From 0879dade786b6dc94fcca9f62edb74387abcc6ed Mon Sep 17 00:00:00 2001 From: marco_giraldi Date: Fri, 10 Jan 2020 11:55:54 +0100 Subject: [PATCH] Built motion from commit (unavailable).|2.4.1 --- 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 +- 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/intSalesforceAccount/index.js | 2 +- .../intSalesforceAccount.attributes.js | 2 +- .../intSalesforceAccount.controller.js | 2 +- .../intSalesforceAccount.model.js | 2 +- .../intSalesforceAccount.rpc.js | 2 +- server/api/intSalesforceConfiguration/index.js | 2 +- .../intSalesforceConfiguration.attributes.js | 2 +- .../intSalesforceConfiguration.controller.js | 2 +- .../intSalesforceConfiguration.model.js | 2 +- .../intSalesforceConfiguration.rpc.js | 2 +- server/api/intSalesforceField/index.js | 2 +- .../intSalesforceField.attributes.js | 2 +- .../intSalesforceField.controller.js | 2 +- .../intSalesforceField/intSalesforceField.model.js | 2 +- .../intSalesforceField/intSalesforceField.rpc.js | 2 +- server/api/intServicenowAccount/index.js | 2 +- .../intServicenowAccount.attributes.js | 2 +- .../intServicenowAccount.controller.js | 2 +- .../intServicenowAccount.model.js | 2 +- .../intServicenowAccount.rpc.js | 2 +- server/api/intServicenowConfiguration/index.js | 2 +- .../intServicenowConfiguration.attributes.js | 2 +- .../intServicenowConfiguration.controller.js | 2 +- .../intServicenowConfiguration.model.js | 2 +- .../intServicenowConfiguration.rpc.js | 2 +- server/api/intServicenowField/index.js | 2 +- .../intServicenowField.attributes.js | 2 +- .../intServicenowField.controller.js | 2 +- .../intServicenowField/intServicenowField.model.js | 2 +- .../intServicenowField/intServicenowField.rpc.js | 2 +- server/api/intSugarcrmAccount/index.js | 2 +- .../intSugarcrmAccount.attributes.js | 2 +- .../intSugarcrmAccount.controller.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.model.js | 2 +- .../intSugarcrmAccount/intSugarcrmAccount.rpc.js | 2 +- server/api/intSugarcrmConfiguration/index.js | 2 +- .../intSugarcrmConfiguration.attributes.js | 2 +- .../intSugarcrmConfiguration.controller.js | 2 +- .../intSugarcrmConfiguration.model.js | 2 +- .../intSugarcrmConfiguration.rpc.js | 2 +- server/api/intSugarcrmField/index.js | 2 +- .../intSugarcrmField.attributes.js | 2 +- .../intSugarcrmField.controller.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.model.js | 2 +- .../api/intSugarcrmField/intSugarcrmField.rpc.js | 2 +- server/api/intVtigerAccount/index.js | 2 +- .../intVtigerAccount.attributes.js | 2 +- .../intVtigerAccount.controller.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.model.js | 2 +- .../api/intVtigerAccount/intVtigerAccount.rpc.js | 2 +- server/api/intVtigerConfiguration/index.js | 2 +- .../intVtigerConfiguration.attributes.js | 2 +- .../intVtigerConfiguration.controller.js | 2 +- .../intVtigerConfiguration.model.js | 2 +- .../intVtigerConfiguration.rpc.js | 2 +- server/api/intVtigerField/index.js | 2 +- .../intVtigerField/intVtigerField.attributes.js | 2 +- .../intVtigerField/intVtigerField.controller.js | 2 +- server/api/intVtigerField/intVtigerField.model.js | 2 +- server/api/intVtigerField/intVtigerField.rpc.js | 2 +- server/api/intZendeskAccount/index.js | 2 +- .../intZendeskAccount.attributes.js | 2 +- .../intZendeskAccount.controller.js | 2 +- .../intZendeskAccount/intZendeskAccount.model.js | 2 +- .../api/intZendeskAccount/intZendeskAccount.rpc.js | 2 +- server/api/intZendeskConfiguration/index.js | 2 +- .../intZendeskConfiguration.attributes.js | 2 +- .../intZendeskConfiguration.controller.js | 2 +- .../intZendeskConfiguration.model.js | 2 +- .../intZendeskConfiguration.rpc.js | 2 +- server/api/intZendeskField/index.js | 2 +- .../intZendeskField/intZendeskField.attributes.js | 2 +- .../intZendeskField/intZendeskField.controller.js | 2 +- .../api/intZendeskField/intZendeskField.model.js | 2 +- server/api/intZendeskField/intZendeskField.rpc.js | 2 +- server/api/intZohoAccount/index.js | 2 +- .../intZohoAccount/intZohoAccount.attributes.js | 2 +- .../intZohoAccount/intZohoAccount.controller.js | 2 +- server/api/intZohoAccount/intZohoAccount.model.js | 2 +- server/api/intZohoAccount/intZohoAccount.rpc.js | 2 +- server/api/intZohoConfiguration/index.js | 2 +- .../intZohoConfiguration.attributes.js | 2 +- .../intZohoConfiguration.controller.js | 2 +- .../intZohoConfiguration.model.js | 2 +- .../intZohoConfiguration.rpc.js | 2 +- server/api/intZohoField/index.js | 2 +- server/api/intZohoField/intZohoField.attributes.js | 2 +- server/api/intZohoField/intZohoField.controller.js | 2 +- server/api/intZohoField/intZohoField.model.js | 2 +- server/api/intZohoField/intZohoField.rpc.js | 2 +- server/api/integration/index.js | 2 +- server/api/integration/integration.attributes.js | 2 +- server/api/integration/integration.controller.js | 2 +- server/api/integration/integration.model.js | 2 +- server/api/integration/integration.rpc.js | 2 +- server/api/integrationReport/index.js | 2 +- .../integrationReport.attributes.js | 2 +- .../integrationReport.controller.js | 2 +- .../integrationReport/integrationReport.model.js | 2 +- .../api/integrationReport/integrationReport.rpc.js | 2 +- server/api/interval/index.js | 2 +- server/api/interval/interval.attributes.js | 2 +- server/api/interval/interval.controller.js | 2 +- server/api/interval/interval.model.js | 2 +- server/api/interval/interval.rpc.js | 2 +- server/api/jira/index.js | 2 +- server/api/jira/jira.controller.js | 2 +- server/api/jscriptyAnswerReport/index.js | 2 +- .../jscriptyAnswerReport.attributes.js | 2 +- .../jscriptyAnswerReport.controller.js | 2 +- .../jscriptyAnswerReport.model.js | 2 +- .../jscriptyAnswerReport.rpc.js | 2 +- server/api/jscriptyProject/index.js | 2 +- .../jscriptyProject/jscriptyProject.attributes.js | 2 +- .../jscriptyProject/jscriptyProject.controller.js | 2 +- .../api/jscriptyProject/jscriptyProject.model.js | 2 +- server/api/jscriptyProject/jscriptyProject.rpc.js | 2 +- server/api/jscriptyQuestionReport/index.js | 2 +- .../jscriptyQuestionReport.attributes.js | 2 +- .../jscriptyQuestionReport.controller.js | 2 +- .../jscriptyQuestionReport.model.js | 2 +- .../jscriptyQuestionReport.rpc.js | 2 +- server/api/jscriptySessionReport/index.js | 2 +- .../jscriptySessionReport.attributes.js | 2 +- .../jscriptySessionReport.controller.js | 2 +- .../jscriptySessionReport.model.js | 2 +- .../jscriptySessionReport.rpc.js | 2 +- server/api/license/index.js | 2 +- server/api/license/license.attributes.js | 2 +- server/api/license/license.controller.js | 2 +- server/api/license/license.model.js | 2 +- server/api/license/license.rpc.js | 2 +- server/api/mailAccount/index.js | 2 +- server/api/mailAccount/mailAccount.attributes.js | 2 +- server/api/mailAccount/mailAccount.controller.js | 2 +- server/api/mailAccount/mailAccount.events.js | 2 +- server/api/mailAccount/mailAccount.model.js | 2 +- server/api/mailAccount/mailAccount.rpc.js | 2 +- server/api/mailAccount/mailAccount.socket.js | 2 +- server/api/mailApplication/index.js | 2 +- .../mailApplication/mailApplication.attributes.js | 2 +- .../mailApplication/mailApplication.controller.js | 2 +- .../api/mailApplication/mailApplication.model.js | 2 +- server/api/mailApplication/mailApplication.rpc.js | 2 +- server/api/mailInteraction/index.js | 2 +- .../mailInteraction/mailInteraction.attributes.js | 2 +- .../mailInteraction/mailInteraction.controller.js | 2 +- .../api/mailInteraction/mailInteraction.events.js | 2 +- .../api/mailInteraction/mailInteraction.model.js | 2 +- server/api/mailInteraction/mailInteraction.rpc.js | 2 +- .../api/mailInteraction/mailInteraction.socket.js | 2 +- server/api/mailMessage/index.js | 2 +- server/api/mailMessage/mailMessage.attributes.js | 2 +- server/api/mailMessage/mailMessage.controller.js | 2 +- server/api/mailMessage/mailMessage.events.js | 2 +- server/api/mailMessage/mailMessage.model.js | 2 +- server/api/mailMessage/mailMessage.rpc.js | 2 +- server/api/mailMessage/mailMessage.socket.js | 2 +- server/api/mailQueue/index.js | 2 +- server/api/mailQueue/mailQueue.attributes.js | 2 +- server/api/mailQueue/mailQueue.controller.js | 2 +- server/api/mailQueue/mailQueue.events.js | 2 +- server/api/mailQueue/mailQueue.model.js | 2 +- server/api/mailQueue/mailQueue.rpc.js | 2 +- server/api/mailQueue/mailQueue.socket.js | 2 +- server/api/mailQueueReport/index.js | 2 +- .../mailQueueReport/mailQueueReport.attributes.js | 2 +- .../mailQueueReport/mailQueueReport.controller.js | 2 +- .../api/mailQueueReport/mailQueueReport.model.js | 2 +- server/api/mailQueueReport/mailQueueReport.rpc.js | 2 +- server/api/mailServerIn/index.js | 2 +- server/api/mailServerIn/mailServerIn.attributes.js | 2 +- server/api/mailServerIn/mailServerIn.model.js | 2 +- server/api/mailServerIn/mailServerIn.rpc.js | 2 +- server/api/mailServerOut/index.js | 2 +- .../api/mailServerOut/mailServerOut.attributes.js | 2 +- .../api/mailServerOut/mailServerOut.controller.js | 2 +- server/api/mailServerOut/mailServerOut.model.js | 2 +- server/api/mailServerOut/mailServerOut.rpc.js | 2 +- server/api/mailSubstatus/index.js | 2 +- .../api/mailSubstatus/mailSubstatus.attributes.js | 2 +- .../api/mailSubstatus/mailSubstatus.controller.js | 2 +- server/api/mailSubstatus/mailSubstatus.model.js | 2 +- server/api/mailSubstatus/mailSubstatus.rpc.js | 2 +- server/api/mailTransferReport/index.js | 2 +- .../mailTransferReport.attributes.js | 2 +- .../mailTransferReport.controller.js | 2 +- .../mailTransferReport/mailTransferReport.model.js | 2 +- .../mailTransferReport/mailTransferReport.rpc.js | 2 +- server/api/memberReport/index.js | 2 +- server/api/memberReport/memberReport.attributes.js | 2 +- server/api/memberReport/memberReport.controller.js | 2 +- server/api/memberReport/memberReport.model.js | 2 +- server/api/memberReport/memberReport.rpc.js | 2 +- server/api/migration/index.js | 2 +- server/api/migration/migration.attributes.js | 2 +- server/api/migration/migration.controller.js | 2 +- server/api/migration/migration.model.js | 2 +- server/api/migration/migration.rpc.js | 2 +- server/api/network/index.js | 2 +- server/api/network/network.attributes.js | 2 +- server/api/network/network.controller.js | 2 +- server/api/network/network.model.js | 2 +- server/api/network/network.rpc.js | 2 +- server/api/openchannelAccount/index.js | 2 +- .../openchannelAccount.attributes.js | 2 +- .../openchannelAccount.controller.js | 2 +- .../openchannelAccount.events.js | 2 +- .../openchannelAccount/openchannelAccount.model.js | 2 +- .../openchannelAccount/openchannelAccount.rpc.js | 2 +- .../openchannelAccount.socket.js | 2 +- server/api/openchannelApplication/index.js | 2 +- .../openchannelApplication.attributes.js | 2 +- .../openchannelApplication.controller.js | 2 +- .../openchannelApplication.model.js | 2 +- .../openchannelApplication.rpc.js | 2 +- server/api/openchannelInteraction/index.js | 2 +- .../openchannelInteraction.attributes.js | 2 +- .../openchannelInteraction.controller.js | 2 +- .../openchannelInteraction.events.js | 2 +- .../openchannelInteraction.model.js | 2 +- .../openchannelInteraction.rpc.js | 2 +- .../openchannelInteraction.socket.js | 2 +- server/api/openchannelMessage/index.js | 2 +- .../openchannelMessage.attributes.js | 2 +- .../openchannelMessage.controller.js | 2 +- .../openchannelMessage.events.js | 2 +- .../openchannelMessage/openchannelMessage.model.js | 2 +- .../openchannelMessage/openchannelMessage.rpc.js | 2 +- .../openchannelMessage.socket.js | 2 +- server/api/openchannelQueue/index.js | 2 +- .../openchannelQueue.attributes.js | 2 +- .../openchannelQueue.controller.js | 2 +- .../openchannelQueue/openchannelQueue.events.js | 2 +- .../api/openchannelQueue/openchannelQueue.model.js | 2 +- .../api/openchannelQueue/openchannelQueue.rpc.js | 2 +- .../openchannelQueue/openchannelQueue.socket.js | 2 +- server/api/openchannelQueueReport/index.js | 2 +- .../openchannelQueueReport.attributes.js | 2 +- .../openchannelQueueReport.controller.js | 2 +- .../openchannelQueueReport.model.js | 2 +- .../openchannelQueueReport.rpc.js | 2 +- server/api/openchannelTransferReport/index.js | 2 +- .../openchannelTransferReport.attributes.js | 2 +- .../openchannelTransferReport.controller.js | 2 +- .../openchannelTransferReport.model.js | 2 +- .../openchannelTransferReport.rpc.js | 2 +- server/api/pause/index.js | 2 +- server/api/pause/pause.attributes.js | 2 +- server/api/pause/pause.controller.js | 2 +- server/api/pause/pause.model.js | 2 +- server/api/pause/pause.rpc.js | 2 +- server/api/plugin/index.js | 2 +- server/api/plugin/plugin.attributes.js | 2 +- server/api/plugin/plugin.controller.js | 2 +- server/api/plugin/plugin.events.js | 2 +- server/api/plugin/plugin.model.js | 2 +- server/api/plugin/plugin.rpc.js | 2 +- server/api/plugin/plugin.socket.js | 2 +- server/api/pm2/index.js | 2 +- server/api/pm2/pm2.controller.js | 2 +- server/api/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 +- 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/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 +- 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/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/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/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/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/files/chat/iframe.js | 6 +- 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/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/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/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 +- 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/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/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 +- .../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 +- .../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 +- snippet/1.0.14/styles/custom.css | 396 ++++++++++++++++++++ snippet/1.0.14/styles/mobile.css | 140 +++++++ 1054 files changed, 1590 insertions(+), 1054 deletions(-) create mode 100644 snippet/1.0.14/styles/custom.css create mode 100644 snippet/1.0.14/styles/mobile.css diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 95fceb7..321a043 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-01-10T10:00:42.026Z", + "time": "2020-01-10T10:49:54.198Z", "url": "http://apidocjs.com", "version": "0.19.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 4dd3a59..359b23b 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-01-10T10:00:42.026Z", + "time": "2020-01-10T10:49:54.198Z", "url": "http://apidocjs.com", "version": "0.19.1" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 18837a7..623cbc8 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 _0x3e74=['contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','sequelize','VIRTUAL','getDataValue','contactManager','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING'];(function(_0x736eb,_0x345088){var _0x30ea13=function(_0xbdab7c){while(--_0xbdab7c){_0x736eb['push'](_0x736eb['shift']());}};_0x30ea13(++_0x345088);}(_0x3e74,0x175));var _0x43e7=function(_0x30a8c9,_0xde459d){_0x30a8c9=_0x30a8c9-0x0;var _0x43e716=_0x3e74[_0x30a8c9];return _0x43e716;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'get':function(_0x287a1d){return this[_0x43e7('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x43e7('0x3'),'integration',_0x43e7('0x4'),_0x43e7('0x5'),_0x43e7('0x6'),_0x43e7('0x7'),_0x43e7('0x8'),'script']],'msg':_0x43e7('0x9')}},'comment':_0x43e7('0x9')},'data1':{'type':Sequelize[_0x43e7('0xa')](0x1000),'comment':_0x43e7('0xb')},'data2':{'type':Sequelize[_0x43e7('0xa')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x43e7('0xa')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x43e7('0xa')](0x1000)},'data6':{'type':Sequelize[_0x43e7('0xa')]},'data7':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x70e0=['TEXT','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','jscripty','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0xb28715,_0xc1dd7a){var _0x2eb60d=function(_0x195bc7){while(--_0x195bc7){_0xb28715['push'](_0xb28715['shift']());}};_0x2eb60d(++_0xc1dd7a);}(_0x70e0,0x17b));var _0x070e=function(_0x18e0f7,_0x11dbcf){_0x18e0f7=_0x18e0f7-0x0;var _0x42e5c7=_0x70e0[_0x18e0f7];return _0x42e5c7;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')],'get':function(_0x4d95bb){return this['getDataValue'](_0x070e('0x3'));}},'action':{'type':Sequelize[_0x070e('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x070e('0x5'),_0x070e('0x6'),'motionbar',_0x070e('0x7'),'urlForward',_0x070e('0x8'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x070e('0x9')},'data1':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xa')},'data2':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xb')},'data3':{'type':Sequelize[_0x070e('0x4')](0x1000),'comment':_0x070e('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0x070e('0x4')]},'data7':{'type':Sequelize[_0x070e('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 5fd5a05..af54145 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 _0x7657=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','error','stack','name','send','update','body','find','Action','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x2cca4b,_0xe7d3a0){var _0x14d601=function(_0x16d8b0){while(--_0x16d8b0){_0x2cca4b['push'](_0x2cca4b['shift']());}};_0x14d601(++_0xe7d3a0);}(_0x7657,0xef));var _0x7765=function(_0x5e6814,_0x3ec4e9){_0x5e6814=_0x5e6814-0x0;var _0x2b9187=_0x7657[_0x5e6814];return _0x2b9187;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7765('0x0'));var rimraf=require(_0x7765('0x1'));var zipdir=require(_0x7765('0x2'));var jsonpatch=require(_0x7765('0x3'));var rp=require(_0x7765('0x4'));var moment=require('moment');var BPromise=require(_0x7765('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7765('0x6'));var ejs=require(_0x7765('0x7'));var fs=require('fs');var _=require(_0x7765('0x8'));var squel=require('squel');var crypto=require(_0x7765('0x9'));var jsforce=require(_0x7765('0xa'));var deskjs=require(_0x7765('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7765('0xc'));var Redis=require(_0x7765('0xd'));var authService=require(_0x7765('0xe'));var qs=require(_0x7765('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7765('0x10'))(_0x7765('0x11'));var utils=require(_0x7765('0x12'));var config=require(_0x7765('0x13'));var db=require(_0x7765('0x14'))['db'];function respondWithStatusCode(_0x5a5196,_0x39f5d3){_0x39f5d3=_0x39f5d3||0xcc;return function(_0x26f502){if(_0x26f502){return _0x5a5196[_0x7765('0x15')](_0x39f5d3);}return _0x5a5196[_0x7765('0x16')](_0x39f5d3)[_0x7765('0x17')]();};}function respondWithResult(_0x5014a0,_0x490bbf){_0x490bbf=_0x490bbf||0xc8;return function(_0x33701a){if(_0x33701a){return _0x5014a0[_0x7765('0x16')](_0x490bbf)[_0x7765('0x18')](_0x33701a);}};}function respondWithFilteredResult(_0x5923fe,_0x379214){return function(_0x411558){if(_0x411558){var _0x28c9c3=_0x411558[_0x7765('0x19')],_0x4f4757=_0x379214[_0x7765('0x1a')],_0x2e7113=_0x379214[_0x7765('0x1a')]+_0x379214[_0x7765('0x1b')],_0x3a9cef;if(_0x2e7113>=_0x28c9c3){_0x2e7113=_0x28c9c3;_0x3a9cef=0xc8;}else{_0x3a9cef=0xce;}_0x5923fe['status'](_0x3a9cef);return _0x5923fe[_0x7765('0x1c')](_0x7765('0x1d'),_0x4f4757+'-'+_0x2e7113+'/'+_0x28c9c3)[_0x7765('0x18')](_0x411558);}return null;};}function patchUpdates(_0x54d406){return function(_0x2c7cb5){try{jsonpatch['apply'](_0x2c7cb5,_0x54d406,!![]);}catch(_0x55ea06){return BPromise[_0x7765('0x1e')](_0x55ea06);}return _0x2c7cb5[_0x7765('0x1f')]();};}function saveUpdates(_0x10a3f2,_0x1e285b){return function(_0x41f8ee){if(_0x41f8ee){return _0x41f8ee['update'](_0x10a3f2)[_0x7765('0x20')](function(_0x289d36){return _0x289d36;});}return null;};}function removeEntity(_0x1dc37e,_0x44a8a4){return function(_0x37ed0b){if(_0x37ed0b){return _0x37ed0b['destroy']()[_0x7765('0x20')](function(){_0x1dc37e[_0x7765('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d182,_0x5dbff3){return function(_0xa50b85){if(!_0xa50b85){_0x44d182[_0x7765('0x15')](0x194);}return _0xa50b85;};}function handleError(_0x5741b4,_0x726c7a){_0x726c7a=_0x726c7a||0x1f4;return function(_0x50125e){logger[_0x7765('0x21')](_0x50125e[_0x7765('0x22')]);if(_0x50125e[_0x7765('0x23')]){delete _0x50125e[_0x7765('0x23')];}_0x5741b4[_0x7765('0x16')](_0x726c7a)[_0x7765('0x24')](_0x50125e);};}exports[_0x7765('0x25')]=function(_0x517e36,_0x45d2c6){if(_0x517e36[_0x7765('0x26')]['id']){delete _0x517e36['body']['id'];}return db['Action'][_0x7765('0x27')]({'where':{'id':_0x517e36['params']['id']}})[_0x7765('0x20')](handleEntityNotFound(_0x45d2c6,null))['then'](saveUpdates(_0x517e36[_0x7765('0x26')],null))[_0x7765('0x20')](respondWithResult(_0x45d2c6,null))['catch'](handleError(_0x45d2c6,null));};exports['destroy']=function(_0x1979ce,_0x4e5ce8){return db[_0x7765('0x28')]['find']({'where':{'id':_0x1979ce['params']['id']}})[_0x7765('0x20')](handleEntityNotFound(_0x4e5ce8,null))[_0x7765('0x20')](removeEntity(_0x4e5ce8,null))[_0x7765('0x29')](handleError(_0x4e5ce8,null));}; \ No newline at end of file +var _0x7d0c=['../../config/environment','../../mysqldb','sendStatus','json','count','offset','status','set','Content-Range','apply','update','destroy','error','stack','name','send','Action','find','then','catch','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x36ae15,_0x26435f){var _0x3a9497=function(_0x31756c){while(--_0x31756c){_0x36ae15['push'](_0x36ae15['shift']());}};_0x3a9497(++_0x26435f);}(_0x7d0c,0x1b9));var _0xc7d0=function(_0x3a557a,_0xe7c178){_0x3a557a=_0x3a557a-0x0;var _0x4b80cd=_0x7d0c[_0x3a557a];return _0x4b80cd;};'use strict';var pdf=require(_0xc7d0('0x0'));var emlformat=require(_0xc7d0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc7d0('0x2'));var jsonpatch=require(_0xc7d0('0x3'));var rp=require(_0xc7d0('0x4'));var moment=require('moment');var BPromise=require(_0xc7d0('0x5'));var Mustache=require('mustache');var util=require(_0xc7d0('0x6'));var path=require(_0xc7d0('0x7'));var sox=require(_0xc7d0('0x8'));var csv=require(_0xc7d0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc7d0('0xa'));var squel=require(_0xc7d0('0xb'));var crypto=require(_0xc7d0('0xc'));var jsforce=require(_0xc7d0('0xd'));var deskjs=require(_0xc7d0('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc7d0('0xf'));var Papa=require('papaparse');var Redis=require(_0xc7d0('0x10'));var authService=require(_0xc7d0('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc7d0('0x12'));var logger=require(_0xc7d0('0x13'))(_0xc7d0('0x14'));var utils=require('../../config/utils');var config=require(_0xc7d0('0x15'));var db=require(_0xc7d0('0x16'))['db'];function respondWithStatusCode(_0x357309,_0x26473f){_0x26473f=_0x26473f||0xcc;return function(_0x5f3693){if(_0x5f3693){return _0x357309[_0xc7d0('0x17')](_0x26473f);}return _0x357309['status'](_0x26473f)['end']();};}function respondWithResult(_0x2247b3,_0xb82996){_0xb82996=_0xb82996||0xc8;return function(_0xdc4482){if(_0xdc4482){return _0x2247b3['status'](_0xb82996)[_0xc7d0('0x18')](_0xdc4482);}};}function respondWithFilteredResult(_0xc0b988,_0x330cac){return function(_0x213e85){if(_0x213e85){var _0x30d1ee=_0x213e85[_0xc7d0('0x19')],_0x2ca947=_0x330cac[_0xc7d0('0x1a')],_0x262c85=_0x330cac[_0xc7d0('0x1a')]+_0x330cac['limit'],_0x468a05;if(_0x262c85>=_0x30d1ee){_0x262c85=_0x30d1ee;_0x468a05=0xc8;}else{_0x468a05=0xce;}_0xc0b988[_0xc7d0('0x1b')](_0x468a05);return _0xc0b988[_0xc7d0('0x1c')](_0xc7d0('0x1d'),_0x2ca947+'-'+_0x262c85+'/'+_0x30d1ee)[_0xc7d0('0x18')](_0x213e85);}return null;};}function patchUpdates(_0x532da0){return function(_0x407f28){try{jsonpatch[_0xc7d0('0x1e')](_0x407f28,_0x532da0,!![]);}catch(_0x5aa664){return BPromise['reject'](_0x5aa664);}return _0x407f28['save']();};}function saveUpdates(_0x42f920,_0x93339d){return function(_0x1093a0){if(_0x1093a0){return _0x1093a0[_0xc7d0('0x1f')](_0x42f920)['then'](function(_0x286df0){return _0x286df0;});}return null;};}function removeEntity(_0x9d93b2,_0x47324e){return function(_0x3fac7f){if(_0x3fac7f){return _0x3fac7f[_0xc7d0('0x20')]()['then'](function(){_0x9d93b2[_0xc7d0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x381b50,_0x3060c1){return function(_0x7d8353){if(!_0x7d8353){_0x381b50[_0xc7d0('0x17')](0x194);}return _0x7d8353;};}function handleError(_0x5cfe24,_0xf7e737){_0xf7e737=_0xf7e737||0x1f4;return function(_0x2c100e){logger[_0xc7d0('0x21')](_0x2c100e[_0xc7d0('0x22')]);if(_0x2c100e[_0xc7d0('0x23')]){delete _0x2c100e[_0xc7d0('0x23')];}_0x5cfe24[_0xc7d0('0x1b')](_0xf7e737)[_0xc7d0('0x24')](_0x2c100e);};}exports['update']=function(_0x4f6c98,_0x4155ec){if(_0x4f6c98['body']['id']){delete _0x4f6c98['body']['id'];}return db[_0xc7d0('0x25')][_0xc7d0('0x26')]({'where':{'id':_0x4f6c98['params']['id']}})[_0xc7d0('0x27')](handleEntityNotFound(_0x4155ec,null))[_0xc7d0('0x27')](saveUpdates(_0x4f6c98['body'],null))[_0xc7d0('0x27')](respondWithResult(_0x4155ec,null))[_0xc7d0('0x28')](handleError(_0x4155ec,null));};exports[_0xc7d0('0x20')]=function(_0xde906b,_0x579dfc){return db[_0xc7d0('0x25')][_0xc7d0('0x26')]({'where':{'id':_0xde906b[_0xc7d0('0x29')]['id']}})[_0xc7d0('0x27')](handleEntityNotFound(_0x579dfc,null))[_0xc7d0('0x27')](removeEntity(_0x579dfc,null))['catch'](handleError(_0x579dfc,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 8dcfd66..c0d39b2 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 _0x23c6=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','tools_actions'];(function(_0x148e00,_0x132e7f){var _0x74549f=function(_0x3ddd6c){while(--_0x3ddd6c){_0x148e00['push'](_0x148e00['shift']());}};_0x74549f(++_0x132e7f);}(_0x23c6,0x13f));var _0x623c=function(_0x17c41f,_0x432dcb){_0x17c41f=_0x17c41f-0x0;var _0x2d4942=_0x23c6[_0x17c41f];return _0x2d4942;};'use strict';var _=require(_0x623c('0x0'));var util=require(_0x623c('0x1'));var logger=require(_0x623c('0x2'))(_0x623c('0x3'));var moment=require(_0x623c('0x4'));var BPromise=require(_0x623c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x623c('0x6'));var config=require(_0x623c('0x7'));var attributes=require('./action.attributes');module[_0x623c('0x8')]=function(_0x1d8788,_0x48d4ad){return _0x1d8788[_0x623c('0x9')]('Action',attributes,{'tableName':_0x623c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1412=['request-promise','path','rimraf','../../config/environment','./action.attributes','Action','tools_actions','lodash','../../config/logger','moment'];(function(_0x106b46,_0x5d64bd){var _0x14e43a=function(_0x3623e7){while(--_0x3623e7){_0x106b46['push'](_0x106b46['shift']());}};_0x14e43a(++_0x5d64bd);}(_0x1412,0x147));var _0x2141=function(_0x326c74,_0x3dea14){_0x326c74=_0x326c74-0x0;var _0x2bb4c1=_0x1412[_0x326c74];return _0x2bb4c1;};'use strict';var _=require(_0x2141('0x0'));var util=require('util');var logger=require(_0x2141('0x1'))('api');var moment=require(_0x2141('0x2'));var BPromise=require('bluebird');var rp=require(_0x2141('0x3'));var fs=require('fs');var path=require(_0x2141('0x4'));var rimraf=require(_0x2141('0x5'));var config=require(_0x2141('0x6'));var attributes=require(_0x2141('0x7'));module['exports']=function(_0x4c67fa,_0x12f7bd){return _0x4c67fa['define'](_0x2141('0x8'),attributes,{'tableName':_0x2141('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 fae1ce4..af80b07 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 _0xf53f=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x526f8d,_0x154e1e){var _0x328204=function(_0x18356b){while(--_0x18356b){_0x526f8d['push'](_0x526f8d['shift']());}};_0x328204(++_0x154e1e);}(_0xf53f,0x8d));var _0xff53=function(_0x53f141,_0x9bf255){_0x53f141=_0x53f141-0x0;var _0x19200b=_0xf53f[_0x53f141];return _0x19200b;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var moment=require(_0xff53('0x2'));var BPromise=require(_0xff53('0x3'));var rs=require(_0xff53('0x4'));var fs=require('fs');var Redis=require(_0xff53('0x5'));var db=require(_0xff53('0x6'))['db'];var utils=require(_0xff53('0x7'));var logger=require(_0xff53('0x8'))(_0xff53('0x9'));var config=require(_0xff53('0xa'));var jayson=require(_0xff53('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b397,_0x5751e7,_0x1c27bb){return new BPromise(function(_0x122746,_0x1bc4b3){return client['request'](_0x27b397,_0x1c27bb)['then'](function(_0x3c001d){logger['info'](_0xff53('0xc'),_0x5751e7,_0xff53('0xd'));logger['debug'](_0xff53('0xe'),_0x5751e7,_0xff53('0xd'),JSON['stringify'](_0x3c001d));if(_0x3c001d[_0xff53('0xf')]){if(_0x3c001d[_0xff53('0xf')][_0xff53('0x10')]===0x1f4){logger['error'](_0xff53('0xc'),_0x5751e7,_0x3c001d[_0xff53('0xf')][_0xff53('0x11')]);return _0x1bc4b3(_0x3c001d['error'][_0xff53('0x11')]);}logger[_0xff53('0xf')]('Action,\x20%s,\x20%s',_0x5751e7,_0x3c001d['error']['message']);return _0x122746(_0x3c001d['error'][_0xff53('0x11')]);}else{logger[_0xff53('0x12')](_0xff53('0xc'),_0x5751e7,'request\x20sent');_0x122746(_0x3c001d[_0xff53('0x13')]['message']);}})['catch'](function(_0x12e90b){logger[_0xff53('0xf')](_0xff53('0xc'),_0x5751e7,_0x12e90b);_0x1bc4b3(_0x12e90b);});});} \ No newline at end of file +var _0x867f=['then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x48cb1f,_0x5ca68d){var _0x172c4d=function(_0x85040){while(--_0x85040){_0x48cb1f['push'](_0x48cb1f['shift']());}};_0x172c4d(++_0x5ca68d);}(_0x867f,0xe6));var _0xf867=function(_0x77b868,_0x45ea4b){_0x77b868=_0x77b868-0x0;var _0x1f54ea=_0x867f[_0x77b868];return _0x1f54ea;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841d1,_0x3fe5d1,_0x5c35f9){return new BPromise(function(_0x583f87,_0x26cfba){return client['request'](_0x2841d1,_0x5c35f9)[_0xf867('0xc')](function(_0x2b1c12){logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));logger[_0xf867('0x10')](_0xf867('0x11'),_0x3fe5d1,_0xf867('0xf'),JSON['stringify'](_0x2b1c12));if(_0x2b1c12[_0xf867('0x12')]){if(_0x2b1c12['error']['code']===0x1f4){logger[_0xf867('0x12')](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12[_0xf867('0x12')]['message']);return _0x26cfba(_0x2b1c12['error'][_0xf867('0x13')]);}logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12['error']['message']);return _0x583f87(_0x2b1c12[_0xf867('0x12')][_0xf867('0x13')]);}else{logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));_0x583f87(_0x2b1c12[_0xf867('0x14')][_0xf867('0x13')]);}})[_0xf867('0x15')](function(_0x33c10b){logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x33c10b);_0x26cfba(_0x33c10b);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 92490a5..3c2f5d0 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 _0xc788=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xc788,0xc4));var _0x8c78=function(_0x4c5708,_0x34b1f9){_0x4c5708=_0x4c5708-0x0;var _0x37fa9b=_0xc788[_0x4c5708];return _0x37fa9b;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var auth=require(_0x8c78('0x4'));var interaction=require(_0x8c78('0x5'));var config=require(_0x8c78('0x6'));var controller=require(_0x8c78('0x7'));router['put'](_0x8c78('0x8'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0xb')](_0x8c78('0x8'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);module[_0x8c78('0xd')]=router; \ No newline at end of file +var _0x3176=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x12c95a,_0x389722){var _0x3f0e3f=function(_0x4d0b23){while(--_0x4d0b23){_0x12c95a['push'](_0x12c95a['shift']());}};_0x3f0e3f(++_0x389722);}(_0x3176,0x1d8));var _0x6317=function(_0x3b419d,_0x204897){_0x3b419d=_0x3b419d-0x0;var _0x2a222a=_0x3176[_0x3b419d];return _0x2a222a;};'use strict';var multer=require(_0x6317('0x0'));var util=require(_0x6317('0x1'));var path=require(_0x6317('0x2'));var timeout=require(_0x6317('0x3'));var express=require(_0x6317('0x4'));var router=express[_0x6317('0x5')]();var auth=require(_0x6317('0x6'));var interaction=require(_0x6317('0x7'));var config=require(_0x6317('0x8'));var controller=require(_0x6317('0x9'));router[_0x6317('0xa')](_0x6317('0xb'),auth[_0x6317('0xc')](),controller[_0x6317('0xd')]);router[_0x6317('0xe')](_0x6317('0xb'),auth['isAuthenticated'](),controller[_0x6317('0xf')]);module[_0x6317('0x10')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 79262e4..1665847 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 _0x6e16=['STRING','TEXT','sequelize','exports'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0x6e16,0xca));var _0x66e1=function(_0x498e43,_0x35f181){_0x498e43=_0x498e43-0x0;var _0xa0e361=_0x6e16[_0x498e43];return _0xa0e361;};'use strict';var Sequelize=require(_0x66e1('0x0'));module[_0x66e1('0x1')]={'name':{'type':Sequelize[_0x66e1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x66e1('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x66e1('0x2')]},'conditions':{'type':Sequelize[_0x66e1('0x3')]},'joins':{'type':Sequelize[_0x66e1('0x3')]}}; \ No newline at end of file +var _0x453f=['sequelize','exports','STRING'];(function(_0x34ac09,_0x4c087d){var _0x48ec2f=function(_0x24b7a5){while(--_0x24b7a5){_0x34ac09['push'](_0x34ac09['shift']());}};_0x48ec2f(++_0x4c087d);}(_0x453f,0xb4));var _0xf453=function(_0x17f5ed,_0x408f36){_0x17f5ed=_0x17f5ed-0x0;var _0x4b1692=_0x453f[_0x17f5ed];return _0x4b1692;};'use strict';var Sequelize=require(_0xf453('0x0'));module[_0xf453('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf453('0x2')]},'parent':{'type':Sequelize[_0xf453('0x2')]},'table':{'type':Sequelize[_0xf453('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index eaa6642..f221358 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 _0xe62a=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','AnalyticCustomReport','rawAttributes','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','key','field','options','includeAll','include','rows','catch','params','length','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','foreignTable','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','condition','findAll','table','alias','debug','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../files/reports','savename','countTable','COUNT(*)','run','keyBy','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x3a58ec,_0x4205bb){var _0x2e0660=function(_0x23d07c){while(--_0x23d07c){_0x3a58ec['push'](_0x3a58ec['shift']());}};_0x2e0660(++_0x4205bb);}(_0xe62a,0x143));var _0xae62=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe62a[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0xae62('0x0'));var emlformat=require(_0xae62('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xae62('0x2'));var moment=require(_0xae62('0x3'));var BPromise=require(_0xae62('0x4'));var Mustache=require(_0xae62('0x5'));var util=require(_0xae62('0x6'));var path=require(_0xae62('0x7'));var sox=require(_0xae62('0x8'));var csv=require(_0xae62('0x9'));var ejs=require(_0xae62('0xa'));var fs=require('fs');var _=require(_0xae62('0xb'));var squel=require(_0xae62('0xc'));var crypto=require(_0xae62('0xd'));var jsforce=require(_0xae62('0xe'));var deskjs=require(_0xae62('0xf'));var toCsv=require(_0xae62('0x9'));var querystring=require(_0xae62('0x10'));var Papa=require(_0xae62('0x11'));var Redis=require(_0xae62('0x12'));var authService=require(_0xae62('0x13'));var qs=require(_0xae62('0x14'));var hardwareService=require(_0xae62('0x15'));var logger=require(_0xae62('0x16'))(_0xae62('0x17'));var utils=require(_0xae62('0x18'));var config=require(_0xae62('0x19'));var db=require(_0xae62('0x1a'))['db'];function respondWithStatusCode(_0x55781f,_0x200b6e){_0x200b6e=_0x200b6e||0xcc;return function(_0x206d74){if(_0x206d74){return _0x55781f[_0xae62('0x1b')](_0x200b6e);}return _0x55781f[_0xae62('0x1c')](_0x200b6e)[_0xae62('0x1d')]();};}function respondWithResult(_0x558ee4,_0x5841d2){_0x5841d2=_0x5841d2||0xc8;return function(_0xf6b0b6){if(_0xf6b0b6){return _0x558ee4[_0xae62('0x1c')](_0x5841d2)[_0xae62('0x1e')](_0xf6b0b6);}};}function respondWithFilteredResult(_0x543977,_0x1cf059){return function(_0x133174){if(_0x133174){var _0x407b11=_0x133174[_0xae62('0x1f')],_0xcd57f6=_0x1cf059['offset'],_0x428a6f=_0x1cf059[_0xae62('0x20')]+_0x1cf059[_0xae62('0x21')],_0x5e16c3;if(_0x428a6f>=_0x407b11){_0x428a6f=_0x407b11;_0x5e16c3=0xc8;}else{_0x5e16c3=0xce;}_0x543977[_0xae62('0x1c')](_0x5e16c3);return _0x543977[_0xae62('0x22')]('Content-Range',_0xcd57f6+'-'+_0x428a6f+'/'+_0x407b11)[_0xae62('0x1e')](_0x133174);}return null;};}function patchUpdates(_0x204e7b){return function(_0x56b179){try{jsonpatch['apply'](_0x56b179,_0x204e7b,!![]);}catch(_0x156f2b){return BPromise[_0xae62('0x23')](_0x156f2b);}return _0x56b179[_0xae62('0x24')]();};}function saveUpdates(_0x48305a,_0x3da58c){return function(_0x1df85b){if(_0x1df85b){return _0x1df85b[_0xae62('0x25')](_0x48305a)['then'](function(_0x4528bb){return _0x4528bb;});}return null;};}function removeEntity(_0x12bbbe,_0x3998a1){return function(_0x39278d){if(_0x39278d){return _0x39278d['destroy']()[_0xae62('0x26')](function(){var _0x4d99a6=_0x39278d[_0xae62('0x27')]({'plain':!![]});var _0x37948b=_0xae62('0x28');return db[_0xae62('0x29')][_0xae62('0x2a')]({'where':{'type':_0x37948b,'resourceId':_0x4d99a6['id']}})[_0xae62('0x26')](function(){return _0x39278d;});})[_0xae62('0x26')](function(){_0x12bbbe[_0xae62('0x1c')](0xcc)[_0xae62('0x1d')]();});}};}function handleEntityNotFound(_0x589cef,_0x68f04f){return function(_0x1c6aa5){if(!_0x1c6aa5){_0x589cef[_0xae62('0x1b')](0x194);}return _0x1c6aa5;};}function handleError(_0x4f4ff2,_0x2f341c){_0x2f341c=_0x2f341c||0x1f4;return function(_0xea88f){logger[_0xae62('0x2b')](_0xea88f[_0xae62('0x2c')]);if(_0xea88f[_0xae62('0x2d')]){delete _0xea88f[_0xae62('0x2d')];}_0x4f4ff2[_0xae62('0x1c')](_0x2f341c)[_0xae62('0x2e')](_0xea88f);};}exports['index']=function(_0x1060d0,_0x4301e1){var _0x4bb76b={},_0x30b57b={},_0x6ff222={'count':0x0,'rows':[]};var _0x23790a=db[_0xae62('0x2f')][_0xae62('0x30')];_0x30b57b['model']=_['keys'](_0x23790a);_0x30b57b['query']=_[_0xae62('0x31')](_0x1060d0[_0xae62('0x32')]);_0x30b57b['filters']=_[_0xae62('0x33')](_0x30b57b[_0xae62('0x34')],_0x30b57b['query']);_0x4bb76b[_0xae62('0x35')]=_[_0xae62('0x33')](_0x30b57b[_0xae62('0x34')],qs[_0xae62('0x36')](_0x1060d0[_0xae62('0x32')][_0xae62('0x36')]));_0x4bb76b[_0xae62('0x35')]=_0x4bb76b[_0xae62('0x35')]['length']?_0x4bb76b[_0xae62('0x35')]:_0x30b57b['model'];if(!_0x1060d0[_0xae62('0x32')][_0xae62('0x37')](_0xae62('0x38'))){_0x4bb76b['limit']=qs['limit'](_0x1060d0[_0xae62('0x32')][_0xae62('0x21')]);_0x4bb76b[_0xae62('0x20')]=qs['offset'](_0x1060d0[_0xae62('0x32')][_0xae62('0x20')]);}_0x4bb76b[_0xae62('0x39')]=qs[_0xae62('0x3a')](_0x1060d0[_0xae62('0x32')]['sort']);_0x4bb76b[_0xae62('0x3b')]=qs[_0xae62('0x3c')](_[_0xae62('0x3d')](_0x1060d0[_0xae62('0x32')],_0x30b57b[_0xae62('0x3c')]));if(_0x1060d0[_0xae62('0x32')][_0xae62('0x3e')]){_0x4bb76b['where']=_[_0xae62('0x3f')](_0x4bb76b[_0xae62('0x3b')],{'$or':_['map'](_0x23790a,function(_0x19e906){if(_0x19e906[_0xae62('0x40')][_0xae62('0x41')]!=='VIRTUAL'){var _0x10fb40={};_0x10fb40[_0x19e906[_0xae62('0x42')]]={'$like':'%'+_0x1060d0['query'][_0xae62('0x3e')]+'%'};return _0x10fb40;}})});}_0x4bb76b=_[_0xae62('0x3f')]({},_0x4bb76b,_0x1060d0[_0xae62('0x43')]);var _0x11b8b1={'where':_0x4bb76b[_0xae62('0x3b')]};return db['AnalyticCustomReport'][_0xae62('0x1f')](_0x11b8b1)[_0xae62('0x26')](function(_0x3b20a9){_0x6ff222['count']=_0x3b20a9;if(_0x1060d0['query'][_0xae62('0x44')]){_0x4bb76b[_0xae62('0x45')]=[{'all':!![]}];}return db[_0xae62('0x2f')]['findAll'](_0x4bb76b);})[_0xae62('0x26')](function(_0x4cb888){_0x6ff222[_0xae62('0x46')]=_0x4cb888;return _0x6ff222;})[_0xae62('0x26')](respondWithFilteredResult(_0x4301e1,_0x4bb76b))[_0xae62('0x47')](handleError(_0x4301e1,null));};exports['show']=function(_0x27588a,_0x4520da){var _0x583c74={'raw':![],'where':{'id':_0x27588a[_0xae62('0x48')]['id']}},_0x1f6a7e={};_0x1f6a7e[_0xae62('0x34')]=_[_0xae62('0x31')](db['AnalyticCustomReport'][_0xae62('0x30')]);_0x1f6a7e[_0xae62('0x32')]=_[_0xae62('0x31')](_0x27588a['query']);_0x1f6a7e[_0xae62('0x3c')]=_[_0xae62('0x33')](_0x1f6a7e[_0xae62('0x34')],_0x1f6a7e[_0xae62('0x32')]);_0x583c74[_0xae62('0x35')]=_[_0xae62('0x33')](_0x1f6a7e[_0xae62('0x34')],qs[_0xae62('0x36')](_0x27588a['query'][_0xae62('0x36')]));_0x583c74[_0xae62('0x35')]=_0x583c74[_0xae62('0x35')][_0xae62('0x49')]?_0x583c74['attributes']:_0x1f6a7e['model'];if(_0x27588a[_0xae62('0x32')][_0xae62('0x44')]){_0x583c74[_0xae62('0x45')]=[{'all':!![]}];}_0x583c74=_[_0xae62('0x3f')]({},_0x583c74,_0x27588a[_0xae62('0x43')]);return db['AnalyticCustomReport'][_0xae62('0x4a')](_0x583c74)[_0xae62('0x26')](handleEntityNotFound(_0x4520da,null))['then'](respondWithResult(_0x4520da,null))['catch'](handleError(_0x4520da,null));};exports['create']=function(_0x2738ce,_0x42a873){return db[_0xae62('0x2f')]['create'](_0x2738ce['body'],{})[_0xae62('0x26')](function(_0x2fe994){var _0x400217=_0x2738ce['user'][_0xae62('0x27')]({'plain':!![]});if(!_0x400217)throw new Error(_0xae62('0x4b'));if(_0x400217['role']===_0xae62('0x4c')){var _0x2023c1=_0x2fe994['get']({'plain':!![]});var _0x3be5bd=_0xae62('0x4d');return db[_0xae62('0x4e')][_0xae62('0x4a')]({'where':{'name':_0x3be5bd,'userProfileId':_0x400217['userProfileId']},'raw':!![]})['then'](function(_0x76551f){if(_0x76551f&&_0x76551f[_0xae62('0x4f')]===0x0){return db[_0xae62('0x29')][_0xae62('0x50')]({'name':_0x2023c1['name'],'resourceId':_0x2023c1['id'],'type':'CustomReports','sectionId':_0x76551f['id']},{})[_0xae62('0x26')](function(){return _0x2fe994;});}else{return _0x2fe994;}})[_0xae62('0x47')](function(_0x5c78b6){logger[_0xae62('0x2b')](_0xae62('0x51'),_0x5c78b6);throw _0x5c78b6;});}return _0x2fe994;})['then'](respondWithResult(_0x42a873,0xc9))['catch'](handleError(_0x42a873,null));};exports[_0xae62('0x25')]=function(_0x196c99,_0x13238a){if(_0x196c99[_0xae62('0x52')]['id']){delete _0x196c99[_0xae62('0x52')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x196c99[_0xae62('0x48')]['id']}})['then'](handleEntityNotFound(_0x13238a,null))[_0xae62('0x26')](saveUpdates(_0x196c99[_0xae62('0x52')],null))['then'](respondWithResult(_0x13238a,null))['catch'](handleError(_0x13238a,null));};exports[_0xae62('0x2a')]=function(_0x126c25,_0x1fa4c1){return db[_0xae62('0x2f')][_0xae62('0x4a')]({'where':{'id':_0x126c25[_0xae62('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fa4c1,null))[_0xae62('0x26')](removeEntity(_0x1fa4c1,null))[_0xae62('0x47')](handleError(_0x1fa4c1,null));};exports[_0xae62('0x53')]=function(_0x4832ac,_0x2591fb){var _0x1ba512=0xa;var _0x1db41c=[_0xae62('0x54'),_0xae62('0x55'),'right_join',_0xae62('0x56')];var _0x48a5eb={'SUM':_0xae62('0x57'),'COUNT':_0xae62('0x58'),'COUNT DISTINCT':_0xae62('0x59'),'MAX':_0xae62('0x5a'),'MIN':'MIN(%s)','AVG':_0xae62('0x5b'),'GROUP_CONCAT':_0xae62('0x5c'),'GROUP_CONCAT ASC':_0xae62('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x22c771={'SEC_TO_TIME':_0xae62('0x5e'),'DATE':_0xae62('0x5f'),'HOUR':_0xae62('0x60'),'ROUND':_0xae62('0x61'),'UNIX_TIMESTAMP':_0xae62('0x62')};var _0x315bf5=function(_0x4076ae){return!_[_0xae62('0x63')]([_0xae62('0x64'),_0xae62('0x65'),'IS\x20EMPTY',_0xae62('0x66')],_0x4076ae);};var _0x18cddd=function(_0x7185e4){if(!_0x7185e4||!_0x7185e4[_0xae62('0x67')]['length']){return'';}for(var _0x746d30='(',_0x49c73d=0x0;_0x49c73d<_0x7185e4[_0xae62('0x67')][_0xae62('0x49')];_0x49c73d+=0x1){_0x49c73d>0x0&&(_0x746d30+='\x20'+_0x7185e4[_0xae62('0x68')]+'\x20');_0x746d30+=_0x7185e4['rules'][_0x49c73d]['group']?_0x18cddd(_0x7185e4['rules'][_0x49c73d][_0xae62('0x69')]):_0x7185e4['rules'][_0x49c73d][_0xae62('0x42')]+'\x20'+_0x7185e4[_0xae62('0x67')][_0x49c73d]['condition']+(_0x315bf5(_0x7185e4[_0xae62('0x67')][_0x49c73d]['condition'])?'\x20'+_0x7185e4[_0xae62('0x67')][_0x49c73d][_0xae62('0x6a')]:'');}return _0x746d30+')';};var _0xe9dc8a={'where':{'id':_0x4832ac[_0xae62('0x48')]['id']}},_0x2e3d89,_0x335fea,_0x5d2a95,_0x5e3efc,_0x8bf72;_0xe9dc8a=_[_0xae62('0x3f')]({},_0xe9dc8a,_0x4832ac[_0xae62('0x43')]);return db['AnalyticCustomReport'][_0xae62('0x4a')](_0xe9dc8a)['then'](function(_0x5a3cea){if(_0x5a3cea){_0x2e3d89=_0x5a3cea;return _0x5a3cea[_0xae62('0x6b')]();}return null;})[_0xae62('0x26')](function(_0x456883){if(_0x456883){if(!_0x456883[_0xae62('0x49')]){throw new db[(_0xae62('0x6c'))][(_0xae62('0x6d'))](_0xae62('0x6e'),0x193);}_0x335fea=_0x456883;return db[_0xae62('0x6f')]['findAll']({'raw':!![]});}return null;})[_0xae62('0x26')](function(_0x3dd9aa){if(_0x3dd9aa){_0x5d2a95=_['keyBy'](_0x3dd9aa,'id');var _0x3eb558;var _0x20c921=squel[_0xae62('0x70')]();_0x20c921[_0xae62('0x71')](_0x2e3d89['table']);for(var _0x27940c=0x0;_0x27940c<_0x335fea['length'];_0x27940c+=0x1){_0x3eb558=_0x335fea[_0x27940c][_0xae62('0x72')]?_0x5d2a95[_0x335fea[_0x27940c][_0xae62('0x72')]][_0xae62('0x73')]:_0x335fea[_0x27940c][_0xae62('0x42')];_0x3eb558=_0x335fea[_0x27940c][_0xae62('0x74')]?_[_0xae62('0x75')](_0x48a5eb[_0x335fea[_0x27940c]['function']],'%s',_0x3eb558):_0x3eb558;_0x3eb558=_0x335fea[_0x27940c]['format']?_[_0xae62('0x75')](_0x22c771[_0x335fea[_0x27940c][_0xae62('0x76')]],'%s',_0x3eb558):_0x3eb558;if(_0x335fea[_0x27940c][_0xae62('0x77')]){_0x20c921[_0xae62('0x69')](_0x3eb558);}_0x335fea[_0x27940c][_0xae62('0x78')]&&_0x20c921[_0xae62('0x39')](_0x3eb558,_0x335fea[_0x27940c][_0xae62('0x78')]===_0xae62('0x79')?![]:!![]);_0x20c921[_0xae62('0x42')](_0x3eb558,_0x335fea[_0x27940c]['alias']||_0x3eb558);}if(_0x2e3d89[_0xae62('0x7a')]){_0x2e3d89[_0xae62('0x7a')]=JSON[_0xae62('0x7b')](_0x2e3d89[_0xae62('0x7a')]);for(var _0x54f5f1=0x0;_0x54f5f1<_0x2e3d89[_0xae62('0x7a')]['length'];_0x54f5f1+=0x1){if(_0x2e3d89[_0xae62('0x7a')][_0x54f5f1][_0xae62('0x40')]&&_['includes'](_0x1db41c,_0x2e3d89[_0xae62('0x7a')][_0x54f5f1][_0xae62('0x40')])&&_0x2e3d89[_0xae62('0x7a')][_0x54f5f1]['parentKey']&&_0x2e3d89[_0xae62('0x7a')][_0x54f5f1]['foreignTable']&&_0x2e3d89[_0xae62('0x7a')][_0x54f5f1][_0xae62('0x7c')]){_0x20c921[_0x2e3d89['joins'][_0x54f5f1][_0xae62('0x40')]](_0x2e3d89['joins'][_0x54f5f1]['foreignTable'],null,util['format'](_0xae62('0x7d'),_0x2e3d89['table'],_0x2e3d89['joins'][_0x54f5f1][_0xae62('0x7e')],_0x2e3d89[_0xae62('0x7a')][_0x54f5f1][_0xae62('0x7f')],_0x2e3d89[_0xae62('0x7a')][_0x54f5f1][_0xae62('0x7c')]));}}}if(_0x2e3d89[_0xae62('0x80')]){_0x2e3d89[_0xae62('0x80')]=JSON[_0xae62('0x7b')](_0x2e3d89[_0xae62('0x80')]);_0x20c921[_0xae62('0x3b')](_0x18cddd(_0x2e3d89['conditions']['group']));}_0x8bf72=_0x20c921[_0xae62('0x81')]();_0x20c921[_0xae62('0x21')](_0x1ba512);_0x20c921[_0xae62('0x20')](0x0);logger['debug'](_0xae62('0x82'),_0x20c921[_0xae62('0x83')]());return db['sequelize'][_0xae62('0x32')](_0x20c921[_0xae62('0x83')](),{'type':db[_0xae62('0x84')][_0xae62('0x85')][_0xae62('0x86')]});}})[_0xae62('0x26')](respondWithResult(_0x2591fb,null))[_0xae62('0x47')](handleError(_0x2591fb,null));};function runReport(_0x3fbaa5,_0x2ad440,_0x58e3be){var _0x7ef69a=_0x2ad440[_0xae62('0x2d')];var _0x15c9df=0xa;var _0x310dbf=[_0xae62('0x54'),_0xae62('0x55'),_0xae62('0x87'),_0xae62('0x56')];var _0x1ea24f={'SUM':'SUM(%s)','COUNT':_0xae62('0x58'),'COUNT DISTINCT':_0xae62('0x59'),'MAX':_0xae62('0x5a'),'MIN':_0xae62('0x88'),'AVG':_0xae62('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xae62('0x5d'),'GROUP_CONCAT DESC':_0xae62('0x89')};var _0x5b976c={'SEC_TO_TIME':_0xae62('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xae62('0x61'),'UNIX_TIMESTAMP':_0xae62('0x62')};var _0x32b4ab=function(_0x315f5e){return!_['includes']([_0xae62('0x64'),_0xae62('0x65'),_0xae62('0x8a'),'IS\x20NOT\x20EMPTY'],_0x315f5e);};var _0x49449b=function(_0x144b40){if(!_0x144b40||!_0x144b40[_0xae62('0x67')]['length']){return'';}for(var _0x3f0fe6='(',_0x11c728=0x0;_0x11c728<_0x144b40[_0xae62('0x67')][_0xae62('0x49')];_0x11c728+=0x1){_0x11c728>0x0&&(_0x3f0fe6+='\x20'+_0x144b40['operator']+'\x20');_0x3f0fe6+=_0x144b40['rules'][_0x11c728]['group']?_0x49449b(_0x144b40[_0xae62('0x67')][_0x11c728][_0xae62('0x69')]):_0x144b40['rules'][_0x11c728][_0xae62('0x42')]+'\x20'+_0x144b40[_0xae62('0x67')][_0x11c728][_0xae62('0x8b')]+(_0x32b4ab(_0x144b40['rules'][_0x11c728][_0xae62('0x8b')])?'\x20'+_0x144b40[_0xae62('0x67')][_0x11c728][_0xae62('0x6a')]:'');}return _0x3f0fe6+')';};var _0x40e867={'where':{'id':_0x3fbaa5['id']}},_0x253e07,_0x4a1861,_0x1eec8f,_0xc066c9,_0x5805db;_0x40e867=_[_0xae62('0x3f')]({},_0x40e867,_0x58e3be);return db[_0xae62('0x2f')][_0xae62('0x4a')](_0x40e867)[_0xae62('0x26')](function(_0x2ed31b){if(_0x2ed31b){_0x253e07=_0x2ed31b;return _0x2ed31b[_0xae62('0x6b')]();}return null;})[_0xae62('0x26')](function(_0x406aa5){if(_0x406aa5){if(!_0x406aa5[_0xae62('0x49')]){throw new db[(_0xae62('0x6c'))][(_0xae62('0x6d'))](_0xae62('0x6e'),0x193);}_0x4a1861=_0x406aa5;return db[_0xae62('0x6f')][_0xae62('0x8c')]({'raw':!![]});}return null;})[_0xae62('0x26')](function(_0x459af5){if(_0x459af5){_0x1eec8f=_['keyBy'](_0x459af5,'id');var _0x2338d2;var _0x4eeb80=squel[_0xae62('0x70')]();_0x4eeb80[_0xae62('0x71')](_0x253e07[_0xae62('0x8d')]);for(var _0x687b83=0x0;_0x687b83<_0x4a1861['length'];_0x687b83+=0x1){_0x2338d2=_0x4a1861[_0x687b83][_0xae62('0x72')]?_0x1eec8f[_0x4a1861[_0x687b83]['MetricId']][_0xae62('0x73')]:_0x4a1861[_0x687b83][_0xae62('0x42')];_0x2338d2=_0x4a1861[_0x687b83]['function']?_['replace'](_0x1ea24f[_0x4a1861[_0x687b83]['function']],'%s',_0x2338d2):_0x2338d2;_0x2338d2=_0x4a1861[_0x687b83][_0xae62('0x76')]?_[_0xae62('0x75')](_0x5b976c[_0x4a1861[_0x687b83][_0xae62('0x76')]],'%s',_0x2338d2):_0x2338d2;if(_0x4a1861[_0x687b83][_0xae62('0x77')]){_0x4eeb80[_0xae62('0x69')](_0x2338d2);}_0x4a1861[_0x687b83][_0xae62('0x78')]&&_0x4eeb80[_0xae62('0x39')](_0x2338d2,_0x4a1861[_0x687b83]['orderBy']===_0xae62('0x79')?![]:!![]);_0x4eeb80[_0xae62('0x42')](_0x2338d2,_0x4a1861[_0x687b83][_0xae62('0x8e')]||_0x2338d2);}if(_0x253e07[_0xae62('0x7a')]){_0x253e07[_0xae62('0x7a')]=JSON['parse'](_0x253e07['joins']);for(var _0x4b10c1=0x0;_0x4b10c1<_0x253e07[_0xae62('0x7a')][_0xae62('0x49')];_0x4b10c1+=0x1){if(_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x40')]&&_[_0xae62('0x63')](_0x310dbf,_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x40')])&&_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x7e')]&&_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x7f')]&&_0x253e07['joins'][_0x4b10c1][_0xae62('0x7c')]){_0x4eeb80[_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x40')]](_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x7f')],null,util[_0xae62('0x76')](_0xae62('0x7d'),_0x253e07[_0xae62('0x8d')],_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x7e')],_0x253e07[_0xae62('0x7a')][_0x4b10c1][_0xae62('0x7f')],_0x253e07[_0xae62('0x7a')][_0x4b10c1]['foreignKey']));}}}if(_0x253e07['conditions']){_0x253e07['conditions']=JSON[_0xae62('0x7b')](_0x253e07[_0xae62('0x80')]);_0x4eeb80[_0xae62('0x3b')](_0x49449b(_0x253e07[_0xae62('0x80')][_0xae62('0x69')]));}_0x5805db=_0x4eeb80['clone']();_0x4eeb80[_0xae62('0x21')](_0x15c9df);_0x4eeb80[_0xae62('0x20')](0x0);logger[_0xae62('0x8f')]('Limited\x20Query:',_0x4eeb80['toString']());return db[_0xae62('0x84')][_0xae62('0x32')](_0x4eeb80['toString'](),{'type':db[_0xae62('0x84')]['QueryTypes'][_0xae62('0x86')]});}})[_0xae62('0x26')](function(_0x4dc3de){if(!_0x4dc3de[_0xae62('0x49')]){throw new db[(_0xae62('0x6c'))][(_0xae62('0x6d'))](_0xae62('0x90'),0xcc);}if(_0x2ad440[_0xae62('0x91')]===_0xae62('0x92')){return null;}var _0x49bae2=_['merge'](_0x2ad440,{'name':_0x2ad440['fullPath']||_0x2ad440[_0xae62('0x2d')]||_0x253e07['name'],'basename':_0x7ef69a,'savename':util[_0xae62('0x76')](_0xae62('0x93'),_0x2ad440[_0xae62('0x2d')]||_0x253e07['name'],require(_0xae62('0x94'))[_0xae62('0x95')](0x4),_0x2ad440[_0xae62('0x91')]||_0xae62('0x96')),'reportId':_0x253e07['id'],'reportType':_0xae62('0x97')});return db[_0xae62('0x98')][_0xae62('0x50')](_0x49bae2,{'raw':!![]});})['then'](function(_0x5a8421){if(_0x253e07['table']===_0xae62('0x99')){_0x5805db['where'](_0x253e07['table']+_0xae62('0x9a'),_0x2ad440[_0xae62('0x9b')],_0x2ad440[_0xae62('0x9c')]);}else{_0x5805db[_0xae62('0x3b')](_0x253e07['table']+_0xae62('0x9d'),_0x2ad440['startDate'],_0x2ad440[_0xae62('0x9c')]);}if(_0x5a8421){logger[_0xae62('0x9e')](_0xae62('0x9f'),_0x5805db[_0xae62('0x83')]());require('child_process')[_0xae62('0xa0')](path['join'](__dirname,'../../components/export/',_0x5a8421[_0xae62('0x91')]),[_0x5a8421['id'],_0x5805db['toString'](),path[_0xae62('0x54')](__dirname,_0xae62('0xa1'),_0x5a8421[_0xae62('0xa2')]),_0x7ef69a]);return _0x5a8421;}else{var _0x436ed4=squel[_0xae62('0x70')]();_0x436ed4[_0xae62('0x71')]('('+_0x5805db[_0xae62('0x83')]()+')',_0xae62('0xa3'));_0x436ed4['field'](_0xae62('0xa4'),_0xae62('0x1f'));_0x5805db[_0xae62('0x21')](_0x2ad440[_0xae62('0x21')]||_0x15c9df);_0x5805db[_0xae62('0x20')](_0x2ad440['offset']||0x0);return db[_0xae62('0x84')][_0xae62('0x32')](_0x436ed4[_0xae62('0x83')](),{'type':db['sequelize'][_0xae62('0x85')][_0xae62('0x86')]})[_0xae62('0x26')](function(_0x213bc7){if(!_0x213bc7['length']){_0xc066c9=0x0;}else{_0xc066c9=_0x213bc7[0x0][_0xae62('0x1f')]||0x0;}return db[_0xae62('0x84')][_0xae62('0x32')](_0x5805db[_0xae62('0x83')](),{'type':db[_0xae62('0x84')][_0xae62('0x85')]['SELECT']});})['then'](function(_0x2ce0a4){return{'rows':_0x2ce0a4||[],'count':_0xc066c9};});}});}exports[_0xae62('0xa5')]=function(_0x3f38ea,_0x10fca6){return runReport(_0x3f38ea['params'],_0x3f38ea['query'],_0x3f38ea['options'])[_0xae62('0x26')](respondWithResult(_0x10fca6,null))[_0xae62('0x47')](handleError(_0x10fca6,null));};exports['runReport']=runReport;exports[_0xae62('0x32')]=function(_0x42e716,_0x4e2b34){var _0x33560f=0xa;var _0x5a7a53=[_0xae62('0x54'),_0xae62('0x55'),_0xae62('0x87'),'cross_join'];var _0x3febf5={'SUM':_0xae62('0x57'),'COUNT':_0xae62('0x58'),'COUNT DISTINCT':_0xae62('0x59'),'MAX':_0xae62('0x5a'),'MIN':_0xae62('0x88'),'AVG':_0xae62('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xae62('0x5d'),'GROUP_CONCAT DESC':_0xae62('0x89')};var _0x545ea6={'SEC_TO_TIME':_0xae62('0x5e'),'DATE':_0xae62('0x5f'),'HOUR':_0xae62('0x60'),'ROUND':_0xae62('0x61'),'UNIX_TIMESTAMP':_0xae62('0x62')};var _0x92891d=function(_0x5a0576){return!_[_0xae62('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0xae62('0x66')],_0x5a0576);};var _0x5d1a1a=function(_0x5c494d){if(!_0x5c494d||!_0x5c494d[_0xae62('0x67')][_0xae62('0x49')]){return'';}for(var _0x39b607='(',_0x2624e2=0x0;_0x2624e2<_0x5c494d[_0xae62('0x67')][_0xae62('0x49')];_0x2624e2+=0x1){_0x2624e2>0x0&&(_0x39b607+='\x20'+_0x5c494d[_0xae62('0x68')]+'\x20');_0x39b607+=_0x5c494d[_0xae62('0x67')][_0x2624e2]['group']?_0x5d1a1a(_0x5c494d[_0xae62('0x67')][_0x2624e2][_0xae62('0x69')]):_0x5c494d[_0xae62('0x67')][_0x2624e2][_0xae62('0x42')]+'\x20'+_0x5c494d[_0xae62('0x67')][_0x2624e2][_0xae62('0x8b')]+(_0x92891d(_0x5c494d[_0xae62('0x67')][_0x2624e2][_0xae62('0x8b')])?'\x20'+_0x5c494d[_0xae62('0x67')][_0x2624e2][_0xae62('0x6a')]:'');}return _0x39b607+')';};var _0x452d3f={'where':{'id':_0x42e716[_0xae62('0x48')]['id']}},_0x17c8da,_0x534c0a,_0x25c23c,_0x4e4cc9,_0x23af41;_0x452d3f=_['merge']({},_0x452d3f,_0x42e716[_0xae62('0x43')]);return db[_0xae62('0x2f')]['find'](_0x452d3f)['then'](function(_0x2d5c2c){if(_0x2d5c2c){_0x17c8da=_0x2d5c2c;return _0x2d5c2c['getFields']();}return null;})[_0xae62('0x26')](function(_0x487f39){if(_0x487f39){if(!_0x487f39['length']){throw new db[(_0xae62('0x6c'))][(_0xae62('0x6d'))](_0xae62('0x6e'),0x193);}_0x534c0a=_0x487f39;return db['AnalyticMetric'][_0xae62('0x8c')]({'raw':!![]});}return null;})[_0xae62('0x26')](function(_0x137298){if(_0x137298){_0x25c23c=_[_0xae62('0xa6')](_0x137298,'id');var _0x32df71;var _0x50418c=squel[_0xae62('0x70')]();_0x50418c['from'](_0x17c8da[_0xae62('0x8d')]);for(var _0x59dba5=0x0;_0x59dba5<_0x534c0a[_0xae62('0x49')];_0x59dba5+=0x1){_0x32df71=_0x534c0a[_0x59dba5]['MetricId']?_0x25c23c[_0x534c0a[_0x59dba5][_0xae62('0x72')]][_0xae62('0x73')]:_0x534c0a[_0x59dba5][_0xae62('0x42')];_0x32df71=_0x534c0a[_0x59dba5]['function']?_[_0xae62('0x75')](_0x3febf5[_0x534c0a[_0x59dba5][_0xae62('0x74')]],'%s',_0x32df71):_0x32df71;_0x32df71=_0x534c0a[_0x59dba5][_0xae62('0x76')]?_[_0xae62('0x75')](_0x545ea6[_0x534c0a[_0x59dba5][_0xae62('0x76')]],'%s',_0x32df71):_0x32df71;if(_0x534c0a[_0x59dba5][_0xae62('0x77')]){_0x50418c[_0xae62('0x69')](_0x32df71);}_0x534c0a[_0x59dba5][_0xae62('0x78')]&&_0x50418c[_0xae62('0x39')](_0x32df71,_0x534c0a[_0x59dba5][_0xae62('0x78')]===_0xae62('0x79')?![]:!![]);_0x50418c['field'](_0x32df71,_0x534c0a[_0x59dba5][_0xae62('0x8e')]||_0x32df71);}if(_0x17c8da[_0xae62('0x7a')]){_0x17c8da['joins']=JSON['parse'](_0x17c8da[_0xae62('0x7a')]);for(var _0x2b97be=0x0;_0x2b97be<_0x17c8da[_0xae62('0x7a')][_0xae62('0x49')];_0x2b97be+=0x1){if(_0x17c8da[_0xae62('0x7a')][_0x2b97be]['type']&&_[_0xae62('0x63')](_0x5a7a53,_0x17c8da[_0xae62('0x7a')][_0x2b97be][_0xae62('0x40')])&&_0x17c8da['joins'][_0x2b97be][_0xae62('0x7e')]&&_0x17c8da['joins'][_0x2b97be][_0xae62('0x7f')]&&_0x17c8da[_0xae62('0x7a')][_0x2b97be][_0xae62('0x7c')]){_0x50418c[_0x17c8da[_0xae62('0x7a')][_0x2b97be][_0xae62('0x40')]](_0x17c8da['joins'][_0x2b97be][_0xae62('0x7f')],null,util['format'](_0xae62('0x7d'),_0x17c8da[_0xae62('0x8d')],_0x17c8da['joins'][_0x2b97be][_0xae62('0x7e')],_0x17c8da[_0xae62('0x7a')][_0x2b97be][_0xae62('0x7f')],_0x17c8da[_0xae62('0x7a')][_0x2b97be][_0xae62('0x7c')]));}}}if(_0x17c8da[_0xae62('0x80')]){_0x17c8da['conditions']=JSON['parse'](_0x17c8da[_0xae62('0x80')]);_0x50418c[_0xae62('0x3b')](_0x5d1a1a(_0x17c8da[_0xae62('0x80')][_0xae62('0x69')]));}_0x23af41=_0x50418c[_0xae62('0x81')]();_0x50418c[_0xae62('0x21')](_0x33560f);_0x50418c[_0xae62('0x20')](0x0);logger[_0xae62('0x8f')](_0xae62('0x82'),_0x50418c['toString']());return db['sequelize'][_0xae62('0x32')](_0x50418c[_0xae62('0x83')](),{'type':db['sequelize'][_0xae62('0x85')][_0xae62('0x86')]});}})[_0xae62('0x26')](function(){return{'sql':_0x23af41[_0xae62('0x83')]()};})['then'](respondWithResult(_0x4e2b34,null))[_0xae62('0x47')](handleError(_0x4e2b34,null));}; \ No newline at end of file +var _0xae1a=['AnalyticMetric','table','DESC','parse','output','web','fullPath','randomstring','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','Limited\x20Query:','html-pdf','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','offset','limit','status','set','json','apply','save','update','destroy','then','CustomReports','UserProfileResource','sendStatus','error','stack','name','index','AnalyticCustomReport','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','field','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','AVG(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0xae1a,0xba));var _0xaae1=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xae1a[_0x1d9aa0];return _0x226868;};'use strict';var pdf=require(_0xaae1('0x0'));var emlformat=require(_0xaae1('0x1'));var rimraf=require(_0xaae1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xaae1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaae1('0x4'));var util=require(_0xaae1('0x5'));var path=require(_0xaae1('0x6'));var sox=require(_0xaae1('0x7'));var csv=require(_0xaae1('0x8'));var ejs=require(_0xaae1('0x9'));var fs=require('fs');var _=require(_0xaae1('0xa'));var squel=require('squel');var crypto=require(_0xaae1('0xb'));var jsforce=require(_0xaae1('0xc'));var deskjs=require(_0xaae1('0xd'));var toCsv=require(_0xaae1('0x8'));var querystring=require(_0xaae1('0xe'));var Papa=require(_0xaae1('0xf'));var Redis=require(_0xaae1('0x10'));var authService=require(_0xaae1('0x11'));var qs=require(_0xaae1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaae1('0x13'))(_0xaae1('0x14'));var utils=require(_0xaae1('0x15'));var config=require(_0xaae1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11f7a4,_0x2c63c4){_0x2c63c4=_0x2c63c4||0xcc;return function(_0x430564){if(_0x430564){return _0x11f7a4['sendStatus'](_0x2c63c4);}return _0x11f7a4['status'](_0x2c63c4)['end']();};}function respondWithResult(_0x3121c5,_0x5a24a2){_0x5a24a2=_0x5a24a2||0xc8;return function(_0x2e836f){if(_0x2e836f){return _0x3121c5['status'](_0x5a24a2)['json'](_0x2e836f);}};}function respondWithFilteredResult(_0x129623,_0x3aae6b){return function(_0x4fdcb3){if(_0x4fdcb3){var _0x50364c=_0x4fdcb3['count'],_0x2583c1=_0x3aae6b[_0xaae1('0x17')],_0x4ce3e0=_0x3aae6b[_0xaae1('0x17')]+_0x3aae6b[_0xaae1('0x18')],_0x1a4c52;if(_0x4ce3e0>=_0x50364c){_0x4ce3e0=_0x50364c;_0x1a4c52=0xc8;}else{_0x1a4c52=0xce;}_0x129623[_0xaae1('0x19')](_0x1a4c52);return _0x129623[_0xaae1('0x1a')]('Content-Range',_0x2583c1+'-'+_0x4ce3e0+'/'+_0x50364c)[_0xaae1('0x1b')](_0x4fdcb3);}return null;};}function patchUpdates(_0x2624e2){return function(_0x4a3c96){try{jsonpatch[_0xaae1('0x1c')](_0x4a3c96,_0x2624e2,!![]);}catch(_0x2ff25b){return BPromise['reject'](_0x2ff25b);}return _0x4a3c96[_0xaae1('0x1d')]();};}function saveUpdates(_0x130936,_0x493e8f){return function(_0x3f6118){if(_0x3f6118){return _0x3f6118[_0xaae1('0x1e')](_0x130936)['then'](function(_0x396136){return _0x396136;});}return null;};}function removeEntity(_0x414a4a,_0x53877a){return function(_0x584bd6){if(_0x584bd6){return _0x584bd6[_0xaae1('0x1f')]()[_0xaae1('0x20')](function(){var _0x559a90=_0x584bd6['get']({'plain':!![]});var _0x55523d=_0xaae1('0x21');return db[_0xaae1('0x22')][_0xaae1('0x1f')]({'where':{'type':_0x55523d,'resourceId':_0x559a90['id']}})[_0xaae1('0x20')](function(){return _0x584bd6;});})['then'](function(){_0x414a4a[_0xaae1('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b9454,_0x12fa63){return function(_0x4e4283){if(!_0x4e4283){_0x2b9454[_0xaae1('0x23')](0x194);}return _0x4e4283;};}function handleError(_0x2bcd12,_0x27ecdf){_0x27ecdf=_0x27ecdf||0x1f4;return function(_0x2bcf16){logger[_0xaae1('0x24')](_0x2bcf16[_0xaae1('0x25')]);if(_0x2bcf16[_0xaae1('0x26')]){delete _0x2bcf16[_0xaae1('0x26')];}_0x2bcd12['status'](_0x27ecdf)['send'](_0x2bcf16);};}exports[_0xaae1('0x27')]=function(_0x1e1b98,_0x3f3f19){var _0x2f39d1={},_0x437d75={},_0x3e6427={'count':0x0,'rows':[]};var _0x1dd1d6=db[_0xaae1('0x28')][_0xaae1('0x29')];_0x437d75['model']=_['keys'](_0x1dd1d6);_0x437d75[_0xaae1('0x2a')]=_[_0xaae1('0x2b')](_0x1e1b98[_0xaae1('0x2a')]);_0x437d75[_0xaae1('0x2c')]=_[_0xaae1('0x2d')](_0x437d75[_0xaae1('0x2e')],_0x437d75[_0xaae1('0x2a')]);_0x2f39d1[_0xaae1('0x2f')]=_[_0xaae1('0x2d')](_0x437d75[_0xaae1('0x2e')],qs[_0xaae1('0x30')](_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x30')]));_0x2f39d1['attributes']=_0x2f39d1[_0xaae1('0x2f')][_0xaae1('0x31')]?_0x2f39d1[_0xaae1('0x2f')]:_0x437d75[_0xaae1('0x2e')];if(!_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x32')](_0xaae1('0x33'))){_0x2f39d1['limit']=qs[_0xaae1('0x18')](_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x18')]);_0x2f39d1['offset']=qs[_0xaae1('0x17')](_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x17')]);}_0x2f39d1[_0xaae1('0x34')]=qs[_0xaae1('0x35')](_0x1e1b98['query']['sort']);_0x2f39d1['where']=qs[_0xaae1('0x2c')](_['pick'](_0x1e1b98['query'],_0x437d75['filters']));if(_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x36')]){_0x2f39d1[_0xaae1('0x37')]=_[_0xaae1('0x38')](_0x2f39d1[_0xaae1('0x37')],{'$or':_[_0xaae1('0x39')](_0x1dd1d6,function(_0x5e1726){if(_0x5e1726[_0xaae1('0x3a')]['key']!=='VIRTUAL'){var _0x44b0ac={};_0x44b0ac[_0x5e1726[_0xaae1('0x3b')]]={'$like':'%'+_0x1e1b98['query'][_0xaae1('0x36')]+'%'};return _0x44b0ac;}})});}_0x2f39d1=_[_0xaae1('0x38')]({},_0x2f39d1,_0x1e1b98[_0xaae1('0x3c')]);var _0x375b5c={'where':_0x2f39d1[_0xaae1('0x37')]};return db['AnalyticCustomReport'][_0xaae1('0x3d')](_0x375b5c)[_0xaae1('0x20')](function(_0x4633d5){_0x3e6427[_0xaae1('0x3d')]=_0x4633d5;if(_0x1e1b98[_0xaae1('0x2a')][_0xaae1('0x3e')]){_0x2f39d1[_0xaae1('0x3f')]=[{'all':!![]}];}return db[_0xaae1('0x28')][_0xaae1('0x40')](_0x2f39d1);})[_0xaae1('0x20')](function(_0xad861d){_0x3e6427[_0xaae1('0x41')]=_0xad861d;return _0x3e6427;})['then'](respondWithFilteredResult(_0x3f3f19,_0x2f39d1))[_0xaae1('0x42')](handleError(_0x3f3f19,null));};exports[_0xaae1('0x43')]=function(_0x3caee0,_0x256efd){var _0x388ad3={'raw':![],'where':{'id':_0x3caee0[_0xaae1('0x44')]['id']}},_0x466ada={};_0x466ada['model']=_['keys'](db[_0xaae1('0x28')]['rawAttributes']);_0x466ada['query']=_['keys'](_0x3caee0[_0xaae1('0x2a')]);_0x466ada[_0xaae1('0x2c')]=_[_0xaae1('0x2d')](_0x466ada[_0xaae1('0x2e')],_0x466ada['query']);_0x388ad3[_0xaae1('0x2f')]=_[_0xaae1('0x2d')](_0x466ada['model'],qs[_0xaae1('0x30')](_0x3caee0[_0xaae1('0x2a')][_0xaae1('0x30')]));_0x388ad3[_0xaae1('0x2f')]=_0x388ad3['attributes'][_0xaae1('0x31')]?_0x388ad3[_0xaae1('0x2f')]:_0x466ada[_0xaae1('0x2e')];if(_0x3caee0[_0xaae1('0x2a')][_0xaae1('0x3e')]){_0x388ad3[_0xaae1('0x3f')]=[{'all':!![]}];}_0x388ad3=_[_0xaae1('0x38')]({},_0x388ad3,_0x3caee0[_0xaae1('0x3c')]);return db['AnalyticCustomReport']['find'](_0x388ad3)[_0xaae1('0x20')](handleEntityNotFound(_0x256efd,null))[_0xaae1('0x20')](respondWithResult(_0x256efd,null))['catch'](handleError(_0x256efd,null));};exports[_0xaae1('0x45')]=function(_0x5150f3,_0x49c4c7){return db[_0xaae1('0x28')][_0xaae1('0x45')](_0x5150f3[_0xaae1('0x46')],{})[_0xaae1('0x20')](function(_0x545ab1){var _0x47fdb8=_0x5150f3[_0xaae1('0x47')][_0xaae1('0x48')]({'plain':!![]});if(!_0x47fdb8)throw new Error(_0xaae1('0x49'));if(_0x47fdb8[_0xaae1('0x4a')]===_0xaae1('0x47')){var _0x3acd2d=_0x545ab1[_0xaae1('0x48')]({'plain':!![]});var _0xdbd17e='Reports';return db[_0xaae1('0x4b')][_0xaae1('0x4c')]({'where':{'name':_0xdbd17e,'userProfileId':_0x47fdb8[_0xaae1('0x4d')]},'raw':!![]})['then'](function(_0x527c55){if(_0x527c55&&_0x527c55[_0xaae1('0x4e')]===0x0){return db['UserProfileResource'][_0xaae1('0x45')]({'name':_0x3acd2d[_0xaae1('0x26')],'resourceId':_0x3acd2d['id'],'type':_0xaae1('0x21'),'sectionId':_0x527c55['id']},{})[_0xaae1('0x20')](function(){return _0x545ab1;});}else{return _0x545ab1;}})['catch'](function(_0x4389ea){logger[_0xaae1('0x24')](_0xaae1('0x4f'),_0x4389ea);throw _0x4389ea;});}return _0x545ab1;})[_0xaae1('0x20')](respondWithResult(_0x49c4c7,0xc9))[_0xaae1('0x42')](handleError(_0x49c4c7,null));};exports[_0xaae1('0x1e')]=function(_0x3c1d77,_0x348913){if(_0x3c1d77[_0xaae1('0x46')]['id']){delete _0x3c1d77['body']['id'];}return db['AnalyticCustomReport'][_0xaae1('0x4c')]({'where':{'id':_0x3c1d77[_0xaae1('0x44')]['id']}})[_0xaae1('0x20')](handleEntityNotFound(_0x348913,null))[_0xaae1('0x20')](saveUpdates(_0x3c1d77['body'],null))[_0xaae1('0x20')](respondWithResult(_0x348913,null))[_0xaae1('0x42')](handleError(_0x348913,null));};exports['destroy']=function(_0x35909c,_0x5db676){return db['AnalyticCustomReport'][_0xaae1('0x4c')]({'where':{'id':_0x35909c[_0xaae1('0x44')]['id']}})[_0xaae1('0x20')](handleEntityNotFound(_0x5db676,null))[_0xaae1('0x20')](removeEntity(_0x5db676,null))[_0xaae1('0x42')](handleError(_0x5db676,null));};exports[_0xaae1('0x50')]=function(_0x3cbb55,_0x381057){var _0xc05084=0xa;var _0x1e80e4=[_0xaae1('0x51'),_0xaae1('0x52'),_0xaae1('0x53'),_0xaae1('0x54')];var _0x2fc6ac={'SUM':_0xaae1('0x55'),'COUNT':_0xaae1('0x56'),'COUNT DISTINCT':_0xaae1('0x57'),'MAX':_0xaae1('0x58'),'MIN':_0xaae1('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xaae1('0x5a'),'GROUP_CONCAT ASC':_0xaae1('0x5b'),'GROUP_CONCAT DESC':_0xaae1('0x5c')};var _0x7b6b6a={'SEC_TO_TIME':_0xaae1('0x5d'),'DATE':_0xaae1('0x5e'),'HOUR':_0xaae1('0x5f'),'ROUND':_0xaae1('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2e540f=function(_0x37fefb){return!_[_0xaae1('0x61')]([_0xaae1('0x62'),'IS\x20NOT\x20NULL',_0xaae1('0x63'),_0xaae1('0x64')],_0x37fefb);};var _0x3ca07b=function(_0x3fdd6a){if(!_0x3fdd6a||!_0x3fdd6a[_0xaae1('0x65')][_0xaae1('0x31')]){return'';}for(var _0x312c13='(',_0xa396b2=0x0;_0xa396b2<_0x3fdd6a[_0xaae1('0x65')][_0xaae1('0x31')];_0xa396b2+=0x1){_0xa396b2>0x0&&(_0x312c13+='\x20'+_0x3fdd6a[_0xaae1('0x66')]+'\x20');_0x312c13+=_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x67')]?_0x3ca07b(_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x67')]):_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x3b')]+'\x20'+_0x3fdd6a['rules'][_0xa396b2][_0xaae1('0x68')]+(_0x2e540f(_0x3fdd6a[_0xaae1('0x65')][_0xa396b2]['condition'])?'\x20'+_0x3fdd6a[_0xaae1('0x65')][_0xa396b2][_0xaae1('0x69')]:'');}return _0x312c13+')';};var _0x379b43={'where':{'id':_0x3cbb55[_0xaae1('0x44')]['id']}},_0x3335de,_0x3cfc77,_0x1d6001,_0x46fd05,_0x5ba908;_0x379b43=_['merge']({},_0x379b43,_0x3cbb55[_0xaae1('0x3c')]);return db['AnalyticCustomReport']['find'](_0x379b43)['then'](function(_0x18932b){if(_0x18932b){_0x3335de=_0x18932b;return _0x18932b[_0xaae1('0x6a')]();}return null;})[_0xaae1('0x20')](function(_0x25c6c5){if(_0x25c6c5){if(!_0x25c6c5[_0xaae1('0x31')]){throw new db[(_0xaae1('0x6b'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3cfc77=_0x25c6c5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xaae1('0x20')](function(_0x207174){if(_0x207174){_0x1d6001=_[_0xaae1('0x6c')](_0x207174,'id');var _0x13e552;var _0xb94576=squel[_0xaae1('0x6d')]();_0xb94576[_0xaae1('0x6e')](_0x3335de['table']);for(var _0x55a98d=0x0;_0x55a98d<_0x3cfc77[_0xaae1('0x31')];_0x55a98d+=0x1){_0x13e552=_0x3cfc77[_0x55a98d]['MetricId']?_0x1d6001[_0x3cfc77[_0x55a98d][_0xaae1('0x6f')]][_0xaae1('0x70')]:_0x3cfc77[_0x55a98d][_0xaae1('0x3b')];_0x13e552=_0x3cfc77[_0x55a98d][_0xaae1('0x71')]?_[_0xaae1('0x72')](_0x2fc6ac[_0x3cfc77[_0x55a98d]['function']],'%s',_0x13e552):_0x13e552;_0x13e552=_0x3cfc77[_0x55a98d][_0xaae1('0x73')]?_[_0xaae1('0x72')](_0x7b6b6a[_0x3cfc77[_0x55a98d][_0xaae1('0x73')]],'%s',_0x13e552):_0x13e552;if(_0x3cfc77[_0x55a98d][_0xaae1('0x74')]){_0xb94576['group'](_0x13e552);}_0x3cfc77[_0x55a98d][_0xaae1('0x75')]&&_0xb94576[_0xaae1('0x34')](_0x13e552,_0x3cfc77[_0x55a98d][_0xaae1('0x75')]==='DESC'?![]:!![]);_0xb94576[_0xaae1('0x3b')](_0x13e552,_0x3cfc77[_0x55a98d][_0xaae1('0x76')]||_0x13e552);}if(_0x3335de['joins']){_0x3335de[_0xaae1('0x77')]=JSON['parse'](_0x3335de[_0xaae1('0x77')]);for(var _0x1a2e31=0x0;_0x1a2e31<_0x3335de[_0xaae1('0x77')][_0xaae1('0x31')];_0x1a2e31+=0x1){if(_0x3335de[_0xaae1('0x77')][_0x1a2e31][_0xaae1('0x3a')]&&_[_0xaae1('0x61')](_0x1e80e4,_0x3335de[_0xaae1('0x77')][_0x1a2e31]['type'])&&_0x3335de[_0xaae1('0x77')][_0x1a2e31]['parentKey']&&_0x3335de[_0xaae1('0x77')][_0x1a2e31][_0xaae1('0x78')]&&_0x3335de['joins'][_0x1a2e31][_0xaae1('0x79')]){_0xb94576[_0x3335de['joins'][_0x1a2e31][_0xaae1('0x3a')]](_0x3335de[_0xaae1('0x77')][_0x1a2e31]['foreignTable'],null,util[_0xaae1('0x73')](_0xaae1('0x7a'),_0x3335de['table'],_0x3335de['joins'][_0x1a2e31][_0xaae1('0x7b')],_0x3335de[_0xaae1('0x77')][_0x1a2e31]['foreignTable'],_0x3335de[_0xaae1('0x77')][_0x1a2e31][_0xaae1('0x79')]));}}}if(_0x3335de[_0xaae1('0x7c')]){_0x3335de[_0xaae1('0x7c')]=JSON['parse'](_0x3335de[_0xaae1('0x7c')]);_0xb94576[_0xaae1('0x37')](_0x3ca07b(_0x3335de[_0xaae1('0x7c')][_0xaae1('0x67')]));}_0x5ba908=_0xb94576[_0xaae1('0x7d')]();_0xb94576['limit'](_0xc05084);_0xb94576['offset'](0x0);logger[_0xaae1('0x7e')]('Limited\x20Query:',_0xb94576[_0xaae1('0x7f')]());return db['sequelize'][_0xaae1('0x2a')](_0xb94576[_0xaae1('0x7f')](),{'type':db[_0xaae1('0x80')][_0xaae1('0x81')][_0xaae1('0x82')]});}})['then'](respondWithResult(_0x381057,null))['catch'](handleError(_0x381057,null));};function runReport(_0x56977f,_0x40fde7,_0x14a42a){var _0xee549b=_0x40fde7['name'];var _0x1799dc=0xa;var _0x354bad=[_0xaae1('0x51'),_0xaae1('0x52'),'right_join',_0xaae1('0x54')];var _0x317967={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xaae1('0x57'),'MAX':'MAX(%s)','MIN':_0xaae1('0x59'),'AVG':_0xaae1('0x83'),'GROUP_CONCAT':_0xaae1('0x5a'),'GROUP_CONCAT ASC':_0xaae1('0x5b'),'GROUP_CONCAT DESC':_0xaae1('0x5c')};var _0x373982={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xaae1('0x5e'),'HOUR':_0xaae1('0x5f'),'ROUND':_0xaae1('0x60'),'UNIX_TIMESTAMP':_0xaae1('0x84')};var _0xdd6af4=function(_0x5865b8){return!_['includes']([_0xaae1('0x62'),_0xaae1('0x85'),_0xaae1('0x63'),_0xaae1('0x64')],_0x5865b8);};var _0x378bf6=function(_0x155670){if(!_0x155670||!_0x155670[_0xaae1('0x65')][_0xaae1('0x31')]){return'';}for(var _0x47b926='(',_0x36aa99=0x0;_0x36aa99<_0x155670[_0xaae1('0x65')][_0xaae1('0x31')];_0x36aa99+=0x1){_0x36aa99>0x0&&(_0x47b926+='\x20'+_0x155670['operator']+'\x20');_0x47b926+=_0x155670[_0xaae1('0x65')][_0x36aa99][_0xaae1('0x67')]?_0x378bf6(_0x155670['rules'][_0x36aa99][_0xaae1('0x67')]):_0x155670['rules'][_0x36aa99][_0xaae1('0x3b')]+'\x20'+_0x155670[_0xaae1('0x65')][_0x36aa99][_0xaae1('0x68')]+(_0xdd6af4(_0x155670['rules'][_0x36aa99][_0xaae1('0x68')])?'\x20'+_0x155670[_0xaae1('0x65')][_0x36aa99][_0xaae1('0x69')]:'');}return _0x47b926+')';};var _0x543973={'where':{'id':_0x56977f['id']}},_0x168bea,_0x1b0e9f,_0x391db5,_0x35d978,_0x3c20a6;_0x543973=_['merge']({},_0x543973,_0x14a42a);return db['AnalyticCustomReport'][_0xaae1('0x4c')](_0x543973)[_0xaae1('0x20')](function(_0x10f4a1){if(_0x10f4a1){_0x168bea=_0x10f4a1;return _0x10f4a1[_0xaae1('0x6a')]();}return null;})['then'](function(_0x46deaf){if(_0x46deaf){if(!_0x46deaf['length']){throw new db[(_0xaae1('0x6b'))][(_0xaae1('0x86'))](_0xaae1('0x87'),0x193);}_0x1b0e9f=_0x46deaf;return db[_0xaae1('0x88')]['findAll']({'raw':!![]});}return null;})[_0xaae1('0x20')](function(_0x52aeae){if(_0x52aeae){_0x391db5=_[_0xaae1('0x6c')](_0x52aeae,'id');var _0x187272;var _0x5f3795=squel[_0xaae1('0x6d')]();_0x5f3795[_0xaae1('0x6e')](_0x168bea[_0xaae1('0x89')]);for(var _0x24d46f=0x0;_0x24d46f<_0x1b0e9f[_0xaae1('0x31')];_0x24d46f+=0x1){_0x187272=_0x1b0e9f[_0x24d46f]['MetricId']?_0x391db5[_0x1b0e9f[_0x24d46f][_0xaae1('0x6f')]][_0xaae1('0x70')]:_0x1b0e9f[_0x24d46f][_0xaae1('0x3b')];_0x187272=_0x1b0e9f[_0x24d46f]['function']?_[_0xaae1('0x72')](_0x317967[_0x1b0e9f[_0x24d46f][_0xaae1('0x71')]],'%s',_0x187272):_0x187272;_0x187272=_0x1b0e9f[_0x24d46f][_0xaae1('0x73')]?_[_0xaae1('0x72')](_0x373982[_0x1b0e9f[_0x24d46f][_0xaae1('0x73')]],'%s',_0x187272):_0x187272;if(_0x1b0e9f[_0x24d46f][_0xaae1('0x74')]){_0x5f3795[_0xaae1('0x67')](_0x187272);}_0x1b0e9f[_0x24d46f]['orderBy']&&_0x5f3795['order'](_0x187272,_0x1b0e9f[_0x24d46f][_0xaae1('0x75')]===_0xaae1('0x8a')?![]:!![]);_0x5f3795[_0xaae1('0x3b')](_0x187272,_0x1b0e9f[_0x24d46f][_0xaae1('0x76')]||_0x187272);}if(_0x168bea['joins']){_0x168bea[_0xaae1('0x77')]=JSON[_0xaae1('0x8b')](_0x168bea[_0xaae1('0x77')]);for(var _0xbdb7b9=0x0;_0xbdb7b9<_0x168bea[_0xaae1('0x77')][_0xaae1('0x31')];_0xbdb7b9+=0x1){if(_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x3a')]&&_[_0xaae1('0x61')](_0x354bad,_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x3a')])&&_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x7b')]&&_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x78')]&&_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x79')]){_0x5f3795[_0x168bea[_0xaae1('0x77')][_0xbdb7b9]['type']](_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x78')],null,util[_0xaae1('0x73')](_0xaae1('0x7a'),_0x168bea[_0xaae1('0x89')],_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x7b')],_0x168bea['joins'][_0xbdb7b9][_0xaae1('0x78')],_0x168bea[_0xaae1('0x77')][_0xbdb7b9][_0xaae1('0x79')]));}}}if(_0x168bea[_0xaae1('0x7c')]){_0x168bea[_0xaae1('0x7c')]=JSON[_0xaae1('0x8b')](_0x168bea[_0xaae1('0x7c')]);_0x5f3795[_0xaae1('0x37')](_0x378bf6(_0x168bea[_0xaae1('0x7c')][_0xaae1('0x67')]));}_0x3c20a6=_0x5f3795[_0xaae1('0x7d')]();_0x5f3795[_0xaae1('0x18')](_0x1799dc);_0x5f3795[_0xaae1('0x17')](0x0);logger[_0xaae1('0x7e')]('Limited\x20Query:',_0x5f3795[_0xaae1('0x7f')]());return db[_0xaae1('0x80')]['query'](_0x5f3795[_0xaae1('0x7f')](),{'type':db[_0xaae1('0x80')]['QueryTypes'][_0xaae1('0x82')]});}})[_0xaae1('0x20')](function(_0x511696){if(!_0x511696[_0xaae1('0x31')]){throw new db[(_0xaae1('0x6b'))][(_0xaae1('0x86'))]('No\x20available\x20data',0xcc);}if(_0x40fde7[_0xaae1('0x8c')]===_0xaae1('0x8d')){return null;}var _0x24809c=_['merge'](_0x40fde7,{'name':_0x40fde7[_0xaae1('0x8e')]||_0x40fde7[_0xaae1('0x26')]||_0x168bea[_0xaae1('0x26')],'basename':_0xee549b,'savename':util['format']('%s-%s.%s',_0x40fde7[_0xaae1('0x26')]||_0x168bea[_0xaae1('0x26')],require(_0xaae1('0x8f'))['generate'](0x4),_0x40fde7[_0xaae1('0x8c')]||_0xaae1('0x90')),'reportId':_0x168bea['id'],'reportType':_0xaae1('0x91')});return db[_0xaae1('0x92')]['create'](_0x24809c,{'raw':!![]});})[_0xaae1('0x20')](function(_0x33c508){if(_0x168bea['table']===_0xaae1('0x93')){_0x3c20a6[_0xaae1('0x37')](_0x168bea[_0xaae1('0x89')]+_0xaae1('0x94'),_0x40fde7[_0xaae1('0x95')],_0x40fde7['endDate']);}else{_0x3c20a6['where'](_0x168bea[_0xaae1('0x89')]+_0xaae1('0x96'),_0x40fde7['startDate'],_0x40fde7[_0xaae1('0x97')]);}if(_0x33c508){logger[_0xaae1('0x98')](_0xaae1('0x99'),_0x3c20a6[_0xaae1('0x7f')]());require('child_process')['fork'](path['join'](__dirname,_0xaae1('0x9a'),_0x33c508[_0xaae1('0x8c')]),[_0x33c508['id'],_0x3c20a6[_0xaae1('0x7f')](),path['join'](__dirname,_0xaae1('0x9b'),_0x33c508['savename']),_0xee549b]);return _0x33c508;}else{var _0x4f7ee0=squel[_0xaae1('0x6d')]();_0x4f7ee0['from']('('+_0x3c20a6[_0xaae1('0x7f')]()+')',_0xaae1('0x9c'));_0x4f7ee0[_0xaae1('0x3b')](_0xaae1('0x9d'),_0xaae1('0x3d'));_0x3c20a6['limit'](_0x40fde7['limit']||_0x1799dc);_0x3c20a6[_0xaae1('0x17')](_0x40fde7['offset']||0x0);return db[_0xaae1('0x80')][_0xaae1('0x2a')](_0x4f7ee0[_0xaae1('0x7f')](),{'type':db['sequelize'][_0xaae1('0x81')][_0xaae1('0x82')]})['then'](function(_0x43d595){if(!_0x43d595[_0xaae1('0x31')]){_0x35d978=0x0;}else{_0x35d978=_0x43d595[0x0]['count']||0x0;}return db['sequelize'][_0xaae1('0x2a')](_0x3c20a6[_0xaae1('0x7f')](),{'type':db['sequelize'][_0xaae1('0x81')][_0xaae1('0x82')]});})['then'](function(_0x30877b){return{'rows':_0x30877b||[],'count':_0x35d978};});}});}exports[_0xaae1('0x9e')]=function(_0x2dc6b5,_0x872475){return runReport(_0x2dc6b5[_0xaae1('0x44')],_0x2dc6b5[_0xaae1('0x2a')],_0x2dc6b5['options'])[_0xaae1('0x20')](respondWithResult(_0x872475,null))[_0xaae1('0x42')](handleError(_0x872475,null));};exports[_0xaae1('0x9f')]=runReport;exports[_0xaae1('0x2a')]=function(_0x2b15cb,_0x156811){var _0x34758a=0xa;var _0x5736be=[_0xaae1('0x51'),'left_join',_0xaae1('0x53'),'cross_join'];var _0x5591e3={'SUM':_0xaae1('0x55'),'COUNT':_0xaae1('0x56'),'COUNT DISTINCT':_0xaae1('0x57'),'MAX':_0xaae1('0x58'),'MIN':_0xaae1('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xaae1('0x5a'),'GROUP_CONCAT ASC':_0xaae1('0x5b'),'GROUP_CONCAT DESC':_0xaae1('0x5c')};var _0x5f4713={'SEC_TO_TIME':_0xaae1('0x5d'),'DATE':_0xaae1('0x5e'),'HOUR':_0xaae1('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x10790f=function(_0x55be2b){return!_[_0xaae1('0x61')]([_0xaae1('0x62'),_0xaae1('0x85'),_0xaae1('0x63'),_0xaae1('0x64')],_0x55be2b);};var _0x43cac3=function(_0x32df1f){if(!_0x32df1f||!_0x32df1f[_0xaae1('0x65')][_0xaae1('0x31')]){return'';}for(var _0xbf3dc7='(',_0x12a976=0x0;_0x12a976<_0x32df1f[_0xaae1('0x65')][_0xaae1('0x31')];_0x12a976+=0x1){_0x12a976>0x0&&(_0xbf3dc7+='\x20'+_0x32df1f[_0xaae1('0x66')]+'\x20');_0xbf3dc7+=_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x67')]?_0x43cac3(_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x67')]):_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x3b')]+'\x20'+_0x32df1f[_0xaae1('0x65')][_0x12a976][_0xaae1('0x68')]+(_0x10790f(_0x32df1f['rules'][_0x12a976]['condition'])?'\x20'+_0x32df1f['rules'][_0x12a976]['value']:'');}return _0xbf3dc7+')';};var _0xcb30f0={'where':{'id':_0x2b15cb[_0xaae1('0x44')]['id']}},_0x1a978c,_0x58b472,_0x50f932,_0x51fb74,_0x122edb;_0xcb30f0=_[_0xaae1('0x38')]({},_0xcb30f0,_0x2b15cb[_0xaae1('0x3c')]);return db[_0xaae1('0x28')][_0xaae1('0x4c')](_0xcb30f0)[_0xaae1('0x20')](function(_0x33a09b){if(_0x33a09b){_0x1a978c=_0x33a09b;return _0x33a09b['getFields']();}return null;})[_0xaae1('0x20')](function(_0x22ed91){if(_0x22ed91){if(!_0x22ed91[_0xaae1('0x31')]){throw new db[(_0xaae1('0x6b'))][(_0xaae1('0x86'))](_0xaae1('0x87'),0x193);}_0x58b472=_0x22ed91;return db['AnalyticMetric'][_0xaae1('0x40')]({'raw':!![]});}return null;})[_0xaae1('0x20')](function(_0x1fba42){if(_0x1fba42){_0x50f932=_[_0xaae1('0x6c')](_0x1fba42,'id');var _0x372754;var _0x3a6b7f=squel[_0xaae1('0x6d')]();_0x3a6b7f['from'](_0x1a978c[_0xaae1('0x89')]);for(var _0x4c97f7=0x0;_0x4c97f7<_0x58b472[_0xaae1('0x31')];_0x4c97f7+=0x1){_0x372754=_0x58b472[_0x4c97f7][_0xaae1('0x6f')]?_0x50f932[_0x58b472[_0x4c97f7][_0xaae1('0x6f')]][_0xaae1('0x70')]:_0x58b472[_0x4c97f7][_0xaae1('0x3b')];_0x372754=_0x58b472[_0x4c97f7][_0xaae1('0x71')]?_[_0xaae1('0x72')](_0x5591e3[_0x58b472[_0x4c97f7][_0xaae1('0x71')]],'%s',_0x372754):_0x372754;_0x372754=_0x58b472[_0x4c97f7][_0xaae1('0x73')]?_[_0xaae1('0x72')](_0x5f4713[_0x58b472[_0x4c97f7][_0xaae1('0x73')]],'%s',_0x372754):_0x372754;if(_0x58b472[_0x4c97f7][_0xaae1('0x74')]){_0x3a6b7f[_0xaae1('0x67')](_0x372754);}_0x58b472[_0x4c97f7][_0xaae1('0x75')]&&_0x3a6b7f[_0xaae1('0x34')](_0x372754,_0x58b472[_0x4c97f7][_0xaae1('0x75')]===_0xaae1('0x8a')?![]:!![]);_0x3a6b7f['field'](_0x372754,_0x58b472[_0x4c97f7][_0xaae1('0x76')]||_0x372754);}if(_0x1a978c[_0xaae1('0x77')]){_0x1a978c['joins']=JSON[_0xaae1('0x8b')](_0x1a978c['joins']);for(var _0x20c2c1=0x0;_0x20c2c1<_0x1a978c[_0xaae1('0x77')]['length'];_0x20c2c1+=0x1){if(_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x3a')]&&_['includes'](_0x5736be,_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x3a')])&&_0x1a978c[_0xaae1('0x77')][_0x20c2c1]['parentKey']&&_0x1a978c[_0xaae1('0x77')][_0x20c2c1]['foreignTable']&&_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x79')]){_0x3a6b7f[_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x3a')]](_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x78')],null,util[_0xaae1('0x73')](_0xaae1('0x7a'),_0x1a978c[_0xaae1('0x89')],_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x7b')],_0x1a978c['joins'][_0x20c2c1][_0xaae1('0x78')],_0x1a978c[_0xaae1('0x77')][_0x20c2c1][_0xaae1('0x79')]));}}}if(_0x1a978c[_0xaae1('0x7c')]){_0x1a978c[_0xaae1('0x7c')]=JSON[_0xaae1('0x8b')](_0x1a978c[_0xaae1('0x7c')]);_0x3a6b7f['where'](_0x43cac3(_0x1a978c[_0xaae1('0x7c')][_0xaae1('0x67')]));}_0x122edb=_0x3a6b7f['clone']();_0x3a6b7f['limit'](_0x34758a);_0x3a6b7f['offset'](0x0);logger[_0xaae1('0x7e')](_0xaae1('0xa0'),_0x3a6b7f['toString']());return db['sequelize'][_0xaae1('0x2a')](_0x3a6b7f[_0xaae1('0x7f')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})['then'](function(){return{'sql':_0x122edb['toString']()};})['then'](respondWithResult(_0x156811,null))['catch'](handleError(_0x156811,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5e2a3da..11adfd7 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 _0x8ecc=['moment','bluebird','request-promise','rimraf','./analyticCustomReport.attributes','define','AnalyticCustomReport','lodash','util','../../config/logger'];(function(_0x57bdff,_0x530d74){var _0x1d12cb=function(_0x29022f){while(--_0x29022f){_0x57bdff['push'](_0x57bdff['shift']());}};_0x1d12cb(++_0x530d74);}(_0x8ecc,0x1ab));var _0xc8ec=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8ecc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc8ec('0x0'));var util=require(_0xc8ec('0x1'));var logger=require(_0xc8ec('0x2'))('api');var moment=require(_0xc8ec('0x3'));var BPromise=require(_0xc8ec('0x4'));var rp=require(_0xc8ec('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8ec('0x6'));var config=require('../../config/environment');var attributes=require(_0xc8ec('0x7'));module['exports']=function(_0x48de94,_0x2f9042){return _0x48de94[_0xc8ec('0x8')](_0xc8ec('0x9'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x885d=['analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x885d,0x83));var _0xd885=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0x885d[_0x2cc711];return _0x31a52e;};'use strict';var _=require(_0xd885('0x0'));var util=require('util');var logger=require(_0xd885('0x1'))(_0xd885('0x2'));var moment=require(_0xd885('0x3'));var BPromise=require(_0xd885('0x4'));var rp=require(_0xd885('0x5'));var fs=require('fs');var path=require(_0xd885('0x6'));var rimraf=require('rimraf');var config=require(_0xd885('0x7'));var attributes=require(_0xd885('0x8'));module[_0xd885('0x9')]=function(_0x5359e3,_0x42d854){return _0x5359e3[_0xd885('0xa')](_0xd885('0xb'),attributes,{'tableName':_0xd885('0xc'),'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 fd1caca..b0f8f7d 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x59786c,_0x139e5e){var _0x243366=function(_0x15d0db){while(--_0x15d0db){_0x59786c['push'](_0x59786c['shift']());}};_0x243366(++_0x139e5e);}(_0xb10b,0x12a));var _0xbb10=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0xb10b[_0x426dd2];return _0x4bc76c;};'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);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x5eaa8a,_0x396d27){var _0x558bc8=function(_0x38e99d){while(--_0x38e99d){_0x5eaa8a['push'](_0x5eaa8a['shift']());}};_0x558bc8(++_0x396d27);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 4fd6103..4254221 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 _0xda2d=['query','post','update','delete','destroy','exports','util','path','connect-timeout','express','Router','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','/:id/query'];(function(_0x1d0ce4,_0x2ef654){var _0x2db770=function(_0x17ced4){while(--_0x17ced4){_0x1d0ce4['push'](_0x1d0ce4['shift']());}};_0x2db770(++_0x2ef654);}(_0xda2d,0x102));var _0xdda2=function(_0x5c9d0a,_0x3b6a07){_0x5c9d0a=_0x5c9d0a-0x0;var _0x56edc6=_0xda2d[_0x5c9d0a];return _0x56edc6;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdda2('0x5'));router[_0xdda2('0x6')]('/',auth[_0xdda2('0x7')](),controller[_0xdda2('0x8')]);router[_0xdda2('0x6')](_0xdda2('0x9'),auth[_0xdda2('0x7')](),controller[_0xdda2('0xa')]);router[_0xdda2('0x6')](_0xdda2('0xb'),auth['isAuthenticated'](),controller[_0xdda2('0xc')]);router[_0xdda2('0x6')]('/:id/run',auth[_0xdda2('0x7')](),controller[_0xdda2('0xd')]);router[_0xdda2('0x6')](_0xdda2('0xe'),auth[_0xdda2('0x7')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')]('/',auth[_0xdda2('0x7')](),controller['create']);router['put']('/:id',auth[_0xdda2('0x7')](),controller[_0xdda2('0x11')]);router[_0xdda2('0x12')](_0xdda2('0x9'),auth[_0xdda2('0x7')](),controller[_0xdda2('0x13')]);module[_0xdda2('0x14')]=router; \ No newline at end of file +var _0x7d25=['create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','/:id','isAuthenticated','show','get','/:id/run','/:id/query','query','post'];(function(_0x60a460,_0x56522e){var _0x44c085=function(_0x3ae18b){while(--_0x3ae18b){_0x60a460['push'](_0x60a460['shift']());}};_0x44c085(++_0x56522e);}(_0x7d25,0x8a));var _0x57d2=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x7d25[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require('multer');var util=require(_0x57d2('0x0'));var path=require(_0x57d2('0x1'));var timeout=require(_0x57d2('0x2'));var express=require(_0x57d2('0x3'));var router=express[_0x57d2('0x4')]();var auth=require(_0x57d2('0x5'));var interaction=require(_0x57d2('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x57d2('0x7')]);router['get'](_0x57d2('0x8'),auth[_0x57d2('0x9')](),controller[_0x57d2('0xa')]);router['get']('/:id/preview',auth[_0x57d2('0x9')](),controller['preview']);router[_0x57d2('0xb')](_0x57d2('0xc'),auth[_0x57d2('0x9')](),controller['run']);router[_0x57d2('0xb')](_0x57d2('0xd'),auth[_0x57d2('0x9')](),controller[_0x57d2('0xe')]);router[_0x57d2('0xf')]('/',auth[_0x57d2('0x9')](),controller[_0x57d2('0x10')]);router[_0x57d2('0x11')](_0x57d2('0x8'),auth[_0x57d2('0x9')](),controller[_0x57d2('0x12')]);router[_0x57d2('0x13')](_0x57d2('0x8'),auth[_0x57d2('0x9')](),controller[_0x57d2('0x14')]);module[_0x57d2('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 5ef642f..5da2279 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 _0x04ca=['sequelize','exports','STRING','TEXT'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x04ca,0x1d0));var _0xa04c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x04ca[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa04c('0x0'));module[_0xa04c('0x1')]={'name':{'type':Sequelize[_0xa04c('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0xa04c('0x2')]},'table':{'type':Sequelize[_0xa04c('0x2')]},'conditions':{'type':Sequelize[_0xa04c('0x3')]},'joins':{'type':Sequelize[_0xa04c('0x3')]}}; \ No newline at end of file +var _0x3009=['exports','STRING','TEXT','sequelize'];(function(_0xb93836,_0x2e7941){var _0x2b3e5b=function(_0x56d0a4){while(--_0x56d0a4){_0xb93836['push'](_0xb93836['shift']());}};_0x2b3e5b(++_0x2e7941);}(_0x3009,0x17f));var _0x9300=function(_0x541d85,_0x847ff1){_0x541d85=_0x541d85-0x0;var _0x217bba=_0x3009[_0x541d85];return _0x217bba;};'use strict';var Sequelize=require(_0x9300('0x0'));module[_0x9300('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9300('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x9300('0x2')]},'conditions':{'type':Sequelize[_0x9300('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 1e646b3..d441115 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 _0x0922=['model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','key','field','includeAll','include','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','Sequelize','ValidationErrorItem','groupBy','debug','toString','No\x20available\x20data','web','fullPath','randomstring','generate','output','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','child_process','fork','../../files/reports','savename','countTable','run','options','runReport','cross_join','AVG(%s)','IS\x20NOT\x20NULL','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','get','DefaultReports','UserProfileResource','then','error','stack','name','send','index','AnalyticDefaultReport'];(function(_0x324ced,_0x29e021){var _0x36f1d3=function(_0x511953){while(--_0x511953){_0x324ced['push'](_0x324ced['shift']());}};_0x36f1d3(++_0x29e021);}(_0x0922,0x77));var _0x2092=function(_0x13ac10,_0x46e79e){_0x13ac10=_0x13ac10-0x0;var _0x28eda2=_0x0922[_0x13ac10];return _0x28eda2;};'use strict';var pdf=require(_0x2092('0x0'));var emlformat=require(_0x2092('0x1'));var rimraf=require(_0x2092('0x2'));var zipdir=require(_0x2092('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2092('0x4'));var moment=require(_0x2092('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2092('0x6'));var sox=require(_0x2092('0x7'));var csv=require(_0x2092('0x8'));var ejs=require(_0x2092('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2092('0xa'));var crypto=require('crypto');var jsforce=require(_0x2092('0xb'));var deskjs=require(_0x2092('0xc'));var toCsv=require(_0x2092('0x8'));var querystring=require('querystring');var Papa=require(_0x2092('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2092('0xe'));var hardwareService=require(_0x2092('0xf'));var logger=require(_0x2092('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x2092('0x11'));var db=require(_0x2092('0x12'))['db'];function respondWithStatusCode(_0x412c8f,_0x50210d){_0x50210d=_0x50210d||0xcc;return function(_0x5e946e){if(_0x5e946e){return _0x412c8f[_0x2092('0x13')](_0x50210d);}return _0x412c8f[_0x2092('0x14')](_0x50210d)[_0x2092('0x15')]();};}function respondWithResult(_0x35bac9,_0x518696){_0x518696=_0x518696||0xc8;return function(_0x3be69e){if(_0x3be69e){return _0x35bac9[_0x2092('0x14')](_0x518696)[_0x2092('0x16')](_0x3be69e);}};}function respondWithFilteredResult(_0x69d209,_0x1bc839){return function(_0x408370){if(_0x408370){var _0x1f679e=_0x408370[_0x2092('0x17')],_0x99421d=_0x1bc839['offset'],_0x1bcb7f=_0x1bc839[_0x2092('0x18')]+_0x1bc839[_0x2092('0x19')],_0x50b129;if(_0x1bcb7f>=_0x1f679e){_0x1bcb7f=_0x1f679e;_0x50b129=0xc8;}else{_0x50b129=0xce;}_0x69d209['status'](_0x50b129);return _0x69d209[_0x2092('0x1a')](_0x2092('0x1b'),_0x99421d+'-'+_0x1bcb7f+'/'+_0x1f679e)['json'](_0x408370);}return null;};}function patchUpdates(_0x5e11d6){return function(_0x4bcbfb){try{jsonpatch['apply'](_0x4bcbfb,_0x5e11d6,!![]);}catch(_0x1b9843){return BPromise['reject'](_0x1b9843);}return _0x4bcbfb[_0x2092('0x1c')]();};}function saveUpdates(_0x14dd43,_0x2ea3da){return function(_0x3b0b5b){if(_0x3b0b5b){return _0x3b0b5b[_0x2092('0x1d')](_0x14dd43)['then'](function(_0x33019f){return _0x33019f;});}return null;};}function removeEntity(_0x5ace27,_0x33d72c){return function(_0x114eff){if(_0x114eff){return _0x114eff[_0x2092('0x1e')]()['then'](function(){var _0x58b869=_0x114eff[_0x2092('0x1f')]({'plain':!![]});var _0x5a2687=_0x2092('0x20');return db[_0x2092('0x21')][_0x2092('0x1e')]({'where':{'type':_0x5a2687,'resourceId':_0x58b869['id']}})[_0x2092('0x22')](function(){return _0x114eff;});})[_0x2092('0x22')](function(){_0x5ace27[_0x2092('0x14')](0xcc)[_0x2092('0x15')]();});}};}function handleEntityNotFound(_0x33b24f,_0x4ef4cc){return function(_0x988394){if(!_0x988394){_0x33b24f['sendStatus'](0x194);}return _0x988394;};}function handleError(_0xe2aee4,_0x5cf7d7){_0x5cf7d7=_0x5cf7d7||0x1f4;return function(_0x30716c){logger[_0x2092('0x23')](_0x30716c[_0x2092('0x24')]);if(_0x30716c[_0x2092('0x25')]){delete _0x30716c[_0x2092('0x25')];}_0xe2aee4[_0x2092('0x14')](_0x5cf7d7)[_0x2092('0x26')](_0x30716c);};}exports[_0x2092('0x27')]=function(_0x1bf2f1,_0x42b289){var _0x3cfc86={},_0x4122ab={},_0x3e314e={'count':0x0,'rows':[]};var _0x40ce59=db[_0x2092('0x28')]['rawAttributes'];_0x4122ab[_0x2092('0x29')]=_[_0x2092('0x2a')](_0x40ce59);_0x4122ab[_0x2092('0x2b')]=_[_0x2092('0x2a')](_0x1bf2f1[_0x2092('0x2b')]);_0x4122ab['filters']=_[_0x2092('0x2c')](_0x4122ab['model'],_0x4122ab[_0x2092('0x2b')]);_0x3cfc86[_0x2092('0x2d')]=_[_0x2092('0x2c')](_0x4122ab[_0x2092('0x29')],qs[_0x2092('0x2e')](_0x1bf2f1['query'][_0x2092('0x2e')]));_0x3cfc86[_0x2092('0x2d')]=_0x3cfc86['attributes'][_0x2092('0x2f')]?_0x3cfc86[_0x2092('0x2d')]:_0x4122ab[_0x2092('0x29')];if(!_0x1bf2f1[_0x2092('0x2b')][_0x2092('0x30')](_0x2092('0x31'))){_0x3cfc86[_0x2092('0x19')]=qs[_0x2092('0x19')](_0x1bf2f1[_0x2092('0x2b')]['limit']);_0x3cfc86['offset']=qs[_0x2092('0x18')](_0x1bf2f1[_0x2092('0x2b')]['offset']);}_0x3cfc86['order']=qs[_0x2092('0x32')](_0x1bf2f1[_0x2092('0x2b')][_0x2092('0x32')]);_0x3cfc86[_0x2092('0x33')]=qs['filters'](_[_0x2092('0x34')](_0x1bf2f1[_0x2092('0x2b')],_0x4122ab[_0x2092('0x35')]));if(_0x1bf2f1[_0x2092('0x2b')][_0x2092('0x36')]){_0x3cfc86['where']=_[_0x2092('0x37')](_0x3cfc86[_0x2092('0x33')],{'$or':_['map'](_0x40ce59,function(_0x41019a){if(_0x41019a[_0x2092('0x38')][_0x2092('0x39')]!=='VIRTUAL'){var _0xe094dd={};_0xe094dd[_0x41019a[_0x2092('0x3a')]]={'$like':'%'+_0x1bf2f1[_0x2092('0x2b')]['filter']+'%'};return _0xe094dd;}})});}_0x3cfc86=_[_0x2092('0x37')]({},_0x3cfc86,_0x1bf2f1['options']);var _0x1d7128={'where':_0x3cfc86[_0x2092('0x33')]};return db[_0x2092('0x28')][_0x2092('0x17')](_0x1d7128)[_0x2092('0x22')](function(_0x24fc32){_0x3e314e[_0x2092('0x17')]=_0x24fc32;if(_0x1bf2f1[_0x2092('0x2b')][_0x2092('0x3b')]){_0x3cfc86[_0x2092('0x3c')]=[{'all':!![]}];}return db[_0x2092('0x28')]['findAll'](_0x3cfc86);})[_0x2092('0x22')](function(_0x3d7791){_0x3e314e[_0x2092('0x3d')]=_0x3d7791;return _0x3e314e;})['then'](respondWithFilteredResult(_0x42b289,_0x3cfc86))['catch'](handleError(_0x42b289,null));};exports[_0x2092('0x3e')]=function(_0xc8f05e,_0xecefe3){var _0x419e4c={'raw':!![],'where':{'id':_0xc8f05e[_0x2092('0x3f')]['id']}},_0x4be9a5={};_0x4be9a5['model']=_[_0x2092('0x2a')](db[_0x2092('0x28')][_0x2092('0x40')]);_0x4be9a5[_0x2092('0x2b')]=_[_0x2092('0x2a')](_0xc8f05e['query']);_0x4be9a5[_0x2092('0x35')]=_[_0x2092('0x2c')](_0x4be9a5['model'],_0x4be9a5[_0x2092('0x2b')]);_0x419e4c['attributes']=_[_0x2092('0x2c')](_0x4be9a5[_0x2092('0x29')],qs[_0x2092('0x2e')](_0xc8f05e[_0x2092('0x2b')]['fields']));_0x419e4c[_0x2092('0x2d')]=_0x419e4c[_0x2092('0x2d')]['length']?_0x419e4c['attributes']:_0x4be9a5[_0x2092('0x29')];if(_0xc8f05e[_0x2092('0x2b')][_0x2092('0x3b')]){_0x419e4c['include']=[{'all':!![]}];}_0x419e4c=_[_0x2092('0x37')]({},_0x419e4c,_0xc8f05e['options']);return db['AnalyticDefaultReport'][_0x2092('0x41')](_0x419e4c)[_0x2092('0x22')](handleEntityNotFound(_0xecefe3,null))[_0x2092('0x22')](respondWithResult(_0xecefe3,null))['catch'](handleError(_0xecefe3,null));};exports[_0x2092('0x42')]=function(_0x402b61,_0x1b8711){return db[_0x2092('0x28')]['create'](_0x402b61[_0x2092('0x43')],{})[_0x2092('0x22')](function(_0x2bebd9){var _0xedef1=_0x402b61[_0x2092('0x44')]['get']({'plain':!![]});if(!_0xedef1)throw new Error(_0x2092('0x45'));if(_0xedef1[_0x2092('0x46')]===_0x2092('0x44')){var _0x485b67=_0x2bebd9[_0x2092('0x1f')]({'plain':!![]});var _0x45959a=_0x2092('0x47');return db[_0x2092('0x48')][_0x2092('0x41')]({'where':{'name':_0x45959a,'userProfileId':_0xedef1[_0x2092('0x49')]},'raw':!![]})[_0x2092('0x22')](function(_0x1cfedc){if(_0x1cfedc&&_0x1cfedc['autoAssociation']===0x0){return db['UserProfileResource'][_0x2092('0x42')]({'name':_0x485b67[_0x2092('0x25')],'resourceId':_0x485b67['id'],'type':_0x2092('0x20'),'sectionId':_0x1cfedc['id']},{})[_0x2092('0x22')](function(){return _0x2bebd9;});}else{return _0x2bebd9;}})[_0x2092('0x4a')](function(_0x383bcc){logger[_0x2092('0x23')](_0x2092('0x4b'),_0x383bcc);throw _0x383bcc;});}return _0x2bebd9;})[_0x2092('0x22')](respondWithResult(_0x1b8711,0xc9))['catch'](handleError(_0x1b8711,null));};exports['update']=function(_0xf0c11b,_0x4060d7){if(_0xf0c11b[_0x2092('0x43')]['id']){delete _0xf0c11b[_0x2092('0x43')]['id'];}return db[_0x2092('0x28')][_0x2092('0x41')]({'where':{'id':_0xf0c11b[_0x2092('0x3f')]['id']}})[_0x2092('0x22')](handleEntityNotFound(_0x4060d7,null))[_0x2092('0x22')](saveUpdates(_0xf0c11b[_0x2092('0x43')],null))['then'](respondWithResult(_0x4060d7,null))['catch'](handleError(_0x4060d7,null));};exports['destroy']=function(_0x4bf207,_0x14669b){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x4bf207[_0x2092('0x3f')]['id']}})[_0x2092('0x22')](handleEntityNotFound(_0x14669b,null))[_0x2092('0x22')](removeEntity(_0x14669b,null))[_0x2092('0x4a')](handleError(_0x14669b,null));};exports['preview']=function(_0x3df250,_0x2aad64){var _0x37bd23=0xa;var _0x1e7d83=[_0x2092('0x4c'),_0x2092('0x4d'),_0x2092('0x4e'),'cross_join'];var _0x31f1d4={'SUM':_0x2092('0x4f'),'COUNT':_0x2092('0x50'),'COUNT DISTINCT':_0x2092('0x51'),'MAX':_0x2092('0x52'),'MIN':_0x2092('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2092('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x2092('0x55')};var _0x4bc2c4={'SEC_TO_TIME':_0x2092('0x56'),'DATE':_0x2092('0x57'),'HOUR':_0x2092('0x58'),'ROUND':_0x2092('0x59'),'UNIX_TIMESTAMP':_0x2092('0x5a')};var _0x4bb3fd=function(_0x15f4c7){return!_[_0x2092('0x5b')]([_0x2092('0x5c'),'IS\x20NOT\x20NULL',_0x2092('0x5d'),_0x2092('0x5e')],_0x15f4c7);};var _0x44d734=function(_0x1a19c1){if(!_0x1a19c1||!_0x1a19c1[_0x2092('0x5f')][_0x2092('0x2f')]){return'';}for(var _0x3f27e3='(',_0x589b1b=0x0;_0x589b1b<_0x1a19c1[_0x2092('0x5f')][_0x2092('0x2f')];_0x589b1b+=0x1){_0x589b1b>0x0&&(_0x3f27e3+='\x20'+_0x1a19c1[_0x2092('0x60')]+'\x20');_0x3f27e3+=_0x1a19c1['rules'][_0x589b1b]['group']?_0x44d734(_0x1a19c1[_0x2092('0x5f')][_0x589b1b][_0x2092('0x61')]):_0x1a19c1[_0x2092('0x5f')][_0x589b1b]['field']+'\x20'+_0x1a19c1[_0x2092('0x5f')][_0x589b1b][_0x2092('0x62')]+(_0x4bb3fd(_0x1a19c1[_0x2092('0x5f')][_0x589b1b][_0x2092('0x62')])?'\x20'+_0x1a19c1[_0x2092('0x5f')][_0x589b1b][_0x2092('0x63')]:'');}return _0x3f27e3+')';};var _0x1b9c7a={'where':{'id':_0x3df250[_0x2092('0x3f')]['id']}},_0x2d8019,_0x40e08e,_0x411ed1,_0x55e788,_0x344455;_0x1b9c7a=_[_0x2092('0x37')]({},_0x1b9c7a,_0x3df250['options']);return db[_0x2092('0x28')][_0x2092('0x41')](_0x1b9c7a)[_0x2092('0x22')](function(_0x33efa1){if(_0x33efa1){_0x2d8019=_0x33efa1;return _0x33efa1[_0x2092('0x64')]();}return null;})[_0x2092('0x22')](function(_0x52106f){if(_0x52106f){if(!_0x52106f['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x2092('0x65'),0x193);}_0x40e08e=_0x52106f;return db[_0x2092('0x66')][_0x2092('0x67')]({'raw':!![]});}return null;})[_0x2092('0x22')](function(_0x49a4a2){if(_0x49a4a2){_0x411ed1=_[_0x2092('0x68')](_0x49a4a2,'id');var _0x45ad08;var _0x10ea76=squel[_0x2092('0x69')]();_0x10ea76[_0x2092('0x6a')](_0x2d8019[_0x2092('0x6b')]);for(var _0x18d31=0x0;_0x18d31<_0x40e08e[_0x2092('0x2f')];_0x18d31+=0x1){_0x45ad08=_0x40e08e[_0x18d31][_0x2092('0x6c')]?_0x411ed1[_0x40e08e[_0x18d31][_0x2092('0x6c')]][_0x2092('0x6d')]:_0x40e08e[_0x18d31]['field'];_0x45ad08=_0x40e08e[_0x18d31][_0x2092('0x6e')]?_[_0x2092('0x6f')](_0x31f1d4[_0x40e08e[_0x18d31][_0x2092('0x6e')]],'%s',_0x45ad08):_0x45ad08;_0x45ad08=_0x40e08e[_0x18d31][_0x2092('0x70')]?_[_0x2092('0x6f')](_0x4bc2c4[_0x40e08e[_0x18d31][_0x2092('0x70')]],'%s',_0x45ad08):_0x45ad08;if(_0x40e08e[_0x18d31]['groupBy']){_0x10ea76[_0x2092('0x61')](_0x45ad08);}_0x40e08e[_0x18d31][_0x2092('0x71')]&&_0x10ea76[_0x2092('0x72')](_0x45ad08,_0x40e08e[_0x18d31][_0x2092('0x71')]===_0x2092('0x73')?![]:!![]);_0x10ea76[_0x2092('0x3a')](_0x45ad08,_0x40e08e[_0x18d31][_0x2092('0x74')]||_0x45ad08);}if(_0x2d8019[_0x2092('0x75')]){_0x2d8019['joins']=JSON['parse'](_0x2d8019[_0x2092('0x75')]);for(var _0x447a0a=0x0;_0x447a0a<_0x2d8019['joins']['length'];_0x447a0a+=0x1){if(_0x2d8019['joins'][_0x447a0a][_0x2092('0x38')]&&_[_0x2092('0x5b')](_0x1e7d83,_0x2d8019[_0x2092('0x75')][_0x447a0a][_0x2092('0x38')])&&_0x2d8019[_0x2092('0x75')][_0x447a0a][_0x2092('0x76')]&&_0x2d8019[_0x2092('0x75')][_0x447a0a][_0x2092('0x77')]&&_0x2d8019[_0x2092('0x75')][_0x447a0a][_0x2092('0x78')]){_0x10ea76[_0x2d8019[_0x2092('0x75')][_0x447a0a][_0x2092('0x38')]](_0x2d8019['joins'][_0x447a0a][_0x2092('0x77')],null,util[_0x2092('0x70')](_0x2092('0x79'),_0x2d8019[_0x2092('0x6b')],_0x2d8019[_0x2092('0x75')][_0x447a0a][_0x2092('0x76')],_0x2d8019[_0x2092('0x75')][_0x447a0a]['foreignTable'],_0x2d8019[_0x2092('0x75')][_0x447a0a][_0x2092('0x78')]));}}}if(_0x2d8019[_0x2092('0x7a')]){_0x2d8019[_0x2092('0x7a')]=JSON[_0x2092('0x7b')](_0x2d8019[_0x2092('0x7a')]);_0x10ea76[_0x2092('0x33')](_0x44d734(_0x2d8019[_0x2092('0x7a')]['group']));}_0x344455=_0x10ea76[_0x2092('0x7c')]();_0x10ea76[_0x2092('0x19')](_0x37bd23);_0x10ea76[_0x2092('0x18')](0x0);logger['debug'](_0x2092('0x7d'),_0x10ea76['toString']());return db[_0x2092('0x7e')][_0x2092('0x2b')](_0x10ea76['toString'](),{'type':db['sequelize'][_0x2092('0x7f')][_0x2092('0x80')]});}})['then'](respondWithResult(_0x2aad64,null))['catch'](handleError(_0x2aad64,null));};function runReport(_0x30cfbb,_0x537cb1,_0x38b156){var _0xd4be5b=_0x537cb1['name'];var _0x1af1df=0xa;var _0x2fa676=['join',_0x2092('0x4d'),_0x2092('0x4e'),'cross_join'];var _0x4e7e07={'SUM':_0x2092('0x4f'),'COUNT':_0x2092('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x2092('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2092('0x54'),'GROUP_CONCAT ASC':_0x2092('0x81'),'GROUP_CONCAT DESC':_0x2092('0x55')};var _0x97090f={'SEC_TO_TIME':_0x2092('0x56'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x2092('0x59'),'UNIX_TIMESTAMP':_0x2092('0x5a')};var _0x5c91cb=function(_0x2ee3d6){return!_[_0x2092('0x5b')]([_0x2092('0x5c'),'IS\x20NOT\x20NULL',_0x2092('0x5d'),'IS\x20NOT\x20EMPTY'],_0x2ee3d6);};var _0x41ee2d=function(_0x265e55){if(!_0x265e55||!_0x265e55[_0x2092('0x5f')][_0x2092('0x2f')]){return'';}for(var _0x286a9b='(',_0x254e42=0x0;_0x254e42<_0x265e55[_0x2092('0x5f')][_0x2092('0x2f')];_0x254e42+=0x1){_0x254e42>0x0&&(_0x286a9b+='\x20'+_0x265e55['operator']+'\x20');_0x286a9b+=_0x265e55[_0x2092('0x5f')][_0x254e42]['group']?_0x41ee2d(_0x265e55[_0x2092('0x5f')][_0x254e42]['group']):_0x265e55[_0x2092('0x5f')][_0x254e42][_0x2092('0x3a')]+'\x20'+_0x265e55[_0x2092('0x5f')][_0x254e42][_0x2092('0x62')]+(_0x5c91cb(_0x265e55[_0x2092('0x5f')][_0x254e42][_0x2092('0x62')])?'\x20'+_0x265e55['rules'][_0x254e42]['value']:'');}return _0x286a9b+')';};var _0x160dc5={'where':{'id':_0x30cfbb['id']}},_0x14fd42,_0xf2e94,_0x5e1ff5,_0x284b15,_0x9fe078;_0x160dc5=_[_0x2092('0x37')]({},_0x160dc5,_0x38b156);return db[_0x2092('0x28')]['find'](_0x160dc5)[_0x2092('0x22')](function(_0x11c032){if(_0x11c032){_0x14fd42=_0x11c032;return _0x11c032['getFields']();}return null;})[_0x2092('0x22')](function(_0x30f4e0){if(_0x30f4e0){if(!_0x30f4e0[_0x2092('0x2f')]){throw new db[(_0x2092('0x82'))][(_0x2092('0x83'))](_0x2092('0x65'),0x193);}_0xf2e94=_0x30f4e0;return db[_0x2092('0x66')][_0x2092('0x67')]({'raw':!![]});}return null;})['then'](function(_0x50c650){if(_0x50c650){_0x5e1ff5=_[_0x2092('0x68')](_0x50c650,'id');var _0x4a770c;var _0x14acf1=squel['select']();_0x14acf1[_0x2092('0x6a')](_0x14fd42['table']);for(var _0x40f0c9=0x0;_0x40f0c9<_0xf2e94[_0x2092('0x2f')];_0x40f0c9+=0x1){_0x4a770c=_0xf2e94[_0x40f0c9][_0x2092('0x6c')]?_0x5e1ff5[_0xf2e94[_0x40f0c9]['MetricId']][_0x2092('0x6d')]:_0xf2e94[_0x40f0c9][_0x2092('0x3a')];_0x4a770c=_0xf2e94[_0x40f0c9]['function']?_[_0x2092('0x6f')](_0x4e7e07[_0xf2e94[_0x40f0c9][_0x2092('0x6e')]],'%s',_0x4a770c):_0x4a770c;_0x4a770c=_0xf2e94[_0x40f0c9][_0x2092('0x70')]?_['replace'](_0x97090f[_0xf2e94[_0x40f0c9][_0x2092('0x70')]],'%s',_0x4a770c):_0x4a770c;if(_0xf2e94[_0x40f0c9][_0x2092('0x84')]){_0x14acf1[_0x2092('0x61')](_0x4a770c);}_0xf2e94[_0x40f0c9][_0x2092('0x71')]&&_0x14acf1[_0x2092('0x72')](_0x4a770c,_0xf2e94[_0x40f0c9][_0x2092('0x71')]===_0x2092('0x73')?![]:!![]);_0x14acf1[_0x2092('0x3a')](_0x4a770c,_0xf2e94[_0x40f0c9][_0x2092('0x74')]||_0x4a770c);}if(_0x14fd42[_0x2092('0x75')]){_0x14fd42[_0x2092('0x75')]=JSON[_0x2092('0x7b')](_0x14fd42[_0x2092('0x75')]);for(var _0x519912=0x0;_0x519912<_0x14fd42[_0x2092('0x75')][_0x2092('0x2f')];_0x519912+=0x1){if(_0x14fd42[_0x2092('0x75')][_0x519912][_0x2092('0x38')]&&_[_0x2092('0x5b')](_0x2fa676,_0x14fd42[_0x2092('0x75')][_0x519912][_0x2092('0x38')])&&_0x14fd42[_0x2092('0x75')][_0x519912]['parentKey']&&_0x14fd42['joins'][_0x519912][_0x2092('0x77')]&&_0x14fd42[_0x2092('0x75')][_0x519912][_0x2092('0x78')]){_0x14acf1[_0x14fd42[_0x2092('0x75')][_0x519912][_0x2092('0x38')]](_0x14fd42[_0x2092('0x75')][_0x519912][_0x2092('0x77')],null,util[_0x2092('0x70')](_0x2092('0x79'),_0x14fd42[_0x2092('0x6b')],_0x14fd42[_0x2092('0x75')][_0x519912][_0x2092('0x76')],_0x14fd42[_0x2092('0x75')][_0x519912]['foreignTable'],_0x14fd42[_0x2092('0x75')][_0x519912][_0x2092('0x78')]));}}}if(_0x14fd42[_0x2092('0x7a')]){_0x14fd42[_0x2092('0x7a')]=JSON[_0x2092('0x7b')](_0x14fd42[_0x2092('0x7a')]);_0x14acf1['where'](_0x41ee2d(_0x14fd42[_0x2092('0x7a')][_0x2092('0x61')]));}_0x9fe078=_0x14acf1[_0x2092('0x7c')]();_0x14acf1[_0x2092('0x19')](_0x1af1df);_0x14acf1[_0x2092('0x18')](0x0);logger[_0x2092('0x85')](_0x2092('0x7d'),_0x14acf1['toString']());return db['sequelize']['query'](_0x14acf1[_0x2092('0x86')](),{'type':db[_0x2092('0x7e')][_0x2092('0x7f')][_0x2092('0x80')]});}})[_0x2092('0x22')](function(_0x436ebd){if(!_0x436ebd['length']){throw new db[(_0x2092('0x82'))][(_0x2092('0x83'))](_0x2092('0x87'),0xcc);}if(_0x537cb1['output']===_0x2092('0x88')){return null;}var _0x3be2e9=_[_0x2092('0x37')](_0x537cb1,{'name':_0x537cb1[_0x2092('0x89')]||_0x537cb1[_0x2092('0x25')]||_0x14fd42[_0x2092('0x25')],'basename':_0xd4be5b,'savename':util[_0x2092('0x70')]('%s-%s.%s',_0x537cb1[_0x2092('0x25')]||_0x14fd42[_0x2092('0x25')],require(_0x2092('0x8a'))[_0x2092('0x8b')](0x4),_0x537cb1[_0x2092('0x8c')]||_0x2092('0x8d')),'reportId':_0x14fd42['id'],'reportType':_0x2092('0x8e')});return db[_0x2092('0x8f')]['create'](_0x3be2e9,{'raw':!![]});})[_0x2092('0x22')](function(_0x47941b){if(_0x14fd42['table']==='cdr'){_0x9fe078[_0x2092('0x33')](_0x14fd42[_0x2092('0x6b')]+_0x2092('0x90'),_0x537cb1[_0x2092('0x91')],_0x537cb1['endDate']);}else{_0x9fe078['where'](_0x14fd42['table']+_0x2092('0x92'),_0x537cb1[_0x2092('0x91')],_0x537cb1[_0x2092('0x93')]);}if(_0x47941b){logger[_0x2092('0x94')]('Run\x20Query:',_0x9fe078[_0x2092('0x86')]());require(_0x2092('0x95'))[_0x2092('0x96')](path['join'](__dirname,'../../components/export/',_0x47941b[_0x2092('0x8c')]),[_0x47941b['id'],_0x9fe078[_0x2092('0x86')](),path[_0x2092('0x4c')](__dirname,_0x2092('0x97'),_0x47941b[_0x2092('0x98')]),_0xd4be5b]);return _0x47941b;}else{var _0x12a1e0=squel['select']();_0x12a1e0[_0x2092('0x6a')]('('+_0x9fe078['toString']()+')',_0x2092('0x99'));_0x12a1e0[_0x2092('0x3a')]('COUNT(*)',_0x2092('0x17'));_0x9fe078[_0x2092('0x19')](_0x537cb1['limit']||_0x1af1df);_0x9fe078[_0x2092('0x18')](_0x537cb1[_0x2092('0x18')]||0x0);return db[_0x2092('0x7e')][_0x2092('0x2b')](_0x12a1e0[_0x2092('0x86')](),{'type':db[_0x2092('0x7e')][_0x2092('0x7f')][_0x2092('0x80')]})[_0x2092('0x22')](function(_0x4f32f7){if(!_0x4f32f7[_0x2092('0x2f')]){_0x284b15=0x0;}else{_0x284b15=_0x4f32f7[0x0]['count']||0x0;}return db[_0x2092('0x7e')]['query'](_0x9fe078['toString'](),{'type':db[_0x2092('0x7e')]['QueryTypes'][_0x2092('0x80')]});})['then'](function(_0x4f157a){return{'rows':_0x4f157a||[],'count':_0x284b15};});}});}exports[_0x2092('0x9a')]=function(_0x295e48,_0x222c38){return runReport(_0x295e48[_0x2092('0x3f')],_0x295e48[_0x2092('0x2b')],_0x295e48[_0x2092('0x9b')])[_0x2092('0x22')](respondWithResult(_0x222c38,null))[_0x2092('0x4a')](handleError(_0x222c38,null));};exports[_0x2092('0x9c')]=runReport;exports[_0x2092('0x2b')]=function(_0x596a8a,_0x68b7c6){var _0x1c1bd3=0xa;var _0x4aad7d=[_0x2092('0x4c'),_0x2092('0x4d'),_0x2092('0x4e'),_0x2092('0x9d')];var _0x2e6638={'SUM':_0x2092('0x4f'),'COUNT':_0x2092('0x50'),'COUNT DISTINCT':_0x2092('0x51'),'MAX':_0x2092('0x52'),'MIN':_0x2092('0x53'),'AVG':_0x2092('0x9e'),'GROUP_CONCAT':_0x2092('0x54'),'GROUP_CONCAT ASC':_0x2092('0x81'),'GROUP_CONCAT DESC':_0x2092('0x55')};var _0x30d844={'SEC_TO_TIME':_0x2092('0x56'),'DATE':_0x2092('0x57'),'HOUR':_0x2092('0x58'),'ROUND':_0x2092('0x59'),'UNIX_TIMESTAMP':_0x2092('0x5a')};var _0x477b5f=function(_0x350476){return!_[_0x2092('0x5b')]([_0x2092('0x5c'),_0x2092('0x9f'),_0x2092('0x5d'),_0x2092('0x5e')],_0x350476);};var _0x5f48e6=function(_0x2a5050){if(!_0x2a5050||!_0x2a5050[_0x2092('0x5f')][_0x2092('0x2f')]){return'';}for(var _0x1c7780='(',_0x2ce4ff=0x0;_0x2ce4ff<_0x2a5050[_0x2092('0x5f')][_0x2092('0x2f')];_0x2ce4ff+=0x1){_0x2ce4ff>0x0&&(_0x1c7780+='\x20'+_0x2a5050['operator']+'\x20');_0x1c7780+=_0x2a5050['rules'][_0x2ce4ff][_0x2092('0x61')]?_0x5f48e6(_0x2a5050[_0x2092('0x5f')][_0x2ce4ff][_0x2092('0x61')]):_0x2a5050[_0x2092('0x5f')][_0x2ce4ff][_0x2092('0x3a')]+'\x20'+_0x2a5050[_0x2092('0x5f')][_0x2ce4ff][_0x2092('0x62')]+(_0x477b5f(_0x2a5050['rules'][_0x2ce4ff][_0x2092('0x62')])?'\x20'+_0x2a5050[_0x2092('0x5f')][_0x2ce4ff]['value']:'');}return _0x1c7780+')';};var _0x469a09={'where':{'id':_0x596a8a[_0x2092('0x3f')]['id']}},_0x36b8aa,_0xefd6bb,_0xfa4628,_0x50b890,_0x1ec079;_0x469a09=_[_0x2092('0x37')]({},_0x469a09,_0x596a8a['options']);return db[_0x2092('0x28')][_0x2092('0x41')](_0x469a09)[_0x2092('0x22')](function(_0x4d7b5b){if(_0x4d7b5b){_0x36b8aa=_0x4d7b5b;return _0x4d7b5b[_0x2092('0x64')]();}return null;})['then'](function(_0x1ab1d4){if(_0x1ab1d4){if(!_0x1ab1d4[_0x2092('0x2f')]){throw new db['Sequelize'][(_0x2092('0x83'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xefd6bb=_0x1ab1d4;return db[_0x2092('0x66')][_0x2092('0x67')]({'raw':!![]});}return null;})['then'](function(_0x4221ff){if(_0x4221ff){_0xfa4628=_['keyBy'](_0x4221ff,'id');var _0x2dc0cd;var _0x2e19c5=squel['select']();_0x2e19c5['from'](_0x36b8aa[_0x2092('0x6b')]);for(var _0x2ae90b=0x0;_0x2ae90b<_0xefd6bb[_0x2092('0x2f')];_0x2ae90b+=0x1){_0x2dc0cd=_0xefd6bb[_0x2ae90b][_0x2092('0x6c')]?_0xfa4628[_0xefd6bb[_0x2ae90b][_0x2092('0x6c')]]['metric']:_0xefd6bb[_0x2ae90b]['field'];_0x2dc0cd=_0xefd6bb[_0x2ae90b][_0x2092('0x6e')]?_['replace'](_0x2e6638[_0xefd6bb[_0x2ae90b]['function']],'%s',_0x2dc0cd):_0x2dc0cd;_0x2dc0cd=_0xefd6bb[_0x2ae90b][_0x2092('0x70')]?_[_0x2092('0x6f')](_0x30d844[_0xefd6bb[_0x2ae90b][_0x2092('0x70')]],'%s',_0x2dc0cd):_0x2dc0cd;if(_0xefd6bb[_0x2ae90b]['groupBy']){_0x2e19c5[_0x2092('0x61')](_0x2dc0cd);}_0xefd6bb[_0x2ae90b]['orderBy']&&_0x2e19c5[_0x2092('0x72')](_0x2dc0cd,_0xefd6bb[_0x2ae90b]['orderBy']===_0x2092('0x73')?![]:!![]);_0x2e19c5[_0x2092('0x3a')](_0x2dc0cd,_0xefd6bb[_0x2ae90b][_0x2092('0x74')]||_0x2dc0cd);}if(_0x36b8aa[_0x2092('0x75')]){_0x36b8aa['joins']=JSON['parse'](_0x36b8aa[_0x2092('0x75')]);for(var _0x4a6ff3=0x0;_0x4a6ff3<_0x36b8aa[_0x2092('0x75')][_0x2092('0x2f')];_0x4a6ff3+=0x1){if(_0x36b8aa[_0x2092('0x75')][_0x4a6ff3]['type']&&_[_0x2092('0x5b')](_0x4aad7d,_0x36b8aa[_0x2092('0x75')][_0x4a6ff3][_0x2092('0x38')])&&_0x36b8aa[_0x2092('0x75')][_0x4a6ff3][_0x2092('0x76')]&&_0x36b8aa[_0x2092('0x75')][_0x4a6ff3]['foreignTable']&&_0x36b8aa[_0x2092('0x75')][_0x4a6ff3]['foreignKey']){_0x2e19c5[_0x36b8aa[_0x2092('0x75')][_0x4a6ff3][_0x2092('0x38')]](_0x36b8aa[_0x2092('0x75')][_0x4a6ff3][_0x2092('0x77')],null,util['format'](_0x2092('0x79'),_0x36b8aa['table'],_0x36b8aa[_0x2092('0x75')][_0x4a6ff3]['parentKey'],_0x36b8aa['joins'][_0x4a6ff3]['foreignTable'],_0x36b8aa[_0x2092('0x75')][_0x4a6ff3][_0x2092('0x78')]));}}}if(_0x36b8aa[_0x2092('0x7a')]){_0x36b8aa['conditions']=JSON[_0x2092('0x7b')](_0x36b8aa['conditions']);_0x2e19c5[_0x2092('0x33')](_0x5f48e6(_0x36b8aa[_0x2092('0x7a')]['group']));}_0x1ec079=_0x2e19c5[_0x2092('0x7c')]();_0x2e19c5[_0x2092('0x19')](_0x1c1bd3);_0x2e19c5['offset'](0x0);logger[_0x2092('0x85')](_0x2092('0x7d'),_0x2e19c5[_0x2092('0x86')]());return db[_0x2092('0x7e')][_0x2092('0x2b')](_0x2e19c5['toString'](),{'type':db[_0x2092('0x7e')][_0x2092('0x7f')][_0x2092('0x80')]});}})[_0x2092('0x22')](function(){return{'sql':_0x1ec079[_0x2092('0x86')]()};})[_0x2092('0x22')](respondWithResult(_0x68b7c6,null))[_0x2092('0x4a')](handleError(_0x68b7c6,null));}; \ No newline at end of file +var _0x5947=['joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','debug','toString','sequelize','QueryTypes','right_join','UNIX_TIMESTAMP(%s)','condition','getFields','AnalyticMetric','keyBy','MetricId','metric','alias','parse','clone','SELECT','No\x20available\x20data','randomstring','generate','output','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','join','../../components/export/','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20EMPTY','Limited\x20Query:','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','index','AnalyticDefaultReport','rawAttributes','keys','filters','intersection','attributes','model','fields','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','select','from','table','replace','function','format','groupBy','orderBy','DESC'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x5947,0x16e));var _0x7594=function(_0x3abab5,_0x517ed1){_0x3abab5=_0x3abab5-0x0;var _0x16b442=_0x5947[_0x3abab5];return _0x16b442;};'use strict';var pdf=require(_0x7594('0x0'));var emlformat=require(_0x7594('0x1'));var rimraf=require(_0x7594('0x2'));var zipdir=require(_0x7594('0x3'));var jsonpatch=require(_0x7594('0x4'));var rp=require(_0x7594('0x5'));var moment=require(_0x7594('0x6'));var BPromise=require(_0x7594('0x7'));var Mustache=require(_0x7594('0x8'));var util=require(_0x7594('0x9'));var path=require(_0x7594('0xa'));var sox=require(_0x7594('0xb'));var csv=require(_0x7594('0xc'));var ejs=require(_0x7594('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7594('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7594('0xf'));var toCsv=require(_0x7594('0xc'));var querystring=require(_0x7594('0x10'));var Papa=require(_0x7594('0x11'));var Redis=require(_0x7594('0x12'));var authService=require(_0x7594('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7594('0x14'));var logger=require(_0x7594('0x15'))('api');var utils=require(_0x7594('0x16'));var config=require('../../config/environment');var db=require(_0x7594('0x17'))['db'];function respondWithStatusCode(_0x361622,_0x26584c){_0x26584c=_0x26584c||0xcc;return function(_0x20eb05){if(_0x20eb05){return _0x361622[_0x7594('0x18')](_0x26584c);}return _0x361622[_0x7594('0x19')](_0x26584c)[_0x7594('0x1a')]();};}function respondWithResult(_0x28e909,_0x26db53){_0x26db53=_0x26db53||0xc8;return function(_0x312880){if(_0x312880){return _0x28e909[_0x7594('0x19')](_0x26db53)[_0x7594('0x1b')](_0x312880);}};}function respondWithFilteredResult(_0x540ad2,_0x44d6d9){return function(_0x15fcac){if(_0x15fcac){var _0x5a7968=_0x15fcac[_0x7594('0x1c')],_0x5e248b=_0x44d6d9[_0x7594('0x1d')],_0x45e12e=_0x44d6d9['offset']+_0x44d6d9[_0x7594('0x1e')],_0x44306;if(_0x45e12e>=_0x5a7968){_0x45e12e=_0x5a7968;_0x44306=0xc8;}else{_0x44306=0xce;}_0x540ad2[_0x7594('0x19')](_0x44306);return _0x540ad2[_0x7594('0x1f')](_0x7594('0x20'),_0x5e248b+'-'+_0x45e12e+'/'+_0x5a7968)['json'](_0x15fcac);}return null;};}function patchUpdates(_0x298685){return function(_0x5b8c2b){try{jsonpatch[_0x7594('0x21')](_0x5b8c2b,_0x298685,!![]);}catch(_0x5ee0dd){return BPromise['reject'](_0x5ee0dd);}return _0x5b8c2b[_0x7594('0x22')]();};}function saveUpdates(_0x4e1ba5,_0x1dd800){return function(_0x174cb5){if(_0x174cb5){return _0x174cb5[_0x7594('0x23')](_0x4e1ba5)[_0x7594('0x24')](function(_0x3aaf4f){return _0x3aaf4f;});}return null;};}function removeEntity(_0x90a8e8,_0x385b1b){return function(_0x1b0ad4){if(_0x1b0ad4){return _0x1b0ad4['destroy']()[_0x7594('0x24')](function(){var _0x2600ec=_0x1b0ad4[_0x7594('0x25')]({'plain':!![]});var _0x5bf6a6=_0x7594('0x26');return db[_0x7594('0x27')][_0x7594('0x28')]({'where':{'type':_0x5bf6a6,'resourceId':_0x2600ec['id']}})[_0x7594('0x24')](function(){return _0x1b0ad4;});})[_0x7594('0x24')](function(){_0x90a8e8[_0x7594('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e73db,_0x538961){return function(_0x53f248){if(!_0x53f248){_0x1e73db['sendStatus'](0x194);}return _0x53f248;};}function handleError(_0x5ab31f,_0x5b5b6e){_0x5b5b6e=_0x5b5b6e||0x1f4;return function(_0x4b7165){logger[_0x7594('0x29')](_0x4b7165[_0x7594('0x2a')]);if(_0x4b7165[_0x7594('0x2b')]){delete _0x4b7165['name'];}_0x5ab31f[_0x7594('0x19')](_0x5b5b6e)['send'](_0x4b7165);};}exports[_0x7594('0x2c')]=function(_0x26b1c0,_0x2ef8d8){var _0x42e9bd={},_0x45a19a={},_0x2b0c84={'count':0x0,'rows':[]};var _0x49089a=db[_0x7594('0x2d')][_0x7594('0x2e')];_0x45a19a['model']=_['keys'](_0x49089a);_0x45a19a['query']=_[_0x7594('0x2f')](_0x26b1c0['query']);_0x45a19a[_0x7594('0x30')]=_[_0x7594('0x31')](_0x45a19a['model'],_0x45a19a['query']);_0x42e9bd[_0x7594('0x32')]=_[_0x7594('0x31')](_0x45a19a[_0x7594('0x33')],qs[_0x7594('0x34')](_0x26b1c0[_0x7594('0x35')][_0x7594('0x34')]));_0x42e9bd[_0x7594('0x32')]=_0x42e9bd[_0x7594('0x32')]['length']?_0x42e9bd[_0x7594('0x32')]:_0x45a19a[_0x7594('0x33')];if(!_0x26b1c0[_0x7594('0x35')][_0x7594('0x36')](_0x7594('0x37'))){_0x42e9bd[_0x7594('0x1e')]=qs['limit'](_0x26b1c0[_0x7594('0x35')][_0x7594('0x1e')]);_0x42e9bd[_0x7594('0x1d')]=qs['offset'](_0x26b1c0[_0x7594('0x35')]['offset']);}_0x42e9bd[_0x7594('0x38')]=qs[_0x7594('0x39')](_0x26b1c0['query'][_0x7594('0x39')]);_0x42e9bd[_0x7594('0x3a')]=qs[_0x7594('0x30')](_[_0x7594('0x3b')](_0x26b1c0[_0x7594('0x35')],_0x45a19a[_0x7594('0x30')]));if(_0x26b1c0[_0x7594('0x35')][_0x7594('0x3c')]){_0x42e9bd[_0x7594('0x3a')]=_[_0x7594('0x3d')](_0x42e9bd[_0x7594('0x3a')],{'$or':_[_0x7594('0x3e')](_0x49089a,function(_0x171078){if(_0x171078[_0x7594('0x3f')]['key']!=='VIRTUAL'){var _0x85b159={};_0x85b159[_0x171078[_0x7594('0x40')]]={'$like':'%'+_0x26b1c0[_0x7594('0x35')][_0x7594('0x3c')]+'%'};return _0x85b159;}})});}_0x42e9bd=_['merge']({},_0x42e9bd,_0x26b1c0[_0x7594('0x41')]);var _0x5264c2={'where':_0x42e9bd[_0x7594('0x3a')]};return db[_0x7594('0x2d')][_0x7594('0x1c')](_0x5264c2)[_0x7594('0x24')](function(_0xc5223c){_0x2b0c84[_0x7594('0x1c')]=_0xc5223c;if(_0x26b1c0[_0x7594('0x35')][_0x7594('0x42')]){_0x42e9bd[_0x7594('0x43')]=[{'all':!![]}];}return db[_0x7594('0x2d')][_0x7594('0x44')](_0x42e9bd);})['then'](function(_0x37780f){_0x2b0c84[_0x7594('0x45')]=_0x37780f;return _0x2b0c84;})['then'](respondWithFilteredResult(_0x2ef8d8,_0x42e9bd))[_0x7594('0x46')](handleError(_0x2ef8d8,null));};exports[_0x7594('0x47')]=function(_0x434c25,_0x1a4291){var _0x8b8f34={'raw':!![],'where':{'id':_0x434c25[_0x7594('0x48')]['id']}},_0x2aa835={};_0x2aa835['model']=_[_0x7594('0x2f')](db[_0x7594('0x2d')]['rawAttributes']);_0x2aa835[_0x7594('0x35')]=_['keys'](_0x434c25['query']);_0x2aa835[_0x7594('0x30')]=_['intersection'](_0x2aa835[_0x7594('0x33')],_0x2aa835['query']);_0x8b8f34[_0x7594('0x32')]=_[_0x7594('0x31')](_0x2aa835[_0x7594('0x33')],qs[_0x7594('0x34')](_0x434c25['query']['fields']));_0x8b8f34['attributes']=_0x8b8f34[_0x7594('0x32')][_0x7594('0x49')]?_0x8b8f34['attributes']:_0x2aa835[_0x7594('0x33')];if(_0x434c25[_0x7594('0x35')][_0x7594('0x42')]){_0x8b8f34['include']=[{'all':!![]}];}_0x8b8f34=_[_0x7594('0x3d')]({},_0x8b8f34,_0x434c25[_0x7594('0x41')]);return db[_0x7594('0x2d')][_0x7594('0x4a')](_0x8b8f34)['then'](handleEntityNotFound(_0x1a4291,null))['then'](respondWithResult(_0x1a4291,null))[_0x7594('0x46')](handleError(_0x1a4291,null));};exports[_0x7594('0x4b')]=function(_0x3563b9,_0x344510){return db[_0x7594('0x2d')][_0x7594('0x4b')](_0x3563b9['body'],{})[_0x7594('0x24')](function(_0xcf3821){var _0x1f47a0=_0x3563b9[_0x7594('0x4c')][_0x7594('0x25')]({'plain':!![]});if(!_0x1f47a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f47a0[_0x7594('0x4d')]===_0x7594('0x4c')){var _0x123656=_0xcf3821['get']({'plain':!![]});var _0x3ee159='Reports';return db[_0x7594('0x4e')][_0x7594('0x4a')]({'where':{'name':_0x3ee159,'userProfileId':_0x1f47a0['userProfileId']},'raw':!![]})[_0x7594('0x24')](function(_0xe4a086){if(_0xe4a086&&_0xe4a086[_0x7594('0x4f')]===0x0){return db[_0x7594('0x27')][_0x7594('0x4b')]({'name':_0x123656[_0x7594('0x2b')],'resourceId':_0x123656['id'],'type':_0x7594('0x26'),'sectionId':_0xe4a086['id']},{})[_0x7594('0x24')](function(){return _0xcf3821;});}else{return _0xcf3821;}})[_0x7594('0x46')](function(_0x4abd8f){logger['error'](_0x7594('0x50'),_0x4abd8f);throw _0x4abd8f;});}return _0xcf3821;})[_0x7594('0x24')](respondWithResult(_0x344510,0xc9))[_0x7594('0x46')](handleError(_0x344510,null));};exports[_0x7594('0x23')]=function(_0x498267,_0x2423c7){if(_0x498267['body']['id']){delete _0x498267['body']['id'];}return db[_0x7594('0x2d')][_0x7594('0x4a')]({'where':{'id':_0x498267[_0x7594('0x48')]['id']}})[_0x7594('0x24')](handleEntityNotFound(_0x2423c7,null))['then'](saveUpdates(_0x498267[_0x7594('0x51')],null))[_0x7594('0x24')](respondWithResult(_0x2423c7,null))[_0x7594('0x46')](handleError(_0x2423c7,null));};exports[_0x7594('0x28')]=function(_0x419024,_0x47d310){return db['AnalyticDefaultReport'][_0x7594('0x4a')]({'where':{'id':_0x419024[_0x7594('0x48')]['id']}})[_0x7594('0x24')](handleEntityNotFound(_0x47d310,null))[_0x7594('0x24')](removeEntity(_0x47d310,null))[_0x7594('0x46')](handleError(_0x47d310,null));};exports[_0x7594('0x52')]=function(_0x44f557,_0xfdc9aa){var _0x3bef4e=0xa;var _0x1fadcb=['join',_0x7594('0x53'),'right_join',_0x7594('0x54')];var _0xcca3cc={'SUM':_0x7594('0x55'),'COUNT':_0x7594('0x56'),'COUNT DISTINCT':_0x7594('0x57'),'MAX':_0x7594('0x58'),'MIN':_0x7594('0x59'),'AVG':_0x7594('0x5a'),'GROUP_CONCAT':_0x7594('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7594('0x5c')};var _0x8175ee={'SEC_TO_TIME':_0x7594('0x5d'),'DATE':_0x7594('0x5e'),'HOUR':_0x7594('0x5f'),'ROUND':_0x7594('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d7be1=function(_0x2f2524){return!_[_0x7594('0x61')]([_0x7594('0x62'),_0x7594('0x63'),'IS\x20EMPTY',_0x7594('0x64')],_0x2f2524);};var _0x54082d=function(_0x3b0f1b){if(!_0x3b0f1b||!_0x3b0f1b[_0x7594('0x65')][_0x7594('0x49')]){return'';}for(var _0x5142ee='(',_0x1b62fc=0x0;_0x1b62fc<_0x3b0f1b[_0x7594('0x65')][_0x7594('0x49')];_0x1b62fc+=0x1){_0x1b62fc>0x0&&(_0x5142ee+='\x20'+_0x3b0f1b[_0x7594('0x66')]+'\x20');_0x5142ee+=_0x3b0f1b[_0x7594('0x65')][_0x1b62fc][_0x7594('0x67')]?_0x54082d(_0x3b0f1b[_0x7594('0x65')][_0x1b62fc][_0x7594('0x67')]):_0x3b0f1b['rules'][_0x1b62fc][_0x7594('0x40')]+'\x20'+_0x3b0f1b[_0x7594('0x65')][_0x1b62fc]['condition']+(_0x2d7be1(_0x3b0f1b[_0x7594('0x65')][_0x1b62fc]['condition'])?'\x20'+_0x3b0f1b['rules'][_0x1b62fc][_0x7594('0x68')]:'');}return _0x5142ee+')';};var _0x1eef6d={'where':{'id':_0x44f557[_0x7594('0x48')]['id']}},_0x5599d0,_0x2838c2,_0xede814,_0x26fe83,_0x3407b4;_0x1eef6d=_[_0x7594('0x3d')]({},_0x1eef6d,_0x44f557[_0x7594('0x41')]);return db[_0x7594('0x2d')][_0x7594('0x4a')](_0x1eef6d)[_0x7594('0x24')](function(_0x34a4c0){if(_0x34a4c0){_0x5599d0=_0x34a4c0;return _0x34a4c0['getFields']();}return null;})[_0x7594('0x24')](function(_0x2e67c6){if(_0x2e67c6){if(!_0x2e67c6[_0x7594('0x49')]){throw new db[(_0x7594('0x69'))][(_0x7594('0x6a'))](_0x7594('0x6b'),0x193);}_0x2838c2=_0x2e67c6;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7594('0x24')](function(_0x3a4225){if(_0x3a4225){_0xede814=_['keyBy'](_0x3a4225,'id');var _0x46ba65;var _0x47ac62=squel[_0x7594('0x6c')]();_0x47ac62[_0x7594('0x6d')](_0x5599d0[_0x7594('0x6e')]);for(var _0x4e2aee=0x0;_0x4e2aee<_0x2838c2['length'];_0x4e2aee+=0x1){_0x46ba65=_0x2838c2[_0x4e2aee]['MetricId']?_0xede814[_0x2838c2[_0x4e2aee]['MetricId']]['metric']:_0x2838c2[_0x4e2aee][_0x7594('0x40')];_0x46ba65=_0x2838c2[_0x4e2aee]['function']?_[_0x7594('0x6f')](_0xcca3cc[_0x2838c2[_0x4e2aee][_0x7594('0x70')]],'%s',_0x46ba65):_0x46ba65;_0x46ba65=_0x2838c2[_0x4e2aee]['format']?_[_0x7594('0x6f')](_0x8175ee[_0x2838c2[_0x4e2aee][_0x7594('0x71')]],'%s',_0x46ba65):_0x46ba65;if(_0x2838c2[_0x4e2aee][_0x7594('0x72')]){_0x47ac62[_0x7594('0x67')](_0x46ba65);}_0x2838c2[_0x4e2aee][_0x7594('0x73')]&&_0x47ac62[_0x7594('0x38')](_0x46ba65,_0x2838c2[_0x4e2aee]['orderBy']===_0x7594('0x74')?![]:!![]);_0x47ac62[_0x7594('0x40')](_0x46ba65,_0x2838c2[_0x4e2aee]['alias']||_0x46ba65);}if(_0x5599d0[_0x7594('0x75')]){_0x5599d0[_0x7594('0x75')]=JSON['parse'](_0x5599d0[_0x7594('0x75')]);for(var _0x3d84b6=0x0;_0x3d84b6<_0x5599d0['joins'][_0x7594('0x49')];_0x3d84b6+=0x1){if(_0x5599d0[_0x7594('0x75')][_0x3d84b6]['type']&&_[_0x7594('0x61')](_0x1fadcb,_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x3f')])&&_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x76')]&&_0x5599d0['joins'][_0x3d84b6][_0x7594('0x77')]&&_0x5599d0[_0x7594('0x75')][_0x3d84b6]['foreignKey']){_0x47ac62[_0x5599d0['joins'][_0x3d84b6]['type']](_0x5599d0['joins'][_0x3d84b6][_0x7594('0x77')],null,util[_0x7594('0x71')](_0x7594('0x78'),_0x5599d0[_0x7594('0x6e')],_0x5599d0[_0x7594('0x75')][_0x3d84b6]['parentKey'],_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x77')],_0x5599d0[_0x7594('0x75')][_0x3d84b6][_0x7594('0x79')]));}}}if(_0x5599d0[_0x7594('0x7a')]){_0x5599d0[_0x7594('0x7a')]=JSON['parse'](_0x5599d0[_0x7594('0x7a')]);_0x47ac62['where'](_0x54082d(_0x5599d0['conditions'][_0x7594('0x67')]));}_0x3407b4=_0x47ac62['clone']();_0x47ac62['limit'](_0x3bef4e);_0x47ac62[_0x7594('0x1d')](0x0);logger[_0x7594('0x7b')]('Limited\x20Query:',_0x47ac62[_0x7594('0x7c')]());return db[_0x7594('0x7d')][_0x7594('0x35')](_0x47ac62[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')]['SELECT']});}})['then'](respondWithResult(_0xfdc9aa,null))[_0x7594('0x46')](handleError(_0xfdc9aa,null));};function runReport(_0x5d6a71,_0x18e4bf,_0x4c6762){var _0x54c926=_0x18e4bf[_0x7594('0x2b')];var _0x4619f2=0xa;var _0x58b5b8=['join','left_join',_0x7594('0x7f'),'cross_join'];var _0x4546c6={'SUM':'SUM(%s)','COUNT':_0x7594('0x56'),'COUNT DISTINCT':_0x7594('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7594('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7594('0x5c')};var _0x3f63f6={'SEC_TO_TIME':_0x7594('0x5d'),'DATE':'DATE(%s)','HOUR':_0x7594('0x5f'),'ROUND':_0x7594('0x60'),'UNIX_TIMESTAMP':_0x7594('0x80')};var _0x569aa8=function(_0x354917){return!_['includes']([_0x7594('0x62'),_0x7594('0x63'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x354917);};var _0x4ae2ba=function(_0x3268ee){if(!_0x3268ee||!_0x3268ee[_0x7594('0x65')]['length']){return'';}for(var _0x43f625='(',_0x10f787=0x0;_0x10f787<_0x3268ee['rules'][_0x7594('0x49')];_0x10f787+=0x1){_0x10f787>0x0&&(_0x43f625+='\x20'+_0x3268ee[_0x7594('0x66')]+'\x20');_0x43f625+=_0x3268ee[_0x7594('0x65')][_0x10f787]['group']?_0x4ae2ba(_0x3268ee['rules'][_0x10f787][_0x7594('0x67')]):_0x3268ee[_0x7594('0x65')][_0x10f787][_0x7594('0x40')]+'\x20'+_0x3268ee['rules'][_0x10f787][_0x7594('0x81')]+(_0x569aa8(_0x3268ee[_0x7594('0x65')][_0x10f787][_0x7594('0x81')])?'\x20'+_0x3268ee[_0x7594('0x65')][_0x10f787]['value']:'');}return _0x43f625+')';};var _0x4f8b95={'where':{'id':_0x5d6a71['id']}},_0x29dba9,_0x275e61,_0x29c579,_0x323e05,_0x466461;_0x4f8b95=_[_0x7594('0x3d')]({},_0x4f8b95,_0x4c6762);return db[_0x7594('0x2d')][_0x7594('0x4a')](_0x4f8b95)[_0x7594('0x24')](function(_0x5d5279){if(_0x5d5279){_0x29dba9=_0x5d5279;return _0x5d5279[_0x7594('0x82')]();}return null;})[_0x7594('0x24')](function(_0x2c49e7){if(_0x2c49e7){if(!_0x2c49e7['length']){throw new db['Sequelize'][(_0x7594('0x6a'))](_0x7594('0x6b'),0x193);}_0x275e61=_0x2c49e7;return db[_0x7594('0x83')][_0x7594('0x44')]({'raw':!![]});}return null;})['then'](function(_0x2db21f){if(_0x2db21f){_0x29c579=_[_0x7594('0x84')](_0x2db21f,'id');var _0x485d85;var _0x14fd85=squel[_0x7594('0x6c')]();_0x14fd85[_0x7594('0x6d')](_0x29dba9[_0x7594('0x6e')]);for(var _0x3f363c=0x0;_0x3f363c<_0x275e61['length'];_0x3f363c+=0x1){_0x485d85=_0x275e61[_0x3f363c][_0x7594('0x85')]?_0x29c579[_0x275e61[_0x3f363c][_0x7594('0x85')]][_0x7594('0x86')]:_0x275e61[_0x3f363c]['field'];_0x485d85=_0x275e61[_0x3f363c][_0x7594('0x70')]?_[_0x7594('0x6f')](_0x4546c6[_0x275e61[_0x3f363c]['function']],'%s',_0x485d85):_0x485d85;_0x485d85=_0x275e61[_0x3f363c][_0x7594('0x71')]?_[_0x7594('0x6f')](_0x3f63f6[_0x275e61[_0x3f363c][_0x7594('0x71')]],'%s',_0x485d85):_0x485d85;if(_0x275e61[_0x3f363c][_0x7594('0x72')]){_0x14fd85[_0x7594('0x67')](_0x485d85);}_0x275e61[_0x3f363c][_0x7594('0x73')]&&_0x14fd85[_0x7594('0x38')](_0x485d85,_0x275e61[_0x3f363c][_0x7594('0x73')]===_0x7594('0x74')?![]:!![]);_0x14fd85['field'](_0x485d85,_0x275e61[_0x3f363c][_0x7594('0x87')]||_0x485d85);}if(_0x29dba9[_0x7594('0x75')]){_0x29dba9[_0x7594('0x75')]=JSON[_0x7594('0x88')](_0x29dba9[_0x7594('0x75')]);for(var _0x3203d8=0x0;_0x3203d8<_0x29dba9[_0x7594('0x75')][_0x7594('0x49')];_0x3203d8+=0x1){if(_0x29dba9['joins'][_0x3203d8][_0x7594('0x3f')]&&_[_0x7594('0x61')](_0x58b5b8,_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x3f')])&&_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x76')]&&_0x29dba9[_0x7594('0x75')][_0x3203d8]['foreignTable']&&_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x79')]){_0x14fd85[_0x29dba9[_0x7594('0x75')][_0x3203d8]['type']](_0x29dba9['joins'][_0x3203d8][_0x7594('0x77')],null,util[_0x7594('0x71')](_0x7594('0x78'),_0x29dba9['table'],_0x29dba9[_0x7594('0x75')][_0x3203d8][_0x7594('0x76')],_0x29dba9['joins'][_0x3203d8][_0x7594('0x77')],_0x29dba9['joins'][_0x3203d8][_0x7594('0x79')]));}}}if(_0x29dba9[_0x7594('0x7a')]){_0x29dba9[_0x7594('0x7a')]=JSON[_0x7594('0x88')](_0x29dba9[_0x7594('0x7a')]);_0x14fd85[_0x7594('0x3a')](_0x4ae2ba(_0x29dba9[_0x7594('0x7a')][_0x7594('0x67')]));}_0x466461=_0x14fd85[_0x7594('0x89')]();_0x14fd85[_0x7594('0x1e')](_0x4619f2);_0x14fd85['offset'](0x0);logger['debug']('Limited\x20Query:',_0x14fd85[_0x7594('0x7c')]());return db[_0x7594('0x7d')][_0x7594('0x35')](_0x14fd85[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')][_0x7594('0x8a')]});}})[_0x7594('0x24')](function(_0xdc3d05){if(!_0xdc3d05[_0x7594('0x49')]){throw new db[(_0x7594('0x69'))]['ValidationErrorItem'](_0x7594('0x8b'),0xcc);}if(_0x18e4bf['output']==='web'){return null;}var _0x1e9e7c=_[_0x7594('0x3d')](_0x18e4bf,{'name':_0x18e4bf['fullPath']||_0x18e4bf[_0x7594('0x2b')]||_0x29dba9[_0x7594('0x2b')],'basename':_0x54c926,'savename':util['format']('%s-%s.%s',_0x18e4bf[_0x7594('0x2b')]||_0x29dba9[_0x7594('0x2b')],require(_0x7594('0x8c'))[_0x7594('0x8d')](0x4),_0x18e4bf[_0x7594('0x8e')]||_0x7594('0x8f')),'reportId':_0x29dba9['id'],'reportType':_0x7594('0x90')});return db['AnalyticExtractedReport']['create'](_0x1e9e7c,{'raw':!![]});})['then'](function(_0x276d20){if(_0x29dba9[_0x7594('0x6e')]===_0x7594('0x91')){_0x466461[_0x7594('0x3a')](_0x29dba9['table']+_0x7594('0x92'),_0x18e4bf['startDate'],_0x18e4bf['endDate']);}else{_0x466461['where'](_0x29dba9[_0x7594('0x6e')]+_0x7594('0x93'),_0x18e4bf['startDate'],_0x18e4bf['endDate']);}if(_0x276d20){logger[_0x7594('0x94')](_0x7594('0x95'),_0x466461[_0x7594('0x7c')]());require(_0x7594('0x96'))[_0x7594('0x97')](path[_0x7594('0x98')](__dirname,_0x7594('0x99'),_0x276d20['output']),[_0x276d20['id'],_0x466461[_0x7594('0x7c')](),path['join'](__dirname,'../../files/reports',_0x276d20['savename']),_0x54c926]);return _0x276d20;}else{var _0x493225=squel[_0x7594('0x6c')]();_0x493225[_0x7594('0x6d')]('('+_0x466461['toString']()+')',_0x7594('0x9a'));_0x493225[_0x7594('0x40')](_0x7594('0x9b'),_0x7594('0x1c'));_0x466461['limit'](_0x18e4bf[_0x7594('0x1e')]||_0x4619f2);_0x466461[_0x7594('0x1d')](_0x18e4bf['offset']||0x0);return db[_0x7594('0x7d')][_0x7594('0x35')](_0x493225[_0x7594('0x7c')](),{'type':db['sequelize'][_0x7594('0x7e')][_0x7594('0x8a')]})[_0x7594('0x24')](function(_0x24a2ff){if(!_0x24a2ff[_0x7594('0x49')]){_0x323e05=0x0;}else{_0x323e05=_0x24a2ff[0x0][_0x7594('0x1c')]||0x0;}return db[_0x7594('0x7d')][_0x7594('0x35')](_0x466461[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')]['SELECT']});})[_0x7594('0x24')](function(_0x1f6ff3){return{'rows':_0x1f6ff3||[],'count':_0x323e05};});}});}exports[_0x7594('0x9c')]=function(_0x7a1fbc,_0x5bc5e7){return runReport(_0x7a1fbc['params'],_0x7a1fbc[_0x7594('0x35')],_0x7a1fbc['options'])[_0x7594('0x24')](respondWithResult(_0x5bc5e7,null))[_0x7594('0x46')](handleError(_0x5bc5e7,null));};exports[_0x7594('0x9d')]=runReport;exports['query']=function(_0x570f09,_0x59c266){var _0x5c7db2=0xa;var _0x204a5d=[_0x7594('0x98'),'left_join',_0x7594('0x7f'),_0x7594('0x54')];var _0x52f990={'SUM':_0x7594('0x55'),'COUNT':_0x7594('0x56'),'COUNT DISTINCT':_0x7594('0x57'),'MAX':_0x7594('0x58'),'MIN':_0x7594('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7594('0x5b'),'GROUP_CONCAT ASC':_0x7594('0x9e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3f91ac={'SEC_TO_TIME':_0x7594('0x5d'),'DATE':_0x7594('0x5e'),'HOUR':_0x7594('0x5f'),'ROUND':_0x7594('0x60'),'UNIX_TIMESTAMP':_0x7594('0x80')};var _0x37dae3=function(_0x8bbe4c){return!_[_0x7594('0x61')]([_0x7594('0x62'),'IS\x20NOT\x20NULL',_0x7594('0x9f'),_0x7594('0x64')],_0x8bbe4c);};var _0xc5e24e=function(_0x556947){if(!_0x556947||!_0x556947['rules'][_0x7594('0x49')]){return'';}for(var _0x1da579='(',_0x4ae80d=0x0;_0x4ae80d<_0x556947[_0x7594('0x65')][_0x7594('0x49')];_0x4ae80d+=0x1){_0x4ae80d>0x0&&(_0x1da579+='\x20'+_0x556947[_0x7594('0x66')]+'\x20');_0x1da579+=_0x556947[_0x7594('0x65')][_0x4ae80d]['group']?_0xc5e24e(_0x556947[_0x7594('0x65')][_0x4ae80d][_0x7594('0x67')]):_0x556947[_0x7594('0x65')][_0x4ae80d]['field']+'\x20'+_0x556947['rules'][_0x4ae80d][_0x7594('0x81')]+(_0x37dae3(_0x556947[_0x7594('0x65')][_0x4ae80d][_0x7594('0x81')])?'\x20'+_0x556947[_0x7594('0x65')][_0x4ae80d][_0x7594('0x68')]:'');}return _0x1da579+')';};var _0x3f78f5={'where':{'id':_0x570f09[_0x7594('0x48')]['id']}},_0x4ce050,_0xeaa940,_0x2ad522,_0x266aee,_0x139f54;_0x3f78f5=_['merge']({},_0x3f78f5,_0x570f09[_0x7594('0x41')]);return db[_0x7594('0x2d')]['find'](_0x3f78f5)[_0x7594('0x24')](function(_0x55908e){if(_0x55908e){_0x4ce050=_0x55908e;return _0x55908e[_0x7594('0x82')]();}return null;})[_0x7594('0x24')](function(_0xa745e5){if(_0xa745e5){if(!_0xa745e5[_0x7594('0x49')]){throw new db[(_0x7594('0x69'))][(_0x7594('0x6a'))](_0x7594('0x6b'),0x193);}_0xeaa940=_0xa745e5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x7594('0x24')](function(_0x111010){if(_0x111010){_0x2ad522=_['keyBy'](_0x111010,'id');var _0xfa18d3;var _0x583d55=squel[_0x7594('0x6c')]();_0x583d55[_0x7594('0x6d')](_0x4ce050[_0x7594('0x6e')]);for(var _0x26daea=0x0;_0x26daea<_0xeaa940[_0x7594('0x49')];_0x26daea+=0x1){_0xfa18d3=_0xeaa940[_0x26daea][_0x7594('0x85')]?_0x2ad522[_0xeaa940[_0x26daea]['MetricId']][_0x7594('0x86')]:_0xeaa940[_0x26daea][_0x7594('0x40')];_0xfa18d3=_0xeaa940[_0x26daea]['function']?_[_0x7594('0x6f')](_0x52f990[_0xeaa940[_0x26daea]['function']],'%s',_0xfa18d3):_0xfa18d3;_0xfa18d3=_0xeaa940[_0x26daea]['format']?_[_0x7594('0x6f')](_0x3f91ac[_0xeaa940[_0x26daea][_0x7594('0x71')]],'%s',_0xfa18d3):_0xfa18d3;if(_0xeaa940[_0x26daea]['groupBy']){_0x583d55[_0x7594('0x67')](_0xfa18d3);}_0xeaa940[_0x26daea]['orderBy']&&_0x583d55['order'](_0xfa18d3,_0xeaa940[_0x26daea][_0x7594('0x73')]===_0x7594('0x74')?![]:!![]);_0x583d55[_0x7594('0x40')](_0xfa18d3,_0xeaa940[_0x26daea][_0x7594('0x87')]||_0xfa18d3);}if(_0x4ce050[_0x7594('0x75')]){_0x4ce050[_0x7594('0x75')]=JSON['parse'](_0x4ce050['joins']);for(var _0x763e86=0x0;_0x763e86<_0x4ce050[_0x7594('0x75')][_0x7594('0x49')];_0x763e86+=0x1){if(_0x4ce050[_0x7594('0x75')][_0x763e86]['type']&&_[_0x7594('0x61')](_0x204a5d,_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x3f')])&&_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x76')]&&_0x4ce050[_0x7594('0x75')][_0x763e86]['foreignTable']&&_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x79')]){_0x583d55[_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x3f')]](_0x4ce050['joins'][_0x763e86][_0x7594('0x77')],null,util['format'](_0x7594('0x78'),_0x4ce050[_0x7594('0x6e')],_0x4ce050[_0x7594('0x75')][_0x763e86][_0x7594('0x76')],_0x4ce050['joins'][_0x763e86][_0x7594('0x77')],_0x4ce050[_0x7594('0x75')][_0x763e86]['foreignKey']));}}}if(_0x4ce050[_0x7594('0x7a')]){_0x4ce050[_0x7594('0x7a')]=JSON[_0x7594('0x88')](_0x4ce050[_0x7594('0x7a')]);_0x583d55[_0x7594('0x3a')](_0xc5e24e(_0x4ce050[_0x7594('0x7a')][_0x7594('0x67')]));}_0x139f54=_0x583d55[_0x7594('0x89')]();_0x583d55[_0x7594('0x1e')](_0x5c7db2);_0x583d55[_0x7594('0x1d')](0x0);logger['debug'](_0x7594('0xa0'),_0x583d55[_0x7594('0x7c')]());return db['sequelize'][_0x7594('0x35')](_0x583d55[_0x7594('0x7c')](),{'type':db[_0x7594('0x7d')][_0x7594('0x7e')]['SELECT']});}})[_0x7594('0x24')](function(){return{'sql':_0x139f54[_0x7594('0x7c')]()};})['then'](respondWithResult(_0x59c266,null))[_0x7594('0x46')](handleError(_0x59c266,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 259a63b..4e55c22 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 _0xfb92=['rimraf','exports','define','AnalyticDefaultReport','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5dee44,_0x115b60){var _0x46f720=function(_0x169927){while(--_0x169927){_0x5dee44['push'](_0x5dee44['shift']());}};_0x46f720(++_0x115b60);}(_0xfb92,0x72));var _0x2fb9=function(_0x3f03f0,_0x2433d2){_0x3f03f0=_0x3f03f0-0x0;var _0x53d76a=_0xfb92[_0x3f03f0];return _0x53d76a;};'use strict';var _=require('lodash');var util=require(_0x2fb9('0x0'));var logger=require(_0x2fb9('0x1'))(_0x2fb9('0x2'));var moment=require(_0x2fb9('0x3'));var BPromise=require(_0x2fb9('0x4'));var rp=require(_0x2fb9('0x5'));var fs=require('fs');var path=require(_0x2fb9('0x6'));var rimraf=require(_0x2fb9('0x7'));var config=require('../../config/environment');var attributes=require('./analyticDefaultReport.attributes');module[_0x2fb9('0x8')]=function(_0x592455,_0x4dd4f1){return _0x592455[_0x2fb9('0x9')](_0x2fb9('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39b2=['./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3ac2a9,_0x2ec310){var _0x5053b9=function(_0x5f3fb2){while(--_0x5f3fb2){_0x3ac2a9['push'](_0x3ac2a9['shift']());}};_0x5053b9(++_0x2ec310);}(_0x39b2,0x89));var _0x239b=function(_0x5d3c9,_0x2d49a7){_0x5d3c9=_0x5d3c9-0x0;var _0x54284c=_0x39b2[_0x5d3c9];return _0x54284c;};'use strict';var _=require(_0x239b('0x0'));var util=require(_0x239b('0x1'));var logger=require(_0x239b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x239b('0x3'));var rp=require(_0x239b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x239b('0x5'));var config=require(_0x239b('0x6'));var attributes=require(_0x239b('0x7'));module[_0x239b('0x8')]=function(_0x46a593,_0x13896f){return _0x46a593[_0x239b('0x9')](_0x239b('0xa'),attributes,{'tableName':_0x239b('0xb'),'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 b9651be..8cc9b45 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 _0xf4eb=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x23119a,_0x213ff4){var _0x2a8b7e=function(_0x2333c3){while(--_0x2333c3){_0x23119a['push'](_0x23119a['shift']());}};_0x2a8b7e(++_0x213ff4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2b2494,_0x38c1b0){_0x2b2494=_0x2b2494-0x0;var _0xeefa09=_0xf4eb[_0x2b2494];return _0xeefa09;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x335a40,_0x4a3002){var _0x5d1309=function(_0x2a58f9){while(--_0x2a58f9){_0x335a40['push'](_0x335a40['shift']());}};_0x5d1309(++_0x4a3002);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2351c4,_0x1dca54){_0x2351c4=_0x2351c4-0x0;var _0x1dd3f8=_0xcb91[_0x2351c4];return _0x1dd3f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 377bf58..6b86e5e 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 _0x513f=['express','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','/:id/query','post','create','update','delete','destroy','exports','path','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x513f,0x70));var _0xf513=function(_0x452fd6,_0x16e730){_0x452fd6=_0x452fd6-0x0;var _0x2ce08e=_0x513f[_0x452fd6];return _0x2ce08e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf513('0x0'));var timeout=require(_0xf513('0x1'));var express=require(_0xf513('0x2'));var router=express['Router']();var auth=require(_0xf513('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf513('0x4'));var controller=require(_0xf513('0x5'));router[_0xf513('0x6')]('/',auth[_0xf513('0x7')](),controller[_0xf513('0x8')]);router['get'](_0xf513('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xf513('0x6')]('/:id/preview',auth['isAuthenticated'](),controller[_0xf513('0xa')]);router[_0xf513('0x6')](_0xf513('0xb'),auth[_0xf513('0x7')](),controller['run']);router[_0xf513('0x6')](_0xf513('0xc'),auth[_0xf513('0x7')](),controller['query']);router[_0xf513('0xd')]('/',auth[_0xf513('0x7')](),controller[_0xf513('0xe')]);router['put'](_0xf513('0x9'),auth['isAuthenticated'](),controller[_0xf513('0xf')]);router[_0xf513('0x10')](_0xf513('0x9'),auth[_0xf513('0x7')](),controller[_0xf513('0x11')]);module[_0xf513('0x12')]=router; \ No newline at end of file +var _0x684c=['multer','util','path','express','Router','../../components/interaction/service','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','/:id/query','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x684c,0xdc));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc684('0x0'));var util=require(_0xc684('0x1'));var path=require(_0xc684('0x2'));var timeout=require('connect-timeout');var express=require(_0xc684('0x3'));var router=express[_0xc684('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc684('0x5'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xc684('0x6')]('/',auth[_0xc684('0x7')](),controller[_0xc684('0x8')]);router[_0xc684('0x6')]('/:id',auth[_0xc684('0x7')](),controller[_0xc684('0x9')]);router['get'](_0xc684('0xa'),auth[_0xc684('0x7')](),controller[_0xc684('0xb')]);router['get'](_0xc684('0xc'),auth[_0xc684('0x7')](),controller['run']);router[_0xc684('0x6')](_0xc684('0xd'),auth['isAuthenticated'](),controller['query']);router[_0xc684('0xe')]('/',auth['isAuthenticated'](),controller[_0xc684('0xf')]);router[_0xc684('0x10')](_0xc684('0x11'),auth[_0xc684('0x7')](),controller[_0xc684('0x12')]);router[_0xc684('0x13')](_0xc684('0x11'),auth['isAuthenticated'](),controller[_0xc684('0x14')]);module[_0xc684('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index bb9e12b..eae12be 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 _0xd68f=['STRING','ENUM','pdf','csv','DATE','Loading','manual','scheduled','UNSIGNED','exports'];(function(_0x19a9b5,_0x198382){var _0x632733=function(_0x2b4f07){while(--_0x2b4f07){_0x19a9b5['push'](_0x19a9b5['shift']());}};_0x632733(++_0x198382);}(_0xd68f,0x13f));var _0xfd68=function(_0x57009e,_0x1005ce){_0x57009e=_0x57009e-0x0;var _0x404b0a=_0xd68f[_0x57009e];return _0x404b0a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xfd68('0x0')]={'name':{'type':Sequelize[_0xfd68('0x1')],'allowNull':![]},'basename':{'type':Sequelize[_0xfd68('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0xfd68('0x2')]('csv',_0xfd68('0x3'),'xlsx'),'allowNull':![],'defaultValue':_0xfd68('0x4')},'savename':{'type':Sequelize[_0xfd68('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0xfd68('0x5')]},'endDate':{'type':Sequelize[_0xfd68('0x5')]},'status':{'type':Sequelize[_0xfd68('0x1')],'defaultValue':_0xfd68('0x6')},'type':{'type':Sequelize[_0xfd68('0x2')](_0xfd68('0x7'),_0xfd68('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xfd68('0x9')]},'reportType':{'type':Sequelize[_0xfd68('0x1')]}}; \ No newline at end of file +var _0x16c5=['manual','scheduled','UNSIGNED','sequelize','moment','exports','ENUM','csv','pdf','STRING','DATE'];(function(_0x34533d,_0x5ad28d){var _0x18a738=function(_0x584858){while(--_0x584858){_0x34533d['push'](_0x34533d['shift']());}};_0x18a738(++_0x5ad28d);}(_0x16c5,0x184));var _0x516c=function(_0x13e42b,_0x55f150){_0x13e42b=_0x13e42b-0x0;var _0x265519=_0x16c5[_0x13e42b];return _0x265519;};'use strict';var Sequelize=require(_0x516c('0x0'));var moment=require(_0x516c('0x1'));module[_0x516c('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x516c('0x3')](_0x516c('0x4'),_0x516c('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x516c('0x4')},'savename':{'type':Sequelize[_0x516c('0x6')],'allowNull':![]},'startDate':{'type':Sequelize[_0x516c('0x7')]},'endDate':{'type':Sequelize[_0x516c('0x7')]},'status':{'type':Sequelize[_0x516c('0x6')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x516c('0x3')](_0x516c('0x8'),_0x516c('0x9')),'allowNull':![],'defaultValue':_0x516c('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x516c('0xa')]},'reportType':{'type':Sequelize[_0x516c('0x6')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index b7bd4e5..7812d66 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 _0xed4f=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','AnalyticExtractedReport','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','catch','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','exists','download','format','%s.%s','toLowerCase','html-pdf'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0xed4f,0xbb));var _0xfed4=function(_0xaf1d9b,_0x3b48ea){_0xaf1d9b=_0xaf1d9b-0x0;var _0x3bd6c0=_0xed4f[_0xaf1d9b];return _0x3bd6c0;};'use strict';var pdf=require(_0xfed4('0x0'));var emlformat=require(_0xfed4('0x1'));var rimraf=require(_0xfed4('0x2'));var zipdir=require(_0xfed4('0x3'));var jsonpatch=require(_0xfed4('0x4'));var rp=require(_0xfed4('0x5'));var moment=require(_0xfed4('0x6'));var BPromise=require(_0xfed4('0x7'));var Mustache=require(_0xfed4('0x8'));var util=require('util');var path=require(_0xfed4('0x9'));var sox=require(_0xfed4('0xa'));var csv=require(_0xfed4('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfed4('0xc'));var squel=require(_0xfed4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfed4('0xe'));var toCsv=require(_0xfed4('0xb'));var querystring=require(_0xfed4('0xf'));var Papa=require(_0xfed4('0x10'));var Redis=require(_0xfed4('0x11'));var authService=require(_0xfed4('0x12'));var qs=require(_0xfed4('0x13'));var hardwareService=require(_0xfed4('0x14'));var logger=require(_0xfed4('0x15'))(_0xfed4('0x16'));var utils=require('../../config/utils');var config=require(_0xfed4('0x17'));var db=require(_0xfed4('0x18'))['db'];function respondWithStatusCode(_0x34cefc,_0x54c36f){_0x54c36f=_0x54c36f||0xcc;return function(_0x4999dd){if(_0x4999dd){return _0x34cefc[_0xfed4('0x19')](_0x54c36f);}return _0x34cefc[_0xfed4('0x1a')](_0x54c36f)[_0xfed4('0x1b')]();};}function respondWithResult(_0x573dd8,_0x3dc5a9){_0x3dc5a9=_0x3dc5a9||0xc8;return function(_0x42a6c1){if(_0x42a6c1){return _0x573dd8['status'](_0x3dc5a9)[_0xfed4('0x1c')](_0x42a6c1);}};}function respondWithFilteredResult(_0x1f9fe3,_0x496cd7){return function(_0x53f03e){if(_0x53f03e){var _0x238b96=_0x53f03e[_0xfed4('0x1d')],_0x10b137=_0x496cd7[_0xfed4('0x1e')],_0xfe5a8b=_0x496cd7[_0xfed4('0x1e')]+_0x496cd7[_0xfed4('0x1f')],_0x357937;if(_0xfe5a8b>=_0x238b96){_0xfe5a8b=_0x238b96;_0x357937=0xc8;}else{_0x357937=0xce;}_0x1f9fe3[_0xfed4('0x1a')](_0x357937);return _0x1f9fe3['set'](_0xfed4('0x20'),_0x10b137+'-'+_0xfe5a8b+'/'+_0x238b96)[_0xfed4('0x1c')](_0x53f03e);}return null;};}function patchUpdates(_0x162b9c){return function(_0x7cbc69){try{jsonpatch[_0xfed4('0x21')](_0x7cbc69,_0x162b9c,!![]);}catch(_0x3b5e98){return BPromise[_0xfed4('0x22')](_0x3b5e98);}return _0x7cbc69[_0xfed4('0x23')]();};}function saveUpdates(_0xc89980,_0x2d7693){return function(_0x214cc4){if(_0x214cc4){return _0x214cc4[_0xfed4('0x24')](_0xc89980)[_0xfed4('0x25')](function(_0x1269a9){return _0x1269a9;});}return null;};}function removeEntity(_0x3d0280,_0x28f5ea){return function(_0x1bf0bc){if(_0x1bf0bc){return _0x1bf0bc[_0xfed4('0x26')]()[_0xfed4('0x25')](function(){var _0x44d06c=_0x1bf0bc[_0xfed4('0x27')]({'plain':!![]});var _0x282eec='ExtractedReports';return db[_0xfed4('0x28')][_0xfed4('0x26')]({'where':{'type':_0x282eec,'resourceId':_0x44d06c['id']}})['then'](function(){return _0x1bf0bc;});})[_0xfed4('0x25')](function(){_0x3d0280[_0xfed4('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x315ff8,_0x35fbbf){return function(_0x462aff){if(!_0x462aff){_0x315ff8[_0xfed4('0x19')](0x194);}return _0x462aff;};}function handleError(_0x1a03da,_0x171fd9){_0x171fd9=_0x171fd9||0x1f4;return function(_0x59e0ff){logger[_0xfed4('0x29')](_0x59e0ff[_0xfed4('0x2a')]);if(_0x59e0ff[_0xfed4('0x2b')]){delete _0x59e0ff['name'];}_0x1a03da[_0xfed4('0x1a')](_0x171fd9)['send'](_0x59e0ff);};}exports[_0xfed4('0x2c')]=function(_0x4c60f6,_0x27db11){var _0x57b068={},_0x569165={},_0x2a219b={'count':0x0,'rows':[]};var _0x151488=db[_0xfed4('0x2d')]['rawAttributes'];_0x569165[_0xfed4('0x2e')]=_[_0xfed4('0x2f')](_0x151488);_0x569165[_0xfed4('0x30')]=_['keys'](_0x4c60f6[_0xfed4('0x30')]);_0x569165['filters']=_[_0xfed4('0x31')](_0x569165[_0xfed4('0x2e')],_0x569165[_0xfed4('0x30')]);_0x57b068[_0xfed4('0x32')]=_[_0xfed4('0x31')](_0x569165[_0xfed4('0x2e')],qs[_0xfed4('0x33')](_0x4c60f6[_0xfed4('0x30')][_0xfed4('0x33')]));_0x57b068['attributes']=_0x57b068[_0xfed4('0x32')][_0xfed4('0x34')]?_0x57b068[_0xfed4('0x32')]:_0x569165[_0xfed4('0x2e')];if(!_0x4c60f6['query'][_0xfed4('0x35')](_0xfed4('0x36'))){_0x57b068['limit']=qs[_0xfed4('0x1f')](_0x4c60f6['query'][_0xfed4('0x1f')]);_0x57b068['offset']=qs['offset'](_0x4c60f6[_0xfed4('0x30')][_0xfed4('0x1e')]);}_0x57b068[_0xfed4('0x37')]=qs[_0xfed4('0x38')](_0x4c60f6[_0xfed4('0x30')][_0xfed4('0x38')]);_0x57b068['where']=qs[_0xfed4('0x39')](_[_0xfed4('0x3a')](_0x4c60f6[_0xfed4('0x30')],_0x569165['filters']));if(_0x4c60f6[_0xfed4('0x30')][_0xfed4('0x3b')]){_0x57b068[_0xfed4('0x3c')]=_[_0xfed4('0x3d')](_0x57b068['where'],{'$or':_[_0xfed4('0x3e')](_0x151488,function(_0x5d9101){if(_0x5d9101[_0xfed4('0x3f')][_0xfed4('0x40')]!==_0xfed4('0x41')){var _0x467688={};_0x467688[_0x5d9101[_0xfed4('0x42')]]={'$like':'%'+_0x4c60f6['query'][_0xfed4('0x3b')]+'%'};return _0x467688;}})});}_0x57b068=_[_0xfed4('0x3d')]({},_0x57b068,_0x4c60f6['options']);var _0x45815b={'where':_0x57b068[_0xfed4('0x3c')]};return db[_0xfed4('0x2d')][_0xfed4('0x1d')](_0x45815b)[_0xfed4('0x25')](function(_0x17d102){_0x2a219b[_0xfed4('0x1d')]=_0x17d102;if(_0x4c60f6[_0xfed4('0x30')][_0xfed4('0x43')]){_0x57b068[_0xfed4('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xfed4('0x45')](_0x57b068);})[_0xfed4('0x25')](function(_0xbed81d){_0x2a219b[_0xfed4('0x46')]=_0xbed81d;return _0x2a219b;})[_0xfed4('0x25')](respondWithFilteredResult(_0x27db11,_0x57b068))['catch'](handleError(_0x27db11,null));};exports['show']=function(_0x6a652f,_0xd48fab){var _0x34eee2={'raw':!![],'where':{'id':_0x6a652f[_0xfed4('0x47')]['id']}},_0x3a602b={};_0x3a602b['model']=_[_0xfed4('0x2f')](db[_0xfed4('0x2d')]['rawAttributes']);_0x3a602b[_0xfed4('0x30')]=_['keys'](_0x6a652f[_0xfed4('0x30')]);_0x3a602b[_0xfed4('0x39')]=_[_0xfed4('0x31')](_0x3a602b[_0xfed4('0x2e')],_0x3a602b[_0xfed4('0x30')]);_0x34eee2['attributes']=_[_0xfed4('0x31')](_0x3a602b[_0xfed4('0x2e')],qs[_0xfed4('0x33')](_0x6a652f['query'][_0xfed4('0x33')]));_0x34eee2[_0xfed4('0x32')]=_0x34eee2[_0xfed4('0x32')][_0xfed4('0x34')]?_0x34eee2['attributes']:_0x3a602b['model'];if(_0x6a652f[_0xfed4('0x30')][_0xfed4('0x43')]){_0x34eee2['include']=[{'all':!![]}];}_0x34eee2=_[_0xfed4('0x3d')]({},_0x34eee2,_0x6a652f['options']);return db[_0xfed4('0x2d')][_0xfed4('0x48')](_0x34eee2)[_0xfed4('0x25')](handleEntityNotFound(_0xd48fab,null))['then'](respondWithResult(_0xd48fab,null))['catch'](handleError(_0xd48fab,null));};exports[_0xfed4('0x49')]=function(_0x1061c2,_0x204e86){return db['AnalyticExtractedReport'][_0xfed4('0x49')](_0x1061c2[_0xfed4('0x4a')],{})[_0xfed4('0x25')](function(_0xe65d51){var _0x35dd7e=_0x1061c2[_0xfed4('0x4b')][_0xfed4('0x27')]({'plain':!![]});if(!_0x35dd7e)throw new Error(_0xfed4('0x4c'));if(_0x35dd7e[_0xfed4('0x4d')]==='user'){var _0x1bd4cf=_0xe65d51[_0xfed4('0x27')]({'plain':!![]});var _0x2e9358='ExtractedReports';return db['UserProfileSection'][_0xfed4('0x48')]({'where':{'name':_0x2e9358,'userProfileId':_0x35dd7e[_0xfed4('0x4e')]},'raw':!![]})[_0xfed4('0x25')](function(_0x5e4440){if(_0x5e4440&&_0x5e4440[_0xfed4('0x4f')]===0x0){return db[_0xfed4('0x28')][_0xfed4('0x49')]({'name':_0x1bd4cf[_0xfed4('0x2b')],'resourceId':_0x1bd4cf['id'],'type':_0x5e4440['name'],'sectionId':_0x5e4440['id']},{})[_0xfed4('0x25')](function(){return _0xe65d51;});}else{return _0xe65d51;}})[_0xfed4('0x50')](function(_0x4bad7a){logger[_0xfed4('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bad7a);throw _0x4bad7a;});}return _0xe65d51;})[_0xfed4('0x25')](respondWithResult(_0x204e86,0xc9))[_0xfed4('0x50')](handleError(_0x204e86,null));};exports['update']=function(_0x5468c5,_0x13da81){if(_0x5468c5[_0xfed4('0x4a')]['id']){delete _0x5468c5[_0xfed4('0x4a')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5468c5[_0xfed4('0x47')]['id']}})[_0xfed4('0x25')](handleEntityNotFound(_0x13da81,null))[_0xfed4('0x25')](saveUpdates(_0x5468c5[_0xfed4('0x4a')],null))['then'](respondWithResult(_0x13da81,null))[_0xfed4('0x50')](handleError(_0x13da81,null));};exports[_0xfed4('0x26')]=function(_0x5b8eb7,_0x1949c0){return db[_0xfed4('0x2d')][_0xfed4('0x48')]({'where':{'id':_0x5b8eb7[_0xfed4('0x47')]['id']}})[_0xfed4('0x25')](handleEntityNotFound(_0x1949c0,null))[_0xfed4('0x25')](removeEntity(_0x1949c0,null))['catch'](handleError(_0x1949c0,null));};exports['download']=function(_0x2a2206,_0x15cccd,_0x462752){return db[_0xfed4('0x2d')][_0xfed4('0x48')]({'where':{'id':_0x2a2206['params']['id']},'attributes':[_0xfed4('0x2b'),_0xfed4('0x51'),_0xfed4('0x52'),_0xfed4('0x53')],'raw':!![]})['then'](handleEntityNotFound(_0x15cccd,null))['then'](function(_0x194911){if(_0x194911){if(!fs[_0xfed4('0x54')](path[_0xfed4('0x55')](config[_0xfed4('0x56')],_0xfed4('0x57'),_0x194911['savename']))){throw new db[(_0xfed4('0x58'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x2a2206['query'][_0xfed4('0x59')]){return _0x15cccd[_0xfed4('0x19')](0xc8);}return _0x15cccd[_0xfed4('0x5a')](path[_0xfed4('0x55')](config[_0xfed4('0x56')],'server/files/reports',_0x194911[_0xfed4('0x52')]),util[_0xfed4('0x5b')](_0xfed4('0x5c'),_0x194911['basename']||_0x194911[_0xfed4('0x2b')],_0x194911[_0xfed4('0x53')][_0xfed4('0x5d')]()));}})[_0xfed4('0x50')](handleError(_0x15cccd,null));}; \ No newline at end of file +var _0x3a23=['rows','catch','params','create','user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','download','basename','savename','existsSync','join','root','server/files/reports','ValidationError','format','%s.%s','output','toLowerCase','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','findAll'];(function(_0xa22961,_0x43b541){var _0x595e29=function(_0x500814){while(--_0x500814){_0xa22961['push'](_0xa22961['shift']());}};_0x595e29(++_0x43b541);}(_0x3a23,0x185));var _0x33a2=function(_0x284278,_0x560a3c){_0x284278=_0x284278-0x0;var _0x4dc622=_0x3a23[_0x284278];return _0x4dc622;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x33a2('0x0'));var zipdir=require(_0x33a2('0x1'));var jsonpatch=require(_0x33a2('0x2'));var rp=require(_0x33a2('0x3'));var moment=require(_0x33a2('0x4'));var BPromise=require(_0x33a2('0x5'));var Mustache=require(_0x33a2('0x6'));var util=require(_0x33a2('0x7'));var path=require(_0x33a2('0x8'));var sox=require(_0x33a2('0x9'));var csv=require(_0x33a2('0xa'));var ejs=require(_0x33a2('0xb'));var fs=require('fs');var _=require(_0x33a2('0xc'));var squel=require('squel');var crypto=require(_0x33a2('0xd'));var jsforce=require(_0x33a2('0xe'));var deskjs=require(_0x33a2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x33a2('0x10'));var Papa=require(_0x33a2('0x11'));var Redis=require('ioredis');var authService=require(_0x33a2('0x12'));var qs=require(_0x33a2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33a2('0x14'))('api');var utils=require(_0x33a2('0x15'));var config=require(_0x33a2('0x16'));var db=require(_0x33a2('0x17'))['db'];function respondWithStatusCode(_0x3475e7,_0x43bae2){_0x43bae2=_0x43bae2||0xcc;return function(_0x2b7fdf){if(_0x2b7fdf){return _0x3475e7[_0x33a2('0x18')](_0x43bae2);}return _0x3475e7[_0x33a2('0x19')](_0x43bae2)['end']();};}function respondWithResult(_0x14562f,_0x57a9d1){_0x57a9d1=_0x57a9d1||0xc8;return function(_0x234927){if(_0x234927){return _0x14562f[_0x33a2('0x19')](_0x57a9d1)['json'](_0x234927);}};}function respondWithFilteredResult(_0x4e469e,_0x5cb8e4){return function(_0x868c0c){if(_0x868c0c){var _0x4bd2f7=_0x868c0c[_0x33a2('0x1a')],_0x2708d9=_0x5cb8e4['offset'],_0x1efb05=_0x5cb8e4[_0x33a2('0x1b')]+_0x5cb8e4[_0x33a2('0x1c')],_0x2953a2;if(_0x1efb05>=_0x4bd2f7){_0x1efb05=_0x4bd2f7;_0x2953a2=0xc8;}else{_0x2953a2=0xce;}_0x4e469e['status'](_0x2953a2);return _0x4e469e['set'](_0x33a2('0x1d'),_0x2708d9+'-'+_0x1efb05+'/'+_0x4bd2f7)[_0x33a2('0x1e')](_0x868c0c);}return null;};}function patchUpdates(_0x2f3d27){return function(_0x29c8f3){try{jsonpatch[_0x33a2('0x1f')](_0x29c8f3,_0x2f3d27,!![]);}catch(_0x44cb8e){return BPromise['reject'](_0x44cb8e);}return _0x29c8f3[_0x33a2('0x20')]();};}function saveUpdates(_0x3f0059,_0xa5b54e){return function(_0x25ef3d){if(_0x25ef3d){return _0x25ef3d[_0x33a2('0x21')](_0x3f0059)[_0x33a2('0x22')](function(_0x48606f){return _0x48606f;});}return null;};}function removeEntity(_0x1d3ab2,_0x36f15e){return function(_0x4cbe6c){if(_0x4cbe6c){return _0x4cbe6c['destroy']()[_0x33a2('0x22')](function(){var _0x486c04=_0x4cbe6c[_0x33a2('0x23')]({'plain':!![]});var _0x1ea1d1='ExtractedReports';return db[_0x33a2('0x24')][_0x33a2('0x25')]({'where':{'type':_0x1ea1d1,'resourceId':_0x486c04['id']}})[_0x33a2('0x22')](function(){return _0x4cbe6c;});})[_0x33a2('0x22')](function(){_0x1d3ab2[_0x33a2('0x19')](0xcc)[_0x33a2('0x26')]();});}};}function handleEntityNotFound(_0x7a3ab6,_0x180654){return function(_0x56ae0f){if(!_0x56ae0f){_0x7a3ab6[_0x33a2('0x18')](0x194);}return _0x56ae0f;};}function handleError(_0x411b59,_0x2a70b7){_0x2a70b7=_0x2a70b7||0x1f4;return function(_0x4a101f){logger[_0x33a2('0x27')](_0x4a101f[_0x33a2('0x28')]);if(_0x4a101f[_0x33a2('0x29')]){delete _0x4a101f[_0x33a2('0x29')];}_0x411b59[_0x33a2('0x19')](_0x2a70b7)[_0x33a2('0x2a')](_0x4a101f);};}exports['index']=function(_0x8d31f5,_0xd8425){var _0x8c425a={},_0x2f2006={},_0x19a7e0={'count':0x0,'rows':[]};var _0x5a984d=db[_0x33a2('0x2b')][_0x33a2('0x2c')];_0x2f2006['model']=_[_0x33a2('0x2d')](_0x5a984d);_0x2f2006[_0x33a2('0x2e')]=_[_0x33a2('0x2d')](_0x8d31f5[_0x33a2('0x2e')]);_0x2f2006[_0x33a2('0x2f')]=_[_0x33a2('0x30')](_0x2f2006[_0x33a2('0x31')],_0x2f2006[_0x33a2('0x2e')]);_0x8c425a['attributes']=_['intersection'](_0x2f2006['model'],qs['fields'](_0x8d31f5[_0x33a2('0x2e')][_0x33a2('0x32')]));_0x8c425a[_0x33a2('0x33')]=_0x8c425a[_0x33a2('0x33')][_0x33a2('0x34')]?_0x8c425a[_0x33a2('0x33')]:_0x2f2006[_0x33a2('0x31')];if(!_0x8d31f5[_0x33a2('0x2e')]['hasOwnProperty'](_0x33a2('0x35'))){_0x8c425a[_0x33a2('0x1c')]=qs['limit'](_0x8d31f5['query'][_0x33a2('0x1c')]);_0x8c425a[_0x33a2('0x1b')]=qs[_0x33a2('0x1b')](_0x8d31f5[_0x33a2('0x2e')]['offset']);}_0x8c425a[_0x33a2('0x36')]=qs[_0x33a2('0x37')](_0x8d31f5['query'][_0x33a2('0x37')]);_0x8c425a[_0x33a2('0x38')]=qs['filters'](_[_0x33a2('0x39')](_0x8d31f5[_0x33a2('0x2e')],_0x2f2006[_0x33a2('0x2f')]));if(_0x8d31f5['query'][_0x33a2('0x3a')]){_0x8c425a['where']=_[_0x33a2('0x3b')](_0x8c425a[_0x33a2('0x38')],{'$or':_['map'](_0x5a984d,function(_0x1b4d48){if(_0x1b4d48['type'][_0x33a2('0x3c')]!==_0x33a2('0x3d')){var _0x434920={};_0x434920[_0x1b4d48[_0x33a2('0x3e')]]={'$like':'%'+_0x8d31f5['query'][_0x33a2('0x3a')]+'%'};return _0x434920;}})});}_0x8c425a=_['merge']({},_0x8c425a,_0x8d31f5[_0x33a2('0x3f')]);var _0x250272={'where':_0x8c425a['where']};return db['AnalyticExtractedReport'][_0x33a2('0x1a')](_0x250272)[_0x33a2('0x22')](function(_0x7c54e1){_0x19a7e0[_0x33a2('0x1a')]=_0x7c54e1;if(_0x8d31f5[_0x33a2('0x2e')][_0x33a2('0x40')]){_0x8c425a['include']=[{'all':!![]}];}return db[_0x33a2('0x2b')][_0x33a2('0x41')](_0x8c425a);})[_0x33a2('0x22')](function(_0x44119e){_0x19a7e0[_0x33a2('0x42')]=_0x44119e;return _0x19a7e0;})[_0x33a2('0x22')](respondWithFilteredResult(_0xd8425,_0x8c425a))[_0x33a2('0x43')](handleError(_0xd8425,null));};exports['show']=function(_0x4ca03a,_0x112375){var _0x30588e={'raw':!![],'where':{'id':_0x4ca03a[_0x33a2('0x44')]['id']}},_0xef1ece={};_0xef1ece[_0x33a2('0x31')]=_[_0x33a2('0x2d')](db[_0x33a2('0x2b')][_0x33a2('0x2c')]);_0xef1ece['query']=_[_0x33a2('0x2d')](_0x4ca03a[_0x33a2('0x2e')]);_0xef1ece[_0x33a2('0x2f')]=_[_0x33a2('0x30')](_0xef1ece[_0x33a2('0x31')],_0xef1ece[_0x33a2('0x2e')]);_0x30588e[_0x33a2('0x33')]=_['intersection'](_0xef1ece['model'],qs[_0x33a2('0x32')](_0x4ca03a[_0x33a2('0x2e')][_0x33a2('0x32')]));_0x30588e[_0x33a2('0x33')]=_0x30588e[_0x33a2('0x33')][_0x33a2('0x34')]?_0x30588e[_0x33a2('0x33')]:_0xef1ece['model'];if(_0x4ca03a['query']['includeAll']){_0x30588e['include']=[{'all':!![]}];}_0x30588e=_['merge']({},_0x30588e,_0x4ca03a[_0x33a2('0x3f')]);return db['AnalyticExtractedReport']['find'](_0x30588e)['then'](handleEntityNotFound(_0x112375,null))[_0x33a2('0x22')](respondWithResult(_0x112375,null))[_0x33a2('0x43')](handleError(_0x112375,null));};exports[_0x33a2('0x45')]=function(_0x355151,_0x3b083f){return db['AnalyticExtractedReport'][_0x33a2('0x45')](_0x355151['body'],{})[_0x33a2('0x22')](function(_0x41c8b9){var _0x247e98=_0x355151[_0x33a2('0x46')][_0x33a2('0x23')]({'plain':!![]});if(!_0x247e98)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x247e98[_0x33a2('0x47')]==='user'){var _0x36aff5=_0x41c8b9['get']({'plain':!![]});var _0x3e208d=_0x33a2('0x48');return db[_0x33a2('0x49')]['find']({'where':{'name':_0x3e208d,'userProfileId':_0x247e98[_0x33a2('0x4a')]},'raw':!![]})[_0x33a2('0x22')](function(_0xbf5a37){if(_0xbf5a37&&_0xbf5a37[_0x33a2('0x4b')]===0x0){return db['UserProfileResource'][_0x33a2('0x45')]({'name':_0x36aff5[_0x33a2('0x29')],'resourceId':_0x36aff5['id'],'type':_0xbf5a37['name'],'sectionId':_0xbf5a37['id']},{})[_0x33a2('0x22')](function(){return _0x41c8b9;});}else{return _0x41c8b9;}})[_0x33a2('0x43')](function(_0x1d1a19){logger[_0x33a2('0x27')](_0x33a2('0x4c'),_0x1d1a19);throw _0x1d1a19;});}return _0x41c8b9;})[_0x33a2('0x22')](respondWithResult(_0x3b083f,0xc9))[_0x33a2('0x43')](handleError(_0x3b083f,null));};exports[_0x33a2('0x21')]=function(_0x154f38,_0x221839){if(_0x154f38[_0x33a2('0x4d')]['id']){delete _0x154f38[_0x33a2('0x4d')]['id'];}return db[_0x33a2('0x2b')][_0x33a2('0x4e')]({'where':{'id':_0x154f38[_0x33a2('0x44')]['id']}})[_0x33a2('0x22')](handleEntityNotFound(_0x221839,null))[_0x33a2('0x22')](saveUpdates(_0x154f38[_0x33a2('0x4d')],null))['then'](respondWithResult(_0x221839,null))['catch'](handleError(_0x221839,null));};exports[_0x33a2('0x25')]=function(_0x1f0386,_0x3c2f7f){return db['AnalyticExtractedReport'][_0x33a2('0x4e')]({'where':{'id':_0x1f0386[_0x33a2('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c2f7f,null))[_0x33a2('0x22')](removeEntity(_0x3c2f7f,null))[_0x33a2('0x43')](handleError(_0x3c2f7f,null));};exports[_0x33a2('0x4f')]=function(_0x5e5832,_0x29c6f7,_0x442faf){return db[_0x33a2('0x2b')]['find']({'where':{'id':_0x5e5832[_0x33a2('0x44')]['id']},'attributes':[_0x33a2('0x29'),_0x33a2('0x50'),_0x33a2('0x51'),'output'],'raw':!![]})[_0x33a2('0x22')](handleEntityNotFound(_0x29c6f7,null))[_0x33a2('0x22')](function(_0x341186){if(_0x341186){if(!fs[_0x33a2('0x52')](path[_0x33a2('0x53')](config[_0x33a2('0x54')],_0x33a2('0x55'),_0x341186['savename']))){throw new db['Sequelize'][(_0x33a2('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5e5832['query']['exists']){return _0x29c6f7[_0x33a2('0x18')](0xc8);}return _0x29c6f7['download'](path[_0x33a2('0x53')](config[_0x33a2('0x54')],_0x33a2('0x55'),_0x341186[_0x33a2('0x51')]),util[_0x33a2('0x57')](_0x33a2('0x58'),_0x341186[_0x33a2('0x50')]||_0x341186[_0x33a2('0x29')],_0x341186[_0x33a2('0x59')][_0x33a2('0x5a')]()));}})[_0x33a2('0x43')](handleError(_0x29c6f7,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index bd27eb5..171513f 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 _0x24ca=['AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define'];(function(_0x1d5732,_0x39fcb7){var _0x29b841=function(_0xcd1774){while(--_0xcd1774){_0x1d5732['push'](_0x1d5732['shift']());}};_0x29b841(++_0x39fcb7);}(_0x24ca,0x1bc));var _0xa24c=function(_0x5cb97e,_0x132a39){_0x5cb97e=_0x5cb97e-0x0;var _0x1714b4=_0x24ca[_0x5cb97e];return _0x1714b4;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var logger=require(_0xa24c('0x1'))(_0xa24c('0x2'));var moment=require(_0xa24c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa24c('0x4'));var fs=require('fs');var path=require(_0xa24c('0x5'));var rimraf=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var attributes=require(_0xa24c('0x8'));module[_0xa24c('0x9')]=function(_0xf0511,_0x3c0aaa){return _0xf0511[_0xa24c('0xa')](_0xa24c('0xb'),attributes,{'tableName':_0xa24c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports'];(function(_0x64b474,_0x39e1b3){var _0x132fff=function(_0x2ec1ee){while(--_0x2ec1ee){_0x64b474['push'](_0x64b474['shift']());}};_0x132fff(++_0x39e1b3);}(_0x5d17,0x114));var _0x75d1=function(_0x827d61,_0x127d23){_0x827d61=_0x827d61-0x0;var _0x3d2398=_0x5d17[_0x827d61];return _0x3d2398;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 8f6fa15..bacb85a 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 _0x05fc=['message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x5d4586,_0x2b4e52){var _0x56be1f=function(_0x4f5c8a){while(--_0x4f5c8a){_0x5d4586['push'](_0x5d4586['shift']());}};_0x56be1f(++_0x2b4e52);}(_0x05fc,0x81));var _0xc05f=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x05fc[_0x4ea69d];return _0x5318e0;};'use strict';var _=require(_0xc05f('0x0'));var util=require(_0xc05f('0x1'));var moment=require('moment');var BPromise=require(_0xc05f('0x2'));var rs=require(_0xc05f('0x3'));var fs=require('fs');var Redis=require(_0xc05f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc05f('0x5'));var logger=require(_0xc05f('0x6'))(_0xc05f('0x7'));var config=require(_0xc05f('0x8'));var jayson=require(_0xc05f('0x9'));var client=jayson['client'][_0xc05f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e345a,_0x3571c6,_0x3b80d9){return new BPromise(function(_0x3c994a,_0x45695f){return client[_0xc05f('0xb')](_0x5e345a,_0x3b80d9)['then'](function(_0x32ad4a){logger['info'](_0xc05f('0xc'),_0x3571c6,_0xc05f('0xd'));logger[_0xc05f('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3571c6,_0xc05f('0xd'),JSON[_0xc05f('0xf')](_0x32ad4a));if(_0x32ad4a[_0xc05f('0x10')]){if(_0x32ad4a['error'][_0xc05f('0x11')]===0x1f4){logger['error'](_0xc05f('0xc'),_0x3571c6,_0x32ad4a[_0xc05f('0x10')][_0xc05f('0x12')]);return _0x45695f(_0x32ad4a[_0xc05f('0x10')]['message']);}logger[_0xc05f('0x10')](_0xc05f('0xc'),_0x3571c6,_0x32ad4a[_0xc05f('0x10')][_0xc05f('0x12')]);return _0x3c994a(_0x32ad4a[_0xc05f('0x10')]['message']);}else{logger[_0xc05f('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3571c6,_0xc05f('0xd'));_0x3c994a(_0x32ad4a['result'][_0xc05f('0x12')]);}})[_0xc05f('0x14')](function(_0x10207e){logger[_0xc05f('0x10')](_0xc05f('0xc'),_0x3571c6,_0x10207e);_0x45695f(_0x10207e);});});} \ No newline at end of file +var _0xdd0b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','bluebird','randomstring'];(function(_0x14b6c0,_0x306bc5){var _0x507e5f=function(_0x2bc320){while(--_0x2bc320){_0x14b6c0['push'](_0x14b6c0['shift']());}};_0x507e5f(++_0x306bc5);}(_0xdd0b,0x123));var _0xbdd0=function(_0x27f398,_0x349e0b){_0x27f398=_0x27f398-0x0;var _0x1dd2b4=_0xdd0b[_0x27f398];return _0x1dd2b4;};'use strict';var _=require(_0xbdd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbdd0('0x1'));var rs=require(_0xbdd0('0x2'));var fs=require('fs');var Redis=require(_0xbdd0('0x3'));var db=require(_0xbdd0('0x4'))['db'];var utils=require(_0xbdd0('0x5'));var logger=require(_0xbdd0('0x6'))(_0xbdd0('0x7'));var config=require(_0xbdd0('0x8'));var jayson=require(_0xbdd0('0x9'));var client=jayson[_0xbdd0('0xa')][_0xbdd0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9658,_0x2dc7b9,_0x5b9ee1){return new BPromise(function(_0x3a540b,_0x1a3ad4){return client['request'](_0x1c9658,_0x5b9ee1)[_0xbdd0('0xc')](function(_0x4fd231){logger['info'](_0xbdd0('0xd'),_0x2dc7b9,_0xbdd0('0xe'));logger[_0xbdd0('0xf')](_0xbdd0('0x10'),_0x2dc7b9,_0xbdd0('0xe'),JSON[_0xbdd0('0x11')](_0x4fd231));if(_0x4fd231[_0xbdd0('0x12')]){if(_0x4fd231[_0xbdd0('0x12')]['code']===0x1f4){logger[_0xbdd0('0x12')](_0xbdd0('0xd'),_0x2dc7b9,_0x4fd231[_0xbdd0('0x12')]['message']);return _0x1a3ad4(_0x4fd231[_0xbdd0('0x12')][_0xbdd0('0x13')]);}logger[_0xbdd0('0x12')](_0xbdd0('0xd'),_0x2dc7b9,_0x4fd231[_0xbdd0('0x12')][_0xbdd0('0x13')]);return _0x3a540b(_0x4fd231[_0xbdd0('0x12')]['message']);}else{logger['info'](_0xbdd0('0xd'),_0x2dc7b9,_0xbdd0('0xe'));_0x3a540b(_0x4fd231['result'][_0xbdd0('0x13')]);}})[_0xbdd0('0x14')](function(_0x4a7f97){logger[_0xbdd0('0x12')](_0xbdd0('0xd'),_0x2dc7b9,_0x4a7f97);_0x1a3ad4(_0x4a7f97);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 921f2ca..2c50460 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 _0xb0fa=['../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','download','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1afbcb,_0x935cbe){var _0x53b133=function(_0x50f8c1){while(--_0x50f8c1){_0x1afbcb['push'](_0x1afbcb['shift']());}};_0x53b133(++_0x935cbe);}(_0xb0fa,0x19d));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab0f('0x0'));var util=require(_0xab0f('0x1'));var path=require(_0xab0f('0x2'));var timeout=require(_0xab0f('0x3'));var express=require(_0xab0f('0x4'));var router=express[_0xab0f('0x5')]();var auth=require(_0xab0f('0x6'));var interaction=require(_0xab0f('0x7'));var config=require(_0xab0f('0x8'));var controller=require(_0xab0f('0x9'));router[_0xab0f('0xa')]('/',auth[_0xab0f('0xb')](),controller[_0xab0f('0xc')]);router[_0xab0f('0xa')](_0xab0f('0xd'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xab0f('0xe')]);router['post']('/',auth[_0xab0f('0xb')](),controller['create']);router[_0xab0f('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xab0f('0x10')]);router[_0xab0f('0x11')](_0xab0f('0xd'),auth[_0xab0f('0xb')](),controller[_0xab0f('0x12')]);module[_0xab0f('0x13')]=router; \ No newline at end of file +var _0x741a=['./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','delete','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x28ea59,_0x4f6956){var _0x5241b9=function(_0x2d5a07){while(--_0x2d5a07){_0x28ea59['push'](_0x28ea59['shift']());}};_0x5241b9(++_0x4f6956);}(_0x741a,0x1cd));var _0xa741=function(_0x5e99ae,_0x37d21f){_0x5e99ae=_0x5e99ae-0x0;var _0x286019=_0x741a[_0x5e99ae];return _0x286019;};'use strict';var multer=require(_0xa741('0x0'));var util=require(_0xa741('0x1'));var path=require(_0xa741('0x2'));var timeout=require(_0xa741('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xa741('0x4'));var interaction=require(_0xa741('0x5'));var config=require(_0xa741('0x6'));var controller=require(_0xa741('0x7'));router[_0xa741('0x8')]('/',auth[_0xa741('0x9')](),controller['index']);router[_0xa741('0x8')]('/:id',auth[_0xa741('0x9')](),controller[_0xa741('0xa')]);router[_0xa741('0x8')](_0xa741('0xb'),auth[_0xa741('0x9')](),controller[_0xa741('0xc')]);router[_0xa741('0xd')]('/',auth[_0xa741('0x9')](),controller[_0xa741('0xe')]);router[_0xa741('0xf')]('/:id',auth[_0xa741('0x9')](),controller[_0xa741('0x10')]);router[_0xa741('0x11')]('/:id',auth[_0xa741('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 64f4ae4..9e10888 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 _0x6f98=['BOOLEAN','sequelize','STRING'];(function(_0xf7d07c,_0x307f5d){var _0x2e248c=function(_0x1acc54){while(--_0x1acc54){_0xf7d07c['push'](_0xf7d07c['shift']());}};_0x2e248c(++_0x307f5d);}(_0x6f98,0x19c));var _0x86f9=function(_0x440d2a,_0x3e657f){_0x440d2a=_0x440d2a-0x0;var _0x4138ba=_0x6f98[_0x440d2a];return _0x4138ba;};'use strict';var Sequelize=require(_0x86f9('0x0'));module['exports']={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x86f9('0x1')]},'function':{'type':Sequelize[_0x86f9('0x1')]},'format':{'type':Sequelize[_0x86f9('0x1')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x86f9('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7d4a=['TEXT','STRING','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7d4a,0x112));var _0xa7d4=function(_0xd4d36d,_0x446b7c){_0xd4d36d=_0xd4d36d-0x0;var _0x491208=_0x7d4a[_0xd4d36d];return _0x491208;};'use strict';var Sequelize=require(_0xa7d4('0x0'));module[_0xa7d4('0x1')]={'field':{'type':Sequelize[_0xa7d4('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xa7d4('0x3')]},'format':{'type':Sequelize[_0xa7d4('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'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 d94dd59..9572f29 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 _0x574b=['catch','show','params','rawAttributes','body','bulkCreate','find','bulkDestroy','ids','findOne','sequelize','transaction','CustomReportId','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','then','end','error','stack','name','send','index','AnalyticFieldReport','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x574b,0x189));var _0xb574=function(_0x61a228,_0x5f061b){_0x61a228=_0x61a228-0x0;var _0x2138ae=_0x574b[_0x61a228];return _0x2138ae;};'use strict';var pdf=require(_0xb574('0x0'));var emlformat=require(_0xb574('0x1'));var rimraf=require(_0xb574('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb574('0x3'));var rp=require('request-promise');var moment=require(_0xb574('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb574('0x5'));var util=require('util');var path=require(_0xb574('0x6'));var sox=require(_0xb574('0x7'));var csv=require(_0xb574('0x8'));var ejs=require(_0xb574('0x9'));var fs=require('fs');var _=require(_0xb574('0xa'));var squel=require(_0xb574('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb574('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb574('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb574('0xe'));var qs=require(_0xb574('0xf'));var hardwareService=require(_0xb574('0x10'));var logger=require(_0xb574('0x11'))(_0xb574('0x12'));var utils=require(_0xb574('0x13'));var config=require('../../config/environment');var db=require(_0xb574('0x14'))['db'];function respondWithStatusCode(_0x94e004,_0x35cf4a){_0x35cf4a=_0x35cf4a||0xcc;return function(_0x247eab){if(_0x247eab){return _0x94e004[_0xb574('0x15')](_0x35cf4a);}return _0x94e004[_0xb574('0x16')](_0x35cf4a)['end']();};}function respondWithResult(_0x3f7b35,_0x4467cb){_0x4467cb=_0x4467cb||0xc8;return function(_0xa140a8){if(_0xa140a8){return _0x3f7b35['status'](_0x4467cb)[_0xb574('0x17')](_0xa140a8);}};}function respondWithFilteredResult(_0x45c640,_0x483b32){return function(_0x41b66e){if(_0x41b66e){var _0x4849b0=_0x41b66e[_0xb574('0x18')],_0x52c58e=_0x483b32[_0xb574('0x19')],_0x1648d3=_0x483b32['offset']+_0x483b32[_0xb574('0x1a')],_0x34d391;if(_0x1648d3>=_0x4849b0){_0x1648d3=_0x4849b0;_0x34d391=0xc8;}else{_0x34d391=0xce;}_0x45c640[_0xb574('0x16')](_0x34d391);return _0x45c640[_0xb574('0x1b')]('Content-Range',_0x52c58e+'-'+_0x1648d3+'/'+_0x4849b0)['json'](_0x41b66e);}return null;};}function patchUpdates(_0x30bb9d){return function(_0x31b4a7){try{jsonpatch[_0xb574('0x1c')](_0x31b4a7,_0x30bb9d,!![]);}catch(_0x335616){return BPromise['reject'](_0x335616);}return _0x31b4a7[_0xb574('0x1d')]();};}function saveUpdates(_0x534305,_0x431595){return function(_0x4dafc7){if(_0x4dafc7){return _0x4dafc7[_0xb574('0x1e')](_0x534305)['then'](function(_0x1eb7f8){return _0x1eb7f8;});}return null;};}function removeEntity(_0x5d54bc,_0x32045b){return function(_0x243611){if(_0x243611){return _0x243611[_0xb574('0x1f')]()[_0xb574('0x20')](function(){_0x5d54bc[_0xb574('0x16')](0xcc)[_0xb574('0x21')]();});}};}function handleEntityNotFound(_0x48b9a0,_0x5467e0){return function(_0x1b9498){if(!_0x1b9498){_0x48b9a0['sendStatus'](0x194);}return _0x1b9498;};}function handleError(_0x3186ac,_0x5813a1){_0x5813a1=_0x5813a1||0x1f4;return function(_0x5b5863){logger[_0xb574('0x22')](_0x5b5863[_0xb574('0x23')]);if(_0x5b5863[_0xb574('0x24')]){delete _0x5b5863[_0xb574('0x24')];}_0x3186ac[_0xb574('0x16')](_0x5813a1)[_0xb574('0x25')](_0x5b5863);};}exports[_0xb574('0x26')]=function(_0x4d697a,_0x598600){var _0xcbc3c7={},_0x58059a={},_0x2cf871={'count':0x0,'rows':[]};var _0x27a87f=db[_0xb574('0x27')]['rawAttributes'];_0x58059a[_0xb574('0x28')]=_[_0xb574('0x29')](_0x27a87f);_0x58059a[_0xb574('0x2a')]=_['keys'](_0x4d697a[_0xb574('0x2a')]);_0x58059a[_0xb574('0x2b')]=_['intersection'](_0x58059a[_0xb574('0x28')],_0x58059a[_0xb574('0x2a')]);_0xcbc3c7[_0xb574('0x2c')]=_[_0xb574('0x2d')](_0x58059a[_0xb574('0x28')],qs[_0xb574('0x2e')](_0x4d697a[_0xb574('0x2a')][_0xb574('0x2e')]));_0xcbc3c7['attributes']=_0xcbc3c7[_0xb574('0x2c')][_0xb574('0x2f')]?_0xcbc3c7[_0xb574('0x2c')]:_0x58059a[_0xb574('0x28')];if(!_0x4d697a[_0xb574('0x2a')][_0xb574('0x30')](_0xb574('0x31'))){_0xcbc3c7[_0xb574('0x1a')]=qs[_0xb574('0x1a')](_0x4d697a[_0xb574('0x2a')][_0xb574('0x1a')]);_0xcbc3c7['offset']=qs[_0xb574('0x19')](_0x4d697a[_0xb574('0x2a')][_0xb574('0x19')]);}_0xcbc3c7[_0xb574('0x32')]=qs[_0xb574('0x33')](_0x4d697a[_0xb574('0x2a')]['sort']);_0xcbc3c7['where']=qs[_0xb574('0x2b')](_['pick'](_0x4d697a[_0xb574('0x2a')],_0x58059a[_0xb574('0x2b')]));if(_0x4d697a[_0xb574('0x2a')][_0xb574('0x34')]){_0xcbc3c7[_0xb574('0x35')]=_[_0xb574('0x36')](_0xcbc3c7[_0xb574('0x35')],{'$or':_[_0xb574('0x37')](_0x27a87f,function(_0x43255b){if(_0x43255b[_0xb574('0x38')]['key']!==_0xb574('0x39')){var _0x21c915={};_0x21c915[_0x43255b['field']]={'$like':'%'+_0x4d697a['query']['filter']+'%'};return _0x21c915;}})});}_0xcbc3c7=_['merge']({},_0xcbc3c7,_0x4d697a[_0xb574('0x3a')]);var _0x24c25a={'where':_0xcbc3c7[_0xb574('0x35')]};return db[_0xb574('0x27')][_0xb574('0x18')](_0x24c25a)[_0xb574('0x20')](function(_0x5b41de){_0x2cf871[_0xb574('0x18')]=_0x5b41de;if(_0x4d697a[_0xb574('0x2a')][_0xb574('0x3b')]){_0xcbc3c7[_0xb574('0x3c')]=[{'all':!![]}];}return db[_0xb574('0x27')][_0xb574('0x3d')](_0xcbc3c7);})[_0xb574('0x20')](function(_0x20422c){_0x2cf871[_0xb574('0x3e')]=_0x20422c;return _0x2cf871;})[_0xb574('0x20')](respondWithFilteredResult(_0x598600,_0xcbc3c7))[_0xb574('0x3f')](handleError(_0x598600,null));};exports[_0xb574('0x40')]=function(_0x3b4a4d,_0x28af60){var _0x29b740={'raw':![],'where':{'id':_0x3b4a4d[_0xb574('0x41')]['id']}},_0x99809f={};_0x99809f[_0xb574('0x28')]=_[_0xb574('0x29')](db[_0xb574('0x27')][_0xb574('0x42')]);_0x99809f[_0xb574('0x2a')]=_['keys'](_0x3b4a4d[_0xb574('0x2a')]);_0x99809f[_0xb574('0x2b')]=_[_0xb574('0x2d')](_0x99809f[_0xb574('0x28')],_0x99809f['query']);_0x29b740[_0xb574('0x2c')]=_[_0xb574('0x2d')](_0x99809f[_0xb574('0x28')],qs[_0xb574('0x2e')](_0x3b4a4d[_0xb574('0x2a')][_0xb574('0x2e')]));_0x29b740['attributes']=_0x29b740[_0xb574('0x2c')][_0xb574('0x2f')]?_0x29b740['attributes']:_0x99809f[_0xb574('0x28')];if(_0x3b4a4d['query'][_0xb574('0x3b')]){_0x29b740[_0xb574('0x3c')]=[{'all':!![]}];}_0x29b740=_['merge']({},_0x29b740,_0x3b4a4d['options']);return db[_0xb574('0x27')]['find'](_0x29b740)['then'](handleEntityNotFound(_0x28af60,null))[_0xb574('0x20')](respondWithResult(_0x28af60,null))[_0xb574('0x3f')](handleError(_0x28af60,null));};exports['create']=function(_0x17fe56,_0x3e75c1){return db[_0xb574('0x27')]['create'](_0x17fe56[_0xb574('0x43')],{})[_0xb574('0x20')](respondWithResult(_0x3e75c1,0xc9))[_0xb574('0x3f')](handleError(_0x3e75c1,null));};exports['bulkCreate']=function(_0x20abc7,_0x580ebb){return db[_0xb574('0x27')][_0xb574('0x44')](_0x20abc7[_0xb574('0x43')],{'raw':![],'individualHooks':!![]})[_0xb574('0x20')](respondWithResult(_0x580ebb,0xc9))['catch'](handleError(_0x580ebb,null));};exports[_0xb574('0x1e')]=function(_0x14a61c,_0x3caabe){if(_0x14a61c['body']['id']){delete _0x14a61c[_0xb574('0x43')]['id'];}return db[_0xb574('0x27')][_0xb574('0x45')]({'where':{'id':_0x14a61c['params']['id']}})[_0xb574('0x20')](handleEntityNotFound(_0x3caabe,null))[_0xb574('0x20')](saveUpdates(_0x14a61c['body'],null))[_0xb574('0x20')](respondWithResult(_0x3caabe,null))[_0xb574('0x3f')](handleError(_0x3caabe,null));};exports[_0xb574('0x1f')]=function(_0x26d9bf,_0x49f92e){return db[_0xb574('0x27')]['find']({'where':{'id':_0x26d9bf['params']['id']}})[_0xb574('0x20')](handleEntityNotFound(_0x49f92e,null))['then'](removeEntity(_0x49f92e,null))[_0xb574('0x3f')](handleError(_0x49f92e,null));};exports[_0xb574('0x46')]=function(_0x2b8832,_0x723960){return db['AnalyticFieldReport'][_0xb574('0x1f')]({'where':{'id':_0x2b8832[_0xb574('0x2a')][_0xb574('0x47')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x723960,0xcc))[_0xb574('0x3f')](handleError(_0x723960,null));};exports['addFields']=function(_0x34abcf,_0x573149,_0x3dda9d){return db['AnalyticCustomReport'][_0xb574('0x48')]({'where':{'id':_0x34abcf[_0xb574('0x41')]['id']}})[_0xb574('0x20')](handleEntityNotFound(_0x573149,null))[_0xb574('0x20')](function(_0x2f5fa6){if(_0x2f5fa6){return db[_0xb574('0x49')][_0xb574('0x4a')](function(_0x2a0048){return db[_0xb574('0x27')][_0xb574('0x1f')]({'where':{'CustomReportId':_0x34abcf[_0xb574('0x41')]['id']},'transaction':_0x2a0048})['then'](function(_0x4664ce){var _0x15e653=_[_0xb574('0x37')](_0x34abcf[_0xb574('0x43')],function(_0x151996){delete _0x151996['id'];_0x151996[_0xb574('0x4b')]=_0x34abcf[_0xb574('0x41')]['id'];return _0x151996;});return db[_0xb574('0x27')][_0xb574('0x44')](_0x15e653,{'transaction':_0x2a0048});});})[_0xb574('0x20')](function(){return db[_0xb574('0x27')]['findAll']({'where':{'CustomReportId':_0x34abcf['params']['id']}});});}})[_0xb574('0x20')](respondWithResult(_0x573149,null))[_0xb574('0x3f')](handleError(_0x573149,null));}; \ No newline at end of file +var _0x6f33=['attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','bulkCreate','find','bulkDestroy','destroy','ids','addFields','AnalyticCustomReport','transaction','map','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','save','then','error','stack','name','index','AnalyticFieldReport','rawAttributes','model','keys','query','filters','intersection','fields'];(function(_0x1e373e,_0x236080){var _0x572e59=function(_0x4e97d9){while(--_0x4e97d9){_0x1e373e['push'](_0x1e373e['shift']());}};_0x572e59(++_0x236080);}(_0x6f33,0x162));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x36f3('0x0'));var emlformat=require(_0x36f3('0x1'));var rimraf=require(_0x36f3('0x2'));var zipdir=require(_0x36f3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36f3('0x4'));var moment=require(_0x36f3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x36f3('0x6'));var util=require(_0x36f3('0x7'));var path=require('path');var sox=require(_0x36f3('0x8'));var csv=require('to-csv');var ejs=require(_0x36f3('0x9'));var fs=require('fs');var _=require(_0x36f3('0xa'));var squel=require(_0x36f3('0xb'));var crypto=require(_0x36f3('0xc'));var jsforce=require(_0x36f3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x36f3('0xe'));var querystring=require('querystring');var Papa=require(_0x36f3('0xf'));var Redis=require(_0x36f3('0x10'));var authService=require(_0x36f3('0x11'));var qs=require(_0x36f3('0x12'));var hardwareService=require(_0x36f3('0x13'));var logger=require('../../config/logger')(_0x36f3('0x14'));var utils=require(_0x36f3('0x15'));var config=require(_0x36f3('0x16'));var db=require(_0x36f3('0x17'))['db'];function respondWithStatusCode(_0x1cadc0,_0x10999c){_0x10999c=_0x10999c||0xcc;return function(_0x9ab9a5){if(_0x9ab9a5){return _0x1cadc0[_0x36f3('0x18')](_0x10999c);}return _0x1cadc0[_0x36f3('0x19')](_0x10999c)[_0x36f3('0x1a')]();};}function respondWithResult(_0x17ac44,_0x2ecec1){_0x2ecec1=_0x2ecec1||0xc8;return function(_0x15f777){if(_0x15f777){return _0x17ac44[_0x36f3('0x19')](_0x2ecec1)[_0x36f3('0x1b')](_0x15f777);}};}function respondWithFilteredResult(_0xc07f9b,_0x3d2b46){return function(_0x35d622){if(_0x35d622){var _0x20890f=_0x35d622['count'],_0x2c877a=_0x3d2b46[_0x36f3('0x1c')],_0x38922b=_0x3d2b46[_0x36f3('0x1c')]+_0x3d2b46[_0x36f3('0x1d')],_0x280a8a;if(_0x38922b>=_0x20890f){_0x38922b=_0x20890f;_0x280a8a=0xc8;}else{_0x280a8a=0xce;}_0xc07f9b[_0x36f3('0x19')](_0x280a8a);return _0xc07f9b[_0x36f3('0x1e')]('Content-Range',_0x2c877a+'-'+_0x38922b+'/'+_0x20890f)[_0x36f3('0x1b')](_0x35d622);}return null;};}function patchUpdates(_0x2f1538){return function(_0x51cdd7){try{jsonpatch[_0x36f3('0x1f')](_0x51cdd7,_0x2f1538,!![]);}catch(_0x301e74){return BPromise['reject'](_0x301e74);}return _0x51cdd7[_0x36f3('0x20')]();};}function saveUpdates(_0x4913c2,_0xc70040){return function(_0x39aa3b){if(_0x39aa3b){return _0x39aa3b['update'](_0x4913c2)[_0x36f3('0x21')](function(_0x215aca){return _0x215aca;});}return null;};}function removeEntity(_0x2d8c3e,_0x5ef623){return function(_0x2df36){if(_0x2df36){return _0x2df36['destroy']()[_0x36f3('0x21')](function(){_0x2d8c3e[_0x36f3('0x19')](0xcc)[_0x36f3('0x1a')]();});}};}function handleEntityNotFound(_0x12ae47,_0x439a58){return function(_0x31f124){if(!_0x31f124){_0x12ae47[_0x36f3('0x18')](0x194);}return _0x31f124;};}function handleError(_0x395970,_0x11169f){_0x11169f=_0x11169f||0x1f4;return function(_0x4b0162){logger[_0x36f3('0x22')](_0x4b0162[_0x36f3('0x23')]);if(_0x4b0162[_0x36f3('0x24')]){delete _0x4b0162[_0x36f3('0x24')];}_0x395970['status'](_0x11169f)['send'](_0x4b0162);};}exports[_0x36f3('0x25')]=function(_0x41d179,_0x4a4e04){var _0x8e6aa2={},_0x137c98={},_0x201c55={'count':0x0,'rows':[]};var _0x3e766f=db[_0x36f3('0x26')][_0x36f3('0x27')];_0x137c98[_0x36f3('0x28')]=_[_0x36f3('0x29')](_0x3e766f);_0x137c98[_0x36f3('0x2a')]=_['keys'](_0x41d179[_0x36f3('0x2a')]);_0x137c98[_0x36f3('0x2b')]=_['intersection'](_0x137c98[_0x36f3('0x28')],_0x137c98[_0x36f3('0x2a')]);_0x8e6aa2['attributes']=_[_0x36f3('0x2c')](_0x137c98['model'],qs[_0x36f3('0x2d')](_0x41d179['query'][_0x36f3('0x2d')]));_0x8e6aa2[_0x36f3('0x2e')]=_0x8e6aa2[_0x36f3('0x2e')][_0x36f3('0x2f')]?_0x8e6aa2[_0x36f3('0x2e')]:_0x137c98[_0x36f3('0x28')];if(!_0x41d179[_0x36f3('0x2a')][_0x36f3('0x30')]('nolimit')){_0x8e6aa2[_0x36f3('0x1d')]=qs['limit'](_0x41d179[_0x36f3('0x2a')]['limit']);_0x8e6aa2['offset']=qs[_0x36f3('0x1c')](_0x41d179[_0x36f3('0x2a')][_0x36f3('0x1c')]);}_0x8e6aa2[_0x36f3('0x31')]=qs[_0x36f3('0x32')](_0x41d179[_0x36f3('0x2a')][_0x36f3('0x32')]);_0x8e6aa2[_0x36f3('0x33')]=qs[_0x36f3('0x2b')](_[_0x36f3('0x34')](_0x41d179[_0x36f3('0x2a')],_0x137c98[_0x36f3('0x2b')]));if(_0x41d179[_0x36f3('0x2a')][_0x36f3('0x35')]){_0x8e6aa2[_0x36f3('0x33')]=_[_0x36f3('0x36')](_0x8e6aa2[_0x36f3('0x33')],{'$or':_['map'](_0x3e766f,function(_0xbd72b9){if(_0xbd72b9[_0x36f3('0x37')][_0x36f3('0x38')]!==_0x36f3('0x39')){var _0x43476e={};_0x43476e[_0xbd72b9[_0x36f3('0x3a')]]={'$like':'%'+_0x41d179[_0x36f3('0x2a')]['filter']+'%'};return _0x43476e;}})});}_0x8e6aa2=_[_0x36f3('0x36')]({},_0x8e6aa2,_0x41d179[_0x36f3('0x3b')]);var _0x3a5417={'where':_0x8e6aa2[_0x36f3('0x33')]};return db[_0x36f3('0x26')][_0x36f3('0x3c')](_0x3a5417)[_0x36f3('0x21')](function(_0x5ea125){_0x201c55[_0x36f3('0x3c')]=_0x5ea125;if(_0x41d179[_0x36f3('0x2a')]['includeAll']){_0x8e6aa2[_0x36f3('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x36f3('0x3e')](_0x8e6aa2);})[_0x36f3('0x21')](function(_0x40a475){_0x201c55[_0x36f3('0x3f')]=_0x40a475;return _0x201c55;})[_0x36f3('0x21')](respondWithFilteredResult(_0x4a4e04,_0x8e6aa2))[_0x36f3('0x40')](handleError(_0x4a4e04,null));};exports[_0x36f3('0x41')]=function(_0x4be3f9,_0x32790d){var _0x5f14d3={'raw':![],'where':{'id':_0x4be3f9[_0x36f3('0x42')]['id']}},_0x4eefbb={};_0x4eefbb[_0x36f3('0x28')]=_[_0x36f3('0x29')](db['AnalyticFieldReport'][_0x36f3('0x27')]);_0x4eefbb[_0x36f3('0x2a')]=_[_0x36f3('0x29')](_0x4be3f9[_0x36f3('0x2a')]);_0x4eefbb[_0x36f3('0x2b')]=_[_0x36f3('0x2c')](_0x4eefbb[_0x36f3('0x28')],_0x4eefbb['query']);_0x5f14d3[_0x36f3('0x2e')]=_[_0x36f3('0x2c')](_0x4eefbb[_0x36f3('0x28')],qs[_0x36f3('0x2d')](_0x4be3f9[_0x36f3('0x2a')][_0x36f3('0x2d')]));_0x5f14d3[_0x36f3('0x2e')]=_0x5f14d3[_0x36f3('0x2e')]['length']?_0x5f14d3[_0x36f3('0x2e')]:_0x4eefbb[_0x36f3('0x28')];if(_0x4be3f9[_0x36f3('0x2a')][_0x36f3('0x43')]){_0x5f14d3[_0x36f3('0x3d')]=[{'all':!![]}];}_0x5f14d3=_[_0x36f3('0x36')]({},_0x5f14d3,_0x4be3f9[_0x36f3('0x3b')]);return db['AnalyticFieldReport']['find'](_0x5f14d3)[_0x36f3('0x21')](handleEntityNotFound(_0x32790d,null))[_0x36f3('0x21')](respondWithResult(_0x32790d,null))[_0x36f3('0x40')](handleError(_0x32790d,null));};exports['create']=function(_0x4cf286,_0x2f8400){return db[_0x36f3('0x26')][_0x36f3('0x44')](_0x4cf286[_0x36f3('0x45')],{})['then'](respondWithResult(_0x2f8400,0xc9))[_0x36f3('0x40')](handleError(_0x2f8400,null));};exports[_0x36f3('0x46')]=function(_0x726898,_0x44bb27){return db[_0x36f3('0x26')][_0x36f3('0x46')](_0x726898[_0x36f3('0x45')],{'raw':![],'individualHooks':!![]})[_0x36f3('0x21')](respondWithResult(_0x44bb27,0xc9))[_0x36f3('0x40')](handleError(_0x44bb27,null));};exports['update']=function(_0x4c55f9,_0x4be95f){if(_0x4c55f9['body']['id']){delete _0x4c55f9[_0x36f3('0x45')]['id'];}return db['AnalyticFieldReport'][_0x36f3('0x47')]({'where':{'id':_0x4c55f9['params']['id']}})[_0x36f3('0x21')](handleEntityNotFound(_0x4be95f,null))[_0x36f3('0x21')](saveUpdates(_0x4c55f9[_0x36f3('0x45')],null))[_0x36f3('0x21')](respondWithResult(_0x4be95f,null))['catch'](handleError(_0x4be95f,null));};exports['destroy']=function(_0x3f9114,_0x1ce6f6){return db['AnalyticFieldReport'][_0x36f3('0x47')]({'where':{'id':_0x3f9114['params']['id']}})[_0x36f3('0x21')](handleEntityNotFound(_0x1ce6f6,null))['then'](removeEntity(_0x1ce6f6,null))[_0x36f3('0x40')](handleError(_0x1ce6f6,null));};exports[_0x36f3('0x48')]=function(_0x540b3a,_0x1373d6){return db[_0x36f3('0x26')][_0x36f3('0x49')]({'where':{'id':_0x540b3a[_0x36f3('0x2a')][_0x36f3('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1373d6,0xcc))['catch'](handleError(_0x1373d6,null));};exports[_0x36f3('0x4b')]=function(_0x42405d,_0x471c06,_0x398c03){return db[_0x36f3('0x4c')]['findOne']({'where':{'id':_0x42405d['params']['id']}})[_0x36f3('0x21')](handleEntityNotFound(_0x471c06,null))[_0x36f3('0x21')](function(_0x3974d8){if(_0x3974d8){return db['sequelize'][_0x36f3('0x4d')](function(_0x4997d7){return db[_0x36f3('0x26')]['destroy']({'where':{'CustomReportId':_0x42405d['params']['id']},'transaction':_0x4997d7})[_0x36f3('0x21')](function(_0x361a89){var _0x3b9d12=_[_0x36f3('0x4e')](_0x42405d[_0x36f3('0x45')],function(_0x3673d2){delete _0x3673d2['id'];_0x3673d2[_0x36f3('0x4f')]=_0x42405d[_0x36f3('0x42')]['id'];return _0x3673d2;});return db[_0x36f3('0x26')]['bulkCreate'](_0x3b9d12,{'transaction':_0x4997d7});});})['then'](function(){return db['AnalyticFieldReport'][_0x36f3('0x3e')]({'where':{'CustomReportId':_0x42405d[_0x36f3('0x42')]['id']}});});}})[_0x36f3('0x21')](respondWithResult(_0x471c06,null))[_0x36f3('0x40')](handleError(_0x471c06,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index d827a57..514f33c 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 _0xd1b6=['../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment','path','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd1b6,0x192));var _0x6d1b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd1b6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x6d1b('0x0'));var logger=require(_0x6d1b('0x1'))('api');var moment=require(_0x6d1b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d1b('0x3'));var rimraf=require(_0x6d1b('0x4'));var config=require(_0x6d1b('0x5'));var attributes=require(_0x6d1b('0x6'));module[_0x6d1b('0x7')]=function(_0x461b14,_0x227429){return _0x461b14[_0x6d1b('0x8')](_0x6d1b('0x9'),attributes,{'tableName':_0x6d1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a73=['request-promise','path','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a3e02,_0x3da60c){var _0x5d3a3e=function(_0x49a219){while(--_0x49a219){_0x1a3e02['push'](_0x1a3e02['shift']());}};_0x5d3a3e(++_0x3da60c);}(_0x3a73,0x166));var _0x33a7=function(_0x124120,_0x6468a8){_0x124120=_0x124120-0x0;var _0x24ec51=_0x3a73[_0x124120];return _0x24ec51;};'use strict';var _=require(_0x33a7('0x0'));var util=require(_0x33a7('0x1'));var logger=require(_0x33a7('0x2'))(_0x33a7('0x3'));var moment=require(_0x33a7('0x4'));var BPromise=require(_0x33a7('0x5'));var rp=require(_0x33a7('0x6'));var fs=require('fs');var path=require(_0x33a7('0x7'));var rimraf=require('rimraf');var config=require(_0x33a7('0x8'));var attributes=require(_0x33a7('0x9'));module[_0x33a7('0xa')]=function(_0x591799,_0x13f9d4){return _0x591799[_0x33a7('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0x33a7('0xc'),'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 8189202..8da36e3 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 _0xf95f=['../../config/logger','../../config/environment','client','request','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2d1971,_0x20b764){var _0x4d7759=function(_0x56a550){while(--_0x56a550){_0x2d1971['push'](_0x2d1971['shift']());}};_0x4d7759(++_0x20b764);}(_0xf95f,0x142));var _0xff95=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0xf95f[_0x2ec2bf];return _0x2c279c;};'use strict';var _=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var moment=require(_0xff95('0x2'));var BPromise=require(_0xff95('0x3'));var rs=require(_0xff95('0x4'));var fs=require('fs');var Redis=require(_0xff95('0x5'));var db=require(_0xff95('0x6'))['db'];var utils=require(_0xff95('0x7'));var logger=require(_0xff95('0x8'))('rpc');var config=require(_0xff95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x314fb4,_0x781e05,_0x2b9ce9){return new BPromise(function(_0x1a42b2,_0x198a51){return client[_0xff95('0xb')](_0x314fb4,_0x2b9ce9)[_0xff95('0xc')](function(_0xa2a50d){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x781e05,_0xff95('0xd'));logger[_0xff95('0xe')](_0xff95('0xf'),_0x781e05,_0xff95('0xd'),JSON[_0xff95('0x10')](_0xa2a50d));if(_0xa2a50d[_0xff95('0x11')]){if(_0xa2a50d[_0xff95('0x11')]['code']===0x1f4){logger['error'](_0xff95('0x12'),_0x781e05,_0xa2a50d[_0xff95('0x11')]['message']);return _0x198a51(_0xa2a50d[_0xff95('0x11')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x781e05,_0xa2a50d[_0xff95('0x11')][_0xff95('0x13')]);return _0x1a42b2(_0xa2a50d[_0xff95('0x11')][_0xff95('0x13')]);}else{logger[_0xff95('0x14')](_0xff95('0x12'),_0x781e05,'request\x20sent');_0x1a42b2(_0xa2a50d['result'][_0xff95('0x13')]);}})[_0xff95('0x15')](function(_0x83e644){logger[_0xff95('0x11')](_0xff95('0x12'),_0x781e05,_0x83e644);_0x198a51(_0x83e644);});});} \ No newline at end of file +var _0x044a=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3a60bf,_0x3ba9a9){var _0x4f837e=function(_0x5687e6){while(--_0x5687e6){_0x3a60bf['push'](_0x3a60bf['shift']());}};_0x4f837e(++_0x3ba9a9);}(_0x044a,0x173));var _0xa044=function(_0x35b539,_0x16cb3b){_0x35b539=_0x35b539-0x0;var _0x78adfa=_0x044a[_0x35b539];return _0x78adfa;};'use strict';var _=require(_0xa044('0x0'));var util=require(_0xa044('0x1'));var moment=require(_0xa044('0x2'));var BPromise=require(_0xa044('0x3'));var rs=require(_0xa044('0x4'));var fs=require('fs');var Redis=require(_0xa044('0x5'));var db=require(_0xa044('0x6'))['db'];var utils=require(_0xa044('0x7'));var logger=require(_0xa044('0x8'))(_0xa044('0x9'));var config=require('../../config/environment');var jayson=require(_0xa044('0xa'));var client=jayson[_0xa044('0xb')][_0xa044('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c04bb,_0x59b81b,_0xe12f7d){return new BPromise(function(_0x33f556,_0x936b2c){return client[_0xa044('0xd')](_0x1c04bb,_0xe12f7d)['then'](function(_0x3b1dcd){logger[_0xa044('0xe')](_0xa044('0xf'),_0x59b81b,'request\x20sent');logger[_0xa044('0x10')](_0xa044('0x11'),_0x59b81b,_0xa044('0x12'),JSON[_0xa044('0x13')](_0x3b1dcd));if(_0x3b1dcd['error']){if(_0x3b1dcd[_0xa044('0x14')]['code']===0x1f4){logger['error'](_0xa044('0xf'),_0x59b81b,_0x3b1dcd[_0xa044('0x14')][_0xa044('0x15')]);return _0x936b2c(_0x3b1dcd[_0xa044('0x14')][_0xa044('0x15')]);}logger[_0xa044('0x14')](_0xa044('0xf'),_0x59b81b,_0x3b1dcd['error'][_0xa044('0x15')]);return _0x33f556(_0x3b1dcd['error'][_0xa044('0x15')]);}else{logger[_0xa044('0xe')](_0xa044('0xf'),_0x59b81b,_0xa044('0x12'));_0x33f556(_0x3b1dcd[_0xa044('0x16')]['message']);}})['catch'](function(_0x21b78c){logger['error'](_0xa044('0xf'),_0x59b81b,_0x21b78c);_0x936b2c(_0x21b78c);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 6ff417d..45a0583 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 _0xd404=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','bulkCreate','/:id/create_many','addFields','put','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','connect-timeout'];(function(_0x5ae1ad,_0x18983d){var _0x297ceb=function(_0xa6b42d){while(--_0xa6b42d){_0x5ae1ad['push'](_0x5ae1ad['shift']());}};_0x297ceb(++_0x18983d);}(_0xd404,0x15b));var _0x4d40=function(_0x2f7cde,_0xb0b57e){_0x2f7cde=_0x2f7cde-0x0;var _0x16bf5d=_0xd404[_0x2f7cde];return _0x16bf5d;};'use strict';var multer=require(_0x4d40('0x0'));var util=require(_0x4d40('0x1'));var path=require('path');var timeout=require(_0x4d40('0x2'));var express=require(_0x4d40('0x3'));var router=express['Router']();var auth=require(_0x4d40('0x4'));var interaction=require(_0x4d40('0x5'));var config=require(_0x4d40('0x6'));var controller=require(_0x4d40('0x7'));router[_0x4d40('0x8')]('/',auth[_0x4d40('0x9')](),controller[_0x4d40('0xa')]);router[_0x4d40('0x8')](_0x4d40('0xb'),auth['isAuthenticated'](),controller[_0x4d40('0xc')]);router[_0x4d40('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d40('0xe')]);router['post']('/create_many',auth[_0x4d40('0x9')](),controller[_0x4d40('0xf')]);router[_0x4d40('0xd')](_0x4d40('0x10'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x11')]);router[_0x4d40('0x12')](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x13')]);router[_0x4d40('0x14')](_0x4d40('0x15'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x16')]);router['delete'](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x17')]);module[_0x4d40('0x18')]=router; \ No newline at end of file +var _0xbf6e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','post','bulkCreate','/:id/create_many','addFields','put','delete','/destroy_many','bulkDestroy','destroy','path'];(function(_0x21d41f,_0x50654b){var _0x43849b=function(_0x3c9493){while(--_0x3c9493){_0x21d41f['push'](_0x21d41f['shift']());}};_0x43849b(++_0x50654b);}(_0xbf6e,0x149));var _0xebf6=function(_0x4219f5,_0x22bfb2){_0x4219f5=_0x4219f5-0x0;var _0x4d3f5b=_0xbf6e[_0x4219f5];return _0x4d3f5b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebf6('0x0'));var timeout=require(_0xebf6('0x1'));var express=require(_0xebf6('0x2'));var router=express[_0xebf6('0x3')]();var auth=require(_0xebf6('0x4'));var interaction=require(_0xebf6('0x5'));var config=require(_0xebf6('0x6'));var controller=require('./analyticFieldReport.controller');router[_0xebf6('0x7')]('/',auth[_0xebf6('0x8')](),controller[_0xebf6('0x9')]);router[_0xebf6('0x7')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller[_0xebf6('0xb')]);router['post']('/',auth[_0xebf6('0x8')](),controller[_0xebf6('0xc')]);router[_0xebf6('0xd')]('/create_many',auth[_0xebf6('0x8')](),controller[_0xebf6('0xe')]);router['post'](_0xebf6('0xf'),auth[_0xebf6('0x8')](),controller[_0xebf6('0x10')]);router[_0xebf6('0x11')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller['update']);router[_0xebf6('0x12')](_0xebf6('0x13'),auth['isAuthenticated'](),controller[_0xebf6('0x14')]);router[_0xebf6('0x12')](_0xebf6('0xa'),auth[_0xebf6('0x8')](),controller[_0xebf6('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index d0d8c36..49b8243 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 _0xd862=['name','STRING','TEXT','sequelize','exports'];(function(_0x3deef8,_0x486af5){var _0x459d16=function(_0x54668b){while(--_0x54668b){_0x3deef8['push'](_0x3deef8['shift']());}};_0x459d16(++_0x486af5);}(_0xd862,0x139));var _0x2d86=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xd862[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0x2d86('0x0'));module[_0x2d86('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2d86('0x2')},'table':{'type':Sequelize[_0x2d86('0x3')]},'metric':{'type':Sequelize[_0x2d86('0x4')]},'description':{'type':Sequelize[_0x2d86('0x3')]}}; \ No newline at end of file +var _0x6500=['TEXT','sequelize','exports','STRING','name'];(function(_0x5633ba,_0x2cde5e){var _0x1176ab=function(_0x7acfb1){while(--_0x7acfb1){_0x5633ba['push'](_0x5633ba['shift']());}};_0x1176ab(++_0x2cde5e);}(_0x6500,0x18c));var _0x0650=function(_0x4a0273,_0xfc9a88){_0x4a0273=_0x4a0273-0x0;var _0x21d9ad=_0x6500[_0x4a0273];return _0x21d9ad;};'use strict';var Sequelize=require(_0x0650('0x0'));module[_0x0650('0x1')]={'name':{'type':Sequelize[_0x0650('0x2')],'allowNull':![],'unique':_0x0650('0x3')},'table':{'type':Sequelize[_0x0650('0x2')]},'metric':{'type':Sequelize[_0x0650('0x4')]},'description':{'type':Sequelize[_0x0650('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 79c41aa..ee953be 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 _0x13b7=['bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','reject','save','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','index','AnalyticMetric','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','map','type','key','VIRTUAL','field','merge','options','include','findAll','catch','show','keys','intersection','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','params','zip-dir','fast-json-patch'];(function(_0x4fd4dd,_0x560079){var _0x1923d2=function(_0x2b19f0){while(--_0x2b19f0){_0x4fd4dd['push'](_0x4fd4dd['shift']());}};_0x1923d2(++_0x560079);}(_0x13b7,0x1a8));var _0x713b=function(_0x57dda3,_0x12164e){_0x57dda3=_0x57dda3-0x0;var _0x4e86b9=_0x13b7[_0x57dda3];return _0x4e86b9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x713b('0x0'));var jsonpatch=require(_0x713b('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x713b('0x2'));var Mustache=require('mustache');var util=require(_0x713b('0x3'));var path=require(_0x713b('0x4'));var sox=require(_0x713b('0x5'));var csv=require('to-csv');var ejs=require(_0x713b('0x6'));var fs=require('fs');var _=require(_0x713b('0x7'));var squel=require(_0x713b('0x8'));var crypto=require(_0x713b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x713b('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x713b('0xb'));var Redis=require('ioredis');var authService=require(_0x713b('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x713b('0xd'));var utils=require(_0x713b('0xe'));var config=require(_0x713b('0xf'));var db=require(_0x713b('0x10'))['db'];function respondWithStatusCode(_0x5b0d78,_0x56e49c){_0x56e49c=_0x56e49c||0xcc;return function(_0x2dc7c1){if(_0x2dc7c1){return _0x5b0d78[_0x713b('0x11')](_0x56e49c);}return _0x5b0d78['status'](_0x56e49c)[_0x713b('0x12')]();};}function respondWithResult(_0x5740b6,_0x270f10){_0x270f10=_0x270f10||0xc8;return function(_0x49f378){if(_0x49f378){return _0x5740b6[_0x713b('0x13')](_0x270f10)[_0x713b('0x14')](_0x49f378);}};}function respondWithFilteredResult(_0x5aa48c,_0x1e3b70){return function(_0xebc4cb){if(_0xebc4cb){var _0x19fbac=_0xebc4cb[_0x713b('0x15')],_0x170b37=_0x1e3b70[_0x713b('0x16')],_0x4c0f5a=_0x1e3b70[_0x713b('0x16')]+_0x1e3b70[_0x713b('0x17')],_0x2b97c5;if(_0x4c0f5a>=_0x19fbac){_0x4c0f5a=_0x19fbac;_0x2b97c5=0xc8;}else{_0x2b97c5=0xce;}_0x5aa48c[_0x713b('0x13')](_0x2b97c5);return _0x5aa48c['set']('Content-Range',_0x170b37+'-'+_0x4c0f5a+'/'+_0x19fbac)[_0x713b('0x14')](_0xebc4cb);}return null;};}function patchUpdates(_0x5cd828){return function(_0x291ed3){try{jsonpatch['apply'](_0x291ed3,_0x5cd828,!![]);}catch(_0x1e41f3){return BPromise[_0x713b('0x18')](_0x1e41f3);}return _0x291ed3[_0x713b('0x19')]();};}function saveUpdates(_0x5824be,_0x475389){return function(_0xc80d14){if(_0xc80d14){return _0xc80d14[_0x713b('0x1a')](_0x5824be)[_0x713b('0x1b')](function(_0x59a095){return _0x59a095;});}return null;};}function removeEntity(_0x3f5048,_0x4eb420){return function(_0x1c21d4){if(_0x1c21d4){return _0x1c21d4[_0x713b('0x1c')]()[_0x713b('0x1b')](function(){var _0x4d0c14=_0x1c21d4[_0x713b('0x1d')]({'plain':!![]});var _0x2e8388=_0x713b('0x1e');return db[_0x713b('0x1f')][_0x713b('0x1c')]({'where':{'type':_0x2e8388,'resourceId':_0x4d0c14['id']}})['then'](function(){return _0x1c21d4;});})[_0x713b('0x1b')](function(){_0x3f5048['status'](0xcc)[_0x713b('0x12')]();});}};}function handleEntityNotFound(_0xfffbdf,_0x543530){return function(_0x42b5db){if(!_0x42b5db){_0xfffbdf[_0x713b('0x11')](0x194);}return _0x42b5db;};}function handleError(_0x17b4d9,_0x406e4e){_0x406e4e=_0x406e4e||0x1f4;return function(_0x3a0d54){logger[_0x713b('0x20')](_0x3a0d54[_0x713b('0x21')]);if(_0x3a0d54[_0x713b('0x22')]){delete _0x3a0d54[_0x713b('0x22')];}_0x17b4d9[_0x713b('0x13')](_0x406e4e)['send'](_0x3a0d54);};}exports[_0x713b('0x23')]=function(_0x30af9d,_0x530bc3){var _0x4a5e82={},_0x4a501c={},_0x249c8a={'count':0x0,'rows':[]};var _0xe103eb=db[_0x713b('0x24')]['rawAttributes'];_0x4a501c[_0x713b('0x25')]=_['keys'](_0xe103eb);_0x4a501c[_0x713b('0x26')]=_['keys'](_0x30af9d[_0x713b('0x26')]);_0x4a501c[_0x713b('0x27')]=_['intersection'](_0x4a501c[_0x713b('0x25')],_0x4a501c[_0x713b('0x26')]);_0x4a5e82['attributes']=_['intersection'](_0x4a501c['model'],qs[_0x713b('0x28')](_0x30af9d[_0x713b('0x26')][_0x713b('0x28')]));_0x4a5e82[_0x713b('0x29')]=_0x4a5e82[_0x713b('0x29')][_0x713b('0x2a')]?_0x4a5e82[_0x713b('0x29')]:_0x4a501c[_0x713b('0x25')];if(!_0x30af9d[_0x713b('0x26')][_0x713b('0x2b')](_0x713b('0x2c'))){_0x4a5e82[_0x713b('0x17')]=qs[_0x713b('0x17')](_0x30af9d[_0x713b('0x26')][_0x713b('0x17')]);_0x4a5e82[_0x713b('0x16')]=qs['offset'](_0x30af9d['query'][_0x713b('0x16')]);}_0x4a5e82[_0x713b('0x2d')]=qs[_0x713b('0x2e')](_0x30af9d[_0x713b('0x26')][_0x713b('0x2e')]);_0x4a5e82['where']=qs[_0x713b('0x27')](_['pick'](_0x30af9d['query'],_0x4a501c['filters']));if(_0x30af9d['query'][_0x713b('0x2f')]){_0x4a5e82[_0x713b('0x30')]=_['merge'](_0x4a5e82[_0x713b('0x30')],{'$or':_[_0x713b('0x31')](_0xe103eb,function(_0xdd5d7){if(_0xdd5d7[_0x713b('0x32')][_0x713b('0x33')]!==_0x713b('0x34')){var _0x42cee7={};_0x42cee7[_0xdd5d7[_0x713b('0x35')]]={'$like':'%'+_0x30af9d[_0x713b('0x26')][_0x713b('0x2f')]+'%'};return _0x42cee7;}})});}_0x4a5e82=_[_0x713b('0x36')]({},_0x4a5e82,_0x30af9d[_0x713b('0x37')]);var _0x1611c6={'where':_0x4a5e82[_0x713b('0x30')]};return db[_0x713b('0x24')]['count'](_0x1611c6)[_0x713b('0x1b')](function(_0x6d23cc){_0x249c8a[_0x713b('0x15')]=_0x6d23cc;if(_0x30af9d[_0x713b('0x26')]['includeAll']){_0x4a5e82[_0x713b('0x38')]=[{'all':!![]}];}return db[_0x713b('0x24')][_0x713b('0x39')](_0x4a5e82);})[_0x713b('0x1b')](function(_0x4cbc65){_0x249c8a['rows']=_0x4cbc65;return _0x249c8a;})[_0x713b('0x1b')](respondWithFilteredResult(_0x530bc3,_0x4a5e82))[_0x713b('0x3a')](handleError(_0x530bc3,null));};exports[_0x713b('0x3b')]=function(_0x3cd72c,_0x170bfa){var _0xe0c0db={'raw':!![],'where':{'id':_0x3cd72c['params']['id']}},_0x3b9d71={};_0x3b9d71[_0x713b('0x25')]=_[_0x713b('0x3c')](db[_0x713b('0x24')]['rawAttributes']);_0x3b9d71['query']=_[_0x713b('0x3c')](_0x3cd72c[_0x713b('0x26')]);_0x3b9d71[_0x713b('0x27')]=_['intersection'](_0x3b9d71['model'],_0x3b9d71[_0x713b('0x26')]);_0xe0c0db['attributes']=_[_0x713b('0x3d')](_0x3b9d71[_0x713b('0x25')],qs[_0x713b('0x28')](_0x3cd72c['query']['fields']));_0xe0c0db[_0x713b('0x29')]=_0xe0c0db[_0x713b('0x29')][_0x713b('0x2a')]?_0xe0c0db[_0x713b('0x29')]:_0x3b9d71[_0x713b('0x25')];if(_0x3cd72c[_0x713b('0x26')][_0x713b('0x3e')]){_0xe0c0db[_0x713b('0x38')]=[{'all':!![]}];}_0xe0c0db=_['merge']({},_0xe0c0db,_0x3cd72c[_0x713b('0x37')]);return db['AnalyticMetric'][_0x713b('0x3f')](_0xe0c0db)[_0x713b('0x1b')](handleEntityNotFound(_0x170bfa,null))[_0x713b('0x1b')](respondWithResult(_0x170bfa,null))['catch'](handleError(_0x170bfa,null));};exports[_0x713b('0x40')]=function(_0x461251,_0x235894){return db[_0x713b('0x24')]['create'](_0x461251[_0x713b('0x41')],{})[_0x713b('0x1b')](function(_0x477370){var _0x43b535=_0x461251['user'][_0x713b('0x1d')]({'plain':!![]});if(!_0x43b535)throw new Error(_0x713b('0x42'));if(_0x43b535['role']===_0x713b('0x43')){var _0x2755b0=_0x477370[_0x713b('0x1d')]({'plain':!![]});var _0x5648c3='Metrics';return db[_0x713b('0x44')][_0x713b('0x3f')]({'where':{'name':_0x5648c3,'userProfileId':_0x43b535[_0x713b('0x45')]},'raw':!![]})['then'](function(_0x3847e2){if(_0x3847e2&&_0x3847e2['autoAssociation']===0x0){return db[_0x713b('0x1f')][_0x713b('0x40')]({'name':_0x2755b0[_0x713b('0x22')],'resourceId':_0x2755b0['id'],'type':_0x3847e2[_0x713b('0x22')],'sectionId':_0x3847e2['id']},{})[_0x713b('0x1b')](function(){return _0x477370;});}else{return _0x477370;}})[_0x713b('0x3a')](function(_0x16cd28){logger[_0x713b('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16cd28);throw _0x16cd28;});}return _0x477370;})[_0x713b('0x1b')](respondWithResult(_0x235894,0xc9))[_0x713b('0x3a')](handleError(_0x235894,null));};exports[_0x713b('0x1a')]=function(_0x189f43,_0x13d116){if(_0x189f43['body']['id']){delete _0x189f43[_0x713b('0x41')]['id'];}return db[_0x713b('0x24')][_0x713b('0x3f')]({'where':{'id':_0x189f43[_0x713b('0x46')]['id']}})['then'](handleEntityNotFound(_0x13d116,null))[_0x713b('0x1b')](saveUpdates(_0x189f43[_0x713b('0x41')],null))['then'](respondWithResult(_0x13d116,null))['catch'](handleError(_0x13d116,null));};exports[_0x713b('0x1c')]=function(_0x2c6a49,_0x5609e8){return db[_0x713b('0x24')][_0x713b('0x3f')]({'where':{'id':_0x2c6a49[_0x713b('0x46')]['id']}})[_0x713b('0x1b')](handleEntityNotFound(_0x5609e8,null))['then'](removeEntity(_0x5609e8,null))[_0x713b('0x3a')](handleError(_0x5609e8,null));}; \ No newline at end of file +var _0x9893=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Metrics','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','type','key','options','AnalyticMetric','findAll','rows','catch','show','params','length','includeAll','include','merge','find','create','body','user','get','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir'];(function(_0x4a782b,_0x55584a){var _0x5cb5a0=function(_0x3010ed){while(--_0x3010ed){_0x4a782b['push'](_0x4a782b['shift']());}};_0x5cb5a0(++_0x55584a);}(_0x9893,0x1c6));var _0x3989=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9893[_0x14add3];return _0x4a174f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3989('0x0'));var zipdir=require(_0x3989('0x1'));var jsonpatch=require(_0x3989('0x2'));var rp=require(_0x3989('0x3'));var moment=require(_0x3989('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3989('0x5'));var util=require(_0x3989('0x6'));var path=require(_0x3989('0x7'));var sox=require(_0x3989('0x8'));var csv=require(_0x3989('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3989('0xa'));var squel=require(_0x3989('0xb'));var crypto=require(_0x3989('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3989('0xd'));var toCsv=require(_0x3989('0x9'));var querystring=require(_0x3989('0xe'));var Papa=require(_0x3989('0xf'));var Redis=require(_0x3989('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3989('0x11'));var hardwareService=require(_0x3989('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x3989('0x13'));var config=require(_0x3989('0x14'));var db=require(_0x3989('0x15'))['db'];function respondWithStatusCode(_0x45a0ba,_0x96508b){_0x96508b=_0x96508b||0xcc;return function(_0x3f8fa5){if(_0x3f8fa5){return _0x45a0ba[_0x3989('0x16')](_0x96508b);}return _0x45a0ba[_0x3989('0x17')](_0x96508b)[_0x3989('0x18')]();};}function respondWithResult(_0x1cce35,_0xcd6cec){_0xcd6cec=_0xcd6cec||0xc8;return function(_0x5d43d0){if(_0x5d43d0){return _0x1cce35['status'](_0xcd6cec)[_0x3989('0x19')](_0x5d43d0);}};}function respondWithFilteredResult(_0xde984a,_0x22975b){return function(_0x2b7b4d){if(_0x2b7b4d){var _0x214734=_0x2b7b4d[_0x3989('0x1a')],_0x3212c9=_0x22975b['offset'],_0x140912=_0x22975b[_0x3989('0x1b')]+_0x22975b[_0x3989('0x1c')],_0xd7b791;if(_0x140912>=_0x214734){_0x140912=_0x214734;_0xd7b791=0xc8;}else{_0xd7b791=0xce;}_0xde984a['status'](_0xd7b791);return _0xde984a[_0x3989('0x1d')](_0x3989('0x1e'),_0x3212c9+'-'+_0x140912+'/'+_0x214734)['json'](_0x2b7b4d);}return null;};}function patchUpdates(_0x543f68){return function(_0x22d5de){try{jsonpatch[_0x3989('0x1f')](_0x22d5de,_0x543f68,!![]);}catch(_0x49195f){return BPromise[_0x3989('0x20')](_0x49195f);}return _0x22d5de[_0x3989('0x21')]();};}function saveUpdates(_0x162047,_0x2ce29b){return function(_0x437260){if(_0x437260){return _0x437260[_0x3989('0x22')](_0x162047)['then'](function(_0x1c2f32){return _0x1c2f32;});}return null;};}function removeEntity(_0x5b4cbc,_0x2b52fc){return function(_0x560b67){if(_0x560b67){return _0x560b67[_0x3989('0x23')]()[_0x3989('0x24')](function(){var _0x490b4d=_0x560b67['get']({'plain':!![]});var _0x381bcc=_0x3989('0x25');return db[_0x3989('0x26')][_0x3989('0x23')]({'where':{'type':_0x381bcc,'resourceId':_0x490b4d['id']}})['then'](function(){return _0x560b67;});})[_0x3989('0x24')](function(){_0x5b4cbc[_0x3989('0x17')](0xcc)[_0x3989('0x18')]();});}};}function handleEntityNotFound(_0x326a79,_0x4ec7e9){return function(_0x25a5b3){if(!_0x25a5b3){_0x326a79[_0x3989('0x16')](0x194);}return _0x25a5b3;};}function handleError(_0x5c4958,_0x2f0ce7){_0x2f0ce7=_0x2f0ce7||0x1f4;return function(_0x38a8a4){logger[_0x3989('0x27')](_0x38a8a4[_0x3989('0x28')]);if(_0x38a8a4[_0x3989('0x29')]){delete _0x38a8a4[_0x3989('0x29')];}_0x5c4958[_0x3989('0x17')](_0x2f0ce7)[_0x3989('0x2a')](_0x38a8a4);};}exports['index']=function(_0x103805,_0x173d24){var _0x42571a={},_0x4861a8={},_0x7a325b={'count':0x0,'rows':[]};var _0x3f3bdd=db['AnalyticMetric'][_0x3989('0x2b')];_0x4861a8[_0x3989('0x2c')]=_[_0x3989('0x2d')](_0x3f3bdd);_0x4861a8[_0x3989('0x2e')]=_[_0x3989('0x2d')](_0x103805[_0x3989('0x2e')]);_0x4861a8[_0x3989('0x2f')]=_[_0x3989('0x30')](_0x4861a8['model'],_0x4861a8[_0x3989('0x2e')]);_0x42571a[_0x3989('0x31')]=_[_0x3989('0x30')](_0x4861a8[_0x3989('0x2c')],qs['fields'](_0x103805[_0x3989('0x2e')][_0x3989('0x32')]));_0x42571a[_0x3989('0x31')]=_0x42571a[_0x3989('0x31')]['length']?_0x42571a['attributes']:_0x4861a8[_0x3989('0x2c')];if(!_0x103805[_0x3989('0x2e')]['hasOwnProperty']('nolimit')){_0x42571a[_0x3989('0x1c')]=qs[_0x3989('0x1c')](_0x103805['query']['limit']);_0x42571a['offset']=qs['offset'](_0x103805[_0x3989('0x2e')][_0x3989('0x1b')]);}_0x42571a['order']=qs[_0x3989('0x33')](_0x103805['query']['sort']);_0x42571a[_0x3989('0x34')]=qs['filters'](_[_0x3989('0x35')](_0x103805[_0x3989('0x2e')],_0x4861a8[_0x3989('0x2f')]));if(_0x103805[_0x3989('0x2e')][_0x3989('0x36')]){_0x42571a[_0x3989('0x34')]=_['merge'](_0x42571a[_0x3989('0x34')],{'$or':_['map'](_0x3f3bdd,function(_0xd072b7){if(_0xd072b7[_0x3989('0x37')][_0x3989('0x38')]!=='VIRTUAL'){var _0x1dca5a={};_0x1dca5a[_0xd072b7['field']]={'$like':'%'+_0x103805[_0x3989('0x2e')][_0x3989('0x36')]+'%'};return _0x1dca5a;}})});}_0x42571a=_['merge']({},_0x42571a,_0x103805[_0x3989('0x39')]);var _0x39151d={'where':_0x42571a[_0x3989('0x34')]};return db[_0x3989('0x3a')][_0x3989('0x1a')](_0x39151d)[_0x3989('0x24')](function(_0x4aa46f){_0x7a325b[_0x3989('0x1a')]=_0x4aa46f;if(_0x103805[_0x3989('0x2e')]['includeAll']){_0x42571a['include']=[{'all':!![]}];}return db[_0x3989('0x3a')][_0x3989('0x3b')](_0x42571a);})['then'](function(_0x1933ae){_0x7a325b[_0x3989('0x3c')]=_0x1933ae;return _0x7a325b;})['then'](respondWithFilteredResult(_0x173d24,_0x42571a))[_0x3989('0x3d')](handleError(_0x173d24,null));};exports[_0x3989('0x3e')]=function(_0x37b64d,_0x5bbc1a){var _0x38d5d4={'raw':!![],'where':{'id':_0x37b64d[_0x3989('0x3f')]['id']}},_0x452e7c={};_0x452e7c['model']=_[_0x3989('0x2d')](db['AnalyticMetric'][_0x3989('0x2b')]);_0x452e7c[_0x3989('0x2e')]=_['keys'](_0x37b64d['query']);_0x452e7c[_0x3989('0x2f')]=_['intersection'](_0x452e7c['model'],_0x452e7c[_0x3989('0x2e')]);_0x38d5d4[_0x3989('0x31')]=_[_0x3989('0x30')](_0x452e7c[_0x3989('0x2c')],qs['fields'](_0x37b64d['query'][_0x3989('0x32')]));_0x38d5d4['attributes']=_0x38d5d4['attributes'][_0x3989('0x40')]?_0x38d5d4[_0x3989('0x31')]:_0x452e7c[_0x3989('0x2c')];if(_0x37b64d[_0x3989('0x2e')][_0x3989('0x41')]){_0x38d5d4[_0x3989('0x42')]=[{'all':!![]}];}_0x38d5d4=_[_0x3989('0x43')]({},_0x38d5d4,_0x37b64d[_0x3989('0x39')]);return db[_0x3989('0x3a')][_0x3989('0x44')](_0x38d5d4)['then'](handleEntityNotFound(_0x5bbc1a,null))[_0x3989('0x24')](respondWithResult(_0x5bbc1a,null))[_0x3989('0x3d')](handleError(_0x5bbc1a,null));};exports[_0x3989('0x45')]=function(_0x5c7d63,_0x149ad8){return db['AnalyticMetric'][_0x3989('0x45')](_0x5c7d63[_0x3989('0x46')],{})[_0x3989('0x24')](function(_0x1a5015){var _0x109af0=_0x5c7d63[_0x3989('0x47')][_0x3989('0x48')]({'plain':!![]});if(!_0x109af0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x109af0[_0x3989('0x49')]===_0x3989('0x47')){var _0x59ee68=_0x1a5015[_0x3989('0x48')]({'plain':!![]});var _0x1614cd=_0x3989('0x25');return db[_0x3989('0x4a')][_0x3989('0x44')]({'where':{'name':_0x1614cd,'userProfileId':_0x109af0['userProfileId']},'raw':!![]})[_0x3989('0x24')](function(_0x3d4030){if(_0x3d4030&&_0x3d4030['autoAssociation']===0x0){return db[_0x3989('0x26')]['create']({'name':_0x59ee68[_0x3989('0x29')],'resourceId':_0x59ee68['id'],'type':_0x3d4030['name'],'sectionId':_0x3d4030['id']},{})[_0x3989('0x24')](function(){return _0x1a5015;});}else{return _0x1a5015;}})[_0x3989('0x3d')](function(_0x5b6c21){logger[_0x3989('0x27')](_0x3989('0x4b'),_0x5b6c21);throw _0x5b6c21;});}return _0x1a5015;})[_0x3989('0x24')](respondWithResult(_0x149ad8,0xc9))[_0x3989('0x3d')](handleError(_0x149ad8,null));};exports[_0x3989('0x22')]=function(_0x2129bc,_0x15dd97){if(_0x2129bc[_0x3989('0x46')]['id']){delete _0x2129bc[_0x3989('0x46')]['id'];}return db['AnalyticMetric'][_0x3989('0x44')]({'where':{'id':_0x2129bc[_0x3989('0x3f')]['id']}})[_0x3989('0x24')](handleEntityNotFound(_0x15dd97,null))[_0x3989('0x24')](saveUpdates(_0x2129bc[_0x3989('0x46')],null))[_0x3989('0x24')](respondWithResult(_0x15dd97,null))['catch'](handleError(_0x15dd97,null));};exports[_0x3989('0x23')]=function(_0x29b32c,_0x4cc00c){return db[_0x3989('0x3a')][_0x3989('0x44')]({'where':{'id':_0x29b32c['params']['id']}})[_0x3989('0x24')](handleEntityNotFound(_0x4cc00c,null))[_0x3989('0x24')](removeEntity(_0x4cc00c,null))[_0x3989('0x3d')](handleError(_0x4cc00c,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 632b217..0b7bf7b 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 _0xdb8a=['../../config/environment','exports','define','AnalyticMetric','lodash','api','bluebird','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdb8a,0xfc));var _0xadb8=function(_0x440464,_0xb7afd8){_0x440464=_0x440464-0x0;var _0x2f4043=_0xdb8a[_0x440464];return _0x2f4043;};'use strict';var _=require(_0xadb8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xadb8('0x1'));var moment=require('moment');var BPromise=require(_0xadb8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xadb8('0x3'));var config=require(_0xadb8('0x4'));var attributes=require('./analyticMetric.attributes');module[_0xadb8('0x5')]=function(_0x5e1ba1,_0x36feb5){return _0x5e1ba1[_0xadb8('0x6')](_0xadb8('0x7'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ee4=['analytics_metrics','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0x34ad72,_0x1e43f6){var _0x5c9aa8=function(_0x144388){while(--_0x144388){_0x34ad72['push'](_0x34ad72['shift']());}};_0x5c9aa8(++_0x1e43f6);}(_0x1ee4,0x16c));var _0x41ee=function(_0x1afe1e,_0x9f42c2){_0x1afe1e=_0x1afe1e-0x0;var _0x383c23=_0x1ee4[_0x1afe1e];return _0x383c23;};'use strict';var _=require(_0x41ee('0x0'));var util=require(_0x41ee('0x1'));var logger=require(_0x41ee('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x41ee('0x3'));var fs=require('fs');var path=require(_0x41ee('0x4'));var rimraf=require(_0x41ee('0x5'));var config=require(_0x41ee('0x6'));var attributes=require(_0x41ee('0x7'));module[_0x41ee('0x8')]=function(_0x1f1186,_0x44195b){return _0x1f1186[_0x41ee('0x9')]('AnalyticMetric',attributes,{'tableName':_0x41ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index b0e6b83..c8f0c73 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 _0x8128=['message','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2b3087,_0x5bad3a){var _0x39bb6a=function(_0x51f8d4){while(--_0x51f8d4){_0x2b3087['push'](_0x2b3087['shift']());}};_0x39bb6a(++_0x5bad3a);}(_0x8128,0x1b1));var _0x8812=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x8128[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x8812('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8812('0x1'));var rs=require(_0x8812('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8812('0x3'));var logger=require(_0x8812('0x4'))(_0x8812('0x5'));var config=require('../../config/environment');var jayson=require(_0x8812('0x6'));var client=jayson[_0x8812('0x7')][_0x8812('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16bafa,_0x480d1f,_0xfdd696){return new BPromise(function(_0x3d030b,_0x4e5012){return client['request'](_0x16bafa,_0xfdd696)['then'](function(_0x2bc882){logger[_0x8812('0x9')](_0x8812('0xa'),_0x480d1f,_0x8812('0xb'));logger[_0x8812('0xc')](_0x8812('0xd'),_0x480d1f,_0x8812('0xb'),JSON[_0x8812('0xe')](_0x2bc882));if(_0x2bc882[_0x8812('0xf')]){if(_0x2bc882['error'][_0x8812('0x10')]===0x1f4){logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')][_0x8812('0x11')]);return _0x4e5012(_0x2bc882[_0x8812('0xf')]['message']);}logger[_0x8812('0xf')](_0x8812('0xa'),_0x480d1f,_0x2bc882[_0x8812('0xf')]['message']);return _0x3d030b(_0x2bc882['error'][_0x8812('0x11')]);}else{logger[_0x8812('0x9')]('AnalyticMetric,\x20%s,\x20%s',_0x480d1f,'request\x20sent');_0x3d030b(_0x2bc882['result']['message']);}})['catch'](function(_0xa2a8cc){logger['error'](_0x8812('0xa'),_0x480d1f,_0xa2a8cc);_0x4e5012(_0xa2a8cc);});});} \ No newline at end of file +var _0x8d9b=['rpc','../../config/environment','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var moment=require(_0xb8d9('0x2'));var BPromise=require(_0xb8d9('0x3'));var rs=require(_0xb8d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8d9('0x5'));var logger=require('../../config/logger')(_0xb8d9('0x6'));var config=require(_0xb8d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21c87d,_0x537b18,_0x53339b){return new BPromise(function(_0x4c2b8f,_0x13352e){return client[_0xb8d9('0x8')](_0x21c87d,_0x53339b)[_0xb8d9('0x9')](function(_0x2189b1){logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));logger['debug'](_0xb8d9('0xd'),_0x537b18,'request\x20sent',JSON[_0xb8d9('0xe')](_0x2189b1));if(_0x2189b1[_0xb8d9('0xf')]){if(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x10')]===0x1f4){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x13352e(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);}logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x4c2b8f(_0x2189b1['error'][_0xb8d9('0x11')]);}else{logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));_0x4c2b8f(_0x2189b1[_0xb8d9('0x12')]['message']);}})['catch'](function(_0x5b7d5a){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x5b7d5a);_0x13352e(_0x5b7d5a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index f298ab0..e8ee7c6 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 _0x531a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xd1c39b,_0x16f0c6){var _0x58f5bc=function(_0x412cf3){while(--_0x412cf3){_0xd1c39b['push'](_0xd1c39b['shift']());}};_0x58f5bc(++_0x16f0c6);}(_0x531a,0x100));var _0xa531=function(_0x3a10e3,_0x3cdb35){_0x3a10e3=_0x3a10e3-0x0;var _0xf067c8=_0x531a[_0x3a10e3];return _0xf067c8;};'use strict';var multer=require(_0xa531('0x0'));var util=require(_0xa531('0x1'));var path=require(_0xa531('0x2'));var timeout=require(_0xa531('0x3'));var express=require(_0xa531('0x4'));var router=express[_0xa531('0x5')]();var auth=require(_0xa531('0x6'));var interaction=require(_0xa531('0x7'));var config=require(_0xa531('0x8'));var controller=require(_0xa531('0x9'));router['get']('/',auth[_0xa531('0xa')](),controller['index']);router[_0xa531('0xb')](_0xa531('0xc'),auth[_0xa531('0xa')](),controller[_0xa531('0xd')]);router[_0xa531('0xe')]('/',auth['isAuthenticated'](),controller[_0xa531('0xf')]);router[_0xa531('0x10')]('/:id',auth[_0xa531('0xa')](),controller[_0xa531('0x11')]);router[_0xa531('0x12')](_0xa531('0xc'),auth[_0xa531('0xa')](),controller['destroy']);module[_0xa531('0x13')]=router; \ No newline at end of file +var _0xd26f=['post','create','update','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show'];(function(_0x41f325,_0x4de842){var _0x2f723f=function(_0x4d6d0a){while(--_0x4d6d0a){_0x41f325['push'](_0x41f325['shift']());}};_0x2f723f(++_0x4de842);}(_0xd26f,0x113));var _0xfd26=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xd26f[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0xfd26('0x0'));var util=require(_0xfd26('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfd26('0x2'));var router=express[_0xfd26('0x3')]();var auth=require(_0xfd26('0x4'));var interaction=require(_0xfd26('0x5'));var config=require(_0xfd26('0x6'));var controller=require(_0xfd26('0x7'));router[_0xfd26('0x8')]('/',auth[_0xfd26('0x9')](),controller[_0xfd26('0xa')]);router['get'](_0xfd26('0xb'),auth[_0xfd26('0x9')](),controller[_0xfd26('0xc')]);router[_0xfd26('0xd')]('/',auth[_0xfd26('0x9')](),controller[_0xfd26('0xe')]);router['put'](_0xfd26('0xb'),auth[_0xfd26('0x9')](),controller[_0xfd26('0xf')]);router[_0xfd26('0x10')](_0xfd26('0xb'),auth[_0xfd26('0x9')](),controller['destroy']);module[_0xfd26('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index c84faf6..89ffe0b 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 _0x5a26=['exports','TEXT','sequelize'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x5a26,0x83));var _0x65a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a26[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x65a2('0x0'));module[_0x65a2('0x1')]={'tree':{'type':Sequelize[_0x65a2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xb7e8=['TEXT','exports'];(function(_0x4fe416,_0x5a310a){var _0x252725=function(_0x1d67db){while(--_0x1d67db){_0x4fe416['push'](_0x4fe416['shift']());}};_0x252725(++_0x5a310a);}(_0xb7e8,0x13f));var _0x8b7e=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0xb7e8[_0x31abee];return _0x3c1761;};'use strict';var Sequelize=require('sequelize');module[_0x8b7e('0x0')]={'tree':{'type':Sequelize[_0x8b7e('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 ff5c109..fe74355 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 _0x92a3=['sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','count','catch','show','params','length','includeAll','include','options','find','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','to-csv','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','set','apply','save','update','then','stack','name','send','index','AnalyticTreeReport','rawAttributes','keys','query','intersection','model','fields','attributes','hasOwnProperty','limit','order'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x92a3,0x11b));var _0x392a=function(_0xfa44f8,_0x148d09){_0xfa44f8=_0xfa44f8-0x0;var _0x20eae6=_0x92a3[_0xfa44f8];return _0x20eae6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x392a('0x0'));var rimraf=require(_0x392a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x392a('0x2'));var moment=require(_0x392a('0x3'));var BPromise=require(_0x392a('0x4'));var Mustache=require('mustache');var util=require(_0x392a('0x5'));var path=require(_0x392a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x392a('0x7'));var fs=require('fs');var _=require(_0x392a('0x8'));var squel=require(_0x392a('0x9'));var crypto=require(_0x392a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x392a('0xb'));var querystring=require('querystring');var Papa=require(_0x392a('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x392a('0xd'));var hardwareService=require(_0x392a('0xe'));var logger=require(_0x392a('0xf'))(_0x392a('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x392a('0x11'))['db'];function respondWithStatusCode(_0x40b7d9,_0x53b317){_0x53b317=_0x53b317||0xcc;return function(_0x3ff92f){if(_0x3ff92f){return _0x40b7d9[_0x392a('0x12')](_0x53b317);}return _0x40b7d9[_0x392a('0x13')](_0x53b317)['end']();};}function respondWithResult(_0x5c0b04,_0x404180){_0x404180=_0x404180||0xc8;return function(_0x36b00d){if(_0x36b00d){return _0x5c0b04[_0x392a('0x13')](_0x404180)[_0x392a('0x14')](_0x36b00d);}};}function respondWithFilteredResult(_0x228613,_0x2d9653){return function(_0xec4f8d){if(_0xec4f8d){var _0x320b50=_0xec4f8d['count'],_0x2db0fe=_0x2d9653[_0x392a('0x15')],_0x4b473c=_0x2d9653[_0x392a('0x15')]+_0x2d9653['limit'],_0x599a90;if(_0x4b473c>=_0x320b50){_0x4b473c=_0x320b50;_0x599a90=0xc8;}else{_0x599a90=0xce;}_0x228613[_0x392a('0x13')](_0x599a90);return _0x228613[_0x392a('0x16')]('Content-Range',_0x2db0fe+'-'+_0x4b473c+'/'+_0x320b50)[_0x392a('0x14')](_0xec4f8d);}return null;};}function patchUpdates(_0x17806a){return function(_0x468a04){try{jsonpatch[_0x392a('0x17')](_0x468a04,_0x17806a,!![]);}catch(_0x40991c){return BPromise['reject'](_0x40991c);}return _0x468a04[_0x392a('0x18')]();};}function saveUpdates(_0x1d5b3d,_0x267f82){return function(_0x127ba9){if(_0x127ba9){return _0x127ba9[_0x392a('0x19')](_0x1d5b3d)[_0x392a('0x1a')](function(_0x4998c0){return _0x4998c0;});}return null;};}function removeEntity(_0x2da13e,_0x44521d){return function(_0x1f37fc){if(_0x1f37fc){return _0x1f37fc['destroy']()['then'](function(){_0x2da13e[_0x392a('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cf3fa,_0x565ffc){return function(_0x23a104){if(!_0x23a104){_0x5cf3fa[_0x392a('0x12')](0x194);}return _0x23a104;};}function handleError(_0x5c4c65,_0x1959a5){_0x1959a5=_0x1959a5||0x1f4;return function(_0x1f5aaf){logger['error'](_0x1f5aaf[_0x392a('0x1b')]);if(_0x1f5aaf[_0x392a('0x1c')]){delete _0x1f5aaf['name'];}_0x5c4c65[_0x392a('0x13')](_0x1959a5)[_0x392a('0x1d')](_0x1f5aaf);};}exports[_0x392a('0x1e')]=function(_0x1d0055,_0x1ff74a){var _0x494a93={},_0x30a2ef={},_0x153699={'count':0x0,'rows':[]};var _0x31cc71=db[_0x392a('0x1f')][_0x392a('0x20')];_0x30a2ef['model']=_[_0x392a('0x21')](_0x31cc71);_0x30a2ef[_0x392a('0x22')]=_[_0x392a('0x21')](_0x1d0055[_0x392a('0x22')]);_0x30a2ef['filters']=_[_0x392a('0x23')](_0x30a2ef[_0x392a('0x24')],_0x30a2ef[_0x392a('0x22')]);_0x494a93['attributes']=_[_0x392a('0x23')](_0x30a2ef[_0x392a('0x24')],qs['fields'](_0x1d0055[_0x392a('0x22')][_0x392a('0x25')]));_0x494a93['attributes']=_0x494a93[_0x392a('0x26')]['length']?_0x494a93[_0x392a('0x26')]:_0x30a2ef[_0x392a('0x24')];if(!_0x1d0055[_0x392a('0x22')][_0x392a('0x27')]('nolimit')){_0x494a93['limit']=qs['limit'](_0x1d0055[_0x392a('0x22')][_0x392a('0x28')]);_0x494a93[_0x392a('0x15')]=qs['offset'](_0x1d0055[_0x392a('0x22')][_0x392a('0x15')]);}_0x494a93[_0x392a('0x29')]=qs[_0x392a('0x2a')](_0x1d0055['query'][_0x392a('0x2a')]);_0x494a93[_0x392a('0x2b')]=qs[_0x392a('0x2c')](_[_0x392a('0x2d')](_0x1d0055[_0x392a('0x22')],_0x30a2ef['filters']));if(_0x1d0055['query'][_0x392a('0x2e')]){_0x494a93[_0x392a('0x2b')]=_[_0x392a('0x2f')](_0x494a93['where'],{'$or':_[_0x392a('0x30')](_0x31cc71,function(_0x55eaac){if(_0x55eaac[_0x392a('0x31')][_0x392a('0x32')]!==_0x392a('0x33')){var _0x1c1ca8={};_0x1c1ca8[_0x55eaac[_0x392a('0x34')]]={'$like':'%'+_0x1d0055[_0x392a('0x22')]['filter']+'%'};return _0x1c1ca8;}})});}_0x494a93=_['merge']({},_0x494a93,_0x1d0055['options']);var _0x1a445f={'where':_0x494a93['where']};return db[_0x392a('0x1f')][_0x392a('0x35')](_0x1a445f)['then'](function(_0x1c8b8f){_0x153699[_0x392a('0x35')]=_0x1c8b8f;if(_0x1d0055['query']['includeAll']){_0x494a93['include']=[{'all':!![]}];}return db[_0x392a('0x1f')]['findAll'](_0x494a93);})[_0x392a('0x1a')](function(_0x130fa3){_0x153699['rows']=_0x130fa3;return _0x153699;})[_0x392a('0x1a')](respondWithFilteredResult(_0x1ff74a,_0x494a93))[_0x392a('0x36')](handleError(_0x1ff74a,null));};exports[_0x392a('0x37')]=function(_0x4780d0,_0x371d5f){var _0x1b3e13={'raw':!![],'where':{'id':_0x4780d0[_0x392a('0x38')]['id']}},_0x15454f={};_0x15454f[_0x392a('0x24')]=_[_0x392a('0x21')](db[_0x392a('0x1f')][_0x392a('0x20')]);_0x15454f[_0x392a('0x22')]=_[_0x392a('0x21')](_0x4780d0[_0x392a('0x22')]);_0x15454f[_0x392a('0x2c')]=_[_0x392a('0x23')](_0x15454f[_0x392a('0x24')],_0x15454f[_0x392a('0x22')]);_0x1b3e13['attributes']=_['intersection'](_0x15454f[_0x392a('0x24')],qs[_0x392a('0x25')](_0x4780d0[_0x392a('0x22')][_0x392a('0x25')]));_0x1b3e13[_0x392a('0x26')]=_0x1b3e13['attributes'][_0x392a('0x39')]?_0x1b3e13['attributes']:_0x15454f[_0x392a('0x24')];if(_0x4780d0[_0x392a('0x22')][_0x392a('0x3a')]){_0x1b3e13[_0x392a('0x3b')]=[{'all':!![]}];}_0x1b3e13=_[_0x392a('0x2f')]({},_0x1b3e13,_0x4780d0[_0x392a('0x3c')]);return db['AnalyticTreeReport'][_0x392a('0x3d')](_0x1b3e13)['then'](handleEntityNotFound(_0x371d5f,null))[_0x392a('0x1a')](respondWithResult(_0x371d5f,null))[_0x392a('0x36')](handleError(_0x371d5f,null));};exports[_0x392a('0x3e')]=function(_0x52f0d0,_0x202cf7){return db[_0x392a('0x1f')][_0x392a('0x3e')](_0x52f0d0['body'],{})[_0x392a('0x1a')](respondWithResult(_0x202cf7,0xc9))[_0x392a('0x36')](handleError(_0x202cf7,null));};exports[_0x392a('0x19')]=function(_0x35ec36,_0x1dffe9){if(_0x35ec36[_0x392a('0x3f')]['id']){delete _0x35ec36[_0x392a('0x3f')]['id'];}return db[_0x392a('0x1f')][_0x392a('0x3d')]({'where':{'id':_0x35ec36['params']['id']}})[_0x392a('0x1a')](handleEntityNotFound(_0x1dffe9,null))['then'](saveUpdates(_0x35ec36[_0x392a('0x3f')],null))[_0x392a('0x1a')](respondWithResult(_0x1dffe9,null))[_0x392a('0x36')](handleError(_0x1dffe9,null));};exports[_0x392a('0x40')]=function(_0x1f60ba,_0x1e3c31){return db[_0x392a('0x1f')][_0x392a('0x3d')]({'where':{'id':_0x1f60ba['params']['id']}})[_0x392a('0x1a')](handleEntityNotFound(_0x1e3c31,null))[_0x392a('0x1a')](removeEntity(_0x1e3c31,null))[_0x392a('0x36')](handleError(_0x1e3c31,null));}; \ No newline at end of file +var _0x8a11=['api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','AnalyticTreeReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x41aded,_0x21efc2){var _0x938a2e=function(_0x9c97a4){while(--_0x9c97a4){_0x41aded['push'](_0x41aded['shift']());}};_0x938a2e(++_0x21efc2);}(_0x8a11,0xc2));var _0x18a1=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x8a11[_0x49ca18];return _0x145d54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x18a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18a1('0x1'));var jsonpatch=require(_0x18a1('0x2'));var rp=require(_0x18a1('0x3'));var moment=require(_0x18a1('0x4'));var BPromise=require(_0x18a1('0x5'));var Mustache=require(_0x18a1('0x6'));var util=require('util');var path=require(_0x18a1('0x7'));var sox=require(_0x18a1('0x8'));var csv=require(_0x18a1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x18a1('0xa'));var crypto=require(_0x18a1('0xb'));var jsforce=require(_0x18a1('0xc'));var deskjs=require(_0x18a1('0xd'));var toCsv=require(_0x18a1('0x9'));var querystring=require('querystring');var Papa=require(_0x18a1('0xe'));var Redis=require('ioredis');var authService=require(_0x18a1('0xf'));var qs=require(_0x18a1('0x10'));var hardwareService=require(_0x18a1('0x11'));var logger=require(_0x18a1('0x12'))(_0x18a1('0x13'));var utils=require(_0x18a1('0x14'));var config=require(_0x18a1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12d2ae,_0x11b25b){_0x11b25b=_0x11b25b||0xcc;return function(_0x332691){if(_0x332691){return _0x12d2ae[_0x18a1('0x16')](_0x11b25b);}return _0x12d2ae[_0x18a1('0x17')](_0x11b25b)[_0x18a1('0x18')]();};}function respondWithResult(_0x2d97c2,_0x47a7ae){_0x47a7ae=_0x47a7ae||0xc8;return function(_0x2323a7){if(_0x2323a7){return _0x2d97c2['status'](_0x47a7ae)[_0x18a1('0x19')](_0x2323a7);}};}function respondWithFilteredResult(_0x5a2efe,_0x5c012d){return function(_0x51795f){if(_0x51795f){var _0xac991e=_0x51795f['count'],_0x1b8b2b=_0x5c012d[_0x18a1('0x1a')],_0x4d8a6f=_0x5c012d[_0x18a1('0x1a')]+_0x5c012d[_0x18a1('0x1b')],_0x27c6e1;if(_0x4d8a6f>=_0xac991e){_0x4d8a6f=_0xac991e;_0x27c6e1=0xc8;}else{_0x27c6e1=0xce;}_0x5a2efe[_0x18a1('0x17')](_0x27c6e1);return _0x5a2efe[_0x18a1('0x1c')]('Content-Range',_0x1b8b2b+'-'+_0x4d8a6f+'/'+_0xac991e)[_0x18a1('0x19')](_0x51795f);}return null;};}function patchUpdates(_0x3fc3a6){return function(_0xa18a08){try{jsonpatch[_0x18a1('0x1d')](_0xa18a08,_0x3fc3a6,!![]);}catch(_0x2e6302){return BPromise[_0x18a1('0x1e')](_0x2e6302);}return _0xa18a08[_0x18a1('0x1f')]();};}function saveUpdates(_0x342ca3,_0x2eddf7){return function(_0x525ab0){if(_0x525ab0){return _0x525ab0[_0x18a1('0x20')](_0x342ca3)[_0x18a1('0x21')](function(_0x47554c){return _0x47554c;});}return null;};}function removeEntity(_0x573156,_0x29c74c){return function(_0x37f75d){if(_0x37f75d){return _0x37f75d['destroy']()[_0x18a1('0x21')](function(){_0x573156[_0x18a1('0x17')](0xcc)[_0x18a1('0x18')]();});}};}function handleEntityNotFound(_0x34cf86,_0xd69d29){return function(_0x242106){if(!_0x242106){_0x34cf86['sendStatus'](0x194);}return _0x242106;};}function handleError(_0x4ac34d,_0x56e42f){_0x56e42f=_0x56e42f||0x1f4;return function(_0x57e1cd){logger[_0x18a1('0x22')](_0x57e1cd[_0x18a1('0x23')]);if(_0x57e1cd[_0x18a1('0x24')]){delete _0x57e1cd[_0x18a1('0x24')];}_0x4ac34d[_0x18a1('0x17')](_0x56e42f)[_0x18a1('0x25')](_0x57e1cd);};}exports[_0x18a1('0x26')]=function(_0x4f0838,_0x121b64){var _0x55329e={},_0x4f9cec={},_0x168b8c={'count':0x0,'rows':[]};var _0x42c62b=db[_0x18a1('0x27')][_0x18a1('0x28')];_0x4f9cec[_0x18a1('0x29')]=_[_0x18a1('0x2a')](_0x42c62b);_0x4f9cec['query']=_[_0x18a1('0x2a')](_0x4f0838[_0x18a1('0x2b')]);_0x4f9cec[_0x18a1('0x2c')]=_[_0x18a1('0x2d')](_0x4f9cec[_0x18a1('0x29')],_0x4f9cec[_0x18a1('0x2b')]);_0x55329e[_0x18a1('0x2e')]=_[_0x18a1('0x2d')](_0x4f9cec['model'],qs['fields'](_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x2f')]));_0x55329e['attributes']=_0x55329e[_0x18a1('0x2e')][_0x18a1('0x30')]?_0x55329e[_0x18a1('0x2e')]:_0x4f9cec[_0x18a1('0x29')];if(!_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x31')]('nolimit')){_0x55329e['limit']=qs[_0x18a1('0x1b')](_0x4f0838[_0x18a1('0x2b')]['limit']);_0x55329e[_0x18a1('0x1a')]=qs[_0x18a1('0x1a')](_0x4f0838['query'][_0x18a1('0x1a')]);}_0x55329e['order']=qs[_0x18a1('0x32')](_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x32')]);_0x55329e[_0x18a1('0x33')]=qs[_0x18a1('0x2c')](_[_0x18a1('0x34')](_0x4f0838[_0x18a1('0x2b')],_0x4f9cec[_0x18a1('0x2c')]));if(_0x4f0838['query'][_0x18a1('0x35')]){_0x55329e[_0x18a1('0x33')]=_[_0x18a1('0x36')](_0x55329e[_0x18a1('0x33')],{'$or':_['map'](_0x42c62b,function(_0x382b61){if(_0x382b61[_0x18a1('0x37')][_0x18a1('0x38')]!=='VIRTUAL'){var _0xde7c46={};_0xde7c46[_0x382b61[_0x18a1('0x39')]]={'$like':'%'+_0x4f0838[_0x18a1('0x2b')][_0x18a1('0x35')]+'%'};return _0xde7c46;}})});}_0x55329e=_['merge']({},_0x55329e,_0x4f0838[_0x18a1('0x3a')]);var _0xff63e2={'where':_0x55329e['where']};return db['AnalyticTreeReport'][_0x18a1('0x3b')](_0xff63e2)[_0x18a1('0x21')](function(_0x5dd659){_0x168b8c[_0x18a1('0x3b')]=_0x5dd659;if(_0x4f0838['query'][_0x18a1('0x3c')]){_0x55329e[_0x18a1('0x3d')]=[{'all':!![]}];}return db[_0x18a1('0x27')][_0x18a1('0x3e')](_0x55329e);})[_0x18a1('0x21')](function(_0x50ac0b){_0x168b8c[_0x18a1('0x3f')]=_0x50ac0b;return _0x168b8c;})['then'](respondWithFilteredResult(_0x121b64,_0x55329e))[_0x18a1('0x40')](handleError(_0x121b64,null));};exports[_0x18a1('0x41')]=function(_0x1b3938,_0x2b628c){var _0x2648fb={'raw':!![],'where':{'id':_0x1b3938[_0x18a1('0x42')]['id']}},_0x2158a5={};_0x2158a5[_0x18a1('0x29')]=_[_0x18a1('0x2a')](db[_0x18a1('0x27')][_0x18a1('0x28')]);_0x2158a5['query']=_['keys'](_0x1b3938[_0x18a1('0x2b')]);_0x2158a5[_0x18a1('0x2c')]=_[_0x18a1('0x2d')](_0x2158a5[_0x18a1('0x29')],_0x2158a5[_0x18a1('0x2b')]);_0x2648fb['attributes']=_[_0x18a1('0x2d')](_0x2158a5[_0x18a1('0x29')],qs[_0x18a1('0x2f')](_0x1b3938[_0x18a1('0x2b')][_0x18a1('0x2f')]));_0x2648fb['attributes']=_0x2648fb[_0x18a1('0x2e')][_0x18a1('0x30')]?_0x2648fb[_0x18a1('0x2e')]:_0x2158a5[_0x18a1('0x29')];if(_0x1b3938[_0x18a1('0x2b')][_0x18a1('0x3c')]){_0x2648fb['include']=[{'all':!![]}];}_0x2648fb=_[_0x18a1('0x36')]({},_0x2648fb,_0x1b3938[_0x18a1('0x3a')]);return db[_0x18a1('0x27')][_0x18a1('0x43')](_0x2648fb)['then'](handleEntityNotFound(_0x2b628c,null))[_0x18a1('0x21')](respondWithResult(_0x2b628c,null))[_0x18a1('0x40')](handleError(_0x2b628c,null));};exports[_0x18a1('0x44')]=function(_0x9e273a,_0x286483){return db[_0x18a1('0x27')][_0x18a1('0x44')](_0x9e273a[_0x18a1('0x45')],{})[_0x18a1('0x21')](respondWithResult(_0x286483,0xc9))[_0x18a1('0x40')](handleError(_0x286483,null));};exports[_0x18a1('0x20')]=function(_0x3539e0,_0x55db3a){if(_0x3539e0[_0x18a1('0x45')]['id']){delete _0x3539e0['body']['id'];}return db[_0x18a1('0x27')][_0x18a1('0x43')]({'where':{'id':_0x3539e0[_0x18a1('0x42')]['id']}})['then'](handleEntityNotFound(_0x55db3a,null))[_0x18a1('0x21')](saveUpdates(_0x3539e0['body'],null))[_0x18a1('0x21')](respondWithResult(_0x55db3a,null))[_0x18a1('0x40')](handleError(_0x55db3a,null));};exports[_0x18a1('0x46')]=function(_0x27f93e,_0x570cd1){return db[_0x18a1('0x27')][_0x18a1('0x43')]({'where':{'id':_0x27f93e['params']['id']}})[_0x18a1('0x21')](handleEntityNotFound(_0x570cd1,null))[_0x18a1('0x21')](removeEntity(_0x570cd1,null))[_0x18a1('0x40')](handleError(_0x570cd1,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 730c86f..0773e07 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 _0xb3ea=['define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','moment','bluebird','path','rimraf','./analyticTreeReport.attributes','exports'];(function(_0x292e1f,_0x5cd287){var _0x136219=function(_0x9a8114){while(--_0x9a8114){_0x292e1f['push'](_0x292e1f['shift']());}};_0x136219(++_0x5cd287);}(_0xb3ea,0xc9));var _0xab3e=function(_0x48a116,_0x923bf){_0x48a116=_0x48a116-0x0;var _0x16a4ed=_0xb3ea[_0x48a116];return _0x16a4ed;};'use strict';var _=require(_0xab3e('0x0'));var util=require('util');var logger=require(_0xab3e('0x1'))('api');var moment=require(_0xab3e('0x2'));var BPromise=require(_0xab3e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab3e('0x4'));var rimraf=require(_0xab3e('0x5'));var config=require('../../config/environment');var attributes=require(_0xab3e('0x6'));module[_0xab3e('0x7')]=function(_0x3bba48,_0x5e4f8b){return _0x3bba48[_0xab3e('0x8')](_0xab3e('0x9'),attributes,{'tableName':_0xab3e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6392=['bluebird','../../config/environment','./analyticTreeReport.attributes','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment'];(function(_0x293274,_0x1f9041){var _0x21730e=function(_0x56fc27){while(--_0x56fc27){_0x293274['push'](_0x293274['shift']());}};_0x21730e(++_0x1f9041);}(_0x6392,0x7a));var _0x2639=function(_0x2e84f6,_0x5354c8){_0x2e84f6=_0x2e84f6-0x0;var _0x59d210=_0x6392[_0x2e84f6];return _0x59d210;};'use strict';var _=require(_0x2639('0x0'));var util=require('util');var logger=require(_0x2639('0x1'))(_0x2639('0x2'));var moment=require(_0x2639('0x3'));var BPromise=require(_0x2639('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2639('0x5'));var attributes=require(_0x2639('0x6'));module['exports']=function(_0x2116f3,_0x513de8){return _0x2116f3['define'](_0x2639('0x7'),attributes,{'tableName':_0x2639('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 0ceb6e7..46e6dfc 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 _0x6a72=['jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2a9e18,_0x11abb7){var _0x3574ed=function(_0x20cf72){while(--_0x20cf72){_0x2a9e18['push'](_0x2a9e18['shift']());}};_0x3574ed(++_0x11abb7);}(_0x6a72,0x16d));var _0x26a7=function(_0x1d9d4f,_0x504219){_0x1d9d4f=_0x1d9d4f-0x0;var _0x3577cf=_0x6a72[_0x1d9d4f];return _0x3577cf;};'use strict';var _=require(_0x26a7('0x0'));var util=require(_0x26a7('0x1'));var moment=require(_0x26a7('0x2'));var BPromise=require(_0x26a7('0x3'));var rs=require(_0x26a7('0x4'));var fs=require('fs');var Redis=require(_0x26a7('0x5'));var db=require(_0x26a7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x26a7('0x7'))(_0x26a7('0x8'));var config=require(_0x26a7('0x9'));var jayson=require(_0x26a7('0xa'));var client=jayson[_0x26a7('0xb')][_0x26a7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1330b0,_0x37a05a,_0x403c0f){return new BPromise(function(_0xf815cd,_0xcbee41){return client[_0x26a7('0xd')](_0x1330b0,_0x403c0f)[_0x26a7('0xe')](function(_0x4d5a66){logger[_0x26a7('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x37a05a,_0x26a7('0x10'));logger[_0x26a7('0x11')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x37a05a,_0x26a7('0x10'),JSON[_0x26a7('0x12')](_0x4d5a66));if(_0x4d5a66[_0x26a7('0x13')]){if(_0x4d5a66['error'][_0x26a7('0x14')]===0x1f4){logger[_0x26a7('0x13')](_0x26a7('0x15'),_0x37a05a,_0x4d5a66['error']['message']);return _0xcbee41(_0x4d5a66[_0x26a7('0x13')][_0x26a7('0x16')]);}logger[_0x26a7('0x13')](_0x26a7('0x15'),_0x37a05a,_0x4d5a66[_0x26a7('0x13')][_0x26a7('0x16')]);return _0xf815cd(_0x4d5a66[_0x26a7('0x13')]['message']);}else{logger[_0x26a7('0xf')]('AnalyticTreeReport,\x20%s,\x20%s',_0x37a05a,_0x26a7('0x10'));_0xf815cd(_0x4d5a66[_0x26a7('0x17')][_0x26a7('0x16')]);}})[_0x26a7('0x18')](function(_0x56ae92){logger['error'](_0x26a7('0x15'),_0x37a05a,_0x56ae92);_0xcbee41(_0x56ae92);});});} \ No newline at end of file +var _0xb284=['jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','util','bluebird','../../mysqldb','../../config/logger','rpc'];(function(_0x378a1c,_0x1bfad4){var _0xe2c06b=function(_0x367b64){while(--_0x367b64){_0x378a1c['push'](_0x378a1c['shift']());}};_0xe2c06b(++_0x1bfad4);}(_0xb284,0x12d));var _0x4b28=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb284[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4b28('0x0'));var moment=require('moment');var BPromise=require(_0x4b28('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b28('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b28('0x3'))(_0x4b28('0x4'));var config=require('../../config/environment');var jayson=require(_0x4b28('0x5'));var client=jayson[_0x4b28('0x6')][_0x4b28('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3a13ee,_0x4ba5e9,_0x445a1c){return new BPromise(function(_0x39c4c1,_0x550b7d){return client[_0x4b28('0x8')](_0x3a13ee,_0x445a1c)[_0x4b28('0x9')](function(_0x1ee4b7){logger[_0x4b28('0xa')](_0x4b28('0xb'),_0x4ba5e9,_0x4b28('0xc'));logger[_0x4b28('0xd')](_0x4b28('0xe'),_0x4ba5e9,'request\x20sent',JSON['stringify'](_0x1ee4b7));if(_0x1ee4b7['error']){if(_0x1ee4b7[_0x4b28('0xf')][_0x4b28('0x10')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4ba5e9,_0x1ee4b7['error'][_0x4b28('0x11')]);return _0x550b7d(_0x1ee4b7[_0x4b28('0xf')][_0x4b28('0x11')]);}logger['error'](_0x4b28('0xb'),_0x4ba5e9,_0x1ee4b7[_0x4b28('0xf')][_0x4b28('0x11')]);return _0x39c4c1(_0x1ee4b7['error'][_0x4b28('0x11')]);}else{logger['info'](_0x4b28('0xb'),_0x4ba5e9,'request\x20sent');_0x39c4c1(_0x1ee4b7['result'][_0x4b28('0x11')]);}})['catch'](function(_0xd1a24f){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4ba5e9,_0xd1a24f);_0x550b7d(_0xd1a24f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index d115770..d2620b2 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 _0x0531=['/:id','isAuthenticated','create','put','update','delete','destroy','multer','util','path','../../config/environment','./analyticTreeReport.controller','get','index'];(function(_0x30bc85,_0x3d648c){var _0x3df047=function(_0x167bd3){while(--_0x167bd3){_0x30bc85['push'](_0x30bc85['shift']());}};_0x3df047(++_0x3d648c);}(_0x0531,0xa1));var _0x1053=function(_0x4b4b0e,_0x6c674){_0x4b4b0e=_0x4b4b0e-0x0;var _0x4c2d91=_0x0531[_0x4b4b0e];return _0x4c2d91;};'use strict';var multer=require(_0x1053('0x0'));var util=require(_0x1053('0x1'));var path=require(_0x1053('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1053('0x3'));var controller=require(_0x1053('0x4'));router[_0x1053('0x5')]('/',auth['isAuthenticated'](),controller[_0x1053('0x6')]);router['get'](_0x1053('0x7'),auth[_0x1053('0x8')](),controller['show']);router['post']('/',auth[_0x1053('0x8')](),controller[_0x1053('0x9')]);router[_0x1053('0xa')](_0x1053('0x7'),auth[_0x1053('0x8')](),controller[_0x1053('0xb')]);router[_0x1053('0xc')](_0x1053('0x7'),auth[_0x1053('0x8')](),controller[_0x1053('0xd')]);module['exports']=router; \ No newline at end of file +var _0x23f4=['isAuthenticated','index','/:id','show','post','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get'];(function(_0x31fa5c,_0x1c5c11){var _0x3fb703=function(_0x35fc53){while(--_0x35fc53){_0x31fa5c['push'](_0x31fa5c['shift']());}};_0x3fb703(++_0x1c5c11);}(_0x23f4,0x107));var _0x423f=function(_0x1f34a0,_0x43f28d){_0x1f34a0=_0x1f34a0-0x0;var _0x50f307=_0x23f4[_0x1f34a0];return _0x50f307;};'use strict';var multer=require(_0x423f('0x0'));var util=require(_0x423f('0x1'));var path=require(_0x423f('0x2'));var timeout=require('connect-timeout');var express=require(_0x423f('0x3'));var router=express[_0x423f('0x4')]();var auth=require(_0x423f('0x5'));var interaction=require(_0x423f('0x6'));var config=require('../../config/environment');var controller=require(_0x423f('0x7'));router[_0x423f('0x8')]('/',auth[_0x423f('0x9')](),controller[_0x423f('0xa')]);router[_0x423f('0x8')](_0x423f('0xb'),auth[_0x423f('0x9')](),controller[_0x423f('0xc')]);router[_0x423f('0xd')]('/',auth[_0x423f('0x9')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x423f('0xe')]);router[_0x423f('0xf')](_0x423f('0xb'),auth[_0x423f('0x9')](),controller[_0x423f('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 5e209c5..160d4e6 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 _0x19f8=['sequelize','STRING'];(function(_0x4136ee,_0x26913d){var _0x3ef0d0=function(_0x8b4202){while(--_0x8b4202){_0x4136ee['push'](_0x4136ee['shift']());}};_0x3ef0d0(++_0x26913d);}(_0x19f8,0x15e));var _0x819f=function(_0x54dcad,_0x554f46){_0x54dcad=_0x54dcad-0x0;var _0x537c56=_0x19f8[_0x54dcad];return _0x537c56;};'use strict';var Sequelize=require(_0x819f('0x0'));module['exports']={'name':{'type':Sequelize[_0x819f('0x1')]},'basename':{'type':Sequelize[_0x819f('0x1')]},'type':{'type':Sequelize[_0x819f('0x1')]}}; \ No newline at end of file +var _0x8319=['sequelize','exports','STRING'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x8319,0x1ec));var _0x9831=function(_0x5d0a52,_0xa71579){_0x5d0a52=_0x5d0a52-0x0;var _0x35c72f=_0x8319[_0x5d0a52];return _0x35c72f;};'use strict';var Sequelize=require(_0x9831('0x0'));module[_0x9831('0x1')]={'name':{'type':Sequelize[_0x9831('0x2')]},'basename':{'type':Sequelize[_0x9831('0x2')]},'type':{'type':Sequelize[_0x9831('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index d19df95..4bcf6bd 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 _0x800a=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','send','index','Attachment','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','include','findAll','rows','show','params','options','find','catch','body','create','name','file','basename','filename','findOne','download','join','server/files/attachments/','html-pdf'];(function(_0x3f59e7,_0x3ac9df){var _0x26e855=function(_0x4b347b){while(--_0x4b347b){_0x3f59e7['push'](_0x3f59e7['shift']());}};_0x26e855(++_0x3ac9df);}(_0x800a,0x1e5));var _0xa800=function(_0x219377,_0x42bc1e){_0x219377=_0x219377-0x0;var _0x2bc2c8=_0x800a[_0x219377];return _0x2bc2c8;};'use strict';var pdf=require(_0xa800('0x0'));var emlformat=require(_0xa800('0x1'));var rimraf=require(_0xa800('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa800('0x3'));var rp=require(_0xa800('0x4'));var moment=require(_0xa800('0x5'));var BPromise=require(_0xa800('0x6'));var Mustache=require('mustache');var util=require(_0xa800('0x7'));var path=require(_0xa800('0x8'));var sox=require('sox');var csv=require(_0xa800('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa800('0xa'));var crypto=require('crypto');var jsforce=require(_0xa800('0xb'));var deskjs=require(_0xa800('0xc'));var toCsv=require(_0xa800('0x9'));var querystring=require(_0xa800('0xd'));var Papa=require(_0xa800('0xe'));var Redis=require(_0xa800('0xf'));var authService=require(_0xa800('0x10'));var qs=require(_0xa800('0x11'));var hardwareService=require(_0xa800('0x12'));var logger=require(_0xa800('0x13'))(_0xa800('0x14'));var utils=require(_0xa800('0x15'));var config=require('../../config/environment');var db=require(_0xa800('0x16'))['db'];function respondWithStatusCode(_0x6f9bae,_0x427543){_0x427543=_0x427543||0xcc;return function(_0x1cb230){if(_0x1cb230){return _0x6f9bae[_0xa800('0x17')](_0x427543);}return _0x6f9bae['status'](_0x427543)[_0xa800('0x18')]();};}function respondWithResult(_0x5a4624,_0x2ebab2){_0x2ebab2=_0x2ebab2||0xc8;return function(_0x26c08d){if(_0x26c08d){return _0x5a4624[_0xa800('0x19')](_0x2ebab2)[_0xa800('0x1a')](_0x26c08d);}};}function respondWithFilteredResult(_0x5e171d,_0x388732){return function(_0x27fc8d){if(_0x27fc8d){var _0x52662c=_0x27fc8d['count'],_0x439944=_0x388732[_0xa800('0x1b')],_0x4a58ea=_0x388732[_0xa800('0x1b')]+_0x388732[_0xa800('0x1c')],_0x36b905;if(_0x4a58ea>=_0x52662c){_0x4a58ea=_0x52662c;_0x36b905=0xc8;}else{_0x36b905=0xce;}_0x5e171d[_0xa800('0x19')](_0x36b905);return _0x5e171d[_0xa800('0x1d')](_0xa800('0x1e'),_0x439944+'-'+_0x4a58ea+'/'+_0x52662c)['json'](_0x27fc8d);}return null;};}function patchUpdates(_0x500e0c){return function(_0x3550d3){try{jsonpatch['apply'](_0x3550d3,_0x500e0c,!![]);}catch(_0x1c75b5){return BPromise['reject'](_0x1c75b5);}return _0x3550d3[_0xa800('0x1f')]();};}function saveUpdates(_0xefcac2,_0x40f49a){return function(_0x51c010){if(_0x51c010){return _0x51c010[_0xa800('0x20')](_0xefcac2)[_0xa800('0x21')](function(_0x5e9d58){return _0x5e9d58;});}return null;};}function removeEntity(_0x56e152,_0x432005){return function(_0xa10be2){if(_0xa10be2){return _0xa10be2[_0xa800('0x22')]()[_0xa800('0x21')](function(){_0x56e152[_0xa800('0x19')](0xcc)[_0xa800('0x18')]();});}};}function handleEntityNotFound(_0x33e388,_0x31f7c4){return function(_0x23cfe6){if(!_0x23cfe6){_0x33e388['sendStatus'](0x194);}return _0x23cfe6;};}function handleError(_0x20062f,_0x15e9c8){_0x15e9c8=_0x15e9c8||0x1f4;return function(_0x40ecfd){logger[_0xa800('0x23')](_0x40ecfd[_0xa800('0x24')]);if(_0x40ecfd['name']){delete _0x40ecfd['name'];}_0x20062f[_0xa800('0x19')](_0x15e9c8)[_0xa800('0x25')](_0x40ecfd);};}exports[_0xa800('0x26')]=function(_0x2da1f2,_0x4e078b){var _0xd87b46={},_0x55de73={},_0x5a98f0={'count':0x0,'rows':[]};var _0x25fd58=db[_0xa800('0x27')][_0xa800('0x28')];_0x55de73[_0xa800('0x29')]=_[_0xa800('0x2a')](_0x25fd58);_0x55de73['query']=_[_0xa800('0x2a')](_0x2da1f2[_0xa800('0x2b')]);_0x55de73[_0xa800('0x2c')]=_[_0xa800('0x2d')](_0x55de73[_0xa800('0x29')],_0x55de73[_0xa800('0x2b')]);_0xd87b46['attributes']=_['intersection'](_0x55de73[_0xa800('0x29')],qs[_0xa800('0x2e')](_0x2da1f2[_0xa800('0x2b')][_0xa800('0x2e')]));_0xd87b46['attributes']=_0xd87b46[_0xa800('0x2f')][_0xa800('0x30')]?_0xd87b46[_0xa800('0x2f')]:_0x55de73['model'];if(!_0x2da1f2[_0xa800('0x2b')][_0xa800('0x31')](_0xa800('0x32'))){_0xd87b46[_0xa800('0x1c')]=qs['limit'](_0x2da1f2[_0xa800('0x2b')][_0xa800('0x1c')]);_0xd87b46[_0xa800('0x1b')]=qs['offset'](_0x2da1f2[_0xa800('0x2b')][_0xa800('0x1b')]);}_0xd87b46[_0xa800('0x33')]=qs[_0xa800('0x34')](_0x2da1f2[_0xa800('0x2b')][_0xa800('0x34')]);_0xd87b46[_0xa800('0x35')]=qs[_0xa800('0x2c')](_['pick'](_0x2da1f2[_0xa800('0x2b')],_0x55de73['filters']));if(_0x2da1f2['query'][_0xa800('0x36')]){_0xd87b46['where']=_[_0xa800('0x37')](_0xd87b46[_0xa800('0x35')],{'$or':_[_0xa800('0x38')](_0x25fd58,function(_0x385c3a){if(_0x385c3a[_0xa800('0x39')][_0xa800('0x3a')]!==_0xa800('0x3b')){var _0x459c40={};_0x459c40[_0x385c3a[_0xa800('0x3c')]]={'$like':'%'+_0x2da1f2[_0xa800('0x2b')][_0xa800('0x36')]+'%'};return _0x459c40;}})});}_0xd87b46=_['merge']({},_0xd87b46,_0x2da1f2['options']);var _0x49856a={'where':_0xd87b46[_0xa800('0x35')]};return db[_0xa800('0x27')][_0xa800('0x3d')](_0x49856a)[_0xa800('0x21')](function(_0x1014ee){_0x5a98f0[_0xa800('0x3d')]=_0x1014ee;if(_0x2da1f2[_0xa800('0x2b')][_0xa800('0x3e')]){_0xd87b46[_0xa800('0x3f')]=[{'all':!![]}];}return db['Attachment'][_0xa800('0x40')](_0xd87b46);})[_0xa800('0x21')](function(_0x68f9ac){_0x5a98f0[_0xa800('0x41')]=_0x68f9ac;return _0x5a98f0;})[_0xa800('0x21')](respondWithFilteredResult(_0x4e078b,_0xd87b46))['catch'](handleError(_0x4e078b,null));};exports[_0xa800('0x42')]=function(_0x869e7d,_0x28e039){var _0x30c897={'raw':!![],'where':{'id':_0x869e7d[_0xa800('0x43')]['id']}},_0x289c6c={};_0x289c6c[_0xa800('0x29')]=_[_0xa800('0x2a')](db[_0xa800('0x27')]['rawAttributes']);_0x289c6c['query']=_[_0xa800('0x2a')](_0x869e7d[_0xa800('0x2b')]);_0x289c6c[_0xa800('0x2c')]=_['intersection'](_0x289c6c[_0xa800('0x29')],_0x289c6c[_0xa800('0x2b')]);_0x30c897[_0xa800('0x2f')]=_[_0xa800('0x2d')](_0x289c6c[_0xa800('0x29')],qs[_0xa800('0x2e')](_0x869e7d['query'][_0xa800('0x2e')]));_0x30c897[_0xa800('0x2f')]=_0x30c897[_0xa800('0x2f')][_0xa800('0x30')]?_0x30c897[_0xa800('0x2f')]:_0x289c6c['model'];if(_0x869e7d['query']['includeAll']){_0x30c897[_0xa800('0x3f')]=[{'all':!![]}];}_0x30c897=_[_0xa800('0x37')]({},_0x30c897,_0x869e7d[_0xa800('0x44')]);return db[_0xa800('0x27')][_0xa800('0x45')](_0x30c897)['then'](handleEntityNotFound(_0x28e039,null))[_0xa800('0x21')](respondWithResult(_0x28e039,null))[_0xa800('0x46')](handleError(_0x28e039,null));};exports[_0xa800('0x20')]=function(_0x408c00,_0x532e8b){if(_0x408c00['body']['id']){delete _0x408c00[_0xa800('0x47')]['id'];}return db[_0xa800('0x27')][_0xa800('0x45')]({'where':{'id':_0x408c00[_0xa800('0x43')]['id']}})[_0xa800('0x21')](handleEntityNotFound(_0x532e8b,null))[_0xa800('0x21')](saveUpdates(_0x408c00['body'],null))[_0xa800('0x21')](respondWithResult(_0x532e8b,null))[_0xa800('0x46')](handleError(_0x532e8b,null));};exports['destroy']=function(_0x1efa61,_0x14e548){return db[_0xa800('0x27')]['find']({'where':{'id':_0x1efa61[_0xa800('0x43')]['id']}})[_0xa800('0x21')](handleEntityNotFound(_0x14e548,null))['then'](removeEntity(_0x14e548,null))['catch'](handleError(_0x14e548,null));};exports[_0xa800('0x48')]=function(_0x2ee4bf,_0x3bfcc1,_0x20455a){_0x2ee4bf[_0xa800('0x47')][_0xa800('0x49')]=_0x2ee4bf[_0xa800('0x4a')]['originalname'];_0x2ee4bf[_0xa800('0x47')][_0xa800('0x4b')]=_0x2ee4bf[_0xa800('0x4a')][_0xa800('0x4c')];_0x2ee4bf[_0xa800('0x47')][_0xa800('0x39')]=_0x2ee4bf['file']['mimetype'];return db[_0xa800('0x27')][_0xa800('0x48')](_0x2ee4bf[_0xa800('0x47')])[_0xa800('0x21')](respondWithResult(_0x3bfcc1,0xc9))[_0xa800('0x46')](handleError(_0x3bfcc1,null));};exports['download']=function(_0x24d737,_0xda05d9,_0x533172){return db['Attachment'][_0xa800('0x4d')]({'where':{'id':_0x24d737[_0xa800('0x43')]['id']},'raw':!![]})[_0xa800('0x21')](handleEntityNotFound(_0xda05d9,null))[_0xa800('0x21')](function(_0x5c0a82){if(_0x5c0a82){return _0xda05d9[_0xa800('0x4e')](path[_0xa800('0x4f')](config['root'],_0xa800('0x50'),_0x5c0a82[_0xa800('0x4b')]));}})[_0xa800('0x46')](handleError(_0xda05d9,null));}; \ No newline at end of file +var _0x3678=['destroy','error','stack','name','send','index','Attachment','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','VIRTUAL','field','filter','count','include','then','rows','catch','body','find','params','create','originalname','file','filename','mimetype','download','findOne','join','root','server/files/attachments/','basename','html-pdf','fast-json-patch','request-promise','bluebird','mustache','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','apply','save','update'];(function(_0x31ba0f,_0x521571){var _0xe991a0=function(_0x4cb146){while(--_0x4cb146){_0x31ba0f['push'](_0x31ba0f['shift']());}};_0xe991a0(++_0x521571);}(_0x3678,0x78));var _0x8367=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0x3678[_0x2920dd];return _0x5d4e52;};'use strict';var pdf=require(_0x8367('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8367('0x1'));var rp=require(_0x8367('0x2'));var moment=require('moment');var BPromise=require(_0x8367('0x3'));var Mustache=require(_0x8367('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8367('0x5'));var fs=require('fs');var _=require(_0x8367('0x6'));var squel=require(_0x8367('0x7'));var crypto=require('crypto');var jsforce=require(_0x8367('0x8'));var deskjs=require(_0x8367('0x9'));var toCsv=require(_0x8367('0xa'));var querystring=require(_0x8367('0xb'));var Papa=require('papaparse');var Redis=require(_0x8367('0xc'));var authService=require(_0x8367('0xd'));var qs=require(_0x8367('0xe'));var hardwareService=require(_0x8367('0xf'));var logger=require('../../config/logger')(_0x8367('0x10'));var utils=require(_0x8367('0x11'));var config=require('../../config/environment');var db=require(_0x8367('0x12'))['db'];function respondWithStatusCode(_0x17d23e,_0x42d73e){_0x42d73e=_0x42d73e||0xcc;return function(_0x59e83b){if(_0x59e83b){return _0x17d23e[_0x8367('0x13')](_0x42d73e);}return _0x17d23e[_0x8367('0x14')](_0x42d73e)[_0x8367('0x15')]();};}function respondWithResult(_0x39e574,_0x39bc2c){_0x39bc2c=_0x39bc2c||0xc8;return function(_0x25b213){if(_0x25b213){return _0x39e574[_0x8367('0x14')](_0x39bc2c)['json'](_0x25b213);}};}function respondWithFilteredResult(_0x3e5efe,_0x4e6c77){return function(_0x109324){if(_0x109324){var _0x347822=_0x109324['count'],_0x828b19=_0x4e6c77['offset'],_0x466618=_0x4e6c77[_0x8367('0x16')]+_0x4e6c77[_0x8367('0x17')],_0x560c47;if(_0x466618>=_0x347822){_0x466618=_0x347822;_0x560c47=0xc8;}else{_0x560c47=0xce;}_0x3e5efe[_0x8367('0x14')](_0x560c47);return _0x3e5efe['set'](_0x8367('0x18'),_0x828b19+'-'+_0x466618+'/'+_0x347822)['json'](_0x109324);}return null;};}function patchUpdates(_0x12964c){return function(_0x583c3a){try{jsonpatch[_0x8367('0x19')](_0x583c3a,_0x12964c,!![]);}catch(_0x1c2f1e){return BPromise['reject'](_0x1c2f1e);}return _0x583c3a[_0x8367('0x1a')]();};}function saveUpdates(_0x163908,_0x101558){return function(_0x8b5f34){if(_0x8b5f34){return _0x8b5f34[_0x8367('0x1b')](_0x163908)['then'](function(_0x4a442e){return _0x4a442e;});}return null;};}function removeEntity(_0xfe106c,_0x964f5e){return function(_0xae19aa){if(_0xae19aa){return _0xae19aa[_0x8367('0x1c')]()['then'](function(){_0xfe106c[_0x8367('0x14')](0xcc)[_0x8367('0x15')]();});}};}function handleEntityNotFound(_0x27e894,_0x304f6d){return function(_0x379e0f){if(!_0x379e0f){_0x27e894[_0x8367('0x13')](0x194);}return _0x379e0f;};}function handleError(_0x21bfe5,_0x1983f9){_0x1983f9=_0x1983f9||0x1f4;return function(_0x46a96){logger[_0x8367('0x1d')](_0x46a96[_0x8367('0x1e')]);if(_0x46a96['name']){delete _0x46a96[_0x8367('0x1f')];}_0x21bfe5[_0x8367('0x14')](_0x1983f9)[_0x8367('0x20')](_0x46a96);};}exports[_0x8367('0x21')]=function(_0x583f13,_0x803d23){var _0x522b9d={},_0x3121b6={},_0x91aa56={'count':0x0,'rows':[]};var _0x25fe4a=db[_0x8367('0x22')][_0x8367('0x23')];_0x3121b6[_0x8367('0x24')]=_[_0x8367('0x25')](_0x25fe4a);_0x3121b6[_0x8367('0x26')]=_['keys'](_0x583f13[_0x8367('0x26')]);_0x3121b6[_0x8367('0x27')]=_[_0x8367('0x28')](_0x3121b6[_0x8367('0x24')],_0x3121b6[_0x8367('0x26')]);_0x522b9d[_0x8367('0x29')]=_[_0x8367('0x28')](_0x3121b6[_0x8367('0x24')],qs[_0x8367('0x2a')](_0x583f13[_0x8367('0x26')][_0x8367('0x2a')]));_0x522b9d[_0x8367('0x29')]=_0x522b9d['attributes'][_0x8367('0x2b')]?_0x522b9d[_0x8367('0x29')]:_0x3121b6[_0x8367('0x24')];if(!_0x583f13[_0x8367('0x26')][_0x8367('0x2c')](_0x8367('0x2d'))){_0x522b9d[_0x8367('0x17')]=qs[_0x8367('0x17')](_0x583f13['query']['limit']);_0x522b9d[_0x8367('0x16')]=qs[_0x8367('0x16')](_0x583f13[_0x8367('0x26')][_0x8367('0x16')]);}_0x522b9d['order']=qs[_0x8367('0x2e')](_0x583f13[_0x8367('0x26')][_0x8367('0x2e')]);_0x522b9d[_0x8367('0x2f')]=qs[_0x8367('0x27')](_[_0x8367('0x30')](_0x583f13[_0x8367('0x26')],_0x3121b6['filters']));if(_0x583f13[_0x8367('0x26')]['filter']){_0x522b9d[_0x8367('0x2f')]=_[_0x8367('0x31')](_0x522b9d[_0x8367('0x2f')],{'$or':_[_0x8367('0x32')](_0x25fe4a,function(_0x562c3f){if(_0x562c3f[_0x8367('0x33')]['key']!==_0x8367('0x34')){var _0x2b74ee={};_0x2b74ee[_0x562c3f[_0x8367('0x35')]]={'$like':'%'+_0x583f13[_0x8367('0x26')][_0x8367('0x36')]+'%'};return _0x2b74ee;}})});}_0x522b9d=_[_0x8367('0x31')]({},_0x522b9d,_0x583f13['options']);var _0x5e57de={'where':_0x522b9d[_0x8367('0x2f')]};return db[_0x8367('0x22')][_0x8367('0x37')](_0x5e57de)['then'](function(_0x3b6388){_0x91aa56[_0x8367('0x37')]=_0x3b6388;if(_0x583f13['query']['includeAll']){_0x522b9d[_0x8367('0x38')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x522b9d);})[_0x8367('0x39')](function(_0x4878ab){_0x91aa56[_0x8367('0x3a')]=_0x4878ab;return _0x91aa56;})[_0x8367('0x39')](respondWithFilteredResult(_0x803d23,_0x522b9d))[_0x8367('0x3b')](handleError(_0x803d23,null));};exports['show']=function(_0x2b055e,_0x20c422){var _0x4081b7={'raw':!![],'where':{'id':_0x2b055e['params']['id']}},_0x4f21e6={};_0x4f21e6[_0x8367('0x24')]=_['keys'](db[_0x8367('0x22')][_0x8367('0x23')]);_0x4f21e6[_0x8367('0x26')]=_[_0x8367('0x25')](_0x2b055e[_0x8367('0x26')]);_0x4f21e6['filters']=_[_0x8367('0x28')](_0x4f21e6[_0x8367('0x24')],_0x4f21e6['query']);_0x4081b7[_0x8367('0x29')]=_[_0x8367('0x28')](_0x4f21e6[_0x8367('0x24')],qs[_0x8367('0x2a')](_0x2b055e[_0x8367('0x26')]['fields']));_0x4081b7[_0x8367('0x29')]=_0x4081b7['attributes'][_0x8367('0x2b')]?_0x4081b7[_0x8367('0x29')]:_0x4f21e6[_0x8367('0x24')];if(_0x2b055e[_0x8367('0x26')]['includeAll']){_0x4081b7[_0x8367('0x38')]=[{'all':!![]}];}_0x4081b7=_['merge']({},_0x4081b7,_0x2b055e['options']);return db[_0x8367('0x22')]['find'](_0x4081b7)['then'](handleEntityNotFound(_0x20c422,null))['then'](respondWithResult(_0x20c422,null))['catch'](handleError(_0x20c422,null));};exports['update']=function(_0x1c3ce1,_0x310742){if(_0x1c3ce1['body']['id']){delete _0x1c3ce1[_0x8367('0x3c')]['id'];}return db['Attachment'][_0x8367('0x3d')]({'where':{'id':_0x1c3ce1[_0x8367('0x3e')]['id']}})[_0x8367('0x39')](handleEntityNotFound(_0x310742,null))['then'](saveUpdates(_0x1c3ce1[_0x8367('0x3c')],null))[_0x8367('0x39')](respondWithResult(_0x310742,null))[_0x8367('0x3b')](handleError(_0x310742,null));};exports[_0x8367('0x1c')]=function(_0x297649,_0x48f44d){return db[_0x8367('0x22')][_0x8367('0x3d')]({'where':{'id':_0x297649[_0x8367('0x3e')]['id']}})[_0x8367('0x39')](handleEntityNotFound(_0x48f44d,null))['then'](removeEntity(_0x48f44d,null))['catch'](handleError(_0x48f44d,null));};exports[_0x8367('0x3f')]=function(_0x297c63,_0x847c4,_0x30d6f4){_0x297c63['body'][_0x8367('0x1f')]=_0x297c63['file'][_0x8367('0x40')];_0x297c63[_0x8367('0x3c')]['basename']=_0x297c63[_0x8367('0x41')][_0x8367('0x42')];_0x297c63[_0x8367('0x3c')]['type']=_0x297c63['file'][_0x8367('0x43')];return db[_0x8367('0x22')][_0x8367('0x3f')](_0x297c63[_0x8367('0x3c')])['then'](respondWithResult(_0x847c4,0xc9))['catch'](handleError(_0x847c4,null));};exports[_0x8367('0x44')]=function(_0x5dc7e4,_0x1d245b,_0x305af3){return db[_0x8367('0x22')][_0x8367('0x45')]({'where':{'id':_0x5dc7e4['params']['id']},'raw':!![]})[_0x8367('0x39')](handleEntityNotFound(_0x1d245b,null))['then'](function(_0x5cdbdc){if(_0x5cdbdc){return _0x1d245b[_0x8367('0x44')](path[_0x8367('0x46')](config[_0x8367('0x47')],_0x8367('0x48'),_0x5cdbdc[_0x8367('0x49')]));}})[_0x8367('0x3b')](handleError(_0x1d245b,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 2368596..39475ff 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 _0x008c=['define','attachments','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x356307,_0xe0a012){var _0x59e722=function(_0x31348d){while(--_0x31348d){_0x356307['push'](_0x356307['shift']());}};_0x59e722(++_0xe0a012);}(_0x008c,0x188));var _0xc008=function(_0x189061,_0x21d774){_0x189061=_0x189061-0x0;var _0x257e15=_0x008c[_0x189061];return _0x257e15;};'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')]('Attachment',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09dd=['exports','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x09dd,0x81));var _0xd09d=function(_0x23b85e,_0x39b209){_0x23b85e=_0x23b85e-0x0;var _0x329756=_0x09dd[_0x23b85e];return _0x329756;};'use strict';var _=require(_0xd09d('0x0'));var util=require(_0xd09d('0x1'));var logger=require(_0xd09d('0x2'))(_0xd09d('0x3'));var moment=require(_0xd09d('0x4'));var BPromise=require(_0xd09d('0x5'));var rp=require(_0xd09d('0x6'));var fs=require('fs');var path=require(_0xd09d('0x7'));var rimraf=require(_0xd09d('0x8'));var config=require(_0xd09d('0x9'));var attributes=require(_0xd09d('0xa'));module[_0xd09d('0xb')]=function(_0x3410c4,_0x2034af){return _0x3410c4['define'](_0xd09d('0xc'),attributes,{'tableName':_0xd09d('0xd'),'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 8756cdb..1b25efe 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 _0x8156=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x8156,0xad));var _0x6815=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x8156[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x6815('0x0'));var moment=require(_0x6815('0x1'));var BPromise=require(_0x6815('0x2'));var rs=require(_0x6815('0x3'));var fs=require('fs');var Redis=require(_0x6815('0x4'));var db=require(_0x6815('0x5'))['db'];var utils=require(_0x6815('0x6'));var logger=require(_0x6815('0x7'))(_0x6815('0x8'));var config=require(_0x6815('0x9'));var jayson=require(_0x6815('0xa'));var client=jayson[_0x6815('0xb')][_0x6815('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22e6f2,_0x5d2f21,_0x356203){return new BPromise(function(_0x306724,_0x1a8eb9){return client['request'](_0x22e6f2,_0x356203)[_0x6815('0xd')](function(_0x30790f){logger[_0x6815('0xe')](_0x6815('0xf'),_0x5d2f21,_0x6815('0x10'));logger[_0x6815('0x11')](_0x6815('0x12'),_0x5d2f21,_0x6815('0x10'),JSON[_0x6815('0x13')](_0x30790f));if(_0x30790f[_0x6815('0x14')]){if(_0x30790f['error'][_0x6815('0x15')]===0x1f4){logger[_0x6815('0x14')](_0x6815('0xf'),_0x5d2f21,_0x30790f[_0x6815('0x14')][_0x6815('0x16')]);return _0x1a8eb9(_0x30790f[_0x6815('0x14')][_0x6815('0x16')]);}logger[_0x6815('0x14')](_0x6815('0xf'),_0x5d2f21,_0x30790f[_0x6815('0x14')]['message']);return _0x306724(_0x30790f[_0x6815('0x14')][_0x6815('0x16')]);}else{logger[_0x6815('0xe')](_0x6815('0xf'),_0x5d2f21,_0x6815('0x10'));_0x306724(_0x30790f[_0x6815('0x17')][_0x6815('0x16')]);}})[_0x6815('0x18')](function(_0xc326ef){logger[_0x6815('0x14')](_0x6815('0xf'),_0x5d2f21,_0xc326ef);_0x1a8eb9(_0xc326ef);});});}exports[_0x6815('0x19')]=function(_0x3b1715){var _0x159237=this;return new Promise(function(_0x1ee5e7,_0x3be07b){return db[_0x6815('0x1a')][_0x6815('0x1b')](_0x3b1715[_0x6815('0x1c')],{'raw':_0x3b1715['options']?_0x3b1715[_0x6815('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x6815('0xd')](function(_0x387e5f){logger[_0x6815('0xe')]('CreateAttachment',_0x3b1715);logger[_0x6815('0x11')](_0x6815('0x19'),_0x3b1715,JSON[_0x6815('0x13')](_0x387e5f));_0x1ee5e7(_0x387e5f);})[_0x6815('0x18')](function(_0x3f13f2){logger[_0x6815('0x14')]('CreateAttachment',_0x3f13f2[_0x6815('0x16')],_0x3b1715);_0x3be07b(_0x159237['error'](0x1f4,_0x3f13f2[_0x6815('0x16')]));});});}; \ No newline at end of file +var _0x48fa=['moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','client','http','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','CreateAttachment','create','body','options','raw','debug','catch','lodash','util'];(function(_0x19d0ea,_0x5e2bc0){var _0x28cc5e=function(_0x52ddb0){while(--_0x52ddb0){_0x19d0ea['push'](_0x19d0ea['shift']());}};_0x28cc5e(++_0x5e2bc0);}(_0x48fa,0x127));var _0xa48f=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x48fa[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xa48f('0x0'));var util=require(_0xa48f('0x1'));var moment=require(_0xa48f('0x2'));var BPromise=require(_0xa48f('0x3'));var rs=require(_0xa48f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa48f('0x5'))(_0xa48f('0x6'));var config=require(_0xa48f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa48f('0x8')][_0xa48f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c2693,_0x5909c4,_0x4c63c5){return new BPromise(function(_0x295c24,_0x560988){return client['request'](_0x1c2693,_0x4c63c5)[_0xa48f('0xa')](function(_0x2d28d1){logger[_0xa48f('0xb')](_0xa48f('0xc'),_0x5909c4,_0xa48f('0xd'));logger['debug'](_0xa48f('0xe'),_0x5909c4,_0xa48f('0xd'),JSON[_0xa48f('0xf')](_0x2d28d1));if(_0x2d28d1['error']){if(_0x2d28d1['error'][_0xa48f('0x10')]===0x1f4){logger[_0xa48f('0x11')](_0xa48f('0xc'),_0x5909c4,_0x2d28d1[_0xa48f('0x11')][_0xa48f('0x12')]);return _0x560988(_0x2d28d1[_0xa48f('0x11')][_0xa48f('0x12')]);}logger[_0xa48f('0x11')](_0xa48f('0xc'),_0x5909c4,_0x2d28d1['error'][_0xa48f('0x12')]);return _0x295c24(_0x2d28d1[_0xa48f('0x11')][_0xa48f('0x12')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x5909c4,_0xa48f('0xd'));_0x295c24(_0x2d28d1[_0xa48f('0x13')][_0xa48f('0x12')]);}})['catch'](function(_0xe042a5){logger[_0xa48f('0x11')](_0xa48f('0xc'),_0x5909c4,_0xe042a5);_0x560988(_0xe042a5);});});}exports[_0xa48f('0x14')]=function(_0x5c3bc6){var _0x1972ac=this;return new Promise(function(_0x173ed2,_0x594da0){return db['Attachment'][_0xa48f('0x15')](_0x5c3bc6[_0xa48f('0x16')],{'raw':_0x5c3bc6['options']?_0x5c3bc6[_0xa48f('0x17')][_0xa48f('0x18')]===undefined?!![]:![]:!![]})[_0xa48f('0xa')](function(_0x2e5626){logger[_0xa48f('0xb')](_0xa48f('0x14'),_0x5c3bc6);logger[_0xa48f('0x19')]('CreateAttachment',_0x5c3bc6,JSON[_0xa48f('0xf')](_0x2e5626));_0x173ed2(_0x2e5626);})[_0xa48f('0x1a')](function(_0x21743c){logger['error'](_0xa48f('0x14'),_0x21743c[_0xa48f('0x12')],_0x5c3bc6);_0x594da0(_0x1972ac[_0xa48f('0x11')](0x1f4,_0x21743c[_0xa48f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 8ac8b29..8dccdbb 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 _0x43b1=['post','single','file','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','/:id','/:id/download','download','diskStorage','join','root','format','%s-%s','originalname','replace'];(function(_0x189192,_0x5c95de){var _0x6b5fd5=function(_0x2e517d){while(--_0x2e517d){_0x189192['push'](_0x189192['shift']());}};_0x6b5fd5(++_0x5c95de);}(_0x43b1,0x7d));var _0x143b=function(_0x272c0a,_0x20fb33){_0x272c0a=_0x272c0a-0x0;var _0x58784a=_0x43b1[_0x272c0a];return _0x58784a;};'use strict';var multer=require(_0x143b('0x0'));var util=require(_0x143b('0x1'));var path=require(_0x143b('0x2'));var timeout=require('connect-timeout');var express=require(_0x143b('0x3'));var router=express['Router']();var auth=require(_0x143b('0x4'));var interaction=require(_0x143b('0x5'));var config=require(_0x143b('0x6'));var controller=require(_0x143b('0x7'));router[_0x143b('0x8')]('/',auth[_0x143b('0x9')](),controller['index']);router[_0x143b('0x8')](_0x143b('0xa'),auth[_0x143b('0x9')](),controller['show']);router[_0x143b('0x8')](_0x143b('0xb'),auth[_0x143b('0x9')](),controller[_0x143b('0xc')]);var upload=multer({'storage':multer[_0x143b('0xd')]({'destination':function(_0x3fbc04,_0xf5e80b,_0x4be65f){_0x4be65f(null,path[_0x143b('0xe')](config[_0x143b('0xf')],'server/files/attachments/'));},'filename':function(_0x5e4c9d,_0x461405,_0x597dc4){_0x597dc4(null,util[_0x143b('0x10')](_0x143b('0x11'),Date['now'](),_0x461405[_0x143b('0x12')][_0x143b('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x143b('0x14')]('/',upload[_0x143b('0x15')](_0x143b('0x16')),controller[_0x143b('0x17')]);router[_0x143b('0x18')](_0x143b('0xa'),auth[_0x143b('0x9')](),controller[_0x143b('0x19')]);router[_0x143b('0x1a')](_0x143b('0xa'),auth[_0x143b('0x9')](),controller[_0x143b('0x1b')]);module[_0x143b('0x1c')]=router; \ No newline at end of file +var _0xd957=['isAuthenticated','index','/:id','/:id/download','download','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','post','single','file','put','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get'];(function(_0x473e3f,_0x2f0947){var _0x59399b=function(_0x26dece){while(--_0x26dece){_0x473e3f['push'](_0x473e3f['shift']());}};_0x59399b(++_0x2f0947);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var path=require('path');var timeout=require(_0x7d95('0x2'));var express=require(_0x7d95('0x3'));var router=express['Router']();var auth=require(_0x7d95('0x4'));var interaction=require(_0x7d95('0x5'));var config=require(_0x7d95('0x6'));var controller=require(_0x7d95('0x7'));router[_0x7d95('0x8')]('/',auth[_0x7d95('0x9')](),controller[_0x7d95('0xa')]);router['get'](_0x7d95('0xb'),auth[_0x7d95('0x9')](),controller['show']);router[_0x7d95('0x8')](_0x7d95('0xc'),auth[_0x7d95('0x9')](),controller[_0x7d95('0xd')]);var upload=multer({'storage':multer[_0x7d95('0xe')]({'destination':function(_0x572e5f,_0x2e0589,_0x109cec){_0x109cec(null,path[_0x7d95('0xf')](config[_0x7d95('0x10')],_0x7d95('0x11')));},'filename':function(_0x4bbaf1,_0x5f34b9,_0x2ed92b){_0x2ed92b(null,util[_0x7d95('0x12')]('%s-%s',Date[_0x7d95('0x13')](),_0x5f34b9[_0x7d95('0x14')][_0x7d95('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7d95('0x16')]('/',upload[_0x7d95('0x17')](_0x7d95('0x18')),controller['create']);router[_0x7d95('0x19')]('/:id',auth[_0x7d95('0x9')](),controller['update']);router[_0x7d95('0x1a')]('/:id',auth[_0x7d95('0x9')](),controller[_0x7d95('0x1b')]);module[_0x7d95('0x1c')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 480caf7..8ea5c72 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 _0x6c99=['callback','clientSecret','secret','User','map','emails','value','admin','then','Incorrect\x20username\x20and/or\x20password','catch','lodash','passport-google-oauth20','login','authenticate','google','/login','email'];(function(_0x57e550,_0x27506e){var _0xfeec4c=function(_0xd772b5){while(--_0xd772b5){_0x57e550['push'](_0x57e550['shift']());}};_0xfeec4c(++_0x27506e);}(_0x6c99,0x9b));var _0x96c9=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0x6c99[_0x28394f];return _0x2618d2;};'use strict';var _=require(_0x96c9('0x0'));var passport=require('passport');var GoogleStrategy=require(_0x96c9('0x1'))['Strategy'];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')['signToken'];exports[_0x96c9('0x2')]=passport[_0x96c9('0x3')](_0x96c9('0x4'),{'failureRedirect':_0x96c9('0x5'),'scope':['profile',_0x96c9('0x6')],'session':![]});exports[_0x96c9('0x7')]=passport[_0x96c9('0x3')](_0x96c9('0x4'),{'failureRedirect':_0x96c9('0x5'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config['google']?config[_0x96c9('0x4')]['clientID']:'id','clientSecret':config[_0x96c9('0x4')]?config['google'][_0x96c9('0x8')]:_0x96c9('0x9'),'callbackURL':config[_0x96c9('0x4')]?config[_0x96c9('0x4')]['callbackURL']:''},function(_0x35164d,_0x2ade9d,_0x295aab,_0x170488){db[_0x96c9('0xa')]['find']({'where':{'email':_[_0x96c9('0xb')](_0x295aab[_0x96c9('0xc')],_0x96c9('0xd')),'role':{'$or':[_0x96c9('0xe'),'user','agent']}}})[_0x96c9('0xf')](function(_0x277d6a){if(_0x277d6a){return _0x170488(null,_0x277d6a);}_0x170488(_0x96c9('0x10'));})[_0x96c9('0x11')](function(_0x5c1116){_0x170488(_0x5c1116);});})); \ No newline at end of file +var _0x4fe0=['authenticate','use','clientID','clientSecret','secret','callbackURL','User','find','map','emails','user','agent','then','Incorrect\x20username\x20and/or\x20password','catch','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','login','google','/login','profile','email'];(function(_0x355de0,_0x3e1d21){var _0xad0de2=function(_0x5ac42d){while(--_0x5ac42d){_0x355de0['push'](_0x355de0['shift']());}};_0xad0de2(++_0x3e1d21);}(_0x4fe0,0x195));var _0x04fe=function(_0x3a176c,_0x1747cb){_0x3a176c=_0x3a176c-0x0;var _0x44d5b5=_0x4fe0[_0x3a176c];return _0x44d5b5;};'use strict';var _=require('lodash');var passport=require(_0x04fe('0x0'));var GoogleStrategy=require(_0x04fe('0x1'))[_0x04fe('0x2')];var db=require(_0x04fe('0x3'))['db'];var config=require(_0x04fe('0x4'));var signToken=require(_0x04fe('0x5'))['signToken'];exports[_0x04fe('0x6')]=passport['authenticate'](_0x04fe('0x7'),{'failureRedirect':_0x04fe('0x8'),'scope':[_0x04fe('0x9'),_0x04fe('0xa')],'session':![]});exports['callback']=passport[_0x04fe('0xb')]('google',{'failureRedirect':_0x04fe('0x8'),'session':![]});passport[_0x04fe('0xc')](new GoogleStrategy({'clientID':config[_0x04fe('0x7')]?config[_0x04fe('0x7')][_0x04fe('0xd')]:'id','clientSecret':config['google']?config['google'][_0x04fe('0xe')]:_0x04fe('0xf'),'callbackURL':config[_0x04fe('0x7')]?config[_0x04fe('0x7')][_0x04fe('0x10')]:''},function(_0x122b91,_0x426eac,_0x1796e3,_0x319794){db[_0x04fe('0x11')][_0x04fe('0x12')]({'where':{'email':_[_0x04fe('0x13')](_0x1796e3[_0x04fe('0x14')],'value'),'role':{'$or':['admin',_0x04fe('0x15'),_0x04fe('0x16')]}}})[_0x04fe('0x17')](function(_0x10bc7e){if(_0x10bc7e){return _0x319794(null,_0x10bc7e);}_0x319794(_0x04fe('0x18'));})[_0x04fe('0x19')](function(_0x310a70){_0x319794(_0x310a70);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f24ec4b..f5600d9 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 _0x1318=['/callback','exports','express','passport','Router','./authGoogle.controller','../../components/auth/service','setTokenCookie','get','login'];(function(_0xb952a6,_0x344c4d){var _0x162cc5=function(_0x1abbe8){while(--_0x1abbe8){_0xb952a6['push'](_0xb952a6['shift']());}};_0x162cc5(++_0x344c4d);}(_0x1318,0x14c));var _0x8131=function(_0x3bc7a5,_0x184515){_0x3bc7a5=_0x3bc7a5-0x0;var _0x115077=_0x1318[_0x3bc7a5];return _0x115077;};'use strict';var express=require(_0x8131('0x0'));var passport=require(_0x8131('0x1'));var router=express[_0x8131('0x2')]();var controller=require(_0x8131('0x3'));var setTokenCookie=require(_0x8131('0x4'))[_0x8131('0x5')];router[_0x8131('0x6')]('/',controller[_0x8131('0x7')]);router['get'](_0x8131('0x8'),controller['callback'],setTokenCookie);module[_0x8131('0x9')]=router; \ No newline at end of file +var _0x8a70=['passport','../../components/auth/service','get','login','/callback','callback','exports','express'];(function(_0x1fc84d,_0x3f469d){var _0x2658fa=function(_0x189ad0){while(--_0x189ad0){_0x1fc84d['push'](_0x1fc84d['shift']());}};_0x2658fa(++_0x3f469d);}(_0x8a70,0x137));var _0x08a7=function(_0x2d2335,_0x545186){_0x2d2335=_0x2d2335-0x0;var _0x1559e5=_0x8a70[_0x2d2335];return _0x1559e5;};'use strict';var express=require(_0x08a7('0x0'));var passport=require(_0x08a7('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var setTokenCookie=require(_0x08a7('0x2'))['setTokenCookie'];router[_0x08a7('0x3')]('/',controller[_0x08a7('0x4')]);router[_0x08a7('0x3')](_0x08a7('0x5'),controller[_0x08a7('0x6')],setTokenCookie);module[_0x08a7('0x7')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index da4a172..732d59d 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 _0xb62a=['local','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','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','http://','/reset/','Reset\x20Email\x20sent!','reset','User','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','password','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../config/logger','randomstring','../../mysqldb','../../components/auth/service','signToken','client','http','role','agent','count','then','../../config/license/util','getLicense','catch','find','user','name','Incorrect\x20username\x20and/or\x20password','authenticate','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','message','stringify','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login'];(function(_0x35babc,_0x55c90f){var _0x4a02dc=function(_0x13e11d){while(--_0x13e11d){_0x35babc['push'](_0x35babc['shift']());}};_0x4a02dc(++_0x55c90f);}(_0xb62a,0x1a2));var _0xab62=function(_0xecf29c,_0x7a4cd8){_0xecf29c=_0xecf29c-0x0;var _0x566e6b=_0xb62a[_0xecf29c];return _0x566e6b;};'use strict';var util=require(_0xab62('0x0'));var passport=require(_0xab62('0x1'));var LocalStrategy=require(_0xab62('0x2'))[_0xab62('0x3')];var BPromise=require('bluebird');var jayson=require(_0xab62('0x4'));var _=require(_0xab62('0x5'));var logger=require(_0xab62('0x6'))('api');var rs=require(_0xab62('0x7'));var db=require(_0xab62('0x8'))['db'];var signToken=require(_0xab62('0x9'))[_0xab62('0xa')];var client=jayson[_0xab62('0xb')][_0xab62('0xc')]({'port':0x232b});var getLicense=function(_0x312284){return new BPromise(function(_0x3b1c90,_0x4f3529){var _0x409983=0x0;_0x312284[_0xab62('0xd')]!==_0xab62('0xe')&&_0x3b1c90(_0x312284);return db['User'][_0xab62('0xf')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x312284['id']}}})[_0xab62('0x10')](function(_0x136604){_0x409983=_0x136604;return require(_0xab62('0x11'))[_0xab62('0x12')]();})[_0xab62('0x10')](function(_0xdb9d9a){if(_0xdb9d9a&&_0xdb9d9a['agents']&&_0x409983>=_0xdb9d9a['agents']){return _0x4f3529({'message':'Maximum\x20login\x20has\x20been\x20reached'});}return _0x3b1c90(_0x312284);})[_0xab62('0x13')](function(_0x486929){return _0x4f3529(_0x486929);});});};function localAuthenticate(_0x4db1db,_0x13fc7a,_0x262484,_0x2fffa7){_0x4db1db[_0xab62('0x14')]({'where':{'name':_0x13fc7a,'role':{'$or':['admin',_0xab62('0x15'),_0xab62('0xe')]}}})[_0xab62('0x10')](function(_0x4c5588){if(!_0x4c5588||_0x4c5588&&_0x4c5588[_0xab62('0x16')]!==_0x13fc7a){return _0x2fffa7(null,![],{'message':_0xab62('0x17')});}return getLicense(_0x4c5588);})[_0xab62('0x10')](function(_0x529d6c){_0x529d6c[_0xab62('0x18')](_0x262484,function(_0x3c86b5,_0x1b5474){if(_0x3c86b5){return _0x2fffa7(_0x3c86b5);}if(!_0x1b5474){return _0x2fffa7(null,![],{'message':_0xab62('0x17')});}else{return _0x2fffa7(null,_0x529d6c);}});})['catch'](function(_0x5b20ca){_0x2fffa7(_0x5b20ca);});}function sendServiceMail(_0x31375f){return db[_0xab62('0x19')]['find']({'where':{'service':!![]},'attributes':['id',_0xab62('0x16'),_0xab62('0x1a')],'include':[{'model':db[_0xab62('0x1b')],'as':'Smtp'}]})[_0xab62('0x10')](function(_0x321d6f){if(!_0x321d6f){throw new Error(_0xab62('0x1c'));}var _0x572392={'tls':{'rejectUnauthorized':![]}};if(_0x321d6f[_0xab62('0x1d')][_0xab62('0x1e')]){_0x572392[_0xab62('0x1e')]=_0x321d6f[_0xab62('0x1d')]['service'];}else{_0x572392[_0xab62('0x1f')]=_0x321d6f[_0xab62('0x1d')]['host'];_0x572392['port']=_0x321d6f['Smtp'][_0xab62('0x20')];_0x572392['secure']=_0x321d6f['Smtp'][_0xab62('0x21')];}if(_0x321d6f[_0xab62('0x1d')][_0xab62('0x22')]){_0x572392[_0xab62('0x23')]={'user':_0x321d6f['Smtp']['user'],'pass':_0x321d6f[_0xab62('0x1d')][_0xab62('0x24')]};}var _0x2cb737={'account':_0x572392,'message':_[_0xab62('0x25')]({'from':util[_0xab62('0x26')](_0xab62('0x27'),_0x321d6f[_0xab62('0x16')],_0x321d6f[_0xab62('0x1a')]||_0x321d6f[_0xab62('0x1d')][_0xab62('0x15')])},_0x31375f)};return client[_0xab62('0x28')](_0xab62('0x29'),_0x2cb737);})[_0xab62('0x10')](function(_0x3758ba){if(_0x3758ba[_0xab62('0x2a')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3758ba[_0xab62('0x2a')][_0xab62('0x2b')]||JSON[_0xab62('0x2c')](_0x3758ba[_0xab62('0x2a')])));}return!![];});}function handleError(_0x410f56,_0x32fa41,_0x4f9051){return _0x410f56[_0xab62('0x2d')](_0x32fa41||0x1f4)[_0xab62('0x2e')]({'message':_0x4f9051?_0x4f9051['message']||_0x4f9051:''});}function checkPasswordPattern(_0x75bce3,_0x383647,_0x15b47b){if(_0x15b47b){var _0x5f514a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f514a[_0xab62('0x2f')](_0x383647)){return _0x75bce3;}else{throw new Error(_0xab62('0x30'));}}else{return _0x75bce3;}}exports[_0xab62('0x31')]=function(_0x2ad3f6,_0x5f222f,_0x3cfc7c){passport['authenticate'](_0xab62('0x32'),function(_0x12b1fd,_0x22f02b,_0x1ffe3e){var _0x4621ad=_0x12b1fd||_0x1ffe3e;if(_0x4621ad){return handleError(_0x5f222f,0x191,_0x4621ad);}if(!_0x22f02b){return handleError(_0x5f222f,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}var _0x2e7a02=signToken(_0x22f02b['id'],_0x22f02b[_0xab62('0xd')]);_0x5f222f[_0xab62('0x33')]({'id':_0x22f02b['id'],'token':_0x2e7a02,'statusCall':'','isAlreadyLogged':_0x22f02b[_0xab62('0x34')]});})(_0x2ad3f6,_0x5f222f,_0x3cfc7c);};exports[_0xab62('0x35')]=function(_0x533d45,_0x171a74,_0x3336d7){if(!_0x533d45[_0xab62('0x36')][_0xab62('0x1a')]){return handleError(_0x171a74,0x1f4,{'message':_0xab62('0x37')});}var _0x4b8be0=rs[_0xab62('0x38')]();_0x533d45[_0xab62('0x36')][_0xab62('0x1a')]=_0x533d45[_0xab62('0x36')][_0xab62('0x1a')][_0xab62('0x39')]()[_0xab62('0x3a')]();return db['User'][_0xab62('0x14')]({'where':{'email':_0x533d45[_0xab62('0x36')][_0xab62('0x1a')]}})[_0xab62('0x10')](function(_0x3d44ec){if(!_0x3d44ec){throw new Error(_0xab62('0x3b'));}_0x3d44ec['resetPasswordToken']=_0x4b8be0;_0x3d44ec[_0xab62('0x3c')]=Date['now']()+0x36ee80;return _0x3d44ec['save']();})[_0xab62('0x10')](function(){return sendServiceMail({'to':_0x533d45['body'][_0xab62('0x1a')],'subject':_0xab62('0x3d'),'text':_0xab62('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xab62('0x3f')+_0x533d45['headers'][_0xab62('0x1f')]+_0xab62('0x40')+_0x4b8be0+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xab62('0x10')](function(){_0x171a74[_0xab62('0x2d')](0xc8)[_0xab62('0x2e')]({'message':_0xab62('0x41')});})[_0xab62('0x13')](function(_0x41b09e){return handleError(_0x171a74,0x1f4,_0x41b09e);});};exports[_0xab62('0x42')]=function(_0x350f2d,_0x3e47d2,_0x4d35c4){var _0x3b6e73;return db[_0xab62('0x43')][_0xab62('0x14')]({'where':{'resetPasswordToken':_0x350f2d[_0xab62('0x44')][_0xab62('0x45')],'resetPasswordExpires':{'$gt':Date[_0xab62('0x46')]()}}})['then'](function(_0xf8293){_0x3b6e73=_0xf8293;if(!_0x3b6e73){throw new Error(_0xab62('0x47'));}return db[_0xab62('0x48')]['findOne']({'attributes':['id',_0xab62('0x49')]});})[_0xab62('0x10')](function(_0x2d0ddf){return checkPasswordPattern(_0x2d0ddf,_0x350f2d[_0xab62('0x36')][_0xab62('0x4a')],_0x2d0ddf[_0xab62('0x49')]);})[_0xab62('0x10')](function(){_0x3b6e73['password']=_0x350f2d['body'][_0xab62('0x4a')];_0x3b6e73['resetPasswordToken']=null;_0x3b6e73[_0xab62('0x3c')]=null;return _0x3b6e73[_0xab62('0x4b')]();})[_0xab62('0x10')](function(){_0x3e47d2[_0xab62('0x2d')](0xc8)[_0xab62('0x2e')]({'message':_0xab62('0x4c')});})[_0xab62('0x13')](function(_0x31426e){return handleError(_0x3e47d2,0x1f4,_0x31426e);});};passport[_0xab62('0x4d')](new LocalStrategy({'usernameField':_0xab62('0x16'),'passwordField':_0xab62('0x4a')},function(_0x5cbf8d,_0x4b37b0,_0x4a01f2){return localAuthenticate(db[_0xab62('0x43')],_0x5cbf8d,_0x4b37b0,_0x4a01f2);})); \ No newline at end of file +var _0xe84e=['role','agent','User','count','../../config/license/util','getLicense','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','find','user','name','Incorrect\x20username\x20and/or\x20password','authenticate','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','forgot','Email\x20parameter\x20is\x20missing','body','trim','toLowerCase','resetPasswordToken','resetPasswordExpires','now','save','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','http://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','use','passport','passport-local','Strategy','bluebird','jayson/promise','../../config/logger','api','randomstring','../../mysqldb','../../components/auth/service','signToken','http'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0xe84e,0x124));var _0xee84=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0xe84e[_0xee5d2a];return _0x346948;};'use strict';var util=require('util');var passport=require(_0xee84('0x0'));var LocalStrategy=require(_0xee84('0x1'))[_0xee84('0x2')];var BPromise=require(_0xee84('0x3'));var jayson=require(_0xee84('0x4'));var _=require('lodash');var logger=require(_0xee84('0x5'))(_0xee84('0x6'));var rs=require(_0xee84('0x7'));var db=require(_0xee84('0x8'))['db'];var signToken=require(_0xee84('0x9'))[_0xee84('0xa')];var client=jayson['client'][_0xee84('0xb')]({'port':0x232b});var getLicense=function(_0x57b9ce){return new BPromise(function(_0x1fc49b,_0x2306f3){var _0x3f63d5=0x0;_0x57b9ce[_0xee84('0xc')]!==_0xee84('0xd')&&_0x1fc49b(_0x57b9ce);return db[_0xee84('0xe')][_0xee84('0xf')]({'where':{'role':_0xee84('0xd'),'online':!![],'id':{'$ne':_0x57b9ce['id']}}})['then'](function(_0x9b3836){_0x3f63d5=_0x9b3836;return require(_0xee84('0x10'))[_0xee84('0x11')]();})[_0xee84('0x12')](function(_0x485f51){if(_0x485f51&&_0x485f51[_0xee84('0x13')]&&_0x3f63d5>=_0x485f51['agents']){return _0x2306f3({'message':_0xee84('0x14')});}return _0x1fc49b(_0x57b9ce);})[_0xee84('0x15')](function(_0x281d70){return _0x2306f3(_0x281d70);});});};function localAuthenticate(_0x4cab5c,_0xf6c1b3,_0x110954,_0x4f1578){_0x4cab5c[_0xee84('0x16')]({'where':{'name':_0xf6c1b3,'role':{'$or':['admin',_0xee84('0x17'),_0xee84('0xd')]}}})[_0xee84('0x12')](function(_0x29260e){if(!_0x29260e||_0x29260e&&_0x29260e[_0xee84('0x18')]!==_0xf6c1b3){return _0x4f1578(null,![],{'message':_0xee84('0x19')});}return getLicense(_0x29260e);})['then'](function(_0x2b942e){_0x2b942e[_0xee84('0x1a')](_0x110954,function(_0x15986d,_0x201ed7){if(_0x15986d){return _0x4f1578(_0x15986d);}if(!_0x201ed7){return _0x4f1578(null,![],{'message':'Incorrect\x20username\x20and/or\x20password'});}else{return _0x4f1578(null,_0x2b942e);}});})[_0xee84('0x15')](function(_0x1226c5){_0x4f1578(_0x1226c5);});}function sendServiceMail(_0x4ecaae){return db[_0xee84('0x1b')]['find']({'where':{'service':!![]},'attributes':['id','name',_0xee84('0x1c')],'include':[{'model':db[_0xee84('0x1d')],'as':'Smtp'}]})[_0xee84('0x12')](function(_0x1f5f8c){if(!_0x1f5f8c){throw new Error(_0xee84('0x1e'));}var _0x461513={'tls':{'rejectUnauthorized':![]}};if(_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x20')]){_0x461513[_0xee84('0x20')]=_0x1f5f8c['Smtp'][_0xee84('0x20')];}else{_0x461513['host']=_0x1f5f8c[_0xee84('0x1f')]['host'];_0x461513[_0xee84('0x21')]=_0x1f5f8c['Smtp']['port'];_0x461513[_0xee84('0x22')]=_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x22')];}if(_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x23')]){_0x461513[_0xee84('0x24')]={'user':_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x17')],'pass':_0x1f5f8c['Smtp']['pass']};}var _0x4ced9b={'account':_0x461513,'message':_[_0xee84('0x25')]({'from':util[_0xee84('0x26')](_0xee84('0x27'),_0x1f5f8c['name'],_0x1f5f8c[_0xee84('0x1c')]||_0x1f5f8c[_0xee84('0x1f')][_0xee84('0x17')])},_0x4ecaae)};return client['request'](_0xee84('0x28'),_0x4ced9b);})['then'](function(_0x135af9){if(_0x135af9[_0xee84('0x29')]){throw new Error(util['format'](_0xee84('0x2a'),_0x135af9['error'][_0xee84('0x2b')]||JSON[_0xee84('0x2c')](_0x135af9['error'])));}return!![];});}function handleError(_0xbc79d7,_0x1b3969,_0x416a95){return _0xbc79d7[_0xee84('0x2d')](_0x1b3969||0x1f4)['send']({'message':_0x416a95?_0x416a95[_0xee84('0x2b')]||_0x416a95:''});}function checkPasswordPattern(_0x274680,_0x3fd652,_0x19bff4){if(_0x19bff4){var _0x4ddec4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ddec4[_0xee84('0x2e')](_0x3fd652)){return _0x274680;}else{throw new Error(_0xee84('0x2f'));}}else{return _0x274680;}}exports[_0xee84('0x30')]=function(_0x417e7a,_0x522318,_0x1d5079){passport[_0xee84('0x1a')]('local',function(_0x15f67d,_0x238ebc,_0x2e7851){var _0x341d35=_0x15f67d||_0x2e7851;if(_0x341d35){return handleError(_0x522318,0x191,_0x341d35);}if(!_0x238ebc){return handleError(_0x522318,0x194,{'message':_0xee84('0x31')});}var _0x4aafb3=signToken(_0x238ebc['id'],_0x238ebc[_0xee84('0xc')]);_0x522318[_0xee84('0x32')]({'id':_0x238ebc['id'],'token':_0x4aafb3,'statusCall':'','isAlreadyLogged':_0x238ebc['online']});})(_0x417e7a,_0x522318,_0x1d5079);};exports[_0xee84('0x33')]=function(_0x2f58ad,_0x58b52c,_0x30e6e4){if(!_0x2f58ad['body'][_0xee84('0x1c')]){return handleError(_0x58b52c,0x1f4,{'message':_0xee84('0x34')});}var _0x43f166=rs['generate']();_0x2f58ad[_0xee84('0x35')][_0xee84('0x1c')]=_0x2f58ad['body'][_0xee84('0x1c')][_0xee84('0x36')]()[_0xee84('0x37')]();return db[_0xee84('0xe')][_0xee84('0x16')]({'where':{'email':_0x2f58ad[_0xee84('0x35')][_0xee84('0x1c')]}})[_0xee84('0x12')](function(_0x1885ce){if(!_0x1885ce){throw new Error('This\x20email\x20is\x20not\x20registered.');}_0x1885ce[_0xee84('0x38')]=_0x43f166;_0x1885ce[_0xee84('0x39')]=Date[_0xee84('0x3a')]()+0x36ee80;return _0x1885ce[_0xee84('0x3b')]();})[_0xee84('0x12')](function(){return sendServiceMail({'to':_0x2f58ad[_0xee84('0x35')][_0xee84('0x1c')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xee84('0x3c')+_0xee84('0x3d')+_0xee84('0x3e')+_0x2f58ad[_0xee84('0x3f')][_0xee84('0x40')]+_0xee84('0x41')+_0x43f166+'\x0a\x0a'+_0xee84('0x42')});})['then'](function(){_0x58b52c['status'](0xc8)[_0xee84('0x43')]({'message':_0xee84('0x44')});})[_0xee84('0x15')](function(_0xd20e3b){return handleError(_0x58b52c,0x1f4,_0xd20e3b);});};exports[_0xee84('0x45')]=function(_0xacd49d,_0x51f424,_0x4701da){var _0x41bf4d;return db[_0xee84('0xe')][_0xee84('0x16')]({'where':{'resetPasswordToken':_0xacd49d[_0xee84('0x46')][_0xee84('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0xa5de4f){_0x41bf4d=_0xa5de4f;if(!_0x41bf4d){throw new Error(_0xee84('0x48'));}return db['Setting']['findOne']({'attributes':['id',_0xee84('0x49')]});})[_0xee84('0x12')](function(_0x921118){return checkPasswordPattern(_0x921118,_0xacd49d[_0xee84('0x35')]['password'],_0x921118['securePassword']);})[_0xee84('0x12')](function(){_0x41bf4d['password']=_0xacd49d[_0xee84('0x35')][_0xee84('0x4a')];_0x41bf4d[_0xee84('0x38')]=null;_0x41bf4d[_0xee84('0x39')]=null;return _0x41bf4d[_0xee84('0x3b')]();})[_0xee84('0x12')](function(){_0x51f424[_0xee84('0x2d')](0xc8)[_0xee84('0x43')]({'message':'Password\x20reset!'});})[_0xee84('0x15')](function(_0x490963){return handleError(_0x51f424,0x1f4,_0x490963);});};passport[_0xee84('0x4b')](new LocalStrategy({'usernameField':_0xee84('0x18'),'passwordField':_0xee84('0x4a')},function(_0x3061fc,_0x31dd9a,_0x4984f2){return localAuthenticate(db['User'],_0x3061fc,_0x31dd9a,_0x4984f2);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7d7ef5c..833ccfd 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 _0x9ca4=['reset','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x37489c,_0x366874){var _0x51f251=function(_0x2b0bdd){while(--_0x2b0bdd){_0x37489c['push'](_0x37489c['shift']());}};_0x51f251(++_0x366874);}(_0x9ca4,0x9c));var _0x49ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ca4[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x49ca('0x0'));var router=express[_0x49ca('0x1')]();var controller=require(_0x49ca('0x2'));router[_0x49ca('0x3')]('/',controller['login']);router[_0x49ca('0x3')](_0x49ca('0x4'),controller['forgot']);router[_0x49ca('0x3')]('/reset/:token',controller[_0x49ca('0x5')]);module[_0x49ca('0x6')]=router; \ No newline at end of file +var _0x7ae0=['express','Router','./authLocal.controller','post','/forgot','forgot','/reset/:token','exports'];(function(_0x1a5e7b,_0x3a3c12){var _0x1a0b61=function(_0x1b61ae){while(--_0x1b61ae){_0x1a5e7b['push'](_0x1a5e7b['shift']());}};_0x1a0b61(++_0x3a3c12);}(_0x7ae0,0x1a8));var _0x07ae=function(_0x169a60,_0x2f1533){_0x169a60=_0x169a60-0x0;var _0x5c987c=_0x7ae0[_0x169a60];return _0x5c987c;};'use strict';var express=require(_0x07ae('0x0'));var router=express[_0x07ae('0x1')]();var controller=require(_0x07ae('0x2'));router[_0x07ae('0x3')]('/',controller['login']);router[_0x07ae('0x3')](_0x07ae('0x4'),controller[_0x07ae('0x5')]);router[_0x07ae('0x3')](_0x07ae('0x6'),controller['reset']);module[_0x07ae('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index e9afe41..445d42b 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 _0x2d7b=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x2620c4,_0x3b712e){var _0x362a67=function(_0x41146c){while(--_0x41146c){_0x2620c4['push'](_0x2620c4['shift']());}};_0x362a67(++_0x3b712e);}(_0x2d7b,0x1ee));var _0xb2d7=function(_0x8eea78,_0x563fc7){_0x8eea78=_0x8eea78-0x0;var _0x448d18=_0x2d7b[_0x8eea78];return _0x448d18;};'use strict';var Sequelize=require(_0xb2d7('0x0'));module['exports']={'name':{'type':Sequelize[_0xb2d7('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xb2d7('0x1')]},'description':{'type':Sequelize[_0xb2d7('0x1')]},'status':{'type':Sequelize[_0xb2d7('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb2d7('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0xb2f3=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0xe1070f,_0x35c2c3){var _0x242e1d=function(_0x276472){while(--_0x276472){_0xe1070f['push'](_0xe1070f['shift']());}};_0x242e1d(++_0x35c2c3);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xb2f3[_0x1da527];return _0x40fc7c;};'use strict';var Sequelize=require(_0x3b2f('0x0'));module[_0x3b2f('0x1')]={'name':{'type':Sequelize[_0x3b2f('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x3b2f('0x2')]},'description':{'type':Sequelize[_0x3b2f('0x2')]},'status':{'type':Sequelize[_0x3b2f('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3b2f('0x4')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index a61784c..6d48e49 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 _0xa1be=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','Automation','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Condition','ids','omit','getConditions','findOne','nolimit','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','count','offset','status','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit'];(function(_0x445f21,_0x4ffe5b){var _0x4faf94=function(_0x396d68){while(--_0x396d68){_0x445f21['push'](_0x445f21['shift']());}};_0x4faf94(++_0x4ffe5b);}(_0xa1be,0x1a0));var _0xea1b=function(_0x3a7b44,_0x4a8969){_0x3a7b44=_0x3a7b44-0x0;var _0x3288dc=_0xa1be[_0x3a7b44];return _0x3288dc;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xea1b('0x0'));var zipdir=require(_0xea1b('0x1'));var jsonpatch=require(_0xea1b('0x2'));var rp=require(_0xea1b('0x3'));var moment=require('moment');var BPromise=require(_0xea1b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xea1b('0x5'));var sox=require('sox');var csv=require(_0xea1b('0x6'));var ejs=require(_0xea1b('0x7'));var fs=require('fs');var _=require(_0xea1b('0x8'));var squel=require(_0xea1b('0x9'));var crypto=require(_0xea1b('0xa'));var jsforce=require(_0xea1b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xea1b('0x6'));var querystring=require(_0xea1b('0xc'));var Papa=require(_0xea1b('0xd'));var Redis=require('ioredis');var authService=require(_0xea1b('0xe'));var qs=require(_0xea1b('0xf'));var hardwareService=require(_0xea1b('0x10'));var logger=require(_0xea1b('0x11'))(_0xea1b('0x12'));var utils=require(_0xea1b('0x13'));var config=require('../../config/environment');var db=require(_0xea1b('0x14'))['db'];function respondWithStatusCode(_0x853a5d,_0x3d8965){_0x3d8965=_0x3d8965||0xcc;return function(_0x315d15){if(_0x315d15){return _0x853a5d['sendStatus'](_0x3d8965);}return _0x853a5d['status'](_0x3d8965)[_0xea1b('0x15')]();};}function respondWithResult(_0x36b323,_0x278338){_0x278338=_0x278338||0xc8;return function(_0x4509fe){if(_0x4509fe){return _0x36b323['status'](_0x278338)['json'](_0x4509fe);}};}function respondWithFilteredResult(_0x2d8320,_0x1035ca){return function(_0x5d48d0){if(_0x5d48d0){var _0x262400=_0x5d48d0[_0xea1b('0x16')],_0x4c0f67=_0x1035ca[_0xea1b('0x17')],_0x1f53d7=_0x1035ca[_0xea1b('0x17')]+_0x1035ca['limit'],_0x5b555a;if(_0x1f53d7>=_0x262400){_0x1f53d7=_0x262400;_0x5b555a=0xc8;}else{_0x5b555a=0xce;}_0x2d8320[_0xea1b('0x18')](_0x5b555a);return _0x2d8320['set']('Content-Range',_0x4c0f67+'-'+_0x1f53d7+'/'+_0x262400)['json'](_0x5d48d0);}return null;};}function patchUpdates(_0x18a066){return function(_0x44e3bc){try{jsonpatch[_0xea1b('0x19')](_0x44e3bc,_0x18a066,!![]);}catch(_0x25cc50){return BPromise[_0xea1b('0x1a')](_0x25cc50);}return _0x44e3bc[_0xea1b('0x1b')]();};}function saveUpdates(_0x285cc3,_0x22ec63){return function(_0x33aba4){if(_0x33aba4){return _0x33aba4[_0xea1b('0x1c')](_0x285cc3)[_0xea1b('0x1d')](function(_0xafeaf5){return _0xafeaf5;});}return null;};}function removeEntity(_0x34823f,_0x57e1b8){return function(_0x18c2b1){if(_0x18c2b1){return _0x18c2b1[_0xea1b('0x1e')]()[_0xea1b('0x1d')](function(){_0x34823f[_0xea1b('0x18')](0xcc)[_0xea1b('0x15')]();});}};}function handleEntityNotFound(_0x26e4f4,_0x4736e5){return function(_0x316e48){if(!_0x316e48){_0x26e4f4[_0xea1b('0x1f')](0x194);}return _0x316e48;};}function handleError(_0x4da474,_0x14bef9){_0x14bef9=_0x14bef9||0x1f4;return function(_0x10d7cd){logger[_0xea1b('0x20')](_0x10d7cd[_0xea1b('0x21')]);if(_0x10d7cd[_0xea1b('0x22')]){delete _0x10d7cd[_0xea1b('0x22')];}_0x4da474[_0xea1b('0x18')](_0x14bef9)['send'](_0x10d7cd);};}exports[_0xea1b('0x23')]=function(_0x2a2ad3,_0xf19180){var _0x1d823d={},_0x1f9c24={},_0x41f4b2={'count':0x0,'rows':[]};var _0x9a2ead=db['Automation']['rawAttributes'];_0x1f9c24[_0xea1b('0x24')]=_[_0xea1b('0x25')](_0x9a2ead);_0x1f9c24[_0xea1b('0x26')]=_['keys'](_0x2a2ad3[_0xea1b('0x26')]);_0x1f9c24[_0xea1b('0x27')]=_[_0xea1b('0x28')](_0x1f9c24[_0xea1b('0x24')],_0x1f9c24['query']);_0x1d823d['attributes']=_[_0xea1b('0x28')](_0x1f9c24[_0xea1b('0x24')],qs[_0xea1b('0x29')](_0x2a2ad3[_0xea1b('0x26')]['fields']));_0x1d823d[_0xea1b('0x2a')]=_0x1d823d[_0xea1b('0x2a')][_0xea1b('0x2b')]?_0x1d823d['attributes']:_0x1f9c24[_0xea1b('0x24')];if(!_0x2a2ad3['query'][_0xea1b('0x2c')]('nolimit')){_0x1d823d['limit']=qs[_0xea1b('0x2d')](_0x2a2ad3[_0xea1b('0x26')][_0xea1b('0x2d')]);_0x1d823d['offset']=qs[_0xea1b('0x17')](_0x2a2ad3[_0xea1b('0x26')][_0xea1b('0x17')]);}_0x1d823d[_0xea1b('0x2e')]=qs['sort'](_0x2a2ad3[_0xea1b('0x26')][_0xea1b('0x2f')]);_0x1d823d[_0xea1b('0x30')]=qs[_0xea1b('0x27')](_[_0xea1b('0x31')](_0x2a2ad3[_0xea1b('0x26')],_0x1f9c24[_0xea1b('0x27')]));if(_0x2a2ad3[_0xea1b('0x26')][_0xea1b('0x32')]){_0x1d823d[_0xea1b('0x30')]=_[_0xea1b('0x33')](_0x1d823d['where'],{'$or':_[_0xea1b('0x34')](_0x9a2ead,function(_0x49fc49){if(_0x49fc49[_0xea1b('0x35')][_0xea1b('0x36')]!==_0xea1b('0x37')){var _0x53e397={};_0x53e397[_0x49fc49[_0xea1b('0x38')]]={'$like':'%'+_0x2a2ad3[_0xea1b('0x26')]['filter']+'%'};return _0x53e397;}})});}_0x1d823d=_[_0xea1b('0x33')]({},_0x1d823d,_0x2a2ad3[_0xea1b('0x39')]);var _0x25b294={'where':_0x1d823d[_0xea1b('0x30')]};return db[_0xea1b('0x3a')]['count'](_0x25b294)[_0xea1b('0x1d')](function(_0x1714be){_0x41f4b2[_0xea1b('0x16')]=_0x1714be;if(_0x2a2ad3[_0xea1b('0x26')]['includeAll']){_0x1d823d[_0xea1b('0x3b')]=[{'all':!![]}];}return db['Automation'][_0xea1b('0x3c')](_0x1d823d);})[_0xea1b('0x1d')](function(_0x4f781c){_0x41f4b2[_0xea1b('0x3d')]=_0x4f781c;return _0x41f4b2;})[_0xea1b('0x1d')](respondWithFilteredResult(_0xf19180,_0x1d823d))[_0xea1b('0x3e')](handleError(_0xf19180,null));};exports[_0xea1b('0x3f')]=function(_0x15ef52,_0x518a2c){var _0x39f6e0={'raw':![],'where':{'id':_0x15ef52[_0xea1b('0x40')]['id']}},_0x326111={};_0x326111[_0xea1b('0x24')]=_[_0xea1b('0x25')](db['Automation'][_0xea1b('0x41')]);_0x326111[_0xea1b('0x26')]=_[_0xea1b('0x25')](_0x15ef52[_0xea1b('0x26')]);_0x326111[_0xea1b('0x27')]=_[_0xea1b('0x28')](_0x326111['model'],_0x326111[_0xea1b('0x26')]);_0x39f6e0[_0xea1b('0x2a')]=_[_0xea1b('0x28')](_0x326111[_0xea1b('0x24')],qs['fields'](_0x15ef52[_0xea1b('0x26')][_0xea1b('0x29')]));_0x39f6e0[_0xea1b('0x2a')]=_0x39f6e0[_0xea1b('0x2a')]['length']?_0x39f6e0[_0xea1b('0x2a')]:_0x326111['model'];if(_0x15ef52[_0xea1b('0x26')]['includeAll']){_0x39f6e0['include']=[{'all':!![]}];}_0x39f6e0=_[_0xea1b('0x33')]({},_0x39f6e0,_0x15ef52[_0xea1b('0x39')]);return db[_0xea1b('0x3a')][_0xea1b('0x42')](_0x39f6e0)[_0xea1b('0x1d')](handleEntityNotFound(_0x518a2c,null))[_0xea1b('0x1d')](respondWithResult(_0x518a2c,null))[_0xea1b('0x3e')](handleError(_0x518a2c,null));};exports[_0xea1b('0x43')]=function(_0x425411,_0x4414b2){return db['Automation']['create'](_0x425411[_0xea1b('0x44')],{})[_0xea1b('0x1d')](respondWithResult(_0x4414b2,0xc9))[_0xea1b('0x3e')](handleError(_0x4414b2,null));};exports[_0xea1b('0x1c')]=function(_0x48b17c,_0x46dcd0){if(_0x48b17c[_0xea1b('0x44')]['id']){delete _0x48b17c[_0xea1b('0x44')]['id'];}return db[_0xea1b('0x3a')]['find']({'where':{'id':_0x48b17c[_0xea1b('0x40')]['id']}})[_0xea1b('0x1d')](handleEntityNotFound(_0x46dcd0,null))['then'](saveUpdates(_0x48b17c[_0xea1b('0x44')],null))[_0xea1b('0x1d')](respondWithResult(_0x46dcd0,null))[_0xea1b('0x3e')](handleError(_0x46dcd0,null));};exports['destroy']=function(_0x451b3a,_0x37f76b){return db[_0xea1b('0x3a')][_0xea1b('0x42')]({'where':{'id':_0x451b3a[_0xea1b('0x40')]['id']}})['then'](handleEntityNotFound(_0x37f76b,null))['then'](removeEntity(_0x37f76b,null))[_0xea1b('0x3e')](handleError(_0x37f76b,null));};exports['addConditions']=function(_0x257f14,_0x57e639,_0x1dd52a){return db[_0xea1b('0x45')][_0xea1b('0x42')]({'where':{'id':_0x257f14[_0xea1b('0x40')]['id']}})[_0xea1b('0x1d')](handleEntityNotFound(_0x57e639,null))['then'](function(_0x357bd9){if(_0x357bd9){return _0x357bd9['addConditions'](_0x257f14[_0xea1b('0x44')][_0xea1b('0x46')],_[_0xea1b('0x47')](_0x257f14[_0xea1b('0x44')],['ids','id'])||{});}})[_0xea1b('0x1d')](respondWithResult(_0x57e639,null))[_0xea1b('0x3e')](handleError(_0x57e639,null));};exports[_0xea1b('0x48')]=function(_0x5deefd,_0x47e980,_0x1c8339){var _0x1ee506={};var _0x20c9b6={};var _0x48aa14;var _0x2c598d;return db[_0xea1b('0x3a')][_0xea1b('0x49')]({'where':{'id':_0x5deefd['params']['id']}})['then'](handleEntityNotFound(_0x47e980,null))[_0xea1b('0x1d')](function(_0xe0c86){if(_0xe0c86){_0x48aa14=_0xe0c86;_0x20c9b6[_0xea1b('0x24')]=_[_0xea1b('0x25')](db['Condition'][_0xea1b('0x41')]);_0x20c9b6[_0xea1b('0x26')]=_['keys'](_0x5deefd[_0xea1b('0x26')]);_0x20c9b6['filters']=_['intersection'](_0x20c9b6[_0xea1b('0x24')],_0x20c9b6['query']);_0x1ee506['attributes']=_['intersection'](_0x20c9b6['model'],qs['fields'](_0x5deefd['query'][_0xea1b('0x29')]));_0x1ee506[_0xea1b('0x2a')]=_0x1ee506['attributes'][_0xea1b('0x2b')]?_0x1ee506[_0xea1b('0x2a')]:_0x20c9b6[_0xea1b('0x24')];_0x1ee506[_0xea1b('0x2e')]=qs[_0xea1b('0x2f')](_0x5deefd['query'][_0xea1b('0x2f')]);_0x1ee506[_0xea1b('0x30')]=qs['filters'](_[_0xea1b('0x31')](_0x5deefd['query'],_0x20c9b6['filters']));if(_0x5deefd['query'][_0xea1b('0x32')]){_0x1ee506[_0xea1b('0x30')]=_[_0xea1b('0x33')](_0x1ee506[_0xea1b('0x30')],{'$or':_[_0xea1b('0x34')](_0x1ee506[_0xea1b('0x2a')],function(_0x27110f){var _0x47c9ae={};_0x47c9ae[_0x27110f]={'$like':'%'+_0x5deefd[_0xea1b('0x26')][_0xea1b('0x32')]+'%'};return _0x47c9ae;})});}_0x1ee506=_[_0xea1b('0x33')]({},_0x1ee506,_0x5deefd[_0xea1b('0x39')]);return _0x48aa14[_0xea1b('0x48')](_0x1ee506);}})['then'](function(_0xa185fb){if(_0xa185fb){_0x2c598d=_0xa185fb[_0xea1b('0x2b')];if(!_0x5deefd['query'][_0xea1b('0x2c')](_0xea1b('0x4a'))){_0x1ee506['limit']=qs[_0xea1b('0x2d')](_0x5deefd[_0xea1b('0x26')][_0xea1b('0x2d')]);_0x1ee506[_0xea1b('0x17')]=qs[_0xea1b('0x17')](_0x5deefd[_0xea1b('0x26')]['offset']);}return _0x48aa14[_0xea1b('0x48')](_0x1ee506);}})['then'](function(_0x24b043){if(_0x24b043){return _0x24b043?{'count':_0x2c598d,'rows':_0x24b043}:null;}})['then'](respondWithResult(_0x47e980,null))[_0xea1b('0x3e')](handleError(_0x47e980,null));};exports['addActions']=function(_0x5c0a3b,_0x13abfe,_0x385fab){return db[_0xea1b('0x4b')][_0xea1b('0x42')]({'where':{'id':_0x5c0a3b[_0xea1b('0x40')]['id']}})[_0xea1b('0x1d')](handleEntityNotFound(_0x13abfe,null))['then'](function(_0xa5e83){if(_0xa5e83){return _0xa5e83['addActions'](_0x5c0a3b[_0xea1b('0x44')]['ids'],_[_0xea1b('0x47')](_0x5c0a3b[_0xea1b('0x44')],[_0xea1b('0x46'),'id'])||{});}})['then'](respondWithResult(_0x13abfe,null))[_0xea1b('0x3e')](handleError(_0x13abfe,null));};exports[_0xea1b('0x4c')]=function(_0x89511c,_0xd1a7d,_0x3acc95){var _0x57bffc={};var _0x3c2de0={};var _0xd4afd6;var _0x10034f;return db[_0xea1b('0x3a')][_0xea1b('0x49')]({'where':{'id':_0x89511c['params']['id']}})['then'](handleEntityNotFound(_0xd1a7d,null))[_0xea1b('0x1d')](function(_0x159717){if(_0x159717){_0xd4afd6=_0x159717;_0x3c2de0[_0xea1b('0x24')]=_['keys'](db[_0xea1b('0x4b')][_0xea1b('0x41')]);_0x3c2de0[_0xea1b('0x26')]=_[_0xea1b('0x25')](_0x89511c[_0xea1b('0x26')]);_0x3c2de0['filters']=_[_0xea1b('0x28')](_0x3c2de0[_0xea1b('0x24')],_0x3c2de0[_0xea1b('0x26')]);_0x57bffc[_0xea1b('0x2a')]=_[_0xea1b('0x28')](_0x3c2de0[_0xea1b('0x24')],qs['fields'](_0x89511c['query'][_0xea1b('0x29')]));_0x57bffc[_0xea1b('0x2a')]=_0x57bffc[_0xea1b('0x2a')][_0xea1b('0x2b')]?_0x57bffc['attributes']:_0x3c2de0[_0xea1b('0x24')];_0x57bffc[_0xea1b('0x2e')]=qs[_0xea1b('0x2f')](_0x89511c['query'][_0xea1b('0x2f')]);_0x57bffc[_0xea1b('0x30')]=qs[_0xea1b('0x27')](_[_0xea1b('0x31')](_0x89511c[_0xea1b('0x26')],_0x3c2de0[_0xea1b('0x27')]));if(_0x89511c[_0xea1b('0x26')][_0xea1b('0x32')]){_0x57bffc['where']=_['merge'](_0x57bffc[_0xea1b('0x30')],{'$or':_[_0xea1b('0x34')](_0x57bffc[_0xea1b('0x2a')],function(_0x378398){var _0xeeaaf4={};_0xeeaaf4[_0x378398]={'$like':'%'+_0x89511c[_0xea1b('0x26')][_0xea1b('0x32')]+'%'};return _0xeeaaf4;})});}_0x57bffc=_[_0xea1b('0x33')]({},_0x57bffc,_0x89511c[_0xea1b('0x39')]);return _0xd4afd6[_0xea1b('0x4c')](_0x57bffc);}})[_0xea1b('0x1d')](function(_0x5efd8e){if(_0x5efd8e){_0x10034f=_0x5efd8e[_0xea1b('0x2b')];if(!_0x89511c[_0xea1b('0x26')][_0xea1b('0x2c')](_0xea1b('0x4a'))){_0x57bffc[_0xea1b('0x2d')]=qs['limit'](_0x89511c['query'][_0xea1b('0x2d')]);_0x57bffc[_0xea1b('0x17')]=qs[_0xea1b('0x17')](_0x89511c[_0xea1b('0x26')]['offset']);}return _0xd4afd6[_0xea1b('0x4c')](_0x57bffc);}})[_0xea1b('0x1d')](function(_0x102dd8){if(_0x102dd8){return _0x102dd8?{'count':_0x10034f,'rows':_0x102dd8}:null;}})[_0xea1b('0x1d')](respondWithResult(_0xd1a7d,null))[_0xea1b('0x3e')](handleError(_0xd1a7d,null));}; \ No newline at end of file +var _0xbad0=['querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','rawAttributes','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','map','key','field','options','Automation','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','addConditions','Condition','ids','getConditions','findOne','hasOwnProperty','Action','addActions','omit','getActions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x1a89a5,_0x1f895f){var _0x1f351f=function(_0x5c4218){while(--_0x5c4218){_0x1a89a5['push'](_0x1a89a5['shift']());}};_0x1f351f(++_0x1f895f);}(_0xbad0,0x1de));var _0x0bad=function(_0x15a982,_0x2881d7){_0x15a982=_0x15a982-0x0;var _0x475d5a=_0xbad0[_0x15a982];return _0x475d5a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0bad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0bad('0x1'));var jsonpatch=require(_0x0bad('0x2'));var rp=require(_0x0bad('0x3'));var moment=require(_0x0bad('0x4'));var BPromise=require(_0x0bad('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0bad('0x6'));var sox=require(_0x0bad('0x7'));var csv=require(_0x0bad('0x8'));var ejs=require(_0x0bad('0x9'));var fs=require('fs');var _=require(_0x0bad('0xa'));var squel=require(_0x0bad('0xb'));var crypto=require(_0x0bad('0xc'));var jsforce=require(_0x0bad('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0bad('0x8'));var querystring=require(_0x0bad('0xe'));var Papa=require(_0x0bad('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0bad('0x10'));var hardwareService=require(_0x0bad('0x11'));var logger=require('../../config/logger')(_0x0bad('0x12'));var utils=require(_0x0bad('0x13'));var config=require(_0x0bad('0x14'));var db=require(_0x0bad('0x15'))['db'];function respondWithStatusCode(_0x288f3b,_0x4f85f2){_0x4f85f2=_0x4f85f2||0xcc;return function(_0x11c0fb){if(_0x11c0fb){return _0x288f3b[_0x0bad('0x16')](_0x4f85f2);}return _0x288f3b[_0x0bad('0x17')](_0x4f85f2)[_0x0bad('0x18')]();};}function respondWithResult(_0x2918af,_0x590c8b){_0x590c8b=_0x590c8b||0xc8;return function(_0x14ce94){if(_0x14ce94){return _0x2918af[_0x0bad('0x17')](_0x590c8b)[_0x0bad('0x19')](_0x14ce94);}};}function respondWithFilteredResult(_0x3ad1cc,_0xa428e0){return function(_0x3bcba3){if(_0x3bcba3){var _0x57a5e9=_0x3bcba3[_0x0bad('0x1a')],_0x3a54fd=_0xa428e0['offset'],_0x4348c9=_0xa428e0[_0x0bad('0x1b')]+_0xa428e0[_0x0bad('0x1c')],_0x144ba5;if(_0x4348c9>=_0x57a5e9){_0x4348c9=_0x57a5e9;_0x144ba5=0xc8;}else{_0x144ba5=0xce;}_0x3ad1cc['status'](_0x144ba5);return _0x3ad1cc[_0x0bad('0x1d')](_0x0bad('0x1e'),_0x3a54fd+'-'+_0x4348c9+'/'+_0x57a5e9)['json'](_0x3bcba3);}return null;};}function patchUpdates(_0x5ccd99){return function(_0x4834e5){try{jsonpatch[_0x0bad('0x1f')](_0x4834e5,_0x5ccd99,!![]);}catch(_0x48b4c1){return BPromise[_0x0bad('0x20')](_0x48b4c1);}return _0x4834e5['save']();};}function saveUpdates(_0x33bc26,_0x3f2b1f){return function(_0x16278d){if(_0x16278d){return _0x16278d['update'](_0x33bc26)[_0x0bad('0x21')](function(_0x13d9d6){return _0x13d9d6;});}return null;};}function removeEntity(_0x177b9e,_0x107bcf){return function(_0x405d0a){if(_0x405d0a){return _0x405d0a[_0x0bad('0x22')]()['then'](function(){_0x177b9e[_0x0bad('0x17')](0xcc)[_0x0bad('0x18')]();});}};}function handleEntityNotFound(_0x1a9e94,_0x5b5d9c){return function(_0x3a68fc){if(!_0x3a68fc){_0x1a9e94['sendStatus'](0x194);}return _0x3a68fc;};}function handleError(_0x444579,_0x8e1cfd){_0x8e1cfd=_0x8e1cfd||0x1f4;return function(_0x5f49b5){logger[_0x0bad('0x23')](_0x5f49b5[_0x0bad('0x24')]);if(_0x5f49b5['name']){delete _0x5f49b5[_0x0bad('0x25')];}_0x444579[_0x0bad('0x17')](_0x8e1cfd)[_0x0bad('0x26')](_0x5f49b5);};}exports[_0x0bad('0x27')]=function(_0x3bbc78,_0x3e8215){var _0x4eb944={},_0x198b94={},_0x3ea71e={'count':0x0,'rows':[]};var _0x530651=db['Automation'][_0x0bad('0x28')];_0x198b94[_0x0bad('0x29')]=_['keys'](_0x530651);_0x198b94[_0x0bad('0x2a')]=_[_0x0bad('0x2b')](_0x3bbc78[_0x0bad('0x2a')]);_0x198b94['filters']=_[_0x0bad('0x2c')](_0x198b94['model'],_0x198b94[_0x0bad('0x2a')]);_0x4eb944[_0x0bad('0x2d')]=_['intersection'](_0x198b94[_0x0bad('0x29')],qs['fields'](_0x3bbc78['query'][_0x0bad('0x2e')]));_0x4eb944[_0x0bad('0x2d')]=_0x4eb944['attributes'][_0x0bad('0x2f')]?_0x4eb944[_0x0bad('0x2d')]:_0x198b94[_0x0bad('0x29')];if(!_0x3bbc78[_0x0bad('0x2a')]['hasOwnProperty'](_0x0bad('0x30'))){_0x4eb944['limit']=qs[_0x0bad('0x1c')](_0x3bbc78['query'][_0x0bad('0x1c')]);_0x4eb944[_0x0bad('0x1b')]=qs['offset'](_0x3bbc78[_0x0bad('0x2a')][_0x0bad('0x1b')]);}_0x4eb944[_0x0bad('0x31')]=qs[_0x0bad('0x32')](_0x3bbc78['query']['sort']);_0x4eb944[_0x0bad('0x33')]=qs[_0x0bad('0x34')](_[_0x0bad('0x35')](_0x3bbc78[_0x0bad('0x2a')],_0x198b94[_0x0bad('0x34')]));if(_0x3bbc78['query'][_0x0bad('0x36')]){_0x4eb944[_0x0bad('0x33')]=_[_0x0bad('0x37')](_0x4eb944['where'],{'$or':_[_0x0bad('0x38')](_0x530651,function(_0x331722){if(_0x331722['type'][_0x0bad('0x39')]!=='VIRTUAL'){var _0xace013={};_0xace013[_0x331722[_0x0bad('0x3a')]]={'$like':'%'+_0x3bbc78[_0x0bad('0x2a')][_0x0bad('0x36')]+'%'};return _0xace013;}})});}_0x4eb944=_[_0x0bad('0x37')]({},_0x4eb944,_0x3bbc78[_0x0bad('0x3b')]);var _0x131cb1={'where':_0x4eb944['where']};return db[_0x0bad('0x3c')]['count'](_0x131cb1)[_0x0bad('0x21')](function(_0x51203e){_0x3ea71e[_0x0bad('0x1a')]=_0x51203e;if(_0x3bbc78['query'][_0x0bad('0x3d')]){_0x4eb944[_0x0bad('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x0bad('0x3f')](_0x4eb944);})[_0x0bad('0x21')](function(_0x21d6f6){_0x3ea71e[_0x0bad('0x40')]=_0x21d6f6;return _0x3ea71e;})[_0x0bad('0x21')](respondWithFilteredResult(_0x3e8215,_0x4eb944))[_0x0bad('0x41')](handleError(_0x3e8215,null));};exports[_0x0bad('0x42')]=function(_0x2c1d6c,_0x251e86){var _0x58be50={'raw':![],'where':{'id':_0x2c1d6c[_0x0bad('0x43')]['id']}},_0x52a11a={};_0x52a11a['model']=_[_0x0bad('0x2b')](db[_0x0bad('0x3c')]['rawAttributes']);_0x52a11a[_0x0bad('0x2a')]=_['keys'](_0x2c1d6c[_0x0bad('0x2a')]);_0x52a11a[_0x0bad('0x34')]=_[_0x0bad('0x2c')](_0x52a11a[_0x0bad('0x29')],_0x52a11a['query']);_0x58be50[_0x0bad('0x2d')]=_[_0x0bad('0x2c')](_0x52a11a[_0x0bad('0x29')],qs[_0x0bad('0x2e')](_0x2c1d6c['query']['fields']));_0x58be50[_0x0bad('0x2d')]=_0x58be50[_0x0bad('0x2d')][_0x0bad('0x2f')]?_0x58be50['attributes']:_0x52a11a[_0x0bad('0x29')];if(_0x2c1d6c['query'][_0x0bad('0x3d')]){_0x58be50[_0x0bad('0x3e')]=[{'all':!![]}];}_0x58be50=_[_0x0bad('0x37')]({},_0x58be50,_0x2c1d6c[_0x0bad('0x3b')]);return db[_0x0bad('0x3c')][_0x0bad('0x44')](_0x58be50)[_0x0bad('0x21')](handleEntityNotFound(_0x251e86,null))[_0x0bad('0x21')](respondWithResult(_0x251e86,null))[_0x0bad('0x41')](handleError(_0x251e86,null));};exports[_0x0bad('0x45')]=function(_0x353ce1,_0x165a4f){return db['Automation'][_0x0bad('0x45')](_0x353ce1['body'],{})['then'](respondWithResult(_0x165a4f,0xc9))['catch'](handleError(_0x165a4f,null));};exports[_0x0bad('0x46')]=function(_0x3542b9,_0x1594a7){if(_0x3542b9[_0x0bad('0x47')]['id']){delete _0x3542b9[_0x0bad('0x47')]['id'];}return db[_0x0bad('0x3c')][_0x0bad('0x44')]({'where':{'id':_0x3542b9[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x1594a7,null))['then'](saveUpdates(_0x3542b9[_0x0bad('0x47')],null))['then'](respondWithResult(_0x1594a7,null))[_0x0bad('0x41')](handleError(_0x1594a7,null));};exports[_0x0bad('0x22')]=function(_0x2cfe5b,_0x4e91f5){return db[_0x0bad('0x3c')]['find']({'where':{'id':_0x2cfe5b[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x4e91f5,null))['then'](removeEntity(_0x4e91f5,null))[_0x0bad('0x41')](handleError(_0x4e91f5,null));};exports[_0x0bad('0x48')]=function(_0x162d52,_0xe8eb58,_0x168836){return db[_0x0bad('0x49')][_0x0bad('0x44')]({'where':{'id':_0x162d52[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0xe8eb58,null))['then'](function(_0x11c45f){if(_0x11c45f){return _0x11c45f[_0x0bad('0x48')](_0x162d52[_0x0bad('0x47')]['ids'],_['omit'](_0x162d52[_0x0bad('0x47')],[_0x0bad('0x4a'),'id'])||{});}})[_0x0bad('0x21')](respondWithResult(_0xe8eb58,null))['catch'](handleError(_0xe8eb58,null));};exports[_0x0bad('0x4b')]=function(_0x3c62a8,_0x58fb5c,_0x1c71bd){var _0x58d09f={};var _0x3b7948={};var _0x1205f7;var _0x1450aa;return db[_0x0bad('0x3c')][_0x0bad('0x4c')]({'where':{'id':_0x3c62a8[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x58fb5c,null))[_0x0bad('0x21')](function(_0x23109d){if(_0x23109d){_0x1205f7=_0x23109d;_0x3b7948[_0x0bad('0x29')]=_[_0x0bad('0x2b')](db[_0x0bad('0x49')]['rawAttributes']);_0x3b7948['query']=_[_0x0bad('0x2b')](_0x3c62a8[_0x0bad('0x2a')]);_0x3b7948['filters']=_[_0x0bad('0x2c')](_0x3b7948['model'],_0x3b7948[_0x0bad('0x2a')]);_0x58d09f[_0x0bad('0x2d')]=_[_0x0bad('0x2c')](_0x3b7948['model'],qs[_0x0bad('0x2e')](_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x2e')]));_0x58d09f['attributes']=_0x58d09f['attributes'][_0x0bad('0x2f')]?_0x58d09f[_0x0bad('0x2d')]:_0x3b7948[_0x0bad('0x29')];_0x58d09f['order']=qs[_0x0bad('0x32')](_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x32')]);_0x58d09f[_0x0bad('0x33')]=qs[_0x0bad('0x34')](_[_0x0bad('0x35')](_0x3c62a8[_0x0bad('0x2a')],_0x3b7948[_0x0bad('0x34')]));if(_0x3c62a8[_0x0bad('0x2a')]['filter']){_0x58d09f[_0x0bad('0x33')]=_[_0x0bad('0x37')](_0x58d09f[_0x0bad('0x33')],{'$or':_[_0x0bad('0x38')](_0x58d09f[_0x0bad('0x2d')],function(_0x539533){var _0x5b4c81={};_0x5b4c81[_0x539533]={'$like':'%'+_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x36')]+'%'};return _0x5b4c81;})});}_0x58d09f=_['merge']({},_0x58d09f,_0x3c62a8[_0x0bad('0x3b')]);return _0x1205f7[_0x0bad('0x4b')](_0x58d09f);}})[_0x0bad('0x21')](function(_0x25a47f){if(_0x25a47f){_0x1450aa=_0x25a47f[_0x0bad('0x2f')];if(!_0x3c62a8[_0x0bad('0x2a')][_0x0bad('0x4d')](_0x0bad('0x30'))){_0x58d09f[_0x0bad('0x1c')]=qs['limit'](_0x3c62a8[_0x0bad('0x2a')]['limit']);_0x58d09f['offset']=qs[_0x0bad('0x1b')](_0x3c62a8['query'][_0x0bad('0x1b')]);}return _0x1205f7['getConditions'](_0x58d09f);}})[_0x0bad('0x21')](function(_0x4cdcad){if(_0x4cdcad){return _0x4cdcad?{'count':_0x1450aa,'rows':_0x4cdcad}:null;}})[_0x0bad('0x21')](respondWithResult(_0x58fb5c,null))[_0x0bad('0x41')](handleError(_0x58fb5c,null));};exports['addActions']=function(_0x4debe7,_0x4285e0,_0xa4362e){return db[_0x0bad('0x4e')]['find']({'where':{'id':_0x4debe7[_0x0bad('0x43')]['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x4285e0,null))[_0x0bad('0x21')](function(_0x10a688){if(_0x10a688){return _0x10a688[_0x0bad('0x4f')](_0x4debe7[_0x0bad('0x47')]['ids'],_[_0x0bad('0x50')](_0x4debe7[_0x0bad('0x47')],[_0x0bad('0x4a'),'id'])||{});}})[_0x0bad('0x21')](respondWithResult(_0x4285e0,null))['catch'](handleError(_0x4285e0,null));};exports[_0x0bad('0x51')]=function(_0x2a05b2,_0x2b5d0f,_0x79bb72){var _0x762f5b={};var _0x51847b={};var _0x565265;var _0x5c439c;return db[_0x0bad('0x3c')]['findOne']({'where':{'id':_0x2a05b2['params']['id']}})[_0x0bad('0x21')](handleEntityNotFound(_0x2b5d0f,null))[_0x0bad('0x21')](function(_0x3ce277){if(_0x3ce277){_0x565265=_0x3ce277;_0x51847b[_0x0bad('0x29')]=_[_0x0bad('0x2b')](db['Action']['rawAttributes']);_0x51847b[_0x0bad('0x2a')]=_[_0x0bad('0x2b')](_0x2a05b2['query']);_0x51847b['filters']=_[_0x0bad('0x2c')](_0x51847b[_0x0bad('0x29')],_0x51847b[_0x0bad('0x2a')]);_0x762f5b['attributes']=_['intersection'](_0x51847b['model'],qs['fields'](_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x2e')]));_0x762f5b[_0x0bad('0x2d')]=_0x762f5b[_0x0bad('0x2d')][_0x0bad('0x2f')]?_0x762f5b[_0x0bad('0x2d')]:_0x51847b['model'];_0x762f5b['order']=qs[_0x0bad('0x32')](_0x2a05b2[_0x0bad('0x2a')]['sort']);_0x762f5b[_0x0bad('0x33')]=qs['filters'](_['pick'](_0x2a05b2[_0x0bad('0x2a')],_0x51847b[_0x0bad('0x34')]));if(_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x36')]){_0x762f5b[_0x0bad('0x33')]=_[_0x0bad('0x37')](_0x762f5b[_0x0bad('0x33')],{'$or':_['map'](_0x762f5b[_0x0bad('0x2d')],function(_0x5a8c1b){var _0x402a89={};_0x402a89[_0x5a8c1b]={'$like':'%'+_0x2a05b2[_0x0bad('0x2a')]['filter']+'%'};return _0x402a89;})});}_0x762f5b=_['merge']({},_0x762f5b,_0x2a05b2[_0x0bad('0x3b')]);return _0x565265[_0x0bad('0x51')](_0x762f5b);}})[_0x0bad('0x21')](function(_0xe7b2a1){if(_0xe7b2a1){_0x5c439c=_0xe7b2a1[_0x0bad('0x2f')];if(!_0x2a05b2[_0x0bad('0x2a')]['hasOwnProperty']('nolimit')){_0x762f5b['limit']=qs['limit'](_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x1c')]);_0x762f5b[_0x0bad('0x1b')]=qs[_0x0bad('0x1b')](_0x2a05b2[_0x0bad('0x2a')][_0x0bad('0x1b')]);}return _0x565265[_0x0bad('0x51')](_0x762f5b);}})[_0x0bad('0x21')](function(_0x455a49){if(_0x455a49){return _0x455a49?{'count':_0x5c439c,'rows':_0x455a49}:null;}})['then'](respondWithResult(_0x2b5d0f,null))['catch'](handleError(_0x2b5d0f,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index e2504c2..a067b48 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 _0x2c76=['exports','define','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3f447e,_0x286dce){var _0xe01dab=function(_0x2a1f0d){while(--_0x2a1f0d){_0x3f447e['push'](_0x3f447e['shift']());}};_0xe01dab(++_0x286dce);}(_0x2c76,0xde));var _0x62c7=function(_0x4e52d7,_0x1eb475){_0x4e52d7=_0x4e52d7-0x0;var _0x35afd5=_0x2c76[_0x4e52d7];return _0x35afd5;};'use strict';var _=require(_0x62c7('0x0'));var util=require(_0x62c7('0x1'));var logger=require(_0x62c7('0x2'))('api');var moment=require(_0x62c7('0x3'));var BPromise=require(_0x62c7('0x4'));var rp=require(_0x62c7('0x5'));var fs=require('fs');var path=require(_0x62c7('0x6'));var rimraf=require(_0x62c7('0x7'));var config=require(_0x62c7('0x8'));var attributes=require('./automation.attributes');module[_0x62c7('0x9')]=function(_0x37d151,_0x2b693e){return _0x37d151[_0x62c7('0xa')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ea3=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0x5d1c9d,_0x8bb82d){var _0x8edfe4=function(_0x30fdc4){while(--_0x30fdc4){_0x5d1c9d['push'](_0x5d1c9d['shift']());}};_0x8edfe4(++_0x8bb82d);}(_0x7ea3,0xba));var _0x37ea=function(_0x8b4dd3,_0x120bdc){_0x8b4dd3=_0x8b4dd3-0x0;var _0x1f9fda=_0x7ea3[_0x8b4dd3];return _0x1f9fda;};'use strict';var _=require(_0x37ea('0x0'));var util=require(_0x37ea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x37ea('0x2'));var BPromise=require(_0x37ea('0x3'));var rp=require(_0x37ea('0x4'));var fs=require('fs');var path=require(_0x37ea('0x5'));var rimraf=require(_0x37ea('0x6'));var config=require(_0x37ea('0x7'));var attributes=require(_0x37ea('0x8'));module['exports']=function(_0x11f891,_0x1911e7){return _0x11f891[_0x37ea('0x9')]('Automation',attributes,{'tableName':_0x37ea('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index b919eb4..5b9065a 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 _0x4317=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment'];(function(_0x3cad2c,_0x1f9b08){var _0x37d0e3=function(_0x559274){while(--_0x559274){_0x3cad2c['push'](_0x3cad2c['shift']());}};_0x37d0e3(++_0x1f9b08);}(_0x4317,0x7c));var _0x7431=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4317[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x7431('0x0'));var moment=require(_0x7431('0x1'));var BPromise=require(_0x7431('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7431('0x3'));var db=require(_0x7431('0x4'))['db'];var utils=require(_0x7431('0x5'));var logger=require(_0x7431('0x6'))(_0x7431('0x7'));var config=require(_0x7431('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7431('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x76fcb5,_0x31fd44,_0x328945){return new BPromise(function(_0x4650df,_0x23e688){return client[_0x7431('0xa')](_0x76fcb5,_0x328945)[_0x7431('0xb')](function(_0xccbaee){logger[_0x7431('0xc')](_0x7431('0xd'),_0x31fd44,_0x7431('0xe'));logger[_0x7431('0xf')](_0x7431('0x10'),_0x31fd44,_0x7431('0xe'),JSON[_0x7431('0x11')](_0xccbaee));if(_0xccbaee[_0x7431('0x12')]){if(_0xccbaee[_0x7431('0x12')][_0x7431('0x13')]===0x1f4){logger[_0x7431('0x12')](_0x7431('0xd'),_0x31fd44,_0xccbaee[_0x7431('0x12')][_0x7431('0x14')]);return _0x23e688(_0xccbaee[_0x7431('0x12')]['message']);}logger[_0x7431('0x12')](_0x7431('0xd'),_0x31fd44,_0xccbaee[_0x7431('0x12')]['message']);return _0x4650df(_0xccbaee[_0x7431('0x12')][_0x7431('0x14')]);}else{logger[_0x7431('0xc')]('Automation,\x20%s,\x20%s',_0x31fd44,_0x7431('0xe'));_0x4650df(_0xccbaee['result']['message']);}})['catch'](function(_0x245ed0){logger[_0x7431('0x12')](_0x7431('0xd'),_0x31fd44,_0x245ed0);_0x23e688(_0x245ed0);});});} \ No newline at end of file +var _0x444e=['client','http','request','then','request\x20sent','debug','error','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x560485,_0x244601){var _0x3e7f69=function(_0x45529f){while(--_0x45529f){_0x560485['push'](_0x560485['shift']());}};_0x3e7f69(++_0x244601);}(_0x444e,0xe8));var _0xe444=function(_0x544b85,_0x4a0924){_0x544b85=_0x544b85-0x0;var _0x183b83=_0x444e[_0x544b85];return _0x183b83;};'use strict';var _=require(_0xe444('0x0'));var util=require('util');var moment=require(_0xe444('0x1'));var BPromise=require('bluebird');var rs=require(_0xe444('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe444('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe444('0x4'))(_0xe444('0x5'));var config=require(_0xe444('0x6'));var jayson=require(_0xe444('0x7'));var client=jayson[_0xe444('0x8')][_0xe444('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4834c7,_0xfbd88b,_0x4b5b7d){return new BPromise(function(_0x29a2b7,_0x482b98){return client[_0xe444('0xa')](_0x4834c7,_0x4b5b7d)[_0xe444('0xb')](function(_0x40a368){logger['info']('Automation,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'));logger[_0xe444('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0xfbd88b,_0xe444('0xc'),JSON['stringify'](_0x40a368));if(_0x40a368['error']){if(_0x40a368[_0xe444('0xe')]['code']===0x1f4){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x482b98(_0x40a368['error']['message']);}logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x40a368['error'][_0xe444('0x10')]);return _0x29a2b7(_0x40a368['error'][_0xe444('0x10')]);}else{logger[_0xe444('0x11')](_0xe444('0xf'),_0xfbd88b,_0xe444('0xc'));_0x29a2b7(_0x40a368[_0xe444('0x12')][_0xe444('0x10')]);}})[_0xe444('0x13')](function(_0x3e1b57){logger[_0xe444('0xe')](_0xe444('0xf'),_0xfbd88b,_0x3e1b57);_0x482b98(_0x3e1b57);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 477a3af..8d207d5 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 _0x8fb3=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','show','/:id/conditions','getConditions','getActions','post','create','addConditions','addActions','put','update','delete','destroy','exports'];(function(_0x5d07ff,_0x1f976f){var _0x5226ad=function(_0x1653a4){while(--_0x1653a4){_0x5d07ff['push'](_0x5d07ff['shift']());}};_0x5226ad(++_0x1f976f);}(_0x8fb3,0x150));var _0x38fb=function(_0x2d5076,_0x559c58){_0x2d5076=_0x2d5076-0x0;var _0x368f5c=_0x8fb3[_0x2d5076];return _0x368f5c;};'use strict';var multer=require(_0x38fb('0x0'));var util=require(_0x38fb('0x1'));var path=require(_0x38fb('0x2'));var timeout=require(_0x38fb('0x3'));var express=require('express');var router=express[_0x38fb('0x4')]();var auth=require(_0x38fb('0x5'));var interaction=require(_0x38fb('0x6'));var config=require(_0x38fb('0x7'));var controller=require(_0x38fb('0x8'));router['get']('/',auth[_0x38fb('0x9')](),controller['index']);router[_0x38fb('0xa')]('/:id',auth[_0x38fb('0x9')](),controller[_0x38fb('0xb')]);router['get'](_0x38fb('0xc'),auth[_0x38fb('0x9')](),controller[_0x38fb('0xd')]);router[_0x38fb('0xa')]('/:id/actions',auth[_0x38fb('0x9')](),controller[_0x38fb('0xe')]);router[_0x38fb('0xf')]('/',auth['isAuthenticated'](),controller[_0x38fb('0x10')]);router[_0x38fb('0xf')](_0x38fb('0xc'),auth[_0x38fb('0x9')](),controller[_0x38fb('0x11')]);router[_0x38fb('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x38fb('0x12')]);router[_0x38fb('0x13')]('/:id',auth[_0x38fb('0x9')](),controller[_0x38fb('0x14')]);router[_0x38fb('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x38fb('0x16')]);module[_0x38fb('0x17')]=router; \ No newline at end of file +var _0x6538=['create','addActions','put','update','delete','exports','util','path','express','../../config/environment','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post'];(function(_0x2da00c,_0x116136){var _0x1abd08=function(_0x52729e){while(--_0x52729e){_0x2da00c['push'](_0x2da00c['shift']());}};_0x1abd08(++_0x116136);}(_0x6538,0x9e));var _0x8653=function(_0x4b2251,_0x393f10){_0x4b2251=_0x4b2251-0x0;var _0x5d22fb=_0x6538[_0x4b2251];return _0x5d22fb;};'use strict';var multer=require('multer');var util=require(_0x8653('0x0'));var path=require(_0x8653('0x1'));var timeout=require('connect-timeout');var express=require(_0x8653('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8653('0x3'));var controller=require('./automation.controller');router[_0x8653('0x4')]('/',auth[_0x8653('0x5')](),controller['index']);router[_0x8653('0x4')](_0x8653('0x6'),auth[_0x8653('0x5')](),controller[_0x8653('0x7')]);router['get'](_0x8653('0x8'),auth['isAuthenticated'](),controller[_0x8653('0x9')]);router[_0x8653('0x4')](_0x8653('0xa'),auth[_0x8653('0x5')](),controller[_0x8653('0xb')]);router[_0x8653('0xc')]('/',auth[_0x8653('0x5')](),controller[_0x8653('0xd')]);router[_0x8653('0xc')](_0x8653('0x8'),auth['isAuthenticated'](),controller['addConditions']);router[_0x8653('0xc')](_0x8653('0xa'),auth[_0x8653('0x5')](),controller[_0x8653('0xe')]);router[_0x8653('0xf')](_0x8653('0x6'),auth['isAuthenticated'](),controller[_0x8653('0x10')]);router[_0x8653('0x11')](_0x8653('0x6'),auth[_0x8653('0x5')](),controller['destroy']);module[_0x8653('0x12')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index b9d1626..1870499 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 _0xe611=['ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','exports','STRING','name'];(function(_0x3d9823,_0xf7f6be){var _0x2ecec4=function(_0x4ff42a){while(--_0x4ff42a){_0x3d9823['push'](_0x3d9823['shift']());}};_0x2ecec4(++_0xf7f6be);}(_0xe611,0x8e));var _0x1e61=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xe611[_0x6cf19c];return _0xce14f3;};'use strict';var Sequelize=require('sequelize');module[_0x1e61('0x0')]={'name':{'type':Sequelize[_0x1e61('0x1')],'unique':_0x1e61('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1e61('0x3')),'allowNull':![],'defaultValue':_0x1e61('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x1e61('0x4')],'defaultValue':0x0,'comment':_0x1e61('0x5')},'limitCalls':{'type':Sequelize[_0x1e61('0x6')](0x4)[_0x1e61('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1e61('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1e61('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x1e61('0x6')](0x3)[_0x1e61('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e61('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1e61('0x6')](0x3)[_0x1e61('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1e61('0x6')](0x5)[_0x1e61('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e61('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x1e61('0x6')](0x3)[_0x1e61('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1e61('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1e61('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1e61('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1e61('0x6')](0x3)[_0x1e61('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1e61('0x6')](0x5)[_0x1e61('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1e61('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x1e61('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1e61('0x1')],'defaultValue':_0x1e61('0xd')},'dialCheckDuplicateType':{'type':Sequelize[_0x1e61('0xe')](_0x1e61('0xf'),_0x1e61('0x10'),_0x1e61('0x11')),'defaultValue':_0x1e61('0xf')},'dialAMDActive':{'type':Sequelize[_0x1e61('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1e61('0x6')](0x9)[_0x1e61('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1e61('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x1e61('0x6')](0x9)[_0x1e61('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1e61('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1e61('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1e61('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x1e61('0x6')](0x9)[_0x1e61('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1e61('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1e61('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1e61('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1e61('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1e61('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1e61('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1e61('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1e61('0x6')](0x9)[_0x1e61('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1e61('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1e61('0xe')](_0x1e61('0x19'),_0x1e61('0x1a')),'defaultValue':_0x1e61('0x19')},'dialPrefix':{'type':Sequelize[_0x1e61('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1e61('0x6')](0x3)[_0x1e61('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1e61('0x1b')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x1e61('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1e61('0x1c')}}; \ No newline at end of file +var _0xe91c=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never','always','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#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)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xe91c,0x157));var _0xce91=function(_0x441db4,_0x1fabed){_0x441db4=_0x441db4-0x0;var _0x4bed40=_0xe91c[_0x441db4];return _0x4bed40;};'use strict';var Sequelize=require(_0xce91('0x0'));module[_0xce91('0x1')]={'name':{'type':Sequelize[_0xce91('0x2')],'unique':_0xce91('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xce91('0x4')](_0xce91('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xce91('0x2')]},'active':{'type':Sequelize[_0xce91('0x6')],'defaultValue':0x0,'comment':_0xce91('0x7')},'limitCalls':{'type':Sequelize[_0xce91('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xce91('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xce91('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xce91('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce91('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xce91('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce91('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xce91('0x8')](0x5)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce91('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xce91('0xe')},'dialBusyRetryFrequency':{'type':Sequelize[_0xce91('0x8')](0x5)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce91('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xce91('0x8')](0x5)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xce91('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xce91('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xce91('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xce91('0x4')]('always',_0xce91('0x12'),'onlyIfOpen'),'defaultValue':_0xce91('0x13')},'dialAMDActive':{'type':Sequelize[_0xce91('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xce91('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xce91('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xce91('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xce91('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xce91('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xce91('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xce91('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xce91('0x8')](0x9)[_0xce91('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xce91('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xce91('0x1a'),_0xce91('0x1b')),'defaultValue':_0xce91('0x1a')},'dialPrefix':{'type':Sequelize[_0xce91('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xce91('0x1c')},'dialCutDigit':{'type':Sequelize[_0xce91('0x8')](0x3)[_0xce91('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xce91('0x1d')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index ed5639c..bd9faf6 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 _0x0102=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','IvrCampaigns','end','error','stack','name','send','index','Campaign','rawAttributes','query','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','includeAll','include','findAll','catch','show','keys','length','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','getHoppers','findOne','hasOwnProperty','CampaignId','map','CmHopper','rows','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','ContactId','CmListId','toString','NOW()','from','cm_contacts','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','push','removeLists','addBlackLists','cm_hopper_black','deletedAt\x20IS\x20NULL','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2f0972,_0x2b7f19){var _0x1a67fc=function(_0x3954c2){while(--_0x3954c2){_0x2f0972['push'](_0x2f0972['shift']());}};_0x1a67fc(++_0x2b7f19);}(_0x0102,0x186));var _0x2010=function(_0x3b98a2,_0x291dbb){_0x3b98a2=_0x3b98a2-0x0;var _0x2e5ebf=_0x0102[_0x3b98a2];return _0x2e5ebf;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2010('0x0'));var rimraf=require(_0x2010('0x1'));var zipdir=require(_0x2010('0x2'));var jsonpatch=require(_0x2010('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x2010('0x4'));var sox=require(_0x2010('0x5'));var csv=require(_0x2010('0x6'));var ejs=require(_0x2010('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var hardwareService=require(_0x2010('0x10'));var logger=require(_0x2010('0x11'))(_0x2010('0x12'));var utils=require(_0x2010('0x13'));var config=require(_0x2010('0x14'));var db=require(_0x2010('0x15'))['db'];function respondWithStatusCode(_0x32fe2e,_0x2d09c5){_0x2d09c5=_0x2d09c5||0xcc;return function(_0x3f307c){if(_0x3f307c){return _0x32fe2e[_0x2010('0x16')](_0x2d09c5);}return _0x32fe2e[_0x2010('0x17')](_0x2d09c5)['end']();};}function respondWithResult(_0x579340,_0x3be3d3){_0x3be3d3=_0x3be3d3||0xc8;return function(_0x385720){if(_0x385720){return _0x579340[_0x2010('0x17')](_0x3be3d3)[_0x2010('0x18')](_0x385720);}};}function respondWithFilteredResult(_0x32d791,_0x335be4){return function(_0x517ff4){if(_0x517ff4){var _0x3195fa=_0x517ff4[_0x2010('0x19')],_0x136418=_0x335be4[_0x2010('0x1a')],_0x5ad412=_0x335be4[_0x2010('0x1a')]+_0x335be4[_0x2010('0x1b')],_0x41e267;if(_0x5ad412>=_0x3195fa){_0x5ad412=_0x3195fa;_0x41e267=0xc8;}else{_0x41e267=0xce;}_0x32d791[_0x2010('0x17')](_0x41e267);return _0x32d791[_0x2010('0x1c')](_0x2010('0x1d'),_0x136418+'-'+_0x5ad412+'/'+_0x3195fa)[_0x2010('0x18')](_0x517ff4);}return null;};}function patchUpdates(_0x569de2){return function(_0x559ed6){try{jsonpatch[_0x2010('0x1e')](_0x559ed6,_0x569de2,!![]);}catch(_0x38a15a){return BPromise[_0x2010('0x1f')](_0x38a15a);}return _0x559ed6[_0x2010('0x20')]();};}function saveUpdates(_0x569a79,_0x51075e){return function(_0x22c252){if(_0x22c252){return _0x22c252[_0x2010('0x21')](_0x569a79)[_0x2010('0x22')](function(_0x26facc){return _0x26facc;});}return null;};}function removeEntity(_0x103bbc,_0x131a26){return function(_0x4f621c){if(_0x4f621c){return _0x4f621c[_0x2010('0x23')]()[_0x2010('0x22')](function(){var _0x58ff30=_0x4f621c['get']({'plain':!![]});var _0x50aecc=_0x2010('0x24');return db['UserProfileResource'][_0x2010('0x23')]({'where':{'type':_0x50aecc,'resourceId':_0x58ff30['id']}})['then'](function(){return _0x4f621c;});})['then'](function(){_0x103bbc[_0x2010('0x17')](0xcc)[_0x2010('0x25')]();});}};}function handleEntityNotFound(_0x52b4fe,_0x99ebe0){return function(_0x4cff59){if(!_0x4cff59){_0x52b4fe[_0x2010('0x16')](0x194);}return _0x4cff59;};}function handleError(_0x27b425,_0x3929d9){_0x3929d9=_0x3929d9||0x1f4;return function(_0x3dcea4){logger[_0x2010('0x26')](_0x3dcea4[_0x2010('0x27')]);if(_0x3dcea4[_0x2010('0x28')]){delete _0x3dcea4[_0x2010('0x28')];}_0x27b425[_0x2010('0x17')](_0x3929d9)[_0x2010('0x29')](_0x3dcea4);};}exports[_0x2010('0x2a')]=function(_0x2ebdbb,_0x499cbe){var _0x2a4691={},_0x52fe5e={},_0x5b52fb={'count':0x0,'rows':[]};var _0x147a5a=db[_0x2010('0x2b')][_0x2010('0x2c')];_0x52fe5e['model']=_['keys'](_0x147a5a);_0x52fe5e[_0x2010('0x2d')]=_['keys'](_0x2ebdbb[_0x2010('0x2d')]);_0x52fe5e[_0x2010('0x2e')]=_['intersection'](_0x52fe5e[_0x2010('0x2f')],_0x52fe5e[_0x2010('0x2d')]);_0x2a4691[_0x2010('0x30')]=_[_0x2010('0x31')](_0x52fe5e[_0x2010('0x2f')],qs['fields'](_0x2ebdbb[_0x2010('0x2d')][_0x2010('0x32')]));_0x2a4691[_0x2010('0x30')]=_0x2a4691['attributes']['length']?_0x2a4691[_0x2010('0x30')]:_0x52fe5e[_0x2010('0x2f')];if(!_0x2ebdbb[_0x2010('0x2d')]['hasOwnProperty']('nolimit')){_0x2a4691[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x2ebdbb[_0x2010('0x2d')][_0x2010('0x1b')]);_0x2a4691[_0x2010('0x1a')]=qs['offset'](_0x2ebdbb['query']['offset']);}_0x2a4691[_0x2010('0x33')]=qs[_0x2010('0x34')](_0x2ebdbb[_0x2010('0x2d')]['sort']);_0x2a4691[_0x2010('0x35')]=qs[_0x2010('0x2e')](_[_0x2010('0x36')](_0x2ebdbb[_0x2010('0x2d')],_0x52fe5e['filters']));if(_0x2ebdbb[_0x2010('0x2d')][_0x2010('0x37')]){_0x2a4691[_0x2010('0x35')]=_['merge'](_0x2a4691[_0x2010('0x35')],{'$or':_['map'](_0x147a5a,function(_0x13f88a){if(_0x13f88a[_0x2010('0x38')][_0x2010('0x39')]!==_0x2010('0x3a')){var _0x7b4a4d={};_0x7b4a4d[_0x13f88a[_0x2010('0x3b')]]={'$like':'%'+_0x2ebdbb['query'][_0x2010('0x37')]+'%'};return _0x7b4a4d;}})});}_0x2a4691=_['merge']({},_0x2a4691,_0x2ebdbb[_0x2010('0x3c')]);var _0x157c73={'where':_0x2a4691[_0x2010('0x35')]};return db[_0x2010('0x2b')][_0x2010('0x19')](_0x157c73)[_0x2010('0x22')](function(_0x398f10){_0x5b52fb[_0x2010('0x19')]=_0x398f10;if(_0x2ebdbb[_0x2010('0x2d')][_0x2010('0x3d')]){_0x2a4691[_0x2010('0x3e')]=[{'all':!![]}];}return db[_0x2010('0x2b')][_0x2010('0x3f')](_0x2a4691);})[_0x2010('0x22')](function(_0x4b6251){_0x5b52fb['rows']=_0x4b6251;return _0x5b52fb;})[_0x2010('0x22')](respondWithFilteredResult(_0x499cbe,_0x2a4691))[_0x2010('0x40')](handleError(_0x499cbe,null));};exports[_0x2010('0x41')]=function(_0x35d631,_0x3d5906){var _0x5a38ee={'raw':![],'where':{'id':_0x35d631['params']['id']}},_0x2ae88e={};_0x2ae88e[_0x2010('0x2f')]=_['keys'](db[_0x2010('0x2b')][_0x2010('0x2c')]);_0x2ae88e[_0x2010('0x2d')]=_[_0x2010('0x42')](_0x35d631[_0x2010('0x2d')]);_0x2ae88e['filters']=_[_0x2010('0x31')](_0x2ae88e[_0x2010('0x2f')],_0x2ae88e[_0x2010('0x2d')]);_0x5a38ee[_0x2010('0x30')]=_['intersection'](_0x2ae88e[_0x2010('0x2f')],qs['fields'](_0x35d631['query']['fields']));_0x5a38ee[_0x2010('0x30')]=_0x5a38ee[_0x2010('0x30')][_0x2010('0x43')]?_0x5a38ee[_0x2010('0x30')]:_0x2ae88e[_0x2010('0x2f')];if(_0x35d631[_0x2010('0x2d')]['includeAll']){_0x5a38ee[_0x2010('0x3e')]=[{'all':!![]}];}_0x5a38ee=_[_0x2010('0x44')]({},_0x5a38ee,_0x35d631[_0x2010('0x3c')]);return db['Campaign']['find'](_0x5a38ee)[_0x2010('0x22')](handleEntityNotFound(_0x3d5906,null))['then'](respondWithResult(_0x3d5906,null))[_0x2010('0x40')](handleError(_0x3d5906,null));};exports[_0x2010('0x45')]=function(_0x12176e,_0x1f1f31){return db['Campaign'][_0x2010('0x45')](_0x12176e[_0x2010('0x46')],{})[_0x2010('0x22')](function(_0x231db7){var _0x3ec24c=_0x12176e[_0x2010('0x47')]['get']({'plain':!![]});if(!_0x3ec24c)throw new Error(_0x2010('0x48'));if(_0x3ec24c[_0x2010('0x49')]===_0x2010('0x47')){var _0x4dc0cf=_0x231db7[_0x2010('0x4a')]({'plain':!![]});var _0x1dd027='IvrCampaigns';return db[_0x2010('0x4b')][_0x2010('0x4c')]({'where':{'name':_0x1dd027,'userProfileId':_0x3ec24c[_0x2010('0x4d')]},'raw':!![]})[_0x2010('0x22')](function(_0x307ab6){if(_0x307ab6&&_0x307ab6[_0x2010('0x4e')]===0x0){return db[_0x2010('0x4f')][_0x2010('0x45')]({'name':_0x4dc0cf['name'],'resourceId':_0x4dc0cf['id'],'type':_0x307ab6['name'],'sectionId':_0x307ab6['id']},{})[_0x2010('0x22')](function(){return _0x231db7;});}else{return _0x231db7;}})[_0x2010('0x40')](function(_0x5397f4){logger[_0x2010('0x26')](_0x2010('0x50'),_0x5397f4);throw _0x5397f4;});}return _0x231db7;})[_0x2010('0x22')](respondWithResult(_0x1f1f31,0xc9))[_0x2010('0x40')](handleError(_0x1f1f31,null));};exports[_0x2010('0x51')]=function(_0x506943,_0x5f4e98){var _0x3fca06={'raw':![],'where':{'id':_0x506943[_0x2010('0x52')]['id']}},_0x137452={};_0x137452[_0x2010('0x2f')]=_[_0x2010('0x42')](db[_0x2010('0x2b')][_0x2010('0x2c')]);_0x3fca06[_0x2010('0x30')]=_[_0x2010('0x31')](_0x137452[_0x2010('0x2f')],qs[_0x2010('0x32')](_0x506943['query'][_0x2010('0x32')]));_0x3fca06[_0x2010('0x30')]=_0x3fca06['attributes'][_0x2010('0x43')]?_0x3fca06[_0x2010('0x30')]:_0x137452[_0x2010('0x2f')];if(_0x506943[_0x2010('0x2d')][_0x2010('0x3d')]){_0x3fca06[_0x2010('0x3e')]=[{'all':!![]}];}_0x3fca06=_[_0x2010('0x44')]({},_0x3fca06,_0x506943[_0x2010('0x3c')]);return db[_0x2010('0x2b')][_0x2010('0x4c')](_0x3fca06)[_0x2010('0x22')](handleEntityNotFound(_0x5f4e98,null))[_0x2010('0x22')](function(_0x17058a){if(_0x17058a){var _0x87ff30=_0x17058a[_0x2010('0x4a')]({'plain':!![]});_0x87ff30=qs[_0x2010('0x53')](_0x87ff30,['id',_0x2010('0x54'),_0x2010('0x55')]);_0x506943[_0x2010('0x46')]=_[_0x2010('0x53')](_0x506943[_0x2010('0x46')],['id',_0x2010('0x54'),_0x2010('0x55')]);return db['Campaign'][_0x2010('0x45')](_['merge'](_0x87ff30,_0x506943['body']),{'include':_0x506943[_0x2010('0x2d')][_0x2010('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0x4d124e){var _0x268543=_0x506943[_0x2010('0x47')][_0x2010('0x4a')]({'plain':!![]});if(!_0x268543)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x268543[_0x2010('0x49')]===_0x2010('0x47')){var _0x343687=_0x4d124e[_0x2010('0x4a')]({'plain':!![]});var _0x4b4145=_0x2010('0x24');return db['UserProfileSection'][_0x2010('0x4c')]({'where':{'name':_0x4b4145,'userProfileId':_0x268543[_0x2010('0x4d')]},'raw':!![]})[_0x2010('0x22')](function(_0x3cca53){if(_0x3cca53&&_0x3cca53['autoAssociation']===0x0){return db['UserProfileResource'][_0x2010('0x45')]({'name':_0x343687[_0x2010('0x28')],'resourceId':_0x343687['id'],'type':_0x3cca53['name'],'sectionId':_0x3cca53['id']},{})['then'](function(){return _0x4d124e;});}else{return _0x4d124e;}})[_0x2010('0x40')](function(_0x1b7387){logger[_0x2010('0x26')](_0x2010('0x50'),_0x1b7387);throw _0x1b7387;});}return _0x4d124e;});}})['then'](respondWithResult(_0x5f4e98,0xc9))[_0x2010('0x40')](handleError(_0x5f4e98,null));};exports['update']=function(_0x2f8160,_0x28df61){if(_0x2f8160[_0x2010('0x46')]['id']){delete _0x2f8160[_0x2010('0x46')]['id'];}return db['Campaign'][_0x2010('0x4c')]({'where':{'id':_0x2f8160[_0x2010('0x52')]['id']}})['then'](handleEntityNotFound(_0x28df61,null))[_0x2010('0x22')](saveUpdates(_0x2f8160[_0x2010('0x46')],null))[_0x2010('0x22')](respondWithResult(_0x28df61,null))[_0x2010('0x40')](handleError(_0x28df61,null));};exports[_0x2010('0x23')]=function(_0x8df400,_0x548273){return db[_0x2010('0x2b')][_0x2010('0x4c')]({'where':{'id':_0x8df400[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x548273,null))[_0x2010('0x22')](removeEntity(_0x548273,null))['catch'](handleError(_0x548273,null));};exports[_0x2010('0x56')]=function(_0x1d479e,_0x124f3e,_0x5f5230){var _0x5ca75a={'raw':!![],'where':{}};var _0x24466f={};var _0x16c583={'count':0x0,'rows':[]};return db[_0x2010('0x2b')][_0x2010('0x57')]({'where':{'id':_0x1d479e[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x124f3e,null))['then'](function(_0xe37cef){if(_0xe37cef){_0x24466f[_0x2010('0x2f')]=_[_0x2010('0x42')](db['CmHopper'][_0x2010('0x2c')]);_0x24466f[_0x2010('0x2d')]=_[_0x2010('0x42')](_0x1d479e['query']);_0x24466f[_0x2010('0x2e')]=_[_0x2010('0x31')](_0x24466f['model'],_0x24466f['query']);_0x5ca75a[_0x2010('0x30')]=_['intersection'](_0x24466f['model'],qs[_0x2010('0x32')](_0x1d479e[_0x2010('0x2d')][_0x2010('0x32')]));_0x5ca75a[_0x2010('0x30')]=_0x5ca75a[_0x2010('0x30')][_0x2010('0x43')]?_0x5ca75a[_0x2010('0x30')]:_0x24466f[_0x2010('0x2f')];if(!_0x1d479e[_0x2010('0x2d')][_0x2010('0x58')]('nolimit')){_0x5ca75a[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x1d479e['query'][_0x2010('0x1b')]);_0x5ca75a[_0x2010('0x1a')]=qs[_0x2010('0x1a')](_0x1d479e[_0x2010('0x2d')]['offset']);}_0x5ca75a[_0x2010('0x33')]=qs[_0x2010('0x34')](_0x1d479e['query']['sort']);_0x5ca75a[_0x2010('0x35')]=qs['filters'](_[_0x2010('0x36')](_0x1d479e[_0x2010('0x2d')],_0x24466f[_0x2010('0x2e')]));_0x5ca75a[_0x2010('0x35')][_0x2010('0x59')]=_0xe37cef['id'];if(_0x1d479e[_0x2010('0x2d')][_0x2010('0x37')]){_0x5ca75a['where']=_[_0x2010('0x44')](_0x5ca75a[_0x2010('0x35')],{'$or':_[_0x2010('0x5a')](_0x5ca75a['attributes'],function(_0x421016){var _0x340a20={};_0x340a20[_0x421016]={'$like':'%'+_0x1d479e[_0x2010('0x2d')][_0x2010('0x37')]+'%'};return _0x340a20;})});}_0x5ca75a=_[_0x2010('0x44')]({},_0x5ca75a,_0x1d479e[_0x2010('0x3c')]);return db[_0x2010('0x5b')][_0x2010('0x19')]({'where':_0x5ca75a['where']})[_0x2010('0x22')](function(_0x42f536){_0x16c583[_0x2010('0x19')]=_0x42f536;if(_0x1d479e['query'][_0x2010('0x3d')]){_0x5ca75a[_0x2010('0x3e')]=[{'all':!![]}];}return db['CmHopper'][_0x2010('0x3f')](_0x5ca75a);})[_0x2010('0x22')](function(_0x249959){_0x16c583[_0x2010('0x5c')]=_0x249959;return _0x16c583;});}})[_0x2010('0x22')](respondWithFilteredResult(_0x124f3e,_0x5ca75a))['catch'](handleError(_0x124f3e,null));};exports[_0x2010('0x5d')]=function(_0x31e669,_0x57201d,_0x31df61){var _0x3f31db={'raw':!![],'where':{}};var _0x512d98={};var _0xdc9f3c={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x31e669[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x57201d,null))[_0x2010('0x22')](function(_0xaec051){if(_0xaec051){_0x512d98[_0x2010('0x2f')]=_[_0x2010('0x42')](db['CmHopperHistory'][_0x2010('0x2c')]);_0x512d98[_0x2010('0x2d')]=_[_0x2010('0x42')](_0x31e669[_0x2010('0x2d')]);_0x512d98['filters']=_[_0x2010('0x31')](_0x512d98['model'],_0x512d98[_0x2010('0x2d')]);_0x3f31db[_0x2010('0x30')]=_[_0x2010('0x31')](_0x512d98[_0x2010('0x2f')],qs['fields'](_0x31e669['query']['fields']));_0x3f31db[_0x2010('0x30')]=_0x3f31db['attributes'][_0x2010('0x43')]?_0x3f31db[_0x2010('0x30')]:_0x512d98['model'];if(!_0x31e669[_0x2010('0x2d')]['hasOwnProperty'](_0x2010('0x5e'))){_0x3f31db[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x31e669[_0x2010('0x2d')]['limit']);_0x3f31db['offset']=qs['offset'](_0x31e669[_0x2010('0x2d')][_0x2010('0x1a')]);}_0x3f31db['order']=qs[_0x2010('0x34')](_0x31e669['query'][_0x2010('0x34')]);_0x3f31db[_0x2010('0x35')]=qs[_0x2010('0x2e')](_[_0x2010('0x36')](_0x31e669[_0x2010('0x2d')],_0x512d98[_0x2010('0x2e')]));_0x3f31db[_0x2010('0x35')]['CampaignId']=_0xaec051['id'];if(_0x31e669[_0x2010('0x2d')][_0x2010('0x37')]){_0x3f31db['where']=_[_0x2010('0x44')](_0x3f31db[_0x2010('0x35')],{'$or':_[_0x2010('0x5a')](_0x3f31db[_0x2010('0x30')],function(_0x14f64b){var _0x105cf0={};_0x105cf0[_0x14f64b]={'$like':'%'+_0x31e669[_0x2010('0x2d')][_0x2010('0x37')]+'%'};return _0x105cf0;})});}_0x3f31db=_[_0x2010('0x44')]({},_0x3f31db,_0x31e669['options']);return db[_0x2010('0x5f')][_0x2010('0x19')]({'where':_0x3f31db[_0x2010('0x35')]})['then'](function(_0x52c31a){_0xdc9f3c[_0x2010('0x19')]=_0x52c31a;if(_0x31e669[_0x2010('0x2d')][_0x2010('0x3d')]){_0x3f31db[_0x2010('0x3e')]=[{'all':!![]}];}return db[_0x2010('0x5f')][_0x2010('0x3f')](_0x3f31db);})[_0x2010('0x22')](function(_0x3fce95){_0xdc9f3c[_0x2010('0x5c')]=_0x3fce95;return _0xdc9f3c;});}})['then'](respondWithFilteredResult(_0x57201d,_0x3f31db))[_0x2010('0x40')](handleError(_0x57201d,null));};exports[_0x2010('0x60')]=function(_0x216f3b,_0xa82017,_0x77fda0){var _0x26189d={'raw':!![],'where':{}};var _0x596e39={};var _0x4b1124={'count':0x0,'rows':[]};return db[_0x2010('0x2b')][_0x2010('0x57')]({'where':{'id':_0x216f3b[_0x2010('0x52')]['id']}})['then'](handleEntityNotFound(_0xa82017,null))['then'](function(_0x5dc6b4){if(_0x5dc6b4){_0x596e39[_0x2010('0x2f')]=_['keys'](db[_0x2010('0x61')][_0x2010('0x2c')]);_0x596e39[_0x2010('0x2d')]=_[_0x2010('0x42')](_0x216f3b[_0x2010('0x2d')]);_0x596e39[_0x2010('0x2e')]=_['intersection'](_0x596e39[_0x2010('0x2f')],_0x596e39[_0x2010('0x2d')]);_0x26189d[_0x2010('0x30')]=_[_0x2010('0x31')](_0x596e39['model'],qs[_0x2010('0x32')](_0x216f3b[_0x2010('0x2d')][_0x2010('0x32')]));_0x26189d[_0x2010('0x30')]=_0x26189d[_0x2010('0x30')][_0x2010('0x43')]?_0x26189d[_0x2010('0x30')]:_0x596e39[_0x2010('0x2f')];if(!_0x216f3b[_0x2010('0x2d')][_0x2010('0x58')](_0x2010('0x5e'))){_0x26189d[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x216f3b[_0x2010('0x2d')]['limit']);_0x26189d[_0x2010('0x1a')]=qs[_0x2010('0x1a')](_0x216f3b[_0x2010('0x2d')][_0x2010('0x1a')]);}_0x26189d['order']=qs[_0x2010('0x34')](_0x216f3b['query'][_0x2010('0x34')]);_0x26189d[_0x2010('0x35')]=qs[_0x2010('0x2e')](_[_0x2010('0x36')](_0x216f3b[_0x2010('0x2d')],_0x596e39[_0x2010('0x2e')]));_0x26189d['where'][_0x2010('0x59')]=_0x5dc6b4['id'];if(_0x216f3b['query'][_0x2010('0x37')]){_0x26189d['where']=_['merge'](_0x26189d[_0x2010('0x35')],{'$or':_[_0x2010('0x5a')](_0x26189d['attributes'],function(_0x4b2942){var _0x41ec73={};_0x41ec73[_0x4b2942]={'$like':'%'+_0x216f3b['query'][_0x2010('0x37')]+'%'};return _0x41ec73;})});}_0x26189d=_[_0x2010('0x44')]({},_0x26189d,_0x216f3b['options']);return db[_0x2010('0x61')][_0x2010('0x19')]({'where':_0x26189d[_0x2010('0x35')]})['then'](function(_0x5c4b10){_0x4b1124[_0x2010('0x19')]=_0x5c4b10;if(_0x216f3b['query'][_0x2010('0x3d')]){_0x26189d['include']=[{'all':!![]}];}return db[_0x2010('0x61')][_0x2010('0x3f')](_0x26189d);})[_0x2010('0x22')](function(_0x19c9b3){_0x4b1124[_0x2010('0x5c')]=_0x19c9b3;return _0x4b1124;});}})[_0x2010('0x22')](respondWithFilteredResult(_0xa82017,_0x26189d))['catch'](handleError(_0xa82017,null));};exports['getHopperBlacks']=function(_0x17caab,_0x229cb7,_0x549504){var _0x455928={'raw':!![],'where':{}};var _0x1f8ed5={};var _0x476c1e={'count':0x0,'rows':[]};return db[_0x2010('0x2b')][_0x2010('0x57')]({'where':{'id':_0x17caab['params']['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x229cb7,null))[_0x2010('0x22')](function(_0x492b29){if(_0x492b29){_0x1f8ed5[_0x2010('0x2f')]=_[_0x2010('0x42')](db[_0x2010('0x62')][_0x2010('0x2c')]);_0x1f8ed5[_0x2010('0x2d')]=_[_0x2010('0x42')](_0x17caab['query']);_0x1f8ed5[_0x2010('0x2e')]=_[_0x2010('0x31')](_0x1f8ed5['model'],_0x1f8ed5[_0x2010('0x2d')]);_0x455928[_0x2010('0x30')]=_[_0x2010('0x31')](_0x1f8ed5[_0x2010('0x2f')],qs[_0x2010('0x32')](_0x17caab[_0x2010('0x2d')]['fields']));_0x455928['attributes']=_0x455928[_0x2010('0x30')][_0x2010('0x43')]?_0x455928[_0x2010('0x30')]:_0x1f8ed5[_0x2010('0x2f')];if(!_0x17caab[_0x2010('0x2d')]['hasOwnProperty']('nolimit')){_0x455928['limit']=qs[_0x2010('0x1b')](_0x17caab[_0x2010('0x2d')]['limit']);_0x455928[_0x2010('0x1a')]=qs['offset'](_0x17caab[_0x2010('0x2d')]['offset']);}_0x455928[_0x2010('0x33')]=qs[_0x2010('0x34')](_0x17caab[_0x2010('0x2d')][_0x2010('0x34')]);_0x455928[_0x2010('0x35')]=qs[_0x2010('0x2e')](_['pick'](_0x17caab[_0x2010('0x2d')],_0x1f8ed5[_0x2010('0x2e')]));_0x455928[_0x2010('0x35')]['CampaignId']=_0x492b29['id'];if(_0x17caab[_0x2010('0x2d')]['filter']){_0x455928[_0x2010('0x35')]=_[_0x2010('0x44')](_0x455928['where'],{'$or':_[_0x2010('0x5a')](_0x455928[_0x2010('0x30')],function(_0x283c4b){var _0x38d2c7={};_0x38d2c7[_0x283c4b]={'$like':'%'+_0x17caab[_0x2010('0x2d')][_0x2010('0x37')]+'%'};return _0x38d2c7;})});}_0x455928=_[_0x2010('0x44')]({},_0x455928,_0x17caab[_0x2010('0x3c')]);return db['CmHopperBlack'][_0x2010('0x19')]({'where':_0x455928[_0x2010('0x35')]})[_0x2010('0x22')](function(_0x4759dd){_0x476c1e['count']=_0x4759dd;if(_0x17caab[_0x2010('0x2d')][_0x2010('0x3d')]){_0x455928[_0x2010('0x3e')]=[{'all':!![]}];}return db[_0x2010('0x62')][_0x2010('0x3f')](_0x455928);})['then'](function(_0x5d40ff){_0x476c1e['rows']=_0x5d40ff;return _0x476c1e;});}})[_0x2010('0x22')](respondWithFilteredResult(_0x229cb7,_0x455928))[_0x2010('0x40')](handleError(_0x229cb7,null));};exports['getLists']=function(_0x53ea05,_0x753636,_0x423001){var _0x33e24f={};var _0x41f9c0={};var _0x1da67b;var _0x5b8dc4;return db[_0x2010('0x2b')]['findOne']({'where':{'id':_0x53ea05[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x753636,null))['then'](function(_0x4108d8){if(_0x4108d8){_0x1da67b=_0x4108d8;_0x41f9c0[_0x2010('0x2f')]=_[_0x2010('0x42')](db[_0x2010('0x63')][_0x2010('0x2c')]);_0x41f9c0['query']=_[_0x2010('0x42')](_0x53ea05[_0x2010('0x2d')]);_0x41f9c0[_0x2010('0x2e')]=_[_0x2010('0x31')](_0x41f9c0[_0x2010('0x2f')],_0x41f9c0[_0x2010('0x2d')]);_0x33e24f[_0x2010('0x30')]=_['intersection'](_0x41f9c0['model'],qs[_0x2010('0x32')](_0x53ea05[_0x2010('0x2d')][_0x2010('0x32')]));_0x33e24f['attributes']=_0x33e24f[_0x2010('0x30')][_0x2010('0x43')]?_0x33e24f['attributes']:_0x41f9c0[_0x2010('0x2f')];_0x33e24f[_0x2010('0x33')]=qs[_0x2010('0x34')](_0x53ea05[_0x2010('0x2d')][_0x2010('0x34')]);_0x33e24f[_0x2010('0x35')]=qs['filters'](_[_0x2010('0x36')](_0x53ea05[_0x2010('0x2d')],_0x41f9c0['filters']));if(_0x53ea05[_0x2010('0x2d')][_0x2010('0x37')]){_0x33e24f['where']=_[_0x2010('0x44')](_0x33e24f[_0x2010('0x35')],{'$or':_[_0x2010('0x5a')](_0x33e24f[_0x2010('0x30')],function(_0x32a417){var _0x211d99={};_0x211d99[_0x32a417]={'$like':'%'+_0x53ea05['query'][_0x2010('0x37')]+'%'};return _0x211d99;})});}_0x33e24f=_[_0x2010('0x44')]({},_0x33e24f,_0x53ea05[_0x2010('0x3c')]);return _0x1da67b[_0x2010('0x64')](_0x33e24f);}})['then'](function(_0x483f91){if(_0x483f91){_0x5b8dc4=_0x483f91[_0x2010('0x43')];if(!_0x53ea05[_0x2010('0x2d')][_0x2010('0x58')](_0x2010('0x5e'))){_0x33e24f[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x53ea05[_0x2010('0x2d')][_0x2010('0x1b')]);_0x33e24f[_0x2010('0x1a')]=qs[_0x2010('0x1a')](_0x53ea05['query']['offset']);}return _0x1da67b[_0x2010('0x64')](_0x33e24f);}})['then'](function(_0x5aff8d){if(_0x5aff8d){return _0x5aff8d?{'count':_0x5b8dc4,'rows':_0x5aff8d}:null;}})['then'](respondWithResult(_0x753636,null))[_0x2010('0x40')](handleError(_0x753636,null));};exports['addLists']=function(_0x17f975,_0x2a0ba8,_0x14bfe2){var _0x4bc997,_0x5136f8;return db[_0x2010('0x2b')][_0x2010('0x4c')]({'where':{'id':_0x17f975[_0x2010('0x52')]['id']}})['then'](handleEntityNotFound(_0x2a0ba8,null))[_0x2010('0x22')](function(_0x2417ff){if(_0x2417ff){_0x5136f8=_0x2417ff;return _0x2417ff[_0x2010('0x65')](_0x17f975[_0x2010('0x46')][_0x2010('0x66')],_['omit'](_0x17f975[_0x2010('0x46')],[_0x2010('0x66'),'id'])||{});}return null;})[_0x2010('0x67')](function(_0x20048b){var _0x275b99;_0x4bc997=_0x20048b||[];var _0x3a597c=[];if(_0x20048b){for(var _0x268311=0x0;_0x268311<_0x20048b[_0x2010('0x43')];_0x268311+=0x1){var _0xbc3a91=_0x20048b[_0x268311]['get']({'plain':!![]});_0x5136f8[_0x2010('0x68')]=_0x17f975['body'][_0x2010('0x68')]?_0x17f975[_0x2010('0x46')][_0x2010('0x68')]:_0x5136f8[_0x2010('0x68')];switch(_0x5136f8[_0x2010('0x68')]){case _0x2010('0x69'):_0x275b99=squel[_0x2010('0x6a')]()['into'](_0x2010('0x6b'))[_0x2010('0x6c')]([_0x2010('0x6d'),_0x2010('0x6e'),'ContactId',_0x2010('0x6f'),_0x2010('0x59'),_0x2010('0x54'),_0x2010('0x55')],squel['select']()[_0x2010('0x3b')]('phone',_0x2010('0x6d'))['field']('NOW()',_0x2010('0x6e'))['field']('id',_0x2010('0x70'))[_0x2010('0x3b')](_0xbc3a91[_0x2010('0x71')][_0x2010('0x72')](),'ListId')[_0x2010('0x3b')](_0x17f975['params']['id'][_0x2010('0x72')](),_0x2010('0x59'))[_0x2010('0x3b')](_0x2010('0x73'),_0x2010('0x54'))['field'](_0x2010('0x73'),_0x2010('0x55'))[_0x2010('0x74')](_0x2010('0x75'))['where']('deletedAt\x20IS\x20NULL')[_0x2010('0x35')]('ListId\x20=\x20?',_0xbc3a91[_0x2010('0x71')][_0x2010('0x72')]())[_0x2010('0x35')]('phone\x20IS\x20NOT\x20NULL')[_0x2010('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x2010('0x76')]()[_0x2010('0x3b')](_0x2010('0x77'))['from'](_0x2010('0x78'))[_0x2010('0x35')](_0x2010('0x79'),_0x17f975[_0x2010('0x52')]['id']['toString']()))[_0x2010('0x35')](_0x2010('0x7a'),squel[_0x2010('0x76')]()[_0x2010('0x3b')](_0x2010('0x7b'))[_0x2010('0x74')](_0x2010('0x6b'))[_0x2010('0x35')]('CampaignId\x20=\x20?',_0x17f975[_0x2010('0x52')]['id'][_0x2010('0x72')]())))[_0x2010('0x72')]();break;case _0x2010('0x7c'):_0x275b99=squel[_0x2010('0x6a')]()[_0x2010('0x7d')](_0x2010('0x6b'))[_0x2010('0x6c')]([_0x2010('0x6d'),'scheduledAt',_0x2010('0x70'),'ListId',_0x2010('0x59'),_0x2010('0x54'),'updatedAt'],squel[_0x2010('0x76')]()[_0x2010('0x3b')](_0x2010('0x6d'),_0x2010('0x6d'))['field'](_0x2010('0x73'),'scheduledAt')['field']('id',_0x2010('0x70'))[_0x2010('0x3b')](_0xbc3a91[_0x2010('0x71')][_0x2010('0x72')](),_0x2010('0x6f'))[_0x2010('0x3b')](_0x17f975['params']['id'][_0x2010('0x72')](),'CampaignId')[_0x2010('0x3b')](_0x2010('0x73'),_0x2010('0x54'))[_0x2010('0x3b')]('NOW()',_0x2010('0x55'))[_0x2010('0x74')]('cm_contacts')[_0x2010('0x35')]('deletedAt\x20IS\x20NULL')['where'](_0x2010('0x7e'),_0xbc3a91[_0x2010('0x71')][_0x2010('0x72')]())[_0x2010('0x35')](_0x2010('0x7f'))['where'](_0x2010('0x7a'),squel[_0x2010('0x76')]()[_0x2010('0x3b')](_0x2010('0x7b'))['from']('cm_hopper')[_0x2010('0x35')](_0x2010('0x79'),_0x17f975[_0x2010('0x52')]['id']['toString']())))[_0x2010('0x72')]();break;default:_0x275b99=squel[_0x2010('0x6a')]()[_0x2010('0x7d')](_0x2010('0x6b'))[_0x2010('0x6c')](['phone','scheduledAt',_0x2010('0x70'),'ListId',_0x2010('0x59'),'createdAt',_0x2010('0x55')],squel[_0x2010('0x76')]()['field'](_0x2010('0x6d'),'phone')[_0x2010('0x3b')](_0x2010('0x73'),_0x2010('0x6e'))[_0x2010('0x3b')]('id',_0x2010('0x70'))[_0x2010('0x3b')](_0xbc3a91['CmListId'][_0x2010('0x72')](),_0x2010('0x6f'))[_0x2010('0x3b')](_0x17f975[_0x2010('0x52')]['id']['toString'](),'CampaignId')[_0x2010('0x3b')](_0x2010('0x73'),_0x2010('0x54'))[_0x2010('0x3b')]('NOW()',_0x2010('0x55'))[_0x2010('0x74')](_0x2010('0x75'))[_0x2010('0x35')]('deletedAt\x20IS\x20NULL')[_0x2010('0x35')](_0x2010('0x7e'),_0xbc3a91[_0x2010('0x71')][_0x2010('0x72')]())['where'](_0x2010('0x7f')))[_0x2010('0x72')]();}_0x3a597c[_0x2010('0x80')](db['sequelize'][_0x2010('0x2d')](_0x275b99));}return BPromise['all'](_0x3a597c);}})[_0x2010('0x22')](function(){return _0x4bc997;})[_0x2010('0x22')](respondWithResult(_0x2a0ba8,null))[_0x2010('0x40')](handleError(_0x2a0ba8,null));};exports[_0x2010('0x81')]=function(_0x15048e,_0x4400a9,_0x5b9b69){return db[_0x2010('0x2b')][_0x2010('0x4c')]({'where':{'id':_0x15048e[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x4400a9,null))[_0x2010('0x22')](function(_0x8332d5){if(_0x8332d5){return _0x8332d5[_0x2010('0x81')](_0x15048e['query'][_0x2010('0x66')]);}})[_0x2010('0x22')](function(_0x35eeac){if(_0x35eeac){return db[_0x2010('0x5b')][_0x2010('0x23')]({'where':{'ListId':_0x15048e['query'][_0x2010('0x66')],'CampaignId':_0x15048e['params']['id']}})[_0x2010('0x22')](function(){return _0x35eeac;});}})[_0x2010('0x22')](respondWithStatusCode(_0x4400a9,null))[_0x2010('0x40')](handleError(_0x4400a9,null));};exports['getBlackLists']=function(_0x11f019,_0x56dc9b,_0x17f730){var _0xef2053={'raw':!![],'where':{}};var _0x4ef01a={};var _0x27c6da={'count':0x0,'rows':[]};return db[_0x2010('0x2b')]['findOne']({'where':{'id':_0x11f019[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x56dc9b,null))['then'](function(_0x198f1c){if(_0x198f1c){_0x4ef01a[_0x2010('0x2f')]=_[_0x2010('0x42')](db[_0x2010('0x63')][_0x2010('0x2c')]);_0x4ef01a[_0x2010('0x2d')]=_['keys'](_0x11f019['query']);_0x4ef01a['filters']=_[_0x2010('0x31')](_0x4ef01a[_0x2010('0x2f')],_0x4ef01a[_0x2010('0x2d')]);_0xef2053[_0x2010('0x30')]=_[_0x2010('0x31')](_0x4ef01a[_0x2010('0x2f')],qs['fields'](_0x11f019[_0x2010('0x2d')][_0x2010('0x32')]));_0xef2053[_0x2010('0x30')]=_0xef2053[_0x2010('0x30')][_0x2010('0x43')]?_0xef2053[_0x2010('0x30')]:_0x4ef01a['model'];if(!_0x11f019[_0x2010('0x2d')][_0x2010('0x58')](_0x2010('0x5e'))){_0xef2053[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x11f019[_0x2010('0x2d')][_0x2010('0x1b')]);_0xef2053[_0x2010('0x1a')]=qs[_0x2010('0x1a')](_0x11f019['query'][_0x2010('0x1a')]);}_0xef2053[_0x2010('0x33')]=qs[_0x2010('0x34')](_0x11f019[_0x2010('0x2d')][_0x2010('0x34')]);_0xef2053[_0x2010('0x35')]=qs[_0x2010('0x2e')](_['pick'](_0x11f019[_0x2010('0x2d')],_0x4ef01a[_0x2010('0x2e')]));_0xef2053['where'][_0x2010('0x59')]=_0x198f1c['id'];if(_0x11f019[_0x2010('0x2d')][_0x2010('0x37')]){_0xef2053[_0x2010('0x35')]=_[_0x2010('0x44')](_0xef2053[_0x2010('0x35')],{'$or':_[_0x2010('0x5a')](_0xef2053['attributes'],function(_0x42c2a7){var _0x30d6da={};_0x30d6da[_0x42c2a7]={'$like':'%'+_0x11f019[_0x2010('0x2d')][_0x2010('0x37')]+'%'};return _0x30d6da;})});}_0xef2053=_[_0x2010('0x44')]({},_0xef2053,_0x11f019[_0x2010('0x3c')]);return db['CmList']['count']({'where':_0xef2053[_0x2010('0x35')]})[_0x2010('0x22')](function(_0x38f20e){_0x27c6da['count']=_0x38f20e;if(_0x11f019[_0x2010('0x2d')][_0x2010('0x3d')]){_0xef2053[_0x2010('0x3e')]=[{'all':!![]}];}return db[_0x2010('0x63')][_0x2010('0x3f')](_0xef2053);})[_0x2010('0x22')](function(_0x3029e6){_0x27c6da[_0x2010('0x5c')]=_0x3029e6;return _0x27c6da;});}})['then'](respondWithFilteredResult(_0x56dc9b,_0xef2053))[_0x2010('0x40')](handleError(_0x56dc9b,null));};exports[_0x2010('0x82')]=function(_0x5acfbd,_0x2385cf,_0x238eab){var _0x22a5d4,_0x35ce1;return db[_0x2010('0x2b')][_0x2010('0x4c')]({'where':{'id':_0x5acfbd[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x2385cf,null))[_0x2010('0x22')](function(_0x305e89){if(_0x305e89){_0x35ce1=_0x305e89;return _0x305e89[_0x2010('0x82')](_0x5acfbd[_0x2010('0x46')][_0x2010('0x66')],_[_0x2010('0x53')](_0x5acfbd[_0x2010('0x46')],[_0x2010('0x66'),'id'])||{});}return null;})[_0x2010('0x67')](function(_0x20105e){var _0x2d5ad8;_0x22a5d4=_0x20105e||[];var _0x5cca38=[];if(_0x20105e){for(var _0x8435dd=0x0;_0x8435dd<_0x20105e[_0x2010('0x43')];_0x8435dd+=0x1){var _0x4bf82b=_0x20105e[_0x8435dd][_0x2010('0x4a')]({'plain':!![]});_0x2d5ad8=squel[_0x2010('0x6a')]()[_0x2010('0x7d')](_0x2010('0x83'))[_0x2010('0x6c')]([_0x2010('0x6d'),_0x2010('0x70'),'ListId',_0x2010('0x59'),_0x2010('0x54'),_0x2010('0x55')],squel[_0x2010('0x76')]()['field'](_0x2010('0x6d'),_0x2010('0x6d'))[_0x2010('0x3b')]('id',_0x2010('0x70'))[_0x2010('0x3b')](_0x4bf82b[_0x2010('0x71')][_0x2010('0x72')](),_0x2010('0x6f'))['field'](_0x5acfbd[_0x2010('0x52')]['id'][_0x2010('0x72')](),'CampaignId')[_0x2010('0x3b')]('NOW()',_0x2010('0x54'))[_0x2010('0x3b')](_0x2010('0x73'),_0x2010('0x55'))[_0x2010('0x74')]('cm_contacts')['where'](_0x2010('0x84'))[_0x2010('0x35')](_0x2010('0x7e'),_0x4bf82b[_0x2010('0x71')][_0x2010('0x72')]())['where'](_0x2010('0x7f')))['toString']();_0x5cca38[_0x2010('0x80')](db[_0x2010('0x85')][_0x2010('0x2d')](_0x2d5ad8));}return BPromise['all'](_0x5cca38);}})[_0x2010('0x22')](function(){return _0x22a5d4;})[_0x2010('0x22')](respondWithResult(_0x2385cf,null))[_0x2010('0x40')](handleError(_0x2385cf,null));};exports[_0x2010('0x86')]=function(_0x21f6f2,_0x5ce673,_0x3535c6){return db[_0x2010('0x2b')]['find']({'where':{'id':_0x21f6f2[_0x2010('0x52')]['id']}})[_0x2010('0x22')](handleEntityNotFound(_0x5ce673,null))[_0x2010('0x22')](function(_0x4a0ce9){if(_0x4a0ce9){return _0x4a0ce9[_0x2010('0x86')](_0x21f6f2[_0x2010('0x2d')][_0x2010('0x66')]);}})[_0x2010('0x22')](function(_0x43d264){if(_0x43d264){return db[_0x2010('0x62')]['destroy']({'where':{'ListId':_0x21f6f2[_0x2010('0x2d')][_0x2010('0x66')],'CampaignId':_0x21f6f2[_0x2010('0x52')]['id']}})[_0x2010('0x22')](function(){return _0x43d264;});}})['then'](respondWithStatusCode(_0x5ce673,null))[_0x2010('0x40')](handleError(_0x5ce673,null));}; \ No newline at end of file +var _0x1152=['push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','index','Campaign','rawAttributes','model','keys','query','filters','intersection','fields','attributes','order','sort','pick','filter','merge','where','map','type','key','options','includeAll','include','findAll','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','getHoppers','findOne','hasOwnProperty','nolimit','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','ContactId','cm_contacts'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1152,0x182));var _0x2115=function(_0x299cde,_0x13b449){_0x299cde=_0x299cde-0x0;var _0x54981b=_0x1152[_0x299cde];return _0x54981b;};'use strict';var pdf=require(_0x2115('0x0'));var emlformat=require(_0x2115('0x1'));var rimraf=require(_0x2115('0x2'));var zipdir=require(_0x2115('0x3'));var jsonpatch=require(_0x2115('0x4'));var rp=require(_0x2115('0x5'));var moment=require(_0x2115('0x6'));var BPromise=require(_0x2115('0x7'));var Mustache=require('mustache');var util=require(_0x2115('0x8'));var path=require('path');var sox=require(_0x2115('0x9'));var csv=require(_0x2115('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2115('0xb'));var toCsv=require(_0x2115('0xa'));var querystring=require(_0x2115('0xc'));var Papa=require('papaparse');var Redis=require(_0x2115('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2115('0xe'));var logger=require(_0x2115('0xf'))(_0x2115('0x10'));var utils=require('../../config/utils');var config=require(_0x2115('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x84a7e8,_0x32361a){_0x32361a=_0x32361a||0xcc;return function(_0x2bb885){if(_0x2bb885){return _0x84a7e8[_0x2115('0x12')](_0x32361a);}return _0x84a7e8[_0x2115('0x13')](_0x32361a)['end']();};}function respondWithResult(_0x9e2dd5,_0x48af04){_0x48af04=_0x48af04||0xc8;return function(_0x3727a3){if(_0x3727a3){return _0x9e2dd5[_0x2115('0x13')](_0x48af04)[_0x2115('0x14')](_0x3727a3);}};}function respondWithFilteredResult(_0x2001e6,_0x7f6183){return function(_0x113ce2){if(_0x113ce2){var _0x350969=_0x113ce2[_0x2115('0x15')],_0x5e8f81=_0x7f6183[_0x2115('0x16')],_0xdf3e24=_0x7f6183[_0x2115('0x16')]+_0x7f6183[_0x2115('0x17')],_0x21b589;if(_0xdf3e24>=_0x350969){_0xdf3e24=_0x350969;_0x21b589=0xc8;}else{_0x21b589=0xce;}_0x2001e6[_0x2115('0x13')](_0x21b589);return _0x2001e6[_0x2115('0x18')]('Content-Range',_0x5e8f81+'-'+_0xdf3e24+'/'+_0x350969)[_0x2115('0x14')](_0x113ce2);}return null;};}function patchUpdates(_0x254988){return function(_0x38c26f){try{jsonpatch['apply'](_0x38c26f,_0x254988,!![]);}catch(_0x2dfb3c){return BPromise[_0x2115('0x19')](_0x2dfb3c);}return _0x38c26f[_0x2115('0x1a')]();};}function saveUpdates(_0x244cba,_0x534543){return function(_0xcc2d7b){if(_0xcc2d7b){return _0xcc2d7b[_0x2115('0x1b')](_0x244cba)[_0x2115('0x1c')](function(_0x464af4){return _0x464af4;});}return null;};}function removeEntity(_0x22ebb6,_0x1ddb2a){return function(_0x8b7304){if(_0x8b7304){return _0x8b7304[_0x2115('0x1d')]()[_0x2115('0x1c')](function(){var _0x49d26c=_0x8b7304[_0x2115('0x1e')]({'plain':!![]});var _0x340c42=_0x2115('0x1f');return db[_0x2115('0x20')][_0x2115('0x1d')]({'where':{'type':_0x340c42,'resourceId':_0x49d26c['id']}})[_0x2115('0x1c')](function(){return _0x8b7304;});})['then'](function(){_0x22ebb6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x201c94,_0x5e9d07){return function(_0x1a2ec3){if(!_0x1a2ec3){_0x201c94['sendStatus'](0x194);}return _0x1a2ec3;};}function handleError(_0x1283ec,_0x115800){_0x115800=_0x115800||0x1f4;return function(_0x1b7f47){logger[_0x2115('0x21')](_0x1b7f47[_0x2115('0x22')]);if(_0x1b7f47['name']){delete _0x1b7f47[_0x2115('0x23')];}_0x1283ec[_0x2115('0x13')](_0x115800)['send'](_0x1b7f47);};}exports[_0x2115('0x24')]=function(_0x33d81c,_0x26eff7){var _0x1262e7={},_0x59ca70={},_0x19c595={'count':0x0,'rows':[]};var _0x15229e=db[_0x2115('0x25')][_0x2115('0x26')];_0x59ca70[_0x2115('0x27')]=_[_0x2115('0x28')](_0x15229e);_0x59ca70['query']=_['keys'](_0x33d81c[_0x2115('0x29')]);_0x59ca70[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x59ca70[_0x2115('0x27')],_0x59ca70[_0x2115('0x29')]);_0x1262e7['attributes']=_[_0x2115('0x2b')](_0x59ca70[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x33d81c['query'][_0x2115('0x2c')]));_0x1262e7['attributes']=_0x1262e7[_0x2115('0x2d')]['length']?_0x1262e7[_0x2115('0x2d')]:_0x59ca70[_0x2115('0x27')];if(!_0x33d81c[_0x2115('0x29')]['hasOwnProperty']('nolimit')){_0x1262e7[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x33d81c['query'][_0x2115('0x17')]);_0x1262e7[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x33d81c[_0x2115('0x29')]['offset']);}_0x1262e7[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x33d81c[_0x2115('0x29')][_0x2115('0x2f')]);_0x1262e7['where']=qs[_0x2115('0x2a')](_[_0x2115('0x30')](_0x33d81c[_0x2115('0x29')],_0x59ca70[_0x2115('0x2a')]));if(_0x33d81c[_0x2115('0x29')][_0x2115('0x31')]){_0x1262e7['where']=_[_0x2115('0x32')](_0x1262e7[_0x2115('0x33')],{'$or':_[_0x2115('0x34')](_0x15229e,function(_0xaf411a){if(_0xaf411a[_0x2115('0x35')][_0x2115('0x36')]!=='VIRTUAL'){var _0x130fee={};_0x130fee[_0xaf411a['field']]={'$like':'%'+_0x33d81c['query'][_0x2115('0x31')]+'%'};return _0x130fee;}})});}_0x1262e7=_[_0x2115('0x32')]({},_0x1262e7,_0x33d81c[_0x2115('0x37')]);var _0x14adc8={'where':_0x1262e7[_0x2115('0x33')]};return db[_0x2115('0x25')]['count'](_0x14adc8)[_0x2115('0x1c')](function(_0x1c2508){_0x19c595[_0x2115('0x15')]=_0x1c2508;if(_0x33d81c[_0x2115('0x29')][_0x2115('0x38')]){_0x1262e7[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x25')][_0x2115('0x3a')](_0x1262e7);})[_0x2115('0x1c')](function(_0x5e30a5){_0x19c595['rows']=_0x5e30a5;return _0x19c595;})['then'](respondWithFilteredResult(_0x26eff7,_0x1262e7))[_0x2115('0x3b')](handleError(_0x26eff7,null));};exports['show']=function(_0xa652de,_0x52d91a){var _0x54ec64={'raw':![],'where':{'id':_0xa652de[_0x2115('0x3c')]['id']}},_0x55be95={};_0x55be95[_0x2115('0x27')]=_[_0x2115('0x28')](db[_0x2115('0x25')][_0x2115('0x26')]);_0x55be95['query']=_[_0x2115('0x28')](_0xa652de['query']);_0x55be95[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x55be95['model'],_0x55be95[_0x2115('0x29')]);_0x54ec64[_0x2115('0x2d')]=_['intersection'](_0x55be95['model'],qs[_0x2115('0x2c')](_0xa652de[_0x2115('0x29')]['fields']));_0x54ec64['attributes']=_0x54ec64[_0x2115('0x2d')][_0x2115('0x3d')]?_0x54ec64['attributes']:_0x55be95['model'];if(_0xa652de[_0x2115('0x29')][_0x2115('0x38')]){_0x54ec64[_0x2115('0x39')]=[{'all':!![]}];}_0x54ec64=_['merge']({},_0x54ec64,_0xa652de[_0x2115('0x37')]);return db['Campaign'][_0x2115('0x3e')](_0x54ec64)[_0x2115('0x1c')](handleEntityNotFound(_0x52d91a,null))[_0x2115('0x1c')](respondWithResult(_0x52d91a,null))[_0x2115('0x3b')](handleError(_0x52d91a,null));};exports[_0x2115('0x3f')]=function(_0x4cf226,_0x11391e){return db['Campaign']['create'](_0x4cf226[_0x2115('0x40')],{})[_0x2115('0x1c')](function(_0x583575){var _0x84739c=_0x4cf226[_0x2115('0x41')][_0x2115('0x1e')]({'plain':!![]});if(!_0x84739c)throw new Error(_0x2115('0x42'));if(_0x84739c[_0x2115('0x43')]===_0x2115('0x41')){var _0x41d1a4=_0x583575[_0x2115('0x1e')]({'plain':!![]});var _0x1c3cd2='IvrCampaigns';return db[_0x2115('0x44')][_0x2115('0x3e')]({'where':{'name':_0x1c3cd2,'userProfileId':_0x84739c[_0x2115('0x45')]},'raw':!![]})['then'](function(_0x31e684){if(_0x31e684&&_0x31e684['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x41d1a4[_0x2115('0x23')],'resourceId':_0x41d1a4['id'],'type':_0x31e684[_0x2115('0x23')],'sectionId':_0x31e684['id']},{})['then'](function(){return _0x583575;});}else{return _0x583575;}})['catch'](function(_0xd2f5cd){logger[_0x2115('0x21')](_0x2115('0x46'),_0xd2f5cd);throw _0xd2f5cd;});}return _0x583575;})[_0x2115('0x1c')](respondWithResult(_0x11391e,0xc9))[_0x2115('0x3b')](handleError(_0x11391e,null));};exports[_0x2115('0x47')]=function(_0x3b8586,_0x9539e2){var _0x5876d3={'raw':![],'where':{'id':_0x3b8586[_0x2115('0x3c')]['id']}},_0x29dbce={};_0x29dbce['model']=_[_0x2115('0x28')](db[_0x2115('0x25')][_0x2115('0x26')]);_0x5876d3[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x29dbce[_0x2115('0x27')],qs['fields'](_0x3b8586[_0x2115('0x29')][_0x2115('0x2c')]));_0x5876d3['attributes']=_0x5876d3['attributes'][_0x2115('0x3d')]?_0x5876d3[_0x2115('0x2d')]:_0x29dbce[_0x2115('0x27')];if(_0x3b8586[_0x2115('0x29')]['includeAll']){_0x5876d3[_0x2115('0x39')]=[{'all':!![]}];}_0x5876d3=_[_0x2115('0x32')]({},_0x5876d3,_0x3b8586[_0x2115('0x37')]);return db[_0x2115('0x25')][_0x2115('0x3e')](_0x5876d3)[_0x2115('0x1c')](handleEntityNotFound(_0x9539e2,null))['then'](function(_0xd1fe41){if(_0xd1fe41){var _0x756733=_0xd1fe41['get']({'plain':!![]});_0x756733=qs[_0x2115('0x48')](_0x756733,['id',_0x2115('0x49'),_0x2115('0x4a')]);_0x3b8586['body']=_[_0x2115('0x48')](_0x3b8586['body'],['id',_0x2115('0x49'),_0x2115('0x4a')]);return db[_0x2115('0x25')][_0x2115('0x3f')](_[_0x2115('0x32')](_0x756733,_0x3b8586[_0x2115('0x40')]),{'include':_0x3b8586['query'][_0x2115('0x38')]?[{'all':!![]}]:undefined})[_0x2115('0x1c')](function(_0x586c15){var _0x33b417=_0x3b8586[_0x2115('0x41')][_0x2115('0x1e')]({'plain':!![]});if(!_0x33b417)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33b417['role']==='user'){var _0x3d7106=_0x586c15['get']({'plain':!![]});var _0x1f15c5=_0x2115('0x1f');return db[_0x2115('0x44')]['find']({'where':{'name':_0x1f15c5,'userProfileId':_0x33b417[_0x2115('0x45')]},'raw':!![]})['then'](function(_0x386f8a){if(_0x386f8a&&_0x386f8a[_0x2115('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x3d7106[_0x2115('0x23')],'resourceId':_0x3d7106['id'],'type':_0x386f8a[_0x2115('0x23')],'sectionId':_0x386f8a['id']},{})['then'](function(){return _0x586c15;});}else{return _0x586c15;}})[_0x2115('0x3b')](function(_0x533c13){logger[_0x2115('0x21')](_0x2115('0x46'),_0x533c13);throw _0x533c13;});}return _0x586c15;});}})['then'](respondWithResult(_0x9539e2,0xc9))[_0x2115('0x3b')](handleError(_0x9539e2,null));};exports[_0x2115('0x1b')]=function(_0x1a7a9d,_0x3d1c53){if(_0x1a7a9d[_0x2115('0x40')]['id']){delete _0x1a7a9d[_0x2115('0x40')]['id'];}return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x1a7a9d[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x3d1c53,null))[_0x2115('0x1c')](saveUpdates(_0x1a7a9d[_0x2115('0x40')],null))[_0x2115('0x1c')](respondWithResult(_0x3d1c53,null))[_0x2115('0x3b')](handleError(_0x3d1c53,null));};exports[_0x2115('0x1d')]=function(_0x21baa7,_0x46a03a){return db[_0x2115('0x25')]['find']({'where':{'id':_0x21baa7[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x46a03a,null))[_0x2115('0x1c')](removeEntity(_0x46a03a,null))[_0x2115('0x3b')](handleError(_0x46a03a,null));};exports[_0x2115('0x4c')]=function(_0x225389,_0x2b21c8,_0x5ca331){var _0x96003b={'raw':!![],'where':{}};var _0x19068d={};var _0x126c08={'count':0x0,'rows':[]};return db['Campaign'][_0x2115('0x4d')]({'where':{'id':_0x225389[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x2b21c8,null))[_0x2115('0x1c')](function(_0x181e07){if(_0x181e07){_0x19068d['model']=_[_0x2115('0x28')](db['CmHopper']['rawAttributes']);_0x19068d[_0x2115('0x29')]=_['keys'](_0x225389['query']);_0x19068d['filters']=_['intersection'](_0x19068d[_0x2115('0x27')],_0x19068d['query']);_0x96003b[_0x2115('0x2d')]=_['intersection'](_0x19068d[_0x2115('0x27')],qs['fields'](_0x225389[_0x2115('0x29')]['fields']));_0x96003b['attributes']=_0x96003b['attributes'][_0x2115('0x3d')]?_0x96003b[_0x2115('0x2d')]:_0x19068d['model'];if(!_0x225389[_0x2115('0x29')][_0x2115('0x4e')](_0x2115('0x4f'))){_0x96003b[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x225389[_0x2115('0x29')][_0x2115('0x17')]);_0x96003b[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x225389[_0x2115('0x29')][_0x2115('0x16')]);}_0x96003b[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x225389[_0x2115('0x29')][_0x2115('0x2f')]);_0x96003b[_0x2115('0x33')]=qs['filters'](_[_0x2115('0x30')](_0x225389['query'],_0x19068d['filters']));_0x96003b['where'][_0x2115('0x50')]=_0x181e07['id'];if(_0x225389[_0x2115('0x29')][_0x2115('0x31')]){_0x96003b['where']=_[_0x2115('0x32')](_0x96003b[_0x2115('0x33')],{'$or':_['map'](_0x96003b[_0x2115('0x2d')],function(_0x10d172){var _0x2c573a={};_0x2c573a[_0x10d172]={'$like':'%'+_0x225389[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x2c573a;})});}_0x96003b=_[_0x2115('0x32')]({},_0x96003b,_0x225389[_0x2115('0x37')]);return db[_0x2115('0x51')][_0x2115('0x15')]({'where':_0x96003b[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0x387c2b){_0x126c08[_0x2115('0x15')]=_0x387c2b;if(_0x225389['query'][_0x2115('0x38')]){_0x96003b[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x51')][_0x2115('0x3a')](_0x96003b);})['then'](function(_0x249b9c){_0x126c08[_0x2115('0x52')]=_0x249b9c;return _0x126c08;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x2b21c8,_0x96003b))[_0x2115('0x3b')](handleError(_0x2b21c8,null));};exports[_0x2115('0x53')]=function(_0x156b1f,_0x34fbb7,_0x332177){var _0x85f3d9={'raw':!![],'where':{}};var _0x956842={};var _0xe87632={'count':0x0,'rows':[]};return db[_0x2115('0x25')][_0x2115('0x4d')]({'where':{'id':_0x156b1f[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x34fbb7,null))[_0x2115('0x1c')](function(_0x354a73){if(_0x354a73){_0x956842['model']=_[_0x2115('0x28')](db[_0x2115('0x54')][_0x2115('0x26')]);_0x956842[_0x2115('0x29')]=_[_0x2115('0x28')](_0x156b1f[_0x2115('0x29')]);_0x956842[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x956842[_0x2115('0x27')],_0x956842[_0x2115('0x29')]);_0x85f3d9[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x956842[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x156b1f[_0x2115('0x29')][_0x2115('0x2c')]));_0x85f3d9[_0x2115('0x2d')]=_0x85f3d9[_0x2115('0x2d')]['length']?_0x85f3d9[_0x2115('0x2d')]:_0x956842[_0x2115('0x27')];if(!_0x156b1f['query'][_0x2115('0x4e')](_0x2115('0x4f'))){_0x85f3d9[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x156b1f[_0x2115('0x29')][_0x2115('0x17')]);_0x85f3d9['offset']=qs[_0x2115('0x16')](_0x156b1f['query'][_0x2115('0x16')]);}_0x85f3d9[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x156b1f[_0x2115('0x29')]['sort']);_0x85f3d9[_0x2115('0x33')]=qs[_0x2115('0x2a')](_['pick'](_0x156b1f[_0x2115('0x29')],_0x956842[_0x2115('0x2a')]));_0x85f3d9[_0x2115('0x33')]['CampaignId']=_0x354a73['id'];if(_0x156b1f[_0x2115('0x29')][_0x2115('0x31')]){_0x85f3d9[_0x2115('0x33')]=_[_0x2115('0x32')](_0x85f3d9['where'],{'$or':_['map'](_0x85f3d9[_0x2115('0x2d')],function(_0x4135bc){var _0x188497={};_0x188497[_0x4135bc]={'$like':'%'+_0x156b1f[_0x2115('0x29')]['filter']+'%'};return _0x188497;})});}_0x85f3d9=_[_0x2115('0x32')]({},_0x85f3d9,_0x156b1f['options']);return db[_0x2115('0x54')]['count']({'where':_0x85f3d9['where']})['then'](function(_0x2fe8dd){_0xe87632['count']=_0x2fe8dd;if(_0x156b1f[_0x2115('0x29')][_0x2115('0x38')]){_0x85f3d9[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x54')][_0x2115('0x3a')](_0x85f3d9);})['then'](function(_0x374d98){_0xe87632[_0x2115('0x52')]=_0x374d98;return _0xe87632;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x34fbb7,_0x85f3d9))['catch'](handleError(_0x34fbb7,null));};exports[_0x2115('0x55')]=function(_0x398969,_0x4b77a0,_0x368d0a){var _0x251458={'raw':!![],'where':{}};var _0x38cd11={};var _0x4deb05={'count':0x0,'rows':[]};return db[_0x2115('0x25')]['findOne']({'where':{'id':_0x398969[_0x2115('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4b77a0,null))[_0x2115('0x1c')](function(_0x384085){if(_0x384085){_0x38cd11['model']=_[_0x2115('0x28')](db[_0x2115('0x56')]['rawAttributes']);_0x38cd11['query']=_[_0x2115('0x28')](_0x398969[_0x2115('0x29')]);_0x38cd11[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x38cd11[_0x2115('0x27')],_0x38cd11[_0x2115('0x29')]);_0x251458[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x38cd11[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x398969['query'][_0x2115('0x2c')]));_0x251458['attributes']=_0x251458[_0x2115('0x2d')][_0x2115('0x3d')]?_0x251458['attributes']:_0x38cd11[_0x2115('0x27')];if(!_0x398969[_0x2115('0x29')][_0x2115('0x4e')](_0x2115('0x4f'))){_0x251458[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x398969[_0x2115('0x29')][_0x2115('0x17')]);_0x251458[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x398969[_0x2115('0x29')][_0x2115('0x16')]);}_0x251458[_0x2115('0x2e')]=qs['sort'](_0x398969[_0x2115('0x29')][_0x2115('0x2f')]);_0x251458['where']=qs[_0x2115('0x2a')](_[_0x2115('0x30')](_0x398969[_0x2115('0x29')],_0x38cd11[_0x2115('0x2a')]));_0x251458[_0x2115('0x33')]['CampaignId']=_0x384085['id'];if(_0x398969[_0x2115('0x29')][_0x2115('0x31')]){_0x251458['where']=_[_0x2115('0x32')](_0x251458[_0x2115('0x33')],{'$or':_[_0x2115('0x34')](_0x251458[_0x2115('0x2d')],function(_0x3c92a5){var _0x32f75d={};_0x32f75d[_0x3c92a5]={'$like':'%'+_0x398969[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x32f75d;})});}_0x251458=_[_0x2115('0x32')]({},_0x251458,_0x398969[_0x2115('0x37')]);return db['CmHopperFinal'][_0x2115('0x15')]({'where':_0x251458[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0xa1c60c){_0x4deb05[_0x2115('0x15')]=_0xa1c60c;if(_0x398969[_0x2115('0x29')][_0x2115('0x38')]){_0x251458['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x251458);})['then'](function(_0x228e05){_0x4deb05[_0x2115('0x52')]=_0x228e05;return _0x4deb05;});}})['then'](respondWithFilteredResult(_0x4b77a0,_0x251458))[_0x2115('0x3b')](handleError(_0x4b77a0,null));};exports[_0x2115('0x57')]=function(_0x4ce305,_0x56f2d5,_0x420329){var _0x1642a7={'raw':!![],'where':{}};var _0x3f8eaa={};var _0x21162c={'count':0x0,'rows':[]};return db['Campaign'][_0x2115('0x4d')]({'where':{'id':_0x4ce305[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x56f2d5,null))['then'](function(_0x120aea){if(_0x120aea){_0x3f8eaa[_0x2115('0x27')]=_[_0x2115('0x28')](db['CmHopperBlack'][_0x2115('0x26')]);_0x3f8eaa['query']=_[_0x2115('0x28')](_0x4ce305[_0x2115('0x29')]);_0x3f8eaa[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x3f8eaa[_0x2115('0x27')],_0x3f8eaa['query']);_0x1642a7[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x3f8eaa['model'],qs[_0x2115('0x2c')](_0x4ce305[_0x2115('0x29')]['fields']));_0x1642a7[_0x2115('0x2d')]=_0x1642a7[_0x2115('0x2d')][_0x2115('0x3d')]?_0x1642a7[_0x2115('0x2d')]:_0x3f8eaa['model'];if(!_0x4ce305[_0x2115('0x29')]['hasOwnProperty'](_0x2115('0x4f'))){_0x1642a7[_0x2115('0x17')]=qs['limit'](_0x4ce305[_0x2115('0x29')][_0x2115('0x17')]);_0x1642a7[_0x2115('0x16')]=qs['offset'](_0x4ce305['query'][_0x2115('0x16')]);}_0x1642a7[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0x4ce305[_0x2115('0x29')]['sort']);_0x1642a7[_0x2115('0x33')]=qs['filters'](_[_0x2115('0x30')](_0x4ce305[_0x2115('0x29')],_0x3f8eaa[_0x2115('0x2a')]));_0x1642a7[_0x2115('0x33')][_0x2115('0x50')]=_0x120aea['id'];if(_0x4ce305['query']['filter']){_0x1642a7['where']=_[_0x2115('0x32')](_0x1642a7['where'],{'$or':_[_0x2115('0x34')](_0x1642a7[_0x2115('0x2d')],function(_0x3a06e5){var _0x254aa3={};_0x254aa3[_0x3a06e5]={'$like':'%'+_0x4ce305[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x254aa3;})});}_0x1642a7=_[_0x2115('0x32')]({},_0x1642a7,_0x4ce305[_0x2115('0x37')]);return db['CmHopperBlack'][_0x2115('0x15')]({'where':_0x1642a7[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0x42a34c){_0x21162c['count']=_0x42a34c;if(_0x4ce305['query']['includeAll']){_0x1642a7[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x58')]['findAll'](_0x1642a7);})['then'](function(_0xe092a8){_0x21162c[_0x2115('0x52')]=_0xe092a8;return _0x21162c;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x56f2d5,_0x1642a7))[_0x2115('0x3b')](handleError(_0x56f2d5,null));};exports['getLists']=function(_0xd50b47,_0xdf128b,_0x173153){var _0x432d35={};var _0x2adb2a={};var _0x1ec12b;var _0x58764f;return db[_0x2115('0x25')][_0x2115('0x4d')]({'where':{'id':_0xd50b47['params']['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0xdf128b,null))['then'](function(_0x431539){if(_0x431539){_0x1ec12b=_0x431539;_0x2adb2a[_0x2115('0x27')]=_[_0x2115('0x28')](db[_0x2115('0x59')][_0x2115('0x26')]);_0x2adb2a[_0x2115('0x29')]=_[_0x2115('0x28')](_0xd50b47['query']);_0x2adb2a[_0x2115('0x2a')]=_[_0x2115('0x2b')](_0x2adb2a['model'],_0x2adb2a[_0x2115('0x29')]);_0x432d35[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0x2adb2a['model'],qs[_0x2115('0x2c')](_0xd50b47[_0x2115('0x29')][_0x2115('0x2c')]));_0x432d35[_0x2115('0x2d')]=_0x432d35[_0x2115('0x2d')]['length']?_0x432d35[_0x2115('0x2d')]:_0x2adb2a[_0x2115('0x27')];_0x432d35[_0x2115('0x2e')]=qs[_0x2115('0x2f')](_0xd50b47[_0x2115('0x29')][_0x2115('0x2f')]);_0x432d35[_0x2115('0x33')]=qs[_0x2115('0x2a')](_[_0x2115('0x30')](_0xd50b47[_0x2115('0x29')],_0x2adb2a[_0x2115('0x2a')]));if(_0xd50b47[_0x2115('0x29')][_0x2115('0x31')]){_0x432d35[_0x2115('0x33')]=_[_0x2115('0x32')](_0x432d35['where'],{'$or':_[_0x2115('0x34')](_0x432d35[_0x2115('0x2d')],function(_0x503b6d){var _0x4b02a1={};_0x4b02a1[_0x503b6d]={'$like':'%'+_0xd50b47[_0x2115('0x29')][_0x2115('0x31')]+'%'};return _0x4b02a1;})});}_0x432d35=_[_0x2115('0x32')]({},_0x432d35,_0xd50b47[_0x2115('0x37')]);return _0x1ec12b[_0x2115('0x5a')](_0x432d35);}})[_0x2115('0x1c')](function(_0x5a0ca4){if(_0x5a0ca4){_0x58764f=_0x5a0ca4[_0x2115('0x3d')];if(!_0xd50b47[_0x2115('0x29')][_0x2115('0x4e')](_0x2115('0x4f'))){_0x432d35['limit']=qs[_0x2115('0x17')](_0xd50b47[_0x2115('0x29')][_0x2115('0x17')]);_0x432d35[_0x2115('0x16')]=qs['offset'](_0xd50b47[_0x2115('0x29')][_0x2115('0x16')]);}return _0x1ec12b[_0x2115('0x5a')](_0x432d35);}})['then'](function(_0x29f010){if(_0x29f010){return _0x29f010?{'count':_0x58764f,'rows':_0x29f010}:null;}})[_0x2115('0x1c')](respondWithResult(_0xdf128b,null))[_0x2115('0x3b')](handleError(_0xdf128b,null));};exports[_0x2115('0x5b')]=function(_0x24fff5,_0x413fbe,_0x32fe35){var _0x493e74,_0x5a75d1;return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x24fff5[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x413fbe,null))[_0x2115('0x1c')](function(_0x1cc062){if(_0x1cc062){_0x5a75d1=_0x1cc062;return _0x1cc062[_0x2115('0x5b')](_0x24fff5[_0x2115('0x40')]['ids'],_[_0x2115('0x48')](_0x24fff5['body'],[_0x2115('0x5c'),'id'])||{});}return null;})[_0x2115('0x5d')](function(_0x4afc31){var _0x5dbfe0;_0x493e74=_0x4afc31||[];var _0x16f438=[];if(_0x4afc31){for(var _0x2a6e78=0x0;_0x2a6e78<_0x4afc31[_0x2115('0x3d')];_0x2a6e78+=0x1){var _0x381292=_0x4afc31[_0x2a6e78][_0x2115('0x1e')]({'plain':!![]});_0x5a75d1[_0x2115('0x5e')]=_0x24fff5['body'][_0x2115('0x5e')]?_0x24fff5[_0x2115('0x40')][_0x2115('0x5e')]:_0x5a75d1[_0x2115('0x5e')];switch(_0x5a75d1[_0x2115('0x5e')]){case _0x2115('0x5f'):_0x5dbfe0=squel[_0x2115('0x60')]()[_0x2115('0x61')](_0x2115('0x62'))[_0x2115('0x63')]([_0x2115('0x64'),'scheduledAt','ContactId',_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),'updatedAt'],squel[_0x2115('0x66')]()['field'](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x69'))['field']('id','ContactId')[_0x2115('0x67')](_0x381292[_0x2115('0x6a')][_0x2115('0x6b')](),'ListId')['field'](_0x24fff5[_0x2115('0x3c')]['id']['toString'](),'CampaignId')[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x49'))[_0x2115('0x67')]('NOW()',_0x2115('0x4a'))[_0x2115('0x6c')]('cm_contacts')[_0x2115('0x33')](_0x2115('0x6d'))['where'](_0x2115('0x6e'),_0x381292[_0x2115('0x6a')][_0x2115('0x6b')]())['where'](_0x2115('0x6f'))[_0x2115('0x33')](_0x2115('0x70'),squel[_0x2115('0x66')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x2115('0x6c')](_0x2115('0x71'))[_0x2115('0x33')](_0x2115('0x72'),_0x24fff5[_0x2115('0x3c')]['id']['toString']()))[_0x2115('0x33')](_0x2115('0x70'),squel['select']()[_0x2115('0x67')](_0x2115('0x73'))[_0x2115('0x6c')](_0x2115('0x62'))['where'](_0x2115('0x72'),_0x24fff5[_0x2115('0x3c')]['id'][_0x2115('0x6b')]())))[_0x2115('0x6b')]();break;case'onlyIfOpen':_0x5dbfe0=squel[_0x2115('0x60')]()[_0x2115('0x61')](_0x2115('0x62'))[_0x2115('0x63')]([_0x2115('0x64'),_0x2115('0x69'),'ContactId',_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),_0x2115('0x4a')],squel[_0x2115('0x66')]()['field'](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')](_0x2115('0x68'),'scheduledAt')['field']('id',_0x2115('0x74'))[_0x2115('0x67')](_0x381292['CmListId']['toString'](),'ListId')[_0x2115('0x67')](_0x24fff5[_0x2115('0x3c')]['id'][_0x2115('0x6b')](),_0x2115('0x50'))[_0x2115('0x67')]('NOW()','createdAt')[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x4a'))[_0x2115('0x6c')](_0x2115('0x75'))[_0x2115('0x33')]('deletedAt\x20IS\x20NULL')[_0x2115('0x33')]('ListId\x20=\x20?',_0x381292[_0x2115('0x6a')][_0x2115('0x6b')]())[_0x2115('0x33')](_0x2115('0x6f'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x2115('0x66')]()[_0x2115('0x67')](_0x2115('0x73'))['from'](_0x2115('0x62'))[_0x2115('0x33')]('CampaignId\x20=\x20?',_0x24fff5['params']['id']['toString']())))[_0x2115('0x6b')]();break;default:_0x5dbfe0=squel[_0x2115('0x60')]()[_0x2115('0x61')]('cm_hopper')[_0x2115('0x63')]([_0x2115('0x64'),_0x2115('0x69'),_0x2115('0x74'),_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),_0x2115('0x4a')],squel['select']()[_0x2115('0x67')](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')](_0x2115('0x68'),'scheduledAt')[_0x2115('0x67')]('id',_0x2115('0x74'))[_0x2115('0x67')](_0x381292[_0x2115('0x6a')][_0x2115('0x6b')](),_0x2115('0x65'))[_0x2115('0x67')](_0x24fff5[_0x2115('0x3c')]['id']['toString'](),_0x2115('0x50'))[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x49'))['field']('NOW()',_0x2115('0x4a'))['from'](_0x2115('0x75'))[_0x2115('0x33')](_0x2115('0x6d'))[_0x2115('0x33')](_0x2115('0x6e'),_0x381292[_0x2115('0x6a')][_0x2115('0x6b')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2115('0x6b')]();}_0x16f438[_0x2115('0x76')](db[_0x2115('0x77')][_0x2115('0x29')](_0x5dbfe0));}return BPromise[_0x2115('0x78')](_0x16f438);}})[_0x2115('0x1c')](function(){return _0x493e74;})[_0x2115('0x1c')](respondWithResult(_0x413fbe,null))[_0x2115('0x3b')](handleError(_0x413fbe,null));};exports[_0x2115('0x79')]=function(_0x309fd7,_0x10be54,_0x2265c7){return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x309fd7[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x10be54,null))[_0x2115('0x1c')](function(_0x2aef80){if(_0x2aef80){return _0x2aef80['removeLists'](_0x309fd7[_0x2115('0x29')][_0x2115('0x5c')]);}})[_0x2115('0x1c')](function(_0x418610){if(_0x418610){return db[_0x2115('0x51')][_0x2115('0x1d')]({'where':{'ListId':_0x309fd7[_0x2115('0x29')]['ids'],'CampaignId':_0x309fd7[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](function(){return _0x418610;});}})[_0x2115('0x1c')](respondWithStatusCode(_0x10be54,null))['catch'](handleError(_0x10be54,null));};exports[_0x2115('0x7a')]=function(_0x3d25e0,_0x5835f3,_0x503e61){var _0x1fa498={'raw':!![],'where':{}};var _0xd3e119={};var _0x1f07df={'count':0x0,'rows':[]};return db[_0x2115('0x25')][_0x2115('0x4d')]({'where':{'id':_0x3d25e0[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x5835f3,null))[_0x2115('0x1c')](function(_0x407e0c){if(_0x407e0c){_0xd3e119[_0x2115('0x27')]=_['keys'](db['CmList'][_0x2115('0x26')]);_0xd3e119['query']=_[_0x2115('0x28')](_0x3d25e0[_0x2115('0x29')]);_0xd3e119[_0x2115('0x2a')]=_['intersection'](_0xd3e119[_0x2115('0x27')],_0xd3e119[_0x2115('0x29')]);_0x1fa498[_0x2115('0x2d')]=_[_0x2115('0x2b')](_0xd3e119[_0x2115('0x27')],qs[_0x2115('0x2c')](_0x3d25e0['query']['fields']));_0x1fa498[_0x2115('0x2d')]=_0x1fa498['attributes']['length']?_0x1fa498[_0x2115('0x2d')]:_0xd3e119[_0x2115('0x27')];if(!_0x3d25e0[_0x2115('0x29')][_0x2115('0x4e')]('nolimit')){_0x1fa498[_0x2115('0x17')]=qs[_0x2115('0x17')](_0x3d25e0[_0x2115('0x29')][_0x2115('0x17')]);_0x1fa498[_0x2115('0x16')]=qs[_0x2115('0x16')](_0x3d25e0[_0x2115('0x29')][_0x2115('0x16')]);}_0x1fa498[_0x2115('0x2e')]=qs['sort'](_0x3d25e0[_0x2115('0x29')][_0x2115('0x2f')]);_0x1fa498[_0x2115('0x33')]=qs['filters'](_[_0x2115('0x30')](_0x3d25e0['query'],_0xd3e119[_0x2115('0x2a')]));_0x1fa498[_0x2115('0x33')][_0x2115('0x50')]=_0x407e0c['id'];if(_0x3d25e0['query'][_0x2115('0x31')]){_0x1fa498['where']=_[_0x2115('0x32')](_0x1fa498['where'],{'$or':_[_0x2115('0x34')](_0x1fa498[_0x2115('0x2d')],function(_0x549695){var _0x23a9b6={};_0x23a9b6[_0x549695]={'$like':'%'+_0x3d25e0[_0x2115('0x29')]['filter']+'%'};return _0x23a9b6;})});}_0x1fa498=_[_0x2115('0x32')]({},_0x1fa498,_0x3d25e0[_0x2115('0x37')]);return db[_0x2115('0x59')][_0x2115('0x15')]({'where':_0x1fa498[_0x2115('0x33')]})[_0x2115('0x1c')](function(_0x37fbc7){_0x1f07df[_0x2115('0x15')]=_0x37fbc7;if(_0x3d25e0['query'][_0x2115('0x38')]){_0x1fa498[_0x2115('0x39')]=[{'all':!![]}];}return db[_0x2115('0x59')][_0x2115('0x3a')](_0x1fa498);})[_0x2115('0x1c')](function(_0x2b19dc){_0x1f07df['rows']=_0x2b19dc;return _0x1f07df;});}})[_0x2115('0x1c')](respondWithFilteredResult(_0x5835f3,_0x1fa498))[_0x2115('0x3b')](handleError(_0x5835f3,null));};exports[_0x2115('0x7b')]=function(_0x1a2898,_0x10bc0e,_0x4d8181){var _0x4a1c94,_0x290f5e;return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x1a2898[_0x2115('0x3c')]['id']}})['then'](handleEntityNotFound(_0x10bc0e,null))[_0x2115('0x1c')](function(_0x119968){if(_0x119968){_0x290f5e=_0x119968;return _0x119968['addBlackLists'](_0x1a2898[_0x2115('0x40')][_0x2115('0x5c')],_[_0x2115('0x48')](_0x1a2898['body'],[_0x2115('0x5c'),'id'])||{});}return null;})[_0x2115('0x5d')](function(_0xc88469){var _0x4064a3;_0x4a1c94=_0xc88469||[];var _0x2ccb5c=[];if(_0xc88469){for(var _0x36da75=0x0;_0x36da75<_0xc88469[_0x2115('0x3d')];_0x36da75+=0x1){var _0x1c3c5c=_0xc88469[_0x36da75]['get']({'plain':!![]});_0x4064a3=squel[_0x2115('0x60')]()[_0x2115('0x61')](_0x2115('0x7c'))[_0x2115('0x63')](['phone',_0x2115('0x74'),_0x2115('0x65'),_0x2115('0x50'),_0x2115('0x49'),_0x2115('0x4a')],squel['select']()[_0x2115('0x67')](_0x2115('0x64'),_0x2115('0x64'))[_0x2115('0x67')]('id',_0x2115('0x74'))[_0x2115('0x67')](_0x1c3c5c[_0x2115('0x6a')]['toString'](),_0x2115('0x65'))['field'](_0x1a2898[_0x2115('0x3c')]['id'][_0x2115('0x6b')](),'CampaignId')[_0x2115('0x67')](_0x2115('0x68'),_0x2115('0x49'))[_0x2115('0x67')]('NOW()',_0x2115('0x4a'))[_0x2115('0x6c')](_0x2115('0x75'))[_0x2115('0x33')]('deletedAt\x20IS\x20NULL')[_0x2115('0x33')]('ListId\x20=\x20?',_0x1c3c5c[_0x2115('0x6a')][_0x2115('0x6b')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x2115('0x6b')]();_0x2ccb5c[_0x2115('0x76')](db['sequelize'][_0x2115('0x29')](_0x4064a3));}return BPromise[_0x2115('0x78')](_0x2ccb5c);}})[_0x2115('0x1c')](function(){return _0x4a1c94;})[_0x2115('0x1c')](respondWithResult(_0x10bc0e,null))['catch'](handleError(_0x10bc0e,null));};exports['removeBlackLists']=function(_0x409772,_0x35a7d8,_0x31686f){return db[_0x2115('0x25')][_0x2115('0x3e')]({'where':{'id':_0x409772['params']['id']}})[_0x2115('0x1c')](handleEntityNotFound(_0x35a7d8,null))[_0x2115('0x1c')](function(_0x25b465){if(_0x25b465){return _0x25b465[_0x2115('0x7d')](_0x409772[_0x2115('0x29')][_0x2115('0x5c')]);}})[_0x2115('0x1c')](function(_0x1434fb){if(_0x1434fb){return db[_0x2115('0x58')][_0x2115('0x1d')]({'where':{'ListId':_0x409772[_0x2115('0x29')]['ids'],'CampaignId':_0x409772[_0x2115('0x3c')]['id']}})[_0x2115('0x1c')](function(){return _0x1434fb;});}})[_0x2115('0x1c')](respondWithStatusCode(_0x35a7d8,null))[_0x2115('0x3b')](handleError(_0x35a7d8,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 6bfb2a1..e5618ed 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 _0x69aa=['bluebird','request-promise','path','rimraf','./campaign.attributes','exports','Campaign','campaigns','util','../../config/logger','api'];(function(_0x1dc337,_0x163446){var _0x2c4d04=function(_0x849e1){while(--_0x849e1){_0x1dc337['push'](_0x1dc337['shift']());}};_0x2c4d04(++_0x163446);}(_0x69aa,0x1d6));var _0xa69a=function(_0x620edf,_0x45878a){_0x620edf=_0x620edf-0x0;var _0x1daf54=_0x69aa[_0x620edf];return _0x1daf54;};'use strict';var _=require('lodash');var util=require(_0xa69a('0x0'));var logger=require(_0xa69a('0x1'))(_0xa69a('0x2'));var moment=require('moment');var BPromise=require(_0xa69a('0x3'));var rp=require(_0xa69a('0x4'));var fs=require('fs');var path=require(_0xa69a('0x5'));var rimraf=require(_0xa69a('0x6'));var config=require('../../config/environment');var attributes=require(_0xa69a('0x7'));module[_0xa69a('0x8')]=function(_0x581958,_0x40fe6d){return _0x581958['define'](_0xa69a('0x9'),attributes,{'tableName':_0xa69a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd406=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./campaign.attributes','exports','define'];(function(_0x27eeca,_0x1315f9){var _0xe87e2f=function(_0x5ce1e3){while(--_0x5ce1e3){_0x27eeca['push'](_0x27eeca['shift']());}};_0xe87e2f(++_0x1315f9);}(_0xd406,0x1dd));var _0x6d40=function(_0x3ba494,_0x39d455){_0x3ba494=_0x3ba494-0x0;var _0x2fe486=_0xd406[_0x3ba494];return _0x2fe486;};'use strict';var _=require('lodash');var util=require(_0x6d40('0x0'));var logger=require(_0x6d40('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6d40('0x2'));var rp=require(_0x6d40('0x3'));var fs=require('fs');var path=require(_0x6d40('0x4'));var rimraf=require('rimraf');var config=require(_0x6d40('0x5'));var attributes=require(_0x6d40('0x6'));module[_0x6d40('0x7')]=function(_0x3d527a,_0x49fb9f){return _0x3d527a[_0x6d40('0x8')]('Campaign',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 e852bc2..fdcdc9a 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 _0x8d8e=['util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','options','where','attributes','map','include','model','info','GetCampaign','debug','catch'];(function(_0x49130f,_0x10abb1){var _0x390a46=function(_0x3d8a86){while(--_0x3d8a86){_0x49130f['push'](_0x49130f['shift']());}};_0x390a46(++_0x10abb1);}(_0x8d8e,0x129));var _0xe8d8=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8d8e[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0xe8d8('0x0'));var moment=require(_0xe8d8('0x1'));var BPromise=require(_0xe8d8('0x2'));var rs=require(_0xe8d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe8d8('0x5'))('rpc');var config=require(_0xe8d8('0x6'));var jayson=require(_0xe8d8('0x7'));var client=jayson[_0xe8d8('0x8')][_0xe8d8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3137c8,_0x2bf943,_0xaef7ed){return new BPromise(function(_0x96d6b2,_0x3e593b){return client['request'](_0x3137c8,_0xaef7ed)['then'](function(_0x42f39d){logger['info']('Campaign,\x20%s,\x20%s',_0x2bf943,_0xe8d8('0xa'));logger['debug'](_0xe8d8('0xb'),_0x2bf943,_0xe8d8('0xa'),JSON[_0xe8d8('0xc')](_0x42f39d));if(_0x42f39d['error']){if(_0x42f39d[_0xe8d8('0xd')][_0xe8d8('0xe')]===0x1f4){logger[_0xe8d8('0xd')]('Campaign,\x20%s,\x20%s',_0x2bf943,_0x42f39d[_0xe8d8('0xd')]['message']);return _0x3e593b(_0x42f39d[_0xe8d8('0xd')]['message']);}logger[_0xe8d8('0xd')]('Campaign,\x20%s,\x20%s',_0x2bf943,_0x42f39d[_0xe8d8('0xd')][_0xe8d8('0xf')]);return _0x96d6b2(_0x42f39d[_0xe8d8('0xd')][_0xe8d8('0xf')]);}else{logger['info'](_0xe8d8('0x10'),_0x2bf943,_0xe8d8('0xa'));_0x96d6b2(_0x42f39d['result']['message']);}})['catch'](function(_0x1461a4){logger['error'](_0xe8d8('0x10'),_0x2bf943,_0x1461a4);_0x3e593b(_0x1461a4);});});}exports['GetCampaign']=function(_0x4b50cb){var _0x51677d=this;return new Promise(function(_0x174a13,_0x2e1ae4){return db['Campaign']['findAll']({'raw':_0x4b50cb[_0xe8d8('0x11')]?_0x4b50cb[_0xe8d8('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x4b50cb['options']?_0x4b50cb[_0xe8d8('0x11')][_0xe8d8('0x12')]||null:null,'attributes':_0x4b50cb['options']?_0x4b50cb[_0xe8d8('0x11')][_0xe8d8('0x13')]||null:null,'limit':_0x4b50cb[_0xe8d8('0x11')]?_0x4b50cb[_0xe8d8('0x11')]['limit']||null:null,'include':_0x4b50cb[_0xe8d8('0x11')]?_0x4b50cb[_0xe8d8('0x11')]['include']?_[_0xe8d8('0x14')](_0x4b50cb['options'][_0xe8d8('0x15')],function(_0x3020cd){return{'model':db[_0x3020cd[_0xe8d8('0x16')]],'as':_0x3020cd['as'],'attributes':_0x3020cd[_0xe8d8('0x13')],'include':_0x3020cd[_0xe8d8('0x15')]?_[_0xe8d8('0x14')](_0x3020cd[_0xe8d8('0x15')],function(_0x3376b3){return{'model':db[_0x3376b3['model']],'as':_0x3376b3['as'],'attributes':_0x3376b3['attributes'],'include':_0x3376b3[_0xe8d8('0x15')]?_[_0xe8d8('0x14')](_0x3376b3[_0xe8d8('0x15')],function(_0x243cb0){return{'model':db[_0x243cb0[_0xe8d8('0x16')]],'as':_0x243cb0['as'],'attributes':_0x243cb0[_0xe8d8('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x565bf9){logger[_0xe8d8('0x17')](_0xe8d8('0x18'),_0x4b50cb);logger[_0xe8d8('0x19')](_0xe8d8('0x18'),_0x4b50cb,JSON['stringify'](_0x565bf9));_0x174a13(_0x565bf9);})[_0xe8d8('0x1a')](function(_0xb2399e){logger['error'](_0xe8d8('0x18'),_0xb2399e[_0xe8d8('0xf')],_0x4b50cb);_0x2e1ae4(_0x51677d[_0xe8d8('0xd')](0x1f4,_0xb2399e[_0xe8d8('0xf')]));});});}; \ No newline at end of file +var _0x656e=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetCampaign','Campaign','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2f8297,_0x555956){var _0x2b3580=function(_0x47e085){while(--_0x47e085){_0x2f8297['push'](_0x2f8297['shift']());}};_0x2b3580(++_0x555956);}(_0x656e,0xa3));var _0xe656=function(_0x404a11,_0x5d5647){_0x404a11=_0x404a11-0x0;var _0x471865=_0x656e[_0x404a11];return _0x471865;};'use strict';var _=require(_0xe656('0x0'));var util=require(_0xe656('0x1'));var moment=require(_0xe656('0x2'));var BPromise=require(_0xe656('0x3'));var rs=require(_0xe656('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe656('0x5'))['db'];var utils=require(_0xe656('0x6'));var logger=require('../../config/logger')(_0xe656('0x7'));var config=require(_0xe656('0x8'));var jayson=require(_0xe656('0x9'));var client=jayson[_0xe656('0xa')][_0xe656('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x375b9b,_0x2b6d83,_0x1c43ee){return new BPromise(function(_0x1539f1,_0x159245){return client[_0xe656('0xc')](_0x375b9b,_0x1c43ee)[_0xe656('0xd')](function(_0x19a64f){logger[_0xe656('0xe')](_0xe656('0xf'),_0x2b6d83,_0xe656('0x10'));logger[_0xe656('0x11')]('Campaign,\x20%s,\x20%s,\x20%s',_0x2b6d83,'request\x20sent',JSON[_0xe656('0x12')](_0x19a64f));if(_0x19a64f[_0xe656('0x13')]){if(_0x19a64f[_0xe656('0x13')][_0xe656('0x14')]===0x1f4){logger[_0xe656('0x13')](_0xe656('0xf'),_0x2b6d83,_0x19a64f[_0xe656('0x13')]['message']);return _0x159245(_0x19a64f[_0xe656('0x13')][_0xe656('0x15')]);}logger[_0xe656('0x13')](_0xe656('0xf'),_0x2b6d83,_0x19a64f[_0xe656('0x13')]['message']);return _0x1539f1(_0x19a64f[_0xe656('0x13')]['message']);}else{logger[_0xe656('0xe')]('Campaign,\x20%s,\x20%s',_0x2b6d83,_0xe656('0x10'));_0x1539f1(_0x19a64f['result'][_0xe656('0x15')]);}})[_0xe656('0x16')](function(_0x346f9c){logger[_0xe656('0x13')](_0xe656('0xf'),_0x2b6d83,_0x346f9c);_0x159245(_0x346f9c);});});}exports[_0xe656('0x17')]=function(_0x2c4da5){var _0x1bf17f=this;return new Promise(function(_0x571df0,_0x80e691){return db[_0xe656('0x18')][_0xe656('0x19')]({'raw':_0x2c4da5[_0xe656('0x1a')]?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c4da5['options']?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1c')]||null:null,'attributes':_0x2c4da5['options']?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1d')]||null:null,'limit':_0x2c4da5[_0xe656('0x1a')]?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1e')]||null:null,'include':_0x2c4da5['options']?_0x2c4da5[_0xe656('0x1a')][_0xe656('0x1f')]?_[_0xe656('0x20')](_0x2c4da5['options'][_0xe656('0x1f')],function(_0x419d2b){return{'model':db[_0x419d2b[_0xe656('0x21')]],'as':_0x419d2b['as'],'attributes':_0x419d2b[_0xe656('0x1d')],'include':_0x419d2b['include']?_[_0xe656('0x20')](_0x419d2b[_0xe656('0x1f')],function(_0x5d8206){return{'model':db[_0x5d8206[_0xe656('0x21')]],'as':_0x5d8206['as'],'attributes':_0x5d8206[_0xe656('0x1d')],'include':_0x5d8206[_0xe656('0x1f')]?_[_0xe656('0x20')](_0x5d8206['include'],function(_0x36e4fb){return{'model':db[_0x36e4fb[_0xe656('0x21')]],'as':_0x36e4fb['as'],'attributes':_0x36e4fb[_0xe656('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe656('0xd')](function(_0x2d93f8){logger['info'](_0xe656('0x17'),_0x2c4da5);logger[_0xe656('0x11')]('GetCampaign',_0x2c4da5,JSON[_0xe656('0x12')](_0x2d93f8));_0x571df0(_0x2d93f8);})[_0xe656('0x16')](function(_0x503725){logger[_0xe656('0x13')](_0xe656('0x17'),_0x503725[_0xe656('0x15')],_0x2c4da5);_0x80e691(_0x1bf17f[_0xe656('0x13')](0x1f4,_0x503725[_0xe656('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index ac2b984..acaeb5a 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 _0x024a=['../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id/hoppers','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addLists','addBlackLists','put','/:id','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router'];(function(_0x48ccc1,_0x55e9cb){var _0x9ffe13=function(_0x323a36){while(--_0x323a36){_0x48ccc1['push'](_0x48ccc1['shift']());}};_0x9ffe13(++_0x55e9cb);}(_0x024a,0xdb));var _0xa024=function(_0x684e49,_0x34e34d){_0x684e49=_0x684e49-0x0;var _0x1163c9=_0x024a[_0x684e49];return _0x1163c9;};'use strict';var multer=require(_0xa024('0x0'));var util=require(_0xa024('0x1'));var path=require(_0xa024('0x2'));var timeout=require(_0xa024('0x3'));var express=require('express');var router=express[_0xa024('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa024('0x5'));var config=require(_0xa024('0x6'));var controller=require(_0xa024('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa024('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa024('0x8')](_0xa024('0x9'),auth['isAuthenticated'](),controller[_0xa024('0xa')]);router[_0xa024('0x8')](_0xa024('0xb'),auth[_0xa024('0xc')](),controller[_0xa024('0xd')]);router['get'](_0xa024('0xe'),auth[_0xa024('0xc')](),controller[_0xa024('0xf')]);router[_0xa024('0x8')]('/:id/hopper_black',auth[_0xa024('0xc')](),controller['getHopperBlacks']);router[_0xa024('0x8')](_0xa024('0x10'),auth[_0xa024('0xc')](),controller[_0xa024('0x11')]);router['get'](_0xa024('0x12'),auth[_0xa024('0xc')](),controller['getBlackLists']);router[_0xa024('0x13')]('/',auth[_0xa024('0xc')](),controller[_0xa024('0x14')]);router[_0xa024('0x13')](_0xa024('0x15'),auth[_0xa024('0xc')](),controller['clone']);router['post'](_0xa024('0x10'),auth[_0xa024('0xc')](),controller[_0xa024('0x16')]);router[_0xa024('0x13')](_0xa024('0x12'),auth[_0xa024('0xc')](),controller[_0xa024('0x17')]);router[_0xa024('0x18')](_0xa024('0x19'),auth[_0xa024('0xc')](),controller[_0xa024('0x1a')]);router[_0xa024('0x1b')](_0xa024('0x19'),auth[_0xa024('0xc')](),controller[_0xa024('0x1c')]);router[_0xa024('0x1b')](_0xa024('0x10'),auth[_0xa024('0xc')](),controller[_0xa024('0x1d')]);router[_0xa024('0x1b')](_0xa024('0x12'),auth[_0xa024('0xc')](),controller[_0xa024('0x1e')]);module[_0xa024('0x1f')]=router; \ No newline at end of file +var _0x7be0=['/:id','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get'];(function(_0x3580a1,_0x52d460){var _0xda4fa7=function(_0x18096b){while(--_0x18096b){_0x3580a1['push'](_0x3580a1['shift']());}};_0xda4fa7(++_0x52d460);}(_0x7be0,0x1b4));var _0x07be=function(_0x49fc21,_0x2862f2){_0x49fc21=_0x49fc21-0x0;var _0x16b72c=_0x7be0[_0x49fc21];return _0x16b72c;};'use strict';var multer=require(_0x07be('0x0'));var util=require(_0x07be('0x1'));var path=require(_0x07be('0x2'));var timeout=require(_0x07be('0x3'));var express=require('express');var router=express[_0x07be('0x4')]();var auth=require(_0x07be('0x5'));var interaction=require(_0x07be('0x6'));var config=require(_0x07be('0x7'));var controller=require(_0x07be('0x8'));router['get']('/',auth[_0x07be('0x9')](),controller[_0x07be('0xa')]);router[_0x07be('0xb')](_0x07be('0xc'),auth[_0x07be('0x9')](),controller[_0x07be('0xd')]);router[_0x07be('0xb')]('/:id/hoppers',auth[_0x07be('0x9')](),controller[_0x07be('0xe')]);router[_0x07be('0xb')]('/:id/hopper_histories',auth[_0x07be('0x9')](),controller[_0x07be('0xf')]);router[_0x07be('0xb')](_0x07be('0x10'),auth[_0x07be('0x9')](),controller[_0x07be('0x11')]);router['get']('/:id/hopper_black',auth[_0x07be('0x9')](),controller['getHopperBlacks']);router[_0x07be('0xb')](_0x07be('0x12'),auth[_0x07be('0x9')](),controller[_0x07be('0x13')]);router[_0x07be('0xb')](_0x07be('0x14'),auth[_0x07be('0x9')](),controller[_0x07be('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x07be('0x16')]);router[_0x07be('0x17')]('/:id/clone',auth[_0x07be('0x9')](),controller[_0x07be('0x18')]);router[_0x07be('0x17')]('/:id/lists',auth['isAuthenticated'](),controller['addLists']);router[_0x07be('0x17')]('/:id/blacklists',auth[_0x07be('0x9')](),controller['addBlackLists']);router[_0x07be('0x19')](_0x07be('0xc'),auth[_0x07be('0x9')](),controller[_0x07be('0x1a')]);router[_0x07be('0x1b')]('/:id',auth[_0x07be('0x9')](),controller[_0x07be('0x1c')]);router['delete'](_0x07be('0x12'),auth[_0x07be('0x9')](),controller[_0x07be('0x1d')]);router[_0x07be('0x1b')](_0x07be('0x14'),auth[_0x07be('0x9')](),controller[_0x07be('0x1e')]);module[_0x07be('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 1347edd..e9a1d80 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 _0xa6a9=['TEXT','VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x522ae8,_0x3b637e){var _0x3189b9=function(_0x3115d4){while(--_0x3115d4){_0x522ae8['push'](_0x522ae8['shift']());}};_0x3189b9(++_0x3b637e);}(_0xa6a9,0x138));var _0x9a6a=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xa6a9[_0x52666e];return _0x515330;};'use strict';var Sequelize=require(_0x9a6a('0x0'));module[_0x9a6a('0x1')]={'key':{'type':Sequelize[_0x9a6a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9a6a('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x9a6a('0x2')]},'name':{'type':Sequelize[_0x9a6a('0x4')],'get':function(){return this[_0x9a6a('0x5')](_0x9a6a('0x6'));}}}; \ No newline at end of file +var _0x3847=['sequelize','exports','STRING','TEXT','getDataValue'];(function(_0x572706,_0xadcdb5){var _0x556ee9=function(_0x5c174b){while(--_0x5c174b){_0x572706['push'](_0x572706['shift']());}};_0x556ee9(++_0xadcdb5);}(_0x3847,0x14f));var _0x7384=function(_0x505aac,_0x5377fd){_0x505aac=_0x505aac-0x0;var _0xf2b032=_0x3847[_0x505aac];return _0xf2b032;};'use strict';var Sequelize=require(_0x7384('0x0'));module[_0x7384('0x1')]={'key':{'type':Sequelize[_0x7384('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7384('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x7384('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x7384('0x4')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index a6f7294..56c3649 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 _0x77f1=['save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','CannedAnswer','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','key','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x77f1,0xdf));var _0x177f=function(_0x11e104,_0x126e69){_0x11e104=_0x11e104-0x0;var _0x257471=_0x77f1[_0x11e104];return _0x257471;};'use strict';var pdf=require(_0x177f('0x0'));var emlformat=require(_0x177f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x177f('0x2'));var rp=require(_0x177f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x177f('0x4'));var util=require(_0x177f('0x5'));var path=require(_0x177f('0x6'));var sox=require(_0x177f('0x7'));var csv=require(_0x177f('0x8'));var ejs=require(_0x177f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x177f('0xa'));var crypto=require(_0x177f('0xb'));var jsforce=require(_0x177f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x177f('0xd'));var Papa=require(_0x177f('0xe'));var Redis=require(_0x177f('0xf'));var authService=require(_0x177f('0x10'));var qs=require(_0x177f('0x11'));var hardwareService=require(_0x177f('0x12'));var logger=require(_0x177f('0x13'))(_0x177f('0x14'));var utils=require('../../config/utils');var config=require(_0x177f('0x15'));var db=require(_0x177f('0x16'))['db'];function respondWithStatusCode(_0x54846e,_0x378654){_0x378654=_0x378654||0xcc;return function(_0x36603b){if(_0x36603b){return _0x54846e[_0x177f('0x17')](_0x378654);}return _0x54846e[_0x177f('0x18')](_0x378654)[_0x177f('0x19')]();};}function respondWithResult(_0x4fa8bc,_0x3a16cb){_0x3a16cb=_0x3a16cb||0xc8;return function(_0x3929c0){if(_0x3929c0){return _0x4fa8bc[_0x177f('0x18')](_0x3a16cb)[_0x177f('0x1a')](_0x3929c0);}};}function respondWithFilteredResult(_0x1cf444,_0x1c4da8){return function(_0x3b5ee9){if(_0x3b5ee9){var _0x33ecff=_0x3b5ee9[_0x177f('0x1b')],_0x51d587=_0x1c4da8[_0x177f('0x1c')],_0x332e47=_0x1c4da8[_0x177f('0x1c')]+_0x1c4da8[_0x177f('0x1d')],_0x4b44d3;if(_0x332e47>=_0x33ecff){_0x332e47=_0x33ecff;_0x4b44d3=0xc8;}else{_0x4b44d3=0xce;}_0x1cf444[_0x177f('0x18')](_0x4b44d3);return _0x1cf444['set'](_0x177f('0x1e'),_0x51d587+'-'+_0x332e47+'/'+_0x33ecff)[_0x177f('0x1a')](_0x3b5ee9);}return null;};}function patchUpdates(_0x1b7d54){return function(_0x329d52){try{jsonpatch['apply'](_0x329d52,_0x1b7d54,!![]);}catch(_0x1e22bb){return BPromise[_0x177f('0x1f')](_0x1e22bb);}return _0x329d52[_0x177f('0x20')]();};}function saveUpdates(_0x3ee4f9,_0x4eee9f){return function(_0x2ae3b3){if(_0x2ae3b3){return _0x2ae3b3[_0x177f('0x21')](_0x3ee4f9)['then'](function(_0x31546c){return _0x31546c;});}return null;};}function removeEntity(_0x14a8e3,_0x2dc87c){return function(_0x4b3fba){if(_0x4b3fba){return _0x4b3fba[_0x177f('0x22')]()[_0x177f('0x23')](function(){var _0x5974ee=_0x4b3fba[_0x177f('0x24')]({'plain':!![]});var _0x1799e0=_0x177f('0x25');return db[_0x177f('0x26')]['destroy']({'where':{'type':_0x1799e0,'resourceId':_0x5974ee['id']}})[_0x177f('0x23')](function(){return _0x4b3fba;});})[_0x177f('0x23')](function(){_0x14a8e3[_0x177f('0x18')](0xcc)[_0x177f('0x19')]();});}};}function handleEntityNotFound(_0x4a98ad,_0x14351c){return function(_0x44a84f){if(!_0x44a84f){_0x4a98ad[_0x177f('0x17')](0x194);}return _0x44a84f;};}function handleError(_0x5e726e,_0x1bc619){_0x1bc619=_0x1bc619||0x1f4;return function(_0x28b133){logger[_0x177f('0x27')](_0x28b133[_0x177f('0x28')]);if(_0x28b133[_0x177f('0x29')]){delete _0x28b133['name'];}_0x5e726e['status'](_0x1bc619)[_0x177f('0x2a')](_0x28b133);};}exports['index']=function(_0x246e41,_0x1a45d5){var _0x172cf5={},_0x274852={},_0x422c2f={'count':0x0,'rows':[]};var _0x43d88a=db[_0x177f('0x2b')]['rawAttributes'];_0x274852[_0x177f('0x2c')]=_[_0x177f('0x2d')](_0x43d88a);_0x274852[_0x177f('0x2e')]=_[_0x177f('0x2d')](_0x246e41[_0x177f('0x2e')]);_0x274852[_0x177f('0x2f')]=_[_0x177f('0x30')](_0x274852[_0x177f('0x2c')],_0x274852[_0x177f('0x2e')]);_0x172cf5[_0x177f('0x31')]=_[_0x177f('0x30')](_0x274852[_0x177f('0x2c')],qs[_0x177f('0x32')](_0x246e41[_0x177f('0x2e')][_0x177f('0x32')]));_0x172cf5[_0x177f('0x31')]=_0x172cf5[_0x177f('0x31')][_0x177f('0x33')]?_0x172cf5[_0x177f('0x31')]:_0x274852['model'];if(!_0x246e41[_0x177f('0x2e')][_0x177f('0x34')]('nolimit')){_0x172cf5[_0x177f('0x1d')]=qs[_0x177f('0x1d')](_0x246e41[_0x177f('0x2e')][_0x177f('0x1d')]);_0x172cf5[_0x177f('0x1c')]=qs[_0x177f('0x1c')](_0x246e41[_0x177f('0x2e')][_0x177f('0x1c')]);}_0x172cf5['order']=qs[_0x177f('0x35')](_0x246e41['query'][_0x177f('0x35')]);_0x172cf5['where']=qs['filters'](_[_0x177f('0x36')](_0x246e41[_0x177f('0x2e')],_0x274852[_0x177f('0x2f')]));if(_0x246e41[_0x177f('0x2e')]['filter']){_0x172cf5[_0x177f('0x37')]=_[_0x177f('0x38')](_0x172cf5[_0x177f('0x37')],{'$or':_['map'](_0x43d88a,function(_0xae3fbb){if(_0xae3fbb['type'][_0x177f('0x39')]!==_0x177f('0x3a')){var _0x54ff70={};_0x54ff70[_0xae3fbb['field']]={'$like':'%'+_0x246e41[_0x177f('0x2e')][_0x177f('0x3b')]+'%'};return _0x54ff70;}})});}_0x172cf5=_['merge']({},_0x172cf5,_0x246e41['options']);var _0x3d25d5={'where':_0x172cf5[_0x177f('0x37')]};return db[_0x177f('0x2b')][_0x177f('0x1b')](_0x3d25d5)[_0x177f('0x23')](function(_0x192364){_0x422c2f[_0x177f('0x1b')]=_0x192364;if(_0x246e41[_0x177f('0x2e')][_0x177f('0x3c')]){_0x172cf5[_0x177f('0x3d')]=[{'all':!![]}];}return db[_0x177f('0x2b')][_0x177f('0x3e')](_0x172cf5);})[_0x177f('0x23')](function(_0x9d42d7){_0x422c2f[_0x177f('0x3f')]=_0x9d42d7;return _0x422c2f;})[_0x177f('0x23')](respondWithFilteredResult(_0x1a45d5,_0x172cf5))[_0x177f('0x40')](handleError(_0x1a45d5,null));};exports[_0x177f('0x41')]=function(_0x3200fc,_0x636b64){var _0x42709f={'raw':!![],'where':{'id':_0x3200fc[_0x177f('0x42')]['id']}},_0x270d8c={};_0x270d8c[_0x177f('0x2c')]=_[_0x177f('0x2d')](db[_0x177f('0x2b')][_0x177f('0x43')]);_0x270d8c[_0x177f('0x2e')]=_['keys'](_0x3200fc[_0x177f('0x2e')]);_0x270d8c[_0x177f('0x2f')]=_['intersection'](_0x270d8c[_0x177f('0x2c')],_0x270d8c['query']);_0x42709f[_0x177f('0x31')]=_[_0x177f('0x30')](_0x270d8c['model'],qs['fields'](_0x3200fc[_0x177f('0x2e')][_0x177f('0x32')]));_0x42709f[_0x177f('0x31')]=_0x42709f['attributes'][_0x177f('0x33')]?_0x42709f[_0x177f('0x31')]:_0x270d8c['model'];if(_0x3200fc[_0x177f('0x2e')]['includeAll']){_0x42709f[_0x177f('0x3d')]=[{'all':!![]}];}_0x42709f=_[_0x177f('0x38')]({},_0x42709f,_0x3200fc[_0x177f('0x44')]);return db[_0x177f('0x2b')][_0x177f('0x45')](_0x42709f)[_0x177f('0x23')](handleEntityNotFound(_0x636b64,null))[_0x177f('0x23')](respondWithResult(_0x636b64,null))[_0x177f('0x40')](handleError(_0x636b64,null));};exports[_0x177f('0x21')]=function(_0x4bb972,_0x2cb115){if(_0x4bb972[_0x177f('0x46')]['id']){delete _0x4bb972[_0x177f('0x46')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x4bb972['params']['id']}})[_0x177f('0x23')](handleEntityNotFound(_0x2cb115,null))[_0x177f('0x23')](saveUpdates(_0x4bb972[_0x177f('0x46')],null))[_0x177f('0x23')](respondWithResult(_0x2cb115,null))[_0x177f('0x40')](handleError(_0x2cb115,null));};exports[_0x177f('0x22')]=function(_0x335484,_0x182c43){return db[_0x177f('0x2b')][_0x177f('0x45')]({'where':{'id':_0x335484[_0x177f('0x42')]['id']}})[_0x177f('0x23')](handleEntityNotFound(_0x182c43,null))[_0x177f('0x23')](removeEntity(_0x182c43,null))['catch'](handleError(_0x182c43,null));};exports[_0x177f('0x47')]=function(_0x5ee435,_0x77de1e){var _0x2eeb2c={'key':_0x5ee435[_0x177f('0x46')][_0x177f('0x39')]};if(_0x5ee435['body'][_0x177f('0x48')]){_0x2eeb2c[_0x177f('0x48')]=_0x5ee435['body'][_0x177f('0x48')];}else if(_0x5ee435[_0x177f('0x46')][_0x177f('0x49')]){_0x2eeb2c[_0x177f('0x49')]=_0x5ee435['body']['SmsAccountId'];}else if(_0x5ee435['body'][_0x177f('0x4a')]){_0x2eeb2c[_0x177f('0x4a')]=_0x5ee435['body'][_0x177f('0x4a')];}else if(_0x5ee435[_0x177f('0x46')][_0x177f('0x4b')]){_0x2eeb2c[_0x177f('0x4b')]=_0x5ee435[_0x177f('0x46')]['ChatWebsiteId'];}return db[_0x177f('0x2b')]['find']({'where':_0x2eeb2c})['then'](function(_0x1ef3fc){if(_0x1ef3fc){throw new db[(_0x177f('0x4c'))][(_0x177f('0x4d'))](_0x177f('0x4e'));}return db[_0x177f('0x2b')]['create'](_0x5ee435[_0x177f('0x46')]);})[_0x177f('0x23')](function(_0xd020a6){var _0x594e14=_0x5ee435['user'][_0x177f('0x24')]({'plain':!![]});if(!_0x594e14)throw new Error(_0x177f('0x4f'));if(_0x594e14['role']===_0x177f('0x50')){var _0x243164=_0xd020a6['get']({'plain':!![]});return db[_0x177f('0x51')][_0x177f('0x45')]({'where':{'name':_0x177f('0x25'),'userProfileId':_0x594e14[_0x177f('0x52')]},'raw':!![]})[_0x177f('0x23')](function(_0x62d389){if(_0x62d389&&_0x62d389[_0x177f('0x53')]===0x0){return db[_0x177f('0x26')][_0x177f('0x47')]({'name':_0x243164[_0x177f('0x29')],'resourceId':_0x243164['id'],'type':_0x62d389[_0x177f('0x29')],'sectionId':_0x62d389['id']},{})['then'](function(){return _0xd020a6;});}else{return _0xd020a6;}})[_0x177f('0x40')](function(_0x5bea10){logger[_0x177f('0x27')](_0x177f('0x54'),_0x5bea10);throw _0x5bea10;});}return _0xd020a6;})['then'](respondWithResult(_0x77de1e,0xc9))[_0x177f('0x40')](handleError(_0x77de1e,null));}; \ No newline at end of file +var _0x8225=['CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','model','keys','query','filters','intersection','fields','length','attributes','limit','order','sort','pick','where','merge','map','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','show','params','find','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','create','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','crypto','jsforce','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','set','Content-Range','reject','save','update','then','destroy','get'];(function(_0x5aedbc,_0x41eab8){var _0xc9a701=function(_0x3e965e){while(--_0x3e965e){_0x5aedbc['push'](_0x5aedbc['shift']());}};_0xc9a701(++_0x41eab8);}(_0x8225,0x1db));var _0x5822=function(_0x56574a,_0x230873){_0x56574a=_0x56574a-0x0;var _0x3b9fed=_0x8225[_0x56574a];return _0x3b9fed;};'use strict';var pdf=require(_0x5822('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5822('0x1'));var zipdir=require(_0x5822('0x2'));var jsonpatch=require(_0x5822('0x3'));var rp=require(_0x5822('0x4'));var moment=require(_0x5822('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5822('0x6'));var sox=require(_0x5822('0x7'));var csv=require('to-csv');var ejs=require(_0x5822('0x8'));var fs=require('fs');var _=require(_0x5822('0x9'));var squel=require('squel');var crypto=require(_0x5822('0xa'));var jsforce=require(_0x5822('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5822('0xc'));var querystring=require(_0x5822('0xd'));var Papa=require(_0x5822('0xe'));var Redis=require(_0x5822('0xf'));var authService=require(_0x5822('0x10'));var qs=require(_0x5822('0x11'));var hardwareService=require(_0x5822('0x12'));var logger=require(_0x5822('0x13'))(_0x5822('0x14'));var utils=require(_0x5822('0x15'));var config=require(_0x5822('0x16'));var db=require(_0x5822('0x17'))['db'];function respondWithStatusCode(_0x4f96ff,_0x54f5ea){_0x54f5ea=_0x54f5ea||0xcc;return function(_0x525329){if(_0x525329){return _0x4f96ff['sendStatus'](_0x54f5ea);}return _0x4f96ff[_0x5822('0x18')](_0x54f5ea)[_0x5822('0x19')]();};}function respondWithResult(_0x39a8ea,_0x227683){_0x227683=_0x227683||0xc8;return function(_0x27dd7b){if(_0x27dd7b){return _0x39a8ea[_0x5822('0x18')](_0x227683)['json'](_0x27dd7b);}};}function respondWithFilteredResult(_0x2706d1,_0x1f45a2){return function(_0x2a7349){if(_0x2a7349){var _0x2c3c54=_0x2a7349['count'],_0x3ad048=_0x1f45a2['offset'],_0x57f159=_0x1f45a2[_0x5822('0x1a')]+_0x1f45a2['limit'],_0x6fd1e2;if(_0x57f159>=_0x2c3c54){_0x57f159=_0x2c3c54;_0x6fd1e2=0xc8;}else{_0x6fd1e2=0xce;}_0x2706d1[_0x5822('0x18')](_0x6fd1e2);return _0x2706d1[_0x5822('0x1b')](_0x5822('0x1c'),_0x3ad048+'-'+_0x57f159+'/'+_0x2c3c54)['json'](_0x2a7349);}return null;};}function patchUpdates(_0x5b073c){return function(_0x19231e){try{jsonpatch['apply'](_0x19231e,_0x5b073c,!![]);}catch(_0x5e3ff5){return BPromise[_0x5822('0x1d')](_0x5e3ff5);}return _0x19231e[_0x5822('0x1e')]();};}function saveUpdates(_0x57e58b,_0x3ba835){return function(_0xe64467){if(_0xe64467){return _0xe64467[_0x5822('0x1f')](_0x57e58b)[_0x5822('0x20')](function(_0x434f3c){return _0x434f3c;});}return null;};}function removeEntity(_0xe71c3f,_0x2d17ac){return function(_0xaba6ba){if(_0xaba6ba){return _0xaba6ba[_0x5822('0x21')]()[_0x5822('0x20')](function(){var _0x5062d5=_0xaba6ba[_0x5822('0x22')]({'plain':!![]});var _0x453210=_0x5822('0x23');return db[_0x5822('0x24')][_0x5822('0x21')]({'where':{'type':_0x453210,'resourceId':_0x5062d5['id']}})[_0x5822('0x20')](function(){return _0xaba6ba;});})[_0x5822('0x20')](function(){_0xe71c3f['status'](0xcc)[_0x5822('0x19')]();});}};}function handleEntityNotFound(_0x423d47,_0x91fcd9){return function(_0x512047){if(!_0x512047){_0x423d47[_0x5822('0x25')](0x194);}return _0x512047;};}function handleError(_0xeee8be,_0x2f4ce0){_0x2f4ce0=_0x2f4ce0||0x1f4;return function(_0x798df){logger[_0x5822('0x26')](_0x798df[_0x5822('0x27')]);if(_0x798df[_0x5822('0x28')]){delete _0x798df['name'];}_0xeee8be[_0x5822('0x18')](_0x2f4ce0)[_0x5822('0x29')](_0x798df);};}exports[_0x5822('0x2a')]=function(_0x222a3e,_0x22a15c){var _0x228dcb={},_0x40e9a9={},_0x19b44b={'count':0x0,'rows':[]};var _0xbac2d6=db[_0x5822('0x2b')][_0x5822('0x2c')];_0x40e9a9[_0x5822('0x2d')]=_[_0x5822('0x2e')](_0xbac2d6);_0x40e9a9['query']=_['keys'](_0x222a3e[_0x5822('0x2f')]);_0x40e9a9[_0x5822('0x30')]=_['intersection'](_0x40e9a9[_0x5822('0x2d')],_0x40e9a9[_0x5822('0x2f')]);_0x228dcb['attributes']=_[_0x5822('0x31')](_0x40e9a9[_0x5822('0x2d')],qs[_0x5822('0x32')](_0x222a3e['query'][_0x5822('0x32')]));_0x228dcb['attributes']=_0x228dcb['attributes'][_0x5822('0x33')]?_0x228dcb[_0x5822('0x34')]:_0x40e9a9[_0x5822('0x2d')];if(!_0x222a3e[_0x5822('0x2f')]['hasOwnProperty']('nolimit')){_0x228dcb[_0x5822('0x35')]=qs[_0x5822('0x35')](_0x222a3e[_0x5822('0x2f')][_0x5822('0x35')]);_0x228dcb['offset']=qs[_0x5822('0x1a')](_0x222a3e[_0x5822('0x2f')][_0x5822('0x1a')]);}_0x228dcb[_0x5822('0x36')]=qs['sort'](_0x222a3e[_0x5822('0x2f')][_0x5822('0x37')]);_0x228dcb['where']=qs[_0x5822('0x30')](_[_0x5822('0x38')](_0x222a3e[_0x5822('0x2f')],_0x40e9a9[_0x5822('0x30')]));if(_0x222a3e[_0x5822('0x2f')]['filter']){_0x228dcb[_0x5822('0x39')]=_[_0x5822('0x3a')](_0x228dcb['where'],{'$or':_[_0x5822('0x3b')](_0xbac2d6,function(_0x2d300e){if(_0x2d300e['type']['key']!==_0x5822('0x3c')){var _0x1ecef8={};_0x1ecef8[_0x2d300e[_0x5822('0x3d')]]={'$like':'%'+_0x222a3e['query']['filter']+'%'};return _0x1ecef8;}})});}_0x228dcb=_[_0x5822('0x3a')]({},_0x228dcb,_0x222a3e[_0x5822('0x3e')]);var _0x20128f={'where':_0x228dcb[_0x5822('0x39')]};return db['CannedAnswer'][_0x5822('0x3f')](_0x20128f)[_0x5822('0x20')](function(_0x42a379){_0x19b44b[_0x5822('0x3f')]=_0x42a379;if(_0x222a3e[_0x5822('0x2f')][_0x5822('0x40')]){_0x228dcb[_0x5822('0x41')]=[{'all':!![]}];}return db[_0x5822('0x2b')][_0x5822('0x42')](_0x228dcb);})[_0x5822('0x20')](function(_0x1bb75e){_0x19b44b[_0x5822('0x43')]=_0x1bb75e;return _0x19b44b;})[_0x5822('0x20')](respondWithFilteredResult(_0x22a15c,_0x228dcb))[_0x5822('0x44')](handleError(_0x22a15c,null));};exports[_0x5822('0x45')]=function(_0x227fc7,_0x339f58){var _0x2e3982={'raw':!![],'where':{'id':_0x227fc7[_0x5822('0x46')]['id']}},_0x4d6715={};_0x4d6715[_0x5822('0x2d')]=_[_0x5822('0x2e')](db[_0x5822('0x2b')][_0x5822('0x2c')]);_0x4d6715[_0x5822('0x2f')]=_[_0x5822('0x2e')](_0x227fc7[_0x5822('0x2f')]);_0x4d6715[_0x5822('0x30')]=_['intersection'](_0x4d6715[_0x5822('0x2d')],_0x4d6715[_0x5822('0x2f')]);_0x2e3982['attributes']=_[_0x5822('0x31')](_0x4d6715[_0x5822('0x2d')],qs[_0x5822('0x32')](_0x227fc7[_0x5822('0x2f')][_0x5822('0x32')]));_0x2e3982[_0x5822('0x34')]=_0x2e3982['attributes'][_0x5822('0x33')]?_0x2e3982[_0x5822('0x34')]:_0x4d6715[_0x5822('0x2d')];if(_0x227fc7[_0x5822('0x2f')]['includeAll']){_0x2e3982['include']=[{'all':!![]}];}_0x2e3982=_[_0x5822('0x3a')]({},_0x2e3982,_0x227fc7[_0x5822('0x3e')]);return db[_0x5822('0x2b')][_0x5822('0x47')](_0x2e3982)[_0x5822('0x20')](handleEntityNotFound(_0x339f58,null))['then'](respondWithResult(_0x339f58,null))[_0x5822('0x44')](handleError(_0x339f58,null));};exports[_0x5822('0x1f')]=function(_0x20b674,_0x2c453e){if(_0x20b674[_0x5822('0x48')]['id']){delete _0x20b674[_0x5822('0x48')]['id'];}return db[_0x5822('0x2b')]['find']({'where':{'id':_0x20b674[_0x5822('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c453e,null))[_0x5822('0x20')](saveUpdates(_0x20b674['body'],null))[_0x5822('0x20')](respondWithResult(_0x2c453e,null))[_0x5822('0x44')](handleError(_0x2c453e,null));};exports[_0x5822('0x21')]=function(_0x43bcb1,_0x4f2480){return db['CannedAnswer']['find']({'where':{'id':_0x43bcb1[_0x5822('0x46')]['id']}})['then'](handleEntityNotFound(_0x4f2480,null))[_0x5822('0x20')](removeEntity(_0x4f2480,null))[_0x5822('0x44')](handleError(_0x4f2480,null));};exports['create']=function(_0x4ad12b,_0x115098){var _0x4efa45={'key':_0x4ad12b[_0x5822('0x48')][_0x5822('0x49')]};if(_0x4ad12b[_0x5822('0x48')][_0x5822('0x4a')]){_0x4efa45[_0x5822('0x4a')]=_0x4ad12b[_0x5822('0x48')][_0x5822('0x4a')];}else if(_0x4ad12b[_0x5822('0x48')][_0x5822('0x4b')]){_0x4efa45[_0x5822('0x4b')]=_0x4ad12b['body'][_0x5822('0x4b')];}else if(_0x4ad12b[_0x5822('0x48')][_0x5822('0x4c')]){_0x4efa45['OpenchannelAccountId']=_0x4ad12b['body']['OpenchannelAccountId'];}else if(_0x4ad12b[_0x5822('0x48')]['ChatWebsiteId']){_0x4efa45[_0x5822('0x4d')]=_0x4ad12b[_0x5822('0x48')][_0x5822('0x4d')];}return db['CannedAnswer'][_0x5822('0x47')]({'where':_0x4efa45})['then'](function(_0x240f34){if(_0x240f34){throw new db[(_0x5822('0x4e'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x5822('0x2b')][_0x5822('0x4f')](_0x4ad12b[_0x5822('0x48')]);})[_0x5822('0x20')](function(_0x4e294f){var _0x59e287=_0x4ad12b[_0x5822('0x50')][_0x5822('0x22')]({'plain':!![]});if(!_0x59e287)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x59e287[_0x5822('0x51')]==='user'){var _0x29d25a=_0x4e294f[_0x5822('0x22')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5822('0x23'),'userProfileId':_0x59e287[_0x5822('0x52')]},'raw':!![]})[_0x5822('0x20')](function(_0x5e82db){if(_0x5e82db&&_0x5e82db[_0x5822('0x53')]===0x0){return db[_0x5822('0x24')][_0x5822('0x4f')]({'name':_0x29d25a[_0x5822('0x28')],'resourceId':_0x29d25a['id'],'type':_0x5e82db[_0x5822('0x28')],'sectionId':_0x5e82db['id']},{})[_0x5822('0x20')](function(){return _0x4e294f;});}else{return _0x4e294f;}})[_0x5822('0x44')](function(_0x114449){logger[_0x5822('0x26')](_0x5822('0x54'),_0x114449);throw _0x114449;});}return _0x4e294f;})[_0x5822('0x20')](respondWithResult(_0x115098,0xc9))[_0x5822('0x44')](handleError(_0x115098,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 202119c..92bd34e 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 _0xf089=['./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x310523,_0x1fef07){var _0x5f4e6a=function(_0x64f3d6){while(--_0x64f3d6){_0x310523['push'](_0x310523['shift']());}};_0x5f4e6a(++_0x1fef07);}(_0xf089,0x1b8));var _0x9f08=function(_0x1dfb8b,_0x443d83){_0x1dfb8b=_0x1dfb8b-0x0;var _0x43c6a0=_0xf089[_0x1dfb8b];return _0x43c6a0;};'use strict';var _=require(_0x9f08('0x0'));var util=require(_0x9f08('0x1'));var logger=require(_0x9f08('0x2'))(_0x9f08('0x3'));var moment=require(_0x9f08('0x4'));var BPromise=require(_0x9f08('0x5'));var rp=require(_0x9f08('0x6'));var fs=require('fs');var path=require(_0x9f08('0x7'));var rimraf=require(_0x9f08('0x8'));var config=require(_0x9f08('0x9'));var attributes=require(_0x9f08('0xa'));module['exports']=function(_0x5023ff,_0x4422c9){return _0x5023ff['define'](_0x9f08('0xb'),attributes,{'tableName':_0x9f08('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f08('0xd'),'collate':_0x9f08('0xe')});}; \ No newline at end of file +var _0x1ad2=['path','rimraf','./cannedAnswer.attributes','exports','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise'];(function(_0x15f6a4,_0x289ec4){var _0x44b5fc=function(_0x2cc5b0){while(--_0x2cc5b0){_0x15f6a4['push'](_0x15f6a4['shift']());}};_0x44b5fc(++_0x289ec4);}(_0x1ad2,0xcb));var _0x21ad=function(_0xe1b0e1,_0x5dec90){_0xe1b0e1=_0xe1b0e1-0x0;var _0x38fd59=_0x1ad2[_0xe1b0e1];return _0x38fd59;};'use strict';var _=require('lodash');var util=require(_0x21ad('0x0'));var logger=require(_0x21ad('0x1'))(_0x21ad('0x2'));var moment=require('moment');var BPromise=require(_0x21ad('0x3'));var rp=require(_0x21ad('0x4'));var fs=require('fs');var path=require(_0x21ad('0x5'));var rimraf=require(_0x21ad('0x6'));var config=require('../../config/environment');var attributes=require(_0x21ad('0x7'));module[_0x21ad('0x8')]=function(_0x5e8faa,_0x17b1fb){return _0x5e8faa[_0x21ad('0x9')]('CannedAnswer',attributes,{'tableName':_0x21ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x21ad('0xb'),'collate':_0x21ad('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 0115a06..d6428cc 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 _0xa259=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa259,0xfd));var _0x9a25=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa259[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x9a25('0x0'));var util=require(_0x9a25('0x1'));var moment=require(_0x9a25('0x2'));var BPromise=require(_0x9a25('0x3'));var rs=require(_0x9a25('0x4'));var fs=require('fs');var Redis=require(_0x9a25('0x5'));var db=require(_0x9a25('0x6'))['db'];var utils=require(_0x9a25('0x7'));var logger=require(_0x9a25('0x8'))(_0x9a25('0x9'));var config=require(_0x9a25('0xa'));var jayson=require(_0x9a25('0xb'));var client=jayson[_0x9a25('0xc')][_0x9a25('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b8e01,_0x13b019,_0x16eb61){return new BPromise(function(_0x3bb85e,_0x5c2dac){return client[_0x9a25('0xe')](_0x5b8e01,_0x16eb61)[_0x9a25('0xf')](function(_0x2e8bbf){logger[_0x9a25('0x10')](_0x9a25('0x11'),_0x13b019,_0x9a25('0x12'));logger[_0x9a25('0x13')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x13b019,_0x9a25('0x12'),JSON[_0x9a25('0x14')](_0x2e8bbf));if(_0x2e8bbf[_0x9a25('0x15')]){if(_0x2e8bbf['error']['code']===0x1f4){logger[_0x9a25('0x15')]('CannedAnswer,\x20%s,\x20%s',_0x13b019,_0x2e8bbf[_0x9a25('0x15')][_0x9a25('0x16')]);return _0x5c2dac(_0x2e8bbf[_0x9a25('0x15')][_0x9a25('0x16')]);}logger['error'](_0x9a25('0x11'),_0x13b019,_0x2e8bbf[_0x9a25('0x15')][_0x9a25('0x16')]);return _0x3bb85e(_0x2e8bbf[_0x9a25('0x15')][_0x9a25('0x16')]);}else{logger[_0x9a25('0x10')](_0x9a25('0x11'),_0x13b019,_0x9a25('0x12'));_0x3bb85e(_0x2e8bbf[_0x9a25('0x17')][_0x9a25('0x16')]);}})[_0x9a25('0x18')](function(_0x52b4f2){logger[_0x9a25('0x15')](_0x9a25('0x11'),_0x13b019,_0x52b4f2);_0x5c2dac(_0x52b4f2);});});} \ No newline at end of file +var _0x51b5=['info','request\x20sent','result','lodash','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CannedAnswer,\x20%s,\x20%s','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4c4d06,_0x452e60){var _0x400506=function(_0x15a00a){while(--_0x15a00a){_0x4c4d06['push'](_0x4c4d06['shift']());}};_0x400506(++_0x452e60);}(_0x51b5,0x11b));var _0x551b=function(_0x269d49,_0x59a326){_0x269d49=_0x269d49-0x0;var _0x505ee2=_0x51b5[_0x269d49];return _0x505ee2;};'use strict';var _=require(_0x551b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x551b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x551b('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x551b('0x3'))(_0x551b('0x4'));var config=require(_0x551b('0x5'));var jayson=require(_0x551b('0x6'));var client=jayson[_0x551b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x374a0c,_0x5ba26c,_0x2fbb99){return new BPromise(function(_0x3123e3,_0xcc3c35){return client[_0x551b('0x8')](_0x374a0c,_0x2fbb99)[_0x551b('0x9')](function(_0x9af257){logger['info'](_0x551b('0xa'),_0x5ba26c,'request\x20sent');logger[_0x551b('0xb')](_0x551b('0xc'),_0x5ba26c,'request\x20sent',JSON[_0x551b('0xd')](_0x9af257));if(_0x9af257[_0x551b('0xe')]){if(_0x9af257['error'][_0x551b('0xf')]===0x1f4){logger[_0x551b('0xe')](_0x551b('0xa'),_0x5ba26c,_0x9af257[_0x551b('0xe')]['message']);return _0xcc3c35(_0x9af257[_0x551b('0xe')]['message']);}logger[_0x551b('0xe')](_0x551b('0xa'),_0x5ba26c,_0x9af257[_0x551b('0xe')][_0x551b('0x10')]);return _0x3123e3(_0x9af257[_0x551b('0xe')][_0x551b('0x10')]);}else{logger[_0x551b('0x11')](_0x551b('0xa'),_0x5ba26c,_0x551b('0x12'));_0x3123e3(_0x9af257[_0x551b('0x13')][_0x551b('0x10')]);}})['catch'](function(_0x4d8df4){logger[_0x551b('0xe')](_0x551b('0xa'),_0x5ba26c,_0x4d8df4);_0xcc3c35(_0x4d8df4);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index cc640ce..d4d1752 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 _0x07bc=['isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get'];(function(_0x43b1f2,_0x39b223){var _0x3dc370=function(_0x344811){while(--_0x344811){_0x43b1f2['push'](_0x43b1f2['shift']());}};_0x3dc370(++_0x39b223);}(_0x07bc,0x1b2));var _0xc07b=function(_0x49d1ac,_0x555f3b){_0x49d1ac=_0x49d1ac-0x0;var _0x4a9c61=_0x07bc[_0x49d1ac];return _0x4a9c61;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc07b('0x0'));var timeout=require(_0xc07b('0x1'));var express=require(_0xc07b('0x2'));var router=express['Router']();var auth=require(_0xc07b('0x3'));var interaction=require(_0xc07b('0x4'));var config=require(_0xc07b('0x5'));var controller=require(_0xc07b('0x6'));router[_0xc07b('0x7')]('/',auth[_0xc07b('0x8')](),controller['index']);router['get'](_0xc07b('0x9'),auth['isAuthenticated'](),controller[_0xc07b('0xa')]);router[_0xc07b('0xb')]('/',auth['isAuthenticated'](),controller[_0xc07b('0xc')]);router[_0xc07b('0xd')]('/:id',auth[_0xc07b('0x8')](),controller['update']);router[_0xc07b('0xe')](_0xc07b('0x9'),auth['isAuthenticated'](),controller[_0xc07b('0xf')]);module[_0xc07b('0x10')]=router; \ No newline at end of file +var _0x10e9=['exports','util','./cannedAnswer.controller','get','index','/:id','show','post','create','put','isAuthenticated','update','destroy'];(function(_0x22b377,_0x34e228){var _0x2168d2=function(_0x33a14a){while(--_0x33a14a){_0x22b377['push'](_0x22b377['shift']());}};_0x2168d2(++_0x34e228);}(_0x10e9,0x1a1));var _0x910e=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0x10e9[_0xfedc72];return _0x2c7c78;};'use strict';var multer=require('multer');var util=require(_0x910e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x910e('0x1'));router[_0x910e('0x2')]('/',auth['isAuthenticated'](),controller[_0x910e('0x3')]);router[_0x910e('0x2')](_0x910e('0x4'),auth['isAuthenticated'](),controller[_0x910e('0x5')]);router[_0x910e('0x6')]('/',auth['isAuthenticated'](),controller[_0x910e('0x7')]);router[_0x910e('0x8')](_0x910e('0x4'),auth[_0x910e('0x9')](),controller[_0x910e('0xa')]);router['delete'](_0x910e('0x4'),auth[_0x910e('0x9')](),controller[_0x910e('0xb')]);module[_0x910e('0xc')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index cd2f895..4117c12 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 _0x0546=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0xf4c996,_0x9782a1){var _0x47c52b=function(_0x3205c0){while(--_0x3205c0){_0xf4c996['push'](_0xf4c996['shift']());}};_0x47c52b(++_0x9782a1);}(_0x0546,0x13a));var _0x6054=function(_0x285824,_0x3da647){_0x285824=_0x285824-0x0;var _0x311d7e=_0x0546[_0x285824];return _0x311d7e;};'use strict';var Sequelize=require(_0x6054('0x0'));module[_0x6054('0x1')]={'calldate':{'type':Sequelize[_0x6054('0x2')],'allowNull':![],'defaultValue':_0x6054('0x3')},'clid':{'type':Sequelize[_0x6054('0x4')]},'src':{'type':Sequelize[_0x6054('0x4')]},'dst':{'type':Sequelize[_0x6054('0x4')]},'dcontext':{'type':Sequelize[_0x6054('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x6054('0x4')]},'duration':{'type':Sequelize[_0x6054('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6054('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6054('0x4')]},'amaflags':{'type':Sequelize[_0x6054('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x6054('0x4')]},'userfield':{'type':Sequelize[_0x6054('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x6054('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x6054('0x4')]},'type':{'type':Sequelize[_0x6054('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfe77=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x513c8b,_0x4a8e73){var _0x32f3e6=function(_0x595821){while(--_0x595821){_0x513c8b['push'](_0x513c8b['shift']());}};_0x32f3e6(++_0x4a8e73);}(_0xfe77,0xcb));var _0x7fe7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe77[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7fe7('0x0')]={'calldate':{'type':Sequelize[_0x7fe7('0x1')],'allowNull':![],'defaultValue':_0x7fe7('0x2')},'clid':{'type':Sequelize[_0x7fe7('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x7fe7('0x3')]},'channel':{'type':Sequelize[_0x7fe7('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x7fe7('0x3')]},'lastdata':{'type':Sequelize[_0x7fe7('0x3')]},'duration':{'type':Sequelize[_0x7fe7('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7fe7('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7fe7('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7fe7('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x7fe7('0x3')]},'peeraccount':{'type':Sequelize[_0x7fe7('0x3')]},'type':{'type':Sequelize[_0x7fe7('0x3')]},'tag':{'type':Sequelize[_0x7fe7('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 0d9688f..f00452f 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 _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','then','stack','name','send','index','Cdr','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','where','pick','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','html-pdf'];(function(_0x51c0f2,_0x371fef){var _0x2a4fad=function(_0x674171){while(--_0x674171){_0x51c0f2['push'](_0x51c0f2['shift']());}};_0x2a4fad(++_0x371fef);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb0c872,_0x2cb37a){_0x2cb37a=_0x2cb37a||0xcc;return function(_0x19a27e){if(_0x19a27e){return _0xb0c872[_0x7995('0x19')](_0x2cb37a);}return _0xb0c872[_0x7995('0x1a')](_0x2cb37a)[_0x7995('0x1b')]();};}function respondWithResult(_0x2bbe7a,_0x4cc004){_0x4cc004=_0x4cc004||0xc8;return function(_0x58f5ad){if(_0x58f5ad){return _0x2bbe7a[_0x7995('0x1a')](_0x4cc004)[_0x7995('0x1c')](_0x58f5ad);}};}function respondWithFilteredResult(_0x24b5bb,_0x321ae8){return function(_0x3f1d3e){if(_0x3f1d3e){var _0x1a5310=_0x3f1d3e[_0x7995('0x1d')],_0x2202ce=_0x321ae8['offset'],_0x41cbf0=_0x321ae8[_0x7995('0x1e')]+_0x321ae8[_0x7995('0x1f')],_0x5377e5;if(_0x41cbf0>=_0x1a5310){_0x41cbf0=_0x1a5310;_0x5377e5=0xc8;}else{_0x5377e5=0xce;}_0x24b5bb[_0x7995('0x1a')](_0x5377e5);return _0x24b5bb[_0x7995('0x20')](_0x7995('0x21'),_0x2202ce+'-'+_0x41cbf0+'/'+_0x1a5310)[_0x7995('0x1c')](_0x3f1d3e);}return null;};}function patchUpdates(_0x4faa60){return function(_0x54c9ae){try{jsonpatch[_0x7995('0x22')](_0x54c9ae,_0x4faa60,!![]);}catch(_0x5e6f90){return BPromise['reject'](_0x5e6f90);}return _0x54c9ae[_0x7995('0x23')]();};}function saveUpdates(_0x3d463e,_0x4cbe10){return function(_0x3a9b54){if(_0x3a9b54){return _0x3a9b54['update'](_0x3d463e)['then'](function(_0x3e4c54){return _0x3e4c54;});}return null;};}function removeEntity(_0x327b1f,_0x350fd9){return function(_0x1a8568){if(_0x1a8568){return _0x1a8568[_0x7995('0x24')]()[_0x7995('0x25')](function(){_0x327b1f['status'](0xcc)[_0x7995('0x1b')]();});}};}function handleEntityNotFound(_0x46ee4b,_0x204507){return function(_0x285437){if(!_0x285437){_0x46ee4b[_0x7995('0x19')](0x194);}return _0x285437;};}function handleError(_0x13bc35,_0x475351){_0x475351=_0x475351||0x1f4;return function(_0x472195){logger['error'](_0x472195[_0x7995('0x26')]);if(_0x472195[_0x7995('0x27')]){delete _0x472195[_0x7995('0x27')];}_0x13bc35[_0x7995('0x1a')](_0x475351)[_0x7995('0x28')](_0x472195);};}exports[_0x7995('0x29')]=function(_0x56691a,_0x47625f){var _0x5911c3={},_0x229742={},_0x49bc7e={'count':0x0,'rows':[]};var _0xf16cc2=db[_0x7995('0x2a')][_0x7995('0x2b')];_0x229742['model']=_[_0x7995('0x2c')](_0xf16cc2);_0x229742['query']=_[_0x7995('0x2c')](_0x56691a[_0x7995('0x2d')]);_0x229742[_0x7995('0x2e')]=_['intersection'](_0x229742['model'],_0x229742['query']);_0x5911c3[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x229742[_0x7995('0x31')],qs[_0x7995('0x32')](_0x56691a[_0x7995('0x2d')][_0x7995('0x32')]));_0x5911c3['attributes']=_0x5911c3['attributes'][_0x7995('0x33')]?_0x5911c3['attributes']:_0x229742[_0x7995('0x31')];if(!_0x56691a[_0x7995('0x2d')][_0x7995('0x34')](_0x7995('0x35'))){_0x5911c3[_0x7995('0x1f')]=qs['limit'](_0x56691a[_0x7995('0x2d')][_0x7995('0x1f')]);_0x5911c3['offset']=qs['offset'](_0x56691a['query'][_0x7995('0x1e')]);}_0x5911c3[_0x7995('0x36')]=qs['sort'](_0x56691a[_0x7995('0x2d')]['sort']);_0x5911c3[_0x7995('0x37')]=qs[_0x7995('0x2e')](_[_0x7995('0x38')](_0x56691a['query'],_0x229742['filters']));if(_0x56691a[_0x7995('0x2d')]['filter']){_0x5911c3['where']=_[_0x7995('0x39')](_0x5911c3[_0x7995('0x37')],{'$or':_['map'](_0xf16cc2,function(_0x1baa15){if(_0x1baa15[_0x7995('0x3a')][_0x7995('0x3b')]!==_0x7995('0x3c')){var _0x1e3dbf={};_0x1e3dbf[_0x1baa15['field']]={'$like':'%'+_0x56691a[_0x7995('0x2d')][_0x7995('0x3d')]+'%'};return _0x1e3dbf;}})});}_0x5911c3=_[_0x7995('0x39')]({},_0x5911c3,_0x56691a[_0x7995('0x3e')]);var _0x4b1541={'where':_0x5911c3[_0x7995('0x37')]};return db[_0x7995('0x2a')][_0x7995('0x1d')](_0x4b1541)[_0x7995('0x25')](function(_0x1f5bee){_0x49bc7e[_0x7995('0x1d')]=_0x1f5bee;if(_0x56691a['query'][_0x7995('0x3f')]){_0x5911c3[_0x7995('0x40')]=[{'all':!![]}];}return db[_0x7995('0x2a')][_0x7995('0x41')](_0x5911c3);})[_0x7995('0x25')](function(_0x298fc2){_0x49bc7e[_0x7995('0x42')]=_0x298fc2;return _0x49bc7e;})[_0x7995('0x25')](respondWithFilteredResult(_0x47625f,_0x5911c3))[_0x7995('0x43')](handleError(_0x47625f,null));};exports[_0x7995('0x44')]=function(_0x6fe77b,_0x270d52){var _0x7b4e67={'raw':!![],'where':{'id':_0x6fe77b['params']['id']}},_0x53cda2={};_0x53cda2[_0x7995('0x31')]=_[_0x7995('0x2c')](db['Cdr']['rawAttributes']);_0x53cda2[_0x7995('0x2d')]=_['keys'](_0x6fe77b['query']);_0x53cda2[_0x7995('0x2e')]=_[_0x7995('0x30')](_0x53cda2[_0x7995('0x31')],_0x53cda2['query']);_0x7b4e67[_0x7995('0x2f')]=_['intersection'](_0x53cda2[_0x7995('0x31')],qs['fields'](_0x6fe77b['query'][_0x7995('0x32')]));_0x7b4e67[_0x7995('0x2f')]=_0x7b4e67[_0x7995('0x2f')][_0x7995('0x33')]?_0x7b4e67['attributes']:_0x53cda2[_0x7995('0x31')];if(_0x6fe77b[_0x7995('0x2d')][_0x7995('0x3f')]){_0x7b4e67[_0x7995('0x40')]=[{'all':!![]}];}_0x7b4e67=_['merge']({},_0x7b4e67,_0x6fe77b['options']);return db[_0x7995('0x2a')]['find'](_0x7b4e67)[_0x7995('0x25')](handleEntityNotFound(_0x270d52,null))['then'](respondWithResult(_0x270d52,null))[_0x7995('0x43')](handleError(_0x270d52,null));};exports['create']=function(_0x1e795e,_0x1b0373){return db['Cdr'][_0x7995('0x45')](_0x1e795e[_0x7995('0x46')],{})[_0x7995('0x25')](respondWithResult(_0x1b0373,0xc9))[_0x7995('0x43')](handleError(_0x1b0373,null));};exports['update']=function(_0x2458cb,_0x3e787d){if(_0x2458cb[_0x7995('0x46')]['id']){delete _0x2458cb['body']['id'];}return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x2458cb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x3e787d,null))[_0x7995('0x25')](saveUpdates(_0x2458cb['body'],null))[_0x7995('0x25')](respondWithResult(_0x3e787d,null))[_0x7995('0x43')](handleError(_0x3e787d,null));};exports['destroy']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x2a')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x48')]['id']}})[_0x7995('0x25')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x25')](removeEntity(_0x5843ba,null))[_0x7995('0x43')](handleError(_0x5843ba,null));};exports[_0x7995('0x49')]=function(_0x4d46bc,_0x427dcf){return db[_0x7995('0x2a')][_0x7995('0x49')]()['then'](respondWithResult(_0x427dcf,null))[_0x7995('0x43')](handleError(_0x427dcf,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','Cdr','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x22fde5,_0x2b6797){var _0x282da9=function(_0x2e4193){while(--_0x2e4193){_0x22fde5['push'](_0x22fde5['shift']());}};_0x282da9(++_0x2b6797);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['Cdr'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['Cdr'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 08ec4c1..0c43591 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 _0xeed3=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cdr.attributes','define','Cdr','cdr','accountcode','calldate','disposition','dst','uniqueid'];(function(_0x294f3d,_0x1b0f82){var _0x2c8f6c=function(_0x2303e6){while(--_0x2303e6){_0x294f3d['push'](_0x294f3d['shift']());}};_0x2c8f6c(++_0x1b0f82);}(_0xeed3,0x144));var _0x3eed=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xeed3[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x3eed('0x0'));var util=require(_0x3eed('0x1'));var logger=require('../../config/logger')(_0x3eed('0x2'));var moment=require(_0x3eed('0x3'));var BPromise=require(_0x3eed('0x4'));var rp=require(_0x3eed('0x5'));var fs=require('fs');var path=require(_0x3eed('0x6'));var rimraf=require(_0x3eed('0x7'));var config=require(_0x3eed('0x8'));var attributes=require(_0x3eed('0x9'));module['exports']=function(_0x1d8a6c,_0x187b06){return _0x1d8a6c[_0x3eed('0xa')](_0x3eed('0xb'),attributes,{'tableName':_0x3eed('0xc'),'paranoid':![],'indexes':[{'name':_0x3eed('0xd'),'fields':['accountcode']},{'name':_0x3eed('0xe'),'fields':['calldate']},{'name':_0x3eed('0xf'),'fields':[_0x3eed('0xf')]},{'name':_0x3eed('0x10'),'fields':[_0x3eed('0x10')]},{'name':'src','fields':['src']},{'name':'uniqueid','fields':[_0x3eed('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x21d6=['src','uniqueid','lodash','../../config/logger','api','moment','request-promise','rimraf','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst'];(function(_0x143620,_0x2738da){var _0x24fcec=function(_0x4ce62c){while(--_0x4ce62c){_0x143620['push'](_0x143620['shift']());}};_0x24fcec(++_0x2738da);}(_0x21d6,0x8a));var _0x621d=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x21d6[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x621d('0x0'));var util=require('util');var logger=require(_0x621d('0x1'))(_0x621d('0x2'));var moment=require(_0x621d('0x3'));var BPromise=require('bluebird');var rp=require(_0x621d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x621d('0x5'));var config=require('../../config/environment');var attributes=require(_0x621d('0x6'));module[_0x621d('0x7')]=function(_0x5d4916,_0x3afb2c){return _0x5d4916[_0x621d('0x8')](_0x621d('0x9'),attributes,{'tableName':_0x621d('0xa'),'paranoid':![],'indexes':[{'name':_0x621d('0xb'),'fields':[_0x621d('0xb')]},{'name':_0x621d('0xc'),'fields':[_0x621d('0xc')]},{'name':_0x621d('0xd'),'fields':[_0x621d('0xd')]},{'name':_0x621d('0xe'),'fields':['dst']},{'name':_0x621d('0xf'),'fields':['src']},{'name':_0x621d('0x10'),'fields':[_0x621d('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 b8cee1b..bbf0387 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 _0x2a8f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x2a8f,0x11d));var _0xf2a8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x2a8f[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xf2a8('0x0'));var util=require(_0xf2a8('0x1'));var moment=require(_0xf2a8('0x2'));var BPromise=require(_0xf2a8('0x3'));var rs=require(_0xf2a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf2a8('0x5'))['db'];var utils=require(_0xf2a8('0x6'));var logger=require(_0xf2a8('0x7'))(_0xf2a8('0x8'));var config=require(_0xf2a8('0x9'));var jayson=require(_0xf2a8('0xa'));var client=jayson['client'][_0xf2a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e878d,_0x3d843a,_0x2063af){return new BPromise(function(_0x26c1ed,_0x22592b){return client[_0xf2a8('0xc')](_0x4e878d,_0x2063af)[_0xf2a8('0xd')](function(_0x3df0e6){logger[_0xf2a8('0xe')](_0xf2a8('0xf'),_0x3d843a,'request\x20sent');logger['debug'](_0xf2a8('0x10'),_0x3d843a,_0xf2a8('0x11'),JSON[_0xf2a8('0x12')](_0x3df0e6));if(_0x3df0e6['error']){if(_0x3df0e6[_0xf2a8('0x13')][_0xf2a8('0x14')]===0x1f4){logger[_0xf2a8('0x13')]('Cdr,\x20%s,\x20%s',_0x3d843a,_0x3df0e6[_0xf2a8('0x13')][_0xf2a8('0x15')]);return _0x22592b(_0x3df0e6[_0xf2a8('0x13')][_0xf2a8('0x15')]);}logger[_0xf2a8('0x13')](_0xf2a8('0xf'),_0x3d843a,_0x3df0e6[_0xf2a8('0x13')][_0xf2a8('0x15')]);return _0x26c1ed(_0x3df0e6['error'][_0xf2a8('0x15')]);}else{logger['info'](_0xf2a8('0xf'),_0x3d843a,_0xf2a8('0x11'));_0x26c1ed(_0x3df0e6['result'][_0xf2a8('0x15')]);}})['catch'](function(_0x4c8e9b){logger[_0xf2a8('0x13')](_0xf2a8('0xf'),_0x3d843a,_0x4c8e9b);_0x22592b(_0x4c8e9b);});});} \ No newline at end of file +var _0x2922=['info','debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x56c10d,_0x41c8f2){var _0xeaa0ce=function(_0x1b2a94){while(--_0x1b2a94){_0x56c10d['push'](_0x56c10d['shift']());}};_0xeaa0ce(++_0x41c8f2);}(_0x2922,0x1e6));var _0x2292=function(_0x1f13d8,_0x3cbeb2){_0x1f13d8=_0x1f13d8-0x0;var _0x315e1c=_0x2922[_0x1f13d8];return _0x315e1c;};'use strict';var _=require(_0x2292('0x0'));var util=require(_0x2292('0x1'));var moment=require(_0x2292('0x2'));var BPromise=require(_0x2292('0x3'));var rs=require(_0x2292('0x4'));var fs=require('fs');var Redis=require(_0x2292('0x5'));var db=require(_0x2292('0x6'))['db'];var utils=require(_0x2292('0x7'));var logger=require(_0x2292('0x8'))(_0x2292('0x9'));var config=require(_0x2292('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x2292('0xb')][_0x2292('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xb87f20,_0x3b6dd4,_0x3cf0ad){return new BPromise(function(_0x304ca,_0x4b150e){return client[_0x2292('0xd')](_0xb87f20,_0x3cf0ad)['then'](function(_0x2d4c44){logger[_0x2292('0xe')]('Cdr,\x20%s,\x20%s',_0x3b6dd4,'request\x20sent');logger[_0x2292('0xf')](_0x2292('0x10'),_0x3b6dd4,_0x2292('0x11'),JSON[_0x2292('0x12')](_0x2d4c44));if(_0x2d4c44[_0x2292('0x13')]){if(_0x2d4c44[_0x2292('0x13')][_0x2292('0x14')]===0x1f4){logger[_0x2292('0x13')](_0x2292('0x15'),_0x3b6dd4,_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);return _0x4b150e(_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);}logger[_0x2292('0x13')](_0x2292('0x15'),_0x3b6dd4,_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);return _0x304ca(_0x2d4c44[_0x2292('0x13')][_0x2292('0x16')]);}else{logger[_0x2292('0xe')](_0x2292('0x15'),_0x3b6dd4,_0x2292('0x11'));_0x304ca(_0x2d4c44[_0x2292('0x17')]['message']);}})[_0x2292('0x18')](function(_0x5be346){logger[_0x2292('0x13')]('Cdr,\x20%s,\x20%s',_0x3b6dd4,_0x5be346);_0x4b150e(_0x5be346);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index b69fa4f..d0bc43a 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 _0x3aff=['create','update','delete','destroy','exports','multer','express','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x3e954d,_0x4cc3a0){var _0x59649b=function(_0x9c6eac){while(--_0x9c6eac){_0x3e954d['push'](_0x3e954d['shift']());}};_0x59649b(++_0x4cc3a0);}(_0x3aff,0x148));var _0xf3af=function(_0x12f9a5,_0x5edf88){_0x12f9a5=_0x12f9a5-0x0;var _0x5ad5d0=_0x3aff[_0x12f9a5];return _0x5ad5d0;};'use strict';var multer=require(_0xf3af('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf3af('0x1'));var router=express['Router']();var auth=require(_0xf3af('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xf3af('0x3'));var controller=require('./cdr.controller');router[_0xf3af('0x4')]('/',auth[_0xf3af('0x5')](),controller[_0xf3af('0x6')]);router[_0xf3af('0x4')](_0xf3af('0x7'),auth['isAuthenticated'](),controller[_0xf3af('0x8')]);router['get'](_0xf3af('0x9'),auth[_0xf3af('0x5')](),controller[_0xf3af('0xa')]);router[_0xf3af('0xb')]('/',auth['isAuthenticated'](),controller[_0xf3af('0xc')]);router['put'](_0xf3af('0x9'),auth[_0xf3af('0x5')](),controller[_0xf3af('0xd')]);router[_0xf3af('0xe')]('/:id',auth[_0xf3af('0x5')](),controller[_0xf3af('0xf')]);module[_0xf3af('0x10')]=router; \ No newline at end of file +var _0xd2ca=['index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xd2ca,0x15a));var _0xad2c=function(_0x54f56c,_0x2953b7){_0x54f56c=_0x54f56c-0x0;var _0x3d86e9=_0xd2ca[_0x54f56c];return _0x3d86e9;};'use strict';var multer=require(_0xad2c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xad2c('0x1'));var router=express['Router']();var auth=require(_0xad2c('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xad2c('0x3'));var controller=require('./cdr.controller');router[_0xad2c('0x4')]('/',auth[_0xad2c('0x5')](),controller[_0xad2c('0x6')]);router[_0xad2c('0x4')](_0xad2c('0x7'),auth[_0xad2c('0x5')](),controller[_0xad2c('0x8')]);router['get'](_0xad2c('0x9'),auth['isAuthenticated'](),controller[_0xad2c('0xa')]);router[_0xad2c('0xb')]('/',auth[_0xad2c('0x5')](),controller['create']);router[_0xad2c('0xc')]('/:id',auth[_0xad2c('0x5')](),controller[_0xad2c('0xd')]);router['delete'](_0xad2c('0x9'),auth[_0xad2c('0x5')](),controller[_0xad2c('0xe')]);module[_0xad2c('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 5a794cd..ef03fe4 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 _0xce08=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0xce08,0xb4));var _0x8ce0=function(_0x1266b6,_0x59015f){_0x1266b6=_0x1266b6-0x0;var _0x3083f5=_0xce08[_0x1266b6];return _0x3083f5;};'use strict';var Sequelize=require(_0x8ce0('0x0'));module[_0x8ce0('0x1')]={'priority':{'type':Sequelize[_0x8ce0('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8ce0('0x3')],'allowNull':![],'defaultValue':_0x8ce0('0x4')},'appdata':{'type':Sequelize[_0x8ce0('0x5')]()},'description':{'type':Sequelize[_0x8ce0('0x3')]},'interval':{'type':Sequelize[_0x8ce0('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb9a7=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0xbd3a05,_0xe6c6b7){var _0x101f90=function(_0x34fbcb){while(--_0x34fbcb){_0xbd3a05['push'](_0xbd3a05['shift']());}};_0x101f90(++_0xe6c6b7);}(_0xb9a7,0x172));var _0x7b9a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xb9a7[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x7b9a('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7b9a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7b9a('0x2')],'allowNull':![],'defaultValue':_0x7b9a('0x3')},'appdata':{'type':Sequelize[_0x7b9a('0x4')]()},'description':{'type':Sequelize[_0x7b9a('0x2')]},'interval':{'type':Sequelize[_0x7b9a('0x2')],'defaultValue':_0x7b9a('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index b8488d4..1602a46 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 _0x5f58=['sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','options','body','catch','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x5720a5,_0x14dbb9){var _0x418388=function(_0x1ea9a6){while(--_0x1ea9a6){_0x5720a5['push'](_0x5720a5['shift']());}};_0x418388(++_0x14dbb9);}(_0x5f58,0x6b));var _0x85f5=function(_0x631a3c,_0x1b61b6){_0x631a3c=_0x631a3c-0x0;var _0x2bdfa3=_0x5f58[_0x631a3c];return _0x2bdfa3;};'use strict';var pdf=require(_0x85f5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x85f5('0x1'));var zipdir=require(_0x85f5('0x2'));var jsonpatch=require(_0x85f5('0x3'));var rp=require(_0x85f5('0x4'));var moment=require('moment');var BPromise=require(_0x85f5('0x5'));var Mustache=require(_0x85f5('0x6'));var util=require(_0x85f5('0x7'));var path=require(_0x85f5('0x8'));var sox=require(_0x85f5('0x9'));var csv=require(_0x85f5('0xa'));var ejs=require(_0x85f5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x85f5('0xc'));var crypto=require(_0x85f5('0xd'));var jsforce=require(_0x85f5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85f5('0xa'));var querystring=require(_0x85f5('0xf'));var Papa=require(_0x85f5('0x10'));var Redis=require(_0x85f5('0x11'));var authService=require(_0x85f5('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x85f5('0x13'));var logger=require(_0x85f5('0x14'))(_0x85f5('0x15'));var utils=require('../../config/utils');var config=require(_0x85f5('0x16'));var db=require(_0x85f5('0x17'))['db'];function respondWithStatusCode(_0x25048d,_0xce6f8d){_0xce6f8d=_0xce6f8d||0xcc;return function(_0x405aee){if(_0x405aee){return _0x25048d[_0x85f5('0x18')](_0xce6f8d);}return _0x25048d['status'](_0xce6f8d)[_0x85f5('0x19')]();};}function respondWithResult(_0x4aab42,_0x7b42f1){_0x7b42f1=_0x7b42f1||0xc8;return function(_0x5a7972){if(_0x5a7972){return _0x4aab42[_0x85f5('0x1a')](_0x7b42f1)[_0x85f5('0x1b')](_0x5a7972);}};}function respondWithFilteredResult(_0x3b87b6,_0x5d5738){return function(_0x4054ca){if(_0x4054ca){var _0x273913=_0x4054ca[_0x85f5('0x1c')],_0x4bf96d=_0x5d5738[_0x85f5('0x1d')],_0x197f8c=_0x5d5738[_0x85f5('0x1d')]+_0x5d5738[_0x85f5('0x1e')],_0x4fa9a3;if(_0x197f8c>=_0x273913){_0x197f8c=_0x273913;_0x4fa9a3=0xc8;}else{_0x4fa9a3=0xce;}_0x3b87b6[_0x85f5('0x1a')](_0x4fa9a3);return _0x3b87b6[_0x85f5('0x1f')](_0x85f5('0x20'),_0x4bf96d+'-'+_0x197f8c+'/'+_0x273913)['json'](_0x4054ca);}return null;};}function patchUpdates(_0x2c3ccc){return function(_0x16e3cd){try{jsonpatch[_0x85f5('0x21')](_0x16e3cd,_0x2c3ccc,!![]);}catch(_0x243382){return BPromise['reject'](_0x243382);}return _0x16e3cd['save']();};}function saveUpdates(_0x362bb0,_0x3d0126){return function(_0x3ab9f8){if(_0x3ab9f8){return _0x3ab9f8[_0x85f5('0x22')](_0x362bb0)[_0x85f5('0x23')](function(_0x40484a){return _0x40484a;});}return null;};}function removeEntity(_0xac2c17,_0x97e76c){return function(_0x1d8448){if(_0x1d8448){return _0x1d8448[_0x85f5('0x24')]()['then'](function(){_0xac2c17['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a029,_0x5dfbfb){return function(_0x346e58){if(!_0x346e58){_0x44a029[_0x85f5('0x18')](0x194);}return _0x346e58;};}function handleError(_0xc86533,_0x831f90){_0x831f90=_0x831f90||0x1f4;return function(_0x1a22e4){logger[_0x85f5('0x25')](_0x1a22e4[_0x85f5('0x26')]);if(_0x1a22e4[_0x85f5('0x27')]){delete _0x1a22e4[_0x85f5('0x27')];}_0xc86533['status'](_0x831f90)[_0x85f5('0x28')](_0x1a22e4);};}exports['show']=function(_0x5b41b9,_0x4e06a0){var _0x29a79a={'raw':!![],'where':{'id':_0x5b41b9[_0x85f5('0x29')]['id']}},_0x2edb4d={};_0x2edb4d['model']=_[_0x85f5('0x2a')](db[_0x85f5('0x2b')][_0x85f5('0x2c')]);_0x2edb4d[_0x85f5('0x2d')]=_[_0x85f5('0x2a')](_0x5b41b9[_0x85f5('0x2d')]);_0x2edb4d[_0x85f5('0x2e')]=_[_0x85f5('0x2f')](_0x2edb4d[_0x85f5('0x30')],_0x2edb4d[_0x85f5('0x2d')]);_0x29a79a[_0x85f5('0x31')]=_[_0x85f5('0x2f')](_0x2edb4d[_0x85f5('0x30')],qs['fields'](_0x5b41b9[_0x85f5('0x2d')][_0x85f5('0x32')]));_0x29a79a[_0x85f5('0x31')]=_0x29a79a['attributes'][_0x85f5('0x33')]?_0x29a79a[_0x85f5('0x31')]:_0x2edb4d[_0x85f5('0x30')];if(_0x5b41b9[_0x85f5('0x2d')][_0x85f5('0x34')]){_0x29a79a[_0x85f5('0x35')]=[{'all':!![]}];}_0x29a79a=_['merge']({},_0x29a79a,_0x5b41b9[_0x85f5('0x36')]);return db[_0x85f5('0x2b')]['find'](_0x29a79a)[_0x85f5('0x23')](handleEntityNotFound(_0x4e06a0,null))[_0x85f5('0x23')](respondWithResult(_0x4e06a0,null))['catch'](handleError(_0x4e06a0,null));};exports['update']=function(_0x410b7e,_0xd73969){if(_0x410b7e['body']['id']){delete _0x410b7e[_0x85f5('0x37')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x410b7e[_0x85f5('0x29')]['id']}})[_0x85f5('0x23')](handleEntityNotFound(_0xd73969,null))[_0x85f5('0x23')](saveUpdates(_0x410b7e[_0x85f5('0x37')],null))[_0x85f5('0x23')](respondWithResult(_0xd73969,null))[_0x85f5('0x38')](handleError(_0xd73969,null));};exports['destroy']=function(_0x4708c9,_0x16fd9f){return db['ChatApplication'][_0x85f5('0x39')]({'where':{'id':_0x4708c9[_0x85f5('0x29')]['id']}})[_0x85f5('0x23')](handleEntityNotFound(_0x16fd9f,null))['then'](removeEntity(_0x16fd9f,null))[_0x85f5('0x38')](handleError(_0x16fd9f,null));}; \ No newline at end of file +var _0x42ec=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','params','model','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x42ec,0x16a));var _0xc42e=function(_0x22c239,_0x102b65){_0x22c239=_0x22c239-0x0;var _0x234a18=_0x42ec[_0x22c239];return _0x234a18;};'use strict';var pdf=require(_0xc42e('0x0'));var emlformat=require(_0xc42e('0x1'));var rimraf=require(_0xc42e('0x2'));var zipdir=require(_0xc42e('0x3'));var jsonpatch=require(_0xc42e('0x4'));var rp=require(_0xc42e('0x5'));var moment=require(_0xc42e('0x6'));var BPromise=require(_0xc42e('0x7'));var Mustache=require('mustache');var util=require(_0xc42e('0x8'));var path=require(_0xc42e('0x9'));var sox=require(_0xc42e('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc42e('0xb'));var squel=require(_0xc42e('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc42e('0xd'));var Papa=require(_0xc42e('0xe'));var Redis=require(_0xc42e('0xf'));var authService=require(_0xc42e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc42e('0x11'));var logger=require('../../config/logger')(_0xc42e('0x12'));var utils=require('../../config/utils');var config=require(_0xc42e('0x13'));var db=require(_0xc42e('0x14'))['db'];function respondWithStatusCode(_0x4d0d16,_0x549d04){_0x549d04=_0x549d04||0xcc;return function(_0x5fcb32){if(_0x5fcb32){return _0x4d0d16[_0xc42e('0x15')](_0x549d04);}return _0x4d0d16[_0xc42e('0x16')](_0x549d04)['end']();};}function respondWithResult(_0x50c582,_0x7f94f2){_0x7f94f2=_0x7f94f2||0xc8;return function(_0xf3eedf){if(_0xf3eedf){return _0x50c582[_0xc42e('0x16')](_0x7f94f2)[_0xc42e('0x17')](_0xf3eedf);}};}function respondWithFilteredResult(_0x4a7793,_0x5505d1){return function(_0x115ccc){if(_0x115ccc){var _0x4d11c7=_0x115ccc[_0xc42e('0x18')],_0x178b8e=_0x5505d1['offset'],_0x4097fa=_0x5505d1[_0xc42e('0x19')]+_0x5505d1[_0xc42e('0x1a')],_0x484ce9;if(_0x4097fa>=_0x4d11c7){_0x4097fa=_0x4d11c7;_0x484ce9=0xc8;}else{_0x484ce9=0xce;}_0x4a7793['status'](_0x484ce9);return _0x4a7793[_0xc42e('0x1b')](_0xc42e('0x1c'),_0x178b8e+'-'+_0x4097fa+'/'+_0x4d11c7)[_0xc42e('0x17')](_0x115ccc);}return null;};}function patchUpdates(_0x304964){return function(_0x1e2c01){try{jsonpatch[_0xc42e('0x1d')](_0x1e2c01,_0x304964,!![]);}catch(_0x3fbdfb){return BPromise[_0xc42e('0x1e')](_0x3fbdfb);}return _0x1e2c01[_0xc42e('0x1f')]();};}function saveUpdates(_0x36ffb1,_0x35b5ae){return function(_0x1f3b13){if(_0x1f3b13){return _0x1f3b13[_0xc42e('0x20')](_0x36ffb1)[_0xc42e('0x21')](function(_0x10ad4b){return _0x10ad4b;});}return null;};}function removeEntity(_0x21bc1e,_0x576b76){return function(_0x2a70c5){if(_0x2a70c5){return _0x2a70c5[_0xc42e('0x22')]()[_0xc42e('0x21')](function(){_0x21bc1e['status'](0xcc)[_0xc42e('0x23')]();});}};}function handleEntityNotFound(_0x3df86e,_0x3dd688){return function(_0xffe47a){if(!_0xffe47a){_0x3df86e['sendStatus'](0x194);}return _0xffe47a;};}function handleError(_0x640507,_0x2cae4a){_0x2cae4a=_0x2cae4a||0x1f4;return function(_0x33b5d5){logger[_0xc42e('0x24')](_0x33b5d5[_0xc42e('0x25')]);if(_0x33b5d5['name']){delete _0x33b5d5[_0xc42e('0x26')];}_0x640507['status'](_0x2cae4a)['send'](_0x33b5d5);};}exports['show']=function(_0x4ffa0f,_0x319158){var _0x42e844={'raw':!![],'where':{'id':_0x4ffa0f[_0xc42e('0x27')]['id']}},_0x536a15={};_0x536a15[_0xc42e('0x28')]=_['keys'](db[_0xc42e('0x29')][_0xc42e('0x2a')]);_0x536a15[_0xc42e('0x2b')]=_['keys'](_0x4ffa0f[_0xc42e('0x2b')]);_0x536a15[_0xc42e('0x2c')]=_[_0xc42e('0x2d')](_0x536a15['model'],_0x536a15['query']);_0x42e844['attributes']=_[_0xc42e('0x2d')](_0x536a15[_0xc42e('0x28')],qs[_0xc42e('0x2e')](_0x4ffa0f[_0xc42e('0x2b')][_0xc42e('0x2e')]));_0x42e844[_0xc42e('0x2f')]=_0x42e844[_0xc42e('0x2f')][_0xc42e('0x30')]?_0x42e844['attributes']:_0x536a15['model'];if(_0x4ffa0f['query'][_0xc42e('0x31')]){_0x42e844[_0xc42e('0x32')]=[{'all':!![]}];}_0x42e844=_[_0xc42e('0x33')]({},_0x42e844,_0x4ffa0f[_0xc42e('0x34')]);return db[_0xc42e('0x29')]['find'](_0x42e844)[_0xc42e('0x21')](handleEntityNotFound(_0x319158,null))['then'](respondWithResult(_0x319158,null))['catch'](handleError(_0x319158,null));};exports[_0xc42e('0x20')]=function(_0x2d2c8f,_0x1728c0){if(_0x2d2c8f[_0xc42e('0x35')]['id']){delete _0x2d2c8f[_0xc42e('0x35')]['id'];}return db[_0xc42e('0x29')]['find']({'where':{'id':_0x2d2c8f[_0xc42e('0x27')]['id']}})[_0xc42e('0x21')](handleEntityNotFound(_0x1728c0,null))[_0xc42e('0x21')](saveUpdates(_0x2d2c8f[_0xc42e('0x35')],null))[_0xc42e('0x21')](respondWithResult(_0x1728c0,null))[_0xc42e('0x36')](handleError(_0x1728c0,null));};exports[_0xc42e('0x22')]=function(_0x930b66,_0x4f9afd){return db[_0xc42e('0x29')]['find']({'where':{'id':_0x930b66[_0xc42e('0x27')]['id']}})[_0xc42e('0x21')](handleEntityNotFound(_0x4f9afd,null))[_0xc42e('0x21')](removeEntity(_0x4f9afd,null))[_0xc42e('0x36')](handleError(_0x4f9afd,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 19063f9..508c47f 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 _0xfb3b=['./chatApplication.attributes','define','chat_applications','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2caaef,_0x3c19ed){var _0xd011f8=function(_0x318656){while(--_0x318656){_0x2caaef['push'](_0x2caaef['shift']());}};_0xd011f8(++_0x3c19ed);}(_0xfb3b,0xcf));var _0xbfb3=function(_0x410446,_0x3e8293){_0x410446=_0x410446-0x0;var _0x1238bc=_0xfb3b[_0x410446];return _0x1238bc;};'use strict';var _=require('lodash');var util=require(_0xbfb3('0x0'));var logger=require(_0xbfb3('0x1'))(_0xbfb3('0x2'));var moment=require(_0xbfb3('0x3'));var BPromise=require(_0xbfb3('0x4'));var rp=require(_0xbfb3('0x5'));var fs=require('fs');var path=require(_0xbfb3('0x6'));var rimraf=require(_0xbfb3('0x7'));var config=require(_0xbfb3('0x8'));var attributes=require(_0xbfb3('0x9'));module['exports']=function(_0x35ac2a,_0x642438){return _0x35ac2a[_0xbfb3('0xa')]('ChatApplication',attributes,{'tableName':_0xbfb3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2aff=['./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x8957ed,_0x1b1553){var _0xcc833a=function(_0x1c49e4){while(--_0x1c49e4){_0x8957ed['push'](_0x8957ed['shift']());}};_0xcc833a(++_0x1b1553);}(_0x2aff,0x18b));var _0xf2af=function(_0x1c1bef,_0x126ff5){_0x1c1bef=_0x1c1bef-0x0;var _0x2c5f6a=_0x2aff[_0x1c1bef];return _0x2c5f6a;};'use strict';var _=require(_0xf2af('0x0'));var util=require(_0xf2af('0x1'));var logger=require(_0xf2af('0x2'))(_0xf2af('0x3'));var moment=require(_0xf2af('0x4'));var BPromise=require(_0xf2af('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf2af('0x6'));var config=require(_0xf2af('0x7'));var attributes=require(_0xf2af('0x8'));module[_0xf2af('0x9')]=function(_0x21104b,_0x29a4aa){return _0x21104b['define'](_0xf2af('0xa'),attributes,{'tableName':_0xf2af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf2af('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d43f8f1..6339840 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 _0xbe33=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatApplication,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x1f8656,_0x69ee9a){var _0x4acd13=function(_0x19f00e){while(--_0x19f00e){_0x1f8656['push'](_0x1f8656['shift']());}};_0x4acd13(++_0x69ee9a);}(_0xbe33,0x16b));var _0x3be3=function(_0x1fe14f,_0x36745d){_0x1fe14f=_0x1fe14f-0x0;var _0x4c4904=_0xbe33[_0x1fe14f];return _0x4c4904;};'use strict';var _=require(_0x3be3('0x0'));var util=require('util');var moment=require(_0x3be3('0x1'));var BPromise=require(_0x3be3('0x2'));var rs=require(_0x3be3('0x3'));var fs=require('fs');var Redis=require(_0x3be3('0x4'));var db=require(_0x3be3('0x5'))['db'];var utils=require(_0x3be3('0x6'));var logger=require('../../config/logger')(_0x3be3('0x7'));var config=require(_0x3be3('0x8'));var jayson=require(_0x3be3('0x9'));var client=jayson[_0x3be3('0xa')][_0x3be3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x51a755,_0x110cb2,_0x3cac33){return new BPromise(function(_0x189757,_0x43012b){return client[_0x3be3('0xc')](_0x51a755,_0x3cac33)[_0x3be3('0xd')](function(_0x475dd0){logger[_0x3be3('0xe')]('ChatApplication,\x20%s,\x20%s',_0x110cb2,_0x3be3('0xf'));logger['debug'](_0x3be3('0x10'),_0x110cb2,_0x3be3('0xf'),JSON[_0x3be3('0x11')](_0x475dd0));if(_0x475dd0[_0x3be3('0x12')]){if(_0x475dd0[_0x3be3('0x12')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x110cb2,_0x475dd0['error'][_0x3be3('0x13')]);return _0x43012b(_0x475dd0[_0x3be3('0x12')][_0x3be3('0x13')]);}logger[_0x3be3('0x12')](_0x3be3('0x14'),_0x110cb2,_0x475dd0['error'][_0x3be3('0x13')]);return _0x189757(_0x475dd0['error']['message']);}else{logger[_0x3be3('0xe')](_0x3be3('0x14'),_0x110cb2,_0x3be3('0xf'));_0x189757(_0x475dd0[_0x3be3('0x15')]['message']);}})[_0x3be3('0x16')](function(_0x3510ff){logger[_0x3be3('0x12')](_0x3be3('0x14'),_0x110cb2,_0x3510ff);_0x43012b(_0x3510ff);});});} \ No newline at end of file +var _0x038a=['request','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x5a70fd,_0x3b4b27){var _0x429466=function(_0xb731d8){while(--_0xb731d8){_0x5a70fd['push'](_0x5a70fd['shift']());}};_0x429466(++_0x3b4b27);}(_0x038a,0x137));var _0xa038=function(_0x22cb5f,_0x2cdd63){_0x22cb5f=_0x22cb5f-0x0;var _0x274d36=_0x038a[_0x22cb5f];return _0x274d36;};'use strict';var _=require(_0xa038('0x0'));var util=require(_0xa038('0x1'));var moment=require(_0xa038('0x2'));var BPromise=require(_0xa038('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa038('0x4'));var db=require(_0xa038('0x5'))['db'];var utils=require(_0xa038('0x6'));var logger=require(_0xa038('0x7'))(_0xa038('0x8'));var config=require('../../config/environment');var jayson=require(_0xa038('0x9'));var client=jayson['client'][_0xa038('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaecb0b,_0x348a77,_0xb4aaca){return new BPromise(function(_0x3ba7b9,_0x1e2b86){return client[_0xa038('0xb')](_0xaecb0b,_0xb4aaca)['then'](function(_0x1c5860){logger[_0xa038('0xc')](_0xa038('0xd'),_0x348a77,'request\x20sent');logger[_0xa038('0xe')](_0xa038('0xf'),_0x348a77,_0xa038('0x10'),JSON[_0xa038('0x11')](_0x1c5860));if(_0x1c5860['error']){if(_0x1c5860['error'][_0xa038('0x12')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x348a77,_0x1c5860['error'][_0xa038('0x13')]);return _0x1e2b86(_0x1c5860[_0xa038('0x14')]['message']);}logger['error'](_0xa038('0xd'),_0x348a77,_0x1c5860[_0xa038('0x14')]['message']);return _0x3ba7b9(_0x1c5860[_0xa038('0x14')]['message']);}else{logger[_0xa038('0xc')]('ChatApplication,\x20%s,\x20%s',_0x348a77,'request\x20sent');_0x3ba7b9(_0x1c5860[_0xa038('0x15')]['message']);}})[_0xa038('0x16')](function(_0x52bf6d){logger['error'](_0xa038('0xd'),_0x348a77,_0x52bf6d);_0x1e2b86(_0x52bf6d);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 287b529..f8cbe2e 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 _0x14de=['../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','update','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x14de,0x190));var _0xe14d=function(_0x6140db,_0x194195){_0x6140db=_0x6140db-0x0;var _0x266702=_0x14de[_0x6140db];return _0x266702;};'use strict';var multer=require(_0xe14d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe14d('0x1'));var express=require(_0xe14d('0x2'));var router=express[_0xe14d('0x3')]();var auth=require(_0xe14d('0x4'));var interaction=require(_0xe14d('0x5'));var config=require(_0xe14d('0x6'));var controller=require(_0xe14d('0x7'));router['get'](_0xe14d('0x8'),auth[_0xe14d('0x9')](),controller[_0xe14d('0xa')]);router['put'](_0xe14d('0x8'),auth[_0xe14d('0x9')](),controller[_0xe14d('0xb')]);router['delete'](_0xe14d('0x8'),auth['isAuthenticated'](),controller[_0xe14d('0xc')]);module[_0xe14d('0xd')]=router; \ No newline at end of file +var _0x52c1=['../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5d93ba,_0x386640){var _0x2b5bd3=function(_0x5a4971){while(--_0x5a4971){_0x5d93ba['push'](_0x5d93ba['shift']());}};_0x2b5bd3(++_0x386640);}(_0x52c1,0x163));var _0x152c=function(_0x174a1d,_0x580ab8){_0x174a1d=_0x174a1d-0x0;var _0x269f8b=_0x52c1[_0x174a1d];return _0x269f8b;};'use strict';var multer=require('multer');var util=require(_0x152c('0x0'));var path=require(_0x152c('0x1'));var timeout=require(_0x152c('0x2'));var express=require('express');var router=express[_0x152c('0x3')]();var auth=require(_0x152c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x152c('0x5'));var controller=require(_0x152c('0x6'));router[_0x152c('0x7')](_0x152c('0x8'),auth[_0x152c('0x9')](),controller['show']);router[_0x152c('0xa')](_0x152c('0x8'),auth[_0x152c('0x9')](),controller[_0x152c('0xb')]);router[_0x152c('0xc')](_0x152c('0x8'),auth['isAuthenticated'](),controller[_0x152c('0xd')]);module[_0x152c('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 dac0030..7f49e43 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 _0x51f4=['STRING','BOOLEAN','sequelize'];(function(_0x2cd2b8,_0x531013){var _0x28ae72=function(_0x4a75ef){while(--_0x4a75ef){_0x2cd2b8['push'](_0x2cd2b8['shift']());}};_0x28ae72(++_0x531013);}(_0x51f4,0x1b2));var _0x451f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x51f4[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x451f('0x0'));module['exports']={'name':{'type':Sequelize[_0x451f('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x451f('0x1')]},'write':{'type':Sequelize[_0x451f('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0503=['exports','STRING','BOOLEAN','sequelize'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x0503,0x18f));var _0x3050=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x0503[_0x22b68a];return _0x1ac67a;};'use strict';var Sequelize=require(_0x3050('0x0'));module[_0x3050('0x1')]={'name':{'type':Sequelize[_0x3050('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3050('0x2')]},'write':{'type':Sequelize[_0x3050('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index b9b3cdc..0d6fad5 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 _0x21bf=['filters','pick','filter','merge','map','type','VIRTUAL','field','include','rows','show','params','find','create','body','update','describe','getUnread','user','addMembers','omit','ids','getMembers','User','options','removeMembers','ChatGroupId','getMessages','findOne','ChatInternalMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','status','json','count','offset','limit','set','Content-Range','apply','destroy','sendStatus','send','index','ChatGroup','rawAttributes','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2fda4d,_0x1a3f7a){var _0x1b6ce7=function(_0x3f7892){while(--_0x3f7892){_0x2fda4d['push'](_0x2fda4d['shift']());}};_0x1b6ce7(++_0x1a3f7a);}(_0x21bf,0xed));var _0xf21b=function(_0x4ec171,_0x2c265c){_0x4ec171=_0x4ec171-0x0;var _0x5ae8cf=_0x21bf[_0x4ec171];return _0x5ae8cf;};'use strict';var pdf=require(_0xf21b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf21b('0x1'));var zipdir=require(_0xf21b('0x2'));var jsonpatch=require(_0xf21b('0x3'));var rp=require(_0xf21b('0x4'));var moment=require(_0xf21b('0x5'));var BPromise=require(_0xf21b('0x6'));var Mustache=require('mustache');var util=require(_0xf21b('0x7'));var path=require(_0xf21b('0x8'));var sox=require(_0xf21b('0x9'));var csv=require(_0xf21b('0xa'));var ejs=require(_0xf21b('0xb'));var fs=require('fs');var _=require(_0xf21b('0xc'));var squel=require('squel');var crypto=require(_0xf21b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf21b('0xe'));var toCsv=require(_0xf21b('0xa'));var querystring=require(_0xf21b('0xf'));var Papa=require(_0xf21b('0x10'));var Redis=require(_0xf21b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf21b('0x12'));var hardwareService=require(_0xf21b('0x13'));var logger=require(_0xf21b('0x14'))(_0xf21b('0x15'));var utils=require(_0xf21b('0x16'));var config=require('../../config/environment');var db=require(_0xf21b('0x17'))['db'];config['redis']=_[_0xf21b('0x18')](config[_0xf21b('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xf21b('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf21b('0x1b')][_0xf21b('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x185540,_0x515271,_0x516883){if(_0x516883){var _0x3b9c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3b9c3[_0xf21b('0x1d')](_0x515271)){return _0x185540;}else{throw new Error(_0xf21b('0x1e'));}}else{return _0x185540;}}function respondWithRpcPromise(_0x48083f,_0x207599,_0x2b19da,_0xf35831){return new BPromise(function(_0x4588ae,_0x5acff6){var _0x2086ea=_0xf35831||client;return _0x2086ea[_0xf21b('0x1f')](_0x48083f,_0x2b19da)[_0xf21b('0x20')](function(_0x44713e){logger[_0xf21b('0x21')](_0xf21b('0x22'),_0x207599,'request\x20sent');logger[_0xf21b('0x23')](_0xf21b('0x24'),_0x207599,_0xf21b('0x25'),JSON[_0xf21b('0x26')](_0x44713e));if(_0x44713e['error']){if(_0x44713e['error'][_0xf21b('0x27')]===0x1f4){logger[_0xf21b('0x28')](_0xf21b('0x22'),_0x207599,_0x44713e[_0xf21b('0x28')][_0xf21b('0x29')]);return _0x5acff6(_0x44713e[_0xf21b('0x28')][_0xf21b('0x29')]);}logger[_0xf21b('0x28')]('ChatGroup,\x20%s,\x20%s',_0x207599,_0x44713e[_0xf21b('0x28')][_0xf21b('0x29')]);return _0x4588ae(_0x44713e[_0xf21b('0x28')][_0xf21b('0x29')]);}else{logger['info'](_0xf21b('0x22'),_0x207599,_0xf21b('0x25'));_0x4588ae(_0x44713e['result'][_0xf21b('0x29')]);}})[_0xf21b('0x2a')](function(_0x2dcd56){logger[_0xf21b('0x28')](_0xf21b('0x22'),_0x207599,_0x2dcd56);_0x5acff6(_0x2dcd56);});});}function respondWithStatusCode(_0x268d63,_0x4e70ce){_0x4e70ce=_0x4e70ce||0xcc;return function(_0x1bd4b5){if(_0x1bd4b5){return _0x268d63['sendStatus'](_0x4e70ce);}return _0x268d63[_0xf21b('0x2b')](_0x4e70ce)['end']();};}function respondWithResult(_0x2f4df8,_0x3466d6){_0x3466d6=_0x3466d6||0xc8;return function(_0x1605bd){if(_0x1605bd){return _0x2f4df8['status'](_0x3466d6)[_0xf21b('0x2c')](_0x1605bd);}};}function respondWithFilteredResult(_0x5cbab9,_0x5d1837){return function(_0xb34dd5){if(_0xb34dd5){var _0x3b94c3=_0xb34dd5[_0xf21b('0x2d')],_0x4daa8f=_0x5d1837[_0xf21b('0x2e')],_0x53e701=_0x5d1837['offset']+_0x5d1837[_0xf21b('0x2f')],_0x36f1f7;if(_0x53e701>=_0x3b94c3){_0x53e701=_0x3b94c3;_0x36f1f7=0xc8;}else{_0x36f1f7=0xce;}_0x5cbab9[_0xf21b('0x2b')](_0x36f1f7);return _0x5cbab9[_0xf21b('0x30')](_0xf21b('0x31'),_0x4daa8f+'-'+_0x53e701+'/'+_0x3b94c3)[_0xf21b('0x2c')](_0xb34dd5);}return null;};}function patchUpdates(_0x34023a){return function(_0xf7aff0){try{jsonpatch[_0xf21b('0x32')](_0xf7aff0,_0x34023a,!![]);}catch(_0x1d4598){return BPromise['reject'](_0x1d4598);}return _0xf7aff0['save']();};}function saveUpdates(_0x124c76,_0x3cd768){return function(_0x3f16cc){if(_0x3f16cc){return _0x3f16cc['update'](_0x124c76)['then'](function(_0x444c41){return _0x444c41;});}return null;};}function removeEntity(_0x15c0d4,_0x57703e){return function(_0x4a047a){if(_0x4a047a){return _0x4a047a[_0xf21b('0x33')]()[_0xf21b('0x20')](function(){_0x15c0d4[_0xf21b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e68f1,_0x28a10c){return function(_0x1d8467){if(!_0x1d8467){_0x3e68f1[_0xf21b('0x34')](0x194);}return _0x1d8467;};}function handleError(_0x395928,_0x46ba28){_0x46ba28=_0x46ba28||0x1f4;return function(_0x5e6540){logger['error'](_0x5e6540['stack']);if(_0x5e6540['name']){delete _0x5e6540['name'];}_0x395928[_0xf21b('0x2b')](_0x46ba28)[_0xf21b('0x35')](_0x5e6540);};}exports[_0xf21b('0x36')]=function(_0x5ac121,_0x3767d5){var _0x28ecd0={},_0x1e0a78={},_0x41f5d6={'count':0x0,'rows':[]};var _0xe6493=db[_0xf21b('0x37')][_0xf21b('0x38')];_0x1e0a78['model']=_['keys'](_0xe6493);_0x1e0a78[_0xf21b('0x39')]=_[_0xf21b('0x3a')](_0x5ac121['query']);_0x1e0a78['filters']=_[_0xf21b('0x3b')](_0x1e0a78['model'],_0x1e0a78[_0xf21b('0x39')]);_0x28ecd0['attributes']=_['intersection'](_0x1e0a78[_0xf21b('0x3c')],qs[_0xf21b('0x3d')](_0x5ac121['query']['fields']));_0x28ecd0[_0xf21b('0x3e')]=_0x28ecd0[_0xf21b('0x3e')][_0xf21b('0x3f')]?_0x28ecd0[_0xf21b('0x3e')]:_0x1e0a78[_0xf21b('0x3c')];if(!_0x5ac121[_0xf21b('0x39')][_0xf21b('0x40')](_0xf21b('0x41'))){_0x28ecd0['limit']=qs[_0xf21b('0x2f')](_0x5ac121[_0xf21b('0x39')][_0xf21b('0x2f')]);_0x28ecd0[_0xf21b('0x2e')]=qs[_0xf21b('0x2e')](_0x5ac121[_0xf21b('0x39')][_0xf21b('0x2e')]);}_0x28ecd0[_0xf21b('0x42')]=qs['sort'](_0x5ac121[_0xf21b('0x39')][_0xf21b('0x43')]);_0x28ecd0[_0xf21b('0x44')]=qs[_0xf21b('0x45')](_[_0xf21b('0x46')](_0x5ac121['query'],_0x1e0a78['filters']));if(_0x5ac121[_0xf21b('0x39')][_0xf21b('0x47')]){_0x28ecd0[_0xf21b('0x44')]=_[_0xf21b('0x48')](_0x28ecd0['where'],{'$or':_[_0xf21b('0x49')](_0xe6493,function(_0x5013e5){if(_0x5013e5[_0xf21b('0x4a')]['key']!==_0xf21b('0x4b')){var _0x46f11e={};_0x46f11e[_0x5013e5[_0xf21b('0x4c')]]={'$like':'%'+_0x5ac121[_0xf21b('0x39')]['filter']+'%'};return _0x46f11e;}})});}_0x28ecd0=_['merge']({},_0x28ecd0,_0x5ac121['options']);var _0x4b0ffb={'where':_0x28ecd0[_0xf21b('0x44')]};return db[_0xf21b('0x37')][_0xf21b('0x2d')](_0x4b0ffb)[_0xf21b('0x20')](function(_0x1c437a){_0x41f5d6[_0xf21b('0x2d')]=_0x1c437a;if(_0x5ac121[_0xf21b('0x39')]['includeAll']){_0x28ecd0[_0xf21b('0x4d')]=[{'all':!![]}];}return db[_0xf21b('0x37')]['findAll'](_0x28ecd0);})[_0xf21b('0x20')](function(_0x3751f4){_0x41f5d6[_0xf21b('0x4e')]=_0x3751f4;return _0x41f5d6;})[_0xf21b('0x20')](respondWithFilteredResult(_0x3767d5,_0x28ecd0))[_0xf21b('0x2a')](handleError(_0x3767d5,null));};exports[_0xf21b('0x4f')]=function(_0x6a95fe,_0x5c7764){var _0x1d8322={'raw':!![],'where':{'id':_0x6a95fe[_0xf21b('0x50')]['id']}},_0x6b893d={};_0x6b893d[_0xf21b('0x3c')]=_['keys'](db[_0xf21b('0x37')]['rawAttributes']);_0x6b893d[_0xf21b('0x39')]=_[_0xf21b('0x3a')](_0x6a95fe[_0xf21b('0x39')]);_0x6b893d[_0xf21b('0x45')]=_[_0xf21b('0x3b')](_0x6b893d[_0xf21b('0x3c')],_0x6b893d['query']);_0x1d8322['attributes']=_[_0xf21b('0x3b')](_0x6b893d['model'],qs[_0xf21b('0x3d')](_0x6a95fe[_0xf21b('0x39')][_0xf21b('0x3d')]));_0x1d8322[_0xf21b('0x3e')]=_0x1d8322[_0xf21b('0x3e')][_0xf21b('0x3f')]?_0x1d8322['attributes']:_0x6b893d[_0xf21b('0x3c')];if(_0x6a95fe['query']['includeAll']){_0x1d8322[_0xf21b('0x4d')]=[{'all':!![]}];}_0x1d8322=_[_0xf21b('0x48')]({},_0x1d8322,_0x6a95fe['options']);return db['ChatGroup'][_0xf21b('0x51')](_0x1d8322)['then'](handleEntityNotFound(_0x5c7764,null))[_0xf21b('0x20')](respondWithResult(_0x5c7764,null))[_0xf21b('0x2a')](handleError(_0x5c7764,null));};exports[_0xf21b('0x52')]=function(_0x379d19,_0x543158){return db[_0xf21b('0x37')][_0xf21b('0x52')](_0x379d19[_0xf21b('0x53')],{})[_0xf21b('0x20')](respondWithResult(_0x543158,0xc9))[_0xf21b('0x2a')](handleError(_0x543158,null));};exports[_0xf21b('0x54')]=function(_0x2b496c,_0x53a100){if(_0x2b496c[_0xf21b('0x53')]['id']){delete _0x2b496c[_0xf21b('0x53')]['id'];}return db['ChatGroup'][_0xf21b('0x51')]({'where':{'id':_0x2b496c[_0xf21b('0x50')]['id']}})[_0xf21b('0x20')](handleEntityNotFound(_0x53a100,null))[_0xf21b('0x20')](saveUpdates(_0x2b496c[_0xf21b('0x53')],null))[_0xf21b('0x20')](respondWithResult(_0x53a100,null))['catch'](handleError(_0x53a100,null));};exports[_0xf21b('0x33')]=function(_0x3a6267,_0x46e559){return db[_0xf21b('0x37')][_0xf21b('0x51')]({'where':{'id':_0x3a6267[_0xf21b('0x50')]['id']}})[_0xf21b('0x20')](handleEntityNotFound(_0x46e559,null))[_0xf21b('0x20')](removeEntity(_0x46e559,null))['catch'](handleError(_0x46e559,null));};exports[_0xf21b('0x55')]=function(_0x4c37d6,_0xd72187){return db['ChatGroup'][_0xf21b('0x55')]()['then'](respondWithResult(_0xd72187,null))['catch'](handleError(_0xd72187,null));};exports[_0xf21b('0x56')]=function(_0x2cc8b5,_0x4dbd31,_0xed7d57){return db['ChatInternalMessage'][_0xf21b('0x2d')]({'where':{'ChatGroupId':_0x2cc8b5[_0xf21b('0x50')]['id'],'ToId':_0x2cc8b5[_0xf21b('0x57')]['id'],'read':![]}})[_0xf21b('0x20')](function(_0x4f3a37){return{'id':_['toInteger'](_0x2cc8b5[_0xf21b('0x50')]['id']),'count':_0x4f3a37};})[_0xf21b('0x20')](respondWithResult(_0x4dbd31,null))['catch'](handleError(_0x4dbd31,null));};exports[_0xf21b('0x58')]=function(_0x11860a,_0x5f0695,_0x3674bd){return db[_0xf21b('0x37')][_0xf21b('0x51')]({'where':{'id':_0x11860a[_0xf21b('0x50')]['id']}})[_0xf21b('0x20')](handleEntityNotFound(_0x5f0695,null))[_0xf21b('0x20')](function(_0x195b7f){if(_0x195b7f){return _0x195b7f[_0xf21b('0x58')](_0x11860a[_0xf21b('0x53')]['ids'],_[_0xf21b('0x59')](_0x11860a['body'],[_0xf21b('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x5f0695,null))['catch'](handleError(_0x5f0695,null));};exports[_0xf21b('0x5b')]=function(_0x8e50a6,_0x505521,_0x128975){var _0x523766={};var _0x332542={};var _0x4468c8;var _0x38bdc3;return db[_0xf21b('0x37')]['findOne']({'where':{'id':_0x8e50a6[_0xf21b('0x50')]['id']}})[_0xf21b('0x20')](handleEntityNotFound(_0x505521,null))[_0xf21b('0x20')](function(_0x2e961b){if(_0x2e961b){_0x4468c8=_0x2e961b;_0x332542[_0xf21b('0x3c')]=_[_0xf21b('0x3a')](db[_0xf21b('0x5c')]['rawAttributes']);_0x332542[_0xf21b('0x39')]=_[_0xf21b('0x3a')](_0x8e50a6[_0xf21b('0x39')]);_0x332542['filters']=_[_0xf21b('0x3b')](_0x332542[_0xf21b('0x3c')],_0x332542['query']);_0x523766['attributes']=_[_0xf21b('0x3b')](_0x332542[_0xf21b('0x3c')],qs[_0xf21b('0x3d')](_0x8e50a6[_0xf21b('0x39')][_0xf21b('0x3d')]));_0x523766['attributes']=_0x523766['attributes']['length']?_0x523766['attributes']:_0x332542[_0xf21b('0x3c')];_0x523766['order']=qs[_0xf21b('0x43')](_0x8e50a6[_0xf21b('0x39')][_0xf21b('0x43')]);_0x523766['where']=qs[_0xf21b('0x45')](_['pick'](_0x8e50a6[_0xf21b('0x39')],_0x332542[_0xf21b('0x45')]));if(_0x8e50a6[_0xf21b('0x39')][_0xf21b('0x47')]){_0x523766[_0xf21b('0x44')]=_[_0xf21b('0x48')](_0x523766[_0xf21b('0x44')],{'$or':_[_0xf21b('0x49')](_0x523766[_0xf21b('0x3e')],function(_0x34a54d){var _0x2636f8={};_0x2636f8[_0x34a54d]={'$like':'%'+_0x8e50a6[_0xf21b('0x39')][_0xf21b('0x47')]+'%'};return _0x2636f8;})});}_0x523766=_[_0xf21b('0x48')]({},_0x523766,_0x8e50a6[_0xf21b('0x5d')]);return _0x4468c8[_0xf21b('0x5b')](_0x523766);}})[_0xf21b('0x20')](function(_0x17de72){if(_0x17de72){_0x38bdc3=_0x17de72[_0xf21b('0x3f')];if(!_0x8e50a6[_0xf21b('0x39')]['hasOwnProperty'](_0xf21b('0x41'))){_0x523766['limit']=qs[_0xf21b('0x2f')](_0x8e50a6[_0xf21b('0x39')][_0xf21b('0x2f')]);_0x523766[_0xf21b('0x2e')]=qs[_0xf21b('0x2e')](_0x8e50a6[_0xf21b('0x39')]['offset']);}return _0x4468c8[_0xf21b('0x5b')](_0x523766);}})[_0xf21b('0x20')](function(_0xa641bc){if(_0xa641bc){return _0xa641bc?{'count':_0x38bdc3,'rows':_0xa641bc}:null;}})[_0xf21b('0x20')](respondWithResult(_0x505521,null))[_0xf21b('0x2a')](handleError(_0x505521,null));};exports[_0xf21b('0x5e')]=function(_0x2b3943,_0x4d2b42,_0x4f8773){return db['ChatGroup'][_0xf21b('0x51')]({'where':{'id':_0x2b3943[_0xf21b('0x50')]['id']}})[_0xf21b('0x20')](handleEntityNotFound(_0x4d2b42,null))[_0xf21b('0x20')](function(_0x2feded){if(_0x2feded){return _0x2feded['removeMembers'](_0x2b3943[_0xf21b('0x39')][_0xf21b('0x5a')]);}})[_0xf21b('0x20')](respondWithStatusCode(_0x4d2b42,null))[_0xf21b('0x2a')](handleError(_0x4d2b42,null));};exports['addMessage']=function(_0x114f75,_0x248c07,_0x3e95ad){if(_0x114f75[_0xf21b('0x53')]['id']){delete _0x114f75[_0xf21b('0x53')]['id'];}return db[_0xf21b('0x37')][_0xf21b('0x51')]({'where':{'id':_0x114f75['params']['id']}})['then'](handleEntityNotFound(_0x248c07,null))[_0xf21b('0x20')](function(_0x54e9d0){if(_0x54e9d0){_0x114f75[_0xf21b('0x53')][_0xf21b('0x5f')]=_0x54e9d0['id'];return db['ChatInternalMessage']['create'](_0x114f75[_0xf21b('0x53')]);}})['then'](respondWithResult(_0x248c07,null))[_0xf21b('0x2a')](handleError(_0x248c07,null));};exports[_0xf21b('0x60')]=function(_0x549fda,_0x475f3f,_0x4f6a57){var _0x3e8c4d={};var _0x41bd04={};var _0x115369;var _0x36c26c;return db[_0xf21b('0x37')][_0xf21b('0x61')]({'where':{'id':_0x549fda[_0xf21b('0x50')]['id']}})[_0xf21b('0x20')](handleEntityNotFound(_0x475f3f,null))[_0xf21b('0x20')](function(_0x59ebae){if(_0x59ebae){_0x115369=_0x59ebae;_0x41bd04['model']=_[_0xf21b('0x3a')](db[_0xf21b('0x62')][_0xf21b('0x38')]);_0x41bd04[_0xf21b('0x39')]=_['keys'](_0x549fda['query']);_0x41bd04['filters']=_[_0xf21b('0x3b')](_0x41bd04[_0xf21b('0x3c')],_0x41bd04['query']);_0x3e8c4d[_0xf21b('0x3e')]=_[_0xf21b('0x3b')](_0x41bd04['model'],qs['fields'](_0x549fda[_0xf21b('0x39')]['fields']));_0x3e8c4d[_0xf21b('0x3e')]=_0x3e8c4d[_0xf21b('0x3e')][_0xf21b('0x3f')]?_0x3e8c4d[_0xf21b('0x3e')]:_0x41bd04[_0xf21b('0x3c')];_0x3e8c4d[_0xf21b('0x42')]=qs[_0xf21b('0x43')](_0x549fda[_0xf21b('0x39')][_0xf21b('0x43')]);_0x3e8c4d['where']=qs[_0xf21b('0x45')](_[_0xf21b('0x46')](_0x549fda[_0xf21b('0x39')],_0x41bd04[_0xf21b('0x45')]));if(_0x549fda[_0xf21b('0x39')][_0xf21b('0x47')]){_0x3e8c4d[_0xf21b('0x44')]=_[_0xf21b('0x48')](_0x3e8c4d[_0xf21b('0x44')],{'$or':_[_0xf21b('0x49')](_0x3e8c4d[_0xf21b('0x3e')],function(_0x41b331){var _0x5c7f42={};_0x5c7f42[_0x41b331]={'$like':'%'+_0x549fda[_0xf21b('0x39')]['filter']+'%'};return _0x5c7f42;})});}if(_0x549fda[_0xf21b('0x39')][_0xf21b('0x63')]){var _0x85046=_0x549fda[_0xf21b('0x39')][_0xf21b('0x63')][_0xf21b('0x64')](',');var _0x410773={};_0x410773[_0x85046[0x0]]={'$gte':moment(_0x85046[0x1])['format'](_0xf21b('0x65'))};_0x3e8c4d[_0xf21b('0x44')]=_[_0xf21b('0x48')](_0x3e8c4d['where'],_0x410773);}_0x3e8c4d=_[_0xf21b('0x48')]({},_0x3e8c4d,_0x549fda['options']);return _0x115369[_0xf21b('0x60')](_0x3e8c4d);}})[_0xf21b('0x20')](function(_0x4dfa6d){if(_0x4dfa6d){_0x36c26c=_0x4dfa6d[_0xf21b('0x3f')];if(!_0x549fda['query'][_0xf21b('0x40')](_0xf21b('0x41'))){_0x3e8c4d['limit']=qs[_0xf21b('0x2f')](_0x549fda[_0xf21b('0x39')][_0xf21b('0x2f')]);_0x3e8c4d['offset']=qs[_0xf21b('0x2e')](_0x549fda[_0xf21b('0x39')][_0xf21b('0x2e')]);}return _0x115369['getMessages'](_0x3e8c4d);}})[_0xf21b('0x20')](function(_0x44fcd8){if(_0x44fcd8){return _0x44fcd8?{'count':_0x36c26c,'rows':_0x44fcd8}:null;}})[_0xf21b('0x20')](respondWithResult(_0x475f3f,null))[_0xf21b('0x2a')](handleError(_0x475f3f,null));}; \ No newline at end of file +var _0xe1f4=['hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','length','create','body','find','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','rawAttributes','pick','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','./chatGroup.socket','register','jayson/promise','client','http','test','then','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatGroup,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','count','offset','limit','Content-Range','json','apply','save','update','stack','name','index','ChatGroup','model','keys','query','filters','intersection','attributes','fields'];(function(_0x270606,_0x4f6ee2){var _0x1cd9df=function(_0x2c0cac){while(--_0x2c0cac){_0x270606['push'](_0x270606['shift']());}};_0x1cd9df(++_0x4f6ee2);}(_0xe1f4,0x100));var _0x4e1f=function(_0x209e05,_0xc489b4){_0x209e05=_0x209e05-0x0;var _0x18ee7f=_0xe1f4[_0x209e05];return _0x18ee7f;};'use strict';var pdf=require(_0x4e1f('0x0'));var emlformat=require(_0x4e1f('0x1'));var rimraf=require(_0x4e1f('0x2'));var zipdir=require(_0x4e1f('0x3'));var jsonpatch=require(_0x4e1f('0x4'));var rp=require('request-promise');var moment=require(_0x4e1f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4e1f('0x6'));var util=require(_0x4e1f('0x7'));var path=require(_0x4e1f('0x8'));var sox=require(_0x4e1f('0x9'));var csv=require(_0x4e1f('0xa'));var ejs=require(_0x4e1f('0xb'));var fs=require('fs');var _=require(_0x4e1f('0xc'));var squel=require(_0x4e1f('0xd'));var crypto=require('crypto');var jsforce=require(_0x4e1f('0xe'));var deskjs=require(_0x4e1f('0xf'));var toCsv=require(_0x4e1f('0xa'));var querystring=require(_0x4e1f('0x10'));var Papa=require(_0x4e1f('0x11'));var Redis=require(_0x4e1f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4e1f('0x13'));var logger=require(_0x4e1f('0x14'))(_0x4e1f('0x15'));var utils=require(_0x4e1f('0x16'));var config=require(_0x4e1f('0x17'));var db=require('../../mysqldb')['db'];config[_0x4e1f('0x18')]=_['defaults'](config[_0x4e1f('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4e1f('0x18')]));require(_0x4e1f('0x19'))[_0x4e1f('0x1a')](socket);var jayson=require(_0x4e1f('0x1b'));var client=jayson[_0x4e1f('0x1c')][_0x4e1f('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x5212b9,_0x15a80a,_0x4b02eb){if(_0x4b02eb){var _0xc7ffbb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc7ffbb[_0x4e1f('0x1e')](_0x15a80a)){return _0x5212b9;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5212b9;}}function respondWithRpcPromise(_0x1f00cb,_0x492e8d,_0x2a1008,_0x111dea){return new BPromise(function(_0x1b97ec,_0x4212b9){var _0x638c58=_0x111dea||client;return _0x638c58['request'](_0x1f00cb,_0x2a1008)[_0x4e1f('0x1f')](function(_0x11dd84){logger['info']('ChatGroup,\x20%s,\x20%s',_0x492e8d,'request\x20sent');logger[_0x4e1f('0x20')](_0x4e1f('0x21'),_0x492e8d,_0x4e1f('0x22'),JSON[_0x4e1f('0x23')](_0x11dd84));if(_0x11dd84['error']){if(_0x11dd84['error'][_0x4e1f('0x24')]===0x1f4){logger[_0x4e1f('0x25')](_0x4e1f('0x26'),_0x492e8d,_0x11dd84['error'][_0x4e1f('0x27')]);return _0x4212b9(_0x11dd84[_0x4e1f('0x25')]['message']);}logger[_0x4e1f('0x25')](_0x4e1f('0x26'),_0x492e8d,_0x11dd84[_0x4e1f('0x25')][_0x4e1f('0x27')]);return _0x1b97ec(_0x11dd84[_0x4e1f('0x25')][_0x4e1f('0x27')]);}else{logger[_0x4e1f('0x28')]('ChatGroup,\x20%s,\x20%s',_0x492e8d,_0x4e1f('0x22'));_0x1b97ec(_0x11dd84[_0x4e1f('0x29')][_0x4e1f('0x27')]);}})[_0x4e1f('0x2a')](function(_0x29b856){logger['error'](_0x4e1f('0x26'),_0x492e8d,_0x29b856);_0x4212b9(_0x29b856);});});}function respondWithStatusCode(_0x1362c1,_0x21982b){_0x21982b=_0x21982b||0xcc;return function(_0x5c78cd){if(_0x5c78cd){return _0x1362c1[_0x4e1f('0x2b')](_0x21982b);}return _0x1362c1['status'](_0x21982b)[_0x4e1f('0x2c')]();};}function respondWithResult(_0x596a00,_0xbd4ef6){_0xbd4ef6=_0xbd4ef6||0xc8;return function(_0x31fd4b){if(_0x31fd4b){return _0x596a00[_0x4e1f('0x2d')](_0xbd4ef6)['json'](_0x31fd4b);}};}function respondWithFilteredResult(_0x3233c8,_0x27530d){return function(_0x5ac101){if(_0x5ac101){var _0x500803=_0x5ac101[_0x4e1f('0x2e')],_0x221d37=_0x27530d[_0x4e1f('0x2f')],_0x18c677=_0x27530d['offset']+_0x27530d[_0x4e1f('0x30')],_0x530580;if(_0x18c677>=_0x500803){_0x18c677=_0x500803;_0x530580=0xc8;}else{_0x530580=0xce;}_0x3233c8['status'](_0x530580);return _0x3233c8['set'](_0x4e1f('0x31'),_0x221d37+'-'+_0x18c677+'/'+_0x500803)[_0x4e1f('0x32')](_0x5ac101);}return null;};}function patchUpdates(_0x154c50){return function(_0x3e50c3){try{jsonpatch[_0x4e1f('0x33')](_0x3e50c3,_0x154c50,!![]);}catch(_0x16b052){return BPromise['reject'](_0x16b052);}return _0x3e50c3[_0x4e1f('0x34')]();};}function saveUpdates(_0x2ce2ae,_0x35affc){return function(_0x249ec3){if(_0x249ec3){return _0x249ec3[_0x4e1f('0x35')](_0x2ce2ae)[_0x4e1f('0x1f')](function(_0x23d95f){return _0x23d95f;});}return null;};}function removeEntity(_0x50628d,_0x2c061c){return function(_0x40d587){if(_0x40d587){return _0x40d587['destroy']()[_0x4e1f('0x1f')](function(){_0x50628d[_0x4e1f('0x2d')](0xcc)[_0x4e1f('0x2c')]();});}};}function handleEntityNotFound(_0x11df47,_0x4bf953){return function(_0x13e542){if(!_0x13e542){_0x11df47[_0x4e1f('0x2b')](0x194);}return _0x13e542;};}function handleError(_0x3591a2,_0x3dd1c0){_0x3dd1c0=_0x3dd1c0||0x1f4;return function(_0x198e3f){logger['error'](_0x198e3f[_0x4e1f('0x36')]);if(_0x198e3f['name']){delete _0x198e3f[_0x4e1f('0x37')];}_0x3591a2['status'](_0x3dd1c0)['send'](_0x198e3f);};}exports[_0x4e1f('0x38')]=function(_0x736779,_0x12eb49){var _0x2e7fef={},_0x554918={},_0x294423={'count':0x0,'rows':[]};var _0x765560=db[_0x4e1f('0x39')]['rawAttributes'];_0x554918[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](_0x765560);_0x554918[_0x4e1f('0x3c')]=_[_0x4e1f('0x3b')](_0x736779[_0x4e1f('0x3c')]);_0x554918[_0x4e1f('0x3d')]=_[_0x4e1f('0x3e')](_0x554918[_0x4e1f('0x3a')],_0x554918['query']);_0x2e7fef[_0x4e1f('0x3f')]=_[_0x4e1f('0x3e')](_0x554918[_0x4e1f('0x3a')],qs['fields'](_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x40')]));_0x2e7fef[_0x4e1f('0x3f')]=_0x2e7fef['attributes']['length']?_0x2e7fef[_0x4e1f('0x3f')]:_0x554918['model'];if(!_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x41')](_0x4e1f('0x42'))){_0x2e7fef['limit']=qs['limit'](_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x30')]);_0x2e7fef[_0x4e1f('0x2f')]=qs[_0x4e1f('0x2f')](_0x736779[_0x4e1f('0x3c')][_0x4e1f('0x2f')]);}_0x2e7fef[_0x4e1f('0x43')]=qs[_0x4e1f('0x44')](_0x736779['query'][_0x4e1f('0x44')]);_0x2e7fef[_0x4e1f('0x45')]=qs[_0x4e1f('0x3d')](_['pick'](_0x736779[_0x4e1f('0x3c')],_0x554918[_0x4e1f('0x3d')]));if(_0x736779['query'][_0x4e1f('0x46')]){_0x2e7fef['where']=_[_0x4e1f('0x47')](_0x2e7fef[_0x4e1f('0x45')],{'$or':_[_0x4e1f('0x48')](_0x765560,function(_0x6c119a){if(_0x6c119a[_0x4e1f('0x49')][_0x4e1f('0x4a')]!==_0x4e1f('0x4b')){var _0x56163b={};_0x56163b[_0x6c119a[_0x4e1f('0x4c')]]={'$like':'%'+_0x736779['query'][_0x4e1f('0x46')]+'%'};return _0x56163b;}})});}_0x2e7fef=_['merge']({},_0x2e7fef,_0x736779[_0x4e1f('0x4d')]);var _0x166065={'where':_0x2e7fef['where']};return db[_0x4e1f('0x39')][_0x4e1f('0x2e')](_0x166065)[_0x4e1f('0x1f')](function(_0x500cb8){_0x294423[_0x4e1f('0x2e')]=_0x500cb8;if(_0x736779[_0x4e1f('0x3c')]['includeAll']){_0x2e7fef[_0x4e1f('0x4e')]=[{'all':!![]}];}return db[_0x4e1f('0x39')][_0x4e1f('0x4f')](_0x2e7fef);})[_0x4e1f('0x1f')](function(_0x1991aa){_0x294423[_0x4e1f('0x50')]=_0x1991aa;return _0x294423;})['then'](respondWithFilteredResult(_0x12eb49,_0x2e7fef))[_0x4e1f('0x2a')](handleError(_0x12eb49,null));};exports[_0x4e1f('0x51')]=function(_0x954592,_0x2dbfc2){var _0x2c24ea={'raw':!![],'where':{'id':_0x954592['params']['id']}},_0x34e0ee={};_0x34e0ee[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](db[_0x4e1f('0x39')]['rawAttributes']);_0x34e0ee[_0x4e1f('0x3c')]=_['keys'](_0x954592[_0x4e1f('0x3c')]);_0x34e0ee[_0x4e1f('0x3d')]=_[_0x4e1f('0x3e')](_0x34e0ee[_0x4e1f('0x3a')],_0x34e0ee[_0x4e1f('0x3c')]);_0x2c24ea[_0x4e1f('0x3f')]=_['intersection'](_0x34e0ee[_0x4e1f('0x3a')],qs['fields'](_0x954592[_0x4e1f('0x3c')][_0x4e1f('0x40')]));_0x2c24ea[_0x4e1f('0x3f')]=_0x2c24ea[_0x4e1f('0x3f')][_0x4e1f('0x52')]?_0x2c24ea[_0x4e1f('0x3f')]:_0x34e0ee[_0x4e1f('0x3a')];if(_0x954592['query']['includeAll']){_0x2c24ea['include']=[{'all':!![]}];}_0x2c24ea=_[_0x4e1f('0x47')]({},_0x2c24ea,_0x954592[_0x4e1f('0x4d')]);return db[_0x4e1f('0x39')]['find'](_0x2c24ea)[_0x4e1f('0x1f')](handleEntityNotFound(_0x2dbfc2,null))[_0x4e1f('0x1f')](respondWithResult(_0x2dbfc2,null))[_0x4e1f('0x2a')](handleError(_0x2dbfc2,null));};exports['create']=function(_0x47e912,_0x205e25){return db[_0x4e1f('0x39')][_0x4e1f('0x53')](_0x47e912['body'],{})[_0x4e1f('0x1f')](respondWithResult(_0x205e25,0xc9))[_0x4e1f('0x2a')](handleError(_0x205e25,null));};exports[_0x4e1f('0x35')]=function(_0x14b34a,_0x1c9029){if(_0x14b34a[_0x4e1f('0x54')]['id']){delete _0x14b34a['body']['id'];}return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x14b34a[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x1c9029,null))[_0x4e1f('0x1f')](saveUpdates(_0x14b34a[_0x4e1f('0x54')],null))[_0x4e1f('0x1f')](respondWithResult(_0x1c9029,null))[_0x4e1f('0x2a')](handleError(_0x1c9029,null));};exports['destroy']=function(_0x5e0100,_0x5e5ecb){return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x5e0100['params']['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x5e5ecb,null))['then'](removeEntity(_0x5e5ecb,null))[_0x4e1f('0x2a')](handleError(_0x5e5ecb,null));};exports[_0x4e1f('0x57')]=function(_0x2d1392,_0x305504){return db['ChatGroup'][_0x4e1f('0x57')]()['then'](respondWithResult(_0x305504,null))[_0x4e1f('0x2a')](handleError(_0x305504,null));};exports[_0x4e1f('0x58')]=function(_0x4abec9,_0xa04d51,_0x4e53f5){return db[_0x4e1f('0x59')][_0x4e1f('0x2e')]({'where':{'ChatGroupId':_0x4abec9['params']['id'],'ToId':_0x4abec9[_0x4e1f('0x5a')]['id'],'read':![]}})[_0x4e1f('0x1f')](function(_0x370a22){return{'id':_[_0x4e1f('0x5b')](_0x4abec9[_0x4e1f('0x56')]['id']),'count':_0x370a22};})[_0x4e1f('0x1f')](respondWithResult(_0xa04d51,null))[_0x4e1f('0x2a')](handleError(_0xa04d51,null));};exports['addMembers']=function(_0x29ecc9,_0x2074b7,_0x2e80a0){return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x29ecc9[_0x4e1f('0x56')]['id']}})['then'](handleEntityNotFound(_0x2074b7,null))['then'](function(_0xaf5abd){if(_0xaf5abd){return _0xaf5abd[_0x4e1f('0x5c')](_0x29ecc9[_0x4e1f('0x54')][_0x4e1f('0x5d')],_[_0x4e1f('0x5e')](_0x29ecc9['body'],[_0x4e1f('0x5d'),'id'])||{});}})['then'](respondWithResult(_0x2074b7,null))['catch'](handleError(_0x2074b7,null));};exports[_0x4e1f('0x5f')]=function(_0x4d7385,_0xad855c,_0x34f095){var _0x1c428e={};var _0x5ca071={};var _0xe5f529;var _0x3b253b;return db[_0x4e1f('0x39')][_0x4e1f('0x60')]({'where':{'id':_0x4d7385[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0xad855c,null))[_0x4e1f('0x1f')](function(_0x5b6580){if(_0x5b6580){_0xe5f529=_0x5b6580;_0x5ca071[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](db[_0x4e1f('0x61')][_0x4e1f('0x62')]);_0x5ca071[_0x4e1f('0x3c')]=_[_0x4e1f('0x3b')](_0x4d7385[_0x4e1f('0x3c')]);_0x5ca071['filters']=_[_0x4e1f('0x3e')](_0x5ca071[_0x4e1f('0x3a')],_0x5ca071['query']);_0x1c428e[_0x4e1f('0x3f')]=_['intersection'](_0x5ca071[_0x4e1f('0x3a')],qs[_0x4e1f('0x40')](_0x4d7385['query'][_0x4e1f('0x40')]));_0x1c428e[_0x4e1f('0x3f')]=_0x1c428e[_0x4e1f('0x3f')][_0x4e1f('0x52')]?_0x1c428e[_0x4e1f('0x3f')]:_0x5ca071['model'];_0x1c428e[_0x4e1f('0x43')]=qs[_0x4e1f('0x44')](_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x44')]);_0x1c428e['where']=qs[_0x4e1f('0x3d')](_[_0x4e1f('0x63')](_0x4d7385[_0x4e1f('0x3c')],_0x5ca071[_0x4e1f('0x3d')]));if(_0x4d7385['query'][_0x4e1f('0x46')]){_0x1c428e[_0x4e1f('0x45')]=_[_0x4e1f('0x47')](_0x1c428e[_0x4e1f('0x45')],{'$or':_[_0x4e1f('0x48')](_0x1c428e[_0x4e1f('0x3f')],function(_0x25e92e){var _0x209410={};_0x209410[_0x25e92e]={'$like':'%'+_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x46')]+'%'};return _0x209410;})});}_0x1c428e=_[_0x4e1f('0x47')]({},_0x1c428e,_0x4d7385[_0x4e1f('0x4d')]);return _0xe5f529['getMembers'](_0x1c428e);}})['then'](function(_0x59c026){if(_0x59c026){_0x3b253b=_0x59c026['length'];if(!_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x41')](_0x4e1f('0x42'))){_0x1c428e[_0x4e1f('0x30')]=qs[_0x4e1f('0x30')](_0x4d7385[_0x4e1f('0x3c')][_0x4e1f('0x30')]);_0x1c428e[_0x4e1f('0x2f')]=qs[_0x4e1f('0x2f')](_0x4d7385['query'][_0x4e1f('0x2f')]);}return _0xe5f529['getMembers'](_0x1c428e);}})[_0x4e1f('0x1f')](function(_0xe97668){if(_0xe97668){return _0xe97668?{'count':_0x3b253b,'rows':_0xe97668}:null;}})['then'](respondWithResult(_0xad855c,null))[_0x4e1f('0x2a')](handleError(_0xad855c,null));};exports['removeMembers']=function(_0x283b51,_0x5a877c,_0x586274){return db[_0x4e1f('0x39')][_0x4e1f('0x55')]({'where':{'id':_0x283b51[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x5a877c,null))[_0x4e1f('0x1f')](function(_0x356c40){if(_0x356c40){return _0x356c40['removeMembers'](_0x283b51[_0x4e1f('0x3c')][_0x4e1f('0x5d')]);}})[_0x4e1f('0x1f')](respondWithStatusCode(_0x5a877c,null))[_0x4e1f('0x2a')](handleError(_0x5a877c,null));};exports[_0x4e1f('0x64')]=function(_0x1981e3,_0x982196,_0x51dba0){if(_0x1981e3[_0x4e1f('0x54')]['id']){delete _0x1981e3[_0x4e1f('0x54')]['id'];}return db['ChatGroup'][_0x4e1f('0x55')]({'where':{'id':_0x1981e3[_0x4e1f('0x56')]['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x982196,null))[_0x4e1f('0x1f')](function(_0x11a409){if(_0x11a409){_0x1981e3[_0x4e1f('0x54')][_0x4e1f('0x65')]=_0x11a409['id'];return db['ChatInternalMessage'][_0x4e1f('0x53')](_0x1981e3[_0x4e1f('0x54')]);}})[_0x4e1f('0x1f')](respondWithResult(_0x982196,null))[_0x4e1f('0x2a')](handleError(_0x982196,null));};exports['getMessages']=function(_0x588b1f,_0x257610,_0x565f09){var _0x3f86c2={};var _0x1dd3f6={};var _0xad7813;var _0x14cd62;return db[_0x4e1f('0x39')][_0x4e1f('0x60')]({'where':{'id':_0x588b1f['params']['id']}})[_0x4e1f('0x1f')](handleEntityNotFound(_0x257610,null))[_0x4e1f('0x1f')](function(_0x378368){if(_0x378368){_0xad7813=_0x378368;_0x1dd3f6[_0x4e1f('0x3a')]=_[_0x4e1f('0x3b')](db[_0x4e1f('0x59')][_0x4e1f('0x62')]);_0x1dd3f6[_0x4e1f('0x3c')]=_[_0x4e1f('0x3b')](_0x588b1f[_0x4e1f('0x3c')]);_0x1dd3f6[_0x4e1f('0x3d')]=_['intersection'](_0x1dd3f6[_0x4e1f('0x3a')],_0x1dd3f6[_0x4e1f('0x3c')]);_0x3f86c2[_0x4e1f('0x3f')]=_['intersection'](_0x1dd3f6[_0x4e1f('0x3a')],qs[_0x4e1f('0x40')](_0x588b1f['query'][_0x4e1f('0x40')]));_0x3f86c2[_0x4e1f('0x3f')]=_0x3f86c2[_0x4e1f('0x3f')][_0x4e1f('0x52')]?_0x3f86c2[_0x4e1f('0x3f')]:_0x1dd3f6['model'];_0x3f86c2[_0x4e1f('0x43')]=qs[_0x4e1f('0x44')](_0x588b1f['query'][_0x4e1f('0x44')]);_0x3f86c2[_0x4e1f('0x45')]=qs[_0x4e1f('0x3d')](_['pick'](_0x588b1f['query'],_0x1dd3f6['filters']));if(_0x588b1f[_0x4e1f('0x3c')]['filter']){_0x3f86c2[_0x4e1f('0x45')]=_[_0x4e1f('0x47')](_0x3f86c2[_0x4e1f('0x45')],{'$or':_[_0x4e1f('0x48')](_0x3f86c2['attributes'],function(_0x127a60){var _0x1844d3={};_0x1844d3[_0x127a60]={'$like':'%'+_0x588b1f[_0x4e1f('0x3c')][_0x4e1f('0x46')]+'%'};return _0x1844d3;})});}if(_0x588b1f[_0x4e1f('0x3c')]['$gte']){var _0x23d45a=_0x588b1f['query'][_0x4e1f('0x66')][_0x4e1f('0x67')](',');var _0x36465f={};_0x36465f[_0x23d45a[0x0]]={'$gte':moment(_0x23d45a[0x1])[_0x4e1f('0x68')](_0x4e1f('0x69'))};_0x3f86c2[_0x4e1f('0x45')]=_['merge'](_0x3f86c2[_0x4e1f('0x45')],_0x36465f);}_0x3f86c2=_[_0x4e1f('0x47')]({},_0x3f86c2,_0x588b1f[_0x4e1f('0x4d')]);return _0xad7813[_0x4e1f('0x6a')](_0x3f86c2);}})['then'](function(_0x26b33f){if(_0x26b33f){_0x14cd62=_0x26b33f[_0x4e1f('0x52')];if(!_0x588b1f['query'][_0x4e1f('0x41')](_0x4e1f('0x42'))){_0x3f86c2[_0x4e1f('0x30')]=qs[_0x4e1f('0x30')](_0x588b1f[_0x4e1f('0x3c')][_0x4e1f('0x30')]);_0x3f86c2[_0x4e1f('0x2f')]=qs[_0x4e1f('0x2f')](_0x588b1f['query'][_0x4e1f('0x2f')]);}return _0xad7813['getMessages'](_0x3f86c2);}})[_0x4e1f('0x1f')](function(_0x51125a){if(_0x51125a){return _0x51125a?{'count':_0x14cd62,'rows':_0x51125a}:null;}})[_0x4e1f('0x1f')](respondWithResult(_0x257610,null))[_0x4e1f('0x2a')](handleError(_0x257610,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 8c84241..251de94 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 _0xf94d=['exports','events','../../mysqldb','ChatGroup','update','emit'];(function(_0x310d10,_0x3fe887){var _0x1fb8af=function(_0x42965b){while(--_0x42965b){_0x310d10['push'](_0x310d10['shift']());}};_0x1fb8af(++_0x3fe887);}(_0xf94d,0x157));var _0xdf94=function(_0x4cc4bc,_0x365a9c){_0x4cc4bc=_0x4cc4bc-0x0;var _0xf3eeda=_0xf94d[_0x4cc4bc];return _0xf3eeda;};'use strict';var EventEmitter=require(_0xdf94('0x0'));var ChatGroup=require(_0xdf94('0x1'))['db'][_0xdf94('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf94('0x3'),'afterDestroy':'remove'};function emitEvent(_0x55f952){return function(_0x18be55,_0x2bd698,_0x4bd8c3){ChatGroupEvents['emit'](_0x55f952+':'+_0x18be55['id'],_0x18be55);ChatGroupEvents[_0xdf94('0x4')](_0x55f952,_0x18be55);_0x4bd8c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0xdf94('0x5')]=ChatGroupEvents; \ No newline at end of file +var _0x945c=['../../mysqldb','setMaxListeners','save','update','emit','hook','events'];(function(_0x924bed,_0x29479e){var _0x11bd14=function(_0x47fd3c){while(--_0x47fd3c){_0x924bed['push'](_0x924bed['shift']());}};_0x11bd14(++_0x29479e);}(_0x945c,0xd1));var _0xc945=function(_0x56b963,_0x52279f){_0x56b963=_0x56b963-0x0;var _0x144fe4=_0x945c[_0x56b963];return _0x144fe4;};'use strict';var EventEmitter=require(_0xc945('0x0'));var ChatGroup=require(_0xc945('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xc945('0x2')](0x0);var events={'afterCreate':_0xc945('0x3'),'afterUpdate':_0xc945('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2aa0e5){return function(_0x4124a4,_0x212e95,_0x23eb98){ChatGroupEvents['emit'](_0x2aa0e5+':'+_0x4124a4['id'],_0x4124a4);ChatGroupEvents[_0xc945('0x5')](_0x2aa0e5,_0x4124a4);_0x23eb98(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0xc945('0x6')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 83714eb..2c552cc 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 _0xf7c8=['define','ChatGroup','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x39542,_0x5a6bb){var _0x3a2b39=function(_0x5e241c){while(--_0x5e241c){_0x39542['push'](_0x39542['shift']());}};_0x3a2b39(++_0x5a6bb);}(_0xf7c8,0x1ca));var _0x8f7c=function(_0x599767,_0x472fbf){_0x599767=_0x599767-0x0;var _0x2bb310=_0xf7c8[_0x599767];return _0x2bb310;};'use strict';var _=require(_0x8f7c('0x0'));var util=require(_0x8f7c('0x1'));var logger=require(_0x8f7c('0x2'))(_0x8f7c('0x3'));var moment=require(_0x8f7c('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f7c('0x5'));var fs=require('fs');var path=require(_0x8f7c('0x6'));var rimraf=require(_0x8f7c('0x7'));var config=require(_0x8f7c('0x8'));var attributes=require('./chatGroup.attributes');module[_0x8f7c('0x9')]=function(_0x1d6ec1,_0x4342b6){return _0x1d6ec1[_0x8f7c('0xa')](_0x8f7c('0xb'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4dba=['bluebird','request-promise','path','rimraf','../../config/environment','exports','chat_groups','lodash','util','../../config/logger','moment'];(function(_0x43f210,_0x598447){var _0x367860=function(_0x1a0950){while(--_0x1a0950){_0x43f210['push'](_0x43f210['shift']());}};_0x367860(++_0x598447);}(_0x4dba,0x104));var _0xa4db=function(_0x11df4b,_0x2402cb){_0x11df4b=_0x11df4b-0x0;var _0x1b4be1=_0x4dba[_0x11df4b];return _0x1b4be1;};'use strict';var _=require(_0xa4db('0x0'));var util=require(_0xa4db('0x1'));var logger=require(_0xa4db('0x2'))('api');var moment=require(_0xa4db('0x3'));var BPromise=require(_0xa4db('0x4'));var rp=require(_0xa4db('0x5'));var fs=require('fs');var path=require(_0xa4db('0x6'));var rimraf=require(_0xa4db('0x7'));var config=require(_0xa4db('0x8'));var attributes=require('./chatGroup.attributes');module[_0xa4db('0x9')]=function(_0x265646,_0x234182){return _0x265646['define']('ChatGroup',attributes,{'tableName':_0xa4db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 871a17e..7048573 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 _0xb458=['../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./chatGroup.socket','register','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x22af40,_0x1801a2){var _0x54302d=function(_0x4c2d4f){while(--_0x4c2d4f){_0x22af40['push'](_0x22af40['shift']());}};_0x54302d(++_0x1801a2);}(_0xb458,0x103));var _0x8b45=function(_0x32e130,_0x488211){_0x32e130=_0x32e130-0x0;var _0x1a2b0d=_0xb458[_0x32e130];return _0x1a2b0d;};'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});config[_0x8b45('0x9')]=_[_0x8b45('0xa')](config[_0x8b45('0x9')],{'host':_0x8b45('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b45('0x9')]));require(_0x8b45('0xc'))[_0x8b45('0xd')](socket);function respondWithRpcPromise(_0x2bc809,_0x2f7117,_0x499899){return new BPromise(function(_0x2a4c83,_0x7cc49b){return client['request'](_0x2bc809,_0x499899)['then'](function(_0x5bb708){logger['info'](_0x8b45('0xe'),_0x2f7117,_0x8b45('0xf'));logger[_0x8b45('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2f7117,_0x8b45('0xf'),JSON[_0x8b45('0x11')](_0x5bb708));if(_0x5bb708[_0x8b45('0x12')]){if(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x13')]===0x1f4){logger[_0x8b45('0x12')]('ChatGroup,\x20%s,\x20%s',_0x2f7117,_0x5bb708['error'][_0x8b45('0x14')]);return _0x7cc49b(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);}logger[_0x8b45('0x12')](_0x8b45('0xe'),_0x2f7117,_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);return _0x2a4c83(_0x5bb708[_0x8b45('0x12')][_0x8b45('0x14')]);}else{logger[_0x8b45('0x15')](_0x8b45('0xe'),_0x2f7117,_0x8b45('0xf'));_0x2a4c83(_0x5bb708[_0x8b45('0x16')][_0x8b45('0x14')]);}})[_0x8b45('0x17')](function(_0x31c6b4){logger[_0x8b45('0x12')](_0x8b45('0xe'),_0x2f7117,_0x31c6b4);_0x7cc49b(_0x31c6b4);});});} \ No newline at end of file +var _0x29d4=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0x29d4,0x1a1));var _0x429d=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x29d4[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x429d('0x0'));var util=require('util');var moment=require(_0x429d('0x1'));var BPromise=require(_0x429d('0x2'));var rs=require(_0x429d('0x3'));var fs=require('fs');var Redis=require(_0x429d('0x4'));var db=require(_0x429d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x429d('0x6'))(_0x429d('0x7'));var config=require(_0x429d('0x8'));var jayson=require(_0x429d('0x9'));var client=jayson[_0x429d('0xa')][_0x429d('0xb')]({'port':0x232a});config[_0x429d('0xc')]=_[_0x429d('0xd')](config['redis'],{'host':_0x429d('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x429d('0xc')]));require(_0x429d('0xf'))[_0x429d('0x10')](socket);function respondWithRpcPromise(_0x5e8430,_0x1f9b3e,_0x8c7cb6){return new BPromise(function(_0x5993cc,_0x31ff87){return client[_0x429d('0x11')](_0x5e8430,_0x8c7cb6)[_0x429d('0x12')](function(_0x5b45c2){logger[_0x429d('0x13')](_0x429d('0x14'),_0x1f9b3e,_0x429d('0x15'));logger[_0x429d('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x1f9b3e,_0x429d('0x15'),JSON[_0x429d('0x17')](_0x5b45c2));if(_0x5b45c2[_0x429d('0x18')]){if(_0x5b45c2['error'][_0x429d('0x19')]===0x1f4){logger[_0x429d('0x18')]('ChatGroup,\x20%s,\x20%s',_0x1f9b3e,_0x5b45c2[_0x429d('0x18')][_0x429d('0x1a')]);return _0x31ff87(_0x5b45c2[_0x429d('0x18')][_0x429d('0x1a')]);}logger[_0x429d('0x18')](_0x429d('0x14'),_0x1f9b3e,_0x5b45c2['error'][_0x429d('0x1a')]);return _0x5993cc(_0x5b45c2['error'][_0x429d('0x1a')]);}else{logger[_0x429d('0x13')](_0x429d('0x14'),_0x1f9b3e,_0x429d('0x15'));_0x5993cc(_0x5b45c2['result'][_0x429d('0x1a')]);}})[_0x429d('0x1b')](function(_0x2b9e78){logger['error'](_0x429d('0x14'),_0x1f9b3e,_0x2b9e78);_0x31ff87(_0x2b9e78);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 0ccaef2..c68c62e 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 _0xbbfa=['removeListener','register','chatGroup:','./chatGroup.events','remove','emit'];(function(_0x5d27c1,_0x46877d){var _0x50c9a9=function(_0x57d357){while(--_0x57d357){_0x5d27c1['push'](_0x5d27c1['shift']());}};_0x50c9a9(++_0x46877d);}(_0xbbfa,0x1e9));var _0xabbf=function(_0x4dc0c8,_0x48d51f){_0x4dc0c8=_0x4dc0c8-0x0;var _0x26bf81=_0xbbfa[_0x4dc0c8];return _0x26bf81;};'use strict';var ChatGroupEvents=require(_0xabbf('0x0'));var events=['save',_0xabbf('0x1'),'update'];function createListener(_0x2948b3,_0x1ba4c4){return function(_0x33a780){_0x1ba4c4[_0xabbf('0x2')](_0x2948b3,_0x33a780);};}function removeListener(_0x30da1f,_0xfd2359){return function(){ChatGroupEvents[_0xabbf('0x3')](_0x30da1f,_0xfd2359);};}exports[_0xabbf('0x4')]=function(_0x120840){for(var _0x7d0c02=0x0,_0x45b7d6=events['length'];_0x7d0c02<_0x45b7d6;_0x7d0c02++){var _0x5b471b=events[_0x7d0c02];var _0x536a4c=createListener(_0xabbf('0x5')+_0x5b471b,_0x120840);ChatGroupEvents['on'](_0x5b471b,_0x536a4c);}}; \ No newline at end of file +var _0x1120=['./chatGroup.events','save','remove','emit','removeListener','register','length','chatGroup:'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x1120,0x140));var _0x0112=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x1120[_0x4953da];return _0x2d3780;};'use strict';var ChatGroupEvents=require(_0x0112('0x0'));var events=[_0x0112('0x1'),_0x0112('0x2'),'update'];function createListener(_0x5dd0ed,_0x5190bd){return function(_0x54a1d2){_0x5190bd[_0x0112('0x3')](_0x5dd0ed,_0x54a1d2);};}function removeListener(_0x395145,_0x1d9e34){return function(){ChatGroupEvents[_0x0112('0x4')](_0x395145,_0x1d9e34);};}exports[_0x0112('0x5')]=function(_0x10fdca){for(var _0x408230=0x0,_0x40ad0d=events[_0x0112('0x6')];_0x408230<_0x40ad0d;_0x408230++){var _0x444422=events[_0x408230];var _0x2fd18c=createListener(_0x0112('0x7')+_0x444422,_0x10fdca);ChatGroupEvents['on'](_0x444422,_0x2fd18c);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 0bfe4bd..8bb4a1b 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 _0x015b=['delete','destroy','removeMembers','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','put','update'];(function(_0x14fb02,_0x15e8ca){var _0x4458ee=function(_0x5dac71){while(--_0x5dac71){_0x14fb02['push'](_0x14fb02['shift']());}};_0x4458ee(++_0x15e8ca);}(_0x015b,0xab));var _0xb015=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0x015b[_0x5dee2a];return _0x31e98e;};'use strict';var multer=require(_0xb015('0x0'));var util=require(_0xb015('0x1'));var path=require(_0xb015('0x2'));var timeout=require(_0xb015('0x3'));var express=require(_0xb015('0x4'));var router=express[_0xb015('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb015('0x6'));var config=require(_0xb015('0x7'));var controller=require(_0xb015('0x8'));router[_0xb015('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb015('0x9')]('/describe',auth[_0xb015('0xa')](),controller[_0xb015('0xb')]);router[_0xb015('0x9')](_0xb015('0xc'),auth[_0xb015('0xa')](),controller[_0xb015('0xd')]);router[_0xb015('0x9')](_0xb015('0xe'),auth[_0xb015('0xa')](),controller[_0xb015('0xf')]);router[_0xb015('0x9')](_0xb015('0x10'),auth[_0xb015('0xa')](),controller[_0xb015('0x11')]);router[_0xb015('0x9')](_0xb015('0x12'),auth[_0xb015('0xa')](),controller[_0xb015('0x13')]);router[_0xb015('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb015('0x14')](_0xb015('0x10'),auth[_0xb015('0xa')](),controller[_0xb015('0x15')]);router[_0xb015('0x14')](_0xb015('0x12'),auth['isAuthenticated'](),controller[_0xb015('0x16')]);router[_0xb015('0x17')](_0xb015('0xc'),auth[_0xb015('0xa')](),controller[_0xb015('0x18')]);router[_0xb015('0x19')](_0xb015('0xc'),auth['isAuthenticated'](),controller[_0xb015('0x1a')]);router[_0xb015('0x19')](_0xb015('0x10'),auth['isAuthenticated'](),controller[_0xb015('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x316d=['describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','update','destroy','delete','removeMembers','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated'];(function(_0xea9aa8,_0x50a1b4){var _0x8992e7=function(_0x578691){while(--_0x578691){_0xea9aa8['push'](_0xea9aa8['shift']());}};_0x8992e7(++_0x50a1b4);}(_0x316d,0x147));var _0xd316=function(_0x173a3f,_0x3681b6){_0x173a3f=_0x173a3f-0x0;var _0x6f031b=_0x316d[_0x173a3f];return _0x6f031b;};'use strict';var multer=require('multer');var util=require(_0xd316('0x0'));var path=require(_0xd316('0x1'));var timeout=require('connect-timeout');var express=require(_0xd316('0x2'));var router=express[_0xd316('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd316('0x4'));var config=require(_0xd316('0x5'));var controller=require('./chatGroup.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd316('0x6')](_0xd316('0x7'),auth[_0xd316('0x8')](),controller[_0xd316('0x9')]);router['get'](_0xd316('0xa'),auth['isAuthenticated'](),controller[_0xd316('0xb')]);router[_0xd316('0x6')]('/:id/unread',auth[_0xd316('0x8')](),controller[_0xd316('0xc')]);router[_0xd316('0x6')](_0xd316('0xd'),auth[_0xd316('0x8')](),controller[_0xd316('0xe')]);router['get'](_0xd316('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd316('0x10')]('/',auth[_0xd316('0x8')](),controller[_0xd316('0x11')]);router[_0xd316('0x10')](_0xd316('0xd'),auth[_0xd316('0x8')](),controller[_0xd316('0x12')]);router['post'](_0xd316('0xf'),auth[_0xd316('0x8')](),controller['addMessage']);router['put'](_0xd316('0xa'),auth['isAuthenticated'](),controller[_0xd316('0x13')]);router['delete'](_0xd316('0xa'),auth['isAuthenticated'](),controller[_0xd316('0x14')]);router[_0xd316('0x15')](_0xd316('0xd'),auth[_0xd316('0x8')](),controller[_0xd316('0x16')]);module[_0xd316('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index dbb6bf6..14cf3fb 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 _0x6cb4=['long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING'];(function(_0x20273f,_0x46c609){var _0x10b050=function(_0x26721d){while(--_0x26721d){_0x20273f['push'](_0x20273f['shift']());}};_0x10b050(++_0x46c609);}(_0x6cb4,0xff));var _0x46cb=function(_0x5e06e4,_0x5b5ec9){_0x5e06e4=_0x5e06e4-0x0;var _0x4b0a43=_0x6cb4[_0x5e06e4];return _0x4b0a43;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'closed':{'type':Sequelize[_0x46cb('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x46cb('0x3')]},'ratingType':{'type':Sequelize[_0x46cb('0x4')](_0x46cb('0x5'),_0x46cb('0x6')),'defaultValue':_0x46cb('0x5')},'ratingMessage':{'type':Sequelize[_0x46cb('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x46cb('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x46cb('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x46cb('0x8')]},'browserVersion':{'type':Sequelize[_0x46cb('0x8')]},'osName':{'type':Sequelize[_0x46cb('0x8')]},'osVersion':{'type':Sequelize[_0x46cb('0x8')]},'deviceModel':{'type':Sequelize[_0x46cb('0x8')]},'deviceVendor':{'type':Sequelize[_0x46cb('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x46cb('0x8')]},'customerIp':{'type':Sequelize[_0x46cb('0x8')]},'formData':{'type':Sequelize['TEXT'](_0x46cb('0x9'))},'read1stAt':{'type':Sequelize[_0x46cb('0xa')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x46cb('0x4')]('in',_0x46cb('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2547=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports'];(function(_0x5e13af,_0x5461e0){var _0x3dbfa0=function(_0x44c302){while(--_0x44c302){_0x5e13af['push'](_0x5e13af['shift']());}};_0x3dbfa0(++_0x5461e0);}(_0x2547,0x1cd));var _0x7254=function(_0x5267b9,_0x2bc500){_0x5267b9=_0x5267b9-0x0;var _0x3ea9d5=_0x2547[_0x5267b9];return _0x3ea9d5;};'use strict';var Sequelize=require('sequelize');module[_0x7254('0x0')]={'closed':{'type':Sequelize[_0x7254('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x7254('0x2')]},'ratingType':{'type':Sequelize[_0x7254('0x3')](_0x7254('0x4'),_0x7254('0x5')),'defaultValue':_0x7254('0x4')},'ratingMessage':{'type':Sequelize[_0x7254('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x7254('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x7254('0x8')]},'disposition':{'type':Sequelize[_0x7254('0x7')]},'note':{'type':Sequelize[_0x7254('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x7254('0x7')]},'osName':{'type':Sequelize[_0x7254('0x7')]},'osVersion':{'type':Sequelize[_0x7254('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x7254('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['STRING']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x7254('0x6')](_0x7254('0x9'))},'read1stAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgAt':{'type':Sequelize[_0x7254('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x7254('0x3')]('in',_0x7254('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 74fc64c..c0b7fc2 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 _0x2dae=['parse','advancedFilter','createdAt','value','dateStart','startOf','day','utc','format','endOf','and','isArray','condition','TagId','Messages.count','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','c.firstName','c.lastName','\x20LIKE\x20?','\x20>\x20?','\x20<\x20?','ContactId','c.email','map','filter','forEach','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','group','i.id','Sequelize','QueryTypes','SELECT','clone','read','%s\x20=\x200','`Messages.count`\x20=\x200','having','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','ChatInteraction','Contact.firstName','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','Users','Tags','push','rows','show','includeAll','merge','options','find','create','body','params','describe','customUpdate','abandon','entity\x20not\x20found','UserId','ValidationError','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','download','server/files/attachments/','close','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','ChatWebsite','agentAlias','System','customer','%s%d','Visitor','website_alias','alias','agent_fullname','fullname','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','secure','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','mailTranscript','addMessage','omit','getMessages','nolimit','findAll','getMyMessages','include','addTags','ids','spread','Tag','emit','chatInteractionTags:save','removeTags','server','files','tmp','root','transcript-%d-%s.zip','CmContact','Contact','firstName','Account','Owner','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','referer','customerIp','tail','existsSync','createReadStream','createWriteStream','out','renderFile','.pdf','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','name','send','index','rawAttributes','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','pick','select','field','color','from','COUNT(*)','where','me.ChatInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','left_join','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','expr'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2dae,0xc3));var _0xe2da=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0x2dae[_0x1911ed];return _0x11edaa;};'use strict';var pdf=require(_0xe2da('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe2da('0x1'));var zipdir=require(_0xe2da('0x2'));var jsonpatch=require(_0xe2da('0x3'));var rp=require(_0xe2da('0x4'));var moment=require(_0xe2da('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe2da('0x6'));var util=require(_0xe2da('0x7'));var path=require(_0xe2da('0x8'));var sox=require(_0xe2da('0x9'));var csv=require('to-csv');var ejs=require(_0xe2da('0xa'));var fs=require('fs');var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x10'));var querystring=require(_0xe2da('0x11'));var Papa=require(_0xe2da('0x12'));var Redis=require('ioredis');var authService=require(_0xe2da('0x13'));var qs=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var db=require(_0xe2da('0x1a'))['db'];config['redis']=_[_0xe2da('0x1b')](config['redis'],{'host':_0xe2da('0x1c'),'port':0x18eb});var socket=require(_0xe2da('0x1d'))(new Redis(config[_0xe2da('0x1e')]));require(_0xe2da('0x1f'))[_0xe2da('0x20')](socket);var jayson=require(_0xe2da('0x21'));var client=jayson[_0xe2da('0x22')]['http']({'port':0x232b});var client9004=jayson[_0xe2da('0x22')]['http']({'port':0x232c});function checkPasswordPattern(_0x586b27,_0x403d1c,_0x3dfc52){if(_0x3dfc52){var _0x33f919=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f919['test'](_0x403d1c)){return _0x586b27;}else{throw new Error(_0xe2da('0x23'));}}else{return _0x586b27;}}function respondWithRpcPromise(_0x2c0353,_0x2ea60e,_0x33568f,_0x4e1623){return new BPromise(function(_0x45bb92,_0x1f7d33){var _0x417363=_0x4e1623||client;return _0x417363[_0xe2da('0x24')](_0x2c0353,_0x33568f)[_0xe2da('0x25')](function(_0x4c03a7){logger[_0xe2da('0x26')](_0xe2da('0x27'),_0x2ea60e,'request\x20sent');logger[_0xe2da('0x28')](_0xe2da('0x29'),_0x2ea60e,_0xe2da('0x2a'),JSON[_0xe2da('0x2b')](_0x4c03a7));if(_0x4c03a7[_0xe2da('0x2c')]){if(_0x4c03a7[_0xe2da('0x2c')]['code']===0x1f4){logger[_0xe2da('0x2c')]('ChatInteraction,\x20%s,\x20%s',_0x2ea60e,_0x4c03a7[_0xe2da('0x2c')][_0xe2da('0x2d')]);return _0x1f7d33(_0x4c03a7[_0xe2da('0x2c')][_0xe2da('0x2d')]);}logger[_0xe2da('0x2c')](_0xe2da('0x27'),_0x2ea60e,_0x4c03a7[_0xe2da('0x2c')][_0xe2da('0x2d')]);return _0x45bb92(_0x4c03a7['error'][_0xe2da('0x2d')]);}else{logger[_0xe2da('0x26')](_0xe2da('0x27'),_0x2ea60e,_0xe2da('0x2a'));_0x45bb92(_0x4c03a7[_0xe2da('0x2e')][_0xe2da('0x2d')]);}})[_0xe2da('0x2f')](function(_0x56c37e){logger[_0xe2da('0x2c')](_0xe2da('0x27'),_0x2ea60e,_0x56c37e);_0x1f7d33(_0x56c37e);});});}function respondWithStatusCode(_0x1dc228,_0x38ee5e){_0x38ee5e=_0x38ee5e||0xcc;return function(_0x36ca43){if(_0x36ca43){return _0x1dc228[_0xe2da('0x30')](_0x38ee5e);}return _0x1dc228[_0xe2da('0x31')](_0x38ee5e)[_0xe2da('0x32')]();};}function respondWithResult(_0x516f42,_0x487a7c){_0x487a7c=_0x487a7c||0xc8;return function(_0x5e259a){if(_0x5e259a){return _0x516f42[_0xe2da('0x31')](_0x487a7c)[_0xe2da('0x33')](_0x5e259a);}};}function respondWithFilteredResult(_0x4146ad,_0x1ab91a){return function(_0x5de7fb){if(_0x5de7fb){var _0x490794=_0x5de7fb[_0xe2da('0x34')],_0x356ab4=_0x1ab91a[_0xe2da('0x35')],_0x1ec8ca=_0x1ab91a[_0xe2da('0x35')]+_0x1ab91a[_0xe2da('0x36')],_0x262d40;if(_0x1ec8ca>=_0x490794){_0x1ec8ca=_0x490794;_0x262d40=0xc8;}else{_0x262d40=0xce;}_0x4146ad[_0xe2da('0x31')](_0x262d40);return _0x4146ad[_0xe2da('0x37')]('Content-Range',_0x356ab4+'-'+_0x1ec8ca+'/'+_0x490794)['json'](_0x5de7fb);}return null;};}function patchUpdates(_0x672767){return function(_0x249c8d){try{jsonpatch[_0xe2da('0x38')](_0x249c8d,_0x672767,!![]);}catch(_0x34f5fe){return BPromise[_0xe2da('0x39')](_0x34f5fe);}return _0x249c8d[_0xe2da('0x3a')]();};}function saveUpdates(_0x121cbf,_0x7fa46c){return function(_0x28e61a){if(_0x28e61a){return _0x28e61a[_0xe2da('0x3b')](_0x121cbf)[_0xe2da('0x25')](function(_0x2386b8){return _0x2386b8;});}return null;};}function removeEntity(_0x4ef546,_0x19d6c8){return function(_0x3649cd){if(_0x3649cd){return _0x3649cd[_0xe2da('0x3c')]()[_0xe2da('0x25')](function(){_0x4ef546[_0xe2da('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32dddc,_0x8bd0fc){return function(_0x39dae5){if(!_0x39dae5){_0x32dddc['sendStatus'](0x194);}return _0x39dae5;};}function handleError(_0x6d8f39,_0x10b8f5){_0x10b8f5=_0x10b8f5||0x1f4;return function(_0x262bf8){logger['error'](_0x262bf8['stack']);if(_0x262bf8[_0xe2da('0x3d')]){delete _0x262bf8[_0xe2da('0x3d')];}_0x6d8f39['status'](_0x10b8f5)[_0xe2da('0x3e')](_0x262bf8);};}exports[_0xe2da('0x3f')]=function(_0x3aefe2,_0x256a0c){var _0x3a6ca3={},_0x4ddac0={},_0x413ea7={'count':0x0,'rows':[]};var _0x4f5433=db['ChatInteraction'][_0xe2da('0x40')];_0x4ddac0['model']=_[_0xe2da('0x41')](_0x4f5433);_0x4ddac0[_0xe2da('0x42')]=_['keys'](_0x3aefe2[_0xe2da('0x42')]);_0x4ddac0[_0xe2da('0x43')]=_['intersection'](_0x4ddac0['model'],_0x4ddac0['query']);_0x3a6ca3[_0xe2da('0x44')]=_[_0xe2da('0x45')](_0x4ddac0[_0xe2da('0x46')],qs[_0xe2da('0x47')](_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x47')]));_0x3a6ca3[_0xe2da('0x44')]=_0x3a6ca3['attributes'][_0xe2da('0x48')]?_0x3a6ca3[_0xe2da('0x44')]:_0x4ddac0[_0xe2da('0x46')];if(!_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x49')]('nolimit')){_0x3a6ca3[_0xe2da('0x36')]=qs[_0xe2da('0x36')](_0x3aefe2[_0xe2da('0x42')]['limit']);_0x3a6ca3[_0xe2da('0x35')]=qs[_0xe2da('0x35')](_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x35')]);}_0x3a6ca3[_0xe2da('0x4a')]=qs[_0xe2da('0x4b')](_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x4b')]);_0x3a6ca3['where']=qs[_0xe2da('0x43')](_[_0xe2da('0x4c')](_0x3aefe2[_0xe2da('0x42')],_0x4ddac0[_0xe2da('0x43')]));var _0x3457d0=[];var _0x4c9a54=squel[_0xe2da('0x4d')]()[_0xe2da('0x4e')]('id')[_0xe2da('0x4e')](_0xe2da('0x3d'))[_0xe2da('0x4e')](_0xe2da('0x4f'))[_0xe2da('0x50')]('tools_tags');var _0x3e160c=squel['select']()[_0xe2da('0x4e')](_0xe2da('0x51'))[_0xe2da('0x50')]('chat_messages','me')[_0xe2da('0x52')](_0xe2da('0x53'))['where'](_0xe2da('0x54'))[_0xe2da('0x52')](_0xe2da('0x55'));var _0x55ae08=squel[_0xe2da('0x4d')]()['field']('u.id')[_0xe2da('0x4e')]('ui.ChatInteractionId')[_0xe2da('0x50')](_0xe2da('0x56'),'ui')['left_join'](_0xe2da('0x57'),'u',_0xe2da('0x58'));var _0x482547=squel['select']()[_0xe2da('0x50')]('chat_interactions','i')[_0xe2da('0x59')](_0xe2da('0x56'),'ui',_0xe2da('0x5a'))[_0xe2da('0x59')](_0xe2da('0x57'),'u',_0xe2da('0x58'))[_0xe2da('0x59')](_0xe2da('0x5b'),'c',_0xe2da('0x5c'))['left_join'](_0xe2da('0x57'),'o',_0xe2da('0x5d'))[_0xe2da('0x59')]('chat_websites','a',_0xe2da('0x5e'))[_0xe2da('0x59')](_0xe2da('0x5f'),'me',_0xe2da('0x53'));var _0x242049=squel[_0xe2da('0x60')]();if(_0x3aefe2[_0xe2da('0x42')]['advancedFilter']){var _0x283fb4=JSON[_0xe2da('0x61')](_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x62')]);_['keys'](_0x283fb4)['forEach'](function(_0x41d2ca){var _0x4a8dc9=_0x283fb4[_0x41d2ca];if(_0x41d2ca===_0xe2da('0x63')){var _0x153749=moment(_0x4a8dc9[_0xe2da('0x64')][_0xe2da('0x65')])[_0xe2da('0x66')](_0xe2da('0x67'))[_0xe2da('0x68')]()[_0xe2da('0x69')]();var _0x21a19e=moment(_0x21a19e)['utc']()[_0xe2da('0x6a')](_0xe2da('0x67'))[_0xe2da('0x69')]();_0x242049[_0xe2da('0x6b')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x153749,_0x21a19e);}else{if(_[_0xe2da('0x6c')](_0x4a8dc9[_0xe2da('0x6d')])){_0x4a8dc9[_0xe2da('0x6d')]['forEach'](function(_0x394511){switch(_0x4a8dc9[_0xe2da('0x6d')][_0xe2da('0x64')]){case'IS':if(_0x41d2ca!==_0xe2da('0x6e')&&_0x41d2ca!==_0xe2da('0x6f')){if(_[_0xe2da('0x6c')](_0x4a8dc9[_0xe2da('0x64')])&&_0x4a8dc9[_0xe2da('0x64')][_0xe2da('0x48')]>0x1){_0x242049[_0xe2da('0x6b')](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+_0xe2da('0x71'),_0x4a8dc9['value']);}else{_0x242049[_0xe2da('0x6b')](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+_0xe2da('0x72'),_0x4a8dc9[_0xe2da('0x64')][0x0]);}}break;case'=':_0x242049[_0xe2da('0x6b')](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+_0xe2da('0x72'),_0x4a8dc9['value']);break;case _0xe2da('0x73'):if(_0x41d2ca==='ContactId'){_0x242049[_0xe2da('0x6b')](_0xe2da('0x74')+'\x20LIKE\x20?','%'+_0x4a8dc9['value']+'%');_0x242049['or'](_0xe2da('0x75')+'\x20LIKE\x20?','%'+_0x4a8dc9[_0xe2da('0x64')]+'%');_0x242049['or']('c.email'+_0xe2da('0x76'),'%'+_0x4a8dc9[_0xe2da('0x64')]+'%');}else{_0x242049[_0xe2da('0x6b')](_0x4a8dc9['tableAlias']+'.'+_0x41d2ca+'\x20LIKE\x20?','%'+_0x4a8dc9['value']+'%');}break;case'>':_0x242049[_0xe2da('0x6b')](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+_0xe2da('0x77'),_0x4a8dc9[_0xe2da('0x64')]);break;case'<':_0x242049['and'](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+_0xe2da('0x78'),_0x4a8dc9[_0xe2da('0x64')]);break;}});}else{switch(_0x4a8dc9[_0xe2da('0x6d')][_0xe2da('0x64')]){case'IS':if(_0x41d2ca!==_0xe2da('0x6e')&&_0x41d2ca!==_0xe2da('0x6f')){if(_['isArray'](_0x4a8dc9[_0xe2da('0x64')])&&_0x4a8dc9[_0xe2da('0x64')][_0xe2da('0x48')]>0x1){_0x242049[_0xe2da('0x6b')](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+'\x20IN\x20?',_0x4a8dc9[_0xe2da('0x64')]);}else{_0x242049['and'](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+'\x20=\x20?',_0x4a8dc9[_0xe2da('0x64')][0x0]);}}break;case'=':_0x242049['and'](_0x4a8dc9['tableAlias']+'.'+_0x41d2ca+_0xe2da('0x72'),_0x4a8dc9[_0xe2da('0x64')]);break;case _0xe2da('0x73'):if(_0x41d2ca===_0xe2da('0x79')){_0x242049[_0xe2da('0x6b')](_0xe2da('0x74')+_0xe2da('0x76'),'%'+_0x4a8dc9[_0xe2da('0x64')]+'%');_0x242049['or'](_0xe2da('0x75')+_0xe2da('0x76'),'%'+_0x4a8dc9['value']+'%');_0x242049['or'](_0xe2da('0x7a')+_0xe2da('0x76'),'%'+_0x4a8dc9[_0xe2da('0x64')]+'%');}else{_0x242049[_0xe2da('0x6b')](_0x4a8dc9['tableAlias']+'.'+_0x41d2ca+_0xe2da('0x76'),'%'+_0x4a8dc9[_0xe2da('0x64')]+'%');}break;case'>':_0x242049[_0xe2da('0x6b')](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+'\x20>\x20?',_0x4a8dc9[_0xe2da('0x64')]);break;case'<':_0x242049['and'](_0x4a8dc9[_0xe2da('0x70')]+'.'+_0x41d2ca+_0xe2da('0x78'),_0x4a8dc9['value']);break;}}}});}else{var _0x19f06f=_(Object[_0xe2da('0x41')](_0x3aefe2[_0xe2da('0x42')]))[_0xe2da('0x7b')](function(_0x42f865){return _0x4f5433['hasOwnProperty'](_0x42f865)?_0x42f865:undefined;})[_0xe2da('0x7c')](function(_0x53a070){return!_['isNil'](_0x53a070);})['value']();if(!_['isEmpty'](_0x19f06f)){_0x19f06f[_0xe2da('0x7d')](function(_0x7657e8){if(_0x7657e8===_0xe2da('0x7e')){_0x482547[_0xe2da('0x52')](_0xe2da('0x7f'),[][_0xe2da('0x80')](_0x3aefe2[_0xe2da('0x42')][_0x7657e8]));}else if(_0x7657e8===_0xe2da('0x63')){var _0x406782=JSON['parse'](_0x3aefe2[_0xe2da('0x42')][_0x7657e8])[_0xe2da('0x81')];var _0x14377d=JSON[_0xe2da('0x61')](_0x3aefe2[_0xe2da('0x42')][_0x7657e8])[_0xe2da('0x82')];_0x482547[_0xe2da('0x52')](_0xe2da('0x83'),_0x406782,_0x14377d);}else{_0x482547[_0xe2da('0x52')]('i.'+_0x7657e8+_0xe2da('0x72'),_0x3aefe2['query'][_0x7657e8]);}});}if(_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x7c')]){var _0x1bb084=_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x7c')][_0xe2da('0x84')]('\x5c','\x5c\x5c')[_0xe2da('0x84')]('\x27\x27',_0xe2da('0x85'));if(qs[_0xe2da('0x86')](_0x1bb084)){_0x242049['or'](_0xe2da('0x87'),_0x1bb084+'%');}else{var _0x1a9165=[];_0x1bb084[_0xe2da('0x88')]('\x20')['forEach'](function(_0x104332){_0x1a9165['push']('+'+_0x104332[_0xe2da('0x89')]());});var _0x6babeb=_0x1a9165[_0xe2da('0x8a')]('\x20');_0x242049['or'](_0xe2da('0x8b'),_0x6babeb)['or'](_0xe2da('0x8c'),_0x1bb084+'%');}}}_0x482547[_0xe2da('0x52')](_0x242049);if(_0x3a6ca3[_0xe2da('0x4a')]){_0x3a6ca3['order'][_0xe2da('0x7d')](function(_0x727812){_0x482547[_0xe2da('0x4a')]('i.'+_0x727812[0x0],_0x727812[0x1]===_0xe2da('0x8d')?![]:!![]);});}_0x482547[_0xe2da('0x8e')](_0xe2da('0x8f'));var _0x4a9e88={'type':db[_0xe2da('0x90')][_0xe2da('0x91')][_0xe2da('0x92')],'raw':!![]};var _0x96caa5=_0x482547[_0xe2da('0x93')]()[_0xe2da('0x4e')](_0xe2da('0x51'));if(!_0x3aefe2['query'][_0xe2da('0x62')]){if(_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x94')]){if(_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x94')]==0x1){_0x96caa5[_0xe2da('0x52')](util['format'](_0xe2da('0x95'),_0x3e160c['toString']()));_0x482547['having'](_0xe2da('0x96'));}else{_0x96caa5[_0xe2da('0x52')](util[_0xe2da('0x69')]('%s\x20>\x200',_0x3e160c[_0xe2da('0x89')]()));_0x482547[_0xe2da('0x97')](_0xe2da('0x98'));}}if(_0x3aefe2[_0xe2da('0x42')]['tag']){var _0x500f8b=_['isArray'](_0x3aefe2['query'][_0xe2da('0x99')])?_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x99')]:new Array(_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x99')]);var _0x42210e=squel['expr']();_0x500f8b[_0xe2da('0x7d')](function(_0x2c057a){_0x42210e['or'](_0xe2da('0x9a'),'%,'+_0x2c057a+',%');});_0x482547['having'](_0x42210e);_0x96caa5[_0xe2da('0x59')](_0xe2da('0x9b'),'it',_0xe2da('0x9c'));_0x96caa5['left_join'](_0xe2da('0x9d'),'t',_0xe2da('0x9e'));_0x96caa5[_0xe2da('0x52')](_0xe2da('0x9f'),_0x500f8b);}}else{var _0x283fb4=JSON['parse'](_0x3aefe2[_0xe2da('0x42')][_0xe2da('0x62')]);_[_0xe2da('0x41')](_0x283fb4)[_0xe2da('0x7d')](function(_0xfecbd){var _0x3f6082=_0x283fb4[_0xfecbd];if(_0xfecbd===_0xe2da('0x6e')){var _0x10d3ed=_0x3f6082[_0xe2da('0x64')];var _0x5e6c49=squel[_0xe2da('0x60')]();_0x10d3ed[_0xe2da('0x7d')](function(_0x53d3c3){_0x5e6c49['or'](_0xe2da('0x9a'),'%,'+_0x53d3c3+',%');});_0x482547['having'](_0x5e6c49);_0x96caa5['left_join']('mail_interaction_has_tags','it',_0xe2da('0xa0'));_0x96caa5[_0xe2da('0x59')]('tools_tags','t',_0xe2da('0x9e'));_0x96caa5['where'](_0xe2da('0x9f'),_0x10d3ed);}else if(_0xfecbd===_0xe2da('0x6f')){if(_0x3f6082[_0xe2da('0x64')][_0xe2da('0x48')]===0x1){if(_0x3f6082[_0xe2da('0x64')][0x0]===0x1){_0x96caa5[_0xe2da('0x52')](util[_0xe2da('0x69')]('%s\x20=\x200',_0x3e160c['toString']()));_0x482547[_0xe2da('0x97')](_0xe2da('0x96'));}else{_0x96caa5[_0xe2da('0x52')](util[_0xe2da('0x69')]('%s\x20>\x200',_0x3e160c[_0xe2da('0x89')]()));_0x482547['having'](_0xe2da('0x98'));}}}});}db[_0xe2da('0xa1')][_0xe2da('0x42')](_0x96caa5[_0xe2da('0x89')](),_0x4a9e88)[_0xe2da('0x25')](function(_0x414fa3){_0x413ea7['count']=_0x414fa3[_0xe2da('0x48')];if(_0x413ea7[_0xe2da('0x34')]===0x0)return[];return db[_0xe2da('0xa1')][_0xe2da('0x42')](_0x4c9a54[_0xe2da('0x89')](),_0x4a9e88)[_0xe2da('0x25')](function(_0x11f227){_0x3457d0=_[_0xe2da('0xa2')](_0x11f227,'id');_0x4a9e88=_['merge'](_0x4a9e88,{'model':db[_0xe2da('0xa3')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x482547['field'](_0x3e160c,_0xe2da('0x6f'));_0x482547[_0xe2da('0x4e')]('a.key','Account.key');_0x482547[_0xe2da('0x4e')]('i.*');_0x482547[_0xe2da('0x4e')](_0xe2da('0x74'),_0xe2da('0xa4'));_0x482547['field'](_0xe2da('0x75'),'Contact.lastName');_0x482547['field'](_0xe2da('0x7a'),_0xe2da('0xa5'));_0x482547['field'](_0xe2da('0xa6'),'Contact.phone');_0x482547[_0xe2da('0x4e')](_0xe2da('0xa7'),_0xe2da('0xa8'));_0x482547[_0xe2da('0x4e')](_0xe2da('0xa9'),'Contact.fax');_0x482547[_0xe2da('0x4e')](_0xe2da('0xaa'),_0xe2da('0xab'));_0x482547['field'](_0xe2da('0xac'),_0xe2da('0xad'));_0x482547[_0xe2da('0x59')](_0xe2da('0x9b'),'it',_0xe2da('0x9c'));_0x482547[_0xe2da('0x59')](_0xe2da('0x9d'),'t',_0xe2da('0x9e'));_0x482547['limit'](_0x3a6ca3['limit']);_0x482547[_0xe2da('0x35')](_0x3a6ca3['offset']);return db[_0xe2da('0xa1')][_0xe2da('0x42')](_0x482547[_0xe2da('0x89')](),_0x4a9e88);})[_0xe2da('0x25')](function(_0x2bbe54){_0x55ae08[_0xe2da('0x52')](_0xe2da('0xae'),_['map'](_0x2bbe54,'id'));return db[_0xe2da('0xa1')]['query'](_0x55ae08[_0xe2da('0x89')](),_0x4a9e88)['then'](function(_0x4800fd){var _0x45dbb3=_[_0xe2da('0xaf')](_0x4800fd,_0xe2da('0xb0'));_0x2bbe54[_0xe2da('0x7d')](function(_0x13b0f0){if(_0x45dbb3[_0x13b0f0['id']]){_0x13b0f0[_0xe2da('0xb1')]=_[_0xe2da('0x7b')](_0x45dbb3[_0x13b0f0['id']],function(_0x52f25b){return{'id':_0x52f25b['id']};});}if(_0x13b0f0[_0xe2da('0xad')]){_0x13b0f0[_0xe2da('0xb2')]=[];_0x13b0f0[_0xe2da('0xad')]['split'](',')[_0xe2da('0x7d')](function(_0x4852f7){_0x13b0f0['Tags'][_0xe2da('0xb3')](_0x3457d0[_0x4852f7]);});}delete _0x13b0f0[_0xe2da('0xad')];});return _0x2bbe54;});});})['then'](function(_0x51a4f5){_0x413ea7[_0xe2da('0xb4')]=_0x51a4f5;return _0x413ea7;})['then'](respondWithFilteredResult(_0x256a0c,_0x3a6ca3))[_0xe2da('0x2f')](handleError(_0x256a0c,null));};exports[_0xe2da('0xb5')]=function(_0x3cca50,_0x2b7b18){var _0x2b399e={'raw':![],'where':{'id':_0x3cca50['params']['id']}},_0x26982d={};_0x26982d[_0xe2da('0x46')]=_[_0xe2da('0x41')](db[_0xe2da('0xa3')][_0xe2da('0x40')]);_0x26982d[_0xe2da('0x42')]=_[_0xe2da('0x41')](_0x3cca50['query']);_0x26982d[_0xe2da('0x43')]=_[_0xe2da('0x45')](_0x26982d[_0xe2da('0x46')],_0x26982d['query']);_0x2b399e[_0xe2da('0x44')]=_[_0xe2da('0x45')](_0x26982d[_0xe2da('0x46')],qs[_0xe2da('0x47')](_0x3cca50[_0xe2da('0x42')][_0xe2da('0x47')]));_0x2b399e['attributes']=_0x2b399e['attributes'][_0xe2da('0x48')]?_0x2b399e[_0xe2da('0x44')]:_0x26982d['model'];if(_0x3cca50['query'][_0xe2da('0xb6')]){_0x2b399e['include']=[{'all':!![]}];}_0x2b399e=_[_0xe2da('0xb7')]({},_0x2b399e,_0x3cca50[_0xe2da('0xb8')]);return db['ChatInteraction'][_0xe2da('0xb9')](_0x2b399e)[_0xe2da('0x25')](handleEntityNotFound(_0x2b7b18,null))[_0xe2da('0x25')](respondWithResult(_0x2b7b18,null))[_0xe2da('0x2f')](handleError(_0x2b7b18,null));};exports[_0xe2da('0xba')]=function(_0x18f79a,_0x5bc403){return db[_0xe2da('0xa3')]['create'](_0x18f79a[_0xe2da('0xbb')],{})[_0xe2da('0x25')](respondWithResult(_0x5bc403,0xc9))[_0xe2da('0x2f')](handleError(_0x5bc403,null));};exports['update']=function(_0x39ef54,_0x48b927){if(_0x39ef54[_0xe2da('0xbb')]['id']){delete _0x39ef54['body']['id'];}return db['ChatInteraction'][_0xe2da('0xb9')]({'where':{'id':_0x39ef54['params']['id']}})[_0xe2da('0x25')](handleEntityNotFound(_0x48b927,null))[_0xe2da('0x25')](saveUpdates(_0x39ef54[_0xe2da('0xbb')],null))[_0xe2da('0x25')](respondWithResult(_0x48b927,null))[_0xe2da('0x2f')](handleError(_0x48b927,null));};exports[_0xe2da('0x3c')]=function(_0x2870aa,_0x593a09){return db['ChatInteraction'][_0xe2da('0xb9')]({'where':{'id':_0x2870aa[_0xe2da('0xbc')]['id']}})[_0xe2da('0x25')](handleEntityNotFound(_0x593a09,null))[_0xe2da('0x25')](removeEntity(_0x593a09,null))[_0xe2da('0x2f')](handleError(_0x593a09,null));};exports[_0xe2da('0xbd')]=function(_0x59bf32,_0x4bba1e){return db[_0xe2da('0xa3')][_0xe2da('0xbd')]()[_0xe2da('0x25')](respondWithResult(_0x4bba1e,null))['catch'](handleError(_0x4bba1e,null));};exports[_0xe2da('0xbe')]=function(_0x122b47,_0x1887ba){if(_0x122b47[_0xe2da('0xbb')]['id']){delete _0x122b47['body']['id'];}return db[_0xe2da('0xa3')]['find']({'where':{'id':_0x122b47['params']['id']}})[_0xe2da('0x25')](handleEntityNotFound(_0x1887ba,null))['then'](saveUpdates(_0x122b47['body'],null))[_0xe2da('0x25')](respondWithResult(_0x1887ba,null))[_0xe2da('0x2f')](handleError(_0x1887ba,null));};exports[_0xe2da('0xbf')]=function(_0x316c03,_0x4be1fe,_0x1d71c6){if(_0x316c03['body']['id']){delete _0x316c03['body']['id'];}return db['ChatInteraction'][_0xe2da('0xb9')]({'where':{'id':_0x316c03[_0xe2da('0xbc')]['id']}})['then'](function(_0xc7be7){if(!_0xc7be7){logger[_0xe2da('0x2c')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xe2da('0xbf'),0x194,_0xe2da('0xc0'));_0x4be1fe['sendStatus'](0x194);}else{if(_0xc7be7[_0xe2da('0xc1')]){throw new db['Sequelize'][(_0xe2da('0xc2'))](_0xe2da('0xc3'));}}return _0xc7be7;})['then'](function(_0x50ff2c){if(_0x50ff2c){return _0x50ff2c[_0xe2da('0x3b')]({'closed':_0x316c03[_0xe2da('0xbb')][_0xe2da('0xc4')],'disposition':_0x316c03['body']['disposition']})['then'](function(_0x4dfeba){return _0x4dfeba;});}})[_0xe2da('0x25')](function(_0x3fc83f){return respondWithRpcPromise(_0xe2da('0xc5'),_0xe2da('0xbf'),_0x316c03[_0xe2da('0xbb')],client9004);})[_0xe2da('0x25')](respondWithResult(_0x4be1fe,null))[_0xe2da('0x2f')](handleError(_0x4be1fe,null));};exports[_0xe2da('0xc6')]=function(_0x3073a9,_0x37f445,_0x56e103){_0x3073a9[_0xe2da('0xbb')]['name']=_0x3073a9[_0xe2da('0xc7')][_0xe2da('0xc8')];_0x3073a9['body'][_0xe2da('0xc9')]=_0x3073a9[_0xe2da('0xc7')][_0xe2da('0xca')];_0x3073a9[_0xe2da('0xbb')]['type']=_0x3073a9[_0xe2da('0xc7')][_0xe2da('0xcb')];return db[_0xe2da('0xcc')][_0xe2da('0xba')](_0x3073a9[_0xe2da('0xbb')])[_0xe2da('0x25')](respondWithResult(_0x37f445,0xc9))[_0xe2da('0x2f')](handleError(_0x37f445,null));};exports[_0xe2da('0xcd')]=function(_0x40a9bb,_0x106673,_0x3f8a80){return db[_0xe2da('0xa3')]['findOne']({'where':{'id':_0x40a9bb[_0xe2da('0xbc')]['id']},'raw':!![]})[_0xe2da('0x25')](handleEntityNotFound(_0x106673,null))[_0xe2da('0x25')](function(_0x5461ef){if(_0x5461ef){if(_0x5461ef[_0xe2da('0xc4')]){return _0x106673[_0xe2da('0x31')](0x193)[_0xe2da('0x33')]({'status':0x193,'message':_0xe2da('0xce')});}return db[_0xe2da('0xcc')][_0xe2da('0xcf')]({'where':{'id':_0x40a9bb['query'][_0xe2da('0xd0')]},'raw':!![]})[_0xe2da('0x25')](handleEntityNotFound(_0x106673,null));}})[_0xe2da('0x25')](function(_0x3a19ab){if(_0x3a19ab){return _0x106673[_0xe2da('0xd1')](path['join'](config['root'],_0xe2da('0xd2'),_0x3a19ab[_0xe2da('0xc9')]));}})['catch'](handleError(_0x106673,null));};exports[_0xe2da('0xd3')]=function(_0x21c008,_0xc5c6ce){var _0x2ad41e=null;var _0x300d19=null;var _0x5af48a=null;var _0x3320d4=null;if(_0x21c008[_0xe2da('0xbb')]['id']){delete _0x21c008['body']['id'];}if(_0x21c008['body']['mailTranscript']){_0x3320d4=path[_0xe2da('0x8a')](config['root'],'server/files/chat/upload/',util['format'](_0xe2da('0xd4'),Date['now']()));_0x21c008[_0xe2da('0xbb')][_0xe2da('0xd5')]=_0x3320d4;}return db[_0xe2da('0xa3')][_0xe2da('0xb9')]({'where':{'id':_0x21c008['params']['id']},'include':[{'model':db[_0xe2da('0xd6')],'as':_0xe2da('0xd7'),'include':[{'model':db[_0xe2da('0xd8')],'as':_0xe2da('0xd8')}]}]})[_0xe2da('0x25')](handleEntityNotFound(_0xc5c6ce,null))[_0xe2da('0x25')](saveUpdates(_0x21c008[_0xe2da('0xbb')],null))[_0xe2da('0x25')](function(_0xa4188){if(_0xa4188){_0x2ad41e=_0xa4188;return db[_0xe2da('0xd9')][_0xe2da('0xb9')]({'where':{'id':_0x2ad41e[_0xe2da('0x7e')]}});}})[_0xe2da('0x25')](function(_0x2ccb86){if(_0x2ccb86){_0x5af48a=_0x2ccb86;return db['CmContact'][_0xe2da('0xb9')]({'where':{'id':_0x2ad41e['ContactId']}});}})[_0xe2da('0x25')](function(_0x410935){if(_0x410935){_0x300d19=_0x410935;if(_0x3320d4){var _0x20a584=null;for(var _0x50ccaf=0x1;_0x50ccaf<_0x2ad41e[_0xe2da('0xd7')][_0xe2da('0x48')];++_0x50ccaf){_0x20a584=_0x2ad41e[_0xe2da('0xd7')][_0x50ccaf];var _0x165734=_0x20a584[_0xe2da('0xc1')]?util[_0xe2da('0x69')]('%s%d',_0x5af48a[_0xe2da('0xda')],_0x20a584[_0xe2da('0xc1')]):_0xe2da('0xdb');var _0xf0f0cf=_0x21c008[_0xe2da('0xbb')][_0xe2da('0xdc')]||util['format'](_0xe2da('0xdd'),_0xe2da('0xde'),_0x20a584[_0xe2da('0x79')]);switch(_0x5af48a['agentIdentifier']){case _0xe2da('0xdf'):_0x165734=_0x20a584['UserId']?util[_0xe2da('0x69')](_0xe2da('0xdd'),_0x5af48a[_0xe2da('0xda')],_0x20a584[_0xe2da('0xc1')]):_0xe2da('0xdb');break;case'agent_alias':_0x165734=_0x20a584[_0xe2da('0xc1')]?_0x20a584[_0xe2da('0xd8')][_0xe2da('0xe0')]||_0x20a584[_0xe2da('0xd8')]['fullname']:_0xe2da('0xdb');break;case _0xe2da('0xe1'):_0x165734=_0x20a584['UserId']?_0x20a584[_0xe2da('0xd8')][_0xe2da('0xe2')]:_0xe2da('0xdb');break;default:_0x165734=_0x20a584[_0xe2da('0xc1')]?util[_0xe2da('0x69')](_0xe2da('0xdd'),_0x5af48a['agentAlias'],_0x20a584[_0xe2da('0xc1')]):_0xe2da('0xdb');}var _0x5525c3=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x20a584['createdAt'])['format'](_0xe2da('0xe3')),_0x20a584[_0xe2da('0xe4')]==='in'?_0xf0f0cf:_0x165734,_0x20a584['body']);if(!_0x20a584[_0xe2da('0xe5')]){fs[_0xe2da('0xe6')](_0x3320d4,_0x5525c3);}}return db[_0xe2da('0xe7')][_0xe2da('0xcf')]({'where':{'service':!![]},'include':[{'model':db[_0xe2da('0xe8')],'as':_0xe2da('0xe9'),'raw':!![]}]});}}})[_0xe2da('0x25')](function(_0x5431f0){if(_0x5431f0&&_0x5431f0[_0xe2da('0xe9')]&&_0x21c008[_0xe2da('0xbb')]){var _0x444636={'tls':{'rejectUnauthorized':![]}};if(_0x5431f0[_0xe2da('0xe9')][_0xe2da('0xea')]){_0x444636[_0xe2da('0xea')]=_0x5431f0[_0xe2da('0xe9')]['service'];}else{_0x444636['host']=_0x5431f0[_0xe2da('0xe9')][_0xe2da('0xeb')];_0x444636['port']=_0x5431f0[_0xe2da('0xe9')]['port'];_0x444636[_0xe2da('0xec')]=_0x5431f0[_0xe2da('0xe9')][_0xe2da('0xec')];}if(_0x5431f0[_0xe2da('0xe9')]['authentication']){_0x444636[_0xe2da('0xed')]={'user':_0x5431f0[_0xe2da('0xe9')][_0xe2da('0xee')],'pass':_0x5431f0[_0xe2da('0xe9')][_0xe2da('0xef')]};}return respondWithRpcPromise(_0xe2da('0xf0'),_0xe2da('0xf1'),{'account':_0x444636,'message':{'from':util[_0xe2da('0x69')](_0xe2da('0xf2'),_0x5431f0[_0xe2da('0x3d')],_0x5431f0[_0xe2da('0xf3')]||_0x5431f0[_0xe2da('0xe9')][_0xe2da('0xee')]),'to':_0x21c008['body']['mailTranscript'],'subject':_0xe2da('0xf4'),'text':util[_0xe2da('0x69')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x21c008[_0xe2da('0xbb')][_0xe2da('0xf5')]),'attachments':[{'path':_0x3320d4}]}})[_0xe2da('0x25')](function(){return _0x2ad41e;})[_0xe2da('0x2f')](function(_0x16d77e){console['error'](_0x16d77e);});}else{return _0x2ad41e;}})[_0xe2da('0x25')](respondWithStatusCode(_0xc5c6ce,0xc8))[_0xe2da('0x2f')](handleError(_0xc5c6ce,null));};exports[_0xe2da('0xf6')]=function(_0x2fe6ca,_0x37f843,_0x2f4bf0){return db[_0xe2da('0xd6')][_0xe2da('0xb9')]({'where':{'id':_0x2fe6ca['params']['id']}})['then'](handleEntityNotFound(_0x37f843,null))[_0xe2da('0x25')](function(_0x226b98){if(_0x226b98){return _0x226b98[_0xe2da('0xf6')](_0x2fe6ca[_0xe2da('0xbb')]['ids'],_[_0xe2da('0xf7')](_0x2fe6ca[_0xe2da('0xbb')],['ids','id'])||{});}})[_0xe2da('0x25')](respondWithResult(_0x37f843,null))[_0xe2da('0x2f')](handleError(_0x37f843,null));};exports[_0xe2da('0xf8')]=function(_0x317953,_0x20e0ff,_0x4a12e4){var _0x3828e3={'raw':![],'where':{}};var _0x9b93ca={};var _0x3bad83={'count':0x0,'rows':[]};return db[_0xe2da('0xa3')]['findOne']({'where':{'id':_0x317953[_0xe2da('0xbc')]['id']}})[_0xe2da('0x25')](handleEntityNotFound(_0x20e0ff,null))[_0xe2da('0x25')](function(_0x4c010d){if(_0x4c010d){_0x9b93ca['model']=_[_0xe2da('0x41')](db[_0xe2da('0xd6')][_0xe2da('0x40')]);_0x9b93ca[_0xe2da('0x42')]=_['keys'](_0x317953[_0xe2da('0x42')]);_0x9b93ca[_0xe2da('0x43')]=_[_0xe2da('0x45')](_0x9b93ca[_0xe2da('0x46')],_0x9b93ca[_0xe2da('0x42')]);_0x3828e3[_0xe2da('0x44')]=_[_0xe2da('0x45')](_0x9b93ca[_0xe2da('0x46')],qs['fields'](_0x317953[_0xe2da('0x42')][_0xe2da('0x47')]));_0x3828e3[_0xe2da('0x44')]=_0x3828e3[_0xe2da('0x44')]['length']?_0x3828e3[_0xe2da('0x44')]:_0x9b93ca[_0xe2da('0x46')];if(!_0x317953[_0xe2da('0x42')][_0xe2da('0x49')](_0xe2da('0xf9'))){_0x3828e3[_0xe2da('0x36')]=qs[_0xe2da('0x36')](_0x317953[_0xe2da('0x42')][_0xe2da('0x36')]);_0x3828e3[_0xe2da('0x35')]=qs['offset'](_0x317953[_0xe2da('0x42')][_0xe2da('0x35')]);}_0x3828e3['order']=qs[_0xe2da('0x4b')](_0x317953[_0xe2da('0x42')][_0xe2da('0x4b')]);_0x3828e3[_0xe2da('0x52')]=qs[_0xe2da('0x43')](_[_0xe2da('0x4c')](_0x317953[_0xe2da('0x42')],_0x9b93ca[_0xe2da('0x43')]));_0x3828e3[_0xe2da('0x52')][_0xe2da('0xb0')]=_0x4c010d['id'];if(_0x317953[_0xe2da('0x42')][_0xe2da('0x7c')]){_0x3828e3[_0xe2da('0x52')]=_[_0xe2da('0xb7')](_0x3828e3[_0xe2da('0x52')],{'$or':_[_0xe2da('0x7b')](_0x3828e3[_0xe2da('0x44')],function(_0x40215e){var _0xd4d029={};_0xd4d029[_0x40215e]={'$like':'%'+_0x317953[_0xe2da('0x42')][_0xe2da('0x7c')]+'%'};return _0xd4d029;})});}if(_0x317953[_0xe2da('0x42')][_0xe2da('0x81')]){var _0x3f780b=_0x317953[_0xe2da('0x42')]['$gte'][_0xe2da('0x88')](',');var _0x13f188={};_0x13f188[_0x3f780b[0x0]]={'$gte':moment(_0x3f780b[0x1])[_0xe2da('0x69')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3828e3[_0xe2da('0x52')]=_[_0xe2da('0xb7')](_0x3828e3[_0xe2da('0x52')],_0x13f188);}_0x3828e3=_[_0xe2da('0xb7')]({},_0x3828e3,_0x317953[_0xe2da('0xb8')]);return db[_0xe2da('0xd6')][_0xe2da('0x34')]({'where':_0x3828e3[_0xe2da('0x52')]})['then'](function(_0x43922d){_0x3bad83['count']=_0x43922d;if(_0x317953['query'][_0xe2da('0xb6')]){_0x3828e3['include']=[{'all':!![]}];}return db[_0xe2da('0xd6')][_0xe2da('0xfa')](_0x3828e3);})[_0xe2da('0x25')](function(_0x4248aa){_0x3bad83['rows']=_0x4248aa;return _0x3bad83;});}})['then'](respondWithFilteredResult(_0x20e0ff,_0x3828e3))[_0xe2da('0x2f')](handleError(_0x20e0ff,null));};exports[_0xe2da('0xfb')]=function(_0x140b27,_0x27e26c,_0x42190c){var _0xb8f630={'where':{}},_0x32d9f0={},_0x16bd8f={'count':0x0,'rows':[]};return db[_0xe2da('0xa3')][_0xe2da('0xcf')]({'where':{'id':_0x140b27[_0xe2da('0xbc')]['id']}})[_0xe2da('0x25')](handleEntityNotFound(_0x27e26c,null))[_0xe2da('0x25')](function(_0x5ad48c){if(_0x5ad48c){_0x32d9f0[_0xe2da('0x46')]=_[_0xe2da('0x41')](db[_0xe2da('0xd6')][_0xe2da('0x40')]);_0x32d9f0[_0xe2da('0x42')]=_[_0xe2da('0x41')](_0x140b27[_0xe2da('0x42')]);_0x32d9f0[_0xe2da('0x43')]=_[_0xe2da('0x45')](_0x32d9f0[_0xe2da('0x46')],_0x32d9f0[_0xe2da('0x42')]);_0xb8f630[_0xe2da('0x44')]=_[_0xe2da('0x45')](_0x32d9f0['model'],qs['fields'](_0x140b27[_0xe2da('0x42')][_0xe2da('0x47')]));_0xb8f630[_0xe2da('0x44')]=_0xb8f630['attributes']['length']?_0xb8f630[_0xe2da('0x44')]:_0x32d9f0['model'];if(!_0x140b27[_0xe2da('0x42')]['hasOwnProperty'](_0xe2da('0xf9'))){_0xb8f630[_0xe2da('0x36')]=qs[_0xe2da('0x36')](_0x140b27[_0xe2da('0x42')][_0xe2da('0x36')]);_0xb8f630[_0xe2da('0x35')]=qs[_0xe2da('0x35')](_0x140b27[_0xe2da('0x42')][_0xe2da('0x35')]);}_0xb8f630['order']=qs[_0xe2da('0x4b')](_0x140b27[_0xe2da('0x42')][_0xe2da('0x4b')]);_0xb8f630[_0xe2da('0x52')]=qs[_0xe2da('0x43')](_['pick'](_0x140b27['query'],_0x32d9f0['filters']));_0xb8f630[_0xe2da('0x52')][_0xe2da('0xb0')]=_0x5ad48c['id'];if(_0x140b27[_0xe2da('0x42')]['filter']){_0xb8f630[_0xe2da('0x52')]=_[_0xe2da('0xb7')](_0xb8f630[_0xe2da('0x52')],{'$or':_[_0xe2da('0x7b')](_0xb8f630[_0xe2da('0x44')],function(_0x3ac749){var _0x2cfe3f={};_0x2cfe3f[_0x3ac749]={'$like':'%'+_0x140b27[_0xe2da('0x42')][_0xe2da('0x7c')]+'%'};return _0x2cfe3f;})});}_0xb8f630[_0xe2da('0x52')][_0xe2da('0xe5')]=![];if(_0x140b27[_0xe2da('0x42')]['id']){_0xb8f630['where']['id']={'$gt':_0x140b27[_0xe2da('0x42')]['id']};}_0xb8f630=_[_0xe2da('0xb7')]({},_0xb8f630,_0x140b27['options']);return db[_0xe2da('0xd6')][_0xe2da('0x34')]({'where':_0xb8f630[_0xe2da('0x52')]})[_0xe2da('0x25')](function(_0x2c817a){_0x16bd8f[_0xe2da('0x34')]=_0x2c817a;_0xb8f630[_0xe2da('0xfc')]=[];if(_0x140b27[_0xe2da('0x42')]['includeAgent']){_0xb8f630[_0xe2da('0xfc')]['push']({'model':db[_0xe2da('0xd8')],'as':'User','attributes':['id','fullname','alias']});}if(_0x140b27[_0xe2da('0x42')][_0xe2da('0xb6')]){_0xb8f630[_0xe2da('0xfc')]=[{'all':!![]}];}return db['ChatMessage'][_0xe2da('0xfa')](_0xb8f630);})[_0xe2da('0x25')](function(_0x1d7ee0){_0x16bd8f[_0xe2da('0xb4')]=_0x1d7ee0;return _0x16bd8f;});}})[_0xe2da('0x25')](respondWithFilteredResult(_0x27e26c,_0xb8f630))[_0xe2da('0x2f')](handleError(_0x27e26c,null));};exports[_0xe2da('0xfd')]=function(_0x1a075e,_0x4d3fff,_0x1de65f){return db[_0xe2da('0xa3')][_0xe2da('0xb9')]({'where':{'id':_0x1a075e['params']['id']}})[_0xe2da('0x25')](handleEntityNotFound(_0x4d3fff,null))[_0xe2da('0x25')](function(_0x21e23b){if(_0x21e23b){return _0x21e23b['setTags'](_0x1a075e[_0xe2da('0xbb')][_0xe2da('0xfe')],_[_0xe2da('0xf7')](_0x1a075e[_0xe2da('0xbb')],['ids','id'])||{})[_0xe2da('0xff')](function(){return db[_0xe2da('0x100')][_0xe2da('0xfa')]({'attributes':['id','name','color'],'where':{'id':_0x1a075e['body'][_0xe2da('0xfe')]}});})[_0xe2da('0x25')](function(_0x2dc146){socket[_0xe2da('0x101')](_0xe2da('0x102'),{'id':Number(_0x1a075e[_0xe2da('0xbc')]['id']),'tags':_0x2dc146||[]});return{'id':Number(_0x1a075e[_0xe2da('0xbc')]['id']),'tags':_0x2dc146||[]};});}})[_0xe2da('0x25')](respondWithResult(_0x4d3fff,null))[_0xe2da('0x2f')](handleError(_0x4d3fff,null));};exports['removeTags']=function(_0x210cc5,_0xb06cc6,_0x440d8b){return db['ChatInteraction'][_0xe2da('0xb9')]({'where':{'id':_0x210cc5[_0xe2da('0xbc')]['id']}})['then'](handleEntityNotFound(_0xb06cc6,null))[_0xe2da('0x25')](function(_0x597145){if(_0x597145){return _0x597145[_0xe2da('0x103')](_0x210cc5[_0xe2da('0x42')][_0xe2da('0xfe')]);}})[_0xe2da('0x25')](respondWithStatusCode(_0xb06cc6,null))['catch'](handleError(_0xb06cc6,null));};exports[_0xe2da('0xd1')]=function(_0xc9bf5d,_0x386bb0){var _0x195c9e=moment()['unix']()[_0xe2da('0x89')]();var _0x3bc4ea=path[_0xe2da('0x8a')](config['root'],_0xe2da('0x104'),_0xe2da('0x105'),_0xe2da('0x106'));var _0x481032=path[_0xe2da('0x8a')](config[_0xe2da('0x107')],_0xe2da('0x104'),_0xe2da('0x105'),'attachments');var _0x3d3ce1=path[_0xe2da('0x8a')](_0x3bc4ea,_0x195c9e);var _0x7be107=util['format'](_0xe2da('0x108'),_0xc9bf5d[_0xe2da('0xbc')]['id'],_0x195c9e);var _0x52cef9=path[_0xe2da('0x8a')](_0x3bc4ea,_0x7be107);var _0x47e982=![];return db[_0xe2da('0xa3')][_0xe2da('0xb9')]({'where':{'id':_0xc9bf5d[_0xe2da('0xbc')]['id']},'include':[{'model':db[_0xe2da('0xd6')],'as':'Messages','attributes':['id','body',_0xe2da('0x63'),'direction',_0xe2da('0xe5')],'include':[{'model':db[_0xe2da('0xd8')],'as':_0xe2da('0xd8'),'attributes':['id',_0xe2da('0xe2')],'raw':!![]},{'model':db[_0xe2da('0x109')],'as':_0xe2da('0x10a'),'attributes':['id',_0xe2da('0x10b'),'lastName'],'raw':!![]},{'model':db[_0xe2da('0xcc')],'as':_0xe2da('0xcc'),'raw':!![]}]},{'model':db[_0xe2da('0xd9')],'as':_0xe2da('0x10c'),'attributes':['id',_0xe2da('0x3d')]},{'model':db[_0xe2da('0xd8')],'as':_0xe2da('0x10d'),'attributes':['id',_0xe2da('0xe2')]}]})[_0xe2da('0x25')](handleEntityNotFound(_0x386bb0,null))[_0xe2da('0x25')](function(_0xb6cc81){if(_0xb6cc81){var _0x23a77f=_0xb6cc81['get']({'plain':!![]});_0x47e982=!![];var _0x44dde7={'format':'A4','border':_0xe2da('0x10e'),'header':{'height':_0xe2da('0x10f'),'contents':{'first':_0xe2da('0x110')}},'footer':{'height':_0xe2da('0x111'),'contents':{'default':util[_0xe2da('0x69')](_0xe2da('0x112'),util['format'](_0xe2da('0x113'),_0xe2da('0x114'),_0x23a77f['id']),moment()[_0xe2da('0x69')](_0xe2da('0x115'))[_0xe2da('0x89')]())}}};fs[_0xe2da('0x116')](_0x3d3ce1);var _0x31c8db={'channel':_0xe2da('0x114'),'account':_0x23a77f[_0xe2da('0x10c')][_0xe2da('0x3d')],'agent':_0x23a77f['Owner']?_0x23a77f['Owner']['fullname']:_0xe2da('0x117'),'createdAt':moment(_0x23a77f['createdAt'])['format'](_0xe2da('0x118'))[_0xe2da('0x89')](),'closedAt':_0x23a77f[_0xe2da('0xc4')]?moment(_0x23a77f['closedAt'])[_0xe2da('0x69')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe2da('0x89')]():'','disposition':_0x23a77f['disposition'],'chatInfo':{'browser':_0x23a77f['browserName'],'os':_0x23a77f['osName'],'referer':_0x23a77f[_0xe2da('0x119')],'customerIp':_0x23a77f[_0xe2da('0x11a')]},'messages':_(_0x23a77f['Messages'])[_0xe2da('0x11b')]()[_0xe2da('0x7c')]({'secret':![]})['map'](function(_0x577a3a){if(_0x577a3a['Attachment']){var _0x278554=path[_0xe2da('0x8a')](_0x481032,_0x577a3a[_0xe2da('0xcc')][_0xe2da('0xc9')]);if(fs[_0xe2da('0x11c')](_0x278554)){fs[_0xe2da('0x11d')](_0x278554)['pipe'](fs[_0xe2da('0x11e')](path[_0xe2da('0x8a')](_0x3d3ce1,_0x577a3a[_0xe2da('0xcc')][_0xe2da('0xc9')])));}}return{'date':moment(_0x577a3a['createdAt'])[_0xe2da('0x69')](_0xe2da('0x118'))[_0xe2da('0x89')](),'sender':_0x577a3a[_0xe2da('0xe4')]===_0xe2da('0x11f')?_0x577a3a[_0xe2da('0xd8')]?_0x577a3a[_0xe2da('0xd8')][_0xe2da('0xe2')]:'System':_0x577a3a['Contact'][_0xe2da('0x10b')]+(_0x577a3a['Contact']['lastName']?'\x20'+_0x577a3a[_0xe2da('0x10a')]['lastName']:''),'body':_0x577a3a['Attachment']?_0x577a3a[_0xe2da('0xcc')][_0xe2da('0xc9')]:_0x577a3a[_0xe2da('0xbb')],'direction':_0x577a3a['direction']==='out'?'A':'C','secret':_0x577a3a[_0xe2da('0xe5')],'attachment':_0x577a3a[_0xe2da('0xcc')]};})[_0xe2da('0x64')]()};return ejs[_0xe2da('0x120')](path[_0xe2da('0x8a')](config['root'],'server','views','downloadInteraction.html'),{'interaction':_0x31c8db})['then'](function(_0x38875b){return new BPromise(function(_0x2193b5,_0x27657e){pdf[_0xe2da('0xba')](_0x38875b,_0x44dde7)['toFile'](path['join'](_0x3d3ce1,'transcript-'+_0x23a77f['id']+'-'+_0x195c9e+_0xe2da('0x121')),function(_0x1b9cf9,_0x557f56){if(_0x1b9cf9)return _0x27657e(_0x1b9cf9);_0x2193b5(_0x557f56);});});});}})[_0xe2da('0x25')](function(){if(_0x47e982){return new BPromise(function(_0x182c36,_0x15dd74){zipdir(_0x3d3ce1,{'saveTo':_0x52cef9},function(_0x2f83d0,_0x39627b){if(_0x2f83d0)return _0x15dd74(_0x2f83d0);return _0x182c36(_0x39627b);});})['then'](function(){return new BPromise(function(_0xfe6dc5,_0x565bc2){rimraf(_0x3d3ce1,function(_0x5882d8){if(_0x5882d8)_0x565bc2(_0x5882d8);return _0xfe6dc5();});});})[_0xe2da('0x25')](function(){return _0x386bb0[_0xe2da('0xd1')](_0x52cef9,_0x7be107,function(_0x4b28d9){if(_0x4b28d9){console[_0xe2da('0x122')]('err',_0x4b28d9);}else{fs[_0xe2da('0x123')](_0x52cef9);}});});}else{return _0x386bb0[_0xe2da('0x30')](0xc8);}})[_0xe2da('0x2f')](handleError(_0x386bb0,null));}; \ No newline at end of file +var _0x91a7=['destroy','stack','name','send','ChatInteraction','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','color','from','tools_tags','chat_messages','me.ChatInteractionId\x20=\x20i.id','me.read\x20=\x20false','u.id','user_has_chat_interactions','left_join','users','chat_interactions','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','cm_contacts','chat_websites','expr','parse','value','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','Messages.count','length','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','c.email','\x20>\x20?','\x20<\x20?','map','hasOwnProperty','filter','isEmpty','forEach','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','i.id','Sequelize','SELECT','clone','COUNT(*)','advancedFilter','read','%s\x20=\x200','having','%s\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','sequelize','keyBy','merge','a.key','Account.key','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','u.fullname','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','groupBy','ChatInteractionId','Users','Tags','show','rawAttributes','includeAll','include','options','find','body','params','describe','customUpdate','abandon','entity\x20not\x20found','UserId','ValidationError','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','create','closed','findOne','root','server/files/attachments/','close','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','addMessage','ids','omit','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','secret','includeAgent','addTags','spread','Tag','emit','chatInteractionTags:save','removeTags','download','unix','files','server','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','10px','40px','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','Chat','mkdirSync','N.A.','osName','tail','existsSync','createReadStream','createWriteStream','out','downloadInteraction.html','toFile','.pdf','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then'];(function(_0x448773,_0x58fc91){var _0x5edbc7=function(_0x51e6f5){while(--_0x51e6f5){_0x448773['push'](_0x448773['shift']());}};_0x5edbc7(++_0x58fc91);}(_0x91a7,0xe7));var _0x791a=function(_0x57097f,_0x594362){_0x57097f=_0x57097f-0x0;var _0x31f2f4=_0x91a7[_0x57097f];return _0x31f2f4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x791a('0x0'));var rimraf=require(_0x791a('0x1'));var zipdir=require(_0x791a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x791a('0x3'));var moment=require('moment');var BPromise=require(_0x791a('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x791a('0x5'));var sox=require(_0x791a('0x6'));var csv=require('to-csv');var ejs=require(_0x791a('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x791a('0x8'));var crypto=require(_0x791a('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x791a('0xa'));var toCsv=require(_0x791a('0xb'));var querystring=require(_0x791a('0xc'));var Papa=require(_0x791a('0xd'));var Redis=require(_0x791a('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x791a('0xf'));var hardwareService=require(_0x791a('0x10'));var logger=require('../../config/logger')(_0x791a('0x11'));var utils=require(_0x791a('0x12'));var config=require(_0x791a('0x13'));var db=require(_0x791a('0x14'))['db'];config[_0x791a('0x15')]=_[_0x791a('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x791a('0x17'))(new Redis(config[_0x791a('0x15')]));require('./chatInteraction.socket')[_0x791a('0x18')](socket);var jayson=require(_0x791a('0x19'));var client=jayson['client'][_0x791a('0x1a')]({'port':0x232b});var client9004=jayson[_0x791a('0x1b')][_0x791a('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x5cdf2,_0x55e845,_0x2ce2e0){if(_0x2ce2e0){var _0x575d11=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x575d11[_0x791a('0x1c')](_0x55e845)){return _0x5cdf2;}else{throw new Error(_0x791a('0x1d'));}}else{return _0x5cdf2;}}function respondWithRpcPromise(_0x49ae3e,_0x237adb,_0x5bea2e,_0x35fe48){return new BPromise(function(_0x52941d,_0x4a84ee){var _0x588d00=_0x35fe48||client;return _0x588d00[_0x791a('0x1e')](_0x49ae3e,_0x5bea2e)['then'](function(_0x4cf613){logger[_0x791a('0x1f')](_0x791a('0x20'),_0x237adb,_0x791a('0x21'));logger[_0x791a('0x22')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x237adb,_0x791a('0x21'),JSON[_0x791a('0x23')](_0x4cf613));if(_0x4cf613[_0x791a('0x24')]){if(_0x4cf613[_0x791a('0x24')]['code']===0x1f4){logger[_0x791a('0x24')](_0x791a('0x20'),_0x237adb,_0x4cf613[_0x791a('0x24')][_0x791a('0x25')]);return _0x4a84ee(_0x4cf613[_0x791a('0x24')][_0x791a('0x25')]);}logger[_0x791a('0x24')](_0x791a('0x20'),_0x237adb,_0x4cf613[_0x791a('0x24')][_0x791a('0x25')]);return _0x52941d(_0x4cf613[_0x791a('0x24')]['message']);}else{logger[_0x791a('0x1f')](_0x791a('0x20'),_0x237adb,_0x791a('0x21'));_0x52941d(_0x4cf613[_0x791a('0x26')]['message']);}})[_0x791a('0x27')](function(_0x2db3f7){logger['error'](_0x791a('0x20'),_0x237adb,_0x2db3f7);_0x4a84ee(_0x2db3f7);});});}function respondWithStatusCode(_0x1785f5,_0x16dbaf){_0x16dbaf=_0x16dbaf||0xcc;return function(_0x4c1626){if(_0x4c1626){return _0x1785f5[_0x791a('0x28')](_0x16dbaf);}return _0x1785f5[_0x791a('0x29')](_0x16dbaf)[_0x791a('0x2a')]();};}function respondWithResult(_0x395376,_0x4f423){_0x4f423=_0x4f423||0xc8;return function(_0x1a9c6b){if(_0x1a9c6b){return _0x395376[_0x791a('0x29')](_0x4f423)[_0x791a('0x2b')](_0x1a9c6b);}};}function respondWithFilteredResult(_0x58bbc0,_0xbc3436){return function(_0x9e9332){if(_0x9e9332){var _0x1b10a7=_0x9e9332[_0x791a('0x2c')],_0x59d2c0=_0xbc3436[_0x791a('0x2d')],_0x1cdda9=_0xbc3436[_0x791a('0x2d')]+_0xbc3436[_0x791a('0x2e')],_0x5df656;if(_0x1cdda9>=_0x1b10a7){_0x1cdda9=_0x1b10a7;_0x5df656=0xc8;}else{_0x5df656=0xce;}_0x58bbc0[_0x791a('0x29')](_0x5df656);return _0x58bbc0[_0x791a('0x2f')](_0x791a('0x30'),_0x59d2c0+'-'+_0x1cdda9+'/'+_0x1b10a7)['json'](_0x9e9332);}return null;};}function patchUpdates(_0x3662c6){return function(_0x401069){try{jsonpatch[_0x791a('0x31')](_0x401069,_0x3662c6,!![]);}catch(_0x27f758){return BPromise[_0x791a('0x32')](_0x27f758);}return _0x401069['save']();};}function saveUpdates(_0x42d650,_0x8e7002){return function(_0x423a1e){if(_0x423a1e){return _0x423a1e[_0x791a('0x33')](_0x42d650)[_0x791a('0x34')](function(_0x4ef825){return _0x4ef825;});}return null;};}function removeEntity(_0x305836,_0x1f28af){return function(_0x33f998){if(_0x33f998){return _0x33f998[_0x791a('0x35')]()[_0x791a('0x34')](function(){_0x305836['status'](0xcc)[_0x791a('0x2a')]();});}};}function handleEntityNotFound(_0x5d7435,_0x1cf048){return function(_0x4cd047){if(!_0x4cd047){_0x5d7435['sendStatus'](0x194);}return _0x4cd047;};}function handleError(_0x425675,_0x404530){_0x404530=_0x404530||0x1f4;return function(_0x75458d){logger[_0x791a('0x24')](_0x75458d[_0x791a('0x36')]);if(_0x75458d[_0x791a('0x37')]){delete _0x75458d[_0x791a('0x37')];}_0x425675['status'](_0x404530)[_0x791a('0x38')](_0x75458d);};}exports['index']=function(_0x10c5ca,_0x496005){var _0x25e8cc={},_0xe97766={},_0x4ead60={'count':0x0,'rows':[]};var _0x24efa1=db[_0x791a('0x39')]['rawAttributes'];_0xe97766[_0x791a('0x3a')]=_[_0x791a('0x3b')](_0x24efa1);_0xe97766[_0x791a('0x3c')]=_[_0x791a('0x3b')](_0x10c5ca[_0x791a('0x3c')]);_0xe97766[_0x791a('0x3d')]=_[_0x791a('0x3e')](_0xe97766[_0x791a('0x3a')],_0xe97766[_0x791a('0x3c')]);_0x25e8cc[_0x791a('0x3f')]=_['intersection'](_0xe97766[_0x791a('0x3a')],qs[_0x791a('0x40')](_0x10c5ca[_0x791a('0x3c')]['fields']));_0x25e8cc[_0x791a('0x3f')]=_0x25e8cc['attributes']['length']?_0x25e8cc['attributes']:_0xe97766[_0x791a('0x3a')];if(!_0x10c5ca[_0x791a('0x3c')]['hasOwnProperty'](_0x791a('0x41'))){_0x25e8cc[_0x791a('0x2e')]=qs[_0x791a('0x2e')](_0x10c5ca[_0x791a('0x3c')]['limit']);_0x25e8cc['offset']=qs['offset'](_0x10c5ca[_0x791a('0x3c')][_0x791a('0x2d')]);}_0x25e8cc['order']=qs[_0x791a('0x42')](_0x10c5ca[_0x791a('0x3c')][_0x791a('0x42')]);_0x25e8cc[_0x791a('0x43')]=qs['filters'](_[_0x791a('0x44')](_0x10c5ca['query'],_0xe97766[_0x791a('0x3d')]));var _0x31e5d3=[];var _0x24633a=squel[_0x791a('0x45')]()[_0x791a('0x46')]('id')['field'](_0x791a('0x37'))[_0x791a('0x46')](_0x791a('0x47'))[_0x791a('0x48')](_0x791a('0x49'));var _0x5064dd=squel[_0x791a('0x45')]()[_0x791a('0x46')]('COUNT(*)')['from'](_0x791a('0x4a'),'me')[_0x791a('0x43')](_0x791a('0x4b'))['where']('me.direction\x20=\x20\x27in\x27')[_0x791a('0x43')](_0x791a('0x4c'));var _0x5d5a01=squel[_0x791a('0x45')]()[_0x791a('0x46')](_0x791a('0x4d'))['field']('ui.ChatInteractionId')[_0x791a('0x48')](_0x791a('0x4e'),'ui')[_0x791a('0x4f')](_0x791a('0x50'),'u','u.id\x20=\x20ui.UserId');var _0x2d7c7d=squel[_0x791a('0x45')]()[_0x791a('0x48')](_0x791a('0x51'),'i')['left_join'](_0x791a('0x4e'),'ui',_0x791a('0x52'))[_0x791a('0x4f')](_0x791a('0x50'),'u',_0x791a('0x53'))[_0x791a('0x4f')](_0x791a('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x791a('0x4f')](_0x791a('0x50'),'o','o.id\x20=\x20i.UserId')[_0x791a('0x4f')](_0x791a('0x55'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x791a('0x4f')](_0x791a('0x4a'),'me',_0x791a('0x4b'));var _0x2e357c=squel[_0x791a('0x56')]();if(_0x10c5ca['query']['advancedFilter']){var _0x7d4955=JSON[_0x791a('0x57')](_0x10c5ca['query']['advancedFilter']);_[_0x791a('0x3b')](_0x7d4955)['forEach'](function(_0x3e0b17){var _0x346467=_0x7d4955[_0x3e0b17];if(_0x3e0b17==='createdAt'){var _0x5166b5=moment(_0x346467[_0x791a('0x58')]['dateStart'])[_0x791a('0x59')](_0x791a('0x5a'))[_0x791a('0x5b')]()['format']();var _0xbcab79=moment(_0xbcab79)[_0x791a('0x5b')]()['endOf'](_0x791a('0x5a'))[_0x791a('0x5c')]();_0x2e357c[_0x791a('0x5d')](_0x791a('0x5e'),_0x5166b5,_0xbcab79);}else{if(_[_0x791a('0x5f')](_0x346467[_0x791a('0x60')])){_0x346467['condition']['forEach'](function(_0x35ccdf){switch(_0x346467['condition'][_0x791a('0x58')]){case'IS':if(_0x3e0b17!==_0x791a('0x61')&&_0x3e0b17!==_0x791a('0x62')){if(_[_0x791a('0x5f')](_0x346467[_0x791a('0x58')])&&_0x346467[_0x791a('0x58')][_0x791a('0x63')]>0x1){_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x65'),_0x346467[_0x791a('0x58')]);}else{_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x66'),_0x346467[_0x791a('0x58')][0x0]);}}break;case'=':_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+'\x20=\x20?',_0x346467['value']);break;case _0x791a('0x67'):if(_0x3e0b17===_0x791a('0x68')){_0x2e357c[_0x791a('0x5d')](_0x791a('0x69')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');_0x2e357c['or'](_0x791a('0x6b')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');_0x2e357c['or'](_0x791a('0x6c')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');}else{_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');}break;case'>':_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x6d'),_0x346467[_0x791a('0x58')]);break;case'<':_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x6e'),_0x346467[_0x791a('0x58')]);break;}});}else{switch(_0x346467[_0x791a('0x60')][_0x791a('0x58')]){case'IS':if(_0x3e0b17!=='TagId'&&_0x3e0b17!==_0x791a('0x62')){if(_[_0x791a('0x5f')](_0x346467[_0x791a('0x58')])&&_0x346467[_0x791a('0x58')]['length']>0x1){_0x2e357c[_0x791a('0x5d')](_0x346467['tableAlias']+'.'+_0x3e0b17+'\x20IN\x20?',_0x346467['value']);}else{_0x2e357c['and'](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x66'),_0x346467[_0x791a('0x58')][0x0]);}}break;case'=':_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+_0x791a('0x66'),_0x346467[_0x791a('0x58')]);break;case'LIKE':if(_0x3e0b17==='ContactId'){_0x2e357c[_0x791a('0x5d')](_0x791a('0x69')+'\x20LIKE\x20?','%'+_0x346467['value']+'%');_0x2e357c['or'](_0x791a('0x6b')+_0x791a('0x6a'),'%'+_0x346467['value']+'%');_0x2e357c['or'](_0x791a('0x6c')+_0x791a('0x6a'),'%'+_0x346467[_0x791a('0x58')]+'%');}else{_0x2e357c[_0x791a('0x5d')](_0x346467['tableAlias']+'.'+_0x3e0b17+'\x20LIKE\x20?','%'+_0x346467[_0x791a('0x58')]+'%');}break;case'>':_0x2e357c[_0x791a('0x5d')](_0x346467['tableAlias']+'.'+_0x3e0b17+_0x791a('0x6d'),_0x346467[_0x791a('0x58')]);break;case'<':_0x2e357c[_0x791a('0x5d')](_0x346467[_0x791a('0x64')]+'.'+_0x3e0b17+'\x20<\x20?',_0x346467[_0x791a('0x58')]);break;}}}});}else{var _0x4101e1=_(Object[_0x791a('0x3b')](_0x10c5ca[_0x791a('0x3c')]))[_0x791a('0x6f')](function(_0x2ee8b9){return _0x24efa1[_0x791a('0x70')](_0x2ee8b9)?_0x2ee8b9:undefined;})[_0x791a('0x71')](function(_0x5567d3){return!_['isNil'](_0x5567d3);})['value']();if(!_[_0x791a('0x72')](_0x4101e1)){_0x4101e1[_0x791a('0x73')](function(_0x1118a8){if(_0x1118a8===_0x791a('0x74')){_0x2d7c7d[_0x791a('0x43')](_0x791a('0x75'),[][_0x791a('0x76')](_0x10c5ca[_0x791a('0x3c')][_0x1118a8]));}else if(_0x1118a8===_0x791a('0x77')){var _0x13523a=JSON['parse'](_0x10c5ca[_0x791a('0x3c')][_0x1118a8])[_0x791a('0x78')];var _0x50cbb7=JSON[_0x791a('0x57')](_0x10c5ca[_0x791a('0x3c')][_0x1118a8])['$lte'];_0x2d7c7d['where'](_0x791a('0x5e'),_0x13523a,_0x50cbb7);}else{_0x2d7c7d[_0x791a('0x43')]('i.'+_0x1118a8+'\x20=\x20?',_0x10c5ca['query'][_0x1118a8]);}});}if(_0x10c5ca[_0x791a('0x3c')][_0x791a('0x71')]){var _0x46737e=_0x10c5ca['query'][_0x791a('0x71')]['replace']('\x5c','\x5c\x5c')[_0x791a('0x79')]('\x27\x27',_0x791a('0x7a'));if(qs[_0x791a('0x7b')](_0x46737e)){_0x2e357c['or'](_0x791a('0x7c'),_0x46737e+'%');}else{var _0x1de053=[];_0x46737e[_0x791a('0x7d')]('\x20')['forEach'](function(_0x936ebe){_0x1de053[_0x791a('0x7e')]('+'+_0x936ebe[_0x791a('0x7f')]());});var _0x291e8a=_0x1de053[_0x791a('0x80')]('\x20');_0x2e357c['or'](_0x791a('0x81'),_0x291e8a)['or'](_0x791a('0x82'),_0x46737e+'%');}}}_0x2d7c7d[_0x791a('0x43')](_0x2e357c);if(_0x25e8cc[_0x791a('0x83')]){_0x25e8cc[_0x791a('0x83')][_0x791a('0x73')](function(_0x5aaa8e){_0x2d7c7d[_0x791a('0x83')]('i.'+_0x5aaa8e[0x0],_0x5aaa8e[0x1]===_0x791a('0x84')?![]:!![]);});}_0x2d7c7d[_0x791a('0x85')](_0x791a('0x86'));var _0x3272c0={'type':db[_0x791a('0x87')]['QueryTypes'][_0x791a('0x88')],'raw':!![]};var _0xbd35f8=_0x2d7c7d[_0x791a('0x89')]()[_0x791a('0x46')](_0x791a('0x8a'));if(!_0x10c5ca['query'][_0x791a('0x8b')]){if(_0x10c5ca['query'][_0x791a('0x8c')]){if(_0x10c5ca['query'][_0x791a('0x8c')]==0x1){_0xbd35f8[_0x791a('0x43')](util['format'](_0x791a('0x8d'),_0x5064dd[_0x791a('0x7f')]()));_0x2d7c7d[_0x791a('0x8e')]('`Messages.count`\x20=\x200');}else{_0xbd35f8[_0x791a('0x43')](util['format'](_0x791a('0x8f'),_0x5064dd['toString']()));_0x2d7c7d['having']('`Messages.count`\x20>\x200');}}if(_0x10c5ca[_0x791a('0x3c')][_0x791a('0x90')]){var _0x31839a=_[_0x791a('0x5f')](_0x10c5ca['query'][_0x791a('0x90')])?_0x10c5ca[_0x791a('0x3c')]['tag']:new Array(_0x10c5ca[_0x791a('0x3c')][_0x791a('0x90')]);var _0x4b8c18=squel['expr']();_0x31839a['forEach'](function(_0x2ae2af){_0x4b8c18['or'](_0x791a('0x91'),'%,'+_0x2ae2af+',%');});_0x2d7c7d[_0x791a('0x8e')](_0x4b8c18);_0xbd35f8[_0x791a('0x4f')](_0x791a('0x92'),'it',_0x791a('0x93'));_0xbd35f8[_0x791a('0x4f')](_0x791a('0x49'),'t','t.id\x20=\x20it.TagId');_0xbd35f8[_0x791a('0x43')](_0x791a('0x94'),_0x31839a);}}else{var _0x7d4955=JSON[_0x791a('0x57')](_0x10c5ca['query']['advancedFilter']);_[_0x791a('0x3b')](_0x7d4955)[_0x791a('0x73')](function(_0x350d64){var _0x100c74=_0x7d4955[_0x350d64];if(_0x350d64===_0x791a('0x61')){var _0x3f55a5=_0x100c74[_0x791a('0x58')];var _0x3e1b21=squel[_0x791a('0x56')]();_0x3f55a5[_0x791a('0x73')](function(_0x18db1f){_0x3e1b21['or'](_0x791a('0x91'),'%,'+_0x18db1f+',%');});_0x2d7c7d[_0x791a('0x8e')](_0x3e1b21);_0xbd35f8['left_join'](_0x791a('0x95'),'it',_0x791a('0x96'));_0xbd35f8[_0x791a('0x4f')](_0x791a('0x49'),'t',_0x791a('0x97'));_0xbd35f8[_0x791a('0x43')](_0x791a('0x94'),_0x3f55a5);}else if(_0x350d64===_0x791a('0x62')){if(_0x100c74[_0x791a('0x58')][_0x791a('0x63')]===0x1){if(_0x100c74['value'][0x0]===0x1){_0xbd35f8[_0x791a('0x43')](util[_0x791a('0x5c')]('%s\x20=\x200',_0x5064dd[_0x791a('0x7f')]()));_0x2d7c7d[_0x791a('0x8e')](_0x791a('0x98'));}else{_0xbd35f8[_0x791a('0x43')](util[_0x791a('0x5c')]('%s\x20>\x200',_0x5064dd['toString']()));_0x2d7c7d[_0x791a('0x8e')](_0x791a('0x99'));}}}});}db['sequelize']['query'](_0xbd35f8[_0x791a('0x7f')](),_0x3272c0)[_0x791a('0x34')](function(_0x140766){_0x4ead60[_0x791a('0x2c')]=_0x140766[_0x791a('0x63')];if(_0x4ead60[_0x791a('0x2c')]===0x0)return[];return db[_0x791a('0x9a')][_0x791a('0x3c')](_0x24633a['toString'](),_0x3272c0)['then'](function(_0x5a0958){_0x31e5d3=_[_0x791a('0x9b')](_0x5a0958,'id');_0x3272c0=_[_0x791a('0x9c')](_0x3272c0,{'model':db[_0x791a('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x2d7c7d['field'](_0x5064dd,'Messages.count');_0x2d7c7d[_0x791a('0x46')](_0x791a('0x9d'),_0x791a('0x9e'));_0x2d7c7d[_0x791a('0x46')]('i.*');_0x2d7c7d[_0x791a('0x46')](_0x791a('0x69'),_0x791a('0x9f'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0x6b'),_0x791a('0xa0'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0x6c'),_0x791a('0xa1'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa2'),'Contact.phone');_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa3'),_0x791a('0xa4'));_0x2d7c7d['field']('c.fax','Contact.fax');_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa5'),_0x791a('0xa6'));_0x2d7c7d[_0x791a('0x46')](_0x791a('0xa7'),_0x791a('0xa8'));_0x2d7c7d['left_join'](_0x791a('0x92'),'it',_0x791a('0x93'));_0x2d7c7d[_0x791a('0x4f')]('tools_tags','t',_0x791a('0x97'));_0x2d7c7d[_0x791a('0x2e')](_0x25e8cc['limit']);_0x2d7c7d[_0x791a('0x2d')](_0x25e8cc['offset']);return db[_0x791a('0x9a')]['query'](_0x2d7c7d[_0x791a('0x7f')](),_0x3272c0);})['then'](function(_0x4ea270){_0x5d5a01['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x791a('0x6f')](_0x4ea270,'id'));return db[_0x791a('0x9a')][_0x791a('0x3c')](_0x5d5a01['toString'](),_0x3272c0)[_0x791a('0x34')](function(_0x24cbe0){var _0x1599d6=_[_0x791a('0xa9')](_0x24cbe0,_0x791a('0xaa'));_0x4ea270['forEach'](function(_0x4c5bde){if(_0x1599d6[_0x4c5bde['id']]){_0x4c5bde[_0x791a('0xab')]=_[_0x791a('0x6f')](_0x1599d6[_0x4c5bde['id']],function(_0x10f1cf){return{'id':_0x10f1cf['id']};});}if(_0x4c5bde['TagIds']){_0x4c5bde[_0x791a('0xac')]=[];_0x4c5bde['TagIds'][_0x791a('0x7d')](',')[_0x791a('0x73')](function(_0x18d6c6){_0x4c5bde['Tags'][_0x791a('0x7e')](_0x31e5d3[_0x18d6c6]);});}delete _0x4c5bde[_0x791a('0xa8')];});return _0x4ea270;});});})[_0x791a('0x34')](function(_0x480688){_0x4ead60['rows']=_0x480688;return _0x4ead60;})[_0x791a('0x34')](respondWithFilteredResult(_0x496005,_0x25e8cc))[_0x791a('0x27')](handleError(_0x496005,null));};exports[_0x791a('0xad')]=function(_0x14b22f,_0xb39ddf){var _0x5a15c4={'raw':![],'where':{'id':_0x14b22f['params']['id']}},_0x5c24a7={};_0x5c24a7['model']=_[_0x791a('0x3b')](db['ChatInteraction'][_0x791a('0xae')]);_0x5c24a7[_0x791a('0x3c')]=_[_0x791a('0x3b')](_0x14b22f[_0x791a('0x3c')]);_0x5c24a7[_0x791a('0x3d')]=_[_0x791a('0x3e')](_0x5c24a7[_0x791a('0x3a')],_0x5c24a7[_0x791a('0x3c')]);_0x5a15c4[_0x791a('0x3f')]=_[_0x791a('0x3e')](_0x5c24a7[_0x791a('0x3a')],qs['fields'](_0x14b22f[_0x791a('0x3c')][_0x791a('0x40')]));_0x5a15c4['attributes']=_0x5a15c4[_0x791a('0x3f')][_0x791a('0x63')]?_0x5a15c4[_0x791a('0x3f')]:_0x5c24a7['model'];if(_0x14b22f[_0x791a('0x3c')][_0x791a('0xaf')]){_0x5a15c4[_0x791a('0xb0')]=[{'all':!![]}];}_0x5a15c4=_['merge']({},_0x5a15c4,_0x14b22f[_0x791a('0xb1')]);return db[_0x791a('0x39')][_0x791a('0xb2')](_0x5a15c4)[_0x791a('0x34')](handleEntityNotFound(_0xb39ddf,null))['then'](respondWithResult(_0xb39ddf,null))['catch'](handleError(_0xb39ddf,null));};exports['create']=function(_0x5e5bf5,_0x3fb481){return db[_0x791a('0x39')]['create'](_0x5e5bf5[_0x791a('0xb3')],{})[_0x791a('0x34')](respondWithResult(_0x3fb481,0xc9))[_0x791a('0x27')](handleError(_0x3fb481,null));};exports[_0x791a('0x33')]=function(_0x1a7670,_0x16b60f){if(_0x1a7670[_0x791a('0xb3')]['id']){delete _0x1a7670['body']['id'];}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x1a7670['params']['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x16b60f,null))['then'](saveUpdates(_0x1a7670[_0x791a('0xb3')],null))[_0x791a('0x34')](respondWithResult(_0x16b60f,null))[_0x791a('0x27')](handleError(_0x16b60f,null));};exports['destroy']=function(_0x34ae77,_0x7fead2){return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x34ae77[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x7fead2,null))[_0x791a('0x34')](removeEntity(_0x7fead2,null))[_0x791a('0x27')](handleError(_0x7fead2,null));};exports[_0x791a('0xb5')]=function(_0x9fe4a5,_0x4f1d72){return db['ChatInteraction'][_0x791a('0xb5')]()[_0x791a('0x34')](respondWithResult(_0x4f1d72,null))[_0x791a('0x27')](handleError(_0x4f1d72,null));};exports[_0x791a('0xb6')]=function(_0x2ff260,_0x4f074c){if(_0x2ff260['body']['id']){delete _0x2ff260[_0x791a('0xb3')]['id'];}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x2ff260[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x4f074c,null))[_0x791a('0x34')](saveUpdates(_0x2ff260['body'],null))[_0x791a('0x34')](respondWithResult(_0x4f074c,null))['catch'](handleError(_0x4f074c,null));};exports[_0x791a('0xb7')]=function(_0x526f7e,_0x2994b6,_0x59a5b1){if(_0x526f7e['body']['id']){delete _0x526f7e[_0x791a('0xb3')]['id'];}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x526f7e[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](function(_0x1bce38){if(!_0x1bce38){logger[_0x791a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x791a('0xb7'),0x194,_0x791a('0xb8'));_0x2994b6[_0x791a('0x28')](0x194);}else{if(_0x1bce38[_0x791a('0xb9')]){throw new db[(_0x791a('0x87'))][(_0x791a('0xba'))]('Interaction\x20already\x20assigned');}}return _0x1bce38;})[_0x791a('0x34')](function(_0x4b196b){if(_0x4b196b){return _0x4b196b['update']({'closed':_0x526f7e[_0x791a('0xb3')]['closed'],'disposition':_0x526f7e[_0x791a('0xb3')]['disposition']})[_0x791a('0x34')](function(_0x4d9e12){return _0x4d9e12;});}})['then'](function(_0x2c770a){return respondWithRpcPromise(_0x791a('0xbb'),'abandon',_0x526f7e['body'],client9004);})['then'](respondWithResult(_0x2994b6,null))[_0x791a('0x27')](handleError(_0x2994b6,null));};exports[_0x791a('0xbc')]=function(_0x13e1a8,_0x3038d1,_0x2b529a){_0x13e1a8['body']['name']=_0x13e1a8[_0x791a('0xbd')][_0x791a('0xbe')];_0x13e1a8['body'][_0x791a('0xbf')]=_0x13e1a8['file'][_0x791a('0xc0')];_0x13e1a8[_0x791a('0xb3')]['type']=_0x13e1a8[_0x791a('0xbd')][_0x791a('0xc1')];return db[_0x791a('0xc2')][_0x791a('0xc3')](_0x13e1a8[_0x791a('0xb3')])[_0x791a('0x34')](respondWithResult(_0x3038d1,0xc9))[_0x791a('0x27')](handleError(_0x3038d1,null));};exports['attachmentDownload']=function(_0x210629,_0xf52d2c,_0x3583fc){return db['ChatInteraction']['findOne']({'where':{'id':_0x210629['params']['id']},'raw':!![]})[_0x791a('0x34')](handleEntityNotFound(_0xf52d2c,null))[_0x791a('0x34')](function(_0x1932eb){if(_0x1932eb){if(_0x1932eb[_0x791a('0xc4')]){return _0xf52d2c['status'](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0x791a('0xc2')][_0x791a('0xc5')]({'where':{'id':_0x210629[_0x791a('0x3c')]['attachId']},'raw':!![]})[_0x791a('0x34')](handleEntityNotFound(_0xf52d2c,null));}})[_0x791a('0x34')](function(_0x220905){if(_0x220905){return _0xf52d2c['download'](path[_0x791a('0x80')](config[_0x791a('0xc6')],_0x791a('0xc7'),_0x220905[_0x791a('0xbf')]));}})[_0x791a('0x27')](handleError(_0xf52d2c,null));};exports[_0x791a('0xc8')]=function(_0x3b8837,_0x3753bf){var _0x263d4c=null;var _0x55676d=null;var _0x137e2a=null;var _0x308094=null;if(_0x3b8837[_0x791a('0xb3')]['id']){delete _0x3b8837[_0x791a('0xb3')]['id'];}if(_0x3b8837[_0x791a('0xb3')]['mailTranscript']){_0x308094=path[_0x791a('0x80')](config[_0x791a('0xc6')],'server/files/chat/upload/',util[_0x791a('0x5c')](_0x791a('0xc9'),Date[_0x791a('0xca')]()));_0x3b8837[_0x791a('0xb3')][_0x791a('0xcb')]=_0x308094;}return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x3b8837[_0x791a('0xb4')]['id']},'include':[{'model':db[_0x791a('0xcc')],'as':_0x791a('0xcd'),'include':[{'model':db[_0x791a('0xce')],'as':_0x791a('0xce')}]}]})[_0x791a('0x34')](handleEntityNotFound(_0x3753bf,null))['then'](saveUpdates(_0x3b8837[_0x791a('0xb3')],null))[_0x791a('0x34')](function(_0x370a11){if(_0x370a11){_0x263d4c=_0x370a11;return db[_0x791a('0xcf')][_0x791a('0xb2')]({'where':{'id':_0x263d4c[_0x791a('0x74')]}});}})['then'](function(_0x2728f6){if(_0x2728f6){_0x137e2a=_0x2728f6;return db[_0x791a('0xd0')][_0x791a('0xb2')]({'where':{'id':_0x263d4c[_0x791a('0x68')]}});}})[_0x791a('0x34')](function(_0x41cc4d){if(_0x41cc4d){_0x55676d=_0x41cc4d;if(_0x308094){var _0x49dd2=null;for(var _0x18c311=0x1;_0x18c311<_0x263d4c[_0x791a('0xcd')][_0x791a('0x63')];++_0x18c311){_0x49dd2=_0x263d4c['Messages'][_0x18c311];var _0x43c70e=_0x49dd2[_0x791a('0xb9')]?util[_0x791a('0x5c')]('%s%d',_0x137e2a[_0x791a('0xd1')],_0x49dd2[_0x791a('0xb9')]):_0x791a('0xd2');var _0x4ac50e=_0x3b8837['body'][_0x791a('0xd3')]||util[_0x791a('0x5c')](_0x791a('0xd4'),_0x791a('0xd5'),_0x49dd2[_0x791a('0x68')]);switch(_0x137e2a[_0x791a('0xd6')]){case _0x791a('0xd7'):_0x43c70e=_0x49dd2[_0x791a('0xb9')]?util[_0x791a('0x5c')](_0x791a('0xd4'),_0x137e2a[_0x791a('0xd1')],_0x49dd2['UserId']):_0x791a('0xd2');break;case _0x791a('0xd8'):_0x43c70e=_0x49dd2[_0x791a('0xb9')]?_0x49dd2[_0x791a('0xce')][_0x791a('0xd9')]||_0x49dd2[_0x791a('0xce')][_0x791a('0xda')]:_0x791a('0xd2');break;case _0x791a('0xdb'):_0x43c70e=_0x49dd2[_0x791a('0xb9')]?_0x49dd2[_0x791a('0xce')][_0x791a('0xda')]:_0x791a('0xd2');break;default:_0x43c70e=_0x49dd2[_0x791a('0xb9')]?util[_0x791a('0x5c')](_0x791a('0xd4'),_0x137e2a[_0x791a('0xd1')],_0x49dd2['UserId']):_0x791a('0xd2');}var _0x412bc0=util[_0x791a('0x5c')](_0x791a('0xdc'),moment(_0x49dd2[_0x791a('0x77')])['format'](_0x791a('0xdd')),_0x49dd2[_0x791a('0xde')]==='in'?_0x4ac50e:_0x43c70e,_0x49dd2[_0x791a('0xb3')]);if(!_0x49dd2['secret']){fs['appendFileSync'](_0x308094,_0x412bc0);}}return db[_0x791a('0xdf')][_0x791a('0xc5')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x791a('0xe0'),'raw':!![]}]});}}})[_0x791a('0x34')](function(_0x33fb9a){if(_0x33fb9a&&_0x33fb9a[_0x791a('0xe0')]&&_0x3b8837[_0x791a('0xb3')]){var _0x54d690={'tls':{'rejectUnauthorized':![]}};if(_0x33fb9a['Smtp'][_0x791a('0xe1')]){_0x54d690[_0x791a('0xe1')]=_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe1')];}else{_0x54d690[_0x791a('0xe2')]=_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe2')];_0x54d690[_0x791a('0xe3')]=_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe3')];_0x54d690[_0x791a('0xe4')]=_0x33fb9a['Smtp']['secure'];}if(_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe5')]){_0x54d690[_0x791a('0xe6')]={'user':_0x33fb9a[_0x791a('0xe0')][_0x791a('0xe7')],'pass':_0x33fb9a['Smtp'][_0x791a('0xe8')]};}return respondWithRpcPromise(_0x791a('0xe9'),_0x791a('0xea'),{'account':_0x54d690,'message':{'from':util[_0x791a('0x5c')](_0x791a('0xeb'),_0x33fb9a[_0x791a('0x37')],_0x33fb9a[_0x791a('0xec')]||_0x33fb9a['Smtp'][_0x791a('0xe7')]),'to':_0x3b8837[_0x791a('0xb3')][_0x791a('0xed')],'subject':_0x791a('0xee'),'text':util[_0x791a('0x5c')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x3b8837['body']['mailTranscript']),'attachments':[{'path':_0x308094}]}})[_0x791a('0x34')](function(){return _0x263d4c;})[_0x791a('0x27')](function(_0x3bf573){console[_0x791a('0x24')](_0x3bf573);});}else{return _0x263d4c;}})[_0x791a('0x34')](respondWithStatusCode(_0x3753bf,0xc8))['catch'](handleError(_0x3753bf,null));};exports[_0x791a('0xef')]=function(_0x132c6d,_0x5620ef,_0x1c647c){return db['ChatMessage']['find']({'where':{'id':_0x132c6d['params']['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x5620ef,null))[_0x791a('0x34')](function(_0x2800e7){if(_0x2800e7){return _0x2800e7[_0x791a('0xef')](_0x132c6d[_0x791a('0xb3')][_0x791a('0xf0')],_[_0x791a('0xf1')](_0x132c6d[_0x791a('0xb3')],[_0x791a('0xf0'),'id'])||{});}})[_0x791a('0x34')](respondWithResult(_0x5620ef,null))['catch'](handleError(_0x5620ef,null));};exports[_0x791a('0xf2')]=function(_0x145ed4,_0x3f3ed3,_0x5d50a4){var _0xd555={'raw':![],'where':{}};var _0x45bf42={};var _0x2e869b={'count':0x0,'rows':[]};return db[_0x791a('0x39')]['findOne']({'where':{'id':_0x145ed4[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x3f3ed3,null))['then'](function(_0x11ec18){if(_0x11ec18){_0x45bf42['model']=_['keys'](db[_0x791a('0xcc')][_0x791a('0xae')]);_0x45bf42[_0x791a('0x3c')]=_['keys'](_0x145ed4['query']);_0x45bf42[_0x791a('0x3d')]=_[_0x791a('0x3e')](_0x45bf42[_0x791a('0x3a')],_0x45bf42['query']);_0xd555[_0x791a('0x3f')]=_[_0x791a('0x3e')](_0x45bf42[_0x791a('0x3a')],qs['fields'](_0x145ed4[_0x791a('0x3c')][_0x791a('0x40')]));_0xd555[_0x791a('0x3f')]=_0xd555['attributes'][_0x791a('0x63')]?_0xd555[_0x791a('0x3f')]:_0x45bf42[_0x791a('0x3a')];if(!_0x145ed4[_0x791a('0x3c')][_0x791a('0x70')](_0x791a('0x41'))){_0xd555[_0x791a('0x2e')]=qs[_0x791a('0x2e')](_0x145ed4['query'][_0x791a('0x2e')]);_0xd555[_0x791a('0x2d')]=qs[_0x791a('0x2d')](_0x145ed4['query'][_0x791a('0x2d')]);}_0xd555['order']=qs[_0x791a('0x42')](_0x145ed4[_0x791a('0x3c')][_0x791a('0x42')]);_0xd555[_0x791a('0x43')]=qs['filters'](_[_0x791a('0x44')](_0x145ed4[_0x791a('0x3c')],_0x45bf42[_0x791a('0x3d')]));_0xd555[_0x791a('0x43')][_0x791a('0xaa')]=_0x11ec18['id'];if(_0x145ed4[_0x791a('0x3c')][_0x791a('0x71')]){_0xd555['where']=_[_0x791a('0x9c')](_0xd555[_0x791a('0x43')],{'$or':_[_0x791a('0x6f')](_0xd555[_0x791a('0x3f')],function(_0x42b3e4){var _0xb0d2d9={};_0xb0d2d9[_0x42b3e4]={'$like':'%'+_0x145ed4[_0x791a('0x3c')][_0x791a('0x71')]+'%'};return _0xb0d2d9;})});}if(_0x145ed4[_0x791a('0x3c')]['$gte']){var _0x23b545=_0x145ed4[_0x791a('0x3c')][_0x791a('0x78')]['split'](',');var _0xa51ffb={};_0xa51ffb[_0x23b545[0x0]]={'$gte':moment(_0x23b545[0x1])[_0x791a('0x5c')](_0x791a('0xf3'))};_0xd555[_0x791a('0x43')]=_['merge'](_0xd555['where'],_0xa51ffb);}_0xd555=_[_0x791a('0x9c')]({},_0xd555,_0x145ed4[_0x791a('0xb1')]);return db[_0x791a('0xcc')][_0x791a('0x2c')]({'where':_0xd555['where']})[_0x791a('0x34')](function(_0x3a5cd1){_0x2e869b[_0x791a('0x2c')]=_0x3a5cd1;if(_0x145ed4[_0x791a('0x3c')][_0x791a('0xaf')]){_0xd555[_0x791a('0xb0')]=[{'all':!![]}];}return db[_0x791a('0xcc')][_0x791a('0xf4')](_0xd555);})[_0x791a('0x34')](function(_0x4608f6){_0x2e869b['rows']=_0x4608f6;return _0x2e869b;});}})[_0x791a('0x34')](respondWithFilteredResult(_0x3f3ed3,_0xd555))[_0x791a('0x27')](handleError(_0x3f3ed3,null));};exports[_0x791a('0xf5')]=function(_0x553538,_0x43d114,_0x265b90){var _0x24a413={'where':{}},_0x14509b={},_0x52ce0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x791a('0xc5')]({'where':{'id':_0x553538[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x43d114,null))['then'](function(_0x58eab0){if(_0x58eab0){_0x14509b[_0x791a('0x3a')]=_[_0x791a('0x3b')](db[_0x791a('0xcc')]['rawAttributes']);_0x14509b[_0x791a('0x3c')]=_[_0x791a('0x3b')](_0x553538[_0x791a('0x3c')]);_0x14509b['filters']=_[_0x791a('0x3e')](_0x14509b[_0x791a('0x3a')],_0x14509b['query']);_0x24a413[_0x791a('0x3f')]=_[_0x791a('0x3e')](_0x14509b[_0x791a('0x3a')],qs[_0x791a('0x40')](_0x553538[_0x791a('0x3c')][_0x791a('0x40')]));_0x24a413['attributes']=_0x24a413[_0x791a('0x3f')][_0x791a('0x63')]?_0x24a413[_0x791a('0x3f')]:_0x14509b['model'];if(!_0x553538[_0x791a('0x3c')][_0x791a('0x70')](_0x791a('0x41'))){_0x24a413['limit']=qs['limit'](_0x553538['query'][_0x791a('0x2e')]);_0x24a413[_0x791a('0x2d')]=qs[_0x791a('0x2d')](_0x553538[_0x791a('0x3c')][_0x791a('0x2d')]);}_0x24a413[_0x791a('0x83')]=qs[_0x791a('0x42')](_0x553538['query'][_0x791a('0x42')]);_0x24a413[_0x791a('0x43')]=qs['filters'](_['pick'](_0x553538[_0x791a('0x3c')],_0x14509b[_0x791a('0x3d')]));_0x24a413['where']['ChatInteractionId']=_0x58eab0['id'];if(_0x553538[_0x791a('0x3c')][_0x791a('0x71')]){_0x24a413['where']=_[_0x791a('0x9c')](_0x24a413[_0x791a('0x43')],{'$or':_['map'](_0x24a413[_0x791a('0x3f')],function(_0x1007c5){var _0xf51368={};_0xf51368[_0x1007c5]={'$like':'%'+_0x553538[_0x791a('0x3c')][_0x791a('0x71')]+'%'};return _0xf51368;})});}_0x24a413[_0x791a('0x43')][_0x791a('0xf6')]=![];if(_0x553538[_0x791a('0x3c')]['id']){_0x24a413[_0x791a('0x43')]['id']={'$gt':_0x553538[_0x791a('0x3c')]['id']};}_0x24a413=_[_0x791a('0x9c')]({},_0x24a413,_0x553538[_0x791a('0xb1')]);return db[_0x791a('0xcc')]['count']({'where':_0x24a413[_0x791a('0x43')]})[_0x791a('0x34')](function(_0x125593){_0x52ce0e['count']=_0x125593;_0x24a413[_0x791a('0xb0')]=[];if(_0x553538['query'][_0x791a('0xf7')]){_0x24a413[_0x791a('0xb0')][_0x791a('0x7e')]({'model':db[_0x791a('0xce')],'as':_0x791a('0xce'),'attributes':['id',_0x791a('0xda'),_0x791a('0xd9')]});}if(_0x553538[_0x791a('0x3c')][_0x791a('0xaf')]){_0x24a413[_0x791a('0xb0')]=[{'all':!![]}];}return db[_0x791a('0xcc')][_0x791a('0xf4')](_0x24a413);})[_0x791a('0x34')](function(_0x20bd46){_0x52ce0e['rows']=_0x20bd46;return _0x52ce0e;});}})['then'](respondWithFilteredResult(_0x43d114,_0x24a413))['catch'](handleError(_0x43d114,null));};exports[_0x791a('0xf8')]=function(_0x101ae6,_0x5a45b6,_0x4e2a7c){return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x101ae6[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x5a45b6,null))[_0x791a('0x34')](function(_0x3f8767){if(_0x3f8767){return _0x3f8767['setTags'](_0x101ae6[_0x791a('0xb3')][_0x791a('0xf0')],_[_0x791a('0xf1')](_0x101ae6['body'],[_0x791a('0xf0'),'id'])||{})[_0x791a('0xf9')](function(){return db[_0x791a('0xfa')][_0x791a('0xf4')]({'attributes':['id',_0x791a('0x37'),_0x791a('0x47')],'where':{'id':_0x101ae6[_0x791a('0xb3')][_0x791a('0xf0')]}});})['then'](function(_0x5aabd1){socket[_0x791a('0xfb')](_0x791a('0xfc'),{'id':Number(_0x101ae6[_0x791a('0xb4')]['id']),'tags':_0x5aabd1||[]});return{'id':Number(_0x101ae6[_0x791a('0xb4')]['id']),'tags':_0x5aabd1||[]};});}})[_0x791a('0x34')](respondWithResult(_0x5a45b6,null))['catch'](handleError(_0x5a45b6,null));};exports[_0x791a('0xfd')]=function(_0x4bff5f,_0x269544,_0x196f3c){return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x4bff5f[_0x791a('0xb4')]['id']}})[_0x791a('0x34')](handleEntityNotFound(_0x269544,null))['then'](function(_0x4342df){if(_0x4342df){return _0x4342df[_0x791a('0xfd')](_0x4bff5f[_0x791a('0x3c')][_0x791a('0xf0')]);}})['then'](respondWithStatusCode(_0x269544,null))[_0x791a('0x27')](handleError(_0x269544,null));};exports[_0x791a('0xfe')]=function(_0x3652af,_0x3d9b0c){var _0x240038=moment()[_0x791a('0xff')]()[_0x791a('0x7f')]();var _0x378b15=path[_0x791a('0x80')](config[_0x791a('0xc6')],'server',_0x791a('0x100'),'tmp');var _0x1223d0=path['join'](config[_0x791a('0xc6')],_0x791a('0x101'),_0x791a('0x100'),_0x791a('0x102'));var _0xfa6eb8=path[_0x791a('0x80')](_0x378b15,_0x240038);var _0x292de0=util[_0x791a('0x5c')](_0x791a('0x103'),_0x3652af[_0x791a('0xb4')]['id'],_0x240038);var _0xf9e273=path[_0x791a('0x80')](_0x378b15,_0x292de0);var _0x552328=![];return db[_0x791a('0x39')][_0x791a('0xb2')]({'where':{'id':_0x3652af[_0x791a('0xb4')]['id']},'include':[{'model':db[_0x791a('0xcc')],'as':'Messages','attributes':['id',_0x791a('0xb3'),_0x791a('0x77'),'direction','secret'],'include':[{'model':db[_0x791a('0xce')],'as':_0x791a('0xce'),'attributes':['id',_0x791a('0xda')],'raw':!![]},{'model':db['CmContact'],'as':_0x791a('0x104'),'attributes':['id',_0x791a('0x105'),_0x791a('0x106')],'raw':!![]},{'model':db[_0x791a('0xc2')],'as':_0x791a('0xc2'),'raw':!![]}]},{'model':db[_0x791a('0xcf')],'as':_0x791a('0x107'),'attributes':['id',_0x791a('0x37')]},{'model':db[_0x791a('0xce')],'as':_0x791a('0x108'),'attributes':['id',_0x791a('0xda')]}]})[_0x791a('0x34')](handleEntityNotFound(_0x3d9b0c,null))[_0x791a('0x34')](function(_0x1ba229){if(_0x1ba229){var _0x5075b5=_0x1ba229[_0x791a('0x109')]({'plain':!![]});_0x552328=!![];var _0x40b552={'format':'A4','border':_0x791a('0x10a'),'header':{'height':_0x791a('0x10b'),'contents':{'first':'\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x791a('0x10c'),'contents':{'default':util['format'](_0x791a('0x10d'),util[_0x791a('0x5c')]('%s\x20#%d',_0x791a('0x10e'),_0x5075b5['id']),moment()['format']('YYYY-MM-DD')[_0x791a('0x7f')]())}}};fs[_0x791a('0x10f')](_0xfa6eb8);var _0x57f824={'channel':_0x791a('0x10e'),'account':_0x5075b5[_0x791a('0x107')][_0x791a('0x37')],'agent':_0x5075b5['Owner']?_0x5075b5[_0x791a('0x108')][_0x791a('0xda')]:_0x791a('0x110'),'createdAt':moment(_0x5075b5['createdAt'])[_0x791a('0x5c')](_0x791a('0xf3'))[_0x791a('0x7f')](),'closedAt':_0x5075b5['closed']?moment(_0x5075b5['closedAt'])[_0x791a('0x5c')](_0x791a('0xf3'))[_0x791a('0x7f')]():'','disposition':_0x5075b5['disposition'],'chatInfo':{'browser':_0x5075b5['browserName'],'os':_0x5075b5[_0x791a('0x111')],'referer':_0x5075b5['referer'],'customerIp':_0x5075b5['customerIp']},'messages':_(_0x5075b5[_0x791a('0xcd')])[_0x791a('0x112')]()[_0x791a('0x71')]({'secret':![]})[_0x791a('0x6f')](function(_0x36fb00){if(_0x36fb00[_0x791a('0xc2')]){var _0x21ac0b=path[_0x791a('0x80')](_0x1223d0,_0x36fb00[_0x791a('0xc2')][_0x791a('0xbf')]);if(fs[_0x791a('0x113')](_0x21ac0b)){fs[_0x791a('0x114')](_0x21ac0b)['pipe'](fs[_0x791a('0x115')](path['join'](_0xfa6eb8,_0x36fb00[_0x791a('0xc2')]['basename'])));}}return{'date':moment(_0x36fb00[_0x791a('0x77')])[_0x791a('0x5c')](_0x791a('0xf3'))[_0x791a('0x7f')](),'sender':_0x36fb00[_0x791a('0xde')]===_0x791a('0x116')?_0x36fb00[_0x791a('0xce')]?_0x36fb00['User'][_0x791a('0xda')]:'System':_0x36fb00[_0x791a('0x104')][_0x791a('0x105')]+(_0x36fb00[_0x791a('0x104')][_0x791a('0x106')]?'\x20'+_0x36fb00[_0x791a('0x104')][_0x791a('0x106')]:''),'body':_0x36fb00[_0x791a('0xc2')]?_0x36fb00[_0x791a('0xc2')][_0x791a('0xbf')]:_0x36fb00['body'],'direction':_0x36fb00[_0x791a('0xde')]===_0x791a('0x116')?'A':'C','secret':_0x36fb00[_0x791a('0xf6')],'attachment':_0x36fb00[_0x791a('0xc2')]};})['value']()};return ejs['renderFile'](path['join'](config[_0x791a('0xc6')],_0x791a('0x101'),'views',_0x791a('0x117')),{'interaction':_0x57f824})[_0x791a('0x34')](function(_0x50ab30){return new BPromise(function(_0x2a404d,_0x3cdd5e){pdf[_0x791a('0xc3')](_0x50ab30,_0x40b552)[_0x791a('0x118')](path[_0x791a('0x80')](_0xfa6eb8,'transcript-'+_0x5075b5['id']+'-'+_0x240038+_0x791a('0x119')),function(_0x44d954,_0x4367e3){if(_0x44d954)return _0x3cdd5e(_0x44d954);_0x2a404d(_0x4367e3);});});});}})[_0x791a('0x34')](function(){if(_0x552328){return new BPromise(function(_0x5dcc0a,_0xaa0f9a){zipdir(_0xfa6eb8,{'saveTo':_0xf9e273},function(_0x4ade4d,_0x1cb231){if(_0x4ade4d)return _0xaa0f9a(_0x4ade4d);return _0x5dcc0a(_0x1cb231);});})[_0x791a('0x34')](function(){return new BPromise(function(_0x19f669,_0x2b9a90){rimraf(_0xfa6eb8,function(_0x381735){if(_0x381735)_0x2b9a90(_0x381735);return _0x19f669();});});})[_0x791a('0x34')](function(){return _0x3d9b0c[_0x791a('0xfe')](_0xf9e273,_0x292de0,function(_0x399ca1){if(_0x399ca1){console[_0x791a('0x11a')]('err',_0x399ca1);}else{fs[_0x791a('0x11b')](_0xf9e273);}});});}else{return _0x3d9b0c[_0x791a('0x28')](0xc8);}})[_0x791a('0x27')](handleError(_0x3d9b0c,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 9074d07..0d70aaa 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 _0x5f37=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction'];(function(_0x2b79ae,_0x68f40){var _0x267e8a=function(_0x1da99c){while(--_0x1da99c){_0x2b79ae['push'](_0x2b79ae['shift']());}};_0x267e8a(++_0x68f40);}(_0x5f37,0x179));var _0x75f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f37[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x75f3('0x0'));var ChatInteraction=require(_0x75f3('0x1'))['db'][_0x75f3('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x75f3('0x3')](0x0);var events={'afterCreate':_0x75f3('0x4'),'afterUpdate':'update','afterDestroy':_0x75f3('0x5')};function emitEvent(_0x4c4777){return function(_0x3b4ed5,_0x3d2393,_0x71d981){ChatInteractionEvents[_0x75f3('0x6')](_0x4c4777+':'+_0x3b4ed5['id'],_0x3b4ed5);ChatInteractionEvents[_0x75f3('0x6')](_0x4c4777,_0x3b4ed5);_0x71d981(null);};}for(var e in events){if(events[_0x75f3('0x7')](e)){var event=events[e];ChatInteraction[_0x75f3('0x8')](e,emitEvent(event));}}module[_0x75f3('0x9')]=ChatInteractionEvents; \ No newline at end of file +var _0x3dbb=['ChatInteraction','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3dbb,0x103));var _0xb3db=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x3dbb[_0x2932cf];return _0x1711dd;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xb3db('0x0'))['db'][_0xb3db('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb3db('0x2')](0x0);var events={'afterCreate':_0xb3db('0x3'),'afterUpdate':_0xb3db('0x4'),'afterDestroy':_0xb3db('0x5')};function emitEvent(_0x1433fa){return function(_0xf5c7fb,_0x3c9085,_0x2315e6){ChatInteractionEvents[_0xb3db('0x6')](_0x1433fa+':'+_0xf5c7fb['id'],_0xf5c7fb);ChatInteractionEvents['emit'](_0x1433fa,_0xf5c7fb);_0x2315e6(null);};}for(var e in events){if(events[_0xb3db('0x7')](e)){var event=events[e];ChatInteraction[_0xb3db('0x8')](e,emitEvent(event));}}module[_0xb3db('0x9')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 2bc9207..d15cb1d 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 _0x5eb8=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4d394d,_0x40e7b3){_0x4d394d=_0x4d394d-0x0;var _0x4f0003=_0x5eb8[_0x4d394d];return _0x4f0003;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x448345,_0x5cd4ec,_0x2da3b0){if(_0x448345['changed'](_0x85eb('0xc'))){_0x448345[_0x85eb('0xd')]=moment()[_0x85eb('0xe')](_0x85eb('0xf'));}_0x2da3b0(null,_0x448345);}},'charset':_0x85eb('0x10'),'collate':_0x85eb('0x11')});}; \ No newline at end of file +var _0xb7e7=['closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed'];(function(_0x31caf9,_0x6c6a41){var _0x21476d=function(_0x1f1d28){while(--_0x1f1d28){_0x31caf9['push'](_0x31caf9['shift']());}};_0x21476d(++_0x6c6a41);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var 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':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42b871,_0x223587,_0x2917f9){if(_0x42b871[_0x7b7e('0x9')](_0x7b7e('0xa'))){_0x42b871[_0x7b7e('0xb')]=moment()[_0x7b7e('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2917f9(null,_0x42b871);}},'charset':_0x7b7e('0xd'),'collate':_0x7b7e('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 7bde36b..77314f8 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 _0xbf49=['ChatInteraction','update','body','options','attributes','limit','catch','AddTagsToChatInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UpdateChatInteraction'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbf49,0xae));var _0x9bf4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf49[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9bf4('0x0'));var util=require(_0x9bf4('0x1'));var moment=require(_0x9bf4('0x2'));var BPromise=require('bluebird');var rs=require(_0x9bf4('0x3'));var fs=require('fs');var Redis=require(_0x9bf4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9bf4('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9bf4('0x6'));var client=jayson[_0x9bf4('0x7')][_0x9bf4('0x8')]({'port':0x232a});config[_0x9bf4('0x9')]=_[_0x9bf4('0xa')](config[_0x9bf4('0x9')],{'host':_0x9bf4('0xb'),'port':0x18eb});var socket=require(_0x9bf4('0xc'))(new Redis(config[_0x9bf4('0x9')]));require(_0x9bf4('0xd'))[_0x9bf4('0xe')](socket);function respondWithRpcPromise(_0x229a88,_0x1ac7b5,_0xaa0e3f){return new BPromise(function(_0x59c108,_0x1a1b5a){return client['request'](_0x229a88,_0xaa0e3f)[_0x9bf4('0xf')](function(_0x25b83f){logger[_0x9bf4('0x10')](_0x9bf4('0x11'),_0x1ac7b5,'request\x20sent');logger[_0x9bf4('0x12')](_0x9bf4('0x13'),_0x1ac7b5,_0x9bf4('0x14'),JSON[_0x9bf4('0x15')](_0x25b83f));if(_0x25b83f[_0x9bf4('0x16')]){if(_0x25b83f[_0x9bf4('0x16')][_0x9bf4('0x17')]===0x1f4){logger[_0x9bf4('0x16')](_0x9bf4('0x11'),_0x1ac7b5,_0x25b83f[_0x9bf4('0x16')][_0x9bf4('0x18')]);return _0x1a1b5a(_0x25b83f['error'][_0x9bf4('0x18')]);}logger['error'](_0x9bf4('0x11'),_0x1ac7b5,_0x25b83f[_0x9bf4('0x16')]['message']);return _0x59c108(_0x25b83f[_0x9bf4('0x16')]['message']);}else{logger[_0x9bf4('0x10')](_0x9bf4('0x11'),_0x1ac7b5,'request\x20sent');_0x59c108(_0x25b83f['result']['message']);}})['catch'](function(_0x4b3507){logger[_0x9bf4('0x16')](_0x9bf4('0x11'),_0x1ac7b5,_0x4b3507);_0x1a1b5a(_0x4b3507);});});}exports[_0x9bf4('0x19')]=function(_0x4e0095){var _0x3b3b09=this;return new Promise(function(_0x494c9c,_0x529574){return db[_0x9bf4('0x1a')][_0x9bf4('0x1b')](_0x4e0095[_0x9bf4('0x1c')],{'raw':_0x4e0095[_0x9bf4('0x1d')]?_0x4e0095[_0x9bf4('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e0095[_0x9bf4('0x1d')]?_0x4e0095[_0x9bf4('0x1d')]['where']||null:null,'attributes':_0x4e0095[_0x9bf4('0x1d')]?_0x4e0095[_0x9bf4('0x1d')][_0x9bf4('0x1e')]||null:null,'limit':_0x4e0095[_0x9bf4('0x1d')]?_0x4e0095[_0x9bf4('0x1d')][_0x9bf4('0x1f')]||null:null})[_0x9bf4('0xf')](function(_0x5a73ec){logger[_0x9bf4('0x10')](_0x9bf4('0x19'),_0x4e0095);logger[_0x9bf4('0x12')](_0x9bf4('0x19'),_0x4e0095,JSON['stringify'](_0x5a73ec));_0x494c9c(_0x5a73ec);})[_0x9bf4('0x20')](function(_0x304219){logger['error'](_0x9bf4('0x19'),_0x304219[_0x9bf4('0x18')],_0x4e0095);_0x529574(_0x3b3b09[_0x9bf4('0x16')](0x1f4,_0x304219[_0x9bf4('0x18')]));});});};exports[_0x9bf4('0x21')]=function(_0x420e55){return new Promise(function(_0x2dbe21,_0x3e11b6){return db[_0x9bf4('0x1a')][_0x9bf4('0x22')]({'where':_0x420e55['options']?_0x420e55[_0x9bf4('0x1d')][_0x9bf4('0x23')]||null:null})[_0x9bf4('0xf')](function(_0x3fcfd9){if(_0x3fcfd9){return _0x3fcfd9[_0x9bf4('0x24')](_0x420e55[_0x9bf4('0x1c')][_0x9bf4('0x25')],_['omit'](_0x420e55['body'],[_0x9bf4('0x25'),'id'])||{});}})[_0x9bf4('0x26')](function(_0x2a7e8f){logger[_0x9bf4('0x10')](_0x9bf4('0x27'),_0x420e55);logger[_0x9bf4('0x12')](_0x9bf4('0x27'),_0x420e55,JSON[_0x9bf4('0x15')](_0x2a7e8f));_0x2dbe21(_0x2a7e8f);})[_0x9bf4('0x20')](function(_0x49717f){logger['error'](_0x9bf4('0x27'),_0x49717f[_0x9bf4('0x18')],_0x420e55);_0x3e11b6(_this[_0x9bf4('0x16')](0x1f4,_0x49717f[_0x9bf4('0x18')]));});});}; \ No newline at end of file +var _0xe9e4=['ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateChatInteraction','update','body','options','raw','where','limit','AddTagsToChatInteraction','ChatInteraction','addTags','omit','ids','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3b9199,_0x4b90be){var _0x11beab=function(_0x13d226){while(--_0x13d226){_0x3b9199['push'](_0x3b9199['shift']());}};_0x11beab(++_0x4b90be);}(_0xe9e4,0x163));var _0x4e9e=function(_0x469c1e,_0x885771){_0x469c1e=_0x469c1e-0x0;var _0x1fb2ca=_0xe9e4[_0x469c1e];return _0x1fb2ca;};'use strict';var _=require(_0x4e9e('0x0'));var util=require('util');var moment=require(_0x4e9e('0x1'));var BPromise=require(_0x4e9e('0x2'));var rs=require(_0x4e9e('0x3'));var fs=require('fs');var Redis=require(_0x4e9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e9e('0x5'));var logger=require('../../config/logger')(_0x4e9e('0x6'));var config=require(_0x4e9e('0x7'));var jayson=require(_0x4e9e('0x8'));var client=jayson[_0x4e9e('0x9')][_0x4e9e('0xa')]({'port':0x232a});config[_0x4e9e('0xb')]=_[_0x4e9e('0xc')](config[_0x4e9e('0xb')],{'host':_0x4e9e('0xd'),'port':0x18eb});var socket=require(_0x4e9e('0xe'))(new Redis(config[_0x4e9e('0xb')]));require(_0x4e9e('0xf'))[_0x4e9e('0x10')](socket);function respondWithRpcPromise(_0x536d8f,_0x5c406b,_0x435328){return new BPromise(function(_0x496da4,_0x5deeda){return client[_0x4e9e('0x11')](_0x536d8f,_0x435328)[_0x4e9e('0x12')](function(_0xc92673){logger[_0x4e9e('0x13')](_0x4e9e('0x14'),_0x5c406b,_0x4e9e('0x15'));logger[_0x4e9e('0x16')](_0x4e9e('0x17'),_0x5c406b,_0x4e9e('0x15'),JSON[_0x4e9e('0x18')](_0xc92673));if(_0xc92673[_0x4e9e('0x19')]){if(_0xc92673[_0x4e9e('0x19')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5c406b,_0xc92673['error'][_0x4e9e('0x1a')]);return _0x5deeda(_0xc92673['error'][_0x4e9e('0x1a')]);}logger['error'](_0x4e9e('0x14'),_0x5c406b,_0xc92673['error'][_0x4e9e('0x1a')]);return _0x496da4(_0xc92673['error'][_0x4e9e('0x1a')]);}else{logger['info'](_0x4e9e('0x14'),_0x5c406b,'request\x20sent');_0x496da4(_0xc92673['result']['message']);}})[_0x4e9e('0x1b')](function(_0x3c1957){logger[_0x4e9e('0x19')](_0x4e9e('0x14'),_0x5c406b,_0x3c1957);_0x5deeda(_0x3c1957);});});}exports[_0x4e9e('0x1c')]=function(_0x1c411f){var _0x5a38f4=this;return new Promise(function(_0x46a95a,_0x156fe5){return db['ChatInteraction'][_0x4e9e('0x1d')](_0x1c411f[_0x4e9e('0x1e')],{'raw':_0x1c411f[_0x4e9e('0x1f')]?_0x1c411f[_0x4e9e('0x1f')][_0x4e9e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c411f['options']?_0x1c411f[_0x4e9e('0x1f')][_0x4e9e('0x21')]||null:null,'attributes':_0x1c411f[_0x4e9e('0x1f')]?_0x1c411f[_0x4e9e('0x1f')]['attributes']||null:null,'limit':_0x1c411f['options']?_0x1c411f['options'][_0x4e9e('0x22')]||null:null})[_0x4e9e('0x12')](function(_0x4057e6){logger[_0x4e9e('0x13')]('UpdateChatInteraction',_0x1c411f);logger[_0x4e9e('0x16')](_0x4e9e('0x1c'),_0x1c411f,JSON[_0x4e9e('0x18')](_0x4057e6));_0x46a95a(_0x4057e6);})['catch'](function(_0x19702b){logger[_0x4e9e('0x19')](_0x4e9e('0x1c'),_0x19702b['message'],_0x1c411f);_0x156fe5(_0x5a38f4['error'](0x1f4,_0x19702b['message']));});});};exports[_0x4e9e('0x23')]=function(_0x5a1e13){return new Promise(function(_0x32f3a1,_0x5d7e2a){return db[_0x4e9e('0x24')]['find']({'where':_0x5a1e13[_0x4e9e('0x1f')]?_0x5a1e13[_0x4e9e('0x1f')][_0x4e9e('0x21')]||null:null})[_0x4e9e('0x12')](function(_0x9abbd1){if(_0x9abbd1){return _0x9abbd1[_0x4e9e('0x25')](_0x5a1e13[_0x4e9e('0x1e')]['ids'],_[_0x4e9e('0x26')](_0x5a1e13['body'],[_0x4e9e('0x27'),'id'])||{});}})[_0x4e9e('0x28')](function(_0x31670e){logger[_0x4e9e('0x13')]('AddTags',_0x5a1e13);logger[_0x4e9e('0x16')](_0x4e9e('0x29'),_0x5a1e13,JSON[_0x4e9e('0x18')](_0x31670e));_0x32f3a1(_0x31670e);})[_0x4e9e('0x1b')](function(_0x37dcf2){logger[_0x4e9e('0x19')]('AddTags',_0x37dcf2[_0x4e9e('0x1a')],_0x5a1e13);_0x5d7e2a(_this['error'](0x1f4,_0x37dcf2['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3cbb6bd..e2f0ceb 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 _0x2b4b=['remove','emit','removeListener','register','chatInteraction:','./chatInteraction.events','save'];(function(_0x37d557,_0x27a544){var _0x2baa9c=function(_0x531295){while(--_0x531295){_0x37d557['push'](_0x37d557['shift']());}};_0x2baa9c(++_0x27a544);}(_0x2b4b,0x67));var _0xb2b4=function(_0x50bcd9,_0x202be){_0x50bcd9=_0x50bcd9-0x0;var _0x328216=_0x2b4b[_0x50bcd9];return _0x328216;};'use strict';var ChatInteractionEvents=require(_0xb2b4('0x0'));var events=[_0xb2b4('0x1'),_0xb2b4('0x2'),'update'];function createListener(_0x48c506,_0x35a49b){return function(_0x534564){_0x35a49b[_0xb2b4('0x3')](_0x48c506,_0x534564);};}function removeListener(_0x1a81d8,_0xe79edc){return function(){ChatInteractionEvents[_0xb2b4('0x4')](_0x1a81d8,_0xe79edc);};}exports[_0xb2b4('0x5')]=function(_0x4c3a66){for(var _0xbd9e25=0x0,_0x25dc7d=events['length'];_0xbd9e25<_0x25dc7d;_0xbd9e25++){var _0x4a6266=events[_0xbd9e25];var _0xc368b4=createListener(_0xb2b4('0x6')+_0x4a6266,_0x4c3a66);ChatInteractionEvents['on'](_0x4a6266,_0xc368b4);}}; \ No newline at end of file +var _0x1578=['length','./chatInteraction.events','save','update','emit','removeListener'];(function(_0x5f1d32,_0x47d03f){var _0x49145a=function(_0x5744b1){while(--_0x5744b1){_0x5f1d32['push'](_0x5f1d32['shift']());}};_0x49145a(++_0x47d03f);}(_0x1578,0xfd));var _0x8157=function(_0x1b4c30,_0xbb4527){_0x1b4c30=_0x1b4c30-0x0;var _0x45e83b=_0x1578[_0x1b4c30];return _0x45e83b;};'use strict';var ChatInteractionEvents=require(_0x8157('0x0'));var events=[_0x8157('0x1'),'remove',_0x8157('0x2')];function createListener(_0x240cff,_0x161e91){return function(_0x44b21a){_0x161e91[_0x8157('0x3')](_0x240cff,_0x44b21a);};}function removeListener(_0x35e195,_0x342a5a){return function(){ChatInteractionEvents[_0x8157('0x4')](_0x35e195,_0x342a5a);};}exports['register']=function(_0xaec0f2){for(var _0x179137=0x0,_0x2d445f=events[_0x8157('0x5')];_0x179137<_0x2d445f;_0x179137++){var _0x2ffc26=events[_0x179137];var _0x115b9c=createListener('chatInteraction:'+_0x2ffc26,_0xaec0f2);ChatInteractionEvents['on'](_0x2ffc26,_0x115b9c);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 642da4f..29b5570 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 _0x69d3=['root','%s-%s','now','/:id/attachment_upload','single','file','/:id/messages','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','download','post','create','join'];(function(_0x516b2f,_0x6657dd){var _0x278753=function(_0xc3fc23){while(--_0xc3fc23){_0x516b2f['push'](_0x516b2f['shift']());}};_0x278753(++_0x6657dd);}(_0x69d3,0xda));var _0x369d=function(_0xed6c0b,_0xdd2b6f){_0xed6c0b=_0xed6c0b-0x0;var _0x4979ec=_0x69d3[_0xed6c0b];return _0x4979ec;};'use strict';var multer=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var path=require(_0x369d('0x2'));var timeout=require('connect-timeout');var express=require(_0x369d('0x3'));var router=express[_0x369d('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x369d('0x5'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x369d('0x6')](),controller[_0x369d('0x7')]);router[_0x369d('0x8')](_0x369d('0x9'),auth[_0x369d('0x6')](),controller[_0x369d('0xa')]);router[_0x369d('0x8')](_0x369d('0xb'),auth[_0x369d('0xc')](),controller['show']);router['get'](_0x369d('0xd'),auth[_0x369d('0xc')](),controller[_0x369d('0xe')]);router[_0x369d('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x369d('0xf')]);router[_0x369d('0x8')](_0x369d('0x10'),auth[_0x369d('0xc')](),controller[_0x369d('0x11')]);router[_0x369d('0x8')]('/:id/download',auth[_0x369d('0x6')](),controller[_0x369d('0x12')]);router[_0x369d('0x13')]('/',auth[_0x369d('0x6')](),controller[_0x369d('0x14')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5cd4c3,_0x5485a1,_0x2dcc39){_0x2dcc39(null,path[_0x369d('0x15')](config[_0x369d('0x16')],'server/files/attachments/'));},'filename':function(_0x2c1a4a,_0x29c1fe,_0x435c2f){_0x435c2f(null,util['format'](_0x369d('0x17'),Date[_0x369d('0x18')](),_0x29c1fe['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x369d('0x19'),upload[_0x369d('0x1a')](_0x369d('0x1b')),controller['attachmentUpload']);router[_0x369d('0x13')](_0x369d('0x1c'),auth[_0x369d('0xc')](),controller[_0x369d('0x1d')]);router[_0x369d('0x13')]('/:id/tags',auth[_0x369d('0x6')](),interaction[_0x369d('0x1e')](_0x369d('0x1f'),_0x369d('0x20')),controller[_0x369d('0x21')]);router[_0x369d('0x22')](_0x369d('0xb'),auth[_0x369d('0x6')](),interaction['tracked']('chat',_0x369d('0x23')),controller[_0x369d('0x24')]);router[_0x369d('0x22')](_0x369d('0x25'),controller[_0x369d('0x26')]);router[_0x369d('0x22')](_0x369d('0x27'),auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0x369d('0x22')](_0x369d('0x28'),controller[_0x369d('0x29')]);router[_0x369d('0x2a')](_0x369d('0xb'),auth[_0x369d('0x6')](),interaction[_0x369d('0x1e')]('chat',_0x369d('0x2b')),controller[_0x369d('0x2c')]);router[_0x369d('0x2a')](_0x369d('0x2d'),auth[_0x369d('0x6')](),controller[_0x369d('0x2e')]);module[_0x369d('0x2f')]=router; \ No newline at end of file +var _0x8f59=['get','index','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','isAuthenticated','download','post','create','diskStorage','join','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','close','delete','chatinteraction:destroy','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatInteraction.controller'];(function(_0x9260ec,_0x24083c){var _0x122945=function(_0x2c744f){while(--_0x2c744f){_0x9260ec['push'](_0x9260ec['shift']());}};_0x122945(++_0x24083c);}(_0x8f59,0x11d));var _0x98f5=function(_0x284807,_0x4be925){_0x284807=_0x284807-0x0;var _0x50c774=_0x8f59[_0x284807];return _0x50c774;};'use strict';var multer=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var path=require(_0x98f5('0x2'));var timeout=require(_0x98f5('0x3'));var express=require(_0x98f5('0x4'));var router=express[_0x98f5('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x98f5('0x6'));var config=require(_0x98f5('0x7'));var controller=require(_0x98f5('0x8'));router[_0x98f5('0x9')]('/',auth['isAuthenticated'](),controller[_0x98f5('0xa')]);router[_0x98f5('0x9')](_0x98f5('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x98f5('0x9')](_0x98f5('0xc'),auth[_0x98f5('0xd')](),controller['show']);router[_0x98f5('0x9')](_0x98f5('0xe'),auth[_0x98f5('0xd')](),controller[_0x98f5('0xf')]);router['get'](_0x98f5('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0x98f5('0x9')](_0x98f5('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x98f5('0x12')]);router[_0x98f5('0x9')](_0x98f5('0x13'),auth[_0x98f5('0x14')](),controller[_0x98f5('0x15')]);router[_0x98f5('0x16')]('/',auth['isAuthenticated'](),controller[_0x98f5('0x17')]);var upload=multer({'storage':multer[_0x98f5('0x18')]({'destination':function(_0x5b8bab,_0x9df84,_0x3d6b5c){_0x3d6b5c(null,path[_0x98f5('0x19')](config['root'],_0x98f5('0x1a')));},'filename':function(_0xc7a49b,_0x113545,_0x5bb486){_0x5bb486(null,util[_0x98f5('0x1b')](_0x98f5('0x1c'),Date['now'](),_0x113545[_0x98f5('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x98f5('0x16')](_0x98f5('0x1e'),upload[_0x98f5('0x1f')](_0x98f5('0x20')),controller[_0x98f5('0x21')]);router[_0x98f5('0x16')]('/:id/messages',auth[_0x98f5('0xd')](),controller['addMessage']);router[_0x98f5('0x16')](_0x98f5('0x22'),auth['isAuthenticated'](),interaction[_0x98f5('0x23')](_0x98f5('0x24'),_0x98f5('0x25')),controller[_0x98f5('0x26')]);router[_0x98f5('0x27')](_0x98f5('0xc'),auth[_0x98f5('0x14')](),interaction['tracked'](_0x98f5('0x24'),'chatinteraction:update'),controller[_0x98f5('0x28')]);router['put'](_0x98f5('0x29'),controller[_0x98f5('0x2a')]);router[_0x98f5('0x27')](_0x98f5('0x2b'),auth[_0x98f5('0xd')](),controller[_0x98f5('0x2c')]);router[_0x98f5('0x27')]('/:id/close',controller[_0x98f5('0x2d')]);router[_0x98f5('0x2e')]('/:id',auth[_0x98f5('0x14')](),interaction[_0x98f5('0x23')](_0x98f5('0x24'),_0x98f5('0x2f')),controller[_0x98f5('0x30')]);router[_0x98f5('0x2e')](_0x98f5('0x22'),auth[_0x98f5('0x14')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 91b8d48..44d2cff 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 _0x323f=['BOOLEAN','INTEGER','exports','medium'];(function(_0x4f9564,_0x58c61f){var _0x553afe=function(_0x441486){while(--_0x441486){_0x4f9564['push'](_0x4f9564['shift']());}};_0x553afe(++_0x58c61f);}(_0x323f,0x1ee));var _0xf323=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x323f[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require('sequelize');module[_0xf323('0x0')]={'body':{'type':Sequelize['TEXT'](_0xf323('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xf323('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf323('0x3')]}}; \ No newline at end of file +var _0x4991=['TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x38608a,_0x2599c5){var _0x2d7a03=function(_0x5bfe0f){while(--_0x5bfe0f){_0x38608a['push'](_0x38608a['shift']());}};_0x2d7a03(++_0x2599c5);}(_0x4991,0xf7));var _0x1499=function(_0x30f969,_0x405ffa){_0x30f969=_0x30f969-0x0;var _0x2d23cf=_0x4991[_0x30f969];return _0x2d23cf;};'use strict';var Sequelize=require(_0x1499('0x0'));module['exports']={'body':{'type':Sequelize[_0x1499('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1499('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x1499('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index b95752c..4bb4415 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 _0x9c44=['filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe','get','messages','lastMessageAt','createdAt','lastMessage','getUsers','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x46ddf9,_0x49ef0c){var _0x3ab9a3=function(_0x5146ee){while(--_0x5146ee){_0x46ddf9['push'](_0x46ddf9['shift']());}};_0x3ab9a3(++_0x49ef0c);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x49c4('0x0'));var zipdir=require(_0x49c4('0x1'));var jsonpatch=require(_0x49c4('0x2'));var rp=require(_0x49c4('0x3'));var moment=require(_0x49c4('0x4'));var BPromise=require(_0x49c4('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x49c4('0x6'));var sox=require('sox');var csv=require(_0x49c4('0x7'));var ejs=require(_0x49c4('0x8'));var fs=require('fs');var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0x7'));var querystring=require(_0x49c4('0xd'));var Papa=require(_0x49c4('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0xf'));var hardwareService=require(_0x49c4('0x10'));var logger=require('../../config/logger')(_0x49c4('0x11'));var utils=require(_0x49c4('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x49c4('0x13')]=_[_0x49c4('0x14')](config['redis'],{'host':_0x49c4('0x15'),'port':0x18eb});var socket=require(_0x49c4('0x16'))(new Redis(config['redis']));require(_0x49c4('0x17'))[_0x49c4('0x18')](socket);function respondWithStatusCode(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xcc;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x19')](_0x2decee);}return _0x21f15a[_0x49c4('0x1a')](_0x2decee)[_0x49c4('0x1b')]();};}function respondWithResult(_0x58d177,_0x3acd06){_0x3acd06=_0x3acd06||0xc8;return function(_0x141003){if(_0x141003){return _0x58d177[_0x49c4('0x1a')](_0x3acd06)[_0x49c4('0x1c')](_0x141003);}};}function respondWithFilteredResult(_0x2abc78,_0x53e3a2){return function(_0x44e607){if(_0x44e607){var _0x2891f4=_0x44e607[_0x49c4('0x1d')],_0x4c3253=_0x53e3a2[_0x49c4('0x1e')],_0x512650=_0x53e3a2['offset']+_0x53e3a2[_0x49c4('0x1f')],_0x3c782d;if(_0x512650>=_0x2891f4){_0x512650=_0x2891f4;_0x3c782d=0xc8;}else{_0x3c782d=0xce;}_0x2abc78['status'](_0x3c782d);return _0x2abc78[_0x49c4('0x20')](_0x49c4('0x21'),_0x4c3253+'-'+_0x512650+'/'+_0x2891f4)[_0x49c4('0x1c')](_0x44e607);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x22')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x23')](_0x280893);}return _0x382040[_0x49c4('0x24')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x25')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x26')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x1b')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x19')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x27')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x28')];}_0x210159[_0x49c4('0x1a')](_0xa7a826)[_0x49c4('0x29')](_0x531d92);};}exports[_0x49c4('0x2a')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=db[_0x49c4('0x2b')][_0x49c4('0x2c')];_0x46e04d[_0x49c4('0x2d')]=_[_0x49c4('0x2e')](_0x6329b3);_0x46e04d[_0x49c4('0x2f')]=_[_0x49c4('0x2e')](_0x5987ae['query']);_0x46e04d['filters']=_['intersection'](_0x46e04d[_0x49c4('0x2d')],_0x46e04d[_0x49c4('0x2f')]);_0x2b2793[_0x49c4('0x30')]=_[_0x49c4('0x31')](_0x46e04d[_0x49c4('0x2d')],qs['fields'](_0x5987ae[_0x49c4('0x2f')][_0x49c4('0x32')]));_0x2b2793[_0x49c4('0x30')]=_0x2b2793[_0x49c4('0x30')]['length']?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x2d')];if(!_0x5987ae[_0x49c4('0x2f')][_0x49c4('0x33')](_0x49c4('0x34'))){_0x2b2793[_0x49c4('0x1f')]=qs['limit'](_0x5987ae[_0x49c4('0x2f')][_0x49c4('0x1f')]);_0x2b2793[_0x49c4('0x1e')]=qs['offset'](_0x5987ae['query'][_0x49c4('0x1e')]);}_0x2b2793[_0x49c4('0x35')]=qs[_0x49c4('0x36')](_0x5987ae[_0x49c4('0x2f')][_0x49c4('0x36')]);_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2f')],_0x46e04d['filters']));if(_0x5987ae[_0x49c4('0x2f')]['filter']){_0x2b2793[_0x49c4('0x37')]=_[_0x49c4('0x3a')](_0x2b2793[_0x49c4('0x37')],{'$or':_[_0x49c4('0x3b')](_0x6329b3,function(_0x4ed4f8){if(_0x4ed4f8[_0x49c4('0x3c')][_0x49c4('0x3d')]!==_0x49c4('0x3e')){var _0x4e913a={};_0x4e913a[_0x4ed4f8[_0x49c4('0x3f')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2f')][_0x49c4('0x40')]+'%'};return _0x4e913a;}})});}_0x2b2793=_[_0x49c4('0x3a')]({},_0x2b2793,_0x5987ae[_0x49c4('0x41')]);var _0x24c177={'where':_0x2b2793[_0x49c4('0x37')]};return db[_0x49c4('0x2b')][_0x49c4('0x1d')](_0x24c177)[_0x49c4('0x42')](function(_0x1e506a){_0x4f28a2['count']=_0x1e506a;if(_0x5987ae[_0x49c4('0x2f')][_0x49c4('0x43')]){_0x2b2793[_0x49c4('0x44')]=[{'all':!![]}];}return db[_0x49c4('0x2b')][_0x49c4('0x45')](_0x2b2793);})[_0x49c4('0x42')](function(_0x1be62d){_0x4f28a2[_0x49c4('0x46')]=_0x1be62d;return _0x4f28a2;})[_0x49c4('0x42')](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x47')](handleError(_0x889909,null));};exports[_0x49c4('0x48')]=function(_0xa3d59e,_0x326142){var _0x4e38bc={'raw':!![],'where':{'id':_0xa3d59e['params']['id']}},_0x212366={};_0x212366[_0x49c4('0x2d')]=_[_0x49c4('0x2e')](db[_0x49c4('0x2b')][_0x49c4('0x2c')]);_0x212366[_0x49c4('0x2f')]=_[_0x49c4('0x2e')](_0xa3d59e['query']);_0x212366['filters']=_[_0x49c4('0x31')](_0x212366[_0x49c4('0x2d')],_0x212366[_0x49c4('0x2f')]);_0x4e38bc[_0x49c4('0x30')]=_['intersection'](_0x212366[_0x49c4('0x2d')],qs[_0x49c4('0x32')](_0xa3d59e[_0x49c4('0x2f')][_0x49c4('0x32')]));_0x4e38bc[_0x49c4('0x30')]=_0x4e38bc[_0x49c4('0x30')][_0x49c4('0x49')]?_0x4e38bc[_0x49c4('0x30')]:_0x212366[_0x49c4('0x2d')];if(_0xa3d59e['query'][_0x49c4('0x43')]){_0x4e38bc['include']=[{'all':!![]}];}_0x4e38bc=_[_0x49c4('0x3a')]({},_0x4e38bc,_0xa3d59e[_0x49c4('0x41')]);return db[_0x49c4('0x2b')][_0x49c4('0x4a')](_0x4e38bc)[_0x49c4('0x42')](handleEntityNotFound(_0x326142,null))['then'](respondWithResult(_0x326142,null))[_0x49c4('0x47')](handleError(_0x326142,null));};exports[_0x49c4('0x4b')]=function(_0x384862,_0x254d07){return db[_0x49c4('0x2b')][_0x49c4('0x4b')](_0x384862[_0x49c4('0x4c')],{})['then'](respondWithResult(_0x254d07,0xc9))[_0x49c4('0x47')](handleError(_0x254d07,null));};exports['update']=function(_0x3f7379,_0x906d3){if(_0x3f7379[_0x49c4('0x4c')]['id']){delete _0x3f7379[_0x49c4('0x4c')]['id'];}return db[_0x49c4('0x2b')][_0x49c4('0x4a')]({'where':{'id':_0x3f7379[_0x49c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x906d3,null))[_0x49c4('0x42')](saveUpdates(_0x3f7379[_0x49c4('0x4c')],null))['then'](respondWithResult(_0x906d3,null))[_0x49c4('0x47')](handleError(_0x906d3,null));};exports[_0x49c4('0x26')]=function(_0xfbe179,_0x242afc){return db['ChatInternalMessage']['find']({'where':{'id':_0xfbe179[_0x49c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x242afc,null))[_0x49c4('0x42')](removeEntity(_0x242afc,null))[_0x49c4('0x47')](handleError(_0x242afc,null));};exports[_0x49c4('0x4e')]=function(_0x23d500,_0x240c20){return db[_0x49c4('0x2b')][_0x49c4('0x4e')]()['then'](respondWithResult(_0x240c20,null))[_0x49c4('0x47')](handleError(_0x240c20,null));};function wrapUser(_0x1550ce){return function(_0x3936d3){var _0x3d944c=_0x1550ce[_0x49c4('0x4f')]({'plain':!![]});_0x3d944c[_0x49c4('0x50')]=[];if(_0x3936d3){_0x3d944c[_0x49c4('0x51')]=_0x3936d3[_0x49c4('0x52')];_0x3d944c[_0x49c4('0x53')]=_0x3936d3;}else{_0x3d944c[_0x49c4('0x51')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d944c[_0x49c4('0x53')]={};}return _0x3d944c;};}exports[_0x49c4('0x54')]=function(_0x527e74,_0x59a8bc,_0x77163d){var _0x4a00c5=[];return db['User'][_0x49c4('0x45')]({'where':{'role':[_0x49c4('0x55'),_0x49c4('0x56'),_0x49c4('0x57')]},'attributes':['id',_0x49c4('0x58'),_0x49c4('0x28'),_0x49c4('0x59'),'userpic',_0x49c4('0x5a'),_0x49c4('0x5b'),_0x49c4('0x5c'),_0x49c4('0x5d'),_0x49c4('0x5e')],'order':qs[_0x49c4('0x36')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x49c4('0x5f'),'attributes':['id',_0x49c4('0x28'),_0x49c4('0x3c')],'through':{'attributes':[]}}]})[_0x49c4('0x42')](function(_0x23288e){if(_0x23288e){var _0x6b2592=_0x527e74[_0x49c4('0x57')]['get']({'plain':!![]});if(!_0x6b2592)throw new Error(_0x49c4('0x60'));if(_0x6b2592[_0x49c4('0x59')]==='user'){return db[_0x49c4('0x61')]['find']({'where':{'name':_0x49c4('0x62'),'userProfileId':_0x6b2592[_0x49c4('0x63')]},'raw':!![]})[_0x49c4('0x42')](function(_0x2fe89a){if(_0x2fe89a){if(_0x2fe89a[_0x49c4('0x64')]===0x0){return db[_0x49c4('0x65')][_0x49c4('0x45')]({'where':{'sectionId':_0x2fe89a['id']},'raw':!![]})[_0x49c4('0x42')](function(_0x483770){var _0x3894e0=[];if(_[_0x49c4('0x66')](_0x483770)){_0x3894e0=_['filter'](_0x23288e,function(_0x10dec7){if(_0x10dec7[_0x49c4('0x59')]!=='agent'){return _0x10dec7;}});return _0x3894e0;}else{for(var _0x39c455=0x0;_0x39c455<_0x23288e[_0x49c4('0x49')];_0x39c455++){var _0x4f50bf=_0x23288e[_0x39c455];if(_0x4f50bf['role']==='agent'){var _0x513879=_[_0x49c4('0x4a')](_0x483770,function(_0x54947d){return _0x54947d[_0x49c4('0x67')]===_0x4f50bf['id'];});if(_0x513879)_0x3894e0[_0x49c4('0x68')](_0x4f50bf);}else{_0x3894e0['push'](_0x4f50bf);}}return _0x3894e0;}});}else{return _0x23288e;}}else{var _0x679134=_[_0x49c4('0x40')](_0x23288e,function(_0x5ac9f0){if(_0x5ac9f0[_0x49c4('0x59')]!==_0x49c4('0x55')){return _0x5ac9f0;}});return _0x679134;}});}else{return _0x23288e;}}})[_0x49c4('0x42')](function(_0x35f46f){var _0x4fd9a1=[];if(_0x35f46f){_0x4a00c5=_0x35f46f;for(var _0x431921=0x0;_0x431921<_0x35f46f[_0x49c4('0x49')];_0x431921+=0x1){_0x4a00c5[_0x431921][_0x49c4('0x50')]=[];_0x4fd9a1[_0x49c4('0x68')](db['ChatInternalMessage'][_0x49c4('0x4a')]({'where':{'FromId':[_0x527e74['user']['id'],_0x35f46f[_0x431921]['id']],'ToId':[_0x527e74['user']['id'],_0x35f46f[_0x431921]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x49c4('0x69'),_0x49c4('0x6a'),_0x49c4('0x4c')],'order':qs[_0x49c4('0x36')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x35f46f[_0x431921])));}return BPromise[_0x49c4('0x6b')](_0x4fd9a1);}return[];})[_0x49c4('0x42')](function(_0x342326){return{'rows':_0x342326,'count':_0x342326[_0x49c4('0x49')]};})[_0x49c4('0x42')](respondWithResult(_0x59a8bc,null))[_0x49c4('0x47')](handleError(_0x59a8bc,null));}; \ No newline at end of file +var _0x4b84=['messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','FromId','read','-createdAt','all','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','status','end','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','ChatInternalMessage','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe'];(function(_0x33b405,_0xf46007){var _0x215f11=function(_0x349dc9){while(--_0x349dc9){_0x33b405['push'](_0x33b405['shift']());}};_0x215f11(++_0xf46007);}(_0x4b84,0x1cc));var _0x44b8=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x4b84[_0x175a55];return _0x167adf;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var hardwareService=require(_0x44b8('0xd'));var logger=require(_0x44b8('0xe'))(_0x44b8('0xf'));var utils=require(_0x44b8('0x10'));var config=require(_0x44b8('0x11'));var db=require(_0x44b8('0x12'))['db'];config['redis']=_[_0x44b8('0x13')](config[_0x44b8('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x44b8('0x15'))(new Redis(config['redis']));require(_0x44b8('0x16'))[_0x44b8('0x17')](socket);function respondWithStatusCode(_0x4df670,_0x63e8f6){_0x63e8f6=_0x63e8f6||0xcc;return function(_0x4be54c){if(_0x4be54c){return _0x4df670['sendStatus'](_0x63e8f6);}return _0x4df670[_0x44b8('0x18')](_0x63e8f6)[_0x44b8('0x19')]();};}function respondWithResult(_0x1722da,_0x41ab46){_0x41ab46=_0x41ab46||0xc8;return function(_0x5e52f2){if(_0x5e52f2){return _0x1722da['status'](_0x41ab46)['json'](_0x5e52f2);}};}function respondWithFilteredResult(_0x3fe9fb,_0x5b7803){return function(_0x28ef36){if(_0x28ef36){var _0x31651b=_0x28ef36['count'],_0x55e258=_0x5b7803[_0x44b8('0x1a')],_0x36743e=_0x5b7803[_0x44b8('0x1a')]+_0x5b7803['limit'],_0xe3de8f;if(_0x36743e>=_0x31651b){_0x36743e=_0x31651b;_0xe3de8f=0xc8;}else{_0xe3de8f=0xce;}_0x3fe9fb[_0x44b8('0x18')](_0xe3de8f);return _0x3fe9fb[_0x44b8('0x1b')](_0x44b8('0x1c'),_0x55e258+'-'+_0x36743e+'/'+_0x31651b)[_0x44b8('0x1d')](_0x28ef36);}return null;};}function patchUpdates(_0x102ef9){return function(_0x369c09){try{jsonpatch[_0x44b8('0x1e')](_0x369c09,_0x102ef9,!![]);}catch(_0x9b0536){return BPromise[_0x44b8('0x1f')](_0x9b0536);}return _0x369c09[_0x44b8('0x20')]();};}function saveUpdates(_0x1d642b,_0x14996c){return function(_0x48327e){if(_0x48327e){return _0x48327e[_0x44b8('0x21')](_0x1d642b)[_0x44b8('0x22')](function(_0x416b34){return _0x416b34;});}return null;};}function removeEntity(_0x1418db,_0x305a5c){return function(_0x51a34a){if(_0x51a34a){return _0x51a34a[_0x44b8('0x23')]()['then'](function(){_0x1418db[_0x44b8('0x18')](0xcc)[_0x44b8('0x19')]();});}};}function handleEntityNotFound(_0x25a0c1,_0x47689e){return function(_0x230a3d){if(!_0x230a3d){_0x25a0c1['sendStatus'](0x194);}return _0x230a3d;};}function handleError(_0x474f01,_0x502acf){_0x502acf=_0x502acf||0x1f4;return function(_0x41d673){logger[_0x44b8('0x24')](_0x41d673['stack']);if(_0x41d673[_0x44b8('0x25')]){delete _0x41d673[_0x44b8('0x25')];}_0x474f01[_0x44b8('0x18')](_0x502acf)['send'](_0x41d673);};}exports[_0x44b8('0x26')]=function(_0x242342,_0x53d9c7){var _0x2e0174={},_0x4a182d={},_0xfb0028={'count':0x0,'rows':[]};var _0x5a544c=db['ChatInternalMessage']['rawAttributes'];_0x4a182d[_0x44b8('0x27')]=_[_0x44b8('0x28')](_0x5a544c);_0x4a182d[_0x44b8('0x29')]=_[_0x44b8('0x28')](_0x242342[_0x44b8('0x29')]);_0x4a182d[_0x44b8('0x2a')]=_[_0x44b8('0x2b')](_0x4a182d[_0x44b8('0x27')],_0x4a182d[_0x44b8('0x29')]);_0x2e0174[_0x44b8('0x2c')]=_[_0x44b8('0x2b')](_0x4a182d[_0x44b8('0x27')],qs[_0x44b8('0x2d')](_0x242342['query'][_0x44b8('0x2d')]));_0x2e0174['attributes']=_0x2e0174[_0x44b8('0x2c')][_0x44b8('0x2e')]?_0x2e0174[_0x44b8('0x2c')]:_0x4a182d[_0x44b8('0x27')];if(!_0x242342[_0x44b8('0x29')]['hasOwnProperty'](_0x44b8('0x2f'))){_0x2e0174[_0x44b8('0x30')]=qs[_0x44b8('0x30')](_0x242342[_0x44b8('0x29')][_0x44b8('0x30')]);_0x2e0174['offset']=qs[_0x44b8('0x1a')](_0x242342[_0x44b8('0x29')][_0x44b8('0x1a')]);}_0x2e0174[_0x44b8('0x31')]=qs[_0x44b8('0x32')](_0x242342[_0x44b8('0x29')][_0x44b8('0x32')]);_0x2e0174[_0x44b8('0x33')]=qs[_0x44b8('0x2a')](_[_0x44b8('0x34')](_0x242342[_0x44b8('0x29')],_0x4a182d[_0x44b8('0x2a')]));if(_0x242342[_0x44b8('0x29')][_0x44b8('0x35')]){_0x2e0174[_0x44b8('0x33')]=_[_0x44b8('0x36')](_0x2e0174[_0x44b8('0x33')],{'$or':_[_0x44b8('0x37')](_0x5a544c,function(_0x28faa9){if(_0x28faa9[_0x44b8('0x38')][_0x44b8('0x39')]!==_0x44b8('0x3a')){var _0x59848c={};_0x59848c[_0x28faa9[_0x44b8('0x3b')]]={'$like':'%'+_0x242342[_0x44b8('0x29')]['filter']+'%'};return _0x59848c;}})});}_0x2e0174=_[_0x44b8('0x36')]({},_0x2e0174,_0x242342[_0x44b8('0x3c')]);var _0x6658be={'where':_0x2e0174[_0x44b8('0x33')]};return db['ChatInternalMessage'][_0x44b8('0x3d')](_0x6658be)[_0x44b8('0x22')](function(_0x3611b4){_0xfb0028[_0x44b8('0x3d')]=_0x3611b4;if(_0x242342[_0x44b8('0x29')][_0x44b8('0x3e')]){_0x2e0174[_0x44b8('0x3f')]=[{'all':!![]}];}return db[_0x44b8('0x40')][_0x44b8('0x41')](_0x2e0174);})[_0x44b8('0x22')](function(_0x1c9983){_0xfb0028[_0x44b8('0x42')]=_0x1c9983;return _0xfb0028;})[_0x44b8('0x22')](respondWithFilteredResult(_0x53d9c7,_0x2e0174))[_0x44b8('0x43')](handleError(_0x53d9c7,null));};exports[_0x44b8('0x44')]=function(_0x29b43f,_0x57d8c4){var _0x12a0a4={'raw':!![],'where':{'id':_0x29b43f[_0x44b8('0x45')]['id']}},_0x43e43a={};_0x43e43a['model']=_[_0x44b8('0x28')](db[_0x44b8('0x40')][_0x44b8('0x46')]);_0x43e43a['query']=_[_0x44b8('0x28')](_0x29b43f[_0x44b8('0x29')]);_0x43e43a[_0x44b8('0x2a')]=_[_0x44b8('0x2b')](_0x43e43a[_0x44b8('0x27')],_0x43e43a['query']);_0x12a0a4['attributes']=_[_0x44b8('0x2b')](_0x43e43a[_0x44b8('0x27')],qs[_0x44b8('0x2d')](_0x29b43f[_0x44b8('0x29')][_0x44b8('0x2d')]));_0x12a0a4[_0x44b8('0x2c')]=_0x12a0a4[_0x44b8('0x2c')][_0x44b8('0x2e')]?_0x12a0a4[_0x44b8('0x2c')]:_0x43e43a[_0x44b8('0x27')];if(_0x29b43f[_0x44b8('0x29')][_0x44b8('0x3e')]){_0x12a0a4[_0x44b8('0x3f')]=[{'all':!![]}];}_0x12a0a4=_[_0x44b8('0x36')]({},_0x12a0a4,_0x29b43f[_0x44b8('0x3c')]);return db[_0x44b8('0x40')][_0x44b8('0x47')](_0x12a0a4)[_0x44b8('0x22')](handleEntityNotFound(_0x57d8c4,null))[_0x44b8('0x22')](respondWithResult(_0x57d8c4,null))['catch'](handleError(_0x57d8c4,null));};exports['create']=function(_0x3b1b12,_0x1df74b){return db[_0x44b8('0x40')][_0x44b8('0x48')](_0x3b1b12[_0x44b8('0x49')],{})[_0x44b8('0x22')](respondWithResult(_0x1df74b,0xc9))[_0x44b8('0x43')](handleError(_0x1df74b,null));};exports['update']=function(_0x156070,_0x53edca){if(_0x156070[_0x44b8('0x49')]['id']){delete _0x156070[_0x44b8('0x49')]['id'];}return db[_0x44b8('0x40')][_0x44b8('0x47')]({'where':{'id':_0x156070[_0x44b8('0x45')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x53edca,null))['then'](saveUpdates(_0x156070[_0x44b8('0x49')],null))[_0x44b8('0x22')](respondWithResult(_0x53edca,null))[_0x44b8('0x43')](handleError(_0x53edca,null));};exports[_0x44b8('0x23')]=function(_0x4ccc77,_0x4e4ed1){return db[_0x44b8('0x40')][_0x44b8('0x47')]({'where':{'id':_0x4ccc77[_0x44b8('0x45')]['id']}})[_0x44b8('0x22')](handleEntityNotFound(_0x4e4ed1,null))[_0x44b8('0x22')](removeEntity(_0x4e4ed1,null))['catch'](handleError(_0x4e4ed1,null));};exports[_0x44b8('0x4a')]=function(_0x450715,_0x2c5c27){return db[_0x44b8('0x40')][_0x44b8('0x4a')]()['then'](respondWithResult(_0x2c5c27,null))['catch'](handleError(_0x2c5c27,null));};function wrapUser(_0x2516fc){return function(_0x4eb344){var _0x2d9f89=_0x2516fc['get']({'plain':!![]});_0x2d9f89[_0x44b8('0x4b')]=[];if(_0x4eb344){_0x2d9f89[_0x44b8('0x4c')]=_0x4eb344[_0x44b8('0x4d')];_0x2d9f89[_0x44b8('0x4e')]=_0x4eb344;}else{_0x2d9f89[_0x44b8('0x4c')]=moment(0x0)[_0x44b8('0x4f')](_0x44b8('0x50'));_0x2d9f89['lastMessage']={};}return _0x2d9f89;};}exports[_0x44b8('0x51')]=function(_0x37b2c2,_0x1e6a5e,_0x492be6){var _0x20bcc8=[];return db[_0x44b8('0x52')][_0x44b8('0x41')]({'where':{'role':[_0x44b8('0x53'),'admin',_0x44b8('0x54')]},'attributes':['id',_0x44b8('0x55'),'name',_0x44b8('0x56'),_0x44b8('0x57'),_0x44b8('0x58'),_0x44b8('0x59'),_0x44b8('0x5a'),'allowmessenger','showWebBar'],'order':qs[_0x44b8('0x32')](_0x44b8('0x5b')),'include':[{'model':db[_0x44b8('0x5c')],'as':_0x44b8('0x5d'),'attributes':['id',_0x44b8('0x25'),_0x44b8('0x38')],'through':{'attributes':[]}}]})[_0x44b8('0x22')](function(_0xf0fb0d){if(_0xf0fb0d){var _0x10bbd9=_0x37b2c2[_0x44b8('0x54')][_0x44b8('0x5e')]({'plain':!![]});if(!_0x10bbd9)throw new Error(_0x44b8('0x5f'));if(_0x10bbd9['role']===_0x44b8('0x54')){return db[_0x44b8('0x60')][_0x44b8('0x47')]({'where':{'name':_0x44b8('0x61'),'userProfileId':_0x10bbd9[_0x44b8('0x62')]},'raw':!![]})[_0x44b8('0x22')](function(_0x426a6a){if(_0x426a6a){if(_0x426a6a[_0x44b8('0x63')]===0x0){return db[_0x44b8('0x64')][_0x44b8('0x41')]({'where':{'sectionId':_0x426a6a['id']},'raw':!![]})[_0x44b8('0x22')](function(_0x15bcba){var _0x1da152=[];if(_[_0x44b8('0x65')](_0x15bcba)){_0x1da152=_[_0x44b8('0x35')](_0xf0fb0d,function(_0x293c2e){if(_0x293c2e[_0x44b8('0x56')]!==_0x44b8('0x53')){return _0x293c2e;}});return _0x1da152;}else{for(var _0x4cf835=0x0;_0x4cf835<_0xf0fb0d[_0x44b8('0x2e')];_0x4cf835++){var _0x3aac51=_0xf0fb0d[_0x4cf835];if(_0x3aac51[_0x44b8('0x56')]===_0x44b8('0x53')){var _0x51f763=_[_0x44b8('0x47')](_0x15bcba,function(_0x2ecf65){return _0x2ecf65['resourceId']===_0x3aac51['id'];});if(_0x51f763)_0x1da152[_0x44b8('0x66')](_0x3aac51);}else{_0x1da152[_0x44b8('0x66')](_0x3aac51);}}return _0x1da152;}});}else{return _0xf0fb0d;}}else{var _0x5df821=_[_0x44b8('0x35')](_0xf0fb0d,function(_0x3354bd){if(_0x3354bd['role']!==_0x44b8('0x53')){return _0x3354bd;}});return _0x5df821;}});}else{return _0xf0fb0d;}}})[_0x44b8('0x22')](function(_0x370618){var _0x5d7c9b=[];if(_0x370618){_0x20bcc8=_0x370618;for(var _0x16e790=0x0;_0x16e790<_0x370618['length'];_0x16e790+=0x1){_0x20bcc8[_0x16e790][_0x44b8('0x4b')]=[];_0x5d7c9b['push'](db[_0x44b8('0x40')][_0x44b8('0x47')]({'where':{'FromId':[_0x37b2c2[_0x44b8('0x54')]['id'],_0x370618[_0x16e790]['id']],'ToId':[_0x37b2c2[_0x44b8('0x54')]['id'],_0x370618[_0x16e790]['id']],'ChatGroupId':null},'attributes':['id',_0x44b8('0x4d'),_0x44b8('0x67'),'ToId',_0x44b8('0x68'),'body'],'order':qs[_0x44b8('0x32')](_0x44b8('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x370618[_0x16e790])));}return BPromise[_0x44b8('0x6a')](_0x5d7c9b);}return[];})[_0x44b8('0x22')](function(_0x1cf31f){return{'rows':_0x1cf31f,'count':_0x1cf31f[_0x44b8('0x2e')]};})[_0x44b8('0x22')](respondWithResult(_0x1e6a5e,null))[_0x44b8('0x43')](handleError(_0x1e6a5e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 8c0b8fa..747888d 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 _0x8cb2=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3aaf33,_0x4c56fe){var _0x281a10=function(_0x59b17b){while(--_0x59b17b){_0x3aaf33['push'](_0x3aaf33['shift']());}};_0x281a10(++_0x4c56fe);}(_0x8cb2,0xea));var _0x28cb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8cb2[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0x28cb('0x0'));var ChatInternalMessage=require(_0x28cb('0x1'))['db'][_0x28cb('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x28cb('0x3')](0x0);var events={'afterCreate':_0x28cb('0x4'),'afterUpdate':'update','afterDestroy':_0x28cb('0x5')};function emitEvent(_0x11799e){return function(_0x4befc9,_0x2c9fa9,_0x18ea46){ChatInternalMessageEvents[_0x28cb('0x6')](_0x11799e+':'+_0x4befc9['id'],_0x4befc9);ChatInternalMessageEvents[_0x28cb('0x6')](_0x11799e,_0x4befc9);_0x18ea46(null);};}for(var e in events){if(events[_0x28cb('0x7')](e)){var event=events[e];ChatInternalMessage[_0x28cb('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x8cd3=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x8cd3,0x1d0));var _0x38cd=function(_0x382168,_0xe03b6a){_0x382168=_0x382168-0x0;var _0x3ecf7e=_0x8cd3[_0x382168];return _0x3ecf7e;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x38cd('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x38cd('0x1')](0x0);var events={'afterCreate':_0x38cd('0x2'),'afterUpdate':_0x38cd('0x3'),'afterDestroy':_0x38cd('0x4')};function emitEvent(_0x406707){return function(_0x977a34,_0x389c45,_0x189c97){ChatInternalMessageEvents[_0x38cd('0x5')](_0x406707+':'+_0x977a34['id'],_0x977a34);ChatInternalMessageEvents['emit'](_0x406707,_0x977a34);_0x189c97(null);};}for(var e in events){if(events[_0x38cd('0x6')](e)){var event=events[e];ChatInternalMessage[_0x38cd('0x7')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 8e88dc6..236e09d 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 _0xb88c=['path','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment'];(function(_0x2bf005,_0x42f911){var _0x1a9994=function(_0x2c26ca){while(--_0x2c26ca){_0x2bf005['push'](_0x2bf005['shift']());}};_0x1a9994(++_0x42f911);}(_0xb88c,0x147));var _0xcb88=function(_0x17925d,_0x46543f){_0x17925d=_0x17925d-0x0;var _0x5492b7=_0xb88c[_0x17925d];return _0x5492b7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcb88('0x0'))(_0xcb88('0x1'));var moment=require(_0xcb88('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcb88('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcb88('0x4'));module[_0xcb88('0x5')]=function(_0x4f9da8,_0x1d74b5){return _0x4f9da8['define'](_0xcb88('0x6'),attributes,{'tableName':_0xcb88('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb88('0x8'),'collate':_0xcb88('0x9')});}; \ No newline at end of file +var _0x12a7=['rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x13b8ef,_0x3e54b7){var _0x36c172=function(_0xdef8f1){while(--_0xdef8f1){_0x13b8ef['push'](_0x13b8ef['shift']());}};_0x36c172(++_0x3e54b7);}(_0x12a7,0x144));var _0x712a=function(_0xad7409,_0x325083){_0xad7409=_0xad7409-0x0;var _0x4560a9=_0x12a7[_0xad7409];return _0x4560a9;};'use strict';var _=require(_0x712a('0x0'));var util=require('util');var logger=require(_0x712a('0x1'))(_0x712a('0x2'));var moment=require(_0x712a('0x3'));var BPromise=require('bluebird');var rp=require(_0x712a('0x4'));var fs=require('fs');var path=require(_0x712a('0x5'));var rimraf=require(_0x712a('0x6'));var config=require(_0x712a('0x7'));var attributes=require(_0x712a('0x8'));module[_0x712a('0x9')]=function(_0x1e8e37,_0x13eef5){return _0x1e8e37[_0x712a('0xa')](_0x712a('0xb'),attributes,{'tableName':_0x712a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x712a('0xd'),'collate':_0x712a('0xe')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 2fef553..f8bab64 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 _0x5825=['debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','socket.io-emitter','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x5825,0xb5));var _0x5582=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5825[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x5582('0x0'));var util=require(_0x5582('0x1'));var moment=require(_0x5582('0x2'));var BPromise=require('bluebird');var rs=require(_0x5582('0x3'));var fs=require('fs');var Redis=require(_0x5582('0x4'));var db=require(_0x5582('0x5'))['db'];var utils=require(_0x5582('0x6'));var logger=require(_0x5582('0x7'))(_0x5582('0x8'));var config=require(_0x5582('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5582('0xa')]['http']({'port':0x232a});config['redis']=_[_0x5582('0xb')](config[_0x5582('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5582('0xd'))(new Redis(config[_0x5582('0xc')]));require('./chatInternalMessage.socket')[_0x5582('0xe')](socket);function respondWithRpcPromise(_0xc555c3,_0x2039c5,_0x5be487){return new BPromise(function(_0x294445,_0x56ecbb){return client['request'](_0xc555c3,_0x5be487)[_0x5582('0xf')](function(_0x209cfd){logger[_0x5582('0x10')](_0x5582('0x11'),_0x2039c5,_0x5582('0x12'));logger[_0x5582('0x13')](_0x5582('0x14'),_0x2039c5,_0x5582('0x12'),JSON[_0x5582('0x15')](_0x209cfd));if(_0x209cfd['error']){if(_0x209cfd[_0x5582('0x16')]['code']===0x1f4){logger['error'](_0x5582('0x11'),_0x2039c5,_0x209cfd[_0x5582('0x16')][_0x5582('0x17')]);return _0x56ecbb(_0x209cfd[_0x5582('0x16')][_0x5582('0x17')]);}logger[_0x5582('0x16')](_0x5582('0x11'),_0x2039c5,_0x209cfd['error'][_0x5582('0x17')]);return _0x294445(_0x209cfd['error'][_0x5582('0x17')]);}else{logger[_0x5582('0x10')](_0x5582('0x11'),_0x2039c5,_0x5582('0x12'));_0x294445(_0x209cfd[_0x5582('0x18')][_0x5582('0x17')]);}})['catch'](function(_0x403744){logger[_0x5582('0x16')](_0x5582('0x11'),_0x2039c5,_0x403744);_0x56ecbb(_0x403744);});});} \ No newline at end of file +var _0x4a2e=['then','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x4a2e,0x87));var _0xe4a2=function(_0xfb9aaa,_0x37935d){_0xfb9aaa=_0xfb9aaa-0x0;var _0x103bf7=_0x4a2e[_0xfb9aaa];return _0x103bf7;};'use strict';var _=require(_0xe4a2('0x0'));var util=require(_0xe4a2('0x1'));var moment=require(_0xe4a2('0x2'));var BPromise=require(_0xe4a2('0x3'));var rs=require(_0xe4a2('0x4'));var fs=require('fs');var Redis=require(_0xe4a2('0x5'));var db=require(_0xe4a2('0x6'))['db'];var utils=require(_0xe4a2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4a2('0x8')][_0xe4a2('0x9')]({'port':0x232a});config['redis']=_[_0xe4a2('0xa')](config[_0xe4a2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe4a2('0xc'))(new Redis(config[_0xe4a2('0xb')]));require(_0xe4a2('0xd'))[_0xe4a2('0xe')](socket);function respondWithRpcPromise(_0x26e783,_0xb7de6e,_0x2c9dcf){return new BPromise(function(_0x5f504d,_0x89357c){return client['request'](_0x26e783,_0x2c9dcf)[_0xe4a2('0xf')](function(_0xed338e){logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xb7de6e,'request\x20sent');logger[_0xe4a2('0x10')](_0xe4a2('0x11'),_0xb7de6e,'request\x20sent',JSON[_0xe4a2('0x12')](_0xed338e));if(_0xed338e[_0xe4a2('0x13')]){if(_0xed338e[_0xe4a2('0x13')]['code']===0x1f4){logger[_0xe4a2('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0xb7de6e,_0xed338e['error']['message']);return _0x89357c(_0xed338e[_0xe4a2('0x13')]['message']);}logger[_0xe4a2('0x13')](_0xe4a2('0x14'),_0xb7de6e,_0xed338e[_0xe4a2('0x13')][_0xe4a2('0x15')]);return _0x5f504d(_0xed338e[_0xe4a2('0x13')][_0xe4a2('0x15')]);}else{logger[_0xe4a2('0x16')](_0xe4a2('0x14'),_0xb7de6e,'request\x20sent');_0x5f504d(_0xed338e[_0xe4a2('0x17')][_0xe4a2('0x15')]);}})[_0xe4a2('0x18')](function(_0x2e6be3){logger['error'](_0xe4a2('0x14'),_0xb7de6e,_0x2e6be3);_0x89357c(_0x2e6be3);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 9c8f683..51e8810 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 _0xb926=['chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x1ca93c,_0x3271ab){var _0x185169=function(_0x507763){while(--_0x507763){_0x1ca93c['push'](_0x1ca93c['shift']());}};_0x185169(++_0x3271ab);}(_0xb926,0xc7));var _0x6b92=function(_0x5774d8,_0x49533c){_0x5774d8=_0x5774d8-0x0;var _0x164bcc=_0xb926[_0x5774d8];return _0x164bcc;};'use strict';var ChatInternalMessageEvents=require(_0x6b92('0x0'));var events=[_0x6b92('0x1'),_0x6b92('0x2'),_0x6b92('0x3')];function createListener(_0x2eb8a8,_0x2cd642){return function(_0x25ed30){_0x2cd642[_0x6b92('0x4')](_0x2eb8a8,_0x25ed30);};}function removeListener(_0x5ccc4d,_0x3a0cef){return function(){ChatInternalMessageEvents[_0x6b92('0x5')](_0x5ccc4d,_0x3a0cef);};}exports[_0x6b92('0x6')]=function(_0x1c4339){for(var _0x7d2091=0x0,_0x3a7f93=events[_0x6b92('0x7')];_0x7d2091<_0x3a7f93;_0x7d2091++){var _0x4f168b=events[_0x7d2091];var _0x53a7d2=createListener(_0x6b92('0x8')+_0x4f168b,_0x1c4339);ChatInternalMessageEvents['on'](_0x4f168b,_0x53a7d2);}}; \ No newline at end of file +var _0xacad=['update','removeListener','register','chatInternalMessage:','save','remove'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xacad,0xf4));var _0xdaca=function(_0x18518e,_0x1cc0aa){_0x18518e=_0x18518e-0x0;var _0x3a9640=_0xacad[_0x18518e];return _0x3a9640;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xdaca('0x0'),_0xdaca('0x1'),_0xdaca('0x2')];function createListener(_0x2524b9,_0x64aa7c){return function(_0x523f37){_0x64aa7c['emit'](_0x2524b9,_0x523f37);};}function removeListener(_0x29a41d,_0x11a3ca){return function(){ChatInternalMessageEvents[_0xdaca('0x3')](_0x29a41d,_0x11a3ca);};}exports[_0xdaca('0x4')]=function(_0x3b54db){for(var _0x5e74eb=0x0,_0x562bc1=events['length'];_0x5e74eb<_0x562bc1;_0x5e74eb++){var _0xed0fb0=events[_0x5e74eb];var _0x42462b=createListener(_0xdaca('0x5')+_0xed0fb0,_0x3b54db);ChatInternalMessageEvents['on'](_0xed0fb0,_0x42462b);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 036a0b4..4284fed 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 _0x2ef3=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/users','getUsers','/:id','create','put','delete','exports','multer','util','path','connect-timeout'];(function(_0x4af10e,_0x7d37f3){var _0x5780f7=function(_0x54487b){while(--_0x54487b){_0x4af10e['push'](_0x4af10e['shift']());}};_0x5780f7(++_0x7d37f3);}(_0x2ef3,0xba));var _0x32ef=function(_0x25395e,_0x496a70){_0x25395e=_0x25395e-0x0;var _0x122e8b=_0x2ef3[_0x25395e];return _0x122e8b;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./chatInternalMessage.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['show']);router['post']('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router[_0x32ef('0x10')](_0x32ef('0xe'),controller['update']);router[_0x32ef('0x11')]('/:id',auth[_0x32ef('0x9')](),controller['destroy']);module[_0x32ef('0x12')]=router; \ No newline at end of file +var _0x8f04=['/describe','describe','/users','getUsers','/:id','show','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','./chatInternalMessage.controller','isAuthenticated','index','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f04,0xbc));var _0x48f0=function(_0xb3fed2,_0x286a73){_0xb3fed2=_0xb3fed2-0x0;var _0x11692d=_0x8f04[_0xb3fed2];return _0x11692d;};'use strict';var multer=require(_0x48f0('0x0'));var util=require(_0x48f0('0x1'));var path=require(_0x48f0('0x2'));var timeout=require(_0x48f0('0x3'));var express=require('express');var router=express[_0x48f0('0x4')]();var auth=require(_0x48f0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x48f0('0x6'));router['get']('/',auth[_0x48f0('0x7')](),controller[_0x48f0('0x8')]);router[_0x48f0('0x9')](_0x48f0('0xa'),auth[_0x48f0('0x7')](),controller[_0x48f0('0xb')]);router[_0x48f0('0x9')](_0x48f0('0xc'),auth[_0x48f0('0x7')](),controller[_0x48f0('0xd')]);router[_0x48f0('0x9')](_0x48f0('0xe'),auth[_0x48f0('0x7')](),controller[_0x48f0('0xf')]);router['post']('/',auth[_0x48f0('0x7')](),controller['create']);router['put'](_0x48f0('0xe'),controller[_0x48f0('0x10')]);router[_0x48f0('0x11')](_0x48f0('0xe'),auth[_0x48f0('0x7')](),controller['destroy']);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 3def0d2..3c3862d 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 _0x1f2a=['DATE','sequelize','exports','medium','BOOLEAN','out'];(function(_0x13eaaa,_0x217626){var _0x36ed6c=function(_0xd48896){while(--_0xd48896){_0x13eaaa['push'](_0x13eaaa['shift']());}};_0x36ed6c(++_0x217626);}(_0x1f2a,0x12d));var _0xa1f2=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x1f2a[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0xa1f2('0x0'));module[_0xa1f2('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa1f2('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa1f2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa1f2('0x4')),'defaultValue':_0xa1f2('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa1f2('0x5')]}}; \ No newline at end of file +var _0xdff9=['DATE','exports','TEXT','BOOLEAN','ENUM','out'];(function(_0x52a12a,_0x19ffde){var _0xf034fb=function(_0x6edf4c){while(--_0x6edf4c){_0x52a12a['push'](_0x52a12a['shift']());}};_0xf034fb(++_0x19ffde);}(_0xdff9,0x15d));var _0x9dff=function(_0x2b1a78,_0x539d69){_0x2b1a78=_0x2b1a78-0x0;var _0x264e5d=_0xdff9[_0x2b1a78];return _0x264e5d;};'use strict';var Sequelize=require('sequelize');module[_0x9dff('0x0')]={'body':{'type':Sequelize[_0x9dff('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9dff('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9dff('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9dff('0x3')]('in','out'),'defaultValue':_0x9dff('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9dff('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3364331..f1a96dd 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 _0xe349=['format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','interaction','user','role','null','AcceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','map','VIRTUAL','field','ChatMessage','count','includeAll','include','findAll','catch','show','params','options','create','body','find','describe','chat-interactions','accept','chat','read','readAt'];(function(_0x1e04f6,_0x1e13ce){var _0x15131b=function(_0x4435ed){while(--_0x4435ed){_0x1e04f6['push'](_0x1e04f6['shift']());}};_0x15131b(++_0x1e13ce);}(_0xe349,0x107));var _0x9e34=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0xe349[_0xee5d2a];return _0x346948;};'use strict';var pdf=require(_0x9e34('0x0'));var emlformat=require(_0x9e34('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9e34('0x2'));var jsonpatch=require(_0x9e34('0x3'));var rp=require(_0x9e34('0x4'));var moment=require('moment');var BPromise=require(_0x9e34('0x5'));var Mustache=require(_0x9e34('0x6'));var util=require(_0x9e34('0x7'));var path=require(_0x9e34('0x8'));var sox=require('sox');var csv=require(_0x9e34('0x9'));var ejs=require(_0x9e34('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9e34('0xb'));var crypto=require(_0x9e34('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9e34('0xd'));var toCsv=require(_0x9e34('0x9'));var querystring=require(_0x9e34('0xe'));var Papa=require('papaparse');var Redis=require(_0x9e34('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9e34('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9e34('0x11'));var utils=require(_0x9e34('0x12'));var config=require(_0x9e34('0x13'));var db=require('../../mysqldb')['db'];config[_0x9e34('0x14')]=_[_0x9e34('0x15')](config[_0x9e34('0x14')],{'host':_0x9e34('0x16'),'port':0x18eb});var socket=require(_0x9e34('0x17'))(new Redis(config[_0x9e34('0x14')]));require(_0x9e34('0x18'))[_0x9e34('0x19')](socket);var jayson=require(_0x9e34('0x1a'));var client=jayson[_0x9e34('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x9e34('0x1b')][_0x9e34('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3dacdc,_0x1ba415,_0x58105f){if(_0x58105f){var _0x56d17e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56d17e[_0x9e34('0x1d')](_0x1ba415)){return _0x3dacdc;}else{throw new Error(_0x9e34('0x1e'));}}else{return _0x3dacdc;}}function respondWithRpcPromise(_0x2fdd63,_0x4755e0,_0x2d3bad,_0x246de6){return new BPromise(function(_0x7304,_0x53dd0b){var _0x217b69=_0x246de6||client;return _0x217b69[_0x9e34('0x1f')](_0x2fdd63,_0x2d3bad)[_0x9e34('0x20')](function(_0x36db44){logger[_0x9e34('0x21')](_0x9e34('0x22'),_0x4755e0,_0x9e34('0x23'));logger['debug'](_0x9e34('0x24'),_0x4755e0,_0x9e34('0x23'),JSON[_0x9e34('0x25')](_0x36db44));if(_0x36db44[_0x9e34('0x26')]){if(_0x36db44[_0x9e34('0x26')][_0x9e34('0x27')]===0x1f4){logger[_0x9e34('0x26')](_0x9e34('0x22'),_0x4755e0,_0x36db44[_0x9e34('0x26')]['message']);return _0x53dd0b(_0x36db44[_0x9e34('0x26')]['message']);}logger['error'](_0x9e34('0x22'),_0x4755e0,_0x36db44['error'][_0x9e34('0x28')]);return _0x7304(_0x36db44[_0x9e34('0x26')][_0x9e34('0x28')]);}else{logger[_0x9e34('0x21')](_0x9e34('0x22'),_0x4755e0,'request\x20sent');_0x7304(_0x36db44['result'][_0x9e34('0x28')]);}})['catch'](function(_0xa59e7f){logger[_0x9e34('0x26')](_0x9e34('0x22'),_0x4755e0,_0xa59e7f);_0x53dd0b(_0xa59e7f);});});}function respondWithStatusCode(_0x3c9c61,_0x50cb82){_0x50cb82=_0x50cb82||0xcc;return function(_0x402df6){if(_0x402df6){return _0x3c9c61['sendStatus'](_0x50cb82);}return _0x3c9c61[_0x9e34('0x29')](_0x50cb82)['end']();};}function respondWithResult(_0x3441d5,_0x5b9c16){_0x5b9c16=_0x5b9c16||0xc8;return function(_0x25a439){if(_0x25a439){return _0x3441d5[_0x9e34('0x29')](_0x5b9c16)[_0x9e34('0x2a')](_0x25a439);}};}function respondWithFilteredResult(_0x23fe2b,_0x5f01b8){return function(_0x1e48bd){if(_0x1e48bd){var _0x1b7f3e=_0x1e48bd['count'],_0x333c9f=_0x5f01b8['offset'],_0x38ca36=_0x5f01b8[_0x9e34('0x2b')]+_0x5f01b8[_0x9e34('0x2c')],_0x1eab3a;if(_0x38ca36>=_0x1b7f3e){_0x38ca36=_0x1b7f3e;_0x1eab3a=0xc8;}else{_0x1eab3a=0xce;}_0x23fe2b[_0x9e34('0x29')](_0x1eab3a);return _0x23fe2b['set'](_0x9e34('0x2d'),_0x333c9f+'-'+_0x38ca36+'/'+_0x1b7f3e)[_0x9e34('0x2a')](_0x1e48bd);}return null;};}function patchUpdates(_0x13552c){return function(_0x30f370){try{jsonpatch[_0x9e34('0x2e')](_0x30f370,_0x13552c,!![]);}catch(_0x57d480){return BPromise[_0x9e34('0x2f')](_0x57d480);}return _0x30f370[_0x9e34('0x30')]();};}function saveUpdates(_0x36ba82,_0x100e45){return function(_0x2ff893){if(_0x2ff893){return _0x2ff893[_0x9e34('0x31')](_0x36ba82)[_0x9e34('0x20')](function(_0x301fc5){return _0x301fc5;});}return null;};}function removeEntity(_0x4d6aeb,_0x3913c4){return function(_0x709e5d){if(_0x709e5d){return _0x709e5d[_0x9e34('0x32')]()[_0x9e34('0x20')](function(){_0x4d6aeb[_0x9e34('0x29')](0xcc)[_0x9e34('0x33')]();});}};}function handleEntityNotFound(_0x428747,_0x2c2014){return function(_0x172a1b){if(!_0x172a1b){_0x428747[_0x9e34('0x34')](0x194);}return _0x172a1b;};}function handleError(_0x31c58e,_0xc627bd){_0xc627bd=_0xc627bd||0x1f4;return function(_0x33bdb7){logger[_0x9e34('0x26')](_0x33bdb7['stack']);if(_0x33bdb7[_0x9e34('0x35')]){delete _0x33bdb7[_0x9e34('0x35')];}_0x31c58e[_0x9e34('0x29')](_0xc627bd)['send'](_0x33bdb7);};}exports['index']=function(_0x4eff89,_0x1b887a){var _0x17bf24={},_0x2505bd={},_0x4010c1={'count':0x0,'rows':[]};var _0x396006=db['ChatMessage'][_0x9e34('0x36')];_0x2505bd[_0x9e34('0x37')]=_[_0x9e34('0x38')](_0x396006);_0x2505bd[_0x9e34('0x39')]=_['keys'](_0x4eff89[_0x9e34('0x39')]);_0x2505bd['filters']=_[_0x9e34('0x3a')](_0x2505bd['model'],_0x2505bd[_0x9e34('0x39')]);_0x17bf24[_0x9e34('0x3b')]=_[_0x9e34('0x3a')](_0x2505bd[_0x9e34('0x37')],qs[_0x9e34('0x3c')](_0x4eff89[_0x9e34('0x39')][_0x9e34('0x3c')]));_0x17bf24[_0x9e34('0x3b')]=_0x17bf24[_0x9e34('0x3b')][_0x9e34('0x3d')]?_0x17bf24[_0x9e34('0x3b')]:_0x2505bd['model'];if(!_0x4eff89[_0x9e34('0x39')][_0x9e34('0x3e')](_0x9e34('0x3f'))){_0x17bf24[_0x9e34('0x2c')]=qs[_0x9e34('0x2c')](_0x4eff89[_0x9e34('0x39')][_0x9e34('0x2c')]);_0x17bf24[_0x9e34('0x2b')]=qs[_0x9e34('0x2b')](_0x4eff89['query'][_0x9e34('0x2b')]);}_0x17bf24['order']=qs[_0x9e34('0x40')](_0x4eff89[_0x9e34('0x39')]['sort']);_0x17bf24['where']=qs['filters'](_[_0x9e34('0x41')](_0x4eff89[_0x9e34('0x39')],_0x2505bd[_0x9e34('0x42')]));if(_0x4eff89[_0x9e34('0x39')][_0x9e34('0x43')]){_0x17bf24[_0x9e34('0x44')]=_[_0x9e34('0x45')](_0x17bf24['where'],{'$or':_[_0x9e34('0x46')](_0x396006,function(_0x35f7e2){if(_0x35f7e2['type']['key']!==_0x9e34('0x47')){var _0x359707={};_0x359707[_0x35f7e2[_0x9e34('0x48')]]={'$like':'%'+_0x4eff89['query'][_0x9e34('0x43')]+'%'};return _0x359707;}})});}_0x17bf24=_[_0x9e34('0x45')]({},_0x17bf24,_0x4eff89['options']);var _0x1a07fa={'where':_0x17bf24[_0x9e34('0x44')]};return db[_0x9e34('0x49')][_0x9e34('0x4a')](_0x1a07fa)['then'](function(_0x3a3ffc){_0x4010c1[_0x9e34('0x4a')]=_0x3a3ffc;if(_0x4eff89['query'][_0x9e34('0x4b')]){_0x17bf24[_0x9e34('0x4c')]=[{'all':!![]}];}return db[_0x9e34('0x49')][_0x9e34('0x4d')](_0x17bf24);})[_0x9e34('0x20')](function(_0x2bc97b){_0x4010c1['rows']=_0x2bc97b;return _0x4010c1;})[_0x9e34('0x20')](respondWithFilteredResult(_0x1b887a,_0x17bf24))[_0x9e34('0x4e')](handleError(_0x1b887a,null));};exports[_0x9e34('0x4f')]=function(_0x35f012,_0x105cc9){var _0x3ff032={'raw':!![],'where':{'id':_0x35f012[_0x9e34('0x50')]['id']}},_0x2e51a9={};_0x2e51a9[_0x9e34('0x37')]=_[_0x9e34('0x38')](db['ChatMessage'][_0x9e34('0x36')]);_0x2e51a9['query']=_[_0x9e34('0x38')](_0x35f012['query']);_0x2e51a9['filters']=_[_0x9e34('0x3a')](_0x2e51a9['model'],_0x2e51a9['query']);_0x3ff032['attributes']=_[_0x9e34('0x3a')](_0x2e51a9[_0x9e34('0x37')],qs[_0x9e34('0x3c')](_0x35f012['query'][_0x9e34('0x3c')]));_0x3ff032['attributes']=_0x3ff032[_0x9e34('0x3b')][_0x9e34('0x3d')]?_0x3ff032[_0x9e34('0x3b')]:_0x2e51a9[_0x9e34('0x37')];if(_0x35f012['query'][_0x9e34('0x4b')]){_0x3ff032[_0x9e34('0x4c')]=[{'all':!![]}];}_0x3ff032=_['merge']({},_0x3ff032,_0x35f012[_0x9e34('0x51')]);return db[_0x9e34('0x49')]['find'](_0x3ff032)[_0x9e34('0x20')](handleEntityNotFound(_0x105cc9,null))['then'](respondWithResult(_0x105cc9,null))['catch'](handleError(_0x105cc9,null));};exports[_0x9e34('0x52')]=function(_0x1103be,_0x2ea3c4){return db['ChatMessage'][_0x9e34('0x52')](_0x1103be[_0x9e34('0x53')],{})[_0x9e34('0x20')](respondWithResult(_0x2ea3c4,0xc9))[_0x9e34('0x4e')](handleError(_0x2ea3c4,null));};exports[_0x9e34('0x31')]=function(_0x46e698,_0x5dc369){if(_0x46e698['body']['id']){delete _0x46e698[_0x9e34('0x53')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x46e698[_0x9e34('0x50')]['id']}})[_0x9e34('0x20')](handleEntityNotFound(_0x5dc369,null))[_0x9e34('0x20')](saveUpdates(_0x46e698[_0x9e34('0x53')],null))[_0x9e34('0x20')](respondWithResult(_0x5dc369,null))['catch'](handleError(_0x5dc369,null));};exports[_0x9e34('0x32')]=function(_0x11d21a,_0x34fbb9){return db[_0x9e34('0x49')][_0x9e34('0x54')]({'where':{'id':_0x11d21a[_0x9e34('0x50')]['id']}})[_0x9e34('0x20')](handleEntityNotFound(_0x34fbb9,null))[_0x9e34('0x20')](removeEntity(_0x34fbb9,null))[_0x9e34('0x4e')](handleError(_0x34fbb9,null));};exports[_0x9e34('0x55')]=function(_0x157e18,_0xf1ae1c){return db['ChatMessage'][_0x9e34('0x55')]()[_0x9e34('0x20')](respondWithResult(_0xf1ae1c,null))[_0x9e34('0x4e')](handleError(_0xf1ae1c,null));};var interaction_log=require('../../config/logger')(_0x9e34('0x56'));exports[_0x9e34('0x57')]=function(_0x59a114,_0x42e7fc,_0x3d2648){var _0xcf4561={'channel':_0x9e34('0x58')};if(_0x59a114[_0x9e34('0x53')]['id']){delete _0x59a114[_0x9e34('0x53')]['id'];}_0x59a114[_0x9e34('0x53')][_0x9e34('0x59')]=!![];_0x59a114[_0x9e34('0x53')][_0x9e34('0x5a')]=moment()[_0x9e34('0x5b')](_0x9e34('0x5c'));_0x59a114[_0x9e34('0x53')][_0x9e34('0x5d')]=_0x59a114[_0x9e34('0x53')][_0x9e34('0x5d')]||_0x59a114['user']['id'];return db[_0x9e34('0x49')][_0x9e34('0x54')]({'where':{'id':_0x59a114[_0x9e34('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x9e34('0x5e')],'as':_0x9e34('0x5f')}]})[_0x9e34('0x20')](handleEntityNotFound(_0x42e7fc,null))[_0x9e34('0x20')](saveUpdates(_0x59a114[_0x9e34('0x53')],null))[_0x9e34('0x20')](function(_0x192b7a){if(_0x192b7a){_0xcf4561[_0x9e34('0x28')]=_0x192b7a[_0x9e34('0x60')]({'plain':!![]});return db[_0x9e34('0x61')][_0x9e34('0x54')]({'where':{'id':_0x192b7a[_0x9e34('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x42e7fc,null))[_0x9e34('0x20')](function(_0x2d9cda){if(_0x2d9cda){return _0x2d9cda[_0x9e34('0x31')]({'UserId':_0x59a114['body'][_0x9e34('0x5d')],'read1stAt':_[_0x9e34('0x63')](_0x2d9cda['read1stAt'])?moment()[_0x9e34('0x5b')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x16bd2c){if(_0x16bd2c){_0xcf4561[_0x9e34('0x64')]=_0x16bd2c[_0x9e34('0x60')]({'plain':!![]});interaction_log[_0x9e34('0x21')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x59a114[_0x9e34('0x65')]['id'],_0x59a114['user'][_0x9e34('0x35')],_0x59a114[_0x9e34('0x65')][_0x9e34('0x66')],_0xcf4561['interaction']['id'],_0x59a114[_0x9e34('0x53')]?JSON[_0x9e34('0x25')](_0x59a114[_0x9e34('0x53')]):_0x9e34('0x67'));return respondWithRpcPromise(_0x9e34('0x68'),'acceptMessage',_0xcf4561);}return null;})['then'](function(_0x4d3d0e){if(_0x4d3d0e){if(_0x59a114['body'][_0x9e34('0x69')]){_0xcf4561[_0x9e34('0x28')][_0x9e34('0x6a')]=util[_0x9e34('0x5b')](_0x9e34('0x6b'),_0x59a114[_0x9e34('0x65')][_0x9e34('0x35')]);_0xcf4561[_0x9e34('0x28')][_0x9e34('0x6c')]=_0xcf4561[_0x9e34('0x6c')];_0xcf4561[_0x9e34('0x28')]['event']=_0x9e34('0x57');return respondWithRpcPromise('EventManager',_0x9e34('0x6d'),{'event':_0x9e34('0x6e'),'message':_[_0x9e34('0x45')](_0xcf4561[_0x9e34('0x28')],JSON[_0x9e34('0x6f')](_0xcf4561[_0x9e34('0x64')][_0x9e34('0x70')]))},client9002)[_0x9e34('0x20')](function(){return _0xcf4561;});}return _0xcf4561;}return null;})['then'](respondWithResult(_0x42e7fc,null))[_0x9e34('0x4e')](handleError(_0x42e7fc,null));};var interaction_log=require('../../config/logger')(_0x9e34('0x56'));exports[_0x9e34('0x2f')]=function(_0x411145,_0x355dd5,_0xa6452d){var _0x411047={'agent':{},'channel':_0x9e34('0x58')};if(_0x411145['body']['id']){delete _0x411145[_0x9e34('0x53')]['id'];}_0x411145['body'][_0x9e34('0x5d')]=_0x411145[_0x9e34('0x53')]['UserId']||_0x411145[_0x9e34('0x65')]['id'];_0x411047[_0x9e34('0x71')]['id']=_0x411145[_0x9e34('0x53')][_0x9e34('0x5d')];return db[_0x9e34('0x49')][_0x9e34('0x54')]({'where':{'id':_0x411145[_0x9e34('0x50')]['id'],'UserId':null}})[_0x9e34('0x20')](handleEntityNotFound(_0x355dd5,null))['then'](function(_0x583f91){if(_0x583f91){_0x411047['message']=_0x583f91[_0x9e34('0x60')]({'plain':!![]});return db[_0x9e34('0x61')]['find']({'where':{'id':_0x583f91['ChatInteractionId']}});}return null;})[_0x9e34('0x20')](handleEntityNotFound(_0x355dd5,null))[_0x9e34('0x20')](function(_0x1637d6){if(_0x1637d6){_0x411047[_0x9e34('0x64')]=_0x1637d6[_0x9e34('0x60')]({'plain':!![]});interaction_log[_0x9e34('0x21')](_0x9e34('0x72'),_0x411145[_0x9e34('0x65')]['id'],_0x411145['user'][_0x9e34('0x35')],_0x411145[_0x9e34('0x65')][_0x9e34('0x66')],_0x411047[_0x9e34('0x64')]['id'],_0x411145[_0x9e34('0x53')]?JSON[_0x9e34('0x25')](_0x411145[_0x9e34('0x53')]):'null');return respondWithRpcPromise(_0x9e34('0x73'),_0x9e34('0x74'),_0x411047);}return null;})['then'](function(_0x445d5a){if(_0x445d5a){_0x445d5a[_0x9e34('0x28')][_0x9e34('0x6a')]=util['format'](_0x9e34('0x6b'),_0x411145[_0x9e34('0x65')][_0x9e34('0x35')]);_0x445d5a['message']['channel']=_0x411047[_0x9e34('0x6c')];_0x445d5a[_0x9e34('0x28')]['event']=_0x9e34('0x2f');respondWithRpcPromise(_0x9e34('0x6d'),_0x9e34('0x6d'),{'event':_0x9e34('0x75'),'message':_0x445d5a[_0x9e34('0x28')]},client9002);return _0x411047;}return null;})[_0x9e34('0x20')](respondWithResult(_0x355dd5,null))[_0x9e34('0x4e')](handleError(_0x355dd5,null));}; \ No newline at end of file +var _0xc157=['redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','ChatMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','key','VIRTUAL','field','options','includeAll','include','rows','show','params','create','find','describe','chat-interactions','accept','chat','body','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteractionId','isNil','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','EventManager','acceptmessage','parse','formData','agent','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SIP/%s','event','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x4c3c14,_0x5cad65){var _0x27bae5=function(_0x12a97d){while(--_0x12a97d){_0x4c3c14['push'](_0x4c3c14['shift']());}};_0x27bae5(++_0x5cad65);}(_0xc157,0x1c9));var _0x7c15=function(_0x312b0b,_0x5ba216){_0x312b0b=_0x312b0b-0x0;var _0x2421e4=_0xc157[_0x312b0b];return _0x2421e4;};'use strict';var pdf=require(_0x7c15('0x0'));var emlformat=require(_0x7c15('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c15('0x2'));var rp=require('request-promise');var moment=require(_0x7c15('0x3'));var BPromise=require(_0x7c15('0x4'));var Mustache=require(_0x7c15('0x5'));var util=require('util');var path=require(_0x7c15('0x6'));var sox=require(_0x7c15('0x7'));var csv=require(_0x7c15('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7c15('0x9'));var squel=require(_0x7c15('0xa'));var crypto=require(_0x7c15('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7c15('0xc'));var Papa=require(_0x7c15('0xd'));var Redis=require(_0x7c15('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7c15('0xf'));var hardwareService=require(_0x7c15('0x10'));var logger=require(_0x7c15('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7c15('0x12'));var db=require('../../mysqldb')['db'];config[_0x7c15('0x13')]=_[_0x7c15('0x14')](config[_0x7c15('0x13')],{'host':_0x7c15('0x15'),'port':0x18eb});var socket=require(_0x7c15('0x16'))(new Redis(config[_0x7c15('0x13')]));require(_0x7c15('0x17'))[_0x7c15('0x18')](socket);var jayson=require(_0x7c15('0x19'));var client=jayson[_0x7c15('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x7c15('0x1a')][_0x7c15('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x342f44,_0x28d54c,_0x262d28){if(_0x262d28){var _0x44c653=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44c653['test'](_0x28d54c)){return _0x342f44;}else{throw new Error(_0x7c15('0x1c'));}}else{return _0x342f44;}}function respondWithRpcPromise(_0x3edd31,_0x4cc7d7,_0x1a5e0e,_0x45ea70){return new BPromise(function(_0x21d297,_0x4456fc){var _0x47cdd0=_0x45ea70||client;return _0x47cdd0['request'](_0x3edd31,_0x1a5e0e)['then'](function(_0xead923){logger[_0x7c15('0x1d')]('ChatMessage,\x20%s,\x20%s',_0x4cc7d7,_0x7c15('0x1e'));logger['debug'](_0x7c15('0x1f'),_0x4cc7d7,'request\x20sent',JSON[_0x7c15('0x20')](_0xead923));if(_0xead923[_0x7c15('0x21')]){if(_0xead923[_0x7c15('0x21')]['code']===0x1f4){logger[_0x7c15('0x21')](_0x7c15('0x22'),_0x4cc7d7,_0xead923['error'][_0x7c15('0x23')]);return _0x4456fc(_0xead923[_0x7c15('0x21')][_0x7c15('0x23')]);}logger[_0x7c15('0x21')]('ChatMessage,\x20%s,\x20%s',_0x4cc7d7,_0xead923[_0x7c15('0x21')][_0x7c15('0x23')]);return _0x21d297(_0xead923[_0x7c15('0x21')][_0x7c15('0x23')]);}else{logger[_0x7c15('0x1d')](_0x7c15('0x22'),_0x4cc7d7,'request\x20sent');_0x21d297(_0xead923[_0x7c15('0x24')][_0x7c15('0x23')]);}})[_0x7c15('0x25')](function(_0x292d46){logger[_0x7c15('0x21')]('ChatMessage,\x20%s,\x20%s',_0x4cc7d7,_0x292d46);_0x4456fc(_0x292d46);});});}function respondWithStatusCode(_0xd96625,_0x43b8c3){_0x43b8c3=_0x43b8c3||0xcc;return function(_0x2f3fc7){if(_0x2f3fc7){return _0xd96625[_0x7c15('0x26')](_0x43b8c3);}return _0xd96625[_0x7c15('0x27')](_0x43b8c3)[_0x7c15('0x28')]();};}function respondWithResult(_0x594021,_0x2df703){_0x2df703=_0x2df703||0xc8;return function(_0x54afbd){if(_0x54afbd){return _0x594021[_0x7c15('0x27')](_0x2df703)[_0x7c15('0x29')](_0x54afbd);}};}function respondWithFilteredResult(_0x52f79d,_0x37dbfd){return function(_0x33994d){if(_0x33994d){var _0x13577a=_0x33994d[_0x7c15('0x2a')],_0x3f040e=_0x37dbfd[_0x7c15('0x2b')],_0x15a515=_0x37dbfd[_0x7c15('0x2b')]+_0x37dbfd[_0x7c15('0x2c')],_0xd807a8;if(_0x15a515>=_0x13577a){_0x15a515=_0x13577a;_0xd807a8=0xc8;}else{_0xd807a8=0xce;}_0x52f79d[_0x7c15('0x27')](_0xd807a8);return _0x52f79d[_0x7c15('0x2d')](_0x7c15('0x2e'),_0x3f040e+'-'+_0x15a515+'/'+_0x13577a)[_0x7c15('0x29')](_0x33994d);}return null;};}function patchUpdates(_0x2d98eb){return function(_0x2abd28){try{jsonpatch[_0x7c15('0x2f')](_0x2abd28,_0x2d98eb,!![]);}catch(_0x286543){return BPromise[_0x7c15('0x30')](_0x286543);}return _0x2abd28['save']();};}function saveUpdates(_0x1f4208,_0x57b94f){return function(_0x521e04){if(_0x521e04){return _0x521e04[_0x7c15('0x31')](_0x1f4208)[_0x7c15('0x32')](function(_0x3ec858){return _0x3ec858;});}return null;};}function removeEntity(_0x160c70,_0x2f365b){return function(_0x290dd7){if(_0x290dd7){return _0x290dd7[_0x7c15('0x33')]()[_0x7c15('0x32')](function(){_0x160c70[_0x7c15('0x27')](0xcc)[_0x7c15('0x28')]();});}};}function handleEntityNotFound(_0x3746f6,_0x578061){return function(_0x7b8f7){if(!_0x7b8f7){_0x3746f6[_0x7c15('0x26')](0x194);}return _0x7b8f7;};}function handleError(_0x52bf54,_0x315ba8){_0x315ba8=_0x315ba8||0x1f4;return function(_0xa933a9){logger['error'](_0xa933a9[_0x7c15('0x34')]);if(_0xa933a9[_0x7c15('0x35')]){delete _0xa933a9['name'];}_0x52bf54[_0x7c15('0x27')](_0x315ba8)['send'](_0xa933a9);};}exports[_0x7c15('0x36')]=function(_0x47cc2d,_0x4e82a7){var _0x3a5047={},_0x5e78fd={},_0xd3f19c={'count':0x0,'rows':[]};var _0x598616=db[_0x7c15('0x37')][_0x7c15('0x38')];_0x5e78fd[_0x7c15('0x39')]=_[_0x7c15('0x3a')](_0x598616);_0x5e78fd['query']=_[_0x7c15('0x3a')](_0x47cc2d[_0x7c15('0x3b')]);_0x5e78fd['filters']=_[_0x7c15('0x3c')](_0x5e78fd['model'],_0x5e78fd[_0x7c15('0x3b')]);_0x3a5047[_0x7c15('0x3d')]=_[_0x7c15('0x3c')](_0x5e78fd['model'],qs['fields'](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x3e')]));_0x3a5047['attributes']=_0x3a5047['attributes'][_0x7c15('0x3f')]?_0x3a5047[_0x7c15('0x3d')]:_0x5e78fd[_0x7c15('0x39')];if(!_0x47cc2d['query'][_0x7c15('0x40')](_0x7c15('0x41'))){_0x3a5047[_0x7c15('0x2c')]=qs[_0x7c15('0x2c')](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x2c')]);_0x3a5047[_0x7c15('0x2b')]=qs['offset'](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x2b')]);}_0x3a5047['order']=qs[_0x7c15('0x42')](_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x42')]);_0x3a5047['where']=qs['filters'](_[_0x7c15('0x43')](_0x47cc2d[_0x7c15('0x3b')],_0x5e78fd[_0x7c15('0x44')]));if(_0x47cc2d['query'][_0x7c15('0x45')]){_0x3a5047[_0x7c15('0x46')]=_[_0x7c15('0x47')](_0x3a5047[_0x7c15('0x46')],{'$or':_['map'](_0x598616,function(_0x4e1a41){if(_0x4e1a41['type'][_0x7c15('0x48')]!==_0x7c15('0x49')){var _0x369be1={};_0x369be1[_0x4e1a41[_0x7c15('0x4a')]]={'$like':'%'+_0x47cc2d['query'][_0x7c15('0x45')]+'%'};return _0x369be1;}})});}_0x3a5047=_['merge']({},_0x3a5047,_0x47cc2d[_0x7c15('0x4b')]);var _0x9471d1={'where':_0x3a5047[_0x7c15('0x46')]};return db[_0x7c15('0x37')][_0x7c15('0x2a')](_0x9471d1)[_0x7c15('0x32')](function(_0x593179){_0xd3f19c[_0x7c15('0x2a')]=_0x593179;if(_0x47cc2d[_0x7c15('0x3b')][_0x7c15('0x4c')]){_0x3a5047[_0x7c15('0x4d')]=[{'all':!![]}];}return db[_0x7c15('0x37')]['findAll'](_0x3a5047);})[_0x7c15('0x32')](function(_0x285b79){_0xd3f19c[_0x7c15('0x4e')]=_0x285b79;return _0xd3f19c;})['then'](respondWithFilteredResult(_0x4e82a7,_0x3a5047))[_0x7c15('0x25')](handleError(_0x4e82a7,null));};exports[_0x7c15('0x4f')]=function(_0x1de89d,_0x44b64b){var _0x3151bb={'raw':!![],'where':{'id':_0x1de89d[_0x7c15('0x50')]['id']}},_0x2aabfe={};_0x2aabfe[_0x7c15('0x39')]=_[_0x7c15('0x3a')](db[_0x7c15('0x37')][_0x7c15('0x38')]);_0x2aabfe[_0x7c15('0x3b')]=_[_0x7c15('0x3a')](_0x1de89d[_0x7c15('0x3b')]);_0x2aabfe[_0x7c15('0x44')]=_['intersection'](_0x2aabfe['model'],_0x2aabfe[_0x7c15('0x3b')]);_0x3151bb[_0x7c15('0x3d')]=_[_0x7c15('0x3c')](_0x2aabfe['model'],qs[_0x7c15('0x3e')](_0x1de89d['query'][_0x7c15('0x3e')]));_0x3151bb['attributes']=_0x3151bb[_0x7c15('0x3d')][_0x7c15('0x3f')]?_0x3151bb['attributes']:_0x2aabfe[_0x7c15('0x39')];if(_0x1de89d[_0x7c15('0x3b')]['includeAll']){_0x3151bb['include']=[{'all':!![]}];}_0x3151bb=_[_0x7c15('0x47')]({},_0x3151bb,_0x1de89d['options']);return db['ChatMessage']['find'](_0x3151bb)[_0x7c15('0x32')](handleEntityNotFound(_0x44b64b,null))[_0x7c15('0x32')](respondWithResult(_0x44b64b,null))[_0x7c15('0x25')](handleError(_0x44b64b,null));};exports['create']=function(_0x3edbe5,_0x6fa0ca){return db[_0x7c15('0x37')][_0x7c15('0x51')](_0x3edbe5['body'],{})[_0x7c15('0x32')](respondWithResult(_0x6fa0ca,0xc9))[_0x7c15('0x25')](handleError(_0x6fa0ca,null));};exports[_0x7c15('0x31')]=function(_0x40936e,_0x55d22f){if(_0x40936e['body']['id']){delete _0x40936e['body']['id'];}return db[_0x7c15('0x37')][_0x7c15('0x52')]({'where':{'id':_0x40936e[_0x7c15('0x50')]['id']}})[_0x7c15('0x32')](handleEntityNotFound(_0x55d22f,null))['then'](saveUpdates(_0x40936e['body'],null))['then'](respondWithResult(_0x55d22f,null))[_0x7c15('0x25')](handleError(_0x55d22f,null));};exports['destroy']=function(_0x22ec6b,_0x3f8f0f){return db['ChatMessage'][_0x7c15('0x52')]({'where':{'id':_0x22ec6b[_0x7c15('0x50')]['id']}})[_0x7c15('0x32')](handleEntityNotFound(_0x3f8f0f,null))[_0x7c15('0x32')](removeEntity(_0x3f8f0f,null))[_0x7c15('0x25')](handleError(_0x3f8f0f,null));};exports[_0x7c15('0x53')]=function(_0x5810a2,_0x195aae){return db[_0x7c15('0x37')][_0x7c15('0x53')]()[_0x7c15('0x32')](respondWithResult(_0x195aae,null))[_0x7c15('0x25')](handleError(_0x195aae,null));};var interaction_log=require(_0x7c15('0x11'))(_0x7c15('0x54'));exports[_0x7c15('0x55')]=function(_0x341299,_0x5dad2b,_0x3dbde7){var _0x1ae763={'channel':_0x7c15('0x56')};if(_0x341299[_0x7c15('0x57')]['id']){delete _0x341299[_0x7c15('0x57')]['id'];}_0x341299['body'][_0x7c15('0x58')]=!![];_0x341299[_0x7c15('0x57')][_0x7c15('0x59')]=moment()['format'](_0x7c15('0x5a'));_0x341299[_0x7c15('0x57')][_0x7c15('0x5b')]=_0x341299[_0x7c15('0x57')][_0x7c15('0x5b')]||_0x341299[_0x7c15('0x5c')]['id'];return db[_0x7c15('0x37')][_0x7c15('0x52')]({'where':{'id':_0x341299[_0x7c15('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x7c15('0x5d')],'as':_0x7c15('0x5e')}]})[_0x7c15('0x32')](handleEntityNotFound(_0x5dad2b,null))[_0x7c15('0x32')](saveUpdates(_0x341299[_0x7c15('0x57')],null))[_0x7c15('0x32')](function(_0x143e14){if(_0x143e14){_0x1ae763[_0x7c15('0x23')]=_0x143e14[_0x7c15('0x5f')]({'plain':!![]});return db['ChatInteraction'][_0x7c15('0x52')]({'where':{'id':_0x143e14[_0x7c15('0x60')]}});}return null;})[_0x7c15('0x32')](handleEntityNotFound(_0x5dad2b,null))[_0x7c15('0x32')](function(_0x207558){if(_0x207558){return _0x207558['update']({'UserId':_0x341299[_0x7c15('0x57')][_0x7c15('0x5b')],'read1stAt':_[_0x7c15('0x61')](_0x207558[_0x7c15('0x62')])?moment()[_0x7c15('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x7c15('0x32')](function(_0x40964b){if(_0x40964b){_0x1ae763[_0x7c15('0x64')]=_0x40964b[_0x7c15('0x5f')]({'plain':!![]});interaction_log['info'](_0x7c15('0x65'),_0x341299[_0x7c15('0x5c')]['id'],_0x341299[_0x7c15('0x5c')][_0x7c15('0x35')],_0x341299[_0x7c15('0x5c')][_0x7c15('0x66')],_0x1ae763[_0x7c15('0x64')]['id'],_0x341299[_0x7c15('0x57')]?JSON[_0x7c15('0x20')](_0x341299[_0x7c15('0x57')]):_0x7c15('0x67'));return respondWithRpcPromise(_0x7c15('0x68'),_0x7c15('0x69'),_0x1ae763);}return null;})[_0x7c15('0x32')](function(_0x5a39ef){if(_0x5a39ef){if(_0x341299[_0x7c15('0x57')][_0x7c15('0x6a')]){_0x1ae763[_0x7c15('0x23')][_0x7c15('0x6b')]=util[_0x7c15('0x63')]('SIP/%s',_0x341299['user']['name']);_0x1ae763[_0x7c15('0x23')][_0x7c15('0x6c')]=_0x1ae763['channel'];_0x1ae763[_0x7c15('0x23')]['event']=_0x7c15('0x55');return respondWithRpcPromise('EventManager',_0x7c15('0x6d'),{'event':_0x7c15('0x6e'),'message':_[_0x7c15('0x47')](_0x1ae763[_0x7c15('0x23')],JSON[_0x7c15('0x6f')](_0x1ae763[_0x7c15('0x64')][_0x7c15('0x70')]))},client9002)[_0x7c15('0x32')](function(){return _0x1ae763;});}return _0x1ae763;}return null;})[_0x7c15('0x32')](respondWithResult(_0x5dad2b,null))[_0x7c15('0x25')](handleError(_0x5dad2b,null));};var interaction_log=require(_0x7c15('0x11'))(_0x7c15('0x54'));exports['reject']=function(_0x1be51b,_0xf9d86,_0x5cfbac){var _0x126288={'agent':{},'channel':_0x7c15('0x56')};if(_0x1be51b[_0x7c15('0x57')]['id']){delete _0x1be51b['body']['id'];}_0x1be51b['body'][_0x7c15('0x5b')]=_0x1be51b[_0x7c15('0x57')][_0x7c15('0x5b')]||_0x1be51b[_0x7c15('0x5c')]['id'];_0x126288[_0x7c15('0x71')]['id']=_0x1be51b[_0x7c15('0x57')][_0x7c15('0x5b')];return db[_0x7c15('0x37')][_0x7c15('0x52')]({'where':{'id':_0x1be51b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xf9d86,null))['then'](function(_0x7c8704){if(_0x7c8704){_0x126288['message']=_0x7c8704['get']({'plain':!![]});return db[_0x7c15('0x72')]['find']({'where':{'id':_0x7c8704[_0x7c15('0x60')]}});}return null;})[_0x7c15('0x32')](handleEntityNotFound(_0xf9d86,null))['then'](function(_0x1cf9ae){if(_0x1cf9ae){_0x126288[_0x7c15('0x64')]=_0x1cf9ae[_0x7c15('0x5f')]({'plain':!![]});interaction_log['info'](_0x7c15('0x73'),_0x1be51b[_0x7c15('0x5c')]['id'],_0x1be51b[_0x7c15('0x5c')][_0x7c15('0x35')],_0x1be51b[_0x7c15('0x5c')][_0x7c15('0x66')],_0x126288[_0x7c15('0x64')]['id'],_0x1be51b[_0x7c15('0x57')]?JSON[_0x7c15('0x20')](_0x1be51b[_0x7c15('0x57')]):_0x7c15('0x67'));return respondWithRpcPromise('RejectMessage',_0x7c15('0x74'),_0x126288);}return null;})[_0x7c15('0x32')](function(_0x295afb){if(_0x295afb){_0x295afb['message']['interface']=util['format'](_0x7c15('0x75'),_0x1be51b[_0x7c15('0x5c')][_0x7c15('0x35')]);_0x295afb['message'][_0x7c15('0x6c')]=_0x126288['channel'];_0x295afb[_0x7c15('0x23')][_0x7c15('0x76')]=_0x7c15('0x30');respondWithRpcPromise(_0x7c15('0x6d'),_0x7c15('0x6d'),{'event':'rejectmessage','message':_0x295afb['message']},client9002);return _0x126288;}return null;})['then'](respondWithResult(_0xf9d86,null))[_0x7c15('0x25')](handleError(_0xf9d86,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 4822781..4a99160 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 _0xb697=['ChatMessage','update','remove','emit','hook','exports','events'];(function(_0x155d94,_0x23d7af){var _0x1f5da8=function(_0x4ffe6f){while(--_0x4ffe6f){_0x155d94['push'](_0x155d94['shift']());}};_0x1f5da8(++_0x23d7af);}(_0xb697,0x99));var _0x7b69=function(_0x508268,_0x2a7932){_0x508268=_0x508268-0x0;var _0x42d874=_0xb697[_0x508268];return _0x42d874;};'use strict';var EventEmitter=require(_0x7b69('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x7b69('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7b69('0x2'),'afterDestroy':_0x7b69('0x3')};function emitEvent(_0x4baa22){return function(_0x1af215,_0x2a7238,_0x4727ce){ChatMessageEvents[_0x7b69('0x4')](_0x4baa22+':'+_0x1af215['id'],_0x1af215);ChatMessageEvents[_0x7b69('0x4')](_0x4baa22,_0x1af215);_0x4727ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x7b69('0x5')](e,emitEvent(event));}}module[_0x7b69('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x5fc7=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage'];(function(_0x53943a,_0x28c765){var _0x4a7937=function(_0x4fb681){while(--_0x4fb681){_0x53943a['push'](_0x53943a['shift']());}};_0x4a7937(++_0x28c765);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x5fc7[_0x435044];return _0x33d4c6;};'use strict';var EventEmitter=require(_0x75fc('0x0'));var ChatMessage=require(_0x75fc('0x1'))['db'][_0x75fc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x75fc('0x3')](0x0);var events={'afterCreate':_0x75fc('0x4'),'afterUpdate':_0x75fc('0x5'),'afterDestroy':_0x75fc('0x6')};function emitEvent(_0x34103c){return function(_0x756c32,_0x51e8b4,_0x94c5d3){ChatMessageEvents[_0x75fc('0x7')](_0x34103c+':'+_0x756c32['id'],_0x756c32);ChatMessageEvents['emit'](_0x34103c,_0x756c32);_0x94c5d3(null);};}for(var e in events){if(events[_0x75fc('0x8')](e)){var event=events[e];ChatMessage[_0x75fc('0x9')](e,emitEvent(event));}}module[_0x75fc('0xa')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 22e9879..daaac96 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 _0xee8d=['ChatInteraction','then','update','createdAt','error','utf8mb4','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','get','direction','toLowerCase','out','isNil','UserId'];(function(_0x6eb1c1,_0x4aacde){var _0x57b2b1=function(_0x4b2f3d){while(--_0x4b2f3d){_0x6eb1c1['push'](_0x6eb1c1['shift']());}};_0x57b2b1(++_0x4aacde);}(_0xee8d,0xf0));var _0xdee8=function(_0x210b3b,_0x2fbe35){_0x210b3b=_0x210b3b-0x0;var _0x56d4d8=_0xee8d[_0x210b3b];return _0x56d4d8;};'use strict';var _=require(_0xdee8('0x0'));var util=require(_0xdee8('0x1'));var logger=require(_0xdee8('0x2'))('api');var moment=require(_0xdee8('0x3'));var BPromise=require('bluebird');var rp=require(_0xdee8('0x4'));var fs=require('fs');var path=require(_0xdee8('0x5'));var rimraf=require('rimraf');var config=require(_0xdee8('0x6'));var attributes=require(_0xdee8('0x7'));module[_0xdee8('0x8')]=function(_0x549382,_0x163d1a){return _0x549382[_0xdee8('0x9')](_0xdee8('0xa'),attributes,{'tableName':_0xdee8('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xdee8('0xc')],'type':_0xdee8('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49d0d8,_0x4ea6dd,_0x33b30a){var _0x324570=_0x549382['models'];var _0x57f38f=_0x49d0d8[_0xdee8('0xe')]({'plain':!![]});if(_0x57f38f[_0xdee8('0xf')][_0xdee8('0x10')]()==='in'||_0x57f38f[_0xdee8('0xf')][_0xdee8('0x10')]()===_0xdee8('0x11')&&!_0x57f38f['secret']&&!_[_0xdee8('0x12')](_0x57f38f[_0xdee8('0x13')])){_0x324570[_0xdee8('0x14')]['findOne']({'where':{'id':_0x57f38f['ChatInteractionId']}})[_0xdee8('0x15')](function(_0x571931){if(_0x571931){_0x571931[_0xdee8('0x16')]({'lastMsgAt':_0x57f38f[_0xdee8('0x17')],'lastMsgDirection':_0x57f38f[_0xdee8('0xf')][_0xdee8('0x10')]()});}})['catch'](function(_0x3d3161){console[_0xdee8('0x18')](_0x3d3161);});}_0x33b30a();}},'charset':_0xdee8('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x86a2=['update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./chatMessage.attributes','define','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteractionId','then'];(function(_0x4e15c2,_0x3b28b1){var _0x26008d=function(_0x51feee){while(--_0x51feee){_0x4e15c2['push'](_0x4e15c2['shift']());}};_0x26008d(++_0x3b28b1);}(_0x86a2,0x165));var _0x286a=function(_0xf0b977,_0xe512bd){_0xf0b977=_0xf0b977-0x0;var _0x32199c=_0x86a2[_0xf0b977];return _0x32199c;};'use strict';var _=require(_0x286a('0x0'));var util=require('util');var logger=require(_0x286a('0x1'))('api');var moment=require(_0x286a('0x2'));var BPromise=require(_0x286a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x286a('0x4'));var rimraf=require('rimraf');var config=require(_0x286a('0x5'));var attributes=require(_0x286a('0x6'));module['exports']=function(_0x7ce78c,_0x357ed6){return _0x7ce78c[_0x286a('0x7')]('ChatMessage',attributes,{'tableName':_0x286a('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x286a('0x9')],'type':_0x286a('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x367bd9,_0x2c2441,_0x5cf3e8){var _0x5ca996=_0x7ce78c[_0x286a('0xb')];var _0x10ed83=_0x367bd9[_0x286a('0xc')]({'plain':!![]});if(_0x10ed83[_0x286a('0xd')][_0x286a('0xe')]()==='in'||_0x10ed83[_0x286a('0xd')][_0x286a('0xe')]()===_0x286a('0xf')&&!_0x10ed83[_0x286a('0x10')]&&!_[_0x286a('0x11')](_0x10ed83[_0x286a('0x12')])){_0x5ca996['ChatInteraction']['findOne']({'where':{'id':_0x10ed83[_0x286a('0x13')]}})[_0x286a('0x14')](function(_0x340da6){if(_0x340da6){_0x340da6[_0x286a('0x15')]({'lastMsgAt':_0x10ed83[_0x286a('0x16')],'lastMsgDirection':_0x10ed83[_0x286a('0xd')][_0x286a('0xe')]()});}})[_0x286a('0x17')](function(_0x4b5c0a){console[_0x286a('0x18')](_0x4b5c0a);});}_0x5cf3e8();}},'charset':_0x286a('0x19'),'collate':_0x286a('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index bb59f9a..2fb1dec 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 _0xfb2e=['result','catch','CreateChatMessage','ChatMessage','create','options','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatMessage.socket','register','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message'];(function(_0x1af268,_0x29c83c){var _0x1505f1=function(_0x460eb4){while(--_0x460eb4){_0x1af268['push'](_0x1af268['shift']());}};_0x1505f1(++_0x29c83c);}(_0xfb2e,0xed));var _0xefb2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfb2e[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0xefb2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xefb2('0x1'));var fs=require('fs');var Redis=require(_0xefb2('0x2'));var db=require(_0xefb2('0x3'))['db'];var utils=require(_0xefb2('0x4'));var logger=require(_0xefb2('0x5'))(_0xefb2('0x6'));var config=require(_0xefb2('0x7'));var jayson=require(_0xefb2('0x8'));var client=jayson[_0xefb2('0x9')][_0xefb2('0xa')]({'port':0x232a});config[_0xefb2('0xb')]=_[_0xefb2('0xc')](config[_0xefb2('0xb')],{'host':_0xefb2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xefb2('0xb')]));require(_0xefb2('0xe'))[_0xefb2('0xf')](socket);function respondWithRpcPromise(_0x567e44,_0x371cb1,_0x13bf9c){return new BPromise(function(_0x29a667,_0x4e4cbe){return client[_0xefb2('0x10')](_0x567e44,_0x13bf9c)[_0xefb2('0x11')](function(_0x4b7ae7){logger[_0xefb2('0x12')]('ChatMessage,\x20%s,\x20%s',_0x371cb1,_0xefb2('0x13'));logger[_0xefb2('0x14')](_0xefb2('0x15'),_0x371cb1,_0xefb2('0x13'),JSON[_0xefb2('0x16')](_0x4b7ae7));if(_0x4b7ae7[_0xefb2('0x17')]){if(_0x4b7ae7[_0xefb2('0x17')][_0xefb2('0x18')]===0x1f4){logger[_0xefb2('0x17')](_0xefb2('0x19'),_0x371cb1,_0x4b7ae7[_0xefb2('0x17')][_0xefb2('0x1a')]);return _0x4e4cbe(_0x4b7ae7['error'][_0xefb2('0x1a')]);}logger[_0xefb2('0x17')](_0xefb2('0x19'),_0x371cb1,_0x4b7ae7[_0xefb2('0x17')][_0xefb2('0x1a')]);return _0x29a667(_0x4b7ae7['error'][_0xefb2('0x1a')]);}else{logger[_0xefb2('0x12')]('ChatMessage,\x20%s,\x20%s',_0x371cb1,_0xefb2('0x13'));_0x29a667(_0x4b7ae7[_0xefb2('0x1b')][_0xefb2('0x1a')]);}})[_0xefb2('0x1c')](function(_0x211eea){logger[_0xefb2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x371cb1,_0x211eea);_0x4e4cbe(_0x211eea);});});}exports[_0xefb2('0x1d')]=function(_0x15f1a7){var _0x254de6=this;return new Promise(function(_0x390c9d,_0x161444){return db[_0xefb2('0x1e')][_0xefb2('0x1f')](_0x15f1a7['body'],{'raw':_0x15f1a7['options']?_0x15f1a7[_0xefb2('0x20')]['raw']===undefined?!![]:![]:!![]})[_0xefb2('0x11')](function(_0x45837){logger[_0xefb2('0x12')](_0xefb2('0x1d'),_0x15f1a7);logger[_0xefb2('0x14')](_0xefb2('0x1d'),_0x15f1a7,JSON[_0xefb2('0x16')](_0x45837));_0x390c9d(_0x45837);})['catch'](function(_0x57fa34){logger[_0xefb2('0x17')]('CreateChatMessage',_0x57fa34[_0xefb2('0x1a')],_0x15f1a7);_0x161444(_0x254de6[_0xefb2('0x17')](0x1f4,_0x57fa34['message']));});});}; \ No newline at end of file +var _0xfebc=['ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x15681c,_0x1de42e){var _0x1cddf6=function(_0x38a706){while(--_0x38a706){_0x15681c['push'](_0x15681c['shift']());}};_0x1cddf6(++_0x1de42e);}(_0xfebc,0xb9));var _0xcfeb=function(_0x5de8bf,_0x24e115){_0x5de8bf=_0x5de8bf-0x0;var _0x2be3e3=_0xfebc[_0x5de8bf];return _0x2be3e3;};'use strict';var _=require(_0xcfeb('0x0'));var util=require(_0xcfeb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcfeb('0x2'));var fs=require('fs');var Redis=require(_0xcfeb('0x3'));var db=require(_0xcfeb('0x4'))['db'];var utils=require(_0xcfeb('0x5'));var logger=require(_0xcfeb('0x6'))(_0xcfeb('0x7'));var config=require(_0xcfeb('0x8'));var jayson=require(_0xcfeb('0x9'));var client=jayson[_0xcfeb('0xa')][_0xcfeb('0xb')]({'port':0x232a});config[_0xcfeb('0xc')]=_['defaults'](config[_0xcfeb('0xc')],{'host':_0xcfeb('0xd'),'port':0x18eb});var socket=require(_0xcfeb('0xe'))(new Redis(config['redis']));require(_0xcfeb('0xf'))[_0xcfeb('0x10')](socket);function respondWithRpcPromise(_0x49ba94,_0x2e4fdd,_0x5a5c42){return new BPromise(function(_0x104211,_0x4257bc){return client[_0xcfeb('0x11')](_0x49ba94,_0x5a5c42)[_0xcfeb('0x12')](function(_0x5a4196){logger[_0xcfeb('0x13')]('ChatMessage,\x20%s,\x20%s',_0x2e4fdd,_0xcfeb('0x14'));logger[_0xcfeb('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2e4fdd,_0xcfeb('0x14'),JSON[_0xcfeb('0x16')](_0x5a4196));if(_0x5a4196[_0xcfeb('0x17')]){if(_0x5a4196[_0xcfeb('0x17')][_0xcfeb('0x18')]===0x1f4){logger[_0xcfeb('0x17')](_0xcfeb('0x19'),_0x2e4fdd,_0x5a4196['error'][_0xcfeb('0x1a')]);return _0x4257bc(_0x5a4196[_0xcfeb('0x17')]['message']);}logger[_0xcfeb('0x17')](_0xcfeb('0x19'),_0x2e4fdd,_0x5a4196[_0xcfeb('0x17')]['message']);return _0x104211(_0x5a4196[_0xcfeb('0x17')][_0xcfeb('0x1a')]);}else{logger['info'](_0xcfeb('0x19'),_0x2e4fdd,_0xcfeb('0x14'));_0x104211(_0x5a4196[_0xcfeb('0x1b')][_0xcfeb('0x1a')]);}})['catch'](function(_0xaf48c0){logger[_0xcfeb('0x17')](_0xcfeb('0x19'),_0x2e4fdd,_0xaf48c0);_0x4257bc(_0xaf48c0);});});}exports[_0xcfeb('0x1c')]=function(_0x3d2b63){var _0x2dc617=this;return new Promise(function(_0x3d6983,_0x358b52){return db[_0xcfeb('0x1d')][_0xcfeb('0x1e')](_0x3d2b63[_0xcfeb('0x1f')],{'raw':_0x3d2b63[_0xcfeb('0x20')]?_0x3d2b63['options'][_0xcfeb('0x21')]===undefined?!![]:![]:!![]})[_0xcfeb('0x12')](function(_0x5ad9ae){logger['info'](_0xcfeb('0x1c'),_0x3d2b63);logger[_0xcfeb('0x15')](_0xcfeb('0x1c'),_0x3d2b63,JSON['stringify'](_0x5ad9ae));_0x3d6983(_0x5ad9ae);})[_0xcfeb('0x22')](function(_0x2ec81d){logger['error'](_0xcfeb('0x1c'),_0x2ec81d[_0xcfeb('0x1a')],_0x3d2b63);_0x358b52(_0x2dc617[_0xcfeb('0x17')](0x1f4,_0x2ec81d['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index f9a4eb2..784b270 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 _0x9c44=['emit','removeListener','length','chatMessage:','remove','update'];(function(_0x15456b,_0x427c10){var _0x4234a2=function(_0x4ddc77){while(--_0x4ddc77){_0x15456b['push'](_0x15456b['shift']());}};_0x4234a2(++_0x427c10);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x49c4('0x0'),_0x49c4('0x1')];function createListener(_0x26844b,_0x1ba0bb){return function(_0x455700){_0x1ba0bb[_0x49c4('0x2')](_0x26844b,_0x455700);};}function removeListener(_0x4e0313,_0x4941f1){return function(){ChatMessageEvents[_0x49c4('0x3')](_0x4e0313,_0x4941f1);};}exports['register']=function(_0xc1278f){for(var _0x6030ae=0x0,_0x69bc41=events[_0x49c4('0x4')];_0x6030ae<_0x69bc41;_0x6030ae++){var _0x436234=events[_0x6030ae];var _0x511d53=createListener(_0x49c4('0x5')+_0x436234,_0xc1278f);ChatMessageEvents['on'](_0x436234,_0x511d53);}}; \ No newline at end of file +var _0x008c=['./chatMessage.events','save','remove','update','emit','removeListener','register','chatMessage:'];(function(_0x5b1ccf,_0xec68f2){var _0x4767aa=function(_0x183ece){while(--_0x183ece){_0x5b1ccf['push'](_0x5b1ccf['shift']());}};_0x4767aa(++_0xec68f2);}(_0x008c,0x188));var _0xc008=function(_0x5e6116,_0x4bae08){_0x5e6116=_0x5e6116-0x0;var _0x29bf86=_0x008c[_0x5e6116];return _0x29bf86;};'use strict';var ChatMessageEvents=require(_0xc008('0x0'));var events=[_0xc008('0x1'),_0xc008('0x2'),_0xc008('0x3')];function createListener(_0x1d119a,_0x544fdf){return function(_0x3641af){_0x544fdf[_0xc008('0x4')](_0x1d119a,_0x3641af);};}function removeListener(_0x10b33c,_0x163bd9){return function(){ChatMessageEvents[_0xc008('0x5')](_0x10b33c,_0x163bd9);};}exports[_0xc008('0x6')]=function(_0x13aa7){for(var _0x39bb5e=0x0,_0x9c8cb2=events['length'];_0x39bb5e<_0x9c8cb2;_0x39bb5e++){var _0x428fa9=events[_0x39bb5e];var _0x5aa09b=createListener(_0xc008('0x7')+_0x428fa9,_0x13aa7);ChatMessageEvents['on'](_0x428fa9,_0x5aa09b);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 32b7347..1a83be8 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 _0xabee=['chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','tracked','chat'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xabee,0x1df));var _0xeabe=function(_0x2e0621,_0x2ac6c0){_0x2e0621=_0x2e0621-0x0;var _0x4a21c1=_0xabee[_0x2e0621];return _0x4a21c1;};'use strict';var multer=require(_0xeabe('0x0'));var util=require(_0xeabe('0x1'));var path=require(_0xeabe('0x2'));var timeout=require('connect-timeout');var express=require(_0xeabe('0x3'));var router=express['Router']();var auth=require(_0xeabe('0x4'));var interaction=require(_0xeabe('0x5'));var config=require(_0xeabe('0x6'));var controller=require('./chatMessage.controller');router[_0xeabe('0x7')]('/',auth[_0xeabe('0x8')](),controller[_0xeabe('0x9')]);router['get'](_0xeabe('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xeabe('0x7')](_0xeabe('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xeabe('0xc')]('/',auth[_0xeabe('0x8')](),interaction[_0xeabe('0xd')](_0xeabe('0xe'),_0xeabe('0xf')),controller[_0xeabe('0x10')]);router[_0xeabe('0x11')](_0xeabe('0xb'),controller[_0xeabe('0x12')]);router[_0xeabe('0x11')](_0xeabe('0x13'),auth[_0xeabe('0x8')](),controller[_0xeabe('0x14')]);router[_0xeabe('0x11')](_0xeabe('0x15'),auth[_0xeabe('0x8')](),controller[_0xeabe('0x16')]);router[_0xeabe('0x17')]('/:id',auth[_0xeabe('0x8')](),controller[_0xeabe('0x18')]);module[_0xeabe('0x19')]=router; \ No newline at end of file +var _0x7944=['/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','accept'];(function(_0x21eb13,_0x5a3060){var _0x439e40=function(_0x816b69){while(--_0x816b69){_0x21eb13['push'](_0x21eb13['shift']());}};_0x439e40(++_0x5a3060);}(_0x7944,0x71));var _0x4794=function(_0x307ce2,_0x41a7b3){_0x307ce2=_0x307ce2-0x0;var _0x24006e=_0x7944[_0x307ce2];return _0x24006e;};'use strict';var multer=require(_0x4794('0x0'));var util=require('util');var path=require(_0x4794('0x1'));var timeout=require(_0x4794('0x2'));var express=require(_0x4794('0x3'));var router=express['Router']();var auth=require(_0x4794('0x4'));var interaction=require(_0x4794('0x5'));var config=require(_0x4794('0x6'));var controller=require(_0x4794('0x7'));router[_0x4794('0x8')]('/',auth[_0x4794('0x9')](),controller[_0x4794('0xa')]);router[_0x4794('0x8')](_0x4794('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4794('0xc'),auth[_0x4794('0x9')](),controller[_0x4794('0xd')]);router[_0x4794('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x4794('0xf'),_0x4794('0x10')),controller[_0x4794('0x11')]);router[_0x4794('0x12')](_0x4794('0xc'),controller[_0x4794('0x13')]);router['put'](_0x4794('0x14'),auth[_0x4794('0x9')](),controller[_0x4794('0x15')]);router[_0x4794('0x12')](_0x4794('0x16'),auth[_0x4794('0x9')](),controller[_0x4794('0x17')]);router[_0x4794('0x18')](_0x4794('0xc'),auth[_0x4794('0x9')](),controller[_0x4794('0x19')]);module[_0x4794('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index a62d325..52dd7a9 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 _0x896e=['TEXT','sequelize','exports'];(function(_0x58788d,_0x88b74f){var _0x58ceba=function(_0x16a416){while(--_0x16a416){_0x58788d['push'](_0x58788d['shift']());}};_0x58ceba(++_0x88b74f);}(_0x896e,0x181));var _0xe896=function(_0x36cdcd,_0x17e30b){_0x36cdcd=_0x36cdcd-0x0;var _0x1ee059=_0x896e[_0x36cdcd];return _0x1ee059;};'use strict';var Sequelize=require(_0xe896('0x0'));module[_0xe896('0x1')]={'body':{'type':Sequelize[_0xe896('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x6782=['TEXT','medium','sequelize'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x6782,0xdd));var _0x2678=function(_0x3cf0a4,_0x2f96f0){_0x3cf0a4=_0x3cf0a4-0x0;var _0x4190e7=_0x6782[_0x3cf0a4];return _0x4190e7;};'use strict';var Sequelize=require(_0x2678('0x0'));module['exports']={'body':{'type':Sequelize[_0x2678('0x1')](_0x2678('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index e3de13f..7280e97 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 _0xa49b=['VIRTUAL','field','options','includeAll','findAll','show','params','rawAttributes','include','create','body','catch','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','count','offset','limit','Content-Range','json','save','update','then','destroy','end','error','stack','name','send','ChatOfflineMessage','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key'];(function(_0x496590,_0x3426e9){var _0x585ebc=function(_0x5a3f53){while(--_0x5a3f53){_0x496590['push'](_0x496590['shift']());}};_0x585ebc(++_0x3426e9);}(_0xa49b,0x126));var _0xba49=function(_0x1c5a2b,_0x44f2e5){_0x1c5a2b=_0x1c5a2b-0x0;var _0x32d9ee=_0xa49b[_0x1c5a2b];return _0x32d9ee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba49('0x0'));var rimraf=require(_0xba49('0x1'));var zipdir=require(_0xba49('0x2'));var jsonpatch=require(_0xba49('0x3'));var rp=require('request-promise');var moment=require(_0xba49('0x4'));var BPromise=require(_0xba49('0x5'));var Mustache=require(_0xba49('0x6'));var util=require('util');var path=require(_0xba49('0x7'));var sox=require(_0xba49('0x8'));var csv=require(_0xba49('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xba49('0xa'));var squel=require('squel');var crypto=require(_0xba49('0xb'));var jsforce=require(_0xba49('0xc'));var deskjs=require(_0xba49('0xd'));var toCsv=require('to-csv');var querystring=require(_0xba49('0xe'));var Papa=require(_0xba49('0xf'));var Redis=require(_0xba49('0x10'));var authService=require(_0xba49('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xba49('0x12'));var logger=require(_0xba49('0x13'))(_0xba49('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xba49('0x15'))['db'];function respondWithStatusCode(_0x5cff2f,_0x58b8bf){_0x58b8bf=_0x58b8bf||0xcc;return function(_0x5249cd){if(_0x5249cd){return _0x5cff2f[_0xba49('0x16')](_0x58b8bf);}return _0x5cff2f['status'](_0x58b8bf)['end']();};}function respondWithResult(_0x9e4b15,_0x9704e7){_0x9704e7=_0x9704e7||0xc8;return function(_0x1ad55f){if(_0x1ad55f){return _0x9e4b15[_0xba49('0x17')](_0x9704e7)['json'](_0x1ad55f);}};}function respondWithFilteredResult(_0x2a88f4,_0x2d9775){return function(_0x483d0e){if(_0x483d0e){var _0x51979b=_0x483d0e[_0xba49('0x18')],_0xc1053a=_0x2d9775['offset'],_0x1e11e4=_0x2d9775[_0xba49('0x19')]+_0x2d9775[_0xba49('0x1a')],_0x28df24;if(_0x1e11e4>=_0x51979b){_0x1e11e4=_0x51979b;_0x28df24=0xc8;}else{_0x28df24=0xce;}_0x2a88f4[_0xba49('0x17')](_0x28df24);return _0x2a88f4['set'](_0xba49('0x1b'),_0xc1053a+'-'+_0x1e11e4+'/'+_0x51979b)[_0xba49('0x1c')](_0x483d0e);}return null;};}function patchUpdates(_0x2cb910){return function(_0x4da3ca){try{jsonpatch['apply'](_0x4da3ca,_0x2cb910,!![]);}catch(_0x2dc548){return BPromise['reject'](_0x2dc548);}return _0x4da3ca[_0xba49('0x1d')]();};}function saveUpdates(_0x5cd475,_0x2c6617){return function(_0x36b21b){if(_0x36b21b){return _0x36b21b[_0xba49('0x1e')](_0x5cd475)[_0xba49('0x1f')](function(_0x11cb39){return _0x11cb39;});}return null;};}function removeEntity(_0x3369ee,_0x93c3f0){return function(_0x331ec2){if(_0x331ec2){return _0x331ec2[_0xba49('0x20')]()['then'](function(){_0x3369ee['status'](0xcc)[_0xba49('0x21')]();});}};}function handleEntityNotFound(_0x42670c,_0x479f81){return function(_0x54c9cd){if(!_0x54c9cd){_0x42670c['sendStatus'](0x194);}return _0x54c9cd;};}function handleError(_0x4e65c4,_0x26312e){_0x26312e=_0x26312e||0x1f4;return function(_0x3cd3f4){logger[_0xba49('0x22')](_0x3cd3f4[_0xba49('0x23')]);if(_0x3cd3f4[_0xba49('0x24')]){delete _0x3cd3f4[_0xba49('0x24')];}_0x4e65c4[_0xba49('0x17')](_0x26312e)[_0xba49('0x25')](_0x3cd3f4);};}exports['index']=function(_0x437357,_0x1056bd){var _0x1badf6={},_0x4b999b={},_0x23d288={'count':0x0,'rows':[]};var _0xf4d76c=db[_0xba49('0x26')]['rawAttributes'];_0x4b999b[_0xba49('0x27')]=_[_0xba49('0x28')](_0xf4d76c);_0x4b999b['query']=_[_0xba49('0x28')](_0x437357[_0xba49('0x29')]);_0x4b999b[_0xba49('0x2a')]=_[_0xba49('0x2b')](_0x4b999b[_0xba49('0x27')],_0x4b999b[_0xba49('0x29')]);_0x1badf6['attributes']=_[_0xba49('0x2b')](_0x4b999b['model'],qs[_0xba49('0x2c')](_0x437357[_0xba49('0x29')][_0xba49('0x2c')]));_0x1badf6['attributes']=_0x1badf6[_0xba49('0x2d')][_0xba49('0x2e')]?_0x1badf6[_0xba49('0x2d')]:_0x4b999b['model'];if(!_0x437357[_0xba49('0x29')][_0xba49('0x2f')]('nolimit')){_0x1badf6[_0xba49('0x1a')]=qs[_0xba49('0x1a')](_0x437357[_0xba49('0x29')]['limit']);_0x1badf6['offset']=qs[_0xba49('0x19')](_0x437357[_0xba49('0x29')][_0xba49('0x19')]);}_0x1badf6[_0xba49('0x30')]=qs[_0xba49('0x31')](_0x437357[_0xba49('0x29')]['sort']);_0x1badf6[_0xba49('0x32')]=qs[_0xba49('0x2a')](_['pick'](_0x437357[_0xba49('0x29')],_0x4b999b['filters']));if(_0x437357['query'][_0xba49('0x33')]){_0x1badf6['where']=_[_0xba49('0x34')](_0x1badf6[_0xba49('0x32')],{'$or':_[_0xba49('0x35')](_0xf4d76c,function(_0x115aaf){if(_0x115aaf[_0xba49('0x36')][_0xba49('0x37')]!==_0xba49('0x38')){var _0xc3a7b7={};_0xc3a7b7[_0x115aaf[_0xba49('0x39')]]={'$like':'%'+_0x437357[_0xba49('0x29')]['filter']+'%'};return _0xc3a7b7;}})});}_0x1badf6=_[_0xba49('0x34')]({},_0x1badf6,_0x437357[_0xba49('0x3a')]);var _0x257a97={'where':_0x1badf6[_0xba49('0x32')]};return db[_0xba49('0x26')][_0xba49('0x18')](_0x257a97)[_0xba49('0x1f')](function(_0x4d23b8){_0x23d288[_0xba49('0x18')]=_0x4d23b8;if(_0x437357['query'][_0xba49('0x3b')]){_0x1badf6['include']=[{'all':!![]}];}return db['ChatOfflineMessage'][_0xba49('0x3c')](_0x1badf6);})[_0xba49('0x1f')](function(_0x28e5fa){_0x23d288['rows']=_0x28e5fa;return _0x23d288;})['then'](respondWithFilteredResult(_0x1056bd,_0x1badf6))['catch'](handleError(_0x1056bd,null));};exports[_0xba49('0x3d')]=function(_0x567c33,_0xfc9696){var _0xf6294b={'raw':!![],'where':{'id':_0x567c33[_0xba49('0x3e')]['id']}},_0x47ddfa={};_0x47ddfa[_0xba49('0x27')]=_[_0xba49('0x28')](db[_0xba49('0x26')][_0xba49('0x3f')]);_0x47ddfa[_0xba49('0x29')]=_['keys'](_0x567c33['query']);_0x47ddfa[_0xba49('0x2a')]=_[_0xba49('0x2b')](_0x47ddfa[_0xba49('0x27')],_0x47ddfa[_0xba49('0x29')]);_0xf6294b[_0xba49('0x2d')]=_[_0xba49('0x2b')](_0x47ddfa[_0xba49('0x27')],qs[_0xba49('0x2c')](_0x567c33[_0xba49('0x29')][_0xba49('0x2c')]));_0xf6294b[_0xba49('0x2d')]=_0xf6294b[_0xba49('0x2d')][_0xba49('0x2e')]?_0xf6294b[_0xba49('0x2d')]:_0x47ddfa['model'];if(_0x567c33[_0xba49('0x29')][_0xba49('0x3b')]){_0xf6294b[_0xba49('0x40')]=[{'all':!![]}];}_0xf6294b=_['merge']({},_0xf6294b,_0x567c33[_0xba49('0x3a')]);return db[_0xba49('0x26')]['find'](_0xf6294b)['then'](handleEntityNotFound(_0xfc9696,null))[_0xba49('0x1f')](respondWithResult(_0xfc9696,null))['catch'](handleError(_0xfc9696,null));};exports[_0xba49('0x41')]=function(_0xa077b7,_0x3ef36f){return db[_0xba49('0x26')][_0xba49('0x41')](_0xa077b7[_0xba49('0x42')],{})['then'](respondWithResult(_0x3ef36f,0xc9))[_0xba49('0x43')](handleError(_0x3ef36f,null));};exports[_0xba49('0x1e')]=function(_0x173aa1,_0x1bd13b){if(_0x173aa1['body']['id']){delete _0x173aa1[_0xba49('0x42')]['id'];}return db[_0xba49('0x26')][_0xba49('0x44')]({'where':{'id':_0x173aa1['params']['id']}})['then'](handleEntityNotFound(_0x1bd13b,null))[_0xba49('0x1f')](saveUpdates(_0x173aa1[_0xba49('0x42')],null))[_0xba49('0x1f')](respondWithResult(_0x1bd13b,null))['catch'](handleError(_0x1bd13b,null));};exports[_0xba49('0x20')]=function(_0x21a49b,_0xd94990){return db['ChatOfflineMessage'][_0xba49('0x44')]({'where':{'id':_0x21a49b[_0xba49('0x3e')]['id']}})[_0xba49('0x1f')](handleEntityNotFound(_0xd94990,null))[_0xba49('0x1f')](removeEntity(_0xd94990,null))[_0xba49('0x43')](handleError(_0xd94990,null));};exports[_0xba49('0x45')]=function(_0x5984f9,_0x4ec57d){return db['ChatOfflineMessage'][_0xba49('0x45')]()[_0xba49('0x1f')](respondWithResult(_0x4ec57d,null))['catch'](handleError(_0x4ec57d,null));}; \ No newline at end of file +var _0xbf13=['query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','filter','merge','map','key','field','options','includeAll','include','findAll','rows','params','length','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','reject','save','update','then','error','name','send','ChatOfflineMessage','rawAttributes','keys'];(function(_0x51f311,_0x1e30ee){var _0xb32ac=function(_0xd9bd1d){while(--_0xd9bd1d){_0x51f311['push'](_0x51f311['shift']());}};_0xb32ac(++_0x1e30ee);}(_0xbf13,0xe2));var _0x3bf1=function(_0x2f43ee,_0x16f002){_0x2f43ee=_0x2f43ee-0x0;var _0x22fc22=_0xbf13[_0x2f43ee];return _0x22fc22;};'use strict';var pdf=require(_0x3bf1('0x0'));var emlformat=require(_0x3bf1('0x1'));var rimraf=require(_0x3bf1('0x2'));var zipdir=require(_0x3bf1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3bf1('0x4'));var BPromise=require(_0x3bf1('0x5'));var Mustache=require('mustache');var util=require(_0x3bf1('0x6'));var path=require(_0x3bf1('0x7'));var sox=require(_0x3bf1('0x8'));var csv=require(_0x3bf1('0x9'));var ejs=require(_0x3bf1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x3bf1('0xb'));var jsforce=require(_0x3bf1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3bf1('0x9'));var querystring=require(_0x3bf1('0xd'));var Papa=require(_0x3bf1('0xe'));var Redis=require(_0x3bf1('0xf'));var authService=require(_0x3bf1('0x10'));var qs=require(_0x3bf1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3bf1('0x12'));var utils=require(_0x3bf1('0x13'));var config=require('../../config/environment');var db=require(_0x3bf1('0x14'))['db'];function respondWithStatusCode(_0x5abcec,_0x2c8297){_0x2c8297=_0x2c8297||0xcc;return function(_0x237b02){if(_0x237b02){return _0x5abcec[_0x3bf1('0x15')](_0x2c8297);}return _0x5abcec[_0x3bf1('0x16')](_0x2c8297)[_0x3bf1('0x17')]();};}function respondWithResult(_0x2cebfb,_0x4c1a3c){_0x4c1a3c=_0x4c1a3c||0xc8;return function(_0x5ddb37){if(_0x5ddb37){return _0x2cebfb[_0x3bf1('0x16')](_0x4c1a3c)[_0x3bf1('0x18')](_0x5ddb37);}};}function respondWithFilteredResult(_0x3e8405,_0x124e01){return function(_0x2b7974){if(_0x2b7974){var _0x40335f=_0x2b7974[_0x3bf1('0x19')],_0xdc7282=_0x124e01[_0x3bf1('0x1a')],_0x863c2e=_0x124e01[_0x3bf1('0x1a')]+_0x124e01[_0x3bf1('0x1b')],_0x43e714;if(_0x863c2e>=_0x40335f){_0x863c2e=_0x40335f;_0x43e714=0xc8;}else{_0x43e714=0xce;}_0x3e8405[_0x3bf1('0x16')](_0x43e714);return _0x3e8405['set']('Content-Range',_0xdc7282+'-'+_0x863c2e+'/'+_0x40335f)[_0x3bf1('0x18')](_0x2b7974);}return null;};}function patchUpdates(_0x2b6fe1){return function(_0x140e51){try{jsonpatch['apply'](_0x140e51,_0x2b6fe1,!![]);}catch(_0x5a6b90){return BPromise[_0x3bf1('0x1c')](_0x5a6b90);}return _0x140e51[_0x3bf1('0x1d')]();};}function saveUpdates(_0x103b68,_0x13f371){return function(_0x45ed73){if(_0x45ed73){return _0x45ed73[_0x3bf1('0x1e')](_0x103b68)[_0x3bf1('0x1f')](function(_0x208b6b){return _0x208b6b;});}return null;};}function removeEntity(_0x306d67,_0x297128){return function(_0x1b8ae9){if(_0x1b8ae9){return _0x1b8ae9['destroy']()['then'](function(){_0x306d67[_0x3bf1('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331cee,_0x4f8ec8){return function(_0x58a2a6){if(!_0x58a2a6){_0x331cee[_0x3bf1('0x15')](0x194);}return _0x58a2a6;};}function handleError(_0x1f97f7,_0x34e572){_0x34e572=_0x34e572||0x1f4;return function(_0x21aee4){logger[_0x3bf1('0x20')](_0x21aee4['stack']);if(_0x21aee4[_0x3bf1('0x21')]){delete _0x21aee4['name'];}_0x1f97f7[_0x3bf1('0x16')](_0x34e572)[_0x3bf1('0x22')](_0x21aee4);};}exports['index']=function(_0x4dc3ce,_0x3a691d){var _0x2e4905={},_0x20db42={},_0x45b204={'count':0x0,'rows':[]};var _0x589a49=db[_0x3bf1('0x23')][_0x3bf1('0x24')];_0x20db42['model']=_[_0x3bf1('0x25')](_0x589a49);_0x20db42[_0x3bf1('0x26')]=_[_0x3bf1('0x25')](_0x4dc3ce[_0x3bf1('0x26')]);_0x20db42[_0x3bf1('0x27')]=_[_0x3bf1('0x28')](_0x20db42['model'],_0x20db42[_0x3bf1('0x26')]);_0x2e4905['attributes']=_[_0x3bf1('0x28')](_0x20db42[_0x3bf1('0x29')],qs['fields'](_0x4dc3ce['query'][_0x3bf1('0x2a')]));_0x2e4905[_0x3bf1('0x2b')]=_0x2e4905[_0x3bf1('0x2b')]['length']?_0x2e4905[_0x3bf1('0x2b')]:_0x20db42[_0x3bf1('0x29')];if(!_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x2c')](_0x3bf1('0x2d'))){_0x2e4905['limit']=qs['limit'](_0x4dc3ce['query'][_0x3bf1('0x1b')]);_0x2e4905[_0x3bf1('0x1a')]=qs['offset'](_0x4dc3ce['query'][_0x3bf1('0x1a')]);}_0x2e4905[_0x3bf1('0x2e')]=qs['sort'](_0x4dc3ce['query']['sort']);_0x2e4905[_0x3bf1('0x2f')]=qs[_0x3bf1('0x27')](_['pick'](_0x4dc3ce[_0x3bf1('0x26')],_0x20db42[_0x3bf1('0x27')]));if(_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x30')]){_0x2e4905[_0x3bf1('0x2f')]=_[_0x3bf1('0x31')](_0x2e4905[_0x3bf1('0x2f')],{'$or':_[_0x3bf1('0x32')](_0x589a49,function(_0x3af076){if(_0x3af076['type'][_0x3bf1('0x33')]!=='VIRTUAL'){var _0x3340b={};_0x3340b[_0x3af076[_0x3bf1('0x34')]]={'$like':'%'+_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x30')]+'%'};return _0x3340b;}})});}_0x2e4905=_[_0x3bf1('0x31')]({},_0x2e4905,_0x4dc3ce[_0x3bf1('0x35')]);var _0x4ff066={'where':_0x2e4905[_0x3bf1('0x2f')]};return db['ChatOfflineMessage'][_0x3bf1('0x19')](_0x4ff066)[_0x3bf1('0x1f')](function(_0x3cad0d){_0x45b204[_0x3bf1('0x19')]=_0x3cad0d;if(_0x4dc3ce[_0x3bf1('0x26')][_0x3bf1('0x36')]){_0x2e4905[_0x3bf1('0x37')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x3bf1('0x38')](_0x2e4905);})[_0x3bf1('0x1f')](function(_0x3a4c45){_0x45b204[_0x3bf1('0x39')]=_0x3a4c45;return _0x45b204;})[_0x3bf1('0x1f')](respondWithFilteredResult(_0x3a691d,_0x2e4905))['catch'](handleError(_0x3a691d,null));};exports['show']=function(_0x56d0a9,_0x7e9b9){var _0x5010f9={'raw':!![],'where':{'id':_0x56d0a9[_0x3bf1('0x3a')]['id']}},_0x378d59={};_0x378d59[_0x3bf1('0x29')]=_[_0x3bf1('0x25')](db[_0x3bf1('0x23')][_0x3bf1('0x24')]);_0x378d59[_0x3bf1('0x26')]=_[_0x3bf1('0x25')](_0x56d0a9[_0x3bf1('0x26')]);_0x378d59['filters']=_[_0x3bf1('0x28')](_0x378d59[_0x3bf1('0x29')],_0x378d59['query']);_0x5010f9[_0x3bf1('0x2b')]=_['intersection'](_0x378d59[_0x3bf1('0x29')],qs[_0x3bf1('0x2a')](_0x56d0a9[_0x3bf1('0x26')]['fields']));_0x5010f9['attributes']=_0x5010f9[_0x3bf1('0x2b')][_0x3bf1('0x3b')]?_0x5010f9[_0x3bf1('0x2b')]:_0x378d59[_0x3bf1('0x29')];if(_0x56d0a9[_0x3bf1('0x26')][_0x3bf1('0x36')]){_0x5010f9['include']=[{'all':!![]}];}_0x5010f9=_[_0x3bf1('0x31')]({},_0x5010f9,_0x56d0a9[_0x3bf1('0x35')]);return db['ChatOfflineMessage'][_0x3bf1('0x3c')](_0x5010f9)[_0x3bf1('0x1f')](handleEntityNotFound(_0x7e9b9,null))[_0x3bf1('0x1f')](respondWithResult(_0x7e9b9,null))[_0x3bf1('0x3d')](handleError(_0x7e9b9,null));};exports[_0x3bf1('0x3e')]=function(_0x5b65e1,_0x2ba92e){return db['ChatOfflineMessage'][_0x3bf1('0x3e')](_0x5b65e1['body'],{})[_0x3bf1('0x1f')](respondWithResult(_0x2ba92e,0xc9))[_0x3bf1('0x3d')](handleError(_0x2ba92e,null));};exports[_0x3bf1('0x1e')]=function(_0xeac57c,_0x6e4b83){if(_0xeac57c[_0x3bf1('0x3f')]['id']){delete _0xeac57c[_0x3bf1('0x3f')]['id'];}return db[_0x3bf1('0x23')][_0x3bf1('0x3c')]({'where':{'id':_0xeac57c[_0x3bf1('0x3a')]['id']}})[_0x3bf1('0x1f')](handleEntityNotFound(_0x6e4b83,null))[_0x3bf1('0x1f')](saveUpdates(_0xeac57c['body'],null))[_0x3bf1('0x1f')](respondWithResult(_0x6e4b83,null))[_0x3bf1('0x3d')](handleError(_0x6e4b83,null));};exports[_0x3bf1('0x40')]=function(_0x154806,_0x50fe73){return db[_0x3bf1('0x23')][_0x3bf1('0x3c')]({'where':{'id':_0x154806[_0x3bf1('0x3a')]['id']}})[_0x3bf1('0x1f')](handleEntityNotFound(_0x50fe73,null))[_0x3bf1('0x1f')](removeEntity(_0x50fe73,null))[_0x3bf1('0x3d')](handleError(_0x50fe73,null));};exports[_0x3bf1('0x41')]=function(_0xef2c0e,_0x12135a){return db[_0x3bf1('0x23')]['describe']()[_0x3bf1('0x1f')](respondWithResult(_0x12135a,null))[_0x3bf1('0x3d')](handleError(_0x12135a,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 72de171..f4b0cc9 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 _0xce59=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0xad229b,_0x21e8c4){var _0x4ab8ca=function(_0x28d529){while(--_0x28d529){_0xad229b['push'](_0xad229b['shift']());}};_0x4ab8ca(++_0x21e8c4);}(_0xce59,0x134));var _0x9ce5=function(_0x4fdaba,_0x5ba5de){_0x4fdaba=_0x4fdaba-0x0;var _0x4ead6a=_0xce59[_0x4fdaba];return _0x4ead6a;};'use strict';var _=require(_0x9ce5('0x0'));var util=require('util');var logger=require(_0x9ce5('0x1'))(_0x9ce5('0x2'));var moment=require(_0x9ce5('0x3'));var BPromise=require(_0x9ce5('0x4'));var rp=require(_0x9ce5('0x5'));var fs=require('fs');var path=require(_0x9ce5('0x6'));var rimraf=require('rimraf');var config=require(_0x9ce5('0x7'));var attributes=require(_0x9ce5('0x8'));module['exports']=function(_0x13c04e,_0x3ceb8){return _0x13c04e[_0x9ce5('0x9')](_0x9ce5('0xa'),attributes,{'tableName':_0x9ce5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ce5('0xc'),'collate':_0x9ce5('0xd')});}; \ No newline at end of file +var _0x3911=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3404af,_0x1bb80e){var _0xb38180=function(_0x31b0d8){while(--_0x31b0d8){_0x3404af['push'](_0x3404af['shift']());}};_0xb38180(++_0x1bb80e);}(_0x3911,0x152));var _0x1391=function(_0x400f2a,_0x52a559){_0x400f2a=_0x400f2a-0x0;var _0x3dd8d1=_0x3911[_0x400f2a];return _0x3dd8d1;};'use strict';var _=require(_0x1391('0x0'));var util=require(_0x1391('0x1'));var logger=require('../../config/logger')(_0x1391('0x2'));var moment=require(_0x1391('0x3'));var BPromise=require(_0x1391('0x4'));var rp=require(_0x1391('0x5'));var fs=require('fs');var path=require(_0x1391('0x6'));var rimraf=require(_0x1391('0x7'));var config=require(_0x1391('0x8'));var attributes=require(_0x1391('0x9'));module[_0x1391('0xa')]=function(_0x2df393,_0x5d8183){return _0x2df393[_0x1391('0xb')](_0x1391('0xc'),attributes,{'tableName':_0x1391('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x1391('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 83f3e00..29f94c2 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 _0x444d=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment'];(function(_0x458959,_0x4cdf7a){var _0xde7ff6=function(_0x4dbf8f){while(--_0x4dbf8f){_0x458959['push'](_0x458959['shift']());}};_0xde7ff6(++_0x4cdf7a);}(_0x444d,0x88));var _0xd444=function(_0x79ff3c,_0x264758){_0x79ff3c=_0x79ff3c-0x0;var _0x52f01b=_0x444d[_0x79ff3c];return _0x52f01b;};'use strict';var _=require('lodash');var util=require(_0xd444('0x0'));var moment=require(_0xd444('0x1'));var BPromise=require(_0xd444('0x2'));var rs=require(_0xd444('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd444('0x4'))['db'];var utils=require(_0xd444('0x5'));var logger=require(_0xd444('0x6'))(_0xd444('0x7'));var config=require('../../config/environment');var jayson=require(_0xd444('0x8'));var client=jayson[_0xd444('0x9')][_0xd444('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b82d0,_0x371fcd,_0x42eb04){return new BPromise(function(_0x48fc12,_0x42c138){return client[_0xd444('0xb')](_0x5b82d0,_0x42eb04)[_0xd444('0xc')](function(_0x555f53){logger[_0xd444('0xd')](_0xd444('0xe'),_0x371fcd,'request\x20sent');logger[_0xd444('0xf')](_0xd444('0x10'),_0x371fcd,_0xd444('0x11'),JSON['stringify'](_0x555f53));if(_0x555f53[_0xd444('0x12')]){if(_0x555f53[_0xd444('0x12')][_0xd444('0x13')]===0x1f4){logger[_0xd444('0x12')](_0xd444('0xe'),_0x371fcd,_0x555f53[_0xd444('0x12')][_0xd444('0x14')]);return _0x42c138(_0x555f53['error'][_0xd444('0x14')]);}logger[_0xd444('0x12')](_0xd444('0xe'),_0x371fcd,_0x555f53['error'][_0xd444('0x14')]);return _0x48fc12(_0x555f53[_0xd444('0x12')]['message']);}else{logger[_0xd444('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x371fcd,_0xd444('0x11'));_0x48fc12(_0x555f53[_0xd444('0x15')][_0xd444('0x14')]);}})[_0xd444('0x16')](function(_0x2426c6){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x371fcd,_0x2426c6);_0x42c138(_0x2426c6);});});} \ No newline at end of file +var _0x9b5d=['ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x9b5d,0x1a0));var _0xd9b5=function(_0x332f80,_0x3ec103){_0x332f80=_0x332f80-0x0;var _0x1f9127=_0x9b5d[_0x332f80];return _0x1f9127;};'use strict';var _=require(_0xd9b5('0x0'));var util=require(_0xd9b5('0x1'));var moment=require(_0xd9b5('0x2'));var BPromise=require(_0xd9b5('0x3'));var rs=require(_0xd9b5('0x4'));var fs=require('fs');var Redis=require(_0xd9b5('0x5'));var db=require(_0xd9b5('0x6'))['db'];var utils=require(_0xd9b5('0x7'));var logger=require(_0xd9b5('0x8'))(_0xd9b5('0x9'));var config=require(_0xd9b5('0xa'));var jayson=require(_0xd9b5('0xb'));var client=jayson[_0xd9b5('0xc')][_0xd9b5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5a60de,_0x5687e7,_0x13335d){return new BPromise(function(_0x2001f3,_0x5c8f32){return client[_0xd9b5('0xe')](_0x5a60de,_0x13335d)[_0xd9b5('0xf')](function(_0x2462b2){logger['info'](_0xd9b5('0x10'),_0x5687e7,_0xd9b5('0x11'));logger[_0xd9b5('0x12')](_0xd9b5('0x13'),_0x5687e7,'request\x20sent',JSON[_0xd9b5('0x14')](_0x2462b2));if(_0x2462b2[_0xd9b5('0x15')]){if(_0x2462b2[_0xd9b5('0x15')][_0xd9b5('0x16')]===0x1f4){logger[_0xd9b5('0x15')](_0xd9b5('0x10'),_0x5687e7,_0x2462b2[_0xd9b5('0x15')][_0xd9b5('0x17')]);return _0x5c8f32(_0x2462b2['error'][_0xd9b5('0x17')]);}logger['error'](_0xd9b5('0x10'),_0x5687e7,_0x2462b2[_0xd9b5('0x15')]['message']);return _0x2001f3(_0x2462b2[_0xd9b5('0x15')][_0xd9b5('0x17')]);}else{logger[_0xd9b5('0x18')](_0xd9b5('0x10'),_0x5687e7,'request\x20sent');_0x2001f3(_0x2462b2[_0xd9b5('0x19')][_0xd9b5('0x17')]);}})[_0xd9b5('0x1a')](function(_0x5e2dbb){logger['error'](_0xd9b5('0x10'),_0x5687e7,_0x5e2dbb);_0x5c8f32(_0x5e2dbb);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0ca6dae..dcbcabc 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 _0xab5b=['express','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','post','create','delete','destroy','multer','util','connect-timeout'];(function(_0x285db,_0x4f4926){var _0x2ebec6=function(_0x3a08c3){while(--_0x3a08c3){_0x285db['push'](_0x285db['shift']());}};_0x2ebec6(++_0x4f4926);}(_0xab5b,0x11a));var _0xbab5=function(_0x4748a9,_0x1c1600){_0x4748a9=_0x4748a9-0x0;var _0x4bbf32=_0xab5b[_0x4748a9];return _0x4bbf32;};'use strict';var multer=require(_0xbab5('0x0'));var util=require(_0xbab5('0x1'));var path=require('path');var timeout=require(_0xbab5('0x2'));var express=require(_0xbab5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbab5('0x4'));var config=require('../../config/environment');var controller=require(_0xbab5('0x5'));router[_0xbab5('0x6')]('/',auth[_0xbab5('0x7')](),controller[_0xbab5('0x8')]);router[_0xbab5('0x6')]('/describe',auth[_0xbab5('0x7')](),controller[_0xbab5('0x9')]);router[_0xbab5('0x6')](_0xbab5('0xa'),auth[_0xbab5('0x7')](),controller['show']);router[_0xbab5('0xb')]('/',auth[_0xbab5('0x7')](),controller[_0xbab5('0xc')]);router['put'](_0xbab5('0xa'),auth[_0xbab5('0x7')](),controller['update']);router[_0xbab5('0xd')](_0xbab5('0xa'),auth[_0xbab5('0x7')](),controller[_0xbab5('0xe')]);module['exports']=router; \ No newline at end of file +var _0xd51f=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','index','isAuthenticated','describe','/:id','post','create','delete'];(function(_0x367072,_0x334fa9){var _0x26b208=function(_0x573872){while(--_0x573872){_0x367072['push'](_0x367072['shift']());}};_0x26b208(++_0x334fa9);}(_0xd51f,0xf0));var _0xfd51=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd51f[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var path=require('path');var timeout=require(_0xfd51('0x2'));var express=require(_0xfd51('0x3'));var router=express['Router']();var auth=require(_0xfd51('0x4'));var interaction=require(_0xfd51('0x5'));var config=require('../../config/environment');var controller=require(_0xfd51('0x6'));router[_0xfd51('0x7')]('/',auth['isAuthenticated'](),controller[_0xfd51('0x8')]);router[_0xfd51('0x7')]('/describe',auth[_0xfd51('0x9')](),controller[_0xfd51('0xa')]);router[_0xfd51('0x7')](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller['show']);router[_0xfd51('0xc')]('/',auth[_0xfd51('0x9')](),controller[_0xfd51('0xd')]);router['put'](_0xfd51('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xfd51('0xe')](_0xfd51('0xb'),auth[_0xfd51('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index cf80375..1abff66 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 _0x3347=['timeout','mouseOver','INTEGER','sequelize','exports','STRING'];(function(_0xb42bff,_0x26fedf){var _0x32e8c1=function(_0x24fe87){while(--_0x24fe87){_0xb42bff['push'](_0xb42bff['shift']());}};_0x32e8c1(++_0x26fedf);}(_0x3347,0x10b));var _0x7334=function(_0x1631e0,_0x1b1db7){_0x1631e0=_0x1631e0-0x0;var _0x2317f7=_0x3347[_0x1631e0];return _0x2317f7;};'use strict';var Sequelize=require(_0x7334('0x0'));module[_0x7334('0x1')]={'name':{'type':Sequelize[_0x7334('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0x7334('0x3')),'defaultValue':_0x7334('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x7334('0x5')]}}; \ No newline at end of file +var _0x7a03=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x223212,_0x5da8ea){var _0x5de9ad=function(_0x2115f4){while(--_0x2115f4){_0x223212['push'](_0x223212['shift']());}};_0x5de9ad(++_0x5da8ea);}(_0x7a03,0x1b7));var _0x37a0=function(_0x398253,_0x347f5d){_0x398253=_0x398253-0x0;var _0x1dcb99=_0x7a03[_0x398253];return _0x1dcb99;};'use strict';var Sequelize=require(_0x37a0('0x0'));module[_0x37a0('0x1')]={'name':{'type':Sequelize[_0x37a0('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x37a0('0x3')](_0x37a0('0x4'),_0x37a0('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x37a0('0x2')]},'timeout':{'type':Sequelize[_0x37a0('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 25ae878..9dd4c21 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 _0x5acd=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','reject','update','then','destroy','stack','name','send','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','merge','options','ChatProactiveAction','catch','create','body','find','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x5acd,0x1e9));var _0xd5ac=function(_0x5efb09,_0x2a2723){_0x5efb09=_0x5efb09-0x0;var _0x3235e6=_0x5acd[_0x5efb09];return _0x3235e6;};'use strict';var pdf=require(_0xd5ac('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd5ac('0x1'));var jsonpatch=require(_0xd5ac('0x2'));var rp=require(_0xd5ac('0x3'));var moment=require(_0xd5ac('0x4'));var BPromise=require(_0xd5ac('0x5'));var Mustache=require('mustache');var util=require(_0xd5ac('0x6'));var path=require(_0xd5ac('0x7'));var sox=require(_0xd5ac('0x8'));var csv=require(_0xd5ac('0x9'));var ejs=require(_0xd5ac('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd5ac('0xb'));var jsforce=require(_0xd5ac('0xc'));var deskjs=require(_0xd5ac('0xd'));var toCsv=require(_0xd5ac('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd5ac('0xe'));var authService=require(_0xd5ac('0xf'));var qs=require(_0xd5ac('0x10'));var hardwareService=require(_0xd5ac('0x11'));var logger=require('../../config/logger')(_0xd5ac('0x12'));var utils=require(_0xd5ac('0x13'));var config=require('../../config/environment');var db=require(_0xd5ac('0x14'))['db'];function respondWithStatusCode(_0x12921d,_0x53497c){_0x53497c=_0x53497c||0xcc;return function(_0x1b484f){if(_0x1b484f){return _0x12921d[_0xd5ac('0x15')](_0x53497c);}return _0x12921d[_0xd5ac('0x16')](_0x53497c)[_0xd5ac('0x17')]();};}function respondWithResult(_0x44d490,_0x1b4723){_0x1b4723=_0x1b4723||0xc8;return function(_0x30a5bc){if(_0x30a5bc){return _0x44d490[_0xd5ac('0x16')](_0x1b4723)[_0xd5ac('0x18')](_0x30a5bc);}};}function respondWithFilteredResult(_0xb23b7,_0x5dc682){return function(_0x2c8d48){if(_0x2c8d48){var _0xd9a430=_0x2c8d48['count'],_0x1c25f3=_0x5dc682[_0xd5ac('0x19')],_0x1e0c3f=_0x5dc682['offset']+_0x5dc682[_0xd5ac('0x1a')],_0x2fb4f9;if(_0x1e0c3f>=_0xd9a430){_0x1e0c3f=_0xd9a430;_0x2fb4f9=0xc8;}else{_0x2fb4f9=0xce;}_0xb23b7[_0xd5ac('0x16')](_0x2fb4f9);return _0xb23b7['set']('Content-Range',_0x1c25f3+'-'+_0x1e0c3f+'/'+_0xd9a430)[_0xd5ac('0x18')](_0x2c8d48);}return null;};}function patchUpdates(_0x1b4995){return function(_0x2ca3e7){try{jsonpatch['apply'](_0x2ca3e7,_0x1b4995,!![]);}catch(_0x57863b){return BPromise[_0xd5ac('0x1b')](_0x57863b);}return _0x2ca3e7['save']();};}function saveUpdates(_0x1e410f,_0x196aeb){return function(_0x5def5f){if(_0x5def5f){return _0x5def5f[_0xd5ac('0x1c')](_0x1e410f)[_0xd5ac('0x1d')](function(_0x3db38d){return _0x3db38d;});}return null;};}function removeEntity(_0x5c680e,_0x507e36){return function(_0x28aa40){if(_0x28aa40){return _0x28aa40[_0xd5ac('0x1e')]()[_0xd5ac('0x1d')](function(){_0x5c680e[_0xd5ac('0x16')](0xcc)[_0xd5ac('0x17')]();});}};}function handleEntityNotFound(_0x227ef5,_0x56636e){return function(_0x16a04d){if(!_0x16a04d){_0x227ef5[_0xd5ac('0x15')](0x194);}return _0x16a04d;};}function handleError(_0x2da107,_0x174b46){_0x174b46=_0x174b46||0x1f4;return function(_0x10aab6){logger['error'](_0x10aab6[_0xd5ac('0x1f')]);if(_0x10aab6[_0xd5ac('0x20')]){delete _0x10aab6[_0xd5ac('0x20')];}_0x2da107[_0xd5ac('0x16')](_0x174b46)[_0xd5ac('0x21')](_0x10aab6);};}exports['show']=function(_0x55719f,_0x183cd9){var _0x3103da={'raw':!![],'where':{'id':_0x55719f[_0xd5ac('0x22')]['id']}},_0x4c61df={};_0x4c61df[_0xd5ac('0x23')]=_[_0xd5ac('0x24')](db['ChatProactiveAction'][_0xd5ac('0x25')]);_0x4c61df['query']=_[_0xd5ac('0x24')](_0x55719f[_0xd5ac('0x26')]);_0x4c61df['filters']=_[_0xd5ac('0x27')](_0x4c61df[_0xd5ac('0x23')],_0x4c61df[_0xd5ac('0x26')]);_0x3103da[_0xd5ac('0x28')]=_[_0xd5ac('0x27')](_0x4c61df[_0xd5ac('0x23')],qs[_0xd5ac('0x29')](_0x55719f[_0xd5ac('0x26')][_0xd5ac('0x29')]));_0x3103da[_0xd5ac('0x28')]=_0x3103da[_0xd5ac('0x28')][_0xd5ac('0x2a')]?_0x3103da['attributes']:_0x4c61df[_0xd5ac('0x23')];if(_0x55719f['query']['includeAll']){_0x3103da['include']=[{'all':!![]}];}_0x3103da=_[_0xd5ac('0x2b')]({},_0x3103da,_0x55719f[_0xd5ac('0x2c')]);return db[_0xd5ac('0x2d')]['find'](_0x3103da)[_0xd5ac('0x1d')](handleEntityNotFound(_0x183cd9,null))[_0xd5ac('0x1d')](respondWithResult(_0x183cd9,null))[_0xd5ac('0x2e')](handleError(_0x183cd9,null));};exports['create']=function(_0x1d7886,_0x46f220){return db[_0xd5ac('0x2d')][_0xd5ac('0x2f')](_0x1d7886[_0xd5ac('0x30')],{})['then'](respondWithResult(_0x46f220,0xc9))[_0xd5ac('0x2e')](handleError(_0x46f220,null));};exports[_0xd5ac('0x1c')]=function(_0x41e4fc,_0x32457e){if(_0x41e4fc['body']['id']){delete _0x41e4fc[_0xd5ac('0x30')]['id'];}return db[_0xd5ac('0x2d')][_0xd5ac('0x31')]({'where':{'id':_0x41e4fc['params']['id']}})[_0xd5ac('0x1d')](handleEntityNotFound(_0x32457e,null))[_0xd5ac('0x1d')](saveUpdates(_0x41e4fc[_0xd5ac('0x30')],null))[_0xd5ac('0x1d')](respondWithResult(_0x32457e,null))[_0xd5ac('0x2e')](handleError(_0x32457e,null));};exports[_0xd5ac('0x1e')]=function(_0x2c1b34,_0x59d639){return db[_0xd5ac('0x2d')][_0xd5ac('0x31')]({'where':{'id':_0x2c1b34['params']['id']}})[_0xd5ac('0x1d')](handleEntityNotFound(_0x59d639,null))['then'](removeEntity(_0x59d639,null))['catch'](handleError(_0x59d639,null));}; \ No newline at end of file +var _0xe15b=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','show','params','model','ChatProactiveAction','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','find','catch','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status'];(function(_0x43b487,_0x21893a){var _0x2f707a=function(_0x477ee0){while(--_0x477ee0){_0x43b487['push'](_0x43b487['shift']());}};_0x2f707a(++_0x21893a);}(_0xe15b,0x98));var _0xbe15=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0xe15b[_0x2a390b];return _0x5df10a;};'use strict';var pdf=require(_0xbe15('0x0'));var emlformat=require(_0xbe15('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbe15('0x2'));var jsonpatch=require(_0xbe15('0x3'));var rp=require(_0xbe15('0x4'));var moment=require(_0xbe15('0x5'));var BPromise=require(_0xbe15('0x6'));var Mustache=require(_0xbe15('0x7'));var util=require(_0xbe15('0x8'));var path=require(_0xbe15('0x9'));var sox=require(_0xbe15('0xa'));var csv=require(_0xbe15('0xb'));var ejs=require(_0xbe15('0xc'));var fs=require('fs');var _=require(_0xbe15('0xd'));var squel=require(_0xbe15('0xe'));var crypto=require(_0xbe15('0xf'));var jsforce=require(_0xbe15('0x10'));var deskjs=require(_0xbe15('0x11'));var toCsv=require(_0xbe15('0xb'));var querystring=require('querystring');var Papa=require(_0xbe15('0x12'));var Redis=require(_0xbe15('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbe15('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe15('0x15'))(_0xbe15('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xbe15('0x17'))['db'];function respondWithStatusCode(_0x1e8a85,_0x1267e0){_0x1267e0=_0x1267e0||0xcc;return function(_0xf1daf7){if(_0xf1daf7){return _0x1e8a85['sendStatus'](_0x1267e0);}return _0x1e8a85[_0xbe15('0x18')](_0x1267e0)['end']();};}function respondWithResult(_0x4b43c1,_0x4c5381){_0x4c5381=_0x4c5381||0xc8;return function(_0x51cddc){if(_0x51cddc){return _0x4b43c1[_0xbe15('0x18')](_0x4c5381)[_0xbe15('0x19')](_0x51cddc);}};}function respondWithFilteredResult(_0x116b4e,_0x46bb03){return function(_0x5aa42e){if(_0x5aa42e){var _0x27e0ea=_0x5aa42e[_0xbe15('0x1a')],_0x46cac9=_0x46bb03[_0xbe15('0x1b')],_0x3cfa72=_0x46bb03[_0xbe15('0x1b')]+_0x46bb03[_0xbe15('0x1c')],_0xca72d6;if(_0x3cfa72>=_0x27e0ea){_0x3cfa72=_0x27e0ea;_0xca72d6=0xc8;}else{_0xca72d6=0xce;}_0x116b4e[_0xbe15('0x18')](_0xca72d6);return _0x116b4e[_0xbe15('0x1d')](_0xbe15('0x1e'),_0x46cac9+'-'+_0x3cfa72+'/'+_0x27e0ea)[_0xbe15('0x19')](_0x5aa42e);}return null;};}function patchUpdates(_0x1b64a5){return function(_0x52b314){try{jsonpatch[_0xbe15('0x1f')](_0x52b314,_0x1b64a5,!![]);}catch(_0x1f2393){return BPromise[_0xbe15('0x20')](_0x1f2393);}return _0x52b314[_0xbe15('0x21')]();};}function saveUpdates(_0x18ce71,_0x240894){return function(_0x3cfe0d){if(_0x3cfe0d){return _0x3cfe0d[_0xbe15('0x22')](_0x18ce71)['then'](function(_0x534a6f){return _0x534a6f;});}return null;};}function removeEntity(_0x2f51fd,_0x1c0299){return function(_0x2d8acb){if(_0x2d8acb){return _0x2d8acb[_0xbe15('0x23')]()[_0xbe15('0x24')](function(){_0x2f51fd['status'](0xcc)[_0xbe15('0x25')]();});}};}function handleEntityNotFound(_0x3a72c4,_0x24951f){return function(_0x20348e){if(!_0x20348e){_0x3a72c4[_0xbe15('0x26')](0x194);}return _0x20348e;};}function handleError(_0x328b36,_0x62f550){_0x62f550=_0x62f550||0x1f4;return function(_0x5b694d){logger[_0xbe15('0x27')](_0x5b694d['stack']);if(_0x5b694d[_0xbe15('0x28')]){delete _0x5b694d[_0xbe15('0x28')];}_0x328b36['status'](_0x62f550)[_0xbe15('0x29')](_0x5b694d);};}exports[_0xbe15('0x2a')]=function(_0x4da1e5,_0x584aa1){var _0x54ec0c={'raw':!![],'where':{'id':_0x4da1e5[_0xbe15('0x2b')]['id']}},_0x40c471={};_0x40c471[_0xbe15('0x2c')]=_['keys'](db[_0xbe15('0x2d')]['rawAttributes']);_0x40c471[_0xbe15('0x2e')]=_[_0xbe15('0x2f')](_0x4da1e5['query']);_0x40c471[_0xbe15('0x30')]=_[_0xbe15('0x31')](_0x40c471[_0xbe15('0x2c')],_0x40c471['query']);_0x54ec0c[_0xbe15('0x32')]=_['intersection'](_0x40c471[_0xbe15('0x2c')],qs['fields'](_0x4da1e5[_0xbe15('0x2e')][_0xbe15('0x33')]));_0x54ec0c[_0xbe15('0x32')]=_0x54ec0c['attributes'][_0xbe15('0x34')]?_0x54ec0c['attributes']:_0x40c471[_0xbe15('0x2c')];if(_0x4da1e5['query'][_0xbe15('0x35')]){_0x54ec0c['include']=[{'all':!![]}];}_0x54ec0c=_[_0xbe15('0x36')]({},_0x54ec0c,_0x4da1e5['options']);return db[_0xbe15('0x2d')][_0xbe15('0x37')](_0x54ec0c)[_0xbe15('0x24')](handleEntityNotFound(_0x584aa1,null))[_0xbe15('0x24')](respondWithResult(_0x584aa1,null))[_0xbe15('0x38')](handleError(_0x584aa1,null));};exports[_0xbe15('0x39')]=function(_0xc795f2,_0x6ea5f0){return db['ChatProactiveAction'][_0xbe15('0x39')](_0xc795f2[_0xbe15('0x3a')],{})['then'](respondWithResult(_0x6ea5f0,0xc9))[_0xbe15('0x38')](handleError(_0x6ea5f0,null));};exports[_0xbe15('0x22')]=function(_0x378bcb,_0x2870d7){if(_0x378bcb[_0xbe15('0x3a')]['id']){delete _0x378bcb[_0xbe15('0x3a')]['id'];}return db['ChatProactiveAction'][_0xbe15('0x37')]({'where':{'id':_0x378bcb['params']['id']}})['then'](handleEntityNotFound(_0x2870d7,null))[_0xbe15('0x24')](saveUpdates(_0x378bcb[_0xbe15('0x3a')],null))[_0xbe15('0x24')](respondWithResult(_0x2870d7,null))[_0xbe15('0x38')](handleError(_0x2870d7,null));};exports[_0xbe15('0x23')]=function(_0x2282e6,_0x5e0086){return db[_0xbe15('0x2d')]['find']({'where':{'id':_0x2282e6[_0xbe15('0x2b')]['id']}})[_0xbe15('0x24')](handleEntityNotFound(_0x5e0086,null))[_0xbe15('0x24')](removeEntity(_0x5e0086,null))['catch'](handleError(_0x5e0086,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 616e735..f33de3b 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 _0x0c0a=['../../config/logger','moment','bluebird','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0x0c0a,0x15c));var _0xa0c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c0a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa0c0('0x0'));var util=require(_0xa0c0('0x1'));var logger=require(_0xa0c0('0x2'))('api');var moment=require(_0xa0c0('0x3'));var BPromise=require(_0xa0c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa0c0('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xa0c0('0x6')]=function(_0xca92bc,_0x411b33){return _0xca92bc[_0xa0c0('0x7')](_0xa0c0('0x8'),attributes,{'tableName':_0xa0c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf61f=['api','moment','request-promise','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util'];(function(_0x548d7d,_0x2d41fc){var _0xb1c878=function(_0x570f09){while(--_0x570f09){_0x548d7d['push'](_0x548d7d['shift']());}};_0xb1c878(++_0x2d41fc);}(_0xf61f,0x1a0));var _0xff61=function(_0x17c64b,_0x38ae9c){_0x17c64b=_0x17c64b-0x0;var _0x5ca37f=_0xf61f[_0x17c64b];return _0x5ca37f;};'use strict';var _=require(_0xff61('0x0'));var util=require(_0xff61('0x1'));var logger=require('../../config/logger')(_0xff61('0x2'));var moment=require(_0xff61('0x3'));var BPromise=require('bluebird');var rp=require(_0xff61('0x4'));var fs=require('fs');var path=require(_0xff61('0x5'));var rimraf=require(_0xff61('0x6'));var config=require('../../config/environment');var attributes=require(_0xff61('0x7'));module[_0xff61('0x8')]=function(_0x31c6a3,_0x315409){return _0x31c6a3[_0xff61('0x9')](_0xff61('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index c8ab1c2..1a5add1 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 _0xa9e0=['http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\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(_0x1e3a80,_0x30f28a){var _0x1580bf=function(_0x5cd98e){while(--_0x5cd98e){_0x1e3a80['push'](_0x1e3a80['shift']());}};_0x1580bf(++_0x30f28a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1bd5c9,_0x247071){var _0x36fbfe=function(_0x4c6ac1){while(--_0x4c6ac1){_0x1bd5c9['push'](_0x1bd5c9['shift']());}};_0x36fbfe(++_0x247071);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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']('ChatProactiveAction,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index d85dcb0..e4f6513 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 _0x174b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','connect-timeout','express'];(function(_0x427eac,_0x4d8cfb){var _0x499424=function(_0x46acb1){while(--_0x46acb1){_0x427eac['push'](_0x427eac['shift']());}};_0x499424(++_0x4d8cfb);}(_0x174b,0x19d));var _0xb174=function(_0x2fe4b8,_0x32dd32){_0x2fe4b8=_0x2fe4b8-0x0;var _0x1416c2=_0x174b[_0x2fe4b8];return _0x1416c2;};'use strict';var multer=require(_0xb174('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb174('0x1'));var express=require(_0xb174('0x2'));var router=express[_0xb174('0x3')]();var auth=require(_0xb174('0x4'));var interaction=require(_0xb174('0x5'));var config=require(_0xb174('0x6'));var controller=require('./chatProactiveAction.controller');router['get'](_0xb174('0x7'),auth[_0xb174('0x8')](),controller[_0xb174('0x9')]);router[_0xb174('0xa')]('/',auth[_0xb174('0x8')](),controller[_0xb174('0xb')]);router[_0xb174('0xc')](_0xb174('0x7'),auth[_0xb174('0x8')](),controller[_0xb174('0xd')]);router['delete'](_0xb174('0x7'),auth['isAuthenticated'](),controller[_0xb174('0xe')]);module[_0xb174('0xf')]=router; \ No newline at end of file +var _0xdd6e=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','show','create','put','/:id','exports','multer','util','path'];(function(_0x126afc,_0x23081a){var _0x23f312=function(_0x1d5f97){while(--_0x1d5f97){_0x126afc['push'](_0x126afc['shift']());}};_0x23f312(++_0x23081a);}(_0xdd6e,0xa5));var _0xedd6=function(_0x362ec1,_0x469c93){_0x362ec1=_0x362ec1-0x0;var _0x294231=_0xdd6e[_0x362ec1];return _0x294231;};'use strict';var multer=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var path=require(_0xedd6('0x2'));var timeout=require(_0xedd6('0x3'));var express=require('express');var router=express[_0xedd6('0x4')]();var auth=require(_0xedd6('0x5'));var interaction=require(_0xedd6('0x6'));var config=require(_0xedd6('0x7'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xedd6('0x8')](),controller[_0xedd6('0x9')]);router['post']('/',auth[_0xedd6('0x8')](),controller[_0xedd6('0xa')]);router[_0xedd6('0xb')](_0xedd6('0xc'),auth[_0xedd6('0x8')](),controller['update']);router['delete'](_0xedd6('0xc'),auth[_0xedd6('0x8')](),controller['destroy']);module[_0xedd6('0xd')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 686a47b..a667f71 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 _0x638d=['beepall','STRING','name','ENUM'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x638d,0x165));var _0xd638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd638('0x0')],'unique':_0xd638('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd638('0x2')]('rrmemory',_0xd638('0x3'),'roundrobin')}}; \ No newline at end of file +var _0x895c=['beepall','roundrobin','sequelize','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x895c,0x6a));var _0xc895=function(_0x4cf119,_0x139f57){_0x4cf119=_0x4cf119-0x0;var _0x5e7171=_0x895c[_0x4cf119];return _0x5e7171;};'use strict';var Sequelize=require(_0xc895('0x0'));module['exports']={'name':{'type':Sequelize[_0xc895('0x1')],'unique':_0xc895('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc895('0x1')]},'timeout':{'type':Sequelize[_0xc895('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc895('0x4')](_0xc895('0x5'),_0xc895('0x6'),_0xc895('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 95e652a..a4385a6 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 _0x3c45=['forEach','emit','userChatQueue:save','removeTeams','ids','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','socket.io-emitter','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','ChatQueue','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','user','ChatQueues','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','nolimit','filter','UserChatQueue','User','findAndCountAll','UserId','chatPause','createdAt','%s/%s','getTeams','Team','addTeams','teams','Agents','online','voicePause','flatMap','sequelize','transaction'];(function(_0x31bcbe,_0x4ce65b){var _0x485320=function(_0x1cb6d7){while(--_0x1cb6d7){_0x31bcbe['push'](_0x31bcbe['shift']());}};_0x485320(++_0x4ce65b);}(_0x3c45,0x1d5));var _0x53c4=function(_0x2a9e6f,_0x216211){_0x2a9e6f=_0x2a9e6f-0x0;var _0x1159d1=_0x3c45[_0x2a9e6f];return _0x1159d1;};'use strict';var pdf=require(_0x53c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x53c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x53c4('0x2'));var rp=require(_0x53c4('0x3'));var moment=require(_0x53c4('0x4'));var BPromise=require(_0x53c4('0x5'));var Mustache=require(_0x53c4('0x6'));var util=require(_0x53c4('0x7'));var path=require(_0x53c4('0x8'));var sox=require(_0x53c4('0x9'));var csv=require(_0x53c4('0xa'));var ejs=require(_0x53c4('0xb'));var fs=require('fs');var _=require(_0x53c4('0xc'));var squel=require(_0x53c4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x53c4('0xe'));var toCsv=require(_0x53c4('0xa'));var querystring=require(_0x53c4('0xf'));var Papa=require(_0x53c4('0x10'));var Redis=require(_0x53c4('0x11'));var authService=require(_0x53c4('0x12'));var qs=require(_0x53c4('0x13'));var hardwareService=require(_0x53c4('0x14'));var logger=require(_0x53c4('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x53c4('0x16'));var db=require(_0x53c4('0x17'))['db'];config[_0x53c4('0x18')]=_['defaults'](config[_0x53c4('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x53c4('0x19'))(new Redis(config[_0x53c4('0x18')]));require('./chatQueue.socket')[_0x53c4('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x53c4('0x1b')][_0x53c4('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x20fe47,_0x594f60,_0x3c7839){if(_0x3c7839){var _0x42ed10=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42ed10[_0x53c4('0x1d')](_0x594f60)){return _0x20fe47;}else{throw new Error(_0x53c4('0x1e'));}}else{return _0x20fe47;}}function respondWithRpcPromise(_0x4f1278,_0x38b413,_0x1a6c2d,_0x17f955){return new BPromise(function(_0xd26fa0,_0x1728ee){var _0xef4e7c=_0x17f955||client;return _0xef4e7c[_0x53c4('0x1f')](_0x4f1278,_0x1a6c2d)[_0x53c4('0x20')](function(_0x303800){logger[_0x53c4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x38b413,'request\x20sent');logger[_0x53c4('0x22')](_0x53c4('0x23'),_0x38b413,_0x53c4('0x24'),JSON[_0x53c4('0x25')](_0x303800));if(_0x303800['error']){if(_0x303800['error'][_0x53c4('0x26')]===0x1f4){logger[_0x53c4('0x27')](_0x53c4('0x28'),_0x38b413,_0x303800[_0x53c4('0x27')][_0x53c4('0x29')]);return _0x1728ee(_0x303800[_0x53c4('0x27')][_0x53c4('0x29')]);}logger[_0x53c4('0x27')](_0x53c4('0x28'),_0x38b413,_0x303800[_0x53c4('0x27')][_0x53c4('0x29')]);return _0xd26fa0(_0x303800[_0x53c4('0x27')][_0x53c4('0x29')]);}else{logger[_0x53c4('0x21')]('ChatQueue,\x20%s,\x20%s',_0x38b413,_0x53c4('0x24'));_0xd26fa0(_0x303800[_0x53c4('0x2a')]['message']);}})[_0x53c4('0x2b')](function(_0x556249){logger[_0x53c4('0x27')](_0x53c4('0x28'),_0x38b413,_0x556249);_0x1728ee(_0x556249);});});}function respondWithStatusCode(_0x5bcb2a,_0x3a76df){_0x3a76df=_0x3a76df||0xcc;return function(_0xefd924){if(_0xefd924){return _0x5bcb2a[_0x53c4('0x2c')](_0x3a76df);}return _0x5bcb2a[_0x53c4('0x2d')](_0x3a76df)['end']();};}function respondWithResult(_0x15e33c,_0x544fdf){_0x544fdf=_0x544fdf||0xc8;return function(_0x52c644){if(_0x52c644){return _0x15e33c[_0x53c4('0x2d')](_0x544fdf)[_0x53c4('0x2e')](_0x52c644);}};}function respondWithFilteredResult(_0x4d9853,_0x57f8ff){return function(_0x39cba3){if(_0x39cba3){var _0x342b7e=_0x39cba3[_0x53c4('0x2f')],_0x40e97f=_0x57f8ff[_0x53c4('0x30')],_0x26e372=_0x57f8ff['offset']+_0x57f8ff[_0x53c4('0x31')],_0x378b4c;if(_0x26e372>=_0x342b7e){_0x26e372=_0x342b7e;_0x378b4c=0xc8;}else{_0x378b4c=0xce;}_0x4d9853[_0x53c4('0x2d')](_0x378b4c);return _0x4d9853['set'](_0x53c4('0x32'),_0x40e97f+'-'+_0x26e372+'/'+_0x342b7e)[_0x53c4('0x2e')](_0x39cba3);}return null;};}function patchUpdates(_0x4ad572){return function(_0x42dfb9){try{jsonpatch[_0x53c4('0x33')](_0x42dfb9,_0x4ad572,!![]);}catch(_0x1bb23f){return BPromise[_0x53c4('0x34')](_0x1bb23f);}return _0x42dfb9[_0x53c4('0x35')]();};}function saveUpdates(_0x5c9b66,_0xb8fbf9){return function(_0x1fef8d){if(_0x1fef8d){return _0x1fef8d[_0x53c4('0x36')](_0x5c9b66)[_0x53c4('0x20')](function(_0x19f3d4){return _0x19f3d4;});}return null;};}function removeEntity(_0x485ac0,_0x5a09f6){return function(_0x2b71c8){if(_0x2b71c8){return _0x2b71c8[_0x53c4('0x37')]()[_0x53c4('0x20')](function(){var _0x4b299a=_0x2b71c8[_0x53c4('0x38')]({'plain':!![]});var _0x4a2ee8='ChatQueues';return db[_0x53c4('0x39')][_0x53c4('0x37')]({'where':{'type':_0x4a2ee8,'resourceId':_0x4b299a['id']}})['then'](function(){return _0x2b71c8;});})[_0x53c4('0x20')](function(){_0x485ac0[_0x53c4('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5945,_0x332114){return function(_0x35c3b8){if(!_0x35c3b8){_0x1c5945[_0x53c4('0x2c')](0x194);}return _0x35c3b8;};}function handleError(_0x933d02,_0x5a48e2){_0x5a48e2=_0x5a48e2||0x1f4;return function(_0x8feaaf){logger['error'](_0x8feaaf[_0x53c4('0x3a')]);if(_0x8feaaf[_0x53c4('0x3b')]){delete _0x8feaaf[_0x53c4('0x3b')];}_0x933d02[_0x53c4('0x2d')](_0x5a48e2)[_0x53c4('0x3c')](_0x8feaaf);};}exports['index']=function(_0x13e4c3,_0x1258c8){var _0x42349b={},_0x5b557e={},_0x9bd394={'count':0x0,'rows':[]};var _0xb18a0f=db[_0x53c4('0x3d')][_0x53c4('0x3e')];_0x5b557e[_0x53c4('0x3f')]=_[_0x53c4('0x40')](_0xb18a0f);_0x5b557e[_0x53c4('0x41')]=_['keys'](_0x13e4c3[_0x53c4('0x41')]);_0x5b557e[_0x53c4('0x42')]=_['intersection'](_0x5b557e[_0x53c4('0x3f')],_0x5b557e[_0x53c4('0x41')]);_0x42349b[_0x53c4('0x43')]=_[_0x53c4('0x44')](_0x5b557e['model'],qs['fields'](_0x13e4c3[_0x53c4('0x41')][_0x53c4('0x45')]));_0x42349b[_0x53c4('0x43')]=_0x42349b[_0x53c4('0x43')][_0x53c4('0x46')]?_0x42349b[_0x53c4('0x43')]:_0x5b557e[_0x53c4('0x3f')];if(!_0x13e4c3[_0x53c4('0x41')]['hasOwnProperty']('nolimit')){_0x42349b['limit']=qs[_0x53c4('0x31')](_0x13e4c3['query']['limit']);_0x42349b[_0x53c4('0x30')]=qs[_0x53c4('0x30')](_0x13e4c3['query']['offset']);}_0x42349b[_0x53c4('0x47')]=qs[_0x53c4('0x48')](_0x13e4c3[_0x53c4('0x41')]['sort']);_0x42349b[_0x53c4('0x49')]=qs[_0x53c4('0x42')](_[_0x53c4('0x4a')](_0x13e4c3[_0x53c4('0x41')],_0x5b557e[_0x53c4('0x42')]));if(_0x13e4c3[_0x53c4('0x41')]['filter']){_0x42349b[_0x53c4('0x49')]=_[_0x53c4('0x4b')](_0x42349b['where'],{'$or':_[_0x53c4('0x4c')](_0xb18a0f,function(_0x44fb48){if(_0x44fb48[_0x53c4('0x4d')][_0x53c4('0x4e')]!==_0x53c4('0x4f')){var _0x6b948d={};_0x6b948d[_0x44fb48[_0x53c4('0x50')]]={'$like':'%'+_0x13e4c3[_0x53c4('0x41')]['filter']+'%'};return _0x6b948d;}})});}_0x42349b=_['merge']({},_0x42349b,_0x13e4c3[_0x53c4('0x51')]);var _0x4fc38e={'where':_0x42349b[_0x53c4('0x49')]};return db[_0x53c4('0x3d')]['count'](_0x4fc38e)[_0x53c4('0x20')](function(_0x2a48c3){_0x9bd394['count']=_0x2a48c3;if(_0x13e4c3[_0x53c4('0x41')][_0x53c4('0x52')]){_0x42349b[_0x53c4('0x53')]=[{'all':!![]}];}return db['ChatQueue'][_0x53c4('0x54')](_0x42349b);})[_0x53c4('0x20')](function(_0x2e6e39){_0x9bd394[_0x53c4('0x55')]=_0x2e6e39;return _0x9bd394;})['then'](respondWithFilteredResult(_0x1258c8,_0x42349b))['catch'](handleError(_0x1258c8,null));};exports[_0x53c4('0x56')]=function(_0x17cdbd,_0x2f4ba2){var _0x3d55f6={'raw':!![],'where':{'id':_0x17cdbd[_0x53c4('0x57')]['id']}},_0x586f25={};_0x586f25['model']=_[_0x53c4('0x40')](db[_0x53c4('0x3d')][_0x53c4('0x3e')]);_0x586f25[_0x53c4('0x41')]=_[_0x53c4('0x40')](_0x17cdbd[_0x53c4('0x41')]);_0x586f25[_0x53c4('0x42')]=_['intersection'](_0x586f25['model'],_0x586f25[_0x53c4('0x41')]);_0x3d55f6[_0x53c4('0x43')]=_[_0x53c4('0x44')](_0x586f25[_0x53c4('0x3f')],qs[_0x53c4('0x45')](_0x17cdbd[_0x53c4('0x41')][_0x53c4('0x45')]));_0x3d55f6['attributes']=_0x3d55f6[_0x53c4('0x43')][_0x53c4('0x46')]?_0x3d55f6[_0x53c4('0x43')]:_0x586f25[_0x53c4('0x3f')];if(_0x17cdbd[_0x53c4('0x41')][_0x53c4('0x52')]){_0x3d55f6[_0x53c4('0x53')]=[{'all':!![]}];}_0x3d55f6=_[_0x53c4('0x4b')]({},_0x3d55f6,_0x17cdbd[_0x53c4('0x51')]);return db[_0x53c4('0x3d')][_0x53c4('0x58')](_0x3d55f6)[_0x53c4('0x20')](handleEntityNotFound(_0x2f4ba2,null))[_0x53c4('0x20')](respondWithResult(_0x2f4ba2,null))[_0x53c4('0x2b')](handleError(_0x2f4ba2,null));};exports[_0x53c4('0x59')]=function(_0x4bf77f,_0x12dacb){return db[_0x53c4('0x3d')][_0x53c4('0x59')](_0x4bf77f[_0x53c4('0x5a')],{})[_0x53c4('0x20')](function(_0x191189){var _0xe77944=_0x4bf77f[_0x53c4('0x5b')][_0x53c4('0x38')]({'plain':!![]});if(!_0xe77944)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe77944['role']===_0x53c4('0x5b')){var _0x4f32b4=_0x191189['get']({'plain':!![]});var _0x7515b1=_0x53c4('0x5c');return db[_0x53c4('0x5d')][_0x53c4('0x58')]({'where':{'name':_0x7515b1,'userProfileId':_0xe77944[_0x53c4('0x5e')]},'raw':!![]})[_0x53c4('0x20')](function(_0x49c617){if(_0x49c617&&_0x49c617['autoAssociation']===0x0){return db[_0x53c4('0x39')][_0x53c4('0x59')]({'name':_0x4f32b4[_0x53c4('0x3b')],'resourceId':_0x4f32b4['id'],'type':_0x49c617[_0x53c4('0x3b')],'sectionId':_0x49c617['id']},{})[_0x53c4('0x20')](function(){return _0x191189;});}else{return _0x191189;}})[_0x53c4('0x2b')](function(_0x5c0629){logger['error'](_0x53c4('0x5f'),_0x5c0629);throw _0x5c0629;});}return _0x191189;})['then'](respondWithResult(_0x12dacb,0xc9))[_0x53c4('0x2b')](handleError(_0x12dacb,null));};exports[_0x53c4('0x36')]=function(_0x220260,_0x3b6a10){if(_0x220260[_0x53c4('0x5a')]['id']){delete _0x220260[_0x53c4('0x5a')]['id'];}return db['ChatQueue'][_0x53c4('0x58')]({'where':{'id':_0x220260[_0x53c4('0x57')]['id']}})[_0x53c4('0x20')](handleEntityNotFound(_0x3b6a10,null))['then'](saveUpdates(_0x220260[_0x53c4('0x5a')],null))['then'](respondWithResult(_0x3b6a10,null))[_0x53c4('0x2b')](handleError(_0x3b6a10,null));};exports['destroy']=function(_0x17f3ec,_0x568e34){return db[_0x53c4('0x3d')][_0x53c4('0x58')]({'where':{'id':_0x17f3ec[_0x53c4('0x57')]['id']}})[_0x53c4('0x20')](handleEntityNotFound(_0x568e34,null))['then'](removeEntity(_0x568e34,null))[_0x53c4('0x2b')](handleError(_0x568e34,null));};exports['describe']=function(_0x228641,_0x38d7d3){return db[_0x53c4('0x3d')][_0x53c4('0x60')]()[_0x53c4('0x20')](respondWithResult(_0x38d7d3,null))['catch'](handleError(_0x38d7d3,null));};exports[_0x53c4('0x61')]=function(_0x53dc4b,_0x289b52,_0x2366c2){var _0x496736={'raw':!![],'where':{}},_0xe0602e={},_0x1729cd;return db[_0x53c4('0x3d')][_0x53c4('0x62')]({'where':{'id':_0x53dc4b[_0x53c4('0x57')]['id']}})[_0x53c4('0x20')](handleEntityNotFound(_0x289b52,null))[_0x53c4('0x20')](function(_0x4e5519){if(_0x4e5519){_0x1729cd=_0x4e5519['get']({'plain':!![]});_0xe0602e['model']=_['keys'](db['UserChatQueue'][_0x53c4('0x3e')]);_0xe0602e[_0x53c4('0x41')]=_[_0x53c4('0x40')](_0x53dc4b['query']);_0xe0602e[_0x53c4('0x42')]=_[_0x53c4('0x44')](_0xe0602e['model'],_0xe0602e[_0x53c4('0x41')]);_0x496736[_0x53c4('0x43')]=_['intersection'](_0xe0602e[_0x53c4('0x3f')],qs['fields'](_0x53dc4b[_0x53c4('0x41')][_0x53c4('0x45')]));_0x496736[_0x53c4('0x43')]=_0x496736[_0x53c4('0x43')][_0x53c4('0x46')]?_0x496736[_0x53c4('0x43')]:_0xe0602e[_0x53c4('0x3f')];if(!_0x53dc4b[_0x53c4('0x41')][_0x53c4('0x63')](_0x53c4('0x64'))){_0x496736[_0x53c4('0x31')]=qs[_0x53c4('0x31')](_0x53dc4b[_0x53c4('0x41')][_0x53c4('0x31')]);_0x496736[_0x53c4('0x30')]=qs[_0x53c4('0x30')](_0x53dc4b[_0x53c4('0x41')][_0x53c4('0x30')]);}_0x496736[_0x53c4('0x47')]=qs[_0x53c4('0x48')](_0x53dc4b[_0x53c4('0x41')][_0x53c4('0x48')]);_0x496736[_0x53c4('0x49')]=qs[_0x53c4('0x42')](_['pick'](_0x53dc4b[_0x53c4('0x41')],_0xe0602e[_0x53c4('0x42')]));_0x496736[_0x53c4('0x49')]['ChatQueueId']=_0x4e5519['id'];if(_0x53dc4b[_0x53c4('0x41')][_0x53c4('0x65')]){_0x496736[_0x53c4('0x49')]=_['merge'](_0x496736[_0x53c4('0x49')],{'$or':_[_0x53c4('0x4c')](_0x496736['attributes'],function(_0x4dda99){var _0x1b5492={};_0x1b5492[_0x4dda99]={'$like':'%'+_0x53dc4b[_0x53c4('0x41')]['filter']+'%'};return _0x1b5492;})});}_0x496736=_[_0x53c4('0x4b')]({},_0x496736,_0x53dc4b['options']);return db[_0x53c4('0x66')]['findAll'](_0x496736);}})[_0x53c4('0x20')](function(_0x4da296){if(_0x4da296){return db[_0x53c4('0x67')][_0x53c4('0x68')]({'where':{'id':_[_0x53c4('0x4c')](_0x4da296,_0x53c4('0x69')),'role':'agent'},'attributes':['id','name',_0x53c4('0x6a'),'updatedAt',_0x53c4('0x6b')]});}})['then'](function(_0xba51c8){if(_0xba51c8){return{'count':_0xba51c8[_0x53c4('0x2f')],'rows':_['map'](_0xba51c8[_0x53c4('0x55')],function(_0x5f3372){return{'membername':_0x5f3372[_0x53c4('0x3b')],'UserId':_0x5f3372['id'],'queue_name':_0x1729cd[_0x53c4('0x3b')],'ChatQueueId':_0x1729cd['id'],'interface':util['format'](_0x53c4('0x6c'),'SIP',_0x5f3372[_0x53c4('0x3b')]),'penalty':0x0,'paused':_0x5f3372[_0x53c4('0x6a')],'createdAt':_0x5f3372[_0x53c4('0x6b')],'updatedAt':_0x5f3372['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x53c4('0x20')](respondWithFilteredResult(_0x289b52,_0x496736))[_0x53c4('0x2b')](handleError(_0x289b52,null));};exports[_0x53c4('0x6d')]=function(_0x44dadd,_0xf1b00d,_0x2e1d61){var _0x486d94={};var _0x326b4e={};var _0x39adb5;var _0x448255;return db[_0x53c4('0x3d')][_0x53c4('0x62')]({'where':{'id':_0x44dadd['params']['id']}})['then'](handleEntityNotFound(_0xf1b00d,null))[_0x53c4('0x20')](function(_0x364174){if(_0x364174){_0x39adb5=_0x364174;_0x326b4e[_0x53c4('0x3f')]=_['keys'](db[_0x53c4('0x6e')]['rawAttributes']);_0x326b4e[_0x53c4('0x41')]=_[_0x53c4('0x40')](_0x44dadd[_0x53c4('0x41')]);_0x326b4e['filters']=_[_0x53c4('0x44')](_0x326b4e['model'],_0x326b4e[_0x53c4('0x41')]);_0x486d94[_0x53c4('0x43')]=_['intersection'](_0x326b4e[_0x53c4('0x3f')],qs[_0x53c4('0x45')](_0x44dadd['query'][_0x53c4('0x45')]));_0x486d94['attributes']=_0x486d94['attributes'][_0x53c4('0x46')]?_0x486d94['attributes']:_0x326b4e[_0x53c4('0x3f')];_0x486d94['order']=qs['sort'](_0x44dadd['query'][_0x53c4('0x48')]);_0x486d94[_0x53c4('0x49')]=qs[_0x53c4('0x42')](_[_0x53c4('0x4a')](_0x44dadd[_0x53c4('0x41')],_0x326b4e['filters']));if(_0x44dadd[_0x53c4('0x41')]['filter']){_0x486d94[_0x53c4('0x49')]=_[_0x53c4('0x4b')](_0x486d94[_0x53c4('0x49')],{'$or':_[_0x53c4('0x4c')](_0x486d94[_0x53c4('0x43')],function(_0x421ce0){var _0x5f4695={};_0x5f4695[_0x421ce0]={'$like':'%'+_0x44dadd[_0x53c4('0x41')]['filter']+'%'};return _0x5f4695;})});}_0x486d94=_[_0x53c4('0x4b')]({},_0x486d94,_0x44dadd[_0x53c4('0x51')]);return _0x39adb5[_0x53c4('0x6d')](_0x486d94);}})[_0x53c4('0x20')](function(_0x45ecac){if(_0x45ecac){_0x448255=_0x45ecac[_0x53c4('0x46')];if(!_0x44dadd[_0x53c4('0x41')][_0x53c4('0x63')](_0x53c4('0x64'))){_0x486d94[_0x53c4('0x31')]=qs['limit'](_0x44dadd[_0x53c4('0x41')]['limit']);_0x486d94[_0x53c4('0x30')]=qs[_0x53c4('0x30')](_0x44dadd[_0x53c4('0x41')][_0x53c4('0x30')]);}return _0x39adb5[_0x53c4('0x6d')](_0x486d94);}})[_0x53c4('0x20')](function(_0x405ee4){if(_0x405ee4){return _0x405ee4?{'count':_0x448255,'rows':_0x405ee4}:null;}})['then'](respondWithResult(_0xf1b00d,null))[_0x53c4('0x2b')](handleError(_0xf1b00d,null));};exports[_0x53c4('0x6f')]=function(_0x239807,_0x4596d8,_0x8c65){var _0x1cc9d1=_0x239807['body'][_0x53c4('0x70')];return db['Team'][_0x53c4('0x54')]({'where':{'id':_[_0x53c4('0x4c')](_0x1cc9d1,'id')},'attributes':['id'],'include':[{'model':db[_0x53c4('0x67')],'as':_0x53c4('0x71'),'attributes':['id',_0x53c4('0x3b'),_0x53c4('0x72'),_0x53c4('0x73'),'interface'],'raw':!![]}]})['then'](function(_0x348d90){if(_0x348d90){var _0x208417=_[_0x53c4('0x74')](_0x348d90,function(_0x3604f1){var _0x53b30f=_0x3604f1['get']({'plain':!![]});return _0x53b30f[_0x53c4('0x71')];});return db['ChatQueue'][_0x53c4('0x58')]({'where':{'id':_0x239807['params']['id']}})[_0x53c4('0x20')](function(_0x3f8e22){return db[_0x53c4('0x75')][_0x53c4('0x76')](function(_0x75bed){return _0x3f8e22[_0x53c4('0x6f')](_[_0x53c4('0x4c')](_0x1cc9d1,'id'),{'transaction':_0x75bed})[_0x53c4('0x20')](function(){return BPromise['each'](_0x208417,function(_0x518e0e){return db[_0x53c4('0x66')]['findOrCreate']({'where':{'UserId':_0x518e0e['id'],'ChatQueueId':_0x239807['params']['id']},'transaction':_0x75bed});});})['then'](function(){_0x208417[_0x53c4('0x77')](function(_0x115774){socket[_0x53c4('0x78')](_0x53c4('0x79'),{'UserId':_0x115774['id'],'ChatQueueId':_0x3f8e22['id']});});});});});}})[_0x53c4('0x20')](respondWithStatusCode(_0x4596d8,null))[_0x53c4('0x2b')](handleError(_0x4596d8,null));};exports[_0x53c4('0x7a')]=function(_0x3fc0a5,_0x1fd26b,_0x25c501){return db[_0x53c4('0x6e')][_0x53c4('0x54')]({'where':{'id':_0x3fc0a5[_0x53c4('0x41')][_0x53c4('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x53c4('0x67')],'as':_0x53c4('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1fd26b,null))[_0x53c4('0x20')](function(_0x9f64b5){var _0x544d82=_[_0x53c4('0x4c')](_0x9f64b5,'id');var _0x2a84ae=[];var _0x105091=[];var _0x31a4ca=squel['select']();_0x31a4ca[_0x53c4('0x50')](_0x53c4('0x7c'))[_0x53c4('0x7d')](_0x53c4('0x7e'),'tq')[_0x53c4('0x7f')]('user_has_teams','ut',_0x53c4('0x80'))['where'](_0x53c4('0x81'),_0x3fc0a5[_0x53c4('0x57')]['id']);for(var _0x6e9965=0x0;_0x6e9965<_0x9f64b5[_0x53c4('0x46')];_0x6e9965+=0x1){let _0xd81689=_0x9f64b5[_0x6e9965];for(var _0x2a2a5f=0x0;_0x2a2a5f<_0xd81689[_0x53c4('0x71')]['length'];_0x2a2a5f+=0x1){let _0xfe5c9a=_0xd81689[_0x53c4('0x71')][_0x2a2a5f];var _0x557436=_0x31a4ca[_0x53c4('0x82')]();_0x557436[_0x53c4('0x49')](_0x53c4('0x83'),_0xfe5c9a['id']);_0x105091[_0x53c4('0x84')](db[_0x53c4('0x75')][_0x53c4('0x41')](_0x557436['toString'](),{'type':db[_0x53c4('0x75')]['QueryTypes'][_0x53c4('0x85')]})['then'](function(_0x9f456){if(_0x9f456[_0x53c4('0x46')]===0x1){return _0xfe5c9a['id'];}else{var _0xb1ef74=_[_0x53c4('0x86')](_[_0x53c4('0x4c')](_0x9f456,_0x53c4('0x87')),function(_0x430b93){return _['includes'](_0x544d82,_0x430b93);});if(_0xb1ef74){return _0xfe5c9a['id'];}}}));}}return BPromise[_0x53c4('0x88')](_0x105091)[_0x53c4('0x20')](function(_0x114e3c){_0x2a84ae=_(_0x2a84ae)[_0x53c4('0x89')](_0x114e3c)[_0x53c4('0x8a')]()['value']();return db['ChatQueue'][_0x53c4('0x58')]({'where':{'id':_0x3fc0a5[_0x53c4('0x57')]['id']}})[_0x53c4('0x20')](function(_0x3cc76f){return db[_0x53c4('0x75')][_0x53c4('0x76')](function(_0x912d78){return _0x3cc76f['removeTeams'](_0x3fc0a5[_0x53c4('0x41')][_0x53c4('0x7b')],{'transaction':_0x912d78})[_0x53c4('0x20')](function(){if(!_[_0x53c4('0x8b')](_0x2a84ae)){return _0x3cc76f[_0x53c4('0x8c')](_0x2a84ae,{'transaction':_0x912d78});}})['then'](function(){_0x2a84ae[_0x53c4('0x77')](function(_0x17b111){socket['emit'](_0x53c4('0x8d'),{'UserId':_0x17b111,'ChatQueueId':_0x3cc76f['id']});});});});});});})[_0x53c4('0x20')](respondWithStatusCode(_0x1fd26b,null))[_0x53c4('0x2b')](handleError(_0x1fd26b,null));};exports[_0x53c4('0x8e')]=function(_0x140a36,_0x56c5e,_0xa4b1a2){return db[_0x53c4('0x3d')][_0x53c4('0x58')]({'where':{'id':_0x140a36['params']['id']}})[_0x53c4('0x20')](handleEntityNotFound(_0x56c5e,null))[_0x53c4('0x20')](function(_0xc71e35){if(_0xc71e35){return _0xc71e35['addAgents'](_0x140a36[_0x53c4('0x5a')][_0x53c4('0x7b')],_[_0x53c4('0x8f')](_0x140a36[_0x53c4('0x5a')],[_0x53c4('0x7b'),'id'])||{})[_0x53c4('0x90')](function(_0x540bd9){for(var _0x2235ae=0x0;_0x2235ae<_0x140a36[_0x53c4('0x5a')][_0x53c4('0x7b')][_0x53c4('0x46')];_0x2235ae+=0x1){socket['emit'](_0x53c4('0x79'),{'UserId':_0x140a36[_0x53c4('0x5a')]['ids'][_0x2235ae],'ChatQueueId':_0x140a36['params']['id']});}return _0x540bd9;});}})[_0x53c4('0x20')](respondWithResult(_0x56c5e,null))[_0x53c4('0x2b')](handleError(_0x56c5e,null));};exports['removeAgents']=function(_0x3df05e,_0x1401c9,_0x60247a){return db[_0x53c4('0x3d')]['find']({'where':{'id':_0x3df05e[_0x53c4('0x57')]['id']}})[_0x53c4('0x20')](handleEntityNotFound(_0x1401c9,null))[_0x53c4('0x20')](function(_0x5d72b2){if(_0x5d72b2){return _0x5d72b2[_0x53c4('0x8c')](_0x3df05e[_0x53c4('0x41')][_0x53c4('0x7b')])[_0x53c4('0x20')](function(){if(_[_0x53c4('0x91')](_0x3df05e[_0x53c4('0x41')][_0x53c4('0x7b')])){for(var _0x519a60=0x0;_0x519a60<_0x3df05e[_0x53c4('0x41')][_0x53c4('0x7b')]['length'];_0x519a60+=0x1){socket[_0x53c4('0x78')](_0x53c4('0x8d'),{'UserId':Number(_0x3df05e[_0x53c4('0x41')][_0x53c4('0x7b')][_0x519a60]),'ChatQueueId':Number(_0x3df05e[_0x53c4('0x57')]['id'])});}}else{socket[_0x53c4('0x78')](_0x53c4('0x8d'),{'UserId':Number(_0x3df05e['query'][_0x53c4('0x7b')]),'ChatQueueId':Number(_0x3df05e[_0x53c4('0x57')]['id'])});}});}})[_0x53c4('0x20')](respondWithStatusCode(_0x1401c9,null))[_0x53c4('0x2b')](handleError(_0x1401c9,null));};exports[_0x53c4('0x92')]=function(_0x934481,_0x22dd66,_0x142f7b){var _0x83f33={};var _0x480b03={};var _0x153caa;var _0x57f840;return db[_0x53c4('0x3d')][_0x53c4('0x62')]({'where':{'id':_0x934481[_0x53c4('0x57')]['id']}})['then'](handleEntityNotFound(_0x22dd66,null))[_0x53c4('0x20')](function(_0x32692f){if(_0x32692f){_0x153caa=_0x32692f;_0x480b03['model']=_['keys'](db[_0x53c4('0x67')][_0x53c4('0x3e')]);_0x480b03[_0x53c4('0x41')]=_[_0x53c4('0x40')](_0x934481[_0x53c4('0x41')]);_0x480b03[_0x53c4('0x42')]=_['intersection'](_0x480b03['model'],_0x480b03['query']);_0x83f33[_0x53c4('0x43')]=_[_0x53c4('0x44')](_0x480b03['model'],qs['fields'](_0x934481[_0x53c4('0x41')][_0x53c4('0x45')]));_0x83f33[_0x53c4('0x43')]=_0x83f33['attributes'][_0x53c4('0x46')]?_0x83f33[_0x53c4('0x43')]:_0x480b03[_0x53c4('0x3f')];_0x83f33[_0x53c4('0x47')]=qs[_0x53c4('0x48')](_0x934481[_0x53c4('0x41')][_0x53c4('0x48')]);_0x83f33[_0x53c4('0x49')]=qs['filters'](_['pick'](_0x934481['query'],_0x480b03['filters']));if(_0x934481[_0x53c4('0x41')][_0x53c4('0x65')]){_0x83f33[_0x53c4('0x49')]=_[_0x53c4('0x4b')](_0x83f33['where'],{'$or':_[_0x53c4('0x4c')](_0x83f33[_0x53c4('0x43')],function(_0x41fe45){var _0x35050c={};_0x35050c[_0x41fe45]={'$like':'%'+_0x934481['query']['filter']+'%'};return _0x35050c;})});}_0x83f33=_[_0x53c4('0x4b')]({},_0x83f33,_0x934481[_0x53c4('0x51')]);return _0x153caa[_0x53c4('0x92')](_0x83f33);}})[_0x53c4('0x20')](function(_0x33365d){if(_0x33365d){_0x57f840=_0x33365d[_0x53c4('0x46')];if(!_0x934481[_0x53c4('0x41')][_0x53c4('0x63')](_0x53c4('0x64'))){_0x83f33['limit']=qs[_0x53c4('0x31')](_0x934481['query'][_0x53c4('0x31')]);_0x83f33[_0x53c4('0x30')]=qs['offset'](_0x934481[_0x53c4('0x41')][_0x53c4('0x30')]);}return _0x153caa[_0x53c4('0x92')](_0x83f33);}})[_0x53c4('0x20')](function(_0x5856ac){if(_0x5856ac){return _0x5856ac?{'count':_0x57f840,'rows':_0x5856ac}:null;}})[_0x53c4('0x20')](respondWithResult(_0x22dd66,null))[_0x53c4('0x2b')](handleError(_0x22dd66,null));}; \ No newline at end of file +var _0xd472=['emit','getAgents','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','key','VIRTUAL','options','includeAll','include','params','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','map','User','findAndCountAll','UserId','agent','createdAt','rows','%s/%s','SIP','chatPause','updatedAt','Team','getTeams','teams','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray'];(function(_0x2ffdd3,_0x2c4286){var _0x1204ac=function(_0x515f10){while(--_0x515f10){_0x2ffdd3['push'](_0x2ffdd3['shift']());}};_0x1204ac(++_0x2c4286);}(_0xd472,0x1be));var _0x2d47=function(_0x29b326,_0x30c2b5){_0x29b326=_0x29b326-0x0;var _0xf6c8e9=_0xd472[_0x29b326];return _0xf6c8e9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2d47('0x0'));var jsonpatch=require(_0x2d47('0x1'));var rp=require('request-promise');var moment=require(_0x2d47('0x2'));var BPromise=require(_0x2d47('0x3'));var Mustache=require('mustache');var util=require(_0x2d47('0x4'));var path=require(_0x2d47('0x5'));var sox=require(_0x2d47('0x6'));var csv=require(_0x2d47('0x7'));var ejs=require(_0x2d47('0x8'));var fs=require('fs');var _=require(_0x2d47('0x9'));var squel=require(_0x2d47('0xa'));var crypto=require(_0x2d47('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2d47('0xc'));var toCsv=require(_0x2d47('0x7'));var querystring=require(_0x2d47('0xd'));var Papa=require(_0x2d47('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2d47('0xf'));var hardwareService=require(_0x2d47('0x10'));var logger=require(_0x2d47('0x11'))('api');var utils=require(_0x2d47('0x12'));var config=require(_0x2d47('0x13'));var db=require('../../mysqldb')['db'];config[_0x2d47('0x14')]=_[_0x2d47('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d47('0x16'))(new Redis(config['redis']));require(_0x2d47('0x17'))[_0x2d47('0x18')](socket);var jayson=require(_0x2d47('0x19'));var client=jayson[_0x2d47('0x1a')][_0x2d47('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5a7386,_0x50a4cc,_0xed2339){if(_0xed2339){var _0x4a27d7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a27d7['test'](_0x50a4cc)){return _0x5a7386;}else{throw new Error(_0x2d47('0x1c'));}}else{return _0x5a7386;}}function respondWithRpcPromise(_0x7b46cf,_0x243902,_0x1b4654,_0x3a39b6){return new BPromise(function(_0x4b6a0c,_0x2d8949){var _0x55fca1=_0x3a39b6||client;return _0x55fca1[_0x2d47('0x1d')](_0x7b46cf,_0x1b4654)['then'](function(_0x237c32){logger['info'](_0x2d47('0x1e'),_0x243902,_0x2d47('0x1f'));logger['debug'](_0x2d47('0x20'),_0x243902,_0x2d47('0x1f'),JSON[_0x2d47('0x21')](_0x237c32));if(_0x237c32[_0x2d47('0x22')]){if(_0x237c32['error'][_0x2d47('0x23')]===0x1f4){logger[_0x2d47('0x22')](_0x2d47('0x1e'),_0x243902,_0x237c32[_0x2d47('0x22')][_0x2d47('0x24')]);return _0x2d8949(_0x237c32[_0x2d47('0x22')][_0x2d47('0x24')]);}logger[_0x2d47('0x22')](_0x2d47('0x1e'),_0x243902,_0x237c32[_0x2d47('0x22')][_0x2d47('0x24')]);return _0x4b6a0c(_0x237c32['error']['message']);}else{logger[_0x2d47('0x25')](_0x2d47('0x1e'),_0x243902,_0x2d47('0x1f'));_0x4b6a0c(_0x237c32['result'][_0x2d47('0x24')]);}})[_0x2d47('0x26')](function(_0x27482f){logger[_0x2d47('0x22')]('ChatQueue,\x20%s,\x20%s',_0x243902,_0x27482f);_0x2d8949(_0x27482f);});});}function respondWithStatusCode(_0x2e4b4d,_0x2bb6e7){_0x2bb6e7=_0x2bb6e7||0xcc;return function(_0x46c7bb){if(_0x46c7bb){return _0x2e4b4d[_0x2d47('0x27')](_0x2bb6e7);}return _0x2e4b4d[_0x2d47('0x28')](_0x2bb6e7)[_0x2d47('0x29')]();};}function respondWithResult(_0x56fb3d,_0x2b86f7){_0x2b86f7=_0x2b86f7||0xc8;return function(_0x10fcc6){if(_0x10fcc6){return _0x56fb3d[_0x2d47('0x28')](_0x2b86f7)[_0x2d47('0x2a')](_0x10fcc6);}};}function respondWithFilteredResult(_0x55018a,_0x8c9422){return function(_0x434630){if(_0x434630){var _0x557d90=_0x434630[_0x2d47('0x2b')],_0xa16697=_0x8c9422[_0x2d47('0x2c')],_0xb6b4e8=_0x8c9422[_0x2d47('0x2c')]+_0x8c9422[_0x2d47('0x2d')],_0x3b84c2;if(_0xb6b4e8>=_0x557d90){_0xb6b4e8=_0x557d90;_0x3b84c2=0xc8;}else{_0x3b84c2=0xce;}_0x55018a[_0x2d47('0x28')](_0x3b84c2);return _0x55018a['set'](_0x2d47('0x2e'),_0xa16697+'-'+_0xb6b4e8+'/'+_0x557d90)['json'](_0x434630);}return null;};}function patchUpdates(_0x26c917){return function(_0x9c731d){try{jsonpatch[_0x2d47('0x2f')](_0x9c731d,_0x26c917,!![]);}catch(_0x11983b){return BPromise[_0x2d47('0x30')](_0x11983b);}return _0x9c731d['save']();};}function saveUpdates(_0x45a8cb,_0x19d585){return function(_0x57515a){if(_0x57515a){return _0x57515a[_0x2d47('0x31')](_0x45a8cb)[_0x2d47('0x32')](function(_0x428d3a){return _0x428d3a;});}return null;};}function removeEntity(_0x2b9382,_0x17be5){return function(_0x2217ca){if(_0x2217ca){return _0x2217ca[_0x2d47('0x33')]()[_0x2d47('0x32')](function(){var _0x273b9b=_0x2217ca[_0x2d47('0x34')]({'plain':!![]});var _0x4fe959=_0x2d47('0x35');return db[_0x2d47('0x36')][_0x2d47('0x33')]({'where':{'type':_0x4fe959,'resourceId':_0x273b9b['id']}})[_0x2d47('0x32')](function(){return _0x2217ca;});})[_0x2d47('0x32')](function(){_0x2b9382['status'](0xcc)[_0x2d47('0x29')]();});}};}function handleEntityNotFound(_0x4ab620,_0x290e76){return function(_0x391062){if(!_0x391062){_0x4ab620[_0x2d47('0x27')](0x194);}return _0x391062;};}function handleError(_0x5349b6,_0x4541c1){_0x4541c1=_0x4541c1||0x1f4;return function(_0x1f160c){logger[_0x2d47('0x22')](_0x1f160c[_0x2d47('0x37')]);if(_0x1f160c[_0x2d47('0x38')]){delete _0x1f160c['name'];}_0x5349b6[_0x2d47('0x28')](_0x4541c1)[_0x2d47('0x39')](_0x1f160c);};}exports[_0x2d47('0x3a')]=function(_0x320c91,_0x145ca6){var _0x6527e6={},_0x1426b7={},_0xde5158={'count':0x0,'rows':[]};var _0x16a519=db[_0x2d47('0x3b')][_0x2d47('0x3c')];_0x1426b7[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](_0x16a519);_0x1426b7['query']=_[_0x2d47('0x3e')](_0x320c91[_0x2d47('0x3f')]);_0x1426b7[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x1426b7[_0x2d47('0x3d')],_0x1426b7['query']);_0x6527e6[_0x2d47('0x42')]=_[_0x2d47('0x41')](_0x1426b7['model'],qs[_0x2d47('0x43')](_0x320c91[_0x2d47('0x3f')][_0x2d47('0x43')]));_0x6527e6[_0x2d47('0x42')]=_0x6527e6[_0x2d47('0x42')][_0x2d47('0x44')]?_0x6527e6[_0x2d47('0x42')]:_0x1426b7[_0x2d47('0x3d')];if(!_0x320c91[_0x2d47('0x3f')][_0x2d47('0x45')](_0x2d47('0x46'))){_0x6527e6['limit']=qs['limit'](_0x320c91[_0x2d47('0x3f')][_0x2d47('0x2d')]);_0x6527e6[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x320c91[_0x2d47('0x3f')][_0x2d47('0x2c')]);}_0x6527e6['order']=qs[_0x2d47('0x47')](_0x320c91['query']['sort']);_0x6527e6[_0x2d47('0x48')]=qs[_0x2d47('0x40')](_[_0x2d47('0x49')](_0x320c91[_0x2d47('0x3f')],_0x1426b7[_0x2d47('0x40')]));if(_0x320c91[_0x2d47('0x3f')][_0x2d47('0x4a')]){_0x6527e6[_0x2d47('0x48')]=_[_0x2d47('0x4b')](_0x6527e6[_0x2d47('0x48')],{'$or':_['map'](_0x16a519,function(_0x44bb22){if(_0x44bb22['type'][_0x2d47('0x4c')]!==_0x2d47('0x4d')){var _0x136042={};_0x136042[_0x44bb22['field']]={'$like':'%'+_0x320c91[_0x2d47('0x3f')][_0x2d47('0x4a')]+'%'};return _0x136042;}})});}_0x6527e6=_[_0x2d47('0x4b')]({},_0x6527e6,_0x320c91[_0x2d47('0x4e')]);var _0x314189={'where':_0x6527e6['where']};return db[_0x2d47('0x3b')]['count'](_0x314189)[_0x2d47('0x32')](function(_0x4d8ea1){_0xde5158[_0x2d47('0x2b')]=_0x4d8ea1;if(_0x320c91['query'][_0x2d47('0x4f')]){_0x6527e6[_0x2d47('0x50')]=[{'all':!![]}];}return db[_0x2d47('0x3b')]['findAll'](_0x6527e6);})[_0x2d47('0x32')](function(_0x1d09ea){_0xde5158['rows']=_0x1d09ea;return _0xde5158;})[_0x2d47('0x32')](respondWithFilteredResult(_0x145ca6,_0x6527e6))[_0x2d47('0x26')](handleError(_0x145ca6,null));};exports['show']=function(_0x3bd489,_0x1efaf7){var _0xe38ec1={'raw':!![],'where':{'id':_0x3bd489[_0x2d47('0x51')]['id']}},_0x170913={};_0x170913[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x3b')]['rawAttributes']);_0x170913[_0x2d47('0x3f')]=_[_0x2d47('0x3e')](_0x3bd489[_0x2d47('0x3f')]);_0x170913['filters']=_[_0x2d47('0x41')](_0x170913['model'],_0x170913['query']);_0xe38ec1[_0x2d47('0x42')]=_[_0x2d47('0x41')](_0x170913['model'],qs[_0x2d47('0x43')](_0x3bd489['query']['fields']));_0xe38ec1[_0x2d47('0x42')]=_0xe38ec1[_0x2d47('0x42')][_0x2d47('0x44')]?_0xe38ec1[_0x2d47('0x42')]:_0x170913['model'];if(_0x3bd489[_0x2d47('0x3f')][_0x2d47('0x4f')]){_0xe38ec1[_0x2d47('0x50')]=[{'all':!![]}];}_0xe38ec1=_[_0x2d47('0x4b')]({},_0xe38ec1,_0x3bd489[_0x2d47('0x4e')]);return db[_0x2d47('0x3b')][_0x2d47('0x52')](_0xe38ec1)['then'](handleEntityNotFound(_0x1efaf7,null))[_0x2d47('0x32')](respondWithResult(_0x1efaf7,null))[_0x2d47('0x26')](handleError(_0x1efaf7,null));};exports[_0x2d47('0x53')]=function(_0x1c4ae1,_0x46e992){return db[_0x2d47('0x3b')][_0x2d47('0x53')](_0x1c4ae1[_0x2d47('0x54')],{})[_0x2d47('0x32')](function(_0x55d6ae){var _0x2fc2cc=_0x1c4ae1['user'][_0x2d47('0x34')]({'plain':!![]});if(!_0x2fc2cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fc2cc[_0x2d47('0x55')]===_0x2d47('0x56')){var _0x2dfc4d=_0x55d6ae['get']({'plain':!![]});var _0x526d5a=_0x2d47('0x35');return db[_0x2d47('0x57')][_0x2d47('0x52')]({'where':{'name':_0x526d5a,'userProfileId':_0x2fc2cc[_0x2d47('0x58')]},'raw':!![]})[_0x2d47('0x32')](function(_0x2e8447){if(_0x2e8447&&_0x2e8447[_0x2d47('0x59')]===0x0){return db[_0x2d47('0x36')][_0x2d47('0x53')]({'name':_0x2dfc4d[_0x2d47('0x38')],'resourceId':_0x2dfc4d['id'],'type':_0x2e8447[_0x2d47('0x38')],'sectionId':_0x2e8447['id']},{})[_0x2d47('0x32')](function(){return _0x55d6ae;});}else{return _0x55d6ae;}})[_0x2d47('0x26')](function(_0x2d4c0c){logger['error'](_0x2d47('0x5a'),_0x2d4c0c);throw _0x2d4c0c;});}return _0x55d6ae;})[_0x2d47('0x32')](respondWithResult(_0x46e992,0xc9))[_0x2d47('0x26')](handleError(_0x46e992,null));};exports[_0x2d47('0x31')]=function(_0x523a9b,_0x28b511){if(_0x523a9b[_0x2d47('0x54')]['id']){delete _0x523a9b['body']['id'];}return db[_0x2d47('0x3b')][_0x2d47('0x52')]({'where':{'id':_0x523a9b['params']['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x28b511,null))[_0x2d47('0x32')](saveUpdates(_0x523a9b[_0x2d47('0x54')],null))[_0x2d47('0x32')](respondWithResult(_0x28b511,null))['catch'](handleError(_0x28b511,null));};exports[_0x2d47('0x33')]=function(_0x2a4e5a,_0x345249){return db['ChatQueue'][_0x2d47('0x52')]({'where':{'id':_0x2a4e5a[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x345249,null))[_0x2d47('0x32')](removeEntity(_0x345249,null))['catch'](handleError(_0x345249,null));};exports[_0x2d47('0x5b')]=function(_0x4a270f,_0x4fc544){return db[_0x2d47('0x3b')][_0x2d47('0x5b')]()[_0x2d47('0x32')](respondWithResult(_0x4fc544,null))[_0x2d47('0x26')](handleError(_0x4fc544,null));};exports[_0x2d47('0x5c')]=function(_0x67c127,_0x20e54d,_0x3cc934){var _0x24c375={'raw':!![],'where':{}},_0x1faac0={},_0x573fbb;return db['ChatQueue'][_0x2d47('0x5d')]({'where':{'id':_0x67c127[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x20e54d,null))[_0x2d47('0x32')](function(_0xd7fdb7){if(_0xd7fdb7){_0x573fbb=_0xd7fdb7[_0x2d47('0x34')]({'plain':!![]});_0x1faac0[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x5e')]['rawAttributes']);_0x1faac0[_0x2d47('0x3f')]=_[_0x2d47('0x3e')](_0x67c127[_0x2d47('0x3f')]);_0x1faac0[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x1faac0[_0x2d47('0x3d')],_0x1faac0[_0x2d47('0x3f')]);_0x24c375['attributes']=_[_0x2d47('0x41')](_0x1faac0[_0x2d47('0x3d')],qs['fields'](_0x67c127[_0x2d47('0x3f')][_0x2d47('0x43')]));_0x24c375[_0x2d47('0x42')]=_0x24c375['attributes'][_0x2d47('0x44')]?_0x24c375[_0x2d47('0x42')]:_0x1faac0[_0x2d47('0x3d')];if(!_0x67c127['query'][_0x2d47('0x45')](_0x2d47('0x46'))){_0x24c375[_0x2d47('0x2d')]=qs['limit'](_0x67c127[_0x2d47('0x3f')]['limit']);_0x24c375[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x67c127['query'][_0x2d47('0x2c')]);}_0x24c375[_0x2d47('0x5f')]=qs[_0x2d47('0x47')](_0x67c127[_0x2d47('0x3f')][_0x2d47('0x47')]);_0x24c375['where']=qs[_0x2d47('0x40')](_[_0x2d47('0x49')](_0x67c127['query'],_0x1faac0['filters']));_0x24c375['where'][_0x2d47('0x60')]=_0xd7fdb7['id'];if(_0x67c127[_0x2d47('0x3f')][_0x2d47('0x4a')]){_0x24c375[_0x2d47('0x48')]=_['merge'](_0x24c375[_0x2d47('0x48')],{'$or':_[_0x2d47('0x61')](_0x24c375['attributes'],function(_0x2a5d3b){var _0x2fc961={};_0x2fc961[_0x2a5d3b]={'$like':'%'+_0x67c127['query'][_0x2d47('0x4a')]+'%'};return _0x2fc961;})});}_0x24c375=_[_0x2d47('0x4b')]({},_0x24c375,_0x67c127[_0x2d47('0x4e')]);return db[_0x2d47('0x5e')]['findAll'](_0x24c375);}})[_0x2d47('0x32')](function(_0x360cde){if(_0x360cde){return db[_0x2d47('0x62')][_0x2d47('0x63')]({'where':{'id':_['map'](_0x360cde,_0x2d47('0x64')),'role':_0x2d47('0x65')},'attributes':['id','name','chatPause','updatedAt',_0x2d47('0x66')]});}})[_0x2d47('0x32')](function(_0x42450){if(_0x42450){return{'count':_0x42450[_0x2d47('0x2b')],'rows':_[_0x2d47('0x61')](_0x42450[_0x2d47('0x67')],function(_0x3a8d1c){return{'membername':_0x3a8d1c['name'],'UserId':_0x3a8d1c['id'],'queue_name':_0x573fbb[_0x2d47('0x38')],'ChatQueueId':_0x573fbb['id'],'interface':util['format'](_0x2d47('0x68'),_0x2d47('0x69'),_0x3a8d1c['name']),'penalty':0x0,'paused':_0x3a8d1c[_0x2d47('0x6a')],'createdAt':_0x3a8d1c['createdAt'],'updatedAt':_0x3a8d1c[_0x2d47('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2d47('0x32')](respondWithFilteredResult(_0x20e54d,_0x24c375))[_0x2d47('0x26')](handleError(_0x20e54d,null));};exports['getTeams']=function(_0x5b5398,_0x115b29,_0x374375){var _0x1996aa={};var _0x1141b2={};var _0x913dea;var _0x16378a;return db[_0x2d47('0x3b')][_0x2d47('0x5d')]({'where':{'id':_0x5b5398[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x115b29,null))['then'](function(_0x4f6618){if(_0x4f6618){_0x913dea=_0x4f6618;_0x1141b2[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x6c')][_0x2d47('0x3c')]);_0x1141b2[_0x2d47('0x3f')]=_[_0x2d47('0x3e')](_0x5b5398[_0x2d47('0x3f')]);_0x1141b2[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x1141b2[_0x2d47('0x3d')],_0x1141b2[_0x2d47('0x3f')]);_0x1996aa[_0x2d47('0x42')]=_[_0x2d47('0x41')](_0x1141b2[_0x2d47('0x3d')],qs[_0x2d47('0x43')](_0x5b5398[_0x2d47('0x3f')][_0x2d47('0x43')]));_0x1996aa['attributes']=_0x1996aa[_0x2d47('0x42')][_0x2d47('0x44')]?_0x1996aa['attributes']:_0x1141b2[_0x2d47('0x3d')];_0x1996aa[_0x2d47('0x5f')]=qs[_0x2d47('0x47')](_0x5b5398[_0x2d47('0x3f')]['sort']);_0x1996aa[_0x2d47('0x48')]=qs[_0x2d47('0x40')](_['pick'](_0x5b5398['query'],_0x1141b2[_0x2d47('0x40')]));if(_0x5b5398['query']['filter']){_0x1996aa['where']=_[_0x2d47('0x4b')](_0x1996aa[_0x2d47('0x48')],{'$or':_['map'](_0x1996aa[_0x2d47('0x42')],function(_0x1ddf7f){var _0x4e8384={};_0x4e8384[_0x1ddf7f]={'$like':'%'+_0x5b5398[_0x2d47('0x3f')]['filter']+'%'};return _0x4e8384;})});}_0x1996aa=_[_0x2d47('0x4b')]({},_0x1996aa,_0x5b5398[_0x2d47('0x4e')]);return _0x913dea[_0x2d47('0x6d')](_0x1996aa);}})[_0x2d47('0x32')](function(_0x532f81){if(_0x532f81){_0x16378a=_0x532f81[_0x2d47('0x44')];if(!_0x5b5398[_0x2d47('0x3f')]['hasOwnProperty']('nolimit')){_0x1996aa[_0x2d47('0x2d')]=qs[_0x2d47('0x2d')](_0x5b5398[_0x2d47('0x3f')][_0x2d47('0x2d')]);_0x1996aa[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x5b5398[_0x2d47('0x3f')][_0x2d47('0x2c')]);}return _0x913dea[_0x2d47('0x6d')](_0x1996aa);}})['then'](function(_0x55c1cc){if(_0x55c1cc){return _0x55c1cc?{'count':_0x16378a,'rows':_0x55c1cc}:null;}})['then'](respondWithResult(_0x115b29,null))[_0x2d47('0x26')](handleError(_0x115b29,null));};exports['addTeams']=function(_0x147083,_0x1b757c,_0x8883d2){var _0x1aa618=_0x147083[_0x2d47('0x54')][_0x2d47('0x6e')];return db['Team'][_0x2d47('0x6f')]({'where':{'id':_['map'](_0x1aa618,'id')},'attributes':['id'],'include':[{'model':db[_0x2d47('0x62')],'as':_0x2d47('0x70'),'attributes':['id',_0x2d47('0x38'),_0x2d47('0x71'),_0x2d47('0x72'),_0x2d47('0x73')],'raw':!![]}]})[_0x2d47('0x32')](function(_0x4c9e3a){if(_0x4c9e3a){var _0x1d3aed=_[_0x2d47('0x74')](_0x4c9e3a,function(_0x136594){var _0x1afbd4=_0x136594[_0x2d47('0x34')]({'plain':!![]});return _0x1afbd4[_0x2d47('0x70')];});return db[_0x2d47('0x3b')][_0x2d47('0x52')]({'where':{'id':_0x147083[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](function(_0x4e9e3a){return db[_0x2d47('0x75')][_0x2d47('0x76')](function(_0x43ee32){return _0x4e9e3a[_0x2d47('0x77')](_[_0x2d47('0x61')](_0x1aa618,'id'),{'transaction':_0x43ee32})[_0x2d47('0x32')](function(){return BPromise[_0x2d47('0x78')](_0x1d3aed,function(_0x583dd5){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x583dd5['id'],'ChatQueueId':_0x147083[_0x2d47('0x51')]['id']},'transaction':_0x43ee32});});})['then'](function(){_0x1d3aed[_0x2d47('0x79')](function(_0x4a48c8){socket['emit'](_0x2d47('0x7a'),{'UserId':_0x4a48c8['id'],'ChatQueueId':_0x4e9e3a['id']});});});});});}})[_0x2d47('0x32')](respondWithStatusCode(_0x1b757c,null))[_0x2d47('0x26')](handleError(_0x1b757c,null));};exports[_0x2d47('0x7b')]=function(_0x1bfb06,_0x554ba2,_0x807d80){return db[_0x2d47('0x6c')][_0x2d47('0x6f')]({'where':{'id':_0x1bfb06[_0x2d47('0x3f')][_0x2d47('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x2d47('0x62')],'as':_0x2d47('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x554ba2,null))[_0x2d47('0x32')](function(_0x3bc96a){var _0x54ee3f=_[_0x2d47('0x61')](_0x3bc96a,'id');var _0x93fcae=[];var _0x4742a5=[];var _0x4180f2=squel[_0x2d47('0x7d')]();_0x4180f2[_0x2d47('0x7e')](_0x2d47('0x7f'))[_0x2d47('0x80')](_0x2d47('0x81'),'tq')['join']('user_has_teams','ut',_0x2d47('0x82'))[_0x2d47('0x48')](_0x2d47('0x83'),_0x1bfb06[_0x2d47('0x51')]['id']);for(var _0x279355=0x0;_0x279355<_0x3bc96a['length'];_0x279355+=0x1){let _0x43c0c6=_0x3bc96a[_0x279355];for(var _0x440a0d=0x0;_0x440a0d<_0x43c0c6[_0x2d47('0x70')]['length'];_0x440a0d+=0x1){let _0x2a66a2=_0x43c0c6[_0x2d47('0x70')][_0x440a0d];var _0x2c6975=_0x4180f2['clone']();_0x2c6975['where']('ut.UserId\x20=\x20?',_0x2a66a2['id']);_0x4742a5[_0x2d47('0x84')](db[_0x2d47('0x75')]['query'](_0x2c6975['toString'](),{'type':db[_0x2d47('0x75')]['QueryTypes'][_0x2d47('0x85')]})['then'](function(_0x1c7ac9){if(_0x1c7ac9['length']===0x1){return _0x2a66a2['id'];}else{var _0x1a40d9=_['every'](_[_0x2d47('0x61')](_0x1c7ac9,_0x2d47('0x86')),function(_0xaf531){return _[_0x2d47('0x87')](_0x54ee3f,_0xaf531);});if(_0x1a40d9){return _0x2a66a2['id'];}}}));}}return BPromise['all'](_0x4742a5)[_0x2d47('0x32')](function(_0x4e2f62){_0x93fcae=_(_0x93fcae)[_0x2d47('0x88')](_0x4e2f62)[_0x2d47('0x89')]()[_0x2d47('0x8a')]();return db['ChatQueue'][_0x2d47('0x52')]({'where':{'id':_0x1bfb06[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](function(_0x309ab6){return db[_0x2d47('0x75')][_0x2d47('0x76')](function(_0x309986){return _0x309ab6[_0x2d47('0x7b')](_0x1bfb06[_0x2d47('0x3f')][_0x2d47('0x7c')],{'transaction':_0x309986})[_0x2d47('0x32')](function(){if(!_[_0x2d47('0x8b')](_0x93fcae)){return _0x309ab6[_0x2d47('0x8c')](_0x93fcae,{'transaction':_0x309986});}})[_0x2d47('0x32')](function(){_0x93fcae[_0x2d47('0x79')](function(_0x341765){socket['emit'](_0x2d47('0x8d'),{'UserId':_0x341765,'ChatQueueId':_0x309ab6['id']});});});});});});})['then'](respondWithStatusCode(_0x554ba2,null))[_0x2d47('0x26')](handleError(_0x554ba2,null));};exports[_0x2d47('0x8e')]=function(_0x377987,_0x2ae88a,_0x62c3b0){return db['ChatQueue'][_0x2d47('0x52')]({'where':{'id':_0x377987[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x2ae88a,null))[_0x2d47('0x32')](function(_0x357cde){if(_0x357cde){return _0x357cde[_0x2d47('0x8e')](_0x377987[_0x2d47('0x54')][_0x2d47('0x7c')],_[_0x2d47('0x8f')](_0x377987[_0x2d47('0x54')],[_0x2d47('0x7c'),'id'])||{})[_0x2d47('0x90')](function(_0x3f0faf){for(var _0x2ac213=0x0;_0x2ac213<_0x377987[_0x2d47('0x54')][_0x2d47('0x7c')][_0x2d47('0x44')];_0x2ac213+=0x1){socket['emit']('userChatQueue:save',{'UserId':_0x377987[_0x2d47('0x54')][_0x2d47('0x7c')][_0x2ac213],'ChatQueueId':_0x377987[_0x2d47('0x51')]['id']});}return _0x3f0faf;});}})['then'](respondWithResult(_0x2ae88a,null))['catch'](handleError(_0x2ae88a,null));};exports['removeAgents']=function(_0x4f1ed4,_0x468226,_0x23175b){return db[_0x2d47('0x3b')][_0x2d47('0x52')]({'where':{'id':_0x4f1ed4[_0x2d47('0x51')]['id']}})[_0x2d47('0x32')](handleEntityNotFound(_0x468226,null))[_0x2d47('0x32')](function(_0x4f380d){if(_0x4f380d){return _0x4f380d['removeAgents'](_0x4f1ed4[_0x2d47('0x3f')]['ids'])[_0x2d47('0x32')](function(){if(_[_0x2d47('0x91')](_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')])){for(var _0x8f0338=0x0;_0x8f0338<_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')][_0x2d47('0x44')];_0x8f0338+=0x1){socket[_0x2d47('0x92')](_0x2d47('0x8d'),{'UserId':Number(_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')][_0x8f0338]),'ChatQueueId':Number(_0x4f1ed4[_0x2d47('0x51')]['id'])});}}else{socket[_0x2d47('0x92')](_0x2d47('0x8d'),{'UserId':Number(_0x4f1ed4[_0x2d47('0x3f')][_0x2d47('0x7c')]),'ChatQueueId':Number(_0x4f1ed4[_0x2d47('0x51')]['id'])});}});}})[_0x2d47('0x32')](respondWithStatusCode(_0x468226,null))['catch'](handleError(_0x468226,null));};exports['getAgents']=function(_0x844b46,_0x2ee509,_0x9f9e4c){var _0x25038f={};var _0x5b689a={};var _0xabb948;var _0x4542e2;return db[_0x2d47('0x3b')]['findOne']({'where':{'id':_0x844b46[_0x2d47('0x51')]['id']}})['then'](handleEntityNotFound(_0x2ee509,null))[_0x2d47('0x32')](function(_0x1528cc){if(_0x1528cc){_0xabb948=_0x1528cc;_0x5b689a[_0x2d47('0x3d')]=_[_0x2d47('0x3e')](db[_0x2d47('0x62')]['rawAttributes']);_0x5b689a[_0x2d47('0x3f')]=_['keys'](_0x844b46[_0x2d47('0x3f')]);_0x5b689a[_0x2d47('0x40')]=_[_0x2d47('0x41')](_0x5b689a[_0x2d47('0x3d')],_0x5b689a[_0x2d47('0x3f')]);_0x25038f['attributes']=_[_0x2d47('0x41')](_0x5b689a[_0x2d47('0x3d')],qs[_0x2d47('0x43')](_0x844b46['query'][_0x2d47('0x43')]));_0x25038f[_0x2d47('0x42')]=_0x25038f['attributes'][_0x2d47('0x44')]?_0x25038f[_0x2d47('0x42')]:_0x5b689a[_0x2d47('0x3d')];_0x25038f[_0x2d47('0x5f')]=qs['sort'](_0x844b46['query']['sort']);_0x25038f['where']=qs['filters'](_[_0x2d47('0x49')](_0x844b46['query'],_0x5b689a[_0x2d47('0x40')]));if(_0x844b46[_0x2d47('0x3f')][_0x2d47('0x4a')]){_0x25038f[_0x2d47('0x48')]=_[_0x2d47('0x4b')](_0x25038f['where'],{'$or':_[_0x2d47('0x61')](_0x25038f[_0x2d47('0x42')],function(_0x18ddbb){var _0x250c73={};_0x250c73[_0x18ddbb]={'$like':'%'+_0x844b46[_0x2d47('0x3f')][_0x2d47('0x4a')]+'%'};return _0x250c73;})});}_0x25038f=_[_0x2d47('0x4b')]({},_0x25038f,_0x844b46[_0x2d47('0x4e')]);return _0xabb948['getAgents'](_0x25038f);}})[_0x2d47('0x32')](function(_0x572f99){if(_0x572f99){_0x4542e2=_0x572f99[_0x2d47('0x44')];if(!_0x844b46['query'][_0x2d47('0x45')](_0x2d47('0x46'))){_0x25038f[_0x2d47('0x2d')]=qs[_0x2d47('0x2d')](_0x844b46[_0x2d47('0x3f')][_0x2d47('0x2d')]);_0x25038f[_0x2d47('0x2c')]=qs[_0x2d47('0x2c')](_0x844b46[_0x2d47('0x3f')][_0x2d47('0x2c')]);}return _0xabb948[_0x2d47('0x93')](_0x25038f);}})[_0x2d47('0x32')](function(_0x2fca74){if(_0x2fca74){return _0x2fca74?{'count':_0x4542e2,'rows':_0x2fca74}:null;}})[_0x2d47('0x32')](respondWithResult(_0x2ee509,null))['catch'](handleError(_0x2ee509,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index bd7897f..5f50da3 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 _0xb8c3=['update','remove','emit','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x39b81f,_0xed4c4c){var _0x4aa92d=function(_0x36e82b){while(--_0x36e82b){_0x39b81f['push'](_0x39b81f['shift']());}};_0x4aa92d(++_0xed4c4c);}(_0xb8c3,0x9d));var _0x3b8c=function(_0x2908f4,_0x104b0c){_0x2908f4=_0x2908f4-0x0;var _0x5f05a8=_0xb8c3[_0x2908f4];return _0x5f05a8;};'use strict';var EventEmitter=require(_0x3b8c('0x0'));var ChatQueue=require(_0x3b8c('0x1'))['db'][_0x3b8c('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3b8c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b8c('0x4'),'afterDestroy':_0x3b8c('0x5')};function emitEvent(_0x426891){return function(_0x654ae9,_0x37b19f,_0x18b5b8){ChatQueueEvents[_0x3b8c('0x6')](_0x426891+':'+_0x654ae9['id'],_0x654ae9);ChatQueueEvents['emit'](_0x426891,_0x654ae9);_0x18b5b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x8535=['update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save'];(function(_0x540b64,_0xe51786){var _0xea9534=function(_0x6e302a){while(--_0x6e302a){_0x540b64['push'](_0x540b64['shift']());}};_0xea9534(++_0xe51786);}(_0x8535,0x66));var _0x5853=function(_0x2d3d42,_0x5e7caf){_0x2d3d42=_0x2d3d42-0x0;var _0x2c5669=_0x8535[_0x2d3d42];return _0x2c5669;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5853('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5853('0x1')](0x0);var events={'afterCreate':_0x5853('0x2'),'afterUpdate':_0x5853('0x3'),'afterDestroy':'remove'};function emitEvent(_0x437257){return function(_0x357de3,_0x4d0c17,_0xcdbce9){ChatQueueEvents['emit'](_0x437257+':'+_0x357de3['id'],_0x357de3);ChatQueueEvents[_0x5853('0x4')](_0x437257,_0x357de3);_0xcdbce9(null);};}for(var e in events){if(events[_0x5853('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x5853('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 728b3cd..adc94ac 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 _0xa446=['api','bluebird','path','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util'];(function(_0xebf38d,_0x52069a){var _0x30ab34=function(_0xd562e4){while(--_0xd562e4){_0xebf38d['push'](_0xebf38d['shift']());}};_0x30ab34(++_0x52069a);}(_0xa446,0xc6));var _0x6a44=function(_0x17ade4,_0x167e89){_0x17ade4=_0x17ade4-0x0;var _0x33473c=_0xa446[_0x17ade4];return _0x33473c;};'use strict';var _=require(_0x6a44('0x0'));var util=require(_0x6a44('0x1'));var logger=require('../../config/logger')(_0x6a44('0x2'));var moment=require('moment');var BPromise=require(_0x6a44('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6a44('0x4'));var rimraf=require('rimraf');var config=require(_0x6a44('0x5'));var attributes=require(_0x6a44('0x6'));module[_0x6a44('0x7')]=function(_0x1bcc30,_0x1fc85d){return _0x1bcc30[_0x6a44('0x8')]('ChatQueue',attributes,{'tableName':_0x6a44('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d86=['chat_queues','lodash','util','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x25078a,_0x3f68e5){var _0x4d8750=function(_0x18ceed){while(--_0x18ceed){_0x25078a['push'](_0x25078a['shift']());}};_0x4d8750(++_0x3f68e5);}(_0x5d86,0x76));var _0x65d8=function(_0x5c3ea5,_0xa9ed0c){_0x5c3ea5=_0x5c3ea5-0x0;var _0x102b61=_0x5d86[_0x5c3ea5];return _0x102b61;};'use strict';var _=require(_0x65d8('0x0'));var util=require(_0x65d8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x65d8('0x2'));var BPromise=require('bluebird');var rp=require(_0x65d8('0x3'));var fs=require('fs');var path=require(_0x65d8('0x4'));var rimraf=require('rimraf');var config=require(_0x65d8('0x5'));var attributes=require('./chatQueue.attributes');module[_0x65d8('0x6')]=function(_0x50c922,_0x1581a6){return _0x50c922[_0x65d8('0x7')]('ChatQueue',attributes,{'tableName':_0x65d8('0x8'),'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 b2f3c44..f72a6c2 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 _0x6c35=['ShowChatQueue','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ChatQueue','findAll','options','where','include','map','attributes','model','then','GetChatQueue','stringify','find','raw'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x6c35,0xf7));var _0x56c3=function(_0x1a8fdf,_0x273c6e){_0x1a8fdf=_0x1a8fdf-0x0;var _0x2ea957=_0x6c35[_0x1a8fdf];return _0x2ea957;};'use strict';var _=require(_0x56c3('0x0'));var util=require('util');var moment=require(_0x56c3('0x1'));var BPromise=require(_0x56c3('0x2'));var rs=require(_0x56c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56c3('0x4'))['db'];var utils=require(_0x56c3('0x5'));var logger=require('../../config/logger')(_0x56c3('0x6'));var config=require('../../config/environment');var jayson=require(_0x56c3('0x7'));var client=jayson[_0x56c3('0x8')][_0x56c3('0x9')]({'port':0x232a});config[_0x56c3('0xa')]=_[_0x56c3('0xb')](config['redis'],{'host':_0x56c3('0xc'),'port':0x18eb});var socket=require(_0x56c3('0xd'))(new Redis(config[_0x56c3('0xa')]));require(_0x56c3('0xe'))[_0x56c3('0xf')](socket);function respondWithRpcPromise(_0x4fcbae,_0x3435f8,_0x2aa748){return new BPromise(function(_0x5dfaa4,_0x3d501b){return client[_0x56c3('0x10')](_0x4fcbae,_0x2aa748)['then'](function(_0x5aa5a6){logger[_0x56c3('0x11')](_0x56c3('0x12'),_0x3435f8,'request\x20sent');logger[_0x56c3('0x13')](_0x56c3('0x14'),_0x3435f8,_0x56c3('0x15'),JSON['stringify'](_0x5aa5a6));if(_0x5aa5a6['error']){if(_0x5aa5a6[_0x56c3('0x16')][_0x56c3('0x17')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x3435f8,_0x5aa5a6[_0x56c3('0x16')][_0x56c3('0x18')]);return _0x3d501b(_0x5aa5a6['error'][_0x56c3('0x18')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x3435f8,_0x5aa5a6[_0x56c3('0x16')][_0x56c3('0x18')]);return _0x5dfaa4(_0x5aa5a6[_0x56c3('0x16')][_0x56c3('0x18')]);}else{logger[_0x56c3('0x11')]('ChatQueue,\x20%s,\x20%s',_0x3435f8,'request\x20sent');_0x5dfaa4(_0x5aa5a6[_0x56c3('0x19')]['message']);}})[_0x56c3('0x1a')](function(_0x117c1e){logger[_0x56c3('0x16')](_0x56c3('0x12'),_0x3435f8,_0x117c1e);_0x3d501b(_0x117c1e);});});}exports['GetChatQueue']=function(_0x4a0374){var _0x3a94fd=this;return new Promise(function(_0x34083f,_0x4eb5f7){return db[_0x56c3('0x1b')][_0x56c3('0x1c')]({'raw':_0x4a0374['options']?_0x4a0374[_0x56c3('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4a0374[_0x56c3('0x1d')]?_0x4a0374[_0x56c3('0x1d')][_0x56c3('0x1e')]||null:null,'attributes':_0x4a0374[_0x56c3('0x1d')]?_0x4a0374[_0x56c3('0x1d')]['attributes']||null:null,'limit':_0x4a0374['options']?_0x4a0374[_0x56c3('0x1d')]['limit']||null:null,'include':_0x4a0374['options']?_0x4a0374[_0x56c3('0x1d')][_0x56c3('0x1f')]?_[_0x56c3('0x20')](_0x4a0374[_0x56c3('0x1d')][_0x56c3('0x1f')],function(_0x213f0c){return{'model':db[_0x213f0c['model']],'as':_0x213f0c['as'],'attributes':_0x213f0c[_0x56c3('0x21')],'include':_0x213f0c[_0x56c3('0x1f')]?_[_0x56c3('0x20')](_0x213f0c[_0x56c3('0x1f')],function(_0x22bff9){return{'model':db[_0x22bff9['model']],'as':_0x22bff9['as'],'attributes':_0x22bff9[_0x56c3('0x21')],'include':_0x22bff9[_0x56c3('0x1f')]?_[_0x56c3('0x20')](_0x22bff9['include'],function(_0x36e02a){return{'model':db[_0x36e02a[_0x56c3('0x22')]],'as':_0x36e02a['as'],'attributes':_0x36e02a[_0x56c3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x56c3('0x23')](function(_0x30c7f7){logger[_0x56c3('0x11')](_0x56c3('0x24'),_0x4a0374);logger['debug'](_0x56c3('0x24'),_0x4a0374,JSON[_0x56c3('0x25')](_0x30c7f7));_0x34083f(_0x30c7f7);})[_0x56c3('0x1a')](function(_0x19e5fb){logger[_0x56c3('0x16')]('GetChatQueue',_0x19e5fb[_0x56c3('0x18')],_0x4a0374);_0x4eb5f7(_0x3a94fd['error'](0x1f4,_0x19e5fb['message']));});});};exports['ShowChatQueue']=function(_0x438aad){var _0x4a41cf=this;return new Promise(function(_0x139dc1,_0x3b02eb){return db['ChatQueue'][_0x56c3('0x26')]({'raw':_0x438aad[_0x56c3('0x1d')]?_0x438aad[_0x56c3('0x1d')][_0x56c3('0x27')]===undefined?!![]:![]:!![],'where':_0x438aad[_0x56c3('0x1d')]?_0x438aad[_0x56c3('0x1d')]['where']||null:null,'attributes':_0x438aad[_0x56c3('0x1d')]?_0x438aad[_0x56c3('0x1d')]['attributes']||null:null,'include':_0x438aad[_0x56c3('0x1d')]?_0x438aad[_0x56c3('0x1d')][_0x56c3('0x1f')]?_[_0x56c3('0x20')](_0x438aad['options'][_0x56c3('0x1f')],function(_0x388a8d){return{'model':db[_0x388a8d['model']],'as':_0x388a8d['as'],'attributes':_0x388a8d[_0x56c3('0x21')],'include':_0x388a8d[_0x56c3('0x1f')]?_[_0x56c3('0x20')](_0x388a8d[_0x56c3('0x1f')],function(_0x115ab1){return{'model':db[_0x115ab1[_0x56c3('0x22')]],'as':_0x115ab1['as'],'attributes':_0x115ab1[_0x56c3('0x21')],'include':_0x115ab1['include']?_[_0x56c3('0x20')](_0x115ab1[_0x56c3('0x1f')],function(_0x4fafe5){return{'model':db[_0x4fafe5[_0x56c3('0x22')]],'as':_0x4fafe5['as'],'attributes':_0x4fafe5[_0x56c3('0x21')]};}):[]};}):[]};}):[]:[]})[_0x56c3('0x23')](function(_0x19a22c){logger['info'](_0x56c3('0x28'),_0x438aad);logger[_0x56c3('0x13')](_0x56c3('0x28'),_0x438aad,JSON[_0x56c3('0x25')](_0x19a22c));_0x139dc1(_0x19a22c);})[_0x56c3('0x1a')](function(_0x2b7ce7){logger['error'](_0x56c3('0x28'),_0x2b7ce7[_0x56c3('0x18')],_0x438aad);_0x3b02eb(_0x4a41cf[_0x56c3('0x16')](0x1f4,_0x2b7ce7['message']));});});}; \ No newline at end of file +var _0xac14=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','include','map','model','ShowChatQueue','lodash','util','moment','bluebird'];(function(_0x51fb3c,_0x28a763){var _0x941d96=function(_0x91294c){while(--_0x91294c){_0x51fb3c['push'](_0x51fb3c['shift']());}};_0x941d96(++_0x28a763);}(_0xac14,0x134));var _0x4ac1=function(_0x5c5a43,_0x42e1f7){_0x5c5a43=_0x5c5a43-0x0;var _0x8f5f1b=_0xac14[_0x5c5a43];return _0x8f5f1b;};'use strict';var _=require(_0x4ac1('0x0'));var util=require(_0x4ac1('0x1'));var moment=require(_0x4ac1('0x2'));var BPromise=require(_0x4ac1('0x3'));var rs=require(_0x4ac1('0x4'));var fs=require('fs');var Redis=require(_0x4ac1('0x5'));var db=require(_0x4ac1('0x6'))['db'];var utils=require(_0x4ac1('0x7'));var logger=require(_0x4ac1('0x8'))(_0x4ac1('0x9'));var config=require(_0x4ac1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x4ac1('0xb')]['http']({'port':0x232a});config[_0x4ac1('0xc')]=_[_0x4ac1('0xd')](config[_0x4ac1('0xc')],{'host':_0x4ac1('0xe'),'port':0x18eb});var socket=require(_0x4ac1('0xf'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x4ac1('0x10')](socket);function respondWithRpcPromise(_0x4f4918,_0x2e780c,_0x365f90){return new BPromise(function(_0x3bd008,_0x410870){return client[_0x4ac1('0x11')](_0x4f4918,_0x365f90)[_0x4ac1('0x12')](function(_0x5abe9d){logger[_0x4ac1('0x13')]('ChatQueue,\x20%s,\x20%s',_0x2e780c,_0x4ac1('0x14'));logger[_0x4ac1('0x15')](_0x4ac1('0x16'),_0x2e780c,_0x4ac1('0x14'),JSON[_0x4ac1('0x17')](_0x5abe9d));if(_0x5abe9d[_0x4ac1('0x18')]){if(_0x5abe9d['error']['code']===0x1f4){logger[_0x4ac1('0x18')](_0x4ac1('0x19'),_0x2e780c,_0x5abe9d[_0x4ac1('0x18')][_0x4ac1('0x1a')]);return _0x410870(_0x5abe9d[_0x4ac1('0x18')][_0x4ac1('0x1a')]);}logger[_0x4ac1('0x18')]('ChatQueue,\x20%s,\x20%s',_0x2e780c,_0x5abe9d[_0x4ac1('0x18')][_0x4ac1('0x1a')]);return _0x3bd008(_0x5abe9d[_0x4ac1('0x18')]['message']);}else{logger[_0x4ac1('0x13')](_0x4ac1('0x19'),_0x2e780c,_0x4ac1('0x14'));_0x3bd008(_0x5abe9d[_0x4ac1('0x1b')][_0x4ac1('0x1a')]);}})[_0x4ac1('0x1c')](function(_0x2d390a){logger[_0x4ac1('0x18')]('ChatQueue,\x20%s,\x20%s',_0x2e780c,_0x2d390a);_0x410870(_0x2d390a);});});}exports[_0x4ac1('0x1d')]=function(_0x460ca2){var _0x2acc86=this;return new Promise(function(_0x4d4991,_0x520dac){return db[_0x4ac1('0x1e')]['findAll']({'raw':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')][_0x4ac1('0x20')]===undefined?!![]:![]:!![],'where':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')][_0x4ac1('0x21')]||null:null,'attributes':_0x460ca2['options']?_0x460ca2['options'][_0x4ac1('0x22')]||null:null,'limit':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')]['limit']||null:null,'include':_0x460ca2[_0x4ac1('0x1f')]?_0x460ca2[_0x4ac1('0x1f')][_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x460ca2['options'][_0x4ac1('0x23')],function(_0x577ecb){return{'model':db[_0x577ecb[_0x4ac1('0x25')]],'as':_0x577ecb['as'],'attributes':_0x577ecb[_0x4ac1('0x22')],'include':_0x577ecb[_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x577ecb[_0x4ac1('0x23')],function(_0x363abb){return{'model':db[_0x363abb['model']],'as':_0x363abb['as'],'attributes':_0x363abb['attributes'],'include':_0x363abb[_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x363abb[_0x4ac1('0x23')],function(_0x44e15e){return{'model':db[_0x44e15e[_0x4ac1('0x25')]],'as':_0x44e15e['as'],'attributes':_0x44e15e[_0x4ac1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4ac1('0x12')](function(_0x4194c1){logger[_0x4ac1('0x13')](_0x4ac1('0x1d'),_0x460ca2);logger['debug'](_0x4ac1('0x1d'),_0x460ca2,JSON['stringify'](_0x4194c1));_0x4d4991(_0x4194c1);})[_0x4ac1('0x1c')](function(_0x1f926a){logger[_0x4ac1('0x18')]('GetChatQueue',_0x1f926a['message'],_0x460ca2);_0x520dac(_0x2acc86['error'](0x1f4,_0x1f926a['message']));});});};exports[_0x4ac1('0x26')]=function(_0x4acddb){var _0x4e5af2=this;return new Promise(function(_0x4438a8,_0x51122c){return db[_0x4ac1('0x1e')]['find']({'raw':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x20')]===undefined?!![]:![]:!![],'where':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x21')]||null:null,'attributes':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')]['attributes']||null:null,'include':_0x4acddb[_0x4ac1('0x1f')]?_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x23')]?_[_0x4ac1('0x24')](_0x4acddb[_0x4ac1('0x1f')][_0x4ac1('0x23')],function(_0x32cad1){return{'model':db[_0x32cad1[_0x4ac1('0x25')]],'as':_0x32cad1['as'],'attributes':_0x32cad1['attributes'],'include':_0x32cad1['include']?_[_0x4ac1('0x24')](_0x32cad1[_0x4ac1('0x23')],function(_0x549275){return{'model':db[_0x549275[_0x4ac1('0x25')]],'as':_0x549275['as'],'attributes':_0x549275[_0x4ac1('0x22')],'include':_0x549275['include']?_[_0x4ac1('0x24')](_0x549275['include'],function(_0xe21016){return{'model':db[_0xe21016[_0x4ac1('0x25')]],'as':_0xe21016['as'],'attributes':_0xe21016[_0x4ac1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x4ac1('0x12')](function(_0x4eefa1){logger['info'](_0x4ac1('0x26'),_0x4acddb);logger[_0x4ac1('0x15')](_0x4ac1('0x26'),_0x4acddb,JSON[_0x4ac1('0x17')](_0x4eefa1));_0x4438a8(_0x4eefa1);})['catch'](function(_0x1b8bb3){logger[_0x4ac1('0x18')](_0x4ac1('0x26'),_0x1b8bb3[_0x4ac1('0x1a')],_0x4acddb);_0x51122c(_0x4e5af2[_0x4ac1('0x18')](0x1f4,_0x1b8bb3['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index dc795ff..bafa3b1 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 _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var ChatQueueEvents=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(){ChatQueueEvents[_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);ChatQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index b88453b..faab7f5 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 _0x0828=['../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','addAgents','put','delete','/:id/teams','removeTeams','exports','util','path','connect-timeout','express','Router'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0828,0xdc));var _0x8082=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x0828[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require(_0x8082('0x0'));var path=require(_0x8082('0x1'));var timeout=require(_0x8082('0x2'));var express=require(_0x8082('0x3'));var router=express[_0x8082('0x4')]();var auth=require(_0x8082('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8082('0x6'));var controller=require(_0x8082('0x7'));router[_0x8082('0x8')]('/',auth[_0x8082('0x9')](),controller[_0x8082('0xa')]);router[_0x8082('0x8')](_0x8082('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x8082('0x8')](_0x8082('0xc'),auth[_0x8082('0x9')](),controller[_0x8082('0xd')]);router[_0x8082('0x8')](_0x8082('0xe'),auth['isAuthenticated'](),controller[_0x8082('0xf')]);router[_0x8082('0x8')]('/:id/teams',auth[_0x8082('0x9')](),controller['getTeams']);router[_0x8082('0x8')](_0x8082('0x10'),auth['isAuthenticated'](),controller[_0x8082('0x11')]);router['post']('/',auth[_0x8082('0x9')](),controller['create']);router[_0x8082('0x12')]('/:id/teams',auth[_0x8082('0x9')](),controller['addTeams']);router[_0x8082('0x12')]('/:id/users',auth['isAuthenticated'](),controller[_0x8082('0x13')]);router[_0x8082('0x14')]('/:id',auth[_0x8082('0x9')](),controller['update']);router[_0x8082('0x15')](_0x8082('0xc'),auth[_0x8082('0x9')](),controller['destroy']);router[_0x8082('0x15')](_0x8082('0x16'),auth[_0x8082('0x9')](),controller[_0x8082('0x17')]);router[_0x8082('0x15')](_0x8082('0x10'),auth[_0x8082('0x9')](),controller['removeAgents']);module[_0x8082('0x18')]=router; \ No newline at end of file +var _0x4bcb=['get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e3059,_0x5d008a){var _0x3e981a=function(_0x4f814a){while(--_0x4f814a){_0x1e3059['push'](_0x1e3059['shift']());}};_0x3e981a(++_0x5d008a);}(_0x4bcb,0x15a));var _0xb4bc=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0x4bcb[_0x52b24f];return _0x46ea6b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb4bc('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb4bc('0x1')]();var auth=require(_0xb4bc('0x2'));var interaction=require(_0xb4bc('0x3'));var config=require(_0xb4bc('0x4'));var controller=require('./chatQueue.controller');router[_0xb4bc('0x5')]('/',auth['isAuthenticated'](),controller[_0xb4bc('0x6')]);router[_0xb4bc('0x5')](_0xb4bc('0x7'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0x9')]);router[_0xb4bc('0x5')](_0xb4bc('0xa'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0xb')]);router['get'](_0xb4bc('0xc'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0xd')]);router[_0xb4bc('0x5')]('/:id/teams',auth[_0xb4bc('0x8')](),controller[_0xb4bc('0xe')]);router[_0xb4bc('0x5')](_0xb4bc('0xf'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0x10')]);router[_0xb4bc('0x11')]('/',auth[_0xb4bc('0x8')](),controller['create']);router[_0xb4bc('0x11')](_0xb4bc('0x12'),auth['isAuthenticated'](),controller[_0xb4bc('0x13')]);router[_0xb4bc('0x11')](_0xb4bc('0xf'),auth['isAuthenticated'](),controller[_0xb4bc('0x14')]);router[_0xb4bc('0x15')]('/:id',auth[_0xb4bc('0x8')](),controller['update']);router[_0xb4bc('0x16')](_0xb4bc('0xa'),auth[_0xb4bc('0x8')](),controller[_0xb4bc('0x17')]);router[_0xb4bc('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb4bc('0x18')]);router['delete'](_0xb4bc('0xf'),auth['isAuthenticated'](),controller[_0xb4bc('0x19')]);module[_0xb4bc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index fd93d9a..8f26d63 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 _0x0c13=['moment','exports','STRING','DATE'];(function(_0x1b4131,_0x29a33d){var _0x59468f=function(_0x139d5b){while(--_0x139d5b){_0x1b4131['push'](_0x1b4131['shift']());}};_0x59468f(++_0x29a33d);}(_0x0c13,0x88));var _0x30c1=function(_0x3da72b,_0x4fd809){_0x3da72b=_0x3da72b-0x0;var _0xc64ac4=_0x0c13[_0x3da72b];return _0xc64ac4;};'use strict';var moment=require(_0x30c1('0x0'));var Sequelize=require('sequelize');module[_0x30c1('0x1')]={'uniqueid':{'type':Sequelize[_0x30c1('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x30c1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x30c1('0x3')]},'acceptAt':{'type':Sequelize[_0x30c1('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x30c1('0x2')]}}; \ No newline at end of file +var _0x86b4=['exports','STRING','DATE','sequelize'];(function(_0xe0e2a8,_0x292f12){var _0x16f4b2=function(_0x3ebe9c){while(--_0x3ebe9c){_0xe0e2a8['push'](_0xe0e2a8['shift']());}};_0x16f4b2(++_0x292f12);}(_0x86b4,0x1a3));var _0x486b=function(_0x14feb6,_0x788fe3){_0x14feb6=_0x14feb6-0x0;var _0x3db984=_0x86b4[_0x14feb6];return _0x3db984;};'use strict';var moment=require('moment');var Sequelize=require(_0x486b('0x0'));module[_0x486b('0x1')]={'uniqueid':{'type':Sequelize[_0x486b('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x486b('0x2')]},'joinAt':{'type':Sequelize[_0x486b('0x3')]},'leaveAt':{'type':Sequelize[_0x486b('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x486b('0x3')]},'reason':{'type':Sequelize[_0x486b('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 56bc2b1..18ad43d 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 _0x58b8=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','count','offset','limit','status','Content-Range','json','reject','update','then','destroy','sendStatus','error','stack','name','send','rawAttributes','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','where','filters','pick','merge','map','key','VIRTUAL','field','filter','options','ChatQueueReport','findAll','rows','catch','show','params','includeAll','include','find','create','body','html-pdf'];(function(_0x47fa10,_0x39b01c){var _0x204f30=function(_0x4f87b0){while(--_0x4f87b0){_0x47fa10['push'](_0x47fa10['shift']());}};_0x204f30(++_0x39b01c);}(_0x58b8,0x8d));var _0x858b=function(_0x16eb11,_0x1a2251){_0x16eb11=_0x16eb11-0x0;var _0x3ae7ef=_0x58b8[_0x16eb11];return _0x3ae7ef;};'use strict';var pdf=require(_0x858b('0x0'));var emlformat=require(_0x858b('0x1'));var rimraf=require(_0x858b('0x2'));var zipdir=require(_0x858b('0x3'));var jsonpatch=require(_0x858b('0x4'));var rp=require(_0x858b('0x5'));var moment=require(_0x858b('0x6'));var BPromise=require(_0x858b('0x7'));var Mustache=require(_0x858b('0x8'));var util=require(_0x858b('0x9'));var path=require(_0x858b('0xa'));var sox=require(_0x858b('0xb'));var csv=require(_0x858b('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x858b('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x858b('0xe'));var deskjs=require(_0x858b('0xf'));var toCsv=require(_0x858b('0xc'));var querystring=require('querystring');var Papa=require(_0x858b('0x10'));var Redis=require(_0x858b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x858b('0x12'));var hardwareService=require(_0x858b('0x13'));var logger=require(_0x858b('0x14'))(_0x858b('0x15'));var utils=require('../../config/utils');var config=require(_0x858b('0x16'));var db=require(_0x858b('0x17'))['db'];function respondWithStatusCode(_0x46759b,_0x3adb0b){_0x3adb0b=_0x3adb0b||0xcc;return function(_0x29b5d9){if(_0x29b5d9){return _0x46759b['sendStatus'](_0x3adb0b);}return _0x46759b['status'](_0x3adb0b)[_0x858b('0x18')]();};}function respondWithResult(_0x32a571,_0x92468a){_0x92468a=_0x92468a||0xc8;return function(_0x2d372c){if(_0x2d372c){return _0x32a571['status'](_0x92468a)['json'](_0x2d372c);}};}function respondWithFilteredResult(_0x2bdbaf,_0x198fbc){return function(_0x381e42){if(_0x381e42){var _0x4b791d=_0x381e42[_0x858b('0x19')],_0x5ccef5=_0x198fbc[_0x858b('0x1a')],_0x2a368b=_0x198fbc[_0x858b('0x1a')]+_0x198fbc[_0x858b('0x1b')],_0x48f3ec;if(_0x2a368b>=_0x4b791d){_0x2a368b=_0x4b791d;_0x48f3ec=0xc8;}else{_0x48f3ec=0xce;}_0x2bdbaf[_0x858b('0x1c')](_0x48f3ec);return _0x2bdbaf['set'](_0x858b('0x1d'),_0x5ccef5+'-'+_0x2a368b+'/'+_0x4b791d)[_0x858b('0x1e')](_0x381e42);}return null;};}function patchUpdates(_0xf8b12e){return function(_0x39ecef){try{jsonpatch['apply'](_0x39ecef,_0xf8b12e,!![]);}catch(_0x1a9fad){return BPromise[_0x858b('0x1f')](_0x1a9fad);}return _0x39ecef['save']();};}function saveUpdates(_0x4d5a0c,_0x12c780){return function(_0x1f6da0){if(_0x1f6da0){return _0x1f6da0[_0x858b('0x20')](_0x4d5a0c)[_0x858b('0x21')](function(_0x57a795){return _0x57a795;});}return null;};}function removeEntity(_0x43c688,_0x799384){return function(_0x3bdb3f){if(_0x3bdb3f){return _0x3bdb3f[_0x858b('0x22')]()[_0x858b('0x21')](function(){_0x43c688['status'](0xcc)[_0x858b('0x18')]();});}};}function handleEntityNotFound(_0x2b8a41,_0xe638b5){return function(_0x18089d){if(!_0x18089d){_0x2b8a41[_0x858b('0x23')](0x194);}return _0x18089d;};}function handleError(_0x41604a,_0x42e797){_0x42e797=_0x42e797||0x1f4;return function(_0x2585a3){logger[_0x858b('0x24')](_0x2585a3[_0x858b('0x25')]);if(_0x2585a3['name']){delete _0x2585a3[_0x858b('0x26')];}_0x41604a[_0x858b('0x1c')](_0x42e797)[_0x858b('0x27')](_0x2585a3);};}exports['index']=function(_0x281e6c,_0x165592){var _0x7616d7={},_0x54390b={},_0x57560a={'count':0x0,'rows':[]};var _0x3dd344=db['ChatQueueReport'][_0x858b('0x28')];_0x54390b['model']=_[_0x858b('0x29')](_0x3dd344);_0x54390b[_0x858b('0x2a')]=_[_0x858b('0x29')](_0x281e6c['query']);_0x54390b['filters']=_[_0x858b('0x2b')](_0x54390b['model'],_0x54390b[_0x858b('0x2a')]);_0x7616d7[_0x858b('0x2c')]=_['intersection'](_0x54390b[_0x858b('0x2d')],qs['fields'](_0x281e6c[_0x858b('0x2a')][_0x858b('0x2e')]));_0x7616d7[_0x858b('0x2c')]=_0x7616d7[_0x858b('0x2c')][_0x858b('0x2f')]?_0x7616d7['attributes']:_0x54390b[_0x858b('0x2d')];if(!_0x281e6c[_0x858b('0x2a')][_0x858b('0x30')](_0x858b('0x31'))){_0x7616d7[_0x858b('0x1b')]=qs[_0x858b('0x1b')](_0x281e6c[_0x858b('0x2a')][_0x858b('0x1b')]);_0x7616d7['offset']=qs[_0x858b('0x1a')](_0x281e6c[_0x858b('0x2a')][_0x858b('0x1a')]);}_0x7616d7['order']=qs['sort'](_0x281e6c[_0x858b('0x2a')]['sort']);_0x7616d7[_0x858b('0x32')]=qs[_0x858b('0x33')](_[_0x858b('0x34')](_0x281e6c[_0x858b('0x2a')],_0x54390b['filters']));if(_0x281e6c[_0x858b('0x2a')]['filter']){_0x7616d7[_0x858b('0x32')]=_[_0x858b('0x35')](_0x7616d7['where'],{'$or':_[_0x858b('0x36')](_0x3dd344,function(_0x34d274){if(_0x34d274['type'][_0x858b('0x37')]!==_0x858b('0x38')){var _0x554306={};_0x554306[_0x34d274[_0x858b('0x39')]]={'$like':'%'+_0x281e6c[_0x858b('0x2a')][_0x858b('0x3a')]+'%'};return _0x554306;}})});}_0x7616d7=_[_0x858b('0x35')]({},_0x7616d7,_0x281e6c[_0x858b('0x3b')]);var _0x3f51b7={'where':_0x7616d7[_0x858b('0x32')]};return db[_0x858b('0x3c')][_0x858b('0x19')](_0x3f51b7)[_0x858b('0x21')](function(_0x15f9fd){_0x57560a[_0x858b('0x19')]=_0x15f9fd;if(_0x281e6c['query']['includeAll']){_0x7616d7['include']=[{'all':!![]}];}return db[_0x858b('0x3c')][_0x858b('0x3d')](_0x7616d7);})[_0x858b('0x21')](function(_0x38b823){_0x57560a[_0x858b('0x3e')]=_0x38b823;return _0x57560a;})[_0x858b('0x21')](respondWithFilteredResult(_0x165592,_0x7616d7))[_0x858b('0x3f')](handleError(_0x165592,null));};exports[_0x858b('0x40')]=function(_0x691e8e,_0x4eeec0){var _0x5e4dea={'raw':!![],'where':{'id':_0x691e8e[_0x858b('0x41')]['id']}},_0x50bd0f={};_0x50bd0f[_0x858b('0x2d')]=_['keys'](db[_0x858b('0x3c')][_0x858b('0x28')]);_0x50bd0f[_0x858b('0x2a')]=_[_0x858b('0x29')](_0x691e8e[_0x858b('0x2a')]);_0x50bd0f[_0x858b('0x33')]=_[_0x858b('0x2b')](_0x50bd0f[_0x858b('0x2d')],_0x50bd0f[_0x858b('0x2a')]);_0x5e4dea[_0x858b('0x2c')]=_[_0x858b('0x2b')](_0x50bd0f['model'],qs['fields'](_0x691e8e['query'][_0x858b('0x2e')]));_0x5e4dea[_0x858b('0x2c')]=_0x5e4dea[_0x858b('0x2c')][_0x858b('0x2f')]?_0x5e4dea['attributes']:_0x50bd0f['model'];if(_0x691e8e['query'][_0x858b('0x42')]){_0x5e4dea[_0x858b('0x43')]=[{'all':!![]}];}_0x5e4dea=_[_0x858b('0x35')]({},_0x5e4dea,_0x691e8e['options']);return db[_0x858b('0x3c')][_0x858b('0x44')](_0x5e4dea)[_0x858b('0x21')](handleEntityNotFound(_0x4eeec0,null))['then'](respondWithResult(_0x4eeec0,null))[_0x858b('0x3f')](handleError(_0x4eeec0,null));};exports[_0x858b('0x45')]=function(_0x392524,_0x548b22){return db[_0x858b('0x3c')][_0x858b('0x45')](_0x392524['body'],{})[_0x858b('0x21')](respondWithResult(_0x548b22,0xc9))[_0x858b('0x3f')](handleError(_0x548b22,null));};exports['update']=function(_0x395816,_0x6873d2){if(_0x395816[_0x858b('0x46')]['id']){delete _0x395816['body']['id'];}return db['ChatQueueReport'][_0x858b('0x44')]({'where':{'id':_0x395816['params']['id']}})[_0x858b('0x21')](handleEntityNotFound(_0x6873d2,null))['then'](saveUpdates(_0x395816[_0x858b('0x46')],null))[_0x858b('0x21')](respondWithResult(_0x6873d2,null))[_0x858b('0x3f')](handleError(_0x6873d2,null));};exports[_0x858b('0x22')]=function(_0x2ceeb3,_0x25ff27){return db[_0x858b('0x3c')][_0x858b('0x44')]({'where':{'id':_0x2ceeb3[_0x858b('0x41')]['id']}})[_0x858b('0x21')](handleEntityNotFound(_0x25ff27,null))[_0x858b('0x21')](removeEntity(_0x25ff27,null))[_0x858b('0x3f')](handleError(_0x25ff27,null));};exports['describe']=function(_0x81ef88,_0x64d97a){return db[_0x858b('0x3c')]['describe']()['then'](respondWithResult(_0x64d97a,null))[_0x858b('0x3f')](handleError(_0x64d97a,null));}; \ No newline at end of file +var _0xb9f6=['update','destroy','then','error','stack','name','send','model','keys','query','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','field','options','ChatQueueReport','includeAll','include','findAll','rows','catch','params','rawAttributes','fields','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','save'];(function(_0x4a63f3,_0x4b02aa){var _0xc4aa6a=function(_0x4bbcdc){while(--_0x4bbcdc){_0x4a63f3['push'](_0x4a63f3['shift']());}};_0xc4aa6a(++_0x4b02aa);}(_0xb9f6,0x1de));var _0x6b9f=function(_0xc1b84e,_0x12caee){_0xc1b84e=_0xc1b84e-0x0;var _0xeaa56b=_0xb9f6[_0xc1b84e];return _0xeaa56b;};'use strict';var pdf=require(_0x6b9f('0x0'));var emlformat=require(_0x6b9f('0x1'));var rimraf=require(_0x6b9f('0x2'));var zipdir=require(_0x6b9f('0x3'));var jsonpatch=require(_0x6b9f('0x4'));var rp=require('request-promise');var moment=require(_0x6b9f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6b9f('0x6'));var util=require('util');var path=require(_0x6b9f('0x7'));var sox=require(_0x6b9f('0x8'));var csv=require(_0x6b9f('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6b9f('0xa'));var squel=require(_0x6b9f('0xb'));var crypto=require(_0x6b9f('0xc'));var jsforce=require(_0x6b9f('0xd'));var deskjs=require(_0x6b9f('0xe'));var toCsv=require(_0x6b9f('0x9'));var querystring=require(_0x6b9f('0xf'));var Papa=require(_0x6b9f('0x10'));var Redis=require(_0x6b9f('0x11'));var authService=require(_0x6b9f('0x12'));var qs=require(_0x6b9f('0x13'));var hardwareService=require(_0x6b9f('0x14'));var logger=require(_0x6b9f('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x6b9f('0x16'));var db=require(_0x6b9f('0x17'))['db'];function respondWithStatusCode(_0x51ed25,_0x4facc6){_0x4facc6=_0x4facc6||0xcc;return function(_0x46a2f6){if(_0x46a2f6){return _0x51ed25['sendStatus'](_0x4facc6);}return _0x51ed25[_0x6b9f('0x18')](_0x4facc6)[_0x6b9f('0x19')]();};}function respondWithResult(_0x1607ad,_0x3e8b8c){_0x3e8b8c=_0x3e8b8c||0xc8;return function(_0x33036a){if(_0x33036a){return _0x1607ad[_0x6b9f('0x18')](_0x3e8b8c)[_0x6b9f('0x1a')](_0x33036a);}};}function respondWithFilteredResult(_0x446895,_0x251f46){return function(_0x2672f0){if(_0x2672f0){var _0x52dfc8=_0x2672f0[_0x6b9f('0x1b')],_0x2b1bfe=_0x251f46['offset'],_0x1386b3=_0x251f46[_0x6b9f('0x1c')]+_0x251f46['limit'],_0x33b81c;if(_0x1386b3>=_0x52dfc8){_0x1386b3=_0x52dfc8;_0x33b81c=0xc8;}else{_0x33b81c=0xce;}_0x446895[_0x6b9f('0x18')](_0x33b81c);return _0x446895[_0x6b9f('0x1d')](_0x6b9f('0x1e'),_0x2b1bfe+'-'+_0x1386b3+'/'+_0x52dfc8)[_0x6b9f('0x1a')](_0x2672f0);}return null;};}function patchUpdates(_0x5b152d){return function(_0x17e7ec){try{jsonpatch[_0x6b9f('0x1f')](_0x17e7ec,_0x5b152d,!![]);}catch(_0x5cc109){return BPromise['reject'](_0x5cc109);}return _0x17e7ec[_0x6b9f('0x20')]();};}function saveUpdates(_0x4488e2,_0x190cc2){return function(_0x497802){if(_0x497802){return _0x497802[_0x6b9f('0x21')](_0x4488e2)['then'](function(_0x17fb82){return _0x17fb82;});}return null;};}function removeEntity(_0x599d11,_0x2455ee){return function(_0x4eaefa){if(_0x4eaefa){return _0x4eaefa[_0x6b9f('0x22')]()[_0x6b9f('0x23')](function(){_0x599d11[_0x6b9f('0x18')](0xcc)[_0x6b9f('0x19')]();});}};}function handleEntityNotFound(_0x3b7acc,_0x1dbfee){return function(_0xc12bcd){if(!_0xc12bcd){_0x3b7acc['sendStatus'](0x194);}return _0xc12bcd;};}function handleError(_0x237e72,_0x12ad7a){_0x12ad7a=_0x12ad7a||0x1f4;return function(_0x4c73c9){logger[_0x6b9f('0x24')](_0x4c73c9[_0x6b9f('0x25')]);if(_0x4c73c9['name']){delete _0x4c73c9[_0x6b9f('0x26')];}_0x237e72[_0x6b9f('0x18')](_0x12ad7a)[_0x6b9f('0x27')](_0x4c73c9);};}exports['index']=function(_0x1b28cf,_0x2cb6aa){var _0x3d57c4={},_0x6454cb={},_0x2c59d4={'count':0x0,'rows':[]};var _0xf45a86=db['ChatQueueReport']['rawAttributes'];_0x6454cb[_0x6b9f('0x28')]=_[_0x6b9f('0x29')](_0xf45a86);_0x6454cb[_0x6b9f('0x2a')]=_[_0x6b9f('0x29')](_0x1b28cf[_0x6b9f('0x2a')]);_0x6454cb[_0x6b9f('0x2b')]=_[_0x6b9f('0x2c')](_0x6454cb[_0x6b9f('0x28')],_0x6454cb[_0x6b9f('0x2a')]);_0x3d57c4['attributes']=_['intersection'](_0x6454cb[_0x6b9f('0x28')],qs['fields'](_0x1b28cf[_0x6b9f('0x2a')]['fields']));_0x3d57c4[_0x6b9f('0x2d')]=_0x3d57c4['attributes'][_0x6b9f('0x2e')]?_0x3d57c4['attributes']:_0x6454cb[_0x6b9f('0x28')];if(!_0x1b28cf[_0x6b9f('0x2a')]['hasOwnProperty'](_0x6b9f('0x2f'))){_0x3d57c4[_0x6b9f('0x30')]=qs[_0x6b9f('0x30')](_0x1b28cf[_0x6b9f('0x2a')]['limit']);_0x3d57c4[_0x6b9f('0x1c')]=qs[_0x6b9f('0x1c')](_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x1c')]);}_0x3d57c4[_0x6b9f('0x31')]=qs[_0x6b9f('0x32')](_0x1b28cf[_0x6b9f('0x2a')]['sort']);_0x3d57c4[_0x6b9f('0x33')]=qs[_0x6b9f('0x2b')](_[_0x6b9f('0x34')](_0x1b28cf[_0x6b9f('0x2a')],_0x6454cb[_0x6b9f('0x2b')]));if(_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x35')]){_0x3d57c4[_0x6b9f('0x33')]=_[_0x6b9f('0x36')](_0x3d57c4['where'],{'$or':_[_0x6b9f('0x37')](_0xf45a86,function(_0x569900){if(_0x569900[_0x6b9f('0x38')][_0x6b9f('0x39')]!=='VIRTUAL'){var _0xa9eb15={};_0xa9eb15[_0x569900[_0x6b9f('0x3a')]]={'$like':'%'+_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x35')]+'%'};return _0xa9eb15;}})});}_0x3d57c4=_[_0x6b9f('0x36')]({},_0x3d57c4,_0x1b28cf[_0x6b9f('0x3b')]);var _0x2305a8={'where':_0x3d57c4[_0x6b9f('0x33')]};return db[_0x6b9f('0x3c')][_0x6b9f('0x1b')](_0x2305a8)['then'](function(_0x1abd19){_0x2c59d4[_0x6b9f('0x1b')]=_0x1abd19;if(_0x1b28cf[_0x6b9f('0x2a')][_0x6b9f('0x3d')]){_0x3d57c4[_0x6b9f('0x3e')]=[{'all':!![]}];}return db[_0x6b9f('0x3c')][_0x6b9f('0x3f')](_0x3d57c4);})['then'](function(_0x4e1cce){_0x2c59d4[_0x6b9f('0x40')]=_0x4e1cce;return _0x2c59d4;})[_0x6b9f('0x23')](respondWithFilteredResult(_0x2cb6aa,_0x3d57c4))[_0x6b9f('0x41')](handleError(_0x2cb6aa,null));};exports['show']=function(_0x3dc1f9,_0x1c223f){var _0x9d53f4={'raw':!![],'where':{'id':_0x3dc1f9[_0x6b9f('0x42')]['id']}},_0x22d00d={};_0x22d00d[_0x6b9f('0x28')]=_[_0x6b9f('0x29')](db[_0x6b9f('0x3c')][_0x6b9f('0x43')]);_0x22d00d['query']=_['keys'](_0x3dc1f9[_0x6b9f('0x2a')]);_0x22d00d[_0x6b9f('0x2b')]=_['intersection'](_0x22d00d[_0x6b9f('0x28')],_0x22d00d[_0x6b9f('0x2a')]);_0x9d53f4['attributes']=_['intersection'](_0x22d00d['model'],qs[_0x6b9f('0x44')](_0x3dc1f9[_0x6b9f('0x2a')][_0x6b9f('0x44')]));_0x9d53f4['attributes']=_0x9d53f4[_0x6b9f('0x2d')][_0x6b9f('0x2e')]?_0x9d53f4['attributes']:_0x22d00d['model'];if(_0x3dc1f9[_0x6b9f('0x2a')][_0x6b9f('0x3d')]){_0x9d53f4['include']=[{'all':!![]}];}_0x9d53f4=_[_0x6b9f('0x36')]({},_0x9d53f4,_0x3dc1f9[_0x6b9f('0x3b')]);return db['ChatQueueReport'][_0x6b9f('0x45')](_0x9d53f4)[_0x6b9f('0x23')](handleEntityNotFound(_0x1c223f,null))[_0x6b9f('0x23')](respondWithResult(_0x1c223f,null))[_0x6b9f('0x41')](handleError(_0x1c223f,null));};exports[_0x6b9f('0x46')]=function(_0x42f987,_0x3040fa){return db['ChatQueueReport'][_0x6b9f('0x46')](_0x42f987[_0x6b9f('0x47')],{})[_0x6b9f('0x23')](respondWithResult(_0x3040fa,0xc9))['catch'](handleError(_0x3040fa,null));};exports[_0x6b9f('0x21')]=function(_0x443f49,_0x5c7311){if(_0x443f49['body']['id']){delete _0x443f49[_0x6b9f('0x47')]['id'];}return db['ChatQueueReport'][_0x6b9f('0x45')]({'where':{'id':_0x443f49['params']['id']}})['then'](handleEntityNotFound(_0x5c7311,null))[_0x6b9f('0x23')](saveUpdates(_0x443f49[_0x6b9f('0x47')],null))['then'](respondWithResult(_0x5c7311,null))['catch'](handleError(_0x5c7311,null));};exports[_0x6b9f('0x22')]=function(_0x1a2cfc,_0x403d9a){return db[_0x6b9f('0x3c')][_0x6b9f('0x45')]({'where':{'id':_0x1a2cfc[_0x6b9f('0x42')]['id']}})['then'](handleEntityNotFound(_0x403d9a,null))[_0x6b9f('0x23')](removeEntity(_0x403d9a,null))[_0x6b9f('0x41')](handleError(_0x403d9a,null));};exports[_0x6b9f('0x48')]=function(_0x43692f,_0x5c3670){return db['ChatQueueReport'][_0x6b9f('0x48')]()[_0x6b9f('0x23')](respondWithResult(_0x5c3670,null))[_0x6b9f('0x41')](handleError(_0x5c3670,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 6623ec2..1869594 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 _0x2fe9=['ChatQueueReport','report_chat_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x2fe9,0xb9));var _0x92fe=function(_0x242daa,_0x338e8b){_0x242daa=_0x242daa-0x0;var _0x392a64=_0x2fe9[_0x242daa];return _0x392a64;};'use strict';var _=require(_0x92fe('0x0'));var util=require(_0x92fe('0x1'));var logger=require(_0x92fe('0x2'))('api');var moment=require(_0x92fe('0x3'));var BPromise=require(_0x92fe('0x4'));var rp=require(_0x92fe('0x5'));var fs=require('fs');var path=require(_0x92fe('0x6'));var rimraf=require('rimraf');var config=require(_0x92fe('0x7'));var attributes=require(_0x92fe('0x8'));module[_0x92fe('0x9')]=function(_0xa9e4a0,_0x2ffe3f){return _0xa9e4a0['define'](_0x92fe('0xa'),attributes,{'tableName':_0x92fe('0xb'),'paranoid':![],'indexes':[{'name':_0x92fe('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d29=['moment','request-promise','../../config/environment','./chatQueueReport.attributes','define','report_chat_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x2d29,0x1dd));var _0x92d2=function(_0x5ec607,_0x16c7b7){_0x5ec607=_0x5ec607-0x0;var _0x5275f4=_0x2d29[_0x5ec607];return _0x5275f4;};'use strict';var _=require(_0x92d2('0x0'));var util=require(_0x92d2('0x1'));var logger=require(_0x92d2('0x2'))('api');var moment=require(_0x92d2('0x3'));var BPromise=require('bluebird');var rp=require(_0x92d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x92d2('0x5'));var attributes=require(_0x92d2('0x6'));module['exports']=function(_0x5a352e,_0x2490ea){return _0x5a352e[_0x92d2('0x7')]('ChatQueueReport',attributes,{'tableName':_0x92d2('0x8'),'paranoid':![],'indexes':[{'name':_0x92d2('0x9'),'fields':[_0x92d2('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index d921044..9bd4701 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 _0xe4e2=['error','code','message','catch','CreateChatQueueReport','create','body','options','raw','debug','UpdateChatQueueReport','where','attributes','limit','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x12807b,_0x7c0dfb){var _0x5a676e=function(_0x2cb9d9){while(--_0x2cb9d9){_0x12807b['push'](_0x12807b['shift']());}};_0x5a676e(++_0x7c0dfb);}(_0xe4e2,0x86));var _0x2e4e=function(_0x46f6c6,_0x5f337d){_0x46f6c6=_0x46f6c6-0x0;var _0x462bb8=_0xe4e2[_0x46f6c6];return _0x462bb8;};'use strict';var _=require('lodash');var util=require(_0x2e4e('0x0'));var moment=require(_0x2e4e('0x1'));var BPromise=require(_0x2e4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e4e('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e4e('0x4'))(_0x2e4e('0x5'));var config=require(_0x2e4e('0x6'));var jayson=require(_0x2e4e('0x7'));var client=jayson[_0x2e4e('0x8')][_0x2e4e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e3df7,_0x433a04,_0x44d1eb){return new BPromise(function(_0x82c493,_0x4dbb66){return client['request'](_0x5e3df7,_0x44d1eb)[_0x2e4e('0xa')](function(_0x58e1ee){logger[_0x2e4e('0xb')](_0x2e4e('0xc'),_0x433a04,_0x2e4e('0xd'));logger['debug'](_0x2e4e('0xe'),_0x433a04,_0x2e4e('0xd'),JSON[_0x2e4e('0xf')](_0x58e1ee));if(_0x58e1ee[_0x2e4e('0x10')]){if(_0x58e1ee['error'][_0x2e4e('0x11')]===0x1f4){logger['error'](_0x2e4e('0xc'),_0x433a04,_0x58e1ee[_0x2e4e('0x10')][_0x2e4e('0x12')]);return _0x4dbb66(_0x58e1ee['error']['message']);}logger[_0x2e4e('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x433a04,_0x58e1ee[_0x2e4e('0x10')][_0x2e4e('0x12')]);return _0x82c493(_0x58e1ee['error'][_0x2e4e('0x12')]);}else{logger[_0x2e4e('0xb')](_0x2e4e('0xc'),_0x433a04,_0x2e4e('0xd'));_0x82c493(_0x58e1ee['result'][_0x2e4e('0x12')]);}})[_0x2e4e('0x13')](function(_0x6f962){logger[_0x2e4e('0x10')](_0x2e4e('0xc'),_0x433a04,_0x6f962);_0x4dbb66(_0x6f962);});});}exports[_0x2e4e('0x14')]=function(_0x27a3ed){var _0xdc1292=this;return new Promise(function(_0x1596ea,_0x52d75a){return db['ChatQueueReport'][_0x2e4e('0x15')](_0x27a3ed[_0x2e4e('0x16')],{'raw':_0x27a3ed[_0x2e4e('0x17')]?_0x27a3ed[_0x2e4e('0x17')][_0x2e4e('0x18')]===undefined?!![]:![]:!![]})[_0x2e4e('0xa')](function(_0x5d70f4){logger[_0x2e4e('0xb')](_0x2e4e('0x14'),_0x27a3ed);logger[_0x2e4e('0x19')](_0x2e4e('0x14'),_0x27a3ed,JSON['stringify'](_0x5d70f4));_0x1596ea(_0x5d70f4);})[_0x2e4e('0x13')](function(_0x199bf3){logger[_0x2e4e('0x10')]('CreateChatQueueReport',_0x199bf3[_0x2e4e('0x12')],_0x27a3ed);_0x52d75a(_0xdc1292[_0x2e4e('0x10')](0x1f4,_0x199bf3['message']));});});};exports[_0x2e4e('0x1a')]=function(_0x5ad54e){var _0x26792a=this;return new Promise(function(_0xfe9f81,_0x5af03e){return db['ChatQueueReport']['update'](_0x5ad54e['body'],{'raw':_0x5ad54e[_0x2e4e('0x17')]?_0x5ad54e[_0x2e4e('0x17')][_0x2e4e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ad54e[_0x2e4e('0x17')]?_0x5ad54e[_0x2e4e('0x17')][_0x2e4e('0x1b')]||null:null,'attributes':_0x5ad54e[_0x2e4e('0x17')]?_0x5ad54e[_0x2e4e('0x17')][_0x2e4e('0x1c')]||null:null,'limit':_0x5ad54e[_0x2e4e('0x17')]?_0x5ad54e[_0x2e4e('0x17')][_0x2e4e('0x1d')]||null:null})[_0x2e4e('0xa')](function(_0x1f255c){logger['info'](_0x2e4e('0x1a'),_0x5ad54e);logger[_0x2e4e('0x19')](_0x2e4e('0x1a'),_0x5ad54e,JSON[_0x2e4e('0xf')](_0x1f255c));_0xfe9f81(_0x1f255c);})[_0x2e4e('0x13')](function(_0x31fc0e){logger[_0x2e4e('0x10')](_0x2e4e('0x1a'),_0x31fc0e[_0x2e4e('0x12')],_0x5ad54e);_0x5af03e(_0x26792a['error'](0x1f4,_0x31fc0e[_0x2e4e('0x12')]));});});}; \ No newline at end of file +var _0xf267=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','update','where','attributes','UpdateChatQueueReport','lodash','util','moment','randomstring'];(function(_0x3d717f,_0x23d861){var _0x2217d5=function(_0x59626a){while(--_0x59626a){_0x3d717f['push'](_0x3d717f['shift']());}};_0x2217d5(++_0x23d861);}(_0xf267,0xea));var _0x7f26=function(_0x5ae423,_0x39c5bf){_0x5ae423=_0x5ae423-0x0;var _0x4f88a2=_0xf267[_0x5ae423];return _0x4f88a2;};'use strict';var _=require(_0x7f26('0x0'));var util=require(_0x7f26('0x1'));var moment=require(_0x7f26('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f26('0x3'));var fs=require('fs');var Redis=require(_0x7f26('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7f26('0x5'))(_0x7f26('0x6'));var config=require(_0x7f26('0x7'));var jayson=require(_0x7f26('0x8'));var client=jayson[_0x7f26('0x9')][_0x7f26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d7774,_0x57a705,_0x2c9598){return new BPromise(function(_0x33dc92,_0x5ac1b0){return client[_0x7f26('0xb')](_0x1d7774,_0x2c9598)[_0x7f26('0xc')](function(_0xb6dc39){logger[_0x7f26('0xd')](_0x7f26('0xe'),_0x57a705,'request\x20sent');logger[_0x7f26('0xf')](_0x7f26('0x10'),_0x57a705,_0x7f26('0x11'),JSON['stringify'](_0xb6dc39));if(_0xb6dc39[_0x7f26('0x12')]){if(_0xb6dc39[_0x7f26('0x12')][_0x7f26('0x13')]===0x1f4){logger[_0x7f26('0x12')](_0x7f26('0xe'),_0x57a705,_0xb6dc39[_0x7f26('0x12')]['message']);return _0x5ac1b0(_0xb6dc39[_0x7f26('0x12')][_0x7f26('0x14')]);}logger['error'](_0x7f26('0xe'),_0x57a705,_0xb6dc39['error'][_0x7f26('0x14')]);return _0x33dc92(_0xb6dc39[_0x7f26('0x12')][_0x7f26('0x14')]);}else{logger[_0x7f26('0xd')](_0x7f26('0xe'),_0x57a705,_0x7f26('0x11'));_0x33dc92(_0xb6dc39[_0x7f26('0x15')][_0x7f26('0x14')]);}})[_0x7f26('0x16')](function(_0xf4563d){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x57a705,_0xf4563d);_0x5ac1b0(_0xf4563d);});});}exports[_0x7f26('0x17')]=function(_0x124692){var _0xa45ecb=this;return new Promise(function(_0x47f0a,_0x58c3b){return db[_0x7f26('0x18')][_0x7f26('0x19')](_0x124692[_0x7f26('0x1a')],{'raw':_0x124692[_0x7f26('0x1b')]?_0x124692[_0x7f26('0x1b')][_0x7f26('0x1c')]===undefined?!![]:![]:!![]})[_0x7f26('0xc')](function(_0x320e70){logger[_0x7f26('0xd')](_0x7f26('0x17'),_0x124692);logger[_0x7f26('0xf')]('CreateChatQueueReport',_0x124692,JSON[_0x7f26('0x1d')](_0x320e70));_0x47f0a(_0x320e70);})[_0x7f26('0x16')](function(_0x2927b0){logger[_0x7f26('0x12')](_0x7f26('0x17'),_0x2927b0[_0x7f26('0x14')],_0x124692);_0x58c3b(_0xa45ecb['error'](0x1f4,_0x2927b0[_0x7f26('0x14')]));});});};exports['UpdateChatQueueReport']=function(_0x2fdb46){var _0x3aebbb=this;return new Promise(function(_0x337251,_0x14e199){return db[_0x7f26('0x18')][_0x7f26('0x1e')](_0x2fdb46[_0x7f26('0x1a')],{'raw':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')][_0x7f26('0x1f')]||null:null,'attributes':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')][_0x7f26('0x20')]||null:null,'limit':_0x2fdb46[_0x7f26('0x1b')]?_0x2fdb46[_0x7f26('0x1b')]['limit']||null:null})[_0x7f26('0xc')](function(_0x337275){logger[_0x7f26('0xd')]('UpdateChatQueueReport',_0x2fdb46);logger[_0x7f26('0xf')]('UpdateChatQueueReport',_0x2fdb46,JSON['stringify'](_0x337275));_0x337251(_0x337275);})[_0x7f26('0x16')](function(_0x2515ec){logger[_0x7f26('0x12')](_0x7f26('0x21'),_0x2515ec[_0x7f26('0x14')],_0x2fdb46);_0x14e199(_0x3aebbb['error'](0x1f4,_0x2515ec[_0x7f26('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index dc8db8a..35f93c4 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 _0x44f6=['index','/describe','/:id','show','post','create','put','update','destroy','exports','util','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x61587,_0x3825df){var _0x32e3c6=function(_0x1384cd){while(--_0x1384cd){_0x61587['push'](_0x61587['shift']());}};_0x32e3c6(++_0x3825df);}(_0x44f6,0x191));var _0x644f=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0x44f6[_0x3cec8c];return _0x38032e;};'use strict';var multer=require('multer');var util=require(_0x644f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x644f('0x1')]();var auth=require(_0x644f('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x644f('0x3'));var controller=require(_0x644f('0x4'));router[_0x644f('0x5')]('/',auth[_0x644f('0x6')](),controller[_0x644f('0x7')]);router['get'](_0x644f('0x8'),auth[_0x644f('0x6')](),controller['describe']);router[_0x644f('0x5')](_0x644f('0x9'),auth[_0x644f('0x6')](),controller[_0x644f('0xa')]);router[_0x644f('0xb')]('/',auth[_0x644f('0x6')](),controller[_0x644f('0xc')]);router[_0x644f('0xd')](_0x644f('0x9'),auth[_0x644f('0x6')](),controller[_0x644f('0xe')]);router['delete']('/:id',auth[_0x644f('0x6')](),controller[_0x644f('0xf')]);module[_0x644f('0x10')]=router; \ No newline at end of file +var _0x33d2=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x33d2,0x8b));var _0x233d=function(_0x336c8b,_0x56b55b){_0x336c8b=_0x336c8b-0x0;var _0x4dd2f6=_0x33d2[_0x336c8b];return _0x4dd2f6;};'use strict';var multer=require(_0x233d('0x0'));var util=require(_0x233d('0x1'));var path=require(_0x233d('0x2'));var timeout=require(_0x233d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x233d('0x4'));var interaction=require(_0x233d('0x5'));var config=require('../../config/environment');var controller=require(_0x233d('0x6'));router[_0x233d('0x7')]('/',auth[_0x233d('0x8')](),controller[_0x233d('0x9')]);router[_0x233d('0x7')](_0x233d('0xa'),auth[_0x233d('0x8')](),controller[_0x233d('0xb')]);router['get'](_0x233d('0xc'),auth['isAuthenticated'](),controller[_0x233d('0xd')]);router[_0x233d('0xe')]('/',auth[_0x233d('0x8')](),controller[_0x233d('0xf')]);router[_0x233d('0x10')](_0x233d('0xc'),auth[_0x233d('0x8')](),controller[_0x233d('0x11')]);router[_0x233d('0x12')](_0x233d('0xc'),auth[_0x233d('0x8')](),controller[_0x233d('0x13')]);module[_0x233d('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 41aade7..2babacb 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 _0xdeb8=['agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x39f0bc,_0x2cab46){var _0x5d48ce=function(_0x3e6c72){while(--_0x3e6c72){_0x39f0bc['push'](_0x39f0bc['shift']());}};_0x5d48ce(++_0x2cab46);}(_0xdeb8,0x130));var _0x8deb=function(_0x332b50,_0xf0fae8){_0x332b50=_0x332b50-0x0;var _0x2be713=_0xdeb8[_0x332b50];return _0x2be713;};'use strict';var moment=require('moment');var Sequelize=require(_0x8deb('0x0'));module[_0x8deb('0x1')]={'uniqueid':{'type':Sequelize[_0x8deb('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8deb('0x3')]('account',_0x8deb('0x4'),_0x8deb('0x5')),'allowNull':![],'defaultValue':_0x8deb('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x8deb('0x6')]}}; \ No newline at end of file +var _0x0974=['queue','DATE','moment','sequelize','exports','STRING','ENUM'];(function(_0x1066a3,_0x4ae4b6){var _0x488ca3=function(_0x56377c){while(--_0x56377c){_0x1066a3['push'](_0x1066a3['shift']());}};_0x488ca3(++_0x4ae4b6);}(_0x0974,0x1b4));var _0x4097=function(_0x1b598d,_0x1d4db8){_0x1b598d=_0x1b598d-0x0;var _0x5a3ee6=_0x0974[_0x1b598d];return _0x5a3ee6;};'use strict';var moment=require(_0x4097('0x0'));var Sequelize=require(_0x4097('0x1'));module[_0x4097('0x2')]={'uniqueid':{'type':Sequelize[_0x4097('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4097('0x4')]('account','agent','queue'),'allowNull':![],'defaultValue':_0x4097('0x5')},'transferredAt':{'type':Sequelize[_0x4097('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1a567a3..1bd472a 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 _0xdfda=['then','stack','name','index','ChatTransferReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','create','body','destroy','find','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update'];(function(_0x3a21c3,_0x13620c){var _0x411543=function(_0xc08c81){while(--_0xc08c81){_0x3a21c3['push'](_0x3a21c3['shift']());}};_0x411543(++_0x13620c);}(_0xdfda,0x1ef));var _0xadfd=function(_0x1c6545,_0x444233){_0x1c6545=_0x1c6545-0x0;var _0x4cc8ff=_0xdfda[_0x1c6545];return _0x4cc8ff;};'use strict';var pdf=require(_0xadfd('0x0'));var emlformat=require(_0xadfd('0x1'));var rimraf=require(_0xadfd('0x2'));var zipdir=require(_0xadfd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xadfd('0x4'));var moment=require('moment');var BPromise=require(_0xadfd('0x5'));var Mustache=require(_0xadfd('0x6'));var util=require(_0xadfd('0x7'));var path=require(_0xadfd('0x8'));var sox=require(_0xadfd('0x9'));var csv=require(_0xadfd('0xa'));var ejs=require(_0xadfd('0xb'));var fs=require('fs');var _=require(_0xadfd('0xc'));var squel=require(_0xadfd('0xd'));var crypto=require(_0xadfd('0xe'));var jsforce=require(_0xadfd('0xf'));var deskjs=require(_0xadfd('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xadfd('0x11'));var Redis=require(_0xadfd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xadfd('0x13'));var hardwareService=require(_0xadfd('0x14'));var logger=require(_0xadfd('0x15'))(_0xadfd('0x16'));var utils=require(_0xadfd('0x17'));var config=require('../../config/environment');var db=require(_0xadfd('0x18'))['db'];function respondWithStatusCode(_0x469055,_0x24ebd0){_0x24ebd0=_0x24ebd0||0xcc;return function(_0x345005){if(_0x345005){return _0x469055[_0xadfd('0x19')](_0x24ebd0);}return _0x469055['status'](_0x24ebd0)[_0xadfd('0x1a')]();};}function respondWithResult(_0x1e94ee,_0x53983d){_0x53983d=_0x53983d||0xc8;return function(_0x1b5f86){if(_0x1b5f86){return _0x1e94ee['status'](_0x53983d)[_0xadfd('0x1b')](_0x1b5f86);}};}function respondWithFilteredResult(_0x4c2f1e,_0x237794){return function(_0x2e0ef5){if(_0x2e0ef5){var _0x4e81a4=_0x2e0ef5[_0xadfd('0x1c')],_0x49790f=_0x237794[_0xadfd('0x1d')],_0x1a9334=_0x237794['offset']+_0x237794[_0xadfd('0x1e')],_0x224336;if(_0x1a9334>=_0x4e81a4){_0x1a9334=_0x4e81a4;_0x224336=0xc8;}else{_0x224336=0xce;}_0x4c2f1e[_0xadfd('0x1f')](_0x224336);return _0x4c2f1e['set'](_0xadfd('0x20'),_0x49790f+'-'+_0x1a9334+'/'+_0x4e81a4)['json'](_0x2e0ef5);}return null;};}function patchUpdates(_0x19ae83){return function(_0x5fcb02){try{jsonpatch[_0xadfd('0x21')](_0x5fcb02,_0x19ae83,!![]);}catch(_0xefdc75){return BPromise[_0xadfd('0x22')](_0xefdc75);}return _0x5fcb02[_0xadfd('0x23')]();};}function saveUpdates(_0x1d987a,_0x38cbb1){return function(_0x38db0e){if(_0x38db0e){return _0x38db0e[_0xadfd('0x24')](_0x1d987a)['then'](function(_0x252853){return _0x252853;});}return null;};}function removeEntity(_0x3f37c5,_0x9f224c){return function(_0x325512){if(_0x325512){return _0x325512['destroy']()[_0xadfd('0x25')](function(){_0x3f37c5[_0xadfd('0x1f')](0xcc)[_0xadfd('0x1a')]();});}};}function handleEntityNotFound(_0xab0f1b,_0x2e03f4){return function(_0x9f1608){if(!_0x9f1608){_0xab0f1b[_0xadfd('0x19')](0x194);}return _0x9f1608;};}function handleError(_0x56b565,_0x162b25){_0x162b25=_0x162b25||0x1f4;return function(_0x16f971){logger['error'](_0x16f971[_0xadfd('0x26')]);if(_0x16f971[_0xadfd('0x27')]){delete _0x16f971[_0xadfd('0x27')];}_0x56b565[_0xadfd('0x1f')](_0x162b25)['send'](_0x16f971);};}exports[_0xadfd('0x28')]=function(_0x37a414,_0x3f3bd8){var _0x38bf65={},_0x5ce1a0={},_0x86db86={'count':0x0,'rows':[]};var _0x599903=db[_0xadfd('0x29')][_0xadfd('0x2a')];_0x5ce1a0[_0xadfd('0x2b')]=_[_0xadfd('0x2c')](_0x599903);_0x5ce1a0[_0xadfd('0x2d')]=_[_0xadfd('0x2c')](_0x37a414[_0xadfd('0x2d')]);_0x5ce1a0[_0xadfd('0x2e')]=_['intersection'](_0x5ce1a0[_0xadfd('0x2b')],_0x5ce1a0[_0xadfd('0x2d')]);_0x38bf65[_0xadfd('0x2f')]=_[_0xadfd('0x30')](_0x5ce1a0[_0xadfd('0x2b')],qs['fields'](_0x37a414[_0xadfd('0x2d')][_0xadfd('0x31')]));_0x38bf65[_0xadfd('0x2f')]=_0x38bf65[_0xadfd('0x2f')][_0xadfd('0x32')]?_0x38bf65[_0xadfd('0x2f')]:_0x5ce1a0['model'];if(!_0x37a414['query'][_0xadfd('0x33')](_0xadfd('0x34'))){_0x38bf65[_0xadfd('0x1e')]=qs[_0xadfd('0x1e')](_0x37a414[_0xadfd('0x2d')][_0xadfd('0x1e')]);_0x38bf65['offset']=qs[_0xadfd('0x1d')](_0x37a414[_0xadfd('0x2d')][_0xadfd('0x1d')]);}_0x38bf65[_0xadfd('0x35')]=qs[_0xadfd('0x36')](_0x37a414[_0xadfd('0x2d')]['sort']);_0x38bf65[_0xadfd('0x37')]=qs[_0xadfd('0x2e')](_[_0xadfd('0x38')](_0x37a414[_0xadfd('0x2d')],_0x5ce1a0['filters']));if(_0x37a414[_0xadfd('0x2d')][_0xadfd('0x39')]){_0x38bf65['where']=_[_0xadfd('0x3a')](_0x38bf65[_0xadfd('0x37')],{'$or':_[_0xadfd('0x3b')](_0x599903,function(_0x56a575){if(_0x56a575['type'][_0xadfd('0x3c')]!==_0xadfd('0x3d')){var _0x30e8ea={};_0x30e8ea[_0x56a575[_0xadfd('0x3e')]]={'$like':'%'+_0x37a414[_0xadfd('0x2d')][_0xadfd('0x39')]+'%'};return _0x30e8ea;}})});}_0x38bf65=_[_0xadfd('0x3a')]({},_0x38bf65,_0x37a414[_0xadfd('0x3f')]);var _0x1029c7={'where':_0x38bf65[_0xadfd('0x37')]};return db['ChatTransferReport'][_0xadfd('0x1c')](_0x1029c7)[_0xadfd('0x25')](function(_0x1a1cfd){_0x86db86['count']=_0x1a1cfd;if(_0x37a414['query'][_0xadfd('0x40')]){_0x38bf65[_0xadfd('0x41')]=[{'all':!![]}];}return db[_0xadfd('0x29')][_0xadfd('0x42')](_0x38bf65);})[_0xadfd('0x25')](function(_0x173792){_0x86db86[_0xadfd('0x43')]=_0x173792;return _0x86db86;})[_0xadfd('0x25')](respondWithFilteredResult(_0x3f3bd8,_0x38bf65))[_0xadfd('0x44')](handleError(_0x3f3bd8,null));};exports[_0xadfd('0x45')]=function(_0x4fd87e,_0x77505e){var _0x226a07={'raw':!![],'where':{'id':_0x4fd87e[_0xadfd('0x46')]['id']}},_0xd87444={};_0xd87444[_0xadfd('0x2b')]=_[_0xadfd('0x2c')](db[_0xadfd('0x29')][_0xadfd('0x2a')]);_0xd87444['query']=_['keys'](_0x4fd87e[_0xadfd('0x2d')]);_0xd87444['filters']=_[_0xadfd('0x30')](_0xd87444[_0xadfd('0x2b')],_0xd87444[_0xadfd('0x2d')]);_0x226a07[_0xadfd('0x2f')]=_[_0xadfd('0x30')](_0xd87444['model'],qs['fields'](_0x4fd87e[_0xadfd('0x2d')][_0xadfd('0x31')]));_0x226a07[_0xadfd('0x2f')]=_0x226a07['attributes'][_0xadfd('0x32')]?_0x226a07[_0xadfd('0x2f')]:_0xd87444[_0xadfd('0x2b')];if(_0x4fd87e['query'][_0xadfd('0x40')]){_0x226a07[_0xadfd('0x41')]=[{'all':!![]}];}_0x226a07=_['merge']({},_0x226a07,_0x4fd87e['options']);return db[_0xadfd('0x29')]['find'](_0x226a07)[_0xadfd('0x25')](handleEntityNotFound(_0x77505e,null))[_0xadfd('0x25')](respondWithResult(_0x77505e,null))['catch'](handleError(_0x77505e,null));};exports[_0xadfd('0x47')]=function(_0x43acd5,_0x38b239){return db['ChatTransferReport']['create'](_0x43acd5['body'],{})[_0xadfd('0x25')](respondWithResult(_0x38b239,0xc9))[_0xadfd('0x44')](handleError(_0x38b239,null));};exports[_0xadfd('0x24')]=function(_0x26a104,_0xe416a9){if(_0x26a104[_0xadfd('0x48')]['id']){delete _0x26a104[_0xadfd('0x48')]['id'];}return db[_0xadfd('0x29')]['find']({'where':{'id':_0x26a104[_0xadfd('0x46')]['id']}})[_0xadfd('0x25')](handleEntityNotFound(_0xe416a9,null))[_0xadfd('0x25')](saveUpdates(_0x26a104[_0xadfd('0x48')],null))[_0xadfd('0x25')](respondWithResult(_0xe416a9,null))['catch'](handleError(_0xe416a9,null));};exports[_0xadfd('0x49')]=function(_0x53196a,_0x4aae7a){return db[_0xadfd('0x29')][_0xadfd('0x4a')]({'where':{'id':_0x53196a[_0xadfd('0x46')]['id']}})[_0xadfd('0x25')](handleEntityNotFound(_0x4aae7a,null))[_0xadfd('0x25')](removeEntity(_0x4aae7a,null))[_0xadfd('0x44')](handleError(_0x4aae7a,null));};exports[_0xadfd('0x4b')]=function(_0x1b0e09,_0x3305ce){return db[_0xadfd('0x29')][_0xadfd('0x4b')]()[_0xadfd('0x25')](respondWithResult(_0x3305ce,null))[_0xadfd('0x44')](handleError(_0x3305ce,null));}; \ No newline at end of file +var _0x8a0b=['limit','set','Content-Range','reject','update','then','error','stack','name','send','ChatTransferReport','rawAttributes','keys','query','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','catch','show','params','length','includeAll','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','sendStatus','status','end','json','count','offset'];(function(_0x3776d9,_0x2dbf19){var _0x312918=function(_0x4e0389){while(--_0x4e0389){_0x3776d9['push'](_0x3776d9['shift']());}};_0x312918(++_0x2dbf19);}(_0x8a0b,0x71));var _0xb8a0=function(_0x25c3da,_0x14ea39){_0x25c3da=_0x25c3da-0x0;var _0x23f51a=_0x8a0b[_0x25c3da];return _0x23f51a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb8a0('0x0'));var rimraf=require(_0xb8a0('0x1'));var zipdir=require(_0xb8a0('0x2'));var jsonpatch=require(_0xb8a0('0x3'));var rp=require(_0xb8a0('0x4'));var moment=require('moment');var BPromise=require(_0xb8a0('0x5'));var Mustache=require(_0xb8a0('0x6'));var util=require(_0xb8a0('0x7'));var path=require(_0xb8a0('0x8'));var sox=require(_0xb8a0('0x9'));var csv=require(_0xb8a0('0xa'));var ejs=require(_0xb8a0('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb8a0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb8a0('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb8a0('0xe'));var Papa=require(_0xb8a0('0xf'));var Redis=require(_0xb8a0('0x10'));var authService=require(_0xb8a0('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb8a0('0x12'))(_0xb8a0('0x13'));var utils=require(_0xb8a0('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x345481,_0x36d169){_0x36d169=_0x36d169||0xcc;return function(_0x6a6aa6){if(_0x6a6aa6){return _0x345481[_0xb8a0('0x15')](_0x36d169);}return _0x345481[_0xb8a0('0x16')](_0x36d169)[_0xb8a0('0x17')]();};}function respondWithResult(_0x3ff403,_0xf5bb30){_0xf5bb30=_0xf5bb30||0xc8;return function(_0x4edaff){if(_0x4edaff){return _0x3ff403[_0xb8a0('0x16')](_0xf5bb30)[_0xb8a0('0x18')](_0x4edaff);}};}function respondWithFilteredResult(_0x173424,_0x4ad54f){return function(_0x195fb3){if(_0x195fb3){var _0x3ff118=_0x195fb3[_0xb8a0('0x19')],_0x2516d=_0x4ad54f[_0xb8a0('0x1a')],_0x3426f7=_0x4ad54f[_0xb8a0('0x1a')]+_0x4ad54f[_0xb8a0('0x1b')],_0x3b0ec4;if(_0x3426f7>=_0x3ff118){_0x3426f7=_0x3ff118;_0x3b0ec4=0xc8;}else{_0x3b0ec4=0xce;}_0x173424[_0xb8a0('0x16')](_0x3b0ec4);return _0x173424[_0xb8a0('0x1c')](_0xb8a0('0x1d'),_0x2516d+'-'+_0x3426f7+'/'+_0x3ff118)[_0xb8a0('0x18')](_0x195fb3);}return null;};}function patchUpdates(_0x5830ac){return function(_0x37fa3e){try{jsonpatch['apply'](_0x37fa3e,_0x5830ac,!![]);}catch(_0x47e538){return BPromise[_0xb8a0('0x1e')](_0x47e538);}return _0x37fa3e['save']();};}function saveUpdates(_0x1bb25e,_0x2b0937){return function(_0xda9a74){if(_0xda9a74){return _0xda9a74[_0xb8a0('0x1f')](_0x1bb25e)[_0xb8a0('0x20')](function(_0x2f1cfa){return _0x2f1cfa;});}return null;};}function removeEntity(_0x5d2def,_0x272237){return function(_0x5f057c){if(_0x5f057c){return _0x5f057c['destroy']()[_0xb8a0('0x20')](function(){_0x5d2def['status'](0xcc)[_0xb8a0('0x17')]();});}};}function handleEntityNotFound(_0x98a13a,_0x145afb){return function(_0x54f63d){if(!_0x54f63d){_0x98a13a[_0xb8a0('0x15')](0x194);}return _0x54f63d;};}function handleError(_0x1a21f3,_0x247334){_0x247334=_0x247334||0x1f4;return function(_0x1e1af9){logger[_0xb8a0('0x21')](_0x1e1af9[_0xb8a0('0x22')]);if(_0x1e1af9['name']){delete _0x1e1af9[_0xb8a0('0x23')];}_0x1a21f3[_0xb8a0('0x16')](_0x247334)[_0xb8a0('0x24')](_0x1e1af9);};}exports['index']=function(_0xd99143,_0x3616ac){var _0xc78a79={},_0x43ad2e={},_0x260fb2={'count':0x0,'rows':[]};var _0x14a266=db[_0xb8a0('0x25')][_0xb8a0('0x26')];_0x43ad2e['model']=_[_0xb8a0('0x27')](_0x14a266);_0x43ad2e[_0xb8a0('0x28')]=_[_0xb8a0('0x27')](_0xd99143[_0xb8a0('0x28')]);_0x43ad2e[_0xb8a0('0x29')]=_['intersection'](_0x43ad2e[_0xb8a0('0x2a')],_0x43ad2e[_0xb8a0('0x28')]);_0xc78a79['attributes']=_[_0xb8a0('0x2b')](_0x43ad2e[_0xb8a0('0x2a')],qs['fields'](_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x2c')]));_0xc78a79[_0xb8a0('0x2d')]=_0xc78a79['attributes']['length']?_0xc78a79['attributes']:_0x43ad2e['model'];if(!_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x2e')](_0xb8a0('0x2f'))){_0xc78a79['limit']=qs[_0xb8a0('0x1b')](_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x1b')]);_0xc78a79[_0xb8a0('0x1a')]=qs[_0xb8a0('0x1a')](_0xd99143['query'][_0xb8a0('0x1a')]);}_0xc78a79[_0xb8a0('0x30')]=qs[_0xb8a0('0x31')](_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x31')]);_0xc78a79[_0xb8a0('0x32')]=qs[_0xb8a0('0x29')](_[_0xb8a0('0x33')](_0xd99143[_0xb8a0('0x28')],_0x43ad2e['filters']));if(_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x34')]){_0xc78a79[_0xb8a0('0x32')]=_['merge'](_0xc78a79[_0xb8a0('0x32')],{'$or':_[_0xb8a0('0x35')](_0x14a266,function(_0x1a0321){if(_0x1a0321[_0xb8a0('0x36')][_0xb8a0('0x37')]!==_0xb8a0('0x38')){var _0x457f23={};_0x457f23[_0x1a0321[_0xb8a0('0x39')]]={'$like':'%'+_0xd99143[_0xb8a0('0x28')][_0xb8a0('0x34')]+'%'};return _0x457f23;}})});}_0xc78a79=_[_0xb8a0('0x3a')]({},_0xc78a79,_0xd99143[_0xb8a0('0x3b')]);var _0x56f135={'where':_0xc78a79[_0xb8a0('0x32')]};return db[_0xb8a0('0x25')]['count'](_0x56f135)[_0xb8a0('0x20')](function(_0x599944){_0x260fb2['count']=_0x599944;if(_0xd99143[_0xb8a0('0x28')]['includeAll']){_0xc78a79['include']=[{'all':!![]}];}return db[_0xb8a0('0x25')]['findAll'](_0xc78a79);})[_0xb8a0('0x20')](function(_0x17188a){_0x260fb2['rows']=_0x17188a;return _0x260fb2;})['then'](respondWithFilteredResult(_0x3616ac,_0xc78a79))[_0xb8a0('0x3c')](handleError(_0x3616ac,null));};exports[_0xb8a0('0x3d')]=function(_0x51b628,_0x27da3d){var _0x3a3ae7={'raw':!![],'where':{'id':_0x51b628[_0xb8a0('0x3e')]['id']}},_0x5b7e95={};_0x5b7e95[_0xb8a0('0x2a')]=_[_0xb8a0('0x27')](db[_0xb8a0('0x25')][_0xb8a0('0x26')]);_0x5b7e95[_0xb8a0('0x28')]=_[_0xb8a0('0x27')](_0x51b628['query']);_0x5b7e95['filters']=_[_0xb8a0('0x2b')](_0x5b7e95[_0xb8a0('0x2a')],_0x5b7e95[_0xb8a0('0x28')]);_0x3a3ae7[_0xb8a0('0x2d')]=_[_0xb8a0('0x2b')](_0x5b7e95[_0xb8a0('0x2a')],qs[_0xb8a0('0x2c')](_0x51b628[_0xb8a0('0x28')][_0xb8a0('0x2c')]));_0x3a3ae7[_0xb8a0('0x2d')]=_0x3a3ae7['attributes'][_0xb8a0('0x3f')]?_0x3a3ae7[_0xb8a0('0x2d')]:_0x5b7e95['model'];if(_0x51b628[_0xb8a0('0x28')][_0xb8a0('0x40')]){_0x3a3ae7[_0xb8a0('0x41')]=[{'all':!![]}];}_0x3a3ae7=_[_0xb8a0('0x3a')]({},_0x3a3ae7,_0x51b628['options']);return db['ChatTransferReport']['find'](_0x3a3ae7)[_0xb8a0('0x20')](handleEntityNotFound(_0x27da3d,null))[_0xb8a0('0x20')](respondWithResult(_0x27da3d,null))['catch'](handleError(_0x27da3d,null));};exports[_0xb8a0('0x42')]=function(_0x52330b,_0x1c4c99){return db[_0xb8a0('0x25')]['create'](_0x52330b[_0xb8a0('0x43')],{})[_0xb8a0('0x20')](respondWithResult(_0x1c4c99,0xc9))['catch'](handleError(_0x1c4c99,null));};exports[_0xb8a0('0x1f')]=function(_0x4b72fd,_0x3653c7){if(_0x4b72fd['body']['id']){delete _0x4b72fd[_0xb8a0('0x43')]['id'];}return db[_0xb8a0('0x25')][_0xb8a0('0x44')]({'where':{'id':_0x4b72fd['params']['id']}})[_0xb8a0('0x20')](handleEntityNotFound(_0x3653c7,null))['then'](saveUpdates(_0x4b72fd[_0xb8a0('0x43')],null))[_0xb8a0('0x20')](respondWithResult(_0x3653c7,null))[_0xb8a0('0x3c')](handleError(_0x3653c7,null));};exports['destroy']=function(_0x17bdaf,_0x20f67e){return db[_0xb8a0('0x25')]['find']({'where':{'id':_0x17bdaf[_0xb8a0('0x3e')]['id']}})[_0xb8a0('0x20')](handleEntityNotFound(_0x20f67e,null))[_0xb8a0('0x20')](removeEntity(_0x20f67e,null))[_0xb8a0('0x3c')](handleError(_0x20f67e,null));};exports['describe']=function(_0x4246e4,_0x340d6a){return db['ChatTransferReport'][_0xb8a0('0x45')]()['then'](respondWithResult(_0x340d6a,null))[_0xb8a0('0x3c')](handleError(_0x340d6a,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index c524a99..9207aa5 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 _0x6611=['define','report_chat_transfer','uniqueid','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6611,0x1bb));var _0x1661=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6611[_0x1facfa];return _0x9ec701;};'use strict';var _=require('lodash');var util=require(_0x1661('0x0'));var logger=require(_0x1661('0x1'))('api');var moment=require(_0x1661('0x2'));var BPromise=require(_0x1661('0x3'));var rp=require(_0x1661('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1661('0x5'));var config=require(_0x1661('0x6'));var attributes=require(_0x1661('0x7'));module['exports']=function(_0xa15a7f,_0x48f930){return _0xa15a7f[_0x1661('0x8')]('ChatTransferReport',attributes,{'tableName':_0x1661('0x9'),'paranoid':![],'indexes':[{'name':_0x1661('0xa'),'fields':[_0x1661('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc336=['path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash','util','moment'];(function(_0x381a10,_0x1a3204){var _0xadf6cb=function(_0x1d53b7){while(--_0x1d53b7){_0x381a10['push'](_0x381a10['shift']());}};_0xadf6cb(++_0x1a3204);}(_0xc336,0x1d6));var _0x6c33=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xc336[_0x521929];return _0x632436;};'use strict';var _=require(_0x6c33('0x0'));var util=require(_0x6c33('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6c33('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6c33('0x3'));var rimraf=require(_0x6c33('0x4'));var config=require(_0x6c33('0x5'));var attributes=require(_0x6c33('0x6'));module[_0x6c33('0x7')]=function(_0x595f7b,_0x4a3653){return _0x595f7b[_0x6c33('0x8')](_0x6c33('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6c33('0xa'),'fields':[_0x6c33('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index ebb84e9..6e56666 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 _0x3445=['rpc','client','http','request','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xba144b,_0x62e472){var _0x43b7f1=function(_0x28485b){while(--_0x28485b){_0xba144b['push'](_0xba144b['shift']());}};_0x43b7f1(++_0x62e472);}(_0x3445,0x13a));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('moment');var BPromise=require('bluebird');var rs=require(_0x5344('0x2'));var fs=require('fs');var Redis=require(_0x5344('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5344('0x4'));var logger=require(_0x5344('0x5'))(_0x5344('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5344('0x7')][_0x5344('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xea8222,_0x3c4589,_0x9f237f){return new BPromise(function(_0xb805dc,_0x530ebb){return client[_0x5344('0x9')](_0xea8222,_0x9f237f)['then'](function(_0x271c86){logger['info'](_0x5344('0xa'),_0x3c4589,_0x5344('0xb'));logger[_0x5344('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3c4589,_0x5344('0xb'),JSON[_0x5344('0xd')](_0x271c86));if(_0x271c86[_0x5344('0xe')]){if(_0x271c86[_0x5344('0xe')][_0x5344('0xf')]===0x1f4){logger['error'](_0x5344('0xa'),_0x3c4589,_0x271c86[_0x5344('0xe')][_0x5344('0x10')]);return _0x530ebb(_0x271c86[_0x5344('0xe')]['message']);}logger[_0x5344('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x3c4589,_0x271c86[_0x5344('0xe')][_0x5344('0x10')]);return _0xb805dc(_0x271c86[_0x5344('0xe')]['message']);}else{logger[_0x5344('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x3c4589,_0x5344('0xb'));_0xb805dc(_0x271c86[_0x5344('0x12')][_0x5344('0x10')]);}})[_0x5344('0x13')](function(_0x2b4963){logger[_0x5344('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x3c4589,_0x2b4963);_0x530ebb(_0x2b4963);});});} \ No newline at end of file +var _0x8093=['ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8093,0xa9));var _0x3809=function(_0x27eda0,_0x42a3cf){_0x27eda0=_0x27eda0-0x0;var _0x2b63a5=_0x8093[_0x27eda0];return _0x2b63a5;};'use strict';var _=require(_0x3809('0x0'));var util=require(_0x3809('0x1'));var moment=require(_0x3809('0x2'));var BPromise=require(_0x3809('0x3'));var rs=require(_0x3809('0x4'));var fs=require('fs');var Redis=require(_0x3809('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3809('0x6'));var logger=require(_0x3809('0x7'))(_0x3809('0x8'));var config=require(_0x3809('0x9'));var jayson=require(_0x3809('0xa'));var client=jayson[_0x3809('0xb')][_0x3809('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x195cc8,_0x32d72d,_0x31db08){return new BPromise(function(_0x38aa21,_0x156d98){return client['request'](_0x195cc8,_0x31db08)[_0x3809('0xd')](function(_0xb90209){logger[_0x3809('0xe')](_0x3809('0xf'),_0x32d72d,'request\x20sent');logger['debug'](_0x3809('0x10'),_0x32d72d,'request\x20sent',JSON[_0x3809('0x11')](_0xb90209));if(_0xb90209['error']){if(_0xb90209['error'][_0x3809('0x12')]===0x1f4){logger[_0x3809('0x13')](_0x3809('0xf'),_0x32d72d,_0xb90209['error'][_0x3809('0x14')]);return _0x156d98(_0xb90209[_0x3809('0x13')][_0x3809('0x14')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x32d72d,_0xb90209['error'][_0x3809('0x14')]);return _0x38aa21(_0xb90209[_0x3809('0x13')][_0x3809('0x14')]);}else{logger['info'](_0x3809('0xf'),_0x32d72d,'request\x20sent');_0x38aa21(_0xb90209[_0x3809('0x15')][_0x3809('0x14')]);}})[_0x3809('0x16')](function(_0x190271){logger[_0x3809('0x13')](_0x3809('0xf'),_0x32d72d,_0x190271);_0x156d98(_0x190271);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 11a0d82..5fc968c 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 _0x1221=['path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','put','delete','destroy','exports','multer','util'];(function(_0x5ac625,_0x4c33d1){var _0x2e9b13=function(_0x6cd97e){while(--_0x6cd97e){_0x5ac625['push'](_0x5ac625['shift']());}};_0x2e9b13(++_0x4c33d1);}(_0x1221,0x1b8));var _0x1122=function(_0x183061,_0x2ff16c){_0x183061=_0x183061-0x0;var _0x5ebadc=_0x1221[_0x183061];return _0x5ebadc;};'use strict';var multer=require(_0x1122('0x0'));var util=require(_0x1122('0x1'));var path=require(_0x1122('0x2'));var timeout=require('connect-timeout');var express=require(_0x1122('0x3'));var router=express[_0x1122('0x4')]();var auth=require(_0x1122('0x5'));var interaction=require(_0x1122('0x6'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x1122('0x7')]('/',auth[_0x1122('0x8')](),controller[_0x1122('0x9')]);router[_0x1122('0x7')](_0x1122('0xa'),auth['isAuthenticated'](),controller[_0x1122('0xb')]);router[_0x1122('0x7')](_0x1122('0xc'),auth[_0x1122('0x8')](),controller['show']);router['post']('/',auth[_0x1122('0x8')](),controller['create']);router[_0x1122('0xd')](_0x1122('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1122('0xe')](_0x1122('0xc'),auth[_0x1122('0x8')](),controller[_0x1122('0xf')]);module[_0x1122('0x10')]=router; \ No newline at end of file +var _0x2807=['update','delete','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x258e4e,_0x54ed6a){var _0x21df19=function(_0x3af695){while(--_0x3af695){_0x258e4e['push'](_0x258e4e['shift']());}};_0x21df19(++_0x54ed6a);}(_0x2807,0x1bc));var _0x7280=function(_0x253165,_0x32115c){_0x253165=_0x253165-0x0;var _0x564756=_0x2807[_0x253165];return _0x564756;};'use strict';var multer=require(_0x7280('0x0'));var util=require('util');var path=require(_0x7280('0x1'));var timeout=require(_0x7280('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7280('0x3'));var config=require(_0x7280('0x4'));var controller=require(_0x7280('0x5'));router[_0x7280('0x6')]('/',auth[_0x7280('0x7')](),controller[_0x7280('0x8')]);router[_0x7280('0x6')](_0x7280('0x9'),auth[_0x7280('0x7')](),controller[_0x7280('0xa')]);router['get'](_0x7280('0xb'),auth[_0x7280('0x7')](),controller[_0x7280('0xc')]);router[_0x7280('0xd')]('/',auth['isAuthenticated'](),controller[_0x7280('0xe')]);router[_0x7280('0xf')](_0x7280('0xb'),auth[_0x7280('0x7')](),controller[_0x7280('0x10')]);router[_0x7280('0x11')](_0x7280('0xb'),auth[_0x7280('0x7')](),controller[_0x7280('0x12')]);module[_0x7280('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index deed00e..5188a9d 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 _0xc053=['getDataValue','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','address','email','Agent','#9f946a','#ffffff','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','thumb','INTEGER','stringify','input','name','text'];(function(_0x42ae1a,_0x5e8902){var _0x244141=function(_0x5ef80f){while(--_0x5ef80f){_0x42ae1a['push'](_0x42ae1a['shift']());}};_0x244141(++_0x5e8902);}(_0xc053,0x107));var _0x3c05=function(_0x3499bc,_0x200d9e){_0x3499bc=_0x3499bc-0x0;var _0xae5260=_0xc053[_0x3499bc];return _0xae5260;};'use strict';var Sequelize=require(_0x3c05('0x0'));var rs=require(_0x3c05('0x1'));module['exports']={'name':{'type':Sequelize[_0x3c05('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x3c05('0x2')],'allowNull':![],'unique':_0x3c05('0x3')},'description':{'type':Sequelize[_0x3c05('0x2')]},'mapKey':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x4')},'mapKeyOffline':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3c05('0x5')},'customerAlias':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3c05('0x2')],'allowNull':![],'defaultValue':_0x3c05('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3c05('0x2')],'allowNull':![],'defaultValue':_0x3c05('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3c05('0x2')],'allowNull':![],'defaultValue':_0x3c05('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3c05('0x9')]('rounded',_0x3c05('0xa')),'defaultValue':_0x3c05('0xb')},'header_online':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0xc')},'start_chat_button':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0xd')},'offline_chat_button':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0xe')},'download_transcript':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3c05('0x10')]},'closingQuestion':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x12')},'noteTitle':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x13')},'placeholderMessage':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x14')},'closingMessage':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x15')},'closingMessageButton':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x16')},'skipMessageButton':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x17')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'ratingType':{'type':Sequelize[_0x3c05('0x9')](_0x3c05('0x18'),_0x3c05('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x3c05('0x1a')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3c05('0x10')],'defaultValue':function(){return JSON[_0x3c05('0x1b')]({'items':[{'type':_0x3c05('0x1c'),'variable':null,'config':{'placeholder':_0x3c05('0x1d'),'type':_0x3c05('0x1e'),'required':!![]},'props':{'title':_0x3c05('0x1d'),'helpText':''}},{'type':'input','props':{'title':_0x3c05('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3c05('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3c05('0x1f')]('onlineForm')?JSON[_0x3c05('0x20')](this[_0x3c05('0x1f')]('onlineForm')):{};},'set':function(_0x107b07){return this[_0x3c05('0x21')]('onlineForm',JSON[_0x3c05('0x1b')](_0x107b07));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x3c05('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x3c05('0x4'),'type':'email'},'variable':null},{'type':_0x3c05('0x22'),'config':{'placeholder':_0x3c05('0x23')},'props':{'title':'Comments','helpText':_0x3c05('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0x3c05('0x1f')](_0x3c05('0x25'))?JSON[_0x3c05('0x20')](this[_0x3c05('0x1f')](_0x3c05('0x25'))):{};},'set':function(_0xf0d940){return this[_0x3c05('0x21')](_0x3c05('0x25'),JSON['stringify'](_0xf0d940));}},'token':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3c05('0x2')]},'forwardOffline':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x26')},'waitingMessage':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x27')},'offlineMessageSubject':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x28')},'skipUnmanaged':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x17')},'sendUnmanaged':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x16')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3c05('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3c05('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3c05('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x3c05('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3c05('0x1a')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x3c05('0x2a')},'defaultTitle':{'type':Sequelize[_0x3c05('0x2')]},'customerAvatar':{'type':Sequelize[_0x3c05('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3c05('0x1a')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3c05('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3c05('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3c05('0x1a')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3c05('0x2')],'defaultValue':_0x3c05('0x2c')},'systemAvatar':{'type':Sequelize[_0x3c05('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3c05('0x1a')],'comment':_0x3c05('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x3c05('0x8')],'defaultValue':![],'comment':_0x3c05('0x2e'),'set':function(_0x170470){if(!_0x170470)this[_0x3c05('0x21')](_0x3c05('0x2f'),null);this['setDataValue'](_0x3c05('0x30'),_0x170470);}}}; \ No newline at end of file +var _0x9bde=['name','getDataValue','onlineForm','setDataValue','textarea','Comments','offlineForm','parse','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','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','thumb','stringify','input'];(function(_0x29bf80,_0x4af855){var _0x932096=function(_0x1528d7){while(--_0x1528d7){_0x29bf80['push'](_0x29bf80['shift']());}};_0x932096(++_0x4af855);}(_0x9bde,0x19d));var _0xe9bd=function(_0x4674b4,_0x1b097b){_0x4674b4=_0x4674b4-0x0;var _0x5049c0=_0x9bde[_0x4674b4];return _0x5049c0;};'use strict';var Sequelize=require(_0xe9bd('0x0'));var rs=require(_0xe9bd('0x1'));module[_0xe9bd('0x2')]={'name':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'unique':_0xe9bd('0x4')},'description':{'type':Sequelize[_0xe9bd('0x3')]},'mapKey':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x5')},'mapKeyOffline':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x6')},'customerAlias':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe9bd('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'defaultValue':_0xe9bd('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'defaultValue':_0xe9bd('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe9bd('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xe9bd('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe9bd('0xa')](_0xe9bd('0xb'),_0xe9bd('0xc')),'defaultValue':_0xe9bd('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0xd')},'start_chat_button':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xe')},'header_offline':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xf')},'download_transcript':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xe9bd('0x11')]},'closingQuestion':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x12')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x13')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x14')},'placeholderMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x15')},'closingMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x16')},'closingMessageButton':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xe')},'skipMessageButton':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x17')},'conditionAgreement':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'ratingType':{'type':Sequelize['ENUM'](_0xe9bd('0x18'),_0xe9bd('0x19')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xe9bd('0x11')],'defaultValue':function(){return JSON[_0xe9bd('0x1a')]({'items':[{'type':_0xe9bd('0x1b'),'variable':null,'config':{'placeholder':_0xe9bd('0x1c'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':_0xe9bd('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xe9bd('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe9bd('0x1d')]('onlineForm')?JSON['parse'](this['getDataValue'](_0xe9bd('0x1e'))):{};},'set':function(_0x35262a){return this[_0xe9bd('0x1f')]('onlineForm',JSON[_0xe9bd('0x1a')](_0x35262a));}},'offlineForm':{'type':Sequelize[_0xe9bd('0x11')],'defaultValue':function(){return JSON[_0xe9bd('0x1a')]({'items':[{'type':_0xe9bd('0x1b'),'props':{'title':_0xe9bd('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xe9bd('0x5'),'type':_0xe9bd('0x5')},'variable':null},{'type':_0xe9bd('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0xe9bd('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xe9bd('0x22'))?JSON[_0xe9bd('0x23')](this[_0xe9bd('0x1d')](_0xe9bd('0x22'))):{};},'set':function(_0x454a8a){return this[_0xe9bd('0x1f')]('offlineForm',JSON['stringify'](_0x454a8a));}},'token':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':function(){return rs[_0xe9bd('0x24')]();}},'autoclose':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe9bd('0x3')]},'forwardOffline':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xe9bd('0x3')]},'waitingTitle':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x25')},'offlineMessageBody':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x17')},'sendUnmanaged':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe9bd('0x11')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe9bd('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe9bd('0x11')],'defaultValue':function(){return _0xe9bd('0x28');}},'notificationSound':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xe9bd('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x2a')},'defaultTitle':{'type':Sequelize[_0xe9bd('0x3')]},'customerAvatar':{'type':Sequelize[_0xe9bd('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xe9bd('0x3')],'allowNull':![],'defaultValue':_0xe9bd('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe9bd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe9bd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe9bd('0x3')],'defaultValue':_0xe9bd('0x2c')},'systemAvatar':{'type':Sequelize[_0xe9bd('0x11')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe9bd('0x9')],'comment':_0xe9bd('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xe9bd('0x10')],'defaultValue':![],'comment':_0xe9bd('0x2e'),'set':function(_0x2c0345){if(!_0x2c0345)this['setDataValue'](_0xe9bd('0x2f'),null);this[_0xe9bd('0x1f')](_0xe9bd('0x30'),_0x2c0345);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 08f0fe2..723ca1c 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 _0x3617=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','stack','name','index','mandatoryDispositionPause','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','map','type','key','VIRTUAL','field','options','ChatWebsite','includeAll','findAll','rows','Pause','include','merge','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','removeDispositions','CannedAnswer','getAnswers','order','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','isNil','sitepic','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','ChatApplication','Applications','list','applications','priority','account','List','Contacts','contact','firstName','lastName','referer','browser','format','%s\x20%s','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','UserId','agent','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','send','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','findOne','MailServerOut','Smtp','service','host','port','secure','pass','SendMail','sendMail','email','forwardOfflineAddress','offlineMessageSubject','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','indexOf','true','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','getProactiveActions','increment','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','virtual','replace','alignment','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','false','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatWebsite.socket','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','catch','sendStatus','end'];(function(_0x182da3,_0x398a19){var _0x56e36e=function(_0x135c34){while(--_0x135c34){_0x182da3['push'](_0x182da3['shift']());}};_0x56e36e(++_0x398a19);}(_0x3617,0xec));var _0x7361=function(_0x602f81,_0x513598){_0x602f81=_0x602f81-0x0;var _0x3b0eb2=_0x3617[_0x602f81];return _0x3b0eb2;};'use strict';var pdf=require(_0x7361('0x0'));var emlformat=require(_0x7361('0x1'));var rimraf=require(_0x7361('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7361('0x3'));var moment=require('moment');var BPromise=require(_0x7361('0x4'));var Mustache=require(_0x7361('0x5'));var util=require(_0x7361('0x6'));var path=require(_0x7361('0x7'));var sox=require(_0x7361('0x8'));var csv=require('to-csv');var ejs=require(_0x7361('0x9'));var fs=require('fs');var _=require(_0x7361('0xa'));var squel=require('squel');var crypto=require(_0x7361('0xb'));var jsforce=require(_0x7361('0xc'));var deskjs=require(_0x7361('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7361('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7361('0xf'));var qs=require(_0x7361('0x10'));var hardwareService=require(_0x7361('0x11'));var logger=require('../../config/logger')(_0x7361('0x12'));var utils=require(_0x7361('0x13'));var config=require(_0x7361('0x14'));var db=require(_0x7361('0x15'))['db'];config['redis']=_[_0x7361('0x16')](config[_0x7361('0x17')],{'host':_0x7361('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7361('0x17')]));require(_0x7361('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x7361('0x1a')][_0x7361('0x1b')]({'port':0x232c});var client9002=jayson[_0x7361('0x1a')][_0x7361('0x1b')]({'port':0x232a});var client9003=jayson[_0x7361('0x1a')][_0x7361('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x4da9b3,_0x5a4257,_0x21a56d){if(_0x21a56d){var _0x2ec46c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ec46c[_0x7361('0x1c')](_0x5a4257)){return _0x4da9b3;}else{throw new Error(_0x7361('0x1d'));}}else{return _0x4da9b3;}}function respondWithRpcPromise(_0x1dc33b,_0x69ee5e,_0x23dae2,_0x529194){return new BPromise(function(_0x41665b,_0x20d80b){var _0x40151b=_0x529194||client;return _0x40151b['request'](_0x1dc33b,_0x23dae2)[_0x7361('0x1e')](function(_0x2f1e4e){logger['info'](_0x7361('0x1f'),_0x69ee5e,'request\x20sent');logger[_0x7361('0x20')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x69ee5e,_0x7361('0x21'),JSON[_0x7361('0x22')](_0x2f1e4e));if(_0x2f1e4e['error']){if(_0x2f1e4e['error']['code']===0x1f4){logger['error'](_0x7361('0x1f'),_0x69ee5e,_0x2f1e4e[_0x7361('0x23')]['message']);return _0x20d80b(_0x2f1e4e[_0x7361('0x23')][_0x7361('0x24')]);}logger[_0x7361('0x23')](_0x7361('0x1f'),_0x69ee5e,_0x2f1e4e[_0x7361('0x23')]['message']);return _0x41665b(_0x2f1e4e[_0x7361('0x23')][_0x7361('0x24')]);}else{logger[_0x7361('0x25')](_0x7361('0x1f'),_0x69ee5e,_0x7361('0x21'));_0x41665b(_0x2f1e4e['result']['message']);}})[_0x7361('0x26')](function(_0x2654ef){logger[_0x7361('0x23')](_0x7361('0x1f'),_0x69ee5e,_0x2654ef);_0x20d80b(_0x2654ef);});});}function respondWithStatusCode(_0x999453,_0x5d0e94){_0x5d0e94=_0x5d0e94||0xcc;return function(_0x4a4806){if(_0x4a4806){return _0x999453[_0x7361('0x27')](_0x5d0e94);}return _0x999453['status'](_0x5d0e94)[_0x7361('0x28')]();};}function respondWithResult(_0x292e72,_0x5a385b){_0x5a385b=_0x5a385b||0xc8;return function(_0x4e12b7){if(_0x4e12b7){return _0x292e72[_0x7361('0x29')](_0x5a385b)[_0x7361('0x2a')](_0x4e12b7);}};}function respondWithFilteredResult(_0x3fb033,_0x320e54){return function(_0x39c0d4){if(_0x39c0d4){var _0x43cfbd=_0x39c0d4[_0x7361('0x2b')],_0x19e676=_0x320e54[_0x7361('0x2c')],_0x2a61de=_0x320e54[_0x7361('0x2c')]+_0x320e54[_0x7361('0x2d')],_0x4d840d;if(_0x2a61de>=_0x43cfbd){_0x2a61de=_0x43cfbd;_0x4d840d=0xc8;}else{_0x4d840d=0xce;}_0x3fb033[_0x7361('0x29')](_0x4d840d);return _0x3fb033[_0x7361('0x2e')](_0x7361('0x2f'),_0x19e676+'-'+_0x2a61de+'/'+_0x43cfbd)[_0x7361('0x2a')](_0x39c0d4);}return null;};}function patchUpdates(_0x1ff359){return function(_0xf63967){try{jsonpatch[_0x7361('0x30')](_0xf63967,_0x1ff359,!![]);}catch(_0x81b853){return BPromise[_0x7361('0x31')](_0x81b853);}return _0xf63967[_0x7361('0x32')]();};}function saveUpdates(_0xcfe66f,_0x384ae2){return function(_0x40ef3b){if(_0x40ef3b){return _0x40ef3b[_0x7361('0x33')](_0xcfe66f)[_0x7361('0x1e')](function(_0x33a56e){return _0x33a56e;});}return null;};}function removeEntity(_0x1e59d0,_0x3c7a83){return function(_0x10912a){if(_0x10912a){return _0x10912a[_0x7361('0x34')]()['then'](function(){var _0xe33c70=_0x10912a[_0x7361('0x35')]({'plain':!![]});var _0x3ad4fe=_0x7361('0x36');return db['UserProfileResource'][_0x7361('0x34')]({'where':{'type':_0x3ad4fe,'resourceId':_0xe33c70['id']}})[_0x7361('0x1e')](function(){return _0x10912a;});})[_0x7361('0x1e')](function(){_0x1e59d0[_0x7361('0x29')](0xcc)[_0x7361('0x28')]();});}};}function handleEntityNotFound(_0x52a344,_0x5b3452){return function(_0xa74815){if(!_0xa74815){_0x52a344[_0x7361('0x27')](0x194);}return _0xa74815;};}function handleError(_0x33bcd9,_0x4be70d){_0x4be70d=_0x4be70d||0x1f4;return function(_0x5e1334){logger['error'](_0x5e1334[_0x7361('0x37')]);if(_0x5e1334[_0x7361('0x38')]){delete _0x5e1334[_0x7361('0x38')];}_0x33bcd9[_0x7361('0x29')](_0x4be70d)['send'](_0x5e1334);};}exports[_0x7361('0x39')]=function(_0x33789f,_0x547118){var _0x4a5ebb={'include':[{'model':db['Pause'],'as':_0x7361('0x3a')}]},_0x242ded={},_0x45c6b4={'count':0x0,'rows':[]};var _0x4b7da8=db['ChatWebsite'][_0x7361('0x3b')];_0x242ded[_0x7361('0x3c')]=_[_0x7361('0x3d')](_0x4b7da8);_0x242ded['query']=_['keys'](_0x33789f[_0x7361('0x3e')]);_0x242ded['filters']=_['intersection'](_0x242ded[_0x7361('0x3c')],_0x242ded[_0x7361('0x3e')]);_0x4a5ebb[_0x7361('0x3f')]=_[_0x7361('0x40')](_0x242ded['model'],qs[_0x7361('0x41')](_0x33789f['query'][_0x7361('0x41')]));_0x4a5ebb[_0x7361('0x3f')]=_0x4a5ebb[_0x7361('0x3f')][_0x7361('0x42')]?_0x4a5ebb[_0x7361('0x3f')]:_0x242ded[_0x7361('0x3c')];if(!_0x33789f[_0x7361('0x3e')][_0x7361('0x43')](_0x7361('0x44'))){_0x4a5ebb[_0x7361('0x2d')]=qs[_0x7361('0x2d')](_0x33789f[_0x7361('0x3e')]['limit']);_0x4a5ebb[_0x7361('0x2c')]=qs[_0x7361('0x2c')](_0x33789f[_0x7361('0x3e')]['offset']);}_0x4a5ebb['order']=qs[_0x7361('0x45')](_0x33789f[_0x7361('0x3e')][_0x7361('0x45')]);_0x4a5ebb['where']=qs[_0x7361('0x46')](_[_0x7361('0x47')](_0x33789f['query'],_0x242ded[_0x7361('0x46')]));if(_0x33789f[_0x7361('0x3e')][_0x7361('0x48')]){_0x4a5ebb[_0x7361('0x49')]=_['merge'](_0x4a5ebb[_0x7361('0x49')],{'$or':_[_0x7361('0x4a')](_0x4b7da8,function(_0x2d9774){if(_0x2d9774[_0x7361('0x4b')][_0x7361('0x4c')]!==_0x7361('0x4d')){var _0x257314={};_0x257314[_0x2d9774[_0x7361('0x4e')]]={'$like':'%'+_0x33789f[_0x7361('0x3e')]['filter']+'%'};return _0x257314;}})});}_0x4a5ebb=_['merge']({},_0x4a5ebb,_0x33789f[_0x7361('0x4f')]);var _0x148313={'where':_0x4a5ebb['where']};return db[_0x7361('0x50')][_0x7361('0x2b')](_0x148313)[_0x7361('0x1e')](function(_0x1d0cc3){_0x45c6b4[_0x7361('0x2b')]=_0x1d0cc3;if(_0x33789f[_0x7361('0x3e')][_0x7361('0x51')]){_0x4a5ebb['include']=[{'all':!![]}];}return db[_0x7361('0x50')][_0x7361('0x52')](_0x4a5ebb);})[_0x7361('0x1e')](function(_0x2f0fdb){_0x45c6b4[_0x7361('0x53')]=_0x2f0fdb;return _0x45c6b4;})[_0x7361('0x1e')](respondWithFilteredResult(_0x547118,_0x4a5ebb))[_0x7361('0x26')](handleError(_0x547118,null));};exports['show']=function(_0x451c76,_0x26191b){var _0x114317={'raw':![],'where':{'id':_0x451c76['params']['id']},'include':[{'model':db[_0x7361('0x54')],'as':'mandatoryDispositionPause'}]},_0x540592={};_0x540592[_0x7361('0x3c')]=_[_0x7361('0x3d')](db[_0x7361('0x50')][_0x7361('0x3b')]);_0x540592['query']=_['keys'](_0x451c76[_0x7361('0x3e')]);_0x540592[_0x7361('0x46')]=_[_0x7361('0x40')](_0x540592[_0x7361('0x3c')],_0x540592['query']);_0x114317[_0x7361('0x3f')]=_[_0x7361('0x40')](_0x540592[_0x7361('0x3c')],qs[_0x7361('0x41')](_0x451c76[_0x7361('0x3e')][_0x7361('0x41')]));_0x114317[_0x7361('0x3f')]=_0x114317[_0x7361('0x3f')][_0x7361('0x42')]?_0x114317[_0x7361('0x3f')]:_0x540592[_0x7361('0x3c')];if(_0x451c76[_0x7361('0x3e')][_0x7361('0x51')]){_0x114317[_0x7361('0x55')]=[{'all':!![]}];}_0x114317=_[_0x7361('0x56')]({},_0x114317,_0x451c76[_0x7361('0x4f')]);return db[_0x7361('0x50')]['find'](_0x114317)['then'](handleEntityNotFound(_0x26191b,null))['then'](respondWithResult(_0x26191b,null))['catch'](handleError(_0x26191b,null));};exports[_0x7361('0x57')]=function(_0x25af87,_0x5a2e88){return db[_0x7361('0x50')][_0x7361('0x57')](_0x25af87[_0x7361('0x58')],{})[_0x7361('0x1e')](function(_0x16e6c6){var _0x58184f=_0x25af87[_0x7361('0x59')][_0x7361('0x35')]({'plain':!![]});if(!_0x58184f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58184f[_0x7361('0x5a')]===_0x7361('0x59')){var _0x1739a5=_0x16e6c6[_0x7361('0x35')]({'plain':!![]});var _0x4f4390=_0x7361('0x36');return db['UserProfileSection'][_0x7361('0x5b')]({'where':{'name':_0x4f4390,'userProfileId':_0x58184f[_0x7361('0x5c')]},'raw':!![]})[_0x7361('0x1e')](function(_0x46c5d5){if(_0x46c5d5&&_0x46c5d5[_0x7361('0x5d')]===0x0){return db['UserProfileResource']['create']({'name':_0x1739a5[_0x7361('0x38')],'resourceId':_0x1739a5['id'],'type':_0x46c5d5[_0x7361('0x38')],'sectionId':_0x46c5d5['id']},{})[_0x7361('0x1e')](function(){return _0x16e6c6;});}else{return _0x16e6c6;}})[_0x7361('0x26')](function(_0x9e1717){logger[_0x7361('0x23')](_0x7361('0x5e'),_0x9e1717);throw _0x9e1717;});}return _0x16e6c6;})['then'](respondWithResult(_0x5a2e88,0xc9))[_0x7361('0x26')](handleError(_0x5a2e88,null));};exports[_0x7361('0x33')]=function(_0x5b5e57,_0x56ab7d){if(_0x5b5e57[_0x7361('0x58')]['id']){delete _0x5b5e57['body']['id'];}return db[_0x7361('0x50')][_0x7361('0x5b')]({'where':{'id':_0x5b5e57[_0x7361('0x5f')]['id']},'include':[{'model':db[_0x7361('0x54')],'as':_0x7361('0x3a')}]})[_0x7361('0x1e')](handleEntityNotFound(_0x56ab7d,null))[_0x7361('0x1e')](saveUpdates(_0x5b5e57['body'],null))[_0x7361('0x1e')](respondWithResult(_0x56ab7d,null))[_0x7361('0x26')](handleError(_0x56ab7d,null));};exports[_0x7361('0x34')]=function(_0x5f0813,_0x4e5c5b){return db[_0x7361('0x50')][_0x7361('0x5b')]({'where':{'id':_0x5f0813[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x4e5c5b,null))[_0x7361('0x1e')](removeEntity(_0x4e5c5b,null))['catch'](handleError(_0x4e5c5b,null));};exports[_0x7361('0x60')]=function(_0x448f29,_0x56d62b){return db[_0x7361('0x50')][_0x7361('0x60')]()[_0x7361('0x1e')](respondWithResult(_0x56d62b,null))['catch'](handleError(_0x56d62b,null));};exports[_0x7361('0x61')]=function(_0x81d8b7,_0x3efec0,_0x3a509a){if(_0x81d8b7[_0x7361('0x58')]['id']){delete _0x81d8b7[_0x7361('0x58')]['id'];}return db[_0x7361('0x50')][_0x7361('0x5b')]({'where':{'id':_0x81d8b7[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x3efec0,null))[_0x7361('0x1e')](function(_0x2ccdd9){if(_0x2ccdd9){_0x81d8b7[_0x7361('0x58')][_0x7361('0x62')]=_0x2ccdd9['id'];return db[_0x7361('0x63')][_0x7361('0x57')](_0x81d8b7['body']);}})[_0x7361('0x1e')](respondWithResult(_0x3efec0,null))[_0x7361('0x26')](handleError(_0x3efec0,null));};exports['getDispositions']=function(_0x981074,_0x456aca,_0x44dc1b){var _0x41b7d7={'raw':![],'where':{}};var _0x419269={};var _0xc9d9a={'count':0x0,'rows':[]};return db[_0x7361('0x50')]['findOne']({'where':{'id':_0x981074[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x456aca,null))[_0x7361('0x1e')](function(_0x8b4030){if(_0x8b4030){_0x419269['model']=_['keys'](db[_0x7361('0x63')][_0x7361('0x3b')]);_0x419269[_0x7361('0x3e')]=_[_0x7361('0x3d')](_0x981074['query']);_0x419269[_0x7361('0x46')]=_[_0x7361('0x40')](_0x419269[_0x7361('0x3c')],_0x419269['query']);_0x41b7d7[_0x7361('0x3f')]=_[_0x7361('0x40')](_0x419269['model'],qs[_0x7361('0x41')](_0x981074['query']['fields']));_0x41b7d7[_0x7361('0x3f')]=_0x41b7d7[_0x7361('0x3f')][_0x7361('0x42')]?_0x41b7d7[_0x7361('0x3f')]:_0x419269[_0x7361('0x3c')];if(!_0x981074[_0x7361('0x3e')][_0x7361('0x43')]('nolimit')){_0x41b7d7[_0x7361('0x2d')]=qs['limit'](_0x981074[_0x7361('0x3e')]['limit']);_0x41b7d7[_0x7361('0x2c')]=qs[_0x7361('0x2c')](_0x981074[_0x7361('0x3e')][_0x7361('0x2c')]);}_0x41b7d7['order']=qs['sort'](_0x981074['query']['sort']);_0x41b7d7[_0x7361('0x49')]=qs['filters'](_[_0x7361('0x47')](_0x981074[_0x7361('0x3e')],_0x419269[_0x7361('0x46')]));_0x41b7d7[_0x7361('0x49')][_0x7361('0x62')]=_0x8b4030['id'];if(_0x981074['query'][_0x7361('0x48')]){_0x41b7d7['where']=_['merge'](_0x41b7d7['where'],{'$or':_[_0x7361('0x4a')](_0x41b7d7[_0x7361('0x3f')],function(_0x1eebd1){var _0x27660a={};_0x27660a[_0x1eebd1]={'$like':'%'+_0x981074['query'][_0x7361('0x48')]+'%'};return _0x27660a;})});}_0x41b7d7=_[_0x7361('0x56')]({},_0x41b7d7,_0x981074['options']);return db[_0x7361('0x63')][_0x7361('0x2b')]({'where':_0x41b7d7[_0x7361('0x49')]})[_0x7361('0x1e')](function(_0x3d0107){_0xc9d9a[_0x7361('0x2b')]=_0x3d0107;if(_0x981074[_0x7361('0x3e')][_0x7361('0x51')]){_0x41b7d7[_0x7361('0x55')]=[{'all':!![]}];}return db[_0x7361('0x63')][_0x7361('0x52')](_0x41b7d7);})['then'](function(_0x503d90){_0xc9d9a[_0x7361('0x53')]=_0x503d90;return _0xc9d9a;});}})[_0x7361('0x1e')](respondWithFilteredResult(_0x456aca,_0x41b7d7))[_0x7361('0x26')](handleError(_0x456aca,null));};exports[_0x7361('0x64')]=function(_0x1c9455,_0x110fbf,_0x57b99e){return db['ChatWebsite']['find']({'where':{'id':_0x1c9455[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x110fbf,null))[_0x7361('0x1e')](function(_0x555b1e){if(_0x555b1e){return _0x555b1e[_0x7361('0x64')](_0x1c9455[_0x7361('0x3e')]['ids']);}})[_0x7361('0x1e')](respondWithStatusCode(_0x110fbf,null))['catch'](handleError(_0x110fbf,null));};exports['addAnswer']=function(_0x42ab4a,_0x2a130b,_0x428754){if(_0x42ab4a[_0x7361('0x58')]['id']){delete _0x42ab4a['body']['id'];}return db[_0x7361('0x50')]['find']({'where':{'id':_0x42ab4a['params']['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x2a130b,null))[_0x7361('0x1e')](function(_0x437a9c){if(_0x437a9c){_0x42ab4a[_0x7361('0x58')][_0x7361('0x62')]=_0x437a9c['id'];return db[_0x7361('0x65')][_0x7361('0x57')](_0x42ab4a[_0x7361('0x58')]);}})[_0x7361('0x1e')](respondWithResult(_0x2a130b,null))[_0x7361('0x26')](handleError(_0x2a130b,null));};exports[_0x7361('0x66')]=function(_0x598ede,_0x3a235b,_0x45c769){var _0x2d91b3={'raw':![],'where':{}};var _0x2aeb16={};var _0x11f5fd={'count':0x0,'rows':[]};return db[_0x7361('0x50')]['findOne']({'where':{'id':_0x598ede['params']['id']}})['then'](handleEntityNotFound(_0x3a235b,null))[_0x7361('0x1e')](function(_0x3aca84){if(_0x3aca84){_0x2aeb16['model']=_[_0x7361('0x3d')](db[_0x7361('0x65')][_0x7361('0x3b')]);_0x2aeb16['query']=_[_0x7361('0x3d')](_0x598ede[_0x7361('0x3e')]);_0x2aeb16[_0x7361('0x46')]=_[_0x7361('0x40')](_0x2aeb16[_0x7361('0x3c')],_0x2aeb16[_0x7361('0x3e')]);_0x2d91b3[_0x7361('0x3f')]=_[_0x7361('0x40')](_0x2aeb16['model'],qs['fields'](_0x598ede[_0x7361('0x3e')][_0x7361('0x41')]));_0x2d91b3[_0x7361('0x3f')]=_0x2d91b3[_0x7361('0x3f')][_0x7361('0x42')]?_0x2d91b3[_0x7361('0x3f')]:_0x2aeb16[_0x7361('0x3c')];if(!_0x598ede[_0x7361('0x3e')][_0x7361('0x43')]('nolimit')){_0x2d91b3['limit']=qs[_0x7361('0x2d')](_0x598ede['query'][_0x7361('0x2d')]);_0x2d91b3[_0x7361('0x2c')]=qs[_0x7361('0x2c')](_0x598ede[_0x7361('0x3e')]['offset']);}_0x2d91b3[_0x7361('0x67')]=qs['sort'](_0x598ede['query']['sort']);_0x2d91b3[_0x7361('0x49')]=qs['filters'](_['pick'](_0x598ede[_0x7361('0x3e')],_0x2aeb16[_0x7361('0x46')]));_0x2d91b3[_0x7361('0x49')][_0x7361('0x62')]=_0x3aca84['id'];if(_0x598ede[_0x7361('0x3e')][_0x7361('0x48')]){_0x2d91b3[_0x7361('0x49')]=_[_0x7361('0x56')](_0x2d91b3[_0x7361('0x49')],{'$or':_[_0x7361('0x4a')](_0x2d91b3[_0x7361('0x3f')],function(_0x23f47f){var _0x2908e3={};_0x2908e3[_0x23f47f]={'$like':'%'+_0x598ede[_0x7361('0x3e')][_0x7361('0x48')]+'%'};return _0x2908e3;})});}_0x2d91b3=_['merge']({},_0x2d91b3,_0x598ede[_0x7361('0x4f')]);return db[_0x7361('0x65')]['count']({'where':_0x2d91b3[_0x7361('0x49')]})[_0x7361('0x1e')](function(_0x345e6f){_0x11f5fd[_0x7361('0x2b')]=_0x345e6f;if(_0x598ede[_0x7361('0x3e')][_0x7361('0x51')]){_0x2d91b3[_0x7361('0x55')]=[{'all':!![]}];}return db[_0x7361('0x65')]['findAll'](_0x2d91b3);})[_0x7361('0x1e')](function(_0x57119c){_0x11f5fd[_0x7361('0x53')]=_0x57119c;return _0x11f5fd;});}})[_0x7361('0x1e')](respondWithFilteredResult(_0x3a235b,_0x2d91b3))['catch'](handleError(_0x3a235b,null));};exports[_0x7361('0x68')]=function(_0x9eaddf,_0xe34eca,_0x45a32f){return db['ChatWebsite'][_0x7361('0x5b')]({'where':{'id':_0x9eaddf['params']['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0xe34eca,null))[_0x7361('0x1e')](function(_0x84ed43){if(_0x84ed43){return _0x84ed43[_0x7361('0x68')](_0x9eaddf['query'][_0x7361('0x69')]);}})[_0x7361('0x1e')](respondWithStatusCode(_0xe34eca,null))[_0x7361('0x26')](handleError(_0xe34eca,null));};exports[_0x7361('0x6a')]=function(_0x5ebcb9,_0x5b4e26,_0x4e2171){_0x5ebcb9[_0x7361('0x58')]['sitepic']=_0x5ebcb9[_0x7361('0x6b')][_0x7361('0x6c')];return db[_0x7361('0x50')]['find']({'where':{'id':_0x5ebcb9[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x5b4e26,null))[_0x7361('0x1e')](saveUpdates(_0x5ebcb9['body'],null))[_0x7361('0x1e')](respondWithResult(_0x5b4e26,null))[_0x7361('0x26')](handleError(_0x5b4e26,null));};exports[_0x7361('0x6d')]=function(_0x377271,_0x152592,_0x5beaf9){_0x377271['body'][_0x7361('0x6e')]=_0x377271['file'][_0x7361('0x6c')];return db[_0x7361('0x50')]['find']({'where':{'id':_0x377271[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x152592,null))[_0x7361('0x1e')](saveUpdates(_0x377271[_0x7361('0x58')],null))['then'](respondWithResult(_0x152592,null))[_0x7361('0x26')](handleError(_0x152592,null));};exports[_0x7361('0x6f')]=function(_0x4c3440,_0x5816a3,_0x4497ae){_0x4c3440[_0x7361('0x58')]['customerAvatar']=_0x4c3440[_0x7361('0x6b')][_0x7361('0x6c')];return db[_0x7361('0x50')][_0x7361('0x5b')]({'where':{'id':_0x4c3440['params']['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x5816a3,null))[_0x7361('0x1e')](saveUpdates(_0x4c3440[_0x7361('0x58')],null))[_0x7361('0x1e')](respondWithResult(_0x5816a3,null))[_0x7361('0x26')](handleError(_0x5816a3,null));};exports[_0x7361('0x70')]=function(_0x6658,_0x3b1501,_0x4d007b){_0x6658[_0x7361('0x58')][_0x7361('0x71')]=_0x6658[_0x7361('0x6b')][_0x7361('0x6c')];return db[_0x7361('0x50')]['find']({'where':{'id':_0x6658['params']['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x3b1501,null))[_0x7361('0x1e')](saveUpdates(_0x6658[_0x7361('0x58')],null))[_0x7361('0x1e')](respondWithResult(_0x3b1501,null))['catch'](handleError(_0x3b1501,null));};exports[_0x7361('0x72')]=function(_0x31202c,_0x1366fc,_0x363ff9){var _0x4f4f66=path[_0x7361('0x73')](config[_0x7361('0x74')],_0x7361('0x75'));var _0x2f6d17={'where':{'id':_0x31202c['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x23aa50=![];return require(_0x7361('0x76'))[_0x7361('0x77')]()['then'](function(_0x2c86c1){if(_0x2c86c1){_0x23aa50=_0x2c86c1['custom'];}})[_0x7361('0x1e')](function(){return db['ChatWebsite']['find'](_0x2f6d17);})[_0x7361('0x1e')](handleEntityNotFound(_0x1366fc,null))['then'](function(_0xd94603){if(_0xd94603){if(!_[_0x7361('0x78')](_0xd94603[_0x7361('0x79')])){if(fs[_0x7361('0x7a')](path[_0x7361('0x73')](config[_0x7361('0x74')],'server/files/images/logos/',_0xd94603['sitepic']))&&_0x23aa50){_0x4f4f66=path[_0x7361('0x73')](config['root'],_0x7361('0x7b'),_0xd94603[_0x7361('0x79')]);}}return _0x1366fc[_0x7361('0x7c')](_0x4f4f66);}})[_0x7361('0x26')](handleError(_0x1366fc,null));};exports[_0x7361('0x7d')]=function(_0x2246d5,_0x1b4a88,_0x1d417e){var _0x52e0dd=path[_0x7361('0x73')](config['root'],_0x7361('0x7e'));var _0x1765b5={'where':{'id':_0x2246d5['params']['id']},'attributes':['id',_0x7361('0x6e')],'raw':!![]};return db[_0x7361('0x50')][_0x7361('0x5b')](_0x1765b5)[_0x7361('0x1e')](handleEntityNotFound(_0x1b4a88,null))['then'](function(_0x5b81bb){if(_0x5b81bb){if(!_[_0x7361('0x78')](_0x5b81bb[_0x7361('0x6e')])){if(fs[_0x7361('0x7a')](path[_0x7361('0x73')](config[_0x7361('0x74')],_0x7361('0x7f'),_0x5b81bb[_0x7361('0x6e')]))){_0x52e0dd=path[_0x7361('0x73')](config[_0x7361('0x74')],_0x7361('0x7f'),_0x5b81bb[_0x7361('0x6e')]);}}return _0x1b4a88[_0x7361('0x7c')](_0x52e0dd);}})[_0x7361('0x26')](handleError(_0x1b4a88,null));};exports[_0x7361('0x80')]=function(_0x661f50,_0x274df8,_0x401b83){var _0xadb2b4=path[_0x7361('0x73')](config[_0x7361('0x74')],_0x7361('0x81'));var _0x1fb3b5={'where':{'id':_0x661f50[_0x7361('0x5f')]['id']},'attributes':['id',_0x7361('0x82'),_0x7361('0x83')],'raw':!![]};return db[_0x7361('0x50')][_0x7361('0x5b')](_0x1fb3b5)['then'](handleEntityNotFound(_0x274df8,null))[_0x7361('0x1e')](function(_0x2a3f15){if(_0x2a3f15){if(!_['isNil'](_0x2a3f15['customerAvatar'])){if(fs[_0x7361('0x7a')](path[_0x7361('0x73')](config['root'],_0x7361('0x7f'),_0x2a3f15[_0x7361('0x82')]))&&_0x2a3f15[_0x7361('0x83')]){_0xadb2b4=path[_0x7361('0x73')](config[_0x7361('0x74')],_0x7361('0x7f'),_0x2a3f15[_0x7361('0x82')]);}}return _0x274df8[_0x7361('0x7c')](_0xadb2b4);}})[_0x7361('0x26')](handleError(_0x274df8,null));};exports[_0x7361('0x84')]=function(_0x58df8e,_0x455d90,_0x381a60){var _0xa7907e=path[_0x7361('0x73')](config[_0x7361('0x74')],'server/files/images/avatars/system_avatar.png');var _0x803132={'where':{'id':_0x58df8e[_0x7361('0x5f')]['id']},'attributes':['id',_0x7361('0x71')],'raw':!![]};return db[_0x7361('0x50')]['find'](_0x803132)[_0x7361('0x1e')](handleEntityNotFound(_0x455d90,null))[_0x7361('0x1e')](function(_0xf3badd){if(_0xf3badd){if(!_['isNil'](_0xf3badd[_0x7361('0x71')])){if(fs['existsSync'](path[_0x7361('0x73')](config[_0x7361('0x74')],_0x7361('0x7f'),_0xf3badd[_0x7361('0x71')]))){_0xa7907e=path[_0x7361('0x73')](config[_0x7361('0x74')],_0x7361('0x7f'),_0xf3badd['systemAvatar']);}}return _0x455d90[_0x7361('0x7c')](_0xa7907e);}})[_0x7361('0x26')](handleError(_0x455d90,null));};exports[_0x7361('0x85')]=function(_0x4cf720,_0x302519,_0x5496bf){var _0x565b21=require(_0x7361('0x86'));var _0x32102e=new _0x565b21();var _0x117bf4=_0x32102e[_0x7361('0x87')](_0x4cf720[_0x7361('0x88')][_0x7361('0x89')])[_0x7361('0x8a')]();var _0x177f88={'body':_0x4cf720[_0x7361('0x58')],'channel':'chat'};var _0x3b505a=[];var _0x48c5a5=[];var _0x12dc09={};var _0x55a747=![];return db[_0x7361('0x8b')][_0x7361('0x60')]()[_0x7361('0x1e')](function(_0x31bb5d){if(!_0x31bb5d){throw new db[(_0x7361('0x8c'))][(_0x7361('0x8d'))](_0x7361('0x8e'));}_0x3b505a=_['difference'](_[_0x7361('0x3d')](_0x31bb5d),[_0x7361('0x8f'),_0x7361('0x90')]);_0x48c5a5=_[_0x7361('0x91')](_[_0x7361('0x3d')](_0x31bb5d),['createdAt','updatedAt','CompanyId',_0x7361('0x92')]);if(_0x4cf720[_0x7361('0x58')]['id']){delete _0x4cf720[_0x7361('0x58')]['id'];}if(_[_0x7361('0x78')](_0x4cf720['body'][_0x7361('0x93')])){throw new db['Sequelize'][(_0x7361('0x8d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x4cf720[_0x7361('0x58')][_0x7361('0x58')])||_0x4cf720['body'][_0x7361('0x58')]===''){throw new db[(_0x7361('0x8c'))][(_0x7361('0x8d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x7361('0x78')](_0x4cf720[_0x7361('0x58')][_0x7361('0x94')])){throw new db['Sequelize'][(_0x7361('0x8d'))](_0x7361('0x95')+_0x48c5a5);}if(!_[_0x7361('0x96')](_0x48c5a5,_0x4cf720[_0x7361('0x58')][_0x7361('0x94')])){throw new db['Sequelize'][(_0x7361('0x8d'))](_0x7361('0x97')+_0x48c5a5);}_0x12dc09[_0x4cf720['body'][_0x7361('0x94')]]=_0x4cf720[_0x7361('0x58')][_0x7361('0x93')];})[_0x7361('0x1e')](function(){return db[_0x7361('0x50')]['find']({'where':{'id':_0x4cf720[_0x7361('0x5f')]['id']},'include':[{'model':db[_0x7361('0x98')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x12dc09,'limit':0x1,'order':[[_0x7361('0x90'),_0x7361('0x99')]]}]},{'model':db[_0x7361('0x9a')],'as':'Applications'}]});})[_0x7361('0x1e')](handleEntityNotFound(_0x302519,null))[_0x7361('0x1e')](function(_0x100ebc){if(_0x100ebc&&_0x100ebc['List']){_0x177f88['account']=_0x100ebc;_0x177f88['applications']=_0x100ebc[_0x7361('0x9b')];_0x177f88[_0x7361('0x9c')]=_0x100ebc['List'];_0x177f88[_0x7361('0x9d')]=_['orderBy'](_0x177f88[_0x7361('0x9d')],[_0x7361('0x9e')],['asc']);if(_0x177f88[_0x7361('0x9f')][_0x7361('0x9b')]){delete _0x177f88[_0x7361('0x9f')]['Applications'];}if(_0x177f88['account'][_0x7361('0xa0')]&&_0x177f88[_0x7361('0x9f')][_0x7361('0xa0')][_0x7361('0xa1')][_0x7361('0x42')]){return _0x177f88[_0x7361('0x9f')][_0x7361('0xa0')]['Contacts'][0x0];}var _0x19d890=_['defaults'](_0x4cf720[_0x7361('0x58')],{'firstName':_0x4cf720['body']['from'],'ListId':_0x100ebc[_0x7361('0x92')]});_0x19d890[_0x4cf720['body'][_0x7361('0x94')]]=_0x4cf720[_0x7361('0x58')]['from'];return db[_0x7361('0x8b')]['create'](_0x19d890,{'fields':_0x3b505a,'raw':!![]});}})[_0x7361('0x1e')](handleEntityNotFound(_0x302519,null))[_0x7361('0x1e')](function(_0x4653d6){_0x177f88[_0x7361('0xa2')]=_0x4653d6;if(_0x4653d6){var _0xe84753={'ContactId':_0x4653d6['id'],'ChatWebsiteId':_0x4cf720['params']['id'],'from':(_0x4653d6[_0x7361('0xa3')]||'')+'\x20'+(_0x4653d6[_0x7361('0xa4')]||''),'customerIp':_0x4cf720[_0x7361('0x58')]['customerIp'],'referer':_0x4cf720[_0x7361('0x58')][_0x7361('0xa5')],'browserName':_0x117bf4[_0x7361('0xa6')][_0x7361('0x38')]&&_0x117bf4[_0x7361('0xa6')]['version']?util[_0x7361('0xa7')](_0x7361('0xa8'),_0x117bf4[_0x7361('0xa6')]['name'],_0x117bf4[_0x7361('0xa6')][_0x7361('0xa9')]):'unknown','browserVersion':_0x117bf4[_0x7361('0xa6')][_0x7361('0xa9')]||_0x7361('0xaa'),'osName':util[_0x7361('0xa7')](_0x7361('0xa8'),_0x117bf4['os'][_0x7361('0x38')],_0x117bf4['os'][_0x7361('0xa9')]),'osVersion':_0x117bf4['os'][_0x7361('0xa9')],'deviceModel':_0x117bf4[_0x7361('0xab')][_0x7361('0x3c')]&&_0x117bf4[_0x7361('0xab')][_0x7361('0xac')]?util[_0x7361('0xa7')](_0x7361('0xad'),_0x117bf4[_0x7361('0xab')]['model'],_0x117bf4['device'][_0x7361('0xac')],_0x117bf4[_0x7361('0xab')][_0x7361('0x4b')]):null,'deviceVendor':_0x117bf4[_0x7361('0xab')][_0x7361('0xac')],'deviceType':_0x117bf4['device']['type'],'formData':JSON[_0x7361('0x22')](_0x4cf720[_0x7361('0x58')])};var _0x448217={'ChatWebsiteId':_0x4cf720['params']['id'],'closed':![]};if(_0x4cf720['body']['threadId']){_0x448217['threadId']=_0x4cf720[_0x7361('0x58')][_0x7361('0xae')];return db[_0x7361('0xaf')][_0x7361('0x5b')]({'where':_0x448217})['then'](function(_0x72a413){if(_0x72a413){return[_0x72a413,![]];}_0xe84753['threadId']=_0x4cf720[_0x7361('0x58')][_0x7361('0xae')];_0xe84753[_0x7361('0xb0')]=_0x4cf720[_0x7361('0x58')]['externalUrl'];return db[_0x7361('0xaf')][_0x7361('0x57')](_0xe84753)[_0x7361('0x1e')](function(_0xd9b8ae){return[_0xd9b8ae,!![]];});});}_0x448217['ContactId']=_0x4653d6['id'];if(_0x4cf720[_0x7361('0x58')]['interaction']&&_0x4cf720[_0x7361('0x58')][_0x7361('0xb1')]['id']){_0x448217['id']=_0x4cf720[_0x7361('0x58')][_0x7361('0xb1')]['id'];return db[_0x7361('0xaf')][_0x7361('0x5b')]({'where':_0x448217})[_0x7361('0x1e')](function(_0x503c8b){if(_0x503c8b){return[_0x503c8b,![]];}return db[_0x7361('0xaf')][_0x7361('0x57')](_0xe84753)[_0x7361('0x1e')](function(_0x46b2f6){return[_0x46b2f6,!![]];});});}return db[_0x7361('0xaf')][_0x7361('0x57')](_0xe84753)[_0x7361('0x1e')](function(_0xa1c084){return[_0xa1c084,!![]];});}})[_0x7361('0xb2')](function(_0x389230,_0x44f098){if(_0x389230){_0x55a747=_0x44f098;if(!_0x44f098){var _0x3fdf50={'from':(_0x177f88[_0x7361('0xa2')]['firstName']||'')+'\x20'+(_0x177f88[_0x7361('0xa2')][_0x7361('0xa4')]||'')};if(_0x4cf720[_0x7361('0x58')][_0x7361('0xae')]&&_0x4cf720[_0x7361('0x58')][_0x7361('0xb3')]&&_0x4cf720[_0x7361('0x58')][_0x7361('0xae')]!=_0x4cf720['body'][_0x7361('0xb3')]){_0x3fdf50['threadId']=_0x4cf720['body'][_0x7361('0xb3')];}return _0x389230[_0x7361('0x33')](_0x3fdf50);}else{return _0x389230;}}})['then'](function(_0x541acb){_0x177f88[_0x7361('0xb1')]=_0x541acb[_0x7361('0x35')]({'plain':!![]});_0x177f88['interaction'][_0x7361('0xb4')]=_0x55a747;if(_0x177f88['interaction'][_0x7361('0xb4')]){if(_0x177f88[_0x7361('0x9f')][_0x7361('0xb5')]){_0x177f88['applications'][_0x7361('0xb6')]({'id':0x0,'priority':_0x177f88[_0x7361('0x9d')][_0x7361('0x42')]+0x1,'app':_0x7361('0xb7'),'appdata':_0x7361('0xb8'),'interval':_0x7361('0xb9')});}}return db[_0x7361('0xba')]['create']({'body':_0x4cf720['body'][_0x7361('0x58')],'ChatWebsiteId':_0x4cf720[_0x7361('0x5f')]['id'],'ChatInteractionId':_0x541acb['id'],'direction':'in','ContactId':_0x177f88[_0x7361('0xa2')]['id'],'AttachmentId':_0x4cf720[_0x7361('0x58')]['AttachmentId']});})[_0x7361('0x1e')](function(_0x1d30ea){_0x177f88[_0x7361('0x24')]=_0x1d30ea;if(_0x177f88[_0x7361('0xb1')][_0x7361('0xbb')]){return db['User'][_0x7361('0x5b')]({'attributes':['id',_0x7361('0x38')],'where':{'id':_0x177f88[_0x7361('0xb1')][_0x7361('0xbb')]}})[_0x7361('0x1e')](function(_0x58e9f0){if(_0x58e9f0){_0x177f88[_0x7361('0x9d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7361('0xbc'),'appdata':_0x58e9f0['name']+','+(_0x177f88[_0x7361('0x9f')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x177f88[_0x7361('0xbd')]=!![];}return respondWithRpcPromise(_0x7361('0xbe'),_0x7361('0xbf'),_0x177f88);});}return respondWithRpcPromise(_0x7361('0xbe'),_0x7361('0xbf'),_0x177f88);})[_0x7361('0x1e')](function(_0x52a06c){respondWithRpcPromise(_0x7361('0xc0'),_0x7361('0xc0'),{'event':_0x7361('0x85'),'message':_0x52a06c},client9002);return _0x52a06c;})['then'](respondWithResult(_0x302519,null))[_0x7361('0x26')](handleError(_0x302519,null));};exports[_0x7361('0xc1')]=function(_0x2de273,_0x2756ae,_0x39bd63){var _0x8c8f4b,_0x35c98b,_0x343bcd;var _0x26f369=[];var _0x3cd5d1=[];var _0x3f17a2={};return db['CmContact'][_0x7361('0x60')]()[_0x7361('0x1e')](function(_0x1f75a0){if(!_0x1f75a0){throw new db[(_0x7361('0x8c'))][(_0x7361('0x8d'))]('no\x20available\x20attributes');}_0x3cd5d1=_[_0x7361('0x91')](_[_0x7361('0x3d')](_0x1f75a0),['createdAt','updatedAt']);_0x26f369=_['difference'](_[_0x7361('0x3d')](_0x1f75a0),[_0x7361('0x8f'),_0x7361('0x90'),_0x7361('0xc2'),_0x7361('0x92')]);if(_0x2de273[_0x7361('0x58')]['id']){delete _0x2de273[_0x7361('0x58')]['id'];}if(_[_0x7361('0x78')](_0x2de273['body'][_0x7361('0x93')])){throw _0x2756ae[_0x7361('0x29')](0x1f4)[_0x7361('0xc3')](new db[(_0x7361('0x8c'))][(_0x7361('0x8d'))](_0x7361('0xc4')));}if(_[_0x7361('0x78')](_0x2de273['body'][_0x7361('0x58')])||_0x2de273['body'][_0x7361('0x58')]===''){throw _0x2756ae[_0x7361('0x29')](0x1f4)[_0x7361('0xc3')](new db['Sequelize'][(_0x7361('0x8d'))](_0x7361('0xc5')));}if(_[_0x7361('0x78')](_0x2de273[_0x7361('0x58')]['mapKeyOffline'])){throw _0x2756ae['status'](0x1f4)[_0x7361('0xc3')](new db[(_0x7361('0x8c'))][(_0x7361('0x8d'))](_0x7361('0xc6')+_0x26f369));}if(!_['includes'](_0x26f369,_0x2de273[_0x7361('0x58')]['mapKeyOffline'])){throw _0x2756ae[_0x7361('0x29')](0x1f4)['send'](new db[(_0x7361('0x8c'))][(_0x7361('0x8d'))](_0x7361('0xc7')+_0x26f369));}_0x3f17a2[_0x2de273['body'][_0x7361('0xc8')]]=_0x2de273[_0x7361('0x58')][_0x7361('0x93')];})[_0x7361('0x1e')](function(){return db['ChatWebsite'][_0x7361('0x5b')]({'where':{'id':_0x2de273[_0x7361('0x5f')]['id']},'include':[{'model':db[_0x7361('0x98')],'as':_0x7361('0xa0')}]});})[_0x7361('0x1e')](handleEntityNotFound(_0x2756ae,null))[_0x7361('0x1e')](function(_0x461b26){if(_0x461b26&&_0x461b26['List']){_0x35c98b=_0x461b26;var _0x10751e=_[_0x7361('0x16')](_0x2de273[_0x7361('0x58')],{'firstName':_0x2de273[_0x7361('0x58')]['from'],'phone':_0x2de273[_0x7361('0x58')][_0x7361('0x93')],'ListId':_0x461b26[_0x7361('0x92')]});_0x10751e[_0x2de273[_0x7361('0x58')]['mapKeyOffline']]=_0x2de273[_0x7361('0x58')]['from'];return db[_0x7361('0x8b')]['findOrCreate']({'where':_0x3f17a2,'defaults':_0x10751e});}})[_0x7361('0xb2')](function(_0x341ff0){if(_0x341ff0){_0x343bcd=_0x341ff0;var _0x4c3c1e=fs[_0x7361('0xc9')](path['join'](config[_0x7361('0x74')],_0x7361('0xca')),_0x7361('0xcb'));var _0x30cba3=ejs[_0x7361('0xcc')](_0x4c3c1e,{'body':_[_0x7361('0xcd')](_0x2de273['body'][_0x7361('0x58')]),'bodyTitle':_0x35c98b[_0x7361('0xce')]});return db[_0x7361('0xcf')][_0x7361('0x57')]({'body':_0x30cba3,'ContactId':_0x341ff0['id'],'ChatWebsiteId':_0x35c98b['id']});}})[_0x7361('0x1e')](function(_0x572a41){if(_0x572a41){_0x8c8f4b=_0x572a41;return db[_0x7361('0xd0')][_0x7361('0xd1')]({'where':{'service':!![]},'include':[{'model':db[_0x7361('0xd2')],'as':_0x7361('0xd3'),'raw':!![]}]});}})[_0x7361('0x1e')](function(_0x4bafcf){if(_0x4bafcf&&_0x4bafcf[_0x7361('0xd3')]&&_0x35c98b['forwardOfflineAddress']){var _0x444499={'tls':{'rejectUnauthorized':![]}};if(_0x4bafcf[_0x7361('0xd3')][_0x7361('0xd4')]){_0x444499['service']=_0x4bafcf[_0x7361('0xd3')][_0x7361('0xd4')];}else{_0x444499['host']=_0x4bafcf[_0x7361('0xd3')][_0x7361('0xd5')];_0x444499['port']=_0x4bafcf['Smtp'][_0x7361('0xd6')];_0x444499[_0x7361('0xd7')]=_0x4bafcf[_0x7361('0xd3')][_0x7361('0xd7')];}if(_0x4bafcf['Smtp']['authentication']){_0x444499['auth']={'user':_0x4bafcf[_0x7361('0xd3')]['user'],'pass':_0x4bafcf[_0x7361('0xd3')][_0x7361('0xd8')]};}return respondWithRpcPromise(_0x7361('0xd9'),_0x7361('0xda'),{'account':_0x444499,'message':{'from':util[_0x7361('0xa7')]('\x22%s\x22\x20<%s>',_0x4bafcf[_0x7361('0x38')],_0x4bafcf[_0x7361('0xdb')]||_0x4bafcf[_0x7361('0xd3')][_0x7361('0x59')]),'to':_0x35c98b[_0x7361('0xdc')],'subject':_0x35c98b[_0x7361('0xdd')],'text':_0x8c8f4b[_0x7361('0x58')]}},client9003)[_0x7361('0x1e')](function(){return _0x8c8f4b;})[_0x7361('0x26')](function(_0x3640ae){console[_0x7361('0x23')](_0x3640ae);});}})[_0x7361('0x1e')](function(){if(_0x8c8f4b){return _0x8c8f4b;}})['then'](respondWithResult(_0x2756ae,null))[_0x7361('0x26')](handleError(_0x2756ae,null));};exports[_0x7361('0xde')]=function(_0x5457fc,_0x41d6a7,_0x476b32){return db[_0x7361('0xaf')][_0x7361('0x5b')]({'where':{'id':_0x5457fc[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x41d6a7,null))[_0x7361('0x1e')](function(_0x2c40f7){if(_0x2c40f7){return _0x2c40f7[_0x7361('0xde')](_0x5457fc[_0x7361('0x58')][_0x7361('0x69')],_['omit'](_0x5457fc['body'],[_0x7361('0x69'),'id'])||{});}})['then'](respondWithResult(_0x41d6a7,null))[_0x7361('0x26')](handleError(_0x41d6a7,null));};exports[_0x7361('0xdf')]=function(_0x267e06,_0x99a219,_0x26f457){var _0x2bcc52={'raw':![],'where':{}};var _0x40e6a8={};var _0x3bddb8={'count':0x0,'rows':[]};return db[_0x7361('0x50')][_0x7361('0xd1')]({'where':{'id':_0x267e06[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x99a219,null))['then'](function(_0x2c05c6){if(_0x2c05c6){_0x40e6a8['model']=_[_0x7361('0x3d')](db[_0x7361('0xaf')]['rawAttributes']);_0x40e6a8[_0x7361('0x3e')]=_[_0x7361('0x3d')](_0x267e06[_0x7361('0x3e')]);_0x40e6a8[_0x7361('0x46')]=_[_0x7361('0x40')](_0x40e6a8[_0x7361('0x3c')],_0x40e6a8['query']);_0x2bcc52['attributes']=_[_0x7361('0x40')](_0x40e6a8[_0x7361('0x3c')],qs[_0x7361('0x41')](_0x267e06[_0x7361('0x3e')]['fields']));_0x2bcc52['attributes']=_0x2bcc52[_0x7361('0x3f')][_0x7361('0x42')]?_0x2bcc52[_0x7361('0x3f')]:_0x40e6a8['model'];if(!_0x267e06[_0x7361('0x3e')]['hasOwnProperty']('nolimit')){_0x2bcc52[_0x7361('0x2d')]=qs[_0x7361('0x2d')](_0x267e06[_0x7361('0x3e')]['limit']);_0x2bcc52[_0x7361('0x2c')]=qs['offset'](_0x267e06[_0x7361('0x3e')][_0x7361('0x2c')]);}_0x2bcc52[_0x7361('0x67')]=qs[_0x7361('0x45')](_0x267e06[_0x7361('0x3e')]['sort']);_0x2bcc52['where']=qs[_0x7361('0x46')](_[_0x7361('0x47')](_0x267e06[_0x7361('0x3e')],_0x40e6a8[_0x7361('0x46')]));_0x2bcc52[_0x7361('0x49')][_0x7361('0x62')]=_0x2c05c6['id'];if(_0x267e06[_0x7361('0x3e')][_0x7361('0x48')]){_0x2bcc52[_0x7361('0x49')]=_[_0x7361('0x56')](_0x2bcc52[_0x7361('0x49')],{'$or':_[_0x7361('0x4a')](_0x2bcc52[_0x7361('0x3f')],function(_0x171237){var _0x8adf4f={};_0x8adf4f[_0x171237]={'$like':'%'+_0x267e06[_0x7361('0x3e')][_0x7361('0x48')]+'%'};return _0x8adf4f;})});}_0x2bcc52=_['merge']({},_0x2bcc52,_0x267e06[_0x7361('0x4f')]);return db['ChatInteraction'][_0x7361('0x2b')]({'where':_0x2bcc52[_0x7361('0x49')]})[_0x7361('0x1e')](function(_0x88762c){_0x3bddb8['count']=_0x88762c;if(_0x267e06['query'][_0x7361('0x51')]){_0x2bcc52['include']=[{'model':db['CmContact'],'as':_0x7361('0xe0'),'required':![]},{'model':db[_0x7361('0xe1')],'as':_0x7361('0xe2'),'attributes':[_0x7361('0x38'),_0x7361('0xe3'),_0x7361('0xe4')],'required':![]},{'model':db[_0x7361('0xe5')],'as':_0x7361('0xe6'),'attributes':['id',_0x7361('0x38'),_0x7361('0xe7')],'where':_0x267e06['query'][_0x7361('0xe8')]?{'id':_0x267e06['query'][_0x7361('0xe8')]}:undefined,'required':_0x267e06['query'][_0x7361('0xe8')]?!![]:![]}];}return db[_0x7361('0xaf')][_0x7361('0x52')](_0x2bcc52);})[_0x7361('0x1e')](function(_0x1d170e){_0x3bddb8[_0x7361('0x53')]=_0x1d170e;return _0x3bddb8;});}})[_0x7361('0x1e')](respondWithFilteredResult(_0x99a219,_0x2bcc52))['catch'](handleError(_0x99a219,null));};function iftimePromise(_0x1e61db,_0x324a4b){return respondWithRpcPromise(_0x7361('0xe9'),_0x7361('0xea'),{'command':_0x324a4b['timezone']?util[_0x7361('0xa7')](_0x7361('0xeb'),_0x1e61db[_0x7361('0xec')],_0x324a4b[_0x7361('0xed')]):util[_0x7361('0xa7')]('iftime\x20%s',_0x1e61db['interval'])},client9002)[_0x7361('0x1e')](function(_0x209d81){var _0x38b179=_0x209d81&&_0x209d81[_0x7361('0xee')](_0x7361('0xef'))>=0x0?!![]:![];logger[_0x7361('0x25')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x324a4b['id'],_0x1e61db['id'],_0x1e61db[_0x7361('0xec')],_0x38b179?_0x7361('0xf0'):'OFFLINE',_0x324a4b[_0x7361('0xed')]?_0x324a4b[_0x7361('0xed')]:_0x7361('0xf1'));return _0x38b179;})[_0x7361('0x26')](function(_0x4de7eb){logger[_0x7361('0x23')](_0x7361('0xf2'),_0x324a4b['id'],_0x1e61db['id'],_0x1e61db['interval'],util[_0x7361('0xf3')](_0x4de7eb,{'showHidden':![],'depth':null}),_0x324a4b[_0x7361('0xed')]?_0x324a4b[_0x7361('0xed')]:_0x7361('0xf1'));return![];});}exports['getSnippet']=function(_0x42cd94,_0x1277a4,_0x1a9690){var _0x585532=0x0;var _0x34f3f2=0x0;var _0x132421=![];var _0x1c496f;var _0x22b5cc;return db[_0x7361('0x50')][_0x7361('0x5b')]({'where':{'id':_0x42cd94[_0x7361('0x5f')]['id']},'include':[{'model':db[_0x7361('0xf4')],'as':'Interval','include':[{'model':db[_0x7361('0xf4')],'as':_0x7361('0xf5'),'attributes':['id',_0x7361('0xec')],'raw':!![]}]}]})[_0x7361('0x1e')](handleEntityNotFound(_0x1277a4,null))[_0x7361('0x1e')](function(_0x18b546){if(_0x18b546){_0x1c496f=_0x18b546;return _0x18b546[_0x7361('0xf6')]({'raw':!![]});}})['then'](function(_0x414fdb){if(_0x1c496f){if(_0x414fdb){_0x22b5cc=_0x414fdb;}}return require(_0x7361('0x76'))[_0x7361('0x77')]();})[_0x7361('0x1e')](function(_0x1c8eae){if(_0x1c8eae){_0x34f3f2=_0x1c8eae['virtual'];_0x132421=_0x1c8eae['custom'];}})[_0x7361('0x1e')](function(){return db[_0x7361('0xaf')][_0x7361('0x2b')]({'where':{'closed':![]}});})[_0x7361('0x1e')](function(_0x33c291){_0x585532=_0x33c291;if(_0x34f3f2&&_0x33c291>_0x34f3f2){return db['License'][_0x7361('0xd1')]({'where':{'id':0x1}})[_0x7361('0x1e')](function(_0x3798a1){if(_0x3798a1){_0x3798a1[_0x7361('0xf7')](_0x7361('0xf8'));}});}})[_0x7361('0x1e')](function(){if(_0x1c496f['Interval']&&_0x1c496f[_0x7361('0xf4')][_0x7361('0xf5')]){var _0x4c3ee7=[];for(var _0x976e29=0x0;_0x976e29<_0x1c496f['Interval'][_0x7361('0xf5')][_0x7361('0x42')];_0x976e29++){var _0x485a79=_0x1c496f['Interval'][_0x7361('0xf5')][_0x976e29]['get']({'plain':!![]});_0x4c3ee7[_0x7361('0xb6')](iftimePromise(_0x485a79,_0x1c496f));}return BPromise[_0x7361('0xf9')](_0x4c3ee7)['then'](function(_0x2c2055){return _[_0x7361('0xfa')](_0x2c2055);});}else{return!![];}})[_0x7361('0x1e')](function(_0xe9f98d){var _0x2ee7b9=fs[_0x7361('0xc9')](path[_0x7361('0x73')](config[_0x7361('0x74')],'server/files/chat/iframe.js'),_0x7361('0xcb'));var _0x4076da={'remote':_0x1c496f[_0x7361('0xfb')],'query':querystring[_0x7361('0x22')](_[_0x7361('0x56')](_0x1c496f[_0x7361('0x35')]({'plain':!![]}),{'customerIp':_0x42cd94[_0x7361('0x88')]['x-forwarded-for']||_0x42cd94[_0x7361('0x88')][_0x7361('0xfc')]||_0x42cd94[_0x7361('0xfd')][_0x7361('0xfe')]||_0x42cd94['ip'],'referer':_0x42cd94[_0x7361('0x88')][_0x7361('0xa5')],'openedInteractions':_0x585532,'maxInteractions':_0x34f3f2,'virtual':_0x132421[_0x7361('0xff')],'online':_0xe9f98d,'custom':_0x132421}))[_0x7361('0x100')](/'/g,'\x5c\x27')};_0x1277a4['send'](ejs[_0x7361('0xcc')](Mustache[_0x7361('0xcc')](_0x2ee7b9,_0x4076da),{'proactiveActions':_0x22b5cc,'alignment':_0x1c496f[_0x7361('0x101')],'verticalAlignment':_0x1c496f['verticalAlignment']}));})['catch'](handleError(_0x1277a4,null));};exports[_0x7361('0x102')]=function(_0x14c7fc,_0x43c711,_0xfa82f6){return db[_0x7361('0x50')][_0x7361('0xd1')]({'where':{'id':_0x14c7fc[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x43c711,null))[_0x7361('0x1e')](function(_0x2da4e8){if(_0x2da4e8){return db[_0x7361('0x103')][_0x7361('0x104')](function(_0x2e9ff2){return db[_0x7361('0x9a')][_0x7361('0x34')]({'where':{'ChatWebsiteId':_0x14c7fc[_0x7361('0x5f')]['id']},'transaction':_0x2e9ff2})[_0x7361('0x1e')](function(_0x1c6599){var _0x2a9d16=_[_0x7361('0x4a')](_0x14c7fc[_0x7361('0x58')],function(_0x3ea754){_0x3ea754[_0x7361('0x62')]=_0x14c7fc[_0x7361('0x5f')]['id'];return _0x3ea754;});return db[_0x7361('0x9a')][_0x7361('0x105')](_0x2a9d16,{'transaction':_0x2e9ff2});});})[_0x7361('0x1e')](function(){return db['ChatApplication'][_0x7361('0x106')]({'where':{'ChatWebsiteId':_0x14c7fc['params']['id']},'order':'priority'});});}})[_0x7361('0x1e')](respondWithResult(_0x43c711,null))['catch'](handleError(_0x43c711,null));};exports[_0x7361('0x107')]=function(_0x408e23,_0x3bb44e,_0x44e234){var _0x4043f1={};var _0x248e39={};var _0x349b21;var _0x5dc566;return db[_0x7361('0x50')][_0x7361('0xd1')]({'where':{'id':_0x408e23['params']['id']}})['then'](handleEntityNotFound(_0x3bb44e,null))[_0x7361('0x1e')](function(_0x13a02f){if(_0x13a02f){_0x349b21=_0x13a02f;_0x248e39['model']=_[_0x7361('0x3d')](db['ChatApplication'][_0x7361('0x3b')]);_0x248e39['query']=_[_0x7361('0x3d')](_0x408e23[_0x7361('0x3e')]);_0x248e39[_0x7361('0x46')]=_[_0x7361('0x40')](_0x248e39[_0x7361('0x3c')],_0x248e39[_0x7361('0x3e')]);_0x4043f1[_0x7361('0x3f')]=_[_0x7361('0x40')](_0x248e39[_0x7361('0x3c')],qs['fields'](_0x408e23['query'][_0x7361('0x41')]));_0x4043f1[_0x7361('0x3f')]=_0x4043f1['attributes'][_0x7361('0x42')]?_0x4043f1[_0x7361('0x3f')]:_0x248e39[_0x7361('0x3c')];_0x4043f1['order']=qs[_0x7361('0x45')](_0x408e23['query'][_0x7361('0x45')]);_0x4043f1[_0x7361('0x49')]=qs[_0x7361('0x46')](_[_0x7361('0x47')](_0x408e23[_0x7361('0x3e')],_0x248e39[_0x7361('0x46')]));if(_0x408e23[_0x7361('0x3e')][_0x7361('0x48')]){_0x4043f1[_0x7361('0x49')]=_[_0x7361('0x56')](_0x4043f1[_0x7361('0x49')],{'$or':_['map'](_0x4043f1['attributes'],function(_0x170c96){var _0x6d1bca={};_0x6d1bca[_0x170c96]={'$like':'%'+_0x408e23[_0x7361('0x3e')]['filter']+'%'};return _0x6d1bca;})});}_0x4043f1=_[_0x7361('0x56')]({},_0x4043f1,_0x408e23['options']);return _0x349b21['getApplications'](_0x4043f1);}})[_0x7361('0x1e')](function(_0x5aa03c){if(_0x5aa03c){_0x5dc566=_0x5aa03c['length'];if(!_0x408e23[_0x7361('0x3e')]['hasOwnProperty']('nolimit')){_0x4043f1[_0x7361('0x2d')]=qs['limit'](_0x408e23['query'][_0x7361('0x2d')]);_0x4043f1['offset']=qs[_0x7361('0x2c')](_0x408e23[_0x7361('0x3e')][_0x7361('0x2c')]);}return _0x349b21[_0x7361('0x107')](_0x4043f1);}})[_0x7361('0x1e')](function(_0x4d389a){if(_0x4d389a){return _0x4d389a?{'count':_0x5dc566,'rows':_0x4d389a}:null;}})[_0x7361('0x1e')](respondWithResult(_0x3bb44e,null))[_0x7361('0x26')](handleError(_0x3bb44e,null));};exports[_0x7361('0x108')]=function(_0x41410c,_0x156fe0,_0x57d1ac){return db[_0x7361('0x109')][_0x7361('0x5b')]({'where':{'id':_0x41410c[_0x7361('0x5f')]['id']}})['then'](handleEntityNotFound(_0x156fe0,null))['then'](function(_0xa0fa7b){if(_0xa0fa7b){return _0xa0fa7b['addProactiveActions'](_0x41410c[_0x7361('0x58')][_0x7361('0x69')],_[_0x7361('0x10a')](_0x41410c[_0x7361('0x58')],[_0x7361('0x69'),'id'])||{});}})['then'](respondWithResult(_0x156fe0,null))['catch'](handleError(_0x156fe0,null));};exports[_0x7361('0xf6')]=function(_0x26642d,_0x1d41d6,_0x33b91f){var _0x1916cb={};var _0x20a5f3={};var _0x1a05ac;var _0x54e94c;return db[_0x7361('0x50')][_0x7361('0xd1')]({'where':{'id':_0x26642d[_0x7361('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1d41d6,null))['then'](function(_0x55b316){if(_0x55b316){_0x1a05ac=_0x55b316;_0x20a5f3[_0x7361('0x3c')]=_['keys'](db['ChatProactiveAction'][_0x7361('0x3b')]);_0x20a5f3[_0x7361('0x3e')]=_[_0x7361('0x3d')](_0x26642d[_0x7361('0x3e')]);_0x20a5f3[_0x7361('0x46')]=_[_0x7361('0x40')](_0x20a5f3['model'],_0x20a5f3['query']);_0x1916cb['attributes']=_[_0x7361('0x40')](_0x20a5f3[_0x7361('0x3c')],qs[_0x7361('0x41')](_0x26642d[_0x7361('0x3e')][_0x7361('0x41')]));_0x1916cb[_0x7361('0x3f')]=_0x1916cb['attributes'][_0x7361('0x42')]?_0x1916cb['attributes']:_0x20a5f3['model'];_0x1916cb[_0x7361('0x67')]=qs[_0x7361('0x45')](_0x26642d['query']['sort']);_0x1916cb[_0x7361('0x49')]=qs[_0x7361('0x46')](_[_0x7361('0x47')](_0x26642d[_0x7361('0x3e')],_0x20a5f3['filters']));if(_0x26642d[_0x7361('0x3e')]['filter']){_0x1916cb[_0x7361('0x49')]=_[_0x7361('0x56')](_0x1916cb[_0x7361('0x49')],{'$or':_[_0x7361('0x4a')](_0x1916cb[_0x7361('0x3f')],function(_0x313200){var _0x465405={};_0x465405[_0x313200]={'$like':'%'+_0x26642d[_0x7361('0x3e')]['filter']+'%'};return _0x465405;})});}_0x1916cb=_[_0x7361('0x56')]({},_0x1916cb,_0x26642d[_0x7361('0x4f')]);return _0x1a05ac[_0x7361('0xf6')](_0x1916cb);}})[_0x7361('0x1e')](function(_0xc1ab31){if(_0xc1ab31){_0x54e94c=_0xc1ab31[_0x7361('0x42')];if(!_0x26642d[_0x7361('0x3e')][_0x7361('0x43')](_0x7361('0x44'))){_0x1916cb[_0x7361('0x2d')]=qs[_0x7361('0x2d')](_0x26642d[_0x7361('0x3e')][_0x7361('0x2d')]);_0x1916cb[_0x7361('0x2c')]=qs[_0x7361('0x2c')](_0x26642d[_0x7361('0x3e')][_0x7361('0x2c')]);}return _0x1a05ac[_0x7361('0xf6')](_0x1916cb);}})['then'](function(_0x55afb1){if(_0x55afb1){return _0x55afb1?{'count':_0x54e94c,'rows':_0x55afb1}:null;}})[_0x7361('0x1e')](respondWithResult(_0x1d41d6,null))[_0x7361('0x26')](handleError(_0x1d41d6,null));};exports['getFields']=function(_0x298a75,_0xb455b7,_0xbaa601){var _0x5b6675=_0x298a75[_0x7361('0x3e')]['online']===_0x7361('0x10b')?'offlineForm':_0x7361('0x10c');return db['ChatWebsite']['find']({'attributes':['id',_0x5b6675],'where':{'id':_0x298a75['params']['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0xb455b7,null))[_0x7361('0x1e')](function(_0x4d0e11){if(_0x4d0e11){var _0x248026=_0x4d0e11[_0x5b6675];var _0x539927=_0x248026&&_0x248026[_0x7361('0x10d')]?_0x248026[_0x7361('0x10d')]:[];_0xb455b7['send']({'fromKey':_[_0x7361('0x78')](_0x248026[_0x7361('0x10e')])?undefined:_0x248026[_0x7361('0x10e')],'count':_0x539927[_0x7361('0x42')],'rows':_0x539927});}})[_0x7361('0x26')](handleError(_0xb455b7,null));};exports['getOfflineMessages']=function(_0x3db44c,_0x3b5f38,_0x125a63){var _0x218a0c={'raw':!![],'where':{}};var _0x298dbf={};var _0x258909={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3db44c[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x3b5f38,null))[_0x7361('0x1e')](function(_0x1156f1){if(_0x1156f1){_0x298dbf[_0x7361('0x3c')]=_[_0x7361('0x3d')](db[_0x7361('0xcf')][_0x7361('0x3b')]);_0x298dbf['query']=_['keys'](_0x3db44c['query']);_0x298dbf[_0x7361('0x46')]=_[_0x7361('0x40')](_0x298dbf[_0x7361('0x3c')],_0x298dbf[_0x7361('0x3e')]);_0x218a0c[_0x7361('0x3f')]=_['intersection'](_0x298dbf[_0x7361('0x3c')],qs[_0x7361('0x41')](_0x3db44c[_0x7361('0x3e')][_0x7361('0x41')]));_0x218a0c['attributes']=_0x218a0c[_0x7361('0x3f')][_0x7361('0x42')]?_0x218a0c[_0x7361('0x3f')]:_0x298dbf[_0x7361('0x3c')];if(!_0x3db44c['query']['hasOwnProperty'](_0x7361('0x44'))){_0x218a0c[_0x7361('0x2d')]=qs[_0x7361('0x2d')](_0x3db44c[_0x7361('0x3e')][_0x7361('0x2d')]);_0x218a0c[_0x7361('0x2c')]=qs[_0x7361('0x2c')](_0x3db44c[_0x7361('0x3e')][_0x7361('0x2c')]);}_0x218a0c[_0x7361('0x67')]=qs[_0x7361('0x45')](_0x3db44c[_0x7361('0x3e')][_0x7361('0x45')]);_0x218a0c['where']=qs[_0x7361('0x46')](_[_0x7361('0x47')](_0x3db44c[_0x7361('0x3e')],_0x298dbf[_0x7361('0x46')]));_0x218a0c[_0x7361('0x49')][_0x7361('0x62')]=_0x1156f1['id'];if(_0x3db44c[_0x7361('0x3e')][_0x7361('0x48')]){_0x218a0c[_0x7361('0x49')]=_[_0x7361('0x56')](_0x218a0c[_0x7361('0x49')],{'$or':_[_0x7361('0x4a')](_0x218a0c[_0x7361('0x3f')],function(_0x25932b){var _0x489e88={};_0x489e88[_0x25932b]={'$like':'%'+_0x3db44c[_0x7361('0x3e')][_0x7361('0x48')]+'%'};return _0x489e88;})});}_0x218a0c=_[_0x7361('0x56')]({},_0x218a0c,_0x3db44c[_0x7361('0x4f')]);return db['ChatOfflineMessage']['count']({'where':_0x218a0c[_0x7361('0x49')]})[_0x7361('0x1e')](function(_0x366d28){_0x258909['count']=_0x366d28;if(_0x3db44c[_0x7361('0x3e')]['includeAll']){_0x218a0c[_0x7361('0x55')]=[{'all':!![]}];}return db[_0x7361('0xcf')][_0x7361('0x52')](_0x218a0c);})['then'](function(_0xd128f5){_0x258909[_0x7361('0x53')]=_0xd128f5;return _0x258909;});}})[_0x7361('0x1e')](respondWithFilteredResult(_0x3b5f38,_0x218a0c))['catch'](handleError(_0x3b5f38,null));};exports[_0x7361('0x10f')]=function(_0x5f0bcf,_0x3343ab,_0x598bfe){return db[_0x7361('0x50')][_0x7361('0x5b')]({'where':{'id':_0x5f0bcf['params']['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x3343ab,null))[_0x7361('0x1e')](function(_0x24a6f9){if(_0x24a6f9){return _0x24a6f9[_0x7361('0x10f')](_0x5f0bcf[_0x7361('0x58')][_0x7361('0x69')],_['omit'](_0x5f0bcf[_0x7361('0x58')],[_0x7361('0x69'),'id'])||{})[_0x7361('0xb2')](function(_0xb7d3cc){for(var _0x345f75=0x0;_0x345f75<_0x5f0bcf[_0x7361('0x58')]['ids'][_0x7361('0x42')];_0x345f75+=0x1){socket[_0x7361('0x110')](_0x7361('0x111'),{'UserId':_0x5f0bcf['body']['ids'][_0x345f75],'ChatWebsiteId':_0x5f0bcf['params']['id']});}return _0xb7d3cc;});}})['then'](respondWithResult(_0x3343ab,null))[_0x7361('0x26')](handleError(_0x3343ab,null));};exports[_0x7361('0x112')]=function(_0x5ce1d2,_0x555f6d,_0x554804){return db['ChatWebsite'][_0x7361('0x5b')]({'where':{'id':_0x5ce1d2[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x555f6d,null))['then'](function(_0x5d01a9){if(_0x5d01a9){return _0x5d01a9['removeAgents'](_0x5ce1d2[_0x7361('0x3e')][_0x7361('0x69')])[_0x7361('0x1e')](function(){if(_['isArray'](_0x5ce1d2['query']['ids'])){for(var _0x2a6100=0x0;_0x2a6100<_0x5ce1d2[_0x7361('0x3e')][_0x7361('0x69')][_0x7361('0x42')];_0x2a6100+=0x1){socket['emit'](_0x7361('0x113'),{'UserId':Number(_0x5ce1d2[_0x7361('0x3e')][_0x7361('0x69')][_0x2a6100]),'ChatWebsiteId':Number(_0x5ce1d2[_0x7361('0x5f')]['id'])});}}else{socket[_0x7361('0x110')]('userChatWebsite:remove',{'UserId':Number(_0x5ce1d2['query'][_0x7361('0x69')]),'ChatWebsiteId':Number(_0x5ce1d2[_0x7361('0x5f')]['id'])});}});}})[_0x7361('0x1e')](respondWithStatusCode(_0x555f6d,null))['catch'](handleError(_0x555f6d,null));};exports['getAgents']=function(_0x1f58e8,_0x63df5c,_0x141499){var _0x50eb9c={};var _0x2ef347={};var _0x8d030d;var _0x4c0e3e;return db[_0x7361('0x50')][_0x7361('0xd1')]({'where':{'id':_0x1f58e8[_0x7361('0x5f')]['id']}})[_0x7361('0x1e')](handleEntityNotFound(_0x63df5c,null))[_0x7361('0x1e')](function(_0x113ca6){if(_0x113ca6){_0x8d030d=_0x113ca6;_0x2ef347[_0x7361('0x3c')]=_[_0x7361('0x3d')](db[_0x7361('0xe1')][_0x7361('0x3b')]);_0x2ef347[_0x7361('0x3e')]=_[_0x7361('0x3d')](_0x1f58e8[_0x7361('0x3e')]);_0x2ef347[_0x7361('0x46')]=_[_0x7361('0x40')](_0x2ef347[_0x7361('0x3c')],_0x2ef347[_0x7361('0x3e')]);_0x50eb9c[_0x7361('0x3f')]=_[_0x7361('0x40')](_0x2ef347[_0x7361('0x3c')],qs[_0x7361('0x41')](_0x1f58e8[_0x7361('0x3e')]['fields']));_0x50eb9c['attributes']=_0x50eb9c[_0x7361('0x3f')][_0x7361('0x42')]?_0x50eb9c[_0x7361('0x3f')]:_0x2ef347['model'];_0x50eb9c['order']=qs[_0x7361('0x45')](_0x1f58e8[_0x7361('0x3e')]['sort']);_0x50eb9c[_0x7361('0x49')]=qs[_0x7361('0x46')](_[_0x7361('0x47')](_0x1f58e8['query'],_0x2ef347['filters']));if(_0x1f58e8['query'][_0x7361('0x48')]){_0x50eb9c[_0x7361('0x49')]=_[_0x7361('0x56')](_0x50eb9c[_0x7361('0x49')],{'$or':_[_0x7361('0x4a')](_0x50eb9c[_0x7361('0x3f')],function(_0xca9460){var _0x2ab4d8={};_0x2ab4d8[_0xca9460]={'$like':'%'+_0x1f58e8[_0x7361('0x3e')][_0x7361('0x48')]+'%'};return _0x2ab4d8;})});}_0x50eb9c=_[_0x7361('0x56')]({},_0x50eb9c,_0x1f58e8[_0x7361('0x4f')]);return _0x8d030d[_0x7361('0x114')](_0x50eb9c);}})[_0x7361('0x1e')](function(_0x3f1a1d){if(_0x3f1a1d){_0x4c0e3e=_0x3f1a1d[_0x7361('0x42')];if(!_0x1f58e8[_0x7361('0x3e')][_0x7361('0x43')]('nolimit')){_0x50eb9c[_0x7361('0x2d')]=qs[_0x7361('0x2d')](_0x1f58e8[_0x7361('0x3e')][_0x7361('0x2d')]);_0x50eb9c['offset']=qs[_0x7361('0x2c')](_0x1f58e8['query'][_0x7361('0x2c')]);}return _0x8d030d[_0x7361('0x114')](_0x50eb9c);}})[_0x7361('0x1e')](function(_0x883957){if(_0x883957){return _0x883957?{'count':_0x4c0e3e,'rows':_0x883957}:null;}})[_0x7361('0x1e')](respondWithResult(_0x63df5c,null))['catch'](handleError(_0x63df5c,null));}; \ No newline at end of file +var _0x6552=['filter','where','merge','map','type','key','field','options','count','includeAll','include','findAll','rows','catch','show','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','customerAvatar','addSystemAvatar','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','ChatApplication','Applications','List','account','list','applications','orderBy','priority','asc','ListId','from','firstName','lastName','customerIp','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','contact','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','email','offlineMessageSubject','addInteraction','omit','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','connection','remoteAddress','replace','alignment','verticalAlignment','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','json','offset','Content-Range','apply','reject','update','destroy','then','ChatWebsites','UserProfileResource','stack','name','send','Pause','mandatoryDispositionPause','ChatWebsite','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','pick'];(function(_0x379ad4,_0x24770f){var _0x3227f3=function(_0x51f486){while(--_0x51f486){_0x379ad4['push'](_0x379ad4['shift']());}};_0x3227f3(++_0x24770f);}(_0x6552,0x1ea));var _0x2655=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x6552[_0xbca1b1];return _0x4e1686;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x2655('0x0'));var zipdir=require(_0x2655('0x1'));var jsonpatch=require(_0x2655('0x2'));var rp=require(_0x2655('0x3'));var moment=require(_0x2655('0x4'));var BPromise=require(_0x2655('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2655('0x6'));var sox=require(_0x2655('0x7'));var csv=require(_0x2655('0x8'));var ejs=require(_0x2655('0x9'));var fs=require('fs');var _=require(_0x2655('0xa'));var squel=require(_0x2655('0xb'));var crypto=require(_0x2655('0xc'));var jsforce=require(_0x2655('0xd'));var deskjs=require(_0x2655('0xe'));var toCsv=require(_0x2655('0x8'));var querystring=require(_0x2655('0xf'));var Papa=require('papaparse');var Redis=require(_0x2655('0x10'));var authService=require(_0x2655('0x11'));var qs=require(_0x2655('0x12'));var hardwareService=require(_0x2655('0x13'));var logger=require(_0x2655('0x14'))(_0x2655('0x15'));var utils=require(_0x2655('0x16'));var config=require(_0x2655('0x17'));var db=require(_0x2655('0x18'))['db'];config['redis']=_[_0x2655('0x19')](config[_0x2655('0x1a')],{'host':_0x2655('0x1b'),'port':0x18eb});var socket=require(_0x2655('0x1c'))(new Redis(config[_0x2655('0x1a')]));require(_0x2655('0x1d'))[_0x2655('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2655('0x1f')][_0x2655('0x20')]({'port':0x232c});var client9002=jayson[_0x2655('0x1f')][_0x2655('0x20')]({'port':0x232a});var client9003=jayson[_0x2655('0x1f')]['http']({'port':0x232b});function checkPasswordPattern(_0x701fbc,_0x2d9cf2,_0x5484e6){if(_0x5484e6){var _0x218b47=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x218b47[_0x2655('0x21')](_0x2d9cf2)){return _0x701fbc;}else{throw new Error(_0x2655('0x22'));}}else{return _0x701fbc;}}function respondWithRpcPromise(_0x1297e5,_0xeafd4a,_0x2e0402,_0x2d36de){return new BPromise(function(_0x2b16b6,_0x5a20f5){var _0x57aafa=_0x2d36de||client;return _0x57aafa[_0x2655('0x23')](_0x1297e5,_0x2e0402)['then'](function(_0xe0f7f){logger[_0x2655('0x24')](_0x2655('0x25'),_0xeafd4a,_0x2655('0x26'));logger[_0x2655('0x27')](_0x2655('0x28'),_0xeafd4a,_0x2655('0x26'),JSON[_0x2655('0x29')](_0xe0f7f));if(_0xe0f7f[_0x2655('0x2a')]){if(_0xe0f7f[_0x2655('0x2a')]['code']===0x1f4){logger[_0x2655('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0xeafd4a,_0xe0f7f[_0x2655('0x2a')][_0x2655('0x2b')]);return _0x5a20f5(_0xe0f7f[_0x2655('0x2a')]['message']);}logger[_0x2655('0x2a')](_0x2655('0x25'),_0xeafd4a,_0xe0f7f['error'][_0x2655('0x2b')]);return _0x2b16b6(_0xe0f7f[_0x2655('0x2a')][_0x2655('0x2b')]);}else{logger[_0x2655('0x24')](_0x2655('0x25'),_0xeafd4a,_0x2655('0x26'));_0x2b16b6(_0xe0f7f['result'][_0x2655('0x2b')]);}})['catch'](function(_0x374da5){logger['error'](_0x2655('0x25'),_0xeafd4a,_0x374da5);_0x5a20f5(_0x374da5);});});}function respondWithStatusCode(_0x436f13,_0x219ffd){_0x219ffd=_0x219ffd||0xcc;return function(_0x34d327){if(_0x34d327){return _0x436f13[_0x2655('0x2c')](_0x219ffd);}return _0x436f13[_0x2655('0x2d')](_0x219ffd)['end']();};}function respondWithResult(_0x241e52,_0x31136f){_0x31136f=_0x31136f||0xc8;return function(_0x7a7180){if(_0x7a7180){return _0x241e52[_0x2655('0x2d')](_0x31136f)[_0x2655('0x2e')](_0x7a7180);}};}function respondWithFilteredResult(_0x253acf,_0x460fc5){return function(_0x5d4100){if(_0x5d4100){var _0x2192fd=_0x5d4100['count'],_0x21e615=_0x460fc5[_0x2655('0x2f')],_0x2ead1a=_0x460fc5[_0x2655('0x2f')]+_0x460fc5['limit'],_0x3e855f;if(_0x2ead1a>=_0x2192fd){_0x2ead1a=_0x2192fd;_0x3e855f=0xc8;}else{_0x3e855f=0xce;}_0x253acf[_0x2655('0x2d')](_0x3e855f);return _0x253acf['set'](_0x2655('0x30'),_0x21e615+'-'+_0x2ead1a+'/'+_0x2192fd)[_0x2655('0x2e')](_0x5d4100);}return null;};}function patchUpdates(_0x2aa5c0){return function(_0x12f0fb){try{jsonpatch[_0x2655('0x31')](_0x12f0fb,_0x2aa5c0,!![]);}catch(_0x17bc24){return BPromise[_0x2655('0x32')](_0x17bc24);}return _0x12f0fb['save']();};}function saveUpdates(_0xc53e14,_0x5231a4){return function(_0x5385cc){if(_0x5385cc){return _0x5385cc[_0x2655('0x33')](_0xc53e14)['then'](function(_0x4ed530){return _0x4ed530;});}return null;};}function removeEntity(_0x34a4d4,_0x2ab844){return function(_0x174fa9){if(_0x174fa9){return _0x174fa9[_0x2655('0x34')]()[_0x2655('0x35')](function(){var _0x18b611=_0x174fa9['get']({'plain':!![]});var _0x54e090=_0x2655('0x36');return db[_0x2655('0x37')][_0x2655('0x34')]({'where':{'type':_0x54e090,'resourceId':_0x18b611['id']}})['then'](function(){return _0x174fa9;});})['then'](function(){_0x34a4d4[_0x2655('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3923b7,_0x47d887){return function(_0x5123c2){if(!_0x5123c2){_0x3923b7[_0x2655('0x2c')](0x194);}return _0x5123c2;};}function handleError(_0x5ec15f,_0x44ec3e){_0x44ec3e=_0x44ec3e||0x1f4;return function(_0x45967){logger['error'](_0x45967[_0x2655('0x38')]);if(_0x45967['name']){delete _0x45967[_0x2655('0x39')];}_0x5ec15f[_0x2655('0x2d')](_0x44ec3e)[_0x2655('0x3a')](_0x45967);};}exports['index']=function(_0x398bde,_0x35a031){var _0x47e1c6={'include':[{'model':db[_0x2655('0x3b')],'as':_0x2655('0x3c')}]},_0x4c52af={},_0x1f0093={'count':0x0,'rows':[]};var _0x8e521d=db[_0x2655('0x3d')]['rawAttributes'];_0x4c52af[_0x2655('0x3e')]=_['keys'](_0x8e521d);_0x4c52af[_0x2655('0x3f')]=_[_0x2655('0x40')](_0x398bde[_0x2655('0x3f')]);_0x4c52af[_0x2655('0x41')]=_[_0x2655('0x42')](_0x4c52af[_0x2655('0x3e')],_0x4c52af['query']);_0x47e1c6[_0x2655('0x43')]=_[_0x2655('0x42')](_0x4c52af[_0x2655('0x3e')],qs['fields'](_0x398bde[_0x2655('0x3f')]['fields']));_0x47e1c6[_0x2655('0x43')]=_0x47e1c6[_0x2655('0x43')][_0x2655('0x44')]?_0x47e1c6[_0x2655('0x43')]:_0x4c52af[_0x2655('0x3e')];if(!_0x398bde[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x47e1c6[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x398bde['query'][_0x2655('0x47')]);_0x47e1c6[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x398bde[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x47e1c6['order']=qs[_0x2655('0x48')](_0x398bde[_0x2655('0x3f')][_0x2655('0x48')]);_0x47e1c6['where']=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x398bde[_0x2655('0x3f')],_0x4c52af['filters']));if(_0x398bde['query'][_0x2655('0x4a')]){_0x47e1c6[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x47e1c6[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x8e521d,function(_0x4b22c3){if(_0x4b22c3[_0x2655('0x4e')][_0x2655('0x4f')]!=='VIRTUAL'){var _0x347e3e={};_0x347e3e[_0x4b22c3[_0x2655('0x50')]]={'$like':'%'+_0x398bde['query'][_0x2655('0x4a')]+'%'};return _0x347e3e;}})});}_0x47e1c6=_['merge']({},_0x47e1c6,_0x398bde[_0x2655('0x51')]);var _0x5c10b3={'where':_0x47e1c6[_0x2655('0x4b')]};return db[_0x2655('0x3d')]['count'](_0x5c10b3)[_0x2655('0x35')](function(_0x298e7f){_0x1f0093[_0x2655('0x52')]=_0x298e7f;if(_0x398bde[_0x2655('0x3f')][_0x2655('0x53')]){_0x47e1c6[_0x2655('0x54')]=[{'all':!![]}];}return db[_0x2655('0x3d')][_0x2655('0x55')](_0x47e1c6);})[_0x2655('0x35')](function(_0x55e54a){_0x1f0093[_0x2655('0x56')]=_0x55e54a;return _0x1f0093;})['then'](respondWithFilteredResult(_0x35a031,_0x47e1c6))[_0x2655('0x57')](handleError(_0x35a031,null));};exports[_0x2655('0x58')]=function(_0x162022,_0x28ade8){var _0x380ed8={'raw':![],'where':{'id':_0x162022['params']['id']},'include':[{'model':db['Pause'],'as':_0x2655('0x3c')}]},_0x3407b2={};_0x3407b2[_0x2655('0x3e')]=_[_0x2655('0x40')](db[_0x2655('0x3d')]['rawAttributes']);_0x3407b2[_0x2655('0x3f')]=_[_0x2655('0x40')](_0x162022['query']);_0x3407b2[_0x2655('0x41')]=_[_0x2655('0x42')](_0x3407b2['model'],_0x3407b2['query']);_0x380ed8['attributes']=_['intersection'](_0x3407b2[_0x2655('0x3e')],qs[_0x2655('0x59')](_0x162022[_0x2655('0x3f')][_0x2655('0x59')]));_0x380ed8[_0x2655('0x43')]=_0x380ed8['attributes']['length']?_0x380ed8[_0x2655('0x43')]:_0x3407b2[_0x2655('0x3e')];if(_0x162022['query'][_0x2655('0x53')]){_0x380ed8[_0x2655('0x54')]=[{'all':!![]}];}_0x380ed8=_[_0x2655('0x4c')]({},_0x380ed8,_0x162022[_0x2655('0x51')]);return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x380ed8)['then'](handleEntityNotFound(_0x28ade8,null))['then'](respondWithResult(_0x28ade8,null))[_0x2655('0x57')](handleError(_0x28ade8,null));};exports[_0x2655('0x5b')]=function(_0x26f158,_0x2c011d){return db['ChatWebsite'][_0x2655('0x5b')](_0x26f158[_0x2655('0x5c')],{})[_0x2655('0x35')](function(_0x310482){var _0x1b3251=_0x26f158[_0x2655('0x5d')][_0x2655('0x5e')]({'plain':!![]});if(!_0x1b3251)throw new Error(_0x2655('0x5f'));if(_0x1b3251[_0x2655('0x60')]===_0x2655('0x5d')){var _0x428ca4=_0x310482[_0x2655('0x5e')]({'plain':!![]});var _0x2b3bc2=_0x2655('0x36');return db[_0x2655('0x61')][_0x2655('0x5a')]({'where':{'name':_0x2b3bc2,'userProfileId':_0x1b3251[_0x2655('0x62')]},'raw':!![]})[_0x2655('0x35')](function(_0x29f3c6){if(_0x29f3c6&&_0x29f3c6['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x428ca4[_0x2655('0x39')],'resourceId':_0x428ca4['id'],'type':_0x29f3c6['name'],'sectionId':_0x29f3c6['id']},{})[_0x2655('0x35')](function(){return _0x310482;});}else{return _0x310482;}})[_0x2655('0x57')](function(_0x5af56a){logger[_0x2655('0x2a')](_0x2655('0x63'),_0x5af56a);throw _0x5af56a;});}return _0x310482;})['then'](respondWithResult(_0x2c011d,0xc9))[_0x2655('0x57')](handleError(_0x2c011d,null));};exports['update']=function(_0x1b1815,_0x2fdd87){if(_0x1b1815['body']['id']){delete _0x1b1815[_0x2655('0x5c')]['id'];}return db[_0x2655('0x3d')]['find']({'where':{'id':_0x1b1815[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x2655('0x35')](handleEntityNotFound(_0x2fdd87,null))[_0x2655('0x35')](saveUpdates(_0x1b1815[_0x2655('0x5c')],null))[_0x2655('0x35')](respondWithResult(_0x2fdd87,null))[_0x2655('0x57')](handleError(_0x2fdd87,null));};exports[_0x2655('0x34')]=function(_0x21fe3e,_0x26ec5e){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x21fe3e[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x26ec5e,null))['then'](removeEntity(_0x26ec5e,null))[_0x2655('0x57')](handleError(_0x26ec5e,null));};exports[_0x2655('0x65')]=function(_0xc22e36,_0x89351f){return db[_0x2655('0x3d')][_0x2655('0x65')]()['then'](respondWithResult(_0x89351f,null))[_0x2655('0x57')](handleError(_0x89351f,null));};exports[_0x2655('0x66')]=function(_0x4c4c83,_0x1bf2d9,_0x494723){if(_0x4c4c83[_0x2655('0x5c')]['id']){delete _0x4c4c83['body']['id'];}return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x4c4c83[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x1bf2d9,null))['then'](function(_0x541b2b){if(_0x541b2b){_0x4c4c83[_0x2655('0x5c')][_0x2655('0x67')]=_0x541b2b['id'];return db[_0x2655('0x68')][_0x2655('0x5b')](_0x4c4c83[_0x2655('0x5c')]);}})[_0x2655('0x35')](respondWithResult(_0x1bf2d9,null))['catch'](handleError(_0x1bf2d9,null));};exports[_0x2655('0x69')]=function(_0x13c452,_0x410dd1,_0xcdb629){var _0x3abf60={'raw':![],'where':{}};var _0x4c7b42={};var _0x458d95={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x2655('0x6a')]({'where':{'id':_0x13c452[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x410dd1,null))['then'](function(_0x1f5474){if(_0x1f5474){_0x4c7b42['model']=_['keys'](db[_0x2655('0x68')][_0x2655('0x6b')]);_0x4c7b42['query']=_[_0x2655('0x40')](_0x13c452[_0x2655('0x3f')]);_0x4c7b42['filters']=_[_0x2655('0x42')](_0x4c7b42[_0x2655('0x3e')],_0x4c7b42[_0x2655('0x3f')]);_0x3abf60[_0x2655('0x43')]=_[_0x2655('0x42')](_0x4c7b42['model'],qs[_0x2655('0x59')](_0x13c452[_0x2655('0x3f')][_0x2655('0x59')]));_0x3abf60[_0x2655('0x43')]=_0x3abf60[_0x2655('0x43')][_0x2655('0x44')]?_0x3abf60[_0x2655('0x43')]:_0x4c7b42['model'];if(!_0x13c452[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x3abf60[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x13c452[_0x2655('0x3f')][_0x2655('0x47')]);_0x3abf60[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x13c452[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x3abf60[_0x2655('0x6c')]=qs[_0x2655('0x48')](_0x13c452[_0x2655('0x3f')]['sort']);_0x3abf60['where']=qs[_0x2655('0x41')](_['pick'](_0x13c452[_0x2655('0x3f')],_0x4c7b42['filters']));_0x3abf60[_0x2655('0x4b')]['ChatWebsiteId']=_0x1f5474['id'];if(_0x13c452[_0x2655('0x3f')][_0x2655('0x4a')]){_0x3abf60['where']=_[_0x2655('0x4c')](_0x3abf60[_0x2655('0x4b')],{'$or':_['map'](_0x3abf60['attributes'],function(_0x537d51){var _0x2ba3b4={};_0x2ba3b4[_0x537d51]={'$like':'%'+_0x13c452[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x2ba3b4;})});}_0x3abf60=_[_0x2655('0x4c')]({},_0x3abf60,_0x13c452[_0x2655('0x51')]);return db[_0x2655('0x68')]['count']({'where':_0x3abf60[_0x2655('0x4b')]})[_0x2655('0x35')](function(_0x206c54){_0x458d95['count']=_0x206c54;if(_0x13c452[_0x2655('0x3f')][_0x2655('0x53')]){_0x3abf60[_0x2655('0x54')]=[{'all':!![]}];}return db[_0x2655('0x68')][_0x2655('0x55')](_0x3abf60);})[_0x2655('0x35')](function(_0x20effe){_0x458d95[_0x2655('0x56')]=_0x20effe;return _0x458d95;});}})['then'](respondWithFilteredResult(_0x410dd1,_0x3abf60))[_0x2655('0x57')](handleError(_0x410dd1,null));};exports[_0x2655('0x6d')]=function(_0x2a2eee,_0x3a7c4e,_0x171208){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x2a2eee['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x3a7c4e,null))[_0x2655('0x35')](function(_0x3ebde0){if(_0x3ebde0){return _0x3ebde0[_0x2655('0x6d')](_0x2a2eee[_0x2655('0x3f')][_0x2655('0x6e')]);}})['then'](respondWithStatusCode(_0x3a7c4e,null))[_0x2655('0x57')](handleError(_0x3a7c4e,null));};exports[_0x2655('0x6f')]=function(_0x5ce470,_0x2c2399,_0x43fa27){if(_0x5ce470[_0x2655('0x5c')]['id']){delete _0x5ce470[_0x2655('0x5c')]['id'];}return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x5ce470[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x2c2399,null))[_0x2655('0x35')](function(_0x147545){if(_0x147545){_0x5ce470[_0x2655('0x5c')][_0x2655('0x67')]=_0x147545['id'];return db['CannedAnswer']['create'](_0x5ce470[_0x2655('0x5c')]);}})[_0x2655('0x35')](respondWithResult(_0x2c2399,null))[_0x2655('0x57')](handleError(_0x2c2399,null));};exports[_0x2655('0x70')]=function(_0x419572,_0x3aa9be,_0x18bc78){var _0x507919={'raw':![],'where':{}};var _0x3791fe={};var _0x3e5b52={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x419572[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x3aa9be,null))['then'](function(_0x43fdc9){if(_0x43fdc9){_0x3791fe[_0x2655('0x3e')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x3791fe[_0x2655('0x3f')]=_[_0x2655('0x40')](_0x419572[_0x2655('0x3f')]);_0x3791fe[_0x2655('0x41')]=_[_0x2655('0x42')](_0x3791fe[_0x2655('0x3e')],_0x3791fe[_0x2655('0x3f')]);_0x507919[_0x2655('0x43')]=_[_0x2655('0x42')](_0x3791fe[_0x2655('0x3e')],qs['fields'](_0x419572[_0x2655('0x3f')]['fields']));_0x507919['attributes']=_0x507919[_0x2655('0x43')][_0x2655('0x44')]?_0x507919['attributes']:_0x3791fe['model'];if(!_0x419572['query'][_0x2655('0x45')](_0x2655('0x46'))){_0x507919[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x419572['query'][_0x2655('0x47')]);_0x507919[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x419572[_0x2655('0x3f')]['offset']);}_0x507919['order']=qs[_0x2655('0x48')](_0x419572[_0x2655('0x3f')]['sort']);_0x507919['where']=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x419572[_0x2655('0x3f')],_0x3791fe[_0x2655('0x41')]));_0x507919['where']['ChatWebsiteId']=_0x43fdc9['id'];if(_0x419572[_0x2655('0x3f')][_0x2655('0x4a')]){_0x507919[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x507919[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x507919[_0x2655('0x43')],function(_0x3f45f7){var _0x5a064a={};_0x5a064a[_0x3f45f7]={'$like':'%'+_0x419572['query'][_0x2655('0x4a')]+'%'};return _0x5a064a;})});}_0x507919=_[_0x2655('0x4c')]({},_0x507919,_0x419572[_0x2655('0x51')]);return db[_0x2655('0x71')][_0x2655('0x52')]({'where':_0x507919[_0x2655('0x4b')]})['then'](function(_0x319f0a){_0x3e5b52[_0x2655('0x52')]=_0x319f0a;if(_0x419572[_0x2655('0x3f')][_0x2655('0x53')]){_0x507919[_0x2655('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x2655('0x55')](_0x507919);})[_0x2655('0x35')](function(_0x52624c){_0x3e5b52[_0x2655('0x56')]=_0x52624c;return _0x3e5b52;});}})[_0x2655('0x35')](respondWithFilteredResult(_0x3aa9be,_0x507919))[_0x2655('0x57')](handleError(_0x3aa9be,null));};exports[_0x2655('0x72')]=function(_0x1cd5ad,_0x26c3fc,_0x16dd3f){return db[_0x2655('0x3d')]['find']({'where':{'id':_0x1cd5ad[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x26c3fc,null))['then'](function(_0x28d552){if(_0x28d552){return _0x28d552[_0x2655('0x72')](_0x1cd5ad[_0x2655('0x3f')][_0x2655('0x6e')]);}})[_0x2655('0x35')](respondWithStatusCode(_0x26c3fc,null))[_0x2655('0x57')](handleError(_0x26c3fc,null));};exports[_0x2655('0x73')]=function(_0x30ae5e,_0x5e8d8d,_0x2cc97d){_0x30ae5e[_0x2655('0x5c')][_0x2655('0x74')]=_0x30ae5e[_0x2655('0x75')]['filename'];return db[_0x2655('0x3d')]['find']({'where':{'id':_0x30ae5e[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x5e8d8d,null))[_0x2655('0x35')](saveUpdates(_0x30ae5e[_0x2655('0x5c')],null))[_0x2655('0x35')](respondWithResult(_0x5e8d8d,null))[_0x2655('0x57')](handleError(_0x5e8d8d,null));};exports[_0x2655('0x76')]=function(_0x538765,_0x3ecc5d,_0x109738){_0x538765[_0x2655('0x5c')][_0x2655('0x77')]=_0x538765[_0x2655('0x75')][_0x2655('0x78')];return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x538765['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x3ecc5d,null))[_0x2655('0x35')](saveUpdates(_0x538765['body'],null))[_0x2655('0x35')](respondWithResult(_0x3ecc5d,null))['catch'](handleError(_0x3ecc5d,null));};exports['addCustomerAvatar']=function(_0x26c411,_0x1e7ea1,_0x44b412){_0x26c411['body'][_0x2655('0x79')]=_0x26c411['file'][_0x2655('0x78')];return db['ChatWebsite'][_0x2655('0x5a')]({'where':{'id':_0x26c411['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x1e7ea1,null))[_0x2655('0x35')](saveUpdates(_0x26c411['body'],null))[_0x2655('0x35')](respondWithResult(_0x1e7ea1,null))[_0x2655('0x57')](handleError(_0x1e7ea1,null));};exports[_0x2655('0x7a')]=function(_0x59dffb,_0x2ea67f,_0x49a939){_0x59dffb[_0x2655('0x5c')]['systemAvatar']=_0x59dffb[_0x2655('0x75')]['filename'];return db[_0x2655('0x3d')]['find']({'where':{'id':_0x59dffb[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x2ea67f,null))[_0x2655('0x35')](saveUpdates(_0x59dffb[_0x2655('0x5c')],null))[_0x2655('0x35')](respondWithResult(_0x2ea67f,null))['catch'](handleError(_0x2ea67f,null));};exports['getLogo']=function(_0x149011,_0xa83cb5,_0x4e3958){var _0x2ce9c3=path['join'](config[_0x2655('0x7b')],_0x2655('0x7c'));var _0x200374={'where':{'id':_0x149011['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x3332a3=![];return require(_0x2655('0x7d'))[_0x2655('0x7e')]()[_0x2655('0x35')](function(_0x27a864){if(_0x27a864){_0x3332a3=_0x27a864[_0x2655('0x7f')];}})[_0x2655('0x35')](function(){return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x200374);})[_0x2655('0x35')](handleEntityNotFound(_0xa83cb5,null))[_0x2655('0x35')](function(_0x3bb42d){if(_0x3bb42d){if(!_[_0x2655('0x80')](_0x3bb42d[_0x2655('0x74')])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x83'),_0x3bb42d[_0x2655('0x74')]))&&_0x3332a3){_0x2ce9c3=path['join'](config[_0x2655('0x7b')],_0x2655('0x83'),_0x3bb42d['sitepic']);}}return _0xa83cb5[_0x2655('0x84')](_0x2ce9c3);}})[_0x2655('0x57')](handleError(_0xa83cb5,null));};exports[_0x2655('0x85')]=function(_0x5886f2,_0x3f99fe,_0xe57bda){var _0x11ec08=path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x86'));var _0x433040={'where':{'id':_0x5886f2[_0x2655('0x64')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x433040)['then'](handleEntityNotFound(_0x3f99fe,null))[_0x2655('0x35')](function(_0x4ec68e){if(_0x4ec68e){if(!_[_0x2655('0x80')](_0x4ec68e[_0x2655('0x77')])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config['root'],_0x2655('0x87'),_0x4ec68e[_0x2655('0x77')]))){_0x11ec08=path['join'](config['root'],_0x2655('0x87'),_0x4ec68e[_0x2655('0x77')]);}}return _0x3f99fe['download'](_0x11ec08);}})[_0x2655('0x57')](handleError(_0x3f99fe,null));};exports[_0x2655('0x88')]=function(_0x5bc68e,_0x49bca3,_0x4bdd59){var _0x2ab8d4=path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x89'));var _0x16bcb4={'where':{'id':_0x5bc68e['params']['id']},'attributes':['id',_0x2655('0x79'),'showCustomerAvatar'],'raw':!![]};return db[_0x2655('0x3d')][_0x2655('0x5a')](_0x16bcb4)[_0x2655('0x35')](handleEntityNotFound(_0x49bca3,null))[_0x2655('0x35')](function(_0x149a53){if(_0x149a53){if(!_[_0x2655('0x80')](_0x149a53[_0x2655('0x79')])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x87'),_0x149a53[_0x2655('0x79')]))&&_0x149a53['showCustomerAvatar']){_0x2ab8d4=path['join'](config[_0x2655('0x7b')],_0x2655('0x87'),_0x149a53[_0x2655('0x79')]);}}return _0x49bca3['download'](_0x2ab8d4);}})[_0x2655('0x57')](handleError(_0x49bca3,null));};exports['getSystemAvatar']=function(_0x3620d3,_0x36ffe9,_0x14c514){var _0x320054=path[_0x2655('0x82')](config['root'],_0x2655('0x8a'));var _0x2aaaab={'where':{'id':_0x3620d3[_0x2655('0x64')]['id']},'attributes':['id',_0x2655('0x8b')],'raw':!![]};return db['ChatWebsite'][_0x2655('0x5a')](_0x2aaaab)[_0x2655('0x35')](handleEntityNotFound(_0x36ffe9,null))[_0x2655('0x35')](function(_0x407a7c){if(_0x407a7c){if(!_[_0x2655('0x80')](_0x407a7c['systemAvatar'])){if(fs[_0x2655('0x81')](path[_0x2655('0x82')](config[_0x2655('0x7b')],_0x2655('0x87'),_0x407a7c[_0x2655('0x8b')]))){_0x320054=path[_0x2655('0x82')](config[_0x2655('0x7b')],'server/files/images/avatars/',_0x407a7c[_0x2655('0x8b')]);}}return _0x36ffe9[_0x2655('0x84')](_0x320054);}})[_0x2655('0x57')](handleError(_0x36ffe9,null));};exports[_0x2655('0x8c')]=function(_0x2e456b,_0x364a05,_0x26b453){var _0x4007eb=require(_0x2655('0x8d'));var _0x79ceb=new _0x4007eb();var _0x1a6654=_0x79ceb[_0x2655('0x8e')](_0x2e456b[_0x2655('0x8f')][_0x2655('0x90')])[_0x2655('0x91')]();var _0x2489db={'body':_0x2e456b[_0x2655('0x5c')],'channel':_0x2655('0x92')};var _0x593abe=[];var _0x15ed48=[];var _0x238175={};var _0x4e1878=![];return db[_0x2655('0x93')]['describe']()[_0x2655('0x35')](function(_0x2ace50){if(!_0x2ace50){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0x96'));}_0x593abe=_[_0x2655('0x97')](_['keys'](_0x2ace50),[_0x2655('0x98'),'updatedAt']);_0x15ed48=_[_0x2655('0x97')](_[_0x2655('0x40')](_0x2ace50),['createdAt',_0x2655('0x99'),_0x2655('0x9a'),'ListId']);if(_0x2e456b[_0x2655('0x5c')]['id']){delete _0x2e456b['body']['id'];}if(_[_0x2655('0x80')](_0x2e456b['body']['from'])){throw new db[(_0x2655('0x94'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x2e456b[_0x2655('0x5c')][_0x2655('0x5c')])||_0x2e456b[_0x2655('0x5c')][_0x2655('0x5c')]===''){throw new db['Sequelize'][(_0x2655('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2e456b[_0x2655('0x5c')]['mapKey'])){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0x9b')+_0x15ed48);}if(!_[_0x2655('0x9c')](_0x15ed48,_0x2e456b[_0x2655('0x5c')][_0x2655('0x9d')])){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0x9e')+_0x15ed48);}_0x238175[_0x2e456b[_0x2655('0x5c')][_0x2655('0x9d')]]=_0x2e456b['body']['from'];})[_0x2655('0x35')](function(){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x2e456b[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0x9f')],'as':'List','include':[{'model':db['CmContact'],'as':_0x2655('0xa0'),'where':_0x238175,'limit':0x1,'order':[[_0x2655('0x99'),_0x2655('0xa1')]]}]},{'model':db[_0x2655('0xa2')],'as':_0x2655('0xa3')}]});})['then'](handleEntityNotFound(_0x364a05,null))['then'](function(_0x164e5b){if(_0x164e5b&&_0x164e5b[_0x2655('0xa4')]){_0x2489db[_0x2655('0xa5')]=_0x164e5b;_0x2489db['applications']=_0x164e5b['Applications'];_0x2489db[_0x2655('0xa6')]=_0x164e5b[_0x2655('0xa4')];_0x2489db[_0x2655('0xa7')]=_[_0x2655('0xa8')](_0x2489db[_0x2655('0xa7')],[_0x2655('0xa9')],[_0x2655('0xaa')]);if(_0x2489db[_0x2655('0xa5')][_0x2655('0xa3')]){delete _0x2489db[_0x2655('0xa5')]['Applications'];}if(_0x2489db[_0x2655('0xa5')]['List']&&_0x2489db['account'][_0x2655('0xa4')][_0x2655('0xa0')][_0x2655('0x44')]){return _0x2489db['account'][_0x2655('0xa4')][_0x2655('0xa0')][0x0];}var _0x55c0be=_[_0x2655('0x19')](_0x2e456b['body'],{'firstName':_0x2e456b[_0x2655('0x5c')]['from'],'ListId':_0x164e5b[_0x2655('0xab')]});_0x55c0be[_0x2e456b['body'][_0x2655('0x9d')]]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xac')];return db['CmContact'][_0x2655('0x5b')](_0x55c0be,{'fields':_0x593abe,'raw':!![]});}})[_0x2655('0x35')](handleEntityNotFound(_0x364a05,null))['then'](function(_0x3e6fe9){_0x2489db['contact']=_0x3e6fe9;if(_0x3e6fe9){var _0x394c6c={'ContactId':_0x3e6fe9['id'],'ChatWebsiteId':_0x2e456b[_0x2655('0x64')]['id'],'from':(_0x3e6fe9[_0x2655('0xad')]||'')+'\x20'+(_0x3e6fe9[_0x2655('0xae')]||''),'customerIp':_0x2e456b[_0x2655('0x5c')][_0x2655('0xaf')],'referer':_0x2e456b['body'][_0x2655('0xb0')],'browserName':_0x1a6654[_0x2655('0xb1')][_0x2655('0x39')]&&_0x1a6654[_0x2655('0xb1')]['version']?util[_0x2655('0xb2')](_0x2655('0xb3'),_0x1a6654['browser'][_0x2655('0x39')],_0x1a6654[_0x2655('0xb1')][_0x2655('0xb4')]):_0x2655('0xb5'),'browserVersion':_0x1a6654['browser']['version']||_0x2655('0xb5'),'osName':util[_0x2655('0xb2')](_0x2655('0xb3'),_0x1a6654['os'][_0x2655('0x39')],_0x1a6654['os'][_0x2655('0xb4')]),'osVersion':_0x1a6654['os'][_0x2655('0xb4')],'deviceModel':_0x1a6654['device'][_0x2655('0x3e')]&&_0x1a6654[_0x2655('0xb6')][_0x2655('0xb7')]?util[_0x2655('0xb2')]('%s\x20%s\x20%s',_0x1a6654[_0x2655('0xb6')]['model'],_0x1a6654[_0x2655('0xb6')]['vendor'],_0x1a6654[_0x2655('0xb6')]['type']):null,'deviceVendor':_0x1a6654[_0x2655('0xb6')][_0x2655('0xb7')],'deviceType':_0x1a6654[_0x2655('0xb6')][_0x2655('0x4e')],'formData':JSON[_0x2655('0x29')](_0x2e456b[_0x2655('0x5c')])};var _0x270f72={'ChatWebsiteId':_0x2e456b[_0x2655('0x64')]['id'],'closed':![]};if(_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')]){_0x270f72[_0x2655('0xb8')]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')];return db[_0x2655('0xb9')][_0x2655('0x5a')]({'where':_0x270f72})[_0x2655('0x35')](function(_0xf1a2d3){if(_0xf1a2d3){return[_0xf1a2d3,![]];}_0x394c6c[_0x2655('0xb8')]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')];_0x394c6c[_0x2655('0xba')]=_0x2e456b['body'][_0x2655('0xba')];return db[_0x2655('0xb9')][_0x2655('0x5b')](_0x394c6c)[_0x2655('0x35')](function(_0x1668f1){return[_0x1668f1,!![]];});});}_0x270f72['ContactId']=_0x3e6fe9['id'];if(_0x2e456b[_0x2655('0x5c')]['interaction']&&_0x2e456b[_0x2655('0x5c')][_0x2655('0xbb')]['id']){_0x270f72['id']=_0x2e456b[_0x2655('0x5c')][_0x2655('0xbb')]['id'];return db[_0x2655('0xb9')][_0x2655('0x5a')]({'where':_0x270f72})['then'](function(_0x36cb8f){if(_0x36cb8f){return[_0x36cb8f,![]];}return db['ChatInteraction']['create'](_0x394c6c)[_0x2655('0x35')](function(_0x5558ec){return[_0x5558ec,!![]];});});}return db[_0x2655('0xb9')][_0x2655('0x5b')](_0x394c6c)['then'](function(_0x5bb872){return[_0x5bb872,!![]];});}})[_0x2655('0xbc')](function(_0x2b569,_0x3132e2){if(_0x2b569){_0x4e1878=_0x3132e2;if(!_0x3132e2){var _0x2a83d0={'from':(_0x2489db['contact'][_0x2655('0xad')]||'')+'\x20'+(_0x2489db[_0x2655('0xbd')]['lastName']||'')};if(_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')]&&_0x2e456b['body']['messageId']&&_0x2e456b[_0x2655('0x5c')][_0x2655('0xb8')]!=_0x2e456b[_0x2655('0x5c')]['messageId']){_0x2a83d0[_0x2655('0xb8')]=_0x2e456b[_0x2655('0x5c')][_0x2655('0xbe')];}return _0x2b569[_0x2655('0x33')](_0x2a83d0);}else{return _0x2b569;}}})[_0x2655('0x35')](function(_0x67918a){_0x2489db[_0x2655('0xbb')]=_0x67918a[_0x2655('0x5e')]({'plain':!![]});_0x2489db[_0x2655('0xbb')][_0x2655('0xbf')]=_0x4e1878;if(_0x2489db[_0x2655('0xbb')][_0x2655('0xbf')]){if(_0x2489db[_0x2655('0xa5')][_0x2655('0xc0')]){_0x2489db[_0x2655('0xa7')][_0x2655('0xc1')]({'id':0x0,'priority':_0x2489db[_0x2655('0xa7')][_0x2655('0x44')]+0x1,'app':_0x2655('0xc2'),'appdata':'unmanaged','interval':_0x2655('0xc3')});}}return db[_0x2655('0xc4')][_0x2655('0x5b')]({'body':_0x2e456b[_0x2655('0x5c')][_0x2655('0x5c')],'ChatWebsiteId':_0x2e456b[_0x2655('0x64')]['id'],'ChatInteractionId':_0x67918a['id'],'direction':'in','ContactId':_0x2489db[_0x2655('0xbd')]['id'],'AttachmentId':_0x2e456b[_0x2655('0x5c')][_0x2655('0xc5')]});})[_0x2655('0x35')](function(_0x3f17e8){_0x2489db[_0x2655('0x2b')]=_0x3f17e8;if(_0x2489db['interaction'][_0x2655('0xc6')]){return db[_0x2655('0xc7')][_0x2655('0x5a')]({'attributes':['id','name'],'where':{'id':_0x2489db['interaction'][_0x2655('0xc6')]}})[_0x2655('0x35')](function(_0x2dacb5){if(_0x2dacb5){_0x2489db[_0x2655('0xa7')]['unshift']({'id':0x0,'priority':0x0,'app':_0x2655('0xc8'),'appdata':_0x2dacb5[_0x2655('0x39')]+','+(_0x2489db[_0x2655('0xa5')][_0x2655('0xc9')]||0xa),'interval':_0x2655('0xc3')});_0x2489db['forcedOwnership']=!![];}return respondWithRpcPromise(_0x2655('0xca'),_0x2655('0xcb'),_0x2489db);});}return respondWithRpcPromise('Start',_0x2655('0xcb'),_0x2489db);})['then'](function(_0x21533f){respondWithRpcPromise('EventManager',_0x2655('0xcc'),{'event':'notify','message':_0x21533f},client9002);return _0x21533f;})[_0x2655('0x35')](respondWithResult(_0x364a05,null))['catch'](handleError(_0x364a05,null));};exports['offline']=function(_0xefe137,_0x54aafb,_0x105651){var _0x5ac616,_0x532281,_0x4acc07;var _0x1b3cd6=[];var _0x21b627=[];var _0x37d840={};return db[_0x2655('0x93')][_0x2655('0x65')]()[_0x2655('0x35')](function(_0x26e10f){if(!_0x26e10f){throw new db[(_0x2655('0x94'))][(_0x2655('0x95'))]('no\x20available\x20attributes');}_0x21b627=_[_0x2655('0x97')](_['keys'](_0x26e10f),[_0x2655('0x98'),_0x2655('0x99')]);_0x1b3cd6=_[_0x2655('0x97')](_['keys'](_0x26e10f),['createdAt',_0x2655('0x99'),_0x2655('0x9a'),_0x2655('0xab')]);if(_0xefe137[_0x2655('0x5c')]['id']){delete _0xefe137[_0x2655('0x5c')]['id'];}if(_[_0x2655('0x80')](_0xefe137[_0x2655('0x5c')][_0x2655('0xac')])){throw _0x54aafb[_0x2655('0x2d')](0x1f4)[_0x2655('0x3a')](new db[(_0x2655('0x94'))]['ValidationError']('from\x20is\x20mandatory'));}if(_['isNil'](_0xefe137[_0x2655('0x5c')]['body'])||_0xefe137[_0x2655('0x5c')][_0x2655('0x5c')]===''){throw _0x54aafb[_0x2655('0x2d')](0x1f4)[_0x2655('0x3a')](new db[(_0x2655('0x94'))][(_0x2655('0x95'))](_0x2655('0xcd')));}if(_[_0x2655('0x80')](_0xefe137[_0x2655('0x5c')][_0x2655('0xce')])){throw _0x54aafb['status'](0x1f4)['send'](new db[(_0x2655('0x94'))]['ValidationError'](_0x2655('0xcf')+_0x1b3cd6));}if(!_['includes'](_0x1b3cd6,_0xefe137[_0x2655('0x5c')][_0x2655('0xce')])){throw _0x54aafb[_0x2655('0x2d')](0x1f4)[_0x2655('0x3a')](new db[(_0x2655('0x94'))]['ValidationError'](_0x2655('0xd0')+_0x1b3cd6));}_0x37d840[_0xefe137[_0x2655('0x5c')][_0x2655('0xce')]]=_0xefe137['body'][_0x2655('0xac')];})['then'](function(){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0xefe137[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0x9f')],'as':_0x2655('0xa4')}]});})[_0x2655('0x35')](handleEntityNotFound(_0x54aafb,null))[_0x2655('0x35')](function(_0xbcffce){if(_0xbcffce&&_0xbcffce[_0x2655('0xa4')]){_0x532281=_0xbcffce;var _0x25a087=_['defaults'](_0xefe137[_0x2655('0x5c')],{'firstName':_0xefe137[_0x2655('0x5c')][_0x2655('0xac')],'phone':_0xefe137['body'][_0x2655('0xac')],'ListId':_0xbcffce['ListId']});_0x25a087[_0xefe137['body'][_0x2655('0xce')]]=_0xefe137[_0x2655('0x5c')]['from'];return db[_0x2655('0x93')][_0x2655('0xd1')]({'where':_0x37d840,'defaults':_0x25a087});}})[_0x2655('0xbc')](function(_0x53bce1){if(_0x53bce1){_0x4acc07=_0x53bce1;var _0xd07d21=fs['readFileSync'](path[_0x2655('0x82')](config['root'],_0x2655('0xd2')),_0x2655('0xd3'));var _0x3b7c67=ejs[_0x2655('0xd4')](_0xd07d21,{'body':_[_0x2655('0xd5')](_0xefe137[_0x2655('0x5c')]['body']),'bodyTitle':_0x532281[_0x2655('0xd6')]});return db['ChatOfflineMessage'][_0x2655('0x5b')]({'body':_0x3b7c67,'ContactId':_0x53bce1['id'],'ChatWebsiteId':_0x532281['id']});}})['then'](function(_0x1b8ad2){if(_0x1b8ad2){_0x5ac616=_0x1b8ad2;return db[_0x2655('0xd7')][_0x2655('0x6a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x2655('0xd8'),'raw':!![]}]});}})[_0x2655('0x35')](function(_0x5bb43e){if(_0x5bb43e&&_0x5bb43e['Smtp']&&_0x532281[_0x2655('0xd9')]){var _0x434163={'tls':{'rejectUnauthorized':![]}};if(_0x5bb43e[_0x2655('0xd8')][_0x2655('0xda')]){_0x434163['service']=_0x5bb43e['Smtp']['service'];}else{_0x434163[_0x2655('0xdb')]=_0x5bb43e['Smtp']['host'];_0x434163[_0x2655('0xdc')]=_0x5bb43e['Smtp']['port'];_0x434163['secure']=_0x5bb43e[_0x2655('0xd8')][_0x2655('0xdd')];}if(_0x5bb43e[_0x2655('0xd8')]['authentication']){_0x434163[_0x2655('0xde')]={'user':_0x5bb43e[_0x2655('0xd8')][_0x2655('0x5d')],'pass':_0x5bb43e[_0x2655('0xd8')][_0x2655('0xdf')]};}return respondWithRpcPromise(_0x2655('0xe0'),_0x2655('0xe1'),{'account':_0x434163,'message':{'from':util[_0x2655('0xb2')]('\x22%s\x22\x20<%s>',_0x5bb43e['name'],_0x5bb43e[_0x2655('0xe2')]||_0x5bb43e[_0x2655('0xd8')]['user']),'to':_0x532281[_0x2655('0xd9')],'subject':_0x532281[_0x2655('0xe3')],'text':_0x5ac616['body']}},client9003)[_0x2655('0x35')](function(){return _0x5ac616;})[_0x2655('0x57')](function(_0x18c407){console[_0x2655('0x2a')](_0x18c407);});}})[_0x2655('0x35')](function(){if(_0x5ac616){return _0x5ac616;}})[_0x2655('0x35')](respondWithResult(_0x54aafb,null))['catch'](handleError(_0x54aafb,null));};exports[_0x2655('0xe4')]=function(_0x2e35d9,_0x3ec5c1,_0x4dd5b8){return db[_0x2655('0xb9')][_0x2655('0x5a')]({'where':{'id':_0x2e35d9[_0x2655('0x64')]['id']}})['then'](handleEntityNotFound(_0x3ec5c1,null))['then'](function(_0x2c8342){if(_0x2c8342){return _0x2c8342[_0x2655('0xe4')](_0x2e35d9[_0x2655('0x5c')]['ids'],_[_0x2655('0xe5')](_0x2e35d9['body'],['ids','id'])||{});}})[_0x2655('0x35')](respondWithResult(_0x3ec5c1,null))[_0x2655('0x57')](handleError(_0x3ec5c1,null));};exports['getInteractions']=function(_0xbe1d43,_0x27f5a0,_0x263aa4){var _0x280dc6={'raw':![],'where':{}};var _0x5c7f30={};var _0x20269e={'count':0x0,'rows':[]};return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0xbe1d43[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x27f5a0,null))[_0x2655('0x35')](function(_0x491dce){if(_0x491dce){_0x5c7f30[_0x2655('0x3e')]=_['keys'](db[_0x2655('0xb9')][_0x2655('0x6b')]);_0x5c7f30['query']=_[_0x2655('0x40')](_0xbe1d43[_0x2655('0x3f')]);_0x5c7f30[_0x2655('0x41')]=_[_0x2655('0x42')](_0x5c7f30['model'],_0x5c7f30[_0x2655('0x3f')]);_0x280dc6[_0x2655('0x43')]=_[_0x2655('0x42')](_0x5c7f30[_0x2655('0x3e')],qs[_0x2655('0x59')](_0xbe1d43[_0x2655('0x3f')]['fields']));_0x280dc6[_0x2655('0x43')]=_0x280dc6['attributes'][_0x2655('0x44')]?_0x280dc6[_0x2655('0x43')]:_0x5c7f30['model'];if(!_0xbe1d43[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x280dc6[_0x2655('0x47')]=qs[_0x2655('0x47')](_0xbe1d43[_0x2655('0x3f')][_0x2655('0x47')]);_0x280dc6[_0x2655('0x2f')]=qs['offset'](_0xbe1d43[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x280dc6[_0x2655('0x6c')]=qs[_0x2655('0x48')](_0xbe1d43['query'][_0x2655('0x48')]);_0x280dc6[_0x2655('0x4b')]=qs[_0x2655('0x41')](_['pick'](_0xbe1d43['query'],_0x5c7f30[_0x2655('0x41')]));_0x280dc6[_0x2655('0x4b')][_0x2655('0x67')]=_0x491dce['id'];if(_0xbe1d43[_0x2655('0x3f')][_0x2655('0x4a')]){_0x280dc6['where']=_[_0x2655('0x4c')](_0x280dc6['where'],{'$or':_[_0x2655('0x4d')](_0x280dc6[_0x2655('0x43')],function(_0x3495ca){var _0x45bb99={};_0x45bb99[_0x3495ca]={'$like':'%'+_0xbe1d43['query'][_0x2655('0x4a')]+'%'};return _0x45bb99;})});}_0x280dc6=_[_0x2655('0x4c')]({},_0x280dc6,_0xbe1d43[_0x2655('0x51')]);return db[_0x2655('0xb9')][_0x2655('0x52')]({'where':_0x280dc6[_0x2655('0x4b')]})[_0x2655('0x35')](function(_0x483953){_0x20269e[_0x2655('0x52')]=_0x483953;if(_0xbe1d43[_0x2655('0x3f')][_0x2655('0x53')]){_0x280dc6[_0x2655('0x54')]=[{'model':db[_0x2655('0x93')],'as':'Contact','required':![]},{'model':db[_0x2655('0xc7')],'as':'Owner','attributes':[_0x2655('0x39'),_0x2655('0xe6'),'internal'],'required':![]},{'model':db[_0x2655('0xe7')],'as':_0x2655('0xe8'),'attributes':['id',_0x2655('0x39'),_0x2655('0xe9')],'where':_0xbe1d43[_0x2655('0x3f')]['tag']?{'id':_0xbe1d43[_0x2655('0x3f')][_0x2655('0xea')]}:undefined,'required':_0xbe1d43[_0x2655('0x3f')][_0x2655('0xea')]?!![]:![]}];}return db[_0x2655('0xb9')][_0x2655('0x55')](_0x280dc6);})[_0x2655('0x35')](function(_0xcf27dd){_0x20269e[_0x2655('0x56')]=_0xcf27dd;return _0x20269e;});}})[_0x2655('0x35')](respondWithFilteredResult(_0x27f5a0,_0x280dc6))['catch'](handleError(_0x27f5a0,null));};function iftimePromise(_0x2de914,_0x17c49a){return respondWithRpcPromise(_0x2655('0xeb'),_0x2655('0xec'),{'command':_0x17c49a[_0x2655('0xed')]?util[_0x2655('0xb2')](_0x2655('0xee'),_0x2de914[_0x2655('0xef')],_0x17c49a[_0x2655('0xed')]):util['format'](_0x2655('0xf0'),_0x2de914[_0x2655('0xef')])},client9002)['then'](function(_0x59b88c){var _0x856e2b=_0x59b88c&&_0x59b88c['indexOf'](_0x2655('0xf1'))>=0x0?!![]:![];logger[_0x2655('0x24')](_0x2655('0xf2'),_0x17c49a['id'],_0x2de914['id'],_0x2de914['interval'],_0x856e2b?_0x2655('0xf3'):_0x2655('0xf4'),_0x17c49a['timezone']?_0x17c49a[_0x2655('0xed')]:_0x2655('0xf5'));return _0x856e2b;})[_0x2655('0x57')](function(_0x787721){logger['error'](_0x2655('0xf2'),_0x17c49a['id'],_0x2de914['id'],_0x2de914['interval'],util[_0x2655('0xf6')](_0x787721,{'showHidden':![],'depth':null}),_0x17c49a[_0x2655('0xed')]?_0x17c49a[_0x2655('0xed')]:_0x2655('0xf5'));return![];});}exports[_0x2655('0xec')]=function(_0x1ea8c4,_0x1056ba,_0x1317d7){var _0x387699=0x0;var _0x44f537=0x0;var _0x499b84=![];var _0x19bd50;var _0x28393b;return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x1ea8c4[_0x2655('0x64')]['id']},'include':[{'model':db[_0x2655('0xf7')],'as':'Interval','include':[{'model':db[_0x2655('0xf7')],'as':_0x2655('0xf8'),'attributes':['id',_0x2655('0xef')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x1056ba,null))[_0x2655('0x35')](function(_0x3ef0f0){if(_0x3ef0f0){_0x19bd50=_0x3ef0f0;return _0x3ef0f0[_0x2655('0xf9')]({'raw':!![]});}})[_0x2655('0x35')](function(_0x24eb53){if(_0x19bd50){if(_0x24eb53){_0x28393b=_0x24eb53;}}return require(_0x2655('0x7d'))[_0x2655('0x7e')]();})['then'](function(_0x1be665){if(_0x1be665){_0x44f537=_0x1be665[_0x2655('0xfa')];_0x499b84=_0x1be665['custom'];}})[_0x2655('0x35')](function(){return db[_0x2655('0xb9')]['count']({'where':{'closed':![]}});})[_0x2655('0x35')](function(_0x26f62f){_0x387699=_0x26f62f;if(_0x44f537&&_0x26f62f>_0x44f537){return db[_0x2655('0xfb')]['findOne']({'where':{'id':0x1}})[_0x2655('0x35')](function(_0x2595a4){if(_0x2595a4){_0x2595a4[_0x2655('0xfc')](_0x2655('0xfd'));}});}})[_0x2655('0x35')](function(){if(_0x19bd50[_0x2655('0xf7')]&&_0x19bd50['Interval'][_0x2655('0xf8')]){var _0x4821b4=[];for(var _0x3c5087=0x0;_0x3c5087<_0x19bd50['Interval'][_0x2655('0xf8')][_0x2655('0x44')];_0x3c5087++){var _0x4c4406=_0x19bd50['Interval'][_0x2655('0xf8')][_0x3c5087][_0x2655('0x5e')]({'plain':!![]});_0x4821b4[_0x2655('0xc1')](iftimePromise(_0x4c4406,_0x19bd50));}return BPromise[_0x2655('0xfe')](_0x4821b4)[_0x2655('0x35')](function(_0x587ba0){return _[_0x2655('0xff')](_0x587ba0);});}else{return!![];}})[_0x2655('0x35')](function(_0x5ddc0b){var _0x51cca6=fs['readFileSync'](path[_0x2655('0x82')](config['root'],_0x2655('0x100')),_0x2655('0xd3'));var _0x4620c9={'remote':_0x19bd50[_0x2655('0x101')],'query':querystring[_0x2655('0x29')](_[_0x2655('0x4c')](_0x19bd50[_0x2655('0x5e')]({'plain':!![]}),{'customerIp':_0x1ea8c4[_0x2655('0x8f')]['x-forwarded-for']||_0x1ea8c4['headers']['x-real-ip']||_0x1ea8c4[_0x2655('0x102')][_0x2655('0x103')]||_0x1ea8c4['ip'],'referer':_0x1ea8c4[_0x2655('0x8f')]['referer'],'openedInteractions':_0x387699,'maxInteractions':_0x44f537,'virtual':_0x499b84[_0x2655('0xfa')],'online':_0x5ddc0b,'custom':_0x499b84}))[_0x2655('0x104')](/'/g,'\x5c\x27')};_0x1056ba[_0x2655('0x3a')](ejs['render'](Mustache[_0x2655('0xd4')](_0x51cca6,_0x4620c9),{'proactiveActions':_0x28393b,'alignment':_0x19bd50[_0x2655('0x105')],'verticalAlignment':_0x19bd50[_0x2655('0x106')]}));})[_0x2655('0x57')](handleError(_0x1056ba,null));};exports[_0x2655('0x107')]=function(_0x5b5e22,_0x88d4dd,_0x53cb82){return db['ChatWebsite'][_0x2655('0x6a')]({'where':{'id':_0x5b5e22[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x88d4dd,null))['then'](function(_0x20f940){if(_0x20f940){return db['sequelize']['transaction'](function(_0x50c358){return db['ChatApplication']['destroy']({'where':{'ChatWebsiteId':_0x5b5e22[_0x2655('0x64')]['id']},'transaction':_0x50c358})[_0x2655('0x35')](function(_0x23e8b2){var _0x4aaf6d=_[_0x2655('0x4d')](_0x5b5e22['body'],function(_0x15ec3e){_0x15ec3e[_0x2655('0x67')]=_0x5b5e22[_0x2655('0x64')]['id'];return _0x15ec3e;});return db[_0x2655('0xa2')][_0x2655('0x108')](_0x4aaf6d,{'transaction':_0x50c358});});})[_0x2655('0x35')](function(){return db[_0x2655('0xa2')][_0x2655('0x109')]({'where':{'ChatWebsiteId':_0x5b5e22['params']['id']},'order':_0x2655('0xa9')});});}})['then'](respondWithResult(_0x88d4dd,null))[_0x2655('0x57')](handleError(_0x88d4dd,null));};exports[_0x2655('0x10a')]=function(_0x401840,_0x272826,_0x4ec181){var _0x345ab2={};var _0x32f9cb={};var _0xc0c9e5;var _0x32b663;return db['ChatWebsite']['findOne']({'where':{'id':_0x401840['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x272826,null))[_0x2655('0x35')](function(_0x109d9a){if(_0x109d9a){_0xc0c9e5=_0x109d9a;_0x32f9cb['model']=_[_0x2655('0x40')](db[_0x2655('0xa2')][_0x2655('0x6b')]);_0x32f9cb[_0x2655('0x3f')]=_['keys'](_0x401840[_0x2655('0x3f')]);_0x32f9cb['filters']=_[_0x2655('0x42')](_0x32f9cb['model'],_0x32f9cb[_0x2655('0x3f')]);_0x345ab2[_0x2655('0x43')]=_[_0x2655('0x42')](_0x32f9cb[_0x2655('0x3e')],qs['fields'](_0x401840[_0x2655('0x3f')][_0x2655('0x59')]));_0x345ab2[_0x2655('0x43')]=_0x345ab2['attributes'][_0x2655('0x44')]?_0x345ab2['attributes']:_0x32f9cb['model'];_0x345ab2['order']=qs['sort'](_0x401840[_0x2655('0x3f')][_0x2655('0x48')]);_0x345ab2[_0x2655('0x4b')]=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x401840[_0x2655('0x3f')],_0x32f9cb[_0x2655('0x41')]));if(_0x401840[_0x2655('0x3f')][_0x2655('0x4a')]){_0x345ab2[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x345ab2[_0x2655('0x4b')],{'$or':_['map'](_0x345ab2[_0x2655('0x43')],function(_0x30313c){var _0x130118={};_0x130118[_0x30313c]={'$like':'%'+_0x401840[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x130118;})});}_0x345ab2=_[_0x2655('0x4c')]({},_0x345ab2,_0x401840[_0x2655('0x51')]);return _0xc0c9e5['getApplications'](_0x345ab2);}})['then'](function(_0x5ce549){if(_0x5ce549){_0x32b663=_0x5ce549[_0x2655('0x44')];if(!_0x401840[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x345ab2[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x401840[_0x2655('0x3f')][_0x2655('0x47')]);_0x345ab2['offset']=qs[_0x2655('0x2f')](_0x401840[_0x2655('0x3f')][_0x2655('0x2f')]);}return _0xc0c9e5[_0x2655('0x10a')](_0x345ab2);}})[_0x2655('0x35')](function(_0x5bbbfa){if(_0x5bbbfa){return _0x5bbbfa?{'count':_0x32b663,'rows':_0x5bbbfa}:null;}})[_0x2655('0x35')](respondWithResult(_0x272826,null))[_0x2655('0x57')](handleError(_0x272826,null));};exports[_0x2655('0x10b')]=function(_0x2a87d5,_0x114805,_0x171aea){return db[_0x2655('0x10c')][_0x2655('0x5a')]({'where':{'id':_0x2a87d5[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x114805,null))['then'](function(_0x19ca0e){if(_0x19ca0e){return _0x19ca0e[_0x2655('0x10b')](_0x2a87d5[_0x2655('0x5c')]['ids'],_[_0x2655('0xe5')](_0x2a87d5[_0x2655('0x5c')],['ids','id'])||{});}})[_0x2655('0x35')](respondWithResult(_0x114805,null))[_0x2655('0x57')](handleError(_0x114805,null));};exports[_0x2655('0xf9')]=function(_0x58beec,_0x249d89,_0xa2853f){var _0x3c9ad4={};var _0x2c3b3b={};var _0x41032f;var _0x3975f9;return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0x58beec[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x249d89,null))[_0x2655('0x35')](function(_0x59206d){if(_0x59206d){_0x41032f=_0x59206d;_0x2c3b3b[_0x2655('0x3e')]=_[_0x2655('0x40')](db[_0x2655('0x10d')][_0x2655('0x6b')]);_0x2c3b3b['query']=_[_0x2655('0x40')](_0x58beec[_0x2655('0x3f')]);_0x2c3b3b[_0x2655('0x41')]=_[_0x2655('0x42')](_0x2c3b3b[_0x2655('0x3e')],_0x2c3b3b[_0x2655('0x3f')]);_0x3c9ad4[_0x2655('0x43')]=_['intersection'](_0x2c3b3b[_0x2655('0x3e')],qs[_0x2655('0x59')](_0x58beec['query'][_0x2655('0x59')]));_0x3c9ad4[_0x2655('0x43')]=_0x3c9ad4['attributes'][_0x2655('0x44')]?_0x3c9ad4[_0x2655('0x43')]:_0x2c3b3b[_0x2655('0x3e')];_0x3c9ad4['order']=qs[_0x2655('0x48')](_0x58beec[_0x2655('0x3f')][_0x2655('0x48')]);_0x3c9ad4[_0x2655('0x4b')]=qs[_0x2655('0x41')](_['pick'](_0x58beec[_0x2655('0x3f')],_0x2c3b3b[_0x2655('0x41')]));if(_0x58beec['query']['filter']){_0x3c9ad4['where']=_[_0x2655('0x4c')](_0x3c9ad4[_0x2655('0x4b')],{'$or':_['map'](_0x3c9ad4['attributes'],function(_0x3d7f8a){var _0x1a6c34={};_0x1a6c34[_0x3d7f8a]={'$like':'%'+_0x58beec[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x1a6c34;})});}_0x3c9ad4=_[_0x2655('0x4c')]({},_0x3c9ad4,_0x58beec[_0x2655('0x51')]);return _0x41032f['getProactiveActions'](_0x3c9ad4);}})[_0x2655('0x35')](function(_0x17efbd){if(_0x17efbd){_0x3975f9=_0x17efbd[_0x2655('0x44')];if(!_0x58beec[_0x2655('0x3f')][_0x2655('0x45')]('nolimit')){_0x3c9ad4['limit']=qs[_0x2655('0x47')](_0x58beec[_0x2655('0x3f')]['limit']);_0x3c9ad4[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x58beec[_0x2655('0x3f')][_0x2655('0x2f')]);}return _0x41032f['getProactiveActions'](_0x3c9ad4);}})[_0x2655('0x35')](function(_0x2ec517){if(_0x2ec517){return _0x2ec517?{'count':_0x3975f9,'rows':_0x2ec517}:null;}})[_0x2655('0x35')](respondWithResult(_0x249d89,null))[_0x2655('0x57')](handleError(_0x249d89,null));};exports[_0x2655('0x10e')]=function(_0x3314b9,_0x524d24,_0x49e7ae){var _0x594795=_0x3314b9[_0x2655('0x3f')][_0x2655('0x10f')]===_0x2655('0x110')?_0x2655('0x111'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x594795],'where':{'id':_0x3314b9[_0x2655('0x64')]['id']}})['then'](handleEntityNotFound(_0x524d24,null))['then'](function(_0x70e09){if(_0x70e09){var _0x21f747=_0x70e09[_0x594795];var _0x2d9525=_0x21f747&&_0x21f747[_0x2655('0x112')]?_0x21f747[_0x2655('0x112')]:[];_0x524d24[_0x2655('0x3a')]({'fromKey':_[_0x2655('0x80')](_0x21f747['fromKey'])?undefined:_0x21f747[_0x2655('0x113')],'count':_0x2d9525[_0x2655('0x44')],'rows':_0x2d9525});}})[_0x2655('0x57')](handleError(_0x524d24,null));};exports['getOfflineMessages']=function(_0x2b8e83,_0x17a2ba,_0xf42b04){var _0x23f6c7={'raw':!![],'where':{}};var _0x5be4c3={};var _0xd49fda={'count':0x0,'rows':[]};return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0x2b8e83[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x17a2ba,null))[_0x2655('0x35')](function(_0x3d0847){if(_0x3d0847){_0x5be4c3[_0x2655('0x3e')]=_[_0x2655('0x40')](db[_0x2655('0x114')]['rawAttributes']);_0x5be4c3['query']=_['keys'](_0x2b8e83['query']);_0x5be4c3[_0x2655('0x41')]=_['intersection'](_0x5be4c3[_0x2655('0x3e')],_0x5be4c3[_0x2655('0x3f')]);_0x23f6c7[_0x2655('0x43')]=_[_0x2655('0x42')](_0x5be4c3[_0x2655('0x3e')],qs[_0x2655('0x59')](_0x2b8e83[_0x2655('0x3f')][_0x2655('0x59')]));_0x23f6c7[_0x2655('0x43')]=_0x23f6c7[_0x2655('0x43')][_0x2655('0x44')]?_0x23f6c7['attributes']:_0x5be4c3[_0x2655('0x3e')];if(!_0x2b8e83[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x23f6c7[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x2b8e83['query'][_0x2655('0x47')]);_0x23f6c7[_0x2655('0x2f')]=qs[_0x2655('0x2f')](_0x2b8e83[_0x2655('0x3f')][_0x2655('0x2f')]);}_0x23f6c7['order']=qs[_0x2655('0x48')](_0x2b8e83[_0x2655('0x3f')][_0x2655('0x48')]);_0x23f6c7[_0x2655('0x4b')]=qs[_0x2655('0x41')](_['pick'](_0x2b8e83[_0x2655('0x3f')],_0x5be4c3[_0x2655('0x41')]));_0x23f6c7[_0x2655('0x4b')][_0x2655('0x67')]=_0x3d0847['id'];if(_0x2b8e83[_0x2655('0x3f')]['filter']){_0x23f6c7[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x23f6c7[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x23f6c7[_0x2655('0x43')],function(_0x159f8d){var _0x2754e8={};_0x2754e8[_0x159f8d]={'$like':'%'+_0x2b8e83[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x2754e8;})});}_0x23f6c7=_[_0x2655('0x4c')]({},_0x23f6c7,_0x2b8e83['options']);return db['ChatOfflineMessage'][_0x2655('0x52')]({'where':_0x23f6c7[_0x2655('0x4b')]})[_0x2655('0x35')](function(_0x5426ff){_0xd49fda[_0x2655('0x52')]=_0x5426ff;if(_0x2b8e83[_0x2655('0x3f')][_0x2655('0x53')]){_0x23f6c7[_0x2655('0x54')]=[{'all':!![]}];}return db[_0x2655('0x114')]['findAll'](_0x23f6c7);})['then'](function(_0x25c5e1){_0xd49fda[_0x2655('0x56')]=_0x25c5e1;return _0xd49fda;});}})[_0x2655('0x35')](respondWithFilteredResult(_0x17a2ba,_0x23f6c7))[_0x2655('0x57')](handleError(_0x17a2ba,null));};exports[_0x2655('0x115')]=function(_0x38d541,_0x32f03c,_0x4a54a0){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x38d541['params']['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x32f03c,null))[_0x2655('0x35')](function(_0x5a2173){if(_0x5a2173){return _0x5a2173[_0x2655('0x115')](_0x38d541[_0x2655('0x5c')][_0x2655('0x6e')],_['omit'](_0x38d541[_0x2655('0x5c')],[_0x2655('0x6e'),'id'])||{})['spread'](function(_0x27bd3b){for(var _0x2774a6=0x0;_0x2774a6<_0x38d541[_0x2655('0x5c')][_0x2655('0x6e')][_0x2655('0x44')];_0x2774a6+=0x1){socket[_0x2655('0x116')](_0x2655('0x117'),{'UserId':_0x38d541[_0x2655('0x5c')]['ids'][_0x2774a6],'ChatWebsiteId':_0x38d541[_0x2655('0x64')]['id']});}return _0x27bd3b;});}})[_0x2655('0x35')](respondWithResult(_0x32f03c,null))[_0x2655('0x57')](handleError(_0x32f03c,null));};exports['removeAgents']=function(_0x137524,_0x599503,_0x569009){return db[_0x2655('0x3d')][_0x2655('0x5a')]({'where':{'id':_0x137524[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x599503,null))[_0x2655('0x35')](function(_0x34acbe){if(_0x34acbe){return _0x34acbe['removeAgents'](_0x137524[_0x2655('0x3f')][_0x2655('0x6e')])[_0x2655('0x35')](function(){if(_['isArray'](_0x137524['query'][_0x2655('0x6e')])){for(var _0x5ec667=0x0;_0x5ec667<_0x137524[_0x2655('0x3f')][_0x2655('0x6e')]['length'];_0x5ec667+=0x1){socket[_0x2655('0x116')]('userChatWebsite:remove',{'UserId':Number(_0x137524[_0x2655('0x3f')][_0x2655('0x6e')][_0x5ec667]),'ChatWebsiteId':Number(_0x137524[_0x2655('0x64')]['id'])});}}else{socket[_0x2655('0x116')](_0x2655('0x118'),{'UserId':Number(_0x137524[_0x2655('0x3f')]['ids']),'ChatWebsiteId':Number(_0x137524['params']['id'])});}});}})[_0x2655('0x35')](respondWithStatusCode(_0x599503,null))['catch'](handleError(_0x599503,null));};exports[_0x2655('0x119')]=function(_0x4001c3,_0x698ac5,_0x2cff86){var _0x53db1e={};var _0x21a8db={};var _0x19194f;var _0x4274ce;return db[_0x2655('0x3d')][_0x2655('0x6a')]({'where':{'id':_0x4001c3[_0x2655('0x64')]['id']}})[_0x2655('0x35')](handleEntityNotFound(_0x698ac5,null))['then'](function(_0x31b30e){if(_0x31b30e){_0x19194f=_0x31b30e;_0x21a8db[_0x2655('0x3e')]=_['keys'](db[_0x2655('0xc7')]['rawAttributes']);_0x21a8db['query']=_[_0x2655('0x40')](_0x4001c3['query']);_0x21a8db[_0x2655('0x41')]=_[_0x2655('0x42')](_0x21a8db[_0x2655('0x3e')],_0x21a8db[_0x2655('0x3f')]);_0x53db1e[_0x2655('0x43')]=_[_0x2655('0x42')](_0x21a8db[_0x2655('0x3e')],qs['fields'](_0x4001c3[_0x2655('0x3f')]['fields']));_0x53db1e[_0x2655('0x43')]=_0x53db1e['attributes'][_0x2655('0x44')]?_0x53db1e[_0x2655('0x43')]:_0x21a8db[_0x2655('0x3e')];_0x53db1e[_0x2655('0x6c')]=qs[_0x2655('0x48')](_0x4001c3[_0x2655('0x3f')]['sort']);_0x53db1e[_0x2655('0x4b')]=qs[_0x2655('0x41')](_[_0x2655('0x49')](_0x4001c3[_0x2655('0x3f')],_0x21a8db[_0x2655('0x41')]));if(_0x4001c3[_0x2655('0x3f')][_0x2655('0x4a')]){_0x53db1e[_0x2655('0x4b')]=_[_0x2655('0x4c')](_0x53db1e[_0x2655('0x4b')],{'$or':_[_0x2655('0x4d')](_0x53db1e['attributes'],function(_0x34e8f8){var _0x2cff7c={};_0x2cff7c[_0x34e8f8]={'$like':'%'+_0x4001c3[_0x2655('0x3f')][_0x2655('0x4a')]+'%'};return _0x2cff7c;})});}_0x53db1e=_['merge']({},_0x53db1e,_0x4001c3['options']);return _0x19194f['getAgents'](_0x53db1e);}})[_0x2655('0x35')](function(_0x3d8276){if(_0x3d8276){_0x4274ce=_0x3d8276[_0x2655('0x44')];if(!_0x4001c3[_0x2655('0x3f')][_0x2655('0x45')](_0x2655('0x46'))){_0x53db1e[_0x2655('0x47')]=qs[_0x2655('0x47')](_0x4001c3[_0x2655('0x3f')]['limit']);_0x53db1e['offset']=qs[_0x2655('0x2f')](_0x4001c3[_0x2655('0x3f')][_0x2655('0x2f')]);}return _0x19194f[_0x2655('0x119')](_0x53db1e);}})['then'](function(_0x20d439){if(_0x20d439){return _0x20d439?{'count':_0x4274ce,'rows':_0x20d439}:null;}})['then'](respondWithResult(_0x698ac5,null))[_0x2655('0x57')](handleError(_0x698ac5,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index bff1db6..01b2e1d 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 _0x522b=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','remove'];(function(_0x2b1c65,_0x40abdc){var _0x534692=function(_0x31ee6d){while(--_0x31ee6d){_0x2b1c65['push'](_0x2b1c65['shift']());}};_0x534692(++_0x40abdc);}(_0x522b,0x1c3));var _0xb522=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x522b[_0xdeefbd];return _0x4ff63f;};'use strict';var EventEmitter=require(_0xb522('0x0'));var ChatWebsite=require(_0xb522('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb522('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb522('0x3')};function emitEvent(_0x44d216){return function(_0x52cd65,_0x335c92,_0x26f31f){ChatWebsiteEvents[_0xb522('0x4')](_0x44d216+':'+_0x52cd65['id'],_0x52cd65);ChatWebsiteEvents[_0xb522('0x4')](_0x44d216,_0x52cd65);_0x26f31f(null);};}for(var e in events){if(events[_0xb522('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xb522('0x6')]=ChatWebsiteEvents; \ No newline at end of file +var _0x7f3f=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x526437,_0x22b116){var _0x7bc2f7=function(_0x4c56cc){while(--_0x4c56cc){_0x526437['push'](_0x526437['shift']());}};_0x7bc2f7(++_0x22b116);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x388914,_0x3c63f9){_0x388914=_0x388914-0x0;var _0x1f9111=_0x7f3f[_0x388914];return _0x1f9111;};'use strict';var EventEmitter=require(_0xf7f3('0x0'));var ChatWebsite=require(_0xf7f3('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf7f3('0x2')](0x0);var events={'afterCreate':_0xf7f3('0x3'),'afterUpdate':_0xf7f3('0x4'),'afterDestroy':_0xf7f3('0x5')};function emitEvent(_0x227ad2){return function(_0x4b4dbb,_0x19374c,_0xd8190d){ChatWebsiteEvents['emit'](_0x227ad2+':'+_0x4b4dbb['id'],_0x4b4dbb);ChatWebsiteEvents[_0xf7f3('0x6')](_0x227ad2,_0x4b4dbb);_0xd8190d(null);};}for(var e in events){if(events[_0xf7f3('0x7')](e)){var event=events[e];ChatWebsite[_0xf7f3('0x8')](e,emitEvent(event));}}module[_0xf7f3('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 1a36883..0d5212a 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 _0xe939=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x12e3e3,_0x501eaf){var _0x26602e=function(_0x427882){while(--_0x427882){_0x12e3e3['push'](_0x12e3e3['shift']());}};_0x26602e(++_0x501eaf);}(_0xe939,0xda));var _0x9e93=function(_0x1ffdb4,_0xe54dd9){_0x1ffdb4=_0x1ffdb4-0x0;var _0x1c05ee=_0xe939[_0x1ffdb4];return _0x1c05ee;};'use strict';var _=require(_0x9e93('0x0'));var util=require(_0x9e93('0x1'));var logger=require(_0x9e93('0x2'))(_0x9e93('0x3'));var moment=require(_0x9e93('0x4'));var BPromise=require(_0x9e93('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e93('0x6'));var rimraf=require(_0x9e93('0x7'));var config=require(_0x9e93('0x8'));var attributes=require(_0x9e93('0x9'));module[_0x9e93('0xa')]=function(_0x23b1b1,_0x227eef){return _0x23b1b1[_0x9e93('0xb')](_0x9e93('0xc'),attributes,{'tableName':_0x9e93('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xee68=['api','bluebird','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xee68,0x1aa));var _0x8ee6=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0xee68[_0x2dd390];return _0x3afe47;};'use strict';var _=require(_0x8ee6('0x0'));var util=require(_0x8ee6('0x1'));var logger=require(_0x8ee6('0x2'))(_0x8ee6('0x3'));var moment=require('moment');var BPromise=require(_0x8ee6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ee6('0x5'));var rimraf=require(_0x8ee6('0x6'));var config=require(_0x8ee6('0x7'));var attributes=require(_0x8ee6('0x8'));module[_0x8ee6('0x9')]=function(_0x56afef,_0x43b4c4){return _0x56afef[_0x8ee6('0xa')](_0x8ee6('0xb'),attributes,{'tableName':_0x8ee6('0xc'),'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 dca3a42..3b494e1 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 _0xd12a=['defaults','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x1e78a5,_0x49bfde){var _0x58c417=function(_0x3693a7){while(--_0x3693a7){_0x1e78a5['push'](_0x1e78a5['shift']());}};_0x58c417(++_0x49bfde);}(_0xd12a,0x1f2));var _0xad12=function(_0xb7c67b,_0x4ce304){_0xb7c67b=_0xb7c67b-0x0;var _0x2db22f=_0xd12a[_0xb7c67b];return _0x2db22f;};'use strict';var _=require('lodash');var util=require(_0xad12('0x0'));var moment=require('moment');var BPromise=require(_0xad12('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad12('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xad12('0x3'));var config=require(_0xad12('0x4'));var jayson=require(_0xad12('0x5'));var client=jayson['client'][_0xad12('0x6')]({'port':0x232a});config[_0xad12('0x7')]=_[_0xad12('0x8')](config[_0xad12('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xad12('0x9'))(new Redis(config[_0xad12('0x7')]));require('./chatWebsite.socket')[_0xad12('0xa')](socket);function respondWithRpcPromise(_0x649c90,_0x407bf3,_0x1a05b4){return new BPromise(function(_0x523873,_0x24acd3){return client[_0xad12('0xb')](_0x649c90,_0x1a05b4)[_0xad12('0xc')](function(_0x10a82b){logger[_0xad12('0xd')](_0xad12('0xe'),_0x407bf3,_0xad12('0xf'));logger[_0xad12('0x10')](_0xad12('0x11'),_0x407bf3,_0xad12('0xf'),JSON['stringify'](_0x10a82b));if(_0x10a82b['error']){if(_0x10a82b[_0xad12('0x12')][_0xad12('0x13')]===0x1f4){logger[_0xad12('0x12')](_0xad12('0xe'),_0x407bf3,_0x10a82b[_0xad12('0x12')][_0xad12('0x14')]);return _0x24acd3(_0x10a82b['error'][_0xad12('0x14')]);}logger[_0xad12('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x407bf3,_0x10a82b[_0xad12('0x12')][_0xad12('0x14')]);return _0x523873(_0x10a82b[_0xad12('0x12')][_0xad12('0x14')]);}else{logger[_0xad12('0xd')](_0xad12('0xe'),_0x407bf3,_0xad12('0xf'));_0x523873(_0x10a82b[_0xad12('0x15')][_0xad12('0x14')]);}})[_0xad12('0x16')](function(_0x57fe6a){logger[_0xad12('0x12')](_0xad12('0xe'),_0x407bf3,_0x57fe6a);_0x24acd3(_0x57fe6a);});});} \ No newline at end of file +var _0x8b71=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8b71,0x1c0));var _0x18b7=function(_0x175d9a,_0x2a830a){_0x175d9a=_0x175d9a-0x0;var _0x48df16=_0x8b71[_0x175d9a];return _0x48df16;};'use strict';var _=require(_0x18b7('0x0'));var util=require(_0x18b7('0x1'));var moment=require(_0x18b7('0x2'));var BPromise=require(_0x18b7('0x3'));var rs=require(_0x18b7('0x4'));var fs=require('fs');var Redis=require(_0x18b7('0x5'));var db=require(_0x18b7('0x6'))['db'];var utils=require(_0x18b7('0x7'));var logger=require(_0x18b7('0x8'))(_0x18b7('0x9'));var config=require(_0x18b7('0xa'));var jayson=require(_0x18b7('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x18b7('0xc')],{'host':_0x18b7('0xd'),'port':0x18eb});var socket=require(_0x18b7('0xe'))(new Redis(config['redis']));require(_0x18b7('0xf'))[_0x18b7('0x10')](socket);function respondWithRpcPromise(_0xcabe15,_0x26084b,_0x309ad7){return new BPromise(function(_0x46cfbb,_0x1cdce4){return client[_0x18b7('0x11')](_0xcabe15,_0x309ad7)[_0x18b7('0x12')](function(_0x3fb8a0){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x26084b,_0x18b7('0x13'));logger[_0x18b7('0x14')](_0x18b7('0x15'),_0x26084b,'request\x20sent',JSON[_0x18b7('0x16')](_0x3fb8a0));if(_0x3fb8a0[_0x18b7('0x17')]){if(_0x3fb8a0[_0x18b7('0x17')][_0x18b7('0x18')]===0x1f4){logger[_0x18b7('0x17')](_0x18b7('0x19'),_0x26084b,_0x3fb8a0[_0x18b7('0x17')][_0x18b7('0x1a')]);return _0x1cdce4(_0x3fb8a0['error']['message']);}logger[_0x18b7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x26084b,_0x3fb8a0[_0x18b7('0x17')][_0x18b7('0x1a')]);return _0x46cfbb(_0x3fb8a0[_0x18b7('0x17')]['message']);}else{logger['info'](_0x18b7('0x19'),_0x26084b,_0x18b7('0x13'));_0x46cfbb(_0x3fb8a0[_0x18b7('0x1b')][_0x18b7('0x1a')]);}})['catch'](function(_0x5af87c){logger[_0x18b7('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x26084b,_0x5af87c);_0x1cdce4(_0x5af87c);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index aff679d..2a1b73b 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 _0x1136=['emit','removeListener','length','chatWebsite:','./chatWebsite.events','update'];(function(_0x622cfc,_0x3774c0){var _0x272653=function(_0x1c173a){while(--_0x1c173a){_0x622cfc['push'](_0x622cfc['shift']());}};_0x272653(++_0x3774c0);}(_0x1136,0x76));var _0x6113=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1136[_0x14add3];return _0x4a174f;};'use strict';var ChatWebsiteEvents=require(_0x6113('0x0'));var events=['save','remove',_0x6113('0x1')];function createListener(_0x3c021f,_0x146e31){return function(_0x1a377e){_0x146e31[_0x6113('0x2')](_0x3c021f,_0x1a377e);};}function removeListener(_0x56a0e7,_0x34fce7){return function(){ChatWebsiteEvents[_0x6113('0x3')](_0x56a0e7,_0x34fce7);};}exports['register']=function(_0x22bf35){for(var _0x531098=0x0,_0xe817f1=events[_0x6113('0x4')];_0x531098<_0xe817f1;_0x531098++){var _0x59f165=events[_0x531098];var _0x32af44=createListener(_0x6113('0x5')+_0x59f165,_0x22bf35);ChatWebsiteEvents['on'](_0x59f165,_0x32af44);}}; \ No newline at end of file +var _0x9c8a=['removeListener','save','remove','update'];(function(_0x1d3d46,_0x138397){var _0x16cc99=function(_0x2d3baf){while(--_0x2d3baf){_0x1d3d46['push'](_0x1d3d46['shift']());}};_0x16cc99(++_0x138397);}(_0x9c8a,0x191));var _0xa9c8=function(_0x2da190,_0x52db4a){_0x2da190=_0x2da190-0x0;var _0x243a20=_0x9c8a[_0x2da190];return _0x243a20;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xa9c8('0x0'),_0xa9c8('0x1'),_0xa9c8('0x2')];function createListener(_0x15a6ad,_0x3f0207){return function(_0xe2a4ff){_0x3f0207['emit'](_0x15a6ad,_0xe2a4ff);};}function removeListener(_0x185723,_0x4fa96d){return function(){ChatWebsiteEvents[_0xa9c8('0x3')](_0x185723,_0x4fa96d);};}exports['register']=function(_0x506c05){for(var _0x3c3411=0x0,_0x301e63=events['length'];_0x3c3411<_0x301e63;_0x3c3411++){var _0x56c011=events[_0x3c3411];var _0x449124=createListener('chatWebsite:'+_0x56c011,_0x506c05);ChatWebsiteEvents['on'](_0x56c011,_0x449124);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 83039c1..ffb76e8 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 _0x53d5=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','diskStorage','server/files/images/logos/','%s-%s','now','originalname','single','file','join','root','server/files/images/avatars/','format','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','offline','/:id/interactions','addInteraction','/:id/applications','/:id/proactive_actions','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','getApplications'];(function(_0x3ea4b5,_0x2e47ca){var _0x246a94=function(_0x1eb71e){while(--_0x1eb71e){_0x3ea4b5['push'](_0x3ea4b5['shift']());}};_0x246a94(++_0x2e47ca);}(_0x53d5,0x1cc));var _0x553d=function(_0x5273bd,_0x36ebd9){_0x5273bd=_0x5273bd-0x0;var _0x77a5b9=_0x53d5[_0x5273bd];return _0x77a5b9;};'use strict';var multer=require(_0x553d('0x0'));var util=require(_0x553d('0x1'));var path=require(_0x553d('0x2'));var timeout=require(_0x553d('0x3'));var express=require(_0x553d('0x4'));var router=express[_0x553d('0x5')]();var auth=require(_0x553d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x553d('0x7'));var controller=require(_0x553d('0x8'));router[_0x553d('0x9')]('/',auth[_0x553d('0xa')](),controller[_0x553d('0xb')]);router['get'](_0x553d('0xc'),auth[_0x553d('0xa')](),controller[_0x553d('0xd')]);router[_0x553d('0x9')](_0x553d('0xe'),auth[_0x553d('0xa')](),controller[_0x553d('0xf')]);router[_0x553d('0x9')](_0x553d('0x10'),auth[_0x553d('0xa')](),controller[_0x553d('0x11')]);router[_0x553d('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x553d('0x12')]);router['get'](_0x553d('0x13'),controller[_0x553d('0x14')]);router[_0x553d('0x9')](_0x553d('0x15'),controller[_0x553d('0x16')]);router[_0x553d('0x9')](_0x553d('0x17'),controller[_0x553d('0x18')]);router[_0x553d('0x9')](_0x553d('0x19'),controller[_0x553d('0x1a')]);router[_0x553d('0x9')]('/:id/interactions',auth[_0x553d('0xa')](),controller['getInteractions']);router[_0x553d('0x9')](_0x553d('0x1b'),controller[_0x553d('0x1c')]);router['get']('/:id/applications',auth[_0x553d('0xa')](),controller[_0x553d('0x1d')]);router[_0x553d('0x9')]('/:id/proactive_actions',auth[_0x553d('0xa')](),controller[_0x553d('0x1e')]);router[_0x553d('0x9')](_0x553d('0x1f'),controller[_0x553d('0x20')]);router[_0x553d('0x9')](_0x553d('0x21'),auth[_0x553d('0xa')](),controller[_0x553d('0x22')]);router[_0x553d('0x9')](_0x553d('0x23'),auth['isAuthenticated'](),controller[_0x553d('0x24')]);router[_0x553d('0x25')]('/',auth['isAuthenticated'](),controller[_0x553d('0x26')]);router[_0x553d('0x25')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x553d('0x27'),auth['isAuthenticated'](),controller[_0x553d('0x28')]);var upload=multer({'storage':multer[_0x553d('0x29')]({'destination':function(_0x2e4f1b,_0x1878c4,_0x165b6c){_0x165b6c(null,path['join'](config['root'],_0x553d('0x2a')));},'filename':function(_0x491dc2,_0x576c56,_0x185b8a){_0x185b8a(null,util['format'](_0x553d('0x2b'),Date[_0x553d('0x2c')](),_0x576c56[_0x553d('0x2d')]));}})});router['post'](_0x553d('0x13'),upload[_0x553d('0x2e')](_0x553d('0x2f')),controller['addLogo']);var upload=multer({'storage':multer[_0x553d('0x29')]({'destination':function(_0x39943d,_0x2bf05d,_0x50fbc3){_0x50fbc3(null,path[_0x553d('0x30')](config[_0x553d('0x31')],_0x553d('0x32')));},'filename':function(_0x5ce4ab,_0x4315a9,_0x4b70b3){_0x4b70b3(null,util[_0x553d('0x33')](_0x553d('0x2b'),Date[_0x553d('0x2c')](),_0x4315a9[_0x553d('0x2d')]));}})});router[_0x553d('0x25')](_0x553d('0x15'),upload[_0x553d('0x2e')](_0x553d('0x2f')),controller['addAvatar']);var upload=multer({'storage':multer[_0x553d('0x29')]({'destination':function(_0x2b1698,_0x1eda11,_0x1ea58f){_0x1ea58f(null,path[_0x553d('0x30')](config[_0x553d('0x31')],_0x553d('0x32')));},'filename':function(_0x335ee7,_0x52ddd6,_0xd9d3eb){_0xd9d3eb(null,util[_0x553d('0x33')](_0x553d('0x2b'),Date['now'](),_0x52ddd6[_0x553d('0x2d')]));}})});router[_0x553d('0x25')](_0x553d('0x17'),upload[_0x553d('0x2e')](_0x553d('0x2f')),controller[_0x553d('0x34')]);var upload=multer({'storage':multer[_0x553d('0x29')]({'destination':function(_0xb071e0,_0x47cfb0,_0x5c0291){_0x5c0291(null,path[_0x553d('0x30')](config[_0x553d('0x31')],'server/files/images/avatars/'));},'filename':function(_0x4d5b00,_0x5e6c3b,_0x52f94c){_0x52f94c(null,util[_0x553d('0x33')]('%s-%s',Date[_0x553d('0x2c')](),_0x5e6c3b['originalname']));}})});router[_0x553d('0x25')](_0x553d('0x19'),upload['single']('file'),controller[_0x553d('0x35')]);router[_0x553d('0x25')](_0x553d('0x36'),controller[_0x553d('0x37')]);router['post'](_0x553d('0x38'),controller[_0x553d('0x39')]);router['post'](_0x553d('0x3a'),auth['isAuthenticated'](),controller[_0x553d('0x3b')]);router[_0x553d('0x25')](_0x553d('0x3c'),auth[_0x553d('0xa')](),controller['addApplications']);router['post'](_0x553d('0x3d'),auth[_0x553d('0xa')](),controller[_0x553d('0x3e')]);router[_0x553d('0x25')](_0x553d('0x23'),auth[_0x553d('0xa')](),controller[_0x553d('0x3f')]);router[_0x553d('0x40')](_0x553d('0xe'),auth[_0x553d('0xa')](),controller['update']);router[_0x553d('0x41')](_0x553d('0xe'),auth['isAuthenticated'](),controller[_0x553d('0x42')]);router[_0x553d('0x41')]('/:id/dispositions',auth[_0x553d('0xa')](),controller[_0x553d('0x43')]);router[_0x553d('0x41')](_0x553d('0x27'),auth[_0x553d('0xa')](),controller[_0x553d('0x44')]);router['delete'](_0x553d('0x23'),auth[_0x553d('0xa')](),controller[_0x553d('0x45')]);module['exports']=router; \ No newline at end of file +var _0x1ae3=['getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','diskStorage','join','root','%s-%s','now','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','format','addAvatar','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','/:id/offline','addInteraction','addProactiveActions','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions'];(function(_0x343e44,_0x519af9){var _0xa5130e=function(_0xae1fa0){while(--_0xae1fa0){_0x343e44['push'](_0x343e44['shift']());}};_0xa5130e(++_0x519af9);}(_0x1ae3,0x139));var _0x31ae=function(_0x3e6647,_0x2c0d09){_0x3e6647=_0x3e6647-0x0;var _0x46bddd=_0x1ae3[_0x3e6647];return _0x46bddd;};'use strict';var multer=require(_0x31ae('0x0'));var util=require(_0x31ae('0x1'));var path=require('path');var timeout=require(_0x31ae('0x2'));var express=require(_0x31ae('0x3'));var router=express[_0x31ae('0x4')]();var auth=require(_0x31ae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31ae('0x6'));var controller=require(_0x31ae('0x7'));router[_0x31ae('0x8')]('/',auth[_0x31ae('0x9')](),controller[_0x31ae('0xa')]);router[_0x31ae('0x8')](_0x31ae('0xb'),auth[_0x31ae('0x9')](),controller[_0x31ae('0xc')]);router[_0x31ae('0x8')](_0x31ae('0xd'),auth[_0x31ae('0x9')](),controller[_0x31ae('0xe')]);router[_0x31ae('0x8')](_0x31ae('0xf'),auth['isAuthenticated'](),controller[_0x31ae('0x10')]);router[_0x31ae('0x8')](_0x31ae('0x11'),auth['isAuthenticated'](),controller[_0x31ae('0x12')]);router[_0x31ae('0x8')]('/:id/logo',controller[_0x31ae('0x13')]);router['get'](_0x31ae('0x14'),controller[_0x31ae('0x15')]);router[_0x31ae('0x8')]('/:id/customer_avatar',controller[_0x31ae('0x16')]);router[_0x31ae('0x8')](_0x31ae('0x17'),controller[_0x31ae('0x18')]);router[_0x31ae('0x8')](_0x31ae('0x19'),auth['isAuthenticated'](),controller[_0x31ae('0x1a')]);router[_0x31ae('0x8')](_0x31ae('0x1b'),controller[_0x31ae('0x1c')]);router[_0x31ae('0x8')](_0x31ae('0x1d'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x1e')]);router['get'](_0x31ae('0x1f'),auth['isAuthenticated'](),controller[_0x31ae('0x20')]);router[_0x31ae('0x8')](_0x31ae('0x21'),controller[_0x31ae('0x22')]);router[_0x31ae('0x8')](_0x31ae('0x23'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x24')]);router[_0x31ae('0x8')](_0x31ae('0x25'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x26')]);router['post']('/',auth[_0x31ae('0x9')](),controller[_0x31ae('0x27')]);router[_0x31ae('0x28')](_0x31ae('0xf'),auth['isAuthenticated'](),controller[_0x31ae('0x29')]);router[_0x31ae('0x28')]('/:id/canned_answers',auth[_0x31ae('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x31ae('0x2a')]({'destination':function(_0x56f9c4,_0x59827a,_0x2219ce){_0x2219ce(null,path[_0x31ae('0x2b')](config[_0x31ae('0x2c')],'server/files/images/logos/'));},'filename':function(_0x4d18c0,_0x4c0246,_0x431890){_0x431890(null,util['format'](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x4c0246[_0x31ae('0x2f')]));}})});router[_0x31ae('0x28')](_0x31ae('0x30'),upload[_0x31ae('0x31')](_0x31ae('0x32')),controller[_0x31ae('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x258e48,_0xdc9774,_0x1681ab){_0x1681ab(null,path[_0x31ae('0x2b')](config['root'],_0x31ae('0x34')));},'filename':function(_0x418d59,_0x28f439,_0x2c278b){_0x2c278b(null,util[_0x31ae('0x35')](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x28f439['originalname']));}})});router['post'](_0x31ae('0x14'),upload['single'](_0x31ae('0x32')),controller[_0x31ae('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2008a5,_0x207e57,_0x1b7ad7){_0x1b7ad7(null,path[_0x31ae('0x2b')](config['root'],_0x31ae('0x34')));},'filename':function(_0x130ee9,_0x4d22cf,_0x588e72){_0x588e72(null,util['format'](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x4d22cf[_0x31ae('0x2f')]));}})});router[_0x31ae('0x28')](_0x31ae('0x37'),upload['single'](_0x31ae('0x32')),controller[_0x31ae('0x38')]);var upload=multer({'storage':multer[_0x31ae('0x2a')]({'destination':function(_0x3506e0,_0x3cf048,_0x3d6c3c){_0x3d6c3c(null,path[_0x31ae('0x2b')](config[_0x31ae('0x2c')],_0x31ae('0x34')));},'filename':function(_0x1aaa74,_0x27b311,_0x2e755c){_0x2e755c(null,util['format'](_0x31ae('0x2d'),Date[_0x31ae('0x2e')](),_0x27b311['originalname']));}})});router[_0x31ae('0x28')](_0x31ae('0x17'),upload[_0x31ae('0x31')](_0x31ae('0x32')),controller[_0x31ae('0x39')]);router['post'](_0x31ae('0x3a'),controller['notify']);router['post'](_0x31ae('0x3b'),controller['offline']);router[_0x31ae('0x28')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x31ae('0x3c')]);router[_0x31ae('0x28')](_0x31ae('0x1d'),auth[_0x31ae('0x9')](),controller['addApplications']);router[_0x31ae('0x28')](_0x31ae('0x1f'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x3d')]);router[_0x31ae('0x28')](_0x31ae('0x25'),auth['isAuthenticated'](),controller['addAgents']);router[_0x31ae('0x3e')](_0x31ae('0xd'),auth['isAuthenticated'](),controller[_0x31ae('0x3f')]);router[_0x31ae('0x40')](_0x31ae('0xd'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x41')]);router[_0x31ae('0x40')]('/:id/dispositions',auth[_0x31ae('0x9')](),controller[_0x31ae('0x42')]);router[_0x31ae('0x40')]('/:id/canned_answers',auth[_0x31ae('0x9')](),controller[_0x31ae('0x43')]);router['delete'](_0x31ae('0x25'),auth[_0x31ae('0x9')](),controller[_0x31ae('0x44')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index c113f02..fc9e59c 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 _0x19e2=['name','sequelize','exports','STRING'];(function(_0x1e0d8a,_0x3043c6){var _0x481887=function(_0x315c9c){while(--_0x315c9c){_0x1e0d8a['push'](_0x1e0d8a['shift']());}};_0x481887(++_0x3043c6);}(_0x19e2,0x1e1));var _0x219e=function(_0x4f40b6,_0x21fd3c){_0x4f40b6=_0x4f40b6-0x0;var _0xbcb4b=_0x19e2[_0x4f40b6];return _0xbcb4b;};'use strict';var Sequelize=require(_0x219e('0x0'));module[_0x219e('0x1')]={'name':{'type':Sequelize[_0x219e('0x2')],'unique':_0x219e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x219e('0x2')]},'companyId':{'type':Sequelize[_0x219e('0x2')]},'website':{'type':Sequelize[_0x219e('0x2')]},'phone':{'type':Sequelize[_0x219e('0x2')]},'fax':{'type':Sequelize[_0x219e('0x2')]},'type':{'type':Sequelize[_0x219e('0x2')]},'street':{'type':Sequelize[_0x219e('0x2')]},'postalCode':{'type':Sequelize[_0x219e('0x2')]},'city':{'type':Sequelize[_0x219e('0x2')]},'country':{'type':Sequelize[_0x219e('0x2')]},'email':{'type':Sequelize[_0x219e('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x219e('0x2')]},'sStreet':{'type':Sequelize[_0x219e('0x2')]},'sPostalCode':{'type':Sequelize[_0x219e('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x219e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x02db=['sequelize','exports','STRING','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x02db,0x144));var _0xb02d=function(_0x411f14,_0x332d5a){_0x411f14=_0x411f14-0x0;var _0x3ba5fd=_0x02db[_0x411f14];return _0x3ba5fd;};'use strict';var Sequelize=require(_0xb02d('0x0'));module[_0xb02d('0x1')]={'name':{'type':Sequelize[_0xb02d('0x2')],'unique':_0xb02d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xb02d('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xb02d('0x2')]},'phone':{'type':Sequelize[_0xb02d('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xb02d('0x2')]},'postalCode':{'type':Sequelize[_0xb02d('0x2')]},'city':{'type':Sequelize[_0xb02d('0x2')]},'country':{'type':Sequelize[_0xb02d('0x2')]},'email':{'type':Sequelize[_0xb02d('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xb02d('0x2')]},'sStreet':{'type':Sequelize[_0xb02d('0x2')]},'sPostalCode':{'type':Sequelize[_0xb02d('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0xb02d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index a87613f..250b281 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 _0xb23a=['merge','html-pdf','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','set','Content-Range','apply','save','then','destroy','get','UserProfileResource','error','stack','name','send','index','CmCompany','rawAttributes','model','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','options','count','includeAll','include','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','CmContact','omit','ids','getContacts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb23a,0x1e7));var _0xab23=function(_0x101844,_0x118576){_0x101844=_0x101844-0x0;var _0x4bb98b=_0xb23a[_0x101844];return _0x4bb98b;};'use strict';var pdf=require(_0xab23('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xab23('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xab23('0x2'));var moment=require(_0xab23('0x3'));var BPromise=require(_0xab23('0x4'));var Mustache=require('mustache');var util=require(_0xab23('0x5'));var path=require(_0xab23('0x6'));var sox=require(_0xab23('0x7'));var csv=require(_0xab23('0x8'));var ejs=require(_0xab23('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xab23('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xab23('0xb'));var toCsv=require(_0xab23('0x8'));var querystring=require(_0xab23('0xc'));var Papa=require(_0xab23('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xab23('0xe'));var hardwareService=require(_0xab23('0xf'));var logger=require('../../config/logger')(_0xab23('0x10'));var utils=require(_0xab23('0x11'));var config=require(_0xab23('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41f4a5,_0x2c62f8){_0x2c62f8=_0x2c62f8||0xcc;return function(_0x1d68a4){if(_0x1d68a4){return _0x41f4a5[_0xab23('0x13')](_0x2c62f8);}return _0x41f4a5['status'](_0x2c62f8)[_0xab23('0x14')]();};}function respondWithResult(_0x3fa335,_0x221539){_0x221539=_0x221539||0xc8;return function(_0x5d49d9){if(_0x5d49d9){return _0x3fa335[_0xab23('0x15')](_0x221539)[_0xab23('0x16')](_0x5d49d9);}};}function respondWithFilteredResult(_0x22001e,_0x3a0bff){return function(_0xf3ef7e){if(_0xf3ef7e){var _0x3b439b=_0xf3ef7e['count'],_0x23e0cf=_0x3a0bff['offset'],_0x1dffd3=_0x3a0bff[_0xab23('0x17')]+_0x3a0bff['limit'],_0x75811b;if(_0x1dffd3>=_0x3b439b){_0x1dffd3=_0x3b439b;_0x75811b=0xc8;}else{_0x75811b=0xce;}_0x22001e[_0xab23('0x15')](_0x75811b);return _0x22001e[_0xab23('0x18')](_0xab23('0x19'),_0x23e0cf+'-'+_0x1dffd3+'/'+_0x3b439b)[_0xab23('0x16')](_0xf3ef7e);}return null;};}function patchUpdates(_0x199af2){return function(_0x7d1cd9){try{jsonpatch[_0xab23('0x1a')](_0x7d1cd9,_0x199af2,!![]);}catch(_0x1c906f){return BPromise['reject'](_0x1c906f);}return _0x7d1cd9[_0xab23('0x1b')]();};}function saveUpdates(_0x221396,_0x559b92){return function(_0x22e66e){if(_0x22e66e){return _0x22e66e['update'](_0x221396)[_0xab23('0x1c')](function(_0x59a613){return _0x59a613;});}return null;};}function removeEntity(_0x5e200c,_0x5ddcf8){return function(_0x4700c4){if(_0x4700c4){return _0x4700c4[_0xab23('0x1d')]()[_0xab23('0x1c')](function(){var _0x2614c3=_0x4700c4[_0xab23('0x1e')]({'plain':!![]});var _0x5880a9='Companies';return db[_0xab23('0x1f')][_0xab23('0x1d')]({'where':{'type':_0x5880a9,'resourceId':_0x2614c3['id']}})['then'](function(){return _0x4700c4;});})[_0xab23('0x1c')](function(){_0x5e200c[_0xab23('0x15')](0xcc)[_0xab23('0x14')]();});}};}function handleEntityNotFound(_0x3df025,_0x1e046a){return function(_0x491e3f){if(!_0x491e3f){_0x3df025['sendStatus'](0x194);}return _0x491e3f;};}function handleError(_0x132b4a,_0x16bb78){_0x16bb78=_0x16bb78||0x1f4;return function(_0x23f7a0){logger[_0xab23('0x20')](_0x23f7a0[_0xab23('0x21')]);if(_0x23f7a0[_0xab23('0x22')]){delete _0x23f7a0[_0xab23('0x22')];}_0x132b4a[_0xab23('0x15')](_0x16bb78)[_0xab23('0x23')](_0x23f7a0);};}exports[_0xab23('0x24')]=function(_0x911203,_0x4706cd){var _0x358ce0={},_0x29211e={},_0x1cac5d={'count':0x0,'rows':[]};var _0x3f79f3=db[_0xab23('0x25')][_0xab23('0x26')];_0x29211e[_0xab23('0x27')]=_[_0xab23('0x28')](_0x3f79f3);_0x29211e[_0xab23('0x29')]=_[_0xab23('0x28')](_0x911203[_0xab23('0x29')]);_0x29211e[_0xab23('0x2a')]=_['intersection'](_0x29211e['model'],_0x29211e['query']);_0x358ce0[_0xab23('0x2b')]=_[_0xab23('0x2c')](_0x29211e[_0xab23('0x27')],qs['fields'](_0x911203[_0xab23('0x29')]['fields']));_0x358ce0[_0xab23('0x2b')]=_0x358ce0['attributes'][_0xab23('0x2d')]?_0x358ce0['attributes']:_0x29211e[_0xab23('0x27')];if(!_0x911203[_0xab23('0x29')][_0xab23('0x2e')](_0xab23('0x2f'))){_0x358ce0[_0xab23('0x30')]=qs[_0xab23('0x30')](_0x911203['query'][_0xab23('0x30')]);_0x358ce0[_0xab23('0x17')]=qs[_0xab23('0x17')](_0x911203['query']['offset']);}_0x358ce0[_0xab23('0x31')]=qs[_0xab23('0x32')](_0x911203['query'][_0xab23('0x32')]);_0x358ce0[_0xab23('0x33')]=qs['filters'](_[_0xab23('0x34')](_0x911203[_0xab23('0x29')],_0x29211e[_0xab23('0x2a')]));if(_0x911203[_0xab23('0x29')][_0xab23('0x35')]){_0x358ce0[_0xab23('0x33')]=_['merge'](_0x358ce0[_0xab23('0x33')],{'$or':_[_0xab23('0x36')](_0x3f79f3,function(_0x15717a){if(_0x15717a[_0xab23('0x37')][_0xab23('0x38')]!==_0xab23('0x39')){var _0x1e50f0={};_0x1e50f0[_0x15717a[_0xab23('0x3a')]]={'$like':'%'+_0x911203['query']['filter']+'%'};return _0x1e50f0;}})});}_0x358ce0=_['merge']({},_0x358ce0,_0x911203[_0xab23('0x3b')]);var _0x34de4e={'where':_0x358ce0['where']};return db['CmCompany']['count'](_0x34de4e)['then'](function(_0x4a3d20){_0x1cac5d[_0xab23('0x3c')]=_0x4a3d20;if(_0x911203[_0xab23('0x29')][_0xab23('0x3d')]){_0x358ce0[_0xab23('0x3e')]=[{'all':!![]}];}return db[_0xab23('0x25')]['findAll'](_0x358ce0);})['then'](function(_0x35a9fe){_0x1cac5d['rows']=_0x35a9fe;return _0x1cac5d;})[_0xab23('0x1c')](respondWithFilteredResult(_0x4706cd,_0x358ce0))['catch'](handleError(_0x4706cd,null));};exports['show']=function(_0x882215,_0x5e5ee2){var _0x2e1d67={'raw':![],'where':{'id':_0x882215['params']['id']}},_0x311a84={};_0x311a84[_0xab23('0x27')]=_[_0xab23('0x28')](db[_0xab23('0x25')][_0xab23('0x26')]);_0x311a84[_0xab23('0x29')]=_[_0xab23('0x28')](_0x882215[_0xab23('0x29')]);_0x311a84[_0xab23('0x2a')]=_['intersection'](_0x311a84[_0xab23('0x27')],_0x311a84[_0xab23('0x29')]);_0x2e1d67[_0xab23('0x2b')]=_[_0xab23('0x2c')](_0x311a84[_0xab23('0x27')],qs[_0xab23('0x3f')](_0x882215['query'][_0xab23('0x3f')]));_0x2e1d67['attributes']=_0x2e1d67['attributes']['length']?_0x2e1d67[_0xab23('0x2b')]:_0x311a84[_0xab23('0x27')];if(_0x882215[_0xab23('0x29')]['includeAll']){_0x2e1d67[_0xab23('0x3e')]=[{'all':!![]}];}_0x2e1d67=_['merge']({},_0x2e1d67,_0x882215[_0xab23('0x3b')]);return db[_0xab23('0x25')][_0xab23('0x40')](_0x2e1d67)[_0xab23('0x1c')](handleEntityNotFound(_0x5e5ee2,null))[_0xab23('0x1c')](respondWithResult(_0x5e5ee2,null))[_0xab23('0x41')](handleError(_0x5e5ee2,null));};exports[_0xab23('0x42')]=function(_0x373469,_0x14ccdf){return db[_0xab23('0x25')][_0xab23('0x42')](_0x373469[_0xab23('0x43')],{})[_0xab23('0x1c')](function(_0x14d6c7){var _0x46598b=_0x373469[_0xab23('0x44')]['get']({'plain':!![]});if(!_0x46598b)throw new Error(_0xab23('0x45'));if(_0x46598b[_0xab23('0x46')]===_0xab23('0x44')){var _0x33de1d=_0x14d6c7[_0xab23('0x1e')]({'plain':!![]});var _0x393840=_0xab23('0x47');return db['UserProfileSection'][_0xab23('0x40')]({'where':{'name':_0x393840,'userProfileId':_0x46598b[_0xab23('0x48')]},'raw':!![]})['then'](function(_0x156a31){if(_0x156a31&&_0x156a31[_0xab23('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x33de1d[_0xab23('0x22')],'resourceId':_0x33de1d['id'],'type':_0x156a31[_0xab23('0x22')],'sectionId':_0x156a31['id']},{})[_0xab23('0x1c')](function(){return _0x14d6c7;});}else{return _0x14d6c7;}})[_0xab23('0x41')](function(_0x179a42){logger[_0xab23('0x20')](_0xab23('0x4a'),_0x179a42);throw _0x179a42;});}return _0x14d6c7;})[_0xab23('0x1c')](respondWithResult(_0x14ccdf,0xc9))[_0xab23('0x41')](handleError(_0x14ccdf,null));};exports['update']=function(_0x5dceac,_0x20ab37){if(_0x5dceac['body']['id']){delete _0x5dceac[_0xab23('0x43')]['id'];}return db['CmCompany'][_0xab23('0x40')]({'where':{'id':_0x5dceac[_0xab23('0x4b')]['id']}})[_0xab23('0x1c')](handleEntityNotFound(_0x20ab37,null))[_0xab23('0x1c')](saveUpdates(_0x5dceac[_0xab23('0x43')],null))[_0xab23('0x1c')](respondWithResult(_0x20ab37,null))[_0xab23('0x41')](handleError(_0x20ab37,null));};exports[_0xab23('0x1d')]=function(_0x579080,_0x4fdc4e){return db[_0xab23('0x25')][_0xab23('0x40')]({'where':{'id':_0x579080[_0xab23('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fdc4e,null))[_0xab23('0x1c')](removeEntity(_0x4fdc4e,null))['catch'](handleError(_0x4fdc4e,null));};exports['addContacts']=function(_0x3d64d5,_0x578904,_0x1d523b){return db[_0xab23('0x4c')][_0xab23('0x40')]({'where':{'id':_0x3d64d5[_0xab23('0x4b')]['id']}})['then'](handleEntityNotFound(_0x578904,null))['then'](function(_0x537d7b){if(_0x537d7b){return _0x537d7b['addContacts'](_0x3d64d5[_0xab23('0x43')]['ids'],_[_0xab23('0x4d')](_0x3d64d5[_0xab23('0x43')],[_0xab23('0x4e'),'id'])||{});}})[_0xab23('0x1c')](respondWithResult(_0x578904,null))[_0xab23('0x41')](handleError(_0x578904,null));};exports[_0xab23('0x4f')]=function(_0x41fc38,_0x46bbce,_0x335aff){var _0x31ae4b={};var _0x4acee8={};var _0x3602ec;var _0x3b713c;return db['CmCompany']['findOne']({'where':{'id':_0x41fc38[_0xab23('0x4b')]['id']}})['then'](handleEntityNotFound(_0x46bbce,null))[_0xab23('0x1c')](function(_0x47525e){if(_0x47525e){_0x3602ec=_0x47525e;_0x4acee8['model']=_[_0xab23('0x28')](db[_0xab23('0x4c')][_0xab23('0x26')]);_0x4acee8[_0xab23('0x29')]=_[_0xab23('0x28')](_0x41fc38['query']);_0x4acee8['filters']=_[_0xab23('0x2c')](_0x4acee8[_0xab23('0x27')],_0x4acee8[_0xab23('0x29')]);_0x31ae4b[_0xab23('0x2b')]=_[_0xab23('0x2c')](_0x4acee8['model'],qs[_0xab23('0x3f')](_0x41fc38['query'][_0xab23('0x3f')]));_0x31ae4b[_0xab23('0x2b')]=_0x31ae4b[_0xab23('0x2b')]['length']?_0x31ae4b['attributes']:_0x4acee8['model'];_0x31ae4b['order']=qs[_0xab23('0x32')](_0x41fc38[_0xab23('0x29')][_0xab23('0x32')]);_0x31ae4b[_0xab23('0x33')]=qs[_0xab23('0x2a')](_['pick'](_0x41fc38[_0xab23('0x29')],_0x4acee8['filters']));if(_0x41fc38['query'][_0xab23('0x35')]){_0x31ae4b['where']=_[_0xab23('0x50')](_0x31ae4b[_0xab23('0x33')],{'$or':_['map'](_0x31ae4b['attributes'],function(_0x39c45e){var _0x16cfee={};_0x16cfee[_0x39c45e]={'$like':'%'+_0x41fc38[_0xab23('0x29')][_0xab23('0x35')]+'%'};return _0x16cfee;})});}_0x31ae4b=_[_0xab23('0x50')]({},_0x31ae4b,_0x41fc38[_0xab23('0x3b')]);return _0x3602ec['getContacts'](_0x31ae4b);}})[_0xab23('0x1c')](function(_0x13f4f5){if(_0x13f4f5){_0x3b713c=_0x13f4f5[_0xab23('0x2d')];if(!_0x41fc38[_0xab23('0x29')][_0xab23('0x2e')](_0xab23('0x2f'))){_0x31ae4b[_0xab23('0x30')]=qs[_0xab23('0x30')](_0x41fc38[_0xab23('0x29')][_0xab23('0x30')]);_0x31ae4b['offset']=qs[_0xab23('0x17')](_0x41fc38['query']['offset']);}return _0x3602ec[_0xab23('0x4f')](_0x31ae4b);}})[_0xab23('0x1c')](function(_0x5ac28e){if(_0x5ac28e){return _0x5ac28e?{'count':_0x3b713c,'rows':_0x5ac28e}:null;}})[_0xab23('0x1c')](respondWithResult(_0x46bbce,null))[_0xab23('0x41')](handleError(_0x46bbce,null));}; \ No newline at end of file +var _0x0b2a=['addContacts','CmContact','ids','findOne','getContacts','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit','set','Content-Range','save','then','UserProfileResource','destroy','error','name','send','index','rawAttributes','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','include','CmCompany','findAll','rows','catch','params','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x803f24,_0x516eb9){var _0x3f9cd6=function(_0x2fef3e){while(--_0x2fef3e){_0x803f24['push'](_0x803f24['shift']());}};_0x3f9cd6(++_0x516eb9);}(_0x0b2a,0x1e5));var _0xa0b2=function(_0x22bba6,_0x512900){_0x22bba6=_0x22bba6-0x0;var _0x33b11b=_0x0b2a[_0x22bba6];return _0x33b11b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa0b2('0x0'));var zipdir=require(_0xa0b2('0x1'));var jsonpatch=require(_0xa0b2('0x2'));var rp=require(_0xa0b2('0x3'));var moment=require(_0xa0b2('0x4'));var BPromise=require(_0xa0b2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa0b2('0x6'));var sox=require(_0xa0b2('0x7'));var csv=require(_0xa0b2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa0b2('0x9'));var crypto=require(_0xa0b2('0xa'));var jsforce=require(_0xa0b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa0b2('0x8'));var querystring=require(_0xa0b2('0xc'));var Papa=require(_0xa0b2('0xd'));var Redis=require(_0xa0b2('0xe'));var authService=require(_0xa0b2('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa0b2('0x10'))(_0xa0b2('0x11'));var utils=require(_0xa0b2('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb7f530,_0x48d365){_0x48d365=_0x48d365||0xcc;return function(_0x5a8963){if(_0x5a8963){return _0xb7f530[_0xa0b2('0x13')](_0x48d365);}return _0xb7f530[_0xa0b2('0x14')](_0x48d365)[_0xa0b2('0x15')]();};}function respondWithResult(_0x570896,_0x34d9d7){_0x34d9d7=_0x34d9d7||0xc8;return function(_0x1ca0b1){if(_0x1ca0b1){return _0x570896[_0xa0b2('0x14')](_0x34d9d7)['json'](_0x1ca0b1);}};}function respondWithFilteredResult(_0x2aa3cc,_0x4f479b){return function(_0x39cbe4){if(_0x39cbe4){var _0x42ba63=_0x39cbe4[_0xa0b2('0x16')],_0x46a4d2=_0x4f479b[_0xa0b2('0x17')],_0x316fa5=_0x4f479b['offset']+_0x4f479b[_0xa0b2('0x18')],_0xb2ea02;if(_0x316fa5>=_0x42ba63){_0x316fa5=_0x42ba63;_0xb2ea02=0xc8;}else{_0xb2ea02=0xce;}_0x2aa3cc['status'](_0xb2ea02);return _0x2aa3cc[_0xa0b2('0x19')](_0xa0b2('0x1a'),_0x46a4d2+'-'+_0x316fa5+'/'+_0x42ba63)['json'](_0x39cbe4);}return null;};}function patchUpdates(_0x3ce428){return function(_0x3802fe){try{jsonpatch['apply'](_0x3802fe,_0x3ce428,!![]);}catch(_0x5db379){return BPromise['reject'](_0x5db379);}return _0x3802fe[_0xa0b2('0x1b')]();};}function saveUpdates(_0xef8cbb,_0x58d46e){return function(_0x241f39){if(_0x241f39){return _0x241f39['update'](_0xef8cbb)[_0xa0b2('0x1c')](function(_0x3fc8e3){return _0x3fc8e3;});}return null;};}function removeEntity(_0x398b2f,_0x6ff793){return function(_0x336083){if(_0x336083){return _0x336083['destroy']()[_0xa0b2('0x1c')](function(){var _0x167d49=_0x336083['get']({'plain':!![]});var _0x15e4b5='Companies';return db[_0xa0b2('0x1d')][_0xa0b2('0x1e')]({'where':{'type':_0x15e4b5,'resourceId':_0x167d49['id']}})['then'](function(){return _0x336083;});})[_0xa0b2('0x1c')](function(){_0x398b2f['status'](0xcc)[_0xa0b2('0x15')]();});}};}function handleEntityNotFound(_0x42a996,_0x5bda19){return function(_0x51fd9f){if(!_0x51fd9f){_0x42a996[_0xa0b2('0x13')](0x194);}return _0x51fd9f;};}function handleError(_0xde02b7,_0x271b62){_0x271b62=_0x271b62||0x1f4;return function(_0x4c8bc7){logger[_0xa0b2('0x1f')](_0x4c8bc7['stack']);if(_0x4c8bc7[_0xa0b2('0x20')]){delete _0x4c8bc7[_0xa0b2('0x20')];}_0xde02b7[_0xa0b2('0x14')](_0x271b62)[_0xa0b2('0x21')](_0x4c8bc7);};}exports[_0xa0b2('0x22')]=function(_0xd81dc6,_0x400ce2){var _0x1d13c3={},_0x5c0419={},_0x48b18b={'count':0x0,'rows':[]};var _0x3c711b=db['CmCompany'][_0xa0b2('0x23')];_0x5c0419[_0xa0b2('0x24')]=_[_0xa0b2('0x25')](_0x3c711b);_0x5c0419[_0xa0b2('0x26')]=_[_0xa0b2('0x25')](_0xd81dc6[_0xa0b2('0x26')]);_0x5c0419['filters']=_[_0xa0b2('0x27')](_0x5c0419[_0xa0b2('0x24')],_0x5c0419[_0xa0b2('0x26')]);_0x1d13c3['attributes']=_[_0xa0b2('0x27')](_0x5c0419[_0xa0b2('0x24')],qs[_0xa0b2('0x28')](_0xd81dc6['query']['fields']));_0x1d13c3['attributes']=_0x1d13c3[_0xa0b2('0x29')][_0xa0b2('0x2a')]?_0x1d13c3[_0xa0b2('0x29')]:_0x5c0419[_0xa0b2('0x24')];if(!_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x2b')](_0xa0b2('0x2c'))){_0x1d13c3[_0xa0b2('0x18')]=qs[_0xa0b2('0x18')](_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x18')]);_0x1d13c3['offset']=qs[_0xa0b2('0x17')](_0xd81dc6['query'][_0xa0b2('0x17')]);}_0x1d13c3[_0xa0b2('0x2d')]=qs[_0xa0b2('0x2e')](_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x2e')]);_0x1d13c3[_0xa0b2('0x2f')]=qs[_0xa0b2('0x30')](_[_0xa0b2('0x31')](_0xd81dc6[_0xa0b2('0x26')],_0x5c0419[_0xa0b2('0x30')]));if(_0xd81dc6[_0xa0b2('0x26')]['filter']){_0x1d13c3[_0xa0b2('0x2f')]=_[_0xa0b2('0x32')](_0x1d13c3[_0xa0b2('0x2f')],{'$or':_[_0xa0b2('0x33')](_0x3c711b,function(_0x5ba053){if(_0x5ba053[_0xa0b2('0x34')][_0xa0b2('0x35')]!==_0xa0b2('0x36')){var _0x47abb8={};_0x47abb8[_0x5ba053[_0xa0b2('0x37')]]={'$like':'%'+_0xd81dc6[_0xa0b2('0x26')][_0xa0b2('0x38')]+'%'};return _0x47abb8;}})});}_0x1d13c3=_['merge']({},_0x1d13c3,_0xd81dc6[_0xa0b2('0x39')]);var _0x1f680e={'where':_0x1d13c3['where']};return db['CmCompany'][_0xa0b2('0x16')](_0x1f680e)[_0xa0b2('0x1c')](function(_0x2a5e4b){_0x48b18b['count']=_0x2a5e4b;if(_0xd81dc6[_0xa0b2('0x26')]['includeAll']){_0x1d13c3[_0xa0b2('0x3a')]=[{'all':!![]}];}return db[_0xa0b2('0x3b')][_0xa0b2('0x3c')](_0x1d13c3);})['then'](function(_0x3b3c8e){_0x48b18b[_0xa0b2('0x3d')]=_0x3b3c8e;return _0x48b18b;})[_0xa0b2('0x1c')](respondWithFilteredResult(_0x400ce2,_0x1d13c3))[_0xa0b2('0x3e')](handleError(_0x400ce2,null));};exports['show']=function(_0x94ae61,_0x297461){var _0x3c0bd4={'raw':![],'where':{'id':_0x94ae61[_0xa0b2('0x3f')]['id']}},_0x33d51b={};_0x33d51b[_0xa0b2('0x24')]=_['keys'](db[_0xa0b2('0x3b')][_0xa0b2('0x23')]);_0x33d51b['query']=_['keys'](_0x94ae61[_0xa0b2('0x26')]);_0x33d51b[_0xa0b2('0x30')]=_[_0xa0b2('0x27')](_0x33d51b[_0xa0b2('0x24')],_0x33d51b['query']);_0x3c0bd4['attributes']=_[_0xa0b2('0x27')](_0x33d51b[_0xa0b2('0x24')],qs[_0xa0b2('0x28')](_0x94ae61['query'][_0xa0b2('0x28')]));_0x3c0bd4[_0xa0b2('0x29')]=_0x3c0bd4[_0xa0b2('0x29')]['length']?_0x3c0bd4[_0xa0b2('0x29')]:_0x33d51b[_0xa0b2('0x24')];if(_0x94ae61[_0xa0b2('0x26')][_0xa0b2('0x40')]){_0x3c0bd4[_0xa0b2('0x3a')]=[{'all':!![]}];}_0x3c0bd4=_[_0xa0b2('0x32')]({},_0x3c0bd4,_0x94ae61[_0xa0b2('0x39')]);return db[_0xa0b2('0x3b')]['find'](_0x3c0bd4)[_0xa0b2('0x1c')](handleEntityNotFound(_0x297461,null))[_0xa0b2('0x1c')](respondWithResult(_0x297461,null))['catch'](handleError(_0x297461,null));};exports[_0xa0b2('0x41')]=function(_0x422b62,_0x4b3591){return db[_0xa0b2('0x3b')][_0xa0b2('0x41')](_0x422b62[_0xa0b2('0x42')],{})['then'](function(_0x28f873){var _0x3696f0=_0x422b62[_0xa0b2('0x43')][_0xa0b2('0x44')]({'plain':!![]});if(!_0x3696f0)throw new Error(_0xa0b2('0x45'));if(_0x3696f0[_0xa0b2('0x46')]===_0xa0b2('0x43')){var _0x5338a1=_0x28f873[_0xa0b2('0x44')]({'plain':!![]});var _0x2c2229=_0xa0b2('0x47');return db['UserProfileSection'][_0xa0b2('0x48')]({'where':{'name':_0x2c2229,'userProfileId':_0x3696f0[_0xa0b2('0x49')]},'raw':!![]})['then'](function(_0x8e04b){if(_0x8e04b&&_0x8e04b['autoAssociation']===0x0){return db[_0xa0b2('0x1d')][_0xa0b2('0x41')]({'name':_0x5338a1[_0xa0b2('0x20')],'resourceId':_0x5338a1['id'],'type':_0x8e04b[_0xa0b2('0x20')],'sectionId':_0x8e04b['id']},{})[_0xa0b2('0x1c')](function(){return _0x28f873;});}else{return _0x28f873;}})[_0xa0b2('0x3e')](function(_0x25e083){logger[_0xa0b2('0x1f')](_0xa0b2('0x4a'),_0x25e083);throw _0x25e083;});}return _0x28f873;})[_0xa0b2('0x1c')](respondWithResult(_0x4b3591,0xc9))[_0xa0b2('0x3e')](handleError(_0x4b3591,null));};exports['update']=function(_0xa3deb6,_0x280a07){if(_0xa3deb6['body']['id']){delete _0xa3deb6[_0xa0b2('0x42')]['id'];}return db['CmCompany']['find']({'where':{'id':_0xa3deb6[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x280a07,null))['then'](saveUpdates(_0xa3deb6[_0xa0b2('0x42')],null))[_0xa0b2('0x1c')](respondWithResult(_0x280a07,null))[_0xa0b2('0x3e')](handleError(_0x280a07,null));};exports[_0xa0b2('0x1e')]=function(_0x2e70a0,_0x599a8f){return db[_0xa0b2('0x3b')][_0xa0b2('0x48')]({'where':{'id':_0x2e70a0[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x599a8f,null))[_0xa0b2('0x1c')](removeEntity(_0x599a8f,null))['catch'](handleError(_0x599a8f,null));};exports[_0xa0b2('0x4b')]=function(_0xf0a954,_0x127b17,_0x4ad29d){return db[_0xa0b2('0x4c')]['find']({'where':{'id':_0xf0a954[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x127b17,null))[_0xa0b2('0x1c')](function(_0x11d510){if(_0x11d510){return _0x11d510[_0xa0b2('0x4b')](_0xf0a954['body'][_0xa0b2('0x4d')],_['omit'](_0xf0a954[_0xa0b2('0x42')],[_0xa0b2('0x4d'),'id'])||{});}})[_0xa0b2('0x1c')](respondWithResult(_0x127b17,null))[_0xa0b2('0x3e')](handleError(_0x127b17,null));};exports['getContacts']=function(_0x10155f,_0x5477ff,_0x1b690d){var _0x10dabe={};var _0x550748={};var _0x710af9;var _0x51b4ed;return db[_0xa0b2('0x3b')][_0xa0b2('0x4e')]({'where':{'id':_0x10155f[_0xa0b2('0x3f')]['id']}})[_0xa0b2('0x1c')](handleEntityNotFound(_0x5477ff,null))['then'](function(_0x5e2eb2){if(_0x5e2eb2){_0x710af9=_0x5e2eb2;_0x550748[_0xa0b2('0x24')]=_[_0xa0b2('0x25')](db[_0xa0b2('0x4c')][_0xa0b2('0x23')]);_0x550748[_0xa0b2('0x26')]=_[_0xa0b2('0x25')](_0x10155f[_0xa0b2('0x26')]);_0x550748[_0xa0b2('0x30')]=_[_0xa0b2('0x27')](_0x550748[_0xa0b2('0x24')],_0x550748['query']);_0x10dabe[_0xa0b2('0x29')]=_[_0xa0b2('0x27')](_0x550748['model'],qs[_0xa0b2('0x28')](_0x10155f['query']['fields']));_0x10dabe[_0xa0b2('0x29')]=_0x10dabe[_0xa0b2('0x29')][_0xa0b2('0x2a')]?_0x10dabe[_0xa0b2('0x29')]:_0x550748['model'];_0x10dabe['order']=qs[_0xa0b2('0x2e')](_0x10155f['query']['sort']);_0x10dabe[_0xa0b2('0x2f')]=qs[_0xa0b2('0x30')](_[_0xa0b2('0x31')](_0x10155f[_0xa0b2('0x26')],_0x550748[_0xa0b2('0x30')]));if(_0x10155f['query'][_0xa0b2('0x38')]){_0x10dabe[_0xa0b2('0x2f')]=_[_0xa0b2('0x32')](_0x10dabe[_0xa0b2('0x2f')],{'$or':_[_0xa0b2('0x33')](_0x10dabe[_0xa0b2('0x29')],function(_0x4eeb07){var _0x456f17={};_0x456f17[_0x4eeb07]={'$like':'%'+_0x10155f[_0xa0b2('0x26')][_0xa0b2('0x38')]+'%'};return _0x456f17;})});}_0x10dabe=_[_0xa0b2('0x32')]({},_0x10dabe,_0x10155f['options']);return _0x710af9[_0xa0b2('0x4f')](_0x10dabe);}})[_0xa0b2('0x1c')](function(_0x307769){if(_0x307769){_0x51b4ed=_0x307769['length'];if(!_0x10155f[_0xa0b2('0x26')]['hasOwnProperty']('nolimit')){_0x10dabe[_0xa0b2('0x18')]=qs[_0xa0b2('0x18')](_0x10155f[_0xa0b2('0x26')][_0xa0b2('0x18')]);_0x10dabe[_0xa0b2('0x17')]=qs[_0xa0b2('0x17')](_0x10155f[_0xa0b2('0x26')][_0xa0b2('0x17')]);}return _0x710af9[_0xa0b2('0x4f')](_0x10dabe);}})['then'](function(_0x5b1b2f){if(_0x5b1b2f){return _0x5b1b2f?{'count':_0x51b4ed,'rows':_0x5b1b2f}:null;}})['then'](respondWithResult(_0x5477ff,null))['catch'](handleError(_0x5477ff,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index c8700ee..d971ca0 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 _0xcf2f=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash'];(function(_0x4a715a,_0x432e9c){var _0x5a2e80=function(_0x171cc2){while(--_0x171cc2){_0x4a715a['push'](_0x4a715a['shift']());}};_0x5a2e80(++_0x432e9c);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x22675a,_0xb6231f){_0x22675a=_0x22675a-0x0;var _0x194b6e=_0xcf2f[_0x22675a];return _0x194b6e;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require('bluebird');var rp=require(_0xfcf2('0x5'));var fs=require('fs');var path=require(_0xfcf2('0x6'));var rimraf=require(_0xfcf2('0x7'));var config=require(_0xfcf2('0x8'));var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x1e6d99,_0x3a4950){return _0x1e6d99[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa30a=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('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 d345425..c20b684 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 _0xfc11=['debug','stringify','error','message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','CmCompany,\x20%s,\x20%s','request\x20sent'];(function(_0x25b068,_0xb6ac60){var _0xb9f40f=function(_0x28880b){while(--_0x28880b){_0x25b068['push'](_0x25b068['shift']());}};_0xb9f40f(++_0xb6ac60);}(_0xfc11,0x15a));var _0x1fc1=function(_0x3d113d,_0x2754d1){_0x3d113d=_0x3d113d-0x0;var _0x8d4460=_0xfc11[_0x3d113d];return _0x8d4460;};'use strict';var _=require(_0x1fc1('0x0'));var util=require(_0x1fc1('0x1'));var moment=require(_0x1fc1('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fc1('0x3'));var fs=require('fs');var Redis=require(_0x1fc1('0x4'));var db=require(_0x1fc1('0x5'))['db'];var utils=require(_0x1fc1('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x1fc1('0x7'));var jayson=require(_0x1fc1('0x8'));var client=jayson[_0x1fc1('0x9')][_0x1fc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c7f06,_0x560d12,_0x2bccbc){return new BPromise(function(_0x4edf62,_0x1fa946){return client['request'](_0x3c7f06,_0x2bccbc)[_0x1fc1('0xb')](function(_0x18d2c4){logger['info'](_0x1fc1('0xc'),_0x560d12,_0x1fc1('0xd'));logger[_0x1fc1('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x560d12,_0x1fc1('0xd'),JSON[_0x1fc1('0xf')](_0x18d2c4));if(_0x18d2c4[_0x1fc1('0x10')]){if(_0x18d2c4[_0x1fc1('0x10')]['code']===0x1f4){logger[_0x1fc1('0x10')](_0x1fc1('0xc'),_0x560d12,_0x18d2c4[_0x1fc1('0x10')][_0x1fc1('0x11')]);return _0x1fa946(_0x18d2c4[_0x1fc1('0x10')][_0x1fc1('0x11')]);}logger[_0x1fc1('0x10')](_0x1fc1('0xc'),_0x560d12,_0x18d2c4[_0x1fc1('0x10')]['message']);return _0x4edf62(_0x18d2c4[_0x1fc1('0x10')][_0x1fc1('0x11')]);}else{logger[_0x1fc1('0x12')](_0x1fc1('0xc'),_0x560d12,_0x1fc1('0xd'));_0x4edf62(_0x18d2c4['result'][_0x1fc1('0x11')]);}})[_0x1fc1('0x13')](function(_0x136a64){logger[_0x1fc1('0x10')]('CmCompany,\x20%s,\x20%s',_0x560d12,_0x136a64);_0x1fa946(_0x136a64);});});} \ No newline at end of file +var _0xe08a=['CmCompany,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x32b362,_0x1f606f){var _0x35a7d8=function(_0x3f7fb7){while(--_0x3f7fb7){_0x32b362['push'](_0x32b362['shift']());}};_0x35a7d8(++_0x1f606f);}(_0xe08a,0x1d4));var _0xae08=function(_0x58b1fd,_0x180215){_0x58b1fd=_0x58b1fd-0x0;var _0x37a385=_0xe08a[_0x58b1fd];return _0x37a385;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae08('0x0'));var BPromise=require(_0xae08('0x1'));var rs=require(_0xae08('0x2'));var fs=require('fs');var Redis=require(_0xae08('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xae08('0x4'));var logger=require('../../config/logger')(_0xae08('0x5'));var config=require(_0xae08('0x6'));var jayson=require(_0xae08('0x7'));var client=jayson[_0xae08('0x8')][_0xae08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23d168,_0x564b95,_0x4f9fff){return new BPromise(function(_0x2d303b,_0xeb31f3){return client[_0xae08('0xa')](_0x23d168,_0x4f9fff)[_0xae08('0xb')](function(_0x5e603b){logger['info'](_0xae08('0xc'),_0x564b95,_0xae08('0xd'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x564b95,_0xae08('0xd'),JSON['stringify'](_0x5e603b));if(_0x5e603b['error']){if(_0x5e603b[_0xae08('0xe')][_0xae08('0xf')]===0x1f4){logger[_0xae08('0xe')]('CmCompany,\x20%s,\x20%s',_0x564b95,_0x5e603b[_0xae08('0xe')][_0xae08('0x10')]);return _0xeb31f3(_0x5e603b[_0xae08('0xe')]['message']);}logger[_0xae08('0xe')](_0xae08('0xc'),_0x564b95,_0x5e603b[_0xae08('0xe')]['message']);return _0x2d303b(_0x5e603b[_0xae08('0xe')][_0xae08('0x10')]);}else{logger[_0xae08('0x11')](_0xae08('0xc'),_0x564b95,_0xae08('0xd'));_0x2d303b(_0x5e603b[_0xae08('0x12')]['message']);}})[_0xae08('0x13')](function(_0x224b43){logger[_0xae08('0xe')]('CmCompany,\x20%s,\x20%s',_0x564b95,_0x224b43);_0xeb31f3(_0x224b43);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index eda8a2f..4708414 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 _0xaaf7=['/:id','show','/:id/contacts','getContacts','create','post','addContacts','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x196fe9,_0x47e6e5){var _0x1ff195=function(_0x6d1b80){while(--_0x6d1b80){_0x196fe9['push'](_0x196fe9['shift']());}};_0x1ff195(++_0x47e6e5);}(_0xaaf7,0x79));var _0x7aaf=function(_0x5b1389,_0x3f0664){_0x5b1389=_0x5b1389-0x0;var _0x559a88=_0xaaf7[_0x5b1389];return _0x559a88;};'use strict';var multer=require(_0x7aaf('0x0'));var util=require(_0x7aaf('0x1'));var path=require(_0x7aaf('0x2'));var timeout=require(_0x7aaf('0x3'));var express=require(_0x7aaf('0x4'));var router=express[_0x7aaf('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7aaf('0x6'));var config=require(_0x7aaf('0x7'));var controller=require('./cmCompany.controller');router[_0x7aaf('0x8')]('/',auth[_0x7aaf('0x9')](),controller[_0x7aaf('0xa')]);router[_0x7aaf('0x8')](_0x7aaf('0xb'),auth[_0x7aaf('0x9')](),controller[_0x7aaf('0xc')]);router[_0x7aaf('0x8')](_0x7aaf('0xd'),auth[_0x7aaf('0x9')](),controller[_0x7aaf('0xe')]);router['post']('/',auth[_0x7aaf('0x9')](),controller[_0x7aaf('0xf')]);router[_0x7aaf('0x10')](_0x7aaf('0xd'),auth[_0x7aaf('0x9')](),controller[_0x7aaf('0x11')]);router[_0x7aaf('0x12')](_0x7aaf('0xb'),auth[_0x7aaf('0x9')](),controller[_0x7aaf('0x13')]);router['delete'](_0x7aaf('0xb'),auth[_0x7aaf('0x9')](),controller[_0x7aaf('0x14')]);module[_0x7aaf('0x15')]=router; \ No newline at end of file +var _0xcea0=['get','isAuthenticated','index','/:id/contacts','post','create','/:id','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment'];(function(_0x28a83b,_0x590948){var _0x55b99d=function(_0x2cf03d){while(--_0x2cf03d){_0x28a83b['push'](_0x28a83b['shift']());}};_0x55b99d(++_0x590948);}(_0xcea0,0x1ae));var _0x0cea=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0xcea0[_0x209941];return _0x1e8729;};'use strict';var multer=require('multer');var util=require(_0x0cea('0x0'));var path=require('path');var timeout=require(_0x0cea('0x1'));var express=require('express');var router=express[_0x0cea('0x2')]();var auth=require(_0x0cea('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0cea('0x4'));var controller=require('./cmCompany.controller');router[_0x0cea('0x5')]('/',auth[_0x0cea('0x6')](),controller[_0x0cea('0x7')]);router['get']('/:id',auth[_0x0cea('0x6')](),controller['show']);router['get'](_0x0cea('0x8'),auth['isAuthenticated'](),controller['getContacts']);router[_0x0cea('0x9')]('/',auth['isAuthenticated'](),controller[_0x0cea('0xa')]);router[_0x0cea('0x9')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router['put'](_0x0cea('0xb'),auth['isAuthenticated'](),controller[_0x0cea('0xc')]);router[_0x0cea('0xd')](_0x0cea('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x0cea('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 15f6959..78f48d4 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 _0xc7fb=['exports','STRING','TEXT','UNSIGNED','DATE','NOW','sequelize'];(function(_0x186af3,_0x280b2f){var _0x4c920d=function(_0x263641){while(--_0x263641){_0x186af3['push'](_0x186af3['shift']());}};_0x4c920d(++_0x280b2f);}(_0xc7fb,0x13a));var _0xbc7f=function(_0x38c1b8,_0x18e663){_0x38c1b8=_0x38c1b8-0x0;var _0xd0c0c=_0xc7fb[_0x38c1b8];return _0xd0c0c;};'use strict';var _=require('lodash');var Sequelize=require(_0xbc7f('0x0'));module[_0xbc7f('0x1')]={'firstName':{'type':Sequelize[_0xbc7f('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xbc7f('0x2')]},'street':{'type':Sequelize[_0xbc7f('0x2')]},'postalCode':{'type':Sequelize[_0xbc7f('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xbc7f('0x2')]},'dateOfBirth':{'type':Sequelize[_0xbc7f('0x2')]},'description':{'type':Sequelize[_0xbc7f('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xbc7f('0x2')]},'fax':{'type':Sequelize[_0xbc7f('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xbc7f('0x2')]},'facebook':{'type':Sequelize[_0xbc7f('0x2')]},'fb_data':{'type':Sequelize[_0xbc7f('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0xbc7f('0x2')]},'teams':{'type':Sequelize[_0xbc7f('0x2')]},'viber':{'type':Sequelize[_0xbc7f('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xbc7f('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xbc7f('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xbc7f('0x5')],'defaultValue':Sequelize[_0xbc7f('0x6')]}}; \ No newline at end of file +var _0x1e64=['exports','STRING','TEXT','INTEGER','UNSIGNED','DATE'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1e64,0x198));var _0x41e6=function(_0x3475d5,_0x54ddb0){_0x3475d5=_0x3475d5-0x0;var _0x2f57b6=_0x1e64[_0x3475d5];return _0x2f57b6;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x41e6('0x0')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x41e6('0x1')]},'street':{'type':Sequelize[_0x41e6('0x1')]},'postalCode':{'type':Sequelize[_0x41e6('0x1')]},'city':{'type':Sequelize[_0x41e6('0x1')]},'country':{'type':Sequelize[_0x41e6('0x1')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x41e6('0x2')]},'phone':{'type':Sequelize[_0x41e6('0x1')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x41e6('0x1')]},'email':{'type':Sequelize[_0x41e6('0x1')]},'url':{'type':Sequelize[_0x41e6('0x1')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x41e6('0x1')]},'twitter':{'type':Sequelize[_0x41e6('0x1')]},'skype':{'type':Sequelize[_0x41e6('0x1')]},'teams':{'type':Sequelize[_0x41e6('0x1')]},'viber':{'type':Sequelize[_0x41e6('0x1')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x41e6('0x1')]},'telegram':{'type':Sequelize[_0x41e6('0x1')]},'UserId':{'type':Sequelize[_0x41e6('0x3')]},'priority':{'type':Sequelize[_0x41e6('0x3')](0x2)[_0x41e6('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x41e6('0x5')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 0305b58..67c2a2c 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 _0x84e5=['catch','destroy','find','params','describe','startsWith','cf_','columnName','findAll','displayName','alias','custom','type','body','get','mergeWith','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','create','bulkCreate','each','duplicates','$or','ListId','findOrCreate','spread','error','Tag','$and','push','CmCustomField','omit','cf_%d','pickBy','setFields','id\x20=\x20?','text','values','phone','getTags','rawAttributes','filters','options','setTags','findOne','ids','getHoppers','merge','count','includeAll','include','ContactId','rows','getHopperFinals','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','socket_timestamp','split','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','File\x20uploaded\x20correctly!','pid','createReadStream','import','User','agent','binding','firstName','../../components/import/cm/csv2','stringify','message','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','./cmContact.socket','register','status','end','json','offset','limit','Content-Range','apply','reject','save','update','name','send','index','CmContact','then','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','cm_contacts','c.deletedAt\x20IS\x20NULL','expr','parse','advancedFilter','forEach','condition','value','and','tableAlias','\x20IN\x20?','\x20=\x20?','\x20>\x20?','\x20<\x20?','map','filter','isNil','isEmpty','c.ListId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','DESC','group','c.id','QueryTypes','clone','COUNT(*)','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','having','left_join','cm_contact_has_tags','t.id\x20=\x20ct.TagId','t.id\x20IN\x20?','toString','keyBy','sequelize','GROUP_CONCAT(DISTINCT\x20t.id)','ct.CmContactId\x20=\x20c.id','TagIds','Tags'];(function(_0x1dc66f,_0x2a33ab){var _0x47f546=function(_0x3eb496){while(--_0x3eb496){_0x1dc66f['push'](_0x1dc66f['shift']());}};_0x47f546(++_0x2a33ab);}(_0x84e5,0x6d));var _0x584e=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x84e5[_0x3740fe];return _0x55492b;};'use strict';var pdf=require(_0x584e('0x0'));var emlformat=require(_0x584e('0x1'));var rimraf=require(_0x584e('0x2'));var zipdir=require(_0x584e('0x3'));var jsonpatch=require(_0x584e('0x4'));var rp=require(_0x584e('0x5'));var moment=require(_0x584e('0x6'));var BPromise=require(_0x584e('0x7'));var Mustache=require(_0x584e('0x8'));var util=require(_0x584e('0x9'));var path=require(_0x584e('0xa'));var sox=require(_0x584e('0xb'));var csv=require('to-csv');var ejs=require(_0x584e('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x584e('0xd'));var crypto=require(_0x584e('0xe'));var jsforce=require(_0x584e('0xf'));var deskjs=require(_0x584e('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x584e('0x11'));var authService=require(_0x584e('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x584e('0x13'));var logger=require('../../config/logger')(_0x584e('0x14'));var utils=require(_0x584e('0x15'));var config=require(_0x584e('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x584e('0x17')](config[_0x584e('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x584e('0x18')]));require(_0x584e('0x19'))[_0x584e('0x1a')](socket);function respondWithStatusCode(_0x3570fb,_0x359eac){_0x359eac=_0x359eac||0xcc;return function(_0x538b31){if(_0x538b31){return _0x3570fb['sendStatus'](_0x359eac);}return _0x3570fb[_0x584e('0x1b')](_0x359eac)[_0x584e('0x1c')]();};}function respondWithResult(_0x502c81,_0xf4c199){_0xf4c199=_0xf4c199||0xc8;return function(_0x48dd64){if(_0x48dd64){return _0x502c81[_0x584e('0x1b')](_0xf4c199)[_0x584e('0x1d')](_0x48dd64);}};}function respondWithFilteredResult(_0x224890,_0x12b098){return function(_0x341b2b){if(_0x341b2b){var _0x9268d0=_0x341b2b['count'],_0x5a34c4=_0x12b098[_0x584e('0x1e')],_0x11485a=_0x12b098[_0x584e('0x1e')]+_0x12b098[_0x584e('0x1f')],_0x29d339;if(_0x11485a>=_0x9268d0){_0x11485a=_0x9268d0;_0x29d339=0xc8;}else{_0x29d339=0xce;}_0x224890[_0x584e('0x1b')](_0x29d339);return _0x224890['set'](_0x584e('0x20'),_0x5a34c4+'-'+_0x11485a+'/'+_0x9268d0)[_0x584e('0x1d')](_0x341b2b);}return null;};}function patchUpdates(_0x1238cc){return function(_0x2c7ef7){try{jsonpatch[_0x584e('0x21')](_0x2c7ef7,_0x1238cc,!![]);}catch(_0x5e0e56){return BPromise[_0x584e('0x22')](_0x5e0e56);}return _0x2c7ef7[_0x584e('0x23')]();};}function saveUpdates(_0x1d995c,_0x4acdcb){return function(_0x5a5791){if(_0x5a5791){return _0x5a5791[_0x584e('0x24')](_0x1d995c)['then'](function(_0x46c2f4){return _0x46c2f4;});}return null;};}function removeEntity(_0x94c040,_0x4b1636){return function(_0x1ca567){if(_0x1ca567){return _0x1ca567['destroy']()['then'](function(){_0x94c040['status'](0xcc)[_0x584e('0x1c')]();});}};}function handleEntityNotFound(_0x494cf5,_0x290887){return function(_0x52f70f){if(!_0x52f70f){_0x494cf5['sendStatus'](0x194);}return _0x52f70f;};}function handleError(_0x57f677,_0x41b999){_0x41b999=_0x41b999||0x1f4;return function(_0x2867dd){logger['error'](_0x2867dd['stack']);if(_0x2867dd[_0x584e('0x25')]){delete _0x2867dd[_0x584e('0x25')];}_0x57f677[_0x584e('0x1b')](_0x41b999)[_0x584e('0x26')](_0x2867dd);};}exports[_0x584e('0x27')]=function(_0x21bc1b,_0x42c4ff){var _0x20f52a={},_0x2d1236={},_0x1d6340={'count':0x0,'rows':[]};return db[_0x584e('0x28')]['describe']()[_0x584e('0x29')](function(_0x10a9cf){_0x2d1236[_0x584e('0x2a')]=_[_0x584e('0x2b')](_0x10a9cf);_0x2d1236['query']=_[_0x584e('0x2b')](_0x21bc1b[_0x584e('0x2c')]);_0x2d1236['filters']=_['intersection'](_0x2d1236[_0x584e('0x2a')],_0x2d1236['query']);_0x20f52a[_0x584e('0x2d')]=_[_0x584e('0x2e')](_0x2d1236[_0x584e('0x2a')],qs['fields'](_0x21bc1b[_0x584e('0x2c')][_0x584e('0x2f')]));_0x20f52a[_0x584e('0x2d')]=_0x20f52a[_0x584e('0x2d')][_0x584e('0x30')]?_0x20f52a[_0x584e('0x2d')]:_0x2d1236[_0x584e('0x2a')];if(!_0x21bc1b[_0x584e('0x2c')][_0x584e('0x31')](_0x584e('0x32'))){_0x20f52a[_0x584e('0x1f')]=qs['limit'](_0x21bc1b[_0x584e('0x2c')][_0x584e('0x1f')]);_0x20f52a[_0x584e('0x1e')]=qs['offset'](_0x21bc1b[_0x584e('0x2c')][_0x584e('0x1e')]);}_0x20f52a[_0x584e('0x33')]=qs[_0x584e('0x34')](_0x21bc1b[_0x584e('0x2c')][_0x584e('0x34')]);_0x20f52a[_0x584e('0x35')]=qs['filters'](_[_0x584e('0x36')](_0x21bc1b[_0x584e('0x2c')],_0x2d1236['filters']));var _0x4b1bdc=[];var _0x1a030c=squel['select']()[_0x584e('0x37')]('id')['field'](_0x584e('0x25'))[_0x584e('0x37')](_0x584e('0x38'))[_0x584e('0x39')](_0x584e('0x3a'));var _0x4fec54=squel['select']()[_0x584e('0x39')](_0x584e('0x3b'),'c')[_0x584e('0x35')](_0x584e('0x3c'));var _0x6d9ed8=squel[_0x584e('0x3d')]();if(_0x21bc1b[_0x584e('0x2c')]['advancedFilter']){var _0x19e541=JSON[_0x584e('0x3e')](_0x21bc1b[_0x584e('0x2c')][_0x584e('0x3f')]);_[_0x584e('0x2b')](_0x19e541)[_0x584e('0x40')](function(_0xc10519){var _0x44f326=_0x19e541[_0xc10519];switch(_0x44f326[_0x584e('0x41')]){case'IS':if(_['isArray'](_0x44f326[_0x584e('0x42')])&&_0x44f326[_0x584e('0x42')][_0x584e('0x30')]>0x1){_0x6d9ed8[_0x584e('0x43')](_0x44f326[_0x584e('0x44')]+'.'+_0xc10519+_0x584e('0x45'),_0x44f326[_0x584e('0x42')]);}else{_0x6d9ed8[_0x584e('0x43')](_0x44f326[_0x584e('0x44')]+'.'+_0xc10519+'\x20=\x20?',_0x44f326[_0x584e('0x42')][0x0]);}break;case'=':_0x6d9ed8[_0x584e('0x43')](_0x44f326[_0x584e('0x44')]+'.'+_0xc10519+_0x584e('0x46'),_0x44f326[_0x584e('0x42')]);break;case'LIKE':_0x6d9ed8['and'](_0x44f326[_0x584e('0x44')]+'.'+_0xc10519+'\x20LIKE\x20?','%'+_0x44f326[_0x584e('0x42')]+'%');break;case'>':_0x6d9ed8[_0x584e('0x43')](_0x44f326[_0x584e('0x44')]+'.'+_0xc10519+_0x584e('0x47'),_0x44f326['value']);break;case'<':_0x6d9ed8['and'](_0x44f326[_0x584e('0x44')]+'.'+_0xc10519+_0x584e('0x48'),_0x44f326[_0x584e('0x42')]);break;}});}else{var _0x228ce8=_(Object[_0x584e('0x2b')](_0x21bc1b[_0x584e('0x2c')]))[_0x584e('0x49')](function(_0x8b53ed){return _0x10a9cf[_0x584e('0x31')](_0x8b53ed)?_0x8b53ed:undefined;})[_0x584e('0x4a')](function(_0x6e2900){return!_[_0x584e('0x4b')](_0x6e2900);})[_0x584e('0x42')]();if(!_[_0x584e('0x4c')](_0x228ce8)){_0x228ce8[_0x584e('0x40')](function(_0x317459){if(_0x317459==='ListId'){_0x4fec54[_0x584e('0x35')](_0x584e('0x4d'),[][_0x584e('0x4e')](_0x21bc1b[_0x584e('0x2c')][_0x317459]));}else{_0x4fec54[_0x584e('0x35')]('c.'+_0x317459+_0x584e('0x46'),_0x21bc1b['query'][_0x317459]);}});}if(_0x21bc1b[_0x584e('0x2c')][_0x584e('0x4a')]){var _0x2546cb=_0x21bc1b[_0x584e('0x2c')][_0x584e('0x4a')][_0x584e('0x4f')]('\x5c','\x5c\x5c')[_0x584e('0x4f')]('\x27\x27',_0x584e('0x50'));if(qs[_0x584e('0x51')](_0x2546cb)){_0x6d9ed8['or']('c.id\x20LIKE\x20?',_0x2546cb+'%');_0x6d9ed8['or'](_0x584e('0x52'),_0x2546cb+'%');_0x6d9ed8['or'](_0x584e('0x53'),_0x2546cb+'%');_0x6d9ed8['or']('c.fax\x20LIKE\x20?',_0x2546cb+'%');}else if(qs[_0x584e('0x54')](_0x2546cb)){_0x6d9ed8['or'](_0x584e('0x55'),_0x2546cb+'%');}else{_0x6d9ed8['or'](_0x584e('0x55'),_0x2546cb+'%');_0x6d9ed8['or'](_0x584e('0x56'),_0x2546cb+'%');_0x6d9ed8['or']('c.lastName\x20LIKE\x20?',_0x2546cb+'%');}}}_0x4fec54[_0x584e('0x35')](_0x6d9ed8);if(_0x20f52a[_0x584e('0x33')]){_0x20f52a[_0x584e('0x33')][_0x584e('0x40')](function(_0x2aca58){_0x4fec54['order']('c.'+_0x2aca58[0x0],_0x2aca58[0x1]===_0x584e('0x57')?![]:!![]);});}_0x4fec54[_0x584e('0x58')](_0x584e('0x59'));var _0x57b70e={'type':db['Sequelize'][_0x584e('0x5a')]['SELECT'],'raw':!![]};var _0x12d712=_0x4fec54[_0x584e('0x5b')]()[_0x584e('0x37')](_0x584e('0x5c'));if(!_0x21bc1b['query']['advancedFilter']){if(_0x21bc1b[_0x584e('0x2c')][_0x584e('0x5d')]){var _0x1206f4=_[_0x584e('0x5e')](_0x21bc1b[_0x584e('0x2c')][_0x584e('0x5d')])?_0x21bc1b[_0x584e('0x2c')][_0x584e('0x5d')]:new Array(_0x21bc1b[_0x584e('0x2c')]['tag']);var _0x14ca5b=squel['expr']();_0x1206f4[_0x584e('0x40')](function(_0xd18124){_0x14ca5b['or'](_0x584e('0x5f'),'%,'+_0xd18124+',%');});_0x4fec54[_0x584e('0x60')](_0x14ca5b);_0x12d712[_0x584e('0x61')](_0x584e('0x62'),'ct','ct.CmContactId\x20=\x20c.id');_0x12d712[_0x584e('0x61')](_0x584e('0x3a'),'t',_0x584e('0x63'));_0x12d712[_0x584e('0x35')](_0x584e('0x64'),_0x1206f4);}}db['sequelize'][_0x584e('0x2c')](_0x1a030c[_0x584e('0x65')](),_0x57b70e)['then'](function(_0xb06d11){_0x4b1bdc=_[_0x584e('0x66')](_0xb06d11,'id');return db[_0x584e('0x67')][_0x584e('0x2c')](_0x12d712['toString'](),_0x57b70e);})[_0x584e('0x29')](function(_0x310a3f){_0x1d6340['count']=_0x310a3f[_0x584e('0x30')];_0x57b70e=_['merge'](_0x57b70e,{'model':db[_0x584e('0x28')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4fec54[_0x584e('0x37')]('c.*');_0x4fec54[_0x584e('0x37')](_0x584e('0x68'),'TagIds');_0x4fec54[_0x584e('0x61')](_0x584e('0x62'),'ct',_0x584e('0x69'));_0x4fec54['left_join'](_0x584e('0x3a'),'t',_0x584e('0x63'));if(_0x20f52a[_0x584e('0x1f')]){_0x4fec54[_0x584e('0x1f')](_0x20f52a['limit']);}if(_0x20f52a['offset']){_0x4fec54[_0x584e('0x1e')](_0x20f52a['offset']);}db[_0x584e('0x67')][_0x584e('0x2c')](_0x4fec54[_0x584e('0x65')](),_0x57b70e)[_0x584e('0x29')](function(_0xb5102d){_0xb5102d['forEach'](function(_0x5318fa){if(_0x5318fa[_0x584e('0x6a')]){_0x5318fa[_0x584e('0x6b')]=[];_0x5318fa['TagIds']['split'](',')[_0x584e('0x40')](function(_0x37457b){_0x5318fa[_0x584e('0x6b')]['push'](_0x4b1bdc[_0x37457b]);});}delete _0x5318fa[_0x584e('0x6a')];});_0x1d6340['rows']=_0xb5102d;return _0x1d6340;})['then'](respondWithFilteredResult(_0x42c4ff,_0x20f52a))[_0x584e('0x6c')](handleError(_0x42c4ff,null));});});};exports[_0x584e('0x6d')]=function(_0x581807,_0x44fd50){return db[_0x584e('0x28')][_0x584e('0x6e')]({'where':{'id':_0x581807[_0x584e('0x6f')]['id']}})[_0x584e('0x29')](handleEntityNotFound(_0x44fd50,null))[_0x584e('0x29')](removeEntity(_0x44fd50,null))[_0x584e('0x6c')](handleError(_0x44fd50,null));};exports['describe']=function(_0x2dce05,_0x75d58b){return db[_0x584e('0x28')][_0x584e('0x70')]()[_0x584e('0x29')](function(_0x2ea9c8){for(var _0x5497a3=0x0;_0x5497a3=_0x29772f){_0x18a746=_0x29772f;_0x4f4e48=0xc8;}else{_0x4f4e48=0xce;}_0x20644b['status'](_0x4f4e48);return _0x20644b['set'](_0xae0d('0x22'),_0x4f6d05+'-'+_0x18a746+'/'+_0x29772f)[_0xae0d('0x20')](_0x2c2188);}return null;};}function patchUpdates(_0x32317e){return function(_0x169c87){try{jsonpatch[_0xae0d('0x23')](_0x169c87,_0x32317e,!![]);}catch(_0x221cb7){return BPromise[_0xae0d('0x24')](_0x221cb7);}return _0x169c87['save']();};}function saveUpdates(_0x1af8a2,_0x1eb3a4){return function(_0x5cbb20){if(_0x5cbb20){return _0x5cbb20['update'](_0x1af8a2)[_0xae0d('0x25')](function(_0x3db7a7){return _0x3db7a7;});}return null;};}function removeEntity(_0x2f1248,_0x1cec78){return function(_0x39d0a8){if(_0x39d0a8){return _0x39d0a8[_0xae0d('0x26')]()[_0xae0d('0x25')](function(){_0x2f1248[_0xae0d('0x1f')](0xcc)[_0xae0d('0x1e')]();});}};}function handleEntityNotFound(_0x5967fd,_0x821998){return function(_0x16a8ef){if(!_0x16a8ef){_0x5967fd[_0xae0d('0x1d')](0x194);}return _0x16a8ef;};}function handleError(_0x45cc1b,_0x17ada2){_0x17ada2=_0x17ada2||0x1f4;return function(_0xfa3806){logger[_0xae0d('0x27')](_0xfa3806[_0xae0d('0x28')]);if(_0xfa3806['name']){delete _0xfa3806[_0xae0d('0x29')];}_0x45cc1b[_0xae0d('0x1f')](_0x17ada2)['send'](_0xfa3806);};}exports['index']=function(_0xf898e6,_0x4b3d09){var _0x5a969a={},_0x340ad8={},_0x3fa2bb={'count':0x0,'rows':[]};return db[_0xae0d('0x2a')][_0xae0d('0x2b')]()[_0xae0d('0x25')](function(_0x548cab){_0x340ad8[_0xae0d('0x2c')]=_[_0xae0d('0x2d')](_0x548cab);_0x340ad8[_0xae0d('0x2e')]=_[_0xae0d('0x2d')](_0xf898e6[_0xae0d('0x2e')]);_0x340ad8[_0xae0d('0x2f')]=_[_0xae0d('0x30')](_0x340ad8['model'],_0x340ad8[_0xae0d('0x2e')]);_0x5a969a[_0xae0d('0x31')]=_[_0xae0d('0x30')](_0x340ad8['model'],qs[_0xae0d('0x32')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x32')]));_0x5a969a[_0xae0d('0x31')]=_0x5a969a['attributes']['length']?_0x5a969a[_0xae0d('0x31')]:_0x340ad8['model'];if(!_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x33')](_0xae0d('0x34'))){_0x5a969a[_0xae0d('0x35')]=qs[_0xae0d('0x35')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x35')]);_0x5a969a[_0xae0d('0x21')]=qs[_0xae0d('0x21')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x21')]);}_0x5a969a[_0xae0d('0x36')]=qs[_0xae0d('0x37')](_0xf898e6[_0xae0d('0x2e')]['sort']);_0x5a969a[_0xae0d('0x38')]=qs[_0xae0d('0x2f')](_[_0xae0d('0x39')](_0xf898e6[_0xae0d('0x2e')],_0x340ad8[_0xae0d('0x2f')]));var _0x3cf6a8=[];var _0x591f3c=squel[_0xae0d('0x3a')]()[_0xae0d('0x3b')]('id')[_0xae0d('0x3b')](_0xae0d('0x29'))['field'](_0xae0d('0x3c'))[_0xae0d('0x3d')](_0xae0d('0x3e'));var _0x55f8cf=squel[_0xae0d('0x3a')]()['from'](_0xae0d('0x3f'),'c')[_0xae0d('0x38')](_0xae0d('0x40'));var _0x425e6f=squel[_0xae0d('0x41')]();if(_0xf898e6[_0xae0d('0x2e')]['advancedFilter']){var _0x2acd6d=JSON[_0xae0d('0x42')](_0xf898e6['query'][_0xae0d('0x43')]);_[_0xae0d('0x2d')](_0x2acd6d)[_0xae0d('0x44')](function(_0xcf6cfc){var _0x502b63=_0x2acd6d[_0xcf6cfc];switch(_0x502b63['condition']){case'IS':if(_['isArray'](_0x502b63[_0xae0d('0x45')])&&_0x502b63[_0xae0d('0x45')][_0xae0d('0x46')]>0x1){_0x425e6f[_0xae0d('0x47')](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x49'),_0x502b63[_0xae0d('0x45')]);}else{_0x425e6f['and'](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x4a'),_0x502b63[_0xae0d('0x45')][0x0]);}break;case'=':_0x425e6f['and'](_0x502b63['tableAlias']+'.'+_0xcf6cfc+'\x20=\x20?',_0x502b63[_0xae0d('0x45')]);break;case _0xae0d('0x4b'):_0x425e6f[_0xae0d('0x47')](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x4c'),'%'+_0x502b63[_0xae0d('0x45')]+'%');break;case'>':_0x425e6f['and'](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+'\x20>\x20?',_0x502b63[_0xae0d('0x45')]);break;case'<':_0x425e6f[_0xae0d('0x47')](_0x502b63[_0xae0d('0x48')]+'.'+_0xcf6cfc+_0xae0d('0x4d'),_0x502b63[_0xae0d('0x45')]);break;}});}else{var _0x29d4e5=_(Object[_0xae0d('0x2d')](_0xf898e6[_0xae0d('0x2e')]))[_0xae0d('0x4e')](function(_0x3e3b5f){return _0x548cab['hasOwnProperty'](_0x3e3b5f)?_0x3e3b5f:undefined;})['filter'](function(_0x1dc3c6){return!_[_0xae0d('0x4f')](_0x1dc3c6);})[_0xae0d('0x45')]();if(!_[_0xae0d('0x50')](_0x29d4e5)){_0x29d4e5[_0xae0d('0x44')](function(_0x48a2aa){if(_0x48a2aa==='ListId'){_0x55f8cf['where'](_0xae0d('0x51'),[][_0xae0d('0x52')](_0xf898e6[_0xae0d('0x2e')][_0x48a2aa]));}else{_0x55f8cf[_0xae0d('0x38')]('c.'+_0x48a2aa+_0xae0d('0x4a'),_0xf898e6[_0xae0d('0x2e')][_0x48a2aa]);}});}if(_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x53')]){var _0x181c53=_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x53')][_0xae0d('0x54')]('\x5c','\x5c\x5c')[_0xae0d('0x54')]('\x27\x27',_0xae0d('0x55'));if(qs[_0xae0d('0x56')](_0x181c53)){_0x425e6f['or']('c.id\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or']('c.phone\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or']('c.mobile\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or'](_0xae0d('0x57'),_0x181c53+'%');}else if(qs[_0xae0d('0x58')](_0x181c53)){_0x425e6f['or'](_0xae0d('0x59'),_0x181c53+'%');}else{_0x425e6f['or']('c.email\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or']('c.firstName\x20LIKE\x20?',_0x181c53+'%');_0x425e6f['or'](_0xae0d('0x5a'),_0x181c53+'%');}}}_0x55f8cf['where'](_0x425e6f);if(_0x5a969a['order']){_0x5a969a[_0xae0d('0x36')][_0xae0d('0x44')](function(_0x2e87d3){_0x55f8cf[_0xae0d('0x36')]('c.'+_0x2e87d3[0x0],_0x2e87d3[0x1]==='DESC'?![]:!![]);});}_0x55f8cf['group'](_0xae0d('0x5b'));var _0x3ca4cd={'type':db[_0xae0d('0x5c')][_0xae0d('0x5d')][_0xae0d('0x5e')],'raw':!![]};var _0x3ecb7b=_0x55f8cf[_0xae0d('0x5f')]()[_0xae0d('0x3b')](_0xae0d('0x60'));if(!_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x43')]){if(_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x61')]){var _0x580539=_[_0xae0d('0x62')](_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x61')])?_0xf898e6[_0xae0d('0x2e')]['tag']:new Array(_0xf898e6[_0xae0d('0x2e')][_0xae0d('0x61')]);var _0x4c7666=squel[_0xae0d('0x41')]();_0x580539[_0xae0d('0x44')](function(_0x394774){_0x4c7666['or'](_0xae0d('0x63'),'%,'+_0x394774+',%');});_0x55f8cf[_0xae0d('0x64')](_0x4c7666);_0x3ecb7b['left_join'](_0xae0d('0x65'),'ct','ct.CmContactId\x20=\x20c.id');_0x3ecb7b[_0xae0d('0x66')](_0xae0d('0x3e'),'t',_0xae0d('0x67'));_0x3ecb7b[_0xae0d('0x38')](_0xae0d('0x68'),_0x580539);}}db[_0xae0d('0x69')][_0xae0d('0x2e')](_0x591f3c[_0xae0d('0x6a')](),_0x3ca4cd)[_0xae0d('0x25')](function(_0x350c96){_0x3cf6a8=_[_0xae0d('0x6b')](_0x350c96,'id');return db[_0xae0d('0x69')][_0xae0d('0x2e')](_0x3ecb7b['toString'](),_0x3ca4cd);})[_0xae0d('0x25')](function(_0x5c65f2){_0x3fa2bb[_0xae0d('0x6c')]=_0x5c65f2[_0xae0d('0x46')];_0x3ca4cd=_[_0xae0d('0x6d')](_0x3ca4cd,{'model':db[_0xae0d('0x2a')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x55f8cf[_0xae0d('0x3b')](_0xae0d('0x6e'));_0x55f8cf[_0xae0d('0x3b')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xae0d('0x6f'));_0x55f8cf[_0xae0d('0x66')](_0xae0d('0x65'),'ct','ct.CmContactId\x20=\x20c.id');_0x55f8cf['left_join']('tools_tags','t','t.id\x20=\x20ct.TagId');if(_0x5a969a[_0xae0d('0x35')]){_0x55f8cf[_0xae0d('0x35')](_0x5a969a[_0xae0d('0x35')]);}if(_0x5a969a[_0xae0d('0x21')]){_0x55f8cf[_0xae0d('0x21')](_0x5a969a['offset']);}db[_0xae0d('0x69')][_0xae0d('0x2e')](_0x55f8cf[_0xae0d('0x6a')](),_0x3ca4cd)[_0xae0d('0x25')](function(_0x1b0f5d){_0x1b0f5d[_0xae0d('0x44')](function(_0x3faaa3){if(_0x3faaa3[_0xae0d('0x6f')]){_0x3faaa3[_0xae0d('0x70')]=[];_0x3faaa3[_0xae0d('0x6f')][_0xae0d('0x71')](',')[_0xae0d('0x44')](function(_0x38f6c4){_0x3faaa3['Tags']['push'](_0x3cf6a8[_0x38f6c4]);});}delete _0x3faaa3[_0xae0d('0x6f')];});_0x3fa2bb[_0xae0d('0x72')]=_0x1b0f5d;return _0x3fa2bb;})[_0xae0d('0x25')](respondWithFilteredResult(_0x4b3d09,_0x5a969a))[_0xae0d('0x73')](handleError(_0x4b3d09,null));});});};exports[_0xae0d('0x26')]=function(_0x5bec95,_0x5f341d){return db['CmContact'][_0xae0d('0x74')]({'where':{'id':_0x5bec95[_0xae0d('0x75')]['id']}})[_0xae0d('0x25')](handleEntityNotFound(_0x5f341d,null))[_0xae0d('0x25')](removeEntity(_0x5f341d,null))[_0xae0d('0x73')](handleError(_0x5f341d,null));};exports[_0xae0d('0x2b')]=function(_0x468291,_0x14a02f){return db[_0xae0d('0x2a')][_0xae0d('0x2b')]()[_0xae0d('0x25')](function(_0x527d09){for(var _0x4b1041=0x0;_0x4b1041{}\s\\|]/g,'-');_0x2e6e6b(null,util[_0x3228('0x20')](_0x3228('0x21'),path['basename'](_0x50bdc6[_0x3228('0x1e')],path['extname'](_0x50bdc6[_0x3228('0x1e')])),Date['now'](),path['extname'](_0x50bdc6[_0x3228('0x1e')])));}})});router[_0x3228('0x17')](_0x3228('0x22'),upload['single'](_0x3228('0x23')),controller[_0x3228('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1590a6,_0x27250e,_0x1e072f){_0x1e072f(null,path[_0x3228('0x1c')](config[_0x3228('0x1d')],_0x3228('0x25')));},'filename':function(_0x45dde1,_0x1f9902,_0x500526){_0x1f9902[_0x3228('0x1e')]=_0x1f9902['originalname'][_0x3228('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x500526(null,util[_0x3228('0x20')](_0x3228('0x21'),path[_0x3228('0x26')](_0x1f9902[_0x3228('0x1e')],path[_0x3228('0x27')](_0x1f9902[_0x3228('0x1e')])),Date[_0x3228('0x28')](),path['extname'](_0x1f9902['originalname'])));}})});router['post']('/upload',upload['single']('file'),controller['upload']);router['post'](_0x3228('0x29'),auth['isAuthenticated'](),controller['import']);router['put'](_0x3228('0xc'),auth[_0x3228('0xa')](),controller['update']);router[_0x3228('0x2a')](_0x3228('0xc'),auth[_0x3228('0xa')](),controller[_0x3228('0x2b')]);module[_0x3228('0x2c')]=router; \ No newline at end of file +var _0xaba6=['server/files/tmp','originalname','replace','format','basename','now','extname','/csv','root','%s-%s%s','file','upload','/upload/:id','import','put','update','delete','multer','path','express','../../config/environment','./cmContact.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','join'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0xaba6,0x1af));var _0x6aba=function(_0x5a67bb,_0x516504){_0x5a67bb=_0x5a67bb-0x0;var _0x48c706=_0xaba6[_0x5a67bb];return _0x48c706;};'use strict';var multer=require(_0x6aba('0x0'));var util=require('util');var path=require(_0x6aba('0x1'));var timeout=require('connect-timeout');var express=require(_0x6aba('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x3'));var controller=require(_0x6aba('0x4'));router[_0x6aba('0x5')]('/',auth['isAuthenticated'](),controller[_0x6aba('0x6')]);router[_0x6aba('0x5')](_0x6aba('0x7'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x9')]);router['get'](_0x6aba('0xa'),auth[_0x6aba('0x8')](),controller['show']);router[_0x6aba('0x5')](_0x6aba('0xb'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xc')]);router[_0x6aba('0x5')](_0x6aba('0xd'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xe')]);router[_0x6aba('0x5')](_0x6aba('0xf'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x10')]);router[_0x6aba('0x5')](_0x6aba('0x11'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x12')]);router['get'](_0x6aba('0x13'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x14')]);router[_0x6aba('0x15')](_0x6aba('0x16'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x17')]);router[_0x6aba('0x15')]('/',auth[_0x6aba('0x8')](),controller['create']);router[_0x6aba('0x15')](_0x6aba('0x18'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x19')]);router['post'](_0x6aba('0xb'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x1a')]);var upload=multer({'storage':multer[_0x6aba('0x1b')]({'destination':function(_0x5e82e8,_0x2f3c80,_0x35f4af){_0x35f4af(null,path[_0x6aba('0x1c')](config['root'],_0x6aba('0x1d')));},'filename':function(_0x432cc,_0x221d91,_0xe2f6f8){_0x221d91[_0x6aba('0x1e')]=_0x221d91[_0x6aba('0x1e')][_0x6aba('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe2f6f8(null,util[_0x6aba('0x20')]('%s-%s%s',path[_0x6aba('0x21')](_0x221d91[_0x6aba('0x1e')],path['extname'](_0x221d91[_0x6aba('0x1e')])),Date[_0x6aba('0x22')](),path[_0x6aba('0x23')](_0x221d91['originalname'])));}})});router['post'](_0x6aba('0x24'),upload['single']('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0x6aba('0x1b')]({'destination':function(_0x3c37cc,_0x3f7a53,_0x41d59a){_0x41d59a(null,path['join'](config[_0x6aba('0x25')],'server/files/tmp'));},'filename':function(_0x3e28d9,_0x27269f,_0xba8b3){_0x27269f[_0x6aba('0x1e')]=_0x27269f[_0x6aba('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xba8b3(null,util[_0x6aba('0x20')](_0x6aba('0x26'),path[_0x6aba('0x21')](_0x27269f[_0x6aba('0x1e')],path['extname'](_0x27269f[_0x6aba('0x1e')])),Date[_0x6aba('0x22')](),path[_0x6aba('0x23')](_0x27269f['originalname'])));}})});router[_0x6aba('0x15')]('/upload',upload['single'](_0x6aba('0x27')),controller[_0x6aba('0x28')]);router[_0x6aba('0x15')](_0x6aba('0x29'),auth[_0x6aba('0x8')](),controller[_0x6aba('0x2a')]);router[_0x6aba('0x2b')]('/:id',auth['isAuthenticated'](),controller[_0x6aba('0x2c')]);router[_0x6aba('0x2d')]('/:id',auth[_0x6aba('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 518ada0..5954d34 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 _0x72cb=['select','parse','values','isArray','stringify','BOOLEAN','sequelize','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type'];(function(_0x5f2afa,_0x3d2cd2){var _0xc21b56=function(_0x14825b){while(--_0x14825b){_0x5f2afa['push'](_0x5f2afa['shift']());}};_0xc21b56(++_0x3d2cd2);}(_0x72cb,0xd2));var _0xb72c=function(_0x433b73,_0x2c5b9c){_0x433b73=_0x433b73-0x0;var _0x398401=_0x72cb[_0x433b73];return _0x398401;};'use strict';var Sequelize=require(_0xb72c('0x0'));var _=require(_0xb72c('0x1'));module[_0xb72c('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x36e99f){return this[_0xb72c('0x3')](_0xb72c('0x4'));}},'alias':{'type':Sequelize[_0xb72c('0x5')],'allowNull':![],'set':function(_0x325ccd){this[_0xb72c('0x6')](_0xb72c('0x4'),_0x325ccd?_0x325ccd:this[_0xb72c('0x3')](_0xb72c('0x7')));}},'type':{'type':Sequelize[_0xb72c('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xb72c('0x8')](_0xb72c('0x9')),'get':function(){if(this[_0xb72c('0x3')](_0xb72c('0xa'))===_0xb72c('0xb')){return JSON[_0xb72c('0xc')](this[_0xb72c('0x3')](_0xb72c('0xd')));}else{return this[_0xb72c('0x3')]('values');}},'set':function(_0x4514e5){if(Array[_0xb72c('0xe')](_0x4514e5)){this[_0xb72c('0x6')](_0xb72c('0xd'),JSON[_0xb72c('0xf')](_0x4514e5));}else{this[_0xb72c('0x6')](_0xb72c('0xd'),_0x4514e5);}}},'required':{'type':Sequelize[_0xb72c('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0x6c86=['type','select','parse','values','stringify','BOOLEAN','lodash','exports','getDataValue','alias','STRING','setDataValue','name','TEXT','long'];(function(_0x3ab54a,_0xf327f1){var _0x2b8fcd=function(_0x124a71){while(--_0x124a71){_0x3ab54a['push'](_0x3ab54a['shift']());}};_0x2b8fcd(++_0xf327f1);}(_0x6c86,0x132));var _0x66c8=function(_0x5dea6a,_0x192e18){_0x5dea6a=_0x5dea6a-0x0;var _0x4d5435=_0x6c86[_0x5dea6a];return _0x4d5435;};'use strict';var Sequelize=require('sequelize');var _=require(_0x66c8('0x0'));module[_0x66c8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4650fe){return this[_0x66c8('0x2')](_0x66c8('0x3'));}},'alias':{'type':Sequelize[_0x66c8('0x4')],'allowNull':![],'set':function(_0x1e45f9){this[_0x66c8('0x5')](_0x66c8('0x3'),_0x1e45f9?_0x1e45f9:this['getDataValue'](_0x66c8('0x6')));}},'type':{'type':Sequelize[_0x66c8('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x66c8('0x7')](_0x66c8('0x8')),'get':function(){if(this['getDataValue'](_0x66c8('0x9'))===_0x66c8('0xa')){return JSON[_0x66c8('0xb')](this[_0x66c8('0x2')](_0x66c8('0xc')));}else{return this[_0x66c8('0x2')](_0x66c8('0xc'));}},'set':function(_0x181b9f){if(Array['isArray'](_0x181b9f)){this[_0x66c8('0x5')](_0x66c8('0xc'),JSON[_0x66c8('0xd')](_0x181b9f));}else{this['setDataValue'](_0x66c8('0xc'),_0x181b9f);}}},'required':{'type':Sequelize[_0x66c8('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index f8ad788..8b3e14a 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 _0xd51f=['pick','where','merge','map','type','key','VIRTUAL','field','filter','options','includeAll','include','rows','params','keys','find','catch','create','sequelize','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','save','update','then','error','stack','name','send','CmCustomField','rawAttributes','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x91e5da,_0x25ce34){var _0x5533f3=function(_0x15b980){while(--_0x15b980){_0x91e5da['push'](_0x91e5da['shift']());}};_0x5533f3(++_0x25ce34);}(_0xd51f,0xf0));var _0xfd51=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd51f[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xfd51('0x0'));var emlformat=require(_0xfd51('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfd51('0x2'));var jsonpatch=require(_0xfd51('0x3'));var rp=require('request-promise');var moment=require(_0xfd51('0x4'));var BPromise=require(_0xfd51('0x5'));var Mustache=require('mustache');var util=require(_0xfd51('0x6'));var path=require(_0xfd51('0x7'));var sox=require('sox');var csv=require(_0xfd51('0x8'));var ejs=require(_0xfd51('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfd51('0xa'));var crypto=require(_0xfd51('0xb'));var jsforce=require(_0xfd51('0xc'));var deskjs=require(_0xfd51('0xd'));var toCsv=require(_0xfd51('0x8'));var querystring=require('querystring');var Papa=require(_0xfd51('0xe'));var Redis=require(_0xfd51('0xf'));var authService=require(_0xfd51('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfd51('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xfd51('0x12'));var config=require(_0xfd51('0x13'));var db=require(_0xfd51('0x14'))['db'];function respondWithStatusCode(_0x5eb1d0,_0x4d968c){_0x4d968c=_0x4d968c||0xcc;return function(_0x5af174){if(_0x5af174){return _0x5eb1d0[_0xfd51('0x15')](_0x4d968c);}return _0x5eb1d0[_0xfd51('0x16')](_0x4d968c)[_0xfd51('0x17')]();};}function respondWithResult(_0x20bc8d,_0x2409f9){_0x2409f9=_0x2409f9||0xc8;return function(_0x10f0f5){if(_0x10f0f5){return _0x20bc8d[_0xfd51('0x16')](_0x2409f9)['json'](_0x10f0f5);}};}function respondWithFilteredResult(_0x473f6e,_0x37cbb8){return function(_0x28ee51){if(_0x28ee51){var _0x28c148=_0x28ee51[_0xfd51('0x18')],_0x448d5b=_0x37cbb8['offset'],_0x2d1b79=_0x37cbb8[_0xfd51('0x19')]+_0x37cbb8['limit'],_0x44f473;if(_0x2d1b79>=_0x28c148){_0x2d1b79=_0x28c148;_0x44f473=0xc8;}else{_0x44f473=0xce;}_0x473f6e[_0xfd51('0x16')](_0x44f473);return _0x473f6e[_0xfd51('0x1a')](_0xfd51('0x1b'),_0x448d5b+'-'+_0x2d1b79+'/'+_0x28c148)[_0xfd51('0x1c')](_0x28ee51);}return null;};}function patchUpdates(_0x3af330){return function(_0x22b2d0){try{jsonpatch[_0xfd51('0x1d')](_0x22b2d0,_0x3af330,!![]);}catch(_0x440352){return BPromise['reject'](_0x440352);}return _0x22b2d0[_0xfd51('0x1e')]();};}function saveUpdates(_0x3aede4,_0x2aab50){return function(_0x4918e3){if(_0x4918e3){return _0x4918e3[_0xfd51('0x1f')](_0x3aede4)['then'](function(_0x6f6672){return _0x6f6672;});}return null;};}function removeEntity(_0x12d13a,_0xc368a0){return function(_0x443941){if(_0x443941){return _0x443941['destroy']()[_0xfd51('0x20')](function(){_0x12d13a[_0xfd51('0x16')](0xcc)[_0xfd51('0x17')]();});}};}function handleEntityNotFound(_0x420fba,_0x3efad3){return function(_0x49e887){if(!_0x49e887){_0x420fba[_0xfd51('0x15')](0x194);}return _0x49e887;};}function handleError(_0x2c68c8,_0x4b5795){_0x4b5795=_0x4b5795||0x1f4;return function(_0x236dc5){logger[_0xfd51('0x21')](_0x236dc5[_0xfd51('0x22')]);if(_0x236dc5[_0xfd51('0x23')]){delete _0x236dc5['name'];}_0x2c68c8[_0xfd51('0x16')](_0x4b5795)[_0xfd51('0x24')](_0x236dc5);};}exports['index']=function(_0x3d639e,_0x410c94){var _0x5d8467={},_0x3e394a={},_0x2099da={'count':0x0,'rows':[]};var _0x3eb82c=db[_0xfd51('0x25')][_0xfd51('0x26')];_0x3e394a[_0xfd51('0x27')]=_[_0xfd51('0x28')](_['keys'](_0x3eb82c),[_0xfd51('0x23')]);_0x3e394a[_0xfd51('0x29')]=_['keys'](_0x3d639e['query']);_0x3e394a[_0xfd51('0x2a')]=_['intersection'](_0x3e394a[_0xfd51('0x27')],_0x3e394a[_0xfd51('0x29')]);_0x5d8467[_0xfd51('0x2b')]=_[_0xfd51('0x2c')](_0x3e394a[_0xfd51('0x27')],qs['fields'](_0x3d639e[_0xfd51('0x29')][_0xfd51('0x2d')]));_0x5d8467[_0xfd51('0x2b')]=_0x5d8467[_0xfd51('0x2b')][_0xfd51('0x2e')]?_0x5d8467[_0xfd51('0x2b')]:_0x3e394a[_0xfd51('0x27')];if(!_0x3d639e[_0xfd51('0x29')][_0xfd51('0x2f')](_0xfd51('0x30'))){_0x5d8467[_0xfd51('0x31')]=qs[_0xfd51('0x31')](_0x3d639e[_0xfd51('0x29')][_0xfd51('0x31')]);_0x5d8467[_0xfd51('0x19')]=qs[_0xfd51('0x19')](_0x3d639e[_0xfd51('0x29')][_0xfd51('0x19')]);}_0x5d8467[_0xfd51('0x32')]=qs[_0xfd51('0x33')](_0x3d639e['query'][_0xfd51('0x33')]);_0x5d8467['where']=qs[_0xfd51('0x2a')](_[_0xfd51('0x34')](_0x3d639e[_0xfd51('0x29')],_0x3e394a['filters']));if(_0x3d639e['query']['filter']){_0x5d8467[_0xfd51('0x35')]=_[_0xfd51('0x36')](_0x5d8467[_0xfd51('0x35')],{'$or':_[_0xfd51('0x37')](_0x3eb82c,function(_0x32f259){if(_0x32f259[_0xfd51('0x38')][_0xfd51('0x39')]!==_0xfd51('0x3a')){var _0x5ea70f={};_0x5ea70f[_0x32f259[_0xfd51('0x3b')]]={'$like':'%'+_0x3d639e['query'][_0xfd51('0x3c')]+'%'};return _0x5ea70f;}})});}_0x5d8467=_[_0xfd51('0x36')]({},_0x5d8467,_0x3d639e[_0xfd51('0x3d')]);var _0x510a84={'where':_0x5d8467['where']};return db[_0xfd51('0x25')]['count'](_0x510a84)['then'](function(_0x4af42f){_0x2099da[_0xfd51('0x18')]=_0x4af42f;if(_0x3d639e['query'][_0xfd51('0x3e')]){_0x5d8467[_0xfd51('0x3f')]=[{'all':!![]}];}return db[_0xfd51('0x25')]['findAll'](_0x5d8467);})[_0xfd51('0x20')](function(_0xaf4b81){_0x2099da[_0xfd51('0x40')]=_0xaf4b81;return _0x2099da;})['then'](respondWithFilteredResult(_0x410c94,_0x5d8467))['catch'](handleError(_0x410c94,null));};exports['show']=function(_0x31475c,_0x46242f){var _0x11dbfa={'raw':!![],'where':{'id':_0x31475c[_0xfd51('0x41')]['id']}},_0x67c56={};_0x67c56[_0xfd51('0x27')]=_[_0xfd51('0x42')](db[_0xfd51('0x25')][_0xfd51('0x26')]);_0x67c56[_0xfd51('0x29')]=_['keys'](_0x31475c[_0xfd51('0x29')]);_0x67c56[_0xfd51('0x2a')]=_[_0xfd51('0x2c')](_0x67c56[_0xfd51('0x27')],_0x67c56['query']);_0x11dbfa[_0xfd51('0x2b')]=_['intersection'](_0x67c56[_0xfd51('0x27')],qs[_0xfd51('0x2d')](_0x31475c[_0xfd51('0x29')][_0xfd51('0x2d')]));_0x11dbfa[_0xfd51('0x2b')]=_0x11dbfa['attributes']['length']?_0x11dbfa['attributes']:_0x67c56[_0xfd51('0x27')];if(_0x31475c[_0xfd51('0x29')][_0xfd51('0x3e')]){_0x11dbfa[_0xfd51('0x3f')]=[{'all':!![]}];}_0x11dbfa=_[_0xfd51('0x36')]({},_0x11dbfa,_0x31475c[_0xfd51('0x3d')]);return db[_0xfd51('0x25')][_0xfd51('0x43')](_0x11dbfa)[_0xfd51('0x20')](handleEntityNotFound(_0x46242f,null))['then'](respondWithResult(_0x46242f,null))[_0xfd51('0x44')](handleError(_0x46242f,null));};exports[_0xfd51('0x45')]=function(_0x1d2ab3,_0x3fcd76){return db[_0xfd51('0x46')]['transaction'](function(_0x404504){return db[_0xfd51('0x25')][_0xfd51('0x45')](_0x1d2ab3[_0xfd51('0x47')],{'transaction':_0x404504});})[_0xfd51('0x20')](respondWithResult(_0x3fcd76,0xc9))[_0xfd51('0x44')](handleError(_0x3fcd76,null));};exports[_0xfd51('0x1f')]=function(_0x1df1fb,_0x423bf0){if(_0x1df1fb['body']['id']){delete _0x1df1fb['body']['id'];}return db[_0xfd51('0x25')][_0xfd51('0x43')]({'where':{'id':_0x1df1fb['params']['id']}})[_0xfd51('0x20')](handleEntityNotFound(_0x423bf0,null))[_0xfd51('0x20')](saveUpdates(_0x1df1fb['body'],null))[_0xfd51('0x20')](respondWithResult(_0x423bf0,null))[_0xfd51('0x44')](handleError(_0x423bf0,null));};exports[_0xfd51('0x48')]=function(_0x48941c,_0x15b589){return db['CmCustomField'][_0xfd51('0x43')]({'where':{'id':_0x48941c[_0xfd51('0x41')]['id']}})['then'](handleEntityNotFound(_0x15b589,null))['then'](removeEntity(_0x15b589,null))[_0xfd51('0x44')](handleError(_0x15b589,null));}; \ No newline at end of file +var _0x3f4b=['bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index','CmCustomField','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','findAll','rows','catch','params','rawAttributes','includeAll','include','find','create','sequelize','transaction','body','html-pdf','eml-format','rimraf','fast-json-patch','moment'];(function(_0xf5c57d,_0x183fb6){var _0x25a2f5=function(_0x5c6ef8){while(--_0x5c6ef8){_0xf5c57d['push'](_0xf5c57d['shift']());}};_0x25a2f5(++_0x183fb6);}(_0x3f4b,0x11f));var _0xb3f4=function(_0x5968d1,_0x3511d1){_0x5968d1=_0x5968d1-0x0;var _0x359acf=_0x3f4b[_0x5968d1];return _0x359acf;};'use strict';var pdf=require(_0xb3f4('0x0'));var emlformat=require(_0xb3f4('0x1'));var rimraf=require(_0xb3f4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb3f4('0x3'));var rp=require('request-promise');var moment=require(_0xb3f4('0x4'));var BPromise=require(_0xb3f4('0x5'));var Mustache=require(_0xb3f4('0x6'));var util=require(_0xb3f4('0x7'));var path=require('path');var sox=require(_0xb3f4('0x8'));var csv=require(_0xb3f4('0x9'));var ejs=require(_0xb3f4('0xa'));var fs=require('fs');var _=require(_0xb3f4('0xb'));var squel=require(_0xb3f4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb3f4('0xd'));var Papa=require(_0xb3f4('0xe'));var Redis=require('ioredis');var authService=require(_0xb3f4('0xf'));var qs=require(_0xb3f4('0x10'));var hardwareService=require(_0xb3f4('0x11'));var logger=require('../../config/logger')(_0xb3f4('0x12'));var utils=require(_0xb3f4('0x13'));var config=require(_0xb3f4('0x14'));var db=require(_0xb3f4('0x15'))['db'];function respondWithStatusCode(_0x48f2a2,_0x38c796){_0x38c796=_0x38c796||0xcc;return function(_0x2322c3){if(_0x2322c3){return _0x48f2a2[_0xb3f4('0x16')](_0x38c796);}return _0x48f2a2['status'](_0x38c796)['end']();};}function respondWithResult(_0x5b7493,_0x1a8d31){_0x1a8d31=_0x1a8d31||0xc8;return function(_0x4307c5){if(_0x4307c5){return _0x5b7493[_0xb3f4('0x17')](_0x1a8d31)[_0xb3f4('0x18')](_0x4307c5);}};}function respondWithFilteredResult(_0x2ec900,_0x39b2b0){return function(_0x425200){if(_0x425200){var _0x2392b0=_0x425200[_0xb3f4('0x19')],_0xaacf4e=_0x39b2b0[_0xb3f4('0x1a')],_0x2fcc5e=_0x39b2b0['offset']+_0x39b2b0[_0xb3f4('0x1b')],_0x35650f;if(_0x2fcc5e>=_0x2392b0){_0x2fcc5e=_0x2392b0;_0x35650f=0xc8;}else{_0x35650f=0xce;}_0x2ec900[_0xb3f4('0x17')](_0x35650f);return _0x2ec900[_0xb3f4('0x1c')](_0xb3f4('0x1d'),_0xaacf4e+'-'+_0x2fcc5e+'/'+_0x2392b0)[_0xb3f4('0x18')](_0x425200);}return null;};}function patchUpdates(_0x108ed0){return function(_0x57bb29){try{jsonpatch[_0xb3f4('0x1e')](_0x57bb29,_0x108ed0,!![]);}catch(_0x2924f0){return BPromise[_0xb3f4('0x1f')](_0x2924f0);}return _0x57bb29[_0xb3f4('0x20')]();};}function saveUpdates(_0x51adf5,_0x5ab8a8){return function(_0x9bb6a4){if(_0x9bb6a4){return _0x9bb6a4[_0xb3f4('0x21')](_0x51adf5)[_0xb3f4('0x22')](function(_0x42dea9){return _0x42dea9;});}return null;};}function removeEntity(_0x23a671,_0x257a5e){return function(_0x3afd36){if(_0x3afd36){return _0x3afd36[_0xb3f4('0x23')]()[_0xb3f4('0x22')](function(){_0x23a671[_0xb3f4('0x17')](0xcc)[_0xb3f4('0x24')]();});}};}function handleEntityNotFound(_0x3d58b6,_0x3c7f78){return function(_0x221a9a){if(!_0x221a9a){_0x3d58b6['sendStatus'](0x194);}return _0x221a9a;};}function handleError(_0x56fe31,_0x4a972b){_0x4a972b=_0x4a972b||0x1f4;return function(_0x15e77d){logger['error'](_0x15e77d[_0xb3f4('0x25')]);if(_0x15e77d[_0xb3f4('0x26')]){delete _0x15e77d['name'];}_0x56fe31['status'](_0x4a972b)['send'](_0x15e77d);};}exports[_0xb3f4('0x27')]=function(_0x27a13e,_0x2ad496){var _0x562a04={},_0x4d4ac7={},_0x57f43c={'count':0x0,'rows':[]};var _0x306a3d=db[_0xb3f4('0x28')]['rawAttributes'];_0x4d4ac7[_0xb3f4('0x29')]=_[_0xb3f4('0x2a')](_['keys'](_0x306a3d),[_0xb3f4('0x26')]);_0x4d4ac7['query']=_[_0xb3f4('0x2b')](_0x27a13e[_0xb3f4('0x2c')]);_0x4d4ac7[_0xb3f4('0x2d')]=_[_0xb3f4('0x2e')](_0x4d4ac7[_0xb3f4('0x29')],_0x4d4ac7[_0xb3f4('0x2c')]);_0x562a04['attributes']=_[_0xb3f4('0x2e')](_0x4d4ac7[_0xb3f4('0x29')],qs[_0xb3f4('0x2f')](_0x27a13e['query'][_0xb3f4('0x2f')]));_0x562a04[_0xb3f4('0x30')]=_0x562a04[_0xb3f4('0x30')][_0xb3f4('0x31')]?_0x562a04[_0xb3f4('0x30')]:_0x4d4ac7[_0xb3f4('0x29')];if(!_0x27a13e['query']['hasOwnProperty']('nolimit')){_0x562a04[_0xb3f4('0x1b')]=qs[_0xb3f4('0x1b')](_0x27a13e['query'][_0xb3f4('0x1b')]);_0x562a04[_0xb3f4('0x1a')]=qs['offset'](_0x27a13e['query']['offset']);}_0x562a04['order']=qs[_0xb3f4('0x32')](_0x27a13e[_0xb3f4('0x2c')][_0xb3f4('0x32')]);_0x562a04[_0xb3f4('0x33')]=qs[_0xb3f4('0x2d')](_[_0xb3f4('0x34')](_0x27a13e[_0xb3f4('0x2c')],_0x4d4ac7['filters']));if(_0x27a13e[_0xb3f4('0x2c')][_0xb3f4('0x35')]){_0x562a04[_0xb3f4('0x33')]=_[_0xb3f4('0x36')](_0x562a04[_0xb3f4('0x33')],{'$or':_[_0xb3f4('0x37')](_0x306a3d,function(_0x79d46e){if(_0x79d46e[_0xb3f4('0x38')][_0xb3f4('0x39')]!==_0xb3f4('0x3a')){var _0x5464a4={};_0x5464a4[_0x79d46e[_0xb3f4('0x3b')]]={'$like':'%'+_0x27a13e[_0xb3f4('0x2c')][_0xb3f4('0x35')]+'%'};return _0x5464a4;}})});}_0x562a04=_[_0xb3f4('0x36')]({},_0x562a04,_0x27a13e[_0xb3f4('0x3c')]);var _0x1a0793={'where':_0x562a04[_0xb3f4('0x33')]};return db[_0xb3f4('0x28')][_0xb3f4('0x19')](_0x1a0793)[_0xb3f4('0x22')](function(_0x3da981){_0x57f43c[_0xb3f4('0x19')]=_0x3da981;if(_0x27a13e[_0xb3f4('0x2c')]['includeAll']){_0x562a04['include']=[{'all':!![]}];}return db[_0xb3f4('0x28')][_0xb3f4('0x3d')](_0x562a04);})[_0xb3f4('0x22')](function(_0x538d6f){_0x57f43c[_0xb3f4('0x3e')]=_0x538d6f;return _0x57f43c;})[_0xb3f4('0x22')](respondWithFilteredResult(_0x2ad496,_0x562a04))[_0xb3f4('0x3f')](handleError(_0x2ad496,null));};exports['show']=function(_0x3082ff,_0x2c44aa){var _0x304a68={'raw':!![],'where':{'id':_0x3082ff[_0xb3f4('0x40')]['id']}},_0x4acf1a={};_0x4acf1a['model']=_[_0xb3f4('0x2b')](db[_0xb3f4('0x28')][_0xb3f4('0x41')]);_0x4acf1a[_0xb3f4('0x2c')]=_['keys'](_0x3082ff[_0xb3f4('0x2c')]);_0x4acf1a[_0xb3f4('0x2d')]=_[_0xb3f4('0x2e')](_0x4acf1a[_0xb3f4('0x29')],_0x4acf1a[_0xb3f4('0x2c')]);_0x304a68[_0xb3f4('0x30')]=_[_0xb3f4('0x2e')](_0x4acf1a[_0xb3f4('0x29')],qs[_0xb3f4('0x2f')](_0x3082ff[_0xb3f4('0x2c')][_0xb3f4('0x2f')]));_0x304a68[_0xb3f4('0x30')]=_0x304a68['attributes'][_0xb3f4('0x31')]?_0x304a68[_0xb3f4('0x30')]:_0x4acf1a[_0xb3f4('0x29')];if(_0x3082ff[_0xb3f4('0x2c')][_0xb3f4('0x42')]){_0x304a68[_0xb3f4('0x43')]=[{'all':!![]}];}_0x304a68=_[_0xb3f4('0x36')]({},_0x304a68,_0x3082ff[_0xb3f4('0x3c')]);return db['CmCustomField'][_0xb3f4('0x44')](_0x304a68)[_0xb3f4('0x22')](handleEntityNotFound(_0x2c44aa,null))[_0xb3f4('0x22')](respondWithResult(_0x2c44aa,null))[_0xb3f4('0x3f')](handleError(_0x2c44aa,null));};exports[_0xb3f4('0x45')]=function(_0x59e8d4,_0x5bdd13){return db[_0xb3f4('0x46')][_0xb3f4('0x47')](function(_0x227fd5){return db['CmCustomField']['create'](_0x59e8d4[_0xb3f4('0x48')],{'transaction':_0x227fd5});})[_0xb3f4('0x22')](respondWithResult(_0x5bdd13,0xc9))[_0xb3f4('0x3f')](handleError(_0x5bdd13,null));};exports[_0xb3f4('0x21')]=function(_0x20543e,_0x424eb7){if(_0x20543e['body']['id']){delete _0x20543e[_0xb3f4('0x48')]['id'];}return db[_0xb3f4('0x28')]['find']({'where':{'id':_0x20543e[_0xb3f4('0x40')]['id']}})['then'](handleEntityNotFound(_0x424eb7,null))['then'](saveUpdates(_0x20543e[_0xb3f4('0x48')],null))[_0xb3f4('0x22')](respondWithResult(_0x424eb7,null))['catch'](handleError(_0x424eb7,null));};exports[_0xb3f4('0x23')]=function(_0x57c739,_0xc087f3){return db[_0xb3f4('0x28')][_0xb3f4('0x44')]({'where':{'id':_0x57c739[_0xb3f4('0x40')]['id']}})['then'](handleEntityNotFound(_0xc087f3,null))[_0xb3f4('0x22')](removeEntity(_0xc087f3,null))[_0xb3f4('0x3f')](handleError(_0xc087f3,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 13bb582..46c6eb8 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 _0x8d68=['cm_contacts','format','cf_%d','lodash','util','api','bluebird','path','./cmCustomField.attributes','CmCustomField','cm_custom_fields','TEXT','transaction','type','switch','BOOLEAN','defaultValue','queryInterface','addColumn'];(function(_0x520e15,_0x12a45e){var _0x5d545b=function(_0x2a3b13){while(--_0x2a3b13){_0x520e15['push'](_0x520e15['shift']());}};_0x5d545b(++_0x12a45e);}(_0x8d68,0x75));var _0x88d6=function(_0x1897d,_0x10a97e){_0x1897d=_0x1897d-0x0;var _0x18b447=_0x8d68[_0x1897d];return _0x18b447;};'use strict';var _=require(_0x88d6('0x0'));var util=require(_0x88d6('0x1'));var logger=require('../../config/logger')(_0x88d6('0x2'));var moment=require('moment');var BPromise=require(_0x88d6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x88d6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x88d6('0x5'));module['exports']=function(_0x584a69,_0x18e9f0){return _0x584a69['define'](_0x88d6('0x6'),attributes,{'tableName':_0x88d6('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x289dc1,_0x2bcfcc,_0x35059a){var _0xc54294=_0x289dc1['get']({'plain':!![]});var _0x1b23a5={'type':_0x18e9f0[_0x88d6('0x8')],'transaction':_0x2bcfcc[_0x88d6('0x9')]};switch(_0xc54294[_0x88d6('0xa')]){case'text':_0x1b23a5['type']=_0x18e9f0[_0x88d6('0x8')];break;case'number':_0x1b23a5['type']=_0x18e9f0['INTEGER'];break;case _0x88d6('0xb'):_0x1b23a5['type']=_0x18e9f0[_0x88d6('0xc')];_0x1b23a5[_0x88d6('0xd')]=![];break;}_0x584a69[_0x88d6('0xe')][_0x88d6('0xf')](_0x88d6('0x10'),util[_0x88d6('0x11')](_0x88d6('0x12'),_0xc54294['id']),_0x1b23a5);_0x35059a();}}});}; \ No newline at end of file +var _0xcb7b=['switch','BOOLEAN','defaultValue','addColumn','moment','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','get','transaction','type','text','TEXT','number','INTEGER'];(function(_0x2ecb67,_0x8ec62d){var _0x168079=function(_0x56c365){while(--_0x56c365){_0x2ecb67['push'](_0x2ecb67['shift']());}};_0x168079(++_0x8ec62d);}(_0xcb7b,0x1a6));var _0xbcb7=function(_0x4933b6,_0xbf6409){_0x4933b6=_0x4933b6-0x0;var _0x1501f2=_0xcb7b[_0x4933b6];return _0x1501f2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbcb7('0x0'));var BPromise=require('bluebird');var rp=require(_0xbcb7('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbcb7('0x2'));var config=require(_0xbcb7('0x3'));var attributes=require(_0xbcb7('0x4'));module[_0xbcb7('0x5')]=function(_0x4d199c,_0x970591){return _0x4d199c[_0xbcb7('0x6')](_0xbcb7('0x7'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29b3f7,_0x4a6623,_0x28659f){var _0xea2864=_0x29b3f7[_0xbcb7('0x8')]({'plain':!![]});var _0xe4d5ba={'type':_0x970591['TEXT'],'transaction':_0x4a6623[_0xbcb7('0x9')]};switch(_0xea2864[_0xbcb7('0xa')]){case _0xbcb7('0xb'):_0xe4d5ba[_0xbcb7('0xa')]=_0x970591[_0xbcb7('0xc')];break;case _0xbcb7('0xd'):_0xe4d5ba['type']=_0x970591[_0xbcb7('0xe')];break;case _0xbcb7('0xf'):_0xe4d5ba['type']=_0x970591[_0xbcb7('0x10')];_0xe4d5ba[_0xbcb7('0x11')]=![];break;}_0x4d199c['queryInterface'][_0xbcb7('0x12')]('cm_contacts',util['format']('cf_%d',_0xea2864['id']),_0xe4d5ba);_0x28659f();}}});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 74ddc91..7cbfb29 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 _0x0b35=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird'];(function(_0x5d04e4,_0x598bb9){var _0x1f3789=function(_0x5578ba){while(--_0x5578ba){_0x5d04e4['push'](_0x5d04e4['shift']());}};_0x1f3789(++_0x598bb9);}(_0x0b35,0xcf));var _0x50b3=function(_0x10d9b3,_0x312fe9){_0x10d9b3=_0x10d9b3-0x0;var _0x779b20=_0x0b35[_0x10d9b3];return _0x779b20;};'use strict';var _=require(_0x50b3('0x0'));var util=require('util');var moment=require(_0x50b3('0x1'));var BPromise=require(_0x50b3('0x2'));var rs=require(_0x50b3('0x3'));var fs=require('fs');var Redis=require(_0x50b3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x50b3('0x5'));var logger=require('../../config/logger')(_0x50b3('0x6'));var config=require(_0x50b3('0x7'));var jayson=require(_0x50b3('0x8'));var client=jayson['client'][_0x50b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d0ed9,_0x4f4da9,_0x2269d3){return new BPromise(function(_0x1af160,_0x33aac5){return client[_0x50b3('0xa')](_0x2d0ed9,_0x2269d3)[_0x50b3('0xb')](function(_0x5c1923){logger[_0x50b3('0xc')](_0x50b3('0xd'),_0x4f4da9,_0x50b3('0xe'));logger[_0x50b3('0xf')](_0x50b3('0x10'),_0x4f4da9,'request\x20sent',JSON['stringify'](_0x5c1923));if(_0x5c1923[_0x50b3('0x11')]){if(_0x5c1923['error'][_0x50b3('0x12')]===0x1f4){logger[_0x50b3('0x11')]('CmCustomField,\x20%s,\x20%s',_0x4f4da9,_0x5c1923[_0x50b3('0x11')]['message']);return _0x33aac5(_0x5c1923[_0x50b3('0x11')]['message']);}logger[_0x50b3('0x11')](_0x50b3('0xd'),_0x4f4da9,_0x5c1923[_0x50b3('0x11')][_0x50b3('0x13')]);return _0x1af160(_0x5c1923[_0x50b3('0x11')][_0x50b3('0x13')]);}else{logger[_0x50b3('0xc')]('CmCustomField,\x20%s,\x20%s',_0x4f4da9,'request\x20sent');_0x1af160(_0x5c1923[_0x50b3('0x14')][_0x50b3('0x13')]);}})['catch'](function(_0x9a39c0){logger['error'](_0x50b3('0xd'),_0x4f4da9,_0x9a39c0);_0x33aac5(_0x9a39c0);});});} \ No newline at end of file +var _0xc1fe=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmCustomField,\x20%s,\x20%s','info','result','message'];(function(_0x3a0783,_0x1506e6){var _0x629c72=function(_0x284953){while(--_0x284953){_0x3a0783['push'](_0x3a0783['shift']());}};_0x629c72(++_0x1506e6);}(_0xc1fe,0xb1));var _0xec1f=function(_0x86bf3a,_0x56fa58){_0x86bf3a=_0x86bf3a-0x0;var _0x4ce973=_0xc1fe[_0x86bf3a];return _0x4ce973;};'use strict';var _=require(_0xec1f('0x0'));var util=require(_0xec1f('0x1'));var moment=require(_0xec1f('0x2'));var BPromise=require('bluebird');var rs=require(_0xec1f('0x3'));var fs=require('fs');var Redis=require(_0xec1f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec1f('0x5'));var logger=require(_0xec1f('0x6'))(_0xec1f('0x7'));var config=require(_0xec1f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec1f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e4a62,_0x3444d8,_0x2bb418){return new BPromise(function(_0x3ecf29,_0x59e510){return client[_0xec1f('0xa')](_0x3e4a62,_0x2bb418)[_0xec1f('0xb')](function(_0x13e243){logger['info']('CmCustomField,\x20%s,\x20%s',_0x3444d8,'request\x20sent');logger[_0xec1f('0xc')](_0xec1f('0xd'),_0x3444d8,_0xec1f('0xe'),JSON['stringify'](_0x13e243));if(_0x13e243[_0xec1f('0xf')]){if(_0x13e243['error'][_0xec1f('0x10')]===0x1f4){logger['error'](_0xec1f('0x11'),_0x3444d8,_0x13e243[_0xec1f('0xf')]['message']);return _0x59e510(_0x13e243[_0xec1f('0xf')]['message']);}logger[_0xec1f('0xf')](_0xec1f('0x11'),_0x3444d8,_0x13e243[_0xec1f('0xf')]['message']);return _0x3ecf29(_0x13e243[_0xec1f('0xf')]['message']);}else{logger[_0xec1f('0x12')]('CmCustomField,\x20%s,\x20%s',_0x3444d8,_0xec1f('0xe'));_0x3ecf29(_0x13e243[_0xec1f('0x13')][_0xec1f('0x14')]);}})[_0xec1f('0x15')](function(_0x29dda8){logger[_0xec1f('0xf')]('CmCustomField,\x20%s,\x20%s',_0x3444d8,_0x29dda8);_0x59e510(_0x29dda8);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 76088d6..020e13e 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 _0x27de=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','delete','destroy'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x27de,0x155));var _0xe27d=function(_0xc2f4c4,_0x29ef61){_0xc2f4c4=_0xc2f4c4-0x0;var _0x2b76ae=_0x27de[_0xc2f4c4];return _0x2b76ae;};'use strict';var multer=require(_0xe27d('0x0'));var util=require(_0xe27d('0x1'));var path=require('path');var timeout=require(_0xe27d('0x2'));var express=require(_0xe27d('0x3'));var router=express['Router']();var auth=require(_0xe27d('0x4'));var interaction=require(_0xe27d('0x5'));var config=require(_0xe27d('0x6'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0xe27d('0x7')](),controller[_0xe27d('0x8')]);router[_0xe27d('0x9')](_0xe27d('0xa'),auth[_0xe27d('0x7')](),controller[_0xe27d('0xb')]);router[_0xe27d('0xc')]('/',auth[_0xe27d('0x7')](),controller[_0xe27d('0xd')]);router['put']('/:id',auth[_0xe27d('0x7')](),controller['update']);router[_0xe27d('0xe')]('/:id',auth[_0xe27d('0x7')](),controller[_0xe27d('0xf')]);module[_0xe27d('0x10')]=router; \ No newline at end of file +var _0x8ebb=['show','post','create','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x2639e8,_0x432210){var _0x599369=function(_0x5cc0be){while(--_0x5cc0be){_0x2639e8['push'](_0x2639e8['shift']());}};_0x599369(++_0x432210);}(_0x8ebb,0xc2));var _0xb8eb=function(_0x30310e,_0x6d9691){_0x30310e=_0x30310e-0x0;var _0x3bdc2f=_0x8ebb[_0x30310e];return _0x3bdc2f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb8eb('0x0'));var timeout=require(_0xb8eb('0x1'));var express=require(_0xb8eb('0x2'));var router=express[_0xb8eb('0x3')]();var auth=require(_0xb8eb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb8eb('0x5'));var controller=require('./cmCustomField.controller');router[_0xb8eb('0x6')]('/',auth['isAuthenticated'](),controller[_0xb8eb('0x7')]);router[_0xb8eb('0x6')](_0xb8eb('0x8'),auth[_0xb8eb('0x9')](),controller[_0xb8eb('0xa')]);router[_0xb8eb('0xb')]('/',auth[_0xb8eb('0x9')](),controller[_0xb8eb('0xc')]);router[_0xb8eb('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb8eb('0xe')](_0xb8eb('0x8'),auth['isAuthenticated'](),controller[_0xb8eb('0xf')]);module[_0xb8eb('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 64d2a55..06e5661 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 _0xe3b6=['DATE','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','INTEGER'];(function(_0x46f46d,_0x3d1603){var _0x403306=function(_0x37495b){while(--_0x37495b){_0x46f46d['push'](_0x46f46d['shift']());}};_0x403306(++_0x3d1603);}(_0xe3b6,0x110));var _0x6e3b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xe3b6[_0x411add];return _0x238242;};'use strict';var moment=require(_0x6e3b('0x0'));var Sequelize=require(_0x6e3b('0x1'));module[_0x6e3b('0x2')]={'phone':{'type':Sequelize[_0x6e3b('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x6e3b('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x6e3b('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6e3b('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6e3b('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6e3b('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6e3b('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6e3b('0x7')]},'priority':{'type':Sequelize[_0x6e3b('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6e3b('0x6')],'unique':_0x6e3b('0x8')},'ListId':{'type':Sequelize[_0x6e3b('0x6')],'unique':_0x6e3b('0x8')},'UserId':{'type':Sequelize[_0x6e3b('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x6e3b('0x6')],'unique':_0x6e3b('0x8')},'CampaignId':{'type':Sequelize[_0x6e3b('0x6')]}}; \ No newline at end of file +var _0xe395=['contactListQueue','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xe395,0x1f0));var _0x5e39=function(_0x1798f7,_0x6e19c0){_0x1798f7=_0x1798f7-0x0;var _0x71610b=_0xe395[_0x1798f7];return _0x71610b;};'use strict';var moment=require('moment');var Sequelize=require(_0x5e39('0x0'));module[_0x5e39('0x1')]={'phone':{'type':Sequelize[_0x5e39('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5e39('0x3')],'defaultValue':moment()['format'](_0x5e39('0x4'))},'countbusyretry':{'type':Sequelize[_0x5e39('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5e39('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5e39('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5e39('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5e39('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5e39('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5e39('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5e39('0x8')},'ListId':{'type':Sequelize[_0x5e39('0x5')],'unique':_0x5e39('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x5e39('0x5')],'unique':_0x5e39('0x8')},'CampaignId':{'type':Sequelize[_0x5e39('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 1920c08..69a4754 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 _0x8fdd=['include','findAll','rows','catch','show','params','create','body','find','describe','CampaignId','VoiceQueueId','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','campaign','user','UserId','format','calleridnum','phone','campaigntype','CmContact','firstName','isNil','calleridname','lastName','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','map','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','filters','concat','$and','$or','$gt','$lt','$ne','$not','$between','$like','$iLike','$notILike','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','key','VIRTUAL','filter','options','CmHopper','includeAll'];(function(_0x3ab0d9,_0x4c1984){var _0x3221c6=function(_0x2b68be){while(--_0x2b68be){_0x3ab0d9['push'](_0x3ab0d9['shift']());}};_0x3221c6(++_0x4c1984);}(_0x8fdd,0x15e));var _0xd8fd=function(_0x284506,_0x191316){_0x284506=_0x284506-0x0;var _0x1e9ee5=_0x8fdd[_0x284506];return _0x1e9ee5;};'use strict';var pdf=require(_0xd8fd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd8fd('0x1'));var zipdir=require(_0xd8fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd8fd('0x3'));var moment=require(_0xd8fd('0x4'));var BPromise=require(_0xd8fd('0x5'));var Mustache=require(_0xd8fd('0x6'));var util=require(_0xd8fd('0x7'));var path=require(_0xd8fd('0x8'));var sox=require('sox');var csv=require(_0xd8fd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd8fd('0xa'));var crypto=require(_0xd8fd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd8fd('0xc'));var toCsv=require(_0xd8fd('0x9'));var querystring=require('querystring');var Papa=require(_0xd8fd('0xd'));var Redis=require(_0xd8fd('0xe'));var authService=require(_0xd8fd('0xf'));var qs=require(_0xd8fd('0x10'));var hardwareService=require(_0xd8fd('0x11'));var logger=require(_0xd8fd('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd8fd('0x13'))['db'];function respondWithStatusCode(_0x1f83fc,_0x472dfd){_0x472dfd=_0x472dfd||0xcc;return function(_0x557d53){if(_0x557d53){return _0x1f83fc[_0xd8fd('0x14')](_0x472dfd);}return _0x1f83fc[_0xd8fd('0x15')](_0x472dfd)['end']();};}function respondWithResult(_0x47a7b4,_0x501293){_0x501293=_0x501293||0xc8;return function(_0x1cd076){if(_0x1cd076){return _0x47a7b4[_0xd8fd('0x15')](_0x501293)['json'](_0x1cd076);}};}function respondWithFilteredResult(_0x4bebc4,_0x5b4725){return function(_0x22cbb2){if(_0x22cbb2){var _0x1b314f=_0x22cbb2[_0xd8fd('0x16')],_0x79c81c=_0x5b4725[_0xd8fd('0x17')],_0x56f9bf=_0x5b4725['offset']+_0x5b4725['limit'],_0x492925;if(_0x56f9bf>=_0x1b314f){_0x56f9bf=_0x1b314f;_0x492925=0xc8;}else{_0x492925=0xce;}_0x4bebc4[_0xd8fd('0x15')](_0x492925);return _0x4bebc4[_0xd8fd('0x18')](_0xd8fd('0x19'),_0x79c81c+'-'+_0x56f9bf+'/'+_0x1b314f)[_0xd8fd('0x1a')](_0x22cbb2);}return null;};}function patchUpdates(_0x35b922){return function(_0x24ff8c){try{jsonpatch[_0xd8fd('0x1b')](_0x24ff8c,_0x35b922,!![]);}catch(_0x13aab2){return BPromise[_0xd8fd('0x1c')](_0x13aab2);}return _0x24ff8c[_0xd8fd('0x1d')]();};}function saveUpdates(_0x5d2c89,_0x1919dd){return function(_0x1a594b){if(_0x1a594b){return _0x1a594b[_0xd8fd('0x1e')](_0x5d2c89)[_0xd8fd('0x1f')](function(_0x5accb0){return _0x5accb0;});}return null;};}function removeEntity(_0x190d45,_0x54eca2){return function(_0x531fba){if(_0x531fba){return _0x531fba[_0xd8fd('0x20')]()['then'](function(){_0x190d45[_0xd8fd('0x15')](0xcc)[_0xd8fd('0x21')]();});}};}function handleEntityNotFound(_0x6dea3d,_0x245e16){return function(_0x30ee36){if(!_0x30ee36){_0x6dea3d['sendStatus'](0x194);}return _0x30ee36;};}function handleError(_0xa6653d,_0x59c983){_0x59c983=_0x59c983||0x1f4;return function(_0x5c35b2){logger[_0xd8fd('0x22')](_0x5c35b2[_0xd8fd('0x23')]);if(_0x5c35b2[_0xd8fd('0x24')]){delete _0x5c35b2[_0xd8fd('0x24')];}_0xa6653d[_0xd8fd('0x15')](_0x59c983)[_0xd8fd('0x25')](_0x5c35b2);};}exports[_0xd8fd('0x26')]=function(_0x522b9b,_0x5b31db){var _0x4a632e={},_0x3257c4={},_0x59723b={'count':0x0,'rows':[]};var _0x3add35=db['CmHopper'][_0xd8fd('0x27')];_0x3257c4[_0xd8fd('0x28')]=_[_0xd8fd('0x29')](_0x3add35);_0x3257c4[_0xd8fd('0x2a')]=_['keys'](_0x522b9b[_0xd8fd('0x2a')]);_0x3257c4['filters']=_[_0xd8fd('0x2b')](_0x3257c4[_0xd8fd('0x28')],_0x3257c4[_0xd8fd('0x2a')]);_0x3257c4[_0xd8fd('0x2c')]=_[_0xd8fd('0x2d')](_0x3257c4[_0xd8fd('0x2c')],[_0xd8fd('0x2e'),_0xd8fd('0x2f'),_0xd8fd('0x30'),'$gte',_0xd8fd('0x31'),'$lte',_0xd8fd('0x32'),'$eq',_0xd8fd('0x33'),_0xd8fd('0x34'),'$notBetween','$in','$notIn',_0xd8fd('0x35'),'$notLike',_0xd8fd('0x36'),_0xd8fd('0x37'),'$like','$overlap',_0xd8fd('0x38'),'$contained',_0xd8fd('0x39')]);_0x4a632e[_0xd8fd('0x3a')]=_[_0xd8fd('0x2b')](_0x3257c4[_0xd8fd('0x28')],qs[_0xd8fd('0x3b')](_0x522b9b[_0xd8fd('0x2a')][_0xd8fd('0x3b')]));_0x4a632e[_0xd8fd('0x3a')]=_0x4a632e['attributes'][_0xd8fd('0x3c')]?_0x4a632e['attributes']:_0x3257c4[_0xd8fd('0x28')];if(!_0x522b9b[_0xd8fd('0x2a')][_0xd8fd('0x3d')](_0xd8fd('0x3e'))){_0x4a632e[_0xd8fd('0x3f')]=qs[_0xd8fd('0x3f')](_0x522b9b[_0xd8fd('0x2a')][_0xd8fd('0x3f')]);_0x4a632e[_0xd8fd('0x17')]=qs[_0xd8fd('0x17')](_0x522b9b[_0xd8fd('0x2a')][_0xd8fd('0x17')]);}_0x4a632e[_0xd8fd('0x40')]=qs[_0xd8fd('0x41')](_0x522b9b[_0xd8fd('0x2a')][_0xd8fd('0x41')]);_0x4a632e[_0xd8fd('0x42')]=qs[_0xd8fd('0x2c')](_[_0xd8fd('0x43')](_0x522b9b['query'],_0x3257c4[_0xd8fd('0x2c')]));if(_0x522b9b[_0xd8fd('0x2a')]['filter']){_0x4a632e[_0xd8fd('0x42')]=_[_0xd8fd('0x44')](_0x4a632e[_0xd8fd('0x42')],{'$or':_['map'](_0x3add35,function(_0x53890d){if(_0x53890d[_0xd8fd('0x45')][_0xd8fd('0x46')]!==_0xd8fd('0x47')){var _0x47fefb={};_0x47fefb[_0x53890d['field']]={'$like':'%'+_0x522b9b['query'][_0xd8fd('0x48')]+'%'};return _0x47fefb;}})});}_0x4a632e=_['merge']({},_0x4a632e,_0x522b9b[_0xd8fd('0x49')]);var _0x7f9c0e={'where':_0x4a632e[_0xd8fd('0x42')]};return db[_0xd8fd('0x4a')][_0xd8fd('0x16')](_0x7f9c0e)[_0xd8fd('0x1f')](function(_0x2e30d4){_0x59723b[_0xd8fd('0x16')]=_0x2e30d4;if(_0x522b9b['query'][_0xd8fd('0x4b')]){_0x4a632e[_0xd8fd('0x4c')]=[{'all':!![]}];}return db[_0xd8fd('0x4a')][_0xd8fd('0x4d')](_0x4a632e);})[_0xd8fd('0x1f')](function(_0x53faaf){_0x59723b[_0xd8fd('0x4e')]=_0x53faaf;return _0x59723b;})[_0xd8fd('0x1f')](respondWithFilteredResult(_0x5b31db,_0x4a632e))[_0xd8fd('0x4f')](handleError(_0x5b31db,null));};exports[_0xd8fd('0x50')]=function(_0x5c76a9,_0xe6584c){var _0x33e326={'raw':!![],'where':{'id':_0x5c76a9[_0xd8fd('0x51')]['id']}},_0x1e5a2e={};_0x1e5a2e[_0xd8fd('0x28')]=_['keys'](db[_0xd8fd('0x4a')]['rawAttributes']);_0x1e5a2e[_0xd8fd('0x2a')]=_[_0xd8fd('0x29')](_0x5c76a9[_0xd8fd('0x2a')]);_0x1e5a2e[_0xd8fd('0x2c')]=_[_0xd8fd('0x2b')](_0x1e5a2e[_0xd8fd('0x28')],_0x1e5a2e[_0xd8fd('0x2a')]);_0x33e326[_0xd8fd('0x3a')]=_[_0xd8fd('0x2b')](_0x1e5a2e['model'],qs[_0xd8fd('0x3b')](_0x5c76a9['query'][_0xd8fd('0x3b')]));_0x33e326['attributes']=_0x33e326[_0xd8fd('0x3a')]['length']?_0x33e326[_0xd8fd('0x3a')]:_0x1e5a2e[_0xd8fd('0x28')];if(_0x5c76a9[_0xd8fd('0x2a')][_0xd8fd('0x4b')]){_0x33e326['include']=[{'all':!![]}];}_0x33e326=_['merge']({},_0x33e326,_0x5c76a9[_0xd8fd('0x49')]);return db[_0xd8fd('0x4a')]['find'](_0x33e326)[_0xd8fd('0x1f')](handleEntityNotFound(_0xe6584c,null))[_0xd8fd('0x1f')](respondWithResult(_0xe6584c,null))[_0xd8fd('0x4f')](handleError(_0xe6584c,null));};exports[_0xd8fd('0x52')]=function(_0x2963ab,_0x35dcb2){return db[_0xd8fd('0x4a')][_0xd8fd('0x52')](_0x2963ab[_0xd8fd('0x53')],{})[_0xd8fd('0x1f')](respondWithResult(_0x35dcb2,0xc9))['catch'](handleError(_0x35dcb2,null));};exports['update']=function(_0x3085ec,_0xe0b0d2){if(_0x3085ec[_0xd8fd('0x53')]['id']){delete _0x3085ec[_0xd8fd('0x53')]['id'];}return db[_0xd8fd('0x4a')][_0xd8fd('0x54')]({'where':{'id':_0x3085ec['params']['id']}})['then'](handleEntityNotFound(_0xe0b0d2,null))[_0xd8fd('0x1f')](saveUpdates(_0x3085ec[_0xd8fd('0x53')],null))[_0xd8fd('0x1f')](respondWithResult(_0xe0b0d2,null))[_0xd8fd('0x4f')](handleError(_0xe0b0d2,null));};exports['describe']=function(_0x2c0cde,_0x3ef550){return db[_0xd8fd('0x4a')][_0xd8fd('0x55')]()[_0xd8fd('0x1f')](respondWithResult(_0x3ef550,null))[_0xd8fd('0x4f')](handleError(_0x3ef550,null));};exports['destroy']=function(_0x204036,_0x2d2aed){var _0x1345fc;return db[_0xd8fd('0x4a')][_0xd8fd('0x54')]({'where':{'id':_0x204036[_0xd8fd('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d2aed,null))['then'](function(_0x15b905){if(_0x15b905){return _0x15b905['destroy']()[_0xd8fd('0x1f')](function(_0x3a9b9f){return _0x3a9b9f;});}})[_0xd8fd('0x1f')](function(_0x71cd1b){_0x1345fc=_0x71cd1b;if(_0x71cd1b){if(_0x71cd1b['VoiceQueueId']||_0x71cd1b[_0xd8fd('0x56')]){return db[_0x71cd1b[_0xd8fd('0x57')]?'VoiceQueue':_0xd8fd('0x58')][_0xd8fd('0x54')]({'where':{'id':_0x71cd1b['VoiceQueueId']?_0x71cd1b[_0xd8fd('0x57')]:_0x71cd1b['CampaignId']},'attributes':['id',_0xd8fd('0x24')],'raw':!![]});}}})['then'](function(_0x30fc03){var _0x58c4c1={};if(_0x30fc03){_['merge'](_0x58c4c1,_[_0xd8fd('0x59')](_0x1345fc[_0xd8fd('0x5a')],[_0xd8fd('0x5b'),'updatedAt','id']));_0x58c4c1[_0xd8fd('0x5c')]=0x15;_0x58c4c1[_0xd8fd('0x5d')]=_0xd8fd('0x5e');_0x58c4c1[_0xd8fd('0x5f')]=_0x30fc03['name'];_0x58c4c1['membername']=_0x204036[_0xd8fd('0x60')][_0xd8fd('0x24')];_0x58c4c1[_0xd8fd('0x61')]=_0x204036[_0xd8fd('0x60')]['id'];_0x58c4c1['deleted']=!![];_0x58c4c1['deletedat']=moment()[_0xd8fd('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x58c4c1[_0xd8fd('0x63')]=_0x1345fc[_0xd8fd('0x64')];_0x58c4c1[_0xd8fd('0x65')]=_0x1345fc[_0xd8fd('0x57')]?'queue':'ivr';return db[_0xd8fd('0x66')][_0xd8fd('0x54')]({'where':{'id':_0x58c4c1['ContactId']},'attributes':[_0xd8fd('0x67'),'lastName']})['then'](function(_0x18262d){if(!_[_0xd8fd('0x68')](_0x2d2aed)&&!_[_0xd8fd('0x68')](_0x18262d['firstName'])){_0x58c4c1[_0xd8fd('0x69')]=_0x18262d[_0xd8fd('0x67')];if(!_[_0xd8fd('0x68')](_0x18262d[_0xd8fd('0x6a')])){_0x58c4c1[_0xd8fd('0x69')]+='\x20'+_0x18262d[_0xd8fd('0x6a')];}}})['finally'](function(){return db[_0xd8fd('0x6b')][_0xd8fd('0x52')](_0x58c4c1);});}})['then'](function(){return _0x2d2aed[_0xd8fd('0x15')](0xcc)[_0xd8fd('0x21')]();})['catch'](handleError(_0x2d2aed,null));};exports[_0xd8fd('0x6c')]=function(_0x44de96,_0x577ea3,_0x172882){var _0x23a42c=[];return db['CmContact'][_0xd8fd('0x55')]()[_0xd8fd('0x1f')](function(_0x5c4424){_0x23a42c=_[_0xd8fd('0x29')](_0x5c4424);return _0x44de96[_0xd8fd('0x60')][_0xd8fd('0x6d')]({'where':{'type':_0xd8fd('0x6e'),'dialActive':!![],'dialMethod':_0xd8fd('0x6f')},'attributes':['id',_0xd8fd('0x70')],'raw':!![]});})[_0xd8fd('0x1f')](function(_0x5c7154){if(_0x5c7154&&_0x5c7154[_0xd8fd('0x3c')]){return db[_0xd8fd('0x71')][_0xd8fd('0x72')](function(_0x19046){var _0x4355d7={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd8fd('0x62')](_0xd8fd('0x73'))},'VoiceQueueId':{'$in':_[_0xd8fd('0x74')](_0x5c7154,'id')},'$or':[{'UserId':null},{'UserId':_0x44de96['user']['id']}]};var _0x526767=[];if(_0x44de96[_0xd8fd('0x53')][_0xd8fd('0x75')]&&_0x44de96[_0xd8fd('0x53')][_0xd8fd('0x75')]===_0xd8fd('0x76')){if(!_[_0xd8fd('0x77')](_0x44de96[_0xd8fd('0x53')][_0xd8fd('0x78')])){_0x4355d7['id']={'$in':_0x44de96[_0xd8fd('0x53')][_0xd8fd('0x78')]};}_0x526767=[[_0xd8fd('0x79'),_0xd8fd('0x7a')],[_0xd8fd('0x7b'),_0x5c7154[0x0]['dialOrderByScheduledAt']===_0xd8fd('0x7a')?_0xd8fd('0x7c'):_0xd8fd('0x7a')],db[_0xd8fd('0x71')][_0xd8fd('0x7d')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xd8fd('0x7c')]];}else{if(!_[_0xd8fd('0x77')](_0x44de96['body'][_0xd8fd('0x78')])){_0x4355d7['id']={'$notIn':_0x44de96['body']['hopperIds']};}_0x526767=[['priority',_0xd8fd('0x7c')],[_0xd8fd('0x7b'),_0x5c7154[0x0][_0xd8fd('0x70')]],db[_0xd8fd('0x71')][_0xd8fd('0x7d')](_0xd8fd('0x7e')),['id',_0xd8fd('0x7a')]];}return db['CmHopper'][_0xd8fd('0x7f')]({'attributes':['id',_0xd8fd('0x80')],'where':_0x4355d7,'order':_0x526767,'transaction':_0x19046,'lock':_0x19046[_0xd8fd('0x81')][_0xd8fd('0x82')],'include':[{'model':db[_0xd8fd('0x66')],'as':_0xd8fd('0x83'),'attributes':_0x23a42c,'include':[{'model':db[_0xd8fd('0x84')],'as':_0xd8fd('0x85'),'attributes':['id',_0xd8fd('0x24')]}]},{'model':db[_0xd8fd('0x86')],'as':_0xd8fd('0x87'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0xd8fd('0x88'),'attributes':['id',_0xd8fd('0x24'),_0xd8fd('0x89')]}]})[_0xd8fd('0x1f')](function(_0x39aa43){if(_0x39aa43){return _0x39aa43[_0xd8fd('0x1e')]({'UserId':_0x44de96[_0xd8fd('0x60')]['id']},{'transaction':_0x19046});}});});}})['then'](handleEntityNotFound(_0x577ea3,null))[_0xd8fd('0x1f')](respondWithResult(_0x577ea3,null))[_0xd8fd('0x4f')](handleError(_0x577ea3,null));};exports[_0xd8fd('0x8a')]=function(_0x268df3,_0x5df49e,_0x435fe8){return _0x268df3['user'][_0xd8fd('0x6d')]({'where':{'type':_0xd8fd('0x6e'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0xd8fd('0x1f')](function(_0x2b176e){if(_0x2b176e&&_0x2b176e[_0xd8fd('0x3c')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd8fd('0x62')](_0xd8fd('0x73'))},'VoiceQueueId':{'$in':_[_0xd8fd('0x74')](_0x2b176e,'id')},'$or':[{'UserId':null},{'UserId':_0x268df3[_0xd8fd('0x60')]['id']}]}});}return 0x0;})[_0xd8fd('0x1f')](function(_0x53d3e5){if(!_[_0xd8fd('0x68')](_0x53d3e5)&&_[_0xd8fd('0x8b')](_0x53d3e5)){return _0x5df49e['status'](0xc8)['json']({'contacts':_0x53d3e5});}else{logger[_0xd8fd('0x22')](_0xd8fd('0x8c'),_0xd8fd('0x8a'),0x194,_0xd8fd('0x8d'));_0x5df49e[_0xd8fd('0x14')](0x194);}})['catch'](handleError(_0x5df49e,null));}; \ No newline at end of file +var _0xb974=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','destroy','error','stack','name','send','index','rawAttributes','model','query','filters','intersection','concat','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$notLike','$iLike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','CmHopper','then','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','updatedAt','state','statedesc','campaign','user','UserId','deleted','deletedat','format','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','UPDATE','Contact','CmList','List','VoiceQueue','Queue','dialActive','getVoiceQueues','outbound','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x20550f,_0x4e5fba){var _0x2d3cee=function(_0x4c4bbf){while(--_0x4c4bbf){_0x20550f['push'](_0x20550f['shift']());}};_0x2d3cee(++_0x4e5fba);}(_0xb974,0x111));var _0x4b97=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xb974[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x4b97('0x0'));var emlformat=require(_0x4b97('0x1'));var rimraf=require(_0x4b97('0x2'));var zipdir=require(_0x4b97('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b97('0x4'));var moment=require(_0x4b97('0x5'));var BPromise=require(_0x4b97('0x6'));var Mustache=require(_0x4b97('0x7'));var util=require('util');var path=require(_0x4b97('0x8'));var sox=require(_0x4b97('0x9'));var csv=require('to-csv');var ejs=require(_0x4b97('0xa'));var fs=require('fs');var _=require(_0x4b97('0xb'));var squel=require('squel');var crypto=require(_0x4b97('0xc'));var jsforce=require(_0x4b97('0xd'));var deskjs=require(_0x4b97('0xe'));var toCsv=require(_0x4b97('0xf'));var querystring=require(_0x4b97('0x10'));var Papa=require(_0x4b97('0x11'));var Redis=require(_0x4b97('0x12'));var authService=require(_0x4b97('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4b97('0x14'));var logger=require(_0x4b97('0x15'))(_0x4b97('0x16'));var utils=require(_0x4b97('0x17'));var config=require(_0x4b97('0x18'));var db=require(_0x4b97('0x19'))['db'];function respondWithStatusCode(_0x40e1f5,_0x386c10){_0x386c10=_0x386c10||0xcc;return function(_0x3caedc){if(_0x3caedc){return _0x40e1f5[_0x4b97('0x1a')](_0x386c10);}return _0x40e1f5[_0x4b97('0x1b')](_0x386c10)[_0x4b97('0x1c')]();};}function respondWithResult(_0x26fee7,_0x1a5b06){_0x1a5b06=_0x1a5b06||0xc8;return function(_0x5719fe){if(_0x5719fe){return _0x26fee7[_0x4b97('0x1b')](_0x1a5b06)[_0x4b97('0x1d')](_0x5719fe);}};}function respondWithFilteredResult(_0x3f41de,_0x292f70){return function(_0x18afa3){if(_0x18afa3){var _0x157961=_0x18afa3[_0x4b97('0x1e')],_0x3e26b9=_0x292f70[_0x4b97('0x1f')],_0x935e66=_0x292f70[_0x4b97('0x1f')]+_0x292f70[_0x4b97('0x20')],_0x5ee022;if(_0x935e66>=_0x157961){_0x935e66=_0x157961;_0x5ee022=0xc8;}else{_0x5ee022=0xce;}_0x3f41de['status'](_0x5ee022);return _0x3f41de[_0x4b97('0x21')](_0x4b97('0x22'),_0x3e26b9+'-'+_0x935e66+'/'+_0x157961)[_0x4b97('0x1d')](_0x18afa3);}return null;};}function patchUpdates(_0x1ed78b){return function(_0x2fba2f){try{jsonpatch['apply'](_0x2fba2f,_0x1ed78b,!![]);}catch(_0x593864){return BPromise['reject'](_0x593864);}return _0x2fba2f[_0x4b97('0x23')]();};}function saveUpdates(_0x4b82f7,_0x51315e){return function(_0x121cb5){if(_0x121cb5){return _0x121cb5['update'](_0x4b82f7)['then'](function(_0x14dcb1){return _0x14dcb1;});}return null;};}function removeEntity(_0x59c2d4,_0x39ed9a){return function(_0x1dd332){if(_0x1dd332){return _0x1dd332[_0x4b97('0x24')]()['then'](function(){_0x59c2d4['status'](0xcc)[_0x4b97('0x1c')]();});}};}function handleEntityNotFound(_0x3be3c0,_0x57baa5){return function(_0x1b8875){if(!_0x1b8875){_0x3be3c0['sendStatus'](0x194);}return _0x1b8875;};}function handleError(_0x33e9c6,_0x53b4db){_0x53b4db=_0x53b4db||0x1f4;return function(_0x21e400){logger[_0x4b97('0x25')](_0x21e400[_0x4b97('0x26')]);if(_0x21e400[_0x4b97('0x27')]){delete _0x21e400['name'];}_0x33e9c6['status'](_0x53b4db)[_0x4b97('0x28')](_0x21e400);};}exports[_0x4b97('0x29')]=function(_0x2f463f,_0x1806f8){var _0x32624b={},_0x216c68={},_0x1d678f={'count':0x0,'rows':[]};var _0x428261=db['CmHopper'][_0x4b97('0x2a')];_0x216c68[_0x4b97('0x2b')]=_['keys'](_0x428261);_0x216c68[_0x4b97('0x2c')]=_['keys'](_0x2f463f['query']);_0x216c68[_0x4b97('0x2d')]=_[_0x4b97('0x2e')](_0x216c68['model'],_0x216c68[_0x4b97('0x2c')]);_0x216c68[_0x4b97('0x2d')]=_[_0x4b97('0x2f')](_0x216c68[_0x4b97('0x2d')],[_0x4b97('0x30'),_0x4b97('0x31'),_0x4b97('0x32'),_0x4b97('0x33'),'$lt',_0x4b97('0x34'),_0x4b97('0x35'),_0x4b97('0x36'),_0x4b97('0x37'),_0x4b97('0x38'),_0x4b97('0x39'),_0x4b97('0x3a'),_0x4b97('0x3b'),'$like',_0x4b97('0x3c'),_0x4b97('0x3d'),'$notILike','$like',_0x4b97('0x3e'),_0x4b97('0x3f'),_0x4b97('0x40'),_0x4b97('0x41')]);_0x32624b[_0x4b97('0x42')]=_['intersection'](_0x216c68[_0x4b97('0x2b')],qs[_0x4b97('0x43')](_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x43')]));_0x32624b[_0x4b97('0x42')]=_0x32624b[_0x4b97('0x42')][_0x4b97('0x44')]?_0x32624b[_0x4b97('0x42')]:_0x216c68['model'];if(!_0x2f463f['query'][_0x4b97('0x45')](_0x4b97('0x46'))){_0x32624b[_0x4b97('0x20')]=qs[_0x4b97('0x20')](_0x2f463f[_0x4b97('0x2c')]['limit']);_0x32624b[_0x4b97('0x1f')]=qs[_0x4b97('0x1f')](_0x2f463f[_0x4b97('0x2c')]['offset']);}_0x32624b['order']=qs['sort'](_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x47')]);_0x32624b[_0x4b97('0x48')]=qs[_0x4b97('0x2d')](_[_0x4b97('0x49')](_0x2f463f['query'],_0x216c68[_0x4b97('0x2d')]));if(_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x4a')]){_0x32624b['where']=_[_0x4b97('0x4b')](_0x32624b[_0x4b97('0x48')],{'$or':_[_0x4b97('0x4c')](_0x428261,function(_0x34217a){if(_0x34217a[_0x4b97('0x4d')][_0x4b97('0x4e')]!=='VIRTUAL'){var _0x965b1={};_0x965b1[_0x34217a['field']]={'$like':'%'+_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x4a')]+'%'};return _0x965b1;}})});}_0x32624b=_['merge']({},_0x32624b,_0x2f463f['options']);var _0x3d82e9={'where':_0x32624b[_0x4b97('0x48')]};return db[_0x4b97('0x4f')][_0x4b97('0x1e')](_0x3d82e9)[_0x4b97('0x50')](function(_0x402a86){_0x1d678f[_0x4b97('0x1e')]=_0x402a86;if(_0x2f463f[_0x4b97('0x2c')][_0x4b97('0x51')]){_0x32624b[_0x4b97('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0x4b97('0x53')](_0x32624b);})[_0x4b97('0x50')](function(_0x48c60e){_0x1d678f[_0x4b97('0x54')]=_0x48c60e;return _0x1d678f;})[_0x4b97('0x50')](respondWithFilteredResult(_0x1806f8,_0x32624b))[_0x4b97('0x55')](handleError(_0x1806f8,null));};exports[_0x4b97('0x56')]=function(_0x275732,_0x4054ba){var _0x50cbda={'raw':!![],'where':{'id':_0x275732[_0x4b97('0x57')]['id']}},_0xecb6ac={};_0xecb6ac['model']=_[_0x4b97('0x58')](db[_0x4b97('0x4f')][_0x4b97('0x2a')]);_0xecb6ac[_0x4b97('0x2c')]=_[_0x4b97('0x58')](_0x275732[_0x4b97('0x2c')]);_0xecb6ac[_0x4b97('0x2d')]=_[_0x4b97('0x2e')](_0xecb6ac[_0x4b97('0x2b')],_0xecb6ac[_0x4b97('0x2c')]);_0x50cbda[_0x4b97('0x42')]=_['intersection'](_0xecb6ac['model'],qs[_0x4b97('0x43')](_0x275732[_0x4b97('0x2c')][_0x4b97('0x43')]));_0x50cbda[_0x4b97('0x42')]=_0x50cbda[_0x4b97('0x42')][_0x4b97('0x44')]?_0x50cbda['attributes']:_0xecb6ac[_0x4b97('0x2b')];if(_0x275732['query'][_0x4b97('0x51')]){_0x50cbda[_0x4b97('0x52')]=[{'all':!![]}];}_0x50cbda=_[_0x4b97('0x4b')]({},_0x50cbda,_0x275732[_0x4b97('0x59')]);return db[_0x4b97('0x4f')][_0x4b97('0x5a')](_0x50cbda)[_0x4b97('0x50')](handleEntityNotFound(_0x4054ba,null))[_0x4b97('0x50')](respondWithResult(_0x4054ba,null))[_0x4b97('0x55')](handleError(_0x4054ba,null));};exports[_0x4b97('0x5b')]=function(_0x5ec0a8,_0x48cbc7){return db[_0x4b97('0x4f')]['create'](_0x5ec0a8[_0x4b97('0x5c')],{})['then'](respondWithResult(_0x48cbc7,0xc9))[_0x4b97('0x55')](handleError(_0x48cbc7,null));};exports[_0x4b97('0x5d')]=function(_0x1eb83b,_0x450b39){if(_0x1eb83b[_0x4b97('0x5c')]['id']){delete _0x1eb83b[_0x4b97('0x5c')]['id'];}return db[_0x4b97('0x4f')]['find']({'where':{'id':_0x1eb83b[_0x4b97('0x57')]['id']}})[_0x4b97('0x50')](handleEntityNotFound(_0x450b39,null))[_0x4b97('0x50')](saveUpdates(_0x1eb83b[_0x4b97('0x5c')],null))[_0x4b97('0x50')](respondWithResult(_0x450b39,null))[_0x4b97('0x55')](handleError(_0x450b39,null));};exports[_0x4b97('0x5e')]=function(_0x4eecdc,_0x30b3dd){return db[_0x4b97('0x4f')]['describe']()['then'](respondWithResult(_0x30b3dd,null))[_0x4b97('0x55')](handleError(_0x30b3dd,null));};exports[_0x4b97('0x24')]=function(_0x45af83,_0x1a654b){var _0x15eef5;return db['CmHopper'][_0x4b97('0x5a')]({'where':{'id':_0x45af83['params']['id']}})[_0x4b97('0x50')](handleEntityNotFound(_0x1a654b,null))[_0x4b97('0x50')](function(_0x4462c0){if(_0x4462c0){return _0x4462c0[_0x4b97('0x24')]()['then'](function(_0xb625fa){return _0xb625fa;});}})[_0x4b97('0x50')](function(_0x1faaf6){_0x15eef5=_0x1faaf6;if(_0x1faaf6){if(_0x1faaf6[_0x4b97('0x5f')]||_0x1faaf6[_0x4b97('0x60')]){return db[_0x1faaf6[_0x4b97('0x5f')]?'VoiceQueue':_0x4b97('0x61')][_0x4b97('0x5a')]({'where':{'id':_0x1faaf6['VoiceQueueId']?_0x1faaf6[_0x4b97('0x5f')]:_0x1faaf6['CampaignId']},'attributes':['id',_0x4b97('0x27')],'raw':!![]});}}})[_0x4b97('0x50')](function(_0x122cf4){var _0x47083d={};if(_0x122cf4){_[_0x4b97('0x4b')](_0x47083d,_[_0x4b97('0x62')](_0x15eef5[_0x4b97('0x63')],['createdAt',_0x4b97('0x64'),'id']));_0x47083d[_0x4b97('0x65')]=0x15;_0x47083d[_0x4b97('0x66')]='deleted';_0x47083d[_0x4b97('0x67')]=_0x122cf4[_0x4b97('0x27')];_0x47083d['membername']=_0x45af83[_0x4b97('0x68')][_0x4b97('0x27')];_0x47083d[_0x4b97('0x69')]=_0x45af83[_0x4b97('0x68')]['id'];_0x47083d[_0x4b97('0x6a')]=!![];_0x47083d[_0x4b97('0x6b')]=moment()[_0x4b97('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');_0x47083d[_0x4b97('0x6d')]=_0x15eef5['phone'];_0x47083d[_0x4b97('0x6e')]=_0x15eef5[_0x4b97('0x5f')]?_0x4b97('0x6f'):_0x4b97('0x70');return db[_0x4b97('0x71')]['find']({'where':{'id':_0x47083d['ContactId']},'attributes':[_0x4b97('0x72'),_0x4b97('0x73')]})[_0x4b97('0x50')](function(_0x17bd43){if(!_['isNil'](_0x1a654b)&&!_[_0x4b97('0x74')](_0x17bd43[_0x4b97('0x72')])){_0x47083d[_0x4b97('0x75')]=_0x17bd43[_0x4b97('0x72')];if(!_[_0x4b97('0x74')](_0x17bd43[_0x4b97('0x73')])){_0x47083d[_0x4b97('0x75')]+='\x20'+_0x17bd43[_0x4b97('0x73')];}}})[_0x4b97('0x76')](function(){return db['CmHopperFinal'][_0x4b97('0x5b')](_0x47083d);});}})[_0x4b97('0x50')](function(){return _0x1a654b[_0x4b97('0x1b')](0xcc)['end']();})[_0x4b97('0x55')](handleError(_0x1a654b,null));};exports['getPreview']=function(_0x30eb04,_0x421d37,_0x1e98f7){var _0x331c42=[];return db[_0x4b97('0x71')]['describe']()['then'](function(_0x3620b7){_0x331c42=_['keys'](_0x3620b7);return _0x30eb04[_0x4b97('0x68')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x4b97('0x50')](function(_0x28f443){if(_0x28f443&&_0x28f443[_0x4b97('0x44')]){return db[_0x4b97('0x77')][_0x4b97('0x78')](function(_0x5011e4){var _0x2d871c={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x4b97('0x79'))},'VoiceQueueId':{'$in':_[_0x4b97('0x4c')](_0x28f443,'id')},'$or':[{'UserId':null},{'UserId':_0x30eb04[_0x4b97('0x68')]['id']}]};var _0x1b4e34=[];if(_0x30eb04['body'][_0x4b97('0x7a')]&&_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7a')]==='prev'){if(!_[_0x4b97('0x7b')](_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7c')])){_0x2d871c['id']={'$in':_0x30eb04['body'][_0x4b97('0x7c')]};}_0x1b4e34=[[_0x4b97('0x7d'),_0x4b97('0x7e')],[_0x4b97('0x7f'),_0x28f443[0x0][_0x4b97('0x80')]===_0x4b97('0x7e')?_0x4b97('0x81'):'ASC'],db[_0x4b97('0x77')][_0x4b97('0x82')](_0x4b97('0x83')),['id',_0x4b97('0x81')]];}else{if(!_[_0x4b97('0x7b')](_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7c')])){_0x2d871c['id']={'$notIn':_0x30eb04[_0x4b97('0x5c')][_0x4b97('0x7c')]};}_0x1b4e34=[['priority',_0x4b97('0x81')],[_0x4b97('0x7f'),_0x28f443[0x0][_0x4b97('0x80')]],db[_0x4b97('0x77')][_0x4b97('0x82')](_0x4b97('0x84')),['id',_0x4b97('0x7e')]];}return db[_0x4b97('0x4f')]['findOne']({'attributes':['id','scheduledat'],'where':_0x2d871c,'order':_0x1b4e34,'transaction':_0x5011e4,'lock':_0x5011e4['LOCK'][_0x4b97('0x85')],'include':[{'model':db['CmContact'],'as':_0x4b97('0x86'),'attributes':_0x331c42,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id','name']}]},{'model':db[_0x4b97('0x87')],'as':_0x4b97('0x88'),'attributes':['id',_0x4b97('0x27')]},{'model':db[_0x4b97('0x89')],'as':_0x4b97('0x8a'),'attributes':['id',_0x4b97('0x27'),_0x4b97('0x8b')]}]})[_0x4b97('0x50')](function(_0x4f6371){if(_0x4f6371){return _0x4f6371[_0x4b97('0x5d')]({'UserId':_0x30eb04[_0x4b97('0x68')]['id']},{'transaction':_0x5011e4});}});});}})[_0x4b97('0x50')](handleEntityNotFound(_0x421d37,null))['then'](respondWithResult(_0x421d37,null))[_0x4b97('0x55')](handleError(_0x421d37,null));};exports['getOpenContacts']=function(_0x2de146,_0x45ea38,_0x507fbb){return _0x2de146['user'][_0x4b97('0x8c')]({'where':{'type':_0x4b97('0x8d'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x4b97('0x50')](function(_0x2e455a){if(_0x2e455a&&_0x2e455a[_0x4b97('0x44')]){return db['CmHopper'][_0x4b97('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x4b97('0x6c')](_0x4b97('0x79'))},'VoiceQueueId':{'$in':_[_0x4b97('0x4c')](_0x2e455a,'id')},'$or':[{'UserId':null},{'UserId':_0x2de146['user']['id']}]}});}return 0x0;})[_0x4b97('0x50')](function(_0x4c3d78){if(!_[_0x4b97('0x74')](_0x4c3d78)&&_[_0x4b97('0x8e')](_0x4c3d78)){return _0x45ea38[_0x4b97('0x1b')](0xc8)[_0x4b97('0x1d')]({'contacts':_0x4c3d78});}else{logger[_0x4b97('0x25')](_0x4b97('0x8f'),_0x4b97('0x90'),0x194,_0x4b97('0x91'));_0x45ea38[_0x4b97('0x1a')](0x194);}})['catch'](handleError(_0x45ea38,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 145a6ae..ca1e19b 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 _0x22fb=['moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','../../config/logger'];(function(_0x304bf7,_0x4fcafc){var _0x5036cd=function(_0x39e810){while(--_0x39e810){_0x304bf7['push'](_0x304bf7['shift']());}};_0x5036cd(++_0x4fcafc);}(_0x22fb,0x192));var _0xb22f=function(_0x51eab8,_0xbf0b46){_0x51eab8=_0x51eab8-0x0;var _0x2afabe=_0x22fb[_0x51eab8];return _0x2afabe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xb22f('0xa'),'fields':[_0xb22f('0xa')]},{'name':_0xb22f('0xb'),'fields':[_0xb22f('0xb')]},{'name':_0xb22f('0xc'),'fields':[_0xb22f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x70e0=['path','rimraf','./cmHopper.attributes','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0x70e0,0x17b));var _0x070e=function(_0xc67faa,_0x2265a2){_0xc67faa=_0xc67faa-0x0;var _0x2a306e=_0x70e0[_0xc67faa];return _0x2a306e;};'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']('CmHopper',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]},{'name':_0x070e('0xa'),'fields':[_0x070e('0xa')]},{'name':_0x070e('0xb'),'fields':[_0x070e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 803e426..8087096 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 _0x678c=['COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','length','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetCmHopper','findAll','options','raw','where','limit','include','map','model','attributes','ShowCmHopper','CmHopper','find','debug','CreateCmHopper','body','UpdateCmHopper','update','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','push','all','MoveContactManagedDialer','CmHopperFinal','create','CountReScheduled'];(function(_0x4758fe,_0x320797){var _0xa74c4f=function(_0x5a5682){while(--_0x5a5682){_0x4758fe['push'](_0x4758fe['shift']());}};_0xa74c4f(++_0x320797);}(_0x678c,0xd7));var _0xc678=function(_0x13e242,_0x3c5289){_0x13e242=_0x13e242-0x0;var _0x5e0f6c=_0x678c[_0x13e242];return _0x5e0f6c;};'use strict';var _=require(_0xc678('0x0'));var util=require(_0xc678('0x1'));var moment=require(_0xc678('0x2'));var BPromise=require(_0xc678('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc678('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc678('0x5'))(_0xc678('0x6'));var config=require(_0xc678('0x7'));var jayson=require(_0xc678('0x8'));var client=jayson[_0xc678('0x9')][_0xc678('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x214e65,_0x19cf21,_0x346209){return new BPromise(function(_0xc9b2ae,_0x42a0f7){return client[_0xc678('0xb')](_0x214e65,_0x346209)[_0xc678('0xc')](function(_0x1b1116){logger['info'](_0xc678('0xd'),_0x19cf21,_0xc678('0xe'));logger['debug'](_0xc678('0xf'),_0x19cf21,_0xc678('0xe'),JSON[_0xc678('0x10')](_0x1b1116));if(_0x1b1116['error']){if(_0x1b1116[_0xc678('0x11')]['code']===0x1f4){logger[_0xc678('0x11')](_0xc678('0xd'),_0x19cf21,_0x1b1116[_0xc678('0x11')]['message']);return _0x42a0f7(_0x1b1116[_0xc678('0x11')][_0xc678('0x12')]);}logger[_0xc678('0x11')]('CmHopper,\x20%s,\x20%s',_0x19cf21,_0x1b1116[_0xc678('0x11')][_0xc678('0x12')]);return _0xc9b2ae(_0x1b1116[_0xc678('0x11')][_0xc678('0x12')]);}else{logger[_0xc678('0x13')](_0xc678('0xd'),_0x19cf21,_0xc678('0xe'));_0xc9b2ae(_0x1b1116[_0xc678('0x14')]['message']);}})[_0xc678('0x15')](function(_0x5c1880){logger[_0xc678('0x11')]('CmHopper,\x20%s,\x20%s',_0x19cf21,_0x5c1880);_0x42a0f7(_0x5c1880);});});}exports[_0xc678('0x16')]=function(_0x511acc){var _0x425848=this;return new Promise(function(_0x298c69,_0x3c282e){return db['CmHopper'][_0xc678('0x17')]({'raw':_0x511acc[_0xc678('0x18')]?_0x511acc['options'][_0xc678('0x19')]===undefined?!![]:![]:!![],'where':_0x511acc['options']?_0x511acc['options'][_0xc678('0x1a')]||null:null,'attributes':_0x511acc[_0xc678('0x18')]?_0x511acc[_0xc678('0x18')]['attributes']||null:null,'limit':_0x511acc[_0xc678('0x18')]?_0x511acc[_0xc678('0x18')][_0xc678('0x1b')]||null:null,'include':_0x511acc[_0xc678('0x18')]?_0x511acc[_0xc678('0x18')][_0xc678('0x1c')]?_[_0xc678('0x1d')](_0x511acc['options'][_0xc678('0x1c')],function(_0x4ad408){return{'model':db[_0x4ad408[_0xc678('0x1e')]],'as':_0x4ad408['as'],'attributes':_0x4ad408[_0xc678('0x1f')],'include':_0x4ad408['include']?_[_0xc678('0x1d')](_0x4ad408[_0xc678('0x1c')],function(_0x553c00){return{'model':db[_0x553c00[_0xc678('0x1e')]],'as':_0x553c00['as'],'attributes':_0x553c00[_0xc678('0x1f')],'include':_0x553c00[_0xc678('0x1c')]?_[_0xc678('0x1d')](_0x553c00[_0xc678('0x1c')],function(_0x28176d){return{'model':db[_0x28176d[_0xc678('0x1e')]],'as':_0x28176d['as'],'attributes':_0x28176d[_0xc678('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc678('0xc')](function(_0x379504){logger[_0xc678('0x13')](_0xc678('0x16'),_0x511acc);logger['debug']('GetCmHopper',_0x511acc,JSON[_0xc678('0x10')](_0x379504));_0x298c69(_0x379504);})[_0xc678('0x15')](function(_0xfaeaaa){logger['error']('GetCmHopper',_0xfaeaaa[_0xc678('0x12')],_0x511acc);_0x3c282e(_0x425848['error'](0x1f4,_0xfaeaaa[_0xc678('0x12')]));});});};exports[_0xc678('0x20')]=function(_0x22e3b8){var _0x38ece9=this;return new Promise(function(_0x1de848,_0x2759d5){return db[_0xc678('0x21')][_0xc678('0x22')]({'raw':_0x22e3b8[_0xc678('0x18')]?_0x22e3b8[_0xc678('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x22e3b8[_0xc678('0x18')]?_0x22e3b8[_0xc678('0x18')][_0xc678('0x1a')]||null:null,'attributes':_0x22e3b8[_0xc678('0x18')]?_0x22e3b8['options'][_0xc678('0x1f')]||null:null,'include':_0x22e3b8[_0xc678('0x18')]?_0x22e3b8[_0xc678('0x18')][_0xc678('0x1c')]?_['map'](_0x22e3b8['options'][_0xc678('0x1c')],function(_0x10c5f9){return{'model':db[_0x10c5f9[_0xc678('0x1e')]],'as':_0x10c5f9['as'],'attributes':_0x10c5f9[_0xc678('0x1f')],'include':_0x10c5f9['include']?_[_0xc678('0x1d')](_0x10c5f9['include'],function(_0x4155aa){return{'model':db[_0x4155aa['model']],'as':_0x4155aa['as'],'attributes':_0x4155aa['attributes'],'include':_0x4155aa[_0xc678('0x1c')]?_[_0xc678('0x1d')](_0x4155aa[_0xc678('0x1c')],function(_0x531259){return{'model':db[_0x531259[_0xc678('0x1e')]],'as':_0x531259['as'],'attributes':_0x531259[_0xc678('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc678('0xc')](function(_0x37d9a5){logger[_0xc678('0x13')](_0xc678('0x20'),_0x22e3b8);logger[_0xc678('0x23')]('ShowCmHopper',_0x22e3b8,JSON['stringify'](_0x37d9a5));_0x1de848(_0x37d9a5);})[_0xc678('0x15')](function(_0x53c219){logger[_0xc678('0x11')](_0xc678('0x20'),_0x53c219[_0xc678('0x12')],_0x22e3b8);_0x2759d5(_0x38ece9['error'](0x1f4,_0x53c219[_0xc678('0x12')]));});});};exports[_0xc678('0x24')]=function(_0x1319bb){var _0x431855=this;return new Promise(function(_0x2e7ef0,_0x3cbe85){return db[_0xc678('0x21')]['create'](_0x1319bb[_0xc678('0x25')],{'raw':_0x1319bb[_0xc678('0x18')]?_0x1319bb[_0xc678('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x46444d){logger['info'](_0xc678('0x24'),_0x1319bb);logger[_0xc678('0x23')](_0xc678('0x24'),_0x1319bb,JSON[_0xc678('0x10')](_0x46444d));_0x2e7ef0(_0x46444d);})[_0xc678('0x15')](function(_0x2727b5){logger[_0xc678('0x11')]('CreateCmHopper',_0x2727b5[_0xc678('0x12')],_0x1319bb);_0x3cbe85(_0x431855[_0xc678('0x11')](0x1f4,_0x2727b5[_0xc678('0x12')]));});});};exports[_0xc678('0x26')]=function(_0x3c263a){var _0x47c555=this;return new Promise(function(_0x3b87b0,_0x1a10fb){return db[_0xc678('0x21')][_0xc678('0x27')](_0x3c263a[_0xc678('0x25')],{'raw':_0x3c263a[_0xc678('0x18')]?_0x3c263a[_0xc678('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c263a[_0xc678('0x18')]?_0x3c263a[_0xc678('0x18')][_0xc678('0x1a')]||null:null,'attributes':_0x3c263a[_0xc678('0x18')]?_0x3c263a[_0xc678('0x18')]['attributes']||null:null,'limit':_0x3c263a[_0xc678('0x18')]?_0x3c263a[_0xc678('0x18')][_0xc678('0x1b')]||null:null})['then'](function(_0x408877){logger[_0xc678('0x13')](_0xc678('0x26'),_0x3c263a);logger[_0xc678('0x23')]('UpdateCmHopper',_0x3c263a,JSON['stringify'](_0x408877));_0x3b87b0(_0x408877);})[_0xc678('0x15')](function(_0x26bf3c){logger[_0xc678('0x11')](_0xc678('0x26'),_0x26bf3c[_0xc678('0x12')],_0x3c263a);_0x1a10fb(_0x47c555['error'](0x1f4,_0x26bf3c[_0xc678('0x12')]));});});};exports['DestroyCmHopper']=function(_0x317c38){var _0x26ba32=this;return new Promise(function(_0x55022c,_0x5e0341){return db[_0xc678('0x21')][_0xc678('0x28')]({'where':_0x317c38[_0xc678('0x18')]?_0x317c38['options'][_0xc678('0x1a')]||null:null})[_0xc678('0xc')](function(_0x86282e){logger[_0xc678('0x13')]('DestroyCmHopper',_0x317c38);logger['debug'](_0xc678('0x29'),_0x317c38,JSON['stringify'](_0x86282e));_0x55022c(_0x86282e);})[_0xc678('0x15')](function(_0x40281c){logger[_0xc678('0x11')](_0xc678('0x29'),_0x40281c[_0xc678('0x12')],_0x317c38);_0x5e0341(_0x26ba32[_0xc678('0x11')](0x1f4,_0x40281c['message']));});});};exports[_0xc678('0x2a')]=function(_0xaf8421){var _0x3c3ceb=this;return new Promise(function(_0x48a5f1,_0xe04754){return db[_0xc678('0x2b')][_0xc678('0x2c')]()['then'](function(_0x3a3e9e){return db[_0xc678('0x2d')][_0xc678('0x2e')](function(_0x4d1c56){return db['CmHopper'][_0xc678('0x17')]({'where':_0xaf8421['options']?_0xaf8421['options'][_0xc678('0x1a')]||null:null,'attributes':_0xaf8421['options']?_0xaf8421[_0xc678('0x18')][_0xc678('0x1f')]||null:null,'limit':_0xaf8421[_0xc678('0x18')]?_0xaf8421[_0xc678('0x18')][_0xc678('0x1b')]||null:null,'order':_0xaf8421[_0xc678('0x18')]?_0xaf8421['options'][_0xc678('0x2f')]||null:null,'transaction':_0x4d1c56,'lock':_0x4d1c56[_0xc678('0x30')]['UPDATE'],'include':[{'model':db[_0xc678('0x2b')],'as':_0xc678('0x31'),'attributes':_[_0xc678('0x32')](_0x3a3e9e)}]})['then'](function(_0x5d9310){var _0x34b2ce=[];for(var _0x254812=0x0;_0x254812<_0x5d9310['length'];_0x254812+=0x1){_0x34b2ce[_0xc678('0x33')](_0x5d9310[_0x254812][_0xc678('0x27')](_0xaf8421[_0xc678('0x25')],{'transaction':_0x4d1c56}));}return BPromise[_0xc678('0x34')](_0x34b2ce);});})[_0xc678('0xc')](function(_0x565c51){logger[_0xc678('0x13')](_0xc678('0x2a'),_0xaf8421);logger[_0xc678('0x23')]('GetContactDialer',_0xaf8421,JSON['stringify'](_0x565c51));_0x48a5f1(_0x565c51);})[_0xc678('0x15')](function(_0xdcd67e){logger['error'](_0xc678('0x2a'),_0xdcd67e['message'],_0xaf8421);_0xe04754(_0x3c3ceb[_0xc678('0x11')](0x1f4,_0xdcd67e[_0xc678('0x12')]));});});});};exports[_0xc678('0x35')]=function(_0x2c1c88){var _0x280f79=this;return new Promise(function(_0x795cfc,_0x7c3285){return db[_0xc678('0x2d')][_0xc678('0x2e')](function(_0x4fd2d7){return db[_0xc678('0x36')][_0xc678('0x37')](_0x2c1c88[_0xc678('0x25')],{'raw':_0x2c1c88[_0xc678('0x18')]?_0x2c1c88[_0xc678('0x18')][_0xc678('0x19')]===undefined?!![]:![]:!![],'transaction':_0x4fd2d7})[_0xc678('0xc')](function(){return db[_0xc678('0x21')][_0xc678('0x28')]({'where':_0x2c1c88[_0xc678('0x18')]?_0x2c1c88[_0xc678('0x18')]['where']||null:null,'transaction':_0x4fd2d7});});})[_0xc678('0xc')](function(_0x174170){logger[_0xc678('0x13')](_0xc678('0x35'),_0x2c1c88);logger[_0xc678('0x23')](_0xc678('0x35'),_0x2c1c88,JSON[_0xc678('0x10')](_0x174170));_0x795cfc(_0x174170);})[_0xc678('0x15')](function(_0x34a7d2){logger['error']('MoveContactManagedDialer',_0x34a7d2[_0xc678('0x12')],_0x2c1c88);_0x7c3285(_0x280f79[_0xc678('0x11')](0x1f4,_0x34a7d2['message']));});});};exports[_0xc678('0x38')]=function(_0x5368c8){var _0xa5936=this;return new Promise(function(_0x1a3ab1,_0xa4ba4){return db['CmHopper']['findAll']({'raw':_0x5368c8[_0xc678('0x18')]?_0x5368c8['options'][_0xc678('0x19')]===undefined?!![]:![]:!![],'where':_0x5368c8[_0xc678('0x18')]?_0x5368c8[_0xc678('0x18')][_0xc678('0x1a')]||null:null,'attributes':[[db[_0xc678('0x2d')]['fn'](_0xc678('0x39'),db['sequelize']['fn']('IF',db[_0xc678('0x2d')][_0xc678('0x3a')](_0xc678('0x3b')+util[_0xc678('0x3c')](_0xc678('0x3d'),moment()['format'](_0xc678('0x3e')))+_0xc678('0x3f')))),_0xc678('0x40')]]})['then'](function(_0x47a8c8){logger[_0xc678('0x13')](_0xc678('0x38'),_0x5368c8);logger['debug'](_0xc678('0x38'),_0x5368c8,JSON[_0xc678('0x10')](_0x47a8c8));_0x1a3ab1(_0x47a8c8);})['catch'](function(_0x141afe){logger[_0xc678('0x11')](_0xc678('0x38'),_0x141afe[_0xc678('0x12')],_0x5368c8);_0xa4ba4(_0xa5936[_0xc678('0x11')](0x1f4,_0x141afe['message']));});});};exports[_0xc678('0x41')]=function(_0x27be0d){var _0x3125d0=this;return new Promise(function(_0x4e1e14,_0x301d54){return db[_0xc678('0x2b')][_0xc678('0x2c')]()[_0xc678('0xc')](function(_0x2fc589){return db[_0xc678('0x2d')][_0xc678('0x2e')](function(_0x48184b){return db[_0xc678('0x21')]['findAll']({'where':_0x27be0d[_0xc678('0x18')]?_0x27be0d[_0xc678('0x18')]['where']||null:null,'attributes':_0x27be0d[_0xc678('0x18')]?_0x27be0d[_0xc678('0x18')]['attributes']||null:null,'limit':0x1,'order':_0x27be0d[_0xc678('0x18')]?_0x27be0d['options'][_0xc678('0x2f')]||null:null,'group':db[_0xc678('0x21')][_0xc678('0x42')],'transaction':_0x48184b,'lock':_0x48184b[_0xc678('0x30')]['UPDATE'],'include':_0x27be0d[_0xc678('0x18')]?_0x27be0d[_0xc678('0x18')][_0xc678('0x1c')]?_['map'](_0x27be0d[_0xc678('0x18')]['include'],function(_0xa32d2c){return{'model':db[_0xa32d2c[_0xc678('0x1e')]],'as':_0xa32d2c['as'],'attributes':_0xa32d2c['attributes'],'include':_0xa32d2c[_0xc678('0x1c')]?_['map'](_0xa32d2c[_0xc678('0x1c')],function(_0x132622){return{'model':db[_0x132622[_0xc678('0x1e')]],'as':_0x132622['as'],'attributes':_0x132622['attributes'],'include':_0x132622[_0xc678('0x1c')]?_[_0xc678('0x1d')](_0x132622[_0xc678('0x1c')],function(_0x112671){return{'model':db[_0x112671[_0xc678('0x1e')]],'as':_0x112671['as'],'attributes':_0x112671[_0xc678('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x484c8d){var _0x6a7827=[];for(var _0x4a2173=0x0;_0x4a2173<_0x484c8d[_0xc678('0x43')];_0x4a2173+=0x1){_0x6a7827['push'](_0x484c8d[_0x4a2173][_0xc678('0x27')](_0x27be0d['body'],{'transaction':_0x48184b}));}return BPromise[_0xc678('0x34')](_0x6a7827);});})['then'](function(_0x56c3bc){logger[_0xc678('0x13')]('GetContactRecallMe',_0x27be0d);logger[_0xc678('0x23')](_0xc678('0x41'),_0x27be0d,JSON[_0xc678('0x10')](_0x56c3bc));_0x4e1e14(_0x56c3bc);})[_0xc678('0x15')](function(_0x175748){logger[_0xc678('0x11')](_0xc678('0x41'),_0x175748[_0xc678('0x12')],_0x27be0d);_0x301d54(_0x3125d0[_0xc678('0x11')](0x1f4,_0x175748['message']));});});});}; \ No newline at end of file +var _0xebcc=['CmContact','describe','sequelize','transaction','findAll','order','LOCK','Contact','keys','length','body','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','UserId','UPDATE','push','all','GetContactRecallMe','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCmHopper','CmHopper','options','raw','where','include','map','model','attributes','catch','ShowCmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','limit','destroy','DestroyCmHopper','GetContactDialer'];(function(_0x2d5348,_0x2cc29c){var _0x6c32b7=function(_0x4e2f66){while(--_0x4e2f66){_0x2d5348['push'](_0x2d5348['shift']());}};_0x6c32b7(++_0x2cc29c);}(_0xebcc,0x117));var _0xcebc=function(_0x57f7ea,_0x54da6b){_0x57f7ea=_0x57f7ea-0x0;var _0x54a7e4=_0xebcc[_0x57f7ea];return _0x54a7e4;};'use strict';var _=require(_0xcebc('0x0'));var util=require('util');var moment=require(_0xcebc('0x1'));var BPromise=require(_0xcebc('0x2'));var rs=require(_0xcebc('0x3'));var fs=require('fs');var Redis=require(_0xcebc('0x4'));var db=require(_0xcebc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xcebc('0x6'));var jayson=require(_0xcebc('0x7'));var client=jayson[_0xcebc('0x8')][_0xcebc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47e294,_0x377458,_0x1e2a0d){return new BPromise(function(_0x253380,_0x3c7fb0){return client[_0xcebc('0xa')](_0x47e294,_0x1e2a0d)[_0xcebc('0xb')](function(_0x327767){logger[_0xcebc('0xc')](_0xcebc('0xd'),_0x377458,_0xcebc('0xe'));logger[_0xcebc('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x377458,_0xcebc('0xe'),JSON[_0xcebc('0x10')](_0x327767));if(_0x327767['error']){if(_0x327767[_0xcebc('0x11')][_0xcebc('0x12')]===0x1f4){logger[_0xcebc('0x11')]('CmHopper,\x20%s,\x20%s',_0x377458,_0x327767[_0xcebc('0x11')][_0xcebc('0x13')]);return _0x3c7fb0(_0x327767[_0xcebc('0x11')][_0xcebc('0x13')]);}logger[_0xcebc('0x11')](_0xcebc('0xd'),_0x377458,_0x327767[_0xcebc('0x11')]['message']);return _0x253380(_0x327767['error'][_0xcebc('0x13')]);}else{logger[_0xcebc('0xc')](_0xcebc('0xd'),_0x377458,_0xcebc('0xe'));_0x253380(_0x327767[_0xcebc('0x14')][_0xcebc('0x13')]);}})['catch'](function(_0x5a3417){logger[_0xcebc('0x11')](_0xcebc('0xd'),_0x377458,_0x5a3417);_0x3c7fb0(_0x5a3417);});});}exports[_0xcebc('0x15')]=function(_0x1d9ab4){var _0x5ae94e=this;return new Promise(function(_0x251993,_0x3ac65f){return db[_0xcebc('0x16')]['findAll']({'raw':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4[_0xcebc('0x17')][_0xcebc('0x18')]===undefined?!![]:![]:!![],'where':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0x1d9ab4['options']?_0x1d9ab4['options']['attributes']||null:null,'limit':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4[_0xcebc('0x17')]['limit']||null:null,'include':_0x1d9ab4[_0xcebc('0x17')]?_0x1d9ab4['options'][_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x1d9ab4[_0xcebc('0x17')]['include'],function(_0x376a25){return{'model':db[_0x376a25[_0xcebc('0x1c')]],'as':_0x376a25['as'],'attributes':_0x376a25[_0xcebc('0x1d')],'include':_0x376a25[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x376a25[_0xcebc('0x1a')],function(_0x5ed61e){return{'model':db[_0x5ed61e[_0xcebc('0x1c')]],'as':_0x5ed61e['as'],'attributes':_0x5ed61e['attributes'],'include':_0x5ed61e[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x5ed61e[_0xcebc('0x1a')],function(_0xc381b6){return{'model':db[_0xc381b6[_0xcebc('0x1c')]],'as':_0xc381b6['as'],'attributes':_0xc381b6[_0xcebc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcebc('0xb')](function(_0x44b742){logger[_0xcebc('0xc')](_0xcebc('0x15'),_0x1d9ab4);logger[_0xcebc('0xf')]('GetCmHopper',_0x1d9ab4,JSON['stringify'](_0x44b742));_0x251993(_0x44b742);})[_0xcebc('0x1e')](function(_0x52a2bf){logger[_0xcebc('0x11')](_0xcebc('0x15'),_0x52a2bf[_0xcebc('0x13')],_0x1d9ab4);_0x3ac65f(_0x5ae94e[_0xcebc('0x11')](0x1f4,_0x52a2bf['message']));});});};exports[_0xcebc('0x1f')]=function(_0x29e3d2){var _0xa5efc6=this;return new Promise(function(_0x413985,_0x15ce54){return db[_0xcebc('0x16')][_0xcebc('0x20')]({'raw':_0x29e3d2['options']?_0x29e3d2['options']['raw']===undefined?!![]:![]:!![],'where':_0x29e3d2[_0xcebc('0x17')]?_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0x29e3d2[_0xcebc('0x17')]?_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'include':_0x29e3d2[_0xcebc('0x17')]?_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x29e3d2[_0xcebc('0x17')][_0xcebc('0x1a')],function(_0xa29897){return{'model':db[_0xa29897[_0xcebc('0x1c')]],'as':_0xa29897['as'],'attributes':_0xa29897[_0xcebc('0x1d')],'include':_0xa29897[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0xa29897[_0xcebc('0x1a')],function(_0x39a648){return{'model':db[_0x39a648[_0xcebc('0x1c')]],'as':_0x39a648['as'],'attributes':_0x39a648[_0xcebc('0x1d')],'include':_0x39a648[_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x39a648[_0xcebc('0x1a')],function(_0x239cbf){return{'model':db[_0x239cbf['model']],'as':_0x239cbf['as'],'attributes':_0x239cbf[_0xcebc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xcebc('0xb')](function(_0x19a3ab){logger[_0xcebc('0xc')](_0xcebc('0x1f'),_0x29e3d2);logger[_0xcebc('0xf')](_0xcebc('0x1f'),_0x29e3d2,JSON[_0xcebc('0x10')](_0x19a3ab));_0x413985(_0x19a3ab);})[_0xcebc('0x1e')](function(_0x2f6397){logger['error']('ShowCmHopper',_0x2f6397[_0xcebc('0x13')],_0x29e3d2);_0x15ce54(_0xa5efc6['error'](0x1f4,_0x2f6397[_0xcebc('0x13')]));});});};exports[_0xcebc('0x21')]=function(_0x237926){var _0x237803=this;return new Promise(function(_0xdc1fde,_0x340877){return db['CmHopper'][_0xcebc('0x22')](_0x237926['body'],{'raw':_0x237926[_0xcebc('0x17')]?_0x237926[_0xcebc('0x17')][_0xcebc('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x28cfd6){logger[_0xcebc('0xc')](_0xcebc('0x21'),_0x237926);logger[_0xcebc('0xf')]('CreateCmHopper',_0x237926,JSON[_0xcebc('0x10')](_0x28cfd6));_0xdc1fde(_0x28cfd6);})[_0xcebc('0x1e')](function(_0x53b1d6){logger[_0xcebc('0x11')](_0xcebc('0x21'),_0x53b1d6[_0xcebc('0x13')],_0x237926);_0x340877(_0x237803[_0xcebc('0x11')](0x1f4,_0x53b1d6[_0xcebc('0x13')]));});});};exports[_0xcebc('0x23')]=function(_0xbb518f){var _0x34ab3c=this;return new Promise(function(_0x49104b,_0x55dab1){return db[_0xcebc('0x16')][_0xcebc('0x24')](_0xbb518f['body'],{'raw':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'limit':_0xbb518f[_0xcebc('0x17')]?_0xbb518f[_0xcebc('0x17')][_0xcebc('0x25')]||null:null})['then'](function(_0x2875a7){logger[_0xcebc('0xc')](_0xcebc('0x23'),_0xbb518f);logger[_0xcebc('0xf')](_0xcebc('0x23'),_0xbb518f,JSON[_0xcebc('0x10')](_0x2875a7));_0x49104b(_0x2875a7);})[_0xcebc('0x1e')](function(_0x44b713){logger[_0xcebc('0x11')]('UpdateCmHopper',_0x44b713[_0xcebc('0x13')],_0xbb518f);_0x55dab1(_0x34ab3c[_0xcebc('0x11')](0x1f4,_0x44b713['message']));});});};exports['DestroyCmHopper']=function(_0x2872ed){var _0x3e5fe7=this;return new Promise(function(_0x3fb21b,_0x532c37){return db[_0xcebc('0x16')][_0xcebc('0x26')]({'where':_0x2872ed[_0xcebc('0x17')]?_0x2872ed[_0xcebc('0x17')][_0xcebc('0x19')]||null:null})['then'](function(_0x432517){logger[_0xcebc('0xc')](_0xcebc('0x27'),_0x2872ed);logger['debug'](_0xcebc('0x27'),_0x2872ed,JSON[_0xcebc('0x10')](_0x432517));_0x3fb21b(_0x432517);})['catch'](function(_0xa2cc59){logger[_0xcebc('0x11')](_0xcebc('0x27'),_0xa2cc59[_0xcebc('0x13')],_0x2872ed);_0x532c37(_0x3e5fe7[_0xcebc('0x11')](0x1f4,_0xa2cc59['message']));});});};exports[_0xcebc('0x28')]=function(_0x25e9e0){var _0x2c1cdf=this;return new Promise(function(_0xb19da,_0x98f891){return db[_0xcebc('0x29')][_0xcebc('0x2a')]()[_0xcebc('0xb')](function(_0x57e03b){return db[_0xcebc('0x2b')][_0xcebc('0x2c')](function(_0x56da0c){return db['CmHopper'][_0xcebc('0x2d')]({'where':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'limit':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0['options'][_0xcebc('0x25')]||null:null,'order':_0x25e9e0[_0xcebc('0x17')]?_0x25e9e0[_0xcebc('0x17')][_0xcebc('0x2e')]||null:null,'transaction':_0x56da0c,'lock':_0x56da0c[_0xcebc('0x2f')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0xcebc('0x30'),'attributes':_[_0xcebc('0x31')](_0x57e03b)}]})[_0xcebc('0xb')](function(_0x396623){var _0x3869b1=[];for(var _0x16bc65=0x0;_0x16bc65<_0x396623[_0xcebc('0x32')];_0x16bc65+=0x1){_0x3869b1['push'](_0x396623[_0x16bc65][_0xcebc('0x24')](_0x25e9e0[_0xcebc('0x33')],{'transaction':_0x56da0c}));}return BPromise['all'](_0x3869b1);});})['then'](function(_0x42a6d4){logger['info'](_0xcebc('0x28'),_0x25e9e0);logger[_0xcebc('0xf')](_0xcebc('0x28'),_0x25e9e0,JSON[_0xcebc('0x10')](_0x42a6d4));_0xb19da(_0x42a6d4);})[_0xcebc('0x1e')](function(_0x1bc38c){logger[_0xcebc('0x11')]('GetContactDialer',_0x1bc38c[_0xcebc('0x13')],_0x25e9e0);_0x98f891(_0x2c1cdf[_0xcebc('0x11')](0x1f4,_0x1bc38c[_0xcebc('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x27b9e5){var _0x451d5b=this;return new Promise(function(_0x566c69,_0x4dbe84){return db[_0xcebc('0x2b')][_0xcebc('0x2c')](function(_0x5cbaa4){return db[_0xcebc('0x34')][_0xcebc('0x22')](_0x27b9e5[_0xcebc('0x33')],{'raw':_0x27b9e5[_0xcebc('0x17')]?_0x27b9e5['options'][_0xcebc('0x18')]===undefined?!![]:![]:!![],'transaction':_0x5cbaa4})[_0xcebc('0xb')](function(){return db[_0xcebc('0x16')][_0xcebc('0x26')]({'where':_0x27b9e5[_0xcebc('0x17')]?_0x27b9e5['options'][_0xcebc('0x19')]||null:null,'transaction':_0x5cbaa4});});})[_0xcebc('0xb')](function(_0x2329e4){logger['info'](_0xcebc('0x35'),_0x27b9e5);logger[_0xcebc('0xf')](_0xcebc('0x35'),_0x27b9e5,JSON['stringify'](_0x2329e4));_0x566c69(_0x2329e4);})['catch'](function(_0x445ee9){logger['error']('MoveContactManagedDialer',_0x445ee9[_0xcebc('0x13')],_0x27b9e5);_0x4dbe84(_0x451d5b[_0xcebc('0x11')](0x1f4,_0x445ee9['message']));});});};exports[_0xcebc('0x36')]=function(_0x3ae56f){var _0x1c96c8=this;return new Promise(function(_0x276d6,_0x22ceee){return db[_0xcebc('0x16')][_0xcebc('0x2d')]({'raw':_0x3ae56f[_0xcebc('0x17')]?_0x3ae56f['options'][_0xcebc('0x18')]===undefined?!![]:![]:!![],'where':_0x3ae56f['options']?_0x3ae56f[_0xcebc('0x17')][_0xcebc('0x19')]||null:null,'attributes':[[db[_0xcebc('0x2b')]['fn'](_0xcebc('0x37'),db['sequelize']['fn']('IF',db[_0xcebc('0x2b')][_0xcebc('0x38')](_0xcebc('0x39')+util[_0xcebc('0x3a')]('\x22%s\x22',moment()[_0xcebc('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0xcebc('0xb')](function(_0x4a23c6){logger[_0xcebc('0xc')]('CountReScheduled',_0x3ae56f);logger['debug'](_0xcebc('0x36'),_0x3ae56f,JSON[_0xcebc('0x10')](_0x4a23c6));_0x276d6(_0x4a23c6);})[_0xcebc('0x1e')](function(_0x32348b){logger[_0xcebc('0x11')]('CountReScheduled',_0x32348b[_0xcebc('0x13')],_0x3ae56f);_0x22ceee(_0x1c96c8[_0xcebc('0x11')](0x1f4,_0x32348b['message']));});});};exports['GetContactRecallMe']=function(_0x24b0fc){var _0x158247=this;return new Promise(function(_0x2f966f,_0x4b80e9){return db['CmContact'][_0xcebc('0x2a')]()[_0xcebc('0xb')](function(_0x20b90c){return db['sequelize'][_0xcebc('0x2c')](function(_0x1ed4a6){return db[_0xcebc('0x16')][_0xcebc('0x2d')]({'where':_0x24b0fc[_0xcebc('0x17')]?_0x24b0fc['options']['where']||null:null,'attributes':_0x24b0fc['options']?_0x24b0fc[_0xcebc('0x17')][_0xcebc('0x1d')]||null:null,'limit':0x1,'order':_0x24b0fc[_0xcebc('0x17')]?_0x24b0fc['options'][_0xcebc('0x2e')]||null:null,'group':db[_0xcebc('0x16')][_0xcebc('0x3b')],'transaction':_0x1ed4a6,'lock':_0x1ed4a6[_0xcebc('0x2f')][_0xcebc('0x3c')],'include':_0x24b0fc[_0xcebc('0x17')]?_0x24b0fc[_0xcebc('0x17')][_0xcebc('0x1a')]?_[_0xcebc('0x1b')](_0x24b0fc[_0xcebc('0x17')][_0xcebc('0x1a')],function(_0x32121f){return{'model':db[_0x32121f['model']],'as':_0x32121f['as'],'attributes':_0x32121f[_0xcebc('0x1d')],'include':_0x32121f[_0xcebc('0x1a')]?_['map'](_0x32121f[_0xcebc('0x1a')],function(_0x3c1e84){return{'model':db[_0x3c1e84[_0xcebc('0x1c')]],'as':_0x3c1e84['as'],'attributes':_0x3c1e84[_0xcebc('0x1d')],'include':_0x3c1e84['include']?_['map'](_0x3c1e84['include'],function(_0x5034fe){return{'model':db[_0x5034fe[_0xcebc('0x1c')]],'as':_0x5034fe['as'],'attributes':_0x5034fe[_0xcebc('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32eaee){var _0x30bf3b=[];for(var _0x10a02c=0x0;_0x10a02c<_0x32eaee[_0xcebc('0x32')];_0x10a02c+=0x1){_0x30bf3b[_0xcebc('0x3d')](_0x32eaee[_0x10a02c][_0xcebc('0x24')](_0x24b0fc['body'],{'transaction':_0x1ed4a6}));}return BPromise[_0xcebc('0x3e')](_0x30bf3b);});})[_0xcebc('0xb')](function(_0x5500c0){logger[_0xcebc('0xc')]('GetContactRecallMe',_0x24b0fc);logger['debug'](_0xcebc('0x3f'),_0x24b0fc,JSON['stringify'](_0x5500c0));_0x2f966f(_0x5500c0);})[_0xcebc('0x1e')](function(_0x13ed8b){logger['error'](_0xcebc('0x3f'),_0x13ed8b['message'],_0x24b0fc);_0x4b80e9(_0x158247[_0xcebc('0x11')](0x1f4,_0x13ed8b[_0xcebc('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 38d21a6..72288b0 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 _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file +var _0x9957=['/:id','show','post','/preview','getPreview','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./cmHopper.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0x10')](_0x7995('0x11'),auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x13')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x15')](_0x7995('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index c5c118a..ebc7892 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 _0x225f=['contactListQueue','exports','INTEGER'];(function(_0x3903f9,_0x4f50d0){var _0x11af3f=function(_0x39987c){while(--_0x39987c){_0x3903f9['push'](_0x3903f9['shift']());}};_0x11af3f(++_0x4f50d0);}(_0x225f,0x1ab));var _0xf225=function(_0x316ee5,_0x270ce9){_0x316ee5=_0x316ee5-0x0;var _0xa1a6ea=_0x225f[_0x316ee5];return _0xa1a6ea;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xf225('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf225('0x1')],'unique':_0xf225('0x2')},'ListId':{'type':Sequelize[_0xf225('0x1')],'unique':_0xf225('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xf225('0x2')}}; \ No newline at end of file +var _0x834b=['contactListQueue','moment','INTEGER'];(function(_0x59ccaa,_0x26823a){var _0x7780ea=function(_0x1682bc){while(--_0x1682bc){_0x59ccaa['push'](_0x59ccaa['shift']());}};_0x7780ea(++_0x26823a);}(_0x834b,0x16f));var _0xb834=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x834b[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0xb834('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xb834('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb834('0x1')],'unique':_0xb834('0x2')},'VoiceQueueId':{'type':Sequelize[_0xb834('0x1')],'unique':_0xb834('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 90a2d6e..38949a6 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 _0xfa45=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','merge','map','key','field','options','includeAll','include','findAll','rows','then','show','params','keys','find','catch','update','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','name','send','index','CmHopperBlack','rawAttributes','query'];(function(_0x104d4f,_0x9cea8a){var _0x4b7e64=function(_0x4217dc){while(--_0x4217dc){_0x104d4f['push'](_0x104d4f['shift']());}};_0x4b7e64(++_0x9cea8a);}(_0xfa45,0x1d3));var _0x5fa4=function(_0xb362c0,_0x340ed4){_0xb362c0=_0xb362c0-0x0;var _0xe353bb=_0xfa45[_0xb362c0];return _0xe353bb;};'use strict';var pdf=require(_0x5fa4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5fa4('0x1'));var zipdir=require(_0x5fa4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5fa4('0x3'));var moment=require(_0x5fa4('0x4'));var BPromise=require(_0x5fa4('0x5'));var Mustache=require('mustache');var util=require(_0x5fa4('0x6'));var path=require(_0x5fa4('0x7'));var sox=require(_0x5fa4('0x8'));var csv=require(_0x5fa4('0x9'));var ejs=require(_0x5fa4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5fa4('0xb'));var crypto=require(_0x5fa4('0xc'));var jsforce=require(_0x5fa4('0xd'));var deskjs=require(_0x5fa4('0xe'));var toCsv=require(_0x5fa4('0x9'));var querystring=require(_0x5fa4('0xf'));var Papa=require(_0x5fa4('0x10'));var Redis=require(_0x5fa4('0x11'));var authService=require(_0x5fa4('0x12'));var qs=require(_0x5fa4('0x13'));var hardwareService=require(_0x5fa4('0x14'));var logger=require(_0x5fa4('0x15'))(_0x5fa4('0x16'));var utils=require('../../config/utils');var config=require(_0x5fa4('0x17'));var db=require(_0x5fa4('0x18'))['db'];function respondWithStatusCode(_0x7a27e4,_0xeb9f97){_0xeb9f97=_0xeb9f97||0xcc;return function(_0x339c1f){if(_0x339c1f){return _0x7a27e4['sendStatus'](_0xeb9f97);}return _0x7a27e4['status'](_0xeb9f97)[_0x5fa4('0x19')]();};}function respondWithResult(_0x1e2a38,_0x478e65){_0x478e65=_0x478e65||0xc8;return function(_0xe9eda){if(_0xe9eda){return _0x1e2a38[_0x5fa4('0x1a')](_0x478e65)[_0x5fa4('0x1b')](_0xe9eda);}};}function respondWithFilteredResult(_0x402576,_0x4083e0){return function(_0x5cf679){if(_0x5cf679){var _0x3ab984=_0x5cf679[_0x5fa4('0x1c')],_0x532407=_0x4083e0[_0x5fa4('0x1d')],_0x3fba7c=_0x4083e0[_0x5fa4('0x1d')]+_0x4083e0[_0x5fa4('0x1e')],_0x41c2bc;if(_0x3fba7c>=_0x3ab984){_0x3fba7c=_0x3ab984;_0x41c2bc=0xc8;}else{_0x41c2bc=0xce;}_0x402576[_0x5fa4('0x1a')](_0x41c2bc);return _0x402576[_0x5fa4('0x1f')](_0x5fa4('0x20'),_0x532407+'-'+_0x3fba7c+'/'+_0x3ab984)[_0x5fa4('0x1b')](_0x5cf679);}return null;};}function patchUpdates(_0x2b376c){return function(_0x386b3c){try{jsonpatch[_0x5fa4('0x21')](_0x386b3c,_0x2b376c,!![]);}catch(_0x408a0c){return BPromise[_0x5fa4('0x22')](_0x408a0c);}return _0x386b3c[_0x5fa4('0x23')]();};}function saveUpdates(_0x1fdc39,_0x2bf10f){return function(_0x2c410e){if(_0x2c410e){return _0x2c410e['update'](_0x1fdc39)['then'](function(_0x17c853){return _0x17c853;});}return null;};}function removeEntity(_0xc33178,_0x16851a){return function(_0x229f6e){if(_0x229f6e){return _0x229f6e[_0x5fa4('0x24')]()['then'](function(){_0xc33178[_0x5fa4('0x1a')](0xcc)[_0x5fa4('0x19')]();});}};}function handleEntityNotFound(_0x5000f4,_0x16a973){return function(_0x4212f5){if(!_0x4212f5){_0x5000f4[_0x5fa4('0x25')](0x194);}return _0x4212f5;};}function handleError(_0x58a820,_0x5efdb6){_0x5efdb6=_0x5efdb6||0x1f4;return function(_0x5ec17a){logger['error'](_0x5ec17a['stack']);if(_0x5ec17a[_0x5fa4('0x26')]){delete _0x5ec17a[_0x5fa4('0x26')];}_0x58a820[_0x5fa4('0x1a')](_0x5efdb6)[_0x5fa4('0x27')](_0x5ec17a);};}exports[_0x5fa4('0x28')]=function(_0xd6cd00,_0x19043e){var _0xa9b4c6={},_0x16f1c3={},_0x2eb6af={'count':0x0,'rows':[]};var _0x4d07de=db[_0x5fa4('0x29')][_0x5fa4('0x2a')];_0x16f1c3['model']=_['keys'](_0x4d07de);_0x16f1c3[_0x5fa4('0x2b')]=_['keys'](_0xd6cd00['query']);_0x16f1c3['filters']=_[_0x5fa4('0x2c')](_0x16f1c3[_0x5fa4('0x2d')],_0x16f1c3[_0x5fa4('0x2b')]);_0xa9b4c6[_0x5fa4('0x2e')]=_[_0x5fa4('0x2c')](_0x16f1c3[_0x5fa4('0x2d')],qs[_0x5fa4('0x2f')](_0xd6cd00[_0x5fa4('0x2b')][_0x5fa4('0x2f')]));_0xa9b4c6[_0x5fa4('0x2e')]=_0xa9b4c6[_0x5fa4('0x2e')][_0x5fa4('0x30')]?_0xa9b4c6[_0x5fa4('0x2e')]:_0x16f1c3['model'];if(!_0xd6cd00[_0x5fa4('0x2b')][_0x5fa4('0x31')](_0x5fa4('0x32'))){_0xa9b4c6[_0x5fa4('0x1e')]=qs[_0x5fa4('0x1e')](_0xd6cd00[_0x5fa4('0x2b')][_0x5fa4('0x1e')]);_0xa9b4c6[_0x5fa4('0x1d')]=qs['offset'](_0xd6cd00[_0x5fa4('0x2b')][_0x5fa4('0x1d')]);}_0xa9b4c6['order']=qs['sort'](_0xd6cd00['query']['sort']);_0xa9b4c6['where']=qs[_0x5fa4('0x33')](_[_0x5fa4('0x34')](_0xd6cd00[_0x5fa4('0x2b')],_0x16f1c3['filters']));if(_0xd6cd00[_0x5fa4('0x2b')][_0x5fa4('0x35')]){_0xa9b4c6[_0x5fa4('0x36')]=_[_0x5fa4('0x37')](_0xa9b4c6[_0x5fa4('0x36')],{'$or':_[_0x5fa4('0x38')](_0x4d07de,function(_0x5f2fbc){if(_0x5f2fbc['type'][_0x5fa4('0x39')]!=='VIRTUAL'){var _0x49453d={};_0x49453d[_0x5f2fbc[_0x5fa4('0x3a')]]={'$like':'%'+_0xd6cd00[_0x5fa4('0x2b')]['filter']+'%'};return _0x49453d;}})});}_0xa9b4c6=_[_0x5fa4('0x37')]({},_0xa9b4c6,_0xd6cd00[_0x5fa4('0x3b')]);var _0x26676e={'where':_0xa9b4c6[_0x5fa4('0x36')]};return db[_0x5fa4('0x29')][_0x5fa4('0x1c')](_0x26676e)['then'](function(_0x2090a5){_0x2eb6af[_0x5fa4('0x1c')]=_0x2090a5;if(_0xd6cd00[_0x5fa4('0x2b')][_0x5fa4('0x3c')]){_0xa9b4c6[_0x5fa4('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x5fa4('0x3e')](_0xa9b4c6);})['then'](function(_0x6f0a55){_0x2eb6af[_0x5fa4('0x3f')]=_0x6f0a55;return _0x2eb6af;})[_0x5fa4('0x40')](respondWithFilteredResult(_0x19043e,_0xa9b4c6))['catch'](handleError(_0x19043e,null));};exports[_0x5fa4('0x41')]=function(_0x18f669,_0x3029bb){var _0x36a22a={'raw':!![],'where':{'id':_0x18f669[_0x5fa4('0x42')]['id']}},_0x35cd17={};_0x35cd17[_0x5fa4('0x2d')]=_[_0x5fa4('0x43')](db[_0x5fa4('0x29')][_0x5fa4('0x2a')]);_0x35cd17[_0x5fa4('0x2b')]=_['keys'](_0x18f669[_0x5fa4('0x2b')]);_0x35cd17[_0x5fa4('0x33')]=_[_0x5fa4('0x2c')](_0x35cd17[_0x5fa4('0x2d')],_0x35cd17[_0x5fa4('0x2b')]);_0x36a22a[_0x5fa4('0x2e')]=_[_0x5fa4('0x2c')](_0x35cd17['model'],qs['fields'](_0x18f669[_0x5fa4('0x2b')]['fields']));_0x36a22a[_0x5fa4('0x2e')]=_0x36a22a[_0x5fa4('0x2e')][_0x5fa4('0x30')]?_0x36a22a['attributes']:_0x35cd17['model'];if(_0x18f669[_0x5fa4('0x2b')][_0x5fa4('0x3c')]){_0x36a22a[_0x5fa4('0x3d')]=[{'all':!![]}];}_0x36a22a=_[_0x5fa4('0x37')]({},_0x36a22a,_0x18f669['options']);return db['CmHopperBlack'][_0x5fa4('0x44')](_0x36a22a)['then'](handleEntityNotFound(_0x3029bb,null))[_0x5fa4('0x40')](respondWithResult(_0x3029bb,null))[_0x5fa4('0x45')](handleError(_0x3029bb,null));};exports[_0x5fa4('0x46')]=function(_0x1fe0d0,_0x191e26){if(_0x1fe0d0[_0x5fa4('0x47')]['id']){delete _0x1fe0d0['body']['id'];}return db['CmHopperBlack'][_0x5fa4('0x44')]({'where':{'id':_0x1fe0d0[_0x5fa4('0x42')]['id']}})[_0x5fa4('0x40')](handleEntityNotFound(_0x191e26,null))[_0x5fa4('0x40')](saveUpdates(_0x1fe0d0[_0x5fa4('0x47')],null))[_0x5fa4('0x40')](respondWithResult(_0x191e26,null))[_0x5fa4('0x45')](handleError(_0x191e26,null));};exports['destroy']=function(_0x163412,_0x2d4c3b){return db[_0x5fa4('0x29')]['find']({'where':{'id':_0x163412[_0x5fa4('0x42')]['id']}})[_0x5fa4('0x40')](handleEntityNotFound(_0x2d4c3b,null))[_0x5fa4('0x40')](removeEntity(_0x2d4c3b,null))[_0x5fa4('0x45')](handleError(_0x2d4c3b,null));};exports[_0x5fa4('0x48')]=function(_0x441c81,_0x15d91c){return db[_0x5fa4('0x29')]['describe']()[_0x5fa4('0x40')](respondWithResult(_0x15d91c,null))['catch'](handleError(_0x15d91c,null));}; \ No newline at end of file +var _0x2b10=['moment','util','path','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','CmHopperBlack','rawAttributes','model','keys','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','type','VIRTUAL','field','merge','options','includeAll','include','findAll','params','catch','body','find','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3e4b8a,_0x247151){var _0x5dd02e=function(_0x589c1b){while(--_0x589c1b){_0x3e4b8a['push'](_0x3e4b8a['shift']());}};_0x5dd02e(++_0x247151);}(_0x2b10,0x15a));var _0x02b1=function(_0x104d81,_0xcef70c){_0x104d81=_0x104d81-0x0;var _0x4a4d8c=_0x2b10[_0x104d81];return _0x4a4d8c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x02b1('0x0'));var rimraf=require(_0x02b1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02b1('0x2'));var rp=require(_0x02b1('0x3'));var moment=require(_0x02b1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02b1('0x5'));var path=require(_0x02b1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x02b1('0x7'));var fs=require('fs');var _=require(_0x02b1('0x8'));var squel=require(_0x02b1('0x9'));var crypto=require('crypto');var jsforce=require(_0x02b1('0xa'));var deskjs=require(_0x02b1('0xb'));var toCsv=require('to-csv');var querystring=require(_0x02b1('0xc'));var Papa=require(_0x02b1('0xd'));var Redis=require(_0x02b1('0xe'));var authService=require(_0x02b1('0xf'));var qs=require(_0x02b1('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x02b1('0x11'))(_0x02b1('0x12'));var utils=require(_0x02b1('0x13'));var config=require(_0x02b1('0x14'));var db=require(_0x02b1('0x15'))['db'];function respondWithStatusCode(_0x4a19d4,_0x489d80){_0x489d80=_0x489d80||0xcc;return function(_0x46d0c3){if(_0x46d0c3){return _0x4a19d4[_0x02b1('0x16')](_0x489d80);}return _0x4a19d4[_0x02b1('0x17')](_0x489d80)['end']();};}function respondWithResult(_0x575f3c,_0x324dbe){_0x324dbe=_0x324dbe||0xc8;return function(_0x50b6a8){if(_0x50b6a8){return _0x575f3c[_0x02b1('0x17')](_0x324dbe)[_0x02b1('0x18')](_0x50b6a8);}};}function respondWithFilteredResult(_0x59e19d,_0xaaa919){return function(_0x581780){if(_0x581780){var _0x44605d=_0x581780[_0x02b1('0x19')],_0x5afc96=_0xaaa919['offset'],_0x179262=_0xaaa919[_0x02b1('0x1a')]+_0xaaa919[_0x02b1('0x1b')],_0x46b98a;if(_0x179262>=_0x44605d){_0x179262=_0x44605d;_0x46b98a=0xc8;}else{_0x46b98a=0xce;}_0x59e19d[_0x02b1('0x17')](_0x46b98a);return _0x59e19d[_0x02b1('0x1c')](_0x02b1('0x1d'),_0x5afc96+'-'+_0x179262+'/'+_0x44605d)[_0x02b1('0x18')](_0x581780);}return null;};}function patchUpdates(_0xb67993){return function(_0x59c3b5){try{jsonpatch[_0x02b1('0x1e')](_0x59c3b5,_0xb67993,!![]);}catch(_0x489802){return BPromise[_0x02b1('0x1f')](_0x489802);}return _0x59c3b5[_0x02b1('0x20')]();};}function saveUpdates(_0x2e8b38,_0x4aa4c0){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0x02b1('0x21')](_0x2e8b38)[_0x02b1('0x22')](function(_0x15edec){return _0x15edec;});}return null;};}function removeEntity(_0x111c7e,_0x1e5794){return function(_0x44314d){if(_0x44314d){return _0x44314d[_0x02b1('0x23')]()['then'](function(){_0x111c7e[_0x02b1('0x17')](0xcc)[_0x02b1('0x24')]();});}};}function handleEntityNotFound(_0x3e8e69,_0x128181){return function(_0x553f7b){if(!_0x553f7b){_0x3e8e69['sendStatus'](0x194);}return _0x553f7b;};}function handleError(_0x1bc605,_0x4a49af){_0x4a49af=_0x4a49af||0x1f4;return function(_0x27d554){logger['error'](_0x27d554[_0x02b1('0x25')]);if(_0x27d554[_0x02b1('0x26')]){delete _0x27d554[_0x02b1('0x26')];}_0x1bc605[_0x02b1('0x17')](_0x4a49af)[_0x02b1('0x27')](_0x27d554);};}exports[_0x02b1('0x28')]=function(_0x1d7529,_0xdef534){var _0x8a6e8a={},_0x45f4d8={},_0x1b5418={'count':0x0,'rows':[]};var _0x3c93ea=db[_0x02b1('0x29')][_0x02b1('0x2a')];_0x45f4d8[_0x02b1('0x2b')]=_[_0x02b1('0x2c')](_0x3c93ea);_0x45f4d8['query']=_[_0x02b1('0x2c')](_0x1d7529[_0x02b1('0x2d')]);_0x45f4d8['filters']=_['intersection'](_0x45f4d8[_0x02b1('0x2b')],_0x45f4d8[_0x02b1('0x2d')]);_0x8a6e8a[_0x02b1('0x2e')]=_['intersection'](_0x45f4d8['model'],qs['fields'](_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x2f')]));_0x8a6e8a[_0x02b1('0x2e')]=_0x8a6e8a[_0x02b1('0x2e')][_0x02b1('0x30')]?_0x8a6e8a[_0x02b1('0x2e')]:_0x45f4d8['model'];if(!_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x31')](_0x02b1('0x32'))){_0x8a6e8a[_0x02b1('0x1b')]=qs[_0x02b1('0x1b')](_0x1d7529['query'][_0x02b1('0x1b')]);_0x8a6e8a[_0x02b1('0x1a')]=qs[_0x02b1('0x1a')](_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x1a')]);}_0x8a6e8a[_0x02b1('0x33')]=qs['sort'](_0x1d7529['query'][_0x02b1('0x34')]);_0x8a6e8a[_0x02b1('0x35')]=qs[_0x02b1('0x36')](_[_0x02b1('0x37')](_0x1d7529[_0x02b1('0x2d')],_0x45f4d8['filters']));if(_0x1d7529['query'][_0x02b1('0x38')]){_0x8a6e8a[_0x02b1('0x35')]=_['merge'](_0x8a6e8a[_0x02b1('0x35')],{'$or':_[_0x02b1('0x39')](_0x3c93ea,function(_0x4cd228){if(_0x4cd228[_0x02b1('0x3a')]['key']!==_0x02b1('0x3b')){var _0x331caa={};_0x331caa[_0x4cd228[_0x02b1('0x3c')]]={'$like':'%'+_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x38')]+'%'};return _0x331caa;}})});}_0x8a6e8a=_[_0x02b1('0x3d')]({},_0x8a6e8a,_0x1d7529[_0x02b1('0x3e')]);var _0x59dc08={'where':_0x8a6e8a[_0x02b1('0x35')]};return db[_0x02b1('0x29')][_0x02b1('0x19')](_0x59dc08)[_0x02b1('0x22')](function(_0x1fcf01){_0x1b5418[_0x02b1('0x19')]=_0x1fcf01;if(_0x1d7529[_0x02b1('0x2d')][_0x02b1('0x3f')]){_0x8a6e8a[_0x02b1('0x40')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x02b1('0x41')](_0x8a6e8a);})[_0x02b1('0x22')](function(_0xdd9ac7){_0x1b5418['rows']=_0xdd9ac7;return _0x1b5418;})[_0x02b1('0x22')](respondWithFilteredResult(_0xdef534,_0x8a6e8a))['catch'](handleError(_0xdef534,null));};exports['show']=function(_0x5d073c,_0x299533){var _0x3a6e01={'raw':!![],'where':{'id':_0x5d073c[_0x02b1('0x42')]['id']}},_0x1d04ca={};_0x1d04ca[_0x02b1('0x2b')]=_[_0x02b1('0x2c')](db[_0x02b1('0x29')]['rawAttributes']);_0x1d04ca[_0x02b1('0x2d')]=_[_0x02b1('0x2c')](_0x5d073c[_0x02b1('0x2d')]);_0x1d04ca[_0x02b1('0x36')]=_['intersection'](_0x1d04ca[_0x02b1('0x2b')],_0x1d04ca[_0x02b1('0x2d')]);_0x3a6e01[_0x02b1('0x2e')]=_['intersection'](_0x1d04ca[_0x02b1('0x2b')],qs['fields'](_0x5d073c[_0x02b1('0x2d')]['fields']));_0x3a6e01[_0x02b1('0x2e')]=_0x3a6e01[_0x02b1('0x2e')][_0x02b1('0x30')]?_0x3a6e01[_0x02b1('0x2e')]:_0x1d04ca[_0x02b1('0x2b')];if(_0x5d073c[_0x02b1('0x2d')][_0x02b1('0x3f')]){_0x3a6e01[_0x02b1('0x40')]=[{'all':!![]}];}_0x3a6e01=_['merge']({},_0x3a6e01,_0x5d073c[_0x02b1('0x3e')]);return db['CmHopperBlack']['find'](_0x3a6e01)[_0x02b1('0x22')](handleEntityNotFound(_0x299533,null))[_0x02b1('0x22')](respondWithResult(_0x299533,null))[_0x02b1('0x43')](handleError(_0x299533,null));};exports[_0x02b1('0x21')]=function(_0x364438,_0x42d2e3){if(_0x364438['body']['id']){delete _0x364438[_0x02b1('0x44')]['id'];}return db['CmHopperBlack'][_0x02b1('0x45')]({'where':{'id':_0x364438[_0x02b1('0x42')]['id']}})[_0x02b1('0x22')](handleEntityNotFound(_0x42d2e3,null))[_0x02b1('0x22')](saveUpdates(_0x364438['body'],null))[_0x02b1('0x22')](respondWithResult(_0x42d2e3,null))[_0x02b1('0x43')](handleError(_0x42d2e3,null));};exports[_0x02b1('0x23')]=function(_0x5b8c8f,_0xc8c902){return db[_0x02b1('0x29')]['find']({'where':{'id':_0x5b8c8f[_0x02b1('0x42')]['id']}})[_0x02b1('0x22')](handleEntityNotFound(_0xc8c902,null))[_0x02b1('0x22')](removeEntity(_0xc8c902,null))['catch'](handleError(_0xc8c902,null));};exports['describe']=function(_0x405ac3,_0x3fbac4){return db[_0x02b1('0x29')]['describe']()['then'](respondWithResult(_0x3fbac4,null))[_0x02b1('0x43')](handleError(_0x3fbac4,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 87e968a..58079b0 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 _0xf109=['CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define'];(function(_0x5eec4f,_0x4e366d){var _0x385f8b=function(_0x429866){while(--_0x429866){_0x5eec4f['push'](_0x5eec4f['shift']());}};_0x385f8b(++_0x4e366d);}(_0xf109,0xce));var _0x9f10=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xf109[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34e8=['cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack'];(function(_0x14230c,_0x2b995d){var _0x3e4ec7=function(_0x5db0c6){while(--_0x5db0c6){_0x14230c['push'](_0x14230c['shift']());}};_0x3e4ec7(++_0x2b995d);}(_0x34e8,0x12c));var _0x834e=function(_0x480ca8,_0x197b37){_0x480ca8=_0x480ca8-0x0;var _0x439a07=_0x34e8[_0x480ca8];return _0x439a07;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 8da5510..bd60bb0 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 _0xa6d4=['where','limit','include','model','attributes','map','info','UpdateCmHopperBlack','body','raw','destroy','DestroyCmHopperBlack','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options'];(function(_0x5e5966,_0x420cd7){var _0x4901ca=function(_0x33e1fb){while(--_0x33e1fb){_0x5e5966['push'](_0x5e5966['shift']());}};_0x4901ca(++_0x420cd7);}(_0xa6d4,0x1c8));var _0x4a6d=function(_0x1b17bd,_0x291bf7){_0x1b17bd=_0x1b17bd-0x0;var _0x1a7b3f=_0xa6d4[_0x1b17bd];return _0x1a7b3f;};'use strict';var _=require('lodash');var util=require(_0x4a6d('0x0'));var moment=require('moment');var BPromise=require(_0x4a6d('0x1'));var rs=require(_0x4a6d('0x2'));var fs=require('fs');var Redis=require(_0x4a6d('0x3'));var db=require(_0x4a6d('0x4'))['db'];var utils=require(_0x4a6d('0x5'));var logger=require(_0x4a6d('0x6'))(_0x4a6d('0x7'));var config=require('../../config/environment');var jayson=require(_0x4a6d('0x8'));var client=jayson[_0x4a6d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dda8e,_0x4f02e9,_0x10096e){return new BPromise(function(_0x45c684,_0x57d06d){return client[_0x4a6d('0xa')](_0x3dda8e,_0x10096e)[_0x4a6d('0xb')](function(_0x4e5d89){logger['info'](_0x4a6d('0xc'),_0x4f02e9,_0x4a6d('0xd'));logger[_0x4a6d('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x4f02e9,_0x4a6d('0xd'),JSON[_0x4a6d('0xf')](_0x4e5d89));if(_0x4e5d89[_0x4a6d('0x10')]){if(_0x4e5d89['error'][_0x4a6d('0x11')]===0x1f4){logger[_0x4a6d('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x4f02e9,_0x4e5d89[_0x4a6d('0x10')][_0x4a6d('0x12')]);return _0x57d06d(_0x4e5d89[_0x4a6d('0x10')]['message']);}logger[_0x4a6d('0x10')](_0x4a6d('0xc'),_0x4f02e9,_0x4e5d89[_0x4a6d('0x10')]['message']);return _0x45c684(_0x4e5d89['error']['message']);}else{logger['info'](_0x4a6d('0xc'),_0x4f02e9,_0x4a6d('0xd'));_0x45c684(_0x4e5d89[_0x4a6d('0x13')][_0x4a6d('0x12')]);}})[_0x4a6d('0x14')](function(_0x2ff878){logger[_0x4a6d('0x10')](_0x4a6d('0xc'),_0x4f02e9,_0x2ff878);_0x57d06d(_0x2ff878);});});}exports[_0x4a6d('0x15')]=function(_0x412fa0){var _0x4d2746=this;return new Promise(function(_0x2c5bfc,_0x13c12f){return db[_0x4a6d('0x16')][_0x4a6d('0x17')]({'raw':_0x412fa0[_0x4a6d('0x18')]?_0x412fa0['options']['raw']===undefined?!![]:![]:!![],'where':_0x412fa0[_0x4a6d('0x18')]?_0x412fa0[_0x4a6d('0x18')][_0x4a6d('0x19')]||null:null,'attributes':_0x412fa0[_0x4a6d('0x18')]?_0x412fa0[_0x4a6d('0x18')]['attributes']||null:null,'limit':_0x412fa0[_0x4a6d('0x18')]?_0x412fa0['options'][_0x4a6d('0x1a')]||null:null,'include':_0x412fa0[_0x4a6d('0x18')]?_0x412fa0[_0x4a6d('0x18')][_0x4a6d('0x1b')]?_['map'](_0x412fa0[_0x4a6d('0x18')][_0x4a6d('0x1b')],function(_0x15dd59){return{'model':db[_0x15dd59[_0x4a6d('0x1c')]],'as':_0x15dd59['as'],'attributes':_0x15dd59[_0x4a6d('0x1d')],'include':_0x15dd59[_0x4a6d('0x1b')]?_[_0x4a6d('0x1e')](_0x15dd59[_0x4a6d('0x1b')],function(_0x37b5fd){return{'model':db[_0x37b5fd[_0x4a6d('0x1c')]],'as':_0x37b5fd['as'],'attributes':_0x37b5fd[_0x4a6d('0x1d')],'include':_0x37b5fd[_0x4a6d('0x1b')]?_[_0x4a6d('0x1e')](_0x37b5fd[_0x4a6d('0x1b')],function(_0x2c586b){return{'model':db[_0x2c586b['model']],'as':_0x2c586b['as'],'attributes':_0x2c586b[_0x4a6d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x4a6d('0xb')](function(_0x51941d){logger[_0x4a6d('0x1f')]('GetCmHopperBlack',_0x412fa0);logger[_0x4a6d('0xe')]('GetCmHopperBlack',_0x412fa0,JSON['stringify'](_0x51941d));_0x2c5bfc(_0x51941d);})['catch'](function(_0x5d3e0a){logger['error']('GetCmHopperBlack',_0x5d3e0a['message'],_0x412fa0);_0x13c12f(_0x4d2746[_0x4a6d('0x10')](0x1f4,_0x5d3e0a['message']));});});};exports[_0x4a6d('0x20')]=function(_0x45159f){var _0x5f396e=this;return new Promise(function(_0x374cdd,_0x54029d){return db[_0x4a6d('0x16')]['update'](_0x45159f[_0x4a6d('0x21')],{'raw':_0x45159f[_0x4a6d('0x18')]?_0x45159f[_0x4a6d('0x18')][_0x4a6d('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45159f[_0x4a6d('0x18')]?_0x45159f['options'][_0x4a6d('0x19')]||null:null,'attributes':_0x45159f[_0x4a6d('0x18')]?_0x45159f[_0x4a6d('0x18')][_0x4a6d('0x1d')]||null:null,'limit':_0x45159f[_0x4a6d('0x18')]?_0x45159f[_0x4a6d('0x18')][_0x4a6d('0x1a')]||null:null})[_0x4a6d('0xb')](function(_0x13c00d){logger[_0x4a6d('0x1f')](_0x4a6d('0x20'),_0x45159f);logger[_0x4a6d('0xe')](_0x4a6d('0x20'),_0x45159f,JSON['stringify'](_0x13c00d));_0x374cdd(_0x13c00d);})[_0x4a6d('0x14')](function(_0x634309){logger[_0x4a6d('0x10')]('UpdateCmHopperBlack',_0x634309[_0x4a6d('0x12')],_0x45159f);_0x54029d(_0x5f396e['error'](0x1f4,_0x634309[_0x4a6d('0x12')]));});});};exports['DestroyCmHopperBlack']=function(_0x179a72){var _0x3c47ec=this;return new Promise(function(_0x1fed99,_0x56ba48){return db[_0x4a6d('0x16')][_0x4a6d('0x23')]({'where':_0x179a72['options']?_0x179a72['options'][_0x4a6d('0x19')]||null:null})[_0x4a6d('0xb')](function(_0x2b1060){logger[_0x4a6d('0x1f')](_0x4a6d('0x24'),_0x179a72);logger[_0x4a6d('0xe')](_0x4a6d('0x24'),_0x179a72,JSON[_0x4a6d('0xf')](_0x2b1060));_0x1fed99(_0x2b1060);})['catch'](function(_0x533bf7){logger[_0x4a6d('0x10')](_0x4a6d('0x24'),_0x533bf7[_0x4a6d('0x12')],_0x179a72);_0x56ba48(_0x3c47ec['error'](0x1f4,_0x533bf7[_0x4a6d('0x12')]));});});}; \ No newline at end of file +var _0x508a=['where','DestroyCmHopperBlack','CmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCmHopperBlack','findAll','options','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','body','raw'];(function(_0xd4f2c6,_0x1939ba){var _0x46ee69=function(_0x12e081){while(--_0x12e081){_0xd4f2c6['push'](_0xd4f2c6['shift']());}};_0x46ee69(++_0x1939ba);}(_0x508a,0xbd));var _0xa508=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x508a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa508('0x0'));var util=require('util');var moment=require(_0xa508('0x1'));var BPromise=require(_0xa508('0x2'));var rs=require(_0xa508('0x3'));var fs=require('fs');var Redis=require(_0xa508('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa508('0x5'))(_0xa508('0x6'));var config=require(_0xa508('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa508('0x8')][_0xa508('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bfe06,_0x3736f1,_0xcf666b){return new BPromise(function(_0x21c4cb,_0x3cf1e1){return client[_0xa508('0xa')](_0x1bfe06,_0xcf666b)[_0xa508('0xb')](function(_0x96c587){logger[_0xa508('0xc')](_0xa508('0xd'),_0x3736f1,_0xa508('0xe'));logger[_0xa508('0xf')](_0xa508('0x10'),_0x3736f1,'request\x20sent',JSON['stringify'](_0x96c587));if(_0x96c587[_0xa508('0x11')]){if(_0x96c587[_0xa508('0x11')][_0xa508('0x12')]===0x1f4){logger[_0xa508('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x3736f1,_0x96c587[_0xa508('0x11')][_0xa508('0x13')]);return _0x3cf1e1(_0x96c587['error'][_0xa508('0x13')]);}logger[_0xa508('0x11')](_0xa508('0xd'),_0x3736f1,_0x96c587[_0xa508('0x11')][_0xa508('0x13')]);return _0x21c4cb(_0x96c587[_0xa508('0x11')][_0xa508('0x13')]);}else{logger[_0xa508('0xc')](_0xa508('0xd'),_0x3736f1,_0xa508('0xe'));_0x21c4cb(_0x96c587['result'][_0xa508('0x13')]);}})[_0xa508('0x14')](function(_0xb61fe7){logger[_0xa508('0x11')](_0xa508('0xd'),_0x3736f1,_0xb61fe7);_0x3cf1e1(_0xb61fe7);});});}exports[_0xa508('0x15')]=function(_0x527453){var _0x385399=this;return new Promise(function(_0xf47212,_0x22f353){return db['CmHopperBlack'][_0xa508('0x16')]({'raw':_0x527453[_0xa508('0x17')]?_0x527453[_0xa508('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x527453['options']?_0x527453[_0xa508('0x17')]['where']||null:null,'attributes':_0x527453[_0xa508('0x17')]?_0x527453[_0xa508('0x17')][_0xa508('0x18')]||null:null,'limit':_0x527453['options']?_0x527453['options'][_0xa508('0x19')]||null:null,'include':_0x527453[_0xa508('0x17')]?_0x527453[_0xa508('0x17')][_0xa508('0x1a')]?_['map'](_0x527453[_0xa508('0x17')][_0xa508('0x1a')],function(_0x412f55){return{'model':db[_0x412f55['model']],'as':_0x412f55['as'],'attributes':_0x412f55[_0xa508('0x18')],'include':_0x412f55[_0xa508('0x1a')]?_[_0xa508('0x1b')](_0x412f55['include'],function(_0x2b3a75){return{'model':db[_0x2b3a75[_0xa508('0x1c')]],'as':_0x2b3a75['as'],'attributes':_0x2b3a75['attributes'],'include':_0x2b3a75[_0xa508('0x1a')]?_[_0xa508('0x1b')](_0x2b3a75['include'],function(_0x3d83ca){return{'model':db[_0x3d83ca['model']],'as':_0x3d83ca['as'],'attributes':_0x3d83ca[_0xa508('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59266f){logger[_0xa508('0xc')](_0xa508('0x15'),_0x527453);logger[_0xa508('0xf')](_0xa508('0x15'),_0x527453,JSON[_0xa508('0x1d')](_0x59266f));_0xf47212(_0x59266f);})[_0xa508('0x14')](function(_0xfc6173){logger[_0xa508('0x11')](_0xa508('0x15'),_0xfc6173[_0xa508('0x13')],_0x527453);_0x22f353(_0x385399[_0xa508('0x11')](0x1f4,_0xfc6173[_0xa508('0x13')]));});});};exports[_0xa508('0x1e')]=function(_0x1076e3){var _0x426a9d=this;return new Promise(function(_0x4bc3f6,_0x3f78a7){return db['CmHopperBlack']['update'](_0x1076e3[_0xa508('0x1f')],{'raw':_0x1076e3[_0xa508('0x17')]?_0x1076e3['options'][_0xa508('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1076e3[_0xa508('0x17')]?_0x1076e3[_0xa508('0x17')][_0xa508('0x21')]||null:null,'attributes':_0x1076e3[_0xa508('0x17')]?_0x1076e3[_0xa508('0x17')]['attributes']||null:null,'limit':_0x1076e3['options']?_0x1076e3[_0xa508('0x17')][_0xa508('0x19')]||null:null})[_0xa508('0xb')](function(_0x345331){logger['info'](_0xa508('0x1e'),_0x1076e3);logger[_0xa508('0xf')]('UpdateCmHopperBlack',_0x1076e3,JSON[_0xa508('0x1d')](_0x345331));_0x4bc3f6(_0x345331);})[_0xa508('0x14')](function(_0x300cdc){logger[_0xa508('0x11')](_0xa508('0x1e'),_0x300cdc[_0xa508('0x13')],_0x1076e3);_0x3f78a7(_0x426a9d[_0xa508('0x11')](0x1f4,_0x300cdc[_0xa508('0x13')]));});});};exports[_0xa508('0x22')]=function(_0x38b40c){var _0x7bf963=this;return new Promise(function(_0xff57e2,_0x418e46){return db[_0xa508('0x23')][_0xa508('0x24')]({'where':_0x38b40c[_0xa508('0x17')]?_0x38b40c[_0xa508('0x17')][_0xa508('0x21')]||null:null})[_0xa508('0xb')](function(_0x384c05){logger[_0xa508('0xc')](_0xa508('0x22'),_0x38b40c);logger[_0xa508('0xf')](_0xa508('0x22'),_0x38b40c,JSON[_0xa508('0x1d')](_0x384c05));_0xff57e2(_0x384c05);})[_0xa508('0x14')](function(_0x1168e0){logger[_0xa508('0x11')]('DestroyCmHopperBlack',_0x1168e0[_0xa508('0x13')],_0x38b40c);_0x418e46(_0x7bf963['error'](0x1f4,_0x1168e0[_0xa508('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 6e6e2e7..5774b0d 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 _0xe14f=['/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe'];(function(_0x4e3f1d,_0x223972){var _0x45e811=function(_0x1d0740){while(--_0x1d0740){_0x4e3f1d['push'](_0x4e3f1d['shift']());}};_0x45e811(++_0x223972);}(_0xe14f,0xea));var _0xfe14=function(_0x3dd28a,_0x141c05){_0x3dd28a=_0x3dd28a-0x0;var _0x1a7f15=_0xe14f[_0x3dd28a];return _0x1a7f15;};'use strict';var multer=require(_0xfe14('0x0'));var util=require(_0xfe14('0x1'));var path=require(_0xfe14('0x2'));var timeout=require(_0xfe14('0x3'));var express=require(_0xfe14('0x4'));var router=express[_0xfe14('0x5')]();var auth=require(_0xfe14('0x6'));var interaction=require(_0xfe14('0x7'));var config=require(_0xfe14('0x8'));var controller=require('./cmHopperBlack.controller');router['get']('/',auth[_0xfe14('0x9')](),controller['index']);router[_0xfe14('0xa')](_0xfe14('0xb'),auth[_0xfe14('0x9')](),controller[_0xfe14('0xc')]);router[_0xfe14('0xa')](_0xfe14('0xd'),auth[_0xfe14('0x9')](),controller[_0xfe14('0xe')]);router[_0xfe14('0xf')]('/:id',auth[_0xfe14('0x9')](),controller[_0xfe14('0x10')]);router[_0xfe14('0x11')](_0xfe14('0xd'),auth[_0xfe14('0x9')](),controller[_0xfe14('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc23a=['/:id','exports','util','path','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','describe','show','put'];(function(_0x1d6a39,_0x5e3ba1){var _0x534782=function(_0x1d0b72){while(--_0x1d0b72){_0x1d6a39['push'](_0x1d6a39['shift']());}};_0x534782(++_0x5e3ba1);}(_0xc23a,0xd2));var _0xac23=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xc23a[_0x1b6186];return _0x186121;};'use strict';var multer=require('multer');var util=require(_0xac23('0x0'));var path=require(_0xac23('0x1'));var timeout=require(_0xac23('0x2'));var express=require('express');var router=express[_0xac23('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac23('0x4'));var controller=require('./cmHopperBlack.controller');router[_0xac23('0x5')]('/',auth[_0xac23('0x6')](),controller[_0xac23('0x7')]);router['get']('/describe',auth[_0xac23('0x6')](),controller[_0xac23('0x8')]);router[_0xac23('0x5')]('/:id',auth[_0xac23('0x6')](),controller[_0xac23('0x9')]);router[_0xac23('0xa')](_0xac23('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xac23('0xb'),auth[_0xac23('0x6')](),controller['destroy']);module[_0xac23('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 40fbd12..69dc3ad 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 _0x7a76=['seconds','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','diff'];(function(_0x4a796a,_0x5241d0){var _0x2f2b28=function(_0x4db13c){while(--_0x4db13c){_0x4a796a['push'](_0x4a796a['shift']());}};_0x2f2b28(++_0x5241d0);}(_0x7a76,0x1f2));var _0x67a7=function(_0x348860,_0x4531f6){_0x348860=_0x348860-0x0;var _0x2fc2ad=_0x7a76[_0x348860];return _0x2fc2ad;};'use strict';var Sequelize=require(_0x67a7('0x0'));var moment=require(_0x67a7('0x1'));module[_0x67a7('0x2')]={'state':{'type':Sequelize[_0x67a7('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x67a7('0x4')]},'scheduledat':{'type':Sequelize[_0x67a7('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x67a7('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x67a7('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x67a7('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x67a7('0x4')]},'originatecalleridname':{'type':Sequelize[_0x67a7('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x67a7('0x5')]},'answertime':{'type':Sequelize[_0x67a7('0x5')]},'droptime':{'type':Sequelize[_0x67a7('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x67a7('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x67a7('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x67a7('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x67a7('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x67a7('0x4')]},'campaign':{'type':Sequelize[_0x67a7('0x4')]},'campaigntype':{'type':Sequelize[_0x67a7('0x4')]},'membername':{'type':Sequelize[_0x67a7('0x4')]},'reason':{'type':Sequelize[_0x67a7('0x4')]},'disposition':{'type':Sequelize[_0x67a7('0x4')]},'dispositionat':{'type':Sequelize[_0x67a7('0x5')],'set':function(_0x445f39){var _0x5190dc=this[_0x67a7('0x6')](_0x67a7('0x7'));if(_0x5190dc&&_0x445f39){this['setDataValue']('followuptime',moment(_0x445f39)[_0x67a7('0x8')](moment(_0x5190dc),_0x67a7('0x9')));}return this[_0x67a7('0xa')](_0x67a7('0xb'),_0x445f39);}},'amd':{'type':Sequelize[_0x67a7('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x67a7('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x67a7('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x67a7('0x5')]},'callback':{'type':Sequelize[_0x67a7('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x67a7('0x5')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x67a7('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x67a7('0x5')]}}; \ No newline at end of file +var _0xe2cf=['moment','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','seconds','dispositionat','BOOLEAN'];(function(_0x392f8b,_0x121ff9){var _0x3bea2d=function(_0x25be3e){while(--_0x25be3e){_0x392f8b['push'](_0x392f8b['shift']());}};_0x3bea2d(++_0x121ff9);}(_0xe2cf,0xfa));var _0xfe2c=function(_0x5cdacf,_0x7c82b1){_0x5cdacf=_0x5cdacf-0x0;var _0xa68a8b=_0xe2cf[_0x5cdacf];return _0xa68a8b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfe2c('0x0'));module['exports']={'state':{'type':Sequelize[_0xfe2c('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfe2c('0x2')]},'scheduledat':{'type':Sequelize[_0xfe2c('0x3')]},'countbusyretry':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xfe2c('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xfe2c('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfe2c('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfe2c('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xfe2c('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0xfe2c('0x3')]},'endtime':{'type':Sequelize[_0xfe2c('0x3')]},'ringtime':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfe2c('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfe2c('0x2')]},'campaign':{'type':Sequelize[_0xfe2c('0x2')]},'campaigntype':{'type':Sequelize[_0xfe2c('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xfe2c('0x2')]},'disposition':{'type':Sequelize[_0xfe2c('0x2')]},'dispositionat':{'type':Sequelize[_0xfe2c('0x3')],'set':function(_0x5711d7){var _0x2a6d4c=this[_0xfe2c('0x4')](_0xfe2c('0x5'));if(_0x2a6d4c&&_0x5711d7){this[_0xfe2c('0x6')]('followuptime',moment(_0x5711d7)['diff'](moment(_0x2a6d4c),_0xfe2c('0x7')));}return this[_0xfe2c('0x6')](_0xfe2c('0x8'),_0x5711d7);}},'amd':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'fax':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xfe2c('0x3')]},'callback':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xfe2c('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xfe2c('0x3')]},'recallme':{'type':Sequelize[_0xfe2c('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index a42fc8e..ac07fbe 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 _0xdf0f=['ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId\x20=\x20?','calleridnum','CmHopper','findOne','VoiceQueueId','CampaignId','html-pdf','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','json','apply','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','CmHopperFinal','includeAll','include','findAll','rows','params','find','catch','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','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','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','insert','into','cm_hopper','fromQuery','phone','ListId','createdAt','updatedAt','ANY_VALUE(calleridnum)','NOW()','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)'];(function(_0x4840a3,_0x5e3a2c){var _0x4e6008=function(_0x3e10f6){while(--_0x3e10f6){_0x4840a3['push'](_0x4840a3['shift']());}};_0x4e6008(++_0x5e3a2c);}(_0xdf0f,0x10e));var _0xfdf0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf0f[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xfdf0('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfdf0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdf0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfdf0('0x3'));var path=require(_0xfdf0('0x4'));var sox=require(_0xfdf0('0x5'));var csv=require(_0xfdf0('0x6'));var ejs=require(_0xfdf0('0x7'));var fs=require('fs');var _=require(_0xfdf0('0x8'));var squel=require(_0xfdf0('0x9'));var crypto=require(_0xfdf0('0xa'));var jsforce=require(_0xfdf0('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfdf0('0xc'));var authService=require(_0xfdf0('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xfdf0('0xe'));var logger=require(_0xfdf0('0xf'))(_0xfdf0('0x10'));var utils=require(_0xfdf0('0x11'));var config=require('../../config/environment');var db=require(_0xfdf0('0x12'))['db'];function respondWithStatusCode(_0x1fe83c,_0x2a850){_0x2a850=_0x2a850||0xcc;return function(_0x9916e3){if(_0x9916e3){return _0x1fe83c[_0xfdf0('0x13')](_0x2a850);}return _0x1fe83c[_0xfdf0('0x14')](_0x2a850)[_0xfdf0('0x15')]();};}function respondWithResult(_0x55ce3c,_0x434160){_0x434160=_0x434160||0xc8;return function(_0x347b44){if(_0x347b44){return _0x55ce3c[_0xfdf0('0x14')](_0x434160)['json'](_0x347b44);}};}function respondWithFilteredResult(_0x3e1b52,_0x39d2b5){return function(_0x501385){if(_0x501385){var _0x33583a=_0x501385[_0xfdf0('0x16')],_0x4a979f=_0x39d2b5['offset'],_0x17ad2e=_0x39d2b5[_0xfdf0('0x17')]+_0x39d2b5['limit'],_0x5cd310;if(_0x17ad2e>=_0x33583a){_0x17ad2e=_0x33583a;_0x5cd310=0xc8;}else{_0x5cd310=0xce;}_0x3e1b52[_0xfdf0('0x14')](_0x5cd310);return _0x3e1b52['set']('Content-Range',_0x4a979f+'-'+_0x17ad2e+'/'+_0x33583a)[_0xfdf0('0x18')](_0x501385);}return null;};}function patchUpdates(_0x4dbae8){return function(_0x31e3f3){try{jsonpatch[_0xfdf0('0x19')](_0x31e3f3,_0x4dbae8,!![]);}catch(_0x44ba67){return BPromise[_0xfdf0('0x1a')](_0x44ba67);}return _0x31e3f3[_0xfdf0('0x1b')]();};}function saveUpdates(_0x337dc5,_0x488ab7){return function(_0x1e0545){if(_0x1e0545){return _0x1e0545['update'](_0x337dc5)[_0xfdf0('0x1c')](function(_0x53723c){return _0x53723c;});}return null;};}function removeEntity(_0x4bd4a6,_0x4e12e8){return function(_0x3c95cb){if(_0x3c95cb){return _0x3c95cb[_0xfdf0('0x1d')]()[_0xfdf0('0x1c')](function(){_0x4bd4a6[_0xfdf0('0x14')](0xcc)[_0xfdf0('0x15')]();});}};}function handleEntityNotFound(_0x331b03,_0x344f3a){return function(_0x3c163e){if(!_0x3c163e){_0x331b03[_0xfdf0('0x13')](0x194);}return _0x3c163e;};}function handleError(_0x553305,_0x20b14f){_0x20b14f=_0x20b14f||0x1f4;return function(_0x296fc7){logger[_0xfdf0('0x1e')](_0x296fc7[_0xfdf0('0x1f')]);if(_0x296fc7[_0xfdf0('0x20')]){delete _0x296fc7[_0xfdf0('0x20')];}_0x553305['status'](_0x20b14f)[_0xfdf0('0x21')](_0x296fc7);};}exports[_0xfdf0('0x22')]=function(_0x489582,_0x9e8fd5){var _0x209201={},_0x2115cd={},_0x3720f0={'count':0x0,'rows':[]};var _0x179b7e=db['CmHopperFinal'][_0xfdf0('0x23')];_0x2115cd[_0xfdf0('0x24')]=_[_0xfdf0('0x25')](_0x179b7e);_0x2115cd[_0xfdf0('0x26')]=_['keys'](_0x489582[_0xfdf0('0x26')]);_0x2115cd['filters']=_[_0xfdf0('0x27')](_0x2115cd[_0xfdf0('0x24')],_0x2115cd[_0xfdf0('0x26')]);_0x209201[_0xfdf0('0x28')]=_[_0xfdf0('0x27')](_0x2115cd['model'],qs['fields'](_0x489582[_0xfdf0('0x26')][_0xfdf0('0x29')]));_0x209201[_0xfdf0('0x28')]=_0x209201[_0xfdf0('0x28')][_0xfdf0('0x2a')]?_0x209201[_0xfdf0('0x28')]:_0x2115cd['model'];if(!_0x489582[_0xfdf0('0x26')][_0xfdf0('0x2b')](_0xfdf0('0x2c'))){_0x209201[_0xfdf0('0x2d')]=qs[_0xfdf0('0x2d')](_0x489582[_0xfdf0('0x26')][_0xfdf0('0x2d')]);_0x209201['offset']=qs[_0xfdf0('0x17')](_0x489582[_0xfdf0('0x26')][_0xfdf0('0x17')]);}_0x209201[_0xfdf0('0x2e')]=qs[_0xfdf0('0x2f')](_0x489582[_0xfdf0('0x26')]['sort']);_0x209201[_0xfdf0('0x30')]=qs[_0xfdf0('0x31')](_[_0xfdf0('0x32')](_0x489582[_0xfdf0('0x26')],_0x2115cd[_0xfdf0('0x31')]));if(_0x489582[_0xfdf0('0x26')][_0xfdf0('0x33')]){_0x209201[_0xfdf0('0x30')]=_[_0xfdf0('0x34')](_0x209201[_0xfdf0('0x30')],{'$or':_[_0xfdf0('0x35')](_0x179b7e,function(_0xada96e){if(_0xada96e['type'][_0xfdf0('0x36')]!==_0xfdf0('0x37')){var _0x3f1b03={};_0x3f1b03[_0xada96e[_0xfdf0('0x38')]]={'$like':'%'+_0x489582[_0xfdf0('0x26')][_0xfdf0('0x33')]+'%'};return _0x3f1b03;}})});}_0x209201=_[_0xfdf0('0x34')]({},_0x209201,_0x489582[_0xfdf0('0x39')]);var _0x3a8b8b={'where':_0x209201[_0xfdf0('0x30')]};return db[_0xfdf0('0x3a')][_0xfdf0('0x16')](_0x3a8b8b)['then'](function(_0x3a0028){_0x3720f0[_0xfdf0('0x16')]=_0x3a0028;if(_0x489582['query'][_0xfdf0('0x3b')]){_0x209201[_0xfdf0('0x3c')]=[{'all':!![]}];}return db[_0xfdf0('0x3a')][_0xfdf0('0x3d')](_0x209201);})[_0xfdf0('0x1c')](function(_0x116626){_0x3720f0[_0xfdf0('0x3e')]=_0x116626;return _0x3720f0;})[_0xfdf0('0x1c')](respondWithFilteredResult(_0x9e8fd5,_0x209201))['catch'](handleError(_0x9e8fd5,null));};exports['show']=function(_0x5940be,_0x4cad91){var _0x5e7245={'raw':!![],'where':{'id':_0x5940be[_0xfdf0('0x3f')]['id']}},_0x10fe8a={};_0x10fe8a[_0xfdf0('0x24')]=_[_0xfdf0('0x25')](db[_0xfdf0('0x3a')][_0xfdf0('0x23')]);_0x10fe8a['query']=_['keys'](_0x5940be[_0xfdf0('0x26')]);_0x10fe8a['filters']=_[_0xfdf0('0x27')](_0x10fe8a[_0xfdf0('0x24')],_0x10fe8a[_0xfdf0('0x26')]);_0x5e7245[_0xfdf0('0x28')]=_[_0xfdf0('0x27')](_0x10fe8a['model'],qs[_0xfdf0('0x29')](_0x5940be['query'][_0xfdf0('0x29')]));_0x5e7245[_0xfdf0('0x28')]=_0x5e7245[_0xfdf0('0x28')][_0xfdf0('0x2a')]?_0x5e7245[_0xfdf0('0x28')]:_0x10fe8a[_0xfdf0('0x24')];if(_0x5940be[_0xfdf0('0x26')][_0xfdf0('0x3b')]){_0x5e7245[_0xfdf0('0x3c')]=[{'all':!![]}];}_0x5e7245=_[_0xfdf0('0x34')]({},_0x5e7245,_0x5940be[_0xfdf0('0x39')]);return db[_0xfdf0('0x3a')][_0xfdf0('0x40')](_0x5e7245)[_0xfdf0('0x1c')](handleEntityNotFound(_0x4cad91,null))[_0xfdf0('0x1c')](respondWithResult(_0x4cad91,null))[_0xfdf0('0x41')](handleError(_0x4cad91,null));};exports[_0xfdf0('0x42')]=function(_0x10557c,_0x58ba48){return db[_0xfdf0('0x3a')][_0xfdf0('0x42')]()['then'](respondWithResult(_0x58ba48,null))[_0xfdf0('0x41')](handleError(_0x58ba48,null));};exports[_0xfdf0('0x43')]=function(_0x34bda5,_0x2776cc){if(_0x34bda5[_0xfdf0('0x44')][_0xfdf0('0x45')]){delete _0x34bda5['body'][_0xfdf0('0x45')];}return db[_0xfdf0('0x3a')][_0xfdf0('0x40')]({'where':{'uniqueid':_0x34bda5[_0xfdf0('0x3f')]['id']}})[_0xfdf0('0x1c')](handleEntityNotFound(_0x2776cc,null))['then'](saveUpdates(_0x34bda5[_0xfdf0('0x44')],null))['then'](respondWithResult(_0x2776cc,null))[_0xfdf0('0x41')](handleError(_0x2776cc,null));};exports[_0xfdf0('0x46')]=function(_0x386b1c,_0x41fee0,_0x4594a5){return db[_0xfdf0('0x3a')][_0xfdf0('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x386b1c[_0xfdf0('0x3f')]['id']},'attributes':[[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x4a')))),_0xfdf0('0x4b')],[db[_0xfdf0('0x47')]['fn']('COUNT',db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x4c')))),_0xfdf0('0x4d')],[db['sequelize']['fn'](_0xfdf0('0x48'),db['sequelize']['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x4e')))),_0xfdf0('0x4f')],[db['sequelize']['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db['sequelize'][_0xfdf0('0x49')](_0xfdf0('0x50')))),_0xfdf0('0x51')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x52')))),'dropContacts'],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db['sequelize']['fn']('IF',db['sequelize'][_0xfdf0('0x49')](_0xfdf0('0x53')))),_0xfdf0('0x54')],[db['sequelize']['fn']('COUNT',db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0xfdf0('0x55')],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x56')))),_0xfdf0('0x57')]]})[_0xfdf0('0x1c')](handleEntityNotFound(_0x41fee0,null))[_0xfdf0('0x1c')](respondWithResult(_0x41fee0,null))[_0xfdf0('0x41')](handleError(_0x41fee0,null));};exports[_0xfdf0('0x58')]=function(_0x310737,_0x10f0f9,_0x1b9012){return db[_0xfdf0('0x3a')][_0xfdf0('0x3d')]({'raw':![],'where':{'CampaignId':_0x310737[_0xfdf0('0x3f')]['id']},'attributes':[[db[_0xfdf0('0x47')]['fn']('COUNT',db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0xfdf0('0x4b')],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db['sequelize']['fn']('IF',db[_0xfdf0('0x47')]['literal'](_0xfdf0('0x4c')))),_0xfdf0('0x4d')],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db['sequelize'][_0xfdf0('0x49')](_0xfdf0('0x4e')))),_0xfdf0('0x4f')],[db['sequelize']['fn'](_0xfdf0('0x48'),db['sequelize']['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x50')))),_0xfdf0('0x51')],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x52')))),_0xfdf0('0x59')],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')][_0xfdf0('0x49')](_0xfdf0('0x53')))),_0xfdf0('0x54')],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')]['literal'](_0xfdf0('0x5a')))),'reCallContacts'],[db[_0xfdf0('0x47')]['fn'](_0xfdf0('0x48'),db[_0xfdf0('0x47')]['fn']('IF',db[_0xfdf0('0x47')]['literal'](_0xfdf0('0x56')))),'answeringMachine']]})[_0xfdf0('0x1c')](handleEntityNotFound(_0x10f0f9,null))[_0xfdf0('0x1c')](respondWithResult(_0x10f0f9,null))[_0xfdf0('0x41')](handleError(_0x10f0f9,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x587aba,_0x17f808,_0x12944c){return db['VoiceQueue'][_0xfdf0('0x40')]({'where':{'id':_0x587aba['params']['id']}})[_0xfdf0('0x1c')](handleEntityNotFound(_0x17f808,null))[_0xfdf0('0x1c')](function(_0x1c2536){var _0x3926b9;if(_0x1c2536){_0x3926b9=squel[_0xfdf0('0x5b')]()[_0xfdf0('0x5c')](_0xfdf0('0x5d'))[_0xfdf0('0x5e')]([_0xfdf0('0x5f'),'scheduledAt','ContactId',_0xfdf0('0x60'),'VoiceQueueId',_0xfdf0('0x61'),_0xfdf0('0x62')],squel['select']()[_0xfdf0('0x38')](_0xfdf0('0x63'),_0xfdf0('0x5f'))['field'](_0xfdf0('0x64'),_0xfdf0('0x65'))['field'](_0xfdf0('0x66'),_0xfdf0('0x67'))[_0xfdf0('0x38')](_0xfdf0('0x68'),_0xfdf0('0x60'))[_0xfdf0('0x38')](_0xfdf0('0x69'),'VoiceQueueId')[_0xfdf0('0x38')](_0xfdf0('0x64'),_0xfdf0('0x61'))[_0xfdf0('0x38')](_0xfdf0('0x64'),'updatedAt')['from'](_0xfdf0('0x6a'))[_0xfdf0('0x30')](_0xfdf0('0x6b'),_0x587aba['params']['id'][_0xfdf0('0x6c')]())[_0xfdf0('0x30')](_0xfdf0('0x6d'),_0x587aba['body'][_0xfdf0('0x6e')][_0xfdf0('0x6c')]())['where'](_0xfdf0('0x6f'))['where'](_0xfdf0('0x70'),squel[_0xfdf0('0x71')]()[_0xfdf0('0x38')](_0xfdf0('0x5f'))[_0xfdf0('0x72')](_0xfdf0('0x5d'))[_0xfdf0('0x30')](_0xfdf0('0x6b'),_0x587aba[_0xfdf0('0x3f')]['id'][_0xfdf0('0x6c')]()))[_0xfdf0('0x30')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xfdf0('0x71')]()[_0xfdf0('0x38')]('calleridnum')[_0xfdf0('0x72')](_0xfdf0('0x6a'))[_0xfdf0('0x30')]('VoiceQueueId\x20=\x20?',_0x587aba['params']['id'][_0xfdf0('0x6c')]())[_0xfdf0('0x30')](_0xfdf0('0x73')))[_0xfdf0('0x74')](_0xfdf0('0x67')))[_0xfdf0('0x6c')]();return db[_0xfdf0('0x47')][_0xfdf0('0x26')](_0x3926b9);}return[];})[_0xfdf0('0x1c')](respondWithResult(_0x17f808,null))[_0xfdf0('0x41')](handleError(_0x17f808,null));};exports[_0xfdf0('0x75')]=function(_0x268c44,_0x2694b4,_0x68bdfd){return db[_0xfdf0('0x76')]['find']({'where':{'id':_0x268c44[_0xfdf0('0x3f')]['id']}})[_0xfdf0('0x1c')](handleEntityNotFound(_0x2694b4,null))[_0xfdf0('0x1c')](function(_0x2ad7bb){var _0x357db9;if(_0x2ad7bb){_0x357db9=squel[_0xfdf0('0x5b')]()[_0xfdf0('0x5c')]('cm_hopper')['fromQuery'](['phone',_0xfdf0('0x65'),_0xfdf0('0x67'),_0xfdf0('0x60'),'CampaignId','createdAt','updatedAt'],squel[_0xfdf0('0x71')]()[_0xfdf0('0x38')]('ANY_VALUE(calleridnum)',_0xfdf0('0x5f'))['field'](_0xfdf0('0x64'),_0xfdf0('0x65'))['field'](_0xfdf0('0x66'),_0xfdf0('0x67'))[_0xfdf0('0x38')](_0xfdf0('0x68'),_0xfdf0('0x60'))['field']('ANY_VALUE(CampaignId)','CampaignId')['field'](_0xfdf0('0x64'),'createdAt')['field']('NOW()',_0xfdf0('0x62'))[_0xfdf0('0x72')](_0xfdf0('0x6a'))[_0xfdf0('0x30')](_0xfdf0('0x77'),_0x268c44['params']['id'][_0xfdf0('0x6c')]())[_0xfdf0('0x30')]('state\x20=\x20?',_0x268c44[_0xfdf0('0x44')][_0xfdf0('0x6e')][_0xfdf0('0x6c')]())[_0xfdf0('0x30')](_0xfdf0('0x6f'))[_0xfdf0('0x30')](_0xfdf0('0x70'),squel[_0xfdf0('0x71')]()['field'](_0xfdf0('0x5f'))[_0xfdf0('0x72')](_0xfdf0('0x5d'))[_0xfdf0('0x30')](_0xfdf0('0x77'),_0x268c44['params']['id'][_0xfdf0('0x6c')]()))['where'](_0xfdf0('0x70'),squel[_0xfdf0('0x71')]()[_0xfdf0('0x38')](_0xfdf0('0x78'))['from']('cm_hopper_final')[_0xfdf0('0x30')](_0xfdf0('0x77'),_0x268c44[_0xfdf0('0x3f')]['id'][_0xfdf0('0x6c')]())[_0xfdf0('0x30')](_0xfdf0('0x73')))['group'](_0xfdf0('0x67')))[_0xfdf0('0x6c')]();return db[_0xfdf0('0x47')]['query'](_0x357db9);}return[];})[_0xfdf0('0x1c')](respondWithResult(_0x2694b4,null))[_0xfdf0('0x41')](handleError(_0x2694b4,null));};exports['checkContactHopper']=function(_0x3afecd,_0x260fa9,_0x2c8263){return db[_0xfdf0('0x79')][_0xfdf0('0x7a')]({'where':{'VoiceQueueId':_0x3afecd['body'][_0xfdf0('0x7b')],'CampaignId':_0x3afecd[_0xfdf0('0x44')][_0xfdf0('0x7c')],'ContactId':_0x3afecd['body'][_0xfdf0('0x67')]}})['then'](handleEntityNotFound(_0x260fa9,null))[_0xfdf0('0x1c')](function(_0x378c1a){if(_0x378c1a){return _0x378c1a;}return null;})[_0xfdf0('0x1c')](respondWithResult(_0x260fa9,null))[_0xfdf0('0x41')](handleError(_0x260fa9,null));}; \ No newline at end of file +var _0xa263=['options','includeAll','findAll','rows','catch','show','params','find','describe','update','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal','abandonedContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','phone','scheduledAt','ContactId','ListId','updatedAt','select','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','Campaign','into','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','findOne','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','key','VIRTUAL','field','filter'];(function(_0x1c7b4c,_0x5b85b2){var _0x18daf6=function(_0xbe824e){while(--_0xbe824e){_0x1c7b4c['push'](_0x1c7b4c['shift']());}};_0x18daf6(++_0x5b85b2);}(_0xa263,0x135));var _0x3a26=function(_0x4b49cb,_0x4eb15c){_0x4b49cb=_0x4b49cb-0x0;var _0x4d3a2f=_0xa263[_0x4b49cb];return _0x4d3a2f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a26('0x0'));var rp=require(_0x3a26('0x1'));var moment=require(_0x3a26('0x2'));var BPromise=require(_0x3a26('0x3'));var Mustache=require(_0x3a26('0x4'));var util=require(_0x3a26('0x5'));var path=require(_0x3a26('0x6'));var sox=require('sox');var csv=require(_0x3a26('0x7'));var ejs=require(_0x3a26('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3a26('0x9'));var crypto=require(_0x3a26('0xa'));var jsforce=require(_0x3a26('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3a26('0x7'));var querystring=require(_0x3a26('0xc'));var Papa=require(_0x3a26('0xd'));var Redis=require(_0x3a26('0xe'));var authService=require(_0x3a26('0xf'));var qs=require(_0x3a26('0x10'));var hardwareService=require(_0x3a26('0x11'));var logger=require('../../config/logger')(_0x3a26('0x12'));var utils=require('../../config/utils');var config=require(_0x3a26('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x264cff,_0x2c8664){_0x2c8664=_0x2c8664||0xcc;return function(_0x5ca51b){if(_0x5ca51b){return _0x264cff[_0x3a26('0x14')](_0x2c8664);}return _0x264cff['status'](_0x2c8664)['end']();};}function respondWithResult(_0x55239e,_0x4b4fec){_0x4b4fec=_0x4b4fec||0xc8;return function(_0x5e8ffe){if(_0x5e8ffe){return _0x55239e[_0x3a26('0x15')](_0x4b4fec)[_0x3a26('0x16')](_0x5e8ffe);}};}function respondWithFilteredResult(_0x10fdc1,_0x65e21d){return function(_0x348a79){if(_0x348a79){var _0x1fd06b=_0x348a79[_0x3a26('0x17')],_0x53fb30=_0x65e21d[_0x3a26('0x18')],_0x1a4423=_0x65e21d[_0x3a26('0x18')]+_0x65e21d[_0x3a26('0x19')],_0xf4dfb1;if(_0x1a4423>=_0x1fd06b){_0x1a4423=_0x1fd06b;_0xf4dfb1=0xc8;}else{_0xf4dfb1=0xce;}_0x10fdc1['status'](_0xf4dfb1);return _0x10fdc1[_0x3a26('0x1a')](_0x3a26('0x1b'),_0x53fb30+'-'+_0x1a4423+'/'+_0x1fd06b)[_0x3a26('0x16')](_0x348a79);}return null;};}function patchUpdates(_0x5e3a19){return function(_0x886c94){try{jsonpatch[_0x3a26('0x1c')](_0x886c94,_0x5e3a19,!![]);}catch(_0x1dc572){return BPromise[_0x3a26('0x1d')](_0x1dc572);}return _0x886c94[_0x3a26('0x1e')]();};}function saveUpdates(_0x5d0db9,_0x3aac08){return function(_0x22e0ae){if(_0x22e0ae){return _0x22e0ae['update'](_0x5d0db9)[_0x3a26('0x1f')](function(_0x23a32b){return _0x23a32b;});}return null;};}function removeEntity(_0x17968e,_0x4fe510){return function(_0x5913e2){if(_0x5913e2){return _0x5913e2[_0x3a26('0x20')]()['then'](function(){_0x17968e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f0bc4,_0x431231){return function(_0x41c27e){if(!_0x41c27e){_0x2f0bc4[_0x3a26('0x14')](0x194);}return _0x41c27e;};}function handleError(_0x245cbf,_0x2d4a49){_0x2d4a49=_0x2d4a49||0x1f4;return function(_0x407a94){logger[_0x3a26('0x21')](_0x407a94[_0x3a26('0x22')]);if(_0x407a94[_0x3a26('0x23')]){delete _0x407a94['name'];}_0x245cbf[_0x3a26('0x15')](_0x2d4a49)[_0x3a26('0x24')](_0x407a94);};}exports[_0x3a26('0x25')]=function(_0x240acb,_0x3749d2){var _0x3d2d29={},_0x47dc1f={},_0x161045={'count':0x0,'rows':[]};var _0x526a5f=db[_0x3a26('0x26')][_0x3a26('0x27')];_0x47dc1f[_0x3a26('0x28')]=_[_0x3a26('0x29')](_0x526a5f);_0x47dc1f['query']=_[_0x3a26('0x29')](_0x240acb[_0x3a26('0x2a')]);_0x47dc1f[_0x3a26('0x2b')]=_[_0x3a26('0x2c')](_0x47dc1f['model'],_0x47dc1f['query']);_0x3d2d29[_0x3a26('0x2d')]=_[_0x3a26('0x2c')](_0x47dc1f['model'],qs[_0x3a26('0x2e')](_0x240acb['query']['fields']));_0x3d2d29[_0x3a26('0x2d')]=_0x3d2d29['attributes'][_0x3a26('0x2f')]?_0x3d2d29[_0x3a26('0x2d')]:_0x47dc1f[_0x3a26('0x28')];if(!_0x240acb[_0x3a26('0x2a')][_0x3a26('0x30')](_0x3a26('0x31'))){_0x3d2d29[_0x3a26('0x19')]=qs[_0x3a26('0x19')](_0x240acb[_0x3a26('0x2a')][_0x3a26('0x19')]);_0x3d2d29[_0x3a26('0x18')]=qs[_0x3a26('0x18')](_0x240acb['query'][_0x3a26('0x18')]);}_0x3d2d29[_0x3a26('0x32')]=qs[_0x3a26('0x33')](_0x240acb[_0x3a26('0x2a')][_0x3a26('0x33')]);_0x3d2d29[_0x3a26('0x34')]=qs[_0x3a26('0x2b')](_[_0x3a26('0x35')](_0x240acb[_0x3a26('0x2a')],_0x47dc1f[_0x3a26('0x2b')]));if(_0x240acb[_0x3a26('0x2a')]['filter']){_0x3d2d29[_0x3a26('0x34')]=_[_0x3a26('0x36')](_0x3d2d29[_0x3a26('0x34')],{'$or':_[_0x3a26('0x37')](_0x526a5f,function(_0x505427){if(_0x505427['type'][_0x3a26('0x38')]!==_0x3a26('0x39')){var _0x3e2b5e={};_0x3e2b5e[_0x505427[_0x3a26('0x3a')]]={'$like':'%'+_0x240acb['query'][_0x3a26('0x3b')]+'%'};return _0x3e2b5e;}})});}_0x3d2d29=_[_0x3a26('0x36')]({},_0x3d2d29,_0x240acb[_0x3a26('0x3c')]);var _0x439293={'where':_0x3d2d29[_0x3a26('0x34')]};return db[_0x3a26('0x26')][_0x3a26('0x17')](_0x439293)[_0x3a26('0x1f')](function(_0x480706){_0x161045[_0x3a26('0x17')]=_0x480706;if(_0x240acb[_0x3a26('0x2a')][_0x3a26('0x3d')]){_0x3d2d29['include']=[{'all':!![]}];}return db[_0x3a26('0x26')][_0x3a26('0x3e')](_0x3d2d29);})[_0x3a26('0x1f')](function(_0x1e7666){_0x161045[_0x3a26('0x3f')]=_0x1e7666;return _0x161045;})[_0x3a26('0x1f')](respondWithFilteredResult(_0x3749d2,_0x3d2d29))[_0x3a26('0x40')](handleError(_0x3749d2,null));};exports[_0x3a26('0x41')]=function(_0x41c8d6,_0xb960c4){var _0x40bc65={'raw':!![],'where':{'id':_0x41c8d6[_0x3a26('0x42')]['id']}},_0x559aaa={};_0x559aaa[_0x3a26('0x28')]=_[_0x3a26('0x29')](db[_0x3a26('0x26')][_0x3a26('0x27')]);_0x559aaa[_0x3a26('0x2a')]=_[_0x3a26('0x29')](_0x41c8d6['query']);_0x559aaa[_0x3a26('0x2b')]=_[_0x3a26('0x2c')](_0x559aaa['model'],_0x559aaa[_0x3a26('0x2a')]);_0x40bc65[_0x3a26('0x2d')]=_[_0x3a26('0x2c')](_0x559aaa[_0x3a26('0x28')],qs[_0x3a26('0x2e')](_0x41c8d6[_0x3a26('0x2a')][_0x3a26('0x2e')]));_0x40bc65['attributes']=_0x40bc65[_0x3a26('0x2d')][_0x3a26('0x2f')]?_0x40bc65['attributes']:_0x559aaa[_0x3a26('0x28')];if(_0x41c8d6[_0x3a26('0x2a')][_0x3a26('0x3d')]){_0x40bc65['include']=[{'all':!![]}];}_0x40bc65=_[_0x3a26('0x36')]({},_0x40bc65,_0x41c8d6[_0x3a26('0x3c')]);return db[_0x3a26('0x26')][_0x3a26('0x43')](_0x40bc65)[_0x3a26('0x1f')](handleEntityNotFound(_0xb960c4,null))[_0x3a26('0x1f')](respondWithResult(_0xb960c4,null))[_0x3a26('0x40')](handleError(_0xb960c4,null));};exports[_0x3a26('0x44')]=function(_0x5b971f,_0xce3544){return db[_0x3a26('0x26')]['describe']()[_0x3a26('0x1f')](respondWithResult(_0xce3544,null))[_0x3a26('0x40')](handleError(_0xce3544,null));};exports[_0x3a26('0x45')]=function(_0x53c637,_0x244316){if(_0x53c637[_0x3a26('0x46')]['uniqueid']){delete _0x53c637[_0x3a26('0x46')][_0x3a26('0x47')];}return db['CmHopperFinal'][_0x3a26('0x43')]({'where':{'uniqueid':_0x53c637[_0x3a26('0x42')]['id']}})['then'](handleEntityNotFound(_0x244316,null))[_0x3a26('0x1f')](saveUpdates(_0x53c637['body'],null))[_0x3a26('0x1f')](respondWithResult(_0x244316,null))[_0x3a26('0x40')](handleError(_0x244316,null));};exports[_0x3a26('0x48')]=function(_0x327000,_0x4f0bad,_0x41cd5){return db[_0x3a26('0x26')][_0x3a26('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x327000[_0x3a26('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0x3a26('0x49'),db['sequelize']['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x4c')))),'noSuchContacts'],[db[_0x3a26('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x3a26('0x4b')](_0x3a26('0x4d')))),_0x3a26('0x4e')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x4f')))),_0x3a26('0x50')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0x3a26('0x51')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x52')))),_0x3a26('0x53')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x54')))),'abandonedContacts'],[db['sequelize']['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x55')))),_0x3a26('0x56')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x3a26('0x1f')](handleEntityNotFound(_0x4f0bad,null))[_0x3a26('0x1f')](respondWithResult(_0x4f0bad,null))[_0x3a26('0x40')](handleError(_0x4f0bad,null));};exports[_0x3a26('0x57')]=function(_0x5547f7,_0x42003d,_0x51e413){return db[_0x3a26('0x26')][_0x3a26('0x3e')]({'raw':![],'where':{'CampaignId':_0x5547f7[_0x3a26('0x42')]['id']},'attributes':[[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db['sequelize'][_0x3a26('0x4b')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x4d')))),_0x3a26('0x4e')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db['sequelize'][_0x3a26('0x4b')](_0x3a26('0x4f')))),_0x3a26('0x50')],[db[_0x3a26('0x4a')]['fn']('COUNT',db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x52')))),_0x3a26('0x53')],[db[_0x3a26('0x4a')]['fn']('COUNT',db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')][_0x3a26('0x4b')](_0x3a26('0x54')))),_0x3a26('0x58')],[db['sequelize']['fn'](_0x3a26('0x49'),db[_0x3a26('0x4a')]['fn']('IF',db[_0x3a26('0x4a')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),_0x3a26('0x56')],[db[_0x3a26('0x4a')]['fn'](_0x3a26('0x49'),db['sequelize']['fn']('IF',db[_0x3a26('0x4a')]['literal'](_0x3a26('0x59')))),_0x3a26('0x5a')]]})[_0x3a26('0x1f')](handleEntityNotFound(_0x42003d,null))[_0x3a26('0x1f')](respondWithResult(_0x42003d,null))[_0x3a26('0x40')](handleError(_0x42003d,null));};exports[_0x3a26('0x5b')]=function(_0x4717f0,_0xa7c212,_0x26948b){return db['VoiceQueue'][_0x3a26('0x43')]({'where':{'id':_0x4717f0[_0x3a26('0x42')]['id']}})[_0x3a26('0x1f')](handleEntityNotFound(_0xa7c212,null))[_0x3a26('0x1f')](function(_0x59de12){var _0x2f0e8e;if(_0x59de12){_0x2f0e8e=squel[_0x3a26('0x5c')]()['into'](_0x3a26('0x5d'))['fromQuery']([_0x3a26('0x5e'),_0x3a26('0x5f'),_0x3a26('0x60'),_0x3a26('0x61'),'VoiceQueueId','createdAt',_0x3a26('0x62')],squel[_0x3a26('0x63')]()['field'](_0x3a26('0x64'),_0x3a26('0x5e'))[_0x3a26('0x3a')](_0x3a26('0x65'),_0x3a26('0x5f'))[_0x3a26('0x3a')](_0x3a26('0x66'),'ContactId')[_0x3a26('0x3a')]('ANY_VALUE(ListId)',_0x3a26('0x61'))[_0x3a26('0x3a')](_0x3a26('0x67'),_0x3a26('0x68'))[_0x3a26('0x3a')](_0x3a26('0x65'),'createdAt')[_0x3a26('0x3a')](_0x3a26('0x65'),'updatedAt')[_0x3a26('0x69')](_0x3a26('0x6a'))[_0x3a26('0x34')]('VoiceQueueId\x20=\x20?',_0x4717f0[_0x3a26('0x42')]['id'][_0x3a26('0x6b')]())[_0x3a26('0x34')](_0x3a26('0x6c'),_0x4717f0[_0x3a26('0x46')][_0x3a26('0x6d')]['toString']())[_0x3a26('0x34')](_0x3a26('0x6e'))[_0x3a26('0x34')](_0x3a26('0x6f'),squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x5e'))[_0x3a26('0x69')](_0x3a26('0x5d'))['where']('VoiceQueueId\x20=\x20?',_0x4717f0[_0x3a26('0x42')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x70'))['from'](_0x3a26('0x6a'))[_0x3a26('0x34')](_0x3a26('0x71'),_0x4717f0['params']['id'][_0x3a26('0x6b')]())['where'](_0x3a26('0x72')))['group'](_0x3a26('0x60')))['toString']();return db[_0x3a26('0x4a')][_0x3a26('0x2a')](_0x2f0e8e);}return[];})[_0x3a26('0x1f')](respondWithResult(_0xa7c212,null))[_0x3a26('0x40')](handleError(_0xa7c212,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x4787ac,_0x49bcf8,_0x1280b8){return db[_0x3a26('0x73')][_0x3a26('0x43')]({'where':{'id':_0x4787ac[_0x3a26('0x42')]['id']}})[_0x3a26('0x1f')](handleEntityNotFound(_0x49bcf8,null))[_0x3a26('0x1f')](function(_0x1590c5){var _0x798fe0;if(_0x1590c5){_0x798fe0=squel[_0x3a26('0x5c')]()[_0x3a26('0x74')]('cm_hopper')['fromQuery']([_0x3a26('0x5e'),_0x3a26('0x5f'),_0x3a26('0x60'),_0x3a26('0x61'),_0x3a26('0x75'),_0x3a26('0x76'),_0x3a26('0x62')],squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x64'),'phone')[_0x3a26('0x3a')](_0x3a26('0x65'),_0x3a26('0x5f'))['field'](_0x3a26('0x66'),_0x3a26('0x60'))[_0x3a26('0x3a')]('ANY_VALUE(ListId)',_0x3a26('0x61'))[_0x3a26('0x3a')](_0x3a26('0x77'),'CampaignId')[_0x3a26('0x3a')](_0x3a26('0x65'),_0x3a26('0x76'))[_0x3a26('0x3a')]('NOW()',_0x3a26('0x62'))[_0x3a26('0x69')](_0x3a26('0x6a'))[_0x3a26('0x34')](_0x3a26('0x78'),_0x4787ac[_0x3a26('0x42')]['id']['toString']())[_0x3a26('0x34')](_0x3a26('0x6c'),_0x4787ac[_0x3a26('0x46')]['state'][_0x3a26('0x6b')]())[_0x3a26('0x34')](_0x3a26('0x6e'))[_0x3a26('0x34')](_0x3a26('0x6f'),squel['select']()[_0x3a26('0x3a')](_0x3a26('0x5e'))[_0x3a26('0x69')](_0x3a26('0x5d'))[_0x3a26('0x34')]('CampaignId\x20=\x20?',_0x4787ac[_0x3a26('0x42')]['id']['toString']()))[_0x3a26('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x3a26('0x63')]()[_0x3a26('0x3a')](_0x3a26('0x70'))[_0x3a26('0x69')](_0x3a26('0x6a'))[_0x3a26('0x34')](_0x3a26('0x78'),_0x4787ac[_0x3a26('0x42')]['id'][_0x3a26('0x6b')]())['where'](_0x3a26('0x72')))['group'](_0x3a26('0x60')))[_0x3a26('0x6b')]();return db[_0x3a26('0x4a')]['query'](_0x798fe0);}return[];})[_0x3a26('0x1f')](respondWithResult(_0x49bcf8,null))[_0x3a26('0x40')](handleError(_0x49bcf8,null));};exports[_0x3a26('0x79')]=function(_0x111442,_0x117531,_0x46627c){return db['CmHopper'][_0x3a26('0x7a')]({'where':{'VoiceQueueId':_0x111442['body']['VoiceQueueId'],'CampaignId':_0x111442[_0x3a26('0x46')]['CampaignId'],'ContactId':_0x111442[_0x3a26('0x46')][_0x3a26('0x60')]}})['then'](handleEntityNotFound(_0x117531,null))[_0x3a26('0x1f')](function(_0x5736bd){if(_0x5736bd){return _0x5736bd;}return null;})[_0x3a26('0x1f')](respondWithResult(_0x117531,null))[_0x3a26('0x40')](handleError(_0x117531,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 009f488..cde2339 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 _0xbe53=['calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xbe53,0xc5));var _0x3be5=function(_0x3df804,_0x40d0ce){_0x3df804=_0x3df804-0x0;var _0x205c79=_0xbe53[_0x3df804];return _0x205c79;};'use strict';var _=require(_0x3be5('0x0'));var util=require(_0x3be5('0x1'));var logger=require(_0x3be5('0x2'))(_0x3be5('0x3'));var moment=require('moment');var BPromise=require(_0x3be5('0x4'));var rp=require(_0x3be5('0x5'));var fs=require('fs');var path=require(_0x3be5('0x6'));var rimraf=require(_0x3be5('0x7'));var config=require(_0x3be5('0x8'));var attributes=require(_0x3be5('0x9'));module[_0x3be5('0xa')]=function(_0x5320bb,_0x8ca3fd){return _0x5320bb[_0x3be5('0xb')](_0x3be5('0xc'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x3be5('0xd'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0x3be5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb789=['path','rimraf','../../config/environment','exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','request-promise'];(function(_0x4bf406,_0x10810f){var _0x54f3e5=function(_0x312ed3){while(--_0x312ed3){_0x4bf406['push'](_0x4bf406['shift']());}};_0x54f3e5(++_0x10810f);}(_0xb789,0x188));var _0x9b78=function(_0x1036f1,_0x7d4cb7){_0x1036f1=_0x1036f1-0x0;var _0x5c47ad=_0xb789[_0x1036f1];return _0x5c47ad;};'use strict';var _=require(_0x9b78('0x0'));var util=require(_0x9b78('0x1'));var logger=require(_0x9b78('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9b78('0x3'));var fs=require('fs');var path=require(_0x9b78('0x4'));var rimraf=require(_0x9b78('0x5'));var config=require(_0x9b78('0x6'));var attributes=require('./cmHopperFinal.attributes');module[_0x9b78('0x7')]=function(_0x696c5e,_0x548753){return _0x696c5e[_0x9b78('0x8')](_0x9b78('0x9'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x9b78('0xa'),'fields':[_0x9b78('0xa')]},{'name':'uniqueid','fields':[_0x9b78('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 0333c4d..1af9508 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 _0xeb74=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateCmHopperFinal','CmHopperFinal','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring'];(function(_0x4561f1,_0x171083){var _0x1ddfb4=function(_0x2ccadc){while(--_0x2ccadc){_0x4561f1['push'](_0x4561f1['shift']());}};_0x1ddfb4(++_0x171083);}(_0xeb74,0xe3));var _0x4eb7=function(_0x26ffff,_0x60d780){_0x26ffff=_0x26ffff-0x0;var _0x38f967=_0xeb74[_0x26ffff];return _0x38f967;};'use strict';var _=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var moment=require(_0x4eb7('0x2'));var BPromise=require(_0x4eb7('0x3'));var rs=require(_0x4eb7('0x4'));var fs=require('fs');var Redis=require(_0x4eb7('0x5'));var db=require(_0x4eb7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4eb7('0x7'))(_0x4eb7('0x8'));var config=require(_0x4eb7('0x9'));var jayson=require(_0x4eb7('0xa'));var client=jayson[_0x4eb7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3986cd,_0x54859c,_0xcac7c5){return new BPromise(function(_0x2cffe7,_0x588a1c){return client['request'](_0x3986cd,_0xcac7c5)[_0x4eb7('0xc')](function(_0x2f8296){logger['info'](_0x4eb7('0xd'),_0x54859c,'request\x20sent');logger[_0x4eb7('0xe')](_0x4eb7('0xf'),_0x54859c,_0x4eb7('0x10'),JSON['stringify'](_0x2f8296));if(_0x2f8296[_0x4eb7('0x11')]){if(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x12')]===0x1f4){logger[_0x4eb7('0x11')](_0x4eb7('0xd'),_0x54859c,_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);return _0x588a1c(_0x2f8296['error']['message']);}logger['error'](_0x4eb7('0xd'),_0x54859c,_0x2f8296['error'][_0x4eb7('0x13')]);return _0x2cffe7(_0x2f8296[_0x4eb7('0x11')][_0x4eb7('0x13')]);}else{logger[_0x4eb7('0x14')](_0x4eb7('0xd'),_0x54859c,_0x4eb7('0x10'));_0x2cffe7(_0x2f8296[_0x4eb7('0x15')][_0x4eb7('0x13')]);}})[_0x4eb7('0x16')](function(_0x17377f){logger['error'](_0x4eb7('0xd'),_0x54859c,_0x17377f);_0x588a1c(_0x17377f);});});}exports[_0x4eb7('0x17')]=function(_0x3b6d41){var _0xf14478=this;return new Promise(function(_0x302e16,_0x44f1b9){return db[_0x4eb7('0x18')][_0x4eb7('0x19')](_0x3b6d41['body'],{'raw':_0x3b6d41[_0x4eb7('0x1a')]?_0x3b6d41[_0x4eb7('0x1a')][_0x4eb7('0x1b')]===undefined?!![]:![]:!![]})[_0x4eb7('0xc')](function(_0x32f0f5){logger[_0x4eb7('0x14')](_0x4eb7('0x17'),_0x3b6d41);logger['debug'](_0x4eb7('0x17'),_0x3b6d41,JSON[_0x4eb7('0x1c')](_0x32f0f5));_0x302e16(_0x32f0f5);})[_0x4eb7('0x16')](function(_0x164515){logger[_0x4eb7('0x11')](_0x4eb7('0x17'),_0x164515[_0x4eb7('0x13')],_0x3b6d41);_0x44f1b9(_0xf14478[_0x4eb7('0x11')](0x1f4,_0x164515[_0x4eb7('0x13')]));});});}; \ No newline at end of file +var _0x7072=['request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperFinal','options','raw','then','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s'];(function(_0x32f794,_0x2852da){var _0x15dade=function(_0x500ae0){while(--_0x500ae0){_0x32f794['push'](_0x32f794['shift']());}};_0x15dade(++_0x2852da);}(_0x7072,0x138));var _0x2707=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x7072[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0x2707('0x0'));var moment=require(_0x2707('0x1'));var BPromise=require(_0x2707('0x2'));var rs=require(_0x2707('0x3'));var fs=require('fs');var Redis=require(_0x2707('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2707('0x5'))('rpc');var config=require(_0x2707('0x6'));var jayson=require(_0x2707('0x7'));var client=jayson[_0x2707('0x8')][_0x2707('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fd8ff,_0x128205,_0x21b0a0){return new BPromise(function(_0x745cfd,_0x4062b6){return client[_0x2707('0xa')](_0x2fd8ff,_0x21b0a0)['then'](function(_0x597ff9){logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));logger[_0x2707('0xe')](_0x2707('0xf'),_0x128205,_0x2707('0xd'),JSON[_0x2707('0x10')](_0x597ff9));if(_0x597ff9[_0x2707('0x11')]){if(_0x597ff9[_0x2707('0x11')][_0x2707('0x12')]===0x1f4){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')]['message']);return _0x4062b6(_0x597ff9[_0x2707('0x11')]['message']);}logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x597ff9[_0x2707('0x11')][_0x2707('0x13')]);return _0x745cfd(_0x597ff9[_0x2707('0x11')]['message']);}else{logger[_0x2707('0xb')](_0x2707('0xc'),_0x128205,_0x2707('0xd'));_0x745cfd(_0x597ff9['result'][_0x2707('0x13')]);}})[_0x2707('0x14')](function(_0x1a979e){logger[_0x2707('0x11')](_0x2707('0xc'),_0x128205,_0x1a979e);_0x4062b6(_0x1a979e);});});}exports[_0x2707('0x15')]=function(_0x4a8b7f){var _0x119ac4=this;return new Promise(function(_0x449a61,_0x4009f3){return db['CmHopperFinal']['create'](_0x4a8b7f['body'],{'raw':_0x4a8b7f[_0x2707('0x16')]?_0x4a8b7f[_0x2707('0x16')][_0x2707('0x17')]===undefined?!![]:![]:!![]})[_0x2707('0x18')](function(_0x1a0e1a){logger[_0x2707('0xb')](_0x2707('0x15'),_0x4a8b7f);logger[_0x2707('0xe')](_0x2707('0x15'),_0x4a8b7f,JSON[_0x2707('0x10')](_0x1a0e1a));_0x449a61(_0x1a0e1a);})[_0x2707('0x14')](function(_0x119df4){logger[_0x2707('0x11')](_0x2707('0x15'),_0x119df4['message'],_0x4a8b7f);_0x4009f3(_0x119ac4[_0x2707('0x11')](0x1f4,_0x119df4[_0x2707('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index fa17435..05efa79 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 _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0xbdb26b,_0x329cf1){var _0x29a49d=function(_0x5357d0){while(--_0x5357d0){_0xbdb26b['push'](_0xbdb26b['shift']());}};_0x29a49d(++_0x329cf1);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['put','update','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','post','/checkContactHopper','checkContactHopper'];(function(_0x46968a,_0x31623e){var _0xb1c0f2=function(_0x16d4f9){while(--_0x16d4f9){_0x46968a['push'](_0x46968a['shift']());}};_0xb1c0f2(++_0x31623e);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0x6')]('/campaign/countAttributes/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xe')]);router['post']('/voice/queue/moveContacts/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x13')]);router[_0x49c4('0x14')](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5e2815a..20e9228 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 _0xeec6=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeec6,0x1c2));var _0x6eec=function(_0xf64e5,_0x4a3232){_0xf64e5=_0xf64e5-0x0;var _0x5f312c=_0xeec6[_0xf64e5];return _0x5f312c;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'state':{'type':Sequelize[_0x6eec('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6eec('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x6eec('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6eec('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6eec('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6eec('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6eec('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6eec('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x6eec('0x3')]},'calleridname':{'type':Sequelize[_0x6eec('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6eec('0x4')]},'answertime':{'type':Sequelize[_0x6eec('0x4')]},'droptime':{'type':Sequelize[_0x6eec('0x4')]},'endtime':{'type':Sequelize[_0x6eec('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6eec('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6eec('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6eec('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6eec('0x3')]},'reason':{'type':Sequelize[_0x6eec('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x6eec('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6eec('0x4')]},'recallme':{'type':Sequelize[_0x6eec('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6eec('0x4')]},'edited':{'type':Sequelize[_0x6eec('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x5292=['BOOLEAN','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x36d66c,_0x14416b){var _0x3867a8=function(_0x3f147f){while(--_0x3f147f){_0x36d66c['push'](_0x36d66c['shift']());}};_0x3867a8(++_0x14416b);}(_0x5292,0xf7));var _0x2529=function(_0x495f6f,_0x20c392){_0x495f6f=_0x495f6f-0x0;var _0x39bbf3=_0x5292[_0x495f6f];return _0x39bbf3;};'use strict';var Sequelize=require(_0x2529('0x0'));module[_0x2529('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x2529('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x2529('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x2529('0x4')]},'responsetime':{'type':Sequelize[_0x2529('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2529('0x4')]},'ringtime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x2529('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x2529('0x2')]},'campaign':{'type':Sequelize[_0x2529('0x2')]},'campaigntype':{'type':Sequelize[_0x2529('0x2')]},'membername':{'type':Sequelize[_0x2529('0x2')]},'reason':{'type':Sequelize[_0x2529('0x2')]},'amd':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x2529('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x2529('0x4')]},'edited':{'type':Sequelize[_0x2529('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 3660e66..b255baf 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 _0x0a0e=['attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','merge','map','key','field','filter','options','includeAll','findAll','catch','include','create','body','describe','update','uniqueid','find','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','set','Content-Range','apply','reject','save','then','destroy','error','send','index','CmHopperHistory','rawAttributes','keys','query','filters','model'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0x0a0e,0xb0));var _0xe0a0=function(_0x4d9205,_0x8e02b2){_0x4d9205=_0x4d9205-0x0;var _0x2d6e01=_0x0a0e[_0x4d9205];return _0x2d6e01;};'use strict';var pdf=require(_0xe0a0('0x0'));var emlformat=require(_0xe0a0('0x1'));var rimraf=require(_0xe0a0('0x2'));var zipdir=require(_0xe0a0('0x3'));var jsonpatch=require(_0xe0a0('0x4'));var rp=require(_0xe0a0('0x5'));var moment=require('moment');var BPromise=require(_0xe0a0('0x6'));var Mustache=require('mustache');var util=require(_0xe0a0('0x7'));var path=require(_0xe0a0('0x8'));var sox=require(_0xe0a0('0x9'));var csv=require(_0xe0a0('0xa'));var ejs=require(_0xe0a0('0xb'));var fs=require('fs');var _=require(_0xe0a0('0xc'));var squel=require(_0xe0a0('0xd'));var crypto=require(_0xe0a0('0xe'));var jsforce=require(_0xe0a0('0xf'));var deskjs=require(_0xe0a0('0x10'));var toCsv=require(_0xe0a0('0xa'));var querystring=require(_0xe0a0('0x11'));var Papa=require(_0xe0a0('0x12'));var Redis=require(_0xe0a0('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe0a0('0x14'));var hardwareService=require(_0xe0a0('0x15'));var logger=require(_0xe0a0('0x16'))(_0xe0a0('0x17'));var utils=require(_0xe0a0('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15e9db,_0x3b1849){_0x3b1849=_0x3b1849||0xcc;return function(_0x3043f8){if(_0x3043f8){return _0x15e9db[_0xe0a0('0x19')](_0x3b1849);}return _0x15e9db['status'](_0x3b1849)[_0xe0a0('0x1a')]();};}function respondWithResult(_0x171674,_0x33cfb7){_0x33cfb7=_0x33cfb7||0xc8;return function(_0xb4ccb8){if(_0xb4ccb8){return _0x171674[_0xe0a0('0x1b')](_0x33cfb7)[_0xe0a0('0x1c')](_0xb4ccb8);}};}function respondWithFilteredResult(_0xf5aedf,_0x54634e){return function(_0x464da1){if(_0x464da1){var _0x213ce2=_0x464da1[_0xe0a0('0x1d')],_0x27ce52=_0x54634e['offset'],_0x857dc8=_0x54634e['offset']+_0x54634e['limit'],_0x2e686d;if(_0x857dc8>=_0x213ce2){_0x857dc8=_0x213ce2;_0x2e686d=0xc8;}else{_0x2e686d=0xce;}_0xf5aedf[_0xe0a0('0x1b')](_0x2e686d);return _0xf5aedf[_0xe0a0('0x1e')](_0xe0a0('0x1f'),_0x27ce52+'-'+_0x857dc8+'/'+_0x213ce2)[_0xe0a0('0x1c')](_0x464da1);}return null;};}function patchUpdates(_0x572eee){return function(_0x26f2ef){try{jsonpatch[_0xe0a0('0x20')](_0x26f2ef,_0x572eee,!![]);}catch(_0x41b412){return BPromise[_0xe0a0('0x21')](_0x41b412);}return _0x26f2ef[_0xe0a0('0x22')]();};}function saveUpdates(_0x68c8ea,_0x1aa3e5){return function(_0x2329d4){if(_0x2329d4){return _0x2329d4['update'](_0x68c8ea)[_0xe0a0('0x23')](function(_0x55afe5){return _0x55afe5;});}return null;};}function removeEntity(_0x18beef,_0x23f947){return function(_0x487de2){if(_0x487de2){return _0x487de2[_0xe0a0('0x24')]()[_0xe0a0('0x23')](function(){_0x18beef[_0xe0a0('0x1b')](0xcc)[_0xe0a0('0x1a')]();});}};}function handleEntityNotFound(_0x35e872,_0x5e468e){return function(_0xd2af8c){if(!_0xd2af8c){_0x35e872[_0xe0a0('0x19')](0x194);}return _0xd2af8c;};}function handleError(_0x1b483b,_0x5268e0){_0x5268e0=_0x5268e0||0x1f4;return function(_0xe184a0){logger[_0xe0a0('0x25')](_0xe184a0['stack']);if(_0xe184a0['name']){delete _0xe184a0['name'];}_0x1b483b[_0xe0a0('0x1b')](_0x5268e0)[_0xe0a0('0x26')](_0xe184a0);};}exports[_0xe0a0('0x27')]=function(_0x3ae6e5,_0x5d3608){var _0x42b44d={},_0x405ec0={},_0xa1868b={'count':0x0,'rows':[]};var _0x136756=db[_0xe0a0('0x28')][_0xe0a0('0x29')];_0x405ec0['model']=_[_0xe0a0('0x2a')](_0x136756);_0x405ec0[_0xe0a0('0x2b')]=_[_0xe0a0('0x2a')](_0x3ae6e5[_0xe0a0('0x2b')]);_0x405ec0[_0xe0a0('0x2c')]=_['intersection'](_0x405ec0[_0xe0a0('0x2d')],_0x405ec0[_0xe0a0('0x2b')]);_0x42b44d[_0xe0a0('0x2e')]=_[_0xe0a0('0x2f')](_0x405ec0[_0xe0a0('0x2d')],qs[_0xe0a0('0x30')](_0x3ae6e5['query'][_0xe0a0('0x30')]));_0x42b44d[_0xe0a0('0x2e')]=_0x42b44d[_0xe0a0('0x2e')][_0xe0a0('0x31')]?_0x42b44d[_0xe0a0('0x2e')]:_0x405ec0[_0xe0a0('0x2d')];if(!_0x3ae6e5[_0xe0a0('0x2b')][_0xe0a0('0x32')](_0xe0a0('0x33'))){_0x42b44d['limit']=qs[_0xe0a0('0x34')](_0x3ae6e5[_0xe0a0('0x2b')][_0xe0a0('0x34')]);_0x42b44d[_0xe0a0('0x35')]=qs['offset'](_0x3ae6e5['query'][_0xe0a0('0x35')]);}_0x42b44d[_0xe0a0('0x36')]=qs[_0xe0a0('0x37')](_0x3ae6e5[_0xe0a0('0x2b')]['sort']);_0x42b44d[_0xe0a0('0x38')]=qs['filters'](_['pick'](_0x3ae6e5['query'],_0x405ec0[_0xe0a0('0x2c')]));if(_0x3ae6e5[_0xe0a0('0x2b')]['filter']){_0x42b44d[_0xe0a0('0x38')]=_[_0xe0a0('0x39')](_0x42b44d[_0xe0a0('0x38')],{'$or':_[_0xe0a0('0x3a')](_0x136756,function(_0x5a734d){if(_0x5a734d['type'][_0xe0a0('0x3b')]!=='VIRTUAL'){var _0x4e4c5f={};_0x4e4c5f[_0x5a734d[_0xe0a0('0x3c')]]={'$like':'%'+_0x3ae6e5[_0xe0a0('0x2b')][_0xe0a0('0x3d')]+'%'};return _0x4e4c5f;}})});}_0x42b44d=_['merge']({},_0x42b44d,_0x3ae6e5[_0xe0a0('0x3e')]);var _0x506ca6={'where':_0x42b44d[_0xe0a0('0x38')]};return db[_0xe0a0('0x28')][_0xe0a0('0x1d')](_0x506ca6)[_0xe0a0('0x23')](function(_0x1139cc){_0xa1868b[_0xe0a0('0x1d')]=_0x1139cc;if(_0x3ae6e5[_0xe0a0('0x2b')][_0xe0a0('0x3f')]){_0x42b44d['include']=[{'all':!![]}];}return db[_0xe0a0('0x28')][_0xe0a0('0x40')](_0x42b44d);})[_0xe0a0('0x23')](function(_0x2b7dff){_0xa1868b['rows']=_0x2b7dff;return _0xa1868b;})['then'](respondWithFilteredResult(_0x5d3608,_0x42b44d))[_0xe0a0('0x41')](handleError(_0x5d3608,null));};exports['show']=function(_0x3763a8,_0x477a4a){var _0x1665d5={'raw':!![],'where':{'id':_0x3763a8['params']['id']}},_0x4f6da8={};_0x4f6da8[_0xe0a0('0x2d')]=_['keys'](db[_0xe0a0('0x28')][_0xe0a0('0x29')]);_0x4f6da8[_0xe0a0('0x2b')]=_[_0xe0a0('0x2a')](_0x3763a8[_0xe0a0('0x2b')]);_0x4f6da8['filters']=_[_0xe0a0('0x2f')](_0x4f6da8['model'],_0x4f6da8[_0xe0a0('0x2b')]);_0x1665d5[_0xe0a0('0x2e')]=_['intersection'](_0x4f6da8[_0xe0a0('0x2d')],qs[_0xe0a0('0x30')](_0x3763a8[_0xe0a0('0x2b')][_0xe0a0('0x30')]));_0x1665d5[_0xe0a0('0x2e')]=_0x1665d5['attributes'][_0xe0a0('0x31')]?_0x1665d5[_0xe0a0('0x2e')]:_0x4f6da8[_0xe0a0('0x2d')];if(_0x3763a8['query'][_0xe0a0('0x3f')]){_0x1665d5[_0xe0a0('0x42')]=[{'all':!![]}];}_0x1665d5=_[_0xe0a0('0x39')]({},_0x1665d5,_0x3763a8['options']);return db[_0xe0a0('0x28')]['find'](_0x1665d5)[_0xe0a0('0x23')](handleEntityNotFound(_0x477a4a,null))[_0xe0a0('0x23')](respondWithResult(_0x477a4a,null))[_0xe0a0('0x41')](handleError(_0x477a4a,null));};exports[_0xe0a0('0x43')]=function(_0x508510,_0x4f9d7c){return db[_0xe0a0('0x28')]['create'](_0x508510[_0xe0a0('0x44')],{})[_0xe0a0('0x23')](respondWithResult(_0x4f9d7c,0xc9))[_0xe0a0('0x41')](handleError(_0x4f9d7c,null));};exports['describe']=function(_0x55cc13,_0x19e602){return db[_0xe0a0('0x28')][_0xe0a0('0x45')]()[_0xe0a0('0x23')](respondWithResult(_0x19e602,null))[_0xe0a0('0x41')](handleError(_0x19e602,null));};exports[_0xe0a0('0x46')]=function(_0x483b7b,_0x5ba4f3){if(_0x483b7b[_0xe0a0('0x44')][_0xe0a0('0x47')]){delete _0x483b7b[_0xe0a0('0x44')][_0xe0a0('0x47')];}return db[_0xe0a0('0x28')][_0xe0a0('0x48')]({'where':{'uniqueid':_0x483b7b[_0xe0a0('0x49')]['id']}})[_0xe0a0('0x23')](handleEntityNotFound(_0x5ba4f3,null))[_0xe0a0('0x23')](saveUpdates(_0x483b7b[_0xe0a0('0x44')],null))['then'](respondWithResult(_0x5ba4f3,null))[_0xe0a0('0x41')](handleError(_0x5ba4f3,null));}; \ No newline at end of file +var _0x12b5=['then','error','stack','name','send','index','CmHopperHistory','keys','query','filters','intersection','attributes','fields','length','model','where','pick','filter','merge','type','VIRTUAL','field','includeAll','findAll','rows','catch','show','params','rawAttributes','find','body','describe','uniqueid','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy'];(function(_0x372b9d,_0x547e8c){var _0x48cb9b=function(_0x5472c9){while(--_0x5472c9){_0x372b9d['push'](_0x372b9d['shift']());}};_0x48cb9b(++_0x547e8c);}(_0x12b5,0x13d));var _0x512b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x12b5[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x512b('0x0'));var emlformat=require(_0x512b('0x1'));var rimraf=require(_0x512b('0x2'));var zipdir=require(_0x512b('0x3'));var jsonpatch=require(_0x512b('0x4'));var rp=require(_0x512b('0x5'));var moment=require('moment');var BPromise=require(_0x512b('0x6'));var Mustache=require(_0x512b('0x7'));var util=require(_0x512b('0x8'));var path=require(_0x512b('0x9'));var sox=require(_0x512b('0xa'));var csv=require(_0x512b('0xb'));var ejs=require(_0x512b('0xc'));var fs=require('fs');var _=require(_0x512b('0xd'));var squel=require(_0x512b('0xe'));var crypto=require(_0x512b('0xf'));var jsforce=require(_0x512b('0x10'));var deskjs=require(_0x512b('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x512b('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x512b('0x13'));var hardwareService=require(_0x512b('0x14'));var logger=require('../../config/logger')(_0x512b('0x15'));var utils=require(_0x512b('0x16'));var config=require(_0x512b('0x17'));var db=require(_0x512b('0x18'))['db'];function respondWithStatusCode(_0x38c0b6,_0x69dcec){_0x69dcec=_0x69dcec||0xcc;return function(_0x488563){if(_0x488563){return _0x38c0b6[_0x512b('0x19')](_0x69dcec);}return _0x38c0b6['status'](_0x69dcec)[_0x512b('0x1a')]();};}function respondWithResult(_0x4e84fc,_0x5b73c5){_0x5b73c5=_0x5b73c5||0xc8;return function(_0x4d6d01){if(_0x4d6d01){return _0x4e84fc[_0x512b('0x1b')](_0x5b73c5)[_0x512b('0x1c')](_0x4d6d01);}};}function respondWithFilteredResult(_0x5a3730,_0x3419f4){return function(_0x243a83){if(_0x243a83){var _0x377c59=_0x243a83[_0x512b('0x1d')],_0x5237f2=_0x3419f4[_0x512b('0x1e')],_0x1f268f=_0x3419f4['offset']+_0x3419f4[_0x512b('0x1f')],_0x55eba6;if(_0x1f268f>=_0x377c59){_0x1f268f=_0x377c59;_0x55eba6=0xc8;}else{_0x55eba6=0xce;}_0x5a3730[_0x512b('0x1b')](_0x55eba6);return _0x5a3730[_0x512b('0x20')](_0x512b('0x21'),_0x5237f2+'-'+_0x1f268f+'/'+_0x377c59)[_0x512b('0x1c')](_0x243a83);}return null;};}function patchUpdates(_0x3467e3){return function(_0x2ad923){try{jsonpatch[_0x512b('0x22')](_0x2ad923,_0x3467e3,!![]);}catch(_0x173564){return BPromise[_0x512b('0x23')](_0x173564);}return _0x2ad923['save']();};}function saveUpdates(_0x55ae54,_0x1d9483){return function(_0x4f0ef5){if(_0x4f0ef5){return _0x4f0ef5[_0x512b('0x24')](_0x55ae54)['then'](function(_0x2ab3fd){return _0x2ab3fd;});}return null;};}function removeEntity(_0x4c9ba3,_0x142ba6){return function(_0x490140){if(_0x490140){return _0x490140[_0x512b('0x25')]()[_0x512b('0x26')](function(){_0x4c9ba3[_0x512b('0x1b')](0xcc)[_0x512b('0x1a')]();});}};}function handleEntityNotFound(_0x137cea,_0x1606da){return function(_0xd581df){if(!_0xd581df){_0x137cea['sendStatus'](0x194);}return _0xd581df;};}function handleError(_0xde69fe,_0x2d5ad0){_0x2d5ad0=_0x2d5ad0||0x1f4;return function(_0x43bf27){logger[_0x512b('0x27')](_0x43bf27[_0x512b('0x28')]);if(_0x43bf27['name']){delete _0x43bf27[_0x512b('0x29')];}_0xde69fe[_0x512b('0x1b')](_0x2d5ad0)[_0x512b('0x2a')](_0x43bf27);};}exports[_0x512b('0x2b')]=function(_0x4fc4b5,_0x1eca81){var _0xfdda6d={},_0x537615={},_0x589b2e={'count':0x0,'rows':[]};var _0x293c4c=db[_0x512b('0x2c')]['rawAttributes'];_0x537615['model']=_[_0x512b('0x2d')](_0x293c4c);_0x537615[_0x512b('0x2e')]=_['keys'](_0x4fc4b5[_0x512b('0x2e')]);_0x537615[_0x512b('0x2f')]=_[_0x512b('0x30')](_0x537615['model'],_0x537615[_0x512b('0x2e')]);_0xfdda6d[_0x512b('0x31')]=_[_0x512b('0x30')](_0x537615['model'],qs[_0x512b('0x32')](_0x4fc4b5[_0x512b('0x2e')]['fields']));_0xfdda6d[_0x512b('0x31')]=_0xfdda6d[_0x512b('0x31')][_0x512b('0x33')]?_0xfdda6d[_0x512b('0x31')]:_0x537615[_0x512b('0x34')];if(!_0x4fc4b5[_0x512b('0x2e')]['hasOwnProperty']('nolimit')){_0xfdda6d[_0x512b('0x1f')]=qs[_0x512b('0x1f')](_0x4fc4b5[_0x512b('0x2e')]['limit']);_0xfdda6d['offset']=qs[_0x512b('0x1e')](_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x1e')]);}_0xfdda6d['order']=qs['sort'](_0x4fc4b5[_0x512b('0x2e')]['sort']);_0xfdda6d[_0x512b('0x35')]=qs[_0x512b('0x2f')](_[_0x512b('0x36')](_0x4fc4b5[_0x512b('0x2e')],_0x537615['filters']));if(_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x37')]){_0xfdda6d[_0x512b('0x35')]=_[_0x512b('0x38')](_0xfdda6d['where'],{'$or':_['map'](_0x293c4c,function(_0x4fc50f){if(_0x4fc50f[_0x512b('0x39')]['key']!==_0x512b('0x3a')){var _0x437969={};_0x437969[_0x4fc50f[_0x512b('0x3b')]]={'$like':'%'+_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x37')]+'%'};return _0x437969;}})});}_0xfdda6d=_[_0x512b('0x38')]({},_0xfdda6d,_0x4fc4b5['options']);var _0x363fb7={'where':_0xfdda6d['where']};return db[_0x512b('0x2c')]['count'](_0x363fb7)['then'](function(_0x55d24b){_0x589b2e[_0x512b('0x1d')]=_0x55d24b;if(_0x4fc4b5[_0x512b('0x2e')][_0x512b('0x3c')]){_0xfdda6d['include']=[{'all':!![]}];}return db[_0x512b('0x2c')][_0x512b('0x3d')](_0xfdda6d);})[_0x512b('0x26')](function(_0x1d28b2){_0x589b2e[_0x512b('0x3e')]=_0x1d28b2;return _0x589b2e;})[_0x512b('0x26')](respondWithFilteredResult(_0x1eca81,_0xfdda6d))[_0x512b('0x3f')](handleError(_0x1eca81,null));};exports[_0x512b('0x40')]=function(_0x4cb412,_0x416214){var _0x36da59={'raw':!![],'where':{'id':_0x4cb412[_0x512b('0x41')]['id']}},_0x1a0577={};_0x1a0577[_0x512b('0x34')]=_[_0x512b('0x2d')](db[_0x512b('0x2c')][_0x512b('0x42')]);_0x1a0577[_0x512b('0x2e')]=_[_0x512b('0x2d')](_0x4cb412[_0x512b('0x2e')]);_0x1a0577[_0x512b('0x2f')]=_[_0x512b('0x30')](_0x1a0577['model'],_0x1a0577['query']);_0x36da59[_0x512b('0x31')]=_[_0x512b('0x30')](_0x1a0577[_0x512b('0x34')],qs[_0x512b('0x32')](_0x4cb412['query']['fields']));_0x36da59[_0x512b('0x31')]=_0x36da59['attributes']['length']?_0x36da59[_0x512b('0x31')]:_0x1a0577['model'];if(_0x4cb412[_0x512b('0x2e')]['includeAll']){_0x36da59['include']=[{'all':!![]}];}_0x36da59=_[_0x512b('0x38')]({},_0x36da59,_0x4cb412['options']);return db['CmHopperHistory'][_0x512b('0x43')](_0x36da59)[_0x512b('0x26')](handleEntityNotFound(_0x416214,null))[_0x512b('0x26')](respondWithResult(_0x416214,null))[_0x512b('0x3f')](handleError(_0x416214,null));};exports['create']=function(_0x4e4dfe,_0x4a126a){return db[_0x512b('0x2c')]['create'](_0x4e4dfe[_0x512b('0x44')],{})[_0x512b('0x26')](respondWithResult(_0x4a126a,0xc9))[_0x512b('0x3f')](handleError(_0x4a126a,null));};exports[_0x512b('0x45')]=function(_0x3d19fd,_0x2b3955){return db['CmHopperHistory'][_0x512b('0x45')]()[_0x512b('0x26')](respondWithResult(_0x2b3955,null))[_0x512b('0x3f')](handleError(_0x2b3955,null));};exports[_0x512b('0x24')]=function(_0x578103,_0x3e4aac){if(_0x578103[_0x512b('0x44')][_0x512b('0x46')]){delete _0x578103[_0x512b('0x44')]['uniqueid'];}return db[_0x512b('0x2c')][_0x512b('0x43')]({'where':{'uniqueid':_0x578103[_0x512b('0x41')]['id']}})[_0x512b('0x26')](handleEntityNotFound(_0x3e4aac,null))['then'](saveUpdates(_0x578103[_0x512b('0x44')],null))[_0x512b('0x26')](respondWithResult(_0x3e4aac,null))[_0x512b('0x3f')](handleError(_0x3e4aac,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 4b02f8d..9685a21 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 _0x34e8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x178c27,_0x2094e8){var _0x2aa16f=function(_0x267e56){while(--_0x267e56){_0x178c27['push'](_0x178c27['shift']());}};_0x2aa16f(++_0x2094e8);}(_0x34e8,0x12c));var _0x834e=function(_0x2665fb,_0x3ec1c4){_0x2665fb=_0x2665fb-0x0;var _0xe3035b=_0x34e8[_0x2665fb];return _0xe3035b;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var logger=require(_0x834e('0x2'))(_0x834e('0x3'));var moment=require('moment');var BPromise=require(_0x834e('0x4'));var rp=require(_0x834e('0x5'));var fs=require('fs');var path=require(_0x834e('0x6'));var rimraf=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var attributes=require(_0x834e('0x9'));module[_0x834e('0xa')]=function(_0x4a2018,_0x858aa1){return _0x4a2018['define'](_0x834e('0xb'),attributes,{'tableName':_0x834e('0xc'),'paranoid':![],'indexes':[{'name':_0x834e('0xd'),'fields':[_0x834e('0xd')]},{'name':_0x834e('0xe'),'fields':[_0x834e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c44=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperHistory.attributes','define'];(function(_0x3fab58,_0x3b8fad){var _0x401852=function(_0xfacf25){while(--_0xfacf25){_0x3fab58['push'](_0x3fab58['shift']());}};_0x401852(++_0x3b8fad);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x49c4('0x0'))(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var BPromise=require(_0x49c4('0x3'));var rp=require(_0x49c4('0x4'));var fs=require('fs');var path=require(_0x49c4('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x49c4('0x6'));module['exports']=function(_0xc1278f,_0x6030ae){return _0xc1278f[_0x49c4('0x7')](_0x49c4('0x8'),attributes,{'tableName':_0x49c4('0x9'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x49c4('0xa')]},{'name':_0x49c4('0xb'),'fields':[_0x49c4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index b018917..67ef34c 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 _0x3445=['request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','then','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','CmHopperHistory,\x20%s,\x20%s'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x3445,0x13a));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('moment');var BPromise=require('bluebird');var rs=require(_0x5344('0x2'));var fs=require('fs');var Redis=require(_0x5344('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5344('0x4'));var logger=require(_0x5344('0x5'))(_0x5344('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5344('0x7')][_0x5344('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xea8222,_0x3c4589,_0x9f237f){return new BPromise(function(_0xb805dc,_0x530ebb){return client[_0x5344('0x9')](_0xea8222,_0x9f237f)['then'](function(_0x271c86){logger['info'](_0x5344('0xa'),_0x3c4589,_0x5344('0xb'));logger[_0x5344('0xc')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x3c4589,_0x5344('0xb'),JSON[_0x5344('0xd')](_0x271c86));if(_0x271c86[_0x5344('0xe')]){if(_0x271c86[_0x5344('0xe')][_0x5344('0xf')]===0x1f4){logger['error'](_0x5344('0xa'),_0x3c4589,_0x271c86[_0x5344('0xe')][_0x5344('0x10')]);return _0x530ebb(_0x271c86[_0x5344('0xe')]['message']);}logger[_0x5344('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x3c4589,_0x271c86[_0x5344('0xe')][_0x5344('0x10')]);return _0xb805dc(_0x271c86[_0x5344('0xe')]['message']);}else{logger[_0x5344('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x3c4589,_0x5344('0xb'));_0xb805dc(_0x271c86[_0x5344('0x12')][_0x5344('0x10')]);}})[_0x5344('0x13')](function(_0x2b4963){logger[_0x5344('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x3c4589,_0x2b4963);_0x530ebb(_0x2b4963);});});}exports[_0x5344('0x14')]=function(_0x5ee0a3){var _0xd2740c=this;return new Promise(function(_0x193492,_0xf2811d){return db[_0x5344('0x15')]['create'](_0x5ee0a3[_0x5344('0x16')],{'raw':_0x5ee0a3[_0x5344('0x17')]?_0x5ee0a3['options'][_0x5344('0x18')]===undefined?!![]:![]:!![]})[_0x5344('0x19')](function(_0x3418da){logger[_0x5344('0x11')](_0x5344('0x14'),_0x5ee0a3);logger[_0x5344('0xc')](_0x5344('0x14'),_0x5ee0a3,JSON[_0x5344('0xd')](_0x3418da));_0x193492(_0x3418da);})[_0x5344('0x13')](function(_0x1ebec4){logger[_0x5344('0xe')]('CreateCmHopperHistory',_0x1ebec4['message'],_0x5ee0a3);_0xf2811d(_0xd2740c[_0x5344('0xe')](0x1f4,_0x1ebec4[_0x5344('0x10')]));});});};exports['AvgHandleTime']=function(_0x487993){var _0x20472=this;return new Promise(function(_0x20f228,_0x2f000d){return db['CmHopperHistory'][_0x5344('0x1a')]({'raw':_0x487993[_0x5344('0x17')]?_0x487993['options'][_0x5344('0x18')]===undefined?!![]:![]:!![],'where':_0x487993[_0x5344('0x17')]?_0x487993[_0x5344('0x17')][_0x5344('0x1b')]||null:null,'attributes':[[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')][_0x5344('0x1e')]('id')),_0x5344('0x1f')],[db[_0x5344('0x1c')]['fn']('COUNT',db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x21')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x22')))),_0x5344('0x23')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5344('0x24')))),_0x5344('0x25')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x26'),db['sequelize']['fn']('IF',db[_0x5344('0x1c')]['literal'](_0x5344('0x27')))),'predictiveIntervalAvgHoldtime'],[db[_0x5344('0x1c')]['fn'](_0x5344('0x26'),db['sequelize']['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x5344('0x28')]]})['then'](function(_0x217c43){logger[_0x5344('0x11')](_0x5344('0x29'),_0x487993);logger[_0x5344('0xc')](_0x5344('0x29'),_0x487993,JSON[_0x5344('0xd')](_0x217c43));_0x20f228(_0x217c43);})[_0x5344('0x13')](function(_0x1e7070){logger['error'](_0x5344('0x29'),_0x1e7070['message'],_0x487993);_0x2f000d(_0x20472[_0x5344('0xe')](0x1f4,_0x1e7070[_0x5344('0x10')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x35c7d0){var _0x2bb695=this;return new Promise(function(_0x29d396,_0x2eaffa){return db[_0x5344('0x15')][_0x5344('0x1a')]({'raw':_0x35c7d0['options']?_0x35c7d0[_0x5344('0x17')][_0x5344('0x18')]===undefined?!![]:![]:!![],'where':_0x35c7d0[_0x5344('0x17')]?_0x35c7d0[_0x5344('0x17')][_0x5344('0x1b')]||null:null,'attributes':[[_0x5344('0x2a'),_0x5344('0x2b')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db['sequelize'][_0x5344('0x20')](_0x5344('0x2c')))),_0x5344('0x2d')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x21')))),_0x5344('0x2f')],[db[_0x5344('0x1c')]['fn']('COUNT',db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')]('`state`\x20=\x205,\x201,\x20null'))),_0x5344('0x30')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db['sequelize']['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x5344('0x1c')]['fn']('COUNT',db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x31')))),_0x5344('0x32')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x33')))),_0x5344('0x34')],[db['sequelize']['fn']('COUNT',db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),_0x5344('0x35')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x36')))),_0x5344('0x37')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x5344('0x38')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5344('0x39')))),_0x5344('0x3a')],[db['sequelize']['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x3b')))),_0x5344('0x3c')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')][_0x5344('0x20')](_0x5344('0x3d')))),'outboundRejectCallsDay'],[db[_0x5344('0x1c')]['fn']('COUNT',db[_0x5344('0x1c')]['fn']('IF',db[_0x5344('0x1c')]['literal']('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x5344('0x2a')]})[_0x5344('0x19')](function(_0x54d2b0){logger['info'](_0x5344('0x3e'),_0x35c7d0);logger[_0x5344('0xc')](_0x5344('0x3e'),_0x35c7d0,JSON[_0x5344('0xd')](_0x54d2b0));_0x29d396(_0x54d2b0);})[_0x5344('0x13')](function(_0x534b32){logger[_0x5344('0xe')](_0x5344('0x3e'),_0x534b32[_0x5344('0x10')],_0x35c7d0);_0x2eaffa(_0x2bb695['error'](0x1f4,_0x534b32['message']));});});};exports[_0x5344('0x3f')]=function(_0x2e71f4){var _0x37409e=this;return new Promise(function(_0xaae044,_0x52882e){return db[_0x5344('0x15')][_0x5344('0x1a')]({'raw':_0x2e71f4[_0x5344('0x17')]?_0x2e71f4[_0x5344('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e71f4[_0x5344('0x17')]?_0x2e71f4[_0x5344('0x17')][_0x5344('0x1b')]||null:null,'attributes':[[_0x5344('0x2a'),_0x5344('0x2b')],[db[_0x5344('0x1c')]['fn']('COUNT',db['sequelize'][_0x5344('0x1e')]('id')),_0x5344('0x40')],[db[_0x5344('0x1c')]['fn'](_0x5344('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x5344('0x20')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x5344('0x2a')]})[_0x5344('0x19')](function(_0x32cfa4){logger['info'](_0x5344('0x3f'),_0x2e71f4);logger[_0x5344('0xc')]('GetCampaignHopperHistory',_0x2e71f4,JSON[_0x5344('0xd')](_0x32cfa4));_0xaae044(_0x32cfa4);})['catch'](function(_0x56dc43){logger[_0x5344('0xe')](_0x5344('0x3f'),_0x56dc43['message'],_0x2e71f4);_0x52882e(_0x37409e[_0x5344('0xe')](0x1f4,_0x56dc43['message']));});});}; \ No newline at end of file +var _0xd0d5=['jayson/promise','client','http','request','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','then','AvgHandleTime','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2018,\x201,\x20null','outboundAnswerAgiCallsDay','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrAnswerCallsDay','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x414b7b,_0x517446){var _0x25ea89=function(_0x2ac2ea){while(--_0x2ac2ea){_0x414b7b['push'](_0x414b7b['shift']());}};_0x25ea89(++_0x517446);}(_0xd0d5,0x1ed));var _0x5d0d=function(_0x3b1084,_0x3e0063){_0x3b1084=_0x3b1084-0x0;var _0x2d1097=_0xd0d5[_0x3b1084];return _0x2d1097;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d0d('0x0'));var db=require(_0x5d0d('0x1'))['db'];var utils=require(_0x5d0d('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x5d0d('0x3'));var jayson=require(_0x5d0d('0x4'));var client=jayson[_0x5d0d('0x5')][_0x5d0d('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5ace89,_0x36598d,_0xcfec38){return new BPromise(function(_0x11c549,_0x1404bf){return client[_0x5d0d('0x7')](_0x5ace89,_0xcfec38)['then'](function(_0x21a607){logger['info'](_0x5d0d('0x8'),_0x36598d,_0x5d0d('0x9'));logger[_0x5d0d('0xa')](_0x5d0d('0xb'),_0x36598d,_0x5d0d('0x9'),JSON[_0x5d0d('0xc')](_0x21a607));if(_0x21a607[_0x5d0d('0xd')]){if(_0x21a607['error'][_0x5d0d('0xe')]===0x1f4){logger[_0x5d0d('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x36598d,_0x21a607['error'][_0x5d0d('0xf')]);return _0x1404bf(_0x21a607[_0x5d0d('0xd')][_0x5d0d('0xf')]);}logger[_0x5d0d('0xd')](_0x5d0d('0x8'),_0x36598d,_0x21a607[_0x5d0d('0xd')][_0x5d0d('0xf')]);return _0x11c549(_0x21a607[_0x5d0d('0xd')][_0x5d0d('0xf')]);}else{logger[_0x5d0d('0x10')](_0x5d0d('0x8'),_0x36598d,_0x5d0d('0x9'));_0x11c549(_0x21a607[_0x5d0d('0x11')][_0x5d0d('0xf')]);}})['catch'](function(_0x68b55b){logger[_0x5d0d('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x36598d,_0x68b55b);_0x1404bf(_0x68b55b);});});}exports[_0x5d0d('0x12')]=function(_0x4567c6){var _0x286dcb=this;return new Promise(function(_0x1c24cc,_0x161a8e){return db[_0x5d0d('0x13')][_0x5d0d('0x14')](_0x4567c6[_0x5d0d('0x15')],{'raw':_0x4567c6[_0x5d0d('0x16')]?_0x4567c6['options'][_0x5d0d('0x17')]===undefined?!![]:![]:!![]})[_0x5d0d('0x18')](function(_0x29c332){logger['info'](_0x5d0d('0x12'),_0x4567c6);logger[_0x5d0d('0xa')](_0x5d0d('0x12'),_0x4567c6,JSON[_0x5d0d('0xc')](_0x29c332));_0x1c24cc(_0x29c332);})['catch'](function(_0x5a8e73){logger[_0x5d0d('0xd')](_0x5d0d('0x12'),_0x5a8e73['message'],_0x4567c6);_0x161a8e(_0x286dcb[_0x5d0d('0xd')](0x1f4,_0x5a8e73[_0x5d0d('0xf')]));});});};exports[_0x5d0d('0x19')]=function(_0xea36ca){var _0x1d6c1d=this;return new Promise(function(_0x41b525,_0x1ca18f){return db[_0x5d0d('0x13')][_0x5d0d('0x1a')]({'raw':_0xea36ca['options']?_0xea36ca[_0x5d0d('0x16')][_0x5d0d('0x17')]===undefined?!![]:![]:!![],'where':_0xea36ca[_0x5d0d('0x16')]?_0xea36ca[_0x5d0d('0x16')][_0x5d0d('0x1b')]||null:null,'attributes':[[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')][_0x5d0d('0x1e')]('id')),_0x5d0d('0x1f')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x5d0d('0x20')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db['sequelize']['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x22')))),_0x5d0d('0x23')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')]['literal'](_0x5d0d('0x24')))),_0x5d0d('0x25')],[db[_0x5d0d('0x1c')]['fn']('AVG',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x26')))),_0x5d0d('0x27')],[db['sequelize']['fn'](_0x5d0d('0x28'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x29')))),_0x5d0d('0x2a')]]})[_0x5d0d('0x18')](function(_0x2564dd){logger[_0x5d0d('0x10')](_0x5d0d('0x19'),_0xea36ca);logger[_0x5d0d('0xa')](_0x5d0d('0x19'),_0xea36ca,JSON[_0x5d0d('0xc')](_0x2564dd));_0x41b525(_0x2564dd);})[_0x5d0d('0x2b')](function(_0x248202){logger[_0x5d0d('0xd')]('AvgHandleTime',_0x248202[_0x5d0d('0xf')],_0xea36ca);_0x1ca18f(_0x1d6c1d[_0x5d0d('0xd')](0x1f4,_0x248202[_0x5d0d('0xf')]));});});};exports[_0x5d0d('0x2c')]=function(_0x28c9d0){var _0x13fc1e=this;return new Promise(function(_0x185279,_0x83011e){return db[_0x5d0d('0x13')][_0x5d0d('0x1a')]({'raw':_0x28c9d0[_0x5d0d('0x16')]?_0x28c9d0[_0x5d0d('0x16')][_0x5d0d('0x17')]===undefined?!![]:![]:!![],'where':_0x28c9d0['options']?_0x28c9d0[_0x5d0d('0x16')]['where']||null:null,'attributes':[[_0x5d0d('0x2d'),'name'],[db['sequelize']['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize'][_0x5d0d('0x21')](_0x5d0d('0x2e')))),_0x5d0d('0x2f')],[db['sequelize']['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x5d0d('0x30')))),'outboundNoAnswerCallsDay'],[db[_0x5d0d('0x1c')]['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x31')))),_0x5d0d('0x32')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize'][_0x5d0d('0x21')](_0x5d0d('0x33')))),_0x5d0d('0x34')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x35')))),_0x5d0d('0x36')],[db['sequelize']['fn'](_0x5d0d('0x1d'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x5d0d('0x37')))),_0x5d0d('0x38')],[db[_0x5d0d('0x1c')]['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x39')))),_0x5d0d('0x3a')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3b')))),'outboundUnknownCallsDay'],[db[_0x5d0d('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3c')))),_0x5d0d('0x3d')],[db['sequelize']['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3e')))),'outboundOriginateFailureCallsDay'],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')](_0x5d0d('0x3f')))),'outboundRejectCallsDay'],[db[_0x5d0d('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5d0d('0x1c')][_0x5d0d('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x5d0d('0x40')],[db[_0x5d0d('0x1c')]['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db['sequelize'][_0x5d0d('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x5d0d('0x41')],[db['sequelize']['fn']('COUNT',db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')]['literal'](_0x5d0d('0x42')))),_0x5d0d('0x43')]],'group':[_0x5d0d('0x2d')]})['then'](function(_0x44bf4f){logger['info'](_0x5d0d('0x2c'),_0x28c9d0);logger[_0x5d0d('0xa')](_0x5d0d('0x2c'),_0x28c9d0,JSON[_0x5d0d('0xc')](_0x44bf4f));_0x185279(_0x44bf4f);})[_0x5d0d('0x2b')](function(_0x5bd551){logger[_0x5d0d('0xd')](_0x5d0d('0x2c'),_0x5bd551[_0x5d0d('0xf')],_0x28c9d0);_0x83011e(_0x13fc1e[_0x5d0d('0xd')](0x1f4,_0x5bd551[_0x5d0d('0xf')]));});});};exports[_0x5d0d('0x44')]=function(_0xb50a51){var _0x550f33=this;return new Promise(function(_0x279c51,_0x1d77a0){return db[_0x5d0d('0x13')]['findAll']({'raw':_0xb50a51[_0x5d0d('0x16')]?_0xb50a51['options'][_0x5d0d('0x17')]===undefined?!![]:![]:!![],'where':_0xb50a51[_0x5d0d('0x16')]?_0xb50a51[_0x5d0d('0x16')][_0x5d0d('0x1b')]||null:null,'attributes':[[_0x5d0d('0x2d'),_0x5d0d('0x45')],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db['sequelize'][_0x5d0d('0x1e')]('id')),'ivrTotalCallsDays'],[db[_0x5d0d('0x1c')]['fn'](_0x5d0d('0x1d'),db[_0x5d0d('0x1c')]['fn']('IF',db[_0x5d0d('0x1c')]['literal'](_0x5d0d('0x31')))),_0x5d0d('0x46')]],'group':[_0x5d0d('0x2d')]})['then'](function(_0x5e13be){logger[_0x5d0d('0x10')]('GetCampaignHopperHistory',_0xb50a51);logger[_0x5d0d('0xa')](_0x5d0d('0x44'),_0xb50a51,JSON[_0x5d0d('0xc')](_0x5e13be));_0x279c51(_0x5e13be);})[_0x5d0d('0x2b')](function(_0x49da68){logger[_0x5d0d('0xd')]('GetCampaignHopperHistory',_0x49da68[_0x5d0d('0xf')],_0xb50a51);_0x1d77a0(_0x550f33[_0x5d0d('0xd')](0x1f4,_0x49da68[_0x5d0d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index ef89f4d..7080bc0 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 _0x576b=['index','/describe','describe','/:id','show','post','create','update','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated'];(function(_0x8969c2,_0xc524b7){var _0x519f23=function(_0x3d14f6){while(--_0x3d14f6){_0x8969c2['push'](_0x8969c2['shift']());}};_0x519f23(++_0xc524b7);}(_0x576b,0x1d9));var _0xb576=function(_0x50f721,_0x2ab2e2){_0x50f721=_0x50f721-0x0;var _0x58d8f1=_0x576b[_0x50f721];return _0x58d8f1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb576('0x0'));var express=require(_0xb576('0x1'));var router=express['Router']();var auth=require(_0xb576('0x2'));var interaction=require(_0xb576('0x3'));var config=require('../../config/environment');var controller=require(_0xb576('0x4'));router[_0xb576('0x5')]('/',auth[_0xb576('0x6')](),controller[_0xb576('0x7')]);router[_0xb576('0x5')](_0xb576('0x8'),auth[_0xb576('0x6')](),controller[_0xb576('0x9')]);router[_0xb576('0x5')](_0xb576('0xa'),auth[_0xb576('0x6')](),controller[_0xb576('0xb')]);router[_0xb576('0xc')]('/',auth[_0xb576('0x6')](),controller[_0xb576('0xd')]);router['put'](_0xb576('0xa'),auth['isAuthenticated'](),controller[_0xb576('0xe')]);module[_0xb576('0xf')]=router; \ No newline at end of file +var _0x30bc=['/:id','show','create','update','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe'];(function(_0x435d77,_0x3d9a3a){var _0x5b0ffb=function(_0x10c3bc){while(--_0x10c3bc){_0x435d77['push'](_0x435d77['shift']());}};_0x5b0ffb(++_0x3d9a3a);}(_0x30bc,0x149));var _0xc30b=function(_0x1ee04d,_0x4b9f61){_0x1ee04d=_0x1ee04d-0x0;var _0x46a06e=_0x30bc[_0x1ee04d];return _0x46a06e;};'use strict';var multer=require(_0xc30b('0x0'));var util=require(_0xc30b('0x1'));var path=require(_0xc30b('0x2'));var timeout=require('connect-timeout');var express=require(_0xc30b('0x3'));var router=express[_0xc30b('0x4')]();var auth=require(_0xc30b('0x5'));var interaction=require(_0xc30b('0x6'));var config=require(_0xc30b('0x7'));var controller=require(_0xc30b('0x8'));router[_0xc30b('0x9')]('/',auth[_0xc30b('0xa')](),controller[_0xc30b('0xb')]);router[_0xc30b('0x9')]('/describe',auth[_0xc30b('0xa')](),controller[_0xc30b('0xc')]);router[_0xc30b('0x9')](_0xc30b('0xd'),auth['isAuthenticated'](),controller[_0xc30b('0xe')]);router['post']('/',auth[_0xc30b('0xa')](),controller[_0xc30b('0xf')]);router['put']('/:id',auth[_0xc30b('0xa')](),controller[_0xc30b('0x10')]);module[_0xc30b('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 07c783c..1361726 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 _0x2675=['STRING','sequelize'];(function(_0x2a11cb,_0x5d29cc){var _0x54df08=function(_0x4ef7b1){while(--_0x4ef7b1){_0x2a11cb['push'](_0x2a11cb['shift']());}};_0x54df08(++_0x5d29cc);}(_0x2675,0x75));var _0x5267=function(_0x2d7303,_0x398c2d){_0x2d7303=_0x2d7303-0x0;var _0x135013=_0x2675[_0x2d7303];return _0x135013;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5267('0x1')]},'dialPrefix':{'type':Sequelize[_0x5267('0x1')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','name'];(function(_0xd8f524,_0x1ca5de){var _0x3c0354=function(_0x17ff52){while(--_0x17ff52){_0xd8f524['push'](_0xd8f524['shift']());}};_0x3c0354(++_0x1ca5de);}(_0x24ca,0x1bc));var _0xa24c=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x24ca[_0x176317];return _0xef2759;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'unique':_0xa24c('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa24c('0x1')]},'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 0f6446d..257a920 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 _0x9957=['spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./cmList.socket','sendStatus','status','end','json','offset','set','Content-Range','reject','save','then','destroy','Lists','UserProfileResource','error','name','CmList','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','rawAttributes','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','include','removeDispositions','addContacts','CmContact','tags','isArray','push','each','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','nolimit','raw','getContactsCsv','cf_%d','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','download','sequelize','Sequelize','TEXT','type','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','addAgents','omit'];(function(_0x3e86ca,_0x2c4366){var _0x1b0617=function(_0x165be0){while(--_0x165be0){_0x3e86ca['push'](_0x3e86ca['shift']());}};_0x1b0617(++_0x2c4366);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 hardwareService=require(_0x7995('0x15'));var logger=require(_0x7995('0x16'))('api');var utils=require(_0x7995('0x17'));var config=require(_0x7995('0x18'));var db=require('../../mysqldb')['db'];config[_0x7995('0x19')]=_[_0x7995('0x1a')](config[_0x7995('0x19')],{'host':_0x7995('0x1b'),'port':0x18eb});var socket=require(_0x7995('0x1c'))(new Redis(config[_0x7995('0x19')]));require(_0x7995('0x1d'))['register'](socket);function respondWithStatusCode(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xcc;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1e')](_0x2b4e94);}return _0x58f5ad[_0x7995('0x1f')](_0x2b4e94)[_0x7995('0x20')]();};}function respondWithResult(_0x1a5310,_0x2202ce){_0x2202ce=_0x2202ce||0xc8;return function(_0x41cbf0){if(_0x41cbf0){return _0x1a5310['status'](_0x2202ce)[_0x7995('0x21')](_0x41cbf0);}};}function respondWithFilteredResult(_0x565d97,_0x2f832e){return function(_0x37f297){if(_0x37f297){var _0x43d4b8=_0x37f297['count'],_0x291317=_0x2f832e['offset'],_0x1e1415=_0x2f832e[_0x7995('0x22')]+_0x2f832e['limit'],_0x37a7d4;if(_0x1e1415>=_0x43d4b8){_0x1e1415=_0x43d4b8;_0x37a7d4=0xc8;}else{_0x37a7d4=0xce;}_0x565d97['status'](_0x37a7d4);return _0x565d97[_0x7995('0x23')](_0x7995('0x24'),_0x291317+'-'+_0x1e1415+'/'+_0x43d4b8)['json'](_0x37f297);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x25')](_0x3e4c54);}return _0x51f276[_0x7995('0x26')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x27')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x28')]()[_0x7995('0x27')](function(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x29');return db[_0x7995('0x2a')][_0x7995('0x28')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x27')](function(){return _0x563799;});})[_0x7995('0x27')](function(){_0x204507['status'](0xcc)[_0x7995('0x20')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1e')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1f')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=db[_0x7995('0x2d')]['rawAttributes'];_0x327a81['model']=_[_0x7995('0x2e')](_0x2e3493);_0x327a81['query']=_[_0x7995('0x2e')](_0x48e573[_0x7995('0x2f')]);_0x327a81[_0x7995('0x30')]=_[_0x7995('0x31')](_0x327a81[_0x7995('0x32')],_0x327a81['query']);_0xe6b0b3[_0x7995('0x33')]=_[_0x7995('0x31')](_0x327a81['model'],qs['fields'](_0x48e573['query'][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes'][_0x7995('0x35')]?_0xe6b0b3['attributes']:_0x327a81[_0x7995('0x32')];if(!_0x48e573[_0x7995('0x2f')][_0x7995('0x36')]('nolimit')){_0xe6b0b3['limit']=qs[_0x7995('0x37')](_0x48e573['query']['limit']);_0xe6b0b3[_0x7995('0x22')]=qs[_0x7995('0x22')](_0x48e573['query'][_0x7995('0x22')]);}_0xe6b0b3[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x48e573[_0x7995('0x2f')][_0x7995('0x39')]);_0xe6b0b3['where']=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x48e573[_0x7995('0x2f')],_0x327a81[_0x7995('0x30')]));if(_0x48e573['query'][_0x7995('0x3b')]){_0xe6b0b3[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0xe6b0b3[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x2e3493,function(_0x1035dc){if(_0x1035dc['type'][_0x7995('0x3f')]!==_0x7995('0x40')){var _0x8a1be0={};_0x8a1be0[_0x1035dc[_0x7995('0x41')]]={'$like':'%'+_0x48e573[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x8a1be0;}})});}_0xe6b0b3=_[_0x7995('0x3d')]({},_0xe6b0b3,_0x48e573[_0x7995('0x42')]);var _0x1234e1={'where':_0xe6b0b3[_0x7995('0x3c')]};return db[_0x7995('0x2d')][_0x7995('0x43')](_0x1234e1)[_0x7995('0x27')](function(_0x53cda2){_0x2b874d['count']=_0x53cda2;if(_0x48e573[_0x7995('0x2f')][_0x7995('0x44')]){_0xe6b0b3['include']=[{'all':!![]}];}return db['CmList'][_0x7995('0x45')](_0xe6b0b3);})['then'](function(_0x504a33){_0x2b874d[_0x7995('0x46')]=_0x504a33;return _0x2b874d;})[_0x7995('0x27')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))[_0x7995('0x47')](handleError(_0x3573be,null));};exports['show']=function(_0x46ac4f,_0x5e85b9){var _0x3993b5={'raw':![],'where':{'id':_0x46ac4f['params']['id']}},_0x5a8881={};_0x5a8881[_0x7995('0x32')]=_[_0x7995('0x2e')](db[_0x7995('0x2d')][_0x7995('0x48')]);_0x5a8881['query']=_[_0x7995('0x2e')](_0x46ac4f[_0x7995('0x2f')]);_0x5a8881[_0x7995('0x30')]=_[_0x7995('0x31')](_0x5a8881['model'],_0x5a8881['query']);_0x3993b5[_0x7995('0x33')]=_['intersection'](_0x5a8881[_0x7995('0x32')],qs['fields'](_0x46ac4f[_0x7995('0x2f')]['fields']));_0x3993b5[_0x7995('0x33')]=_0x3993b5[_0x7995('0x33')]['length']?_0x3993b5[_0x7995('0x33')]:_0x5a8881[_0x7995('0x32')];if(_0x46ac4f[_0x7995('0x2f')][_0x7995('0x44')]){_0x3993b5['include']=[{'all':!![]}];}_0x3993b5=_[_0x7995('0x3d')]({},_0x3993b5,_0x46ac4f[_0x7995('0x42')]);return db[_0x7995('0x2d')]['find'](_0x3993b5)[_0x7995('0x27')](handleEntityNotFound(_0x5e85b9,null))[_0x7995('0x27')](respondWithResult(_0x5e85b9,null))[_0x7995('0x47')](handleError(_0x5e85b9,null));};exports[_0x7995('0x49')]=function(_0x255313,_0x51934b){return db[_0x7995('0x2d')][_0x7995('0x49')](_0x255313['body'],{})[_0x7995('0x27')](function(_0x5843ba){var _0x1d87f9=_0x255313[_0x7995('0x4a')][_0x7995('0x4b')]({'plain':!![]});if(!_0x1d87f9)throw new Error(_0x7995('0x4c'));if(_0x1d87f9[_0x7995('0x4d')]===_0x7995('0x4a')){var _0x1579b9=_0x5843ba['get']({'plain':!![]});var _0x427dcf=_0x7995('0x29');return db[_0x7995('0x4e')]['find']({'where':{'name':_0x427dcf,'userProfileId':_0x1d87f9[_0x7995('0x4f')]},'raw':!![]})[_0x7995('0x27')](function(_0x12d4b8){if(_0x12d4b8&&_0x12d4b8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1579b9[_0x7995('0x2c')],'resourceId':_0x1579b9['id'],'type':_0x12d4b8[_0x7995('0x2c')],'sectionId':_0x12d4b8['id']},{})['then'](function(){return _0x5843ba;});}else{return _0x5843ba;}})[_0x7995('0x47')](function(_0x29f300){logger[_0x7995('0x2b')](_0x7995('0x50'),_0x29f300);throw _0x29f300;});}return _0x5843ba;})[_0x7995('0x27')](respondWithResult(_0x51934b,0xc9))['catch'](handleError(_0x51934b,null));};exports[_0x7995('0x51')]=function(_0x4ab09f,_0x14fe7f){if(_0x4ab09f[_0x7995('0x52')]['id']){delete _0x4ab09f[_0x7995('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x4ab09f['params']['id']}})['then'](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x27')](saveUpdates(_0x4ab09f[_0x7995('0x52')],null))[_0x7995('0x27')](respondWithResult(_0x14fe7f,null))[_0x7995('0x47')](handleError(_0x14fe7f,null));};exports[_0x7995('0x28')]=function(_0x357e60,_0x1f4270){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x357e60[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x1f4270,null))[_0x7995('0x27')](removeEntity(_0x1f4270,null))[_0x7995('0x47')](handleError(_0x1f4270,null));};exports[_0x7995('0x55')]=function(_0x1ea1dc,_0x416133){return db[_0x7995('0x2d')][_0x7995('0x55')]()[_0x7995('0x27')](respondWithResult(_0x416133,null))['catch'](handleError(_0x416133,null));};exports[_0x7995('0x56')]=function(_0x630737,_0x3b8a54,_0x32c0d3){if(_0x630737['body']['id']){delete _0x630737['body']['id'];}return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x630737[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x3b8a54,null))['then'](function(_0x13cd7b){if(_0x13cd7b){_0x630737[_0x7995('0x52')][_0x7995('0x57')]=_0x13cd7b['id'];return db[_0x7995('0x58')]['create'](_0x630737['body']);}})[_0x7995('0x27')](respondWithResult(_0x3b8a54,null))[_0x7995('0x47')](handleError(_0x3b8a54,null));};exports[_0x7995('0x59')]=function(_0x1d69ce,_0x37072,_0x27c5cd){var _0x1d4689={'raw':![],'where':{}};var _0x1e2206={};var _0x984c23={'count':0x0,'rows':[]};return db['CmList'][_0x7995('0x5a')]({'where':{'id':_0x1d69ce[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x37072,null))[_0x7995('0x27')](function(_0x59c5aa){if(_0x59c5aa){_0x1e2206['model']=_[_0x7995('0x2e')](db[_0x7995('0x58')]['rawAttributes']);_0x1e2206[_0x7995('0x2f')]=_[_0x7995('0x2e')](_0x1d69ce[_0x7995('0x2f')]);_0x1e2206[_0x7995('0x30')]=_[_0x7995('0x31')](_0x1e2206['model'],_0x1e2206[_0x7995('0x2f')]);_0x1d4689['attributes']=_[_0x7995('0x31')](_0x1e2206[_0x7995('0x32')],qs[_0x7995('0x34')](_0x1d69ce[_0x7995('0x2f')][_0x7995('0x34')]));_0x1d4689[_0x7995('0x33')]=_0x1d4689[_0x7995('0x33')][_0x7995('0x35')]?_0x1d4689[_0x7995('0x33')]:_0x1e2206[_0x7995('0x32')];if(!_0x1d69ce[_0x7995('0x2f')][_0x7995('0x36')]('nolimit')){_0x1d4689[_0x7995('0x37')]=qs[_0x7995('0x37')](_0x1d69ce[_0x7995('0x2f')][_0x7995('0x37')]);_0x1d4689[_0x7995('0x22')]=qs['offset'](_0x1d69ce['query'][_0x7995('0x22')]);}_0x1d4689[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x1d69ce[_0x7995('0x2f')]['sort']);_0x1d4689[_0x7995('0x3c')]=qs['filters'](_['pick'](_0x1d69ce[_0x7995('0x2f')],_0x1e2206[_0x7995('0x30')]));_0x1d4689[_0x7995('0x3c')][_0x7995('0x57')]=_0x59c5aa['id'];if(_0x1d69ce[_0x7995('0x2f')][_0x7995('0x3b')]){_0x1d4689[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x1d4689[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x1d4689['attributes'],function(_0x2dc1f7){var _0x8908cd={};_0x8908cd[_0x2dc1f7]={'$like':'%'+_0x1d69ce[_0x7995('0x2f')]['filter']+'%'};return _0x8908cd;})});}_0x1d4689=_[_0x7995('0x3d')]({},_0x1d4689,_0x1d69ce[_0x7995('0x42')]);return db[_0x7995('0x58')][_0x7995('0x43')]({'where':_0x1d4689[_0x7995('0x3c')]})[_0x7995('0x27')](function(_0x550a10){_0x984c23[_0x7995('0x43')]=_0x550a10;if(_0x1d69ce[_0x7995('0x2f')][_0x7995('0x44')]){_0x1d4689[_0x7995('0x5b')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x1d4689);})[_0x7995('0x27')](function(_0xfe1105){_0x984c23[_0x7995('0x46')]=_0xfe1105;return _0x984c23;});}})[_0x7995('0x27')](respondWithFilteredResult(_0x37072,_0x1d4689))['catch'](handleError(_0x37072,null));};exports[_0x7995('0x5c')]=function(_0x2c9eb6,_0x54b955,_0x480fdb){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x2c9eb6['params']['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x54b955,null))['then'](function(_0x3758f9){if(_0x3758f9){return _0x3758f9[_0x7995('0x5c')](_0x2c9eb6['query']['ids']);}})[_0x7995('0x27')](respondWithStatusCode(_0x54b955,null))['catch'](handleError(_0x54b955,null));};exports[_0x7995('0x5d')]=function(_0xa41fff,_0x3dd197,_0x45bd8a){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0xa41fff[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x3dd197,null))[_0x7995('0x27')](function(_0x117317){if(_0x117317){var _0x1ab590=[];var _0x16108c={'success':[],'errors':[]};return db[_0x7995('0x5e')][_0x7995('0x55')]()[_0x7995('0x27')](function(_0x3773de){if(_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]&&_[_0x7995('0x60')](_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')])){if(_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')][_0x7995('0x35')]){_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]=_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]['join'](';')+';';}else{_0xa41fff[_0x7995('0x52')][_0x7995('0x5f')]=null;}}else{_0xa41fff['body']['tags']=null;}if(_0xa41fff[_0x7995('0x52')]&&_[_0x7995('0x60')](_0xa41fff[_0x7995('0x52')])){for(var _0x38acda=0x0;_0x38acda<_0xa41fff[_0x7995('0x52')][_0x7995('0x35')];_0x38acda+=0x1){_0xa41fff['body'][_0x38acda][_0x7995('0x57')]=_0xa41fff[_0x7995('0x54')]['id'];_0x1ab590[_0x7995('0x61')](_0xa41fff[_0x7995('0x52')][_0x38acda]);}return BPromise[_0x7995('0x62')](_0x1ab590,function(_0x3f0bff){return db[_0x7995('0x5e')][_0x7995('0x49')](_['omit'](_0x3f0bff,[_0x7995('0x63'),'id'])||{},{'fields':_[_0x7995('0x2e')](_0x3773de),'raw':!![]})['then'](function(_0x479271){_0x16108c[_0x7995('0x64')][_0x7995('0x61')](_0x479271[_0x7995('0x65')]);})[_0x7995('0x47')](function(_0xe42797){_0x16108c['errors'][_0x7995('0x61')]({'data':_0x3f0bff,'error':_0xe42797[_0x7995('0x66')]});});})['then'](function(_0x209977){return _0x16108c;})[_0x7995('0x47')](function(_0x489bac){return _0x489bac;});}else{_0x3dd197[_0x7995('0x1f')](0x190)['json']({'message':_0x7995('0x67')});}});}})[_0x7995('0x27')](respondWithResult(_0x3dd197,null))[_0x7995('0x47')](handleError(_0x3dd197,null));};exports[_0x7995('0x68')]=function(_0x460fa6,_0x5d16da,_0x1f0506){var _0x345080;return db[_0x7995('0x2d')]['find']({'where':{'id':_0x460fa6[_0x7995('0x54')]['id']},'include':[{'model':db[_0x7995('0x69')],'as':_0x7995('0x6a')}]})[_0x7995('0x27')](handleEntityNotFound(_0x5d16da,null))['then'](function(_0x3356fd){if(_0x3356fd){_0x345080=_0x3356fd;return db[_0x7995('0x5e')][_0x7995('0x48')];}})['then'](function(_0x5358d4){if(_0x5358d4){var _0x3fc10={};var _0x333379={};_0x333379['model']=_['concat'](_[_0x7995('0x2e')](_0x5358d4),_[_0x7995('0x3e')](_0x345080[_0x7995('0x6a')],function(_0x2384c1){return util[_0x7995('0x6b')]('cf_%d',_0x2384c1['id']);}));_0x333379['query']=_[_0x7995('0x2e')](_0x460fa6['query']);_0x333379['filters']=_[_0x7995('0x31')](_0x333379[_0x7995('0x32')],_0x333379[_0x7995('0x2f')]);_0x3fc10['attributes']=_[_0x7995('0x31')](_0x333379[_0x7995('0x32')],qs[_0x7995('0x34')](_0x460fa6[_0x7995('0x2f')][_0x7995('0x34')]));_0x3fc10['attributes']=_0x3fc10[_0x7995('0x33')][_0x7995('0x35')]?_0x3fc10[_0x7995('0x33')]:_0x333379[_0x7995('0x32')];if(!_0x460fa6['query'][_0x7995('0x36')](_0x7995('0x6c'))){_0x3fc10['limit']=qs[_0x7995('0x37')](_0x460fa6[_0x7995('0x2f')]['limit']);_0x3fc10[_0x7995('0x22')]=qs['offset'](_0x460fa6[_0x7995('0x2f')]['offset']);}_0x3fc10[_0x7995('0x38')]=qs['sort'](_0x460fa6[_0x7995('0x2f')][_0x7995('0x39')]);_0x3fc10['where']=qs[_0x7995('0x30')](_['pick'](_0x460fa6['query'],_0x333379[_0x7995('0x30')]));_0x3fc10[_0x7995('0x6d')]=!![];if(_0x460fa6[_0x7995('0x2f')][_0x7995('0x3b')]){_0x3fc10['where']=_[_0x7995('0x3d')](_0x3fc10[_0x7995('0x3c')],{'$or':_['map'](_0x3fc10['attributes'],function(_0xc2648d){var _0x4c8033={};_0x4c8033[_0xc2648d]={'$like':'%'+_0x460fa6[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x4c8033;})});}_0x3fc10=_[_0x7995('0x3d')]({},_0x3fc10,_0x460fa6['options']);return _0x345080['getContacts'](_0x3fc10);}})[_0x7995('0x27')](respondWithResult(_0x5d16da,null))['catch'](handleError(_0x5d16da,null));};exports[_0x7995('0x6e')]=function(_0x44891e,_0x14449c,_0x38bd35){var _0x4ff5e7;return db['CmList']['find']({'where':{'id':_0x44891e[_0x7995('0x54')]['id']},'include':[{'model':db[_0x7995('0x69')],'as':_0x7995('0x6a')}]})[_0x7995('0x27')](handleEntityNotFound(_0x14449c,null))[_0x7995('0x27')](function(_0x168e7f){if(_0x168e7f){_0x4ff5e7=_0x168e7f;return db['CmContact']['rawAttributes'];}})[_0x7995('0x27')](function(_0x5254e4){if(_0x5254e4){var _0x4cfd78={};var _0x17d00f={};_0x17d00f['model']=_['concat'](_[_0x7995('0x2e')](_0x5254e4),_[_0x7995('0x3e')](_0x4ff5e7[_0x7995('0x6a')],function(_0x5cef2e){return util[_0x7995('0x6b')](_0x7995('0x6f'),_0x5cef2e['id']);}));_0x17d00f[_0x7995('0x2f')]=_[_0x7995('0x2e')](_0x44891e[_0x7995('0x2f')]);_0x17d00f[_0x7995('0x30')]=_[_0x7995('0x31')](_0x17d00f[_0x7995('0x32')],_0x17d00f[_0x7995('0x2f')]);_0x4cfd78['attributes']=_[_0x7995('0x31')](_0x17d00f[_0x7995('0x32')],qs[_0x7995('0x34')](_0x44891e[_0x7995('0x2f')][_0x7995('0x34')]));_0x4cfd78['attributes']=_0x4cfd78[_0x7995('0x33')][_0x7995('0x35')]?_0x4cfd78[_0x7995('0x33')]:_0x17d00f['model'];if(!_0x44891e['query']['hasOwnProperty'](_0x7995('0x6c'))){_0x4cfd78[_0x7995('0x37')]=qs[_0x7995('0x37')](_0x44891e[_0x7995('0x2f')][_0x7995('0x37')]);_0x4cfd78[_0x7995('0x22')]=qs['offset'](_0x44891e[_0x7995('0x2f')]['offset']);}_0x4cfd78[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x44891e[_0x7995('0x2f')][_0x7995('0x39')]);_0x4cfd78[_0x7995('0x3c')]=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x44891e[_0x7995('0x2f')],_0x17d00f[_0x7995('0x30')]));_0x4cfd78[_0x7995('0x6d')]=!![];if(_0x44891e[_0x7995('0x2f')]['filter']){_0x4cfd78[_0x7995('0x3c')]=_['merge'](_0x4cfd78[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x4cfd78['attributes'],function(_0x493e74){var _0x2a25eb={};_0x2a25eb[_0x493e74]={'$like':'%'+_0x44891e[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x2a25eb;})});}_0x4cfd78=_[_0x7995('0x3d')]({},_0x4cfd78,_0x44891e[_0x7995('0x42')]);return _0x4ff5e7[_0x7995('0x68')](_0x4cfd78);}})[_0x7995('0x27')](function(_0x3a29b8){if(!_[_0x7995('0x70')](_0x3a29b8)){var _0x3c9b3c=toCsv(_0x3a29b8);var _0x2b9ade=Date[_0x7995('0x71')]();fs['writeFileSync'](util['format'](_0x7995('0x72'),_0x4ff5e7['id'],_0x2b9ade),_0x3c9b3c);_0x14449c[_0x7995('0x73')](_0x7995('0x74'),_0x7995('0x75')+util[_0x7995('0x6b')]('list_%d_%s.csv',_0x4ff5e7['id'],_0x2b9ade));_0x14449c[_0x7995('0x73')](_0x7995('0x76'),'text/csv');return _0x14449c[_0x7995('0x77')](util['format'](_0x7995('0x72'),_0x4ff5e7['id'],_0x2b9ade));}else{return _0x14449c[_0x7995('0x1e')](0xcc);}})[_0x7995('0x47')](handleError(_0x14449c,null));};exports['addCustomField']=function(_0x3501ac,_0x1cd9a0,_0x29dcaf){var _0x15ca94;delete _0x3501ac[_0x7995('0x52')]['id'];return db[_0x7995('0x2d')][_0x7995('0x5a')]({'where':{'id':_0x3501ac['params']['id']}})['then'](handleEntityNotFound(_0x1cd9a0,null))['then'](function(_0x406f82){if(_0x406f82){return db[_0x7995('0x78')]['transaction'](function(_0x4eb988){return db[_0x7995('0x69')][_0x7995('0x49')](_0x3501ac['body'],{'transaction':_0x4eb988})['then'](function(_0x538bd3){_0x15ca94=_0x538bd3;return _0x406f82['addCustomFields'](_0x538bd3,{'transaction':_0x4eb988});})[_0x7995('0x27')](function(){var _0x15ae93={'type':db[_0x7995('0x79')][_0x7995('0x7a')],'transaction':_0x4eb988};switch(_0x3501ac['body'][_0x7995('0x7b')]){case _0x7995('0x7c'):_0x15ae93['type']=db[_0x7995('0x79')][_0x7995('0x7a')];break;case _0x7995('0x7d'):_0x15ae93['type']=db[_0x7995('0x79')][_0x7995('0x7e')];break;case'switch':_0x15ae93[_0x7995('0x7b')]=db[_0x7995('0x79')][_0x7995('0x7f')];_0x15ae93[_0x7995('0x80')]=![];break;default:}return db[_0x7995('0x78')][_0x7995('0x81')][_0x7995('0x82')](_0x7995('0x83'),util[_0x7995('0x6b')](_0x7995('0x84'),_0x15ca94['id']),_0x15ae93);})[_0x7995('0x27')](function(){return _0x15ca94;});});}})[_0x7995('0x27')](respondWithResult(_0x1cd9a0,null))[_0x7995('0x47')](handleError(_0x1cd9a0,null));};exports['getCustomFields']=function(_0x154eff,_0x5f1ff2,_0x3603e8){var _0x3c551f={};var _0x59e356={};var _0x354058;var _0x2e6f4e;return db[_0x7995('0x2d')]['findOne']({'where':{'id':_0x154eff[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x5f1ff2,null))[_0x7995('0x27')](function(_0x413c96){if(_0x413c96){_0x354058=_0x413c96;_0x59e356[_0x7995('0x32')]=_[_0x7995('0x2e')](db[_0x7995('0x69')]['rawAttributes']);_0x59e356[_0x7995('0x2f')]=_['keys'](_0x154eff[_0x7995('0x2f')]);_0x59e356[_0x7995('0x30')]=_[_0x7995('0x31')](_0x59e356['model'],_0x59e356[_0x7995('0x2f')]);_0x3c551f['attributes']=_['intersection'](_0x59e356['model'],qs['fields'](_0x154eff[_0x7995('0x2f')][_0x7995('0x34')]));_0x3c551f['attributes']=_0x3c551f[_0x7995('0x33')][_0x7995('0x35')]?_0x3c551f['attributes']:_0x59e356[_0x7995('0x32')];_0x3c551f[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x154eff[_0x7995('0x2f')][_0x7995('0x39')]);_0x3c551f['where']=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x154eff[_0x7995('0x2f')],_0x59e356[_0x7995('0x30')]));_0x3c551f['where']=_[_0x7995('0x3d')](_0x3c551f[_0x7995('0x3c')],{'$or':[{'ListId':_0x413c96['id']},{'ListId':null}]});if(_0x154eff[_0x7995('0x2f')][_0x7995('0x3b')]){_0x3c551f[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x3c551f[_0x7995('0x3c')],{'$or':_[_0x7995('0x3e')](_0x3c551f[_0x7995('0x33')],function(_0x1fda95){var _0x5e08fa={};_0x5e08fa[_0x1fda95]={'$like':'%'+_0x154eff[_0x7995('0x2f')]['filter']+'%'};return _0x5e08fa;})});}_0x3c551f=_[_0x7995('0x3d')]({},_0x3c551f,_0x154eff[_0x7995('0x42')]);return db[_0x7995('0x69')]['findAndCountAll'](_0x3c551f);}})['then'](respondWithResult(_0x5f1ff2,null))[_0x7995('0x47')](handleError(_0x5f1ff2,null));};exports[_0x7995('0x85')]=function(_0x4c7dc8,_0x15ed0f,_0x5f1abc){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x4c7dc8[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x15ed0f,null))['then'](function(_0x4c090a){if(_0x4c090a){return _0x4c090a[_0x7995('0x85')](_0x4c7dc8[_0x7995('0x52')][_0x7995('0x63')],_[_0x7995('0x86')](_0x4c7dc8['body'],[_0x7995('0x63'),'id'])||{})[_0x7995('0x87')](function(_0x8b820b){for(var _0x241427=0x0;_0x241427<_0x4c7dc8[_0x7995('0x52')]['ids']['length'];_0x241427+=0x1){socket['emit'](_0x7995('0x88'),{'UserId':_0x4c7dc8[_0x7995('0x52')]['ids'][_0x241427],'CmListId':_0x4c7dc8[_0x7995('0x54')]['id']});}return _0x8b820b;});}})['then'](respondWithResult(_0x15ed0f,null))[_0x7995('0x47')](handleError(_0x15ed0f,null));};exports[_0x7995('0x89')]=function(_0x1e7398,_0x467913,_0x4f145e){return db[_0x7995('0x2d')][_0x7995('0x53')]({'where':{'id':_0x1e7398[_0x7995('0x54')]['id']}})[_0x7995('0x27')](handleEntityNotFound(_0x467913,null))[_0x7995('0x27')](function(_0x197adc){if(_0x197adc){return _0x197adc[_0x7995('0x89')](_0x1e7398[_0x7995('0x2f')][_0x7995('0x63')])[_0x7995('0x27')](function(){if(_[_0x7995('0x60')](_0x1e7398[_0x7995('0x2f')][_0x7995('0x63')])){for(var _0x2122af=0x0;_0x2122af<_0x1e7398['query'][_0x7995('0x63')]['length'];_0x2122af+=0x1){socket[_0x7995('0x8a')](_0x7995('0x8b'),{'UserId':Number(_0x1e7398['query'][_0x7995('0x63')][_0x2122af]),'CmListId':Number(_0x1e7398['params']['id'])});}}else{socket[_0x7995('0x8a')](_0x7995('0x8b'),{'UserId':Number(_0x1e7398['query']['ids']),'CmListId':Number(_0x1e7398['params']['id'])});}});}})[_0x7995('0x27')](respondWithStatusCode(_0x467913,null))[_0x7995('0x47')](handleError(_0x467913,null));};exports[_0x7995('0x8c')]=function(_0x2b7bc2,_0x566b48,_0x1ce3ff){var _0x2b2814={};var _0xc81297={};var _0x2de960;var _0x29c109;return db[_0x7995('0x2d')][_0x7995('0x5a')]({'where':{'id':_0x2b7bc2[_0x7995('0x54')]['id']}})['then'](handleEntityNotFound(_0x566b48,null))[_0x7995('0x27')](function(_0x5e12c4){if(_0x5e12c4){_0x2de960=_0x5e12c4;_0xc81297[_0x7995('0x32')]=_[_0x7995('0x2e')](db['User'][_0x7995('0x48')]);_0xc81297[_0x7995('0x2f')]=_[_0x7995('0x2e')](_0x2b7bc2[_0x7995('0x2f')]);_0xc81297[_0x7995('0x30')]=_[_0x7995('0x31')](_0xc81297['model'],_0xc81297[_0x7995('0x2f')]);_0x2b2814[_0x7995('0x33')]=_[_0x7995('0x31')](_0xc81297[_0x7995('0x32')],qs[_0x7995('0x34')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x34')]));_0x2b2814[_0x7995('0x33')]=_0x2b2814[_0x7995('0x33')][_0x7995('0x35')]?_0x2b2814[_0x7995('0x33')]:_0xc81297[_0x7995('0x32')];_0x2b2814[_0x7995('0x38')]=qs[_0x7995('0x39')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x39')]);_0x2b2814[_0x7995('0x3c')]=qs[_0x7995('0x30')](_[_0x7995('0x3a')](_0x2b7bc2[_0x7995('0x2f')],_0xc81297[_0x7995('0x30')]));if(_0x2b7bc2['query']['filter']){_0x2b2814[_0x7995('0x3c')]=_[_0x7995('0x3d')](_0x2b2814['where'],{'$or':_[_0x7995('0x3e')](_0x2b2814['attributes'],function(_0x2ce103){var _0x4b360b={};_0x4b360b[_0x2ce103]={'$like':'%'+_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x3b')]+'%'};return _0x4b360b;})});}_0x2b2814=_[_0x7995('0x3d')]({},_0x2b2814,_0x2b7bc2[_0x7995('0x42')]);return _0x2de960[_0x7995('0x8c')](_0x2b2814);}})[_0x7995('0x27')](function(_0xd82313){if(_0xd82313){_0x29c109=_0xd82313[_0x7995('0x35')];if(!_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x36')]('nolimit')){_0x2b2814[_0x7995('0x37')]=qs[_0x7995('0x37')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x37')]);_0x2b2814['offset']=qs[_0x7995('0x22')](_0x2b7bc2[_0x7995('0x2f')][_0x7995('0x22')]);}return _0x2de960[_0x7995('0x8c')](_0x2b2814);}})['then'](function(_0x32c550){if(_0x32c550){return _0x32c550?{'count':_0x29c109,'rows':_0x32c550}:null;}})[_0x7995('0x27')](respondWithResult(_0x566b48,null))[_0x7995('0x47')](handleError(_0x566b48,null));}; \ No newline at end of file +var _0x54ef=['to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./cmList.socket','register','sendStatus','status','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','CmList','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','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','ListId','findOne','Disposition','nolimit','map','rows','removeDispositions','ids','isArray','tags','join','push','each','CmContact','omit','dataValues','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','hasOwnProperty','raw','getContacts','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','userCmList:save','emit','userCmList:remove','User','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x198365,_0x5bfb09){var _0x5054bd=function(_0x5667ec){while(--_0x5667ec){_0x198365['push'](_0x198365['shift']());}};_0x5054bd(++_0x5bfb09);}(_0x54ef,0x112));var _0xf54e=function(_0x3ba785,_0x5ded3e){_0x3ba785=_0x3ba785-0x0;var _0x7e585=_0x54ef[_0x3ba785];return _0x7e585;};'use strict';var pdf=require(_0xf54e('0x0'));var emlformat=require(_0xf54e('0x1'));var rimraf=require(_0xf54e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf54e('0x3'));var rp=require(_0xf54e('0x4'));var moment=require(_0xf54e('0x5'));var BPromise=require(_0xf54e('0x6'));var Mustache=require(_0xf54e('0x7'));var util=require(_0xf54e('0x8'));var path=require(_0xf54e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf54e('0xa'));var fs=require('fs');var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var hardwareService=require(_0xf54e('0x13'));var logger=require('../../config/logger')(_0xf54e('0x14'));var utils=require(_0xf54e('0x15'));var config=require(_0xf54e('0x16'));var db=require(_0xf54e('0x17'))['db'];config['redis']=_[_0xf54e('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf54e('0x19'))(new Redis(config[_0xf54e('0x1a')]));require(_0xf54e('0x1b'))[_0xf54e('0x1c')](socket);function respondWithStatusCode(_0x5644aa,_0x331732){_0x331732=_0x331732||0xcc;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1d')](_0x331732);}return _0x5644aa[_0xf54e('0x1e')](_0x331732)['end']();};}function respondWithResult(_0x2366ee,_0x389abc){_0x389abc=_0x389abc||0xc8;return function(_0x3eb415){if(_0x3eb415){return _0x2366ee['status'](_0x389abc)['json'](_0x3eb415);}};}function respondWithFilteredResult(_0xd87020,_0x41fb35){return function(_0x1c02e7){if(_0x1c02e7){var _0x9647f=_0x1c02e7[_0xf54e('0x1f')],_0x15cc48=_0x41fb35[_0xf54e('0x20')],_0x3e7d96=_0x41fb35[_0xf54e('0x20')]+_0x41fb35[_0xf54e('0x21')],_0x2e27b6;if(_0x3e7d96>=_0x9647f){_0x3e7d96=_0x9647f;_0x2e27b6=0xc8;}else{_0x2e27b6=0xce;}_0xd87020['status'](_0x2e27b6);return _0xd87020['set'](_0xf54e('0x22'),_0x15cc48+'-'+_0x3e7d96+'/'+_0x9647f)['json'](_0x1c02e7);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x23')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x24')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x25')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x26')](_0x388aa0)[_0xf54e('0x27')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x28')]()[_0xf54e('0x27')](function(){var _0x474b61=_0x264a8f[_0xf54e('0x29')]({'plain':!![]});var _0x160160=_0xf54e('0x2a');return db[_0xf54e('0x2b')][_0xf54e('0x28')]({'where':{'type':_0x160160,'resourceId':_0x474b61['id']}})[_0xf54e('0x27')](function(){return _0x264a8f;});})[_0xf54e('0x27')](function(){_0x6f6d29[_0xf54e('0x1e')](0xcc)[_0xf54e('0x2c')]();});}};}function handleEntityNotFound(_0x5390b8,_0xb3706e){return function(_0x4cbf7c){if(!_0x4cbf7c){_0x5390b8[_0xf54e('0x1d')](0x194);}return _0x4cbf7c;};}function handleError(_0x5e63f4,_0x15b888){_0x15b888=_0x15b888||0x1f4;return function(_0x269f47){logger[_0xf54e('0x2d')](_0x269f47[_0xf54e('0x2e')]);if(_0x269f47[_0xf54e('0x2f')]){delete _0x269f47[_0xf54e('0x2f')];}_0x5e63f4[_0xf54e('0x1e')](_0x15b888)['send'](_0x269f47);};}exports['index']=function(_0x2f96b1,_0x258d29){var _0x2ec92e={},_0x16d00f={},_0xb2d4c4={'count':0x0,'rows':[]};var _0x133cd7=db[_0xf54e('0x30')][_0xf54e('0x31')];_0x16d00f[_0xf54e('0x32')]=_[_0xf54e('0x33')](_0x133cd7);_0x16d00f['query']=_['keys'](_0x2f96b1[_0xf54e('0x34')]);_0x16d00f[_0xf54e('0x35')]=_['intersection'](_0x16d00f[_0xf54e('0x32')],_0x16d00f[_0xf54e('0x34')]);_0x2ec92e[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x16d00f['model'],qs['fields'](_0x2f96b1['query'][_0xf54e('0x38')]));_0x2ec92e[_0xf54e('0x36')]=_0x2ec92e[_0xf54e('0x36')][_0xf54e('0x39')]?_0x2ec92e[_0xf54e('0x36')]:_0x16d00f[_0xf54e('0x32')];if(!_0x2f96b1['query']['hasOwnProperty']('nolimit')){_0x2ec92e[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x2f96b1['query']['limit']);_0x2ec92e[_0xf54e('0x20')]=qs[_0xf54e('0x20')](_0x2f96b1[_0xf54e('0x34')]['offset']);}_0x2ec92e[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x2f96b1['query'][_0xf54e('0x3b')]);_0x2ec92e[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x2f96b1[_0xf54e('0x34')],_0x16d00f[_0xf54e('0x35')]));if(_0x2f96b1['query']['filter']){_0x2ec92e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x2ec92e[_0xf54e('0x3c')],{'$or':_['map'](_0x133cd7,function(_0x4533a2){if(_0x4533a2[_0xf54e('0x3f')][_0xf54e('0x40')]!==_0xf54e('0x41')){var _0x361e4c={};_0x361e4c[_0x4533a2[_0xf54e('0x42')]]={'$like':'%'+_0x2f96b1[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x361e4c;}})});}_0x2ec92e=_[_0xf54e('0x3e')]({},_0x2ec92e,_0x2f96b1[_0xf54e('0x44')]);var _0x1c1f0d={'where':_0x2ec92e[_0xf54e('0x3c')]};return db[_0xf54e('0x30')][_0xf54e('0x1f')](_0x1c1f0d)[_0xf54e('0x27')](function(_0x5085c1){_0xb2d4c4['count']=_0x5085c1;if(_0x2f96b1['query'][_0xf54e('0x45')]){_0x2ec92e[_0xf54e('0x46')]=[{'all':!![]}];}return db['CmList'][_0xf54e('0x47')](_0x2ec92e);})[_0xf54e('0x27')](function(_0x381c03){_0xb2d4c4['rows']=_0x381c03;return _0xb2d4c4;})[_0xf54e('0x27')](respondWithFilteredResult(_0x258d29,_0x2ec92e))[_0xf54e('0x48')](handleError(_0x258d29,null));};exports[_0xf54e('0x49')]=function(_0x794be7,_0x4b1931){var _0x143a39={'raw':![],'where':{'id':_0x794be7[_0xf54e('0x4a')]['id']}},_0x14ce90={};_0x14ce90[_0xf54e('0x32')]=_['keys'](db[_0xf54e('0x30')][_0xf54e('0x31')]);_0x14ce90[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x794be7[_0xf54e('0x34')]);_0x14ce90[_0xf54e('0x35')]=_['intersection'](_0x14ce90[_0xf54e('0x32')],_0x14ce90['query']);_0x143a39[_0xf54e('0x36')]=_['intersection'](_0x14ce90[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x794be7[_0xf54e('0x34')]['fields']));_0x143a39[_0xf54e('0x36')]=_0x143a39[_0xf54e('0x36')][_0xf54e('0x39')]?_0x143a39[_0xf54e('0x36')]:_0x14ce90[_0xf54e('0x32')];if(_0x794be7['query'][_0xf54e('0x45')]){_0x143a39[_0xf54e('0x46')]=[{'all':!![]}];}_0x143a39=_[_0xf54e('0x3e')]({},_0x143a39,_0x794be7[_0xf54e('0x44')]);return db['CmList'][_0xf54e('0x4b')](_0x143a39)[_0xf54e('0x27')](handleEntityNotFound(_0x4b1931,null))['then'](respondWithResult(_0x4b1931,null))[_0xf54e('0x48')](handleError(_0x4b1931,null));};exports[_0xf54e('0x4c')]=function(_0x3d24c7,_0xca0141){return db['CmList'][_0xf54e('0x4c')](_0x3d24c7[_0xf54e('0x4d')],{})[_0xf54e('0x27')](function(_0xb4654f){var _0x346fc9=_0x3d24c7[_0xf54e('0x4e')][_0xf54e('0x29')]({'plain':!![]});if(!_0x346fc9)throw new Error(_0xf54e('0x4f'));if(_0x346fc9[_0xf54e('0x50')]===_0xf54e('0x4e')){var _0xaf9bf0=_0xb4654f[_0xf54e('0x29')]({'plain':!![]});var _0x2deb0c=_0xf54e('0x2a');return db[_0xf54e('0x51')][_0xf54e('0x4b')]({'where':{'name':_0x2deb0c,'userProfileId':_0x346fc9[_0xf54e('0x52')]},'raw':!![]})[_0xf54e('0x27')](function(_0x21fd80){if(_0x21fd80&&_0x21fd80[_0xf54e('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0xaf9bf0[_0xf54e('0x2f')],'resourceId':_0xaf9bf0['id'],'type':_0x21fd80[_0xf54e('0x2f')],'sectionId':_0x21fd80['id']},{})[_0xf54e('0x27')](function(){return _0xb4654f;});}else{return _0xb4654f;}})[_0xf54e('0x48')](function(_0xba297c){logger[_0xf54e('0x2d')](_0xf54e('0x54'),_0xba297c);throw _0xba297c;});}return _0xb4654f;})[_0xf54e('0x27')](respondWithResult(_0xca0141,0xc9))[_0xf54e('0x48')](handleError(_0xca0141,null));};exports[_0xf54e('0x26')]=function(_0x1df308,_0x59c313){if(_0x1df308[_0xf54e('0x4d')]['id']){delete _0x1df308[_0xf54e('0x4d')]['id'];}return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x1df308[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x59c313,null))[_0xf54e('0x27')](saveUpdates(_0x1df308['body'],null))[_0xf54e('0x27')](respondWithResult(_0x59c313,null))[_0xf54e('0x48')](handleError(_0x59c313,null));};exports[_0xf54e('0x28')]=function(_0x48a5c8,_0x3ce832){return db['CmList'][_0xf54e('0x4b')]({'where':{'id':_0x48a5c8[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x3ce832,null))['then'](removeEntity(_0x3ce832,null))[_0xf54e('0x48')](handleError(_0x3ce832,null));};exports[_0xf54e('0x55')]=function(_0x2096e5,_0x4e5059){return db[_0xf54e('0x30')][_0xf54e('0x55')]()[_0xf54e('0x27')](respondWithResult(_0x4e5059,null))['catch'](handleError(_0x4e5059,null));};exports['addDisposition']=function(_0x4270e1,_0x9ab4c4,_0x4f17dd){if(_0x4270e1[_0xf54e('0x4d')]['id']){delete _0x4270e1['body']['id'];}return db[_0xf54e('0x30')]['find']({'where':{'id':_0x4270e1[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x9ab4c4,null))[_0xf54e('0x27')](function(_0x241198){if(_0x241198){_0x4270e1[_0xf54e('0x4d')][_0xf54e('0x56')]=_0x241198['id'];return db['Disposition']['create'](_0x4270e1[_0xf54e('0x4d')]);}})[_0xf54e('0x27')](respondWithResult(_0x9ab4c4,null))['catch'](handleError(_0x9ab4c4,null));};exports['getDispositions']=function(_0x2a5e54,_0x511a99,_0x2b616a){var _0x43f9bf={'raw':![],'where':{}};var _0x47596c={};var _0x2b11f8={'count':0x0,'rows':[]};return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0x2a5e54[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x511a99,null))[_0xf54e('0x27')](function(_0x4d8040){if(_0x4d8040){_0x47596c[_0xf54e('0x32')]=_[_0xf54e('0x33')](db[_0xf54e('0x58')][_0xf54e('0x31')]);_0x47596c['query']=_[_0xf54e('0x33')](_0x2a5e54[_0xf54e('0x34')]);_0x47596c[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x47596c[_0xf54e('0x32')],_0x47596c['query']);_0x43f9bf[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x47596c['model'],qs['fields'](_0x2a5e54[_0xf54e('0x34')]['fields']));_0x43f9bf[_0xf54e('0x36')]=_0x43f9bf[_0xf54e('0x36')][_0xf54e('0x39')]?_0x43f9bf[_0xf54e('0x36')]:_0x47596c['model'];if(!_0x2a5e54[_0xf54e('0x34')]['hasOwnProperty'](_0xf54e('0x59'))){_0x43f9bf[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x2a5e54['query'][_0xf54e('0x21')]);_0x43f9bf['offset']=qs[_0xf54e('0x20')](_0x2a5e54[_0xf54e('0x34')]['offset']);}_0x43f9bf[_0xf54e('0x3a')]=qs['sort'](_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x43f9bf[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x2a5e54['query'],_0x47596c[_0xf54e('0x35')]));_0x43f9bf[_0xf54e('0x3c')]['ListId']=_0x4d8040['id'];if(_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x43')]){_0x43f9bf['where']=_[_0xf54e('0x3e')](_0x43f9bf[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x5a')](_0x43f9bf['attributes'],function(_0xf4e4d){var _0x4ae3d0={};_0x4ae3d0[_0xf4e4d]={'$like':'%'+_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x4ae3d0;})});}_0x43f9bf=_['merge']({},_0x43f9bf,_0x2a5e54[_0xf54e('0x44')]);return db[_0xf54e('0x58')][_0xf54e('0x1f')]({'where':_0x43f9bf[_0xf54e('0x3c')]})[_0xf54e('0x27')](function(_0xfc1e){_0x2b11f8[_0xf54e('0x1f')]=_0xfc1e;if(_0x2a5e54[_0xf54e('0x34')][_0xf54e('0x45')]){_0x43f9bf[_0xf54e('0x46')]=[{'all':!![]}];}return db[_0xf54e('0x58')]['findAll'](_0x43f9bf);})[_0xf54e('0x27')](function(_0x2c20b5){_0x2b11f8[_0xf54e('0x5b')]=_0x2c20b5;return _0x2b11f8;});}})['then'](respondWithFilteredResult(_0x511a99,_0x43f9bf))[_0xf54e('0x48')](handleError(_0x511a99,null));};exports[_0xf54e('0x5c')]=function(_0x2bf430,_0x13db3e,_0x47339e){return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x2bf430['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x13db3e,null))[_0xf54e('0x27')](function(_0x261c39){if(_0x261c39){return _0x261c39['removeDispositions'](_0x2bf430[_0xf54e('0x34')][_0xf54e('0x5d')]);}})[_0xf54e('0x27')](respondWithStatusCode(_0x13db3e,null))[_0xf54e('0x48')](handleError(_0x13db3e,null));};exports['addContacts']=function(_0x4a6dee,_0x25d05e,_0x45c5ff){return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x4a6dee[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x25d05e,null))[_0xf54e('0x27')](function(_0x3b2a3e){if(_0x3b2a3e){var _0xf5108b=[];var _0x205b47={'success':[],'errors':[]};return db['CmContact'][_0xf54e('0x55')]()[_0xf54e('0x27')](function(_0x2b026a){if(_0x4a6dee[_0xf54e('0x4d')]['tags']&&_[_0xf54e('0x5e')](_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')])){if(_0x4a6dee[_0xf54e('0x4d')]['tags'][_0xf54e('0x39')]){_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=_0x4a6dee['body']['tags'][_0xf54e('0x60')](';')+';';}else{_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=null;}}else{_0x4a6dee[_0xf54e('0x4d')][_0xf54e('0x5f')]=null;}if(_0x4a6dee[_0xf54e('0x4d')]&&_[_0xf54e('0x5e')](_0x4a6dee[_0xf54e('0x4d')])){for(var _0x8093bc=0x0;_0x8093bc<_0x4a6dee['body'][_0xf54e('0x39')];_0x8093bc+=0x1){_0x4a6dee[_0xf54e('0x4d')][_0x8093bc][_0xf54e('0x56')]=_0x4a6dee[_0xf54e('0x4a')]['id'];_0xf5108b[_0xf54e('0x61')](_0x4a6dee[_0xf54e('0x4d')][_0x8093bc]);}return BPromise[_0xf54e('0x62')](_0xf5108b,function(_0x9a8f4f){return db[_0xf54e('0x63')][_0xf54e('0x4c')](_[_0xf54e('0x64')](_0x9a8f4f,[_0xf54e('0x5d'),'id'])||{},{'fields':_['keys'](_0x2b026a),'raw':!![]})[_0xf54e('0x27')](function(_0x1cfa09){_0x205b47['success']['push'](_0x1cfa09[_0xf54e('0x65')]);})[_0xf54e('0x48')](function(_0x44687a){_0x205b47[_0xf54e('0x66')][_0xf54e('0x61')]({'data':_0x9a8f4f,'error':_0x44687a[_0xf54e('0x67')]});});})[_0xf54e('0x27')](function(_0x403445){return _0x205b47;})[_0xf54e('0x48')](function(_0x570c3a){return _0x570c3a;});}else{_0x25d05e[_0xf54e('0x1e')](0x190)[_0xf54e('0x68')]({'message':_0xf54e('0x69')});}});}})['then'](respondWithResult(_0x25d05e,null))[_0xf54e('0x48')](handleError(_0x25d05e,null));};exports['getContacts']=function(_0x3830e7,_0x57bc6f,_0xfe35d8){var _0x35da10;return db['CmList']['find']({'where':{'id':_0x3830e7[_0xf54e('0x4a')]['id']},'include':[{'model':db[_0xf54e('0x6a')],'as':_0xf54e('0x6b')}]})[_0xf54e('0x27')](handleEntityNotFound(_0x57bc6f,null))[_0xf54e('0x27')](function(_0x486626){if(_0x486626){_0x35da10=_0x486626;return db['CmContact'][_0xf54e('0x31')];}})[_0xf54e('0x27')](function(_0x456159){if(_0x456159){var _0xc31d53={};var _0x9afe5={};_0x9afe5[_0xf54e('0x32')]=_[_0xf54e('0x6c')](_[_0xf54e('0x33')](_0x456159),_[_0xf54e('0x5a')](_0x35da10[_0xf54e('0x6b')],function(_0x54c13f){return util[_0xf54e('0x6d')](_0xf54e('0x6e'),_0x54c13f['id']);}));_0x9afe5['query']=_['keys'](_0x3830e7[_0xf54e('0x34')]);_0x9afe5[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x9afe5[_0xf54e('0x32')],_0x9afe5[_0xf54e('0x34')]);_0xc31d53['attributes']=_[_0xf54e('0x37')](_0x9afe5[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x3830e7[_0xf54e('0x34')]['fields']));_0xc31d53[_0xf54e('0x36')]=_0xc31d53[_0xf54e('0x36')][_0xf54e('0x39')]?_0xc31d53[_0xf54e('0x36')]:_0x9afe5['model'];if(!_0x3830e7[_0xf54e('0x34')][_0xf54e('0x6f')](_0xf54e('0x59'))){_0xc31d53[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x3830e7['query'][_0xf54e('0x21')]);_0xc31d53['offset']=qs['offset'](_0x3830e7[_0xf54e('0x34')][_0xf54e('0x20')]);}_0xc31d53[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x3830e7[_0xf54e('0x34')][_0xf54e('0x3b')]);_0xc31d53[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x3830e7['query'],_0x9afe5[_0xf54e('0x35')]));_0xc31d53[_0xf54e('0x70')]=!![];if(_0x3830e7[_0xf54e('0x34')][_0xf54e('0x43')]){_0xc31d53[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0xc31d53['where'],{'$or':_[_0xf54e('0x5a')](_0xc31d53[_0xf54e('0x36')],function(_0xd2c60d){var _0x2b46d4={};_0x2b46d4[_0xd2c60d]={'$like':'%'+_0x3830e7[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x2b46d4;})});}_0xc31d53=_['merge']({},_0xc31d53,_0x3830e7[_0xf54e('0x44')]);return _0x35da10[_0xf54e('0x71')](_0xc31d53);}})[_0xf54e('0x27')](respondWithResult(_0x57bc6f,null))[_0xf54e('0x48')](handleError(_0x57bc6f,null));};exports['getContactsCsv']=function(_0x4787ea,_0x2feaff,_0x1a5050){var _0x13dec5;return db[_0xf54e('0x30')][_0xf54e('0x4b')]({'where':{'id':_0x4787ea[_0xf54e('0x4a')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xf54e('0x6b')}]})[_0xf54e('0x27')](handleEntityNotFound(_0x2feaff,null))[_0xf54e('0x27')](function(_0x2136c2){if(_0x2136c2){_0x13dec5=_0x2136c2;return db[_0xf54e('0x63')][_0xf54e('0x31')];}})['then'](function(_0x33bed6){if(_0x33bed6){var _0x4dde1d={};var _0x385b43={};_0x385b43['model']=_[_0xf54e('0x6c')](_[_0xf54e('0x33')](_0x33bed6),_[_0xf54e('0x5a')](_0x13dec5[_0xf54e('0x6b')],function(_0x19796f){return util['format'](_0xf54e('0x6e'),_0x19796f['id']);}));_0x385b43[_0xf54e('0x34')]=_['keys'](_0x4787ea[_0xf54e('0x34')]);_0x385b43[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x385b43[_0xf54e('0x32')],_0x385b43['query']);_0x4dde1d[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x385b43['model'],qs[_0xf54e('0x38')](_0x4787ea['query']['fields']));_0x4dde1d[_0xf54e('0x36')]=_0x4dde1d['attributes'][_0xf54e('0x39')]?_0x4dde1d[_0xf54e('0x36')]:_0x385b43[_0xf54e('0x32')];if(!_0x4787ea[_0xf54e('0x34')][_0xf54e('0x6f')]('nolimit')){_0x4dde1d[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x4787ea[_0xf54e('0x34')][_0xf54e('0x21')]);_0x4dde1d['offset']=qs[_0xf54e('0x20')](_0x4787ea['query'][_0xf54e('0x20')]);}_0x4dde1d[_0xf54e('0x3a')]=qs['sort'](_0x4787ea[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x4dde1d[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_['pick'](_0x4787ea[_0xf54e('0x34')],_0x385b43[_0xf54e('0x35')]));_0x4dde1d[_0xf54e('0x70')]=!![];if(_0x4787ea['query']['filter']){_0x4dde1d[_0xf54e('0x3c')]=_['merge'](_0x4dde1d['where'],{'$or':_['map'](_0x4dde1d[_0xf54e('0x36')],function(_0x146a6a){var _0x7c17a={};_0x7c17a[_0x146a6a]={'$like':'%'+_0x4787ea[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x7c17a;})});}_0x4dde1d=_[_0xf54e('0x3e')]({},_0x4dde1d,_0x4787ea[_0xf54e('0x44')]);return _0x13dec5[_0xf54e('0x71')](_0x4dde1d);}})[_0xf54e('0x27')](function(_0x558d5f){if(!_[_0xf54e('0x72')](_0x558d5f)){var _0x523171=toCsv(_0x558d5f);var _0x7cd726=Date[_0xf54e('0x73')]();fs['writeFileSync'](util[_0xf54e('0x6d')]('/tmp/list_%d_%s.csv',_0x13dec5['id'],_0x7cd726),_0x523171);_0x2feaff[_0xf54e('0x74')](_0xf54e('0x75'),_0xf54e('0x76')+util[_0xf54e('0x6d')](_0xf54e('0x77'),_0x13dec5['id'],_0x7cd726));_0x2feaff[_0xf54e('0x74')]('Content-type','text/csv');return _0x2feaff['download'](util[_0xf54e('0x6d')]('/tmp/list_%d_%s.csv',_0x13dec5['id'],_0x7cd726));}else{return _0x2feaff[_0xf54e('0x1d')](0xcc);}})[_0xf54e('0x48')](handleError(_0x2feaff,null));};exports[_0xf54e('0x78')]=function(_0xf24a7c,_0xf92db2,_0x5e5e50){var _0x40a68c;delete _0xf24a7c[_0xf54e('0x4d')]['id'];return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0xf24a7c[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0xf92db2,null))['then'](function(_0x996df5){if(_0x996df5){return db[_0xf54e('0x79')][_0xf54e('0x7a')](function(_0x3c3b44){return db[_0xf54e('0x6a')]['create'](_0xf24a7c[_0xf54e('0x4d')],{'transaction':_0x3c3b44})[_0xf54e('0x27')](function(_0x26631d){_0x40a68c=_0x26631d;return _0x996df5[_0xf54e('0x7b')](_0x26631d,{'transaction':_0x3c3b44});})[_0xf54e('0x27')](function(){var _0xea4112={'type':db[_0xf54e('0x7c')][_0xf54e('0x7d')],'transaction':_0x3c3b44};switch(_0xf24a7c[_0xf54e('0x4d')]['type']){case _0xf54e('0x7e'):_0xea4112[_0xf54e('0x3f')]=db['Sequelize']['TEXT'];break;case _0xf54e('0x7f'):_0xea4112['type']=db[_0xf54e('0x7c')][_0xf54e('0x80')];break;case _0xf54e('0x81'):_0xea4112[_0xf54e('0x3f')]=db['Sequelize'][_0xf54e('0x82')];_0xea4112[_0xf54e('0x83')]=![];break;default:}return db['sequelize'][_0xf54e('0x84')][_0xf54e('0x85')](_0xf54e('0x86'),util[_0xf54e('0x6d')](_0xf54e('0x87'),_0x40a68c['id']),_0xea4112);})[_0xf54e('0x27')](function(){return _0x40a68c;});});}})[_0xf54e('0x27')](respondWithResult(_0xf92db2,null))[_0xf54e('0x48')](handleError(_0xf92db2,null));};exports[_0xf54e('0x88')]=function(_0x3634bc,_0x4931b8,_0x5168a8){var _0x4bb13e={};var _0x246cdd={};var _0x2ef7e4;var _0x78860e;return db[_0xf54e('0x30')][_0xf54e('0x57')]({'where':{'id':_0x3634bc['params']['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x4931b8,null))[_0xf54e('0x27')](function(_0x3a9def){if(_0x3a9def){_0x2ef7e4=_0x3a9def;_0x246cdd[_0xf54e('0x32')]=_['keys'](db[_0xf54e('0x6a')][_0xf54e('0x31')]);_0x246cdd[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x3634bc[_0xf54e('0x34')]);_0x246cdd[_0xf54e('0x35')]=_[_0xf54e('0x37')](_0x246cdd[_0xf54e('0x32')],_0x246cdd[_0xf54e('0x34')]);_0x4bb13e[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x246cdd[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x3634bc[_0xf54e('0x34')]['fields']));_0x4bb13e[_0xf54e('0x36')]=_0x4bb13e['attributes']['length']?_0x4bb13e[_0xf54e('0x36')]:_0x246cdd[_0xf54e('0x32')];_0x4bb13e[_0xf54e('0x3a')]=qs[_0xf54e('0x3b')](_0x3634bc[_0xf54e('0x34')][_0xf54e('0x3b')]);_0x4bb13e[_0xf54e('0x3c')]=qs[_0xf54e('0x35')](_[_0xf54e('0x3d')](_0x3634bc[_0xf54e('0x34')],_0x246cdd[_0xf54e('0x35')]));_0x4bb13e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x4bb13e['where'],{'$or':[{'ListId':_0x3a9def['id']},{'ListId':null}]});if(_0x3634bc[_0xf54e('0x34')][_0xf54e('0x43')]){_0x4bb13e[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x4bb13e[_0xf54e('0x3c')],{'$or':_['map'](_0x4bb13e['attributes'],function(_0x16956a){var _0xcc86ca={};_0xcc86ca[_0x16956a]={'$like':'%'+_0x3634bc['query']['filter']+'%'};return _0xcc86ca;})});}_0x4bb13e=_[_0xf54e('0x3e')]({},_0x4bb13e,_0x3634bc['options']);return db[_0xf54e('0x6a')][_0xf54e('0x89')](_0x4bb13e);}})[_0xf54e('0x27')](respondWithResult(_0x4931b8,null))[_0xf54e('0x48')](handleError(_0x4931b8,null));};exports[_0xf54e('0x8a')]=function(_0x1f9d18,_0x50bff9,_0x39fc7d){return db[_0xf54e('0x30')]['find']({'where':{'id':_0x1f9d18[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x50bff9,null))['then'](function(_0x337fac){if(_0x337fac){return _0x337fac[_0xf54e('0x8a')](_0x1f9d18[_0xf54e('0x4d')]['ids'],_['omit'](_0x1f9d18[_0xf54e('0x4d')],[_0xf54e('0x5d'),'id'])||{})['spread'](function(_0x4f6645){for(var _0x4ce631=0x0;_0x4ce631<_0x1f9d18[_0xf54e('0x4d')][_0xf54e('0x5d')][_0xf54e('0x39')];_0x4ce631+=0x1){socket['emit'](_0xf54e('0x8b'),{'UserId':_0x1f9d18[_0xf54e('0x4d')][_0xf54e('0x5d')][_0x4ce631],'CmListId':_0x1f9d18[_0xf54e('0x4a')]['id']});}return _0x4f6645;});}})[_0xf54e('0x27')](respondWithResult(_0x50bff9,null))['catch'](handleError(_0x50bff9,null));};exports['removeAgents']=function(_0x54a86a,_0x484acd,_0x5458f0){return db[_0xf54e('0x30')]['find']({'where':{'id':_0x54a86a[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x484acd,null))['then'](function(_0x2d5256){if(_0x2d5256){return _0x2d5256['removeAgents'](_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')])[_0xf54e('0x27')](function(){if(_[_0xf54e('0x5e')](_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')])){for(var _0x1b632d=0x0;_0x1b632d<_0x54a86a['query'][_0xf54e('0x5d')][_0xf54e('0x39')];_0x1b632d+=0x1){socket[_0xf54e('0x8c')](_0xf54e('0x8d'),{'UserId':Number(_0x54a86a[_0xf54e('0x34')]['ids'][_0x1b632d]),'CmListId':Number(_0x54a86a[_0xf54e('0x4a')]['id'])});}}else{socket[_0xf54e('0x8c')](_0xf54e('0x8d'),{'UserId':Number(_0x54a86a[_0xf54e('0x34')][_0xf54e('0x5d')]),'CmListId':Number(_0x54a86a[_0xf54e('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x484acd,null))['catch'](handleError(_0x484acd,null));};exports['getAgents']=function(_0x40da4d,_0x32f8f4,_0x261d91){var _0x21cb51={};var _0x2acc8c={};var _0x51be69;var _0x31b2d6;return db[_0xf54e('0x30')]['findOne']({'where':{'id':_0x40da4d[_0xf54e('0x4a')]['id']}})[_0xf54e('0x27')](handleEntityNotFound(_0x32f8f4,null))[_0xf54e('0x27')](function(_0x5b5d32){if(_0x5b5d32){_0x51be69=_0x5b5d32;_0x2acc8c[_0xf54e('0x32')]=_[_0xf54e('0x33')](db[_0xf54e('0x8e')][_0xf54e('0x31')]);_0x2acc8c[_0xf54e('0x34')]=_[_0xf54e('0x33')](_0x40da4d[_0xf54e('0x34')]);_0x2acc8c[_0xf54e('0x35')]=_['intersection'](_0x2acc8c[_0xf54e('0x32')],_0x2acc8c['query']);_0x21cb51[_0xf54e('0x36')]=_[_0xf54e('0x37')](_0x2acc8c[_0xf54e('0x32')],qs[_0xf54e('0x38')](_0x40da4d[_0xf54e('0x34')][_0xf54e('0x38')]));_0x21cb51[_0xf54e('0x36')]=_0x21cb51['attributes']['length']?_0x21cb51['attributes']:_0x2acc8c[_0xf54e('0x32')];_0x21cb51['order']=qs[_0xf54e('0x3b')](_0x40da4d['query'][_0xf54e('0x3b')]);_0x21cb51[_0xf54e('0x3c')]=qs['filters'](_[_0xf54e('0x3d')](_0x40da4d[_0xf54e('0x34')],_0x2acc8c[_0xf54e('0x35')]));if(_0x40da4d[_0xf54e('0x34')][_0xf54e('0x43')]){_0x21cb51[_0xf54e('0x3c')]=_[_0xf54e('0x3e')](_0x21cb51[_0xf54e('0x3c')],{'$or':_[_0xf54e('0x5a')](_0x21cb51[_0xf54e('0x36')],function(_0x3351a3){var _0x5bc7ed={};_0x5bc7ed[_0x3351a3]={'$like':'%'+_0x40da4d[_0xf54e('0x34')][_0xf54e('0x43')]+'%'};return _0x5bc7ed;})});}_0x21cb51=_[_0xf54e('0x3e')]({},_0x21cb51,_0x40da4d['options']);return _0x51be69[_0xf54e('0x8f')](_0x21cb51);}})['then'](function(_0x2f6bcc){if(_0x2f6bcc){_0x31b2d6=_0x2f6bcc[_0xf54e('0x39')];if(!_0x40da4d[_0xf54e('0x34')][_0xf54e('0x6f')](_0xf54e('0x59'))){_0x21cb51[_0xf54e('0x21')]=qs[_0xf54e('0x21')](_0x40da4d[_0xf54e('0x34')][_0xf54e('0x21')]);_0x21cb51[_0xf54e('0x20')]=qs[_0xf54e('0x20')](_0x40da4d['query']['offset']);}return _0x51be69['getAgents'](_0x21cb51);}})[_0xf54e('0x27')](function(_0x3cc581){if(_0x3cc581){return _0x3cc581?{'count':_0x31b2d6,'rows':_0x3cc581}:null;}})[_0xf54e('0x27')](respondWithResult(_0x32f8f4,null))['catch'](handleError(_0x32f8f4,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 70c237d..71ac642 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 _0x3764=['setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb','CmList'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x3764,0x16f));var _0x4376=function(_0xe51c5e,_0x434894){_0xe51c5e=_0xe51c5e-0x0;var _0x53941c=_0x3764[_0xe51c5e];return _0x53941c;};'use strict';var EventEmitter=require('events');var CmList=require(_0x4376('0x0'))['db'][_0x4376('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x4376('0x2')](0x0);var events={'afterCreate':_0x4376('0x3'),'afterUpdate':_0x4376('0x4'),'afterDestroy':_0x4376('0x5')};function emitEvent(_0x45262d){return function(_0x56a59e,_0x45093d,_0x5d5740){CmListEvents[_0x4376('0x6')](_0x45262d+':'+_0x56a59e['id'],_0x56a59e);CmListEvents[_0x4376('0x6')](_0x45262d,_0x56a59e);_0x5d5740(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x4376('0x7')](e,emitEvent(event));}}module[_0x4376('0x8')]=CmListEvents; \ No newline at end of file +var _0xe706=['events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x3657f2,_0x9a1d30){var _0x5ebfc1=function(_0x597584){while(--_0x597584){_0x3657f2['push'](_0x3657f2['shift']());}};_0x5ebfc1(++_0x9a1d30);}(_0xe706,0x12c));var _0x6e70=function(_0x5d869e,_0x1731bd){_0x5d869e=_0x5d869e-0x0;var _0x13a90b=_0xe706[_0x5d869e];return _0x13a90b;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var CmList=require(_0x6e70('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x2'),'afterUpdate':'update','afterDestroy':_0x6e70('0x3')};function emitEvent(_0x3aa8a6){return function(_0x27bf0b,_0x139c75,_0x58a7da){CmListEvents[_0x6e70('0x4')](_0x3aa8a6+':'+_0x27bf0b['id'],_0x27bf0b);CmListEvents['emit'](_0x3aa8a6,_0x27bf0b);_0x58a7da(null);};}for(var e in events){if(events[_0x6e70('0x5')](e)){var event=events[e];CmList['hook'](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 6503b7c..2daed98 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 _0x0962=['CmList','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./cmList.attributes','exports','define'];(function(_0x554f19,_0x38b062){var _0x27e39e=function(_0x1b2dd0){while(--_0x1b2dd0){_0x554f19['push'](_0x554f19['shift']());}};_0x27e39e(++_0x38b062);}(_0x0962,0x198));var _0x2096=function(_0x392295,_0x17a297){_0x392295=_0x392295-0x0;var _0xa3e14d=_0x0962[_0x392295];return _0xa3e14d;};'use strict';var _=require(_0x2096('0x0'));var util=require(_0x2096('0x1'));var logger=require(_0x2096('0x2'))(_0x2096('0x3'));var moment=require('moment');var BPromise=require(_0x2096('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2096('0x5'));var config=require(_0x2096('0x6'));var attributes=require(_0x2096('0x7'));module[_0x2096('0x8')]=function(_0x1ce10d,_0x462564){return _0x1ce10d[_0x2096('0x9')](_0x2096('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2ce=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmList','util','api','moment'];(function(_0x347e56,_0x13aaea){var _0xd94cf1=function(_0x4c2e79){while(--_0x4c2e79){_0x347e56['push'](_0x347e56['shift']());}};_0xd94cf1(++_0x13aaea);}(_0xd2ce,0x13c));var _0xed2c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xd2ce[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xed2c('0x0'));var logger=require('../../config/logger')(_0xed2c('0x1'));var moment=require(_0xed2c('0x2'));var BPromise=require(_0xed2c('0x3'));var rp=require(_0xed2c('0x4'));var fs=require('fs');var path=require(_0xed2c('0x5'));var rimraf=require(_0xed2c('0x6'));var config=require(_0xed2c('0x7'));var attributes=require('./cmList.attributes');module[_0xed2c('0x8')]=function(_0x5b6ccb,_0x38aa25){return _0x5b6ccb[_0xed2c('0x9')](_0xed2c('0xa'),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 5b8a049..a9edbf6 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 _0x877d=['message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./cmList.socket','register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x4ad697,_0x49f44a){var _0x410255=function(_0x2b36e2){while(--_0x2b36e2){_0x4ad697['push'](_0x4ad697['shift']());}};_0x410255(++_0x49f44a);}(_0x877d,0xe3));var _0xd877=function(_0x3032e2,_0x26a4e8){_0x3032e2=_0x3032e2-0x0;var _0x427aef=_0x877d[_0x3032e2];return _0x427aef;};'use strict';var _=require(_0xd877('0x0'));var util=require(_0xd877('0x1'));var moment=require('moment');var BPromise=require(_0xd877('0x2'));var rs=require(_0xd877('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd877('0x4'))['db'];var utils=require(_0xd877('0x5'));var logger=require(_0xd877('0x6'))('rpc');var config=require(_0xd877('0x7'));var jayson=require(_0xd877('0x8'));var client=jayson[_0xd877('0x9')][_0xd877('0xa')]({'port':0x232a});config['redis']=_[_0xd877('0xb')](config[_0xd877('0xc')],{'host':_0xd877('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd877('0xc')]));require(_0xd877('0xe'))[_0xd877('0xf')](socket);function respondWithRpcPromise(_0xb724de,_0x3d56d1,_0x3e300b){return new BPromise(function(_0x59edcc,_0x4b81c0){return client['request'](_0xb724de,_0x3e300b)[_0xd877('0x10')](function(_0x30bc4b){logger[_0xd877('0x11')](_0xd877('0x12'),_0x3d56d1,_0xd877('0x13'));logger[_0xd877('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x3d56d1,_0xd877('0x13'),JSON['stringify'](_0x30bc4b));if(_0x30bc4b[_0xd877('0x15')]){if(_0x30bc4b[_0xd877('0x15')][_0xd877('0x16')]===0x1f4){logger['error'](_0xd877('0x12'),_0x3d56d1,_0x30bc4b[_0xd877('0x15')][_0xd877('0x17')]);return _0x4b81c0(_0x30bc4b[_0xd877('0x15')][_0xd877('0x17')]);}logger[_0xd877('0x15')](_0xd877('0x12'),_0x3d56d1,_0x30bc4b[_0xd877('0x15')][_0xd877('0x17')]);return _0x59edcc(_0x30bc4b[_0xd877('0x15')][_0xd877('0x17')]);}else{logger[_0xd877('0x11')](_0xd877('0x12'),_0x3d56d1,_0xd877('0x13'));_0x59edcc(_0x30bc4b[_0xd877('0x18')][_0xd877('0x17')]);}})['catch'](function(_0x1fd806){logger[_0xd877('0x15')](_0xd877('0x12'),_0x3d56d1,_0x1fd806);_0x4b81c0(_0x1fd806);});});} \ No newline at end of file +var _0x13ea=['register','request','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x392368,_0x1e14a5){var _0x33efe7=function(_0x385d1a){while(--_0x385d1a){_0x392368['push'](_0x392368['shift']());}};_0x33efe7(++_0x1e14a5);}(_0x13ea,0x139));var _0xa13e=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0x13ea[_0x254b22];return _0x1279db;};'use strict';var _=require(_0xa13e('0x0'));var util=require(_0xa13e('0x1'));var moment=require(_0xa13e('0x2'));var BPromise=require(_0xa13e('0x3'));var rs=require(_0xa13e('0x4'));var fs=require('fs');var Redis=require(_0xa13e('0x5'));var db=require(_0xa13e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa13e('0x7'))(_0xa13e('0x8'));var config=require(_0xa13e('0x9'));var jayson=require(_0xa13e('0xa'));var client=jayson[_0xa13e('0xb')][_0xa13e('0xc')]({'port':0x232a});config[_0xa13e('0xd')]=_[_0xa13e('0xe')](config['redis'],{'host':_0xa13e('0xf'),'port':0x18eb});var socket=require(_0xa13e('0x10'))(new Redis(config['redis']));require('./cmList.socket')[_0xa13e('0x11')](socket);function respondWithRpcPromise(_0x492f18,_0x35df15,_0x5ca711){return new BPromise(function(_0x413f10,_0x2b2081){return client[_0xa13e('0x12')](_0x492f18,_0x5ca711)['then'](function(_0x2ce0db){logger[_0xa13e('0x13')](_0xa13e('0x14'),_0x35df15,_0xa13e('0x15'));logger[_0xa13e('0x16')](_0xa13e('0x17'),_0x35df15,_0xa13e('0x15'),JSON[_0xa13e('0x18')](_0x2ce0db));if(_0x2ce0db[_0xa13e('0x19')]){if(_0x2ce0db['error'][_0xa13e('0x1a')]===0x1f4){logger[_0xa13e('0x19')](_0xa13e('0x14'),_0x35df15,_0x2ce0db[_0xa13e('0x19')][_0xa13e('0x1b')]);return _0x2b2081(_0x2ce0db[_0xa13e('0x19')]['message']);}logger[_0xa13e('0x19')](_0xa13e('0x14'),_0x35df15,_0x2ce0db[_0xa13e('0x19')][_0xa13e('0x1b')]);return _0x413f10(_0x2ce0db['error'][_0xa13e('0x1b')]);}else{logger[_0xa13e('0x13')](_0xa13e('0x14'),_0x35df15,_0xa13e('0x15'));_0x413f10(_0x2ce0db[_0xa13e('0x1c')][_0xa13e('0x1b')]);}})[_0xa13e('0x1d')](function(_0x31daca){logger[_0xa13e('0x19')](_0xa13e('0x14'),_0x35df15,_0x31daca);_0x2b2081(_0x31daca);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 7840f54..7763af6 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 _0x983a=['./cmList.events','save','remove','update','emit','removeListener','register','length'];(function(_0x6148ee,_0x4d2fca){var _0x5afc74=function(_0x351621){while(--_0x351621){_0x6148ee['push'](_0x6148ee['shift']());}};_0x5afc74(++_0x4d2fca);}(_0x983a,0x100));var _0xa983=function(_0x40db91,_0x232c51){_0x40db91=_0x40db91-0x0;var _0x3e1912=_0x983a[_0x40db91];return _0x3e1912;};'use strict';var CmListEvents=require(_0xa983('0x0'));var events=[_0xa983('0x1'),_0xa983('0x2'),_0xa983('0x3')];function createListener(_0x24b4ac,_0x331741){return function(_0x119f69){_0x331741[_0xa983('0x4')](_0x24b4ac,_0x119f69);};}function removeListener(_0x8bf35d,_0x5aef60){return function(){CmListEvents[_0xa983('0x5')](_0x8bf35d,_0x5aef60);};}exports[_0xa983('0x6')]=function(_0x27f2a2){for(var _0x5999ef=0x0,_0x9ad52a=events[_0xa983('0x7')];_0x5999ef<_0x9ad52a;_0x5999ef++){var _0x3ff6a5=events[_0x5999ef];var _0x5e610b=createListener('cmList:'+_0x3ff6a5,_0x27f2a2);CmListEvents['on'](_0x3ff6a5,_0x5e610b);}}; \ No newline at end of file +var _0x0a8c=['cmList:','./cmList.events','save','remove','update','removeListener','register','length'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x0a8c,0xa1));var _0xc0a8=function(_0xdaab62,_0x2728ab){_0xdaab62=_0xdaab62-0x0;var _0x13d767=_0x0a8c[_0xdaab62];return _0x13d767;};'use strict';var CmListEvents=require(_0xc0a8('0x0'));var events=[_0xc0a8('0x1'),_0xc0a8('0x2'),_0xc0a8('0x3')];function createListener(_0x38184d,_0x51df5f){return function(_0xa6375b){_0x51df5f['emit'](_0x38184d,_0xa6375b);};}function removeListener(_0x55f1c3,_0x436964){return function(){CmListEvents[_0xc0a8('0x4')](_0x55f1c3,_0x436964);};}exports[_0xc0a8('0x5')]=function(_0xa2acad){for(var _0x290a45=0x0,_0x18ec07=events[_0xc0a8('0x6')];_0x290a45<_0x18ec07;_0x290a45++){var _0x207a8b=events[_0x290a45];var _0x1c06e5=createListener(_0xc0a8('0x7')+_0x207a8b,_0xa2acad);CmListEvents['on'](_0x207a8b,_0x1c06e5);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 2a49c05..d33f79b 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 _0x7f92=['/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getDispositions','/:id/contacts','getContacts'];(function(_0x63ceb7,_0x18d274){var _0x1ce7bb=function(_0x574baa){while(--_0x574baa){_0x63ceb7['push'](_0x63ceb7['shift']());}};_0x1ce7bb(++_0x18d274);}(_0x7f92,0x19c));var _0x27f9=function(_0x4dec06,_0x3aa1f4){_0x4dec06=_0x4dec06-0x0;var _0x247472=_0x7f92[_0x4dec06];return _0x247472;};'use strict';var multer=require(_0x27f9('0x0'));var util=require(_0x27f9('0x1'));var path=require(_0x27f9('0x2'));var timeout=require(_0x27f9('0x3'));var express=require('express');var router=express[_0x27f9('0x4')]();var auth=require(_0x27f9('0x5'));var interaction=require(_0x27f9('0x6'));var config=require(_0x27f9('0x7'));var controller=require('./cmList.controller');router[_0x27f9('0x8')]('/',auth[_0x27f9('0x9')](),controller[_0x27f9('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x27f9('0xb')]);router[_0x27f9('0x8')](_0x27f9('0xc'),auth['isAuthenticated'](),controller[_0x27f9('0xd')]);router[_0x27f9('0x8')]('/:id/dispositions',auth[_0x27f9('0x9')](),controller[_0x27f9('0xe')]);router[_0x27f9('0x8')](_0x27f9('0xf'),auth['isAuthenticated'](),controller[_0x27f9('0x10')]);router[_0x27f9('0x8')](_0x27f9('0x11'),auth[_0x27f9('0x9')](),controller[_0x27f9('0x12')]);router[_0x27f9('0x8')](_0x27f9('0x13'),auth['isAuthenticated'](),controller[_0x27f9('0x14')]);router[_0x27f9('0x8')](_0x27f9('0x15'),auth[_0x27f9('0x9')](),controller[_0x27f9('0x16')]);router[_0x27f9('0x17')]('/',auth[_0x27f9('0x9')](),controller[_0x27f9('0x18')]);router[_0x27f9('0x17')](_0x27f9('0x19'),auth[_0x27f9('0x9')](),controller['addDisposition']);router['post'](_0x27f9('0xf'),auth[_0x27f9('0x9')](),controller['addContacts']);router[_0x27f9('0x17')]('/:id/fields',auth[_0x27f9('0x9')](),controller['addCustomField']);router['post']('/:id/users',auth[_0x27f9('0x9')](),controller[_0x27f9('0x1a')]);router['put'](_0x27f9('0xc'),auth[_0x27f9('0x9')](),controller[_0x27f9('0x1b')]);router[_0x27f9('0x1c')](_0x27f9('0xc'),auth[_0x27f9('0x9')](),controller[_0x27f9('0x1d')]);router['delete'](_0x27f9('0x19'),auth[_0x27f9('0x9')](),controller[_0x27f9('0x1e')]);router[_0x27f9('0x1c')](_0x27f9('0x15'),auth['isAuthenticated'](),controller[_0x27f9('0x1f')]);module[_0x27f9('0x20')]=router; \ No newline at end of file +var _0xe766=['Router','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','post','addDisposition','addContacts','addAgents','put','update','delete','destroy','removeDispositions','multer','util','path','connect-timeout','express'];(function(_0x47983c,_0x349fa3){var _0x1e6201=function(_0x36c5a3){while(--_0x36c5a3){_0x47983c['push'](_0x47983c['shift']());}};_0x1e6201(++_0x349fa3);}(_0xe766,0xe9));var _0x6e76=function(_0x18ee80,_0x2adf1c){_0x18ee80=_0x18ee80-0x0;var _0x2f60c2=_0xe766[_0x18ee80];return _0x2f60c2;};'use strict';var multer=require(_0x6e76('0x0'));var util=require(_0x6e76('0x1'));var path=require(_0x6e76('0x2'));var timeout=require(_0x6e76('0x3'));var express=require(_0x6e76('0x4'));var router=express[_0x6e76('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e76('0x6'));var config=require(_0x6e76('0x7'));var controller=require(_0x6e76('0x8'));router[_0x6e76('0x9')]('/',auth[_0x6e76('0xa')](),controller[_0x6e76('0xb')]);router['get'](_0x6e76('0xc'),auth[_0x6e76('0xa')](),controller[_0x6e76('0xd')]);router[_0x6e76('0x9')](_0x6e76('0xe'),auth[_0x6e76('0xa')](),controller[_0x6e76('0xf')]);router['get'](_0x6e76('0x10'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x11')]);router['get'](_0x6e76('0x12'),auth['isAuthenticated'](),controller[_0x6e76('0x13')]);router[_0x6e76('0x9')](_0x6e76('0x14'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x15')]);router[_0x6e76('0x9')](_0x6e76('0x16'),auth[_0x6e76('0xa')](),controller['getCustomFields']);router[_0x6e76('0x9')](_0x6e76('0x17'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x18')]);router[_0x6e76('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6e76('0x19')](_0x6e76('0x10'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x1a')]);router[_0x6e76('0x19')](_0x6e76('0x12'),auth['isAuthenticated'](),controller[_0x6e76('0x1b')]);router['post'](_0x6e76('0x16'),auth['isAuthenticated'](),controller['addCustomField']);router[_0x6e76('0x19')](_0x6e76('0x17'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x1c')]);router[_0x6e76('0x1d')](_0x6e76('0xe'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x1e')]);router[_0x6e76('0x1f')](_0x6e76('0xe'),auth['isAuthenticated'](),controller[_0x6e76('0x20')]);router[_0x6e76('0x1f')](_0x6e76('0x10'),auth[_0x6e76('0xa')](),controller[_0x6e76('0x21')]);router[_0x6e76('0x1f')](_0x6e76('0x17'),auth[_0x6e76('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index eee5681..4b78a9c 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 _0xf3b0=['STRING','exports','VIRTUAL','field'];(function(_0x17bb0b,_0x5c3e12){var _0x4b6b39=function(_0x35740f){while(--_0x35740f){_0x17bb0b['push'](_0x17bb0b['shift']());}};_0x4b6b39(++_0x5c3e12);}(_0xf3b0,0x15d));var _0x0f3b=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0xf3b0[_0x44cb92];return _0x56b9e6;};'use strict';var Sequelize=require('sequelize');module[_0x0f3b('0x0')]={'name':{'type':Sequelize[_0x0f3b('0x1')],'get':function(_0xfecf96){return this['getDataValue'](_0x0f3b('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0f3b('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x0f3b('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x1848=['VIRTUAL','getDataValue','STRING','sequelize','exports'];(function(_0x402b7,_0x1bbb75){var _0x356bf6=function(_0x57845f){while(--_0x57845f){_0x402b7['push'](_0x402b7['shift']());}};_0x356bf6(++_0x1bbb75);}(_0x1848,0x166));var _0x8184=function(_0x43cded,_0x3e8fde){_0x43cded=_0x43cded-0x0;var _0xd6bb7c=_0x1848[_0x43cded];return _0xd6bb7c;};'use strict';var Sequelize=require(_0x8184('0x0'));module[_0x8184('0x1')]={'name':{'type':Sequelize[_0x8184('0x2')],'get':function(_0x1ee75a){return this[_0x8184('0x3')]('field');}},'field':{'type':Sequelize[_0x8184('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8184('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 4c9a4e4..e692bce 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 _0x8d9f=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','body','find','params','catch','Condition','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x8d9f,0xdf));var _0xf8d9=function(_0x47a528,_0x59567c){_0x47a528=_0x47a528-0x0;var _0x627777=_0x8d9f[_0x47a528];return _0x627777;};'use strict';var pdf=require(_0xf8d9('0x0'));var emlformat=require(_0xf8d9('0x1'));var rimraf=require(_0xf8d9('0x2'));var zipdir=require(_0xf8d9('0x3'));var jsonpatch=require(_0xf8d9('0x4'));var rp=require('request-promise');var moment=require(_0xf8d9('0x5'));var BPromise=require(_0xf8d9('0x6'));var Mustache=require(_0xf8d9('0x7'));var util=require(_0xf8d9('0x8'));var path=require(_0xf8d9('0x9'));var sox=require('sox');var csv=require(_0xf8d9('0xa'));var ejs=require(_0xf8d9('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf8d9('0xc'));var crypto=require(_0xf8d9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf8d9('0xe'));var toCsv=require(_0xf8d9('0xa'));var querystring=require(_0xf8d9('0xf'));var Papa=require(_0xf8d9('0x10'));var Redis=require(_0xf8d9('0x11'));var authService=require(_0xf8d9('0x12'));var qs=require(_0xf8d9('0x13'));var hardwareService=require(_0xf8d9('0x14'));var logger=require(_0xf8d9('0x15'))('api');var utils=require(_0xf8d9('0x16'));var config=require(_0xf8d9('0x17'));var db=require(_0xf8d9('0x18'))['db'];function respondWithStatusCode(_0x550e42,_0x545228){_0x545228=_0x545228||0xcc;return function(_0x8e2a9b){if(_0x8e2a9b){return _0x550e42[_0xf8d9('0x19')](_0x545228);}return _0x550e42['status'](_0x545228)[_0xf8d9('0x1a')]();};}function respondWithResult(_0x4801f9,_0x42cf2b){_0x42cf2b=_0x42cf2b||0xc8;return function(_0x3f84f3){if(_0x3f84f3){return _0x4801f9[_0xf8d9('0x1b')](_0x42cf2b)[_0xf8d9('0x1c')](_0x3f84f3);}};}function respondWithFilteredResult(_0x296ec0,_0x28b171){return function(_0x4a8ecf){if(_0x4a8ecf){var _0x4639aa=_0x4a8ecf[_0xf8d9('0x1d')],_0x331636=_0x28b171[_0xf8d9('0x1e')],_0x31a561=_0x28b171[_0xf8d9('0x1e')]+_0x28b171[_0xf8d9('0x1f')],_0x3436c0;if(_0x31a561>=_0x4639aa){_0x31a561=_0x4639aa;_0x3436c0=0xc8;}else{_0x3436c0=0xce;}_0x296ec0[_0xf8d9('0x1b')](_0x3436c0);return _0x296ec0[_0xf8d9('0x20')](_0xf8d9('0x21'),_0x331636+'-'+_0x31a561+'/'+_0x4639aa)[_0xf8d9('0x1c')](_0x4a8ecf);}return null;};}function patchUpdates(_0xc50d25){return function(_0xae92f4){try{jsonpatch[_0xf8d9('0x22')](_0xae92f4,_0xc50d25,!![]);}catch(_0x44d97a){return BPromise[_0xf8d9('0x23')](_0x44d97a);}return _0xae92f4[_0xf8d9('0x24')]();};}function saveUpdates(_0x5e530c,_0x5bef24){return function(_0x7c0141){if(_0x7c0141){return _0x7c0141[_0xf8d9('0x25')](_0x5e530c)[_0xf8d9('0x26')](function(_0xfd58cf){return _0xfd58cf;});}return null;};}function removeEntity(_0x2d58dd,_0x38412e){return function(_0x2597e3){if(_0x2597e3){return _0x2597e3['destroy']()[_0xf8d9('0x26')](function(){_0x2d58dd['status'](0xcc)[_0xf8d9('0x1a')]();});}};}function handleEntityNotFound(_0x396420,_0x1808a9){return function(_0x2e1b6e){if(!_0x2e1b6e){_0x396420[_0xf8d9('0x19')](0x194);}return _0x2e1b6e;};}function handleError(_0x509983,_0x21a72b){_0x21a72b=_0x21a72b||0x1f4;return function(_0x39bcee){logger[_0xf8d9('0x27')](_0x39bcee[_0xf8d9('0x28')]);if(_0x39bcee[_0xf8d9('0x29')]){delete _0x39bcee[_0xf8d9('0x29')];}_0x509983[_0xf8d9('0x1b')](_0x21a72b)['send'](_0x39bcee);};}exports['update']=function(_0x1a4e73,_0x4ce4fd){if(_0x1a4e73[_0xf8d9('0x2a')]['id']){delete _0x1a4e73[_0xf8d9('0x2a')]['id'];}return db['Condition'][_0xf8d9('0x2b')]({'where':{'id':_0x1a4e73[_0xf8d9('0x2c')]['id']}})['then'](handleEntityNotFound(_0x4ce4fd,null))['then'](saveUpdates(_0x1a4e73[_0xf8d9('0x2a')],null))[_0xf8d9('0x26')](respondWithResult(_0x4ce4fd,null))[_0xf8d9('0x2d')](handleError(_0x4ce4fd,null));};exports['destroy']=function(_0x2c3bc8,_0x59279f){return db[_0xf8d9('0x2e')]['find']({'where':{'id':_0x2c3bc8['params']['id']}})['then'](handleEntityNotFound(_0x59279f,null))[_0xf8d9('0x26')](removeEntity(_0x59279f,null))[_0xf8d9('0x2d')](handleError(_0x59279f,null));}; \ No newline at end of file +var _0xbf95=['json','count','offset','set','Content-Range','apply','reject','update','then','destroy','status','error','stack','name','send','body','Condition','find','params','catch','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0xb1749e,_0x33f3af){var _0x1de3a5=function(_0x126b89){while(--_0x126b89){_0xb1749e['push'](_0xb1749e['shift']());}};_0x1de3a5(++_0x33f3af);}(_0xbf95,0xc8));var _0x5bf9=function(_0xf3e15c,_0xfb644e){_0xf3e15c=_0xf3e15c-0x0;var _0x21698f=_0xbf95[_0xf3e15c];return _0x21698f;};'use strict';var pdf=require(_0x5bf9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5bf9('0x1'));var zipdir=require(_0x5bf9('0x2'));var jsonpatch=require(_0x5bf9('0x3'));var rp=require(_0x5bf9('0x4'));var moment=require(_0x5bf9('0x5'));var BPromise=require(_0x5bf9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5bf9('0x7'));var sox=require(_0x5bf9('0x8'));var csv=require(_0x5bf9('0x9'));var ejs=require(_0x5bf9('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5bf9('0xb'));var crypto=require('crypto');var jsforce=require(_0x5bf9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5bf9('0xd'));var Papa=require('papaparse');var Redis=require(_0x5bf9('0xe'));var authService=require(_0x5bf9('0xf'));var qs=require(_0x5bf9('0x10'));var hardwareService=require(_0x5bf9('0x11'));var logger=require(_0x5bf9('0x12'))(_0x5bf9('0x13'));var utils=require(_0x5bf9('0x14'));var config=require(_0x5bf9('0x15'));var db=require(_0x5bf9('0x16'))['db'];function respondWithStatusCode(_0x165916,_0x2f7988){_0x2f7988=_0x2f7988||0xcc;return function(_0x520262){if(_0x520262){return _0x165916[_0x5bf9('0x17')](_0x2f7988);}return _0x165916['status'](_0x2f7988)[_0x5bf9('0x18')]();};}function respondWithResult(_0x4e6d45,_0x1922de){_0x1922de=_0x1922de||0xc8;return function(_0x53a99b){if(_0x53a99b){return _0x4e6d45['status'](_0x1922de)[_0x5bf9('0x19')](_0x53a99b);}};}function respondWithFilteredResult(_0x59fc03,_0x3d512e){return function(_0xccdf14){if(_0xccdf14){var _0x594308=_0xccdf14[_0x5bf9('0x1a')],_0x42f807=_0x3d512e[_0x5bf9('0x1b')],_0x5882a6=_0x3d512e[_0x5bf9('0x1b')]+_0x3d512e['limit'],_0x5cbeec;if(_0x5882a6>=_0x594308){_0x5882a6=_0x594308;_0x5cbeec=0xc8;}else{_0x5cbeec=0xce;}_0x59fc03['status'](_0x5cbeec);return _0x59fc03[_0x5bf9('0x1c')](_0x5bf9('0x1d'),_0x42f807+'-'+_0x5882a6+'/'+_0x594308)['json'](_0xccdf14);}return null;};}function patchUpdates(_0x1afe8d){return function(_0x3870c7){try{jsonpatch[_0x5bf9('0x1e')](_0x3870c7,_0x1afe8d,!![]);}catch(_0x1002c7){return BPromise[_0x5bf9('0x1f')](_0x1002c7);}return _0x3870c7['save']();};}function saveUpdates(_0x27530a,_0x28386f){return function(_0x107ec7){if(_0x107ec7){return _0x107ec7[_0x5bf9('0x20')](_0x27530a)[_0x5bf9('0x21')](function(_0x5cca40){return _0x5cca40;});}return null;};}function removeEntity(_0x574d0a,_0x38768e){return function(_0x2b849b){if(_0x2b849b){return _0x2b849b[_0x5bf9('0x22')]()[_0x5bf9('0x21')](function(){_0x574d0a[_0x5bf9('0x23')](0xcc)[_0x5bf9('0x18')]();});}};}function handleEntityNotFound(_0xf6d8df,_0x23a93f){return function(_0x3d6bb6){if(!_0x3d6bb6){_0xf6d8df[_0x5bf9('0x17')](0x194);}return _0x3d6bb6;};}function handleError(_0x541ef1,_0xbc0462){_0xbc0462=_0xbc0462||0x1f4;return function(_0xdbdd41){logger[_0x5bf9('0x24')](_0xdbdd41[_0x5bf9('0x25')]);if(_0xdbdd41[_0x5bf9('0x26')]){delete _0xdbdd41[_0x5bf9('0x26')];}_0x541ef1[_0x5bf9('0x23')](_0xbc0462)[_0x5bf9('0x27')](_0xdbdd41);};}exports['update']=function(_0x1f1f26,_0x5736c3){if(_0x1f1f26[_0x5bf9('0x28')]['id']){delete _0x1f1f26[_0x5bf9('0x28')]['id'];}return db[_0x5bf9('0x29')][_0x5bf9('0x2a')]({'where':{'id':_0x1f1f26[_0x5bf9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5736c3,null))[_0x5bf9('0x21')](saveUpdates(_0x1f1f26[_0x5bf9('0x28')],null))[_0x5bf9('0x21')](respondWithResult(_0x5736c3,null))[_0x5bf9('0x2c')](handleError(_0x5736c3,null));};exports[_0x5bf9('0x22')]=function(_0x276ac4,_0x4c304){return db[_0x5bf9('0x29')][_0x5bf9('0x2a')]({'where':{'id':_0x276ac4[_0x5bf9('0x2b')]['id']}})['then'](handleEntityNotFound(_0x4c304,null))[_0x5bf9('0x21')](removeEntity(_0x4c304,null))[_0x5bf9('0x2c')](handleError(_0x4c304,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 71bad7d..c8d08c4 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 _0x9f35=['../../config/environment','./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f35,0x1f3));var _0x59f3=function(_0x1382f0,_0x436d54){_0x1382f0=_0x1382f0-0x0;var _0x26ba4e=_0x9f35[_0x1382f0];return _0x26ba4e;};'use strict';var _=require(_0x59f3('0x0'));var util=require(_0x59f3('0x1'));var logger=require(_0x59f3('0x2'))(_0x59f3('0x3'));var moment=require(_0x59f3('0x4'));var BPromise=require('bluebird');var rp=require(_0x59f3('0x5'));var fs=require('fs');var path=require(_0x59f3('0x6'));var rimraf=require(_0x59f3('0x7'));var config=require(_0x59f3('0x8'));var attributes=require(_0x59f3('0x9'));module[_0x59f3('0xa')]=function(_0x58e4a4,_0x3a6b6c){return _0x58e4a4[_0x59f3('0xb')]('Condition',attributes,{'tableName':_0x59f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20de=['define','Condition','tools_conditions','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x33d77b,_0x3dc729){var _0x44d471=function(_0x3c4617){while(--_0x3c4617){_0x33d77b['push'](_0x33d77b['shift']());}};_0x44d471(++_0x3dc729);}(_0x20de,0x1ca));var _0xe20d=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x20de[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xe20d('0x0'));var util=require(_0xe20d('0x1'));var logger=require('../../config/logger')(_0xe20d('0x2'));var moment=require('moment');var BPromise=require(_0xe20d('0x3'));var rp=require(_0xe20d('0x4'));var fs=require('fs');var path=require(_0xe20d('0x5'));var rimraf=require(_0xe20d('0x6'));var config=require(_0xe20d('0x7'));var attributes=require(_0xe20d('0x8'));module[_0xe20d('0x9')]=function(_0x280de1,_0x4ed186){return _0x280de1[_0xe20d('0xa')](_0xe20d('0xb'),attributes,{'tableName':_0xe20d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 59e48a9..7a1bf71 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 _0xc227=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1f89e9,_0x1d6560){var _0x4a3de0=function(_0x19ff26){while(--_0x19ff26){_0x1f89e9['push'](_0x1f89e9['shift']());}};_0x4a3de0(++_0x1d6560);}(_0xc227,0x17d));var _0x7c22=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xc227[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x7c22('0x0'));var util=require(_0x7c22('0x1'));var moment=require(_0x7c22('0x2'));var BPromise=require(_0x7c22('0x3'));var rs=require(_0x7c22('0x4'));var fs=require('fs');var Redis=require(_0x7c22('0x5'));var db=require(_0x7c22('0x6'))['db'];var utils=require(_0x7c22('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x7c22('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf3cb8a,_0xf28426,_0x186ff2){return new BPromise(function(_0x5d5296,_0x459b2c){return client['request'](_0xf3cb8a,_0x186ff2)[_0x7c22('0x9')](function(_0x370c9c){logger[_0x7c22('0xa')](_0x7c22('0xb'),_0xf28426,_0x7c22('0xc'));logger[_0x7c22('0xd')](_0x7c22('0xe'),_0xf28426,_0x7c22('0xc'),JSON[_0x7c22('0xf')](_0x370c9c));if(_0x370c9c[_0x7c22('0x10')]){if(_0x370c9c[_0x7c22('0x10')][_0x7c22('0x11')]===0x1f4){logger[_0x7c22('0x10')]('Condition,\x20%s,\x20%s',_0xf28426,_0x370c9c[_0x7c22('0x10')][_0x7c22('0x12')]);return _0x459b2c(_0x370c9c[_0x7c22('0x10')][_0x7c22('0x12')]);}logger['error'](_0x7c22('0xb'),_0xf28426,_0x370c9c['error']['message']);return _0x5d5296(_0x370c9c[_0x7c22('0x10')][_0x7c22('0x12')]);}else{logger[_0x7c22('0xa')](_0x7c22('0xb'),_0xf28426,_0x7c22('0xc'));_0x5d5296(_0x370c9c['result'][_0x7c22('0x12')]);}})['catch'](function(_0x7a3aad){logger['error'](_0x7c22('0xb'),_0xf28426,_0x7a3aad);_0x459b2c(_0x7a3aad);});});} \ No newline at end of file +var _0x93b8=['jayson/promise','client','http','request','then','Condition,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x51f764,_0x4c5c26){var _0x40eee9=function(_0x1c8827){while(--_0x1c8827){_0x51f764['push'](_0x51f764['shift']());}};_0x40eee9(++_0x4c5c26);}(_0x93b8,0xc1));var _0x893b=function(_0x41a095,_0x250e4a){_0x41a095=_0x41a095-0x0;var _0x337570=_0x93b8[_0x41a095];return _0x337570;};'use strict';var _=require(_0x893b('0x0'));var util=require(_0x893b('0x1'));var moment=require('moment');var BPromise=require(_0x893b('0x2'));var rs=require(_0x893b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x893b('0x4'));var logger=require(_0x893b('0x5'))(_0x893b('0x6'));var config=require('../../config/environment');var jayson=require(_0x893b('0x7'));var client=jayson[_0x893b('0x8')][_0x893b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf2c5,_0x5475f3,_0x4905a2){return new BPromise(function(_0x5abe2b,_0x28e322){return client[_0x893b('0xa')](_0x2bf2c5,_0x4905a2)[_0x893b('0xb')](function(_0x446f6f){logger['info'](_0x893b('0xc'),_0x5475f3,_0x893b('0xd'));logger['debug']('Condition,\x20%s,\x20%s,\x20%s',_0x5475f3,'request\x20sent',JSON[_0x893b('0xe')](_0x446f6f));if(_0x446f6f[_0x893b('0xf')]){if(_0x446f6f[_0x893b('0xf')]['code']===0x1f4){logger[_0x893b('0xf')](_0x893b('0xc'),_0x5475f3,_0x446f6f[_0x893b('0xf')][_0x893b('0x10')]);return _0x28e322(_0x446f6f[_0x893b('0xf')][_0x893b('0x10')]);}logger[_0x893b('0xf')](_0x893b('0xc'),_0x5475f3,_0x446f6f[_0x893b('0xf')][_0x893b('0x10')]);return _0x5abe2b(_0x446f6f['error'][_0x893b('0x10')]);}else{logger[_0x893b('0x11')](_0x893b('0xc'),_0x5475f3,_0x893b('0xd'));_0x5abe2b(_0x446f6f[_0x893b('0x12')][_0x893b('0x10')]);}})[_0x893b('0x13')](function(_0x3c7a85){logger[_0x893b('0xf')]('Condition,\x20%s,\x20%s',_0x5475f3,_0x3c7a85);_0x28e322(_0x3c7a85);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 2b0cdad..d4b422a 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 _0xaa85=['Router','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x1e2fc9,_0x3175bc){var _0x66a5c1=function(_0x155fc2){while(--_0x155fc2){_0x1e2fc9['push'](_0x1e2fc9['shift']());}};_0x66a5c1(++_0x3175bc);}(_0xaa85,0x17e));var _0x5aa8=function(_0x377c9a,_0x330586){_0x377c9a=_0x377c9a-0x0;var _0x185bb7=_0xaa85[_0x377c9a];return _0x185bb7;};'use strict';var multer=require(_0x5aa8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5aa8('0x1'));var express=require('express');var router=express[_0x5aa8('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5aa8('0x3'));var config=require(_0x5aa8('0x4'));var controller=require('./condition.controller');router[_0x5aa8('0x5')](_0x5aa8('0x6'),auth[_0x5aa8('0x7')](),controller[_0x5aa8('0x8')]);router[_0x5aa8('0x9')]('/:id',auth[_0x5aa8('0x7')](),controller[_0x5aa8('0xa')]);module[_0x5aa8('0xb')]=router; \ No newline at end of file +var _0x4c13=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','delete','destroy','multer','util'];(function(_0x22d705,_0x27dd8e){var _0x8686fc=function(_0x29a9f1){while(--_0x29a9f1){_0x22d705['push'](_0x22d705['shift']());}};_0x8686fc(++_0x27dd8e);}(_0x4c13,0x66));var _0x34c1=function(_0x72ad5a,_0x3ad145){_0x72ad5a=_0x72ad5a-0x0;var _0x54b6bd=_0x4c13[_0x72ad5a];return _0x54b6bd;};'use strict';var multer=require(_0x34c1('0x0'));var util=require(_0x34c1('0x1'));var path=require(_0x34c1('0x2'));var timeout=require(_0x34c1('0x3'));var express=require(_0x34c1('0x4'));var router=express['Router']();var auth=require(_0x34c1('0x5'));var interaction=require(_0x34c1('0x6'));var config=require(_0x34c1('0x7'));var controller=require('./condition.controller');router[_0x34c1('0x8')](_0x34c1('0x9'),auth[_0x34c1('0xa')](),controller['update']);router[_0x34c1('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x34c1('0xc')]);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 b9bd509..76bc39e 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 _0x913c=['STRING','name','sequelize','exports'];(function(_0x329ada,_0x260a88){var _0x1c253a=function(_0x40fe3d){while(--_0x40fe3d){_0x329ada['push'](_0x329ada['shift']());}};_0x1c253a(++_0x260a88);}(_0x913c,0x13a));var _0xc913=function(_0x446674,_0x4f0ea9){_0x446674=_0x446674-0x0;var _0x4d027b=_0x913c[_0x446674];return _0x4d027b;};'use strict';var Sequelize=require(_0xc913('0x0'));module[_0xc913('0x1')]={'name':{'type':Sequelize[_0xc913('0x2')],'allowNull':![],'unique':_0xc913('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xafd4=['STRING','exports'];(function(_0x6098b9,_0x3dc78c){var _0x116ed7=function(_0x4c4afe){while(--_0x4c4afe){_0x6098b9['push'](_0x6098b9['shift']());}};_0x116ed7(++_0x3dc78c);}(_0xafd4,0x16b));var _0x4afd=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0xafd4[_0x5774be];return _0x4914b4;};'use strict';var Sequelize=require('sequelize');module[_0x4afd('0x0')]={'name':{'type':Sequelize[_0x4afd('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x4afd('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 7d97b91..0dbe6cd 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 _0x63c9=['sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','end','stack','name','Dashboard','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','key','field','options','count','includeAll','include','findAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','destroy','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','addItem','getItems','findOne','DashboardItem','filter','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x63c9,0x140));var _0x963c=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0x63c9[_0x3ea913];return _0x2b4f28;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x963c('0x0'));var zipdir=require(_0x963c('0x1'));var jsonpatch=require(_0x963c('0x2'));var rp=require(_0x963c('0x3'));var moment=require(_0x963c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x963c('0x5'));var util=require('util');var path=require(_0x963c('0x6'));var sox=require(_0x963c('0x7'));var csv=require(_0x963c('0x8'));var ejs=require(_0x963c('0x9'));var fs=require('fs');var _=require(_0x963c('0xa'));var squel=require('squel');var crypto=require(_0x963c('0xb'));var jsforce=require(_0x963c('0xc'));var deskjs=require(_0x963c('0xd'));var toCsv=require(_0x963c('0x8'));var querystring=require(_0x963c('0xe'));var Papa=require(_0x963c('0xf'));var Redis=require(_0x963c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x963c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x963c('0x12'))(_0x963c('0x13'));var utils=require('../../config/utils');var config=require(_0x963c('0x14'));var db=require('../../mysqldb')['db'];config[_0x963c('0x15')]=_[_0x963c('0x16')](config[_0x963c('0x15')],{'host':_0x963c('0x17'),'port':0x18eb});var socket=require(_0x963c('0x18'))(new Redis(config[_0x963c('0x15')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x1637b7,_0x29aa14){_0x29aa14=_0x29aa14||0xcc;return function(_0x4f701e){if(_0x4f701e){return _0x1637b7[_0x963c('0x19')](_0x29aa14);}return _0x1637b7[_0x963c('0x1a')](_0x29aa14)['end']();};}function respondWithResult(_0xb58ce6,_0xf4cdc7){_0xf4cdc7=_0xf4cdc7||0xc8;return function(_0x52f3ae){if(_0x52f3ae){return _0xb58ce6[_0x963c('0x1a')](_0xf4cdc7)[_0x963c('0x1b')](_0x52f3ae);}};}function respondWithFilteredResult(_0x8b2e94,_0x59b4e4){return function(_0x3463a6){if(_0x3463a6){var _0x3583b0=_0x3463a6['count'],_0x59424a=_0x59b4e4[_0x963c('0x1c')],_0x1ae9d4=_0x59b4e4[_0x963c('0x1c')]+_0x59b4e4[_0x963c('0x1d')],_0x5d3894;if(_0x1ae9d4>=_0x3583b0){_0x1ae9d4=_0x3583b0;_0x5d3894=0xc8;}else{_0x5d3894=0xce;}_0x8b2e94[_0x963c('0x1a')](_0x5d3894);return _0x8b2e94[_0x963c('0x1e')](_0x963c('0x1f'),_0x59424a+'-'+_0x1ae9d4+'/'+_0x3583b0)['json'](_0x3463a6);}return null;};}function patchUpdates(_0x4561b0){return function(_0x5f1835){try{jsonpatch[_0x963c('0x20')](_0x5f1835,_0x4561b0,!![]);}catch(_0x484c1c){return BPromise[_0x963c('0x21')](_0x484c1c);}return _0x5f1835[_0x963c('0x22')]();};}function saveUpdates(_0xab3a2e,_0x5c3313){return function(_0x1bd5f5){if(_0x1bd5f5){return _0x1bd5f5[_0x963c('0x23')](_0xab3a2e)['then'](function(_0x33d803){return _0x33d803;});}return null;};}function removeEntity(_0x169b26,_0x357adc){return function(_0x2c276a){if(_0x2c276a){return _0x2c276a['destroy']()[_0x963c('0x24')](function(){var _0x56b0a2=_0x2c276a[_0x963c('0x25')]({'plain':!![]});var _0x2febb2=_0x963c('0x26');return db[_0x963c('0x27')]['destroy']({'where':{'type':_0x2febb2,'resourceId':_0x56b0a2['id']}})[_0x963c('0x24')](function(){return _0x2c276a;});})[_0x963c('0x24')](function(){_0x169b26[_0x963c('0x1a')](0xcc)[_0x963c('0x28')]();});}};}function handleEntityNotFound(_0x140369,_0x3d0213){return function(_0x4ad55e){if(!_0x4ad55e){_0x140369[_0x963c('0x19')](0x194);}return _0x4ad55e;};}function handleError(_0x2ef4c8,_0x19f025){_0x19f025=_0x19f025||0x1f4;return function(_0x238923){logger['error'](_0x238923[_0x963c('0x29')]);if(_0x238923[_0x963c('0x2a')]){delete _0x238923[_0x963c('0x2a')];}_0x2ef4c8[_0x963c('0x1a')](_0x19f025)['send'](_0x238923);};}exports['index']=function(_0x394144,_0x5828c4){var _0x20efb2={},_0x17cd00={},_0xa39deb={'count':0x0,'rows':[]};var _0xb66d30=db[_0x963c('0x2b')][_0x963c('0x2c')];_0x17cd00[_0x963c('0x2d')]=_[_0x963c('0x2e')](_0xb66d30);_0x17cd00[_0x963c('0x2f')]=_[_0x963c('0x2e')](_0x394144[_0x963c('0x2f')]);_0x17cd00[_0x963c('0x30')]=_[_0x963c('0x31')](_0x17cd00[_0x963c('0x2d')],_0x17cd00['query']);_0x20efb2[_0x963c('0x32')]=_[_0x963c('0x31')](_0x17cd00['model'],qs[_0x963c('0x33')](_0x394144[_0x963c('0x2f')]['fields']));_0x20efb2[_0x963c('0x32')]=_0x20efb2[_0x963c('0x32')]['length']?_0x20efb2['attributes']:_0x17cd00[_0x963c('0x2d')];if(!_0x394144[_0x963c('0x2f')][_0x963c('0x34')](_0x963c('0x35'))){_0x20efb2['limit']=qs[_0x963c('0x1d')](_0x394144[_0x963c('0x2f')][_0x963c('0x1d')]);_0x20efb2[_0x963c('0x1c')]=qs['offset'](_0x394144[_0x963c('0x2f')][_0x963c('0x1c')]);}_0x20efb2[_0x963c('0x36')]=qs['sort'](_0x394144[_0x963c('0x2f')][_0x963c('0x37')]);_0x20efb2[_0x963c('0x38')]=qs[_0x963c('0x30')](_[_0x963c('0x39')](_0x394144[_0x963c('0x2f')],_0x17cd00['filters']));if(_0x394144[_0x963c('0x2f')]['filter']){_0x20efb2[_0x963c('0x38')]=_[_0x963c('0x3a')](_0x20efb2[_0x963c('0x38')],{'$or':_[_0x963c('0x3b')](_0xb66d30,function(_0x4c9cac){if(_0x4c9cac[_0x963c('0x3c')][_0x963c('0x3d')]!=='VIRTUAL'){var _0x1b0a55={};_0x1b0a55[_0x4c9cac[_0x963c('0x3e')]]={'$like':'%'+_0x394144['query']['filter']+'%'};return _0x1b0a55;}})});}_0x20efb2=_[_0x963c('0x3a')]({},_0x20efb2,_0x394144[_0x963c('0x3f')]);var _0x3af3b4={'where':_0x20efb2[_0x963c('0x38')]};return db[_0x963c('0x2b')][_0x963c('0x40')](_0x3af3b4)[_0x963c('0x24')](function(_0x36d97e){_0xa39deb[_0x963c('0x40')]=_0x36d97e;if(_0x394144[_0x963c('0x2f')][_0x963c('0x41')]){_0x20efb2[_0x963c('0x42')]=[{'all':!![]}];}return db[_0x963c('0x2b')][_0x963c('0x43')](_0x20efb2);})[_0x963c('0x24')](function(_0x7f9cbd){_0xa39deb['rows']=_0x7f9cbd;return _0xa39deb;})[_0x963c('0x24')](respondWithFilteredResult(_0x5828c4,_0x20efb2))[_0x963c('0x44')](handleError(_0x5828c4,null));};exports[_0x963c('0x45')]=function(_0x5396cb,_0x1b4f53){var _0x23f615={'raw':![],'where':{'id':_0x5396cb[_0x963c('0x46')]['id']}},_0x4be8e0={};_0x4be8e0[_0x963c('0x2d')]=_['keys'](db[_0x963c('0x2b')]['rawAttributes']);_0x4be8e0[_0x963c('0x2f')]=_['keys'](_0x5396cb[_0x963c('0x2f')]);_0x4be8e0['filters']=_[_0x963c('0x31')](_0x4be8e0['model'],_0x4be8e0[_0x963c('0x2f')]);_0x23f615[_0x963c('0x32')]=_[_0x963c('0x31')](_0x4be8e0[_0x963c('0x2d')],qs[_0x963c('0x33')](_0x5396cb[_0x963c('0x2f')]['fields']));_0x23f615['attributes']=_0x23f615['attributes'][_0x963c('0x47')]?_0x23f615[_0x963c('0x32')]:_0x4be8e0[_0x963c('0x2d')];if(_0x5396cb[_0x963c('0x2f')]['includeAll']){_0x23f615['include']=[{'all':!![]}];}_0x23f615=_[_0x963c('0x3a')]({},_0x23f615,_0x5396cb['options']);return db[_0x963c('0x2b')][_0x963c('0x48')](_0x23f615)[_0x963c('0x24')](handleEntityNotFound(_0x1b4f53,null))[_0x963c('0x24')](respondWithResult(_0x1b4f53,null))[_0x963c('0x44')](handleError(_0x1b4f53,null));};exports[_0x963c('0x49')]=function(_0x56bc2e,_0x11546e){return db[_0x963c('0x2b')][_0x963c('0x49')](_0x56bc2e[_0x963c('0x4a')],{})[_0x963c('0x24')](function(_0xa80ddd){var _0x1457ed=_0x56bc2e[_0x963c('0x4b')][_0x963c('0x25')]({'plain':!![]});if(!_0x1457ed)throw new Error(_0x963c('0x4c'));if(_0x1457ed['role']==='user'){var _0x25beb8=_0xa80ddd['get']({'plain':!![]});var _0x2270e3=_0x963c('0x26');return db[_0x963c('0x4d')][_0x963c('0x48')]({'where':{'name':_0x2270e3,'userProfileId':_0x1457ed[_0x963c('0x4e')]},'raw':!![]})[_0x963c('0x24')](function(_0x5acf49){if(_0x5acf49&&_0x5acf49['autoAssociation']===0x0){return db[_0x963c('0x27')]['create']({'name':_0x25beb8['name'],'resourceId':_0x25beb8['id'],'type':_0x5acf49[_0x963c('0x2a')],'sectionId':_0x5acf49['id']},{})[_0x963c('0x24')](function(){return _0xa80ddd;});}else{return _0xa80ddd;}})[_0x963c('0x44')](function(_0x3719af){logger[_0x963c('0x4f')](_0x963c('0x50'),_0x3719af);throw _0x3719af;});}return _0xa80ddd;})[_0x963c('0x24')](respondWithResult(_0x11546e,0xc9))['catch'](handleError(_0x11546e,null));};exports[_0x963c('0x51')]=function(_0x52b88a,_0x3d3c1d){var _0x4d4fe8={'raw':![],'where':{'id':_0x52b88a['params']['id']}},_0x25fbec={};_0x25fbec[_0x963c('0x2d')]=_[_0x963c('0x2e')](db[_0x963c('0x2b')][_0x963c('0x2c')]);_0x4d4fe8['attributes']=_[_0x963c('0x31')](_0x25fbec[_0x963c('0x2d')],qs[_0x963c('0x33')](_0x52b88a[_0x963c('0x2f')][_0x963c('0x33')]));_0x4d4fe8[_0x963c('0x32')]=_0x4d4fe8[_0x963c('0x32')][_0x963c('0x47')]?_0x4d4fe8[_0x963c('0x32')]:_0x25fbec[_0x963c('0x2d')];if(_0x52b88a[_0x963c('0x2f')][_0x963c('0x41')]){_0x4d4fe8[_0x963c('0x42')]=[{'all':!![]}];}_0x4d4fe8=_[_0x963c('0x3a')]({},_0x4d4fe8,_0x52b88a[_0x963c('0x3f')]);return db[_0x963c('0x2b')][_0x963c('0x48')](_0x4d4fe8)[_0x963c('0x24')](handleEntityNotFound(_0x3d3c1d,null))[_0x963c('0x24')](function(_0x1ed148){if(_0x1ed148){var _0x59c5bb=_0x1ed148['get']({'plain':!![]});_0x59c5bb=qs[_0x963c('0x52')](_0x59c5bb,['id',_0x963c('0x53'),_0x963c('0x54')]);_0x52b88a[_0x963c('0x4a')]=_['omit'](_0x52b88a['body'],['id',_0x963c('0x53'),'updatedAt']);return db[_0x963c('0x2b')][_0x963c('0x49')](_[_0x963c('0x3a')](_0x59c5bb,_0x52b88a[_0x963c('0x4a')]),{'include':_0x52b88a[_0x963c('0x2f')][_0x963c('0x41')]?[{'all':!![]}]:undefined})[_0x963c('0x24')](function(_0xba6377){var _0x48335d=_0x52b88a['user'][_0x963c('0x25')]({'plain':!![]});if(!_0x48335d)throw new Error(_0x963c('0x4c'));if(_0x48335d[_0x963c('0x55')]===_0x963c('0x4b')){var _0x46d7a4=_0xba6377[_0x963c('0x25')]({'plain':!![]});var _0x9519c4=_0x963c('0x26');return db[_0x963c('0x4d')][_0x963c('0x48')]({'where':{'name':_0x9519c4,'userProfileId':_0x48335d[_0x963c('0x4e')]},'raw':!![]})[_0x963c('0x24')](function(_0x207548){if(_0x207548&&_0x207548['autoAssociation']===0x0){return db['UserProfileResource'][_0x963c('0x49')]({'name':_0x46d7a4[_0x963c('0x2a')],'resourceId':_0x46d7a4['id'],'type':_0x207548[_0x963c('0x2a')],'sectionId':_0x207548['id']},{})[_0x963c('0x24')](function(){return _0xba6377;});}else{return _0xba6377;}})[_0x963c('0x44')](function(_0xceaa00){logger[_0x963c('0x4f')](_0x963c('0x50'),_0xceaa00);throw _0xceaa00;});}return _0xba6377;});}})[_0x963c('0x24')](respondWithResult(_0x3d3c1d,0xc9))[_0x963c('0x44')](handleError(_0x3d3c1d,null));};exports[_0x963c('0x23')]=function(_0x2f0f48,_0x418b38){if(_0x2f0f48[_0x963c('0x4a')]['id']){delete _0x2f0f48[_0x963c('0x4a')]['id'];}return db[_0x963c('0x2b')][_0x963c('0x48')]({'where':{'id':_0x2f0f48['params']['id']}})['then'](handleEntityNotFound(_0x418b38,null))[_0x963c('0x24')](saveUpdates(_0x2f0f48['body'],null))['then'](respondWithResult(_0x418b38,null))[_0x963c('0x44')](handleError(_0x418b38,null));};exports[_0x963c('0x56')]=function(_0xe632b2,_0x259340){return db[_0x963c('0x2b')][_0x963c('0x48')]({'where':{'id':_0xe632b2[_0x963c('0x46')]['id']}})[_0x963c('0x24')](handleEntityNotFound(_0x259340,null))[_0x963c('0x24')](removeEntity(_0x259340,null))[_0x963c('0x44')](handleError(_0x259340,null));};function widgetAttributes(_0x3a7c28){try{switch(_0x3a7c28[_0x963c('0x3c')]){case'iframe':return[{'name':_0x963c('0x57'),'value':_0x3a7c28[_0x963c('0x57')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28['attrs'][0x0]?_0x3a7c28[_0x963c('0x58')][0x0][_0x963c('0x59')]:undefined)||_0x963c('0x5a')}];case _0x963c('0x5b'):return[{'name':'attrPath','value':_0x3a7c28[_0x963c('0x5c')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x0]?_0x3a7c28[_0x963c('0x58')][0x0][_0x963c('0x59')]:undefined)||''}];case _0x963c('0x5d'):return[{'name':_0x963c('0x5e'),'value':_0x3a7c28[_0x963c('0x5e')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28['attrs'][0x0]?_0x3a7c28[_0x963c('0x58')][0x0]['value']:undefined)||_0x963c('0x5f')},{'name':_0x963c('0x60'),'value':_0x3a7c28[_0x963c('0x60')]||(_0x3a7c28['attrs']&&_0x3a7c28[_0x963c('0x58')][0x1]?_0x3a7c28['attrs'][0x1][_0x963c('0x59')]:undefined)||_0x963c('0x61')},{'name':'attrFontSize','value':_0x3a7c28[_0x963c('0x62')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x2]?_0x3a7c28[_0x963c('0x58')][0x2]['value']:undefined)||0xc}];case _0x963c('0x63'):return[{'name':_0x963c('0x64'),'value':_0x3a7c28[_0x963c('0x64')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28['attrs'][0x0]?_0x3a7c28['attrs'][0x0][_0x963c('0x59')]:undefined)||_0x963c('0x65')},{'name':'attrVoiceQueues','value':_0x3a7c28[_0x963c('0x66')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x1]?_0x3a7c28['attrs'][0x1]['value']:undefined)||[]},{'name':_0x963c('0x62'),'value':_0x3a7c28[_0x963c('0x62')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x2]?_0x3a7c28[_0x963c('0x58')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x963c('0x67'),'value':_0x3a7c28[_0x963c('0x67')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x0]?_0x3a7c28[_0x963c('0x58')][0x0]['value']:undefined)||_0x963c('0x65')},{'name':_0x963c('0x68'),'value':_0x3a7c28[_0x963c('0x68')]||(_0x3a7c28['attrs']&&_0x3a7c28[_0x963c('0x58')][0x1]?_0x3a7c28['attrs'][0x1]['value']:undefined)||null},{'name':_0x963c('0x69'),'value':_0x3a7c28[_0x963c('0x69')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28['attrs'][0x2]?_0x3a7c28[_0x963c('0x58')][0x2][_0x963c('0x59')]:undefined)||null},{'name':_0x963c('0x66'),'value':_0x3a7c28[_0x963c('0x66')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x3]?_0x3a7c28[_0x963c('0x58')][0x3][_0x963c('0x59')]:undefined)||[]}];case _0x963c('0x6a'):return[{'name':_0x963c('0x6b'),'type':_0x3a7c28['reportType']||(_0x3a7c28['attrs']&&_0x3a7c28[_0x963c('0x58')][0x0]?_0x3a7c28[_0x963c('0x58')][0x0][_0x963c('0x3c')]:undefined)||null,'value':_0x3a7c28[_0x963c('0x6b')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x0]?_0x3a7c28['attrs'][0x0][_0x963c('0x59')]:undefined)||null},{'name':'attrRefresh','value':_0x3a7c28[_0x963c('0x6c')]||(_0x3a7c28[_0x963c('0x58')]&&_0x3a7c28[_0x963c('0x58')][0x1]?_0x3a7c28[_0x963c('0x58')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5c9292){logger[_0x963c('0x4f')]('widgetAttributes:\x20%s',JSON[_0x963c('0x6d')](_0x5c9292));return[];}}exports[_0x963c('0x6e')]=function(_0x3714a5,_0x342ce0,_0x5de781){if(_0x3714a5[_0x963c('0x4a')]['id']){delete _0x3714a5[_0x963c('0x4a')]['id'];}return db[_0x963c('0x2b')][_0x963c('0x48')]({'where':{'id':_0x3714a5[_0x963c('0x46')]['id']}})[_0x963c('0x24')](handleEntityNotFound(_0x342ce0,null))[_0x963c('0x24')](function(_0x173f09){if(_0x173f09){_0x3714a5[_0x963c('0x4a')]['DashboardId']=_0x173f09['id'];_0x3714a5[_0x963c('0x4a')][_0x963c('0x58')]=widgetAttributes(_0x3714a5[_0x963c('0x4a')]);return db['DashboardItem']['create'](_0x3714a5[_0x963c('0x4a')]);}})[_0x963c('0x24')](respondWithResult(_0x342ce0,null))[_0x963c('0x44')](handleError(_0x342ce0,null));};exports[_0x963c('0x6f')]=function(_0x483eaf,_0x1fe1ed,_0x28fc21){var _0x131a14={};var _0x51c081={};var _0x189c85;var _0x3fb3b6;return db['Dashboard'][_0x963c('0x70')]({'where':{'id':_0x483eaf['params']['id']}})[_0x963c('0x24')](handleEntityNotFound(_0x1fe1ed,null))[_0x963c('0x24')](function(_0x879d9d){if(_0x879d9d){_0x189c85=_0x879d9d;_0x51c081[_0x963c('0x2d')]=_[_0x963c('0x2e')](db[_0x963c('0x71')][_0x963c('0x2c')]);_0x51c081[_0x963c('0x2f')]=_[_0x963c('0x2e')](_0x483eaf[_0x963c('0x2f')]);_0x51c081[_0x963c('0x30')]=_[_0x963c('0x31')](_0x51c081[_0x963c('0x2d')],_0x51c081[_0x963c('0x2f')]);_0x131a14['attributes']=_[_0x963c('0x31')](_0x51c081['model'],qs[_0x963c('0x33')](_0x483eaf[_0x963c('0x2f')][_0x963c('0x33')]));_0x131a14['attributes']=_0x131a14['attributes'][_0x963c('0x47')]?_0x131a14[_0x963c('0x32')]:_0x51c081[_0x963c('0x2d')];_0x131a14[_0x963c('0x36')]=qs[_0x963c('0x37')](_0x483eaf[_0x963c('0x2f')]['sort']);_0x131a14['where']=qs[_0x963c('0x30')](_['pick'](_0x483eaf['query'],_0x51c081[_0x963c('0x30')]));if(_0x483eaf['query'][_0x963c('0x72')]){_0x131a14['where']=_['merge'](_0x131a14[_0x963c('0x38')],{'$or':_[_0x963c('0x3b')](_0x131a14['attributes'],function(_0x25747b){var _0x2f2c7e={};_0x2f2c7e[_0x25747b]={'$like':'%'+_0x483eaf[_0x963c('0x2f')][_0x963c('0x72')]+'%'};return _0x2f2c7e;})});}_0x131a14=_['merge']({},_0x131a14,_0x483eaf[_0x963c('0x3f')]);return _0x189c85[_0x963c('0x6f')](_0x131a14);}})[_0x963c('0x24')](function(_0x1131ca){if(_0x1131ca){_0x3fb3b6=_0x1131ca[_0x963c('0x47')];if(!_0x483eaf[_0x963c('0x2f')][_0x963c('0x34')](_0x963c('0x35'))){_0x131a14[_0x963c('0x1d')]=qs[_0x963c('0x1d')](_0x483eaf[_0x963c('0x2f')]['limit']);_0x131a14[_0x963c('0x1c')]=qs[_0x963c('0x1c')](_0x483eaf[_0x963c('0x2f')][_0x963c('0x1c')]);}return _0x189c85[_0x963c('0x6f')](_0x131a14);}})[_0x963c('0x24')](function(_0xa41ae8){if(_0xa41ae8){return _0xa41ae8?{'count':_0x3fb3b6,'rows':_0xa41ae8}:null;}})[_0x963c('0x24')](respondWithResult(_0x1fe1ed,null))['catch'](handleError(_0x1fe1ed,null));}; \ No newline at end of file +var _0xdeb7=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','stack','name','send','index','Dashboard','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','type','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','stringify','DashboardId','DashboardItem','getItems','findOne','sort','map','html-pdf'];(function(_0x37c2b7,_0x29c081){var _0x1e5e30=function(_0x686709){while(--_0x686709){_0x37c2b7['push'](_0x37c2b7['shift']());}};_0x1e5e30(++_0x29c081);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var pdf=require(_0x7deb('0x0'));var emlformat=require(_0x7deb('0x1'));var rimraf=require(_0x7deb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7deb('0x3'));var rp=require(_0x7deb('0x4'));var moment=require(_0x7deb('0x5'));var BPromise=require(_0x7deb('0x6'));var Mustache=require(_0x7deb('0x7'));var util=require('util');var path=require(_0x7deb('0x8'));var sox=require(_0x7deb('0x9'));var csv=require(_0x7deb('0xa'));var ejs=require(_0x7deb('0xb'));var fs=require('fs');var _=require(_0x7deb('0xc'));var squel=require(_0x7deb('0xd'));var crypto=require('crypto');var jsforce=require(_0x7deb('0xe'));var deskjs=require(_0x7deb('0xf'));var toCsv=require(_0x7deb('0xa'));var querystring=require(_0x7deb('0x10'));var Papa=require('papaparse');var Redis=require(_0x7deb('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7deb('0x12'));var logger=require('../../config/logger')(_0x7deb('0x13'));var utils=require(_0x7deb('0x14'));var config=require(_0x7deb('0x15'));var db=require('../../mysqldb')['db'];config[_0x7deb('0x16')]=_[_0x7deb('0x17')](config[_0x7deb('0x16')],{'host':_0x7deb('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7deb('0x16')]));require(_0x7deb('0x19'))[_0x7deb('0x1a')](socket);function respondWithStatusCode(_0x290f7a,_0xdf8efb){_0xdf8efb=_0xdf8efb||0xcc;return function(_0x2b784f){if(_0x2b784f){return _0x290f7a[_0x7deb('0x1b')](_0xdf8efb);}return _0x290f7a[_0x7deb('0x1c')](_0xdf8efb)[_0x7deb('0x1d')]();};}function respondWithResult(_0x405ae6,_0x470e07){_0x470e07=_0x470e07||0xc8;return function(_0x4764e3){if(_0x4764e3){return _0x405ae6[_0x7deb('0x1c')](_0x470e07)[_0x7deb('0x1e')](_0x4764e3);}};}function respondWithFilteredResult(_0xbe8e2a,_0x5b7f1e){return function(_0x13831c){if(_0x13831c){var _0x50e4ec=_0x13831c[_0x7deb('0x1f')],_0x2241a3=_0x5b7f1e[_0x7deb('0x20')],_0xbd6ea8=_0x5b7f1e[_0x7deb('0x20')]+_0x5b7f1e[_0x7deb('0x21')],_0x5439ac;if(_0xbd6ea8>=_0x50e4ec){_0xbd6ea8=_0x50e4ec;_0x5439ac=0xc8;}else{_0x5439ac=0xce;}_0xbe8e2a[_0x7deb('0x1c')](_0x5439ac);return _0xbe8e2a[_0x7deb('0x22')](_0x7deb('0x23'),_0x2241a3+'-'+_0xbd6ea8+'/'+_0x50e4ec)[_0x7deb('0x1e')](_0x13831c);}return null;};}function patchUpdates(_0x27a448){return function(_0x4e4f8f){try{jsonpatch[_0x7deb('0x24')](_0x4e4f8f,_0x27a448,!![]);}catch(_0x262a0d){return BPromise[_0x7deb('0x25')](_0x262a0d);}return _0x4e4f8f[_0x7deb('0x26')]();};}function saveUpdates(_0x21e061,_0x2f88ca){return function(_0x31dd30){if(_0x31dd30){return _0x31dd30[_0x7deb('0x27')](_0x21e061)['then'](function(_0x3151d6){return _0x3151d6;});}return null;};}function removeEntity(_0x2f1e42,_0x2cb976){return function(_0x529e23){if(_0x529e23){return _0x529e23[_0x7deb('0x28')]()[_0x7deb('0x29')](function(){var _0xde3478=_0x529e23[_0x7deb('0x2a')]({'plain':!![]});var _0x5e2258=_0x7deb('0x2b');return db[_0x7deb('0x2c')][_0x7deb('0x28')]({'where':{'type':_0x5e2258,'resourceId':_0xde3478['id']}})[_0x7deb('0x29')](function(){return _0x529e23;});})[_0x7deb('0x29')](function(){_0x2f1e42[_0x7deb('0x1c')](0xcc)[_0x7deb('0x1d')]();});}};}function handleEntityNotFound(_0x659b9,_0x3b2fe6){return function(_0x28f884){if(!_0x28f884){_0x659b9[_0x7deb('0x1b')](0x194);}return _0x28f884;};}function handleError(_0x2f9d98,_0x45d711){_0x45d711=_0x45d711||0x1f4;return function(_0x14ec6f){logger['error'](_0x14ec6f[_0x7deb('0x2d')]);if(_0x14ec6f['name']){delete _0x14ec6f[_0x7deb('0x2e')];}_0x2f9d98['status'](_0x45d711)[_0x7deb('0x2f')](_0x14ec6f);};}exports[_0x7deb('0x30')]=function(_0x57a062,_0x513bae){var _0x23d74a={},_0x298831={},_0x565349={'count':0x0,'rows':[]};var _0x504899=db[_0x7deb('0x31')][_0x7deb('0x32')];_0x298831[_0x7deb('0x33')]=_[_0x7deb('0x34')](_0x504899);_0x298831[_0x7deb('0x35')]=_[_0x7deb('0x34')](_0x57a062[_0x7deb('0x35')]);_0x298831[_0x7deb('0x36')]=_[_0x7deb('0x37')](_0x298831['model'],_0x298831[_0x7deb('0x35')]);_0x23d74a['attributes']=_[_0x7deb('0x37')](_0x298831[_0x7deb('0x33')],qs[_0x7deb('0x38')](_0x57a062[_0x7deb('0x35')][_0x7deb('0x38')]));_0x23d74a[_0x7deb('0x39')]=_0x23d74a[_0x7deb('0x39')][_0x7deb('0x3a')]?_0x23d74a[_0x7deb('0x39')]:_0x298831[_0x7deb('0x33')];if(!_0x57a062['query'][_0x7deb('0x3b')](_0x7deb('0x3c'))){_0x23d74a['limit']=qs['limit'](_0x57a062['query'][_0x7deb('0x21')]);_0x23d74a['offset']=qs[_0x7deb('0x20')](_0x57a062[_0x7deb('0x35')][_0x7deb('0x20')]);}_0x23d74a[_0x7deb('0x3d')]=qs['sort'](_0x57a062['query']['sort']);_0x23d74a[_0x7deb('0x3e')]=qs[_0x7deb('0x36')](_[_0x7deb('0x3f')](_0x57a062[_0x7deb('0x35')],_0x298831[_0x7deb('0x36')]));if(_0x57a062[_0x7deb('0x35')]['filter']){_0x23d74a['where']=_[_0x7deb('0x40')](_0x23d74a[_0x7deb('0x3e')],{'$or':_['map'](_0x504899,function(_0x35d033){if(_0x35d033['type'][_0x7deb('0x41')]!==_0x7deb('0x42')){var _0x293066={};_0x293066[_0x35d033[_0x7deb('0x43')]]={'$like':'%'+_0x57a062[_0x7deb('0x35')][_0x7deb('0x44')]+'%'};return _0x293066;}})});}_0x23d74a=_['merge']({},_0x23d74a,_0x57a062[_0x7deb('0x45')]);var _0xccae33={'where':_0x23d74a[_0x7deb('0x3e')]};return db[_0x7deb('0x31')]['count'](_0xccae33)[_0x7deb('0x29')](function(_0x50b7d2){_0x565349['count']=_0x50b7d2;if(_0x57a062['query'][_0x7deb('0x46')]){_0x23d74a[_0x7deb('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x7deb('0x48')](_0x23d74a);})[_0x7deb('0x29')](function(_0x5c9e57){_0x565349[_0x7deb('0x49')]=_0x5c9e57;return _0x565349;})['then'](respondWithFilteredResult(_0x513bae,_0x23d74a))['catch'](handleError(_0x513bae,null));};exports[_0x7deb('0x4a')]=function(_0x2dbd49,_0x3ffa6a){var _0x350f6d={'raw':![],'where':{'id':_0x2dbd49[_0x7deb('0x4b')]['id']}},_0x27f82b={};_0x27f82b['model']=_[_0x7deb('0x34')](db[_0x7deb('0x31')][_0x7deb('0x32')]);_0x27f82b[_0x7deb('0x35')]=_[_0x7deb('0x34')](_0x2dbd49[_0x7deb('0x35')]);_0x27f82b[_0x7deb('0x36')]=_['intersection'](_0x27f82b[_0x7deb('0x33')],_0x27f82b[_0x7deb('0x35')]);_0x350f6d[_0x7deb('0x39')]=_[_0x7deb('0x37')](_0x27f82b[_0x7deb('0x33')],qs[_0x7deb('0x38')](_0x2dbd49['query']['fields']));_0x350f6d[_0x7deb('0x39')]=_0x350f6d[_0x7deb('0x39')][_0x7deb('0x3a')]?_0x350f6d[_0x7deb('0x39')]:_0x27f82b[_0x7deb('0x33')];if(_0x2dbd49[_0x7deb('0x35')][_0x7deb('0x46')]){_0x350f6d['include']=[{'all':!![]}];}_0x350f6d=_[_0x7deb('0x40')]({},_0x350f6d,_0x2dbd49[_0x7deb('0x45')]);return db[_0x7deb('0x31')][_0x7deb('0x4c')](_0x350f6d)[_0x7deb('0x29')](handleEntityNotFound(_0x3ffa6a,null))[_0x7deb('0x29')](respondWithResult(_0x3ffa6a,null))[_0x7deb('0x4d')](handleError(_0x3ffa6a,null));};exports[_0x7deb('0x4e')]=function(_0x54adc1,_0x3f4abc){return db['Dashboard'][_0x7deb('0x4e')](_0x54adc1['body'],{})['then'](function(_0x5c9790){var _0x2df040=_0x54adc1['user'][_0x7deb('0x2a')]({'plain':!![]});if(!_0x2df040)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2df040[_0x7deb('0x4f')]===_0x7deb('0x50')){var _0xd47ac=_0x5c9790[_0x7deb('0x2a')]({'plain':!![]});var _0x93f3a2=_0x7deb('0x2b');return db[_0x7deb('0x51')]['find']({'where':{'name':_0x93f3a2,'userProfileId':_0x2df040[_0x7deb('0x52')]},'raw':!![]})[_0x7deb('0x29')](function(_0x5f185c){if(_0x5f185c&&_0x5f185c['autoAssociation']===0x0){return db['UserProfileResource'][_0x7deb('0x4e')]({'name':_0xd47ac[_0x7deb('0x2e')],'resourceId':_0xd47ac['id'],'type':_0x5f185c['name'],'sectionId':_0x5f185c['id']},{})[_0x7deb('0x29')](function(){return _0x5c9790;});}else{return _0x5c9790;}})[_0x7deb('0x4d')](function(_0x1221c3){logger[_0x7deb('0x53')](_0x7deb('0x54'),_0x1221c3);throw _0x1221c3;});}return _0x5c9790;})[_0x7deb('0x29')](respondWithResult(_0x3f4abc,0xc9))['catch'](handleError(_0x3f4abc,null));};exports[_0x7deb('0x55')]=function(_0x4b75b7,_0x320fa4){var _0xbbbe04={'raw':![],'where':{'id':_0x4b75b7[_0x7deb('0x4b')]['id']}},_0xf6ee8a={};_0xf6ee8a[_0x7deb('0x33')]=_[_0x7deb('0x34')](db[_0x7deb('0x31')][_0x7deb('0x32')]);_0xbbbe04[_0x7deb('0x39')]=_[_0x7deb('0x37')](_0xf6ee8a[_0x7deb('0x33')],qs['fields'](_0x4b75b7['query'][_0x7deb('0x38')]));_0xbbbe04[_0x7deb('0x39')]=_0xbbbe04[_0x7deb('0x39')][_0x7deb('0x3a')]?_0xbbbe04[_0x7deb('0x39')]:_0xf6ee8a['model'];if(_0x4b75b7[_0x7deb('0x35')][_0x7deb('0x46')]){_0xbbbe04[_0x7deb('0x47')]=[{'all':!![]}];}_0xbbbe04=_[_0x7deb('0x40')]({},_0xbbbe04,_0x4b75b7['options']);return db[_0x7deb('0x31')][_0x7deb('0x4c')](_0xbbbe04)[_0x7deb('0x29')](handleEntityNotFound(_0x320fa4,null))[_0x7deb('0x29')](function(_0x470bef){if(_0x470bef){var _0x19825a=_0x470bef[_0x7deb('0x2a')]({'plain':!![]});_0x19825a=qs['omit'](_0x19825a,['id',_0x7deb('0x56'),_0x7deb('0x57')]);_0x4b75b7[_0x7deb('0x58')]=_['omit'](_0x4b75b7[_0x7deb('0x58')],['id',_0x7deb('0x56'),'updatedAt']);return db[_0x7deb('0x31')]['create'](_[_0x7deb('0x40')](_0x19825a,_0x4b75b7['body']),{'include':_0x4b75b7['query'][_0x7deb('0x46')]?[{'all':!![]}]:undefined})[_0x7deb('0x29')](function(_0x335567){var _0x2ced48=_0x4b75b7[_0x7deb('0x50')]['get']({'plain':!![]});if(!_0x2ced48)throw new Error(_0x7deb('0x59'));if(_0x2ced48[_0x7deb('0x4f')]===_0x7deb('0x50')){var _0x14794f=_0x335567[_0x7deb('0x2a')]({'plain':!![]});var _0x2e4b62=_0x7deb('0x2b');return db[_0x7deb('0x51')][_0x7deb('0x4c')]({'where':{'name':_0x2e4b62,'userProfileId':_0x2ced48[_0x7deb('0x52')]},'raw':!![]})['then'](function(_0x2d593e){if(_0x2d593e&&_0x2d593e[_0x7deb('0x5a')]===0x0){return db[_0x7deb('0x2c')][_0x7deb('0x4e')]({'name':_0x14794f['name'],'resourceId':_0x14794f['id'],'type':_0x2d593e[_0x7deb('0x2e')],'sectionId':_0x2d593e['id']},{})[_0x7deb('0x29')](function(){return _0x335567;});}else{return _0x335567;}})[_0x7deb('0x4d')](function(_0x3aed0f){logger['error'](_0x7deb('0x54'),_0x3aed0f);throw _0x3aed0f;});}return _0x335567;});}})[_0x7deb('0x29')](respondWithResult(_0x320fa4,0xc9))[_0x7deb('0x4d')](handleError(_0x320fa4,null));};exports[_0x7deb('0x27')]=function(_0x71acf4,_0xc18a71){if(_0x71acf4['body']['id']){delete _0x71acf4['body']['id'];}return db[_0x7deb('0x31')]['find']({'where':{'id':_0x71acf4[_0x7deb('0x4b')]['id']}})[_0x7deb('0x29')](handleEntityNotFound(_0xc18a71,null))[_0x7deb('0x29')](saveUpdates(_0x71acf4[_0x7deb('0x58')],null))[_0x7deb('0x29')](respondWithResult(_0xc18a71,null))['catch'](handleError(_0xc18a71,null));};exports[_0x7deb('0x28')]=function(_0x36cdee,_0x22b89a){return db['Dashboard'][_0x7deb('0x4c')]({'where':{'id':_0x36cdee[_0x7deb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x22b89a,null))[_0x7deb('0x29')](removeEntity(_0x22b89a,null))[_0x7deb('0x4d')](handleError(_0x22b89a,null));};function widgetAttributes(_0x190d86){try{switch(_0x190d86[_0x7deb('0x5b')]){case'iframe':return[{'name':_0x7deb('0x5c'),'value':_0x190d86[_0x7deb('0x5c')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86[_0x7deb('0x5d')][0x0][_0x7deb('0x5e')]:undefined)||'https://'}];case _0x7deb('0x5f'):return[{'name':_0x7deb('0x60'),'value':_0x190d86['attrPath']||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86['attrs'][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5e')]:undefined)||''}];case _0x7deb('0x61'):return[{'name':'attrHourFormat','value':_0x190d86[_0x7deb('0x62')]||(_0x190d86['attrs']&&_0x190d86['attrs'][0x0]?_0x190d86[_0x7deb('0x5d')][0x0][_0x7deb('0x5e')]:undefined)||_0x7deb('0x63')},{'name':_0x7deb('0x64'),'value':_0x190d86[_0x7deb('0x64')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x1]?_0x190d86['attrs'][0x1][_0x7deb('0x5e')]:undefined)||'0.00'},{'name':_0x7deb('0x65'),'value':_0x190d86[_0x7deb('0x65')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x2]?_0x190d86[_0x7deb('0x5d')][0x2]['value']:undefined)||0xc}];case _0x7deb('0x66'):return[{'name':_0x7deb('0x67'),'value':_0x190d86[_0x7deb('0x67')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5e')]:undefined)||'total'},{'name':_0x7deb('0x68'),'value':_0x190d86['attrVoiceQueues']||(_0x190d86['attrs']&&_0x190d86['attrs'][0x1]?_0x190d86['attrs'][0x1][_0x7deb('0x5e')]:undefined)||[]},{'name':'attrFontSize','value':_0x190d86[_0x7deb('0x65')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x2]?_0x190d86[_0x7deb('0x5d')][0x2]['value']:undefined)||0x14}];case _0x7deb('0x69'):case _0x7deb('0x6a'):return[{'name':_0x7deb('0x6b'),'value':_0x190d86['attrSerie1']||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86[_0x7deb('0x5d')][0x0]['value']:undefined)||_0x7deb('0x6c')},{'name':_0x7deb('0x6d'),'value':_0x190d86[_0x7deb('0x6d')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x1]?_0x190d86['attrs'][0x1]['value']:undefined)||null},{'name':_0x7deb('0x6e'),'value':_0x190d86[_0x7deb('0x6e')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86['attrs'][0x2]?_0x190d86['attrs'][0x2][_0x7deb('0x5e')]:undefined)||null},{'name':_0x7deb('0x68'),'value':_0x190d86[_0x7deb('0x68')]||(_0x190d86['attrs']&&_0x190d86[_0x7deb('0x5d')][0x3]?_0x190d86[_0x7deb('0x5d')][0x3][_0x7deb('0x5e')]:undefined)||[]}];case'web-report':return[{'name':_0x7deb('0x6f'),'type':_0x190d86['reportType']||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5b')]:undefined)||null,'value':_0x190d86['attrReport']||(_0x190d86['attrs']&&_0x190d86['attrs'][0x0]?_0x190d86['attrs'][0x0][_0x7deb('0x5e')]:undefined)||null},{'name':_0x7deb('0x70'),'value':_0x190d86[_0x7deb('0x70')]||(_0x190d86[_0x7deb('0x5d')]&&_0x190d86[_0x7deb('0x5d')][0x1]?_0x190d86[_0x7deb('0x5d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3eb200){logger[_0x7deb('0x53')]('widgetAttributes:\x20%s',JSON[_0x7deb('0x71')](_0x3eb200));return[];}}exports['addItem']=function(_0x45e327,_0x2ed32e,_0xa2c8d7){if(_0x45e327[_0x7deb('0x58')]['id']){delete _0x45e327[_0x7deb('0x58')]['id'];}return db[_0x7deb('0x31')][_0x7deb('0x4c')]({'where':{'id':_0x45e327[_0x7deb('0x4b')]['id']}})[_0x7deb('0x29')](handleEntityNotFound(_0x2ed32e,null))['then'](function(_0x5e306d){if(_0x5e306d){_0x45e327[_0x7deb('0x58')][_0x7deb('0x72')]=_0x5e306d['id'];_0x45e327[_0x7deb('0x58')]['attrs']=widgetAttributes(_0x45e327[_0x7deb('0x58')]);return db[_0x7deb('0x73')][_0x7deb('0x4e')](_0x45e327[_0x7deb('0x58')]);}})[_0x7deb('0x29')](respondWithResult(_0x2ed32e,null))[_0x7deb('0x4d')](handleError(_0x2ed32e,null));};exports[_0x7deb('0x74')]=function(_0x1c6908,_0x183769,_0x16b87d){var _0x24b766={};var _0x5ec50e={};var _0x275dc2;var _0x110f5e;return db[_0x7deb('0x31')][_0x7deb('0x75')]({'where':{'id':_0x1c6908['params']['id']}})[_0x7deb('0x29')](handleEntityNotFound(_0x183769,null))[_0x7deb('0x29')](function(_0x479228){if(_0x479228){_0x275dc2=_0x479228;_0x5ec50e[_0x7deb('0x33')]=_['keys'](db[_0x7deb('0x73')][_0x7deb('0x32')]);_0x5ec50e[_0x7deb('0x35')]=_['keys'](_0x1c6908[_0x7deb('0x35')]);_0x5ec50e[_0x7deb('0x36')]=_[_0x7deb('0x37')](_0x5ec50e[_0x7deb('0x33')],_0x5ec50e['query']);_0x24b766[_0x7deb('0x39')]=_[_0x7deb('0x37')](_0x5ec50e[_0x7deb('0x33')],qs[_0x7deb('0x38')](_0x1c6908['query'][_0x7deb('0x38')]));_0x24b766[_0x7deb('0x39')]=_0x24b766[_0x7deb('0x39')][_0x7deb('0x3a')]?_0x24b766['attributes']:_0x5ec50e[_0x7deb('0x33')];_0x24b766['order']=qs[_0x7deb('0x76')](_0x1c6908[_0x7deb('0x35')][_0x7deb('0x76')]);_0x24b766['where']=qs['filters'](_[_0x7deb('0x3f')](_0x1c6908[_0x7deb('0x35')],_0x5ec50e[_0x7deb('0x36')]));if(_0x1c6908[_0x7deb('0x35')][_0x7deb('0x44')]){_0x24b766[_0x7deb('0x3e')]=_['merge'](_0x24b766['where'],{'$or':_[_0x7deb('0x77')](_0x24b766[_0x7deb('0x39')],function(_0x1d0b6e){var _0x5a84dc={};_0x5a84dc[_0x1d0b6e]={'$like':'%'+_0x1c6908[_0x7deb('0x35')][_0x7deb('0x44')]+'%'};return _0x5a84dc;})});}_0x24b766=_[_0x7deb('0x40')]({},_0x24b766,_0x1c6908[_0x7deb('0x45')]);return _0x275dc2[_0x7deb('0x74')](_0x24b766);}})[_0x7deb('0x29')](function(_0x23bd52){if(_0x23bd52){_0x110f5e=_0x23bd52[_0x7deb('0x3a')];if(!_0x1c6908[_0x7deb('0x35')][_0x7deb('0x3b')](_0x7deb('0x3c'))){_0x24b766[_0x7deb('0x21')]=qs['limit'](_0x1c6908[_0x7deb('0x35')][_0x7deb('0x21')]);_0x24b766[_0x7deb('0x20')]=qs[_0x7deb('0x20')](_0x1c6908[_0x7deb('0x35')][_0x7deb('0x20')]);}return _0x275dc2[_0x7deb('0x74')](_0x24b766);}})[_0x7deb('0x29')](function(_0x3efbf6){if(_0x3efbf6){return _0x3efbf6?{'count':_0x110f5e,'rows':_0x3efbf6}:null;}})['then'](respondWithResult(_0x183769,null))[_0x7deb('0x4d')](handleError(_0x183769,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 0b2f9ee..0c17f7d 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 _0xfaef=['emit','hasOwnProperty','hook','exports','Dashboard','setMaxListeners','save','update','remove'];(function(_0xdf5462,_0x66522a){var _0x12bcb0=function(_0x467132){while(--_0x467132){_0xdf5462['push'](_0xdf5462['shift']());}};_0x12bcb0(++_0x66522a);}(_0xfaef,0x70));var _0xffae=function(_0x225697,_0x52ea3e){_0x225697=_0x225697-0x0;var _0x578354=_0xfaef[_0x225697];return _0x578354;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xffae('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xffae('0x1')](0x0);var events={'afterCreate':_0xffae('0x2'),'afterUpdate':_0xffae('0x3'),'afterDestroy':_0xffae('0x4')};function emitEvent(_0x22cfa1){return function(_0x5f0217,_0x5e092c,_0x1d52b3){DashboardEvents['emit'](_0x22cfa1+':'+_0x5f0217['id'],_0x5f0217);DashboardEvents[_0xffae('0x5')](_0x22cfa1,_0x5f0217);_0x1d52b3(null);};}for(var e in events){if(events[_0xffae('0x6')](e)){var event=events[e];Dashboard[_0xffae('0x7')](e,emitEvent(event));}}module[_0xffae('0x8')]=DashboardEvents; \ No newline at end of file +var _0x6739=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x53f964,_0x3b52b8){var _0x17be6c=function(_0x25a732){while(--_0x25a732){_0x53f964['push'](_0x53f964['shift']());}};_0x17be6c(++_0x3b52b8);}(_0x6739,0xe4));var _0x9673=function(_0x3f2930,_0x59313c){_0x3f2930=_0x3f2930-0x0;var _0x5cc939=_0x6739[_0x3f2930];return _0x5cc939;};'use strict';var EventEmitter=require(_0x9673('0x0'));var Dashboard=require(_0x9673('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x9673('0x2')](0x0);var events={'afterCreate':_0x9673('0x3'),'afterUpdate':_0x9673('0x4'),'afterDestroy':'remove'};function emitEvent(_0x546ed2){return function(_0x3f4061,_0x5dc303,_0x527dcd){DashboardEvents['emit'](_0x546ed2+':'+_0x3f4061['id'],_0x3f4061);DashboardEvents[_0x9673('0x5')](_0x546ed2,_0x3f4061);_0x527dcd(null);};}for(var e in events){if(events[_0x9673('0x6')](e)){var event=events[e];Dashboard[_0x9673('0x7')](e,emitEvent(event));}}module[_0x9673('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 16343d3..af65ee1 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 _0x7bb8=['api','moment','request-promise','path','../../config/environment','./dashboard.attributes','dashboards','util','../../config/logger'];(function(_0x507c92,_0x50ea0f){var _0x2d806f=function(_0x19a6d9){while(--_0x19a6d9){_0x507c92['push'](_0x507c92['shift']());}};_0x2d806f(++_0x50ea0f);}(_0x7bb8,0xe8));var _0x87bb=function(_0x1f49cd,_0x5a363e){_0x1f49cd=_0x1f49cd-0x0;var _0x1ee2c2=_0x7bb8[_0x1f49cd];return _0x1ee2c2;};'use strict';var _=require('lodash');var util=require(_0x87bb('0x0'));var logger=require(_0x87bb('0x1'))(_0x87bb('0x2'));var moment=require(_0x87bb('0x3'));var BPromise=require('bluebird');var rp=require(_0x87bb('0x4'));var fs=require('fs');var path=require(_0x87bb('0x5'));var rimraf=require('rimraf');var config=require(_0x87bb('0x6'));var attributes=require(_0x87bb('0x7'));module['exports']=function(_0x38b56d,_0x46622e){return _0x38b56d['define']('Dashboard',attributes,{'tableName':_0x87bb('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5bc=['api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','dashboards','lodash','util','../../config/logger'];(function(_0x352a8e,_0x443baf){var _0x41d3dc=function(_0x2ea51e){while(--_0x2ea51e){_0x352a8e['push'](_0x352a8e['shift']());}};_0x41d3dc(++_0x443baf);}(_0xe5bc,0x8c));var _0xce5b=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0xe5bc[_0x111e94];return _0x3de107;};'use strict';var _=require(_0xce5b('0x0'));var util=require(_0xce5b('0x1'));var logger=require(_0xce5b('0x2'))(_0xce5b('0x3'));var moment=require(_0xce5b('0x4'));var BPromise=require(_0xce5b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce5b('0x6'));var rimraf=require(_0xce5b('0x7'));var config=require(_0xce5b('0x8'));var attributes=require(_0xce5b('0x9'));module[_0xce5b('0xa')]=function(_0x2d890c,_0x59ed4f){return _0x2d890c[_0xce5b('0xb')]('Dashboard',attributes,{'tableName':_0xce5b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index af1857d..e655da0 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 _0xd6ea=['redis','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xd6ea,0x88));var _0xad6e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xd6ea[_0x68c979];return _0x4f0001;};'use strict';var _=require(_0xad6e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xad6e('0x1'));var rs=require(_0xad6e('0x2'));var fs=require('fs');var Redis=require(_0xad6e('0x3'));var db=require(_0xad6e('0x4'))['db'];var utils=require(_0xad6e('0x5'));var logger=require(_0xad6e('0x6'))(_0xad6e('0x7'));var config=require('../../config/environment');var jayson=require(_0xad6e('0x8'));var client=jayson[_0xad6e('0x9')][_0xad6e('0xa')]({'port':0x232a});config['redis']=_[_0xad6e('0xb')](config['redis'],{'host':_0xad6e('0xc'),'port':0x18eb});var socket=require(_0xad6e('0xd'))(new Redis(config[_0xad6e('0xe')]));require(_0xad6e('0xf'))[_0xad6e('0x10')](socket);function respondWithRpcPromise(_0x3534e7,_0x932661,_0x44d9c5){return new BPromise(function(_0x202437,_0x2b4b3f){return client[_0xad6e('0x11')](_0x3534e7,_0x44d9c5)[_0xad6e('0x12')](function(_0x2b38de){logger['info'](_0xad6e('0x13'),_0x932661,_0xad6e('0x14'));logger[_0xad6e('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x932661,_0xad6e('0x14'),JSON['stringify'](_0x2b38de));if(_0x2b38de['error']){if(_0x2b38de[_0xad6e('0x16')]['code']===0x1f4){logger[_0xad6e('0x16')]('Dashboard,\x20%s,\x20%s',_0x932661,_0x2b38de[_0xad6e('0x16')]['message']);return _0x2b4b3f(_0x2b38de[_0xad6e('0x16')]['message']);}logger[_0xad6e('0x16')](_0xad6e('0x13'),_0x932661,_0x2b38de[_0xad6e('0x16')][_0xad6e('0x17')]);return _0x202437(_0x2b38de['error'][_0xad6e('0x17')]);}else{logger['info']('Dashboard,\x20%s,\x20%s',_0x932661,_0xad6e('0x14'));_0x202437(_0x2b38de['result']['message']);}})[_0xad6e('0x18')](function(_0x28b352){logger[_0xad6e('0x16')]('Dashboard,\x20%s,\x20%s',_0x932661,_0x28b352);_0x2b4b3f(_0x28b352);});});} \ No newline at end of file +var _0xb576=['socket.io-emitter','./dashboard.socket','register','then','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x46f221,_0x211dab){var _0x5d510b=function(_0x2c4065){while(--_0x2c4065){_0x46f221['push'](_0x46f221['shift']());}};_0x5d510b(++_0x211dab);}(_0xb576,0x112));var _0x6b57=function(_0x321eeb,_0x1a3845){_0x321eeb=_0x321eeb-0x0;var _0x4f61f1=_0xb576[_0x321eeb];return _0x4f61f1;};'use strict';var _=require(_0x6b57('0x0'));var util=require('util');var moment=require(_0x6b57('0x1'));var BPromise=require(_0x6b57('0x2'));var rs=require(_0x6b57('0x3'));var fs=require('fs');var Redis=require(_0x6b57('0x4'));var db=require(_0x6b57('0x5'))['db'];var utils=require(_0x6b57('0x6'));var logger=require(_0x6b57('0x7'))(_0x6b57('0x8'));var config=require(_0x6b57('0x9'));var jayson=require(_0x6b57('0xa'));var client=jayson[_0x6b57('0xb')][_0x6b57('0xc')]({'port':0x232a});config[_0x6b57('0xd')]=_[_0x6b57('0xe')](config[_0x6b57('0xd')],{'host':_0x6b57('0xf'),'port':0x18eb});var socket=require(_0x6b57('0x10'))(new Redis(config[_0x6b57('0xd')]));require(_0x6b57('0x11'))[_0x6b57('0x12')](socket);function respondWithRpcPromise(_0x159757,_0x377c6f,_0x2e73a9){return new BPromise(function(_0x26c484,_0x284f38){return client['request'](_0x159757,_0x2e73a9)[_0x6b57('0x13')](function(_0x37b65d){logger['info'](_0x6b57('0x14'),_0x377c6f,_0x6b57('0x15'));logger['debug'](_0x6b57('0x16'),_0x377c6f,_0x6b57('0x15'),JSON[_0x6b57('0x17')](_0x37b65d));if(_0x37b65d[_0x6b57('0x18')]){if(_0x37b65d[_0x6b57('0x18')][_0x6b57('0x19')]===0x1f4){logger[_0x6b57('0x18')]('Dashboard,\x20%s,\x20%s',_0x377c6f,_0x37b65d[_0x6b57('0x18')]['message']);return _0x284f38(_0x37b65d[_0x6b57('0x18')][_0x6b57('0x1a')]);}logger[_0x6b57('0x18')](_0x6b57('0x14'),_0x377c6f,_0x37b65d[_0x6b57('0x18')]['message']);return _0x26c484(_0x37b65d[_0x6b57('0x18')]['message']);}else{logger['info'](_0x6b57('0x14'),_0x377c6f,_0x6b57('0x15'));_0x26c484(_0x37b65d[_0x6b57('0x1b')][_0x6b57('0x1a')]);}})[_0x6b57('0x1c')](function(_0x4f59bd){logger[_0x6b57('0x18')](_0x6b57('0x14'),_0x377c6f,_0x4f59bd);_0x284f38(_0x4f59bd);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 316f84e..f70659e 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 _0x3bb2=['removeListener','length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x40f104,_0x209989){var _0x2d4a73=function(_0x5c4692){while(--_0x5c4692){_0x40f104['push'](_0x40f104['shift']());}};_0x2d4a73(++_0x209989);}(_0x3bb2,0x193));var _0x23bb=function(_0x476a5a,_0x27ea48){_0x476a5a=_0x476a5a-0x0;var _0x402dd4=_0x3bb2[_0x476a5a];return _0x402dd4;};'use strict';var DashboardEvents=require(_0x23bb('0x0'));var events=[_0x23bb('0x1'),_0x23bb('0x2'),_0x23bb('0x3')];function createListener(_0x41a30c,_0x343eba){return function(_0x105ccf){_0x343eba[_0x23bb('0x4')](_0x41a30c,_0x105ccf);};}function removeListener(_0x297621,_0x4dbfe9){return function(){DashboardEvents[_0x23bb('0x5')](_0x297621,_0x4dbfe9);};}exports['register']=function(_0xf35d16){for(var _0x421dbd=0x0,_0x33d823=events[_0x23bb('0x6')];_0x421dbd<_0x33d823;_0x421dbd++){var _0x546c25=events[_0x421dbd];var _0x2fe66e=createListener(_0x23bb('0x7')+_0x546c25,_0xf35d16);DashboardEvents['on'](_0x546c25,_0x2fe66e);}}; \ No newline at end of file +var _0x074e=['remove','update','emit','removeListener','register','length','dashboard:','./dashboard.events','save'];(function(_0x4af2c3,_0xf4d1f4){var _0x74088=function(_0x5a3cc8){while(--_0x5a3cc8){_0x4af2c3['push'](_0x4af2c3['shift']());}};_0x74088(++_0xf4d1f4);}(_0x074e,0x1d2));var _0xe074=function(_0x3300ee,_0xed60a9){_0x3300ee=_0x3300ee-0x0;var _0x714154=_0x074e[_0x3300ee];return _0x714154;};'use strict';var DashboardEvents=require(_0xe074('0x0'));var events=[_0xe074('0x1'),_0xe074('0x2'),_0xe074('0x3')];function createListener(_0x2e723b,_0x393b62){return function(_0x5141f6){_0x393b62[_0xe074('0x4')](_0x2e723b,_0x5141f6);};}function removeListener(_0x232f52,_0x2cfdde){return function(){DashboardEvents[_0xe074('0x5')](_0x232f52,_0x2cfdde);};}exports[_0xe074('0x6')]=function(_0x3a37ac){for(var _0x588725=0x0,_0x2dcb66=events[_0xe074('0x7')];_0x588725<_0x2dcb66;_0x588725++){var _0x1354f3=events[_0x588725];var _0x14cc8e=createListener(_0xe074('0x8')+_0x1354f3,_0x3a37ac);DashboardEvents['on'](_0x1354f3,_0x14cc8e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 48fe74a..eb8782b 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 _0x507e=['get','index','/:id','isAuthenticated','show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller'];(function(_0x24b1c7,_0x5efea0){var _0x13f3dd=function(_0x3a605b){while(--_0x3a605b){_0x24b1c7['push'](_0x24b1c7['shift']());}};_0x13f3dd(++_0x5efea0);}(_0x507e,0xdd));var _0xe507=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0x507e[_0x34eb31];return _0x254994;};'use strict';var multer=require(_0xe507('0x0'));var util=require(_0xe507('0x1'));var path=require(_0xe507('0x2'));var timeout=require(_0xe507('0x3'));var express=require(_0xe507('0x4'));var router=express['Router']();var auth=require(_0xe507('0x5'));var interaction=require(_0xe507('0x6'));var config=require(_0xe507('0x7'));var controller=require(_0xe507('0x8'));router[_0xe507('0x9')]('/',auth['isAuthenticated'](),controller[_0xe507('0xa')]);router[_0xe507('0x9')](_0xe507('0xb'),auth[_0xe507('0xc')](),controller[_0xe507('0xd')]);router[_0xe507('0x9')](_0xe507('0xe'),auth[_0xe507('0xc')](),controller[_0xe507('0xf')]);router[_0xe507('0x10')]('/',auth[_0xe507('0xc')](),controller['create']);router[_0xe507('0x10')](_0xe507('0x11'),auth[_0xe507('0xc')](),controller[_0xe507('0x12')]);router[_0xe507('0x10')](_0xe507('0xe'),auth[_0xe507('0xc')](),controller[_0xe507('0x13')]);router[_0xe507('0x14')]('/:id',auth[_0xe507('0xc')](),controller[_0xe507('0x15')]);router['delete'](_0xe507('0xb'),auth[_0xe507('0xc')](),controller['destroy']);module[_0xe507('0x16')]=router; \ No newline at end of file +var _0x156d=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','put','update'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x156d,0x1a5));var _0xd156=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x156d[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0xd156('0x0'));var util=require(_0xd156('0x1'));var path=require('path');var timeout=require(_0xd156('0x2'));var express=require('express');var router=express[_0xd156('0x3')]();var auth=require(_0xd156('0x4'));var interaction=require(_0xd156('0x5'));var config=require(_0xd156('0x6'));var controller=require('./dashboard.controller');router[_0xd156('0x7')]('/',auth[_0xd156('0x8')](),controller[_0xd156('0x9')]);router[_0xd156('0x7')](_0xd156('0xa'),auth[_0xd156('0x8')](),controller[_0xd156('0xb')]);router[_0xd156('0x7')](_0xd156('0xc'),auth[_0xd156('0x8')](),controller[_0xd156('0xd')]);router[_0xd156('0xe')]('/',auth['isAuthenticated'](),controller[_0xd156('0xf')]);router['post'](_0xd156('0x10'),auth['isAuthenticated'](),controller['clone']);router['post'](_0xd156('0xc'),auth['isAuthenticated'](),controller['addItem']);router[_0xd156('0x11')](_0xd156('0xa'),auth['isAuthenticated'](),controller[_0xd156('0x12')]);router[_0xd156('0x13')](_0xd156('0xa'),auth[_0xd156('0x8')](),controller[_0xd156('0x14')]);module[_0xd156('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 139d81e..e1b5d0d 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 _0x7f98=['squel','lodash','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize'];(function(_0x4804cc,_0x472e9e){var _0x29b550=function(_0x556606){while(--_0x556606){_0x4804cc['push'](_0x4804cc['shift']());}};_0x29b550(++_0x472e9e);}(_0x7f98,0x178));var _0x87f9=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x7f98[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x87f9('0x0'));var squel=require(_0x87f9('0x1'));var _=require(_0x87f9('0x2'));module['exports']={'title':{'type':Sequelize[_0x87f9('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x87f9('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x87f9('0x4')](_0x87f9('0x5')),'get':function(){try{return JSON[_0x87f9('0x6')](this[_0x87f9('0x7')](_0x87f9('0x8')));}catch(_0x2cf201){return[];}},'set':function(_0x594484){try{this[_0x87f9('0x9')](_0x87f9('0x8'),JSON['stringify'](_0x594484));}catch(_0x2b3f37){this[_0x87f9('0x9')](_0x87f9('0x8'),JSON[_0x87f9('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x87f9('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x87f9('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x87f9('0xb')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x87f9('0x3')],'allowNull':![],'defaultValue':_0x87f9('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x87f9('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6fff=['long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','lodash','exports','STRING','TEXT'];(function(_0x35313f,_0x4993f6){var _0x1d458f=function(_0x7aa24a){while(--_0x7aa24a){_0x35313f['push'](_0x35313f['shift']());}};_0x1d458f(++_0x4993f6);}(_0x6fff,0xa4));var _0xf6ff=function(_0x187bb2,_0x2f59bf){_0x187bb2=_0x187bb2-0x0;var _0x4af854=_0x6fff[_0x187bb2];return _0x4af854;};'use strict';var Sequelize=require(_0xf6ff('0x0'));var squel=require('squel');var _=require(_0xf6ff('0x1'));module[_0xf6ff('0x2')]={'title':{'type':Sequelize[_0xf6ff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf6ff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf6ff('0x4')](_0xf6ff('0x5')),'get':function(){try{return JSON[_0xf6ff('0x6')](this[_0xf6ff('0x7')](_0xf6ff('0x8')));}catch(_0x1d9d9){return[];}},'set':function(_0x5d844c){try{this[_0xf6ff('0x9')](_0xf6ff('0x8'),JSON[_0xf6ff('0xa')](_0x5d844c));}catch(_0x1dd7ff){this[_0xf6ff('0x9')](_0xf6ff('0x8'),JSON[_0xf6ff('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf6ff('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xf6ff('0xb')]},'background':{'type':Sequelize[_0xf6ff('0x3')],'allowNull':![],'defaultValue':_0xf6ff('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xf6ff('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xf6ff('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 485ade2..2d56533 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 _0x0b0e=['redis','localhost','socket.io-emitter','register','sendStatus','end','json','offset','set','apply','reject','save','then','destroy','status','error','stack','name','show','params','model','keys','DashboardItem','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','catch','type','iframe','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','reportType','attrRefresh','create','body','update','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults'];(function(_0x4046b6,_0x238c36){var _0x1443be=function(_0x2e6c5d){while(--_0x2e6c5d){_0x4046b6['push'](_0x4046b6['shift']());}};_0x1443be(++_0x238c36);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0x0b0e[_0x3d00db];return _0x41f115;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');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('0xa'));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 hardwareService=require(_0xe0b0('0x12'));var logger=require(_0xe0b0('0x13'))('api');var utils=require(_0xe0b0('0x14'));var config=require(_0xe0b0('0x15'));var db=require(_0xe0b0('0x16'))['db'];config['redis']=_[_0xe0b0('0x17')](config[_0xe0b0('0x18')],{'host':_0xe0b0('0x19'),'port':0x18eb});var socket=require(_0xe0b0('0x1a'))(new Redis(config[_0xe0b0('0x18')]));require('./dashboardItem.socket')[_0xe0b0('0x1b')](socket);function respondWithStatusCode(_0x154de6,_0x743318){_0x743318=_0x743318||0xcc;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1c')](_0x743318);}return _0x154de6['status'](_0x743318)[_0xe0b0('0x1d')]();};}function respondWithResult(_0x5adb01,_0x35cb40){_0x35cb40=_0x35cb40||0xc8;return function(_0xadee6e){if(_0xadee6e){return _0x5adb01['status'](_0x35cb40)[_0xe0b0('0x1e')](_0xadee6e);}};}function respondWithFilteredResult(_0x4a4cc0,_0x2d6fb6){return function(_0x100204){if(_0x100204){var _0x56bcc7=_0x100204['count'],_0x54a3eb=_0x2d6fb6['offset'],_0x46bb44=_0x2d6fb6[_0xe0b0('0x1f')]+_0x2d6fb6['limit'],_0x50a441;if(_0x46bb44>=_0x56bcc7){_0x46bb44=_0x56bcc7;_0x50a441=0xc8;}else{_0x50a441=0xce;}_0x4a4cc0['status'](_0x50a441);return _0x4a4cc0[_0xe0b0('0x20')]('Content-Range',_0x54a3eb+'-'+_0x46bb44+'/'+_0x56bcc7)[_0xe0b0('0x1e')](_0x100204);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x21')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x22')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x23')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x24')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x25')]()['then'](function(){_0x513e63[_0xe0b0('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x27')](_0x362aba[_0xe0b0('0x28')]);if(_0x362aba[_0xe0b0('0x29')]){delete _0x362aba[_0xe0b0('0x29')];}_0x3c221d[_0xe0b0('0x26')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x2a')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={'raw':![],'where':{'id':_0x1b8aa8[_0xe0b0('0x2b')]['id']}},_0x419b1f={};_0x419b1f[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](db[_0xe0b0('0x2e')][_0xe0b0('0x2f')]);_0x419b1f['query']=_[_0xe0b0('0x2d')](_0x1b8aa8[_0xe0b0('0x30')]);_0x419b1f['filters']=_['intersection'](_0x419b1f[_0xe0b0('0x2c')],_0x419b1f[_0xe0b0('0x30')]);_0x15e13b[_0xe0b0('0x31')]=_[_0xe0b0('0x32')](_0x419b1f[_0xe0b0('0x2c')],qs['fields'](_0x1b8aa8[_0xe0b0('0x30')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x31')]=_0x15e13b[_0xe0b0('0x31')][_0xe0b0('0x34')]?_0x15e13b['attributes']:_0x419b1f[_0xe0b0('0x2c')];if(_0x1b8aa8[_0xe0b0('0x30')][_0xe0b0('0x35')]){_0x15e13b[_0xe0b0('0x36')]=[{'all':!![]}];}_0x15e13b=_[_0xe0b0('0x37')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x38')]);return db[_0xe0b0('0x2e')][_0xe0b0('0x39')](_0x15e13b)[_0xe0b0('0x24')](handleEntityNotFound(_0x5b7a64,null))[_0xe0b0('0x24')](respondWithResult(_0x5b7a64,null))[_0xe0b0('0x3a')](handleError(_0x5b7a64,null));};exports[_0xe0b0('0x25')]=function(_0x1d35bc,_0x2a1c44){return db[_0xe0b0('0x2e')]['find']({'where':{'id':_0x1d35bc[_0xe0b0('0x2b')]['id']}})[_0xe0b0('0x24')](handleEntityNotFound(_0x2a1c44,null))[_0xe0b0('0x24')](removeEntity(_0x2a1c44,null))[_0xe0b0('0x3a')](handleError(_0x2a1c44,null));};function widgetAttributes(_0x1a2d24){try{switch(_0x1a2d24[_0xe0b0('0x3b')]){case _0xe0b0('0x3c'):return[{'name':'attrUrl','value':_0x1a2d24['attrUrl']||(_0x1a2d24['attrs']&&_0x1a2d24['attrs'][0x0]?_0x1a2d24[_0xe0b0('0x3d')][0x0][_0xe0b0('0x3e')]:undefined)||_0xe0b0('0x3f')}];case'custom':return[{'name':_0xe0b0('0x40'),'value':_0x1a2d24[_0xe0b0('0x40')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24[_0xe0b0('0x3d')][0x0]?_0x1a2d24['attrs'][0x0][_0xe0b0('0x3e')]:undefined)||''}];case _0xe0b0('0x41'):return[{'name':_0xe0b0('0x42'),'value':_0x1a2d24[_0xe0b0('0x42')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24[_0xe0b0('0x3d')][0x0]?_0x1a2d24[_0xe0b0('0x3d')][0x0][_0xe0b0('0x3e')]:undefined)||_0xe0b0('0x43')},{'name':'attrTimezone','value':_0x1a2d24[_0xe0b0('0x44')]||(_0x1a2d24['attrs']&&_0x1a2d24[_0xe0b0('0x3d')][0x1]?_0x1a2d24[_0xe0b0('0x3d')][0x1][_0xe0b0('0x3e')]:undefined)||_0xe0b0('0x45')},{'name':'attrFontSize','value':_0x1a2d24[_0xe0b0('0x46')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24[_0xe0b0('0x3d')][0x2]?_0x1a2d24[_0xe0b0('0x3d')][0x2][_0xe0b0('0x3e')]:undefined)||0xc}];case _0xe0b0('0x47'):return[{'name':_0xe0b0('0x48'),'value':_0x1a2d24[_0xe0b0('0x48')]||(_0x1a2d24['attrs']&&_0x1a2d24[_0xe0b0('0x3d')][0x0]?_0x1a2d24[_0xe0b0('0x3d')][0x0]['value']:undefined)||'total'},{'name':_0xe0b0('0x49'),'value':_0x1a2d24[_0xe0b0('0x49')]||(_0x1a2d24['attrs']&&_0x1a2d24[_0xe0b0('0x3d')][0x1]?_0x1a2d24[_0xe0b0('0x3d')][0x1][_0xe0b0('0x3e')]:undefined)||[]},{'name':_0xe0b0('0x46'),'value':_0x1a2d24[_0xe0b0('0x46')]||(_0x1a2d24['attrs']&&_0x1a2d24['attrs'][0x2]?_0x1a2d24['attrs'][0x2][_0xe0b0('0x3e')]:undefined)||0x14}];case _0xe0b0('0x4a'):case'pie-chart':return[{'name':_0xe0b0('0x4b'),'value':_0x1a2d24[_0xe0b0('0x4b')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24[_0xe0b0('0x3d')][0x0]?_0x1a2d24[_0xe0b0('0x3d')][0x0]['value']:undefined)||'total'},{'name':_0xe0b0('0x4c'),'value':_0x1a2d24[_0xe0b0('0x4c')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24[_0xe0b0('0x3d')][0x1]?_0x1a2d24[_0xe0b0('0x3d')][0x1]['value']:undefined)||null},{'name':_0xe0b0('0x4d'),'value':_0x1a2d24[_0xe0b0('0x4d')]||(_0x1a2d24['attrs']&&_0x1a2d24['attrs'][0x2]?_0x1a2d24['attrs'][0x2][_0xe0b0('0x3e')]:undefined)||null},{'name':_0xe0b0('0x49'),'value':_0x1a2d24[_0xe0b0('0x49')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24['attrs'][0x3]?_0x1a2d24[_0xe0b0('0x3d')][0x3][_0xe0b0('0x3e')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x1a2d24[_0xe0b0('0x4e')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24['attrs'][0x0]?_0x1a2d24[_0xe0b0('0x3d')][0x0][_0xe0b0('0x3b')]:undefined)||null,'value':_0x1a2d24['attrReport']||(_0x1a2d24['attrs']&&_0x1a2d24[_0xe0b0('0x3d')][0x0]?_0x1a2d24['attrs'][0x0][_0xe0b0('0x3e')]:undefined)||null},{'name':_0xe0b0('0x4f'),'value':_0x1a2d24[_0xe0b0('0x4f')]||(_0x1a2d24[_0xe0b0('0x3d')]&&_0x1a2d24[_0xe0b0('0x3d')][0x1]?_0x1a2d24[_0xe0b0('0x3d')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x5d018d){logger[_0xe0b0('0x27')]('widgetAttributes:\x20%s',JSON['stringify'](_0x5d018d));return[];}}exports[_0xe0b0('0x50')]=function(_0x222174,_0x54cf7b){if(_0x222174['body']){_0x222174[_0xe0b0('0x51')][_0xe0b0('0x3d')]=widgetAttributes(_0x222174[_0xe0b0('0x51')]);}return db[_0xe0b0('0x2e')][_0xe0b0('0x50')](_0x222174[_0xe0b0('0x51')],{})[_0xe0b0('0x24')](respondWithResult(_0x54cf7b,0xc9))['catch'](handleError(_0x54cf7b,null));};exports[_0xe0b0('0x52')]=function(_0x5ec880,_0x17b3d4){if(_0x5ec880['body']['id']){delete _0x5ec880['body']['id'];}_0x5ec880[_0xe0b0('0x51')][_0xe0b0('0x3d')]=widgetAttributes(_0x5ec880[_0xe0b0('0x51')]);return db[_0xe0b0('0x2e')][_0xe0b0('0x39')]({'where':{'id':_0x5ec880[_0xe0b0('0x2b')]['id']}})[_0xe0b0('0x24')](handleEntityNotFound(_0x17b3d4,null))[_0xe0b0('0x24')](saveUpdates(_0x5ec880[_0xe0b0('0x51')],null))['then'](respondWithResult(_0x17b3d4,null))[_0xe0b0('0x3a')](handleError(_0x17b3d4,null));}; \ No newline at end of file +var _0x7a54=['web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','DashboardItem','query','keys','intersection','attributes','fields','length','includeAll','include','catch','find','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues'];(function(_0xddb860,_0x344918){var _0x255df9=function(_0x102c1c){while(--_0x102c1c){_0xddb860['push'](_0xddb860['shift']());}};_0x255df9(++_0x344918);}(_0x7a54,0x106));var _0x47a5=function(_0x548c96,_0x48a5d1){_0x548c96=_0x548c96-0x0;var _0x160b80=_0x7a54[_0x548c96];return _0x160b80;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 hardwareService=require(_0x47a5('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x47a5('0x11'));var config=require(_0x47a5('0x12'));var db=require(_0x47a5('0x13'))['db'];config[_0x47a5('0x14')]=_[_0x47a5('0x15')](config[_0x47a5('0x14')],{'host':_0x47a5('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47a5('0x14')]));require(_0x47a5('0x17'))[_0x47a5('0x18')](socket);function respondWithStatusCode(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xcc;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x19')](_0x139f25);}return _0x711793[_0x47a5('0x1a')](_0x139f25)['end']();};}function respondWithResult(_0x362359,_0x11faf5){_0x11faf5=_0x11faf5||0xc8;return function(_0x3b001e){if(_0x3b001e){return _0x362359[_0x47a5('0x1a')](_0x11faf5)[_0x47a5('0x1b')](_0x3b001e);}};}function respondWithFilteredResult(_0x574af6,_0x549de3){return function(_0x138bc0){if(_0x138bc0){var _0x4b966e=_0x138bc0[_0x47a5('0x1c')],_0x5247fd=_0x549de3[_0x47a5('0x1d')],_0x423a81=_0x549de3[_0x47a5('0x1d')]+_0x549de3[_0x47a5('0x1e')],_0xaf70a6;if(_0x423a81>=_0x4b966e){_0x423a81=_0x4b966e;_0xaf70a6=0xc8;}else{_0xaf70a6=0xce;}_0x574af6[_0x47a5('0x1a')](_0xaf70a6);return _0x574af6[_0x47a5('0x1f')](_0x47a5('0x20'),_0x5247fd+'-'+_0x423a81+'/'+_0x4b966e)['json'](_0x138bc0);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x21')](_0x2b0360);}return _0xf160ba[_0x47a5('0x22')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x23')](_0x4c5910)[_0x47a5('0x24')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x25')]()[_0x47a5('0x24')](function(){_0xe2dea9[_0x47a5('0x1a')](0xcc)[_0x47a5('0x26')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x19')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x27')](_0x5b6c4e[_0x47a5('0x28')]);if(_0x5b6c4e[_0x47a5('0x29')]){delete _0x5b6c4e[_0x47a5('0x29')];}_0x5686db[_0x47a5('0x1a')](_0x1ea9c8)[_0x47a5('0x2a')](_0x5b6c4e);};}exports[_0x47a5('0x2b')]=function(_0x136b14,_0x16631f){var _0x361bfa={'raw':![],'where':{'id':_0x136b14[_0x47a5('0x2c')]['id']}},_0x1127f8={};_0x1127f8[_0x47a5('0x2d')]=_['keys'](db[_0x47a5('0x2e')]['rawAttributes']);_0x1127f8[_0x47a5('0x2f')]=_[_0x47a5('0x30')](_0x136b14[_0x47a5('0x2f')]);_0x1127f8['filters']=_[_0x47a5('0x31')](_0x1127f8[_0x47a5('0x2d')],_0x1127f8[_0x47a5('0x2f')]);_0x361bfa[_0x47a5('0x32')]=_['intersection'](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14[_0x47a5('0x2f')]['fields']));_0x361bfa['attributes']=_0x361bfa[_0x47a5('0x32')][_0x47a5('0x34')]?_0x361bfa['attributes']:_0x1127f8[_0x47a5('0x2d')];if(_0x136b14['query'][_0x47a5('0x35')]){_0x361bfa[_0x47a5('0x36')]=[{'all':!![]}];}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);return db[_0x47a5('0x2e')]['find'](_0x361bfa)[_0x47a5('0x24')](handleEntityNotFound(_0x16631f,null))[_0x47a5('0x24')](respondWithResult(_0x16631f,null))[_0x47a5('0x37')](handleError(_0x16631f,null));};exports['destroy']=function(_0x18f7e9,_0x50c086){return db['DashboardItem'][_0x47a5('0x38')]({'where':{'id':_0x18f7e9['params']['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x50c086,null))['then'](removeEntity(_0x50c086,null))[_0x47a5('0x37')](handleError(_0x50c086,null));};function widgetAttributes(_0x3534cb){try{switch(_0x3534cb[_0x47a5('0x39')]){case _0x47a5('0x3a'):return[{'name':_0x47a5('0x3b'),'value':_0x3534cb[_0x47a5('0x3b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x3d')}];case _0x47a5('0x3e'):return[{'name':'attrPath','value':_0x3534cb[_0x47a5('0x3f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x40')]:undefined)||''}];case _0x47a5('0x41'):return[{'name':'attrHourFormat','value':_0x3534cb[_0x47a5('0x42')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x0]?_0x3534cb['attrs'][0x0]['value']:undefined)||_0x47a5('0x43')},{'name':'attrTimezone','value':_0x3534cb[_0x47a5('0x44')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||_0x47a5('0x45')},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0xc}];case _0x47a5('0x47'):return[{'name':'attrMetric','value':_0x3534cb[_0x47a5('0x48')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0]['value']:undefined)||_0x47a5('0x49')},{'name':'attrVoiceQueues','value':_0x3534cb['attrVoiceQueues']||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1]['value']:undefined)||[]},{'name':_0x47a5('0x46'),'value':_0x3534cb[_0x47a5('0x46')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb['attrs'][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2][_0x47a5('0x40')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':_0x47a5('0x4a'),'value':_0x3534cb['attrSerie1']||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||_0x47a5('0x49')},{'name':_0x47a5('0x4b'),'value':_0x3534cb[_0x47a5('0x4b')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x4c'),'value':_0x3534cb[_0x47a5('0x4c')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x2]?_0x3534cb[_0x47a5('0x3c')][0x2]['value']:undefined)||null},{'name':_0x47a5('0x4d'),'value':_0x3534cb[_0x47a5('0x4d')]||(_0x3534cb['attrs']&&_0x3534cb['attrs'][0x3]?_0x3534cb[_0x47a5('0x3c')][0x3]['value']:undefined)||[]}];case _0x47a5('0x4e'):return[{'name':_0x47a5('0x4f'),'type':_0x3534cb['reportType']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb['attrs'][0x0][_0x47a5('0x39')]:undefined)||null,'value':_0x3534cb[_0x47a5('0x4f')]||(_0x3534cb[_0x47a5('0x3c')]&&_0x3534cb[_0x47a5('0x3c')][0x0]?_0x3534cb[_0x47a5('0x3c')][0x0][_0x47a5('0x40')]:undefined)||null},{'name':_0x47a5('0x50'),'value':_0x3534cb['attrRefresh']||(_0x3534cb['attrs']&&_0x3534cb[_0x47a5('0x3c')][0x1]?_0x3534cb[_0x47a5('0x3c')][0x1][_0x47a5('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x9ea93e){logger[_0x47a5('0x27')](_0x47a5('0x51'),JSON[_0x47a5('0x52')](_0x9ea93e));return[];}}exports['create']=function(_0x45cca5,_0x1c9a62){if(_0x45cca5[_0x47a5('0x53')]){_0x45cca5['body'][_0x47a5('0x3c')]=widgetAttributes(_0x45cca5['body']);}return db[_0x47a5('0x2e')][_0x47a5('0x54')](_0x45cca5[_0x47a5('0x53')],{})[_0x47a5('0x24')](respondWithResult(_0x1c9a62,0xc9))['catch'](handleError(_0x1c9a62,null));};exports[_0x47a5('0x23')]=function(_0x1e6de3,_0x2f66e9){if(_0x1e6de3[_0x47a5('0x53')]['id']){delete _0x1e6de3[_0x47a5('0x53')]['id'];}_0x1e6de3[_0x47a5('0x53')][_0x47a5('0x3c')]=widgetAttributes(_0x1e6de3['body']);return db[_0x47a5('0x2e')][_0x47a5('0x38')]({'where':{'id':_0x1e6de3[_0x47a5('0x2c')]['id']}})[_0x47a5('0x24')](handleEntityNotFound(_0x2f66e9,null))[_0x47a5('0x24')](saveUpdates(_0x1e6de3[_0x47a5('0x53')],null))['then'](respondWithResult(_0x2f66e9,null))[_0x47a5('0x37')](handleError(_0x2f66e9,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 74bf569..4ee1bad 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 _0xe77f=['hasOwnProperty','exports','events','../../mysqldb','DashboardItem','update','emit'];(function(_0x46a38b,_0x16ffb5){var _0x346e75=function(_0x34f8d0){while(--_0x34f8d0){_0x46a38b['push'](_0x46a38b['shift']());}};_0x346e75(++_0x16ffb5);}(_0xe77f,0x87));var _0xfe77=function(_0x5ea349,_0x5b6cd9){_0x5ea349=_0x5ea349-0x0;var _0x423e6b=_0xe77f[_0x5ea349];return _0x423e6b;};'use strict';var EventEmitter=require(_0xfe77('0x0'));var DashboardItem=require(_0xfe77('0x1'))['db'][_0xfe77('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe77('0x3'),'afterDestroy':'remove'};function emitEvent(_0x9052f1){return function(_0x4fff6,_0x3ab4de,_0x3c8d01){DashboardItemEvents[_0xfe77('0x4')](_0x9052f1+':'+_0x4fff6['id'],_0x4fff6);DashboardItemEvents['emit'](_0x9052f1,_0x4fff6);_0x3c8d01(null);};}for(var e in events){if(events[_0xfe77('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xfe77('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x2501=['save','emit','hasOwnProperty','exports','events','setMaxListeners'];(function(_0x55f039,_0x3be31b){var _0xdbed83=function(_0x4d3d13){while(--_0x4d3d13){_0x55f039['push'](_0x55f039['shift']());}};_0xdbed83(++_0x3be31b);}(_0x2501,0xac));var _0x1250=function(_0x228b96,_0x341271){_0x228b96=_0x228b96-0x0;var _0x264a3f=_0x2501[_0x228b96];return _0x264a3f;};'use strict';var EventEmitter=require(_0x1250('0x0'));var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1250('0x1')](0x0);var events={'afterCreate':_0x1250('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c607e){return function(_0x5cab91,_0x57348c,_0x16083e){DashboardItemEvents[_0x1250('0x3')](_0x1c607e+':'+_0x5cab91['id'],_0x5cab91);DashboardItemEvents[_0x1250('0x3')](_0x1c607e,_0x5cab91);_0x16083e(null);};}for(var e in events){if(events[_0x1250('0x4')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x1250('0x5')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 11c69e9..9a26446 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 _0xae50=['request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird'];(function(_0x325e1e,_0x903510){var _0x33aa0f=function(_0x519777){while(--_0x519777){_0x325e1e['push'](_0x325e1e['shift']());}};_0x33aa0f(++_0x903510);}(_0xae50,0x19b));var _0x0ae5=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0xae50[_0x15e6fe];return _0x34894d;};'use strict';var _=require('lodash');var util=require(_0x0ae5('0x0'));var logger=require(_0x0ae5('0x1'))(_0x0ae5('0x2'));var moment=require(_0x0ae5('0x3'));var BPromise=require(_0x0ae5('0x4'));var rp=require(_0x0ae5('0x5'));var fs=require('fs');var path=require(_0x0ae5('0x6'));var rimraf=require('rimraf');var config=require(_0x0ae5('0x7'));var attributes=require(_0x0ae5('0x8'));module[_0x0ae5('0x9')]=function(_0x1d5fe6,_0x528790){return _0x1d5fe6[_0x0ae5('0xa')](_0x0ae5('0xb'),attributes,{'tableName':_0x0ae5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7994=['request-promise','path','rimraf','exports','define','DashboardItem','dashboard_items','util','../../config/logger','api','moment','bluebird'];(function(_0x339d01,_0x282b12){var _0x4957e8=function(_0x24f3b7){while(--_0x24f3b7){_0x339d01['push'](_0x339d01['shift']());}};_0x4957e8(++_0x282b12);}(_0x7994,0x1b7));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4799('0x0'));var logger=require(_0x4799('0x1'))(_0x4799('0x2'));var moment=require(_0x4799('0x3'));var BPromise=require(_0x4799('0x4'));var rp=require(_0x4799('0x5'));var fs=require('fs');var path=require(_0x4799('0x6'));var rimraf=require(_0x4799('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x4799('0x8')]=function(_0x130941,_0x1c25e9){return _0x130941[_0x4799('0x9')](_0x4799('0xa'),attributes,{'tableName':_0x4799('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 4d54425..d8cefbc 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 _0xa25d=['redis','defaults','socket.io-emitter','./dashboardItem.socket','register','then','info','request\x20sent','debug','stringify','error','code','message','catch','DashboardItem,\x20%s,\x20%s','lodash','util','moment','ioredis','../../mysqldb','../../config/environment','client'];(function(_0x1f7a17,_0x13a3ad){var _0x15d51f=function(_0x2f7f48){while(--_0x2f7f48){_0x1f7a17['push'](_0x1f7a17['shift']());}};_0x15d51f(++_0x13a3ad);}(_0xa25d,0x1c7));var _0xda25=function(_0x5cdae6,_0x50e1fc){_0x5cdae6=_0x5cdae6-0x0;var _0x18e71d=_0xa25d[_0x5cdae6];return _0x18e71d;};'use strict';var _=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var moment=require(_0xda25('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda25('0x3'));var db=require(_0xda25('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xda25('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xda25('0x6')]['http']({'port':0x232a});config[_0xda25('0x7')]=_[_0xda25('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xda25('0x9'))(new Redis(config['redis']));require(_0xda25('0xa'))[_0xda25('0xb')](socket);function respondWithRpcPromise(_0x45bcb1,_0x5f5ac6,_0x344825){return new BPromise(function(_0x1ee802,_0x496874){return client['request'](_0x45bcb1,_0x344825)[_0xda25('0xc')](function(_0x48eba0){logger[_0xda25('0xd')]('DashboardItem,\x20%s,\x20%s',_0x5f5ac6,_0xda25('0xe'));logger[_0xda25('0xf')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x5f5ac6,_0xda25('0xe'),JSON[_0xda25('0x10')](_0x48eba0));if(_0x48eba0[_0xda25('0x11')]){if(_0x48eba0[_0xda25('0x11')][_0xda25('0x12')]===0x1f4){logger[_0xda25('0x11')]('DashboardItem,\x20%s,\x20%s',_0x5f5ac6,_0x48eba0[_0xda25('0x11')]['message']);return _0x496874(_0x48eba0[_0xda25('0x11')][_0xda25('0x13')]);}logger[_0xda25('0x11')]('DashboardItem,\x20%s,\x20%s',_0x5f5ac6,_0x48eba0[_0xda25('0x11')]['message']);return _0x1ee802(_0x48eba0[_0xda25('0x11')][_0xda25('0x13')]);}else{logger[_0xda25('0xd')]('DashboardItem,\x20%s,\x20%s',_0x5f5ac6,_0xda25('0xe'));_0x1ee802(_0x48eba0['result']['message']);}})[_0xda25('0x14')](function(_0x497f1c){logger[_0xda25('0x11')](_0xda25('0x15'),_0x5f5ac6,_0x497f1c);_0x496874(_0x497f1c);});});} \ No newline at end of file +var _0x850d=['register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboardItem.socket'];(function(_0x6d59c3,_0x54a10e){var _0x3d65f2=function(_0x55c25a){while(--_0x55c25a){_0x6d59c3['push'](_0x6d59c3['shift']());}};_0x3d65f2(++_0x54a10e);}(_0x850d,0x140));var _0xd850=function(_0x31c5e9,_0x30e373){_0x31c5e9=_0x31c5e9-0x0;var _0x517a8d=_0x850d[_0x31c5e9];return _0x517a8d;};'use strict';var _=require(_0xd850('0x0'));var util=require(_0xd850('0x1'));var moment=require('moment');var BPromise=require(_0xd850('0x2'));var rs=require(_0xd850('0x3'));var fs=require('fs');var Redis=require(_0xd850('0x4'));var db=require(_0xd850('0x5'))['db'];var utils=require(_0xd850('0x6'));var logger=require('../../config/logger')(_0xd850('0x7'));var config=require(_0xd850('0x8'));var jayson=require(_0xd850('0x9'));var client=jayson[_0xd850('0xa')][_0xd850('0xb')]({'port':0x232a});config[_0xd850('0xc')]=_['defaults'](config['redis'],{'host':_0xd850('0xd'),'port':0x18eb});var socket=require(_0xd850('0xe'))(new Redis(config[_0xd850('0xc')]));require(_0xd850('0xf'))[_0xd850('0x10')](socket);function respondWithRpcPromise(_0x381654,_0x342752,_0x200662){return new BPromise(function(_0x4df000,_0x46ea72){return client[_0xd850('0x11')](_0x381654,_0x200662)[_0xd850('0x12')](function(_0x2bde04){logger[_0xd850('0x13')](_0xd850('0x14'),_0x342752,_0xd850('0x15'));logger[_0xd850('0x16')](_0xd850('0x17'),_0x342752,_0xd850('0x15'),JSON[_0xd850('0x18')](_0x2bde04));if(_0x2bde04[_0xd850('0x19')]){if(_0x2bde04['error']['code']===0x1f4){logger[_0xd850('0x19')](_0xd850('0x14'),_0x342752,_0x2bde04[_0xd850('0x19')][_0xd850('0x1a')]);return _0x46ea72(_0x2bde04[_0xd850('0x19')][_0xd850('0x1a')]);}logger['error'](_0xd850('0x14'),_0x342752,_0x2bde04['error'][_0xd850('0x1a')]);return _0x4df000(_0x2bde04[_0xd850('0x19')]['message']);}else{logger[_0xd850('0x13')](_0xd850('0x14'),_0x342752,_0xd850('0x15'));_0x4df000(_0x2bde04['result']['message']);}})[_0xd850('0x1b')](function(_0x174226){logger[_0xd850('0x19')](_0xd850('0x14'),_0x342752,_0x174226);_0x46ea72(_0x174226);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index dc097f8..9a77564 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 _0x55ca=['removeListener','register','./dashboardItem.events','save'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x55ca,0x126));var _0xa55c=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x55ca[_0x4629ed];return _0x52ca04;};'use strict';var DashboardItemEvents=require(_0xa55c('0x0'));var events=[_0xa55c('0x1'),'remove','update'];function createListener(_0x49875a,_0x1c6ec3){return function(_0x267ea0){_0x1c6ec3['emit'](_0x49875a,_0x267ea0);};}function removeListener(_0x3b478a,_0x2db02a){return function(){DashboardItemEvents[_0xa55c('0x2')](_0x3b478a,_0x2db02a);};}exports[_0xa55c('0x3')]=function(_0x3c97c8){for(var _0x279caa=0x0,_0x36b623=events['length'];_0x279caa<_0x36b623;_0x279caa++){var _0x2121fd=events[_0x279caa];var _0x2537f0=createListener('dashboardItem:'+_0x2121fd,_0x3c97c8);DashboardItemEvents['on'](_0x2121fd,_0x2537f0);}}; \ No newline at end of file +var _0xedd9=['removeListener','register','length','dashboardItem:','save','remove','update','emit'];(function(_0x4b7c10,_0x28ad51){var _0x12b39e=function(_0x3b47ff){while(--_0x3b47ff){_0x4b7c10['push'](_0x4b7c10['shift']());}};_0x12b39e(++_0x28ad51);}(_0xedd9,0xfc));var _0x9edd=function(_0x539d06,_0x26277d){_0x539d06=_0x539d06-0x0;var _0x2f178a=_0xedd9[_0x539d06];return _0x2f178a;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){DashboardItemEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);DashboardItemEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 5c9d757..d987514 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 _0xdef3=['update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','isAuthenticated','post','create','put'];(function(_0x31dc25,_0x2f42a2){var _0x4747b9=function(_0xb61297){while(--_0xb61297){_0x31dc25['push'](_0x31dc25['shift']());}};_0x4747b9(++_0x2f42a2);}(_0xdef3,0xb0));var _0x3def=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xdef3[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x3def('0x0'));var util=require(_0x3def('0x1'));var path=require(_0x3def('0x2'));var timeout=require(_0x3def('0x3'));var express=require(_0x3def('0x4'));var router=express[_0x3def('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3def('0x6'));var config=require(_0x3def('0x7'));var controller=require(_0x3def('0x8'));router[_0x3def('0x9')]('/:id',auth[_0x3def('0xa')](),controller['show']);router[_0x3def('0xb')]('/',auth[_0x3def('0xa')](),controller[_0x3def('0xc')]);router[_0x3def('0xd')]('/:id',auth[_0x3def('0xa')](),controller[_0x3def('0xe')]);router[_0x3def('0xf')](_0x3def('0x10'),auth[_0x3def('0xa')](),controller[_0x3def('0x11')]);module[_0x3def('0x12')]=router; \ No newline at end of file +var _0xbb4c=['/:id','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','create','put','update','delete'];(function(_0x5d9272,_0x15f0b2){var _0x433599=function(_0xfe17d4){while(--_0xfe17d4){_0x5d9272['push'](_0x5d9272['shift']());}};_0x433599(++_0x15f0b2);}(_0xbb4c,0x1a6));var _0xcbb4=function(_0x3f06be,_0x39f208){_0x3f06be=_0x3f06be-0x0;var _0x54680=_0xbb4c[_0x3f06be];return _0x54680;};'use strict';var multer=require('multer');var util=require(_0xcbb4('0x0'));var path=require(_0xcbb4('0x1'));var timeout=require(_0xcbb4('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xcbb4('0x3'));var interaction=require(_0xcbb4('0x4'));var config=require(_0xcbb4('0x5'));var controller=require('./dashboardItem.controller');router[_0xcbb4('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcbb4('0x7')](),controller[_0xcbb4('0x8')]);router[_0xcbb4('0x9')]('/:id',auth[_0xcbb4('0x7')](),controller[_0xcbb4('0xa')]);router[_0xcbb4('0xb')](_0xcbb4('0xc'),auth[_0xcbb4('0x7')](),controller[_0xcbb4('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5b16ee5..8e2e02d 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 _0x7ea2=['exports'];(function(_0x2ee790,_0x5a8661){var _0x5a54a5=function(_0x2713a4){while(--_0x2713a4){_0x2ee790['push'](_0x2ee790['shift']());}};_0x5a54a5(++_0x5a8661);}(_0x7ea2,0x137));var _0x27ea=function(_0x4fdcc0,_0x560a01){_0x4fdcc0=_0x4fdcc0-0x0;var _0xc0ce94=_0x7ea2[_0x4fdcc0];return _0xc0ce94;};'use strict';var Sequelize=require('sequelize');module[_0x27ea('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xc48b=['sequelize','exports'];(function(_0x408c20,_0x1501e4){var _0x21a450=function(_0x542f2a){while(--_0x542f2a){_0x408c20['push'](_0x408c20['shift']());}};_0x21a450(++_0x1501e4);}(_0xc48b,0x12a));var _0xbc48=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xc48b[_0x251d9c];return _0x16ae64;};'use strict';var Sequelize=require(_0xbc48('0x0'));module[_0xbc48('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index d965a27..68b9c44 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 _0xa842=['lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','update','then','get','Dispositions','destroy','stack','name','send','index','Disposition','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','filter','merge','map','type','VIRTUAL','field','includeAll','findAll','rows','catch','params','include','options','find','create','body','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','moment','mustache','sox','ejs'];(function(_0x28f5c9,_0x2de2cc){var _0x5376a4=function(_0x460c8d){while(--_0x460c8d){_0x28f5c9['push'](_0x28f5c9['shift']());}};_0x5376a4(++_0x2de2cc);}(_0xa842,0x8e));var _0x2a84=function(_0x3fd8c1,_0x563836){_0x3fd8c1=_0x3fd8c1-0x0;var _0x2c5f76=_0xa842[_0x3fd8c1];return _0x2c5f76;};'use strict';var pdf=require(_0x2a84('0x0'));var emlformat=require(_0x2a84('0x1'));var rimraf=require(_0x2a84('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2a84('0x3'));var moment=require(_0x2a84('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2a84('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2a84('0x6'));var csv=require('to-csv');var ejs=require(_0x2a84('0x7'));var fs=require('fs');var _=require(_0x2a84('0x8'));var squel=require(_0x2a84('0x9'));var crypto=require('crypto');var jsforce=require(_0x2a84('0xa'));var deskjs=require(_0x2a84('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2a84('0xc'));var Papa=require('papaparse');var Redis=require(_0x2a84('0xd'));var authService=require(_0x2a84('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2a84('0xf'));var logger=require('../../config/logger')(_0x2a84('0x10'));var utils=require(_0x2a84('0x11'));var config=require(_0x2a84('0x12'));var db=require(_0x2a84('0x13'))['db'];function respondWithStatusCode(_0x5b5f7a,_0x2c03ed){_0x2c03ed=_0x2c03ed||0xcc;return function(_0x511806){if(_0x511806){return _0x5b5f7a[_0x2a84('0x14')](_0x2c03ed);}return _0x5b5f7a[_0x2a84('0x15')](_0x2c03ed)[_0x2a84('0x16')]();};}function respondWithResult(_0x598ffe,_0xc8bee7){_0xc8bee7=_0xc8bee7||0xc8;return function(_0x509213){if(_0x509213){return _0x598ffe['status'](_0xc8bee7)[_0x2a84('0x17')](_0x509213);}};}function respondWithFilteredResult(_0x4bf507,_0x75722f){return function(_0x413e81){if(_0x413e81){var _0x378ec7=_0x413e81[_0x2a84('0x18')],_0x6daeb1=_0x75722f[_0x2a84('0x19')],_0x2ae760=_0x75722f[_0x2a84('0x19')]+_0x75722f['limit'],_0x518886;if(_0x2ae760>=_0x378ec7){_0x2ae760=_0x378ec7;_0x518886=0xc8;}else{_0x518886=0xce;}_0x4bf507[_0x2a84('0x15')](_0x518886);return _0x4bf507[_0x2a84('0x1a')]('Content-Range',_0x6daeb1+'-'+_0x2ae760+'/'+_0x378ec7)['json'](_0x413e81);}return null;};}function patchUpdates(_0x1546e5){return function(_0x5314b7){try{jsonpatch[_0x2a84('0x1b')](_0x5314b7,_0x1546e5,!![]);}catch(_0x2e4060){return BPromise[_0x2a84('0x1c')](_0x2e4060);}return _0x5314b7['save']();};}function saveUpdates(_0x5ea6c2,_0x445154){return function(_0x5cd5fe){if(_0x5cd5fe){return _0x5cd5fe[_0x2a84('0x1d')](_0x5ea6c2)[_0x2a84('0x1e')](function(_0x3ec7bb){return _0x3ec7bb;});}return null;};}function removeEntity(_0xa0c69e,_0x2201ab){return function(_0x2c8773){if(_0x2c8773){return _0x2c8773['destroy']()[_0x2a84('0x1e')](function(){var _0x513dd3=_0x2c8773[_0x2a84('0x1f')]({'plain':!![]});var _0x20ac5a=_0x2a84('0x20');return db['UserProfileResource'][_0x2a84('0x21')]({'where':{'type':_0x20ac5a,'resourceId':_0x513dd3['id']}})['then'](function(){return _0x2c8773;});})[_0x2a84('0x1e')](function(){_0xa0c69e[_0x2a84('0x15')](0xcc)[_0x2a84('0x16')]();});}};}function handleEntityNotFound(_0x532d5c,_0x32cf13){return function(_0x22caaf){if(!_0x22caaf){_0x532d5c[_0x2a84('0x14')](0x194);}return _0x22caaf;};}function handleError(_0x3f8cda,_0x88cd14){_0x88cd14=_0x88cd14||0x1f4;return function(_0x35fcd7){logger['error'](_0x35fcd7[_0x2a84('0x22')]);if(_0x35fcd7[_0x2a84('0x23')]){delete _0x35fcd7[_0x2a84('0x23')];}_0x3f8cda[_0x2a84('0x15')](_0x88cd14)[_0x2a84('0x24')](_0x35fcd7);};}exports[_0x2a84('0x25')]=function(_0x255a8c,_0x3c64c9){var _0x4ad37d={},_0x19ff8c={},_0x392a5a={'count':0x0,'rows':[]};var _0x58955b=db[_0x2a84('0x26')][_0x2a84('0x27')];_0x19ff8c[_0x2a84('0x28')]=_[_0x2a84('0x29')](_0x58955b);_0x19ff8c[_0x2a84('0x2a')]=_[_0x2a84('0x29')](_0x255a8c['query']);_0x19ff8c[_0x2a84('0x2b')]=_[_0x2a84('0x2c')](_0x19ff8c[_0x2a84('0x28')],_0x19ff8c[_0x2a84('0x2a')]);_0x4ad37d[_0x2a84('0x2d')]=_['intersection'](_0x19ff8c[_0x2a84('0x28')],qs['fields'](_0x255a8c[_0x2a84('0x2a')][_0x2a84('0x2e')]));_0x4ad37d[_0x2a84('0x2d')]=_0x4ad37d[_0x2a84('0x2d')][_0x2a84('0x2f')]?_0x4ad37d[_0x2a84('0x2d')]:_0x19ff8c[_0x2a84('0x28')];if(!_0x255a8c[_0x2a84('0x2a')]['hasOwnProperty'](_0x2a84('0x30'))){_0x4ad37d[_0x2a84('0x31')]=qs[_0x2a84('0x31')](_0x255a8c['query'][_0x2a84('0x31')]);_0x4ad37d[_0x2a84('0x19')]=qs['offset'](_0x255a8c['query'][_0x2a84('0x19')]);}_0x4ad37d['order']=qs['sort'](_0x255a8c['query'][_0x2a84('0x32')]);_0x4ad37d[_0x2a84('0x33')]=qs['filters'](_['pick'](_0x255a8c['query'],_0x19ff8c[_0x2a84('0x2b')]));if(_0x255a8c[_0x2a84('0x2a')][_0x2a84('0x34')]){_0x4ad37d['where']=_[_0x2a84('0x35')](_0x4ad37d['where'],{'$or':_[_0x2a84('0x36')](_0x58955b,function(_0x86cd71){if(_0x86cd71[_0x2a84('0x37')]['key']!==_0x2a84('0x38')){var _0x1ea263={};_0x1ea263[_0x86cd71[_0x2a84('0x39')]]={'$like':'%'+_0x255a8c[_0x2a84('0x2a')]['filter']+'%'};return _0x1ea263;}})});}_0x4ad37d=_[_0x2a84('0x35')]({},_0x4ad37d,_0x255a8c['options']);var _0x1fbd3e={'where':_0x4ad37d['where']};return db[_0x2a84('0x26')][_0x2a84('0x18')](_0x1fbd3e)['then'](function(_0x570dbf){_0x392a5a[_0x2a84('0x18')]=_0x570dbf;if(_0x255a8c[_0x2a84('0x2a')][_0x2a84('0x3a')]){_0x4ad37d['include']=[{'all':!![]}];}return db[_0x2a84('0x26')][_0x2a84('0x3b')](_0x4ad37d);})[_0x2a84('0x1e')](function(_0x116b2b){_0x392a5a[_0x2a84('0x3c')]=_0x116b2b;return _0x392a5a;})[_0x2a84('0x1e')](respondWithFilteredResult(_0x3c64c9,_0x4ad37d))[_0x2a84('0x3d')](handleError(_0x3c64c9,null));};exports['show']=function(_0x5ce57d,_0x26cb6f){var _0x34c69e={'raw':!![],'where':{'id':_0x5ce57d[_0x2a84('0x3e')]['id']}},_0x395bd3={};_0x395bd3[_0x2a84('0x28')]=_[_0x2a84('0x29')](db['Disposition']['rawAttributes']);_0x395bd3['query']=_['keys'](_0x5ce57d['query']);_0x395bd3[_0x2a84('0x2b')]=_[_0x2a84('0x2c')](_0x395bd3[_0x2a84('0x28')],_0x395bd3[_0x2a84('0x2a')]);_0x34c69e[_0x2a84('0x2d')]=_[_0x2a84('0x2c')](_0x395bd3[_0x2a84('0x28')],qs[_0x2a84('0x2e')](_0x5ce57d['query'][_0x2a84('0x2e')]));_0x34c69e[_0x2a84('0x2d')]=_0x34c69e[_0x2a84('0x2d')][_0x2a84('0x2f')]?_0x34c69e[_0x2a84('0x2d')]:_0x395bd3[_0x2a84('0x28')];if(_0x5ce57d[_0x2a84('0x2a')]['includeAll']){_0x34c69e[_0x2a84('0x3f')]=[{'all':!![]}];}_0x34c69e=_['merge']({},_0x34c69e,_0x5ce57d[_0x2a84('0x40')]);return db[_0x2a84('0x26')][_0x2a84('0x41')](_0x34c69e)['then'](handleEntityNotFound(_0x26cb6f,null))[_0x2a84('0x1e')](respondWithResult(_0x26cb6f,null))['catch'](handleError(_0x26cb6f,null));};exports[_0x2a84('0x42')]=function(_0x1203a5,_0x51c780){return db[_0x2a84('0x26')][_0x2a84('0x42')](_0x1203a5[_0x2a84('0x43')],{})['then'](function(_0x2ad8f9){var _0x4a4c05=_0x1203a5[_0x2a84('0x44')][_0x2a84('0x1f')]({'plain':!![]});if(!_0x4a4c05)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a4c05[_0x2a84('0x45')]===_0x2a84('0x44')){var _0x5b0da9=_0x2ad8f9[_0x2a84('0x1f')]({'plain':!![]});var _0x2e5a47='Dispositions';return db[_0x2a84('0x46')][_0x2a84('0x41')]({'where':{'name':_0x2e5a47,'userProfileId':_0x4a4c05[_0x2a84('0x47')]},'raw':!![]})[_0x2a84('0x1e')](function(_0x2c1322){if(_0x2c1322&&_0x2c1322['autoAssociation']===0x0){return db[_0x2a84('0x48')][_0x2a84('0x42')]({'name':_0x5b0da9[_0x2a84('0x23')],'resourceId':_0x5b0da9['id'],'type':_0x2c1322[_0x2a84('0x23')],'sectionId':_0x2c1322['id']},{})[_0x2a84('0x1e')](function(){return _0x2ad8f9;});}else{return _0x2ad8f9;}})['catch'](function(_0x3079ba){logger[_0x2a84('0x49')](_0x2a84('0x4a'),_0x3079ba);throw _0x3079ba;});}return _0x2ad8f9;})['then'](respondWithResult(_0x51c780,0xc9))[_0x2a84('0x3d')](handleError(_0x51c780,null));};exports[_0x2a84('0x1d')]=function(_0x1a5f24,_0x406ce5){if(_0x1a5f24[_0x2a84('0x43')]['id']){delete _0x1a5f24['body']['id'];}return db[_0x2a84('0x26')][_0x2a84('0x41')]({'where':{'id':_0x1a5f24[_0x2a84('0x3e')]['id']}})[_0x2a84('0x1e')](handleEntityNotFound(_0x406ce5,null))[_0x2a84('0x1e')](saveUpdates(_0x1a5f24[_0x2a84('0x43')],null))[_0x2a84('0x1e')](respondWithResult(_0x406ce5,null))[_0x2a84('0x3d')](handleError(_0x406ce5,null));};exports[_0x2a84('0x21')]=function(_0x362a42,_0x57080d){return db[_0x2a84('0x26')]['find']({'where':{'id':_0x362a42[_0x2a84('0x3e')]['id']}})['then'](handleEntityNotFound(_0x57080d,null))[_0x2a84('0x1e')](removeEntity(_0x57080d,null))[_0x2a84('0x3d')](handleError(_0x57080d,null));}; \ No newline at end of file +var _0x491d=['mustache','util','path','sox','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','sendStatus','error','stack','name','send','index','Disposition','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','field','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x36756a,_0x3d1aec){var _0x151212=function(_0x2c8102){while(--_0x2c8102){_0x36756a['push'](_0x36756a['shift']());}};_0x151212(++_0x3d1aec);}(_0x491d,0xe6));var _0xd491=function(_0x44610b,_0x34693f){_0x44610b=_0x44610b-0x0;var _0x88c632=_0x491d[_0x44610b];return _0x88c632;};'use strict';var pdf=require(_0xd491('0x0'));var emlformat=require(_0xd491('0x1'));var rimraf=require(_0xd491('0x2'));var zipdir=require(_0xd491('0x3'));var jsonpatch=require(_0xd491('0x4'));var rp=require('request-promise');var moment=require(_0xd491('0x5'));var BPromise=require(_0xd491('0x6'));var Mustache=require(_0xd491('0x7'));var util=require(_0xd491('0x8'));var path=require(_0xd491('0x9'));var sox=require(_0xd491('0xa'));var csv=require('to-csv');var ejs=require(_0xd491('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd491('0xc'));var crypto=require('crypto');var jsforce=require(_0xd491('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd491('0xe'));var Papa=require(_0xd491('0xf'));var Redis=require('ioredis');var authService=require(_0xd491('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd491('0x11'))(_0xd491('0x12'));var utils=require(_0xd491('0x13'));var config=require(_0xd491('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x579c67,_0x3c86e1){_0x3c86e1=_0x3c86e1||0xcc;return function(_0x9fae9c){if(_0x9fae9c){return _0x579c67['sendStatus'](_0x3c86e1);}return _0x579c67['status'](_0x3c86e1)[_0xd491('0x15')]();};}function respondWithResult(_0x5bf73b,_0x2f0b9d){_0x2f0b9d=_0x2f0b9d||0xc8;return function(_0x1d5604){if(_0x1d5604){return _0x5bf73b[_0xd491('0x16')](_0x2f0b9d)[_0xd491('0x17')](_0x1d5604);}};}function respondWithFilteredResult(_0xe20fb,_0x57cb0d){return function(_0x39bbfb){if(_0x39bbfb){var _0x8101a6=_0x39bbfb[_0xd491('0x18')],_0x49b919=_0x57cb0d['offset'],_0x47cd3d=_0x57cb0d[_0xd491('0x19')]+_0x57cb0d[_0xd491('0x1a')],_0x4ac740;if(_0x47cd3d>=_0x8101a6){_0x47cd3d=_0x8101a6;_0x4ac740=0xc8;}else{_0x4ac740=0xce;}_0xe20fb[_0xd491('0x16')](_0x4ac740);return _0xe20fb[_0xd491('0x1b')](_0xd491('0x1c'),_0x49b919+'-'+_0x47cd3d+'/'+_0x8101a6)[_0xd491('0x17')](_0x39bbfb);}return null;};}function patchUpdates(_0x2df0b5){return function(_0x283230){try{jsonpatch[_0xd491('0x1d')](_0x283230,_0x2df0b5,!![]);}catch(_0x3a19cd){return BPromise[_0xd491('0x1e')](_0x3a19cd);}return _0x283230[_0xd491('0x1f')]();};}function saveUpdates(_0x229e35,_0x26cbfa){return function(_0x4cf467){if(_0x4cf467){return _0x4cf467[_0xd491('0x20')](_0x229e35)[_0xd491('0x21')](function(_0x31d975){return _0x31d975;});}return null;};}function removeEntity(_0x1fa90f,_0x31f08b){return function(_0x66414){if(_0x66414){return _0x66414[_0xd491('0x22')]()[_0xd491('0x21')](function(){var _0x8bf6f4=_0x66414[_0xd491('0x23')]({'plain':!![]});var _0x44288d=_0xd491('0x24');return db['UserProfileResource'][_0xd491('0x22')]({'where':{'type':_0x44288d,'resourceId':_0x8bf6f4['id']}})['then'](function(){return _0x66414;});})[_0xd491('0x21')](function(){_0x1fa90f[_0xd491('0x16')](0xcc)[_0xd491('0x15')]();});}};}function handleEntityNotFound(_0x5c645a,_0xf79c36){return function(_0x1c7d54){if(!_0x1c7d54){_0x5c645a[_0xd491('0x25')](0x194);}return _0x1c7d54;};}function handleError(_0x32356a,_0x4cb75a){_0x4cb75a=_0x4cb75a||0x1f4;return function(_0x3adb4a){logger[_0xd491('0x26')](_0x3adb4a[_0xd491('0x27')]);if(_0x3adb4a[_0xd491('0x28')]){delete _0x3adb4a['name'];}_0x32356a[_0xd491('0x16')](_0x4cb75a)[_0xd491('0x29')](_0x3adb4a);};}exports[_0xd491('0x2a')]=function(_0x3b3d38,_0x3aaa0b){var _0x49b0d7={},_0x45e378={},_0xabba59={'count':0x0,'rows':[]};var _0x4a31b1=db[_0xd491('0x2b')][_0xd491('0x2c')];_0x45e378[_0xd491('0x2d')]=_[_0xd491('0x2e')](_0x4a31b1);_0x45e378[_0xd491('0x2f')]=_[_0xd491('0x2e')](_0x3b3d38[_0xd491('0x2f')]);_0x45e378[_0xd491('0x30')]=_[_0xd491('0x31')](_0x45e378[_0xd491('0x2d')],_0x45e378[_0xd491('0x2f')]);_0x49b0d7[_0xd491('0x32')]=_['intersection'](_0x45e378[_0xd491('0x2d')],qs[_0xd491('0x33')](_0x3b3d38['query'][_0xd491('0x33')]));_0x49b0d7['attributes']=_0x49b0d7['attributes'][_0xd491('0x34')]?_0x49b0d7[_0xd491('0x32')]:_0x45e378[_0xd491('0x2d')];if(!_0x3b3d38[_0xd491('0x2f')][_0xd491('0x35')](_0xd491('0x36'))){_0x49b0d7[_0xd491('0x1a')]=qs[_0xd491('0x1a')](_0x3b3d38[_0xd491('0x2f')]['limit']);_0x49b0d7[_0xd491('0x19')]=qs[_0xd491('0x19')](_0x3b3d38[_0xd491('0x2f')][_0xd491('0x19')]);}_0x49b0d7[_0xd491('0x37')]=qs[_0xd491('0x38')](_0x3b3d38[_0xd491('0x2f')][_0xd491('0x38')]);_0x49b0d7[_0xd491('0x39')]=qs[_0xd491('0x30')](_[_0xd491('0x3a')](_0x3b3d38[_0xd491('0x2f')],_0x45e378[_0xd491('0x30')]));if(_0x3b3d38['query'][_0xd491('0x3b')]){_0x49b0d7['where']=_[_0xd491('0x3c')](_0x49b0d7[_0xd491('0x39')],{'$or':_[_0xd491('0x3d')](_0x4a31b1,function(_0x22e6a6){if(_0x22e6a6['type'][_0xd491('0x3e')]!=='VIRTUAL'){var _0x57ef8a={};_0x57ef8a[_0x22e6a6[_0xd491('0x3f')]]={'$like':'%'+_0x3b3d38[_0xd491('0x2f')][_0xd491('0x3b')]+'%'};return _0x57ef8a;}})});}_0x49b0d7=_[_0xd491('0x3c')]({},_0x49b0d7,_0x3b3d38[_0xd491('0x40')]);var _0x33715e={'where':_0x49b0d7[_0xd491('0x39')]};return db[_0xd491('0x2b')]['count'](_0x33715e)[_0xd491('0x21')](function(_0x1574af){_0xabba59['count']=_0x1574af;if(_0x3b3d38[_0xd491('0x2f')][_0xd491('0x41')]){_0x49b0d7['include']=[{'all':!![]}];}return db[_0xd491('0x2b')][_0xd491('0x42')](_0x49b0d7);})[_0xd491('0x21')](function(_0x23a589){_0xabba59['rows']=_0x23a589;return _0xabba59;})['then'](respondWithFilteredResult(_0x3aaa0b,_0x49b0d7))[_0xd491('0x43')](handleError(_0x3aaa0b,null));};exports[_0xd491('0x44')]=function(_0x8f341d,_0x455ee2){var _0x5197ae={'raw':!![],'where':{'id':_0x8f341d['params']['id']}},_0x32489f={};_0x32489f[_0xd491('0x2d')]=_[_0xd491('0x2e')](db[_0xd491('0x2b')][_0xd491('0x2c')]);_0x32489f[_0xd491('0x2f')]=_[_0xd491('0x2e')](_0x8f341d[_0xd491('0x2f')]);_0x32489f[_0xd491('0x30')]=_[_0xd491('0x31')](_0x32489f[_0xd491('0x2d')],_0x32489f[_0xd491('0x2f')]);_0x5197ae['attributes']=_[_0xd491('0x31')](_0x32489f['model'],qs[_0xd491('0x33')](_0x8f341d['query']['fields']));_0x5197ae[_0xd491('0x32')]=_0x5197ae[_0xd491('0x32')]['length']?_0x5197ae[_0xd491('0x32')]:_0x32489f[_0xd491('0x2d')];if(_0x8f341d[_0xd491('0x2f')]['includeAll']){_0x5197ae[_0xd491('0x45')]=[{'all':!![]}];}_0x5197ae=_['merge']({},_0x5197ae,_0x8f341d[_0xd491('0x40')]);return db['Disposition'][_0xd491('0x46')](_0x5197ae)['then'](handleEntityNotFound(_0x455ee2,null))[_0xd491('0x21')](respondWithResult(_0x455ee2,null))[_0xd491('0x43')](handleError(_0x455ee2,null));};exports[_0xd491('0x47')]=function(_0x223b62,_0x1456c8){return db[_0xd491('0x2b')][_0xd491('0x47')](_0x223b62[_0xd491('0x48')],{})[_0xd491('0x21')](function(_0x36fa2d){var _0x51ec94=_0x223b62[_0xd491('0x49')][_0xd491('0x23')]({'plain':!![]});if(!_0x51ec94)throw new Error(_0xd491('0x4a'));if(_0x51ec94[_0xd491('0x4b')]==='user'){var _0x23000a=_0x36fa2d[_0xd491('0x23')]({'plain':!![]});var _0x1e41d2=_0xd491('0x24');return db[_0xd491('0x4c')][_0xd491('0x46')]({'where':{'name':_0x1e41d2,'userProfileId':_0x51ec94['userProfileId']},'raw':!![]})[_0xd491('0x21')](function(_0x3a8caf){if(_0x3a8caf&&_0x3a8caf[_0xd491('0x4d')]===0x0){return db[_0xd491('0x4e')][_0xd491('0x47')]({'name':_0x23000a['name'],'resourceId':_0x23000a['id'],'type':_0x3a8caf[_0xd491('0x28')],'sectionId':_0x3a8caf['id']},{})[_0xd491('0x21')](function(){return _0x36fa2d;});}else{return _0x36fa2d;}})[_0xd491('0x43')](function(_0x3d5b44){logger[_0xd491('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d5b44);throw _0x3d5b44;});}return _0x36fa2d;})[_0xd491('0x21')](respondWithResult(_0x1456c8,0xc9))[_0xd491('0x43')](handleError(_0x1456c8,null));};exports[_0xd491('0x20')]=function(_0x242c07,_0x2de774){if(_0x242c07[_0xd491('0x48')]['id']){delete _0x242c07[_0xd491('0x48')]['id'];}return db['Disposition'][_0xd491('0x46')]({'where':{'id':_0x242c07['params']['id']}})['then'](handleEntityNotFound(_0x2de774,null))[_0xd491('0x21')](saveUpdates(_0x242c07['body'],null))[_0xd491('0x21')](respondWithResult(_0x2de774,null))[_0xd491('0x43')](handleError(_0x2de774,null));};exports['destroy']=function(_0x5446ef,_0x7c8113){return db[_0xd491('0x2b')][_0xd491('0x46')]({'where':{'id':_0x5446ef['params']['id']}})['then'](handleEntityNotFound(_0x7c8113,null))['then'](removeEntity(_0x7c8113,null))[_0xd491('0x43')](handleError(_0x7c8113,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6bf7018..7a4ad74 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 _0x2217=['tools_dispositions','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','path','exports','define','Disposition'];(function(_0x4750d7,_0x3ad6a5){var _0x3237fb=function(_0x547104){while(--_0x547104){_0x4750d7['push'](_0x4750d7['shift']());}};_0x3237fb(++_0x3ad6a5);}(_0x2217,0xb5));var _0x7221=function(_0x4ffc5d,_0x595b0a){_0x4ffc5d=_0x4ffc5d-0x0;var _0x4765c5=_0x2217[_0x4ffc5d];return _0x4765c5;};'use strict';var _=require(_0x7221('0x0'));var util=require(_0x7221('0x1'));var logger=require(_0x7221('0x2'))(_0x7221('0x3'));var moment=require(_0x7221('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7221('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x7221('0x6')]=function(_0x2fc827,_0x5c701f){return _0x2fc827[_0x7221('0x7')](_0x7221('0x8'),attributes,{'tableName':_0x7221('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x7221('0xa'),_0x7221('0xb')]},{'unique':!![],'name':_0x7221('0xc'),'fields':[_0x7221('0xa'),'ChatWebsiteId']},{'unique':!![],'name':_0x7221('0xd'),'fields':[_0x7221('0xa'),_0x7221('0xe')]},{'unique':!![],'name':_0x7221('0xf'),'fields':['name',_0x7221('0x10')]},{'unique':!![],'name':_0x7221('0x11'),'fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0x7221('0xa'),_0x7221('0x12')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdaee=['tools_dispositions','name_voice','name','ListId','name_chat','name_mail','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition'];(function(_0x7c9f34,_0x134666){var _0x2d93d1=function(_0x546121){while(--_0x546121){_0x7c9f34['push'](_0x7c9f34['shift']());}};_0x2d93d1(++_0x134666);}(_0xdaee,0x164));var _0xedae=function(_0xdc29c7,_0x32e24a){_0xdc29c7=_0xdc29c7-0x0;var _0x7388a2=_0xdaee[_0xdc29c7];return _0x7388a2;};'use strict';var _=require(_0xedae('0x0'));var util=require(_0xedae('0x1'));var logger=require(_0xedae('0x2'))(_0xedae('0x3'));var moment=require(_0xedae('0x4'));var BPromise=require(_0xedae('0x5'));var rp=require(_0xedae('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedae('0x7'));var config=require('../../config/environment');var attributes=require(_0xedae('0x8'));module[_0xedae('0x9')]=function(_0x349d78,_0x1f11b9){return _0x349d78[_0xedae('0xa')](_0xedae('0xb'),attributes,{'tableName':_0xedae('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xedae('0xd'),'fields':[_0xedae('0xe'),_0xedae('0xf')]},{'unique':!![],'name':_0xedae('0x10'),'fields':[_0xedae('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0xedae('0x11'),'fields':[_0xedae('0xe'),'MailAccountId']},{'unique':!![],'name':_0xedae('0x12'),'fields':['name',_0xedae('0x13')]},{'unique':!![],'name':_0xedae('0x14'),'fields':[_0xedae('0xe'),_0xedae('0x15')]},{'unique':!![],'name':_0xedae('0x16'),'fields':[_0xedae('0xe'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 5a9c21c..d93e08e 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 _0xba18=['request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','Disposition,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_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 moment=require(_0x8ba1('0x2'));var BPromise=require(_0x8ba1('0x3'));var rs=require(_0x8ba1('0x4'));var fs=require('fs');var Redis=require(_0x8ba1('0x5'));var db=require(_0x8ba1('0x6'))['db'];var utils=require(_0x8ba1('0x7'));var logger=require('../../config/logger')(_0x8ba1('0x8'));var config=require(_0x8ba1('0x9'));var jayson=require(_0x8ba1('0xa'));var client=jayson[_0x8ba1('0xb')][_0x8ba1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ffa15,_0x51a988,_0x3a87eb){return new BPromise(function(_0x3d1fe7,_0x4dc6c4){return client['request'](_0x2ffa15,_0x3a87eb)['then'](function(_0x4609ce){logger[_0x8ba1('0xd')]('Disposition,\x20%s,\x20%s',_0x51a988,_0x8ba1('0xe'));logger[_0x8ba1('0xf')](_0x8ba1('0x10'),_0x51a988,_0x8ba1('0xe'),JSON[_0x8ba1('0x11')](_0x4609ce));if(_0x4609ce['error']){if(_0x4609ce[_0x8ba1('0x12')][_0x8ba1('0x13')]===0x1f4){logger[_0x8ba1('0x12')](_0x8ba1('0x14'),_0x51a988,_0x4609ce[_0x8ba1('0x12')][_0x8ba1('0x15')]);return _0x4dc6c4(_0x4609ce['error'][_0x8ba1('0x15')]);}logger[_0x8ba1('0x12')](_0x8ba1('0x14'),_0x51a988,_0x4609ce[_0x8ba1('0x12')]['message']);return _0x3d1fe7(_0x4609ce['error']['message']);}else{logger[_0x8ba1('0xd')](_0x8ba1('0x14'),_0x51a988,_0x8ba1('0xe'));_0x3d1fe7(_0x4609ce[_0x8ba1('0x16')][_0x8ba1('0x15')]);}})[_0x8ba1('0x17')](function(_0x107846){logger[_0x8ba1('0x12')](_0x8ba1('0x14'),_0x51a988,_0x107846);_0x4dc6c4(_0x107846);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Disposition,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3fe476,_0x31755a){var _0x5b3b8c=function(_0x511b54){while(--_0x511b54){_0x3fe476['push'](_0x3fe476['shift']());}};_0x5b3b8c(++_0x31755a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x5fc3[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Disposition,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Disposition,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 001964f..d8f97dc 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 _0x449c=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x2081aa,_0x31d653){var _0x36485d=function(_0x4381f5){while(--_0x4381f5){_0x2081aa['push'](_0x2081aa['shift']());}};_0x36485d(++_0x31d653);}(_0x449c,0x9b));var _0xc449=function(_0x2820bf,_0x1550f5){_0x2820bf=_0x2820bf-0x0;var _0x4b2973=_0x449c[_0x2820bf];return _0x4b2973;};'use strict';var multer=require(_0xc449('0x0'));var util=require(_0xc449('0x1'));var path=require(_0xc449('0x2'));var timeout=require('connect-timeout');var express=require(_0xc449('0x3'));var router=express[_0xc449('0x4')]();var auth=require(_0xc449('0x5'));var interaction=require(_0xc449('0x6'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xc449('0x7')]('/',auth[_0xc449('0x8')](),controller[_0xc449('0x9')]);router[_0xc449('0x7')](_0xc449('0xa'),auth[_0xc449('0x8')](),controller[_0xc449('0xb')]);router[_0xc449('0xc')]('/',auth[_0xc449('0x8')](),controller[_0xc449('0xd')]);router[_0xc449('0xe')](_0xc449('0xa'),auth[_0xc449('0x8')](),controller[_0xc449('0xf')]);router[_0xc449('0x10')](_0xc449('0xa'),auth['isAuthenticated'](),controller[_0xc449('0x11')]);module[_0xc449('0x12')]=router; \ No newline at end of file +var _0x42e1=['get','isAuthenticated','index','show','put','update','/:id','destroy','exports','util','connect-timeout','express','Router'];(function(_0x1a8d7b,_0x23bf63){var _0x338c60=function(_0x1a69fb){while(--_0x1a69fb){_0x1a8d7b['push'](_0x1a8d7b['shift']());}};_0x338c60(++_0x23bf63);}(_0x42e1,0x1dd));var _0x142e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x42e1[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x142e('0x0'));var path=require('path');var timeout=require(_0x142e('0x1'));var express=require(_0x142e('0x2'));var router=express[_0x142e('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x142e('0x4')]('/',auth[_0x142e('0x5')](),controller[_0x142e('0x6')]);router[_0x142e('0x4')]('/:id',auth[_0x142e('0x5')](),controller[_0x142e('0x7')]);router['post']('/',auth[_0x142e('0x5')](),controller['create']);router[_0x142e('0x8')]('/:id',auth[_0x142e('0x5')](),controller[_0x142e('0x9')]);router['delete'](_0x142e('0xa'),auth[_0x142e('0x5')](),controller[_0x142e('0xb')]);module[_0x142e('0xc')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 5cbf539..efd9eda 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 _0xc1ff=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','9600','12000','14400','4800','2400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x5dde93,_0x150f84){var _0x52884d=function(_0x148609){while(--_0x148609){_0x5dde93['push'](_0x5dde93['shift']());}};_0x52884d(++_0x150f84);}(_0xc1ff,0xd3));var _0xfc1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1ff[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfc1f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfc1f('0x1')]},'ecm':{'type':Sequelize[_0xfc1f('0x2')](_0xfc1f('0x3'),'no'),'defaultValue':_0xfc1f('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0xfc1f('0x4')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xfc1f('0x5')},'minrate':{'type':Sequelize[_0xfc1f('0x2')]('2400','4800','7200',_0xfc1f('0x6'),_0xfc1f('0x7'),_0xfc1f('0x8')),'defaultValue':_0xfc1f('0x9')},'maxrate':{'type':Sequelize[_0xfc1f('0x2')](_0xfc1f('0xa'),'4800','7200',_0xfc1f('0x6'),_0xfc1f('0x7'),_0xfc1f('0x8')),'defaultValue':_0xfc1f('0x8')},'modem':{'type':Sequelize[_0xfc1f('0x1')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xfc1f('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xfc1f('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfc1f('0x2')](_0xfc1f('0xc'),_0xfc1f('0xd'),_0xfc1f('0xe'),_0xfc1f('0xf')),'defaultValue':_0xfc1f('0xc')},'key':{'type':Sequelize[_0xfc1f('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfc1f('0x10')],'defaultValue':function(){return _0xfc1f('0x11');}},'notificationSound':{'type':Sequelize[_0xfc1f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc1f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfc1f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc1f('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfc1f('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xfc1f('0x12')],'defaultValue':![],'comment':_0xfc1f('0x13'),'set':function(_0x3e65d0){if(!_0x3e65d0)this['setDataValue'](_0xfc1f('0x14'),null);this[_0xfc1f('0x15')](_0xfc1f('0x16'),_0x3e65d0);}}}; \ No newline at end of file +var _0x4655=['sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','2400','v17,v27,v29','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','mandatoryDisposition'];(function(_0x57185a,_0x2fb687){var _0x29ab4f=function(_0x4c8783){while(--_0x4c8783){_0x57185a['push'](_0x57185a['shift']());}};_0x29ab4f(++_0x2fb687);}(_0x4655,0x186));var _0x5465=function(_0xb09d1b,_0x412994){_0xb09d1b=_0xb09d1b-0x0;var _0x43626b=_0x4655[_0xb09d1b];return _0x43626b;};'use strict';var Sequelize=require(_0x5465('0x0'));module[_0x5465('0x1')]={'name':{'type':Sequelize[_0x5465('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5465('0x2')]},'ecm':{'type':Sequelize[_0x5465('0x3')](_0x5465('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x5465('0x2')],'defaultValue':_0x5465('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x5465('0x6')},'minrate':{'type':Sequelize[_0x5465('0x3')]('2400',_0x5465('0x7'),_0x5465('0x8'),_0x5465('0x9'),_0x5465('0xa'),_0x5465('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x5465('0x3')](_0x5465('0xc'),_0x5465('0x7'),_0x5465('0x8'),_0x5465('0x9'),_0x5465('0xa'),'14400'),'defaultValue':_0x5465('0xb')},'modem':{'type':Sequelize[_0x5465('0x2')],'defaultValue':_0x5465('0xd')},'gateway':{'type':Sequelize[_0x5465('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5465('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5465('0x3')](_0x5465('0xe'),'IAX',_0x5465('0xf'),_0x5465('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5465('0x11')],'defaultValue':function(){return _0x5465('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5465('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5465('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5465('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5465('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5465('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5465('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5465('0x14')],'allowNull':!![],'defaultValue':null,'comment':_0x5465('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x5465('0x16'),'set':function(_0x113acc){if(!_0x113acc)this['setDataValue'](_0x5465('0x17'),null);this[_0x5465('0x18')](_0x5465('0x19'),_0x113acc);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 8177375..dff3a6c 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 _0x7873=['jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','FaxAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','model','keys','filters','query','intersection','fields','attributes','nolimit','order','sort','where','merge','map','type','field','options','count','includeAll','findAll','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','FaxAccountId','getDispositions','findOne','Disposition','pick','filter','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','rows','removeAnswers','addInteraction','FaxInteraction','getInteractions','Contact','User','fullname','Tags','tag','sequelize','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','push','ecm','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Set','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','updateAccountApplications','omit','tech','key','createdAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','CmContact','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','register'];(function(_0x1556c7,_0x4e4209){var _0x141dd5=function(_0xd8ec1e){while(--_0xd8ec1e){_0x1556c7['push'](_0x1556c7['shift']());}};_0x141dd5(++_0x4e4209);}(_0x7873,0x163));var _0x3787=function(_0x20948a,_0x5d2ca6){_0x20948a=_0x20948a-0x0;var _0x3dab4f=_0x7873[_0x20948a];return _0x3dab4f;};'use strict';var pdf=require(_0x3787('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3787('0x1'));var zipdir=require(_0x3787('0x2'));var jsonpatch=require(_0x3787('0x3'));var rp=require(_0x3787('0x4'));var moment=require(_0x3787('0x5'));var BPromise=require(_0x3787('0x6'));var Mustache=require(_0x3787('0x7'));var util=require(_0x3787('0x8'));var path=require(_0x3787('0x9'));var sox=require(_0x3787('0xa'));var csv=require(_0x3787('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3787('0xc'));var squel=require(_0x3787('0xd'));var crypto=require(_0x3787('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3787('0xb'));var querystring=require(_0x3787('0xf'));var Papa=require(_0x3787('0x10'));var Redis=require(_0x3787('0x11'));var authService=require(_0x3787('0x12'));var qs=require(_0x3787('0x13'));var hardwareService=require(_0x3787('0x14'));var logger=require(_0x3787('0x15'))(_0x3787('0x16'));var utils=require(_0x3787('0x17'));var config=require(_0x3787('0x18'));var db=require(_0x3787('0x19'))['db'];config[_0x3787('0x1a')]=_[_0x3787('0x1b')](config['redis'],{'host':_0x3787('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3787('0x1a')]));require(_0x3787('0x1d'))[_0x3787('0x1e')](socket);var jayson=require(_0x3787('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x3787('0x20')][_0x3787('0x21')]({'port':0x232a});function checkPasswordPattern(_0x563e64,_0x1b5f63,_0x4e36b8){if(_0x4e36b8){var _0xda9a1b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xda9a1b[_0x3787('0x22')](_0x1b5f63)){return _0x563e64;}else{throw new Error(_0x3787('0x23'));}}else{return _0x563e64;}}function respondWithRpcPromise(_0x4e4006,_0x1211c6,_0x2f3ddc,_0x4e8b3b){return new BPromise(function(_0x5d3742,_0x1e8200){var _0xdf8407=_0x4e8b3b||client;return _0xdf8407[_0x3787('0x24')](_0x4e4006,_0x2f3ddc)['then'](function(_0x103314){logger[_0x3787('0x25')](_0x3787('0x26'),_0x1211c6,'request\x20sent');logger['debug'](_0x3787('0x27'),_0x1211c6,'request\x20sent',JSON[_0x3787('0x28')](_0x103314));if(_0x103314[_0x3787('0x29')]){if(_0x103314['error'][_0x3787('0x2a')]===0x1f4){logger['error'](_0x3787('0x26'),_0x1211c6,_0x103314['error'][_0x3787('0x2b')]);return _0x1e8200(_0x103314[_0x3787('0x29')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x1211c6,_0x103314['error']['message']);return _0x5d3742(_0x103314[_0x3787('0x29')]['message']);}else{logger[_0x3787('0x25')]('FaxAccount,\x20%s,\x20%s',_0x1211c6,_0x3787('0x2c'));_0x5d3742(_0x103314[_0x3787('0x2d')][_0x3787('0x2b')]);}})[_0x3787('0x2e')](function(_0x5befd1){logger['error'](_0x3787('0x26'),_0x1211c6,_0x5befd1);_0x1e8200(_0x5befd1);});});}function respondWithStatusCode(_0x95a54a,_0x2834de){_0x2834de=_0x2834de||0xcc;return function(_0x4b60d5){if(_0x4b60d5){return _0x95a54a[_0x3787('0x2f')](_0x2834de);}return _0x95a54a[_0x3787('0x30')](_0x2834de)[_0x3787('0x31')]();};}function respondWithResult(_0x2a0dcc,_0x51bcbb){_0x51bcbb=_0x51bcbb||0xc8;return function(_0x129732){if(_0x129732){return _0x2a0dcc[_0x3787('0x30')](_0x51bcbb)['json'](_0x129732);}};}function respondWithFilteredResult(_0x354e3c,_0x387ad6){return function(_0x3bee1c){if(_0x3bee1c){var _0x537942=_0x3bee1c['count'],_0x8a0dac=_0x387ad6[_0x3787('0x32')],_0x2a80a3=_0x387ad6['offset']+_0x387ad6[_0x3787('0x33')],_0x111f1a;if(_0x2a80a3>=_0x537942){_0x2a80a3=_0x537942;_0x111f1a=0xc8;}else{_0x111f1a=0xce;}_0x354e3c['status'](_0x111f1a);return _0x354e3c[_0x3787('0x34')](_0x3787('0x35'),_0x8a0dac+'-'+_0x2a80a3+'/'+_0x537942)[_0x3787('0x36')](_0x3bee1c);}return null;};}function patchUpdates(_0x5db364){return function(_0x29c98d){try{jsonpatch[_0x3787('0x37')](_0x29c98d,_0x5db364,!![]);}catch(_0x46226f){return BPromise['reject'](_0x46226f);}return _0x29c98d[_0x3787('0x38')]();};}function saveUpdates(_0x1e57de,_0x48463e){return function(_0x51c267){if(_0x51c267){return _0x51c267[_0x3787('0x39')](_0x1e57de)[_0x3787('0x3a')](function(_0x453dc7){return _0x453dc7;});}return null;};}function removeEntity(_0x57bf86,_0xc442ae){return function(_0x112fdd){if(_0x112fdd){return _0x112fdd[_0x3787('0x3b')]()[_0x3787('0x3a')](function(){var _0x1523a7=_0x112fdd['get']({'plain':!![]});var _0x273740=_0x3787('0x3c');return db[_0x3787('0x3d')][_0x3787('0x3b')]({'where':{'type':_0x273740,'resourceId':_0x1523a7['id']}})[_0x3787('0x3a')](function(){return _0x112fdd;});})['then'](function(){_0x57bf86[_0x3787('0x30')](0xcc)[_0x3787('0x31')]();});}};}function handleEntityNotFound(_0x3c80cb,_0x1cc7eb){return function(_0x39e50c){if(!_0x39e50c){_0x3c80cb['sendStatus'](0x194);}return _0x39e50c;};}function handleError(_0x45068c,_0x2fef43){_0x2fef43=_0x2fef43||0x1f4;return function(_0x52222d){logger['error'](_0x52222d[_0x3787('0x3e')]);if(_0x52222d[_0x3787('0x3f')]){delete _0x52222d[_0x3787('0x3f')];}_0x45068c['status'](_0x2fef43)['send'](_0x52222d);};}exports[_0x3787('0x40')]=function(_0x2a9fb4,_0x835be4){var _0x283f12={'include':[{'model':db[_0x3787('0x41')],'as':_0x3787('0x42')}]},_0x89741c={},_0x42e2f4={'count':0x0,'rows':[]};var _0x3403c9=db[_0x3787('0x43')][_0x3787('0x44')];_0x89741c[_0x3787('0x45')]=_[_0x3787('0x46')](_0x3403c9);_0x89741c['query']=_[_0x3787('0x46')](_0x2a9fb4['query']);_0x89741c[_0x3787('0x47')]=_['intersection'](_0x89741c[_0x3787('0x45')],_0x89741c[_0x3787('0x48')]);_0x283f12['attributes']=_[_0x3787('0x49')](_0x89741c[_0x3787('0x45')],qs[_0x3787('0x4a')](_0x2a9fb4['query'][_0x3787('0x4a')]));_0x283f12['attributes']=_0x283f12[_0x3787('0x4b')]['length']?_0x283f12[_0x3787('0x4b')]:_0x89741c['model'];if(!_0x2a9fb4[_0x3787('0x48')]['hasOwnProperty'](_0x3787('0x4c'))){_0x283f12[_0x3787('0x33')]=qs['limit'](_0x2a9fb4[_0x3787('0x48')]['limit']);_0x283f12['offset']=qs['offset'](_0x2a9fb4[_0x3787('0x48')]['offset']);}_0x283f12[_0x3787('0x4d')]=qs['sort'](_0x2a9fb4[_0x3787('0x48')][_0x3787('0x4e')]);_0x283f12[_0x3787('0x4f')]=qs['filters'](_['pick'](_0x2a9fb4['query'],_0x89741c[_0x3787('0x47')]));if(_0x2a9fb4[_0x3787('0x48')]['filter']){_0x283f12[_0x3787('0x4f')]=_[_0x3787('0x50')](_0x283f12[_0x3787('0x4f')],{'$or':_[_0x3787('0x51')](_0x3403c9,function(_0x24d846){if(_0x24d846[_0x3787('0x52')]['key']!=='VIRTUAL'){var _0x4da562={};_0x4da562[_0x24d846[_0x3787('0x53')]]={'$like':'%'+_0x2a9fb4[_0x3787('0x48')]['filter']+'%'};return _0x4da562;}})});}_0x283f12=_[_0x3787('0x50')]({},_0x283f12,_0x2a9fb4[_0x3787('0x54')]);var _0x87f7a1={'where':_0x283f12[_0x3787('0x4f')]};return db['FaxAccount'][_0x3787('0x55')](_0x87f7a1)[_0x3787('0x3a')](function(_0x1ff51f){_0x42e2f4[_0x3787('0x55')]=_0x1ff51f;if(_0x2a9fb4[_0x3787('0x48')][_0x3787('0x56')]){_0x283f12['include']=[{'all':!![]}];}return db[_0x3787('0x43')][_0x3787('0x57')](_0x283f12);})['then'](function(_0x2f5265){_0x42e2f4['rows']=_0x2f5265;return _0x42e2f4;})['then'](respondWithFilteredResult(_0x835be4,_0x283f12))[_0x3787('0x2e')](handleError(_0x835be4,null));};exports[_0x3787('0x58')]=function(_0x41767f,_0x4f4090){var _0x4e1561={'raw':![],'where':{'id':_0x41767f[_0x3787('0x59')]['id']},'include':[{'model':db[_0x3787('0x41')],'as':_0x3787('0x42')}]},_0x989de9={};_0x989de9[_0x3787('0x45')]=_[_0x3787('0x46')](db['FaxAccount']['rawAttributes']);_0x989de9[_0x3787('0x48')]=_[_0x3787('0x46')](_0x41767f[_0x3787('0x48')]);_0x989de9[_0x3787('0x47')]=_[_0x3787('0x49')](_0x989de9[_0x3787('0x45')],_0x989de9[_0x3787('0x48')]);_0x4e1561[_0x3787('0x4b')]=_['intersection'](_0x989de9['model'],qs[_0x3787('0x4a')](_0x41767f[_0x3787('0x48')][_0x3787('0x4a')]));_0x4e1561['attributes']=_0x4e1561[_0x3787('0x4b')][_0x3787('0x5a')]?_0x4e1561[_0x3787('0x4b')]:_0x989de9[_0x3787('0x45')];if(_0x41767f[_0x3787('0x48')][_0x3787('0x56')]){_0x4e1561[_0x3787('0x5b')]=[{'all':!![]}];}_0x4e1561=_[_0x3787('0x50')]({},_0x4e1561,_0x41767f[_0x3787('0x54')]);return db[_0x3787('0x43')]['find'](_0x4e1561)[_0x3787('0x3a')](handleEntityNotFound(_0x4f4090,null))[_0x3787('0x3a')](respondWithResult(_0x4f4090,null))['catch'](handleError(_0x4f4090,null));};exports['create']=function(_0x206b99,_0x2871a2){return db[_0x3787('0x43')][_0x3787('0x5c')](_0x206b99[_0x3787('0x5d')],{})[_0x3787('0x3a')](function(_0x5c05ba){var _0x2ac1c0=_0x206b99[_0x3787('0x5e')]['get']({'plain':!![]});if(!_0x2ac1c0)throw new Error(_0x3787('0x5f'));if(_0x2ac1c0[_0x3787('0x60')]===_0x3787('0x5e')){var _0x5c031a=_0x5c05ba[_0x3787('0x61')]({'plain':!![]});var _0x55ab35='FaxAccounts';return db[_0x3787('0x62')]['find']({'where':{'name':_0x55ab35,'userProfileId':_0x2ac1c0[_0x3787('0x63')]},'raw':!![]})[_0x3787('0x3a')](function(_0x5a4d7d){if(_0x5a4d7d&&_0x5a4d7d[_0x3787('0x64')]===0x0){return db[_0x3787('0x3d')][_0x3787('0x5c')]({'name':_0x5c031a['name'],'resourceId':_0x5c031a['id'],'type':_0x5a4d7d[_0x3787('0x3f')],'sectionId':_0x5a4d7d['id']},{})[_0x3787('0x3a')](function(){return _0x5c05ba;});}else{return _0x5c05ba;}})[_0x3787('0x2e')](function(_0x21fb77){logger[_0x3787('0x29')](_0x3787('0x65'),_0x21fb77);throw _0x21fb77;});}return _0x5c05ba;})[_0x3787('0x3a')](respondWithResult(_0x2871a2,0xc9))[_0x3787('0x2e')](handleError(_0x2871a2,null));};exports[_0x3787('0x39')]=function(_0x22aa17,_0x156625){if(_0x22aa17['body']['id']){delete _0x22aa17[_0x3787('0x5d')]['id'];}return db['FaxAccount'][_0x3787('0x66')]({'where':{'id':_0x22aa17[_0x3787('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3787('0x3a')](handleEntityNotFound(_0x156625,null))['then'](saveUpdates(_0x22aa17['body'],null))[_0x3787('0x3a')](respondWithResult(_0x156625,null))['catch'](handleError(_0x156625,null));};exports[_0x3787('0x3b')]=function(_0x2aa2fe,_0x3ac5b2){return db['FaxAccount'][_0x3787('0x66')]({'where':{'id':_0x2aa2fe[_0x3787('0x59')]['id']}})['then'](handleEntityNotFound(_0x3ac5b2,null))[_0x3787('0x3a')](removeEntity(_0x3ac5b2,null))[_0x3787('0x2e')](handleError(_0x3ac5b2,null));};exports[_0x3787('0x67')]=function(_0x2764b9,_0xe2e119){return db[_0x3787('0x43')][_0x3787('0x67')]()[_0x3787('0x3a')](respondWithResult(_0xe2e119,null))[_0x3787('0x2e')](handleError(_0xe2e119,null));};exports[_0x3787('0x68')]=function(_0x19ead1,_0x253c44,_0x221ba5){if(_0x19ead1[_0x3787('0x5d')]['id']){delete _0x19ead1['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x19ead1[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x253c44,null))['then'](function(_0x44a7ff){if(_0x44a7ff){_0x19ead1[_0x3787('0x5d')][_0x3787('0x69')]=_0x44a7ff['id'];return db['Disposition'][_0x3787('0x5c')](_0x19ead1[_0x3787('0x5d')]);}})[_0x3787('0x3a')](respondWithResult(_0x253c44,null))[_0x3787('0x2e')](handleError(_0x253c44,null));};exports[_0x3787('0x6a')]=function(_0x3e9357,_0x15e0da,_0x58308a){var _0x41d397={'raw':![],'where':{}};var _0x1687ed={};var _0x476e6c={'count':0x0,'rows':[]};return db[_0x3787('0x43')][_0x3787('0x6b')]({'where':{'id':_0x3e9357['params']['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x15e0da,null))['then'](function(_0x34ff74){if(_0x34ff74){_0x1687ed[_0x3787('0x45')]=_[_0x3787('0x46')](db[_0x3787('0x6c')][_0x3787('0x44')]);_0x1687ed[_0x3787('0x48')]=_[_0x3787('0x46')](_0x3e9357[_0x3787('0x48')]);_0x1687ed[_0x3787('0x47')]=_['intersection'](_0x1687ed[_0x3787('0x45')],_0x1687ed[_0x3787('0x48')]);_0x41d397[_0x3787('0x4b')]=_[_0x3787('0x49')](_0x1687ed[_0x3787('0x45')],qs[_0x3787('0x4a')](_0x3e9357[_0x3787('0x48')]['fields']));_0x41d397[_0x3787('0x4b')]=_0x41d397[_0x3787('0x4b')]['length']?_0x41d397[_0x3787('0x4b')]:_0x1687ed['model'];if(!_0x3e9357[_0x3787('0x48')]['hasOwnProperty']('nolimit')){_0x41d397['limit']=qs[_0x3787('0x33')](_0x3e9357[_0x3787('0x48')]['limit']);_0x41d397['offset']=qs['offset'](_0x3e9357[_0x3787('0x48')][_0x3787('0x32')]);}_0x41d397[_0x3787('0x4d')]=qs['sort'](_0x3e9357['query']['sort']);_0x41d397['where']=qs[_0x3787('0x47')](_[_0x3787('0x6d')](_0x3e9357[_0x3787('0x48')],_0x1687ed[_0x3787('0x47')]));_0x41d397['where'][_0x3787('0x69')]=_0x34ff74['id'];if(_0x3e9357['query'][_0x3787('0x6e')]){_0x41d397[_0x3787('0x4f')]=_[_0x3787('0x50')](_0x41d397['where'],{'$or':_[_0x3787('0x51')](_0x41d397[_0x3787('0x4b')],function(_0x1b4732){var _0x4b292b={};_0x4b292b[_0x1b4732]={'$like':'%'+_0x3e9357['query'][_0x3787('0x6e')]+'%'};return _0x4b292b;})});}_0x41d397=_[_0x3787('0x50')]({},_0x41d397,_0x3e9357['options']);return db[_0x3787('0x6c')][_0x3787('0x55')]({'where':_0x41d397[_0x3787('0x4f')]})[_0x3787('0x3a')](function(_0x4b1cb6){_0x476e6c[_0x3787('0x55')]=_0x4b1cb6;if(_0x3e9357[_0x3787('0x48')][_0x3787('0x56')]){_0x41d397[_0x3787('0x5b')]=[{'all':!![]}];}return db['Disposition'][_0x3787('0x57')](_0x41d397);})[_0x3787('0x3a')](function(_0x564af9){_0x476e6c['rows']=_0x564af9;return _0x476e6c;});}})[_0x3787('0x3a')](respondWithFilteredResult(_0x15e0da,_0x41d397))[_0x3787('0x2e')](handleError(_0x15e0da,null));};exports[_0x3787('0x6f')]=function(_0x2b0c8f,_0xa8f2a6,_0x5f024d){return db[_0x3787('0x43')][_0x3787('0x66')]({'where':{'id':_0x2b0c8f['params']['id']}})['then'](handleEntityNotFound(_0xa8f2a6,null))[_0x3787('0x3a')](function(_0x2ea171){if(_0x2ea171){return _0x2ea171['removeDispositions'](_0x2b0c8f[_0x3787('0x48')][_0x3787('0x70')]);}})[_0x3787('0x3a')](respondWithStatusCode(_0xa8f2a6,null))['catch'](handleError(_0xa8f2a6,null));};exports[_0x3787('0x71')]=function(_0xa6ee2e,_0x54285c,_0x48d094){if(_0xa6ee2e[_0x3787('0x5d')]['id']){delete _0xa6ee2e[_0x3787('0x5d')]['id'];}return db['FaxAccount'][_0x3787('0x66')]({'where':{'id':_0xa6ee2e[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x54285c,null))[_0x3787('0x3a')](function(_0x4bd6e5){if(_0x4bd6e5){_0xa6ee2e[_0x3787('0x5d')]['FaxAccountId']=_0x4bd6e5['id'];return db[_0x3787('0x72')][_0x3787('0x5c')](_0xa6ee2e[_0x3787('0x5d')]);}})[_0x3787('0x3a')](respondWithResult(_0x54285c,null))[_0x3787('0x2e')](handleError(_0x54285c,null));};exports['getAnswers']=function(_0x97123f,_0x5f348c,_0x228a1d){var _0x13e756={'raw':![],'where':{}};var _0x2a66f7={};var _0x5e1bb5={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x97123f[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x5f348c,null))['then'](function(_0x1944d5){if(_0x1944d5){_0x2a66f7[_0x3787('0x45')]=_['keys'](db[_0x3787('0x72')][_0x3787('0x44')]);_0x2a66f7[_0x3787('0x48')]=_['keys'](_0x97123f['query']);_0x2a66f7[_0x3787('0x47')]=_['intersection'](_0x2a66f7[_0x3787('0x45')],_0x2a66f7[_0x3787('0x48')]);_0x13e756[_0x3787('0x4b')]=_[_0x3787('0x49')](_0x2a66f7[_0x3787('0x45')],qs[_0x3787('0x4a')](_0x97123f[_0x3787('0x48')][_0x3787('0x4a')]));_0x13e756[_0x3787('0x4b')]=_0x13e756[_0x3787('0x4b')]['length']?_0x13e756[_0x3787('0x4b')]:_0x2a66f7[_0x3787('0x45')];if(!_0x97123f['query'][_0x3787('0x73')](_0x3787('0x4c'))){_0x13e756[_0x3787('0x33')]=qs[_0x3787('0x33')](_0x97123f[_0x3787('0x48')][_0x3787('0x33')]);_0x13e756[_0x3787('0x32')]=qs[_0x3787('0x32')](_0x97123f[_0x3787('0x48')][_0x3787('0x32')]);}_0x13e756['order']=qs[_0x3787('0x4e')](_0x97123f[_0x3787('0x48')]['sort']);_0x13e756[_0x3787('0x4f')]=qs['filters'](_[_0x3787('0x6d')](_0x97123f[_0x3787('0x48')],_0x2a66f7[_0x3787('0x47')]));_0x13e756[_0x3787('0x4f')][_0x3787('0x69')]=_0x1944d5['id'];if(_0x97123f[_0x3787('0x48')][_0x3787('0x6e')]){_0x13e756[_0x3787('0x4f')]=_[_0x3787('0x50')](_0x13e756[_0x3787('0x4f')],{'$or':_[_0x3787('0x51')](_0x13e756[_0x3787('0x4b')],function(_0x531597){var _0x57d5fb={};_0x57d5fb[_0x531597]={'$like':'%'+_0x97123f[_0x3787('0x48')]['filter']+'%'};return _0x57d5fb;})});}_0x13e756=_[_0x3787('0x50')]({},_0x13e756,_0x97123f['options']);return db[_0x3787('0x72')][_0x3787('0x55')]({'where':_0x13e756[_0x3787('0x4f')]})['then'](function(_0x4d4259){_0x5e1bb5[_0x3787('0x55')]=_0x4d4259;if(_0x97123f[_0x3787('0x48')][_0x3787('0x56')]){_0x13e756[_0x3787('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3787('0x57')](_0x13e756);})[_0x3787('0x3a')](function(_0x26b344){_0x5e1bb5[_0x3787('0x74')]=_0x26b344;return _0x5e1bb5;});}})['then'](respondWithFilteredResult(_0x5f348c,_0x13e756))['catch'](handleError(_0x5f348c,null));};exports[_0x3787('0x75')]=function(_0x12843d,_0x509035,_0x1fca3d){return db[_0x3787('0x43')][_0x3787('0x66')]({'where':{'id':_0x12843d[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x509035,null))[_0x3787('0x3a')](function(_0x19ba19){if(_0x19ba19){return _0x19ba19[_0x3787('0x75')](_0x12843d['query'][_0x3787('0x70')]);}})[_0x3787('0x3a')](respondWithStatusCode(_0x509035,null))[_0x3787('0x2e')](handleError(_0x509035,null));};exports[_0x3787('0x76')]=function(_0x9bd07e,_0x3f0d75,_0x5607c0){return db[_0x3787('0x77')][_0x3787('0x66')]({'where':{'id':_0x9bd07e[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x3f0d75,null))[_0x3787('0x3a')](function(_0x4360b2){if(_0x4360b2){return _0x4360b2['addInteraction'](_0x9bd07e[_0x3787('0x5d')][_0x3787('0x70')],_['omit'](_0x9bd07e[_0x3787('0x5d')],['ids','id'])||{});}})[_0x3787('0x3a')](respondWithResult(_0x3f0d75,null))[_0x3787('0x2e')](handleError(_0x3f0d75,null));};exports[_0x3787('0x78')]=function(_0x2e894a,_0x33eac3,_0x1dc4cc){var _0x2c2b6f={'raw':![],'where':{}};var _0x5ee0e8={};var _0x34fdc4={'count':0x0,'rows':[]};return db[_0x3787('0x43')][_0x3787('0x6b')]({'where':{'id':_0x2e894a[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x33eac3,null))[_0x3787('0x3a')](function(_0x2efa90){if(_0x2efa90){_0x5ee0e8['model']=_[_0x3787('0x46')](db[_0x3787('0x77')][_0x3787('0x44')]);_0x5ee0e8[_0x3787('0x48')]=_[_0x3787('0x46')](_0x2e894a[_0x3787('0x48')]);_0x5ee0e8[_0x3787('0x47')]=_['intersection'](_0x5ee0e8[_0x3787('0x45')],_0x5ee0e8[_0x3787('0x48')]);_0x2c2b6f['attributes']=_[_0x3787('0x49')](_0x5ee0e8[_0x3787('0x45')],qs[_0x3787('0x4a')](_0x2e894a[_0x3787('0x48')][_0x3787('0x4a')]));_0x2c2b6f[_0x3787('0x4b')]=_0x2c2b6f[_0x3787('0x4b')][_0x3787('0x5a')]?_0x2c2b6f['attributes']:_0x5ee0e8['model'];if(!_0x2e894a[_0x3787('0x48')][_0x3787('0x73')](_0x3787('0x4c'))){_0x2c2b6f['limit']=qs['limit'](_0x2e894a[_0x3787('0x48')]['limit']);_0x2c2b6f[_0x3787('0x32')]=qs['offset'](_0x2e894a[_0x3787('0x48')][_0x3787('0x32')]);}_0x2c2b6f[_0x3787('0x4d')]=qs[_0x3787('0x4e')](_0x2e894a[_0x3787('0x48')][_0x3787('0x4e')]);_0x2c2b6f['where']=qs[_0x3787('0x47')](_['pick'](_0x2e894a[_0x3787('0x48')],_0x5ee0e8[_0x3787('0x47')]));_0x2c2b6f[_0x3787('0x4f')][_0x3787('0x69')]=_0x2efa90['id'];if(_0x2e894a[_0x3787('0x48')][_0x3787('0x6e')]){_0x2c2b6f[_0x3787('0x4f')]=_[_0x3787('0x50')](_0x2c2b6f[_0x3787('0x4f')],{'$or':_[_0x3787('0x51')](_0x2c2b6f[_0x3787('0x4b')],function(_0x2346fb){var _0x4d9bcb={};_0x4d9bcb[_0x2346fb]={'$like':'%'+_0x2e894a['query'][_0x3787('0x6e')]+'%'};return _0x4d9bcb;})});}_0x2c2b6f=_[_0x3787('0x50')]({},_0x2c2b6f,_0x2e894a[_0x3787('0x54')]);return db[_0x3787('0x77')][_0x3787('0x55')]({'where':_0x2c2b6f[_0x3787('0x4f')]})[_0x3787('0x3a')](function(_0x2439bc){_0x34fdc4[_0x3787('0x55')]=_0x2439bc;if(_0x2e894a[_0x3787('0x48')][_0x3787('0x56')]){_0x2c2b6f[_0x3787('0x5b')]=[{'model':db['CmContact'],'as':_0x3787('0x79'),'required':![]},{'model':db[_0x3787('0x7a')],'as':'Owner','attributes':[_0x3787('0x3f'),_0x3787('0x7b'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x3787('0x7c'),'attributes':['id','name','color'],'where':_0x2e894a['query'][_0x3787('0x7d')]?{'id':_0x2e894a[_0x3787('0x48')][_0x3787('0x7d')]}:undefined,'required':_0x2e894a['query'][_0x3787('0x7d')]?!![]:![]}];}return db[_0x3787('0x77')][_0x3787('0x57')](_0x2c2b6f);})[_0x3787('0x3a')](function(_0x4e5793){_0x34fdc4['rows']=_0x4e5793;return _0x34fdc4;});}})[_0x3787('0x3a')](respondWithFilteredResult(_0x33eac3,_0x2c2b6f))[_0x3787('0x2e')](handleError(_0x33eac3,null));};exports['addApplications']=function(_0x388dd1,_0x5a2eb2,_0x3d6c8a){return db[_0x3787('0x43')][_0x3787('0x6b')]({'where':{'id':_0x388dd1[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x5a2eb2,null))['then'](function(_0x5e25ba){if(_0x5e25ba){return db[_0x3787('0x7e')][_0x3787('0x7f')](function(_0xd740ab){return db[_0x3787('0x80')][_0x3787('0x3b')]({'where':{'FaxAccountId':_0x388dd1['params']['id']},'transaction':_0xd740ab})[_0x3787('0x3a')](function(_0x282d73){var _0x2bfd04=_[_0x3787('0x51')](_0x388dd1[_0x3787('0x5d')],function(_0x31bfbb){_0x31bfbb['FaxAccountId']=_0x388dd1[_0x3787('0x59')]['id'];return _0x31bfbb;});return db[_0x3787('0x80')][_0x3787('0x81')](_0x2bfd04,{'transaction':_0xd740ab});});})[_0x3787('0x3a')](function(){return db[_0x3787('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x388dd1['params']['id']},'order':_0x3787('0x82')});});}})[_0x3787('0x3a')](respondWithResult(_0x5a2eb2,null))[_0x3787('0x2e')](handleError(_0x5a2eb2,null));};exports[_0x3787('0x83')]=function(_0x500083,_0x260b3e,_0x5cdb42){var _0x140f36={};var _0x2837cb={};var _0x1c0628;var _0x6ec216;return db['FaxAccount'][_0x3787('0x6b')]({'where':{'id':_0x500083['params']['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x260b3e,null))[_0x3787('0x3a')](function(_0x5a9955){if(_0x5a9955){_0x1c0628=_0x5a9955;_0x2837cb[_0x3787('0x45')]=_[_0x3787('0x46')](db[_0x3787('0x80')][_0x3787('0x44')]);_0x2837cb[_0x3787('0x48')]=_[_0x3787('0x46')](_0x500083['query']);_0x2837cb[_0x3787('0x47')]=_[_0x3787('0x49')](_0x2837cb['model'],_0x2837cb[_0x3787('0x48')]);_0x140f36['attributes']=_[_0x3787('0x49')](_0x2837cb['model'],qs[_0x3787('0x4a')](_0x500083[_0x3787('0x48')]['fields']));_0x140f36['attributes']=_0x140f36['attributes']['length']?_0x140f36[_0x3787('0x4b')]:_0x2837cb['model'];_0x140f36[_0x3787('0x4d')]=qs[_0x3787('0x4e')](_0x500083[_0x3787('0x48')][_0x3787('0x4e')]);_0x140f36[_0x3787('0x4f')]=qs['filters'](_[_0x3787('0x6d')](_0x500083[_0x3787('0x48')],_0x2837cb[_0x3787('0x47')]));if(_0x500083['query'][_0x3787('0x6e')]){_0x140f36['where']=_[_0x3787('0x50')](_0x140f36[_0x3787('0x4f')],{'$or':_[_0x3787('0x51')](_0x140f36[_0x3787('0x4b')],function(_0x3f04e9){var _0x332faf={};_0x332faf[_0x3f04e9]={'$like':'%'+_0x500083[_0x3787('0x48')][_0x3787('0x6e')]+'%'};return _0x332faf;})});}_0x140f36=_[_0x3787('0x50')]({},_0x140f36,_0x500083[_0x3787('0x54')]);return _0x1c0628['getApplications'](_0x140f36);}})[_0x3787('0x3a')](function(_0x2e2a4d){if(_0x2e2a4d){_0x6ec216=_0x2e2a4d[_0x3787('0x5a')];if(!_0x500083[_0x3787('0x48')][_0x3787('0x73')](_0x3787('0x4c'))){_0x140f36[_0x3787('0x33')]=qs[_0x3787('0x33')](_0x500083['query'][_0x3787('0x33')]);_0x140f36[_0x3787('0x32')]=qs[_0x3787('0x32')](_0x500083['query'][_0x3787('0x32')]);}return _0x1c0628[_0x3787('0x83')](_0x140f36);}})['then'](function(_0x44e1a2){if(_0x44e1a2){return _0x44e1a2?{'count':_0x6ec216,'rows':_0x44e1a2}:null;}})['then'](respondWithResult(_0x260b3e,null))[_0x3787('0x2e')](handleError(_0x260b3e,null));};function Extension(_0x46d376,_0x1a7d37,_0x4724cc,_0x378f47){this[_0x3787('0x84')]=_0x3787('0x85');this[_0x3787('0x86')]=_0x46d376[_0x3787('0x87')];this[_0x3787('0x88')]=_0x378f47;this[_0x3787('0x52')]='system';this[_0x3787('0x89')]=_0x3787('0x8a');this[_0x3787('0x69')]=_0x46d376['id'];this[_0x3787('0x82')]=_0x1a7d37;this['appdata']=_0x4724cc;}function createExtensionsReciveFax(_0x2ed114){var _0x552af0=0x1;var _0x126e61=[];_0x126e61[_0x3787('0x8b')](new Extension(_0x2ed114,_0x552af0,'','Answer'));_0x552af0+=0x1;_0x126e61[_0x3787('0x8b')](new Extension(_0x2ed114,_0x552af0,'CDR(type)=inbound-fax','Set'));_0x552af0+=0x1;for(var _0x5bdc24 in _0x2ed114){if(_0x2ed114[_0x3787('0x73')](_0x5bdc24)&&(_0x5bdc24===_0x3787('0x8c')||_0x5bdc24===_0x3787('0x87')||_0x5bdc24==='gateway'||_0x5bdc24==='faxdetect'||_0x5bdc24===_0x3787('0x8d')||_0x5bdc24===_0x3787('0x8e')||_0x5bdc24==='minrate'||_0x5bdc24===_0x3787('0x8f')||_0x5bdc24===_0x3787('0x90'))){_0x126e61['push'](new Extension(_0x2ed114,_0x552af0,_0x3787('0x91')+_0x5bdc24+')='+_0x2ed114[_0x5bdc24],_0x3787('0x92')));_0x552af0+=0x1;}}_0x126e61[_0x3787('0x8b')](new Extension(_0x2ed114,_0x552af0,'6','Wait'));_0x552af0+=0x1;_0x126e61['push'](new Extension(_0x2ed114,_0x552af0,_0x3787('0x93'),_0x3787('0x94')));_0x552af0=0x0;return _0x126e61;}exports['addAccountApplications']=function(_0x320b5e,_0x18fc9d,_0x5cf45d){var _0x3543b1;return db['sequelize'][_0x3787('0x7f')](function(_0x714068){return db[_0x3787('0x43')][_0x3787('0x5c')](_0x320b5e[_0x3787('0x5d')],{'transaction':_0x714068})[_0x3787('0x3a')](function(_0x2b076d){_0x3543b1=_0x2b076d[_0x3787('0x61')]({'plain':!![]});return db[_0x3787('0x95')][_0x3787('0x81')](createExtensionsReciveFax(_0x3543b1),{'transaction':_0x714068});});})[_0x3787('0x3a')](function(){return _0x3543b1;})['then'](respondWithResult(_0x18fc9d,null))['catch'](handleError(_0x18fc9d,null));};exports[_0x3787('0x96')]=function(_0x26c2d3,_0x4ebf47,_0x206667){var _0xff1cef;return db[_0x3787('0x7e')][_0x3787('0x7f')](function(_0x25cc93){return db[_0x3787('0x43')][_0x3787('0x39')](_0x26c2d3[_0x3787('0x5d')],{'where':{'id':_0x26c2d3[_0x3787('0x5d')]['id']},'transaction':_0x25cc93})[_0x3787('0x3a')](function(_0x3dbd1c){return db['VoiceExtension'][_0x3787('0x3b')]({'where':{'FaxAccountId':_0x26c2d3['body']['id']},'transaction':_0x25cc93})[_0x3787('0x3a')](function(_0x3ac7){return db[_0x3787('0x95')][_0x3787('0x81')](createExtensionsReciveFax(_[_0x3787('0x97')](_0x26c2d3[_0x3787('0x5d')],[_0x3787('0x98'),_0x3787('0x99'),_0x3787('0x9a'),'updatedAt',_0x3787('0x9b'),_0x3787('0x9c')])),{'transaction':_0x25cc93});});});})[_0x3787('0x3a')](function(){return db[_0x3787('0x43')][_0x3787('0x9d')](_0x26c2d3[_0x3787('0x5d')]['id']);})[_0x3787('0x3a')](respondWithResult(_0x4ebf47,null))[_0x3787('0x2e')](handleError(_0x4ebf47,null));};exports[_0x3787('0x9e')]=function(_0x1d63ce,_0xace61b,_0x22e475){var _0x15c662={'raw':!![],'where':{}};var _0x1fa950={};var _0x193562={'count':0x0,'rows':[]};return db[_0x3787('0x43')]['findOne']({'where':{'id':_0x1d63ce[_0x3787('0x59')]['id']}})['then'](handleEntityNotFound(_0xace61b,null))[_0x3787('0x3a')](function(_0x11d706){if(_0x11d706){_0x1fa950['model']=_['keys'](db[_0x3787('0x9f')][_0x3787('0x44')]);_0x1fa950[_0x3787('0x48')]=_['keys'](_0x1d63ce[_0x3787('0x48')]);_0x1fa950[_0x3787('0x47')]=_['intersection'](_0x1fa950[_0x3787('0x45')],_0x1fa950[_0x3787('0x48')]);_0x15c662[_0x3787('0x4b')]=_['intersection'](_0x1fa950['model'],qs[_0x3787('0x4a')](_0x1d63ce[_0x3787('0x48')][_0x3787('0x4a')]));_0x15c662[_0x3787('0x4b')]=_0x15c662[_0x3787('0x4b')][_0x3787('0x5a')]?_0x15c662[_0x3787('0x4b')]:_0x1fa950[_0x3787('0x45')];if(!_0x1d63ce[_0x3787('0x48')][_0x3787('0x73')](_0x3787('0x4c'))){_0x15c662['limit']=qs[_0x3787('0x33')](_0x1d63ce['query'][_0x3787('0x33')]);_0x15c662[_0x3787('0x32')]=qs['offset'](_0x1d63ce[_0x3787('0x48')][_0x3787('0x32')]);}_0x15c662['order']=qs[_0x3787('0x4e')](_0x1d63ce[_0x3787('0x48')][_0x3787('0x4e')]);_0x15c662[_0x3787('0x4f')]=qs['filters'](_['pick'](_0x1d63ce['query'],_0x1fa950[_0x3787('0x47')]));_0x15c662[_0x3787('0x4f')][_0x3787('0x69')]=_0x11d706['id'];if(_0x1d63ce[_0x3787('0x48')][_0x3787('0x6e')]){_0x15c662['where']=_[_0x3787('0x50')](_0x15c662['where'],{'$or':_[_0x3787('0x51')](_0x15c662[_0x3787('0x4b')],function(_0x2c7910){var _0x234d7b={};_0x234d7b[_0x2c7910]={'$like':'%'+_0x1d63ce['query'][_0x3787('0x6e')]+'%'};return _0x234d7b;})});}if(_0x1d63ce[_0x3787('0x48')][_0x3787('0xa0')]){var _0x131088=_0x1d63ce[_0x3787('0x48')]['$gte'][_0x3787('0xa1')](',');var _0x20847a={};_0x20847a[_0x131088[0x0]]={'$gte':moment(_0x131088[0x1])[_0x3787('0xa2')](_0x3787('0xa3'))};_0x15c662['where']=_['merge'](_0x15c662[_0x3787('0x4f')],_0x20847a);}_0x15c662=_[_0x3787('0x50')]({},_0x15c662,_0x1d63ce[_0x3787('0x54')]);return db['FaxMessage']['count']({'where':_0x15c662[_0x3787('0x4f')]})[_0x3787('0x3a')](function(_0xf3ea4d){_0x193562[_0x3787('0x55')]=_0xf3ea4d;if(_0x1d63ce[_0x3787('0x48')][_0x3787('0x56')]){_0x15c662[_0x3787('0x5b')]=[{'all':!![]}];}return db[_0x3787('0x9f')]['findAll'](_0x15c662);})['then'](function(_0x379f38){_0x193562[_0x3787('0x74')]=_0x379f38;return _0x193562;});}})[_0x3787('0x3a')](respondWithFilteredResult(_0xace61b,_0x15c662))[_0x3787('0x2e')](handleError(_0xace61b,null));};exports['send']=function(_0x2d830c,_0x44d2fe,_0x49363a){var _0x1c6879,_0x2fc712={},_0x149323;if(_0x2d830c['body']['to']){_0x149323=_0x2d830c[_0x3787('0x5d')]['to'][0x0];}return db[_0x3787('0x43')][_0x3787('0x66')]({'where':{'id':_0x2d830c[_0x3787('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x3787('0xa4'),'include':[{'model':db['CmContact'],'as':_0x3787('0xa5'),'where':{'fax':_0x149323},'limit':0x1,'order':[['updatedAt',_0x3787('0xa6')]]}]}]})[_0x3787('0x3a')](handleEntityNotFound(_0x44d2fe,null))[_0x3787('0x3a')](function(_0x586d01){_0x1c6879=_0x586d01;if(_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')]&&_0x2d830c[_0x3787('0x5d')]['attachments']['length']){for(var _0x245508=0x0;_0x245508<_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')]['length'];_0x245508+=0x1){_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')][_0x245508]={'filename':_0x2d830c['body']['attachments'][_0x245508]['name'],'id':_0x2d830c[_0x3787('0x5d')]['attachments'][_0x245508]['id'],'path':path[_0x3787('0xa8')](config[_0x3787('0xa9')],_0x3787('0xaa'),_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')][_0x245508][_0x3787('0xab')])};}}return respondWithRpcPromise('CheckAfterSend',_0x3787('0xac'),{'FaxAccountId':_[_0x3787('0xad')](_0x2d830c[_0x3787('0x59')]['id'])?undefined:_0x2d830c['params']['id'],'path':_['isNil'](_0x2d830c['body']['attachments'][0x0]['path'])?undefined:_0x2d830c['body']['attachments'][0x0][_0x3787('0x9')],'fax':_[_0x3787('0xad')](_0x2d830c[_0x3787('0x5d')]['to'][0x0])?undefined:_0x2d830c[_0x3787('0x5d')]['to'][0x0]},client9002);})[_0x3787('0x3a')](function(){if(_0x1c6879){if(_[_0x3787('0xad')](_0x2d830c[_0x3787('0x5d')][_0x3787('0xae')])){_0x2d830c[_0x3787('0x5d')][_0x3787('0xae')]=util[_0x3787('0xa2')](_0x3787('0xaf'),_0x1c6879[_0x3787('0x3f')],_0x1c6879['fax']);}if(_0x1c6879[_0x3787('0xa4')]){if(_0x1c6879[_0x3787('0xa4')][_0x3787('0xa5')][_0x3787('0x5a')]){return _0x1c6879[_0x3787('0xa4')]['Contacts'][0x0];}else{return db[_0x3787('0xb0')][_0x3787('0x5c')](_[_0x3787('0x1b')](_0x2d830c['body'],{'firstName':_0x2d830c[_0x3787('0x5d')]['to'][0x0],'phone':_0x2d830c[_0x3787('0x5d')]['to'][0x0],'fax':_0x2d830c[_0x3787('0x5d')]['to'][0x0],'ListId':_0x1c6879[_0x3787('0x9c')]}));}}else{throw new Error(_0x3787('0xb1'));}}else{throw new Error(_0x3787('0xb2'));}})[_0x3787('0x3a')](function(_0x115e73){if(_0x115e73){return db[_0x3787('0x77')][_0x3787('0x66')]({'where':{'ContactId':_0x115e73['id'],'closed':![],'FaxAccountId':_0x1c6879['id']}})[_0x3787('0x3a')](function(_0x17b00e){if(_0x17b00e){return[_0x17b00e,![]];}return db[_0x3787('0x77')]['create']({'UserId':_0x2d830c['user']['id'],'ContactId':_0x115e73['id'],'FaxAccountId':_0x1c6879['id'],'fax':_0x2d830c[_0x3787('0x5d')]['to'][0x0],'firstMsgDirection':_0x3787('0xb3'),'Messages':[_[_0x3787('0x50')](_0x2d830c['body'],{'read':![],'body':_0x2d830c['body'][_0x3787('0xa7')][0x0]['filename'],'FaxAccountId':_0x1c6879['id'],'UserId':_0x2d830c[_0x3787('0x5e')]['id'],'ContactId':_0x115e73['id'],'AttachmentId':_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')][0x0]['id']})]},{'include':[{'model':db[_0x3787('0x9f')],'as':_0x3787('0xb4')}]})[_0x3787('0x3a')](function(_0x4831ca){return[_0x4831ca,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3787('0xb5')](function(_0x58fd82,_0x34ab37){if(_0x34ab37){return _0x58fd82;}return db['FaxMessage'][_0x3787('0x5c')]({'direction':'out','read':![],'body':_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')][0x0][_0x3787('0xb6')],'FaxAccountId':_0x1c6879['id'],'FaxInteractionId':_0x58fd82['id'],'UserId':_0x2d830c[_0x3787('0x5e')]['id'],'ContactId':_0x58fd82[_0x3787('0xb7')],'AttachmentId':_0x2d830c['body'][_0x3787('0xa7')][0x0]['id']})['then'](function(_0x480b3c){_0x58fd82[_0x3787('0xb8')][_0x3787('0xb4')]=[];_0x58fd82[_0x3787('0xb8')]['Messages']['push'](_0x480b3c['dataValues']);return _0x58fd82;});})[_0x3787('0x3a')](function(_0x334dfa){respondWithRpcPromise(_0x3787('0xb9'),'SendFax',{'FaxAccountId':_[_0x3787('0xad')](_0x2d830c['params']['id'])?undefined:_0x2d830c[_0x3787('0x59')]['id'],'path':_[_0x3787('0xad')](_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')][0x0][_0x3787('0x9')])?undefined:_0x2d830c[_0x3787('0x5d')]['attachments'][0x0][_0x3787('0x9')],'fax':_[_0x3787('0xad')](_0x2d830c[_0x3787('0x5d')]['to'][0x0])?undefined:_0x2d830c[_0x3787('0x5d')]['to'][0x0],'AttachmentId':_0x2d830c[_0x3787('0x5d')][_0x3787('0xa7')][0x0]['id']},client9002)[_0x3787('0x3a')](function(_0x140940){logger['info'](_0x3787('0xba'),_0x140940);})[_0x3787('0x2e')](function(_0x3368a6){logger[_0x3787('0x25')](_0x3787('0xba'),_0x3368a6);});return _0x334dfa;})[_0x3787('0x3a')](respondWithResult(_0x44d2fe,null))[_0x3787('0x2e')](handleError(_0x44d2fe,null));};exports['addAgents']=function(_0x4d323b,_0x536963,_0x5127d2){return db[_0x3787('0x43')][_0x3787('0x66')]({'where':{'id':_0x4d323b[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x536963,null))['then'](function(_0x1399e2){if(_0x1399e2){return _0x1399e2[_0x3787('0xbb')](_0x4d323b[_0x3787('0x5d')][_0x3787('0x70')],_[_0x3787('0x97')](_0x4d323b[_0x3787('0x5d')],[_0x3787('0x70'),'id'])||{})['spread'](function(_0x12a6c3){for(var _0x9d9116=0x0;_0x9d9116<_0x4d323b[_0x3787('0x5d')][_0x3787('0x70')][_0x3787('0x5a')];_0x9d9116+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x4d323b['body'][_0x3787('0x70')][_0x9d9116],'FaxAccountId':_0x4d323b[_0x3787('0x59')]['id']});}return _0x12a6c3;});}})[_0x3787('0x3a')](respondWithResult(_0x536963,null))['catch'](handleError(_0x536963,null));};exports[_0x3787('0xbc')]=function(_0x25f5e8,_0x236f2e,_0x53ecd2){return db[_0x3787('0x43')]['find']({'where':{'id':_0x25f5e8[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x236f2e,null))[_0x3787('0x3a')](function(_0x4107f0){if(_0x4107f0){return _0x4107f0[_0x3787('0xbc')](_0x25f5e8[_0x3787('0x48')][_0x3787('0x70')])['then'](function(){if(_[_0x3787('0xbd')](_0x25f5e8[_0x3787('0x48')][_0x3787('0x70')])){for(var _0x54da85=0x0;_0x54da85<_0x25f5e8[_0x3787('0x48')][_0x3787('0x70')][_0x3787('0x5a')];_0x54da85+=0x1){socket[_0x3787('0xbe')](_0x3787('0xbf'),{'UserId':Number(_0x25f5e8[_0x3787('0x48')]['ids'][_0x54da85]),'FaxAccountId':Number(_0x25f5e8[_0x3787('0x59')]['id'])});}}else{socket['emit'](_0x3787('0xbf'),{'UserId':Number(_0x25f5e8['query'][_0x3787('0x70')]),'FaxAccountId':Number(_0x25f5e8[_0x3787('0x59')]['id'])});}});}})[_0x3787('0x3a')](respondWithStatusCode(_0x236f2e,null))['catch'](handleError(_0x236f2e,null));};exports[_0x3787('0xc0')]=function(_0x3b994c,_0x20152f,_0x462f22){var _0x1c7597={};var _0x24e43b={};var _0x566fd0;var _0x555abf;return db[_0x3787('0x43')][_0x3787('0x6b')]({'where':{'id':_0x3b994c[_0x3787('0x59')]['id']}})[_0x3787('0x3a')](handleEntityNotFound(_0x20152f,null))[_0x3787('0x3a')](function(_0x1e37e5){if(_0x1e37e5){_0x566fd0=_0x1e37e5;_0x24e43b[_0x3787('0x45')]=_[_0x3787('0x46')](db[_0x3787('0x7a')][_0x3787('0x44')]);_0x24e43b[_0x3787('0x48')]=_[_0x3787('0x46')](_0x3b994c['query']);_0x24e43b['filters']=_[_0x3787('0x49')](_0x24e43b[_0x3787('0x45')],_0x24e43b[_0x3787('0x48')]);_0x1c7597[_0x3787('0x4b')]=_[_0x3787('0x49')](_0x24e43b['model'],qs[_0x3787('0x4a')](_0x3b994c[_0x3787('0x48')][_0x3787('0x4a')]));_0x1c7597[_0x3787('0x4b')]=_0x1c7597[_0x3787('0x4b')]['length']?_0x1c7597[_0x3787('0x4b')]:_0x24e43b['model'];_0x1c7597['order']=qs['sort'](_0x3b994c['query'][_0x3787('0x4e')]);_0x1c7597[_0x3787('0x4f')]=qs[_0x3787('0x47')](_[_0x3787('0x6d')](_0x3b994c[_0x3787('0x48')],_0x24e43b[_0x3787('0x47')]));if(_0x3b994c[_0x3787('0x48')][_0x3787('0x6e')]){_0x1c7597[_0x3787('0x4f')]=_[_0x3787('0x50')](_0x1c7597[_0x3787('0x4f')],{'$or':_[_0x3787('0x51')](_0x1c7597[_0x3787('0x4b')],function(_0x19a056){var _0x36e205={};_0x36e205[_0x19a056]={'$like':'%'+_0x3b994c[_0x3787('0x48')][_0x3787('0x6e')]+'%'};return _0x36e205;})});}_0x1c7597=_[_0x3787('0x50')]({},_0x1c7597,_0x3b994c[_0x3787('0x54')]);return _0x566fd0['getAgents'](_0x1c7597);}})['then'](function(_0x4e171c){if(_0x4e171c){_0x555abf=_0x4e171c[_0x3787('0x5a')];if(!_0x3b994c['query']['hasOwnProperty']('nolimit')){_0x1c7597[_0x3787('0x33')]=qs['limit'](_0x3b994c[_0x3787('0x48')][_0x3787('0x33')]);_0x1c7597['offset']=qs[_0x3787('0x32')](_0x3b994c['query'][_0x3787('0x32')]);}return _0x566fd0['getAgents'](_0x1c7597);}})[_0x3787('0x3a')](function(_0x133864){if(_0x133864){return _0x133864?{'count':_0x555abf,'rows':_0x133864}:null;}})[_0x3787('0x3a')](respondWithResult(_0x20152f,null))[_0x3787('0x2e')](handleError(_0x20152f,null));}; \ No newline at end of file +var _0xed69=['mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','then','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','FaxAccount','include','findAll','rows','show','keys','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','findOne','hasOwnProperty','Disposition','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','app','Fax\x20Extension','priority','Answer','Set','ecm','gateway','headerinfo','maxrate','t38timeout','push','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','tech','createdAt','updatedAt','TrunkId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xed69,0x179));var _0x9ed6=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0xed69[_0x1559a5];return _0x17a783;};'use strict';var pdf=require(_0x9ed6('0x0'));var emlformat=require(_0x9ed6('0x1'));var rimraf=require(_0x9ed6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ed6('0x3'));var rp=require(_0x9ed6('0x4'));var moment=require(_0x9ed6('0x5'));var BPromise=require(_0x9ed6('0x6'));var Mustache=require(_0x9ed6('0x7'));var util=require(_0x9ed6('0x8'));var path=require(_0x9ed6('0x9'));var sox=require(_0x9ed6('0xa'));var csv=require('to-csv');var ejs=require(_0x9ed6('0xb'));var fs=require('fs');var _=require(_0x9ed6('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9ed6('0xd'));var deskjs=require(_0x9ed6('0xe'));var toCsv=require(_0x9ed6('0xf'));var querystring=require(_0x9ed6('0x10'));var Papa=require(_0x9ed6('0x11'));var Redis=require('ioredis');var authService=require(_0x9ed6('0x12'));var qs=require(_0x9ed6('0x13'));var hardwareService=require(_0x9ed6('0x14'));var logger=require(_0x9ed6('0x15'))(_0x9ed6('0x16'));var utils=require(_0x9ed6('0x17'));var config=require(_0x9ed6('0x18'));var db=require(_0x9ed6('0x19'))['db'];config[_0x9ed6('0x1a')]=_[_0x9ed6('0x1b')](config['redis'],{'host':_0x9ed6('0x1c'),'port':0x18eb});var socket=require(_0x9ed6('0x1d'))(new Redis(config[_0x9ed6('0x1a')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x9ed6('0x1e'));var client=jayson['client'][_0x9ed6('0x1f')]({'port':0x232c});var client9002=jayson[_0x9ed6('0x20')][_0x9ed6('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x2d37c7,_0x4bf333,_0x37ab2){if(_0x37ab2){var _0x2e77bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e77bc[_0x9ed6('0x21')](_0x4bf333)){return _0x2d37c7;}else{throw new Error(_0x9ed6('0x22'));}}else{return _0x2d37c7;}}function respondWithRpcPromise(_0x226327,_0x5a922c,_0x431a86,_0x58fe45){return new BPromise(function(_0x54e87d,_0x593bf9){var _0x5b3b23=_0x58fe45||client;return _0x5b3b23[_0x9ed6('0x23')](_0x226327,_0x431a86)['then'](function(_0x42279f){logger[_0x9ed6('0x24')](_0x9ed6('0x25'),_0x5a922c,_0x9ed6('0x26'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5a922c,_0x9ed6('0x26'),JSON[_0x9ed6('0x27')](_0x42279f));if(_0x42279f['error']){if(_0x42279f[_0x9ed6('0x28')]['code']===0x1f4){logger['error'](_0x9ed6('0x25'),_0x5a922c,_0x42279f['error'][_0x9ed6('0x29')]);return _0x593bf9(_0x42279f[_0x9ed6('0x28')][_0x9ed6('0x29')]);}logger[_0x9ed6('0x28')](_0x9ed6('0x25'),_0x5a922c,_0x42279f[_0x9ed6('0x28')]['message']);return _0x54e87d(_0x42279f['error']['message']);}else{logger[_0x9ed6('0x24')](_0x9ed6('0x25'),_0x5a922c,'request\x20sent');_0x54e87d(_0x42279f[_0x9ed6('0x2a')][_0x9ed6('0x29')]);}})[_0x9ed6('0x2b')](function(_0x578515){logger[_0x9ed6('0x28')](_0x9ed6('0x25'),_0x5a922c,_0x578515);_0x593bf9(_0x578515);});});}function respondWithStatusCode(_0x178e1d,_0x51fbcb){_0x51fbcb=_0x51fbcb||0xcc;return function(_0x2af353){if(_0x2af353){return _0x178e1d[_0x9ed6('0x2c')](_0x51fbcb);}return _0x178e1d[_0x9ed6('0x2d')](_0x51fbcb)[_0x9ed6('0x2e')]();};}function respondWithResult(_0x29ee48,_0x1dc291){_0x1dc291=_0x1dc291||0xc8;return function(_0x13f225){if(_0x13f225){return _0x29ee48['status'](_0x1dc291)[_0x9ed6('0x2f')](_0x13f225);}};}function respondWithFilteredResult(_0x343cbe,_0x55a4a1){return function(_0x196b25){if(_0x196b25){var _0x55e640=_0x196b25[_0x9ed6('0x30')],_0x8a9e69=_0x55a4a1[_0x9ed6('0x31')],_0x3cc8c6=_0x55a4a1[_0x9ed6('0x31')]+_0x55a4a1[_0x9ed6('0x32')],_0x2a0923;if(_0x3cc8c6>=_0x55e640){_0x3cc8c6=_0x55e640;_0x2a0923=0xc8;}else{_0x2a0923=0xce;}_0x343cbe[_0x9ed6('0x2d')](_0x2a0923);return _0x343cbe['set']('Content-Range',_0x8a9e69+'-'+_0x3cc8c6+'/'+_0x55e640)[_0x9ed6('0x2f')](_0x196b25);}return null;};}function patchUpdates(_0xe41200){return function(_0x5d53cb){try{jsonpatch['apply'](_0x5d53cb,_0xe41200,!![]);}catch(_0x1ab27c){return BPromise[_0x9ed6('0x33')](_0x1ab27c);}return _0x5d53cb[_0x9ed6('0x34')]();};}function saveUpdates(_0x53e612,_0xaffdf2){return function(_0x1b3b3e){if(_0x1b3b3e){return _0x1b3b3e[_0x9ed6('0x35')](_0x53e612)['then'](function(_0x2338e5){return _0x2338e5;});}return null;};}function removeEntity(_0x364199,_0x36f35b){return function(_0x6b216){if(_0x6b216){return _0x6b216[_0x9ed6('0x36')]()['then'](function(){var _0x272788=_0x6b216[_0x9ed6('0x37')]({'plain':!![]});var _0x11c8d0=_0x9ed6('0x38');return db[_0x9ed6('0x39')]['destroy']({'where':{'type':_0x11c8d0,'resourceId':_0x272788['id']}})[_0x9ed6('0x3a')](function(){return _0x6b216;});})[_0x9ed6('0x3a')](function(){_0x364199['status'](0xcc)[_0x9ed6('0x2e')]();});}};}function handleEntityNotFound(_0x204516,_0x5df5d4){return function(_0x4bd2e9){if(!_0x4bd2e9){_0x204516[_0x9ed6('0x2c')](0x194);}return _0x4bd2e9;};}function handleError(_0x17e2a5,_0x6cd0d3){_0x6cd0d3=_0x6cd0d3||0x1f4;return function(_0x5444ac){logger[_0x9ed6('0x28')](_0x5444ac[_0x9ed6('0x3b')]);if(_0x5444ac['name']){delete _0x5444ac[_0x9ed6('0x3c')];}_0x17e2a5[_0x9ed6('0x2d')](_0x6cd0d3)[_0x9ed6('0x3d')](_0x5444ac);};}exports[_0x9ed6('0x3e')]=function(_0x1e54d2,_0x9e010a){var _0x1f2e4c={'include':[{'model':db[_0x9ed6('0x3f')],'as':_0x9ed6('0x40')}]},_0x51c2d9={},_0x28acf3={'count':0x0,'rows':[]};var _0x511a07=db['FaxAccount'][_0x9ed6('0x41')];_0x51c2d9[_0x9ed6('0x42')]=_['keys'](_0x511a07);_0x51c2d9[_0x9ed6('0x43')]=_['keys'](_0x1e54d2[_0x9ed6('0x43')]);_0x51c2d9[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x51c2d9['model'],_0x51c2d9[_0x9ed6('0x43')]);_0x1f2e4c['attributes']=_[_0x9ed6('0x45')](_0x51c2d9[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x1e54d2[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0x1f2e4c[_0x9ed6('0x47')]=_0x1f2e4c[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x1f2e4c[_0x9ed6('0x47')]:_0x51c2d9[_0x9ed6('0x42')];if(!_0x1e54d2['query']['hasOwnProperty'](_0x9ed6('0x49'))){_0x1f2e4c[_0x9ed6('0x32')]=qs[_0x9ed6('0x32')](_0x1e54d2[_0x9ed6('0x43')][_0x9ed6('0x32')]);_0x1f2e4c[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x1e54d2['query'][_0x9ed6('0x31')]);}_0x1f2e4c[_0x9ed6('0x4a')]=qs[_0x9ed6('0x4b')](_0x1e54d2['query']['sort']);_0x1f2e4c[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x1e54d2[_0x9ed6('0x43')],_0x51c2d9['filters']));if(_0x1e54d2[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0x1f2e4c[_0x9ed6('0x4c')]=_[_0x9ed6('0x4f')](_0x1f2e4c[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x511a07,function(_0x2872c2){if(_0x2872c2[_0x9ed6('0x51')][_0x9ed6('0x52')]!==_0x9ed6('0x53')){var _0xf7502a={};_0xf7502a[_0x2872c2['field']]={'$like':'%'+_0x1e54d2['query']['filter']+'%'};return _0xf7502a;}})});}_0x1f2e4c=_[_0x9ed6('0x4f')]({},_0x1f2e4c,_0x1e54d2['options']);var _0x36861b={'where':_0x1f2e4c['where']};return db[_0x9ed6('0x54')]['count'](_0x36861b)[_0x9ed6('0x3a')](function(_0x46b415){_0x28acf3[_0x9ed6('0x30')]=_0x46b415;if(_0x1e54d2[_0x9ed6('0x43')]['includeAll']){_0x1f2e4c[_0x9ed6('0x55')]=[{'all':!![]}];}return db['FaxAccount'][_0x9ed6('0x56')](_0x1f2e4c);})[_0x9ed6('0x3a')](function(_0x50f625){_0x28acf3[_0x9ed6('0x57')]=_0x50f625;return _0x28acf3;})['then'](respondWithFilteredResult(_0x9e010a,_0x1f2e4c))[_0x9ed6('0x2b')](handleError(_0x9e010a,null));};exports[_0x9ed6('0x58')]=function(_0x59ec81,_0x17bb96){var _0x177358={'raw':![],'where':{'id':_0x59ec81['params']['id']},'include':[{'model':db[_0x9ed6('0x3f')],'as':'mandatoryDispositionPause'}]},_0x3af57d={};_0x3af57d[_0x9ed6('0x42')]=_['keys'](db[_0x9ed6('0x54')][_0x9ed6('0x41')]);_0x3af57d['query']=_[_0x9ed6('0x59')](_0x59ec81[_0x9ed6('0x43')]);_0x3af57d[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x3af57d[_0x9ed6('0x42')],_0x3af57d[_0x9ed6('0x43')]);_0x177358[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x3af57d['model'],qs[_0x9ed6('0x46')](_0x59ec81['query'][_0x9ed6('0x46')]));_0x177358[_0x9ed6('0x47')]=_0x177358[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x177358[_0x9ed6('0x47')]:_0x3af57d[_0x9ed6('0x42')];if(_0x59ec81['query'][_0x9ed6('0x5a')]){_0x177358[_0x9ed6('0x55')]=[{'all':!![]}];}_0x177358=_[_0x9ed6('0x4f')]({},_0x177358,_0x59ec81[_0x9ed6('0x5b')]);return db[_0x9ed6('0x54')]['find'](_0x177358)[_0x9ed6('0x3a')](handleEntityNotFound(_0x17bb96,null))[_0x9ed6('0x3a')](respondWithResult(_0x17bb96,null))[_0x9ed6('0x2b')](handleError(_0x17bb96,null));};exports[_0x9ed6('0x5c')]=function(_0x57f0f9,_0x4df873){return db[_0x9ed6('0x54')][_0x9ed6('0x5c')](_0x57f0f9[_0x9ed6('0x5d')],{})[_0x9ed6('0x3a')](function(_0xfe5dba){var _0x1d0a55=_0x57f0f9[_0x9ed6('0x5e')]['get']({'plain':!![]});if(!_0x1d0a55)throw new Error(_0x9ed6('0x5f'));if(_0x1d0a55[_0x9ed6('0x60')]==='user'){var _0x32b377=_0xfe5dba[_0x9ed6('0x37')]({'plain':!![]});var _0x19abc9=_0x9ed6('0x38');return db[_0x9ed6('0x61')][_0x9ed6('0x62')]({'where':{'name':_0x19abc9,'userProfileId':_0x1d0a55['userProfileId']},'raw':!![]})[_0x9ed6('0x3a')](function(_0x5141e7){if(_0x5141e7&&_0x5141e7[_0x9ed6('0x63')]===0x0){return db['UserProfileResource'][_0x9ed6('0x5c')]({'name':_0x32b377[_0x9ed6('0x3c')],'resourceId':_0x32b377['id'],'type':_0x5141e7[_0x9ed6('0x3c')],'sectionId':_0x5141e7['id']},{})['then'](function(){return _0xfe5dba;});}else{return _0xfe5dba;}})[_0x9ed6('0x2b')](function(_0x48ec90){logger['error'](_0x9ed6('0x64'),_0x48ec90);throw _0x48ec90;});}return _0xfe5dba;})['then'](respondWithResult(_0x4df873,0xc9))[_0x9ed6('0x2b')](handleError(_0x4df873,null));};exports['update']=function(_0x693762,_0x5a8c26){if(_0x693762[_0x9ed6('0x5d')]['id']){delete _0x693762[_0x9ed6('0x5d')]['id'];}return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x693762[_0x9ed6('0x65')]['id']},'include':[{'model':db['Pause'],'as':_0x9ed6('0x40')}]})[_0x9ed6('0x3a')](handleEntityNotFound(_0x5a8c26,null))[_0x9ed6('0x3a')](saveUpdates(_0x693762[_0x9ed6('0x5d')],null))['then'](respondWithResult(_0x5a8c26,null))[_0x9ed6('0x2b')](handleError(_0x5a8c26,null));};exports['destroy']=function(_0x4a54c7,_0x5ab19f){return db[_0x9ed6('0x54')]['find']({'where':{'id':_0x4a54c7[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x5ab19f,null))['then'](removeEntity(_0x5ab19f,null))[_0x9ed6('0x2b')](handleError(_0x5ab19f,null));};exports['describe']=function(_0x402704,_0x3275fc){return db[_0x9ed6('0x54')][_0x9ed6('0x66')]()[_0x9ed6('0x3a')](respondWithResult(_0x3275fc,null))[_0x9ed6('0x2b')](handleError(_0x3275fc,null));};exports[_0x9ed6('0x67')]=function(_0x138e99,_0x5a96a7,_0x36323c){if(_0x138e99[_0x9ed6('0x5d')]['id']){delete _0x138e99['body']['id'];}return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x138e99[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x5a96a7,null))[_0x9ed6('0x3a')](function(_0x476c60){if(_0x476c60){_0x138e99[_0x9ed6('0x5d')][_0x9ed6('0x68')]=_0x476c60['id'];return db['Disposition'][_0x9ed6('0x5c')](_0x138e99['body']);}})[_0x9ed6('0x3a')](respondWithResult(_0x5a96a7,null))[_0x9ed6('0x2b')](handleError(_0x5a96a7,null));};exports['getDispositions']=function(_0x32fa7b,_0x37b603,_0x5b9ca6){var _0x58c7e6={'raw':![],'where':{}};var _0x85dc33={};var _0x45bc1a={'count':0x0,'rows':[]};return db[_0x9ed6('0x54')][_0x9ed6('0x69')]({'where':{'id':_0x32fa7b[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x37b603,null))[_0x9ed6('0x3a')](function(_0x59a8ba){if(_0x59a8ba){_0x85dc33['model']=_['keys'](db['Disposition'][_0x9ed6('0x41')]);_0x85dc33[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x32fa7b['query']);_0x85dc33['filters']=_[_0x9ed6('0x45')](_0x85dc33[_0x9ed6('0x42')],_0x85dc33['query']);_0x58c7e6[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x85dc33[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0x58c7e6[_0x9ed6('0x47')]=_0x58c7e6['attributes']['length']?_0x58c7e6[_0x9ed6('0x47')]:_0x85dc33[_0x9ed6('0x42')];if(!_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x58c7e6[_0x9ed6('0x32')]=qs['limit'](_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x32')]);_0x58c7e6[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x32fa7b[_0x9ed6('0x43')]['offset']);}_0x58c7e6['order']=qs['sort'](_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x58c7e6[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x32fa7b[_0x9ed6('0x43')],_0x85dc33['filters']));_0x58c7e6[_0x9ed6('0x4c')][_0x9ed6('0x68')]=_0x59a8ba['id'];if(_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0x58c7e6['where']=_['merge'](_0x58c7e6[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x58c7e6[_0x9ed6('0x47')],function(_0x5150bd){var _0x39751a={};_0x39751a[_0x5150bd]={'$like':'%'+_0x32fa7b[_0x9ed6('0x43')]['filter']+'%'};return _0x39751a;})});}_0x58c7e6=_[_0x9ed6('0x4f')]({},_0x58c7e6,_0x32fa7b['options']);return db['Disposition']['count']({'where':_0x58c7e6[_0x9ed6('0x4c')]})['then'](function(_0x28e727){_0x45bc1a[_0x9ed6('0x30')]=_0x28e727;if(_0x32fa7b[_0x9ed6('0x43')][_0x9ed6('0x5a')]){_0x58c7e6[_0x9ed6('0x55')]=[{'all':!![]}];}return db[_0x9ed6('0x6b')][_0x9ed6('0x56')](_0x58c7e6);})['then'](function(_0xa88249){_0x45bc1a[_0x9ed6('0x57')]=_0xa88249;return _0x45bc1a;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x37b603,_0x58c7e6))['catch'](handleError(_0x37b603,null));};exports['removeDispositions']=function(_0x3a1fc4,_0x43a405,_0x3d6015){return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x3a1fc4[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x43a405,null))[_0x9ed6('0x3a')](function(_0x1769df){if(_0x1769df){return _0x1769df['removeDispositions'](_0x3a1fc4[_0x9ed6('0x43')][_0x9ed6('0x6c')]);}})['then'](respondWithStatusCode(_0x43a405,null))[_0x9ed6('0x2b')](handleError(_0x43a405,null));};exports['addAnswer']=function(_0x91a93d,_0x2f549e,_0x22fae9){if(_0x91a93d[_0x9ed6('0x5d')]['id']){delete _0x91a93d[_0x9ed6('0x5d')]['id'];}return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x91a93d[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x2f549e,null))[_0x9ed6('0x3a')](function(_0x524a8e){if(_0x524a8e){_0x91a93d[_0x9ed6('0x5d')][_0x9ed6('0x68')]=_0x524a8e['id'];return db[_0x9ed6('0x6d')]['create'](_0x91a93d[_0x9ed6('0x5d')]);}})[_0x9ed6('0x3a')](respondWithResult(_0x2f549e,null))[_0x9ed6('0x2b')](handleError(_0x2f549e,null));};exports[_0x9ed6('0x6e')]=function(_0x4ab90a,_0x2075e6,_0x4e2dd9){var _0xec726a={'raw':![],'where':{}};var _0x325736={};var _0x319684={'count':0x0,'rows':[]};return db[_0x9ed6('0x54')][_0x9ed6('0x69')]({'where':{'id':_0x4ab90a['params']['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x2075e6,null))[_0x9ed6('0x3a')](function(_0x430a10){if(_0x430a10){_0x325736[_0x9ed6('0x42')]=_[_0x9ed6('0x59')](db[_0x9ed6('0x6d')]['rawAttributes']);_0x325736[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x4ab90a['query']);_0x325736[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x325736[_0x9ed6('0x42')],_0x325736[_0x9ed6('0x43')]);_0xec726a['attributes']=_['intersection'](_0x325736['model'],qs['fields'](_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0xec726a['attributes']=_0xec726a['attributes'][_0x9ed6('0x48')]?_0xec726a['attributes']:_0x325736[_0x9ed6('0x42')];if(!_0x4ab90a[_0x9ed6('0x43')]['hasOwnProperty'](_0x9ed6('0x49'))){_0xec726a[_0x9ed6('0x32')]=qs[_0x9ed6('0x32')](_0x4ab90a[_0x9ed6('0x43')]['limit']);_0xec726a[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x31')]);}_0xec726a['order']=qs[_0x9ed6('0x4b')](_0x4ab90a['query'][_0x9ed6('0x4b')]);_0xec726a[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x4ab90a[_0x9ed6('0x43')],_0x325736['filters']));_0xec726a[_0x9ed6('0x4c')][_0x9ed6('0x68')]=_0x430a10['id'];if(_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0xec726a[_0x9ed6('0x4c')]=_['merge'](_0xec726a[_0x9ed6('0x4c')],{'$or':_['map'](_0xec726a[_0x9ed6('0x47')],function(_0x339bd7){var _0x47d042={};_0x47d042[_0x339bd7]={'$like':'%'+_0x4ab90a[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0x47d042;})});}_0xec726a=_[_0x9ed6('0x4f')]({},_0xec726a,_0x4ab90a[_0x9ed6('0x5b')]);return db[_0x9ed6('0x6d')][_0x9ed6('0x30')]({'where':_0xec726a[_0x9ed6('0x4c')]})[_0x9ed6('0x3a')](function(_0x38977e){_0x319684[_0x9ed6('0x30')]=_0x38977e;if(_0x4ab90a['query'][_0x9ed6('0x5a')]){_0xec726a[_0x9ed6('0x55')]=[{'all':!![]}];}return db['CannedAnswer'][_0x9ed6('0x56')](_0xec726a);})[_0x9ed6('0x3a')](function(_0x394818){_0x319684[_0x9ed6('0x57')]=_0x394818;return _0x319684;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x2075e6,_0xec726a))[_0x9ed6('0x2b')](handleError(_0x2075e6,null));};exports[_0x9ed6('0x6f')]=function(_0xbc91a2,_0xb61222,_0x124b7f){return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0xbc91a2['params']['id']}})['then'](handleEntityNotFound(_0xb61222,null))[_0x9ed6('0x3a')](function(_0x361bfd){if(_0x361bfd){return _0x361bfd[_0x9ed6('0x6f')](_0xbc91a2[_0x9ed6('0x43')][_0x9ed6('0x6c')]);}})['then'](respondWithStatusCode(_0xb61222,null))[_0x9ed6('0x2b')](handleError(_0xb61222,null));};exports[_0x9ed6('0x70')]=function(_0x1cb16b,_0x2f1771,_0x129d56){return db[_0x9ed6('0x71')][_0x9ed6('0x62')]({'where':{'id':_0x1cb16b[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x2f1771,null))[_0x9ed6('0x3a')](function(_0x1de323){if(_0x1de323){return _0x1de323['addInteraction'](_0x1cb16b['body'][_0x9ed6('0x6c')],_[_0x9ed6('0x72')](_0x1cb16b[_0x9ed6('0x5d')],[_0x9ed6('0x6c'),'id'])||{});}})[_0x9ed6('0x3a')](respondWithResult(_0x2f1771,null))[_0x9ed6('0x2b')](handleError(_0x2f1771,null));};exports[_0x9ed6('0x73')]=function(_0x2335d3,_0x2366d1,_0x1fbbd1){var _0x30024f={'raw':![],'where':{}};var _0x3dd017={};var _0x3cd2ec={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x2335d3[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x2366d1,null))[_0x9ed6('0x3a')](function(_0x1b00b9){if(_0x1b00b9){_0x3dd017[_0x9ed6('0x42')]=_[_0x9ed6('0x59')](db[_0x9ed6('0x71')][_0x9ed6('0x41')]);_0x3dd017[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x2335d3['query']);_0x3dd017[_0x9ed6('0x44')]=_['intersection'](_0x3dd017[_0x9ed6('0x42')],_0x3dd017['query']);_0x30024f[_0x9ed6('0x47')]=_['intersection'](_0x3dd017[_0x9ed6('0x42')],qs['fields'](_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x46')]));_0x30024f[_0x9ed6('0x47')]=_0x30024f[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x30024f[_0x9ed6('0x47')]:_0x3dd017['model'];if(!_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x30024f[_0x9ed6('0x32')]=qs[_0x9ed6('0x32')](_0x2335d3[_0x9ed6('0x43')]['limit']);_0x30024f[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x31')]);}_0x30024f['order']=qs[_0x9ed6('0x4b')](_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x30024f['where']=qs[_0x9ed6('0x44')](_[_0x9ed6('0x4d')](_0x2335d3[_0x9ed6('0x43')],_0x3dd017[_0x9ed6('0x44')]));_0x30024f['where'][_0x9ed6('0x68')]=_0x1b00b9['id'];if(_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x4e')]){_0x30024f[_0x9ed6('0x4c')]=_[_0x9ed6('0x4f')](_0x30024f[_0x9ed6('0x4c')],{'$or':_['map'](_0x30024f['attributes'],function(_0x2bea71){var _0xcd9023={};_0xcd9023[_0x2bea71]={'$like':'%'+_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0xcd9023;})});}_0x30024f=_[_0x9ed6('0x4f')]({},_0x30024f,_0x2335d3[_0x9ed6('0x5b')]);return db['FaxInteraction'][_0x9ed6('0x30')]({'where':_0x30024f[_0x9ed6('0x4c')]})[_0x9ed6('0x3a')](function(_0x27f5a5){_0x3cd2ec['count']=_0x27f5a5;if(_0x2335d3[_0x9ed6('0x43')]['includeAll']){_0x30024f['include']=[{'model':db['CmContact'],'as':_0x9ed6('0x74'),'required':![]},{'model':db['User'],'as':_0x9ed6('0x75'),'attributes':[_0x9ed6('0x3c'),_0x9ed6('0x76'),_0x9ed6('0x77')],'required':![]},{'model':db[_0x9ed6('0x78')],'as':_0x9ed6('0x79'),'attributes':['id','name',_0x9ed6('0x7a')],'where':_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x7b')]?{'id':_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x7b')]}:undefined,'required':_0x2335d3[_0x9ed6('0x43')][_0x9ed6('0x7b')]?!![]:![]}];}return db[_0x9ed6('0x71')][_0x9ed6('0x56')](_0x30024f);})[_0x9ed6('0x3a')](function(_0x39af43){_0x3cd2ec[_0x9ed6('0x57')]=_0x39af43;return _0x3cd2ec;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x2366d1,_0x30024f))[_0x9ed6('0x2b')](handleError(_0x2366d1,null));};exports['addApplications']=function(_0x2116f0,_0x290df8,_0x1a87e4){return db[_0x9ed6('0x54')]['findOne']({'where':{'id':_0x2116f0['params']['id']}})['then'](handleEntityNotFound(_0x290df8,null))[_0x9ed6('0x3a')](function(_0x36ad57){if(_0x36ad57){return db[_0x9ed6('0x7c')][_0x9ed6('0x7d')](function(_0x5bdcdf){return db['FaxApplication']['destroy']({'where':{'FaxAccountId':_0x2116f0[_0x9ed6('0x65')]['id']},'transaction':_0x5bdcdf})['then'](function(_0x358d4d){var _0x4700ce=_[_0x9ed6('0x50')](_0x2116f0[_0x9ed6('0x5d')],function(_0x36f14a){_0x36f14a[_0x9ed6('0x68')]=_0x2116f0['params']['id'];return _0x36f14a;});return db[_0x9ed6('0x7e')]['bulkCreate'](_0x4700ce,{'transaction':_0x5bdcdf});});})[_0x9ed6('0x3a')](function(){return db['FaxApplication'][_0x9ed6('0x7f')]({'where':{'FaxAccountId':_0x2116f0[_0x9ed6('0x65')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x290df8,null))[_0x9ed6('0x2b')](handleError(_0x290df8,null));};exports['getApplications']=function(_0x22c164,_0x481841,_0x598600){var _0x1718ea={};var _0x42f170={};var _0x16f0f1;var _0xf82b8b;return db['FaxAccount'][_0x9ed6('0x69')]({'where':{'id':_0x22c164['params']['id']}})['then'](handleEntityNotFound(_0x481841,null))[_0x9ed6('0x3a')](function(_0xc8f68c){if(_0xc8f68c){_0x16f0f1=_0xc8f68c;_0x42f170[_0x9ed6('0x42')]=_[_0x9ed6('0x59')](db[_0x9ed6('0x7e')][_0x9ed6('0x41')]);_0x42f170[_0x9ed6('0x43')]=_[_0x9ed6('0x59')](_0x22c164[_0x9ed6('0x43')]);_0x42f170[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x42f170[_0x9ed6('0x42')],_0x42f170[_0x9ed6('0x43')]);_0x1718ea[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x42f170[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x22c164[_0x9ed6('0x43')]['fields']));_0x1718ea[_0x9ed6('0x47')]=_0x1718ea[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x1718ea[_0x9ed6('0x47')]:_0x42f170[_0x9ed6('0x42')];_0x1718ea[_0x9ed6('0x4a')]=qs[_0x9ed6('0x4b')](_0x22c164[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x1718ea[_0x9ed6('0x4c')]=qs[_0x9ed6('0x44')](_['pick'](_0x22c164[_0x9ed6('0x43')],_0x42f170[_0x9ed6('0x44')]));if(_0x22c164['query'][_0x9ed6('0x4e')]){_0x1718ea['where']=_[_0x9ed6('0x4f')](_0x1718ea[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x1718ea['attributes'],function(_0x1f469a){var _0x4c32b4={};_0x4c32b4[_0x1f469a]={'$like':'%'+_0x22c164[_0x9ed6('0x43')]['filter']+'%'};return _0x4c32b4;})});}_0x1718ea=_[_0x9ed6('0x4f')]({},_0x1718ea,_0x22c164[_0x9ed6('0x5b')]);return _0x16f0f1[_0x9ed6('0x80')](_0x1718ea);}})[_0x9ed6('0x3a')](function(_0x15becf){if(_0x15becf){_0xf82b8b=_0x15becf[_0x9ed6('0x48')];if(!_0x22c164[_0x9ed6('0x43')]['hasOwnProperty'](_0x9ed6('0x49'))){_0x1718ea['limit']=qs['limit'](_0x22c164['query'][_0x9ed6('0x32')]);_0x1718ea[_0x9ed6('0x31')]=qs['offset'](_0x22c164[_0x9ed6('0x43')][_0x9ed6('0x31')]);}return _0x16f0f1['getApplications'](_0x1718ea);}})[_0x9ed6('0x3a')](function(_0x4f1d86){if(_0x4f1d86){return _0x4f1d86?{'count':_0xf82b8b,'rows':_0x4f1d86}:null;}})[_0x9ed6('0x3a')](respondWithResult(_0x481841,null))[_0x9ed6('0x2b')](handleError(_0x481841,null));};function Extension(_0x25fb8b,_0x5df147,_0x53287b,_0x149a1b){this[_0x9ed6('0x81')]=_0x9ed6('0x82');this[_0x9ed6('0x83')]=_0x25fb8b[_0x9ed6('0x84')];this[_0x9ed6('0x85')]=_0x149a1b;this[_0x9ed6('0x51')]='system';this['description']=_0x9ed6('0x86');this[_0x9ed6('0x68')]=_0x25fb8b['id'];this[_0x9ed6('0x87')]=_0x5df147;this['appdata']=_0x53287b;}function createExtensionsReciveFax(_0x1e1036){var _0x386479=0x1;var _0x280b7a=[];_0x280b7a['push'](new Extension(_0x1e1036,_0x386479,'',_0x9ed6('0x88')));_0x386479+=0x1;_0x280b7a['push'](new Extension(_0x1e1036,_0x386479,'CDR(type)=inbound-fax',_0x9ed6('0x89')));_0x386479+=0x1;for(var _0x4fea8a in _0x1e1036){if(_0x1e1036[_0x9ed6('0x6a')](_0x4fea8a)&&(_0x4fea8a===_0x9ed6('0x8a')||_0x4fea8a===_0x9ed6('0x84')||_0x4fea8a===_0x9ed6('0x8b')||_0x4fea8a==='faxdetect'||_0x4fea8a===_0x9ed6('0x8c')||_0x4fea8a===_0x9ed6('0x8d')||_0x4fea8a==='minrate'||_0x4fea8a==='modem'||_0x4fea8a===_0x9ed6('0x8e'))){_0x280b7a[_0x9ed6('0x8f')](new Extension(_0x1e1036,_0x386479,'FAXOPT('+_0x4fea8a+')='+_0x1e1036[_0x4fea8a],'Set'));_0x386479+=0x1;}}_0x280b7a['push'](new Extension(_0x1e1036,_0x386479,'6',_0x9ed6('0x90')));_0x386479+=0x1;_0x280b7a[_0x9ed6('0x8f')](new Extension(_0x1e1036,_0x386479,_0x9ed6('0x91'),_0x9ed6('0x92')));_0x386479=0x0;return _0x280b7a;}exports[_0x9ed6('0x93')]=function(_0x5cfa41,_0x55bdce,_0x3437e1){var _0x441d72;return db['sequelize'][_0x9ed6('0x7d')](function(_0x409513){return db['FaxAccount'][_0x9ed6('0x5c')](_0x5cfa41[_0x9ed6('0x5d')],{'transaction':_0x409513})[_0x9ed6('0x3a')](function(_0x3ab4fe){_0x441d72=_0x3ab4fe[_0x9ed6('0x37')]({'plain':!![]});return db[_0x9ed6('0x94')]['bulkCreate'](createExtensionsReciveFax(_0x441d72),{'transaction':_0x409513});});})[_0x9ed6('0x3a')](function(){return _0x441d72;})[_0x9ed6('0x3a')](respondWithResult(_0x55bdce,null))[_0x9ed6('0x2b')](handleError(_0x55bdce,null));};exports['updateAccountApplications']=function(_0x29fbfd,_0xba0231,_0x6e36a2){var _0x17fcb2;return db[_0x9ed6('0x7c')][_0x9ed6('0x7d')](function(_0x58b1a5){return db['FaxAccount']['update'](_0x29fbfd[_0x9ed6('0x5d')],{'where':{'id':_0x29fbfd[_0x9ed6('0x5d')]['id']},'transaction':_0x58b1a5})[_0x9ed6('0x3a')](function(_0x1d92bd){return db[_0x9ed6('0x94')]['destroy']({'where':{'FaxAccountId':_0x29fbfd['body']['id']},'transaction':_0x58b1a5})['then'](function(_0x2ba637){return db[_0x9ed6('0x94')][_0x9ed6('0x95')](createExtensionsReciveFax(_[_0x9ed6('0x72')](_0x29fbfd[_0x9ed6('0x5d')],[_0x9ed6('0x96'),_0x9ed6('0x52'),_0x9ed6('0x97'),_0x9ed6('0x98'),_0x9ed6('0x99'),'ListId'])),{'transaction':_0x58b1a5});});});})[_0x9ed6('0x3a')](function(){return db[_0x9ed6('0x54')][_0x9ed6('0x9a')](_0x29fbfd[_0x9ed6('0x5d')]['id']);})[_0x9ed6('0x3a')](respondWithResult(_0xba0231,null))[_0x9ed6('0x2b')](handleError(_0xba0231,null));};exports[_0x9ed6('0x9b')]=function(_0x383acd,_0x92bc37,_0x19c6cd){var _0x1c200f={'raw':!![],'where':{}};var _0x530c41={};var _0x1c3099={'count':0x0,'rows':[]};return db[_0x9ed6('0x54')][_0x9ed6('0x69')]({'where':{'id':_0x383acd[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x92bc37,null))[_0x9ed6('0x3a')](function(_0x5d80fd){if(_0x5d80fd){_0x530c41[_0x9ed6('0x42')]=_['keys'](db[_0x9ed6('0x9c')][_0x9ed6('0x41')]);_0x530c41['query']=_[_0x9ed6('0x59')](_0x383acd[_0x9ed6('0x43')]);_0x530c41[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x530c41[_0x9ed6('0x42')],_0x530c41[_0x9ed6('0x43')]);_0x1c200f[_0x9ed6('0x47')]=_[_0x9ed6('0x45')](_0x530c41[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x383acd[_0x9ed6('0x43')]['fields']));_0x1c200f[_0x9ed6('0x47')]=_0x1c200f[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x1c200f['attributes']:_0x530c41[_0x9ed6('0x42')];if(!_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x1c200f['limit']=qs[_0x9ed6('0x32')](_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x32')]);_0x1c200f['offset']=qs[_0x9ed6('0x31')](_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x31')]);}_0x1c200f[_0x9ed6('0x4a')]=qs[_0x9ed6('0x4b')](_0x383acd['query'][_0x9ed6('0x4b')]);_0x1c200f['where']=qs[_0x9ed6('0x44')](_['pick'](_0x383acd[_0x9ed6('0x43')],_0x530c41[_0x9ed6('0x44')]));_0x1c200f[_0x9ed6('0x4c')]['FaxAccountId']=_0x5d80fd['id'];if(_0x383acd['query']['filter']){_0x1c200f[_0x9ed6('0x4c')]=_['merge'](_0x1c200f['where'],{'$or':_[_0x9ed6('0x50')](_0x1c200f['attributes'],function(_0x37e5b0){var _0x18b50f={};_0x18b50f[_0x37e5b0]={'$like':'%'+_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0x18b50f;})});}if(_0x383acd[_0x9ed6('0x43')]['$gte']){var _0x6bd52d=_0x383acd[_0x9ed6('0x43')][_0x9ed6('0x9d')]['split'](',');var _0x2e566b={};_0x2e566b[_0x6bd52d[0x0]]={'$gte':moment(_0x6bd52d[0x1])[_0x9ed6('0x9e')](_0x9ed6('0x9f'))};_0x1c200f[_0x9ed6('0x4c')]=_[_0x9ed6('0x4f')](_0x1c200f['where'],_0x2e566b);}_0x1c200f=_['merge']({},_0x1c200f,_0x383acd[_0x9ed6('0x5b')]);return db[_0x9ed6('0x9c')][_0x9ed6('0x30')]({'where':_0x1c200f[_0x9ed6('0x4c')]})[_0x9ed6('0x3a')](function(_0x319a5b){_0x1c3099[_0x9ed6('0x30')]=_0x319a5b;if(_0x383acd['query'][_0x9ed6('0x5a')]){_0x1c200f[_0x9ed6('0x55')]=[{'all':!![]}];}return db['FaxMessage'][_0x9ed6('0x56')](_0x1c200f);})[_0x9ed6('0x3a')](function(_0x474b98){_0x1c3099[_0x9ed6('0x57')]=_0x474b98;return _0x1c3099;});}})[_0x9ed6('0x3a')](respondWithFilteredResult(_0x92bc37,_0x1c200f))[_0x9ed6('0x2b')](handleError(_0x92bc37,null));};exports[_0x9ed6('0x3d')]=function(_0x68bfd1,_0x5b625b,_0x604167){var _0x289327,_0x15b930={},_0x1c2cd2;if(_0x68bfd1['body']['to']){_0x1c2cd2=_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x68bfd1[_0x9ed6('0x65')]['id']},'include':[{'model':db['CmList'],'as':_0x9ed6('0xa0'),'include':[{'model':db[_0x9ed6('0xa1')],'as':_0x9ed6('0xa2'),'where':{'fax':_0x1c2cd2},'limit':0x1,'order':[[_0x9ed6('0x98'),_0x9ed6('0xa3')]]}]}]})['then'](handleEntityNotFound(_0x5b625b,null))[_0x9ed6('0x3a')](function(_0x3b1ae7){_0x289327=_0x3b1ae7;if(_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')]&&_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x9ed6('0x48')]){for(var _0x504d65=0x0;_0x504d65<_0x68bfd1[_0x9ed6('0x5d')]['attachments'][_0x9ed6('0x48')];_0x504d65+=0x1){_0x68bfd1[_0x9ed6('0x5d')]['attachments'][_0x504d65]={'filename':_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x504d65][_0x9ed6('0x3c')],'id':_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x504d65]['id'],'path':path[_0x9ed6('0xa5')](config[_0x9ed6('0xa6')],_0x9ed6('0xa7'),_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][_0x504d65][_0x9ed6('0xa8')])};}}return respondWithRpcPromise('CheckAfterSend',_0x9ed6('0xa9'),{'FaxAccountId':_['isNil'](_0x68bfd1[_0x9ed6('0x65')]['id'])?undefined:_0x68bfd1[_0x9ed6('0x65')]['id'],'path':_['isNil'](_0x68bfd1['body'][_0x9ed6('0xa4')][0x0][_0x9ed6('0x9')])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0x9')],'fax':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0]},client9002);})[_0x9ed6('0x3a')](function(){if(_0x289327){if(_[_0x9ed6('0xaa')](_0x68bfd1['body'][_0x9ed6('0xab')])){_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xab')]=util[_0x9ed6('0x9e')](_0x9ed6('0xac'),_0x289327['name'],_0x289327[_0x9ed6('0xad')]);}if(_0x289327['List']){if(_0x289327['List'][_0x9ed6('0xa2')][_0x9ed6('0x48')]){return _0x289327[_0x9ed6('0xa0')][_0x9ed6('0xa2')][0x0];}else{return db[_0x9ed6('0xa1')][_0x9ed6('0x5c')](_['defaults'](_0x68bfd1[_0x9ed6('0x5d')],{'firstName':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'phone':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'fax':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'ListId':_0x289327['ListId']}));}}else{throw new Error(_0x9ed6('0xae'));}}else{throw new Error(_0x9ed6('0xaf'));}})['then'](function(_0x2cffaf){if(_0x2cffaf){return db[_0x9ed6('0x71')]['find']({'where':{'ContactId':_0x2cffaf['id'],'closed':![],'FaxAccountId':_0x289327['id']}})['then'](function(_0x266cdb){if(_0x266cdb){return[_0x266cdb,![]];}return db[_0x9ed6('0x71')][_0x9ed6('0x5c')]({'UserId':_0x68bfd1['user']['id'],'ContactId':_0x2cffaf['id'],'FaxAccountId':_0x289327['id'],'fax':_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'firstMsgDirection':_0x9ed6('0xb0'),'Messages':[_[_0x9ed6('0x4f')](_0x68bfd1[_0x9ed6('0x5d')],{'read':![],'body':_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0xb1')],'FaxAccountId':_0x289327['id'],'UserId':_0x68bfd1['user']['id'],'ContactId':_0x2cffaf['id'],'AttachmentId':_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x9ed6('0x9c')],'as':_0x9ed6('0xb2')}]})[_0x9ed6('0x3a')](function(_0x431aa4){return[_0x431aa4,!![]];});});}else{throw new Error(_0x9ed6('0xb3'));}})[_0x9ed6('0xb4')](function(_0x22b8ae,_0x4e9b3a){if(_0x4e9b3a){return _0x22b8ae;}return db[_0x9ed6('0x9c')][_0x9ed6('0x5c')]({'direction':'out','read':![],'body':_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0xb1')],'FaxAccountId':_0x289327['id'],'FaxInteractionId':_0x22b8ae['id'],'UserId':_0x68bfd1[_0x9ed6('0x5e')]['id'],'ContactId':_0x22b8ae[_0x9ed6('0xb5')],'AttachmentId':_0x68bfd1['body'][_0x9ed6('0xa4')][0x0]['id']})[_0x9ed6('0x3a')](function(_0x5eb583){_0x22b8ae[_0x9ed6('0xb6')][_0x9ed6('0xb2')]=[];_0x22b8ae[_0x9ed6('0xb6')][_0x9ed6('0xb2')][_0x9ed6('0x8f')](_0x5eb583[_0x9ed6('0xb6')]);return _0x22b8ae;});})[_0x9ed6('0x3a')](function(_0x36e4d1){respondWithRpcPromise(_0x9ed6('0xb7'),_0x9ed6('0xb7'),{'FaxAccountId':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x65')]['id'])?undefined:_0x68bfd1[_0x9ed6('0x65')]['id'],'path':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x5d')][_0x9ed6('0xa4')][0x0][_0x9ed6('0x9')])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['attachments'][0x0][_0x9ed6('0x9')],'fax':_[_0x9ed6('0xaa')](_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0])?undefined:_0x68bfd1[_0x9ed6('0x5d')]['to'][0x0],'AttachmentId':_0x68bfd1['body'][_0x9ed6('0xa4')][0x0]['id']},client9002)['then'](function(_0x4038db){logger[_0x9ed6('0x24')](_0x9ed6('0xb8'),_0x4038db);})['catch'](function(_0x343a29){logger[_0x9ed6('0x24')]('SendFaxRpc,\x20%s',_0x343a29);});return _0x36e4d1;})[_0x9ed6('0x3a')](respondWithResult(_0x5b625b,null))['catch'](handleError(_0x5b625b,null));};exports['addAgents']=function(_0x4d70b4,_0x13a11f,_0xaf894f){return db['FaxAccount'][_0x9ed6('0x62')]({'where':{'id':_0x4d70b4['params']['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x13a11f,null))[_0x9ed6('0x3a')](function(_0xd631f9){if(_0xd631f9){return _0xd631f9['addAgents'](_0x4d70b4[_0x9ed6('0x5d')]['ids'],_[_0x9ed6('0x72')](_0x4d70b4[_0x9ed6('0x5d')],[_0x9ed6('0x6c'),'id'])||{})[_0x9ed6('0xb4')](function(_0x5c7d4b){for(var _0x25363e=0x0;_0x25363e<_0x4d70b4[_0x9ed6('0x5d')][_0x9ed6('0x6c')]['length'];_0x25363e+=0x1){socket[_0x9ed6('0xb9')](_0x9ed6('0xba'),{'UserId':_0x4d70b4[_0x9ed6('0x5d')][_0x9ed6('0x6c')][_0x25363e],'FaxAccountId':_0x4d70b4['params']['id']});}return _0x5c7d4b;});}})[_0x9ed6('0x3a')](respondWithResult(_0x13a11f,null))[_0x9ed6('0x2b')](handleError(_0x13a11f,null));};exports[_0x9ed6('0xbb')]=function(_0x3ab1f7,_0x3ee6db,_0x5214f6){return db[_0x9ed6('0x54')][_0x9ed6('0x62')]({'where':{'id':_0x3ab1f7[_0x9ed6('0x65')]['id']}})['then'](handleEntityNotFound(_0x3ee6db,null))[_0x9ed6('0x3a')](function(_0x13582a){if(_0x13582a){return _0x13582a[_0x9ed6('0xbb')](_0x3ab1f7['query'][_0x9ed6('0x6c')])[_0x9ed6('0x3a')](function(){if(_[_0x9ed6('0xbc')](_0x3ab1f7[_0x9ed6('0x43')][_0x9ed6('0x6c')])){for(var _0x4ef9c6=0x0;_0x4ef9c6<_0x3ab1f7[_0x9ed6('0x43')][_0x9ed6('0x6c')]['length'];_0x4ef9c6+=0x1){socket[_0x9ed6('0xb9')](_0x9ed6('0xbd'),{'UserId':Number(_0x3ab1f7[_0x9ed6('0x43')][_0x9ed6('0x6c')][_0x4ef9c6]),'FaxAccountId':Number(_0x3ab1f7['params']['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x3ab1f7[_0x9ed6('0x43')]['ids']),'FaxAccountId':Number(_0x3ab1f7['params']['id'])});}});}})[_0x9ed6('0x3a')](respondWithStatusCode(_0x3ee6db,null))[_0x9ed6('0x2b')](handleError(_0x3ee6db,null));};exports[_0x9ed6('0xbe')]=function(_0x58e15e,_0x35566f,_0x17dc19){var _0x47741b={};var _0x568fc9={};var _0x136264;var _0x288fe0;return db[_0x9ed6('0x54')]['findOne']({'where':{'id':_0x58e15e[_0x9ed6('0x65')]['id']}})[_0x9ed6('0x3a')](handleEntityNotFound(_0x35566f,null))[_0x9ed6('0x3a')](function(_0x3bad4c){if(_0x3bad4c){_0x136264=_0x3bad4c;_0x568fc9[_0x9ed6('0x42')]=_['keys'](db[_0x9ed6('0xbf')]['rawAttributes']);_0x568fc9[_0x9ed6('0x43')]=_['keys'](_0x58e15e[_0x9ed6('0x43')]);_0x568fc9[_0x9ed6('0x44')]=_[_0x9ed6('0x45')](_0x568fc9[_0x9ed6('0x42')],_0x568fc9[_0x9ed6('0x43')]);_0x47741b[_0x9ed6('0x47')]=_['intersection'](_0x568fc9[_0x9ed6('0x42')],qs[_0x9ed6('0x46')](_0x58e15e['query'][_0x9ed6('0x46')]));_0x47741b[_0x9ed6('0x47')]=_0x47741b[_0x9ed6('0x47')][_0x9ed6('0x48')]?_0x47741b[_0x9ed6('0x47')]:_0x568fc9[_0x9ed6('0x42')];_0x47741b[_0x9ed6('0x4a')]=qs['sort'](_0x58e15e[_0x9ed6('0x43')][_0x9ed6('0x4b')]);_0x47741b[_0x9ed6('0x4c')]=qs['filters'](_[_0x9ed6('0x4d')](_0x58e15e['query'],_0x568fc9['filters']));if(_0x58e15e[_0x9ed6('0x43')]['filter']){_0x47741b['where']=_[_0x9ed6('0x4f')](_0x47741b[_0x9ed6('0x4c')],{'$or':_[_0x9ed6('0x50')](_0x47741b[_0x9ed6('0x47')],function(_0x3ae74b){var _0x151382={};_0x151382[_0x3ae74b]={'$like':'%'+_0x58e15e[_0x9ed6('0x43')][_0x9ed6('0x4e')]+'%'};return _0x151382;})});}_0x47741b=_[_0x9ed6('0x4f')]({},_0x47741b,_0x58e15e[_0x9ed6('0x5b')]);return _0x136264[_0x9ed6('0xbe')](_0x47741b);}})[_0x9ed6('0x3a')](function(_0x4b977e){if(_0x4b977e){_0x288fe0=_0x4b977e[_0x9ed6('0x48')];if(!_0x58e15e['query'][_0x9ed6('0x6a')](_0x9ed6('0x49'))){_0x47741b[_0x9ed6('0x32')]=qs['limit'](_0x58e15e[_0x9ed6('0x43')]['limit']);_0x47741b[_0x9ed6('0x31')]=qs[_0x9ed6('0x31')](_0x58e15e['query']['offset']);}return _0x136264[_0x9ed6('0xbe')](_0x47741b);}})[_0x9ed6('0x3a')](function(_0x19824d){if(_0x19824d){return _0x19824d?{'count':_0x288fe0,'rows':_0x19824d}:null;}})[_0x9ed6('0x3a')](respondWithResult(_0x35566f,null))[_0x9ed6('0x2b')](handleError(_0x35566f,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 88ee9df..7d878c3 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 _0x1413=['../../mysqldb','FaxAccount','setMaxListeners','remove','emit','exports'];(function(_0x3451e6,_0x29ade4){var _0x2bfa50=function(_0x50aa0a){while(--_0x50aa0a){_0x3451e6['push'](_0x3451e6['shift']());}};_0x2bfa50(++_0x29ade4);}(_0x1413,0xea));var _0x3141=function(_0x32b4bc,_0x17f7bb){_0x32b4bc=_0x32b4bc-0x0;var _0x591abf=_0x1413[_0x32b4bc];return _0x591abf;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x3141('0x0'))['db'][_0x3141('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3141('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3141('0x3')};function emitEvent(_0x4d9fdf){return function(_0x54c0c7,_0x293580,_0xf873f8){FaxAccountEvents[_0x3141('0x4')](_0x4d9fdf+':'+_0x54c0c7['id'],_0x54c0c7);FaxAccountEvents['emit'](_0x4d9fdf,_0x54c0c7);_0xf873f8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x3141('0x5')]=FaxAccountEvents; \ No newline at end of file +var _0x66fe=['save','update','emit','hook','exports','events','FaxAccount','setMaxListeners'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x66fe,0x7d));var _0xe66f=function(_0x134710,_0x15c37){_0x134710=_0x134710-0x0;var _0x5790fc=_0x66fe[_0x134710];return _0x5790fc;};'use strict';var EventEmitter=require(_0xe66f('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xe66f('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xe66f('0x2')](0x0);var events={'afterCreate':_0xe66f('0x3'),'afterUpdate':_0xe66f('0x4'),'afterDestroy':'remove'};function emitEvent(_0xfd90f7){return function(_0x424166,_0x32777b,_0x43ac5b){FaxAccountEvents[_0xe66f('0x5')](_0xfd90f7+':'+_0x424166['id'],_0x424166);FaxAccountEvents['emit'](_0xfd90f7,_0x424166);_0x43ac5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xe66f('0x6')](e,emitEvent(event));}}module[_0xe66f('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index a5b6628..4104f74 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 _0xa4c2=['define','FaxAccount','fax_accounts','lodash','../../config/logger','moment','bluebird','rimraf','./faxAccount.attributes','exports'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0xa4c2,0xc1));var _0x2a4c=function(_0x36261a,_0x1fceb2){_0x36261a=_0x36261a-0x0;var _0x260c5a=_0xa4c2[_0x36261a];return _0x260c5a;};'use strict';var _=require(_0x2a4c('0x0'));var util=require('util');var logger=require(_0x2a4c('0x1'))('api');var moment=require(_0x2a4c('0x2'));var BPromise=require(_0x2a4c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2a4c('0x4'));var config=require('../../config/environment');var attributes=require(_0x2a4c('0x5'));module[_0x2a4c('0x6')]=function(_0x5141d6,_0x259803){return _0x5141d6[_0x2a4c('0x7')](_0x2a4c('0x8'),attributes,{'tableName':_0x2a4c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa4b2=['../../config/environment','./faxAccount.attributes','define','FaxAccount','fax_accounts','api','bluebird','request-promise','rimraf'];(function(_0x353b90,_0x528e73){var _0x4e96df=function(_0x2bc277){while(--_0x2bc277){_0x353b90['push'](_0x353b90['shift']());}};_0x4e96df(++_0x528e73);}(_0xa4b2,0x1e2));var _0x2a4b=function(_0x2c6cff,_0x5d12c2){_0x2c6cff=_0x2c6cff-0x0;var _0xa6bad9=_0xa4b2[_0x2c6cff];return _0xa6bad9;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2a4b('0x0'));var moment=require('moment');var BPromise=require(_0x2a4b('0x1'));var rp=require(_0x2a4b('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a4b('0x3'));var config=require(_0x2a4b('0x4'));var attributes=require(_0x2a4b('0x5'));module['exports']=function(_0x13d691,_0x2bce18){return _0x13d691[_0x2a4b('0x6')](_0x2a4b('0x7'),attributes,{'tableName':_0x2a4b('0x8'),'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 c127eec..b2fb933 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 _0xcdef=['startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','options','raw','where','attributes','include','map','model','catch','NotifyFaxAccount','body','fax','Sequelize','ValidationError','difference','createdAt','keys','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','CmContact','Contacts','DESC','List','applications','Applications','list','orderBy','priority','length','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','autoclose','push','close','unmanaged','created','ContactId','AttachmentId','interaction','UserId','User','name','agent','waitForTheAssignedAgent','*,*,*,*','Start'];(function(_0x165ea0,_0x9bbbf9){var _0x38f3a2=function(_0x379815){while(--_0x379815){_0x165ea0['push'](_0x165ea0['shift']());}};_0x38f3a2(++_0x9bbbf9);}(_0xcdef,0xb3));var _0xfcde=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcdef[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xfcde('0x0'));var util=require(_0xfcde('0x1'));var moment=require('moment');var BPromise=require(_0xfcde('0x2'));var rs=require(_0xfcde('0x3'));var fs=require('fs');var Redis=require(_0xfcde('0x4'));var db=require(_0xfcde('0x5'))['db'];var utils=require(_0xfcde('0x6'));var logger=require(_0xfcde('0x7'))(_0xfcde('0x8'));var config=require(_0xfcde('0x9'));var jayson=require(_0xfcde('0xa'));var client=jayson['client'][_0xfcde('0xb')]({'port':0x232c});config[_0xfcde('0xc')]=_[_0xfcde('0xd')](config[_0xfcde('0xc')],{'host':_0xfcde('0xe'),'port':0x18eb});var socket=require(_0xfcde('0xf'))(new Redis(config[_0xfcde('0xc')]));require(_0xfcde('0x10'))[_0xfcde('0x11')](socket);function respondWithRpcPromise(_0x599b65,_0x13ab8a,_0xf680cc){return new BPromise(function(_0x8dc7aa,_0x26ddbf){return client['request'](_0x599b65,_0xf680cc)[_0xfcde('0x12')](function(_0x348eaf){logger[_0xfcde('0x13')]('FaxAccount,\x20%s,\x20%s',_0x13ab8a,_0xfcde('0x14'));logger[_0xfcde('0x15')](_0xfcde('0x16'),_0x13ab8a,_0xfcde('0x14'),JSON[_0xfcde('0x17')](_0x348eaf));if(_0x348eaf['error']){if(_0x348eaf['error'][_0xfcde('0x18')]===0x1f4){logger[_0xfcde('0x19')](_0xfcde('0x1a'),_0x13ab8a,_0x348eaf[_0xfcde('0x19')][_0xfcde('0x1b')]);return _0x26ddbf(_0x348eaf[_0xfcde('0x19')][_0xfcde('0x1b')]);}logger[_0xfcde('0x19')](_0xfcde('0x1a'),_0x13ab8a,_0x348eaf[_0xfcde('0x19')]['message']);return _0x8dc7aa(_0x348eaf[_0xfcde('0x19')][_0xfcde('0x1b')]);}else{logger['info'](_0xfcde('0x1a'),_0x13ab8a,_0xfcde('0x14'));_0x8dc7aa(_0x348eaf[_0xfcde('0x1c')]['message']);}})['catch'](function(_0x390a66){logger['error'](_0xfcde('0x1a'),_0x13ab8a,_0x390a66);_0x26ddbf(_0x390a66);});});}exports[_0xfcde('0x1d')]=function(_0x5b6e83){var _0x410958=this;return new Promise(function(_0xc87003,_0x12b0a1){return db['FaxAccount']['findAll']({'raw':_0x5b6e83['options']?_0x5b6e83[_0xfcde('0x1e')][_0xfcde('0x1f')]===undefined?!![]:![]:!![],'where':_0x5b6e83['options']?_0x5b6e83[_0xfcde('0x1e')][_0xfcde('0x20')]||null:null,'attributes':_0x5b6e83['options']?_0x5b6e83['options'][_0xfcde('0x21')]||null:null,'limit':_0x5b6e83[_0xfcde('0x1e')]?_0x5b6e83[_0xfcde('0x1e')]['limit']||null:null,'include':_0x5b6e83['options']?_0x5b6e83[_0xfcde('0x1e')][_0xfcde('0x22')]?_[_0xfcde('0x23')](_0x5b6e83[_0xfcde('0x1e')]['include'],function(_0x79599c){return{'model':db[_0x79599c[_0xfcde('0x24')]],'as':_0x79599c['as'],'attributes':_0x79599c[_0xfcde('0x21')],'include':_0x79599c[_0xfcde('0x22')]?_[_0xfcde('0x23')](_0x79599c[_0xfcde('0x22')],function(_0x2f9801){return{'model':db[_0x2f9801[_0xfcde('0x24')]],'as':_0x2f9801['as'],'attributes':_0x2f9801[_0xfcde('0x21')],'include':_0x2f9801[_0xfcde('0x22')]?_['map'](_0x2f9801[_0xfcde('0x22')],function(_0x413dcc){return{'model':db[_0x413dcc['model']],'as':_0x413dcc['as'],'attributes':_0x413dcc[_0xfcde('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfcde('0x12')](function(_0x4f27ef){logger[_0xfcde('0x13')](_0xfcde('0x1d'),_0x5b6e83);logger[_0xfcde('0x15')](_0xfcde('0x1d'),_0x5b6e83,JSON['stringify'](_0x4f27ef));_0xc87003(_0x4f27ef);})[_0xfcde('0x25')](function(_0x37a4e8){logger[_0xfcde('0x19')](_0xfcde('0x1d'),_0x37a4e8[_0xfcde('0x1b')],_0x5b6e83);_0x12b0a1(_0x410958['error'](0x1f4,_0x37a4e8[_0xfcde('0x1b')]));});});};exports[_0xfcde('0x26')]=function(_0x5df345,_0x2cfa26,_0x316718){var _0x4a9c50=this;return new Promise(function(_0x46d512,_0x1e0afe){var _0x3e6503={'body':_0x5df345[_0xfcde('0x27')],'channel':_0xfcde('0x28')};var _0x21669f=[];var _0x16a5fc=[];var _0x3bafeb={};return db['CmContact']['describe']()[_0xfcde('0x12')](function(_0x5cd7f8){if(!_0x5cd7f8){throw new db[(_0xfcde('0x29'))][(_0xfcde('0x2a'))]('no\x20available\x20attributes');}_0x21669f=_[_0xfcde('0x2b')](_['keys'](_0x5cd7f8),[_0xfcde('0x2c'),'updatedAt']);_0x16a5fc=_[_0xfcde('0x2b')](_[_0xfcde('0x2d')](_0x5cd7f8),[_0xfcde('0x2c'),_0xfcde('0x2e'),_0xfcde('0x2f'),_0xfcde('0x30')]);if(_0x5df345[_0xfcde('0x27')]['id']){delete _0x5df345[_0xfcde('0x27')]['id'];}if(_[_0xfcde('0x31')](_0x5df345[_0xfcde('0x27')][_0xfcde('0x32')])){throw new db[(_0xfcde('0x29'))][(_0xfcde('0x2a'))](_0xfcde('0x33'));}if(_[_0xfcde('0x31')](_0x5df345[_0xfcde('0x27')][_0xfcde('0x27')])||_0x5df345[_0xfcde('0x27')]['body']===''){throw new db[(_0xfcde('0x29'))][(_0xfcde('0x2a'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfcde('0x31')](_0x5df345['body']['mapKey'])){throw new db['Sequelize']['ValidationError'](_0xfcde('0x34')+_0x16a5fc);}if(!_['includes'](_0x16a5fc,_0x5df345['body'][_0xfcde('0x35')])){throw new db['Sequelize'][(_0xfcde('0x2a'))](_0xfcde('0x36')+_0x16a5fc);}_0x3bafeb[_0x5df345['body'][_0xfcde('0x35')]]=_0x5df345['body']['from'];})['then'](function(){return db['FaxAccount']['find']({'where':{'id':_0x5df345[_0xfcde('0x37')]['id']},'include':[{'model':db[_0xfcde('0x38')],'as':'List','include':[{'model':db[_0xfcde('0x39')],'as':_0xfcde('0x3a'),'where':_0x3bafeb,'limit':0x1,'order':[[_0xfcde('0x2e'),_0xfcde('0x3b')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xfcde('0x12')](function(_0x10c639){if(_0x10c639&&_0x10c639[_0xfcde('0x3c')]){var _0x957a26=_0x10c639['get']({'plain':!![]});_0x3e6503['account']=_0x957a26;_0x3e6503[_0xfcde('0x3d')]=_0x957a26[_0xfcde('0x3e')];_0x3e6503[_0xfcde('0x3f')]=_0x957a26[_0xfcde('0x3c')];_0x3e6503[_0xfcde('0x3d')]=_[_0xfcde('0x40')](_0x3e6503[_0xfcde('0x3d')],[_0xfcde('0x41')],['asc']);if(_0x3e6503[_0xfcde('0x37')][_0xfcde('0x3e')]){delete _0x3e6503[_0xfcde('0x37')][_0xfcde('0x3e')];}if(_0x3e6503[_0xfcde('0x37')]['List']&&_0x3e6503[_0xfcde('0x37')][_0xfcde('0x3c')][_0xfcde('0x3a')][_0xfcde('0x42')]){return _0x3e6503['account'][_0xfcde('0x3c')][_0xfcde('0x3a')][0x0];}var _0x2f4d0e=_[_0xfcde('0xd')](_0x5df345[_0xfcde('0x27')],{'firstName':_0x5df345[_0xfcde('0x27')][_0xfcde('0x32')],'ListId':_0x957a26['ListId']});_0x2f4d0e[_0x5df345[_0xfcde('0x27')][_0xfcde('0x35')]]=_0x5df345[_0xfcde('0x27')][_0xfcde('0x32')];return db[_0xfcde('0x39')][_0xfcde('0x43')](_0x2f4d0e,{'fields':_0x21669f,'raw':!![]});}})['then'](function(_0x444d86){_0x3e6503[_0xfcde('0x44')]=_0x444d86;if(_0x444d86){var _0xd3964a={'ContactId':_0x444d86['id'],'FaxAccountId':_0x5df345['account']['id'],'fax':_0x444d86[_0xfcde('0x28')]};return db[_0xfcde('0x45')][_0xfcde('0x46')]({'where':{'ContactId':_0x444d86['id'],'closed':![],'FaxAccountId':_0x5df345[_0xfcde('0x37')]['id']}})[_0xfcde('0x12')](function(_0x233d9e){if(_0x233d9e){return[_0x233d9e,![]];}return db[_0xfcde('0x45')][_0xfcde('0x43')](_0xd3964a)['then'](function(_0x48d513){return[_0x48d513,!![]];});});}else{throw new Error(_0xfcde('0x47'));}})[_0xfcde('0x48')](function(_0x3eed76,_0x24985d){var _0x35e894=_0x3eed76['get']({'plain':!![]});if(_0x24985d){if(_0x3e6503['account'][_0xfcde('0x49')]){_0x3e6503[_0xfcde('0x3d')][_0xfcde('0x4a')]({'id':0x0,'priority':_0x3e6503[_0xfcde('0x3d')][_0xfcde('0x42')]+0x1,'app':_0xfcde('0x4b'),'appdata':_0xfcde('0x4c'),'interval':'*,*,*,*'});}_0x35e894[_0xfcde('0x4d')]=!![];}else{_0x35e894[_0xfcde('0x4d')]=![];}_0x3e6503['interaction']=_0x35e894;return db['FaxMessage'][_0xfcde('0x43')]({'body':_0x5df345['body']['body'],'FaxAccountId':_0x5df345[_0xfcde('0x37')]['id'],'FaxInteractionId':_0x3eed76['id'],'direction':'in','ContactId':_0x3eed76[_0xfcde('0x4e')],'AttachmentId':_0x5df345['body'][_0xfcde('0x4f')]});})[_0xfcde('0x12')](function(_0x3fa3a8){_0x3e6503[_0xfcde('0x1b')]=_0x3fa3a8;if(_0x3e6503[_0xfcde('0x50')][_0xfcde('0x51')]){return db[_0xfcde('0x52')]['find']({'attributes':['id',_0xfcde('0x53')],'where':{'id':_0x3e6503[_0xfcde('0x50')][_0xfcde('0x51')]}})[_0xfcde('0x12')](function(_0x304939){if(_0x304939){_0x3e6503[_0xfcde('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xfcde('0x54'),'appdata':_0x304939[_0xfcde('0x53')]+','+(_0x3e6503['account'][_0xfcde('0x55')]||0xa),'interval':_0xfcde('0x56')});}return respondWithRpcPromise(_0xfcde('0x57'),_0xfcde('0x58'),_0x3e6503);});}return respondWithRpcPromise(_0xfcde('0x57'),_0xfcde('0x58'),_0x3e6503);})['then'](function(_0x33f3cf){_0x46d512(_0x33f3cf);})[_0xfcde('0x25')](function(_0x28eb6a){_0x1e0afe(_0x4a9c50[_0xfcde('0x19')](0x1f4,_0x28eb6a[_0xfcde('0x1b')]));});});}; \ No newline at end of file +var _0xc727=['catch','GetFaxAccount','FaxAccount','raw','options','attributes','limit','include','model','map','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','updatedAt','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','FaxApplication','Applications','get','applications','list','asc','length','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','interaction','create','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','FaxAccount,\x20%s,\x20%s'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xc727,0x1e5));var _0x7c72=function(_0x239818,_0x5a997f){_0x239818=_0x239818-0x0;var _0x157fcb=_0xc727[_0x239818];return _0x157fcb;};'use strict';var _=require(_0x7c72('0x0'));var util=require(_0x7c72('0x1'));var moment=require(_0x7c72('0x2'));var BPromise=require('bluebird');var rs=require(_0x7c72('0x3'));var fs=require('fs');var Redis=require(_0x7c72('0x4'));var db=require(_0x7c72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7c72('0x6'))(_0x7c72('0x7'));var config=require(_0x7c72('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7c72('0x9')]['http']({'port':0x232c});config[_0x7c72('0xa')]=_[_0x7c72('0xb')](config[_0x7c72('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7c72('0xc'))(new Redis(config['redis']));require(_0x7c72('0xd'))[_0x7c72('0xe')](socket);function respondWithRpcPromise(_0xf91f5d,_0x351af5,_0x34ab34){return new BPromise(function(_0x40e65d,_0x1b6de3){return client[_0x7c72('0xf')](_0xf91f5d,_0x34ab34)[_0x7c72('0x10')](function(_0x21ff80){logger[_0x7c72('0x11')]('FaxAccount,\x20%s,\x20%s',_0x351af5,_0x7c72('0x12'));logger[_0x7c72('0x13')](_0x7c72('0x14'),_0x351af5,_0x7c72('0x12'),JSON['stringify'](_0x21ff80));if(_0x21ff80[_0x7c72('0x15')]){if(_0x21ff80[_0x7c72('0x15')][_0x7c72('0x16')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x351af5,_0x21ff80[_0x7c72('0x15')][_0x7c72('0x17')]);return _0x1b6de3(_0x21ff80[_0x7c72('0x15')][_0x7c72('0x17')]);}logger[_0x7c72('0x15')](_0x7c72('0x18'),_0x351af5,_0x21ff80[_0x7c72('0x15')][_0x7c72('0x17')]);return _0x40e65d(_0x21ff80['error'][_0x7c72('0x17')]);}else{logger[_0x7c72('0x11')](_0x7c72('0x18'),_0x351af5,_0x7c72('0x12'));_0x40e65d(_0x21ff80['result'][_0x7c72('0x17')]);}})[_0x7c72('0x19')](function(_0x1027af){logger[_0x7c72('0x15')](_0x7c72('0x18'),_0x351af5,_0x1027af);_0x1b6de3(_0x1027af);});});}exports[_0x7c72('0x1a')]=function(_0x551139){var _0x524b52=this;return new Promise(function(_0x96596b,_0x2d1f63){return db[_0x7c72('0x1b')]['findAll']({'raw':_0x551139['options']?_0x551139['options'][_0x7c72('0x1c')]===undefined?!![]:![]:!![],'where':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')]['where']||null:null,'attributes':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')][_0x7c72('0x1e')]||null:null,'limit':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')][_0x7c72('0x1f')]||null:null,'include':_0x551139[_0x7c72('0x1d')]?_0x551139[_0x7c72('0x1d')][_0x7c72('0x20')]?_['map'](_0x551139[_0x7c72('0x1d')]['include'],function(_0x505699){return{'model':db[_0x505699[_0x7c72('0x21')]],'as':_0x505699['as'],'attributes':_0x505699[_0x7c72('0x1e')],'include':_0x505699[_0x7c72('0x20')]?_[_0x7c72('0x22')](_0x505699['include'],function(_0x4241b7){return{'model':db[_0x4241b7['model']],'as':_0x4241b7['as'],'attributes':_0x4241b7[_0x7c72('0x1e')],'include':_0x4241b7[_0x7c72('0x20')]?_[_0x7c72('0x22')](_0x4241b7['include'],function(_0x2576f9){return{'model':db[_0x2576f9[_0x7c72('0x21')]],'as':_0x2576f9['as'],'attributes':_0x2576f9[_0x7c72('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7c72('0x10')](function(_0x539854){logger['info'](_0x7c72('0x1a'),_0x551139);logger[_0x7c72('0x13')](_0x7c72('0x1a'),_0x551139,JSON[_0x7c72('0x23')](_0x539854));_0x96596b(_0x539854);})[_0x7c72('0x19')](function(_0x77c92e){logger[_0x7c72('0x15')](_0x7c72('0x1a'),_0x77c92e[_0x7c72('0x17')],_0x551139);_0x2d1f63(_0x524b52['error'](0x1f4,_0x77c92e[_0x7c72('0x17')]));});});};exports[_0x7c72('0x24')]=function(_0x47aa4f,_0x21440e,_0x6a8e65){var _0x51bd16=this;return new Promise(function(_0x1dd951,_0xa78162){var _0x52929e={'body':_0x47aa4f[_0x7c72('0x25')],'channel':_0x7c72('0x26')};var _0xe8f2e9=[];var _0x22651f=[];var _0x60128b={};return db[_0x7c72('0x27')][_0x7c72('0x28')]()[_0x7c72('0x10')](function(_0x45042e){if(!_0x45042e){throw new db[(_0x7c72('0x29'))]['ValidationError'](_0x7c72('0x2a'));}_0xe8f2e9=_[_0x7c72('0x2b')](_[_0x7c72('0x2c')](_0x45042e),['createdAt',_0x7c72('0x2d')]);_0x22651f=_['difference'](_[_0x7c72('0x2c')](_0x45042e),[_0x7c72('0x2e'),_0x7c72('0x2d'),_0x7c72('0x2f'),_0x7c72('0x30')]);if(_0x47aa4f['body']['id']){delete _0x47aa4f[_0x7c72('0x25')]['id'];}if(_[_0x7c72('0x31')](_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x32')])){throw new db[(_0x7c72('0x29'))][(_0x7c72('0x33'))](_0x7c72('0x34'));}if(_[_0x7c72('0x31')](_0x47aa4f['body']['body'])||_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x25')]===''){throw new db[(_0x7c72('0x29'))][(_0x7c72('0x33'))](_0x7c72('0x35'));}if(_[_0x7c72('0x31')](_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x36')])){throw new db[(_0x7c72('0x29'))][(_0x7c72('0x33'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x22651f);}if(!_[_0x7c72('0x37')](_0x22651f,_0x47aa4f[_0x7c72('0x25')]['mapKey'])){throw new db['Sequelize'][(_0x7c72('0x33'))](_0x7c72('0x38')+_0x22651f);}_0x60128b[_0x47aa4f['body'][_0x7c72('0x36')]]=_0x47aa4f['body'][_0x7c72('0x32')];})[_0x7c72('0x10')](function(){return db[_0x7c72('0x1b')][_0x7c72('0x39')]({'where':{'id':_0x47aa4f[_0x7c72('0x3a')]['id']},'include':[{'model':db[_0x7c72('0x3b')],'as':_0x7c72('0x3c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x60128b,'limit':0x1,'order':[[_0x7c72('0x2d'),_0x7c72('0x3d')]]}]},{'model':db[_0x7c72('0x3e')],'as':_0x7c72('0x3f')}]});})[_0x7c72('0x10')](function(_0x42a133){if(_0x42a133&&_0x42a133[_0x7c72('0x3c')]){var _0x1b6d29=_0x42a133[_0x7c72('0x40')]({'plain':!![]});_0x52929e[_0x7c72('0x3a')]=_0x1b6d29;_0x52929e[_0x7c72('0x41')]=_0x1b6d29[_0x7c72('0x3f')];_0x52929e[_0x7c72('0x42')]=_0x1b6d29[_0x7c72('0x3c')];_0x52929e['applications']=_['orderBy'](_0x52929e['applications'],['priority'],[_0x7c72('0x43')]);if(_0x52929e[_0x7c72('0x3a')]['Applications']){delete _0x52929e[_0x7c72('0x3a')][_0x7c72('0x3f')];}if(_0x52929e[_0x7c72('0x3a')][_0x7c72('0x3c')]&&_0x52929e[_0x7c72('0x3a')][_0x7c72('0x3c')]['Contacts'][_0x7c72('0x44')]){return _0x52929e[_0x7c72('0x3a')][_0x7c72('0x3c')]['Contacts'][0x0];}var _0x741117=_[_0x7c72('0xb')](_0x47aa4f[_0x7c72('0x25')],{'firstName':_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x32')],'ListId':_0x1b6d29['ListId']});_0x741117[_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x36')]]=_0x47aa4f['body'][_0x7c72('0x32')];return db[_0x7c72('0x27')]['create'](_0x741117,{'fields':_0xe8f2e9,'raw':!![]});}})['then'](function(_0x315e92){_0x52929e['contact']=_0x315e92;if(_0x315e92){var _0x239fd4={'ContactId':_0x315e92['id'],'FaxAccountId':_0x47aa4f[_0x7c72('0x3a')]['id'],'fax':_0x315e92[_0x7c72('0x26')]};return db['FaxInteraction'][_0x7c72('0x39')]({'where':{'ContactId':_0x315e92['id'],'closed':![],'FaxAccountId':_0x47aa4f[_0x7c72('0x3a')]['id']}})['then'](function(_0x376659){if(_0x376659){return[_0x376659,![]];}return db[_0x7c72('0x45')]['create'](_0x239fd4)[_0x7c72('0x10')](function(_0x2866d3){return[_0x2866d3,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x7c72('0x46')](function(_0x4dd8e5,_0x280c9c){var _0x3facff=_0x4dd8e5[_0x7c72('0x40')]({'plain':!![]});if(_0x280c9c){if(_0x52929e[_0x7c72('0x3a')][_0x7c72('0x47')]){_0x52929e['applications'][_0x7c72('0x48')]({'id':0x0,'priority':_0x52929e[_0x7c72('0x41')][_0x7c72('0x44')]+0x1,'app':_0x7c72('0x49'),'appdata':_0x7c72('0x4a'),'interval':_0x7c72('0x4b')});}_0x3facff['created']=!![];}else{_0x3facff['created']=![];}_0x52929e[_0x7c72('0x4c')]=_0x3facff;return db['FaxMessage'][_0x7c72('0x4d')]({'body':_0x47aa4f[_0x7c72('0x25')][_0x7c72('0x25')],'FaxAccountId':_0x47aa4f[_0x7c72('0x3a')]['id'],'FaxInteractionId':_0x4dd8e5['id'],'direction':'in','ContactId':_0x4dd8e5['ContactId'],'AttachmentId':_0x47aa4f[_0x7c72('0x25')]['AttachmentId']});})['then'](function(_0x491f61){_0x52929e['message']=_0x491f61;if(_0x52929e[_0x7c72('0x4c')]['UserId']){return db['User'][_0x7c72('0x39')]({'attributes':['id','name'],'where':{'id':_0x52929e[_0x7c72('0x4c')][_0x7c72('0x4e')]}})[_0x7c72('0x10')](function(_0x4198fc){if(_0x4198fc){_0x52929e[_0x7c72('0x41')][_0x7c72('0x4f')]({'id':0x0,'priority':0x0,'app':_0x7c72('0x50'),'appdata':_0x4198fc[_0x7c72('0x51')]+','+(_0x52929e[_0x7c72('0x3a')][_0x7c72('0x52')]||0xa),'interval':_0x7c72('0x4b')});}return respondWithRpcPromise(_0x7c72('0x53'),_0x7c72('0x54'),_0x52929e);});}return respondWithRpcPromise(_0x7c72('0x53'),_0x7c72('0x54'),_0x52929e);})[_0x7c72('0x10')](function(_0xa3aa1f){_0x1dd951(_0xa3aa1f);})[_0x7c72('0x19')](function(_0xca2998){_0xa78162(_0x51bd16[_0x7c72('0x15')](0x1f4,_0xca2998[_0x7c72('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 10dd6bc..331b8a9 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 _0xe395=['faxAccount:','save','remove','removeListener','register','length'];(function(_0x500729,_0x32ed4a){var _0x2d2ab4=function(_0x2ff344){while(--_0x2ff344){_0x500729['push'](_0x500729['shift']());}};_0x2d2ab4(++_0x32ed4a);}(_0xe395,0x91));var _0x5e39=function(_0x209e90,_0x26b758){_0x209e90=_0x209e90-0x0;var _0x2fee02=_0xe395[_0x209e90];return _0x2fee02;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x5e39('0x0'),_0x5e39('0x1'),'update'];function createListener(_0x52e76b,_0x284ebc){return function(_0x5b7471){_0x284ebc['emit'](_0x52e76b,_0x5b7471);};}function removeListener(_0x3187a5,_0x4b5950){return function(){FaxAccountEvents[_0x5e39('0x2')](_0x3187a5,_0x4b5950);};}exports[_0x5e39('0x3')]=function(_0x2ef7d9){for(var _0x57c8eb=0x0,_0x5ac135=events[_0x5e39('0x4')];_0x57c8eb<_0x5ac135;_0x57c8eb++){var _0x1b1374=events[_0x57c8eb];var _0x2fd211=createListener(_0x5e39('0x5')+_0x1b1374,_0x2ef7d9);FaxAccountEvents['on'](_0x1b1374,_0x2fd211);}}; \ No newline at end of file +var _0x3896=['removeListener','register','length','faxAccount:','./faxAccount.events','save','remove','update','emit'];(function(_0x3bc61f,_0x137218){var _0x4e52b4=function(_0x16591c){while(--_0x16591c){_0x3bc61f['push'](_0x3bc61f['shift']());}};_0x4e52b4(++_0x137218);}(_0x3896,0x175));var _0x6389=function(_0x404d66,_0xcf3612){_0x404d66=_0x404d66-0x0;var _0x5e72a8=_0x3896[_0x404d66];return _0x5e72a8;};'use strict';var FaxAccountEvents=require(_0x6389('0x0'));var events=[_0x6389('0x1'),_0x6389('0x2'),_0x6389('0x3')];function createListener(_0x467bea,_0x349a08){return function(_0x669ad3){_0x349a08[_0x6389('0x4')](_0x467bea,_0x669ad3);};}function removeListener(_0xb65757,_0x50d202){return function(){FaxAccountEvents[_0x6389('0x5')](_0xb65757,_0x50d202);};}exports[_0x6389('0x6')]=function(_0x540130){for(var _0x157b77=0x0,_0x6bec6f=events[_0x6389('0x7')];_0x157b77<_0x6bec6f;_0x157b77++){var _0x52e1b1=events[_0x157b77];var _0x303ecd=createListener(_0x6389('0x8')+_0x52e1b1,_0x540130);FaxAccountEvents['on'](_0x52e1b1,_0x303ecd);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 5a6685c..dcee3e7 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 _0xcad9=['addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','update','destroy','delete','removeDispositions','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create'];(function(_0x574ce3,_0x59eef4){var _0x3447a0=function(_0x27f8cb){while(--_0x27f8cb){_0x574ce3['push'](_0x574ce3['shift']());}};_0x3447a0(++_0x59eef4);}(_0xcad9,0xa9));var _0x9cad=function(_0x278c6d,_0x2cb449){_0x278c6d=_0x278c6d-0x0;var _0x5be406=_0xcad9[_0x278c6d];return _0x5be406;};'use strict';var multer=require(_0x9cad('0x0'));var util=require('util');var path=require(_0x9cad('0x1'));var timeout=require('connect-timeout');var express=require(_0x9cad('0x2'));var router=express[_0x9cad('0x3')]();var auth=require(_0x9cad('0x4'));var interaction=require(_0x9cad('0x5'));var config=require(_0x9cad('0x6'));var controller=require('./faxAccount.controller');router['get']('/',auth[_0x9cad('0x7')](),controller[_0x9cad('0x8')]);router[_0x9cad('0x9')](_0x9cad('0xa'),auth[_0x9cad('0x7')](),controller['describe']);router[_0x9cad('0x9')](_0x9cad('0xb'),auth[_0x9cad('0x7')](),controller['show']);router[_0x9cad('0x9')](_0x9cad('0xc'),auth['isAuthenticated'](),controller[_0x9cad('0xd')]);router['get'](_0x9cad('0xe'),auth[_0x9cad('0x7')](),controller[_0x9cad('0xf')]);router[_0x9cad('0x9')](_0x9cad('0x10'),auth[_0x9cad('0x7')](),controller[_0x9cad('0x11')]);router[_0x9cad('0x9')](_0x9cad('0x12'),auth[_0x9cad('0x7')](),controller[_0x9cad('0x13')]);router[_0x9cad('0x9')](_0x9cad('0x14'),auth['isAuthenticated'](),controller[_0x9cad('0x15')]);router[_0x9cad('0x9')](_0x9cad('0x16'),auth['isAuthenticated'](),controller[_0x9cad('0x17')]);router[_0x9cad('0x18')]('/',auth[_0x9cad('0x7')](),controller[_0x9cad('0x19')]);router[_0x9cad('0x18')](_0x9cad('0xc'),auth[_0x9cad('0x7')](),controller['addDisposition']);router[_0x9cad('0x18')](_0x9cad('0xe'),auth[_0x9cad('0x7')](),controller['addAnswer']);router['post'](_0x9cad('0x10'),auth[_0x9cad('0x7')](),controller[_0x9cad('0x1a')]);router[_0x9cad('0x18')]('/:id/applications',auth[_0x9cad('0x7')](),controller[_0x9cad('0x1b')]);router[_0x9cad('0x18')](_0x9cad('0x1c'),auth['isAuthenticated'](),controller[_0x9cad('0x1d')]);router[_0x9cad('0x18')](_0x9cad('0x1e'),auth[_0x9cad('0x7')](),controller['updateAccountApplications']);router['post'](_0x9cad('0x1f'),auth[_0x9cad('0x7')](),controller['send']);router[_0x9cad('0x18')](_0x9cad('0x16'),auth[_0x9cad('0x7')](),controller[_0x9cad('0x20')]);router['put'](_0x9cad('0xb'),auth[_0x9cad('0x7')](),controller[_0x9cad('0x21')]);router['delete'](_0x9cad('0xb'),auth['isAuthenticated'](),controller[_0x9cad('0x22')]);router[_0x9cad('0x23')](_0x9cad('0xc'),auth[_0x9cad('0x7')](),controller[_0x9cad('0x24')]);router[_0x9cad('0x23')](_0x9cad('0xe'),auth[_0x9cad('0x7')](),controller['removeAnswers']);router[_0x9cad('0x23')](_0x9cad('0x16'),auth[_0x9cad('0x7')](),controller[_0x9cad('0x25')]);module[_0x9cad('0x26')]=router; \ No newline at end of file +var _0xd2d8=['isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/users','getAgents','post','create','/:id/dispositions','addInteraction','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxAccount.controller','get'];(function(_0x345533,_0x5949f6){var _0x319552=function(_0x42f030){while(--_0x42f030){_0x345533['push'](_0x345533['shift']());}};_0x319552(++_0x5949f6);}(_0xd2d8,0x97));var _0x8d2d=function(_0x26ac27,_0x574b86){_0x26ac27=_0x26ac27-0x0;var _0x44a599=_0xd2d8[_0x26ac27];return _0x44a599;};'use strict';var multer=require(_0x8d2d('0x0'));var util=require(_0x8d2d('0x1'));var path=require('path');var timeout=require(_0x8d2d('0x2'));var express=require(_0x8d2d('0x3'));var router=express[_0x8d2d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8d2d('0x5'));var config=require(_0x8d2d('0x6'));var controller=require(_0x8d2d('0x7'));router[_0x8d2d('0x8')]('/',auth[_0x8d2d('0x9')](),controller['index']);router[_0x8d2d('0x8')](_0x8d2d('0xa'),auth['isAuthenticated'](),controller[_0x8d2d('0xb')]);router[_0x8d2d('0x8')](_0x8d2d('0xc'),auth['isAuthenticated'](),controller[_0x8d2d('0xd')]);router[_0x8d2d('0x8')]('/:id/dispositions',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0xe')]);router['get'](_0x8d2d('0xf'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x10')]);router[_0x8d2d('0x8')](_0x8d2d('0x11'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x12')]);router[_0x8d2d('0x8')](_0x8d2d('0x13'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x14')]);router[_0x8d2d('0x8')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x8d2d('0x15'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x16')]);router[_0x8d2d('0x17')]('/',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x18')]);router[_0x8d2d('0x17')](_0x8d2d('0x19'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x8d2d('0x17')](_0x8d2d('0xf'),auth[_0x8d2d('0x9')](),controller['addAnswer']);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x8d2d('0x1a')]);router[_0x8d2d('0x17')](_0x8d2d('0x13'),auth['isAuthenticated'](),controller['addApplications']);router[_0x8d2d('0x17')](_0x8d2d('0x1b'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x1c')]);router[_0x8d2d('0x17')]('/updateaccountapplications',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x1d')]);router[_0x8d2d('0x17')](_0x8d2d('0x1e'),auth['isAuthenticated'](),controller[_0x8d2d('0x1f')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x8d2d('0x20')]);router['put']('/:id',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x21')]);router[_0x8d2d('0x22')](_0x8d2d('0xc'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x23')]);router[_0x8d2d('0x22')]('/:id/dispositions',auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x24')]);router[_0x8d2d('0x22')](_0x8d2d('0xf'),auth['isAuthenticated'](),controller[_0x8d2d('0x25')]);router[_0x8d2d('0x22')](_0x8d2d('0x15'),auth[_0x8d2d('0x9')](),controller[_0x8d2d('0x26')]);module[_0x8d2d('0x27')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 1fc34c5..618b6fb 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 _0x352b=['sequelize','exports','STRING','noop','TEXT','*,*,*,*'];(function(_0x4d3f8a,_0x464e82){var _0x43252b=function(_0x2f0976){while(--_0x2f0976){_0x4d3f8a['push'](_0x4d3f8a['shift']());}};_0x43252b(++_0x464e82);}(_0x352b,0x1c8));var _0xb352=function(_0x32db9f,_0x50a877){_0x32db9f=_0x32db9f-0x0;var _0x2e7308=_0x352b[_0x32db9f];return _0x2e7308;};'use strict';var Sequelize=require(_0xb352('0x0'));module[_0xb352('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb352('0x2')],'allowNull':![],'defaultValue':_0xb352('0x3')},'appdata':{'type':Sequelize[_0xb352('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb352('0x5')}}; \ No newline at end of file +var _0xd386=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xd386,0x10c));var _0x6d38=function(_0x47327a,_0xa744ab){_0x47327a=_0x47327a-0x0;var _0x258c4c=_0xd386[_0x47327a];return _0x258c4c;};'use strict';var Sequelize=require(_0x6d38('0x0'));module[_0x6d38('0x1')]={'priority':{'type':Sequelize[_0x6d38('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6d38('0x3')},'appdata':{'type':Sequelize[_0x6d38('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6d38('0x5')],'defaultValue':_0x6d38('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 13bfea8..51065c1 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 _0x524e=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','FaxApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','limit','sort','where','pick','filter','merge','key','VIRTUAL','field','options','count','includeAll','include','findAll','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x51ec67,_0x1a3992){var _0x458d83=function(_0x18882c){while(--_0x18882c){_0x51ec67['push'](_0x51ec67['shift']());}};_0x458d83(++_0x1a3992);}(_0x524e,0x15e));var _0xe524=function(_0x40a06b,_0x9753cc){_0x40a06b=_0x40a06b-0x0;var _0x37f84a=_0x524e[_0x40a06b];return _0x37f84a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe524('0x0'));var zipdir=require(_0xe524('0x1'));var jsonpatch=require(_0xe524('0x2'));var rp=require(_0xe524('0x3'));var moment=require(_0xe524('0x4'));var BPromise=require(_0xe524('0x5'));var Mustache=require(_0xe524('0x6'));var util=require(_0xe524('0x7'));var path=require(_0xe524('0x8'));var sox=require(_0xe524('0x9'));var csv=require('to-csv');var ejs=require(_0xe524('0xa'));var fs=require('fs');var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0xf'));var querystring=require(_0xe524('0x10'));var Papa=require(_0xe524('0x11'));var Redis=require(_0xe524('0x12'));var authService=require(_0xe524('0x13'));var qs=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var db=require(_0xe524('0x1a'))['db'];function respondWithStatusCode(_0x1bdcee,_0x26cc77){_0x26cc77=_0x26cc77||0xcc;return function(_0x5077c1){if(_0x5077c1){return _0x1bdcee['sendStatus'](_0x26cc77);}return _0x1bdcee[_0xe524('0x1b')](_0x26cc77)[_0xe524('0x1c')]();};}function respondWithResult(_0x11adbc,_0xf4c00d){_0xf4c00d=_0xf4c00d||0xc8;return function(_0x20a852){if(_0x20a852){return _0x11adbc['status'](_0xf4c00d)[_0xe524('0x1d')](_0x20a852);}};}function respondWithFilteredResult(_0x51e9fe,_0x19f013){return function(_0x1b0af6){if(_0x1b0af6){var _0x48165e=_0x1b0af6['count'],_0x569660=_0x19f013[_0xe524('0x1e')],_0x488fce=_0x19f013['offset']+_0x19f013['limit'],_0x109795;if(_0x488fce>=_0x48165e){_0x488fce=_0x48165e;_0x109795=0xc8;}else{_0x109795=0xce;}_0x51e9fe['status'](_0x109795);return _0x51e9fe[_0xe524('0x1f')]('Content-Range',_0x569660+'-'+_0x488fce+'/'+_0x48165e)[_0xe524('0x1d')](_0x1b0af6);}return null;};}function patchUpdates(_0x238f8f){return function(_0x278de9){try{jsonpatch[_0xe524('0x20')](_0x278de9,_0x238f8f,!![]);}catch(_0x5d7b17){return BPromise[_0xe524('0x21')](_0x5d7b17);}return _0x278de9[_0xe524('0x22')]();};}function saveUpdates(_0x49d104,_0x467c2a){return function(_0x309f85){if(_0x309f85){return _0x309f85[_0xe524('0x23')](_0x49d104)[_0xe524('0x24')](function(_0x1c4194){return _0x1c4194;});}return null;};}function removeEntity(_0x1cab6c,_0xbf059b){return function(_0x375219){if(_0x375219){return _0x375219[_0xe524('0x25')]()['then'](function(){_0x1cab6c[_0xe524('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x577d1f,_0x2d2f83){return function(_0x23df5e){if(!_0x23df5e){_0x577d1f[_0xe524('0x26')](0x194);}return _0x23df5e;};}function handleError(_0x85fc51,_0x599d5d){_0x599d5d=_0x599d5d||0x1f4;return function(_0x158f07){logger['error'](_0x158f07[_0xe524('0x27')]);if(_0x158f07[_0xe524('0x28')]){delete _0x158f07[_0xe524('0x28')];}_0x85fc51[_0xe524('0x1b')](_0x599d5d)[_0xe524('0x29')](_0x158f07);};}exports[_0xe524('0x2a')]=function(_0x2141db,_0x583cc3){var _0x58a896={},_0x283f18={},_0x45abad={'count':0x0,'rows':[]};var _0x476572=db[_0xe524('0x2b')][_0xe524('0x2c')];_0x283f18['model']=_['keys'](_0x476572);_0x283f18[_0xe524('0x2d')]=_[_0xe524('0x2e')](_0x2141db[_0xe524('0x2d')]);_0x283f18[_0xe524('0x2f')]=_[_0xe524('0x30')](_0x283f18['model'],_0x283f18[_0xe524('0x2d')]);_0x58a896[_0xe524('0x31')]=_['intersection'](_0x283f18['model'],qs[_0xe524('0x32')](_0x2141db[_0xe524('0x2d')]['fields']));_0x58a896[_0xe524('0x31')]=_0x58a896['attributes'][_0xe524('0x33')]?_0x58a896['attributes']:_0x283f18[_0xe524('0x34')];if(!_0x2141db[_0xe524('0x2d')][_0xe524('0x35')]('nolimit')){_0x58a896[_0xe524('0x36')]=qs['limit'](_0x2141db[_0xe524('0x2d')][_0xe524('0x36')]);_0x58a896[_0xe524('0x1e')]=qs['offset'](_0x2141db[_0xe524('0x2d')][_0xe524('0x1e')]);}_0x58a896['order']=qs[_0xe524('0x37')](_0x2141db[_0xe524('0x2d')][_0xe524('0x37')]);_0x58a896[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x2141db[_0xe524('0x2d')],_0x283f18[_0xe524('0x2f')]));if(_0x2141db[_0xe524('0x2d')][_0xe524('0x3a')]){_0x58a896[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x58a896[_0xe524('0x38')],{'$or':_['map'](_0x476572,function(_0x150a9f){if(_0x150a9f['type'][_0xe524('0x3c')]!==_0xe524('0x3d')){var _0x51cafc={};_0x51cafc[_0x150a9f[_0xe524('0x3e')]]={'$like':'%'+_0x2141db['query'][_0xe524('0x3a')]+'%'};return _0x51cafc;}})});}_0x58a896=_[_0xe524('0x3b')]({},_0x58a896,_0x2141db[_0xe524('0x3f')]);var _0x3103e9={'where':_0x58a896[_0xe524('0x38')]};return db[_0xe524('0x2b')][_0xe524('0x40')](_0x3103e9)[_0xe524('0x24')](function(_0x5e8e64){_0x45abad[_0xe524('0x40')]=_0x5e8e64;if(_0x2141db[_0xe524('0x2d')][_0xe524('0x41')]){_0x58a896[_0xe524('0x42')]=[{'all':!![]}];}return db[_0xe524('0x2b')][_0xe524('0x43')](_0x58a896);})[_0xe524('0x24')](function(_0x158d45){_0x45abad['rows']=_0x158d45;return _0x45abad;})[_0xe524('0x24')](respondWithFilteredResult(_0x583cc3,_0x58a896))[_0xe524('0x44')](handleError(_0x583cc3,null));};exports[_0xe524('0x45')]=function(_0x59781b,_0x238673){var _0x5213ed={'raw':!![],'where':{'id':_0x59781b[_0xe524('0x46')]['id']}},_0x2574a2={};_0x2574a2[_0xe524('0x34')]=_[_0xe524('0x2e')](db[_0xe524('0x2b')][_0xe524('0x2c')]);_0x2574a2[_0xe524('0x2d')]=_['keys'](_0x59781b[_0xe524('0x2d')]);_0x2574a2[_0xe524('0x2f')]=_[_0xe524('0x30')](_0x2574a2[_0xe524('0x34')],_0x2574a2[_0xe524('0x2d')]);_0x5213ed[_0xe524('0x31')]=_['intersection'](_0x2574a2[_0xe524('0x34')],qs[_0xe524('0x32')](_0x59781b[_0xe524('0x2d')]['fields']));_0x5213ed[_0xe524('0x31')]=_0x5213ed['attributes']['length']?_0x5213ed[_0xe524('0x31')]:_0x2574a2[_0xe524('0x34')];if(_0x59781b['query'][_0xe524('0x41')]){_0x5213ed[_0xe524('0x42')]=[{'all':!![]}];}_0x5213ed=_[_0xe524('0x3b')]({},_0x5213ed,_0x59781b[_0xe524('0x3f')]);return db['FaxApplication']['find'](_0x5213ed)[_0xe524('0x24')](handleEntityNotFound(_0x238673,null))[_0xe524('0x24')](respondWithResult(_0x238673,null))['catch'](handleError(_0x238673,null));};exports[_0xe524('0x47')]=function(_0x4e3809,_0x472519){return db[_0xe524('0x2b')][_0xe524('0x47')](_0x4e3809[_0xe524('0x48')],{})[_0xe524('0x24')](respondWithResult(_0x472519,0xc9))[_0xe524('0x44')](handleError(_0x472519,null));};exports[_0xe524('0x23')]=function(_0x22fb42,_0x1642a7){if(_0x22fb42[_0xe524('0x48')]['id']){delete _0x22fb42[_0xe524('0x48')]['id'];}return db[_0xe524('0x2b')][_0xe524('0x49')]({'where':{'id':_0x22fb42[_0xe524('0x46')]['id']}})[_0xe524('0x24')](handleEntityNotFound(_0x1642a7,null))['then'](saveUpdates(_0x22fb42[_0xe524('0x48')],null))['then'](respondWithResult(_0x1642a7,null))['catch'](handleError(_0x1642a7,null));};exports[_0xe524('0x25')]=function(_0x59fe6b,_0x232cf0){return db[_0xe524('0x2b')]['find']({'where':{'id':_0x59fe6b[_0xe524('0x46')]['id']}})['then'](handleEntityNotFound(_0x232cf0,null))['then'](removeEntity(_0x232cf0,null))[_0xe524('0x44')](handleError(_0x232cf0,null));}; \ No newline at end of file +var _0xb016=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','FaxApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','show','params','find','catch','create','body','update','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x5e0e52,_0x5b449c){var _0x53bcae=function(_0x3f8a6d){while(--_0x3f8a6d){_0x5e0e52['push'](_0x5e0e52['shift']());}};_0x53bcae(++_0x5b449c);}(_0xb016,0x159));var _0x6b01=function(_0x506526,_0xcb7d3b){_0x506526=_0x506526-0x0;var _0x269995=_0xb016[_0x506526];return _0x269995;};'use strict';var pdf=require(_0x6b01('0x0'));var emlformat=require(_0x6b01('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6b01('0x2'));var rp=require('request-promise');var moment=require(_0x6b01('0x3'));var BPromise=require(_0x6b01('0x4'));var Mustache=require(_0x6b01('0x5'));var util=require(_0x6b01('0x6'));var path=require('path');var sox=require(_0x6b01('0x7'));var csv=require(_0x6b01('0x8'));var ejs=require(_0x6b01('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b01('0xa'));var jsforce=require(_0x6b01('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6b01('0xc'));var Papa=require(_0x6b01('0xd'));var Redis=require(_0x6b01('0xe'));var authService=require(_0x6b01('0xf'));var qs=require(_0x6b01('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6b01('0x11'));var utils=require(_0x6b01('0x12'));var config=require(_0x6b01('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x200614,_0x5c54e4){_0x5c54e4=_0x5c54e4||0xcc;return function(_0x51f976){if(_0x51f976){return _0x200614[_0x6b01('0x14')](_0x5c54e4);}return _0x200614['status'](_0x5c54e4)[_0x6b01('0x15')]();};}function respondWithResult(_0x192406,_0x47c09f){_0x47c09f=_0x47c09f||0xc8;return function(_0x2c305e){if(_0x2c305e){return _0x192406['status'](_0x47c09f)['json'](_0x2c305e);}};}function respondWithFilteredResult(_0x51b3cf,_0x3d4666){return function(_0x4cbd38){if(_0x4cbd38){var _0x5b2f60=_0x4cbd38[_0x6b01('0x16')],_0x3a259f=_0x3d4666[_0x6b01('0x17')],_0x327e86=_0x3d4666[_0x6b01('0x17')]+_0x3d4666[_0x6b01('0x18')],_0x20dd83;if(_0x327e86>=_0x5b2f60){_0x327e86=_0x5b2f60;_0x20dd83=0xc8;}else{_0x20dd83=0xce;}_0x51b3cf[_0x6b01('0x19')](_0x20dd83);return _0x51b3cf[_0x6b01('0x1a')](_0x6b01('0x1b'),_0x3a259f+'-'+_0x327e86+'/'+_0x5b2f60)[_0x6b01('0x1c')](_0x4cbd38);}return null;};}function patchUpdates(_0x4f2d08){return function(_0x2c5f29){try{jsonpatch[_0x6b01('0x1d')](_0x2c5f29,_0x4f2d08,!![]);}catch(_0x3b0bab){return BPromise[_0x6b01('0x1e')](_0x3b0bab);}return _0x2c5f29[_0x6b01('0x1f')]();};}function saveUpdates(_0x11e4dc,_0x33753f){return function(_0x3c0573){if(_0x3c0573){return _0x3c0573['update'](_0x11e4dc)[_0x6b01('0x20')](function(_0xc1f453){return _0xc1f453;});}return null;};}function removeEntity(_0x424cd3,_0x2551b0){return function(_0x1fced4){if(_0x1fced4){return _0x1fced4[_0x6b01('0x21')]()[_0x6b01('0x20')](function(){_0x424cd3['status'](0xcc)[_0x6b01('0x15')]();});}};}function handleEntityNotFound(_0xcf9200,_0x42c990){return function(_0x51243c){if(!_0x51243c){_0xcf9200[_0x6b01('0x14')](0x194);}return _0x51243c;};}function handleError(_0x70a1c0,_0x304393){_0x304393=_0x304393||0x1f4;return function(_0x2ae85e){logger[_0x6b01('0x22')](_0x2ae85e[_0x6b01('0x23')]);if(_0x2ae85e[_0x6b01('0x24')]){delete _0x2ae85e[_0x6b01('0x24')];}_0x70a1c0[_0x6b01('0x19')](_0x304393)[_0x6b01('0x25')](_0x2ae85e);};}exports[_0x6b01('0x26')]=function(_0xa846d8,_0x154dfc){var _0x55ca4b={},_0x33d95d={},_0x220efb={'count':0x0,'rows':[]};var _0x32128f=db[_0x6b01('0x27')][_0x6b01('0x28')];_0x33d95d['model']=_['keys'](_0x32128f);_0x33d95d[_0x6b01('0x29')]=_[_0x6b01('0x2a')](_0xa846d8[_0x6b01('0x29')]);_0x33d95d[_0x6b01('0x2b')]=_[_0x6b01('0x2c')](_0x33d95d[_0x6b01('0x2d')],_0x33d95d['query']);_0x55ca4b[_0x6b01('0x2e')]=_['intersection'](_0x33d95d[_0x6b01('0x2d')],qs['fields'](_0xa846d8[_0x6b01('0x29')][_0x6b01('0x2f')]));_0x55ca4b[_0x6b01('0x2e')]=_0x55ca4b[_0x6b01('0x2e')][_0x6b01('0x30')]?_0x55ca4b['attributes']:_0x33d95d[_0x6b01('0x2d')];if(!_0xa846d8[_0x6b01('0x29')][_0x6b01('0x31')]('nolimit')){_0x55ca4b['limit']=qs[_0x6b01('0x18')](_0xa846d8['query'][_0x6b01('0x18')]);_0x55ca4b[_0x6b01('0x17')]=qs[_0x6b01('0x17')](_0xa846d8['query'][_0x6b01('0x17')]);}_0x55ca4b[_0x6b01('0x32')]=qs[_0x6b01('0x33')](_0xa846d8['query'][_0x6b01('0x33')]);_0x55ca4b[_0x6b01('0x34')]=qs[_0x6b01('0x2b')](_[_0x6b01('0x35')](_0xa846d8[_0x6b01('0x29')],_0x33d95d['filters']));if(_0xa846d8[_0x6b01('0x29')][_0x6b01('0x36')]){_0x55ca4b[_0x6b01('0x34')]=_[_0x6b01('0x37')](_0x55ca4b[_0x6b01('0x34')],{'$or':_[_0x6b01('0x38')](_0x32128f,function(_0x21492c){if(_0x21492c[_0x6b01('0x39')]['key']!==_0x6b01('0x3a')){var _0x530c91={};_0x530c91[_0x21492c[_0x6b01('0x3b')]]={'$like':'%'+_0xa846d8[_0x6b01('0x29')][_0x6b01('0x36')]+'%'};return _0x530c91;}})});}_0x55ca4b=_[_0x6b01('0x37')]({},_0x55ca4b,_0xa846d8[_0x6b01('0x3c')]);var _0x457c93={'where':_0x55ca4b[_0x6b01('0x34')]};return db['FaxApplication'][_0x6b01('0x16')](_0x457c93)[_0x6b01('0x20')](function(_0x2c3385){_0x220efb[_0x6b01('0x16')]=_0x2c3385;if(_0xa846d8[_0x6b01('0x29')][_0x6b01('0x3d')]){_0x55ca4b[_0x6b01('0x3e')]=[{'all':!![]}];}return db[_0x6b01('0x27')]['findAll'](_0x55ca4b);})[_0x6b01('0x20')](function(_0x55907f){_0x220efb[_0x6b01('0x3f')]=_0x55907f;return _0x220efb;})[_0x6b01('0x20')](respondWithFilteredResult(_0x154dfc,_0x55ca4b))['catch'](handleError(_0x154dfc,null));};exports[_0x6b01('0x40')]=function(_0x2e661b,_0x1fa942){var _0x45952a={'raw':!![],'where':{'id':_0x2e661b[_0x6b01('0x41')]['id']}},_0x2d4125={};_0x2d4125[_0x6b01('0x2d')]=_[_0x6b01('0x2a')](db[_0x6b01('0x27')][_0x6b01('0x28')]);_0x2d4125['query']=_[_0x6b01('0x2a')](_0x2e661b[_0x6b01('0x29')]);_0x2d4125['filters']=_['intersection'](_0x2d4125[_0x6b01('0x2d')],_0x2d4125[_0x6b01('0x29')]);_0x45952a['attributes']=_[_0x6b01('0x2c')](_0x2d4125[_0x6b01('0x2d')],qs['fields'](_0x2e661b[_0x6b01('0x29')]['fields']));_0x45952a[_0x6b01('0x2e')]=_0x45952a[_0x6b01('0x2e')][_0x6b01('0x30')]?_0x45952a['attributes']:_0x2d4125[_0x6b01('0x2d')];if(_0x2e661b[_0x6b01('0x29')]['includeAll']){_0x45952a['include']=[{'all':!![]}];}_0x45952a=_['merge']({},_0x45952a,_0x2e661b[_0x6b01('0x3c')]);return db[_0x6b01('0x27')][_0x6b01('0x42')](_0x45952a)[_0x6b01('0x20')](handleEntityNotFound(_0x1fa942,null))[_0x6b01('0x20')](respondWithResult(_0x1fa942,null))[_0x6b01('0x43')](handleError(_0x1fa942,null));};exports['create']=function(_0x362085,_0x1dfe41){return db[_0x6b01('0x27')][_0x6b01('0x44')](_0x362085[_0x6b01('0x45')],{})[_0x6b01('0x20')](respondWithResult(_0x1dfe41,0xc9))['catch'](handleError(_0x1dfe41,null));};exports[_0x6b01('0x46')]=function(_0x58a91a,_0x52b8dd){if(_0x58a91a[_0x6b01('0x45')]['id']){delete _0x58a91a[_0x6b01('0x45')]['id'];}return db['FaxApplication'][_0x6b01('0x42')]({'where':{'id':_0x58a91a[_0x6b01('0x41')]['id']}})[_0x6b01('0x20')](handleEntityNotFound(_0x52b8dd,null))['then'](saveUpdates(_0x58a91a['body'],null))['then'](respondWithResult(_0x52b8dd,null))[_0x6b01('0x43')](handleError(_0x52b8dd,null));};exports[_0x6b01('0x21')]=function(_0x518d94,_0x34cef6){return db['FaxApplication']['find']({'where':{'id':_0x518d94['params']['id']}})[_0x6b01('0x20')](handleEntityNotFound(_0x34cef6,null))[_0x6b01('0x20')](removeEntity(_0x34cef6,null))['catch'](handleError(_0x34cef6,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index bdd84f0..d3554e1 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 _0xee14=['./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3e478c,_0x3afee8){var _0x3a0906=function(_0x580d99){while(--_0x580d99){_0x3e478c['push'](_0x3e478c['shift']());}};_0x3a0906(++_0x3afee8);}(_0xee14,0x13a));var _0x4ee1=function(_0x5e7f59,_0x22acda){_0x5e7f59=_0x5e7f59-0x0;var _0x5d739f=_0xee14[_0x5e7f59];return _0x5d739f;};'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':[],'timestamps':!![],'charset':_0x4ee1('0xc'),'collate':_0x4ee1('0xd')});}; \ No newline at end of file +var _0x25fa=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','./faxApplication.attributes','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x5b77a,_0x54c7f6){var _0x2b9ab4=function(_0x316d79){while(--_0x316d79){_0x5b77a['push'](_0x5b77a['shift']());}};_0x2b9ab4(++_0x54c7f6);}(_0x25fa,0x109));var _0xa25f=function(_0x5826e0,_0xa6395e){_0x5826e0=_0x5826e0-0x0;var _0x1a236e=_0x25fa[_0x5826e0];return _0x1a236e;};'use strict';var _=require(_0xa25f('0x0'));var util=require('util');var logger=require(_0xa25f('0x1'))(_0xa25f('0x2'));var moment=require('moment');var BPromise=require(_0xa25f('0x3'));var rp=require(_0xa25f('0x4'));var fs=require('fs');var path=require(_0xa25f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa25f('0x6'));module['exports']=function(_0x2ea9ea,_0x3ab530){return _0x2ea9ea[_0xa25f('0x7')](_0xa25f('0x8'),attributes,{'tableName':_0xa25f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa25f('0xa'),'collate':_0xa25f('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index a0ae282..430d867 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 _0x2a13=['body','options','raw','limit','UpdateFaxApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','FaxApplication','update'];(function(_0x49b0a1,_0x416298){var _0x41bb72=function(_0x698abf){while(--_0x698abf){_0x49b0a1['push'](_0x49b0a1['shift']());}};_0x41bb72(++_0x416298);}(_0x2a13,0xb9));var _0x32a1=function(_0x928b3d,_0x4ef254){_0x928b3d=_0x928b3d-0x0;var _0x513e61=_0x2a13[_0x928b3d];return _0x513e61;};'use strict';var _=require(_0x32a1('0x0'));var util=require(_0x32a1('0x1'));var moment=require(_0x32a1('0x2'));var BPromise=require(_0x32a1('0x3'));var rs=require(_0x32a1('0x4'));var fs=require('fs');var Redis=require(_0x32a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32a1('0x6'));var logger=require(_0x32a1('0x7'))(_0x32a1('0x8'));var config=require('../../config/environment');var jayson=require(_0x32a1('0x9'));var client=jayson['client'][_0x32a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e1c55,_0x389c02,_0x4ab0f5){return new BPromise(function(_0x4c0ade,_0x135ccd){return client[_0x32a1('0xb')](_0x3e1c55,_0x4ab0f5)[_0x32a1('0xc')](function(_0x2e795a){logger[_0x32a1('0xd')](_0x32a1('0xe'),_0x389c02,_0x32a1('0xf'));logger[_0x32a1('0x10')](_0x32a1('0x11'),_0x389c02,'request\x20sent',JSON[_0x32a1('0x12')](_0x2e795a));if(_0x2e795a['error']){if(_0x2e795a[_0x32a1('0x13')][_0x32a1('0x14')]===0x1f4){logger['error'](_0x32a1('0xe'),_0x389c02,_0x2e795a['error'][_0x32a1('0x15')]);return _0x135ccd(_0x2e795a[_0x32a1('0x13')][_0x32a1('0x15')]);}logger[_0x32a1('0x13')]('FaxApplication,\x20%s,\x20%s',_0x389c02,_0x2e795a['error'][_0x32a1('0x15')]);return _0x4c0ade(_0x2e795a[_0x32a1('0x13')][_0x32a1('0x15')]);}else{logger[_0x32a1('0xd')](_0x32a1('0xe'),_0x389c02,_0x32a1('0xf'));_0x4c0ade(_0x2e795a['result'][_0x32a1('0x15')]);}})[_0x32a1('0x16')](function(_0x104564){logger[_0x32a1('0x13')](_0x32a1('0xe'),_0x389c02,_0x104564);_0x135ccd(_0x104564);});});}exports['UpdateFaxApplication']=function(_0x44f2ec){var _0x400f56=this;return new Promise(function(_0x555498,_0x31c361){return db[_0x32a1('0x17')][_0x32a1('0x18')](_0x44f2ec[_0x32a1('0x19')],{'raw':_0x44f2ec[_0x32a1('0x1a')]?_0x44f2ec[_0x32a1('0x1a')][_0x32a1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f2ec[_0x32a1('0x1a')]?_0x44f2ec[_0x32a1('0x1a')]['where']||null:null,'attributes':_0x44f2ec[_0x32a1('0x1a')]?_0x44f2ec['options']['attributes']||null:null,'limit':_0x44f2ec['options']?_0x44f2ec[_0x32a1('0x1a')][_0x32a1('0x1c')]||null:null})[_0x32a1('0xc')](function(_0xef14bc){logger[_0x32a1('0xd')](_0x32a1('0x1d'),_0x44f2ec);logger[_0x32a1('0x10')](_0x32a1('0x1d'),_0x44f2ec,JSON[_0x32a1('0x12')](_0xef14bc));_0x555498(_0xef14bc);})[_0x32a1('0x16')](function(_0x17b49a){logger[_0x32a1('0x13')](_0x32a1('0x1d'),_0x17b49a[_0x32a1('0x15')],_0x44f2ec);_0x31c361(_0x400f56['error'](0x1f4,_0x17b49a[_0x32a1('0x15')]));});});}; \ No newline at end of file +var _0x74bb=['util','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x74bb,0x9b));var _0xb74b=function(_0x11b43e,_0x5bc5ed){_0x11b43e=_0x11b43e-0x0;var _0x3311f7=_0x74bb[_0x11b43e];return _0x3311f7;};'use strict';var _=require('lodash');var util=require(_0xb74b('0x0'));var moment=require('moment');var BPromise=require(_0xb74b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb74b('0x2'))['db'];var utils=require(_0xb74b('0x3'));var logger=require(_0xb74b('0x4'))('rpc');var config=require(_0xb74b('0x5'));var jayson=require(_0xb74b('0x6'));var client=jayson[_0xb74b('0x7')][_0xb74b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a9d09,_0x1124df,_0x1e0425){return new BPromise(function(_0x4ce517,_0x578670){return client[_0xb74b('0x9')](_0x2a9d09,_0x1e0425)[_0xb74b('0xa')](function(_0x486586){logger[_0xb74b('0xb')]('FaxApplication,\x20%s,\x20%s',_0x1124df,_0xb74b('0xc'));logger[_0xb74b('0xd')](_0xb74b('0xe'),_0x1124df,_0xb74b('0xc'),JSON[_0xb74b('0xf')](_0x486586));if(_0x486586['error']){if(_0x486586[_0xb74b('0x10')][_0xb74b('0x11')]===0x1f4){logger['error']('FaxApplication,\x20%s,\x20%s',_0x1124df,_0x486586[_0xb74b('0x10')][_0xb74b('0x12')]);return _0x578670(_0x486586[_0xb74b('0x10')]['message']);}logger[_0xb74b('0x10')](_0xb74b('0x13'),_0x1124df,_0x486586['error'][_0xb74b('0x12')]);return _0x4ce517(_0x486586[_0xb74b('0x10')][_0xb74b('0x12')]);}else{logger[_0xb74b('0xb')](_0xb74b('0x13'),_0x1124df,_0xb74b('0xc'));_0x4ce517(_0x486586[_0xb74b('0x14')][_0xb74b('0x12')]);}})[_0xb74b('0x15')](function(_0x3f15b5){logger[_0xb74b('0x10')](_0xb74b('0x13'),_0x1124df,_0x3f15b5);_0x578670(_0x3f15b5);});});}exports[_0xb74b('0x16')]=function(_0x10d40d){var _0x554466=this;return new Promise(function(_0x663841,_0x23201f){return db[_0xb74b('0x17')][_0xb74b('0x18')](_0x10d40d[_0xb74b('0x19')],{'raw':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1c')]||null:null,'attributes':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1d')]||null:null,'limit':_0x10d40d[_0xb74b('0x1a')]?_0x10d40d['options'][_0xb74b('0x1e')]||null:null})['then'](function(_0x424367){logger['info']('UpdateFaxApplication',_0x10d40d);logger[_0xb74b('0xd')]('UpdateFaxApplication',_0x10d40d,JSON[_0xb74b('0xf')](_0x424367));_0x663841(_0x424367);})[_0xb74b('0x15')](function(_0x23db2e){logger['error']('UpdateFaxApplication',_0x23db2e[_0xb74b('0x12')],_0x10d40d);_0x23201f(_0x554466[_0xb74b('0x10')](0x1f4,_0x23db2e[_0xb74b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 63fb6dd..df43c64 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 _0x93e9=['show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./faxApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x454838,_0x588a64){var _0x1c0b5e=function(_0x59c187){while(--_0x59c187){_0x454838['push'](_0x454838['shift']());}};_0x1c0b5e(++_0x588a64);}(_0x93e9,0xcc));var _0x993e=function(_0x394e2c,_0x2469a0){_0x394e2c=_0x394e2c-0x0;var _0x552353=_0x93e9[_0x394e2c];return _0x552353;};'use strict';var multer=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var path=require(_0x993e('0x2'));var timeout=require(_0x993e('0x3'));var express=require(_0x993e('0x4'));var router=express[_0x993e('0x5')]();var auth=require(_0x993e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x993e('0x7'));router[_0x993e('0x8')]('/',auth[_0x993e('0x9')](),controller[_0x993e('0xa')]);router[_0x993e('0x8')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xc')]);router['post']('/',auth[_0x993e('0x9')](),controller[_0x993e('0xd')]);router[_0x993e('0xe')](_0x993e('0xb'),auth[_0x993e('0x9')](),controller[_0x993e('0xf')]);router[_0x993e('0x10')]('/:id',auth[_0x993e('0x9')](),controller[_0x993e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x3f8c=['put','update','delete','destroy','exports','path','connect-timeout','express','Router','isAuthenticated','index','get','/:id','show','create'];(function(_0x180b76,_0x561a3e){var _0x1111ae=function(_0x5c6263){while(--_0x5c6263){_0x180b76['push'](_0x180b76['shift']());}};_0x1111ae(++_0x561a3e);}(_0x3f8c,0x104));var _0xc3f8=function(_0x34a5af,_0x3f93d7){_0x34a5af=_0x34a5af-0x0;var _0x5e4357=_0x3f8c[_0x34a5af];return _0x5e4357;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3f8('0x0'));var timeout=require(_0xc3f8('0x1'));var express=require(_0xc3f8('0x2'));var router=express[_0xc3f8('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxApplication.controller');router['get']('/',auth[_0xc3f8('0x4')](),controller[_0xc3f8('0x5')]);router[_0xc3f8('0x6')](_0xc3f8('0x7'),auth[_0xc3f8('0x4')](),controller[_0xc3f8('0x8')]);router['post']('/',auth[_0xc3f8('0x4')](),controller[_0xc3f8('0x9')]);router[_0xc3f8('0xa')](_0xc3f8('0x7'),auth[_0xc3f8('0x4')](),controller[_0xc3f8('0xb')]);router[_0xc3f8('0xc')]('/:id',auth[_0xc3f8('0x4')](),controller[_0xc3f8('0xd')]);module[_0xc3f8('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index b0d467e..ca749c0 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 _0x97b5=['out','exports','DATE','STRING','ENUM'];(function(_0x504097,_0x2351a0){var _0x262a21=function(_0x3647da){while(--_0x3647da){_0x504097['push'](_0x504097['shift']());}};_0x262a21(++_0x2351a0);}(_0x97b5,0x137));var _0x597b=function(_0x44f347,_0x3be1a9){_0x44f347=_0x44f347-0x0;var _0x296219=_0x97b5[_0x44f347];return _0x296219;};'use strict';var Sequelize=require('sequelize');module[_0x597b('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x597b('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x597b('0x2')]},'read1stAt':{'type':Sequelize[_0x597b('0x1')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x597b('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x597b('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x597b('0x3')]('in',_0x597b('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7e0c=['exports','STRING','ENUM','out','DATE','sequelize'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0x7e0c,0xa7));var _0xc7e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e0c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc7e0('0x0'));module[_0xc7e0('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc7e0('0x2')]},'note':{'type':Sequelize[_0xc7e0('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xc7e0('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xc7e0('0x3')]('in',_0xc7e0('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc7e0('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc7e0('0x4')),'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 18b8fff..3bab854 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 _0x390a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','status','end','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','select','field','color','tools_tags','from','fax_messages','me.FaxInteractionId\x20=\x20i.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','fax_interactions','ui.UserId\x20=\x20i.UserId','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','expr','parse','advancedFilter','createdAt','value','dateStart','startOf','day','format','utc','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','Messages.count','isArray','tableAlias','\x20=\x20?','LIKE','c.firstName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','TagId','\x20IN\x20?','c.lastName','map','hasOwnProperty','filter','isNil','isEmpty','forEach','FaxAccountId','i.FaxAccountId\x20IN\x20?','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','QueryTypes','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','toString','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','it.MailInteractionId\x20=\x20i.id','sequelize','count','keyBy','merge','FaxInteraction','a.key','Account.key','i.*','Contact.firstName','c.phone','c.mobile','c.fax','Contact.fax','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.FaxInteractionId\x20IN\x20?','groupBy','split','push','rows','catch','params','includeAll','include','options','find','create','body','describe','addMessage','ids','getMessages','FaxMessage','pick','FaxInteractionId','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','Tag','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','attachments','tmp','interaction-%s.zip','Attachment','mkdirSync','basename','createReadStream','pipe','err','html-pdf'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x390a,0xbe));var _0xa390=function(_0xe46d53,_0x1243f8){_0xe46d53=_0xe46d53-0x0;var _0x2abff7=_0x390a[_0xe46d53];return _0x2abff7;};'use strict';var pdf=require(_0xa390('0x0'));var emlformat=require(_0xa390('0x1'));var rimraf=require(_0xa390('0x2'));var zipdir=require(_0xa390('0x3'));var jsonpatch=require(_0xa390('0x4'));var rp=require(_0xa390('0x5'));var moment=require(_0xa390('0x6'));var BPromise=require(_0xa390('0x7'));var Mustache=require(_0xa390('0x8'));var util=require(_0xa390('0x9'));var path=require(_0xa390('0xa'));var sox=require(_0xa390('0xb'));var csv=require(_0xa390('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa390('0xd'));var squel=require(_0xa390('0xe'));var crypto=require('crypto');var jsforce=require(_0xa390('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa390('0x10'));var Papa=require(_0xa390('0x11'));var Redis=require(_0xa390('0x12'));var authService=require(_0xa390('0x13'));var qs=require(_0xa390('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa390('0x15'))(_0xa390('0x16'));var utils=require('../../config/utils');var config=require(_0xa390('0x17'));var db=require(_0xa390('0x18'))['db'];config[_0xa390('0x19')]=_[_0xa390('0x1a')](config[_0xa390('0x19')],{'host':_0xa390('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa390('0x19')]));require(_0xa390('0x1c'))[_0xa390('0x1d')](socket);function respondWithStatusCode(_0x564acb,_0x531c82){_0x531c82=_0x531c82||0xcc;return function(_0x4453a1){if(_0x4453a1){return _0x564acb['sendStatus'](_0x531c82);}return _0x564acb[_0xa390('0x1e')](_0x531c82)[_0xa390('0x1f')]();};}function respondWithResult(_0x1c4cd3,_0x36b367){_0x36b367=_0x36b367||0xc8;return function(_0x3727e2){if(_0x3727e2){return _0x1c4cd3['status'](_0x36b367)['json'](_0x3727e2);}};}function respondWithFilteredResult(_0x5b1998,_0x33b933){return function(_0x24a45a){if(_0x24a45a){var _0x4f4836=_0x24a45a['count'],_0x30e6ef=_0x33b933[_0xa390('0x20')],_0x15e501=_0x33b933[_0xa390('0x20')]+_0x33b933[_0xa390('0x21')],_0x23ee60;if(_0x15e501>=_0x4f4836){_0x15e501=_0x4f4836;_0x23ee60=0xc8;}else{_0x23ee60=0xce;}_0x5b1998[_0xa390('0x1e')](_0x23ee60);return _0x5b1998[_0xa390('0x22')](_0xa390('0x23'),_0x30e6ef+'-'+_0x15e501+'/'+_0x4f4836)['json'](_0x24a45a);}return null;};}function patchUpdates(_0xba6a8){return function(_0x499fa3){try{jsonpatch[_0xa390('0x24')](_0x499fa3,_0xba6a8,!![]);}catch(_0x2c842e){return BPromise['reject'](_0x2c842e);}return _0x499fa3[_0xa390('0x25')]();};}function saveUpdates(_0x2681ad,_0x5e8cf1){return function(_0x361b2f){if(_0x361b2f){return _0x361b2f[_0xa390('0x26')](_0x2681ad)[_0xa390('0x27')](function(_0x5233bf){return _0x5233bf;});}return null;};}function removeEntity(_0x344fca,_0x1c2c8f){return function(_0x261c9f){if(_0x261c9f){return _0x261c9f[_0xa390('0x28')]()[_0xa390('0x27')](function(){_0x344fca[_0xa390('0x1e')](0xcc)[_0xa390('0x1f')]();});}};}function handleEntityNotFound(_0x3b8ba0,_0x520a94){return function(_0x54e4ed){if(!_0x54e4ed){_0x3b8ba0[_0xa390('0x29')](0x194);}return _0x54e4ed;};}function handleError(_0x54b25f,_0x5af8ef){_0x5af8ef=_0x5af8ef||0x1f4;return function(_0x19f161){logger[_0xa390('0x2a')](_0x19f161[_0xa390('0x2b')]);if(_0x19f161[_0xa390('0x2c')]){delete _0x19f161[_0xa390('0x2c')];}_0x54b25f[_0xa390('0x1e')](_0x5af8ef)['send'](_0x19f161);};}exports[_0xa390('0x2d')]=function(_0x2864d0,_0x56e0a6){var _0x2008d5={},_0x1bd869={},_0x3007b4={'count':0x0,'rows':[]};var _0x3257d8=db['FaxInteraction'][_0xa390('0x2e')];_0x1bd869[_0xa390('0x2f')]=_[_0xa390('0x30')](_0x3257d8);_0x1bd869['query']=_[_0xa390('0x30')](_0x2864d0[_0xa390('0x31')]);_0x1bd869['filters']=_[_0xa390('0x32')](_0x1bd869[_0xa390('0x2f')],_0x1bd869[_0xa390('0x31')]);_0x2008d5[_0xa390('0x33')]=_[_0xa390('0x32')](_0x1bd869[_0xa390('0x2f')],qs[_0xa390('0x34')](_0x2864d0[_0xa390('0x31')][_0xa390('0x34')]));_0x2008d5['attributes']=_0x2008d5[_0xa390('0x33')][_0xa390('0x35')]?_0x2008d5[_0xa390('0x33')]:_0x1bd869[_0xa390('0x2f')];if(!_0x2864d0[_0xa390('0x31')]['hasOwnProperty'](_0xa390('0x36'))){_0x2008d5[_0xa390('0x21')]=qs[_0xa390('0x21')](_0x2864d0[_0xa390('0x31')]['limit']);_0x2008d5[_0xa390('0x20')]=qs[_0xa390('0x20')](_0x2864d0[_0xa390('0x31')]['offset']);}_0x2008d5[_0xa390('0x37')]=qs['sort'](_0x2864d0[_0xa390('0x31')][_0xa390('0x38')]);_0x2008d5[_0xa390('0x39')]=qs[_0xa390('0x3a')](_['pick'](_0x2864d0[_0xa390('0x31')],_0x1bd869[_0xa390('0x3a')]));var _0x32a423=[];var _0x4236ef=squel[_0xa390('0x3b')]()[_0xa390('0x3c')]('id')['field'](_0xa390('0x2c'))[_0xa390('0x3c')](_0xa390('0x3d'))['from'](_0xa390('0x3e'));var _0xfb63cf=squel[_0xa390('0x3b')]()[_0xa390('0x3c')]('COUNT(*)')[_0xa390('0x3f')](_0xa390('0x40'),'me')[_0xa390('0x39')](_0xa390('0x41'))['where']('me.direction\x20=\x20\x27in\x27')['where']('me.read\x20=\x20false');var _0x111f6a=squel[_0xa390('0x3b')]()[_0xa390('0x3c')]('u.id')['field'](_0xa390('0x42'))[_0xa390('0x3f')](_0xa390('0x43'),'ui')[_0xa390('0x44')](_0xa390('0x45'),'u','u.id\x20=\x20ui.UserId');var _0x3b5fbd=squel[_0xa390('0x3b')]()['from'](_0xa390('0x46'),'i')['left_join']('user_has_fax_interactions','ui',_0xa390('0x47'))['left_join']('users','u',_0xa390('0x48'))[_0xa390('0x44')]('cm_contacts','c',_0xa390('0x49'))[_0xa390('0x44')]('users','o',_0xa390('0x4a'))[_0xa390('0x44')](_0xa390('0x4b'),'a',_0xa390('0x4c'))[_0xa390('0x44')](_0xa390('0x40'),'me',_0xa390('0x41'));var _0xf6841e=squel[_0xa390('0x4d')]();if(_0x2864d0[_0xa390('0x31')]['advancedFilter']){var _0x5616ac=JSON[_0xa390('0x4e')](_0x2864d0[_0xa390('0x31')][_0xa390('0x4f')]);_['keys'](_0x5616ac)['forEach'](function(_0x358bb1){var _0x1993f4=_0x5616ac[_0x358bb1];if(_0x358bb1===_0xa390('0x50')){var _0x38b647=moment(_0x1993f4[_0xa390('0x51')][_0xa390('0x52')])[_0xa390('0x53')](_0xa390('0x54'))['utc']()[_0xa390('0x55')]();var _0x3948ef=moment(_0x3948ef)[_0xa390('0x56')]()['endOf']('day')['format']();_0xf6841e[_0xa390('0x57')](_0xa390('0x58'),_0x38b647,_0x3948ef);}else{if(_['isArray'](_0x1993f4[_0xa390('0x59')])){_0x1993f4[_0xa390('0x59')]['forEach'](function(_0x2c1ab6){switch(_0x1993f4[_0xa390('0x59')]['value']){case'IS':if(_0x358bb1!=='TagId'&&_0x358bb1!==_0xa390('0x5a')){if(_[_0xa390('0x5b')](_0x1993f4[_0xa390('0x51')])&&_0x1993f4['value']['length']>0x1){_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+'\x20IN\x20?',_0x1993f4['value']);}else{_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+_0xa390('0x5d'),_0x1993f4['value'][0x0]);}}break;case'=':_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+'\x20=\x20?',_0x1993f4[_0xa390('0x51')]);break;case _0xa390('0x5e'):if(_0x358bb1==='ContactId'){_0xf6841e[_0xa390('0x57')](_0xa390('0x5f')+_0xa390('0x60'),'%'+_0x1993f4[_0xa390('0x51')]+'%');_0xf6841e['or']('c.lastName'+_0xa390('0x60'),'%'+_0x1993f4[_0xa390('0x51')]+'%');_0xf6841e['or'](_0xa390('0x61')+'\x20LIKE\x20?','%'+_0x1993f4[_0xa390('0x51')]+'%');}else{_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+_0xa390('0x60'),'%'+_0x1993f4[_0xa390('0x51')]+'%');}break;case'>':_0xf6841e[_0xa390('0x57')](_0x1993f4['tableAlias']+'.'+_0x358bb1+_0xa390('0x62'),_0x1993f4[_0xa390('0x51')]);break;case'<':_0xf6841e['and'](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+_0xa390('0x63'),_0x1993f4['value']);break;}});}else{switch(_0x1993f4[_0xa390('0x59')]['value']){case'IS':if(_0x358bb1!==_0xa390('0x64')&&_0x358bb1!==_0xa390('0x5a')){if(_['isArray'](_0x1993f4[_0xa390('0x51')])&&_0x1993f4[_0xa390('0x51')][_0xa390('0x35')]>0x1){_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+_0xa390('0x65'),_0x1993f4['value']);}else{_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+_0xa390('0x5d'),_0x1993f4[_0xa390('0x51')][0x0]);}}break;case'=':_0xf6841e[_0xa390('0x57')](_0x1993f4['tableAlias']+'.'+_0x358bb1+_0xa390('0x5d'),_0x1993f4['value']);break;case _0xa390('0x5e'):if(_0x358bb1==='ContactId'){_0xf6841e[_0xa390('0x57')]('c.firstName'+'\x20LIKE\x20?','%'+_0x1993f4['value']+'%');_0xf6841e['or'](_0xa390('0x66')+'\x20LIKE\x20?','%'+_0x1993f4[_0xa390('0x51')]+'%');_0xf6841e['or'](_0xa390('0x61')+_0xa390('0x60'),'%'+_0x1993f4[_0xa390('0x51')]+'%');}else{_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+_0xa390('0x60'),'%'+_0x1993f4['value']+'%');}break;case'>':_0xf6841e[_0xa390('0x57')](_0x1993f4[_0xa390('0x5c')]+'.'+_0x358bb1+_0xa390('0x62'),_0x1993f4[_0xa390('0x51')]);break;case'<':_0xf6841e[_0xa390('0x57')](_0x1993f4['tableAlias']+'.'+_0x358bb1+'\x20<\x20?',_0x1993f4[_0xa390('0x51')]);break;}}}});}else{var _0x4d8b84=_(Object[_0xa390('0x30')](_0x2864d0['query']))[_0xa390('0x67')](function(_0x3c0ad0){return _0x3257d8[_0xa390('0x68')](_0x3c0ad0)?_0x3c0ad0:undefined;})[_0xa390('0x69')](function(_0x16a7ee){return!_[_0xa390('0x6a')](_0x16a7ee);})['value']();if(!_[_0xa390('0x6b')](_0x4d8b84)){_0x4d8b84[_0xa390('0x6c')](function(_0x3b4e0f){if(_0x3b4e0f===_0xa390('0x6d')){_0x3b5fbd[_0xa390('0x39')](_0xa390('0x6e'),[]['concat'](_0x2864d0['query'][_0x3b4e0f]));}else if(_0x3b4e0f===_0xa390('0x50')){var _0x23a6fe=JSON[_0xa390('0x4e')](_0x2864d0['query'][_0x3b4e0f])['$gte'];var _0x40374a=JSON['parse'](_0x2864d0['query'][_0x3b4e0f])['$lte'];_0x3b5fbd[_0xa390('0x39')](_0xa390('0x58'),_0x23a6fe,_0x40374a);}else{_0x3b5fbd[_0xa390('0x39')]('i.'+_0x3b4e0f+_0xa390('0x5d'),_0x2864d0['query'][_0x3b4e0f]);}});}if(_0x2864d0['query'][_0xa390('0x69')]){var _0x5db7eb=_0x2864d0[_0xa390('0x31')][_0xa390('0x69')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xa390('0x6f'));if(qs[_0xa390('0x70')](_0x5db7eb)){_0xf6841e['or']('i.id\x20LIKE\x20?',_0x5db7eb+'%')['or'](_0xa390('0x71'),_0x5db7eb+'%');}_0xf6841e['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5db7eb+'%');}}_0x3b5fbd['where'](_0xf6841e);if(_0x2008d5[_0xa390('0x37')]){_0x2008d5[_0xa390('0x37')][_0xa390('0x6c')](function(_0x4e29aa){_0x3b5fbd[_0xa390('0x37')]('i.'+_0x4e29aa[0x0],_0x4e29aa[0x1]==='DESC'?![]:!![]);});}_0x3b5fbd['group']('i.id');var _0x13ab2a={'type':db['Sequelize'][_0xa390('0x72')][_0xa390('0x73')],'raw':!![]};var _0x2ed2e2=_0x3b5fbd[_0xa390('0x74')]()[_0xa390('0x3c')]('COUNT(*)');if(!_0x2864d0[_0xa390('0x31')][_0xa390('0x4f')]){if(_0x2864d0[_0xa390('0x31')][_0xa390('0x75')]){if(_0x2864d0[_0xa390('0x31')][_0xa390('0x75')]==0x1){_0x2ed2e2['where'](util['format'](_0xa390('0x76'),_0xfb63cf['toString']()));_0x3b5fbd[_0xa390('0x77')](_0xa390('0x78'));}else{_0x2ed2e2[_0xa390('0x39')](util[_0xa390('0x55')](_0xa390('0x79'),_0xfb63cf[_0xa390('0x7a')]()));_0x3b5fbd[_0xa390('0x77')](_0xa390('0x7b'));}}if(_0x2864d0[_0xa390('0x31')][_0xa390('0x7c')]){var _0x27e3bb=_[_0xa390('0x5b')](_0x2864d0[_0xa390('0x31')][_0xa390('0x7c')])?_0x2864d0[_0xa390('0x31')]['tag']:new Array(_0x2864d0['query']['tag']);var _0x562f7e=squel[_0xa390('0x4d')]();_0x27e3bb[_0xa390('0x6c')](function(_0x2dc39d){_0x562f7e['or'](_0xa390('0x7d'),'%,'+_0x2dc39d+',%');});_0x3b5fbd[_0xa390('0x77')](_0x562f7e);_0x2ed2e2[_0xa390('0x44')](_0xa390('0x7e'),'it',_0xa390('0x7f'));_0x2ed2e2[_0xa390('0x44')](_0xa390('0x3e'),'t',_0xa390('0x80'));_0x2ed2e2[_0xa390('0x39')](_0xa390('0x81'),_0x27e3bb);}}else{var _0x5616ac=JSON[_0xa390('0x4e')](_0x2864d0[_0xa390('0x31')]['advancedFilter']);_[_0xa390('0x30')](_0x5616ac)[_0xa390('0x6c')](function(_0x36b554){var _0x5015fa=_0x5616ac[_0x36b554];if(_0x36b554===_0xa390('0x64')){var _0x2f7099=_0x5015fa[_0xa390('0x51')];var _0x1f20b5=squel[_0xa390('0x4d')]();_0x2f7099[_0xa390('0x6c')](function(_0x4d0587){_0x1f20b5['or'](_0xa390('0x7d'),'%,'+_0x4d0587+',%');});_0x3b5fbd['having'](_0x1f20b5);_0x2ed2e2['left_join']('mail_interaction_has_tags','it',_0xa390('0x82'));_0x2ed2e2[_0xa390('0x44')]('tools_tags','t',_0xa390('0x80'));_0x2ed2e2[_0xa390('0x39')]('t.id\x20IN\x20?',_0x2f7099);}else if(_0x36b554==='Messages.count'){if(_0x5015fa[_0xa390('0x51')]['length']===0x1){if(_0x5015fa[_0xa390('0x51')][0x0]===0x1){_0x2ed2e2[_0xa390('0x39')](util['format']('%s\x20=\x200',_0xfb63cf[_0xa390('0x7a')]()));_0x3b5fbd['having'](_0xa390('0x78'));}else{_0x2ed2e2['where'](util[_0xa390('0x55')](_0xa390('0x79'),_0xfb63cf[_0xa390('0x7a')]()));_0x3b5fbd[_0xa390('0x77')]('`Messages.count`\x20>\x200');}}}});}db[_0xa390('0x83')][_0xa390('0x31')](_0x2ed2e2[_0xa390('0x7a')](),_0x13ab2a)[_0xa390('0x27')](function(_0x11299e){_0x3007b4[_0xa390('0x84')]=_0x11299e[_0xa390('0x35')];if(_0x3007b4[_0xa390('0x84')]===0x0)return[];return db[_0xa390('0x83')][_0xa390('0x31')](_0x4236ef[_0xa390('0x7a')](),_0x13ab2a)[_0xa390('0x27')](function(_0x4e1ea7){_0x32a423=_[_0xa390('0x85')](_0x4e1ea7,'id');_0x13ab2a=_[_0xa390('0x86')](_0x13ab2a,{'model':db[_0xa390('0x87')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3b5fbd[_0xa390('0x3c')](_0xfb63cf,_0xa390('0x5a'));_0x3b5fbd[_0xa390('0x3c')](_0xa390('0x88'),_0xa390('0x89'));_0x3b5fbd[_0xa390('0x3c')](_0xa390('0x8a'));_0x3b5fbd[_0xa390('0x3c')](_0xa390('0x5f'),_0xa390('0x8b'));_0x3b5fbd[_0xa390('0x3c')]('c.lastName','Contact.lastName');_0x3b5fbd['field'](_0xa390('0x61'),'Contact.email');_0x3b5fbd[_0xa390('0x3c')](_0xa390('0x8c'),'Contact.phone');_0x3b5fbd[_0xa390('0x3c')](_0xa390('0x8d'),'Contact.mobile');_0x3b5fbd[_0xa390('0x3c')](_0xa390('0x8e'),_0xa390('0x8f'));_0x3b5fbd[_0xa390('0x3c')]('u.fullname',_0xa390('0x90'));_0x3b5fbd[_0xa390('0x3c')](_0xa390('0x91'),_0xa390('0x92'));_0x3b5fbd[_0xa390('0x44')]('fax_interaction_has_tags','it',_0xa390('0x7f'));_0x3b5fbd['left_join'](_0xa390('0x3e'),'t',_0xa390('0x80'));_0x3b5fbd[_0xa390('0x21')](_0x2008d5[_0xa390('0x21')]);_0x3b5fbd[_0xa390('0x20')](_0x2008d5[_0xa390('0x20')]);return db[_0xa390('0x83')]['query'](_0x3b5fbd[_0xa390('0x7a')](),_0x13ab2a);})[_0xa390('0x27')](function(_0x1ef206){_0x111f6a[_0xa390('0x39')](_0xa390('0x93'),_[_0xa390('0x67')](_0x1ef206,'id'));return db[_0xa390('0x83')]['query'](_0x111f6a[_0xa390('0x7a')](),_0x13ab2a)['then'](function(_0x4d9c04){var _0xd40c95=_[_0xa390('0x94')](_0x4d9c04,'FaxInteractionId');_0x1ef206[_0xa390('0x6c')](function(_0x97fe21){if(_0xd40c95[_0x97fe21['id']]){_0x97fe21['Users']=_[_0xa390('0x67')](_0xd40c95[_0x97fe21['id']],function(_0x2c9842){return{'id':_0x2c9842['id']};});}if(_0x97fe21[_0xa390('0x92')]){_0x97fe21['Tags']=[];_0x97fe21[_0xa390('0x92')][_0xa390('0x95')](',')[_0xa390('0x6c')](function(_0x38482d){_0x97fe21['Tags'][_0xa390('0x96')](_0x32a423[_0x38482d]);});}delete _0x97fe21[_0xa390('0x92')];});return _0x1ef206;});});})['then'](function(_0x4b2fc2){_0x3007b4[_0xa390('0x97')]=_0x4b2fc2;return _0x3007b4;})[_0xa390('0x27')](respondWithFilteredResult(_0x56e0a6,_0x2008d5))[_0xa390('0x98')](handleError(_0x56e0a6,null));};exports['show']=function(_0x136af0,_0x18dbdd){var _0x2c5882={'raw':![],'where':{'id':_0x136af0[_0xa390('0x99')]['id']}},_0x367bea={};_0x367bea[_0xa390('0x2f')]=_[_0xa390('0x30')](db[_0xa390('0x87')][_0xa390('0x2e')]);_0x367bea['query']=_['keys'](_0x136af0[_0xa390('0x31')]);_0x367bea['filters']=_[_0xa390('0x32')](_0x367bea[_0xa390('0x2f')],_0x367bea['query']);_0x2c5882[_0xa390('0x33')]=_[_0xa390('0x32')](_0x367bea[_0xa390('0x2f')],qs['fields'](_0x136af0['query'][_0xa390('0x34')]));_0x2c5882[_0xa390('0x33')]=_0x2c5882[_0xa390('0x33')][_0xa390('0x35')]?_0x2c5882['attributes']:_0x367bea[_0xa390('0x2f')];if(_0x136af0[_0xa390('0x31')][_0xa390('0x9a')]){_0x2c5882[_0xa390('0x9b')]=[{'all':!![]}];}_0x2c5882=_[_0xa390('0x86')]({},_0x2c5882,_0x136af0[_0xa390('0x9c')]);return db[_0xa390('0x87')][_0xa390('0x9d')](_0x2c5882)['then'](handleEntityNotFound(_0x18dbdd,null))[_0xa390('0x27')](respondWithResult(_0x18dbdd,null))['catch'](handleError(_0x18dbdd,null));};exports[_0xa390('0x9e')]=function(_0x1b716b,_0x48558f){return db['FaxInteraction'][_0xa390('0x9e')](_0x1b716b[_0xa390('0x9f')],{})[_0xa390('0x27')](respondWithResult(_0x48558f,0xc9))[_0xa390('0x98')](handleError(_0x48558f,null));};exports['update']=function(_0x3df22b,_0x5b59c5){if(_0x3df22b[_0xa390('0x9f')]['id']){delete _0x3df22b[_0xa390('0x9f')]['id'];}return db[_0xa390('0x87')][_0xa390('0x9d')]({'where':{'id':_0x3df22b[_0xa390('0x99')]['id']}})[_0xa390('0x27')](handleEntityNotFound(_0x5b59c5,null))[_0xa390('0x27')](saveUpdates(_0x3df22b[_0xa390('0x9f')],null))[_0xa390('0x27')](respondWithResult(_0x5b59c5,null))[_0xa390('0x98')](handleError(_0x5b59c5,null));};exports[_0xa390('0x28')]=function(_0x45919e,_0x319f23){return db[_0xa390('0x87')][_0xa390('0x9d')]({'where':{'id':_0x45919e[_0xa390('0x99')]['id']}})[_0xa390('0x27')](handleEntityNotFound(_0x319f23,null))[_0xa390('0x27')](removeEntity(_0x319f23,null))['catch'](handleError(_0x319f23,null));};exports[_0xa390('0xa0')]=function(_0x40598e,_0x350cf3){return db[_0xa390('0x87')][_0xa390('0xa0')]()[_0xa390('0x27')](respondWithResult(_0x350cf3,null))['catch'](handleError(_0x350cf3,null));};exports['addMessage']=function(_0x5737d7,_0x20ab48,_0x3f6cfb){return db['FaxMessage'][_0xa390('0x9d')]({'where':{'id':_0x5737d7[_0xa390('0x99')]['id']}})[_0xa390('0x27')](handleEntityNotFound(_0x20ab48,null))['then'](function(_0x4c3291){if(_0x4c3291){return _0x4c3291[_0xa390('0xa1')](_0x5737d7[_0xa390('0x9f')]['ids'],_['omit'](_0x5737d7[_0xa390('0x9f')],[_0xa390('0xa2'),'id'])||{});}})['then'](respondWithResult(_0x20ab48,null))[_0xa390('0x98')](handleError(_0x20ab48,null));};exports[_0xa390('0xa3')]=function(_0xe1fb33,_0x2748ae,_0x3dcfa6){var _0x16f8fd={'raw':![],'where':{}};var _0x3299a1={};var _0x4925cd={'count':0x0,'rows':[]};return db['FaxInteraction']['findOne']({'where':{'id':_0xe1fb33[_0xa390('0x99')]['id']}})['then'](handleEntityNotFound(_0x2748ae,null))[_0xa390('0x27')](function(_0x32f388){if(_0x32f388){_0x3299a1[_0xa390('0x2f')]=_[_0xa390('0x30')](db[_0xa390('0xa4')][_0xa390('0x2e')]);_0x3299a1['query']=_['keys'](_0xe1fb33[_0xa390('0x31')]);_0x3299a1[_0xa390('0x3a')]=_[_0xa390('0x32')](_0x3299a1[_0xa390('0x2f')],_0x3299a1[_0xa390('0x31')]);_0x16f8fd['attributes']=_[_0xa390('0x32')](_0x3299a1['model'],qs['fields'](_0xe1fb33[_0xa390('0x31')][_0xa390('0x34')]));_0x16f8fd[_0xa390('0x33')]=_0x16f8fd[_0xa390('0x33')]['length']?_0x16f8fd[_0xa390('0x33')]:_0x3299a1[_0xa390('0x2f')];if(!_0xe1fb33[_0xa390('0x31')]['hasOwnProperty']('nolimit')){_0x16f8fd['limit']=qs[_0xa390('0x21')](_0xe1fb33['query'][_0xa390('0x21')]);_0x16f8fd[_0xa390('0x20')]=qs[_0xa390('0x20')](_0xe1fb33[_0xa390('0x31')]['offset']);}_0x16f8fd['order']=qs[_0xa390('0x38')](_0xe1fb33[_0xa390('0x31')][_0xa390('0x38')]);_0x16f8fd[_0xa390('0x39')]=qs['filters'](_[_0xa390('0xa5')](_0xe1fb33[_0xa390('0x31')],_0x3299a1[_0xa390('0x3a')]));_0x16f8fd[_0xa390('0x39')][_0xa390('0xa6')]=_0x32f388['id'];if(_0xe1fb33[_0xa390('0x31')]['filter']){_0x16f8fd['where']=_[_0xa390('0x86')](_0x16f8fd[_0xa390('0x39')],{'$or':_[_0xa390('0x67')](_0x16f8fd[_0xa390('0x33')],function(_0x1b6537){var _0x53483f={};_0x53483f[_0x1b6537]={'$like':'%'+_0xe1fb33[_0xa390('0x31')][_0xa390('0x69')]+'%'};return _0x53483f;})});}if(_0xe1fb33[_0xa390('0x31')][_0xa390('0xa7')]){var _0x2c14ec=_0xe1fb33[_0xa390('0x31')][_0xa390('0xa7')][_0xa390('0x95')](',');var _0x7a33ac={};_0x7a33ac[_0x2c14ec[0x0]]={'$gte':moment(_0x2c14ec[0x1])[_0xa390('0x55')](_0xa390('0xa8'))};_0x16f8fd[_0xa390('0x39')]=_['merge'](_0x16f8fd[_0xa390('0x39')],_0x7a33ac);}_0x16f8fd=_[_0xa390('0x86')]({},_0x16f8fd,_0xe1fb33[_0xa390('0x9c')]);return db[_0xa390('0xa4')][_0xa390('0x84')]({'where':_0x16f8fd[_0xa390('0x39')]})[_0xa390('0x27')](function(_0x5950b5){_0x4925cd[_0xa390('0x84')]=_0x5950b5;if(_0xe1fb33[_0xa390('0x31')][_0xa390('0x9a')]){_0x16f8fd[_0xa390('0x9b')]=[{'all':!![]}];}return db['FaxMessage'][_0xa390('0xa9')](_0x16f8fd);})[_0xa390('0x27')](function(_0x8a3cac){_0x4925cd[_0xa390('0x97')]=_0x8a3cac;return _0x4925cd;});}})[_0xa390('0x27')](respondWithFilteredResult(_0x2748ae,_0x16f8fd))[_0xa390('0x98')](handleError(_0x2748ae,null));};exports[_0xa390('0xaa')]=function(_0x362ba8,_0x4afda9,_0x2f8c7b){return db[_0xa390('0x87')]['find']({'where':{'id':_0x362ba8[_0xa390('0x99')]['id']}})[_0xa390('0x27')](handleEntityNotFound(_0x4afda9,null))[_0xa390('0x27')](function(_0x3931a1){if(_0x3931a1){return _0x3931a1[_0xa390('0xab')](_0x362ba8[_0xa390('0x9f')][_0xa390('0xa2')],_[_0xa390('0xac')](_0x362ba8[_0xa390('0x9f')],[_0xa390('0xa2'),'id'])||{})['spread'](function(){return db[_0xa390('0xad')][_0xa390('0xa9')]({'attributes':['id',_0xa390('0x2c'),'color'],'where':{'id':_0x362ba8[_0xa390('0x9f')][_0xa390('0xa2')]}});})[_0xa390('0x27')](function(_0x489fb5){socket[_0xa390('0xae')](_0xa390('0xaf'),{'id':Number(_0x362ba8['params']['id']),'tags':_0x489fb5||[]});return{'id':Number(_0x362ba8[_0xa390('0x99')]['id']),'tags':_0x489fb5||[]};});}})[_0xa390('0x27')](respondWithResult(_0x4afda9,null))['catch'](handleError(_0x4afda9,null));};exports[_0xa390('0xb0')]=function(_0x93e61f,_0x4885d6,_0x27e138){return db[_0xa390('0x87')][_0xa390('0x9d')]({'where':{'id':_0x93e61f[_0xa390('0x99')]['id']}})[_0xa390('0x27')](handleEntityNotFound(_0x4885d6,null))[_0xa390('0x27')](function(_0x56928f){if(_0x56928f){return _0x56928f[_0xa390('0xb0')](_0x93e61f[_0xa390('0x31')][_0xa390('0xa2')]);}})['then'](respondWithStatusCode(_0x4885d6,null))[_0xa390('0x98')](handleError(_0x4885d6,null));};exports[_0xa390('0xb1')]=function(_0x428553,_0x1c8cec){var _0x48366d=moment()[_0xa390('0xb2')]()['toString']();var _0x273d89=path[_0xa390('0xb3')](config['root'],_0xa390('0xb4'),_0xa390('0xb5'),_0xa390('0xb6'));var _0x45544e=path['join'](config['root'],'server',_0xa390('0xb5'),_0xa390('0xb7'));var _0x4364a4=path['join'](_0x45544e,_0x48366d);var _0x41dec1=util[_0xa390('0x55')](_0xa390('0xb8'),_0x48366d);var _0x1911b4=path[_0xa390('0xb3')](_0x45544e,_0x41dec1);var _0x186353=![];return db[_0xa390('0x87')][_0xa390('0x9d')]({'where':{'id':_0x428553['params']['id']}})[_0xa390('0x27')](handleEntityNotFound(_0x1c8cec,null))[_0xa390('0x27')](function(_0x18f4d5){if(_0x18f4d5){return _0x18f4d5[_0xa390('0xa3')]({'attributes':['id',_0xa390('0x9f'),_0xa390('0x50')],'include':[{'model':db[_0xa390('0xb9')],'as':_0xa390('0xb9')}]});}return[];})[_0xa390('0x27')](function(_0x4796ae){_0x186353=_0x4796ae[_0xa390('0x35')];if(_0x4796ae['length']){fs[_0xa390('0xba')](_0x4364a4);for(var _0x66b968=0x0;_0x66b968<_0x4796ae[_0xa390('0x35')];_0x66b968++){var _0x585624=_0x4796ae[_0x66b968];var _0x259e8d=_0x585624[_0xa390('0xb9')];if(_0x259e8d){var _0xd5d9de=path['join'](_0x273d89,_0x259e8d[_0xa390('0xbb')]);if(fs['existsSync'](_0xd5d9de)){fs[_0xa390('0xbc')](_0xd5d9de)[_0xa390('0xbd')](fs['createWriteStream'](path[_0xa390('0xb3')](_0x4364a4,_0x259e8d[_0xa390('0xbb')])));}}}}})[_0xa390('0x27')](function(){if(_0x186353){return new BPromise(function(_0x253966,_0x3d817a){zipdir(_0x4364a4,{'saveTo':_0x1911b4},function(_0x37b5e2,_0x138d52){if(_0x37b5e2)return _0x3d817a(_0x37b5e2);return _0x253966(_0x138d52);});});}})['then'](function(){if(_0x186353){return new BPromise(function(_0xb1813c,_0x2adfd8){rimraf(_0x4364a4,function(_0x72333b){if(_0x72333b)_0x2adfd8(_0x72333b);return _0xb1813c();});});}})[_0xa390('0x27')](function(){if(_0x186353){return _0x1c8cec[_0xa390('0xb1')](_0x1911b4,_0x41dec1,function(_0x24d1b4){if(_0x24d1b4){console['log'](_0xa390('0xbe'),_0x24d1b4);}else{fs['unlinkSync'](_0x1911b4);}});}else{return _0x1c8cec[_0xa390('0x29')](0xc8);}})[_0xa390('0x98')](handleError(_0x1c8cec,null));}; \ No newline at end of file +var _0x2bde=['body','destroy','describe','FaxMessage','addMessage','omit','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','setTags','ids','spread','Tag','emit','faxInteractionTags:save','removeTags','download','join','files','attachments','server','tmp','interaction-%s.zip','createdAt','Attachment','basename','createReadStream','pipe','createWriteStream','log','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','FaxInteraction','rawAttributes','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','pick','select','field','color','from','COUNT(*)','fax_messages','where','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','user_has_fax_interactions','cm_contacts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','expr','advancedFilter','parse','forEach','value','dateStart','day','utc','format','endOf','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','TagId','length','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','\x20>\x20?','Messages.count','c.lastName','\x20<\x20?','map','isNil','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','$lte','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','i.id','Sequelize','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','toString','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','`Messages.count`\x20>\x200','sequelize','merge','a.key','Account.key','i.*','Contact.firstName','Contact.lastName','c.email','Contact.email','c.mobile','c.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','t.id\x20=\x20it.TagId','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','Users','Tags','split','push','rows','show','params','includeAll','include','find','catch','create'];(function(_0x3c37cb,_0xe44e){var _0xa1e8ec=function(_0x3a1644){while(--_0x3a1644){_0x3c37cb['push'](_0x3c37cb['shift']());}};_0xa1e8ec(++_0xe44e);}(_0x2bde,0x1b3));var _0xe2bd=function(_0x12e3e3,_0x501eaf){_0x12e3e3=_0x12e3e3-0x0;var _0x26602e=_0x2bde[_0x12e3e3];return _0x26602e;};'use strict';var pdf=require(_0xe2bd('0x0'));var emlformat=require(_0xe2bd('0x1'));var rimraf=require(_0xe2bd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe2bd('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2bd('0x4'));var Mustache=require(_0xe2bd('0x5'));var util=require(_0xe2bd('0x6'));var path=require(_0xe2bd('0x7'));var sox=require(_0xe2bd('0x8'));var csv=require(_0xe2bd('0x9'));var ejs=require(_0xe2bd('0xa'));var fs=require('fs');var _=require(_0xe2bd('0xb'));var squel=require(_0xe2bd('0xc'));var crypto=require(_0xe2bd('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe2bd('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe2bd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe2bd('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2bd('0x11'))(_0xe2bd('0x12'));var utils=require(_0xe2bd('0x13'));var config=require('../../config/environment');var db=require(_0xe2bd('0x14'))['db'];config[_0xe2bd('0x15')]=_[_0xe2bd('0x16')](config[_0xe2bd('0x15')],{'host':_0xe2bd('0x17'),'port':0x18eb});var socket=require(_0xe2bd('0x18'))(new Redis(config['redis']));require(_0xe2bd('0x19'))[_0xe2bd('0x1a')](socket);function respondWithStatusCode(_0x328936,_0x30e48a){_0x30e48a=_0x30e48a||0xcc;return function(_0x191a89){if(_0x191a89){return _0x328936[_0xe2bd('0x1b')](_0x30e48a);}return _0x328936[_0xe2bd('0x1c')](_0x30e48a)[_0xe2bd('0x1d')]();};}function respondWithResult(_0xea33cf,_0x47c919){_0x47c919=_0x47c919||0xc8;return function(_0x254ac5){if(_0x254ac5){return _0xea33cf[_0xe2bd('0x1c')](_0x47c919)['json'](_0x254ac5);}};}function respondWithFilteredResult(_0x582351,_0x204a81){return function(_0x17d147){if(_0x17d147){var _0x1e0be2=_0x17d147[_0xe2bd('0x1e')],_0x288d87=_0x204a81[_0xe2bd('0x1f')],_0x5b71c7=_0x204a81[_0xe2bd('0x1f')]+_0x204a81['limit'],_0x27f8f0;if(_0x5b71c7>=_0x1e0be2){_0x5b71c7=_0x1e0be2;_0x27f8f0=0xc8;}else{_0x27f8f0=0xce;}_0x582351[_0xe2bd('0x1c')](_0x27f8f0);return _0x582351[_0xe2bd('0x20')](_0xe2bd('0x21'),_0x288d87+'-'+_0x5b71c7+'/'+_0x1e0be2)['json'](_0x17d147);}return null;};}function patchUpdates(_0xd412d9){return function(_0x16fb5b){try{jsonpatch[_0xe2bd('0x22')](_0x16fb5b,_0xd412d9,!![]);}catch(_0x2883ba){return BPromise[_0xe2bd('0x23')](_0x2883ba);}return _0x16fb5b[_0xe2bd('0x24')]();};}function saveUpdates(_0x5433fe,_0x27b1c2){return function(_0x14edbb){if(_0x14edbb){return _0x14edbb[_0xe2bd('0x25')](_0x5433fe)[_0xe2bd('0x26')](function(_0x16cba9){return _0x16cba9;});}return null;};}function removeEntity(_0x499e51,_0x2bf7ee){return function(_0xddfdc9){if(_0xddfdc9){return _0xddfdc9['destroy']()['then'](function(){_0x499e51[_0xe2bd('0x1c')](0xcc)[_0xe2bd('0x1d')]();});}};}function handleEntityNotFound(_0x47918b,_0x32fee7){return function(_0x2847ed){if(!_0x2847ed){_0x47918b[_0xe2bd('0x1b')](0x194);}return _0x2847ed;};}function handleError(_0x5158e9,_0x4b61a8){_0x4b61a8=_0x4b61a8||0x1f4;return function(_0x29caaf){logger[_0xe2bd('0x27')](_0x29caaf[_0xe2bd('0x28')]);if(_0x29caaf[_0xe2bd('0x29')]){delete _0x29caaf[_0xe2bd('0x29')];}_0x5158e9[_0xe2bd('0x1c')](_0x4b61a8)[_0xe2bd('0x2a')](_0x29caaf);};}exports[_0xe2bd('0x2b')]=function(_0xbe448a,_0x2416c4){var _0x1d10eb={},_0x4e0640={},_0x3e3ab7={'count':0x0,'rows':[]};var _0x2cb5d8=db[_0xe2bd('0x2c')][_0xe2bd('0x2d')];_0x4e0640[_0xe2bd('0x2e')]=_[_0xe2bd('0x2f')](_0x2cb5d8);_0x4e0640['query']=_[_0xe2bd('0x2f')](_0xbe448a['query']);_0x4e0640[_0xe2bd('0x30')]=_['intersection'](_0x4e0640['model'],_0x4e0640[_0xe2bd('0x31')]);_0x1d10eb[_0xe2bd('0x32')]=_[_0xe2bd('0x33')](_0x4e0640[_0xe2bd('0x2e')],qs[_0xe2bd('0x34')](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x34')]));_0x1d10eb['attributes']=_0x1d10eb[_0xe2bd('0x32')]['length']?_0x1d10eb[_0xe2bd('0x32')]:_0x4e0640['model'];if(!_0xbe448a['query'][_0xe2bd('0x35')](_0xe2bd('0x36'))){_0x1d10eb['limit']=qs[_0xe2bd('0x37')](_0xbe448a['query']['limit']);_0x1d10eb[_0xe2bd('0x1f')]=qs['offset'](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x1f')]);}_0x1d10eb['order']=qs[_0xe2bd('0x38')](_0xbe448a['query'][_0xe2bd('0x38')]);_0x1d10eb['where']=qs[_0xe2bd('0x30')](_[_0xe2bd('0x39')](_0xbe448a['query'],_0x4e0640[_0xe2bd('0x30')]));var _0x3a42ad=[];var _0x2c1922=squel[_0xe2bd('0x3a')]()['field']('id')[_0xe2bd('0x3b')](_0xe2bd('0x29'))['field'](_0xe2bd('0x3c'))[_0xe2bd('0x3d')]('tools_tags');var _0x4ab07c=squel[_0xe2bd('0x3a')]()['field'](_0xe2bd('0x3e'))[_0xe2bd('0x3d')](_0xe2bd('0x3f'),'me')[_0xe2bd('0x40')]('me.FaxInteractionId\x20=\x20i.id')['where'](_0xe2bd('0x41'))[_0xe2bd('0x40')](_0xe2bd('0x42'));var _0x223b4b=squel[_0xe2bd('0x3a')]()[_0xe2bd('0x3b')]('u.id')[_0xe2bd('0x3b')](_0xe2bd('0x43'))[_0xe2bd('0x3d')]('user_has_fax_interactions','ui')[_0xe2bd('0x44')]('users','u',_0xe2bd('0x45'));var _0x53152e=squel[_0xe2bd('0x3a')]()[_0xe2bd('0x3d')](_0xe2bd('0x46'),'i')[_0xe2bd('0x44')](_0xe2bd('0x47'),'ui','ui.UserId\x20=\x20i.UserId')[_0xe2bd('0x44')]('users','u','u.id\x20=\x20ui.UserId')[_0xe2bd('0x44')](_0xe2bd('0x48'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe2bd('0x44')]('users','o','o.id\x20=\x20i.UserId')[_0xe2bd('0x44')]('fax_accounts','a',_0xe2bd('0x49'))[_0xe2bd('0x44')](_0xe2bd('0x3f'),'me',_0xe2bd('0x4a'));var _0x122f53=squel[_0xe2bd('0x4b')]();if(_0xbe448a['query'][_0xe2bd('0x4c')]){var _0x1e1da8=JSON[_0xe2bd('0x4d')](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x4c')]);_[_0xe2bd('0x2f')](_0x1e1da8)[_0xe2bd('0x4e')](function(_0x2387cd){var _0x1bfdb3=_0x1e1da8[_0x2387cd];if(_0x2387cd==='createdAt'){var _0xd19498=moment(_0x1bfdb3[_0xe2bd('0x4f')][_0xe2bd('0x50')])['startOf'](_0xe2bd('0x51'))[_0xe2bd('0x52')]()[_0xe2bd('0x53')]();var _0x352107=moment(_0x352107)['utc']()[_0xe2bd('0x54')](_0xe2bd('0x51'))[_0xe2bd('0x53')]();_0x122f53[_0xe2bd('0x55')](_0xe2bd('0x56'),_0xd19498,_0x352107);}else{if(_['isArray'](_0x1bfdb3[_0xe2bd('0x57')])){_0x1bfdb3[_0xe2bd('0x57')][_0xe2bd('0x4e')](function(_0x50cc5a){switch(_0x1bfdb3[_0xe2bd('0x57')][_0xe2bd('0x4f')]){case'IS':if(_0x2387cd!==_0xe2bd('0x58')&&_0x2387cd!=='Messages.count'){if(_['isArray'](_0x1bfdb3['value'])&&_0x1bfdb3['value'][_0xe2bd('0x59')]>0x1){_0x122f53['and'](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5b'),_0x1bfdb3[_0xe2bd('0x4f')]);}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+'\x20=\x20?',_0x1bfdb3[_0xe2bd('0x4f')][0x0]);}}break;case'=':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5c'),_0x1bfdb3['value']);break;case _0xe2bd('0x5d'):if(_0x2387cd===_0xe2bd('0x5e')){_0x122f53[_0xe2bd('0x55')](_0xe2bd('0x5f')+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');_0x122f53['or']('c.lastName'+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');_0x122f53['or']('c.email'+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');}break;case'>':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3['tableAlias']+'.'+_0x2387cd+_0xe2bd('0x61'),_0x1bfdb3[_0xe2bd('0x4f')]);break;case'<':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+'\x20<\x20?',_0x1bfdb3[_0xe2bd('0x4f')]);break;}});}else{switch(_0x1bfdb3[_0xe2bd('0x57')][_0xe2bd('0x4f')]){case'IS':if(_0x2387cd!==_0xe2bd('0x58')&&_0x2387cd!==_0xe2bd('0x62')){if(_['isArray'](_0x1bfdb3['value'])&&_0x1bfdb3[_0xe2bd('0x4f')][_0xe2bd('0x59')]>0x1){_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5b'),_0x1bfdb3[_0xe2bd('0x4f')]);}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5c'),_0x1bfdb3[_0xe2bd('0x4f')][0x0]);}}break;case'=':_0x122f53['and'](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x5c'),_0x1bfdb3['value']);break;case'LIKE':if(_0x2387cd===_0xe2bd('0x5e')){_0x122f53['and'](_0xe2bd('0x5f')+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');_0x122f53['or'](_0xe2bd('0x63')+'\x20LIKE\x20?','%'+_0x1bfdb3['value']+'%');_0x122f53['or']('c.email'+_0xe2bd('0x60'),'%'+_0x1bfdb3[_0xe2bd('0x4f')]+'%');}else{_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x60'),'%'+_0x1bfdb3['value']+'%');}break;case'>':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3['tableAlias']+'.'+_0x2387cd+_0xe2bd('0x61'),_0x1bfdb3[_0xe2bd('0x4f')]);break;case'<':_0x122f53[_0xe2bd('0x55')](_0x1bfdb3[_0xe2bd('0x5a')]+'.'+_0x2387cd+_0xe2bd('0x64'),_0x1bfdb3[_0xe2bd('0x4f')]);break;}}}});}else{var _0x2a0635=_(Object[_0xe2bd('0x2f')](_0xbe448a[_0xe2bd('0x31')]))[_0xe2bd('0x65')](function(_0x3a8c2d){return _0x2cb5d8[_0xe2bd('0x35')](_0x3a8c2d)?_0x3a8c2d:undefined;})['filter'](function(_0x50e2bf){return!_[_0xe2bd('0x66')](_0x50e2bf);})[_0xe2bd('0x4f')]();if(!_[_0xe2bd('0x67')](_0x2a0635)){_0x2a0635['forEach'](function(_0x129a4d){if(_0x129a4d===_0xe2bd('0x68')){_0x53152e['where'](_0xe2bd('0x69'),[][_0xe2bd('0x6a')](_0xbe448a[_0xe2bd('0x31')][_0x129a4d]));}else if(_0x129a4d==='createdAt'){var _0x7df06b=JSON[_0xe2bd('0x4d')](_0xbe448a[_0xe2bd('0x31')][_0x129a4d])['$gte'];var _0x52d0bc=JSON[_0xe2bd('0x4d')](_0xbe448a['query'][_0x129a4d])[_0xe2bd('0x6b')];_0x53152e['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x7df06b,_0x52d0bc);}else{_0x53152e[_0xe2bd('0x40')]('i.'+_0x129a4d+'\x20=\x20?',_0xbe448a['query'][_0x129a4d]);}});}if(_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x6c')]){var _0x1ae25b=_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x6c')][_0xe2bd('0x6d')]('\x5c','\x5c\x5c')[_0xe2bd('0x6d')]('\x27\x27',_0xe2bd('0x6e'));if(qs[_0xe2bd('0x6f')](_0x1ae25b)){_0x122f53['or']('i.id\x20LIKE\x20?',_0x1ae25b+'%')['or'](_0xe2bd('0x70'),_0x1ae25b+'%');}_0x122f53['or'](_0xe2bd('0x71'),_0x1ae25b+'%');}}_0x53152e['where'](_0x122f53);if(_0x1d10eb[_0xe2bd('0x72')]){_0x1d10eb[_0xe2bd('0x72')][_0xe2bd('0x4e')](function(_0x48c3da){_0x53152e[_0xe2bd('0x72')]('i.'+_0x48c3da[0x0],_0x48c3da[0x1]===_0xe2bd('0x73')?![]:!![]);});}_0x53152e['group'](_0xe2bd('0x74'));var _0x28730d={'type':db[_0xe2bd('0x75')]['QueryTypes'][_0xe2bd('0x76')],'raw':!![]};var _0x342e6d=_0x53152e[_0xe2bd('0x77')]()[_0xe2bd('0x3b')](_0xe2bd('0x3e'));if(!_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x4c')]){if(_0xbe448a['query'][_0xe2bd('0x78')]){if(_0xbe448a['query'][_0xe2bd('0x78')]==0x1){_0x342e6d[_0xe2bd('0x40')](util[_0xe2bd('0x53')](_0xe2bd('0x79'),_0x4ab07c['toString']()));_0x53152e[_0xe2bd('0x7a')](_0xe2bd('0x7b'));}else{_0x342e6d[_0xe2bd('0x40')](util[_0xe2bd('0x53')]('%s\x20>\x200',_0x4ab07c[_0xe2bd('0x7c')]()));_0x53152e['having']('`Messages.count`\x20>\x200');}}if(_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x7d')]){var _0x3b182f=_[_0xe2bd('0x7e')](_0xbe448a[_0xe2bd('0x31')]['tag'])?_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x7d')]:new Array(_0xbe448a['query'][_0xe2bd('0x7d')]);var _0x2d4396=squel['expr']();_0x3b182f['forEach'](function(_0x68789f){_0x2d4396['or'](_0xe2bd('0x7f'),'%,'+_0x68789f+',%');});_0x53152e[_0xe2bd('0x7a')](_0x2d4396);_0x342e6d[_0xe2bd('0x44')](_0xe2bd('0x80'),'it',_0xe2bd('0x81'));_0x342e6d['left_join'](_0xe2bd('0x82'),'t','t.id\x20=\x20it.TagId');_0x342e6d[_0xe2bd('0x40')]('t.id\x20IN\x20?',_0x3b182f);}}else{var _0x1e1da8=JSON[_0xe2bd('0x4d')](_0xbe448a[_0xe2bd('0x31')][_0xe2bd('0x4c')]);_[_0xe2bd('0x2f')](_0x1e1da8)['forEach'](function(_0x3366b1){var _0x1c7022=_0x1e1da8[_0x3366b1];if(_0x3366b1===_0xe2bd('0x58')){var _0x59d69d=_0x1c7022[_0xe2bd('0x4f')];var _0x352206=squel[_0xe2bd('0x4b')]();_0x59d69d['forEach'](function(_0x154ec4){_0x352206['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x154ec4+',%');});_0x53152e[_0xe2bd('0x7a')](_0x352206);_0x342e6d[_0xe2bd('0x44')](_0xe2bd('0x83'),'it',_0xe2bd('0x84'));_0x342e6d[_0xe2bd('0x44')](_0xe2bd('0x82'),'t','t.id\x20=\x20it.TagId');_0x342e6d['where'](_0xe2bd('0x85'),_0x59d69d);}else if(_0x3366b1==='Messages.count'){if(_0x1c7022['value'][_0xe2bd('0x59')]===0x1){if(_0x1c7022[_0xe2bd('0x4f')][0x0]===0x1){_0x342e6d['where'](util['format'](_0xe2bd('0x79'),_0x4ab07c[_0xe2bd('0x7c')]()));_0x53152e[_0xe2bd('0x7a')](_0xe2bd('0x7b'));}else{_0x342e6d[_0xe2bd('0x40')](util[_0xe2bd('0x53')]('%s\x20>\x200',_0x4ab07c[_0xe2bd('0x7c')]()));_0x53152e[_0xe2bd('0x7a')](_0xe2bd('0x86'));}}}});}db[_0xe2bd('0x87')][_0xe2bd('0x31')](_0x342e6d['toString'](),_0x28730d)['then'](function(_0x1cb883){_0x3e3ab7['count']=_0x1cb883[_0xe2bd('0x59')];if(_0x3e3ab7[_0xe2bd('0x1e')]===0x0)return[];return db[_0xe2bd('0x87')][_0xe2bd('0x31')](_0x2c1922[_0xe2bd('0x7c')](),_0x28730d)[_0xe2bd('0x26')](function(_0x559c56){_0x3a42ad=_['keyBy'](_0x559c56,'id');_0x28730d=_[_0xe2bd('0x88')](_0x28730d,{'model':db[_0xe2bd('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x53152e[_0xe2bd('0x3b')](_0x4ab07c,_0xe2bd('0x62'));_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x89'),_0xe2bd('0x8a'));_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x8b'));_0x53152e[_0xe2bd('0x3b')]('c.firstName',_0xe2bd('0x8c'));_0x53152e['field'](_0xe2bd('0x63'),_0xe2bd('0x8d'));_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x8e'),_0xe2bd('0x8f'));_0x53152e[_0xe2bd('0x3b')]('c.phone','Contact.phone');_0x53152e['field'](_0xe2bd('0x90'),'Contact.mobile');_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x91'),'Contact.fax');_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x92'),'User.name');_0x53152e[_0xe2bd('0x3b')](_0xe2bd('0x93'),_0xe2bd('0x94'));_0x53152e['left_join'](_0xe2bd('0x80'),'it',_0xe2bd('0x81'));_0x53152e[_0xe2bd('0x44')](_0xe2bd('0x82'),'t',_0xe2bd('0x95'));_0x53152e[_0xe2bd('0x37')](_0x1d10eb[_0xe2bd('0x37')]);_0x53152e['offset'](_0x1d10eb['offset']);return db[_0xe2bd('0x87')][_0xe2bd('0x31')](_0x53152e[_0xe2bd('0x7c')](),_0x28730d);})[_0xe2bd('0x26')](function(_0x33b0a7){_0x223b4b['where'](_0xe2bd('0x96'),_[_0xe2bd('0x65')](_0x33b0a7,'id'));return db['sequelize'][_0xe2bd('0x31')](_0x223b4b[_0xe2bd('0x7c')](),_0x28730d)[_0xe2bd('0x26')](function(_0x32f7f9){var _0x649f62=_[_0xe2bd('0x97')](_0x32f7f9,_0xe2bd('0x98'));_0x33b0a7['forEach'](function(_0x291623){if(_0x649f62[_0x291623['id']]){_0x291623[_0xe2bd('0x99')]=_['map'](_0x649f62[_0x291623['id']],function(_0x19521a){return{'id':_0x19521a['id']};});}if(_0x291623[_0xe2bd('0x94')]){_0x291623[_0xe2bd('0x9a')]=[];_0x291623['TagIds'][_0xe2bd('0x9b')](',')['forEach'](function(_0x5253df){_0x291623['Tags'][_0xe2bd('0x9c')](_0x3a42ad[_0x5253df]);});}delete _0x291623[_0xe2bd('0x94')];});return _0x33b0a7;});});})[_0xe2bd('0x26')](function(_0x66217c){_0x3e3ab7[_0xe2bd('0x9d')]=_0x66217c;return _0x3e3ab7;})['then'](respondWithFilteredResult(_0x2416c4,_0x1d10eb))['catch'](handleError(_0x2416c4,null));};exports[_0xe2bd('0x9e')]=function(_0x23fbc5,_0x5416b5){var _0x5b6359={'raw':![],'where':{'id':_0x23fbc5[_0xe2bd('0x9f')]['id']}},_0xfb04a9={};_0xfb04a9[_0xe2bd('0x2e')]=_[_0xe2bd('0x2f')](db[_0xe2bd('0x2c')][_0xe2bd('0x2d')]);_0xfb04a9[_0xe2bd('0x31')]=_[_0xe2bd('0x2f')](_0x23fbc5[_0xe2bd('0x31')]);_0xfb04a9[_0xe2bd('0x30')]=_[_0xe2bd('0x33')](_0xfb04a9[_0xe2bd('0x2e')],_0xfb04a9['query']);_0x5b6359[_0xe2bd('0x32')]=_['intersection'](_0xfb04a9[_0xe2bd('0x2e')],qs['fields'](_0x23fbc5[_0xe2bd('0x31')][_0xe2bd('0x34')]));_0x5b6359['attributes']=_0x5b6359[_0xe2bd('0x32')]['length']?_0x5b6359[_0xe2bd('0x32')]:_0xfb04a9[_0xe2bd('0x2e')];if(_0x23fbc5['query'][_0xe2bd('0xa0')]){_0x5b6359[_0xe2bd('0xa1')]=[{'all':!![]}];}_0x5b6359=_[_0xe2bd('0x88')]({},_0x5b6359,_0x23fbc5['options']);return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')](_0x5b6359)[_0xe2bd('0x26')](handleEntityNotFound(_0x5416b5,null))[_0xe2bd('0x26')](respondWithResult(_0x5416b5,null))[_0xe2bd('0xa3')](handleError(_0x5416b5,null));};exports[_0xe2bd('0xa4')]=function(_0x3b4359,_0x18b97b){return db[_0xe2bd('0x2c')][_0xe2bd('0xa4')](_0x3b4359[_0xe2bd('0xa5')],{})['then'](respondWithResult(_0x18b97b,0xc9))[_0xe2bd('0xa3')](handleError(_0x18b97b,null));};exports[_0xe2bd('0x25')]=function(_0x5b2bb7,_0x595c4d){if(_0x5b2bb7[_0xe2bd('0xa5')]['id']){delete _0x5b2bb7['body']['id'];}return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')]({'where':{'id':_0x5b2bb7[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x595c4d,null))[_0xe2bd('0x26')](saveUpdates(_0x5b2bb7[_0xe2bd('0xa5')],null))[_0xe2bd('0x26')](respondWithResult(_0x595c4d,null))[_0xe2bd('0xa3')](handleError(_0x595c4d,null));};exports[_0xe2bd('0xa6')]=function(_0x4de59f,_0x593012){return db['FaxInteraction'][_0xe2bd('0xa2')]({'where':{'id':_0x4de59f[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x593012,null))[_0xe2bd('0x26')](removeEntity(_0x593012,null))['catch'](handleError(_0x593012,null));};exports[_0xe2bd('0xa7')]=function(_0x5034bf,_0x2e3f13){return db[_0xe2bd('0x2c')][_0xe2bd('0xa7')]()['then'](respondWithResult(_0x2e3f13,null))[_0xe2bd('0xa3')](handleError(_0x2e3f13,null));};exports['addMessage']=function(_0x387ded,_0x133546,_0x17fe62){return db[_0xe2bd('0xa8')][_0xe2bd('0xa2')]({'where':{'id':_0x387ded[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x133546,null))[_0xe2bd('0x26')](function(_0x3edfe8){if(_0x3edfe8){return _0x3edfe8[_0xe2bd('0xa9')](_0x387ded[_0xe2bd('0xa5')]['ids'],_[_0xe2bd('0xaa')](_0x387ded['body'],['ids','id'])||{});}})[_0xe2bd('0x26')](respondWithResult(_0x133546,null))[_0xe2bd('0xa3')](handleError(_0x133546,null));};exports[_0xe2bd('0xab')]=function(_0x296bf6,_0xf8475,_0x554ca9){var _0x3c770f={'raw':![],'where':{}};var _0x37c97a={};var _0x84cb89={'count':0x0,'rows':[]};return db[_0xe2bd('0x2c')][_0xe2bd('0xac')]({'where':{'id':_0x296bf6[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0xf8475,null))['then'](function(_0x1d151b){if(_0x1d151b){_0x37c97a['model']=_['keys'](db[_0xe2bd('0xa8')]['rawAttributes']);_0x37c97a['query']=_[_0xe2bd('0x2f')](_0x296bf6[_0xe2bd('0x31')]);_0x37c97a[_0xe2bd('0x30')]=_[_0xe2bd('0x33')](_0x37c97a['model'],_0x37c97a[_0xe2bd('0x31')]);_0x3c770f[_0xe2bd('0x32')]=_[_0xe2bd('0x33')](_0x37c97a['model'],qs[_0xe2bd('0x34')](_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0x34')]));_0x3c770f[_0xe2bd('0x32')]=_0x3c770f[_0xe2bd('0x32')][_0xe2bd('0x59')]?_0x3c770f['attributes']:_0x37c97a[_0xe2bd('0x2e')];if(!_0x296bf6[_0xe2bd('0x31')]['hasOwnProperty']('nolimit')){_0x3c770f[_0xe2bd('0x37')]=qs[_0xe2bd('0x37')](_0x296bf6['query'][_0xe2bd('0x37')]);_0x3c770f[_0xe2bd('0x1f')]=qs['offset'](_0x296bf6['query']['offset']);}_0x3c770f[_0xe2bd('0x72')]=qs[_0xe2bd('0x38')](_0x296bf6['query']['sort']);_0x3c770f[_0xe2bd('0x40')]=qs[_0xe2bd('0x30')](_[_0xe2bd('0x39')](_0x296bf6[_0xe2bd('0x31')],_0x37c97a[_0xe2bd('0x30')]));_0x3c770f[_0xe2bd('0x40')]['FaxInteractionId']=_0x1d151b['id'];if(_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0x6c')]){_0x3c770f['where']=_[_0xe2bd('0x88')](_0x3c770f[_0xe2bd('0x40')],{'$or':_[_0xe2bd('0x65')](_0x3c770f['attributes'],function(_0x5b8ba6){var _0x1fa2a9={};_0x1fa2a9[_0x5b8ba6]={'$like':'%'+_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0x6c')]+'%'};return _0x1fa2a9;})});}if(_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0xad')]){var _0x19a1a4=_0x296bf6[_0xe2bd('0x31')]['$gte'][_0xe2bd('0x9b')](',');var _0x446409={};_0x446409[_0x19a1a4[0x0]]={'$gte':moment(_0x19a1a4[0x1])['format'](_0xe2bd('0xae'))};_0x3c770f[_0xe2bd('0x40')]=_['merge'](_0x3c770f['where'],_0x446409);}_0x3c770f=_['merge']({},_0x3c770f,_0x296bf6[_0xe2bd('0xaf')]);return db[_0xe2bd('0xa8')][_0xe2bd('0x1e')]({'where':_0x3c770f[_0xe2bd('0x40')]})[_0xe2bd('0x26')](function(_0x319f30){_0x84cb89['count']=_0x319f30;if(_0x296bf6[_0xe2bd('0x31')][_0xe2bd('0xa0')]){_0x3c770f[_0xe2bd('0xa1')]=[{'all':!![]}];}return db[_0xe2bd('0xa8')][_0xe2bd('0xb0')](_0x3c770f);})['then'](function(_0x16b6a9){_0x84cb89[_0xe2bd('0x9d')]=_0x16b6a9;return _0x84cb89;});}})[_0xe2bd('0x26')](respondWithFilteredResult(_0xf8475,_0x3c770f))[_0xe2bd('0xa3')](handleError(_0xf8475,null));};exports[_0xe2bd('0xb1')]=function(_0x1aace2,_0x69da87,_0x1a63ad){return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')]({'where':{'id':_0x1aace2[_0xe2bd('0x9f')]['id']}})['then'](handleEntityNotFound(_0x69da87,null))[_0xe2bd('0x26')](function(_0x1b0977){if(_0x1b0977){return _0x1b0977[_0xe2bd('0xb2')](_0x1aace2[_0xe2bd('0xa5')]['ids'],_[_0xe2bd('0xaa')](_0x1aace2[_0xe2bd('0xa5')],[_0xe2bd('0xb3'),'id'])||{})[_0xe2bd('0xb4')](function(){return db[_0xe2bd('0xb5')][_0xe2bd('0xb0')]({'attributes':['id',_0xe2bd('0x29'),_0xe2bd('0x3c')],'where':{'id':_0x1aace2[_0xe2bd('0xa5')][_0xe2bd('0xb3')]}});})[_0xe2bd('0x26')](function(_0x4e7819){socket[_0xe2bd('0xb6')](_0xe2bd('0xb7'),{'id':Number(_0x1aace2[_0xe2bd('0x9f')]['id']),'tags':_0x4e7819||[]});return{'id':Number(_0x1aace2[_0xe2bd('0x9f')]['id']),'tags':_0x4e7819||[]};});}})[_0xe2bd('0x26')](respondWithResult(_0x69da87,null))['catch'](handleError(_0x69da87,null));};exports[_0xe2bd('0xb8')]=function(_0x16875d,_0x272bea,_0x1ae797){return db[_0xe2bd('0x2c')]['find']({'where':{'id':_0x16875d[_0xe2bd('0x9f')]['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0x272bea,null))['then'](function(_0x4f8706){if(_0x4f8706){return _0x4f8706[_0xe2bd('0xb8')](_0x16875d[_0xe2bd('0x31')]['ids']);}})[_0xe2bd('0x26')](respondWithStatusCode(_0x272bea,null))['catch'](handleError(_0x272bea,null));};exports[_0xe2bd('0xb9')]=function(_0x3da21f,_0xa2fe8b){var _0x4ee1c3=moment()['unix']()[_0xe2bd('0x7c')]();var _0x9f7a98=path[_0xe2bd('0xba')](config['root'],'server',_0xe2bd('0xbb'),_0xe2bd('0xbc'));var _0x45acc7=path[_0xe2bd('0xba')](config['root'],_0xe2bd('0xbd'),_0xe2bd('0xbb'),_0xe2bd('0xbe'));var _0x40a680=path[_0xe2bd('0xba')](_0x45acc7,_0x4ee1c3);var _0x57e8a8=util[_0xe2bd('0x53')](_0xe2bd('0xbf'),_0x4ee1c3);var _0x46fe6a=path[_0xe2bd('0xba')](_0x45acc7,_0x57e8a8);var _0x1db1fe=![];return db[_0xe2bd('0x2c')][_0xe2bd('0xa2')]({'where':{'id':_0x3da21f['params']['id']}})[_0xe2bd('0x26')](handleEntityNotFound(_0xa2fe8b,null))[_0xe2bd('0x26')](function(_0x257e62){if(_0x257e62){return _0x257e62['getMessages']({'attributes':['id','body',_0xe2bd('0xc0')],'include':[{'model':db['Attachment'],'as':_0xe2bd('0xc1')}]});}return[];})['then'](function(_0x76825d){_0x1db1fe=_0x76825d[_0xe2bd('0x59')];if(_0x76825d[_0xe2bd('0x59')]){fs['mkdirSync'](_0x40a680);for(var _0x39fe65=0x0;_0x39fe65<_0x76825d[_0xe2bd('0x59')];_0x39fe65++){var _0x4cecc4=_0x76825d[_0x39fe65];var _0x44fc6a=_0x4cecc4[_0xe2bd('0xc1')];if(_0x44fc6a){var _0x3a92bd=path[_0xe2bd('0xba')](_0x9f7a98,_0x44fc6a[_0xe2bd('0xc2')]);if(fs['existsSync'](_0x3a92bd)){fs[_0xe2bd('0xc3')](_0x3a92bd)[_0xe2bd('0xc4')](fs[_0xe2bd('0xc5')](path['join'](_0x40a680,_0x44fc6a[_0xe2bd('0xc2')])));}}}}})[_0xe2bd('0x26')](function(){if(_0x1db1fe){return new BPromise(function(_0x37ecbe,_0x18082e){zipdir(_0x40a680,{'saveTo':_0x46fe6a},function(_0x1b74ba,_0x12837f){if(_0x1b74ba)return _0x18082e(_0x1b74ba);return _0x37ecbe(_0x12837f);});});}})[_0xe2bd('0x26')](function(){if(_0x1db1fe){return new BPromise(function(_0x1982ba,_0xb23492){rimraf(_0x40a680,function(_0x55ecbd){if(_0x55ecbd)_0xb23492(_0x55ecbd);return _0x1982ba();});});}})[_0xe2bd('0x26')](function(){if(_0x1db1fe){return _0xa2fe8b[_0xe2bd('0xb9')](_0x46fe6a,_0x57e8a8,function(_0x28b5f1){if(_0x28b5f1){console[_0xe2bd('0xc6')]('err',_0x28b5f1);}else{fs[_0xe2bd('0xc7')](_0x46fe6a);}});}else{return _0xa2fe8b[_0xe2bd('0x1b')](0xc8);}})['catch'](handleError(_0xa2fe8b,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 20f66be..6f8e4dc 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 _0x236c=['FaxInteraction','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0x236c,0x155));var _0xc236=function(_0x52e222,_0x2c628e){_0x52e222=_0x52e222-0x0;var _0x165ae1=_0x236c[_0x52e222];return _0x165ae1;};'use strict';var EventEmitter=require(_0xc236('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xc236('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc236('0x2')](0x0);var events={'afterCreate':_0xc236('0x3'),'afterUpdate':_0xc236('0x4'),'afterDestroy':_0xc236('0x5')};function emitEvent(_0x518d6a){return function(_0x3adce9,_0x36e87d,_0x33bc57){FaxInteractionEvents[_0xc236('0x6')](_0x518d6a+':'+_0x3adce9['id'],_0x3adce9);FaxInteractionEvents[_0xc236('0x6')](_0x518d6a,_0x3adce9);_0x33bc57(null);};}for(var e in events){if(events[_0xc236('0x7')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xc236('0x8')]=FaxInteractionEvents; \ No newline at end of file +var _0x9ffd=['events','../../mysqldb','FaxInteraction','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x7c324f,_0x326b1b){var _0x1b8d77=function(_0x339341){while(--_0x339341){_0x7c324f['push'](_0x7c324f['shift']());}};_0x1b8d77(++_0x326b1b);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x7d22fe,_0x2b5f9f){_0x7d22fe=_0x7d22fe-0x0;var _0x46ee01=_0x9ffd[_0x7d22fe];return _0x46ee01;};'use strict';var EventEmitter=require(_0xd9ff('0x0'));var FaxInteraction=require(_0xd9ff('0x1'))['db'][_0xd9ff('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd9ff('0x3'),'afterUpdate':_0xd9ff('0x4'),'afterDestroy':_0xd9ff('0x5')};function emitEvent(_0x5493ae){return function(_0x53e962,_0x1c9460,_0x111697){FaxInteractionEvents['emit'](_0x5493ae+':'+_0x53e962['id'],_0x53e962);FaxInteractionEvents[_0xd9ff('0x6')](_0x5493ae,_0x53e962);_0x111697(null);};}for(var e in events){if(events[_0xd9ff('0x7')](e)){var event=events[e];FaxInteraction[_0xd9ff('0x8')](e,emitEvent(event));}}module[_0xd9ff('0x9')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 977a250..bf0acd8 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 _0x1c60=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','changed'];(function(_0x380a93,_0x63d51d){var _0x2be539=function(_0x8ff520){while(--_0x8ff520){_0x380a93['push'](_0x380a93['shift']());}};_0x2be539(++_0x63d51d);}(_0x1c60,0x1d4));var _0x01c6=function(_0x250669,_0xb15e88){_0x250669=_0x250669-0x0;var _0x131447=_0x1c60[_0x250669];return _0x131447;};'use strict';var _=require(_0x01c6('0x0'));var util=require('util');var logger=require(_0x01c6('0x1'))(_0x01c6('0x2'));var moment=require(_0x01c6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x01c6('0x4'));var rimraf=require(_0x01c6('0x5'));var config=require(_0x01c6('0x6'));var attributes=require(_0x01c6('0x7'));module[_0x01c6('0x8')]=function(_0x415983,_0x48868b){return _0x415983[_0x01c6('0x9')](_0x01c6('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x186059,_0x5ad6db,_0x79fd14){if(_0x186059[_0x01c6('0xb')](_0x01c6('0xc'))){_0x186059[_0x01c6('0xd')]=moment()[_0x01c6('0xe')](_0x01c6('0xf'));}_0x79fd14(null,_0x186059);}}});}; \ No newline at end of file +var _0x2082=['FaxInteraction','changed','closed','format','util','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0x2082,0x1b1));var _0x2208=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x2082[_0xf16b1];return _0x26f94d;};'use strict';var _=require('lodash');var util=require(_0x2208('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2208('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2208('0x2'));var rimraf=require(_0x2208('0x3'));var config=require(_0x2208('0x4'));var attributes=require('./faxInteraction.attributes');module[_0x2208('0x5')]=function(_0x5b625a,_0xd2a30e){return _0x5b625a[_0x2208('0x6')](_0x2208('0x7'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x435016,_0x3e3a3b,_0x31f886){if(_0x435016[_0x2208('0x8')](_0x2208('0x9'))){_0x435016['closedAt']=moment()[_0x2208('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x31f886(null,_0x435016);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 23573bb..476b787 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 _0xe808=['ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','register','request','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxInteraction,\x20%s,\x20%s','info','result','catch','UpdateFaxInteraction','update','body','options','raw','where','attributes','then','AddTagsToFaxInteraction','addTags'];(function(_0x54b742,_0x409961){var _0x46e592=function(_0x5185fa){while(--_0x5185fa){_0x54b742['push'](_0x54b742['shift']());}};_0x46e592(++_0x409961);}(_0xe808,0x194));var _0x8e80=function(_0x3fe472,_0x4cdcbb){_0x3fe472=_0x3fe472-0x0;var _0x43ece2=_0xe808[_0x3fe472];return _0x43ece2;};'use strict';var _=require(_0x8e80('0x0'));var util=require(_0x8e80('0x1'));var moment=require(_0x8e80('0x2'));var BPromise=require(_0x8e80('0x3'));var rs=require(_0x8e80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e80('0x5'))['db'];var utils=require(_0x8e80('0x6'));var logger=require(_0x8e80('0x7'))('rpc');var config=require(_0x8e80('0x8'));var jayson=require(_0x8e80('0x9'));var client=jayson['client'][_0x8e80('0xa')]({'port':0x232a});config['redis']=_[_0x8e80('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8e80('0xc'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x8e80('0xd')](socket);function respondWithRpcPromise(_0x10d4fb,_0x310e50,_0x3d3444){return new BPromise(function(_0x1a948e,_0x114d52){return client[_0x8e80('0xe')](_0x10d4fb,_0x3d3444)['then'](function(_0x331442){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x310e50,_0x8e80('0xf'));logger[_0x8e80('0x10')](_0x8e80('0x11'),_0x310e50,'request\x20sent',JSON[_0x8e80('0x12')](_0x331442));if(_0x331442[_0x8e80('0x13')]){if(_0x331442[_0x8e80('0x13')][_0x8e80('0x14')]===0x1f4){logger[_0x8e80('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x310e50,_0x331442[_0x8e80('0x13')][_0x8e80('0x15')]);return _0x114d52(_0x331442['error']['message']);}logger[_0x8e80('0x13')](_0x8e80('0x16'),_0x310e50,_0x331442['error'][_0x8e80('0x15')]);return _0x1a948e(_0x331442[_0x8e80('0x13')][_0x8e80('0x15')]);}else{logger[_0x8e80('0x17')](_0x8e80('0x16'),_0x310e50,_0x8e80('0xf'));_0x1a948e(_0x331442[_0x8e80('0x18')][_0x8e80('0x15')]);}})[_0x8e80('0x19')](function(_0x1a53d3){logger[_0x8e80('0x13')]('FaxInteraction,\x20%s,\x20%s',_0x310e50,_0x1a53d3);_0x114d52(_0x1a53d3);});});}exports[_0x8e80('0x1a')]=function(_0x5b6842){var _0x134f57=this;return new Promise(function(_0x3cf7ef,_0x28c68){return db['FaxInteraction'][_0x8e80('0x1b')](_0x5b6842[_0x8e80('0x1c')],{'raw':_0x5b6842[_0x8e80('0x1d')]?_0x5b6842[_0x8e80('0x1d')][_0x8e80('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b6842[_0x8e80('0x1d')]?_0x5b6842[_0x8e80('0x1d')][_0x8e80('0x1f')]||null:null,'attributes':_0x5b6842[_0x8e80('0x1d')]?_0x5b6842[_0x8e80('0x1d')][_0x8e80('0x20')]||null:null,'limit':_0x5b6842[_0x8e80('0x1d')]?_0x5b6842['options']['limit']||null:null})[_0x8e80('0x21')](function(_0x4055d9){logger[_0x8e80('0x17')](_0x8e80('0x1a'),_0x5b6842);logger[_0x8e80('0x10')](_0x8e80('0x1a'),_0x5b6842,JSON[_0x8e80('0x12')](_0x4055d9));_0x3cf7ef(_0x4055d9);})[_0x8e80('0x19')](function(_0x12d08a){logger['error'](_0x8e80('0x1a'),_0x12d08a['message'],_0x5b6842);_0x28c68(_0x134f57[_0x8e80('0x13')](0x1f4,_0x12d08a[_0x8e80('0x15')]));});});};exports[_0x8e80('0x22')]=function(_0x2a9d3a){return new Promise(function(_0x265eb7,_0x1100c9){return db['FaxInteraction']['find']({'where':_0x2a9d3a[_0x8e80('0x1d')]?_0x2a9d3a[_0x8e80('0x1d')][_0x8e80('0x1f')]||null:null})['then'](function(_0x1cdb57){if(_0x1cdb57){return _0x1cdb57[_0x8e80('0x23')](_0x2a9d3a['body'][_0x8e80('0x24')],_[_0x8e80('0x25')](_0x2a9d3a['body'],[_0x8e80('0x24'),'id'])||{});}})[_0x8e80('0x26')](function(_0x28bd79){logger[_0x8e80('0x17')](_0x8e80('0x27'),_0x2a9d3a);logger[_0x8e80('0x10')](_0x8e80('0x27'),_0x2a9d3a,JSON[_0x8e80('0x12')](_0x28bd79));_0x265eb7(_0x28bd79);})[_0x8e80('0x19')](function(_0x1c907b){logger[_0x8e80('0x13')](_0x8e80('0x27'),_0x1c907b[_0x8e80('0x15')],_0x2a9d3a);_0x1100c9(_this[_0x8e80('0x13')](0x1f4,_0x1c907b[_0x8e80('0x15')]));});});}; \ No newline at end of file +var _0xc3a4=['FaxInteraction','find','body','omit','ids','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','update','options','where','limit','then','UpdateFaxInteraction','catch'];(function(_0x4cd14a,_0x3c08b4){var _0x59ac6a=function(_0x5d95ec){while(--_0x5d95ec){_0x4cd14a['push'](_0x4cd14a['shift']());}};_0x59ac6a(++_0x3c08b4);}(_0xc3a4,0x7f));var _0x4c3a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc3a4[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x4c3a('0x0'));var util=require('util');var moment=require(_0x4c3a('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c3a('0x2'));var fs=require('fs');var Redis=require(_0x4c3a('0x3'));var db=require(_0x4c3a('0x4'))['db'];var utils=require(_0x4c3a('0x5'));var logger=require(_0x4c3a('0x6'))('rpc');var config=require(_0x4c3a('0x7'));var jayson=require(_0x4c3a('0x8'));var client=jayson[_0x4c3a('0x9')][_0x4c3a('0xa')]({'port':0x232a});config[_0x4c3a('0xb')]=_[_0x4c3a('0xc')](config[_0x4c3a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c3a('0xd'))(new Redis(config[_0x4c3a('0xb')]));require(_0x4c3a('0xe'))[_0x4c3a('0xf')](socket);function respondWithRpcPromise(_0x29b0c8,_0x34c003,_0x49cacb){return new BPromise(function(_0x564de2,_0x237f09){return client[_0x4c3a('0x10')](_0x29b0c8,_0x49cacb)['then'](function(_0x439111){logger[_0x4c3a('0x11')](_0x4c3a('0x12'),_0x34c003,_0x4c3a('0x13'));logger[_0x4c3a('0x14')](_0x4c3a('0x15'),_0x34c003,_0x4c3a('0x13'),JSON[_0x4c3a('0x16')](_0x439111));if(_0x439111[_0x4c3a('0x17')]){if(_0x439111[_0x4c3a('0x17')]['code']===0x1f4){logger[_0x4c3a('0x17')](_0x4c3a('0x12'),_0x34c003,_0x439111[_0x4c3a('0x17')][_0x4c3a('0x18')]);return _0x237f09(_0x439111[_0x4c3a('0x17')][_0x4c3a('0x18')]);}logger[_0x4c3a('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x34c003,_0x439111['error'][_0x4c3a('0x18')]);return _0x564de2(_0x439111[_0x4c3a('0x17')][_0x4c3a('0x18')]);}else{logger[_0x4c3a('0x11')](_0x4c3a('0x12'),_0x34c003,_0x4c3a('0x13'));_0x564de2(_0x439111[_0x4c3a('0x19')]['message']);}})['catch'](function(_0x4de3b1){logger[_0x4c3a('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x34c003,_0x4de3b1);_0x237f09(_0x4de3b1);});});}exports['UpdateFaxInteraction']=function(_0x1c1100){var _0x1a8c18=this;return new Promise(function(_0x564355,_0xc298b9){return db['FaxInteraction'][_0x4c3a('0x1a')](_0x1c1100['body'],{'raw':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options'][_0x4c3a('0x1c')]||null:null,'attributes':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options']['attributes']||null:null,'limit':_0x1c1100[_0x4c3a('0x1b')]?_0x1c1100['options'][_0x4c3a('0x1d')]||null:null})[_0x4c3a('0x1e')](function(_0x25a94b){logger[_0x4c3a('0x11')](_0x4c3a('0x1f'),_0x1c1100);logger[_0x4c3a('0x14')](_0x4c3a('0x1f'),_0x1c1100,JSON[_0x4c3a('0x16')](_0x25a94b));_0x564355(_0x25a94b);})[_0x4c3a('0x20')](function(_0xbfbfc6){logger['error'](_0x4c3a('0x1f'),_0xbfbfc6[_0x4c3a('0x18')],_0x1c1100);_0xc298b9(_0x1a8c18[_0x4c3a('0x17')](0x1f4,_0xbfbfc6['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x6f8cb2){return new Promise(function(_0x34f702,_0xee8c31){return db[_0x4c3a('0x21')][_0x4c3a('0x22')]({'where':_0x6f8cb2[_0x4c3a('0x1b')]?_0x6f8cb2['options']['where']||null:null})[_0x4c3a('0x1e')](function(_0xd205ae){if(_0xd205ae){return _0xd205ae['addTags'](_0x6f8cb2[_0x4c3a('0x23')]['ids'],_[_0x4c3a('0x24')](_0x6f8cb2[_0x4c3a('0x23')],[_0x4c3a('0x25'),'id'])||{});}})[_0x4c3a('0x26')](function(_0x4e0e97){logger['info']('AddTags',_0x6f8cb2);logger[_0x4c3a('0x14')](_0x4c3a('0x27'),_0x6f8cb2,JSON[_0x4c3a('0x16')](_0x4e0e97));_0x34f702(_0x4e0e97);})[_0x4c3a('0x20')](function(_0x2cb917){logger[_0x4c3a('0x17')](_0x4c3a('0x27'),_0x2cb917['message'],_0x6f8cb2);_0xee8c31(_this[_0x4c3a('0x17')](0x1f4,_0x2cb917[_0x4c3a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index ddba0ed..029a7d1 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 _0xc284=['save','remove','update','register','length'];(function(_0x22284d,_0x386354){var _0x34ae74=function(_0x4b8b9e){while(--_0x4b8b9e){_0x22284d['push'](_0x22284d['shift']());}};_0x34ae74(++_0x386354);}(_0xc284,0x7d));var _0x4c28=function(_0x325f41,_0x3c4e5d){_0x325f41=_0x325f41-0x0;var _0x366f55=_0xc284[_0x325f41];return _0x366f55;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x4c28('0x0'),_0x4c28('0x1'),_0x4c28('0x2')];function createListener(_0x457571,_0x259641){return function(_0x3287e4){_0x259641['emit'](_0x457571,_0x3287e4);};}function removeListener(_0x56db96,_0x3142a8){return function(){FaxInteractionEvents['removeListener'](_0x56db96,_0x3142a8);};}exports[_0x4c28('0x3')]=function(_0x31a3c2){for(var _0x4160c8=0x0,_0x39a719=events[_0x4c28('0x4')];_0x4160c8<_0x39a719;_0x4160c8++){var _0x495f0e=events[_0x4160c8];var _0x2a7192=createListener('faxInteraction:'+_0x495f0e,_0x31a3c2);FaxInteractionEvents['on'](_0x495f0e,_0x2a7192);}}; \ No newline at end of file +var _0x43ac=['faxInteraction:','remove','update','emit','register'];(function(_0x2efd1d,_0x44f696){var _0x1ef3f6=function(_0x25da5f){while(--_0x25da5f){_0x2efd1d['push'](_0x2efd1d['shift']());}};_0x1ef3f6(++_0x44f696);}(_0x43ac,0xb0));var _0xc43a=function(_0x16768a,_0x361d22){_0x16768a=_0x16768a-0x0;var _0x57b061=_0x43ac[_0x16768a];return _0x57b061;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0xc43a('0x0'),_0xc43a('0x1')];function createListener(_0x5f31ed,_0x39c24e){return function(_0xa5eeb8){_0x39c24e[_0xc43a('0x2')](_0x5f31ed,_0xa5eeb8);};}function removeListener(_0xff1886,_0x4be0ed){return function(){FaxInteractionEvents['removeListener'](_0xff1886,_0x4be0ed);};}exports[_0xc43a('0x3')]=function(_0x2240a2){for(var _0x3594ac=0x0,_0x40b26a=events['length'];_0x3594ac<_0x40b26a;_0x3594ac++){var _0xd63d58=events[_0x3594ac];var _0xcf64ad=createListener(_0xc43a('0x4')+_0xd63d58,_0x2240a2);FaxInteractionEvents['on'](_0xd63d58,_0xcf64ad);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 588fe4e..16c5267 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 _0x1ffe=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','index','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','fax','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags','exports'];(function(_0x405258,_0x254e75){var _0x586ab1=function(_0x22b0a9){while(--_0x22b0a9){_0x405258['push'](_0x405258['shift']());}};_0x586ab1(++_0x254e75);}(_0x1ffe,0x80));var _0xe1ff=function(_0x4dfeff,_0x29886){_0x4dfeff=_0x4dfeff-0x0;var _0x3c852f=_0x1ffe[_0x4dfeff];return _0x3c852f;};'use strict';var multer=require(_0xe1ff('0x0'));var util=require(_0xe1ff('0x1'));var path=require(_0xe1ff('0x2'));var timeout=require(_0xe1ff('0x3'));var express=require(_0xe1ff('0x4'));var router=express[_0xe1ff('0x5')]();var auth=require(_0xe1ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe1ff('0x7'));var controller=require(_0xe1ff('0x8'));router[_0xe1ff('0x9')]('/',auth['isAuthenticated'](),controller[_0xe1ff('0xa')]);router[_0xe1ff('0x9')]('/describe',auth[_0xe1ff('0xb')](),controller[_0xe1ff('0xc')]);router['get'](_0xe1ff('0xd'),auth[_0xe1ff('0xb')](),controller[_0xe1ff('0xe')]);router[_0xe1ff('0x9')](_0xe1ff('0xf'),auth['isAuthenticated'](),controller[_0xe1ff('0x10')]);router['get'](_0xe1ff('0x11'),auth[_0xe1ff('0xb')](),controller[_0xe1ff('0x12')]);router[_0xe1ff('0x13')]('/',auth['isAuthenticated'](),controller[_0xe1ff('0x14')]);router[_0xe1ff('0x13')]('/:id/messages',auth[_0xe1ff('0xb')](),controller[_0xe1ff('0x15')]);router[_0xe1ff('0x13')]('/:id/tags',auth[_0xe1ff('0xb')](),interaction['tracked'](_0xe1ff('0x16'),'faxinteraction:addtags'),controller['addTags']);router[_0xe1ff('0x17')]('/:id',auth[_0xe1ff('0xb')](),interaction['tracked'](_0xe1ff('0x16'),_0xe1ff('0x18')),controller[_0xe1ff('0x19')]);router[_0xe1ff('0x1a')](_0xe1ff('0xd'),auth[_0xe1ff('0xb')](),interaction['tracked'](_0xe1ff('0x16'),_0xe1ff('0x1b')),controller[_0xe1ff('0x1c')]);router[_0xe1ff('0x1a')](_0xe1ff('0x1d'),auth[_0xe1ff('0xb')](),controller[_0xe1ff('0x1e')]);module[_0xe1ff('0x1f')]=router; \ No newline at end of file +var _0x784a=['faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','fax','faxinteraction:addtags','addTags','put','tracked'];(function(_0x2b58a5,_0x135cc9){var _0xa9e7fe=function(_0x5785f3){while(--_0x5785f3){_0x2b58a5['push'](_0x2b58a5['shift']());}};_0xa9e7fe(++_0x135cc9);}(_0x784a,0x16d));var _0xa784=function(_0x51d111,_0x53ddbc){_0x51d111=_0x51d111-0x0;var _0xdaeb2e=_0x784a[_0x51d111];return _0xdaeb2e;};'use strict';var multer=require(_0xa784('0x0'));var util=require('util');var path=require(_0xa784('0x1'));var timeout=require(_0xa784('0x2'));var express=require('express');var router=express[_0xa784('0x3')]();var auth=require(_0xa784('0x4'));var interaction=require(_0xa784('0x5'));var config=require('../../config/environment');var controller=require(_0xa784('0x6'));router[_0xa784('0x7')]('/',auth[_0xa784('0x8')](),controller[_0xa784('0x9')]);router['get'](_0xa784('0xa'),auth[_0xa784('0x8')](),controller[_0xa784('0xb')]);router['get'](_0xa784('0xc'),auth[_0xa784('0x8')](),controller[_0xa784('0xd')]);router[_0xa784('0x7')](_0xa784('0xe'),auth[_0xa784('0x8')](),controller[_0xa784('0xf')]);router['get'](_0xa784('0x10'),auth[_0xa784('0x8')](),controller['download']);router[_0xa784('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa784('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0xa784('0x12')]);router['post'](_0xa784('0x13'),auth[_0xa784('0x8')](),interaction['tracked'](_0xa784('0x14'),_0xa784('0x15')),controller[_0xa784('0x16')]);router[_0xa784('0x17')](_0xa784('0xc'),auth[_0xa784('0x8')](),interaction[_0xa784('0x18')](_0xa784('0x14'),_0xa784('0x19')),controller[_0xa784('0x1a')]);router[_0xa784('0x1b')]('/:id',auth[_0xa784('0x8')](),interaction[_0xa784('0x18')]('fax',_0xa784('0x1c')),controller['destroy']);router[_0xa784('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa784('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 216acbb..f7cb10b 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 _0x9cfd=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0x9cfd,0x180));var _0xd9cf=function(_0x2217eb,_0x572e94){_0x2217eb=_0x2217eb-0x0;var _0x57db5f=_0x9cfd[_0x2217eb];return _0x57db5f;};'use strict';var Sequelize=require(_0xd9cf('0x0'));module[_0xd9cf('0x1')]={'body':{'type':Sequelize[_0xd9cf('0x2')](_0xd9cf('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd9cf('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd9cf('0x5')]('in',_0xd9cf('0x6')),'defaultValue':_0xd9cf('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xd9cf('0x7')]}}; \ No newline at end of file +var _0x5e72=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5e72,0x1e6));var _0x25e7=function(_0x45fd68,_0x3f60a2){_0x45fd68=_0x45fd68-0x0;var _0x2ff2b8=_0x5e72[_0x45fd68];return _0x2ff2b8;};'use strict';var Sequelize=require(_0x25e7('0x0'));module[_0x25e7('0x1')]={'body':{'type':Sequelize[_0x25e7('0x2')](_0x25e7('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x25e7('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x25e7('0x5')]('in',_0x25e7('0x6')),'defaultValue':_0x25e7('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x25e7('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index bb9ad77..a49f29e 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 _0x58c6=['model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','key','field','options','count','includeAll','include','findAll','show','fields','find','body','destroy','params','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','FaxInteraction','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','agent','FaxInteractionId','interaction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','interface','event','rejectmessage','create','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','download','html-pdf','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','stack','name','index','FaxMessage','rawAttributes'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x58c6,0xd0));var _0x658c=function(_0x2f9d83,_0xfbc7e7){_0x2f9d83=_0x2f9d83-0x0;var _0x112d5f=_0x58c6[_0x2f9d83];return _0x112d5f;};'use strict';var pdf=require(_0x658c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x658c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x658c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x658c('0x3'));var Mustache=require(_0x658c('0x4'));var util=require(_0x658c('0x5'));var path=require(_0x658c('0x6'));var sox=require('sox');var csv=require(_0x658c('0x7'));var ejs=require(_0x658c('0x8'));var fs=require('fs');var _=require(_0x658c('0x9'));var squel=require('squel');var crypto=require(_0x658c('0xa'));var jsforce=require(_0x658c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x658c('0x7'));var querystring=require(_0x658c('0xc'));var Papa=require('papaparse');var Redis=require(_0x658c('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x658c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x658c('0xf'))(_0x658c('0x10'));var utils=require(_0x658c('0x11'));var config=require(_0x658c('0x12'));var db=require(_0x658c('0x13'))['db'];config[_0x658c('0x14')]=_[_0x658c('0x15')](config[_0x658c('0x14')],{'host':_0x658c('0x16'),'port':0x18eb});var socket=require(_0x658c('0x17'))(new Redis(config[_0x658c('0x14')]));require('./faxMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x658c('0x18')][_0x658c('0x19')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5554fc,_0x339688,_0x4dcdf8){if(_0x4dcdf8){var _0x413f4b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x413f4b[_0x658c('0x1a')](_0x339688)){return _0x5554fc;}else{throw new Error(_0x658c('0x1b'));}}else{return _0x5554fc;}}function respondWithRpcPromise(_0x533d2a,_0x252e94,_0x1efc17,_0x626c7e){return new BPromise(function(_0x7ecf60,_0x5460fa){var _0xafac86=_0x626c7e||client;return _0xafac86[_0x658c('0x1c')](_0x533d2a,_0x1efc17)[_0x658c('0x1d')](function(_0x154eee){logger['info'](_0x658c('0x1e'),_0x252e94,_0x658c('0x1f'));logger[_0x658c('0x20')](_0x658c('0x21'),_0x252e94,_0x658c('0x1f'),JSON[_0x658c('0x22')](_0x154eee));if(_0x154eee[_0x658c('0x23')]){if(_0x154eee[_0x658c('0x23')][_0x658c('0x24')]===0x1f4){logger[_0x658c('0x23')]('FaxMessage,\x20%s,\x20%s',_0x252e94,_0x154eee['error']['message']);return _0x5460fa(_0x154eee[_0x658c('0x23')][_0x658c('0x25')]);}logger['error'](_0x658c('0x1e'),_0x252e94,_0x154eee[_0x658c('0x23')]['message']);return _0x7ecf60(_0x154eee[_0x658c('0x23')][_0x658c('0x25')]);}else{logger[_0x658c('0x26')](_0x658c('0x1e'),_0x252e94,_0x658c('0x1f'));_0x7ecf60(_0x154eee[_0x658c('0x27')][_0x658c('0x25')]);}})[_0x658c('0x28')](function(_0x1d674d){logger[_0x658c('0x23')](_0x658c('0x1e'),_0x252e94,_0x1d674d);_0x5460fa(_0x1d674d);});});}function respondWithStatusCode(_0x2eac50,_0x3b8622){_0x3b8622=_0x3b8622||0xcc;return function(_0x3d48d4){if(_0x3d48d4){return _0x2eac50[_0x658c('0x29')](_0x3b8622);}return _0x2eac50[_0x658c('0x2a')](_0x3b8622)[_0x658c('0x2b')]();};}function respondWithResult(_0x2136b4,_0x329e85){_0x329e85=_0x329e85||0xc8;return function(_0x59ffc3){if(_0x59ffc3){return _0x2136b4[_0x658c('0x2a')](_0x329e85)[_0x658c('0x2c')](_0x59ffc3);}};}function respondWithFilteredResult(_0x220738,_0x46bdcb){return function(_0x3fcd8b){if(_0x3fcd8b){var _0x312dfc=_0x3fcd8b['count'],_0x11618c=_0x46bdcb[_0x658c('0x2d')],_0x3288cf=_0x46bdcb['offset']+_0x46bdcb['limit'],_0x56e1a6;if(_0x3288cf>=_0x312dfc){_0x3288cf=_0x312dfc;_0x56e1a6=0xc8;}else{_0x56e1a6=0xce;}_0x220738[_0x658c('0x2a')](_0x56e1a6);return _0x220738['set'](_0x658c('0x2e'),_0x11618c+'-'+_0x3288cf+'/'+_0x312dfc)[_0x658c('0x2c')](_0x3fcd8b);}return null;};}function patchUpdates(_0x255a05){return function(_0x4ea1e2){try{jsonpatch[_0x658c('0x2f')](_0x4ea1e2,_0x255a05,!![]);}catch(_0x784fe3){return BPromise[_0x658c('0x30')](_0x784fe3);}return _0x4ea1e2[_0x658c('0x31')]();};}function saveUpdates(_0x138f0e,_0x5ef2d6){return function(_0x1cf71e){if(_0x1cf71e){return _0x1cf71e[_0x658c('0x32')](_0x138f0e)['then'](function(_0x42759a){return _0x42759a;});}return null;};}function removeEntity(_0x21bac3,_0x4cbadd){return function(_0x3c35e4){if(_0x3c35e4){return _0x3c35e4['destroy']()[_0x658c('0x1d')](function(){_0x21bac3['status'](0xcc)[_0x658c('0x2b')]();});}};}function handleEntityNotFound(_0x22a3b4,_0x4ef2f4){return function(_0x2ea17b){if(!_0x2ea17b){_0x22a3b4[_0x658c('0x29')](0x194);}return _0x2ea17b;};}function handleError(_0x22ac5f,_0x17c982){_0x17c982=_0x17c982||0x1f4;return function(_0x2979f8){logger[_0x658c('0x23')](_0x2979f8[_0x658c('0x33')]);if(_0x2979f8[_0x658c('0x34')]){delete _0x2979f8[_0x658c('0x34')];}_0x22ac5f[_0x658c('0x2a')](_0x17c982)['send'](_0x2979f8);};}exports[_0x658c('0x35')]=function(_0x402787,_0x10933c){var _0x24a176={},_0x3acbc4={},_0x103c74={'count':0x0,'rows':[]};var _0x1ef963=db[_0x658c('0x36')][_0x658c('0x37')];_0x3acbc4[_0x658c('0x38')]=_[_0x658c('0x39')](_0x1ef963);_0x3acbc4[_0x658c('0x3a')]=_[_0x658c('0x39')](_0x402787[_0x658c('0x3a')]);_0x3acbc4[_0x658c('0x3b')]=_[_0x658c('0x3c')](_0x3acbc4['model'],_0x3acbc4[_0x658c('0x3a')]);_0x24a176[_0x658c('0x3d')]=_['intersection'](_0x3acbc4[_0x658c('0x38')],qs['fields'](_0x402787[_0x658c('0x3a')]['fields']));_0x24a176['attributes']=_0x24a176['attributes'][_0x658c('0x3e')]?_0x24a176[_0x658c('0x3d')]:_0x3acbc4[_0x658c('0x38')];if(!_0x402787[_0x658c('0x3a')][_0x658c('0x3f')](_0x658c('0x40'))){_0x24a176['limit']=qs['limit'](_0x402787[_0x658c('0x3a')][_0x658c('0x41')]);_0x24a176[_0x658c('0x2d')]=qs[_0x658c('0x2d')](_0x402787[_0x658c('0x3a')]['offset']);}_0x24a176[_0x658c('0x42')]=qs[_0x658c('0x43')](_0x402787[_0x658c('0x3a')]['sort']);_0x24a176[_0x658c('0x44')]=qs[_0x658c('0x3b')](_[_0x658c('0x45')](_0x402787[_0x658c('0x3a')],_0x3acbc4[_0x658c('0x3b')]));if(_0x402787[_0x658c('0x3a')][_0x658c('0x46')]){_0x24a176[_0x658c('0x44')]=_[_0x658c('0x47')](_0x24a176[_0x658c('0x44')],{'$or':_['map'](_0x1ef963,function(_0x26c70a){if(_0x26c70a['type'][_0x658c('0x48')]!=='VIRTUAL'){var _0x4110fc={};_0x4110fc[_0x26c70a[_0x658c('0x49')]]={'$like':'%'+_0x402787[_0x658c('0x3a')]['filter']+'%'};return _0x4110fc;}})});}_0x24a176=_[_0x658c('0x47')]({},_0x24a176,_0x402787[_0x658c('0x4a')]);var _0x5900af={'where':_0x24a176[_0x658c('0x44')]};return db[_0x658c('0x36')][_0x658c('0x4b')](_0x5900af)[_0x658c('0x1d')](function(_0x43b147){_0x103c74['count']=_0x43b147;if(_0x402787[_0x658c('0x3a')][_0x658c('0x4c')]){_0x24a176[_0x658c('0x4d')]=[{'all':!![]}];}return db['FaxMessage'][_0x658c('0x4e')](_0x24a176);})[_0x658c('0x1d')](function(_0x564bd2){_0x103c74['rows']=_0x564bd2;return _0x103c74;})[_0x658c('0x1d')](respondWithFilteredResult(_0x10933c,_0x24a176))[_0x658c('0x28')](handleError(_0x10933c,null));};exports[_0x658c('0x4f')]=function(_0x71ad4e,_0x102fd7){var _0x2add0c={'raw':!![],'where':{'id':_0x71ad4e['params']['id']}},_0x51b70f={};_0x51b70f[_0x658c('0x38')]=_[_0x658c('0x39')](db[_0x658c('0x36')][_0x658c('0x37')]);_0x51b70f[_0x658c('0x3a')]=_[_0x658c('0x39')](_0x71ad4e['query']);_0x51b70f[_0x658c('0x3b')]=_[_0x658c('0x3c')](_0x51b70f['model'],_0x51b70f[_0x658c('0x3a')]);_0x2add0c[_0x658c('0x3d')]=_[_0x658c('0x3c')](_0x51b70f[_0x658c('0x38')],qs[_0x658c('0x50')](_0x71ad4e[_0x658c('0x3a')][_0x658c('0x50')]));_0x2add0c[_0x658c('0x3d')]=_0x2add0c['attributes']['length']?_0x2add0c['attributes']:_0x51b70f[_0x658c('0x38')];if(_0x71ad4e[_0x658c('0x3a')][_0x658c('0x4c')]){_0x2add0c['include']=[{'all':!![]}];}_0x2add0c=_[_0x658c('0x47')]({},_0x2add0c,_0x71ad4e[_0x658c('0x4a')]);return db['FaxMessage'][_0x658c('0x51')](_0x2add0c)['then'](handleEntityNotFound(_0x102fd7,null))[_0x658c('0x1d')](respondWithResult(_0x102fd7,null))['catch'](handleError(_0x102fd7,null));};exports['update']=function(_0x1fbd1b,_0x41531b){if(_0x1fbd1b[_0x658c('0x52')]['id']){delete _0x1fbd1b['body']['id'];}return db['FaxMessage'][_0x658c('0x51')]({'where':{'id':_0x1fbd1b['params']['id']}})[_0x658c('0x1d')](handleEntityNotFound(_0x41531b,null))['then'](saveUpdates(_0x1fbd1b[_0x658c('0x52')],null))[_0x658c('0x1d')](respondWithResult(_0x41531b,null))['catch'](handleError(_0x41531b,null));};exports[_0x658c('0x53')]=function(_0x2df7ce,_0x434c8d){return db[_0x658c('0x36')]['find']({'where':{'id':_0x2df7ce[_0x658c('0x54')]['id']}})[_0x658c('0x1d')](handleEntityNotFound(_0x434c8d,null))['then'](removeEntity(_0x434c8d,null))['catch'](handleError(_0x434c8d,null));};exports[_0x658c('0x55')]=function(_0x50767e,_0x533479){return db['FaxMessage']['describe']()[_0x658c('0x1d')](respondWithResult(_0x533479,null))[_0x658c('0x28')](handleError(_0x533479,null));};var interaction_log=require(_0x658c('0xf'))(_0x658c('0x56'));exports[_0x658c('0x57')]=function(_0x303efb,_0xb36229,_0x56980d){var _0x4d49df={'channel':_0x658c('0x58')};if(_0x303efb[_0x658c('0x52')]['id']){delete _0x303efb['body']['id'];}_0x303efb[_0x658c('0x52')][_0x658c('0x59')]=!![];_0x303efb[_0x658c('0x52')]['readAt']=moment()[_0x658c('0x5a')](_0x658c('0x5b'));_0x303efb[_0x658c('0x52')][_0x658c('0x5c')]=_0x303efb[_0x658c('0x52')][_0x658c('0x5c')]||_0x303efb[_0x658c('0x5d')]['id'];return db[_0x658c('0x36')][_0x658c('0x51')]({'where':{'id':_0x303efb[_0x658c('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x658c('0x5e')}]})['then'](handleEntityNotFound(_0xb36229,null))[_0x658c('0x1d')](saveUpdates(_0x303efb[_0x658c('0x52')],null))['then'](function(_0x2e9a1d){if(_0x2e9a1d){_0x4d49df[_0x658c('0x25')]=_0x2e9a1d[_0x658c('0x5f')]({'plain':!![]});return db[_0x658c('0x60')][_0x658c('0x51')]({'where':{'id':_0x2e9a1d['FaxInteractionId']}});}return null;})[_0x658c('0x1d')](handleEntityNotFound(_0xb36229,null))[_0x658c('0x1d')](function(_0xefba30){if(_0xefba30){return _0xefba30[_0x658c('0x32')]({'UserId':_0x303efb['body']['UserId'],'read1stAt':_[_0x658c('0x61')](_0xefba30[_0x658c('0x62')])?moment()[_0x658c('0x5a')](_0x658c('0x5b')):undefined});}return null;})[_0x658c('0x1d')](function(_0x5f0013){if(_0x5f0013){_0x4d49df['interaction']=_0x5f0013[_0x658c('0x5f')]({'plain':!![]});interaction_log[_0x658c('0x26')](_0x658c('0x63'),_0x303efb[_0x658c('0x5d')]['id'],_0x303efb[_0x658c('0x5d')][_0x658c('0x34')],_0x303efb[_0x658c('0x5d')][_0x658c('0x64')],_0x4d49df['interaction']['id'],_0x303efb[_0x658c('0x52')]?JSON[_0x658c('0x22')](_0x303efb[_0x658c('0x52')]):'null');return respondWithRpcPromise(_0x658c('0x65'),_0x658c('0x66'),_0x4d49df);}return null;})[_0x658c('0x1d')](function(_0xd1d0f9){if(_0xd1d0f9){if(_0x303efb[_0x658c('0x52')][_0x658c('0x67')]){_0x4d49df[_0x658c('0x25')]['interface']=util['format'](_0x658c('0x68'),_0x303efb['user'][_0x658c('0x34')]);_0x4d49df[_0x658c('0x25')][_0x658c('0x69')]=_0x4d49df[_0x658c('0x69')];_0x4d49df[_0x658c('0x25')]['event']='accept';return respondWithRpcPromise('EventManager',_0x658c('0x6a'),{'event':_0x658c('0x6b'),'message':_0x4d49df[_0x658c('0x25')]},client9002)[_0x658c('0x1d')](function(){return _0x4d49df;});}return _0x4d49df;}return null;})[_0x658c('0x1d')](respondWithResult(_0xb36229,null))[_0x658c('0x28')](handleError(_0xb36229,null));};var interaction_log=require(_0x658c('0xf'))(_0x658c('0x56'));exports[_0x658c('0x30')]=function(_0x1d5e21,_0x3ae3dc,_0x30faac){var _0x45bddc={'agent':{},'channel':_0x658c('0x58')};if(_0x1d5e21[_0x658c('0x52')]['id']){delete _0x1d5e21[_0x658c('0x52')]['id'];}_0x1d5e21[_0x658c('0x52')][_0x658c('0x5c')]=_0x1d5e21[_0x658c('0x52')][_0x658c('0x5c')]||_0x1d5e21[_0x658c('0x5d')]['id'];_0x45bddc[_0x658c('0x6c')]['id']=_0x1d5e21[_0x658c('0x52')][_0x658c('0x5c')];return db[_0x658c('0x36')][_0x658c('0x51')]({'where':{'id':_0x1d5e21[_0x658c('0x54')]['id'],'UserId':null}})[_0x658c('0x1d')](handleEntityNotFound(_0x3ae3dc,null))[_0x658c('0x1d')](function(_0x38797a){if(_0x38797a){_0x45bddc[_0x658c('0x25')]=_0x38797a[_0x658c('0x5f')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x38797a[_0x658c('0x6d')]}});}return null;})[_0x658c('0x1d')](handleEntityNotFound(_0x3ae3dc,null))[_0x658c('0x1d')](function(_0x287196){if(_0x287196){_0x45bddc[_0x658c('0x6e')]=_0x287196['get']({'plain':!![]});interaction_log[_0x658c('0x26')](_0x658c('0x6f'),_0x1d5e21[_0x658c('0x5d')]['id'],_0x1d5e21[_0x658c('0x5d')][_0x658c('0x34')],_0x1d5e21[_0x658c('0x5d')][_0x658c('0x64')],_0x45bddc[_0x658c('0x6e')]['id'],_0x1d5e21['body']?JSON[_0x658c('0x22')](_0x1d5e21[_0x658c('0x52')]):_0x658c('0x70'));return respondWithRpcPromise(_0x658c('0x71'),_0x658c('0x72'),_0x45bddc);}return null;})['then'](function(_0x4ac707){if(_0x4ac707){_0x4ac707['message'][_0x658c('0x73')]=util['format']('SIP/%s',_0x1d5e21[_0x658c('0x5d')]['name']);_0x4ac707[_0x658c('0x25')][_0x658c('0x69')]=_0x45bddc['channel'];_0x4ac707['message'][_0x658c('0x74')]=_0x658c('0x30');respondWithRpcPromise(_0x658c('0x6a'),_0x658c('0x6a'),{'event':_0x658c('0x75'),'message':_0x4ac707['message']},client9002);return _0x45bddc;}return null;})[_0x658c('0x1d')](respondWithResult(_0x3ae3dc,null))[_0x658c('0x28')](handleError(_0x3ae3dc,null));};exports[_0x658c('0x76')]=function(_0x1ef338,_0x99071c){var _0x976db1;return db[_0x658c('0x36')][_0x658c('0x76')](_0x1ef338['body'],{})[_0x658c('0x1d')](function(_0x3c8191){_0x976db1=_0x3c8191;return db['CmContact'][_0x658c('0x77')]({'where':{'id':_0x976db1[_0x658c('0x78')]}});})['then'](function(_0x271bf7){if(_['isNil'](_0x271bf7)){return;}else{_0x976db1['fax']=_0x271bf7[_0x658c('0x58')];return db[_0x658c('0x79')][_0x658c('0x77')]({'where':{'id':_0x976db1[_0x658c('0x7a')]}});}})[_0x658c('0x1d')](function(_0x500c6c){return respondWithRpcPromise('SendFax',_0x658c('0x7b'),{'FaxAccountId':_[_0x658c('0x61')](_0x1ef338[_0x658c('0x52')])?undefined:_0x1ef338['body'][_0x658c('0x7c')],'path':_[_0x658c('0x61')](_0x500c6c)?undefined:util[_0x658c('0x5a')](_0x658c('0x7d'),_0x500c6c[_0x658c('0x7e')]),'fax':_['isNil'](_0x976db1[_0x658c('0x58')])?undefined:_0x976db1[_0x658c('0x58')],'AttachmentId':_0x976db1[_0x658c('0x7a')]},client9002);})[_0x658c('0x1d')](respondWithResult(_0x99071c,0xc9))[_0x658c('0x28')](handleError(_0x99071c,null));};exports['download']=function(_0x5d38d5,_0x3c6638){var _0x2c3c17=path[_0x658c('0x7f')](config[_0x658c('0x80')],_0x658c('0x81'),'files',_0x658c('0x82'));return db['FaxMessage']['find']({'where':{'id':_0x5d38d5[_0x658c('0x54')]['id']},'include':[{'model':db[_0x658c('0x79')],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x3c6638,null))[_0x658c('0x1d')](function(_0x14da1d){if(_0x14da1d){return _0x3c6638[_0x658c('0x83')](path[_0x658c('0x7f')](_0x2c3c17,_0x14da1d['Attachment'][_0x658c('0x7e')]));}})['catch'](handleError(_0x3c6638,null));}; \ No newline at end of file +var _0x858e=['isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','basename','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','save','update','destroy','stack','name','send','index','FaxMessage','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','map','key','VIRTUAL','field','then','includeAll','include','findAll','params','rawAttributes','body','find','describe','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','reject','agent','FaxInteractionId','null','RejectMessage','rejectMessage','rejectmessage','create','findOne'];(function(_0x487702,_0x49f5d4){var _0x5e7150=function(_0x2b2b29){while(--_0x2b2b29){_0x487702['push'](_0x487702['shift']());}};_0x5e7150(++_0x49f5d4);}(_0x858e,0x10c));var _0xe858=function(_0x217ce7,_0x592574){_0x217ce7=_0x217ce7-0x0;var _0x4d3f53=_0x858e[_0x217ce7];return _0x4d3f53;};'use strict';var pdf=require(_0xe858('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe858('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe858('0x2'));var rp=require(_0xe858('0x3'));var moment=require(_0xe858('0x4'));var BPromise=require(_0xe858('0x5'));var Mustache=require(_0xe858('0x6'));var util=require(_0xe858('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe858('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe858('0x9'));var crypto=require(_0xe858('0xa'));var jsforce=require(_0xe858('0xb'));var deskjs=require(_0xe858('0xc'));var toCsv=require(_0xe858('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe858('0xd'));var authService=require(_0xe858('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xe858('0xf'));var logger=require(_0xe858('0x10'))('api');var utils=require(_0xe858('0x11'));var config=require(_0xe858('0x12'));var db=require('../../mysqldb')['db'];config[_0xe858('0x13')]=_[_0xe858('0x14')](config[_0xe858('0x13')],{'host':_0xe858('0x15'),'port':0x18eb});var socket=require(_0xe858('0x16'))(new Redis(config['redis']));require(_0xe858('0x17'))[_0xe858('0x18')](socket);var jayson=require(_0xe858('0x19'));var client=jayson[_0xe858('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0xe858('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4eabd3,_0x2a58fa,_0x592237){if(_0x592237){var _0x14e6b7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14e6b7[_0xe858('0x1c')](_0x2a58fa)){return _0x4eabd3;}else{throw new Error(_0xe858('0x1d'));}}else{return _0x4eabd3;}}function respondWithRpcPromise(_0x287bdc,_0x1f9111,_0x48bd32,_0x277be6){return new BPromise(function(_0x4a6edc,_0x511af4){var _0x413f9d=_0x277be6||client;return _0x413f9d[_0xe858('0x1e')](_0x287bdc,_0x48bd32)['then'](function(_0x5db43d){logger[_0xe858('0x1f')](_0xe858('0x20'),_0x1f9111,_0xe858('0x21'));logger[_0xe858('0x22')](_0xe858('0x23'),_0x1f9111,_0xe858('0x21'),JSON[_0xe858('0x24')](_0x5db43d));if(_0x5db43d[_0xe858('0x25')]){if(_0x5db43d[_0xe858('0x25')][_0xe858('0x26')]===0x1f4){logger[_0xe858('0x25')]('FaxMessage,\x20%s,\x20%s',_0x1f9111,_0x5db43d[_0xe858('0x25')][_0xe858('0x27')]);return _0x511af4(_0x5db43d[_0xe858('0x25')][_0xe858('0x27')]);}logger[_0xe858('0x25')]('FaxMessage,\x20%s,\x20%s',_0x1f9111,_0x5db43d[_0xe858('0x25')]['message']);return _0x4a6edc(_0x5db43d['error'][_0xe858('0x27')]);}else{logger[_0xe858('0x1f')](_0xe858('0x20'),_0x1f9111,_0xe858('0x21'));_0x4a6edc(_0x5db43d[_0xe858('0x28')]['message']);}})[_0xe858('0x29')](function(_0x6aab29){logger[_0xe858('0x25')](_0xe858('0x20'),_0x1f9111,_0x6aab29);_0x511af4(_0x6aab29);});});}function respondWithStatusCode(_0x48cf95,_0x379cc8){_0x379cc8=_0x379cc8||0xcc;return function(_0x5229b2){if(_0x5229b2){return _0x48cf95['sendStatus'](_0x379cc8);}return _0x48cf95[_0xe858('0x2a')](_0x379cc8)[_0xe858('0x2b')]();};}function respondWithResult(_0xe98114,_0x1c4e7d){_0x1c4e7d=_0x1c4e7d||0xc8;return function(_0x4d35d8){if(_0x4d35d8){return _0xe98114['status'](_0x1c4e7d)[_0xe858('0x2c')](_0x4d35d8);}};}function respondWithFilteredResult(_0x42c5e0,_0x45db0b){return function(_0x3d0162){if(_0x3d0162){var _0x5c334e=_0x3d0162[_0xe858('0x2d')],_0x51b983=_0x45db0b[_0xe858('0x2e')],_0x46e9eb=_0x45db0b[_0xe858('0x2e')]+_0x45db0b[_0xe858('0x2f')],_0x3888b7;if(_0x46e9eb>=_0x5c334e){_0x46e9eb=_0x5c334e;_0x3888b7=0xc8;}else{_0x3888b7=0xce;}_0x42c5e0[_0xe858('0x2a')](_0x3888b7);return _0x42c5e0[_0xe858('0x30')]('Content-Range',_0x51b983+'-'+_0x46e9eb+'/'+_0x5c334e)[_0xe858('0x2c')](_0x3d0162);}return null;};}function patchUpdates(_0x50b7e8){return function(_0x1e05ab){try{jsonpatch['apply'](_0x1e05ab,_0x50b7e8,!![]);}catch(_0x408f12){return BPromise['reject'](_0x408f12);}return _0x1e05ab[_0xe858('0x31')]();};}function saveUpdates(_0x2719e7,_0x7cf7e6){return function(_0x212c2b){if(_0x212c2b){return _0x212c2b[_0xe858('0x32')](_0x2719e7)['then'](function(_0x4f10a2){return _0x4f10a2;});}return null;};}function removeEntity(_0x18a0e0,_0x1687b7){return function(_0x4da115){if(_0x4da115){return _0x4da115[_0xe858('0x33')]()['then'](function(){_0x18a0e0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x526cbe,_0x1f8cd7){return function(_0xecc118){if(!_0xecc118){_0x526cbe['sendStatus'](0x194);}return _0xecc118;};}function handleError(_0x36ba67,_0x4ded4a){_0x4ded4a=_0x4ded4a||0x1f4;return function(_0xf094ec){logger[_0xe858('0x25')](_0xf094ec[_0xe858('0x34')]);if(_0xf094ec[_0xe858('0x35')]){delete _0xf094ec[_0xe858('0x35')];}_0x36ba67[_0xe858('0x2a')](_0x4ded4a)[_0xe858('0x36')](_0xf094ec);};}exports[_0xe858('0x37')]=function(_0x30a22d,_0x50fd12){var _0x21c08d={},_0xad3387={},_0x428b9d={'count':0x0,'rows':[]};var _0x3f6c4d=db[_0xe858('0x38')]['rawAttributes'];_0xad3387['model']=_[_0xe858('0x39')](_0x3f6c4d);_0xad3387['query']=_['keys'](_0x30a22d[_0xe858('0x3a')]);_0xad3387['filters']=_[_0xe858('0x3b')](_0xad3387[_0xe858('0x3c')],_0xad3387[_0xe858('0x3a')]);_0x21c08d['attributes']=_['intersection'](_0xad3387[_0xe858('0x3c')],qs[_0xe858('0x3d')](_0x30a22d[_0xe858('0x3a')][_0xe858('0x3d')]));_0x21c08d[_0xe858('0x3e')]=_0x21c08d[_0xe858('0x3e')][_0xe858('0x3f')]?_0x21c08d[_0xe858('0x3e')]:_0xad3387[_0xe858('0x3c')];if(!_0x30a22d[_0xe858('0x3a')][_0xe858('0x40')](_0xe858('0x41'))){_0x21c08d[_0xe858('0x2f')]=qs[_0xe858('0x2f')](_0x30a22d['query'][_0xe858('0x2f')]);_0x21c08d[_0xe858('0x2e')]=qs['offset'](_0x30a22d[_0xe858('0x3a')][_0xe858('0x2e')]);}_0x21c08d[_0xe858('0x42')]=qs[_0xe858('0x43')](_0x30a22d[_0xe858('0x3a')]['sort']);_0x21c08d['where']=qs[_0xe858('0x44')](_['pick'](_0x30a22d[_0xe858('0x3a')],_0xad3387[_0xe858('0x44')]));if(_0x30a22d[_0xe858('0x3a')][_0xe858('0x45')]){_0x21c08d[_0xe858('0x46')]=_[_0xe858('0x47')](_0x21c08d['where'],{'$or':_[_0xe858('0x48')](_0x3f6c4d,function(_0x163a56){if(_0x163a56['type'][_0xe858('0x49')]!==_0xe858('0x4a')){var _0x5120ef={};_0x5120ef[_0x163a56[_0xe858('0x4b')]]={'$like':'%'+_0x30a22d['query'][_0xe858('0x45')]+'%'};return _0x5120ef;}})});}_0x21c08d=_[_0xe858('0x47')]({},_0x21c08d,_0x30a22d['options']);var _0x51c3f7={'where':_0x21c08d['where']};return db[_0xe858('0x38')][_0xe858('0x2d')](_0x51c3f7)[_0xe858('0x4c')](function(_0x1812d8){_0x428b9d[_0xe858('0x2d')]=_0x1812d8;if(_0x30a22d[_0xe858('0x3a')][_0xe858('0x4d')]){_0x21c08d[_0xe858('0x4e')]=[{'all':!![]}];}return db[_0xe858('0x38')][_0xe858('0x4f')](_0x21c08d);})[_0xe858('0x4c')](function(_0x48b6ed){_0x428b9d['rows']=_0x48b6ed;return _0x428b9d;})[_0xe858('0x4c')](respondWithFilteredResult(_0x50fd12,_0x21c08d))[_0xe858('0x29')](handleError(_0x50fd12,null));};exports['show']=function(_0x4972bf,_0x265e6a){var _0x50183d={'raw':!![],'where':{'id':_0x4972bf[_0xe858('0x50')]['id']}},_0x13ea07={};_0x13ea07[_0xe858('0x3c')]=_['keys'](db['FaxMessage'][_0xe858('0x51')]);_0x13ea07[_0xe858('0x3a')]=_[_0xe858('0x39')](_0x4972bf[_0xe858('0x3a')]);_0x13ea07['filters']=_[_0xe858('0x3b')](_0x13ea07['model'],_0x13ea07[_0xe858('0x3a')]);_0x50183d['attributes']=_[_0xe858('0x3b')](_0x13ea07[_0xe858('0x3c')],qs[_0xe858('0x3d')](_0x4972bf[_0xe858('0x3a')]['fields']));_0x50183d[_0xe858('0x3e')]=_0x50183d[_0xe858('0x3e')][_0xe858('0x3f')]?_0x50183d['attributes']:_0x13ea07[_0xe858('0x3c')];if(_0x4972bf[_0xe858('0x3a')][_0xe858('0x4d')]){_0x50183d['include']=[{'all':!![]}];}_0x50183d=_[_0xe858('0x47')]({},_0x50183d,_0x4972bf['options']);return db[_0xe858('0x38')]['find'](_0x50183d)[_0xe858('0x4c')](handleEntityNotFound(_0x265e6a,null))['then'](respondWithResult(_0x265e6a,null))[_0xe858('0x29')](handleError(_0x265e6a,null));};exports[_0xe858('0x32')]=function(_0x2a5148,_0x4dff27){if(_0x2a5148['body']['id']){delete _0x2a5148['body']['id'];}return db[_0xe858('0x38')]['find']({'where':{'id':_0x2a5148[_0xe858('0x50')]['id']}})[_0xe858('0x4c')](handleEntityNotFound(_0x4dff27,null))[_0xe858('0x4c')](saveUpdates(_0x2a5148[_0xe858('0x52')],null))[_0xe858('0x4c')](respondWithResult(_0x4dff27,null))[_0xe858('0x29')](handleError(_0x4dff27,null));};exports[_0xe858('0x33')]=function(_0x2fd499,_0x51326c){return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x2fd499[_0xe858('0x50')]['id']}})[_0xe858('0x4c')](handleEntityNotFound(_0x51326c,null))[_0xe858('0x4c')](removeEntity(_0x51326c,null))[_0xe858('0x29')](handleError(_0x51326c,null));};exports[_0xe858('0x54')]=function(_0x1a5546,_0x7ba88c){return db[_0xe858('0x38')][_0xe858('0x54')]()[_0xe858('0x4c')](respondWithResult(_0x7ba88c,null))[_0xe858('0x29')](handleError(_0x7ba88c,null));};var interaction_log=require(_0xe858('0x10'))('fax-interactions');exports[_0xe858('0x55')]=function(_0x45a2e4,_0x51a3f3,_0x17d9d3){var _0x3356d1={'channel':_0xe858('0x56')};if(_0x45a2e4[_0xe858('0x52')]['id']){delete _0x45a2e4[_0xe858('0x52')]['id'];}_0x45a2e4[_0xe858('0x52')][_0xe858('0x57')]=!![];_0x45a2e4[_0xe858('0x52')]['readAt']=moment()[_0xe858('0x58')](_0xe858('0x59'));_0x45a2e4[_0xe858('0x52')][_0xe858('0x5a')]=_0x45a2e4[_0xe858('0x52')]['UserId']||_0x45a2e4[_0xe858('0x5b')]['id'];return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x45a2e4[_0xe858('0x50')]['id'],'UserId':null},'include':[{'model':db[_0xe858('0x5c')],'as':_0xe858('0x5d')}]})[_0xe858('0x4c')](handleEntityNotFound(_0x51a3f3,null))['then'](saveUpdates(_0x45a2e4[_0xe858('0x52')],null))['then'](function(_0x578f7b){if(_0x578f7b){_0x3356d1[_0xe858('0x27')]=_0x578f7b['get']({'plain':!![]});return db[_0xe858('0x5e')][_0xe858('0x53')]({'where':{'id':_0x578f7b['FaxInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x51a3f3,null))[_0xe858('0x4c')](function(_0x13d8ad){if(_0x13d8ad){return _0x13d8ad[_0xe858('0x32')]({'UserId':_0x45a2e4[_0xe858('0x52')][_0xe858('0x5a')],'read1stAt':_['isNil'](_0x13d8ad['read1stAt'])?moment()[_0xe858('0x58')](_0xe858('0x59')):undefined});}return null;})[_0xe858('0x4c')](function(_0x5752c9){if(_0x5752c9){_0x3356d1[_0xe858('0x5f')]=_0x5752c9[_0xe858('0x60')]({'plain':!![]});interaction_log[_0xe858('0x1f')](_0xe858('0x61'),_0x45a2e4[_0xe858('0x5b')]['id'],_0x45a2e4[_0xe858('0x5b')]['name'],_0x45a2e4[_0xe858('0x5b')][_0xe858('0x62')],_0x3356d1['interaction']['id'],_0x45a2e4[_0xe858('0x52')]?JSON[_0xe858('0x24')](_0x45a2e4[_0xe858('0x52')]):'null');return respondWithRpcPromise('AcceptMessage',_0xe858('0x63'),_0x3356d1);}return null;})[_0xe858('0x4c')](function(_0x1cfe95){if(_0x1cfe95){if(_0x45a2e4[_0xe858('0x52')]['manual']){_0x3356d1[_0xe858('0x27')][_0xe858('0x64')]=util[_0xe858('0x58')](_0xe858('0x65'),_0x45a2e4[_0xe858('0x5b')][_0xe858('0x35')]);_0x3356d1[_0xe858('0x27')][_0xe858('0x66')]=_0x3356d1[_0xe858('0x66')];_0x3356d1[_0xe858('0x27')][_0xe858('0x67')]=_0xe858('0x55');return respondWithRpcPromise(_0xe858('0x68'),_0xe858('0x68'),{'event':_0xe858('0x69'),'message':_0x3356d1[_0xe858('0x27')]},client9002)['then'](function(){return _0x3356d1;});}return _0x3356d1;}return null;})['then'](respondWithResult(_0x51a3f3,null))[_0xe858('0x29')](handleError(_0x51a3f3,null));};var interaction_log=require(_0xe858('0x10'))(_0xe858('0x6a'));exports[_0xe858('0x6b')]=function(_0x3d7f93,_0x60cbea,_0x54bef7){var _0x10c514={'agent':{},'channel':_0xe858('0x56')};if(_0x3d7f93[_0xe858('0x52')]['id']){delete _0x3d7f93[_0xe858('0x52')]['id'];}_0x3d7f93[_0xe858('0x52')][_0xe858('0x5a')]=_0x3d7f93[_0xe858('0x52')][_0xe858('0x5a')]||_0x3d7f93[_0xe858('0x5b')]['id'];_0x10c514[_0xe858('0x6c')]['id']=_0x3d7f93['body']['UserId'];return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x3d7f93['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x60cbea,null))[_0xe858('0x4c')](function(_0x226b40){if(_0x226b40){_0x10c514[_0xe858('0x27')]=_0x226b40[_0xe858('0x60')]({'plain':!![]});return db['FaxInteraction'][_0xe858('0x53')]({'where':{'id':_0x226b40[_0xe858('0x6d')]}});}return null;})[_0xe858('0x4c')](handleEntityNotFound(_0x60cbea,null))['then'](function(_0x4e435b){if(_0x4e435b){_0x10c514['interaction']=_0x4e435b[_0xe858('0x60')]({'plain':!![]});interaction_log[_0xe858('0x1f')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3d7f93[_0xe858('0x5b')]['id'],_0x3d7f93['user']['name'],_0x3d7f93['user'][_0xe858('0x62')],_0x10c514[_0xe858('0x5f')]['id'],_0x3d7f93[_0xe858('0x52')]?JSON[_0xe858('0x24')](_0x3d7f93[_0xe858('0x52')]):_0xe858('0x6e'));return respondWithRpcPromise(_0xe858('0x6f'),_0xe858('0x70'),_0x10c514);}return null;})['then'](function(_0x16f8cc){if(_0x16f8cc){_0x16f8cc['message'][_0xe858('0x64')]=util[_0xe858('0x58')](_0xe858('0x65'),_0x3d7f93['user']['name']);_0x16f8cc[_0xe858('0x27')][_0xe858('0x66')]=_0x10c514[_0xe858('0x66')];_0x16f8cc['message'][_0xe858('0x67')]=_0xe858('0x6b');respondWithRpcPromise(_0xe858('0x68'),_0xe858('0x68'),{'event':_0xe858('0x71'),'message':_0x16f8cc['message']},client9002);return _0x10c514;}return null;})[_0xe858('0x4c')](respondWithResult(_0x60cbea,null))['catch'](handleError(_0x60cbea,null));};exports[_0xe858('0x72')]=function(_0x2ebf53,_0x1b2d6e){var _0x3b9285;return db[_0xe858('0x38')][_0xe858('0x72')](_0x2ebf53[_0xe858('0x52')],{})['then'](function(_0xd799f5){_0x3b9285=_0xd799f5;return db[_0xe858('0x5c')][_0xe858('0x73')]({'where':{'id':_0x3b9285['ContactId']}});})[_0xe858('0x4c')](function(_0x3d4b1d){if(_[_0xe858('0x74')](_0x3d4b1d)){return;}else{_0x3b9285['fax']=_0x3d4b1d[_0xe858('0x56')];return db[_0xe858('0x75')]['findOne']({'where':{'id':_0x3b9285[_0xe858('0x76')]}});}})[_0xe858('0x4c')](function(_0x3faeaa){return respondWithRpcPromise(_0xe858('0x77'),_0xe858('0x77'),{'FaxAccountId':_[_0xe858('0x74')](_0x2ebf53[_0xe858('0x52')])?undefined:_0x2ebf53[_0xe858('0x52')][_0xe858('0x78')],'path':_[_0xe858('0x74')](_0x3faeaa)?undefined:util[_0xe858('0x58')](_0xe858('0x79'),_0x3faeaa['basename']),'fax':_[_0xe858('0x74')](_0x3b9285[_0xe858('0x56')])?undefined:_0x3b9285[_0xe858('0x56')],'AttachmentId':_0x3b9285['AttachmentId']},client9002);})[_0xe858('0x4c')](respondWithResult(_0x1b2d6e,0xc9))[_0xe858('0x29')](handleError(_0x1b2d6e,null));};exports[_0xe858('0x7a')]=function(_0x5b8781,_0x39cc6c){var _0x2d3c60=path[_0xe858('0x7b')](config[_0xe858('0x7c')],_0xe858('0x7d'),_0xe858('0x7e'),'attachments');return db[_0xe858('0x38')][_0xe858('0x53')]({'where':{'id':_0x5b8781['params']['id']},'include':[{'model':db['Attachment'],'as':_0xe858('0x75')}]})[_0xe858('0x4c')](handleEntityNotFound(_0x39cc6c,null))[_0xe858('0x4c')](function(_0x497ff2){if(_0x497ff2){return _0x39cc6c[_0xe858('0x7a')](path[_0xe858('0x7b')](_0x2d3c60,_0x497ff2[_0xe858('0x75')][_0xe858('0x7f')]));}})[_0xe858('0x29')](handleError(_0x39cc6c,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 4688644..ec574ed 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 _0x4f8d=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','save','update','remove','emit'];(function(_0x22ee10,_0xf53f9d){var _0x90e888=function(_0x2c87ea){while(--_0x2c87ea){_0x22ee10['push'](_0x22ee10['shift']());}};_0x90e888(++_0xf53f9d);}(_0x4f8d,0x12f));var _0xd4f8=function(_0xea35d1,_0x302471){_0xea35d1=_0xea35d1-0x0;var _0x1d7a7c=_0x4f8d[_0xea35d1];return _0x1d7a7c;};'use strict';var EventEmitter=require(_0xd4f8('0x0'));var FaxMessage=require(_0xd4f8('0x1'))['db'][_0xd4f8('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd4f8('0x3'),'afterUpdate':_0xd4f8('0x4'),'afterDestroy':_0xd4f8('0x5')};function emitEvent(_0x34db3b){return function(_0x2dcc11,_0x48e48d,_0x366839){FaxMessageEvents[_0xd4f8('0x6')](_0x34db3b+':'+_0x2dcc11['id'],_0x2dcc11);FaxMessageEvents[_0xd4f8('0x6')](_0x34db3b,_0x2dcc11);_0x366839(null);};}for(var e in events){if(events[_0xd4f8('0x7')](e)){var event=events[e];FaxMessage[_0xd4f8('0x8')](e,emitEvent(event));}}module[_0xd4f8('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0xd0c8=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','FaxMessage','save'];(function(_0x1ba8a2,_0x16bf47){var _0x517541=function(_0x1e01d2){while(--_0x1e01d2){_0x1ba8a2['push'](_0x1ba8a2['shift']());}};_0x517541(++_0x16bf47);}(_0xd0c8,0xcd));var _0x8d0c=function(_0x4ec767,_0x4e55f3){_0x4ec767=_0x4ec767-0x0;var _0x94eb04=_0xd0c8[_0x4ec767];return _0x94eb04;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x8d0c('0x0'))['db'][_0x8d0c('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8d0c('0x2'),'afterUpdate':_0x8d0c('0x3'),'afterDestroy':_0x8d0c('0x4')};function emitEvent(_0x35ea93){return function(_0xc9143e,_0x10be27,_0xa88e40){FaxMessageEvents['emit'](_0x35ea93+':'+_0xc9143e['id'],_0xc9143e);FaxMessageEvents[_0x8d0c('0x5')](_0x35ea93,_0xc9143e);_0xa88e40(null);};}for(var e in events){if(events[_0x8d0c('0x6')](e)){var event=events[e];FaxMessage[_0x8d0c('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 7cec2e7..e894ac5 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 _0x1d0e=['models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','fax_messages','fti_fax_messages','FULLTEXT'];(function(_0x10e3ff,_0x286bd8){var _0x1f2fe1=function(_0x89886a){while(--_0x89886a){_0x10e3ff['push'](_0x10e3ff['shift']());}};_0x1f2fe1(++_0x286bd8);}(_0x1d0e,0xa2));var _0xe1d0=function(_0x186a7f,_0x281016){_0x186a7f=_0x186a7f-0x0;var _0x4d27ce=_0x1d0e[_0x186a7f];return _0x4d27ce;};'use strict';var _=require('lodash');var util=require(_0xe1d0('0x0'));var logger=require(_0xe1d0('0x1'))('api');var moment=require(_0xe1d0('0x2'));var BPromise=require(_0xe1d0('0x3'));var rp=require(_0xe1d0('0x4'));var fs=require('fs');var path=require(_0xe1d0('0x5'));var rimraf=require(_0xe1d0('0x6'));var config=require(_0xe1d0('0x7'));var attributes=require('./faxMessage.attributes');module[_0xe1d0('0x8')]=function(_0x51599d,_0x5e83cd){return _0x51599d['define']('FaxMessage',attributes,{'tableName':_0xe1d0('0x9'),'paranoid':![],'indexes':[{'name':_0xe1d0('0xa'),'fields':['body'],'type':_0xe1d0('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58c473,_0x509612,_0x1d71eb){var _0x2a3260=_0x51599d[_0xe1d0('0xc')];var _0xd7745a=_0x58c473[_0xe1d0('0xd')]({'plain':!![]});if(_0xd7745a[_0xe1d0('0xe')][_0xe1d0('0xf')]()==='in'||_0xd7745a['direction']['toLowerCase']()===_0xe1d0('0x10')&&!_0xd7745a[_0xe1d0('0x11')]&&!_[_0xe1d0('0x12')](_0xd7745a[_0xe1d0('0x13')])){_0x2a3260[_0xe1d0('0x14')]['findOne']({'where':{'id':_0xd7745a[_0xe1d0('0x15')]}})[_0xe1d0('0x16')](function(_0x32a4d1){if(_0x32a4d1){_0x32a4d1[_0xe1d0('0x17')]({'lastMsgAt':_0xd7745a[_0xe1d0('0x18')],'lastMsgDirection':_0xd7745a[_0xe1d0('0xe')][_0xe1d0('0xf')]()});}})[_0xe1d0('0x19')](function(_0x4a4545){console[_0xe1d0('0x1a')](_0x4a4545);});}_0x1d71eb();}},'charset':_0xe1d0('0x1b'),'collate':_0xe1d0('0x1c')});}; \ No newline at end of file +var _0xa82c=['toLowerCase','direction','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','catch','error','utf8mb4_unicode_ci','util','api','moment','bluebird','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','body','FULLTEXT','models','get'];(function(_0x931446,_0x61f05a){var _0x5e6e68=function(_0x4fd213){while(--_0x4fd213){_0x931446['push'](_0x931446['shift']());}};_0x5e6e68(++_0x61f05a);}(_0xa82c,0x12a));var _0xca82=function(_0x206fb4,_0x3c8834){_0x206fb4=_0x206fb4-0x0;var _0x28cb32=_0xa82c[_0x206fb4];return _0x28cb32;};'use strict';var _=require('lodash');var util=require(_0xca82('0x0'));var logger=require('../../config/logger')(_0xca82('0x1'));var moment=require(_0xca82('0x2'));var BPromise=require(_0xca82('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xca82('0x4'));var config=require(_0xca82('0x5'));var attributes=require(_0xca82('0x6'));module['exports']=function(_0x735ed9,_0x3160c5){return _0x735ed9[_0xca82('0x7')](_0xca82('0x8'),attributes,{'tableName':_0xca82('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xca82('0xa')],'type':_0xca82('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x20c39f,_0x196a27,_0x42a055){var _0xe3c9ee=_0x735ed9[_0xca82('0xc')];var _0x287832=_0x20c39f[_0xca82('0xd')]({'plain':!![]});if(_0x287832['direction'][_0xca82('0xe')]()==='in'||_0x287832[_0xca82('0xf')][_0xca82('0xe')]()===_0xca82('0x10')&&!_0x287832[_0xca82('0x11')]&&!_['isNil'](_0x287832[_0xca82('0x12')])){_0xe3c9ee[_0xca82('0x13')][_0xca82('0x14')]({'where':{'id':_0x287832[_0xca82('0x15')]}})[_0xca82('0x16')](function(_0xdb2f21){if(_0xdb2f21){_0xdb2f21['update']({'lastMsgAt':_0x287832['createdAt'],'lastMsgDirection':_0x287832[_0xca82('0xf')]['toLowerCase']()});}})[_0xca82('0x17')](function(_0x422bcf){console[_0xca82('0x18')](_0x422bcf);});}_0x42a055();}},'charset':'utf8mb4','collate':_0xca82('0x19')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index dd8ec6b..9875d7a 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 _0x44ae=['catch','CreateFaxMessage','FaxMessage','create','body','options','raw','debug','UpdateFaxMessage','update','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message'];(function(_0x4a7e01,_0x8c0829){var _0x2f72f1=function(_0x18c1e4){while(--_0x18c1e4){_0x4a7e01['push'](_0x4a7e01['shift']());}};_0x2f72f1(++_0x8c0829);}(_0x44ae,0x17d));var _0xe44a=function(_0x2cf437,_0x5b0508){_0x2cf437=_0x2cf437-0x0;var _0x2f1fd2=_0x44ae[_0x2cf437];return _0x2f1fd2;};'use strict';var _=require(_0xe44a('0x0'));var util=require(_0xe44a('0x1'));var moment=require(_0xe44a('0x2'));var BPromise=require(_0xe44a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe44a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe44a('0x5'));var logger=require(_0xe44a('0x6'))(_0xe44a('0x7'));var config=require(_0xe44a('0x8'));var jayson=require(_0xe44a('0x9'));var client=jayson[_0xe44a('0xa')]['http']({'port':0x232a});config[_0xe44a('0xb')]=_[_0xe44a('0xc')](config[_0xe44a('0xb')],{'host':_0xe44a('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe44a('0xb')]));require(_0xe44a('0xe'))[_0xe44a('0xf')](socket);function respondWithRpcPromise(_0x30a104,_0x4c52ee,_0x231326){return new BPromise(function(_0x3493e7,_0x353bf8){return client[_0xe44a('0x10')](_0x30a104,_0x231326)[_0xe44a('0x11')](function(_0x30fd36){logger[_0xe44a('0x12')]('FaxMessage,\x20%s,\x20%s',_0x4c52ee,'request\x20sent');logger['debug'](_0xe44a('0x13'),_0x4c52ee,_0xe44a('0x14'),JSON[_0xe44a('0x15')](_0x30fd36));if(_0x30fd36['error']){if(_0x30fd36[_0xe44a('0x16')][_0xe44a('0x17')]===0x1f4){logger[_0xe44a('0x16')](_0xe44a('0x18'),_0x4c52ee,_0x30fd36[_0xe44a('0x16')][_0xe44a('0x19')]);return _0x353bf8(_0x30fd36[_0xe44a('0x16')]['message']);}logger[_0xe44a('0x16')](_0xe44a('0x18'),_0x4c52ee,_0x30fd36['error']['message']);return _0x3493e7(_0x30fd36['error']['message']);}else{logger[_0xe44a('0x12')](_0xe44a('0x18'),_0x4c52ee,_0xe44a('0x14'));_0x3493e7(_0x30fd36['result'][_0xe44a('0x19')]);}})[_0xe44a('0x1a')](function(_0x1d3c58){logger[_0xe44a('0x16')](_0xe44a('0x18'),_0x4c52ee,_0x1d3c58);_0x353bf8(_0x1d3c58);});});}exports[_0xe44a('0x1b')]=function(_0x4f3baf){var _0x1c4d90=this;return new Promise(function(_0x5c01c1,_0x295ceb){return db[_0xe44a('0x1c')][_0xe44a('0x1d')](_0x4f3baf[_0xe44a('0x1e')],{'raw':_0x4f3baf[_0xe44a('0x1f')]?_0x4f3baf[_0xe44a('0x1f')][_0xe44a('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x203889){logger['info'](_0xe44a('0x1b'),_0x4f3baf);logger[_0xe44a('0x21')](_0xe44a('0x1b'),_0x4f3baf,JSON[_0xe44a('0x15')](_0x203889));_0x5c01c1(_0x203889);})[_0xe44a('0x1a')](function(_0x256079){logger[_0xe44a('0x16')](_0xe44a('0x1b'),_0x256079[_0xe44a('0x19')],_0x4f3baf);_0x295ceb(_0x1c4d90[_0xe44a('0x16')](0x1f4,_0x256079[_0xe44a('0x19')]));});});};exports[_0xe44a('0x22')]=function(_0x12bf7c){var _0xc69e9d=this;return new Promise(function(_0x5574f8,_0x8fbbbf){return db['FaxMessage'][_0xe44a('0x23')](_0x12bf7c[_0xe44a('0x1e')],{'raw':_0x12bf7c['options']?_0x12bf7c[_0xe44a('0x1f')][_0xe44a('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12bf7c[_0xe44a('0x1f')]?_0x12bf7c['options'][_0xe44a('0x24')]||null:null,'attributes':_0x12bf7c['options']?_0x12bf7c[_0xe44a('0x1f')]['attributes']||null:null,'limit':_0x12bf7c[_0xe44a('0x1f')]?_0x12bf7c['options']['limit']||null:null})[_0xe44a('0x11')](function(_0x5e00f7){logger[_0xe44a('0x12')]('UpdateFaxMessage',_0x12bf7c);logger[_0xe44a('0x21')](_0xe44a('0x22'),_0x12bf7c,JSON[_0xe44a('0x15')](_0x5e00f7));_0x5574f8(_0x5e00f7);})['catch'](function(_0x12af37){logger[_0xe44a('0x16')]('UpdateFaxMessage',_0x12af37['message'],_0x12bf7c);_0x8fbbbf(_0xc69e9d[_0xe44a('0x16')](0x1f4,_0x12af37['message']));});});}; \ No newline at end of file +var _0xd6d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','update','where','limit','UpdateFaxMessage'];(function(_0x504fad,_0x556cd0){var _0x2b6826=function(_0xd27774){while(--_0xd27774){_0x504fad['push'](_0x504fad['shift']());}};_0x2b6826(++_0x556cd0);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5737b5,_0x3a8b65){_0x5737b5=_0x5737b5-0x0;var _0x447b01=_0xd6d6[_0x5737b5];return _0x447b01;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});}exports['CreateFaxMessage']=function(_0x26f631){var _0xb8590d=this;return new Promise(function(_0x30d87d,_0x450352){return db[_0x6d6d('0x1b')][_0x6d6d('0x1c')](_0x26f631[_0x6d6d('0x1d')],{'raw':_0x26f631[_0x6d6d('0x1e')]?_0x26f631[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![]})[_0x6d6d('0x10')](function(_0x6e58e3){logger[_0x6d6d('0x20')](_0x6d6d('0x21'),_0x26f631);logger[_0x6d6d('0x12')](_0x6d6d('0x21'),_0x26f631,JSON[_0x6d6d('0x14')](_0x6e58e3));_0x30d87d(_0x6e58e3);})['catch'](function(_0x3b73e5){logger[_0x6d6d('0x15')](_0x6d6d('0x21'),_0x3b73e5[_0x6d6d('0x18')],_0x26f631);_0x450352(_0xb8590d[_0x6d6d('0x15')](0x1f4,_0x3b73e5[_0x6d6d('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x2851dd){var _0x2b5e31=this;return new Promise(function(_0x235451,_0x126ac8){return db[_0x6d6d('0x1b')][_0x6d6d('0x22')](_0x2851dd[_0x6d6d('0x1d')],{'raw':_0x2851dd['options']?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851dd['options']?_0x2851dd['options'][_0x6d6d('0x23')]||null:null,'attributes':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')]['attributes']||null:null,'limit':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x24')]||null:null})[_0x6d6d('0x10')](function(_0x64d1f7){logger[_0x6d6d('0x20')](_0x6d6d('0x25'),_0x2851dd);logger[_0x6d6d('0x12')](_0x6d6d('0x25'),_0x2851dd,JSON[_0x6d6d('0x14')](_0x64d1f7));_0x235451(_0x64d1f7);})['catch'](function(_0x1f9469){logger['error'](_0x6d6d('0x25'),_0x1f9469[_0x6d6d('0x18')],_0x2851dd);_0x126ac8(_0x2b5e31[_0x6d6d('0x15')](0x1f4,_0x1f9469[_0x6d6d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 9807c8c..b140f32 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 _0x9c00=['removeListener','register','length','faxMessage:'];(function(_0x9880d2,_0x547be8){var _0x561d60=function(_0x6db6a8){while(--_0x6db6a8){_0x9880d2['push'](_0x9880d2['shift']());}};_0x561d60(++_0x547be8);}(_0x9c00,0xf4));var _0x09c0=function(_0x320c90,_0x515e0a){_0x320c90=_0x320c90-0x0;var _0x4b8824=_0x9c00[_0x320c90];return _0x4b8824;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save','remove','update'];function createListener(_0x5cedb0,_0x19e8e1){return function(_0x4eaa14){_0x19e8e1['emit'](_0x5cedb0,_0x4eaa14);};}function removeListener(_0x29e127,_0x4ee895){return function(){FaxMessageEvents[_0x09c0('0x0')](_0x29e127,_0x4ee895);};}exports[_0x09c0('0x1')]=function(_0x30dddb){for(var _0x42e740=0x0,_0x3f426b=events[_0x09c0('0x2')];_0x42e740<_0x3f426b;_0x42e740++){var _0x404493=events[_0x42e740];var _0x53e9bf=createListener(_0x09c0('0x3')+_0x404493,_0x30dddb);FaxMessageEvents['on'](_0x404493,_0x53e9bf);}}; \ No newline at end of file +var _0xaeab=['emit','removeListener','register','length','faxMessage:','./faxMessage.events','remove'];(function(_0x41907d,_0x52a638){var _0x1454f9=function(_0x1ea425){while(--_0x1ea425){_0x41907d['push'](_0x41907d['shift']());}};_0x1454f9(++_0x52a638);}(_0xaeab,0x91));var _0xbaea=function(_0xc0905b,_0x58bce2){_0xc0905b=_0xc0905b-0x0;var _0x252b68=_0xaeab[_0xc0905b];return _0x252b68;};'use strict';var FaxMessageEvents=require(_0xbaea('0x0'));var events=['save',_0xbaea('0x1'),'update'];function createListener(_0x2eb81e,_0x236fca){return function(_0x2e3da7){_0x236fca[_0xbaea('0x2')](_0x2eb81e,_0x2e3da7);};}function removeListener(_0x36e839,_0xbe1ff5){return function(){FaxMessageEvents[_0xbaea('0x3')](_0x36e839,_0xbe1ff5);};}exports[_0xbaea('0x4')]=function(_0x1ae44e){for(var _0x1e4331=0x0,_0x5bfed3=events[_0xbaea('0x5')];_0x1e4331<_0x5bfed3;_0x1e4331++){var _0x267afb=events[_0x1e4331];var _0x202d96=createListener(_0xbaea('0x6')+_0x267afb,_0x1ae44e);FaxMessageEvents['on'](_0x267afb,_0x202d96);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index e346ec7..c3e2c60 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 _0xdb28=['./faxMessage.controller','isAuthenticated','index','describe','get','/:id','show','download','post','tracked','fax','create','put','update','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x100332,_0x4296e1){var _0x308ffc=function(_0x43791b){while(--_0x43791b){_0x100332['push'](_0x100332['shift']());}};_0x308ffc(++_0x4296e1);}(_0xdb28,0x106));var _0x8db2=function(_0x4286c3,_0x31d85a){_0x4286c3=_0x4286c3-0x0;var _0x10b285=_0xdb28[_0x4286c3];return _0x10b285;};'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 auth=require(_0x8db2('0x5'));var interaction=require(_0x8db2('0x6'));var config=require(_0x8db2('0x7'));var controller=require(_0x8db2('0x8'));router['get']('/',auth[_0x8db2('0x9')](),controller[_0x8db2('0xa')]);router['get']('/describe',auth[_0x8db2('0x9')](),controller[_0x8db2('0xb')]);router[_0x8db2('0xc')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0xe')]);router[_0x8db2('0xc')]('/:id/download',auth[_0x8db2('0x9')](),controller[_0x8db2('0xf')]);router[_0x8db2('0x10')]('/',auth['isAuthenticated'](),interaction[_0x8db2('0x11')](_0x8db2('0x12'),'faxmessage:create'),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x15')]);router['put']('/:id/accept',auth[_0x8db2('0x9')](),controller[_0x8db2('0x16')]);router[_0x8db2('0x14')](_0x8db2('0x17'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x18')]);router[_0x8db2('0x19')](_0x8db2('0xd'),auth[_0x8db2('0x9')](),controller[_0x8db2('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x1261=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','faxmessage:create','put','update','/:id/accept','accept','reject','delete','destroy','util'];(function(_0x5935e6,_0x4a2b41){var _0x3aba85=function(_0x346199){while(--_0x346199){_0x5935e6['push'](_0x5935e6['shift']());}};_0x3aba85(++_0x4a2b41);}(_0x1261,0x144));var _0x1126=function(_0x4c9cc4,_0x1b6528){_0x4c9cc4=_0x4c9cc4-0x0;var _0x4384fb=_0x1261[_0x4c9cc4];return _0x4384fb;};'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 auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['get'](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x10')]);router['post']('/',auth[_0x1126('0xd')](),interaction['tracked']('fax',_0x1126('0x11')),controller['create']);router[_0x1126('0x12')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0x13')]);router[_0x1126('0x12')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x15')]);router[_0x1126('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x1126('0x16')]);router[_0x1126('0x17')](_0x1126('0xc'),auth['isAuthenticated'](),controller[_0x1126('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index dab7890..4b750ab 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 _0x776c=['name','INTEGER','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x4bba6d,_0x12073a){var _0x824926=function(_0x566cb9){while(--_0x566cb9){_0x4bba6d['push'](_0x4bba6d['shift']());}};_0x824926(++_0x12073a);}(_0x776c,0x8a));var _0xc776=function(_0x243d07,_0x3f3ad4){_0x243d07=_0x243d07-0x0;var _0x26a563=_0x776c[_0x243d07];return _0x26a563;};'use strict';var Sequelize=require('sequelize');module[_0xc776('0x0')]={'name':{'type':Sequelize[_0xc776('0x1')],'unique':_0xc776('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc776('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc776('0x4'),_0xc776('0x5'),_0xc776('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc776('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x48b0=['exports','STRING','rrmemory','roundrobin','INTEGER','sequelize'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x48b0,0x9b));var _0x048b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x48b0[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x048b('0x0'));module[_0x048b('0x1')]={'name':{'type':Sequelize[_0x048b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x048b('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x048b('0x3'),'beepall',_0x048b('0x4')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x048b('0x5')],'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 b1701c4..f3c12c4 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 _0x089f=['updatedAt','getTeams','hasOwnProperty','Team','Agents','voicePause','flatMap','sequelize','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','index','model','keys','query','attributes','intersection','fields','length','nolimit','sort','filters','filter','merge','where','map','type','VIRTUAL','field','options','FaxQueue','include','findAll','rows','catch','show','params','find','create','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserFaxQueue','rawAttributes','order','pick','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','faxPause'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x089f,0x1c7));var _0xf089=function(_0xc97a93,_0x25942f){_0xc97a93=_0xc97a93-0x0;var _0x316254=_0x089f[_0xc97a93];return _0x316254;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf089('0x0'));var rimraf=require(_0xf089('0x1'));var zipdir=require(_0xf089('0x2'));var jsonpatch=require(_0xf089('0x3'));var rp=require(_0xf089('0x4'));var moment=require('moment');var BPromise=require(_0xf089('0x5'));var Mustache=require(_0xf089('0x6'));var util=require(_0xf089('0x7'));var path=require('path');var sox=require(_0xf089('0x8'));var csv=require(_0xf089('0x9'));var ejs=require(_0xf089('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf089('0xb'));var crypto=require(_0xf089('0xc'));var jsforce=require(_0xf089('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf089('0x9'));var querystring=require(_0xf089('0xe'));var Papa=require(_0xf089('0xf'));var Redis=require(_0xf089('0x10'));var authService=require(_0xf089('0x11'));var qs=require(_0xf089('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf089('0x13'))(_0xf089('0x14'));var utils=require(_0xf089('0x15'));var config=require('../../config/environment');var db=require(_0xf089('0x16'))['db'];config[_0xf089('0x17')]=_['defaults'](config['redis'],{'host':_0xf089('0x18'),'port':0x18eb});var socket=require(_0xf089('0x19'))(new Redis(config['redis']));require(_0xf089('0x1a'))[_0xf089('0x1b')](socket);function respondWithStatusCode(_0x72b34f,_0x337673){_0x337673=_0x337673||0xcc;return function(_0x58b0db){if(_0x58b0db){return _0x72b34f[_0xf089('0x1c')](_0x337673);}return _0x72b34f['status'](_0x337673)[_0xf089('0x1d')]();};}function respondWithResult(_0x528cf9,_0x342bb3){_0x342bb3=_0x342bb3||0xc8;return function(_0x5aee45){if(_0x5aee45){return _0x528cf9[_0xf089('0x1e')](_0x342bb3)[_0xf089('0x1f')](_0x5aee45);}};}function respondWithFilteredResult(_0x157371,_0x1b57fd){return function(_0xbd29ca){if(_0xbd29ca){var _0x57f2a7=_0xbd29ca[_0xf089('0x20')],_0x7fbed5=_0x1b57fd['offset'],_0x4e714a=_0x1b57fd[_0xf089('0x21')]+_0x1b57fd[_0xf089('0x22')],_0x407263;if(_0x4e714a>=_0x57f2a7){_0x4e714a=_0x57f2a7;_0x407263=0xc8;}else{_0x407263=0xce;}_0x157371['status'](_0x407263);return _0x157371[_0xf089('0x23')](_0xf089('0x24'),_0x7fbed5+'-'+_0x4e714a+'/'+_0x57f2a7)[_0xf089('0x1f')](_0xbd29ca);}return null;};}function patchUpdates(_0x2ab659){return function(_0x105f05){try{jsonpatch[_0xf089('0x25')](_0x105f05,_0x2ab659,!![]);}catch(_0x23a008){return BPromise[_0xf089('0x26')](_0x23a008);}return _0x105f05[_0xf089('0x27')]();};}function saveUpdates(_0x1196be,_0x581180){return function(_0x36ace9){if(_0x36ace9){return _0x36ace9[_0xf089('0x28')](_0x1196be)[_0xf089('0x29')](function(_0x1b9444){return _0x1b9444;});}return null;};}function removeEntity(_0x599b04,_0x19e801){return function(_0x249b88){if(_0x249b88){return _0x249b88[_0xf089('0x2a')]()[_0xf089('0x29')](function(){var _0x3a78fc=_0x249b88['get']({'plain':!![]});var _0x3ec39b='FaxQueues';return db[_0xf089('0x2b')][_0xf089('0x2a')]({'where':{'type':_0x3ec39b,'resourceId':_0x3a78fc['id']}})['then'](function(){return _0x249b88;});})[_0xf089('0x29')](function(){_0x599b04['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x42c286,_0x220746){return function(_0x2ffff6){if(!_0x2ffff6){_0x42c286[_0xf089('0x1c')](0x194);}return _0x2ffff6;};}function handleError(_0x14aa96,_0x52e6ac){_0x52e6ac=_0x52e6ac||0x1f4;return function(_0x210147){logger['error'](_0x210147[_0xf089('0x2c')]);if(_0x210147[_0xf089('0x2d')]){delete _0x210147[_0xf089('0x2d')];}_0x14aa96[_0xf089('0x1e')](_0x52e6ac)[_0xf089('0x2e')](_0x210147);};}exports[_0xf089('0x2f')]=function(_0x3268ca,_0x29eb23){var _0x281fee={},_0x2df2bb={},_0x3f82b8={'count':0x0,'rows':[]};var _0x12924c=db['FaxQueue']['rawAttributes'];_0x2df2bb[_0xf089('0x30')]=_[_0xf089('0x31')](_0x12924c);_0x2df2bb[_0xf089('0x32')]=_[_0xf089('0x31')](_0x3268ca[_0xf089('0x32')]);_0x2df2bb['filters']=_['intersection'](_0x2df2bb[_0xf089('0x30')],_0x2df2bb[_0xf089('0x32')]);_0x281fee[_0xf089('0x33')]=_[_0xf089('0x34')](_0x2df2bb[_0xf089('0x30')],qs[_0xf089('0x35')](_0x3268ca[_0xf089('0x32')][_0xf089('0x35')]));_0x281fee[_0xf089('0x33')]=_0x281fee['attributes'][_0xf089('0x36')]?_0x281fee['attributes']:_0x2df2bb[_0xf089('0x30')];if(!_0x3268ca[_0xf089('0x32')]['hasOwnProperty'](_0xf089('0x37'))){_0x281fee[_0xf089('0x22')]=qs[_0xf089('0x22')](_0x3268ca[_0xf089('0x32')]['limit']);_0x281fee[_0xf089('0x21')]=qs['offset'](_0x3268ca[_0xf089('0x32')]['offset']);}_0x281fee['order']=qs['sort'](_0x3268ca[_0xf089('0x32')][_0xf089('0x38')]);_0x281fee['where']=qs['filters'](_['pick'](_0x3268ca[_0xf089('0x32')],_0x2df2bb[_0xf089('0x39')]));if(_0x3268ca[_0xf089('0x32')][_0xf089('0x3a')]){_0x281fee['where']=_[_0xf089('0x3b')](_0x281fee[_0xf089('0x3c')],{'$or':_[_0xf089('0x3d')](_0x12924c,function(_0x4c2b18){if(_0x4c2b18[_0xf089('0x3e')]['key']!==_0xf089('0x3f')){var _0xd6af5c={};_0xd6af5c[_0x4c2b18[_0xf089('0x40')]]={'$like':'%'+_0x3268ca[_0xf089('0x32')][_0xf089('0x3a')]+'%'};return _0xd6af5c;}})});}_0x281fee=_[_0xf089('0x3b')]({},_0x281fee,_0x3268ca[_0xf089('0x41')]);var _0x13d374={'where':_0x281fee[_0xf089('0x3c')]};return db[_0xf089('0x42')]['count'](_0x13d374)[_0xf089('0x29')](function(_0x32815e){_0x3f82b8[_0xf089('0x20')]=_0x32815e;if(_0x3268ca['query']['includeAll']){_0x281fee[_0xf089('0x43')]=[{'all':!![]}];}return db[_0xf089('0x42')][_0xf089('0x44')](_0x281fee);})['then'](function(_0x13030b){_0x3f82b8[_0xf089('0x45')]=_0x13030b;return _0x3f82b8;})['then'](respondWithFilteredResult(_0x29eb23,_0x281fee))[_0xf089('0x46')](handleError(_0x29eb23,null));};exports[_0xf089('0x47')]=function(_0x5cb0d2,_0x9cd3ad){var _0x4d8848={'raw':!![],'where':{'id':_0x5cb0d2[_0xf089('0x48')]['id']}},_0x83b5d={};_0x83b5d[_0xf089('0x30')]=_[_0xf089('0x31')](db[_0xf089('0x42')]['rawAttributes']);_0x83b5d[_0xf089('0x32')]=_[_0xf089('0x31')](_0x5cb0d2['query']);_0x83b5d[_0xf089('0x39')]=_[_0xf089('0x34')](_0x83b5d[_0xf089('0x30')],_0x83b5d[_0xf089('0x32')]);_0x4d8848[_0xf089('0x33')]=_[_0xf089('0x34')](_0x83b5d[_0xf089('0x30')],qs['fields'](_0x5cb0d2['query']['fields']));_0x4d8848[_0xf089('0x33')]=_0x4d8848[_0xf089('0x33')][_0xf089('0x36')]?_0x4d8848[_0xf089('0x33')]:_0x83b5d['model'];if(_0x5cb0d2[_0xf089('0x32')]['includeAll']){_0x4d8848[_0xf089('0x43')]=[{'all':!![]}];}_0x4d8848=_[_0xf089('0x3b')]({},_0x4d8848,_0x5cb0d2[_0xf089('0x41')]);return db['FaxQueue'][_0xf089('0x49')](_0x4d8848)[_0xf089('0x29')](handleEntityNotFound(_0x9cd3ad,null))['then'](respondWithResult(_0x9cd3ad,null))[_0xf089('0x46')](handleError(_0x9cd3ad,null));};exports[_0xf089('0x4a')]=function(_0xb68f3e,_0x34abf3){return db['FaxQueue'][_0xf089('0x4a')](_0xb68f3e['body'],{})['then'](function(_0x2c064d){var _0x32d6d7=_0xb68f3e['user'][_0xf089('0x4b')]({'plain':!![]});if(!_0x32d6d7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32d6d7['role']==='user'){var _0x517f5e=_0x2c064d[_0xf089('0x4b')]({'plain':!![]});var _0x3ed6dd='FaxQueues';return db[_0xf089('0x4c')][_0xf089('0x49')]({'where':{'name':_0x3ed6dd,'userProfileId':_0x32d6d7[_0xf089('0x4d')]},'raw':!![]})[_0xf089('0x29')](function(_0xb6b8ee){if(_0xb6b8ee&&_0xb6b8ee[_0xf089('0x4e')]===0x0){return db[_0xf089('0x2b')]['create']({'name':_0x517f5e[_0xf089('0x2d')],'resourceId':_0x517f5e['id'],'type':_0xb6b8ee[_0xf089('0x2d')],'sectionId':_0xb6b8ee['id']},{})[_0xf089('0x29')](function(){return _0x2c064d;});}else{return _0x2c064d;}})[_0xf089('0x46')](function(_0x52ed2d){logger[_0xf089('0x4f')](_0xf089('0x50'),_0x52ed2d);throw _0x52ed2d;});}return _0x2c064d;})[_0xf089('0x29')](respondWithResult(_0x34abf3,0xc9))[_0xf089('0x46')](handleError(_0x34abf3,null));};exports[_0xf089('0x28')]=function(_0x292766,_0x381e44){if(_0x292766['body']['id']){delete _0x292766['body']['id'];}return db['FaxQueue'][_0xf089('0x49')]({'where':{'id':_0x292766[_0xf089('0x48')]['id']}})['then'](handleEntityNotFound(_0x381e44,null))['then'](saveUpdates(_0x292766[_0xf089('0x51')],null))[_0xf089('0x29')](respondWithResult(_0x381e44,null))[_0xf089('0x46')](handleError(_0x381e44,null));};exports[_0xf089('0x2a')]=function(_0x1e744a,_0x364e34){return db[_0xf089('0x42')]['find']({'where':{'id':_0x1e744a['params']['id']}})[_0xf089('0x29')](handleEntityNotFound(_0x364e34,null))[_0xf089('0x29')](removeEntity(_0x364e34,null))[_0xf089('0x46')](handleError(_0x364e34,null));};exports['describe']=function(_0x3a9b66,_0x20ae39){return db[_0xf089('0x42')][_0xf089('0x52')]()[_0xf089('0x29')](respondWithResult(_0x20ae39,null))['catch'](handleError(_0x20ae39,null));};exports['getMembers']=function(_0x8f1124,_0x12e86e,_0x2e22ca){var _0x4eb267={'raw':!![],'where':{}},_0x5ea5c3={},_0x2f4bcb;return db['FaxQueue'][_0xf089('0x53')]({'where':{'id':_0x8f1124[_0xf089('0x48')]['id']}})[_0xf089('0x29')](handleEntityNotFound(_0x12e86e,null))['then'](function(_0x8dff33){if(_0x8dff33){_0x2f4bcb=_0x8dff33['get']({'plain':!![]});_0x5ea5c3[_0xf089('0x30')]=_[_0xf089('0x31')](db[_0xf089('0x54')][_0xf089('0x55')]);_0x5ea5c3['query']=_['keys'](_0x8f1124[_0xf089('0x32')]);_0x5ea5c3['filters']=_[_0xf089('0x34')](_0x5ea5c3['model'],_0x5ea5c3['query']);_0x4eb267[_0xf089('0x33')]=_[_0xf089('0x34')](_0x5ea5c3['model'],qs['fields'](_0x8f1124[_0xf089('0x32')]['fields']));_0x4eb267[_0xf089('0x33')]=_0x4eb267[_0xf089('0x33')][_0xf089('0x36')]?_0x4eb267[_0xf089('0x33')]:_0x5ea5c3[_0xf089('0x30')];if(!_0x8f1124[_0xf089('0x32')]['hasOwnProperty'](_0xf089('0x37'))){_0x4eb267[_0xf089('0x22')]=qs['limit'](_0x8f1124[_0xf089('0x32')][_0xf089('0x22')]);_0x4eb267[_0xf089('0x21')]=qs[_0xf089('0x21')](_0x8f1124[_0xf089('0x32')][_0xf089('0x21')]);}_0x4eb267[_0xf089('0x56')]=qs[_0xf089('0x38')](_0x8f1124[_0xf089('0x32')][_0xf089('0x38')]);_0x4eb267[_0xf089('0x3c')]=qs[_0xf089('0x39')](_[_0xf089('0x57')](_0x8f1124[_0xf089('0x32')],_0x5ea5c3[_0xf089('0x39')]));_0x4eb267[_0xf089('0x3c')]['FaxQueueId']=_0x8dff33['id'];if(_0x8f1124['query'][_0xf089('0x3a')]){_0x4eb267[_0xf089('0x3c')]=_[_0xf089('0x3b')](_0x4eb267[_0xf089('0x3c')],{'$or':_[_0xf089('0x3d')](_0x4eb267[_0xf089('0x33')],function(_0x51eb40){var _0x2da086={};_0x2da086[_0x51eb40]={'$like':'%'+_0x8f1124[_0xf089('0x32')][_0xf089('0x3a')]+'%'};return _0x2da086;})});}_0x4eb267=_['merge']({},_0x4eb267,_0x8f1124[_0xf089('0x41')]);return db[_0xf089('0x54')][_0xf089('0x44')](_0x4eb267);}})[_0xf089('0x29')](function(_0x478bec){if(_0x478bec){return db[_0xf089('0x58')][_0xf089('0x59')]({'where':{'id':_[_0xf089('0x3d')](_0x478bec,_0xf089('0x5a')),'role':_0xf089('0x5b')},'attributes':['id',_0xf089('0x2d'),'faxPause','updatedAt',_0xf089('0x5c')]});}})[_0xf089('0x29')](function(_0x3712ca){if(_0x3712ca){return{'count':_0x3712ca[_0xf089('0x20')],'rows':_['map'](_0x3712ca[_0xf089('0x45')],function(_0x5b1713){return{'membername':_0x5b1713[_0xf089('0x2d')],'UserId':_0x5b1713['id'],'queue_name':_0x2f4bcb[_0xf089('0x2d')],'FaxQueueId':_0x2f4bcb['id'],'interface':util[_0xf089('0x5d')](_0xf089('0x5e'),_0xf089('0x5f'),_0x5b1713['name']),'penalty':0x0,'paused':_0x5b1713[_0xf089('0x60')],'createdAt':_0x5b1713['createdAt'],'updatedAt':_0x5b1713[_0xf089('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf089('0x29')](respondWithFilteredResult(_0x12e86e,_0x4eb267))[_0xf089('0x46')](handleError(_0x12e86e,null));};exports['getTeams']=function(_0x2a7bc7,_0x550044,_0x38c7a0){var _0x449370={};var _0x1e5594={};var _0x3dfcd8;var _0x54646a;return db[_0xf089('0x42')][_0xf089('0x53')]({'where':{'id':_0x2a7bc7['params']['id']}})['then'](handleEntityNotFound(_0x550044,null))[_0xf089('0x29')](function(_0x24e469){if(_0x24e469){_0x3dfcd8=_0x24e469;_0x1e5594['model']=_[_0xf089('0x31')](db['Team']['rawAttributes']);_0x1e5594[_0xf089('0x32')]=_[_0xf089('0x31')](_0x2a7bc7[_0xf089('0x32')]);_0x1e5594[_0xf089('0x39')]=_[_0xf089('0x34')](_0x1e5594[_0xf089('0x30')],_0x1e5594['query']);_0x449370['attributes']=_[_0xf089('0x34')](_0x1e5594['model'],qs[_0xf089('0x35')](_0x2a7bc7['query']['fields']));_0x449370['attributes']=_0x449370[_0xf089('0x33')][_0xf089('0x36')]?_0x449370['attributes']:_0x1e5594[_0xf089('0x30')];_0x449370['order']=qs[_0xf089('0x38')](_0x2a7bc7[_0xf089('0x32')][_0xf089('0x38')]);_0x449370[_0xf089('0x3c')]=qs[_0xf089('0x39')](_[_0xf089('0x57')](_0x2a7bc7['query'],_0x1e5594[_0xf089('0x39')]));if(_0x2a7bc7[_0xf089('0x32')][_0xf089('0x3a')]){_0x449370['where']=_[_0xf089('0x3b')](_0x449370['where'],{'$or':_[_0xf089('0x3d')](_0x449370['attributes'],function(_0x21a44c){var _0x46b771={};_0x46b771[_0x21a44c]={'$like':'%'+_0x2a7bc7[_0xf089('0x32')][_0xf089('0x3a')]+'%'};return _0x46b771;})});}_0x449370=_[_0xf089('0x3b')]({},_0x449370,_0x2a7bc7[_0xf089('0x41')]);return _0x3dfcd8[_0xf089('0x62')](_0x449370);}})['then'](function(_0x4bca89){if(_0x4bca89){_0x54646a=_0x4bca89[_0xf089('0x36')];if(!_0x2a7bc7[_0xf089('0x32')][_0xf089('0x63')](_0xf089('0x37'))){_0x449370[_0xf089('0x22')]=qs[_0xf089('0x22')](_0x2a7bc7[_0xf089('0x32')][_0xf089('0x22')]);_0x449370[_0xf089('0x21')]=qs[_0xf089('0x21')](_0x2a7bc7[_0xf089('0x32')][_0xf089('0x21')]);}return _0x3dfcd8[_0xf089('0x62')](_0x449370);}})[_0xf089('0x29')](function(_0x1fb659){if(_0x1fb659){return _0x1fb659?{'count':_0x54646a,'rows':_0x1fb659}:null;}})[_0xf089('0x29')](respondWithResult(_0x550044,null))['catch'](handleError(_0x550044,null));};exports['addTeams']=function(_0x1a3c74,_0x302649,_0x1d4e3d){var _0x34af52=_0x1a3c74[_0xf089('0x51')]['teams'];return db[_0xf089('0x64')][_0xf089('0x44')]({'where':{'id':_[_0xf089('0x3d')](_0x34af52,'id')},'attributes':['id'],'include':[{'model':db[_0xf089('0x58')],'as':_0xf089('0x65'),'attributes':['id','name','online',_0xf089('0x66'),'interface'],'raw':!![]}]})['then'](function(_0x28801f){if(_0x28801f){var _0x19e12e=_[_0xf089('0x67')](_0x28801f,function(_0x230af1){var _0x443905=_0x230af1[_0xf089('0x4b')]({'plain':!![]});return _0x443905[_0xf089('0x65')];});return db[_0xf089('0x42')][_0xf089('0x49')]({'where':{'id':_0x1a3c74[_0xf089('0x48')]['id']}})[_0xf089('0x29')](function(_0x1e3621){return db[_0xf089('0x68')]['transaction'](function(_0x11251a){return _0x1e3621[_0xf089('0x69')](_[_0xf089('0x3d')](_0x34af52,'id'),{'transaction':_0x11251a})[_0xf089('0x29')](function(){return BPromise[_0xf089('0x6a')](_0x19e12e,function(_0x5715cf){return db[_0xf089('0x54')][_0xf089('0x6b')]({'where':{'UserId':_0x5715cf['id'],'FaxQueueId':_0x1a3c74[_0xf089('0x48')]['id']},'transaction':_0x11251a});});})[_0xf089('0x29')](function(){_0x19e12e[_0xf089('0x6c')](function(_0x6817de){socket[_0xf089('0x6d')](_0xf089('0x6e'),{'UserId':_0x6817de['id'],'FaxQueueId':_0x1e3621['id']});});});});});}})[_0xf089('0x29')](respondWithStatusCode(_0x302649,null))[_0xf089('0x46')](handleError(_0x302649,null));};exports[_0xf089('0x6f')]=function(_0x5dc3b0,_0x1d8da2,_0x463421){return db[_0xf089('0x64')][_0xf089('0x44')]({'where':{'id':_0x5dc3b0['query'][_0xf089('0x70')]},'attributes':['id'],'include':[{'model':db[_0xf089('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf089('0x29')](handleEntityNotFound(_0x1d8da2,null))['then'](function(_0x2715fa){var _0x22f180=_[_0xf089('0x3d')](_0x2715fa,'id');var _0x1455a8=[];var _0x2173f8=[];var _0x3a266c=squel['select']();_0x3a266c[_0xf089('0x40')](_0xf089('0x71'))[_0xf089('0x72')](_0xf089('0x73'),'tq')[_0xf089('0x74')](_0xf089('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf089('0x3c')](_0xf089('0x76'),_0x5dc3b0['params']['id']);for(var _0x1de5ec=0x0;_0x1de5ec<_0x2715fa['length'];_0x1de5ec+=0x1){let _0x262be0=_0x2715fa[_0x1de5ec];for(var _0x4d9dd5=0x0;_0x4d9dd5<_0x262be0[_0xf089('0x65')][_0xf089('0x36')];_0x4d9dd5+=0x1){let _0x24ca31=_0x262be0[_0xf089('0x65')][_0x4d9dd5];var _0x4fcb46=_0x3a266c[_0xf089('0x77')]();_0x4fcb46['where'](_0xf089('0x78'),_0x24ca31['id']);_0x2173f8[_0xf089('0x79')](db[_0xf089('0x68')][_0xf089('0x32')](_0x4fcb46['toString'](),{'type':db[_0xf089('0x68')][_0xf089('0x7a')][_0xf089('0x7b')]})[_0xf089('0x29')](function(_0x300345){if(_0x300345[_0xf089('0x36')]===0x1){return _0x24ca31['id'];}else{var _0x577136=_[_0xf089('0x7c')](_[_0xf089('0x3d')](_0x300345,_0xf089('0x7d')),function(_0x453c8a){return _[_0xf089('0x7e')](_0x22f180,_0x453c8a);});if(_0x577136){return _0x24ca31['id'];}}}));}}return BPromise['all'](_0x2173f8)[_0xf089('0x29')](function(_0x591128){_0x1455a8=_(_0x1455a8)[_0xf089('0x7f')](_0x591128)[_0xf089('0x80')]()[_0xf089('0x81')]();return db[_0xf089('0x42')][_0xf089('0x49')]({'where':{'id':_0x5dc3b0['params']['id']}})[_0xf089('0x29')](function(_0x17e938){return db['sequelize'][_0xf089('0x82')](function(_0x17a1f4){return _0x17e938[_0xf089('0x6f')](_0x5dc3b0[_0xf089('0x32')]['ids'],{'transaction':_0x17a1f4})[_0xf089('0x29')](function(){if(!_[_0xf089('0x83')](_0x1455a8)){return _0x17e938[_0xf089('0x84')](_0x1455a8,{'transaction':_0x17a1f4});}})[_0xf089('0x29')](function(){_0x1455a8[_0xf089('0x6c')](function(_0x177ea6){socket[_0xf089('0x6d')](_0xf089('0x85'),{'UserId':_0x177ea6,'FaxQueueId':_0x17e938['id']});});});});});});})['then'](respondWithStatusCode(_0x1d8da2,null))[_0xf089('0x46')](handleError(_0x1d8da2,null));};exports[_0xf089('0x86')]=function(_0x186554,_0x2bb4dd,_0x130793){return db['FaxQueue'][_0xf089('0x49')]({'where':{'id':_0x186554[_0xf089('0x48')]['id']}})[_0xf089('0x29')](handleEntityNotFound(_0x2bb4dd,null))[_0xf089('0x29')](function(_0xe5b915){if(_0xe5b915){return _0xe5b915[_0xf089('0x86')](_0x186554[_0xf089('0x51')][_0xf089('0x70')],_[_0xf089('0x87')](_0x186554['body'],[_0xf089('0x70'),'id'])||{})['spread'](function(_0xd94308){for(var _0x1d5377=0x0;_0x1d5377<_0x186554[_0xf089('0x51')][_0xf089('0x70')][_0xf089('0x36')];_0x1d5377+=0x1){socket[_0xf089('0x6d')]('userFaxQueue:save',{'UserId':_0x186554[_0xf089('0x51')]['ids'][_0x1d5377],'FaxQueueId':_0x186554['params']['id']});}return _0xd94308;});}})[_0xf089('0x29')](respondWithResult(_0x2bb4dd,null))[_0xf089('0x46')](handleError(_0x2bb4dd,null));};exports[_0xf089('0x84')]=function(_0x4f60f3,_0x287140,_0x26aa20){return db[_0xf089('0x42')][_0xf089('0x49')]({'where':{'id':_0x4f60f3[_0xf089('0x48')]['id']}})[_0xf089('0x29')](handleEntityNotFound(_0x287140,null))[_0xf089('0x29')](function(_0x4639f9){if(_0x4639f9){return _0x4639f9['removeAgents'](_0x4f60f3[_0xf089('0x32')]['ids'])[_0xf089('0x29')](function(){if(_[_0xf089('0x88')](_0x4f60f3[_0xf089('0x32')]['ids'])){for(var _0x306c9e=0x0;_0x306c9e<_0x4f60f3[_0xf089('0x32')][_0xf089('0x70')][_0xf089('0x36')];_0x306c9e+=0x1){socket[_0xf089('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x4f60f3['query']['ids'][_0x306c9e]),'FaxQueueId':Number(_0x4f60f3['params']['id'])});}}else{socket[_0xf089('0x6d')](_0xf089('0x85'),{'UserId':Number(_0x4f60f3['query']['ids']),'FaxQueueId':Number(_0x4f60f3[_0xf089('0x48')]['id'])});}});}})[_0xf089('0x29')](respondWithStatusCode(_0x287140,null))[_0xf089('0x46')](handleError(_0x287140,null));};exports['getAgents']=function(_0x19edfd,_0x591f52,_0x17268d){var _0x5a5f22={};var _0x47b3ea={};var _0x2ed29a;var _0x5591dc;return db[_0xf089('0x42')][_0xf089('0x53')]({'where':{'id':_0x19edfd['params']['id']}})['then'](handleEntityNotFound(_0x591f52,null))['then'](function(_0x58cf24){if(_0x58cf24){_0x2ed29a=_0x58cf24;_0x47b3ea['model']=_[_0xf089('0x31')](db[_0xf089('0x58')][_0xf089('0x55')]);_0x47b3ea[_0xf089('0x32')]=_[_0xf089('0x31')](_0x19edfd[_0xf089('0x32')]);_0x47b3ea[_0xf089('0x39')]=_[_0xf089('0x34')](_0x47b3ea[_0xf089('0x30')],_0x47b3ea[_0xf089('0x32')]);_0x5a5f22[_0xf089('0x33')]=_[_0xf089('0x34')](_0x47b3ea['model'],qs[_0xf089('0x35')](_0x19edfd[_0xf089('0x32')][_0xf089('0x35')]));_0x5a5f22[_0xf089('0x33')]=_0x5a5f22[_0xf089('0x33')]['length']?_0x5a5f22[_0xf089('0x33')]:_0x47b3ea[_0xf089('0x30')];_0x5a5f22[_0xf089('0x56')]=qs[_0xf089('0x38')](_0x19edfd['query'][_0xf089('0x38')]);_0x5a5f22[_0xf089('0x3c')]=qs[_0xf089('0x39')](_[_0xf089('0x57')](_0x19edfd[_0xf089('0x32')],_0x47b3ea[_0xf089('0x39')]));if(_0x19edfd['query']['filter']){_0x5a5f22[_0xf089('0x3c')]=_[_0xf089('0x3b')](_0x5a5f22['where'],{'$or':_[_0xf089('0x3d')](_0x5a5f22[_0xf089('0x33')],function(_0x1613be){var _0x106c39={};_0x106c39[_0x1613be]={'$like':'%'+_0x19edfd[_0xf089('0x32')]['filter']+'%'};return _0x106c39;})});}_0x5a5f22=_['merge']({},_0x5a5f22,_0x19edfd[_0xf089('0x41')]);return _0x2ed29a[_0xf089('0x89')](_0x5a5f22);}})[_0xf089('0x29')](function(_0x24e3c4){if(_0x24e3c4){_0x5591dc=_0x24e3c4[_0xf089('0x36')];if(!_0x19edfd[_0xf089('0x32')]['hasOwnProperty'](_0xf089('0x37'))){_0x5a5f22[_0xf089('0x22')]=qs['limit'](_0x19edfd['query']['limit']);_0x5a5f22[_0xf089('0x21')]=qs[_0xf089('0x21')](_0x19edfd[_0xf089('0x32')]['offset']);}return _0x2ed29a[_0xf089('0x89')](_0x5a5f22);}})[_0xf089('0x29')](function(_0x304cb0){if(_0x304cb0){return _0x304cb0?{'count':_0x5591dc,'rows':_0x304cb0}:null;}})[_0xf089('0x29')](respondWithResult(_0x591f52,null))['catch'](handleError(_0x591f52,null));}; \ No newline at end of file +var _0x3c70=['bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./faxQueue.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','name','send','index','FaxQueue','rawAttributes','keys','filters','intersection','model','attributes','query','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','type','options','count','includeAll','include','findAll','find','catch','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','params','describe','getMembers','UserFaxQueue','nolimit','pick','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','rows','SIP','findOne','getTeams','teams','Team','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','emit','removeTeams','ids','select','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x5dd74f,_0x588c9d){var _0x4d4643=function(_0x2a7c29){while(--_0x2a7c29){_0x5dd74f['push'](_0x5dd74f['shift']());}};_0x4d4643(++_0x588c9d);}(_0x3c70,0x10c));var _0x03c7=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x3c70[_0x43d11d];return _0x38cd08;};'use strict';var pdf=require(_0x03c7('0x0'));var emlformat=require(_0x03c7('0x1'));var rimraf=require(_0x03c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03c7('0x3'));var rp=require(_0x03c7('0x4'));var moment=require(_0x03c7('0x5'));var BPromise=require(_0x03c7('0x6'));var Mustache=require(_0x03c7('0x7'));var util=require(_0x03c7('0x8'));var path=require('path');var sox=require(_0x03c7('0x9'));var csv=require('to-csv');var ejs=require(_0x03c7('0xa'));var fs=require('fs');var _=require(_0x03c7('0xb'));var squel=require(_0x03c7('0xc'));var crypto=require('crypto');var jsforce=require(_0x03c7('0xd'));var deskjs=require(_0x03c7('0xe'));var toCsv=require(_0x03c7('0xf'));var querystring=require('querystring');var Papa=require(_0x03c7('0x10'));var Redis=require('ioredis');var authService=require(_0x03c7('0x11'));var qs=require(_0x03c7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03c7('0x13'))(_0x03c7('0x14'));var utils=require(_0x03c7('0x15'));var config=require(_0x03c7('0x16'));var db=require(_0x03c7('0x17'))['db'];config['redis']=_['defaults'](config[_0x03c7('0x18')],{'host':_0x03c7('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03c7('0x18')]));require(_0x03c7('0x1a'))[_0x03c7('0x1b')](socket);function respondWithStatusCode(_0x2c57af,_0x1d9668){_0x1d9668=_0x1d9668||0xcc;return function(_0x5adce3){if(_0x5adce3){return _0x2c57af[_0x03c7('0x1c')](_0x1d9668);}return _0x2c57af['status'](_0x1d9668)[_0x03c7('0x1d')]();};}function respondWithResult(_0x1ae657,_0x4e3ff5){_0x4e3ff5=_0x4e3ff5||0xc8;return function(_0x9a3264){if(_0x9a3264){return _0x1ae657[_0x03c7('0x1e')](_0x4e3ff5)[_0x03c7('0x1f')](_0x9a3264);}};}function respondWithFilteredResult(_0x5e8b01,_0x1d7562){return function(_0x6c852d){if(_0x6c852d){var _0xdb6482=_0x6c852d['count'],_0xdb40cc=_0x1d7562['offset'],_0x37118f=_0x1d7562[_0x03c7('0x20')]+_0x1d7562[_0x03c7('0x21')],_0x2946d7;if(_0x37118f>=_0xdb6482){_0x37118f=_0xdb6482;_0x2946d7=0xc8;}else{_0x2946d7=0xce;}_0x5e8b01[_0x03c7('0x1e')](_0x2946d7);return _0x5e8b01[_0x03c7('0x22')](_0x03c7('0x23'),_0xdb40cc+'-'+_0x37118f+'/'+_0xdb6482)['json'](_0x6c852d);}return null;};}function patchUpdates(_0x1e3de1){return function(_0x1e6fae){try{jsonpatch['apply'](_0x1e6fae,_0x1e3de1,!![]);}catch(_0x4e8062){return BPromise['reject'](_0x4e8062);}return _0x1e6fae[_0x03c7('0x24')]();};}function saveUpdates(_0x734b3b,_0x3a5da2){return function(_0x50b316){if(_0x50b316){return _0x50b316[_0x03c7('0x25')](_0x734b3b)[_0x03c7('0x26')](function(_0x3c960a){return _0x3c960a;});}return null;};}function removeEntity(_0x4d6a9c,_0xfa2d9e){return function(_0x4795e7){if(_0x4795e7){return _0x4795e7[_0x03c7('0x27')]()['then'](function(){var _0x2e7403=_0x4795e7['get']({'plain':!![]});var _0x270ee3=_0x03c7('0x28');return db[_0x03c7('0x29')]['destroy']({'where':{'type':_0x270ee3,'resourceId':_0x2e7403['id']}})[_0x03c7('0x26')](function(){return _0x4795e7;});})[_0x03c7('0x26')](function(){_0x4d6a9c[_0x03c7('0x1e')](0xcc)[_0x03c7('0x1d')]();});}};}function handleEntityNotFound(_0x5041fe,_0x5773e2){return function(_0x270b9a){if(!_0x270b9a){_0x5041fe['sendStatus'](0x194);}return _0x270b9a;};}function handleError(_0x182f72,_0x118491){_0x118491=_0x118491||0x1f4;return function(_0x51929b){logger[_0x03c7('0x2a')](_0x51929b[_0x03c7('0x2b')]);if(_0x51929b[_0x03c7('0x2c')]){delete _0x51929b[_0x03c7('0x2c')];}_0x182f72[_0x03c7('0x1e')](_0x118491)[_0x03c7('0x2d')](_0x51929b);};}exports[_0x03c7('0x2e')]=function(_0x2ab3bb,_0x306699){var _0x464f7e={},_0x199944={},_0x4de5f4={'count':0x0,'rows':[]};var _0x19c3ff=db[_0x03c7('0x2f')][_0x03c7('0x30')];_0x199944['model']=_['keys'](_0x19c3ff);_0x199944['query']=_[_0x03c7('0x31')](_0x2ab3bb['query']);_0x199944[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x199944[_0x03c7('0x34')],_0x199944['query']);_0x464f7e[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x199944[_0x03c7('0x34')],qs['fields'](_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x37')]));_0x464f7e['attributes']=_0x464f7e[_0x03c7('0x35')][_0x03c7('0x38')]?_0x464f7e['attributes']:_0x199944[_0x03c7('0x34')];if(!_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x39')]('nolimit')){_0x464f7e[_0x03c7('0x21')]=qs[_0x03c7('0x21')](_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x21')]);_0x464f7e['offset']=qs[_0x03c7('0x20')](_0x2ab3bb['query'][_0x03c7('0x20')]);}_0x464f7e[_0x03c7('0x3a')]=qs[_0x03c7('0x3b')](_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x3b')]);_0x464f7e[_0x03c7('0x3c')]=qs['filters'](_['pick'](_0x2ab3bb[_0x03c7('0x36')],_0x199944[_0x03c7('0x32')]));if(_0x2ab3bb['query'][_0x03c7('0x3d')]){_0x464f7e[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0x464f7e[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0x19c3ff,function(_0x19da08){if(_0x19da08[_0x03c7('0x40')]['key']!=='VIRTUAL'){var _0x1c6256={};_0x1c6256[_0x19da08['field']]={'$like':'%'+_0x2ab3bb['query'][_0x03c7('0x3d')]+'%'};return _0x1c6256;}})});}_0x464f7e=_[_0x03c7('0x3e')]({},_0x464f7e,_0x2ab3bb[_0x03c7('0x41')]);var _0x525d0={'where':_0x464f7e['where']};return db[_0x03c7('0x2f')]['count'](_0x525d0)[_0x03c7('0x26')](function(_0x288fdd){_0x4de5f4[_0x03c7('0x42')]=_0x288fdd;if(_0x2ab3bb[_0x03c7('0x36')][_0x03c7('0x43')]){_0x464f7e[_0x03c7('0x44')]=[{'all':!![]}];}return db[_0x03c7('0x2f')][_0x03c7('0x45')](_0x464f7e);})[_0x03c7('0x26')](function(_0x4c2001){_0x4de5f4['rows']=_0x4c2001;return _0x4de5f4;})[_0x03c7('0x26')](respondWithFilteredResult(_0x306699,_0x464f7e))['catch'](handleError(_0x306699,null));};exports['show']=function(_0x129bbe,_0x31cca4){var _0x103174={'raw':!![],'where':{'id':_0x129bbe['params']['id']}},_0x13ca1d={};_0x13ca1d[_0x03c7('0x34')]=_[_0x03c7('0x31')](db[_0x03c7('0x2f')]['rawAttributes']);_0x13ca1d[_0x03c7('0x36')]=_[_0x03c7('0x31')](_0x129bbe[_0x03c7('0x36')]);_0x13ca1d[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x13ca1d['model'],_0x13ca1d['query']);_0x103174[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x13ca1d[_0x03c7('0x34')],qs['fields'](_0x129bbe[_0x03c7('0x36')]['fields']));_0x103174[_0x03c7('0x35')]=_0x103174[_0x03c7('0x35')][_0x03c7('0x38')]?_0x103174['attributes']:_0x13ca1d[_0x03c7('0x34')];if(_0x129bbe[_0x03c7('0x36')][_0x03c7('0x43')]){_0x103174[_0x03c7('0x44')]=[{'all':!![]}];}_0x103174=_[_0x03c7('0x3e')]({},_0x103174,_0x129bbe['options']);return db[_0x03c7('0x2f')][_0x03c7('0x46')](_0x103174)[_0x03c7('0x26')](handleEntityNotFound(_0x31cca4,null))[_0x03c7('0x26')](respondWithResult(_0x31cca4,null))[_0x03c7('0x47')](handleError(_0x31cca4,null));};exports['create']=function(_0x45a0f2,_0x31eb6c){return db[_0x03c7('0x2f')][_0x03c7('0x48')](_0x45a0f2[_0x03c7('0x49')],{})[_0x03c7('0x26')](function(_0xc17546){var _0x3d1f32=_0x45a0f2[_0x03c7('0x4a')][_0x03c7('0x4b')]({'plain':!![]});if(!_0x3d1f32)throw new Error(_0x03c7('0x4c'));if(_0x3d1f32[_0x03c7('0x4d')]===_0x03c7('0x4a')){var _0x133007=_0xc17546[_0x03c7('0x4b')]({'plain':!![]});var _0x578303='FaxQueues';return db[_0x03c7('0x4e')][_0x03c7('0x46')]({'where':{'name':_0x578303,'userProfileId':_0x3d1f32[_0x03c7('0x4f')]},'raw':!![]})['then'](function(_0x20825a){if(_0x20825a&&_0x20825a[_0x03c7('0x50')]===0x0){return db[_0x03c7('0x29')][_0x03c7('0x48')]({'name':_0x133007[_0x03c7('0x2c')],'resourceId':_0x133007['id'],'type':_0x20825a[_0x03c7('0x2c')],'sectionId':_0x20825a['id']},{})[_0x03c7('0x26')](function(){return _0xc17546;});}else{return _0xc17546;}})[_0x03c7('0x47')](function(_0x30ebcb){logger[_0x03c7('0x2a')](_0x03c7('0x51'),_0x30ebcb);throw _0x30ebcb;});}return _0xc17546;})['then'](respondWithResult(_0x31eb6c,0xc9))['catch'](handleError(_0x31eb6c,null));};exports[_0x03c7('0x25')]=function(_0x376991,_0x46c805){if(_0x376991[_0x03c7('0x49')]['id']){delete _0x376991[_0x03c7('0x49')]['id'];}return db['FaxQueue'][_0x03c7('0x46')]({'where':{'id':_0x376991[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](handleEntityNotFound(_0x46c805,null))['then'](saveUpdates(_0x376991['body'],null))[_0x03c7('0x26')](respondWithResult(_0x46c805,null))[_0x03c7('0x47')](handleError(_0x46c805,null));};exports['destroy']=function(_0x19d5aa,_0x5049bb){return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x19d5aa[_0x03c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x5049bb,null))[_0x03c7('0x26')](removeEntity(_0x5049bb,null))[_0x03c7('0x47')](handleError(_0x5049bb,null));};exports[_0x03c7('0x53')]=function(_0x400e91,_0x5f2fcb){return db[_0x03c7('0x2f')][_0x03c7('0x53')]()['then'](respondWithResult(_0x5f2fcb,null))['catch'](handleError(_0x5f2fcb,null));};exports[_0x03c7('0x54')]=function(_0x558663,_0x4d546b,_0x2f505f){var _0xdbd64c={'raw':!![],'where':{}},_0x5b3624={},_0x49558a;return db[_0x03c7('0x2f')]['findOne']({'where':{'id':_0x558663[_0x03c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d546b,null))['then'](function(_0x2e48d1){if(_0x2e48d1){_0x49558a=_0x2e48d1['get']({'plain':!![]});_0x5b3624[_0x03c7('0x34')]=_[_0x03c7('0x31')](db[_0x03c7('0x55')][_0x03c7('0x30')]);_0x5b3624[_0x03c7('0x36')]=_[_0x03c7('0x31')](_0x558663[_0x03c7('0x36')]);_0x5b3624[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x5b3624[_0x03c7('0x34')],_0x5b3624[_0x03c7('0x36')]);_0xdbd64c[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x5b3624[_0x03c7('0x34')],qs[_0x03c7('0x37')](_0x558663[_0x03c7('0x36')][_0x03c7('0x37')]));_0xdbd64c['attributes']=_0xdbd64c[_0x03c7('0x35')][_0x03c7('0x38')]?_0xdbd64c[_0x03c7('0x35')]:_0x5b3624['model'];if(!_0x558663[_0x03c7('0x36')]['hasOwnProperty'](_0x03c7('0x56'))){_0xdbd64c['limit']=qs[_0x03c7('0x21')](_0x558663[_0x03c7('0x36')][_0x03c7('0x21')]);_0xdbd64c[_0x03c7('0x20')]=qs['offset'](_0x558663['query'][_0x03c7('0x20')]);}_0xdbd64c['order']=qs[_0x03c7('0x3b')](_0x558663['query'][_0x03c7('0x3b')]);_0xdbd64c['where']=qs[_0x03c7('0x32')](_[_0x03c7('0x57')](_0x558663[_0x03c7('0x36')],_0x5b3624[_0x03c7('0x32')]));_0xdbd64c[_0x03c7('0x3c')]['FaxQueueId']=_0x2e48d1['id'];if(_0x558663[_0x03c7('0x36')][_0x03c7('0x3d')]){_0xdbd64c[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0xdbd64c[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0xdbd64c[_0x03c7('0x35')],function(_0x3364a7){var _0x2ec2cb={};_0x2ec2cb[_0x3364a7]={'$like':'%'+_0x558663[_0x03c7('0x36')][_0x03c7('0x3d')]+'%'};return _0x2ec2cb;})});}_0xdbd64c=_[_0x03c7('0x3e')]({},_0xdbd64c,_0x558663[_0x03c7('0x41')]);return db['UserFaxQueue'][_0x03c7('0x45')](_0xdbd64c);}})[_0x03c7('0x26')](function(_0x3ca756){if(_0x3ca756){return db[_0x03c7('0x58')][_0x03c7('0x59')]({'where':{'id':_[_0x03c7('0x3f')](_0x3ca756,_0x03c7('0x5a')),'role':_0x03c7('0x5b')},'attributes':['id',_0x03c7('0x2c'),_0x03c7('0x5c'),_0x03c7('0x5d'),_0x03c7('0x5e')]});}})['then'](function(_0x41c2c4){if(_0x41c2c4){return{'count':_0x41c2c4[_0x03c7('0x42')],'rows':_[_0x03c7('0x3f')](_0x41c2c4[_0x03c7('0x5f')],function(_0x5e9238){return{'membername':_0x5e9238['name'],'UserId':_0x5e9238['id'],'queue_name':_0x49558a[_0x03c7('0x2c')],'FaxQueueId':_0x49558a['id'],'interface':util['format']('%s/%s',_0x03c7('0x60'),_0x5e9238['name']),'penalty':0x0,'paused':_0x5e9238[_0x03c7('0x5c')],'createdAt':_0x5e9238['createdAt'],'updatedAt':_0x5e9238[_0x03c7('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x03c7('0x26')](respondWithFilteredResult(_0x4d546b,_0xdbd64c))['catch'](handleError(_0x4d546b,null));};exports['getTeams']=function(_0x5c5113,_0x42b62e,_0x3eb0c6){var _0x48d57c={};var _0x2ce44e={};var _0x1609a6;var _0x793d43;return db[_0x03c7('0x2f')][_0x03c7('0x61')]({'where':{'id':_0x5c5113['params']['id']}})['then'](handleEntityNotFound(_0x42b62e,null))[_0x03c7('0x26')](function(_0x5557f3){if(_0x5557f3){_0x1609a6=_0x5557f3;_0x2ce44e[_0x03c7('0x34')]=_[_0x03c7('0x31')](db['Team']['rawAttributes']);_0x2ce44e[_0x03c7('0x36')]=_[_0x03c7('0x31')](_0x5c5113[_0x03c7('0x36')]);_0x2ce44e[_0x03c7('0x32')]=_[_0x03c7('0x33')](_0x2ce44e[_0x03c7('0x34')],_0x2ce44e[_0x03c7('0x36')]);_0x48d57c['attributes']=_[_0x03c7('0x33')](_0x2ce44e[_0x03c7('0x34')],qs['fields'](_0x5c5113[_0x03c7('0x36')][_0x03c7('0x37')]));_0x48d57c[_0x03c7('0x35')]=_0x48d57c[_0x03c7('0x35')][_0x03c7('0x38')]?_0x48d57c[_0x03c7('0x35')]:_0x2ce44e[_0x03c7('0x34')];_0x48d57c['order']=qs[_0x03c7('0x3b')](_0x5c5113[_0x03c7('0x36')][_0x03c7('0x3b')]);_0x48d57c[_0x03c7('0x3c')]=qs['filters'](_['pick'](_0x5c5113[_0x03c7('0x36')],_0x2ce44e[_0x03c7('0x32')]));if(_0x5c5113['query'][_0x03c7('0x3d')]){_0x48d57c[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0x48d57c[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0x48d57c[_0x03c7('0x35')],function(_0x2ad246){var _0x10de41={};_0x10de41[_0x2ad246]={'$like':'%'+_0x5c5113[_0x03c7('0x36')][_0x03c7('0x3d')]+'%'};return _0x10de41;})});}_0x48d57c=_[_0x03c7('0x3e')]({},_0x48d57c,_0x5c5113[_0x03c7('0x41')]);return _0x1609a6[_0x03c7('0x62')](_0x48d57c);}})['then'](function(_0x30a745){if(_0x30a745){_0x793d43=_0x30a745['length'];if(!_0x5c5113[_0x03c7('0x36')][_0x03c7('0x39')]('nolimit')){_0x48d57c[_0x03c7('0x21')]=qs[_0x03c7('0x21')](_0x5c5113[_0x03c7('0x36')][_0x03c7('0x21')]);_0x48d57c['offset']=qs[_0x03c7('0x20')](_0x5c5113['query'][_0x03c7('0x20')]);}return _0x1609a6['getTeams'](_0x48d57c);}})[_0x03c7('0x26')](function(_0x334f4a){if(_0x334f4a){return _0x334f4a?{'count':_0x793d43,'rows':_0x334f4a}:null;}})[_0x03c7('0x26')](respondWithResult(_0x42b62e,null))[_0x03c7('0x47')](handleError(_0x42b62e,null));};exports['addTeams']=function(_0x5bc146,_0x21d2b2,_0x51ff9f){var _0x337f5a=_0x5bc146[_0x03c7('0x49')][_0x03c7('0x63')];return db[_0x03c7('0x64')][_0x03c7('0x45')]({'where':{'id':_[_0x03c7('0x3f')](_0x337f5a,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x03c7('0x65'),'attributes':['id','name','online',_0x03c7('0x66'),'interface'],'raw':!![]}]})[_0x03c7('0x26')](function(_0x461920){if(_0x461920){var _0x32f5fa=_[_0x03c7('0x67')](_0x461920,function(_0x57b6e2){var _0x4fd1e3=_0x57b6e2[_0x03c7('0x4b')]({'plain':!![]});return _0x4fd1e3['Agents'];});return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x5bc146['params']['id']}})[_0x03c7('0x26')](function(_0x597c17){return db[_0x03c7('0x68')][_0x03c7('0x69')](function(_0x4f5dae){return _0x597c17[_0x03c7('0x6a')](_['map'](_0x337f5a,'id'),{'transaction':_0x4f5dae})[_0x03c7('0x26')](function(){return BPromise[_0x03c7('0x6b')](_0x32f5fa,function(_0x3ee34c){return db['UserFaxQueue']['findOrCreate']({'where':{'UserId':_0x3ee34c['id'],'FaxQueueId':_0x5bc146[_0x03c7('0x52')]['id']},'transaction':_0x4f5dae});});})[_0x03c7('0x26')](function(){_0x32f5fa['forEach'](function(_0x4c38ce){socket[_0x03c7('0x6c')]('userFaxQueue:save',{'UserId':_0x4c38ce['id'],'FaxQueueId':_0x597c17['id']});});});});});}})['then'](respondWithStatusCode(_0x21d2b2,null))[_0x03c7('0x47')](handleError(_0x21d2b2,null));};exports[_0x03c7('0x6d')]=function(_0x3c6f6c,_0x342fb8,_0x2c11ce){return db[_0x03c7('0x64')][_0x03c7('0x45')]({'where':{'id':_0x3c6f6c[_0x03c7('0x36')][_0x03c7('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x03c7('0x65'),'attributes':['id'],'raw':!![]}]})[_0x03c7('0x26')](handleEntityNotFound(_0x342fb8,null))[_0x03c7('0x26')](function(_0x3244e8){var _0x2d7e71=_[_0x03c7('0x3f')](_0x3244e8,'id');var _0x1a29e8=[];var _0x50c130=[];var _0x77614b=squel[_0x03c7('0x6f')]();_0x77614b['field'](_0x03c7('0x70'))['from'](_0x03c7('0x71'),'tq')['join'](_0x03c7('0x72'),'ut',_0x03c7('0x73'))['where'](_0x03c7('0x74'),_0x3c6f6c[_0x03c7('0x52')]['id']);for(var _0x30e959=0x0;_0x30e959<_0x3244e8[_0x03c7('0x38')];_0x30e959+=0x1){let _0xa575d=_0x3244e8[_0x30e959];for(var _0x14e9ee=0x0;_0x14e9ee<_0xa575d['Agents']['length'];_0x14e9ee+=0x1){let _0x72d871=_0xa575d['Agents'][_0x14e9ee];var _0x25ea6c=_0x77614b['clone']();_0x25ea6c[_0x03c7('0x3c')]('ut.UserId\x20=\x20?',_0x72d871['id']);_0x50c130[_0x03c7('0x75')](db[_0x03c7('0x68')][_0x03c7('0x36')](_0x25ea6c[_0x03c7('0x76')](),{'type':db[_0x03c7('0x68')][_0x03c7('0x77')][_0x03c7('0x78')]})[_0x03c7('0x26')](function(_0x35c506){if(_0x35c506['length']===0x1){return _0x72d871['id'];}else{var _0x572b4e=_[_0x03c7('0x79')](_[_0x03c7('0x3f')](_0x35c506,_0x03c7('0x7a')),function(_0x375536){return _[_0x03c7('0x7b')](_0x2d7e71,_0x375536);});if(_0x572b4e){return _0x72d871['id'];}}}));}}return BPromise[_0x03c7('0x7c')](_0x50c130)[_0x03c7('0x26')](function(_0x4540fc){_0x1a29e8=_(_0x1a29e8)[_0x03c7('0x7d')](_0x4540fc)[_0x03c7('0x7e')]()['value']();return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x3c6f6c[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](function(_0x467402){return db['sequelize'][_0x03c7('0x69')](function(_0x1a17cf){return _0x467402[_0x03c7('0x6d')](_0x3c6f6c['query'][_0x03c7('0x6e')],{'transaction':_0x1a17cf})[_0x03c7('0x26')](function(){if(!_[_0x03c7('0x7f')](_0x1a29e8)){return _0x467402['removeAgents'](_0x1a29e8,{'transaction':_0x1a17cf});}})['then'](function(){_0x1a29e8[_0x03c7('0x80')](function(_0x1a18ec){socket['emit'](_0x03c7('0x81'),{'UserId':_0x1a18ec,'FaxQueueId':_0x467402['id']});});});});});});})[_0x03c7('0x26')](respondWithStatusCode(_0x342fb8,null))[_0x03c7('0x47')](handleError(_0x342fb8,null));};exports[_0x03c7('0x82')]=function(_0x898fef,_0x18d4a6,_0x3d8413){return db[_0x03c7('0x2f')][_0x03c7('0x46')]({'where':{'id':_0x898fef[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](handleEntityNotFound(_0x18d4a6,null))[_0x03c7('0x26')](function(_0x111047){if(_0x111047){return _0x111047[_0x03c7('0x82')](_0x898fef['body']['ids'],_[_0x03c7('0x83')](_0x898fef['body'],[_0x03c7('0x6e'),'id'])||{})[_0x03c7('0x84')](function(_0x52928f){for(var _0x2adc36=0x0;_0x2adc36<_0x898fef['body']['ids'][_0x03c7('0x38')];_0x2adc36+=0x1){socket[_0x03c7('0x6c')](_0x03c7('0x85'),{'UserId':_0x898fef[_0x03c7('0x49')]['ids'][_0x2adc36],'FaxQueueId':_0x898fef[_0x03c7('0x52')]['id']});}return _0x52928f;});}})[_0x03c7('0x26')](respondWithResult(_0x18d4a6,null))[_0x03c7('0x47')](handleError(_0x18d4a6,null));};exports[_0x03c7('0x86')]=function(_0x29d472,_0x31c4e0,_0x7f1782){return db['FaxQueue'][_0x03c7('0x46')]({'where':{'id':_0x29d472[_0x03c7('0x52')]['id']}})['then'](handleEntityNotFound(_0x31c4e0,null))[_0x03c7('0x26')](function(_0x51b6c1){if(_0x51b6c1){return _0x51b6c1['removeAgents'](_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')])[_0x03c7('0x26')](function(){if(_[_0x03c7('0x87')](_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')])){for(var _0x122762=0x0;_0x122762<_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')][_0x03c7('0x38')];_0x122762+=0x1){socket[_0x03c7('0x6c')](_0x03c7('0x81'),{'UserId':Number(_0x29d472[_0x03c7('0x36')][_0x03c7('0x6e')][_0x122762]),'FaxQueueId':Number(_0x29d472[_0x03c7('0x52')]['id'])});}}else{socket[_0x03c7('0x6c')]('userFaxQueue:remove',{'UserId':Number(_0x29d472['query'][_0x03c7('0x6e')]),'FaxQueueId':Number(_0x29d472[_0x03c7('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x31c4e0,null))[_0x03c7('0x47')](handleError(_0x31c4e0,null));};exports[_0x03c7('0x88')]=function(_0xea9153,_0x18b389,_0x2b2d48){var _0x4dede6={};var _0x214fac={};var _0x3f0f28;var _0x9244e4;return db[_0x03c7('0x2f')][_0x03c7('0x61')]({'where':{'id':_0xea9153[_0x03c7('0x52')]['id']}})[_0x03c7('0x26')](handleEntityNotFound(_0x18b389,null))[_0x03c7('0x26')](function(_0x210f80){if(_0x210f80){_0x3f0f28=_0x210f80;_0x214fac[_0x03c7('0x34')]=_[_0x03c7('0x31')](db['User'][_0x03c7('0x30')]);_0x214fac[_0x03c7('0x36')]=_['keys'](_0xea9153[_0x03c7('0x36')]);_0x214fac['filters']=_['intersection'](_0x214fac[_0x03c7('0x34')],_0x214fac[_0x03c7('0x36')]);_0x4dede6[_0x03c7('0x35')]=_[_0x03c7('0x33')](_0x214fac[_0x03c7('0x34')],qs['fields'](_0xea9153[_0x03c7('0x36')]['fields']));_0x4dede6['attributes']=_0x4dede6[_0x03c7('0x35')]['length']?_0x4dede6[_0x03c7('0x35')]:_0x214fac['model'];_0x4dede6[_0x03c7('0x3a')]=qs[_0x03c7('0x3b')](_0xea9153[_0x03c7('0x36')]['sort']);_0x4dede6['where']=qs[_0x03c7('0x32')](_['pick'](_0xea9153[_0x03c7('0x36')],_0x214fac[_0x03c7('0x32')]));if(_0xea9153[_0x03c7('0x36')][_0x03c7('0x3d')]){_0x4dede6[_0x03c7('0x3c')]=_[_0x03c7('0x3e')](_0x4dede6[_0x03c7('0x3c')],{'$or':_[_0x03c7('0x3f')](_0x4dede6[_0x03c7('0x35')],function(_0x445300){var _0x3ee5bb={};_0x3ee5bb[_0x445300]={'$like':'%'+_0xea9153['query']['filter']+'%'};return _0x3ee5bb;})});}_0x4dede6=_[_0x03c7('0x3e')]({},_0x4dede6,_0xea9153[_0x03c7('0x41')]);return _0x3f0f28[_0x03c7('0x88')](_0x4dede6);}})[_0x03c7('0x26')](function(_0x47f104){if(_0x47f104){_0x9244e4=_0x47f104['length'];if(!_0xea9153[_0x03c7('0x36')]['hasOwnProperty'](_0x03c7('0x56'))){_0x4dede6[_0x03c7('0x21')]=qs[_0x03c7('0x21')](_0xea9153['query']['limit']);_0x4dede6[_0x03c7('0x20')]=qs[_0x03c7('0x20')](_0xea9153['query'][_0x03c7('0x20')]);}return _0x3f0f28[_0x03c7('0x88')](_0x4dede6);}})[_0x03c7('0x26')](function(_0x2edc18){if(_0x2edc18){return _0x2edc18?{'count':_0x9244e4,'rows':_0x2edc18}:null;}})[_0x03c7('0x26')](respondWithResult(_0x18b389,null))[_0x03c7('0x47')](handleError(_0x18b389,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index b9e293d..3931b2d 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 _0x0fda=['hook','exports','events','FaxQueue','setMaxListeners','save','update','remove','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0fda,0x1a0));var _0xa0fd=function(_0x45638c,_0x1f26e1){_0x45638c=_0x45638c-0x0;var _0x46ce62=_0x0fda[_0x45638c];return _0x46ce62;};'use strict';var EventEmitter=require(_0xa0fd('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0xa0fd('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa0fd('0x2')](0x0);var events={'afterCreate':_0xa0fd('0x3'),'afterUpdate':_0xa0fd('0x4'),'afterDestroy':_0xa0fd('0x5')};function emitEvent(_0xd8e73a){return function(_0x13c734,_0x574fca,_0x4978fa){FaxQueueEvents[_0xa0fd('0x6')](_0xd8e73a+':'+_0x13c734['id'],_0x13c734);FaxQueueEvents['emit'](_0xd8e73a,_0x13c734);_0x4978fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xa0fd('0x7')](e,emitEvent(event));}}module[_0xa0fd('0x8')]=FaxQueueEvents; \ No newline at end of file +var _0xc3b5=['setMaxListeners','save','update','remove','emit','hook','exports','FaxQueue'];(function(_0x5404f2,_0x1109a5){var _0x3e3ef0=function(_0x547731){while(--_0x547731){_0x5404f2['push'](_0x5404f2['shift']());}};_0x3e3ef0(++_0x1109a5);}(_0xc3b5,0x6f));var _0x5c3b=function(_0xd851b3,_0x140e24){_0xd851b3=_0xd851b3-0x0;var _0x3707c1=_0xc3b5[_0xd851b3];return _0x3707c1;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db'][_0x5c3b('0x0')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x5c3b('0x1')](0x0);var events={'afterCreate':_0x5c3b('0x2'),'afterUpdate':_0x5c3b('0x3'),'afterDestroy':_0x5c3b('0x4')};function emitEvent(_0x34be81){return function(_0x237a61,_0x48f8a1,_0x587055){FaxQueueEvents[_0x5c3b('0x5')](_0x34be81+':'+_0x237a61['id'],_0x237a61);FaxQueueEvents[_0x5c3b('0x5')](_0x34be81,_0x237a61);_0x587055(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x5c3b('0x6')](e,emitEvent(event));}}module[_0x5c3b('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 192ebec..465ce8a 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','lodash','../../config/logger'];(function(_0x567fff,_0xd8acd8){var _0x465a37=function(_0x9d7bf7){while(--_0x9d7bf7){_0x567fff['push'](_0x567fff['shift']());}};_0x465a37(++_0xd8acd8);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c0c92,_0x267969){_0x3c0c92=_0x3c0c92-0x0;var _0xe3859b=_0xb10b[_0x3c0c92];return _0xe3859b;};'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')]('FaxQueue',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0e=['path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x4162e8,_0x421221){var _0x48768c=function(_0x25f33f){while(--_0x25f33f){_0x4162e8['push'](_0x4162e8['shift']());}};_0x48768c(++_0x421221);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1af655,_0x28b928){_0x1af655=_0x1af655-0x0;var _0x29da01=_0x0b0e[_0x1af655];return _0x29da01;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 7cb5701..fdd2459 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 _0x1ad0=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetFaxQueue','FaxQueue','options','raw','attributes','limit','map','include','model','debug','ShowFaxQueue','find','where','stringify','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5c9f9c,_0x2193ed){var _0x20350a=function(_0x4b7419){while(--_0x4b7419){_0x5c9f9c['push'](_0x5c9f9c['shift']());}};_0x20350a(++_0x2193ed);}(_0x1ad0,0xa6));var _0x01ad=function(_0x43d1ec,_0x32b511){_0x43d1ec=_0x43d1ec-0x0;var _0x1529ce=_0x1ad0[_0x43d1ec];return _0x1529ce;};'use strict';var _=require(_0x01ad('0x0'));var util=require(_0x01ad('0x1'));var moment=require(_0x01ad('0x2'));var BPromise=require(_0x01ad('0x3'));var rs=require(_0x01ad('0x4'));var fs=require('fs');var Redis=require(_0x01ad('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x01ad('0x6'));var logger=require(_0x01ad('0x7'))('rpc');var config=require(_0x01ad('0x8'));var jayson=require(_0x01ad('0x9'));var client=jayson[_0x01ad('0xa')][_0x01ad('0xb')]({'port':0x232a});config[_0x01ad('0xc')]=_[_0x01ad('0xd')](config[_0x01ad('0xc')],{'host':_0x01ad('0xe'),'port':0x18eb});var socket=require(_0x01ad('0xf'))(new Redis(config['redis']));require(_0x01ad('0x10'))[_0x01ad('0x11')](socket);function respondWithRpcPromise(_0x7c28f,_0x305e9b,_0xbe8d7c){return new BPromise(function(_0x12f3c3,_0x538171){return client[_0x01ad('0x12')](_0x7c28f,_0xbe8d7c)[_0x01ad('0x13')](function(_0x1c95c9){logger['info'](_0x01ad('0x14'),_0x305e9b,_0x01ad('0x15'));logger['debug'](_0x01ad('0x16'),_0x305e9b,_0x01ad('0x15'),JSON['stringify'](_0x1c95c9));if(_0x1c95c9[_0x01ad('0x17')]){if(_0x1c95c9[_0x01ad('0x17')][_0x01ad('0x18')]===0x1f4){logger['error']('FaxQueue,\x20%s,\x20%s',_0x305e9b,_0x1c95c9[_0x01ad('0x17')][_0x01ad('0x19')]);return _0x538171(_0x1c95c9[_0x01ad('0x17')][_0x01ad('0x19')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x305e9b,_0x1c95c9[_0x01ad('0x17')][_0x01ad('0x19')]);return _0x12f3c3(_0x1c95c9['error'][_0x01ad('0x19')]);}else{logger[_0x01ad('0x1a')](_0x01ad('0x14'),_0x305e9b,_0x01ad('0x15'));_0x12f3c3(_0x1c95c9[_0x01ad('0x1b')][_0x01ad('0x19')]);}})[_0x01ad('0x1c')](function(_0x5ce693){logger[_0x01ad('0x17')](_0x01ad('0x14'),_0x305e9b,_0x5ce693);_0x538171(_0x5ce693);});});}exports[_0x01ad('0x1d')]=function(_0x352376){var _0x52caac=this;return new Promise(function(_0x5645d6,_0x3da537){return db[_0x01ad('0x1e')]['findAll']({'raw':_0x352376['options']?_0x352376[_0x01ad('0x1f')][_0x01ad('0x20')]===undefined?!![]:![]:!![],'where':_0x352376[_0x01ad('0x1f')]?_0x352376[_0x01ad('0x1f')]['where']||null:null,'attributes':_0x352376[_0x01ad('0x1f')]?_0x352376['options'][_0x01ad('0x21')]||null:null,'limit':_0x352376[_0x01ad('0x1f')]?_0x352376[_0x01ad('0x1f')][_0x01ad('0x22')]||null:null,'include':_0x352376[_0x01ad('0x1f')]?_0x352376[_0x01ad('0x1f')]['include']?_[_0x01ad('0x23')](_0x352376[_0x01ad('0x1f')][_0x01ad('0x24')],function(_0x43aa87){return{'model':db[_0x43aa87[_0x01ad('0x25')]],'as':_0x43aa87['as'],'attributes':_0x43aa87[_0x01ad('0x21')],'include':_0x43aa87[_0x01ad('0x24')]?_['map'](_0x43aa87[_0x01ad('0x24')],function(_0x4eabfb){return{'model':db[_0x4eabfb[_0x01ad('0x25')]],'as':_0x4eabfb['as'],'attributes':_0x4eabfb[_0x01ad('0x21')],'include':_0x4eabfb['include']?_[_0x01ad('0x23')](_0x4eabfb[_0x01ad('0x24')],function(_0xed57a8){return{'model':db[_0xed57a8[_0x01ad('0x25')]],'as':_0xed57a8['as'],'attributes':_0xed57a8[_0x01ad('0x21')]};}):[]};}):[]};}):[]:[]})[_0x01ad('0x13')](function(_0x4f2bf1){logger['info'](_0x01ad('0x1d'),_0x352376);logger[_0x01ad('0x26')](_0x01ad('0x1d'),_0x352376,JSON['stringify'](_0x4f2bf1));_0x5645d6(_0x4f2bf1);})[_0x01ad('0x1c')](function(_0x3ae1af){logger['error'](_0x01ad('0x1d'),_0x3ae1af[_0x01ad('0x19')],_0x352376);_0x3da537(_0x52caac[_0x01ad('0x17')](0x1f4,_0x3ae1af[_0x01ad('0x19')]));});});};exports[_0x01ad('0x27')]=function(_0x277ec5){var _0x578d79=this;return new Promise(function(_0x3a2f18,_0x5da10f){return db[_0x01ad('0x1e')][_0x01ad('0x28')]({'raw':_0x277ec5['options']?_0x277ec5[_0x01ad('0x1f')][_0x01ad('0x20')]===undefined?!![]:![]:!![],'where':_0x277ec5['options']?_0x277ec5['options'][_0x01ad('0x29')]||null:null,'attributes':_0x277ec5[_0x01ad('0x1f')]?_0x277ec5['options']['attributes']||null:null,'include':_0x277ec5['options']?_0x277ec5[_0x01ad('0x1f')][_0x01ad('0x24')]?_[_0x01ad('0x23')](_0x277ec5[_0x01ad('0x1f')][_0x01ad('0x24')],function(_0x43b2bd){return{'model':db[_0x43b2bd[_0x01ad('0x25')]],'as':_0x43b2bd['as'],'attributes':_0x43b2bd[_0x01ad('0x21')],'include':_0x43b2bd[_0x01ad('0x24')]?_['map'](_0x43b2bd[_0x01ad('0x24')],function(_0x54c7b9){return{'model':db[_0x54c7b9['model']],'as':_0x54c7b9['as'],'attributes':_0x54c7b9[_0x01ad('0x21')],'include':_0x54c7b9['include']?_[_0x01ad('0x23')](_0x54c7b9[_0x01ad('0x24')],function(_0x264ce){return{'model':db[_0x264ce[_0x01ad('0x25')]],'as':_0x264ce['as'],'attributes':_0x264ce['attributes']};}):[]};}):[]};}):[]:[]})[_0x01ad('0x13')](function(_0x2c4a3a){logger[_0x01ad('0x1a')](_0x01ad('0x27'),_0x277ec5);logger['debug'](_0x01ad('0x27'),_0x277ec5,JSON[_0x01ad('0x2a')](_0x2c4a3a));_0x3a2f18(_0x2c4a3a);})[_0x01ad('0x1c')](function(_0x148430){logger['error'](_0x01ad('0x27'),_0x148430['message'],_0x277ec5);_0x5da10f(_0x578d79[_0x01ad('0x17')](0x1f4,_0x148430[_0x01ad('0x19')]));});});}; \ No newline at end of file +var _0x2661=['catch','GetFaxQueue','FaxQueue','options','where','attributes','limit','include','model','map','ShowFaxQueue','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result'];(function(_0xdd4555,_0x368dc9){var _0x5b035c=function(_0x2a00b9){while(--_0x2a00b9){_0xdd4555['push'](_0xdd4555['shift']());}};_0x5b035c(++_0x368dc9);}(_0x2661,0x116));var _0x1266=function(_0x59c9ac,_0x49bf7d){_0x59c9ac=_0x59c9ac-0x0;var _0x77d575=_0x2661[_0x59c9ac];return _0x77d575;};'use strict';var _=require(_0x1266('0x0'));var util=require('util');var moment=require(_0x1266('0x1'));var BPromise=require(_0x1266('0x2'));var rs=require(_0x1266('0x3'));var fs=require('fs');var Redis=require(_0x1266('0x4'));var db=require(_0x1266('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1266('0x6'))('rpc');var config=require(_0x1266('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1266('0x8')][_0x1266('0x9')]({'port':0x232a});config[_0x1266('0xa')]=_[_0x1266('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1266('0xc'))(new Redis(config[_0x1266('0xa')]));require('./faxQueue.socket')[_0x1266('0xd')](socket);function respondWithRpcPromise(_0x25ef14,_0x9aedd3,_0x199df9){return new BPromise(function(_0x5345c1,_0x52cbf5){return client[_0x1266('0xe')](_0x25ef14,_0x199df9)[_0x1266('0xf')](function(_0x415b1c){logger[_0x1266('0x10')]('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x1266('0x11'));logger[_0x1266('0x12')](_0x1266('0x13'),_0x9aedd3,'request\x20sent',JSON[_0x1266('0x14')](_0x415b1c));if(_0x415b1c['error']){if(_0x415b1c[_0x1266('0x15')][_0x1266('0x16')]===0x1f4){logger[_0x1266('0x15')](_0x1266('0x17'),_0x9aedd3,_0x415b1c[_0x1266('0x15')][_0x1266('0x18')]);return _0x52cbf5(_0x415b1c[_0x1266('0x15')][_0x1266('0x18')]);}logger[_0x1266('0x15')]('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x415b1c['error'][_0x1266('0x18')]);return _0x5345c1(_0x415b1c[_0x1266('0x15')][_0x1266('0x18')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x1266('0x11'));_0x5345c1(_0x415b1c[_0x1266('0x19')][_0x1266('0x18')]);}})[_0x1266('0x1a')](function(_0x2a2343){logger[_0x1266('0x15')]('FaxQueue,\x20%s,\x20%s',_0x9aedd3,_0x2a2343);_0x52cbf5(_0x2a2343);});});}exports[_0x1266('0x1b')]=function(_0x262a5e){var _0x5bc7d2=this;return new Promise(function(_0x10db01,_0x4a93c7){return db[_0x1266('0x1c')]['findAll']({'raw':_0x262a5e['options']?_0x262a5e['options']['raw']===undefined?!![]:![]:!![],'where':_0x262a5e[_0x1266('0x1d')]?_0x262a5e[_0x1266('0x1d')][_0x1266('0x1e')]||null:null,'attributes':_0x262a5e[_0x1266('0x1d')]?_0x262a5e[_0x1266('0x1d')][_0x1266('0x1f')]||null:null,'limit':_0x262a5e['options']?_0x262a5e['options'][_0x1266('0x20')]||null:null,'include':_0x262a5e[_0x1266('0x1d')]?_0x262a5e[_0x1266('0x1d')][_0x1266('0x21')]?_['map'](_0x262a5e[_0x1266('0x1d')][_0x1266('0x21')],function(_0x50127a){return{'model':db[_0x50127a[_0x1266('0x22')]],'as':_0x50127a['as'],'attributes':_0x50127a[_0x1266('0x1f')],'include':_0x50127a[_0x1266('0x21')]?_[_0x1266('0x23')](_0x50127a['include'],function(_0x11561e){return{'model':db[_0x11561e['model']],'as':_0x11561e['as'],'attributes':_0x11561e[_0x1266('0x1f')],'include':_0x11561e[_0x1266('0x21')]?_[_0x1266('0x23')](_0x11561e[_0x1266('0x21')],function(_0x13d9cd){return{'model':db[_0x13d9cd[_0x1266('0x22')]],'as':_0x13d9cd['as'],'attributes':_0x13d9cd[_0x1266('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1266('0xf')](function(_0x357fca){logger['info'](_0x1266('0x1b'),_0x262a5e);logger[_0x1266('0x12')]('GetFaxQueue',_0x262a5e,JSON[_0x1266('0x14')](_0x357fca));_0x10db01(_0x357fca);})[_0x1266('0x1a')](function(_0x74cb21){logger[_0x1266('0x15')]('GetFaxQueue',_0x74cb21[_0x1266('0x18')],_0x262a5e);_0x4a93c7(_0x5bc7d2['error'](0x1f4,_0x74cb21[_0x1266('0x18')]));});});};exports[_0x1266('0x24')]=function(_0x2c9c0a){var _0x3a24b9=this;return new Promise(function(_0x64cdb6,_0x11e07c){return db[_0x1266('0x1c')]['find']({'raw':_0x2c9c0a[_0x1266('0x1d')]?_0x2c9c0a[_0x1266('0x1d')][_0x1266('0x25')]===undefined?!![]:![]:!![],'where':_0x2c9c0a[_0x1266('0x1d')]?_0x2c9c0a[_0x1266('0x1d')]['where']||null:null,'attributes':_0x2c9c0a['options']?_0x2c9c0a['options'][_0x1266('0x1f')]||null:null,'include':_0x2c9c0a[_0x1266('0x1d')]?_0x2c9c0a[_0x1266('0x1d')][_0x1266('0x21')]?_[_0x1266('0x23')](_0x2c9c0a[_0x1266('0x1d')][_0x1266('0x21')],function(_0x1060df){return{'model':db[_0x1060df['model']],'as':_0x1060df['as'],'attributes':_0x1060df[_0x1266('0x1f')],'include':_0x1060df[_0x1266('0x21')]?_[_0x1266('0x23')](_0x1060df[_0x1266('0x21')],function(_0x207ed7){return{'model':db[_0x207ed7[_0x1266('0x22')]],'as':_0x207ed7['as'],'attributes':_0x207ed7['attributes'],'include':_0x207ed7[_0x1266('0x21')]?_[_0x1266('0x23')](_0x207ed7[_0x1266('0x21')],function(_0x52c340){return{'model':db[_0x52c340[_0x1266('0x22')]],'as':_0x52c340['as'],'attributes':_0x52c340[_0x1266('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1266('0xf')](function(_0x1ebf4c){logger['info'](_0x1266('0x24'),_0x2c9c0a);logger[_0x1266('0x12')](_0x1266('0x24'),_0x2c9c0a,JSON[_0x1266('0x14')](_0x1ebf4c));_0x64cdb6(_0x1ebf4c);})[_0x1266('0x1a')](function(_0x31da14){logger['error'](_0x1266('0x24'),_0x31da14[_0x1266('0x18')],_0x2c9c0a);_0x11e07c(_0x3a24b9[_0x1266('0x15')](0x1f4,_0x31da14[_0x1266('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index c0fd5c9..97dbdda 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 _0x6a32=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x1ca711,_0x43e011){var _0x8be5f6=function(_0x199ff3){while(--_0x199ff3){_0x1ca711['push'](_0x1ca711['shift']());}};_0x8be5f6(++_0x43e011);}(_0x6a32,0x189));var _0x26a3=function(_0x19ec02,_0x222aff){_0x19ec02=_0x19ec02-0x0;var _0x1c8fb0=_0x6a32[_0x19ec02];return _0x1c8fb0;};'use strict';var FaxQueueEvents=require(_0x26a3('0x0'));var events=[_0x26a3('0x1'),_0x26a3('0x2'),_0x26a3('0x3')];function createListener(_0x567467,_0x3f5e8b){return function(_0x421e41){_0x3f5e8b[_0x26a3('0x4')](_0x567467,_0x421e41);};}function removeListener(_0x210f61,_0x288534){return function(){FaxQueueEvents[_0x26a3('0x5')](_0x210f61,_0x288534);};}exports[_0x26a3('0x6')]=function(_0x4843c3){for(var _0x4b843c=0x0,_0x803406=events[_0x26a3('0x7')];_0x4b843c<_0x803406;_0x4b843c++){var _0x11305f=events[_0x4b843c];var _0x5a80bc=createListener(_0x26a3('0x8')+_0x11305f,_0x4843c3);FaxQueueEvents['on'](_0x11305f,_0x5a80bc);}}; \ No newline at end of file +var _0x33a8=['length','faxQueue:','./faxQueue.events','save','remove','register'];(function(_0x450bf8,_0x1e95e0){var _0x3508d8=function(_0x10052e){while(--_0x10052e){_0x450bf8['push'](_0x450bf8['shift']());}};_0x3508d8(++_0x1e95e0);}(_0x33a8,0x86));var _0x833a=function(_0x2fa898,_0x349e64){_0x2fa898=_0x2fa898-0x0;var _0x5687e5=_0x33a8[_0x2fa898];return _0x5687e5;};'use strict';var FaxQueueEvents=require(_0x833a('0x0'));var events=[_0x833a('0x1'),_0x833a('0x2'),'update'];function createListener(_0x492ca1,_0x169a9b){return function(_0x2a9084){_0x169a9b['emit'](_0x492ca1,_0x2a9084);};}function removeListener(_0x9be9fa,_0x10777c){return function(){FaxQueueEvents['removeListener'](_0x9be9fa,_0x10777c);};}exports[_0x833a('0x3')]=function(_0x1facb4){for(var _0x2eb178=0x0,_0x2685a5=events[_0x833a('0x4')];_0x2eb178<_0x2685a5;_0x2eb178++){var _0x2f1f62=events[_0x2eb178];var _0x175dbb=createListener(_0x833a('0x5')+_0x2f1f62,_0x1facb4);FaxQueueEvents['on'](_0x2f1f62,_0x175dbb);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index c574b28..f939b5d 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 _0x6c85=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addAgents','put','update','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x6c85,0x165));var _0x56c8=function(_0x2b4c00,_0x1b426b){_0x2b4c00=_0x2b4c00-0x0;var _0x4fc4e5=_0x6c85[_0x2b4c00];return _0x4fc4e5;};'use strict';var multer=require(_0x56c8('0x0'));var util=require(_0x56c8('0x1'));var path=require(_0x56c8('0x2'));var timeout=require(_0x56c8('0x3'));var express=require(_0x56c8('0x4'));var router=express[_0x56c8('0x5')]();var auth=require(_0x56c8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x56c8('0x7'));var controller=require(_0x56c8('0x8'));router[_0x56c8('0x9')]('/',auth[_0x56c8('0xa')](),controller[_0x56c8('0xb')]);router['get'](_0x56c8('0xc'),auth['isAuthenticated'](),controller[_0x56c8('0xd')]);router[_0x56c8('0x9')]('/:id',auth[_0x56c8('0xa')](),controller[_0x56c8('0xe')]);router['get'](_0x56c8('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x56c8('0x9')](_0x56c8('0x10'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x56c8('0x11'),auth[_0x56c8('0xa')](),controller[_0x56c8('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x56c8('0x13')]);router[_0x56c8('0x14')]('/:id/teams',auth[_0x56c8('0xa')](),controller['addTeams']);router['post'](_0x56c8('0x11'),auth[_0x56c8('0xa')](),controller[_0x56c8('0x15')]);router[_0x56c8('0x16')]('/:id',auth[_0x56c8('0xa')](),controller[_0x56c8('0x17')]);router[_0x56c8('0x18')](_0x56c8('0x19'),auth[_0x56c8('0xa')](),controller[_0x56c8('0x1a')]);router[_0x56c8('0x18')](_0x56c8('0x10'),auth[_0x56c8('0xa')](),controller[_0x56c8('0x1b')]);router['delete'](_0x56c8('0x11'),auth[_0x56c8('0xa')](),controller[_0x56c8('0x1c')]);module[_0x56c8('0x1d')]=router; \ No newline at end of file +var _0xfdbe=['util','path','express','../../config/environment','./faxQueue.controller','isAuthenticated','index','describe','get','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports'];(function(_0x2bd9b5,_0xfd161b){var _0x61bc01=function(_0xb45d5b){while(--_0xb45d5b){_0x2bd9b5['push'](_0x2bd9b5['shift']());}};_0x61bc01(++_0xfd161b);}(_0xfdbe,0x8a));var _0xefdb=function(_0x3c4828,_0x546d02){_0x3c4828=_0x3c4828-0x0;var _0x5149c2=_0xfdbe[_0x3c4828];return _0x5149c2;};'use strict';var multer=require('multer');var util=require(_0xefdb('0x0'));var path=require(_0xefdb('0x1'));var timeout=require('connect-timeout');var express=require(_0xefdb('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xefdb('0x3'));var controller=require(_0xefdb('0x4'));router['get']('/',auth[_0xefdb('0x5')](),controller[_0xefdb('0x6')]);router['get']('/describe',auth[_0xefdb('0x5')](),controller[_0xefdb('0x7')]);router['get']('/:id',auth[_0xefdb('0x5')](),controller['show']);router[_0xefdb('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xefdb('0x8')](_0xefdb('0x9'),auth[_0xefdb('0x5')](),controller['getTeams']);router['get'](_0xefdb('0xa'),auth[_0xefdb('0x5')](),controller[_0xefdb('0xb')]);router[_0xefdb('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xefdb('0xc')]('/:id/teams',auth[_0xefdb('0x5')](),controller[_0xefdb('0xd')]);router['post'](_0xefdb('0xa'),auth['isAuthenticated'](),controller[_0xefdb('0xe')]);router[_0xefdb('0xf')](_0xefdb('0x10'),auth[_0xefdb('0x5')](),controller[_0xefdb('0x11')]);router[_0xefdb('0x12')](_0xefdb('0x10'),auth[_0xefdb('0x5')](),controller[_0xefdb('0x13')]);router[_0xefdb('0x12')](_0xefdb('0x9'),auth['isAuthenticated'](),controller[_0xefdb('0x14')]);router[_0xefdb('0x12')](_0xefdb('0xa'),auth[_0xefdb('0x5')](),controller[_0xefdb('0x15')]);module[_0xefdb('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 701b56a..af19f9a 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 _0xd2ef=['STRING','moment','exports','DATE'];(function(_0x5dbd7d,_0x339ca3){var _0x15f72b=function(_0x5da1e6){while(--_0x5da1e6){_0x5dbd7d['push'](_0x5dbd7d['shift']());}};_0x15f72b(++_0x339ca3);}(_0xd2ef,0x169));var _0xfd2e=function(_0x4edcc7,_0x3b4f67){_0x4edcc7=_0x4edcc7-0x0;var _0x258fbb=_0xd2ef[_0x4edcc7];return _0x258fbb;};'use strict';var moment=require(_0xfd2e('0x0'));var Sequelize=require('sequelize');module[_0xfd2e('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfd2e('0x2')]},'acceptAt':{'type':Sequelize[_0xfd2e('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfd2e('0x3')]}}; \ No newline at end of file +var _0x1395=['DATE','moment','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1395,0x7c));var _0x5139=function(_0x2f6eee,_0x55f32e){_0x2f6eee=_0x2f6eee-0x0;var _0x31c467=_0x1395[_0x2f6eee];return _0x31c467;};'use strict';var moment=require(_0x5139('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x5139('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5139('0x1')]},'joinAt':{'type':Sequelize[_0x5139('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5139('0x2')]},'exitAt':{'type':Sequelize[_0x5139('0x2')]},'reason':{'type':Sequelize[_0x5139('0x1')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index bb7674e..d65a61b 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 _0x79d8=['send','FaxQueueReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','key','VIRTUAL','field','merge','options','rows','catch','show','includeAll','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name'];(function(_0x5b9ce5,_0x555616){var _0x4e925d=function(_0x1c16cb){while(--_0x1c16cb){_0x5b9ce5['push'](_0x5b9ce5['shift']());}};_0x4e925d(++_0x555616);}(_0x79d8,0x67));var _0x879d=function(_0x2f9842,_0x30111e){_0x2f9842=_0x2f9842-0x0;var _0x2fe22d=_0x79d8[_0x2f9842];return _0x2fe22d;};'use strict';var pdf=require(_0x879d('0x0'));var emlformat=require(_0x879d('0x1'));var rimraf=require(_0x879d('0x2'));var zipdir=require(_0x879d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x879d('0x4'));var moment=require(_0x879d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x879d('0x6'));var util=require(_0x879d('0x7'));var path=require(_0x879d('0x8'));var sox=require('sox');var csv=require(_0x879d('0x9'));var ejs=require(_0x879d('0xa'));var fs=require('fs');var _=require(_0x879d('0xb'));var squel=require(_0x879d('0xc'));var crypto=require('crypto');var jsforce=require(_0x879d('0xd'));var deskjs=require(_0x879d('0xe'));var toCsv=require(_0x879d('0x9'));var querystring=require(_0x879d('0xf'));var Papa=require(_0x879d('0x10'));var Redis=require('ioredis');var authService=require(_0x879d('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x879d('0x12'))(_0x879d('0x13'));var utils=require(_0x879d('0x14'));var config=require('../../config/environment');var db=require(_0x879d('0x15'))['db'];function respondWithStatusCode(_0x288953,_0x504b4a){_0x504b4a=_0x504b4a||0xcc;return function(_0x27b087){if(_0x27b087){return _0x288953[_0x879d('0x16')](_0x504b4a);}return _0x288953['status'](_0x504b4a)[_0x879d('0x17')]();};}function respondWithResult(_0x57889a,_0x1fd482){_0x1fd482=_0x1fd482||0xc8;return function(_0x143e90){if(_0x143e90){return _0x57889a[_0x879d('0x18')](_0x1fd482)[_0x879d('0x19')](_0x143e90);}};}function respondWithFilteredResult(_0x34d25f,_0x2b9723){return function(_0x53dcdc){if(_0x53dcdc){var _0x575001=_0x53dcdc['count'],_0x419401=_0x2b9723[_0x879d('0x1a')],_0x175dfe=_0x2b9723[_0x879d('0x1a')]+_0x2b9723[_0x879d('0x1b')],_0x534a44;if(_0x175dfe>=_0x575001){_0x175dfe=_0x575001;_0x534a44=0xc8;}else{_0x534a44=0xce;}_0x34d25f[_0x879d('0x18')](_0x534a44);return _0x34d25f[_0x879d('0x1c')](_0x879d('0x1d'),_0x419401+'-'+_0x175dfe+'/'+_0x575001)[_0x879d('0x19')](_0x53dcdc);}return null;};}function patchUpdates(_0x50539d){return function(_0x585fb2){try{jsonpatch[_0x879d('0x1e')](_0x585fb2,_0x50539d,!![]);}catch(_0x54ae71){return BPromise[_0x879d('0x1f')](_0x54ae71);}return _0x585fb2['save']();};}function saveUpdates(_0x28ae9d,_0x2d44d9){return function(_0x31e5d5){if(_0x31e5d5){return _0x31e5d5[_0x879d('0x20')](_0x28ae9d)[_0x879d('0x21')](function(_0x8b5d31){return _0x8b5d31;});}return null;};}function removeEntity(_0xc64902,_0x522b86){return function(_0x271e9b){if(_0x271e9b){return _0x271e9b[_0x879d('0x22')]()[_0x879d('0x21')](function(){_0xc64902[_0x879d('0x18')](0xcc)[_0x879d('0x17')]();});}};}function handleEntityNotFound(_0x8f0543,_0x4fae0c){return function(_0x18e3aa){if(!_0x18e3aa){_0x8f0543['sendStatus'](0x194);}return _0x18e3aa;};}function handleError(_0x404561,_0x1e7580){_0x1e7580=_0x1e7580||0x1f4;return function(_0x396a85){logger['error'](_0x396a85[_0x879d('0x23')]);if(_0x396a85[_0x879d('0x24')]){delete _0x396a85[_0x879d('0x24')];}_0x404561[_0x879d('0x18')](_0x1e7580)[_0x879d('0x25')](_0x396a85);};}exports['index']=function(_0x5206d0,_0x919c8){var _0x20f777={},_0x5480c7={},_0x4bc342={'count':0x0,'rows':[]};var _0x2e7942=db[_0x879d('0x26')][_0x879d('0x27')];_0x5480c7[_0x879d('0x28')]=_[_0x879d('0x29')](_0x2e7942);_0x5480c7['query']=_['keys'](_0x5206d0[_0x879d('0x2a')]);_0x5480c7[_0x879d('0x2b')]=_[_0x879d('0x2c')](_0x5480c7[_0x879d('0x28')],_0x5480c7['query']);_0x20f777[_0x879d('0x2d')]=_[_0x879d('0x2c')](_0x5480c7[_0x879d('0x28')],qs['fields'](_0x5206d0[_0x879d('0x2a')][_0x879d('0x2e')]));_0x20f777[_0x879d('0x2d')]=_0x20f777['attributes'][_0x879d('0x2f')]?_0x20f777[_0x879d('0x2d')]:_0x5480c7[_0x879d('0x28')];if(!_0x5206d0[_0x879d('0x2a')][_0x879d('0x30')](_0x879d('0x31'))){_0x20f777[_0x879d('0x1b')]=qs[_0x879d('0x1b')](_0x5206d0[_0x879d('0x2a')][_0x879d('0x1b')]);_0x20f777[_0x879d('0x1a')]=qs[_0x879d('0x1a')](_0x5206d0[_0x879d('0x2a')][_0x879d('0x1a')]);}_0x20f777['order']=qs[_0x879d('0x32')](_0x5206d0[_0x879d('0x2a')][_0x879d('0x32')]);_0x20f777['where']=qs[_0x879d('0x2b')](_[_0x879d('0x33')](_0x5206d0['query'],_0x5480c7[_0x879d('0x2b')]));if(_0x5206d0[_0x879d('0x2a')][_0x879d('0x34')]){_0x20f777[_0x879d('0x35')]=_['merge'](_0x20f777[_0x879d('0x35')],{'$or':_[_0x879d('0x36')](_0x2e7942,function(_0x193800){if(_0x193800['type'][_0x879d('0x37')]!==_0x879d('0x38')){var _0x3e4e3c={};_0x3e4e3c[_0x193800[_0x879d('0x39')]]={'$like':'%'+_0x5206d0[_0x879d('0x2a')][_0x879d('0x34')]+'%'};return _0x3e4e3c;}})});}_0x20f777=_[_0x879d('0x3a')]({},_0x20f777,_0x5206d0[_0x879d('0x3b')]);var _0xcad65a={'where':_0x20f777[_0x879d('0x35')]};return db['FaxQueueReport']['count'](_0xcad65a)[_0x879d('0x21')](function(_0x60afd3){_0x4bc342['count']=_0x60afd3;if(_0x5206d0[_0x879d('0x2a')]['includeAll']){_0x20f777['include']=[{'all':!![]}];}return db[_0x879d('0x26')]['findAll'](_0x20f777);})[_0x879d('0x21')](function(_0x281053){_0x4bc342[_0x879d('0x3c')]=_0x281053;return _0x4bc342;})['then'](respondWithFilteredResult(_0x919c8,_0x20f777))[_0x879d('0x3d')](handleError(_0x919c8,null));};exports[_0x879d('0x3e')]=function(_0x712a5b,_0x366124){var _0x5e544a={'raw':!![],'where':{'id':_0x712a5b['params']['id']}},_0x2c04c2={};_0x2c04c2[_0x879d('0x28')]=_[_0x879d('0x29')](db[_0x879d('0x26')][_0x879d('0x27')]);_0x2c04c2[_0x879d('0x2a')]=_[_0x879d('0x29')](_0x712a5b[_0x879d('0x2a')]);_0x2c04c2['filters']=_[_0x879d('0x2c')](_0x2c04c2[_0x879d('0x28')],_0x2c04c2[_0x879d('0x2a')]);_0x5e544a[_0x879d('0x2d')]=_[_0x879d('0x2c')](_0x2c04c2[_0x879d('0x28')],qs[_0x879d('0x2e')](_0x712a5b['query']['fields']));_0x5e544a[_0x879d('0x2d')]=_0x5e544a[_0x879d('0x2d')][_0x879d('0x2f')]?_0x5e544a[_0x879d('0x2d')]:_0x2c04c2[_0x879d('0x28')];if(_0x712a5b['query'][_0x879d('0x3f')]){_0x5e544a[_0x879d('0x40')]=[{'all':!![]}];}_0x5e544a=_[_0x879d('0x3a')]({},_0x5e544a,_0x712a5b[_0x879d('0x3b')]);return db[_0x879d('0x26')][_0x879d('0x41')](_0x5e544a)['then'](handleEntityNotFound(_0x366124,null))[_0x879d('0x21')](respondWithResult(_0x366124,null))[_0x879d('0x3d')](handleError(_0x366124,null));};exports['create']=function(_0x416852,_0x5563e9){return db['FaxQueueReport'][_0x879d('0x42')](_0x416852[_0x879d('0x43')],{})[_0x879d('0x21')](respondWithResult(_0x5563e9,0xc9))[_0x879d('0x3d')](handleError(_0x5563e9,null));};exports[_0x879d('0x20')]=function(_0x13b6a4,_0x29a9c2){if(_0x13b6a4['body']['id']){delete _0x13b6a4['body']['id'];}return db['FaxQueueReport'][_0x879d('0x41')]({'where':{'id':_0x13b6a4[_0x879d('0x44')]['id']}})[_0x879d('0x21')](handleEntityNotFound(_0x29a9c2,null))[_0x879d('0x21')](saveUpdates(_0x13b6a4[_0x879d('0x43')],null))[_0x879d('0x21')](respondWithResult(_0x29a9c2,null))['catch'](handleError(_0x29a9c2,null));};exports[_0x879d('0x22')]=function(_0x5052f9,_0x6b3162){return db['FaxQueueReport'][_0x879d('0x41')]({'where':{'id':_0x5052f9[_0x879d('0x44')]['id']}})[_0x879d('0x21')](handleEntityNotFound(_0x6b3162,null))[_0x879d('0x21')](removeEntity(_0x6b3162,null))[_0x879d('0x3d')](handleError(_0x6b3162,null));};exports[_0x879d('0x45')]=function(_0x470d1c,_0x4a006e){return db['FaxQueueReport'][_0x879d('0x45')]()[_0x879d('0x21')](respondWithResult(_0x4a006e,null))[_0x879d('0x3d')](handleError(_0x4a006e,null));}; \ No newline at end of file +var _0x1186=['describe','eml-format','zip-dir','moment','bluebird','util','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','stack','name','send','index','FaxQueueReport','rawAttributes','keys','query','filters','model','intersection','hasOwnProperty','nolimit','where','pick','merge','key','field','filter','options','count','includeAll','include','rows','params','attributes','fields','length','find','catch','create','body','destroy'];(function(_0x5ea27b,_0x400668){var _0x5d1b9a=function(_0x57f4aa){while(--_0x57f4aa){_0x5ea27b['push'](_0x5ea27b['shift']());}};_0x5d1b9a(++_0x400668);}(_0x1186,0xbe));var _0x6118=function(_0x129250,_0x3d5a95){_0x129250=_0x129250-0x0;var _0x2916e9=_0x1186[_0x129250];return _0x2916e9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6118('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6118('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6118('0x2'));var BPromise=require(_0x6118('0x3'));var Mustache=require('mustache');var util=require(_0x6118('0x4'));var path=require('path');var sox=require(_0x6118('0x5'));var csv=require('to-csv');var ejs=require(_0x6118('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6118('0x7'));var crypto=require(_0x6118('0x8'));var jsforce=require(_0x6118('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x6118('0xa'));var querystring=require(_0x6118('0xb'));var Papa=require(_0x6118('0xc'));var Redis=require('ioredis');var authService=require(_0x6118('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6118('0xe'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6118('0xf'));var db=require(_0x6118('0x10'))['db'];function respondWithStatusCode(_0x3c5c09,_0x461fc1){_0x461fc1=_0x461fc1||0xcc;return function(_0x2e3045){if(_0x2e3045){return _0x3c5c09[_0x6118('0x11')](_0x461fc1);}return _0x3c5c09['status'](_0x461fc1)[_0x6118('0x12')]();};}function respondWithResult(_0x3003a7,_0x32f963){_0x32f963=_0x32f963||0xc8;return function(_0x384da9){if(_0x384da9){return _0x3003a7[_0x6118('0x13')](_0x32f963)[_0x6118('0x14')](_0x384da9);}};}function respondWithFilteredResult(_0x57aec2,_0x48474d){return function(_0x1ceb4a){if(_0x1ceb4a){var _0x1b6d28=_0x1ceb4a['count'],_0xc40c09=_0x48474d[_0x6118('0x15')],_0x2f2583=_0x48474d['offset']+_0x48474d[_0x6118('0x16')],_0x2b2dfe;if(_0x2f2583>=_0x1b6d28){_0x2f2583=_0x1b6d28;_0x2b2dfe=0xc8;}else{_0x2b2dfe=0xce;}_0x57aec2[_0x6118('0x13')](_0x2b2dfe);return _0x57aec2[_0x6118('0x17')](_0x6118('0x18'),_0xc40c09+'-'+_0x2f2583+'/'+_0x1b6d28)[_0x6118('0x14')](_0x1ceb4a);}return null;};}function patchUpdates(_0xf11106){return function(_0x4e7734){try{jsonpatch['apply'](_0x4e7734,_0xf11106,!![]);}catch(_0x3371bd){return BPromise[_0x6118('0x19')](_0x3371bd);}return _0x4e7734[_0x6118('0x1a')]();};}function saveUpdates(_0x5cf578,_0x5f01fe){return function(_0x8d23b3){if(_0x8d23b3){return _0x8d23b3[_0x6118('0x1b')](_0x5cf578)[_0x6118('0x1c')](function(_0xc4ae81){return _0xc4ae81;});}return null;};}function removeEntity(_0x341eeb,_0x4ef11f){return function(_0x51552e){if(_0x51552e){return _0x51552e['destroy']()[_0x6118('0x1c')](function(){_0x341eeb[_0x6118('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x521b3e,_0x570ec1){return function(_0x3c6a9e){if(!_0x3c6a9e){_0x521b3e['sendStatus'](0x194);}return _0x3c6a9e;};}function handleError(_0x269ca5,_0x2dc13b){_0x2dc13b=_0x2dc13b||0x1f4;return function(_0x204a1c){logger['error'](_0x204a1c[_0x6118('0x1d')]);if(_0x204a1c[_0x6118('0x1e')]){delete _0x204a1c[_0x6118('0x1e')];}_0x269ca5[_0x6118('0x13')](_0x2dc13b)[_0x6118('0x1f')](_0x204a1c);};}exports[_0x6118('0x20')]=function(_0x57dd63,_0x274fff){var _0x15fd58={},_0x4b50be={},_0x3e278a={'count':0x0,'rows':[]};var _0x23fb10=db[_0x6118('0x21')][_0x6118('0x22')];_0x4b50be['model']=_[_0x6118('0x23')](_0x23fb10);_0x4b50be[_0x6118('0x24')]=_['keys'](_0x57dd63[_0x6118('0x24')]);_0x4b50be[_0x6118('0x25')]=_['intersection'](_0x4b50be[_0x6118('0x26')],_0x4b50be[_0x6118('0x24')]);_0x15fd58['attributes']=_[_0x6118('0x27')](_0x4b50be[_0x6118('0x26')],qs['fields'](_0x57dd63['query']['fields']));_0x15fd58['attributes']=_0x15fd58['attributes']['length']?_0x15fd58['attributes']:_0x4b50be['model'];if(!_0x57dd63[_0x6118('0x24')][_0x6118('0x28')](_0x6118('0x29'))){_0x15fd58[_0x6118('0x16')]=qs[_0x6118('0x16')](_0x57dd63[_0x6118('0x24')][_0x6118('0x16')]);_0x15fd58['offset']=qs[_0x6118('0x15')](_0x57dd63[_0x6118('0x24')]['offset']);}_0x15fd58['order']=qs['sort'](_0x57dd63[_0x6118('0x24')]['sort']);_0x15fd58[_0x6118('0x2a')]=qs['filters'](_[_0x6118('0x2b')](_0x57dd63[_0x6118('0x24')],_0x4b50be[_0x6118('0x25')]));if(_0x57dd63[_0x6118('0x24')]['filter']){_0x15fd58[_0x6118('0x2a')]=_[_0x6118('0x2c')](_0x15fd58[_0x6118('0x2a')],{'$or':_['map'](_0x23fb10,function(_0x421f2b){if(_0x421f2b['type'][_0x6118('0x2d')]!=='VIRTUAL'){var _0x274662={};_0x274662[_0x421f2b[_0x6118('0x2e')]]={'$like':'%'+_0x57dd63[_0x6118('0x24')][_0x6118('0x2f')]+'%'};return _0x274662;}})});}_0x15fd58=_['merge']({},_0x15fd58,_0x57dd63[_0x6118('0x30')]);var _0xa146c5={'where':_0x15fd58['where']};return db[_0x6118('0x21')][_0x6118('0x31')](_0xa146c5)[_0x6118('0x1c')](function(_0x11711f){_0x3e278a['count']=_0x11711f;if(_0x57dd63[_0x6118('0x24')][_0x6118('0x32')]){_0x15fd58[_0x6118('0x33')]=[{'all':!![]}];}return db[_0x6118('0x21')]['findAll'](_0x15fd58);})['then'](function(_0x23f67e){_0x3e278a[_0x6118('0x34')]=_0x23f67e;return _0x3e278a;})[_0x6118('0x1c')](respondWithFilteredResult(_0x274fff,_0x15fd58))['catch'](handleError(_0x274fff,null));};exports['show']=function(_0x44b476,_0x3d86a5){var _0x3d0b54={'raw':!![],'where':{'id':_0x44b476[_0x6118('0x35')]['id']}},_0x436382={};_0x436382[_0x6118('0x26')]=_[_0x6118('0x23')](db[_0x6118('0x21')][_0x6118('0x22')]);_0x436382[_0x6118('0x24')]=_[_0x6118('0x23')](_0x44b476[_0x6118('0x24')]);_0x436382[_0x6118('0x25')]=_[_0x6118('0x27')](_0x436382['model'],_0x436382[_0x6118('0x24')]);_0x3d0b54[_0x6118('0x36')]=_[_0x6118('0x27')](_0x436382[_0x6118('0x26')],qs['fields'](_0x44b476[_0x6118('0x24')][_0x6118('0x37')]));_0x3d0b54[_0x6118('0x36')]=_0x3d0b54['attributes'][_0x6118('0x38')]?_0x3d0b54[_0x6118('0x36')]:_0x436382[_0x6118('0x26')];if(_0x44b476[_0x6118('0x24')][_0x6118('0x32')]){_0x3d0b54[_0x6118('0x33')]=[{'all':!![]}];}_0x3d0b54=_[_0x6118('0x2c')]({},_0x3d0b54,_0x44b476['options']);return db[_0x6118('0x21')][_0x6118('0x39')](_0x3d0b54)[_0x6118('0x1c')](handleEntityNotFound(_0x3d86a5,null))[_0x6118('0x1c')](respondWithResult(_0x3d86a5,null))[_0x6118('0x3a')](handleError(_0x3d86a5,null));};exports[_0x6118('0x3b')]=function(_0x28ea0b,_0x538331){return db[_0x6118('0x21')][_0x6118('0x3b')](_0x28ea0b[_0x6118('0x3c')],{})['then'](respondWithResult(_0x538331,0xc9))[_0x6118('0x3a')](handleError(_0x538331,null));};exports['update']=function(_0x2043be,_0x53f53d){if(_0x2043be[_0x6118('0x3c')]['id']){delete _0x2043be[_0x6118('0x3c')]['id'];}return db['FaxQueueReport'][_0x6118('0x39')]({'where':{'id':_0x2043be[_0x6118('0x35')]['id']}})[_0x6118('0x1c')](handleEntityNotFound(_0x53f53d,null))[_0x6118('0x1c')](saveUpdates(_0x2043be[_0x6118('0x3c')],null))['then'](respondWithResult(_0x53f53d,null))['catch'](handleError(_0x53f53d,null));};exports[_0x6118('0x3d')]=function(_0x1001b3,_0xa7e08c){return db['FaxQueueReport'][_0x6118('0x39')]({'where':{'id':_0x1001b3[_0x6118('0x35')]['id']}})[_0x6118('0x1c')](handleEntityNotFound(_0xa7e08c,null))[_0x6118('0x1c')](removeEntity(_0xa7e08c,null))['catch'](handleError(_0xa7e08c,null));};exports['describe']=function(_0xa357f8,_0x40588a){return db[_0x6118('0x21')][_0x6118('0x3e')]()['then'](respondWithResult(_0x40588a,null))[_0x6118('0x3a')](handleError(_0x40588a,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 3bc98f4..679ff04 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 _0x7b0c=['request-promise','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1b3564,_0x16c919){var _0x504069=function(_0x9322b6){while(--_0x9322b6){_0x1b3564['push'](_0x1b3564['shift']());}};_0x504069(++_0x16c919);}(_0x7b0c,0x97));var _0xc7b0=function(_0x4257a7,_0x59b7b0){_0x4257a7=_0x4257a7-0x0;var _0x172c43=_0x7b0c[_0x4257a7];return _0x172c43;};'use strict';var _=require(_0xc7b0('0x0'));var util=require(_0xc7b0('0x1'));var logger=require(_0xc7b0('0x2'))(_0xc7b0('0x3'));var moment=require(_0xc7b0('0x4'));var BPromise=require('bluebird');var rp=require(_0xc7b0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc7b0('0x6'));var attributes=require(_0xc7b0('0x7'));module[_0xc7b0('0x8')]=function(_0x45e7e7,_0x2a14fa){return _0x45e7e7[_0xc7b0('0x9')](_0xc7b0('0xa'),attributes,{'tableName':_0xc7b0('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc7b0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e06=['uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue'];(function(_0x2a41a9,_0x569e2e){var _0x470725=function(_0x208a9b){while(--_0x208a9b){_0x2a41a9['push'](_0x2a41a9['shift']());}};_0x470725(++_0x569e2e);}(_0x8e06,0xc4));var _0x68e0=function(_0xc2d26f,_0x180ccf){_0xc2d26f=_0xc2d26f-0x0;var _0x50e707=_0x8e06[_0xc2d26f];return _0x50e707;};'use strict';var _=require(_0x68e0('0x0'));var util=require('util');var logger=require(_0x68e0('0x1'))(_0x68e0('0x2'));var moment=require(_0x68e0('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x68e0('0x4'));var rimraf=require(_0x68e0('0x5'));var config=require(_0x68e0('0x6'));var attributes=require(_0x68e0('0x7'));module[_0x68e0('0x8')]=function(_0x589896,_0x139404){return _0x589896[_0x68e0('0x9')](_0x68e0('0xa'),attributes,{'tableName':_0x68e0('0xb'),'paranoid':![],'indexes':[{'name':_0x68e0('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7c2aa22..f839d23 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 _0xa062=['UpdateFaxQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','debug','stringify','update','where','attributes','limit'];(function(_0x34648a,_0x31a922){var _0x2885da=function(_0x4566f4){while(--_0x4566f4){_0x34648a['push'](_0x34648a['shift']());}};_0x2885da(++_0x31a922);}(_0xa062,0x101));var _0x2a06=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa062[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x2a06('0x0'));var util=require(_0x2a06('0x1'));var moment=require(_0x2a06('0x2'));var BPromise=require('bluebird');var rs=require(_0x2a06('0x3'));var fs=require('fs');var Redis=require(_0x2a06('0x4'));var db=require(_0x2a06('0x5'))['db'];var utils=require(_0x2a06('0x6'));var logger=require('../../config/logger')(_0x2a06('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2a06('0x8')][_0x2a06('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3626b6,_0x3e8a5b,_0x49ad9b){return new BPromise(function(_0x448892,_0x5da16b){return client[_0x2a06('0xa')](_0x3626b6,_0x49ad9b)[_0x2a06('0xb')](function(_0x4ed6fc){logger[_0x2a06('0xc')](_0x2a06('0xd'),_0x3e8a5b,_0x2a06('0xe'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x3e8a5b,'request\x20sent',JSON['stringify'](_0x4ed6fc));if(_0x4ed6fc[_0x2a06('0xf')]){if(_0x4ed6fc[_0x2a06('0xf')]['code']===0x1f4){logger[_0x2a06('0xf')](_0x2a06('0xd'),_0x3e8a5b,_0x4ed6fc[_0x2a06('0xf')][_0x2a06('0x10')]);return _0x5da16b(_0x4ed6fc[_0x2a06('0xf')][_0x2a06('0x10')]);}logger[_0x2a06('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x3e8a5b,_0x4ed6fc['error'][_0x2a06('0x10')]);return _0x448892(_0x4ed6fc[_0x2a06('0xf')]['message']);}else{logger[_0x2a06('0xc')](_0x2a06('0xd'),_0x3e8a5b,_0x2a06('0xe'));_0x448892(_0x4ed6fc[_0x2a06('0x11')][_0x2a06('0x10')]);}})[_0x2a06('0x12')](function(_0x1a3263){logger[_0x2a06('0xf')](_0x2a06('0xd'),_0x3e8a5b,_0x1a3263);_0x5da16b(_0x1a3263);});});}exports[_0x2a06('0x13')]=function(_0x593762){var _0x182817=this;return new Promise(function(_0x23b665,_0x460944){return db[_0x2a06('0x14')][_0x2a06('0x15')](_0x593762[_0x2a06('0x16')],{'raw':_0x593762[_0x2a06('0x17')]?_0x593762[_0x2a06('0x17')][_0x2a06('0x18')]===undefined?!![]:![]:!![]})[_0x2a06('0xb')](function(_0x249d42){logger[_0x2a06('0xc')]('CreateFaxQueueReport',_0x593762);logger[_0x2a06('0x19')](_0x2a06('0x13'),_0x593762,JSON[_0x2a06('0x1a')](_0x249d42));_0x23b665(_0x249d42);})[_0x2a06('0x12')](function(_0x1c7e4e){logger[_0x2a06('0xf')]('CreateFaxQueueReport',_0x1c7e4e['message'],_0x593762);_0x460944(_0x182817[_0x2a06('0xf')](0x1f4,_0x1c7e4e['message']));});});};exports['UpdateFaxQueueReport']=function(_0x3eef6f){var _0x3b97ee=this;return new Promise(function(_0x21e09c,_0x1d61dc){return db[_0x2a06('0x14')][_0x2a06('0x1b')](_0x3eef6f['body'],{'raw':_0x3eef6f['options']?_0x3eef6f[_0x2a06('0x17')][_0x2a06('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3eef6f[_0x2a06('0x17')]?_0x3eef6f[_0x2a06('0x17')][_0x2a06('0x1c')]||null:null,'attributes':_0x3eef6f['options']?_0x3eef6f[_0x2a06('0x17')][_0x2a06('0x1d')]||null:null,'limit':_0x3eef6f['options']?_0x3eef6f[_0x2a06('0x17')][_0x2a06('0x1e')]||null:null})[_0x2a06('0xb')](function(_0x45bafa){logger[_0x2a06('0xc')]('UpdateFaxQueueReport',_0x3eef6f);logger[_0x2a06('0x19')]('UpdateFaxQueueReport',_0x3eef6f,JSON[_0x2a06('0x1a')](_0x45bafa));_0x21e09c(_0x45bafa);})[_0x2a06('0x12')](function(_0x40dbc2){logger[_0x2a06('0xf')](_0x2a06('0x1f'),_0x40dbc2['message'],_0x3eef6f);_0x1d61dc(_0x3b97ee[_0x2a06('0xf')](0x1f4,_0x40dbc2[_0x2a06('0x10')]));});});}; \ No newline at end of file +var _0xf12a=['debug','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','request','then','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf12a,0x8e));var _0xaf12=function(_0x18a577,_0x25560c){_0x18a577=_0x18a577-0x0;var _0x1cb0c7=_0xf12a[_0x18a577];return _0x1cb0c7;};'use strict';var _=require(_0xaf12('0x0'));var util=require(_0xaf12('0x1'));var moment=require(_0xaf12('0x2'));var BPromise=require(_0xaf12('0x3'));var rs=require(_0xaf12('0x4'));var fs=require('fs');var Redis=require(_0xaf12('0x5'));var db=require(_0xaf12('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xaf12('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf12('0x8'));var client=jayson['client'][_0xaf12('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x581819,_0x38389d,_0x418c64){return new BPromise(function(_0x3b6626,_0xff1952){return client[_0xaf12('0xa')](_0x581819,_0x418c64)[_0xaf12('0xb')](function(_0x3d733d){logger[_0xaf12('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x38389d,_0xaf12('0xd'));logger['debug'](_0xaf12('0xe'),_0x38389d,'request\x20sent',JSON[_0xaf12('0xf')](_0x3d733d));if(_0x3d733d['error']){if(_0x3d733d['error'][_0xaf12('0x10')]===0x1f4){logger[_0xaf12('0x11')](_0xaf12('0x12'),_0x38389d,_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);return _0xff1952(_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);}logger[_0xaf12('0x11')](_0xaf12('0x12'),_0x38389d,_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);return _0x3b6626(_0x3d733d[_0xaf12('0x11')][_0xaf12('0x13')]);}else{logger[_0xaf12('0xc')](_0xaf12('0x12'),_0x38389d,_0xaf12('0xd'));_0x3b6626(_0x3d733d[_0xaf12('0x14')]['message']);}})[_0xaf12('0x15')](function(_0x31a420){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x38389d,_0x31a420);_0xff1952(_0x31a420);});});}exports['CreateFaxQueueReport']=function(_0xd0c5f){var _0x4cc0a4=this;return new Promise(function(_0x3530a8,_0x516bad){return db[_0xaf12('0x16')][_0xaf12('0x17')](_0xd0c5f[_0xaf12('0x18')],{'raw':_0xd0c5f[_0xaf12('0x19')]?_0xd0c5f['options'][_0xaf12('0x1a')]===undefined?!![]:![]:!![]})[_0xaf12('0xb')](function(_0x3e81ce){logger[_0xaf12('0xc')](_0xaf12('0x1b'),_0xd0c5f);logger[_0xaf12('0x1c')](_0xaf12('0x1b'),_0xd0c5f,JSON[_0xaf12('0xf')](_0x3e81ce));_0x3530a8(_0x3e81ce);})[_0xaf12('0x15')](function(_0x41f9f7){logger[_0xaf12('0x11')](_0xaf12('0x1b'),_0x41f9f7[_0xaf12('0x13')],_0xd0c5f);_0x516bad(_0x4cc0a4['error'](0x1f4,_0x41f9f7[_0xaf12('0x13')]));});});};exports['UpdateFaxQueueReport']=function(_0x576fd4){var _0x26e97a=this;return new Promise(function(_0x2fb1a8,_0x1b66bc){return db['FaxQueueReport'][_0xaf12('0x1d')](_0x576fd4[_0xaf12('0x18')],{'raw':_0x576fd4['options']?_0x576fd4[_0xaf12('0x19')][_0xaf12('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x576fd4[_0xaf12('0x19')]?_0x576fd4[_0xaf12('0x19')][_0xaf12('0x1e')]||null:null,'attributes':_0x576fd4[_0xaf12('0x19')]?_0x576fd4[_0xaf12('0x19')][_0xaf12('0x1f')]||null:null,'limit':_0x576fd4[_0xaf12('0x19')]?_0x576fd4['options'][_0xaf12('0x20')]||null:null})['then'](function(_0x39b12f){logger[_0xaf12('0xc')](_0xaf12('0x21'),_0x576fd4);logger['debug']('UpdateFaxQueueReport',_0x576fd4,JSON['stringify'](_0x39b12f));_0x2fb1a8(_0x39b12f);})['catch'](function(_0x5484c8){logger['error'](_0xaf12('0x21'),_0x5484c8[_0xaf12('0x13')],_0x576fd4);_0x1b66bc(_0x26e97a[_0xaf12('0x11')](0x1f4,_0x5484c8[_0xaf12('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 66033c0..33c2207 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 _0x0ad1=['get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xe9fece,_0x38f1d9){var _0x5f2549=function(_0x597f68){while(--_0x597f68){_0xe9fece['push'](_0xe9fece['shift']());}};_0x5f2549(++_0x38f1d9);}(_0x0ad1,0x1ef));var _0x10ad=function(_0x55d946,_0x644bc4){_0x55d946=_0x55d946-0x0;var _0xc53385=_0x0ad1[_0x55d946];return _0xc53385;};'use strict';var multer=require(_0x10ad('0x0'));var util=require(_0x10ad('0x1'));var path=require(_0x10ad('0x2'));var timeout=require(_0x10ad('0x3'));var express=require(_0x10ad('0x4'));var router=express[_0x10ad('0x5')]();var auth=require(_0x10ad('0x6'));var interaction=require(_0x10ad('0x7'));var config=require(_0x10ad('0x8'));var controller=require('./faxQueueReport.controller');router[_0x10ad('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x10ad('0x9')](_0x10ad('0xa'),auth[_0x10ad('0xb')](),controller[_0x10ad('0xc')]);router[_0x10ad('0x9')](_0x10ad('0xd'),auth[_0x10ad('0xb')](),controller[_0x10ad('0xe')]);router[_0x10ad('0xf')]('/',auth[_0x10ad('0xb')](),controller[_0x10ad('0x10')]);router[_0x10ad('0x11')](_0x10ad('0xd'),auth[_0x10ad('0xb')](),controller[_0x10ad('0x12')]);router['delete'](_0x10ad('0xd'),auth['isAuthenticated'](),controller[_0x10ad('0x13')]);module[_0x10ad('0x14')]=router; \ No newline at end of file +var _0xfa9f=['../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3ab41e,_0x50bef3){var _0x46817c=function(_0x288cde){while(--_0x288cde){_0x3ab41e['push'](_0x3ab41e['shift']());}};_0x46817c(++_0x50bef3);}(_0xfa9f,0x100));var _0xffa9=function(_0x2f037f,_0x2958c5){_0x2f037f=_0x2f037f-0x0;var _0x2d1573=_0xfa9f[_0x2f037f];return _0x2d1573;};'use strict';var multer=require(_0xffa9('0x0'));var util=require(_0xffa9('0x1'));var path=require(_0xffa9('0x2'));var timeout=require(_0xffa9('0x3'));var express=require(_0xffa9('0x4'));var router=express[_0xffa9('0x5')]();var auth=require(_0xffa9('0x6'));var interaction=require(_0xffa9('0x7'));var config=require(_0xffa9('0x8'));var controller=require(_0xffa9('0x9'));router[_0xffa9('0xa')]('/',auth[_0xffa9('0xb')](),controller[_0xffa9('0xc')]);router[_0xffa9('0xa')](_0xffa9('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0xffa9('0xa')]('/:id',auth[_0xffa9('0xb')](),controller[_0xffa9('0xe')]);router['post']('/',auth[_0xffa9('0xb')](),controller[_0xffa9('0xf')]);router[_0xffa9('0x10')](_0xffa9('0x11'),auth['isAuthenticated'](),controller[_0xffa9('0x12')]);router[_0xffa9('0x13')](_0xffa9('0x11'),auth[_0xffa9('0xb')](),controller[_0xffa9('0x14')]);module[_0xffa9('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index d9c91d4..49a31e8 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 _0x4eee=['sequelize','exports','STRING','agent','queue','NOW'];(function(_0x1a0a30,_0x91e0c6){var _0x6342a2=function(_0x159f78){while(--_0x159f78){_0x1a0a30['push'](_0x1a0a30['shift']());}};_0x6342a2(++_0x91e0c6);}(_0x4eee,0xde));var _0xe4ee=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0x4eee[_0x5d07ff];return _0x5226ad;};'use strict';var moment=require('moment');var Sequelize=require(_0xe4ee('0x0'));module[_0xe4ee('0x1')]={'uniqueid':{'type':Sequelize[_0xe4ee('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xe4ee('0x3'),'queue'),'allowNull':![],'defaultValue':_0xe4ee('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xe4ee('0x5')]}}; \ No newline at end of file +var _0x5cf4=['agent','queue','NOW','sequelize','ENUM','account'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x5cf4,0x99));var _0x45cf=function(_0x2b8077,_0x453634){_0x2b8077=_0x2b8077-0x0;var _0x308091=_0x5cf4[_0x2b8077];return _0x308091;};'use strict';var moment=require('moment');var Sequelize=require(_0x45cf('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x45cf('0x1')](_0x45cf('0x2'),_0x45cf('0x3'),'queue'),'allowNull':![],'defaultValue':_0x45cf('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x45cf('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d239d0e..7bcd498 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 _0x2ad0=['../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','FaxTransferReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2ad0,0x7a));var _0x02ad=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x2ad0[_0x2d9c6a];return _0xf3c918;};'use strict';var pdf=require(_0x02ad('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x02ad('0x1'));var zipdir=require(_0x02ad('0x2'));var jsonpatch=require(_0x02ad('0x3'));var rp=require('request-promise');var moment=require(_0x02ad('0x4'));var BPromise=require(_0x02ad('0x5'));var Mustache=require(_0x02ad('0x6'));var util=require(_0x02ad('0x7'));var path=require(_0x02ad('0x8'));var sox=require('sox');var csv=require(_0x02ad('0x9'));var ejs=require(_0x02ad('0xa'));var fs=require('fs');var _=require(_0x02ad('0xb'));var squel=require(_0x02ad('0xc'));var crypto=require(_0x02ad('0xd'));var jsforce=require(_0x02ad('0xe'));var deskjs=require(_0x02ad('0xf'));var toCsv=require(_0x02ad('0x9'));var querystring=require('querystring');var Papa=require(_0x02ad('0x10'));var Redis=require(_0x02ad('0x11'));var authService=require(_0x02ad('0x12'));var qs=require(_0x02ad('0x13'));var hardwareService=require(_0x02ad('0x14'));var logger=require(_0x02ad('0x15'))('api');var utils=require(_0x02ad('0x16'));var config=require(_0x02ad('0x17'));var db=require(_0x02ad('0x18'))['db'];function respondWithStatusCode(_0x33b92d,_0x4fa5bf){_0x4fa5bf=_0x4fa5bf||0xcc;return function(_0x2fd965){if(_0x2fd965){return _0x33b92d[_0x02ad('0x19')](_0x4fa5bf);}return _0x33b92d[_0x02ad('0x1a')](_0x4fa5bf)[_0x02ad('0x1b')]();};}function respondWithResult(_0x3aa205,_0x370020){_0x370020=_0x370020||0xc8;return function(_0x5a47b1){if(_0x5a47b1){return _0x3aa205['status'](_0x370020)[_0x02ad('0x1c')](_0x5a47b1);}};}function respondWithFilteredResult(_0x3ff5b5,_0x4cc040){return function(_0x2b84ca){if(_0x2b84ca){var _0x12e632=_0x2b84ca[_0x02ad('0x1d')],_0x272304=_0x4cc040[_0x02ad('0x1e')],_0x18a1ea=_0x4cc040[_0x02ad('0x1e')]+_0x4cc040[_0x02ad('0x1f')],_0x15d53a;if(_0x18a1ea>=_0x12e632){_0x18a1ea=_0x12e632;_0x15d53a=0xc8;}else{_0x15d53a=0xce;}_0x3ff5b5[_0x02ad('0x1a')](_0x15d53a);return _0x3ff5b5['set'](_0x02ad('0x20'),_0x272304+'-'+_0x18a1ea+'/'+_0x12e632)['json'](_0x2b84ca);}return null;};}function patchUpdates(_0x337830){return function(_0x5506f9){try{jsonpatch[_0x02ad('0x21')](_0x5506f9,_0x337830,!![]);}catch(_0x558857){return BPromise[_0x02ad('0x22')](_0x558857);}return _0x5506f9[_0x02ad('0x23')]();};}function saveUpdates(_0x43f476,_0x15b73d){return function(_0x335df4){if(_0x335df4){return _0x335df4[_0x02ad('0x24')](_0x43f476)[_0x02ad('0x25')](function(_0x963d47){return _0x963d47;});}return null;};}function removeEntity(_0x20a6a0,_0x11f5a6){return function(_0xd15951){if(_0xd15951){return _0xd15951[_0x02ad('0x26')]()['then'](function(){_0x20a6a0[_0x02ad('0x1a')](0xcc)[_0x02ad('0x1b')]();});}};}function handleEntityNotFound(_0x280ddf,_0x299c32){return function(_0x3e8980){if(!_0x3e8980){_0x280ddf['sendStatus'](0x194);}return _0x3e8980;};}function handleError(_0x25038e,_0x51db08){_0x51db08=_0x51db08||0x1f4;return function(_0x1ffd64){logger['error'](_0x1ffd64[_0x02ad('0x27')]);if(_0x1ffd64[_0x02ad('0x28')]){delete _0x1ffd64[_0x02ad('0x28')];}_0x25038e[_0x02ad('0x1a')](_0x51db08)[_0x02ad('0x29')](_0x1ffd64);};}exports[_0x02ad('0x2a')]=function(_0x118946,_0x1fc412){var _0x1473ca={},_0xac84d9={},_0x1a4f45={'count':0x0,'rows':[]};var _0x169cdb=db[_0x02ad('0x2b')][_0x02ad('0x2c')];_0xac84d9[_0x02ad('0x2d')]=_['keys'](_0x169cdb);_0xac84d9[_0x02ad('0x2e')]=_[_0x02ad('0x2f')](_0x118946[_0x02ad('0x2e')]);_0xac84d9[_0x02ad('0x30')]=_[_0x02ad('0x31')](_0xac84d9[_0x02ad('0x2d')],_0xac84d9[_0x02ad('0x2e')]);_0x1473ca['attributes']=_[_0x02ad('0x31')](_0xac84d9[_0x02ad('0x2d')],qs[_0x02ad('0x32')](_0x118946[_0x02ad('0x2e')][_0x02ad('0x32')]));_0x1473ca[_0x02ad('0x33')]=_0x1473ca[_0x02ad('0x33')][_0x02ad('0x34')]?_0x1473ca[_0x02ad('0x33')]:_0xac84d9[_0x02ad('0x2d')];if(!_0x118946[_0x02ad('0x2e')][_0x02ad('0x35')](_0x02ad('0x36'))){_0x1473ca[_0x02ad('0x1f')]=qs[_0x02ad('0x1f')](_0x118946[_0x02ad('0x2e')][_0x02ad('0x1f')]);_0x1473ca[_0x02ad('0x1e')]=qs[_0x02ad('0x1e')](_0x118946[_0x02ad('0x2e')][_0x02ad('0x1e')]);}_0x1473ca[_0x02ad('0x37')]=qs[_0x02ad('0x38')](_0x118946[_0x02ad('0x2e')][_0x02ad('0x38')]);_0x1473ca[_0x02ad('0x39')]=qs['filters'](_[_0x02ad('0x3a')](_0x118946[_0x02ad('0x2e')],_0xac84d9[_0x02ad('0x30')]));if(_0x118946[_0x02ad('0x2e')]['filter']){_0x1473ca[_0x02ad('0x39')]=_[_0x02ad('0x3b')](_0x1473ca[_0x02ad('0x39')],{'$or':_['map'](_0x169cdb,function(_0x2bb3b9){if(_0x2bb3b9[_0x02ad('0x3c')]['key']!=='VIRTUAL'){var _0x43e618={};_0x43e618[_0x2bb3b9['field']]={'$like':'%'+_0x118946[_0x02ad('0x2e')]['filter']+'%'};return _0x43e618;}})});}_0x1473ca=_[_0x02ad('0x3b')]({},_0x1473ca,_0x118946[_0x02ad('0x3d')]);var _0xc4399d={'where':_0x1473ca[_0x02ad('0x39')]};return db[_0x02ad('0x2b')][_0x02ad('0x1d')](_0xc4399d)[_0x02ad('0x25')](function(_0x4d6706){_0x1a4f45[_0x02ad('0x1d')]=_0x4d6706;if(_0x118946[_0x02ad('0x2e')]['includeAll']){_0x1473ca['include']=[{'all':!![]}];}return db[_0x02ad('0x2b')][_0x02ad('0x3e')](_0x1473ca);})[_0x02ad('0x25')](function(_0x1de480){_0x1a4f45[_0x02ad('0x3f')]=_0x1de480;return _0x1a4f45;})[_0x02ad('0x25')](respondWithFilteredResult(_0x1fc412,_0x1473ca))[_0x02ad('0x40')](handleError(_0x1fc412,null));};exports[_0x02ad('0x41')]=function(_0x33e0b8,_0x3531f7){var _0x2e98a7={'raw':!![],'where':{'id':_0x33e0b8[_0x02ad('0x42')]['id']}},_0x572001={};_0x572001['model']=_[_0x02ad('0x2f')](db[_0x02ad('0x2b')]['rawAttributes']);_0x572001['query']=_[_0x02ad('0x2f')](_0x33e0b8[_0x02ad('0x2e')]);_0x572001[_0x02ad('0x30')]=_[_0x02ad('0x31')](_0x572001[_0x02ad('0x2d')],_0x572001[_0x02ad('0x2e')]);_0x2e98a7['attributes']=_['intersection'](_0x572001[_0x02ad('0x2d')],qs[_0x02ad('0x32')](_0x33e0b8[_0x02ad('0x2e')][_0x02ad('0x32')]));_0x2e98a7[_0x02ad('0x33')]=_0x2e98a7[_0x02ad('0x33')][_0x02ad('0x34')]?_0x2e98a7['attributes']:_0x572001[_0x02ad('0x2d')];if(_0x33e0b8[_0x02ad('0x2e')][_0x02ad('0x43')]){_0x2e98a7[_0x02ad('0x44')]=[{'all':!![]}];}_0x2e98a7=_[_0x02ad('0x3b')]({},_0x2e98a7,_0x33e0b8[_0x02ad('0x3d')]);return db[_0x02ad('0x2b')][_0x02ad('0x45')](_0x2e98a7)[_0x02ad('0x25')](handleEntityNotFound(_0x3531f7,null))[_0x02ad('0x25')](respondWithResult(_0x3531f7,null))[_0x02ad('0x40')](handleError(_0x3531f7,null));};exports[_0x02ad('0x46')]=function(_0x11dc9c,_0x3f5ff1){return db[_0x02ad('0x2b')][_0x02ad('0x46')](_0x11dc9c['body'],{})[_0x02ad('0x25')](respondWithResult(_0x3f5ff1,0xc9))[_0x02ad('0x40')](handleError(_0x3f5ff1,null));};exports['update']=function(_0x5ce89c,_0x2e3781){if(_0x5ce89c[_0x02ad('0x47')]['id']){delete _0x5ce89c[_0x02ad('0x47')]['id'];}return db[_0x02ad('0x2b')][_0x02ad('0x45')]({'where':{'id':_0x5ce89c[_0x02ad('0x42')]['id']}})[_0x02ad('0x25')](handleEntityNotFound(_0x2e3781,null))[_0x02ad('0x25')](saveUpdates(_0x5ce89c[_0x02ad('0x47')],null))[_0x02ad('0x25')](respondWithResult(_0x2e3781,null))['catch'](handleError(_0x2e3781,null));};exports[_0x02ad('0x26')]=function(_0x112410,_0x10f4ba){return db[_0x02ad('0x2b')][_0x02ad('0x45')]({'where':{'id':_0x112410[_0x02ad('0x42')]['id']}})[_0x02ad('0x25')](handleEntityNotFound(_0x10f4ba,null))[_0x02ad('0x25')](removeEntity(_0x10f4ba,null))[_0x02ad('0x40')](handleError(_0x10f4ba,null));};exports['describe']=function(_0x303af5,_0x1cb561){return db[_0x02ad('0x2b')][_0x02ad('0x48')]()['then'](respondWithResult(_0x1cb561,null))[_0x02ad('0x40')](handleError(_0x1cb561,null));}; \ No newline at end of file +var _0x3c61=['map','type','VIRTUAL','field','options','FaxTransferReport','include','findAll','catch','show','params','keys','includeAll','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','name','send','index','rawAttributes','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge'];(function(_0x236a8d,_0x2e9b1d){var _0x212efe=function(_0xe70882){while(--_0xe70882){_0x236a8d['push'](_0x236a8d['shift']());}};_0x212efe(++_0x2e9b1d);}(_0x3c61,0x1c7));var _0x13c6=function(_0x30e7b5,_0x5ce937){_0x30e7b5=_0x30e7b5-0x0;var _0x216457=_0x3c61[_0x30e7b5];return _0x216457;};'use strict';var pdf=require(_0x13c6('0x0'));var emlformat=require(_0x13c6('0x1'));var rimraf=require(_0x13c6('0x2'));var zipdir=require(_0x13c6('0x3'));var jsonpatch=require(_0x13c6('0x4'));var rp=require(_0x13c6('0x5'));var moment=require(_0x13c6('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x13c6('0x7'));var util=require(_0x13c6('0x8'));var path=require('path');var sox=require(_0x13c6('0x9'));var csv=require(_0x13c6('0xa'));var ejs=require(_0x13c6('0xb'));var fs=require('fs');var _=require(_0x13c6('0xc'));var squel=require(_0x13c6('0xd'));var crypto=require(_0x13c6('0xe'));var jsforce=require(_0x13c6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x13c6('0xa'));var querystring=require(_0x13c6('0x10'));var Papa=require(_0x13c6('0x11'));var Redis=require('ioredis');var authService=require(_0x13c6('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x13c6('0x13'))('api');var utils=require(_0x13c6('0x14'));var config=require(_0x13c6('0x15'));var db=require(_0x13c6('0x16'))['db'];function respondWithStatusCode(_0x190128,_0xaa648e){_0xaa648e=_0xaa648e||0xcc;return function(_0x569a65){if(_0x569a65){return _0x190128[_0x13c6('0x17')](_0xaa648e);}return _0x190128[_0x13c6('0x18')](_0xaa648e)[_0x13c6('0x19')]();};}function respondWithResult(_0x1a56bf,_0x721d78){_0x721d78=_0x721d78||0xc8;return function(_0x2e9dd8){if(_0x2e9dd8){return _0x1a56bf[_0x13c6('0x18')](_0x721d78)[_0x13c6('0x1a')](_0x2e9dd8);}};}function respondWithFilteredResult(_0x5d1b6b,_0x25a7ea){return function(_0x5f0f01){if(_0x5f0f01){var _0x3b0cf5=_0x5f0f01[_0x13c6('0x1b')],_0x10d925=_0x25a7ea[_0x13c6('0x1c')],_0x44558e=_0x25a7ea[_0x13c6('0x1c')]+_0x25a7ea[_0x13c6('0x1d')],_0x3bb8ba;if(_0x44558e>=_0x3b0cf5){_0x44558e=_0x3b0cf5;_0x3bb8ba=0xc8;}else{_0x3bb8ba=0xce;}_0x5d1b6b[_0x13c6('0x18')](_0x3bb8ba);return _0x5d1b6b[_0x13c6('0x1e')](_0x13c6('0x1f'),_0x10d925+'-'+_0x44558e+'/'+_0x3b0cf5)['json'](_0x5f0f01);}return null;};}function patchUpdates(_0x2eca95){return function(_0x3ebc56){try{jsonpatch['apply'](_0x3ebc56,_0x2eca95,!![]);}catch(_0x144a9d){return BPromise['reject'](_0x144a9d);}return _0x3ebc56[_0x13c6('0x20')]();};}function saveUpdates(_0x59c442,_0x182a20){return function(_0x1c62e2){if(_0x1c62e2){return _0x1c62e2[_0x13c6('0x21')](_0x59c442)[_0x13c6('0x22')](function(_0x3226c9){return _0x3226c9;});}return null;};}function removeEntity(_0x81e7bd,_0x5ac38a){return function(_0x208bee){if(_0x208bee){return _0x208bee[_0x13c6('0x23')]()['then'](function(){_0x81e7bd[_0x13c6('0x18')](0xcc)[_0x13c6('0x19')]();});}};}function handleEntityNotFound(_0x3ace42,_0x5c2397){return function(_0x4dc2f3){if(!_0x4dc2f3){_0x3ace42['sendStatus'](0x194);}return _0x4dc2f3;};}function handleError(_0x1089d7,_0x3d29a8){_0x3d29a8=_0x3d29a8||0x1f4;return function(_0x2ede6e){logger[_0x13c6('0x24')](_0x2ede6e['stack']);if(_0x2ede6e[_0x13c6('0x25')]){delete _0x2ede6e[_0x13c6('0x25')];}_0x1089d7[_0x13c6('0x18')](_0x3d29a8)[_0x13c6('0x26')](_0x2ede6e);};}exports[_0x13c6('0x27')]=function(_0xedc225,_0x375f4a){var _0x2f55c3={},_0x92ff9={},_0x43d718={'count':0x0,'rows':[]};var _0x3e236a=db['FaxTransferReport'][_0x13c6('0x28')];_0x92ff9['model']=_['keys'](_0x3e236a);_0x92ff9[_0x13c6('0x29')]=_['keys'](_0xedc225[_0x13c6('0x29')]);_0x92ff9['filters']=_[_0x13c6('0x2a')](_0x92ff9[_0x13c6('0x2b')],_0x92ff9[_0x13c6('0x29')]);_0x2f55c3[_0x13c6('0x2c')]=_['intersection'](_0x92ff9[_0x13c6('0x2b')],qs[_0x13c6('0x2d')](_0xedc225['query'][_0x13c6('0x2d')]));_0x2f55c3[_0x13c6('0x2c')]=_0x2f55c3[_0x13c6('0x2c')][_0x13c6('0x2e')]?_0x2f55c3[_0x13c6('0x2c')]:_0x92ff9[_0x13c6('0x2b')];if(!_0xedc225[_0x13c6('0x29')][_0x13c6('0x2f')](_0x13c6('0x30'))){_0x2f55c3[_0x13c6('0x1d')]=qs[_0x13c6('0x1d')](_0xedc225[_0x13c6('0x29')][_0x13c6('0x1d')]);_0x2f55c3[_0x13c6('0x1c')]=qs[_0x13c6('0x1c')](_0xedc225[_0x13c6('0x29')][_0x13c6('0x1c')]);}_0x2f55c3[_0x13c6('0x31')]=qs[_0x13c6('0x32')](_0xedc225[_0x13c6('0x29')]['sort']);_0x2f55c3['where']=qs[_0x13c6('0x33')](_[_0x13c6('0x34')](_0xedc225[_0x13c6('0x29')],_0x92ff9[_0x13c6('0x33')]));if(_0xedc225[_0x13c6('0x29')][_0x13c6('0x35')]){_0x2f55c3[_0x13c6('0x36')]=_[_0x13c6('0x37')](_0x2f55c3[_0x13c6('0x36')],{'$or':_[_0x13c6('0x38')](_0x3e236a,function(_0x395a85){if(_0x395a85[_0x13c6('0x39')]['key']!==_0x13c6('0x3a')){var _0x31018c={};_0x31018c[_0x395a85[_0x13c6('0x3b')]]={'$like':'%'+_0xedc225[_0x13c6('0x29')][_0x13c6('0x35')]+'%'};return _0x31018c;}})});}_0x2f55c3=_['merge']({},_0x2f55c3,_0xedc225[_0x13c6('0x3c')]);var _0x1daeec={'where':_0x2f55c3['where']};return db[_0x13c6('0x3d')][_0x13c6('0x1b')](_0x1daeec)['then'](function(_0x1a916c){_0x43d718[_0x13c6('0x1b')]=_0x1a916c;if(_0xedc225['query']['includeAll']){_0x2f55c3[_0x13c6('0x3e')]=[{'all':!![]}];}return db[_0x13c6('0x3d')][_0x13c6('0x3f')](_0x2f55c3);})[_0x13c6('0x22')](function(_0xf22d3b){_0x43d718['rows']=_0xf22d3b;return _0x43d718;})[_0x13c6('0x22')](respondWithFilteredResult(_0x375f4a,_0x2f55c3))[_0x13c6('0x40')](handleError(_0x375f4a,null));};exports[_0x13c6('0x41')]=function(_0x49f90a,_0x331157){var _0x5a378b={'raw':!![],'where':{'id':_0x49f90a[_0x13c6('0x42')]['id']}},_0x4cd049={};_0x4cd049['model']=_[_0x13c6('0x43')](db['FaxTransferReport']['rawAttributes']);_0x4cd049['query']=_[_0x13c6('0x43')](_0x49f90a[_0x13c6('0x29')]);_0x4cd049[_0x13c6('0x33')]=_['intersection'](_0x4cd049[_0x13c6('0x2b')],_0x4cd049[_0x13c6('0x29')]);_0x5a378b[_0x13c6('0x2c')]=_[_0x13c6('0x2a')](_0x4cd049['model'],qs['fields'](_0x49f90a[_0x13c6('0x29')]['fields']));_0x5a378b['attributes']=_0x5a378b[_0x13c6('0x2c')]['length']?_0x5a378b[_0x13c6('0x2c')]:_0x4cd049[_0x13c6('0x2b')];if(_0x49f90a['query'][_0x13c6('0x44')]){_0x5a378b['include']=[{'all':!![]}];}_0x5a378b=_[_0x13c6('0x37')]({},_0x5a378b,_0x49f90a['options']);return db[_0x13c6('0x3d')][_0x13c6('0x45')](_0x5a378b)['then'](handleEntityNotFound(_0x331157,null))[_0x13c6('0x22')](respondWithResult(_0x331157,null))[_0x13c6('0x40')](handleError(_0x331157,null));};exports[_0x13c6('0x46')]=function(_0x148483,_0x4829da){return db[_0x13c6('0x3d')][_0x13c6('0x46')](_0x148483[_0x13c6('0x47')],{})[_0x13c6('0x22')](respondWithResult(_0x4829da,0xc9))[_0x13c6('0x40')](handleError(_0x4829da,null));};exports[_0x13c6('0x21')]=function(_0x58df71,_0x21997d){if(_0x58df71[_0x13c6('0x47')]['id']){delete _0x58df71['body']['id'];}return db[_0x13c6('0x3d')][_0x13c6('0x45')]({'where':{'id':_0x58df71[_0x13c6('0x42')]['id']}})['then'](handleEntityNotFound(_0x21997d,null))[_0x13c6('0x22')](saveUpdates(_0x58df71[_0x13c6('0x47')],null))[_0x13c6('0x22')](respondWithResult(_0x21997d,null))[_0x13c6('0x40')](handleError(_0x21997d,null));};exports['destroy']=function(_0x5d086e,_0x2395f6){return db[_0x13c6('0x3d')][_0x13c6('0x45')]({'where':{'id':_0x5d086e[_0x13c6('0x42')]['id']}})[_0x13c6('0x22')](handleEntityNotFound(_0x2395f6,null))[_0x13c6('0x22')](removeEntity(_0x2395f6,null))['catch'](handleError(_0x2395f6,null));};exports[_0x13c6('0x48')]=function(_0x448762,_0x22ab02){return db[_0x13c6('0x3d')][_0x13c6('0x48')]()['then'](respondWithResult(_0x22ab02,null))[_0x13c6('0x40')](handleError(_0x22ab02,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 4ced6f3..24adeb1 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 _0x3764=['lodash','util','../../config/logger','api','bluebird','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid'];(function(_0x3dcfb9,_0x31b829){var _0x434373=function(_0x30861f){while(--_0x30861f){_0x3dcfb9['push'](_0x3dcfb9['shift']());}};_0x434373(++_0x31b829);}(_0x3764,0xb0));var _0x4376=function(_0x4f8522,_0x42263c){_0x4f8522=_0x4f8522-0x0;var _0x5915c7=_0x3764[_0x4f8522];return _0x5915c7;};'use strict';var _=require(_0x4376('0x0'));var util=require(_0x4376('0x1'));var logger=require(_0x4376('0x2'))(_0x4376('0x3'));var moment=require('moment');var BPromise=require(_0x4376('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4376('0x5'));var attributes=require(_0x4376('0x6'));module['exports']=function(_0x5aa78c,_0x375a88){return _0x5aa78c[_0x4376('0x7')](_0x4376('0x8'),attributes,{'tableName':_0x4376('0x9'),'paranoid':![],'indexes':[{'name':_0x4376('0xa'),'fields':[_0x4376('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x96f1=['define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxTransferReport.attributes'];(function(_0x2cf8ef,_0x5ab4d4){var _0x11869f=function(_0xbd8a28){while(--_0xbd8a28){_0x2cf8ef['push'](_0x2cf8ef['shift']());}};_0x11869f(++_0x5ab4d4);}(_0x96f1,0x1b6));var _0x196f=function(_0x3f71c0,_0x2fa4d1){_0x3f71c0=_0x3f71c0-0x0;var _0x45d3ec=_0x96f1[_0x3f71c0];return _0x45d3ec;};'use strict';var _=require(_0x196f('0x0'));var util=require(_0x196f('0x1'));var logger=require(_0x196f('0x2'))(_0x196f('0x3'));var moment=require(_0x196f('0x4'));var BPromise=require(_0x196f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x196f('0x6'));var rimraf=require(_0x196f('0x7'));var config=require(_0x196f('0x8'));var attributes=require(_0x196f('0x9'));module['exports']=function(_0x299eae,_0x4a5d3b){return _0x299eae[_0x196f('0xa')](_0x196f('0xb'),attributes,{'tableName':_0x196f('0xc'),'paranoid':![],'indexes':[{'name':_0x196f('0xd'),'fields':[_0x196f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 8157dac..8ae8d93 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 _0xfc9e=['request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0xfc9e,0xf1));var _0xefc9=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xfc9e[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0xefc9('0x0'));var util=require('util');var moment=require(_0xefc9('0x1'));var BPromise=require(_0xefc9('0x2'));var rs=require(_0xefc9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefc9('0x4'))['db'];var utils=require(_0xefc9('0x5'));var logger=require(_0xefc9('0x6'))(_0xefc9('0x7'));var config=require(_0xefc9('0x8'));var jayson=require(_0xefc9('0x9'));var client=jayson[_0xefc9('0xa')][_0xefc9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50719c,_0x1a4178,_0x1b487e){return new BPromise(function(_0x15c828,_0x2a1b13){return client[_0xefc9('0xc')](_0x50719c,_0x1b487e)[_0xefc9('0xd')](function(_0x215473){logger[_0xefc9('0xe')](_0xefc9('0xf'),_0x1a4178,_0xefc9('0x10'));logger['debug'](_0xefc9('0x11'),_0x1a4178,_0xefc9('0x10'),JSON[_0xefc9('0x12')](_0x215473));if(_0x215473[_0xefc9('0x13')]){if(_0x215473[_0xefc9('0x13')][_0xefc9('0x14')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x1a4178,_0x215473[_0xefc9('0x13')][_0xefc9('0x15')]);return _0x2a1b13(_0x215473[_0xefc9('0x13')]['message']);}logger[_0xefc9('0x13')](_0xefc9('0xf'),_0x1a4178,_0x215473[_0xefc9('0x13')][_0xefc9('0x15')]);return _0x15c828(_0x215473[_0xefc9('0x13')][_0xefc9('0x15')]);}else{logger[_0xefc9('0xe')]('FaxTransferReport,\x20%s,\x20%s',_0x1a4178,_0xefc9('0x10'));_0x15c828(_0x215473['result'][_0xefc9('0x15')]);}})[_0xefc9('0x16')](function(_0x41dce3){logger[_0xefc9('0x13')](_0xefc9('0xf'),_0x1a4178,_0x41dce3);_0x2a1b13(_0x41dce3);});});} \ No newline at end of file +var _0xe9e4=['info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x52c6fb,_0xb84388){var _0x5f51df=function(_0xc3c9f0){while(--_0xc3c9f0){_0x52c6fb['push'](_0x52c6fb['shift']());}};_0x5f51df(++_0xb84388);}(_0xe9e4,0x104));var _0x4e9e=function(_0x110231,_0x20380c){_0x110231=_0x110231-0x0;var _0x4c7e51=_0xe9e4[_0x110231];return _0x4c7e51;};'use strict';var _=require(_0x4e9e('0x0'));var util=require(_0x4e9e('0x1'));var moment=require(_0x4e9e('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e9e('0x3'));var fs=require('fs');var Redis=require(_0x4e9e('0x4'));var db=require(_0x4e9e('0x5'))['db'];var utils=require(_0x4e9e('0x6'));var logger=require(_0x4e9e('0x7'))(_0x4e9e('0x8'));var config=require(_0x4e9e('0x9'));var jayson=require(_0x4e9e('0xa'));var client=jayson[_0x4e9e('0xb')][_0x4e9e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ac8dd,_0x310ffa,_0x1d8e65){return new BPromise(function(_0x15cc1e,_0x2dfd4f){return client[_0x4e9e('0xd')](_0x4ac8dd,_0x1d8e65)[_0x4e9e('0xe')](function(_0x33c6ad){logger[_0x4e9e('0xf')](_0x4e9e('0x10'),_0x310ffa,_0x4e9e('0x11'));logger[_0x4e9e('0x12')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x310ffa,_0x4e9e('0x11'),JSON[_0x4e9e('0x13')](_0x33c6ad));if(_0x33c6ad[_0x4e9e('0x14')]){if(_0x33c6ad[_0x4e9e('0x14')][_0x4e9e('0x15')]===0x1f4){logger['error'](_0x4e9e('0x10'),_0x310ffa,_0x33c6ad['error'][_0x4e9e('0x16')]);return _0x2dfd4f(_0x33c6ad[_0x4e9e('0x14')][_0x4e9e('0x16')]);}logger[_0x4e9e('0x14')](_0x4e9e('0x10'),_0x310ffa,_0x33c6ad['error']['message']);return _0x15cc1e(_0x33c6ad[_0x4e9e('0x14')][_0x4e9e('0x16')]);}else{logger[_0x4e9e('0xf')](_0x4e9e('0x10'),_0x310ffa,_0x4e9e('0x11'));_0x15cc1e(_0x33c6ad[_0x4e9e('0x17')][_0x4e9e('0x16')]);}})[_0x4e9e('0x18')](function(_0x446053){logger['error'](_0x4e9e('0x10'),_0x310ffa,_0x446053);_0x2dfd4f(_0x446053);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 9cd7839..7207dc0 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 _0x33c5=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x1543f8,_0x219084){var _0x56e45b=function(_0x3061d0){while(--_0x3061d0){_0x1543f8['push'](_0x1543f8['shift']());}};_0x56e45b(++_0x219084);}(_0x33c5,0xe6));var _0x533c=function(_0x2731f0,_0x126b1b){_0x2731f0=_0x2731f0-0x0;var _0x36a180=_0x33c5[_0x2731f0];return _0x36a180;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var auth=require(_0x533c('0x4'));var interaction=require(_0x533c('0x5'));var config=require(_0x533c('0x6'));var controller=require('./faxTransferReport.controller');router[_0x533c('0x7')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0x9')]);router[_0x533c('0x7')](_0x533c('0xa'),auth[_0x533c('0x8')](),controller[_0x533c('0xb')]);router[_0x533c('0x7')](_0x533c('0xc'),auth[_0x533c('0x8')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')](_0x533c('0xc'),auth['isAuthenticated'](),controller[_0x533c('0x11')]);router[_0x533c('0x12')](_0x533c('0xc'),auth[_0x533c('0x8')](),controller[_0x533c('0x13')]);module[_0x533c('0x14')]=router; \ No newline at end of file +var _0x6aa7=['Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','index','/describe','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x14bf9e,_0xeac65e){var _0x8d2af2=function(_0x12c72a){while(--_0x12c72a){_0x14bf9e['push'](_0x14bf9e['shift']());}};_0x8d2af2(++_0xeac65e);}(_0x6aa7,0x178));var _0x76aa=function(_0x2ba50f,_0x32cee8){_0x2ba50f=_0x2ba50f-0x0;var _0x3db9e9=_0x6aa7[_0x2ba50f];return _0x3db9e9;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76aa('0x5'));var config=require(_0x76aa('0x6'));var controller=require(_0x76aa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x76aa('0x8')]);router['get'](_0x76aa('0x9'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xd')]);router['post']('/',auth[_0x76aa('0xa')](),controller[_0x76aa('0xe')]);router[_0x76aa('0xf')](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x10')]);router[_0x76aa('0x11')](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('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 b4e2575..7cdfde1 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 _0x7821=['./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4b9174,_0x5a347d){var _0x5669a9=function(_0x1debb1){while(--_0x1debb1){_0x4b9174['push'](_0x4b9174['shift']());}};_0x5669a9(++_0x5a347d);}(_0x7821,0x6c));var _0x1782=function(_0x53ba51,_0x2f2321){_0x53ba51=_0x53ba51-0x0;var _0x2e776e=_0x7821[_0x53ba51];return _0x2e776e;};'use strict';var multer=require(_0x1782('0x0'));var util=require(_0x1782('0x1'));var path=require(_0x1782('0x2'));var timeout=require(_0x1782('0x3'));var express=require('express');var router=express[_0x1782('0x4')]();var auth=require(_0x1782('0x5'));var interaction=require(_0x1782('0x6'));var config=require('../../config/environment');var controller=require(_0x1782('0x7'));router[_0x1782('0x8')]('/',auth[_0x1782('0x9')](),controller[_0x1782('0xa')]);router[_0x1782('0x8')](_0x1782('0xb'),auth['isAuthenticated'](),controller[_0x1782('0xc')]);router[_0x1782('0x8')](_0x1782('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1782('0x8')](_0x1782('0xe'),auth[_0x1782('0x9')](),controller[_0x1782('0xf')]);router[_0x1782('0x10')]('/',auth['isAuthenticated'](),controller[_0x1782('0x11')]);router[_0x1782('0x10')](_0x1782('0xd'),auth[_0x1782('0x9')](),controller[_0x1782('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1782('0x13')]);router[_0x1782('0x14')](_0x1782('0xb'),auth[_0x1782('0x9')](),controller[_0x1782('0x15')]);module[_0x1782('0x16')]=router; \ No newline at end of file +var _0x721e=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','/:id','delete','destroy'];(function(_0x3b9822,_0x4a9051){var _0x102220=function(_0x151dc2){while(--_0x151dc2){_0x3b9822['push'](_0x3b9822['shift']());}};_0x102220(++_0x4a9051);}(_0x721e,0xdd));var _0xe721=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x721e[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xe721('0x0'));var util=require(_0xe721('0x1'));var path=require(_0xe721('0x2'));var timeout=require('connect-timeout');var express=require(_0xe721('0x3'));var router=express[_0xe721('0x4')]();var auth=require(_0xe721('0x5'));var interaction=require(_0xe721('0x6'));var config=require('../../config/environment');var controller=require('./intDeskAccount.controller');router[_0xe721('0x7')]('/',auth[_0xe721('0x8')](),controller[_0xe721('0x9')]);router[_0xe721('0x7')]('/:id',auth[_0xe721('0x8')](),controller[_0xe721('0xa')]);router[_0xe721('0x7')](_0xe721('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xe721('0x7')](_0xe721('0xc'),auth['isAuthenticated'](),controller[_0xe721('0xd')]);router[_0xe721('0xe')]('/',auth[_0xe721('0x8')](),controller['create']);router[_0xe721('0xe')](_0xe721('0xb'),auth[_0xe721('0x8')](),controller[_0xe721('0xf')]);router['put'](_0xe721('0x10'),auth[_0xe721('0x8')](),controller['update']);router[_0xe721('0x11')](_0xe721('0x10'),auth[_0xe721('0x8')](),controller[_0xe721('0x12')]);module[_0xe721('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 1e9e46d..32566d5 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 _0xe7e6=['STRING','ENUM','sequelize'];(function(_0x4e61bc,_0x1cff51){var _0x4e0fb1=function(_0x587f0d){while(--_0x587f0d){_0x4e61bc['push'](_0x4e61bc['shift']());}};_0x4e0fb1(++_0x1cff51);}(_0xe7e6,0x1c4));var _0x6e7e=function(_0x4f361a,_0x3ca85d){_0x4f361a=_0x4f361a-0x0;var _0x1ea24d=_0xe7e6[_0x4f361a];return _0x1ea24d;};'use strict';var Sequelize=require(_0x6e7e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6e7e('0x1')]},'remoteUri':{'type':Sequelize[_0x6e7e('0x1')]},'authType':{'type':Sequelize[_0x6e7e('0x2')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x6e7e('0x1')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x6e7e('0x1')]},'token':{'type':Sequelize[_0x6e7e('0x1')]},'tokenSecret':{'type':Sequelize[_0x6e7e('0x1')]},'serverUrl':{'type':Sequelize[_0x6e7e('0x1')]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xe061=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x473dff,_0x556b62){var _0x1b8daa=function(_0x431000){while(--_0x431000){_0x473dff['push'](_0x473dff['shift']());}};_0x1b8daa(++_0x556b62);}(_0xe061,0xbb));var _0x1e06=function(_0x1db616,_0x5d464a){_0x1db616=_0x1db616-0x0;var _0x4102ee=_0xe061[_0x1db616];return _0x4102ee;};'use strict';var Sequelize=require(_0x1e06('0x0'));module[_0x1e06('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1e06('0x2')]},'username':{'type':Sequelize[_0x1e06('0x2')]},'remoteUri':{'type':Sequelize[_0x1e06('0x2')]},'authType':{'type':Sequelize[_0x1e06('0x3')](_0x1e06('0x4')),'defaultValue':_0x1e06('0x4')},'password':{'type':Sequelize[_0x1e06('0x2')]},'consumerKey':{'type':Sequelize[_0x1e06('0x2')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1e06('0x2')]},'tokenSecret':{'type':Sequelize[_0x1e06('0x2')]},'serverUrl':{'type':Sequelize[_0x1e06('0x2')]},'type':{'type':Sequelize[_0x1e06('0x3')]('integrationTab','newTab'),'defaultValue':_0x1e06('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index c6e670c..8efa29b 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 _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file +var _0xa9e0=['includeAll','include','findAll','rows','params','model','rawAttributes','find','body','findOne','DeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskField','getFields','priority','authType','username','password','consumerKey','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','toString','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','status','sendStatus','stack','name','send','index','DeskAccount','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','field','options'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x0a9e('0x13'));var jayson=require(_0x0a9e('0x14'));var client=jayson[_0x0a9e('0x15')][_0x0a9e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x32d742,_0x69aeb7,_0x5db4b0){if(_0x5db4b0){var _0x4283ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4283ce[_0x0a9e('0x17')](_0x69aeb7)){return _0x32d742;}else{throw new Error(_0x0a9e('0x18'));}}else{return _0x32d742;}}function respondWithRpcPromise(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){var _0x1985b6=_0x52a03d||client;return _0x1985b6['request'](_0x281129,_0x4d5611)[_0x0a9e('0x19')](function(_0x12066b){logger['info'](_0x0a9e('0x1a'),_0x44dcfd,'request\x20sent');logger[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x44dcfd,_0x0a9e('0x1d'),JSON[_0x0a9e('0x1e')](_0x12066b));if(_0x12066b[_0x0a9e('0x1f')]){if(_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x20')]===0x1f4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b[_0x0a9e('0x1f')][_0x0a9e('0x21')]);return _0x5d0880(_0x12066b[_0x0a9e('0x1f')]['message']);}logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x12066b['error'][_0x0a9e('0x21')]);return _0x22dccb(_0x12066b['error']['message']);}else{logger[_0x0a9e('0x22')](_0x0a9e('0x1a'),_0x44dcfd,_0x0a9e('0x1d'));_0x22dccb(_0x12066b[_0x0a9e('0x23')]['message']);}})[_0x0a9e('0x24')](function(_0x2fb0e4){logger[_0x0a9e('0x1f')](_0x0a9e('0x1a'),_0x44dcfd,_0x2fb0e4);_0x5d0880(_0x2fb0e4);});});}function respondWithStatusCode(_0x370d86,_0x42ac8f){_0x42ac8f=_0x42ac8f||0xcc;return function(_0x16b1ca){if(_0x16b1ca){return _0x370d86['sendStatus'](_0x42ac8f);}return _0x370d86['status'](_0x42ac8f)[_0x0a9e('0x25')]();};}function respondWithResult(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0xc8;return function(_0x33161b){if(_0x33161b){return _0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);}};}function respondWithFilteredResult(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(_0x5bfb33){var _0x1dc186=_0x5bfb33[_0x0a9e('0x27')],_0x34dc65=_0x45a1e7[_0x0a9e('0x28')],_0x25fba9=_0x45a1e7[_0x0a9e('0x28')]+_0x45a1e7[_0x0a9e('0x29')],_0x14433c;if(_0x25fba9>=_0x1dc186){_0x25fba9=_0x1dc186;_0x14433c=0xc8;}else{_0x14433c=0xce;}_0x479bc4['status'](_0x14433c);return _0x479bc4[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x34dc65+'-'+_0x25fba9+'/'+_0x1dc186)[_0x0a9e('0x26')](_0x5bfb33);}return null;};}function patchUpdates(_0x2ec755){return function(_0x5c877d){try{jsonpatch[_0x0a9e('0x2c')](_0x5c877d,_0x2ec755,!![]);}catch(_0x40e7a3){return BPromise[_0x0a9e('0x2d')](_0x40e7a3);}return _0x5c877d[_0x0a9e('0x2e')]();};}function saveUpdates(_0x58b06f,_0x563b45){return function(_0x296f41){if(_0x296f41){return _0x296f41[_0x0a9e('0x2f')](_0x58b06f)[_0x0a9e('0x19')](function(_0x540530){return _0x540530;});}return null;};}function removeEntity(_0x426950,_0x5d1e0e){return function(_0x2407f9){if(_0x2407f9){return _0x2407f9[_0x0a9e('0x30')]()[_0x0a9e('0x19')](function(){_0x426950[_0x0a9e('0x31')](0xcc)[_0x0a9e('0x25')]();});}};}function handleEntityNotFound(_0x5180f1,_0x66c1d2){return function(_0x46f0a5){if(!_0x46f0a5){_0x5180f1[_0x0a9e('0x32')](0x194);}return _0x46f0a5;};}function handleError(_0x2da5c0,_0x2b45ea){_0x2b45ea=_0x2b45ea||0x1f4;return function(_0x409319){logger[_0x0a9e('0x1f')](_0x409319[_0x0a9e('0x33')]);if(_0x409319['name']){delete _0x409319[_0x0a9e('0x34')];}_0x2da5c0['status'](_0x2b45ea)[_0x0a9e('0x35')](_0x409319);};}exports[_0x0a9e('0x36')]=function(_0x2b7e7f,_0x3f3d41){var _0x567193={},_0x191e91={},_0xd1836d={'count':0x0,'rows':[]};var _0x1fa90d=db[_0x0a9e('0x37')]['rawAttributes'];_0x191e91['model']=_[_0x0a9e('0x38')](_0x1fa90d);_0x191e91['query']=_[_0x0a9e('0x38')](_0x2b7e7f[_0x0a9e('0x39')]);_0x191e91[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x191e91['model'],_0x191e91[_0x0a9e('0x39')]);_0x567193[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x191e91['model'],qs[_0x0a9e('0x3d')](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x567193['attributes']=_0x567193['attributes'][_0x0a9e('0x3e')]?_0x567193[_0x0a9e('0x3c')]:_0x191e91['model'];if(!_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x567193[_0x0a9e('0x29')]=qs['limit'](_0x2b7e7f['query'][_0x0a9e('0x29')]);_0x567193[_0x0a9e('0x28')]=qs['offset'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x28')]);}_0x567193[_0x0a9e('0x41')]=qs['sort'](_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x42')]);_0x567193[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x2b7e7f[_0x0a9e('0x39')],_0x191e91[_0x0a9e('0x3a')]));if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x567193[_0x0a9e('0x43')]=_[_0x0a9e('0x46')](_0x567193[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x1fa90d,function(_0x11ca30){if(_0x11ca30[_0x0a9e('0x48')]['key']!=='VIRTUAL'){var _0x473fdc={};_0x473fdc[_0x11ca30[_0x0a9e('0x49')]]={'$like':'%'+_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x473fdc;}})});}_0x567193=_[_0x0a9e('0x46')]({},_0x567193,_0x2b7e7f[_0x0a9e('0x4a')]);var _0x10b040={'where':_0x567193[_0x0a9e('0x43')]};return db[_0x0a9e('0x37')][_0x0a9e('0x27')](_0x10b040)[_0x0a9e('0x19')](function(_0x35ed4a){_0xd1836d['count']=_0x35ed4a;if(_0x2b7e7f[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x567193[_0x0a9e('0x4c')]=[{'all':!![]}];}return db[_0x0a9e('0x37')][_0x0a9e('0x4d')](_0x567193);})[_0x0a9e('0x19')](function(_0x21eb86){_0xd1836d[_0x0a9e('0x4e')]=_0x21eb86;return _0xd1836d;})['then'](respondWithFilteredResult(_0x3f3d41,_0x567193))[_0x0a9e('0x24')](handleError(_0x3f3d41,null));};exports['show']=function(_0x473dc8,_0x476688){var _0x8d6dd1={'raw':![],'where':{'id':_0x473dc8[_0x0a9e('0x4f')]['id']}},_0x562fb4={};_0x562fb4[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x37')][_0x0a9e('0x51')]);_0x562fb4[_0x0a9e('0x39')]=_[_0x0a9e('0x38')](_0x473dc8['query']);_0x562fb4[_0x0a9e('0x3a')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],_0x562fb4[_0x0a9e('0x39')]);_0x8d6dd1[_0x0a9e('0x3c')]=_[_0x0a9e('0x3b')](_0x562fb4[_0x0a9e('0x50')],qs[_0x0a9e('0x3d')](_0x473dc8[_0x0a9e('0x39')]['fields']));_0x8d6dd1[_0x0a9e('0x3c')]=_0x8d6dd1[_0x0a9e('0x3c')]['length']?_0x8d6dd1['attributes']:_0x562fb4['model'];if(_0x473dc8[_0x0a9e('0x39')][_0x0a9e('0x4b')]){_0x8d6dd1[_0x0a9e('0x4c')]=[{'all':!![]}];}_0x8d6dd1=_[_0x0a9e('0x46')]({},_0x8d6dd1,_0x473dc8[_0x0a9e('0x4a')]);return db[_0x0a9e('0x37')][_0x0a9e('0x52')](_0x8d6dd1)[_0x0a9e('0x19')](handleEntityNotFound(_0x476688,null))['then'](respondWithResult(_0x476688,null))['catch'](handleError(_0x476688,null));};exports['create']=function(_0x39d77d,_0x204173){return db[_0x0a9e('0x37')]['create'](_0x39d77d[_0x0a9e('0x53')],{})[_0x0a9e('0x19')](respondWithResult(_0x204173,0xc9))['catch'](handleError(_0x204173,null));};exports['update']=function(_0x2ef381,_0x59c6ff){if(_0x2ef381[_0x0a9e('0x53')]['id']){delete _0x2ef381['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x52')]({'where':{'id':_0x2ef381[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x59c6ff,null))[_0x0a9e('0x19')](saveUpdates(_0x2ef381[_0x0a9e('0x53')],null))['then'](respondWithResult(_0x59c6ff,null))['catch'](handleError(_0x59c6ff,null));};exports[_0x0a9e('0x30')]=function(_0x3aedd0,_0x49c095){return db[_0x0a9e('0x37')]['find']({'where':{'id':_0x3aedd0[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x49c095,null))[_0x0a9e('0x19')](removeEntity(_0x49c095,null))['catch'](handleError(_0x49c095,null));};exports['getConfigurations']=function(_0x5df0ad,_0x2da03c,_0x47de4c){var _0x2f7092={};var _0x65432={};var _0x3cfd00;var _0x19b4df;return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x5df0ad[_0x0a9e('0x4f')]['id']}})[_0x0a9e('0x19')](handleEntityNotFound(_0x2da03c,null))['then'](function(_0x1c693e){if(_0x1c693e){_0x3cfd00=_0x1c693e;_0x65432[_0x0a9e('0x50')]=_[_0x0a9e('0x38')](db[_0x0a9e('0x55')][_0x0a9e('0x51')]);_0x65432[_0x0a9e('0x39')]=_['keys'](_0x5df0ad[_0x0a9e('0x39')]);_0x65432[_0x0a9e('0x3a')]=_['intersection'](_0x65432[_0x0a9e('0x50')],_0x65432['query']);_0x2f7092[_0x0a9e('0x3c')]=_['intersection'](_0x65432['model'],qs['fields'](_0x5df0ad[_0x0a9e('0x39')]['fields']));_0x2f7092[_0x0a9e('0x3c')]=_0x2f7092[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x2f7092[_0x0a9e('0x3c')]:_0x65432[_0x0a9e('0x50')];_0x2f7092[_0x0a9e('0x41')]=qs['sort'](_0x5df0ad[_0x0a9e('0x39')]['sort']);_0x2f7092[_0x0a9e('0x43')]=qs[_0x0a9e('0x3a')](_[_0x0a9e('0x44')](_0x5df0ad['query'],_0x65432[_0x0a9e('0x3a')]));if(_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]){_0x2f7092[_0x0a9e('0x43')]=_['merge'](_0x2f7092[_0x0a9e('0x43')],{'$or':_[_0x0a9e('0x47')](_0x2f7092['attributes'],function(_0x797b45){var _0x17e88c={};_0x17e88c[_0x797b45]={'$like':'%'+_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x45')]+'%'};return _0x17e88c;})});}_0x2f7092=_[_0x0a9e('0x46')]({},_0x2f7092,_0x5df0ad['options']);return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x281c7d){if(_0x281c7d){_0x19b4df=_0x281c7d['length'];if(!_0x5df0ad[_0x0a9e('0x39')]['hasOwnProperty']('nolimit')){_0x2f7092[_0x0a9e('0x29')]=qs[_0x0a9e('0x29')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x29')]);_0x2f7092[_0x0a9e('0x28')]=qs[_0x0a9e('0x28')](_0x5df0ad[_0x0a9e('0x39')][_0x0a9e('0x28')]);}return _0x3cfd00[_0x0a9e('0x56')](_0x2f7092);}})[_0x0a9e('0x19')](function(_0x2e89b7){if(_0x2e89b7){return _0x2e89b7?{'count':_0x19b4df,'rows':_0x2e89b7}:null;}})[_0x0a9e('0x19')](respondWithResult(_0x2da03c,null))[_0x0a9e('0x24')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x57')]=function(_0x320898,_0x412a72,_0x2a28c0){if(_0x320898[_0x0a9e('0x53')]['id']){delete _0x320898['body']['id'];}return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x320898[_0x0a9e('0x4f')]['id']}})['then'](handleEntityNotFound(_0x412a72,null))[_0x0a9e('0x19')](function(_0x30944e){if(_0x30944e){_0x320898['body'][_0x0a9e('0x58')]=_0x30944e['id'];_0x320898[_0x0a9e('0x53')][_0x0a9e('0x59')]=integrations[_0x0a9e('0x5a')](_0x320898[_0x0a9e('0x53')]['channel'],_0x320898['body']['type']);_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5b')]=integrations[_0x0a9e('0x5c')](_0x320898[_0x0a9e('0x53')][_0x0a9e('0x5d')],_0x320898[_0x0a9e('0x53')][_0x0a9e('0x48')]);return db[_0x0a9e('0x55')]['create'](_0x320898[_0x0a9e('0x53')],{'include':[{'model':db[_0x0a9e('0x5e')],'as':_0x0a9e('0x59')},{'model':db['DeskField'],'as':_0x0a9e('0x5b')}]});}return null;})['then'](respondWithResult(_0x412a72,null))[_0x0a9e('0x24')](handleError(_0x412a72,null));};exports[_0x0a9e('0x5f')]=function(_0x4c46c1,_0x2ed01e,_0x75912a){var _0x2cc7a7=[{'name':_0x0a9e('0x60'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1d442c='';return db[_0x0a9e('0x37')][_0x0a9e('0x54')]({'where':{'id':_0x4c46c1[_0x0a9e('0x4f')]['id']},'attributes':['id','remoteUri',_0x0a9e('0x61'),_0x0a9e('0x62'),_0x0a9e('0x63'),_0x0a9e('0x64'),'consumerSecret',_0x0a9e('0x65'),_0x0a9e('0x66')]})[_0x0a9e('0x19')](handleEntityNotFound(_0x2ed01e,null))[_0x0a9e('0x19')](function(_0x332367){if(_0x332367){_0x1d442c=_0x332367[_0x0a9e('0x67')];var _0x40fc56=_0x1d442c[_0x0a9e('0x68')](-0x1);if(_0x40fc56==='/'){_0x1d442c=_0x1d442c[_0x0a9e('0x69')](0x0,_0x1d442c[_0x0a9e('0x6a')](_0x40fc56));}var _0xc4c230={'method':_0x0a9e('0x6b'),'uri':util[_0x0a9e('0x6c')](_0x0a9e('0x6d'),_0x1d442c),'headers':{'Content-Type':'application/json','Accept':_0x0a9e('0x6e')},'json':!![]};if(_0x332367[_0x0a9e('0x61')]===_0x0a9e('0x6f')){_0xc4c230['headers'][_0x0a9e('0x70')]=util[_0x0a9e('0x6c')](_0x0a9e('0x71'),new Buffer(util[_0x0a9e('0x6c')]('%s:%s',_0x332367['username'],_0x332367[_0x0a9e('0x63')]))[_0x0a9e('0x72')]('base64'));}return rp(_0xc4c230)[_0x0a9e('0x19')](function(_0x53a6a1){return _0x2cc7a7[_0x0a9e('0x73')](_[_0x0a9e('0x47')](_0x53a6a1['_embedded'][_0x0a9e('0x74')],function(_0x41cf12){return{'id':_0x41cf12[_0x0a9e('0x34')],'name':_0x41cf12[_0x0a9e('0x34')],'type':_0x41cf12[_0x0a9e('0x48')],'active':_0x41cf12[_0x0a9e('0x75')],'label':_0x41cf12[_0x0a9e('0x76')],'custom':!![]};}));});}})['then'](function(_0x2973d3){return{'count':_0x2973d3[_0x0a9e('0x3e')],'rows':_0x2973d3};})[_0x0a9e('0x19')](respondWithResult(_0x2ed01e,null))[_0x0a9e('0x24')](function(_0x492543){var _0xf51744=_0x4c46c1[_0x0a9e('0x39')]['test']?0x1f4:_0x492543[_0x0a9e('0x77')]||0x1f4;logger['error'](_0x0a9e('0x78'),_0x0a9e('0x5f'),_0xf51744,JSON[_0x0a9e('0x1e')](_0x492543));delete _0x492543[_0x0a9e('0x34')];if(_0xf51744===0x191){_0xf51744=0x190;}_0x2ed01e['status'](_0xf51744)['send'](_0x4c46c1[_0x0a9e('0x39')][_0x0a9e('0x17')]?{'message':_0x0a9e('0x79'),'statusCode':_0x492543['statusCode']}:_0x492543);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 99fa8ad..a1436d0 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 _0xb43b=['DeskAccount','int_desk_accounts','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskAccount.attributes','define'];(function(_0x2ffaf9,_0x3c571a){var _0x30200f=function(_0x1398ee){while(--_0x1398ee){_0x2ffaf9['push'](_0x2ffaf9['shift']());}};_0x30200f(++_0x3c571a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x529294,_0x54a349){_0x529294=_0x529294-0x0;var _0x1fe94c=_0xb43b[_0x529294];return _0x1fe94c;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x378df5,_0x553520){return _0x378df5[_0xbb43('0x9')](_0xbb43('0xa'),attributes,{'tableName':_0xbb43('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util'];(function(_0x3be075,_0x50d5b0){var _0xbe567b=function(_0x26eb2c){while(--_0x26eb2c){_0x3be075['push'](_0x3be075['shift']());}};_0xbe567b(++_0x50d5b0);}(_0xe706,0xa3));var _0x6e70=function(_0x13d153,_0x3edda1){_0x13d153=_0x13d153-0x0;var _0x508a08=_0xe706[_0x13d153];return _0x508a08;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 5d7330e..c51600f 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 _0x1a85=['info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','options','raw','where','limit','include','model','map','attributes','then','ShowDeskAccount','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1a85,0x178));var _0x51a8=function(_0x131acf,_0x4b4597){_0x131acf=_0x131acf-0x0;var _0x40d32e=_0x1a85[_0x131acf];return _0x40d32e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('DeskAccount,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['findAll']({'raw':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x16')]===undefined?!![]:![]:!![],'where':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x17')]||null:null,'attributes':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')]['attributes']||null:null,'limit':_0x45a433[_0x51a8('0x15')]?_0x45a433['options'][_0x51a8('0x18')]||null:null,'include':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x19')]?_['map'](_0x45a433[_0x51a8('0x15')]['include'],function(_0x47f063){return{'model':db[_0x47f063[_0x51a8('0x1a')]],'as':_0x47f063['as'],'attributes':_0x47f063['attributes'],'include':_0x47f063[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x47f063[_0x51a8('0x19')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1a')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1a')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x1c150d){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger[_0x51a8('0xb')](_0x51a8('0x13'),_0x45a433,JSON[_0x51a8('0xd')](_0x1c150d));_0x23539e(_0x1c150d);})[_0x51a8('0x12')](function(_0x347a02){logger['error'](_0x51a8('0x13'),_0x347a02['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x347a02[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1e')]=function(_0x41df56){var _0x2136b4=this;return new Promise(function(_0x4ea271,_0x10c19b){return db['DeskAccount'][_0x51a8('0x1f')]({'raw':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x17')]||null:null,'attributes':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')][_0x51a8('0x1c')]||null:null,'include':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x19')]?_['map'](_0x41df56[_0x51a8('0x15')][_0x51a8('0x19')],function(_0x41561a){return{'model':db[_0x41561a['model']],'as':_0x41561a['as'],'attributes':_0x41561a[_0x51a8('0x1c')],'include':_0x41561a[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x41561a[_0x51a8('0x19')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1b')](_0x41c020[_0x51a8('0x19')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1a')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes']};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x38aa25){logger[_0x51a8('0x8')](_0x51a8('0x1e'),_0x41df56);logger[_0x51a8('0xb')](_0x51a8('0x1e'),_0x41df56,JSON['stringify'](_0x38aa25));_0x4ea271(_0x38aa25);})['catch'](function(_0x377b4c){logger['error']('ShowDeskAccount',_0x377b4c['message'],_0x41df56);_0x10c19b(_0x2136b4[_0x51a8('0xe')](0x1f4,_0x377b4c[_0x51a8('0x10')]));});});}; \ No newline at end of file +var _0x1c3d=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowDeskAccount','find','where','util','moment','bluebird','randomstring'];(function(_0x907ab1,_0x3735cb){var _0x17ed79=function(_0x36d0c2){while(--_0x36d0c2){_0x907ab1['push'](_0x907ab1['shift']());}};_0x17ed79(++_0x3735cb);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x4d4c63,_0x33ac30){_0x4d4c63=_0x4d4c63-0x0;var _0x383b63=_0x1c3d[_0x4d4c63];return _0x383b63;};'use strict';var _=require('lodash');var util=require(_0xd1c3('0x0'));var moment=require(_0xd1c3('0x1'));var BPromise=require(_0xd1c3('0x2'));var rs=require(_0xd1c3('0x3'));var fs=require('fs');var Redis=require(_0xd1c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd1c3('0x5'))(_0xd1c3('0x6'));var config=require(_0xd1c3('0x7'));var jayson=require(_0xd1c3('0x8'));var client=jayson[_0xd1c3('0x9')][_0xd1c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5adcb7,_0x398766,_0x420ab0){return new BPromise(function(_0x5db2f0,_0x1afc71){return client[_0xd1c3('0xb')](_0x5adcb7,_0x420ab0)[_0xd1c3('0xc')](function(_0x18556c){logger[_0xd1c3('0xd')]('DeskAccount,\x20%s,\x20%s',_0x398766,'request\x20sent');logger[_0xd1c3('0xe')](_0xd1c3('0xf'),_0x398766,_0xd1c3('0x10'),JSON[_0xd1c3('0x11')](_0x18556c));if(_0x18556c[_0xd1c3('0x12')]){if(_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x13')]===0x1f4){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x18556c['error'][_0xd1c3('0x15')]);return _0x1afc71(_0x18556c['error']['message']);}logger[_0xd1c3('0x12')]('DeskAccount,\x20%s,\x20%s',_0x398766,_0x18556c[_0xd1c3('0x12')][_0xd1c3('0x15')]);return _0x5db2f0(_0x18556c[_0xd1c3('0x12')]['message']);}else{logger[_0xd1c3('0xd')](_0xd1c3('0x14'),_0x398766,_0xd1c3('0x10'));_0x5db2f0(_0x18556c[_0xd1c3('0x16')][_0xd1c3('0x15')]);}})[_0xd1c3('0x17')](function(_0x586fa7){logger[_0xd1c3('0x12')](_0xd1c3('0x14'),_0x398766,_0x586fa7);_0x1afc71(_0x586fa7);});});}exports[_0xd1c3('0x18')]=function(_0x5d26c2){var _0x53a5e1=this;return new Promise(function(_0x14f6cb,_0x3a1a74){return db[_0xd1c3('0x19')][_0xd1c3('0x1a')]({'raw':_0x5d26c2[_0xd1c3('0x1b')]?_0x5d26c2['options'][_0xd1c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d26c2[_0xd1c3('0x1b')]?_0x5d26c2[_0xd1c3('0x1b')]['where']||null:null,'attributes':_0x5d26c2['options']?_0x5d26c2[_0xd1c3('0x1b')][_0xd1c3('0x1d')]||null:null,'limit':_0x5d26c2['options']?_0x5d26c2['options'][_0xd1c3('0x1e')]||null:null,'include':_0x5d26c2[_0xd1c3('0x1b')]?_0x5d26c2[_0xd1c3('0x1b')][_0xd1c3('0x1f')]?_[_0xd1c3('0x20')](_0x5d26c2[_0xd1c3('0x1b')][_0xd1c3('0x1f')],function(_0xaa7580){return{'model':db[_0xaa7580[_0xd1c3('0x21')]],'as':_0xaa7580['as'],'attributes':_0xaa7580[_0xd1c3('0x1d')],'include':_0xaa7580['include']?_['map'](_0xaa7580[_0xd1c3('0x1f')],function(_0x261323){return{'model':db[_0x261323[_0xd1c3('0x21')]],'as':_0x261323['as'],'attributes':_0x261323[_0xd1c3('0x1d')],'include':_0x261323['include']?_[_0xd1c3('0x20')](_0x261323[_0xd1c3('0x1f')],function(_0x54fd33){return{'model':db[_0x54fd33[_0xd1c3('0x21')]],'as':_0x54fd33['as'],'attributes':_0x54fd33[_0xd1c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1c3('0xc')](function(_0x173cb9){logger[_0xd1c3('0xd')](_0xd1c3('0x18'),_0x5d26c2);logger[_0xd1c3('0xe')]('GetDeskAccount',_0x5d26c2,JSON['stringify'](_0x173cb9));_0x14f6cb(_0x173cb9);})[_0xd1c3('0x17')](function(_0x3eabca){logger[_0xd1c3('0x12')](_0xd1c3('0x18'),_0x3eabca[_0xd1c3('0x15')],_0x5d26c2);_0x3a1a74(_0x53a5e1['error'](0x1f4,_0x3eabca[_0xd1c3('0x15')]));});});};exports[_0xd1c3('0x22')]=function(_0x5ce257){var _0x102e34=this;return new Promise(function(_0x5a7cdb,_0x1eefc2){return db[_0xd1c3('0x19')][_0xd1c3('0x23')]({'raw':_0x5ce257[_0xd1c3('0x1b')]?_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ce257[_0xd1c3('0x1b')]?_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x24')]||null:null,'attributes':_0x5ce257['options']?_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x1d')]||null:null,'include':_0x5ce257['options']?_0x5ce257[_0xd1c3('0x1b')]['include']?_[_0xd1c3('0x20')](_0x5ce257[_0xd1c3('0x1b')][_0xd1c3('0x1f')],function(_0x4ba6f0){return{'model':db[_0x4ba6f0[_0xd1c3('0x21')]],'as':_0x4ba6f0['as'],'attributes':_0x4ba6f0[_0xd1c3('0x1d')],'include':_0x4ba6f0[_0xd1c3('0x1f')]?_[_0xd1c3('0x20')](_0x4ba6f0[_0xd1c3('0x1f')],function(_0x1da9bf){return{'model':db[_0x1da9bf[_0xd1c3('0x21')]],'as':_0x1da9bf['as'],'attributes':_0x1da9bf[_0xd1c3('0x1d')],'include':_0x1da9bf[_0xd1c3('0x1f')]?_['map'](_0x1da9bf['include'],function(_0x3e5bcb){return{'model':db[_0x3e5bcb['model']],'as':_0x3e5bcb['as'],'attributes':_0x3e5bcb[_0xd1c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd1c3('0xc')](function(_0x1fd559){logger[_0xd1c3('0xd')](_0xd1c3('0x22'),_0x5ce257);logger[_0xd1c3('0xe')]('ShowDeskAccount',_0x5ce257,JSON[_0xd1c3('0x11')](_0x1fd559));_0x5a7cdb(_0x1fd559);})['catch'](function(_0x424918){logger['error'](_0xd1c3('0x22'),_0x424918['message'],_0x5ce257);_0x1eefc2(_0x102e34['error'](0x1f4,_0x424918[_0xd1c3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 352598a..f896864 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 _0xb3b3=['isAuthenticated','index','/:id','show','get','/:id/fields','getSubjects','getDescriptions','/:id/tags','getTags','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','./intDeskConfiguration.controller'];(function(_0x5f5495,_0x30d087){var _0x14d8a3=function(_0x40e773){while(--_0x40e773){_0x5f5495['push'](_0x5f5495['shift']());}};_0x14d8a3(++_0x30d087);}(_0xb3b3,0x6d));var _0x3b3b=function(_0x6719af,_0x27be3e){_0x6719af=_0x6719af-0x0;var _0x4e35c8=_0xb3b3[_0x6719af];return _0x4e35c8;};'use strict';var multer=require('multer');var util=require(_0x3b3b('0x0'));var path=require('path');var timeout=require(_0x3b3b('0x1'));var express=require(_0x3b3b('0x2'));var router=express[_0x3b3b('0x3')]();var auth=require(_0x3b3b('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3b3b('0x5'));router['get']('/',auth[_0x3b3b('0x6')](),controller[_0x3b3b('0x7')]);router['get'](_0x3b3b('0x8'),auth[_0x3b3b('0x6')](),controller[_0x3b3b('0x9')]);router[_0x3b3b('0xa')](_0x3b3b('0xb'),auth[_0x3b3b('0x6')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x3b3b('0x6')](),controller[_0x3b3b('0xc')]);router[_0x3b3b('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3b3b('0xd')]);router['get'](_0x3b3b('0xe'),auth[_0x3b3b('0x6')](),controller[_0x3b3b('0xf')]);router[_0x3b3b('0x10')]('/',auth['isAuthenticated'](),controller[_0x3b3b('0x11')]);router['post'](_0x3b3b('0xe'),auth[_0x3b3b('0x6')](),controller['setTags']);router[_0x3b3b('0x12')](_0x3b3b('0x8'),auth['isAuthenticated'](),controller[_0x3b3b('0x13')]);router[_0x3b3b('0x14')](_0x3b3b('0x8'),auth[_0x3b3b('0x6')](),controller[_0x3b3b('0x15')]);module[_0x3b3b('0x16')]=router; \ No newline at end of file +var _0xd018=['getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','put','/:id','delete','exports','multer','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id/fields'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xd018,0x114));var _0x8d01=function(_0x4111a0,_0x171f56){_0x4111a0=_0x4111a0-0x0;var _0x5011a3=_0xd018[_0x4111a0];return _0x5011a3;};'use strict';var multer=require(_0x8d01('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8d01('0x1')]();var auth=require(_0x8d01('0x2'));var interaction=require(_0x8d01('0x3'));var config=require(_0x8d01('0x4'));var controller=require(_0x8d01('0x5'));router['get']('/',auth[_0x8d01('0x6')](),controller[_0x8d01('0x7')]);router[_0x8d01('0x8')]('/:id',auth[_0x8d01('0x6')](),controller['show']);router[_0x8d01('0x8')](_0x8d01('0x9'),auth[_0x8d01('0x6')](),controller[_0x8d01('0xa')]);router[_0x8d01('0x8')](_0x8d01('0xb'),auth[_0x8d01('0x6')](),controller[_0x8d01('0xc')]);router[_0x8d01('0x8')]('/:id/descriptions',auth[_0x8d01('0x6')](),controller[_0x8d01('0xd')]);router[_0x8d01('0x8')](_0x8d01('0xe'),auth[_0x8d01('0x6')](),controller[_0x8d01('0xf')]);router[_0x8d01('0x10')]('/',auth[_0x8d01('0x6')](),controller[_0x8d01('0x11')]);router[_0x8d01('0x10')](_0x8d01('0xe'),auth[_0x8d01('0x6')](),controller['setTags']);router[_0x8d01('0x12')](_0x8d01('0x13'),auth[_0x8d01('0x6')](),controller['update']);router[_0x8d01('0x14')](_0x8d01('0x13'),auth[_0x8d01('0x6')](),controller['destroy']);module[_0x8d01('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 c96b0e1..803b9bc 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 _0x7ebd=['sequelize','STRING'];(function(_0x5330b7,_0xd242d4){var _0x520a2e=function(_0x10fbc8){while(--_0x10fbc8){_0x5330b7['push'](_0x5330b7['shift']());}};_0x520a2e(++_0xd242d4);}(_0x7ebd,0x170));var _0xd7eb=function(_0x10b743,_0x29bf0d){_0x10b743=_0x10b743-0x0;var _0x2e4595=_0x7ebd[_0x10b743];return _0x2e4595;};'use strict';var Sequelize=require(_0xd7eb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd7eb('0x1')]},'description':{'type':Sequelize[_0xd7eb('0x1')]}}; \ No newline at end of file +var _0xec63=['exports','STRING','sequelize'];(function(_0x5c6299,_0x11bd28){var _0x23b564=function(_0x329ed6){while(--_0x329ed6){_0x5c6299['push'](_0x5c6299['shift']());}};_0x23b564(++_0x11bd28);}(_0xec63,0xbf));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x3ec6('0x0'));module[_0x3ec6('0x1')]={'name':{'type':Sequelize[_0x3ec6('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 40cfbab..05d677f 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 _0xdaf7=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','name','send','DeskConfiguration','rawAttributes','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','destroy','getFields','keys','DeskField','map','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','html-pdf'];(function(_0x3fdb67,_0x5d1a0b){var _0xd1746c=function(_0x4ba3b4){while(--_0x4ba3b4){_0x3fdb67['push'](_0x3fdb67['shift']());}};_0xd1746c(++_0x5d1a0b);}(_0xdaf7,0xb1));var _0x7daf=function(_0x3364a2,_0x2d24d3){_0x3364a2=_0x3364a2-0x0;var _0x5a4323=_0xdaf7[_0x3364a2];return _0x5a4323;};'use strict';var pdf=require(_0x7daf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7daf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7daf('0x2'));var rp=require(_0x7daf('0x3'));var moment=require(_0x7daf('0x4'));var BPromise=require(_0x7daf('0x5'));var Mustache=require(_0x7daf('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7daf('0x7'));var csv=require('to-csv');var ejs=require(_0x7daf('0x8'));var fs=require('fs');var _=require(_0x7daf('0x9'));var squel=require('squel');var crypto=require(_0x7daf('0xa'));var jsforce=require(_0x7daf('0xb'));var deskjs=require(_0x7daf('0xc'));var toCsv=require(_0x7daf('0xd'));var querystring=require(_0x7daf('0xe'));var Papa=require('papaparse');var Redis=require(_0x7daf('0xf'));var authService=require(_0x7daf('0x10'));var qs=require(_0x7daf('0x11'));var hardwareService=require(_0x7daf('0x12'));var logger=require('../../config/logger')(_0x7daf('0x13'));var utils=require(_0x7daf('0x14'));var config=require('../../config/environment');var db=require(_0x7daf('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7daf('0x16')][_0x7daf('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5a764e,_0x59cfe0,_0x262756){if(_0x262756){var _0x25b466=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25b466[_0x7daf('0x18')](_0x59cfe0)){return _0x5a764e;}else{throw new Error(_0x7daf('0x19'));}}else{return _0x5a764e;}}function respondWithRpcPromise(_0x32f56e,_0x290253,_0x1ab30b,_0x18591c){return new BPromise(function(_0x5ae485,_0x2aefc4){var _0x48f163=_0x18591c||client;return _0x48f163['request'](_0x32f56e,_0x1ab30b)[_0x7daf('0x1a')](function(_0x101946){logger['info'](_0x7daf('0x1b'),_0x290253,_0x7daf('0x1c'));logger[_0x7daf('0x1d')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x290253,_0x7daf('0x1c'),JSON[_0x7daf('0x1e')](_0x101946));if(_0x101946[_0x7daf('0x1f')]){if(_0x101946[_0x7daf('0x1f')][_0x7daf('0x20')]===0x1f4){logger[_0x7daf('0x1f')](_0x7daf('0x1b'),_0x290253,_0x101946[_0x7daf('0x1f')][_0x7daf('0x21')]);return _0x2aefc4(_0x101946[_0x7daf('0x1f')][_0x7daf('0x21')]);}logger[_0x7daf('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x290253,_0x101946['error'][_0x7daf('0x21')]);return _0x5ae485(_0x101946[_0x7daf('0x1f')][_0x7daf('0x21')]);}else{logger[_0x7daf('0x22')](_0x7daf('0x1b'),_0x290253,'request\x20sent');_0x5ae485(_0x101946[_0x7daf('0x23')][_0x7daf('0x21')]);}})['catch'](function(_0xeb1c9c){logger[_0x7daf('0x1f')]('DeskConfiguration,\x20%s,\x20%s',_0x290253,_0xeb1c9c);_0x2aefc4(_0xeb1c9c);});});}function respondWithStatusCode(_0xbc1279,_0x4db526){_0x4db526=_0x4db526||0xcc;return function(_0x5a1cea){if(_0x5a1cea){return _0xbc1279[_0x7daf('0x24')](_0x4db526);}return _0xbc1279[_0x7daf('0x25')](_0x4db526)[_0x7daf('0x26')]();};}function respondWithResult(_0x2d32ec,_0x5ac516){_0x5ac516=_0x5ac516||0xc8;return function(_0x4f9466){if(_0x4f9466){return _0x2d32ec['status'](_0x5ac516)[_0x7daf('0x27')](_0x4f9466);}};}function respondWithFilteredResult(_0x45ad89,_0x2dca13){return function(_0x48c83e){if(_0x48c83e){var _0x54cfb8=_0x48c83e[_0x7daf('0x28')],_0x30cca8=_0x2dca13[_0x7daf('0x29')],_0x2c117e=_0x2dca13[_0x7daf('0x29')]+_0x2dca13[_0x7daf('0x2a')],_0x567fc0;if(_0x2c117e>=_0x54cfb8){_0x2c117e=_0x54cfb8;_0x567fc0=0xc8;}else{_0x567fc0=0xce;}_0x45ad89[_0x7daf('0x25')](_0x567fc0);return _0x45ad89['set'](_0x7daf('0x2b'),_0x30cca8+'-'+_0x2c117e+'/'+_0x54cfb8)[_0x7daf('0x27')](_0x48c83e);}return null;};}function patchUpdates(_0x2f00e3){return function(_0x4e2dd8){try{jsonpatch[_0x7daf('0x2c')](_0x4e2dd8,_0x2f00e3,!![]);}catch(_0x512d34){return BPromise['reject'](_0x512d34);}return _0x4e2dd8[_0x7daf('0x2d')]();};}function saveUpdates(_0x457c5f,_0x2967f0){return function(_0x1a37b7){if(_0x1a37b7){return _0x1a37b7[_0x7daf('0x2e')](_0x457c5f)[_0x7daf('0x1a')](function(_0x1780af){return _0x1780af;});}return null;};}function removeEntity(_0x3490e3,_0x26e7dc){return function(_0x1a4955){if(_0x1a4955){return _0x1a4955['destroy']()[_0x7daf('0x1a')](function(){_0x3490e3[_0x7daf('0x25')](0xcc)[_0x7daf('0x26')]();});}};}function handleEntityNotFound(_0x327c93,_0x1dd02b){return function(_0x131f7c){if(!_0x131f7c){_0x327c93[_0x7daf('0x24')](0x194);}return _0x131f7c;};}function handleError(_0xa68d0f,_0x55830a){_0x55830a=_0x55830a||0x1f4;return function(_0x1286e6){logger[_0x7daf('0x1f')](_0x1286e6['stack']);if(_0x1286e6[_0x7daf('0x2f')]){delete _0x1286e6[_0x7daf('0x2f')];}_0xa68d0f[_0x7daf('0x25')](_0x55830a)[_0x7daf('0x30')](_0x1286e6);};}exports['index']=function(_0x59ac5d,_0x237f80){var _0x2c51b2={},_0x20a7bb={},_0x2981dd={'count':0x0,'rows':[]};var _0x231132=db[_0x7daf('0x31')][_0x7daf('0x32')];_0x20a7bb[_0x7daf('0x33')]=_['keys'](_0x231132);_0x20a7bb['query']=_['keys'](_0x59ac5d[_0x7daf('0x34')]);_0x20a7bb[_0x7daf('0x35')]=_['intersection'](_0x20a7bb[_0x7daf('0x33')],_0x20a7bb[_0x7daf('0x34')]);_0x2c51b2[_0x7daf('0x36')]=_[_0x7daf('0x37')](_0x20a7bb['model'],qs[_0x7daf('0x38')](_0x59ac5d['query'][_0x7daf('0x38')]));_0x2c51b2[_0x7daf('0x36')]=_0x2c51b2[_0x7daf('0x36')][_0x7daf('0x39')]?_0x2c51b2[_0x7daf('0x36')]:_0x20a7bb['model'];if(!_0x59ac5d[_0x7daf('0x34')]['hasOwnProperty'](_0x7daf('0x3a'))){_0x2c51b2[_0x7daf('0x2a')]=qs[_0x7daf('0x2a')](_0x59ac5d[_0x7daf('0x34')][_0x7daf('0x2a')]);_0x2c51b2[_0x7daf('0x29')]=qs[_0x7daf('0x29')](_0x59ac5d[_0x7daf('0x34')]['offset']);}_0x2c51b2[_0x7daf('0x3b')]=qs[_0x7daf('0x3c')](_0x59ac5d[_0x7daf('0x34')][_0x7daf('0x3c')]);_0x2c51b2[_0x7daf('0x3d')]=qs[_0x7daf('0x35')](_[_0x7daf('0x3e')](_0x59ac5d[_0x7daf('0x34')],_0x20a7bb['filters']));if(_0x59ac5d[_0x7daf('0x34')][_0x7daf('0x3f')]){_0x2c51b2['where']=_[_0x7daf('0x40')](_0x2c51b2['where'],{'$or':_['map'](_0x231132,function(_0x154b85){if(_0x154b85[_0x7daf('0x41')][_0x7daf('0x42')]!==_0x7daf('0x43')){var _0x154101={};_0x154101[_0x154b85['field']]={'$like':'%'+_0x59ac5d['query'][_0x7daf('0x3f')]+'%'};return _0x154101;}})});}_0x2c51b2=_[_0x7daf('0x40')]({},_0x2c51b2,_0x59ac5d[_0x7daf('0x44')]);var _0x3934ac={'where':_0x2c51b2[_0x7daf('0x3d')]};return db[_0x7daf('0x31')]['count'](_0x3934ac)['then'](function(_0x69e2e9){_0x2981dd[_0x7daf('0x28')]=_0x69e2e9;if(_0x59ac5d['query'][_0x7daf('0x45')]){_0x2c51b2[_0x7daf('0x46')]=[{'all':!![]}];}return db[_0x7daf('0x31')][_0x7daf('0x47')](_0x2c51b2);})[_0x7daf('0x1a')](function(_0x5b89e9){_0x2981dd['rows']=_0x5b89e9;return _0x2981dd;})[_0x7daf('0x1a')](respondWithFilteredResult(_0x237f80,_0x2c51b2))[_0x7daf('0x48')](handleError(_0x237f80,null));};exports['show']=function(_0x535376,_0x198468){var _0x33a968={'raw':![],'where':{'id':_0x535376[_0x7daf('0x49')]['id']}},_0x342b13={};_0x342b13[_0x7daf('0x33')]=_['keys'](db['DeskConfiguration'][_0x7daf('0x32')]);_0x342b13[_0x7daf('0x34')]=_['keys'](_0x535376['query']);_0x342b13[_0x7daf('0x35')]=_[_0x7daf('0x37')](_0x342b13[_0x7daf('0x33')],_0x342b13['query']);_0x33a968[_0x7daf('0x36')]=_['intersection'](_0x342b13[_0x7daf('0x33')],qs[_0x7daf('0x38')](_0x535376['query'][_0x7daf('0x38')]));_0x33a968[_0x7daf('0x36')]=_0x33a968[_0x7daf('0x36')][_0x7daf('0x39')]?_0x33a968['attributes']:_0x342b13['model'];if(_0x535376['query']['includeAll']){_0x33a968[_0x7daf('0x46')]=[{'all':!![]}];}_0x33a968=_['merge']({},_0x33a968,_0x535376[_0x7daf('0x44')]);return db[_0x7daf('0x31')][_0x7daf('0x4a')](_0x33a968)[_0x7daf('0x1a')](handleEntityNotFound(_0x198468,null))[_0x7daf('0x1a')](respondWithResult(_0x198468,null))[_0x7daf('0x48')](handleError(_0x198468,null));};exports[_0x7daf('0x4b')]=function(_0x57683a,_0xc0a413){return db[_0x7daf('0x31')]['create'](_0x57683a['body'],{})[_0x7daf('0x1a')](respondWithResult(_0xc0a413,0xc9))['catch'](handleError(_0xc0a413,null));};exports[_0x7daf('0x2e')]=function(_0x343558,_0x26c54f){if(_0x343558[_0x7daf('0x4c')]['id']){delete _0x343558[_0x7daf('0x4c')]['id'];}return db[_0x7daf('0x31')][_0x7daf('0x4a')]({'where':{'id':_0x343558[_0x7daf('0x49')]['id']}})['then'](handleEntityNotFound(_0x26c54f,null))['then'](saveUpdates(_0x343558[_0x7daf('0x4c')],null))[_0x7daf('0x1a')](respondWithResult(_0x26c54f,null))['catch'](handleError(_0x26c54f,null));};exports[_0x7daf('0x4d')]=function(_0x5126dc,_0x3ab127){return db['DeskConfiguration']['find']({'where':{'id':_0x5126dc[_0x7daf('0x49')]['id']}})[_0x7daf('0x1a')](handleEntityNotFound(_0x3ab127,null))[_0x7daf('0x1a')](removeEntity(_0x3ab127,null))[_0x7daf('0x48')](handleError(_0x3ab127,null));};exports[_0x7daf('0x4e')]=function(_0x54b502,_0x3241a6,_0x3b13a7){var _0x5375de={};var _0x5c3fa5={};var _0x4c9f35;var _0x68179d;return db[_0x7daf('0x31')]['findOne']({'where':{'id':_0x54b502['params']['id']}})[_0x7daf('0x1a')](handleEntityNotFound(_0x3241a6,null))[_0x7daf('0x1a')](function(_0x4ced98){if(_0x4ced98){_0x4c9f35=_0x4ced98;_0x5c3fa5[_0x7daf('0x33')]=_[_0x7daf('0x4f')](db[_0x7daf('0x50')]['rawAttributes']);_0x5c3fa5[_0x7daf('0x34')]=_[_0x7daf('0x4f')](_0x54b502[_0x7daf('0x34')]);_0x5c3fa5[_0x7daf('0x35')]=_[_0x7daf('0x37')](_0x5c3fa5['model'],_0x5c3fa5[_0x7daf('0x34')]);_0x5375de['attributes']=_['intersection'](_0x5c3fa5['model'],qs[_0x7daf('0x38')](_0x54b502['query'][_0x7daf('0x38')]));_0x5375de[_0x7daf('0x36')]=_0x5375de[_0x7daf('0x36')][_0x7daf('0x39')]?_0x5375de['attributes']:_0x5c3fa5['model'];_0x5375de[_0x7daf('0x3b')]=qs[_0x7daf('0x3c')](_0x54b502['query'][_0x7daf('0x3c')]);_0x5375de['where']=qs[_0x7daf('0x35')](_['pick'](_0x54b502[_0x7daf('0x34')],_0x5c3fa5[_0x7daf('0x35')]));if(_0x54b502[_0x7daf('0x34')][_0x7daf('0x3f')]){_0x5375de['where']=_[_0x7daf('0x40')](_0x5375de[_0x7daf('0x3d')],{'$or':_[_0x7daf('0x51')](_0x5375de[_0x7daf('0x36')],function(_0x247c64){var _0x573c77={};_0x573c77[_0x247c64]={'$like':'%'+_0x54b502[_0x7daf('0x34')][_0x7daf('0x3f')]+'%'};return _0x573c77;})});}_0x5375de=_[_0x7daf('0x40')]({},_0x5375de,_0x54b502['options']);return _0x4c9f35['getFields'](_0x5375de);}})[_0x7daf('0x1a')](function(_0x2ce015){if(_0x2ce015){_0x68179d=_0x2ce015[_0x7daf('0x39')];if(!_0x54b502[_0x7daf('0x34')][_0x7daf('0x52')](_0x7daf('0x3a'))){_0x5375de['limit']=qs['limit'](_0x54b502[_0x7daf('0x34')][_0x7daf('0x2a')]);_0x5375de['offset']=qs[_0x7daf('0x29')](_0x54b502[_0x7daf('0x34')][_0x7daf('0x29')]);}return _0x4c9f35[_0x7daf('0x4e')](_0x5375de);}})['then'](function(_0x1d4c2f){if(_0x1d4c2f){return _0x1d4c2f?{'count':_0x68179d,'rows':_0x1d4c2f}:null;}})[_0x7daf('0x1a')](respondWithResult(_0x3241a6,null))[_0x7daf('0x48')](handleError(_0x3241a6,null));};exports[_0x7daf('0x53')]=function(_0x1c85ce,_0x434c57,_0x4a5de7){var _0x13177e={};var _0x242a40={};var _0x4ade7f;var _0x5b2da2;return db['DeskConfiguration'][_0x7daf('0x54')]({'where':{'id':_0x1c85ce[_0x7daf('0x49')]['id']}})[_0x7daf('0x1a')](handleEntityNotFound(_0x434c57,null))[_0x7daf('0x1a')](function(_0x578e3a){if(_0x578e3a){_0x4ade7f=_0x578e3a;_0x242a40[_0x7daf('0x33')]=_['keys'](db['DeskField']['rawAttributes']);_0x242a40[_0x7daf('0x34')]=_[_0x7daf('0x4f')](_0x1c85ce[_0x7daf('0x34')]);_0x242a40[_0x7daf('0x35')]=_[_0x7daf('0x37')](_0x242a40['model'],_0x242a40[_0x7daf('0x34')]);_0x13177e[_0x7daf('0x36')]=_[_0x7daf('0x37')](_0x242a40[_0x7daf('0x33')],qs['fields'](_0x1c85ce[_0x7daf('0x34')]['fields']));_0x13177e[_0x7daf('0x36')]=_0x13177e[_0x7daf('0x36')][_0x7daf('0x39')]?_0x13177e[_0x7daf('0x36')]:_0x242a40[_0x7daf('0x33')];_0x13177e[_0x7daf('0x3b')]=qs[_0x7daf('0x3c')](_0x1c85ce[_0x7daf('0x34')][_0x7daf('0x3c')]);_0x13177e[_0x7daf('0x3d')]=qs[_0x7daf('0x35')](_['pick'](_0x1c85ce[_0x7daf('0x34')],_0x242a40['filters']));if(_0x1c85ce['query'][_0x7daf('0x3f')]){_0x13177e['where']=_['merge'](_0x13177e[_0x7daf('0x3d')],{'$or':_[_0x7daf('0x51')](_0x13177e[_0x7daf('0x36')],function(_0x83e8d1){var _0x2570a9={};_0x2570a9[_0x83e8d1]={'$like':'%'+_0x1c85ce[_0x7daf('0x34')][_0x7daf('0x3f')]+'%'};return _0x2570a9;})});}_0x13177e=_['merge']({},_0x13177e,_0x1c85ce['options']);return _0x4ade7f[_0x7daf('0x53')](_0x13177e);}})[_0x7daf('0x1a')](function(_0x17ccf1){if(_0x17ccf1){_0x5b2da2=_0x17ccf1[_0x7daf('0x39')];if(!_0x1c85ce['query']['hasOwnProperty'](_0x7daf('0x3a'))){_0x13177e['limit']=qs[_0x7daf('0x2a')](_0x1c85ce['query'][_0x7daf('0x2a')]);_0x13177e[_0x7daf('0x29')]=qs[_0x7daf('0x29')](_0x1c85ce[_0x7daf('0x34')][_0x7daf('0x29')]);}return _0x4ade7f[_0x7daf('0x53')](_0x13177e);}})['then'](function(_0x25e39e){if(_0x25e39e){return _0x25e39e?{'count':_0x5b2da2,'rows':_0x25e39e}:null;}})[_0x7daf('0x1a')](respondWithResult(_0x434c57,null))[_0x7daf('0x48')](handleError(_0x434c57,null));};exports['getDescriptions']=function(_0x5bbc59,_0x4b1b2a,_0x4174fd){var _0x2557a1={};var _0x3902e4={};var _0xa27d84;var _0x4534ff;return db[_0x7daf('0x31')][_0x7daf('0x54')]({'where':{'id':_0x5bbc59[_0x7daf('0x49')]['id']}})[_0x7daf('0x1a')](handleEntityNotFound(_0x4b1b2a,null))[_0x7daf('0x1a')](function(_0x5ec94b){if(_0x5ec94b){_0xa27d84=_0x5ec94b;_0x3902e4['model']=_[_0x7daf('0x4f')](db[_0x7daf('0x50')]['rawAttributes']);_0x3902e4[_0x7daf('0x34')]=_[_0x7daf('0x4f')](_0x5bbc59[_0x7daf('0x34')]);_0x3902e4[_0x7daf('0x35')]=_[_0x7daf('0x37')](_0x3902e4[_0x7daf('0x33')],_0x3902e4[_0x7daf('0x34')]);_0x2557a1[_0x7daf('0x36')]=_[_0x7daf('0x37')](_0x3902e4[_0x7daf('0x33')],qs['fields'](_0x5bbc59[_0x7daf('0x34')][_0x7daf('0x38')]));_0x2557a1[_0x7daf('0x36')]=_0x2557a1[_0x7daf('0x36')][_0x7daf('0x39')]?_0x2557a1[_0x7daf('0x36')]:_0x3902e4['model'];_0x2557a1[_0x7daf('0x3b')]=qs['sort'](_0x5bbc59[_0x7daf('0x34')]['sort']);_0x2557a1[_0x7daf('0x3d')]=qs[_0x7daf('0x35')](_[_0x7daf('0x3e')](_0x5bbc59['query'],_0x3902e4[_0x7daf('0x35')]));if(_0x5bbc59[_0x7daf('0x34')][_0x7daf('0x3f')]){_0x2557a1[_0x7daf('0x3d')]=_['merge'](_0x2557a1[_0x7daf('0x3d')],{'$or':_[_0x7daf('0x51')](_0x2557a1[_0x7daf('0x36')],function(_0x5b77ce){var _0x69fd2a={};_0x69fd2a[_0x5b77ce]={'$like':'%'+_0x5bbc59['query'][_0x7daf('0x3f')]+'%'};return _0x69fd2a;})});}_0x2557a1=_[_0x7daf('0x40')]({},_0x2557a1,_0x5bbc59[_0x7daf('0x44')]);return _0xa27d84[_0x7daf('0x55')](_0x2557a1);}})[_0x7daf('0x1a')](function(_0x1ccd84){if(_0x1ccd84){_0x4534ff=_0x1ccd84[_0x7daf('0x39')];if(!_0x5bbc59[_0x7daf('0x34')]['hasOwnProperty'](_0x7daf('0x3a'))){_0x2557a1['limit']=qs[_0x7daf('0x2a')](_0x5bbc59[_0x7daf('0x34')][_0x7daf('0x2a')]);_0x2557a1[_0x7daf('0x29')]=qs[_0x7daf('0x29')](_0x5bbc59[_0x7daf('0x34')][_0x7daf('0x29')]);}return _0xa27d84[_0x7daf('0x55')](_0x2557a1);}})[_0x7daf('0x1a')](function(_0x3fcec9){if(_0x3fcec9){return _0x3fcec9?{'count':_0x4534ff,'rows':_0x3fcec9}:null;}})[_0x7daf('0x1a')](respondWithResult(_0x4b1b2a,null))['catch'](handleError(_0x4b1b2a,null));};exports[_0x7daf('0x56')]=function(_0x2afb4f,_0x1e2b19,_0x4c3ab7){var _0x352964={};var _0x2cbe70={};var _0x5e035b;var _0x2fd308;return db['DeskConfiguration'][_0x7daf('0x54')]({'where':{'id':_0x2afb4f[_0x7daf('0x49')]['id']}})['then'](handleEntityNotFound(_0x1e2b19,null))[_0x7daf('0x1a')](function(_0x40fd4e){if(_0x40fd4e){_0x5e035b=_0x40fd4e;_0x2cbe70[_0x7daf('0x33')]=_[_0x7daf('0x4f')](db[_0x7daf('0x57')][_0x7daf('0x32')]);_0x2cbe70[_0x7daf('0x34')]=_[_0x7daf('0x4f')](_0x2afb4f[_0x7daf('0x34')]);_0x2cbe70[_0x7daf('0x35')]=_[_0x7daf('0x37')](_0x2cbe70[_0x7daf('0x33')],_0x2cbe70[_0x7daf('0x34')]);_0x352964[_0x7daf('0x36')]=_[_0x7daf('0x37')](_0x2cbe70[_0x7daf('0x33')],qs['fields'](_0x2afb4f[_0x7daf('0x34')][_0x7daf('0x38')]));_0x352964['attributes']=_0x352964[_0x7daf('0x36')][_0x7daf('0x39')]?_0x352964[_0x7daf('0x36')]:_0x2cbe70['model'];_0x352964['order']=qs['sort'](_0x2afb4f[_0x7daf('0x34')][_0x7daf('0x3c')]);_0x352964[_0x7daf('0x3d')]=qs[_0x7daf('0x35')](_[_0x7daf('0x3e')](_0x2afb4f[_0x7daf('0x34')],_0x2cbe70[_0x7daf('0x35')]));if(_0x2afb4f[_0x7daf('0x34')][_0x7daf('0x3f')]){_0x352964[_0x7daf('0x3d')]=_[_0x7daf('0x40')](_0x352964[_0x7daf('0x3d')],{'$or':_[_0x7daf('0x51')](_0x352964[_0x7daf('0x36')],function(_0x495608){var _0x45a610={};_0x45a610[_0x495608]={'$like':'%'+_0x2afb4f['query'][_0x7daf('0x3f')]+'%'};return _0x45a610;})});}_0x352964=_[_0x7daf('0x40')]({},_0x352964,_0x2afb4f[_0x7daf('0x44')]);return _0x5e035b[_0x7daf('0x56')](_0x352964);}})['then'](function(_0x18e8b3){if(_0x18e8b3){_0x2fd308=_0x18e8b3[_0x7daf('0x39')];if(!_0x2afb4f[_0x7daf('0x34')][_0x7daf('0x52')](_0x7daf('0x3a'))){_0x352964['limit']=qs['limit'](_0x2afb4f[_0x7daf('0x34')][_0x7daf('0x2a')]);_0x352964['offset']=qs[_0x7daf('0x29')](_0x2afb4f[_0x7daf('0x34')][_0x7daf('0x29')]);}return _0x5e035b[_0x7daf('0x56')](_0x352964);}})['then'](function(_0x1707ef){if(_0x1707ef){return _0x1707ef?{'count':_0x2fd308,'rows':_0x1707ef}:null;}})[_0x7daf('0x1a')](respondWithResult(_0x1e2b19,null))[_0x7daf('0x48')](handleError(_0x1e2b19,null));};exports['setTags']=function(_0x5d2ac3,_0x30ac9e,_0x4a54a6){if(_0x5d2ac3[_0x7daf('0x4c')]['id']){delete _0x5d2ac3[_0x7daf('0x4c')]['id'];}return db[_0x7daf('0x31')][_0x7daf('0x54')]({'where':{'id':_0x5d2ac3['params']['id']}})[_0x7daf('0x1a')](handleEntityNotFound(_0x30ac9e,null))[_0x7daf('0x1a')](function(_0x5a4264){if(_0x5a4264){return _0x5a4264[_0x7daf('0x58')](_0x5d2ac3[_0x7daf('0x4c')]['ids']||[]);}return null;})[_0x7daf('0x1a')](respondWithResult(_0x30ac9e,null))[_0x7daf('0x48')](handleError(_0x30ac9e,null));}; \ No newline at end of file +var _0x13f6=['getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','where','key','VIRTUAL','field','options','count','include','DeskConfiguration','findAll','rows','includeAll','create','body','params','find','getFields','findOne','DeskField','order','map','nolimit','getSubjects'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x13f6,0xc2));var _0x613f=function(_0x551c3d,_0x532744){_0x551c3d=_0x551c3d-0x0;var _0x2dbdc6=_0x13f6[_0x551c3d];return _0x2dbdc6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x613f('0x0'));var rimraf=require(_0x613f('0x1'));var zipdir=require(_0x613f('0x2'));var jsonpatch=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var moment=require(_0x613f('0x5'));var BPromise=require(_0x613f('0x6'));var Mustache=require(_0x613f('0x7'));var util=require(_0x613f('0x8'));var path=require(_0x613f('0x9'));var sox=require(_0x613f('0xa'));var csv=require(_0x613f('0xb'));var ejs=require(_0x613f('0xc'));var fs=require('fs');var _=require(_0x613f('0xd'));var squel=require('squel');var crypto=require(_0x613f('0xe'));var jsforce=require(_0x613f('0xf'));var deskjs=require(_0x613f('0x10'));var toCsv=require(_0x613f('0xb'));var querystring=require(_0x613f('0x11'));var Papa=require(_0x613f('0x12'));var Redis=require(_0x613f('0x13'));var authService=require(_0x613f('0x14'));var qs=require(_0x613f('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x613f('0x16'))(_0x613f('0x17'));var utils=require('../../config/utils');var config=require(_0x613f('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x613f('0x19'));var client=jayson['client'][_0x613f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x27f45c,_0x1ea71c,_0xd4423d){if(_0xd4423d){var _0x296e4c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x296e4c['test'](_0x1ea71c)){return _0x27f45c;}else{throw new Error(_0x613f('0x1b'));}}else{return _0x27f45c;}}function respondWithRpcPromise(_0x4b41fb,_0x921e5b,_0x1543e5,_0x2b26e4){return new BPromise(function(_0x2f907e,_0xbac54f){var _0x2c09db=_0x2b26e4||client;return _0x2c09db[_0x613f('0x1c')](_0x4b41fb,_0x1543e5)['then'](function(_0x7fc722){logger['info'](_0x613f('0x1d'),_0x921e5b,_0x613f('0x1e'));logger[_0x613f('0x1f')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x921e5b,'request\x20sent',JSON[_0x613f('0x20')](_0x7fc722));if(_0x7fc722[_0x613f('0x21')]){if(_0x7fc722[_0x613f('0x21')][_0x613f('0x22')]===0x1f4){logger['error'](_0x613f('0x1d'),_0x921e5b,_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);return _0xbac54f(_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);}logger[_0x613f('0x21')](_0x613f('0x1d'),_0x921e5b,_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);return _0x2f907e(_0x7fc722[_0x613f('0x21')][_0x613f('0x23')]);}else{logger[_0x613f('0x24')]('DeskConfiguration,\x20%s,\x20%s',_0x921e5b,_0x613f('0x1e'));_0x2f907e(_0x7fc722[_0x613f('0x25')]['message']);}})[_0x613f('0x26')](function(_0x2f986a){logger[_0x613f('0x21')]('DeskConfiguration,\x20%s,\x20%s',_0x921e5b,_0x2f986a);_0xbac54f(_0x2f986a);});});}function respondWithStatusCode(_0x1a9666,_0x4c6bc0){_0x4c6bc0=_0x4c6bc0||0xcc;return function(_0x1f4b2f){if(_0x1f4b2f){return _0x1a9666[_0x613f('0x27')](_0x4c6bc0);}return _0x1a9666['status'](_0x4c6bc0)[_0x613f('0x28')]();};}function respondWithResult(_0x522e85,_0x2f106f){_0x2f106f=_0x2f106f||0xc8;return function(_0xc002cc){if(_0xc002cc){return _0x522e85[_0x613f('0x29')](_0x2f106f)[_0x613f('0x2a')](_0xc002cc);}};}function respondWithFilteredResult(_0xdc66d7,_0x532f7d){return function(_0x53fbf8){if(_0x53fbf8){var _0x4ba591=_0x53fbf8['count'],_0x501250=_0x532f7d[_0x613f('0x2b')],_0x2f5c39=_0x532f7d['offset']+_0x532f7d[_0x613f('0x2c')],_0x44c711;if(_0x2f5c39>=_0x4ba591){_0x2f5c39=_0x4ba591;_0x44c711=0xc8;}else{_0x44c711=0xce;}_0xdc66d7['status'](_0x44c711);return _0xdc66d7[_0x613f('0x2d')]('Content-Range',_0x501250+'-'+_0x2f5c39+'/'+_0x4ba591)[_0x613f('0x2a')](_0x53fbf8);}return null;};}function patchUpdates(_0x4c7a3f){return function(_0x56a132){try{jsonpatch[_0x613f('0x2e')](_0x56a132,_0x4c7a3f,!![]);}catch(_0x43398c){return BPromise[_0x613f('0x2f')](_0x43398c);}return _0x56a132[_0x613f('0x30')]();};}function saveUpdates(_0x325f16,_0x369c31){return function(_0x454f1b){if(_0x454f1b){return _0x454f1b[_0x613f('0x31')](_0x325f16)[_0x613f('0x32')](function(_0x2a092e){return _0x2a092e;});}return null;};}function removeEntity(_0x1b798e,_0x3e64b1){return function(_0x1b7be4){if(_0x1b7be4){return _0x1b7be4[_0x613f('0x33')]()[_0x613f('0x32')](function(){_0x1b798e[_0x613f('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x337c69,_0x14eabd){return function(_0x2b9d85){if(!_0x2b9d85){_0x337c69['sendStatus'](0x194);}return _0x2b9d85;};}function handleError(_0xc65bbe,_0x38081f){_0x38081f=_0x38081f||0x1f4;return function(_0xe8ff91){logger[_0x613f('0x21')](_0xe8ff91[_0x613f('0x34')]);if(_0xe8ff91[_0x613f('0x35')]){delete _0xe8ff91['name'];}_0xc65bbe[_0x613f('0x29')](_0x38081f)[_0x613f('0x36')](_0xe8ff91);};}exports['index']=function(_0x1cb1b8,_0x70462b){var _0x505983={},_0x540be5={},_0x78b115={'count':0x0,'rows':[]};var _0x5eb1e3=db['DeskConfiguration'][_0x613f('0x37')];_0x540be5['model']=_[_0x613f('0x38')](_0x5eb1e3);_0x540be5[_0x613f('0x39')]=_[_0x613f('0x38')](_0x1cb1b8[_0x613f('0x39')]);_0x540be5[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x540be5[_0x613f('0x3c')],_0x540be5[_0x613f('0x39')]);_0x505983[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x540be5['model'],qs['fields'](_0x1cb1b8['query'][_0x613f('0x3e')]));_0x505983[_0x613f('0x3d')]=_0x505983['attributes'][_0x613f('0x3f')]?_0x505983[_0x613f('0x3d')]:_0x540be5[_0x613f('0x3c')];if(!_0x1cb1b8[_0x613f('0x39')][_0x613f('0x40')]('nolimit')){_0x505983['limit']=qs[_0x613f('0x2c')](_0x1cb1b8[_0x613f('0x39')]['limit']);_0x505983[_0x613f('0x2b')]=qs['offset'](_0x1cb1b8[_0x613f('0x39')]['offset']);}_0x505983['order']=qs[_0x613f('0x41')](_0x1cb1b8['query'][_0x613f('0x41')]);_0x505983['where']=qs[_0x613f('0x3a')](_[_0x613f('0x42')](_0x1cb1b8['query'],_0x540be5['filters']));if(_0x1cb1b8[_0x613f('0x39')][_0x613f('0x43')]){_0x505983['where']=_[_0x613f('0x44')](_0x505983[_0x613f('0x45')],{'$or':_['map'](_0x5eb1e3,function(_0x50b30f){if(_0x50b30f['type'][_0x613f('0x46')]!==_0x613f('0x47')){var _0x22cb0b={};_0x22cb0b[_0x50b30f[_0x613f('0x48')]]={'$like':'%'+_0x1cb1b8[_0x613f('0x39')][_0x613f('0x43')]+'%'};return _0x22cb0b;}})});}_0x505983=_['merge']({},_0x505983,_0x1cb1b8[_0x613f('0x49')]);var _0x184bf0={'where':_0x505983[_0x613f('0x45')]};return db['DeskConfiguration']['count'](_0x184bf0)['then'](function(_0x55cd5e){_0x78b115[_0x613f('0x4a')]=_0x55cd5e;if(_0x1cb1b8['query']['includeAll']){_0x505983[_0x613f('0x4b')]=[{'all':!![]}];}return db[_0x613f('0x4c')][_0x613f('0x4d')](_0x505983);})[_0x613f('0x32')](function(_0x296e8b){_0x78b115[_0x613f('0x4e')]=_0x296e8b;return _0x78b115;})[_0x613f('0x32')](respondWithFilteredResult(_0x70462b,_0x505983))[_0x613f('0x26')](handleError(_0x70462b,null));};exports['show']=function(_0x4c7918,_0x5980c3){var _0x30c578={'raw':![],'where':{'id':_0x4c7918['params']['id']}},_0x4610f7={};_0x4610f7[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x4c')][_0x613f('0x37')]);_0x4610f7[_0x613f('0x39')]=_['keys'](_0x4c7918[_0x613f('0x39')]);_0x4610f7[_0x613f('0x3a')]=_['intersection'](_0x4610f7[_0x613f('0x3c')],_0x4610f7['query']);_0x30c578[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x4610f7[_0x613f('0x3c')],qs['fields'](_0x4c7918['query']['fields']));_0x30c578[_0x613f('0x3d')]=_0x30c578[_0x613f('0x3d')][_0x613f('0x3f')]?_0x30c578['attributes']:_0x4610f7['model'];if(_0x4c7918[_0x613f('0x39')][_0x613f('0x4f')]){_0x30c578[_0x613f('0x4b')]=[{'all':!![]}];}_0x30c578=_[_0x613f('0x44')]({},_0x30c578,_0x4c7918[_0x613f('0x49')]);return db[_0x613f('0x4c')]['find'](_0x30c578)[_0x613f('0x32')](handleEntityNotFound(_0x5980c3,null))[_0x613f('0x32')](respondWithResult(_0x5980c3,null))[_0x613f('0x26')](handleError(_0x5980c3,null));};exports[_0x613f('0x50')]=function(_0xa1999e,_0xe08541){return db[_0x613f('0x4c')][_0x613f('0x50')](_0xa1999e[_0x613f('0x51')],{})[_0x613f('0x32')](respondWithResult(_0xe08541,0xc9))[_0x613f('0x26')](handleError(_0xe08541,null));};exports[_0x613f('0x31')]=function(_0x3c3cb7,_0x20822d){if(_0x3c3cb7[_0x613f('0x51')]['id']){delete _0x3c3cb7[_0x613f('0x51')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x3c3cb7[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x20822d,null))[_0x613f('0x32')](saveUpdates(_0x3c3cb7[_0x613f('0x51')],null))[_0x613f('0x32')](respondWithResult(_0x20822d,null))[_0x613f('0x26')](handleError(_0x20822d,null));};exports[_0x613f('0x33')]=function(_0xbf24e1,_0x604519){return db[_0x613f('0x4c')][_0x613f('0x53')]({'where':{'id':_0xbf24e1[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x604519,null))[_0x613f('0x32')](removeEntity(_0x604519,null))[_0x613f('0x26')](handleError(_0x604519,null));};exports[_0x613f('0x54')]=function(_0x2c76c0,_0x124b3f,_0x2f1d3f){var _0x475855={};var _0x4e8955={};var _0x2c0e3a;var _0x17dbe9;return db['DeskConfiguration'][_0x613f('0x55')]({'where':{'id':_0x2c76c0['params']['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x124b3f,null))['then'](function(_0x47fc17){if(_0x47fc17){_0x2c0e3a=_0x47fc17;_0x4e8955[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x56')][_0x613f('0x37')]);_0x4e8955['query']=_[_0x613f('0x38')](_0x2c76c0[_0x613f('0x39')]);_0x4e8955[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x4e8955[_0x613f('0x3c')],_0x4e8955['query']);_0x475855[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x4e8955[_0x613f('0x3c')],qs[_0x613f('0x3e')](_0x2c76c0['query']['fields']));_0x475855[_0x613f('0x3d')]=_0x475855['attributes'][_0x613f('0x3f')]?_0x475855[_0x613f('0x3d')]:_0x4e8955[_0x613f('0x3c')];_0x475855[_0x613f('0x57')]=qs[_0x613f('0x41')](_0x2c76c0['query'][_0x613f('0x41')]);_0x475855['where']=qs[_0x613f('0x3a')](_['pick'](_0x2c76c0['query'],_0x4e8955[_0x613f('0x3a')]));if(_0x2c76c0[_0x613f('0x39')][_0x613f('0x43')]){_0x475855['where']=_[_0x613f('0x44')](_0x475855[_0x613f('0x45')],{'$or':_[_0x613f('0x58')](_0x475855[_0x613f('0x3d')],function(_0x9eea2c){var _0x1558c3={};_0x1558c3[_0x9eea2c]={'$like':'%'+_0x2c76c0['query'][_0x613f('0x43')]+'%'};return _0x1558c3;})});}_0x475855=_['merge']({},_0x475855,_0x2c76c0[_0x613f('0x49')]);return _0x2c0e3a[_0x613f('0x54')](_0x475855);}})['then'](function(_0x4ac819){if(_0x4ac819){_0x17dbe9=_0x4ac819[_0x613f('0x3f')];if(!_0x2c76c0['query'][_0x613f('0x40')](_0x613f('0x59'))){_0x475855[_0x613f('0x2c')]=qs[_0x613f('0x2c')](_0x2c76c0['query'][_0x613f('0x2c')]);_0x475855['offset']=qs[_0x613f('0x2b')](_0x2c76c0['query']['offset']);}return _0x2c0e3a[_0x613f('0x54')](_0x475855);}})[_0x613f('0x32')](function(_0x1419e0){if(_0x1419e0){return _0x1419e0?{'count':_0x17dbe9,'rows':_0x1419e0}:null;}})[_0x613f('0x32')](respondWithResult(_0x124b3f,null))[_0x613f('0x26')](handleError(_0x124b3f,null));};exports[_0x613f('0x5a')]=function(_0x159500,_0x2a82d4,_0x53269a){var _0x2d9e31={};var _0x2a321a={};var _0x5925d9;var _0x4e4ec1;return db[_0x613f('0x4c')][_0x613f('0x55')]({'where':{'id':_0x159500['params']['id']}})['then'](handleEntityNotFound(_0x2a82d4,null))['then'](function(_0x39e0e6){if(_0x39e0e6){_0x5925d9=_0x39e0e6;_0x2a321a['model']=_[_0x613f('0x38')](db['DeskField'][_0x613f('0x37')]);_0x2a321a[_0x613f('0x39')]=_[_0x613f('0x38')](_0x159500[_0x613f('0x39')]);_0x2a321a[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x2a321a[_0x613f('0x3c')],_0x2a321a['query']);_0x2d9e31['attributes']=_[_0x613f('0x3b')](_0x2a321a['model'],qs[_0x613f('0x3e')](_0x159500[_0x613f('0x39')][_0x613f('0x3e')]));_0x2d9e31['attributes']=_0x2d9e31[_0x613f('0x3d')]['length']?_0x2d9e31[_0x613f('0x3d')]:_0x2a321a[_0x613f('0x3c')];_0x2d9e31['order']=qs['sort'](_0x159500[_0x613f('0x39')]['sort']);_0x2d9e31[_0x613f('0x45')]=qs[_0x613f('0x3a')](_[_0x613f('0x42')](_0x159500[_0x613f('0x39')],_0x2a321a['filters']));if(_0x159500['query'][_0x613f('0x43')]){_0x2d9e31['where']=_[_0x613f('0x44')](_0x2d9e31[_0x613f('0x45')],{'$or':_[_0x613f('0x58')](_0x2d9e31[_0x613f('0x3d')],function(_0x59ea01){var _0x1fd89f={};_0x1fd89f[_0x59ea01]={'$like':'%'+_0x159500[_0x613f('0x39')][_0x613f('0x43')]+'%'};return _0x1fd89f;})});}_0x2d9e31=_['merge']({},_0x2d9e31,_0x159500[_0x613f('0x49')]);return _0x5925d9[_0x613f('0x5a')](_0x2d9e31);}})[_0x613f('0x32')](function(_0x34b917){if(_0x34b917){_0x4e4ec1=_0x34b917[_0x613f('0x3f')];if(!_0x159500[_0x613f('0x39')][_0x613f('0x40')](_0x613f('0x59'))){_0x2d9e31[_0x613f('0x2c')]=qs[_0x613f('0x2c')](_0x159500[_0x613f('0x39')][_0x613f('0x2c')]);_0x2d9e31[_0x613f('0x2b')]=qs[_0x613f('0x2b')](_0x159500['query']['offset']);}return _0x5925d9[_0x613f('0x5a')](_0x2d9e31);}})[_0x613f('0x32')](function(_0xfe1b51){if(_0xfe1b51){return _0xfe1b51?{'count':_0x4e4ec1,'rows':_0xfe1b51}:null;}})[_0x613f('0x32')](respondWithResult(_0x2a82d4,null))['catch'](handleError(_0x2a82d4,null));};exports['getDescriptions']=function(_0x217574,_0xf89eb2,_0x12b0a){var _0x17af58={};var _0x1995db={};var _0x505578;var _0x2e37f0;return db[_0x613f('0x4c')][_0x613f('0x55')]({'where':{'id':_0x217574[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0xf89eb2,null))['then'](function(_0x553189){if(_0x553189){_0x505578=_0x553189;_0x1995db[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x56')]['rawAttributes']);_0x1995db['query']=_['keys'](_0x217574[_0x613f('0x39')]);_0x1995db[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x1995db[_0x613f('0x3c')],_0x1995db['query']);_0x17af58[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x1995db[_0x613f('0x3c')],qs[_0x613f('0x3e')](_0x217574['query'][_0x613f('0x3e')]));_0x17af58[_0x613f('0x3d')]=_0x17af58[_0x613f('0x3d')][_0x613f('0x3f')]?_0x17af58[_0x613f('0x3d')]:_0x1995db['model'];_0x17af58[_0x613f('0x57')]=qs[_0x613f('0x41')](_0x217574[_0x613f('0x39')][_0x613f('0x41')]);_0x17af58[_0x613f('0x45')]=qs['filters'](_[_0x613f('0x42')](_0x217574['query'],_0x1995db['filters']));if(_0x217574[_0x613f('0x39')]['filter']){_0x17af58[_0x613f('0x45')]=_['merge'](_0x17af58[_0x613f('0x45')],{'$or':_['map'](_0x17af58[_0x613f('0x3d')],function(_0x3ce4cf){var _0x3140b9={};_0x3140b9[_0x3ce4cf]={'$like':'%'+_0x217574['query'][_0x613f('0x43')]+'%'};return _0x3140b9;})});}_0x17af58=_[_0x613f('0x44')]({},_0x17af58,_0x217574[_0x613f('0x49')]);return _0x505578[_0x613f('0x5b')](_0x17af58);}})['then'](function(_0x40f2f7){if(_0x40f2f7){_0x2e37f0=_0x40f2f7[_0x613f('0x3f')];if(!_0x217574[_0x613f('0x39')][_0x613f('0x40')](_0x613f('0x59'))){_0x17af58[_0x613f('0x2c')]=qs[_0x613f('0x2c')](_0x217574[_0x613f('0x39')]['limit']);_0x17af58[_0x613f('0x2b')]=qs['offset'](_0x217574[_0x613f('0x39')][_0x613f('0x2b')]);}return _0x505578[_0x613f('0x5b')](_0x17af58);}})[_0x613f('0x32')](function(_0x596b4e){if(_0x596b4e){return _0x596b4e?{'count':_0x2e37f0,'rows':_0x596b4e}:null;}})['then'](respondWithResult(_0xf89eb2,null))[_0x613f('0x26')](handleError(_0xf89eb2,null));};exports[_0x613f('0x5c')]=function(_0x272378,_0x2ca890,_0x284c5a){var _0x14a05a={};var _0x5ec9e7={};var _0x51c8e9;var _0x205ddf;return db[_0x613f('0x4c')][_0x613f('0x55')]({'where':{'id':_0x272378[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x2ca890,null))['then'](function(_0x4b0140){if(_0x4b0140){_0x51c8e9=_0x4b0140;_0x5ec9e7[_0x613f('0x3c')]=_[_0x613f('0x38')](db[_0x613f('0x5d')]['rawAttributes']);_0x5ec9e7[_0x613f('0x39')]=_[_0x613f('0x38')](_0x272378[_0x613f('0x39')]);_0x5ec9e7[_0x613f('0x3a')]=_[_0x613f('0x3b')](_0x5ec9e7[_0x613f('0x3c')],_0x5ec9e7[_0x613f('0x39')]);_0x14a05a[_0x613f('0x3d')]=_[_0x613f('0x3b')](_0x5ec9e7[_0x613f('0x3c')],qs[_0x613f('0x3e')](_0x272378[_0x613f('0x39')]['fields']));_0x14a05a[_0x613f('0x3d')]=_0x14a05a[_0x613f('0x3d')][_0x613f('0x3f')]?_0x14a05a['attributes']:_0x5ec9e7[_0x613f('0x3c')];_0x14a05a['order']=qs['sort'](_0x272378[_0x613f('0x39')][_0x613f('0x41')]);_0x14a05a[_0x613f('0x45')]=qs['filters'](_[_0x613f('0x42')](_0x272378[_0x613f('0x39')],_0x5ec9e7['filters']));if(_0x272378[_0x613f('0x39')][_0x613f('0x43')]){_0x14a05a[_0x613f('0x45')]=_[_0x613f('0x44')](_0x14a05a[_0x613f('0x45')],{'$or':_[_0x613f('0x58')](_0x14a05a[_0x613f('0x3d')],function(_0x3eb4fb){var _0x5c6367={};_0x5c6367[_0x3eb4fb]={'$like':'%'+_0x272378[_0x613f('0x39')][_0x613f('0x43')]+'%'};return _0x5c6367;})});}_0x14a05a=_[_0x613f('0x44')]({},_0x14a05a,_0x272378[_0x613f('0x49')]);return _0x51c8e9[_0x613f('0x5c')](_0x14a05a);}})[_0x613f('0x32')](function(_0x5b3b73){if(_0x5b3b73){_0x205ddf=_0x5b3b73[_0x613f('0x3f')];if(!_0x272378[_0x613f('0x39')][_0x613f('0x40')](_0x613f('0x59'))){_0x14a05a['limit']=qs[_0x613f('0x2c')](_0x272378[_0x613f('0x39')][_0x613f('0x2c')]);_0x14a05a[_0x613f('0x2b')]=qs[_0x613f('0x2b')](_0x272378['query'][_0x613f('0x2b')]);}return _0x51c8e9[_0x613f('0x5c')](_0x14a05a);}})[_0x613f('0x32')](function(_0x32035b){if(_0x32035b){return _0x32035b?{'count':_0x205ddf,'rows':_0x32035b}:null;}})['then'](respondWithResult(_0x2ca890,null))[_0x613f('0x26')](handleError(_0x2ca890,null));};exports[_0x613f('0x5e')]=function(_0x41b7b9,_0x4f7854,_0x2509b2){if(_0x41b7b9[_0x613f('0x51')]['id']){delete _0x41b7b9[_0x613f('0x51')]['id'];}return db['DeskConfiguration'][_0x613f('0x55')]({'where':{'id':_0x41b7b9[_0x613f('0x52')]['id']}})[_0x613f('0x32')](handleEntityNotFound(_0x4f7854,null))[_0x613f('0x32')](function(_0x122f97){if(_0x122f97){return _0x122f97[_0x613f('0x5e')](_0x41b7b9[_0x613f('0x51')]['ids']||[]);}return null;})['then'](respondWithResult(_0x4f7854,null))[_0x613f('0x26')](handleError(_0x4f7854,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 86eb7b4..68fb543 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 _0xdbbc=['path','../../config/environment','exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','request-promise'];(function(_0x1fd638,_0xed5089){var _0x4cac04=function(_0x3b86c2){while(--_0x3b86c2){_0x1fd638['push'](_0x1fd638['shift']());}};_0x4cac04(++_0xed5089);}(_0xdbbc,0xed));var _0xcdbb=function(_0x11b8a5,_0x2b56a0){_0x11b8a5=_0x11b8a5-0x0;var _0x1f64e8=_0xdbbc[_0x11b8a5];return _0x1f64e8;};'use strict';var _=require(_0xcdbb('0x0'));var util=require('util');var logger=require(_0xcdbb('0x1'))(_0xcdbb('0x2'));var moment=require(_0xcdbb('0x3'));var BPromise=require('bluebird');var rp=require(_0xcdbb('0x4'));var fs=require('fs');var path=require(_0xcdbb('0x5'));var rimraf=require('rimraf');var config=require(_0xcdbb('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0xcdbb('0x7')]=function(_0x1ed12d,_0x66ee1){return _0x1ed12d[_0xcdbb('0x8')](_0xcdbb('0x9'),attributes,{'tableName':_0xcdbb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x766e=['../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','../../config/logger','api','moment','path','rimraf'];(function(_0x4763db,_0x4b1d33){var _0x5a41ec=function(_0xb1deda){while(--_0xb1deda){_0x4763db['push'](_0x4763db['shift']());}};_0x5a41ec(++_0x4b1d33);}(_0x766e,0x13f));var _0xe766=function(_0x283f1a,_0x271f9a){_0x283f1a=_0x283f1a-0x0;var _0x3eeb4c=_0x766e[_0x283f1a];return _0x3eeb4c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe766('0x0'))(_0xe766('0x1'));var moment=require(_0xe766('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe766('0x3'));var rimraf=require(_0xe766('0x4'));var config=require(_0xe766('0x5'));var attributes=require(_0xe766('0x6'));module[_0xe766('0x7')]=function(_0x2d2932,_0x1eaa38){return _0x2d2932['define'](_0xe766('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index b3b49c1..7157400 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3294ae,_0x5d72bc){var _0x3fb3fe=function(_0x31923a){while(--_0x31923a){_0x3294ae['push'](_0x3294ae['shift']());}};_0x3fb3fe(++_0x5d72bc);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc4aa[_0x2064e5];return _0x21a233;};'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')]('DeskConfiguration,\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 _0xdbf5=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch'];(function(_0x43057a,_0x4e00ff){var _0x478ac8=function(_0x124b1b){while(--_0x124b1b){_0x43057a['push'](_0x43057a['shift']());}};_0x478ac8(++_0x4e00ff);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1b43bf,_0x217a57){_0x1b43bf=_0x1b43bf-0x0;var _0x5ca176=_0xdbf5[_0x1b43bf];return _0x5ca176;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x209b7d,_0x88128e,_0x93e657){return new BPromise(function(_0x52b039,_0x134810){return client['request'](_0x209b7d,_0x93e657)[_0x5dbf('0xb')](function(_0x3bec50){logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,'request\x20sent');logger[_0x5dbf('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x88128e,'request\x20sent',JSON[_0x5dbf('0xf')](_0x3bec50));if(_0x3bec50['error']){if(_0x3bec50['error'][_0x5dbf('0x10')]===0x1f4){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x134810(_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x88128e,_0x3bec50[_0x5dbf('0x11')][_0x5dbf('0x12')]);return _0x52b039(_0x3bec50['error'][_0x5dbf('0x12')]);}else{logger[_0x5dbf('0xc')](_0x5dbf('0xd'),_0x88128e,_0x5dbf('0x13'));_0x52b039(_0x3bec50[_0x5dbf('0x14')][_0x5dbf('0x12')]);}})[_0x5dbf('0x15')](function(_0x50ef1d){logger['error'](_0x5dbf('0xd'),_0x88128e,_0x50ef1d);_0x134810(_0x50ef1d);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index d6a8d6c..2ba4668 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 _0x0d2e=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0x10d190,_0x5b640a){var _0x52ed52=function(_0x3eec1c){while(--_0x3eec1c){_0x10d190['push'](_0x10d190['shift']());}};_0x52ed52(++_0x5b640a);}(_0x0d2e,0x107));var _0xe0d2=function(_0x4fa1f0,_0x5b5c01){_0x4fa1f0=_0x4fa1f0-0x0;var _0x20c7b6=_0x0d2e[_0x4fa1f0];return _0x20c7b6;};'use strict';var multer=require(_0xe0d2('0x0'));var util=require(_0xe0d2('0x1'));var path=require(_0xe0d2('0x2'));var timeout=require(_0xe0d2('0x3'));var express=require(_0xe0d2('0x4'));var router=express[_0xe0d2('0x5')]();var auth=require(_0xe0d2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe0d2('0x7'));var controller=require(_0xe0d2('0x8'));router['get']('/',auth[_0xe0d2('0x9')](),controller[_0xe0d2('0xa')]);router[_0xe0d2('0xb')](_0xe0d2('0xc'),auth[_0xe0d2('0x9')](),controller['show']);router[_0xe0d2('0xd')]('/',auth[_0xe0d2('0x9')](),controller[_0xe0d2('0xe')]);router[_0xe0d2('0xf')](_0xe0d2('0xc'),auth[_0xe0d2('0x9')](),controller[_0xe0d2('0x10')]);router[_0xe0d2('0x11')](_0xe0d2('0xc'),auth['isAuthenticated'](),controller[_0xe0d2('0x12')]);module[_0xe0d2('0x13')]=router; \ No newline at end of file +var _0x586d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','create','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x256771,_0xd650e0){var _0x37c1cd=function(_0xfff3af){while(--_0xfff3af){_0x256771['push'](_0x256771['shift']());}};_0x37c1cd(++_0xd650e0);}(_0x586d,0x8a));var _0xd586=function(_0x1c8989,_0x1ae867){_0x1c8989=_0x1c8989-0x0;var _0xefaadc=_0x586d[_0x1c8989];return _0xefaadc;};'use strict';var multer=require(_0xd586('0x0'));var util=require(_0xd586('0x1'));var path=require(_0xd586('0x2'));var timeout=require(_0xd586('0x3'));var express=require(_0xd586('0x4'));var router=express[_0xd586('0x5')]();var auth=require(_0xd586('0x6'));var interaction=require(_0xd586('0x7'));var config=require(_0xd586('0x8'));var controller=require(_0xd586('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd586('0xa')]('/:id',auth[_0xd586('0xb')](),controller['show']);router['post']('/',auth[_0xd586('0xb')](),controller[_0xd586('0xc')]);router['put']('/:id',auth[_0xd586('0xb')](),controller[_0xd586('0xd')]);router[_0xd586('0xe')](_0xd586('0xf'),auth['isAuthenticated'](),controller[_0xd586('0x10')]);module[_0xd586('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 8805606..898723a 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 _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x43fbbc,_0x44b526){var _0x15cf00=function(_0x20fa23){while(--_0x20fa23){_0x43fbbc['push'](_0x43fbbc['shift']());}};_0x15cf00(++_0x44b526);}(_0xb688,0xcf));var _0x8b68=function(_0x691ec0,_0x115405){_0x691ec0=_0x691ec0-0x0;var _0x2569b1=_0xb688[_0x691ec0];return _0x2569b1;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file +var _0xd64b=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x3735f9,_0x1ae262){var _0x1ad32=function(_0x3a73ae){while(--_0x3a73ae){_0x3735f9['push'](_0x3735f9['shift']());}};_0x1ad32(++_0x1ae262);}(_0xd64b,0xc1));var _0xbd64=function(_0x4951a3,_0xc7bb2c){_0x4951a3=_0x4951a3-0x0;var _0x1566a1=_0xd64b[_0x4951a3];return _0x1566a1;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'type':{'type':Sequelize[_0xbd64('0x1')]('string',_0xbd64('0x2'),_0xbd64('0x3'),_0xbd64('0x4')),'defaultValue':_0xbd64('0x5')},'content':{'type':Sequelize[_0xbd64('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xbd64('0x3'))},'keyContent':{'type':Sequelize[_0xbd64('0x6')]},'idField':{'type':Sequelize[_0xbd64('0x6')]},'nameField':{'type':Sequelize[_0xbd64('0x6')]},'customField':{'type':Sequelize[_0xbd64('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd64('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 106a521..403e09b 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 _0xb469=['../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','apply','save','update','then','sendStatus','error','stack','name','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','map','key','field','options','DeskField','count','includeAll','include','findAll','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','jsforce','querystring','papaparse'];(function(_0xbefd56,_0x5ade12){var _0x300517=function(_0x173ebb){while(--_0x173ebb){_0xbefd56['push'](_0xbefd56['shift']());}};_0x300517(++_0x5ade12);}(_0xb469,0x13b));var _0x9b46=function(_0x4c6ba2,_0x31856e){_0x4c6ba2=_0x4c6ba2-0x0;var _0x456c2f=_0xb469[_0x4c6ba2];return _0x456c2f;};'use strict';var pdf=require(_0x9b46('0x0'));var emlformat=require(_0x9b46('0x1'));var rimraf=require(_0x9b46('0x2'));var zipdir=require(_0x9b46('0x3'));var jsonpatch=require(_0x9b46('0x4'));var rp=require(_0x9b46('0x5'));var moment=require(_0x9b46('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x9b46('0x7'));var util=require(_0x9b46('0x8'));var path=require('path');var sox=require(_0x9b46('0x9'));var csv=require(_0x9b46('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9b46('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b46('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9b46('0xa'));var querystring=require(_0x9b46('0xd'));var Papa=require(_0x9b46('0xe'));var Redis=require('ioredis');var authService=require(_0x9b46('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x9b46('0x10'));var logger=require('../../config/logger')(_0x9b46('0x11'));var utils=require('../../config/utils');var config=require(_0x9b46('0x12'));var db=require(_0x9b46('0x13'))['db'];function respondWithStatusCode(_0x563de4,_0x360974){_0x360974=_0x360974||0xcc;return function(_0x417df5){if(_0x417df5){return _0x563de4['sendStatus'](_0x360974);}return _0x563de4[_0x9b46('0x14')](_0x360974)[_0x9b46('0x15')]();};}function respondWithResult(_0x3d9618,_0x467086){_0x467086=_0x467086||0xc8;return function(_0xa8f4ac){if(_0xa8f4ac){return _0x3d9618[_0x9b46('0x14')](_0x467086)[_0x9b46('0x16')](_0xa8f4ac);}};}function respondWithFilteredResult(_0x2e70c3,_0x3f2b28){return function(_0x178293){if(_0x178293){var _0xbc1ba6=_0x178293['count'],_0x135cc2=_0x3f2b28['offset'],_0x1e6911=_0x3f2b28[_0x9b46('0x17')]+_0x3f2b28[_0x9b46('0x18')],_0x559bdf;if(_0x1e6911>=_0xbc1ba6){_0x1e6911=_0xbc1ba6;_0x559bdf=0xc8;}else{_0x559bdf=0xce;}_0x2e70c3[_0x9b46('0x14')](_0x559bdf);return _0x2e70c3['set']('Content-Range',_0x135cc2+'-'+_0x1e6911+'/'+_0xbc1ba6)[_0x9b46('0x16')](_0x178293);}return null;};}function patchUpdates(_0x4ccfd0){return function(_0x56ec1a){try{jsonpatch[_0x9b46('0x19')](_0x56ec1a,_0x4ccfd0,!![]);}catch(_0x3a15cc){return BPromise['reject'](_0x3a15cc);}return _0x56ec1a[_0x9b46('0x1a')]();};}function saveUpdates(_0x297be6,_0x498185){return function(_0x55aece){if(_0x55aece){return _0x55aece[_0x9b46('0x1b')](_0x297be6)[_0x9b46('0x1c')](function(_0x204098){return _0x204098;});}return null;};}function removeEntity(_0x4e4c7d,_0x50c7a1){return function(_0x2b3440){if(_0x2b3440){return _0x2b3440['destroy']()[_0x9b46('0x1c')](function(){_0x4e4c7d[_0x9b46('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xadff19,_0x5182b1){return function(_0x141cb6){if(!_0x141cb6){_0xadff19[_0x9b46('0x1d')](0x194);}return _0x141cb6;};}function handleError(_0x4d3b1b,_0x4615b7){_0x4615b7=_0x4615b7||0x1f4;return function(_0x31ca63){logger[_0x9b46('0x1e')](_0x31ca63[_0x9b46('0x1f')]);if(_0x31ca63[_0x9b46('0x20')]){delete _0x31ca63[_0x9b46('0x20')];}_0x4d3b1b[_0x9b46('0x14')](_0x4615b7)['send'](_0x31ca63);};}exports[_0x9b46('0x21')]=function(_0x3ac37e,_0x478105){var _0x268821={},_0x2468be={},_0x2a79a5={'count':0x0,'rows':[]};var _0x125fd6=db['DeskField'][_0x9b46('0x22')];_0x2468be[_0x9b46('0x23')]=_[_0x9b46('0x24')](_0x125fd6);_0x2468be[_0x9b46('0x25')]=_[_0x9b46('0x24')](_0x3ac37e[_0x9b46('0x25')]);_0x2468be[_0x9b46('0x26')]=_[_0x9b46('0x27')](_0x2468be[_0x9b46('0x23')],_0x2468be[_0x9b46('0x25')]);_0x268821[_0x9b46('0x28')]=_['intersection'](_0x2468be[_0x9b46('0x23')],qs[_0x9b46('0x29')](_0x3ac37e[_0x9b46('0x25')][_0x9b46('0x29')]));_0x268821[_0x9b46('0x28')]=_0x268821[_0x9b46('0x28')][_0x9b46('0x2a')]?_0x268821[_0x9b46('0x28')]:_0x2468be[_0x9b46('0x23')];if(!_0x3ac37e[_0x9b46('0x25')][_0x9b46('0x2b')]('nolimit')){_0x268821[_0x9b46('0x18')]=qs['limit'](_0x3ac37e[_0x9b46('0x25')][_0x9b46('0x18')]);_0x268821[_0x9b46('0x17')]=qs['offset'](_0x3ac37e[_0x9b46('0x25')][_0x9b46('0x17')]);}_0x268821[_0x9b46('0x2c')]=qs[_0x9b46('0x2d')](_0x3ac37e[_0x9b46('0x25')]['sort']);_0x268821['where']=qs[_0x9b46('0x26')](_[_0x9b46('0x2e')](_0x3ac37e[_0x9b46('0x25')],_0x2468be[_0x9b46('0x26')]));if(_0x3ac37e['query'][_0x9b46('0x2f')]){_0x268821['where']=_[_0x9b46('0x30')](_0x268821[_0x9b46('0x31')],{'$or':_[_0x9b46('0x32')](_0x125fd6,function(_0x1ccba9){if(_0x1ccba9['type'][_0x9b46('0x33')]!=='VIRTUAL'){var _0x28a9c3={};_0x28a9c3[_0x1ccba9[_0x9b46('0x34')]]={'$like':'%'+_0x3ac37e[_0x9b46('0x25')][_0x9b46('0x2f')]+'%'};return _0x28a9c3;}})});}_0x268821=_[_0x9b46('0x30')]({},_0x268821,_0x3ac37e[_0x9b46('0x35')]);var _0x412ddd={'where':_0x268821[_0x9b46('0x31')]};return db[_0x9b46('0x36')][_0x9b46('0x37')](_0x412ddd)[_0x9b46('0x1c')](function(_0x4970df){_0x2a79a5[_0x9b46('0x37')]=_0x4970df;if(_0x3ac37e['query'][_0x9b46('0x38')]){_0x268821[_0x9b46('0x39')]=[{'all':!![]}];}return db['DeskField'][_0x9b46('0x3a')](_0x268821);})['then'](function(_0x416538){_0x2a79a5['rows']=_0x416538;return _0x2a79a5;})[_0x9b46('0x1c')](respondWithFilteredResult(_0x478105,_0x268821))[_0x9b46('0x3b')](handleError(_0x478105,null));};exports[_0x9b46('0x3c')]=function(_0x22ab5d,_0x272b){var _0x4eb816={'raw':!![],'where':{'id':_0x22ab5d[_0x9b46('0x3d')]['id']}},_0x4e268c={};_0x4e268c['model']=_['keys'](db['DeskField']['rawAttributes']);_0x4e268c[_0x9b46('0x25')]=_['keys'](_0x22ab5d[_0x9b46('0x25')]);_0x4e268c['filters']=_[_0x9b46('0x27')](_0x4e268c[_0x9b46('0x23')],_0x4e268c[_0x9b46('0x25')]);_0x4eb816[_0x9b46('0x28')]=_[_0x9b46('0x27')](_0x4e268c[_0x9b46('0x23')],qs[_0x9b46('0x29')](_0x22ab5d[_0x9b46('0x25')][_0x9b46('0x29')]));_0x4eb816['attributes']=_0x4eb816[_0x9b46('0x28')][_0x9b46('0x2a')]?_0x4eb816[_0x9b46('0x28')]:_0x4e268c[_0x9b46('0x23')];if(_0x22ab5d[_0x9b46('0x25')][_0x9b46('0x38')]){_0x4eb816[_0x9b46('0x39')]=[{'all':!![]}];}_0x4eb816=_[_0x9b46('0x30')]({},_0x4eb816,_0x22ab5d[_0x9b46('0x35')]);return db[_0x9b46('0x36')][_0x9b46('0x3e')](_0x4eb816)[_0x9b46('0x1c')](handleEntityNotFound(_0x272b,null))[_0x9b46('0x1c')](respondWithResult(_0x272b,null))[_0x9b46('0x3b')](handleError(_0x272b,null));};exports['create']=function(_0x4a62c6,_0xf81543){return db[_0x9b46('0x36')][_0x9b46('0x3f')](_0x4a62c6['body'],{})['then'](respondWithResult(_0xf81543,0xc9))[_0x9b46('0x3b')](handleError(_0xf81543,null));};exports[_0x9b46('0x1b')]=function(_0x3708dc,_0x16091f){if(_0x3708dc[_0x9b46('0x40')]['id']){delete _0x3708dc[_0x9b46('0x40')]['id'];}return db['DeskField'][_0x9b46('0x3e')]({'where':{'id':_0x3708dc[_0x9b46('0x3d')]['id']}})[_0x9b46('0x1c')](handleEntityNotFound(_0x16091f,null))['then'](saveUpdates(_0x3708dc[_0x9b46('0x40')],null))['then'](respondWithResult(_0x16091f,null))[_0x9b46('0x3b')](handleError(_0x16091f,null));};exports[_0x9b46('0x41')]=function(_0x16e6d8,_0x566bad){return db[_0x9b46('0x36')][_0x9b46('0x3e')]({'where':{'id':_0x16e6d8[_0x9b46('0x3d')]['id']}})[_0x9b46('0x1c')](handleEntityNotFound(_0x566bad,null))[_0x9b46('0x1c')](removeEntity(_0x566bad,null))[_0x9b46('0x3b')](handleError(_0x566bad,null));}; \ No newline at end of file +var _0x5089=['length','nolimit','order','sort','where','filters','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','includeAll','catch','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','name','index','DeskField','rawAttributes','model','keys','query','intersection','fields','attributes'];(function(_0x2d6207,_0x6c515d){var _0x5b3eee=function(_0x3d68a3){while(--_0x3d68a3){_0x2d6207['push'](_0x2d6207['shift']());}};_0x5b3eee(++_0x6c515d);}(_0x5089,0x1bb));var _0x9508=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0x5089[_0x1ee62e];return _0x27c6c8;};'use strict';var pdf=require(_0x9508('0x0'));var emlformat=require(_0x9508('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9508('0x2'));var jsonpatch=require(_0x9508('0x3'));var rp=require(_0x9508('0x4'));var moment=require(_0x9508('0x5'));var BPromise=require(_0x9508('0x6'));var Mustache=require('mustache');var util=require(_0x9508('0x7'));var path=require('path');var sox=require(_0x9508('0x8'));var csv=require(_0x9508('0x9'));var ejs=require(_0x9508('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9508('0xb'));var crypto=require(_0x9508('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9508('0xd'));var toCsv=require(_0x9508('0x9'));var querystring=require('querystring');var Papa=require(_0x9508('0xe'));var Redis=require('ioredis');var authService=require(_0x9508('0xf'));var qs=require(_0x9508('0x10'));var hardwareService=require(_0x9508('0x11'));var logger=require(_0x9508('0x12'))(_0x9508('0x13'));var utils=require(_0x9508('0x14'));var config=require('../../config/environment');var db=require(_0x9508('0x15'))['db'];function respondWithStatusCode(_0x507887,_0x2c4fd9){_0x2c4fd9=_0x2c4fd9||0xcc;return function(_0x396896){if(_0x396896){return _0x507887['sendStatus'](_0x2c4fd9);}return _0x507887[_0x9508('0x16')](_0x2c4fd9)[_0x9508('0x17')]();};}function respondWithResult(_0x10ceef,_0x4701de){_0x4701de=_0x4701de||0xc8;return function(_0x51ef92){if(_0x51ef92){return _0x10ceef[_0x9508('0x16')](_0x4701de)[_0x9508('0x18')](_0x51ef92);}};}function respondWithFilteredResult(_0x51c80b,_0x2a281d){return function(_0x539746){if(_0x539746){var _0x25d4d6=_0x539746[_0x9508('0x19')],_0x418889=_0x2a281d[_0x9508('0x1a')],_0x374c03=_0x2a281d[_0x9508('0x1a')]+_0x2a281d[_0x9508('0x1b')],_0x255a03;if(_0x374c03>=_0x25d4d6){_0x374c03=_0x25d4d6;_0x255a03=0xc8;}else{_0x255a03=0xce;}_0x51c80b['status'](_0x255a03);return _0x51c80b[_0x9508('0x1c')](_0x9508('0x1d'),_0x418889+'-'+_0x374c03+'/'+_0x25d4d6)[_0x9508('0x18')](_0x539746);}return null;};}function patchUpdates(_0x1ba7e6){return function(_0x23c30e){try{jsonpatch[_0x9508('0x1e')](_0x23c30e,_0x1ba7e6,!![]);}catch(_0x52e3c4){return BPromise['reject'](_0x52e3c4);}return _0x23c30e[_0x9508('0x1f')]();};}function saveUpdates(_0x47f7a2,_0x2272e2){return function(_0x4e9e9f){if(_0x4e9e9f){return _0x4e9e9f[_0x9508('0x20')](_0x47f7a2)[_0x9508('0x21')](function(_0x226f29){return _0x226f29;});}return null;};}function removeEntity(_0x1dfc6c,_0x1edf1b){return function(_0x2f8106){if(_0x2f8106){return _0x2f8106[_0x9508('0x22')]()['then'](function(){_0x1dfc6c['status'](0xcc)[_0x9508('0x17')]();});}};}function handleEntityNotFound(_0x1b70e6,_0x39e6b0){return function(_0xf70830){if(!_0xf70830){_0x1b70e6[_0x9508('0x23')](0x194);}return _0xf70830;};}function handleError(_0x20d2ce,_0x4b68e9){_0x4b68e9=_0x4b68e9||0x1f4;return function(_0x5e9a80){logger[_0x9508('0x24')](_0x5e9a80['stack']);if(_0x5e9a80['name']){delete _0x5e9a80[_0x9508('0x25')];}_0x20d2ce['status'](_0x4b68e9)['send'](_0x5e9a80);};}exports[_0x9508('0x26')]=function(_0x30da92,_0x57c7ae){var _0x49246b={},_0x32b0dd={},_0x22b2e2={'count':0x0,'rows':[]};var _0x4529a8=db[_0x9508('0x27')][_0x9508('0x28')];_0x32b0dd[_0x9508('0x29')]=_[_0x9508('0x2a')](_0x4529a8);_0x32b0dd[_0x9508('0x2b')]=_[_0x9508('0x2a')](_0x30da92[_0x9508('0x2b')]);_0x32b0dd['filters']=_[_0x9508('0x2c')](_0x32b0dd[_0x9508('0x29')],_0x32b0dd[_0x9508('0x2b')]);_0x49246b['attributes']=_[_0x9508('0x2c')](_0x32b0dd[_0x9508('0x29')],qs['fields'](_0x30da92[_0x9508('0x2b')][_0x9508('0x2d')]));_0x49246b['attributes']=_0x49246b[_0x9508('0x2e')][_0x9508('0x2f')]?_0x49246b[_0x9508('0x2e')]:_0x32b0dd[_0x9508('0x29')];if(!_0x30da92['query']['hasOwnProperty'](_0x9508('0x30'))){_0x49246b[_0x9508('0x1b')]=qs[_0x9508('0x1b')](_0x30da92['query']['limit']);_0x49246b[_0x9508('0x1a')]=qs[_0x9508('0x1a')](_0x30da92[_0x9508('0x2b')][_0x9508('0x1a')]);}_0x49246b[_0x9508('0x31')]=qs[_0x9508('0x32')](_0x30da92[_0x9508('0x2b')][_0x9508('0x32')]);_0x49246b[_0x9508('0x33')]=qs[_0x9508('0x34')](_['pick'](_0x30da92[_0x9508('0x2b')],_0x32b0dd[_0x9508('0x34')]));if(_0x30da92['query'][_0x9508('0x35')]){_0x49246b[_0x9508('0x33')]=_[_0x9508('0x36')](_0x49246b[_0x9508('0x33')],{'$or':_[_0x9508('0x37')](_0x4529a8,function(_0x31ab9c){if(_0x31ab9c[_0x9508('0x38')][_0x9508('0x39')]!==_0x9508('0x3a')){var _0x98ff75={};_0x98ff75[_0x31ab9c[_0x9508('0x3b')]]={'$like':'%'+_0x30da92['query'][_0x9508('0x35')]+'%'};return _0x98ff75;}})});}_0x49246b=_['merge']({},_0x49246b,_0x30da92[_0x9508('0x3c')]);var _0x1dd6c9={'where':_0x49246b[_0x9508('0x33')]};return db['DeskField']['count'](_0x1dd6c9)[_0x9508('0x21')](function(_0x1f28f6){_0x22b2e2[_0x9508('0x19')]=_0x1f28f6;if(_0x30da92[_0x9508('0x2b')]['includeAll']){_0x49246b[_0x9508('0x3d')]=[{'all':!![]}];}return db['DeskField'][_0x9508('0x3e')](_0x49246b);})[_0x9508('0x21')](function(_0x5205f8){_0x22b2e2[_0x9508('0x3f')]=_0x5205f8;return _0x22b2e2;})[_0x9508('0x21')](respondWithFilteredResult(_0x57c7ae,_0x49246b))['catch'](handleError(_0x57c7ae,null));};exports[_0x9508('0x40')]=function(_0x1e6851,_0x5b601d){var _0x12fdc6={'raw':!![],'where':{'id':_0x1e6851['params']['id']}},_0x4e2561={};_0x4e2561[_0x9508('0x29')]=_['keys'](db[_0x9508('0x27')][_0x9508('0x28')]);_0x4e2561[_0x9508('0x2b')]=_[_0x9508('0x2a')](_0x1e6851['query']);_0x4e2561['filters']=_['intersection'](_0x4e2561[_0x9508('0x29')],_0x4e2561['query']);_0x12fdc6[_0x9508('0x2e')]=_['intersection'](_0x4e2561[_0x9508('0x29')],qs[_0x9508('0x2d')](_0x1e6851[_0x9508('0x2b')][_0x9508('0x2d')]));_0x12fdc6['attributes']=_0x12fdc6[_0x9508('0x2e')][_0x9508('0x2f')]?_0x12fdc6[_0x9508('0x2e')]:_0x4e2561['model'];if(_0x1e6851[_0x9508('0x2b')][_0x9508('0x41')]){_0x12fdc6['include']=[{'all':!![]}];}_0x12fdc6=_[_0x9508('0x36')]({},_0x12fdc6,_0x1e6851['options']);return db[_0x9508('0x27')]['find'](_0x12fdc6)['then'](handleEntityNotFound(_0x5b601d,null))[_0x9508('0x21')](respondWithResult(_0x5b601d,null))[_0x9508('0x42')](handleError(_0x5b601d,null));};exports[_0x9508('0x43')]=function(_0x9c674f,_0xf17d3a){return db[_0x9508('0x27')]['create'](_0x9c674f[_0x9508('0x44')],{})[_0x9508('0x21')](respondWithResult(_0xf17d3a,0xc9))[_0x9508('0x42')](handleError(_0xf17d3a,null));};exports['update']=function(_0x2ee9e,_0xe81056){if(_0x2ee9e[_0x9508('0x44')]['id']){delete _0x2ee9e[_0x9508('0x44')]['id'];}return db['DeskField'][_0x9508('0x45')]({'where':{'id':_0x2ee9e['params']['id']}})[_0x9508('0x21')](handleEntityNotFound(_0xe81056,null))[_0x9508('0x21')](saveUpdates(_0x2ee9e['body'],null))[_0x9508('0x21')](respondWithResult(_0xe81056,null))[_0x9508('0x42')](handleError(_0xe81056,null));};exports['destroy']=function(_0x61eb2c,_0x22306e){return db['DeskField'][_0x9508('0x45')]({'where':{'id':_0x61eb2c['params']['id']}})[_0x9508('0x21')](handleEntityNotFound(_0x22306e,null))['then'](removeEntity(_0x22306e,null))[_0x9508('0x42')](handleError(_0x22306e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 51b0f85..6cb0246 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 _0x42ba=['./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x77fb5,_0x1be993){var _0x43a498=function(_0x211674){while(--_0x211674){_0x77fb5['push'](_0x77fb5['shift']());}};_0x43a498(++_0x1be993);}(_0x42ba,0x19f));var _0xa42b=function(_0x521ce8,_0x2818f8){_0x521ce8=_0x521ce8-0x0;var _0x233dad=_0x42ba[_0x521ce8];return _0x233dad;};'use strict';var _=require(_0xa42b('0x0'));var util=require(_0xa42b('0x1'));var logger=require(_0xa42b('0x2'))(_0xa42b('0x3'));var moment=require(_0xa42b('0x4'));var BPromise=require(_0xa42b('0x5'));var rp=require(_0xa42b('0x6'));var fs=require('fs');var path=require(_0xa42b('0x7'));var rimraf=require(_0xa42b('0x8'));var config=require(_0xa42b('0x9'));var attributes=require(_0xa42b('0xa'));module[_0xa42b('0xb')]=function(_0x4ae74f,_0xcc53fc){return _0x4ae74f[_0xa42b('0xc')]('DeskField',attributes,{'tableName':_0xa42b('0xd'),'paranoid':![],'indexes':[{'name':_0xa42b('0xe'),'fields':[_0xa42b('0xf'),_0xa42b('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1eb8=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','desk_unique_index','FieldId'];(function(_0x362ade,_0x3e8b6a){var _0x1c985e=function(_0x1742f7){while(--_0x1742f7){_0x362ade['push'](_0x362ade['shift']());}};_0x1c985e(++_0x3e8b6a);}(_0x1eb8,0xfc));var _0x81eb=function(_0x20bc10,_0x35bed9){_0x20bc10=_0x20bc10-0x0;var _0x3bd5ce=_0x1eb8[_0x20bc10];return _0x3bd5ce;};'use strict';var _=require(_0x81eb('0x0'));var util=require(_0x81eb('0x1'));var logger=require(_0x81eb('0x2'))(_0x81eb('0x3'));var moment=require(_0x81eb('0x4'));var BPromise=require(_0x81eb('0x5'));var rp=require(_0x81eb('0x6'));var fs=require('fs');var path=require(_0x81eb('0x7'));var rimraf=require(_0x81eb('0x8'));var config=require('../../config/environment');var attributes=require(_0x81eb('0x9'));module[_0x81eb('0xa')]=function(_0x57fbed,_0x476117){return _0x57fbed[_0x81eb('0xb')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x81eb('0xc'),'fields':['idField',_0x81eb('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index cf036f3..7d360c0 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x45f67b,_0xd2e1d2){var _0x4da8e9=function(_0x1e6787){while(--_0x1e6787){_0x45f67b['push'](_0x45f67b['shift']());}};_0x4da8e9(++_0xd2e1d2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x18e52b,_0x1fae35){_0x18e52b=_0x18e52b-0x0;var _0x3d3062=_0xcb91[_0x18e52b];return _0x3d3062;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('DeskField,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x702d=['stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x251d43,_0xd5a05a){var _0x3d7759=function(_0x13bd1c){while(--_0x13bd1c){_0x251d43['push'](_0x251d43['shift']());}};_0x3d7759(++_0xd5a05a);}(_0x702d,0x147));var _0xd702=function(_0x2a2271,_0x141af0){_0x2a2271=_0x2a2271-0x0;var _0x5c08c0=_0x702d[_0x2a2271];return _0x5c08c0;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var moment=require(_0xd702('0x2'));var BPromise=require(_0xd702('0x3'));var rs=require(_0xd702('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd702('0x5'))['db'];var utils=require(_0xd702('0x6'));var logger=require(_0xd702('0x7'))(_0xd702('0x8'));var config=require('../../config/environment');var jayson=require(_0xd702('0x9'));var client=jayson['client'][_0xd702('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a2c03,_0xf4bf4f,_0x5af246){return new BPromise(function(_0x12bb75,_0x53bd02){return client[_0xd702('0xb')](_0x3a2c03,_0x5af246)[_0xd702('0xc')](function(_0x907a9f){logger[_0xd702('0xd')](_0xd702('0xe'),_0xf4bf4f,_0xd702('0xf'));logger[_0xd702('0x10')](_0xd702('0x11'),_0xf4bf4f,_0xd702('0xf'),JSON[_0xd702('0x12')](_0x907a9f));if(_0x907a9f['error']){if(_0x907a9f['error'][_0xd702('0x13')]===0x1f4){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f['error'][_0xd702('0x15')]);return _0x53bd02(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x907a9f[_0xd702('0x14')]['message']);return _0x12bb75(_0x907a9f[_0xd702('0x14')][_0xd702('0x15')]);}else{logger['info'](_0xd702('0xe'),_0xf4bf4f,'request\x20sent');_0x12bb75(_0x907a9f[_0xd702('0x16')][_0xd702('0x15')]);}})['catch'](function(_0x2ba791){logger[_0xd702('0x14')](_0xd702('0xe'),_0xf4bf4f,_0x2ba791);_0x53bd02(_0x2ba791);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 86e2cfa..5dfa9a4 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 _0xb55d=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x506363,_0x15b1f6){var _0x45b1e3=function(_0x4fc63f){while(--_0x4fc63f){_0x506363['push'](_0x506363['shift']());}};_0x45b1e3(++_0x15b1f6);}(_0xb55d,0x12b));var _0xdb55=function(_0x57ab8b,_0x52eb79){_0x57ab8b=_0x57ab8b-0x0;var _0x47beeb=_0xb55d[_0x57ab8b];return _0x47beeb;};'use strict';var multer=require('multer');var util=require(_0xdb55('0x0'));var path=require(_0xdb55('0x1'));var timeout=require(_0xdb55('0x2'));var express=require(_0xdb55('0x3'));var router=express[_0xdb55('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdb55('0x5'));var config=require(_0xdb55('0x6'));var controller=require('./intDynamics365Account.controller');router[_0xdb55('0x7')]('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0x9')]);router[_0xdb55('0x7')](_0xdb55('0xa'),auth[_0xdb55('0x8')](),controller[_0xdb55('0xb')]);router[_0xdb55('0x7')](_0xdb55('0xc'),auth['isAuthenticated'](),controller[_0xdb55('0xd')]);router[_0xdb55('0x7')](_0xdb55('0xe'),auth[_0xdb55('0x8')](),controller['getFields']);router[_0xdb55('0xf')]('/',auth[_0xdb55('0x8')](),controller[_0xdb55('0x10')]);router['post']('/:id/configurations',auth[_0xdb55('0x8')](),controller['addConfiguration']);router[_0xdb55('0x11')]('/:id',auth[_0xdb55('0x8')](),controller['update']);router[_0xdb55('0x12')]('/:id',auth[_0xdb55('0x8')](),controller[_0xdb55('0x13')]);module[_0xdb55('0x14')]=router; \ No newline at end of file +var _0xd868=['addConfiguration','put','update','delete','/:id','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','post','create'];(function(_0x4b3358,_0x5cda77){var _0x1ea011=function(_0x1a17ea){while(--_0x1a17ea){_0x4b3358['push'](_0x4b3358['shift']());}};_0x1ea011(++_0x5cda77);}(_0xd868,0xd9));var _0x8d86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd868[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x8d86('0x0'));var path=require(_0x8d86('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d86('0x2'));var router=express['Router']();var auth=require(_0x8d86('0x3'));var interaction=require(_0x8d86('0x4'));var config=require(_0x8d86('0x5'));var controller=require('./intDynamics365Account.controller');router[_0x8d86('0x6')]('/',auth[_0x8d86('0x7')](),controller[_0x8d86('0x8')]);router[_0x8d86('0x6')]('/:id',auth[_0x8d86('0x7')](),controller[_0x8d86('0x9')]);router['get'](_0x8d86('0xa'),auth[_0x8d86('0x7')](),controller[_0x8d86('0xb')]);router['get']('/:id/fields',auth[_0x8d86('0x7')](),controller['getFields']);router[_0x8d86('0xc')]('/',auth[_0x8d86('0x7')](),controller[_0x8d86('0xd')]);router[_0x8d86('0xc')](_0x8d86('0xa'),auth['isAuthenticated'](),controller[_0x8d86('0xe')]);router[_0x8d86('0xf')]('/:id',auth[_0x8d86('0x7')](),controller[_0x8d86('0x10')]);router[_0x8d86('0x11')](_0x8d86('0x12'),auth['isAuthenticated'](),controller[_0x8d86('0x13')]);module[_0x8d86('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index b97a376..55151de 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 _0xa60b=['STRING','exports'];(function(_0x11aaa2,_0x39bdd9){var _0x4ac417=function(_0x5561f0){while(--_0x5561f0){_0x11aaa2['push'](_0x11aaa2['shift']());}};_0x4ac417(++_0x39bdd9);}(_0xa60b,0x103));var _0xba60=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa60b[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');module[_0xba60('0x0')]={'name':{'type':Sequelize[_0xba60('0x1')]},'username':{'type':Sequelize[_0xba60('0x1')]},'password':{'type':Sequelize[_0xba60('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xba60('0x1')]},'clientId':{'type':Sequelize[_0xba60('0x1')]},'clientSecret':{'type':Sequelize[_0xba60('0x1')]},'serverUrl':{'type':Sequelize[_0xba60('0x1')]},'description':{'type':Sequelize[_0xba60('0x1')]}}; \ No newline at end of file +var _0xcbd6=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbd6,0x114));var _0x6cbd=function(_0x19d378,_0x26d5c6){_0x19d378=_0x19d378-0x0;var _0x23a2d7=_0xcbd6[_0x19d378];return _0x23a2d7;};'use strict';var Sequelize=require(_0x6cbd('0x0'));module[_0x6cbd('0x1')]={'name':{'type':Sequelize[_0x6cbd('0x2')]},'username':{'type':Sequelize[_0x6cbd('0x2')]},'password':{'type':Sequelize[_0x6cbd('0x2')]},'remoteUri':{'type':Sequelize[_0x6cbd('0x2')]},'tenantId':{'type':Sequelize[_0x6cbd('0x2')]},'clientId':{'type':Sequelize[_0x6cbd('0x2')]},'clientSecret':{'type':Sequelize[_0x6cbd('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6cbd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index db38890..f417ced 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 _0x2c64=['limit','json','apply','reject','save','update','destroy','stack','name','send','index','Dynamics365Account','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','options','includeAll','rows','params','include','create','body','getConfigurations','findOne','rawAttributes','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','getFields','ticketType','incident','PhoneCall','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','tenantId','remoteUri','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','clientId','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','Dynamics365\x20error:\x20','Wrong\x20credentials','statusCode',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false','?$select=DisplayName,LogicalName','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x2c64,0x181));var _0x42c6=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x2c64[_0x26b80e];return _0x84a8a8;};'use strict';var pdf=require(_0x42c6('0x0'));var emlformat=require(_0x42c6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x42c6('0x2'));var jsonpatch=require(_0x42c6('0x3'));var rp=require(_0x42c6('0x4'));var moment=require(_0x42c6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x42c6('0x6'));var path=require(_0x42c6('0x7'));var sox=require(_0x42c6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x42c6('0x9'));var crypto=require(_0x42c6('0xa'));var jsforce=require(_0x42c6('0xb'));var deskjs=require(_0x42c6('0xc'));var toCsv=require(_0x42c6('0xd'));var querystring=require('querystring');var Papa=require(_0x42c6('0xe'));var Redis=require(_0x42c6('0xf'));var authService=require(_0x42c6('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x42c6('0x11'));var logger=require(_0x42c6('0x12'))('api');var utils=require(_0x42c6('0x13'));var config=require(_0x42c6('0x14'));var db=require(_0x42c6('0x15'))['db'];var integrations=require(_0x42c6('0x16'));var jayson=require(_0x42c6('0x17'));var client=jayson[_0x42c6('0x18')][_0x42c6('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4ff092,_0x9de7a1,_0x1e9287){if(_0x1e9287){var _0x21f74a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21f74a[_0x42c6('0x1a')](_0x9de7a1)){return _0x4ff092;}else{throw new Error(_0x42c6('0x1b'));}}else{return _0x4ff092;}}function respondWithRpcPromise(_0x1c91bb,_0x373598,_0x51a06c,_0x376d62){return new BPromise(function(_0x1a2863,_0x189e46){var _0x1ac8bd=_0x376d62||client;return _0x1ac8bd['request'](_0x1c91bb,_0x51a06c)[_0x42c6('0x1c')](function(_0x4ee7e2){logger[_0x42c6('0x1d')](_0x42c6('0x1e'),_0x373598,_0x42c6('0x1f'));logger['debug'](_0x42c6('0x20'),_0x373598,_0x42c6('0x1f'),JSON[_0x42c6('0x21')](_0x4ee7e2));if(_0x4ee7e2[_0x42c6('0x22')]){if(_0x4ee7e2[_0x42c6('0x22')][_0x42c6('0x23')]===0x1f4){logger[_0x42c6('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x373598,_0x4ee7e2['error'][_0x42c6('0x24')]);return _0x189e46(_0x4ee7e2[_0x42c6('0x22')][_0x42c6('0x24')]);}logger[_0x42c6('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x373598,_0x4ee7e2['error'][_0x42c6('0x24')]);return _0x1a2863(_0x4ee7e2[_0x42c6('0x22')]['message']);}else{logger[_0x42c6('0x1d')]('Dynamics365Account,\x20%s,\x20%s',_0x373598,_0x42c6('0x1f'));_0x1a2863(_0x4ee7e2[_0x42c6('0x25')][_0x42c6('0x24')]);}})[_0x42c6('0x26')](function(_0x2bbc82){logger[_0x42c6('0x22')](_0x42c6('0x1e'),_0x373598,_0x2bbc82);_0x189e46(_0x2bbc82);});});}function respondWithStatusCode(_0x9ed602,_0x10c408){_0x10c408=_0x10c408||0xcc;return function(_0x1015ab){if(_0x1015ab){return _0x9ed602[_0x42c6('0x27')](_0x10c408);}return _0x9ed602[_0x42c6('0x28')](_0x10c408)['end']();};}function respondWithResult(_0x4465fc,_0x34f85b){_0x34f85b=_0x34f85b||0xc8;return function(_0x1d9c11){if(_0x1d9c11){return _0x4465fc[_0x42c6('0x28')](_0x34f85b)['json'](_0x1d9c11);}};}function respondWithFilteredResult(_0x1b0fe7,_0x3972b8){return function(_0x9fac8c){if(_0x9fac8c){var _0x5dde30=_0x9fac8c[_0x42c6('0x29')],_0x130807=_0x3972b8[_0x42c6('0x2a')],_0x5394ff=_0x3972b8[_0x42c6('0x2a')]+_0x3972b8[_0x42c6('0x2b')],_0x31aa56;if(_0x5394ff>=_0x5dde30){_0x5394ff=_0x5dde30;_0x31aa56=0xc8;}else{_0x31aa56=0xce;}_0x1b0fe7['status'](_0x31aa56);return _0x1b0fe7['set']('Content-Range',_0x130807+'-'+_0x5394ff+'/'+_0x5dde30)[_0x42c6('0x2c')](_0x9fac8c);}return null;};}function patchUpdates(_0xc621b7){return function(_0x305e27){try{jsonpatch[_0x42c6('0x2d')](_0x305e27,_0xc621b7,!![]);}catch(_0x5ba6cb){return BPromise[_0x42c6('0x2e')](_0x5ba6cb);}return _0x305e27[_0x42c6('0x2f')]();};}function saveUpdates(_0x522d14,_0x1777ce){return function(_0x4bba65){if(_0x4bba65){return _0x4bba65[_0x42c6('0x30')](_0x522d14)['then'](function(_0xd7a969){return _0xd7a969;});}return null;};}function removeEntity(_0x1896fb,_0x43e4cd){return function(_0xa4b57){if(_0xa4b57){return _0xa4b57[_0x42c6('0x31')]()[_0x42c6('0x1c')](function(){_0x1896fb[_0x42c6('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27bb6e,_0x24423e){return function(_0xfd1a9f){if(!_0xfd1a9f){_0x27bb6e[_0x42c6('0x27')](0x194);}return _0xfd1a9f;};}function handleError(_0x1c4fc3,_0x898d52){_0x898d52=_0x898d52||0x1f4;return function(_0x45f06e){logger[_0x42c6('0x22')](_0x45f06e[_0x42c6('0x32')]);if(_0x45f06e[_0x42c6('0x33')]){delete _0x45f06e['name'];}_0x1c4fc3[_0x42c6('0x28')](_0x898d52)[_0x42c6('0x34')](_0x45f06e);};}exports[_0x42c6('0x35')]=function(_0x34d8f5,_0x334d37){var _0x4cebbe={},_0xcaab0={},_0x2f9f42={'count':0x0,'rows':[]};var _0x4bbc18=db[_0x42c6('0x36')]['rawAttributes'];_0xcaab0[_0x42c6('0x37')]=_['keys'](_0x4bbc18);_0xcaab0[_0x42c6('0x38')]=_[_0x42c6('0x39')](_0x34d8f5['query']);_0xcaab0[_0x42c6('0x3a')]=_[_0x42c6('0x3b')](_0xcaab0[_0x42c6('0x37')],_0xcaab0['query']);_0x4cebbe[_0x42c6('0x3c')]=_[_0x42c6('0x3b')](_0xcaab0[_0x42c6('0x37')],qs['fields'](_0x34d8f5[_0x42c6('0x38')][_0x42c6('0x3d')]));_0x4cebbe[_0x42c6('0x3c')]=_0x4cebbe['attributes'][_0x42c6('0x3e')]?_0x4cebbe[_0x42c6('0x3c')]:_0xcaab0[_0x42c6('0x37')];if(!_0x34d8f5[_0x42c6('0x38')]['hasOwnProperty'](_0x42c6('0x3f'))){_0x4cebbe[_0x42c6('0x2b')]=qs['limit'](_0x34d8f5[_0x42c6('0x38')][_0x42c6('0x2b')]);_0x4cebbe[_0x42c6('0x2a')]=qs[_0x42c6('0x2a')](_0x34d8f5[_0x42c6('0x38')][_0x42c6('0x2a')]);}_0x4cebbe[_0x42c6('0x40')]=qs['sort'](_0x34d8f5[_0x42c6('0x38')][_0x42c6('0x41')]);_0x4cebbe['where']=qs[_0x42c6('0x3a')](_[_0x42c6('0x42')](_0x34d8f5['query'],_0xcaab0[_0x42c6('0x3a')]));if(_0x34d8f5['query'][_0x42c6('0x43')]){_0x4cebbe['where']=_[_0x42c6('0x44')](_0x4cebbe[_0x42c6('0x45')],{'$or':_[_0x42c6('0x46')](_0x4bbc18,function(_0x5de806){if(_0x5de806[_0x42c6('0x47')][_0x42c6('0x48')]!==_0x42c6('0x49')){var _0x36faac={};_0x36faac[_0x5de806['field']]={'$like':'%'+_0x34d8f5[_0x42c6('0x38')][_0x42c6('0x43')]+'%'};return _0x36faac;}})});}_0x4cebbe=_[_0x42c6('0x44')]({},_0x4cebbe,_0x34d8f5[_0x42c6('0x4a')]);var _0x2a2654={'where':_0x4cebbe[_0x42c6('0x45')]};return db[_0x42c6('0x36')][_0x42c6('0x29')](_0x2a2654)[_0x42c6('0x1c')](function(_0x405713){_0x2f9f42[_0x42c6('0x29')]=_0x405713;if(_0x34d8f5[_0x42c6('0x38')][_0x42c6('0x4b')]){_0x4cebbe['include']=[{'all':!![]}];}return db[_0x42c6('0x36')]['findAll'](_0x4cebbe);})['then'](function(_0x61bdeb){_0x2f9f42[_0x42c6('0x4c')]=_0x61bdeb;return _0x2f9f42;})[_0x42c6('0x1c')](respondWithFilteredResult(_0x334d37,_0x4cebbe))[_0x42c6('0x26')](handleError(_0x334d37,null));};exports['show']=function(_0x452947,_0x2466c3){var _0x1c9956={'raw':![],'where':{'id':_0x452947[_0x42c6('0x4d')]['id']}},_0x5ab3a3={};_0x5ab3a3[_0x42c6('0x37')]=_[_0x42c6('0x39')](db[_0x42c6('0x36')]['rawAttributes']);_0x5ab3a3[_0x42c6('0x38')]=_[_0x42c6('0x39')](_0x452947['query']);_0x5ab3a3[_0x42c6('0x3a')]=_[_0x42c6('0x3b')](_0x5ab3a3[_0x42c6('0x37')],_0x5ab3a3[_0x42c6('0x38')]);_0x1c9956[_0x42c6('0x3c')]=_[_0x42c6('0x3b')](_0x5ab3a3['model'],qs['fields'](_0x452947[_0x42c6('0x38')][_0x42c6('0x3d')]));_0x1c9956[_0x42c6('0x3c')]=_0x1c9956[_0x42c6('0x3c')]['length']?_0x1c9956['attributes']:_0x5ab3a3['model'];if(_0x452947[_0x42c6('0x38')][_0x42c6('0x4b')]){_0x1c9956[_0x42c6('0x4e')]=[{'all':!![]}];}_0x1c9956=_[_0x42c6('0x44')]({},_0x1c9956,_0x452947[_0x42c6('0x4a')]);return db['Dynamics365Account']['find'](_0x1c9956)[_0x42c6('0x1c')](handleEntityNotFound(_0x2466c3,null))['then'](respondWithResult(_0x2466c3,null))[_0x42c6('0x26')](handleError(_0x2466c3,null));};exports[_0x42c6('0x4f')]=function(_0x16cfa5,_0x105f49){return db[_0x42c6('0x36')][_0x42c6('0x4f')](_0x16cfa5[_0x42c6('0x50')],{})[_0x42c6('0x1c')](respondWithResult(_0x105f49,0xc9))[_0x42c6('0x26')](handleError(_0x105f49,null));};exports[_0x42c6('0x30')]=function(_0x5182fa,_0x454f66){if(_0x5182fa[_0x42c6('0x50')]['id']){delete _0x5182fa[_0x42c6('0x50')]['id'];}return db[_0x42c6('0x36')]['find']({'where':{'id':_0x5182fa['params']['id']}})[_0x42c6('0x1c')](handleEntityNotFound(_0x454f66,null))[_0x42c6('0x1c')](saveUpdates(_0x5182fa[_0x42c6('0x50')],null))['then'](respondWithResult(_0x454f66,null))[_0x42c6('0x26')](handleError(_0x454f66,null));};exports[_0x42c6('0x31')]=function(_0x248505,_0x245e41){return db['Dynamics365Account']['find']({'where':{'id':_0x248505[_0x42c6('0x4d')]['id']}})[_0x42c6('0x1c')](handleEntityNotFound(_0x245e41,null))[_0x42c6('0x1c')](removeEntity(_0x245e41,null))['catch'](handleError(_0x245e41,null));};exports[_0x42c6('0x51')]=function(_0x3802ab,_0x29c7a4,_0x6df8b7){var _0x400620={};var _0x50a8e5={};var _0x56af9c;var _0x4d640c;return db[_0x42c6('0x36')][_0x42c6('0x52')]({'where':{'id':_0x3802ab['params']['id']}})[_0x42c6('0x1c')](handleEntityNotFound(_0x29c7a4,null))[_0x42c6('0x1c')](function(_0x562b05){if(_0x562b05){_0x56af9c=_0x562b05;_0x50a8e5[_0x42c6('0x37')]=_[_0x42c6('0x39')](db['Dynamics365Configuration'][_0x42c6('0x53')]);_0x50a8e5[_0x42c6('0x38')]=_[_0x42c6('0x39')](_0x3802ab[_0x42c6('0x38')]);_0x50a8e5[_0x42c6('0x3a')]=_[_0x42c6('0x3b')](_0x50a8e5[_0x42c6('0x37')],_0x50a8e5[_0x42c6('0x38')]);_0x400620[_0x42c6('0x3c')]=_[_0x42c6('0x3b')](_0x50a8e5[_0x42c6('0x37')],qs[_0x42c6('0x3d')](_0x3802ab[_0x42c6('0x38')][_0x42c6('0x3d')]));_0x400620['attributes']=_0x400620['attributes'][_0x42c6('0x3e')]?_0x400620[_0x42c6('0x3c')]:_0x50a8e5['model'];_0x400620[_0x42c6('0x40')]=qs[_0x42c6('0x41')](_0x3802ab[_0x42c6('0x38')][_0x42c6('0x41')]);_0x400620[_0x42c6('0x45')]=qs[_0x42c6('0x3a')](_[_0x42c6('0x42')](_0x3802ab['query'],_0x50a8e5[_0x42c6('0x3a')]));if(_0x3802ab[_0x42c6('0x38')][_0x42c6('0x43')]){_0x400620[_0x42c6('0x45')]=_['merge'](_0x400620[_0x42c6('0x45')],{'$or':_[_0x42c6('0x46')](_0x400620['attributes'],function(_0x421e10){var _0x192576={};_0x192576[_0x421e10]={'$like':'%'+_0x3802ab[_0x42c6('0x38')][_0x42c6('0x43')]+'%'};return _0x192576;})});}_0x400620=_['merge']({},_0x400620,_0x3802ab[_0x42c6('0x4a')]);return _0x56af9c[_0x42c6('0x51')](_0x400620);}})['then'](function(_0xba12f1){if(_0xba12f1){_0x4d640c=_0xba12f1[_0x42c6('0x3e')];if(!_0x3802ab[_0x42c6('0x38')][_0x42c6('0x54')](_0x42c6('0x3f'))){_0x400620[_0x42c6('0x2b')]=qs[_0x42c6('0x2b')](_0x3802ab[_0x42c6('0x38')][_0x42c6('0x2b')]);_0x400620[_0x42c6('0x2a')]=qs[_0x42c6('0x2a')](_0x3802ab['query'][_0x42c6('0x2a')]);}return _0x56af9c[_0x42c6('0x51')](_0x400620);}})[_0x42c6('0x1c')](function(_0x2b6738){if(_0x2b6738){return _0x2b6738?{'count':_0x4d640c,'rows':_0x2b6738}:null;}})[_0x42c6('0x1c')](respondWithResult(_0x29c7a4,null))[_0x42c6('0x26')](handleError(_0x29c7a4,null));};exports[_0x42c6('0x55')]=function(_0x574038,_0x1b2169,_0x58e5a4){if(_0x574038[_0x42c6('0x50')]['id']){delete _0x574038[_0x42c6('0x50')]['id'];}return db[_0x42c6('0x36')][_0x42c6('0x52')]({'where':{'id':_0x574038['params']['id']}})[_0x42c6('0x1c')](handleEntityNotFound(_0x1b2169,null))[_0x42c6('0x1c')](function(_0x3f40a4){if(_0x3f40a4){_0x574038[_0x42c6('0x50')][_0x42c6('0x56')]=_0x3f40a4['id'];_0x574038[_0x42c6('0x50')]['Subjects']=integrations[_0x42c6('0x57')](_0x574038[_0x42c6('0x50')][_0x42c6('0x58')],_0x574038[_0x42c6('0x50')][_0x42c6('0x47')]);_0x574038[_0x42c6('0x50')]['Descriptions']=integrations[_0x42c6('0x59')](_0x574038[_0x42c6('0x50')][_0x42c6('0x58')],_0x574038[_0x42c6('0x50')][_0x42c6('0x47')]);return db[_0x42c6('0x5a')][_0x42c6('0x4f')](_0x574038[_0x42c6('0x50')],{'include':[{'model':db[_0x42c6('0x5b')],'as':'Subjects'},{'model':db[_0x42c6('0x5b')],'as':'Descriptions'}]});}return null;})[_0x42c6('0x1c')](respondWithResult(_0x1b2169,null))['catch'](handleError(_0x1b2169,null));};exports[_0x42c6('0x5c')]=function(_0x39ccd1,_0x52b231,_0x532c0a){var _0x5c7b74=_0x39ccd1['query'][_0x42c6('0x5d')];var _0x1c7ba9=_0x5c7b74===_0x42c6('0x5e')?'Incident':_0x42c6('0x5f');var _0x2ab546='';var _0x144315='';var _0x204bc0='';var _0xda3435='';var _0x1181c4='';var _0x47c520='';var _0xce5632='';var _0x1e8957='';var _0x3be9b9=[_0x42c6('0x60'),_0x42c6('0x61'),_0x42c6('0x62'),'ownerid',_0x42c6('0x63'),_0x42c6('0x64'),'phonenumber',_0x42c6('0x65'),_0x42c6('0x66'),_0x42c6('0x67')];var _0x365e89=['accountidname',_0x42c6('0x68'),_0x42c6('0x69'),_0x42c6('0x6a'),_0x42c6('0x6b'),'contactidyominame','contractdetailidname',_0x42c6('0x6c'),_0x42c6('0x6d'),_0x42c6('0x6e'),'createdbyname',_0x42c6('0x6f'),_0x42c6('0x70'),_0x42c6('0x71'),'createdonbehalfbyyominame',_0x42c6('0x72'),_0x42c6('0x73'),_0x42c6('0x74'),'emailaddress',_0x42c6('0x75'),_0x42c6('0x76'),_0x42c6('0x77'),_0x42c6('0x78'),_0x42c6('0x79'),_0x42c6('0x7a'),_0x42c6('0x7b'),_0x42c6('0x7c'),'influencescore',_0x42c6('0x7d'),_0x42c6('0x7e'),_0x42c6('0x7f'),_0x42c6('0x80'),_0x42c6('0x81'),'modifiedbyname',_0x42c6('0x82'),'modifiedon',_0x42c6('0x83'),_0x42c6('0x84'),'msdyn_incidenttypename','msdyn_iotalertname',_0x42c6('0x85'),_0x42c6('0x86'),_0x42c6('0x87'),_0x42c6('0x88'),_0x42c6('0x89'),_0x42c6('0x8a'),'parentcaseidname',_0x42c6('0x8b'),_0x42c6('0x8c'),_0x42c6('0x8d'),_0x42c6('0x8e'),_0x42c6('0x8f'),_0x42c6('0x90'),_0x42c6('0x91'),_0x42c6('0x92'),'responsiblecontactidname',_0x42c6('0x93'),_0x42c6('0x94'),_0x42c6('0x95'),_0x42c6('0x96'),_0x42c6('0x97'),_0x42c6('0x98'),'statuscode',_0x42c6('0x99'),_0x42c6('0x9a'),'timezoneruleversionnumber',_0x42c6('0x9b'),_0x42c6('0x9c'),_0x42c6('0x9d'),'versionnumber'];var _0x58847a=_0x3be9b9[_0x42c6('0x9e')](_0x365e89);return db[_0x42c6('0x36')][_0x42c6('0x52')]({'where':{'id':_0x39ccd1[_0x42c6('0x4d')]['id']},'attributes':['id',_0x42c6('0x9f'),_0x42c6('0xa0'),'remoteUri',_0x42c6('0xa1'),'clientId','clientSecret']})[_0x42c6('0x1c')](handleEntityNotFound(_0x52b231,null))[_0x42c6('0x1c')](function(_0x3fb279){if(_0x3fb279){_0x1e8957=_0x3fb279[_0x42c6('0xa2')];var _0x1c3228=_0x1e8957[_0x42c6('0xa3')](-0x1);if(_0x1c3228==='/'){_0x1e8957=_0x1e8957['substring'](0x0,_0x1e8957[_0x42c6('0xa4')](_0x1c3228));}_0xce5632=util[_0x42c6('0xa5')](_0x42c6('0xa6'),_0x1e8957);var _0x313491={'method':_0x42c6('0xa7'),'uri':_0x42c6('0xa8')+_0x3fb279[_0x42c6('0xa1')]+'/oauth2/token','form':{'client_id':_0x3fb279[_0x42c6('0xa9')],'resource':_0x1e8957,'username':_0x3fb279[_0x42c6('0x9f')],'password':_0x3fb279[_0x42c6('0xa0')],'grant_type':'password','client_secret':_0x3fb279[_0x42c6('0xaa')]},'json':!![]};return rp(_0x313491);}})['then'](function(_0x21ace5){_0x47c520=_0x21ace5['access_token'];var _0x5f590d={'method':_0x42c6('0xab'),'uri':encodeURI(_0xce5632+_0x42c6('0xac')+_0x1c7ba9+'\x27'),'headers':{'Authorization':_0x42c6('0xad')+_0x47c520,'If-None-Match':null,'OData-Version':_0x42c6('0xae')},'json':!![]};return rp(_0x5f590d);})['then'](function(_0x58b535){var _0x3fc7d5=_0x58b535[_0x42c6('0xaf')][0x0];var _0x2050c0=_0x3fc7d5[_0x42c6('0xb0')];var _0x4a0d0c={'method':_0x42c6('0xab'),'uri':_0xce5632+_0x42c6('0xb1')+_0x2050c0+_0x42c6('0xb2'),'headers':{'Authorization':_0x42c6('0xad')+_0x47c520,'If-None-Match':null,'OData-Version':_0x42c6('0xae')},'json':!![]};return rp(_0x4a0d0c);})[_0x42c6('0x1c')](function(_0x6c9ef7){_0x2ab546=_0x6c9ef7;_0x144315=_0x2ab546['Attributes'];_0x144315=_['remove'](_0x144315,function(_0x1744b9){return!_0x58847a[_0x42c6('0xb3')](_0x1744b9[_0x42c6('0xb4')]);});var _0x399256=[];var _0xa479aa=[];_0x144315[_0x42c6('0xb5')](function(_0x17d275){if(_0x17d275[_0x42c6('0xb6')]){var _0x6cc177=_0x17d275[_0x42c6('0xb6')][_0x42c6('0xb7')](_0x17d275[_0x42c6('0xb6')]['lastIndexOf']('.')+0x1);if(_0x6cc177===_0x42c6('0xb8')){_0x399256[_0x42c6('0xb9')](getSelectList(_0xce5632,_0x5c7b74,_0xa479aa,_0x2ab546['MetadataId'],_0x17d275[_0x42c6('0xb0')],_0x47c520));}}});return Promise[_0x42c6('0xba')](_0x399256);})[_0x42c6('0x1c')](function(_0x15936f){_0x204bc0=_0x15936f[0x0];var _0x439bca=[];var _0x41f9dc=[];_0x144315[_0x42c6('0xb5')](function(_0x3169f1){if(!_[_0x42c6('0xbb')](_0x3169f1['@odata.type'])){var _0x495e3f=_0x3169f1[_0x42c6('0xb6')][_0x42c6('0xb7')](_0x3169f1['@odata.type'][_0x42c6('0xa4')]('.')+0x1);if(_0x495e3f===_0x42c6('0xbc')){_0x439bca[_0x42c6('0xb9')](getBooleanList(_0xce5632,_0x5c7b74,_0x41f9dc,_0x2ab546['MetadataId'],_0x3169f1[_0x42c6('0xb0')],_0x47c520));}}});return Promise[_0x42c6('0xba')](_0x439bca);})[_0x42c6('0x1c')](function(_0x8ac46e){_0xda3435=_0x8ac46e[0x0];var _0x535680=[];var _0x39e476=[];_0x144315[_0x42c6('0xb5')](function(_0x58cbe8){if(_0x58cbe8[_0x42c6('0xb6')]){var _0x188213=_0x58cbe8['@odata.type']['substring'](_0x58cbe8[_0x42c6('0xb6')][_0x42c6('0xa4')]('.')+0x1);if(_0x188213===_0x42c6('0xbd')||_0x188213===_0x42c6('0xbe')||_0x188213===_0x42c6('0xbf')||_0x188213===_0x42c6('0xc0')||_0x188213==='MemoAttributeMetadata'||_0x188213===_0x42c6('0xc1')||_0x188213===_0x42c6('0xc2')||_0x188213===_0x42c6('0xc3')||_0x188213===_0x42c6('0xc4')||_0x188213==='DecimalAttributeMetadata'){_0x535680[_0x42c6('0xb9')](getInputList(_0xce5632,_0x5c7b74,_0x188213,_0x39e476,_0x2ab546[_0x42c6('0xb0')],_0x58cbe8[_0x42c6('0xb0')],_0x47c520));}}});return Promise['all'](_0x535680);})[_0x42c6('0x1c')](function(_0x1f1b69){_0x1181c4=_0x1f1b69[0x0];var _0x1293bc=_0x204bc0[_0x42c6('0x9e')](_0xda3435)[_0x42c6('0x9e')](_0x1181c4);var _0x5c7d5b={'count':_0x1293bc[_0x42c6('0x3e')],'rows':_0x1293bc};return _0x5c7d5b;})[_0x42c6('0x1c')](respondWithResult(_0x52b231,null))['catch'](function(_0x13ec39){console['log'](_0x42c6('0xc5')+_0x13ec39);var _0x52539e=_0x39ccd1[_0x42c6('0x38')]['test']?0x1f4:_0x13ec39['statusCode']||0x1f4;logger['error'](_0x13ec39[_0x42c6('0x32')]);delete _0x13ec39['name'];if(_0x52539e===0x191){_0x52539e=0x190;}_0x52b231['status'](_0x52539e)[_0x42c6('0x34')](_0x39ccd1[_0x42c6('0x38')][_0x42c6('0x1a')]?{'message':_0x42c6('0xc6'),'statusCode':_0x13ec39[_0x42c6('0xc7')]}:_0x13ec39);});};function getSelectList(_0xfd2315,_0x37e097,_0x553dc6,_0x2ee020,_0x12d262,_0x33d37b){var _0x3b4ca7={'method':_0x42c6('0xab'),'uri':_0xfd2315+_0x42c6('0xb1')+_0x2ee020+_0x42c6('0xc8')+_0x12d262+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x42c6('0xc9'),'headers':{'Authorization':_0x42c6('0xad')+_0x33d37b,'If-None-Match':null,'OData-Version':_0x42c6('0xae')},'json':!![]};return rp(_0x3b4ca7)[_0x42c6('0x1c')](function(_0x10fce7){var _0x2eca29=[];var _0x48798a=_0x10fce7[_0x42c6('0xca')][_0x42c6('0xcb')];_0x48798a[_0x42c6('0xb5')](function(_0x5ba6d3){_0x2eca29[_0x42c6('0xb9')]({'name':_0x5ba6d3[_0x42c6('0xcc')][_0x42c6('0xcd')]['Label'],'value':String(_0x5ba6d3[_0x42c6('0xce')])});});var _0x42d7ec={'id':_0x37e097+'_'+_0x10fce7[_0x42c6('0xb4')],'name':_0x10fce7[_0x42c6('0xcf')][_0x42c6('0xcd')][_0x42c6('0xcc')],'custom':![],'options':_0x2eca29};_0x553dc6[_0x42c6('0xb9')](_0x42d7ec);return _0x553dc6;});}function getBooleanList(_0x2ad797,_0xcd059f,_0x1ebf8b,_0x593c33,_0x55838f,_0x2c2812){var _0x5dbcc6={'method':_0x42c6('0xab'),'uri':_0x2ad797+_0x42c6('0xb1')+_0x593c33+_0x42c6('0xc8')+_0x55838f+_0x42c6('0xd0'),'headers':{'Authorization':_0x42c6('0xad')+_0x2c2812,'If-None-Match':null,'OData-Version':_0x42c6('0xae')},'json':!![]};return rp(_0x5dbcc6)[_0x42c6('0x1c')](function(_0x154c8d){var _0xa37bfb=[];_0xa37bfb[_0x42c6('0xb9')]({'name':_0x154c8d['OptionSet'][_0x42c6('0xd1')][_0x42c6('0xcc')][_0x42c6('0xcd')]['Label'],'value':_0x42c6('0xd2')},{'name':_0x154c8d[_0x42c6('0xca')][_0x42c6('0xd3')]['Label'][_0x42c6('0xcd')][_0x42c6('0xcc')],'value':_0x42c6('0xd4')});var _0xeb46af={'id':_0xcd059f+'_'+_0x154c8d[_0x42c6('0xb4')],'name':_0x154c8d[_0x42c6('0xcf')][_0x42c6('0xcd')][_0x42c6('0xcc')],'custom':![],'options':_0xa37bfb};_0x1ebf8b[_0x42c6('0xb9')](_0xeb46af);return _0x1ebf8b;});}function getInputList(_0x4cb903,_0x41cbee,_0x1a4e1b,_0x300e31,_0x71c57b,_0x2b063d,_0x3ad672){var _0x4d482e={'method':_0x42c6('0xab'),'uri':_0x4cb903+_0x42c6('0xb1')+_0x71c57b+')/Attributes('+_0x2b063d+')/Microsoft.Dynamics.CRM.'+_0x1a4e1b+_0x42c6('0xd5'),'headers':{'Authorization':_0x42c6('0xad')+_0x3ad672,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4d482e)['then'](function(_0x3e52a7){var _0x4985cb={'id':_0x41cbee+'_'+_0x3e52a7['LogicalName'],'name':_0x3e52a7[_0x42c6('0xcf')][_0x42c6('0xcd')]?_0x3e52a7['DisplayName'][_0x42c6('0xcd')][_0x42c6('0xcc')]:_0x3e52a7[_0x42c6('0xb4')],'custom':![],'options':[]};_0x300e31[_0x42c6('0xb9')](_0x4985cb);return _0x300e31;});} \ No newline at end of file +var _0xc8f8=['StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','send','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value','GET',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../mysqldb','client','request','then','info','request\x20sent','debug','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','end','stack','name','index','Dynamics365Account','rawAttributes','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','show','params','create','body','find','destroy','getConfigurations','findOne','Dynamics365Configuration','pick','map','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','Incident','title','description','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','prioritycodename','productidname','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','username','password','remoteUri','clientId','clientSecret','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','access_token','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','@odata.type','push','forEach','isNil','substring','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata'];(function(_0x5e9841,_0x51d53b){var _0x33e84f=function(_0x24623a){while(--_0x24623a){_0x5e9841['push'](_0x5e9841['shift']());}};_0x33e84f(++_0x51d53b);}(_0xc8f8,0x1cc));var _0x8c8f=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xc8f8[_0x278e3c];return _0x3e2d9b;};'use strict';var pdf=require(_0x8c8f('0x0'));var emlformat=require(_0x8c8f('0x1'));var rimraf=require(_0x8c8f('0x2'));var zipdir=require(_0x8c8f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8c8f('0x4'));var moment=require(_0x8c8f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8c8f('0x6'));var util=require(_0x8c8f('0x7'));var path=require(_0x8c8f('0x8'));var sox=require(_0x8c8f('0x9'));var csv=require(_0x8c8f('0xa'));var ejs=require(_0x8c8f('0xb'));var fs=require('fs');var _=require(_0x8c8f('0xc'));var squel=require(_0x8c8f('0xd'));var crypto=require(_0x8c8f('0xe'));var jsforce=require(_0x8c8f('0xf'));var deskjs=require(_0x8c8f('0x10'));var toCsv=require(_0x8c8f('0xa'));var querystring=require(_0x8c8f('0x11'));var Papa=require('papaparse');var Redis=require(_0x8c8f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x8c8f('0x13'));var logger=require('../../config/logger')(_0x8c8f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x8c8f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x8c8f('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x3cf77d,_0x3d2413,_0x3dedf5){if(_0x3dedf5){var _0x15f54d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x15f54d['test'](_0x3d2413)){return _0x3cf77d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3cf77d;}}function respondWithRpcPromise(_0x321462,_0x3f3ff7,_0x42e084,_0x5b77f2){return new BPromise(function(_0x2edd9a,_0x2613dd){var _0x5ad27d=_0x5b77f2||client;return _0x5ad27d[_0x8c8f('0x17')](_0x321462,_0x42e084)[_0x8c8f('0x18')](function(_0x358c2a){logger[_0x8c8f('0x19')]('Dynamics365Account,\x20%s,\x20%s',_0x3f3ff7,_0x8c8f('0x1a'));logger[_0x8c8f('0x1b')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3f3ff7,_0x8c8f('0x1a'),JSON[_0x8c8f('0x1c')](_0x358c2a));if(_0x358c2a[_0x8c8f('0x1d')]){if(_0x358c2a[_0x8c8f('0x1d')][_0x8c8f('0x1e')]===0x1f4){logger[_0x8c8f('0x1d')]('Dynamics365Account,\x20%s,\x20%s',_0x3f3ff7,_0x358c2a[_0x8c8f('0x1d')]['message']);return _0x2613dd(_0x358c2a['error'][_0x8c8f('0x1f')]);}logger[_0x8c8f('0x1d')](_0x8c8f('0x20'),_0x3f3ff7,_0x358c2a[_0x8c8f('0x1d')][_0x8c8f('0x1f')]);return _0x2edd9a(_0x358c2a[_0x8c8f('0x1d')][_0x8c8f('0x1f')]);}else{logger[_0x8c8f('0x19')](_0x8c8f('0x20'),_0x3f3ff7,_0x8c8f('0x1a'));_0x2edd9a(_0x358c2a[_0x8c8f('0x21')]['message']);}})[_0x8c8f('0x22')](function(_0x2c7939){logger[_0x8c8f('0x1d')](_0x8c8f('0x20'),_0x3f3ff7,_0x2c7939);_0x2613dd(_0x2c7939);});});}function respondWithStatusCode(_0x38631b,_0x488924){_0x488924=_0x488924||0xcc;return function(_0x7d258d){if(_0x7d258d){return _0x38631b[_0x8c8f('0x23')](_0x488924);}return _0x38631b[_0x8c8f('0x24')](_0x488924)['end']();};}function respondWithResult(_0x432933,_0x1a8c4a){_0x1a8c4a=_0x1a8c4a||0xc8;return function(_0x6e4ad2){if(_0x6e4ad2){return _0x432933[_0x8c8f('0x24')](_0x1a8c4a)[_0x8c8f('0x25')](_0x6e4ad2);}};}function respondWithFilteredResult(_0x3f14c9,_0x1fa65){return function(_0x5b1fe9){if(_0x5b1fe9){var _0x2a7838=_0x5b1fe9[_0x8c8f('0x26')],_0x274a2b=_0x1fa65['offset'],_0x30e8e7=_0x1fa65[_0x8c8f('0x27')]+_0x1fa65[_0x8c8f('0x28')],_0x5bbb6b;if(_0x30e8e7>=_0x2a7838){_0x30e8e7=_0x2a7838;_0x5bbb6b=0xc8;}else{_0x5bbb6b=0xce;}_0x3f14c9[_0x8c8f('0x24')](_0x5bbb6b);return _0x3f14c9[_0x8c8f('0x29')](_0x8c8f('0x2a'),_0x274a2b+'-'+_0x30e8e7+'/'+_0x2a7838)[_0x8c8f('0x25')](_0x5b1fe9);}return null;};}function patchUpdates(_0x2f7791){return function(_0x379d3d){try{jsonpatch[_0x8c8f('0x2b')](_0x379d3d,_0x2f7791,!![]);}catch(_0x5a6bdb){return BPromise['reject'](_0x5a6bdb);}return _0x379d3d[_0x8c8f('0x2c')]();};}function saveUpdates(_0x4c96d5,_0x5edc6d){return function(_0x2b5b91){if(_0x2b5b91){return _0x2b5b91[_0x8c8f('0x2d')](_0x4c96d5)[_0x8c8f('0x18')](function(_0x58632e){return _0x58632e;});}return null;};}function removeEntity(_0x4b9a7c,_0x2f2879){return function(_0x553ae1){if(_0x553ae1){return _0x553ae1['destroy']()[_0x8c8f('0x18')](function(){_0x4b9a7c[_0x8c8f('0x24')](0xcc)[_0x8c8f('0x2e')]();});}};}function handleEntityNotFound(_0xed4a4f,_0x365ddf){return function(_0x252238){if(!_0x252238){_0xed4a4f['sendStatus'](0x194);}return _0x252238;};}function handleError(_0x3bab08,_0x9499d0){_0x9499d0=_0x9499d0||0x1f4;return function(_0x18d6bd){logger[_0x8c8f('0x1d')](_0x18d6bd[_0x8c8f('0x2f')]);if(_0x18d6bd[_0x8c8f('0x30')]){delete _0x18d6bd['name'];}_0x3bab08[_0x8c8f('0x24')](_0x9499d0)['send'](_0x18d6bd);};}exports[_0x8c8f('0x31')]=function(_0x469839,_0xac6da0){var _0x10dca6={},_0x3369ad={},_0x4b9b0f={'count':0x0,'rows':[]};var _0x95df8b=db[_0x8c8f('0x32')][_0x8c8f('0x33')];_0x3369ad['model']=_[_0x8c8f('0x34')](_0x95df8b);_0x3369ad[_0x8c8f('0x35')]=_[_0x8c8f('0x34')](_0x469839[_0x8c8f('0x35')]);_0x3369ad['filters']=_['intersection'](_0x3369ad['model'],_0x3369ad[_0x8c8f('0x35')]);_0x10dca6[_0x8c8f('0x36')]=_[_0x8c8f('0x37')](_0x3369ad[_0x8c8f('0x38')],qs[_0x8c8f('0x39')](_0x469839[_0x8c8f('0x35')][_0x8c8f('0x39')]));_0x10dca6['attributes']=_0x10dca6[_0x8c8f('0x36')][_0x8c8f('0x3a')]?_0x10dca6[_0x8c8f('0x36')]:_0x3369ad[_0x8c8f('0x38')];if(!_0x469839['query'][_0x8c8f('0x3b')](_0x8c8f('0x3c'))){_0x10dca6[_0x8c8f('0x28')]=qs[_0x8c8f('0x28')](_0x469839['query'][_0x8c8f('0x28')]);_0x10dca6[_0x8c8f('0x27')]=qs[_0x8c8f('0x27')](_0x469839['query'][_0x8c8f('0x27')]);}_0x10dca6[_0x8c8f('0x3d')]=qs[_0x8c8f('0x3e')](_0x469839[_0x8c8f('0x35')]['sort']);_0x10dca6[_0x8c8f('0x3f')]=qs[_0x8c8f('0x40')](_['pick'](_0x469839[_0x8c8f('0x35')],_0x3369ad[_0x8c8f('0x40')]));if(_0x469839['query'][_0x8c8f('0x41')]){_0x10dca6[_0x8c8f('0x3f')]=_['merge'](_0x10dca6[_0x8c8f('0x3f')],{'$or':_['map'](_0x95df8b,function(_0xd501d){if(_0xd501d[_0x8c8f('0x42')]['key']!==_0x8c8f('0x43')){var _0x28e57a={};_0x28e57a[_0xd501d[_0x8c8f('0x44')]]={'$like':'%'+_0x469839[_0x8c8f('0x35')]['filter']+'%'};return _0x28e57a;}})});}_0x10dca6=_[_0x8c8f('0x45')]({},_0x10dca6,_0x469839[_0x8c8f('0x46')]);var _0x3af9d7={'where':_0x10dca6[_0x8c8f('0x3f')]};return db[_0x8c8f('0x32')][_0x8c8f('0x26')](_0x3af9d7)['then'](function(_0x27be03){_0x4b9b0f[_0x8c8f('0x26')]=_0x27be03;if(_0x469839[_0x8c8f('0x35')][_0x8c8f('0x47')]){_0x10dca6[_0x8c8f('0x48')]=[{'all':!![]}];}return db[_0x8c8f('0x32')][_0x8c8f('0x49')](_0x10dca6);})[_0x8c8f('0x18')](function(_0x494102){_0x4b9b0f[_0x8c8f('0x4a')]=_0x494102;return _0x4b9b0f;})[_0x8c8f('0x18')](respondWithFilteredResult(_0xac6da0,_0x10dca6))[_0x8c8f('0x22')](handleError(_0xac6da0,null));};exports[_0x8c8f('0x4b')]=function(_0x42a18c,_0x556019){var _0x280453={'raw':![],'where':{'id':_0x42a18c[_0x8c8f('0x4c')]['id']}},_0x2308e1={};_0x2308e1['model']=_[_0x8c8f('0x34')](db[_0x8c8f('0x32')][_0x8c8f('0x33')]);_0x2308e1[_0x8c8f('0x35')]=_[_0x8c8f('0x34')](_0x42a18c['query']);_0x2308e1[_0x8c8f('0x40')]=_[_0x8c8f('0x37')](_0x2308e1['model'],_0x2308e1[_0x8c8f('0x35')]);_0x280453[_0x8c8f('0x36')]=_['intersection'](_0x2308e1[_0x8c8f('0x38')],qs['fields'](_0x42a18c[_0x8c8f('0x35')]['fields']));_0x280453['attributes']=_0x280453[_0x8c8f('0x36')][_0x8c8f('0x3a')]?_0x280453[_0x8c8f('0x36')]:_0x2308e1[_0x8c8f('0x38')];if(_0x42a18c[_0x8c8f('0x35')][_0x8c8f('0x47')]){_0x280453[_0x8c8f('0x48')]=[{'all':!![]}];}_0x280453=_[_0x8c8f('0x45')]({},_0x280453,_0x42a18c[_0x8c8f('0x46')]);return db[_0x8c8f('0x32')]['find'](_0x280453)[_0x8c8f('0x18')](handleEntityNotFound(_0x556019,null))[_0x8c8f('0x18')](respondWithResult(_0x556019,null))[_0x8c8f('0x22')](handleError(_0x556019,null));};exports[_0x8c8f('0x4d')]=function(_0x9f17bc,_0x2276ce){return db['Dynamics365Account']['create'](_0x9f17bc[_0x8c8f('0x4e')],{})[_0x8c8f('0x18')](respondWithResult(_0x2276ce,0xc9))[_0x8c8f('0x22')](handleError(_0x2276ce,null));};exports[_0x8c8f('0x2d')]=function(_0x5f3651,_0x2f9630){if(_0x5f3651['body']['id']){delete _0x5f3651[_0x8c8f('0x4e')]['id'];}return db[_0x8c8f('0x32')][_0x8c8f('0x4f')]({'where':{'id':_0x5f3651[_0x8c8f('0x4c')]['id']}})[_0x8c8f('0x18')](handleEntityNotFound(_0x2f9630,null))[_0x8c8f('0x18')](saveUpdates(_0x5f3651[_0x8c8f('0x4e')],null))[_0x8c8f('0x18')](respondWithResult(_0x2f9630,null))['catch'](handleError(_0x2f9630,null));};exports[_0x8c8f('0x50')]=function(_0x1e738c,_0x294f29){return db['Dynamics365Account'][_0x8c8f('0x4f')]({'where':{'id':_0x1e738c[_0x8c8f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x294f29,null))['then'](removeEntity(_0x294f29,null))[_0x8c8f('0x22')](handleError(_0x294f29,null));};exports[_0x8c8f('0x51')]=function(_0x1de7df,_0x308e71,_0x4c86ec){var _0x3aa0fd={};var _0x22dbac={};var _0x319735;var _0x431b4c;return db[_0x8c8f('0x32')][_0x8c8f('0x52')]({'where':{'id':_0x1de7df[_0x8c8f('0x4c')]['id']}})[_0x8c8f('0x18')](handleEntityNotFound(_0x308e71,null))[_0x8c8f('0x18')](function(_0x480f4){if(_0x480f4){_0x319735=_0x480f4;_0x22dbac[_0x8c8f('0x38')]=_[_0x8c8f('0x34')](db[_0x8c8f('0x53')][_0x8c8f('0x33')]);_0x22dbac[_0x8c8f('0x35')]=_['keys'](_0x1de7df[_0x8c8f('0x35')]);_0x22dbac[_0x8c8f('0x40')]=_[_0x8c8f('0x37')](_0x22dbac['model'],_0x22dbac[_0x8c8f('0x35')]);_0x3aa0fd[_0x8c8f('0x36')]=_['intersection'](_0x22dbac['model'],qs[_0x8c8f('0x39')](_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x39')]));_0x3aa0fd[_0x8c8f('0x36')]=_0x3aa0fd[_0x8c8f('0x36')][_0x8c8f('0x3a')]?_0x3aa0fd[_0x8c8f('0x36')]:_0x22dbac['model'];_0x3aa0fd[_0x8c8f('0x3d')]=qs[_0x8c8f('0x3e')](_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x3e')]);_0x3aa0fd[_0x8c8f('0x3f')]=qs[_0x8c8f('0x40')](_[_0x8c8f('0x54')](_0x1de7df[_0x8c8f('0x35')],_0x22dbac['filters']));if(_0x1de7df[_0x8c8f('0x35')]['filter']){_0x3aa0fd[_0x8c8f('0x3f')]=_[_0x8c8f('0x45')](_0x3aa0fd[_0x8c8f('0x3f')],{'$or':_[_0x8c8f('0x55')](_0x3aa0fd['attributes'],function(_0x191b61){var _0x686681={};_0x686681[_0x191b61]={'$like':'%'+_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x41')]+'%'};return _0x686681;})});}_0x3aa0fd=_[_0x8c8f('0x45')]({},_0x3aa0fd,_0x1de7df['options']);return _0x319735[_0x8c8f('0x51')](_0x3aa0fd);}})[_0x8c8f('0x18')](function(_0x32d1da){if(_0x32d1da){_0x431b4c=_0x32d1da[_0x8c8f('0x3a')];if(!_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x3b')]('nolimit')){_0x3aa0fd['limit']=qs[_0x8c8f('0x28')](_0x1de7df[_0x8c8f('0x35')][_0x8c8f('0x28')]);_0x3aa0fd[_0x8c8f('0x27')]=qs[_0x8c8f('0x27')](_0x1de7df['query'][_0x8c8f('0x27')]);}return _0x319735[_0x8c8f('0x51')](_0x3aa0fd);}})[_0x8c8f('0x18')](function(_0x444adb){if(_0x444adb){return _0x444adb?{'count':_0x431b4c,'rows':_0x444adb}:null;}})[_0x8c8f('0x18')](respondWithResult(_0x308e71,null))['catch'](handleError(_0x308e71,null));};exports[_0x8c8f('0x56')]=function(_0x2f654a,_0x28df47,_0x1adbd4){if(_0x2f654a[_0x8c8f('0x4e')]['id']){delete _0x2f654a[_0x8c8f('0x4e')]['id'];}return db[_0x8c8f('0x32')]['findOne']({'where':{'id':_0x2f654a['params']['id']}})[_0x8c8f('0x18')](handleEntityNotFound(_0x28df47,null))[_0x8c8f('0x18')](function(_0x112a2f){if(_0x112a2f){_0x2f654a[_0x8c8f('0x4e')]['AccountId']=_0x112a2f['id'];_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x57')]=integrations[_0x8c8f('0x58')](_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x59')],_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x42')]);_0x2f654a[_0x8c8f('0x4e')][_0x8c8f('0x5a')]=integrations[_0x8c8f('0x5b')](_0x2f654a['body'][_0x8c8f('0x59')],_0x2f654a[_0x8c8f('0x4e')]['type']);return db[_0x8c8f('0x53')]['create'](_0x2f654a['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0x8c8f('0x57')},{'model':db[_0x8c8f('0x5c')],'as':'Descriptions'}]});}return null;})[_0x8c8f('0x18')](respondWithResult(_0x28df47,null))[_0x8c8f('0x22')](handleError(_0x28df47,null));};exports[_0x8c8f('0x5d')]=function(_0x51d4f6,_0x40d4b1,_0x4edbab){var _0xe3399d=_0x51d4f6[_0x8c8f('0x35')][_0x8c8f('0x5e')];var _0x4aa9b3=_0xe3399d==='incident'?_0x8c8f('0x5f'):'PhoneCall';var _0x38f4d4='';var _0x4a9238='';var _0x2927d9='';var _0x46d75e='';var _0x448251='';var _0x388dad='';var _0x5a0c89='';var _0x5e17fd='';var _0x60d1bc=[_0x8c8f('0x60'),_0x8c8f('0x61'),_0x8c8f('0x62'),'ownerid',_0x8c8f('0x63'),_0x8c8f('0x64'),_0x8c8f('0x65'),_0x8c8f('0x66'),_0x8c8f('0x67'),_0x8c8f('0x68')];var _0x5a80e0=[_0x8c8f('0x69'),'accountidyominame',_0x8c8f('0x6a'),_0x8c8f('0x6b'),_0x8c8f('0x6c'),_0x8c8f('0x6d'),_0x8c8f('0x6e'),_0x8c8f('0x6f'),_0x8c8f('0x70'),_0x8c8f('0x71'),_0x8c8f('0x72'),_0x8c8f('0x73'),'createdon',_0x8c8f('0x74'),'createdonbehalfbyyominame',_0x8c8f('0x75'),_0x8c8f('0x76'),_0x8c8f('0x77'),_0x8c8f('0x78'),_0x8c8f('0x79'),_0x8c8f('0x7a'),_0x8c8f('0x7b'),_0x8c8f('0x7c'),_0x8c8f('0x7d'),_0x8c8f('0x7e'),_0x8c8f('0x7f'),'importsequencenumber',_0x8c8f('0x80'),_0x8c8f('0x81'),_0x8c8f('0x82'),_0x8c8f('0x83'),_0x8c8f('0x84'),_0x8c8f('0x85'),_0x8c8f('0x86'),_0x8c8f('0x87'),_0x8c8f('0x88'),'modifiedonbehalfbyname',_0x8c8f('0x89'),_0x8c8f('0x8a'),_0x8c8f('0x8b'),_0x8c8f('0x8c'),'onholdtime',_0x8c8f('0x8d'),_0x8c8f('0x8e'),_0x8c8f('0x8f'),_0x8c8f('0x90'),'parentcaseidname',_0x8c8f('0x91'),'primarycontactidyominame',_0x8c8f('0x92'),_0x8c8f('0x93'),'productserialnumber',_0x8c8f('0x94'),_0x8c8f('0x95'),_0x8c8f('0x96'),_0x8c8f('0x97'),_0x8c8f('0x98'),_0x8c8f('0x99'),'slainvokedidname',_0x8c8f('0x9a'),_0x8c8f('0x9b'),'statecode',_0x8c8f('0x9c'),_0x8c8f('0x9d'),_0x8c8f('0x9e'),_0x8c8f('0x9f'),'transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber'];var _0x2f0b89=_0x60d1bc['concat'](_0x5a80e0);return db[_0x8c8f('0x32')][_0x8c8f('0x52')]({'where':{'id':_0x51d4f6[_0x8c8f('0x4c')]['id']},'attributes':['id',_0x8c8f('0xa0'),_0x8c8f('0xa1'),_0x8c8f('0xa2'),'tenantId',_0x8c8f('0xa3'),_0x8c8f('0xa4')]})[_0x8c8f('0x18')](handleEntityNotFound(_0x40d4b1,null))[_0x8c8f('0x18')](function(_0x140285){if(_0x140285){_0x5e17fd=_0x140285[_0x8c8f('0xa2')];var _0x254cd5=_0x5e17fd['slice'](-0x1);if(_0x254cd5==='/'){_0x5e17fd=_0x5e17fd['substring'](0x0,_0x5e17fd[_0x8c8f('0xa5')](_0x254cd5));}_0x5a0c89=util[_0x8c8f('0xa6')](_0x8c8f('0xa7'),_0x5e17fd);var _0x4bb5f0={'method':_0x8c8f('0xa8'),'uri':_0x8c8f('0xa9')+_0x140285[_0x8c8f('0xaa')]+'/oauth2/token','form':{'client_id':_0x140285[_0x8c8f('0xa3')],'resource':_0x5e17fd,'username':_0x140285[_0x8c8f('0xa0')],'password':_0x140285[_0x8c8f('0xa1')],'grant_type':_0x8c8f('0xa1'),'client_secret':_0x140285[_0x8c8f('0xa4')]},'json':!![]};return rp(_0x4bb5f0);}})[_0x8c8f('0x18')](function(_0x2493dd){_0x388dad=_0x2493dd[_0x8c8f('0xab')];var _0x1df6e1={'method':'GET','uri':encodeURI(_0x5a0c89+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x4aa9b3+'\x27'),'headers':{'Authorization':_0x8c8f('0xac')+_0x388dad,'If-None-Match':null,'OData-Version':_0x8c8f('0xad')},'json':!![]};return rp(_0x1df6e1);})['then'](function(_0x3f736c){var _0x2994b5=_0x3f736c[_0x8c8f('0xae')][0x0];var _0x8da36b=_0x2994b5[_0x8c8f('0xaf')];var _0x8238e1={'method':'GET','uri':_0x5a0c89+_0x8c8f('0xb0')+_0x8da36b+_0x8c8f('0xb1'),'headers':{'Authorization':'Bearer\x20'+_0x388dad,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x8238e1);})[_0x8c8f('0x18')](function(_0x1abf87){_0x38f4d4=_0x1abf87;_0x4a9238=_0x38f4d4[_0x8c8f('0xb2')];_0x4a9238=_[_0x8c8f('0xb3')](_0x4a9238,function(_0x17e68d){return!_0x2f0b89[_0x8c8f('0xb4')](_0x17e68d[_0x8c8f('0xb5')]);});var _0x420cef=[];var _0xc2f5d=[];_0x4a9238['forEach'](function(_0x328c8a){if(_0x328c8a[_0x8c8f('0xb6')]){var _0x5b82d7=_0x328c8a[_0x8c8f('0xb6')]['substring'](_0x328c8a['@odata.type'][_0x8c8f('0xa5')]('.')+0x1);if(_0x5b82d7==='PicklistAttributeMetadata'){_0x420cef[_0x8c8f('0xb7')](getSelectList(_0x5a0c89,_0xe3399d,_0xc2f5d,_0x38f4d4['MetadataId'],_0x328c8a[_0x8c8f('0xaf')],_0x388dad));}}});return Promise['all'](_0x420cef);})[_0x8c8f('0x18')](function(_0x3f0846){_0x2927d9=_0x3f0846[0x0];var _0x496b63=[];var _0x1892ec=[];_0x4a9238[_0x8c8f('0xb8')](function(_0x8d19d1){if(!_[_0x8c8f('0xb9')](_0x8d19d1[_0x8c8f('0xb6')])){var _0x153582=_0x8d19d1[_0x8c8f('0xb6')][_0x8c8f('0xba')](_0x8d19d1[_0x8c8f('0xb6')][_0x8c8f('0xa5')]('.')+0x1);if(_0x153582===_0x8c8f('0xbb')){_0x496b63[_0x8c8f('0xb7')](getBooleanList(_0x5a0c89,_0xe3399d,_0x1892ec,_0x38f4d4[_0x8c8f('0xaf')],_0x8d19d1[_0x8c8f('0xaf')],_0x388dad));}}});return Promise[_0x8c8f('0xbc')](_0x496b63);})[_0x8c8f('0x18')](function(_0x158278){_0x46d75e=_0x158278[0x0];var _0x102911=[];var _0x1c0f64=[];_0x4a9238[_0x8c8f('0xb8')](function(_0x3bc3c9){if(_0x3bc3c9['@odata.type']){var _0x76a314=_0x3bc3c9[_0x8c8f('0xb6')][_0x8c8f('0xba')](_0x3bc3c9[_0x8c8f('0xb6')][_0x8c8f('0xa5')]('.')+0x1);if(_0x76a314===_0x8c8f('0xbd')||_0x76a314===_0x8c8f('0xbe')||_0x76a314===_0x8c8f('0xbf')||_0x76a314===_0x8c8f('0xc0')||_0x76a314===_0x8c8f('0xc1')||_0x76a314===_0x8c8f('0xc2')||_0x76a314===_0x8c8f('0xc3')||_0x76a314===_0x8c8f('0xc4')||_0x76a314===_0x8c8f('0xc5')||_0x76a314===_0x8c8f('0xc6')){_0x102911[_0x8c8f('0xb7')](getInputList(_0x5a0c89,_0xe3399d,_0x76a314,_0x1c0f64,_0x38f4d4[_0x8c8f('0xaf')],_0x3bc3c9[_0x8c8f('0xaf')],_0x388dad));}}});return Promise[_0x8c8f('0xbc')](_0x102911);})[_0x8c8f('0x18')](function(_0x5051a3){_0x448251=_0x5051a3[0x0];var _0x146cc5=_0x2927d9[_0x8c8f('0xc7')](_0x46d75e)[_0x8c8f('0xc7')](_0x448251);var _0x125d78={'count':_0x146cc5['length'],'rows':_0x146cc5};return _0x125d78;})['then'](respondWithResult(_0x40d4b1,null))['catch'](function(_0x3d9a15){console['log']('Dynamics365\x20error:\x20'+_0x3d9a15);var _0x3ce978=_0x51d4f6[_0x8c8f('0x35')][_0x8c8f('0xc8')]?0x1f4:_0x3d9a15[_0x8c8f('0xc9')]||0x1f4;logger[_0x8c8f('0x1d')](_0x3d9a15['stack']);delete _0x3d9a15[_0x8c8f('0x30')];if(_0x3ce978===0x191){_0x3ce978=0x190;}_0x40d4b1[_0x8c8f('0x24')](_0x3ce978)[_0x8c8f('0xca')](_0x51d4f6['query'][_0x8c8f('0xc8')]?{'message':_0x8c8f('0xcb'),'statusCode':_0x3d9a15[_0x8c8f('0xc9')]}:_0x3d9a15);});};function getSelectList(_0x4bda56,_0x2d76dc,_0x594eb9,_0x3a60e5,_0x4dfd95,_0x3e5674){var _0x16f2d2={'method':'GET','uri':_0x4bda56+_0x8c8f('0xb0')+_0x3a60e5+_0x8c8f('0xcc')+_0x4dfd95+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x8c8f('0xcd'),'headers':{'Authorization':_0x8c8f('0xac')+_0x3e5674,'If-None-Match':null,'OData-Version':_0x8c8f('0xad')},'json':!![]};return rp(_0x16f2d2)[_0x8c8f('0x18')](function(_0x254955){var _0x207687=[];var _0x43f2b4=_0x254955['OptionSet'][_0x8c8f('0xce')];_0x43f2b4[_0x8c8f('0xb8')](function(_0x20ece0){_0x207687[_0x8c8f('0xb7')]({'name':_0x20ece0[_0x8c8f('0xcf')][_0x8c8f('0xd0')]['Label'],'value':String(_0x20ece0[_0x8c8f('0xd1')])});});var _0x49c1dd={'id':_0x2d76dc+'_'+_0x254955[_0x8c8f('0xb5')],'name':_0x254955['DisplayName'][_0x8c8f('0xd0')][_0x8c8f('0xcf')],'custom':![],'options':_0x207687};_0x594eb9[_0x8c8f('0xb7')](_0x49c1dd);return _0x594eb9;});}function getBooleanList(_0xf341ec,_0x56ad2c,_0x4693ba,_0x23ffbe,_0x40151a,_0x432f60){var _0x57df7d={'method':_0x8c8f('0xd2'),'uri':_0xf341ec+'EntityDefinitions('+_0x23ffbe+_0x8c8f('0xcc')+_0x40151a+_0x8c8f('0xd3'),'headers':{'Authorization':_0x8c8f('0xac')+_0x432f60,'If-None-Match':null,'OData-Version':_0x8c8f('0xad')},'json':!![]};return rp(_0x57df7d)[_0x8c8f('0x18')](function(_0x32008c){var _0x3dbaca=[];_0x3dbaca[_0x8c8f('0xb7')]({'name':_0x32008c[_0x8c8f('0xd4')]['TrueOption'][_0x8c8f('0xcf')][_0x8c8f('0xd0')][_0x8c8f('0xcf')],'value':_0x8c8f('0xd5')},{'name':_0x32008c[_0x8c8f('0xd4')][_0x8c8f('0xd6')]['Label'][_0x8c8f('0xd0')][_0x8c8f('0xcf')],'value':_0x8c8f('0xd7')});var _0x533281={'id':_0x56ad2c+'_'+_0x32008c[_0x8c8f('0xb5')],'name':_0x32008c[_0x8c8f('0xd8')][_0x8c8f('0xd0')]['Label'],'custom':![],'options':_0x3dbaca};_0x4693ba['push'](_0x533281);return _0x4693ba;});}function getInputList(_0x4c1099,_0x45b031,_0x84cc06,_0xcec8ae,_0x596591,_0x1e3d80,_0x530d5b){var _0x28c0d0={'method':_0x8c8f('0xd2'),'uri':_0x4c1099+_0x8c8f('0xb0')+_0x596591+_0x8c8f('0xcc')+_0x1e3d80+_0x8c8f('0xd9')+_0x84cc06+_0x8c8f('0xda'),'headers':{'Authorization':_0x8c8f('0xac')+_0x530d5b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x28c0d0)['then'](function(_0x1233ee){var _0x41cd9f={'id':_0x45b031+'_'+_0x1233ee[_0x8c8f('0xb5')],'name':_0x1233ee[_0x8c8f('0xd8')][_0x8c8f('0xd0')]?_0x1233ee[_0x8c8f('0xd8')][_0x8c8f('0xd0')]['Label']:_0x1233ee['LogicalName'],'custom':![],'options':[]};_0xcec8ae[_0x8c8f('0xb7')](_0x41cd9f);return _0xcec8ae;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index c7718dc..63ed2a2 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 _0x8786=['../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x43edc7,_0x292bde){var _0x34b76f=function(_0x2befcb){while(--_0x2befcb){_0x43edc7['push'](_0x43edc7['shift']());}};_0x34b76f(++_0x292bde);}(_0x8786,0x19d));var _0x6878=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8786[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x6878('0x0'));var util=require(_0x6878('0x1'));var logger=require(_0x6878('0x2'))(_0x6878('0x3'));var moment=require('moment');var BPromise=require(_0x6878('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6878('0x5'));var config=require(_0x6878('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x6878('0x7'));module[_0x6878('0x8')]=function(_0x47c30b,_0x17ff64){return _0x47c30b[_0x6878('0x9')](_0x6878('0xa'),attributes,{'tableName':_0x6878('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf81c=['./intDynamics365Account.attributes','define','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x168463,_0x1c6e2c){var _0x1f3d27=function(_0x4fad35){while(--_0x4fad35){_0x168463['push'](_0x168463['shift']());}};_0x1f3d27(++_0x1c6e2c);}(_0xf81c,0x7c));var _0xcf81=function(_0x22b2be,_0x4b164c){_0x22b2be=_0x22b2be-0x0;var _0x213c31=_0xf81c[_0x22b2be];return _0x213c31;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcf81('0x0'))(_0xcf81('0x1'));var moment=require(_0xcf81('0x2'));var BPromise=require('bluebird');var rp=require(_0xcf81('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcf81('0x4'));var config=require(_0xcf81('0x5'));var attributes=require(_0xcf81('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x948048,_0x86c6cb){return _0x948048[_0xcf81('0x7')](_0xcf81('0x8'),attributes,{'tableName':_0xcf81('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 953aa05..915d936 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 _0x9055=['../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','include','map','model','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x22b11e,_0x184f09){var _0x3d3740=function(_0x19aae8){while(--_0x19aae8){_0x22b11e['push'](_0x22b11e['shift']());}};_0x3d3740(++_0x184f09);}(_0x9055,0x12a));var _0x5905=function(_0x3d2ddf,_0x17d94a){_0x3d2ddf=_0x3d2ddf-0x0;var _0x58f808=_0x9055[_0x3d2ddf];return _0x58f808;};'use strict';var _=require(_0x5905('0x0'));var util=require(_0x5905('0x1'));var moment=require(_0x5905('0x2'));var BPromise=require(_0x5905('0x3'));var rs=require(_0x5905('0x4'));var fs=require('fs');var Redis=require(_0x5905('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5905('0x6'));var logger=require('../../config/logger')(_0x5905('0x7'));var config=require(_0x5905('0x8'));var jayson=require(_0x5905('0x9'));var client=jayson[_0x5905('0xa')][_0x5905('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44d6bb,_0x5cd967,_0x1e239e){return new BPromise(function(_0x3ce4c6,_0x5b5df6){return client[_0x5905('0xc')](_0x44d6bb,_0x1e239e)[_0x5905('0xd')](function(_0x32271e){logger[_0x5905('0xe')](_0x5905('0xf'),_0x5cd967,'request\x20sent');logger[_0x5905('0x10')](_0x5905('0x11'),_0x5cd967,_0x5905('0x12'),JSON[_0x5905('0x13')](_0x32271e));if(_0x32271e[_0x5905('0x14')]){if(_0x32271e[_0x5905('0x14')]['code']===0x1f4){logger[_0x5905('0x14')](_0x5905('0xf'),_0x5cd967,_0x32271e[_0x5905('0x14')][_0x5905('0x15')]);return _0x5b5df6(_0x32271e[_0x5905('0x14')]['message']);}logger[_0x5905('0x14')](_0x5905('0xf'),_0x5cd967,_0x32271e[_0x5905('0x14')][_0x5905('0x15')]);return _0x3ce4c6(_0x32271e['error'][_0x5905('0x15')]);}else{logger[_0x5905('0xe')](_0x5905('0xf'),_0x5cd967,_0x5905('0x12'));_0x3ce4c6(_0x32271e['result'][_0x5905('0x15')]);}})[_0x5905('0x16')](function(_0x2a5865){logger[_0x5905('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x5cd967,_0x2a5865);_0x5b5df6(_0x2a5865);});});}exports[_0x5905('0x17')]=function(_0x225c33){var _0x35610a=this;return new Promise(function(_0x2430dd,_0x2d97e){return db[_0x5905('0x18')][_0x5905('0x19')]({'raw':_0x225c33[_0x5905('0x1a')]?_0x225c33['options']['raw']===undefined?!![]:![]:!![],'where':_0x225c33['options']?_0x225c33[_0x5905('0x1a')][_0x5905('0x1b')]||null:null,'attributes':_0x225c33['options']?_0x225c33[_0x5905('0x1a')][_0x5905('0x1c')]||null:null,'limit':_0x225c33[_0x5905('0x1a')]?_0x225c33[_0x5905('0x1a')]['limit']||null:null,'include':_0x225c33[_0x5905('0x1a')]?_0x225c33[_0x5905('0x1a')][_0x5905('0x1d')]?_[_0x5905('0x1e')](_0x225c33[_0x5905('0x1a')]['include'],function(_0x28baa4){return{'model':db[_0x28baa4[_0x5905('0x1f')]],'as':_0x28baa4['as'],'attributes':_0x28baa4['attributes'],'include':_0x28baa4[_0x5905('0x1d')]?_[_0x5905('0x1e')](_0x28baa4[_0x5905('0x1d')],function(_0x45f5cc){return{'model':db[_0x45f5cc[_0x5905('0x1f')]],'as':_0x45f5cc['as'],'attributes':_0x45f5cc[_0x5905('0x1c')],'include':_0x45f5cc[_0x5905('0x1d')]?_['map'](_0x45f5cc[_0x5905('0x1d')],function(_0x522fb6){return{'model':db[_0x522fb6[_0x5905('0x1f')]],'as':_0x522fb6['as'],'attributes':_0x522fb6[_0x5905('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5905('0xd')](function(_0x12e8e3){logger[_0x5905('0xe')]('GetDynamics365Account',_0x225c33);logger['debug'](_0x5905('0x17'),_0x225c33,JSON['stringify'](_0x12e8e3));_0x2430dd(_0x12e8e3);})[_0x5905('0x16')](function(_0x50cde0){logger[_0x5905('0x14')]('GetDynamics365Account',_0x50cde0[_0x5905('0x15')],_0x225c33);_0x2d97e(_0x35610a[_0x5905('0x14')](0x1f4,_0x50cde0[_0x5905('0x15')]));});});};exports[_0x5905('0x20')]=function(_0x538fbf){var _0x3739f1=this;return new Promise(function(_0x13d93f,_0x141b23){return db['Dynamics365Account'][_0x5905('0x21')]({'raw':_0x538fbf['options']?_0x538fbf[_0x5905('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x538fbf['options']?_0x538fbf[_0x5905('0x1a')][_0x5905('0x1b')]||null:null,'attributes':_0x538fbf['options']?_0x538fbf[_0x5905('0x1a')][_0x5905('0x1c')]||null:null,'include':_0x538fbf['options']?_0x538fbf[_0x5905('0x1a')][_0x5905('0x1d')]?_[_0x5905('0x1e')](_0x538fbf[_0x5905('0x1a')][_0x5905('0x1d')],function(_0x32618b){return{'model':db[_0x32618b[_0x5905('0x1f')]],'as':_0x32618b['as'],'attributes':_0x32618b[_0x5905('0x1c')],'include':_0x32618b['include']?_['map'](_0x32618b[_0x5905('0x1d')],function(_0x3acfe7){return{'model':db[_0x3acfe7['model']],'as':_0x3acfe7['as'],'attributes':_0x3acfe7[_0x5905('0x1c')],'include':_0x3acfe7['include']?_[_0x5905('0x1e')](_0x3acfe7[_0x5905('0x1d')],function(_0x842354){return{'model':db[_0x842354[_0x5905('0x1f')]],'as':_0x842354['as'],'attributes':_0x842354[_0x5905('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x448325){logger[_0x5905('0xe')]('ShowDynamics365Account',_0x538fbf);logger['debug']('ShowDynamics365Account',_0x538fbf,JSON[_0x5905('0x13')](_0x448325));_0x13d93f(_0x448325);})['catch'](function(_0x52ddc5){logger[_0x5905('0x14')](_0x5905('0x20'),_0x52ddc5['message'],_0x538fbf);_0x141b23(_0x3739f1[_0x5905('0x14')](0x1f4,_0x52ddc5[_0x5905('0x15')]));});});}; \ No newline at end of file +var _0x9a93=['request\x20sent','debug','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','include','map','attributes','model','stringify','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x53aea3,_0x36d8c9){var _0x434479=function(_0x350fc1){while(--_0x350fc1){_0x53aea3['push'](_0x53aea3['shift']());}};_0x434479(++_0x36d8c9);}(_0x9a93,0xa5));var _0x39a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x39a9('0x0'));var util=require(_0x39a9('0x1'));var moment=require(_0x39a9('0x2'));var BPromise=require(_0x39a9('0x3'));var rs=require(_0x39a9('0x4'));var fs=require('fs');var Redis=require(_0x39a9('0x5'));var db=require(_0x39a9('0x6'))['db'];var utils=require(_0x39a9('0x7'));var logger=require('../../config/logger')(_0x39a9('0x8'));var config=require(_0x39a9('0x9'));var jayson=require(_0x39a9('0xa'));var client=jayson[_0x39a9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x454f3b,_0x1c315f,_0x19b34b){return new BPromise(function(_0x3fc6e2,_0xa5384f){return client[_0x39a9('0xc')](_0x454f3b,_0x19b34b)[_0x39a9('0xd')](function(_0x380f60){logger[_0x39a9('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x1c315f,_0x39a9('0xf'));logger[_0x39a9('0x10')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1c315f,_0x39a9('0xf'),JSON['stringify'](_0x380f60));if(_0x380f60[_0x39a9('0x11')]){if(_0x380f60[_0x39a9('0x11')][_0x39a9('0x12')]===0x1f4){logger[_0x39a9('0x11')](_0x39a9('0x13'),_0x1c315f,_0x380f60[_0x39a9('0x11')][_0x39a9('0x14')]);return _0xa5384f(_0x380f60[_0x39a9('0x11')]['message']);}logger['error'](_0x39a9('0x13'),_0x1c315f,_0x380f60[_0x39a9('0x11')][_0x39a9('0x14')]);return _0x3fc6e2(_0x380f60[_0x39a9('0x11')][_0x39a9('0x14')]);}else{logger[_0x39a9('0xe')](_0x39a9('0x13'),_0x1c315f,_0x39a9('0xf'));_0x3fc6e2(_0x380f60[_0x39a9('0x15')]['message']);}})[_0x39a9('0x16')](function(_0xfa0dd8){logger[_0x39a9('0x11')](_0x39a9('0x13'),_0x1c315f,_0xfa0dd8);_0xa5384f(_0xfa0dd8);});});}exports[_0x39a9('0x17')]=function(_0x59668d){var _0xfa2425=this;return new Promise(function(_0x28d76d,_0x3458b0){return db[_0x39a9('0x18')][_0x39a9('0x19')]({'raw':_0x59668d['options']?_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x59668d[_0x39a9('0x1a')]?_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1c')]||null:null,'attributes':_0x59668d[_0x39a9('0x1a')]?_0x59668d['options']['attributes']||null:null,'limit':_0x59668d[_0x39a9('0x1a')]?_0x59668d[_0x39a9('0x1a')]['limit']||null:null,'include':_0x59668d['options']?_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x59668d[_0x39a9('0x1a')][_0x39a9('0x1d')],function(_0x310499){return{'model':db[_0x310499['model']],'as':_0x310499['as'],'attributes':_0x310499[_0x39a9('0x1f')],'include':_0x310499['include']?_['map'](_0x310499[_0x39a9('0x1d')],function(_0x826c43){return{'model':db[_0x826c43[_0x39a9('0x20')]],'as':_0x826c43['as'],'attributes':_0x826c43[_0x39a9('0x1f')],'include':_0x826c43[_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x826c43['include'],function(_0x408545){return{'model':db[_0x408545[_0x39a9('0x20')]],'as':_0x408545['as'],'attributes':_0x408545['attributes']};}):[]};}):[]};}):[]:[]})[_0x39a9('0xd')](function(_0x14bfa6){logger['info'](_0x39a9('0x17'),_0x59668d);logger[_0x39a9('0x10')]('GetDynamics365Account',_0x59668d,JSON[_0x39a9('0x21')](_0x14bfa6));_0x28d76d(_0x14bfa6);})['catch'](function(_0x287f70){logger[_0x39a9('0x11')](_0x39a9('0x17'),_0x287f70[_0x39a9('0x14')],_0x59668d);_0x3458b0(_0xfa2425[_0x39a9('0x11')](0x1f4,_0x287f70[_0x39a9('0x14')]));});});};exports[_0x39a9('0x22')]=function(_0x2afe74){var _0x42c588=this;return new Promise(function(_0x5e5a23,_0x3ade97){return db[_0x39a9('0x18')][_0x39a9('0x23')]({'raw':_0x2afe74[_0x39a9('0x1a')]?_0x2afe74[_0x39a9('0x1a')][_0x39a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2afe74['options']?_0x2afe74[_0x39a9('0x1a')][_0x39a9('0x1c')]||null:null,'attributes':_0x2afe74[_0x39a9('0x1a')]?_0x2afe74['options'][_0x39a9('0x1f')]||null:null,'include':_0x2afe74[_0x39a9('0x1a')]?_0x2afe74[_0x39a9('0x1a')][_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x2afe74['options'][_0x39a9('0x1d')],function(_0x5d3a4c){return{'model':db[_0x5d3a4c[_0x39a9('0x20')]],'as':_0x5d3a4c['as'],'attributes':_0x5d3a4c[_0x39a9('0x1f')],'include':_0x5d3a4c[_0x39a9('0x1d')]?_[_0x39a9('0x1e')](_0x5d3a4c['include'],function(_0x912e9b){return{'model':db[_0x912e9b[_0x39a9('0x20')]],'as':_0x912e9b['as'],'attributes':_0x912e9b[_0x39a9('0x1f')],'include':_0x912e9b['include']?_['map'](_0x912e9b[_0x39a9('0x1d')],function(_0x206f65){return{'model':db[_0x206f65[_0x39a9('0x20')]],'as':_0x206f65['as'],'attributes':_0x206f65['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3aca2e){logger[_0x39a9('0xe')](_0x39a9('0x22'),_0x2afe74);logger[_0x39a9('0x10')]('ShowDynamics365Account',_0x2afe74,JSON[_0x39a9('0x21')](_0x3aca2e));_0x5e5a23(_0x3aca2e);})[_0x39a9('0x16')](function(_0x3ece6b){logger[_0x39a9('0x11')]('ShowDynamics365Account',_0x3ece6b[_0x39a9('0x14')],_0x2afe74);_0x3ade97(_0x42c588[_0x39a9('0x11')](0x1f4,_0x3ece6b[_0x39a9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 56e504e..ee4105f 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 _0xd7a2=['/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects'];(function(_0x115722,_0xbb8061){var _0xab1372=function(_0x401804){while(--_0x401804){_0x115722['push'](_0x115722['shift']());}};_0xab1372(++_0xbb8061);}(_0xd7a2,0x1d3));var _0x2d7a=function(_0x2f8c62,_0x3cbb9e){_0x2f8c62=_0x2f8c62-0x0;var _0x3169d3=_0xd7a2[_0x2f8c62];return _0x3169d3;};'use strict';var multer=require(_0x2d7a('0x0'));var util=require(_0x2d7a('0x1'));var path=require(_0x2d7a('0x2'));var timeout=require(_0x2d7a('0x3'));var express=require('express');var router=express[_0x2d7a('0x4')]();var auth=require(_0x2d7a('0x5'));var interaction=require(_0x2d7a('0x6'));var config=require(_0x2d7a('0x7'));var controller=require('./intDynamics365Configuration.controller');router[_0x2d7a('0x8')]('/',auth['isAuthenticated'](),controller[_0x2d7a('0x9')]);router['get'](_0x2d7a('0xa'),auth['isAuthenticated'](),controller[_0x2d7a('0xb')]);router['get'](_0x2d7a('0xc'),auth[_0x2d7a('0xd')](),controller['getFields']);router[_0x2d7a('0x8')](_0x2d7a('0xe'),auth[_0x2d7a('0xd')](),controller[_0x2d7a('0xf')]);router[_0x2d7a('0x8')](_0x2d7a('0x10'),auth[_0x2d7a('0xd')](),controller[_0x2d7a('0x11')]);router[_0x2d7a('0x12')]('/',auth['isAuthenticated'](),controller[_0x2d7a('0x13')]);router['put'](_0x2d7a('0xa'),auth[_0x2d7a('0xd')](),controller[_0x2d7a('0x14')]);router['delete'](_0x2d7a('0xa'),auth[_0x2d7a('0xd')](),controller[_0x2d7a('0x15')]);module[_0x2d7a('0x16')]=router; \ No newline at end of file +var _0x1279=['getFields','/:id/subjects','/:id/descriptions','post','update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated','/:id','get'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x1279,0xe7));var _0x9127=function(_0x347dde,_0x36eb9d){_0x347dde=_0x347dde-0x0;var _0x59fe14=_0x1279[_0x347dde];return _0x59fe14;};'use strict';var multer=require(_0x9127('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9127('0x1'));var router=express[_0x9127('0x2')]();var auth=require(_0x9127('0x3'));var interaction=require(_0x9127('0x4'));var config=require('../../config/environment');var controller=require(_0x9127('0x5'));router['get']('/',auth[_0x9127('0x6')](),controller['index']);router['get'](_0x9127('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x9127('0x8')]('/:id/fields',auth[_0x9127('0x6')](),controller[_0x9127('0x9')]);router[_0x9127('0x8')](_0x9127('0xa'),auth[_0x9127('0x6')](),controller['getSubjects']);router[_0x9127('0x8')](_0x9127('0xb'),auth[_0x9127('0x6')](),controller['getDescriptions']);router[_0x9127('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9127('0xd')]);router['delete'](_0x9127('0x7'),auth[_0x9127('0x6')](),controller[_0x9127('0xe')]);module[_0x9127('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index fefac9c..9efa3ef 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 _0xbb82=['exports','STRING','ENUM','incident','phonecall'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xbb82,0x16d));var _0x2bb8=function(_0x35c300,_0x284351){_0x35c300=_0x35c300-0x0;var _0x59e44b=_0xbb82[_0x35c300];return _0x59e44b;};'use strict';var Sequelize=require('sequelize');module[_0x2bb8('0x0')]={'name':{'type':Sequelize[_0x2bb8('0x1')]},'description':{'type':Sequelize[_0x2bb8('0x1')]},'ticketType':{'type':Sequelize[_0x2bb8('0x2')](_0x2bb8('0x3'),_0x2bb8('0x4')),'defaultValue':_0x2bb8('0x3')}}; \ No newline at end of file +var _0x38fc=['ENUM','incident','phonecall','sequelize','exports','STRING'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0x38fc,0x75));var _0xc38f=function(_0x82a5c5,_0x7431ac){_0x82a5c5=_0x82a5c5-0x0;var _0x82193d=_0x38fc[_0x82a5c5];return _0x82193d;};'use strict';var Sequelize=require(_0xc38f('0x0'));module[_0xc38f('0x1')]={'name':{'type':Sequelize[_0xc38f('0x2')]},'description':{'type':Sequelize[_0xc38f('0x2')]},'ticketType':{'type':Sequelize[_0xc38f('0x3')](_0xc38f('0x4'),_0xc38f('0x5')),'defaultValue':_0xc38f('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index e3c6ea8..995f7f1 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 _0xa3c8=['crypto','desk.js','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','stack','name','send','Dynamics365Configuration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','show','params','find','create','body','destroy','getFields','findOne','Dynamics365Field','sort','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x4fd22f,_0x1f9cb){var _0x1d9bc6=function(_0x49330b){while(--_0x49330b){_0x4fd22f['push'](_0x4fd22f['shift']());}};_0x1d9bc6(++_0x1f9cb);}(_0xa3c8,0x1a7));var _0x8a3c=function(_0x46c718,_0x19adb5){_0x46c718=_0x46c718-0x0;var _0x5ac924=_0xa3c8[_0x46c718];return _0x5ac924;};'use strict';var pdf=require(_0x8a3c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8a3c('0x1'));var zipdir=require(_0x8a3c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8a3c('0x3'));var BPromise=require(_0x8a3c('0x4'));var Mustache=require(_0x8a3c('0x5'));var util=require(_0x8a3c('0x6'));var path=require(_0x8a3c('0x7'));var sox=require(_0x8a3c('0x8'));var csv=require(_0x8a3c('0x9'));var ejs=require(_0x8a3c('0xa'));var fs=require('fs');var _=require(_0x8a3c('0xb'));var squel=require('squel');var crypto=require(_0x8a3c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8a3c('0xd'));var toCsv=require(_0x8a3c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8a3c('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8a3c('0xf'));var config=require(_0x8a3c('0x10'));var db=require(_0x8a3c('0x11'))['db'];var jayson=require(_0x8a3c('0x12'));var client=jayson[_0x8a3c('0x13')][_0x8a3c('0x14')]({'port':0x232a});function checkPasswordPattern(_0x10a992,_0x4c8290,_0x30ec3e){if(_0x30ec3e){var _0x341021=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x341021[_0x8a3c('0x15')](_0x4c8290)){return _0x10a992;}else{throw new Error(_0x8a3c('0x16'));}}else{return _0x10a992;}}function respondWithRpcPromise(_0x56d402,_0x201bc9,_0x2cad3b,_0x28a38c){return new BPromise(function(_0x2c53f0,_0xb271){var _0x5f3bd7=_0x28a38c||client;return _0x5f3bd7[_0x8a3c('0x17')](_0x56d402,_0x2cad3b)['then'](function(_0x241506){logger[_0x8a3c('0x18')](_0x8a3c('0x19'),_0x201bc9,_0x8a3c('0x1a'));logger[_0x8a3c('0x1b')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x201bc9,_0x8a3c('0x1a'),JSON['stringify'](_0x241506));if(_0x241506[_0x8a3c('0x1c')]){if(_0x241506[_0x8a3c('0x1c')]['code']===0x1f4){logger[_0x8a3c('0x1c')]('Dynamics365Configuration,\x20%s,\x20%s',_0x201bc9,_0x241506['error'][_0x8a3c('0x1d')]);return _0xb271(_0x241506[_0x8a3c('0x1c')]['message']);}logger['error'](_0x8a3c('0x19'),_0x201bc9,_0x241506[_0x8a3c('0x1c')][_0x8a3c('0x1d')]);return _0x2c53f0(_0x241506[_0x8a3c('0x1c')][_0x8a3c('0x1d')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x201bc9,'request\x20sent');_0x2c53f0(_0x241506[_0x8a3c('0x1e')][_0x8a3c('0x1d')]);}})[_0x8a3c('0x1f')](function(_0x3d4382){logger[_0x8a3c('0x1c')](_0x8a3c('0x19'),_0x201bc9,_0x3d4382);_0xb271(_0x3d4382);});});}function respondWithStatusCode(_0x5157ae,_0x9766df){_0x9766df=_0x9766df||0xcc;return function(_0xa97157){if(_0xa97157){return _0x5157ae['sendStatus'](_0x9766df);}return _0x5157ae[_0x8a3c('0x20')](_0x9766df)[_0x8a3c('0x21')]();};}function respondWithResult(_0x2f6ed5,_0x253aca){_0x253aca=_0x253aca||0xc8;return function(_0x3dc4d2){if(_0x3dc4d2){return _0x2f6ed5[_0x8a3c('0x20')](_0x253aca)[_0x8a3c('0x22')](_0x3dc4d2);}};}function respondWithFilteredResult(_0xca048e,_0x18e8bc){return function(_0x4d5817){if(_0x4d5817){var _0x2cfcee=_0x4d5817[_0x8a3c('0x23')],_0x36edd3=_0x18e8bc[_0x8a3c('0x24')],_0xcc28ad=_0x18e8bc[_0x8a3c('0x24')]+_0x18e8bc[_0x8a3c('0x25')],_0x23d145;if(_0xcc28ad>=_0x2cfcee){_0xcc28ad=_0x2cfcee;_0x23d145=0xc8;}else{_0x23d145=0xce;}_0xca048e[_0x8a3c('0x20')](_0x23d145);return _0xca048e[_0x8a3c('0x26')](_0x8a3c('0x27'),_0x36edd3+'-'+_0xcc28ad+'/'+_0x2cfcee)[_0x8a3c('0x22')](_0x4d5817);}return null;};}function patchUpdates(_0x3e8b5f){return function(_0x41d1e3){try{jsonpatch['apply'](_0x41d1e3,_0x3e8b5f,!![]);}catch(_0x3e43c2){return BPromise[_0x8a3c('0x28')](_0x3e43c2);}return _0x41d1e3[_0x8a3c('0x29')]();};}function saveUpdates(_0x489197,_0x1346fc){return function(_0x575756){if(_0x575756){return _0x575756[_0x8a3c('0x2a')](_0x489197)[_0x8a3c('0x2b')](function(_0x15a634){return _0x15a634;});}return null;};}function removeEntity(_0x488512,_0x406d21){return function(_0x1b44b4){if(_0x1b44b4){return _0x1b44b4['destroy']()[_0x8a3c('0x2b')](function(){_0x488512[_0x8a3c('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x593f75,_0x1042b4){return function(_0x58fea3){if(!_0x58fea3){_0x593f75[_0x8a3c('0x2c')](0x194);}return _0x58fea3;};}function handleError(_0x2c5905,_0x104c14){_0x104c14=_0x104c14||0x1f4;return function(_0x2b33af){logger[_0x8a3c('0x1c')](_0x2b33af[_0x8a3c('0x2d')]);if(_0x2b33af[_0x8a3c('0x2e')]){delete _0x2b33af[_0x8a3c('0x2e')];}_0x2c5905[_0x8a3c('0x20')](_0x104c14)[_0x8a3c('0x2f')](_0x2b33af);};}exports['index']=function(_0x594073,_0x451bf2){var _0x4133df={},_0x3d5b81={},_0x4e6ed5={'count':0x0,'rows':[]};var _0x32b7cc=db[_0x8a3c('0x30')][_0x8a3c('0x31')];_0x3d5b81[_0x8a3c('0x32')]=_['keys'](_0x32b7cc);_0x3d5b81[_0x8a3c('0x33')]=_[_0x8a3c('0x34')](_0x594073[_0x8a3c('0x33')]);_0x3d5b81[_0x8a3c('0x35')]=_[_0x8a3c('0x36')](_0x3d5b81[_0x8a3c('0x32')],_0x3d5b81['query']);_0x4133df[_0x8a3c('0x37')]=_[_0x8a3c('0x36')](_0x3d5b81[_0x8a3c('0x32')],qs[_0x8a3c('0x38')](_0x594073['query']['fields']));_0x4133df[_0x8a3c('0x37')]=_0x4133df[_0x8a3c('0x37')][_0x8a3c('0x39')]?_0x4133df[_0x8a3c('0x37')]:_0x3d5b81['model'];if(!_0x594073[_0x8a3c('0x33')][_0x8a3c('0x3a')](_0x8a3c('0x3b'))){_0x4133df[_0x8a3c('0x25')]=qs['limit'](_0x594073['query'][_0x8a3c('0x25')]);_0x4133df[_0x8a3c('0x24')]=qs[_0x8a3c('0x24')](_0x594073[_0x8a3c('0x33')][_0x8a3c('0x24')]);}_0x4133df[_0x8a3c('0x3c')]=qs['sort'](_0x594073[_0x8a3c('0x33')]['sort']);_0x4133df['where']=qs[_0x8a3c('0x35')](_[_0x8a3c('0x3d')](_0x594073['query'],_0x3d5b81[_0x8a3c('0x35')]));if(_0x594073['query'][_0x8a3c('0x3e')]){_0x4133df[_0x8a3c('0x3f')]=_[_0x8a3c('0x40')](_0x4133df['where'],{'$or':_[_0x8a3c('0x41')](_0x32b7cc,function(_0x2562dd){if(_0x2562dd[_0x8a3c('0x42')][_0x8a3c('0x43')]!==_0x8a3c('0x44')){var _0x357e6b={};_0x357e6b[_0x2562dd[_0x8a3c('0x45')]]={'$like':'%'+_0x594073['query'][_0x8a3c('0x3e')]+'%'};return _0x357e6b;}})});}_0x4133df=_['merge']({},_0x4133df,_0x594073[_0x8a3c('0x46')]);var _0x37f27f={'where':_0x4133df[_0x8a3c('0x3f')]};return db['Dynamics365Configuration'][_0x8a3c('0x23')](_0x37f27f)[_0x8a3c('0x2b')](function(_0x1e1828){_0x4e6ed5[_0x8a3c('0x23')]=_0x1e1828;if(_0x594073['query'][_0x8a3c('0x47')]){_0x4133df[_0x8a3c('0x48')]=[{'all':!![]}];}return db[_0x8a3c('0x30')][_0x8a3c('0x49')](_0x4133df);})[_0x8a3c('0x2b')](function(_0x2dc783){_0x4e6ed5[_0x8a3c('0x4a')]=_0x2dc783;return _0x4e6ed5;})[_0x8a3c('0x2b')](respondWithFilteredResult(_0x451bf2,_0x4133df))['catch'](handleError(_0x451bf2,null));};exports[_0x8a3c('0x4b')]=function(_0x226cbd,_0x464a2f){var _0x7850bc={'raw':![],'where':{'id':_0x226cbd[_0x8a3c('0x4c')]['id']}},_0x14c32e={};_0x14c32e[_0x8a3c('0x32')]=_[_0x8a3c('0x34')](db[_0x8a3c('0x30')][_0x8a3c('0x31')]);_0x14c32e['query']=_[_0x8a3c('0x34')](_0x226cbd[_0x8a3c('0x33')]);_0x14c32e[_0x8a3c('0x35')]=_[_0x8a3c('0x36')](_0x14c32e['model'],_0x14c32e['query']);_0x7850bc[_0x8a3c('0x37')]=_[_0x8a3c('0x36')](_0x14c32e[_0x8a3c('0x32')],qs[_0x8a3c('0x38')](_0x226cbd[_0x8a3c('0x33')]['fields']));_0x7850bc[_0x8a3c('0x37')]=_0x7850bc[_0x8a3c('0x37')][_0x8a3c('0x39')]?_0x7850bc['attributes']:_0x14c32e[_0x8a3c('0x32')];if(_0x226cbd[_0x8a3c('0x33')][_0x8a3c('0x47')]){_0x7850bc[_0x8a3c('0x48')]=[{'all':!![]}];}_0x7850bc=_[_0x8a3c('0x40')]({},_0x7850bc,_0x226cbd[_0x8a3c('0x46')]);return db[_0x8a3c('0x30')][_0x8a3c('0x4d')](_0x7850bc)[_0x8a3c('0x2b')](handleEntityNotFound(_0x464a2f,null))[_0x8a3c('0x2b')](respondWithResult(_0x464a2f,null))['catch'](handleError(_0x464a2f,null));};exports[_0x8a3c('0x4e')]=function(_0xfa0936,_0x3a9f9e){return db[_0x8a3c('0x30')]['create'](_0xfa0936[_0x8a3c('0x4f')],{})[_0x8a3c('0x2b')](respondWithResult(_0x3a9f9e,0xc9))[_0x8a3c('0x1f')](handleError(_0x3a9f9e,null));};exports['update']=function(_0x9ffe55,_0x4799fd){if(_0x9ffe55['body']['id']){delete _0x9ffe55[_0x8a3c('0x4f')]['id'];}return db[_0x8a3c('0x30')][_0x8a3c('0x4d')]({'where':{'id':_0x9ffe55[_0x8a3c('0x4c')]['id']}})[_0x8a3c('0x2b')](handleEntityNotFound(_0x4799fd,null))[_0x8a3c('0x2b')](saveUpdates(_0x9ffe55['body'],null))[_0x8a3c('0x2b')](respondWithResult(_0x4799fd,null))['catch'](handleError(_0x4799fd,null));};exports[_0x8a3c('0x50')]=function(_0x1f8aa9,_0x381fb9){return db[_0x8a3c('0x30')][_0x8a3c('0x4d')]({'where':{'id':_0x1f8aa9[_0x8a3c('0x4c')]['id']}})[_0x8a3c('0x2b')](handleEntityNotFound(_0x381fb9,null))[_0x8a3c('0x2b')](removeEntity(_0x381fb9,null))[_0x8a3c('0x1f')](handleError(_0x381fb9,null));};exports[_0x8a3c('0x51')]=function(_0x4d4db0,_0xa7eb1f,_0x4eb602){var _0x34db60={};var _0x405bbf={};var _0x37a260;var _0x1beef6;return db[_0x8a3c('0x30')][_0x8a3c('0x52')]({'where':{'id':_0x4d4db0[_0x8a3c('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa7eb1f,null))[_0x8a3c('0x2b')](function(_0x5f239d){if(_0x5f239d){_0x37a260=_0x5f239d;_0x405bbf['model']=_['keys'](db[_0x8a3c('0x53')][_0x8a3c('0x31')]);_0x405bbf[_0x8a3c('0x33')]=_['keys'](_0x4d4db0[_0x8a3c('0x33')]);_0x405bbf[_0x8a3c('0x35')]=_['intersection'](_0x405bbf['model'],_0x405bbf[_0x8a3c('0x33')]);_0x34db60[_0x8a3c('0x37')]=_[_0x8a3c('0x36')](_0x405bbf['model'],qs['fields'](_0x4d4db0[_0x8a3c('0x33')][_0x8a3c('0x38')]));_0x34db60['attributes']=_0x34db60[_0x8a3c('0x37')][_0x8a3c('0x39')]?_0x34db60[_0x8a3c('0x37')]:_0x405bbf[_0x8a3c('0x32')];_0x34db60[_0x8a3c('0x3c')]=qs[_0x8a3c('0x54')](_0x4d4db0[_0x8a3c('0x33')][_0x8a3c('0x54')]);_0x34db60[_0x8a3c('0x3f')]=qs['filters'](_[_0x8a3c('0x3d')](_0x4d4db0[_0x8a3c('0x33')],_0x405bbf['filters']));if(_0x4d4db0['query']['filter']){_0x34db60[_0x8a3c('0x3f')]=_[_0x8a3c('0x40')](_0x34db60[_0x8a3c('0x3f')],{'$or':_[_0x8a3c('0x41')](_0x34db60[_0x8a3c('0x37')],function(_0xbc9c78){var _0x3d907b={};_0x3d907b[_0xbc9c78]={'$like':'%'+_0x4d4db0['query'][_0x8a3c('0x3e')]+'%'};return _0x3d907b;})});}_0x34db60=_[_0x8a3c('0x40')]({},_0x34db60,_0x4d4db0[_0x8a3c('0x46')]);return _0x37a260['getFields'](_0x34db60);}})[_0x8a3c('0x2b')](function(_0x5d3061){if(_0x5d3061){_0x1beef6=_0x5d3061[_0x8a3c('0x39')];if(!_0x4d4db0['query']['hasOwnProperty'](_0x8a3c('0x3b'))){_0x34db60[_0x8a3c('0x25')]=qs[_0x8a3c('0x25')](_0x4d4db0[_0x8a3c('0x33')][_0x8a3c('0x25')]);_0x34db60[_0x8a3c('0x24')]=qs[_0x8a3c('0x24')](_0x4d4db0[_0x8a3c('0x33')][_0x8a3c('0x24')]);}return _0x37a260[_0x8a3c('0x51')](_0x34db60);}})[_0x8a3c('0x2b')](function(_0x20c0ac){if(_0x20c0ac){return _0x20c0ac?{'count':_0x1beef6,'rows':_0x20c0ac}:null;}})[_0x8a3c('0x2b')](respondWithResult(_0xa7eb1f,null))[_0x8a3c('0x1f')](handleError(_0xa7eb1f,null));};exports[_0x8a3c('0x55')]=function(_0x1e7a42,_0x1bab9f,_0x646bcb){var _0x2f3f4e={};var _0x730619={};var _0x1d4a83;var _0xe285a;return db[_0x8a3c('0x30')][_0x8a3c('0x52')]({'where':{'id':_0x1e7a42['params']['id']}})[_0x8a3c('0x2b')](handleEntityNotFound(_0x1bab9f,null))[_0x8a3c('0x2b')](function(_0x3ce3ed){if(_0x3ce3ed){_0x1d4a83=_0x3ce3ed;_0x730619[_0x8a3c('0x32')]=_[_0x8a3c('0x34')](db[_0x8a3c('0x53')]['rawAttributes']);_0x730619[_0x8a3c('0x33')]=_[_0x8a3c('0x34')](_0x1e7a42[_0x8a3c('0x33')]);_0x730619[_0x8a3c('0x35')]=_[_0x8a3c('0x36')](_0x730619[_0x8a3c('0x32')],_0x730619[_0x8a3c('0x33')]);_0x2f3f4e[_0x8a3c('0x37')]=_[_0x8a3c('0x36')](_0x730619['model'],qs[_0x8a3c('0x38')](_0x1e7a42[_0x8a3c('0x33')][_0x8a3c('0x38')]));_0x2f3f4e[_0x8a3c('0x37')]=_0x2f3f4e['attributes']['length']?_0x2f3f4e['attributes']:_0x730619[_0x8a3c('0x32')];_0x2f3f4e[_0x8a3c('0x3c')]=qs[_0x8a3c('0x54')](_0x1e7a42[_0x8a3c('0x33')]['sort']);_0x2f3f4e['where']=qs[_0x8a3c('0x35')](_[_0x8a3c('0x3d')](_0x1e7a42[_0x8a3c('0x33')],_0x730619[_0x8a3c('0x35')]));if(_0x1e7a42['query']['filter']){_0x2f3f4e[_0x8a3c('0x3f')]=_[_0x8a3c('0x40')](_0x2f3f4e[_0x8a3c('0x3f')],{'$or':_[_0x8a3c('0x41')](_0x2f3f4e[_0x8a3c('0x37')],function(_0x3dfc8a){var _0x4faffc={};_0x4faffc[_0x3dfc8a]={'$like':'%'+_0x1e7a42['query'][_0x8a3c('0x3e')]+'%'};return _0x4faffc;})});}_0x2f3f4e=_[_0x8a3c('0x40')]({},_0x2f3f4e,_0x1e7a42['options']);return _0x1d4a83['getSubjects'](_0x2f3f4e);}})['then'](function(_0x349a5a){if(_0x349a5a){_0xe285a=_0x349a5a[_0x8a3c('0x39')];if(!_0x1e7a42['query']['hasOwnProperty'](_0x8a3c('0x3b'))){_0x2f3f4e[_0x8a3c('0x25')]=qs[_0x8a3c('0x25')](_0x1e7a42['query']['limit']);_0x2f3f4e[_0x8a3c('0x24')]=qs[_0x8a3c('0x24')](_0x1e7a42['query'][_0x8a3c('0x24')]);}return _0x1d4a83['getSubjects'](_0x2f3f4e);}})[_0x8a3c('0x2b')](function(_0x2fe553){if(_0x2fe553){return _0x2fe553?{'count':_0xe285a,'rows':_0x2fe553}:null;}})[_0x8a3c('0x2b')](respondWithResult(_0x1bab9f,null))['catch'](handleError(_0x1bab9f,null));};exports[_0x8a3c('0x56')]=function(_0x558970,_0x22791c,_0x5321d3){var _0x41d460={};var _0x38f9c7={};var _0x2f5cfc;var _0x9f4b64;return db['Dynamics365Configuration'][_0x8a3c('0x52')]({'where':{'id':_0x558970[_0x8a3c('0x4c')]['id']}})[_0x8a3c('0x2b')](handleEntityNotFound(_0x22791c,null))[_0x8a3c('0x2b')](function(_0x14b67b){if(_0x14b67b){_0x2f5cfc=_0x14b67b;_0x38f9c7[_0x8a3c('0x32')]=_[_0x8a3c('0x34')](db[_0x8a3c('0x53')][_0x8a3c('0x31')]);_0x38f9c7[_0x8a3c('0x33')]=_[_0x8a3c('0x34')](_0x558970['query']);_0x38f9c7[_0x8a3c('0x35')]=_['intersection'](_0x38f9c7[_0x8a3c('0x32')],_0x38f9c7[_0x8a3c('0x33')]);_0x41d460[_0x8a3c('0x37')]=_[_0x8a3c('0x36')](_0x38f9c7[_0x8a3c('0x32')],qs[_0x8a3c('0x38')](_0x558970['query'][_0x8a3c('0x38')]));_0x41d460[_0x8a3c('0x37')]=_0x41d460['attributes'][_0x8a3c('0x39')]?_0x41d460['attributes']:_0x38f9c7['model'];_0x41d460['order']=qs[_0x8a3c('0x54')](_0x558970['query'][_0x8a3c('0x54')]);_0x41d460[_0x8a3c('0x3f')]=qs['filters'](_[_0x8a3c('0x3d')](_0x558970['query'],_0x38f9c7[_0x8a3c('0x35')]));if(_0x558970['query'][_0x8a3c('0x3e')]){_0x41d460[_0x8a3c('0x3f')]=_[_0x8a3c('0x40')](_0x41d460['where'],{'$or':_[_0x8a3c('0x41')](_0x41d460[_0x8a3c('0x37')],function(_0x32a3e4){var _0x42db17={};_0x42db17[_0x32a3e4]={'$like':'%'+_0x558970['query'][_0x8a3c('0x3e')]+'%'};return _0x42db17;})});}_0x41d460=_[_0x8a3c('0x40')]({},_0x41d460,_0x558970[_0x8a3c('0x46')]);return _0x2f5cfc[_0x8a3c('0x56')](_0x41d460);}})[_0x8a3c('0x2b')](function(_0x1b1d19){if(_0x1b1d19){_0x9f4b64=_0x1b1d19['length'];if(!_0x558970[_0x8a3c('0x33')]['hasOwnProperty'](_0x8a3c('0x3b'))){_0x41d460[_0x8a3c('0x25')]=qs[_0x8a3c('0x25')](_0x558970[_0x8a3c('0x33')][_0x8a3c('0x25')]);_0x41d460[_0x8a3c('0x24')]=qs[_0x8a3c('0x24')](_0x558970[_0x8a3c('0x33')][_0x8a3c('0x24')]);}return _0x2f5cfc['getDescriptions'](_0x41d460);}})[_0x8a3c('0x2b')](function(_0x36e9e1){if(_0x36e9e1){return _0x36e9e1?{'count':_0x9f4b64,'rows':_0x36e9e1}:null;}})[_0x8a3c('0x2b')](respondWithResult(_0x22791c,null))[_0x8a3c('0x1f')](handleError(_0x22791c,null));}; \ No newline at end of file +var _0x4766=['nolimit','order','sort','where','filters','pick','filter','type','key','VIRTUAL','field','includeAll','findAll','rows','params','include','merge','options','find','create','body','findOne','Dynamics365Field','map','hasOwnProperty','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','destroy','name','send','index','Dynamics365Configuration','rawAttributes','model','keys','query','intersection','attributes','fields','length'];(function(_0xc4c47f,_0x2379a2){var _0x11a039=function(_0x4eacf3){while(--_0x4eacf3){_0xc4c47f['push'](_0xc4c47f['shift']());}};_0x11a039(++_0x2379a2);}(_0x4766,0xce));var _0x6476=function(_0x1bdd8c,_0x4a7f61){_0x1bdd8c=_0x1bdd8c-0x0;var _0x23dacd=_0x4766[_0x1bdd8c];return _0x23dacd;};'use strict';var pdf=require(_0x6476('0x0'));var emlformat=require(_0x6476('0x1'));var rimraf=require(_0x6476('0x2'));var zipdir=require(_0x6476('0x3'));var jsonpatch=require(_0x6476('0x4'));var rp=require(_0x6476('0x5'));var moment=require(_0x6476('0x6'));var BPromise=require(_0x6476('0x7'));var Mustache=require(_0x6476('0x8'));var util=require(_0x6476('0x9'));var path=require('path');var sox=require(_0x6476('0xa'));var csv=require(_0x6476('0xb'));var ejs=require(_0x6476('0xc'));var fs=require('fs');var _=require(_0x6476('0xd'));var squel=require('squel');var crypto=require(_0x6476('0xe'));var jsforce=require(_0x6476('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6476('0xb'));var querystring=require(_0x6476('0x10'));var Papa=require('papaparse');var Redis=require(_0x6476('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6476('0x12'));var logger=require(_0x6476('0x13'))(_0x6476('0x14'));var utils=require(_0x6476('0x15'));var config=require(_0x6476('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x6476('0x17'));var client=jayson[_0x6476('0x18')][_0x6476('0x19')]({'port':0x232a});function checkPasswordPattern(_0x56828e,_0x2723fa,_0x352194){if(_0x352194){var _0x3c5a3b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c5a3b[_0x6476('0x1a')](_0x2723fa)){return _0x56828e;}else{throw new Error(_0x6476('0x1b'));}}else{return _0x56828e;}}function respondWithRpcPromise(_0x9fe982,_0x1059f9,_0x9c2e5c,_0x2b86d8){return new BPromise(function(_0x18c201,_0x5d96cb){var _0x2f9e9e=_0x2b86d8||client;return _0x2f9e9e[_0x6476('0x1c')](_0x9fe982,_0x9c2e5c)[_0x6476('0x1d')](function(_0x29e4df){logger[_0x6476('0x1e')](_0x6476('0x1f'),_0x1059f9,'request\x20sent');logger[_0x6476('0x20')](_0x6476('0x21'),_0x1059f9,_0x6476('0x22'),JSON[_0x6476('0x23')](_0x29e4df));if(_0x29e4df[_0x6476('0x24')]){if(_0x29e4df[_0x6476('0x24')][_0x6476('0x25')]===0x1f4){logger[_0x6476('0x24')](_0x6476('0x1f'),_0x1059f9,_0x29e4df['error'][_0x6476('0x26')]);return _0x5d96cb(_0x29e4df[_0x6476('0x24')]['message']);}logger[_0x6476('0x24')](_0x6476('0x1f'),_0x1059f9,_0x29e4df[_0x6476('0x24')][_0x6476('0x26')]);return _0x18c201(_0x29e4df['error'][_0x6476('0x26')]);}else{logger[_0x6476('0x1e')](_0x6476('0x1f'),_0x1059f9,_0x6476('0x22'));_0x18c201(_0x29e4df[_0x6476('0x27')]['message']);}})[_0x6476('0x28')](function(_0x215d0a){logger[_0x6476('0x24')](_0x6476('0x1f'),_0x1059f9,_0x215d0a);_0x5d96cb(_0x215d0a);});});}function respondWithStatusCode(_0x3aadbc,_0x5e7c17){_0x5e7c17=_0x5e7c17||0xcc;return function(_0x50223a){if(_0x50223a){return _0x3aadbc[_0x6476('0x29')](_0x5e7c17);}return _0x3aadbc[_0x6476('0x2a')](_0x5e7c17)[_0x6476('0x2b')]();};}function respondWithResult(_0x5c42e0,_0x698899){_0x698899=_0x698899||0xc8;return function(_0x2862be){if(_0x2862be){return _0x5c42e0[_0x6476('0x2a')](_0x698899)['json'](_0x2862be);}};}function respondWithFilteredResult(_0x58b354,_0x51ed20){return function(_0xfdf89){if(_0xfdf89){var _0x515ee9=_0xfdf89[_0x6476('0x2c')],_0x281e09=_0x51ed20[_0x6476('0x2d')],_0x515dca=_0x51ed20['offset']+_0x51ed20[_0x6476('0x2e')],_0xc09838;if(_0x515dca>=_0x515ee9){_0x515dca=_0x515ee9;_0xc09838=0xc8;}else{_0xc09838=0xce;}_0x58b354[_0x6476('0x2a')](_0xc09838);return _0x58b354['set'](_0x6476('0x2f'),_0x281e09+'-'+_0x515dca+'/'+_0x515ee9)['json'](_0xfdf89);}return null;};}function patchUpdates(_0x5e3d4f){return function(_0x1c6a51){try{jsonpatch['apply'](_0x1c6a51,_0x5e3d4f,!![]);}catch(_0x429974){return BPromise['reject'](_0x429974);}return _0x1c6a51['save']();};}function saveUpdates(_0x1d0eca,_0x103455){return function(_0x117deb){if(_0x117deb){return _0x117deb['update'](_0x1d0eca)[_0x6476('0x1d')](function(_0x5e639b){return _0x5e639b;});}return null;};}function removeEntity(_0x43e543,_0x17b2cf){return function(_0xdd277){if(_0xdd277){return _0xdd277[_0x6476('0x30')]()['then'](function(){_0x43e543[_0x6476('0x2a')](0xcc)[_0x6476('0x2b')]();});}};}function handleEntityNotFound(_0x180197,_0x5b5905){return function(_0xbe3629){if(!_0xbe3629){_0x180197[_0x6476('0x29')](0x194);}return _0xbe3629;};}function handleError(_0x3a9bf3,_0x51e0e7){_0x51e0e7=_0x51e0e7||0x1f4;return function(_0x4bcef2){logger['error'](_0x4bcef2['stack']);if(_0x4bcef2[_0x6476('0x31')]){delete _0x4bcef2['name'];}_0x3a9bf3['status'](_0x51e0e7)[_0x6476('0x32')](_0x4bcef2);};}exports[_0x6476('0x33')]=function(_0x49c901,_0x2e708c){var _0x3f6270={},_0x5150e7={},_0x58b93d={'count':0x0,'rows':[]};var _0x3262d7=db[_0x6476('0x34')][_0x6476('0x35')];_0x5150e7[_0x6476('0x36')]=_[_0x6476('0x37')](_0x3262d7);_0x5150e7['query']=_[_0x6476('0x37')](_0x49c901[_0x6476('0x38')]);_0x5150e7['filters']=_[_0x6476('0x39')](_0x5150e7[_0x6476('0x36')],_0x5150e7[_0x6476('0x38')]);_0x3f6270[_0x6476('0x3a')]=_['intersection'](_0x5150e7[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x49c901['query']['fields']));_0x3f6270[_0x6476('0x3a')]=_0x3f6270['attributes'][_0x6476('0x3c')]?_0x3f6270[_0x6476('0x3a')]:_0x5150e7['model'];if(!_0x49c901['query']['hasOwnProperty'](_0x6476('0x3d'))){_0x3f6270['limit']=qs[_0x6476('0x2e')](_0x49c901[_0x6476('0x38')][_0x6476('0x2e')]);_0x3f6270[_0x6476('0x2d')]=qs[_0x6476('0x2d')](_0x49c901['query'][_0x6476('0x2d')]);}_0x3f6270[_0x6476('0x3e')]=qs[_0x6476('0x3f')](_0x49c901[_0x6476('0x38')][_0x6476('0x3f')]);_0x3f6270[_0x6476('0x40')]=qs[_0x6476('0x41')](_[_0x6476('0x42')](_0x49c901['query'],_0x5150e7['filters']));if(_0x49c901[_0x6476('0x38')][_0x6476('0x43')]){_0x3f6270['where']=_['merge'](_0x3f6270[_0x6476('0x40')],{'$or':_['map'](_0x3262d7,function(_0xf92858){if(_0xf92858[_0x6476('0x44')][_0x6476('0x45')]!==_0x6476('0x46')){var _0x110d47={};_0x110d47[_0xf92858[_0x6476('0x47')]]={'$like':'%'+_0x49c901[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x110d47;}})});}_0x3f6270=_['merge']({},_0x3f6270,_0x49c901['options']);var _0x594c28={'where':_0x3f6270[_0x6476('0x40')]};return db[_0x6476('0x34')][_0x6476('0x2c')](_0x594c28)[_0x6476('0x1d')](function(_0x39f229){_0x58b93d[_0x6476('0x2c')]=_0x39f229;if(_0x49c901[_0x6476('0x38')][_0x6476('0x48')]){_0x3f6270['include']=[{'all':!![]}];}return db[_0x6476('0x34')][_0x6476('0x49')](_0x3f6270);})[_0x6476('0x1d')](function(_0x44f3c1){_0x58b93d[_0x6476('0x4a')]=_0x44f3c1;return _0x58b93d;})['then'](respondWithFilteredResult(_0x2e708c,_0x3f6270))[_0x6476('0x28')](handleError(_0x2e708c,null));};exports['show']=function(_0x4972a4,_0x5dba4a){var _0x16b9c4={'raw':![],'where':{'id':_0x4972a4[_0x6476('0x4b')]['id']}},_0xe0620b={};_0xe0620b[_0x6476('0x36')]=_[_0x6476('0x37')](db[_0x6476('0x34')]['rawAttributes']);_0xe0620b[_0x6476('0x38')]=_[_0x6476('0x37')](_0x4972a4[_0x6476('0x38')]);_0xe0620b[_0x6476('0x41')]=_[_0x6476('0x39')](_0xe0620b['model'],_0xe0620b[_0x6476('0x38')]);_0x16b9c4['attributes']=_[_0x6476('0x39')](_0xe0620b[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x4972a4[_0x6476('0x38')][_0x6476('0x3b')]));_0x16b9c4[_0x6476('0x3a')]=_0x16b9c4[_0x6476('0x3a')][_0x6476('0x3c')]?_0x16b9c4[_0x6476('0x3a')]:_0xe0620b[_0x6476('0x36')];if(_0x4972a4[_0x6476('0x38')][_0x6476('0x48')]){_0x16b9c4[_0x6476('0x4c')]=[{'all':!![]}];}_0x16b9c4=_[_0x6476('0x4d')]({},_0x16b9c4,_0x4972a4[_0x6476('0x4e')]);return db[_0x6476('0x34')][_0x6476('0x4f')](_0x16b9c4)[_0x6476('0x1d')](handleEntityNotFound(_0x5dba4a,null))['then'](respondWithResult(_0x5dba4a,null))['catch'](handleError(_0x5dba4a,null));};exports[_0x6476('0x50')]=function(_0x1c89c9,_0x3d14f5){return db[_0x6476('0x34')][_0x6476('0x50')](_0x1c89c9[_0x6476('0x51')],{})[_0x6476('0x1d')](respondWithResult(_0x3d14f5,0xc9))[_0x6476('0x28')](handleError(_0x3d14f5,null));};exports['update']=function(_0x3b64b3,_0x1b339a){if(_0x3b64b3[_0x6476('0x51')]['id']){delete _0x3b64b3[_0x6476('0x51')]['id'];}return db[_0x6476('0x34')][_0x6476('0x4f')]({'where':{'id':_0x3b64b3[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x1b339a,null))[_0x6476('0x1d')](saveUpdates(_0x3b64b3[_0x6476('0x51')],null))['then'](respondWithResult(_0x1b339a,null))['catch'](handleError(_0x1b339a,null));};exports['destroy']=function(_0x50d6ae,_0x3fbb1a){return db[_0x6476('0x34')]['find']({'where':{'id':_0x50d6ae[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x3fbb1a,null))[_0x6476('0x1d')](removeEntity(_0x3fbb1a,null))[_0x6476('0x28')](handleError(_0x3fbb1a,null));};exports['getFields']=function(_0x320a48,_0x423209,_0x3fa68d){var _0x50f795={};var _0x185586={};var _0x2b53d2;var _0x3b07f5;return db['Dynamics365Configuration'][_0x6476('0x52')]({'where':{'id':_0x320a48['params']['id']}})['then'](handleEntityNotFound(_0x423209,null))[_0x6476('0x1d')](function(_0x507964){if(_0x507964){_0x2b53d2=_0x507964;_0x185586[_0x6476('0x36')]=_['keys'](db[_0x6476('0x53')]['rawAttributes']);_0x185586[_0x6476('0x38')]=_[_0x6476('0x37')](_0x320a48[_0x6476('0x38')]);_0x185586[_0x6476('0x41')]=_[_0x6476('0x39')](_0x185586[_0x6476('0x36')],_0x185586[_0x6476('0x38')]);_0x50f795[_0x6476('0x3a')]=_[_0x6476('0x39')](_0x185586[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x320a48[_0x6476('0x38')][_0x6476('0x3b')]));_0x50f795[_0x6476('0x3a')]=_0x50f795[_0x6476('0x3a')][_0x6476('0x3c')]?_0x50f795[_0x6476('0x3a')]:_0x185586[_0x6476('0x36')];_0x50f795[_0x6476('0x3e')]=qs[_0x6476('0x3f')](_0x320a48[_0x6476('0x38')][_0x6476('0x3f')]);_0x50f795[_0x6476('0x40')]=qs[_0x6476('0x41')](_[_0x6476('0x42')](_0x320a48[_0x6476('0x38')],_0x185586['filters']));if(_0x320a48['query'][_0x6476('0x43')]){_0x50f795['where']=_['merge'](_0x50f795[_0x6476('0x40')],{'$or':_[_0x6476('0x54')](_0x50f795[_0x6476('0x3a')],function(_0x17d1d8){var _0x35af66={};_0x35af66[_0x17d1d8]={'$like':'%'+_0x320a48[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x35af66;})});}_0x50f795=_[_0x6476('0x4d')]({},_0x50f795,_0x320a48['options']);return _0x2b53d2['getFields'](_0x50f795);}})[_0x6476('0x1d')](function(_0x316c9a){if(_0x316c9a){_0x3b07f5=_0x316c9a['length'];if(!_0x320a48[_0x6476('0x38')][_0x6476('0x55')](_0x6476('0x3d'))){_0x50f795[_0x6476('0x2e')]=qs['limit'](_0x320a48[_0x6476('0x38')][_0x6476('0x2e')]);_0x50f795[_0x6476('0x2d')]=qs['offset'](_0x320a48[_0x6476('0x38')][_0x6476('0x2d')]);}return _0x2b53d2[_0x6476('0x56')](_0x50f795);}})['then'](function(_0x4cb4c0){if(_0x4cb4c0){return _0x4cb4c0?{'count':_0x3b07f5,'rows':_0x4cb4c0}:null;}})[_0x6476('0x1d')](respondWithResult(_0x423209,null))[_0x6476('0x28')](handleError(_0x423209,null));};exports[_0x6476('0x57')]=function(_0x4a67cc,_0x71dd73,_0x26d1db){var _0x21dc79={};var _0x19d313={};var _0xbd270e;var _0x22e4f3;return db[_0x6476('0x34')]['findOne']({'where':{'id':_0x4a67cc[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x71dd73,null))[_0x6476('0x1d')](function(_0x42d541){if(_0x42d541){_0xbd270e=_0x42d541;_0x19d313[_0x6476('0x36')]=_[_0x6476('0x37')](db[_0x6476('0x53')][_0x6476('0x35')]);_0x19d313[_0x6476('0x38')]=_[_0x6476('0x37')](_0x4a67cc[_0x6476('0x38')]);_0x19d313[_0x6476('0x41')]=_[_0x6476('0x39')](_0x19d313['model'],_0x19d313[_0x6476('0x38')]);_0x21dc79[_0x6476('0x3a')]=_['intersection'](_0x19d313[_0x6476('0x36')],qs[_0x6476('0x3b')](_0x4a67cc[_0x6476('0x38')][_0x6476('0x3b')]));_0x21dc79[_0x6476('0x3a')]=_0x21dc79['attributes'][_0x6476('0x3c')]?_0x21dc79['attributes']:_0x19d313[_0x6476('0x36')];_0x21dc79['order']=qs[_0x6476('0x3f')](_0x4a67cc[_0x6476('0x38')]['sort']);_0x21dc79['where']=qs[_0x6476('0x41')](_[_0x6476('0x42')](_0x4a67cc['query'],_0x19d313['filters']));if(_0x4a67cc[_0x6476('0x38')]['filter']){_0x21dc79[_0x6476('0x40')]=_[_0x6476('0x4d')](_0x21dc79[_0x6476('0x40')],{'$or':_[_0x6476('0x54')](_0x21dc79[_0x6476('0x3a')],function(_0x4f6ee6){var _0x540fdf={};_0x540fdf[_0x4f6ee6]={'$like':'%'+_0x4a67cc[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x540fdf;})});}_0x21dc79=_[_0x6476('0x4d')]({},_0x21dc79,_0x4a67cc[_0x6476('0x4e')]);return _0xbd270e[_0x6476('0x57')](_0x21dc79);}})['then'](function(_0x9d0031){if(_0x9d0031){_0x22e4f3=_0x9d0031[_0x6476('0x3c')];if(!_0x4a67cc['query'][_0x6476('0x55')]('nolimit')){_0x21dc79[_0x6476('0x2e')]=qs['limit'](_0x4a67cc['query']['limit']);_0x21dc79[_0x6476('0x2d')]=qs[_0x6476('0x2d')](_0x4a67cc['query'][_0x6476('0x2d')]);}return _0xbd270e[_0x6476('0x57')](_0x21dc79);}})['then'](function(_0x119a09){if(_0x119a09){return _0x119a09?{'count':_0x22e4f3,'rows':_0x119a09}:null;}})['then'](respondWithResult(_0x71dd73,null))[_0x6476('0x28')](handleError(_0x71dd73,null));};exports[_0x6476('0x58')]=function(_0x5d8291,_0x17f0c4,_0x19a345){var _0x26dc17={};var _0x54a09c={};var _0x160469;var _0xb2f24b;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5d8291[_0x6476('0x4b')]['id']}})[_0x6476('0x1d')](handleEntityNotFound(_0x17f0c4,null))[_0x6476('0x1d')](function(_0x5d0215){if(_0x5d0215){_0x160469=_0x5d0215;_0x54a09c['model']=_[_0x6476('0x37')](db[_0x6476('0x53')][_0x6476('0x35')]);_0x54a09c[_0x6476('0x38')]=_[_0x6476('0x37')](_0x5d8291['query']);_0x54a09c[_0x6476('0x41')]=_['intersection'](_0x54a09c[_0x6476('0x36')],_0x54a09c[_0x6476('0x38')]);_0x26dc17['attributes']=_[_0x6476('0x39')](_0x54a09c['model'],qs[_0x6476('0x3b')](_0x5d8291[_0x6476('0x38')][_0x6476('0x3b')]));_0x26dc17[_0x6476('0x3a')]=_0x26dc17[_0x6476('0x3a')][_0x6476('0x3c')]?_0x26dc17[_0x6476('0x3a')]:_0x54a09c[_0x6476('0x36')];_0x26dc17[_0x6476('0x3e')]=qs[_0x6476('0x3f')](_0x5d8291[_0x6476('0x38')][_0x6476('0x3f')]);_0x26dc17[_0x6476('0x40')]=qs[_0x6476('0x41')](_['pick'](_0x5d8291['query'],_0x54a09c[_0x6476('0x41')]));if(_0x5d8291[_0x6476('0x38')]['filter']){_0x26dc17[_0x6476('0x40')]=_[_0x6476('0x4d')](_0x26dc17[_0x6476('0x40')],{'$or':_['map'](_0x26dc17[_0x6476('0x3a')],function(_0x9ca3b0){var _0x4347d1={};_0x4347d1[_0x9ca3b0]={'$like':'%'+_0x5d8291[_0x6476('0x38')][_0x6476('0x43')]+'%'};return _0x4347d1;})});}_0x26dc17=_[_0x6476('0x4d')]({},_0x26dc17,_0x5d8291['options']);return _0x160469[_0x6476('0x58')](_0x26dc17);}})['then'](function(_0x59980e){if(_0x59980e){_0xb2f24b=_0x59980e[_0x6476('0x3c')];if(!_0x5d8291[_0x6476('0x38')][_0x6476('0x55')]('nolimit')){_0x26dc17['limit']=qs[_0x6476('0x2e')](_0x5d8291[_0x6476('0x38')][_0x6476('0x2e')]);_0x26dc17['offset']=qs[_0x6476('0x2d')](_0x5d8291['query']['offset']);}return _0x160469[_0x6476('0x58')](_0x26dc17);}})[_0x6476('0x1d')](function(_0xf2a49d){if(_0xf2a49d){return _0xf2a49d?{'count':_0xb2f24b,'rows':_0xf2a49d}:null;}})[_0x6476('0x1d')](respondWithResult(_0x17f0c4,null))[_0x6476('0x28')](handleError(_0x17f0c4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index d1eb557..6d70f2a 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 _0x5834=['path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x377612,_0x48ac9f){var _0x3276b5=function(_0x4fc516){while(--_0x4fc516){_0x377612['push'](_0x377612['shift']());}};_0x3276b5(++_0x48ac9f);}(_0x5834,0x14f));var _0x4583=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x5834[_0x18d631];return _0x50d708;};'use strict';var _=require(_0x4583('0x0'));var util=require(_0x4583('0x1'));var logger=require(_0x4583('0x2'))(_0x4583('0x3'));var moment=require(_0x4583('0x4'));var BPromise=require('bluebird');var rp=require(_0x4583('0x5'));var fs=require('fs');var path=require(_0x4583('0x6'));var rimraf=require('rimraf');var config=require(_0x4583('0x7'));var attributes=require(_0x4583('0x8'));module['exports']=function(_0x13d703,_0x3c53a9){return _0x13d703[_0x4583('0x9')](_0x4583('0xa'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf263=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','moment','request-promise','path'];(function(_0x1fcc7d,_0x4eb620){var _0x3daa39=function(_0x2b90f9){while(--_0x2b90f9){_0x1fcc7d['push'](_0x1fcc7d['shift']());}};_0x3daa39(++_0x4eb620);}(_0xf263,0x8b));var _0x3f26=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xf263[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x3f26('0x0'));var util=require('util');var logger=require(_0x3f26('0x1'))('api');var moment=require(_0x3f26('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f26('0x3'));var fs=require('fs');var path=require(_0x3f26('0x4'));var rimraf=require('rimraf');var config=require(_0x3f26('0x5'));var attributes=require(_0x3f26('0x6'));module[_0x3f26('0x7')]=function(_0x2c1ef4,_0x4d16bf){return _0x2c1ef4[_0x3f26('0x8')]('Dynamics365Configuration',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 289085c..67f8f01 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 _0x68bc=['error','code','message','result','util','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x15711a,_0x364a14){var _0x3a5ed2=function(_0x5aae12){while(--_0x5aae12){_0x15711a['push'](_0x15711a['shift']());}};_0x3a5ed2(++_0x364a14);}(_0x68bc,0x1ad));var _0xc68b=function(_0x263f37,_0x5bd9e2){_0x263f37=_0x263f37-0x0;var _0x3ae35d=_0x68bc[_0x263f37];return _0x3ae35d;};'use strict';var _=require('lodash');var util=require(_0xc68b('0x0'));var moment=require(_0xc68b('0x1'));var BPromise=require(_0xc68b('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(_0xc68b('0x3'))('rpc');var config=require(_0xc68b('0x4'));var jayson=require(_0xc68b('0x5'));var client=jayson[_0xc68b('0x6')][_0xc68b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3b148e,_0x5c5d94,_0x3b7a82){return new BPromise(function(_0x214cc1,_0x338291){return client['request'](_0x3b148e,_0x3b7a82)[_0xc68b('0x8')](function(_0x3560d7){logger[_0xc68b('0x9')](_0xc68b('0xa'),_0x5c5d94,_0xc68b('0xb'));logger['debug'](_0xc68b('0xc'),_0x5c5d94,_0xc68b('0xb'),JSON['stringify'](_0x3560d7));if(_0x3560d7[_0xc68b('0xd')]){if(_0x3560d7[_0xc68b('0xd')][_0xc68b('0xe')]===0x1f4){logger[_0xc68b('0xd')](_0xc68b('0xa'),_0x5c5d94,_0x3560d7['error'][_0xc68b('0xf')]);return _0x338291(_0x3560d7[_0xc68b('0xd')][_0xc68b('0xf')]);}logger[_0xc68b('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5c5d94,_0x3560d7['error'][_0xc68b('0xf')]);return _0x214cc1(_0x3560d7[_0xc68b('0xd')][_0xc68b('0xf')]);}else{logger[_0xc68b('0x9')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5c5d94,_0xc68b('0xb'));_0x214cc1(_0x3560d7[_0xc68b('0x10')][_0xc68b('0xf')]);}})['catch'](function(_0x3937d9){logger['error'](_0xc68b('0xa'),_0x5c5d94,_0x3937d9);_0x338291(_0x3937d9);});});} \ No newline at end of file +var _0xde2c=['request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s'];(function(_0x4ce166,_0x418ecb){var _0x3cbf38=function(_0x104b99){while(--_0x104b99){_0x4ce166['push'](_0x4ce166['shift']());}};_0x3cbf38(++_0x418ecb);}(_0xde2c,0x16f));var _0xcde2=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0xde2c[_0x5b7788];return _0x573871;};'use strict';var _=require(_0xcde2('0x0'));var util=require('util');var moment=require(_0xcde2('0x1'));var BPromise=require(_0xcde2('0x2'));var rs=require(_0xcde2('0x3'));var fs=require('fs');var Redis=require(_0xcde2('0x4'));var db=require(_0xcde2('0x5'))['db'];var utils=require(_0xcde2('0x6'));var logger=require(_0xcde2('0x7'))('rpc');var config=require(_0xcde2('0x8'));var jayson=require(_0xcde2('0x9'));var client=jayson[_0xcde2('0xa')][_0xcde2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46ef6c,_0x2dce23,_0x405031){return new BPromise(function(_0x306242,_0x465fcc){return client['request'](_0x46ef6c,_0x405031)[_0xcde2('0xc')](function(_0x5201d2){logger[_0xcde2('0xd')](_0xcde2('0xe'),_0x2dce23,'request\x20sent');logger[_0xcde2('0xf')](_0xcde2('0x10'),_0x2dce23,_0xcde2('0x11'),JSON[_0xcde2('0x12')](_0x5201d2));if(_0x5201d2[_0xcde2('0x13')]){if(_0x5201d2['error'][_0xcde2('0x14')]===0x1f4){logger[_0xcde2('0x13')](_0xcde2('0xe'),_0x2dce23,_0x5201d2[_0xcde2('0x13')]['message']);return _0x465fcc(_0x5201d2['error'][_0xcde2('0x15')]);}logger[_0xcde2('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2dce23,_0x5201d2[_0xcde2('0x13')][_0xcde2('0x15')]);return _0x306242(_0x5201d2[_0xcde2('0x13')][_0xcde2('0x15')]);}else{logger[_0xcde2('0xd')](_0xcde2('0xe'),_0x2dce23,'request\x20sent');_0x306242(_0x5201d2[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x5ea90c){logger[_0xcde2('0x13')](_0xcde2('0xe'),_0x2dce23,_0x5ea90c);_0x465fcc(_0x5ea90c);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 875eac9..efe759b 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 _0x3ac2=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x3ac2,0x1b5));var _0x23ac=function(_0x4df607,_0x1d8455){_0x4df607=_0x4df607-0x0;var _0x23d906=_0x3ac2[_0x4df607];return _0x23d906;};'use strict';var multer=require(_0x23ac('0x0'));var util=require(_0x23ac('0x1'));var path=require(_0x23ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x23ac('0x3'));var router=express[_0x23ac('0x4')]();var auth=require(_0x23ac('0x5'));var interaction=require(_0x23ac('0x6'));var config=require(_0x23ac('0x7'));var controller=require(_0x23ac('0x8'));router[_0x23ac('0x9')]('/',auth[_0x23ac('0xa')](),controller[_0x23ac('0xb')]);router[_0x23ac('0x9')](_0x23ac('0xc'),auth['isAuthenticated'](),controller[_0x23ac('0xd')]);router[_0x23ac('0xe')]('/',auth[_0x23ac('0xa')](),controller['create']);router[_0x23ac('0xf')](_0x23ac('0xc'),auth['isAuthenticated'](),controller[_0x23ac('0x10')]);router[_0x23ac('0x11')](_0x23ac('0xc'),auth[_0x23ac('0xa')](),controller[_0x23ac('0x12')]);module[_0x23ac('0x13')]=router; \ No newline at end of file +var _0xe080=['express','Router','../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer','path','connect-timeout'];(function(_0x39bc44,_0x1d4373){var _0x2916d8=function(_0x1767ac){while(--_0x1767ac){_0x39bc44['push'](_0x39bc44['shift']());}};_0x2916d8(++_0x1d4373);}(_0xe080,0x1d9));var _0x0e08=function(_0xae46ae,_0x6ceec6){_0xae46ae=_0xae46ae-0x0;var _0xf88ff4=_0xe080[_0xae46ae];return _0xf88ff4;};'use strict';var multer=require(_0x0e08('0x0'));var util=require('util');var path=require(_0x0e08('0x1'));var timeout=require(_0x0e08('0x2'));var express=require(_0x0e08('0x3'));var router=express[_0x0e08('0x4')]();var auth=require(_0x0e08('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0e08('0x6'));router[_0x0e08('0x7')]('/',auth[_0x0e08('0x8')](),controller[_0x0e08('0x9')]);router[_0x0e08('0x7')](_0x0e08('0xa'),auth[_0x0e08('0x8')](),controller[_0x0e08('0xb')]);router[_0x0e08('0xc')]('/',auth[_0x0e08('0x8')](),controller[_0x0e08('0xd')]);router[_0x0e08('0xe')](_0x0e08('0xa'),auth['isAuthenticated'](),controller[_0x0e08('0xf')]);router['delete']('/:id',auth[_0x0e08('0x8')](),controller[_0x0e08('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 6e53aed..0c2894d 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 _0x5c00=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x27327f,_0x5f2132){var _0x42e961=function(_0x3f6637){while(--_0x3f6637){_0x27327f['push'](_0x27327f['shift']());}};_0x42e961(++_0x5f2132);}(_0x5c00,0x17e));var _0x05c0=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5c00[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'type':{'type':Sequelize[_0x05c0('0x2')]('string',_0x05c0('0x3'),'customVariable',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'content':{'type':Sequelize[_0x05c0('0x6')]},'key':{'type':Sequelize[_0x05c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x05c0('0x5'),_0x05c0('0x3'),_0x05c0('0x7'))},'keyContent':{'type':Sequelize[_0x05c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05c0('0x6')]},'customField':{'type':Sequelize[_0x05c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05c0('0x6')]}}; \ No newline at end of file +var _0x153f=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x153f,0x15b));var _0xf153=function(_0x511653,_0x3b52b4){_0x511653=_0x511653-0x0;var _0x34e716=_0x153f[_0x511653];return _0x34e716;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'type':{'type':Sequelize[_0xf153('0x2')](_0xf153('0x3'),_0xf153('0x4'),_0xf153('0x5'),_0xf153('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf153('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf153('0x2')](_0xf153('0x3'),_0xf153('0x4'),_0xf153('0x5'))},'keyContent':{'type':Sequelize[_0xf153('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf153('0x7')]},'customField':{'type':Sequelize[_0xf153('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf153('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7aa601c..377dd9c 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 _0x8504=['path','sox','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','options','Dynamics365Field','includeAll','include','findAll','rows','show','find','body','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util'];(function(_0x3a52f2,_0x4a6981){var _0x44cbfb=function(_0x4d69d2){while(--_0x4d69d2){_0x3a52f2['push'](_0x3a52f2['shift']());}};_0x44cbfb(++_0x4a6981);}(_0x8504,0x118));var _0x4850=function(_0x5e93a3,_0x32e4bb){_0x5e93a3=_0x5e93a3-0x0;var _0x3d24df=_0x8504[_0x5e93a3];return _0x3d24df;};'use strict';var pdf=require(_0x4850('0x0'));var emlformat=require(_0x4850('0x1'));var rimraf=require(_0x4850('0x2'));var zipdir=require(_0x4850('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4850('0x4'));var moment=require(_0x4850('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4850('0x6'));var util=require(_0x4850('0x7'));var path=require(_0x4850('0x8'));var sox=require(_0x4850('0x9'));var csv=require(_0x4850('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4850('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4850('0xc'));var deskjs=require(_0x4850('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4850('0xe'));var Redis=require(_0x4850('0xf'));var authService=require(_0x4850('0x10'));var qs=require(_0x4850('0x11'));var hardwareService=require(_0x4850('0x12'));var logger=require(_0x4850('0x13'))(_0x4850('0x14'));var utils=require(_0x4850('0x15'));var config=require(_0x4850('0x16'));var db=require(_0x4850('0x17'))['db'];function respondWithStatusCode(_0x39c087,_0x13b536){_0x13b536=_0x13b536||0xcc;return function(_0x446f29){if(_0x446f29){return _0x39c087[_0x4850('0x18')](_0x13b536);}return _0x39c087['status'](_0x13b536)[_0x4850('0x19')]();};}function respondWithResult(_0x3d919d,_0x5a4b3a){_0x5a4b3a=_0x5a4b3a||0xc8;return function(_0x40ac7f){if(_0x40ac7f){return _0x3d919d['status'](_0x5a4b3a)[_0x4850('0x1a')](_0x40ac7f);}};}function respondWithFilteredResult(_0x5c86a8,_0xb25a58){return function(_0x50cf98){if(_0x50cf98){var _0x9b13f3=_0x50cf98[_0x4850('0x1b')],_0x3bf82b=_0xb25a58[_0x4850('0x1c')],_0xaaab3d=_0xb25a58[_0x4850('0x1c')]+_0xb25a58['limit'],_0x5945f0;if(_0xaaab3d>=_0x9b13f3){_0xaaab3d=_0x9b13f3;_0x5945f0=0xc8;}else{_0x5945f0=0xce;}_0x5c86a8[_0x4850('0x1d')](_0x5945f0);return _0x5c86a8[_0x4850('0x1e')]('Content-Range',_0x3bf82b+'-'+_0xaaab3d+'/'+_0x9b13f3)[_0x4850('0x1a')](_0x50cf98);}return null;};}function patchUpdates(_0x1c5476){return function(_0x4c6b67){try{jsonpatch[_0x4850('0x1f')](_0x4c6b67,_0x1c5476,!![]);}catch(_0x14c19b){return BPromise[_0x4850('0x20')](_0x14c19b);}return _0x4c6b67['save']();};}function saveUpdates(_0x25672a,_0x5a13d6){return function(_0x5f3477){if(_0x5f3477){return _0x5f3477[_0x4850('0x21')](_0x25672a)[_0x4850('0x22')](function(_0x515b78){return _0x515b78;});}return null;};}function removeEntity(_0x2f5684,_0x1378c9){return function(_0x383bd9){if(_0x383bd9){return _0x383bd9[_0x4850('0x23')]()[_0x4850('0x22')](function(){_0x2f5684[_0x4850('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bfa38,_0x5ae4e){return function(_0x3b5f43){if(!_0x3b5f43){_0x3bfa38[_0x4850('0x18')](0x194);}return _0x3b5f43;};}function handleError(_0x36a705,_0x4428b8){_0x4428b8=_0x4428b8||0x1f4;return function(_0x1fc21c){logger[_0x4850('0x24')](_0x1fc21c[_0x4850('0x25')]);if(_0x1fc21c['name']){delete _0x1fc21c[_0x4850('0x26')];}_0x36a705[_0x4850('0x1d')](_0x4428b8)[_0x4850('0x27')](_0x1fc21c);};}exports[_0x4850('0x28')]=function(_0x28f363,_0x5256d9){var _0x3fcf20={},_0x5d23e8={},_0x54623d={'count':0x0,'rows':[]};var _0x4cff0a=db['Dynamics365Field'][_0x4850('0x29')];_0x5d23e8[_0x4850('0x2a')]=_[_0x4850('0x2b')](_0x4cff0a);_0x5d23e8[_0x4850('0x2c')]=_[_0x4850('0x2b')](_0x28f363[_0x4850('0x2c')]);_0x5d23e8[_0x4850('0x2d')]=_[_0x4850('0x2e')](_0x5d23e8[_0x4850('0x2a')],_0x5d23e8[_0x4850('0x2c')]);_0x3fcf20[_0x4850('0x2f')]=_[_0x4850('0x2e')](_0x5d23e8[_0x4850('0x2a')],qs[_0x4850('0x30')](_0x28f363[_0x4850('0x2c')][_0x4850('0x30')]));_0x3fcf20[_0x4850('0x2f')]=_0x3fcf20['attributes'][_0x4850('0x31')]?_0x3fcf20[_0x4850('0x2f')]:_0x5d23e8['model'];if(!_0x28f363['query'][_0x4850('0x32')](_0x4850('0x33'))){_0x3fcf20[_0x4850('0x34')]=qs[_0x4850('0x34')](_0x28f363[_0x4850('0x2c')][_0x4850('0x34')]);_0x3fcf20[_0x4850('0x1c')]=qs[_0x4850('0x1c')](_0x28f363['query'][_0x4850('0x1c')]);}_0x3fcf20[_0x4850('0x35')]=qs[_0x4850('0x36')](_0x28f363[_0x4850('0x2c')][_0x4850('0x36')]);_0x3fcf20[_0x4850('0x37')]=qs[_0x4850('0x2d')](_['pick'](_0x28f363['query'],_0x5d23e8[_0x4850('0x2d')]));if(_0x28f363[_0x4850('0x2c')][_0x4850('0x38')]){_0x3fcf20[_0x4850('0x37')]=_[_0x4850('0x39')](_0x3fcf20['where'],{'$or':_[_0x4850('0x3a')](_0x4cff0a,function(_0x387922){if(_0x387922[_0x4850('0x3b')][_0x4850('0x3c')]!==_0x4850('0x3d')){var _0x1fef1a={};_0x1fef1a[_0x387922['field']]={'$like':'%'+_0x28f363[_0x4850('0x2c')][_0x4850('0x38')]+'%'};return _0x1fef1a;}})});}_0x3fcf20=_[_0x4850('0x39')]({},_0x3fcf20,_0x28f363[_0x4850('0x3e')]);var _0x52ec2b={'where':_0x3fcf20[_0x4850('0x37')]};return db[_0x4850('0x3f')][_0x4850('0x1b')](_0x52ec2b)['then'](function(_0x389482){_0x54623d[_0x4850('0x1b')]=_0x389482;if(_0x28f363[_0x4850('0x2c')][_0x4850('0x40')]){_0x3fcf20[_0x4850('0x41')]=[{'all':!![]}];}return db[_0x4850('0x3f')][_0x4850('0x42')](_0x3fcf20);})[_0x4850('0x22')](function(_0x15177b){_0x54623d[_0x4850('0x43')]=_0x15177b;return _0x54623d;})[_0x4850('0x22')](respondWithFilteredResult(_0x5256d9,_0x3fcf20))['catch'](handleError(_0x5256d9,null));};exports[_0x4850('0x44')]=function(_0x27908d,_0x3344f5){var _0x3d7fb7={'raw':!![],'where':{'id':_0x27908d['params']['id']}},_0x4389c7={};_0x4389c7[_0x4850('0x2a')]=_[_0x4850('0x2b')](db[_0x4850('0x3f')][_0x4850('0x29')]);_0x4389c7[_0x4850('0x2c')]=_[_0x4850('0x2b')](_0x27908d['query']);_0x4389c7[_0x4850('0x2d')]=_[_0x4850('0x2e')](_0x4389c7['model'],_0x4389c7[_0x4850('0x2c')]);_0x3d7fb7['attributes']=_[_0x4850('0x2e')](_0x4389c7[_0x4850('0x2a')],qs[_0x4850('0x30')](_0x27908d[_0x4850('0x2c')]['fields']));_0x3d7fb7['attributes']=_0x3d7fb7[_0x4850('0x2f')][_0x4850('0x31')]?_0x3d7fb7['attributes']:_0x4389c7[_0x4850('0x2a')];if(_0x27908d['query'][_0x4850('0x40')]){_0x3d7fb7[_0x4850('0x41')]=[{'all':!![]}];}_0x3d7fb7=_[_0x4850('0x39')]({},_0x3d7fb7,_0x27908d[_0x4850('0x3e')]);return db[_0x4850('0x3f')][_0x4850('0x45')](_0x3d7fb7)[_0x4850('0x22')](handleEntityNotFound(_0x3344f5,null))[_0x4850('0x22')](respondWithResult(_0x3344f5,null))['catch'](handleError(_0x3344f5,null));};exports['create']=function(_0x433d97,_0x46768e){return db['Dynamics365Field']['create'](_0x433d97[_0x4850('0x46')],{})[_0x4850('0x22')](respondWithResult(_0x46768e,0xc9))[_0x4850('0x47')](handleError(_0x46768e,null));};exports[_0x4850('0x21')]=function(_0x2c253b,_0x2d4c8a){if(_0x2c253b[_0x4850('0x46')]['id']){delete _0x2c253b[_0x4850('0x46')]['id'];}return db[_0x4850('0x3f')][_0x4850('0x45')]({'where':{'id':_0x2c253b['params']['id']}})['then'](handleEntityNotFound(_0x2d4c8a,null))[_0x4850('0x22')](saveUpdates(_0x2c253b[_0x4850('0x46')],null))[_0x4850('0x22')](respondWithResult(_0x2d4c8a,null))[_0x4850('0x47')](handleError(_0x2d4c8a,null));};exports[_0x4850('0x23')]=function(_0x43975c,_0x37783d){return db[_0x4850('0x3f')][_0x4850('0x45')]({'where':{'id':_0x43975c['params']['id']}})[_0x4850('0x22')](handleEntityNotFound(_0x37783d,null))['then'](removeEntity(_0x37783d,null))[_0x4850('0x47')](handleError(_0x37783d,null));}; \ No newline at end of file +var _0x0cff=['status','end','json','offset','limit','set','apply','reject','update','then','destroy','error','name','send','index','Dynamics365Field','rawAttributes','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus'];(function(_0x120905,_0x3ed4ef){var _0x55446d=function(_0x1f3785){while(--_0x1f3785){_0x120905['push'](_0x120905['shift']());}};_0x55446d(++_0x3ed4ef);}(_0x0cff,0x18c));var _0xf0cf=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x0cff[_0x5d8018];return _0x151ac4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf0cf('0x0'));var rimraf=require(_0xf0cf('0x1'));var zipdir=require(_0xf0cf('0x2'));var jsonpatch=require(_0xf0cf('0x3'));var rp=require('request-promise');var moment=require(_0xf0cf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf0cf('0x5'));var util=require(_0xf0cf('0x6'));var path=require(_0xf0cf('0x7'));var sox=require(_0xf0cf('0x8'));var csv=require(_0xf0cf('0x9'));var ejs=require(_0xf0cf('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf0cf('0xb'));var crypto=require(_0xf0cf('0xc'));var jsforce=require(_0xf0cf('0xd'));var deskjs=require(_0xf0cf('0xe'));var toCsv=require(_0xf0cf('0x9'));var querystring=require('querystring');var Papa=require(_0xf0cf('0xf'));var Redis=require(_0xf0cf('0x10'));var authService=require(_0xf0cf('0x11'));var qs=require(_0xf0cf('0x12'));var hardwareService=require(_0xf0cf('0x13'));var logger=require(_0xf0cf('0x14'))(_0xf0cf('0x15'));var utils=require('../../config/utils');var config=require(_0xf0cf('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b5bad,_0x3cbf8d){_0x3cbf8d=_0x3cbf8d||0xcc;return function(_0x480c1d){if(_0x480c1d){return _0x1b5bad[_0xf0cf('0x17')](_0x3cbf8d);}return _0x1b5bad[_0xf0cf('0x18')](_0x3cbf8d)[_0xf0cf('0x19')]();};}function respondWithResult(_0x4f96f1,_0x55ef0c){_0x55ef0c=_0x55ef0c||0xc8;return function(_0x6aedc){if(_0x6aedc){return _0x4f96f1[_0xf0cf('0x18')](_0x55ef0c)[_0xf0cf('0x1a')](_0x6aedc);}};}function respondWithFilteredResult(_0x940a76,_0x265718){return function(_0x25f1f2){if(_0x25f1f2){var _0x12fc03=_0x25f1f2['count'],_0x1e5011=_0x265718[_0xf0cf('0x1b')],_0x17f2a4=_0x265718[_0xf0cf('0x1b')]+_0x265718[_0xf0cf('0x1c')],_0x486ee9;if(_0x17f2a4>=_0x12fc03){_0x17f2a4=_0x12fc03;_0x486ee9=0xc8;}else{_0x486ee9=0xce;}_0x940a76['status'](_0x486ee9);return _0x940a76[_0xf0cf('0x1d')]('Content-Range',_0x1e5011+'-'+_0x17f2a4+'/'+_0x12fc03)[_0xf0cf('0x1a')](_0x25f1f2);}return null;};}function patchUpdates(_0x254d04){return function(_0x1ea1ad){try{jsonpatch[_0xf0cf('0x1e')](_0x1ea1ad,_0x254d04,!![]);}catch(_0x41a089){return BPromise[_0xf0cf('0x1f')](_0x41a089);}return _0x1ea1ad['save']();};}function saveUpdates(_0x1519d7,_0x5b76eb){return function(_0x898373){if(_0x898373){return _0x898373[_0xf0cf('0x20')](_0x1519d7)[_0xf0cf('0x21')](function(_0x31adc1){return _0x31adc1;});}return null;};}function removeEntity(_0x2234c5,_0x98c667){return function(_0x13c9c9){if(_0x13c9c9){return _0x13c9c9[_0xf0cf('0x22')]()[_0xf0cf('0x21')](function(){_0x2234c5[_0xf0cf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebbce,_0x9e600){return function(_0x23e8c8){if(!_0x23e8c8){_0x1ebbce['sendStatus'](0x194);}return _0x23e8c8;};}function handleError(_0x1d3d3e,_0x1a647d){_0x1a647d=_0x1a647d||0x1f4;return function(_0x106861){logger[_0xf0cf('0x23')](_0x106861['stack']);if(_0x106861[_0xf0cf('0x24')]){delete _0x106861['name'];}_0x1d3d3e[_0xf0cf('0x18')](_0x1a647d)[_0xf0cf('0x25')](_0x106861);};}exports[_0xf0cf('0x26')]=function(_0x47c844,_0x4aaadb){var _0x2f4ff1={},_0x194421={},_0x374ae1={'count':0x0,'rows':[]};var _0x5a1f44=db[_0xf0cf('0x27')][_0xf0cf('0x28')];_0x194421['model']=_[_0xf0cf('0x29')](_0x5a1f44);_0x194421[_0xf0cf('0x2a')]=_[_0xf0cf('0x29')](_0x47c844[_0xf0cf('0x2a')]);_0x194421[_0xf0cf('0x2b')]=_['intersection'](_0x194421['model'],_0x194421[_0xf0cf('0x2a')]);_0x2f4ff1['attributes']=_[_0xf0cf('0x2c')](_0x194421[_0xf0cf('0x2d')],qs[_0xf0cf('0x2e')](_0x47c844[_0xf0cf('0x2a')]['fields']));_0x2f4ff1[_0xf0cf('0x2f')]=_0x2f4ff1[_0xf0cf('0x2f')]['length']?_0x2f4ff1[_0xf0cf('0x2f')]:_0x194421['model'];if(!_0x47c844[_0xf0cf('0x2a')]['hasOwnProperty'](_0xf0cf('0x30'))){_0x2f4ff1[_0xf0cf('0x1c')]=qs[_0xf0cf('0x1c')](_0x47c844[_0xf0cf('0x2a')][_0xf0cf('0x1c')]);_0x2f4ff1[_0xf0cf('0x1b')]=qs[_0xf0cf('0x1b')](_0x47c844[_0xf0cf('0x2a')]['offset']);}_0x2f4ff1[_0xf0cf('0x31')]=qs[_0xf0cf('0x32')](_0x47c844['query']['sort']);_0x2f4ff1[_0xf0cf('0x33')]=qs[_0xf0cf('0x2b')](_['pick'](_0x47c844[_0xf0cf('0x2a')],_0x194421['filters']));if(_0x47c844[_0xf0cf('0x2a')]['filter']){_0x2f4ff1[_0xf0cf('0x33')]=_[_0xf0cf('0x34')](_0x2f4ff1[_0xf0cf('0x33')],{'$or':_[_0xf0cf('0x35')](_0x5a1f44,function(_0x280a5d){if(_0x280a5d[_0xf0cf('0x36')][_0xf0cf('0x37')]!==_0xf0cf('0x38')){var _0x38c657={};_0x38c657[_0x280a5d['field']]={'$like':'%'+_0x47c844[_0xf0cf('0x2a')]['filter']+'%'};return _0x38c657;}})});}_0x2f4ff1=_[_0xf0cf('0x34')]({},_0x2f4ff1,_0x47c844[_0xf0cf('0x39')]);var _0x584111={'where':_0x2f4ff1[_0xf0cf('0x33')]};return db[_0xf0cf('0x27')][_0xf0cf('0x3a')](_0x584111)['then'](function(_0x463420){_0x374ae1[_0xf0cf('0x3a')]=_0x463420;if(_0x47c844[_0xf0cf('0x2a')][_0xf0cf('0x3b')]){_0x2f4ff1[_0xf0cf('0x3c')]=[{'all':!![]}];}return db[_0xf0cf('0x27')][_0xf0cf('0x3d')](_0x2f4ff1);})[_0xf0cf('0x21')](function(_0x2bd352){_0x374ae1[_0xf0cf('0x3e')]=_0x2bd352;return _0x374ae1;})[_0xf0cf('0x21')](respondWithFilteredResult(_0x4aaadb,_0x2f4ff1))[_0xf0cf('0x3f')](handleError(_0x4aaadb,null));};exports[_0xf0cf('0x40')]=function(_0x36ea87,_0x4b993f){var _0x389c59={'raw':!![],'where':{'id':_0x36ea87[_0xf0cf('0x41')]['id']}},_0x2e97a4={};_0x2e97a4['model']=_['keys'](db[_0xf0cf('0x27')][_0xf0cf('0x28')]);_0x2e97a4[_0xf0cf('0x2a')]=_[_0xf0cf('0x29')](_0x36ea87['query']);_0x2e97a4['filters']=_['intersection'](_0x2e97a4[_0xf0cf('0x2d')],_0x2e97a4[_0xf0cf('0x2a')]);_0x389c59[_0xf0cf('0x2f')]=_[_0xf0cf('0x2c')](_0x2e97a4['model'],qs[_0xf0cf('0x2e')](_0x36ea87[_0xf0cf('0x2a')][_0xf0cf('0x2e')]));_0x389c59[_0xf0cf('0x2f')]=_0x389c59[_0xf0cf('0x2f')][_0xf0cf('0x42')]?_0x389c59[_0xf0cf('0x2f')]:_0x2e97a4[_0xf0cf('0x2d')];if(_0x36ea87[_0xf0cf('0x2a')]['includeAll']){_0x389c59[_0xf0cf('0x3c')]=[{'all':!![]}];}_0x389c59=_[_0xf0cf('0x34')]({},_0x389c59,_0x36ea87[_0xf0cf('0x39')]);return db['Dynamics365Field'][_0xf0cf('0x43')](_0x389c59)[_0xf0cf('0x21')](handleEntityNotFound(_0x4b993f,null))['then'](respondWithResult(_0x4b993f,null))[_0xf0cf('0x3f')](handleError(_0x4b993f,null));};exports[_0xf0cf('0x44')]=function(_0x54bbd6,_0x35b257){return db[_0xf0cf('0x27')]['create'](_0x54bbd6['body'],{})[_0xf0cf('0x21')](respondWithResult(_0x35b257,0xc9))[_0xf0cf('0x3f')](handleError(_0x35b257,null));};exports['update']=function(_0x2bd963,_0x2e5976){if(_0x2bd963[_0xf0cf('0x45')]['id']){delete _0x2bd963[_0xf0cf('0x45')]['id'];}return db[_0xf0cf('0x27')][_0xf0cf('0x43')]({'where':{'id':_0x2bd963[_0xf0cf('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e5976,null))[_0xf0cf('0x21')](saveUpdates(_0x2bd963[_0xf0cf('0x45')],null))['then'](respondWithResult(_0x2e5976,null))[_0xf0cf('0x3f')](handleError(_0x2e5976,null));};exports['destroy']=function(_0x2a0a05,_0x986713){return db[_0xf0cf('0x27')][_0xf0cf('0x43')]({'where':{'id':_0x2a0a05[_0xf0cf('0x41')]['id']}})[_0xf0cf('0x21')](handleEntityNotFound(_0x986713,null))[_0xf0cf('0x21')](removeEntity(_0x986713,null))[_0xf0cf('0x3f')](handleError(_0x986713,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index e81f475..963d160 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 _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x3915e2,_0x577c1e){var _0x34e6a2=function(_0x497e4d){while(--_0x497e4d){_0x3915e2['push'](_0x3915e2['shift']());}};_0x34e6a2(++_0x577c1e);}(_0x7a54,0x106));var _0x47a5=function(_0x46267f,_0x1d8710){_0x46267f=_0x46267f-0x0;var _0x2df9b2=_0x7a54[_0x46267f];return _0x2df9b2;};'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':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_dynamics365_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field'];(function(_0x1e38d4,_0x22388f){var _0x322b36=function(_0x4c3ecb){while(--_0x4c3ecb){_0x1e38d4['push'](_0x1e38d4['shift']());}};_0x322b36(++_0x22388f);}(_0x7a54,0x106));var _0x47a5=function(_0x1c2269,_0x199bfc){_0x1c2269=_0x1c2269-0x0;var _0x5c4482=_0x7a54[_0x1c2269];return _0x5c4482;};'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':'dynamics365_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 96d7987..d82a799 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 _0xedd7=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring'];(function(_0x3e55c6,_0x18c7bc){var _0x5e6a12=function(_0x295397){while(--_0x295397){_0x3e55c6['push'](_0x3e55c6['shift']());}};_0x5e6a12(++_0x18c7bc);}(_0xedd7,0x6f));var _0x7edd=function(_0x4624c4,_0x2620c9){_0x4624c4=_0x4624c4-0x0;var _0x3c0d60=_0xedd7[_0x4624c4];return _0x3c0d60;};'use strict';var _=require('lodash');var util=require(_0x7edd('0x0'));var moment=require(_0x7edd('0x1'));var BPromise=require(_0x7edd('0x2'));var rs=require(_0x7edd('0x3'));var fs=require('fs');var Redis=require(_0x7edd('0x4'));var db=require(_0x7edd('0x5'))['db'];var utils=require(_0x7edd('0x6'));var logger=require('../../config/logger')(_0x7edd('0x7'));var config=require(_0x7edd('0x8'));var jayson=require(_0x7edd('0x9'));var client=jayson['client'][_0x7edd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd943ba,_0x578582,_0x22e2d3){return new BPromise(function(_0x2ed6c5,_0xe81b82){return client[_0x7edd('0xb')](_0xd943ba,_0x22e2d3)[_0x7edd('0xc')](function(_0x4c804f){logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x578582,_0x7edd('0xd'));logger['debug'](_0x7edd('0xe'),_0x578582,_0x7edd('0xd'),JSON[_0x7edd('0xf')](_0x4c804f));if(_0x4c804f[_0x7edd('0x10')]){if(_0x4c804f[_0x7edd('0x10')][_0x7edd('0x11')]===0x1f4){logger[_0x7edd('0x10')](_0x7edd('0x12'),_0x578582,_0x4c804f[_0x7edd('0x10')]['message']);return _0xe81b82(_0x4c804f[_0x7edd('0x10')][_0x7edd('0x13')]);}logger[_0x7edd('0x10')](_0x7edd('0x12'),_0x578582,_0x4c804f[_0x7edd('0x10')][_0x7edd('0x13')]);return _0x2ed6c5(_0x4c804f[_0x7edd('0x10')]['message']);}else{logger[_0x7edd('0x14')]('Dynamics365Field,\x20%s,\x20%s',_0x578582,_0x7edd('0xd'));_0x2ed6c5(_0x4c804f[_0x7edd('0x15')][_0x7edd('0x13')]);}})[_0x7edd('0x16')](function(_0x2b6e67){logger[_0x7edd('0x10')](_0x7edd('0x12'),_0x578582,_0x2b6e67);_0xe81b82(_0x2b6e67);});});} \ No newline at end of file +var _0xef7e=['http','request','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Field,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xef7e,0x194));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeef7('0x0'));var util=require('util');var moment=require(_0xeef7('0x1'));var BPromise=require(_0xeef7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeef7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeef7('0x4'));var logger=require(_0xeef7('0x5'))(_0xeef7('0x6'));var config=require(_0xeef7('0x7'));var jayson=require(_0xeef7('0x8'));var client=jayson[_0xeef7('0x9')][_0xeef7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbe8730,_0x104b84,_0x1e3695){return new BPromise(function(_0xc41c2d,_0x1021d5){return client[_0xeef7('0xb')](_0xbe8730,_0x1e3695)[_0xeef7('0xc')](function(_0x39a6cb){logger[_0xeef7('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x104b84,_0xeef7('0xe'));logger['debug'](_0xeef7('0xf'),_0x104b84,_0xeef7('0xe'),JSON[_0xeef7('0x10')](_0x39a6cb));if(_0x39a6cb[_0xeef7('0x11')]){if(_0x39a6cb[_0xeef7('0x11')][_0xeef7('0x12')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x104b84,_0x39a6cb[_0xeef7('0x11')][_0xeef7('0x13')]);return _0x1021d5(_0x39a6cb[_0xeef7('0x11')]['message']);}logger[_0xeef7('0x11')](_0xeef7('0x14'),_0x104b84,_0x39a6cb[_0xeef7('0x11')][_0xeef7('0x13')]);return _0xc41c2d(_0x39a6cb['error'][_0xeef7('0x13')]);}else{logger[_0xeef7('0xd')](_0xeef7('0x14'),_0x104b84,'request\x20sent');_0xc41c2d(_0x39a6cb[_0xeef7('0x15')][_0xeef7('0x13')]);}})[_0xeef7('0x16')](function(_0x75cb6f){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x104b84,_0x75cb6f);_0x1021d5(_0x75cb6f);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 09da1fb..bcbadc7 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 _0x823a=['exports','util','path','express','Router','../../components/auth/service','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','addConfiguration','put','update','delete'];(function(_0x58fd14,_0xa2b92a){var _0x320f2b=function(_0x333e7a){while(--_0x333e7a){_0x58fd14['push'](_0x58fd14['shift']());}};_0x320f2b(++_0xa2b92a);}(_0x823a,0x1a5));var _0xa823=function(_0x5da01c,_0x53bf77){_0x5da01c=_0x5da01c-0x0;var _0x1216c2=_0x823a[_0x5da01c];return _0x1216c2;};'use strict';var multer=require('multer');var util=require(_0xa823('0x0'));var path=require(_0xa823('0x1'));var timeout=require('connect-timeout');var express=require(_0xa823('0x2'));var router=express[_0xa823('0x3')]();var auth=require(_0xa823('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa823('0x5'));router['get']('/',auth[_0xa823('0x6')](),controller[_0xa823('0x7')]);router[_0xa823('0x8')](_0xa823('0x9'),auth[_0xa823('0x6')](),controller[_0xa823('0xa')]);router['get'](_0xa823('0xb'),auth[_0xa823('0x6')](),controller[_0xa823('0xc')]);router[_0xa823('0x8')](_0xa823('0xd'),auth[_0xa823('0x6')](),controller[_0xa823('0xe')]);router['post']('/',auth[_0xa823('0x6')](),controller['create']);router['post'](_0xa823('0xb'),auth[_0xa823('0x6')](),controller[_0xa823('0xf')]);router[_0xa823('0x10')](_0xa823('0x9'),auth['isAuthenticated'](),controller[_0xa823('0x11')]);router[_0xa823('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa823('0x13')]=router; \ No newline at end of file +var _0x8f60=['index','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x5e0fcd,_0x2a6202){var _0x8e934e=function(_0xab6615){while(--_0xab6615){_0x5e0fcd['push'](_0x5e0fcd['shift']());}};_0x8e934e(++_0x2a6202);}(_0x8f60,0x199));var _0x08f6=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0x8f60[_0x43aee5];return _0x76d1d0;};'use strict';var multer=require(_0x08f6('0x0'));var util=require('util');var path=require(_0x08f6('0x1'));var timeout=require(_0x08f6('0x2'));var express=require(_0x08f6('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x08f6('0x4'));var config=require(_0x08f6('0x5'));var controller=require(_0x08f6('0x6'));router[_0x08f6('0x7')]('/',auth[_0x08f6('0x8')](),controller[_0x08f6('0x9')]);router['get']('/:id',auth[_0x08f6('0x8')](),controller[_0x08f6('0xa')]);router[_0x08f6('0x7')](_0x08f6('0xb'),auth[_0x08f6('0x8')](),controller[_0x08f6('0xc')]);router[_0x08f6('0x7')](_0x08f6('0xd'),auth[_0x08f6('0x8')](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x08f6('0xe')]);router[_0x08f6('0xf')](_0x08f6('0xb'),auth['isAuthenticated'](),controller[_0x08f6('0x10')]);router['put'](_0x08f6('0x11'),auth[_0x08f6('0x8')](),controller[_0x08f6('0x12')]);router[_0x08f6('0x13')](_0x08f6('0x11'),auth['isAuthenticated'](),controller[_0x08f6('0x14')]);module[_0x08f6('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index cf0769a..1675af6 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 _0xca81=['username','remoteUri','sequelize','exports','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xca81,0xb6));var _0x1ca8=function(_0x52df9e,_0x28ea4d){_0x52df9e=_0x52df9e-0x0;var _0x4a929f=_0xca81[_0x52df9e];return _0x4a929f;};'use strict';var Sequelize=require(_0x1ca8('0x0'));module[_0x1ca8('0x1')]={'name':{'type':Sequelize[_0x1ca8('0x2')]},'description':{'type':Sequelize[_0x1ca8('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1ca8('0x3')},'apiKey':{'type':Sequelize[_0x1ca8('0x2')]},'remoteUri':{'type':Sequelize[_0x1ca8('0x2')],'unique':_0x1ca8('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4165=['username','remoteUri','sequelize','exports','STRING'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x4165,0x1f1));var _0x5416=function(_0x59ffaf,_0x3b89db){_0x59ffaf=_0x59ffaf-0x0;var _0x5ab585=_0x4165[_0x59ffaf];return _0x5ab585;};'use strict';var Sequelize=require(_0x5416('0x0'));module[_0x5416('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5416('0x2')]},'username':{'type':Sequelize[_0x5416('0x2')],'unique':_0x5416('0x3')},'apiKey':{'type':Sequelize[_0x5416('0x2')]},'remoteUri':{'type':Sequelize[_0x5416('0x2')],'unique':_0x5416('0x4')},'serverUrl':{'type':Sequelize[_0x5416('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 227d151..0edc30f 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 _0x80e0=['body','findOne','FreshdeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','apiKey','remoteUri','slice','substring','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','base64','requester','subject','agent','description','priority','source','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','client','http','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','count','offset','limit','json','apply','reject','save','update','then','destroy','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','key','field','options','FreshdeskAccount','includeAll','include','findAll','rows','show','params','find','catch','create'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x80e0,0x9d));var _0x080e=function(_0x3d5e84,_0x58b603){_0x3d5e84=_0x3d5e84-0x0;var _0x485188=_0x80e0[_0x3d5e84];return _0x485188;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x080e('0x0'));var zipdir=require(_0x080e('0x1'));var jsonpatch=require(_0x080e('0x2'));var rp=require('request-promise');var moment=require(_0x080e('0x3'));var BPromise=require(_0x080e('0x4'));var Mustache=require(_0x080e('0x5'));var util=require('util');var path=require(_0x080e('0x6'));var sox=require(_0x080e('0x7'));var csv=require(_0x080e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x080e('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x080e('0xa'));var toCsv=require('to-csv');var querystring=require(_0x080e('0xb'));var Papa=require(_0x080e('0xc'));var Redis=require(_0x080e('0xd'));var authService=require(_0x080e('0xe'));var qs=require(_0x080e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x080e('0x10'));var utils=require(_0x080e('0x11'));var config=require(_0x080e('0x12'));var db=require(_0x080e('0x13'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x080e('0x14')][_0x080e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x10fc04,_0x568960,_0x238744){if(_0x238744){var _0x3fae11=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fae11['test'](_0x568960)){return _0x10fc04;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x10fc04;}}function respondWithRpcPromise(_0x53b13c,_0x4a6e2b,_0x3e49c0,_0x16429a){return new BPromise(function(_0x5816c8,_0x4d1a7d){var _0x3394c1=_0x16429a||client;return _0x3394c1['request'](_0x53b13c,_0x3e49c0)['then'](function(_0x1b87fb){logger['info'](_0x080e('0x16'),_0x4a6e2b,_0x080e('0x17'));logger[_0x080e('0x18')](_0x080e('0x19'),_0x4a6e2b,'request\x20sent',JSON[_0x080e('0x1a')](_0x1b87fb));if(_0x1b87fb[_0x080e('0x1b')]){if(_0x1b87fb[_0x080e('0x1b')]['code']===0x1f4){logger[_0x080e('0x1b')](_0x080e('0x16'),_0x4a6e2b,_0x1b87fb[_0x080e('0x1b')]['message']);return _0x4d1a7d(_0x1b87fb[_0x080e('0x1b')][_0x080e('0x1c')]);}logger[_0x080e('0x1b')]('FreshdeskAccount,\x20%s,\x20%s',_0x4a6e2b,_0x1b87fb[_0x080e('0x1b')]['message']);return _0x5816c8(_0x1b87fb[_0x080e('0x1b')][_0x080e('0x1c')]);}else{logger[_0x080e('0x1d')](_0x080e('0x16'),_0x4a6e2b,_0x080e('0x17'));_0x5816c8(_0x1b87fb[_0x080e('0x1e')][_0x080e('0x1c')]);}})['catch'](function(_0x416f57){logger[_0x080e('0x1b')](_0x080e('0x16'),_0x4a6e2b,_0x416f57);_0x4d1a7d(_0x416f57);});});}function respondWithStatusCode(_0x14fdcd,_0xce186b){_0xce186b=_0xce186b||0xcc;return function(_0xd64e99){if(_0xd64e99){return _0x14fdcd[_0x080e('0x1f')](_0xce186b);}return _0x14fdcd[_0x080e('0x20')](_0xce186b)[_0x080e('0x21')]();};}function respondWithResult(_0x2e0d50,_0x3bb0bd){_0x3bb0bd=_0x3bb0bd||0xc8;return function(_0x50c791){if(_0x50c791){return _0x2e0d50[_0x080e('0x20')](_0x3bb0bd)['json'](_0x50c791);}};}function respondWithFilteredResult(_0x575874,_0x185445){return function(_0x4e9f41){if(_0x4e9f41){var _0x21130e=_0x4e9f41[_0x080e('0x22')],_0x3d7fa5=_0x185445[_0x080e('0x23')],_0x1a709a=_0x185445[_0x080e('0x23')]+_0x185445[_0x080e('0x24')],_0x1fe8b0;if(_0x1a709a>=_0x21130e){_0x1a709a=_0x21130e;_0x1fe8b0=0xc8;}else{_0x1fe8b0=0xce;}_0x575874[_0x080e('0x20')](_0x1fe8b0);return _0x575874['set']('Content-Range',_0x3d7fa5+'-'+_0x1a709a+'/'+_0x21130e)[_0x080e('0x25')](_0x4e9f41);}return null;};}function patchUpdates(_0x90c97e){return function(_0x181269){try{jsonpatch[_0x080e('0x26')](_0x181269,_0x90c97e,!![]);}catch(_0x34b3f6){return BPromise[_0x080e('0x27')](_0x34b3f6);}return _0x181269[_0x080e('0x28')]();};}function saveUpdates(_0x15aad2,_0x3f962e){return function(_0x3081c0){if(_0x3081c0){return _0x3081c0[_0x080e('0x29')](_0x15aad2)[_0x080e('0x2a')](function(_0x33b45f){return _0x33b45f;});}return null;};}function removeEntity(_0x4cc5c1,_0x1ba075){return function(_0x5ecf02){if(_0x5ecf02){return _0x5ecf02[_0x080e('0x2b')]()[_0x080e('0x2a')](function(){_0x4cc5c1[_0x080e('0x20')](0xcc)[_0x080e('0x21')]();});}};}function handleEntityNotFound(_0x324e90,_0x2b6e7b){return function(_0x1e8882){if(!_0x1e8882){_0x324e90[_0x080e('0x1f')](0x194);}return _0x1e8882;};}function handleError(_0x7ccc0f,_0x350a68){_0x350a68=_0x350a68||0x1f4;return function(_0x11e04f){logger[_0x080e('0x1b')](_0x11e04f[_0x080e('0x2c')]);if(_0x11e04f['name']){delete _0x11e04f[_0x080e('0x2d')];}_0x7ccc0f[_0x080e('0x20')](_0x350a68)[_0x080e('0x2e')](_0x11e04f);};}exports['index']=function(_0x39f2db,_0xbbc836){var _0x1c1b4f={},_0x439fe0={},_0x81e161={'count':0x0,'rows':[]};var _0x484328=db['FreshdeskAccount'][_0x080e('0x2f')];_0x439fe0[_0x080e('0x30')]=_[_0x080e('0x31')](_0x484328);_0x439fe0[_0x080e('0x32')]=_[_0x080e('0x31')](_0x39f2db[_0x080e('0x32')]);_0x439fe0[_0x080e('0x33')]=_[_0x080e('0x34')](_0x439fe0['model'],_0x439fe0[_0x080e('0x32')]);_0x1c1b4f['attributes']=_[_0x080e('0x34')](_0x439fe0[_0x080e('0x30')],qs[_0x080e('0x35')](_0x39f2db[_0x080e('0x32')][_0x080e('0x35')]));_0x1c1b4f[_0x080e('0x36')]=_0x1c1b4f[_0x080e('0x36')][_0x080e('0x37')]?_0x1c1b4f[_0x080e('0x36')]:_0x439fe0[_0x080e('0x30')];if(!_0x39f2db[_0x080e('0x32')][_0x080e('0x38')](_0x080e('0x39'))){_0x1c1b4f[_0x080e('0x24')]=qs['limit'](_0x39f2db[_0x080e('0x32')][_0x080e('0x24')]);_0x1c1b4f['offset']=qs[_0x080e('0x23')](_0x39f2db['query'][_0x080e('0x23')]);}_0x1c1b4f[_0x080e('0x3a')]=qs[_0x080e('0x3b')](_0x39f2db['query']['sort']);_0x1c1b4f['where']=qs['filters'](_[_0x080e('0x3c')](_0x39f2db[_0x080e('0x32')],_0x439fe0[_0x080e('0x33')]));if(_0x39f2db[_0x080e('0x32')][_0x080e('0x3d')]){_0x1c1b4f[_0x080e('0x3e')]=_[_0x080e('0x3f')](_0x1c1b4f[_0x080e('0x3e')],{'$or':_[_0x080e('0x40')](_0x484328,function(_0x59cac6){if(_0x59cac6[_0x080e('0x41')][_0x080e('0x42')]!=='VIRTUAL'){var _0x81cd0={};_0x81cd0[_0x59cac6[_0x080e('0x43')]]={'$like':'%'+_0x39f2db[_0x080e('0x32')][_0x080e('0x3d')]+'%'};return _0x81cd0;}})});}_0x1c1b4f=_[_0x080e('0x3f')]({},_0x1c1b4f,_0x39f2db[_0x080e('0x44')]);var _0x5c1dcd={'where':_0x1c1b4f[_0x080e('0x3e')]};return db[_0x080e('0x45')]['count'](_0x5c1dcd)['then'](function(_0x33f186){_0x81e161['count']=_0x33f186;if(_0x39f2db[_0x080e('0x32')][_0x080e('0x46')]){_0x1c1b4f[_0x080e('0x47')]=[{'all':!![]}];}return db[_0x080e('0x45')][_0x080e('0x48')](_0x1c1b4f);})[_0x080e('0x2a')](function(_0x569fcd){_0x81e161[_0x080e('0x49')]=_0x569fcd;return _0x81e161;})[_0x080e('0x2a')](respondWithFilteredResult(_0xbbc836,_0x1c1b4f))['catch'](handleError(_0xbbc836,null));};exports[_0x080e('0x4a')]=function(_0x560eab,_0x5ad913){var _0x4b30c3={'raw':![],'where':{'id':_0x560eab[_0x080e('0x4b')]['id']}},_0x22a5f2={};_0x22a5f2[_0x080e('0x30')]=_[_0x080e('0x31')](db[_0x080e('0x45')][_0x080e('0x2f')]);_0x22a5f2['query']=_['keys'](_0x560eab[_0x080e('0x32')]);_0x22a5f2['filters']=_['intersection'](_0x22a5f2['model'],_0x22a5f2[_0x080e('0x32')]);_0x4b30c3[_0x080e('0x36')]=_[_0x080e('0x34')](_0x22a5f2[_0x080e('0x30')],qs[_0x080e('0x35')](_0x560eab['query'][_0x080e('0x35')]));_0x4b30c3[_0x080e('0x36')]=_0x4b30c3['attributes'][_0x080e('0x37')]?_0x4b30c3[_0x080e('0x36')]:_0x22a5f2[_0x080e('0x30')];if(_0x560eab[_0x080e('0x32')][_0x080e('0x46')]){_0x4b30c3[_0x080e('0x47')]=[{'all':!![]}];}_0x4b30c3=_[_0x080e('0x3f')]({},_0x4b30c3,_0x560eab[_0x080e('0x44')]);return db[_0x080e('0x45')][_0x080e('0x4c')](_0x4b30c3)[_0x080e('0x2a')](handleEntityNotFound(_0x5ad913,null))[_0x080e('0x2a')](respondWithResult(_0x5ad913,null))[_0x080e('0x4d')](handleError(_0x5ad913,null));};exports[_0x080e('0x4e')]=function(_0x2a7171,_0xb40664){return db[_0x080e('0x45')][_0x080e('0x4e')](_0x2a7171['body'],{})[_0x080e('0x2a')](respondWithResult(_0xb40664,0xc9))['catch'](handleError(_0xb40664,null));};exports[_0x080e('0x29')]=function(_0x5d008b,_0x4e75fe){if(_0x5d008b[_0x080e('0x4f')]['id']){delete _0x5d008b[_0x080e('0x4f')]['id'];}return db[_0x080e('0x45')]['find']({'where':{'id':_0x5d008b[_0x080e('0x4b')]['id']}})[_0x080e('0x2a')](handleEntityNotFound(_0x4e75fe,null))[_0x080e('0x2a')](saveUpdates(_0x5d008b[_0x080e('0x4f')],null))[_0x080e('0x2a')](respondWithResult(_0x4e75fe,null))[_0x080e('0x4d')](handleError(_0x4e75fe,null));};exports[_0x080e('0x2b')]=function(_0x29356d,_0x41cf3a){return db[_0x080e('0x45')][_0x080e('0x4c')]({'where':{'id':_0x29356d['params']['id']}})[_0x080e('0x2a')](handleEntityNotFound(_0x41cf3a,null))[_0x080e('0x2a')](removeEntity(_0x41cf3a,null))['catch'](handleError(_0x41cf3a,null));};exports['getConfigurations']=function(_0x5463e1,_0x2cb542,_0x2029fa){var _0x5ea55c={};var _0x5b744c={};var _0x2e3091;var _0x274799;return db[_0x080e('0x45')][_0x080e('0x50')]({'where':{'id':_0x5463e1[_0x080e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2cb542,null))[_0x080e('0x2a')](function(_0x135307){if(_0x135307){_0x2e3091=_0x135307;_0x5b744c[_0x080e('0x30')]=_['keys'](db[_0x080e('0x51')]['rawAttributes']);_0x5b744c['query']=_[_0x080e('0x31')](_0x5463e1[_0x080e('0x32')]);_0x5b744c[_0x080e('0x33')]=_[_0x080e('0x34')](_0x5b744c['model'],_0x5b744c[_0x080e('0x32')]);_0x5ea55c[_0x080e('0x36')]=_[_0x080e('0x34')](_0x5b744c[_0x080e('0x30')],qs[_0x080e('0x35')](_0x5463e1['query'][_0x080e('0x35')]));_0x5ea55c[_0x080e('0x36')]=_0x5ea55c[_0x080e('0x36')][_0x080e('0x37')]?_0x5ea55c[_0x080e('0x36')]:_0x5b744c['model'];_0x5ea55c[_0x080e('0x3a')]=qs['sort'](_0x5463e1[_0x080e('0x32')][_0x080e('0x3b')]);_0x5ea55c[_0x080e('0x3e')]=qs['filters'](_[_0x080e('0x3c')](_0x5463e1[_0x080e('0x32')],_0x5b744c[_0x080e('0x33')]));if(_0x5463e1[_0x080e('0x32')][_0x080e('0x3d')]){_0x5ea55c['where']=_[_0x080e('0x3f')](_0x5ea55c['where'],{'$or':_[_0x080e('0x40')](_0x5ea55c[_0x080e('0x36')],function(_0xd07ee0){var _0x48d8f8={};_0x48d8f8[_0xd07ee0]={'$like':'%'+_0x5463e1['query'][_0x080e('0x3d')]+'%'};return _0x48d8f8;})});}_0x5ea55c=_['merge']({},_0x5ea55c,_0x5463e1[_0x080e('0x44')]);return _0x2e3091[_0x080e('0x52')](_0x5ea55c);}})[_0x080e('0x2a')](function(_0x33976c){if(_0x33976c){_0x274799=_0x33976c[_0x080e('0x37')];if(!_0x5463e1['query'][_0x080e('0x38')](_0x080e('0x39'))){_0x5ea55c[_0x080e('0x24')]=qs[_0x080e('0x24')](_0x5463e1['query']['limit']);_0x5ea55c[_0x080e('0x23')]=qs['offset'](_0x5463e1[_0x080e('0x32')][_0x080e('0x23')]);}return _0x2e3091[_0x080e('0x52')](_0x5ea55c);}})[_0x080e('0x2a')](function(_0x1871a3){if(_0x1871a3){return _0x1871a3?{'count':_0x274799,'rows':_0x1871a3}:null;}})[_0x080e('0x2a')](respondWithResult(_0x2cb542,null))['catch'](handleError(_0x2cb542,null));};exports[_0x080e('0x53')]=function(_0x446a1f,_0x4c5d67,_0x460c19){if(_0x446a1f[_0x080e('0x4f')]['id']){delete _0x446a1f['body']['id'];}return db[_0x080e('0x45')]['findOne']({'where':{'id':_0x446a1f[_0x080e('0x4b')]['id']}})[_0x080e('0x2a')](handleEntityNotFound(_0x4c5d67,null))[_0x080e('0x2a')](function(_0x31d067){if(_0x31d067){_0x446a1f[_0x080e('0x4f')][_0x080e('0x54')]=_0x31d067['id'];_0x446a1f[_0x080e('0x4f')][_0x080e('0x55')]=integrations[_0x080e('0x56')](_0x446a1f[_0x080e('0x4f')][_0x080e('0x57')],_0x446a1f[_0x080e('0x4f')][_0x080e('0x41')]);_0x446a1f[_0x080e('0x4f')]['Descriptions']=integrations[_0x080e('0x58')](_0x446a1f[_0x080e('0x4f')][_0x080e('0x57')],_0x446a1f[_0x080e('0x4f')][_0x080e('0x41')]);return db[_0x080e('0x51')][_0x080e('0x4e')](_0x446a1f['body'],{'include':[{'model':db[_0x080e('0x59')],'as':_0x080e('0x55')},{'model':db[_0x080e('0x59')],'as':_0x080e('0x5a')}]});}return null;})['then'](respondWithResult(_0x4c5d67,null))[_0x080e('0x4d')](handleError(_0x4c5d67,null));};exports[_0x080e('0x5b')]=function(_0x533946,_0x4c0d84,_0x5dbe1e){var _0xf7f35c='';return db[_0x080e('0x45')][_0x080e('0x50')]({'where':{'id':_0x533946[_0x080e('0x4b')]['id']},'attributes':['id','remoteUri',_0x080e('0x5c')]})[_0x080e('0x2a')](handleEntityNotFound(_0x4c0d84,null))[_0x080e('0x2a')](function(_0x23857d){if(_0x23857d){_0xf7f35c=_0x23857d[_0x080e('0x5d')];var _0x5b73b1=_0xf7f35c[_0x080e('0x5e')](-0x1);if(_0x5b73b1==='/'){_0xf7f35c=_0xf7f35c[_0x080e('0x5f')](0x0,_0xf7f35c['lastIndexOf'](_0x5b73b1));}return rp({'method':_0x080e('0x60'),'uri':util[_0x080e('0x61')](_0x080e('0x62'),_0xf7f35c,_0x080e('0x63')),'headers':{'Authorization':util[_0x080e('0x61')](_0x080e('0x64'),new Buffer(util['format']('%s:X',_0x23857d[_0x080e('0x5c')]))['toString'](_0x080e('0x65')))},'json':!![]});}})['then'](function(_0x3d015c){if(_0x3d015c){var _0x4f9700=[_0x080e('0x66'),_0x080e('0x67'),_0x080e('0x68'),_0x080e('0x69'),_0x080e('0x20'),_0x080e('0x6a'),'group',_0x080e('0x6b'),'ticket_type','group',_0x080e('0x6c')];_[_0x080e('0x6d')](_0x3d015c,function(_0x3bfa04){return _0x4f9700[_0x080e('0x6e')](_0x3bfa04[_0x080e('0x2d')])||!_0x3bfa04[_0x080e('0x6f')]&&_0x3bfa04[_0x080e('0x41')]!==_0x080e('0x70')&&_0x3bfa04[_0x080e('0x41')]!==_0x080e('0x71');});return{'count':_0x3d015c[_0x080e('0x37')],'rows':_[_0x080e('0x40')](_0x3d015c,function(_0x379266){return{'id':_0x379266['name'],'name':_0x379266['label'],'custom':!_0x379266[_0x080e('0x6f')],'options':_0x379266[_0x080e('0x72')]?_[_0x080e('0x40')](_0x379266['choices'],function(_0x1cb5d6){return{'name':_[_0x080e('0x73')](_0x1cb5d6),'value':_0x1cb5d6};}):[]};})};}})[_0x080e('0x2a')](respondWithResult(_0x4c0d84,null))[_0x080e('0x4d')](function(_0x577164){var _0x5988c0=_0x533946[_0x080e('0x32')][_0x080e('0x74')]?0x1f4:_0x577164[_0x080e('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x080e('0x5b'),_0x5988c0,JSON['stringify'](_0x577164));delete _0x577164[_0x080e('0x2d')];if(_0x5988c0===0x191){_0x5988c0=0x190;}_0x4c0d84[_0x080e('0x20')](_0x5988c0)[_0x080e('0x2e')](_0x533946['query'][_0x080e('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x577164[_0x080e('0x75')]}:_0x577164);});}; \ No newline at end of file +var _0xd481=['request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','offset','limit','set','json','apply','save','update','stack','send','index','FreshdeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','merge','map','type','VIRTUAL','field','filter','count','includeAll','include','findAll','show','find','create','body','destroy','params','getConfigurations','findOne','FreshdeskConfiguration','length','order','pick','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','source','ticket_type','group','company','includes','name','custom_text','label','default','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x24cdf2,_0x54ade2){var _0x323890=function(_0x274c73){while(--_0x274c73){_0x24cdf2['push'](_0x24cdf2['shift']());}};_0x323890(++_0x54ade2);}(_0xd481,0x1e4));var _0x1d48=function(_0x3ffca5,_0x99c86b){_0x3ffca5=_0x3ffca5-0x0;var _0x2bd0f3=_0xd481[_0x3ffca5];return _0x2bd0f3;};'use strict';var pdf=require(_0x1d48('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1d48('0x1'));var zipdir=require(_0x1d48('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d48('0x3'));var moment=require(_0x1d48('0x4'));var BPromise=require(_0x1d48('0x5'));var Mustache=require('mustache');var util=require(_0x1d48('0x6'));var path=require('path');var sox=require(_0x1d48('0x7'));var csv=require(_0x1d48('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d48('0x9'));var squel=require(_0x1d48('0xa'));var crypto=require(_0x1d48('0xb'));var jsforce=require(_0x1d48('0xc'));var deskjs=require(_0x1d48('0xd'));var toCsv=require(_0x1d48('0x8'));var querystring=require(_0x1d48('0xe'));var Papa=require(_0x1d48('0xf'));var Redis=require(_0x1d48('0x10'));var authService=require(_0x1d48('0x11'));var qs=require(_0x1d48('0x12'));var hardwareService=require(_0x1d48('0x13'));var logger=require('../../config/logger')(_0x1d48('0x14'));var utils=require(_0x1d48('0x15'));var config=require(_0x1d48('0x16'));var db=require(_0x1d48('0x17'))['db'];var integrations=require(_0x1d48('0x18'));var jayson=require(_0x1d48('0x19'));var client=jayson[_0x1d48('0x1a')][_0x1d48('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2ac3e9,_0x2d84b1,_0x483b42){if(_0x483b42){var _0x3034d5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3034d5['test'](_0x2d84b1)){return _0x2ac3e9;}else{throw new Error(_0x1d48('0x1c'));}}else{return _0x2ac3e9;}}function respondWithRpcPromise(_0x2ccc5e,_0x2b7f7c,_0x44db99,_0x4f9f04){return new BPromise(function(_0x1845bd,_0x2e2748){var _0x27fd35=_0x4f9f04||client;return _0x27fd35['request'](_0x2ccc5e,_0x44db99)[_0x1d48('0x1d')](function(_0x433c92){logger[_0x1d48('0x1e')](_0x1d48('0x1f'),_0x2b7f7c,_0x1d48('0x20'));logger[_0x1d48('0x21')](_0x1d48('0x22'),_0x2b7f7c,_0x1d48('0x20'),JSON[_0x1d48('0x23')](_0x433c92));if(_0x433c92['error']){if(_0x433c92['error'][_0x1d48('0x24')]===0x1f4){logger[_0x1d48('0x25')](_0x1d48('0x1f'),_0x2b7f7c,_0x433c92[_0x1d48('0x25')][_0x1d48('0x26')]);return _0x2e2748(_0x433c92[_0x1d48('0x25')][_0x1d48('0x26')]);}logger[_0x1d48('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x2b7f7c,_0x433c92[_0x1d48('0x25')][_0x1d48('0x26')]);return _0x1845bd(_0x433c92['error']['message']);}else{logger[_0x1d48('0x1e')](_0x1d48('0x1f'),_0x2b7f7c,_0x1d48('0x20'));_0x1845bd(_0x433c92[_0x1d48('0x27')][_0x1d48('0x26')]);}})[_0x1d48('0x28')](function(_0xef15b5){logger[_0x1d48('0x25')](_0x1d48('0x1f'),_0x2b7f7c,_0xef15b5);_0x2e2748(_0xef15b5);});});}function respondWithStatusCode(_0x1382d8,_0x4be71e){_0x4be71e=_0x4be71e||0xcc;return function(_0x4e44eb){if(_0x4e44eb){return _0x1382d8[_0x1d48('0x29')](_0x4be71e);}return _0x1382d8[_0x1d48('0x2a')](_0x4be71e)[_0x1d48('0x2b')]();};}function respondWithResult(_0x2bf773,_0x228276){_0x228276=_0x228276||0xc8;return function(_0x7631b4){if(_0x7631b4){return _0x2bf773['status'](_0x228276)['json'](_0x7631b4);}};}function respondWithFilteredResult(_0x187b34,_0x280505){return function(_0x4d3f91){if(_0x4d3f91){var _0x33f9dd=_0x4d3f91['count'],_0x368c5f=_0x280505[_0x1d48('0x2c')],_0xb4d9c7=_0x280505[_0x1d48('0x2c')]+_0x280505[_0x1d48('0x2d')],_0xccc388;if(_0xb4d9c7>=_0x33f9dd){_0xb4d9c7=_0x33f9dd;_0xccc388=0xc8;}else{_0xccc388=0xce;}_0x187b34[_0x1d48('0x2a')](_0xccc388);return _0x187b34[_0x1d48('0x2e')]('Content-Range',_0x368c5f+'-'+_0xb4d9c7+'/'+_0x33f9dd)[_0x1d48('0x2f')](_0x4d3f91);}return null;};}function patchUpdates(_0x3dee70){return function(_0x41e050){try{jsonpatch[_0x1d48('0x30')](_0x41e050,_0x3dee70,!![]);}catch(_0x3cae45){return BPromise['reject'](_0x3cae45);}return _0x41e050[_0x1d48('0x31')]();};}function saveUpdates(_0xa3b0ed,_0x2fb984){return function(_0x4cfc41){if(_0x4cfc41){return _0x4cfc41[_0x1d48('0x32')](_0xa3b0ed)['then'](function(_0x5a2670){return _0x5a2670;});}return null;};}function removeEntity(_0x3abd42,_0x1ed3f5){return function(_0x2c4527){if(_0x2c4527){return _0x2c4527['destroy']()[_0x1d48('0x1d')](function(){_0x3abd42[_0x1d48('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2648d8,_0x2e77d5){return function(_0x189a89){if(!_0x189a89){_0x2648d8['sendStatus'](0x194);}return _0x189a89;};}function handleError(_0x3c6e09,_0x51093f){_0x51093f=_0x51093f||0x1f4;return function(_0x3e434c){logger[_0x1d48('0x25')](_0x3e434c[_0x1d48('0x33')]);if(_0x3e434c['name']){delete _0x3e434c['name'];}_0x3c6e09[_0x1d48('0x2a')](_0x51093f)[_0x1d48('0x34')](_0x3e434c);};}exports[_0x1d48('0x35')]=function(_0x438a0d,_0x292483){var _0x16493d={},_0x1df1e9={},_0x2476fe={'count':0x0,'rows':[]};var _0x216438=db[_0x1d48('0x36')][_0x1d48('0x37')];_0x1df1e9[_0x1d48('0x38')]=_[_0x1d48('0x39')](_0x216438);_0x1df1e9[_0x1d48('0x3a')]=_[_0x1d48('0x39')](_0x438a0d[_0x1d48('0x3a')]);_0x1df1e9[_0x1d48('0x3b')]=_[_0x1d48('0x3c')](_0x1df1e9[_0x1d48('0x38')],_0x1df1e9[_0x1d48('0x3a')]);_0x16493d[_0x1d48('0x3d')]=_[_0x1d48('0x3c')](_0x1df1e9[_0x1d48('0x38')],qs[_0x1d48('0x3e')](_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x3e')]));_0x16493d[_0x1d48('0x3d')]=_0x16493d[_0x1d48('0x3d')]['length']?_0x16493d[_0x1d48('0x3d')]:_0x1df1e9['model'];if(!_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x3f')]('nolimit')){_0x16493d[_0x1d48('0x2d')]=qs[_0x1d48('0x2d')](_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x2d')]);_0x16493d[_0x1d48('0x2c')]=qs[_0x1d48('0x2c')](_0x438a0d['query']['offset']);}_0x16493d['order']=qs[_0x1d48('0x40')](_0x438a0d[_0x1d48('0x3a')]['sort']);_0x16493d[_0x1d48('0x41')]=qs[_0x1d48('0x3b')](_['pick'](_0x438a0d[_0x1d48('0x3a')],_0x1df1e9[_0x1d48('0x3b')]));if(_0x438a0d[_0x1d48('0x3a')]['filter']){_0x16493d['where']=_[_0x1d48('0x42')](_0x16493d[_0x1d48('0x41')],{'$or':_[_0x1d48('0x43')](_0x216438,function(_0x56971c){if(_0x56971c[_0x1d48('0x44')]['key']!==_0x1d48('0x45')){var _0xf849e4={};_0xf849e4[_0x56971c[_0x1d48('0x46')]]={'$like':'%'+_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x47')]+'%'};return _0xf849e4;}})});}_0x16493d=_[_0x1d48('0x42')]({},_0x16493d,_0x438a0d['options']);var _0x146111={'where':_0x16493d[_0x1d48('0x41')]};return db[_0x1d48('0x36')][_0x1d48('0x48')](_0x146111)[_0x1d48('0x1d')](function(_0x37bdbe){_0x2476fe[_0x1d48('0x48')]=_0x37bdbe;if(_0x438a0d[_0x1d48('0x3a')][_0x1d48('0x49')]){_0x16493d[_0x1d48('0x4a')]=[{'all':!![]}];}return db[_0x1d48('0x36')][_0x1d48('0x4b')](_0x16493d);})['then'](function(_0x1e97c0){_0x2476fe['rows']=_0x1e97c0;return _0x2476fe;})[_0x1d48('0x1d')](respondWithFilteredResult(_0x292483,_0x16493d))[_0x1d48('0x28')](handleError(_0x292483,null));};exports[_0x1d48('0x4c')]=function(_0x484e4d,_0x53f2aa){var _0xf50046={'raw':![],'where':{'id':_0x484e4d['params']['id']}},_0x3e2420={};_0x3e2420[_0x1d48('0x38')]=_[_0x1d48('0x39')](db[_0x1d48('0x36')][_0x1d48('0x37')]);_0x3e2420[_0x1d48('0x3a')]=_[_0x1d48('0x39')](_0x484e4d['query']);_0x3e2420[_0x1d48('0x3b')]=_[_0x1d48('0x3c')](_0x3e2420[_0x1d48('0x38')],_0x3e2420['query']);_0xf50046[_0x1d48('0x3d')]=_[_0x1d48('0x3c')](_0x3e2420[_0x1d48('0x38')],qs[_0x1d48('0x3e')](_0x484e4d[_0x1d48('0x3a')][_0x1d48('0x3e')]));_0xf50046[_0x1d48('0x3d')]=_0xf50046['attributes']['length']?_0xf50046[_0x1d48('0x3d')]:_0x3e2420[_0x1d48('0x38')];if(_0x484e4d[_0x1d48('0x3a')]['includeAll']){_0xf50046['include']=[{'all':!![]}];}_0xf50046=_['merge']({},_0xf50046,_0x484e4d['options']);return db[_0x1d48('0x36')][_0x1d48('0x4d')](_0xf50046)[_0x1d48('0x1d')](handleEntityNotFound(_0x53f2aa,null))[_0x1d48('0x1d')](respondWithResult(_0x53f2aa,null))[_0x1d48('0x28')](handleError(_0x53f2aa,null));};exports[_0x1d48('0x4e')]=function(_0x1a1405,_0x2dd61e){return db[_0x1d48('0x36')][_0x1d48('0x4e')](_0x1a1405[_0x1d48('0x4f')],{})[_0x1d48('0x1d')](respondWithResult(_0x2dd61e,0xc9))[_0x1d48('0x28')](handleError(_0x2dd61e,null));};exports['update']=function(_0x51af4a,_0xea6d8c){if(_0x51af4a['body']['id']){delete _0x51af4a['body']['id'];}return db['FreshdeskAccount'][_0x1d48('0x4d')]({'where':{'id':_0x51af4a['params']['id']}})[_0x1d48('0x1d')](handleEntityNotFound(_0xea6d8c,null))[_0x1d48('0x1d')](saveUpdates(_0x51af4a[_0x1d48('0x4f')],null))[_0x1d48('0x1d')](respondWithResult(_0xea6d8c,null))[_0x1d48('0x28')](handleError(_0xea6d8c,null));};exports[_0x1d48('0x50')]=function(_0xb5da33,_0x599b20){return db[_0x1d48('0x36')][_0x1d48('0x4d')]({'where':{'id':_0xb5da33[_0x1d48('0x51')]['id']}})[_0x1d48('0x1d')](handleEntityNotFound(_0x599b20,null))[_0x1d48('0x1d')](removeEntity(_0x599b20,null))[_0x1d48('0x28')](handleError(_0x599b20,null));};exports[_0x1d48('0x52')]=function(_0x55e0f5,_0x3937a3,_0x55a4ec){var _0x9bd2d6={};var _0x5dc8a2={};var _0x3feb0c;var _0x5504ed;return db[_0x1d48('0x36')][_0x1d48('0x53')]({'where':{'id':_0x55e0f5[_0x1d48('0x51')]['id']}})[_0x1d48('0x1d')](handleEntityNotFound(_0x3937a3,null))[_0x1d48('0x1d')](function(_0x3204eb){if(_0x3204eb){_0x3feb0c=_0x3204eb;_0x5dc8a2[_0x1d48('0x38')]=_[_0x1d48('0x39')](db[_0x1d48('0x54')][_0x1d48('0x37')]);_0x5dc8a2[_0x1d48('0x3a')]=_['keys'](_0x55e0f5[_0x1d48('0x3a')]);_0x5dc8a2[_0x1d48('0x3b')]=_['intersection'](_0x5dc8a2['model'],_0x5dc8a2['query']);_0x9bd2d6[_0x1d48('0x3d')]=_[_0x1d48('0x3c')](_0x5dc8a2[_0x1d48('0x38')],qs[_0x1d48('0x3e')](_0x55e0f5['query']['fields']));_0x9bd2d6[_0x1d48('0x3d')]=_0x9bd2d6['attributes'][_0x1d48('0x55')]?_0x9bd2d6[_0x1d48('0x3d')]:_0x5dc8a2[_0x1d48('0x38')];_0x9bd2d6[_0x1d48('0x56')]=qs[_0x1d48('0x40')](_0x55e0f5[_0x1d48('0x3a')]['sort']);_0x9bd2d6[_0x1d48('0x41')]=qs[_0x1d48('0x3b')](_[_0x1d48('0x57')](_0x55e0f5[_0x1d48('0x3a')],_0x5dc8a2['filters']));if(_0x55e0f5['query']['filter']){_0x9bd2d6[_0x1d48('0x41')]=_['merge'](_0x9bd2d6[_0x1d48('0x41')],{'$or':_[_0x1d48('0x43')](_0x9bd2d6[_0x1d48('0x3d')],function(_0x308042){var _0x3447fa={};_0x3447fa[_0x308042]={'$like':'%'+_0x55e0f5['query'][_0x1d48('0x47')]+'%'};return _0x3447fa;})});}_0x9bd2d6=_[_0x1d48('0x42')]({},_0x9bd2d6,_0x55e0f5['options']);return _0x3feb0c[_0x1d48('0x52')](_0x9bd2d6);}})[_0x1d48('0x1d')](function(_0x567ed3){if(_0x567ed3){_0x5504ed=_0x567ed3[_0x1d48('0x55')];if(!_0x55e0f5[_0x1d48('0x3a')]['hasOwnProperty'](_0x1d48('0x58'))){_0x9bd2d6[_0x1d48('0x2d')]=qs[_0x1d48('0x2d')](_0x55e0f5['query']['limit']);_0x9bd2d6['offset']=qs['offset'](_0x55e0f5[_0x1d48('0x3a')][_0x1d48('0x2c')]);}return _0x3feb0c[_0x1d48('0x52')](_0x9bd2d6);}})[_0x1d48('0x1d')](function(_0x3fe0f4){if(_0x3fe0f4){return _0x3fe0f4?{'count':_0x5504ed,'rows':_0x3fe0f4}:null;}})['then'](respondWithResult(_0x3937a3,null))[_0x1d48('0x28')](handleError(_0x3937a3,null));};exports['addConfiguration']=function(_0x47e6ea,_0x3da820,_0x7c8284){if(_0x47e6ea[_0x1d48('0x4f')]['id']){delete _0x47e6ea[_0x1d48('0x4f')]['id'];}return db[_0x1d48('0x36')]['findOne']({'where':{'id':_0x47e6ea[_0x1d48('0x51')]['id']}})['then'](handleEntityNotFound(_0x3da820,null))[_0x1d48('0x1d')](function(_0x4cb827){if(_0x4cb827){_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x59')]=_0x4cb827['id'];_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x5a')]=integrations[_0x1d48('0x5b')](_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x5c')],_0x47e6ea[_0x1d48('0x4f')]['type']);_0x47e6ea[_0x1d48('0x4f')]['Descriptions']=integrations[_0x1d48('0x5d')](_0x47e6ea['body'][_0x1d48('0x5c')],_0x47e6ea[_0x1d48('0x4f')][_0x1d48('0x44')]);return db['FreshdeskConfiguration'][_0x1d48('0x4e')](_0x47e6ea[_0x1d48('0x4f')],{'include':[{'model':db[_0x1d48('0x5e')],'as':_0x1d48('0x5a')},{'model':db[_0x1d48('0x5e')],'as':_0x1d48('0x5f')}]});}return null;})[_0x1d48('0x1d')](respondWithResult(_0x3da820,null))[_0x1d48('0x28')](handleError(_0x3da820,null));};exports[_0x1d48('0x60')]=function(_0x19617e,_0x3c61f5,_0x4b9d35){var _0x2f33aa='';return db[_0x1d48('0x36')]['findOne']({'where':{'id':_0x19617e[_0x1d48('0x51')]['id']},'attributes':['id',_0x1d48('0x61'),_0x1d48('0x62')]})[_0x1d48('0x1d')](handleEntityNotFound(_0x3c61f5,null))[_0x1d48('0x1d')](function(_0x217485){if(_0x217485){_0x2f33aa=_0x217485[_0x1d48('0x61')];var _0x1d809d=_0x2f33aa[_0x1d48('0x63')](-0x1);if(_0x1d809d==='/'){_0x2f33aa=_0x2f33aa[_0x1d48('0x64')](0x0,_0x2f33aa[_0x1d48('0x65')](_0x1d809d));}return rp({'method':_0x1d48('0x66'),'uri':util[_0x1d48('0x67')](_0x1d48('0x68'),_0x2f33aa,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x1d48('0x67')](_0x1d48('0x69'),new Buffer(util[_0x1d48('0x67')](_0x1d48('0x6a'),_0x217485[_0x1d48('0x62')]))[_0x1d48('0x6b')](_0x1d48('0x6c')))},'json':!![]});}})['then'](function(_0x12fd32){if(_0x12fd32){var _0x4e81ce=[_0x1d48('0x6d'),_0x1d48('0x6e'),_0x1d48('0x6f'),_0x1d48('0x70'),_0x1d48('0x2a'),_0x1d48('0x71'),'group',_0x1d48('0x72'),_0x1d48('0x73'),_0x1d48('0x74'),_0x1d48('0x75')];_['remove'](_0x12fd32,function(_0x1dd2cc){return _0x4e81ce[_0x1d48('0x76')](_0x1dd2cc[_0x1d48('0x77')])||!_0x1dd2cc['default']&&_0x1dd2cc[_0x1d48('0x44')]!==_0x1d48('0x78')&&_0x1dd2cc[_0x1d48('0x44')]!=='custom_dropdown';});return{'count':_0x12fd32[_0x1d48('0x55')],'rows':_[_0x1d48('0x43')](_0x12fd32,function(_0x1f1f65){return{'id':_0x1f1f65['name'],'name':_0x1f1f65[_0x1d48('0x79')],'custom':!_0x1f1f65[_0x1d48('0x7a')],'options':_0x1f1f65['choices']?_['map'](_0x1f1f65[_0x1d48('0x7b')],function(_0x115fb8){return{'name':_[_0x1d48('0x7c')](_0x115fb8),'value':_0x115fb8};}):[]};})};}})[_0x1d48('0x1d')](respondWithResult(_0x3c61f5,null))[_0x1d48('0x28')](function(_0x7300b4){var _0x3eacbd=_0x19617e['query'][_0x1d48('0x7d')]?0x1f4:_0x7300b4['statusCode']||0x1f4;logger[_0x1d48('0x25')](_0x1d48('0x7e'),_0x1d48('0x60'),_0x3eacbd,JSON['stringify'](_0x7300b4));delete _0x7300b4[_0x1d48('0x77')];if(_0x3eacbd===0x191){_0x3eacbd=0x190;}_0x3c61f5[_0x1d48('0x2a')](_0x3eacbd)[_0x1d48('0x34')](_0x19617e['query'][_0x1d48('0x7d')]?{'message':_0x1d48('0x7f'),'statusCode':_0x7300b4[_0x1d48('0x80')]}:_0x7300b4);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 74615ed..0693451 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 _0xbd89=['lodash','api','moment','bluebird','request-promise','../../config/environment','../../components/integrations/configuration','exports','define'];(function(_0x1d21eb,_0x493643){var _0x471f63=function(_0x4596f0){while(--_0x4596f0){_0x1d21eb['push'](_0x1d21eb['shift']());}};_0x471f63(++_0x493643);}(_0xbd89,0x15f));var _0x9bd8=function(_0x3a8fe3,_0xde1b15){_0x3a8fe3=_0x3a8fe3-0x0;var _0x13926b=_0xbd89[_0x3a8fe3];return _0x13926b;};'use strict';var _=require(_0x9bd8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9bd8('0x1'));var moment=require(_0x9bd8('0x2'));var BPromise=require(_0x9bd8('0x3'));var rp=require(_0x9bd8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9bd8('0x5'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x9bd8('0x6'));module[_0x9bd8('0x7')]=function(_0x47b691,_0x30f382){return _0x47b691[_0x9bd8('0x8')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd34e=['../../components/integrations/configuration','define','int_freshdesk_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x598b53,_0x20fe66){var _0x1b2874=function(_0x4d2b54){while(--_0x4d2b54){_0x598b53['push'](_0x598b53['shift']());}};_0x1b2874(++_0x20fe66);}(_0xd34e,0x1a7));var _0xed34=function(_0x586839,_0x54aeab){_0x586839=_0x586839-0x0;var _0x33f90b=_0xd34e[_0x586839];return _0x33f90b;};'use strict';var _=require('lodash');var util=require(_0xed34('0x0'));var logger=require(_0xed34('0x1'))(_0xed34('0x2'));var moment=require(_0xed34('0x3'));var BPromise=require(_0xed34('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed34('0x5'));var rimraf=require(_0xed34('0x6'));var config=require(_0xed34('0x7'));var attributes=require(_0xed34('0x8'));var integrations=require(_0xed34('0x9'));module['exports']=function(_0x50a3d7,_0x2d1a06){return _0x50a3d7[_0xed34('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xed34('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 5741a06..7a6c0e9 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 _0xbe7b=['debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','FreshdeskAccount,\x20%s,\x20%s','result','catch','GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x3fcebe,_0x273da9){var _0x177cce=function(_0x229fba){while(--_0x229fba){_0x3fcebe['push'](_0x3fcebe['shift']());}};_0x177cce(++_0x273da9);}(_0xbe7b,0x1ab));var _0xbbe7=function(_0x141c01,_0x1556f0){_0x141c01=_0x141c01-0x0;var _0x49e963=_0xbe7b[_0x141c01];return _0x49e963;};'use strict';var _=require(_0xbbe7('0x0'));var util=require(_0xbbe7('0x1'));var moment=require(_0xbbe7('0x2'));var BPromise=require(_0xbbe7('0x3'));var rs=require(_0xbbe7('0x4'));var fs=require('fs');var Redis=require(_0xbbe7('0x5'));var db=require(_0xbbe7('0x6'))['db'];var utils=require(_0xbbe7('0x7'));var logger=require(_0xbbe7('0x8'))(_0xbbe7('0x9'));var config=require(_0xbbe7('0xa'));var jayson=require(_0xbbe7('0xb'));var client=jayson['client'][_0xbbe7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35fc19,_0xea5a5c,_0x14dd75){return new BPromise(function(_0x32c14c,_0x53d77a){return client[_0xbbe7('0xd')](_0x35fc19,_0x14dd75)[_0xbbe7('0xe')](function(_0xff1a94){logger[_0xbbe7('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0xea5a5c,_0xbbe7('0x10'));logger[_0xbbe7('0x11')](_0xbbe7('0x12'),_0xea5a5c,_0xbbe7('0x10'),JSON['stringify'](_0xff1a94));if(_0xff1a94[_0xbbe7('0x13')]){if(_0xff1a94[_0xbbe7('0x13')]['code']===0x1f4){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0xea5a5c,_0xff1a94[_0xbbe7('0x13')]['message']);return _0x53d77a(_0xff1a94[_0xbbe7('0x13')][_0xbbe7('0x14')]);}logger[_0xbbe7('0x13')](_0xbbe7('0x15'),_0xea5a5c,_0xff1a94[_0xbbe7('0x13')][_0xbbe7('0x14')]);return _0x32c14c(_0xff1a94['error'][_0xbbe7('0x14')]);}else{logger[_0xbbe7('0xf')](_0xbbe7('0x15'),_0xea5a5c,_0xbbe7('0x10'));_0x32c14c(_0xff1a94[_0xbbe7('0x16')][_0xbbe7('0x14')]);}})[_0xbbe7('0x17')](function(_0x115f9b){logger[_0xbbe7('0x13')](_0xbbe7('0x15'),_0xea5a5c,_0x115f9b);_0x53d77a(_0x115f9b);});});}exports[_0xbbe7('0x18')]=function(_0x464b68){var _0x4b5498=this;return new Promise(function(_0x4090df,_0x577e6c){return db[_0xbbe7('0x19')]['findAll']({'raw':_0x464b68['options']?_0x464b68[_0xbbe7('0x1a')][_0xbbe7('0x1b')]===undefined?!![]:![]:!![],'where':_0x464b68['options']?_0x464b68[_0xbbe7('0x1a')][_0xbbe7('0x1c')]||null:null,'attributes':_0x464b68[_0xbbe7('0x1a')]?_0x464b68['options'][_0xbbe7('0x1d')]||null:null,'limit':_0x464b68[_0xbbe7('0x1a')]?_0x464b68['options'][_0xbbe7('0x1e')]||null:null,'include':_0x464b68[_0xbbe7('0x1a')]?_0x464b68[_0xbbe7('0x1a')][_0xbbe7('0x1f')]?_[_0xbbe7('0x20')](_0x464b68[_0xbbe7('0x1a')][_0xbbe7('0x1f')],function(_0x3324e0){return{'model':db[_0x3324e0[_0xbbe7('0x21')]],'as':_0x3324e0['as'],'attributes':_0x3324e0[_0xbbe7('0x1d')],'include':_0x3324e0['include']?_[_0xbbe7('0x20')](_0x3324e0[_0xbbe7('0x1f')],function(_0x380910){return{'model':db[_0x380910[_0xbbe7('0x21')]],'as':_0x380910['as'],'attributes':_0x380910[_0xbbe7('0x1d')],'include':_0x380910['include']?_[_0xbbe7('0x20')](_0x380910[_0xbbe7('0x1f')],function(_0x4893e8){return{'model':db[_0x4893e8[_0xbbe7('0x21')]],'as':_0x4893e8['as'],'attributes':_0x4893e8[_0xbbe7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbbe7('0xe')](function(_0x4f377e){logger['info'](_0xbbe7('0x18'),_0x464b68);logger[_0xbbe7('0x11')](_0xbbe7('0x18'),_0x464b68,JSON[_0xbbe7('0x22')](_0x4f377e));_0x4090df(_0x4f377e);})[_0xbbe7('0x17')](function(_0x2a96b7){logger[_0xbbe7('0x13')](_0xbbe7('0x18'),_0x2a96b7[_0xbbe7('0x14')],_0x464b68);_0x577e6c(_0x4b5498['error'](0x1f4,_0x2a96b7['message']));});});};exports['ShowFreshdeskAccount']=function(_0x49f29b){var _0x54d468=this;return new Promise(function(_0x3bf829,_0x4ec003){return db[_0xbbe7('0x19')][_0xbbe7('0x23')]({'raw':_0x49f29b[_0xbbe7('0x1a')]?_0x49f29b['options']['raw']===undefined?!![]:![]:!![],'where':_0x49f29b[_0xbbe7('0x1a')]?_0x49f29b[_0xbbe7('0x1a')]['where']||null:null,'attributes':_0x49f29b[_0xbbe7('0x1a')]?_0x49f29b[_0xbbe7('0x1a')]['attributes']||null:null,'include':_0x49f29b[_0xbbe7('0x1a')]?_0x49f29b[_0xbbe7('0x1a')]['include']?_['map'](_0x49f29b[_0xbbe7('0x1a')][_0xbbe7('0x1f')],function(_0x149923){return{'model':db[_0x149923[_0xbbe7('0x21')]],'as':_0x149923['as'],'attributes':_0x149923[_0xbbe7('0x1d')],'include':_0x149923[_0xbbe7('0x1f')]?_[_0xbbe7('0x20')](_0x149923[_0xbbe7('0x1f')],function(_0x317edb){return{'model':db[_0x317edb['model']],'as':_0x317edb['as'],'attributes':_0x317edb[_0xbbe7('0x1d')],'include':_0x317edb[_0xbbe7('0x1f')]?_[_0xbbe7('0x20')](_0x317edb[_0xbbe7('0x1f')],function(_0x549a0f){return{'model':db[_0x549a0f['model']],'as':_0x549a0f['as'],'attributes':_0x549a0f[_0xbbe7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xbbe7('0xe')](function(_0x2e5aa2){logger[_0xbbe7('0xf')]('ShowFreshdeskAccount',_0x49f29b);logger[_0xbbe7('0x11')]('ShowFreshdeskAccount',_0x49f29b,JSON['stringify'](_0x2e5aa2));_0x3bf829(_0x2e5aa2);})[_0xbbe7('0x17')](function(_0x2cfdda){logger[_0xbbe7('0x13')](_0xbbe7('0x24'),_0x2cfdda['message'],_0x49f29b);_0x4ec003(_0x54d468['error'](0x1f4,_0x2cfdda['message']));});});}; \ No newline at end of file +var _0xdbc6=['findAll','options','where','attributes','limit','include','map','GetFreshdeskAccount','ShowFreshdeskAccount','find','model','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','FreshdeskAccount'];(function(_0x59efd2,_0x7b6b20){var _0x5abf6d=function(_0x518b33){while(--_0x518b33){_0x59efd2['push'](_0x59efd2['shift']());}};_0x5abf6d(++_0x7b6b20);}(_0xdbc6,0x1a3));var _0x6dbc=function(_0x2632f2,_0x1a38e5){_0x2632f2=_0x2632f2-0x0;var _0x1598ff=_0xdbc6[_0x2632f2];return _0x1598ff;};'use strict';var _=require('lodash');var util=require(_0x6dbc('0x0'));var moment=require('moment');var BPromise=require(_0x6dbc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dbc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x6dbc('0x3'))(_0x6dbc('0x4'));var config=require(_0x6dbc('0x5'));var jayson=require(_0x6dbc('0x6'));var client=jayson[_0x6dbc('0x7')][_0x6dbc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf9e279,_0x94b73d,_0x397f24){return new BPromise(function(_0x284d8d,_0x3b5bef){return client[_0x6dbc('0x9')](_0xf9e279,_0x397f24)[_0x6dbc('0xa')](function(_0x4e33ab){logger[_0x6dbc('0xb')]('FreshdeskAccount,\x20%s,\x20%s',_0x94b73d,'request\x20sent');logger[_0x6dbc('0xc')](_0x6dbc('0xd'),_0x94b73d,_0x6dbc('0xe'),JSON[_0x6dbc('0xf')](_0x4e33ab));if(_0x4e33ab[_0x6dbc('0x10')]){if(_0x4e33ab['error'][_0x6dbc('0x11')]===0x1f4){logger[_0x6dbc('0x10')](_0x6dbc('0x12'),_0x94b73d,_0x4e33ab['error'][_0x6dbc('0x13')]);return _0x3b5bef(_0x4e33ab[_0x6dbc('0x10')][_0x6dbc('0x13')]);}logger[_0x6dbc('0x10')](_0x6dbc('0x12'),_0x94b73d,_0x4e33ab[_0x6dbc('0x10')][_0x6dbc('0x13')]);return _0x284d8d(_0x4e33ab[_0x6dbc('0x10')][_0x6dbc('0x13')]);}else{logger[_0x6dbc('0xb')](_0x6dbc('0x12'),_0x94b73d,_0x6dbc('0xe'));_0x284d8d(_0x4e33ab[_0x6dbc('0x14')]['message']);}})[_0x6dbc('0x15')](function(_0x430a88){logger[_0x6dbc('0x10')](_0x6dbc('0x12'),_0x94b73d,_0x430a88);_0x3b5bef(_0x430a88);});});}exports['GetFreshdeskAccount']=function(_0x49d0c2){var _0xc7e3eb=this;return new Promise(function(_0x5bedca,_0x19f7af){return db[_0x6dbc('0x16')][_0x6dbc('0x17')]({'raw':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')][_0x6dbc('0x19')]||null:null,'attributes':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')][_0x6dbc('0x1a')]||null:null,'limit':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2[_0x6dbc('0x18')][_0x6dbc('0x1b')]||null:null,'include':_0x49d0c2[_0x6dbc('0x18')]?_0x49d0c2['options'][_0x6dbc('0x1c')]?_[_0x6dbc('0x1d')](_0x49d0c2[_0x6dbc('0x18')]['include'],function(_0x498e18){return{'model':db[_0x498e18['model']],'as':_0x498e18['as'],'attributes':_0x498e18[_0x6dbc('0x1a')],'include':_0x498e18['include']?_[_0x6dbc('0x1d')](_0x498e18[_0x6dbc('0x1c')],function(_0x501b4a){return{'model':db[_0x501b4a['model']],'as':_0x501b4a['as'],'attributes':_0x501b4a[_0x6dbc('0x1a')],'include':_0x501b4a['include']?_[_0x6dbc('0x1d')](_0x501b4a['include'],function(_0x1f642a){return{'model':db[_0x1f642a['model']],'as':_0x1f642a['as'],'attributes':_0x1f642a[_0x6dbc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x438810){logger['info'](_0x6dbc('0x1e'),_0x49d0c2);logger[_0x6dbc('0xc')](_0x6dbc('0x1e'),_0x49d0c2,JSON[_0x6dbc('0xf')](_0x438810));_0x5bedca(_0x438810);})[_0x6dbc('0x15')](function(_0x47e9b5){logger[_0x6dbc('0x10')](_0x6dbc('0x1e'),_0x47e9b5[_0x6dbc('0x13')],_0x49d0c2);_0x19f7af(_0xc7e3eb[_0x6dbc('0x10')](0x1f4,_0x47e9b5[_0x6dbc('0x13')]));});});};exports[_0x6dbc('0x1f')]=function(_0x31c051){var _0x35273d=this;return new Promise(function(_0x539d8b,_0x508c1d){return db[_0x6dbc('0x16')][_0x6dbc('0x20')]({'raw':_0x31c051[_0x6dbc('0x18')]?_0x31c051[_0x6dbc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x31c051[_0x6dbc('0x18')]?_0x31c051['options']['where']||null:null,'attributes':_0x31c051[_0x6dbc('0x18')]?_0x31c051[_0x6dbc('0x18')]['attributes']||null:null,'include':_0x31c051['options']?_0x31c051[_0x6dbc('0x18')][_0x6dbc('0x1c')]?_[_0x6dbc('0x1d')](_0x31c051['options'][_0x6dbc('0x1c')],function(_0x5300c4){return{'model':db[_0x5300c4['model']],'as':_0x5300c4['as'],'attributes':_0x5300c4[_0x6dbc('0x1a')],'include':_0x5300c4[_0x6dbc('0x1c')]?_[_0x6dbc('0x1d')](_0x5300c4['include'],function(_0x1c93d1){return{'model':db[_0x1c93d1[_0x6dbc('0x21')]],'as':_0x1c93d1['as'],'attributes':_0x1c93d1[_0x6dbc('0x1a')],'include':_0x1c93d1[_0x6dbc('0x1c')]?_['map'](_0x1c93d1[_0x6dbc('0x1c')],function(_0x2603fc){return{'model':db[_0x2603fc[_0x6dbc('0x21')]],'as':_0x2603fc['as'],'attributes':_0x2603fc[_0x6dbc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6dbc('0xa')](function(_0x1fc4e0){logger[_0x6dbc('0xb')](_0x6dbc('0x1f'),_0x31c051);logger['debug']('ShowFreshdeskAccount',_0x31c051,JSON[_0x6dbc('0xf')](_0x1fc4e0));_0x539d8b(_0x1fc4e0);})['catch'](function(_0x37942e){logger[_0x6dbc('0x10')]('ShowFreshdeskAccount',_0x37942e[_0x6dbc('0x13')],_0x31c051);_0x508c1d(_0x35273d[_0x6dbc('0x10')](0x1f4,_0x37942e[_0x6dbc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 4c60cd7..0713f15 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 _0x1cb9=['../../config/environment','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x2fa8ae,_0x4d1da5){var _0x55ce27=function(_0x5912fe){while(--_0x5912fe){_0x2fa8ae['push'](_0x2fa8ae['shift']());}};_0x55ce27(++_0x4d1da5);}(_0x1cb9,0x14e));var _0x91cb=function(_0x54a322,_0x2a8f10){_0x54a322=_0x54a322-0x0;var _0x21481b=_0x1cb9[_0x54a322];return _0x21481b;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x91cb('0x5'));var config=require(_0x91cb('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x91cb('0x7')]('/',auth[_0x91cb('0x8')](),controller[_0x91cb('0x9')]);router[_0x91cb('0x7')](_0x91cb('0xa'),auth[_0x91cb('0x8')](),controller['show']);router[_0x91cb('0x7')]('/:id/fields',auth[_0x91cb('0x8')](),controller['getFields']);router[_0x91cb('0x7')](_0x91cb('0xb'),auth[_0x91cb('0x8')](),controller[_0x91cb('0xc')]);router[_0x91cb('0x7')](_0x91cb('0xd'),auth[_0x91cb('0x8')](),controller[_0x91cb('0xe')]);router[_0x91cb('0x7')](_0x91cb('0xf'),auth['isAuthenticated'](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')]('/',auth['isAuthenticated'](),controller[_0x91cb('0x12')]);router[_0x91cb('0x11')](_0x91cb('0xf'),auth[_0x91cb('0x8')](),controller['setTags']);router['put'](_0x91cb('0xa'),auth[_0x91cb('0x8')](),controller['update']);router['delete'](_0x91cb('0xa'),auth[_0x91cb('0x8')](),controller[_0x91cb('0x13')]);module['exports']=router; \ No newline at end of file +var _0x98a8=['put','update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags'];(function(_0x31a37b,_0x826249){var _0x49ae16=function(_0x2e8d52){while(--_0x2e8d52){_0x31a37b['push'](_0x31a37b['shift']());}};_0x49ae16(++_0x826249);}(_0x98a8,0x12c));var _0x898a=function(_0x3ceb15,_0x140ee6){_0x3ceb15=_0x3ceb15-0x0;var _0x3be3cc=_0x98a8[_0x3ceb15];return _0x3be3cc;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var auth=require(_0x898a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x898a('0x7'));var controller=require(_0x898a('0x8'));router[_0x898a('0x9')]('/',auth[_0x898a('0xa')](),controller[_0x898a('0xb')]);router['get'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0xd')]);router['get'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0xf')]);router[_0x898a('0x9')](_0x898a('0x10'),auth[_0x898a('0xa')](),controller[_0x898a('0x11')]);router[_0x898a('0x9')](_0x898a('0x12'),auth['isAuthenticated'](),controller[_0x898a('0x13')]);router['get'](_0x898a('0x14'),auth['isAuthenticated'](),controller[_0x898a('0x15')]);router[_0x898a('0x16')]('/',auth[_0x898a('0xa')](),controller['create']);router['post']('/:id/tags',auth[_0x898a('0xa')](),controller[_0x898a('0x17')]);router[_0x898a('0x18')](_0x898a('0xc'),auth[_0x898a('0xa')](),controller[_0x898a('0x19')]);router['delete'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 5c149eb..0e04b72 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 _0xfca9=['sequelize'];(function(_0x2aef29,_0x28c7e2){var _0x54252d=function(_0x164ae3){while(--_0x164ae3){_0x2aef29['push'](_0x2aef29['shift']());}};_0x54252d(++_0x28c7e2);}(_0xfca9,0x12c));var _0x9fca=function(_0x1ad435,_0x2ad44b){_0x1ad435=_0x1ad435-0x0;var _0xd34fd4=_0xfca9[_0x1ad435];return _0xd34fd4;};'use strict';var Sequelize=require(_0x9fca('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf721=['exports','STRING'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xf721,0x150));var _0x1f72=function(_0x53d172,_0x46611b){_0x53d172=_0x53d172-0x0;var _0x1bd0a2=_0xf721[_0x53d172];return _0x1bd0a2;};'use strict';var Sequelize=require('sequelize');module[_0x1f72('0x0')]={'name':{'type':Sequelize[_0x1f72('0x1')]},'description':{'type':Sequelize[_0x1f72('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 39a71e3..b6e5c4b 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 _0x4500=['limit','set','apply','update','end','stack','name','send','index','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','FreshdeskConfiguration','findAll','show','params','rawAttributes','length','find','create','body','destroy','getFields','findOne','order','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','count','offset'];(function(_0x3ddf73,_0x17fb51){var _0x5930e5=function(_0x41d4f9){while(--_0x41d4f9){_0x3ddf73['push'](_0x3ddf73['shift']());}};_0x5930e5(++_0x17fb51);}(_0x4500,0x13d));var _0x0450=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x4500[_0x5575cd];return _0x4979a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0450('0x0'));var rimraf=require(_0x0450('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0450('0x2'));var rp=require(_0x0450('0x3'));var moment=require(_0x0450('0x4'));var BPromise=require(_0x0450('0x5'));var Mustache=require(_0x0450('0x6'));var util=require('util');var path=require('path');var sox=require(_0x0450('0x7'));var csv=require('to-csv');var ejs=require(_0x0450('0x8'));var fs=require('fs');var _=require(_0x0450('0x9'));var squel=require('squel');var crypto=require(_0x0450('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0450('0xb'));var Papa=require(_0x0450('0xc'));var Redis=require('ioredis');var authService=require(_0x0450('0xd'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0450('0xe'));var logger=require(_0x0450('0xf'))(_0x0450('0x10'));var utils=require(_0x0450('0x11'));var config=require(_0x0450('0x12'));var db=require(_0x0450('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x0450('0x14')][_0x0450('0x15')]({'port':0x232a});function checkPasswordPattern(_0x3ae335,_0x230683,_0x11009b){if(_0x11009b){var _0x26758e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26758e[_0x0450('0x16')](_0x230683)){return _0x3ae335;}else{throw new Error(_0x0450('0x17'));}}else{return _0x3ae335;}}function respondWithRpcPromise(_0x208f07,_0x2fed79,_0x59ebce,_0xcfed95){return new BPromise(function(_0x355df2,_0xe1699d){var _0xa4c4b3=_0xcfed95||client;return _0xa4c4b3['request'](_0x208f07,_0x59ebce)[_0x0450('0x18')](function(_0x82e0a3){logger[_0x0450('0x19')](_0x0450('0x1a'),_0x2fed79,_0x0450('0x1b'));logger[_0x0450('0x1c')](_0x0450('0x1d'),_0x2fed79,_0x0450('0x1b'),JSON[_0x0450('0x1e')](_0x82e0a3));if(_0x82e0a3[_0x0450('0x1f')]){if(_0x82e0a3[_0x0450('0x1f')]['code']===0x1f4){logger[_0x0450('0x1f')](_0x0450('0x1a'),_0x2fed79,_0x82e0a3[_0x0450('0x1f')]['message']);return _0xe1699d(_0x82e0a3[_0x0450('0x1f')][_0x0450('0x20')]);}logger[_0x0450('0x1f')](_0x0450('0x1a'),_0x2fed79,_0x82e0a3['error']['message']);return _0x355df2(_0x82e0a3[_0x0450('0x1f')][_0x0450('0x20')]);}else{logger[_0x0450('0x19')](_0x0450('0x1a'),_0x2fed79,_0x0450('0x1b'));_0x355df2(_0x82e0a3['result'][_0x0450('0x20')]);}})[_0x0450('0x21')](function(_0x443667){logger[_0x0450('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x2fed79,_0x443667);_0xe1699d(_0x443667);});});}function respondWithStatusCode(_0x1e2666,_0x43c51c){_0x43c51c=_0x43c51c||0xcc;return function(_0x4cc1c0){if(_0x4cc1c0){return _0x1e2666[_0x0450('0x22')](_0x43c51c);}return _0x1e2666[_0x0450('0x23')](_0x43c51c)['end']();};}function respondWithResult(_0x163831,_0x35fb89){_0x35fb89=_0x35fb89||0xc8;return function(_0x1f160c){if(_0x1f160c){return _0x163831[_0x0450('0x23')](_0x35fb89)[_0x0450('0x24')](_0x1f160c);}};}function respondWithFilteredResult(_0x4b9b42,_0xe3a6bd){return function(_0x1cc447){if(_0x1cc447){var _0x5e3209=_0x1cc447[_0x0450('0x25')],_0x3f3a02=_0xe3a6bd[_0x0450('0x26')],_0xb20bd=_0xe3a6bd[_0x0450('0x26')]+_0xe3a6bd[_0x0450('0x27')],_0x23741b;if(_0xb20bd>=_0x5e3209){_0xb20bd=_0x5e3209;_0x23741b=0xc8;}else{_0x23741b=0xce;}_0x4b9b42['status'](_0x23741b);return _0x4b9b42[_0x0450('0x28')]('Content-Range',_0x3f3a02+'-'+_0xb20bd+'/'+_0x5e3209)[_0x0450('0x24')](_0x1cc447);}return null;};}function patchUpdates(_0x1cde52){return function(_0x52ac42){try{jsonpatch[_0x0450('0x29')](_0x52ac42,_0x1cde52,!![]);}catch(_0x446a0b){return BPromise['reject'](_0x446a0b);}return _0x52ac42['save']();};}function saveUpdates(_0xa7682b,_0x4fe6ef){return function(_0x1ff8b1){if(_0x1ff8b1){return _0x1ff8b1[_0x0450('0x2a')](_0xa7682b)[_0x0450('0x18')](function(_0x58864c){return _0x58864c;});}return null;};}function removeEntity(_0x297075,_0x49ba17){return function(_0x98bba7){if(_0x98bba7){return _0x98bba7['destroy']()['then'](function(){_0x297075['status'](0xcc)[_0x0450('0x2b')]();});}};}function handleEntityNotFound(_0x4bda46,_0x2dd40f){return function(_0x40bb23){if(!_0x40bb23){_0x4bda46['sendStatus'](0x194);}return _0x40bb23;};}function handleError(_0x3cef46,_0x24ff0a){_0x24ff0a=_0x24ff0a||0x1f4;return function(_0xa4ab31){logger[_0x0450('0x1f')](_0xa4ab31[_0x0450('0x2c')]);if(_0xa4ab31['name']){delete _0xa4ab31[_0x0450('0x2d')];}_0x3cef46[_0x0450('0x23')](_0x24ff0a)[_0x0450('0x2e')](_0xa4ab31);};}exports[_0x0450('0x2f')]=function(_0x4c19cc,_0x1b334c){var _0x3bf5f8={},_0x252216={},_0x52baf0={'count':0x0,'rows':[]};var _0x2bd800=db['FreshdeskConfiguration']['rawAttributes'];_0x252216[_0x0450('0x30')]=_[_0x0450('0x31')](_0x2bd800);_0x252216[_0x0450('0x32')]=_[_0x0450('0x31')](_0x4c19cc[_0x0450('0x32')]);_0x252216[_0x0450('0x33')]=_[_0x0450('0x34')](_0x252216[_0x0450('0x30')],_0x252216[_0x0450('0x32')]);_0x3bf5f8[_0x0450('0x35')]=_[_0x0450('0x34')](_0x252216['model'],qs[_0x0450('0x36')](_0x4c19cc[_0x0450('0x32')][_0x0450('0x36')]));_0x3bf5f8[_0x0450('0x35')]=_0x3bf5f8[_0x0450('0x35')]['length']?_0x3bf5f8[_0x0450('0x35')]:_0x252216[_0x0450('0x30')];if(!_0x4c19cc['query'][_0x0450('0x37')](_0x0450('0x38'))){_0x3bf5f8[_0x0450('0x27')]=qs[_0x0450('0x27')](_0x4c19cc['query'][_0x0450('0x27')]);_0x3bf5f8['offset']=qs[_0x0450('0x26')](_0x4c19cc[_0x0450('0x32')]['offset']);}_0x3bf5f8['order']=qs[_0x0450('0x39')](_0x4c19cc[_0x0450('0x32')][_0x0450('0x39')]);_0x3bf5f8[_0x0450('0x3a')]=qs[_0x0450('0x33')](_[_0x0450('0x3b')](_0x4c19cc['query'],_0x252216[_0x0450('0x33')]));if(_0x4c19cc[_0x0450('0x32')][_0x0450('0x3c')]){_0x3bf5f8[_0x0450('0x3a')]=_['merge'](_0x3bf5f8[_0x0450('0x3a')],{'$or':_[_0x0450('0x3d')](_0x2bd800,function(_0x3d1f56){if(_0x3d1f56[_0x0450('0x3e')][_0x0450('0x3f')]!==_0x0450('0x40')){var _0x2fd79f={};_0x2fd79f[_0x3d1f56[_0x0450('0x41')]]={'$like':'%'+_0x4c19cc[_0x0450('0x32')][_0x0450('0x3c')]+'%'};return _0x2fd79f;}})});}_0x3bf5f8=_[_0x0450('0x42')]({},_0x3bf5f8,_0x4c19cc[_0x0450('0x43')]);var _0x3e5a76={'where':_0x3bf5f8[_0x0450('0x3a')]};return db['FreshdeskConfiguration'][_0x0450('0x25')](_0x3e5a76)['then'](function(_0xd06331){_0x52baf0[_0x0450('0x25')]=_0xd06331;if(_0x4c19cc['query'][_0x0450('0x44')]){_0x3bf5f8[_0x0450('0x45')]=[{'all':!![]}];}return db[_0x0450('0x46')][_0x0450('0x47')](_0x3bf5f8);})[_0x0450('0x18')](function(_0x201a78){_0x52baf0['rows']=_0x201a78;return _0x52baf0;})['then'](respondWithFilteredResult(_0x1b334c,_0x3bf5f8))[_0x0450('0x21')](handleError(_0x1b334c,null));};exports[_0x0450('0x48')]=function(_0x5bdbf6,_0x279d37){var _0x58fd6b={'raw':![],'where':{'id':_0x5bdbf6[_0x0450('0x49')]['id']}},_0x2cc176={};_0x2cc176[_0x0450('0x30')]=_[_0x0450('0x31')](db[_0x0450('0x46')][_0x0450('0x4a')]);_0x2cc176[_0x0450('0x32')]=_[_0x0450('0x31')](_0x5bdbf6[_0x0450('0x32')]);_0x2cc176[_0x0450('0x33')]=_[_0x0450('0x34')](_0x2cc176['model'],_0x2cc176[_0x0450('0x32')]);_0x58fd6b['attributes']=_[_0x0450('0x34')](_0x2cc176[_0x0450('0x30')],qs[_0x0450('0x36')](_0x5bdbf6[_0x0450('0x32')][_0x0450('0x36')]));_0x58fd6b[_0x0450('0x35')]=_0x58fd6b[_0x0450('0x35')][_0x0450('0x4b')]?_0x58fd6b[_0x0450('0x35')]:_0x2cc176[_0x0450('0x30')];if(_0x5bdbf6[_0x0450('0x32')][_0x0450('0x44')]){_0x58fd6b[_0x0450('0x45')]=[{'all':!![]}];}_0x58fd6b=_[_0x0450('0x42')]({},_0x58fd6b,_0x5bdbf6[_0x0450('0x43')]);return db[_0x0450('0x46')][_0x0450('0x4c')](_0x58fd6b)[_0x0450('0x18')](handleEntityNotFound(_0x279d37,null))[_0x0450('0x18')](respondWithResult(_0x279d37,null))['catch'](handleError(_0x279d37,null));};exports['create']=function(_0x556baa,_0x3d4fd6){return db[_0x0450('0x46')][_0x0450('0x4d')](_0x556baa[_0x0450('0x4e')],{})['then'](respondWithResult(_0x3d4fd6,0xc9))[_0x0450('0x21')](handleError(_0x3d4fd6,null));};exports[_0x0450('0x2a')]=function(_0x291a09,_0x298148){if(_0x291a09[_0x0450('0x4e')]['id']){delete _0x291a09[_0x0450('0x4e')]['id'];}return db[_0x0450('0x46')][_0x0450('0x4c')]({'where':{'id':_0x291a09[_0x0450('0x49')]['id']}})[_0x0450('0x18')](handleEntityNotFound(_0x298148,null))[_0x0450('0x18')](saveUpdates(_0x291a09['body'],null))[_0x0450('0x18')](respondWithResult(_0x298148,null))[_0x0450('0x21')](handleError(_0x298148,null));};exports[_0x0450('0x4f')]=function(_0x36fb38,_0x3807b6){return db[_0x0450('0x46')]['find']({'where':{'id':_0x36fb38[_0x0450('0x49')]['id']}})['then'](handleEntityNotFound(_0x3807b6,null))[_0x0450('0x18')](removeEntity(_0x3807b6,null))['catch'](handleError(_0x3807b6,null));};exports[_0x0450('0x50')]=function(_0x5b6914,_0x2ec047,_0x23a45a){var _0x3f744d={};var _0x24ac6d={};var _0x2a9287;var _0x558d00;return db[_0x0450('0x46')][_0x0450('0x51')]({'where':{'id':_0x5b6914[_0x0450('0x49')]['id']}})[_0x0450('0x18')](handleEntityNotFound(_0x2ec047,null))[_0x0450('0x18')](function(_0x594e7){if(_0x594e7){_0x2a9287=_0x594e7;_0x24ac6d['model']=_[_0x0450('0x31')](db['FreshdeskField']['rawAttributes']);_0x24ac6d[_0x0450('0x32')]=_[_0x0450('0x31')](_0x5b6914[_0x0450('0x32')]);_0x24ac6d[_0x0450('0x33')]=_[_0x0450('0x34')](_0x24ac6d[_0x0450('0x30')],_0x24ac6d[_0x0450('0x32')]);_0x3f744d[_0x0450('0x35')]=_[_0x0450('0x34')](_0x24ac6d[_0x0450('0x30')],qs[_0x0450('0x36')](_0x5b6914['query'][_0x0450('0x36')]));_0x3f744d[_0x0450('0x35')]=_0x3f744d[_0x0450('0x35')]['length']?_0x3f744d[_0x0450('0x35')]:_0x24ac6d[_0x0450('0x30')];_0x3f744d[_0x0450('0x52')]=qs[_0x0450('0x39')](_0x5b6914[_0x0450('0x32')]['sort']);_0x3f744d[_0x0450('0x3a')]=qs[_0x0450('0x33')](_[_0x0450('0x3b')](_0x5b6914[_0x0450('0x32')],_0x24ac6d[_0x0450('0x33')]));if(_0x5b6914[_0x0450('0x32')][_0x0450('0x3c')]){_0x3f744d[_0x0450('0x3a')]=_[_0x0450('0x42')](_0x3f744d[_0x0450('0x3a')],{'$or':_[_0x0450('0x3d')](_0x3f744d[_0x0450('0x35')],function(_0x89940c){var _0x10c673={};_0x10c673[_0x89940c]={'$like':'%'+_0x5b6914[_0x0450('0x32')][_0x0450('0x3c')]+'%'};return _0x10c673;})});}_0x3f744d=_['merge']({},_0x3f744d,_0x5b6914[_0x0450('0x43')]);return _0x2a9287['getFields'](_0x3f744d);}})[_0x0450('0x18')](function(_0xaee2a3){if(_0xaee2a3){_0x558d00=_0xaee2a3[_0x0450('0x4b')];if(!_0x5b6914[_0x0450('0x32')]['hasOwnProperty'](_0x0450('0x38'))){_0x3f744d[_0x0450('0x27')]=qs[_0x0450('0x27')](_0x5b6914[_0x0450('0x32')][_0x0450('0x27')]);_0x3f744d[_0x0450('0x26')]=qs[_0x0450('0x26')](_0x5b6914[_0x0450('0x32')][_0x0450('0x26')]);}return _0x2a9287[_0x0450('0x50')](_0x3f744d);}})['then'](function(_0x5946ea){if(_0x5946ea){return _0x5946ea?{'count':_0x558d00,'rows':_0x5946ea}:null;}})['then'](respondWithResult(_0x2ec047,null))[_0x0450('0x21')](handleError(_0x2ec047,null));};exports['getSubjects']=function(_0x2f5ae4,_0x4ff4f4,_0x227634){var _0x3ac4ab={};var _0x3b42ab={};var _0x9babe8;var _0x4d007b;return db[_0x0450('0x46')][_0x0450('0x51')]({'where':{'id':_0x2f5ae4[_0x0450('0x49')]['id']}})[_0x0450('0x18')](handleEntityNotFound(_0x4ff4f4,null))['then'](function(_0xe15a0f){if(_0xe15a0f){_0x9babe8=_0xe15a0f;_0x3b42ab[_0x0450('0x30')]=_['keys'](db[_0x0450('0x53')]['rawAttributes']);_0x3b42ab[_0x0450('0x32')]=_['keys'](_0x2f5ae4[_0x0450('0x32')]);_0x3b42ab[_0x0450('0x33')]=_[_0x0450('0x34')](_0x3b42ab['model'],_0x3b42ab[_0x0450('0x32')]);_0x3ac4ab[_0x0450('0x35')]=_['intersection'](_0x3b42ab[_0x0450('0x30')],qs[_0x0450('0x36')](_0x2f5ae4[_0x0450('0x32')][_0x0450('0x36')]));_0x3ac4ab[_0x0450('0x35')]=_0x3ac4ab['attributes'][_0x0450('0x4b')]?_0x3ac4ab['attributes']:_0x3b42ab['model'];_0x3ac4ab[_0x0450('0x52')]=qs[_0x0450('0x39')](_0x2f5ae4[_0x0450('0x32')][_0x0450('0x39')]);_0x3ac4ab['where']=qs[_0x0450('0x33')](_['pick'](_0x2f5ae4['query'],_0x3b42ab['filters']));if(_0x2f5ae4[_0x0450('0x32')][_0x0450('0x3c')]){_0x3ac4ab[_0x0450('0x3a')]=_[_0x0450('0x42')](_0x3ac4ab[_0x0450('0x3a')],{'$or':_[_0x0450('0x3d')](_0x3ac4ab['attributes'],function(_0x1fb51b){var _0x38c7f1={};_0x38c7f1[_0x1fb51b]={'$like':'%'+_0x2f5ae4['query']['filter']+'%'};return _0x38c7f1;})});}_0x3ac4ab=_[_0x0450('0x42')]({},_0x3ac4ab,_0x2f5ae4[_0x0450('0x43')]);return _0x9babe8[_0x0450('0x54')](_0x3ac4ab);}})['then'](function(_0x28eaa3){if(_0x28eaa3){_0x4d007b=_0x28eaa3[_0x0450('0x4b')];if(!_0x2f5ae4[_0x0450('0x32')]['hasOwnProperty'](_0x0450('0x38'))){_0x3ac4ab[_0x0450('0x27')]=qs[_0x0450('0x27')](_0x2f5ae4[_0x0450('0x32')][_0x0450('0x27')]);_0x3ac4ab['offset']=qs[_0x0450('0x26')](_0x2f5ae4[_0x0450('0x32')][_0x0450('0x26')]);}return _0x9babe8[_0x0450('0x54')](_0x3ac4ab);}})['then'](function(_0x47731f){if(_0x47731f){return _0x47731f?{'count':_0x4d007b,'rows':_0x47731f}:null;}})[_0x0450('0x18')](respondWithResult(_0x4ff4f4,null))[_0x0450('0x21')](handleError(_0x4ff4f4,null));};exports[_0x0450('0x55')]=function(_0x2f217f,_0x7d0cbb,_0x57b3d5){var _0x243d7f={};var _0x5ca36f={};var _0x3cdc59;var _0x3960ef;return db[_0x0450('0x46')][_0x0450('0x51')]({'where':{'id':_0x2f217f[_0x0450('0x49')]['id']}})['then'](handleEntityNotFound(_0x7d0cbb,null))[_0x0450('0x18')](function(_0xc8c0c2){if(_0xc8c0c2){_0x3cdc59=_0xc8c0c2;_0x5ca36f[_0x0450('0x30')]=_['keys'](db[_0x0450('0x53')]['rawAttributes']);_0x5ca36f[_0x0450('0x32')]=_[_0x0450('0x31')](_0x2f217f['query']);_0x5ca36f[_0x0450('0x33')]=_['intersection'](_0x5ca36f[_0x0450('0x30')],_0x5ca36f[_0x0450('0x32')]);_0x243d7f[_0x0450('0x35')]=_[_0x0450('0x34')](_0x5ca36f[_0x0450('0x30')],qs['fields'](_0x2f217f['query'][_0x0450('0x36')]));_0x243d7f[_0x0450('0x35')]=_0x243d7f[_0x0450('0x35')][_0x0450('0x4b')]?_0x243d7f[_0x0450('0x35')]:_0x5ca36f[_0x0450('0x30')];_0x243d7f[_0x0450('0x52')]=qs[_0x0450('0x39')](_0x2f217f[_0x0450('0x32')]['sort']);_0x243d7f[_0x0450('0x3a')]=qs['filters'](_[_0x0450('0x3b')](_0x2f217f[_0x0450('0x32')],_0x5ca36f['filters']));if(_0x2f217f[_0x0450('0x32')][_0x0450('0x3c')]){_0x243d7f[_0x0450('0x3a')]=_[_0x0450('0x42')](_0x243d7f[_0x0450('0x3a')],{'$or':_[_0x0450('0x3d')](_0x243d7f[_0x0450('0x35')],function(_0x112ca7){var _0x457422={};_0x457422[_0x112ca7]={'$like':'%'+_0x2f217f[_0x0450('0x32')][_0x0450('0x3c')]+'%'};return _0x457422;})});}_0x243d7f=_[_0x0450('0x42')]({},_0x243d7f,_0x2f217f[_0x0450('0x43')]);return _0x3cdc59[_0x0450('0x55')](_0x243d7f);}})[_0x0450('0x18')](function(_0x3e5a21){if(_0x3e5a21){_0x3960ef=_0x3e5a21[_0x0450('0x4b')];if(!_0x2f217f[_0x0450('0x32')]['hasOwnProperty'](_0x0450('0x38'))){_0x243d7f[_0x0450('0x27')]=qs[_0x0450('0x27')](_0x2f217f[_0x0450('0x32')][_0x0450('0x27')]);_0x243d7f[_0x0450('0x26')]=qs[_0x0450('0x26')](_0x2f217f[_0x0450('0x32')]['offset']);}return _0x3cdc59[_0x0450('0x55')](_0x243d7f);}})[_0x0450('0x18')](function(_0x580add){if(_0x580add){return _0x580add?{'count':_0x3960ef,'rows':_0x580add}:null;}})[_0x0450('0x18')](respondWithResult(_0x7d0cbb,null))['catch'](handleError(_0x7d0cbb,null));};exports[_0x0450('0x56')]=function(_0x436fad,_0x78a853,_0x2882c7){var _0x209860={};var _0x3b664a={};var _0x3aafbc;var _0x1f3b63;return db[_0x0450('0x46')][_0x0450('0x51')]({'where':{'id':_0x436fad[_0x0450('0x49')]['id']}})['then'](handleEntityNotFound(_0x78a853,null))[_0x0450('0x18')](function(_0x47f2fe){if(_0x47f2fe){_0x3aafbc=_0x47f2fe;_0x3b664a[_0x0450('0x30')]=_[_0x0450('0x31')](db[_0x0450('0x57')][_0x0450('0x4a')]);_0x3b664a[_0x0450('0x32')]=_[_0x0450('0x31')](_0x436fad['query']);_0x3b664a[_0x0450('0x33')]=_[_0x0450('0x34')](_0x3b664a[_0x0450('0x30')],_0x3b664a['query']);_0x209860[_0x0450('0x35')]=_[_0x0450('0x34')](_0x3b664a[_0x0450('0x30')],qs[_0x0450('0x36')](_0x436fad['query'][_0x0450('0x36')]));_0x209860[_0x0450('0x35')]=_0x209860['attributes'][_0x0450('0x4b')]?_0x209860[_0x0450('0x35')]:_0x3b664a[_0x0450('0x30')];_0x209860[_0x0450('0x52')]=qs[_0x0450('0x39')](_0x436fad[_0x0450('0x32')][_0x0450('0x39')]);_0x209860[_0x0450('0x3a')]=qs['filters'](_[_0x0450('0x3b')](_0x436fad['query'],_0x3b664a[_0x0450('0x33')]));if(_0x436fad[_0x0450('0x32')][_0x0450('0x3c')]){_0x209860[_0x0450('0x3a')]=_[_0x0450('0x42')](_0x209860[_0x0450('0x3a')],{'$or':_[_0x0450('0x3d')](_0x209860[_0x0450('0x35')],function(_0x31c677){var _0x123ba9={};_0x123ba9[_0x31c677]={'$like':'%'+_0x436fad['query'][_0x0450('0x3c')]+'%'};return _0x123ba9;})});}_0x209860=_[_0x0450('0x42')]({},_0x209860,_0x436fad[_0x0450('0x43')]);return _0x3aafbc[_0x0450('0x56')](_0x209860);}})[_0x0450('0x18')](function(_0x412956){if(_0x412956){_0x1f3b63=_0x412956[_0x0450('0x4b')];if(!_0x436fad[_0x0450('0x32')][_0x0450('0x37')](_0x0450('0x38'))){_0x209860['limit']=qs[_0x0450('0x27')](_0x436fad[_0x0450('0x32')]['limit']);_0x209860[_0x0450('0x26')]=qs[_0x0450('0x26')](_0x436fad['query'][_0x0450('0x26')]);}return _0x3aafbc['getTags'](_0x209860);}})[_0x0450('0x18')](function(_0x4ed9dc){if(_0x4ed9dc){return _0x4ed9dc?{'count':_0x1f3b63,'rows':_0x4ed9dc}:null;}})[_0x0450('0x18')](respondWithResult(_0x78a853,null))[_0x0450('0x21')](handleError(_0x78a853,null));};exports[_0x0450('0x58')]=function(_0x4fd417,_0x460905,_0x301d39){if(_0x4fd417[_0x0450('0x4e')]['id']){delete _0x4fd417[_0x0450('0x4e')]['id'];}return db[_0x0450('0x46')][_0x0450('0x51')]({'where':{'id':_0x4fd417[_0x0450('0x49')]['id']}})[_0x0450('0x18')](handleEntityNotFound(_0x460905,null))[_0x0450('0x18')](function(_0xd94f3a){if(_0xd94f3a){return _0xd94f3a[_0x0450('0x58')](_0x4fd417[_0x0450('0x4e')]['ids']||[]);}return null;})['then'](respondWithResult(_0x460905,null))['catch'](handleError(_0x460905,null));}; \ No newline at end of file +var _0x7d05=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','apply','save','update','then','destroy','stack','name','FreshdeskConfiguration','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','type','key','VIRTUAL','field','merge','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','options','find','create','body','getFields','findOne','FreshdeskField','order','pick','getSubjects','map','getDescriptions','Tag','getTags','setTags','ids','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x44f3a8,_0x3f1f14){var _0x94d332=function(_0xa52ec3){while(--_0xa52ec3){_0x44f3a8['push'](_0x44f3a8['shift']());}};_0x94d332(++_0x3f1f14);}(_0x7d05,0x113));var _0x57d0=function(_0x4e4255,_0x41edd0){_0x4e4255=_0x4e4255-0x0;var _0x106fd4=_0x7d05[_0x4e4255];return _0x106fd4;};'use strict';var pdf=require(_0x57d0('0x0'));var emlformat=require(_0x57d0('0x1'));var rimraf=require(_0x57d0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57d0('0x3'));var rp=require(_0x57d0('0x4'));var moment=require(_0x57d0('0x5'));var BPromise=require(_0x57d0('0x6'));var Mustache=require(_0x57d0('0x7'));var util=require(_0x57d0('0x8'));var path=require(_0x57d0('0x9'));var sox=require('sox');var csv=require(_0x57d0('0xa'));var ejs=require(_0x57d0('0xb'));var fs=require('fs');var _=require(_0x57d0('0xc'));var squel=require(_0x57d0('0xd'));var crypto=require(_0x57d0('0xe'));var jsforce=require(_0x57d0('0xf'));var deskjs=require(_0x57d0('0x10'));var toCsv=require(_0x57d0('0xa'));var querystring=require(_0x57d0('0x11'));var Papa=require(_0x57d0('0x12'));var Redis=require(_0x57d0('0x13'));var authService=require(_0x57d0('0x14'));var qs=require(_0x57d0('0x15'));var hardwareService=require(_0x57d0('0x16'));var logger=require(_0x57d0('0x17'))('api');var utils=require(_0x57d0('0x18'));var config=require('../../config/environment');var db=require(_0x57d0('0x19'))['db'];var jayson=require(_0x57d0('0x1a'));var client=jayson[_0x57d0('0x1b')][_0x57d0('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x62c017,_0x3672da,_0x406b87){if(_0x406b87){var _0x266206=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x266206[_0x57d0('0x1d')](_0x3672da)){return _0x62c017;}else{throw new Error(_0x57d0('0x1e'));}}else{return _0x62c017;}}function respondWithRpcPromise(_0x3bd5a4,_0x3bc944,_0x58cbad,_0x409958){return new BPromise(function(_0x39d236,_0x192710){var _0x2bfba7=_0x409958||client;return _0x2bfba7[_0x57d0('0x1f')](_0x3bd5a4,_0x58cbad)['then'](function(_0xb61f74){logger[_0x57d0('0x20')](_0x57d0('0x21'),_0x3bc944,_0x57d0('0x22'));logger[_0x57d0('0x23')](_0x57d0('0x24'),_0x3bc944,_0x57d0('0x22'),JSON[_0x57d0('0x25')](_0xb61f74));if(_0xb61f74[_0x57d0('0x26')]){if(_0xb61f74[_0x57d0('0x26')][_0x57d0('0x27')]===0x1f4){logger[_0x57d0('0x26')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bc944,_0xb61f74[_0x57d0('0x26')][_0x57d0('0x28')]);return _0x192710(_0xb61f74[_0x57d0('0x26')]['message']);}logger[_0x57d0('0x26')](_0x57d0('0x21'),_0x3bc944,_0xb61f74[_0x57d0('0x26')][_0x57d0('0x28')]);return _0x39d236(_0xb61f74[_0x57d0('0x26')][_0x57d0('0x28')]);}else{logger[_0x57d0('0x20')](_0x57d0('0x21'),_0x3bc944,_0x57d0('0x22'));_0x39d236(_0xb61f74['result']['message']);}})[_0x57d0('0x29')](function(_0x547700){logger[_0x57d0('0x26')](_0x57d0('0x21'),_0x3bc944,_0x547700);_0x192710(_0x547700);});});}function respondWithStatusCode(_0x116062,_0x5bb244){_0x5bb244=_0x5bb244||0xcc;return function(_0x2dd103){if(_0x2dd103){return _0x116062[_0x57d0('0x2a')](_0x5bb244);}return _0x116062[_0x57d0('0x2b')](_0x5bb244)[_0x57d0('0x2c')]();};}function respondWithResult(_0xa042a1,_0x4a2dfa){_0x4a2dfa=_0x4a2dfa||0xc8;return function(_0x235b6b){if(_0x235b6b){return _0xa042a1['status'](_0x4a2dfa)['json'](_0x235b6b);}};}function respondWithFilteredResult(_0x16ba8e,_0x198511){return function(_0x511732){if(_0x511732){var _0x568af4=_0x511732[_0x57d0('0x2d')],_0x1248ee=_0x198511[_0x57d0('0x2e')],_0xaf791=_0x198511[_0x57d0('0x2e')]+_0x198511[_0x57d0('0x2f')],_0x48e79;if(_0xaf791>=_0x568af4){_0xaf791=_0x568af4;_0x48e79=0xc8;}else{_0x48e79=0xce;}_0x16ba8e[_0x57d0('0x2b')](_0x48e79);return _0x16ba8e[_0x57d0('0x30')]('Content-Range',_0x1248ee+'-'+_0xaf791+'/'+_0x568af4)['json'](_0x511732);}return null;};}function patchUpdates(_0x4bff29){return function(_0x4777ca){try{jsonpatch[_0x57d0('0x31')](_0x4777ca,_0x4bff29,!![]);}catch(_0x5d2bd8){return BPromise['reject'](_0x5d2bd8);}return _0x4777ca[_0x57d0('0x32')]();};}function saveUpdates(_0x49e00c,_0x2150e9){return function(_0x19f9fb){if(_0x19f9fb){return _0x19f9fb[_0x57d0('0x33')](_0x49e00c)[_0x57d0('0x34')](function(_0x473877){return _0x473877;});}return null;};}function removeEntity(_0x59f888,_0x55c7fc){return function(_0x270775){if(_0x270775){return _0x270775[_0x57d0('0x35')]()[_0x57d0('0x34')](function(){_0x59f888[_0x57d0('0x2b')](0xcc)[_0x57d0('0x2c')]();});}};}function handleEntityNotFound(_0x4460e7,_0x4441de){return function(_0x4d188c){if(!_0x4d188c){_0x4460e7['sendStatus'](0x194);}return _0x4d188c;};}function handleError(_0x2058bf,_0xb97e23){_0xb97e23=_0xb97e23||0x1f4;return function(_0x26ae90){logger[_0x57d0('0x26')](_0x26ae90[_0x57d0('0x36')]);if(_0x26ae90[_0x57d0('0x37')]){delete _0x26ae90['name'];}_0x2058bf[_0x57d0('0x2b')](_0xb97e23)['send'](_0x26ae90);};}exports['index']=function(_0x3dbfbc,_0x4d6d4b){var _0x2ded2a={},_0x2b8ba0={},_0x42bc85={'count':0x0,'rows':[]};var _0x3b84b2=db[_0x57d0('0x38')]['rawAttributes'];_0x2b8ba0[_0x57d0('0x39')]=_['keys'](_0x3b84b2);_0x2b8ba0[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x3dbfbc[_0x57d0('0x3a')]);_0x2b8ba0['filters']=_['intersection'](_0x2b8ba0[_0x57d0('0x39')],_0x2b8ba0[_0x57d0('0x3a')]);_0x2ded2a[_0x57d0('0x3c')]=_['intersection'](_0x2b8ba0[_0x57d0('0x39')],qs['fields'](_0x3dbfbc['query'][_0x57d0('0x3d')]));_0x2ded2a[_0x57d0('0x3c')]=_0x2ded2a['attributes'][_0x57d0('0x3e')]?_0x2ded2a[_0x57d0('0x3c')]:_0x2b8ba0[_0x57d0('0x39')];if(!_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x3f')](_0x57d0('0x40'))){_0x2ded2a[_0x57d0('0x2f')]=qs['limit'](_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x2f')]);_0x2ded2a[_0x57d0('0x2e')]=qs[_0x57d0('0x2e')](_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x2e')]);}_0x2ded2a['order']=qs[_0x57d0('0x41')](_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x2ded2a['where']=qs[_0x57d0('0x42')](_['pick'](_0x3dbfbc[_0x57d0('0x3a')],_0x2b8ba0[_0x57d0('0x42')]));if(_0x3dbfbc[_0x57d0('0x3a')][_0x57d0('0x43')]){_0x2ded2a[_0x57d0('0x44')]=_['merge'](_0x2ded2a[_0x57d0('0x44')],{'$or':_['map'](_0x3b84b2,function(_0x5cabe0){if(_0x5cabe0[_0x57d0('0x45')][_0x57d0('0x46')]!==_0x57d0('0x47')){var _0x34d387={};_0x34d387[_0x5cabe0[_0x57d0('0x48')]]={'$like':'%'+_0x3dbfbc[_0x57d0('0x3a')]['filter']+'%'};return _0x34d387;}})});}_0x2ded2a=_[_0x57d0('0x49')]({},_0x2ded2a,_0x3dbfbc['options']);var _0x298d26={'where':_0x2ded2a[_0x57d0('0x44')]};return db[_0x57d0('0x38')][_0x57d0('0x2d')](_0x298d26)['then'](function(_0x3cf11e){_0x42bc85['count']=_0x3cf11e;if(_0x3dbfbc['query'][_0x57d0('0x4a')]){_0x2ded2a[_0x57d0('0x4b')]=[{'all':!![]}];}return db[_0x57d0('0x38')][_0x57d0('0x4c')](_0x2ded2a);})[_0x57d0('0x34')](function(_0x126b3e){_0x42bc85[_0x57d0('0x4d')]=_0x126b3e;return _0x42bc85;})['then'](respondWithFilteredResult(_0x4d6d4b,_0x2ded2a))['catch'](handleError(_0x4d6d4b,null));};exports[_0x57d0('0x4e')]=function(_0x14b094,_0x176847){var _0x5f543f={'raw':![],'where':{'id':_0x14b094[_0x57d0('0x4f')]['id']}},_0xea6c7f={};_0xea6c7f['model']=_[_0x57d0('0x3b')](db['FreshdeskConfiguration'][_0x57d0('0x50')]);_0xea6c7f[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x14b094[_0x57d0('0x3a')]);_0xea6c7f['filters']=_[_0x57d0('0x51')](_0xea6c7f[_0x57d0('0x39')],_0xea6c7f[_0x57d0('0x3a')]);_0x5f543f[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0xea6c7f[_0x57d0('0x39')],qs['fields'](_0x14b094[_0x57d0('0x3a')][_0x57d0('0x3d')]));_0x5f543f['attributes']=_0x5f543f[_0x57d0('0x3c')][_0x57d0('0x3e')]?_0x5f543f[_0x57d0('0x3c')]:_0xea6c7f['model'];if(_0x14b094[_0x57d0('0x3a')][_0x57d0('0x4a')]){_0x5f543f[_0x57d0('0x4b')]=[{'all':!![]}];}_0x5f543f=_['merge']({},_0x5f543f,_0x14b094[_0x57d0('0x52')]);return db['FreshdeskConfiguration'][_0x57d0('0x53')](_0x5f543f)['then'](handleEntityNotFound(_0x176847,null))[_0x57d0('0x34')](respondWithResult(_0x176847,null))[_0x57d0('0x29')](handleError(_0x176847,null));};exports[_0x57d0('0x54')]=function(_0x4c7552,_0x7beb1e){return db[_0x57d0('0x38')][_0x57d0('0x54')](_0x4c7552['body'],{})[_0x57d0('0x34')](respondWithResult(_0x7beb1e,0xc9))[_0x57d0('0x29')](handleError(_0x7beb1e,null));};exports['update']=function(_0x2fa69a,_0x1a9146){if(_0x2fa69a['body']['id']){delete _0x2fa69a[_0x57d0('0x55')]['id'];}return db[_0x57d0('0x38')][_0x57d0('0x53')]({'where':{'id':_0x2fa69a[_0x57d0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a9146,null))[_0x57d0('0x34')](saveUpdates(_0x2fa69a[_0x57d0('0x55')],null))['then'](respondWithResult(_0x1a9146,null))[_0x57d0('0x29')](handleError(_0x1a9146,null));};exports['destroy']=function(_0x3a21d1,_0x51bd1b){return db[_0x57d0('0x38')][_0x57d0('0x53')]({'where':{'id':_0x3a21d1[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x51bd1b,null))[_0x57d0('0x34')](removeEntity(_0x51bd1b,null))['catch'](handleError(_0x51bd1b,null));};exports[_0x57d0('0x56')]=function(_0x48d61,_0x147087,_0x1e1722){var _0x2d56b7={};var _0x565802={};var _0x3f1f84;var _0x1b7765;return db['FreshdeskConfiguration'][_0x57d0('0x57')]({'where':{'id':_0x48d61[_0x57d0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x147087,null))[_0x57d0('0x34')](function(_0x134fa0){if(_0x134fa0){_0x3f1f84=_0x134fa0;_0x565802['model']=_[_0x57d0('0x3b')](db[_0x57d0('0x58')]['rawAttributes']);_0x565802['query']=_[_0x57d0('0x3b')](_0x48d61[_0x57d0('0x3a')]);_0x565802[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x565802[_0x57d0('0x39')],_0x565802[_0x57d0('0x3a')]);_0x2d56b7[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0x565802['model'],qs[_0x57d0('0x3d')](_0x48d61[_0x57d0('0x3a')]['fields']));_0x2d56b7[_0x57d0('0x3c')]=_0x2d56b7[_0x57d0('0x3c')][_0x57d0('0x3e')]?_0x2d56b7[_0x57d0('0x3c')]:_0x565802[_0x57d0('0x39')];_0x2d56b7[_0x57d0('0x59')]=qs[_0x57d0('0x41')](_0x48d61[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x2d56b7['where']=qs[_0x57d0('0x42')](_[_0x57d0('0x5a')](_0x48d61['query'],_0x565802[_0x57d0('0x42')]));if(_0x48d61[_0x57d0('0x3a')][_0x57d0('0x43')]){_0x2d56b7[_0x57d0('0x44')]=_[_0x57d0('0x49')](_0x2d56b7['where'],{'$or':_['map'](_0x2d56b7['attributes'],function(_0x4ee44c){var _0x26278b={};_0x26278b[_0x4ee44c]={'$like':'%'+_0x48d61[_0x57d0('0x3a')]['filter']+'%'};return _0x26278b;})});}_0x2d56b7=_[_0x57d0('0x49')]({},_0x2d56b7,_0x48d61[_0x57d0('0x52')]);return _0x3f1f84[_0x57d0('0x56')](_0x2d56b7);}})[_0x57d0('0x34')](function(_0x3332bf){if(_0x3332bf){_0x1b7765=_0x3332bf['length'];if(!_0x48d61[_0x57d0('0x3a')]['hasOwnProperty']('nolimit')){_0x2d56b7[_0x57d0('0x2f')]=qs[_0x57d0('0x2f')](_0x48d61['query'][_0x57d0('0x2f')]);_0x2d56b7[_0x57d0('0x2e')]=qs[_0x57d0('0x2e')](_0x48d61['query'][_0x57d0('0x2e')]);}return _0x3f1f84[_0x57d0('0x56')](_0x2d56b7);}})[_0x57d0('0x34')](function(_0x177fbf){if(_0x177fbf){return _0x177fbf?{'count':_0x1b7765,'rows':_0x177fbf}:null;}})[_0x57d0('0x34')](respondWithResult(_0x147087,null))['catch'](handleError(_0x147087,null));};exports[_0x57d0('0x5b')]=function(_0x3690e4,_0x88ba71,_0x2ad2fe){var _0x5009ef={};var _0x41f34e={};var _0x28de65;var _0x230097;return db[_0x57d0('0x38')][_0x57d0('0x57')]({'where':{'id':_0x3690e4[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x88ba71,null))[_0x57d0('0x34')](function(_0x57873f){if(_0x57873f){_0x28de65=_0x57873f;_0x41f34e[_0x57d0('0x39')]=_[_0x57d0('0x3b')](db[_0x57d0('0x58')][_0x57d0('0x50')]);_0x41f34e[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x3690e4[_0x57d0('0x3a')]);_0x41f34e[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x41f34e[_0x57d0('0x39')],_0x41f34e['query']);_0x5009ef['attributes']=_[_0x57d0('0x51')](_0x41f34e[_0x57d0('0x39')],qs[_0x57d0('0x3d')](_0x3690e4['query']['fields']));_0x5009ef['attributes']=_0x5009ef['attributes'][_0x57d0('0x3e')]?_0x5009ef[_0x57d0('0x3c')]:_0x41f34e[_0x57d0('0x39')];_0x5009ef[_0x57d0('0x59')]=qs['sort'](_0x3690e4[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x5009ef[_0x57d0('0x44')]=qs[_0x57d0('0x42')](_['pick'](_0x3690e4[_0x57d0('0x3a')],_0x41f34e[_0x57d0('0x42')]));if(_0x3690e4['query']['filter']){_0x5009ef[_0x57d0('0x44')]=_['merge'](_0x5009ef[_0x57d0('0x44')],{'$or':_[_0x57d0('0x5c')](_0x5009ef['attributes'],function(_0x459942){var _0x51e722={};_0x51e722[_0x459942]={'$like':'%'+_0x3690e4[_0x57d0('0x3a')][_0x57d0('0x43')]+'%'};return _0x51e722;})});}_0x5009ef=_[_0x57d0('0x49')]({},_0x5009ef,_0x3690e4[_0x57d0('0x52')]);return _0x28de65[_0x57d0('0x5b')](_0x5009ef);}})[_0x57d0('0x34')](function(_0xd39a37){if(_0xd39a37){_0x230097=_0xd39a37['length'];if(!_0x3690e4['query'][_0x57d0('0x3f')]('nolimit')){_0x5009ef['limit']=qs[_0x57d0('0x2f')](_0x3690e4['query'][_0x57d0('0x2f')]);_0x5009ef[_0x57d0('0x2e')]=qs['offset'](_0x3690e4['query'][_0x57d0('0x2e')]);}return _0x28de65[_0x57d0('0x5b')](_0x5009ef);}})[_0x57d0('0x34')](function(_0x71b1c8){if(_0x71b1c8){return _0x71b1c8?{'count':_0x230097,'rows':_0x71b1c8}:null;}})[_0x57d0('0x34')](respondWithResult(_0x88ba71,null))['catch'](handleError(_0x88ba71,null));};exports['getDescriptions']=function(_0x4e258f,_0x44341c,_0x2388c5){var _0x4f1a8a={};var _0x6e8296={};var _0x20df4a;var _0x309549;return db[_0x57d0('0x38')][_0x57d0('0x57')]({'where':{'id':_0x4e258f[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x44341c,null))[_0x57d0('0x34')](function(_0x4f3b4a){if(_0x4f3b4a){_0x20df4a=_0x4f3b4a;_0x6e8296[_0x57d0('0x39')]=_[_0x57d0('0x3b')](db[_0x57d0('0x58')][_0x57d0('0x50')]);_0x6e8296[_0x57d0('0x3a')]=_['keys'](_0x4e258f[_0x57d0('0x3a')]);_0x6e8296[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x6e8296[_0x57d0('0x39')],_0x6e8296[_0x57d0('0x3a')]);_0x4f1a8a[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0x6e8296[_0x57d0('0x39')],qs['fields'](_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x3d')]));_0x4f1a8a[_0x57d0('0x3c')]=_0x4f1a8a[_0x57d0('0x3c')][_0x57d0('0x3e')]?_0x4f1a8a[_0x57d0('0x3c')]:_0x6e8296[_0x57d0('0x39')];_0x4f1a8a[_0x57d0('0x59')]=qs['sort'](_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x41')]);_0x4f1a8a[_0x57d0('0x44')]=qs[_0x57d0('0x42')](_['pick'](_0x4e258f[_0x57d0('0x3a')],_0x6e8296['filters']));if(_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x43')]){_0x4f1a8a[_0x57d0('0x44')]=_['merge'](_0x4f1a8a[_0x57d0('0x44')],{'$or':_[_0x57d0('0x5c')](_0x4f1a8a[_0x57d0('0x3c')],function(_0xd5ce0a){var _0xff98da={};_0xff98da[_0xd5ce0a]={'$like':'%'+_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x43')]+'%'};return _0xff98da;})});}_0x4f1a8a=_[_0x57d0('0x49')]({},_0x4f1a8a,_0x4e258f[_0x57d0('0x52')]);return _0x20df4a[_0x57d0('0x5d')](_0x4f1a8a);}})[_0x57d0('0x34')](function(_0x3a099b){if(_0x3a099b){_0x309549=_0x3a099b['length'];if(!_0x4e258f[_0x57d0('0x3a')]['hasOwnProperty'](_0x57d0('0x40'))){_0x4f1a8a[_0x57d0('0x2f')]=qs[_0x57d0('0x2f')](_0x4e258f[_0x57d0('0x3a')][_0x57d0('0x2f')]);_0x4f1a8a['offset']=qs['offset'](_0x4e258f[_0x57d0('0x3a')]['offset']);}return _0x20df4a[_0x57d0('0x5d')](_0x4f1a8a);}})[_0x57d0('0x34')](function(_0x100dc9){if(_0x100dc9){return _0x100dc9?{'count':_0x309549,'rows':_0x100dc9}:null;}})[_0x57d0('0x34')](respondWithResult(_0x44341c,null))['catch'](handleError(_0x44341c,null));};exports['getTags']=function(_0x1eb9cf,_0xb448cc,_0x5b99e0){var _0xac2d56={};var _0x3dd1d8={};var _0x2eb7c2;var _0x5dd564;return db[_0x57d0('0x38')]['findOne']({'where':{'id':_0x1eb9cf[_0x57d0('0x4f')]['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0xb448cc,null))[_0x57d0('0x34')](function(_0x497ce5){if(_0x497ce5){_0x2eb7c2=_0x497ce5;_0x3dd1d8[_0x57d0('0x39')]=_['keys'](db[_0x57d0('0x5e')]['rawAttributes']);_0x3dd1d8[_0x57d0('0x3a')]=_[_0x57d0('0x3b')](_0x1eb9cf['query']);_0x3dd1d8[_0x57d0('0x42')]=_[_0x57d0('0x51')](_0x3dd1d8[_0x57d0('0x39')],_0x3dd1d8[_0x57d0('0x3a')]);_0xac2d56[_0x57d0('0x3c')]=_[_0x57d0('0x51')](_0x3dd1d8[_0x57d0('0x39')],qs[_0x57d0('0x3d')](_0x1eb9cf['query'][_0x57d0('0x3d')]));_0xac2d56['attributes']=_0xac2d56[_0x57d0('0x3c')]['length']?_0xac2d56[_0x57d0('0x3c')]:_0x3dd1d8[_0x57d0('0x39')];_0xac2d56[_0x57d0('0x59')]=qs['sort'](_0x1eb9cf[_0x57d0('0x3a')]['sort']);_0xac2d56[_0x57d0('0x44')]=qs['filters'](_[_0x57d0('0x5a')](_0x1eb9cf[_0x57d0('0x3a')],_0x3dd1d8[_0x57d0('0x42')]));if(_0x1eb9cf[_0x57d0('0x3a')][_0x57d0('0x43')]){_0xac2d56['where']=_[_0x57d0('0x49')](_0xac2d56[_0x57d0('0x44')],{'$or':_[_0x57d0('0x5c')](_0xac2d56[_0x57d0('0x3c')],function(_0x450d0e){var _0xa7d82f={};_0xa7d82f[_0x450d0e]={'$like':'%'+_0x1eb9cf[_0x57d0('0x3a')]['filter']+'%'};return _0xa7d82f;})});}_0xac2d56=_[_0x57d0('0x49')]({},_0xac2d56,_0x1eb9cf['options']);return _0x2eb7c2[_0x57d0('0x5f')](_0xac2d56);}})[_0x57d0('0x34')](function(_0x10c15b){if(_0x10c15b){_0x5dd564=_0x10c15b[_0x57d0('0x3e')];if(!_0x1eb9cf[_0x57d0('0x3a')][_0x57d0('0x3f')](_0x57d0('0x40'))){_0xac2d56[_0x57d0('0x2f')]=qs[_0x57d0('0x2f')](_0x1eb9cf[_0x57d0('0x3a')][_0x57d0('0x2f')]);_0xac2d56[_0x57d0('0x2e')]=qs[_0x57d0('0x2e')](_0x1eb9cf[_0x57d0('0x3a')]['offset']);}return _0x2eb7c2[_0x57d0('0x5f')](_0xac2d56);}})[_0x57d0('0x34')](function(_0x3d60bb){if(_0x3d60bb){return _0x3d60bb?{'count':_0x5dd564,'rows':_0x3d60bb}:null;}})[_0x57d0('0x34')](respondWithResult(_0xb448cc,null))[_0x57d0('0x29')](handleError(_0xb448cc,null));};exports[_0x57d0('0x60')]=function(_0x3c05e0,_0x271260,_0xb72082){if(_0x3c05e0[_0x57d0('0x55')]['id']){delete _0x3c05e0['body']['id'];}return db[_0x57d0('0x38')][_0x57d0('0x57')]({'where':{'id':_0x3c05e0['params']['id']}})[_0x57d0('0x34')](handleEntityNotFound(_0x271260,null))[_0x57d0('0x34')](function(_0x3301c2){if(_0x3301c2){return _0x3301c2['setTags'](_0x3c05e0['body'][_0x57d0('0x61')]||[]);}return null;})[_0x57d0('0x34')](respondWithResult(_0x271260,null))['catch'](handleError(_0x271260,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index ac31d4b..1339c17 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 _0x4fc2=['request-promise','path','rimraf','./intFreshdeskConfiguration.attributes','define','lodash','util','api','moment','bluebird'];(function(_0x4ed90e,_0x46e825){var _0x3cffb5=function(_0x460f4b){while(--_0x460f4b){_0x4ed90e['push'](_0x4ed90e['shift']());}};_0x3cffb5(++_0x46e825);}(_0x4fc2,0x91));var _0x24fc=function(_0x27f11f,_0x2256c8){_0x27f11f=_0x27f11f-0x0;var _0x3baf31=_0x4fc2[_0x27f11f];return _0x3baf31;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require('../../config/logger')(_0x24fc('0x2'));var moment=require(_0x24fc('0x3'));var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require(_0x24fc('0x7'));var config=require('../../config/environment');var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x28ec34,_0x2b6844){return _0x28ec34[_0x24fc('0x9')]('FreshdeskConfiguration',attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70e8=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x209497,_0x311317){var _0x4882d4=function(_0x574888){while(--_0x574888){_0x209497['push'](_0x209497['shift']());}};_0x4882d4(++_0x311317);}(_0x70e8,0x106));var _0x870e=function(_0x1b1772,_0x44cd65){_0x1b1772=_0x1b1772-0x0;var _0x176510=_0x70e8[_0x1b1772];return _0x176510;};'use strict';var _=require(_0x870e('0x0'));var util=require(_0x870e('0x1'));var logger=require(_0x870e('0x2'))(_0x870e('0x3'));var moment=require('moment');var BPromise=require(_0x870e('0x4'));var rp=require(_0x870e('0x5'));var fs=require('fs');var path=require(_0x870e('0x6'));var rimraf=require(_0x870e('0x7'));var config=require(_0x870e('0x8'));var attributes=require(_0x870e('0x9'));module[_0x870e('0xa')]=function(_0x470560,_0x36fcc4){return _0x470560[_0x870e('0xb')](_0x870e('0xc'),attributes,{'tableName':_0x870e('0xd'),'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 4d3bc3d..bd2714d 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 _0x15fe=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x30c6ca,_0x13e6c0){var _0x5adf64=function(_0x402a6a){while(--_0x402a6a){_0x30c6ca['push'](_0x30c6ca['shift']());}};_0x5adf64(++_0x13e6c0);}(_0x15fe,0xbc));var _0xe15f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x15fe[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xe15f('0x0'));var util=require('util');var moment=require(_0xe15f('0x1'));var BPromise=require(_0xe15f('0x2'));var rs=require(_0xe15f('0x3'));var fs=require('fs');var Redis=require(_0xe15f('0x4'));var db=require(_0xe15f('0x5'))['db'];var utils=require(_0xe15f('0x6'));var logger=require(_0xe15f('0x7'))('rpc');var config=require(_0xe15f('0x8'));var jayson=require(_0xe15f('0x9'));var client=jayson[_0xe15f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365ac6,_0x3bb962,_0x5476cf){return new BPromise(function(_0x1de9a4,_0x559052){return client['request'](_0x365ac6,_0x5476cf)[_0xe15f('0xb')](function(_0x5e28f8){logger[_0xe15f('0xc')](_0xe15f('0xd'),_0x3bb962,_0xe15f('0xe'));logger[_0xe15f('0xf')](_0xe15f('0x10'),_0x3bb962,_0xe15f('0xe'),JSON[_0xe15f('0x11')](_0x5e28f8));if(_0x5e28f8[_0xe15f('0x12')]){if(_0x5e28f8[_0xe15f('0x12')][_0xe15f('0x13')]===0x1f4){logger[_0xe15f('0x12')](_0xe15f('0xd'),_0x3bb962,_0x5e28f8[_0xe15f('0x12')]['message']);return _0x559052(_0x5e28f8[_0xe15f('0x12')][_0xe15f('0x14')]);}logger[_0xe15f('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bb962,_0x5e28f8[_0xe15f('0x12')][_0xe15f('0x14')]);return _0x1de9a4(_0x5e28f8[_0xe15f('0x12')]['message']);}else{logger[_0xe15f('0xc')](_0xe15f('0xd'),_0x3bb962,_0xe15f('0xe'));_0x1de9a4(_0x5e28f8[_0xe15f('0x15')][_0xe15f('0x14')]);}})[_0xe15f('0x16')](function(_0x13a969){logger[_0xe15f('0x12')](_0xe15f('0xd'),_0x3bb962,_0x13a969);_0x559052(_0x13a969);});});} \ No newline at end of file +var _0x6f5a=['util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0x6f5a,0x10f));var _0xa6f5=function(_0x194494,_0x57c76e){_0x194494=_0x194494-0x0;var _0x45acaf=_0x6f5a[_0x194494];return _0x45acaf;};'use strict';var _=require(_0xa6f5('0x0'));var util=require(_0xa6f5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa6f5('0x2'));var fs=require('fs');var Redis=require(_0xa6f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6f5('0x4'));var logger=require('../../config/logger')(_0xa6f5('0x5'));var config=require(_0xa6f5('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x299fc0,_0x40cceb,_0x54c201){return new BPromise(function(_0x497224,_0x9b188d){return client[_0xa6f5('0x7')](_0x299fc0,_0x54c201)[_0xa6f5('0x8')](function(_0xda660a){logger['info'](_0xa6f5('0x9'),_0x40cceb,_0xa6f5('0xa'));logger['debug'](_0xa6f5('0xb'),_0x40cceb,_0xa6f5('0xa'),JSON['stringify'](_0xda660a));if(_0xda660a['error']){if(_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xd')]===0x1f4){logger[_0xa6f5('0xc')](_0xa6f5('0x9'),_0x40cceb,_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xe')]);return _0x9b188d(_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xe')]);}logger[_0xa6f5('0xc')](_0xa6f5('0x9'),_0x40cceb,_0xda660a[_0xa6f5('0xc')][_0xa6f5('0xe')]);return _0x497224(_0xda660a[_0xa6f5('0xc')]['message']);}else{logger['info'](_0xa6f5('0x9'),_0x40cceb,'request\x20sent');_0x497224(_0xda660a[_0xa6f5('0xf')][_0xa6f5('0xe')]);}})[_0xa6f5('0x10')](function(_0x84ee59){logger[_0xa6f5('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x40cceb,_0x84ee59);_0x9b188d(_0x84ee59);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 65a3b75..2002288 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 _0xd770=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','show','post','create','put','/:id','delete','exports','util'];(function(_0x4b4965,_0x3e7193){var _0x3bc9f7=function(_0x330866){while(--_0x330866){_0x4b4965['push'](_0x4b4965['shift']());}};_0x3bc9f7(++_0x3e7193);}(_0xd770,0x1e5));var _0x0d77=function(_0xbc84c9,_0x3ed028){_0xbc84c9=_0xbc84c9-0x0;var _0x589310=_0xd770[_0xbc84c9];return _0x589310;};'use strict';var multer=require('multer');var util=require(_0x0d77('0x0'));var path=require(_0x0d77('0x1'));var timeout=require(_0x0d77('0x2'));var express=require('express');var router=express[_0x0d77('0x3')]();var auth=require(_0x0d77('0x4'));var interaction=require(_0x0d77('0x5'));var config=require(_0x0d77('0x6'));var controller=require(_0x0d77('0x7'));router['get']('/',auth[_0x0d77('0x8')](),controller[_0x0d77('0x9')]);router[_0x0d77('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0d77('0xb')]);router[_0x0d77('0xc')]('/',auth[_0x0d77('0x8')](),controller[_0x0d77('0xd')]);router[_0x0d77('0xe')](_0x0d77('0xf'),auth[_0x0d77('0x8')](),controller['update']);router[_0x0d77('0x10')]('/:id',auth[_0x0d77('0x8')](),controller['destroy']);module[_0x0d77('0x11')]=router; \ No newline at end of file +var _0x1c2e=['express','Router','../../components/interaction/service','./intFreshdeskField.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c2e,0x186));var _0xe1c2=function(_0x2e2457,_0xb3805a){_0x2e2457=_0x2e2457-0x0;var _0x491473=_0x1c2e[_0x2e2457];return _0x491473;};'use strict';var multer=require('multer');var util=require(_0xe1c2('0x0'));var path=require(_0xe1c2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe1c2('0x2'));var router=express[_0xe1c2('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe1c2('0x4'));var config=require('../../config/environment');var controller=require(_0xe1c2('0x5'));router[_0xe1c2('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe1c2('0x6')](_0xe1c2('0x7'),auth[_0xe1c2('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe1c2('0x9')](_0xe1c2('0x7'),auth[_0xe1c2('0x8')](),controller[_0xe1c2('0xa')]);router[_0xe1c2('0xb')](_0xe1c2('0x7'),auth[_0xe1c2('0x8')](),controller[_0xe1c2('0xc')]);module[_0xe1c2('0xd')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 09e7d45..19d6a04 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 _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x532d05,_0x21579c){var _0x509806=function(_0x5d32ed){while(--_0x5d32ed){_0x532d05['push'](_0x532d05['shift']());}};_0x509806(++_0x21579c);}(_0xb688,0xcf));var _0x8b68=function(_0x4aecdb,_0xec1224){_0x4aecdb=_0x4aecdb-0x0;var _0x1da8ab=_0xb688[_0x4aecdb];return _0x1da8ab;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file +var _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x26cfb2,_0x1a565f){var _0x4a6275=function(_0x5b4e17){while(--_0x5b4e17){_0x26cfb2['push'](_0x26cfb2['shift']());}};_0x4a6275(++_0x1a565f);}(_0xb688,0xcf));var _0x8b68=function(_0x1c6ae8,_0x4f4527){_0x1c6ae8=_0x1c6ae8-0x0;var _0x48fd3d=_0xb688[_0x1c6ae8];return _0x48fd3d;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8e17d4c..0152276 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 _0x53a8=['nolimit','order','sort','filters','where','merge','map','type','key','field','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','FreshdeskField','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x53a8,0xa5));var _0x853a=function(_0x5de5d7,_0x3ad60f){_0x5de5d7=_0x5de5d7-0x0;var _0xa4f3e3=_0x53a8[_0x5de5d7];return _0xa4f3e3;};'use strict';var pdf=require(_0x853a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x853a('0x1'));var jsonpatch=require(_0x853a('0x2'));var rp=require(_0x853a('0x3'));var moment=require(_0x853a('0x4'));var BPromise=require(_0x853a('0x5'));var Mustache=require(_0x853a('0x6'));var util=require(_0x853a('0x7'));var path=require(_0x853a('0x8'));var sox=require(_0x853a('0x9'));var csv=require(_0x853a('0xa'));var ejs=require(_0x853a('0xb'));var fs=require('fs');var _=require(_0x853a('0xc'));var squel=require(_0x853a('0xd'));var crypto=require(_0x853a('0xe'));var jsforce=require(_0x853a('0xf'));var deskjs=require(_0x853a('0x10'));var toCsv=require(_0x853a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x853a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x853a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x853a('0x13'))(_0x853a('0x14'));var utils=require('../../config/utils');var config=require(_0x853a('0x15'));var db=require(_0x853a('0x16'))['db'];function respondWithStatusCode(_0x500cc7,_0x186e2a){_0x186e2a=_0x186e2a||0xcc;return function(_0x1d183d){if(_0x1d183d){return _0x500cc7[_0x853a('0x17')](_0x186e2a);}return _0x500cc7[_0x853a('0x18')](_0x186e2a)[_0x853a('0x19')]();};}function respondWithResult(_0x77306f,_0x132f75){_0x132f75=_0x132f75||0xc8;return function(_0x21f222){if(_0x21f222){return _0x77306f[_0x853a('0x18')](_0x132f75)[_0x853a('0x1a')](_0x21f222);}};}function respondWithFilteredResult(_0x208567,_0xd3f821){return function(_0xa85a64){if(_0xa85a64){var _0x1132da=_0xa85a64[_0x853a('0x1b')],_0xa2fe74=_0xd3f821['offset'],_0x3e9aa1=_0xd3f821[_0x853a('0x1c')]+_0xd3f821[_0x853a('0x1d')],_0x21cee0;if(_0x3e9aa1>=_0x1132da){_0x3e9aa1=_0x1132da;_0x21cee0=0xc8;}else{_0x21cee0=0xce;}_0x208567['status'](_0x21cee0);return _0x208567[_0x853a('0x1e')](_0x853a('0x1f'),_0xa2fe74+'-'+_0x3e9aa1+'/'+_0x1132da)[_0x853a('0x1a')](_0xa85a64);}return null;};}function patchUpdates(_0x34d77e){return function(_0x15fe5c){try{jsonpatch['apply'](_0x15fe5c,_0x34d77e,!![]);}catch(_0x5492ce){return BPromise[_0x853a('0x20')](_0x5492ce);}return _0x15fe5c[_0x853a('0x21')]();};}function saveUpdates(_0x3cd34c,_0x20567d){return function(_0x41878e){if(_0x41878e){return _0x41878e[_0x853a('0x22')](_0x3cd34c)[_0x853a('0x23')](function(_0x1a25de){return _0x1a25de;});}return null;};}function removeEntity(_0x21d53b,_0x577380){return function(_0x349312){if(_0x349312){return _0x349312[_0x853a('0x24')]()[_0x853a('0x23')](function(){_0x21d53b[_0x853a('0x18')](0xcc)[_0x853a('0x19')]();});}};}function handleEntityNotFound(_0x5c2208,_0x3dbeed){return function(_0x5ac8ed){if(!_0x5ac8ed){_0x5c2208[_0x853a('0x17')](0x194);}return _0x5ac8ed;};}function handleError(_0x5eabf9,_0x449417){_0x449417=_0x449417||0x1f4;return function(_0x9524c2){logger[_0x853a('0x25')](_0x9524c2[_0x853a('0x26')]);if(_0x9524c2['name']){delete _0x9524c2[_0x853a('0x27')];}_0x5eabf9[_0x853a('0x18')](_0x449417)['send'](_0x9524c2);};}exports[_0x853a('0x28')]=function(_0x241149,_0x4c28f4){var _0x3d4500={},_0x37a95c={},_0x42c9a1={'count':0x0,'rows':[]};var _0xa19e8f=db[_0x853a('0x29')][_0x853a('0x2a')];_0x37a95c[_0x853a('0x2b')]=_[_0x853a('0x2c')](_0xa19e8f);_0x37a95c['query']=_['keys'](_0x241149[_0x853a('0x2d')]);_0x37a95c['filters']=_[_0x853a('0x2e')](_0x37a95c[_0x853a('0x2b')],_0x37a95c[_0x853a('0x2d')]);_0x3d4500[_0x853a('0x2f')]=_[_0x853a('0x2e')](_0x37a95c[_0x853a('0x2b')],qs[_0x853a('0x30')](_0x241149['query']['fields']));_0x3d4500[_0x853a('0x2f')]=_0x3d4500['attributes'][_0x853a('0x31')]?_0x3d4500[_0x853a('0x2f')]:_0x37a95c[_0x853a('0x2b')];if(!_0x241149[_0x853a('0x2d')][_0x853a('0x32')](_0x853a('0x33'))){_0x3d4500['limit']=qs[_0x853a('0x1d')](_0x241149[_0x853a('0x2d')][_0x853a('0x1d')]);_0x3d4500[_0x853a('0x1c')]=qs[_0x853a('0x1c')](_0x241149[_0x853a('0x2d')][_0x853a('0x1c')]);}_0x3d4500[_0x853a('0x34')]=qs[_0x853a('0x35')](_0x241149['query']['sort']);_0x3d4500['where']=qs[_0x853a('0x36')](_['pick'](_0x241149['query'],_0x37a95c['filters']));if(_0x241149['query']['filter']){_0x3d4500[_0x853a('0x37')]=_[_0x853a('0x38')](_0x3d4500[_0x853a('0x37')],{'$or':_[_0x853a('0x39')](_0xa19e8f,function(_0x4eccbe){if(_0x4eccbe[_0x853a('0x3a')][_0x853a('0x3b')]!=='VIRTUAL'){var _0x303bfc={};_0x303bfc[_0x4eccbe[_0x853a('0x3c')]]={'$like':'%'+_0x241149[_0x853a('0x2d')][_0x853a('0x3d')]+'%'};return _0x303bfc;}})});}_0x3d4500=_['merge']({},_0x3d4500,_0x241149['options']);var _0x3fe163={'where':_0x3d4500[_0x853a('0x37')]};return db[_0x853a('0x29')][_0x853a('0x1b')](_0x3fe163)[_0x853a('0x23')](function(_0x232362){_0x42c9a1[_0x853a('0x1b')]=_0x232362;if(_0x241149[_0x853a('0x2d')][_0x853a('0x3e')]){_0x3d4500[_0x853a('0x3f')]=[{'all':!![]}];}return db[_0x853a('0x29')][_0x853a('0x40')](_0x3d4500);})[_0x853a('0x23')](function(_0x41685e){_0x42c9a1['rows']=_0x41685e;return _0x42c9a1;})[_0x853a('0x23')](respondWithFilteredResult(_0x4c28f4,_0x3d4500))[_0x853a('0x41')](handleError(_0x4c28f4,null));};exports[_0x853a('0x42')]=function(_0x1ee4e6,_0x57f86f){var _0x1421ae={'raw':!![],'where':{'id':_0x1ee4e6[_0x853a('0x43')]['id']}},_0x271e39={};_0x271e39[_0x853a('0x2b')]=_[_0x853a('0x2c')](db[_0x853a('0x29')][_0x853a('0x2a')]);_0x271e39['query']=_[_0x853a('0x2c')](_0x1ee4e6[_0x853a('0x2d')]);_0x271e39['filters']=_[_0x853a('0x2e')](_0x271e39['model'],_0x271e39[_0x853a('0x2d')]);_0x1421ae[_0x853a('0x2f')]=_[_0x853a('0x2e')](_0x271e39[_0x853a('0x2b')],qs[_0x853a('0x30')](_0x1ee4e6[_0x853a('0x2d')][_0x853a('0x30')]));_0x1421ae[_0x853a('0x2f')]=_0x1421ae[_0x853a('0x2f')]['length']?_0x1421ae['attributes']:_0x271e39[_0x853a('0x2b')];if(_0x1ee4e6[_0x853a('0x2d')]['includeAll']){_0x1421ae[_0x853a('0x3f')]=[{'all':!![]}];}_0x1421ae=_['merge']({},_0x1421ae,_0x1ee4e6[_0x853a('0x44')]);return db[_0x853a('0x29')][_0x853a('0x45')](_0x1421ae)[_0x853a('0x23')](handleEntityNotFound(_0x57f86f,null))[_0x853a('0x23')](respondWithResult(_0x57f86f,null))[_0x853a('0x41')](handleError(_0x57f86f,null));};exports[_0x853a('0x46')]=function(_0x3c867b,_0x27f44e){return db[_0x853a('0x29')][_0x853a('0x46')](_0x3c867b[_0x853a('0x47')],{})[_0x853a('0x23')](respondWithResult(_0x27f44e,0xc9))['catch'](handleError(_0x27f44e,null));};exports[_0x853a('0x22')]=function(_0x1f1b22,_0x1e8857){if(_0x1f1b22['body']['id']){delete _0x1f1b22['body']['id'];}return db[_0x853a('0x29')][_0x853a('0x45')]({'where':{'id':_0x1f1b22[_0x853a('0x43')]['id']}})[_0x853a('0x23')](handleEntityNotFound(_0x1e8857,null))['then'](saveUpdates(_0x1f1b22[_0x853a('0x47')],null))[_0x853a('0x23')](respondWithResult(_0x1e8857,null))['catch'](handleError(_0x1e8857,null));};exports[_0x853a('0x24')]=function(_0xc4be22,_0x1b2344){return db['FreshdeskField'][_0x853a('0x45')]({'where':{'id':_0xc4be22[_0x853a('0x43')]['id']}})[_0x853a('0x23')](handleEntityNotFound(_0x1b2344,null))[_0x853a('0x23')](removeEntity(_0x1b2344,null))[_0x853a('0x41')](handleError(_0x1b2344,null));}; \ No newline at end of file +var _0x22f0=['offset','set','reject','update','then','destroy','error','stack','name','send','index','FreshdeskField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','map','type','VIRTUAL','field','merge','includeAll','include','findAll','rows','catch','params','options','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count'];(function(_0x2dc5d5,_0x2ec894){var _0x3f390e=function(_0x51d41b){while(--_0x51d41b){_0x2dc5d5['push'](_0x2dc5d5['shift']());}};_0x3f390e(++_0x2ec894);}(_0x22f0,0x193));var _0x022f=function(_0x3f20a5,_0x5bbeda){_0x3f20a5=_0x3f20a5-0x0;var _0x168ec6=_0x22f0[_0x3f20a5];return _0x168ec6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x022f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x022f('0x1'));var rp=require(_0x022f('0x2'));var moment=require(_0x022f('0x3'));var BPromise=require(_0x022f('0x4'));var Mustache=require(_0x022f('0x5'));var util=require('util');var path=require(_0x022f('0x6'));var sox=require(_0x022f('0x7'));var csv=require(_0x022f('0x8'));var ejs=require(_0x022f('0x9'));var fs=require('fs');var _=require(_0x022f('0xa'));var squel=require(_0x022f('0xb'));var crypto=require(_0x022f('0xc'));var jsforce=require(_0x022f('0xd'));var deskjs=require(_0x022f('0xe'));var toCsv=require(_0x022f('0x8'));var querystring=require(_0x022f('0xf'));var Papa=require(_0x022f('0x10'));var Redis=require(_0x022f('0x11'));var authService=require(_0x022f('0x12'));var qs=require(_0x022f('0x13'));var hardwareService=require(_0x022f('0x14'));var logger=require(_0x022f('0x15'))(_0x022f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x022f('0x17'))['db'];function respondWithStatusCode(_0x2e69b6,_0x5dd312){_0x5dd312=_0x5dd312||0xcc;return function(_0x1ce858){if(_0x1ce858){return _0x2e69b6[_0x022f('0x18')](_0x5dd312);}return _0x2e69b6['status'](_0x5dd312)[_0x022f('0x19')]();};}function respondWithResult(_0xc54273,_0x1937e5){_0x1937e5=_0x1937e5||0xc8;return function(_0x2b52a3){if(_0x2b52a3){return _0xc54273[_0x022f('0x1a')](_0x1937e5)[_0x022f('0x1b')](_0x2b52a3);}};}function respondWithFilteredResult(_0x521324,_0x4e9a2f){return function(_0x218f24){if(_0x218f24){var _0x2f1429=_0x218f24[_0x022f('0x1c')],_0x35e0ce=_0x4e9a2f['offset'],_0x3b3eab=_0x4e9a2f[_0x022f('0x1d')]+_0x4e9a2f['limit'],_0x419e09;if(_0x3b3eab>=_0x2f1429){_0x3b3eab=_0x2f1429;_0x419e09=0xc8;}else{_0x419e09=0xce;}_0x521324[_0x022f('0x1a')](_0x419e09);return _0x521324[_0x022f('0x1e')]('Content-Range',_0x35e0ce+'-'+_0x3b3eab+'/'+_0x2f1429)[_0x022f('0x1b')](_0x218f24);}return null;};}function patchUpdates(_0x2d0001){return function(_0x3dcbeb){try{jsonpatch['apply'](_0x3dcbeb,_0x2d0001,!![]);}catch(_0x586762){return BPromise[_0x022f('0x1f')](_0x586762);}return _0x3dcbeb['save']();};}function saveUpdates(_0x583f2c,_0x2f950c){return function(_0x33906e){if(_0x33906e){return _0x33906e[_0x022f('0x20')](_0x583f2c)[_0x022f('0x21')](function(_0x13f71b){return _0x13f71b;});}return null;};}function removeEntity(_0x44e56e,_0x43bed7){return function(_0x3cc9c6){if(_0x3cc9c6){return _0x3cc9c6[_0x022f('0x22')]()[_0x022f('0x21')](function(){_0x44e56e[_0x022f('0x1a')](0xcc)[_0x022f('0x19')]();});}};}function handleEntityNotFound(_0x395bcc,_0xb9ecc1){return function(_0x4d5b37){if(!_0x4d5b37){_0x395bcc[_0x022f('0x18')](0x194);}return _0x4d5b37;};}function handleError(_0x174f44,_0x50fedc){_0x50fedc=_0x50fedc||0x1f4;return function(_0x1878be){logger[_0x022f('0x23')](_0x1878be[_0x022f('0x24')]);if(_0x1878be[_0x022f('0x25')]){delete _0x1878be[_0x022f('0x25')];}_0x174f44[_0x022f('0x1a')](_0x50fedc)[_0x022f('0x26')](_0x1878be);};}exports[_0x022f('0x27')]=function(_0x444503,_0x275d21){var _0x24787c={},_0xb54d80={},_0x3e0df8={'count':0x0,'rows':[]};var _0x4ae3cb=db[_0x022f('0x28')][_0x022f('0x29')];_0xb54d80[_0x022f('0x2a')]=_[_0x022f('0x2b')](_0x4ae3cb);_0xb54d80[_0x022f('0x2c')]=_['keys'](_0x444503[_0x022f('0x2c')]);_0xb54d80[_0x022f('0x2d')]=_[_0x022f('0x2e')](_0xb54d80[_0x022f('0x2a')],_0xb54d80[_0x022f('0x2c')]);_0x24787c[_0x022f('0x2f')]=_[_0x022f('0x2e')](_0xb54d80['model'],qs[_0x022f('0x30')](_0x444503[_0x022f('0x2c')][_0x022f('0x30')]));_0x24787c[_0x022f('0x2f')]=_0x24787c[_0x022f('0x2f')][_0x022f('0x31')]?_0x24787c['attributes']:_0xb54d80[_0x022f('0x2a')];if(!_0x444503[_0x022f('0x2c')][_0x022f('0x32')]('nolimit')){_0x24787c[_0x022f('0x33')]=qs[_0x022f('0x33')](_0x444503[_0x022f('0x2c')][_0x022f('0x33')]);_0x24787c[_0x022f('0x1d')]=qs[_0x022f('0x1d')](_0x444503[_0x022f('0x2c')][_0x022f('0x1d')]);}_0x24787c[_0x022f('0x34')]=qs[_0x022f('0x35')](_0x444503[_0x022f('0x2c')][_0x022f('0x35')]);_0x24787c['where']=qs[_0x022f('0x2d')](_[_0x022f('0x36')](_0x444503[_0x022f('0x2c')],_0xb54d80[_0x022f('0x2d')]));if(_0x444503[_0x022f('0x2c')][_0x022f('0x37')]){_0x24787c[_0x022f('0x38')]=_['merge'](_0x24787c[_0x022f('0x38')],{'$or':_[_0x022f('0x39')](_0x4ae3cb,function(_0x3a9ac6){if(_0x3a9ac6[_0x022f('0x3a')]['key']!==_0x022f('0x3b')){var _0x2f0ce6={};_0x2f0ce6[_0x3a9ac6[_0x022f('0x3c')]]={'$like':'%'+_0x444503[_0x022f('0x2c')][_0x022f('0x37')]+'%'};return _0x2f0ce6;}})});}_0x24787c=_[_0x022f('0x3d')]({},_0x24787c,_0x444503['options']);var _0x17f796={'where':_0x24787c[_0x022f('0x38')]};return db[_0x022f('0x28')][_0x022f('0x1c')](_0x17f796)[_0x022f('0x21')](function(_0x35b098){_0x3e0df8[_0x022f('0x1c')]=_0x35b098;if(_0x444503[_0x022f('0x2c')][_0x022f('0x3e')]){_0x24787c[_0x022f('0x3f')]=[{'all':!![]}];}return db[_0x022f('0x28')][_0x022f('0x40')](_0x24787c);})[_0x022f('0x21')](function(_0x379bfa){_0x3e0df8[_0x022f('0x41')]=_0x379bfa;return _0x3e0df8;})[_0x022f('0x21')](respondWithFilteredResult(_0x275d21,_0x24787c))[_0x022f('0x42')](handleError(_0x275d21,null));};exports['show']=function(_0x28bc27,_0x4eadd8){var _0x3e46d3={'raw':!![],'where':{'id':_0x28bc27[_0x022f('0x43')]['id']}},_0x234b0f={};_0x234b0f[_0x022f('0x2a')]=_[_0x022f('0x2b')](db[_0x022f('0x28')][_0x022f('0x29')]);_0x234b0f[_0x022f('0x2c')]=_[_0x022f('0x2b')](_0x28bc27[_0x022f('0x2c')]);_0x234b0f[_0x022f('0x2d')]=_['intersection'](_0x234b0f[_0x022f('0x2a')],_0x234b0f[_0x022f('0x2c')]);_0x3e46d3[_0x022f('0x2f')]=_[_0x022f('0x2e')](_0x234b0f[_0x022f('0x2a')],qs['fields'](_0x28bc27[_0x022f('0x2c')][_0x022f('0x30')]));_0x3e46d3['attributes']=_0x3e46d3['attributes']['length']?_0x3e46d3[_0x022f('0x2f')]:_0x234b0f[_0x022f('0x2a')];if(_0x28bc27[_0x022f('0x2c')][_0x022f('0x3e')]){_0x3e46d3[_0x022f('0x3f')]=[{'all':!![]}];}_0x3e46d3=_['merge']({},_0x3e46d3,_0x28bc27[_0x022f('0x44')]);return db[_0x022f('0x28')][_0x022f('0x45')](_0x3e46d3)[_0x022f('0x21')](handleEntityNotFound(_0x4eadd8,null))[_0x022f('0x21')](respondWithResult(_0x4eadd8,null))[_0x022f('0x42')](handleError(_0x4eadd8,null));};exports[_0x022f('0x46')]=function(_0x24579f,_0x1453cb){return db['FreshdeskField'][_0x022f('0x46')](_0x24579f[_0x022f('0x47')],{})[_0x022f('0x21')](respondWithResult(_0x1453cb,0xc9))['catch'](handleError(_0x1453cb,null));};exports[_0x022f('0x20')]=function(_0x5744c7,_0x126ddb){if(_0x5744c7[_0x022f('0x47')]['id']){delete _0x5744c7[_0x022f('0x47')]['id'];}return db[_0x022f('0x28')][_0x022f('0x45')]({'where':{'id':_0x5744c7[_0x022f('0x43')]['id']}})[_0x022f('0x21')](handleEntityNotFound(_0x126ddb,null))[_0x022f('0x21')](saveUpdates(_0x5744c7[_0x022f('0x47')],null))[_0x022f('0x21')](respondWithResult(_0x126ddb,null))['catch'](handleError(_0x126ddb,null));};exports[_0x022f('0x22')]=function(_0x215f09,_0x5ccfd8){return db['FreshdeskField']['find']({'where':{'id':_0x215f09[_0x022f('0x43')]['id']}})['then'](handleEntityNotFound(_0x5ccfd8,null))['then'](removeEntity(_0x5ccfd8,null))['catch'](handleError(_0x5ccfd8,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d8d0e34..ad3c630 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 _0xadb3=['int_freshdesk_fields','freshdesk_unique_index','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','FreshdeskField'];(function(_0x2cd8b9,_0x19bb56){var _0x435de3=function(_0x5a1bcf){while(--_0x5a1bcf){_0x2cd8b9['push'](_0x2cd8b9['shift']());}};_0x435de3(++_0x19bb56);}(_0xadb3,0x1d6));var _0x3adb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xadb3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x3adb('0x0'));var util=require(_0x3adb('0x1'));var logger=require(_0x3adb('0x2'))('api');var moment=require(_0x3adb('0x3'));var BPromise=require(_0x3adb('0x4'));var rp=require(_0x3adb('0x5'));var fs=require('fs');var path=require(_0x3adb('0x6'));var rimraf=require(_0x3adb('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x50c790,_0x1ab12b){return _0x50c790[_0x3adb('0x8')](_0x3adb('0x9'),attributes,{'tableName':_0x3adb('0xa'),'paranoid':![],'indexes':[{'name':_0x3adb('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1705=['define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x306527,_0x3873db){var _0x47ce18=function(_0x1419d3){while(--_0x1419d3){_0x306527['push'](_0x306527['shift']());}};_0x47ce18(++_0x3873db);}(_0x1705,0xe6));var _0x5170=function(_0x10e840,_0x5b3935){_0x10e840=_0x10e840-0x0;var _0x405caa=_0x1705[_0x10e840];return _0x405caa;};'use strict';var _=require(_0x5170('0x0'));var util=require(_0x5170('0x1'));var logger=require(_0x5170('0x2'))(_0x5170('0x3'));var moment=require('moment');var BPromise=require(_0x5170('0x4'));var rp=require(_0x5170('0x5'));var fs=require('fs');var path=require(_0x5170('0x6'));var rimraf=require(_0x5170('0x7'));var config=require(_0x5170('0x8'));var attributes=require(_0x5170('0x9'));module['exports']=function(_0x1453c8,_0x127b58){return _0x1453c8[_0x5170('0xa')](_0x5170('0xb'),attributes,{'tableName':_0x5170('0xc'),'paranoid':![],'indexes':[{'name':_0x5170('0xd'),'fields':[_0x5170('0xe'),'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 deb853a..cbadfb5 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 _0xcb99=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xcb99,0x8b));var _0x9cb9=function(_0x3e1a10,_0x6aeaf2){_0x3e1a10=_0x3e1a10-0x0;var _0x2fb8ee=_0xcb99[_0x3e1a10];return _0x2fb8ee;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var moment=require(_0x9cb9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var utils=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed26a,_0xa84493,_0x1bf9b7){return new BPromise(function(_0x1dd62f,_0x82e3e){return client[_0x9cb9('0x8')](_0x2ed26a,_0x1bf9b7)[_0x9cb9('0x9')](function(_0x3da50b){logger['info']('FreshdeskField,\x20%s,\x20%s',_0xa84493,_0x9cb9('0xa'));logger[_0x9cb9('0xb')](_0x9cb9('0xc'),_0xa84493,'request\x20sent',JSON[_0x9cb9('0xd')](_0x3da50b));if(_0x3da50b[_0x9cb9('0xe')]){if(_0x3da50b['error']['code']===0x1f4){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x82e3e(_0x3da50b['error'][_0x9cb9('0x10')]);}logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x1dd62f(_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);}else{logger[_0x9cb9('0x11')](_0x9cb9('0xf'),_0xa84493,_0x9cb9('0xa'));_0x1dd62f(_0x3da50b[_0x9cb9('0x12')][_0x9cb9('0x10')]);}})[_0x9cb9('0x13')](function(_0x140910){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x140910);_0x82e3e(_0x140910);});});} \ No newline at end of file +var _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5c660a,_0x4b5262){var _0x3a77a4=function(_0x479c95){while(--_0x479c95){_0x5c660a['push'](_0x5c660a['shift']());}};_0x3a77a4(++_0x4b5262);}(_0x5089,0x1bb));var _0x9508=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0x5089[_0x29bf80];return _0x932096;};'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')]('FreshdeskField,\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/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index b01cc24..27e577b 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 _0xeca3=['./intSalesforceAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x53f3a4,_0x45671e){var _0x95276a=function(_0x5da938){while(--_0x5da938){_0x53f3a4['push'](_0x53f3a4['shift']());}};_0x95276a(++_0x45671e);}(_0xeca3,0x99));var _0x3eca=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xeca3[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0x3eca('0x0'));var util=require(_0x3eca('0x1'));var path=require(_0x3eca('0x2'));var timeout=require(_0x3eca('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3eca('0x4'));var interaction=require(_0x3eca('0x5'));var config=require(_0x3eca('0x6'));var controller=require(_0x3eca('0x7'));router[_0x3eca('0x8')]('/',auth[_0x3eca('0x9')](),controller['index']);router[_0x3eca('0x8')](_0x3eca('0xa'),auth[_0x3eca('0x9')](),controller[_0x3eca('0xb')]);router[_0x3eca('0x8')](_0x3eca('0xc'),auth[_0x3eca('0x9')](),controller['getConfigurations']);router[_0x3eca('0x8')](_0x3eca('0xd'),auth[_0x3eca('0x9')](),controller['getFields']);router[_0x3eca('0xe')]('/',auth[_0x3eca('0x9')](),controller[_0x3eca('0xf')]);router['post'](_0x3eca('0xc'),auth[_0x3eca('0x9')](),controller['addConfiguration']);router[_0x3eca('0x10')]('/:id',auth[_0x3eca('0x9')](),controller[_0x3eca('0x11')]);router[_0x3eca('0x12')]('/:id',auth[_0x3eca('0x9')](),controller[_0x3eca('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3dd3=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x49cd4c,_0x1c3aee){var _0x470ee5=function(_0x365446){while(--_0x365446){_0x49cd4c['push'](_0x49cd4c['shift']());}};_0x470ee5(++_0x1c3aee);}(_0x3dd3,0x185));var _0x33dd=function(_0x1bd413,_0x362007){_0x1bd413=_0x1bd413-0x0;var _0x4c853f=_0x3dd3[_0x1bd413];return _0x4c853f;};'use strict';var multer=require(_0x33dd('0x0'));var util=require(_0x33dd('0x1'));var path=require(_0x33dd('0x2'));var timeout=require(_0x33dd('0x3'));var express=require(_0x33dd('0x4'));var router=express[_0x33dd('0x5')]();var auth=require(_0x33dd('0x6'));var interaction=require(_0x33dd('0x7'));var config=require('../../config/environment');var controller=require('./intSalesforceAccount.controller');router[_0x33dd('0x8')]('/',auth[_0x33dd('0x9')](),controller['index']);router[_0x33dd('0x8')](_0x33dd('0xa'),auth['isAuthenticated'](),controller[_0x33dd('0xb')]);router[_0x33dd('0x8')](_0x33dd('0xc'),auth[_0x33dd('0x9')](),controller[_0x33dd('0xd')]);router['get'](_0x33dd('0xe'),auth[_0x33dd('0x9')](),controller['getFields']);router[_0x33dd('0xf')]('/',auth[_0x33dd('0x9')](),controller[_0x33dd('0x10')]);router[_0x33dd('0xf')](_0x33dd('0xc'),auth[_0x33dd('0x9')](),controller['addConfiguration']);router[_0x33dd('0x11')]('/:id',auth[_0x33dd('0x9')](),controller['update']);router['delete']('/:id',auth[_0x33dd('0x9')](),controller['destroy']);module[_0x33dd('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index b9fc3c6..66bed6e 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 _0x675b=['STRING','username','integrationTab','newTab','sequelize','exports'];(function(_0x5b6a01,_0x4378be){var _0x4a0331=function(_0x11d998){while(--_0x11d998){_0x5b6a01['push'](_0x5b6a01['shift']());}};_0x4a0331(++_0x4378be);}(_0x675b,0xb2));var _0xb675=function(_0x4b64ae,_0xc4cd1b){_0x4b64ae=_0x4b64ae-0x0;var _0x29246b=_0x675b[_0x4b64ae];return _0x29246b;};'use strict';var Sequelize=require(_0xb675('0x0'));module[_0xb675('0x1')]={'name':{'type':Sequelize[_0xb675('0x2')]},'description':{'type':Sequelize[_0xb675('0x2')]},'username':{'type':Sequelize[_0xb675('0x2')],'unique':_0xb675('0x3')},'remoteUri':{'type':Sequelize[_0xb675('0x2')]},'password':{'type':Sequelize[_0xb675('0x2')]},'clientId':{'type':Sequelize[_0xb675('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb675('0x2')]},'type':{'type':Sequelize['ENUM'](_0xb675('0x4'),_0xb675('0x5')),'defaultValue':_0xb675('0x4')}}; \ No newline at end of file +var _0xb9f4=['sequelize','STRING','ENUM','integrationTab','newTab'];(function(_0x50f08f,_0x477116){var _0x19ab53=function(_0x391787){while(--_0x391787){_0x50f08f['push'](_0x50f08f['shift']());}};_0x19ab53(++_0x477116);}(_0xb9f4,0xff));var _0x4b9f=function(_0x3d12f3,_0x4be54a){_0x3d12f3=_0x3d12f3-0x0;var _0x50d40d=_0xb9f4[_0x3d12f3];return _0x50d40d;};'use strict';var Sequelize=require(_0x4b9f('0x0'));module['exports']={'name':{'type':Sequelize[_0x4b9f('0x1')]},'description':{'type':Sequelize[_0x4b9f('0x1')]},'username':{'type':Sequelize[_0x4b9f('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4b9f('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x4b9f('0x1')]},'clientSecret':{'type':Sequelize[_0x4b9f('0x1')]},'securityToken':{'type':Sequelize[_0x4b9f('0x1')]},'serverUrl':{'type':Sequelize[_0x4b9f('0x1')]},'type':{'type':Sequelize[_0x4b9f('0x2')](_0x4b9f('0x3'),_0x4b9f('0x4')),'defaultValue':_0x4b9f('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 4f32985..d840d74 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 _0xf27b=['request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','keys','query','filters','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','includeAll','include','catch','params','intersection','find','body','findOne','SalesforceConfiguration','order','map','length','nolimit','getConfigurations','addConfiguration','AccountId','getDescriptions','Descriptions','getFields','remoteUri','clientId','username','password','securityToken','slice','substring','lastIndexOf','concat','isNil','ticketType','sobject','describe','CallDurationInSeconds','CallObject','IsArchived','Priority','Status','Type','Case','Origin','Reason','custom','includes','label','picklistValues','value','boolean','True','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','ejs','squel','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','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceAccount,\x20%s,\x20%s'];(function(_0x35e344,_0x3448cf){var _0x159c3d=function(_0x90f268){while(--_0x90f268){_0x35e344['push'](_0x35e344['shift']());}};_0x159c3d(++_0x3448cf);}(_0xf27b,0x1db));var _0xbf27=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xf27b[_0xf51c06];return _0x1d5420;};'use strict';var pdf=require(_0xbf27('0x0'));var emlformat=require(_0xbf27('0x1'));var rimraf=require(_0xbf27('0x2'));var zipdir=require(_0xbf27('0x3'));var jsonpatch=require(_0xbf27('0x4'));var rp=require(_0xbf27('0x5'));var moment=require(_0xbf27('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xbf27('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbf27('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbf27('0x9'));var crypto=require('crypto');var jsforce=require(_0xbf27('0xa'));var deskjs=require(_0xbf27('0xb'));var toCsv=require(_0xbf27('0xc'));var querystring=require(_0xbf27('0xd'));var Papa=require(_0xbf27('0xe'));var Redis=require(_0xbf27('0xf'));var authService=require(_0xbf27('0x10'));var qs=require(_0xbf27('0x11'));var hardwareService=require(_0xbf27('0x12'));var logger=require(_0xbf27('0x13'))(_0xbf27('0x14'));var utils=require(_0xbf27('0x15'));var config=require(_0xbf27('0x16'));var db=require(_0xbf27('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xbf27('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x1d6cd3,_0x5d6ea8,_0x543f24){if(_0x543f24){var _0x4f2ece=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f2ece['test'](_0x5d6ea8)){return _0x1d6cd3;}else{throw new Error(_0xbf27('0x19'));}}else{return _0x1d6cd3;}}function respondWithRpcPromise(_0x4300a6,_0xf18936,_0x504860,_0x148dd5){return new BPromise(function(_0x17467b,_0xe9a395){var _0x568ee3=_0x148dd5||client;return _0x568ee3[_0xbf27('0x1a')](_0x4300a6,_0x504860)['then'](function(_0x2a7f74){logger[_0xbf27('0x1b')](_0xbf27('0x1c'),_0xf18936,_0xbf27('0x1d'));logger[_0xbf27('0x1e')](_0xbf27('0x1f'),_0xf18936,_0xbf27('0x1d'),JSON['stringify'](_0x2a7f74));if(_0x2a7f74[_0xbf27('0x20')]){if(_0x2a7f74[_0xbf27('0x20')]['code']===0x1f4){logger['error'](_0xbf27('0x1c'),_0xf18936,_0x2a7f74[_0xbf27('0x20')][_0xbf27('0x21')]);return _0xe9a395(_0x2a7f74[_0xbf27('0x20')]['message']);}logger[_0xbf27('0x20')](_0xbf27('0x1c'),_0xf18936,_0x2a7f74[_0xbf27('0x20')]['message']);return _0x17467b(_0x2a7f74['error'][_0xbf27('0x21')]);}else{logger[_0xbf27('0x1b')](_0xbf27('0x1c'),_0xf18936,_0xbf27('0x1d'));_0x17467b(_0x2a7f74['result'][_0xbf27('0x21')]);}})['catch'](function(_0x4dddfe){logger[_0xbf27('0x20')]('SalesforceAccount,\x20%s,\x20%s',_0xf18936,_0x4dddfe);_0xe9a395(_0x4dddfe);});});}function respondWithStatusCode(_0x5dee25,_0x4e1070){_0x4e1070=_0x4e1070||0xcc;return function(_0x14d200){if(_0x14d200){return _0x5dee25[_0xbf27('0x22')](_0x4e1070);}return _0x5dee25[_0xbf27('0x23')](_0x4e1070)[_0xbf27('0x24')]();};}function respondWithResult(_0x2e314a,_0x4c5d6b){_0x4c5d6b=_0x4c5d6b||0xc8;return function(_0x44994d){if(_0x44994d){return _0x2e314a['status'](_0x4c5d6b)['json'](_0x44994d);}};}function respondWithFilteredResult(_0x37851a,_0x42a1aa){return function(_0x65f12a){if(_0x65f12a){var _0x1977ff=_0x65f12a[_0xbf27('0x25')],_0x37faab=_0x42a1aa['offset'],_0x11dbe6=_0x42a1aa[_0xbf27('0x26')]+_0x42a1aa[_0xbf27('0x27')],_0x57723e;if(_0x11dbe6>=_0x1977ff){_0x11dbe6=_0x1977ff;_0x57723e=0xc8;}else{_0x57723e=0xce;}_0x37851a[_0xbf27('0x23')](_0x57723e);return _0x37851a[_0xbf27('0x28')](_0xbf27('0x29'),_0x37faab+'-'+_0x11dbe6+'/'+_0x1977ff)[_0xbf27('0x2a')](_0x65f12a);}return null;};}function patchUpdates(_0xe32e27){return function(_0x4ff621){try{jsonpatch[_0xbf27('0x2b')](_0x4ff621,_0xe32e27,!![]);}catch(_0x2300fa){return BPromise[_0xbf27('0x2c')](_0x2300fa);}return _0x4ff621[_0xbf27('0x2d')]();};}function saveUpdates(_0x2d06ee,_0x7e88c6){return function(_0xa2ade7){if(_0xa2ade7){return _0xa2ade7[_0xbf27('0x2e')](_0x2d06ee)[_0xbf27('0x2f')](function(_0x37e443){return _0x37e443;});}return null;};}function removeEntity(_0x1eb348,_0x2fab32){return function(_0x2898ec){if(_0x2898ec){return _0x2898ec[_0xbf27('0x30')]()['then'](function(){_0x1eb348[_0xbf27('0x23')](0xcc)[_0xbf27('0x24')]();});}};}function handleEntityNotFound(_0x1695ab,_0x51b6c7){return function(_0x5bd473){if(!_0x5bd473){_0x1695ab[_0xbf27('0x22')](0x194);}return _0x5bd473;};}function handleError(_0x2c6a08,_0x36497b){_0x36497b=_0x36497b||0x1f4;return function(_0x403ecb){logger[_0xbf27('0x20')](_0x403ecb[_0xbf27('0x31')]);if(_0x403ecb[_0xbf27('0x32')]){delete _0x403ecb['name'];}_0x2c6a08[_0xbf27('0x23')](_0x36497b)[_0xbf27('0x33')](_0x403ecb);};}exports[_0xbf27('0x34')]=function(_0x292e90,_0xe59dd9){var _0x2fd0ae={},_0x34363c={},_0x37e1ea={'count':0x0,'rows':[]};var _0x2d77fe=db[_0xbf27('0x35')][_0xbf27('0x36')];_0x34363c['model']=_[_0xbf27('0x37')](_0x2d77fe);_0x34363c['query']=_['keys'](_0x292e90[_0xbf27('0x38')]);_0x34363c[_0xbf27('0x39')]=_['intersection'](_0x34363c[_0xbf27('0x3a')],_0x34363c[_0xbf27('0x38')]);_0x2fd0ae['attributes']=_['intersection'](_0x34363c[_0xbf27('0x3a')],qs['fields'](_0x292e90['query'][_0xbf27('0x3b')]));_0x2fd0ae[_0xbf27('0x3c')]=_0x2fd0ae[_0xbf27('0x3c')]['length']?_0x2fd0ae[_0xbf27('0x3c')]:_0x34363c[_0xbf27('0x3a')];if(!_0x292e90[_0xbf27('0x38')][_0xbf27('0x3d')]('nolimit')){_0x2fd0ae['limit']=qs[_0xbf27('0x27')](_0x292e90['query'][_0xbf27('0x27')]);_0x2fd0ae['offset']=qs[_0xbf27('0x26')](_0x292e90[_0xbf27('0x38')][_0xbf27('0x26')]);}_0x2fd0ae['order']=qs[_0xbf27('0x3e')](_0x292e90[_0xbf27('0x38')][_0xbf27('0x3e')]);_0x2fd0ae[_0xbf27('0x3f')]=qs[_0xbf27('0x39')](_[_0xbf27('0x40')](_0x292e90[_0xbf27('0x38')],_0x34363c[_0xbf27('0x39')]));if(_0x292e90[_0xbf27('0x38')][_0xbf27('0x41')]){_0x2fd0ae[_0xbf27('0x3f')]=_[_0xbf27('0x42')](_0x2fd0ae[_0xbf27('0x3f')],{'$or':_['map'](_0x2d77fe,function(_0x2ebf2e){if(_0x2ebf2e[_0xbf27('0x43')][_0xbf27('0x44')]!==_0xbf27('0x45')){var _0x2e5c9a={};_0x2e5c9a[_0x2ebf2e[_0xbf27('0x46')]]={'$like':'%'+_0x292e90[_0xbf27('0x38')][_0xbf27('0x41')]+'%'};return _0x2e5c9a;}})});}_0x2fd0ae=_[_0xbf27('0x42')]({},_0x2fd0ae,_0x292e90[_0xbf27('0x47')]);var _0x322446={'where':_0x2fd0ae[_0xbf27('0x3f')]};return db[_0xbf27('0x35')][_0xbf27('0x25')](_0x322446)[_0xbf27('0x2f')](function(_0x47aec){_0x37e1ea[_0xbf27('0x25')]=_0x47aec;if(_0x292e90[_0xbf27('0x38')][_0xbf27('0x48')]){_0x2fd0ae[_0xbf27('0x49')]=[{'all':!![]}];}return db[_0xbf27('0x35')]['findAll'](_0x2fd0ae);})[_0xbf27('0x2f')](function(_0x3c2b52){_0x37e1ea['rows']=_0x3c2b52;return _0x37e1ea;})['then'](respondWithFilteredResult(_0xe59dd9,_0x2fd0ae))[_0xbf27('0x4a')](handleError(_0xe59dd9,null));};exports['show']=function(_0x7b67e,_0x406d7c){var _0x1bc78a={'raw':![],'where':{'id':_0x7b67e[_0xbf27('0x4b')]['id']}},_0x38d8ed={};_0x38d8ed[_0xbf27('0x3a')]=_[_0xbf27('0x37')](db[_0xbf27('0x35')][_0xbf27('0x36')]);_0x38d8ed[_0xbf27('0x38')]=_[_0xbf27('0x37')](_0x7b67e[_0xbf27('0x38')]);_0x38d8ed[_0xbf27('0x39')]=_[_0xbf27('0x4c')](_0x38d8ed[_0xbf27('0x3a')],_0x38d8ed[_0xbf27('0x38')]);_0x1bc78a[_0xbf27('0x3c')]=_[_0xbf27('0x4c')](_0x38d8ed[_0xbf27('0x3a')],qs[_0xbf27('0x3b')](_0x7b67e[_0xbf27('0x38')][_0xbf27('0x3b')]));_0x1bc78a[_0xbf27('0x3c')]=_0x1bc78a[_0xbf27('0x3c')]['length']?_0x1bc78a[_0xbf27('0x3c')]:_0x38d8ed[_0xbf27('0x3a')];if(_0x7b67e[_0xbf27('0x38')][_0xbf27('0x48')]){_0x1bc78a['include']=[{'all':!![]}];}_0x1bc78a=_[_0xbf27('0x42')]({},_0x1bc78a,_0x7b67e[_0xbf27('0x47')]);return db['SalesforceAccount'][_0xbf27('0x4d')](_0x1bc78a)[_0xbf27('0x2f')](handleEntityNotFound(_0x406d7c,null))[_0xbf27('0x2f')](respondWithResult(_0x406d7c,null))[_0xbf27('0x4a')](handleError(_0x406d7c,null));};exports['create']=function(_0x30f2bd,_0x3a413e){return db[_0xbf27('0x35')]['create'](_0x30f2bd[_0xbf27('0x4e')],{})[_0xbf27('0x2f')](respondWithResult(_0x3a413e,0xc9))[_0xbf27('0x4a')](handleError(_0x3a413e,null));};exports[_0xbf27('0x2e')]=function(_0x58b480,_0x4c3723){if(_0x58b480['body']['id']){delete _0x58b480[_0xbf27('0x4e')]['id'];}return db[_0xbf27('0x35')][_0xbf27('0x4d')]({'where':{'id':_0x58b480['params']['id']}})[_0xbf27('0x2f')](handleEntityNotFound(_0x4c3723,null))[_0xbf27('0x2f')](saveUpdates(_0x58b480[_0xbf27('0x4e')],null))[_0xbf27('0x2f')](respondWithResult(_0x4c3723,null))[_0xbf27('0x4a')](handleError(_0x4c3723,null));};exports[_0xbf27('0x30')]=function(_0x5ec8d1,_0x66ee28){return db[_0xbf27('0x35')][_0xbf27('0x4d')]({'where':{'id':_0x5ec8d1[_0xbf27('0x4b')]['id']}})['then'](handleEntityNotFound(_0x66ee28,null))[_0xbf27('0x2f')](removeEntity(_0x66ee28,null))[_0xbf27('0x4a')](handleError(_0x66ee28,null));};exports['getConfigurations']=function(_0x4a523c,_0x389bbc,_0x1a9bd6){var _0x581942={};var _0x40e6f0={};var _0x23bbab;var _0x14bbde;return db[_0xbf27('0x35')][_0xbf27('0x4f')]({'where':{'id':_0x4a523c[_0xbf27('0x4b')]['id']}})[_0xbf27('0x2f')](handleEntityNotFound(_0x389bbc,null))[_0xbf27('0x2f')](function(_0x38a901){if(_0x38a901){_0x23bbab=_0x38a901;_0x40e6f0['model']=_['keys'](db[_0xbf27('0x50')][_0xbf27('0x36')]);_0x40e6f0[_0xbf27('0x38')]=_[_0xbf27('0x37')](_0x4a523c[_0xbf27('0x38')]);_0x40e6f0[_0xbf27('0x39')]=_[_0xbf27('0x4c')](_0x40e6f0[_0xbf27('0x3a')],_0x40e6f0[_0xbf27('0x38')]);_0x581942[_0xbf27('0x3c')]=_[_0xbf27('0x4c')](_0x40e6f0[_0xbf27('0x3a')],qs[_0xbf27('0x3b')](_0x4a523c['query']['fields']));_0x581942[_0xbf27('0x3c')]=_0x581942[_0xbf27('0x3c')]['length']?_0x581942[_0xbf27('0x3c')]:_0x40e6f0[_0xbf27('0x3a')];_0x581942[_0xbf27('0x51')]=qs['sort'](_0x4a523c[_0xbf27('0x38')]['sort']);_0x581942['where']=qs[_0xbf27('0x39')](_[_0xbf27('0x40')](_0x4a523c[_0xbf27('0x38')],_0x40e6f0[_0xbf27('0x39')]));if(_0x4a523c['query']['filter']){_0x581942[_0xbf27('0x3f')]=_[_0xbf27('0x42')](_0x581942[_0xbf27('0x3f')],{'$or':_[_0xbf27('0x52')](_0x581942[_0xbf27('0x3c')],function(_0x11cd34){var _0x4978aa={};_0x4978aa[_0x11cd34]={'$like':'%'+_0x4a523c[_0xbf27('0x38')][_0xbf27('0x41')]+'%'};return _0x4978aa;})});}_0x581942=_[_0xbf27('0x42')]({},_0x581942,_0x4a523c[_0xbf27('0x47')]);return _0x23bbab['getConfigurations'](_0x581942);}})['then'](function(_0x13353d){if(_0x13353d){_0x14bbde=_0x13353d[_0xbf27('0x53')];if(!_0x4a523c['query'][_0xbf27('0x3d')](_0xbf27('0x54'))){_0x581942[_0xbf27('0x27')]=qs[_0xbf27('0x27')](_0x4a523c[_0xbf27('0x38')]['limit']);_0x581942['offset']=qs[_0xbf27('0x26')](_0x4a523c[_0xbf27('0x38')]['offset']);}return _0x23bbab[_0xbf27('0x55')](_0x581942);}})['then'](function(_0x45f4ec){if(_0x45f4ec){return _0x45f4ec?{'count':_0x14bbde,'rows':_0x45f4ec}:null;}})[_0xbf27('0x2f')](respondWithResult(_0x389bbc,null))[_0xbf27('0x4a')](handleError(_0x389bbc,null));};exports[_0xbf27('0x56')]=function(_0xce9cd9,_0x4881ee,_0x51510f){if(_0xce9cd9[_0xbf27('0x4e')]['id']){delete _0xce9cd9['body']['id'];}return db[_0xbf27('0x35')][_0xbf27('0x4f')]({'where':{'id':_0xce9cd9[_0xbf27('0x4b')]['id']}})[_0xbf27('0x2f')](handleEntityNotFound(_0x4881ee,null))[_0xbf27('0x2f')](function(_0x138c60){if(_0x138c60){_0xce9cd9['body'][_0xbf27('0x57')]=_0x138c60['id'];_0xce9cd9[_0xbf27('0x4e')]['Subjects']=integrations['getSubjects'](_0xce9cd9[_0xbf27('0x4e')]['channel'],_0xce9cd9['body'][_0xbf27('0x43')]);_0xce9cd9['body']['Descriptions']=integrations[_0xbf27('0x58')](_0xce9cd9[_0xbf27('0x4e')]['channel'],_0xce9cd9[_0xbf27('0x4e')][_0xbf27('0x43')]);return db[_0xbf27('0x50')]['create'](_0xce9cd9['body'],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0xbf27('0x59')}]});}return null;})[_0xbf27('0x2f')](respondWithResult(_0x4881ee,null))[_0xbf27('0x4a')](handleError(_0x4881ee,null));};exports[_0xbf27('0x5a')]=function(_0x5b9510,_0x15a7f3,_0x1b06e4){var _0x329cd7;var _0x515121='';var _0x112621='Task';return db['SalesforceAccount'][_0xbf27('0x4f')]({'where':{'id':_0x5b9510[_0xbf27('0x4b')]['id']},'attributes':['id',_0xbf27('0x5b'),_0xbf27('0x5c'),'clientSecret',_0xbf27('0x5d'),_0xbf27('0x5e'),_0xbf27('0x5f')]})[_0xbf27('0x2f')](handleEntityNotFound(_0x15a7f3,null))[_0xbf27('0x2f')](function(_0x2fdb5f){if(_0x2fdb5f){_0x515121=_0x2fdb5f[_0xbf27('0x5b')];var _0x2f3812=_0x515121[_0xbf27('0x60')](-0x1);if(_0x2f3812==='/'){_0x515121=_0x515121[_0xbf27('0x61')](0x0,_0x515121[_0xbf27('0x62')](_0x2f3812));}_0x329cd7=new jsforce['Connection']({'oauth2':{'loginUrl':_0x515121,'clientId':_0x2fdb5f[_0xbf27('0x5c')],'clientSecret':_0x2fdb5f['clientSecret']}});return _0x329cd7['login'](_0x2fdb5f[_0xbf27('0x5d')],_0x2fdb5f[_0xbf27('0x5e')][_0xbf27('0x63')](_0x2fdb5f['securityToken']));}})[_0xbf27('0x2f')](function(_0x512953){if(_0x512953){if(!_[_0xbf27('0x64')](_0x5b9510['query'][_0xbf27('0x65')])){_0x112621=_0x5b9510[_0xbf27('0x38')][_0xbf27('0x65')];}return _0x329cd7[_0xbf27('0x66')](_0x112621)[_0xbf27('0x67')]();}})['then'](function(_0x232c3e){var _0x3f8dec=['CallDisposition',_0xbf27('0x68'),_0xbf27('0x69'),'CallType',_0xbf27('0x6a'),_0xbf27('0x6b'),_0xbf27('0x6c'),_0xbf27('0x6d')];if(!_[_0xbf27('0x64')](_0x5b9510[_0xbf27('0x38')][_0xbf27('0x65')])&&_0x5b9510[_0xbf27('0x38')][_0xbf27('0x65')]===_0xbf27('0x6e')){_0x3f8dec=[_0xbf27('0x6d'),_0xbf27('0x6f'),_0xbf27('0x70'),'Status',_0xbf27('0x6b'),'IsEscalated','SuppliedName','SuppliedCompany'];}if(_0x232c3e){_['remove'](_0x232c3e[_0xbf27('0x3b')],function(_0x406b1d){return _0x406b1d[_0xbf27('0x71')]===![]&&!_0x3f8dec[_0xbf27('0x72')](_0x406b1d[_0xbf27('0x32')]);});return{'count':_0x232c3e[_0xbf27('0x3b')][_0xbf27('0x53')],'rows':_[_0xbf27('0x52')](_0x232c3e['fields'],function(_0x62e097){return{'id':_0x62e097[_0xbf27('0x32')],'name':_0x62e097[_0xbf27('0x73')],'custom':_0x62e097[_0xbf27('0x71')],'options':_0x62e097[_0xbf27('0x74')][_0xbf27('0x53')]>0x0?_[_0xbf27('0x52')](_0x62e097[_0xbf27('0x74')],function(_0x19866c){return{'name':_0x19866c['label'],'value':_0x19866c[_0xbf27('0x75')]};}):_0x62e097[_0xbf27('0x43')]==_0xbf27('0x76')?[{'name':_0xbf27('0x77'),'value':'true'},{'name':'False','value':_0xbf27('0x78')}]:[]};})};}})['then'](respondWithResult(_0x15a7f3,null))[_0xbf27('0x4a')](function(_0x130ab2){var _0x1efc0b=_0x5b9510[_0xbf27('0x38')]['test']?0x1f4:_0x130ab2[_0xbf27('0x79')]||0x1f4;logger[_0xbf27('0x20')](_0xbf27('0x7a'),_0xbf27('0x5a'),_0x1efc0b,JSON[_0xbf27('0x7b')](_0x130ab2));delete _0x130ab2[_0xbf27('0x32')];if(_0x1efc0b===0x191){_0x1efc0b=0x190;}_0x15a7f3[_0xbf27('0x23')](_0x1efc0b)[_0xbf27('0x33')](_0x5b9510[_0xbf27('0x38')][_0xbf27('0x7c')]?{'message':_0xbf27('0x7d'),'statusCode':_0x130ab2[_0xbf27('0x79')]}:_0x130ab2);});}; \ No newline at end of file +var _0xedd1=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','save','update','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','model','keys','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','map','type','field','options','includeAll','include','findAll','rows','catch','params','merge','find','create','body','getConfigurations','findOne','SalesforceConfiguration','hasOwnProperty','addConfiguration','Subjects','getSubjects','getDescriptions','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','username','securityToken','slice','Connection','clientSecret','password','concat','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Status','Type','Case','Origin','Reason','IsEscalated','SuppliedCompany','remove','custom','includes','label','picklistValues','boolean','True','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x288dbc,_0x422195){var _0x547988=function(_0x3c66d2){while(--_0x3c66d2){_0x288dbc['push'](_0x288dbc['shift']());}};_0x547988(++_0x422195);}(_0xedd1,0xf2));var _0x1edd=function(_0x5775c4,_0x11631c){_0x5775c4=_0x5775c4-0x0;var _0xa2e3a1=_0xedd1[_0x5775c4];return _0xa2e3a1;};'use strict';var pdf=require(_0x1edd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1edd('0x1'));var zipdir=require(_0x1edd('0x2'));var jsonpatch=require(_0x1edd('0x3'));var rp=require(_0x1edd('0x4'));var moment=require(_0x1edd('0x5'));var BPromise=require(_0x1edd('0x6'));var Mustache=require(_0x1edd('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1edd('0x8'));var ejs=require(_0x1edd('0x9'));var fs=require('fs');var _=require(_0x1edd('0xa'));var squel=require(_0x1edd('0xb'));var crypto=require('crypto');var jsforce=require(_0x1edd('0xc'));var deskjs=require(_0x1edd('0xd'));var toCsv=require(_0x1edd('0x8'));var querystring=require('querystring');var Papa=require(_0x1edd('0xe'));var Redis=require(_0x1edd('0xf'));var authService=require(_0x1edd('0x10'));var qs=require(_0x1edd('0x11'));var hardwareService=require(_0x1edd('0x12'));var logger=require(_0x1edd('0x13'))(_0x1edd('0x14'));var utils=require(_0x1edd('0x15'));var config=require(_0x1edd('0x16'));var db=require(_0x1edd('0x17'))['db'];var integrations=require(_0x1edd('0x18'));var jayson=require(_0x1edd('0x19'));var client=jayson['client'][_0x1edd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x17f6e7,_0x5843cc,_0x5a76e2){if(_0x5a76e2){var _0x5286de=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5286de[_0x1edd('0x1b')](_0x5843cc)){return _0x17f6e7;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17f6e7;}}function respondWithRpcPromise(_0x415975,_0x3d4e30,_0x1a3d3b,_0x536b43){return new BPromise(function(_0x190bc8,_0x19d479){var _0xa32634=_0x536b43||client;return _0xa32634[_0x1edd('0x1c')](_0x415975,_0x1a3d3b)[_0x1edd('0x1d')](function(_0x480a55){logger[_0x1edd('0x1e')](_0x1edd('0x1f'),_0x3d4e30,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x3d4e30,_0x1edd('0x20'),JSON[_0x1edd('0x21')](_0x480a55));if(_0x480a55[_0x1edd('0x22')]){if(_0x480a55[_0x1edd('0x22')]['code']===0x1f4){logger['error'](_0x1edd('0x1f'),_0x3d4e30,_0x480a55['error'][_0x1edd('0x23')]);return _0x19d479(_0x480a55[_0x1edd('0x22')][_0x1edd('0x23')]);}logger[_0x1edd('0x22')](_0x1edd('0x1f'),_0x3d4e30,_0x480a55['error'][_0x1edd('0x23')]);return _0x190bc8(_0x480a55['error']['message']);}else{logger['info'](_0x1edd('0x1f'),_0x3d4e30,_0x1edd('0x20'));_0x190bc8(_0x480a55[_0x1edd('0x24')][_0x1edd('0x23')]);}})['catch'](function(_0x986755){logger[_0x1edd('0x22')]('SalesforceAccount,\x20%s,\x20%s',_0x3d4e30,_0x986755);_0x19d479(_0x986755);});});}function respondWithStatusCode(_0x133a33,_0x489121){_0x489121=_0x489121||0xcc;return function(_0x4c81e5){if(_0x4c81e5){return _0x133a33[_0x1edd('0x25')](_0x489121);}return _0x133a33[_0x1edd('0x26')](_0x489121)[_0x1edd('0x27')]();};}function respondWithResult(_0x3399fb,_0x1420ce){_0x1420ce=_0x1420ce||0xc8;return function(_0x2cdbf7){if(_0x2cdbf7){return _0x3399fb[_0x1edd('0x26')](_0x1420ce)['json'](_0x2cdbf7);}};}function respondWithFilteredResult(_0x5a5d80,_0x3523bd){return function(_0x194db7){if(_0x194db7){var _0x21701a=_0x194db7[_0x1edd('0x28')],_0x39faae=_0x3523bd[_0x1edd('0x29')],_0xc3e989=_0x3523bd[_0x1edd('0x29')]+_0x3523bd[_0x1edd('0x2a')],_0x59ef54;if(_0xc3e989>=_0x21701a){_0xc3e989=_0x21701a;_0x59ef54=0xc8;}else{_0x59ef54=0xce;}_0x5a5d80[_0x1edd('0x26')](_0x59ef54);return _0x5a5d80[_0x1edd('0x2b')](_0x1edd('0x2c'),_0x39faae+'-'+_0xc3e989+'/'+_0x21701a)['json'](_0x194db7);}return null;};}function patchUpdates(_0x49c00a){return function(_0x14f09b){try{jsonpatch['apply'](_0x14f09b,_0x49c00a,!![]);}catch(_0x31ca8d){return BPromise['reject'](_0x31ca8d);}return _0x14f09b[_0x1edd('0x2d')]();};}function saveUpdates(_0x2cd117,_0x2c17ef){return function(_0x2a84c8){if(_0x2a84c8){return _0x2a84c8[_0x1edd('0x2e')](_0x2cd117)[_0x1edd('0x1d')](function(_0x31635b){return _0x31635b;});}return null;};}function removeEntity(_0xbbce0a,_0x58c60d){return function(_0x6c3fac){if(_0x6c3fac){return _0x6c3fac[_0x1edd('0x2f')]()[_0x1edd('0x1d')](function(){_0xbbce0a[_0x1edd('0x26')](0xcc)[_0x1edd('0x27')]();});}};}function handleEntityNotFound(_0x4e24ad,_0x4df78e){return function(_0x519458){if(!_0x519458){_0x4e24ad['sendStatus'](0x194);}return _0x519458;};}function handleError(_0x5b3b7d,_0x24455f){_0x24455f=_0x24455f||0x1f4;return function(_0x372f4b){logger['error'](_0x372f4b[_0x1edd('0x30')]);if(_0x372f4b[_0x1edd('0x31')]){delete _0x372f4b[_0x1edd('0x31')];}_0x5b3b7d[_0x1edd('0x26')](_0x24455f)[_0x1edd('0x32')](_0x372f4b);};}exports[_0x1edd('0x33')]=function(_0x1b6f9d,_0x303a38){var _0x37f3b2={},_0x259cea={},_0x404bf4={'count':0x0,'rows':[]};var _0x54c024=db[_0x1edd('0x34')][_0x1edd('0x35')];_0x259cea[_0x1edd('0x36')]=_[_0x1edd('0x37')](_0x54c024);_0x259cea['query']=_[_0x1edd('0x37')](_0x1b6f9d[_0x1edd('0x38')]);_0x259cea['filters']=_[_0x1edd('0x39')](_0x259cea[_0x1edd('0x36')],_0x259cea[_0x1edd('0x38')]);_0x37f3b2[_0x1edd('0x3a')]=_[_0x1edd('0x39')](_0x259cea['model'],qs[_0x1edd('0x3b')](_0x1b6f9d[_0x1edd('0x38')]['fields']));_0x37f3b2[_0x1edd('0x3a')]=_0x37f3b2[_0x1edd('0x3a')][_0x1edd('0x3c')]?_0x37f3b2[_0x1edd('0x3a')]:_0x259cea[_0x1edd('0x36')];if(!_0x1b6f9d[_0x1edd('0x38')]['hasOwnProperty'](_0x1edd('0x3d'))){_0x37f3b2[_0x1edd('0x2a')]=qs[_0x1edd('0x2a')](_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x2a')]);_0x37f3b2['offset']=qs[_0x1edd('0x29')](_0x1b6f9d[_0x1edd('0x38')]['offset']);}_0x37f3b2['order']=qs['sort'](_0x1b6f9d['query'][_0x1edd('0x3e')]);_0x37f3b2[_0x1edd('0x3f')]=qs[_0x1edd('0x40')](_[_0x1edd('0x41')](_0x1b6f9d[_0x1edd('0x38')],_0x259cea[_0x1edd('0x40')]));if(_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x42')]){_0x37f3b2[_0x1edd('0x3f')]=_['merge'](_0x37f3b2['where'],{'$or':_[_0x1edd('0x43')](_0x54c024,function(_0x24cd43){if(_0x24cd43[_0x1edd('0x44')]['key']!=='VIRTUAL'){var _0x1bbdaf={};_0x1bbdaf[_0x24cd43[_0x1edd('0x45')]]={'$like':'%'+_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x42')]+'%'};return _0x1bbdaf;}})});}_0x37f3b2=_['merge']({},_0x37f3b2,_0x1b6f9d[_0x1edd('0x46')]);var _0x4966ea={'where':_0x37f3b2[_0x1edd('0x3f')]};return db[_0x1edd('0x34')][_0x1edd('0x28')](_0x4966ea)[_0x1edd('0x1d')](function(_0x488c07){_0x404bf4[_0x1edd('0x28')]=_0x488c07;if(_0x1b6f9d[_0x1edd('0x38')][_0x1edd('0x47')]){_0x37f3b2[_0x1edd('0x48')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x1edd('0x49')](_0x37f3b2);})['then'](function(_0xdad261){_0x404bf4[_0x1edd('0x4a')]=_0xdad261;return _0x404bf4;})[_0x1edd('0x1d')](respondWithFilteredResult(_0x303a38,_0x37f3b2))[_0x1edd('0x4b')](handleError(_0x303a38,null));};exports['show']=function(_0x4b81ec,_0x4efea6){var _0x1d038a={'raw':![],'where':{'id':_0x4b81ec[_0x1edd('0x4c')]['id']}},_0xfe287d={};_0xfe287d[_0x1edd('0x36')]=_['keys'](db[_0x1edd('0x34')][_0x1edd('0x35')]);_0xfe287d[_0x1edd('0x38')]=_[_0x1edd('0x37')](_0x4b81ec[_0x1edd('0x38')]);_0xfe287d[_0x1edd('0x40')]=_[_0x1edd('0x39')](_0xfe287d[_0x1edd('0x36')],_0xfe287d[_0x1edd('0x38')]);_0x1d038a['attributes']=_[_0x1edd('0x39')](_0xfe287d[_0x1edd('0x36')],qs[_0x1edd('0x3b')](_0x4b81ec['query'][_0x1edd('0x3b')]));_0x1d038a[_0x1edd('0x3a')]=_0x1d038a[_0x1edd('0x3a')]['length']?_0x1d038a['attributes']:_0xfe287d[_0x1edd('0x36')];if(_0x4b81ec['query']['includeAll']){_0x1d038a[_0x1edd('0x48')]=[{'all':!![]}];}_0x1d038a=_[_0x1edd('0x4d')]({},_0x1d038a,_0x4b81ec[_0x1edd('0x46')]);return db[_0x1edd('0x34')][_0x1edd('0x4e')](_0x1d038a)[_0x1edd('0x1d')](handleEntityNotFound(_0x4efea6,null))[_0x1edd('0x1d')](respondWithResult(_0x4efea6,null))[_0x1edd('0x4b')](handleError(_0x4efea6,null));};exports[_0x1edd('0x4f')]=function(_0xd73af3,_0x24960d){return db[_0x1edd('0x34')][_0x1edd('0x4f')](_0xd73af3[_0x1edd('0x50')],{})[_0x1edd('0x1d')](respondWithResult(_0x24960d,0xc9))['catch'](handleError(_0x24960d,null));};exports[_0x1edd('0x2e')]=function(_0x9f594e,_0x32f661){if(_0x9f594e['body']['id']){delete _0x9f594e[_0x1edd('0x50')]['id'];}return db[_0x1edd('0x34')][_0x1edd('0x4e')]({'where':{'id':_0x9f594e[_0x1edd('0x4c')]['id']}})[_0x1edd('0x1d')](handleEntityNotFound(_0x32f661,null))['then'](saveUpdates(_0x9f594e['body'],null))['then'](respondWithResult(_0x32f661,null))['catch'](handleError(_0x32f661,null));};exports['destroy']=function(_0x1161a0,_0x2758b4){return db['SalesforceAccount']['find']({'where':{'id':_0x1161a0['params']['id']}})['then'](handleEntityNotFound(_0x2758b4,null))['then'](removeEntity(_0x2758b4,null))[_0x1edd('0x4b')](handleError(_0x2758b4,null));};exports[_0x1edd('0x51')]=function(_0x1721dd,_0x11e4a8,_0x165185){var _0x1d72ca={};var _0x1f94e4={};var _0x45a012;var _0x2abb6a;return db[_0x1edd('0x34')][_0x1edd('0x52')]({'where':{'id':_0x1721dd[_0x1edd('0x4c')]['id']}})[_0x1edd('0x1d')](handleEntityNotFound(_0x11e4a8,null))[_0x1edd('0x1d')](function(_0x201550){if(_0x201550){_0x45a012=_0x201550;_0x1f94e4[_0x1edd('0x36')]=_[_0x1edd('0x37')](db[_0x1edd('0x53')][_0x1edd('0x35')]);_0x1f94e4['query']=_[_0x1edd('0x37')](_0x1721dd['query']);_0x1f94e4[_0x1edd('0x40')]=_[_0x1edd('0x39')](_0x1f94e4[_0x1edd('0x36')],_0x1f94e4[_0x1edd('0x38')]);_0x1d72ca[_0x1edd('0x3a')]=_[_0x1edd('0x39')](_0x1f94e4[_0x1edd('0x36')],qs['fields'](_0x1721dd[_0x1edd('0x38')]['fields']));_0x1d72ca[_0x1edd('0x3a')]=_0x1d72ca[_0x1edd('0x3a')][_0x1edd('0x3c')]?_0x1d72ca['attributes']:_0x1f94e4['model'];_0x1d72ca['order']=qs[_0x1edd('0x3e')](_0x1721dd['query'][_0x1edd('0x3e')]);_0x1d72ca[_0x1edd('0x3f')]=qs[_0x1edd('0x40')](_[_0x1edd('0x41')](_0x1721dd[_0x1edd('0x38')],_0x1f94e4[_0x1edd('0x40')]));if(_0x1721dd['query']['filter']){_0x1d72ca[_0x1edd('0x3f')]=_['merge'](_0x1d72ca[_0x1edd('0x3f')],{'$or':_[_0x1edd('0x43')](_0x1d72ca[_0x1edd('0x3a')],function(_0x3b2143){var _0x243264={};_0x243264[_0x3b2143]={'$like':'%'+_0x1721dd[_0x1edd('0x38')][_0x1edd('0x42')]+'%'};return _0x243264;})});}_0x1d72ca=_['merge']({},_0x1d72ca,_0x1721dd['options']);return _0x45a012['getConfigurations'](_0x1d72ca);}})[_0x1edd('0x1d')](function(_0x2d1431){if(_0x2d1431){_0x2abb6a=_0x2d1431[_0x1edd('0x3c')];if(!_0x1721dd[_0x1edd('0x38')][_0x1edd('0x54')](_0x1edd('0x3d'))){_0x1d72ca[_0x1edd('0x2a')]=qs['limit'](_0x1721dd[_0x1edd('0x38')]['limit']);_0x1d72ca[_0x1edd('0x29')]=qs['offset'](_0x1721dd[_0x1edd('0x38')][_0x1edd('0x29')]);}return _0x45a012['getConfigurations'](_0x1d72ca);}})[_0x1edd('0x1d')](function(_0x4d1710){if(_0x4d1710){return _0x4d1710?{'count':_0x2abb6a,'rows':_0x4d1710}:null;}})[_0x1edd('0x1d')](respondWithResult(_0x11e4a8,null))[_0x1edd('0x4b')](handleError(_0x11e4a8,null));};exports[_0x1edd('0x55')]=function(_0x4e0bbb,_0x20270e,_0xdd8575){if(_0x4e0bbb[_0x1edd('0x50')]['id']){delete _0x4e0bbb['body']['id'];}return db[_0x1edd('0x34')][_0x1edd('0x52')]({'where':{'id':_0x4e0bbb[_0x1edd('0x4c')]['id']}})[_0x1edd('0x1d')](handleEntityNotFound(_0x20270e,null))[_0x1edd('0x1d')](function(_0xac5bd2){if(_0xac5bd2){_0x4e0bbb[_0x1edd('0x50')]['AccountId']=_0xac5bd2['id'];_0x4e0bbb[_0x1edd('0x50')][_0x1edd('0x56')]=integrations[_0x1edd('0x57')](_0x4e0bbb[_0x1edd('0x50')]['channel'],_0x4e0bbb[_0x1edd('0x50')][_0x1edd('0x44')]);_0x4e0bbb[_0x1edd('0x50')]['Descriptions']=integrations[_0x1edd('0x58')](_0x4e0bbb['body'][_0x1edd('0x59')],_0x4e0bbb[_0x1edd('0x50')]['type']);return db['SalesforceConfiguration'][_0x1edd('0x4f')](_0x4e0bbb[_0x1edd('0x50')],{'include':[{'model':db[_0x1edd('0x5a')],'as':_0x1edd('0x56')},{'model':db['SalesforceField'],'as':_0x1edd('0x5b')}]});}return null;})[_0x1edd('0x1d')](respondWithResult(_0x20270e,null))[_0x1edd('0x4b')](handleError(_0x20270e,null));};exports[_0x1edd('0x5c')]=function(_0x2ed5eb,_0x1c8933,_0x239ca9){var _0xaeb178;var _0xd5f678='';var _0x3a0408=_0x1edd('0x5d');return db[_0x1edd('0x34')]['findOne']({'where':{'id':_0x2ed5eb[_0x1edd('0x4c')]['id']},'attributes':['id',_0x1edd('0x5e'),_0x1edd('0x5f'),'clientSecret',_0x1edd('0x60'),'password',_0x1edd('0x61')]})['then'](handleEntityNotFound(_0x1c8933,null))['then'](function(_0x404879){if(_0x404879){_0xd5f678=_0x404879[_0x1edd('0x5e')];var _0x5c621c=_0xd5f678[_0x1edd('0x62')](-0x1);if(_0x5c621c==='/'){_0xd5f678=_0xd5f678['substring'](0x0,_0xd5f678['lastIndexOf'](_0x5c621c));}_0xaeb178=new jsforce[(_0x1edd('0x63'))]({'oauth2':{'loginUrl':_0xd5f678,'clientId':_0x404879['clientId'],'clientSecret':_0x404879[_0x1edd('0x64')]}});return _0xaeb178['login'](_0x404879[_0x1edd('0x60')],_0x404879[_0x1edd('0x65')][_0x1edd('0x66')](_0x404879[_0x1edd('0x61')]));}})[_0x1edd('0x1d')](function(_0x48fcef){if(_0x48fcef){if(!_[_0x1edd('0x67')](_0x2ed5eb['query'][_0x1edd('0x68')])){_0x3a0408=_0x2ed5eb[_0x1edd('0x38')][_0x1edd('0x68')];}return _0xaeb178[_0x1edd('0x69')](_0x3a0408)['describe']();}})[_0x1edd('0x1d')](function(_0x3ee486){var _0x69acec=[_0x1edd('0x6a'),_0x1edd('0x6b'),_0x1edd('0x6c'),'CallType',_0x1edd('0x6d'),_0x1edd('0x6e'),_0x1edd('0x6f'),_0x1edd('0x70')];if(!_[_0x1edd('0x67')](_0x2ed5eb[_0x1edd('0x38')][_0x1edd('0x68')])&&_0x2ed5eb[_0x1edd('0x38')]['ticketType']===_0x1edd('0x71')){_0x69acec=[_0x1edd('0x70'),_0x1edd('0x72'),_0x1edd('0x73'),'Status',_0x1edd('0x6e'),_0x1edd('0x74'),'SuppliedName',_0x1edd('0x75')];}if(_0x3ee486){_[_0x1edd('0x76')](_0x3ee486['fields'],function(_0x4ee5e5){return _0x4ee5e5[_0x1edd('0x77')]===![]&&!_0x69acec[_0x1edd('0x78')](_0x4ee5e5[_0x1edd('0x31')]);});return{'count':_0x3ee486['fields']['length'],'rows':_[_0x1edd('0x43')](_0x3ee486[_0x1edd('0x3b')],function(_0x2506a9){return{'id':_0x2506a9[_0x1edd('0x31')],'name':_0x2506a9[_0x1edd('0x79')],'custom':_0x2506a9[_0x1edd('0x77')],'options':_0x2506a9[_0x1edd('0x7a')][_0x1edd('0x3c')]>0x0?_[_0x1edd('0x43')](_0x2506a9['picklistValues'],function(_0x3c2a58){return{'name':_0x3c2a58[_0x1edd('0x79')],'value':_0x3c2a58['value']};}):_0x2506a9[_0x1edd('0x44')]==_0x1edd('0x7b')?[{'name':_0x1edd('0x7c'),'value':_0x1edd('0x7d')},{'name':'False','value':_0x1edd('0x7e')}]:[]};})};}})['then'](respondWithResult(_0x1c8933,null))[_0x1edd('0x4b')](function(_0x541069){var _0x5495c0=_0x2ed5eb[_0x1edd('0x38')][_0x1edd('0x1b')]?0x1f4:_0x541069[_0x1edd('0x7f')]||0x1f4;logger[_0x1edd('0x22')](_0x1edd('0x80'),_0x1edd('0x5c'),_0x5495c0,JSON['stringify'](_0x541069));delete _0x541069[_0x1edd('0x31')];if(_0x5495c0===0x191){_0x5495c0=0x190;}_0x1c8933['status'](_0x5495c0)['send'](_0x2ed5eb['query'][_0x1edd('0x1b')]?{'message':_0x1edd('0x81'),'statusCode':_0x541069[_0x1edd('0x7f')]}:_0x541069);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 52c8b1f..1fd4edd 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 _0x0565=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_salesforce_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x0565,0xf2));var _0x5056=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x0565[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var moment=require(_0x5056('0x4'));var BPromise=require(_0x5056('0x5'));var rp=require(_0x5056('0x6'));var fs=require('fs');var path=require(_0x5056('0x7'));var rimraf=require(_0x5056('0x8'));var config=require(_0x5056('0x9'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x5056('0xa'));module[_0x5056('0xb')]=function(_0x1143df,_0x22afb7){return _0x1143df['define']('SalesforceAccount',attributes,{'tableName':_0x5056('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea28=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x542505,_0x5e1687){var _0x5b9924=function(_0x58aaa7){while(--_0x58aaa7){_0x542505['push'](_0x542505['shift']());}};_0x5b9924(++_0x5e1687);}(_0xea28,0x13a));var _0x8ea2=function(_0xba34f8,_0x2d5922){_0xba34f8=_0xba34f8-0x0;var _0x39c5b5=_0xea28[_0xba34f8];return _0x39c5b5;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));var integrations=require(_0x8ea2('0xa'));module['exports']=function(_0x29b82b,_0x435d78){return _0x29b82b[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'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 0b0533f..95d4f57 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 _0xb51a=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x11275f,_0x3aeaaa){var _0x2fa622=function(_0x2b0fb0){while(--_0x2b0fb0){_0x11275f['push'](_0x11275f['shift']());}};_0x2fa622(++_0x3aeaaa);}(_0xb51a,0x154));var _0xab51=function(_0x200813,_0x46fc8e){_0x200813=_0x200813-0x0;var _0x5ab1b2=_0xb51a[_0x200813];return _0x5ab1b2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab51('0x0'));var BPromise=require(_0xab51('0x1'));var rs=require(_0xab51('0x2'));var fs=require('fs');var Redis=require(_0xab51('0x3'));var db=require(_0xab51('0x4'))['db'];var utils=require(_0xab51('0x5'));var logger=require(_0xab51('0x6'))(_0xab51('0x7'));var config=require(_0xab51('0x8'));var jayson=require(_0xab51('0x9'));var client=jayson['client'][_0xab51('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x575b34,_0x479cc9,_0x237742){return new BPromise(function(_0x26db08,_0x38f98b){return client[_0xab51('0xb')](_0x575b34,_0x237742)[_0xab51('0xc')](function(_0x200d1c){logger[_0xab51('0xd')](_0xab51('0xe'),_0x479cc9,_0xab51('0xf'));logger[_0xab51('0x10')](_0xab51('0x11'),_0x479cc9,'request\x20sent',JSON[_0xab51('0x12')](_0x200d1c));if(_0x200d1c['error']){if(_0x200d1c[_0xab51('0x13')][_0xab51('0x14')]===0x1f4){logger['error'](_0xab51('0xe'),_0x479cc9,_0x200d1c[_0xab51('0x13')]['message']);return _0x38f98b(_0x200d1c[_0xab51('0x13')][_0xab51('0x15')]);}logger[_0xab51('0x13')](_0xab51('0xe'),_0x479cc9,_0x200d1c[_0xab51('0x13')]['message']);return _0x26db08(_0x200d1c[_0xab51('0x13')][_0xab51('0x15')]);}else{logger[_0xab51('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x479cc9,'request\x20sent');_0x26db08(_0x200d1c['result'][_0xab51('0x15')]);}})[_0xab51('0x16')](function(_0x1fa2b9){logger[_0xab51('0x13')](_0xab51('0xe'),_0x479cc9,_0x1fa2b9);_0x38f98b(_0x1fa2b9);});});}exports[_0xab51('0x17')]=function(_0xa19706){var _0x35e712=this;return new Promise(function(_0x146559,_0x1a1feb){return db['SalesforceAccount'][_0xab51('0x18')]({'raw':_0xa19706[_0xab51('0x19')]?_0xa19706[_0xab51('0x19')][_0xab51('0x1a')]===undefined?!![]:![]:!![],'where':_0xa19706[_0xab51('0x19')]?_0xa19706['options'][_0xab51('0x1b')]||null:null,'attributes':_0xa19706['options']?_0xa19706[_0xab51('0x19')][_0xab51('0x1c')]||null:null,'limit':_0xa19706[_0xab51('0x19')]?_0xa19706[_0xab51('0x19')][_0xab51('0x1d')]||null:null,'include':_0xa19706['options']?_0xa19706[_0xab51('0x19')][_0xab51('0x1e')]?_[_0xab51('0x1f')](_0xa19706[_0xab51('0x19')][_0xab51('0x1e')],function(_0x5027b5){return{'model':db[_0x5027b5[_0xab51('0x20')]],'as':_0x5027b5['as'],'attributes':_0x5027b5[_0xab51('0x1c')],'include':_0x5027b5[_0xab51('0x1e')]?_[_0xab51('0x1f')](_0x5027b5['include'],function(_0x2209ba){return{'model':db[_0x2209ba[_0xab51('0x20')]],'as':_0x2209ba['as'],'attributes':_0x2209ba[_0xab51('0x1c')],'include':_0x2209ba['include']?_['map'](_0x2209ba[_0xab51('0x1e')],function(_0x123954){return{'model':db[_0x123954[_0xab51('0x20')]],'as':_0x123954['as'],'attributes':_0x123954[_0xab51('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xab51('0xc')](function(_0x1682d7){logger['info']('GetSalesforceAccount',_0xa19706);logger['debug'](_0xab51('0x17'),_0xa19706,JSON[_0xab51('0x12')](_0x1682d7));_0x146559(_0x1682d7);})[_0xab51('0x16')](function(_0x5b3f23){logger[_0xab51('0x13')](_0xab51('0x17'),_0x5b3f23[_0xab51('0x15')],_0xa19706);_0x1a1feb(_0x35e712[_0xab51('0x13')](0x1f4,_0x5b3f23['message']));});});};exports[_0xab51('0x21')]=function(_0x29c7a0){var _0x3a6f17=this;return new Promise(function(_0x10ffc5,_0x1e2911){return db['SalesforceAccount'][_0xab51('0x22')]({'raw':_0x29c7a0[_0xab51('0x19')]?_0x29c7a0[_0xab51('0x19')][_0xab51('0x1a')]===undefined?!![]:![]:!![],'where':_0x29c7a0[_0xab51('0x19')]?_0x29c7a0['options']['where']||null:null,'attributes':_0x29c7a0[_0xab51('0x19')]?_0x29c7a0[_0xab51('0x19')][_0xab51('0x1c')]||null:null,'include':_0x29c7a0['options']?_0x29c7a0['options']['include']?_[_0xab51('0x1f')](_0x29c7a0[_0xab51('0x19')][_0xab51('0x1e')],function(_0x245f38){return{'model':db[_0x245f38['model']],'as':_0x245f38['as'],'attributes':_0x245f38['attributes'],'include':_0x245f38['include']?_[_0xab51('0x1f')](_0x245f38[_0xab51('0x1e')],function(_0x50d590){return{'model':db[_0x50d590['model']],'as':_0x50d590['as'],'attributes':_0x50d590[_0xab51('0x1c')],'include':_0x50d590[_0xab51('0x1e')]?_[_0xab51('0x1f')](_0x50d590['include'],function(_0xa654d9){return{'model':db[_0xa654d9[_0xab51('0x20')]],'as':_0xa654d9['as'],'attributes':_0xa654d9['attributes']};}):[]};}):[]};}):[]:[]})[_0xab51('0xc')](function(_0x313afc){logger['info'](_0xab51('0x21'),_0x29c7a0);logger[_0xab51('0x10')](_0xab51('0x21'),_0x29c7a0,JSON[_0xab51('0x12')](_0x313afc));_0x10ffc5(_0x313afc);})[_0xab51('0x16')](function(_0x542d77){logger['error'](_0xab51('0x21'),_0x542d77[_0xab51('0x15')],_0x29c7a0);_0x1e2911(_0x3a6f17['error'](0x1f4,_0x542d77[_0xab51('0x15')]));});});}; \ No newline at end of file +var _0xdecc=['ShowSalesforceAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','include','map','model','then','stringify'];(function(_0x2ae588,_0x11621e){var _0x442b9c=function(_0x4af107){while(--_0x4af107){_0x2ae588['push'](_0x2ae588['shift']());}};_0x442b9c(++_0x11621e);}(_0xdecc,0x1d7));var _0xcdec=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0xdecc[_0x261b8a];return _0x3455e8;};'use strict';var _=require(_0xcdec('0x0'));var util=require(_0xcdec('0x1'));var moment=require(_0xcdec('0x2'));var BPromise=require(_0xcdec('0x3'));var rs=require(_0xcdec('0x4'));var fs=require('fs');var Redis=require(_0xcdec('0x5'));var db=require(_0xcdec('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xcdec('0x7'))('rpc');var config=require(_0xcdec('0x8'));var jayson=require(_0xcdec('0x9'));var client=jayson[_0xcdec('0xa')][_0xcdec('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1578d5,_0x2bb273,_0x25c6f3){return new BPromise(function(_0x1ad4ff,_0x426e18){return client[_0xcdec('0xc')](_0x1578d5,_0x25c6f3)['then'](function(_0x47abb5){logger[_0xcdec('0xd')](_0xcdec('0xe'),_0x2bb273,_0xcdec('0xf'));logger[_0xcdec('0x10')](_0xcdec('0x11'),_0x2bb273,_0xcdec('0xf'),JSON['stringify'](_0x47abb5));if(_0x47abb5[_0xcdec('0x12')]){if(_0x47abb5[_0xcdec('0x12')]['code']===0x1f4){logger['error'](_0xcdec('0xe'),_0x2bb273,_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);return _0x426e18(_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);}logger[_0xcdec('0x12')](_0xcdec('0xe'),_0x2bb273,_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);return _0x1ad4ff(_0x47abb5[_0xcdec('0x12')][_0xcdec('0x13')]);}else{logger[_0xcdec('0xd')](_0xcdec('0xe'),_0x2bb273,_0xcdec('0xf'));_0x1ad4ff(_0x47abb5[_0xcdec('0x14')][_0xcdec('0x13')]);}})[_0xcdec('0x15')](function(_0x5f0dc3){logger[_0xcdec('0x12')](_0xcdec('0xe'),_0x2bb273,_0x5f0dc3);_0x426e18(_0x5f0dc3);});});}exports[_0xcdec('0x16')]=function(_0x11cd8c){var _0x1ef4fe=this;return new Promise(function(_0x13ad65,_0x387109){return db[_0xcdec('0x17')][_0xcdec('0x18')]({'raw':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x11cd8c['options']?_0x11cd8c[_0xcdec('0x19')][_0xcdec('0x1a')]||null:null,'attributes':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')][_0xcdec('0x1b')]||null:null,'limit':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')]['limit']||null:null,'include':_0x11cd8c[_0xcdec('0x19')]?_0x11cd8c[_0xcdec('0x19')][_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x11cd8c['options'][_0xcdec('0x1c')],function(_0x4f0647){return{'model':db[_0x4f0647[_0xcdec('0x1e')]],'as':_0x4f0647['as'],'attributes':_0x4f0647[_0xcdec('0x1b')],'include':_0x4f0647[_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x4f0647['include'],function(_0x433c45){return{'model':db[_0x433c45[_0xcdec('0x1e')]],'as':_0x433c45['as'],'attributes':_0x433c45[_0xcdec('0x1b')],'include':_0x433c45[_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x433c45[_0xcdec('0x1c')],function(_0x42f48c){return{'model':db[_0x42f48c['model']],'as':_0x42f48c['as'],'attributes':_0x42f48c[_0xcdec('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcdec('0x1f')](function(_0x5273ff){logger['info'](_0xcdec('0x16'),_0x11cd8c);logger[_0xcdec('0x10')](_0xcdec('0x16'),_0x11cd8c,JSON[_0xcdec('0x20')](_0x5273ff));_0x13ad65(_0x5273ff);})['catch'](function(_0x26e7c3){logger[_0xcdec('0x12')](_0xcdec('0x16'),_0x26e7c3[_0xcdec('0x13')],_0x11cd8c);_0x387109(_0x1ef4fe['error'](0x1f4,_0x26e7c3[_0xcdec('0x13')]));});});};exports[_0xcdec('0x21')]=function(_0x4055d1){var _0x1bec2c=this;return new Promise(function(_0x214f28,_0x5d5aec){return db['SalesforceAccount'][_0xcdec('0x22')]({'raw':_0x4055d1['options']?_0x4055d1[_0xcdec('0x19')][_0xcdec('0x23')]===undefined?!![]:![]:!![],'where':_0x4055d1[_0xcdec('0x19')]?_0x4055d1[_0xcdec('0x19')][_0xcdec('0x1a')]||null:null,'attributes':_0x4055d1[_0xcdec('0x19')]?_0x4055d1['options'][_0xcdec('0x1b')]||null:null,'include':_0x4055d1[_0xcdec('0x19')]?_0x4055d1[_0xcdec('0x19')][_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0x4055d1[_0xcdec('0x19')][_0xcdec('0x1c')],function(_0xaf7b17){return{'model':db[_0xaf7b17['model']],'as':_0xaf7b17['as'],'attributes':_0xaf7b17[_0xcdec('0x1b')],'include':_0xaf7b17[_0xcdec('0x1c')]?_[_0xcdec('0x1d')](_0xaf7b17[_0xcdec('0x1c')],function(_0x2c2d18){return{'model':db[_0x2c2d18['model']],'as':_0x2c2d18['as'],'attributes':_0x2c2d18[_0xcdec('0x1b')],'include':_0x2c2d18['include']?_[_0xcdec('0x1d')](_0x2c2d18[_0xcdec('0x1c')],function(_0x1f5b00){return{'model':db[_0x1f5b00[_0xcdec('0x1e')]],'as':_0x1f5b00['as'],'attributes':_0x1f5b00[_0xcdec('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe6d0d3){logger[_0xcdec('0xd')](_0xcdec('0x21'),_0x4055d1);logger[_0xcdec('0x10')](_0xcdec('0x21'),_0x4055d1,JSON[_0xcdec('0x20')](_0xe6d0d3));_0x214f28(_0xe6d0d3);})['catch'](function(_0x2e8c15){logger[_0xcdec('0x12')]('ShowSalesforceAccount',_0x2e8c15[_0xcdec('0x13')],_0x4055d1);_0x5d5aec(_0x1bec2c[_0xcdec('0x12')](0x1f4,_0x2e8c15['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 93803af..15ef7f6 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 _0xb76d=['put','delete','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x506617,_0x45f263){var _0xd6211f=function(_0x322f9b){while(--_0x322f9b){_0x506617['push'](_0x506617['shift']());}};_0xd6211f(++_0x45f263);}(_0xb76d,0x146));var _0xdb76=function(_0x15ce65,_0x38b25c){_0x15ce65=_0x15ce65-0x0;var _0x1bbced=_0xb76d[_0x15ce65];return _0x1bbced;};'use strict';var multer=require('multer');var util=require(_0xdb76('0x0'));var path=require(_0xdb76('0x1'));var timeout=require(_0xdb76('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xdb76('0x3'));var interaction=require(_0xdb76('0x4'));var config=require('../../config/environment');var controller=require(_0xdb76('0x5'));router[_0xdb76('0x6')]('/',auth[_0xdb76('0x7')](),controller[_0xdb76('0x8')]);router['get'](_0xdb76('0x9'),auth[_0xdb76('0x7')](),controller['show']);router[_0xdb76('0x6')](_0xdb76('0xa'),auth[_0xdb76('0x7')](),controller['getFields']);router['get'](_0xdb76('0xb'),auth[_0xdb76('0x7')](),controller['getSubjects']);router[_0xdb76('0x6')](_0xdb76('0xc'),auth['isAuthenticated'](),controller[_0xdb76('0xd')]);router[_0xdb76('0xe')]('/',auth['isAuthenticated'](),controller[_0xdb76('0xf')]);router[_0xdb76('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xdb76('0x11')](_0xdb76('0x9'),auth[_0xdb76('0x7')](),controller['destroy']);module[_0xdb76('0x12')]=router; \ No newline at end of file +var _0x6ff2=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x41116c,_0x33ac8b){var _0x16b707=function(_0x3d9758){while(--_0x3d9758){_0x41116c['push'](_0x41116c['shift']());}};_0x16b707(++_0x33ac8b);}(_0x6ff2,0xba));var _0x26ff=function(_0x44e7aa,_0x578c0d){_0x44e7aa=_0x44e7aa-0x0;var _0x41ee86=_0x6ff2[_0x44e7aa];return _0x41ee86;};'use strict';var multer=require(_0x26ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x26ff('0x1'));var express=require(_0x26ff('0x2'));var router=express[_0x26ff('0x3')]();var auth=require(_0x26ff('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26ff('0x5'));router[_0x26ff('0x6')]('/',auth[_0x26ff('0x7')](),controller[_0x26ff('0x8')]);router[_0x26ff('0x6')](_0x26ff('0x9'),auth[_0x26ff('0x7')](),controller[_0x26ff('0xa')]);router[_0x26ff('0x6')](_0x26ff('0xb'),auth[_0x26ff('0x7')](),controller[_0x26ff('0xc')]);router['get'](_0x26ff('0xd'),auth[_0x26ff('0x7')](),controller[_0x26ff('0xe')]);router[_0x26ff('0x6')](_0x26ff('0xf'),auth[_0x26ff('0x7')](),controller[_0x26ff('0x10')]);router[_0x26ff('0x11')]('/',auth['isAuthenticated'](),controller[_0x26ff('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x26ff('0x13')]);router[_0x26ff('0x14')](_0x26ff('0x9'),auth[_0x26ff('0x7')](),controller['destroy']);module[_0x26ff('0x15')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index e715ebf..f3d8b75 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 _0xefea=['STRING','ENUM','Task','contact_lead','contact','lead','nothing','sequelize','exports'];(function(_0x427115,_0x3628f0){var _0x486775=function(_0x266b15){while(--_0x266b15){_0x427115['push'](_0x427115['shift']());}};_0x486775(++_0x3628f0);}(_0xefea,0x142));var _0xaefe=function(_0x3d09ba,_0x1295b2){_0x3d09ba=_0x3d09ba-0x0;var _0xf6959a=_0xefea[_0x3d09ba];return _0xf6959a;};'use strict';var Sequelize=require(_0xaefe('0x0'));module[_0xaefe('0x1')]={'name':{'type':Sequelize[_0xaefe('0x2')]},'description':{'type':Sequelize[_0xaefe('0x2')]},'ticketType':{'type':Sequelize[_0xaefe('0x3')](_0xaefe('0x4'),'Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xaefe('0x5'),_0xaefe('0x6'),_0xaefe('0x7')),'defaultValue':_0xaefe('0x5')},'moduleCreate':{'type':Sequelize[_0xaefe('0x3')](_0xaefe('0x8'),'contact','lead'),'defaultValue':_0xaefe('0x7')}}; \ No newline at end of file +var _0xe4c2=['ENUM','Task','contact_lead','contact','lead','nothing','STRING'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0xe4c2,0x1a3));var _0x2e4c=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe4c2[_0x25e7cb];return _0x375d92;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2e4c('0x0')]},'description':{'type':Sequelize[_0x2e4c('0x0')]},'ticketType':{'type':Sequelize[_0x2e4c('0x1')]('Task','Case'),'defaultValue':_0x2e4c('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x2e4c('0x3'),_0x2e4c('0x4'),_0x2e4c('0x5')),'defaultValue':_0x2e4c('0x3')},'moduleCreate':{'type':Sequelize[_0x2e4c('0x1')](_0x2e4c('0x6'),_0x2e4c('0x4'),_0x2e4c('0x5')),'defaultValue':_0x2e4c('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 0a412b9..0ecd502 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 _0x0fd9=['set','apply','reject','update','destroy','end','name','send','index','SalesforceConfiguration','rawAttributes','model','keys','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','where','pick','filter','map','type','key','includeAll','include','findAll','rows','catch','show','params','filters','length','merge','find','create','body','getFields','findOne','sort','getSubjects','SalesforceField','options','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','sendStatus','status','json','count','offset'];(function(_0x251010,_0xf986ba){var _0x307a6b=function(_0x34d150){while(--_0x34d150){_0x251010['push'](_0x251010['shift']());}};_0x307a6b(++_0xf986ba);}(_0x0fd9,0xe5));var _0x90fd=function(_0x1ab0e6,_0x17ba8d){_0x1ab0e6=_0x1ab0e6-0x0;var _0x248815=_0x0fd9[_0x1ab0e6];return _0x248815;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x90fd('0x0'));var rimraf=require(_0x90fd('0x1'));var zipdir=require(_0x90fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x90fd('0x3'));var BPromise=require(_0x90fd('0x4'));var Mustache=require(_0x90fd('0x5'));var util=require(_0x90fd('0x6'));var path=require(_0x90fd('0x7'));var sox=require(_0x90fd('0x8'));var csv=require('to-csv');var ejs=require(_0x90fd('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x90fd('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0xc'));var querystring=require('querystring');var Papa=require(_0x90fd('0xd'));var Redis=require(_0x90fd('0xe'));var authService=require(_0x90fd('0xf'));var qs=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var db=require(_0x90fd('0x15'))['db'];var jayson=require(_0x90fd('0x16'));var client=jayson[_0x90fd('0x17')][_0x90fd('0x18')]({'port':0x232a});function checkPasswordPattern(_0x89a31d,_0x4db9dd,_0x322ad4){if(_0x322ad4){var _0x41a188=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41a188[_0x90fd('0x19')](_0x4db9dd)){return _0x89a31d;}else{throw new Error(_0x90fd('0x1a'));}}else{return _0x89a31d;}}function respondWithRpcPromise(_0x3195b5,_0x590850,_0x4e8ca9,_0x3f8dd9){return new BPromise(function(_0x153aa5,_0x2fca8a){var _0x2847b5=_0x3f8dd9||client;return _0x2847b5[_0x90fd('0x1b')](_0x3195b5,_0x4e8ca9)[_0x90fd('0x1c')](function(_0x2d968f){logger[_0x90fd('0x1d')]('SalesforceConfiguration,\x20%s,\x20%s',_0x590850,_0x90fd('0x1e'));logger[_0x90fd('0x1f')](_0x90fd('0x20'),_0x590850,_0x90fd('0x1e'),JSON[_0x90fd('0x21')](_0x2d968f));if(_0x2d968f[_0x90fd('0x22')]){if(_0x2d968f[_0x90fd('0x22')][_0x90fd('0x23')]===0x1f4){logger[_0x90fd('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0x590850,_0x2d968f[_0x90fd('0x22')][_0x90fd('0x24')]);return _0x2fca8a(_0x2d968f['error']['message']);}logger[_0x90fd('0x22')](_0x90fd('0x25'),_0x590850,_0x2d968f[_0x90fd('0x22')][_0x90fd('0x24')]);return _0x153aa5(_0x2d968f[_0x90fd('0x22')][_0x90fd('0x24')]);}else{logger[_0x90fd('0x1d')](_0x90fd('0x25'),_0x590850,'request\x20sent');_0x153aa5(_0x2d968f[_0x90fd('0x26')][_0x90fd('0x24')]);}})['catch'](function(_0x2967a4){logger['error'](_0x90fd('0x25'),_0x590850,_0x2967a4);_0x2fca8a(_0x2967a4);});});}function respondWithStatusCode(_0x23e5e6,_0x3b237b){_0x3b237b=_0x3b237b||0xcc;return function(_0x456e92){if(_0x456e92){return _0x23e5e6[_0x90fd('0x27')](_0x3b237b);}return _0x23e5e6[_0x90fd('0x28')](_0x3b237b)['end']();};}function respondWithResult(_0x3f6bb7,_0x28c1e4){_0x28c1e4=_0x28c1e4||0xc8;return function(_0x2f40b3){if(_0x2f40b3){return _0x3f6bb7[_0x90fd('0x28')](_0x28c1e4)[_0x90fd('0x29')](_0x2f40b3);}};}function respondWithFilteredResult(_0xed2827,_0x3f18c0){return function(_0x4a78eb){if(_0x4a78eb){var _0x36b776=_0x4a78eb[_0x90fd('0x2a')],_0x11deda=_0x3f18c0[_0x90fd('0x2b')],_0x431112=_0x3f18c0[_0x90fd('0x2b')]+_0x3f18c0['limit'],_0x3f2c91;if(_0x431112>=_0x36b776){_0x431112=_0x36b776;_0x3f2c91=0xc8;}else{_0x3f2c91=0xce;}_0xed2827[_0x90fd('0x28')](_0x3f2c91);return _0xed2827[_0x90fd('0x2c')]('Content-Range',_0x11deda+'-'+_0x431112+'/'+_0x36b776)[_0x90fd('0x29')](_0x4a78eb);}return null;};}function patchUpdates(_0x542136){return function(_0x4741ab){try{jsonpatch[_0x90fd('0x2d')](_0x4741ab,_0x542136,!![]);}catch(_0x5024dc){return BPromise[_0x90fd('0x2e')](_0x5024dc);}return _0x4741ab['save']();};}function saveUpdates(_0x139d22,_0xfee7d5){return function(_0x58f1ca){if(_0x58f1ca){return _0x58f1ca[_0x90fd('0x2f')](_0x139d22)['then'](function(_0x68723){return _0x68723;});}return null;};}function removeEntity(_0x1da2dc,_0x3d73f8){return function(_0x269b83){if(_0x269b83){return _0x269b83[_0x90fd('0x30')]()[_0x90fd('0x1c')](function(){_0x1da2dc[_0x90fd('0x28')](0xcc)[_0x90fd('0x31')]();});}};}function handleEntityNotFound(_0x4e9942,_0x594b72){return function(_0x559d40){if(!_0x559d40){_0x4e9942[_0x90fd('0x27')](0x194);}return _0x559d40;};}function handleError(_0x3394ba,_0x26b4c0){_0x26b4c0=_0x26b4c0||0x1f4;return function(_0x31624a){logger[_0x90fd('0x22')](_0x31624a['stack']);if(_0x31624a['name']){delete _0x31624a[_0x90fd('0x32')];}_0x3394ba['status'](_0x26b4c0)[_0x90fd('0x33')](_0x31624a);};}exports[_0x90fd('0x34')]=function(_0x1e2ad1,_0x4b3d7e){var _0x3ad46f={},_0x2e8c45={},_0x1c16a1={'count':0x0,'rows':[]};var _0x3c3cc6=db[_0x90fd('0x35')][_0x90fd('0x36')];_0x2e8c45[_0x90fd('0x37')]=_[_0x90fd('0x38')](_0x3c3cc6);_0x2e8c45[_0x90fd('0x39')]=_[_0x90fd('0x38')](_0x1e2ad1[_0x90fd('0x39')]);_0x2e8c45['filters']=_['intersection'](_0x2e8c45['model'],_0x2e8c45[_0x90fd('0x39')]);_0x3ad46f[_0x90fd('0x3a')]=_[_0x90fd('0x3b')](_0x2e8c45['model'],qs[_0x90fd('0x3c')](_0x1e2ad1[_0x90fd('0x39')][_0x90fd('0x3c')]));_0x3ad46f[_0x90fd('0x3a')]=_0x3ad46f[_0x90fd('0x3a')]['length']?_0x3ad46f[_0x90fd('0x3a')]:_0x2e8c45[_0x90fd('0x37')];if(!_0x1e2ad1[_0x90fd('0x39')][_0x90fd('0x3d')](_0x90fd('0x3e'))){_0x3ad46f[_0x90fd('0x3f')]=qs['limit'](_0x1e2ad1[_0x90fd('0x39')][_0x90fd('0x3f')]);_0x3ad46f[_0x90fd('0x2b')]=qs[_0x90fd('0x2b')](_0x1e2ad1[_0x90fd('0x39')]['offset']);}_0x3ad46f[_0x90fd('0x40')]=qs['sort'](_0x1e2ad1[_0x90fd('0x39')]['sort']);_0x3ad46f[_0x90fd('0x41')]=qs['filters'](_[_0x90fd('0x42')](_0x1e2ad1[_0x90fd('0x39')],_0x2e8c45['filters']));if(_0x1e2ad1[_0x90fd('0x39')][_0x90fd('0x43')]){_0x3ad46f[_0x90fd('0x41')]=_['merge'](_0x3ad46f[_0x90fd('0x41')],{'$or':_[_0x90fd('0x44')](_0x3c3cc6,function(_0x4fd425){if(_0x4fd425[_0x90fd('0x45')][_0x90fd('0x46')]!=='VIRTUAL'){var _0x38f7f3={};_0x38f7f3[_0x4fd425['field']]={'$like':'%'+_0x1e2ad1[_0x90fd('0x39')]['filter']+'%'};return _0x38f7f3;}})});}_0x3ad46f=_['merge']({},_0x3ad46f,_0x1e2ad1['options']);var _0x17b6d0={'where':_0x3ad46f[_0x90fd('0x41')]};return db[_0x90fd('0x35')][_0x90fd('0x2a')](_0x17b6d0)[_0x90fd('0x1c')](function(_0x5b7f9f){_0x1c16a1[_0x90fd('0x2a')]=_0x5b7f9f;if(_0x1e2ad1['query'][_0x90fd('0x47')]){_0x3ad46f[_0x90fd('0x48')]=[{'all':!![]}];}return db[_0x90fd('0x35')][_0x90fd('0x49')](_0x3ad46f);})['then'](function(_0x6fada7){_0x1c16a1[_0x90fd('0x4a')]=_0x6fada7;return _0x1c16a1;})[_0x90fd('0x1c')](respondWithFilteredResult(_0x4b3d7e,_0x3ad46f))[_0x90fd('0x4b')](handleError(_0x4b3d7e,null));};exports[_0x90fd('0x4c')]=function(_0x14d35c,_0x5530aa){var _0x3d417d={'raw':![],'where':{'id':_0x14d35c[_0x90fd('0x4d')]['id']}},_0x4e6d6b={};_0x4e6d6b[_0x90fd('0x37')]=_[_0x90fd('0x38')](db[_0x90fd('0x35')][_0x90fd('0x36')]);_0x4e6d6b['query']=_[_0x90fd('0x38')](_0x14d35c[_0x90fd('0x39')]);_0x4e6d6b[_0x90fd('0x4e')]=_[_0x90fd('0x3b')](_0x4e6d6b[_0x90fd('0x37')],_0x4e6d6b[_0x90fd('0x39')]);_0x3d417d[_0x90fd('0x3a')]=_[_0x90fd('0x3b')](_0x4e6d6b[_0x90fd('0x37')],qs[_0x90fd('0x3c')](_0x14d35c[_0x90fd('0x39')][_0x90fd('0x3c')]));_0x3d417d[_0x90fd('0x3a')]=_0x3d417d[_0x90fd('0x3a')][_0x90fd('0x4f')]?_0x3d417d['attributes']:_0x4e6d6b['model'];if(_0x14d35c[_0x90fd('0x39')][_0x90fd('0x47')]){_0x3d417d['include']=[{'all':!![]}];}_0x3d417d=_[_0x90fd('0x50')]({},_0x3d417d,_0x14d35c['options']);return db['SalesforceConfiguration'][_0x90fd('0x51')](_0x3d417d)[_0x90fd('0x1c')](handleEntityNotFound(_0x5530aa,null))[_0x90fd('0x1c')](respondWithResult(_0x5530aa,null))[_0x90fd('0x4b')](handleError(_0x5530aa,null));};exports[_0x90fd('0x52')]=function(_0x3bf7c5,_0x56ae80){return db[_0x90fd('0x35')]['create'](_0x3bf7c5['body'],{})[_0x90fd('0x1c')](respondWithResult(_0x56ae80,0xc9))[_0x90fd('0x4b')](handleError(_0x56ae80,null));};exports[_0x90fd('0x2f')]=function(_0x4c09ba,_0x1011ff){if(_0x4c09ba[_0x90fd('0x53')]['id']){delete _0x4c09ba[_0x90fd('0x53')]['id'];}return db[_0x90fd('0x35')][_0x90fd('0x51')]({'where':{'id':_0x4c09ba['params']['id']}})[_0x90fd('0x1c')](handleEntityNotFound(_0x1011ff,null))['then'](saveUpdates(_0x4c09ba[_0x90fd('0x53')],null))['then'](respondWithResult(_0x1011ff,null))[_0x90fd('0x4b')](handleError(_0x1011ff,null));};exports['destroy']=function(_0x5dd592,_0x2d49cb){return db[_0x90fd('0x35')][_0x90fd('0x51')]({'where':{'id':_0x5dd592['params']['id']}})['then'](handleEntityNotFound(_0x2d49cb,null))['then'](removeEntity(_0x2d49cb,null))['catch'](handleError(_0x2d49cb,null));};exports[_0x90fd('0x54')]=function(_0x36b85b,_0x55a736,_0xcf0ffd){var _0x41c5e7={};var _0x372a16={};var _0x2563b6;var _0x529cd2;return db[_0x90fd('0x35')][_0x90fd('0x55')]({'where':{'id':_0x36b85b[_0x90fd('0x4d')]['id']}})[_0x90fd('0x1c')](handleEntityNotFound(_0x55a736,null))['then'](function(_0x22868b){if(_0x22868b){_0x2563b6=_0x22868b;_0x372a16[_0x90fd('0x37')]=_[_0x90fd('0x38')](db['SalesforceField'][_0x90fd('0x36')]);_0x372a16[_0x90fd('0x39')]=_['keys'](_0x36b85b[_0x90fd('0x39')]);_0x372a16[_0x90fd('0x4e')]=_[_0x90fd('0x3b')](_0x372a16[_0x90fd('0x37')],_0x372a16[_0x90fd('0x39')]);_0x41c5e7[_0x90fd('0x3a')]=_[_0x90fd('0x3b')](_0x372a16[_0x90fd('0x37')],qs[_0x90fd('0x3c')](_0x36b85b[_0x90fd('0x39')]['fields']));_0x41c5e7[_0x90fd('0x3a')]=_0x41c5e7['attributes'][_0x90fd('0x4f')]?_0x41c5e7[_0x90fd('0x3a')]:_0x372a16[_0x90fd('0x37')];_0x41c5e7[_0x90fd('0x40')]=qs[_0x90fd('0x56')](_0x36b85b[_0x90fd('0x39')]['sort']);_0x41c5e7[_0x90fd('0x41')]=qs[_0x90fd('0x4e')](_[_0x90fd('0x42')](_0x36b85b[_0x90fd('0x39')],_0x372a16[_0x90fd('0x4e')]));if(_0x36b85b[_0x90fd('0x39')][_0x90fd('0x43')]){_0x41c5e7['where']=_[_0x90fd('0x50')](_0x41c5e7[_0x90fd('0x41')],{'$or':_['map'](_0x41c5e7[_0x90fd('0x3a')],function(_0x5de98e){var _0x2215e6={};_0x2215e6[_0x5de98e]={'$like':'%'+_0x36b85b[_0x90fd('0x39')][_0x90fd('0x43')]+'%'};return _0x2215e6;})});}_0x41c5e7=_[_0x90fd('0x50')]({},_0x41c5e7,_0x36b85b['options']);return _0x2563b6[_0x90fd('0x54')](_0x41c5e7);}})['then'](function(_0x14bd38){if(_0x14bd38){_0x529cd2=_0x14bd38['length'];if(!_0x36b85b[_0x90fd('0x39')][_0x90fd('0x3d')](_0x90fd('0x3e'))){_0x41c5e7[_0x90fd('0x3f')]=qs[_0x90fd('0x3f')](_0x36b85b[_0x90fd('0x39')]['limit']);_0x41c5e7['offset']=qs[_0x90fd('0x2b')](_0x36b85b[_0x90fd('0x39')][_0x90fd('0x2b')]);}return _0x2563b6['getFields'](_0x41c5e7);}})['then'](function(_0x22defa){if(_0x22defa){return _0x22defa?{'count':_0x529cd2,'rows':_0x22defa}:null;}})[_0x90fd('0x1c')](respondWithResult(_0x55a736,null))[_0x90fd('0x4b')](handleError(_0x55a736,null));};exports[_0x90fd('0x57')]=function(_0x2ee14b,_0x4ea60c,_0x43104){var _0x3eaed7={};var _0x3a7418={};var _0x578c2f;var _0x102acd;return db[_0x90fd('0x35')][_0x90fd('0x55')]({'where':{'id':_0x2ee14b[_0x90fd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ea60c,null))[_0x90fd('0x1c')](function(_0xdf6cdb){if(_0xdf6cdb){_0x578c2f=_0xdf6cdb;_0x3a7418['model']=_[_0x90fd('0x38')](db[_0x90fd('0x58')][_0x90fd('0x36')]);_0x3a7418[_0x90fd('0x39')]=_['keys'](_0x2ee14b[_0x90fd('0x39')]);_0x3a7418['filters']=_[_0x90fd('0x3b')](_0x3a7418[_0x90fd('0x37')],_0x3a7418['query']);_0x3eaed7['attributes']=_[_0x90fd('0x3b')](_0x3a7418['model'],qs[_0x90fd('0x3c')](_0x2ee14b[_0x90fd('0x39')][_0x90fd('0x3c')]));_0x3eaed7[_0x90fd('0x3a')]=_0x3eaed7[_0x90fd('0x3a')]['length']?_0x3eaed7[_0x90fd('0x3a')]:_0x3a7418['model'];_0x3eaed7['order']=qs[_0x90fd('0x56')](_0x2ee14b[_0x90fd('0x39')][_0x90fd('0x56')]);_0x3eaed7[_0x90fd('0x41')]=qs['filters'](_[_0x90fd('0x42')](_0x2ee14b[_0x90fd('0x39')],_0x3a7418[_0x90fd('0x4e')]));if(_0x2ee14b[_0x90fd('0x39')][_0x90fd('0x43')]){_0x3eaed7[_0x90fd('0x41')]=_[_0x90fd('0x50')](_0x3eaed7[_0x90fd('0x41')],{'$or':_[_0x90fd('0x44')](_0x3eaed7[_0x90fd('0x3a')],function(_0x4b204d){var _0x2dd7c7={};_0x2dd7c7[_0x4b204d]={'$like':'%'+_0x2ee14b[_0x90fd('0x39')]['filter']+'%'};return _0x2dd7c7;})});}_0x3eaed7=_[_0x90fd('0x50')]({},_0x3eaed7,_0x2ee14b[_0x90fd('0x59')]);return _0x578c2f[_0x90fd('0x57')](_0x3eaed7);}})[_0x90fd('0x1c')](function(_0x19c960){if(_0x19c960){_0x102acd=_0x19c960['length'];if(!_0x2ee14b[_0x90fd('0x39')][_0x90fd('0x3d')](_0x90fd('0x3e'))){_0x3eaed7[_0x90fd('0x3f')]=qs[_0x90fd('0x3f')](_0x2ee14b['query']['limit']);_0x3eaed7[_0x90fd('0x2b')]=qs[_0x90fd('0x2b')](_0x2ee14b[_0x90fd('0x39')][_0x90fd('0x2b')]);}return _0x578c2f[_0x90fd('0x57')](_0x3eaed7);}})['then'](function(_0xa059af){if(_0xa059af){return _0xa059af?{'count':_0x102acd,'rows':_0xa059af}:null;}})['then'](respondWithResult(_0x4ea60c,null))['catch'](handleError(_0x4ea60c,null));};exports[_0x90fd('0x5a')]=function(_0x1c6b5f,_0x4524a3,_0x6ac01d){var _0x150db8={};var _0x5161d3={};var _0x16598e;var _0x5de71d;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x1c6b5f[_0x90fd('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4524a3,null))[_0x90fd('0x1c')](function(_0x591851){if(_0x591851){_0x16598e=_0x591851;_0x5161d3['model']=_[_0x90fd('0x38')](db['SalesforceField']['rawAttributes']);_0x5161d3[_0x90fd('0x39')]=_['keys'](_0x1c6b5f[_0x90fd('0x39')]);_0x5161d3[_0x90fd('0x4e')]=_[_0x90fd('0x3b')](_0x5161d3[_0x90fd('0x37')],_0x5161d3[_0x90fd('0x39')]);_0x150db8[_0x90fd('0x3a')]=_[_0x90fd('0x3b')](_0x5161d3['model'],qs['fields'](_0x1c6b5f['query'][_0x90fd('0x3c')]));_0x150db8[_0x90fd('0x3a')]=_0x150db8[_0x90fd('0x3a')]['length']?_0x150db8[_0x90fd('0x3a')]:_0x5161d3[_0x90fd('0x37')];_0x150db8['order']=qs['sort'](_0x1c6b5f[_0x90fd('0x39')][_0x90fd('0x56')]);_0x150db8['where']=qs[_0x90fd('0x4e')](_[_0x90fd('0x42')](_0x1c6b5f[_0x90fd('0x39')],_0x5161d3[_0x90fd('0x4e')]));if(_0x1c6b5f[_0x90fd('0x39')]['filter']){_0x150db8[_0x90fd('0x41')]=_[_0x90fd('0x50')](_0x150db8[_0x90fd('0x41')],{'$or':_[_0x90fd('0x44')](_0x150db8['attributes'],function(_0x5c71b1){var _0xc2e379={};_0xc2e379[_0x5c71b1]={'$like':'%'+_0x1c6b5f[_0x90fd('0x39')]['filter']+'%'};return _0xc2e379;})});}_0x150db8=_[_0x90fd('0x50')]({},_0x150db8,_0x1c6b5f[_0x90fd('0x59')]);return _0x16598e[_0x90fd('0x5a')](_0x150db8);}})['then'](function(_0x247525){if(_0x247525){_0x5de71d=_0x247525[_0x90fd('0x4f')];if(!_0x1c6b5f[_0x90fd('0x39')]['hasOwnProperty'](_0x90fd('0x3e'))){_0x150db8[_0x90fd('0x3f')]=qs[_0x90fd('0x3f')](_0x1c6b5f[_0x90fd('0x39')][_0x90fd('0x3f')]);_0x150db8['offset']=qs[_0x90fd('0x2b')](_0x1c6b5f[_0x90fd('0x39')][_0x90fd('0x2b')]);}return _0x16598e[_0x90fd('0x5a')](_0x150db8);}})['then'](function(_0x544f21){if(_0x544f21){return _0x544f21?{'count':_0x5de71d,'rows':_0x544f21}:null;}})[_0x90fd('0x1c')](respondWithResult(_0x4524a3,null))[_0x90fd('0x4b')](handleError(_0x4524a3,null));}; \ No newline at end of file +var _0x698b=['order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','include','SalesforceConfiguration','findAll','rows','catch','show','includeAll','options','find','create','body','update','params','findOne','SalesforceField','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','SalesforceConfiguration,\x20%s,\x20%s','message','info','result','sendStatus','status','count','offset','limit','Content-Range','json','reject','save','destroy','end','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x377443,_0x963b2d){var _0x12026e=function(_0x11f67){while(--_0x11f67){_0x377443['push'](_0x377443['shift']());}};_0x12026e(++_0x963b2d);}(_0x698b,0x77));var _0xb698=function(_0x9490e5,_0x1b29ec){_0x9490e5=_0x9490e5-0x0;var _0x280fde=_0x698b[_0x9490e5];return _0x280fde;};'use strict';var pdf=require(_0xb698('0x0'));var emlformat=require(_0xb698('0x1'));var rimraf=require(_0xb698('0x2'));var zipdir=require(_0xb698('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb698('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb698('0x5'));var util=require(_0xb698('0x6'));var path=require(_0xb698('0x7'));var sox=require(_0xb698('0x8'));var csv=require(_0xb698('0x9'));var ejs=require(_0xb698('0xa'));var fs=require('fs');var _=require(_0xb698('0xb'));var squel=require(_0xb698('0xc'));var crypto=require(_0xb698('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb698('0xe'));var toCsv=require(_0xb698('0x9'));var querystring=require('querystring');var Papa=require(_0xb698('0xf'));var Redis=require(_0xb698('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb698('0x11'));var hardwareService=require(_0xb698('0x12'));var logger=require(_0xb698('0x13'))('api');var utils=require(_0xb698('0x14'));var config=require(_0xb698('0x15'));var db=require(_0xb698('0x16'))['db'];var jayson=require(_0xb698('0x17'));var client=jayson[_0xb698('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d03fa,_0x536703,_0x465fcc){if(_0x465fcc){var _0x5385d5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5385d5[_0xb698('0x19')](_0x536703)){return _0x2d03fa;}else{throw new Error(_0xb698('0x1a'));}}else{return _0x2d03fa;}}function respondWithRpcPromise(_0x284f13,_0x380e81,_0x19ddc0,_0x284534){return new BPromise(function(_0x56af56,_0x2a3192){var _0x2dfffb=_0x284534||client;return _0x2dfffb[_0xb698('0x1b')](_0x284f13,_0x19ddc0)[_0xb698('0x1c')](function(_0x68d9e){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x380e81,_0xb698('0x1d'));logger[_0xb698('0x1e')](_0xb698('0x1f'),_0x380e81,_0xb698('0x1d'),JSON['stringify'](_0x68d9e));if(_0x68d9e[_0xb698('0x20')]){if(_0x68d9e[_0xb698('0x20')]['code']===0x1f4){logger['error'](_0xb698('0x21'),_0x380e81,_0x68d9e[_0xb698('0x20')][_0xb698('0x22')]);return _0x2a3192(_0x68d9e[_0xb698('0x20')]['message']);}logger[_0xb698('0x20')](_0xb698('0x21'),_0x380e81,_0x68d9e[_0xb698('0x20')]['message']);return _0x56af56(_0x68d9e['error']['message']);}else{logger[_0xb698('0x23')](_0xb698('0x21'),_0x380e81,_0xb698('0x1d'));_0x56af56(_0x68d9e[_0xb698('0x24')][_0xb698('0x22')]);}})['catch'](function(_0x5542a9){logger[_0xb698('0x20')](_0xb698('0x21'),_0x380e81,_0x5542a9);_0x2a3192(_0x5542a9);});});}function respondWithStatusCode(_0x158ff1,_0x21a894){_0x21a894=_0x21a894||0xcc;return function(_0x2df913){if(_0x2df913){return _0x158ff1[_0xb698('0x25')](_0x21a894);}return _0x158ff1['status'](_0x21a894)['end']();};}function respondWithResult(_0x3ef3bd,_0x431f24){_0x431f24=_0x431f24||0xc8;return function(_0x107c3b){if(_0x107c3b){return _0x3ef3bd[_0xb698('0x26')](_0x431f24)['json'](_0x107c3b);}};}function respondWithFilteredResult(_0x40b7fe,_0x4808ba){return function(_0x413d07){if(_0x413d07){var _0x3abc30=_0x413d07[_0xb698('0x27')],_0x27ae11=_0x4808ba[_0xb698('0x28')],_0x62ce91=_0x4808ba[_0xb698('0x28')]+_0x4808ba[_0xb698('0x29')],_0x398557;if(_0x62ce91>=_0x3abc30){_0x62ce91=_0x3abc30;_0x398557=0xc8;}else{_0x398557=0xce;}_0x40b7fe[_0xb698('0x26')](_0x398557);return _0x40b7fe['set'](_0xb698('0x2a'),_0x27ae11+'-'+_0x62ce91+'/'+_0x3abc30)[_0xb698('0x2b')](_0x413d07);}return null;};}function patchUpdates(_0x4259e6){return function(_0xdb18b4){try{jsonpatch['apply'](_0xdb18b4,_0x4259e6,!![]);}catch(_0x56a9c5){return BPromise[_0xb698('0x2c')](_0x56a9c5);}return _0xdb18b4[_0xb698('0x2d')]();};}function saveUpdates(_0x172738,_0x447768){return function(_0x32b931){if(_0x32b931){return _0x32b931['update'](_0x172738)['then'](function(_0x29e1a4){return _0x29e1a4;});}return null;};}function removeEntity(_0x27a15b,_0x208eb3){return function(_0x2b590c){if(_0x2b590c){return _0x2b590c[_0xb698('0x2e')]()['then'](function(){_0x27a15b[_0xb698('0x26')](0xcc)[_0xb698('0x2f')]();});}};}function handleEntityNotFound(_0x1f7d63,_0x47fcf1){return function(_0xec98e4){if(!_0xec98e4){_0x1f7d63[_0xb698('0x25')](0x194);}return _0xec98e4;};}function handleError(_0x321f20,_0x5e5f71){_0x5e5f71=_0x5e5f71||0x1f4;return function(_0x4de49c){logger[_0xb698('0x20')](_0x4de49c[_0xb698('0x30')]);if(_0x4de49c['name']){delete _0x4de49c[_0xb698('0x31')];}_0x321f20[_0xb698('0x26')](_0x5e5f71)[_0xb698('0x32')](_0x4de49c);};}exports[_0xb698('0x33')]=function(_0x35551d,_0x28a965){var _0x3d7160={},_0x11b5e9={},_0x3d702d={'count':0x0,'rows':[]};var _0x5d8bb0=db['SalesforceConfiguration'][_0xb698('0x34')];_0x11b5e9[_0xb698('0x35')]=_['keys'](_0x5d8bb0);_0x11b5e9[_0xb698('0x36')]=_[_0xb698('0x37')](_0x35551d[_0xb698('0x36')]);_0x11b5e9[_0xb698('0x38')]=_[_0xb698('0x39')](_0x11b5e9[_0xb698('0x35')],_0x11b5e9[_0xb698('0x36')]);_0x3d7160[_0xb698('0x3a')]=_['intersection'](_0x11b5e9[_0xb698('0x35')],qs[_0xb698('0x3b')](_0x35551d['query'][_0xb698('0x3b')]));_0x3d7160['attributes']=_0x3d7160[_0xb698('0x3a')][_0xb698('0x3c')]?_0x3d7160[_0xb698('0x3a')]:_0x11b5e9[_0xb698('0x35')];if(!_0x35551d['query'][_0xb698('0x3d')](_0xb698('0x3e'))){_0x3d7160[_0xb698('0x29')]=qs['limit'](_0x35551d[_0xb698('0x36')][_0xb698('0x29')]);_0x3d7160[_0xb698('0x28')]=qs[_0xb698('0x28')](_0x35551d[_0xb698('0x36')]['offset']);}_0x3d7160[_0xb698('0x3f')]=qs[_0xb698('0x40')](_0x35551d['query'][_0xb698('0x40')]);_0x3d7160[_0xb698('0x41')]=qs['filters'](_[_0xb698('0x42')](_0x35551d[_0xb698('0x36')],_0x11b5e9['filters']));if(_0x35551d[_0xb698('0x36')][_0xb698('0x43')]){_0x3d7160[_0xb698('0x41')]=_[_0xb698('0x44')](_0x3d7160[_0xb698('0x41')],{'$or':_[_0xb698('0x45')](_0x5d8bb0,function(_0x184682){if(_0x184682[_0xb698('0x46')][_0xb698('0x47')]!==_0xb698('0x48')){var _0x3c46e8={};_0x3c46e8[_0x184682['field']]={'$like':'%'+_0x35551d[_0xb698('0x36')][_0xb698('0x43')]+'%'};return _0x3c46e8;}})});}_0x3d7160=_[_0xb698('0x44')]({},_0x3d7160,_0x35551d['options']);var _0x381e6c={'where':_0x3d7160[_0xb698('0x41')]};return db['SalesforceConfiguration'][_0xb698('0x27')](_0x381e6c)[_0xb698('0x1c')](function(_0x31ed40){_0x3d702d[_0xb698('0x27')]=_0x31ed40;if(_0x35551d[_0xb698('0x36')]['includeAll']){_0x3d7160[_0xb698('0x49')]=[{'all':!![]}];}return db[_0xb698('0x4a')][_0xb698('0x4b')](_0x3d7160);})[_0xb698('0x1c')](function(_0xf00222){_0x3d702d[_0xb698('0x4c')]=_0xf00222;return _0x3d702d;})[_0xb698('0x1c')](respondWithFilteredResult(_0x28a965,_0x3d7160))[_0xb698('0x4d')](handleError(_0x28a965,null));};exports[_0xb698('0x4e')]=function(_0x227bf9,_0xcd7727){var _0x51f9a6={'raw':![],'where':{'id':_0x227bf9['params']['id']}},_0x3c9f7c={};_0x3c9f7c[_0xb698('0x35')]=_[_0xb698('0x37')](db['SalesforceConfiguration'][_0xb698('0x34')]);_0x3c9f7c[_0xb698('0x36')]=_['keys'](_0x227bf9[_0xb698('0x36')]);_0x3c9f7c[_0xb698('0x38')]=_[_0xb698('0x39')](_0x3c9f7c[_0xb698('0x35')],_0x3c9f7c['query']);_0x51f9a6['attributes']=_[_0xb698('0x39')](_0x3c9f7c[_0xb698('0x35')],qs[_0xb698('0x3b')](_0x227bf9['query']['fields']));_0x51f9a6[_0xb698('0x3a')]=_0x51f9a6[_0xb698('0x3a')][_0xb698('0x3c')]?_0x51f9a6[_0xb698('0x3a')]:_0x3c9f7c[_0xb698('0x35')];if(_0x227bf9['query'][_0xb698('0x4f')]){_0x51f9a6[_0xb698('0x49')]=[{'all':!![]}];}_0x51f9a6=_[_0xb698('0x44')]({},_0x51f9a6,_0x227bf9[_0xb698('0x50')]);return db[_0xb698('0x4a')][_0xb698('0x51')](_0x51f9a6)[_0xb698('0x1c')](handleEntityNotFound(_0xcd7727,null))[_0xb698('0x1c')](respondWithResult(_0xcd7727,null))[_0xb698('0x4d')](handleError(_0xcd7727,null));};exports[_0xb698('0x52')]=function(_0x93024b,_0x471dd4){return db['SalesforceConfiguration'][_0xb698('0x52')](_0x93024b[_0xb698('0x53')],{})['then'](respondWithResult(_0x471dd4,0xc9))[_0xb698('0x4d')](handleError(_0x471dd4,null));};exports[_0xb698('0x54')]=function(_0x49e3da,_0x4919eb){if(_0x49e3da[_0xb698('0x53')]['id']){delete _0x49e3da[_0xb698('0x53')]['id'];}return db['SalesforceConfiguration'][_0xb698('0x51')]({'where':{'id':_0x49e3da[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x4919eb,null))[_0xb698('0x1c')](saveUpdates(_0x49e3da[_0xb698('0x53')],null))['then'](respondWithResult(_0x4919eb,null))[_0xb698('0x4d')](handleError(_0x4919eb,null));};exports[_0xb698('0x2e')]=function(_0x1cf440,_0x56cd0b){return db[_0xb698('0x4a')][_0xb698('0x51')]({'where':{'id':_0x1cf440[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x56cd0b,null))[_0xb698('0x1c')](removeEntity(_0x56cd0b,null))[_0xb698('0x4d')](handleError(_0x56cd0b,null));};exports['getFields']=function(_0x2ac5cc,_0x48b811,_0x54dacd){var _0x48a8de={};var _0x520057={};var _0x3f0238;var _0x1e821e;return db[_0xb698('0x4a')][_0xb698('0x56')]({'where':{'id':_0x2ac5cc['params']['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x48b811,null))[_0xb698('0x1c')](function(_0x5edd12){if(_0x5edd12){_0x3f0238=_0x5edd12;_0x520057[_0xb698('0x35')]=_[_0xb698('0x37')](db[_0xb698('0x57')][_0xb698('0x34')]);_0x520057[_0xb698('0x36')]=_[_0xb698('0x37')](_0x2ac5cc['query']);_0x520057[_0xb698('0x38')]=_[_0xb698('0x39')](_0x520057['model'],_0x520057[_0xb698('0x36')]);_0x48a8de['attributes']=_[_0xb698('0x39')](_0x520057['model'],qs['fields'](_0x2ac5cc[_0xb698('0x36')][_0xb698('0x3b')]));_0x48a8de[_0xb698('0x3a')]=_0x48a8de['attributes']['length']?_0x48a8de['attributes']:_0x520057[_0xb698('0x35')];_0x48a8de[_0xb698('0x3f')]=qs[_0xb698('0x40')](_0x2ac5cc['query']['sort']);_0x48a8de[_0xb698('0x41')]=qs[_0xb698('0x38')](_[_0xb698('0x42')](_0x2ac5cc[_0xb698('0x36')],_0x520057[_0xb698('0x38')]));if(_0x2ac5cc[_0xb698('0x36')][_0xb698('0x43')]){_0x48a8de[_0xb698('0x41')]=_[_0xb698('0x44')](_0x48a8de['where'],{'$or':_['map'](_0x48a8de['attributes'],function(_0x57a038){var _0x266488={};_0x266488[_0x57a038]={'$like':'%'+_0x2ac5cc[_0xb698('0x36')][_0xb698('0x43')]+'%'};return _0x266488;})});}_0x48a8de=_[_0xb698('0x44')]({},_0x48a8de,_0x2ac5cc[_0xb698('0x50')]);return _0x3f0238[_0xb698('0x58')](_0x48a8de);}})[_0xb698('0x1c')](function(_0x2a2c1){if(_0x2a2c1){_0x1e821e=_0x2a2c1[_0xb698('0x3c')];if(!_0x2ac5cc['query']['hasOwnProperty']('nolimit')){_0x48a8de[_0xb698('0x29')]=qs[_0xb698('0x29')](_0x2ac5cc[_0xb698('0x36')][_0xb698('0x29')]);_0x48a8de[_0xb698('0x28')]=qs[_0xb698('0x28')](_0x2ac5cc[_0xb698('0x36')][_0xb698('0x28')]);}return _0x3f0238[_0xb698('0x58')](_0x48a8de);}})[_0xb698('0x1c')](function(_0x45ce54){if(_0x45ce54){return _0x45ce54?{'count':_0x1e821e,'rows':_0x45ce54}:null;}})['then'](respondWithResult(_0x48b811,null))[_0xb698('0x4d')](handleError(_0x48b811,null));};exports[_0xb698('0x59')]=function(_0x526689,_0x51062a,_0x13cf08){var _0x4084df={};var _0x18b66b={};var _0x1565c8;var _0x5c1745;return db[_0xb698('0x4a')][_0xb698('0x56')]({'where':{'id':_0x526689[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x51062a,null))[_0xb698('0x1c')](function(_0x588a32){if(_0x588a32){_0x1565c8=_0x588a32;_0x18b66b['model']=_['keys'](db[_0xb698('0x57')][_0xb698('0x34')]);_0x18b66b[_0xb698('0x36')]=_['keys'](_0x526689[_0xb698('0x36')]);_0x18b66b['filters']=_[_0xb698('0x39')](_0x18b66b[_0xb698('0x35')],_0x18b66b['query']);_0x4084df['attributes']=_[_0xb698('0x39')](_0x18b66b[_0xb698('0x35')],qs['fields'](_0x526689['query'][_0xb698('0x3b')]));_0x4084df['attributes']=_0x4084df[_0xb698('0x3a')][_0xb698('0x3c')]?_0x4084df[_0xb698('0x3a')]:_0x18b66b[_0xb698('0x35')];_0x4084df[_0xb698('0x3f')]=qs['sort'](_0x526689[_0xb698('0x36')][_0xb698('0x40')]);_0x4084df[_0xb698('0x41')]=qs[_0xb698('0x38')](_[_0xb698('0x42')](_0x526689[_0xb698('0x36')],_0x18b66b[_0xb698('0x38')]));if(_0x526689['query'][_0xb698('0x43')]){_0x4084df['where']=_['merge'](_0x4084df['where'],{'$or':_[_0xb698('0x45')](_0x4084df[_0xb698('0x3a')],function(_0x1edb6a){var _0x1e4824={};_0x1e4824[_0x1edb6a]={'$like':'%'+_0x526689[_0xb698('0x36')][_0xb698('0x43')]+'%'};return _0x1e4824;})});}_0x4084df=_[_0xb698('0x44')]({},_0x4084df,_0x526689[_0xb698('0x50')]);return _0x1565c8[_0xb698('0x59')](_0x4084df);}})[_0xb698('0x1c')](function(_0x34f0a3){if(_0x34f0a3){_0x5c1745=_0x34f0a3[_0xb698('0x3c')];if(!_0x526689[_0xb698('0x36')]['hasOwnProperty'](_0xb698('0x3e'))){_0x4084df['limit']=qs[_0xb698('0x29')](_0x526689[_0xb698('0x36')]['limit']);_0x4084df['offset']=qs[_0xb698('0x28')](_0x526689[_0xb698('0x36')][_0xb698('0x28')]);}return _0x1565c8[_0xb698('0x59')](_0x4084df);}})[_0xb698('0x1c')](function(_0x3de387){if(_0x3de387){return _0x3de387?{'count':_0x5c1745,'rows':_0x3de387}:null;}})['then'](respondWithResult(_0x51062a,null))['catch'](handleError(_0x51062a,null));};exports[_0xb698('0x5a')]=function(_0x212cfe,_0x3a2b35,_0x27406c){var _0x3be7ac={};var _0x1e2239={};var _0x4df227;var _0x1a6608;return db['SalesforceConfiguration'][_0xb698('0x56')]({'where':{'id':_0x212cfe[_0xb698('0x55')]['id']}})[_0xb698('0x1c')](handleEntityNotFound(_0x3a2b35,null))[_0xb698('0x1c')](function(_0x48927c){if(_0x48927c){_0x4df227=_0x48927c;_0x1e2239[_0xb698('0x35')]=_['keys'](db[_0xb698('0x57')][_0xb698('0x34')]);_0x1e2239[_0xb698('0x36')]=_['keys'](_0x212cfe['query']);_0x1e2239['filters']=_['intersection'](_0x1e2239[_0xb698('0x35')],_0x1e2239['query']);_0x3be7ac[_0xb698('0x3a')]=_[_0xb698('0x39')](_0x1e2239['model'],qs[_0xb698('0x3b')](_0x212cfe[_0xb698('0x36')]['fields']));_0x3be7ac[_0xb698('0x3a')]=_0x3be7ac[_0xb698('0x3a')][_0xb698('0x3c')]?_0x3be7ac[_0xb698('0x3a')]:_0x1e2239[_0xb698('0x35')];_0x3be7ac['order']=qs['sort'](_0x212cfe[_0xb698('0x36')][_0xb698('0x40')]);_0x3be7ac['where']=qs[_0xb698('0x38')](_['pick'](_0x212cfe[_0xb698('0x36')],_0x1e2239['filters']));if(_0x212cfe[_0xb698('0x36')][_0xb698('0x43')]){_0x3be7ac[_0xb698('0x41')]=_[_0xb698('0x44')](_0x3be7ac['where'],{'$or':_[_0xb698('0x45')](_0x3be7ac[_0xb698('0x3a')],function(_0x67c95c){var _0x565d59={};_0x565d59[_0x67c95c]={'$like':'%'+_0x212cfe['query'][_0xb698('0x43')]+'%'};return _0x565d59;})});}_0x3be7ac=_[_0xb698('0x44')]({},_0x3be7ac,_0x212cfe[_0xb698('0x50')]);return _0x4df227[_0xb698('0x5a')](_0x3be7ac);}})[_0xb698('0x1c')](function(_0x2027f8){if(_0x2027f8){_0x1a6608=_0x2027f8[_0xb698('0x3c')];if(!_0x212cfe[_0xb698('0x36')]['hasOwnProperty'](_0xb698('0x3e'))){_0x3be7ac[_0xb698('0x29')]=qs['limit'](_0x212cfe['query'][_0xb698('0x29')]);_0x3be7ac['offset']=qs[_0xb698('0x28')](_0x212cfe[_0xb698('0x36')][_0xb698('0x28')]);}return _0x4df227[_0xb698('0x5a')](_0x3be7ac);}})[_0xb698('0x1c')](function(_0x101447){if(_0x101447){return _0x101447?{'count':_0x1a6608,'rows':_0x101447}:null;}})['then'](respondWithResult(_0x3a2b35,null))['catch'](handleError(_0x3a2b35,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index c533b31..e46fc68 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 _0x8a68=['define','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSalesforceConfiguration.attributes','exports'];(function(_0x3b49c1,_0x25cedf){var _0x2bcfb0=function(_0x1e12aa){while(--_0x1e12aa){_0x3b49c1['push'](_0x3b49c1['shift']());}};_0x2bcfb0(++_0x25cedf);}(_0x8a68,0xce));var _0x88a6=function(_0x4e1a5b,_0x1bc2a2){_0x4e1a5b=_0x4e1a5b-0x0;var _0x1fd8f8=_0x8a68[_0x4e1a5b];return _0x1fd8f8;};'use strict';var _=require(_0x88a6('0x0'));var util=require(_0x88a6('0x1'));var logger=require(_0x88a6('0x2'))(_0x88a6('0x3'));var moment=require(_0x88a6('0x4'));var BPromise=require(_0x88a6('0x5'));var rp=require(_0x88a6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x88a6('0x7'));var attributes=require(_0x88a6('0x8'));module[_0x88a6('0x9')]=function(_0x18809f,_0x2fc429){return _0x18809f[_0x88a6('0xa')]('SalesforceConfiguration',attributes,{'tableName':_0x88a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1f1=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x18c246,_0x53540e){var _0x27587e=function(_0x3b4798){while(--_0x3b4798){_0x18c246['push'](_0x18c246['shift']());}};_0x27587e(++_0x53540e);}(_0xe1f1,0xa0));var _0x1e1f=function(_0x9b84b4,_0x17077d){_0x9b84b4=_0x9b84b4-0x0;var _0x43c4e8=_0xe1f1[_0x9b84b4];return _0x43c4e8;};'use strict';var _=require('lodash');var util=require(_0x1e1f('0x0'));var logger=require(_0x1e1f('0x1'))(_0x1e1f('0x2'));var moment=require(_0x1e1f('0x3'));var BPromise=require('bluebird');var rp=require(_0x1e1f('0x4'));var fs=require('fs');var path=require(_0x1e1f('0x5'));var rimraf=require('rimraf');var config=require(_0x1e1f('0x6'));var attributes=require(_0x1e1f('0x7'));module['exports']=function(_0x4314de,_0x2bebe0){return _0x4314de['define'](_0x1e1f('0x8'),attributes,{'tableName':_0x1e1f('0x9'),'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 eb47d43..14faf84 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x4ee9af,_0x3fa6ba){var _0x16ed8c=function(_0x358380){while(--_0x358380){_0x4ee9af['push'](_0x4ee9af['shift']());}};_0x16ed8c(++_0x3fa6ba);}(_0xe14b,0x93));var _0xbe14=function(_0x2389a8,_0x25efe3){_0x2389a8=_0x2389a8-0x0;var _0x2438a8=_0xe14b[_0x2389a8];return _0x2438a8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x7217,0x19e));var _0x7721=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x7217[_0x4bfac3];return _0x15f0f2;};'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')]('SalesforceConfiguration,\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']('SalesforceConfiguration,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 237baa6..2f92a7a 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 _0x3db0=['update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x3db0,0x159));var _0x03db=function(_0x4ccd32,_0x3b11c9){_0x4ccd32=_0x4ccd32-0x0;var _0x30b693=_0x3db0[_0x4ccd32];return _0x30b693;};'use strict';var multer=require(_0x03db('0x0'));var util=require(_0x03db('0x1'));var path=require(_0x03db('0x2'));var timeout=require(_0x03db('0x3'));var express=require(_0x03db('0x4'));var router=express['Router']();var auth=require(_0x03db('0x5'));var interaction=require(_0x03db('0x6'));var config=require(_0x03db('0x7'));var controller=require(_0x03db('0x8'));router[_0x03db('0x9')]('/',auth[_0x03db('0xa')](),controller[_0x03db('0xb')]);router['get'](_0x03db('0xc'),auth[_0x03db('0xa')](),controller[_0x03db('0xd')]);router[_0x03db('0xe')]('/',auth[_0x03db('0xa')](),controller['create']);router[_0x03db('0xf')](_0x03db('0xc'),auth[_0x03db('0xa')](),controller[_0x03db('0x10')]);router[_0x03db('0x11')](_0x03db('0xc'),auth[_0x03db('0xa')](),controller[_0x03db('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4e8b=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x4e8b,0xab));var _0xb4e8=function(_0x4de586,_0x183427){_0x4de586=_0x4de586-0x0;var _0x46baf5=_0x4e8b[_0x4de586];return _0x46baf5;};'use strict';var multer=require(_0xb4e8('0x0'));var util=require(_0xb4e8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb4e8('0x2')]();var auth=require(_0xb4e8('0x3'));var interaction=require(_0xb4e8('0x4'));var config=require('../../config/environment');var controller=require(_0xb4e8('0x5'));router[_0xb4e8('0x6')]('/',auth[_0xb4e8('0x7')](),controller[_0xb4e8('0x8')]);router[_0xb4e8('0x6')](_0xb4e8('0x9'),auth[_0xb4e8('0x7')](),controller['show']);router[_0xb4e8('0xa')]('/',auth[_0xb4e8('0x7')](),controller[_0xb4e8('0xb')]);router[_0xb4e8('0xc')](_0xb4e8('0x9'),auth[_0xb4e8('0x7')](),controller[_0xb4e8('0xd')]);router[_0xb4e8('0xe')](_0xb4e8('0x9'),auth[_0xb4e8('0x7')](),controller['destroy']);module[_0xb4e8('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8580ad0..6a49a45 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 _0x492a=['STRING','variable','sequelize','ENUM','string','customVariable','keyValue'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x492a,0xc6));var _0xa492=function(_0x1dc422,_0x379f18){_0x1dc422=_0x1dc422-0x0;var _0x299f0a=_0x492a[_0x1dc422];return _0x299f0a;};'use strict';var Sequelize=require(_0xa492('0x0'));module['exports']={'type':{'type':Sequelize[_0xa492('0x1')](_0xa492('0x2'),'variable',_0xa492('0x3'),_0xa492('0x4')),'defaultValue':_0xa492('0x2')},'content':{'type':Sequelize[_0xa492('0x5')]},'key':{'type':Sequelize[_0xa492('0x5')]},'keyType':{'type':Sequelize[_0xa492('0x1')]('string',_0xa492('0x6'),_0xa492('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xa492('0x5')]}}; \ No newline at end of file +var _0x63c7=['customVariable','ENUM','string','variable','STRING'];(function(_0x3ae4cc,_0x1cd059){var _0x102b82=function(_0x5cfcdf){while(--_0x5cfcdf){_0x3ae4cc['push'](_0x3ae4cc['shift']());}};_0x102b82(++_0x1cd059);}(_0x63c7,0x1a5));var _0x763c=function(_0x2fec16,_0x3c6e34){_0x2fec16=_0x2fec16-0x0;var _0x56b703=_0x63c7[_0x2fec16];return _0x56b703;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x763c('0x0')](_0x763c('0x1'),_0x763c('0x2'),'customVariable','keyValue'),'defaultValue':_0x763c('0x1')},'content':{'type':Sequelize[_0x763c('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x763c('0x0')](_0x763c('0x1'),_0x763c('0x2'),_0x763c('0x4'))},'keyContent':{'type':Sequelize[_0x763c('0x3')]},'idField':{'type':Sequelize[_0x763c('0x3')]},'variableName':{'type':Sequelize[_0x763c('0x3')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 22cd2ac..58c925e 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 _0x7bac=['fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','index','SalesforceField','rawAttributes','model','keys','query','attributes','intersection'];(function(_0x133757,_0x5038c2){var _0x13d944=function(_0x5a59e3){while(--_0x5a59e3){_0x133757['push'](_0x133757['shift']());}};_0x13d944(++_0x5038c2);}(_0x7bac,0x186));var _0xc7ba=function(_0x1f5e25,_0x171656){_0x1f5e25=_0x1f5e25-0x0;var _0x2fbb0a=_0x7bac[_0x1f5e25];return _0x2fbb0a;};'use strict';var pdf=require(_0xc7ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc7ba('0x1'));var zipdir=require(_0xc7ba('0x2'));var jsonpatch=require(_0xc7ba('0x3'));var rp=require(_0xc7ba('0x4'));var moment=require(_0xc7ba('0x5'));var BPromise=require(_0xc7ba('0x6'));var Mustache=require(_0xc7ba('0x7'));var util=require('util');var path=require(_0xc7ba('0x8'));var sox=require(_0xc7ba('0x9'));var csv=require(_0xc7ba('0xa'));var ejs=require(_0xc7ba('0xb'));var fs=require('fs');var _=require(_0xc7ba('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc7ba('0xd'));var deskjs=require(_0xc7ba('0xe'));var toCsv=require(_0xc7ba('0xa'));var querystring=require(_0xc7ba('0xf'));var Papa=require(_0xc7ba('0x10'));var Redis=require(_0xc7ba('0x11'));var authService=require(_0xc7ba('0x12'));var qs=require(_0xc7ba('0x13'));var hardwareService=require(_0xc7ba('0x14'));var logger=require(_0xc7ba('0x15'))(_0xc7ba('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc7ba('0x17'))['db'];function respondWithStatusCode(_0x44921c,_0xa5f337){_0xa5f337=_0xa5f337||0xcc;return function(_0x4b1f76){if(_0x4b1f76){return _0x44921c[_0xc7ba('0x18')](_0xa5f337);}return _0x44921c[_0xc7ba('0x19')](_0xa5f337)['end']();};}function respondWithResult(_0x2755e5,_0x28d9d8){_0x28d9d8=_0x28d9d8||0xc8;return function(_0x6a6b51){if(_0x6a6b51){return _0x2755e5[_0xc7ba('0x19')](_0x28d9d8)[_0xc7ba('0x1a')](_0x6a6b51);}};}function respondWithFilteredResult(_0x5c582f,_0x3228bf){return function(_0x4bbc93){if(_0x4bbc93){var _0x4cbbc1=_0x4bbc93[_0xc7ba('0x1b')],_0x474a24=_0x3228bf[_0xc7ba('0x1c')],_0x4a462c=_0x3228bf[_0xc7ba('0x1c')]+_0x3228bf['limit'],_0x3f58c7;if(_0x4a462c>=_0x4cbbc1){_0x4a462c=_0x4cbbc1;_0x3f58c7=0xc8;}else{_0x3f58c7=0xce;}_0x5c582f[_0xc7ba('0x19')](_0x3f58c7);return _0x5c582f[_0xc7ba('0x1d')](_0xc7ba('0x1e'),_0x474a24+'-'+_0x4a462c+'/'+_0x4cbbc1)['json'](_0x4bbc93);}return null;};}function patchUpdates(_0x270ea1){return function(_0x156365){try{jsonpatch['apply'](_0x156365,_0x270ea1,!![]);}catch(_0x339d3c){return BPromise[_0xc7ba('0x1f')](_0x339d3c);}return _0x156365[_0xc7ba('0x20')]();};}function saveUpdates(_0x3d9082,_0x24561d){return function(_0x1d433d){if(_0x1d433d){return _0x1d433d[_0xc7ba('0x21')](_0x3d9082)[_0xc7ba('0x22')](function(_0xf6ac84){return _0xf6ac84;});}return null;};}function removeEntity(_0x4223a8,_0x394683){return function(_0x4e5ccb){if(_0x4e5ccb){return _0x4e5ccb[_0xc7ba('0x23')]()[_0xc7ba('0x22')](function(){_0x4223a8['status'](0xcc)[_0xc7ba('0x24')]();});}};}function handleEntityNotFound(_0x1dbb67,_0x21308c){return function(_0xfe6458){if(!_0xfe6458){_0x1dbb67[_0xc7ba('0x18')](0x194);}return _0xfe6458;};}function handleError(_0x4e964e,_0x36ee01){_0x36ee01=_0x36ee01||0x1f4;return function(_0x2939a5){logger[_0xc7ba('0x25')](_0x2939a5[_0xc7ba('0x26')]);if(_0x2939a5['name']){delete _0x2939a5[_0xc7ba('0x27')];}_0x4e964e['status'](_0x36ee01)['send'](_0x2939a5);};}exports[_0xc7ba('0x28')]=function(_0x33beaa,_0x1191bc){var _0x27e40d={},_0x1acd54={},_0x1db21b={'count':0x0,'rows':[]};var _0x269a61=db[_0xc7ba('0x29')][_0xc7ba('0x2a')];_0x1acd54[_0xc7ba('0x2b')]=_[_0xc7ba('0x2c')](_0x269a61);_0x1acd54['query']=_[_0xc7ba('0x2c')](_0x33beaa[_0xc7ba('0x2d')]);_0x1acd54['filters']=_['intersection'](_0x1acd54[_0xc7ba('0x2b')],_0x1acd54[_0xc7ba('0x2d')]);_0x27e40d[_0xc7ba('0x2e')]=_[_0xc7ba('0x2f')](_0x1acd54[_0xc7ba('0x2b')],qs[_0xc7ba('0x30')](_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x30')]));_0x27e40d[_0xc7ba('0x2e')]=_0x27e40d[_0xc7ba('0x2e')]['length']?_0x27e40d[_0xc7ba('0x2e')]:_0x1acd54[_0xc7ba('0x2b')];if(!_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x31')](_0xc7ba('0x32'))){_0x27e40d[_0xc7ba('0x33')]=qs['limit'](_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x33')]);_0x27e40d[_0xc7ba('0x1c')]=qs[_0xc7ba('0x1c')](_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x1c')]);}_0x27e40d[_0xc7ba('0x34')]=qs[_0xc7ba('0x35')](_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x35')]);_0x27e40d[_0xc7ba('0x36')]=qs[_0xc7ba('0x37')](_['pick'](_0x33beaa[_0xc7ba('0x2d')],_0x1acd54[_0xc7ba('0x37')]));if(_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x38')]){_0x27e40d[_0xc7ba('0x36')]=_[_0xc7ba('0x39')](_0x27e40d[_0xc7ba('0x36')],{'$or':_['map'](_0x269a61,function(_0x43613e){if(_0x43613e[_0xc7ba('0x3a')]['key']!==_0xc7ba('0x3b')){var _0x5a8832={};_0x5a8832[_0x43613e[_0xc7ba('0x3c')]]={'$like':'%'+_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x38')]+'%'};return _0x5a8832;}})});}_0x27e40d=_[_0xc7ba('0x39')]({},_0x27e40d,_0x33beaa['options']);var _0x12583d={'where':_0x27e40d['where']};return db[_0xc7ba('0x29')][_0xc7ba('0x1b')](_0x12583d)[_0xc7ba('0x22')](function(_0x4701f2){_0x1db21b[_0xc7ba('0x1b')]=_0x4701f2;if(_0x33beaa[_0xc7ba('0x2d')][_0xc7ba('0x3d')]){_0x27e40d[_0xc7ba('0x3e')]=[{'all':!![]}];}return db[_0xc7ba('0x29')][_0xc7ba('0x3f')](_0x27e40d);})['then'](function(_0x227304){_0x1db21b[_0xc7ba('0x40')]=_0x227304;return _0x1db21b;})['then'](respondWithFilteredResult(_0x1191bc,_0x27e40d))[_0xc7ba('0x41')](handleError(_0x1191bc,null));};exports[_0xc7ba('0x42')]=function(_0x375d1b,_0x465df6){var _0x263456={'raw':!![],'where':{'id':_0x375d1b[_0xc7ba('0x43')]['id']}},_0x43501b={};_0x43501b['model']=_[_0xc7ba('0x2c')](db[_0xc7ba('0x29')][_0xc7ba('0x2a')]);_0x43501b[_0xc7ba('0x2d')]=_['keys'](_0x375d1b[_0xc7ba('0x2d')]);_0x43501b[_0xc7ba('0x37')]=_['intersection'](_0x43501b['model'],_0x43501b['query']);_0x263456['attributes']=_[_0xc7ba('0x2f')](_0x43501b[_0xc7ba('0x2b')],qs[_0xc7ba('0x30')](_0x375d1b[_0xc7ba('0x2d')][_0xc7ba('0x30')]));_0x263456[_0xc7ba('0x2e')]=_0x263456[_0xc7ba('0x2e')][_0xc7ba('0x44')]?_0x263456[_0xc7ba('0x2e')]:_0x43501b[_0xc7ba('0x2b')];if(_0x375d1b[_0xc7ba('0x2d')][_0xc7ba('0x3d')]){_0x263456[_0xc7ba('0x3e')]=[{'all':!![]}];}_0x263456=_['merge']({},_0x263456,_0x375d1b[_0xc7ba('0x45')]);return db[_0xc7ba('0x29')][_0xc7ba('0x46')](_0x263456)[_0xc7ba('0x22')](handleEntityNotFound(_0x465df6,null))[_0xc7ba('0x22')](respondWithResult(_0x465df6,null))[_0xc7ba('0x41')](handleError(_0x465df6,null));};exports[_0xc7ba('0x47')]=function(_0x2628b2,_0x57ae2c){return db['SalesforceField'][_0xc7ba('0x47')](_0x2628b2[_0xc7ba('0x48')],{})['then'](respondWithResult(_0x57ae2c,0xc9))[_0xc7ba('0x41')](handleError(_0x57ae2c,null));};exports['update']=function(_0x10d589,_0x4385f8){if(_0x10d589[_0xc7ba('0x48')]['id']){delete _0x10d589[_0xc7ba('0x48')]['id'];}return db[_0xc7ba('0x29')]['find']({'where':{'id':_0x10d589['params']['id']}})[_0xc7ba('0x22')](handleEntityNotFound(_0x4385f8,null))[_0xc7ba('0x22')](saveUpdates(_0x10d589['body'],null))['then'](respondWithResult(_0x4385f8,null))[_0xc7ba('0x41')](handleError(_0x4385f8,null));};exports[_0xc7ba('0x23')]=function(_0x3032b7,_0x44df60){return db[_0xc7ba('0x29')][_0xc7ba('0x46')]({'where':{'id':_0x3032b7[_0xc7ba('0x43')]['id']}})['then'](handleEntityNotFound(_0x44df60,null))[_0xc7ba('0x22')](removeEntity(_0x44df60,null))[_0xc7ba('0x41')](handleError(_0x44df60,null));}; \ No newline at end of file +var _0x4d5c=['path','sox','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','SalesforceField','findAll','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x5ab5d9,_0x38a056){var _0x106fb8=function(_0x135e83){while(--_0x135e83){_0x5ab5d9['push'](_0x5ab5d9['shift']());}};_0x106fb8(++_0x38a056);}(_0x4d5c,0x119));var _0xc4d5=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x4d5c[_0x468b0f];return _0x3e74d9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc4d5('0x0'));var rimraf=require(_0xc4d5('0x1'));var zipdir=require(_0xc4d5('0x2'));var jsonpatch=require(_0xc4d5('0x3'));var rp=require(_0xc4d5('0x4'));var moment=require(_0xc4d5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc4d5('0x6'));var path=require(_0xc4d5('0x7'));var sox=require(_0xc4d5('0x8'));var csv=require('to-csv');var ejs=require(_0xc4d5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc4d5('0xa'));var crypto=require(_0xc4d5('0xb'));var jsforce=require(_0xc4d5('0xc'));var deskjs=require(_0xc4d5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc4d5('0xe'));var Redis=require(_0xc4d5('0xf'));var authService=require(_0xc4d5('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xc4d5('0x11'));var logger=require(_0xc4d5('0x12'))(_0xc4d5('0x13'));var utils=require(_0xc4d5('0x14'));var config=require(_0xc4d5('0x15'));var db=require(_0xc4d5('0x16'))['db'];function respondWithStatusCode(_0x39d3a8,_0x22eda8){_0x22eda8=_0x22eda8||0xcc;return function(_0xc4873f){if(_0xc4873f){return _0x39d3a8[_0xc4d5('0x17')](_0x22eda8);}return _0x39d3a8[_0xc4d5('0x18')](_0x22eda8)[_0xc4d5('0x19')]();};}function respondWithResult(_0x260cf2,_0x1fdc0b){_0x1fdc0b=_0x1fdc0b||0xc8;return function(_0x3f3a3a){if(_0x3f3a3a){return _0x260cf2[_0xc4d5('0x18')](_0x1fdc0b)[_0xc4d5('0x1a')](_0x3f3a3a);}};}function respondWithFilteredResult(_0x59375c,_0x3c4098){return function(_0x529067){if(_0x529067){var _0x1970ae=_0x529067[_0xc4d5('0x1b')],_0x277a97=_0x3c4098['offset'],_0x50770e=_0x3c4098[_0xc4d5('0x1c')]+_0x3c4098[_0xc4d5('0x1d')],_0x2b3b17;if(_0x50770e>=_0x1970ae){_0x50770e=_0x1970ae;_0x2b3b17=0xc8;}else{_0x2b3b17=0xce;}_0x59375c['status'](_0x2b3b17);return _0x59375c[_0xc4d5('0x1e')](_0xc4d5('0x1f'),_0x277a97+'-'+_0x50770e+'/'+_0x1970ae)[_0xc4d5('0x1a')](_0x529067);}return null;};}function patchUpdates(_0x3e7686){return function(_0x458300){try{jsonpatch[_0xc4d5('0x20')](_0x458300,_0x3e7686,!![]);}catch(_0x2dfe31){return BPromise[_0xc4d5('0x21')](_0x2dfe31);}return _0x458300[_0xc4d5('0x22')]();};}function saveUpdates(_0x319fef,_0x3c7417){return function(_0x5e79d1){if(_0x5e79d1){return _0x5e79d1[_0xc4d5('0x23')](_0x319fef)[_0xc4d5('0x24')](function(_0x4a9c4a){return _0x4a9c4a;});}return null;};}function removeEntity(_0xa688b5,_0x30e4d5){return function(_0x282501){if(_0x282501){return _0x282501[_0xc4d5('0x25')]()[_0xc4d5('0x24')](function(){_0xa688b5[_0xc4d5('0x18')](0xcc)[_0xc4d5('0x19')]();});}};}function handleEntityNotFound(_0x4c93fa,_0x12257e){return function(_0x38a9c1){if(!_0x38a9c1){_0x4c93fa['sendStatus'](0x194);}return _0x38a9c1;};}function handleError(_0x491875,_0x2893ad){_0x2893ad=_0x2893ad||0x1f4;return function(_0x4a3922){logger[_0xc4d5('0x26')](_0x4a3922['stack']);if(_0x4a3922[_0xc4d5('0x27')]){delete _0x4a3922[_0xc4d5('0x27')];}_0x491875['status'](_0x2893ad)[_0xc4d5('0x28')](_0x4a3922);};}exports['index']=function(_0x42e23c,_0x465b68){var _0x1e1b19={},_0x4e3997={},_0x594837={'count':0x0,'rows':[]};var _0x13e00a=db['SalesforceField'][_0xc4d5('0x29')];_0x4e3997[_0xc4d5('0x2a')]=_[_0xc4d5('0x2b')](_0x13e00a);_0x4e3997[_0xc4d5('0x2c')]=_[_0xc4d5('0x2b')](_0x42e23c[_0xc4d5('0x2c')]);_0x4e3997[_0xc4d5('0x2d')]=_[_0xc4d5('0x2e')](_0x4e3997[_0xc4d5('0x2a')],_0x4e3997[_0xc4d5('0x2c')]);_0x1e1b19[_0xc4d5('0x2f')]=_[_0xc4d5('0x2e')](_0x4e3997[_0xc4d5('0x2a')],qs[_0xc4d5('0x30')](_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x30')]));_0x1e1b19['attributes']=_0x1e1b19[_0xc4d5('0x2f')][_0xc4d5('0x31')]?_0x1e1b19[_0xc4d5('0x2f')]:_0x4e3997['model'];if(!_0x42e23c[_0xc4d5('0x2c')]['hasOwnProperty'](_0xc4d5('0x32'))){_0x1e1b19[_0xc4d5('0x1d')]=qs[_0xc4d5('0x1d')](_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x1d')]);_0x1e1b19[_0xc4d5('0x1c')]=qs[_0xc4d5('0x1c')](_0x42e23c[_0xc4d5('0x2c')]['offset']);}_0x1e1b19[_0xc4d5('0x33')]=qs[_0xc4d5('0x34')](_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x34')]);_0x1e1b19['where']=qs[_0xc4d5('0x2d')](_[_0xc4d5('0x35')](_0x42e23c[_0xc4d5('0x2c')],_0x4e3997[_0xc4d5('0x2d')]));if(_0x42e23c[_0xc4d5('0x2c')]['filter']){_0x1e1b19[_0xc4d5('0x36')]=_[_0xc4d5('0x37')](_0x1e1b19[_0xc4d5('0x36')],{'$or':_[_0xc4d5('0x38')](_0x13e00a,function(_0x38961a){if(_0x38961a[_0xc4d5('0x39')][_0xc4d5('0x3a')]!==_0xc4d5('0x3b')){var _0x3b6a40={};_0x3b6a40[_0x38961a[_0xc4d5('0x3c')]]={'$like':'%'+_0x42e23c['query']['filter']+'%'};return _0x3b6a40;}})});}_0x1e1b19=_[_0xc4d5('0x37')]({},_0x1e1b19,_0x42e23c[_0xc4d5('0x3d')]);var _0x2f21d2={'where':_0x1e1b19['where']};return db['SalesforceField'][_0xc4d5('0x1b')](_0x2f21d2)[_0xc4d5('0x24')](function(_0x41d742){_0x594837['count']=_0x41d742;if(_0x42e23c[_0xc4d5('0x2c')][_0xc4d5('0x3e')]){_0x1e1b19[_0xc4d5('0x3f')]=[{'all':!![]}];}return db[_0xc4d5('0x40')][_0xc4d5('0x41')](_0x1e1b19);})[_0xc4d5('0x24')](function(_0x3c381f){_0x594837['rows']=_0x3c381f;return _0x594837;})[_0xc4d5('0x24')](respondWithFilteredResult(_0x465b68,_0x1e1b19))[_0xc4d5('0x42')](handleError(_0x465b68,null));};exports[_0xc4d5('0x43')]=function(_0x17499f,_0xaf85d0){var _0x28f44a={'raw':!![],'where':{'id':_0x17499f['params']['id']}},_0x4ee474={};_0x4ee474[_0xc4d5('0x2a')]=_[_0xc4d5('0x2b')](db[_0xc4d5('0x40')][_0xc4d5('0x29')]);_0x4ee474['query']=_['keys'](_0x17499f[_0xc4d5('0x2c')]);_0x4ee474['filters']=_[_0xc4d5('0x2e')](_0x4ee474[_0xc4d5('0x2a')],_0x4ee474['query']);_0x28f44a[_0xc4d5('0x2f')]=_['intersection'](_0x4ee474[_0xc4d5('0x2a')],qs[_0xc4d5('0x30')](_0x17499f[_0xc4d5('0x2c')][_0xc4d5('0x30')]));_0x28f44a[_0xc4d5('0x2f')]=_0x28f44a[_0xc4d5('0x2f')][_0xc4d5('0x31')]?_0x28f44a[_0xc4d5('0x2f')]:_0x4ee474[_0xc4d5('0x2a')];if(_0x17499f[_0xc4d5('0x2c')]['includeAll']){_0x28f44a['include']=[{'all':!![]}];}_0x28f44a=_['merge']({},_0x28f44a,_0x17499f['options']);return db[_0xc4d5('0x40')]['find'](_0x28f44a)['then'](handleEntityNotFound(_0xaf85d0,null))[_0xc4d5('0x24')](respondWithResult(_0xaf85d0,null))[_0xc4d5('0x42')](handleError(_0xaf85d0,null));};exports[_0xc4d5('0x44')]=function(_0xc17747,_0x17a8e6){return db[_0xc4d5('0x40')][_0xc4d5('0x44')](_0xc17747[_0xc4d5('0x45')],{})['then'](respondWithResult(_0x17a8e6,0xc9))[_0xc4d5('0x42')](handleError(_0x17a8e6,null));};exports[_0xc4d5('0x23')]=function(_0x575954,_0x4cbb5b){if(_0x575954[_0xc4d5('0x45')]['id']){delete _0x575954[_0xc4d5('0x45')]['id'];}return db[_0xc4d5('0x40')][_0xc4d5('0x46')]({'where':{'id':_0x575954[_0xc4d5('0x47')]['id']}})['then'](handleEntityNotFound(_0x4cbb5b,null))[_0xc4d5('0x24')](saveUpdates(_0x575954[_0xc4d5('0x45')],null))['then'](respondWithResult(_0x4cbb5b,null))[_0xc4d5('0x42')](handleError(_0x4cbb5b,null));};exports[_0xc4d5('0x25')]=function(_0x1e3fda,_0x150db5){return db['SalesforceField'][_0xc4d5('0x46')]({'where':{'id':_0x1e3fda['params']['id']}})[_0xc4d5('0x24')](handleEntityNotFound(_0x150db5,null))['then'](removeEntity(_0x150db5,null))[_0xc4d5('0x42')](handleError(_0x150db5,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 411726d..106b178 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 _0x516f=['SalesforceField','int_salesforce_fields','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./intSalesforceField.attributes','exports','define'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0x516f,0xb9));var _0xf516=function(_0x2cdf96,_0x3de28b){_0x2cdf96=_0x2cdf96-0x0;var _0x47ec3a=_0x516f[_0x2cdf96];return _0x47ec3a;};'use strict';var _=require(_0xf516('0x0'));var util=require(_0xf516('0x1'));var logger=require(_0xf516('0x2'))(_0xf516('0x3'));var moment=require('moment');var BPromise=require(_0xf516('0x4'));var rp=require(_0xf516('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf516('0x6'));var config=require('../../config/environment');var attributes=require(_0xf516('0x7'));module[_0xf516('0x8')]=function(_0x3290ef,_0x2b4eb9){return _0x3290ef[_0xf516('0x9')](_0xf516('0xa'),attributes,{'tableName':_0xf516('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField',_0xf516('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x491b=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','../../config/logger','api','moment','path','../../config/environment','exports','define'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x491b,0x119));var _0xb491=function(_0x10e1b3,_0x52f3ed){_0x10e1b3=_0x10e1b3-0x0;var _0x3be5ca=_0x491b[_0x10e1b3];return _0x3be5ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb491('0x0'))(_0xb491('0x1'));var moment=require(_0xb491('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb491('0x3'));var rimraf=require('rimraf');var config=require(_0xb491('0x4'));var attributes=require('./intSalesforceField.attributes');module[_0xb491('0x5')]=function(_0x1c856,_0x10ff69){return _0x1c856[_0xb491('0x6')](_0xb491('0x7'),attributes,{'tableName':_0xb491('0x8'),'paranoid':![],'indexes':[{'name':_0xb491('0x9'),'fields':[_0xb491('0xa'),_0xb491('0xb')],'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 207b61a..975d9f0 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 _0x1507=['request','then','info','SalesforceField,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0xd9ed87,_0x432a9c){var _0x5968af=function(_0xa9803d){while(--_0xa9803d){_0xd9ed87['push'](_0xd9ed87['shift']());}};_0x5968af(++_0x432a9c);}(_0x1507,0x19a));var _0x7150=function(_0x63c794,_0x14f52c){_0x63c794=_0x63c794-0x0;var _0x16f319=_0x1507[_0x63c794];return _0x16f319;};'use strict';var _=require(_0x7150('0x0'));var util=require(_0x7150('0x1'));var moment=require(_0x7150('0x2'));var BPromise=require(_0x7150('0x3'));var rs=require(_0x7150('0x4'));var fs=require('fs');var Redis=require(_0x7150('0x5'));var db=require(_0x7150('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7150('0x7'));var config=require('../../config/environment');var jayson=require(_0x7150('0x8'));var client=jayson[_0x7150('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f9aca,_0x313a68,_0x47a876){return new BPromise(function(_0x50a2f9,_0x298a77){return client[_0x7150('0xa')](_0x3f9aca,_0x47a876)[_0x7150('0xb')](function(_0x5ac6a7){logger[_0x7150('0xc')](_0x7150('0xd'),_0x313a68,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x313a68,'request\x20sent',JSON[_0x7150('0xe')](_0x5ac6a7));if(_0x5ac6a7[_0x7150('0xf')]){if(_0x5ac6a7[_0x7150('0xf')][_0x7150('0x10')]===0x1f4){logger['error'](_0x7150('0xd'),_0x313a68,_0x5ac6a7['error'][_0x7150('0x11')]);return _0x298a77(_0x5ac6a7[_0x7150('0xf')][_0x7150('0x11')]);}logger[_0x7150('0xf')](_0x7150('0xd'),_0x313a68,_0x5ac6a7[_0x7150('0xf')][_0x7150('0x11')]);return _0x50a2f9(_0x5ac6a7[_0x7150('0xf')][_0x7150('0x11')]);}else{logger[_0x7150('0xc')](_0x7150('0xd'),_0x313a68,_0x7150('0x12'));_0x50a2f9(_0x5ac6a7[_0x7150('0x13')][_0x7150('0x11')]);}})[_0x7150('0x14')](function(_0x5a7e50){logger[_0x7150('0xf')](_0x7150('0xd'),_0x313a68,_0x5a7e50);_0x298a77(_0x5a7e50);});});} \ No newline at end of file +var _0xdb80=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d5e76,_0x4a27bf){var _0x1f8064=function(_0x2c07bb){while(--_0x2c07bb){_0x2d5e76['push'](_0x2d5e76['shift']());}};_0x1f8064(++_0x4a27bf);}(_0xdb80,0xc3));var _0x0db8=function(_0x56e654,_0x5625c){_0x56e654=_0x56e654-0x0;var _0x237130=_0xdb80[_0x56e654];return _0x237130;};'use strict';var _=require(_0x0db8('0x0'));var util=require(_0x0db8('0x1'));var moment=require(_0x0db8('0x2'));var BPromise=require(_0x0db8('0x3'));var rs=require(_0x0db8('0x4'));var fs=require('fs');var Redis=require(_0x0db8('0x5'));var db=require(_0x0db8('0x6'))['db'];var utils=require(_0x0db8('0x7'));var logger=require(_0x0db8('0x8'))(_0x0db8('0x9'));var config=require(_0x0db8('0xa'));var jayson=require(_0x0db8('0xb'));var client=jayson[_0x0db8('0xc')][_0x0db8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xd95e6b,_0x30291d,_0x15d3b4){return new BPromise(function(_0x54b5da,_0x47eb89){return client[_0x0db8('0xe')](_0xd95e6b,_0x15d3b4)[_0x0db8('0xf')](function(_0x14489d){logger['info'](_0x0db8('0x10'),_0x30291d,_0x0db8('0x11'));logger[_0x0db8('0x12')](_0x0db8('0x13'),_0x30291d,'request\x20sent',JSON[_0x0db8('0x14')](_0x14489d));if(_0x14489d[_0x0db8('0x15')]){if(_0x14489d[_0x0db8('0x15')][_0x0db8('0x16')]===0x1f4){logger[_0x0db8('0x15')](_0x0db8('0x10'),_0x30291d,_0x14489d['error'][_0x0db8('0x17')]);return _0x47eb89(_0x14489d['error'][_0x0db8('0x17')]);}logger[_0x0db8('0x15')]('SalesforceField,\x20%s,\x20%s',_0x30291d,_0x14489d['error'][_0x0db8('0x17')]);return _0x54b5da(_0x14489d[_0x0db8('0x15')][_0x0db8('0x17')]);}else{logger[_0x0db8('0x18')](_0x0db8('0x10'),_0x30291d,_0x0db8('0x11'));_0x54b5da(_0x14489d[_0x0db8('0x19')][_0x0db8('0x17')]);}})[_0x0db8('0x1a')](function(_0x293b6e){logger[_0x0db8('0x15')]('SalesforceField,\x20%s,\x20%s',_0x30291d,_0x293b6e);_0x47eb89(_0x293b6e);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b793d68..829feac 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 _0xced8=['isAuthenticated','getConfigurations','/:id/fields','getFields','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','/:id'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xced8,0xdd));var _0x8ced=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xced8[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x8ced('0x0'));var util=require('util');var path=require(_0x8ced('0x1'));var timeout=require(_0x8ced('0x2'));var express=require(_0x8ced('0x3'));var router=express[_0x8ced('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8ced('0x5'));var config=require(_0x8ced('0x6'));var controller=require(_0x8ced('0x7'));router[_0x8ced('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8ced('0x9'),auth[_0x8ced('0xa')](),controller['show']);router[_0x8ced('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8ced('0xb')]);router[_0x8ced('0x8')](_0x8ced('0xc'),auth[_0x8ced('0xa')](),controller[_0x8ced('0xd')]);router['post']('/',auth[_0x8ced('0xa')](),controller['create']);router['post'](_0x8ced('0xe'),auth[_0x8ced('0xa')](),controller[_0x8ced('0xf')]);router[_0x8ced('0x10')](_0x8ced('0x9'),auth[_0x8ced('0xa')](),controller[_0x8ced('0x11')]);router[_0x8ced('0x12')](_0x8ced('0x9'),auth[_0x8ced('0xa')](),controller[_0x8ced('0x13')]);module[_0x8ced('0x14')]=router; \ No newline at end of file +var _0xe3c0=['get','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','/:id','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated'];(function(_0x240700,_0x13e7d9){var _0x51530c=function(_0x1e1420){while(--_0x1e1420){_0x240700['push'](_0x240700['shift']());}};_0x51530c(++_0x13e7d9);}(_0xe3c0,0x194));var _0x0e3c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe3c0[_0x2b5eae];return _0x5f3ac9;};'use strict';var multer=require(_0x0e3c('0x0'));var util=require(_0x0e3c('0x1'));var path=require(_0x0e3c('0x2'));var timeout=require(_0x0e3c('0x3'));var express=require(_0x0e3c('0x4'));var router=express[_0x0e3c('0x5')]();var auth=require(_0x0e3c('0x6'));var interaction=require(_0x0e3c('0x7'));var config=require('../../config/environment');var controller=require(_0x0e3c('0x8'));router['get']('/',auth[_0x0e3c('0x9')](),controller['index']);router[_0x0e3c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0e3c('0xb')]);router[_0x0e3c('0xa')](_0x0e3c('0xc'),auth[_0x0e3c('0x9')](),controller[_0x0e3c('0xd')]);router['get'](_0x0e3c('0xe'),auth['isAuthenticated'](),controller[_0x0e3c('0xf')]);router['post']('/',auth[_0x0e3c('0x9')](),controller[_0x0e3c('0x10')]);router[_0x0e3c('0x11')](_0x0e3c('0xc'),auth[_0x0e3c('0x9')](),controller[_0x0e3c('0x12')]);router[_0x0e3c('0x13')](_0x0e3c('0x14'),auth[_0x0e3c('0x9')](),controller['update']);router[_0x0e3c('0x15')](_0x0e3c('0x14'),auth[_0x0e3c('0x9')](),controller[_0x0e3c('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 d27ea41..d4dc244 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 _0x9aea=['remoteUri','sequelize','STRING','username'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x9aea,0xdd));var _0xa9ae=function(_0x29819b,_0x514ae4){_0x29819b=_0x29819b-0x0;var _0x437a09=_0x9aea[_0x29819b];return _0x437a09;};'use strict';var Sequelize=require(_0xa9ae('0x0'));module['exports']={'name':{'type':Sequelize[_0xa9ae('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa9ae('0x1')],'unique':_0xa9ae('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa9ae('0x1')]},'remoteUri':{'type':Sequelize[_0xa9ae('0x1')],'unique':_0xa9ae('0x3')},'serverUrl':{'type':Sequelize[_0xa9ae('0x1')]}}; \ No newline at end of file +var _0x7072=['exports','STRING','username'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7072,0x138));var _0x2707=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x7072[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require('sequelize');module[_0x2707('0x0')]={'name':{'type':Sequelize[_0x2707('0x1')]},'description':{'type':Sequelize[_0x2707('0x1')]},'username':{'type':Sequelize[_0x2707('0x1')],'unique':_0x2707('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2707('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2707('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index b26eede..f9e7574 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 _0x5738=['contact_type','reopened_by','incident_state','urgency','problem_id','company','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','findOne','username','password','email','serverUrl','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','statusCode','Wrong\x20credentials','options','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../components/integrations/configuration','client','test','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','ServicenowAccount','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','map','type','VIRTUAL','field','filter','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','order','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','getFields','made_sla','hold_reason','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','impact','work_notes_list','business_service','sys_domain_path','time_worked','expected_start','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','additional_assignee_list','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x5738,0xee));var _0x8573=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0x5738[_0x30f5bb];return _0x1cfc00;};'use strict';var pdf=require(_0x8573('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8573('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8573('0x2'));var rp=require(_0x8573('0x3'));var moment=require(_0x8573('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8573('0x5'));var util=require('util');var path=require('path');var sox=require(_0x8573('0x6'));var csv=require('to-csv');var ejs=require(_0x8573('0x7'));var fs=require('fs');var _=require(_0x8573('0x8'));var squel=require(_0x8573('0x9'));var crypto=require(_0x8573('0xa'));var jsforce=require(_0x8573('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8573('0xc'));var Papa=require(_0x8573('0xd'));var Redis=require('ioredis');var authService=require(_0x8573('0xe'));var qs=require(_0x8573('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8573('0x10'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x8573('0x11'));var jayson=require('jayson/promise');var client=jayson[_0x8573('0x12')]['http']({'port':0x232a});function checkPasswordPattern(_0x209b66,_0x45c45b,_0x40a2f6){if(_0x40a2f6){var _0x3939e7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3939e7[_0x8573('0x13')](_0x45c45b)){return _0x209b66;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x209b66;}}function respondWithRpcPromise(_0x5da322,_0x22c781,_0x82191b,_0x26cf71){return new BPromise(function(_0x1f36a1,_0x38ac4){var _0x6aa9f1=_0x26cf71||client;return _0x6aa9f1[_0x8573('0x14')](_0x5da322,_0x82191b)[_0x8573('0x15')](function(_0x363ff2){logger['info'](_0x8573('0x16'),_0x22c781,_0x8573('0x17'));logger[_0x8573('0x18')](_0x8573('0x19'),_0x22c781,_0x8573('0x17'),JSON['stringify'](_0x363ff2));if(_0x363ff2[_0x8573('0x1a')]){if(_0x363ff2[_0x8573('0x1a')]['code']===0x1f4){logger[_0x8573('0x1a')](_0x8573('0x16'),_0x22c781,_0x363ff2[_0x8573('0x1a')][_0x8573('0x1b')]);return _0x38ac4(_0x363ff2[_0x8573('0x1a')][_0x8573('0x1b')]);}logger[_0x8573('0x1a')](_0x8573('0x16'),_0x22c781,_0x363ff2[_0x8573('0x1a')][_0x8573('0x1b')]);return _0x1f36a1(_0x363ff2[_0x8573('0x1a')][_0x8573('0x1b')]);}else{logger[_0x8573('0x1c')](_0x8573('0x16'),_0x22c781,_0x8573('0x17'));_0x1f36a1(_0x363ff2[_0x8573('0x1d')][_0x8573('0x1b')]);}})['catch'](function(_0x21f0ad){logger[_0x8573('0x1a')](_0x8573('0x16'),_0x22c781,_0x21f0ad);_0x38ac4(_0x21f0ad);});});}function respondWithStatusCode(_0x3b7674,_0x4ed475){_0x4ed475=_0x4ed475||0xcc;return function(_0x4ebd44){if(_0x4ebd44){return _0x3b7674[_0x8573('0x1e')](_0x4ed475);}return _0x3b7674['status'](_0x4ed475)[_0x8573('0x1f')]();};}function respondWithResult(_0x4e8f38,_0x316d8a){_0x316d8a=_0x316d8a||0xc8;return function(_0x55c777){if(_0x55c777){return _0x4e8f38[_0x8573('0x20')](_0x316d8a)[_0x8573('0x21')](_0x55c777);}};}function respondWithFilteredResult(_0x1f38e2,_0x342962){return function(_0x2d799c){if(_0x2d799c){var _0x1a4408=_0x2d799c[_0x8573('0x22')],_0x201647=_0x342962['offset'],_0x534489=_0x342962[_0x8573('0x23')]+_0x342962[_0x8573('0x24')],_0x4198e8;if(_0x534489>=_0x1a4408){_0x534489=_0x1a4408;_0x4198e8=0xc8;}else{_0x4198e8=0xce;}_0x1f38e2[_0x8573('0x20')](_0x4198e8);return _0x1f38e2[_0x8573('0x25')]('Content-Range',_0x201647+'-'+_0x534489+'/'+_0x1a4408)[_0x8573('0x21')](_0x2d799c);}return null;};}function patchUpdates(_0x12b794){return function(_0x208082){try{jsonpatch[_0x8573('0x26')](_0x208082,_0x12b794,!![]);}catch(_0x42de4d){return BPromise[_0x8573('0x27')](_0x42de4d);}return _0x208082[_0x8573('0x28')]();};}function saveUpdates(_0x15cb7c,_0x21a8de){return function(_0x314e03){if(_0x314e03){return _0x314e03[_0x8573('0x29')](_0x15cb7c)[_0x8573('0x15')](function(_0x2a0f92){return _0x2a0f92;});}return null;};}function removeEntity(_0x37f9fd,_0x5104de){return function(_0x5eaa6d){if(_0x5eaa6d){return _0x5eaa6d['destroy']()[_0x8573('0x15')](function(){_0x37f9fd[_0x8573('0x20')](0xcc)[_0x8573('0x1f')]();});}};}function handleEntityNotFound(_0x525bf5,_0x3fe0f6){return function(_0x3c51ce){if(!_0x3c51ce){_0x525bf5[_0x8573('0x1e')](0x194);}return _0x3c51ce;};}function handleError(_0x1282da,_0x12d7e0){_0x12d7e0=_0x12d7e0||0x1f4;return function(_0x3ce782){logger[_0x8573('0x1a')](_0x3ce782[_0x8573('0x2a')]);if(_0x3ce782['name']){delete _0x3ce782[_0x8573('0x2b')];}_0x1282da[_0x8573('0x20')](_0x12d7e0)[_0x8573('0x2c')](_0x3ce782);};}exports[_0x8573('0x2d')]=function(_0x11193e,_0x2dbe49){var _0x3b9dfc={},_0x14a87d={},_0x5b8add={'count':0x0,'rows':[]};var _0x1ea319=db[_0x8573('0x2e')][_0x8573('0x2f')];_0x14a87d['model']=_[_0x8573('0x30')](_0x1ea319);_0x14a87d[_0x8573('0x31')]=_[_0x8573('0x30')](_0x11193e[_0x8573('0x31')]);_0x14a87d[_0x8573('0x32')]=_[_0x8573('0x33')](_0x14a87d[_0x8573('0x34')],_0x14a87d[_0x8573('0x31')]);_0x3b9dfc[_0x8573('0x35')]=_[_0x8573('0x33')](_0x14a87d['model'],qs[_0x8573('0x36')](_0x11193e['query'][_0x8573('0x36')]));_0x3b9dfc[_0x8573('0x35')]=_0x3b9dfc['attributes'][_0x8573('0x37')]?_0x3b9dfc[_0x8573('0x35')]:_0x14a87d['model'];if(!_0x11193e[_0x8573('0x31')][_0x8573('0x38')]('nolimit')){_0x3b9dfc[_0x8573('0x24')]=qs[_0x8573('0x24')](_0x11193e[_0x8573('0x31')][_0x8573('0x24')]);_0x3b9dfc[_0x8573('0x23')]=qs['offset'](_0x11193e['query'][_0x8573('0x23')]);}_0x3b9dfc['order']=qs[_0x8573('0x39')](_0x11193e[_0x8573('0x31')][_0x8573('0x39')]);_0x3b9dfc['where']=qs[_0x8573('0x32')](_[_0x8573('0x3a')](_0x11193e['query'],_0x14a87d['filters']));if(_0x11193e[_0x8573('0x31')]['filter']){_0x3b9dfc[_0x8573('0x3b')]=_[_0x8573('0x3c')](_0x3b9dfc[_0x8573('0x3b')],{'$or':_[_0x8573('0x3d')](_0x1ea319,function(_0x4ee485){if(_0x4ee485[_0x8573('0x3e')]['key']!==_0x8573('0x3f')){var _0x536c24={};_0x536c24[_0x4ee485[_0x8573('0x40')]]={'$like':'%'+_0x11193e[_0x8573('0x31')][_0x8573('0x41')]+'%'};return _0x536c24;}})});}_0x3b9dfc=_[_0x8573('0x3c')]({},_0x3b9dfc,_0x11193e['options']);var _0x1c4b79={'where':_0x3b9dfc[_0x8573('0x3b')]};return db[_0x8573('0x2e')][_0x8573('0x22')](_0x1c4b79)['then'](function(_0x1235e0){_0x5b8add[_0x8573('0x22')]=_0x1235e0;if(_0x11193e[_0x8573('0x31')][_0x8573('0x42')]){_0x3b9dfc[_0x8573('0x43')]=[{'all':!![]}];}return db[_0x8573('0x2e')][_0x8573('0x44')](_0x3b9dfc);})[_0x8573('0x15')](function(_0x27c6dd){_0x5b8add[_0x8573('0x45')]=_0x27c6dd;return _0x5b8add;})[_0x8573('0x15')](respondWithFilteredResult(_0x2dbe49,_0x3b9dfc))[_0x8573('0x46')](handleError(_0x2dbe49,null));};exports['show']=function(_0x5968aa,_0x55ea42){var _0x2fabc1={'raw':![],'where':{'id':_0x5968aa[_0x8573('0x47')]['id']}},_0x541dc3={};_0x541dc3['model']=_['keys'](db[_0x8573('0x2e')][_0x8573('0x2f')]);_0x541dc3[_0x8573('0x31')]=_[_0x8573('0x30')](_0x5968aa[_0x8573('0x31')]);_0x541dc3[_0x8573('0x32')]=_[_0x8573('0x33')](_0x541dc3['model'],_0x541dc3['query']);_0x2fabc1[_0x8573('0x35')]=_['intersection'](_0x541dc3[_0x8573('0x34')],qs['fields'](_0x5968aa[_0x8573('0x31')]['fields']));_0x2fabc1[_0x8573('0x35')]=_0x2fabc1[_0x8573('0x35')][_0x8573('0x37')]?_0x2fabc1[_0x8573('0x35')]:_0x541dc3[_0x8573('0x34')];if(_0x5968aa[_0x8573('0x31')][_0x8573('0x42')]){_0x2fabc1['include']=[{'all':!![]}];}_0x2fabc1=_[_0x8573('0x3c')]({},_0x2fabc1,_0x5968aa['options']);return db[_0x8573('0x2e')][_0x8573('0x48')](_0x2fabc1)[_0x8573('0x15')](handleEntityNotFound(_0x55ea42,null))['then'](respondWithResult(_0x55ea42,null))[_0x8573('0x46')](handleError(_0x55ea42,null));};exports['create']=function(_0xdf4ca0,_0x52820e){return db[_0x8573('0x2e')][_0x8573('0x49')](_0xdf4ca0[_0x8573('0x4a')],{})['then'](respondWithResult(_0x52820e,0xc9))[_0x8573('0x46')](handleError(_0x52820e,null));};exports['update']=function(_0x2a711b,_0x5365cf){if(_0x2a711b['body']['id']){delete _0x2a711b[_0x8573('0x4a')]['id'];}return db[_0x8573('0x2e')][_0x8573('0x48')]({'where':{'id':_0x2a711b[_0x8573('0x47')]['id']}})[_0x8573('0x15')](handleEntityNotFound(_0x5365cf,null))[_0x8573('0x15')](saveUpdates(_0x2a711b[_0x8573('0x4a')],null))[_0x8573('0x15')](respondWithResult(_0x5365cf,null))['catch'](handleError(_0x5365cf,null));};exports[_0x8573('0x4b')]=function(_0xad9b8a,_0x2ae7bf){return db[_0x8573('0x2e')][_0x8573('0x48')]({'where':{'id':_0xad9b8a[_0x8573('0x47')]['id']}})[_0x8573('0x15')](handleEntityNotFound(_0x2ae7bf,null))[_0x8573('0x15')](removeEntity(_0x2ae7bf,null))[_0x8573('0x46')](handleError(_0x2ae7bf,null));};exports[_0x8573('0x4c')]=function(_0x333fe9,_0x2b33f1,_0x483823){var _0x573383={};var _0x3c7805={};var _0x5cfc6f;var _0x333ea8;return db[_0x8573('0x2e')]['findOne']({'where':{'id':_0x333fe9[_0x8573('0x47')]['id']}})[_0x8573('0x15')](handleEntityNotFound(_0x2b33f1,null))[_0x8573('0x15')](function(_0x2e090c){if(_0x2e090c){_0x5cfc6f=_0x2e090c;_0x3c7805[_0x8573('0x34')]=_[_0x8573('0x30')](db['ServicenowConfiguration']['rawAttributes']);_0x3c7805[_0x8573('0x31')]=_['keys'](_0x333fe9[_0x8573('0x31')]);_0x3c7805[_0x8573('0x32')]=_[_0x8573('0x33')](_0x3c7805['model'],_0x3c7805['query']);_0x573383[_0x8573('0x35')]=_[_0x8573('0x33')](_0x3c7805[_0x8573('0x34')],qs[_0x8573('0x36')](_0x333fe9[_0x8573('0x31')][_0x8573('0x36')]));_0x573383[_0x8573('0x35')]=_0x573383[_0x8573('0x35')][_0x8573('0x37')]?_0x573383[_0x8573('0x35')]:_0x3c7805['model'];_0x573383[_0x8573('0x4d')]=qs[_0x8573('0x39')](_0x333fe9[_0x8573('0x31')][_0x8573('0x39')]);_0x573383[_0x8573('0x3b')]=qs[_0x8573('0x32')](_[_0x8573('0x3a')](_0x333fe9[_0x8573('0x31')],_0x3c7805[_0x8573('0x32')]));if(_0x333fe9[_0x8573('0x31')][_0x8573('0x41')]){_0x573383['where']=_[_0x8573('0x3c')](_0x573383[_0x8573('0x3b')],{'$or':_[_0x8573('0x3d')](_0x573383[_0x8573('0x35')],function(_0x4b2743){var _0xabfe89={};_0xabfe89[_0x4b2743]={'$like':'%'+_0x333fe9[_0x8573('0x31')][_0x8573('0x41')]+'%'};return _0xabfe89;})});}_0x573383=_[_0x8573('0x3c')]({},_0x573383,_0x333fe9['options']);return _0x5cfc6f[_0x8573('0x4c')](_0x573383);}})[_0x8573('0x15')](function(_0x1bcef7){if(_0x1bcef7){_0x333ea8=_0x1bcef7[_0x8573('0x37')];if(!_0x333fe9['query'][_0x8573('0x38')]('nolimit')){_0x573383['limit']=qs[_0x8573('0x24')](_0x333fe9['query'][_0x8573('0x24')]);_0x573383[_0x8573('0x23')]=qs[_0x8573('0x23')](_0x333fe9[_0x8573('0x31')][_0x8573('0x23')]);}return _0x5cfc6f[_0x8573('0x4c')](_0x573383);}})[_0x8573('0x15')](function(_0x480d4e){if(_0x480d4e){return _0x480d4e?{'count':_0x333ea8,'rows':_0x480d4e}:null;}})[_0x8573('0x15')](respondWithResult(_0x2b33f1,null))[_0x8573('0x46')](handleError(_0x2b33f1,null));};exports['addConfiguration']=function(_0xf309bf,_0xe9437c,_0x5a0ffb){if(_0xf309bf['body']['id']){delete _0xf309bf[_0x8573('0x4a')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0xf309bf[_0x8573('0x47')]['id']}})[_0x8573('0x15')](handleEntityNotFound(_0xe9437c,null))[_0x8573('0x15')](function(_0x55a7e9){if(_0x55a7e9){_0xf309bf[_0x8573('0x4a')][_0x8573('0x4e')]=_0x55a7e9['id'];_0xf309bf[_0x8573('0x4a')][_0x8573('0x4f')]=integrations['getSubjects'](_0xf309bf[_0x8573('0x4a')][_0x8573('0x50')],_0xf309bf['body']['type']);_0xf309bf['body'][_0x8573('0x51')]=integrations[_0x8573('0x52')](_0xf309bf['body'][_0x8573('0x50')],_0xf309bf[_0x8573('0x4a')][_0x8573('0x3e')]);return db[_0x8573('0x53')][_0x8573('0x49')](_0xf309bf[_0x8573('0x4a')],{'include':[{'model':db['ServicenowField'],'as':_0x8573('0x4f')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x8573('0x15')](respondWithResult(_0xe9437c,null))['catch'](handleError(_0xe9437c,null));};exports[_0x8573('0x54')]=function(_0x40c55c,_0x72f211,_0x5f54f1){var _0x223423=[_0x8573('0x55'),_0x8573('0x56'),'knowledge',_0x8573('0x57'),_0x8573('0x58'),_0x8573('0x59'),'incident_state',_0x8573('0x5a'),_0x8573('0x5b')];var _0x259533=[_0x8573('0x5c'),_0x8573('0x55'),_0x8573('0x5d'),_0x8573('0x5e'),_0x8573('0x5f'),_0x8573('0x60'),_0x8573('0x61'),_0x8573('0x56'),_0x8573('0x62'),_0x8573('0x63'),_0x8573('0x64'),_0x8573('0x65'),_0x8573('0x66'),_0x8573('0x67'),'sys_created_on',_0x8573('0x68'),_0x8573('0x69'),_0x8573('0x6a'),_0x8573('0x6b'),_0x8573('0x4d'),_0x8573('0x6c'),_0x8573('0x6d'),_0x8573('0x6e'),'delivery_plan',_0x8573('0x6f'),'active',_0x8573('0x70'),_0x8573('0x71'),'priority',_0x8573('0x72'),'rfc',_0x8573('0x73'),_0x8573('0x74'),'opened_at',_0x8573('0x75'),_0x8573('0x76'),_0x8573('0x77'),'reopened_time',_0x8573('0x78'),_0x8573('0x79'),_0x8573('0x7a'),'subcategory','work_notes',_0x8573('0x7b'),_0x8573('0x58'),_0x8573('0x7c'),_0x8573('0x7d'),_0x8573('0x7e'),'assignment_group','business_stc',_0x8573('0x7f'),'description','calendar_duration',_0x8573('0x59'),_0x8573('0x80'),_0x8573('0x81'),_0x8573('0x82'),_0x8573('0x83'),_0x8573('0x84'),_0x8573('0x85'),_0x8573('0x86'),_0x8573('0x87'),_0x8573('0x88'),_0x8573('0x89'),_0x8573('0x8a'),_0x8573('0x8b'),'reassignment_count',_0x8573('0x8c'),'assigned_to','severity',_0x8573('0x8d'),_0x8573('0x8e'),_0x8573('0x8f'),_0x8573('0x90'),_0x8573('0x91'),_0x8573('0x92'),_0x8573('0x93'),_0x8573('0x94'),_0x8573('0x95'),_0x8573('0x96'),_0x8573('0x97'),'location',_0x8573('0x5b')];var _0x23e35a='';var _0x11896c='';var _0x2fcbe3=[];var _0x1edb4d='';var _0x4cb8ff='';var _0x164377=[];var _0x4419f8='';var _0x1dfb35='';var _0x56bc64={};var _0x2934b7='';return db[_0x8573('0x2e')][_0x8573('0x98')]({'where':{'id':_0x40c55c[_0x8573('0x47')]['id']},'attributes':['id',_0x8573('0x99'),_0x8573('0x9a'),_0x8573('0x9b'),'remoteUri',_0x8573('0x9c')]})['then'](handleEntityNotFound(_0x72f211,null))['then'](function(_0x36b5b8){if(_0x36b5b8){_0x2934b7=_0x36b5b8[_0x8573('0x9d')];var _0x2b9758=_0x2934b7[_0x8573('0x9e')](-0x1);if(_0x2b9758==='/'){_0x2934b7=_0x2934b7[_0x8573('0x9f')](0x0,_0x2934b7['lastIndexOf'](_0x2b9758));}_0x1dfb35=util[_0x8573('0xa0')](_0x8573('0xa1'),_0x2934b7);_0x4419f8=util[_0x8573('0xa0')](_0x8573('0xa2'),_0x2934b7);_0x56bc64={'user':_0x36b5b8['username'],'pass':_0x36b5b8['password']};var _0x1fffb3={'method':'GET','uri':_0x1dfb35+_0x8573('0xa3'),'auth':_0x56bc64,'json':!![]};return rp(_0x1fffb3);}})['then'](function(_0x10f8c3){if(_0x10f8c3[_0x8573('0x1d')][_0x8573('0x37')]>0x0){_0x23e35a=_0x10f8c3[_0x8573('0x1d')];}console[_0x8573('0xa4')](_0x8573('0xa5'),_0x23e35a);_0x164377=[];_0x11896c=Object[_0x8573('0xa6')]([],_0x23e35a);_[_0x8573('0xa7')](_0x11896c,function(_0x105a0f){return!_0x223423[_0x8573('0xa8')](_0x105a0f['name']);});_0x11896c[_0x8573('0xa9')](function(_0x21f04a){var _0x2c0e9c=createFieldObject(_0x4419f8,_0x56bc64,_0x21f04a[_0x8573('0xaa')],_0x21f04a[_0x8573('0x2b')],_0x21f04a[_0x8573('0xab')],![]);_0x164377[_0x8573('0xac')](_0x2c0e9c);});return Promise['all'](_0x164377);})[_0x8573('0x15')](function(_0x572cb0){_0x2fcbe3=_0x572cb0;_0x1edb4d=Object[_0x8573('0xa6')]([],_0x23e35a);console['log'](_0x8573('0xad'),_0x23e35a);_['remove'](_0x1edb4d,function(_0x1e5e97){return _0x259533['includes'](_0x1e5e97[_0x8573('0x2b')]);});console['log'](_0x8573('0xae'),_0x1edb4d);_0x164377=[];_0x1edb4d['forEach'](function(_0x15b8c2){var _0x5b1e5f=createFieldObject(_0x4419f8,_0x56bc64,_0x15b8c2[_0x8573('0xaa')],_0x15b8c2[_0x8573('0x2b')],_0x15b8c2[_0x8573('0xab')],!![]);_0x164377[_0x8573('0xac')](_0x5b1e5f);});return Promise[_0x8573('0xaf')](_0x164377);})[_0x8573('0x15')](function(_0x5da8a7){_0x4cb8ff=_0x5da8a7;var _0x365d71=_0x2fcbe3['concat'](_0x4cb8ff);return{'count':_0x365d71[_0x8573('0x37')],'rows':_0x365d71};})[_0x8573('0x15')](respondWithResult(_0x72f211,null))[_0x8573('0x46')](function(_0x1f1a88){console[_0x8573('0xa4')]('ServiceNow\x20error:\x20'+_0x1f1a88);var _0x51683d=_0x40c55c[_0x8573('0x31')][_0x8573('0x13')]?0x1f4:_0x1f1a88[_0x8573('0xb0')]||0x1f4;logger[_0x8573('0x1a')](_0x1f1a88[_0x8573('0x2a')]);delete _0x1f1a88[_0x8573('0x2b')];if(_0x51683d===0x191){_0x51683d=0x190;}_0x72f211[_0x8573('0x20')](_0x51683d)[_0x8573('0x2c')](_0x40c55c[_0x8573('0x31')][_0x8573('0x13')]?{'message':_0x8573('0xb1'),'statusCode':_0x1f1a88[_0x8573('0xb0')]}:_0x1f1a88);});};function createFieldObject(_0xa0442e,_0x51b19c,_0x3d28b5,_0x405f2a,_0x24f157,_0x5781e9){return new Promise(function(_0x5323ae,_0x831569){var _0x11183a={'id':_0x405f2a,'name':_0x24f157,'custom':_0x5781e9};if(_0x3d28b5==='boolean'){_0x11183a[_0x8573('0xb2')]=[{'name':_0x8573('0xb3'),'value':_0x8573('0xb4')},{'name':_0x8573('0xb5'),'value':_0x8573('0xb6')}];_0x5323ae(_0x11183a);}else{var _0x5dd804={'method':_0x8573('0xb7'),'uri':_0xa0442e+_0x8573('0xb8')+_0x405f2a,'auth':_0x51b19c,'json':!![]};return rp(_0x5dd804)[_0x8573('0x15')](function(_0x527a11){var _0x435e7e=[];if(_0x527a11['result'][_0x8573('0x37')]>0x0){_0x527a11[_0x8573('0x1d')][_0x8573('0xa9')](function(_0x4156e6){if(_0x4156e6[_0x8573('0xb9')]==='false'){var _0x40ec6c={'name':_0x4156e6[_0x8573('0xab')],'value':_0x4156e6['value']};_0x435e7e[_0x8573('0xac')](_0x40ec6c);}});}_0x11183a[_0x8573('0xb2')]=_0x435e7e;if(_0x11183a[_0x8573('0xb2')][_0x8573('0x37')]>0x0){_0x5323ae(_0x11183a);}else{if(_0x5781e9==![]){_0x5323ae();}else{_0x5323ae(_0x11183a);}}});}});} \ No newline at end of file +var _0xa552=['impact','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','reopened_time','caller_id','subcategory','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','severity','sla_due','approval','due_date','reopen_count','sys_tags','upon_approval','correlation_id','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','GET','log','incident\x20table\x20objects','assign','remove','includes','forEach','label','push','all','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','status','end','count','offset','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','ServicenowAccount','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','findAll','rows','show','params','find','create','body','getConfigurations','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','made_sla','hold_reason','knowledge','close_code','notify','incident_state','category','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan'];(function(_0x37980,_0x13c0f3){var _0x2eea4c=function(_0x5ce91a){while(--_0x5ce91a){_0x37980['push'](_0x37980['shift']());}};_0x2eea4c(++_0x13c0f3);}(_0xa552,0x105));var _0x2a55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa552[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2a55('0x0'));var emlformat=require(_0x2a55('0x1'));var rimraf=require(_0x2a55('0x2'));var zipdir=require(_0x2a55('0x3'));var jsonpatch=require(_0x2a55('0x4'));var rp=require('request-promise');var moment=require(_0x2a55('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2a55('0x6'));var util=require(_0x2a55('0x7'));var path=require(_0x2a55('0x8'));var sox=require('sox');var csv=require(_0x2a55('0x9'));var ejs=require(_0x2a55('0xa'));var fs=require('fs');var _=require(_0x2a55('0xb'));var squel=require('squel');var crypto=require(_0x2a55('0xc'));var jsforce=require(_0x2a55('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a55('0x9'));var querystring=require(_0x2a55('0xe'));var Papa=require('papaparse');var Redis=require(_0x2a55('0xf'));var authService=require(_0x2a55('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2a55('0x11'));var logger=require(_0x2a55('0x12'))(_0x2a55('0x13'));var utils=require(_0x2a55('0x14'));var config=require(_0x2a55('0x15'));var db=require(_0x2a55('0x16'))['db'];var integrations=require(_0x2a55('0x17'));var jayson=require(_0x2a55('0x18'));var client=jayson[_0x2a55('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x5d657d,_0x5684fb,_0x457413){if(_0x457413){var _0x19943c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19943c['test'](_0x5684fb)){return _0x5d657d;}else{throw new Error(_0x2a55('0x1a'));}}else{return _0x5d657d;}}function respondWithRpcPromise(_0xf7ab18,_0x4f7204,_0x3de64f,_0x1164bc){return new BPromise(function(_0x53fbf1,_0x152ee9){var _0x33934d=_0x1164bc||client;return _0x33934d[_0x2a55('0x1b')](_0xf7ab18,_0x3de64f)['then'](function(_0x4a371b){logger[_0x2a55('0x1c')]('ServicenowAccount,\x20%s,\x20%s',_0x4f7204,'request\x20sent');logger[_0x2a55('0x1d')](_0x2a55('0x1e'),_0x4f7204,_0x2a55('0x1f'),JSON[_0x2a55('0x20')](_0x4a371b));if(_0x4a371b[_0x2a55('0x21')]){if(_0x4a371b['error'][_0x2a55('0x22')]===0x1f4){logger[_0x2a55('0x21')](_0x2a55('0x23'),_0x4f7204,_0x4a371b['error']['message']);return _0x152ee9(_0x4a371b[_0x2a55('0x21')][_0x2a55('0x24')]);}logger['error'](_0x2a55('0x23'),_0x4f7204,_0x4a371b[_0x2a55('0x21')][_0x2a55('0x24')]);return _0x53fbf1(_0x4a371b[_0x2a55('0x21')][_0x2a55('0x24')]);}else{logger[_0x2a55('0x1c')](_0x2a55('0x23'),_0x4f7204,_0x2a55('0x1f'));_0x53fbf1(_0x4a371b[_0x2a55('0x25')][_0x2a55('0x24')]);}})[_0x2a55('0x26')](function(_0xb4b713){logger[_0x2a55('0x21')]('ServicenowAccount,\x20%s,\x20%s',_0x4f7204,_0xb4b713);_0x152ee9(_0xb4b713);});});}function respondWithStatusCode(_0x388354,_0x9d6276){_0x9d6276=_0x9d6276||0xcc;return function(_0x20e672){if(_0x20e672){return _0x388354['sendStatus'](_0x9d6276);}return _0x388354[_0x2a55('0x27')](_0x9d6276)[_0x2a55('0x28')]();};}function respondWithResult(_0x33264c,_0x31fff6){_0x31fff6=_0x31fff6||0xc8;return function(_0x37d4df){if(_0x37d4df){return _0x33264c[_0x2a55('0x27')](_0x31fff6)['json'](_0x37d4df);}};}function respondWithFilteredResult(_0x3697f5,_0xb4731b){return function(_0x4faada){if(_0x4faada){var _0x4c9df9=_0x4faada[_0x2a55('0x29')],_0x1a8ed8=_0xb4731b[_0x2a55('0x2a')],_0x4bf851=_0xb4731b[_0x2a55('0x2a')]+_0xb4731b['limit'],_0x2d469a;if(_0x4bf851>=_0x4c9df9){_0x4bf851=_0x4c9df9;_0x2d469a=0xc8;}else{_0x2d469a=0xce;}_0x3697f5['status'](_0x2d469a);return _0x3697f5['set'](_0x2a55('0x2b'),_0x1a8ed8+'-'+_0x4bf851+'/'+_0x4c9df9)['json'](_0x4faada);}return null;};}function patchUpdates(_0x2be796){return function(_0x511329){try{jsonpatch[_0x2a55('0x2c')](_0x511329,_0x2be796,!![]);}catch(_0x466f56){return BPromise[_0x2a55('0x2d')](_0x466f56);}return _0x511329['save']();};}function saveUpdates(_0x3c7f8c,_0x45b9a7){return function(_0x1acc97){if(_0x1acc97){return _0x1acc97[_0x2a55('0x2e')](_0x3c7f8c)[_0x2a55('0x2f')](function(_0x5b9585){return _0x5b9585;});}return null;};}function removeEntity(_0x4b8b28,_0xcab11b){return function(_0x30f50a){if(_0x30f50a){return _0x30f50a[_0x2a55('0x30')]()[_0x2a55('0x2f')](function(){_0x4b8b28[_0x2a55('0x27')](0xcc)[_0x2a55('0x28')]();});}};}function handleEntityNotFound(_0x5c9d69,_0xf4c0d9){return function(_0x4756a3){if(!_0x4756a3){_0x5c9d69[_0x2a55('0x31')](0x194);}return _0x4756a3;};}function handleError(_0xfab77c,_0x455a41){_0x455a41=_0x455a41||0x1f4;return function(_0x158267){logger[_0x2a55('0x21')](_0x158267[_0x2a55('0x32')]);if(_0x158267[_0x2a55('0x33')]){delete _0x158267[_0x2a55('0x33')];}_0xfab77c[_0x2a55('0x27')](_0x455a41)[_0x2a55('0x34')](_0x158267);};}exports[_0x2a55('0x35')]=function(_0x5b43fe,_0x575382){var _0x14d844={},_0x567b64={},_0x21d4ba={'count':0x0,'rows':[]};var _0x598a04=db[_0x2a55('0x36')][_0x2a55('0x37')];_0x567b64[_0x2a55('0x38')]=_[_0x2a55('0x39')](_0x598a04);_0x567b64[_0x2a55('0x3a')]=_['keys'](_0x5b43fe[_0x2a55('0x3a')]);_0x567b64[_0x2a55('0x3b')]=_[_0x2a55('0x3c')](_0x567b64[_0x2a55('0x38')],_0x567b64[_0x2a55('0x3a')]);_0x14d844['attributes']=_[_0x2a55('0x3c')](_0x567b64[_0x2a55('0x38')],qs[_0x2a55('0x3d')](_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x3d')]));_0x14d844[_0x2a55('0x3e')]=_0x14d844[_0x2a55('0x3e')][_0x2a55('0x3f')]?_0x14d844[_0x2a55('0x3e')]:_0x567b64[_0x2a55('0x38')];if(!_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x40')](_0x2a55('0x41'))){_0x14d844['limit']=qs['limit'](_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x42')]);_0x14d844[_0x2a55('0x2a')]=qs[_0x2a55('0x2a')](_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x2a')]);}_0x14d844[_0x2a55('0x43')]=qs['sort'](_0x5b43fe['query'][_0x2a55('0x44')]);_0x14d844[_0x2a55('0x45')]=qs[_0x2a55('0x3b')](_[_0x2a55('0x46')](_0x5b43fe[_0x2a55('0x3a')],_0x567b64[_0x2a55('0x3b')]));if(_0x5b43fe['query'][_0x2a55('0x47')]){_0x14d844[_0x2a55('0x45')]=_[_0x2a55('0x48')](_0x14d844[_0x2a55('0x45')],{'$or':_[_0x2a55('0x49')](_0x598a04,function(_0xb5011){if(_0xb5011[_0x2a55('0x4a')]['key']!=='VIRTUAL'){var _0x4eab03={};_0x4eab03[_0xb5011['field']]={'$like':'%'+_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x47')]+'%'};return _0x4eab03;}})});}_0x14d844=_[_0x2a55('0x48')]({},_0x14d844,_0x5b43fe[_0x2a55('0x4b')]);var _0x24e037={'where':_0x14d844[_0x2a55('0x45')]};return db['ServicenowAccount'][_0x2a55('0x29')](_0x24e037)[_0x2a55('0x2f')](function(_0x57f78c){_0x21d4ba['count']=_0x57f78c;if(_0x5b43fe[_0x2a55('0x3a')][_0x2a55('0x4c')]){_0x14d844[_0x2a55('0x4d')]=[{'all':!![]}];}return db[_0x2a55('0x36')][_0x2a55('0x4e')](_0x14d844);})[_0x2a55('0x2f')](function(_0x56b4e2){_0x21d4ba[_0x2a55('0x4f')]=_0x56b4e2;return _0x21d4ba;})[_0x2a55('0x2f')](respondWithFilteredResult(_0x575382,_0x14d844))['catch'](handleError(_0x575382,null));};exports[_0x2a55('0x50')]=function(_0x21b51a,_0x3c6284){var _0x549ba5={'raw':![],'where':{'id':_0x21b51a[_0x2a55('0x51')]['id']}},_0x34fa9c={};_0x34fa9c[_0x2a55('0x38')]=_[_0x2a55('0x39')](db[_0x2a55('0x36')][_0x2a55('0x37')]);_0x34fa9c[_0x2a55('0x3a')]=_['keys'](_0x21b51a[_0x2a55('0x3a')]);_0x34fa9c[_0x2a55('0x3b')]=_[_0x2a55('0x3c')](_0x34fa9c[_0x2a55('0x38')],_0x34fa9c['query']);_0x549ba5[_0x2a55('0x3e')]=_[_0x2a55('0x3c')](_0x34fa9c[_0x2a55('0x38')],qs['fields'](_0x21b51a[_0x2a55('0x3a')]['fields']));_0x549ba5[_0x2a55('0x3e')]=_0x549ba5['attributes'][_0x2a55('0x3f')]?_0x549ba5['attributes']:_0x34fa9c['model'];if(_0x21b51a[_0x2a55('0x3a')][_0x2a55('0x4c')]){_0x549ba5[_0x2a55('0x4d')]=[{'all':!![]}];}_0x549ba5=_[_0x2a55('0x48')]({},_0x549ba5,_0x21b51a[_0x2a55('0x4b')]);return db[_0x2a55('0x36')][_0x2a55('0x52')](_0x549ba5)[_0x2a55('0x2f')](handleEntityNotFound(_0x3c6284,null))[_0x2a55('0x2f')](respondWithResult(_0x3c6284,null))[_0x2a55('0x26')](handleError(_0x3c6284,null));};exports[_0x2a55('0x53')]=function(_0x38c731,_0x5b8597){return db['ServicenowAccount'][_0x2a55('0x53')](_0x38c731[_0x2a55('0x54')],{})[_0x2a55('0x2f')](respondWithResult(_0x5b8597,0xc9))[_0x2a55('0x26')](handleError(_0x5b8597,null));};exports[_0x2a55('0x2e')]=function(_0x38270f,_0x3b7e6a){if(_0x38270f[_0x2a55('0x54')]['id']){delete _0x38270f[_0x2a55('0x54')]['id'];}return db[_0x2a55('0x36')]['find']({'where':{'id':_0x38270f[_0x2a55('0x51')]['id']}})[_0x2a55('0x2f')](handleEntityNotFound(_0x3b7e6a,null))[_0x2a55('0x2f')](saveUpdates(_0x38270f[_0x2a55('0x54')],null))[_0x2a55('0x2f')](respondWithResult(_0x3b7e6a,null))['catch'](handleError(_0x3b7e6a,null));};exports['destroy']=function(_0x426c40,_0x5e8241){return db[_0x2a55('0x36')][_0x2a55('0x52')]({'where':{'id':_0x426c40[_0x2a55('0x51')]['id']}})[_0x2a55('0x2f')](handleEntityNotFound(_0x5e8241,null))[_0x2a55('0x2f')](removeEntity(_0x5e8241,null))[_0x2a55('0x26')](handleError(_0x5e8241,null));};exports['getConfigurations']=function(_0x3d278f,_0x547cdb,_0x2438a6){var _0x560839={};var _0x43f664={};var _0x4ffbda;var _0x225006;return db[_0x2a55('0x36')]['findOne']({'where':{'id':_0x3d278f[_0x2a55('0x51')]['id']}})[_0x2a55('0x2f')](handleEntityNotFound(_0x547cdb,null))[_0x2a55('0x2f')](function(_0xffaf73){if(_0xffaf73){_0x4ffbda=_0xffaf73;_0x43f664[_0x2a55('0x38')]=_[_0x2a55('0x39')](db['ServicenowConfiguration'][_0x2a55('0x37')]);_0x43f664[_0x2a55('0x3a')]=_[_0x2a55('0x39')](_0x3d278f['query']);_0x43f664['filters']=_[_0x2a55('0x3c')](_0x43f664[_0x2a55('0x38')],_0x43f664[_0x2a55('0x3a')]);_0x560839[_0x2a55('0x3e')]=_[_0x2a55('0x3c')](_0x43f664['model'],qs['fields'](_0x3d278f[_0x2a55('0x3a')]['fields']));_0x560839[_0x2a55('0x3e')]=_0x560839[_0x2a55('0x3e')][_0x2a55('0x3f')]?_0x560839[_0x2a55('0x3e')]:_0x43f664['model'];_0x560839['order']=qs['sort'](_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x44')]);_0x560839['where']=qs[_0x2a55('0x3b')](_[_0x2a55('0x46')](_0x3d278f[_0x2a55('0x3a')],_0x43f664[_0x2a55('0x3b')]));if(_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x47')]){_0x560839[_0x2a55('0x45')]=_[_0x2a55('0x48')](_0x560839[_0x2a55('0x45')],{'$or':_[_0x2a55('0x49')](_0x560839[_0x2a55('0x3e')],function(_0x4cfafe){var _0x39c97b={};_0x39c97b[_0x4cfafe]={'$like':'%'+_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x47')]+'%'};return _0x39c97b;})});}_0x560839=_[_0x2a55('0x48')]({},_0x560839,_0x3d278f[_0x2a55('0x4b')]);return _0x4ffbda[_0x2a55('0x55')](_0x560839);}})['then'](function(_0x3c2d30){if(_0x3c2d30){_0x225006=_0x3c2d30['length'];if(!_0x3d278f[_0x2a55('0x3a')][_0x2a55('0x40')]('nolimit')){_0x560839[_0x2a55('0x42')]=qs[_0x2a55('0x42')](_0x3d278f[_0x2a55('0x3a')]['limit']);_0x560839['offset']=qs[_0x2a55('0x2a')](_0x3d278f['query']['offset']);}return _0x4ffbda[_0x2a55('0x55')](_0x560839);}})[_0x2a55('0x2f')](function(_0x387bbc){if(_0x387bbc){return _0x387bbc?{'count':_0x225006,'rows':_0x387bbc}:null;}})[_0x2a55('0x2f')](respondWithResult(_0x547cdb,null))['catch'](handleError(_0x547cdb,null));};exports[_0x2a55('0x56')]=function(_0x48a019,_0x25da51,_0x476077){if(_0x48a019[_0x2a55('0x54')]['id']){delete _0x48a019[_0x2a55('0x54')]['id'];}return db[_0x2a55('0x36')][_0x2a55('0x57')]({'where':{'id':_0x48a019[_0x2a55('0x51')]['id']}})['then'](handleEntityNotFound(_0x25da51,null))[_0x2a55('0x2f')](function(_0x40ccd5){if(_0x40ccd5){_0x48a019[_0x2a55('0x54')]['AccountId']=_0x40ccd5['id'];_0x48a019['body'][_0x2a55('0x58')]=integrations[_0x2a55('0x59')](_0x48a019[_0x2a55('0x54')][_0x2a55('0x5a')],_0x48a019[_0x2a55('0x54')]['type']);_0x48a019[_0x2a55('0x54')][_0x2a55('0x5b')]=integrations[_0x2a55('0x5c')](_0x48a019['body']['channel'],_0x48a019[_0x2a55('0x54')][_0x2a55('0x4a')]);return db[_0x2a55('0x5d')][_0x2a55('0x53')](_0x48a019[_0x2a55('0x54')],{'include':[{'model':db[_0x2a55('0x5e')],'as':'Subjects'},{'model':db[_0x2a55('0x5e')],'as':_0x2a55('0x5b')}]});}return null;})['then'](respondWithResult(_0x25da51,null))[_0x2a55('0x26')](handleError(_0x25da51,null));};exports['getFields']=function(_0x23dd53,_0x29baea,_0x56f70b){var _0x5da420=[_0x2a55('0x5f'),_0x2a55('0x60'),_0x2a55('0x61'),'subcategory',_0x2a55('0x62'),_0x2a55('0x63'),_0x2a55('0x64'),'severity',_0x2a55('0x65')];var _0x4da5f9=['parent',_0x2a55('0x5f'),_0x2a55('0x66'),_0x2a55('0x67'),_0x2a55('0x68'),'sys_updated_on',_0x2a55('0x69'),_0x2a55('0x60'),_0x2a55('0x6a'),_0x2a55('0x6b'),_0x2a55('0x6c'),'sys_updated_by',_0x2a55('0x6d'),_0x2a55('0x6e'),_0x2a55('0x6f'),_0x2a55('0x70'),_0x2a55('0x71'),_0x2a55('0x72'),_0x2a55('0x61'),_0x2a55('0x43'),_0x2a55('0x73'),_0x2a55('0x74'),_0x2a55('0x75'),_0x2a55('0x76'),_0x2a55('0x77'),'active',_0x2a55('0x78'),_0x2a55('0x79'),_0x2a55('0x7a'),_0x2a55('0x7b'),_0x2a55('0x7c'),_0x2a55('0x7d'),_0x2a55('0x7e'),_0x2a55('0x7f'),_0x2a55('0x80'),'group_list','work_end',_0x2a55('0x81'),'resolved_at',_0x2a55('0x82'),'approval_set',_0x2a55('0x83'),_0x2a55('0x84'),_0x2a55('0x85'),_0x2a55('0x62'),_0x2a55('0x86'),'delivery_task',_0x2a55('0x87'),_0x2a55('0x88'),_0x2a55('0x89'),_0x2a55('0x8a'),_0x2a55('0x8b'),_0x2a55('0x8c'),_0x2a55('0x63'),_0x2a55('0x8d'),_0x2a55('0x8e'),'closed_by',_0x2a55('0x8f'),_0x2a55('0x90'),_0x2a55('0x91'),_0x2a55('0x92'),_0x2a55('0x93'),_0x2a55('0x64'),_0x2a55('0x94'),_0x2a55('0x95'),_0x2a55('0x96'),_0x2a55('0x97'),_0x2a55('0x98'),'assigned_to',_0x2a55('0x99'),'comments',_0x2a55('0x9a'),_0x2a55('0x9b'),'comments_and_work_notes',_0x2a55('0x9c'),'sys_mod_count',_0x2a55('0x9d'),_0x2a55('0x9e'),'escalation',_0x2a55('0x9f'),_0x2a55('0xa0'),'location',_0x2a55('0x65')];var _0x536372='';var _0x4ecd57='';var _0x1e34d2=[];var _0x19530d='';var _0x1eeee8='';var _0x467621=[];var _0x5ef2d5='';var _0x5f0f5a='';var _0x5d8363={};var _0x16bbd8='';return db[_0x2a55('0x36')][_0x2a55('0x57')]({'where':{'id':_0x23dd53['params']['id']},'attributes':['id','username',_0x2a55('0xa1'),'email',_0x2a55('0xa2'),_0x2a55('0xa3')]})[_0x2a55('0x2f')](handleEntityNotFound(_0x29baea,null))[_0x2a55('0x2f')](function(_0x498e0c){if(_0x498e0c){_0x16bbd8=_0x498e0c[_0x2a55('0xa2')];var _0x3d19d4=_0x16bbd8[_0x2a55('0xa4')](-0x1);if(_0x3d19d4==='/'){_0x16bbd8=_0x16bbd8[_0x2a55('0xa5')](0x0,_0x16bbd8[_0x2a55('0xa6')](_0x3d19d4));}_0x5f0f5a=util[_0x2a55('0xa7')]('%s/api/now/doc/table/schema/',_0x16bbd8);_0x5ef2d5=util[_0x2a55('0xa7')](_0x2a55('0xa8'),_0x16bbd8);_0x5d8363={'user':_0x498e0c[_0x2a55('0xa9')],'pass':_0x498e0c[_0x2a55('0xa1')]};var _0x3f9c61={'method':_0x2a55('0xaa'),'uri':_0x5f0f5a+'incident?sysparm_display_value=all','auth':_0x5d8363,'json':!![]};return rp(_0x3f9c61);}})[_0x2a55('0x2f')](function(_0x54a525){if(_0x54a525[_0x2a55('0x25')][_0x2a55('0x3f')]>0x0){_0x536372=_0x54a525[_0x2a55('0x25')];}console[_0x2a55('0xab')](_0x2a55('0xac'),_0x536372);_0x467621=[];_0x4ecd57=Object[_0x2a55('0xad')]([],_0x536372);_[_0x2a55('0xae')](_0x4ecd57,function(_0x534676){return!_0x5da420[_0x2a55('0xaf')](_0x534676['name']);});_0x4ecd57[_0x2a55('0xb0')](function(_0x1104d5){var _0x1206ff=createFieldObject(_0x5ef2d5,_0x5d8363,_0x1104d5['internalType'],_0x1104d5[_0x2a55('0x33')],_0x1104d5[_0x2a55('0xb1')],![]);_0x467621[_0x2a55('0xb2')](_0x1206ff);});return Promise[_0x2a55('0xb3')](_0x467621);})['then'](function(_0x3ef916){_0x1e34d2=_0x3ef916;_0x19530d=Object[_0x2a55('0xad')]([],_0x536372);console[_0x2a55('0xab')]('TCL:\x20_object',_0x536372);_[_0x2a55('0xae')](_0x19530d,function(_0x268dc6){return _0x4da5f9[_0x2a55('0xaf')](_0x268dc6[_0x2a55('0x33')]);});console[_0x2a55('0xab')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x19530d);_0x467621=[];_0x19530d[_0x2a55('0xb0')](function(_0x538b6f){var _0x185c8a=createFieldObject(_0x5ef2d5,_0x5d8363,_0x538b6f['internalType'],_0x538b6f[_0x2a55('0x33')],_0x538b6f[_0x2a55('0xb1')],!![]);_0x467621[_0x2a55('0xb2')](_0x185c8a);});return Promise['all'](_0x467621);})[_0x2a55('0x2f')](function(_0x94600){_0x1eeee8=_0x94600;var _0x3af573=_0x1e34d2['concat'](_0x1eeee8);return{'count':_0x3af573[_0x2a55('0x3f')],'rows':_0x3af573};})[_0x2a55('0x2f')](respondWithResult(_0x29baea,null))[_0x2a55('0x26')](function(_0xe6baaf){console[_0x2a55('0xab')](_0x2a55('0xb4')+_0xe6baaf);var _0x377cb3=_0x23dd53[_0x2a55('0x3a')][_0x2a55('0xb5')]?0x1f4:_0xe6baaf[_0x2a55('0xb6')]||0x1f4;logger[_0x2a55('0x21')](_0xe6baaf['stack']);delete _0xe6baaf['name'];if(_0x377cb3===0x191){_0x377cb3=0x190;}_0x29baea[_0x2a55('0x27')](_0x377cb3)['send'](_0x23dd53[_0x2a55('0x3a')][_0x2a55('0xb5')]?{'message':_0x2a55('0xb7'),'statusCode':_0xe6baaf[_0x2a55('0xb6')]}:_0xe6baaf);});};function createFieldObject(_0x573f79,_0x1714b4,_0x402cd7,_0x4fcc56,_0x10fbc1,_0x109a95){return new Promise(function(_0x313c68,_0x4aae49){var _0x531c61={'id':_0x4fcc56,'name':_0x10fbc1,'custom':_0x109a95};if(_0x402cd7===_0x2a55('0xb8')){_0x531c61[_0x2a55('0x4b')]=[{'name':_0x2a55('0xb9'),'value':'true'},{'name':_0x2a55('0xba'),'value':_0x2a55('0xbb')}];_0x313c68(_0x531c61);}else{var _0x95cadc={'method':_0x2a55('0xaa'),'uri':_0x573f79+_0x2a55('0xbc')+_0x4fcc56,'auth':_0x1714b4,'json':!![]};return rp(_0x95cadc)[_0x2a55('0x2f')](function(_0x3c9881){var _0x1ab35a=[];if(_0x3c9881[_0x2a55('0x25')][_0x2a55('0x3f')]>0x0){_0x3c9881['result'][_0x2a55('0xb0')](function(_0x2479d7){if(_0x2479d7[_0x2a55('0xbd')]===_0x2a55('0xbb')){var _0x1e0a9f={'name':_0x2479d7['label'],'value':_0x2479d7['value']};_0x1ab35a[_0x2a55('0xb2')](_0x1e0a9f);}});}_0x531c61[_0x2a55('0x4b')]=_0x1ab35a;if(_0x531c61[_0x2a55('0x4b')][_0x2a55('0x3f')]>0x0){_0x313c68(_0x531c61);}else{if(_0x109a95==![]){_0x313c68();}else{_0x313c68(_0x531c61);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 8f1e9ee..36dcbeb 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 _0x9957=['../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes'];(function(_0x5b1370,_0x5beac4){var _0xf5075d=function(_0x26aeab){while(--_0x26aeab){_0x5b1370['push'](_0x5b1370['shift']());}};_0xf5075d(++_0x5beac4);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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'));var integrations=require(_0x7995('0x9'));module[_0x7995('0xa')]=function(_0x219534,_0xbda126){return _0x219534[_0x7995('0xb')]('ServicenowAccount',attributes,{'tableName':_0x7995('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x7a54,0x106));var _0x47a5=function(_0x17bc92,_0x174962){_0x17bc92=_0x17bc92-0x0;var _0x299a29=_0x7a54[_0x17bc92];return _0x299a29;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','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 6ed7565..87783a2 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 _0xaae2=['ShowServicenowAccount','ServicenowAccount','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','map','include','model','stringify'];(function(_0x53822e,_0x3c92cb){var _0x3bdf7e=function(_0x212703){while(--_0x212703){_0x53822e['push'](_0x53822e['shift']());}};_0x3bdf7e(++_0x3c92cb);}(_0xaae2,0x123));var _0x2aae=function(_0x994b1d,_0x5b4383){_0x994b1d=_0x994b1d-0x0;var _0x319555=_0xaae2[_0x994b1d];return _0x319555;};'use strict';var _=require(_0x2aae('0x0'));var util=require('util');var moment=require(_0x2aae('0x1'));var BPromise=require('bluebird');var rs=require(_0x2aae('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2aae('0x3'))['db'];var utils=require(_0x2aae('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2aae('0x5'));var client=jayson[_0x2aae('0x6')][_0x2aae('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5bbf76,_0x20ccfb,_0x1fdd9d){return new BPromise(function(_0x33cb6c,_0x38578c){return client[_0x2aae('0x8')](_0x5bbf76,_0x1fdd9d)[_0x2aae('0x9')](function(_0x2c628a){logger[_0x2aae('0xa')](_0x2aae('0xb'),_0x20ccfb,_0x2aae('0xc'));logger[_0x2aae('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x20ccfb,'request\x20sent',JSON['stringify'](_0x2c628a));if(_0x2c628a[_0x2aae('0xe')]){if(_0x2c628a['error'][_0x2aae('0xf')]===0x1f4){logger[_0x2aae('0xe')](_0x2aae('0xb'),_0x20ccfb,_0x2c628a['error'][_0x2aae('0x10')]);return _0x38578c(_0x2c628a[_0x2aae('0xe')][_0x2aae('0x10')]);}logger[_0x2aae('0xe')]('ServicenowAccount,\x20%s,\x20%s',_0x20ccfb,_0x2c628a[_0x2aae('0xe')][_0x2aae('0x10')]);return _0x33cb6c(_0x2c628a[_0x2aae('0xe')][_0x2aae('0x10')]);}else{logger[_0x2aae('0xa')]('ServicenowAccount,\x20%s,\x20%s',_0x20ccfb,_0x2aae('0xc'));_0x33cb6c(_0x2c628a[_0x2aae('0x11')][_0x2aae('0x10')]);}})[_0x2aae('0x12')](function(_0x223a1d){logger[_0x2aae('0xe')](_0x2aae('0xb'),_0x20ccfb,_0x223a1d);_0x38578c(_0x223a1d);});});}exports[_0x2aae('0x13')]=function(_0x2e423d){var _0x4c71e3=this;return new Promise(function(_0x374cc2,_0x20777e){return db['ServicenowAccount'][_0x2aae('0x14')]({'raw':_0x2e423d[_0x2aae('0x15')]?_0x2e423d[_0x2aae('0x15')][_0x2aae('0x16')]===undefined?!![]:![]:!![],'where':_0x2e423d[_0x2aae('0x15')]?_0x2e423d[_0x2aae('0x15')][_0x2aae('0x17')]||null:null,'attributes':_0x2e423d[_0x2aae('0x15')]?_0x2e423d['options'][_0x2aae('0x18')]||null:null,'limit':_0x2e423d[_0x2aae('0x15')]?_0x2e423d[_0x2aae('0x15')]['limit']||null:null,'include':_0x2e423d[_0x2aae('0x15')]?_0x2e423d[_0x2aae('0x15')]['include']?_[_0x2aae('0x19')](_0x2e423d['options'][_0x2aae('0x1a')],function(_0x17fc41){return{'model':db[_0x17fc41['model']],'as':_0x17fc41['as'],'attributes':_0x17fc41[_0x2aae('0x18')],'include':_0x17fc41[_0x2aae('0x1a')]?_[_0x2aae('0x19')](_0x17fc41[_0x2aae('0x1a')],function(_0xe55ee1){return{'model':db[_0xe55ee1[_0x2aae('0x1b')]],'as':_0xe55ee1['as'],'attributes':_0xe55ee1[_0x2aae('0x18')],'include':_0xe55ee1[_0x2aae('0x1a')]?_[_0x2aae('0x19')](_0xe55ee1[_0x2aae('0x1a')],function(_0x403d22){return{'model':db[_0x403d22['model']],'as':_0x403d22['as'],'attributes':_0x403d22['attributes']};}):[]};}):[]};}):[]:[]})[_0x2aae('0x9')](function(_0x997a9d){logger[_0x2aae('0xa')]('GetServicenowAccount',_0x2e423d);logger[_0x2aae('0xd')]('GetServicenowAccount',_0x2e423d,JSON[_0x2aae('0x1c')](_0x997a9d));_0x374cc2(_0x997a9d);})['catch'](function(_0x25bc85){logger[_0x2aae('0xe')](_0x2aae('0x13'),_0x25bc85[_0x2aae('0x10')],_0x2e423d);_0x20777e(_0x4c71e3[_0x2aae('0xe')](0x1f4,_0x25bc85['message']));});});};exports[_0x2aae('0x1d')]=function(_0xd933e1){var _0x3aedc5=this;return new Promise(function(_0x4e841e,_0x4b9613){return db[_0x2aae('0x1e')][_0x2aae('0x1f')]({'raw':_0xd933e1[_0x2aae('0x15')]?_0xd933e1[_0x2aae('0x15')][_0x2aae('0x16')]===undefined?!![]:![]:!![],'where':_0xd933e1[_0x2aae('0x15')]?_0xd933e1[_0x2aae('0x15')][_0x2aae('0x17')]||null:null,'attributes':_0xd933e1['options']?_0xd933e1[_0x2aae('0x15')]['attributes']||null:null,'include':_0xd933e1[_0x2aae('0x15')]?_0xd933e1[_0x2aae('0x15')][_0x2aae('0x1a')]?_[_0x2aae('0x19')](_0xd933e1[_0x2aae('0x15')][_0x2aae('0x1a')],function(_0x51ac0d){return{'model':db[_0x51ac0d['model']],'as':_0x51ac0d['as'],'attributes':_0x51ac0d['attributes'],'include':_0x51ac0d[_0x2aae('0x1a')]?_[_0x2aae('0x19')](_0x51ac0d[_0x2aae('0x1a')],function(_0x283543){return{'model':db[_0x283543[_0x2aae('0x1b')]],'as':_0x283543['as'],'attributes':_0x283543[_0x2aae('0x18')],'include':_0x283543[_0x2aae('0x1a')]?_[_0x2aae('0x19')](_0x283543[_0x2aae('0x1a')],function(_0x816a92){return{'model':db[_0x816a92[_0x2aae('0x1b')]],'as':_0x816a92['as'],'attributes':_0x816a92['attributes']};}):[]};}):[]};}):[]:[]})[_0x2aae('0x9')](function(_0x43c0a9){logger[_0x2aae('0xa')](_0x2aae('0x1d'),_0xd933e1);logger[_0x2aae('0xd')](_0x2aae('0x1d'),_0xd933e1,JSON[_0x2aae('0x1c')](_0x43c0a9));_0x4e841e(_0x43c0a9);})[_0x2aae('0x12')](function(_0x52f8a9){logger[_0x2aae('0xe')](_0x2aae('0x1d'),_0x52f8a9['message'],_0xd933e1);_0x4b9613(_0x3aedc5[_0x2aae('0xe')](0x1f4,_0x52f8a9['message']));});});}; \ No newline at end of file +var _0x40ab=['where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','include','map','model','debug','ShowServicenowAccount','find'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x40ab,0x64));var _0xb40a=function(_0x19fdab,_0x226364){_0x19fdab=_0x19fdab-0x0;var _0x5f18f5=_0x40ab[_0x19fdab];return _0x5f18f5;};'use strict';var _=require('lodash');var util=require(_0xb40a('0x0'));var moment=require(_0xb40a('0x1'));var BPromise=require(_0xb40a('0x2'));var rs=require(_0xb40a('0x3'));var fs=require('fs');var Redis=require(_0xb40a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb40a('0x5'));var logger=require(_0xb40a('0x6'))(_0xb40a('0x7'));var config=require(_0xb40a('0x8'));var jayson=require(_0xb40a('0x9'));var client=jayson['client'][_0xb40a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21248b,_0x5192f3,_0x599787){return new BPromise(function(_0x5b7781,_0x3e660f){return client['request'](_0x21248b,_0x599787)[_0xb40a('0xb')](function(_0x59f757){logger['info'](_0xb40a('0xc'),_0x5192f3,_0xb40a('0xd'));logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x5192f3,'request\x20sent',JSON[_0xb40a('0xe')](_0x59f757));if(_0x59f757['error']){if(_0x59f757[_0xb40a('0xf')]['code']===0x1f4){logger['error'](_0xb40a('0xc'),_0x5192f3,_0x59f757['error']['message']);return _0x3e660f(_0x59f757['error']['message']);}logger[_0xb40a('0xf')]('ServicenowAccount,\x20%s,\x20%s',_0x5192f3,_0x59f757[_0xb40a('0xf')][_0xb40a('0x10')]);return _0x5b7781(_0x59f757[_0xb40a('0xf')][_0xb40a('0x10')]);}else{logger[_0xb40a('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x5192f3,_0xb40a('0xd'));_0x5b7781(_0x59f757[_0xb40a('0x12')]['message']);}})[_0xb40a('0x13')](function(_0x355fb4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5192f3,_0x355fb4);_0x3e660f(_0x355fb4);});});}exports[_0xb40a('0x14')]=function(_0x52e39c){var _0x8bfe0a=this;return new Promise(function(_0x3bc5d7,_0x1be736){return db[_0xb40a('0x15')]['findAll']({'raw':_0x52e39c['options']?_0x52e39c[_0xb40a('0x16')][_0xb40a('0x17')]===undefined?!![]:![]:!![],'where':_0x52e39c[_0xb40a('0x16')]?_0x52e39c['options']['where']||null:null,'attributes':_0x52e39c[_0xb40a('0x16')]?_0x52e39c[_0xb40a('0x16')][_0xb40a('0x18')]||null:null,'limit':_0x52e39c[_0xb40a('0x16')]?_0x52e39c['options'][_0xb40a('0x19')]||null:null,'include':_0x52e39c[_0xb40a('0x16')]?_0x52e39c['options'][_0xb40a('0x1a')]?_[_0xb40a('0x1b')](_0x52e39c['options'][_0xb40a('0x1a')],function(_0x4e2aef){return{'model':db[_0x4e2aef[_0xb40a('0x1c')]],'as':_0x4e2aef['as'],'attributes':_0x4e2aef[_0xb40a('0x18')],'include':_0x4e2aef[_0xb40a('0x1a')]?_[_0xb40a('0x1b')](_0x4e2aef[_0xb40a('0x1a')],function(_0xfe28f7){return{'model':db[_0xfe28f7[_0xb40a('0x1c')]],'as':_0xfe28f7['as'],'attributes':_0xfe28f7[_0xb40a('0x18')],'include':_0xfe28f7['include']?_[_0xb40a('0x1b')](_0xfe28f7[_0xb40a('0x1a')],function(_0x5b8c6d){return{'model':db[_0x5b8c6d[_0xb40a('0x1c')]],'as':_0x5b8c6d['as'],'attributes':_0x5b8c6d[_0xb40a('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f7234){logger[_0xb40a('0x11')](_0xb40a('0x14'),_0x52e39c);logger[_0xb40a('0x1d')](_0xb40a('0x14'),_0x52e39c,JSON['stringify'](_0x4f7234));_0x3bc5d7(_0x4f7234);})[_0xb40a('0x13')](function(_0x5c9366){logger[_0xb40a('0xf')](_0xb40a('0x14'),_0x5c9366[_0xb40a('0x10')],_0x52e39c);_0x1be736(_0x8bfe0a['error'](0x1f4,_0x5c9366[_0xb40a('0x10')]));});});};exports[_0xb40a('0x1e')]=function(_0x282fae){var _0x2c5d02=this;return new Promise(function(_0x2f2d6a,_0x14a1ed){return db[_0xb40a('0x15')][_0xb40a('0x1f')]({'raw':_0x282fae[_0xb40a('0x16')]?_0x282fae['options'][_0xb40a('0x17')]===undefined?!![]:![]:!![],'where':_0x282fae[_0xb40a('0x16')]?_0x282fae['options'][_0xb40a('0x20')]||null:null,'attributes':_0x282fae['options']?_0x282fae[_0xb40a('0x16')]['attributes']||null:null,'include':_0x282fae[_0xb40a('0x16')]?_0x282fae[_0xb40a('0x16')][_0xb40a('0x1a')]?_['map'](_0x282fae[_0xb40a('0x16')]['include'],function(_0x191a20){return{'model':db[_0x191a20[_0xb40a('0x1c')]],'as':_0x191a20['as'],'attributes':_0x191a20[_0xb40a('0x18')],'include':_0x191a20[_0xb40a('0x1a')]?_[_0xb40a('0x1b')](_0x191a20['include'],function(_0x32f5c5){return{'model':db[_0x32f5c5['model']],'as':_0x32f5c5['as'],'attributes':_0x32f5c5[_0xb40a('0x18')],'include':_0x32f5c5[_0xb40a('0x1a')]?_['map'](_0x32f5c5[_0xb40a('0x1a')],function(_0x40889d){return{'model':db[_0x40889d[_0xb40a('0x1c')]],'as':_0x40889d['as'],'attributes':_0x40889d['attributes']};}):[]};}):[]};}):[]:[]})[_0xb40a('0xb')](function(_0x30dc00){logger[_0xb40a('0x11')](_0xb40a('0x1e'),_0x282fae);logger[_0xb40a('0x1d')](_0xb40a('0x1e'),_0x282fae,JSON[_0xb40a('0xe')](_0x30dc00));_0x2f2d6a(_0x30dc00);})['catch'](function(_0x5b4d4c){logger[_0xb40a('0xf')](_0xb40a('0x1e'),_0x5b4d4c['message'],_0x282fae);_0x14a1ed(_0x2c5d02[_0xb40a('0xf')](0x1f4,_0x5b4d4c[_0xb40a('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index a73df05..659fe55 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 _0xf873=['path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','create','put','update','delete','exports','util'];(function(_0x364d51,_0x677e4c){var _0x5c34c2=function(_0x338b4a){while(--_0x338b4a){_0x364d51['push'](_0x364d51['shift']());}};_0x5c34c2(++_0x677e4c);}(_0xf873,0x153));var _0x3f87=function(_0x5f3cd8,_0x65c8c8){_0x5f3cd8=_0x5f3cd8-0x0;var _0x292c34=_0xf873[_0x5f3cd8];return _0x292c34;};'use strict';var multer=require('multer');var util=require(_0x3f87('0x0'));var path=require(_0x3f87('0x1'));var timeout=require(_0x3f87('0x2'));var express=require(_0x3f87('0x3'));var router=express[_0x3f87('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3f87('0x5'));var controller=require('./intServicenowConfiguration.controller');router[_0x3f87('0x6')]('/',auth[_0x3f87('0x7')](),controller[_0x3f87('0x8')]);router[_0x3f87('0x6')](_0x3f87('0x9'),auth['isAuthenticated'](),controller[_0x3f87('0xa')]);router['get'](_0x3f87('0xb'),auth[_0x3f87('0x7')](),controller[_0x3f87('0xc')]);router['get'](_0x3f87('0xd'),auth[_0x3f87('0x7')](),controller[_0x3f87('0xe')]);router[_0x3f87('0x6')]('/:id/descriptions',auth[_0x3f87('0x7')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0x3f87('0xf')]);router[_0x3f87('0x10')](_0x3f87('0x9'),auth[_0x3f87('0x7')](),controller[_0x3f87('0x11')]);router[_0x3f87('0x12')](_0x3f87('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x3f87('0x13')]=router; \ No newline at end of file +var _0x2b10=['index','/:id','show','/:id/fields','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated'];(function(_0x92342b,_0x4b1810){var _0x44a822=function(_0x2c0e0c){while(--_0x2c0e0c){_0x92342b['push'](_0x92342b['shift']());}};_0x44a822(++_0x4b1810);}(_0x2b10,0xfc));var _0x02b1=function(_0xc164,_0x30abed){_0xc164=_0xc164-0x0;var _0x469d46=_0x2b10[_0xc164];return _0x469d46;};'use strict';var multer=require(_0x02b1('0x0'));var util=require(_0x02b1('0x1'));var path=require(_0x02b1('0x2'));var timeout=require(_0x02b1('0x3'));var express=require(_0x02b1('0x4'));var router=express[_0x02b1('0x5')]();var auth=require(_0x02b1('0x6'));var interaction=require(_0x02b1('0x7'));var config=require(_0x02b1('0x8'));var controller=require(_0x02b1('0x9'));router[_0x02b1('0xa')]('/',auth[_0x02b1('0xb')](),controller[_0x02b1('0xc')]);router['get'](_0x02b1('0xd'),auth['isAuthenticated'](),controller[_0x02b1('0xe')]);router[_0x02b1('0xa')](_0x02b1('0xf'),auth[_0x02b1('0xb')](),controller['getFields']);router[_0x02b1('0xa')]('/:id/subjects',auth[_0x02b1('0xb')](),controller[_0x02b1('0x10')]);router[_0x02b1('0xa')]('/:id/descriptions',auth[_0x02b1('0xb')](),controller[_0x02b1('0x11')]);router[_0x02b1('0x12')]('/',auth[_0x02b1('0xb')](),controller[_0x02b1('0x13')]);router[_0x02b1('0x14')](_0x02b1('0xd'),auth[_0x02b1('0xb')](),controller[_0x02b1('0x15')]);router[_0x02b1('0x16')](_0x02b1('0xd'),auth[_0x02b1('0xb')](),controller['destroy']);module[_0x02b1('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 8930452..180ebca 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 _0x9ff0=['sequelize','exports','STRING'];(function(_0x557d6a,_0x4a9fc9){var _0x3472f6=function(_0x468f9e){while(--_0x468f9e){_0x557d6a['push'](_0x557d6a['shift']());}};_0x3472f6(++_0x4a9fc9);}(_0x9ff0,0xcf));var _0x09ff=function(_0x489561,_0x123e93){_0x489561=_0x489561-0x0;var _0x1c638a=_0x9ff0[_0x489561];return _0x1c638a;};'use strict';var Sequelize=require(_0x09ff('0x0'));module[_0x09ff('0x1')]={'name':{'type':Sequelize[_0x09ff('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb0c0=['sequelize','exports','STRING'];(function(_0x21a14a,_0x2ef0f6){var _0x3d3931=function(_0x43f340){while(--_0x43f340){_0x21a14a['push'](_0x21a14a['shift']());}};_0x3d3931(++_0x2ef0f6);}(_0xb0c0,0x144));var _0x0b0c=function(_0x5abe26,_0x39c703){_0x5abe26=_0x5abe26-0x0;var _0x28eed8=_0xb0c0[_0x5abe26];return _0x28eed8;};'use strict';var Sequelize=require(_0x0b0c('0x0'));module[_0x0b0c('0x1')]={'name':{'type':Sequelize[_0x0b0c('0x2')]},'description':{'type':Sequelize[_0x0b0c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 6e48c7d..bac6f96 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 _0x326f=['hasOwnProperty','limit','order','sort','where','filters','pick','filter','map','type','key','VIRTUAL','field','merge','options','ServicenowConfiguration','include','findAll','rows','show','params','includeAll','find','create','body','update','getFields','findOne','ServicenowField','nolimit','getDescriptions','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','end','count','offset','set','json','apply','reject','save','destroy','sendStatus','name','send','rawAttributes','model','keys','query','intersection','attributes','fields','length'];(function(_0x2423d7,_0xe6ec57){var _0x151d17=function(_0x559e15){while(--_0x559e15){_0x2423d7['push'](_0x2423d7['shift']());}};_0x151d17(++_0xe6ec57);}(_0x326f,0xd1));var _0xf326=function(_0x4847a8,_0x5799fa){_0x4847a8=_0x4847a8-0x0;var _0x5c68f7=_0x326f[_0x4847a8];return _0x5c68f7;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var hardwareService=require(_0xf326('0x13'));var logger=require('../../config/logger')(_0xf326('0x14'));var utils=require('../../config/utils');var config=require(_0xf326('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xf326('0x16'));var client=jayson['client'][_0xf326('0x17')]({'port':0x232a});function checkPasswordPattern(_0x9ed463,_0x4b3966,_0x342fe5){if(_0x342fe5){var _0x472632=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x472632[_0xf326('0x18')](_0x4b3966)){return _0x9ed463;}else{throw new Error(_0xf326('0x19'));}}else{return _0x9ed463;}}function respondWithRpcPromise(_0x5c8483,_0x45c1b6,_0x5204ee,_0x54bd1a){return new BPromise(function(_0xdf21d9,_0x11f6d2){var _0x1f2e5a=_0x54bd1a||client;return _0x1f2e5a[_0xf326('0x1a')](_0x5c8483,_0x5204ee)[_0xf326('0x1b')](function(_0x287a2a){logger[_0xf326('0x1c')](_0xf326('0x1d'),_0x45c1b6,'request\x20sent');logger[_0xf326('0x1e')](_0xf326('0x1f'),_0x45c1b6,_0xf326('0x20'),JSON[_0xf326('0x21')](_0x287a2a));if(_0x287a2a[_0xf326('0x22')]){if(_0x287a2a[_0xf326('0x22')]['code']===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x45c1b6,_0x287a2a[_0xf326('0x22')][_0xf326('0x23')]);return _0x11f6d2(_0x287a2a['error']['message']);}logger[_0xf326('0x22')]('ServicenowConfiguration,\x20%s,\x20%s',_0x45c1b6,_0x287a2a['error'][_0xf326('0x23')]);return _0xdf21d9(_0x287a2a[_0xf326('0x22')]['message']);}else{logger['info'](_0xf326('0x1d'),_0x45c1b6,_0xf326('0x20'));_0xdf21d9(_0x287a2a['result'][_0xf326('0x23')]);}})[_0xf326('0x24')](function(_0x43c53e){logger[_0xf326('0x22')](_0xf326('0x1d'),_0x45c1b6,_0x43c53e);_0x11f6d2(_0x43c53e);});});}function respondWithStatusCode(_0x2049ec,_0x5ce532){_0x5ce532=_0x5ce532||0xcc;return function(_0x55b9f4){if(_0x55b9f4){return _0x2049ec['sendStatus'](_0x5ce532);}return _0x2049ec[_0xf326('0x25')](_0x5ce532)[_0xf326('0x26')]();};}function respondWithResult(_0x2cd45a,_0x1ff2b5){_0x1ff2b5=_0x1ff2b5||0xc8;return function(_0x148953){if(_0x148953){return _0x2cd45a[_0xf326('0x25')](_0x1ff2b5)['json'](_0x148953);}};}function respondWithFilteredResult(_0x201d28,_0xa3c0b){return function(_0x212d5d){if(_0x212d5d){var _0x581531=_0x212d5d[_0xf326('0x27')],_0x1617d2=_0xa3c0b[_0xf326('0x28')],_0x55ad0f=_0xa3c0b[_0xf326('0x28')]+_0xa3c0b['limit'],_0x4a9abf;if(_0x55ad0f>=_0x581531){_0x55ad0f=_0x581531;_0x4a9abf=0xc8;}else{_0x4a9abf=0xce;}_0x201d28[_0xf326('0x25')](_0x4a9abf);return _0x201d28[_0xf326('0x29')]('Content-Range',_0x1617d2+'-'+_0x55ad0f+'/'+_0x581531)[_0xf326('0x2a')](_0x212d5d);}return null;};}function patchUpdates(_0x119ab8){return function(_0xd77aba){try{jsonpatch[_0xf326('0x2b')](_0xd77aba,_0x119ab8,!![]);}catch(_0xa80156){return BPromise[_0xf326('0x2c')](_0xa80156);}return _0xd77aba[_0xf326('0x2d')]();};}function saveUpdates(_0x39a1e2,_0x43b951){return function(_0x349a03){if(_0x349a03){return _0x349a03['update'](_0x39a1e2)[_0xf326('0x1b')](function(_0x424104){return _0x424104;});}return null;};}function removeEntity(_0x21b23d,_0x4792d2){return function(_0x2c0cac){if(_0x2c0cac){return _0x2c0cac[_0xf326('0x2e')]()[_0xf326('0x1b')](function(){_0x21b23d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b8b31,_0x46d75e){return function(_0x9c3039){if(!_0x9c3039){_0x2b8b31[_0xf326('0x2f')](0x194);}return _0x9c3039;};}function handleError(_0x30694f,_0x2e8a64){_0x2e8a64=_0x2e8a64||0x1f4;return function(_0x62585a){logger[_0xf326('0x22')](_0x62585a['stack']);if(_0x62585a[_0xf326('0x30')]){delete _0x62585a[_0xf326('0x30')];}_0x30694f['status'](_0x2e8a64)[_0xf326('0x31')](_0x62585a);};}exports['index']=function(_0xce1cbb,_0x481b64){var _0x51f147={},_0xadb020={},_0x4d8eac={'count':0x0,'rows':[]};var _0x40dcb4=db['ServicenowConfiguration'][_0xf326('0x32')];_0xadb020[_0xf326('0x33')]=_[_0xf326('0x34')](_0x40dcb4);_0xadb020['query']=_[_0xf326('0x34')](_0xce1cbb[_0xf326('0x35')]);_0xadb020['filters']=_[_0xf326('0x36')](_0xadb020[_0xf326('0x33')],_0xadb020[_0xf326('0x35')]);_0x51f147[_0xf326('0x37')]=_['intersection'](_0xadb020[_0xf326('0x33')],qs[_0xf326('0x38')](_0xce1cbb[_0xf326('0x35')][_0xf326('0x38')]));_0x51f147[_0xf326('0x37')]=_0x51f147['attributes'][_0xf326('0x39')]?_0x51f147[_0xf326('0x37')]:_0xadb020['model'];if(!_0xce1cbb['query'][_0xf326('0x3a')]('nolimit')){_0x51f147['limit']=qs[_0xf326('0x3b')](_0xce1cbb['query'][_0xf326('0x3b')]);_0x51f147[_0xf326('0x28')]=qs[_0xf326('0x28')](_0xce1cbb[_0xf326('0x35')]['offset']);}_0x51f147[_0xf326('0x3c')]=qs[_0xf326('0x3d')](_0xce1cbb[_0xf326('0x35')][_0xf326('0x3d')]);_0x51f147[_0xf326('0x3e')]=qs[_0xf326('0x3f')](_[_0xf326('0x40')](_0xce1cbb[_0xf326('0x35')],_0xadb020[_0xf326('0x3f')]));if(_0xce1cbb[_0xf326('0x35')][_0xf326('0x41')]){_0x51f147[_0xf326('0x3e')]=_['merge'](_0x51f147[_0xf326('0x3e')],{'$or':_[_0xf326('0x42')](_0x40dcb4,function(_0x2ed1a7){if(_0x2ed1a7[_0xf326('0x43')][_0xf326('0x44')]!==_0xf326('0x45')){var _0x4f4c51={};_0x4f4c51[_0x2ed1a7[_0xf326('0x46')]]={'$like':'%'+_0xce1cbb[_0xf326('0x35')]['filter']+'%'};return _0x4f4c51;}})});}_0x51f147=_[_0xf326('0x47')]({},_0x51f147,_0xce1cbb[_0xf326('0x48')]);var _0x130c56={'where':_0x51f147[_0xf326('0x3e')]};return db[_0xf326('0x49')]['count'](_0x130c56)['then'](function(_0x184a74){_0x4d8eac[_0xf326('0x27')]=_0x184a74;if(_0xce1cbb['query']['includeAll']){_0x51f147[_0xf326('0x4a')]=[{'all':!![]}];}return db[_0xf326('0x49')][_0xf326('0x4b')](_0x51f147);})['then'](function(_0x301e65){_0x4d8eac[_0xf326('0x4c')]=_0x301e65;return _0x4d8eac;})[_0xf326('0x1b')](respondWithFilteredResult(_0x481b64,_0x51f147))[_0xf326('0x24')](handleError(_0x481b64,null));};exports[_0xf326('0x4d')]=function(_0x2d9bba,_0x12792c){var _0x3b90dc={'raw':![],'where':{'id':_0x2d9bba[_0xf326('0x4e')]['id']}},_0x3df9a8={};_0x3df9a8[_0xf326('0x33')]=_[_0xf326('0x34')](db[_0xf326('0x49')][_0xf326('0x32')]);_0x3df9a8[_0xf326('0x35')]=_['keys'](_0x2d9bba[_0xf326('0x35')]);_0x3df9a8[_0xf326('0x3f')]=_[_0xf326('0x36')](_0x3df9a8[_0xf326('0x33')],_0x3df9a8['query']);_0x3b90dc[_0xf326('0x37')]=_[_0xf326('0x36')](_0x3df9a8[_0xf326('0x33')],qs[_0xf326('0x38')](_0x2d9bba['query'][_0xf326('0x38')]));_0x3b90dc[_0xf326('0x37')]=_0x3b90dc[_0xf326('0x37')][_0xf326('0x39')]?_0x3b90dc[_0xf326('0x37')]:_0x3df9a8['model'];if(_0x2d9bba['query'][_0xf326('0x4f')]){_0x3b90dc[_0xf326('0x4a')]=[{'all':!![]}];}_0x3b90dc=_[_0xf326('0x47')]({},_0x3b90dc,_0x2d9bba['options']);return db[_0xf326('0x49')][_0xf326('0x50')](_0x3b90dc)[_0xf326('0x1b')](handleEntityNotFound(_0x12792c,null))['then'](respondWithResult(_0x12792c,null))['catch'](handleError(_0x12792c,null));};exports[_0xf326('0x51')]=function(_0x5b4832,_0x1cf58f){return db['ServicenowConfiguration'][_0xf326('0x51')](_0x5b4832[_0xf326('0x52')],{})[_0xf326('0x1b')](respondWithResult(_0x1cf58f,0xc9))[_0xf326('0x24')](handleError(_0x1cf58f,null));};exports[_0xf326('0x53')]=function(_0x35d3c8,_0x7f7ece){if(_0x35d3c8['body']['id']){delete _0x35d3c8[_0xf326('0x52')]['id'];}return db[_0xf326('0x49')][_0xf326('0x50')]({'where':{'id':_0x35d3c8['params']['id']}})[_0xf326('0x1b')](handleEntityNotFound(_0x7f7ece,null))[_0xf326('0x1b')](saveUpdates(_0x35d3c8[_0xf326('0x52')],null))[_0xf326('0x1b')](respondWithResult(_0x7f7ece,null))[_0xf326('0x24')](handleError(_0x7f7ece,null));};exports['destroy']=function(_0x161fb3,_0x21eac7){return db[_0xf326('0x49')][_0xf326('0x50')]({'where':{'id':_0x161fb3['params']['id']}})[_0xf326('0x1b')](handleEntityNotFound(_0x21eac7,null))[_0xf326('0x1b')](removeEntity(_0x21eac7,null))[_0xf326('0x24')](handleError(_0x21eac7,null));};exports[_0xf326('0x54')]=function(_0x4d3b9e,_0x5be2b1,_0x18b46e){var _0x44d2ed={};var _0x55ca96={};var _0x3cf6fa;var _0x29de71;return db[_0xf326('0x49')][_0xf326('0x55')]({'where':{'id':_0x4d3b9e['params']['id']}})[_0xf326('0x1b')](handleEntityNotFound(_0x5be2b1,null))['then'](function(_0x5dbeb9){if(_0x5dbeb9){_0x3cf6fa=_0x5dbeb9;_0x55ca96[_0xf326('0x33')]=_['keys'](db[_0xf326('0x56')][_0xf326('0x32')]);_0x55ca96[_0xf326('0x35')]=_['keys'](_0x4d3b9e['query']);_0x55ca96[_0xf326('0x3f')]=_[_0xf326('0x36')](_0x55ca96[_0xf326('0x33')],_0x55ca96['query']);_0x44d2ed[_0xf326('0x37')]=_['intersection'](_0x55ca96[_0xf326('0x33')],qs[_0xf326('0x38')](_0x4d3b9e[_0xf326('0x35')][_0xf326('0x38')]));_0x44d2ed[_0xf326('0x37')]=_0x44d2ed[_0xf326('0x37')][_0xf326('0x39')]?_0x44d2ed[_0xf326('0x37')]:_0x55ca96[_0xf326('0x33')];_0x44d2ed[_0xf326('0x3c')]=qs[_0xf326('0x3d')](_0x4d3b9e[_0xf326('0x35')][_0xf326('0x3d')]);_0x44d2ed['where']=qs[_0xf326('0x3f')](_['pick'](_0x4d3b9e[_0xf326('0x35')],_0x55ca96[_0xf326('0x3f')]));if(_0x4d3b9e['query'][_0xf326('0x41')]){_0x44d2ed['where']=_[_0xf326('0x47')](_0x44d2ed[_0xf326('0x3e')],{'$or':_[_0xf326('0x42')](_0x44d2ed[_0xf326('0x37')],function(_0x31b6dd){var _0x51ff5e={};_0x51ff5e[_0x31b6dd]={'$like':'%'+_0x4d3b9e['query'][_0xf326('0x41')]+'%'};return _0x51ff5e;})});}_0x44d2ed=_[_0xf326('0x47')]({},_0x44d2ed,_0x4d3b9e[_0xf326('0x48')]);return _0x3cf6fa[_0xf326('0x54')](_0x44d2ed);}})[_0xf326('0x1b')](function(_0x579d2c){if(_0x579d2c){_0x29de71=_0x579d2c[_0xf326('0x39')];if(!_0x4d3b9e[_0xf326('0x35')]['hasOwnProperty']('nolimit')){_0x44d2ed['limit']=qs[_0xf326('0x3b')](_0x4d3b9e[_0xf326('0x35')][_0xf326('0x3b')]);_0x44d2ed[_0xf326('0x28')]=qs[_0xf326('0x28')](_0x4d3b9e[_0xf326('0x35')][_0xf326('0x28')]);}return _0x3cf6fa['getFields'](_0x44d2ed);}})[_0xf326('0x1b')](function(_0x588d26){if(_0x588d26){return _0x588d26?{'count':_0x29de71,'rows':_0x588d26}:null;}})[_0xf326('0x1b')](respondWithResult(_0x5be2b1,null))[_0xf326('0x24')](handleError(_0x5be2b1,null));};exports['getSubjects']=function(_0x3717fe,_0x5eebe8,_0x499b59){var _0x2dd9e4={};var _0x540fa0={};var _0x78ba34;var _0x3411a4;return db[_0xf326('0x49')][_0xf326('0x55')]({'where':{'id':_0x3717fe[_0xf326('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5eebe8,null))['then'](function(_0x48d84a){if(_0x48d84a){_0x78ba34=_0x48d84a;_0x540fa0[_0xf326('0x33')]=_[_0xf326('0x34')](db[_0xf326('0x56')][_0xf326('0x32')]);_0x540fa0[_0xf326('0x35')]=_['keys'](_0x3717fe[_0xf326('0x35')]);_0x540fa0[_0xf326('0x3f')]=_[_0xf326('0x36')](_0x540fa0['model'],_0x540fa0['query']);_0x2dd9e4[_0xf326('0x37')]=_[_0xf326('0x36')](_0x540fa0['model'],qs['fields'](_0x3717fe[_0xf326('0x35')]['fields']));_0x2dd9e4[_0xf326('0x37')]=_0x2dd9e4['attributes']['length']?_0x2dd9e4['attributes']:_0x540fa0[_0xf326('0x33')];_0x2dd9e4[_0xf326('0x3c')]=qs[_0xf326('0x3d')](_0x3717fe['query'][_0xf326('0x3d')]);_0x2dd9e4[_0xf326('0x3e')]=qs[_0xf326('0x3f')](_[_0xf326('0x40')](_0x3717fe[_0xf326('0x35')],_0x540fa0[_0xf326('0x3f')]));if(_0x3717fe[_0xf326('0x35')][_0xf326('0x41')]){_0x2dd9e4[_0xf326('0x3e')]=_['merge'](_0x2dd9e4[_0xf326('0x3e')],{'$or':_['map'](_0x2dd9e4[_0xf326('0x37')],function(_0x366312){var _0x40ee66={};_0x40ee66[_0x366312]={'$like':'%'+_0x3717fe['query'][_0xf326('0x41')]+'%'};return _0x40ee66;})});}_0x2dd9e4=_[_0xf326('0x47')]({},_0x2dd9e4,_0x3717fe[_0xf326('0x48')]);return _0x78ba34['getSubjects'](_0x2dd9e4);}})[_0xf326('0x1b')](function(_0x4057e1){if(_0x4057e1){_0x3411a4=_0x4057e1[_0xf326('0x39')];if(!_0x3717fe[_0xf326('0x35')]['hasOwnProperty'](_0xf326('0x57'))){_0x2dd9e4['limit']=qs['limit'](_0x3717fe[_0xf326('0x35')][_0xf326('0x3b')]);_0x2dd9e4['offset']=qs['offset'](_0x3717fe['query'][_0xf326('0x28')]);}return _0x78ba34['getSubjects'](_0x2dd9e4);}})[_0xf326('0x1b')](function(_0x37a564){if(_0x37a564){return _0x37a564?{'count':_0x3411a4,'rows':_0x37a564}:null;}})[_0xf326('0x1b')](respondWithResult(_0x5eebe8,null))[_0xf326('0x24')](handleError(_0x5eebe8,null));};exports[_0xf326('0x58')]=function(_0x25b56c,_0x5d23f0,_0x39edf8){var _0x323926={};var _0x5f1724={};var _0x497ada;var _0x14eecc;return db['ServicenowConfiguration'][_0xf326('0x55')]({'where':{'id':_0x25b56c[_0xf326('0x4e')]['id']}})[_0xf326('0x1b')](handleEntityNotFound(_0x5d23f0,null))[_0xf326('0x1b')](function(_0x19d676){if(_0x19d676){_0x497ada=_0x19d676;_0x5f1724[_0xf326('0x33')]=_[_0xf326('0x34')](db[_0xf326('0x56')][_0xf326('0x32')]);_0x5f1724['query']=_[_0xf326('0x34')](_0x25b56c[_0xf326('0x35')]);_0x5f1724['filters']=_[_0xf326('0x36')](_0x5f1724['model'],_0x5f1724[_0xf326('0x35')]);_0x323926[_0xf326('0x37')]=_[_0xf326('0x36')](_0x5f1724['model'],qs[_0xf326('0x38')](_0x25b56c[_0xf326('0x35')][_0xf326('0x38')]));_0x323926[_0xf326('0x37')]=_0x323926[_0xf326('0x37')][_0xf326('0x39')]?_0x323926[_0xf326('0x37')]:_0x5f1724[_0xf326('0x33')];_0x323926[_0xf326('0x3c')]=qs[_0xf326('0x3d')](_0x25b56c[_0xf326('0x35')][_0xf326('0x3d')]);_0x323926[_0xf326('0x3e')]=qs[_0xf326('0x3f')](_[_0xf326('0x40')](_0x25b56c['query'],_0x5f1724[_0xf326('0x3f')]));if(_0x25b56c[_0xf326('0x35')]['filter']){_0x323926[_0xf326('0x3e')]=_[_0xf326('0x47')](_0x323926['where'],{'$or':_[_0xf326('0x42')](_0x323926[_0xf326('0x37')],function(_0x2b5747){var _0x8dbd96={};_0x8dbd96[_0x2b5747]={'$like':'%'+_0x25b56c[_0xf326('0x35')][_0xf326('0x41')]+'%'};return _0x8dbd96;})});}_0x323926=_[_0xf326('0x47')]({},_0x323926,_0x25b56c['options']);return _0x497ada[_0xf326('0x58')](_0x323926);}})[_0xf326('0x1b')](function(_0x323fb1){if(_0x323fb1){_0x14eecc=_0x323fb1[_0xf326('0x39')];if(!_0x25b56c[_0xf326('0x35')][_0xf326('0x3a')](_0xf326('0x57'))){_0x323926[_0xf326('0x3b')]=qs['limit'](_0x25b56c[_0xf326('0x35')][_0xf326('0x3b')]);_0x323926['offset']=qs[_0xf326('0x28')](_0x25b56c['query'][_0xf326('0x28')]);}return _0x497ada[_0xf326('0x58')](_0x323926);}})[_0xf326('0x1b')](function(_0x2a0f36){if(_0x2a0f36){return _0x2a0f36?{'count':_0x14eecc,'rows':_0x2a0f36}:null;}})[_0xf326('0x1b')](respondWithResult(_0x5d23f0,null))[_0xf326('0x24')](handleError(_0x5d23f0,null));}; \ No newline at end of file +var _0xadb5=['request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','index','rawAttributes','keys','filters','intersection','query','model','fields','attributes','length','where','pick','filter','map','type','key','VIRTUAL','field','ServicenowConfiguration','count','includeAll','include','show','params','options','find','create','body','destroy','getFields','findOne','ServicenowField','sort','merge','order','getSubjects','hasOwnProperty','getDescriptions','nolimit','eml-format','zip-dir','fast-json-patch'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xadb5,0xad));var _0x5adb=function(_0x26a1fd,_0x35215e){_0x26a1fd=_0x26a1fd-0x0;var _0x5cba48=_0xadb5[_0x26a1fd];return _0x5cba48;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5adb('0x14'));var utils=require(_0x5adb('0x15'));var config=require(_0x5adb('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x5adb('0x17'));var client=jayson['client'][_0x5adb('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5433bf,_0x8cfcc6,_0x39a0b3){if(_0x39a0b3){var _0x44abe3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44abe3['test'](_0x8cfcc6)){return _0x5433bf;}else{throw new Error(_0x5adb('0x19'));}}else{return _0x5433bf;}}function respondWithRpcPromise(_0x34af2c,_0xf82f72,_0x5263ec,_0x2312de){return new BPromise(function(_0x518823,_0x367d82){var _0x42a482=_0x2312de||client;return _0x42a482[_0x5adb('0x1a')](_0x34af2c,_0x5263ec)[_0x5adb('0x1b')](function(_0x1c0f97){logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));logger[_0x5adb('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xf82f72,_0x5adb('0x1e'),JSON['stringify'](_0x1c0f97));if(_0x1c0f97[_0x5adb('0x20')]){if(_0x1c0f97['error'][_0x5adb('0x21')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);return _0x367d82(_0x1c0f97[_0x5adb('0x20')][_0x5adb('0x22')]);}logger[_0x5adb('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0xf82f72,_0x1c0f97[_0x5adb('0x20')]['message']);return _0x518823(_0x1c0f97['error'][_0x5adb('0x22')]);}else{logger[_0x5adb('0x1c')](_0x5adb('0x1d'),_0xf82f72,_0x5adb('0x1e'));_0x518823(_0x1c0f97[_0x5adb('0x23')][_0x5adb('0x22')]);}})[_0x5adb('0x24')](function(_0x4ca150){logger[_0x5adb('0x20')](_0x5adb('0x1d'),_0xf82f72,_0x4ca150);_0x367d82(_0x4ca150);});});}function respondWithStatusCode(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0xcc;return function(_0xeb556c){if(_0xeb556c){return _0x3220cd['sendStatus'](_0x3839fb);}return _0x3220cd[_0x5adb('0x25')](_0x3839fb)[_0x5adb('0x26')]();};}function respondWithResult(_0x5aed76,_0x1feecf){_0x1feecf=_0x1feecf||0xc8;return function(_0x1ded9f){if(_0x1ded9f){return _0x5aed76[_0x5adb('0x25')](_0x1feecf)['json'](_0x1ded9f);}};}function respondWithFilteredResult(_0x13ad1d,_0xbe21b1){return function(_0x3a4fca){if(_0x3a4fca){var _0x2c64a3=_0x3a4fca['count'],_0x36459b=_0xbe21b1['offset'],_0x1c06c4=_0xbe21b1[_0x5adb('0x27')]+_0xbe21b1[_0x5adb('0x28')],_0x4a5d46;if(_0x1c06c4>=_0x2c64a3){_0x1c06c4=_0x2c64a3;_0x4a5d46=0xc8;}else{_0x4a5d46=0xce;}_0x13ad1d[_0x5adb('0x25')](_0x4a5d46);return _0x13ad1d[_0x5adb('0x29')](_0x5adb('0x2a'),_0x36459b+'-'+_0x1c06c4+'/'+_0x2c64a3)['json'](_0x3a4fca);}return null;};}function patchUpdates(_0x11ec2a){return function(_0x34b793){try{jsonpatch[_0x5adb('0x2b')](_0x34b793,_0x11ec2a,!![]);}catch(_0x3b1fed){return BPromise[_0x5adb('0x2c')](_0x3b1fed);}return _0x34b793[_0x5adb('0x2d')]();};}function saveUpdates(_0x28190d,_0x28bf1f){return function(_0x138bf6){if(_0x138bf6){return _0x138bf6[_0x5adb('0x2e')](_0x28190d)['then'](function(_0x2e46ce){return _0x2e46ce;});}return null;};}function removeEntity(_0x4c8b2e,_0x12424d){return function(_0x20cde6){if(_0x20cde6){return _0x20cde6['destroy']()[_0x5adb('0x1b')](function(){_0x4c8b2e[_0x5adb('0x25')](0xcc)[_0x5adb('0x26')]();});}};}function handleEntityNotFound(_0x4a3661,_0x173789){return function(_0x14cf00){if(!_0x14cf00){_0x4a3661['sendStatus'](0x194);}return _0x14cf00;};}function handleError(_0x5bb227,_0x1ed9ea){_0x1ed9ea=_0x1ed9ea||0x1f4;return function(_0x49dd03){logger[_0x5adb('0x20')](_0x49dd03[_0x5adb('0x2f')]);if(_0x49dd03[_0x5adb('0x30')]){delete _0x49dd03[_0x5adb('0x30')];}_0x5bb227[_0x5adb('0x25')](_0x1ed9ea)['send'](_0x49dd03);};}exports[_0x5adb('0x31')]=function(_0x215b88,_0x1c3a5c){var _0x54851b={},_0x4c8870={},_0x32eb69={'count':0x0,'rows':[]};var _0x5d1baa=db['ServicenowConfiguration'][_0x5adb('0x32')];_0x4c8870['model']=_[_0x5adb('0x33')](_0x5d1baa);_0x4c8870['query']=_[_0x5adb('0x33')](_0x215b88['query']);_0x4c8870[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4c8870['model'],_0x4c8870[_0x5adb('0x36')]);_0x54851b['attributes']=_[_0x5adb('0x35')](_0x4c8870[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0x215b88['query'][_0x5adb('0x38')]));_0x54851b[_0x5adb('0x39')]=_0x54851b[_0x5adb('0x39')][_0x5adb('0x3a')]?_0x54851b[_0x5adb('0x39')]:_0x4c8870['model'];if(!_0x215b88['query']['hasOwnProperty']('nolimit')){_0x54851b[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x28')]);_0x54851b[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x215b88[_0x5adb('0x36')][_0x5adb('0x27')]);}_0x54851b['order']=qs['sort'](_0x215b88[_0x5adb('0x36')]['sort']);_0x54851b[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_[_0x5adb('0x3c')](_0x215b88[_0x5adb('0x36')],_0x4c8870[_0x5adb('0x34')]));if(_0x215b88['query'][_0x5adb('0x3d')]){_0x54851b[_0x5adb('0x3b')]=_['merge'](_0x54851b[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x5d1baa,function(_0x5833c8){if(_0x5833c8[_0x5adb('0x3f')][_0x5adb('0x40')]!==_0x5adb('0x41')){var _0x35c379={};_0x35c379[_0x5833c8[_0x5adb('0x42')]]={'$like':'%'+_0x215b88[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x35c379;}})});}_0x54851b=_['merge']({},_0x54851b,_0x215b88['options']);var _0x26a656={'where':_0x54851b[_0x5adb('0x3b')]};return db[_0x5adb('0x43')][_0x5adb('0x44')](_0x26a656)['then'](function(_0x507e48){_0x32eb69[_0x5adb('0x44')]=_0x507e48;if(_0x215b88[_0x5adb('0x36')][_0x5adb('0x45')]){_0x54851b[_0x5adb('0x46')]=[{'all':!![]}];}return db[_0x5adb('0x43')]['findAll'](_0x54851b);})[_0x5adb('0x1b')](function(_0x437f52){_0x32eb69['rows']=_0x437f52;return _0x32eb69;})[_0x5adb('0x1b')](respondWithFilteredResult(_0x1c3a5c,_0x54851b))[_0x5adb('0x24')](handleError(_0x1c3a5c,null));};exports[_0x5adb('0x47')]=function(_0x24758f,_0x186bd2){var _0x3a5409={'raw':![],'where':{'id':_0x24758f[_0x5adb('0x48')]['id']}},_0x39840e={};_0x39840e['model']=_[_0x5adb('0x33')](db['ServicenowConfiguration']['rawAttributes']);_0x39840e['query']=_[_0x5adb('0x33')](_0x24758f[_0x5adb('0x36')]);_0x39840e[_0x5adb('0x34')]=_['intersection'](_0x39840e[_0x5adb('0x37')],_0x39840e['query']);_0x3a5409[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x39840e[_0x5adb('0x37')],qs['fields'](_0x24758f[_0x5adb('0x36')]['fields']));_0x3a5409[_0x5adb('0x39')]=_0x3a5409[_0x5adb('0x39')]['length']?_0x3a5409[_0x5adb('0x39')]:_0x39840e[_0x5adb('0x37')];if(_0x24758f[_0x5adb('0x36')][_0x5adb('0x45')]){_0x3a5409[_0x5adb('0x46')]=[{'all':!![]}];}_0x3a5409=_['merge']({},_0x3a5409,_0x24758f[_0x5adb('0x49')]);return db[_0x5adb('0x43')][_0x5adb('0x4a')](_0x3a5409)[_0x5adb('0x1b')](handleEntityNotFound(_0x186bd2,null))['then'](respondWithResult(_0x186bd2,null))[_0x5adb('0x24')](handleError(_0x186bd2,null));};exports[_0x5adb('0x4b')]=function(_0x3b4794,_0x4d98d0){return db[_0x5adb('0x43')][_0x5adb('0x4b')](_0x3b4794[_0x5adb('0x4c')],{})[_0x5adb('0x1b')](respondWithResult(_0x4d98d0,0xc9))['catch'](handleError(_0x4d98d0,null));};exports[_0x5adb('0x2e')]=function(_0x91775c,_0x28b291){if(_0x91775c[_0x5adb('0x4c')]['id']){delete _0x91775c[_0x5adb('0x4c')]['id'];}return db['ServicenowConfiguration'][_0x5adb('0x4a')]({'where':{'id':_0x91775c['params']['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x28b291,null))['then'](saveUpdates(_0x91775c[_0x5adb('0x4c')],null))[_0x5adb('0x1b')](respondWithResult(_0x28b291,null))[_0x5adb('0x24')](handleError(_0x28b291,null));};exports[_0x5adb('0x4d')]=function(_0x59b512,_0x18f95c){return db[_0x5adb('0x43')][_0x5adb('0x4a')]({'where':{'id':_0x59b512['params']['id']}})['then'](handleEntityNotFound(_0x18f95c,null))['then'](removeEntity(_0x18f95c,null))[_0x5adb('0x24')](handleError(_0x18f95c,null));};exports[_0x5adb('0x4e')]=function(_0xa5ecc0,_0x12a146,_0xa833f4){var _0xb06bee={};var _0x204b9b={};var _0x8d7810;var _0xc880af;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'id':_0xa5ecc0[_0x5adb('0x48')]['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x12a146,null))['then'](function(_0x49f4c8){if(_0x49f4c8){_0x8d7810=_0x49f4c8;_0x204b9b[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x204b9b['query']=_[_0x5adb('0x33')](_0xa5ecc0[_0x5adb('0x36')]);_0x204b9b['filters']=_[_0x5adb('0x35')](_0x204b9b[_0x5adb('0x37')],_0x204b9b[_0x5adb('0x36')]);_0xb06bee['attributes']=_[_0x5adb('0x35')](_0x204b9b[_0x5adb('0x37')],qs[_0x5adb('0x38')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x38')]));_0xb06bee[_0x5adb('0x39')]=_0xb06bee['attributes'][_0x5adb('0x3a')]?_0xb06bee[_0x5adb('0x39')]:_0x204b9b[_0x5adb('0x37')];_0xb06bee['order']=qs[_0x5adb('0x51')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x51')]);_0xb06bee['where']=qs[_0x5adb('0x34')](_['pick'](_0xa5ecc0[_0x5adb('0x36')],_0x204b9b[_0x5adb('0x34')]));if(_0xa5ecc0[_0x5adb('0x36')]['filter']){_0xb06bee[_0x5adb('0x3b')]=_[_0x5adb('0x52')](_0xb06bee['where'],{'$or':_[_0x5adb('0x3e')](_0xb06bee[_0x5adb('0x39')],function(_0x248739){var _0x3fcad5={};_0x3fcad5[_0x248739]={'$like':'%'+_0xa5ecc0['query'][_0x5adb('0x3d')]+'%'};return _0x3fcad5;})});}_0xb06bee=_[_0x5adb('0x52')]({},_0xb06bee,_0xa5ecc0[_0x5adb('0x49')]);return _0x8d7810[_0x5adb('0x4e')](_0xb06bee);}})['then'](function(_0x53a4bc){if(_0x53a4bc){_0xc880af=_0x53a4bc[_0x5adb('0x3a')];if(!_0xa5ecc0['query']['hasOwnProperty']('nolimit')){_0xb06bee[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0xa5ecc0['query'][_0x5adb('0x28')]);_0xb06bee[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0xa5ecc0[_0x5adb('0x36')][_0x5adb('0x27')]);}return _0x8d7810[_0x5adb('0x4e')](_0xb06bee);}})[_0x5adb('0x1b')](function(_0x1ffcd3){if(_0x1ffcd3){return _0x1ffcd3?{'count':_0xc880af,'rows':_0x1ffcd3}:null;}})['then'](respondWithResult(_0x12a146,null))['catch'](handleError(_0x12a146,null));};exports['getSubjects']=function(_0x347b7b,_0x4357a6,_0x3a0d1b){var _0x2a55a3={};var _0x1f59bb={};var _0x2f6ef7;var _0x386c76;return db[_0x5adb('0x43')]['findOne']({'where':{'id':_0x347b7b['params']['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x4357a6,null))[_0x5adb('0x1b')](function(_0x114ee4){if(_0x114ee4){_0x2f6ef7=_0x114ee4;_0x1f59bb[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x1f59bb[_0x5adb('0x36')]=_[_0x5adb('0x33')](_0x347b7b[_0x5adb('0x36')]);_0x1f59bb['filters']=_[_0x5adb('0x35')](_0x1f59bb[_0x5adb('0x37')],_0x1f59bb[_0x5adb('0x36')]);_0x2a55a3['attributes']=_[_0x5adb('0x35')](_0x1f59bb[_0x5adb('0x37')],qs['fields'](_0x347b7b[_0x5adb('0x36')]['fields']));_0x2a55a3[_0x5adb('0x39')]=_0x2a55a3[_0x5adb('0x39')]['length']?_0x2a55a3[_0x5adb('0x39')]:_0x1f59bb[_0x5adb('0x37')];_0x2a55a3[_0x5adb('0x53')]=qs[_0x5adb('0x51')](_0x347b7b[_0x5adb('0x36')][_0x5adb('0x51')]);_0x2a55a3[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_['pick'](_0x347b7b[_0x5adb('0x36')],_0x1f59bb[_0x5adb('0x34')]));if(_0x347b7b[_0x5adb('0x36')]['filter']){_0x2a55a3['where']=_[_0x5adb('0x52')](_0x2a55a3['where'],{'$or':_[_0x5adb('0x3e')](_0x2a55a3[_0x5adb('0x39')],function(_0xd6cc89){var _0x50600f={};_0x50600f[_0xd6cc89]={'$like':'%'+_0x347b7b[_0x5adb('0x36')][_0x5adb('0x3d')]+'%'};return _0x50600f;})});}_0x2a55a3=_[_0x5adb('0x52')]({},_0x2a55a3,_0x347b7b[_0x5adb('0x49')]);return _0x2f6ef7[_0x5adb('0x54')](_0x2a55a3);}})['then'](function(_0x2a3084){if(_0x2a3084){_0x386c76=_0x2a3084[_0x5adb('0x3a')];if(!_0x347b7b[_0x5adb('0x36')][_0x5adb('0x55')]('nolimit')){_0x2a55a3[_0x5adb('0x28')]=qs[_0x5adb('0x28')](_0x347b7b[_0x5adb('0x36')][_0x5adb('0x28')]);_0x2a55a3[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x347b7b[_0x5adb('0x36')]['offset']);}return _0x2f6ef7[_0x5adb('0x54')](_0x2a55a3);}})[_0x5adb('0x1b')](function(_0x5f36ec){if(_0x5f36ec){return _0x5f36ec?{'count':_0x386c76,'rows':_0x5f36ec}:null;}})[_0x5adb('0x1b')](respondWithResult(_0x4357a6,null))[_0x5adb('0x24')](handleError(_0x4357a6,null));};exports['getDescriptions']=function(_0x462fa0,_0x50f8ed,_0x372354){var _0x268df2={};var _0x4a2ebc={};var _0x167432;var _0x54c2c8;return db[_0x5adb('0x43')][_0x5adb('0x4f')]({'where':{'id':_0x462fa0[_0x5adb('0x48')]['id']}})[_0x5adb('0x1b')](handleEntityNotFound(_0x50f8ed,null))[_0x5adb('0x1b')](function(_0x4dbcd9){if(_0x4dbcd9){_0x167432=_0x4dbcd9;_0x4a2ebc[_0x5adb('0x37')]=_[_0x5adb('0x33')](db[_0x5adb('0x50')][_0x5adb('0x32')]);_0x4a2ebc['query']=_['keys'](_0x462fa0[_0x5adb('0x36')]);_0x4a2ebc[_0x5adb('0x34')]=_[_0x5adb('0x35')](_0x4a2ebc[_0x5adb('0x37')],_0x4a2ebc[_0x5adb('0x36')]);_0x268df2[_0x5adb('0x39')]=_[_0x5adb('0x35')](_0x4a2ebc['model'],qs[_0x5adb('0x38')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x38')]));_0x268df2[_0x5adb('0x39')]=_0x268df2['attributes'][_0x5adb('0x3a')]?_0x268df2[_0x5adb('0x39')]:_0x4a2ebc[_0x5adb('0x37')];_0x268df2[_0x5adb('0x53')]=qs[_0x5adb('0x51')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x51')]);_0x268df2[_0x5adb('0x3b')]=qs[_0x5adb('0x34')](_['pick'](_0x462fa0[_0x5adb('0x36')],_0x4a2ebc[_0x5adb('0x34')]));if(_0x462fa0['query'][_0x5adb('0x3d')]){_0x268df2[_0x5adb('0x3b')]=_[_0x5adb('0x52')](_0x268df2[_0x5adb('0x3b')],{'$or':_[_0x5adb('0x3e')](_0x268df2[_0x5adb('0x39')],function(_0x450516){var _0x350bb1={};_0x350bb1[_0x450516]={'$like':'%'+_0x462fa0['query'][_0x5adb('0x3d')]+'%'};return _0x350bb1;})});}_0x268df2=_[_0x5adb('0x52')]({},_0x268df2,_0x462fa0['options']);return _0x167432[_0x5adb('0x56')](_0x268df2);}})[_0x5adb('0x1b')](function(_0x14d4a7){if(_0x14d4a7){_0x54c2c8=_0x14d4a7['length'];if(!_0x462fa0['query'][_0x5adb('0x55')](_0x5adb('0x57'))){_0x268df2[_0x5adb('0x28')]=qs['limit'](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x28')]);_0x268df2[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x462fa0[_0x5adb('0x36')][_0x5adb('0x27')]);}return _0x167432[_0x5adb('0x56')](_0x268df2);}})[_0x5adb('0x1b')](function(_0x28bd33){if(_0x28bd33){return _0x28bd33?{'count':_0x54c2c8,'rows':_0x28bd33}:null;}})[_0x5adb('0x1b')](respondWithResult(_0x50f8ed,null))[_0x5adb('0x24')](handleError(_0x50f8ed,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 6dc3620..3f44b9c 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 _0x2a69=['../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x2a69,0x159));var _0x92a6=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2a69[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x92a6('0x0'));var util=require(_0x92a6('0x1'));var logger=require('../../config/logger')(_0x92a6('0x2'));var moment=require(_0x92a6('0x3'));var BPromise=require(_0x92a6('0x4'));var rp=require(_0x92a6('0x5'));var fs=require('fs');var path=require(_0x92a6('0x6'));var rimraf=require('rimraf');var config=require(_0x92a6('0x7'));var attributes=require(_0x92a6('0x8'));module['exports']=function(_0x3c364a,_0x571910){return _0x3c364a[_0x92a6('0x9')](_0x92a6('0xa'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfea1=['path','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','moment','request-promise'];(function(_0x23a311,_0x12a101){var _0x528616=function(_0x34828a){while(--_0x34828a){_0x23a311['push'](_0x23a311['shift']());}};_0x528616(++_0x12a101);}(_0xfea1,0x163));var _0x1fea=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0xfea1[_0x2dc96f];return _0xd012da;};'use strict';var _=require(_0x1fea('0x0'));var util=require(_0x1fea('0x1'));var logger=require(_0x1fea('0x2'))('api');var moment=require(_0x1fea('0x3'));var BPromise=require('bluebird');var rp=require(_0x1fea('0x4'));var fs=require('fs');var path=require(_0x1fea('0x5'));var rimraf=require(_0x1fea('0x6'));var config=require('../../config/environment');var attributes=require(_0x1fea('0x7'));module[_0x1fea('0x8')]=function(_0x2094e8,_0x2de394){return _0x2094e8[_0x1fea('0x9')](_0x1fea('0xa'),attributes,{'tableName':_0x1fea('0xb'),'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 ab9762c..c81f864 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 _0x2f03=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x3407ee,_0xb2e716){var _0x1b0b35=function(_0x457262){while(--_0x457262){_0x3407ee['push'](_0x3407ee['shift']());}};_0x1b0b35(++_0xb2e716);}(_0x2f03,0x9b));var _0x32f0=function(_0x12f21e,_0x1e8b11){_0x12f21e=_0x12f21e-0x0;var _0x348b51=_0x2f03[_0x12f21e];return _0x348b51;};'use strict';var _=require(_0x32f0('0x0'));var util=require(_0x32f0('0x1'));var moment=require(_0x32f0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x32f0('0x3'));var db=require(_0x32f0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x32f0('0x5'))(_0x32f0('0x6'));var config=require(_0x32f0('0x7'));var jayson=require(_0x32f0('0x8'));var client=jayson[_0x32f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3167bf,_0x10b4c6,_0x1d457f){return new BPromise(function(_0x91ebb1,_0x2973bc){return client[_0x32f0('0xa')](_0x3167bf,_0x1d457f)[_0x32f0('0xb')](function(_0x1e601f){logger[_0x32f0('0xc')](_0x32f0('0xd'),_0x10b4c6,_0x32f0('0xe'));logger[_0x32f0('0xf')](_0x32f0('0x10'),_0x10b4c6,_0x32f0('0xe'),JSON['stringify'](_0x1e601f));if(_0x1e601f['error']){if(_0x1e601f['error'][_0x32f0('0x11')]===0x1f4){logger['error'](_0x32f0('0xd'),_0x10b4c6,_0x1e601f[_0x32f0('0x12')]['message']);return _0x2973bc(_0x1e601f['error'][_0x32f0('0x13')]);}logger[_0x32f0('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x10b4c6,_0x1e601f['error'][_0x32f0('0x13')]);return _0x91ebb1(_0x1e601f[_0x32f0('0x12')][_0x32f0('0x13')]);}else{logger[_0x32f0('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x10b4c6,_0x32f0('0xe'));_0x91ebb1(_0x1e601f[_0x32f0('0x14')][_0x32f0('0x13')]);}})[_0x32f0('0x15')](function(_0x19baa3){logger[_0x32f0('0x12')](_0x32f0('0xd'),_0x10b4c6,_0x19baa3);_0x2973bc(_0x19baa3);});});} \ No newline at end of file +var _0x9a45=['code','message','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x41a785,_0x2a6ffa){var _0x56f35d=function(_0x5199d4){while(--_0x5199d4){_0x41a785['push'](_0x41a785['shift']());}};_0x56f35d(++_0x2a6ffa);}(_0x9a45,0xca));var _0x59a4=function(_0x19e3c2,_0x177a95){_0x19e3c2=_0x19e3c2-0x0;var _0x2bb88f=_0x9a45[_0x19e3c2];return _0x2bb88f;};'use strict';var _=require(_0x59a4('0x0'));var util=require(_0x59a4('0x1'));var moment=require('moment');var BPromise=require(_0x59a4('0x2'));var rs=require(_0x59a4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x59a4('0x4'));var logger=require(_0x59a4('0x5'))(_0x59a4('0x6'));var config=require('../../config/environment');var jayson=require(_0x59a4('0x7'));var client=jayson[_0x59a4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x261dcf,_0x283f3e,_0x593d2f){return new BPromise(function(_0xc86690,_0x1742fd){return client[_0x59a4('0x9')](_0x261dcf,_0x593d2f)[_0x59a4('0xa')](function(_0xed8876){logger[_0x59a4('0xb')](_0x59a4('0xc'),_0x283f3e,_0x59a4('0xd'));logger[_0x59a4('0xe')](_0x59a4('0xf'),_0x283f3e,_0x59a4('0xd'),JSON[_0x59a4('0x10')](_0xed8876));if(_0xed8876[_0x59a4('0x11')]){if(_0xed8876[_0x59a4('0x11')][_0x59a4('0x12')]===0x1f4){logger[_0x59a4('0x11')](_0x59a4('0xc'),_0x283f3e,_0xed8876[_0x59a4('0x11')][_0x59a4('0x13')]);return _0x1742fd(_0xed8876['error'][_0x59a4('0x13')]);}logger[_0x59a4('0x11')](_0x59a4('0xc'),_0x283f3e,_0xed8876[_0x59a4('0x11')][_0x59a4('0x13')]);return _0xc86690(_0xed8876[_0x59a4('0x11')][_0x59a4('0x13')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x283f3e,'request\x20sent');_0xc86690(_0xed8876['result'][_0x59a4('0x13')]);}})['catch'](function(_0x2a3ee2){logger[_0x59a4('0x11')](_0x59a4('0xc'),_0x283f3e,_0x2a3ee2);_0x1742fd(_0x2a3ee2);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 2ee84a9..2577906 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 _0x4b0c=['put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','post'];(function(_0x3fc946,_0x3bd6ff){var _0x521fa1=function(_0x56d587){while(--_0x56d587){_0x3fc946['push'](_0x3fc946['shift']());}};_0x521fa1(++_0x3bd6ff);}(_0x4b0c,0x6a));var _0xc4b0=function(_0x1eda21,_0x3ecbd8){_0x1eda21=_0x1eda21-0x0;var _0x26efb3=_0x4b0c[_0x1eda21];return _0x26efb3;};'use strict';var multer=require(_0xc4b0('0x0'));var util=require(_0xc4b0('0x1'));var path=require('path');var timeout=require(_0xc4b0('0x2'));var express=require(_0xc4b0('0x3'));var router=express[_0xc4b0('0x4')]();var auth=require(_0xc4b0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc4b0('0x6'));var controller=require(_0xc4b0('0x7'));router[_0xc4b0('0x8')]('/',auth[_0xc4b0('0x9')](),controller[_0xc4b0('0xa')]);router[_0xc4b0('0x8')](_0xc4b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc4b0('0xc')]('/',auth[_0xc4b0('0x9')](),controller['create']);router[_0xc4b0('0xd')](_0xc4b0('0xb'),auth[_0xc4b0('0x9')](),controller[_0xc4b0('0xe')]);router[_0xc4b0('0xf')](_0xc4b0('0xb'),auth['isAuthenticated'](),controller[_0xc4b0('0x10')]);module['exports']=router; \ No newline at end of file +var _0x8f71=['util','express','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x8f71,0xed));var _0x18f7=function(_0x46a8c4,_0x312adc){_0x46a8c4=_0x46a8c4-0x0;var _0x16515c=_0x8f71[_0x46a8c4];return _0x16515c;};'use strict';var multer=require(_0x18f7('0x0'));var util=require(_0x18f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x18f7('0x2'));var router=express['Router']();var auth=require(_0x18f7('0x3'));var interaction=require(_0x18f7('0x4'));var config=require('../../config/environment');var controller=require(_0x18f7('0x5'));router[_0x18f7('0x6')]('/',auth[_0x18f7('0x7')](),controller[_0x18f7('0x8')]);router['get']('/:id',auth[_0x18f7('0x7')](),controller[_0x18f7('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x18f7('0xa')]);router[_0x18f7('0xb')](_0x18f7('0xc'),auth[_0x18f7('0x7')](),controller[_0x18f7('0xd')]);router[_0x18f7('0xe')](_0x18f7('0xc'),auth[_0x18f7('0x7')](),controller[_0x18f7('0xf')]);module[_0x18f7('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 10bce95..dc0ec94 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 _0x5c00=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x52cb84,_0x4992a8){var _0x542310=function(_0x177f98){while(--_0x177f98){_0x52cb84['push'](_0x52cb84['shift']());}};_0x542310(++_0x4992a8);}(_0x5c00,0x17e));var _0x05c0=function(_0x17f85f,_0x5c6ff9){_0x17f85f=_0x17f85f-0x0;var _0x38100a=_0x5c00[_0x17f85f];return _0x38100a;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'type':{'type':Sequelize[_0x05c0('0x2')]('string',_0x05c0('0x3'),'customVariable',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'content':{'type':Sequelize[_0x05c0('0x6')]},'key':{'type':Sequelize[_0x05c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x05c0('0x5'),_0x05c0('0x3'),_0x05c0('0x7'))},'keyContent':{'type':Sequelize[_0x05c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05c0('0x6')]},'customField':{'type':Sequelize[_0x05c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05c0('0x6')]}}; \ No newline at end of file +var _0xb688=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x4d8e49,_0x102e48){var _0xb4257b=function(_0x358b03){while(--_0x358b03){_0x4d8e49['push'](_0x4d8e49['shift']());}};_0xb4257b(++_0x102e48);}(_0xb688,0xcf));var _0x8b68=function(_0x5e2cde,_0x20dae0){_0x5e2cde=_0x5e2cde-0x0;var _0x33b759=_0xb688[_0x5e2cde];return _0x33b759;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'type':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),_0x8b68('0x3'),_0x8b68('0x4'),_0x8b68('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8b68('0x6')]},'key':{'type':Sequelize[_0x8b68('0x6')]},'keyType':{'type':Sequelize[_0x8b68('0x1')](_0x8b68('0x2'),'variable',_0x8b68('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8b68('0x6')]},'nameField':{'type':Sequelize[_0x8b68('0x6')]},'customField':{'type':Sequelize[_0x8b68('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8b68('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index afd3d4d..9ca4492 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 _0x57ca=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','map','type','key','VIRTUAL','filter','merge','ServicenowField','includeAll','include','findAll','rows','params','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse'];(function(_0x145c1c,_0x27e490){var _0x57e119=function(_0x100d9e){while(--_0x100d9e){_0x145c1c['push'](_0x145c1c['shift']());}};_0x57e119(++_0x27e490);}(_0x57ca,0x108));var _0xa57c=function(_0xfa86e,_0x35dc17){_0xfa86e=_0xfa86e-0x0;var _0x3d535d=_0x57ca[_0xfa86e];return _0x3d535d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x9'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa57c('0x12'))(_0xa57c('0x13'));var utils=require('../../config/utils');var config=require(_0xa57c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4200c1,_0x4ca5b2){_0x4ca5b2=_0x4ca5b2||0xcc;return function(_0x1f2bb5){if(_0x1f2bb5){return _0x4200c1[_0xa57c('0x15')](_0x4ca5b2);}return _0x4200c1[_0xa57c('0x16')](_0x4ca5b2)['end']();};}function respondWithResult(_0x2644a1,_0x546cde){_0x546cde=_0x546cde||0xc8;return function(_0x30d23d){if(_0x30d23d){return _0x2644a1[_0xa57c('0x16')](_0x546cde)[_0xa57c('0x17')](_0x30d23d);}};}function respondWithFilteredResult(_0x3821d2,_0x3238ff){return function(_0x37a323){if(_0x37a323){var _0x3f900a=_0x37a323[_0xa57c('0x18')],_0x4b4bdb=_0x3238ff['offset'],_0x26607a=_0x3238ff[_0xa57c('0x19')]+_0x3238ff['limit'],_0xdf7ff6;if(_0x26607a>=_0x3f900a){_0x26607a=_0x3f900a;_0xdf7ff6=0xc8;}else{_0xdf7ff6=0xce;}_0x3821d2[_0xa57c('0x16')](_0xdf7ff6);return _0x3821d2[_0xa57c('0x1a')](_0xa57c('0x1b'),_0x4b4bdb+'-'+_0x26607a+'/'+_0x3f900a)[_0xa57c('0x17')](_0x37a323);}return null;};}function patchUpdates(_0x1fd0d8){return function(_0x4728f9){try{jsonpatch[_0xa57c('0x1c')](_0x4728f9,_0x1fd0d8,!![]);}catch(_0x595c7a){return BPromise['reject'](_0x595c7a);}return _0x4728f9[_0xa57c('0x1d')]();};}function saveUpdates(_0x4a53ab,_0x4a35bb){return function(_0x418415){if(_0x418415){return _0x418415[_0xa57c('0x1e')](_0x4a53ab)[_0xa57c('0x1f')](function(_0x23bec0){return _0x23bec0;});}return null;};}function removeEntity(_0x49242c,_0x348211){return function(_0x25715f){if(_0x25715f){return _0x25715f[_0xa57c('0x20')]()[_0xa57c('0x1f')](function(){_0x49242c[_0xa57c('0x16')](0xcc)[_0xa57c('0x21')]();});}};}function handleEntityNotFound(_0x1e0192,_0x42038e){return function(_0x2e99ed){if(!_0x2e99ed){_0x1e0192[_0xa57c('0x15')](0x194);}return _0x2e99ed;};}function handleError(_0x382a26,_0x1e7f7a){_0x1e7f7a=_0x1e7f7a||0x1f4;return function(_0x241dcc){logger[_0xa57c('0x22')](_0x241dcc[_0xa57c('0x23')]);if(_0x241dcc['name']){delete _0x241dcc[_0xa57c('0x24')];}_0x382a26[_0xa57c('0x16')](_0x1e7f7a)[_0xa57c('0x25')](_0x241dcc);};}exports[_0xa57c('0x26')]=function(_0x315ad7,_0x1e8e45){var _0x8ee1c0={},_0xe50fb8={},_0x337f97={'count':0x0,'rows':[]};var _0x1d59c2=db['ServicenowField'][_0xa57c('0x27')];_0xe50fb8['model']=_['keys'](_0x1d59c2);_0xe50fb8[_0xa57c('0x28')]=_[_0xa57c('0x29')](_0x315ad7['query']);_0xe50fb8[_0xa57c('0x2a')]=_[_0xa57c('0x2b')](_0xe50fb8[_0xa57c('0x2c')],_0xe50fb8['query']);_0x8ee1c0[_0xa57c('0x2d')]=_['intersection'](_0xe50fb8[_0xa57c('0x2c')],qs['fields'](_0x315ad7[_0xa57c('0x28')]['fields']));_0x8ee1c0[_0xa57c('0x2d')]=_0x8ee1c0['attributes'][_0xa57c('0x2e')]?_0x8ee1c0[_0xa57c('0x2d')]:_0xe50fb8[_0xa57c('0x2c')];if(!_0x315ad7[_0xa57c('0x28')][_0xa57c('0x2f')](_0xa57c('0x30'))){_0x8ee1c0[_0xa57c('0x31')]=qs['limit'](_0x315ad7[_0xa57c('0x28')]['limit']);_0x8ee1c0[_0xa57c('0x19')]=qs[_0xa57c('0x19')](_0x315ad7[_0xa57c('0x28')]['offset']);}_0x8ee1c0[_0xa57c('0x32')]=qs['sort'](_0x315ad7[_0xa57c('0x28')]['sort']);_0x8ee1c0[_0xa57c('0x33')]=qs['filters'](_[_0xa57c('0x34')](_0x315ad7[_0xa57c('0x28')],_0xe50fb8['filters']));if(_0x315ad7[_0xa57c('0x28')]['filter']){_0x8ee1c0[_0xa57c('0x33')]=_['merge'](_0x8ee1c0[_0xa57c('0x33')],{'$or':_[_0xa57c('0x35')](_0x1d59c2,function(_0x205ee5){if(_0x205ee5[_0xa57c('0x36')][_0xa57c('0x37')]!==_0xa57c('0x38')){var _0x59b8af={};_0x59b8af[_0x205ee5['field']]={'$like':'%'+_0x315ad7[_0xa57c('0x28')][_0xa57c('0x39')]+'%'};return _0x59b8af;}})});}_0x8ee1c0=_[_0xa57c('0x3a')]({},_0x8ee1c0,_0x315ad7['options']);var _0x12b644={'where':_0x8ee1c0['where']};return db[_0xa57c('0x3b')][_0xa57c('0x18')](_0x12b644)['then'](function(_0x558cf7){_0x337f97['count']=_0x558cf7;if(_0x315ad7[_0xa57c('0x28')][_0xa57c('0x3c')]){_0x8ee1c0[_0xa57c('0x3d')]=[{'all':!![]}];}return db[_0xa57c('0x3b')][_0xa57c('0x3e')](_0x8ee1c0);})[_0xa57c('0x1f')](function(_0x5a444a){_0x337f97[_0xa57c('0x3f')]=_0x5a444a;return _0x337f97;})[_0xa57c('0x1f')](respondWithFilteredResult(_0x1e8e45,_0x8ee1c0))['catch'](handleError(_0x1e8e45,null));};exports['show']=function(_0x5e10b,_0x203375){var _0x5af5e9={'raw':!![],'where':{'id':_0x5e10b[_0xa57c('0x40')]['id']}},_0x24459a={};_0x24459a[_0xa57c('0x2c')]=_[_0xa57c('0x29')](db[_0xa57c('0x3b')][_0xa57c('0x27')]);_0x24459a['query']=_[_0xa57c('0x29')](_0x5e10b['query']);_0x24459a['filters']=_['intersection'](_0x24459a['model'],_0x24459a['query']);_0x5af5e9[_0xa57c('0x2d')]=_[_0xa57c('0x2b')](_0x24459a[_0xa57c('0x2c')],qs['fields'](_0x5e10b['query']['fields']));_0x5af5e9[_0xa57c('0x2d')]=_0x5af5e9[_0xa57c('0x2d')][_0xa57c('0x2e')]?_0x5af5e9[_0xa57c('0x2d')]:_0x24459a[_0xa57c('0x2c')];if(_0x5e10b[_0xa57c('0x28')]['includeAll']){_0x5af5e9[_0xa57c('0x3d')]=[{'all':!![]}];}_0x5af5e9=_[_0xa57c('0x3a')]({},_0x5af5e9,_0x5e10b[_0xa57c('0x41')]);return db[_0xa57c('0x3b')][_0xa57c('0x42')](_0x5af5e9)[_0xa57c('0x1f')](handleEntityNotFound(_0x203375,null))['then'](respondWithResult(_0x203375,null))[_0xa57c('0x43')](handleError(_0x203375,null));};exports[_0xa57c('0x44')]=function(_0xa3ff0,_0x14e943){return db[_0xa57c('0x3b')]['create'](_0xa3ff0[_0xa57c('0x45')],{})[_0xa57c('0x1f')](respondWithResult(_0x14e943,0xc9))[_0xa57c('0x43')](handleError(_0x14e943,null));};exports[_0xa57c('0x1e')]=function(_0x7ba8ab,_0x11fccc){if(_0x7ba8ab['body']['id']){delete _0x7ba8ab[_0xa57c('0x45')]['id'];}return db[_0xa57c('0x3b')][_0xa57c('0x42')]({'where':{'id':_0x7ba8ab[_0xa57c('0x40')]['id']}})[_0xa57c('0x1f')](handleEntityNotFound(_0x11fccc,null))[_0xa57c('0x1f')](saveUpdates(_0x7ba8ab['body'],null))['then'](respondWithResult(_0x11fccc,null))['catch'](handleError(_0x11fccc,null));};exports['destroy']=function(_0x232675,_0x49492f){return db[_0xa57c('0x3b')][_0xa57c('0x42')]({'where':{'id':_0x232675['params']['id']}})[_0xa57c('0x1f')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x1f')](removeEntity(_0x49492f,null))[_0xa57c('0x43')](handleError(_0x49492f,null));}; \ No newline at end of file +var _0x2ef3=['count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','name','send','index','ServicenowField','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','map','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','status','end','json'];(function(_0x45408d,_0x38f8b2){var _0x186ae7=function(_0x2c10e8){while(--_0x2c10e8){_0x45408d['push'](_0x45408d['shift']());}};_0x186ae7(++_0x38f8b2);}(_0x2ef3,0xba));var _0x32ef=function(_0x18fe1c,_0xacb736){_0x18fe1c=_0x18fe1c-0x0;var _0x30caf6=_0x2ef3[_0x18fe1c];return _0x30caf6;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');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('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x193714,_0x5afcc2){_0x5afcc2=_0x5afcc2||0xcc;return function(_0x1a5106){if(_0x1a5106){return _0x193714['sendStatus'](_0x5afcc2);}return _0x193714[_0x32ef('0x18')](_0x5afcc2)[_0x32ef('0x19')]();};}function respondWithResult(_0x5c3eb9,_0x539d18){_0x539d18=_0x539d18||0xc8;return function(_0x19ce1){if(_0x19ce1){return _0x5c3eb9['status'](_0x539d18)[_0x32ef('0x1a')](_0x19ce1);}};}function respondWithFilteredResult(_0x40a6e6,_0x93d492){return function(_0x54c7f5){if(_0x54c7f5){var _0x57aff1=_0x54c7f5[_0x32ef('0x1b')],_0x55bf0b=_0x93d492[_0x32ef('0x1c')],_0x531e30=_0x93d492['offset']+_0x93d492['limit'],_0x13db1a;if(_0x531e30>=_0x57aff1){_0x531e30=_0x57aff1;_0x13db1a=0xc8;}else{_0x13db1a=0xce;}_0x40a6e6[_0x32ef('0x18')](_0x13db1a);return _0x40a6e6[_0x32ef('0x1d')](_0x32ef('0x1e'),_0x55bf0b+'-'+_0x531e30+'/'+_0x57aff1)['json'](_0x54c7f5);}return null;};}function patchUpdates(_0xbe37f6){return function(_0x33e230){try{jsonpatch['apply'](_0x33e230,_0xbe37f6,!![]);}catch(_0x304505){return BPromise[_0x32ef('0x1f')](_0x304505);}return _0x33e230[_0x32ef('0x20')]();};}function saveUpdates(_0x251084,_0x445cda){return function(_0x3aec05){if(_0x3aec05){return _0x3aec05['update'](_0x251084)[_0x32ef('0x21')](function(_0x5cc3ef){return _0x5cc3ef;});}return null;};}function removeEntity(_0x309866,_0x3a20ca){return function(_0x49f2d8){if(_0x49f2d8){return _0x49f2d8[_0x32ef('0x22')]()[_0x32ef('0x21')](function(){_0x309866[_0x32ef('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f5e5,_0x22f2d7){return function(_0xb30fab){if(!_0xb30fab){_0x57f5e5[_0x32ef('0x23')](0x194);}return _0xb30fab;};}function handleError(_0x478bef,_0x59585f){_0x59585f=_0x59585f||0x1f4;return function(_0x19ea6){logger['error'](_0x19ea6['stack']);if(_0x19ea6[_0x32ef('0x24')]){delete _0x19ea6[_0x32ef('0x24')];}_0x478bef[_0x32ef('0x18')](_0x59585f)[_0x32ef('0x25')](_0x19ea6);};}exports[_0x32ef('0x26')]=function(_0x234175,_0x1874ea){var _0x38aed5={},_0x338f19={},_0x2f52d7={'count':0x0,'rows':[]};var _0x1335e2=db[_0x32ef('0x27')]['rawAttributes'];_0x338f19[_0x32ef('0x28')]=_[_0x32ef('0x29')](_0x1335e2);_0x338f19['query']=_[_0x32ef('0x29')](_0x234175[_0x32ef('0x2a')]);_0x338f19[_0x32ef('0x2b')]=_[_0x32ef('0x2c')](_0x338f19['model'],_0x338f19[_0x32ef('0x2a')]);_0x38aed5[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0x338f19[_0x32ef('0x28')],qs[_0x32ef('0x2e')](_0x234175[_0x32ef('0x2a')][_0x32ef('0x2e')]));_0x38aed5['attributes']=_0x38aed5[_0x32ef('0x2d')]['length']?_0x38aed5[_0x32ef('0x2d')]:_0x338f19[_0x32ef('0x28')];if(!_0x234175['query'][_0x32ef('0x2f')](_0x32ef('0x30'))){_0x38aed5[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x234175[_0x32ef('0x2a')]['limit']);_0x38aed5['offset']=qs[_0x32ef('0x1c')](_0x234175['query'][_0x32ef('0x1c')]);}_0x38aed5[_0x32ef('0x32')]=qs[_0x32ef('0x33')](_0x234175[_0x32ef('0x2a')][_0x32ef('0x33')]);_0x38aed5[_0x32ef('0x34')]=qs['filters'](_['pick'](_0x234175['query'],_0x338f19[_0x32ef('0x2b')]));if(_0x234175[_0x32ef('0x2a')][_0x32ef('0x35')]){_0x38aed5['where']=_['merge'](_0x38aed5[_0x32ef('0x34')],{'$or':_[_0x32ef('0x36')](_0x1335e2,function(_0x410334){if(_0x410334['type']['key']!==_0x32ef('0x37')){var _0x21706f={};_0x21706f[_0x410334[_0x32ef('0x38')]]={'$like':'%'+_0x234175[_0x32ef('0x2a')][_0x32ef('0x35')]+'%'};return _0x21706f;}})});}_0x38aed5=_[_0x32ef('0x39')]({},_0x38aed5,_0x234175[_0x32ef('0x3a')]);var _0x21da90={'where':_0x38aed5[_0x32ef('0x34')]};return db['ServicenowField'][_0x32ef('0x1b')](_0x21da90)[_0x32ef('0x21')](function(_0x14b54f){_0x2f52d7['count']=_0x14b54f;if(_0x234175[_0x32ef('0x2a')][_0x32ef('0x3b')]){_0x38aed5[_0x32ef('0x3c')]=[{'all':!![]}];}return db[_0x32ef('0x27')][_0x32ef('0x3d')](_0x38aed5);})[_0x32ef('0x21')](function(_0x256c40){_0x2f52d7[_0x32ef('0x3e')]=_0x256c40;return _0x2f52d7;})[_0x32ef('0x21')](respondWithFilteredResult(_0x1874ea,_0x38aed5))[_0x32ef('0x3f')](handleError(_0x1874ea,null));};exports[_0x32ef('0x40')]=function(_0x4615b4,_0x48e071){var _0x3cac2e={'raw':!![],'where':{'id':_0x4615b4[_0x32ef('0x41')]['id']}},_0xc3a6d3={};_0xc3a6d3[_0x32ef('0x28')]=_[_0x32ef('0x29')](db[_0x32ef('0x27')][_0x32ef('0x42')]);_0xc3a6d3['query']=_['keys'](_0x4615b4[_0x32ef('0x2a')]);_0xc3a6d3[_0x32ef('0x2b')]=_[_0x32ef('0x2c')](_0xc3a6d3[_0x32ef('0x28')],_0xc3a6d3['query']);_0x3cac2e[_0x32ef('0x2d')]=_[_0x32ef('0x2c')](_0xc3a6d3['model'],qs[_0x32ef('0x2e')](_0x4615b4['query'][_0x32ef('0x2e')]));_0x3cac2e[_0x32ef('0x2d')]=_0x3cac2e[_0x32ef('0x2d')][_0x32ef('0x43')]?_0x3cac2e[_0x32ef('0x2d')]:_0xc3a6d3[_0x32ef('0x28')];if(_0x4615b4[_0x32ef('0x2a')][_0x32ef('0x3b')]){_0x3cac2e[_0x32ef('0x3c')]=[{'all':!![]}];}_0x3cac2e=_[_0x32ef('0x39')]({},_0x3cac2e,_0x4615b4['options']);return db[_0x32ef('0x27')]['find'](_0x3cac2e)[_0x32ef('0x21')](handleEntityNotFound(_0x48e071,null))[_0x32ef('0x21')](respondWithResult(_0x48e071,null))[_0x32ef('0x3f')](handleError(_0x48e071,null));};exports['create']=function(_0x502113,_0x230ac9){return db[_0x32ef('0x27')][_0x32ef('0x44')](_0x502113[_0x32ef('0x45')],{})[_0x32ef('0x21')](respondWithResult(_0x230ac9,0xc9))[_0x32ef('0x3f')](handleError(_0x230ac9,null));};exports['update']=function(_0x5cb6fc,_0x36252c){if(_0x5cb6fc[_0x32ef('0x45')]['id']){delete _0x5cb6fc[_0x32ef('0x45')]['id'];}return db[_0x32ef('0x27')][_0x32ef('0x46')]({'where':{'id':_0x5cb6fc[_0x32ef('0x41')]['id']}})[_0x32ef('0x21')](handleEntityNotFound(_0x36252c,null))[_0x32ef('0x21')](saveUpdates(_0x5cb6fc[_0x32ef('0x45')],null))[_0x32ef('0x21')](respondWithResult(_0x36252c,null))[_0x32ef('0x3f')](handleError(_0x36252c,null));};exports[_0x32ef('0x22')]=function(_0x36a65c,_0x4c2534){return db[_0x32ef('0x27')][_0x32ef('0x46')]({'where':{'id':_0x36a65c[_0x32ef('0x41')]['id']}})[_0x32ef('0x21')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x21')](removeEntity(_0x4c2534,null))[_0x32ef('0x3f')](handleError(_0x4c2534,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 1b296c6..8fa0d59 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 _0x843a=['ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path','../../config/environment','exports'];(function(_0x469945,_0x376eb5){var _0x8ddc31=function(_0x562255){while(--_0x562255){_0x469945['push'](_0x469945['shift']());}};_0x8ddc31(++_0x376eb5);}(_0x843a,0xa1));var _0xa843=function(_0x13b2ba,_0x4ba397){_0x13b2ba=_0x13b2ba-0x0;var _0x3ec75a=_0x843a[_0x13b2ba];return _0x3ec75a;};'use strict';var _=require(_0xa843('0x0'));var util=require(_0xa843('0x1'));var logger=require(_0xa843('0x2'))(_0xa843('0x3'));var moment=require(_0xa843('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa843('0x5'));var rimraf=require('rimraf');var config=require(_0xa843('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xa843('0x7')]=function(_0x468745,_0x5757c0){return _0x468745['define'](_0xa843('0x8'),attributes,{'tableName':_0xa843('0x9'),'paranoid':![],'indexes':[{'name':_0xa843('0xa'),'fields':[_0xa843('0xb'),_0xa843('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1504=['ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x35cee0,_0x46d552){var _0x77812d=function(_0x581a85){while(--_0x581a85){_0x35cee0['push'](_0x35cee0['shift']());}};_0x77812d(++_0x46d552);}(_0x1504,0x1d6));var _0x4150=function(_0x450875,_0x1ba5aa){_0x450875=_0x450875-0x0;var _0x284b8f=_0x1504[_0x450875];return _0x284b8f;};'use strict';var _=require(_0x4150('0x0'));var util=require(_0x4150('0x1'));var logger=require(_0x4150('0x2'))(_0x4150('0x3'));var moment=require(_0x4150('0x4'));var BPromise=require('bluebird');var rp=require(_0x4150('0x5'));var fs=require('fs');var path=require(_0x4150('0x6'));var rimraf=require(_0x4150('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x4150('0x8')]=function(_0x5782f5,_0x5c8d81){return _0x5782f5[_0x4150('0x9')](_0x4150('0xa'),attributes,{'tableName':_0x4150('0xb'),'paranoid':![],'indexes':[{'name':_0x4150('0xc'),'fields':[_0x4150('0xd'),_0x4150('0xe')],'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 f4507af..837d23e 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 _0xc1c6=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch'];(function(_0x46c011,_0x59cde4){var _0x118ce0=function(_0x1e3c87){while(--_0x1e3c87){_0x46c011['push'](_0x46c011['shift']());}};_0x118ce0(++_0x59cde4);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x5c4209,_0x264723){_0x5c4209=_0x5c4209-0x0;var _0x426ab4=_0xc1c6[_0x5c4209];return _0x426ab4;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});} \ No newline at end of file +var _0x8ace=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x486d60,_0x1f1cb7){var _0x4b81fb=function(_0x4d5680){while(--_0x4d5680){_0x486d60['push'](_0x486d60['shift']());}};_0x4b81fb(++_0x1f1cb7);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x332edd,_0x30528b){_0x332edd=_0x332edd-0x0;var _0x310417=_0x8ace[_0x332edd];return _0x310417;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var moment=require(_0xe8ac('0x2'));var BPromise=require(_0xe8ac('0x3'));var rs=require(_0xe8ac('0x4'));var fs=require('fs');var Redis=require(_0xe8ac('0x5'));var db=require(_0xe8ac('0x6'))['db'];var utils=require(_0xe8ac('0x7'));var logger=require(_0xe8ac('0x8'))(_0xe8ac('0x9'));var config=require(_0xe8ac('0xa'));var jayson=require(_0xe8ac('0xb'));var client=jayson[_0xe8ac('0xc')][_0xe8ac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4eb087,_0x2d56f0,_0x1357ed){return new BPromise(function(_0x4f9233,_0x5c83e1){return client[_0xe8ac('0xe')](_0x4eb087,_0x1357ed)['then'](function(_0x1b5467){logger[_0xe8ac('0xf')](_0xe8ac('0x10'),_0x2d56f0,_0xe8ac('0x11'));logger[_0xe8ac('0x12')](_0xe8ac('0x13'),_0x2d56f0,'request\x20sent',JSON[_0xe8ac('0x14')](_0x1b5467));if(_0x1b5467[_0xe8ac('0x15')]){if(_0x1b5467[_0xe8ac('0x15')]['code']===0x1f4){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467['error'][_0xe8ac('0x16')]);return _0x5c83e1(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);return _0x4f9233(_0x1b5467[_0xe8ac('0x15')][_0xe8ac('0x16')]);}else{logger[_0xe8ac('0xf')]('ServicenowField,\x20%s,\x20%s',_0x2d56f0,_0xe8ac('0x11'));_0x4f9233(_0x1b5467[_0xe8ac('0x17')]['message']);}})[_0xe8ac('0x18')](function(_0x3a7939){logger[_0xe8ac('0x15')](_0xe8ac('0x10'),_0x2d56f0,_0x3a7939);_0x5c83e1(_0x3a7939);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 0f8bf51..7789ffc 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 _0xdd29=['create','addConfiguration','put','update','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','getConfigurations','post'];(function(_0x29bcae,_0x31ecf0){var _0x21fd93=function(_0x2ddae7){while(--_0x2ddae7){_0x29bcae['push'](_0x29bcae['shift']());}};_0x21fd93(++_0x31ecf0);}(_0xdd29,0x193));var _0x9dd2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd29[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x9dd2('0x0'));var util=require(_0x9dd2('0x1'));var path=require('path');var timeout=require(_0x9dd2('0x2'));var express=require(_0x9dd2('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9dd2('0x4'));var config=require(_0x9dd2('0x5'));var controller=require('./intSugarcrmAccount.controller');router[_0x9dd2('0x6')]('/',auth[_0x9dd2('0x7')](),controller['index']);router[_0x9dd2('0x6')]('/:id',auth[_0x9dd2('0x7')](),controller[_0x9dd2('0x8')]);router[_0x9dd2('0x6')]('/:id/configurations',auth[_0x9dd2('0x7')](),controller[_0x9dd2('0x9')]);router[_0x9dd2('0x6')]('/:id/fields',auth[_0x9dd2('0x7')](),controller['getFields']);router[_0x9dd2('0xa')]('/',auth[_0x9dd2('0x7')](),controller[_0x9dd2('0xb')]);router[_0x9dd2('0xa')]('/:id/configurations',auth[_0x9dd2('0x7')](),controller[_0x9dd2('0xc')]);router[_0x9dd2('0xd')]('/:id',auth[_0x9dd2('0x7')](),controller[_0x9dd2('0xe')]);router['delete'](_0x9dd2('0xf'),auth[_0x9dd2('0x7')](),controller[_0x9dd2('0x10')]);module[_0x9dd2('0x11')]=router; \ No newline at end of file +var _0x0c1c=['/:id/configurations','getConfigurations','post','addConfiguration','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x5ae8f7,_0x330d91){var _0x54c636=function(_0x173188){while(--_0x173188){_0x5ae8f7['push'](_0x5ae8f7['shift']());}};_0x54c636(++_0x330d91);}(_0x0c1c,0x183));var _0xc0c1=function(_0x28b7ab,_0x16a764){_0x28b7ab=_0x28b7ab-0x0;var _0x56791b=_0x0c1c[_0x28b7ab];return _0x56791b;};'use strict';var multer=require(_0xc0c1('0x0'));var util=require(_0xc0c1('0x1'));var path=require(_0xc0c1('0x2'));var timeout=require(_0xc0c1('0x3'));var express=require(_0xc0c1('0x4'));var router=express['Router']();var auth=require(_0xc0c1('0x5'));var interaction=require(_0xc0c1('0x6'));var config=require('../../config/environment');var controller=require(_0xc0c1('0x7'));router[_0xc0c1('0x8')]('/',auth[_0xc0c1('0x9')](),controller['index']);router[_0xc0c1('0x8')](_0xc0c1('0xa'),auth[_0xc0c1('0x9')](),controller[_0xc0c1('0xb')]);router['get'](_0xc0c1('0xc'),auth[_0xc0c1('0x9')](),controller[_0xc0c1('0xd')]);router[_0xc0c1('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xc0c1('0xe')]('/',auth[_0xc0c1('0x9')](),controller['create']);router['post']('/:id/configurations',auth[_0xc0c1('0x9')](),controller[_0xc0c1('0xf')]);router['put']('/:id',auth[_0xc0c1('0x9')](),controller[_0xc0c1('0x10')]);router[_0xc0c1('0x11')](_0xc0c1('0xa'),auth[_0xc0c1('0x9')](),controller[_0xc0c1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 2e18ee4..790237e 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 _0xb963=['STRING','username','sequelize'];(function(_0x555366,_0x382738){var _0xa6a41c=function(_0x77645b){while(--_0x77645b){_0x555366['push'](_0x555366['shift']());}};_0xa6a41c(++_0x382738);}(_0xb963,0x146));var _0x3b96=function(_0x56b734,_0xf6388b){_0x56b734=_0x56b734-0x0;var _0x48505b=_0xb963[_0x56b734];return _0x48505b;};'use strict';var Sequelize=require(_0x3b96('0x0'));module['exports']={'name':{'type':Sequelize[_0x3b96('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3b96('0x1')],'unique':_0x3b96('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3b96('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x3b96('0x1')]}}; \ No newline at end of file +var _0x9883=['remoteUri','exports','STRING'];(function(_0x3f2fa5,_0x434388){var _0xe7fb00=function(_0x25c03){while(--_0x25c03){_0x3f2fa5['push'](_0x3f2fa5['shift']());}};_0xe7fb00(++_0x434388);}(_0x9883,0x151));var _0x3988=function(_0x5562fc,_0x70905b){_0x5562fc=_0x5562fc-0x0;var _0x5efd05=_0x9883[_0x5562fc];return _0x5efd05;};'use strict';var Sequelize=require('sequelize');module[_0x3988('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3988('0x1')]},'username':{'type':Sequelize[_0x3988('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x3988('0x1')]},'remoteUri':{'type':Sequelize[_0x3988('0x1')],'unique':_0x3988('0x2')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 16c8421..3e5612b 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 _0xb82a=['getFields','assigned_user_id','created_by','parent_id','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','JSON','Calls','module_fields','label','endsWith','values','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','limit','apply','reject','save','update','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','findAll','params','options','create','body','find','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel'];(function(_0x168483,_0x34df6c){var _0x5b841f=function(_0x407aa3){while(--_0x407aa3){_0x168483['push'](_0x168483['shift']());}};_0x5b841f(++_0x34df6c);}(_0xb82a,0x93));var _0xab82=function(_0x25064f,_0x3d9ec0){_0x25064f=_0x25064f-0x0;var _0x3ad544=_0xb82a[_0x25064f];return _0x3ad544;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xab82('0x0'));var rimraf=require(_0xab82('0x1'));var zipdir=require(_0xab82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab82('0x3'));var moment=require(_0xab82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xab82('0x5'));var util=require(_0xab82('0x6'));var path=require(_0xab82('0x7'));var sox=require('sox');var csv=require(_0xab82('0x8'));var ejs=require(_0xab82('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xab82('0xa'));var deskjs=require(_0xab82('0xb'));var toCsv=require('to-csv');var querystring=require(_0xab82('0xc'));var Papa=require(_0xab82('0xd'));var Redis=require(_0xab82('0xe'));var authService=require(_0xab82('0xf'));var qs=require(_0xab82('0x10'));var hardwareService=require(_0xab82('0x11'));var logger=require(_0xab82('0x12'))(_0xab82('0x13'));var utils=require('../../config/utils');var config=require(_0xab82('0x14'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xab82('0x15'));var client=jayson[_0xab82('0x16')][_0xab82('0x17')]({'port':0x232a});function checkPasswordPattern(_0x378072,_0x1d941e,_0x23ce15){if(_0x23ce15){var _0x454997=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x454997['test'](_0x1d941e)){return _0x378072;}else{throw new Error(_0xab82('0x18'));}}else{return _0x378072;}}function respondWithRpcPromise(_0x41fa2b,_0xdab21,_0x52ca69,_0x29933c){return new BPromise(function(_0x1886d2,_0x92f3c2){var _0x2d738d=_0x29933c||client;return _0x2d738d[_0xab82('0x19')](_0x41fa2b,_0x52ca69)[_0xab82('0x1a')](function(_0x476557){logger['info'](_0xab82('0x1b'),_0xdab21,_0xab82('0x1c'));logger[_0xab82('0x1d')](_0xab82('0x1e'),_0xdab21,'request\x20sent',JSON[_0xab82('0x1f')](_0x476557));if(_0x476557[_0xab82('0x20')]){if(_0x476557['error'][_0xab82('0x21')]===0x1f4){logger[_0xab82('0x20')]('SugarcrmAccount,\x20%s,\x20%s',_0xdab21,_0x476557[_0xab82('0x20')][_0xab82('0x22')]);return _0x92f3c2(_0x476557['error'][_0xab82('0x22')]);}logger[_0xab82('0x20')](_0xab82('0x1b'),_0xdab21,_0x476557[_0xab82('0x20')][_0xab82('0x22')]);return _0x1886d2(_0x476557[_0xab82('0x20')][_0xab82('0x22')]);}else{logger[_0xab82('0x23')](_0xab82('0x1b'),_0xdab21,_0xab82('0x1c'));_0x1886d2(_0x476557[_0xab82('0x24')][_0xab82('0x22')]);}})[_0xab82('0x25')](function(_0x1f062a){logger[_0xab82('0x20')](_0xab82('0x1b'),_0xdab21,_0x1f062a);_0x92f3c2(_0x1f062a);});});}function respondWithStatusCode(_0x34ddb4,_0x3ffc77){_0x3ffc77=_0x3ffc77||0xcc;return function(_0x18c79d){if(_0x18c79d){return _0x34ddb4[_0xab82('0x26')](_0x3ffc77);}return _0x34ddb4['status'](_0x3ffc77)[_0xab82('0x27')]();};}function respondWithResult(_0xd79009,_0x4b8c85){_0x4b8c85=_0x4b8c85||0xc8;return function(_0x5d2a34){if(_0x5d2a34){return _0xd79009[_0xab82('0x28')](_0x4b8c85)[_0xab82('0x29')](_0x5d2a34);}};}function respondWithFilteredResult(_0x131a55,_0x227685){return function(_0x495f86){if(_0x495f86){var _0x485fa8=_0x495f86['count'],_0x43832e=_0x227685[_0xab82('0x2a')],_0x183f51=_0x227685[_0xab82('0x2a')]+_0x227685[_0xab82('0x2b')],_0xe67ab5;if(_0x183f51>=_0x485fa8){_0x183f51=_0x485fa8;_0xe67ab5=0xc8;}else{_0xe67ab5=0xce;}_0x131a55['status'](_0xe67ab5);return _0x131a55['set']('Content-Range',_0x43832e+'-'+_0x183f51+'/'+_0x485fa8)[_0xab82('0x29')](_0x495f86);}return null;};}function patchUpdates(_0xdb00a6){return function(_0x41119b){try{jsonpatch[_0xab82('0x2c')](_0x41119b,_0xdb00a6,!![]);}catch(_0x45f50d){return BPromise[_0xab82('0x2d')](_0x45f50d);}return _0x41119b[_0xab82('0x2e')]();};}function saveUpdates(_0x241ea4,_0x3de7ff){return function(_0xd7bdc2){if(_0xd7bdc2){return _0xd7bdc2[_0xab82('0x2f')](_0x241ea4)[_0xab82('0x1a')](function(_0xa1e18b){return _0xa1e18b;});}return null;};}function removeEntity(_0xac16c2,_0x4b6962){return function(_0x53630f){if(_0x53630f){return _0x53630f[_0xab82('0x30')]()[_0xab82('0x1a')](function(){_0xac16c2[_0xab82('0x28')](0xcc)[_0xab82('0x27')]();});}};}function handleEntityNotFound(_0xa1c786,_0x1272a5){return function(_0x5f032e){if(!_0x5f032e){_0xa1c786[_0xab82('0x26')](0x194);}return _0x5f032e;};}function handleError(_0x56350b,_0x4824c3){_0x4824c3=_0x4824c3||0x1f4;return function(_0x3e0222){logger[_0xab82('0x20')](_0x3e0222[_0xab82('0x31')]);if(_0x3e0222['name']){delete _0x3e0222[_0xab82('0x32')];}_0x56350b[_0xab82('0x28')](_0x4824c3)[_0xab82('0x33')](_0x3e0222);};}exports[_0xab82('0x34')]=function(_0x5e30fc,_0x50b827){var _0x4045b9={},_0x54d38b={},_0x243a02={'count':0x0,'rows':[]};var _0x170ba5=db[_0xab82('0x35')][_0xab82('0x36')];_0x54d38b[_0xab82('0x37')]=_[_0xab82('0x38')](_0x170ba5);_0x54d38b[_0xab82('0x39')]=_[_0xab82('0x38')](_0x5e30fc[_0xab82('0x39')]);_0x54d38b['filters']=_['intersection'](_0x54d38b['model'],_0x54d38b[_0xab82('0x39')]);_0x4045b9[_0xab82('0x3a')]=_[_0xab82('0x3b')](_0x54d38b[_0xab82('0x37')],qs[_0xab82('0x3c')](_0x5e30fc[_0xab82('0x39')][_0xab82('0x3c')]));_0x4045b9[_0xab82('0x3a')]=_0x4045b9[_0xab82('0x3a')][_0xab82('0x3d')]?_0x4045b9[_0xab82('0x3a')]:_0x54d38b[_0xab82('0x37')];if(!_0x5e30fc[_0xab82('0x39')][_0xab82('0x3e')](_0xab82('0x3f'))){_0x4045b9[_0xab82('0x2b')]=qs['limit'](_0x5e30fc['query'][_0xab82('0x2b')]);_0x4045b9['offset']=qs[_0xab82('0x2a')](_0x5e30fc[_0xab82('0x39')][_0xab82('0x2a')]);}_0x4045b9[_0xab82('0x40')]=qs[_0xab82('0x41')](_0x5e30fc['query'][_0xab82('0x41')]);_0x4045b9[_0xab82('0x42')]=qs['filters'](_[_0xab82('0x43')](_0x5e30fc['query'],_0x54d38b[_0xab82('0x44')]));if(_0x5e30fc[_0xab82('0x39')][_0xab82('0x45')]){_0x4045b9[_0xab82('0x42')]=_[_0xab82('0x46')](_0x4045b9[_0xab82('0x42')],{'$or':_[_0xab82('0x47')](_0x170ba5,function(_0x43a29f){if(_0x43a29f[_0xab82('0x48')][_0xab82('0x49')]!==_0xab82('0x4a')){var _0x17bf72={};_0x17bf72[_0x43a29f[_0xab82('0x4b')]]={'$like':'%'+_0x5e30fc[_0xab82('0x39')][_0xab82('0x45')]+'%'};return _0x17bf72;}})});}_0x4045b9=_[_0xab82('0x46')]({},_0x4045b9,_0x5e30fc['options']);var _0x1d6471={'where':_0x4045b9[_0xab82('0x42')]};return db[_0xab82('0x35')][_0xab82('0x4c')](_0x1d6471)[_0xab82('0x1a')](function(_0x21e238){_0x243a02[_0xab82('0x4c')]=_0x21e238;if(_0x5e30fc[_0xab82('0x39')][_0xab82('0x4d')]){_0x4045b9['include']=[{'all':!![]}];}return db[_0xab82('0x35')][_0xab82('0x4e')](_0x4045b9);})['then'](function(_0x262480){_0x243a02['rows']=_0x262480;return _0x243a02;})['then'](respondWithFilteredResult(_0x50b827,_0x4045b9))[_0xab82('0x25')](handleError(_0x50b827,null));};exports['show']=function(_0x5881ee,_0x10048e){var _0x304678={'raw':![],'where':{'id':_0x5881ee[_0xab82('0x4f')]['id']}},_0x5d606b={};_0x5d606b['model']=_[_0xab82('0x38')](db[_0xab82('0x35')][_0xab82('0x36')]);_0x5d606b[_0xab82('0x39')]=_[_0xab82('0x38')](_0x5881ee[_0xab82('0x39')]);_0x5d606b[_0xab82('0x44')]=_['intersection'](_0x5d606b[_0xab82('0x37')],_0x5d606b[_0xab82('0x39')]);_0x304678[_0xab82('0x3a')]=_[_0xab82('0x3b')](_0x5d606b['model'],qs['fields'](_0x5881ee[_0xab82('0x39')]['fields']));_0x304678[_0xab82('0x3a')]=_0x304678['attributes'][_0xab82('0x3d')]?_0x304678[_0xab82('0x3a')]:_0x5d606b['model'];if(_0x5881ee[_0xab82('0x39')]['includeAll']){_0x304678['include']=[{'all':!![]}];}_0x304678=_[_0xab82('0x46')]({},_0x304678,_0x5881ee[_0xab82('0x50')]);return db[_0xab82('0x35')]['find'](_0x304678)[_0xab82('0x1a')](handleEntityNotFound(_0x10048e,null))[_0xab82('0x1a')](respondWithResult(_0x10048e,null))[_0xab82('0x25')](handleError(_0x10048e,null));};exports[_0xab82('0x51')]=function(_0x22c7d2,_0x43286b){return db[_0xab82('0x35')]['create'](_0x22c7d2['body'],{})[_0xab82('0x1a')](respondWithResult(_0x43286b,0xc9))[_0xab82('0x25')](handleError(_0x43286b,null));};exports[_0xab82('0x2f')]=function(_0x461985,_0x25b22e){if(_0x461985[_0xab82('0x52')]['id']){delete _0x461985[_0xab82('0x52')]['id'];}return db[_0xab82('0x35')][_0xab82('0x53')]({'where':{'id':_0x461985[_0xab82('0x4f')]['id']}})['then'](handleEntityNotFound(_0x25b22e,null))['then'](saveUpdates(_0x461985[_0xab82('0x52')],null))[_0xab82('0x1a')](respondWithResult(_0x25b22e,null))['catch'](handleError(_0x25b22e,null));};exports[_0xab82('0x30')]=function(_0x257ec1,_0xacb4e8){return db[_0xab82('0x35')][_0xab82('0x53')]({'where':{'id':_0x257ec1['params']['id']}})[_0xab82('0x1a')](handleEntityNotFound(_0xacb4e8,null))['then'](removeEntity(_0xacb4e8,null))[_0xab82('0x25')](handleError(_0xacb4e8,null));};exports['getConfigurations']=function(_0x6cc69f,_0x24a388,_0x1377a3){var _0x2fe3eb={};var _0x364988={};var _0x3d9b8c;var _0x432e88;return db[_0xab82('0x35')][_0xab82('0x54')]({'where':{'id':_0x6cc69f['params']['id']}})[_0xab82('0x1a')](handleEntityNotFound(_0x24a388,null))[_0xab82('0x1a')](function(_0x744e40){if(_0x744e40){_0x3d9b8c=_0x744e40;_0x364988[_0xab82('0x37')]=_[_0xab82('0x38')](db[_0xab82('0x55')][_0xab82('0x36')]);_0x364988[_0xab82('0x39')]=_[_0xab82('0x38')](_0x6cc69f[_0xab82('0x39')]);_0x364988['filters']=_['intersection'](_0x364988[_0xab82('0x37')],_0x364988['query']);_0x2fe3eb['attributes']=_[_0xab82('0x3b')](_0x364988[_0xab82('0x37')],qs[_0xab82('0x3c')](_0x6cc69f[_0xab82('0x39')][_0xab82('0x3c')]));_0x2fe3eb[_0xab82('0x3a')]=_0x2fe3eb[_0xab82('0x3a')][_0xab82('0x3d')]?_0x2fe3eb[_0xab82('0x3a')]:_0x364988[_0xab82('0x37')];_0x2fe3eb['order']=qs[_0xab82('0x41')](_0x6cc69f[_0xab82('0x39')][_0xab82('0x41')]);_0x2fe3eb[_0xab82('0x42')]=qs[_0xab82('0x44')](_[_0xab82('0x43')](_0x6cc69f[_0xab82('0x39')],_0x364988[_0xab82('0x44')]));if(_0x6cc69f['query'][_0xab82('0x45')]){_0x2fe3eb['where']=_[_0xab82('0x46')](_0x2fe3eb['where'],{'$or':_[_0xab82('0x47')](_0x2fe3eb[_0xab82('0x3a')],function(_0x356af5){var _0x39c0af={};_0x39c0af[_0x356af5]={'$like':'%'+_0x6cc69f[_0xab82('0x39')][_0xab82('0x45')]+'%'};return _0x39c0af;})});}_0x2fe3eb=_[_0xab82('0x46')]({},_0x2fe3eb,_0x6cc69f[_0xab82('0x50')]);return _0x3d9b8c[_0xab82('0x56')](_0x2fe3eb);}})['then'](function(_0x2c8000){if(_0x2c8000){_0x432e88=_0x2c8000[_0xab82('0x3d')];if(!_0x6cc69f['query'][_0xab82('0x3e')](_0xab82('0x3f'))){_0x2fe3eb[_0xab82('0x2b')]=qs['limit'](_0x6cc69f[_0xab82('0x39')]['limit']);_0x2fe3eb[_0xab82('0x2a')]=qs[_0xab82('0x2a')](_0x6cc69f[_0xab82('0x39')][_0xab82('0x2a')]);}return _0x3d9b8c[_0xab82('0x56')](_0x2fe3eb);}})['then'](function(_0x39408b){if(_0x39408b){return _0x39408b?{'count':_0x432e88,'rows':_0x39408b}:null;}})['then'](respondWithResult(_0x24a388,null))['catch'](handleError(_0x24a388,null));};exports[_0xab82('0x57')]=function(_0x53c60e,_0x13b264,_0x272b8b){if(_0x53c60e[_0xab82('0x52')]['id']){delete _0x53c60e[_0xab82('0x52')]['id'];}return db[_0xab82('0x35')][_0xab82('0x54')]({'where':{'id':_0x53c60e[_0xab82('0x4f')]['id']}})[_0xab82('0x1a')](handleEntityNotFound(_0x13b264,null))[_0xab82('0x1a')](function(_0x29c536){if(_0x29c536){_0x53c60e[_0xab82('0x52')]['AccountId']=_0x29c536['id'];_0x53c60e[_0xab82('0x52')][_0xab82('0x58')]=integrations[_0xab82('0x59')](_0x53c60e[_0xab82('0x52')]['channel'],_0x53c60e['body']['type']);_0x53c60e[_0xab82('0x52')][_0xab82('0x5a')]=integrations[_0xab82('0x5b')](_0x53c60e['body'][_0xab82('0x5c')],_0x53c60e[_0xab82('0x52')]['type']);return db['SugarcrmConfiguration'][_0xab82('0x51')](_0x53c60e['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xab82('0x58')},{'model':db['SugarcrmField'],'as':_0xab82('0x5a')}]});}return null;})[_0xab82('0x1a')](respondWithResult(_0x13b264,null))['catch'](handleError(_0x13b264,null));};exports[_0xab82('0x5d')]=function(_0xef351f,_0x3e46e0,_0xa989bb){var _0x5d65bb='';var _0x31d120=['id',_0xab82('0x32'),_0xab82('0x5e'),_0xab82('0x5f'),'description','date_start','duration_hours','duration_minutes',_0xab82('0x60'),'parent_type','parent_name','direction'];return db[_0xab82('0x35')][_0xab82('0x54')]({'where':{'id':_0xef351f[_0xab82('0x4f')]['id']},'attributes':['id',_0xab82('0x61'),_0xab82('0x62'),_0xab82('0x63')]})[_0xab82('0x1a')](handleEntityNotFound(_0x3e46e0,null))[_0xab82('0x1a')](function(_0x1c0207){if(_0x1c0207){_0x5d65bb=_0x1c0207[_0xab82('0x63')];var _0x512a89=_0x5d65bb[_0xab82('0x64')](-0x1);if(_0x512a89==='/'){_0x5d65bb=_0x5d65bb[_0xab82('0x65')](0x0,_0x5d65bb[_0xab82('0x66')](_0x512a89));}return rp({'method':_0xab82('0x67'),'uri':util[_0xab82('0x68')](_0xab82('0x69'),_0x5d65bb,_0xab82('0x6a')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xab82('0x1f')]({'user_auth':{'user_name':_0x1c0207[_0xab82('0x61')],'password':_0x1c0207['password'],'encryption':'PLAIN'},'application':_0xab82('0x6b')})}});}})[_0xab82('0x1a')](function(_0x9187b6){if(_0x9187b6&&_0x9187b6[_0xab82('0x32')]!==_0xab82('0x6c')&&_0x9187b6[_0xab82('0x32')]!==_0xab82('0x6d')){return rp({'method':_0xab82('0x67'),'uri':util[_0xab82('0x68')](_0xab82('0x69'),_0x5d65bb,_0xab82('0x6a')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xab82('0x6e'),'response_type':_0xab82('0x6e'),'rest_data':JSON[_0xab82('0x1f')]({'session':_0x9187b6['id'],'module_name':_0xab82('0x6f')})}})['then'](function(_0x3fce88){if(_0x3fce88){var _0x15fd60=_['values'](_0x3fce88[_0xab82('0x70')]);_['remove'](_0x15fd60,function(_0x4d279f){return _0x31d120['includes'](_0x4d279f[_0xab82('0x32')]);});return{'count':_0x15fd60['length'],'rows':_[_0xab82('0x47')](_0x15fd60,function(_0xe57e40){return{'id':_0xe57e40[_0xab82('0x32')],'name':_0xe57e40[_0xab82('0x71')],'custom':_[_0xab82('0x72')](_0xe57e40[_0xab82('0x32')],'_c')?!![]:![],'options':_0xe57e40[_0xab82('0x50')]?_[_0xab82('0x47')](_[_0xab82('0x73')](_0xe57e40[_0xab82('0x50')]),function(_0x32d564){return{'name':_0x32d564[_0xab82('0x74')],'value':_0x32d564[_0xab82('0x32')]};}):[]};})};}})[_0xab82('0x1a')](respondWithResult(_0x3e46e0,null))[_0xab82('0x25')](function(_0x37f9d8){var _0x4dcb4a=_0xef351f[_0xab82('0x39')]['test']?0x1f4:_0x37f9d8[_0xab82('0x75')]||0x1f4;logger[_0xab82('0x20')](_0xab82('0x76'),'getFields',_0x4dcb4a,JSON[_0xab82('0x1f')](_0x37f9d8));delete _0x37f9d8[_0xab82('0x32')];if(_0x4dcb4a===0x191){_0x4dcb4a=0x190;}_0x3e46e0['status'](_0x4dcb4a)[_0xab82('0x33')](_0xef351f['query']['test']?{'message':_0xab82('0x77'),'statusCode':_0x37f9d8[_0xab82('0x75')]}:_0x37f9d8);});}else{var _0x5e1822=0x1f4;_0x3e46e0[_0xab82('0x28')](_0x5e1822)[_0xab82('0x33')]({'message':_0xab82('0x77'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x3c7b=['map','type','key','VIRTUAL','options','include','SugarcrmAccount','rows','params','rawAttributes','find','create','body','getConfigurations','SugarcrmConfiguration','order','nolimit','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','direction','remoteUri','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','username','PLAIN','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','includes','value','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','request','then','info','SugarcrmAccount,\x20%s,\x20%s','SugarcrmAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','update','destroy','stack','name','index','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','filter','where','merge'];(function(_0x4320ce,_0x49f5f5){var _0x537dae=function(_0x5991ef){while(--_0x5991ef){_0x4320ce['push'](_0x4320ce['shift']());}};_0x537dae(++_0x49f5f5);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x361be3,_0x53e660){_0x361be3=_0x361be3-0x0;var _0x256904=_0x3c7b[_0x361be3];return _0x256904;};'use strict';var pdf=require(_0xb3c7('0x0'));var emlformat=require(_0xb3c7('0x1'));var rimraf=require(_0xb3c7('0x2'));var zipdir=require(_0xb3c7('0x3'));var jsonpatch=require(_0xb3c7('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb3c7('0x5'));var path=require(_0xb3c7('0x6'));var sox=require('sox');var csv=require(_0xb3c7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb3c7('0x8'));var squel=require(_0xb3c7('0x9'));var crypto=require(_0xb3c7('0xa'));var jsforce=require(_0xb3c7('0xb'));var deskjs=require(_0xb3c7('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb3c7('0xd'));var Papa=require('papaparse');var Redis=require(_0xb3c7('0xe'));var authService=require(_0xb3c7('0xf'));var qs=require(_0xb3c7('0x10'));var hardwareService=require(_0xb3c7('0x11'));var logger=require('../../config/logger')(_0xb3c7('0x12'));var utils=require(_0xb3c7('0x13'));var config=require('../../config/environment');var db=require(_0xb3c7('0x14'))['db'];var integrations=require(_0xb3c7('0x15'));var jayson=require(_0xb3c7('0x16'));var client=jayson[_0xb3c7('0x17')][_0xb3c7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x10def5,_0xc30bf9,_0x48317f){if(_0x48317f){var _0x382743=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x382743[_0xb3c7('0x19')](_0xc30bf9)){return _0x10def5;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x10def5;}}function respondWithRpcPromise(_0x1d9860,_0x1beab1,_0x746d75,_0x2a24c7){return new BPromise(function(_0x370eae,_0x26e5c9){var _0x9a2b03=_0x2a24c7||client;return _0x9a2b03[_0xb3c7('0x1a')](_0x1d9860,_0x746d75)[_0xb3c7('0x1b')](function(_0x10f8d4){logger[_0xb3c7('0x1c')](_0xb3c7('0x1d'),_0x1beab1,'request\x20sent');logger['debug'](_0xb3c7('0x1e'),_0x1beab1,_0xb3c7('0x1f'),JSON[_0xb3c7('0x20')](_0x10f8d4));if(_0x10f8d4[_0xb3c7('0x21')]){if(_0x10f8d4[_0xb3c7('0x21')]['code']===0x1f4){logger[_0xb3c7('0x21')](_0xb3c7('0x1d'),_0x1beab1,_0x10f8d4[_0xb3c7('0x21')][_0xb3c7('0x22')]);return _0x26e5c9(_0x10f8d4['error']['message']);}logger[_0xb3c7('0x21')](_0xb3c7('0x1d'),_0x1beab1,_0x10f8d4['error'][_0xb3c7('0x22')]);return _0x370eae(_0x10f8d4[_0xb3c7('0x21')][_0xb3c7('0x22')]);}else{logger[_0xb3c7('0x1c')]('SugarcrmAccount,\x20%s,\x20%s',_0x1beab1,'request\x20sent');_0x370eae(_0x10f8d4[_0xb3c7('0x23')][_0xb3c7('0x22')]);}})[_0xb3c7('0x24')](function(_0x1348a6){logger[_0xb3c7('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x1beab1,_0x1348a6);_0x26e5c9(_0x1348a6);});});}function respondWithStatusCode(_0x3a46bd,_0x13d5ad){_0x13d5ad=_0x13d5ad||0xcc;return function(_0x21a2de){if(_0x21a2de){return _0x3a46bd[_0xb3c7('0x25')](_0x13d5ad);}return _0x3a46bd['status'](_0x13d5ad)[_0xb3c7('0x26')]();};}function respondWithResult(_0x1bde63,_0x191cc6){_0x191cc6=_0x191cc6||0xc8;return function(_0x593cf6){if(_0x593cf6){return _0x1bde63[_0xb3c7('0x27')](_0x191cc6)[_0xb3c7('0x28')](_0x593cf6);}};}function respondWithFilteredResult(_0xedb5e,_0x6fa822){return function(_0x29c707){if(_0x29c707){var _0x51e0a5=_0x29c707[_0xb3c7('0x29')],_0x42a817=_0x6fa822[_0xb3c7('0x2a')],_0x394568=_0x6fa822[_0xb3c7('0x2a')]+_0x6fa822[_0xb3c7('0x2b')],_0x1f51c4;if(_0x394568>=_0x51e0a5){_0x394568=_0x51e0a5;_0x1f51c4=0xc8;}else{_0x1f51c4=0xce;}_0xedb5e[_0xb3c7('0x27')](_0x1f51c4);return _0xedb5e[_0xb3c7('0x2c')]('Content-Range',_0x42a817+'-'+_0x394568+'/'+_0x51e0a5)[_0xb3c7('0x28')](_0x29c707);}return null;};}function patchUpdates(_0x685eb5){return function(_0x44ef69){try{jsonpatch['apply'](_0x44ef69,_0x685eb5,!![]);}catch(_0x2c67a9){return BPromise['reject'](_0x2c67a9);}return _0x44ef69['save']();};}function saveUpdates(_0x4a80c4,_0x18c2cd){return function(_0x35e80e){if(_0x35e80e){return _0x35e80e[_0xb3c7('0x2d')](_0x4a80c4)[_0xb3c7('0x1b')](function(_0x52e418){return _0x52e418;});}return null;};}function removeEntity(_0x511ff9,_0x3f82c6){return function(_0x1aba77){if(_0x1aba77){return _0x1aba77[_0xb3c7('0x2e')]()['then'](function(){_0x511ff9['status'](0xcc)[_0xb3c7('0x26')]();});}};}function handleEntityNotFound(_0x4ce7f9,_0x46d221){return function(_0x15680a){if(!_0x15680a){_0x4ce7f9[_0xb3c7('0x25')](0x194);}return _0x15680a;};}function handleError(_0x1267e0,_0x40efdc){_0x40efdc=_0x40efdc||0x1f4;return function(_0x4d7b3e){logger[_0xb3c7('0x21')](_0x4d7b3e[_0xb3c7('0x2f')]);if(_0x4d7b3e[_0xb3c7('0x30')]){delete _0x4d7b3e[_0xb3c7('0x30')];}_0x1267e0[_0xb3c7('0x27')](_0x40efdc)['send'](_0x4d7b3e);};}exports[_0xb3c7('0x31')]=function(_0x1044b2,_0x346dcc){var _0x4668bd={},_0x2935aa={},_0x3ed478={'count':0x0,'rows':[]};var _0x371feb=db['SugarcrmAccount']['rawAttributes'];_0x2935aa[_0xb3c7('0x32')]=_[_0xb3c7('0x33')](_0x371feb);_0x2935aa[_0xb3c7('0x34')]=_[_0xb3c7('0x33')](_0x1044b2[_0xb3c7('0x34')]);_0x2935aa[_0xb3c7('0x35')]=_['intersection'](_0x2935aa[_0xb3c7('0x32')],_0x2935aa[_0xb3c7('0x34')]);_0x4668bd[_0xb3c7('0x36')]=_[_0xb3c7('0x37')](_0x2935aa[_0xb3c7('0x32')],qs[_0xb3c7('0x38')](_0x1044b2[_0xb3c7('0x34')]['fields']));_0x4668bd[_0xb3c7('0x36')]=_0x4668bd['attributes'][_0xb3c7('0x39')]?_0x4668bd[_0xb3c7('0x36')]:_0x2935aa[_0xb3c7('0x32')];if(!_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x3a')]('nolimit')){_0x4668bd[_0xb3c7('0x2b')]=qs[_0xb3c7('0x2b')](_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x2b')]);_0x4668bd[_0xb3c7('0x2a')]=qs[_0xb3c7('0x2a')](_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x2a')]);}_0x4668bd['order']=qs['sort'](_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x3b')]);_0x4668bd['where']=qs[_0xb3c7('0x35')](_['pick'](_0x1044b2[_0xb3c7('0x34')],_0x2935aa[_0xb3c7('0x35')]));if(_0x1044b2['query'][_0xb3c7('0x3c')]){_0x4668bd[_0xb3c7('0x3d')]=_[_0xb3c7('0x3e')](_0x4668bd['where'],{'$or':_[_0xb3c7('0x3f')](_0x371feb,function(_0x2406ba){if(_0x2406ba[_0xb3c7('0x40')][_0xb3c7('0x41')]!==_0xb3c7('0x42')){var _0x3d97a4={};_0x3d97a4[_0x2406ba['field']]={'$like':'%'+_0x1044b2[_0xb3c7('0x34')][_0xb3c7('0x3c')]+'%'};return _0x3d97a4;}})});}_0x4668bd=_['merge']({},_0x4668bd,_0x1044b2[_0xb3c7('0x43')]);var _0x1a6025={'where':_0x4668bd[_0xb3c7('0x3d')]};return db['SugarcrmAccount'][_0xb3c7('0x29')](_0x1a6025)[_0xb3c7('0x1b')](function(_0x464bd1){_0x3ed478[_0xb3c7('0x29')]=_0x464bd1;if(_0x1044b2[_0xb3c7('0x34')]['includeAll']){_0x4668bd[_0xb3c7('0x44')]=[{'all':!![]}];}return db[_0xb3c7('0x45')]['findAll'](_0x4668bd);})['then'](function(_0x4c0f6c){_0x3ed478[_0xb3c7('0x46')]=_0x4c0f6c;return _0x3ed478;})['then'](respondWithFilteredResult(_0x346dcc,_0x4668bd))[_0xb3c7('0x24')](handleError(_0x346dcc,null));};exports['show']=function(_0x5d4da0,_0x1c7c54){var _0x2c6f2b={'raw':![],'where':{'id':_0x5d4da0[_0xb3c7('0x47')]['id']}},_0x1b4d20={};_0x1b4d20[_0xb3c7('0x32')]=_['keys'](db['SugarcrmAccount'][_0xb3c7('0x48')]);_0x1b4d20[_0xb3c7('0x34')]=_[_0xb3c7('0x33')](_0x5d4da0[_0xb3c7('0x34')]);_0x1b4d20[_0xb3c7('0x35')]=_[_0xb3c7('0x37')](_0x1b4d20[_0xb3c7('0x32')],_0x1b4d20['query']);_0x2c6f2b['attributes']=_[_0xb3c7('0x37')](_0x1b4d20['model'],qs[_0xb3c7('0x38')](_0x5d4da0['query']['fields']));_0x2c6f2b[_0xb3c7('0x36')]=_0x2c6f2b[_0xb3c7('0x36')][_0xb3c7('0x39')]?_0x2c6f2b['attributes']:_0x1b4d20['model'];if(_0x5d4da0[_0xb3c7('0x34')]['includeAll']){_0x2c6f2b['include']=[{'all':!![]}];}_0x2c6f2b=_[_0xb3c7('0x3e')]({},_0x2c6f2b,_0x5d4da0[_0xb3c7('0x43')]);return db[_0xb3c7('0x45')][_0xb3c7('0x49')](_0x2c6f2b)[_0xb3c7('0x1b')](handleEntityNotFound(_0x1c7c54,null))[_0xb3c7('0x1b')](respondWithResult(_0x1c7c54,null))[_0xb3c7('0x24')](handleError(_0x1c7c54,null));};exports[_0xb3c7('0x4a')]=function(_0x3ef029,_0x4e9722){return db[_0xb3c7('0x45')][_0xb3c7('0x4a')](_0x3ef029[_0xb3c7('0x4b')],{})[_0xb3c7('0x1b')](respondWithResult(_0x4e9722,0xc9))[_0xb3c7('0x24')](handleError(_0x4e9722,null));};exports[_0xb3c7('0x2d')]=function(_0x5e00de,_0x9f27cf){if(_0x5e00de[_0xb3c7('0x4b')]['id']){delete _0x5e00de['body']['id'];}return db['SugarcrmAccount']['find']({'where':{'id':_0x5e00de[_0xb3c7('0x47')]['id']}})[_0xb3c7('0x1b')](handleEntityNotFound(_0x9f27cf,null))[_0xb3c7('0x1b')](saveUpdates(_0x5e00de[_0xb3c7('0x4b')],null))[_0xb3c7('0x1b')](respondWithResult(_0x9f27cf,null))[_0xb3c7('0x24')](handleError(_0x9f27cf,null));};exports[_0xb3c7('0x2e')]=function(_0x390bb9,_0x251af2){return db[_0xb3c7('0x45')][_0xb3c7('0x49')]({'where':{'id':_0x390bb9[_0xb3c7('0x47')]['id']}})[_0xb3c7('0x1b')](handleEntityNotFound(_0x251af2,null))[_0xb3c7('0x1b')](removeEntity(_0x251af2,null))['catch'](handleError(_0x251af2,null));};exports[_0xb3c7('0x4c')]=function(_0x8244df,_0x3402ef,_0x4f4efd){var _0x9c4423={};var _0x1c3001={};var _0x122b84;var _0x2fc8ed;return db[_0xb3c7('0x45')]['findOne']({'where':{'id':_0x8244df[_0xb3c7('0x47')]['id']}})[_0xb3c7('0x1b')](handleEntityNotFound(_0x3402ef,null))[_0xb3c7('0x1b')](function(_0x3a49c6){if(_0x3a49c6){_0x122b84=_0x3a49c6;_0x1c3001[_0xb3c7('0x32')]=_['keys'](db[_0xb3c7('0x4d')][_0xb3c7('0x48')]);_0x1c3001[_0xb3c7('0x34')]=_['keys'](_0x8244df[_0xb3c7('0x34')]);_0x1c3001[_0xb3c7('0x35')]=_[_0xb3c7('0x37')](_0x1c3001[_0xb3c7('0x32')],_0x1c3001[_0xb3c7('0x34')]);_0x9c4423['attributes']=_[_0xb3c7('0x37')](_0x1c3001[_0xb3c7('0x32')],qs[_0xb3c7('0x38')](_0x8244df['query'][_0xb3c7('0x38')]));_0x9c4423[_0xb3c7('0x36')]=_0x9c4423['attributes']['length']?_0x9c4423[_0xb3c7('0x36')]:_0x1c3001[_0xb3c7('0x32')];_0x9c4423[_0xb3c7('0x4e')]=qs[_0xb3c7('0x3b')](_0x8244df[_0xb3c7('0x34')]['sort']);_0x9c4423[_0xb3c7('0x3d')]=qs['filters'](_['pick'](_0x8244df[_0xb3c7('0x34')],_0x1c3001[_0xb3c7('0x35')]));if(_0x8244df['query'][_0xb3c7('0x3c')]){_0x9c4423[_0xb3c7('0x3d')]=_['merge'](_0x9c4423[_0xb3c7('0x3d')],{'$or':_[_0xb3c7('0x3f')](_0x9c4423[_0xb3c7('0x36')],function(_0x166b99){var _0x180564={};_0x180564[_0x166b99]={'$like':'%'+_0x8244df['query'][_0xb3c7('0x3c')]+'%'};return _0x180564;})});}_0x9c4423=_[_0xb3c7('0x3e')]({},_0x9c4423,_0x8244df['options']);return _0x122b84[_0xb3c7('0x4c')](_0x9c4423);}})[_0xb3c7('0x1b')](function(_0x42c10e){if(_0x42c10e){_0x2fc8ed=_0x42c10e[_0xb3c7('0x39')];if(!_0x8244df[_0xb3c7('0x34')]['hasOwnProperty'](_0xb3c7('0x4f'))){_0x9c4423[_0xb3c7('0x2b')]=qs['limit'](_0x8244df[_0xb3c7('0x34')][_0xb3c7('0x2b')]);_0x9c4423[_0xb3c7('0x2a')]=qs[_0xb3c7('0x2a')](_0x8244df[_0xb3c7('0x34')][_0xb3c7('0x2a')]);}return _0x122b84['getConfigurations'](_0x9c4423);}})[_0xb3c7('0x1b')](function(_0x172b8f){if(_0x172b8f){return _0x172b8f?{'count':_0x2fc8ed,'rows':_0x172b8f}:null;}})[_0xb3c7('0x1b')](respondWithResult(_0x3402ef,null))[_0xb3c7('0x24')](handleError(_0x3402ef,null));};exports['addConfiguration']=function(_0x47c59c,_0x416c67,_0x1f9568){if(_0x47c59c['body']['id']){delete _0x47c59c[_0xb3c7('0x4b')]['id'];}return db['SugarcrmAccount'][_0xb3c7('0x50')]({'where':{'id':_0x47c59c[_0xb3c7('0x47')]['id']}})['then'](handleEntityNotFound(_0x416c67,null))[_0xb3c7('0x1b')](function(_0x414a03){if(_0x414a03){_0x47c59c[_0xb3c7('0x4b')][_0xb3c7('0x51')]=_0x414a03['id'];_0x47c59c[_0xb3c7('0x4b')]['Subjects']=integrations[_0xb3c7('0x52')](_0x47c59c['body']['channel'],_0x47c59c['body'][_0xb3c7('0x40')]);_0x47c59c['body'][_0xb3c7('0x53')]=integrations[_0xb3c7('0x54')](_0x47c59c['body'][_0xb3c7('0x55')],_0x47c59c[_0xb3c7('0x4b')][_0xb3c7('0x40')]);return db[_0xb3c7('0x4d')][_0xb3c7('0x4a')](_0x47c59c[_0xb3c7('0x4b')],{'include':[{'model':db[_0xb3c7('0x56')],'as':'Subjects'},{'model':db[_0xb3c7('0x56')],'as':_0xb3c7('0x53')}]});}return null;})['then'](respondWithResult(_0x416c67,null))[_0xb3c7('0x24')](handleError(_0x416c67,null));};exports[_0xb3c7('0x57')]=function(_0xbf2d7a,_0x632b20,_0x4df5a1){var _0x19655e='';var _0x2116c5=['id',_0xb3c7('0x30'),_0xb3c7('0x58'),_0xb3c7('0x59'),'description',_0xb3c7('0x5a'),_0xb3c7('0x5b'),_0xb3c7('0x5c'),_0xb3c7('0x5d'),'parent_type','parent_name',_0xb3c7('0x5e')];return db[_0xb3c7('0x45')][_0xb3c7('0x50')]({'where':{'id':_0xbf2d7a['params']['id']},'attributes':['id','username','password',_0xb3c7('0x5f')]})[_0xb3c7('0x1b')](handleEntityNotFound(_0x632b20,null))[_0xb3c7('0x1b')](function(_0x1524be){if(_0x1524be){_0x19655e=_0x1524be[_0xb3c7('0x5f')];var _0x2cf7d7=_0x19655e['slice'](-0x1);if(_0x2cf7d7==='/'){_0x19655e=_0x19655e[_0xb3c7('0x60')](0x0,_0x19655e[_0xb3c7('0x61')](_0x2cf7d7));}return rp({'method':_0xb3c7('0x62'),'uri':util[_0xb3c7('0x63')](_0xb3c7('0x64'),_0x19655e,_0xb3c7('0x65')),'json':!![],'form':{'method':_0xb3c7('0x66'),'input_type':_0xb3c7('0x67'),'response_type':_0xb3c7('0x67'),'rest_data':JSON[_0xb3c7('0x20')]({'user_auth':{'user_name':_0x1524be[_0xb3c7('0x68')],'password':_0x1524be['password'],'encryption':_0xb3c7('0x69')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xb3c7('0x1b')](function(_0x34f020){if(_0x34f020&&_0x34f020[_0xb3c7('0x30')]!=='Invalid\x20Login'&&_0x34f020['name']!==_0xb3c7('0x6a')){return rp({'method':'POST','uri':util['format'](_0xb3c7('0x64'),_0x19655e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xb3c7('0x6b'),'input_type':'JSON','response_type':_0xb3c7('0x67'),'rest_data':JSON[_0xb3c7('0x20')]({'session':_0x34f020['id'],'module_name':_0xb3c7('0x6c')})}})[_0xb3c7('0x1b')](function(_0x1d6774){if(_0x1d6774){var _0x2ce8b7=_[_0xb3c7('0x6d')](_0x1d6774[_0xb3c7('0x6e')]);_[_0xb3c7('0x6f')](_0x2ce8b7,function(_0x80d831){return _0x2116c5[_0xb3c7('0x70')](_0x80d831[_0xb3c7('0x30')]);});return{'count':_0x2ce8b7[_0xb3c7('0x39')],'rows':_[_0xb3c7('0x3f')](_0x2ce8b7,function(_0x5b663d){return{'id':_0x5b663d[_0xb3c7('0x30')],'name':_0x5b663d['label'],'custom':_['endsWith'](_0x5b663d[_0xb3c7('0x30')],'_c')?!![]:![],'options':_0x5b663d['options']?_[_0xb3c7('0x3f')](_[_0xb3c7('0x6d')](_0x5b663d[_0xb3c7('0x43')]),function(_0x5d2a02){return{'name':_0x5d2a02[_0xb3c7('0x71')],'value':_0x5d2a02[_0xb3c7('0x30')]};}):[]};})};}})[_0xb3c7('0x1b')](respondWithResult(_0x632b20,null))[_0xb3c7('0x24')](function(_0x33ed02){var _0x3bf716=_0xbf2d7a[_0xb3c7('0x34')][_0xb3c7('0x19')]?0x1f4:_0x33ed02[_0xb3c7('0x72')]||0x1f4;logger[_0xb3c7('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0xb3c7('0x57'),_0x3bf716,JSON[_0xb3c7('0x20')](_0x33ed02));delete _0x33ed02[_0xb3c7('0x30')];if(_0x3bf716===0x191){_0x3bf716=0x190;}_0x632b20[_0xb3c7('0x27')](_0x3bf716)['send'](_0xbf2d7a[_0xb3c7('0x34')][_0xb3c7('0x19')]?{'message':_0xb3c7('0x73'),'statusCode':_0x33ed02[_0xb3c7('0x72')]}:_0x33ed02);});}else{var _0x220bda=0x1f4;_0x632b20[_0xb3c7('0x27')](_0x220bda)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index d7f38e2..6b73f12 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 _0xb959=['request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','api','moment','bluebird'];(function(_0x2475f6,_0x4c2f9e){var _0x31c3e7=function(_0x148bec){while(--_0x148bec){_0x2475f6['push'](_0x2475f6['shift']());}};_0x31c3e7(++_0x4c2f9e);}(_0xb959,0x1a0));var _0x9b95=function(_0x4e9cb1,_0x4d3b37){_0x4e9cb1=_0x4e9cb1-0x0;var _0x55deda=_0xb959[_0x4e9cb1];return _0x55deda;};'use strict';var _=require(_0x9b95('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9b95('0x1'));var moment=require(_0x9b95('0x2'));var BPromise=require(_0x9b95('0x3'));var rp=require(_0x9b95('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b95('0x5'));var config=require(_0x9b95('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x9b95('0x7'));module[_0x9b95('0x8')]=function(_0x2d467b,_0x3c27b9){return _0x2d467b[_0x9b95('0x9')](_0x9b95('0xa'),attributes,{'tableName':_0x9b95('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a89=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','define','SugarcrmAccount'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x5a89,0x1e4));var _0x95a8=function(_0x1eddb9,_0x4e8c4f){_0x1eddb9=_0x1eddb9-0x0;var _0x17ebdd=_0x5a89[_0x1eddb9];return _0x17ebdd;};'use strict';var _=require(_0x95a8('0x0'));var util=require(_0x95a8('0x1'));var logger=require(_0x95a8('0x2'))(_0x95a8('0x3'));var moment=require(_0x95a8('0x4'));var BPromise=require(_0x95a8('0x5'));var rp=require(_0x95a8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95a8('0x7'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x95a8('0x8'));module['exports']=function(_0x29d4bb,_0x5b9dfd){return _0x29d4bb[_0x95a8('0x9')](_0x95a8('0xa'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index ea8bee5..ed9799e 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 _0x2a00=['where','attributes','limit','include','model','map','catch','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw'];(function(_0x56739b,_0x2d2cc9){var _0x1c752f=function(_0x228220){while(--_0x228220){_0x56739b['push'](_0x56739b['shift']());}};_0x1c752f(++_0x2d2cc9);}(_0x2a00,0xe7));var _0x02a0=function(_0x55ac60,_0x49948d){_0x55ac60=_0x55ac60-0x0;var _0x52b609=_0x2a00[_0x55ac60];return _0x52b609;};'use strict';var _=require(_0x02a0('0x0'));var util=require(_0x02a0('0x1'));var moment=require(_0x02a0('0x2'));var BPromise=require(_0x02a0('0x3'));var rs=require(_0x02a0('0x4'));var fs=require('fs');var Redis=require(_0x02a0('0x5'));var db=require(_0x02a0('0x6'))['db'];var utils=require(_0x02a0('0x7'));var logger=require(_0x02a0('0x8'))(_0x02a0('0x9'));var config=require('../../config/environment');var jayson=require(_0x02a0('0xa'));var client=jayson[_0x02a0('0xb')][_0x02a0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17b195,_0x4e08bc,_0x3cb048){return new BPromise(function(_0x10581a,_0x29b109){return client[_0x02a0('0xd')](_0x17b195,_0x3cb048)[_0x02a0('0xe')](function(_0x33b3da){logger[_0x02a0('0xf')](_0x02a0('0x10'),_0x4e08bc,_0x02a0('0x11'));logger[_0x02a0('0x12')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4e08bc,_0x02a0('0x11'),JSON[_0x02a0('0x13')](_0x33b3da));if(_0x33b3da[_0x02a0('0x14')]){if(_0x33b3da[_0x02a0('0x14')][_0x02a0('0x15')]===0x1f4){logger[_0x02a0('0x14')](_0x02a0('0x10'),_0x4e08bc,_0x33b3da[_0x02a0('0x14')][_0x02a0('0x16')]);return _0x29b109(_0x33b3da[_0x02a0('0x14')][_0x02a0('0x16')]);}logger['error'](_0x02a0('0x10'),_0x4e08bc,_0x33b3da['error'][_0x02a0('0x16')]);return _0x10581a(_0x33b3da[_0x02a0('0x14')][_0x02a0('0x16')]);}else{logger[_0x02a0('0xf')](_0x02a0('0x10'),_0x4e08bc,_0x02a0('0x11'));_0x10581a(_0x33b3da['result'][_0x02a0('0x16')]);}})['catch'](function(_0x227f47){logger[_0x02a0('0x14')]('SugarcrmAccount,\x20%s,\x20%s',_0x4e08bc,_0x227f47);_0x29b109(_0x227f47);});});}exports[_0x02a0('0x17')]=function(_0x4f24ba){var _0x323b5e=this;return new Promise(function(_0x5e0c0d,_0x29f5c4){return db[_0x02a0('0x18')][_0x02a0('0x19')]({'raw':_0x4f24ba['options']?_0x4f24ba[_0x02a0('0x1a')][_0x02a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f24ba[_0x02a0('0x1a')]?_0x4f24ba['options'][_0x02a0('0x1c')]||null:null,'attributes':_0x4f24ba[_0x02a0('0x1a')]?_0x4f24ba[_0x02a0('0x1a')][_0x02a0('0x1d')]||null:null,'limit':_0x4f24ba[_0x02a0('0x1a')]?_0x4f24ba[_0x02a0('0x1a')][_0x02a0('0x1e')]||null:null,'include':_0x4f24ba[_0x02a0('0x1a')]?_0x4f24ba[_0x02a0('0x1a')][_0x02a0('0x1f')]?_['map'](_0x4f24ba[_0x02a0('0x1a')][_0x02a0('0x1f')],function(_0x517669){return{'model':db[_0x517669[_0x02a0('0x20')]],'as':_0x517669['as'],'attributes':_0x517669[_0x02a0('0x1d')],'include':_0x517669[_0x02a0('0x1f')]?_['map'](_0x517669[_0x02a0('0x1f')],function(_0x358f8a){return{'model':db[_0x358f8a[_0x02a0('0x20')]],'as':_0x358f8a['as'],'attributes':_0x358f8a[_0x02a0('0x1d')],'include':_0x358f8a[_0x02a0('0x1f')]?_[_0x02a0('0x21')](_0x358f8a[_0x02a0('0x1f')],function(_0x20f04d){return{'model':db[_0x20f04d[_0x02a0('0x20')]],'as':_0x20f04d['as'],'attributes':_0x20f04d[_0x02a0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x02a0('0xe')](function(_0x3b15ce){logger[_0x02a0('0xf')](_0x02a0('0x17'),_0x4f24ba);logger['debug'](_0x02a0('0x17'),_0x4f24ba,JSON[_0x02a0('0x13')](_0x3b15ce));_0x5e0c0d(_0x3b15ce);})[_0x02a0('0x22')](function(_0x37f71e){logger[_0x02a0('0x14')](_0x02a0('0x17'),_0x37f71e[_0x02a0('0x16')],_0x4f24ba);_0x29f5c4(_0x323b5e[_0x02a0('0x14')](0x1f4,_0x37f71e[_0x02a0('0x16')]));});});};exports['ShowSugarcrmAccount']=function(_0x3dd8c2){var _0x3afdf1=this;return new Promise(function(_0x23ec61,_0x2d449c){return db[_0x02a0('0x18')][_0x02a0('0x23')]({'raw':_0x3dd8c2[_0x02a0('0x1a')]?_0x3dd8c2[_0x02a0('0x1a')][_0x02a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x3dd8c2[_0x02a0('0x1a')]?_0x3dd8c2[_0x02a0('0x1a')][_0x02a0('0x1c')]||null:null,'attributes':_0x3dd8c2[_0x02a0('0x1a')]?_0x3dd8c2['options']['attributes']||null:null,'include':_0x3dd8c2[_0x02a0('0x1a')]?_0x3dd8c2[_0x02a0('0x1a')]['include']?_[_0x02a0('0x21')](_0x3dd8c2[_0x02a0('0x1a')]['include'],function(_0x2bf77a){return{'model':db[_0x2bf77a['model']],'as':_0x2bf77a['as'],'attributes':_0x2bf77a[_0x02a0('0x1d')],'include':_0x2bf77a[_0x02a0('0x1f')]?_[_0x02a0('0x21')](_0x2bf77a[_0x02a0('0x1f')],function(_0x185613){return{'model':db[_0x185613[_0x02a0('0x20')]],'as':_0x185613['as'],'attributes':_0x185613[_0x02a0('0x1d')],'include':_0x185613['include']?_['map'](_0x185613[_0x02a0('0x1f')],function(_0x31503a){return{'model':db[_0x31503a[_0x02a0('0x20')]],'as':_0x31503a['as'],'attributes':_0x31503a[_0x02a0('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x02a0('0xe')](function(_0x35d37c){logger[_0x02a0('0xf')](_0x02a0('0x24'),_0x3dd8c2);logger[_0x02a0('0x12')](_0x02a0('0x24'),_0x3dd8c2,JSON[_0x02a0('0x13')](_0x35d37c));_0x23ec61(_0x35d37c);})[_0x02a0('0x22')](function(_0x575d53){logger[_0x02a0('0x14')]('ShowSugarcrmAccount',_0x575d53[_0x02a0('0x16')],_0x3dd8c2);_0x2d449c(_0x3afdf1['error'](0x1f4,_0x575d53['message']));});});}; \ No newline at end of file +var _0xce9e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','bluebird','randomstring'];(function(_0x5e7c3e,_0x4dd14e){var _0x3ca540=function(_0x718103){while(--_0x718103){_0x5e7c3e['push'](_0x5e7c3e['shift']());}};_0x3ca540(++_0x4dd14e);}(_0xce9e,0x188));var _0xece9=function(_0xb72cc8,_0x3b7aa3){_0xb72cc8=_0xb72cc8-0x0;var _0x75cfb3=_0xce9e[_0xb72cc8];return _0x75cfb3;};'use strict';var _=require(_0xece9('0x0'));var util=require(_0xece9('0x1'));var moment=require('moment');var BPromise=require(_0xece9('0x2'));var rs=require(_0xece9('0x3'));var fs=require('fs');var Redis=require(_0xece9('0x4'));var db=require(_0xece9('0x5'))['db'];var utils=require(_0xece9('0x6'));var logger=require(_0xece9('0x7'))(_0xece9('0x8'));var config=require(_0xece9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xece9('0xa')][_0xece9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b6404,_0x38a4d3,_0x14c415){return new BPromise(function(_0xaebd22,_0x589e48){return client[_0xece9('0xc')](_0x3b6404,_0x14c415)[_0xece9('0xd')](function(_0xd29905){logger['info'](_0xece9('0xe'),_0x38a4d3,_0xece9('0xf'));logger[_0xece9('0x10')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x38a4d3,_0xece9('0xf'),JSON[_0xece9('0x11')](_0xd29905));if(_0xd29905[_0xece9('0x12')]){if(_0xd29905['error'][_0xece9('0x13')]===0x1f4){logger[_0xece9('0x12')](_0xece9('0xe'),_0x38a4d3,_0xd29905[_0xece9('0x12')]['message']);return _0x589e48(_0xd29905[_0xece9('0x12')][_0xece9('0x14')]);}logger[_0xece9('0x12')](_0xece9('0xe'),_0x38a4d3,_0xd29905[_0xece9('0x12')][_0xece9('0x14')]);return _0xaebd22(_0xd29905[_0xece9('0x12')]['message']);}else{logger[_0xece9('0x15')](_0xece9('0xe'),_0x38a4d3,_0xece9('0xf'));_0xaebd22(_0xd29905[_0xece9('0x16')][_0xece9('0x14')]);}})[_0xece9('0x17')](function(_0x3e509a){logger[_0xece9('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x38a4d3,_0x3e509a);_0x589e48(_0x3e509a);});});}exports['GetSugarcrmAccount']=function(_0x211a92){var _0x467c09=this;return new Promise(function(_0x378cc9,_0x3f2f4a){return db[_0xece9('0x18')][_0xece9('0x19')]({'raw':_0x211a92[_0xece9('0x1a')]?_0x211a92['options'][_0xece9('0x1b')]===undefined?!![]:![]:!![],'where':_0x211a92[_0xece9('0x1a')]?_0x211a92[_0xece9('0x1a')][_0xece9('0x1c')]||null:null,'attributes':_0x211a92['options']?_0x211a92[_0xece9('0x1a')][_0xece9('0x1d')]||null:null,'limit':_0x211a92[_0xece9('0x1a')]?_0x211a92[_0xece9('0x1a')]['limit']||null:null,'include':_0x211a92[_0xece9('0x1a')]?_0x211a92[_0xece9('0x1a')][_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x211a92[_0xece9('0x1a')][_0xece9('0x1e')],function(_0x36694a){return{'model':db[_0x36694a[_0xece9('0x20')]],'as':_0x36694a['as'],'attributes':_0x36694a[_0xece9('0x1d')],'include':_0x36694a[_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x36694a['include'],function(_0x5ef097){return{'model':db[_0x5ef097[_0xece9('0x20')]],'as':_0x5ef097['as'],'attributes':_0x5ef097['attributes'],'include':_0x5ef097[_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x5ef097[_0xece9('0x1e')],function(_0x4db657){return{'model':db[_0x4db657[_0xece9('0x20')]],'as':_0x4db657['as'],'attributes':_0x4db657[_0xece9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xece9('0xd')](function(_0xee134a){logger[_0xece9('0x15')](_0xece9('0x21'),_0x211a92);logger[_0xece9('0x10')](_0xece9('0x21'),_0x211a92,JSON[_0xece9('0x11')](_0xee134a));_0x378cc9(_0xee134a);})[_0xece9('0x17')](function(_0x2b8b18){logger[_0xece9('0x12')](_0xece9('0x21'),_0x2b8b18['message'],_0x211a92);_0x3f2f4a(_0x467c09[_0xece9('0x12')](0x1f4,_0x2b8b18['message']));});});};exports[_0xece9('0x22')]=function(_0x38e915){var _0x4b8687=this;return new Promise(function(_0x3bcd2c,_0x2279a2){return db['SugarcrmAccount'][_0xece9('0x23')]({'raw':_0x38e915[_0xece9('0x1a')]?_0x38e915['options'][_0xece9('0x1b')]===undefined?!![]:![]:!![],'where':_0x38e915[_0xece9('0x1a')]?_0x38e915[_0xece9('0x1a')][_0xece9('0x1c')]||null:null,'attributes':_0x38e915['options']?_0x38e915[_0xece9('0x1a')][_0xece9('0x1d')]||null:null,'include':_0x38e915['options']?_0x38e915[_0xece9('0x1a')][_0xece9('0x1e')]?_[_0xece9('0x1f')](_0x38e915[_0xece9('0x1a')][_0xece9('0x1e')],function(_0x24fc9c){return{'model':db[_0x24fc9c[_0xece9('0x20')]],'as':_0x24fc9c['as'],'attributes':_0x24fc9c[_0xece9('0x1d')],'include':_0x24fc9c[_0xece9('0x1e')]?_['map'](_0x24fc9c['include'],function(_0xf821f){return{'model':db[_0xf821f[_0xece9('0x20')]],'as':_0xf821f['as'],'attributes':_0xf821f[_0xece9('0x1d')],'include':_0xf821f['include']?_[_0xece9('0x1f')](_0xf821f['include'],function(_0x41b719){return{'model':db[_0x41b719[_0xece9('0x20')]],'as':_0x41b719['as'],'attributes':_0x41b719['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x133467){logger[_0xece9('0x15')]('ShowSugarcrmAccount',_0x38e915);logger[_0xece9('0x10')](_0xece9('0x22'),_0x38e915,JSON['stringify'](_0x133467));_0x3bcd2c(_0x133467);})['catch'](function(_0x1dac84){logger[_0xece9('0x12')](_0xece9('0x22'),_0x1dac84[_0xece9('0x14')],_0x38e915);_0x2279a2(_0x4b8687['error'](0x1f4,_0x1dac84[_0xece9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 8ed2f5b..ff157a8 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 _0x1fda=['create','put','/:id','update','delete','destroy','exports','multer','util','Router','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x28a250,_0x45f9af){var _0x3d9f0c=function(_0x2c0bf5){while(--_0x2c0bf5){_0x28a250['push'](_0x28a250['shift']());}};_0x3d9f0c(++_0x45f9af);}(_0x1fda,0x103));var _0xa1fd=function(_0x3db3d8,_0x4fae40){_0x3db3d8=_0x3db3d8-0x0;var _0x41f827=_0x1fda[_0x3db3d8];return _0x41f827;};'use strict';var multer=require(_0xa1fd('0x0'));var util=require(_0xa1fd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa1fd('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xa1fd('0x3'));var config=require(_0xa1fd('0x4'));var controller=require(_0xa1fd('0x5'));router[_0xa1fd('0x6')]('/',auth[_0xa1fd('0x7')](),controller[_0xa1fd('0x8')]);router[_0xa1fd('0x6')]('/:id',auth[_0xa1fd('0x7')](),controller['show']);router[_0xa1fd('0x6')]('/:id/fields',auth[_0xa1fd('0x7')](),controller['getFields']);router[_0xa1fd('0x6')](_0xa1fd('0x9'),auth['isAuthenticated'](),controller[_0xa1fd('0xa')]);router[_0xa1fd('0x6')](_0xa1fd('0xb'),auth[_0xa1fd('0x7')](),controller[_0xa1fd('0xc')]);router[_0xa1fd('0xd')]('/',auth[_0xa1fd('0x7')](),controller[_0xa1fd('0xe')]);router[_0xa1fd('0xf')](_0xa1fd('0x10'),auth[_0xa1fd('0x7')](),controller[_0xa1fd('0x11')]);router[_0xa1fd('0x12')](_0xa1fd('0x10'),auth[_0xa1fd('0x7')](),controller[_0xa1fd('0x13')]);module[_0xa1fd('0x14')]=router; \ No newline at end of file +var _0xdddf=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getSubjects','/:id/descriptions','create','put','delete','exports','multer','util'];(function(_0x1fa759,_0x4ecdce){var _0x2da9f4=function(_0x463e2a){while(--_0x463e2a){_0x1fa759['push'](_0x1fa759['shift']());}};_0x2da9f4(++_0x4ecdce);}(_0xdddf,0x17a));var _0xfddd=function(_0x3cf62f,_0x39152c){_0x3cf62f=_0x3cf62f-0x0;var _0x36f12f=_0xdddf[_0x3cf62f];return _0x36f12f;};'use strict';var multer=require(_0xfddd('0x0'));var util=require(_0xfddd('0x1'));var path=require(_0xfddd('0x2'));var timeout=require(_0xfddd('0x3'));var express=require(_0xfddd('0x4'));var router=express[_0xfddd('0x5')]();var auth=require(_0xfddd('0x6'));var interaction=require(_0xfddd('0x7'));var config=require('../../config/environment');var controller=require(_0xfddd('0x8'));router['get']('/',auth[_0xfddd('0x9')](),controller[_0xfddd('0xa')]);router[_0xfddd('0xb')](_0xfddd('0xc'),auth[_0xfddd('0x9')](),controller['show']);router[_0xfddd('0xb')](_0xfddd('0xd'),auth[_0xfddd('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xfddd('0x9')](),controller[_0xfddd('0xe')]);router['get'](_0xfddd('0xf'),auth[_0xfddd('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0xfddd('0x9')](),controller[_0xfddd('0x10')]);router[_0xfddd('0x11')](_0xfddd('0xc'),auth[_0xfddd('0x9')](),controller['update']);router[_0xfddd('0x12')](_0xfddd('0xc'),auth[_0xfddd('0x9')](),controller['destroy']);module[_0xfddd('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index d3fb390..a688135 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 _0x63f0=['sequelize','exports','STRING'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0x63f0,0xe1));var _0x063f=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0x63f0[_0x1e4a8e];return _0x5408f9;};'use strict';var Sequelize=require(_0x063f('0x0'));module[_0x063f('0x1')]={'name':{'type':Sequelize[_0x063f('0x2')]},'description':{'type':Sequelize[_0x063f('0x2')]}}; \ No newline at end of file +'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index cacb11f..c075a4a 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 _0x4fc2=['getSubjects','getDescriptions','SugarcrmField','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','set','reject','save','update','destroy','stack','name','send','index','SugarcrmConfiguration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','includeAll','findAll','rows','show','params','include','merge','find','catch','create','body','getFields','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fc2,0x111));var _0x24fc=function(_0xe6b674,_0x267db9){_0xe6b674=_0xe6b674-0x0;var _0x2a6236=_0x4fc2[_0xe6b674];return _0x2a6236;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var hardwareService=require(_0x24fc('0x13'));var logger=require(_0x24fc('0x14'))(_0x24fc('0x15'));var utils=require(_0x24fc('0x16'));var config=require(_0x24fc('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x24fc('0x18'));var client=jayson[_0x24fc('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x306873,_0x76cb25,_0x3f6d8b){if(_0x3f6d8b){var _0x3bc30b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bc30b[_0x24fc('0x1a')](_0x76cb25)){return _0x306873;}else{throw new Error(_0x24fc('0x1b'));}}else{return _0x306873;}}function respondWithRpcPromise(_0x537b5c,_0x2a0971,_0x18c0a7,_0x2ffed3){return new BPromise(function(_0x42cbe8,_0x4acd36){var _0x2ac989=_0x2ffed3||client;return _0x2ac989['request'](_0x537b5c,_0x18c0a7)[_0x24fc('0x1c')](function(_0x3385c7){logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));logger['debug'](_0x24fc('0x20'),_0x2a0971,_0x24fc('0x1f'),JSON[_0x24fc('0x21')](_0x3385c7));if(_0x3385c7[_0x24fc('0x22')]){if(_0x3385c7['error'][_0x24fc('0x23')]===0x1f4){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x3385c7['error'][_0x24fc('0x24')]);return _0x4acd36(_0x3385c7[_0x24fc('0x22')][_0x24fc('0x24')]);}logger[_0x24fc('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a0971,_0x3385c7[_0x24fc('0x22')]['message']);return _0x42cbe8(_0x3385c7[_0x24fc('0x22')]['message']);}else{logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));_0x42cbe8(_0x3385c7['result'][_0x24fc('0x24')]);}})['catch'](function(_0x35a9c7){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x35a9c7);_0x4acd36(_0x35a9c7);});});}function respondWithStatusCode(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0xcc;return function(_0x262e11){if(_0x262e11){return _0x34b5b2[_0x24fc('0x25')](_0x3296fc);}return _0x34b5b2[_0x24fc('0x26')](_0x3296fc)[_0x24fc('0x27')]();};}function respondWithResult(_0x2a5c4b,_0x568441){_0x568441=_0x568441||0xc8;return function(_0x11c913){if(_0x11c913){return _0x2a5c4b[_0x24fc('0x26')](_0x568441)[_0x24fc('0x28')](_0x11c913);}};}function respondWithFilteredResult(_0x5bb4c8,_0xf2f77d){return function(_0x3d1ec8){if(_0x3d1ec8){var _0x35f9f9=_0x3d1ec8['count'],_0x290f84=_0xf2f77d[_0x24fc('0x29')],_0x8f2528=_0xf2f77d[_0x24fc('0x29')]+_0xf2f77d[_0x24fc('0x2a')],_0x443796;if(_0x8f2528>=_0x35f9f9){_0x8f2528=_0x35f9f9;_0x443796=0xc8;}else{_0x443796=0xce;}_0x5bb4c8[_0x24fc('0x26')](_0x443796);return _0x5bb4c8[_0x24fc('0x2b')]('Content-Range',_0x290f84+'-'+_0x8f2528+'/'+_0x35f9f9)['json'](_0x3d1ec8);}return null;};}function patchUpdates(_0x4e6f73){return function(_0x3df6f4){try{jsonpatch['apply'](_0x3df6f4,_0x4e6f73,!![]);}catch(_0x3f2464){return BPromise[_0x24fc('0x2c')](_0x3f2464);}return _0x3df6f4[_0x24fc('0x2d')]();};}function saveUpdates(_0x2086c0,_0x4dbd52){return function(_0x66eec0){if(_0x66eec0){return _0x66eec0[_0x24fc('0x2e')](_0x2086c0)['then'](function(_0xf46cd5){return _0xf46cd5;});}return null;};}function removeEntity(_0x1b174d,_0x4d756f){return function(_0x48c62a){if(_0x48c62a){return _0x48c62a[_0x24fc('0x2f')]()['then'](function(){_0x1b174d[_0x24fc('0x26')](0xcc)[_0x24fc('0x27')]();});}};}function handleEntityNotFound(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(!_0x33bbf2){_0x5491b0[_0x24fc('0x25')](0x194);}return _0x33bbf2;};}function handleError(_0x1f7f8d,_0x1c5874){_0x1c5874=_0x1c5874||0x1f4;return function(_0x1e205d){logger[_0x24fc('0x22')](_0x1e205d[_0x24fc('0x30')]);if(_0x1e205d[_0x24fc('0x31')]){delete _0x1e205d['name'];}_0x1f7f8d[_0x24fc('0x26')](_0x1c5874)[_0x24fc('0x32')](_0x1e205d);};}exports[_0x24fc('0x33')]=function(_0x316aa2,_0x242bd5){var _0x5781d2={},_0x56a9bd={},_0xd52d10={'count':0x0,'rows':[]};var _0x5d48fe=db[_0x24fc('0x34')][_0x24fc('0x35')];_0x56a9bd[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x5d48fe);_0x56a9bd['query']=_[_0x24fc('0x37')](_0x316aa2['query']);_0x56a9bd[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x56a9bd[_0x24fc('0x36')],_0x56a9bd[_0x24fc('0x3a')]);_0x5781d2[_0x24fc('0x3b')]=_['intersection'](_0x56a9bd[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x5781d2['attributes']=_0x5781d2[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x5781d2['attributes']:_0x56a9bd[_0x24fc('0x36')];if(!_0x316aa2['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x5781d2[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x5781d2[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x316aa2['query'][_0x24fc('0x29')]);}_0x5781d2[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x316aa2['query'][_0x24fc('0x41')]);_0x5781d2[_0x24fc('0x42')]=qs['filters'](_[_0x24fc('0x43')](_0x316aa2[_0x24fc('0x3a')],_0x56a9bd[_0x24fc('0x38')]));if(_0x316aa2['query'][_0x24fc('0x44')]){_0x5781d2[_0x24fc('0x42')]=_['merge'](_0x5781d2[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x5d48fe,function(_0x158f7b){if(_0x158f7b[_0x24fc('0x46')]['key']!==_0x24fc('0x47')){var _0x9bc56a={};_0x9bc56a[_0x158f7b[_0x24fc('0x48')]]={'$like':'%'+_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x9bc56a;}})});}_0x5781d2=_['merge']({},_0x5781d2,_0x316aa2[_0x24fc('0x49')]);var _0x1b9c90={'where':_0x5781d2[_0x24fc('0x42')]};return db[_0x24fc('0x34')]['count'](_0x1b9c90)[_0x24fc('0x1c')](function(_0x253358){_0xd52d10['count']=_0x253358;if(_0x316aa2['query'][_0x24fc('0x4a')]){_0x5781d2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x24fc('0x4b')](_0x5781d2);})['then'](function(_0x281194){_0xd52d10[_0x24fc('0x4c')]=_0x281194;return _0xd52d10;})[_0x24fc('0x1c')](respondWithFilteredResult(_0x242bd5,_0x5781d2))['catch'](handleError(_0x242bd5,null));};exports[_0x24fc('0x4d')]=function(_0x23c1d4,_0x1b1f1c){var _0x1ad8d6={'raw':![],'where':{'id':_0x23c1d4[_0x24fc('0x4e')]['id']}},_0x39873d={};_0x39873d[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmConfiguration']['rawAttributes']);_0x39873d[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x23c1d4[_0x24fc('0x3a')]);_0x39873d['filters']=_['intersection'](_0x39873d[_0x24fc('0x36')],_0x39873d[_0x24fc('0x3a')]);_0x1ad8d6[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x39873d[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x1ad8d6[_0x24fc('0x3b')]=_0x1ad8d6[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x1ad8d6[_0x24fc('0x3b')]:_0x39873d['model'];if(_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x4a')]){_0x1ad8d6[_0x24fc('0x4f')]=[{'all':!![]}];}_0x1ad8d6=_[_0x24fc('0x50')]({},_0x1ad8d6,_0x23c1d4[_0x24fc('0x49')]);return db['SugarcrmConfiguration'][_0x24fc('0x51')](_0x1ad8d6)['then'](handleEntityNotFound(_0x1b1f1c,null))[_0x24fc('0x1c')](respondWithResult(_0x1b1f1c,null))[_0x24fc('0x52')](handleError(_0x1b1f1c,null));};exports[_0x24fc('0x53')]=function(_0x41ddfb,_0x40f42b){return db[_0x24fc('0x34')]['create'](_0x41ddfb[_0x24fc('0x54')],{})[_0x24fc('0x1c')](respondWithResult(_0x40f42b,0xc9))[_0x24fc('0x52')](handleError(_0x40f42b,null));};exports[_0x24fc('0x2e')]=function(_0x28f799,_0x870767){if(_0x28f799['body']['id']){delete _0x28f799[_0x24fc('0x54')]['id'];}return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x28f799[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x870767,null))[_0x24fc('0x1c')](saveUpdates(_0x28f799[_0x24fc('0x54')],null))['then'](respondWithResult(_0x870767,null))[_0x24fc('0x52')](handleError(_0x870767,null));};exports[_0x24fc('0x2f')]=function(_0x4ae720,_0x1368f6){return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x4ae720[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x1368f6,null))[_0x24fc('0x1c')](removeEntity(_0x1368f6,null))['catch'](handleError(_0x1368f6,null));};exports[_0x24fc('0x55')]=function(_0x4a0524,_0x3e9644,_0x8c9649){var _0x50e5b0={};var _0x435442={};var _0x5c1a92;var _0x1c1f74;return db['SugarcrmConfiguration'][_0x24fc('0x56')]({'where':{'id':_0x4a0524[_0x24fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e9644,null))[_0x24fc('0x1c')](function(_0x5d6539){if(_0x5d6539){_0x5c1a92=_0x5d6539;_0x435442[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmField'][_0x24fc('0x35')]);_0x435442[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x4a0524[_0x24fc('0x3a')]);_0x435442[_0x24fc('0x38')]=_['intersection'](_0x435442[_0x24fc('0x36')],_0x435442[_0x24fc('0x3a')]);_0x50e5b0[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x435442[_0x24fc('0x36')],qs['fields'](_0x4a0524['query'][_0x24fc('0x3c')]));_0x50e5b0[_0x24fc('0x3b')]=_0x50e5b0['attributes']['length']?_0x50e5b0[_0x24fc('0x3b')]:_0x435442[_0x24fc('0x36')];_0x50e5b0[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4a0524['query'][_0x24fc('0x41')]);_0x50e5b0[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x4a0524[_0x24fc('0x3a')],_0x435442[_0x24fc('0x38')]));if(_0x4a0524[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x50e5b0[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x50e5b0[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x50e5b0[_0x24fc('0x3b')],function(_0x24ca4b){var _0x354fc6={};_0x354fc6[_0x24ca4b]={'$like':'%'+_0x4a0524['query'][_0x24fc('0x44')]+'%'};return _0x354fc6;})});}_0x50e5b0=_[_0x24fc('0x50')]({},_0x50e5b0,_0x4a0524[_0x24fc('0x49')]);return _0x5c1a92[_0x24fc('0x55')](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x2eb6dc){if(_0x2eb6dc){_0x1c1f74=_0x2eb6dc[_0x24fc('0x3d')];if(!_0x4a0524[_0x24fc('0x3a')]['hasOwnProperty'](_0x24fc('0x3f'))){_0x50e5b0[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x4a0524[_0x24fc('0x3a')]['limit']);_0x50e5b0[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x4a0524['query']['offset']);}return _0x5c1a92['getFields'](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x698283){if(_0x698283){return _0x698283?{'count':_0x1c1f74,'rows':_0x698283}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x3e9644,null))[_0x24fc('0x52')](handleError(_0x3e9644,null));};exports[_0x24fc('0x57')]=function(_0x1d0f06,_0x52e1aa,_0x11bafd){var _0x15e8a3={};var _0x5a2c09={};var _0x51b1c0;var _0xfc6b7f;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1d0f06['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x52e1aa,null))[_0x24fc('0x1c')](function(_0x33f04e){if(_0x33f04e){_0x51b1c0=_0x33f04e;_0x5a2c09['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x5a2c09['query']=_[_0x24fc('0x37')](_0x1d0f06[_0x24fc('0x3a')]);_0x5a2c09[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5a2c09['model'],_0x5a2c09[_0x24fc('0x3a')]);_0x15e8a3['attributes']=_[_0x24fc('0x39')](_0x5a2c09['model'],qs[_0x24fc('0x3c')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x15e8a3[_0x24fc('0x3b')]=_0x15e8a3[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x15e8a3[_0x24fc('0x3b')]:_0x5a2c09['model'];_0x15e8a3[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1d0f06[_0x24fc('0x3a')]['sort']);_0x15e8a3['where']=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x1d0f06['query'],_0x5a2c09[_0x24fc('0x38')]));if(_0x1d0f06[_0x24fc('0x3a')]['filter']){_0x15e8a3[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x15e8a3['where'],{'$or':_[_0x24fc('0x45')](_0x15e8a3[_0x24fc('0x3b')],function(_0x24e717){var _0x1efe4e={};_0x1efe4e[_0x24e717]={'$like':'%'+_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x1efe4e;})});}_0x15e8a3=_['merge']({},_0x15e8a3,_0x1d0f06['options']);return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x29bd9f){if(_0x29bd9f){_0xfc6b7f=_0x29bd9f['length'];if(!_0x1d0f06['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x15e8a3[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x15e8a3[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1d0f06['query'][_0x24fc('0x29')]);}return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x47e22f){if(_0x47e22f){return _0x47e22f?{'count':_0xfc6b7f,'rows':_0x47e22f}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x52e1aa,null))[_0x24fc('0x52')](handleError(_0x52e1aa,null));};exports[_0x24fc('0x58')]=function(_0x1b2a97,_0xd1e6,_0x5de0ea){var _0x216781={};var _0xcb7986={};var _0x5ca35b;var _0x13ab57;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1b2a97['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0xd1e6,null))[_0x24fc('0x1c')](function(_0x3399fe){if(_0x3399fe){_0x5ca35b=_0x3399fe;_0xcb7986[_0x24fc('0x36')]=_[_0x24fc('0x37')](db[_0x24fc('0x59')][_0x24fc('0x35')]);_0xcb7986[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x1b2a97['query']);_0xcb7986[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0xcb7986[_0x24fc('0x36')],_0xcb7986['query']);_0x216781['attributes']=_['intersection'](_0xcb7986[_0x24fc('0x36')],qs['fields'](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x216781['attributes']=_0x216781[_0x24fc('0x3b')]['length']?_0x216781[_0x24fc('0x3b')]:_0xcb7986['model'];_0x216781[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x41')]);_0x216781[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_['pick'](_0x1b2a97[_0x24fc('0x3a')],_0xcb7986[_0x24fc('0x38')]));if(_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x216781[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x216781[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x216781[_0x24fc('0x3b')],function(_0x5f4ec2){var _0x2c9119={};_0x2c9119[_0x5f4ec2]={'$like':'%'+_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x2c9119;})});}_0x216781=_[_0x24fc('0x50')]({},_0x216781,_0x1b2a97['options']);return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0xc2be0f){if(_0xc2be0f){_0x13ab57=_0xc2be0f['length'];if(!_0x1b2a97[_0x24fc('0x3a')]['hasOwnProperty']('nolimit')){_0x216781['limit']=qs[_0x24fc('0x2a')](_0x1b2a97['query'][_0x24fc('0x2a')]);_0x216781[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1b2a97[_0x24fc('0x3a')]['offset']);}return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0x3d8394){if(_0x3d8394){return _0x3d8394?{'count':_0x13ab57,'rows':_0x3d8394}:null;}})[_0x24fc('0x1c')](respondWithResult(_0xd1e6,null))[_0x24fc('0x52')](handleError(_0xd1e6,null));}; \ No newline at end of file +var _0x4fc2=['getSubjects','getDescriptions','SugarcrmField','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','set','reject','save','update','destroy','stack','name','send','index','SugarcrmConfiguration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','includeAll','findAll','rows','show','params','include','merge','find','catch','create','body','getFields','findOne'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fc2,0x111));var _0x24fc=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0x4fc2[_0x1fdb40];return _0x281f93;};'use strict';var pdf=require(_0x24fc('0x0'));var emlformat=require(_0x24fc('0x1'));var rimraf=require(_0x24fc('0x2'));var zipdir=require(_0x24fc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24fc('0x4'));var moment=require(_0x24fc('0x5'));var BPromise=require(_0x24fc('0x6'));var Mustache=require('mustache');var util=require(_0x24fc('0x7'));var path=require(_0x24fc('0x8'));var sox=require('sox');var csv=require(_0x24fc('0x9'));var ejs=require(_0x24fc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0x9'));var querystring=require(_0x24fc('0xf'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x10'));var authService=require(_0x24fc('0x11'));var qs=require(_0x24fc('0x12'));var hardwareService=require(_0x24fc('0x13'));var logger=require(_0x24fc('0x14'))(_0x24fc('0x15'));var utils=require(_0x24fc('0x16'));var config=require(_0x24fc('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x24fc('0x18'));var client=jayson[_0x24fc('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x306873,_0x76cb25,_0x3f6d8b){if(_0x3f6d8b){var _0x3bc30b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bc30b[_0x24fc('0x1a')](_0x76cb25)){return _0x306873;}else{throw new Error(_0x24fc('0x1b'));}}else{return _0x306873;}}function respondWithRpcPromise(_0x537b5c,_0x2a0971,_0x18c0a7,_0x2ffed3){return new BPromise(function(_0x42cbe8,_0x4acd36){var _0x2ac989=_0x2ffed3||client;return _0x2ac989['request'](_0x537b5c,_0x18c0a7)[_0x24fc('0x1c')](function(_0x3385c7){logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));logger['debug'](_0x24fc('0x20'),_0x2a0971,_0x24fc('0x1f'),JSON[_0x24fc('0x21')](_0x3385c7));if(_0x3385c7[_0x24fc('0x22')]){if(_0x3385c7['error'][_0x24fc('0x23')]===0x1f4){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x3385c7['error'][_0x24fc('0x24')]);return _0x4acd36(_0x3385c7[_0x24fc('0x22')][_0x24fc('0x24')]);}logger[_0x24fc('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2a0971,_0x3385c7[_0x24fc('0x22')]['message']);return _0x42cbe8(_0x3385c7[_0x24fc('0x22')]['message']);}else{logger[_0x24fc('0x1d')](_0x24fc('0x1e'),_0x2a0971,_0x24fc('0x1f'));_0x42cbe8(_0x3385c7['result'][_0x24fc('0x24')]);}})['catch'](function(_0x35a9c7){logger[_0x24fc('0x22')](_0x24fc('0x1e'),_0x2a0971,_0x35a9c7);_0x4acd36(_0x35a9c7);});});}function respondWithStatusCode(_0x34b5b2,_0x3296fc){_0x3296fc=_0x3296fc||0xcc;return function(_0x262e11){if(_0x262e11){return _0x34b5b2[_0x24fc('0x25')](_0x3296fc);}return _0x34b5b2[_0x24fc('0x26')](_0x3296fc)[_0x24fc('0x27')]();};}function respondWithResult(_0x2a5c4b,_0x568441){_0x568441=_0x568441||0xc8;return function(_0x11c913){if(_0x11c913){return _0x2a5c4b[_0x24fc('0x26')](_0x568441)[_0x24fc('0x28')](_0x11c913);}};}function respondWithFilteredResult(_0x5bb4c8,_0xf2f77d){return function(_0x3d1ec8){if(_0x3d1ec8){var _0x35f9f9=_0x3d1ec8['count'],_0x290f84=_0xf2f77d[_0x24fc('0x29')],_0x8f2528=_0xf2f77d[_0x24fc('0x29')]+_0xf2f77d[_0x24fc('0x2a')],_0x443796;if(_0x8f2528>=_0x35f9f9){_0x8f2528=_0x35f9f9;_0x443796=0xc8;}else{_0x443796=0xce;}_0x5bb4c8[_0x24fc('0x26')](_0x443796);return _0x5bb4c8[_0x24fc('0x2b')]('Content-Range',_0x290f84+'-'+_0x8f2528+'/'+_0x35f9f9)['json'](_0x3d1ec8);}return null;};}function patchUpdates(_0x4e6f73){return function(_0x3df6f4){try{jsonpatch['apply'](_0x3df6f4,_0x4e6f73,!![]);}catch(_0x3f2464){return BPromise[_0x24fc('0x2c')](_0x3f2464);}return _0x3df6f4[_0x24fc('0x2d')]();};}function saveUpdates(_0x2086c0,_0x4dbd52){return function(_0x66eec0){if(_0x66eec0){return _0x66eec0[_0x24fc('0x2e')](_0x2086c0)['then'](function(_0xf46cd5){return _0xf46cd5;});}return null;};}function removeEntity(_0x1b174d,_0x4d756f){return function(_0x48c62a){if(_0x48c62a){return _0x48c62a[_0x24fc('0x2f')]()['then'](function(){_0x1b174d[_0x24fc('0x26')](0xcc)[_0x24fc('0x27')]();});}};}function handleEntityNotFound(_0x5491b0,_0x2ae896){return function(_0x33bbf2){if(!_0x33bbf2){_0x5491b0[_0x24fc('0x25')](0x194);}return _0x33bbf2;};}function handleError(_0x1f7f8d,_0x1c5874){_0x1c5874=_0x1c5874||0x1f4;return function(_0x1e205d){logger[_0x24fc('0x22')](_0x1e205d[_0x24fc('0x30')]);if(_0x1e205d[_0x24fc('0x31')]){delete _0x1e205d['name'];}_0x1f7f8d[_0x24fc('0x26')](_0x1c5874)[_0x24fc('0x32')](_0x1e205d);};}exports[_0x24fc('0x33')]=function(_0x316aa2,_0x242bd5){var _0x5781d2={},_0x56a9bd={},_0xd52d10={'count':0x0,'rows':[]};var _0x5d48fe=db[_0x24fc('0x34')][_0x24fc('0x35')];_0x56a9bd[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x5d48fe);_0x56a9bd['query']=_[_0x24fc('0x37')](_0x316aa2['query']);_0x56a9bd[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x56a9bd[_0x24fc('0x36')],_0x56a9bd[_0x24fc('0x3a')]);_0x5781d2[_0x24fc('0x3b')]=_['intersection'](_0x56a9bd[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x5781d2['attributes']=_0x5781d2[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x5781d2['attributes']:_0x56a9bd[_0x24fc('0x36')];if(!_0x316aa2['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x5781d2[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x5781d2[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x316aa2['query'][_0x24fc('0x29')]);}_0x5781d2[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x316aa2['query'][_0x24fc('0x41')]);_0x5781d2[_0x24fc('0x42')]=qs['filters'](_[_0x24fc('0x43')](_0x316aa2[_0x24fc('0x3a')],_0x56a9bd[_0x24fc('0x38')]));if(_0x316aa2['query'][_0x24fc('0x44')]){_0x5781d2[_0x24fc('0x42')]=_['merge'](_0x5781d2[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x5d48fe,function(_0x158f7b){if(_0x158f7b[_0x24fc('0x46')]['key']!==_0x24fc('0x47')){var _0x9bc56a={};_0x9bc56a[_0x158f7b[_0x24fc('0x48')]]={'$like':'%'+_0x316aa2[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x9bc56a;}})});}_0x5781d2=_['merge']({},_0x5781d2,_0x316aa2[_0x24fc('0x49')]);var _0x1b9c90={'where':_0x5781d2[_0x24fc('0x42')]};return db[_0x24fc('0x34')]['count'](_0x1b9c90)[_0x24fc('0x1c')](function(_0x253358){_0xd52d10['count']=_0x253358;if(_0x316aa2['query'][_0x24fc('0x4a')]){_0x5781d2['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x24fc('0x4b')](_0x5781d2);})['then'](function(_0x281194){_0xd52d10[_0x24fc('0x4c')]=_0x281194;return _0xd52d10;})[_0x24fc('0x1c')](respondWithFilteredResult(_0x242bd5,_0x5781d2))['catch'](handleError(_0x242bd5,null));};exports[_0x24fc('0x4d')]=function(_0x23c1d4,_0x1b1f1c){var _0x1ad8d6={'raw':![],'where':{'id':_0x23c1d4[_0x24fc('0x4e')]['id']}},_0x39873d={};_0x39873d[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmConfiguration']['rawAttributes']);_0x39873d[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x23c1d4[_0x24fc('0x3a')]);_0x39873d['filters']=_['intersection'](_0x39873d[_0x24fc('0x36')],_0x39873d[_0x24fc('0x3a')]);_0x1ad8d6[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x39873d[_0x24fc('0x36')],qs[_0x24fc('0x3c')](_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x1ad8d6[_0x24fc('0x3b')]=_0x1ad8d6[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x1ad8d6[_0x24fc('0x3b')]:_0x39873d['model'];if(_0x23c1d4[_0x24fc('0x3a')][_0x24fc('0x4a')]){_0x1ad8d6[_0x24fc('0x4f')]=[{'all':!![]}];}_0x1ad8d6=_[_0x24fc('0x50')]({},_0x1ad8d6,_0x23c1d4[_0x24fc('0x49')]);return db['SugarcrmConfiguration'][_0x24fc('0x51')](_0x1ad8d6)['then'](handleEntityNotFound(_0x1b1f1c,null))[_0x24fc('0x1c')](respondWithResult(_0x1b1f1c,null))[_0x24fc('0x52')](handleError(_0x1b1f1c,null));};exports[_0x24fc('0x53')]=function(_0x41ddfb,_0x40f42b){return db[_0x24fc('0x34')]['create'](_0x41ddfb[_0x24fc('0x54')],{})[_0x24fc('0x1c')](respondWithResult(_0x40f42b,0xc9))[_0x24fc('0x52')](handleError(_0x40f42b,null));};exports[_0x24fc('0x2e')]=function(_0x28f799,_0x870767){if(_0x28f799['body']['id']){delete _0x28f799[_0x24fc('0x54')]['id'];}return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x28f799[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x870767,null))[_0x24fc('0x1c')](saveUpdates(_0x28f799[_0x24fc('0x54')],null))['then'](respondWithResult(_0x870767,null))[_0x24fc('0x52')](handleError(_0x870767,null));};exports[_0x24fc('0x2f')]=function(_0x4ae720,_0x1368f6){return db[_0x24fc('0x34')][_0x24fc('0x51')]({'where':{'id':_0x4ae720[_0x24fc('0x4e')]['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x1368f6,null))[_0x24fc('0x1c')](removeEntity(_0x1368f6,null))['catch'](handleError(_0x1368f6,null));};exports[_0x24fc('0x55')]=function(_0x4a0524,_0x3e9644,_0x8c9649){var _0x50e5b0={};var _0x435442={};var _0x5c1a92;var _0x1c1f74;return db['SugarcrmConfiguration'][_0x24fc('0x56')]({'where':{'id':_0x4a0524[_0x24fc('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3e9644,null))[_0x24fc('0x1c')](function(_0x5d6539){if(_0x5d6539){_0x5c1a92=_0x5d6539;_0x435442[_0x24fc('0x36')]=_[_0x24fc('0x37')](db['SugarcrmField'][_0x24fc('0x35')]);_0x435442[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x4a0524[_0x24fc('0x3a')]);_0x435442[_0x24fc('0x38')]=_['intersection'](_0x435442[_0x24fc('0x36')],_0x435442[_0x24fc('0x3a')]);_0x50e5b0[_0x24fc('0x3b')]=_[_0x24fc('0x39')](_0x435442[_0x24fc('0x36')],qs['fields'](_0x4a0524['query'][_0x24fc('0x3c')]));_0x50e5b0[_0x24fc('0x3b')]=_0x50e5b0['attributes']['length']?_0x50e5b0[_0x24fc('0x3b')]:_0x435442[_0x24fc('0x36')];_0x50e5b0[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4a0524['query'][_0x24fc('0x41')]);_0x50e5b0[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x4a0524[_0x24fc('0x3a')],_0x435442[_0x24fc('0x38')]));if(_0x4a0524[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x50e5b0[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x50e5b0[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x50e5b0[_0x24fc('0x3b')],function(_0x24ca4b){var _0x354fc6={};_0x354fc6[_0x24ca4b]={'$like':'%'+_0x4a0524['query'][_0x24fc('0x44')]+'%'};return _0x354fc6;})});}_0x50e5b0=_[_0x24fc('0x50')]({},_0x50e5b0,_0x4a0524[_0x24fc('0x49')]);return _0x5c1a92[_0x24fc('0x55')](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x2eb6dc){if(_0x2eb6dc){_0x1c1f74=_0x2eb6dc[_0x24fc('0x3d')];if(!_0x4a0524[_0x24fc('0x3a')]['hasOwnProperty'](_0x24fc('0x3f'))){_0x50e5b0[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x4a0524[_0x24fc('0x3a')]['limit']);_0x50e5b0[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x4a0524['query']['offset']);}return _0x5c1a92['getFields'](_0x50e5b0);}})[_0x24fc('0x1c')](function(_0x698283){if(_0x698283){return _0x698283?{'count':_0x1c1f74,'rows':_0x698283}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x3e9644,null))[_0x24fc('0x52')](handleError(_0x3e9644,null));};exports[_0x24fc('0x57')]=function(_0x1d0f06,_0x52e1aa,_0x11bafd){var _0x15e8a3={};var _0x5a2c09={};var _0x51b1c0;var _0xfc6b7f;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1d0f06['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0x52e1aa,null))[_0x24fc('0x1c')](function(_0x33f04e){if(_0x33f04e){_0x51b1c0=_0x33f04e;_0x5a2c09['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x5a2c09['query']=_[_0x24fc('0x37')](_0x1d0f06[_0x24fc('0x3a')]);_0x5a2c09[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5a2c09['model'],_0x5a2c09[_0x24fc('0x3a')]);_0x15e8a3['attributes']=_[_0x24fc('0x39')](_0x5a2c09['model'],qs[_0x24fc('0x3c')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x15e8a3[_0x24fc('0x3b')]=_0x15e8a3[_0x24fc('0x3b')][_0x24fc('0x3d')]?_0x15e8a3[_0x24fc('0x3b')]:_0x5a2c09['model'];_0x15e8a3[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1d0f06[_0x24fc('0x3a')]['sort']);_0x15e8a3['where']=qs[_0x24fc('0x38')](_[_0x24fc('0x43')](_0x1d0f06['query'],_0x5a2c09[_0x24fc('0x38')]));if(_0x1d0f06[_0x24fc('0x3a')]['filter']){_0x15e8a3[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x15e8a3['where'],{'$or':_[_0x24fc('0x45')](_0x15e8a3[_0x24fc('0x3b')],function(_0x24e717){var _0x1efe4e={};_0x1efe4e[_0x24e717]={'$like':'%'+_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x1efe4e;})});}_0x15e8a3=_['merge']({},_0x15e8a3,_0x1d0f06['options']);return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x29bd9f){if(_0x29bd9f){_0xfc6b7f=_0x29bd9f['length'];if(!_0x1d0f06['query'][_0x24fc('0x3e')](_0x24fc('0x3f'))){_0x15e8a3[_0x24fc('0x2a')]=qs[_0x24fc('0x2a')](_0x1d0f06[_0x24fc('0x3a')][_0x24fc('0x2a')]);_0x15e8a3[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1d0f06['query'][_0x24fc('0x29')]);}return _0x51b1c0[_0x24fc('0x57')](_0x15e8a3);}})['then'](function(_0x47e22f){if(_0x47e22f){return _0x47e22f?{'count':_0xfc6b7f,'rows':_0x47e22f}:null;}})[_0x24fc('0x1c')](respondWithResult(_0x52e1aa,null))[_0x24fc('0x52')](handleError(_0x52e1aa,null));};exports[_0x24fc('0x58')]=function(_0x1b2a97,_0xd1e6,_0x5de0ea){var _0x216781={};var _0xcb7986={};var _0x5ca35b;var _0x13ab57;return db[_0x24fc('0x34')][_0x24fc('0x56')]({'where':{'id':_0x1b2a97['params']['id']}})[_0x24fc('0x1c')](handleEntityNotFound(_0xd1e6,null))[_0x24fc('0x1c')](function(_0x3399fe){if(_0x3399fe){_0x5ca35b=_0x3399fe;_0xcb7986[_0x24fc('0x36')]=_[_0x24fc('0x37')](db[_0x24fc('0x59')][_0x24fc('0x35')]);_0xcb7986[_0x24fc('0x3a')]=_[_0x24fc('0x37')](_0x1b2a97['query']);_0xcb7986[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0xcb7986[_0x24fc('0x36')],_0xcb7986['query']);_0x216781['attributes']=_['intersection'](_0xcb7986[_0x24fc('0x36')],qs['fields'](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x3c')]));_0x216781['attributes']=_0x216781[_0x24fc('0x3b')]['length']?_0x216781[_0x24fc('0x3b')]:_0xcb7986['model'];_0x216781[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x41')]);_0x216781[_0x24fc('0x42')]=qs[_0x24fc('0x38')](_['pick'](_0x1b2a97[_0x24fc('0x3a')],_0xcb7986[_0x24fc('0x38')]));if(_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]){_0x216781[_0x24fc('0x42')]=_[_0x24fc('0x50')](_0x216781[_0x24fc('0x42')],{'$or':_[_0x24fc('0x45')](_0x216781[_0x24fc('0x3b')],function(_0x5f4ec2){var _0x2c9119={};_0x2c9119[_0x5f4ec2]={'$like':'%'+_0x1b2a97[_0x24fc('0x3a')][_0x24fc('0x44')]+'%'};return _0x2c9119;})});}_0x216781=_[_0x24fc('0x50')]({},_0x216781,_0x1b2a97['options']);return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0xc2be0f){if(_0xc2be0f){_0x13ab57=_0xc2be0f['length'];if(!_0x1b2a97[_0x24fc('0x3a')]['hasOwnProperty']('nolimit')){_0x216781['limit']=qs[_0x24fc('0x2a')](_0x1b2a97['query'][_0x24fc('0x2a')]);_0x216781[_0x24fc('0x29')]=qs[_0x24fc('0x29')](_0x1b2a97[_0x24fc('0x3a')]['offset']);}return _0x5ca35b[_0x24fc('0x58')](_0x216781);}})[_0x24fc('0x1c')](function(_0x3d8394){if(_0x3d8394){return _0x3d8394?{'count':_0x13ab57,'rows':_0x3d8394}:null;}})[_0x24fc('0x1c')](respondWithResult(_0xd1e6,null))[_0x24fc('0x52')](handleError(_0xd1e6,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 4ffcfc7..9b91c53 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 _0xc2c1=['./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0xc2c1,0x6c));var _0x1c2c=function(_0x268f7c,_0x59be02){_0x268f7c=_0x268f7c-0x0;var _0x1b6a77=_0xc2c1[_0x268f7c];return _0x1b6a77;};'use strict';var _=require(_0x1c2c('0x0'));var util=require('util');var logger=require(_0x1c2c('0x1'))(_0x1c2c('0x2'));var moment=require(_0x1c2c('0x3'));var BPromise=require(_0x1c2c('0x4'));var rp=require(_0x1c2c('0x5'));var fs=require('fs');var path=require(_0x1c2c('0x6'));var rimraf=require(_0x1c2c('0x7'));var config=require(_0x1c2c('0x8'));var attributes=require(_0x1c2c('0x9'));module[_0x1c2c('0xa')]=function(_0x21f719,_0x172dae){return _0x21f719[_0x1c2c('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0x1c2c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7c2d=['api','moment','bluebird','request-promise','./intSugarcrmConfiguration.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x3e29df,_0x42fdf8){var _0x3e3ba9=function(_0x47ccb0){while(--_0x47ccb0){_0x3e29df['push'](_0x3e29df['shift']());}};_0x3e3ba9(++_0x42fdf8);}(_0x7c2d,0x1a1));var _0xd7c2=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x7c2d[_0x38537f];return _0x141e23;};'use strict';var _=require(_0xd7c2('0x0'));var util=require(_0xd7c2('0x1'));var logger=require(_0xd7c2('0x2'))(_0xd7c2('0x3'));var moment=require(_0xd7c2('0x4'));var BPromise=require(_0xd7c2('0x5'));var rp=require(_0xd7c2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7c2('0x7'));module[_0xd7c2('0x8')]=function(_0x174364,_0x468b8f){return _0x174364[_0xd7c2('0x9')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','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 8aca38e..59abb02 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 _0xd2f9=['SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug'];(function(_0x4c5e87,_0x481e33){var _0x10c4f8=function(_0x5952e0){while(--_0x5952e0){_0x4c5e87['push'](_0x4c5e87['shift']());}};_0x10c4f8(++_0x481e33);}(_0xd2f9,0x19f));var _0x9d2f=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0xd2f9[_0x2cd1fb];return _0x48fd2b;};'use strict';var _=require(_0x9d2f('0x0'));var util=require(_0x9d2f('0x1'));var moment=require(_0x9d2f('0x2'));var BPromise=require(_0x9d2f('0x3'));var rs=require(_0x9d2f('0x4'));var fs=require('fs');var Redis=require(_0x9d2f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d2f('0x6'));var logger=require(_0x9d2f('0x7'))(_0x9d2f('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d2f('0x9'));var client=jayson[_0x9d2f('0xa')][_0x9d2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3bcd72,_0x2b40d1,_0x32890b){return new BPromise(function(_0x4a142f,_0x23013c){return client[_0x9d2f('0xc')](_0x3bcd72,_0x32890b)[_0x9d2f('0xd')](function(_0x195ea8){logger[_0x9d2f('0xe')](_0x9d2f('0xf'),_0x2b40d1,'request\x20sent');logger[_0x9d2f('0x10')](_0x9d2f('0x11'),_0x2b40d1,_0x9d2f('0x12'),JSON[_0x9d2f('0x13')](_0x195ea8));if(_0x195ea8[_0x9d2f('0x14')]){if(_0x195ea8[_0x9d2f('0x14')][_0x9d2f('0x15')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2b40d1,_0x195ea8[_0x9d2f('0x14')][_0x9d2f('0x16')]);return _0x23013c(_0x195ea8['error'][_0x9d2f('0x16')]);}logger[_0x9d2f('0x14')](_0x9d2f('0xf'),_0x2b40d1,_0x195ea8['error'][_0x9d2f('0x16')]);return _0x4a142f(_0x195ea8['error'][_0x9d2f('0x16')]);}else{logger['info'](_0x9d2f('0xf'),_0x2b40d1,_0x9d2f('0x12'));_0x4a142f(_0x195ea8['result'][_0x9d2f('0x16')]);}})[_0x9d2f('0x17')](function(_0x377d6e){logger[_0x9d2f('0x14')](_0x9d2f('0xf'),_0x2b40d1,_0x377d6e);_0x23013c(_0x377d6e);});});} \ No newline at end of file +var _0xd609=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','bluebird'];(function(_0x2a261d,_0x4857a8){var _0x56dab0=function(_0x4ffa14){while(--_0x4ffa14){_0x2a261d['push'](_0x2a261d['shift']());}};_0x56dab0(++_0x4857a8);}(_0xd609,0x184));var _0x9d60=function(_0x41a36f,_0xe248f0){_0x41a36f=_0x41a36f-0x0;var _0x27a295=_0xd609[_0x41a36f];return _0x27a295;};'use strict';var _=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var moment=require('moment');var BPromise=require(_0x9d60('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d60('0x3'))['db'];var utils=require(_0x9d60('0x4'));var logger=require(_0x9d60('0x5'))(_0x9d60('0x6'));var config=require(_0x9d60('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9d60('0x8')][_0x9d60('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x403091,_0x44490e,_0x2cfdb2){return new BPromise(function(_0x2ca90f,_0x2cf2f8){return client['request'](_0x403091,_0x2cfdb2)['then'](function(_0x1a2d16){logger[_0x9d60('0xa')](_0x9d60('0xb'),_0x44490e,'request\x20sent');logger['debug'](_0x9d60('0xc'),_0x44490e,_0x9d60('0xd'),JSON['stringify'](_0x1a2d16));if(_0x1a2d16['error']){if(_0x1a2d16['error']['code']===0x1f4){logger[_0x9d60('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x44490e,_0x1a2d16['error']['message']);return _0x2cf2f8(_0x1a2d16[_0x9d60('0xe')][_0x9d60('0xf')]);}logger[_0x9d60('0xe')](_0x9d60('0xb'),_0x44490e,_0x1a2d16['error'][_0x9d60('0xf')]);return _0x2ca90f(_0x1a2d16['error'][_0x9d60('0xf')]);}else{logger[_0x9d60('0xa')](_0x9d60('0xb'),_0x44490e,'request\x20sent');_0x2ca90f(_0x1a2d16['result'][_0x9d60('0xf')]);}})[_0x9d60('0x10')](function(_0x5e5eca){logger[_0x9d60('0xe')](_0x9d60('0xb'),_0x44490e,_0x5e5eca);_0x2cf2f8(_0x5e5eca);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 53c5404..6543156 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 _0x7acc=['get','index','/:id','isAuthenticated','post','create','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./intSugarcrmField.controller'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x7acc,0x199));var _0xc7ac=function(_0x5c905e,_0x10123a){_0x5c905e=_0x5c905e-0x0;var _0x37533d=_0x7acc[_0x5c905e];return _0x37533d;};'use strict';var multer=require('multer');var util=require(_0xc7ac('0x0'));var path=require(_0xc7ac('0x1'));var timeout=require(_0xc7ac('0x2'));var express=require(_0xc7ac('0x3'));var router=express[_0xc7ac('0x4')]();var auth=require(_0xc7ac('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc7ac('0x6'));router[_0xc7ac('0x7')]('/',auth['isAuthenticated'](),controller[_0xc7ac('0x8')]);router[_0xc7ac('0x7')](_0xc7ac('0x9'),auth[_0xc7ac('0xa')](),controller['show']);router[_0xc7ac('0xb')]('/',auth[_0xc7ac('0xa')](),controller[_0xc7ac('0xc')]);router[_0xc7ac('0xd')]('/:id',auth[_0xc7ac('0xa')](),controller['update']);router[_0xc7ac('0xe')](_0xc7ac('0x9'),auth[_0xc7ac('0xa')](),controller['destroy']);module[_0xc7ac('0xf')]=router; \ No newline at end of file +var _0x627f=['exports','path','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','index','get','/:id','isAuthenticated','show','post','create','update'];(function(_0x2cf7f3,_0x5b3ffc){var _0x17cb68=function(_0x3a41bd){while(--_0x3a41bd){_0x2cf7f3['push'](_0x2cf7f3['shift']());}};_0x17cb68(++_0x5b3ffc);}(_0x627f,0xb7));var _0xf627=function(_0x41d9a8,_0x386c27){_0x41d9a8=_0x41d9a8-0x0;var _0x146498=_0x627f[_0x41d9a8];return _0x146498;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf627('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf627('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xf627('0x2'));var config=require(_0xf627('0x3'));var controller=require(_0xf627('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xf627('0x5')]);router[_0xf627('0x6')](_0xf627('0x7'),auth[_0xf627('0x8')](),controller[_0xf627('0x9')]);router[_0xf627('0xa')]('/',auth[_0xf627('0x8')](),controller[_0xf627('0xb')]);router['put']('/:id',auth[_0xf627('0x8')](),controller[_0xf627('0xc')]);router['delete'](_0xf627('0x7'),auth[_0xf627('0x8')](),controller['destroy']);module[_0xf627('0xd')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 975c1fa..ad0ec9c 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 _0x5c00=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x565d4f,_0x5f4a79){var _0x71f90=function(_0x10a3d7){while(--_0x10a3d7){_0x565d4f['push'](_0x565d4f['shift']());}};_0x71f90(++_0x5f4a79);}(_0x5c00,0x17e));var _0x05c0=function(_0x41cdde,_0x4bd78c){_0x41cdde=_0x41cdde-0x0;var _0x2dec1e=_0x5c00[_0x41cdde];return _0x2dec1e;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'type':{'type':Sequelize[_0x05c0('0x2')]('string',_0x05c0('0x3'),'customVariable',_0x05c0('0x4')),'defaultValue':_0x05c0('0x5')},'content':{'type':Sequelize[_0x05c0('0x6')]},'key':{'type':Sequelize[_0x05c0('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x05c0('0x5'),_0x05c0('0x3'),_0x05c0('0x7'))},'keyContent':{'type':Sequelize[_0x05c0('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x05c0('0x6')]},'customField':{'type':Sequelize[_0x05c0('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x05c0('0x6')]}}; \ No newline at end of file +var _0x750a=['customVariable','keyValue','string','STRING','ENUM','exports','variable'];(function(_0x26d335,_0x1cd183){var _0x5b25b7=function(_0x3d0d8c){while(--_0x3d0d8c){_0x26d335['push'](_0x26d335['shift']());}};_0x5b25b7(++_0x1cd183);}(_0x750a,0x140));var _0xa750=function(_0x2d94b1,_0x29bbad){_0x2d94b1=_0x2d94b1-0x0;var _0x3a1d08=_0x750a[_0x2d94b1];return _0x3a1d08;};'use strict';var Sequelize=require('sequelize');module[_0xa750('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xa750('0x1'),_0xa750('0x2'),_0xa750('0x3')),'defaultValue':_0xa750('0x4')},'content':{'type':Sequelize[_0xa750('0x5')]},'key':{'type':Sequelize[_0xa750('0x5')]},'keyType':{'type':Sequelize[_0xa750('0x6')](_0xa750('0x4'),_0xa750('0x1'),_0xa750('0x2'))},'keyContent':{'type':Sequelize[_0xa750('0x5')]},'idField':{'type':Sequelize[_0xa750('0x5')]},'nameField':{'type':Sequelize[_0xa750('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index d7e39eb..2aa2f50 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 _0x0647=['rows','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','set','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','map','key','field','options','SugarcrmField','count','includeAll','findAll'];(function(_0x5f40f2,_0x4b4400){var _0x4677f3=function(_0x49e9d6){while(--_0x49e9d6){_0x5f40f2['push'](_0x5f40f2['shift']());}};_0x4677f3(++_0x4b4400);}(_0x0647,0x94));var _0x7064=function(_0x374ccf,_0xa945c4){_0x374ccf=_0x374ccf-0x0;var _0x443cde=_0x0647[_0x374ccf];return _0x443cde;};'use strict';var pdf=require(_0x7064('0x0'));var emlformat=require(_0x7064('0x1'));var rimraf=require(_0x7064('0x2'));var zipdir=require(_0x7064('0x3'));var jsonpatch=require(_0x7064('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7064('0x5'));var util=require(_0x7064('0x6'));var path=require('path');var sox=require(_0x7064('0x7'));var csv=require(_0x7064('0x8'));var ejs=require(_0x7064('0x9'));var fs=require('fs');var _=require(_0x7064('0xa'));var squel=require(_0x7064('0xb'));var crypto=require(_0x7064('0xc'));var jsforce=require(_0x7064('0xd'));var deskjs=require(_0x7064('0xe'));var toCsv=require(_0x7064('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7064('0xf'));var hardwareService=require(_0x7064('0x10'));var logger=require('../../config/logger')(_0x7064('0x11'));var utils=require(_0x7064('0x12'));var config=require(_0x7064('0x13'));var db=require(_0x7064('0x14'))['db'];function respondWithStatusCode(_0x2630c1,_0x46ea3b){_0x46ea3b=_0x46ea3b||0xcc;return function(_0x45f889){if(_0x45f889){return _0x2630c1[_0x7064('0x15')](_0x46ea3b);}return _0x2630c1['status'](_0x46ea3b)[_0x7064('0x16')]();};}function respondWithResult(_0x11c42e,_0x49530b){_0x49530b=_0x49530b||0xc8;return function(_0x1c0c20){if(_0x1c0c20){return _0x11c42e[_0x7064('0x17')](_0x49530b)[_0x7064('0x18')](_0x1c0c20);}};}function respondWithFilteredResult(_0x4fa010,_0x14302f){return function(_0x32f7c3){if(_0x32f7c3){var _0x1a170f=_0x32f7c3['count'],_0x3d72a5=_0x14302f[_0x7064('0x19')],_0x870d6b=_0x14302f['offset']+_0x14302f['limit'],_0x5da92b;if(_0x870d6b>=_0x1a170f){_0x870d6b=_0x1a170f;_0x5da92b=0xc8;}else{_0x5da92b=0xce;}_0x4fa010[_0x7064('0x17')](_0x5da92b);return _0x4fa010[_0x7064('0x1a')]('Content-Range',_0x3d72a5+'-'+_0x870d6b+'/'+_0x1a170f)[_0x7064('0x18')](_0x32f7c3);}return null;};}function patchUpdates(_0x1408a1){return function(_0x59c257){try{jsonpatch[_0x7064('0x1b')](_0x59c257,_0x1408a1,!![]);}catch(_0x42630c){return BPromise['reject'](_0x42630c);}return _0x59c257[_0x7064('0x1c')]();};}function saveUpdates(_0x21a120,_0x8ef45c){return function(_0x47f1eb){if(_0x47f1eb){return _0x47f1eb[_0x7064('0x1d')](_0x21a120)[_0x7064('0x1e')](function(_0x241944){return _0x241944;});}return null;};}function removeEntity(_0x4dd76c,_0x154221){return function(_0x2a2e96){if(_0x2a2e96){return _0x2a2e96[_0x7064('0x1f')]()['then'](function(){_0x4dd76c[_0x7064('0x17')](0xcc)[_0x7064('0x16')]();});}};}function handleEntityNotFound(_0x2c480a,_0x497ed3){return function(_0x2ba8fc){if(!_0x2ba8fc){_0x2c480a[_0x7064('0x15')](0x194);}return _0x2ba8fc;};}function handleError(_0x50561a,_0x107c2e){_0x107c2e=_0x107c2e||0x1f4;return function(_0x3186a4){logger['error'](_0x3186a4[_0x7064('0x20')]);if(_0x3186a4[_0x7064('0x21')]){delete _0x3186a4['name'];}_0x50561a[_0x7064('0x17')](_0x107c2e)[_0x7064('0x22')](_0x3186a4);};}exports[_0x7064('0x23')]=function(_0x5b1d31,_0x91adf){var _0xc2d009={},_0x37a481={},_0x1251bb={'count':0x0,'rows':[]};var _0x427cbf=db['SugarcrmField'][_0x7064('0x24')];_0x37a481[_0x7064('0x25')]=_[_0x7064('0x26')](_0x427cbf);_0x37a481['query']=_[_0x7064('0x26')](_0x5b1d31[_0x7064('0x27')]);_0x37a481[_0x7064('0x28')]=_['intersection'](_0x37a481['model'],_0x37a481[_0x7064('0x27')]);_0xc2d009[_0x7064('0x29')]=_[_0x7064('0x2a')](_0x37a481[_0x7064('0x25')],qs[_0x7064('0x2b')](_0x5b1d31[_0x7064('0x27')][_0x7064('0x2b')]));_0xc2d009['attributes']=_0xc2d009[_0x7064('0x29')][_0x7064('0x2c')]?_0xc2d009[_0x7064('0x29')]:_0x37a481[_0x7064('0x25')];if(!_0x5b1d31[_0x7064('0x27')][_0x7064('0x2d')](_0x7064('0x2e'))){_0xc2d009[_0x7064('0x2f')]=qs[_0x7064('0x2f')](_0x5b1d31[_0x7064('0x27')][_0x7064('0x2f')]);_0xc2d009[_0x7064('0x19')]=qs[_0x7064('0x19')](_0x5b1d31[_0x7064('0x27')][_0x7064('0x19')]);}_0xc2d009[_0x7064('0x30')]=qs['sort'](_0x5b1d31['query'][_0x7064('0x31')]);_0xc2d009['where']=qs['filters'](_[_0x7064('0x32')](_0x5b1d31[_0x7064('0x27')],_0x37a481[_0x7064('0x28')]));if(_0x5b1d31[_0x7064('0x27')][_0x7064('0x33')]){_0xc2d009[_0x7064('0x34')]=_[_0x7064('0x35')](_0xc2d009[_0x7064('0x34')],{'$or':_[_0x7064('0x36')](_0x427cbf,function(_0x16c7d6){if(_0x16c7d6['type'][_0x7064('0x37')]!=='VIRTUAL'){var _0x3bee3f={};_0x3bee3f[_0x16c7d6[_0x7064('0x38')]]={'$like':'%'+_0x5b1d31['query'][_0x7064('0x33')]+'%'};return _0x3bee3f;}})});}_0xc2d009=_[_0x7064('0x35')]({},_0xc2d009,_0x5b1d31[_0x7064('0x39')]);var _0x5cea22={'where':_0xc2d009[_0x7064('0x34')]};return db[_0x7064('0x3a')]['count'](_0x5cea22)['then'](function(_0x3d901e){_0x1251bb[_0x7064('0x3b')]=_0x3d901e;if(_0x5b1d31[_0x7064('0x27')][_0x7064('0x3c')]){_0xc2d009['include']=[{'all':!![]}];}return db[_0x7064('0x3a')][_0x7064('0x3d')](_0xc2d009);})['then'](function(_0x206ac6){_0x1251bb[_0x7064('0x3e')]=_0x206ac6;return _0x1251bb;})[_0x7064('0x1e')](respondWithFilteredResult(_0x91adf,_0xc2d009))[_0x7064('0x3f')](handleError(_0x91adf,null));};exports[_0x7064('0x40')]=function(_0x28ab98,_0x3fbc7e){var _0x330727={'raw':!![],'where':{'id':_0x28ab98[_0x7064('0x41')]['id']}},_0x54a6fc={};_0x54a6fc[_0x7064('0x25')]=_[_0x7064('0x26')](db[_0x7064('0x3a')][_0x7064('0x24')]);_0x54a6fc['query']=_[_0x7064('0x26')](_0x28ab98[_0x7064('0x27')]);_0x54a6fc[_0x7064('0x28')]=_['intersection'](_0x54a6fc[_0x7064('0x25')],_0x54a6fc[_0x7064('0x27')]);_0x330727['attributes']=_[_0x7064('0x2a')](_0x54a6fc[_0x7064('0x25')],qs[_0x7064('0x2b')](_0x28ab98[_0x7064('0x27')]['fields']));_0x330727['attributes']=_0x330727[_0x7064('0x29')][_0x7064('0x2c')]?_0x330727[_0x7064('0x29')]:_0x54a6fc[_0x7064('0x25')];if(_0x28ab98[_0x7064('0x27')][_0x7064('0x3c')]){_0x330727[_0x7064('0x42')]=[{'all':!![]}];}_0x330727=_[_0x7064('0x35')]({},_0x330727,_0x28ab98[_0x7064('0x39')]);return db[_0x7064('0x3a')][_0x7064('0x43')](_0x330727)[_0x7064('0x1e')](handleEntityNotFound(_0x3fbc7e,null))['then'](respondWithResult(_0x3fbc7e,null))[_0x7064('0x3f')](handleError(_0x3fbc7e,null));};exports[_0x7064('0x44')]=function(_0x4dee4b,_0x1274fc){return db[_0x7064('0x3a')][_0x7064('0x44')](_0x4dee4b['body'],{})['then'](respondWithResult(_0x1274fc,0xc9))[_0x7064('0x3f')](handleError(_0x1274fc,null));};exports[_0x7064('0x1d')]=function(_0x31b813,_0x59a0f0){if(_0x31b813[_0x7064('0x45')]['id']){delete _0x31b813[_0x7064('0x45')]['id'];}return db[_0x7064('0x3a')]['find']({'where':{'id':_0x31b813[_0x7064('0x41')]['id']}})[_0x7064('0x1e')](handleEntityNotFound(_0x59a0f0,null))[_0x7064('0x1e')](saveUpdates(_0x31b813['body'],null))[_0x7064('0x1e')](respondWithResult(_0x59a0f0,null))[_0x7064('0x3f')](handleError(_0x59a0f0,null));};exports['destroy']=function(_0x311ae9,_0xfc33f3){return db[_0x7064('0x3a')]['find']({'where':{'id':_0x311ae9[_0x7064('0x41')]['id']}})['then'](handleEntityNotFound(_0xfc33f3,null))[_0x7064('0x1e')](removeEntity(_0xfc33f3,null))[_0x7064('0x3f')](handleError(_0xfc33f3,null));}; \ No newline at end of file +var _0xbcdb=['map','type','key','field','options','include','then','rows','catch','show','rawAttributes','length','includeAll','create','body','find','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','error','stack','name','send','index','SugarcrmField','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0xab41a6,_0x46b9f0){var _0x5cda36=function(_0x4228e7){while(--_0x4228e7){_0xab41a6['push'](_0xab41a6['shift']());}};_0x5cda36(++_0x46b9f0);}(_0xbcdb,0xa8));var _0xbbcd=function(_0x2808c3,_0xfbf446){_0x2808c3=_0x2808c3-0x0;var _0x490a96=_0xbcdb[_0x2808c3];return _0x490a96;};'use strict';var pdf=require(_0xbbcd('0x0'));var emlformat=require(_0xbbcd('0x1'));var rimraf=require(_0xbbcd('0x2'));var zipdir=require(_0xbbcd('0x3'));var jsonpatch=require(_0xbbcd('0x4'));var rp=require(_0xbbcd('0x5'));var moment=require('moment');var BPromise=require(_0xbbcd('0x6'));var Mustache=require('mustache');var util=require(_0xbbcd('0x7'));var path=require(_0xbbcd('0x8'));var sox=require('sox');var csv=require(_0xbbcd('0x9'));var ejs=require(_0xbbcd('0xa'));var fs=require('fs');var _=require(_0xbbcd('0xb'));var squel=require('squel');var crypto=require(_0xbbcd('0xc'));var jsforce=require(_0xbbcd('0xd'));var deskjs=require(_0xbbcd('0xe'));var toCsv=require(_0xbbcd('0x9'));var querystring=require(_0xbbcd('0xf'));var Papa=require(_0xbbcd('0x10'));var Redis=require('ioredis');var authService=require(_0xbbcd('0x11'));var qs=require(_0xbbcd('0x12'));var hardwareService=require(_0xbbcd('0x13'));var logger=require(_0xbbcd('0x14'))(_0xbbcd('0x15'));var utils=require(_0xbbcd('0x16'));var config=require(_0xbbcd('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52e8a9,_0x3a462e){_0x3a462e=_0x3a462e||0xcc;return function(_0x201af4){if(_0x201af4){return _0x52e8a9[_0xbbcd('0x18')](_0x3a462e);}return _0x52e8a9[_0xbbcd('0x19')](_0x3a462e)[_0xbbcd('0x1a')]();};}function respondWithResult(_0x4cfe60,_0x100cbe){_0x100cbe=_0x100cbe||0xc8;return function(_0x42ee94){if(_0x42ee94){return _0x4cfe60[_0xbbcd('0x19')](_0x100cbe)[_0xbbcd('0x1b')](_0x42ee94);}};}function respondWithFilteredResult(_0x51a01e,_0x282937){return function(_0x134b64){if(_0x134b64){var _0x1df67a=_0x134b64[_0xbbcd('0x1c')],_0x3d573c=_0x282937['offset'],_0x4eccfa=_0x282937[_0xbbcd('0x1d')]+_0x282937[_0xbbcd('0x1e')],_0x191901;if(_0x4eccfa>=_0x1df67a){_0x4eccfa=_0x1df67a;_0x191901=0xc8;}else{_0x191901=0xce;}_0x51a01e[_0xbbcd('0x19')](_0x191901);return _0x51a01e[_0xbbcd('0x1f')](_0xbbcd('0x20'),_0x3d573c+'-'+_0x4eccfa+'/'+_0x1df67a)['json'](_0x134b64);}return null;};}function patchUpdates(_0x4a87c9){return function(_0x41a0e9){try{jsonpatch[_0xbbcd('0x21')](_0x41a0e9,_0x4a87c9,!![]);}catch(_0x423169){return BPromise['reject'](_0x423169);}return _0x41a0e9[_0xbbcd('0x22')]();};}function saveUpdates(_0x4b3a66,_0x1c1b78){return function(_0x56de41){if(_0x56de41){return _0x56de41[_0xbbcd('0x23')](_0x4b3a66)['then'](function(_0x4a2b6b){return _0x4a2b6b;});}return null;};}function removeEntity(_0x23767a,_0x1f1351){return function(_0x3a94d1){if(_0x3a94d1){return _0x3a94d1['destroy']()['then'](function(){_0x23767a['status'](0xcc)[_0xbbcd('0x1a')]();});}};}function handleEntityNotFound(_0x4edbfe,_0x2bafbe){return function(_0x216878){if(!_0x216878){_0x4edbfe[_0xbbcd('0x18')](0x194);}return _0x216878;};}function handleError(_0x5a1a70,_0x3f578d){_0x3f578d=_0x3f578d||0x1f4;return function(_0x1d0f1d){logger[_0xbbcd('0x24')](_0x1d0f1d[_0xbbcd('0x25')]);if(_0x1d0f1d[_0xbbcd('0x26')]){delete _0x1d0f1d[_0xbbcd('0x26')];}_0x5a1a70[_0xbbcd('0x19')](_0x3f578d)[_0xbbcd('0x27')](_0x1d0f1d);};}exports[_0xbbcd('0x28')]=function(_0x5c35f1,_0x4863be){var _0xa65ba6={},_0x25e17b={},_0x53fc6d={'count':0x0,'rows':[]};var _0x256ce2=db[_0xbbcd('0x29')]['rawAttributes'];_0x25e17b[_0xbbcd('0x2a')]=_[_0xbbcd('0x2b')](_0x256ce2);_0x25e17b[_0xbbcd('0x2c')]=_[_0xbbcd('0x2b')](_0x5c35f1[_0xbbcd('0x2c')]);_0x25e17b['filters']=_[_0xbbcd('0x2d')](_0x25e17b[_0xbbcd('0x2a')],_0x25e17b[_0xbbcd('0x2c')]);_0xa65ba6[_0xbbcd('0x2e')]=_['intersection'](_0x25e17b[_0xbbcd('0x2a')],qs[_0xbbcd('0x2f')](_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x2f')]));_0xa65ba6[_0xbbcd('0x2e')]=_0xa65ba6[_0xbbcd('0x2e')]['length']?_0xa65ba6[_0xbbcd('0x2e')]:_0x25e17b[_0xbbcd('0x2a')];if(!_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x30')](_0xbbcd('0x31'))){_0xa65ba6[_0xbbcd('0x1e')]=qs[_0xbbcd('0x1e')](_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x1e')]);_0xa65ba6['offset']=qs['offset'](_0x5c35f1[_0xbbcd('0x2c')]['offset']);}_0xa65ba6[_0xbbcd('0x32')]=qs[_0xbbcd('0x33')](_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x33')]);_0xa65ba6[_0xbbcd('0x34')]=qs[_0xbbcd('0x35')](_[_0xbbcd('0x36')](_0x5c35f1[_0xbbcd('0x2c')],_0x25e17b['filters']));if(_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x37')]){_0xa65ba6[_0xbbcd('0x34')]=_[_0xbbcd('0x38')](_0xa65ba6[_0xbbcd('0x34')],{'$or':_[_0xbbcd('0x39')](_0x256ce2,function(_0x5897a8){if(_0x5897a8[_0xbbcd('0x3a')][_0xbbcd('0x3b')]!=='VIRTUAL'){var _0x127a76={};_0x127a76[_0x5897a8[_0xbbcd('0x3c')]]={'$like':'%'+_0x5c35f1[_0xbbcd('0x2c')][_0xbbcd('0x37')]+'%'};return _0x127a76;}})});}_0xa65ba6=_[_0xbbcd('0x38')]({},_0xa65ba6,_0x5c35f1[_0xbbcd('0x3d')]);var _0x5a5857={'where':_0xa65ba6[_0xbbcd('0x34')]};return db['SugarcrmField'][_0xbbcd('0x1c')](_0x5a5857)['then'](function(_0x57de42){_0x53fc6d['count']=_0x57de42;if(_0x5c35f1[_0xbbcd('0x2c')]['includeAll']){_0xa65ba6[_0xbbcd('0x3e')]=[{'all':!![]}];}return db[_0xbbcd('0x29')]['findAll'](_0xa65ba6);})[_0xbbcd('0x3f')](function(_0x27d3b2){_0x53fc6d[_0xbbcd('0x40')]=_0x27d3b2;return _0x53fc6d;})[_0xbbcd('0x3f')](respondWithFilteredResult(_0x4863be,_0xa65ba6))[_0xbbcd('0x41')](handleError(_0x4863be,null));};exports[_0xbbcd('0x42')]=function(_0x4d41ea,_0x35ea0f){var _0x1fa1cc={'raw':!![],'where':{'id':_0x4d41ea['params']['id']}},_0x137db2={};_0x137db2['model']=_[_0xbbcd('0x2b')](db[_0xbbcd('0x29')][_0xbbcd('0x43')]);_0x137db2[_0xbbcd('0x2c')]=_[_0xbbcd('0x2b')](_0x4d41ea['query']);_0x137db2[_0xbbcd('0x35')]=_[_0xbbcd('0x2d')](_0x137db2[_0xbbcd('0x2a')],_0x137db2[_0xbbcd('0x2c')]);_0x1fa1cc[_0xbbcd('0x2e')]=_[_0xbbcd('0x2d')](_0x137db2[_0xbbcd('0x2a')],qs[_0xbbcd('0x2f')](_0x4d41ea[_0xbbcd('0x2c')]['fields']));_0x1fa1cc[_0xbbcd('0x2e')]=_0x1fa1cc['attributes'][_0xbbcd('0x44')]?_0x1fa1cc[_0xbbcd('0x2e')]:_0x137db2[_0xbbcd('0x2a')];if(_0x4d41ea[_0xbbcd('0x2c')][_0xbbcd('0x45')]){_0x1fa1cc['include']=[{'all':!![]}];}_0x1fa1cc=_['merge']({},_0x1fa1cc,_0x4d41ea['options']);return db[_0xbbcd('0x29')]['find'](_0x1fa1cc)[_0xbbcd('0x3f')](handleEntityNotFound(_0x35ea0f,null))[_0xbbcd('0x3f')](respondWithResult(_0x35ea0f,null))[_0xbbcd('0x41')](handleError(_0x35ea0f,null));};exports[_0xbbcd('0x46')]=function(_0x3fd691,_0x3fea6b){return db[_0xbbcd('0x29')][_0xbbcd('0x46')](_0x3fd691[_0xbbcd('0x47')],{})[_0xbbcd('0x3f')](respondWithResult(_0x3fea6b,0xc9))[_0xbbcd('0x41')](handleError(_0x3fea6b,null));};exports[_0xbbcd('0x23')]=function(_0x3d93d3,_0x237603){if(_0x3d93d3['body']['id']){delete _0x3d93d3['body']['id'];}return db[_0xbbcd('0x29')][_0xbbcd('0x48')]({'where':{'id':_0x3d93d3[_0xbbcd('0x49')]['id']}})[_0xbbcd('0x3f')](handleEntityNotFound(_0x237603,null))[_0xbbcd('0x3f')](saveUpdates(_0x3d93d3[_0xbbcd('0x47')],null))[_0xbbcd('0x3f')](respondWithResult(_0x237603,null))[_0xbbcd('0x41')](handleError(_0x237603,null));};exports[_0xbbcd('0x4a')]=function(_0x524122,_0xf1ec2){return db[_0xbbcd('0x29')]['find']({'where':{'id':_0x524122['params']['id']}})[_0xbbcd('0x3f')](handleEntityNotFound(_0xf1ec2,null))['then'](removeEntity(_0xf1ec2,null))[_0xbbcd('0x41')](handleError(_0xf1ec2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 7879634..691c22d 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 _0x08b0=['FieldId','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','define','SugarcrmField','int_sugarcrm_fields','idField'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0x08b0,0x1a5));var _0x008b=function(_0x1de2bd,_0x953fb){_0x1de2bd=_0x1de2bd-0x0;var _0x595960=_0x08b0[_0x1de2bd];return _0x595960;};'use strict';var _=require('lodash');var util=require(_0x008b('0x0'));var logger=require(_0x008b('0x1'))(_0x008b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x008b('0x3'));var fs=require('fs');var path=require(_0x008b('0x4'));var rimraf=require(_0x008b('0x5'));var config=require(_0x008b('0x6'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x72031b,_0x4816f8){return _0x72031b[_0x008b('0x7')](_0x008b('0x8'),attributes,{'tableName':_0x008b('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x008b('0xa'),_0x008b('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf744=['api','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','sugarcrm_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x47397f,_0x45ba05){var _0xba5ff1=function(_0x4e139a){while(--_0x4e139a){_0x47397f['push'](_0x47397f['shift']());}};_0xba5ff1(++_0x45ba05);}(_0xf744,0x1be));var _0x4f74=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xf744[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require('lodash');var util=require(_0x4f74('0x0'));var logger=require(_0x4f74('0x1'))(_0x4f74('0x2'));var moment=require('moment');var BPromise=require(_0x4f74('0x3'));var rp=require(_0x4f74('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4f74('0x5'));var config=require(_0x4f74('0x6'));var attributes=require(_0x4f74('0x7'));module[_0x4f74('0x8')]=function(_0x13bb65,_0x40569d){return _0x13bb65[_0x4f74('0x9')](_0x4f74('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x4f74('0xb'),'fields':[_0x4f74('0xc'),_0x4f74('0xd')],'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 c6e757b..f640dea 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 _0x1302=['request','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0xaecdf7,_0x343d28){var _0x5e32dd=function(_0x36ab64){while(--_0x36ab64){_0xaecdf7['push'](_0xaecdf7['shift']());}};_0x5e32dd(++_0x343d28);}(_0x1302,0x109));var _0x2130=function(_0xd38e7a,_0x2b344f){_0xd38e7a=_0xd38e7a-0x0;var _0x55ca75=_0x1302[_0xd38e7a];return _0x55ca75;};'use strict';var _=require(_0x2130('0x0'));var util=require(_0x2130('0x1'));var moment=require(_0x2130('0x2'));var BPromise=require('bluebird');var rs=require(_0x2130('0x3'));var fs=require('fs');var Redis=require(_0x2130('0x4'));var db=require(_0x2130('0x5'))['db'];var utils=require(_0x2130('0x6'));var logger=require('../../config/logger')(_0x2130('0x7'));var config=require(_0x2130('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2130('0x9')][_0x2130('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e2019,_0x2d8003,_0x13797f){return new BPromise(function(_0x4f85d3,_0x2a48a3){return client[_0x2130('0xb')](_0x5e2019,_0x13797f)['then'](function(_0x28729a){logger['info'](_0x2130('0xc'),_0x2d8003,_0x2130('0xd'));logger[_0x2130('0xe')](_0x2130('0xf'),_0x2d8003,'request\x20sent',JSON[_0x2130('0x10')](_0x28729a));if(_0x28729a[_0x2130('0x11')]){if(_0x28729a[_0x2130('0x11')][_0x2130('0x12')]===0x1f4){logger[_0x2130('0x11')](_0x2130('0xc'),_0x2d8003,_0x28729a[_0x2130('0x11')]['message']);return _0x2a48a3(_0x28729a[_0x2130('0x11')][_0x2130('0x13')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2d8003,_0x28729a[_0x2130('0x11')]['message']);return _0x4f85d3(_0x28729a[_0x2130('0x11')][_0x2130('0x13')]);}else{logger[_0x2130('0x14')](_0x2130('0xc'),_0x2d8003,_0x2130('0xd'));_0x4f85d3(_0x28729a[_0x2130('0x15')][_0x2130('0x13')]);}})[_0x2130('0x16')](function(_0x4c0cdc){logger[_0x2130('0x11')](_0x2130('0xc'),_0x2d8003,_0x4c0cdc);_0x2a48a3(_0x4c0cdc);});});} \ No newline at end of file +var _0x501c=['SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x113664,_0x43c8ca){var _0x4210f4=function(_0x3d2f51){while(--_0x3d2f51){_0x113664['push'](_0x113664['shift']());}};_0x4210f4(++_0x43c8ca);}(_0x501c,0x7a));var _0xc501=function(_0x4d446d,_0x289bbd){_0x4d446d=_0x4d446d-0x0;var _0x3314e8=_0x501c[_0x4d446d];return _0x3314e8;};'use strict';var _=require(_0xc501('0x0'));var util=require(_0xc501('0x1'));var moment=require(_0xc501('0x2'));var BPromise=require(_0xc501('0x3'));var rs=require(_0xc501('0x4'));var fs=require('fs');var Redis=require(_0xc501('0x5'));var db=require(_0xc501('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc501('0x7'))(_0xc501('0x8'));var config=require(_0xc501('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc501('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27e026,_0x42227b,_0xcd0c08){return new BPromise(function(_0xbbb1e7,_0x16101d){return client[_0xc501('0xb')](_0x27e026,_0xcd0c08)[_0xc501('0xc')](function(_0x39fb82){logger[_0xc501('0xd')](_0xc501('0xe'),_0x42227b,'request\x20sent');logger[_0xc501('0xf')](_0xc501('0x10'),_0x42227b,_0xc501('0x11'),JSON['stringify'](_0x39fb82));if(_0x39fb82[_0xc501('0x12')]){if(_0x39fb82[_0xc501('0x12')][_0xc501('0x13')]===0x1f4){logger[_0xc501('0x12')](_0xc501('0xe'),_0x42227b,_0x39fb82[_0xc501('0x12')][_0xc501('0x14')]);return _0x16101d(_0x39fb82['error'][_0xc501('0x14')]);}logger[_0xc501('0x12')](_0xc501('0xe'),_0x42227b,_0x39fb82[_0xc501('0x12')][_0xc501('0x14')]);return _0xbbb1e7(_0x39fb82[_0xc501('0x12')][_0xc501('0x14')]);}else{logger[_0xc501('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x42227b,_0xc501('0x11'));_0xbbb1e7(_0x39fb82[_0xc501('0x15')][_0xc501('0x14')]);}})[_0xc501('0x16')](function(_0x42f213){logger['error'](_0xc501('0xe'),_0x42227b,_0x42f213);_0x16101d(_0x42f213);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a64d130..f9030eb 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 _0xf094=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2d02a5,_0x456e7f){var _0x5d4a1a=function(_0xe6ecdd){while(--_0xe6ecdd){_0x2d02a5['push'](_0x2d02a5['shift']());}};_0x5d4a1a(++_0x456e7f);}(_0xf094,0x1d0));var _0x4f09=function(_0x49588f,_0x3e56ea){_0x49588f=_0x49588f-0x0;var _0x41b293=_0xf094[_0x49588f];return _0x41b293;};'use strict';var multer=require(_0x4f09('0x0'));var util=require(_0x4f09('0x1'));var path=require(_0x4f09('0x2'));var timeout=require(_0x4f09('0x3'));var express=require(_0x4f09('0x4'));var router=express[_0x4f09('0x5')]();var auth=require(_0x4f09('0x6'));var interaction=require(_0x4f09('0x7'));var config=require(_0x4f09('0x8'));var controller=require(_0x4f09('0x9'));router[_0x4f09('0xa')]('/',auth[_0x4f09('0xb')](),controller[_0x4f09('0xc')]);router[_0x4f09('0xa')]('/:id',auth[_0x4f09('0xb')](),controller[_0x4f09('0xd')]);router[_0x4f09('0xa')](_0x4f09('0xe'),auth[_0x4f09('0xb')](),controller[_0x4f09('0xf')]);router[_0x4f09('0xa')](_0x4f09('0x10'),auth[_0x4f09('0xb')](),controller[_0x4f09('0x11')]);router[_0x4f09('0x12')]('/',auth[_0x4f09('0xb')](),controller[_0x4f09('0x13')]);router[_0x4f09('0x12')](_0x4f09('0xe'),auth[_0x4f09('0xb')](),controller[_0x4f09('0x14')]);router[_0x4f09('0x15')](_0x4f09('0x16'),auth[_0x4f09('0xb')](),controller[_0x4f09('0x17')]);router[_0x4f09('0x18')](_0x4f09('0x16'),auth[_0x4f09('0xb')](),controller[_0x4f09('0x19')]);module['exports']=router; \ No newline at end of file +var _0x5ab4=['index','get','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x10b317,_0x2adf32){var _0x1e3054=function(_0x38ed3e){while(--_0x38ed3e){_0x10b317['push'](_0x10b317['shift']());}};_0x1e3054(++_0x2adf32);}(_0x5ab4,0x12b));var _0x45ab=function(_0x2b8a28,_0x1dd421){_0x2b8a28=_0x2b8a28-0x0;var _0x1299bd=_0x5ab4[_0x2b8a28];return _0x1299bd;};'use strict';var multer=require(_0x45ab('0x0'));var util=require(_0x45ab('0x1'));var path=require(_0x45ab('0x2'));var timeout=require(_0x45ab('0x3'));var express=require(_0x45ab('0x4'));var router=express['Router']();var auth=require(_0x45ab('0x5'));var interaction=require(_0x45ab('0x6'));var config=require(_0x45ab('0x7'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x45ab('0x8')](),controller[_0x45ab('0x9')]);router[_0x45ab('0xa')]('/:id',auth[_0x45ab('0x8')](),controller[_0x45ab('0xb')]);router[_0x45ab('0xa')](_0x45ab('0xc'),auth[_0x45ab('0x8')](),controller['getConfigurations']);router[_0x45ab('0xa')](_0x45ab('0xd'),auth['isAuthenticated'](),controller[_0x45ab('0xe')]);router[_0x45ab('0xf')]('/',auth[_0x45ab('0x8')](),controller['create']);router['post'](_0x45ab('0xc'),auth[_0x45ab('0x8')](),controller[_0x45ab('0x10')]);router['put'](_0x45ab('0x11'),auth[_0x45ab('0x8')](),controller[_0x45ab('0x12')]);router[_0x45ab('0x13')](_0x45ab('0x11'),auth[_0x45ab('0x8')](),controller[_0x45ab('0x14')]);module[_0x45ab('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index cd490bf..728cd56 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 _0x6b3d=['HelpDesk','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6b3d,0x1a2));var _0xd6b3=function(_0x4eedb2,_0x42c960){_0x4eedb2=_0x4eedb2-0x0;var _0x2f73a0=_0x6b3d[_0x4eedb2];return _0x2f73a0;};'use strict';var Sequelize=require(_0xd6b3('0x0'));module['exports']={'name':{'type':Sequelize[_0xd6b3('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd6b3('0x1')]},'username':{'type':Sequelize[_0xd6b3('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xd6b3('0x1')],'allowNull':![],'defaultValue':_0xd6b3('0x2')},'remoteUri':{'type':Sequelize[_0xd6b3('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xd6b3('0x1')]},'accessKey':{'type':Sequelize[_0xd6b3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x82a8=['STRING','sequelize','exports'];(function(_0x5d9a46,_0x2d4360){var _0x1a8790=function(_0x3a5281){while(--_0x3a5281){_0x5d9a46['push'](_0x5d9a46['shift']());}};_0x1a8790(++_0x2d4360);}(_0x82a8,0xcd));var _0x882a=function(_0x4fd805,_0x46dee4){_0x4fd805=_0x4fd805-0x0;var _0x4e9bbd=_0x82a8[_0x4fd805];return _0x4e9bbd;};'use strict';var Sequelize=require(_0x882a('0x0'));module[_0x882a('0x1')]={'name':{'type':Sequelize[_0x882a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x882a('0x2')]},'username':{'type':Sequelize[_0x882a('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x882a('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x882a('0x2')]},'accessKey':{'type':Sequelize[_0x882a('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 032cf09..fb9242d 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 _0xe3cc=['POST','login','token','owner','includes','editable','false','startsWith','cf_','picklistValues','label','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','VtigerAccount,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','destroy','stack','name','VtigerAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','findAll','rows','show','params','length','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success'];(function(_0x3aeae6,_0x201d94){var _0xc3594=function(_0x585f54){while(--_0x585f54){_0x3aeae6['push'](_0x3aeae6['shift']());}};_0xc3594(++_0x201d94);}(_0xe3cc,0x8b));var _0xce3c=function(_0x426de3,_0x597b4e){_0x426de3=_0x426de3-0x0;var _0x3f770b=_0xe3cc[_0x426de3];return _0x3f770b;};'use strict';var pdf=require(_0xce3c('0x0'));var emlformat=require(_0xce3c('0x1'));var rimraf=require(_0xce3c('0x2'));var zipdir=require(_0xce3c('0x3'));var jsonpatch=require(_0xce3c('0x4'));var rp=require(_0xce3c('0x5'));var moment=require(_0xce3c('0x6'));var BPromise=require(_0xce3c('0x7'));var Mustache=require(_0xce3c('0x8'));var util=require('util');var path=require('path');var sox=require(_0xce3c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xce3c('0xa'));var squel=require('squel');var crypto=require(_0xce3c('0xb'));var jsforce=require(_0xce3c('0xc'));var deskjs=require(_0xce3c('0xd'));var toCsv=require(_0xce3c('0xe'));var querystring=require(_0xce3c('0xf'));var Papa=require(_0xce3c('0x10'));var Redis=require(_0xce3c('0x11'));var authService=require(_0xce3c('0x12'));var qs=require(_0xce3c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xce3c('0x14'));var utils=require(_0xce3c('0x15'));var config=require('../../config/environment');var db=require(_0xce3c('0x16'))['db'];var integrations=require(_0xce3c('0x17'));var jayson=require(_0xce3c('0x18'));var client=jayson[_0xce3c('0x19')][_0xce3c('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5a992b,_0x3bb8c0,_0x187585){if(_0x187585){var _0x2c300a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c300a[_0xce3c('0x1b')](_0x3bb8c0)){return _0x5a992b;}else{throw new Error(_0xce3c('0x1c'));}}else{return _0x5a992b;}}function respondWithRpcPromise(_0x5ea868,_0x26f28e,_0x32a8ed,_0x55d590){return new BPromise(function(_0x5741d9,_0x227f38){var _0x2b2a45=_0x55d590||client;return _0x2b2a45['request'](_0x5ea868,_0x32a8ed)[_0xce3c('0x1d')](function(_0x128cf9){logger[_0xce3c('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x26f28e,_0xce3c('0x1f'));logger[_0xce3c('0x20')](_0xce3c('0x21'),_0x26f28e,_0xce3c('0x1f'),JSON['stringify'](_0x128cf9));if(_0x128cf9['error']){if(_0x128cf9[_0xce3c('0x22')]['code']===0x1f4){logger[_0xce3c('0x22')]('VtigerAccount,\x20%s,\x20%s',_0x26f28e,_0x128cf9['error'][_0xce3c('0x23')]);return _0x227f38(_0x128cf9[_0xce3c('0x22')]['message']);}logger[_0xce3c('0x22')](_0xce3c('0x24'),_0x26f28e,_0x128cf9[_0xce3c('0x22')][_0xce3c('0x23')]);return _0x5741d9(_0x128cf9[_0xce3c('0x22')]['message']);}else{logger[_0xce3c('0x1e')](_0xce3c('0x24'),_0x26f28e,'request\x20sent');_0x5741d9(_0x128cf9[_0xce3c('0x25')][_0xce3c('0x23')]);}})[_0xce3c('0x26')](function(_0x29500e){logger[_0xce3c('0x22')](_0xce3c('0x24'),_0x26f28e,_0x29500e);_0x227f38(_0x29500e);});});}function respondWithStatusCode(_0x4e3f19,_0x2fbb6d){_0x2fbb6d=_0x2fbb6d||0xcc;return function(_0x4ab36d){if(_0x4ab36d){return _0x4e3f19[_0xce3c('0x27')](_0x2fbb6d);}return _0x4e3f19[_0xce3c('0x28')](_0x2fbb6d)[_0xce3c('0x29')]();};}function respondWithResult(_0x13471f,_0x453d59){_0x453d59=_0x453d59||0xc8;return function(_0x1425cd){if(_0x1425cd){return _0x13471f[_0xce3c('0x28')](_0x453d59)[_0xce3c('0x2a')](_0x1425cd);}};}function respondWithFilteredResult(_0x22fae5,_0x2f977a){return function(_0x2d20da){if(_0x2d20da){var _0x36489f=_0x2d20da[_0xce3c('0x2b')],_0x20e97f=_0x2f977a[_0xce3c('0x2c')],_0xbe357f=_0x2f977a[_0xce3c('0x2c')]+_0x2f977a[_0xce3c('0x2d')],_0x213d93;if(_0xbe357f>=_0x36489f){_0xbe357f=_0x36489f;_0x213d93=0xc8;}else{_0x213d93=0xce;}_0x22fae5[_0xce3c('0x28')](_0x213d93);return _0x22fae5[_0xce3c('0x2e')]('Content-Range',_0x20e97f+'-'+_0xbe357f+'/'+_0x36489f)['json'](_0x2d20da);}return null;};}function patchUpdates(_0x5450c2){return function(_0x5e45d9){try{jsonpatch[_0xce3c('0x2f')](_0x5e45d9,_0x5450c2,!![]);}catch(_0x1c778a){return BPromise[_0xce3c('0x30')](_0x1c778a);}return _0x5e45d9['save']();};}function saveUpdates(_0x3d05f2,_0x3d017f){return function(_0xf0bdf2){if(_0xf0bdf2){return _0xf0bdf2[_0xce3c('0x31')](_0x3d05f2)[_0xce3c('0x1d')](function(_0x4261f3){return _0x4261f3;});}return null;};}function removeEntity(_0x3a85c8,_0x5bb86b){return function(_0x2d455f){if(_0x2d455f){return _0x2d455f[_0xce3c('0x32')]()[_0xce3c('0x1d')](function(){_0x3a85c8[_0xce3c('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e843,_0xca6d31){return function(_0x230a0f){if(!_0x230a0f){_0x29e843[_0xce3c('0x27')](0x194);}return _0x230a0f;};}function handleError(_0x4f72c6,_0x55ed48){_0x55ed48=_0x55ed48||0x1f4;return function(_0x1ba28c){logger[_0xce3c('0x22')](_0x1ba28c[_0xce3c('0x33')]);if(_0x1ba28c[_0xce3c('0x34')]){delete _0x1ba28c[_0xce3c('0x34')];}_0x4f72c6[_0xce3c('0x28')](_0x55ed48)['send'](_0x1ba28c);};}exports['index']=function(_0x5f2ed2,_0x7397f2){var _0x1d1824={},_0x2b2a5d={},_0x1f532e={'count':0x0,'rows':[]};var _0x443add=db[_0xce3c('0x35')][_0xce3c('0x36')];_0x2b2a5d[_0xce3c('0x37')]=_[_0xce3c('0x38')](_0x443add);_0x2b2a5d[_0xce3c('0x39')]=_['keys'](_0x5f2ed2['query']);_0x2b2a5d[_0xce3c('0x3a')]=_['intersection'](_0x2b2a5d[_0xce3c('0x37')],_0x2b2a5d['query']);_0x1d1824[_0xce3c('0x3b')]=_[_0xce3c('0x3c')](_0x2b2a5d[_0xce3c('0x37')],qs[_0xce3c('0x3d')](_0x5f2ed2[_0xce3c('0x39')]['fields']));_0x1d1824[_0xce3c('0x3b')]=_0x1d1824['attributes']['length']?_0x1d1824[_0xce3c('0x3b')]:_0x2b2a5d['model'];if(!_0x5f2ed2[_0xce3c('0x39')][_0xce3c('0x3e')](_0xce3c('0x3f'))){_0x1d1824[_0xce3c('0x2d')]=qs['limit'](_0x5f2ed2[_0xce3c('0x39')][_0xce3c('0x2d')]);_0x1d1824['offset']=qs[_0xce3c('0x2c')](_0x5f2ed2[_0xce3c('0x39')]['offset']);}_0x1d1824['order']=qs[_0xce3c('0x40')](_0x5f2ed2[_0xce3c('0x39')][_0xce3c('0x40')]);_0x1d1824[_0xce3c('0x41')]=qs[_0xce3c('0x3a')](_[_0xce3c('0x42')](_0x5f2ed2[_0xce3c('0x39')],_0x2b2a5d[_0xce3c('0x3a')]));if(_0x5f2ed2['query'][_0xce3c('0x43')]){_0x1d1824[_0xce3c('0x41')]=_[_0xce3c('0x44')](_0x1d1824['where'],{'$or':_[_0xce3c('0x45')](_0x443add,function(_0x2d7e0b){if(_0x2d7e0b[_0xce3c('0x46')][_0xce3c('0x47')]!=='VIRTUAL'){var _0x326b97={};_0x326b97[_0x2d7e0b[_0xce3c('0x48')]]={'$like':'%'+_0x5f2ed2['query'][_0xce3c('0x43')]+'%'};return _0x326b97;}})});}_0x1d1824=_[_0xce3c('0x44')]({},_0x1d1824,_0x5f2ed2[_0xce3c('0x49')]);var _0x3015a2={'where':_0x1d1824[_0xce3c('0x41')]};return db['VtigerAccount']['count'](_0x3015a2)[_0xce3c('0x1d')](function(_0x2772d4){_0x1f532e[_0xce3c('0x2b')]=_0x2772d4;if(_0x5f2ed2[_0xce3c('0x39')][_0xce3c('0x4a')]){_0x1d1824['include']=[{'all':!![]}];}return db['VtigerAccount'][_0xce3c('0x4b')](_0x1d1824);})['then'](function(_0x476b9c){_0x1f532e[_0xce3c('0x4c')]=_0x476b9c;return _0x1f532e;})[_0xce3c('0x1d')](respondWithFilteredResult(_0x7397f2,_0x1d1824))[_0xce3c('0x26')](handleError(_0x7397f2,null));};exports[_0xce3c('0x4d')]=function(_0x3bef0b,_0x75d5d5){var _0x9666b={'raw':![],'where':{'id':_0x3bef0b[_0xce3c('0x4e')]['id']}},_0x5acee4={};_0x5acee4['model']=_[_0xce3c('0x38')](db[_0xce3c('0x35')]['rawAttributes']);_0x5acee4[_0xce3c('0x39')]=_[_0xce3c('0x38')](_0x3bef0b['query']);_0x5acee4[_0xce3c('0x3a')]=_[_0xce3c('0x3c')](_0x5acee4[_0xce3c('0x37')],_0x5acee4[_0xce3c('0x39')]);_0x9666b[_0xce3c('0x3b')]=_[_0xce3c('0x3c')](_0x5acee4[_0xce3c('0x37')],qs[_0xce3c('0x3d')](_0x3bef0b[_0xce3c('0x39')]['fields']));_0x9666b[_0xce3c('0x3b')]=_0x9666b[_0xce3c('0x3b')][_0xce3c('0x4f')]?_0x9666b[_0xce3c('0x3b')]:_0x5acee4[_0xce3c('0x37')];if(_0x3bef0b[_0xce3c('0x39')][_0xce3c('0x4a')]){_0x9666b[_0xce3c('0x50')]=[{'all':!![]}];}_0x9666b=_[_0xce3c('0x44')]({},_0x9666b,_0x3bef0b[_0xce3c('0x49')]);return db[_0xce3c('0x35')][_0xce3c('0x51')](_0x9666b)[_0xce3c('0x1d')](handleEntityNotFound(_0x75d5d5,null))['then'](respondWithResult(_0x75d5d5,null))[_0xce3c('0x26')](handleError(_0x75d5d5,null));};exports[_0xce3c('0x52')]=function(_0x364d8a,_0x505898){return db[_0xce3c('0x35')][_0xce3c('0x52')](_0x364d8a[_0xce3c('0x53')],{})[_0xce3c('0x1d')](respondWithResult(_0x505898,0xc9))[_0xce3c('0x26')](handleError(_0x505898,null));};exports['update']=function(_0x5c89bd,_0x197ed0){if(_0x5c89bd['body']['id']){delete _0x5c89bd[_0xce3c('0x53')]['id'];}return db[_0xce3c('0x35')][_0xce3c('0x51')]({'where':{'id':_0x5c89bd[_0xce3c('0x4e')]['id']}})[_0xce3c('0x1d')](handleEntityNotFound(_0x197ed0,null))['then'](saveUpdates(_0x5c89bd[_0xce3c('0x53')],null))[_0xce3c('0x1d')](respondWithResult(_0x197ed0,null))[_0xce3c('0x26')](handleError(_0x197ed0,null));};exports['destroy']=function(_0x212e8e,_0x50879c){return db[_0xce3c('0x35')]['find']({'where':{'id':_0x212e8e[_0xce3c('0x4e')]['id']}})[_0xce3c('0x1d')](handleEntityNotFound(_0x50879c,null))['then'](removeEntity(_0x50879c,null))['catch'](handleError(_0x50879c,null));};exports[_0xce3c('0x54')]=function(_0x1c5972,_0x58d262,_0xb27c9a){var _0x41522c={};var _0x360051={};var _0x27441e;var _0x47482a;return db['VtigerAccount'][_0xce3c('0x55')]({'where':{'id':_0x1c5972['params']['id']}})[_0xce3c('0x1d')](handleEntityNotFound(_0x58d262,null))[_0xce3c('0x1d')](function(_0x43c99){if(_0x43c99){_0x27441e=_0x43c99;_0x360051[_0xce3c('0x37')]=_['keys'](db[_0xce3c('0x56')][_0xce3c('0x36')]);_0x360051[_0xce3c('0x39')]=_[_0xce3c('0x38')](_0x1c5972[_0xce3c('0x39')]);_0x360051[_0xce3c('0x3a')]=_[_0xce3c('0x3c')](_0x360051[_0xce3c('0x37')],_0x360051[_0xce3c('0x39')]);_0x41522c[_0xce3c('0x3b')]=_['intersection'](_0x360051[_0xce3c('0x37')],qs['fields'](_0x1c5972['query'][_0xce3c('0x3d')]));_0x41522c[_0xce3c('0x3b')]=_0x41522c['attributes']['length']?_0x41522c[_0xce3c('0x3b')]:_0x360051['model'];_0x41522c['order']=qs['sort'](_0x1c5972[_0xce3c('0x39')][_0xce3c('0x40')]);_0x41522c['where']=qs['filters'](_[_0xce3c('0x42')](_0x1c5972[_0xce3c('0x39')],_0x360051[_0xce3c('0x3a')]));if(_0x1c5972[_0xce3c('0x39')][_0xce3c('0x43')]){_0x41522c[_0xce3c('0x41')]=_['merge'](_0x41522c[_0xce3c('0x41')],{'$or':_[_0xce3c('0x45')](_0x41522c[_0xce3c('0x3b')],function(_0x2d16d2){var _0x902362={};_0x902362[_0x2d16d2]={'$like':'%'+_0x1c5972[_0xce3c('0x39')][_0xce3c('0x43')]+'%'};return _0x902362;})});}_0x41522c=_[_0xce3c('0x44')]({},_0x41522c,_0x1c5972[_0xce3c('0x49')]);return _0x27441e[_0xce3c('0x54')](_0x41522c);}})['then'](function(_0x109e69){if(_0x109e69){_0x47482a=_0x109e69[_0xce3c('0x4f')];if(!_0x1c5972['query'][_0xce3c('0x3e')](_0xce3c('0x3f'))){_0x41522c[_0xce3c('0x2d')]=qs[_0xce3c('0x2d')](_0x1c5972['query'][_0xce3c('0x2d')]);_0x41522c[_0xce3c('0x2c')]=qs['offset'](_0x1c5972[_0xce3c('0x39')][_0xce3c('0x2c')]);}return _0x27441e[_0xce3c('0x54')](_0x41522c);}})[_0xce3c('0x1d')](function(_0x29104d){if(_0x29104d){return _0x29104d?{'count':_0x47482a,'rows':_0x29104d}:null;}})['then'](respondWithResult(_0x58d262,null))[_0xce3c('0x26')](handleError(_0x58d262,null));};exports[_0xce3c('0x57')]=function(_0x5d3eec,_0x384cb0,_0x1162a6){if(_0x5d3eec[_0xce3c('0x53')]['id']){delete _0x5d3eec['body']['id'];}return db[_0xce3c('0x35')][_0xce3c('0x55')]({'where':{'id':_0x5d3eec[_0xce3c('0x4e')]['id']}})[_0xce3c('0x1d')](handleEntityNotFound(_0x384cb0,null))[_0xce3c('0x1d')](function(_0x135f49){if(_0x135f49){_0x5d3eec['body']['AccountId']=_0x135f49['id'];_0x5d3eec[_0xce3c('0x53')][_0xce3c('0x58')]=integrations['getSubjects'](_0x5d3eec['body'][_0xce3c('0x59')],_0x5d3eec[_0xce3c('0x53')][_0xce3c('0x46')]);_0x5d3eec[_0xce3c('0x53')][_0xce3c('0x5a')]=integrations[_0xce3c('0x5b')](_0x5d3eec[_0xce3c('0x53')][_0xce3c('0x59')],_0x5d3eec[_0xce3c('0x53')][_0xce3c('0x46')]);return db[_0xce3c('0x56')][_0xce3c('0x52')](_0x5d3eec[_0xce3c('0x53')],{'include':[{'model':db[_0xce3c('0x5c')],'as':_0xce3c('0x58')},{'model':db['VtigerField'],'as':_0xce3c('0x5a')}]});}return null;})[_0xce3c('0x1d')](respondWithResult(_0x384cb0,null))[_0xce3c('0x26')](handleError(_0x384cb0,null));};var md5=require(_0xce3c('0x5d'));exports[_0xce3c('0x5e')]=function(_0x4ef45b,_0x27b357,_0x5992d8){var _0x545acf=null;var _0xc53ff8=null;var _0x1a28c7=null;var _0x1f5e0e=null;var _0x36404d='';return db[_0xce3c('0x35')][_0xce3c('0x55')]({'where':{'id':_0x4ef45b[_0xce3c('0x4e')]['id']},'attributes':['id','name',_0xce3c('0x5f'),'description',_0xce3c('0x60'),_0xce3c('0x61'),'serverUrl',_0xce3c('0x62')]})[_0xce3c('0x1d')](handleEntityNotFound(_0x27b357,null))['then'](function(_0xaeb666){if(_0xaeb666){_0x545acf=_0xaeb666[_0xce3c('0x5f')];_0xc53ff8=_0xaeb666[_0xce3c('0x62')];_0x1a28c7=_0xaeb666[_0xce3c('0x60')];_0x36404d=_0xaeb666[_0xce3c('0x61')];var _0x5e01fb=_0x36404d[_0xce3c('0x63')](-0x1);if(_0x5e01fb==='/'){_0x36404d=_0x36404d[_0xce3c('0x64')](0x0,_0x36404d[_0xce3c('0x65')](_0x5e01fb));}_0x1f5e0e=util[_0xce3c('0x66')](_0xce3c('0x67'),_0x36404d);var _0x21e349={'method':_0xce3c('0x68'),'uri':_0x1f5e0e,'qs':{'operation':_0xce3c('0x69'),'username':_0xaeb666[_0xce3c('0x5f')]},'json':!![]};return rp(_0x21e349);}})['then'](function(_0x450c05){if(_0x450c05[_0xce3c('0x6a')]){var _0x5bb2ea={'method':_0xce3c('0x6b'),'uri':_0x1f5e0e,'form':{'operation':_0xce3c('0x6c'),'username':_0x545acf,'accessKey':md5(_0x450c05[_0xce3c('0x25')][_0xce3c('0x6d')]+_0xc53ff8)},'json':!![]};return rp(_0x5bb2ea);}})[_0xce3c('0x1d')](function(_0x19795d){if(_0x19795d['success']){var _0xa01718={'method':'GET','uri':_0x1f5e0e,'qs':{'operation':'describe','username':_0x545acf,'sessionName':_0x19795d[_0xce3c('0x25')]['sessionName'],'elementType':_0x1a28c7},'json':!![]};return rp(_0xa01718);}})[_0xce3c('0x1d')](function(_0x311dc3){if(_0x311dc3[_0xce3c('0x6a')]){var _0xce0e86=['autogenerated','reference',_0xce3c('0x6e')];_['remove'](_0x311dc3[_0xce3c('0x25')][_0xce3c('0x3d')],function(_0x45a16c){return _0xce0e86[_0xce3c('0x6f')](_0x45a16c[_0xce3c('0x46')][_0xce3c('0x34')]);});_['remove'](_0x311dc3[_0xce3c('0x25')]['fields'],function(_0x127e57){return _0x127e57[_0xce3c('0x70')]===_0xce3c('0x71');});return{'count':_0x311dc3[_0xce3c('0x25')][_0xce3c('0x3d')][_0xce3c('0x4f')],'rows':_[_0xce3c('0x45')](_0x311dc3[_0xce3c('0x25')][_0xce3c('0x3d')],function(_0x32ea3b){return{'id':_0x32ea3b[_0xce3c('0x34')],'name':_0x32ea3b['label'],'custom':_[_0xce3c('0x72')](_0x32ea3b[_0xce3c('0x34')],_0xce3c('0x73'))?!![]:![],'options':_0x32ea3b[_0xce3c('0x46')][_0xce3c('0x34')]==='picklist'&&_0x32ea3b[_0xce3c('0x46')][_0xce3c('0x74')][_0xce3c('0x4f')]>0x0?_[_0xce3c('0x45')](_0x32ea3b[_0xce3c('0x46')][_0xce3c('0x74')],function(_0x4f1874){return{'name':_0x4f1874[_0xce3c('0x75')],'value':_0x4f1874['value']};}):[]};})};}})[_0xce3c('0x1d')](respondWithResult(_0x27b357,null))[_0xce3c('0x26')](function(_0xe393d9){console[_0xce3c('0x76')]('vTiger\x20error:\x20'+_0xe393d9);var _0x48f032=_0x4ef45b[_0xce3c('0x39')]['test']?0x1f4:_0xe393d9[_0xce3c('0x77')]||0x1f4;logger[_0xce3c('0x22')](_0xce3c('0x78'),_0xce3c('0x5e'),_0x48f032,JSON[_0xce3c('0x79')](_0xe393d9));delete _0xe393d9[_0xce3c('0x34')];if(_0x48f032===0x191){_0x48f032=0x190;}_0x27b357[_0xce3c('0x28')](_0x48f032)[_0xce3c('0x7a')](_0x4ef45b[_0xce3c('0x39')][_0xce3c('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0xe393d9[_0xce3c('0x77')]}:_0xe393d9);});}; \ No newline at end of file +var _0x0a39=['querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','info','result','catch','count','offset','limit','set','Content-Range','json','reject','update','destroy','status','sendStatus','stack','name','VtigerAccount','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','findOne','length','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','VtigerConfiguration','VtigerField','Subjects','Descriptions','md5','getFields','serverUrl','accessKey','username','moduleName','remoteUri','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','sessionName','autogenerated','remove','includes','editable','false','label','startsWith','picklist','picklistValues','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a39,0x176));var _0x90a3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0a39[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x90a3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x90a3('0x1'));var zipdir=require(_0x90a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x90a3('0x3'));var moment=require(_0x90a3('0x4'));var BPromise=require(_0x90a3('0x5'));var Mustache=require(_0x90a3('0x6'));var util=require(_0x90a3('0x7'));var path=require(_0x90a3('0x8'));var sox=require(_0x90a3('0x9'));var csv=require(_0x90a3('0xa'));var ejs=require(_0x90a3('0xb'));var fs=require('fs');var _=require(_0x90a3('0xc'));var squel=require(_0x90a3('0xd'));var crypto=require(_0x90a3('0xe'));var jsforce=require(_0x90a3('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x90a3('0xa'));var querystring=require(_0x90a3('0x10'));var Papa=require(_0x90a3('0x11'));var Redis=require(_0x90a3('0x12'));var authService=require(_0x90a3('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x90a3('0x14'))(_0x90a3('0x15'));var utils=require(_0x90a3('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0x90a3('0x17'));var jayson=require(_0x90a3('0x18'));var client=jayson[_0x90a3('0x19')][_0x90a3('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xf9b9d2,_0x3457c1,_0x1d85db){if(_0x1d85db){var _0x18504c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18504c[_0x90a3('0x1b')](_0x3457c1)){return _0xf9b9d2;}else{throw new Error(_0x90a3('0x1c'));}}else{return _0xf9b9d2;}}function respondWithRpcPromise(_0x300519,_0x28e6ec,_0x5b6951,_0x1ffabd){return new BPromise(function(_0x19d7b3,_0x29f56a){var _0x1eb0a4=_0x1ffabd||client;return _0x1eb0a4[_0x90a3('0x1d')](_0x300519,_0x5b6951)[_0x90a3('0x1e')](function(_0x50f540){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x28e6ec,'request\x20sent');logger[_0x90a3('0x1f')](_0x90a3('0x20'),_0x28e6ec,_0x90a3('0x21'),JSON[_0x90a3('0x22')](_0x50f540));if(_0x50f540[_0x90a3('0x23')]){if(_0x50f540[_0x90a3('0x23')][_0x90a3('0x24')]===0x1f4){logger[_0x90a3('0x23')](_0x90a3('0x25'),_0x28e6ec,_0x50f540[_0x90a3('0x23')]['message']);return _0x29f56a(_0x50f540[_0x90a3('0x23')][_0x90a3('0x26')]);}logger['error'](_0x90a3('0x25'),_0x28e6ec,_0x50f540[_0x90a3('0x23')]['message']);return _0x19d7b3(_0x50f540['error'][_0x90a3('0x26')]);}else{logger[_0x90a3('0x27')](_0x90a3('0x25'),_0x28e6ec,'request\x20sent');_0x19d7b3(_0x50f540[_0x90a3('0x28')][_0x90a3('0x26')]);}})[_0x90a3('0x29')](function(_0x39fe52){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x28e6ec,_0x39fe52);_0x29f56a(_0x39fe52);});});}function respondWithStatusCode(_0x48a224,_0x54d255){_0x54d255=_0x54d255||0xcc;return function(_0xe1f6e5){if(_0xe1f6e5){return _0x48a224['sendStatus'](_0x54d255);}return _0x48a224['status'](_0x54d255)['end']();};}function respondWithResult(_0x35c358,_0x4cd6bf){_0x4cd6bf=_0x4cd6bf||0xc8;return function(_0x19b01b){if(_0x19b01b){return _0x35c358['status'](_0x4cd6bf)['json'](_0x19b01b);}};}function respondWithFilteredResult(_0x587f5f,_0x3238ce){return function(_0x1e0237){if(_0x1e0237){var _0x521391=_0x1e0237[_0x90a3('0x2a')],_0x4b9ca0=_0x3238ce['offset'],_0x7f63c1=_0x3238ce[_0x90a3('0x2b')]+_0x3238ce[_0x90a3('0x2c')],_0x4f38e1;if(_0x7f63c1>=_0x521391){_0x7f63c1=_0x521391;_0x4f38e1=0xc8;}else{_0x4f38e1=0xce;}_0x587f5f['status'](_0x4f38e1);return _0x587f5f[_0x90a3('0x2d')](_0x90a3('0x2e'),_0x4b9ca0+'-'+_0x7f63c1+'/'+_0x521391)[_0x90a3('0x2f')](_0x1e0237);}return null;};}function patchUpdates(_0x431f1e){return function(_0x4042c1){try{jsonpatch['apply'](_0x4042c1,_0x431f1e,!![]);}catch(_0x352668){return BPromise[_0x90a3('0x30')](_0x352668);}return _0x4042c1['save']();};}function saveUpdates(_0x1bcc4d,_0x3b30aa){return function(_0x53cd05){if(_0x53cd05){return _0x53cd05[_0x90a3('0x31')](_0x1bcc4d)[_0x90a3('0x1e')](function(_0x2ead5d){return _0x2ead5d;});}return null;};}function removeEntity(_0x204b8b,_0x2547cb){return function(_0x58fd40){if(_0x58fd40){return _0x58fd40[_0x90a3('0x32')]()[_0x90a3('0x1e')](function(){_0x204b8b[_0x90a3('0x33')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f594c,_0x593601){return function(_0x414b6b){if(!_0x414b6b){_0x2f594c[_0x90a3('0x34')](0x194);}return _0x414b6b;};}function handleError(_0x5d0cf4,_0x6e7ba){_0x6e7ba=_0x6e7ba||0x1f4;return function(_0x20518e){logger['error'](_0x20518e[_0x90a3('0x35')]);if(_0x20518e[_0x90a3('0x36')]){delete _0x20518e[_0x90a3('0x36')];}_0x5d0cf4['status'](_0x6e7ba)['send'](_0x20518e);};}exports['index']=function(_0x1d1b62,_0x338263){var _0x23ccf7={},_0x5aadab={},_0x531148={'count':0x0,'rows':[]};var _0x3f7890=db[_0x90a3('0x37')]['rawAttributes'];_0x5aadab[_0x90a3('0x38')]=_[_0x90a3('0x39')](_0x3f7890);_0x5aadab['query']=_['keys'](_0x1d1b62[_0x90a3('0x3a')]);_0x5aadab[_0x90a3('0x3b')]=_[_0x90a3('0x3c')](_0x5aadab[_0x90a3('0x38')],_0x5aadab['query']);_0x23ccf7[_0x90a3('0x3d')]=_[_0x90a3('0x3c')](_0x5aadab[_0x90a3('0x38')],qs['fields'](_0x1d1b62['query'][_0x90a3('0x3e')]));_0x23ccf7[_0x90a3('0x3d')]=_0x23ccf7[_0x90a3('0x3d')]['length']?_0x23ccf7[_0x90a3('0x3d')]:_0x5aadab[_0x90a3('0x38')];if(!_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x3f')]('nolimit')){_0x23ccf7['limit']=qs[_0x90a3('0x2c')](_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x2c')]);_0x23ccf7['offset']=qs[_0x90a3('0x2b')](_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x2b')]);}_0x23ccf7[_0x90a3('0x40')]=qs[_0x90a3('0x41')](_0x1d1b62[_0x90a3('0x3a')]['sort']);_0x23ccf7[_0x90a3('0x42')]=qs[_0x90a3('0x3b')](_[_0x90a3('0x43')](_0x1d1b62[_0x90a3('0x3a')],_0x5aadab[_0x90a3('0x3b')]));if(_0x1d1b62[_0x90a3('0x3a')][_0x90a3('0x44')]){_0x23ccf7[_0x90a3('0x42')]=_[_0x90a3('0x45')](_0x23ccf7[_0x90a3('0x42')],{'$or':_[_0x90a3('0x46')](_0x3f7890,function(_0x255568){if(_0x255568[_0x90a3('0x47')]['key']!==_0x90a3('0x48')){var _0x200054={};_0x200054[_0x255568[_0x90a3('0x49')]]={'$like':'%'+_0x1d1b62['query']['filter']+'%'};return _0x200054;}})});}_0x23ccf7=_[_0x90a3('0x45')]({},_0x23ccf7,_0x1d1b62[_0x90a3('0x4a')]);var _0x48208e={'where':_0x23ccf7[_0x90a3('0x42')]};return db[_0x90a3('0x37')][_0x90a3('0x2a')](_0x48208e)[_0x90a3('0x1e')](function(_0x49402f){_0x531148[_0x90a3('0x2a')]=_0x49402f;if(_0x1d1b62[_0x90a3('0x3a')]['includeAll']){_0x23ccf7[_0x90a3('0x4b')]=[{'all':!![]}];}return db[_0x90a3('0x37')][_0x90a3('0x4c')](_0x23ccf7);})['then'](function(_0x5790de){_0x531148[_0x90a3('0x4d')]=_0x5790de;return _0x531148;})[_0x90a3('0x1e')](respondWithFilteredResult(_0x338263,_0x23ccf7))[_0x90a3('0x29')](handleError(_0x338263,null));};exports[_0x90a3('0x4e')]=function(_0x41e65a,_0x19d351){var _0x23ac6a={'raw':![],'where':{'id':_0x41e65a[_0x90a3('0x4f')]['id']}},_0x3354c2={};_0x3354c2[_0x90a3('0x38')]=_[_0x90a3('0x39')](db[_0x90a3('0x37')][_0x90a3('0x50')]);_0x3354c2['query']=_[_0x90a3('0x39')](_0x41e65a[_0x90a3('0x3a')]);_0x3354c2['filters']=_[_0x90a3('0x3c')](_0x3354c2[_0x90a3('0x38')],_0x3354c2[_0x90a3('0x3a')]);_0x23ac6a[_0x90a3('0x3d')]=_[_0x90a3('0x3c')](_0x3354c2[_0x90a3('0x38')],qs[_0x90a3('0x3e')](_0x41e65a[_0x90a3('0x3a')][_0x90a3('0x3e')]));_0x23ac6a[_0x90a3('0x3d')]=_0x23ac6a[_0x90a3('0x3d')]['length']?_0x23ac6a[_0x90a3('0x3d')]:_0x3354c2[_0x90a3('0x38')];if(_0x41e65a['query'][_0x90a3('0x51')]){_0x23ac6a['include']=[{'all':!![]}];}_0x23ac6a=_[_0x90a3('0x45')]({},_0x23ac6a,_0x41e65a[_0x90a3('0x4a')]);return db[_0x90a3('0x37')][_0x90a3('0x52')](_0x23ac6a)[_0x90a3('0x1e')](handleEntityNotFound(_0x19d351,null))[_0x90a3('0x1e')](respondWithResult(_0x19d351,null))[_0x90a3('0x29')](handleError(_0x19d351,null));};exports[_0x90a3('0x53')]=function(_0x19be4a,_0xf480b0){return db['VtigerAccount'][_0x90a3('0x53')](_0x19be4a[_0x90a3('0x54')],{})[_0x90a3('0x1e')](respondWithResult(_0xf480b0,0xc9))[_0x90a3('0x29')](handleError(_0xf480b0,null));};exports[_0x90a3('0x31')]=function(_0x50d432,_0x243167){if(_0x50d432[_0x90a3('0x54')]['id']){delete _0x50d432[_0x90a3('0x54')]['id'];}return db[_0x90a3('0x37')][_0x90a3('0x52')]({'where':{'id':_0x50d432['params']['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0x243167,null))['then'](saveUpdates(_0x50d432[_0x90a3('0x54')],null))[_0x90a3('0x1e')](respondWithResult(_0x243167,null))['catch'](handleError(_0x243167,null));};exports[_0x90a3('0x32')]=function(_0x144681,_0x2a3f67){return db['VtigerAccount'][_0x90a3('0x52')]({'where':{'id':_0x144681['params']['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0x2a3f67,null))[_0x90a3('0x1e')](removeEntity(_0x2a3f67,null))['catch'](handleError(_0x2a3f67,null));};exports['getConfigurations']=function(_0x3723d2,_0x2ae026,_0x4d321a){var _0x5a6a2d={};var _0x5f5370={};var _0x575f4f;var _0x18b86f;return db['VtigerAccount'][_0x90a3('0x55')]({'where':{'id':_0x3723d2[_0x90a3('0x4f')]['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0x2ae026,null))[_0x90a3('0x1e')](function(_0x18e69f){if(_0x18e69f){_0x575f4f=_0x18e69f;_0x5f5370[_0x90a3('0x38')]=_[_0x90a3('0x39')](db['VtigerConfiguration'][_0x90a3('0x50')]);_0x5f5370[_0x90a3('0x3a')]=_[_0x90a3('0x39')](_0x3723d2[_0x90a3('0x3a')]);_0x5f5370[_0x90a3('0x3b')]=_[_0x90a3('0x3c')](_0x5f5370[_0x90a3('0x38')],_0x5f5370['query']);_0x5a6a2d['attributes']=_[_0x90a3('0x3c')](_0x5f5370[_0x90a3('0x38')],qs[_0x90a3('0x3e')](_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x3e')]));_0x5a6a2d[_0x90a3('0x3d')]=_0x5a6a2d[_0x90a3('0x3d')][_0x90a3('0x56')]?_0x5a6a2d[_0x90a3('0x3d')]:_0x5f5370[_0x90a3('0x38')];_0x5a6a2d[_0x90a3('0x40')]=qs[_0x90a3('0x41')](_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x41')]);_0x5a6a2d[_0x90a3('0x42')]=qs[_0x90a3('0x3b')](_[_0x90a3('0x43')](_0x3723d2[_0x90a3('0x3a')],_0x5f5370[_0x90a3('0x3b')]));if(_0x3723d2[_0x90a3('0x3a')]['filter']){_0x5a6a2d[_0x90a3('0x42')]=_['merge'](_0x5a6a2d['where'],{'$or':_['map'](_0x5a6a2d['attributes'],function(_0x329aa2){var _0x4354bb={};_0x4354bb[_0x329aa2]={'$like':'%'+_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x44')]+'%'};return _0x4354bb;})});}_0x5a6a2d=_[_0x90a3('0x45')]({},_0x5a6a2d,_0x3723d2[_0x90a3('0x4a')]);return _0x575f4f[_0x90a3('0x57')](_0x5a6a2d);}})[_0x90a3('0x1e')](function(_0x22bdf2){if(_0x22bdf2){_0x18b86f=_0x22bdf2[_0x90a3('0x56')];if(!_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x3f')]('nolimit')){_0x5a6a2d['limit']=qs[_0x90a3('0x2c')](_0x3723d2[_0x90a3('0x3a')][_0x90a3('0x2c')]);_0x5a6a2d['offset']=qs[_0x90a3('0x2b')](_0x3723d2['query'][_0x90a3('0x2b')]);}return _0x575f4f['getConfigurations'](_0x5a6a2d);}})[_0x90a3('0x1e')](function(_0xf2b844){if(_0xf2b844){return _0xf2b844?{'count':_0x18b86f,'rows':_0xf2b844}:null;}})['then'](respondWithResult(_0x2ae026,null))['catch'](handleError(_0x2ae026,null));};exports[_0x90a3('0x58')]=function(_0x2fa7af,_0xd2655e,_0x4b0ab1){if(_0x2fa7af[_0x90a3('0x54')]['id']){delete _0x2fa7af[_0x90a3('0x54')]['id'];}return db[_0x90a3('0x37')][_0x90a3('0x55')]({'where':{'id':_0x2fa7af[_0x90a3('0x4f')]['id']}})[_0x90a3('0x1e')](handleEntityNotFound(_0xd2655e,null))[_0x90a3('0x1e')](function(_0x8411cd){if(_0x8411cd){_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x59')]=_0x8411cd['id'];_0x2fa7af[_0x90a3('0x54')]['Subjects']=integrations[_0x90a3('0x5a')](_0x2fa7af[_0x90a3('0x54')]['channel'],_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x47')]);_0x2fa7af['body']['Descriptions']=integrations[_0x90a3('0x5b')](_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x5c')],_0x2fa7af[_0x90a3('0x54')][_0x90a3('0x47')]);return db[_0x90a3('0x5d')][_0x90a3('0x53')](_0x2fa7af[_0x90a3('0x54')],{'include':[{'model':db[_0x90a3('0x5e')],'as':_0x90a3('0x5f')},{'model':db[_0x90a3('0x5e')],'as':_0x90a3('0x60')}]});}return null;})[_0x90a3('0x1e')](respondWithResult(_0xd2655e,null))[_0x90a3('0x29')](handleError(_0xd2655e,null));};var md5=require(_0x90a3('0x61'));exports[_0x90a3('0x62')]=function(_0x364ee8,_0xbbaee,_0x20befa){var _0x212df5=null;var _0x19a0e0=null;var _0x4a6a4d=null;var _0x434354=null;var _0x4339d6='';return db[_0x90a3('0x37')]['findOne']({'where':{'id':_0x364ee8['params']['id']},'attributes':['id','name','username','description','moduleName','remoteUri',_0x90a3('0x63'),_0x90a3('0x64')]})['then'](handleEntityNotFound(_0xbbaee,null))['then'](function(_0x3b50f4){if(_0x3b50f4){_0x212df5=_0x3b50f4[_0x90a3('0x65')];_0x19a0e0=_0x3b50f4[_0x90a3('0x64')];_0x4a6a4d=_0x3b50f4[_0x90a3('0x66')];_0x4339d6=_0x3b50f4[_0x90a3('0x67')];var _0x31d1f7=_0x4339d6[_0x90a3('0x68')](-0x1);if(_0x31d1f7==='/'){_0x4339d6=_0x4339d6[_0x90a3('0x69')](0x0,_0x4339d6['lastIndexOf'](_0x31d1f7));}_0x434354=util[_0x90a3('0x6a')](_0x90a3('0x6b'),_0x4339d6);var _0x4d4cef={'method':_0x90a3('0x6c'),'uri':_0x434354,'qs':{'operation':_0x90a3('0x6d'),'username':_0x3b50f4[_0x90a3('0x65')]},'json':!![]};return rp(_0x4d4cef);}})[_0x90a3('0x1e')](function(_0x54fffb){if(_0x54fffb[_0x90a3('0x6e')]){var _0x4212aa={'method':_0x90a3('0x6f'),'uri':_0x434354,'form':{'operation':_0x90a3('0x70'),'username':_0x212df5,'accessKey':md5(_0x54fffb[_0x90a3('0x28')][_0x90a3('0x71')]+_0x19a0e0)},'json':!![]};return rp(_0x4212aa);}})['then'](function(_0x4cb49d){if(_0x4cb49d[_0x90a3('0x6e')]){var _0xb490ee={'method':_0x90a3('0x6c'),'uri':_0x434354,'qs':{'operation':_0x90a3('0x72'),'username':_0x212df5,'sessionName':_0x4cb49d[_0x90a3('0x28')][_0x90a3('0x73')],'elementType':_0x4a6a4d},'json':!![]};return rp(_0xb490ee);}})[_0x90a3('0x1e')](function(_0x16cf62){if(_0x16cf62[_0x90a3('0x6e')]){var _0x1e1aee=[_0x90a3('0x74'),'reference','owner'];_[_0x90a3('0x75')](_0x16cf62['result']['fields'],function(_0x35f539){return _0x1e1aee[_0x90a3('0x76')](_0x35f539[_0x90a3('0x47')]['name']);});_['remove'](_0x16cf62[_0x90a3('0x28')][_0x90a3('0x3e')],function(_0x257a90){return _0x257a90[_0x90a3('0x77')]===_0x90a3('0x78');});return{'count':_0x16cf62['result'][_0x90a3('0x3e')][_0x90a3('0x56')],'rows':_['map'](_0x16cf62[_0x90a3('0x28')][_0x90a3('0x3e')],function(_0x37656b){return{'id':_0x37656b[_0x90a3('0x36')],'name':_0x37656b[_0x90a3('0x79')],'custom':_[_0x90a3('0x7a')](_0x37656b[_0x90a3('0x36')],'cf_')?!![]:![],'options':_0x37656b[_0x90a3('0x47')][_0x90a3('0x36')]===_0x90a3('0x7b')&&_0x37656b['type'][_0x90a3('0x7c')][_0x90a3('0x56')]>0x0?_[_0x90a3('0x46')](_0x37656b[_0x90a3('0x47')][_0x90a3('0x7c')],function(_0x210ef1){return{'name':_0x210ef1[_0x90a3('0x79')],'value':_0x210ef1['value']};}):[]};})};}})[_0x90a3('0x1e')](respondWithResult(_0xbbaee,null))['catch'](function(_0x1f824f){console[_0x90a3('0x7d')]('vTiger\x20error:\x20'+_0x1f824f);var _0x166787=_0x364ee8[_0x90a3('0x3a')][_0x90a3('0x1b')]?0x1f4:_0x1f824f[_0x90a3('0x7e')]||0x1f4;logger[_0x90a3('0x23')](_0x90a3('0x7f'),_0x90a3('0x62'),_0x166787,JSON['stringify'](_0x1f824f));delete _0x1f824f[_0x90a3('0x36')];if(_0x166787===0x191){_0x166787=0x190;}_0xbbaee['status'](_0x166787)[_0x90a3('0x80')](_0x364ee8['query']['test']?{'message':_0x90a3('0x81'),'statusCode':_0x1f824f['statusCode']}:_0x1f824f);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index ea639df..28ce668 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 _0xb1fa=['./intVtigerAccount.attributes','VtigerAccount','int_vtiger_accounts','../../config/logger','moment'];(function(_0x5825d3,_0x4bcf0f){var _0x251c24=function(_0x4305f3){while(--_0x4305f3){_0x5825d3['push'](_0x5825d3['shift']());}};_0x251c24(++_0x4bcf0f);}(_0xb1fa,0x9e));var _0xab1f=function(_0x3b0066,_0x2e260e){_0x3b0066=_0x3b0066-0x0;var _0x2f801d=_0xb1fa[_0x3b0066];return _0x2f801d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab1f('0x0'))('api');var moment=require(_0xab1f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab1f('0x2'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4ee73b,_0x463442){return _0x4ee73b['define'](_0xab1f('0x3'),attributes,{'tableName':_0xab1f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0f9=['VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x254983,_0x26c7ba){var _0x2ba66b=function(_0x30a256){while(--_0x30a256){_0x254983['push'](_0x254983['shift']());}};_0x2ba66b(++_0x26c7ba);}(_0xc0f9,0xc5));var _0x9c0f=function(_0x55754e,_0x286388){_0x55754e=_0x55754e-0x0;var _0x2e9948=_0xc0f9[_0x55754e];return _0x2e9948;};'use strict';var _=require(_0x9c0f('0x0'));var util=require(_0x9c0f('0x1'));var logger=require(_0x9c0f('0x2'))(_0x9c0f('0x3'));var moment=require(_0x9c0f('0x4'));var BPromise=require(_0x9c0f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c0f('0x6'));var rimraf=require(_0x9c0f('0x7'));var config=require(_0x9c0f('0x8'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x9c0f('0x9'));module[_0x9c0f('0xa')]=function(_0x2eab65,_0x181915){return _0x2eab65['define'](_0x9c0f('0xb'),attributes,{'tableName':_0x9c0f('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 4b3f413..a8f503b 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 _0x4a98=['request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','findAll','options','raw','attributes','limit','include','map','model','info','debug','find','ShowVtigerAccount','util','rpc','../../config/environment','client','request','then','VtigerAccount,\x20%s,\x20%s'];(function(_0x1c14b9,_0x542c8e){var _0x52761f=function(_0x2a0237){while(--_0x2a0237){_0x1c14b9['push'](_0x1c14b9['shift']());}};_0x52761f(++_0x542c8e);}(_0x4a98,0x9b));var _0x84a9=function(_0x2d0b84,_0x34682d){_0x2d0b84=_0x2d0b84-0x0;var _0x8d0088=_0x4a98[_0x2d0b84];return _0x8d0088;};'use strict';var _=require('lodash');var util=require(_0x84a9('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x84a9('0x1'));var config=require(_0x84a9('0x2'));var jayson=require('jayson/promise');var client=jayson[_0x84a9('0x3')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33dc75,_0x3f7b18,_0x42ebe1){return new BPromise(function(_0x38dec3,_0xe1707c){return client[_0x84a9('0x4')](_0x33dc75,_0x42ebe1)[_0x84a9('0x5')](function(_0x535943){logger['info'](_0x84a9('0x6'),_0x3f7b18,_0x84a9('0x7'));logger['debug'](_0x84a9('0x8'),_0x3f7b18,_0x84a9('0x7'),JSON[_0x84a9('0x9')](_0x535943));if(_0x535943[_0x84a9('0xa')]){if(_0x535943['error'][_0x84a9('0xb')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x3f7b18,_0x535943['error']['message']);return _0xe1707c(_0x535943[_0x84a9('0xa')][_0x84a9('0xc')]);}logger['error'](_0x84a9('0x6'),_0x3f7b18,_0x535943[_0x84a9('0xa')]['message']);return _0x38dec3(_0x535943[_0x84a9('0xa')][_0x84a9('0xc')]);}else{logger['info'](_0x84a9('0x6'),_0x3f7b18,'request\x20sent');_0x38dec3(_0x535943['result'][_0x84a9('0xc')]);}})[_0x84a9('0xd')](function(_0x4a5717){logger[_0x84a9('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x3f7b18,_0x4a5717);_0xe1707c(_0x4a5717);});});}exports[_0x84a9('0xe')]=function(_0x43c46a){var _0x42e031=this;return new Promise(function(_0x449c1b,_0x42a476){return db['VtigerAccount'][_0x84a9('0xf')]({'raw':_0x43c46a[_0x84a9('0x10')]?_0x43c46a['options'][_0x84a9('0x11')]===undefined?!![]:![]:!![],'where':_0x43c46a[_0x84a9('0x10')]?_0x43c46a['options']['where']||null:null,'attributes':_0x43c46a[_0x84a9('0x10')]?_0x43c46a[_0x84a9('0x10')][_0x84a9('0x12')]||null:null,'limit':_0x43c46a[_0x84a9('0x10')]?_0x43c46a[_0x84a9('0x10')][_0x84a9('0x13')]||null:null,'include':_0x43c46a[_0x84a9('0x10')]?_0x43c46a[_0x84a9('0x10')][_0x84a9('0x14')]?_[_0x84a9('0x15')](_0x43c46a[_0x84a9('0x10')]['include'],function(_0x16ca19){return{'model':db[_0x16ca19[_0x84a9('0x16')]],'as':_0x16ca19['as'],'attributes':_0x16ca19['attributes'],'include':_0x16ca19[_0x84a9('0x14')]?_['map'](_0x16ca19[_0x84a9('0x14')],function(_0x8df61a){return{'model':db[_0x8df61a[_0x84a9('0x16')]],'as':_0x8df61a['as'],'attributes':_0x8df61a[_0x84a9('0x12')],'include':_0x8df61a[_0x84a9('0x14')]?_[_0x84a9('0x15')](_0x8df61a[_0x84a9('0x14')],function(_0x22109f){return{'model':db[_0x22109f[_0x84a9('0x16')]],'as':_0x22109f['as'],'attributes':_0x22109f[_0x84a9('0x12')]};}):[]};}):[]};}):[]:[]})[_0x84a9('0x5')](function(_0x312c7d){logger[_0x84a9('0x17')](_0x84a9('0xe'),_0x43c46a);logger[_0x84a9('0x18')](_0x84a9('0xe'),_0x43c46a,JSON[_0x84a9('0x9')](_0x312c7d));_0x449c1b(_0x312c7d);})[_0x84a9('0xd')](function(_0x5b5148){logger[_0x84a9('0xa')](_0x84a9('0xe'),_0x5b5148[_0x84a9('0xc')],_0x43c46a);_0x42a476(_0x42e031[_0x84a9('0xa')](0x1f4,_0x5b5148[_0x84a9('0xc')]));});});};exports['ShowVtigerAccount']=function(_0x45e0ce){var _0x573cae=this;return new Promise(function(_0x5eb721,_0x9f7948){return db['VtigerAccount'][_0x84a9('0x19')]({'raw':_0x45e0ce['options']?_0x45e0ce[_0x84a9('0x10')][_0x84a9('0x11')]===undefined?!![]:![]:!![],'where':_0x45e0ce[_0x84a9('0x10')]?_0x45e0ce[_0x84a9('0x10')]['where']||null:null,'attributes':_0x45e0ce[_0x84a9('0x10')]?_0x45e0ce[_0x84a9('0x10')][_0x84a9('0x12')]||null:null,'include':_0x45e0ce[_0x84a9('0x10')]?_0x45e0ce[_0x84a9('0x10')][_0x84a9('0x14')]?_[_0x84a9('0x15')](_0x45e0ce['options'][_0x84a9('0x14')],function(_0x1ea543){return{'model':db[_0x1ea543['model']],'as':_0x1ea543['as'],'attributes':_0x1ea543[_0x84a9('0x12')],'include':_0x1ea543[_0x84a9('0x14')]?_['map'](_0x1ea543[_0x84a9('0x14')],function(_0x25f6bd){return{'model':db[_0x25f6bd[_0x84a9('0x16')]],'as':_0x25f6bd['as'],'attributes':_0x25f6bd[_0x84a9('0x12')],'include':_0x25f6bd['include']?_[_0x84a9('0x15')](_0x25f6bd[_0x84a9('0x14')],function(_0x5d4731){return{'model':db[_0x5d4731['model']],'as':_0x5d4731['as'],'attributes':_0x5d4731[_0x84a9('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2baddb){logger[_0x84a9('0x17')](_0x84a9('0x1a'),_0x45e0ce);logger['debug'](_0x84a9('0x1a'),_0x45e0ce,JSON[_0x84a9('0x9')](_0x2baddb));_0x5eb721(_0x2baddb);})[_0x84a9('0xd')](function(_0x157159){logger[_0x84a9('0xa')](_0x84a9('0x1a'),_0x157159[_0x84a9('0xc')],_0x45e0ce);_0x9f7948(_0x573cae['error'](0x1f4,_0x157159[_0x84a9('0xc')]));});});}; \ No newline at end of file +var _0xe9d3=['attributes','include','map','model','then','GetVtigerAccount','ShowVtigerAccount','find','debug','lodash','util','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','VtigerAccount','findAll','options','raw','where'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xe9d3,0x169));var _0x3e9d=function(_0x14e8c6,_0xd130a){_0x14e8c6=_0x14e8c6-0x0;var _0x203210=_0xe9d3[_0x14e8c6];return _0x203210;};'use strict';var _=require(_0x3e9d('0x0'));var util=require(_0x3e9d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e9d('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3e9d('0x3'))(_0x3e9d('0x4'));var config=require(_0x3e9d('0x5'));var jayson=require(_0x3e9d('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf1fc26,_0x4e6e9c,_0x36e6f3){return new BPromise(function(_0x3af59c,_0x2bd1f9){return client[_0x3e9d('0x7')](_0xf1fc26,_0x36e6f3)['then'](function(_0x29085b){logger[_0x3e9d('0x8')](_0x3e9d('0x9'),_0x4e6e9c,_0x3e9d('0xa'));logger['debug'](_0x3e9d('0xb'),_0x4e6e9c,_0x3e9d('0xa'),JSON[_0x3e9d('0xc')](_0x29085b));if(_0x29085b['error']){if(_0x29085b['error'][_0x3e9d('0xd')]===0x1f4){logger[_0x3e9d('0xe')](_0x3e9d('0x9'),_0x4e6e9c,_0x29085b['error'][_0x3e9d('0xf')]);return _0x2bd1f9(_0x29085b[_0x3e9d('0xe')][_0x3e9d('0xf')]);}logger[_0x3e9d('0xe')](_0x3e9d('0x9'),_0x4e6e9c,_0x29085b[_0x3e9d('0xe')][_0x3e9d('0xf')]);return _0x3af59c(_0x29085b[_0x3e9d('0xe')][_0x3e9d('0xf')]);}else{logger['info'](_0x3e9d('0x9'),_0x4e6e9c,'request\x20sent');_0x3af59c(_0x29085b[_0x3e9d('0x10')][_0x3e9d('0xf')]);}})[_0x3e9d('0x11')](function(_0x201765){logger['error'](_0x3e9d('0x9'),_0x4e6e9c,_0x201765);_0x2bd1f9(_0x201765);});});}exports['GetVtigerAccount']=function(_0x38cb0e){var _0xc77889=this;return new Promise(function(_0x22d2f3,_0x37e81b){return db[_0x3e9d('0x12')][_0x3e9d('0x13')]({'raw':_0x38cb0e['options']?_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x15')]===undefined?!![]:![]:!![],'where':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x16')]||null:null,'attributes':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x17')]||null:null,'limit':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e[_0x3e9d('0x14')]['limit']||null:null,'include':_0x38cb0e[_0x3e9d('0x14')]?_0x38cb0e['options'][_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x38cb0e[_0x3e9d('0x14')][_0x3e9d('0x18')],function(_0x233895){return{'model':db[_0x233895[_0x3e9d('0x1a')]],'as':_0x233895['as'],'attributes':_0x233895[_0x3e9d('0x17')],'include':_0x233895[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x233895[_0x3e9d('0x18')],function(_0x4cf83b){return{'model':db[_0x4cf83b[_0x3e9d('0x1a')]],'as':_0x4cf83b['as'],'attributes':_0x4cf83b[_0x3e9d('0x17')],'include':_0x4cf83b[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x4cf83b[_0x3e9d('0x18')],function(_0x4b3801){return{'model':db[_0x4b3801['model']],'as':_0x4b3801['as'],'attributes':_0x4b3801[_0x3e9d('0x17')]};}):[]};}):[]};}):[]:[]})[_0x3e9d('0x1b')](function(_0x17f006){logger[_0x3e9d('0x8')](_0x3e9d('0x1c'),_0x38cb0e);logger['debug'](_0x3e9d('0x1c'),_0x38cb0e,JSON[_0x3e9d('0xc')](_0x17f006));_0x22d2f3(_0x17f006);})[_0x3e9d('0x11')](function(_0x5c98e4){logger[_0x3e9d('0xe')]('GetVtigerAccount',_0x5c98e4[_0x3e9d('0xf')],_0x38cb0e);_0x37e81b(_0xc77889['error'](0x1f4,_0x5c98e4['message']));});});};exports[_0x3e9d('0x1d')]=function(_0x518e66){var _0x2a3889=this;return new Promise(function(_0x429da7,_0xc4e892){return db[_0x3e9d('0x12')][_0x3e9d('0x1e')]({'raw':_0x518e66['options']?_0x518e66[_0x3e9d('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x518e66['options']?_0x518e66['options'][_0x3e9d('0x16')]||null:null,'attributes':_0x518e66[_0x3e9d('0x14')]?_0x518e66['options'][_0x3e9d('0x17')]||null:null,'include':_0x518e66['options']?_0x518e66[_0x3e9d('0x14')]['include']?_[_0x3e9d('0x19')](_0x518e66[_0x3e9d('0x14')][_0x3e9d('0x18')],function(_0x273004){return{'model':db[_0x273004[_0x3e9d('0x1a')]],'as':_0x273004['as'],'attributes':_0x273004[_0x3e9d('0x17')],'include':_0x273004[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x273004[_0x3e9d('0x18')],function(_0x513b41){return{'model':db[_0x513b41[_0x3e9d('0x1a')]],'as':_0x513b41['as'],'attributes':_0x513b41[_0x3e9d('0x17')],'include':_0x513b41[_0x3e9d('0x18')]?_[_0x3e9d('0x19')](_0x513b41[_0x3e9d('0x18')],function(_0x862b85){return{'model':db[_0x862b85[_0x3e9d('0x1a')]],'as':_0x862b85['as'],'attributes':_0x862b85['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e9d('0x1b')](function(_0x2b0a85){logger[_0x3e9d('0x8')](_0x3e9d('0x1d'),_0x518e66);logger[_0x3e9d('0x1f')](_0x3e9d('0x1d'),_0x518e66,JSON[_0x3e9d('0xc')](_0x2b0a85));_0x429da7(_0x2b0a85);})[_0x3e9d('0x11')](function(_0x44855d){logger[_0x3e9d('0xe')](_0x3e9d('0x1d'),_0x44855d['message'],_0x518e66);_0xc4e892(_0x2a3889[_0x3e9d('0xe')](0x1f4,_0x44855d[_0x3e9d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 2e586fb..9b7c15d 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 _0xb7e7=['create','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb7e7[_0x297fd3];return _0x2af381;};'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 auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['getSubjects']);router[_0x7b7e('0x6')](_0x7b7e('0xc'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb7e7=['create','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post'];(function(_0x339129,_0x86dcc6){var _0x1570df=function(_0x3b537e){while(--_0x3b537e){_0x339129['push'](_0x339129['shift']());}};_0x1570df(++_0x86dcc6);}(_0xb7e7,0x121));var _0x7b7e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xb7e7[_0x49ca18];return _0x145d54;};'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 auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x6')](_0x7b7e('0xb'),auth[_0x7b7e('0x8')](),controller['getSubjects']);router[_0x7b7e('0x6')](_0x7b7e('0xc'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),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 339a9de..2a90240 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 _0x5f4b=['exports','STRING','sequelize'];(function(_0x15cc63,_0x4f61d8){var _0x2eebd8=function(_0x2e4a6b){while(--_0x2e4a6b){_0x15cc63['push'](_0x15cc63['shift']());}};_0x2eebd8(++_0x4f61d8);}(_0x5f4b,0x1b2));var _0xb5f4=function(_0x221675,_0xe7abae){_0x221675=_0x221675-0x0;var _0x4b1414=_0x5f4b[_0x221675];return _0x4b1414;};'use strict';var Sequelize=require(_0xb5f4('0x0'));module[_0xb5f4('0x1')]={'name':{'type':Sequelize[_0xb5f4('0x2')]},'description':{'type':Sequelize[_0xb5f4('0x2')]}}; \ No newline at end of file +var _0x8f9b=['sequelize','STRING'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x8f9b,0x156));var _0xb8f9=function(_0x9a451f,_0x2858ea){_0x9a451f=_0x9a451f-0x0;var _0x30f055=_0x8f9b[_0x9a451f];return _0x30f055;};'use strict';var Sequelize=require(_0xb8f9('0x0'));module['exports']={'name':{'type':Sequelize[_0xb8f9('0x1')]},'description':{'type':Sequelize[_0xb8f9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 73be24a..408658b 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 _0x943c=['name','VtigerConfiguration','rawAttributes','model','keys','query','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','intersection','fields','find','create','body','params','getFields','findOne','VtigerField','order','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack'];(function(_0x41c053,_0x349c3f){var _0x2805ab=function(_0x148cb9){while(--_0x148cb9){_0x41c053['push'](_0x41c053['shift']());}};_0x2805ab(++_0x349c3f);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc943('0x0'));var emlformat=require(_0xc943('0x1'));var rimraf=require(_0xc943('0x2'));var zipdir=require(_0xc943('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc943('0x4'));var BPromise=require(_0xc943('0x5'));var Mustache=require(_0xc943('0x6'));var util=require('util');var path=require(_0xc943('0x7'));var sox=require(_0xc943('0x8'));var csv=require(_0xc943('0x9'));var ejs=require(_0xc943('0xa'));var fs=require('fs');var _=require(_0xc943('0xb'));var squel=require(_0xc943('0xc'));var crypto=require(_0xc943('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc943('0xe'));var toCsv=require(_0xc943('0x9'));var querystring=require(_0xc943('0xf'));var Papa=require(_0xc943('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc943('0x11'));var hardwareService=require(_0xc943('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc943('0x13'));var config=require(_0xc943('0x14'));var db=require(_0xc943('0x15'))['db'];var jayson=require(_0xc943('0x16'));var client=jayson[_0xc943('0x17')][_0xc943('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5ee50d,_0xf11802,_0x3e92f8){if(_0x3e92f8){var _0x56ca5d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56ca5d['test'](_0xf11802)){return _0x5ee50d;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5ee50d;}}function respondWithRpcPromise(_0x334fe2,_0xbdc5c4,_0x4ad944,_0x441eb1){return new BPromise(function(_0x537a11,_0x559fb0){var _0x2fa39b=_0x441eb1||client;return _0x2fa39b['request'](_0x334fe2,_0x4ad944)[_0xc943('0x19')](function(_0x40c9c2){logger[_0xc943('0x1a')](_0xc943('0x1b'),_0xbdc5c4,'request\x20sent');logger[_0xc943('0x1c')](_0xc943('0x1d'),_0xbdc5c4,_0xc943('0x1e'),JSON['stringify'](_0x40c9c2));if(_0x40c9c2[_0xc943('0x1f')]){if(_0x40c9c2[_0xc943('0x1f')][_0xc943('0x20')]===0x1f4){logger[_0xc943('0x1f')](_0xc943('0x1b'),_0xbdc5c4,_0x40c9c2[_0xc943('0x1f')][_0xc943('0x21')]);return _0x559fb0(_0x40c9c2[_0xc943('0x1f')][_0xc943('0x21')]);}logger[_0xc943('0x1f')](_0xc943('0x1b'),_0xbdc5c4,_0x40c9c2[_0xc943('0x1f')][_0xc943('0x21')]);return _0x537a11(_0x40c9c2[_0xc943('0x1f')][_0xc943('0x21')]);}else{logger[_0xc943('0x1a')](_0xc943('0x1b'),_0xbdc5c4,_0xc943('0x1e'));_0x537a11(_0x40c9c2[_0xc943('0x22')]['message']);}})[_0xc943('0x23')](function(_0x469b9e){logger[_0xc943('0x1f')](_0xc943('0x1b'),_0xbdc5c4,_0x469b9e);_0x559fb0(_0x469b9e);});});}function respondWithStatusCode(_0x2d75cc,_0x37f6f1){_0x37f6f1=_0x37f6f1||0xcc;return function(_0xb58fdc){if(_0xb58fdc){return _0x2d75cc[_0xc943('0x24')](_0x37f6f1);}return _0x2d75cc[_0xc943('0x25')](_0x37f6f1)[_0xc943('0x26')]();};}function respondWithResult(_0x15d6f8,_0x462bfc){_0x462bfc=_0x462bfc||0xc8;return function(_0x1d2bf4){if(_0x1d2bf4){return _0x15d6f8[_0xc943('0x25')](_0x462bfc)['json'](_0x1d2bf4);}};}function respondWithFilteredResult(_0x34a9ea,_0x30dc1c){return function(_0xf73438){if(_0xf73438){var _0x44530d=_0xf73438[_0xc943('0x27')],_0x182e2f=_0x30dc1c[_0xc943('0x28')],_0x26d6d7=_0x30dc1c[_0xc943('0x28')]+_0x30dc1c[_0xc943('0x29')],_0x4e77b3;if(_0x26d6d7>=_0x44530d){_0x26d6d7=_0x44530d;_0x4e77b3=0xc8;}else{_0x4e77b3=0xce;}_0x34a9ea[_0xc943('0x25')](_0x4e77b3);return _0x34a9ea[_0xc943('0x2a')](_0xc943('0x2b'),_0x182e2f+'-'+_0x26d6d7+'/'+_0x44530d)[_0xc943('0x2c')](_0xf73438);}return null;};}function patchUpdates(_0x4a7bce){return function(_0x4f2b46){try{jsonpatch[_0xc943('0x2d')](_0x4f2b46,_0x4a7bce,!![]);}catch(_0x137738){return BPromise[_0xc943('0x2e')](_0x137738);}return _0x4f2b46[_0xc943('0x2f')]();};}function saveUpdates(_0x53ba8b,_0x55b07c){return function(_0x14b6d3){if(_0x14b6d3){return _0x14b6d3[_0xc943('0x30')](_0x53ba8b)['then'](function(_0x21acbf){return _0x21acbf;});}return null;};}function removeEntity(_0x4a8a06,_0x211663){return function(_0x1ccf8c){if(_0x1ccf8c){return _0x1ccf8c[_0xc943('0x31')]()[_0xc943('0x19')](function(){_0x4a8a06['status'](0xcc)[_0xc943('0x26')]();});}};}function handleEntityNotFound(_0x4b35af,_0x2d7e62){return function(_0x16ae38){if(!_0x16ae38){_0x4b35af[_0xc943('0x24')](0x194);}return _0x16ae38;};}function handleError(_0x556406,_0x4113c7){_0x4113c7=_0x4113c7||0x1f4;return function(_0x13fd43){logger[_0xc943('0x1f')](_0x13fd43[_0xc943('0x32')]);if(_0x13fd43[_0xc943('0x33')]){delete _0x13fd43[_0xc943('0x33')];}_0x556406['status'](_0x4113c7)['send'](_0x13fd43);};}exports['index']=function(_0xbf2a4b,_0x329011){var _0x457ced={},_0x1ea2f8={},_0x1ff79c={'count':0x0,'rows':[]};var _0x42bb30=db[_0xc943('0x34')][_0xc943('0x35')];_0x1ea2f8[_0xc943('0x36')]=_['keys'](_0x42bb30);_0x1ea2f8['query']=_[_0xc943('0x37')](_0xbf2a4b[_0xc943('0x38')]);_0x1ea2f8['filters']=_['intersection'](_0x1ea2f8[_0xc943('0x36')],_0x1ea2f8[_0xc943('0x38')]);_0x457ced[_0xc943('0x39')]=_['intersection'](_0x1ea2f8[_0xc943('0x36')],qs['fields'](_0xbf2a4b[_0xc943('0x38')]['fields']));_0x457ced[_0xc943('0x39')]=_0x457ced[_0xc943('0x39')][_0xc943('0x3a')]?_0x457ced['attributes']:_0x1ea2f8['model'];if(!_0xbf2a4b[_0xc943('0x38')][_0xc943('0x3b')](_0xc943('0x3c'))){_0x457ced[_0xc943('0x29')]=qs['limit'](_0xbf2a4b[_0xc943('0x38')][_0xc943('0x29')]);_0x457ced[_0xc943('0x28')]=qs[_0xc943('0x28')](_0xbf2a4b['query']['offset']);}_0x457ced['order']=qs['sort'](_0xbf2a4b[_0xc943('0x38')][_0xc943('0x3d')]);_0x457ced['where']=qs[_0xc943('0x3e')](_[_0xc943('0x3f')](_0xbf2a4b[_0xc943('0x38')],_0x1ea2f8[_0xc943('0x3e')]));if(_0xbf2a4b[_0xc943('0x38')][_0xc943('0x40')]){_0x457ced[_0xc943('0x41')]=_[_0xc943('0x42')](_0x457ced['where'],{'$or':_[_0xc943('0x43')](_0x42bb30,function(_0x95e9c4){if(_0x95e9c4[_0xc943('0x44')][_0xc943('0x45')]!==_0xc943('0x46')){var _0x53d5a1={};_0x53d5a1[_0x95e9c4[_0xc943('0x47')]]={'$like':'%'+_0xbf2a4b['query']['filter']+'%'};return _0x53d5a1;}})});}_0x457ced=_['merge']({},_0x457ced,_0xbf2a4b[_0xc943('0x48')]);var _0x1f7492={'where':_0x457ced['where']};return db[_0xc943('0x34')][_0xc943('0x27')](_0x1f7492)[_0xc943('0x19')](function(_0x17c5c4){_0x1ff79c[_0xc943('0x27')]=_0x17c5c4;if(_0xbf2a4b[_0xc943('0x38')][_0xc943('0x49')]){_0x457ced[_0xc943('0x4a')]=[{'all':!![]}];}return db[_0xc943('0x34')][_0xc943('0x4b')](_0x457ced);})[_0xc943('0x19')](function(_0x32d969){_0x1ff79c[_0xc943('0x4c')]=_0x32d969;return _0x1ff79c;})['then'](respondWithFilteredResult(_0x329011,_0x457ced))[_0xc943('0x23')](handleError(_0x329011,null));};exports['show']=function(_0x5f0bbf,_0xc138e0){var _0x388fdc={'raw':![],'where':{'id':_0x5f0bbf['params']['id']}},_0x410977={};_0x410977['model']=_[_0xc943('0x37')](db[_0xc943('0x34')][_0xc943('0x35')]);_0x410977[_0xc943('0x38')]=_[_0xc943('0x37')](_0x5f0bbf[_0xc943('0x38')]);_0x410977[_0xc943('0x3e')]=_[_0xc943('0x4d')](_0x410977['model'],_0x410977['query']);_0x388fdc[_0xc943('0x39')]=_[_0xc943('0x4d')](_0x410977[_0xc943('0x36')],qs['fields'](_0x5f0bbf[_0xc943('0x38')][_0xc943('0x4e')]));_0x388fdc[_0xc943('0x39')]=_0x388fdc[_0xc943('0x39')][_0xc943('0x3a')]?_0x388fdc['attributes']:_0x410977[_0xc943('0x36')];if(_0x5f0bbf['query'][_0xc943('0x49')]){_0x388fdc[_0xc943('0x4a')]=[{'all':!![]}];}_0x388fdc=_[_0xc943('0x42')]({},_0x388fdc,_0x5f0bbf[_0xc943('0x48')]);return db[_0xc943('0x34')][_0xc943('0x4f')](_0x388fdc)[_0xc943('0x19')](handleEntityNotFound(_0xc138e0,null))[_0xc943('0x19')](respondWithResult(_0xc138e0,null))[_0xc943('0x23')](handleError(_0xc138e0,null));};exports[_0xc943('0x50')]=function(_0x4ea843,_0x1b95ed){return db[_0xc943('0x34')][_0xc943('0x50')](_0x4ea843[_0xc943('0x51')],{})[_0xc943('0x19')](respondWithResult(_0x1b95ed,0xc9))[_0xc943('0x23')](handleError(_0x1b95ed,null));};exports[_0xc943('0x30')]=function(_0x560f43,_0x479b35){if(_0x560f43[_0xc943('0x51')]['id']){delete _0x560f43['body']['id'];}return db[_0xc943('0x34')]['find']({'where':{'id':_0x560f43[_0xc943('0x52')]['id']}})[_0xc943('0x19')](handleEntityNotFound(_0x479b35,null))[_0xc943('0x19')](saveUpdates(_0x560f43[_0xc943('0x51')],null))[_0xc943('0x19')](respondWithResult(_0x479b35,null))[_0xc943('0x23')](handleError(_0x479b35,null));};exports[_0xc943('0x31')]=function(_0x45e9f6,_0x5813b4){return db[_0xc943('0x34')][_0xc943('0x4f')]({'where':{'id':_0x45e9f6[_0xc943('0x52')]['id']}})[_0xc943('0x19')](handleEntityNotFound(_0x5813b4,null))[_0xc943('0x19')](removeEntity(_0x5813b4,null))['catch'](handleError(_0x5813b4,null));};exports[_0xc943('0x53')]=function(_0x40ad88,_0x17b0ba,_0x356ca7){var _0x556272={};var _0x4afcbe={};var _0xf72782;var _0x131df2;return db['VtigerConfiguration'][_0xc943('0x54')]({'where':{'id':_0x40ad88[_0xc943('0x52')]['id']}})[_0xc943('0x19')](handleEntityNotFound(_0x17b0ba,null))[_0xc943('0x19')](function(_0x424d78){if(_0x424d78){_0xf72782=_0x424d78;_0x4afcbe['model']=_[_0xc943('0x37')](db[_0xc943('0x55')]['rawAttributes']);_0x4afcbe[_0xc943('0x38')]=_[_0xc943('0x37')](_0x40ad88[_0xc943('0x38')]);_0x4afcbe['filters']=_['intersection'](_0x4afcbe[_0xc943('0x36')],_0x4afcbe[_0xc943('0x38')]);_0x556272[_0xc943('0x39')]=_[_0xc943('0x4d')](_0x4afcbe['model'],qs[_0xc943('0x4e')](_0x40ad88[_0xc943('0x38')][_0xc943('0x4e')]));_0x556272[_0xc943('0x39')]=_0x556272[_0xc943('0x39')][_0xc943('0x3a')]?_0x556272[_0xc943('0x39')]:_0x4afcbe[_0xc943('0x36')];_0x556272[_0xc943('0x56')]=qs[_0xc943('0x3d')](_0x40ad88[_0xc943('0x38')][_0xc943('0x3d')]);_0x556272[_0xc943('0x41')]=qs[_0xc943('0x3e')](_['pick'](_0x40ad88[_0xc943('0x38')],_0x4afcbe[_0xc943('0x3e')]));if(_0x40ad88[_0xc943('0x38')][_0xc943('0x40')]){_0x556272[_0xc943('0x41')]=_[_0xc943('0x42')](_0x556272[_0xc943('0x41')],{'$or':_[_0xc943('0x43')](_0x556272['attributes'],function(_0x3d394f){var _0x3e7d45={};_0x3e7d45[_0x3d394f]={'$like':'%'+_0x40ad88[_0xc943('0x38')][_0xc943('0x40')]+'%'};return _0x3e7d45;})});}_0x556272=_['merge']({},_0x556272,_0x40ad88[_0xc943('0x48')]);return _0xf72782[_0xc943('0x53')](_0x556272);}})[_0xc943('0x19')](function(_0x2e4ec6){if(_0x2e4ec6){_0x131df2=_0x2e4ec6[_0xc943('0x3a')];if(!_0x40ad88[_0xc943('0x38')]['hasOwnProperty'](_0xc943('0x3c'))){_0x556272['limit']=qs['limit'](_0x40ad88[_0xc943('0x38')][_0xc943('0x29')]);_0x556272[_0xc943('0x28')]=qs['offset'](_0x40ad88['query']['offset']);}return _0xf72782[_0xc943('0x53')](_0x556272);}})['then'](function(_0x1bccc0){if(_0x1bccc0){return _0x1bccc0?{'count':_0x131df2,'rows':_0x1bccc0}:null;}})[_0xc943('0x19')](respondWithResult(_0x17b0ba,null))['catch'](handleError(_0x17b0ba,null));};exports[_0xc943('0x57')]=function(_0x577bc9,_0x53fd18,_0x662239){var _0x2f25b6={};var _0x233fd8={};var _0x284394;var _0x4c73a0;return db[_0xc943('0x34')][_0xc943('0x54')]({'where':{'id':_0x577bc9[_0xc943('0x52')]['id']}})[_0xc943('0x19')](handleEntityNotFound(_0x53fd18,null))[_0xc943('0x19')](function(_0xca02c6){if(_0xca02c6){_0x284394=_0xca02c6;_0x233fd8[_0xc943('0x36')]=_[_0xc943('0x37')](db['VtigerField'][_0xc943('0x35')]);_0x233fd8['query']=_['keys'](_0x577bc9['query']);_0x233fd8[_0xc943('0x3e')]=_[_0xc943('0x4d')](_0x233fd8[_0xc943('0x36')],_0x233fd8[_0xc943('0x38')]);_0x2f25b6[_0xc943('0x39')]=_[_0xc943('0x4d')](_0x233fd8['model'],qs[_0xc943('0x4e')](_0x577bc9['query'][_0xc943('0x4e')]));_0x2f25b6[_0xc943('0x39')]=_0x2f25b6['attributes']['length']?_0x2f25b6['attributes']:_0x233fd8['model'];_0x2f25b6[_0xc943('0x56')]=qs['sort'](_0x577bc9[_0xc943('0x38')]['sort']);_0x2f25b6[_0xc943('0x41')]=qs['filters'](_[_0xc943('0x3f')](_0x577bc9[_0xc943('0x38')],_0x233fd8['filters']));if(_0x577bc9[_0xc943('0x38')][_0xc943('0x40')]){_0x2f25b6['where']=_[_0xc943('0x42')](_0x2f25b6[_0xc943('0x41')],{'$or':_['map'](_0x2f25b6[_0xc943('0x39')],function(_0x8cb768){var _0x17b21e={};_0x17b21e[_0x8cb768]={'$like':'%'+_0x577bc9['query']['filter']+'%'};return _0x17b21e;})});}_0x2f25b6=_[_0xc943('0x42')]({},_0x2f25b6,_0x577bc9['options']);return _0x284394[_0xc943('0x57')](_0x2f25b6);}})[_0xc943('0x19')](function(_0x16876b){if(_0x16876b){_0x4c73a0=_0x16876b[_0xc943('0x3a')];if(!_0x577bc9[_0xc943('0x38')][_0xc943('0x3b')](_0xc943('0x3c'))){_0x2f25b6[_0xc943('0x29')]=qs[_0xc943('0x29')](_0x577bc9['query'][_0xc943('0x29')]);_0x2f25b6[_0xc943('0x28')]=qs[_0xc943('0x28')](_0x577bc9[_0xc943('0x38')][_0xc943('0x28')]);}return _0x284394[_0xc943('0x57')](_0x2f25b6);}})['then'](function(_0xe71ac0){if(_0xe71ac0){return _0xe71ac0?{'count':_0x4c73a0,'rows':_0xe71ac0}:null;}})[_0xc943('0x19')](respondWithResult(_0x53fd18,null))['catch'](handleError(_0x53fd18,null));};exports[_0xc943('0x58')]=function(_0x26142a,_0x32b851,_0x9c4d68){var _0x477587={};var _0x2b2470={};var _0x345322;var _0x1249ef;return db['VtigerConfiguration'][_0xc943('0x54')]({'where':{'id':_0x26142a[_0xc943('0x52')]['id']}})[_0xc943('0x19')](handleEntityNotFound(_0x32b851,null))[_0xc943('0x19')](function(_0x1c18b9){if(_0x1c18b9){_0x345322=_0x1c18b9;_0x2b2470[_0xc943('0x36')]=_[_0xc943('0x37')](db[_0xc943('0x55')][_0xc943('0x35')]);_0x2b2470[_0xc943('0x38')]=_['keys'](_0x26142a[_0xc943('0x38')]);_0x2b2470['filters']=_[_0xc943('0x4d')](_0x2b2470['model'],_0x2b2470[_0xc943('0x38')]);_0x477587[_0xc943('0x39')]=_['intersection'](_0x2b2470[_0xc943('0x36')],qs['fields'](_0x26142a[_0xc943('0x38')][_0xc943('0x4e')]));_0x477587[_0xc943('0x39')]=_0x477587[_0xc943('0x39')][_0xc943('0x3a')]?_0x477587[_0xc943('0x39')]:_0x2b2470[_0xc943('0x36')];_0x477587[_0xc943('0x56')]=qs['sort'](_0x26142a[_0xc943('0x38')]['sort']);_0x477587[_0xc943('0x41')]=qs[_0xc943('0x3e')](_[_0xc943('0x3f')](_0x26142a['query'],_0x2b2470[_0xc943('0x3e')]));if(_0x26142a['query']['filter']){_0x477587[_0xc943('0x41')]=_[_0xc943('0x42')](_0x477587['where'],{'$or':_[_0xc943('0x43')](_0x477587[_0xc943('0x39')],function(_0x169e2e){var _0xa0fdc={};_0xa0fdc[_0x169e2e]={'$like':'%'+_0x26142a['query'][_0xc943('0x40')]+'%'};return _0xa0fdc;})});}_0x477587=_[_0xc943('0x42')]({},_0x477587,_0x26142a[_0xc943('0x48')]);return _0x345322[_0xc943('0x58')](_0x477587);}})[_0xc943('0x19')](function(_0x2e8bf9){if(_0x2e8bf9){_0x1249ef=_0x2e8bf9[_0xc943('0x3a')];if(!_0x26142a[_0xc943('0x38')]['hasOwnProperty'](_0xc943('0x3c'))){_0x477587['limit']=qs[_0xc943('0x29')](_0x26142a[_0xc943('0x38')][_0xc943('0x29')]);_0x477587[_0xc943('0x28')]=qs[_0xc943('0x28')](_0x26142a['query']['offset']);}return _0x345322[_0xc943('0x58')](_0x477587);}})[_0xc943('0x19')](function(_0x138740){if(_0x138740){return _0x138740?{'count':_0x1249ef,'rows':_0x138740}:null;}})[_0xc943('0x19')](respondWithResult(_0x32b851,null))[_0xc943('0x23')](handleError(_0x32b851,null));}; \ No newline at end of file +var _0xadec=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','VtigerConfiguration','model','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','show','params','keys','create','body','findOne','VtigerField','rawAttributes','getFields','getSubjects','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x21bad5,_0x23a39d){var _0x235106=function(_0x281b1f){while(--_0x281b1f){_0x21bad5['push'](_0x21bad5['shift']());}};_0x235106(++_0x23a39d);}(_0xadec,0x156));var _0xcade=function(_0x2687b9,_0x1d7069){_0x2687b9=_0x2687b9-0x0;var _0x3d19b7=_0xadec[_0x2687b9];return _0x3d19b7;};'use strict';var pdf=require(_0xcade('0x0'));var emlformat=require(_0xcade('0x1'));var rimraf=require(_0xcade('0x2'));var zipdir=require(_0xcade('0x3'));var jsonpatch=require(_0xcade('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcade('0x5'));var util=require(_0xcade('0x6'));var path=require(_0xcade('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xcade('0x8'));var crypto=require('crypto');var jsforce=require(_0xcade('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcade('0xa'));var Papa=require(_0xcade('0xb'));var Redis=require(_0xcade('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xcade('0xd'));var hardwareService=require(_0xcade('0xe'));var logger=require(_0xcade('0xf'))(_0xcade('0x10'));var utils=require(_0xcade('0x11'));var config=require(_0xcade('0x12'));var db=require(_0xcade('0x13'))['db'];var jayson=require(_0xcade('0x14'));var client=jayson[_0xcade('0x15')][_0xcade('0x16')]({'port':0x232a});function checkPasswordPattern(_0x136d02,_0x2fd9a4,_0x2e2019){if(_0x2e2019){var _0x40c5c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40c5c7['test'](_0x2fd9a4)){return _0x136d02;}else{throw new Error(_0xcade('0x17'));}}else{return _0x136d02;}}function respondWithRpcPromise(_0x33d794,_0x2c5976,_0x53dfb8,_0x81ddea){return new BPromise(function(_0x245621,_0x4be206){var _0x135fb7=_0x81ddea||client;return _0x135fb7[_0xcade('0x18')](_0x33d794,_0x53dfb8)[_0xcade('0x19')](function(_0x4da027){logger[_0xcade('0x1a')](_0xcade('0x1b'),_0x2c5976,_0xcade('0x1c'));logger['debug'](_0xcade('0x1d'),_0x2c5976,_0xcade('0x1c'),JSON[_0xcade('0x1e')](_0x4da027));if(_0x4da027[_0xcade('0x1f')]){if(_0x4da027[_0xcade('0x1f')][_0xcade('0x20')]===0x1f4){logger[_0xcade('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x2c5976,_0x4da027[_0xcade('0x1f')][_0xcade('0x21')]);return _0x4be206(_0x4da027[_0xcade('0x1f')][_0xcade('0x21')]);}logger[_0xcade('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x2c5976,_0x4da027['error'][_0xcade('0x21')]);return _0x245621(_0x4da027['error'][_0xcade('0x21')]);}else{logger[_0xcade('0x1a')](_0xcade('0x1b'),_0x2c5976,_0xcade('0x1c'));_0x245621(_0x4da027[_0xcade('0x22')][_0xcade('0x21')]);}})[_0xcade('0x23')](function(_0x264df7){logger[_0xcade('0x1f')](_0xcade('0x1b'),_0x2c5976,_0x264df7);_0x4be206(_0x264df7);});});}function respondWithStatusCode(_0x28b55c,_0x2c9f13){_0x2c9f13=_0x2c9f13||0xcc;return function(_0x598a20){if(_0x598a20){return _0x28b55c[_0xcade('0x24')](_0x2c9f13);}return _0x28b55c[_0xcade('0x25')](_0x2c9f13)['end']();};}function respondWithResult(_0x3b6f37,_0x25cf6a){_0x25cf6a=_0x25cf6a||0xc8;return function(_0x468302){if(_0x468302){return _0x3b6f37[_0xcade('0x25')](_0x25cf6a)[_0xcade('0x26')](_0x468302);}};}function respondWithFilteredResult(_0x1c77f1,_0xf8e810){return function(_0x4bbe2a){if(_0x4bbe2a){var _0x39dcf0=_0x4bbe2a[_0xcade('0x27')],_0x17c156=_0xf8e810[_0xcade('0x28')],_0x18fe12=_0xf8e810[_0xcade('0x28')]+_0xf8e810[_0xcade('0x29')],_0x1874c6;if(_0x18fe12>=_0x39dcf0){_0x18fe12=_0x39dcf0;_0x1874c6=0xc8;}else{_0x1874c6=0xce;}_0x1c77f1['status'](_0x1874c6);return _0x1c77f1[_0xcade('0x2a')](_0xcade('0x2b'),_0x17c156+'-'+_0x18fe12+'/'+_0x39dcf0)[_0xcade('0x26')](_0x4bbe2a);}return null;};}function patchUpdates(_0x28d9da){return function(_0x5c96e3){try{jsonpatch[_0xcade('0x2c')](_0x5c96e3,_0x28d9da,!![]);}catch(_0xe83cc3){return BPromise[_0xcade('0x2d')](_0xe83cc3);}return _0x5c96e3[_0xcade('0x2e')]();};}function saveUpdates(_0x104c45,_0x13ac98){return function(_0x4eac69){if(_0x4eac69){return _0x4eac69[_0xcade('0x2f')](_0x104c45)[_0xcade('0x19')](function(_0x8c92b1){return _0x8c92b1;});}return null;};}function removeEntity(_0x31429b,_0x4c4442){return function(_0x3fbb39){if(_0x3fbb39){return _0x3fbb39[_0xcade('0x30')]()[_0xcade('0x19')](function(){_0x31429b[_0xcade('0x25')](0xcc)[_0xcade('0x31')]();});}};}function handleEntityNotFound(_0x1abd15,_0x4821d2){return function(_0x5363cc){if(!_0x5363cc){_0x1abd15[_0xcade('0x24')](0x194);}return _0x5363cc;};}function handleError(_0x5f59de,_0x80b610){_0x80b610=_0x80b610||0x1f4;return function(_0x40fe71){logger[_0xcade('0x1f')](_0x40fe71[_0xcade('0x32')]);if(_0x40fe71[_0xcade('0x33')]){delete _0x40fe71[_0xcade('0x33')];}_0x5f59de[_0xcade('0x25')](_0x80b610)[_0xcade('0x34')](_0x40fe71);};}exports[_0xcade('0x35')]=function(_0x3dc0ad,_0xeb678d){var _0x265011={},_0x51d576={},_0x4fd75e={'count':0x0,'rows':[]};var _0x53d5a8=db[_0xcade('0x36')]['rawAttributes'];_0x51d576[_0xcade('0x37')]=_['keys'](_0x53d5a8);_0x51d576['query']=_['keys'](_0x3dc0ad['query']);_0x51d576['filters']=_[_0xcade('0x38')](_0x51d576['model'],_0x51d576[_0xcade('0x39')]);_0x265011['attributes']=_[_0xcade('0x38')](_0x51d576[_0xcade('0x37')],qs[_0xcade('0x3a')](_0x3dc0ad[_0xcade('0x39')][_0xcade('0x3a')]));_0x265011[_0xcade('0x3b')]=_0x265011['attributes'][_0xcade('0x3c')]?_0x265011[_0xcade('0x3b')]:_0x51d576[_0xcade('0x37')];if(!_0x3dc0ad['query'][_0xcade('0x3d')](_0xcade('0x3e'))){_0x265011['limit']=qs[_0xcade('0x29')](_0x3dc0ad[_0xcade('0x39')]['limit']);_0x265011[_0xcade('0x28')]=qs[_0xcade('0x28')](_0x3dc0ad['query'][_0xcade('0x28')]);}_0x265011[_0xcade('0x3f')]=qs['sort'](_0x3dc0ad[_0xcade('0x39')][_0xcade('0x40')]);_0x265011[_0xcade('0x41')]=qs[_0xcade('0x42')](_[_0xcade('0x43')](_0x3dc0ad[_0xcade('0x39')],_0x51d576[_0xcade('0x42')]));if(_0x3dc0ad[_0xcade('0x39')][_0xcade('0x44')]){_0x265011[_0xcade('0x41')]=_[_0xcade('0x45')](_0x265011['where'],{'$or':_[_0xcade('0x46')](_0x53d5a8,function(_0x4ad05f){if(_0x4ad05f[_0xcade('0x47')][_0xcade('0x48')]!==_0xcade('0x49')){var _0x5b1c21={};_0x5b1c21[_0x4ad05f[_0xcade('0x4a')]]={'$like':'%'+_0x3dc0ad[_0xcade('0x39')][_0xcade('0x44')]+'%'};return _0x5b1c21;}})});}_0x265011=_[_0xcade('0x45')]({},_0x265011,_0x3dc0ad[_0xcade('0x4b')]);var _0x34c46b={'where':_0x265011['where']};return db['VtigerConfiguration']['count'](_0x34c46b)[_0xcade('0x19')](function(_0xdbd296){_0x4fd75e[_0xcade('0x27')]=_0xdbd296;if(_0x3dc0ad[_0xcade('0x39')]['includeAll']){_0x265011[_0xcade('0x4c')]=[{'all':!![]}];}return db[_0xcade('0x36')][_0xcade('0x4d')](_0x265011);})['then'](function(_0x500303){_0x4fd75e[_0xcade('0x4e')]=_0x500303;return _0x4fd75e;})[_0xcade('0x19')](respondWithFilteredResult(_0xeb678d,_0x265011))[_0xcade('0x23')](handleError(_0xeb678d,null));};exports[_0xcade('0x4f')]=function(_0x5a0d3e,_0xab6d57){var _0x18bb5a={'raw':![],'where':{'id':_0x5a0d3e[_0xcade('0x50')]['id']}},_0x350b01={};_0x350b01[_0xcade('0x37')]=_[_0xcade('0x51')](db[_0xcade('0x36')]['rawAttributes']);_0x350b01[_0xcade('0x39')]=_[_0xcade('0x51')](_0x5a0d3e[_0xcade('0x39')]);_0x350b01[_0xcade('0x42')]=_['intersection'](_0x350b01[_0xcade('0x37')],_0x350b01[_0xcade('0x39')]);_0x18bb5a[_0xcade('0x3b')]=_[_0xcade('0x38')](_0x350b01[_0xcade('0x37')],qs[_0xcade('0x3a')](_0x5a0d3e[_0xcade('0x39')][_0xcade('0x3a')]));_0x18bb5a[_0xcade('0x3b')]=_0x18bb5a[_0xcade('0x3b')][_0xcade('0x3c')]?_0x18bb5a['attributes']:_0x350b01[_0xcade('0x37')];if(_0x5a0d3e[_0xcade('0x39')]['includeAll']){_0x18bb5a[_0xcade('0x4c')]=[{'all':!![]}];}_0x18bb5a=_['merge']({},_0x18bb5a,_0x5a0d3e[_0xcade('0x4b')]);return db[_0xcade('0x36')]['find'](_0x18bb5a)[_0xcade('0x19')](handleEntityNotFound(_0xab6d57,null))[_0xcade('0x19')](respondWithResult(_0xab6d57,null))['catch'](handleError(_0xab6d57,null));};exports[_0xcade('0x52')]=function(_0x18fb02,_0x380832){return db['VtigerConfiguration'][_0xcade('0x52')](_0x18fb02[_0xcade('0x53')],{})[_0xcade('0x19')](respondWithResult(_0x380832,0xc9))[_0xcade('0x23')](handleError(_0x380832,null));};exports[_0xcade('0x2f')]=function(_0xc3d5ff,_0x11b6c5){if(_0xc3d5ff['body']['id']){delete _0xc3d5ff[_0xcade('0x53')]['id'];}return db['VtigerConfiguration']['find']({'where':{'id':_0xc3d5ff[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x11b6c5,null))[_0xcade('0x19')](saveUpdates(_0xc3d5ff['body'],null))[_0xcade('0x19')](respondWithResult(_0x11b6c5,null))[_0xcade('0x23')](handleError(_0x11b6c5,null));};exports['destroy']=function(_0x27e474,_0x196e5c){return db[_0xcade('0x36')]['find']({'where':{'id':_0x27e474[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x196e5c,null))[_0xcade('0x19')](removeEntity(_0x196e5c,null))[_0xcade('0x23')](handleError(_0x196e5c,null));};exports['getFields']=function(_0x446a32,_0x4f6b85,_0x40ef90){var _0xc8bed0={};var _0x2577b7={};var _0x2198ed;var _0x77aea3;return db[_0xcade('0x36')][_0xcade('0x54')]({'where':{'id':_0x446a32[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x4f6b85,null))[_0xcade('0x19')](function(_0x51cd3f){if(_0x51cd3f){_0x2198ed=_0x51cd3f;_0x2577b7[_0xcade('0x37')]=_[_0xcade('0x51')](db[_0xcade('0x55')][_0xcade('0x56')]);_0x2577b7[_0xcade('0x39')]=_['keys'](_0x446a32['query']);_0x2577b7[_0xcade('0x42')]=_[_0xcade('0x38')](_0x2577b7['model'],_0x2577b7[_0xcade('0x39')]);_0xc8bed0['attributes']=_[_0xcade('0x38')](_0x2577b7[_0xcade('0x37')],qs[_0xcade('0x3a')](_0x446a32[_0xcade('0x39')][_0xcade('0x3a')]));_0xc8bed0[_0xcade('0x3b')]=_0xc8bed0[_0xcade('0x3b')][_0xcade('0x3c')]?_0xc8bed0[_0xcade('0x3b')]:_0x2577b7[_0xcade('0x37')];_0xc8bed0[_0xcade('0x3f')]=qs[_0xcade('0x40')](_0x446a32[_0xcade('0x39')][_0xcade('0x40')]);_0xc8bed0[_0xcade('0x41')]=qs['filters'](_['pick'](_0x446a32['query'],_0x2577b7[_0xcade('0x42')]));if(_0x446a32['query']['filter']){_0xc8bed0[_0xcade('0x41')]=_[_0xcade('0x45')](_0xc8bed0[_0xcade('0x41')],{'$or':_[_0xcade('0x46')](_0xc8bed0[_0xcade('0x3b')],function(_0x3a5f35){var _0x7a3ada={};_0x7a3ada[_0x3a5f35]={'$like':'%'+_0x446a32[_0xcade('0x39')][_0xcade('0x44')]+'%'};return _0x7a3ada;})});}_0xc8bed0=_[_0xcade('0x45')]({},_0xc8bed0,_0x446a32['options']);return _0x2198ed[_0xcade('0x57')](_0xc8bed0);}})[_0xcade('0x19')](function(_0x518f93){if(_0x518f93){_0x77aea3=_0x518f93['length'];if(!_0x446a32[_0xcade('0x39')][_0xcade('0x3d')](_0xcade('0x3e'))){_0xc8bed0['limit']=qs[_0xcade('0x29')](_0x446a32[_0xcade('0x39')][_0xcade('0x29')]);_0xc8bed0[_0xcade('0x28')]=qs['offset'](_0x446a32[_0xcade('0x39')][_0xcade('0x28')]);}return _0x2198ed[_0xcade('0x57')](_0xc8bed0);}})['then'](function(_0x243706){if(_0x243706){return _0x243706?{'count':_0x77aea3,'rows':_0x243706}:null;}})[_0xcade('0x19')](respondWithResult(_0x4f6b85,null))['catch'](handleError(_0x4f6b85,null));};exports[_0xcade('0x58')]=function(_0x5d67c0,_0x29456f,_0x28e91b){var _0x433eec={};var _0x50cf70={};var _0xda52af;var _0x2802a1;return db[_0xcade('0x36')][_0xcade('0x54')]({'where':{'id':_0x5d67c0[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x29456f,null))[_0xcade('0x19')](function(_0x154b85){if(_0x154b85){_0xda52af=_0x154b85;_0x50cf70[_0xcade('0x37')]=_[_0xcade('0x51')](db['VtigerField'][_0xcade('0x56')]);_0x50cf70['query']=_[_0xcade('0x51')](_0x5d67c0[_0xcade('0x39')]);_0x50cf70[_0xcade('0x42')]=_[_0xcade('0x38')](_0x50cf70[_0xcade('0x37')],_0x50cf70[_0xcade('0x39')]);_0x433eec[_0xcade('0x3b')]=_['intersection'](_0x50cf70[_0xcade('0x37')],qs['fields'](_0x5d67c0[_0xcade('0x39')]['fields']));_0x433eec['attributes']=_0x433eec[_0xcade('0x3b')][_0xcade('0x3c')]?_0x433eec[_0xcade('0x3b')]:_0x50cf70[_0xcade('0x37')];_0x433eec[_0xcade('0x3f')]=qs[_0xcade('0x40')](_0x5d67c0[_0xcade('0x39')][_0xcade('0x40')]);_0x433eec['where']=qs[_0xcade('0x42')](_[_0xcade('0x43')](_0x5d67c0[_0xcade('0x39')],_0x50cf70[_0xcade('0x42')]));if(_0x5d67c0[_0xcade('0x39')][_0xcade('0x44')]){_0x433eec['where']=_[_0xcade('0x45')](_0x433eec['where'],{'$or':_[_0xcade('0x46')](_0x433eec[_0xcade('0x3b')],function(_0x369206){var _0x25ca25={};_0x25ca25[_0x369206]={'$like':'%'+_0x5d67c0[_0xcade('0x39')][_0xcade('0x44')]+'%'};return _0x25ca25;})});}_0x433eec=_[_0xcade('0x45')]({},_0x433eec,_0x5d67c0[_0xcade('0x4b')]);return _0xda52af[_0xcade('0x58')](_0x433eec);}})[_0xcade('0x19')](function(_0x44ff6b){if(_0x44ff6b){_0x2802a1=_0x44ff6b[_0xcade('0x3c')];if(!_0x5d67c0[_0xcade('0x39')][_0xcade('0x3d')](_0xcade('0x3e'))){_0x433eec['limit']=qs[_0xcade('0x29')](_0x5d67c0[_0xcade('0x39')][_0xcade('0x29')]);_0x433eec[_0xcade('0x28')]=qs['offset'](_0x5d67c0[_0xcade('0x39')]['offset']);}return _0xda52af[_0xcade('0x58')](_0x433eec);}})[_0xcade('0x19')](function(_0xf5ec56){if(_0xf5ec56){return _0xf5ec56?{'count':_0x2802a1,'rows':_0xf5ec56}:null;}})[_0xcade('0x19')](respondWithResult(_0x29456f,null))['catch'](handleError(_0x29456f,null));};exports['getDescriptions']=function(_0x17d974,_0x847f42,_0xaeb5c){var _0x5ca84c={};var _0x2b5575={};var _0x472bcb;var _0x3a7e1a;return db[_0xcade('0x36')]['findOne']({'where':{'id':_0x17d974[_0xcade('0x50')]['id']}})[_0xcade('0x19')](handleEntityNotFound(_0x847f42,null))[_0xcade('0x19')](function(_0x19e201){if(_0x19e201){_0x472bcb=_0x19e201;_0x2b5575[_0xcade('0x37')]=_[_0xcade('0x51')](db[_0xcade('0x55')][_0xcade('0x56')]);_0x2b5575[_0xcade('0x39')]=_[_0xcade('0x51')](_0x17d974[_0xcade('0x39')]);_0x2b5575[_0xcade('0x42')]=_[_0xcade('0x38')](_0x2b5575[_0xcade('0x37')],_0x2b5575[_0xcade('0x39')]);_0x5ca84c[_0xcade('0x3b')]=_[_0xcade('0x38')](_0x2b5575['model'],qs[_0xcade('0x3a')](_0x17d974['query']['fields']));_0x5ca84c['attributes']=_0x5ca84c[_0xcade('0x3b')][_0xcade('0x3c')]?_0x5ca84c[_0xcade('0x3b')]:_0x2b5575[_0xcade('0x37')];_0x5ca84c[_0xcade('0x3f')]=qs[_0xcade('0x40')](_0x17d974['query'][_0xcade('0x40')]);_0x5ca84c['where']=qs[_0xcade('0x42')](_[_0xcade('0x43')](_0x17d974['query'],_0x2b5575[_0xcade('0x42')]));if(_0x17d974[_0xcade('0x39')][_0xcade('0x44')]){_0x5ca84c[_0xcade('0x41')]=_[_0xcade('0x45')](_0x5ca84c[_0xcade('0x41')],{'$or':_[_0xcade('0x46')](_0x5ca84c[_0xcade('0x3b')],function(_0x4732e9){var _0x3b290c={};_0x3b290c[_0x4732e9]={'$like':'%'+_0x17d974[_0xcade('0x39')]['filter']+'%'};return _0x3b290c;})});}_0x5ca84c=_[_0xcade('0x45')]({},_0x5ca84c,_0x17d974[_0xcade('0x4b')]);return _0x472bcb['getDescriptions'](_0x5ca84c);}})[_0xcade('0x19')](function(_0x2a11e6){if(_0x2a11e6){_0x3a7e1a=_0x2a11e6[_0xcade('0x3c')];if(!_0x17d974[_0xcade('0x39')][_0xcade('0x3d')](_0xcade('0x3e'))){_0x5ca84c[_0xcade('0x29')]=qs[_0xcade('0x29')](_0x17d974[_0xcade('0x39')][_0xcade('0x29')]);_0x5ca84c[_0xcade('0x28')]=qs[_0xcade('0x28')](_0x17d974[_0xcade('0x39')]['offset']);}return _0x472bcb['getDescriptions'](_0x5ca84c);}})[_0xcade('0x19')](function(_0x3fb7d9){if(_0x3fb7d9){return _0x3fb7d9?{'count':_0x3a7e1a,'rows':_0x3fb7d9}:null;}})['then'](respondWithResult(_0x847f42,null))[_0xcade('0x23')](handleError(_0x847f42,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6defb97..95f485a 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 _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xa8901e,_0x488b93){var _0x438547=function(_0x3fde66){while(--_0x3fde66){_0xa8901e['push'](_0xa8901e['shift']());}};_0x438547(++_0x488b93);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x46279b,_0x2d7e20){var _0x38e9f6=function(_0x2294df){while(--_0x2294df){_0x46279b['push'](_0x46279b['shift']());}};_0x38e9f6(++_0x2d7e20);}(_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':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index d4fc361..9be62c5 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 _0x684e=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x502208,_0x107346){var _0xd9a98c=function(_0x20749b){while(--_0x20749b){_0x502208['push'](_0x502208['shift']());}};_0xd9a98c(++_0x107346);}(_0x684e,0x1bb));var _0xe684=function(_0x325d25,_0x1ea545){_0x325d25=_0x325d25-0x0;var _0x18ca74=_0x684e[_0x325d25];return _0x18ca74;};'use strict';var _=require(_0xe684('0x0'));var util=require(_0xe684('0x1'));var moment=require('moment');var BPromise=require(_0xe684('0x2'));var rs=require(_0xe684('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe684('0x4'))['db'];var utils=require(_0xe684('0x5'));var logger=require(_0xe684('0x6'))(_0xe684('0x7'));var config=require(_0xe684('0x8'));var jayson=require(_0xe684('0x9'));var client=jayson[_0xe684('0xa')][_0xe684('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x79585e,_0x3a3630,_0x26284f){return new BPromise(function(_0x4da598,_0x18b6dc){return client[_0xe684('0xc')](_0x79585e,_0x26284f)[_0xe684('0xd')](function(_0x5cf038){logger[_0xe684('0xe')](_0xe684('0xf'),_0x3a3630,_0xe684('0x10'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x3a3630,_0xe684('0x10'),JSON['stringify'](_0x5cf038));if(_0x5cf038[_0xe684('0x11')]){if(_0x5cf038[_0xe684('0x11')][_0xe684('0x12')]===0x1f4){logger['error'](_0xe684('0xf'),_0x3a3630,_0x5cf038[_0xe684('0x11')][_0xe684('0x13')]);return _0x18b6dc(_0x5cf038[_0xe684('0x11')][_0xe684('0x13')]);}logger[_0xe684('0x11')](_0xe684('0xf'),_0x3a3630,_0x5cf038['error']['message']);return _0x4da598(_0x5cf038[_0xe684('0x11')][_0xe684('0x13')]);}else{logger['info'](_0xe684('0xf'),_0x3a3630,_0xe684('0x10'));_0x4da598(_0x5cf038[_0xe684('0x14')][_0xe684('0x13')]);}})[_0xe684('0x15')](function(_0x214115){logger[_0xe684('0x11')](_0xe684('0xf'),_0x3a3630,_0x214115);_0x18b6dc(_0x214115);});});} \ No newline at end of file +var _0xd939=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','code','error','VtigerConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd939,0x1ac));var _0x9d93=function(_0x57dc85,_0x3a6d51){_0x57dc85=_0x57dc85-0x0;var _0x563a2e=_0xd939[_0x57dc85];return _0x563a2e;};'use strict';var _=require(_0x9d93('0x0'));var util=require(_0x9d93('0x1'));var moment=require(_0x9d93('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d93('0x3'));var fs=require('fs');var Redis=require(_0x9d93('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d93('0x5'));var logger=require(_0x9d93('0x6'))(_0x9d93('0x7'));var config=require(_0x9d93('0x8'));var jayson=require(_0x9d93('0x9'));var client=jayson['client'][_0x9d93('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bc7db,_0x43d9fe,_0x2ae0ca){return new BPromise(function(_0xc84d49,_0x4a6ea7){return client[_0x9d93('0xb')](_0x2bc7db,_0x2ae0ca)['then'](function(_0x37cc71){logger[_0x9d93('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x43d9fe,_0x9d93('0xd'));logger[_0x9d93('0xe')](_0x9d93('0xf'),_0x43d9fe,_0x9d93('0xd'),JSON['stringify'](_0x37cc71));if(_0x37cc71['error']){if(_0x37cc71['error'][_0x9d93('0x10')]===0x1f4){logger[_0x9d93('0x11')](_0x9d93('0x12'),_0x43d9fe,_0x37cc71[_0x9d93('0x11')]['message']);return _0x4a6ea7(_0x37cc71[_0x9d93('0x11')]['message']);}logger[_0x9d93('0x11')](_0x9d93('0x12'),_0x43d9fe,_0x37cc71[_0x9d93('0x11')]['message']);return _0xc84d49(_0x37cc71['error'][_0x9d93('0x13')]);}else{logger[_0x9d93('0xc')](_0x9d93('0x12'),_0x43d9fe,_0x9d93('0xd'));_0xc84d49(_0x37cc71[_0x9d93('0x14')][_0x9d93('0x13')]);}})['catch'](function(_0x8d38a7){logger[_0x9d93('0x11')](_0x9d93('0x12'),_0x43d9fe,_0x8d38a7);_0x4a6ea7(_0x8d38a7);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 0464383..9d3dc7c 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 _0x9076=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0xa2785c,_0x51eb5d){var _0x524936=function(_0x5eb81f){while(--_0x5eb81f){_0xa2785c['push'](_0xa2785c['shift']());}};_0x524936(++_0x51eb5d);}(_0x9076,0x157));var _0x6907=function(_0x1e0dfe,_0x37ba1e){_0x1e0dfe=_0x1e0dfe-0x0;var _0x42a1c3=_0x9076[_0x1e0dfe];return _0x42a1c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6907('0x0'));var timeout=require(_0x6907('0x1'));var express=require(_0x6907('0x2'));var router=express[_0x6907('0x3')]();var auth=require(_0x6907('0x4'));var interaction=require(_0x6907('0x5'));var config=require(_0x6907('0x6'));var controller=require(_0x6907('0x7'));router[_0x6907('0x8')]('/',auth[_0x6907('0x9')](),controller[_0x6907('0xa')]);router[_0x6907('0x8')](_0x6907('0xb'),auth[_0x6907('0x9')](),controller[_0x6907('0xc')]);router[_0x6907('0xd')]('/',auth[_0x6907('0x9')](),controller[_0x6907('0xe')]);router[_0x6907('0xf')](_0x6907('0xb'),auth[_0x6907('0x9')](),controller[_0x6907('0x10')]);router[_0x6907('0x11')]('/:id',auth[_0x6907('0x9')](),controller[_0x6907('0x12')]);module[_0x6907('0x13')]=router; \ No newline at end of file +var _0x1c55=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id'];(function(_0xab5f15,_0x5c1860){var _0x56290a=function(_0x226869){while(--_0x226869){_0xab5f15['push'](_0xab5f15['shift']());}};_0x56290a(++_0x5c1860);}(_0x1c55,0xbb));var _0x51c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c55[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x51c5('0x0'));var util=require(_0x51c5('0x1'));var path=require(_0x51c5('0x2'));var timeout=require(_0x51c5('0x3'));var express=require(_0x51c5('0x4'));var router=express[_0x51c5('0x5')]();var auth=require(_0x51c5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x51c5('0x7'));var controller=require(_0x51c5('0x8'));router[_0x51c5('0x9')]('/',auth[_0x51c5('0xa')](),controller[_0x51c5('0xb')]);router[_0x51c5('0x9')](_0x51c5('0xc'),auth[_0x51c5('0xa')](),controller['show']);router[_0x51c5('0xd')]('/',auth['isAuthenticated'](),controller[_0x51c5('0xe')]);router[_0x51c5('0xf')](_0x51c5('0xc'),auth[_0x51c5('0xa')](),controller[_0x51c5('0x10')]);router[_0x51c5('0x11')](_0x51c5('0xc'),auth[_0x51c5('0xa')](),controller[_0x51c5('0x12')]);module[_0x51c5('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 1ec633d..6bb7f9f 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 _0xda3f=['keyValue','STRING','string','variable','BOOLEAN','exports','ENUM'];(function(_0x12a79f,_0x1b9ef2){var _0xfbff56=function(_0x1f1664){while(--_0x1f1664){_0x12a79f['push'](_0x12a79f['shift']());}};_0xfbff56(++_0x1b9ef2);}(_0xda3f,0xec));var _0xfda3=function(_0x93e01e,_0x44d0eb){_0x93e01e=_0x93e01e-0x0;var _0x586013=_0xda3f[_0x93e01e];return _0x586013;};'use strict';var Sequelize=require('sequelize');module[_0xfda3('0x0')]={'type':{'type':Sequelize[_0xfda3('0x1')]('string','variable','customVariable',_0xfda3('0x2')),'defaultValue':'string'},'content':{'type':Sequelize[_0xfda3('0x3')]},'key':{'type':Sequelize[_0xfda3('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0xfda3('0x4'),_0xfda3('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfda3('0x3')]},'nameField':{'type':Sequelize[_0xfda3('0x3')]},'customField':{'type':Sequelize[_0xfda3('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfda3('0x3')]}}; \ No newline at end of file +var _0x702d=['STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x2c0723,_0x1c99cb){var _0x5b468f=function(_0x14d4fc){while(--_0x14d4fc){_0x2c0723['push'](_0x2c0723['shift']());}};_0x5b468f(++_0x1c99cb);}(_0x702d,0x147));var _0xd702=function(_0x478ff1,_0x3158fc){_0x478ff1=_0x478ff1-0x0;var _0x22fa4c=_0x702d[_0x478ff1];return _0x22fa4c;};'use strict';var Sequelize=require(_0xd702('0x0'));module[_0xd702('0x1')]={'type':{'type':Sequelize[_0xd702('0x2')](_0xd702('0x3'),_0xd702('0x4'),'customVariable',_0xd702('0x5')),'defaultValue':_0xd702('0x3')},'content':{'type':Sequelize[_0xd702('0x6')]},'key':{'type':Sequelize[_0xd702('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd702('0x3'),'variable',_0xd702('0x7'))},'keyContent':{'type':Sequelize[_0xd702('0x6')]},'idField':{'type':Sequelize[_0xd702('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd702('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index ebb4e09..b051b36 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 _0xc03e=['field','merge','options','includeAll','include','findAll','catch','params','find','create','body','html-pdf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','Content-Range','apply','reject','update','then','destroy','stack','name','send','VtigerField','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','filter','map','key','VIRTUAL'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc03e,0x15a));var _0xec03=function(_0x1a809b,_0x4c15e3){_0x1a809b=_0x1a809b-0x0;var _0x5d90e6=_0xc03e[_0x1a809b];return _0x5d90e6;};'use strict';var pdf=require(_0xec03('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xec03('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec03('0x2'));var moment=require('moment');var BPromise=require(_0xec03('0x3'));var Mustache=require(_0xec03('0x4'));var util=require(_0xec03('0x5'));var path=require(_0xec03('0x6'));var sox=require(_0xec03('0x7'));var csv=require(_0xec03('0x8'));var ejs=require(_0xec03('0x9'));var fs=require('fs');var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x8'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var hardwareService=require(_0xec03('0x12'));var logger=require(_0xec03('0x13'))(_0xec03('0x14'));var utils=require(_0xec03('0x15'));var config=require(_0xec03('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14c7df,_0x190f46){_0x190f46=_0x190f46||0xcc;return function(_0x398720){if(_0x398720){return _0x14c7df[_0xec03('0x17')](_0x190f46);}return _0x14c7df[_0xec03('0x18')](_0x190f46)[_0xec03('0x19')]();};}function respondWithResult(_0x8e5f46,_0x9a818f){_0x9a818f=_0x9a818f||0xc8;return function(_0x4ba43a){if(_0x4ba43a){return _0x8e5f46['status'](_0x9a818f)['json'](_0x4ba43a);}};}function respondWithFilteredResult(_0x252a60,_0x2d177e){return function(_0x3501ab){if(_0x3501ab){var _0x515680=_0x3501ab[_0xec03('0x1a')],_0x28bb4f=_0x2d177e['offset'],_0xbe85e6=_0x2d177e[_0xec03('0x1b')]+_0x2d177e['limit'],_0x452323;if(_0xbe85e6>=_0x515680){_0xbe85e6=_0x515680;_0x452323=0xc8;}else{_0x452323=0xce;}_0x252a60[_0xec03('0x18')](_0x452323);return _0x252a60['set'](_0xec03('0x1c'),_0x28bb4f+'-'+_0xbe85e6+'/'+_0x515680)['json'](_0x3501ab);}return null;};}function patchUpdates(_0x57dc2d){return function(_0x26f431){try{jsonpatch[_0xec03('0x1d')](_0x26f431,_0x57dc2d,!![]);}catch(_0xefa268){return BPromise[_0xec03('0x1e')](_0xefa268);}return _0x26f431['save']();};}function saveUpdates(_0x3ccac5,_0x5a799b){return function(_0x16ade3){if(_0x16ade3){return _0x16ade3[_0xec03('0x1f')](_0x3ccac5)[_0xec03('0x20')](function(_0x33a167){return _0x33a167;});}return null;};}function removeEntity(_0x416b9a,_0x41b729){return function(_0x3a44df){if(_0x3a44df){return _0x3a44df[_0xec03('0x21')]()['then'](function(){_0x416b9a[_0xec03('0x18')](0xcc)[_0xec03('0x19')]();});}};}function handleEntityNotFound(_0xa16d53,_0x76b813){return function(_0x33de1e){if(!_0x33de1e){_0xa16d53[_0xec03('0x17')](0x194);}return _0x33de1e;};}function handleError(_0x59936d,_0x3880b0){_0x3880b0=_0x3880b0||0x1f4;return function(_0x3ab7a1){logger['error'](_0x3ab7a1[_0xec03('0x22')]);if(_0x3ab7a1[_0xec03('0x23')]){delete _0x3ab7a1[_0xec03('0x23')];}_0x59936d[_0xec03('0x18')](_0x3880b0)[_0xec03('0x24')](_0x3ab7a1);};}exports['index']=function(_0x73cc4f,_0x2d944c){var _0x3eefe0={},_0x11a6b6={},_0x29e904={'count':0x0,'rows':[]};var _0x58621e=db[_0xec03('0x25')][_0xec03('0x26')];_0x11a6b6['model']=_['keys'](_0x58621e);_0x11a6b6[_0xec03('0x27')]=_[_0xec03('0x28')](_0x73cc4f[_0xec03('0x27')]);_0x11a6b6[_0xec03('0x29')]=_[_0xec03('0x2a')](_0x11a6b6[_0xec03('0x2b')],_0x11a6b6[_0xec03('0x27')]);_0x3eefe0[_0xec03('0x2c')]=_['intersection'](_0x11a6b6[_0xec03('0x2b')],qs[_0xec03('0x2d')](_0x73cc4f[_0xec03('0x27')][_0xec03('0x2d')]));_0x3eefe0[_0xec03('0x2c')]=_0x3eefe0[_0xec03('0x2c')][_0xec03('0x2e')]?_0x3eefe0[_0xec03('0x2c')]:_0x11a6b6[_0xec03('0x2b')];if(!_0x73cc4f['query']['hasOwnProperty']('nolimit')){_0x3eefe0[_0xec03('0x2f')]=qs[_0xec03('0x2f')](_0x73cc4f[_0xec03('0x27')][_0xec03('0x2f')]);_0x3eefe0['offset']=qs['offset'](_0x73cc4f['query']['offset']);}_0x3eefe0[_0xec03('0x30')]=qs[_0xec03('0x31')](_0x73cc4f[_0xec03('0x27')][_0xec03('0x31')]);_0x3eefe0[_0xec03('0x32')]=qs[_0xec03('0x29')](_[_0xec03('0x33')](_0x73cc4f[_0xec03('0x27')],_0x11a6b6[_0xec03('0x29')]));if(_0x73cc4f[_0xec03('0x27')][_0xec03('0x34')]){_0x3eefe0[_0xec03('0x32')]=_['merge'](_0x3eefe0[_0xec03('0x32')],{'$or':_[_0xec03('0x35')](_0x58621e,function(_0x240f48){if(_0x240f48['type'][_0xec03('0x36')]!==_0xec03('0x37')){var _0x2d1876={};_0x2d1876[_0x240f48[_0xec03('0x38')]]={'$like':'%'+_0x73cc4f[_0xec03('0x27')][_0xec03('0x34')]+'%'};return _0x2d1876;}})});}_0x3eefe0=_[_0xec03('0x39')]({},_0x3eefe0,_0x73cc4f[_0xec03('0x3a')]);var _0xc04862={'where':_0x3eefe0[_0xec03('0x32')]};return db[_0xec03('0x25')]['count'](_0xc04862)[_0xec03('0x20')](function(_0x1409f0){_0x29e904[_0xec03('0x1a')]=_0x1409f0;if(_0x73cc4f[_0xec03('0x27')][_0xec03('0x3b')]){_0x3eefe0[_0xec03('0x3c')]=[{'all':!![]}];}return db[_0xec03('0x25')][_0xec03('0x3d')](_0x3eefe0);})['then'](function(_0x454e91){_0x29e904['rows']=_0x454e91;return _0x29e904;})['then'](respondWithFilteredResult(_0x2d944c,_0x3eefe0))[_0xec03('0x3e')](handleError(_0x2d944c,null));};exports['show']=function(_0x548b81,_0x312d0b){var _0x66185a={'raw':!![],'where':{'id':_0x548b81[_0xec03('0x3f')]['id']}},_0x5aec1c={};_0x5aec1c['model']=_['keys'](db['VtigerField'][_0xec03('0x26')]);_0x5aec1c[_0xec03('0x27')]=_[_0xec03('0x28')](_0x548b81[_0xec03('0x27')]);_0x5aec1c['filters']=_[_0xec03('0x2a')](_0x5aec1c[_0xec03('0x2b')],_0x5aec1c[_0xec03('0x27')]);_0x66185a[_0xec03('0x2c')]=_[_0xec03('0x2a')](_0x5aec1c[_0xec03('0x2b')],qs[_0xec03('0x2d')](_0x548b81[_0xec03('0x27')][_0xec03('0x2d')]));_0x66185a['attributes']=_0x66185a[_0xec03('0x2c')][_0xec03('0x2e')]?_0x66185a[_0xec03('0x2c')]:_0x5aec1c[_0xec03('0x2b')];if(_0x548b81['query'][_0xec03('0x3b')]){_0x66185a[_0xec03('0x3c')]=[{'all':!![]}];}_0x66185a=_[_0xec03('0x39')]({},_0x66185a,_0x548b81[_0xec03('0x3a')]);return db[_0xec03('0x25')][_0xec03('0x40')](_0x66185a)['then'](handleEntityNotFound(_0x312d0b,null))['then'](respondWithResult(_0x312d0b,null))[_0xec03('0x3e')](handleError(_0x312d0b,null));};exports[_0xec03('0x41')]=function(_0x1cd711,_0x19e390){return db[_0xec03('0x25')]['create'](_0x1cd711['body'],{})[_0xec03('0x20')](respondWithResult(_0x19e390,0xc9))['catch'](handleError(_0x19e390,null));};exports[_0xec03('0x1f')]=function(_0x4930a,_0x1a3a8d){if(_0x4930a[_0xec03('0x42')]['id']){delete _0x4930a['body']['id'];}return db[_0xec03('0x25')][_0xec03('0x40')]({'where':{'id':_0x4930a[_0xec03('0x3f')]['id']}})[_0xec03('0x20')](handleEntityNotFound(_0x1a3a8d,null))['then'](saveUpdates(_0x4930a[_0xec03('0x42')],null))['then'](respondWithResult(_0x1a3a8d,null))[_0xec03('0x3e')](handleError(_0x1a3a8d,null));};exports[_0xec03('0x21')]=function(_0xdb9a99,_0x1c6b87){return db[_0xec03('0x25')][_0xec03('0x40')]({'where':{'id':_0xdb9a99[_0xec03('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1c6b87,null))[_0xec03('0x20')](removeEntity(_0x1c6b87,null))[_0xec03('0x3e')](handleError(_0x1c6b87,null));}; \ No newline at end of file +var _0xe5d5=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','index','VtigerField','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','options','count','then','include','findAll','rows','catch','show','params','includeAll','create','body','find','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x340c09,_0xc08941){var _0x1cc1b6=function(_0x193f75){while(--_0x193f75){_0x340c09['push'](_0x340c09['shift']());}};_0x1cc1b6(++_0xc08941);}(_0xe5d5,0x156));var _0x5e5d=function(_0x4cb0c5,_0xa5dbe3){_0x4cb0c5=_0x4cb0c5-0x0;var _0x2e4ec9=_0xe5d5[_0x4cb0c5];return _0x2e4ec9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5e5d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e5d('0x1'));var rp=require('request-promise');var moment=require(_0x5e5d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5e5d('0x3'));var util=require(_0x5e5d('0x4'));var path=require(_0x5e5d('0x5'));var sox=require(_0x5e5d('0x6'));var csv=require(_0x5e5d('0x7'));var ejs=require(_0x5e5d('0x8'));var fs=require('fs');var _=require(_0x5e5d('0x9'));var squel=require(_0x5e5d('0xa'));var crypto=require(_0x5e5d('0xb'));var jsforce=require(_0x5e5d('0xc'));var deskjs=require(_0x5e5d('0xd'));var toCsv=require(_0x5e5d('0x7'));var querystring=require(_0x5e5d('0xe'));var Papa=require(_0x5e5d('0xf'));var Redis=require('ioredis');var authService=require(_0x5e5d('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5e5d('0x11'));var logger=require(_0x5e5d('0x12'))('api');var utils=require(_0x5e5d('0x13'));var config=require(_0x5e5d('0x14'));var db=require(_0x5e5d('0x15'))['db'];function respondWithStatusCode(_0x35e513,_0x4a10c8){_0x4a10c8=_0x4a10c8||0xcc;return function(_0x4ff045){if(_0x4ff045){return _0x35e513[_0x5e5d('0x16')](_0x4a10c8);}return _0x35e513[_0x5e5d('0x17')](_0x4a10c8)['end']();};}function respondWithResult(_0x2a743d,_0x2cf150){_0x2cf150=_0x2cf150||0xc8;return function(_0x5a4474){if(_0x5a4474){return _0x2a743d[_0x5e5d('0x17')](_0x2cf150)[_0x5e5d('0x18')](_0x5a4474);}};}function respondWithFilteredResult(_0x5a5258,_0x5a8457){return function(_0x5bf617){if(_0x5bf617){var _0x1a3e5c=_0x5bf617['count'],_0x3dfb7e=_0x5a8457[_0x5e5d('0x19')],_0x79e8c1=_0x5a8457[_0x5e5d('0x19')]+_0x5a8457[_0x5e5d('0x1a')],_0x1e2d44;if(_0x79e8c1>=_0x1a3e5c){_0x79e8c1=_0x1a3e5c;_0x1e2d44=0xc8;}else{_0x1e2d44=0xce;}_0x5a5258[_0x5e5d('0x17')](_0x1e2d44);return _0x5a5258[_0x5e5d('0x1b')](_0x5e5d('0x1c'),_0x3dfb7e+'-'+_0x79e8c1+'/'+_0x1a3e5c)[_0x5e5d('0x18')](_0x5bf617);}return null;};}function patchUpdates(_0x27e197){return function(_0x4ae3f3){try{jsonpatch[_0x5e5d('0x1d')](_0x4ae3f3,_0x27e197,!![]);}catch(_0x1ceea7){return BPromise[_0x5e5d('0x1e')](_0x1ceea7);}return _0x4ae3f3[_0x5e5d('0x1f')]();};}function saveUpdates(_0xd3b6d6,_0xf8fe10){return function(_0x517b89){if(_0x517b89){return _0x517b89[_0x5e5d('0x20')](_0xd3b6d6)['then'](function(_0x968d4b){return _0x968d4b;});}return null;};}function removeEntity(_0x2f1eab,_0x3c5dd0){return function(_0x4c9973){if(_0x4c9973){return _0x4c9973[_0x5e5d('0x21')]()['then'](function(){_0x2f1eab[_0x5e5d('0x17')](0xcc)[_0x5e5d('0x22')]();});}};}function handleEntityNotFound(_0x3e8a1d,_0x49a558){return function(_0x49d2e5){if(!_0x49d2e5){_0x3e8a1d[_0x5e5d('0x16')](0x194);}return _0x49d2e5;};}function handleError(_0x1d5078,_0x5bef18){_0x5bef18=_0x5bef18||0x1f4;return function(_0x537564){logger[_0x5e5d('0x23')](_0x537564[_0x5e5d('0x24')]);if(_0x537564[_0x5e5d('0x25')]){delete _0x537564['name'];}_0x1d5078[_0x5e5d('0x17')](_0x5bef18)['send'](_0x537564);};}exports[_0x5e5d('0x26')]=function(_0x4ed6e5,_0x15abf2){var _0x20ba59={},_0x180816={},_0x442324={'count':0x0,'rows':[]};var _0x425b5c=db[_0x5e5d('0x27')][_0x5e5d('0x28')];_0x180816['model']=_[_0x5e5d('0x29')](_0x425b5c);_0x180816[_0x5e5d('0x2a')]=_[_0x5e5d('0x29')](_0x4ed6e5[_0x5e5d('0x2a')]);_0x180816[_0x5e5d('0x2b')]=_[_0x5e5d('0x2c')](_0x180816[_0x5e5d('0x2d')],_0x180816[_0x5e5d('0x2a')]);_0x20ba59[_0x5e5d('0x2e')]=_['intersection'](_0x180816[_0x5e5d('0x2d')],qs['fields'](_0x4ed6e5['query'][_0x5e5d('0x2f')]));_0x20ba59[_0x5e5d('0x2e')]=_0x20ba59[_0x5e5d('0x2e')][_0x5e5d('0x30')]?_0x20ba59[_0x5e5d('0x2e')]:_0x180816['model'];if(!_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x31')](_0x5e5d('0x32'))){_0x20ba59[_0x5e5d('0x1a')]=qs[_0x5e5d('0x1a')](_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x1a')]);_0x20ba59['offset']=qs[_0x5e5d('0x19')](_0x4ed6e5[_0x5e5d('0x2a')]['offset']);}_0x20ba59['order']=qs[_0x5e5d('0x33')](_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x33')]);_0x20ba59[_0x5e5d('0x34')]=qs[_0x5e5d('0x2b')](_[_0x5e5d('0x35')](_0x4ed6e5['query'],_0x180816[_0x5e5d('0x2b')]));if(_0x4ed6e5['query'][_0x5e5d('0x36')]){_0x20ba59[_0x5e5d('0x34')]=_[_0x5e5d('0x37')](_0x20ba59[_0x5e5d('0x34')],{'$or':_[_0x5e5d('0x38')](_0x425b5c,function(_0x5ba035){if(_0x5ba035[_0x5e5d('0x39')][_0x5e5d('0x3a')]!=='VIRTUAL'){var _0x13ec9c={};_0x13ec9c[_0x5ba035['field']]={'$like':'%'+_0x4ed6e5[_0x5e5d('0x2a')][_0x5e5d('0x36')]+'%'};return _0x13ec9c;}})});}_0x20ba59=_[_0x5e5d('0x37')]({},_0x20ba59,_0x4ed6e5[_0x5e5d('0x3b')]);var _0x25c347={'where':_0x20ba59[_0x5e5d('0x34')]};return db[_0x5e5d('0x27')][_0x5e5d('0x3c')](_0x25c347)[_0x5e5d('0x3d')](function(_0x27636d){_0x442324[_0x5e5d('0x3c')]=_0x27636d;if(_0x4ed6e5[_0x5e5d('0x2a')]['includeAll']){_0x20ba59[_0x5e5d('0x3e')]=[{'all':!![]}];}return db[_0x5e5d('0x27')][_0x5e5d('0x3f')](_0x20ba59);})[_0x5e5d('0x3d')](function(_0x225ad5){_0x442324[_0x5e5d('0x40')]=_0x225ad5;return _0x442324;})['then'](respondWithFilteredResult(_0x15abf2,_0x20ba59))[_0x5e5d('0x41')](handleError(_0x15abf2,null));};exports[_0x5e5d('0x42')]=function(_0x4c2667,_0x162e74){var _0x38698e={'raw':!![],'where':{'id':_0x4c2667[_0x5e5d('0x43')]['id']}},_0x1f1186={};_0x1f1186[_0x5e5d('0x2d')]=_[_0x5e5d('0x29')](db['VtigerField']['rawAttributes']);_0x1f1186[_0x5e5d('0x2a')]=_['keys'](_0x4c2667[_0x5e5d('0x2a')]);_0x1f1186['filters']=_['intersection'](_0x1f1186[_0x5e5d('0x2d')],_0x1f1186['query']);_0x38698e['attributes']=_[_0x5e5d('0x2c')](_0x1f1186[_0x5e5d('0x2d')],qs[_0x5e5d('0x2f')](_0x4c2667[_0x5e5d('0x2a')][_0x5e5d('0x2f')]));_0x38698e[_0x5e5d('0x2e')]=_0x38698e['attributes']['length']?_0x38698e['attributes']:_0x1f1186[_0x5e5d('0x2d')];if(_0x4c2667['query'][_0x5e5d('0x44')]){_0x38698e[_0x5e5d('0x3e')]=[{'all':!![]}];}_0x38698e=_['merge']({},_0x38698e,_0x4c2667[_0x5e5d('0x3b')]);return db[_0x5e5d('0x27')]['find'](_0x38698e)[_0x5e5d('0x3d')](handleEntityNotFound(_0x162e74,null))[_0x5e5d('0x3d')](respondWithResult(_0x162e74,null))[_0x5e5d('0x41')](handleError(_0x162e74,null));};exports[_0x5e5d('0x45')]=function(_0x3ba75f,_0x4b6fc9){return db[_0x5e5d('0x27')][_0x5e5d('0x45')](_0x3ba75f[_0x5e5d('0x46')],{})[_0x5e5d('0x3d')](respondWithResult(_0x4b6fc9,0xc9))[_0x5e5d('0x41')](handleError(_0x4b6fc9,null));};exports[_0x5e5d('0x20')]=function(_0x117e05,_0x24eb0f){if(_0x117e05['body']['id']){delete _0x117e05[_0x5e5d('0x46')]['id'];}return db[_0x5e5d('0x27')][_0x5e5d('0x47')]({'where':{'id':_0x117e05['params']['id']}})[_0x5e5d('0x3d')](handleEntityNotFound(_0x24eb0f,null))[_0x5e5d('0x3d')](saveUpdates(_0x117e05['body'],null))[_0x5e5d('0x3d')](respondWithResult(_0x24eb0f,null))[_0x5e5d('0x41')](handleError(_0x24eb0f,null));};exports[_0x5e5d('0x21')]=function(_0x56e0ac,_0x3df625){return db[_0x5e5d('0x27')][_0x5e5d('0x47')]({'where':{'id':_0x56e0ac[_0x5e5d('0x43')]['id']}})[_0x5e5d('0x3d')](handleEntityNotFound(_0x3df625,null))['then'](removeEntity(_0x3df625,null))[_0x5e5d('0x41')](handleError(_0x3df625,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index fd54a40..0f57b29 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 _0x39fc=['lodash','moment','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId'];(function(_0xb59a03,_0x4e3af0){var _0x576217=function(_0x58f93c){while(--_0x58f93c){_0xb59a03['push'](_0xb59a03['shift']());}};_0x576217(++_0x4e3af0);}(_0x39fc,0x1d6));var _0xc39f=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0x39fc[_0x2637ac];return _0x4a5758;};'use strict';var _=require(_0xc39f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc39f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc39f('0x2'));var config=require(_0xc39f('0x3'));var attributes=require('./intVtigerField.attributes');module[_0xc39f('0x4')]=function(_0x84b25f,_0x16d049){return _0x84b25f[_0xc39f('0x5')](_0xc39f('0x6'),attributes,{'tableName':_0xc39f('0x7'),'paranoid':![],'indexes':[{'name':_0xc39f('0x8'),'fields':['idField',_0xc39f('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x08e0=['request-promise','path','../../config/environment','define','VtigerField','vtiger_unique_index','idField','FieldId','lodash','util','bluebird'];(function(_0x5bfb95,_0x5c7940){var _0x2d17b9=function(_0xd4ff1c){while(--_0xd4ff1c){_0x5bfb95['push'](_0x5bfb95['shift']());}};_0x2d17b9(++_0x5c7940);}(_0x08e0,0x1e1));var _0x008e=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x08e0[_0x391c55];return _0xa434e0;};'use strict';var _=require(_0x008e('0x0'));var util=require(_0x008e('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x008e('0x2'));var rp=require(_0x008e('0x3'));var fs=require('fs');var path=require(_0x008e('0x4'));var rimraf=require('rimraf');var config=require(_0x008e('0x5'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x43ebba,_0x1c9220){return _0x43ebba[_0x008e('0x6')](_0x008e('0x7'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x008e('0x8'),'fields':[_0x008e('0x9'),_0x008e('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 94f8a6b..9ddcc3b 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 _0xa87e=['info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa87e,0x1bf));var _0xea87=function(_0x4a6d54,_0x4a2373){_0x4a6d54=_0x4a6d54-0x0;var _0x3812d9=_0xa87e[_0x4a6d54];return _0x3812d9;};'use strict';var _=require(_0xea87('0x0'));var util=require('util');var moment=require(_0xea87('0x1'));var BPromise=require(_0xea87('0x2'));var rs=require(_0xea87('0x3'));var fs=require('fs');var Redis=require(_0xea87('0x4'));var db=require(_0xea87('0x5'))['db'];var utils=require(_0xea87('0x6'));var logger=require(_0xea87('0x7'))('rpc');var config=require(_0xea87('0x8'));var jayson=require(_0xea87('0x9'));var client=jayson[_0xea87('0xa')][_0xea87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x246150,_0x4b9403,_0x2b2452){return new BPromise(function(_0x5cc5fe,_0x4fcc92){return client['request'](_0x246150,_0x2b2452)[_0xea87('0xc')](function(_0x2c48d2){logger[_0xea87('0xd')](_0xea87('0xe'),_0x4b9403,_0xea87('0xf'));logger[_0xea87('0x10')](_0xea87('0x11'),_0x4b9403,'request\x20sent',JSON[_0xea87('0x12')](_0x2c48d2));if(_0x2c48d2[_0xea87('0x13')]){if(_0x2c48d2[_0xea87('0x13')][_0xea87('0x14')]===0x1f4){logger[_0xea87('0x13')]('VtigerField,\x20%s,\x20%s',_0x4b9403,_0x2c48d2[_0xea87('0x13')][_0xea87('0x15')]);return _0x4fcc92(_0x2c48d2[_0xea87('0x13')][_0xea87('0x15')]);}logger[_0xea87('0x13')](_0xea87('0xe'),_0x4b9403,_0x2c48d2[_0xea87('0x13')][_0xea87('0x15')]);return _0x5cc5fe(_0x2c48d2[_0xea87('0x13')]['message']);}else{logger[_0xea87('0xd')](_0xea87('0xe'),_0x4b9403,'request\x20sent');_0x5cc5fe(_0x2c48d2[_0xea87('0x16')]['message']);}})['catch'](function(_0x446ec7){logger[_0xea87('0x13')](_0xea87('0xe'),_0x4b9403,_0x446ec7);_0x4fcc92(_0x446ec7);});});} \ No newline at end of file +var _0x30fb=['code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x30fb,0x13e));var _0xb30f=function(_0x222fb3,_0x8ffafd){_0x222fb3=_0x222fb3-0x0;var _0x7ee839=_0x30fb[_0x222fb3];return _0x7ee839;};'use strict';var _=require(_0xb30f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb30f('0x1'));var rs=require(_0xb30f('0x2'));var fs=require('fs');var Redis=require(_0xb30f('0x3'));var db=require(_0xb30f('0x4'))['db'];var utils=require(_0xb30f('0x5'));var logger=require(_0xb30f('0x6'))(_0xb30f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb30f('0x8')][_0xb30f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5de1c1,_0x4341ea,_0x744084){return new BPromise(function(_0x5e1b9d,_0x58ac3c){return client[_0xb30f('0xa')](_0x5de1c1,_0x744084)['then'](function(_0x331c23){logger[_0xb30f('0xb')](_0xb30f('0xc'),_0x4341ea,_0xb30f('0xd'));logger[_0xb30f('0xe')](_0xb30f('0xf'),_0x4341ea,_0xb30f('0xd'),JSON[_0xb30f('0x10')](_0x331c23));if(_0x331c23['error']){if(_0x331c23[_0xb30f('0x11')][_0xb30f('0x12')]===0x1f4){logger[_0xb30f('0x11')]('VtigerField,\x20%s,\x20%s',_0x4341ea,_0x331c23[_0xb30f('0x11')]['message']);return _0x58ac3c(_0x331c23['error'][_0xb30f('0x13')]);}logger[_0xb30f('0x11')](_0xb30f('0xc'),_0x4341ea,_0x331c23[_0xb30f('0x11')]['message']);return _0x5e1b9d(_0x331c23[_0xb30f('0x11')][_0xb30f('0x13')]);}else{logger[_0xb30f('0xb')]('VtigerField,\x20%s,\x20%s',_0x4341ea,_0xb30f('0xd'));_0x5e1b9d(_0x331c23['result'][_0xb30f('0x13')]);}})[_0xb30f('0x14')](function(_0x3d6b36){logger[_0xb30f('0x11')](_0xb30f('0xc'),_0x4341ea,_0x3d6b36);_0x58ac3c(_0x3d6b36);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index d3df3cb..c820c36 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 _0x0b9b=['./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b9b,0x77));var _0xb0b9=function(_0x1f2e8e,_0xc21558){_0x1f2e8e=_0x1f2e8e-0x0;var _0x307914=_0x0b9b[_0x1f2e8e];return _0x307914;};'use strict';var multer=require(_0xb0b9('0x0'));var util=require(_0xb0b9('0x1'));var path=require('path');var timeout=require(_0xb0b9('0x2'));var express=require(_0xb0b9('0x3'));var router=express['Router']();var auth=require(_0xb0b9('0x4'));var interaction=require(_0xb0b9('0x5'));var config=require(_0xb0b9('0x6'));var controller=require(_0xb0b9('0x7'));router[_0xb0b9('0x8')]('/',auth[_0xb0b9('0x9')](),controller['index']);router['get'](_0xb0b9('0xa'),auth[_0xb0b9('0x9')](),controller[_0xb0b9('0xb')]);router[_0xb0b9('0x8')](_0xb0b9('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xb0b9('0x8')](_0xb0b9('0xd'),auth[_0xb0b9('0x9')](),controller[_0xb0b9('0xe')]);router[_0xb0b9('0xf')]('/',auth[_0xb0b9('0x9')](),controller['create']);router[_0xb0b9('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xb0b9('0x10')](_0xb0b9('0xa'),auth['isAuthenticated'](),controller[_0xb0b9('0x11')]);router[_0xb0b9('0x12')](_0xb0b9('0xa'),auth[_0xb0b9('0x9')](),controller[_0xb0b9('0x13')]);module[_0xb0b9('0x14')]=router; \ No newline at end of file +var _0xd6e8=['./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9fb75,_0x2b0232){var _0x4ddb83=function(_0x11d062){while(--_0x11d062){_0x9fb75['push'](_0x9fb75['shift']());}};_0x4ddb83(++_0x2b0232);}(_0xd6e8,0xb0));var _0x8d6e=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xd6e8[_0x30a31e];return _0x170879;};'use strict';var multer=require(_0x8d6e('0x0'));var util=require(_0x8d6e('0x1'));var path=require(_0x8d6e('0x2'));var timeout=require(_0x8d6e('0x3'));var express=require(_0x8d6e('0x4'));var router=express['Router']();var auth=require(_0x8d6e('0x5'));var interaction=require(_0x8d6e('0x6'));var config=require(_0x8d6e('0x7'));var controller=require(_0x8d6e('0x8'));router[_0x8d6e('0x9')]('/',auth[_0x8d6e('0xa')](),controller[_0x8d6e('0xb')]);router['get'](_0x8d6e('0xc'),auth[_0x8d6e('0xa')](),controller[_0x8d6e('0xd')]);router[_0x8d6e('0x9')]('/:id/configurations',auth[_0x8d6e('0xa')](),controller[_0x8d6e('0xe')]);router['get'](_0x8d6e('0xf'),auth[_0x8d6e('0xa')](),controller[_0x8d6e('0x10')]);router[_0x8d6e('0x11')]('/',auth[_0x8d6e('0xa')](),controller[_0x8d6e('0x12')]);router[_0x8d6e('0x11')]('/:id/configurations',auth[_0x8d6e('0xa')](),controller['addConfiguration']);router[_0x8d6e('0x13')](_0x8d6e('0xc'),auth[_0x8d6e('0xa')](),controller[_0x8d6e('0x14')]);router[_0x8d6e('0x15')](_0x8d6e('0xc'),auth['isAuthenticated'](),controller[_0x8d6e('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 9698d1f..c5afd56 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 _0x4509=['ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri'];(function(_0x572f5b,_0x363ed2){var _0x2f702f=function(_0x45a7b3){while(--_0x45a7b3){_0x572f5b['push'](_0x572f5b['shift']());}};_0x2f702f(++_0x363ed2);}(_0x4509,0xd7));var _0x9450=function(_0x43f452,_0x35a131){_0x43f452=_0x43f452-0x0;var _0x5eca57=_0x4509[_0x43f452];return _0x5eca57;};'use strict';var Sequelize=require(_0x9450('0x0'));module[_0x9450('0x1')]={'name':{'type':Sequelize[_0x9450('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9450('0x2')],'unique':_0x9450('0x3')},'password':{'type':Sequelize[_0x9450('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9450('0x2')],'unique':_0x9450('0x4')},'authType':{'type':Sequelize[_0x9450('0x5')](_0x9450('0x6'),_0x9450('0x7')),'defaultValue':_0x9450('0x6')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9450('0x5')](_0x9450('0x8'),_0x9450('0x9')),'defaultValue':_0x9450('0x8')}}; \ No newline at end of file +var _0x1340=['ENUM','password','token','integrationTab','exports','STRING','remoteUri'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1340,0x74));var _0x0134=function(_0x519cee,_0x3e4053){_0x519cee=_0x519cee-0x0;var _0x41e344=_0x1340[_0x519cee];return _0x41e344;};'use strict';var Sequelize=require('sequelize');module[_0x0134('0x0')]={'name':{'type':Sequelize[_0x0134('0x1')]},'description':{'type':Sequelize[_0x0134('0x1')]},'username':{'type':Sequelize[_0x0134('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x0134('0x1')]},'token':{'type':Sequelize[_0x0134('0x1')]},'remoteUri':{'type':Sequelize[_0x0134('0x1')],'unique':_0x0134('0x2')},'authType':{'type':Sequelize[_0x0134('0x3')](_0x0134('0x4'),_0x0134('0x5')),'defaultValue':_0x0134('0x4')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0134('0x3')](_0x0134('0x6'),'newTab'),'defaultValue':_0x0134('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 1b7edce..4340b28 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 _0x946d=['lastIndexOf','GET','format','password','headers','Basic\x20%s','%s:%s','username','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','ticket_fields','position','system_field_options','custom_field_options','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','keys','query','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','map','type','key','VIRTUAL','field','filter','merge','options','ZendeskAccount','count','include','findAll','rows','show','params','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','Descriptions','getDescriptions','channel','ZendeskField','getFields','token','authType','remoteUri','slice','substring'];(function(_0x572222,_0x59ace3){var _0x1cd5b5=function(_0x61f5e2){while(--_0x61f5e2){_0x572222['push'](_0x572222['shift']());}};_0x1cd5b5(++_0x59ace3);}(_0x946d,0x1a7));var _0xd946=function(_0x4e40e0,_0x11f947){_0x4e40e0=_0x4e40e0-0x0;var _0x5b68b3=_0x946d[_0x4e40e0];return _0x5b68b3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd946('0x0'));var zipdir=require(_0xd946('0x1'));var jsonpatch=require(_0xd946('0x2'));var rp=require('request-promise');var moment=require(_0xd946('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd946('0x4'));var path=require(_0xd946('0x5'));var sox=require(_0xd946('0x6'));var csv=require(_0xd946('0x7'));var ejs=require(_0xd946('0x8'));var fs=require('fs');var _=require(_0xd946('0x9'));var squel=require('squel');var crypto=require(_0xd946('0xa'));var jsforce=require(_0xd946('0xb'));var deskjs=require(_0xd946('0xc'));var toCsv=require(_0xd946('0x7'));var querystring=require('querystring');var Papa=require(_0xd946('0xd'));var Redis=require(_0xd946('0xe'));var authService=require(_0xd946('0xf'));var qs=require(_0xd946('0x10'));var hardwareService=require(_0xd946('0x11'));var logger=require(_0xd946('0x12'))(_0xd946('0x13'));var utils=require('../../config/utils');var config=require(_0xd946('0x14'));var db=require(_0xd946('0x15'))['db'];var integrations=require(_0xd946('0x16'));var jayson=require(_0xd946('0x17'));var client=jayson[_0xd946('0x18')][_0xd946('0x19')]({'port':0x232a});function checkPasswordPattern(_0x7933ef,_0x238d50,_0x21c1c8){if(_0x21c1c8){var _0x179e36=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x179e36[_0xd946('0x1a')](_0x238d50)){return _0x7933ef;}else{throw new Error(_0xd946('0x1b'));}}else{return _0x7933ef;}}function respondWithRpcPromise(_0xa27f65,_0x3272a7,_0x50abfc,_0x151fba){return new BPromise(function(_0x2cd505,_0x168674){var _0x29e551=_0x151fba||client;return _0x29e551[_0xd946('0x1c')](_0xa27f65,_0x50abfc)[_0xd946('0x1d')](function(_0x1160ea){logger[_0xd946('0x1e')](_0xd946('0x1f'),_0x3272a7,'request\x20sent');logger['debug'](_0xd946('0x20'),_0x3272a7,_0xd946('0x21'),JSON['stringify'](_0x1160ea));if(_0x1160ea['error']){if(_0x1160ea[_0xd946('0x22')][_0xd946('0x23')]===0x1f4){logger['error'](_0xd946('0x1f'),_0x3272a7,_0x1160ea[_0xd946('0x22')][_0xd946('0x24')]);return _0x168674(_0x1160ea[_0xd946('0x22')][_0xd946('0x24')]);}logger['error'](_0xd946('0x1f'),_0x3272a7,_0x1160ea[_0xd946('0x22')]['message']);return _0x2cd505(_0x1160ea[_0xd946('0x22')][_0xd946('0x24')]);}else{logger[_0xd946('0x1e')](_0xd946('0x1f'),_0x3272a7,_0xd946('0x21'));_0x2cd505(_0x1160ea[_0xd946('0x25')][_0xd946('0x24')]);}})[_0xd946('0x26')](function(_0x41e690){logger[_0xd946('0x22')](_0xd946('0x1f'),_0x3272a7,_0x41e690);_0x168674(_0x41e690);});});}function respondWithStatusCode(_0x2ff9be,_0x146e4a){_0x146e4a=_0x146e4a||0xcc;return function(_0x29b25f){if(_0x29b25f){return _0x2ff9be[_0xd946('0x27')](_0x146e4a);}return _0x2ff9be[_0xd946('0x28')](_0x146e4a)[_0xd946('0x29')]();};}function respondWithResult(_0xde6ca4,_0x3f4932){_0x3f4932=_0x3f4932||0xc8;return function(_0x542840){if(_0x542840){return _0xde6ca4[_0xd946('0x28')](_0x3f4932)[_0xd946('0x2a')](_0x542840);}};}function respondWithFilteredResult(_0x586e06,_0x3883aa){return function(_0x30c4fe){if(_0x30c4fe){var _0x484f51=_0x30c4fe['count'],_0x4b22cb=_0x3883aa[_0xd946('0x2b')],_0x27e447=_0x3883aa[_0xd946('0x2b')]+_0x3883aa[_0xd946('0x2c')],_0x5c3e06;if(_0x27e447>=_0x484f51){_0x27e447=_0x484f51;_0x5c3e06=0xc8;}else{_0x5c3e06=0xce;}_0x586e06['status'](_0x5c3e06);return _0x586e06[_0xd946('0x2d')]('Content-Range',_0x4b22cb+'-'+_0x27e447+'/'+_0x484f51)[_0xd946('0x2a')](_0x30c4fe);}return null;};}function patchUpdates(_0x26434f){return function(_0xeaad6){try{jsonpatch[_0xd946('0x2e')](_0xeaad6,_0x26434f,!![]);}catch(_0x2b7063){return BPromise[_0xd946('0x2f')](_0x2b7063);}return _0xeaad6[_0xd946('0x30')]();};}function saveUpdates(_0x86a809,_0xffe6b7){return function(_0x200faa){if(_0x200faa){return _0x200faa[_0xd946('0x31')](_0x86a809)['then'](function(_0x37d8f3){return _0x37d8f3;});}return null;};}function removeEntity(_0x20b350,_0x422ed3){return function(_0x2bf796){if(_0x2bf796){return _0x2bf796[_0xd946('0x32')]()[_0xd946('0x1d')](function(){_0x20b350[_0xd946('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1615d,_0x484997){return function(_0x1a381c){if(!_0x1a381c){_0xc1615d[_0xd946('0x27')](0x194);}return _0x1a381c;};}function handleError(_0x148186,_0x4ac1f4){_0x4ac1f4=_0x4ac1f4||0x1f4;return function(_0x3be77f){logger[_0xd946('0x22')](_0x3be77f[_0xd946('0x33')]);if(_0x3be77f[_0xd946('0x34')]){delete _0x3be77f[_0xd946('0x34')];}_0x148186[_0xd946('0x28')](_0x4ac1f4)[_0xd946('0x35')](_0x3be77f);};}exports[_0xd946('0x36')]=function(_0x31356c,_0x1e1f94){var _0x119375={},_0x7a8bd6={},_0x1a8635={'count':0x0,'rows':[]};var _0x8c7829=db['ZendeskAccount'][_0xd946('0x37')];_0x7a8bd6['model']=_[_0xd946('0x38')](_0x8c7829);_0x7a8bd6['query']=_[_0xd946('0x38')](_0x31356c[_0xd946('0x39')]);_0x7a8bd6['filters']=_[_0xd946('0x3a')](_0x7a8bd6[_0xd946('0x3b')],_0x7a8bd6[_0xd946('0x39')]);_0x119375['attributes']=_[_0xd946('0x3a')](_0x7a8bd6[_0xd946('0x3b')],qs[_0xd946('0x3c')](_0x31356c[_0xd946('0x39')][_0xd946('0x3c')]));_0x119375['attributes']=_0x119375['attributes'][_0xd946('0x3d')]?_0x119375[_0xd946('0x3e')]:_0x7a8bd6['model'];if(!_0x31356c[_0xd946('0x39')][_0xd946('0x3f')](_0xd946('0x40'))){_0x119375[_0xd946('0x2c')]=qs[_0xd946('0x2c')](_0x31356c['query'][_0xd946('0x2c')]);_0x119375[_0xd946('0x2b')]=qs[_0xd946('0x2b')](_0x31356c['query'][_0xd946('0x2b')]);}_0x119375[_0xd946('0x41')]=qs[_0xd946('0x42')](_0x31356c[_0xd946('0x39')][_0xd946('0x42')]);_0x119375[_0xd946('0x43')]=qs[_0xd946('0x44')](_['pick'](_0x31356c['query'],_0x7a8bd6[_0xd946('0x44')]));if(_0x31356c['query']['filter']){_0x119375[_0xd946('0x43')]=_['merge'](_0x119375[_0xd946('0x43')],{'$or':_[_0xd946('0x45')](_0x8c7829,function(_0x4c1e75){if(_0x4c1e75[_0xd946('0x46')][_0xd946('0x47')]!==_0xd946('0x48')){var _0x3fcf16={};_0x3fcf16[_0x4c1e75[_0xd946('0x49')]]={'$like':'%'+_0x31356c[_0xd946('0x39')][_0xd946('0x4a')]+'%'};return _0x3fcf16;}})});}_0x119375=_[_0xd946('0x4b')]({},_0x119375,_0x31356c[_0xd946('0x4c')]);var _0x71b564={'where':_0x119375[_0xd946('0x43')]};return db[_0xd946('0x4d')][_0xd946('0x4e')](_0x71b564)['then'](function(_0x171af3){_0x1a8635[_0xd946('0x4e')]=_0x171af3;if(_0x31356c[_0xd946('0x39')]['includeAll']){_0x119375[_0xd946('0x4f')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xd946('0x50')](_0x119375);})[_0xd946('0x1d')](function(_0x3fe1c2){_0x1a8635[_0xd946('0x51')]=_0x3fe1c2;return _0x1a8635;})[_0xd946('0x1d')](respondWithFilteredResult(_0x1e1f94,_0x119375))[_0xd946('0x26')](handleError(_0x1e1f94,null));};exports[_0xd946('0x52')]=function(_0x244320,_0x5444fa){var _0x474c8c={'raw':![],'where':{'id':_0x244320[_0xd946('0x53')]['id']}},_0x3f5d9b={};_0x3f5d9b[_0xd946('0x3b')]=_['keys'](db[_0xd946('0x4d')]['rawAttributes']);_0x3f5d9b['query']=_[_0xd946('0x38')](_0x244320[_0xd946('0x39')]);_0x3f5d9b[_0xd946('0x44')]=_[_0xd946('0x3a')](_0x3f5d9b[_0xd946('0x3b')],_0x3f5d9b[_0xd946('0x39')]);_0x474c8c[_0xd946('0x3e')]=_[_0xd946('0x3a')](_0x3f5d9b['model'],qs[_0xd946('0x3c')](_0x244320[_0xd946('0x39')][_0xd946('0x3c')]));_0x474c8c[_0xd946('0x3e')]=_0x474c8c['attributes'][_0xd946('0x3d')]?_0x474c8c['attributes']:_0x3f5d9b['model'];if(_0x244320[_0xd946('0x39')][_0xd946('0x54')]){_0x474c8c[_0xd946('0x4f')]=[{'all':!![]}];}_0x474c8c=_[_0xd946('0x4b')]({},_0x474c8c,_0x244320[_0xd946('0x4c')]);return db[_0xd946('0x4d')][_0xd946('0x55')](_0x474c8c)[_0xd946('0x1d')](handleEntityNotFound(_0x5444fa,null))['then'](respondWithResult(_0x5444fa,null))[_0xd946('0x26')](handleError(_0x5444fa,null));};exports['create']=function(_0x494872,_0x433b59){return db[_0xd946('0x4d')][_0xd946('0x56')](_0x494872[_0xd946('0x57')],{})[_0xd946('0x1d')](respondWithResult(_0x433b59,0xc9))['catch'](handleError(_0x433b59,null));};exports[_0xd946('0x31')]=function(_0x161330,_0x488a6b){if(_0x161330['body']['id']){delete _0x161330[_0xd946('0x57')]['id'];}return db[_0xd946('0x4d')][_0xd946('0x55')]({'where':{'id':_0x161330[_0xd946('0x53')]['id']}})[_0xd946('0x1d')](handleEntityNotFound(_0x488a6b,null))[_0xd946('0x1d')](saveUpdates(_0x161330[_0xd946('0x57')],null))['then'](respondWithResult(_0x488a6b,null))['catch'](handleError(_0x488a6b,null));};exports['destroy']=function(_0x232da0,_0x59e0c0){return db[_0xd946('0x4d')][_0xd946('0x55')]({'where':{'id':_0x232da0[_0xd946('0x53')]['id']}})[_0xd946('0x1d')](handleEntityNotFound(_0x59e0c0,null))[_0xd946('0x1d')](removeEntity(_0x59e0c0,null))[_0xd946('0x26')](handleError(_0x59e0c0,null));};exports[_0xd946('0x58')]=function(_0x2f5ceb,_0x5f0999,_0x7ab7df){var _0x5a9f29={};var _0x57913e={};var _0x3acd42;var _0x30b15f;return db[_0xd946('0x4d')][_0xd946('0x59')]({'where':{'id':_0x2f5ceb[_0xd946('0x53')]['id']}})[_0xd946('0x1d')](handleEntityNotFound(_0x5f0999,null))[_0xd946('0x1d')](function(_0x12a58a){if(_0x12a58a){_0x3acd42=_0x12a58a;_0x57913e[_0xd946('0x3b')]=_[_0xd946('0x38')](db[_0xd946('0x5a')][_0xd946('0x37')]);_0x57913e[_0xd946('0x39')]=_[_0xd946('0x38')](_0x2f5ceb['query']);_0x57913e[_0xd946('0x44')]=_['intersection'](_0x57913e[_0xd946('0x3b')],_0x57913e[_0xd946('0x39')]);_0x5a9f29['attributes']=_[_0xd946('0x3a')](_0x57913e[_0xd946('0x3b')],qs[_0xd946('0x3c')](_0x2f5ceb[_0xd946('0x39')]['fields']));_0x5a9f29[_0xd946('0x3e')]=_0x5a9f29[_0xd946('0x3e')][_0xd946('0x3d')]?_0x5a9f29[_0xd946('0x3e')]:_0x57913e['model'];_0x5a9f29[_0xd946('0x41')]=qs['sort'](_0x2f5ceb[_0xd946('0x39')]['sort']);_0x5a9f29['where']=qs['filters'](_[_0xd946('0x5b')](_0x2f5ceb[_0xd946('0x39')],_0x57913e[_0xd946('0x44')]));if(_0x2f5ceb[_0xd946('0x39')][_0xd946('0x4a')]){_0x5a9f29[_0xd946('0x43')]=_[_0xd946('0x4b')](_0x5a9f29[_0xd946('0x43')],{'$or':_[_0xd946('0x45')](_0x5a9f29[_0xd946('0x3e')],function(_0x45a0df){var _0x42cd1e={};_0x42cd1e[_0x45a0df]={'$like':'%'+_0x2f5ceb[_0xd946('0x39')][_0xd946('0x4a')]+'%'};return _0x42cd1e;})});}_0x5a9f29=_[_0xd946('0x4b')]({},_0x5a9f29,_0x2f5ceb[_0xd946('0x4c')]);return _0x3acd42[_0xd946('0x58')](_0x5a9f29);}})[_0xd946('0x1d')](function(_0x2e727d){if(_0x2e727d){_0x30b15f=_0x2e727d[_0xd946('0x3d')];if(!_0x2f5ceb[_0xd946('0x39')]['hasOwnProperty']('nolimit')){_0x5a9f29[_0xd946('0x2c')]=qs[_0xd946('0x2c')](_0x2f5ceb[_0xd946('0x39')][_0xd946('0x2c')]);_0x5a9f29[_0xd946('0x2b')]=qs[_0xd946('0x2b')](_0x2f5ceb[_0xd946('0x39')][_0xd946('0x2b')]);}return _0x3acd42[_0xd946('0x58')](_0x5a9f29);}})['then'](function(_0x53250c){if(_0x53250c){return _0x53250c?{'count':_0x30b15f,'rows':_0x53250c}:null;}})[_0xd946('0x1d')](respondWithResult(_0x5f0999,null))[_0xd946('0x26')](handleError(_0x5f0999,null));};exports[_0xd946('0x5c')]=function(_0xf8741c,_0x5c2f0e,_0x37b5a2){if(_0xf8741c[_0xd946('0x57')]['id']){delete _0xf8741c[_0xd946('0x57')]['id'];}return db[_0xd946('0x4d')][_0xd946('0x59')]({'where':{'id':_0xf8741c[_0xd946('0x53')]['id']}})[_0xd946('0x1d')](handleEntityNotFound(_0x5c2f0e,null))[_0xd946('0x1d')](function(_0x421abd){if(_0x421abd){_0xf8741c[_0xd946('0x57')][_0xd946('0x5d')]=_0x421abd['id'];_0xf8741c[_0xd946('0x57')][_0xd946('0x5e')]=integrations['getSubjects'](_0xf8741c[_0xd946('0x57')]['channel'],_0xf8741c[_0xd946('0x57')][_0xd946('0x46')]);_0xf8741c['body'][_0xd946('0x5f')]=integrations[_0xd946('0x60')](_0xf8741c[_0xd946('0x57')][_0xd946('0x61')],_0xf8741c[_0xd946('0x57')]['type']);return db['ZendeskConfiguration'][_0xd946('0x56')](_0xf8741c[_0xd946('0x57')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0xd946('0x62')],'as':_0xd946('0x5f')}]});}return null;})[_0xd946('0x1d')](respondWithResult(_0x5c2f0e,null))[_0xd946('0x26')](handleError(_0x5c2f0e,null));};exports[_0xd946('0x63')]=function(_0x5bf415,_0x28ba01,_0x19e6c3){var _0x85b6c8='';return db[_0xd946('0x4d')][_0xd946('0x59')]({'where':{'id':_0x5bf415[_0xd946('0x53')]['id']},'attributes':['id','username','password',_0xd946('0x64'),_0xd946('0x65'),_0xd946('0x66')]})['then'](handleEntityNotFound(_0x28ba01,null))[_0xd946('0x1d')](function(_0x1e9da7){if(_0x1e9da7){_0x85b6c8=_0x1e9da7['remoteUri'];var _0x432eea=_0x85b6c8[_0xd946('0x67')](-0x1);if(_0x432eea==='/'){_0x85b6c8=_0x85b6c8[_0xd946('0x68')](0x0,_0x85b6c8[_0xd946('0x69')](_0x432eea));}var _0x31deeb={'method':_0xd946('0x6a'),'uri':util[_0xd946('0x6b')]('%s/%s',_0x85b6c8,'ticket_fields'),'json':!![]};switch(_0x1e9da7[_0xd946('0x65')]){case _0xd946('0x6c'):_0x31deeb[_0xd946('0x6d')]={'Authorization':util[_0xd946('0x6b')](_0xd946('0x6e'),new Buffer(util[_0xd946('0x6b')](_0xd946('0x6f'),_0x1e9da7[_0xd946('0x70')],_0x1e9da7[_0xd946('0x6c')]))['toString'](_0xd946('0x71')))};break;case'token':_0x31deeb[_0xd946('0x6d')]={'Authorization':util['format'](_0xd946('0x6e'),new Buffer(util[_0xd946('0x6b')](_0xd946('0x72'),_0x1e9da7[_0xd946('0x70')],_0x1e9da7[_0xd946('0x64')]))[_0xd946('0x73')](_0xd946('0x71')))};break;default:throw new db[(_0xd946('0x74'))][(_0xd946('0x75'))](_0xd946('0x76'));}return rp(_0x31deeb);}})[_0xd946('0x1d')](function(_0x16e87c){if(_0x16e87c){var _0x2de7d9=[_0xd946('0x77'),_0xd946('0x78'),_0xd946('0x79'),_0xd946('0x7a')];_[_0xd946('0x7b')](_0x16e87c['ticket_fields'],function(_0x214fca){return _0x2de7d9[_0xd946('0x7c')](_0x214fca[_0xd946('0x46')]);});return{'count':_0x16e87c[_0xd946('0x7d')][_0xd946('0x3d')],'rows':_[_0xd946('0x45')](_0x16e87c[_0xd946('0x7d')],function(_0x27b3c6){return{'id':_0x27b3c6['id'],'name':_0x27b3c6[_0xd946('0x7e')]>0x7?_0x27b3c6['title']:_0x27b3c6['type'],'custom':_0x27b3c6[_0xd946('0x7e')]>0x7?!![]:![],'options':_0x27b3c6[_0xd946('0x7f')]?_0x27b3c6[_0xd946('0x7f')]:_0x27b3c6[_0xd946('0x80')]?_0x27b3c6[_0xd946('0x80')]:[]};})};}})['then'](respondWithResult(_0x28ba01,null))['catch'](function(_0xfc0db6){var _0x3b9a09=_0x5bf415[_0xd946('0x39')][_0xd946('0x1a')]?0x1f4:_0xfc0db6[_0xd946('0x81')]||0x1f4;logger[_0xd946('0x22')]('getFields,\x20%s,\x20%s,\x20%s',_0xd946('0x63'),_0x3b9a09,JSON[_0xd946('0x82')](_0xfc0db6));delete _0xfc0db6[_0xd946('0x34')];if(_0x3b9a09===0x191){_0x3b9a09=0x190;}_0x28ba01[_0xd946('0x28')](_0x3b9a09)[_0xd946('0x35')](_0x5bf415[_0xd946('0x39')][_0xd946('0x1a')]?{'message':_0xd946('0x83'),'statusCode':_0xfc0db6[_0xd946('0x81')]}:_0xfc0db6);});}; \ No newline at end of file +var _0x2de4=['show','include','find','create','body','params','getConfigurations','map','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','type','ZendeskField','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','headers','%s:%s','toString','base64','Basic\x20%s','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','description','group','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../components/integrations/configuration','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','code','error','ZendeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','index','ZendeskAccount','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','findAll','rows'];(function(_0x5ddf0e,_0x3eed0b){var _0x1b5a0c=function(_0x56af0b){while(--_0x56af0b){_0x5ddf0e['push'](_0x5ddf0e['shift']());}};_0x1b5a0c(++_0x3eed0b);}(_0x2de4,0x1a9));var _0x42de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2de4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x42de('0x0'));var emlformat=require(_0x42de('0x1'));var rimraf=require(_0x42de('0x2'));var zipdir=require(_0x42de('0x3'));var jsonpatch=require(_0x42de('0x4'));var rp=require(_0x42de('0x5'));var moment=require(_0x42de('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x42de('0x7'));var util=require('util');var path=require(_0x42de('0x8'));var sox=require('sox');var csv=require(_0x42de('0x9'));var ejs=require(_0x42de('0xa'));var fs=require('fs');var _=require(_0x42de('0xb'));var squel=require(_0x42de('0xc'));var crypto=require(_0x42de('0xd'));var jsforce=require(_0x42de('0xe'));var deskjs=require(_0x42de('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x42de('0x10'));var Redis=require(_0x42de('0x11'));var authService=require(_0x42de('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x42de('0x13'))(_0x42de('0x14'));var utils=require('../../config/utils');var config=require(_0x42de('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x42de('0x16'));var jayson=require('jayson/promise');var client=jayson['client'][_0x42de('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3dc31e,_0x1121dd,_0x1fa011){if(_0x1fa011){var _0x4dc49a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4dc49a[_0x42de('0x18')](_0x1121dd)){return _0x3dc31e;}else{throw new Error(_0x42de('0x19'));}}else{return _0x3dc31e;}}function respondWithRpcPromise(_0x337f66,_0x3101a0,_0xbc82f,_0x222803){return new BPromise(function(_0x2ed9d4,_0x11b3c4){var _0x49bc51=_0x222803||client;return _0x49bc51[_0x42de('0x1a')](_0x337f66,_0xbc82f)[_0x42de('0x1b')](function(_0x800f7f){logger[_0x42de('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x3101a0,_0x42de('0x1d'));logger['debug']('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x3101a0,_0x42de('0x1d'),JSON[_0x42de('0x1e')](_0x800f7f));if(_0x800f7f['error']){if(_0x800f7f['error'][_0x42de('0x1f')]===0x1f4){logger[_0x42de('0x20')](_0x42de('0x21'),_0x3101a0,_0x800f7f[_0x42de('0x20')][_0x42de('0x22')]);return _0x11b3c4(_0x800f7f[_0x42de('0x20')]['message']);}logger[_0x42de('0x20')](_0x42de('0x21'),_0x3101a0,_0x800f7f[_0x42de('0x20')]['message']);return _0x2ed9d4(_0x800f7f[_0x42de('0x20')][_0x42de('0x22')]);}else{logger[_0x42de('0x1c')](_0x42de('0x21'),_0x3101a0,_0x42de('0x1d'));_0x2ed9d4(_0x800f7f[_0x42de('0x23')][_0x42de('0x22')]);}})[_0x42de('0x24')](function(_0x4033b8){logger['error'](_0x42de('0x21'),_0x3101a0,_0x4033b8);_0x11b3c4(_0x4033b8);});});}function respondWithStatusCode(_0x437c45,_0x403e4a){_0x403e4a=_0x403e4a||0xcc;return function(_0x1a9f18){if(_0x1a9f18){return _0x437c45[_0x42de('0x25')](_0x403e4a);}return _0x437c45[_0x42de('0x26')](_0x403e4a)[_0x42de('0x27')]();};}function respondWithResult(_0x1bb401,_0x4ec06d){_0x4ec06d=_0x4ec06d||0xc8;return function(_0x753802){if(_0x753802){return _0x1bb401[_0x42de('0x26')](_0x4ec06d)[_0x42de('0x28')](_0x753802);}};}function respondWithFilteredResult(_0x4fdd4d,_0x3a65f2){return function(_0x2da998){if(_0x2da998){var _0x325f7c=_0x2da998[_0x42de('0x29')],_0x484693=_0x3a65f2[_0x42de('0x2a')],_0x332662=_0x3a65f2[_0x42de('0x2a')]+_0x3a65f2[_0x42de('0x2b')],_0x2e4f49;if(_0x332662>=_0x325f7c){_0x332662=_0x325f7c;_0x2e4f49=0xc8;}else{_0x2e4f49=0xce;}_0x4fdd4d['status'](_0x2e4f49);return _0x4fdd4d[_0x42de('0x2c')](_0x42de('0x2d'),_0x484693+'-'+_0x332662+'/'+_0x325f7c)[_0x42de('0x28')](_0x2da998);}return null;};}function patchUpdates(_0xb8c8a9){return function(_0x202721){try{jsonpatch[_0x42de('0x2e')](_0x202721,_0xb8c8a9,!![]);}catch(_0x40caad){return BPromise[_0x42de('0x2f')](_0x40caad);}return _0x202721[_0x42de('0x30')]();};}function saveUpdates(_0x456beb,_0xf3e944){return function(_0x521832){if(_0x521832){return _0x521832[_0x42de('0x31')](_0x456beb)[_0x42de('0x1b')](function(_0x3e512b){return _0x3e512b;});}return null;};}function removeEntity(_0x530976,_0x1f23bd){return function(_0x152d42){if(_0x152d42){return _0x152d42[_0x42de('0x32')]()[_0x42de('0x1b')](function(){_0x530976['status'](0xcc)[_0x42de('0x27')]();});}};}function handleEntityNotFound(_0x555638,_0x2dad0f){return function(_0x10d455){if(!_0x10d455){_0x555638[_0x42de('0x25')](0x194);}return _0x10d455;};}function handleError(_0x3568a2,_0x383940){_0x383940=_0x383940||0x1f4;return function(_0x39fd47){logger[_0x42de('0x20')](_0x39fd47['stack']);if(_0x39fd47[_0x42de('0x33')]){delete _0x39fd47['name'];}_0x3568a2[_0x42de('0x26')](_0x383940)[_0x42de('0x34')](_0x39fd47);};}exports[_0x42de('0x35')]=function(_0x4509ce,_0x369269){var _0x380614={},_0x5596d5={},_0x222827={'count':0x0,'rows':[]};var _0x2381f3=db[_0x42de('0x36')][_0x42de('0x37')];_0x5596d5[_0x42de('0x38')]=_[_0x42de('0x39')](_0x2381f3);_0x5596d5[_0x42de('0x3a')]=_[_0x42de('0x39')](_0x4509ce[_0x42de('0x3a')]);_0x5596d5[_0x42de('0x3b')]=_[_0x42de('0x3c')](_0x5596d5[_0x42de('0x38')],_0x5596d5[_0x42de('0x3a')]);_0x380614[_0x42de('0x3d')]=_[_0x42de('0x3c')](_0x5596d5[_0x42de('0x38')],qs[_0x42de('0x3e')](_0x4509ce[_0x42de('0x3a')][_0x42de('0x3e')]));_0x380614['attributes']=_0x380614[_0x42de('0x3d')][_0x42de('0x3f')]?_0x380614[_0x42de('0x3d')]:_0x5596d5[_0x42de('0x38')];if(!_0x4509ce[_0x42de('0x3a')][_0x42de('0x40')](_0x42de('0x41'))){_0x380614[_0x42de('0x2b')]=qs[_0x42de('0x2b')](_0x4509ce['query'][_0x42de('0x2b')]);_0x380614[_0x42de('0x2a')]=qs[_0x42de('0x2a')](_0x4509ce[_0x42de('0x3a')][_0x42de('0x2a')]);}_0x380614[_0x42de('0x42')]=qs[_0x42de('0x43')](_0x4509ce[_0x42de('0x3a')][_0x42de('0x43')]);_0x380614[_0x42de('0x44')]=qs[_0x42de('0x3b')](_[_0x42de('0x45')](_0x4509ce[_0x42de('0x3a')],_0x5596d5[_0x42de('0x3b')]));if(_0x4509ce[_0x42de('0x3a')][_0x42de('0x46')]){_0x380614['where']=_[_0x42de('0x47')](_0x380614['where'],{'$or':_['map'](_0x2381f3,function(_0x486c7c){if(_0x486c7c['type'][_0x42de('0x48')]!==_0x42de('0x49')){var _0x43f7a6={};_0x43f7a6[_0x486c7c[_0x42de('0x4a')]]={'$like':'%'+_0x4509ce[_0x42de('0x3a')][_0x42de('0x46')]+'%'};return _0x43f7a6;}})});}_0x380614=_[_0x42de('0x47')]({},_0x380614,_0x4509ce[_0x42de('0x4b')]);var _0x1b0be1={'where':_0x380614[_0x42de('0x44')]};return db[_0x42de('0x36')][_0x42de('0x29')](_0x1b0be1)[_0x42de('0x1b')](function(_0x554516){_0x222827[_0x42de('0x29')]=_0x554516;if(_0x4509ce[_0x42de('0x3a')][_0x42de('0x4c')]){_0x380614['include']=[{'all':!![]}];}return db[_0x42de('0x36')][_0x42de('0x4d')](_0x380614);})[_0x42de('0x1b')](function(_0x476c8a){_0x222827[_0x42de('0x4e')]=_0x476c8a;return _0x222827;})[_0x42de('0x1b')](respondWithFilteredResult(_0x369269,_0x380614))[_0x42de('0x24')](handleError(_0x369269,null));};exports[_0x42de('0x4f')]=function(_0x40ddb9,_0x32a831){var _0x5720c1={'raw':![],'where':{'id':_0x40ddb9['params']['id']}},_0x1ba8ac={};_0x1ba8ac[_0x42de('0x38')]=_[_0x42de('0x39')](db['ZendeskAccount'][_0x42de('0x37')]);_0x1ba8ac[_0x42de('0x3a')]=_['keys'](_0x40ddb9[_0x42de('0x3a')]);_0x1ba8ac[_0x42de('0x3b')]=_[_0x42de('0x3c')](_0x1ba8ac[_0x42de('0x38')],_0x1ba8ac['query']);_0x5720c1['attributes']=_[_0x42de('0x3c')](_0x1ba8ac[_0x42de('0x38')],qs['fields'](_0x40ddb9['query']['fields']));_0x5720c1[_0x42de('0x3d')]=_0x5720c1['attributes'][_0x42de('0x3f')]?_0x5720c1[_0x42de('0x3d')]:_0x1ba8ac[_0x42de('0x38')];if(_0x40ddb9[_0x42de('0x3a')][_0x42de('0x4c')]){_0x5720c1[_0x42de('0x50')]=[{'all':!![]}];}_0x5720c1=_['merge']({},_0x5720c1,_0x40ddb9['options']);return db[_0x42de('0x36')][_0x42de('0x51')](_0x5720c1)[_0x42de('0x1b')](handleEntityNotFound(_0x32a831,null))['then'](respondWithResult(_0x32a831,null))[_0x42de('0x24')](handleError(_0x32a831,null));};exports[_0x42de('0x52')]=function(_0x396e49,_0x2e4eca){return db['ZendeskAccount'][_0x42de('0x52')](_0x396e49['body'],{})[_0x42de('0x1b')](respondWithResult(_0x2e4eca,0xc9))[_0x42de('0x24')](handleError(_0x2e4eca,null));};exports[_0x42de('0x31')]=function(_0x4991f6,_0x33efcf){if(_0x4991f6[_0x42de('0x53')]['id']){delete _0x4991f6[_0x42de('0x53')]['id'];}return db[_0x42de('0x36')][_0x42de('0x51')]({'where':{'id':_0x4991f6[_0x42de('0x54')]['id']}})[_0x42de('0x1b')](handleEntityNotFound(_0x33efcf,null))[_0x42de('0x1b')](saveUpdates(_0x4991f6[_0x42de('0x53')],null))[_0x42de('0x1b')](respondWithResult(_0x33efcf,null))[_0x42de('0x24')](handleError(_0x33efcf,null));};exports[_0x42de('0x32')]=function(_0x206029,_0x450340){return db[_0x42de('0x36')][_0x42de('0x51')]({'where':{'id':_0x206029['params']['id']}})['then'](handleEntityNotFound(_0x450340,null))['then'](removeEntity(_0x450340,null))[_0x42de('0x24')](handleError(_0x450340,null));};exports[_0x42de('0x55')]=function(_0x50953b,_0x7e951c,_0x1b56d5){var _0x1f88ad={};var _0xb5bb39={};var _0x33efbe;var _0x1fa62a;return db[_0x42de('0x36')]['findOne']({'where':{'id':_0x50953b['params']['id']}})[_0x42de('0x1b')](handleEntityNotFound(_0x7e951c,null))[_0x42de('0x1b')](function(_0x3a50b5){if(_0x3a50b5){_0x33efbe=_0x3a50b5;_0xb5bb39['model']=_[_0x42de('0x39')](db['ZendeskConfiguration']['rawAttributes']);_0xb5bb39['query']=_['keys'](_0x50953b['query']);_0xb5bb39[_0x42de('0x3b')]=_[_0x42de('0x3c')](_0xb5bb39[_0x42de('0x38')],_0xb5bb39[_0x42de('0x3a')]);_0x1f88ad[_0x42de('0x3d')]=_[_0x42de('0x3c')](_0xb5bb39[_0x42de('0x38')],qs['fields'](_0x50953b['query']['fields']));_0x1f88ad['attributes']=_0x1f88ad[_0x42de('0x3d')][_0x42de('0x3f')]?_0x1f88ad[_0x42de('0x3d')]:_0xb5bb39['model'];_0x1f88ad[_0x42de('0x42')]=qs['sort'](_0x50953b['query'][_0x42de('0x43')]);_0x1f88ad['where']=qs[_0x42de('0x3b')](_[_0x42de('0x45')](_0x50953b[_0x42de('0x3a')],_0xb5bb39['filters']));if(_0x50953b[_0x42de('0x3a')][_0x42de('0x46')]){_0x1f88ad['where']=_[_0x42de('0x47')](_0x1f88ad[_0x42de('0x44')],{'$or':_[_0x42de('0x56')](_0x1f88ad['attributes'],function(_0xc785ec){var _0x4d6873={};_0x4d6873[_0xc785ec]={'$like':'%'+_0x50953b[_0x42de('0x3a')][_0x42de('0x46')]+'%'};return _0x4d6873;})});}_0x1f88ad=_[_0x42de('0x47')]({},_0x1f88ad,_0x50953b[_0x42de('0x4b')]);return _0x33efbe[_0x42de('0x55')](_0x1f88ad);}})[_0x42de('0x1b')](function(_0x4ce52e){if(_0x4ce52e){_0x1fa62a=_0x4ce52e[_0x42de('0x3f')];if(!_0x50953b[_0x42de('0x3a')][_0x42de('0x40')](_0x42de('0x41'))){_0x1f88ad[_0x42de('0x2b')]=qs[_0x42de('0x2b')](_0x50953b[_0x42de('0x3a')][_0x42de('0x2b')]);_0x1f88ad[_0x42de('0x2a')]=qs[_0x42de('0x2a')](_0x50953b[_0x42de('0x3a')][_0x42de('0x2a')]);}return _0x33efbe[_0x42de('0x55')](_0x1f88ad);}})[_0x42de('0x1b')](function(_0x392ffb){if(_0x392ffb){return _0x392ffb?{'count':_0x1fa62a,'rows':_0x392ffb}:null;}})['then'](respondWithResult(_0x7e951c,null))['catch'](handleError(_0x7e951c,null));};exports['addConfiguration']=function(_0x5d119d,_0x25eac3,_0x1cd19f){if(_0x5d119d[_0x42de('0x53')]['id']){delete _0x5d119d[_0x42de('0x53')]['id'];}return db['ZendeskAccount'][_0x42de('0x57')]({'where':{'id':_0x5d119d[_0x42de('0x54')]['id']}})[_0x42de('0x1b')](handleEntityNotFound(_0x25eac3,null))[_0x42de('0x1b')](function(_0x20fa9b){if(_0x20fa9b){_0x5d119d['body'][_0x42de('0x58')]=_0x20fa9b['id'];_0x5d119d[_0x42de('0x53')][_0x42de('0x59')]=integrations[_0x42de('0x5a')](_0x5d119d['body'][_0x42de('0x5b')],_0x5d119d[_0x42de('0x53')]['type']);_0x5d119d['body'][_0x42de('0x5c')]=integrations[_0x42de('0x5d')](_0x5d119d['body'][_0x42de('0x5b')],_0x5d119d['body'][_0x42de('0x5e')]);return db['ZendeskConfiguration'][_0x42de('0x52')](_0x5d119d[_0x42de('0x53')],{'include':[{'model':db[_0x42de('0x5f')],'as':_0x42de('0x59')},{'model':db[_0x42de('0x5f')],'as':_0x42de('0x5c')}]});}return null;})['then'](respondWithResult(_0x25eac3,null))[_0x42de('0x24')](handleError(_0x25eac3,null));};exports['getFields']=function(_0x5bcf16,_0x800bc7,_0x5357c2){var _0x30d79b='';return db[_0x42de('0x36')]['findOne']({'where':{'id':_0x5bcf16[_0x42de('0x54')]['id']},'attributes':['id',_0x42de('0x60'),_0x42de('0x61'),_0x42de('0x62'),_0x42de('0x63'),_0x42de('0x64')]})[_0x42de('0x1b')](handleEntityNotFound(_0x800bc7,null))[_0x42de('0x1b')](function(_0xfd7b13){if(_0xfd7b13){_0x30d79b=_0xfd7b13[_0x42de('0x64')];var _0x3b50ea=_0x30d79b[_0x42de('0x65')](-0x1);if(_0x3b50ea==='/'){_0x30d79b=_0x30d79b['substring'](0x0,_0x30d79b[_0x42de('0x66')](_0x3b50ea));}var _0x178737={'method':_0x42de('0x67'),'uri':util[_0x42de('0x68')]('%s/%s',_0x30d79b,'ticket_fields'),'json':!![]};switch(_0xfd7b13[_0x42de('0x63')]){case _0x42de('0x61'):_0x178737[_0x42de('0x69')]={'Authorization':util[_0x42de('0x68')]('Basic\x20%s',new Buffer(util[_0x42de('0x68')](_0x42de('0x6a'),_0xfd7b13[_0x42de('0x60')],_0xfd7b13[_0x42de('0x61')]))[_0x42de('0x6b')](_0x42de('0x6c')))};break;case _0x42de('0x62'):_0x178737[_0x42de('0x69')]={'Authorization':util['format'](_0x42de('0x6d'),new Buffer(util[_0x42de('0x68')](_0x42de('0x6e'),_0xfd7b13[_0x42de('0x60')],_0xfd7b13[_0x42de('0x62')]))[_0x42de('0x6b')](_0x42de('0x6c')))};break;default:throw new db['Sequelize'][(_0x42de('0x6f'))](_0x42de('0x70'));}return rp(_0x178737);}})[_0x42de('0x1b')](function(_0x55b5ba){if(_0x55b5ba){var _0x522f78=['subject',_0x42de('0x71'),_0x42de('0x72'),'assignee'];_[_0x42de('0x73')](_0x55b5ba[_0x42de('0x74')],function(_0x1378e9){return _0x522f78[_0x42de('0x75')](_0x1378e9['type']);});return{'count':_0x55b5ba[_0x42de('0x74')]['length'],'rows':_[_0x42de('0x56')](_0x55b5ba[_0x42de('0x74')],function(_0x190fb9){return{'id':_0x190fb9['id'],'name':_0x190fb9[_0x42de('0x76')]>0x7?_0x190fb9[_0x42de('0x77')]:_0x190fb9[_0x42de('0x5e')],'custom':_0x190fb9[_0x42de('0x76')]>0x7?!![]:![],'options':_0x190fb9[_0x42de('0x78')]?_0x190fb9[_0x42de('0x78')]:_0x190fb9[_0x42de('0x79')]?_0x190fb9[_0x42de('0x79')]:[]};})};}})['then'](respondWithResult(_0x800bc7,null))['catch'](function(_0x399a9d){var _0x11d0b8=_0x5bcf16[_0x42de('0x3a')][_0x42de('0x18')]?0x1f4:_0x399a9d[_0x42de('0x7a')]||0x1f4;logger[_0x42de('0x20')](_0x42de('0x7b'),_0x42de('0x7c'),_0x11d0b8,JSON['stringify'](_0x399a9d));delete _0x399a9d['name'];if(_0x11d0b8===0x191){_0x11d0b8=0x190;}_0x800bc7['status'](_0x11d0b8)[_0x42de('0x34')](_0x5bcf16[_0x42de('0x3a')]['test']?{'message':_0x42de('0x7d'),'statusCode':_0x399a9d[_0x42de('0x7a')]}:_0x399a9d);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 7f3626e..242eec1 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 _0x74af=['int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount'];(function(_0x1ee49f,_0x26c151){var _0x2665f2=function(_0x43de75){while(--_0x43de75){_0x1ee49f['push'](_0x1ee49f['shift']());}};_0x2665f2(++_0x26c151);}(_0x74af,0x178));var _0xf74a=function(_0x428cc2,_0x2bfbf6){_0x428cc2=_0x428cc2-0x0;var _0x334d95=_0x74af[_0x428cc2];return _0x334d95;};'use strict';var _=require(_0xf74a('0x0'));var util=require(_0xf74a('0x1'));var logger=require(_0xf74a('0x2'))(_0xf74a('0x3'));var moment=require(_0xf74a('0x4'));var BPromise=require(_0xf74a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf74a('0x6'));var rimraf=require(_0xf74a('0x7'));var config=require(_0xf74a('0x8'));var attributes=require(_0xf74a('0x9'));var integrations=require(_0xf74a('0xa'));module[_0xf74a('0xb')]=function(_0x110741,_0x543438){return _0x110741[_0xf74a('0xc')](_0xf74a('0xd'),attributes,{'tableName':_0xf74a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4a6=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x409586,_0x32c0ff){var _0x3daae3=function(_0x5100e1){while(--_0x5100e1){_0x409586['push'](_0x409586['shift']());}};_0x3daae3(++_0x32c0ff);}(_0xc4a6,0x106));var _0x6c4a=function(_0x2f3a46,_0x25335f){_0x2f3a46=_0x2f3a46-0x0;var _0x98fa2f=_0xc4a6[_0x2f3a46];return _0x98fa2f;};'use strict';var _=require(_0x6c4a('0x0'));var util=require(_0x6c4a('0x1'));var logger=require(_0x6c4a('0x2'))(_0x6c4a('0x3'));var moment=require(_0x6c4a('0x4'));var BPromise=require('bluebird');var rp=require(_0x6c4a('0x5'));var fs=require('fs');var path=require(_0x6c4a('0x6'));var rimraf=require(_0x6c4a('0x7'));var config=require(_0x6c4a('0x8'));var attributes=require(_0x6c4a('0x9'));var integrations=require(_0x6c4a('0xa'));module[_0x6c4a('0xb')]=function(_0x5f5363,_0x1bc91f){return _0x5f5363[_0x6c4a('0xc')](_0x6c4a('0xd'),attributes,{'tableName':_0x6c4a('0xe'),'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 a14447c..b9b1038 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 _0x41f6=['catch','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowZendeskAccount','ZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x41f6,0x1e9));var _0x641f=function(_0x15876a,_0x15383d){_0x15876a=_0x15876a-0x0;var _0xbd900f=_0x41f6[_0x15876a];return _0xbd900f;};'use strict';var _=require(_0x641f('0x0'));var util=require(_0x641f('0x1'));var moment=require('moment');var BPromise=require(_0x641f('0x2'));var rs=require(_0x641f('0x3'));var fs=require('fs');var Redis=require(_0x641f('0x4'));var db=require(_0x641f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x641f('0x6'))(_0x641f('0x7'));var config=require('../../config/environment');var jayson=require(_0x641f('0x8'));var client=jayson[_0x641f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c0fe9,_0x4a4949,_0x4b3422){return new BPromise(function(_0xb7d609,_0x3288d9){return client[_0x641f('0xa')](_0x3c0fe9,_0x4b3422)[_0x641f('0xb')](function(_0x3ad526){logger[_0x641f('0xc')](_0x641f('0xd'),_0x4a4949,_0x641f('0xe'));logger[_0x641f('0xf')](_0x641f('0x10'),_0x4a4949,'request\x20sent',JSON[_0x641f('0x11')](_0x3ad526));if(_0x3ad526['error']){if(_0x3ad526[_0x641f('0x12')][_0x641f('0x13')]===0x1f4){logger[_0x641f('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x4a4949,_0x3ad526[_0x641f('0x12')][_0x641f('0x14')]);return _0x3288d9(_0x3ad526[_0x641f('0x12')][_0x641f('0x14')]);}logger[_0x641f('0x12')](_0x641f('0xd'),_0x4a4949,_0x3ad526['error'][_0x641f('0x14')]);return _0xb7d609(_0x3ad526['error'][_0x641f('0x14')]);}else{logger[_0x641f('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x4a4949,_0x641f('0xe'));_0xb7d609(_0x3ad526['result'][_0x641f('0x14')]);}})[_0x641f('0x15')](function(_0x19bd01){logger['error'](_0x641f('0xd'),_0x4a4949,_0x19bd01);_0x3288d9(_0x19bd01);});});}exports[_0x641f('0x16')]=function(_0x1e69c0){var _0x28220a=this;return new Promise(function(_0x808334,_0x1ae97c){return db['ZendeskAccount'][_0x641f('0x17')]({'raw':_0x1e69c0[_0x641f('0x18')]?_0x1e69c0[_0x641f('0x18')][_0x641f('0x19')]===undefined?!![]:![]:!![],'where':_0x1e69c0[_0x641f('0x18')]?_0x1e69c0['options'][_0x641f('0x1a')]||null:null,'attributes':_0x1e69c0[_0x641f('0x18')]?_0x1e69c0[_0x641f('0x18')][_0x641f('0x1b')]||null:null,'limit':_0x1e69c0[_0x641f('0x18')]?_0x1e69c0['options'][_0x641f('0x1c')]||null:null,'include':_0x1e69c0[_0x641f('0x18')]?_0x1e69c0[_0x641f('0x18')][_0x641f('0x1d')]?_['map'](_0x1e69c0[_0x641f('0x18')]['include'],function(_0x2403e1){return{'model':db[_0x2403e1[_0x641f('0x1e')]],'as':_0x2403e1['as'],'attributes':_0x2403e1['attributes'],'include':_0x2403e1[_0x641f('0x1d')]?_[_0x641f('0x1f')](_0x2403e1['include'],function(_0x1e15d8){return{'model':db[_0x1e15d8[_0x641f('0x1e')]],'as':_0x1e15d8['as'],'attributes':_0x1e15d8[_0x641f('0x1b')],'include':_0x1e15d8[_0x641f('0x1d')]?_[_0x641f('0x1f')](_0x1e15d8[_0x641f('0x1d')],function(_0x48bc37){return{'model':db[_0x48bc37['model']],'as':_0x48bc37['as'],'attributes':_0x48bc37[_0x641f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x641f('0xb')](function(_0xc9d3f){logger['info'](_0x641f('0x16'),_0x1e69c0);logger[_0x641f('0xf')](_0x641f('0x16'),_0x1e69c0,JSON[_0x641f('0x11')](_0xc9d3f));_0x808334(_0xc9d3f);})['catch'](function(_0x2207aa){logger[_0x641f('0x12')](_0x641f('0x16'),_0x2207aa[_0x641f('0x14')],_0x1e69c0);_0x1ae97c(_0x28220a['error'](0x1f4,_0x2207aa[_0x641f('0x14')]));});});};exports[_0x641f('0x20')]=function(_0x517579){var _0x5f5b33=this;return new Promise(function(_0x303ca8,_0x2e1140){return db[_0x641f('0x21')]['find']({'raw':_0x517579[_0x641f('0x18')]?_0x517579[_0x641f('0x18')][_0x641f('0x19')]===undefined?!![]:![]:!![],'where':_0x517579['options']?_0x517579['options'][_0x641f('0x1a')]||null:null,'attributes':_0x517579[_0x641f('0x18')]?_0x517579[_0x641f('0x18')]['attributes']||null:null,'include':_0x517579[_0x641f('0x18')]?_0x517579[_0x641f('0x18')][_0x641f('0x1d')]?_[_0x641f('0x1f')](_0x517579[_0x641f('0x18')]['include'],function(_0x419a7c){return{'model':db[_0x419a7c[_0x641f('0x1e')]],'as':_0x419a7c['as'],'attributes':_0x419a7c['attributes'],'include':_0x419a7c['include']?_['map'](_0x419a7c[_0x641f('0x1d')],function(_0x1a7058){return{'model':db[_0x1a7058[_0x641f('0x1e')]],'as':_0x1a7058['as'],'attributes':_0x1a7058['attributes'],'include':_0x1a7058['include']?_[_0x641f('0x1f')](_0x1a7058[_0x641f('0x1d')],function(_0x23299e){return{'model':db[_0x23299e[_0x641f('0x1e')]],'as':_0x23299e['as'],'attributes':_0x23299e[_0x641f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56f0c4){logger[_0x641f('0xc')](_0x641f('0x20'),_0x517579);logger[_0x641f('0xf')](_0x641f('0x20'),_0x517579,JSON[_0x641f('0x11')](_0x56f0c4));_0x303ca8(_0x56f0c4);})['catch'](function(_0x512343){logger['error']('ShowZendeskAccount',_0x512343[_0x641f('0x14')],_0x517579);_0x2e1140(_0x5f5b33['error'](0x1f4,_0x512343[_0x641f('0x14')]));});});}; \ No newline at end of file +var _0x556b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetZendeskAccount','debug','find','ShowZendeskAccount','lodash','util','moment','bluebird','randomstring'];(function(_0xb849e7,_0x24aa49){var _0x344014=function(_0x54a99e){while(--_0x54a99e){_0xb849e7['push'](_0xb849e7['shift']());}};_0x344014(++_0x24aa49);}(_0x556b,0x1d7));var _0xb556=function(_0x28d10a,_0x3637f9){_0x28d10a=_0x28d10a-0x0;var _0x58eb45=_0x556b[_0x28d10a];return _0x58eb45;};'use strict';var _=require(_0xb556('0x0'));var util=require(_0xb556('0x1'));var moment=require(_0xb556('0x2'));var BPromise=require(_0xb556('0x3'));var rs=require(_0xb556('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb556('0x5'))['db'];var utils=require(_0xb556('0x6'));var logger=require(_0xb556('0x7'))(_0xb556('0x8'));var config=require(_0xb556('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18728e,_0xb44f26,_0x1cc8a1){return new BPromise(function(_0x33508d,_0xe45310){return client[_0xb556('0xa')](_0x18728e,_0x1cc8a1)[_0xb556('0xb')](function(_0x9c1e10){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0xb44f26,_0xb556('0xc'));logger['debug'](_0xb556('0xd'),_0xb44f26,_0xb556('0xc'),JSON['stringify'](_0x9c1e10));if(_0x9c1e10['error']){if(_0x9c1e10[_0xb556('0xe')][_0xb556('0xf')]===0x1f4){logger[_0xb556('0xe')](_0xb556('0x10'),_0xb44f26,_0x9c1e10[_0xb556('0xe')][_0xb556('0x11')]);return _0xe45310(_0x9c1e10['error']['message']);}logger[_0xb556('0xe')]('ZendeskAccount,\x20%s,\x20%s',_0xb44f26,_0x9c1e10[_0xb556('0xe')][_0xb556('0x11')]);return _0x33508d(_0x9c1e10['error']['message']);}else{logger[_0xb556('0x12')](_0xb556('0x10'),_0xb44f26,_0xb556('0xc'));_0x33508d(_0x9c1e10[_0xb556('0x13')][_0xb556('0x11')]);}})[_0xb556('0x14')](function(_0x13677c){logger[_0xb556('0xe')](_0xb556('0x10'),_0xb44f26,_0x13677c);_0xe45310(_0x13677c);});});}exports['GetZendeskAccount']=function(_0x475808){var _0xaa8168=this;return new Promise(function(_0xb378b2,_0x23ada8){return db['ZendeskAccount'][_0xb556('0x15')]({'raw':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')][_0xb556('0x17')]===undefined?!![]:![]:!![],'where':_0x475808['options']?_0x475808[_0xb556('0x16')][_0xb556('0x18')]||null:null,'attributes':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')]['attributes']||null:null,'limit':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')][_0xb556('0x19')]||null:null,'include':_0x475808[_0xb556('0x16')]?_0x475808[_0xb556('0x16')][_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x475808[_0xb556('0x16')][_0xb556('0x1a')],function(_0x3d5ae7){return{'model':db[_0x3d5ae7[_0xb556('0x1c')]],'as':_0x3d5ae7['as'],'attributes':_0x3d5ae7[_0xb556('0x1d')],'include':_0x3d5ae7[_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x3d5ae7[_0xb556('0x1a')],function(_0x442264){return{'model':db[_0x442264[_0xb556('0x1c')]],'as':_0x442264['as'],'attributes':_0x442264[_0xb556('0x1d')],'include':_0x442264[_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x442264[_0xb556('0x1a')],function(_0x1962b1){return{'model':db[_0x1962b1['model']],'as':_0x1962b1['as'],'attributes':_0x1962b1[_0xb556('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a43a0){logger['info'](_0xb556('0x1e'),_0x475808);logger[_0xb556('0x1f')](_0xb556('0x1e'),_0x475808,JSON['stringify'](_0x4a43a0));_0xb378b2(_0x4a43a0);})[_0xb556('0x14')](function(_0x3c9a87){logger['error']('GetZendeskAccount',_0x3c9a87['message'],_0x475808);_0x23ada8(_0xaa8168[_0xb556('0xe')](0x1f4,_0x3c9a87[_0xb556('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x4d5311){var _0x3a6548=this;return new Promise(function(_0x5d989c,_0x2694de){return db['ZendeskAccount'][_0xb556('0x20')]({'raw':_0x4d5311['options']?_0x4d5311[_0xb556('0x16')][_0xb556('0x17')]===undefined?!![]:![]:!![],'where':_0x4d5311['options']?_0x4d5311['options'][_0xb556('0x18')]||null:null,'attributes':_0x4d5311[_0xb556('0x16')]?_0x4d5311[_0xb556('0x16')]['attributes']||null:null,'include':_0x4d5311[_0xb556('0x16')]?_0x4d5311[_0xb556('0x16')][_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x4d5311['options'][_0xb556('0x1a')],function(_0x3ce450){return{'model':db[_0x3ce450['model']],'as':_0x3ce450['as'],'attributes':_0x3ce450['attributes'],'include':_0x3ce450[_0xb556('0x1a')]?_[_0xb556('0x1b')](_0x3ce450[_0xb556('0x1a')],function(_0x5bdf7b){return{'model':db[_0x5bdf7b[_0xb556('0x1c')]],'as':_0x5bdf7b['as'],'attributes':_0x5bdf7b[_0xb556('0x1d')],'include':_0x5bdf7b['include']?_[_0xb556('0x1b')](_0x5bdf7b[_0xb556('0x1a')],function(_0x2e5d65){return{'model':db[_0x2e5d65['model']],'as':_0x2e5d65['as'],'attributes':_0x2e5d65['attributes']};}):[]};}):[]};}):[]:[]})[_0xb556('0xb')](function(_0x2db02e){logger[_0xb556('0x12')]('ShowZendeskAccount',_0x4d5311);logger[_0xb556('0x1f')](_0xb556('0x21'),_0x4d5311,JSON['stringify'](_0x2db02e));_0x5d989c(_0x2db02e);})['catch'](function(_0xaf4af4){logger[_0xb556('0xe')]('ShowZendeskAccount',_0xaf4af4['message'],_0x4d5311);_0x2694de(_0x3a6548[_0xb556('0xe')](0x1f4,_0xaf4af4[_0xb556('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 5d692af..479fa9d 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 _0xe67b=['Router','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','setTags','destroy','util','connect-timeout','express'];(function(_0x1f0b6a,_0x13836e){var _0x5b8a4a=function(_0x40ffef){while(--_0x40ffef){_0x1f0b6a['push'](_0x1f0b6a['shift']());}};_0x5b8a4a(++_0x13836e);}(_0xe67b,0x140));var _0xbe67=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xe67b[_0x737a1f];return _0x16eba1;};'use strict';var multer=require('multer');var util=require(_0xbe67('0x0'));var path=require('path');var timeout=require(_0xbe67('0x1'));var express=require(_0xbe67('0x2'));var router=express[_0xbe67('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe67('0x4'));var config=require('../../config/environment');var controller=require('./intZendeskConfiguration.controller');router[_0xbe67('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbe67('0x5')](_0xbe67('0x6'),auth[_0xbe67('0x7')](),controller[_0xbe67('0x8')]);router[_0xbe67('0x5')](_0xbe67('0x9'),auth['isAuthenticated'](),controller[_0xbe67('0xa')]);router[_0xbe67('0x5')]('/:id/subjects',auth[_0xbe67('0x7')](),controller[_0xbe67('0xb')]);router[_0xbe67('0x5')](_0xbe67('0xc'),auth[_0xbe67('0x7')](),controller[_0xbe67('0xd')]);router['get'](_0xbe67('0xe'),auth['isAuthenticated'](),controller[_0xbe67('0xf')]);router['post']('/',auth[_0xbe67('0x7')](),controller[_0xbe67('0x10')]);router['post'](_0xbe67('0xe'),auth[_0xbe67('0x7')](),controller[_0xbe67('0x11')]);router['put'](_0xbe67('0x6'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbe67('0x6'),auth[_0xbe67('0x7')](),controller[_0xbe67('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd982=['/:id','exports','multer','util','path','express','./intZendeskConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags','post','put','delete'];(function(_0x1f3ec0,_0x4809c2){var _0x3e2007=function(_0x1e2d16){while(--_0x1e2d16){_0x1f3ec0['push'](_0x1f3ec0['shift']());}};_0x3e2007(++_0x4809c2);}(_0xd982,0x128));var _0x2d98=function(_0x43bc0e,_0x18864e){_0x43bc0e=_0x43bc0e-0x0;var _0x5b4081=_0xd982[_0x43bc0e];return _0x5b4081;};'use strict';var multer=require(_0x2d98('0x0'));var util=require(_0x2d98('0x1'));var path=require(_0x2d98('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d98('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2d98('0x4'));router['get']('/',auth[_0x2d98('0x5')](),controller[_0x2d98('0x6')]);router[_0x2d98('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x2d98('0x8')]);router[_0x2d98('0x7')](_0x2d98('0x9'),auth[_0x2d98('0x5')](),controller[_0x2d98('0xa')]);router[_0x2d98('0x7')](_0x2d98('0xb'),auth[_0x2d98('0x5')](),controller[_0x2d98('0xc')]);router[_0x2d98('0x7')](_0x2d98('0xd'),auth[_0x2d98('0x5')](),controller['getDescriptions']);router['get'](_0x2d98('0xe'),auth['isAuthenticated'](),controller[_0x2d98('0xf')]);router[_0x2d98('0x10')]('/',auth[_0x2d98('0x5')](),controller['create']);router[_0x2d98('0x10')](_0x2d98('0xe'),auth['isAuthenticated'](),controller['setTags']);router[_0x2d98('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x2d98('0x12')](_0x2d98('0x13'),auth[_0x2d98('0x5')](),controller['destroy']);module[_0x2d98('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index d63c347..36c1615 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 _0x3fa3=['STRING','exports'];(function(_0x202236,_0x688028){var _0x426b05=function(_0x1637c4){while(--_0x1637c4){_0x202236['push'](_0x202236['shift']());}};_0x426b05(++_0x688028);}(_0x3fa3,0x1bb));var _0x33fa=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fa3[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x33fa('0x0')]={'name':{'type':Sequelize[_0x33fa('0x1')]},'description':{'type':Sequelize[_0x33fa('0x1')]}}; \ No newline at end of file +var _0xd780=['sequelize','exports','STRING'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xd780,0x18c));var _0x0d78=function(_0x33b22c,_0x42ad88){_0x33b22c=_0x33b22c-0x0;var _0xcdd372=_0xd780[_0x33b22c];return _0xcdd372;};'use strict';var Sequelize=require(_0x0d78('0x0'));module[_0x0d78('0x1')]={'name':{'type':Sequelize[_0x0d78('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index e0551ac..84726ec 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 _0x8ccf=['findAll','rows','show','params','fields','find','create','body','getFields','ZendeskField','order','nolimit','getSubjects','getDescriptions','findOne','getTags','Tag','setTags','ids','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','ZendeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','json','count','offset','limit','status','set','apply','reject','update','then','destroy','stack','name','send','index','rawAttributes','model','keys','intersection','query','attributes','length','hasOwnProperty','sort','filters','pick','filter','merge','where','map','type','VIRTUAL','field','options','ZendeskConfiguration','includeAll','include'];(function(_0x489665,_0x51a7eb){var _0x507776=function(_0x34a2d6){while(--_0x34a2d6){_0x489665['push'](_0x489665['shift']());}};_0x507776(++_0x51a7eb);}(_0x8ccf,0x133));var _0xf8cc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x8ccf[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf8cc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8cc('0x1'));var moment=require(_0xf8cc('0x2'));var BPromise=require(_0xf8cc('0x3'));var Mustache=require(_0xf8cc('0x4'));var util=require(_0xf8cc('0x5'));var path=require(_0xf8cc('0x6'));var sox=require(_0xf8cc('0x7'));var csv=require(_0xf8cc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf8cc('0x9'));var squel=require(_0xf8cc('0xa'));var crypto=require(_0xf8cc('0xb'));var jsforce=require(_0xf8cc('0xc'));var deskjs=require(_0xf8cc('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf8cc('0xe'));var Papa=require(_0xf8cc('0xf'));var Redis=require(_0xf8cc('0x10'));var authService=require(_0xf8cc('0x11'));var qs=require(_0xf8cc('0x12'));var hardwareService=require(_0xf8cc('0x13'));var logger=require(_0xf8cc('0x14'))(_0xf8cc('0x15'));var utils=require(_0xf8cc('0x16'));var config=require(_0xf8cc('0x17'));var db=require(_0xf8cc('0x18'))['db'];var jayson=require(_0xf8cc('0x19'));var client=jayson[_0xf8cc('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x2eae8d,_0x3729bd,_0x34bcea){if(_0x34bcea){var _0xbcc730=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbcc730[_0xf8cc('0x1b')](_0x3729bd)){return _0x2eae8d;}else{throw new Error(_0xf8cc('0x1c'));}}else{return _0x2eae8d;}}function respondWithRpcPromise(_0x36abff,_0x56751b,_0x830e89,_0x45dc28){return new BPromise(function(_0x339b65,_0x3bb20b){var _0x454667=_0x45dc28||client;return _0x454667['request'](_0x36abff,_0x830e89)['then'](function(_0x28de8c){logger['info'](_0xf8cc('0x1d'),_0x56751b,'request\x20sent');logger[_0xf8cc('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x56751b,_0xf8cc('0x1f'),JSON[_0xf8cc('0x20')](_0x28de8c));if(_0x28de8c[_0xf8cc('0x21')]){if(_0x28de8c[_0xf8cc('0x21')][_0xf8cc('0x22')]===0x1f4){logger['error'](_0xf8cc('0x1d'),_0x56751b,_0x28de8c[_0xf8cc('0x21')][_0xf8cc('0x23')]);return _0x3bb20b(_0x28de8c[_0xf8cc('0x21')][_0xf8cc('0x23')]);}logger[_0xf8cc('0x21')](_0xf8cc('0x1d'),_0x56751b,_0x28de8c['error'][_0xf8cc('0x23')]);return _0x339b65(_0x28de8c['error'][_0xf8cc('0x23')]);}else{logger[_0xf8cc('0x24')](_0xf8cc('0x1d'),_0x56751b,_0xf8cc('0x1f'));_0x339b65(_0x28de8c[_0xf8cc('0x25')]['message']);}})[_0xf8cc('0x26')](function(_0x2a4199){logger[_0xf8cc('0x21')](_0xf8cc('0x1d'),_0x56751b,_0x2a4199);_0x3bb20b(_0x2a4199);});});}function respondWithStatusCode(_0x3cf054,_0x4f04ea){_0x4f04ea=_0x4f04ea||0xcc;return function(_0x1b33a2){if(_0x1b33a2){return _0x3cf054[_0xf8cc('0x27')](_0x4f04ea);}return _0x3cf054['status'](_0x4f04ea)['end']();};}function respondWithResult(_0x5c16cd,_0x2b1d09){_0x2b1d09=_0x2b1d09||0xc8;return function(_0x1811c0){if(_0x1811c0){return _0x5c16cd['status'](_0x2b1d09)[_0xf8cc('0x28')](_0x1811c0);}};}function respondWithFilteredResult(_0x26ec7e,_0x344f8b){return function(_0x13bb0c){if(_0x13bb0c){var _0x5768db=_0x13bb0c[_0xf8cc('0x29')],_0x538f10=_0x344f8b[_0xf8cc('0x2a')],_0x869b03=_0x344f8b['offset']+_0x344f8b[_0xf8cc('0x2b')],_0x42215c;if(_0x869b03>=_0x5768db){_0x869b03=_0x5768db;_0x42215c=0xc8;}else{_0x42215c=0xce;}_0x26ec7e[_0xf8cc('0x2c')](_0x42215c);return _0x26ec7e[_0xf8cc('0x2d')]('Content-Range',_0x538f10+'-'+_0x869b03+'/'+_0x5768db)['json'](_0x13bb0c);}return null;};}function patchUpdates(_0x4a5764){return function(_0x5e07e9){try{jsonpatch[_0xf8cc('0x2e')](_0x5e07e9,_0x4a5764,!![]);}catch(_0x5e69f4){return BPromise[_0xf8cc('0x2f')](_0x5e69f4);}return _0x5e07e9['save']();};}function saveUpdates(_0x5130e6,_0x3d1454){return function(_0x25bae1){if(_0x25bae1){return _0x25bae1[_0xf8cc('0x30')](_0x5130e6)[_0xf8cc('0x31')](function(_0x4d9512){return _0x4d9512;});}return null;};}function removeEntity(_0x1f4dc3,_0x4c1560){return function(_0x28da70){if(_0x28da70){return _0x28da70[_0xf8cc('0x32')]()[_0xf8cc('0x31')](function(){_0x1f4dc3[_0xf8cc('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x386865,_0x34f072){return function(_0x4693e3){if(!_0x4693e3){_0x386865[_0xf8cc('0x27')](0x194);}return _0x4693e3;};}function handleError(_0x561bf2,_0x255ff0){_0x255ff0=_0x255ff0||0x1f4;return function(_0x127dad){logger['error'](_0x127dad[_0xf8cc('0x33')]);if(_0x127dad[_0xf8cc('0x34')]){delete _0x127dad['name'];}_0x561bf2[_0xf8cc('0x2c')](_0x255ff0)[_0xf8cc('0x35')](_0x127dad);};}exports[_0xf8cc('0x36')]=function(_0x24b146,_0x2005af){var _0x4b45fa={},_0x3456fd={},_0x3990af={'count':0x0,'rows':[]};var _0x4b4f83=db['ZendeskConfiguration'][_0xf8cc('0x37')];_0x3456fd[_0xf8cc('0x38')]=_['keys'](_0x4b4f83);_0x3456fd['query']=_[_0xf8cc('0x39')](_0x24b146['query']);_0x3456fd['filters']=_[_0xf8cc('0x3a')](_0x3456fd[_0xf8cc('0x38')],_0x3456fd[_0xf8cc('0x3b')]);_0x4b45fa[_0xf8cc('0x3c')]=_[_0xf8cc('0x3a')](_0x3456fd[_0xf8cc('0x38')],qs['fields'](_0x24b146['query']['fields']));_0x4b45fa[_0xf8cc('0x3c')]=_0x4b45fa['attributes'][_0xf8cc('0x3d')]?_0x4b45fa[_0xf8cc('0x3c')]:_0x3456fd['model'];if(!_0x24b146[_0xf8cc('0x3b')][_0xf8cc('0x3e')]('nolimit')){_0x4b45fa[_0xf8cc('0x2b')]=qs[_0xf8cc('0x2b')](_0x24b146[_0xf8cc('0x3b')]['limit']);_0x4b45fa[_0xf8cc('0x2a')]=qs[_0xf8cc('0x2a')](_0x24b146[_0xf8cc('0x3b')][_0xf8cc('0x2a')]);}_0x4b45fa['order']=qs[_0xf8cc('0x3f')](_0x24b146[_0xf8cc('0x3b')][_0xf8cc('0x3f')]);_0x4b45fa['where']=qs[_0xf8cc('0x40')](_[_0xf8cc('0x41')](_0x24b146[_0xf8cc('0x3b')],_0x3456fd[_0xf8cc('0x40')]));if(_0x24b146[_0xf8cc('0x3b')][_0xf8cc('0x42')]){_0x4b45fa['where']=_[_0xf8cc('0x43')](_0x4b45fa[_0xf8cc('0x44')],{'$or':_[_0xf8cc('0x45')](_0x4b4f83,function(_0x494766){if(_0x494766[_0xf8cc('0x46')]['key']!==_0xf8cc('0x47')){var _0x1b3fa7={};_0x1b3fa7[_0x494766[_0xf8cc('0x48')]]={'$like':'%'+_0x24b146['query']['filter']+'%'};return _0x1b3fa7;}})});}_0x4b45fa=_['merge']({},_0x4b45fa,_0x24b146[_0xf8cc('0x49')]);var _0xa9a9ce={'where':_0x4b45fa[_0xf8cc('0x44')]};return db[_0xf8cc('0x4a')][_0xf8cc('0x29')](_0xa9a9ce)[_0xf8cc('0x31')](function(_0x1ca0fa){_0x3990af['count']=_0x1ca0fa;if(_0x24b146[_0xf8cc('0x3b')][_0xf8cc('0x4b')]){_0x4b45fa[_0xf8cc('0x4c')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xf8cc('0x4d')](_0x4b45fa);})['then'](function(_0x450559){_0x3990af[_0xf8cc('0x4e')]=_0x450559;return _0x3990af;})[_0xf8cc('0x31')](respondWithFilteredResult(_0x2005af,_0x4b45fa))[_0xf8cc('0x26')](handleError(_0x2005af,null));};exports[_0xf8cc('0x4f')]=function(_0x4cc0f3,_0x42603a){var _0x32afc0={'raw':![],'where':{'id':_0x4cc0f3[_0xf8cc('0x50')]['id']}},_0x328237={};_0x328237[_0xf8cc('0x38')]=_[_0xf8cc('0x39')](db[_0xf8cc('0x4a')][_0xf8cc('0x37')]);_0x328237[_0xf8cc('0x3b')]=_[_0xf8cc('0x39')](_0x4cc0f3[_0xf8cc('0x3b')]);_0x328237[_0xf8cc('0x40')]=_[_0xf8cc('0x3a')](_0x328237[_0xf8cc('0x38')],_0x328237[_0xf8cc('0x3b')]);_0x32afc0[_0xf8cc('0x3c')]=_[_0xf8cc('0x3a')](_0x328237[_0xf8cc('0x38')],qs['fields'](_0x4cc0f3[_0xf8cc('0x3b')][_0xf8cc('0x51')]));_0x32afc0[_0xf8cc('0x3c')]=_0x32afc0[_0xf8cc('0x3c')][_0xf8cc('0x3d')]?_0x32afc0[_0xf8cc('0x3c')]:_0x328237[_0xf8cc('0x38')];if(_0x4cc0f3['query'][_0xf8cc('0x4b')]){_0x32afc0[_0xf8cc('0x4c')]=[{'all':!![]}];}_0x32afc0=_[_0xf8cc('0x43')]({},_0x32afc0,_0x4cc0f3[_0xf8cc('0x49')]);return db['ZendeskConfiguration'][_0xf8cc('0x52')](_0x32afc0)[_0xf8cc('0x31')](handleEntityNotFound(_0x42603a,null))['then'](respondWithResult(_0x42603a,null))[_0xf8cc('0x26')](handleError(_0x42603a,null));};exports[_0xf8cc('0x53')]=function(_0x408ed2,_0x5e0447){return db[_0xf8cc('0x4a')][_0xf8cc('0x53')](_0x408ed2[_0xf8cc('0x54')],{})[_0xf8cc('0x31')](respondWithResult(_0x5e0447,0xc9))[_0xf8cc('0x26')](handleError(_0x5e0447,null));};exports['update']=function(_0x2b9fa8,_0x5964fe){if(_0x2b9fa8[_0xf8cc('0x54')]['id']){delete _0x2b9fa8[_0xf8cc('0x54')]['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x2b9fa8['params']['id']}})[_0xf8cc('0x31')](handleEntityNotFound(_0x5964fe,null))[_0xf8cc('0x31')](saveUpdates(_0x2b9fa8[_0xf8cc('0x54')],null))[_0xf8cc('0x31')](respondWithResult(_0x5964fe,null))[_0xf8cc('0x26')](handleError(_0x5964fe,null));};exports[_0xf8cc('0x32')]=function(_0x342df6,_0x490692){return db['ZendeskConfiguration']['find']({'where':{'id':_0x342df6[_0xf8cc('0x50')]['id']}})[_0xf8cc('0x31')](handleEntityNotFound(_0x490692,null))[_0xf8cc('0x31')](removeEntity(_0x490692,null))['catch'](handleError(_0x490692,null));};exports[_0xf8cc('0x55')]=function(_0x2671d5,_0x294d88,_0x442695){var _0xc034c9={};var _0x406bbf={};var _0x4a6416;var _0x2526bf;return db[_0xf8cc('0x4a')]['findOne']({'where':{'id':_0x2671d5[_0xf8cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x294d88,null))[_0xf8cc('0x31')](function(_0x5752f4){if(_0x5752f4){_0x4a6416=_0x5752f4;_0x406bbf[_0xf8cc('0x38')]=_[_0xf8cc('0x39')](db[_0xf8cc('0x56')][_0xf8cc('0x37')]);_0x406bbf[_0xf8cc('0x3b')]=_['keys'](_0x2671d5['query']);_0x406bbf[_0xf8cc('0x40')]=_[_0xf8cc('0x3a')](_0x406bbf['model'],_0x406bbf['query']);_0xc034c9[_0xf8cc('0x3c')]=_[_0xf8cc('0x3a')](_0x406bbf[_0xf8cc('0x38')],qs[_0xf8cc('0x51')](_0x2671d5[_0xf8cc('0x3b')][_0xf8cc('0x51')]));_0xc034c9['attributes']=_0xc034c9[_0xf8cc('0x3c')]['length']?_0xc034c9[_0xf8cc('0x3c')]:_0x406bbf[_0xf8cc('0x38')];_0xc034c9[_0xf8cc('0x57')]=qs['sort'](_0x2671d5[_0xf8cc('0x3b')][_0xf8cc('0x3f')]);_0xc034c9[_0xf8cc('0x44')]=qs[_0xf8cc('0x40')](_['pick'](_0x2671d5[_0xf8cc('0x3b')],_0x406bbf['filters']));if(_0x2671d5['query'][_0xf8cc('0x42')]){_0xc034c9[_0xf8cc('0x44')]=_[_0xf8cc('0x43')](_0xc034c9[_0xf8cc('0x44')],{'$or':_[_0xf8cc('0x45')](_0xc034c9[_0xf8cc('0x3c')],function(_0x1bb73f){var _0x2d35b3={};_0x2d35b3[_0x1bb73f]={'$like':'%'+_0x2671d5[_0xf8cc('0x3b')]['filter']+'%'};return _0x2d35b3;})});}_0xc034c9=_[_0xf8cc('0x43')]({},_0xc034c9,_0x2671d5[_0xf8cc('0x49')]);return _0x4a6416['getFields'](_0xc034c9);}})[_0xf8cc('0x31')](function(_0x23536c){if(_0x23536c){_0x2526bf=_0x23536c[_0xf8cc('0x3d')];if(!_0x2671d5[_0xf8cc('0x3b')][_0xf8cc('0x3e')](_0xf8cc('0x58'))){_0xc034c9[_0xf8cc('0x2b')]=qs[_0xf8cc('0x2b')](_0x2671d5[_0xf8cc('0x3b')]['limit']);_0xc034c9[_0xf8cc('0x2a')]=qs[_0xf8cc('0x2a')](_0x2671d5[_0xf8cc('0x3b')]['offset']);}return _0x4a6416['getFields'](_0xc034c9);}})[_0xf8cc('0x31')](function(_0x436699){if(_0x436699){return _0x436699?{'count':_0x2526bf,'rows':_0x436699}:null;}})[_0xf8cc('0x31')](respondWithResult(_0x294d88,null))[_0xf8cc('0x26')](handleError(_0x294d88,null));};exports[_0xf8cc('0x59')]=function(_0xb0fb20,_0x1c402f,_0x1dfb13){var _0x7c57fb={};var _0x5dff73={};var _0x2d8bae;var _0x222d60;return db[_0xf8cc('0x4a')]['findOne']({'where':{'id':_0xb0fb20[_0xf8cc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1c402f,null))[_0xf8cc('0x31')](function(_0x44bbd2){if(_0x44bbd2){_0x2d8bae=_0x44bbd2;_0x5dff73[_0xf8cc('0x38')]=_[_0xf8cc('0x39')](db[_0xf8cc('0x56')][_0xf8cc('0x37')]);_0x5dff73[_0xf8cc('0x3b')]=_['keys'](_0xb0fb20[_0xf8cc('0x3b')]);_0x5dff73['filters']=_[_0xf8cc('0x3a')](_0x5dff73[_0xf8cc('0x38')],_0x5dff73[_0xf8cc('0x3b')]);_0x7c57fb[_0xf8cc('0x3c')]=_[_0xf8cc('0x3a')](_0x5dff73[_0xf8cc('0x38')],qs[_0xf8cc('0x51')](_0xb0fb20[_0xf8cc('0x3b')][_0xf8cc('0x51')]));_0x7c57fb['attributes']=_0x7c57fb[_0xf8cc('0x3c')]['length']?_0x7c57fb[_0xf8cc('0x3c')]:_0x5dff73[_0xf8cc('0x38')];_0x7c57fb[_0xf8cc('0x57')]=qs[_0xf8cc('0x3f')](_0xb0fb20['query'][_0xf8cc('0x3f')]);_0x7c57fb['where']=qs[_0xf8cc('0x40')](_['pick'](_0xb0fb20['query'],_0x5dff73[_0xf8cc('0x40')]));if(_0xb0fb20[_0xf8cc('0x3b')][_0xf8cc('0x42')]){_0x7c57fb[_0xf8cc('0x44')]=_[_0xf8cc('0x43')](_0x7c57fb[_0xf8cc('0x44')],{'$or':_[_0xf8cc('0x45')](_0x7c57fb['attributes'],function(_0xbbf395){var _0x20d433={};_0x20d433[_0xbbf395]={'$like':'%'+_0xb0fb20[_0xf8cc('0x3b')][_0xf8cc('0x42')]+'%'};return _0x20d433;})});}_0x7c57fb=_[_0xf8cc('0x43')]({},_0x7c57fb,_0xb0fb20[_0xf8cc('0x49')]);return _0x2d8bae[_0xf8cc('0x59')](_0x7c57fb);}})[_0xf8cc('0x31')](function(_0x39b4a8){if(_0x39b4a8){_0x222d60=_0x39b4a8['length'];if(!_0xb0fb20[_0xf8cc('0x3b')][_0xf8cc('0x3e')](_0xf8cc('0x58'))){_0x7c57fb[_0xf8cc('0x2b')]=qs[_0xf8cc('0x2b')](_0xb0fb20['query'][_0xf8cc('0x2b')]);_0x7c57fb[_0xf8cc('0x2a')]=qs[_0xf8cc('0x2a')](_0xb0fb20['query'][_0xf8cc('0x2a')]);}return _0x2d8bae[_0xf8cc('0x59')](_0x7c57fb);}})['then'](function(_0x362fe6){if(_0x362fe6){return _0x362fe6?{'count':_0x222d60,'rows':_0x362fe6}:null;}})[_0xf8cc('0x31')](respondWithResult(_0x1c402f,null))[_0xf8cc('0x26')](handleError(_0x1c402f,null));};exports[_0xf8cc('0x5a')]=function(_0x497b7b,_0x5bd528,_0x480f85){var _0xece439={};var _0x3c488d={};var _0x10985d;var _0x16af0d;return db['ZendeskConfiguration'][_0xf8cc('0x5b')]({'where':{'id':_0x497b7b[_0xf8cc('0x50')]['id']}})[_0xf8cc('0x31')](handleEntityNotFound(_0x5bd528,null))['then'](function(_0x2fd32e){if(_0x2fd32e){_0x10985d=_0x2fd32e;_0x3c488d[_0xf8cc('0x38')]=_[_0xf8cc('0x39')](db[_0xf8cc('0x56')][_0xf8cc('0x37')]);_0x3c488d['query']=_[_0xf8cc('0x39')](_0x497b7b[_0xf8cc('0x3b')]);_0x3c488d['filters']=_['intersection'](_0x3c488d[_0xf8cc('0x38')],_0x3c488d[_0xf8cc('0x3b')]);_0xece439[_0xf8cc('0x3c')]=_[_0xf8cc('0x3a')](_0x3c488d[_0xf8cc('0x38')],qs[_0xf8cc('0x51')](_0x497b7b['query']['fields']));_0xece439[_0xf8cc('0x3c')]=_0xece439['attributes'][_0xf8cc('0x3d')]?_0xece439['attributes']:_0x3c488d[_0xf8cc('0x38')];_0xece439[_0xf8cc('0x57')]=qs[_0xf8cc('0x3f')](_0x497b7b[_0xf8cc('0x3b')][_0xf8cc('0x3f')]);_0xece439['where']=qs['filters'](_['pick'](_0x497b7b[_0xf8cc('0x3b')],_0x3c488d[_0xf8cc('0x40')]));if(_0x497b7b['query'][_0xf8cc('0x42')]){_0xece439['where']=_[_0xf8cc('0x43')](_0xece439[_0xf8cc('0x44')],{'$or':_[_0xf8cc('0x45')](_0xece439[_0xf8cc('0x3c')],function(_0x3512a7){var _0x218145={};_0x218145[_0x3512a7]={'$like':'%'+_0x497b7b[_0xf8cc('0x3b')][_0xf8cc('0x42')]+'%'};return _0x218145;})});}_0xece439=_[_0xf8cc('0x43')]({},_0xece439,_0x497b7b[_0xf8cc('0x49')]);return _0x10985d[_0xf8cc('0x5a')](_0xece439);}})[_0xf8cc('0x31')](function(_0x34ae5a){if(_0x34ae5a){_0x16af0d=_0x34ae5a['length'];if(!_0x497b7b['query'][_0xf8cc('0x3e')](_0xf8cc('0x58'))){_0xece439[_0xf8cc('0x2b')]=qs[_0xf8cc('0x2b')](_0x497b7b['query'][_0xf8cc('0x2b')]);_0xece439[_0xf8cc('0x2a')]=qs[_0xf8cc('0x2a')](_0x497b7b[_0xf8cc('0x3b')][_0xf8cc('0x2a')]);}return _0x10985d[_0xf8cc('0x5a')](_0xece439);}})[_0xf8cc('0x31')](function(_0xcc728c){if(_0xcc728c){return _0xcc728c?{'count':_0x16af0d,'rows':_0xcc728c}:null;}})['then'](respondWithResult(_0x5bd528,null))[_0xf8cc('0x26')](handleError(_0x5bd528,null));};exports[_0xf8cc('0x5c')]=function(_0x2ec786,_0x67681f,_0x90fa84){var _0xd01aa4={};var _0x470933={};var _0x2d564f;var _0xaef584;return db[_0xf8cc('0x4a')][_0xf8cc('0x5b')]({'where':{'id':_0x2ec786['params']['id']}})[_0xf8cc('0x31')](handleEntityNotFound(_0x67681f,null))[_0xf8cc('0x31')](function(_0x13ac15){if(_0x13ac15){_0x2d564f=_0x13ac15;_0x470933[_0xf8cc('0x38')]=_[_0xf8cc('0x39')](db[_0xf8cc('0x5d')][_0xf8cc('0x37')]);_0x470933[_0xf8cc('0x3b')]=_['keys'](_0x2ec786[_0xf8cc('0x3b')]);_0x470933['filters']=_[_0xf8cc('0x3a')](_0x470933[_0xf8cc('0x38')],_0x470933['query']);_0xd01aa4[_0xf8cc('0x3c')]=_[_0xf8cc('0x3a')](_0x470933[_0xf8cc('0x38')],qs['fields'](_0x2ec786[_0xf8cc('0x3b')][_0xf8cc('0x51')]));_0xd01aa4['attributes']=_0xd01aa4[_0xf8cc('0x3c')][_0xf8cc('0x3d')]?_0xd01aa4[_0xf8cc('0x3c')]:_0x470933['model'];_0xd01aa4[_0xf8cc('0x57')]=qs[_0xf8cc('0x3f')](_0x2ec786[_0xf8cc('0x3b')][_0xf8cc('0x3f')]);_0xd01aa4['where']=qs[_0xf8cc('0x40')](_[_0xf8cc('0x41')](_0x2ec786[_0xf8cc('0x3b')],_0x470933['filters']));if(_0x2ec786[_0xf8cc('0x3b')]['filter']){_0xd01aa4[_0xf8cc('0x44')]=_[_0xf8cc('0x43')](_0xd01aa4['where'],{'$or':_[_0xf8cc('0x45')](_0xd01aa4['attributes'],function(_0x26fb73){var _0x1bcd12={};_0x1bcd12[_0x26fb73]={'$like':'%'+_0x2ec786[_0xf8cc('0x3b')][_0xf8cc('0x42')]+'%'};return _0x1bcd12;})});}_0xd01aa4=_['merge']({},_0xd01aa4,_0x2ec786[_0xf8cc('0x49')]);return _0x2d564f['getTags'](_0xd01aa4);}})[_0xf8cc('0x31')](function(_0x48c8a1){if(_0x48c8a1){_0xaef584=_0x48c8a1[_0xf8cc('0x3d')];if(!_0x2ec786['query'][_0xf8cc('0x3e')]('nolimit')){_0xd01aa4[_0xf8cc('0x2b')]=qs[_0xf8cc('0x2b')](_0x2ec786[_0xf8cc('0x3b')]['limit']);_0xd01aa4['offset']=qs[_0xf8cc('0x2a')](_0x2ec786[_0xf8cc('0x3b')][_0xf8cc('0x2a')]);}return _0x2d564f[_0xf8cc('0x5c')](_0xd01aa4);}})[_0xf8cc('0x31')](function(_0x52ab08){if(_0x52ab08){return _0x52ab08?{'count':_0xaef584,'rows':_0x52ab08}:null;}})[_0xf8cc('0x31')](respondWithResult(_0x67681f,null))['catch'](handleError(_0x67681f,null));};exports[_0xf8cc('0x5e')]=function(_0x1b32e5,_0x4717ab,_0x4275cf){if(_0x1b32e5[_0xf8cc('0x54')]['id']){delete _0x1b32e5[_0xf8cc('0x54')]['id'];}return db[_0xf8cc('0x4a')][_0xf8cc('0x5b')]({'where':{'id':_0x1b32e5['params']['id']}})[_0xf8cc('0x31')](handleEntityNotFound(_0x4717ab,null))[_0xf8cc('0x31')](function(_0x1143b9){if(_0x1143b9){return _0x1143b9[_0xf8cc('0x5e')](_0x1b32e5['body'][_0xf8cc('0x5f')]||[]);}return null;})['then'](respondWithResult(_0x4717ab,null))['catch'](handleError(_0x4717ab,null));}; \ No newline at end of file +var _0x63e8=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','map','type','key','VIRTUAL','field','filter','options','ZendeskConfiguration','findAll','rows','show','includeAll','include','create','body','params','getFields','findOne','ZendeskField','rawAttributes','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird'];(function(_0xec434,_0x80a23c){var _0x109d2d=function(_0x59006c){while(--_0x59006c){_0xec434['push'](_0xec434['shift']());}};_0x109d2d(++_0x80a23c);}(_0x63e8,0x183));var _0x863e=function(_0x4a43bd,_0x356c65){_0x4a43bd=_0x4a43bd-0x0;var _0x40b36a=_0x63e8[_0x4a43bd];return _0x40b36a;};'use strict';var pdf=require(_0x863e('0x0'));var emlformat=require(_0x863e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x863e('0x2'));var jsonpatch=require(_0x863e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x863e('0x4'));var Mustache=require('mustache');var util=require(_0x863e('0x5'));var path=require(_0x863e('0x6'));var sox=require(_0x863e('0x7'));var csv=require(_0x863e('0x8'));var ejs=require(_0x863e('0x9'));var fs=require('fs');var _=require(_0x863e('0xa'));var squel=require(_0x863e('0xb'));var crypto=require(_0x863e('0xc'));var jsforce=require(_0x863e('0xd'));var deskjs=require(_0x863e('0xe'));var toCsv=require(_0x863e('0x8'));var querystring=require(_0x863e('0xf'));var Papa=require(_0x863e('0x10'));var Redis=require(_0x863e('0x11'));var authService=require(_0x863e('0x12'));var qs=require(_0x863e('0x13'));var hardwareService=require(_0x863e('0x14'));var logger=require(_0x863e('0x15'))(_0x863e('0x16'));var utils=require(_0x863e('0x17'));var config=require(_0x863e('0x18'));var db=require(_0x863e('0x19'))['db'];var jayson=require(_0x863e('0x1a'));var client=jayson[_0x863e('0x1b')][_0x863e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x30fb77,_0x15f44f,_0x54cd55){if(_0x54cd55){var _0x55eb62=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x55eb62[_0x863e('0x1d')](_0x15f44f)){return _0x30fb77;}else{throw new Error(_0x863e('0x1e'));}}else{return _0x30fb77;}}function respondWithRpcPromise(_0x3b10d2,_0xbb60dd,_0x28097a,_0x489c71){return new BPromise(function(_0x371fb2,_0x206f93){var _0x8f59ad=_0x489c71||client;return _0x8f59ad[_0x863e('0x1f')](_0x3b10d2,_0x28097a)[_0x863e('0x20')](function(_0x58fb5e){logger[_0x863e('0x21')](_0x863e('0x22'),_0xbb60dd,_0x863e('0x23'));logger['debug'](_0x863e('0x24'),_0xbb60dd,_0x863e('0x23'),JSON['stringify'](_0x58fb5e));if(_0x58fb5e['error']){if(_0x58fb5e[_0x863e('0x25')][_0x863e('0x26')]===0x1f4){logger[_0x863e('0x25')](_0x863e('0x22'),_0xbb60dd,_0x58fb5e[_0x863e('0x25')][_0x863e('0x27')]);return _0x206f93(_0x58fb5e['error']['message']);}logger[_0x863e('0x25')](_0x863e('0x22'),_0xbb60dd,_0x58fb5e[_0x863e('0x25')]['message']);return _0x371fb2(_0x58fb5e['error'][_0x863e('0x27')]);}else{logger[_0x863e('0x21')](_0x863e('0x22'),_0xbb60dd,_0x863e('0x23'));_0x371fb2(_0x58fb5e['result'][_0x863e('0x27')]);}})[_0x863e('0x28')](function(_0x3ae72c){logger[_0x863e('0x25')]('ZendeskConfiguration,\x20%s,\x20%s',_0xbb60dd,_0x3ae72c);_0x206f93(_0x3ae72c);});});}function respondWithStatusCode(_0x47e323,_0x3d105d){_0x3d105d=_0x3d105d||0xcc;return function(_0x51b191){if(_0x51b191){return _0x47e323[_0x863e('0x29')](_0x3d105d);}return _0x47e323[_0x863e('0x2a')](_0x3d105d)[_0x863e('0x2b')]();};}function respondWithResult(_0x1952da,_0x24b8fd){_0x24b8fd=_0x24b8fd||0xc8;return function(_0x3fdcac){if(_0x3fdcac){return _0x1952da[_0x863e('0x2a')](_0x24b8fd)[_0x863e('0x2c')](_0x3fdcac);}};}function respondWithFilteredResult(_0x253e64,_0x480dda){return function(_0x28d9f8){if(_0x28d9f8){var _0x3fb2da=_0x28d9f8[_0x863e('0x2d')],_0x4ae7fd=_0x480dda[_0x863e('0x2e')],_0xf65c6a=_0x480dda[_0x863e('0x2e')]+_0x480dda[_0x863e('0x2f')],_0x5ac541;if(_0xf65c6a>=_0x3fb2da){_0xf65c6a=_0x3fb2da;_0x5ac541=0xc8;}else{_0x5ac541=0xce;}_0x253e64[_0x863e('0x2a')](_0x5ac541);return _0x253e64[_0x863e('0x30')]('Content-Range',_0x4ae7fd+'-'+_0xf65c6a+'/'+_0x3fb2da)[_0x863e('0x2c')](_0x28d9f8);}return null;};}function patchUpdates(_0x5cf819){return function(_0x2daf75){try{jsonpatch[_0x863e('0x31')](_0x2daf75,_0x5cf819,!![]);}catch(_0x89aed2){return BPromise[_0x863e('0x32')](_0x89aed2);}return _0x2daf75[_0x863e('0x33')]();};}function saveUpdates(_0x4b3f46,_0x2c5941){return function(_0x479d3b){if(_0x479d3b){return _0x479d3b[_0x863e('0x34')](_0x4b3f46)[_0x863e('0x20')](function(_0x27085c){return _0x27085c;});}return null;};}function removeEntity(_0x1e8568,_0xac552){return function(_0x49ff9f){if(_0x49ff9f){return _0x49ff9f['destroy']()[_0x863e('0x20')](function(){_0x1e8568[_0x863e('0x2a')](0xcc)[_0x863e('0x2b')]();});}};}function handleEntityNotFound(_0x2fc952,_0x3554d4){return function(_0x1a0178){if(!_0x1a0178){_0x2fc952[_0x863e('0x29')](0x194);}return _0x1a0178;};}function handleError(_0x5965ff,_0x1bc642){_0x1bc642=_0x1bc642||0x1f4;return function(_0x5ce8b6){logger[_0x863e('0x25')](_0x5ce8b6[_0x863e('0x35')]);if(_0x5ce8b6[_0x863e('0x36')]){delete _0x5ce8b6[_0x863e('0x36')];}_0x5965ff[_0x863e('0x2a')](_0x1bc642)[_0x863e('0x37')](_0x5ce8b6);};}exports[_0x863e('0x38')]=function(_0x53a86c,_0x9a1fc6){var _0x1709e6={},_0x242a91={},_0x2b1fc6={'count':0x0,'rows':[]};var _0x42efdc=db['ZendeskConfiguration']['rawAttributes'];_0x242a91[_0x863e('0x39')]=_[_0x863e('0x3a')](_0x42efdc);_0x242a91[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x53a86c[_0x863e('0x3b')]);_0x242a91[_0x863e('0x3c')]=_['intersection'](_0x242a91[_0x863e('0x39')],_0x242a91['query']);_0x1709e6['attributes']=_[_0x863e('0x3d')](_0x242a91['model'],qs[_0x863e('0x3e')](_0x53a86c[_0x863e('0x3b')]['fields']));_0x1709e6[_0x863e('0x3f')]=_0x1709e6[_0x863e('0x3f')][_0x863e('0x40')]?_0x1709e6[_0x863e('0x3f')]:_0x242a91['model'];if(!_0x53a86c[_0x863e('0x3b')][_0x863e('0x41')](_0x863e('0x42'))){_0x1709e6[_0x863e('0x2f')]=qs[_0x863e('0x2f')](_0x53a86c[_0x863e('0x3b')][_0x863e('0x2f')]);_0x1709e6[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x53a86c[_0x863e('0x3b')]['offset']);}_0x1709e6[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x53a86c['query'][_0x863e('0x44')]);_0x1709e6['where']=qs[_0x863e('0x3c')](_['pick'](_0x53a86c[_0x863e('0x3b')],_0x242a91[_0x863e('0x3c')]));if(_0x53a86c['query']['filter']){_0x1709e6[_0x863e('0x45')]=_[_0x863e('0x46')](_0x1709e6[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x42efdc,function(_0x39cf56){if(_0x39cf56[_0x863e('0x48')][_0x863e('0x49')]!==_0x863e('0x4a')){var _0x392bac={};_0x392bac[_0x39cf56[_0x863e('0x4b')]]={'$like':'%'+_0x53a86c[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x392bac;}})});}_0x1709e6=_[_0x863e('0x46')]({},_0x1709e6,_0x53a86c[_0x863e('0x4d')]);var _0x17ce9e={'where':_0x1709e6[_0x863e('0x45')]};return db[_0x863e('0x4e')][_0x863e('0x2d')](_0x17ce9e)[_0x863e('0x20')](function(_0x4d9252){_0x2b1fc6['count']=_0x4d9252;if(_0x53a86c['query']['includeAll']){_0x1709e6['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x863e('0x4f')](_0x1709e6);})[_0x863e('0x20')](function(_0x10b65d){_0x2b1fc6[_0x863e('0x50')]=_0x10b65d;return _0x2b1fc6;})[_0x863e('0x20')](respondWithFilteredResult(_0x9a1fc6,_0x1709e6))['catch'](handleError(_0x9a1fc6,null));};exports[_0x863e('0x51')]=function(_0x5a5d66,_0xb7986b){var _0x54588c={'raw':![],'where':{'id':_0x5a5d66['params']['id']}},_0x3a92a1={};_0x3a92a1[_0x863e('0x39')]=_[_0x863e('0x3a')](db[_0x863e('0x4e')]['rawAttributes']);_0x3a92a1[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x5a5d66['query']);_0x3a92a1[_0x863e('0x3c')]=_[_0x863e('0x3d')](_0x3a92a1[_0x863e('0x39')],_0x3a92a1[_0x863e('0x3b')]);_0x54588c[_0x863e('0x3f')]=_[_0x863e('0x3d')](_0x3a92a1[_0x863e('0x39')],qs[_0x863e('0x3e')](_0x5a5d66[_0x863e('0x3b')]['fields']));_0x54588c[_0x863e('0x3f')]=_0x54588c['attributes']['length']?_0x54588c[_0x863e('0x3f')]:_0x3a92a1[_0x863e('0x39')];if(_0x5a5d66['query'][_0x863e('0x52')]){_0x54588c[_0x863e('0x53')]=[{'all':!![]}];}_0x54588c=_[_0x863e('0x46')]({},_0x54588c,_0x5a5d66[_0x863e('0x4d')]);return db['ZendeskConfiguration']['find'](_0x54588c)[_0x863e('0x20')](handleEntityNotFound(_0xb7986b,null))[_0x863e('0x20')](respondWithResult(_0xb7986b,null))[_0x863e('0x28')](handleError(_0xb7986b,null));};exports[_0x863e('0x54')]=function(_0x21345,_0x586391){return db[_0x863e('0x4e')][_0x863e('0x54')](_0x21345[_0x863e('0x55')],{})[_0x863e('0x20')](respondWithResult(_0x586391,0xc9))[_0x863e('0x28')](handleError(_0x586391,null));};exports[_0x863e('0x34')]=function(_0xbf26d0,_0xdc252e){if(_0xbf26d0['body']['id']){delete _0xbf26d0[_0x863e('0x55')]['id'];}return db[_0x863e('0x4e')]['find']({'where':{'id':_0xbf26d0[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0xdc252e,null))['then'](saveUpdates(_0xbf26d0[_0x863e('0x55')],null))[_0x863e('0x20')](respondWithResult(_0xdc252e,null))[_0x863e('0x28')](handleError(_0xdc252e,null));};exports['destroy']=function(_0x319299,_0x2368a8){return db['ZendeskConfiguration']['find']({'where':{'id':_0x319299[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x2368a8,null))['then'](removeEntity(_0x2368a8,null))[_0x863e('0x28')](handleError(_0x2368a8,null));};exports[_0x863e('0x57')]=function(_0x2301e8,_0x225b23,_0x42b826){var _0x5d3f6f={};var _0x5a89c5={};var _0x252af7;var _0x211fc5;return db[_0x863e('0x4e')][_0x863e('0x58')]({'where':{'id':_0x2301e8[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x225b23,null))[_0x863e('0x20')](function(_0x4d169a){if(_0x4d169a){_0x252af7=_0x4d169a;_0x5a89c5['model']=_['keys'](db[_0x863e('0x59')][_0x863e('0x5a')]);_0x5a89c5[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x2301e8[_0x863e('0x3b')]);_0x5a89c5['filters']=_[_0x863e('0x3d')](_0x5a89c5['model'],_0x5a89c5[_0x863e('0x3b')]);_0x5d3f6f[_0x863e('0x3f')]=_['intersection'](_0x5a89c5[_0x863e('0x39')],qs[_0x863e('0x3e')](_0x2301e8[_0x863e('0x3b')][_0x863e('0x3e')]));_0x5d3f6f[_0x863e('0x3f')]=_0x5d3f6f[_0x863e('0x3f')]['length']?_0x5d3f6f[_0x863e('0x3f')]:_0x5a89c5['model'];_0x5d3f6f[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x2301e8['query'][_0x863e('0x44')]);_0x5d3f6f[_0x863e('0x45')]=qs[_0x863e('0x3c')](_[_0x863e('0x5b')](_0x2301e8[_0x863e('0x3b')],_0x5a89c5[_0x863e('0x3c')]));if(_0x2301e8[_0x863e('0x3b')][_0x863e('0x4c')]){_0x5d3f6f[_0x863e('0x45')]=_['merge'](_0x5d3f6f[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x5d3f6f[_0x863e('0x3f')],function(_0x14e3cd){var _0x35509f={};_0x35509f[_0x14e3cd]={'$like':'%'+_0x2301e8[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x35509f;})});}_0x5d3f6f=_[_0x863e('0x46')]({},_0x5d3f6f,_0x2301e8[_0x863e('0x4d')]);return _0x252af7['getFields'](_0x5d3f6f);}})['then'](function(_0x125194){if(_0x125194){_0x211fc5=_0x125194['length'];if(!_0x2301e8[_0x863e('0x3b')]['hasOwnProperty'](_0x863e('0x42'))){_0x5d3f6f['limit']=qs[_0x863e('0x2f')](_0x2301e8[_0x863e('0x3b')][_0x863e('0x2f')]);_0x5d3f6f[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x2301e8[_0x863e('0x3b')][_0x863e('0x2e')]);}return _0x252af7['getFields'](_0x5d3f6f);}})[_0x863e('0x20')](function(_0x4a62b2){if(_0x4a62b2){return _0x4a62b2?{'count':_0x211fc5,'rows':_0x4a62b2}:null;}})['then'](respondWithResult(_0x225b23,null))[_0x863e('0x28')](handleError(_0x225b23,null));};exports['getSubjects']=function(_0x101641,_0x537fde,_0x3819e2){var _0x3c7a96={};var _0x15ada9={};var _0x4b3544;var _0x18cff2;return db[_0x863e('0x4e')][_0x863e('0x58')]({'where':{'id':_0x101641['params']['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x537fde,null))['then'](function(_0x4431d6){if(_0x4431d6){_0x4b3544=_0x4431d6;_0x15ada9[_0x863e('0x39')]=_['keys'](db[_0x863e('0x59')][_0x863e('0x5a')]);_0x15ada9['query']=_['keys'](_0x101641['query']);_0x15ada9['filters']=_[_0x863e('0x3d')](_0x15ada9['model'],_0x15ada9['query']);_0x3c7a96[_0x863e('0x3f')]=_[_0x863e('0x3d')](_0x15ada9['model'],qs[_0x863e('0x3e')](_0x101641[_0x863e('0x3b')]['fields']));_0x3c7a96[_0x863e('0x3f')]=_0x3c7a96['attributes'][_0x863e('0x40')]?_0x3c7a96[_0x863e('0x3f')]:_0x15ada9[_0x863e('0x39')];_0x3c7a96['order']=qs['sort'](_0x101641[_0x863e('0x3b')][_0x863e('0x44')]);_0x3c7a96[_0x863e('0x45')]=qs[_0x863e('0x3c')](_['pick'](_0x101641[_0x863e('0x3b')],_0x15ada9[_0x863e('0x3c')]));if(_0x101641[_0x863e('0x3b')][_0x863e('0x4c')]){_0x3c7a96[_0x863e('0x45')]=_['merge'](_0x3c7a96[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x3c7a96[_0x863e('0x3f')],function(_0x44cccb){var _0x83e20={};_0x83e20[_0x44cccb]={'$like':'%'+_0x101641[_0x863e('0x3b')]['filter']+'%'};return _0x83e20;})});}_0x3c7a96=_[_0x863e('0x46')]({},_0x3c7a96,_0x101641[_0x863e('0x4d')]);return _0x4b3544[_0x863e('0x5c')](_0x3c7a96);}})[_0x863e('0x20')](function(_0x16fb2a){if(_0x16fb2a){_0x18cff2=_0x16fb2a[_0x863e('0x40')];if(!_0x101641['query'][_0x863e('0x41')]('nolimit')){_0x3c7a96[_0x863e('0x2f')]=qs['limit'](_0x101641[_0x863e('0x3b')][_0x863e('0x2f')]);_0x3c7a96[_0x863e('0x2e')]=qs['offset'](_0x101641[_0x863e('0x3b')]['offset']);}return _0x4b3544['getSubjects'](_0x3c7a96);}})[_0x863e('0x20')](function(_0x15e79e){if(_0x15e79e){return _0x15e79e?{'count':_0x18cff2,'rows':_0x15e79e}:null;}})[_0x863e('0x20')](respondWithResult(_0x537fde,null))['catch'](handleError(_0x537fde,null));};exports[_0x863e('0x5d')]=function(_0x7fa0ad,_0x3c7f36,_0x2c3876){var _0x3fd130={};var _0x14467e={};var _0x16089f;var _0x3ac22e;return db['ZendeskConfiguration'][_0x863e('0x58')]({'where':{'id':_0x7fa0ad['params']['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x3c7f36,null))[_0x863e('0x20')](function(_0x136551){if(_0x136551){_0x16089f=_0x136551;_0x14467e[_0x863e('0x39')]=_[_0x863e('0x3a')](db['ZendeskField'][_0x863e('0x5a')]);_0x14467e[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x7fa0ad[_0x863e('0x3b')]);_0x14467e[_0x863e('0x3c')]=_[_0x863e('0x3d')](_0x14467e[_0x863e('0x39')],_0x14467e[_0x863e('0x3b')]);_0x3fd130['attributes']=_[_0x863e('0x3d')](_0x14467e['model'],qs[_0x863e('0x3e')](_0x7fa0ad['query'][_0x863e('0x3e')]));_0x3fd130[_0x863e('0x3f')]=_0x3fd130[_0x863e('0x3f')][_0x863e('0x40')]?_0x3fd130[_0x863e('0x3f')]:_0x14467e[_0x863e('0x39')];_0x3fd130[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x44')]);_0x3fd130['where']=qs[_0x863e('0x3c')](_[_0x863e('0x5b')](_0x7fa0ad[_0x863e('0x3b')],_0x14467e[_0x863e('0x3c')]));if(_0x7fa0ad['query'][_0x863e('0x4c')]){_0x3fd130[_0x863e('0x45')]=_['merge'](_0x3fd130[_0x863e('0x45')],{'$or':_['map'](_0x3fd130['attributes'],function(_0x57ec47){var _0x4f691c={};_0x4f691c[_0x57ec47]={'$like':'%'+_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x4f691c;})});}_0x3fd130=_[_0x863e('0x46')]({},_0x3fd130,_0x7fa0ad[_0x863e('0x4d')]);return _0x16089f[_0x863e('0x5d')](_0x3fd130);}})[_0x863e('0x20')](function(_0x20614d){if(_0x20614d){_0x3ac22e=_0x20614d['length'];if(!_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x41')](_0x863e('0x42'))){_0x3fd130[_0x863e('0x2f')]=qs['limit'](_0x7fa0ad[_0x863e('0x3b')][_0x863e('0x2f')]);_0x3fd130[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x7fa0ad[_0x863e('0x3b')]['offset']);}return _0x16089f[_0x863e('0x5d')](_0x3fd130);}})[_0x863e('0x20')](function(_0x9bee10){if(_0x9bee10){return _0x9bee10?{'count':_0x3ac22e,'rows':_0x9bee10}:null;}})[_0x863e('0x20')](respondWithResult(_0x3c7f36,null))['catch'](handleError(_0x3c7f36,null));};exports[_0x863e('0x5e')]=function(_0x4f00e7,_0x3204a2,_0x48f834){var _0x12b34d={};var _0x18423c={};var _0x593e54;var _0x463be9;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4f00e7[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x3204a2,null))[_0x863e('0x20')](function(_0x28797){if(_0x28797){_0x593e54=_0x28797;_0x18423c[_0x863e('0x39')]=_[_0x863e('0x3a')](db[_0x863e('0x5f')][_0x863e('0x5a')]);_0x18423c[_0x863e('0x3b')]=_[_0x863e('0x3a')](_0x4f00e7[_0x863e('0x3b')]);_0x18423c['filters']=_[_0x863e('0x3d')](_0x18423c[_0x863e('0x39')],_0x18423c[_0x863e('0x3b')]);_0x12b34d[_0x863e('0x3f')]=_[_0x863e('0x3d')](_0x18423c['model'],qs['fields'](_0x4f00e7['query'][_0x863e('0x3e')]));_0x12b34d['attributes']=_0x12b34d['attributes'][_0x863e('0x40')]?_0x12b34d['attributes']:_0x18423c[_0x863e('0x39')];_0x12b34d[_0x863e('0x43')]=qs[_0x863e('0x44')](_0x4f00e7[_0x863e('0x3b')][_0x863e('0x44')]);_0x12b34d[_0x863e('0x45')]=qs[_0x863e('0x3c')](_[_0x863e('0x5b')](_0x4f00e7['query'],_0x18423c[_0x863e('0x3c')]));if(_0x4f00e7[_0x863e('0x3b')]['filter']){_0x12b34d['where']=_[_0x863e('0x46')](_0x12b34d[_0x863e('0x45')],{'$or':_[_0x863e('0x47')](_0x12b34d[_0x863e('0x3f')],function(_0x41eddd){var _0x567acf={};_0x567acf[_0x41eddd]={'$like':'%'+_0x4f00e7[_0x863e('0x3b')][_0x863e('0x4c')]+'%'};return _0x567acf;})});}_0x12b34d=_['merge']({},_0x12b34d,_0x4f00e7[_0x863e('0x4d')]);return _0x593e54[_0x863e('0x5e')](_0x12b34d);}})['then'](function(_0x14efc5){if(_0x14efc5){_0x463be9=_0x14efc5['length'];if(!_0x4f00e7[_0x863e('0x3b')][_0x863e('0x41')]('nolimit')){_0x12b34d[_0x863e('0x2f')]=qs[_0x863e('0x2f')](_0x4f00e7[_0x863e('0x3b')]['limit']);_0x12b34d[_0x863e('0x2e')]=qs[_0x863e('0x2e')](_0x4f00e7[_0x863e('0x3b')][_0x863e('0x2e')]);}return _0x593e54[_0x863e('0x5e')](_0x12b34d);}})[_0x863e('0x20')](function(_0x3cf5ff){if(_0x3cf5ff){return _0x3cf5ff?{'count':_0x463be9,'rows':_0x3cf5ff}:null;}})['then'](respondWithResult(_0x3204a2,null))[_0x863e('0x28')](handleError(_0x3204a2,null));};exports['setTags']=function(_0x198bad,_0x211623,_0x280bee){if(_0x198bad[_0x863e('0x55')]['id']){delete _0x198bad[_0x863e('0x55')]['id'];}return db[_0x863e('0x4e')][_0x863e('0x58')]({'where':{'id':_0x198bad[_0x863e('0x56')]['id']}})[_0x863e('0x20')](handleEntityNotFound(_0x211623,null))[_0x863e('0x20')](function(_0x2a28c5){if(_0x2a28c5){return _0x2a28c5[_0x863e('0x60')](_0x198bad[_0x863e('0x55')][_0x863e('0x61')]||[]);}return null;})['then'](respondWithResult(_0x211623,null))[_0x863e('0x28')](handleError(_0x211623,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index bd2502e..7778572 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 _0x6197=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x6197,0x142));var _0x7619=function(_0x5060b8,_0x3baad4){_0x5060b8=_0x5060b8-0x0;var _0x5d2b0d=_0x6197[_0x5060b8];return _0x5d2b0d;};'use strict';var _=require(_0x7619('0x0'));var util=require('util');var logger=require(_0x7619('0x1'))('api');var moment=require(_0x7619('0x2'));var BPromise=require(_0x7619('0x3'));var rp=require(_0x7619('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7619('0x5'));var config=require(_0x7619('0x6'));var attributes=require(_0x7619('0x7'));module[_0x7619('0x8')]=function(_0x6253f8,_0x18bfc9){return _0x6253f8[_0x7619('0x9')](_0x7619('0xa'),attributes,{'tableName':_0x7619('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30cb=['moment','bluebird','request-promise','path','../../config/environment','exports','define','int_zendesk_configurations','lodash','util','../../config/logger'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x30cb,0xb8));var _0xb30c=function(_0x2c5df9,_0x2811cb){_0x2c5df9=_0x2c5df9-0x0;var _0x39d1d0=_0x30cb[_0x2c5df9];return _0x39d1d0;};'use strict';var _=require(_0xb30c('0x0'));var util=require(_0xb30c('0x1'));var logger=require(_0xb30c('0x2'))('api');var moment=require(_0xb30c('0x3'));var BPromise=require(_0xb30c('0x4'));var rp=require(_0xb30c('0x5'));var fs=require('fs');var path=require(_0xb30c('0x6'));var rimraf=require('rimraf');var config=require(_0xb30c('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xb30c('0x8')]=function(_0x12f3f5,_0x5e3bc7){return _0x12f3f5[_0xb30c('0x9')]('ZendeskConfiguration',attributes,{'tableName':_0xb30c('0xa'),'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 a7e7be4..276eed9 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 _0x4732=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','request\x20sent','stringify','code','ZendeskConfiguration,\x20%s,\x20%s','message','error','result','catch','lodash'];(function(_0xcc0bbf,_0x37b306){var _0x39a5ac=function(_0x1be047){while(--_0x1be047){_0xcc0bbf['push'](_0xcc0bbf['shift']());}};_0x39a5ac(++_0x37b306);}(_0x4732,0xe3));var _0x2473=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0x4732[_0x2defb5];return _0x229c53;};'use strict';var _=require(_0x2473('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2473('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2473('0x2'));var db=require(_0x2473('0x3'))['db'];var utils=require(_0x2473('0x4'));var logger=require('../../config/logger')(_0x2473('0x5'));var config=require(_0x2473('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2473('0x7')][_0x2473('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x186b5a,_0x21b46a,_0x5d44fe){return new BPromise(function(_0x45ba75,_0x50668d){return client['request'](_0x186b5a,_0x5d44fe)[_0x2473('0x9')](function(_0x1e3483){logger[_0x2473('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x21b46a,_0x2473('0xb'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x21b46a,_0x2473('0xb'),JSON[_0x2473('0xc')](_0x1e3483));if(_0x1e3483['error']){if(_0x1e3483['error'][_0x2473('0xd')]===0x1f4){logger['error'](_0x2473('0xe'),_0x21b46a,_0x1e3483['error'][_0x2473('0xf')]);return _0x50668d(_0x1e3483['error'][_0x2473('0xf')]);}logger[_0x2473('0x10')](_0x2473('0xe'),_0x21b46a,_0x1e3483['error'][_0x2473('0xf')]);return _0x45ba75(_0x1e3483[_0x2473('0x10')][_0x2473('0xf')]);}else{logger[_0x2473('0xa')](_0x2473('0xe'),_0x21b46a,_0x2473('0xb'));_0x45ba75(_0x1e3483[_0x2473('0x11')][_0x2473('0xf')]);}})[_0x2473('0x12')](function(_0x3da3aa){logger[_0x2473('0x10')](_0x2473('0xe'),_0x21b46a,_0x3da3aa);_0x50668d(_0x3da3aa);});});} \ No newline at end of file +var _0x870c=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x45016b,_0x2e0355){var _0x5cfccc=function(_0xeb05a7){while(--_0xeb05a7){_0x45016b['push'](_0x45016b['shift']());}};_0x5cfccc(++_0x2e0355);}(_0x870c,0x8b));var _0xc870=function(_0x24f673,_0x1dd82c){_0x24f673=_0x24f673-0x0;var _0x556058=_0x870c[_0x24f673];return _0x556058;};'use strict';var _=require(_0xc870('0x0'));var util=require(_0xc870('0x1'));var moment=require(_0xc870('0x2'));var BPromise=require(_0xc870('0x3'));var rs=require(_0xc870('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc870('0x5'));var logger=require(_0xc870('0x6'))('rpc');var config=require(_0xc870('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc870('0x8')][_0xc870('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ce2da,_0xd7b806,_0x4d2fdb){return new BPromise(function(_0x3890d8,_0xff11f8){return client[_0xc870('0xa')](_0x5ce2da,_0x4d2fdb)[_0xc870('0xb')](function(_0x176aa7){logger[_0xc870('0xc')](_0xc870('0xd'),_0xd7b806,_0xc870('0xe'));logger[_0xc870('0xf')](_0xc870('0x10'),_0xd7b806,_0xc870('0xe'),JSON[_0xc870('0x11')](_0x176aa7));if(_0x176aa7[_0xc870('0x12')]){if(_0x176aa7[_0xc870('0x12')][_0xc870('0x13')]===0x1f4){logger[_0xc870('0x12')](_0xc870('0xd'),_0xd7b806,_0x176aa7['error']['message']);return _0xff11f8(_0x176aa7[_0xc870('0x12')]['message']);}logger[_0xc870('0x12')](_0xc870('0xd'),_0xd7b806,_0x176aa7['error'][_0xc870('0x14')]);return _0x3890d8(_0x176aa7[_0xc870('0x12')][_0xc870('0x14')]);}else{logger[_0xc870('0xc')](_0xc870('0xd'),_0xd7b806,_0xc870('0xe'));_0x3890d8(_0x176aa7[_0xc870('0x15')][_0xc870('0x14')]);}})[_0xc870('0x16')](function(_0x2ad688){logger[_0xc870('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0xd7b806,_0x2ad688);_0xff11f8(_0x2ad688);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 1a7d4d2..371a977 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 _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2706bb,_0x148079){var _0xef24d2=function(_0x58bab8){while(--_0x58bab8){_0x2706bb['push'](_0x2706bb['shift']());}};_0xef24d2(++_0x148079);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file +var _0x9957=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x5ed641,_0x540a32){var _0xbfa18a=function(_0x50442c){while(--_0x50442c){_0x5ed641['push'](_0x5ed641['shift']());}};_0xbfa18a(++_0x540a32);}(_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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./intZendeskField.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xd')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xf')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['destroy']);module[_0x7995('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 294e2ef..3930241 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 _0xdace=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','ENUM','string'];(function(_0x215e12,_0xfcc20f){var _0x4949a1=function(_0x1a84dc){while(--_0x1a84dc){_0x215e12['push'](_0x215e12['shift']());}};_0x4949a1(++_0xfcc20f);}(_0xdace,0xc5));var _0xedac=function(_0x593752,_0xfc3827){_0x593752=_0x593752-0x0;var _0x4612be=_0xdace[_0x593752];return _0x4612be;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'type':{'type':Sequelize[_0xedac('0x1')](_0xedac('0x2'),_0xedac('0x3'),'customVariable',_0xedac('0x4')),'defaultValue':_0xedac('0x2')},'content':{'type':Sequelize[_0xedac('0x5')]},'key':{'type':Sequelize[_0xedac('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xedac('0x2'),_0xedac('0x3'),_0xedac('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xedac('0x5')]},'nameField':{'type':Sequelize[_0xedac('0x5')]},'customField':{'type':Sequelize[_0xedac('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4522=['STRING','customVariable','BOOLEAN','ENUM','string','variable','keyValue'];(function(_0xda7c25,_0x256fc4){var _0x1ef7db=function(_0x1fa751){while(--_0x1fa751){_0xda7c25['push'](_0xda7c25['shift']());}};_0x1ef7db(++_0x256fc4);}(_0x4522,0x1a0));var _0x2452=function(_0x1c419e,_0x39e23c){_0x1c419e=_0x1c419e-0x0;var _0x1e712f=_0x4522[_0x1c419e];return _0x1e712f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),'customVariable',_0x2452('0x3')),'defaultValue':_0x2452('0x1')},'content':{'type':Sequelize[_0x2452('0x4')]},'key':{'type':Sequelize[_0x2452('0x4')]},'keyType':{'type':Sequelize[_0x2452('0x0')](_0x2452('0x1'),_0x2452('0x2'),_0x2452('0x5'))},'keyContent':{'type':Sequelize[_0x2452('0x4')]},'idField':{'type':Sequelize[_0x2452('0x4')]},'nameField':{'type':Sequelize[_0x2452('0x4')]},'customField':{'type':Sequelize[_0x2452('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2452('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 601d165..b5367ae 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 _0xb1cb=['fields','length','nolimit','limit','sort','where','pick','filters','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','rows','params','find','catch','create','body','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','end','stack','name','send','index','ZendeskField','rawAttributes','keys','query','model','attributes','intersection'];(function(_0x151151,_0x5b185a){var _0x3c43ca=function(_0x22c719){while(--_0x22c719){_0x151151['push'](_0x151151['shift']());}};_0x3c43ca(++_0x5b185a);}(_0xb1cb,0xa4));var _0xbb1c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb1cb[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0xbb1c('0x0'));var emlformat=require(_0xbb1c('0x1'));var rimraf=require(_0xbb1c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb1c('0x3'));var moment=require(_0xbb1c('0x4'));var BPromise=require(_0xbb1c('0x5'));var Mustache=require(_0xbb1c('0x6'));var util=require(_0xbb1c('0x7'));var path=require(_0xbb1c('0x8'));var sox=require(_0xbb1c('0x9'));var csv=require(_0xbb1c('0xa'));var ejs=require(_0xbb1c('0xb'));var fs=require('fs');var _=require(_0xbb1c('0xc'));var squel=require(_0xbb1c('0xd'));var crypto=require('crypto');var jsforce=require(_0xbb1c('0xe'));var deskjs=require(_0xbb1c('0xf'));var toCsv=require(_0xbb1c('0xa'));var querystring=require('querystring');var Papa=require(_0xbb1c('0x10'));var Redis=require('ioredis');var authService=require(_0xbb1c('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb1c('0x12'))('api');var utils=require(_0xbb1c('0x13'));var config=require(_0xbb1c('0x14'));var db=require(_0xbb1c('0x15'))['db'];function respondWithStatusCode(_0x30758c,_0x16d7ae){_0x16d7ae=_0x16d7ae||0xcc;return function(_0x33ec27){if(_0x33ec27){return _0x30758c[_0xbb1c('0x16')](_0x16d7ae);}return _0x30758c[_0xbb1c('0x17')](_0x16d7ae)['end']();};}function respondWithResult(_0x48aad7,_0x2a696a){_0x2a696a=_0x2a696a||0xc8;return function(_0x2af615){if(_0x2af615){return _0x48aad7[_0xbb1c('0x17')](_0x2a696a)[_0xbb1c('0x18')](_0x2af615);}};}function respondWithFilteredResult(_0x292a2e,_0x12be78){return function(_0x152ff5){if(_0x152ff5){var _0x77948=_0x152ff5[_0xbb1c('0x19')],_0x590dcd=_0x12be78[_0xbb1c('0x1a')],_0x4a4e77=_0x12be78[_0xbb1c('0x1a')]+_0x12be78['limit'],_0x2a588a;if(_0x4a4e77>=_0x77948){_0x4a4e77=_0x77948;_0x2a588a=0xc8;}else{_0x2a588a=0xce;}_0x292a2e[_0xbb1c('0x17')](_0x2a588a);return _0x292a2e[_0xbb1c('0x1b')]('Content-Range',_0x590dcd+'-'+_0x4a4e77+'/'+_0x77948)['json'](_0x152ff5);}return null;};}function patchUpdates(_0x194c6e){return function(_0x28c31b){try{jsonpatch[_0xbb1c('0x1c')](_0x28c31b,_0x194c6e,!![]);}catch(_0x2c4a0a){return BPromise[_0xbb1c('0x1d')](_0x2c4a0a);}return _0x28c31b[_0xbb1c('0x1e')]();};}function saveUpdates(_0xf1c6aa,_0x47ecdd){return function(_0x3a113d){if(_0x3a113d){return _0x3a113d[_0xbb1c('0x1f')](_0xf1c6aa)[_0xbb1c('0x20')](function(_0x1501f3){return _0x1501f3;});}return null;};}function removeEntity(_0x1c7d65,_0xd723f5){return function(_0x263958){if(_0x263958){return _0x263958[_0xbb1c('0x21')]()['then'](function(){_0x1c7d65['status'](0xcc)[_0xbb1c('0x22')]();});}};}function handleEntityNotFound(_0x572633,_0x419be1){return function(_0x4723a1){if(!_0x4723a1){_0x572633['sendStatus'](0x194);}return _0x4723a1;};}function handleError(_0x2dd72c,_0x5eee29){_0x5eee29=_0x5eee29||0x1f4;return function(_0xfa947a){logger['error'](_0xfa947a[_0xbb1c('0x23')]);if(_0xfa947a[_0xbb1c('0x24')]){delete _0xfa947a[_0xbb1c('0x24')];}_0x2dd72c[_0xbb1c('0x17')](_0x5eee29)[_0xbb1c('0x25')](_0xfa947a);};}exports[_0xbb1c('0x26')]=function(_0x1b88a4,_0x432877){var _0x1e5700={},_0x486762={},_0x2b0d3e={'count':0x0,'rows':[]};var _0x329821=db[_0xbb1c('0x27')][_0xbb1c('0x28')];_0x486762['model']=_[_0xbb1c('0x29')](_0x329821);_0x486762['query']=_[_0xbb1c('0x29')](_0x1b88a4[_0xbb1c('0x2a')]);_0x486762['filters']=_['intersection'](_0x486762[_0xbb1c('0x2b')],_0x486762[_0xbb1c('0x2a')]);_0x1e5700[_0xbb1c('0x2c')]=_[_0xbb1c('0x2d')](_0x486762[_0xbb1c('0x2b')],qs[_0xbb1c('0x2e')](_0x1b88a4[_0xbb1c('0x2a')][_0xbb1c('0x2e')]));_0x1e5700['attributes']=_0x1e5700[_0xbb1c('0x2c')][_0xbb1c('0x2f')]?_0x1e5700[_0xbb1c('0x2c')]:_0x486762[_0xbb1c('0x2b')];if(!_0x1b88a4[_0xbb1c('0x2a')]['hasOwnProperty'](_0xbb1c('0x30'))){_0x1e5700['limit']=qs[_0xbb1c('0x31')](_0x1b88a4[_0xbb1c('0x2a')][_0xbb1c('0x31')]);_0x1e5700[_0xbb1c('0x1a')]=qs['offset'](_0x1b88a4['query'][_0xbb1c('0x1a')]);}_0x1e5700['order']=qs[_0xbb1c('0x32')](_0x1b88a4[_0xbb1c('0x2a')][_0xbb1c('0x32')]);_0x1e5700[_0xbb1c('0x33')]=qs['filters'](_[_0xbb1c('0x34')](_0x1b88a4[_0xbb1c('0x2a')],_0x486762[_0xbb1c('0x35')]));if(_0x1b88a4['query'][_0xbb1c('0x36')]){_0x1e5700['where']=_[_0xbb1c('0x37')](_0x1e5700[_0xbb1c('0x33')],{'$or':_[_0xbb1c('0x38')](_0x329821,function(_0x30d4da){if(_0x30d4da[_0xbb1c('0x39')]['key']!==_0xbb1c('0x3a')){var _0x41b6c2={};_0x41b6c2[_0x30d4da[_0xbb1c('0x3b')]]={'$like':'%'+_0x1b88a4['query'][_0xbb1c('0x36')]+'%'};return _0x41b6c2;}})});}_0x1e5700=_[_0xbb1c('0x37')]({},_0x1e5700,_0x1b88a4[_0xbb1c('0x3c')]);var _0x5bbc0b={'where':_0x1e5700[_0xbb1c('0x33')]};return db[_0xbb1c('0x27')][_0xbb1c('0x19')](_0x5bbc0b)['then'](function(_0x1f6c0f){_0x2b0d3e['count']=_0x1f6c0f;if(_0x1b88a4[_0xbb1c('0x2a')][_0xbb1c('0x3d')]){_0x1e5700[_0xbb1c('0x3e')]=[{'all':!![]}];}return db[_0xbb1c('0x27')][_0xbb1c('0x3f')](_0x1e5700);})[_0xbb1c('0x20')](function(_0x3a7f7c){_0x2b0d3e[_0xbb1c('0x40')]=_0x3a7f7c;return _0x2b0d3e;})[_0xbb1c('0x20')](respondWithFilteredResult(_0x432877,_0x1e5700))['catch'](handleError(_0x432877,null));};exports['show']=function(_0xb1a56f,_0x4f0476){var _0x20028c={'raw':!![],'where':{'id':_0xb1a56f[_0xbb1c('0x41')]['id']}},_0x4c02c0={};_0x4c02c0[_0xbb1c('0x2b')]=_['keys'](db[_0xbb1c('0x27')]['rawAttributes']);_0x4c02c0[_0xbb1c('0x2a')]=_['keys'](_0xb1a56f['query']);_0x4c02c0[_0xbb1c('0x35')]=_[_0xbb1c('0x2d')](_0x4c02c0[_0xbb1c('0x2b')],_0x4c02c0[_0xbb1c('0x2a')]);_0x20028c[_0xbb1c('0x2c')]=_[_0xbb1c('0x2d')](_0x4c02c0['model'],qs['fields'](_0xb1a56f[_0xbb1c('0x2a')][_0xbb1c('0x2e')]));_0x20028c[_0xbb1c('0x2c')]=_0x20028c[_0xbb1c('0x2c')]['length']?_0x20028c['attributes']:_0x4c02c0[_0xbb1c('0x2b')];if(_0xb1a56f[_0xbb1c('0x2a')][_0xbb1c('0x3d')]){_0x20028c[_0xbb1c('0x3e')]=[{'all':!![]}];}_0x20028c=_['merge']({},_0x20028c,_0xb1a56f[_0xbb1c('0x3c')]);return db[_0xbb1c('0x27')][_0xbb1c('0x42')](_0x20028c)[_0xbb1c('0x20')](handleEntityNotFound(_0x4f0476,null))[_0xbb1c('0x20')](respondWithResult(_0x4f0476,null))[_0xbb1c('0x43')](handleError(_0x4f0476,null));};exports[_0xbb1c('0x44')]=function(_0x5a2776,_0x57ffde){return db['ZendeskField'][_0xbb1c('0x44')](_0x5a2776['body'],{})[_0xbb1c('0x20')](respondWithResult(_0x57ffde,0xc9))['catch'](handleError(_0x57ffde,null));};exports[_0xbb1c('0x1f')]=function(_0x487980,_0x47a6d9){if(_0x487980[_0xbb1c('0x45')]['id']){delete _0x487980[_0xbb1c('0x45')]['id'];}return db[_0xbb1c('0x27')][_0xbb1c('0x42')]({'where':{'id':_0x487980['params']['id']}})[_0xbb1c('0x20')](handleEntityNotFound(_0x47a6d9,null))[_0xbb1c('0x20')](saveUpdates(_0x487980[_0xbb1c('0x45')],null))['then'](respondWithResult(_0x47a6d9,null))[_0xbb1c('0x43')](handleError(_0x47a6d9,null));};exports[_0xbb1c('0x21')]=function(_0x25ca2f,_0x1cad84){return db[_0xbb1c('0x27')][_0xbb1c('0x42')]({'where':{'id':_0x25ca2f['params']['id']}})[_0xbb1c('0x20')](handleEntityNotFound(_0x1cad84,null))[_0xbb1c('0x20')](removeEntity(_0x1cad84,null))[_0xbb1c('0x43')](handleError(_0x1cad84,null));}; \ No newline at end of file +var _0x9ca6=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','apply','save','update','destroy','then','error','name','send','index','ZendeskField','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','type','key','VIRTUAL','field','merge','count','includeAll','findAll','rows','catch','params','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash'];(function(_0x2e2aaa,_0x3214bf){var _0x122b6f=function(_0x51b5c6){while(--_0x51b5c6){_0x2e2aaa['push'](_0x2e2aaa['shift']());}};_0x122b6f(++_0x3214bf);}(_0x9ca6,0x19e));var _0x69ca=function(_0x7c221e,_0x3ac7cd){_0x7c221e=_0x7c221e-0x0;var _0x105f4a=_0x9ca6[_0x7c221e];return _0x105f4a;};'use strict';var pdf=require(_0x69ca('0x0'));var emlformat=require(_0x69ca('0x1'));var rimraf=require(_0x69ca('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69ca('0x3'));var rp=require(_0x69ca('0x4'));var moment=require(_0x69ca('0x5'));var BPromise=require(_0x69ca('0x6'));var Mustache=require(_0x69ca('0x7'));var util=require('util');var path=require('path');var sox=require(_0x69ca('0x8'));var csv=require(_0x69ca('0x9'));var ejs=require(_0x69ca('0xa'));var fs=require('fs');var _=require(_0x69ca('0xb'));var squel=require(_0x69ca('0xc'));var crypto=require(_0x69ca('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x69ca('0xe'));var toCsv=require(_0x69ca('0x9'));var querystring=require(_0x69ca('0xf'));var Papa=require(_0x69ca('0x10'));var Redis=require(_0x69ca('0x11'));var authService=require(_0x69ca('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x69ca('0x13'));var logger=require(_0x69ca('0x14'))(_0x69ca('0x15'));var utils=require('../../config/utils');var config=require(_0x69ca('0x16'));var db=require(_0x69ca('0x17'))['db'];function respondWithStatusCode(_0x1200ee,_0x7d1ee9){_0x7d1ee9=_0x7d1ee9||0xcc;return function(_0x144a23){if(_0x144a23){return _0x1200ee[_0x69ca('0x18')](_0x7d1ee9);}return _0x1200ee[_0x69ca('0x19')](_0x7d1ee9)[_0x69ca('0x1a')]();};}function respondWithResult(_0x584ed7,_0x1f1b2c){_0x1f1b2c=_0x1f1b2c||0xc8;return function(_0x441ed4){if(_0x441ed4){return _0x584ed7['status'](_0x1f1b2c)[_0x69ca('0x1b')](_0x441ed4);}};}function respondWithFilteredResult(_0x51e25f,_0x16d97b){return function(_0x3efe80){if(_0x3efe80){var _0x174a46=_0x3efe80['count'],_0x54e8c4=_0x16d97b['offset'],_0x460a7f=_0x16d97b[_0x69ca('0x1c')]+_0x16d97b['limit'],_0x3a4a33;if(_0x460a7f>=_0x174a46){_0x460a7f=_0x174a46;_0x3a4a33=0xc8;}else{_0x3a4a33=0xce;}_0x51e25f[_0x69ca('0x19')](_0x3a4a33);return _0x51e25f[_0x69ca('0x1d')]('Content-Range',_0x54e8c4+'-'+_0x460a7f+'/'+_0x174a46)['json'](_0x3efe80);}return null;};}function patchUpdates(_0x3d2096){return function(_0x68f87a){try{jsonpatch[_0x69ca('0x1e')](_0x68f87a,_0x3d2096,!![]);}catch(_0x5d5ca9){return BPromise['reject'](_0x5d5ca9);}return _0x68f87a[_0x69ca('0x1f')]();};}function saveUpdates(_0x287992,_0x343450){return function(_0x6e8021){if(_0x6e8021){return _0x6e8021[_0x69ca('0x20')](_0x287992)['then'](function(_0x484094){return _0x484094;});}return null;};}function removeEntity(_0x326eec,_0x13feea){return function(_0x1c6398){if(_0x1c6398){return _0x1c6398[_0x69ca('0x21')]()[_0x69ca('0x22')](function(){_0x326eec[_0x69ca('0x19')](0xcc)[_0x69ca('0x1a')]();});}};}function handleEntityNotFound(_0x49dce1,_0x31ad5d){return function(_0x178146){if(!_0x178146){_0x49dce1[_0x69ca('0x18')](0x194);}return _0x178146;};}function handleError(_0x546c44,_0x5b8d73){_0x5b8d73=_0x5b8d73||0x1f4;return function(_0x32fc99){logger[_0x69ca('0x23')](_0x32fc99['stack']);if(_0x32fc99[_0x69ca('0x24')]){delete _0x32fc99[_0x69ca('0x24')];}_0x546c44[_0x69ca('0x19')](_0x5b8d73)[_0x69ca('0x25')](_0x32fc99);};}exports[_0x69ca('0x26')]=function(_0x2f66d3,_0x5eb844){var _0x50a4a7={},_0xd6f9e2={},_0x3670f6={'count':0x0,'rows':[]};var _0x42977e=db[_0x69ca('0x27')][_0x69ca('0x28')];_0xd6f9e2[_0x69ca('0x29')]=_[_0x69ca('0x2a')](_0x42977e);_0xd6f9e2[_0x69ca('0x2b')]=_[_0x69ca('0x2a')](_0x2f66d3['query']);_0xd6f9e2['filters']=_[_0x69ca('0x2c')](_0xd6f9e2['model'],_0xd6f9e2[_0x69ca('0x2b')]);_0x50a4a7[_0x69ca('0x2d')]=_['intersection'](_0xd6f9e2[_0x69ca('0x29')],qs[_0x69ca('0x2e')](_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x2e')]));_0x50a4a7[_0x69ca('0x2d')]=_0x50a4a7['attributes'][_0x69ca('0x2f')]?_0x50a4a7[_0x69ca('0x2d')]:_0xd6f9e2['model'];if(!_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x30')](_0x69ca('0x31'))){_0x50a4a7['limit']=qs[_0x69ca('0x32')](_0x2f66d3['query']['limit']);_0x50a4a7['offset']=qs[_0x69ca('0x1c')](_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x1c')]);}_0x50a4a7[_0x69ca('0x33')]=qs['sort'](_0x2f66d3[_0x69ca('0x2b')]['sort']);_0x50a4a7[_0x69ca('0x34')]=qs[_0x69ca('0x35')](_[_0x69ca('0x36')](_0x2f66d3[_0x69ca('0x2b')],_0xd6f9e2[_0x69ca('0x35')]));if(_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x37')]){_0x50a4a7[_0x69ca('0x34')]=_['merge'](_0x50a4a7[_0x69ca('0x34')],{'$or':_['map'](_0x42977e,function(_0x53751){if(_0x53751[_0x69ca('0x38')][_0x69ca('0x39')]!==_0x69ca('0x3a')){var _0x412a7e={};_0x412a7e[_0x53751[_0x69ca('0x3b')]]={'$like':'%'+_0x2f66d3[_0x69ca('0x2b')]['filter']+'%'};return _0x412a7e;}})});}_0x50a4a7=_[_0x69ca('0x3c')]({},_0x50a4a7,_0x2f66d3['options']);var _0x2bd39b={'where':_0x50a4a7[_0x69ca('0x34')]};return db[_0x69ca('0x27')][_0x69ca('0x3d')](_0x2bd39b)['then'](function(_0x5d7661){_0x3670f6[_0x69ca('0x3d')]=_0x5d7661;if(_0x2f66d3[_0x69ca('0x2b')][_0x69ca('0x3e')]){_0x50a4a7['include']=[{'all':!![]}];}return db['ZendeskField'][_0x69ca('0x3f')](_0x50a4a7);})[_0x69ca('0x22')](function(_0x51c87f){_0x3670f6[_0x69ca('0x40')]=_0x51c87f;return _0x3670f6;})['then'](respondWithFilteredResult(_0x5eb844,_0x50a4a7))[_0x69ca('0x41')](handleError(_0x5eb844,null));};exports['show']=function(_0x398c02,_0x4466b4){var _0xa3939b={'raw':!![],'where':{'id':_0x398c02[_0x69ca('0x42')]['id']}},_0x2b1137={};_0x2b1137[_0x69ca('0x29')]=_['keys'](db[_0x69ca('0x27')]['rawAttributes']);_0x2b1137[_0x69ca('0x2b')]=_[_0x69ca('0x2a')](_0x398c02['query']);_0x2b1137[_0x69ca('0x35')]=_[_0x69ca('0x2c')](_0x2b1137[_0x69ca('0x29')],_0x2b1137['query']);_0xa3939b[_0x69ca('0x2d')]=_[_0x69ca('0x2c')](_0x2b1137['model'],qs[_0x69ca('0x2e')](_0x398c02[_0x69ca('0x2b')]['fields']));_0xa3939b[_0x69ca('0x2d')]=_0xa3939b[_0x69ca('0x2d')][_0x69ca('0x2f')]?_0xa3939b['attributes']:_0x2b1137[_0x69ca('0x29')];if(_0x398c02[_0x69ca('0x2b')][_0x69ca('0x3e')]){_0xa3939b[_0x69ca('0x43')]=[{'all':!![]}];}_0xa3939b=_[_0x69ca('0x3c')]({},_0xa3939b,_0x398c02['options']);return db[_0x69ca('0x27')][_0x69ca('0x44')](_0xa3939b)[_0x69ca('0x22')](handleEntityNotFound(_0x4466b4,null))[_0x69ca('0x22')](respondWithResult(_0x4466b4,null))['catch'](handleError(_0x4466b4,null));};exports[_0x69ca('0x45')]=function(_0x5b3758,_0x14dc5a){return db[_0x69ca('0x27')][_0x69ca('0x45')](_0x5b3758['body'],{})[_0x69ca('0x22')](respondWithResult(_0x14dc5a,0xc9))['catch'](handleError(_0x14dc5a,null));};exports[_0x69ca('0x20')]=function(_0x1f9d1e,_0x3bda9f){if(_0x1f9d1e['body']['id']){delete _0x1f9d1e[_0x69ca('0x46')]['id'];}return db[_0x69ca('0x27')]['find']({'where':{'id':_0x1f9d1e[_0x69ca('0x42')]['id']}})['then'](handleEntityNotFound(_0x3bda9f,null))[_0x69ca('0x22')](saveUpdates(_0x1f9d1e['body'],null))['then'](respondWithResult(_0x3bda9f,null))[_0x69ca('0x41')](handleError(_0x3bda9f,null));};exports[_0x69ca('0x21')]=function(_0xa827a5,_0x2f17fe){return db[_0x69ca('0x27')]['find']({'where':{'id':_0xa827a5['params']['id']}})[_0x69ca('0x22')](handleEntityNotFound(_0x2f17fe,null))[_0x69ca('0x22')](removeEntity(_0x2f17fe,null))[_0x69ca('0x41')](handleError(_0x2f17fe,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 1655e3c..5db867d 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 _0x38ff=['zendesk_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','ZendeskField','int_zendesk_fields'];(function(_0xf4b32c,_0x2e989c){var _0x2514cf=function(_0x1680d7){while(--_0x1680d7){_0xf4b32c['push'](_0xf4b32c['shift']());}};_0x2514cf(++_0x2e989c);}(_0x38ff,0x137));var _0xf38f=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x38ff[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require('lodash');var util=require(_0xf38f('0x0'));var logger=require(_0xf38f('0x1'))('api');var moment=require(_0xf38f('0x2'));var BPromise=require(_0xf38f('0x3'));var rp=require(_0xf38f('0x4'));var fs=require('fs');var path=require(_0xf38f('0x5'));var rimraf=require('rimraf');var config=require(_0xf38f('0x6'));var attributes=require('./intZendeskField.attributes');module[_0xf38f('0x7')]=function(_0x556887,_0x2e3eeb){return _0x556887[_0xf38f('0x8')](_0xf38f('0x9'),attributes,{'tableName':_0xf38f('0xa'),'paranoid':![],'indexes':[{'name':_0xf38f('0xb'),'fields':[_0xf38f('0xc'),_0xf38f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x071d=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x22bbab,_0x7cc47e){var _0x162710=function(_0x5c2d2d){while(--_0x5c2d2d){_0x22bbab['push'](_0x22bbab['shift']());}};_0x162710(++_0x7cc47e);}(_0x071d,0x190));var _0xd071=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x071d[_0xa148b7];return _0x51efd3;};'use strict';var _=require('lodash');var util=require(_0xd071('0x0'));var logger=require(_0xd071('0x1'))(_0xd071('0x2'));var moment=require('moment');var BPromise=require(_0xd071('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd071('0x4'));var rimraf=require(_0xd071('0x5'));var config=require(_0xd071('0x6'));var attributes=require(_0xd071('0x7'));module[_0xd071('0x8')]=function(_0x28f704,_0x42dd8a){return _0x28f704[_0xd071('0x9')](_0xd071('0xa'),attributes,{'tableName':_0xd071('0xb'),'paranoid':![],'indexes':[{'name':_0xd071('0xc'),'fields':['idField',_0xd071('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index cfcbe6b..b220db9 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 _0x2884=['request\x20sent','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','info','debug','ZendeskField,\x20%s,\x20%s,\x20%s'];(function(_0x464a45,_0x351af0){var _0x201329=function(_0x621286){while(--_0x621286){_0x464a45['push'](_0x464a45['shift']());}};_0x201329(++_0x351af0);}(_0x2884,0x1eb));var _0x4288=function(_0x290ef5,_0x32cfa7){_0x290ef5=_0x290ef5-0x0;var _0x450d92=_0x2884[_0x290ef5];return _0x450d92;};'use strict';var _=require(_0x4288('0x0'));var util=require('util');var moment=require(_0x4288('0x1'));var BPromise=require(_0x4288('0x2'));var rs=require(_0x4288('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4288('0x4'))['db'];var utils=require(_0x4288('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4288('0x6'));var jayson=require(_0x4288('0x7'));var client=jayson[_0x4288('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x526a07,_0x3a930e,_0x5e4cfc){return new BPromise(function(_0x25023a,_0x237b02){return client['request'](_0x526a07,_0x5e4cfc)[_0x4288('0x9')](function(_0x3c8d6e){logger[_0x4288('0xa')]('ZendeskField,\x20%s,\x20%s',_0x3a930e,'request\x20sent');logger[_0x4288('0xb')](_0x4288('0xc'),_0x3a930e,_0x4288('0xd'),JSON[_0x4288('0xe')](_0x3c8d6e));if(_0x3c8d6e[_0x4288('0xf')]){if(_0x3c8d6e[_0x4288('0xf')][_0x4288('0x10')]===0x1f4){logger['error'](_0x4288('0x11'),_0x3a930e,_0x3c8d6e[_0x4288('0xf')][_0x4288('0x12')]);return _0x237b02(_0x3c8d6e[_0x4288('0xf')]['message']);}logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x3c8d6e['error'][_0x4288('0x12')]);return _0x25023a(_0x3c8d6e['error'][_0x4288('0x12')]);}else{logger['info'](_0x4288('0x11'),_0x3a930e,_0x4288('0xd'));_0x25023a(_0x3c8d6e[_0x4288('0x13')][_0x4288('0x12')]);}})[_0x4288('0x14')](function(_0x1db33b){logger[_0x4288('0xf')](_0x4288('0x11'),_0x3a930e,_0x1db33b);_0x237b02(_0x1db33b);});});} \ No newline at end of file +var _0xb9a7=['request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZendeskField,\x20%s,\x20%s'];(function(_0xf48cce,_0x3531e4){var _0x2a5c38=function(_0x22a454){while(--_0x22a454){_0xf48cce['push'](_0xf48cce['shift']());}};_0x2a5c38(++_0x3531e4);}(_0xb9a7,0x112));var _0x7b9a=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xb9a7[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('ZendeskField,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('ZendeskField,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index a5948a5..073c98e 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 _0xea28=['./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xe2f2ca,_0x4a3540){var _0x3e517f=function(_0x5a0026){while(--_0x5a0026){_0xe2f2ca['push'](_0xe2f2ca['shift']());}};_0x3e517f(++_0x4a3540);}(_0xea28,0x13a));var _0x8ea2=function(_0x1cea27,_0x365e88){_0x1cea27=_0x1cea27-0x0;var _0x51acff=_0xea28[_0x1cea27];return _0x51acff;};'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 auth=require(_0x8ea2('0x6'));var interaction=require(_0x8ea2('0x7'));var config=require('../../config/environment');var controller=require(_0x8ea2('0x8'));router[_0x8ea2('0x9')]('/',auth[_0x8ea2('0xa')](),controller['index']);router[_0x8ea2('0x9')](_0x8ea2('0xb'),auth[_0x8ea2('0xa')](),controller[_0x8ea2('0xc')]);router[_0x8ea2('0x9')](_0x8ea2('0xd'),auth[_0x8ea2('0xa')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0x9')](_0x8ea2('0xf'),auth[_0x8ea2('0xa')](),controller[_0x8ea2('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8ea2('0x11')]);router[_0x8ea2('0x12')](_0x8ea2('0xd'),auth['isAuthenticated'](),controller[_0x8ea2('0x13')]);router[_0x8ea2('0x14')](_0x8ea2('0xb'),auth[_0x8ea2('0xa')](),controller[_0x8ea2('0x15')]);router['delete'](_0x8ea2('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8ea2('0x16')]=router; \ No newline at end of file +var _0x4cf8=['addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','/:id','show','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x3a833e,_0x5a1878){_0x3a833e=_0x3a833e-0x0;var _0xdff445=_0x4cf8[_0x3a833e];return _0xdff445;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var auth=require(_0x84cf('0x6'));var interaction=require(_0x84cf('0x7'));var config=require(_0x84cf('0x8'));var controller=require(_0x84cf('0x9'));router[_0x84cf('0xa')]('/',auth[_0x84cf('0xb')](),controller['index']);router['get'](_0x84cf('0xc'),auth['isAuthenticated'](),controller[_0x84cf('0xd')]);router[_0x84cf('0xa')]('/:id/configurations',auth[_0x84cf('0xb')](),controller[_0x84cf('0xe')]);router['get'](_0x84cf('0xf'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/',auth['isAuthenticated'](),controller[_0x84cf('0x12')]);router[_0x84cf('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x84cf('0x13')]);router[_0x84cf('0x14')](_0x84cf('0xc'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x15')]);router[_0x84cf('0x16')](_0x84cf('0xc'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x17')]);module[_0x84cf('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index ca92087..0c4bf18 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 _0x95fe=['STRING'];(function(_0x1c68d7,_0x341eee){var _0x5a6de7=function(_0x35fb92){while(--_0x35fb92){_0x1c68d7['push'](_0x1c68d7['shift']());}};_0x5a6de7(++_0x341eee);}(_0x95fe,0xbb));var _0xe95f=function(_0x2103dd,_0x2cb8f6){_0x2103dd=_0x2103dd-0x0;var _0x457cf6=_0x95fe[_0x2103dd];return _0x457cf6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe95f('0x0')]},'description':{'type':Sequelize[_0xe95f('0x0')]},'authToken':{'type':Sequelize[_0xe95f('0x0')]},'host':{'type':Sequelize[_0xe95f('0x0')]},'serverUrl':{'type':Sequelize[_0xe95f('0x0')]}}; \ No newline at end of file +var _0x704e=['sequelize','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x704e,0x160));var _0xe704=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x704e[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xe704('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xe704('0x1')]},'host':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xe704('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index dc9c103..81902a1 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 _0x36f9=['Calls','Call\x20Purpose','includes','label','customfield','true','Pick\x20List','val','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','moment','mustache','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','destroy','name','send','ZohoAccount','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','show','params','length','find','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','getSubjects','channel','Descriptions','ZohoField','Subjects','host','authToken','slice','substring','lastIndexOf','GET','format','https://crm.%s/crm/private/json/Calls/getFields','crmapi','response','section'];(function(_0x3a2849,_0xf7766a){var _0x1456af=function(_0x466000){while(--_0x466000){_0x3a2849['push'](_0x3a2849['shift']());}};_0x1456af(++_0xf7766a);}(_0x36f9,0x1bb));var _0x936f=function(_0x874e27,_0x212e80){_0x874e27=_0x874e27-0x0;var _0x52ae59=_0x36f9[_0x874e27];return _0x52ae59;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x936f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x936f('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x936f('0x2'));var util=require('util');var path=require('path');var sox=require(_0x936f('0x3'));var csv=require(_0x936f('0x4'));var ejs=require(_0x936f('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x936f('0x6'));var crypto=require(_0x936f('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x936f('0x8'));var toCsv=require(_0x936f('0x4'));var querystring=require(_0x936f('0x9'));var Papa=require(_0x936f('0xa'));var Redis=require(_0x936f('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x936f('0xc'));var hardwareService=require(_0x936f('0xd'));var logger=require(_0x936f('0xe'))(_0x936f('0xf'));var utils=require('../../config/utils');var config=require(_0x936f('0x10'));var db=require(_0x936f('0x11'))['db'];var integrations=require(_0x936f('0x12'));var jayson=require(_0x936f('0x13'));var client=jayson[_0x936f('0x14')][_0x936f('0x15')]({'port':0x232a});function checkPasswordPattern(_0x17bcae,_0x56c95b,_0x26e034){if(_0x26e034){var _0x36f52b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36f52b['test'](_0x56c95b)){return _0x17bcae;}else{throw new Error(_0x936f('0x16'));}}else{return _0x17bcae;}}function respondWithRpcPromise(_0x180b20,_0x4b467d,_0x4e10c3,_0x4c926c){return new BPromise(function(_0x522687,_0xfdd310){var _0x30d611=_0x4c926c||client;return _0x30d611['request'](_0x180b20,_0x4e10c3)[_0x936f('0x17')](function(_0x39fa84){logger[_0x936f('0x18')](_0x936f('0x19'),_0x4b467d,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x4b467d,_0x936f('0x1a'),JSON[_0x936f('0x1b')](_0x39fa84));if(_0x39fa84[_0x936f('0x1c')]){if(_0x39fa84['error'][_0x936f('0x1d')]===0x1f4){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4b467d,_0x39fa84[_0x936f('0x1c')][_0x936f('0x1e')]);return _0xfdd310(_0x39fa84['error']['message']);}logger[_0x936f('0x1c')](_0x936f('0x19'),_0x4b467d,_0x39fa84[_0x936f('0x1c')][_0x936f('0x1e')]);return _0x522687(_0x39fa84[_0x936f('0x1c')]['message']);}else{logger[_0x936f('0x18')]('ZohoAccount,\x20%s,\x20%s',_0x4b467d,_0x936f('0x1a'));_0x522687(_0x39fa84['result']['message']);}})[_0x936f('0x1f')](function(_0x3e2025){logger[_0x936f('0x1c')](_0x936f('0x19'),_0x4b467d,_0x3e2025);_0xfdd310(_0x3e2025);});});}function respondWithStatusCode(_0x4c759e,_0x4185e9){_0x4185e9=_0x4185e9||0xcc;return function(_0x5e3432){if(_0x5e3432){return _0x4c759e[_0x936f('0x20')](_0x4185e9);}return _0x4c759e[_0x936f('0x21')](_0x4185e9)[_0x936f('0x22')]();};}function respondWithResult(_0x2e5e72,_0x181010){_0x181010=_0x181010||0xc8;return function(_0x557cca){if(_0x557cca){return _0x2e5e72[_0x936f('0x21')](_0x181010)[_0x936f('0x23')](_0x557cca);}};}function respondWithFilteredResult(_0x538d19,_0x77f910){return function(_0x40db2e){if(_0x40db2e){var _0x4f95ec=_0x40db2e[_0x936f('0x24')],_0x2c976b=_0x77f910[_0x936f('0x25')],_0x4b77b9=_0x77f910[_0x936f('0x25')]+_0x77f910[_0x936f('0x26')],_0x2f375f;if(_0x4b77b9>=_0x4f95ec){_0x4b77b9=_0x4f95ec;_0x2f375f=0xc8;}else{_0x2f375f=0xce;}_0x538d19[_0x936f('0x21')](_0x2f375f);return _0x538d19[_0x936f('0x27')]('Content-Range',_0x2c976b+'-'+_0x4b77b9+'/'+_0x4f95ec)['json'](_0x40db2e);}return null;};}function patchUpdates(_0x11b6fa){return function(_0x3c1047){try{jsonpatch[_0x936f('0x28')](_0x3c1047,_0x11b6fa,!![]);}catch(_0x32af43){return BPromise[_0x936f('0x29')](_0x32af43);}return _0x3c1047[_0x936f('0x2a')]();};}function saveUpdates(_0x51418a,_0x1a45a6){return function(_0xa6d0de){if(_0xa6d0de){return _0xa6d0de[_0x936f('0x2b')](_0x51418a)[_0x936f('0x17')](function(_0x3a8eb5){return _0x3a8eb5;});}return null;};}function removeEntity(_0x38987b,_0x367613){return function(_0xd45f07){if(_0xd45f07){return _0xd45f07[_0x936f('0x2c')]()[_0x936f('0x17')](function(){_0x38987b[_0x936f('0x21')](0xcc)[_0x936f('0x22')]();});}};}function handleEntityNotFound(_0x474054,_0x253078){return function(_0x2888fc){if(!_0x2888fc){_0x474054[_0x936f('0x20')](0x194);}return _0x2888fc;};}function handleError(_0x3304bd,_0x383032){_0x383032=_0x383032||0x1f4;return function(_0x401991){logger[_0x936f('0x1c')](_0x401991['stack']);if(_0x401991[_0x936f('0x2d')]){delete _0x401991['name'];}_0x3304bd[_0x936f('0x21')](_0x383032)[_0x936f('0x2e')](_0x401991);};}exports['index']=function(_0x3ebc79,_0x186df2){var _0x3a3229={},_0x37a319={},_0x1f3a83={'count':0x0,'rows':[]};var _0x4a6a25=db[_0x936f('0x2f')][_0x936f('0x30')];_0x37a319[_0x936f('0x31')]=_[_0x936f('0x32')](_0x4a6a25);_0x37a319[_0x936f('0x33')]=_[_0x936f('0x32')](_0x3ebc79['query']);_0x37a319[_0x936f('0x34')]=_['intersection'](_0x37a319[_0x936f('0x31')],_0x37a319[_0x936f('0x33')]);_0x3a3229[_0x936f('0x35')]=_[_0x936f('0x36')](_0x37a319[_0x936f('0x31')],qs[_0x936f('0x37')](_0x3ebc79['query'][_0x936f('0x37')]));_0x3a3229['attributes']=_0x3a3229[_0x936f('0x35')]['length']?_0x3a3229[_0x936f('0x35')]:_0x37a319[_0x936f('0x31')];if(!_0x3ebc79[_0x936f('0x33')][_0x936f('0x38')](_0x936f('0x39'))){_0x3a3229['limit']=qs['limit'](_0x3ebc79[_0x936f('0x33')][_0x936f('0x26')]);_0x3a3229[_0x936f('0x25')]=qs['offset'](_0x3ebc79[_0x936f('0x33')][_0x936f('0x25')]);}_0x3a3229[_0x936f('0x3a')]=qs['sort'](_0x3ebc79[_0x936f('0x33')][_0x936f('0x3b')]);_0x3a3229[_0x936f('0x3c')]=qs[_0x936f('0x34')](_[_0x936f('0x3d')](_0x3ebc79['query'],_0x37a319[_0x936f('0x34')]));if(_0x3ebc79['query'][_0x936f('0x3e')]){_0x3a3229['where']=_[_0x936f('0x3f')](_0x3a3229[_0x936f('0x3c')],{'$or':_[_0x936f('0x40')](_0x4a6a25,function(_0x300c00){if(_0x300c00[_0x936f('0x41')]['key']!==_0x936f('0x42')){var _0x1dbfef={};_0x1dbfef[_0x300c00[_0x936f('0x43')]]={'$like':'%'+_0x3ebc79[_0x936f('0x33')]['filter']+'%'};return _0x1dbfef;}})});}_0x3a3229=_[_0x936f('0x3f')]({},_0x3a3229,_0x3ebc79[_0x936f('0x44')]);var _0x2ba693={'where':_0x3a3229['where']};return db[_0x936f('0x2f')]['count'](_0x2ba693)[_0x936f('0x17')](function(_0x50e3d5){_0x1f3a83[_0x936f('0x24')]=_0x50e3d5;if(_0x3ebc79[_0x936f('0x33')][_0x936f('0x45')]){_0x3a3229[_0x936f('0x46')]=[{'all':!![]}];}return db[_0x936f('0x2f')][_0x936f('0x47')](_0x3a3229);})['then'](function(_0x12b762){_0x1f3a83['rows']=_0x12b762;return _0x1f3a83;})['then'](respondWithFilteredResult(_0x186df2,_0x3a3229))['catch'](handleError(_0x186df2,null));};exports[_0x936f('0x48')]=function(_0x3a7419,_0x5defee){var _0x290566={'raw':![],'where':{'id':_0x3a7419[_0x936f('0x49')]['id']}},_0xc16a2f={};_0xc16a2f[_0x936f('0x31')]=_[_0x936f('0x32')](db[_0x936f('0x2f')]['rawAttributes']);_0xc16a2f[_0x936f('0x33')]=_[_0x936f('0x32')](_0x3a7419[_0x936f('0x33')]);_0xc16a2f[_0x936f('0x34')]=_[_0x936f('0x36')](_0xc16a2f[_0x936f('0x31')],_0xc16a2f[_0x936f('0x33')]);_0x290566[_0x936f('0x35')]=_[_0x936f('0x36')](_0xc16a2f[_0x936f('0x31')],qs[_0x936f('0x37')](_0x3a7419[_0x936f('0x33')][_0x936f('0x37')]));_0x290566[_0x936f('0x35')]=_0x290566[_0x936f('0x35')][_0x936f('0x4a')]?_0x290566[_0x936f('0x35')]:_0xc16a2f[_0x936f('0x31')];if(_0x3a7419['query']['includeAll']){_0x290566[_0x936f('0x46')]=[{'all':!![]}];}_0x290566=_[_0x936f('0x3f')]({},_0x290566,_0x3a7419[_0x936f('0x44')]);return db[_0x936f('0x2f')][_0x936f('0x4b')](_0x290566)['then'](handleEntityNotFound(_0x5defee,null))[_0x936f('0x17')](respondWithResult(_0x5defee,null))['catch'](handleError(_0x5defee,null));};exports['create']=function(_0x50be00,_0x491ec9){return db[_0x936f('0x2f')]['create'](_0x50be00[_0x936f('0x4c')],{})[_0x936f('0x17')](respondWithResult(_0x491ec9,0xc9))['catch'](handleError(_0x491ec9,null));};exports[_0x936f('0x2b')]=function(_0x2d15ab,_0x1abe09){if(_0x2d15ab[_0x936f('0x4c')]['id']){delete _0x2d15ab[_0x936f('0x4c')]['id'];}return db[_0x936f('0x2f')][_0x936f('0x4b')]({'where':{'id':_0x2d15ab['params']['id']}})['then'](handleEntityNotFound(_0x1abe09,null))[_0x936f('0x17')](saveUpdates(_0x2d15ab['body'],null))[_0x936f('0x17')](respondWithResult(_0x1abe09,null))[_0x936f('0x1f')](handleError(_0x1abe09,null));};exports[_0x936f('0x2c')]=function(_0x520ade,_0x40539c){return db[_0x936f('0x2f')]['find']({'where':{'id':_0x520ade['params']['id']}})[_0x936f('0x17')](handleEntityNotFound(_0x40539c,null))[_0x936f('0x17')](removeEntity(_0x40539c,null))[_0x936f('0x1f')](handleError(_0x40539c,null));};exports[_0x936f('0x4d')]=function(_0x5e73b1,_0x48b167,_0x5ef524){var _0xebfbd5={};var _0x24af87={};var _0x5f0c75;var _0x449ece;return db['ZohoAccount'][_0x936f('0x4e')]({'where':{'id':_0x5e73b1[_0x936f('0x49')]['id']}})[_0x936f('0x17')](handleEntityNotFound(_0x48b167,null))[_0x936f('0x17')](function(_0x464e0c){if(_0x464e0c){_0x5f0c75=_0x464e0c;_0x24af87['model']=_[_0x936f('0x32')](db[_0x936f('0x4f')]['rawAttributes']);_0x24af87[_0x936f('0x33')]=_[_0x936f('0x32')](_0x5e73b1[_0x936f('0x33')]);_0x24af87[_0x936f('0x34')]=_[_0x936f('0x36')](_0x24af87[_0x936f('0x31')],_0x24af87[_0x936f('0x33')]);_0xebfbd5[_0x936f('0x35')]=_[_0x936f('0x36')](_0x24af87[_0x936f('0x31')],qs[_0x936f('0x37')](_0x5e73b1[_0x936f('0x33')][_0x936f('0x37')]));_0xebfbd5[_0x936f('0x35')]=_0xebfbd5['attributes'][_0x936f('0x4a')]?_0xebfbd5['attributes']:_0x24af87[_0x936f('0x31')];_0xebfbd5['order']=qs['sort'](_0x5e73b1[_0x936f('0x33')][_0x936f('0x3b')]);_0xebfbd5['where']=qs[_0x936f('0x34')](_[_0x936f('0x3d')](_0x5e73b1['query'],_0x24af87['filters']));if(_0x5e73b1['query'][_0x936f('0x3e')]){_0xebfbd5[_0x936f('0x3c')]=_[_0x936f('0x3f')](_0xebfbd5[_0x936f('0x3c')],{'$or':_['map'](_0xebfbd5['attributes'],function(_0x1714df){var _0x468a75={};_0x468a75[_0x1714df]={'$like':'%'+_0x5e73b1[_0x936f('0x33')]['filter']+'%'};return _0x468a75;})});}_0xebfbd5=_[_0x936f('0x3f')]({},_0xebfbd5,_0x5e73b1['options']);return _0x5f0c75['getConfigurations'](_0xebfbd5);}})['then'](function(_0x3928df){if(_0x3928df){_0x449ece=_0x3928df[_0x936f('0x4a')];if(!_0x5e73b1['query'][_0x936f('0x38')](_0x936f('0x39'))){_0xebfbd5['limit']=qs[_0x936f('0x26')](_0x5e73b1[_0x936f('0x33')][_0x936f('0x26')]);_0xebfbd5[_0x936f('0x25')]=qs[_0x936f('0x25')](_0x5e73b1[_0x936f('0x33')][_0x936f('0x25')]);}return _0x5f0c75[_0x936f('0x4d')](_0xebfbd5);}})[_0x936f('0x17')](function(_0x2dbac4){if(_0x2dbac4){return _0x2dbac4?{'count':_0x449ece,'rows':_0x2dbac4}:null;}})[_0x936f('0x17')](respondWithResult(_0x48b167,null))['catch'](handleError(_0x48b167,null));};exports[_0x936f('0x50')]=function(_0x3bb3a8,_0x2890eb,_0x1212b4){if(_0x3bb3a8[_0x936f('0x4c')]['id']){delete _0x3bb3a8[_0x936f('0x4c')]['id'];}return db[_0x936f('0x2f')][_0x936f('0x4e')]({'where':{'id':_0x3bb3a8[_0x936f('0x49')]['id']}})[_0x936f('0x17')](handleEntityNotFound(_0x2890eb,null))[_0x936f('0x17')](function(_0x3a128d){if(_0x3a128d){_0x3bb3a8[_0x936f('0x4c')]['AccountId']=_0x3a128d['id'];_0x3bb3a8['body']['Subjects']=integrations[_0x936f('0x51')](_0x3bb3a8[_0x936f('0x4c')][_0x936f('0x52')],_0x3bb3a8[_0x936f('0x4c')][_0x936f('0x41')]);_0x3bb3a8[_0x936f('0x4c')][_0x936f('0x53')]=integrations['getDescriptions'](_0x3bb3a8[_0x936f('0x4c')][_0x936f('0x52')],_0x3bb3a8[_0x936f('0x4c')][_0x936f('0x41')]);return db['ZohoConfiguration']['create'](_0x3bb3a8[_0x936f('0x4c')],{'include':[{'model':db[_0x936f('0x54')],'as':_0x936f('0x55')},{'model':db[_0x936f('0x54')],'as':_0x936f('0x53')}]});}return null;})[_0x936f('0x17')](respondWithResult(_0x2890eb,null))[_0x936f('0x1f')](handleError(_0x2890eb,null));};exports['getFields']=function(_0x495259,_0x36de61,_0x56edbe){var _0x4e1deb='';return db['ZohoAccount']['findOne']({'where':{'id':_0x495259[_0x936f('0x49')]['id']},'attributes':['id',_0x936f('0x56'),_0x936f('0x57')]})[_0x936f('0x17')](handleEntityNotFound(_0x36de61,null))[_0x936f('0x17')](function(_0xb391aa){if(_0xb391aa){_0x4e1deb=_0xb391aa['host'];var _0x2ead28=_0x4e1deb[_0x936f('0x58')](-0x1);if(_0x2ead28==='/'){_0x4e1deb=_0x4e1deb[_0x936f('0x59')](0x0,_0x4e1deb[_0x936f('0x5a')](_0x2ead28));}return rp({'method':_0x936f('0x5b'),'uri':util[_0x936f('0x5c')](_0x936f('0x5d'),_0x4e1deb),'qs':{'authtoken':_0xb391aa['authToken'],'scope':_0x936f('0x5e')},'json':!![]});}})[_0x936f('0x17')](function(_0xdf3c12){if(_0xdf3c12){if(_0xdf3c12[_0x936f('0x5f')]&&_0xdf3c12['response'][_0x936f('0x1c')]){throw new Error(_0xdf3c12[_0x936f('0x5f')]['error']['message']);}var _0x35a6a5=[];if(_0xdf3c12['Calls']&&_0xdf3c12['Calls'][_0x936f('0x60')]){if(_0xdf3c12[_0x936f('0x61')][_0x936f('0x60')]['FL']){var _0x15e37b=[_0x936f('0x62')];for(var _0x3c14e6=0x0,_0x12e772=_0xdf3c12[_0x936f('0x61')]['section']['FL']['length'];_0x3c14e6<_0x12e772;_0x3c14e6++){if(_[_0x936f('0x63')](_0x15e37b,_0xdf3c12['Calls'][_0x936f('0x60')]['FL'][_0x3c14e6]['dv'])){_0x35a6a5['push']({'id':_0xdf3c12['Calls'][_0x936f('0x60')]['FL'][_0x3c14e6]['dv'],'name':_0xdf3c12[_0x936f('0x61')][_0x936f('0x60')]['FL'][_0x3c14e6][_0x936f('0x64')],'custom':_0xdf3c12[_0x936f('0x61')][_0x936f('0x60')]['FL'][_0x3c14e6][_0x936f('0x65')]===_0x936f('0x66')?!![]:![],'options':_0xdf3c12[_0x936f('0x61')][_0x936f('0x60')]['FL'][_0x3c14e6][_0x936f('0x41')]===_0x936f('0x67')&&_0xdf3c12['Calls']['section']['FL'][_0x3c14e6][_0x936f('0x68')]?_[_0x936f('0x40')](_0xdf3c12[_0x936f('0x61')][_0x936f('0x60')]['FL'][_0x3c14e6][_0x936f('0x68')],function(_0x53e500){return{'name':_0x53e500,'value':_0x53e500};}):[]});}}}}return{'count':_0x35a6a5['length'],'rows':_0x35a6a5};}})[_0x936f('0x17')](respondWithResult(_0x36de61,null))[_0x936f('0x1f')](function(_0x2f4934){var _0x4fd0dc=_0x495259[_0x936f('0x33')][_0x936f('0x69')]?0x1f4:_0x2f4934[_0x936f('0x6a')]||0x1f4;logger[_0x936f('0x1c')](_0x936f('0x6b'),'getFields',_0x4fd0dc,JSON['stringify'](_0x2f4934));delete _0x2f4934[_0x936f('0x2d')];if(_0x4fd0dc===0x191){_0x4fd0dc=0x190;}_0x36de61[_0x936f('0x21')](_0x4fd0dc)['send'](_0x495259[_0x936f('0x33')][_0x936f('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x2f4934[_0x936f('0x6a')]}:_0x2f4934);});}; \ No newline at end of file +var _0xdf2b=['reject','save','update','stack','name','send','ZohoAccount','rawAttributes','query','keys','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','key','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','create','body','getConfigurations','ZohoConfiguration','map','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ZohoField','Subjects','host','authToken','slice','substring','lastIndexOf','GET','response','Calls','section','includes','push','customfield','true','Pick\x20List','val','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','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','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xdf2b,0x125));var _0xbdf2=function(_0x2781b0,_0x4ec0d2){_0x2781b0=_0x2781b0-0x0;var _0xb532ba=_0xdf2b[_0x2781b0];return _0xb532ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbdf2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbdf2('0x1'));var rp=require('request-promise');var moment=require(_0xbdf2('0x2'));var BPromise=require(_0xbdf2('0x3'));var Mustache=require(_0xbdf2('0x4'));var util=require(_0xbdf2('0x5'));var path=require(_0xbdf2('0x6'));var sox=require(_0xbdf2('0x7'));var csv=require(_0xbdf2('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbdf2('0x9'));var squel=require(_0xbdf2('0xa'));var crypto=require('crypto');var jsforce=require(_0xbdf2('0xb'));var deskjs=require(_0xbdf2('0xc'));var toCsv=require(_0xbdf2('0x8'));var querystring=require(_0xbdf2('0xd'));var Papa=require(_0xbdf2('0xe'));var Redis=require(_0xbdf2('0xf'));var authService=require(_0xbdf2('0x10'));var qs=require(_0xbdf2('0x11'));var hardwareService=require(_0xbdf2('0x12'));var logger=require(_0xbdf2('0x13'))(_0xbdf2('0x14'));var utils=require(_0xbdf2('0x15'));var config=require(_0xbdf2('0x16'));var db=require(_0xbdf2('0x17'))['db'];var integrations=require(_0xbdf2('0x18'));var jayson=require(_0xbdf2('0x19'));var client=jayson['client'][_0xbdf2('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x293e77,_0x2e2c74,_0x5ec208){if(_0x5ec208){var _0x2ac939=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ac939[_0xbdf2('0x1b')](_0x2e2c74)){return _0x293e77;}else{throw new Error(_0xbdf2('0x1c'));}}else{return _0x293e77;}}function respondWithRpcPromise(_0x679f35,_0xdc30dc,_0x3c955e,_0x563105){return new BPromise(function(_0x200b66,_0xa405be){var _0x25ad56=_0x563105||client;return _0x25ad56[_0xbdf2('0x1d')](_0x679f35,_0x3c955e)[_0xbdf2('0x1e')](function(_0x15f857){logger[_0xbdf2('0x1f')](_0xbdf2('0x20'),_0xdc30dc,_0xbdf2('0x21'));logger['debug'](_0xbdf2('0x22'),_0xdc30dc,_0xbdf2('0x21'),JSON[_0xbdf2('0x23')](_0x15f857));if(_0x15f857['error']){if(_0x15f857['error']['code']===0x1f4){logger['error'](_0xbdf2('0x20'),_0xdc30dc,_0x15f857[_0xbdf2('0x24')]['message']);return _0xa405be(_0x15f857['error'][_0xbdf2('0x25')]);}logger[_0xbdf2('0x24')](_0xbdf2('0x20'),_0xdc30dc,_0x15f857[_0xbdf2('0x24')][_0xbdf2('0x25')]);return _0x200b66(_0x15f857['error']['message']);}else{logger[_0xbdf2('0x1f')](_0xbdf2('0x20'),_0xdc30dc,_0xbdf2('0x21'));_0x200b66(_0x15f857[_0xbdf2('0x26')]['message']);}})[_0xbdf2('0x27')](function(_0x5a87f9){logger['error']('ZohoAccount,\x20%s,\x20%s',_0xdc30dc,_0x5a87f9);_0xa405be(_0x5a87f9);});});}function respondWithStatusCode(_0x393d9f,_0x332e59){_0x332e59=_0x332e59||0xcc;return function(_0x2f21ba){if(_0x2f21ba){return _0x393d9f[_0xbdf2('0x28')](_0x332e59);}return _0x393d9f['status'](_0x332e59)[_0xbdf2('0x29')]();};}function respondWithResult(_0xad03af,_0x1bbc2a){_0x1bbc2a=_0x1bbc2a||0xc8;return function(_0x1555ea){if(_0x1555ea){return _0xad03af[_0xbdf2('0x2a')](_0x1bbc2a)[_0xbdf2('0x2b')](_0x1555ea);}};}function respondWithFilteredResult(_0x2f4b7f,_0x222a65){return function(_0x37fb10){if(_0x37fb10){var _0x1c51b1=_0x37fb10[_0xbdf2('0x2c')],_0x521ab4=_0x222a65[_0xbdf2('0x2d')],_0x3bc623=_0x222a65[_0xbdf2('0x2d')]+_0x222a65[_0xbdf2('0x2e')],_0x5775c9;if(_0x3bc623>=_0x1c51b1){_0x3bc623=_0x1c51b1;_0x5775c9=0xc8;}else{_0x5775c9=0xce;}_0x2f4b7f[_0xbdf2('0x2a')](_0x5775c9);return _0x2f4b7f[_0xbdf2('0x2f')](_0xbdf2('0x30'),_0x521ab4+'-'+_0x3bc623+'/'+_0x1c51b1)[_0xbdf2('0x2b')](_0x37fb10);}return null;};}function patchUpdates(_0x48cda9){return function(_0x4f726f){try{jsonpatch['apply'](_0x4f726f,_0x48cda9,!![]);}catch(_0x3ad6c0){return BPromise[_0xbdf2('0x31')](_0x3ad6c0);}return _0x4f726f[_0xbdf2('0x32')]();};}function saveUpdates(_0x27f1c4,_0x23792f){return function(_0x592457){if(_0x592457){return _0x592457[_0xbdf2('0x33')](_0x27f1c4)[_0xbdf2('0x1e')](function(_0x26f74f){return _0x26f74f;});}return null;};}function removeEntity(_0x33866c,_0x7c1fa1){return function(_0x4ffcab){if(_0x4ffcab){return _0x4ffcab['destroy']()['then'](function(){_0x33866c[_0xbdf2('0x2a')](0xcc)[_0xbdf2('0x29')]();});}};}function handleEntityNotFound(_0x5391c9,_0xdb46ce){return function(_0x2a37d7){if(!_0x2a37d7){_0x5391c9[_0xbdf2('0x28')](0x194);}return _0x2a37d7;};}function handleError(_0x3c9d53,_0x328be1){_0x328be1=_0x328be1||0x1f4;return function(_0x575ba7){logger[_0xbdf2('0x24')](_0x575ba7[_0xbdf2('0x34')]);if(_0x575ba7[_0xbdf2('0x35')]){delete _0x575ba7[_0xbdf2('0x35')];}_0x3c9d53[_0xbdf2('0x2a')](_0x328be1)[_0xbdf2('0x36')](_0x575ba7);};}exports['index']=function(_0xde58e5,_0x2a8d70){var _0x4996ee={},_0x22ac41={},_0x54e5cd={'count':0x0,'rows':[]};var _0x30d797=db[_0xbdf2('0x37')][_0xbdf2('0x38')];_0x22ac41['model']=_['keys'](_0x30d797);_0x22ac41[_0xbdf2('0x39')]=_[_0xbdf2('0x3a')](_0xde58e5[_0xbdf2('0x39')]);_0x22ac41[_0xbdf2('0x3b')]=_['intersection'](_0x22ac41['model'],_0x22ac41[_0xbdf2('0x39')]);_0x4996ee[_0xbdf2('0x3c')]=_[_0xbdf2('0x3d')](_0x22ac41['model'],qs['fields'](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x3e')]));_0x4996ee[_0xbdf2('0x3c')]=_0x4996ee[_0xbdf2('0x3c')][_0xbdf2('0x3f')]?_0x4996ee['attributes']:_0x22ac41[_0xbdf2('0x40')];if(!_0xde58e5['query'][_0xbdf2('0x41')](_0xbdf2('0x42'))){_0x4996ee[_0xbdf2('0x2e')]=qs[_0xbdf2('0x2e')](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x2e')]);_0x4996ee[_0xbdf2('0x2d')]=qs[_0xbdf2('0x2d')](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x2d')]);}_0x4996ee[_0xbdf2('0x43')]=qs[_0xbdf2('0x44')](_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x44')]);_0x4996ee[_0xbdf2('0x45')]=qs[_0xbdf2('0x3b')](_['pick'](_0xde58e5['query'],_0x22ac41[_0xbdf2('0x3b')]));if(_0xde58e5['query'][_0xbdf2('0x46')]){_0x4996ee[_0xbdf2('0x45')]=_[_0xbdf2('0x47')](_0x4996ee[_0xbdf2('0x45')],{'$or':_['map'](_0x30d797,function(_0x2c1db4){if(_0x2c1db4[_0xbdf2('0x48')][_0xbdf2('0x49')]!==_0xbdf2('0x4a')){var _0x155aa8={};_0x155aa8[_0x2c1db4['field']]={'$like':'%'+_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x46')]+'%'};return _0x155aa8;}})});}_0x4996ee=_[_0xbdf2('0x47')]({},_0x4996ee,_0xde58e5[_0xbdf2('0x4b')]);var _0x1c9811={'where':_0x4996ee[_0xbdf2('0x45')]};return db[_0xbdf2('0x37')][_0xbdf2('0x2c')](_0x1c9811)[_0xbdf2('0x1e')](function(_0x10542e){_0x54e5cd[_0xbdf2('0x2c')]=_0x10542e;if(_0xde58e5[_0xbdf2('0x39')][_0xbdf2('0x4c')]){_0x4996ee['include']=[{'all':!![]}];}return db[_0xbdf2('0x37')][_0xbdf2('0x4d')](_0x4996ee);})['then'](function(_0x2d811d){_0x54e5cd[_0xbdf2('0x4e')]=_0x2d811d;return _0x54e5cd;})[_0xbdf2('0x1e')](respondWithFilteredResult(_0x2a8d70,_0x4996ee))[_0xbdf2('0x27')](handleError(_0x2a8d70,null));};exports[_0xbdf2('0x4f')]=function(_0x54223c,_0x43364d){var _0x42fb69={'raw':![],'where':{'id':_0x54223c[_0xbdf2('0x50')]['id']}},_0x573bb1={};_0x573bb1[_0xbdf2('0x40')]=_[_0xbdf2('0x3a')](db['ZohoAccount']['rawAttributes']);_0x573bb1[_0xbdf2('0x39')]=_['keys'](_0x54223c[_0xbdf2('0x39')]);_0x573bb1[_0xbdf2('0x3b')]=_[_0xbdf2('0x3d')](_0x573bb1[_0xbdf2('0x40')],_0x573bb1['query']);_0x42fb69[_0xbdf2('0x3c')]=_[_0xbdf2('0x3d')](_0x573bb1[_0xbdf2('0x40')],qs[_0xbdf2('0x3e')](_0x54223c[_0xbdf2('0x39')][_0xbdf2('0x3e')]));_0x42fb69['attributes']=_0x42fb69[_0xbdf2('0x3c')]['length']?_0x42fb69['attributes']:_0x573bb1[_0xbdf2('0x40')];if(_0x54223c[_0xbdf2('0x39')]['includeAll']){_0x42fb69[_0xbdf2('0x51')]=[{'all':!![]}];}_0x42fb69=_[_0xbdf2('0x47')]({},_0x42fb69,_0x54223c['options']);return db[_0xbdf2('0x37')][_0xbdf2('0x52')](_0x42fb69)[_0xbdf2('0x1e')](handleEntityNotFound(_0x43364d,null))[_0xbdf2('0x1e')](respondWithResult(_0x43364d,null))[_0xbdf2('0x27')](handleError(_0x43364d,null));};exports[_0xbdf2('0x53')]=function(_0x5a496e,_0x335dee){return db[_0xbdf2('0x37')][_0xbdf2('0x53')](_0x5a496e[_0xbdf2('0x54')],{})['then'](respondWithResult(_0x335dee,0xc9))[_0xbdf2('0x27')](handleError(_0x335dee,null));};exports['update']=function(_0x28e56b,_0x2cdf5d){if(_0x28e56b[_0xbdf2('0x54')]['id']){delete _0x28e56b['body']['id'];}return db[_0xbdf2('0x37')][_0xbdf2('0x52')]({'where':{'id':_0x28e56b[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x2cdf5d,null))['then'](saveUpdates(_0x28e56b[_0xbdf2('0x54')],null))[_0xbdf2('0x1e')](respondWithResult(_0x2cdf5d,null))[_0xbdf2('0x27')](handleError(_0x2cdf5d,null));};exports['destroy']=function(_0x5e070e,_0x868343){return db['ZohoAccount'][_0xbdf2('0x52')]({'where':{'id':_0x5e070e[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x868343,null))[_0xbdf2('0x1e')](removeEntity(_0x868343,null))[_0xbdf2('0x27')](handleError(_0x868343,null));};exports[_0xbdf2('0x55')]=function(_0x1088e2,_0x4a00bd,_0x5b9f77){var _0x1841b3={};var _0x51d8d={};var _0x5d06a4;var _0x566160;return db[_0xbdf2('0x37')]['findOne']({'where':{'id':_0x1088e2[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x4a00bd,null))[_0xbdf2('0x1e')](function(_0x42f1d5){if(_0x42f1d5){_0x5d06a4=_0x42f1d5;_0x51d8d[_0xbdf2('0x40')]=_[_0xbdf2('0x3a')](db[_0xbdf2('0x56')]['rawAttributes']);_0x51d8d[_0xbdf2('0x39')]=_[_0xbdf2('0x3a')](_0x1088e2['query']);_0x51d8d[_0xbdf2('0x3b')]=_[_0xbdf2('0x3d')](_0x51d8d['model'],_0x51d8d['query']);_0x1841b3['attributes']=_[_0xbdf2('0x3d')](_0x51d8d[_0xbdf2('0x40')],qs[_0xbdf2('0x3e')](_0x1088e2[_0xbdf2('0x39')]['fields']));_0x1841b3[_0xbdf2('0x3c')]=_0x1841b3['attributes']['length']?_0x1841b3[_0xbdf2('0x3c')]:_0x51d8d[_0xbdf2('0x40')];_0x1841b3[_0xbdf2('0x43')]=qs[_0xbdf2('0x44')](_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x44')]);_0x1841b3[_0xbdf2('0x45')]=qs[_0xbdf2('0x3b')](_['pick'](_0x1088e2[_0xbdf2('0x39')],_0x51d8d[_0xbdf2('0x3b')]));if(_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x46')]){_0x1841b3[_0xbdf2('0x45')]=_[_0xbdf2('0x47')](_0x1841b3[_0xbdf2('0x45')],{'$or':_[_0xbdf2('0x57')](_0x1841b3[_0xbdf2('0x3c')],function(_0x278a94){var _0xbe6881={};_0xbe6881[_0x278a94]={'$like':'%'+_0x1088e2[_0xbdf2('0x39')]['filter']+'%'};return _0xbe6881;})});}_0x1841b3=_[_0xbdf2('0x47')]({},_0x1841b3,_0x1088e2[_0xbdf2('0x4b')]);return _0x5d06a4['getConfigurations'](_0x1841b3);}})[_0xbdf2('0x1e')](function(_0x245984){if(_0x245984){_0x566160=_0x245984[_0xbdf2('0x3f')];if(!_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x41')](_0xbdf2('0x42'))){_0x1841b3[_0xbdf2('0x2e')]=qs[_0xbdf2('0x2e')](_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x2e')]);_0x1841b3[_0xbdf2('0x2d')]=qs[_0xbdf2('0x2d')](_0x1088e2[_0xbdf2('0x39')][_0xbdf2('0x2d')]);}return _0x5d06a4[_0xbdf2('0x55')](_0x1841b3);}})[_0xbdf2('0x1e')](function(_0x18140f){if(_0x18140f){return _0x18140f?{'count':_0x566160,'rows':_0x18140f}:null;}})[_0xbdf2('0x1e')](respondWithResult(_0x4a00bd,null))[_0xbdf2('0x27')](handleError(_0x4a00bd,null));};exports[_0xbdf2('0x58')]=function(_0x877088,_0x57b87f,_0x22a673){if(_0x877088[_0xbdf2('0x54')]['id']){delete _0x877088[_0xbdf2('0x54')]['id'];}return db[_0xbdf2('0x37')]['findOne']({'where':{'id':_0x877088[_0xbdf2('0x50')]['id']}})[_0xbdf2('0x1e')](handleEntityNotFound(_0x57b87f,null))[_0xbdf2('0x1e')](function(_0x1e8cb2){if(_0x1e8cb2){_0x877088[_0xbdf2('0x54')][_0xbdf2('0x59')]=_0x1e8cb2['id'];_0x877088[_0xbdf2('0x54')]['Subjects']=integrations['getSubjects'](_0x877088[_0xbdf2('0x54')][_0xbdf2('0x5a')],_0x877088[_0xbdf2('0x54')][_0xbdf2('0x48')]);_0x877088[_0xbdf2('0x54')][_0xbdf2('0x5b')]=integrations[_0xbdf2('0x5c')](_0x877088[_0xbdf2('0x54')]['channel'],_0x877088[_0xbdf2('0x54')][_0xbdf2('0x48')]);return db[_0xbdf2('0x56')][_0xbdf2('0x53')](_0x877088[_0xbdf2('0x54')],{'include':[{'model':db[_0xbdf2('0x5d')],'as':_0xbdf2('0x5e')},{'model':db['ZohoField'],'as':_0xbdf2('0x5b')}]});}return null;})[_0xbdf2('0x1e')](respondWithResult(_0x57b87f,null))[_0xbdf2('0x27')](handleError(_0x57b87f,null));};exports['getFields']=function(_0x2888d5,_0x23ff66,_0x510e9e){var _0x3c318b='';return db[_0xbdf2('0x37')]['findOne']({'where':{'id':_0x2888d5[_0xbdf2('0x50')]['id']},'attributes':['id',_0xbdf2('0x5f'),_0xbdf2('0x60')]})[_0xbdf2('0x1e')](handleEntityNotFound(_0x23ff66,null))[_0xbdf2('0x1e')](function(_0x2a9199){if(_0x2a9199){_0x3c318b=_0x2a9199[_0xbdf2('0x5f')];var _0x50f6a6=_0x3c318b[_0xbdf2('0x61')](-0x1);if(_0x50f6a6==='/'){_0x3c318b=_0x3c318b[_0xbdf2('0x62')](0x0,_0x3c318b[_0xbdf2('0x63')](_0x50f6a6));}return rp({'method':_0xbdf2('0x64'),'uri':util['format']('https://crm.%s/crm/private/json/Calls/getFields',_0x3c318b),'qs':{'authtoken':_0x2a9199[_0xbdf2('0x60')],'scope':'crmapi'},'json':!![]});}})[_0xbdf2('0x1e')](function(_0x359357){if(_0x359357){if(_0x359357['response']&&_0x359357[_0xbdf2('0x65')][_0xbdf2('0x24')]){throw new Error(_0x359357[_0xbdf2('0x65')][_0xbdf2('0x24')][_0xbdf2('0x25')]);}var _0x2bd5b4=[];if(_0x359357[_0xbdf2('0x66')]&&_0x359357[_0xbdf2('0x66')]['section']){if(_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL']){var _0xfdbca8=['Call\x20Purpose'];for(var _0x17c8e1=0x0,_0x432858=_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0xbdf2('0x3f')];_0x17c8e1<_0x432858;_0x17c8e1++){if(_[_0xbdf2('0x68')](_0xfdbca8,_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['dv'])){_0x2bd5b4[_0xbdf2('0x69')]({'id':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['dv'],'name':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['label'],'custom':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1][_0xbdf2('0x6a')]===_0xbdf2('0x6b')?!![]:![],'options':_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1][_0xbdf2('0x48')]===_0xbdf2('0x6c')&&_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1][_0xbdf2('0x6d')]?_['map'](_0x359357[_0xbdf2('0x66')][_0xbdf2('0x67')]['FL'][_0x17c8e1]['val'],function(_0x2aef53){return{'name':_0x2aef53,'value':_0x2aef53};}):[]});}}}}return{'count':_0x2bd5b4['length'],'rows':_0x2bd5b4};}})[_0xbdf2('0x1e')](respondWithResult(_0x23ff66,null))['catch'](function(_0x37e784){var _0x690576=_0x2888d5[_0xbdf2('0x39')][_0xbdf2('0x1b')]?0x1f4:_0x37e784[_0xbdf2('0x6e')]||0x1f4;logger[_0xbdf2('0x24')](_0xbdf2('0x6f'),_0xbdf2('0x70'),_0x690576,JSON[_0xbdf2('0x23')](_0x37e784));delete _0x37e784[_0xbdf2('0x35')];if(_0x690576===0x191){_0x690576=0x190;}_0x23ff66['status'](_0x690576)['send'](_0x2888d5[_0xbdf2('0x39')][_0xbdf2('0x1b')]?{'message':_0xbdf2('0x71'),'statusCode':_0x37e784['statusCode']}:_0x37e784);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 57b03b1..a44ca1f 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 _0x094d=['path','rimraf','../../components/integrations/configuration','exports','define','int_zoho_accounts','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x4f374e,_0x38eccb){var _0x8f4cb=function(_0xeb7f4d){while(--_0xeb7f4d){_0x4f374e['push'](_0x4f374e['shift']());}};_0x8f4cb(++_0x38eccb);}(_0x094d,0x102));var _0xd094=function(_0x5eafc8,_0x2d95ba){_0x5eafc8=_0x5eafc8-0x0;var _0x507208=_0x094d[_0x5eafc8];return _0x507208;};'use strict';var _=require(_0xd094('0x0'));var util=require(_0xd094('0x1'));var logger=require(_0xd094('0x2'))(_0xd094('0x3'));var moment=require(_0xd094('0x4'));var BPromise=require('bluebird');var rp=require(_0xd094('0x5'));var fs=require('fs');var path=require(_0xd094('0x6'));var rimraf=require(_0xd094('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xd094('0x8'));module[_0xd094('0x9')]=function(_0x1e8b7c,_0x1393b0){return _0x1e8b7c[_0xd094('0xa')]('ZohoAccount',attributes,{'tableName':_0xd094('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb338=['moment','bluebird','../../config/environment','./intZohoAccount.attributes','exports','define','lodash','api'];(function(_0x2a4226,_0x202691){var _0x483c78=function(_0x546536){while(--_0x546536){_0x2a4226['push'](_0x2a4226['shift']());}};_0x483c78(++_0x202691);}(_0xb338,0x16e));var _0x8b33=function(_0x530ec8,_0x3b402d){_0x530ec8=_0x530ec8-0x0;var _0xdd83a5=_0xb338[_0x530ec8];return _0xdd83a5;};'use strict';var _=require(_0x8b33('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8b33('0x1'));var moment=require(_0x8b33('0x2'));var BPromise=require(_0x8b33('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8b33('0x4'));var attributes=require(_0x8b33('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x8b33('0x6')]=function(_0x49545d,_0x2eb2d8){return _0x49545d[_0x8b33('0x7')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index b8b1cc1..908897c 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 _0xfe36=['include','map','model','ShowZohoAccount','ZohoAccount','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZohoAccount','options','raw','where','attributes','limit'];(function(_0x59a0e4,_0x492f2c){var _0x64e2f9=function(_0x42df1e){while(--_0x42df1e){_0x59a0e4['push'](_0x59a0e4['shift']());}};_0x64e2f9(++_0x492f2c);}(_0xfe36,0x1b6));var _0x6fe3=function(_0x66d7a8,_0x29bb93){_0x66d7a8=_0x66d7a8-0x0;var _0x2815f1=_0xfe36[_0x66d7a8];return _0x2815f1;};'use strict';var _=require(_0x6fe3('0x0'));var util=require(_0x6fe3('0x1'));var moment=require('moment');var BPromise=require(_0x6fe3('0x2'));var rs=require(_0x6fe3('0x3'));var fs=require('fs');var Redis=require(_0x6fe3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6fe3('0x5'));var logger=require(_0x6fe3('0x6'))(_0x6fe3('0x7'));var config=require(_0x6fe3('0x8'));var jayson=require(_0x6fe3('0x9'));var client=jayson[_0x6fe3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ef797,_0x36998c,_0x373ed8){return new BPromise(function(_0x3b725c,_0x55e152){return client[_0x6fe3('0xb')](_0x5ef797,_0x373ed8)[_0x6fe3('0xc')](function(_0x5242de){logger[_0x6fe3('0xd')](_0x6fe3('0xe'),_0x36998c,_0x6fe3('0xf'));logger[_0x6fe3('0x10')](_0x6fe3('0x11'),_0x36998c,_0x6fe3('0xf'),JSON[_0x6fe3('0x12')](_0x5242de));if(_0x5242de['error']){if(_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x14')]===0x1f4){logger[_0x6fe3('0x13')](_0x6fe3('0xe'),_0x36998c,_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x15')]);return _0x55e152(_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x15')]);}logger[_0x6fe3('0x13')](_0x6fe3('0xe'),_0x36998c,_0x5242de[_0x6fe3('0x13')][_0x6fe3('0x15')]);return _0x3b725c(_0x5242de['error']['message']);}else{logger[_0x6fe3('0xd')]('ZohoAccount,\x20%s,\x20%s',_0x36998c,_0x6fe3('0xf'));_0x3b725c(_0x5242de[_0x6fe3('0x16')][_0x6fe3('0x15')]);}})[_0x6fe3('0x17')](function(_0x5dea64){logger[_0x6fe3('0x13')](_0x6fe3('0xe'),_0x36998c,_0x5dea64);_0x55e152(_0x5dea64);});});}exports[_0x6fe3('0x18')]=function(_0x3c56a3){var _0x42f0a9=this;return new Promise(function(_0x5ea196,_0x55ae0e){return db['ZohoAccount']['findAll']({'raw':_0x3c56a3['options']?_0x3c56a3[_0x6fe3('0x19')][_0x6fe3('0x1a')]===undefined?!![]:![]:!![],'where':_0x3c56a3[_0x6fe3('0x19')]?_0x3c56a3['options'][_0x6fe3('0x1b')]||null:null,'attributes':_0x3c56a3[_0x6fe3('0x19')]?_0x3c56a3[_0x6fe3('0x19')][_0x6fe3('0x1c')]||null:null,'limit':_0x3c56a3['options']?_0x3c56a3[_0x6fe3('0x19')][_0x6fe3('0x1d')]||null:null,'include':_0x3c56a3['options']?_0x3c56a3[_0x6fe3('0x19')][_0x6fe3('0x1e')]?_[_0x6fe3('0x1f')](_0x3c56a3[_0x6fe3('0x19')]['include'],function(_0x56588e){return{'model':db[_0x56588e[_0x6fe3('0x20')]],'as':_0x56588e['as'],'attributes':_0x56588e[_0x6fe3('0x1c')],'include':_0x56588e['include']?_['map'](_0x56588e[_0x6fe3('0x1e')],function(_0x1295ab){return{'model':db[_0x1295ab[_0x6fe3('0x20')]],'as':_0x1295ab['as'],'attributes':_0x1295ab[_0x6fe3('0x1c')],'include':_0x1295ab[_0x6fe3('0x1e')]?_[_0x6fe3('0x1f')](_0x1295ab['include'],function(_0x4952e5){return{'model':db[_0x4952e5[_0x6fe3('0x20')]],'as':_0x4952e5['as'],'attributes':_0x4952e5[_0x6fe3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6fe3('0xc')](function(_0x483e79){logger[_0x6fe3('0xd')](_0x6fe3('0x18'),_0x3c56a3);logger[_0x6fe3('0x10')](_0x6fe3('0x18'),_0x3c56a3,JSON['stringify'](_0x483e79));_0x5ea196(_0x483e79);})[_0x6fe3('0x17')](function(_0x1325ca){logger[_0x6fe3('0x13')](_0x6fe3('0x18'),_0x1325ca[_0x6fe3('0x15')],_0x3c56a3);_0x55ae0e(_0x42f0a9[_0x6fe3('0x13')](0x1f4,_0x1325ca[_0x6fe3('0x15')]));});});};exports[_0x6fe3('0x21')]=function(_0x32c2aa){var _0x522783=this;return new Promise(function(_0x399267,_0x1154e2){return db[_0x6fe3('0x22')][_0x6fe3('0x23')]({'raw':_0x32c2aa[_0x6fe3('0x19')]?_0x32c2aa[_0x6fe3('0x19')][_0x6fe3('0x1a')]===undefined?!![]:![]:!![],'where':_0x32c2aa['options']?_0x32c2aa[_0x6fe3('0x19')][_0x6fe3('0x1b')]||null:null,'attributes':_0x32c2aa['options']?_0x32c2aa[_0x6fe3('0x19')][_0x6fe3('0x1c')]||null:null,'include':_0x32c2aa[_0x6fe3('0x19')]?_0x32c2aa[_0x6fe3('0x19')]['include']?_[_0x6fe3('0x1f')](_0x32c2aa[_0x6fe3('0x19')][_0x6fe3('0x1e')],function(_0x5e0377){return{'model':db[_0x5e0377[_0x6fe3('0x20')]],'as':_0x5e0377['as'],'attributes':_0x5e0377[_0x6fe3('0x1c')],'include':_0x5e0377[_0x6fe3('0x1e')]?_[_0x6fe3('0x1f')](_0x5e0377[_0x6fe3('0x1e')],function(_0x623558){return{'model':db[_0x623558['model']],'as':_0x623558['as'],'attributes':_0x623558['attributes'],'include':_0x623558[_0x6fe3('0x1e')]?_[_0x6fe3('0x1f')](_0x623558['include'],function(_0x394e81){return{'model':db[_0x394e81[_0x6fe3('0x20')]],'as':_0x394e81['as'],'attributes':_0x394e81[_0x6fe3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6fe3('0xc')](function(_0x59706d){logger[_0x6fe3('0xd')]('ShowZohoAccount',_0x32c2aa);logger[_0x6fe3('0x10')]('ShowZohoAccount',_0x32c2aa,JSON[_0x6fe3('0x12')](_0x59706d));_0x399267(_0x59706d);})[_0x6fe3('0x17')](function(_0x434964){logger['error']('ShowZohoAccount',_0x434964[_0x6fe3('0x15')],_0x32c2aa);_0x1154e2(_0x522783[_0x6fe3('0x13')](0x1f4,_0x434964[_0x6fe3('0x15')]));});});}; \ No newline at end of file +var _0xc6e8=['rpc','../../config/environment','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ZohoAccount','findAll','options','raw','attributes','limit','include','model','map','GetZohoAccount','find','where','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x46531f,_0x4f56da){var _0x31b3e0=function(_0x5af008){while(--_0x5af008){_0x46531f['push'](_0x46531f['shift']());}};_0x31b3e0(++_0x4f56da);}(_0xc6e8,0x9e));var _0x8c6e=function(_0xe656e5,_0x31c52c){_0xe656e5=_0xe656e5-0x0;var _0x2d48b6=_0xc6e8[_0xe656e5];return _0x2d48b6;};'use strict';var _=require(_0x8c6e('0x0'));var util=require(_0x8c6e('0x1'));var moment=require(_0x8c6e('0x2'));var BPromise=require(_0x8c6e('0x3'));var rs=require(_0x8c6e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8c6e('0x6'))(_0x8c6e('0x7'));var config=require(_0x8c6e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8c6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4624a5,_0x5b0cbc,_0x14c178){return new BPromise(function(_0x2b1156,_0x22ec9d){return client['request'](_0x4624a5,_0x14c178)[_0x8c6e('0xa')](function(_0x1f0352){logger[_0x8c6e('0xb')](_0x8c6e('0xc'),_0x5b0cbc,_0x8c6e('0xd'));logger[_0x8c6e('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5b0cbc,_0x8c6e('0xd'),JSON['stringify'](_0x1f0352));if(_0x1f0352[_0x8c6e('0xf')]){if(_0x1f0352[_0x8c6e('0xf')][_0x8c6e('0x10')]===0x1f4){logger[_0x8c6e('0xf')](_0x8c6e('0xc'),_0x5b0cbc,_0x1f0352[_0x8c6e('0xf')][_0x8c6e('0x11')]);return _0x22ec9d(_0x1f0352['error'][_0x8c6e('0x11')]);}logger[_0x8c6e('0xf')](_0x8c6e('0xc'),_0x5b0cbc,_0x1f0352['error'][_0x8c6e('0x11')]);return _0x2b1156(_0x1f0352[_0x8c6e('0xf')][_0x8c6e('0x11')]);}else{logger[_0x8c6e('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x5b0cbc,'request\x20sent');_0x2b1156(_0x1f0352[_0x8c6e('0x12')][_0x8c6e('0x11')]);}})[_0x8c6e('0x13')](function(_0x15e63d){logger['error'](_0x8c6e('0xc'),_0x5b0cbc,_0x15e63d);_0x22ec9d(_0x15e63d);});});}exports['GetZohoAccount']=function(_0x7e5a7){var _0x4be8d9=this;return new Promise(function(_0x436279,_0x58197d){return db[_0x8c6e('0x14')][_0x8c6e('0x15')]({'raw':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7[_0x8c6e('0x16')][_0x8c6e('0x17')]===undefined?!![]:![]:!![],'where':_0x7e5a7['options']?_0x7e5a7[_0x8c6e('0x16')]['where']||null:null,'attributes':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7[_0x8c6e('0x16')][_0x8c6e('0x18')]||null:null,'limit':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7['options'][_0x8c6e('0x19')]||null:null,'include':_0x7e5a7[_0x8c6e('0x16')]?_0x7e5a7[_0x8c6e('0x16')][_0x8c6e('0x1a')]?_['map'](_0x7e5a7['options']['include'],function(_0x497795){return{'model':db[_0x497795[_0x8c6e('0x1b')]],'as':_0x497795['as'],'attributes':_0x497795[_0x8c6e('0x18')],'include':_0x497795['include']?_['map'](_0x497795[_0x8c6e('0x1a')],function(_0x33a0a3){return{'model':db[_0x33a0a3[_0x8c6e('0x1b')]],'as':_0x33a0a3['as'],'attributes':_0x33a0a3[_0x8c6e('0x18')],'include':_0x33a0a3[_0x8c6e('0x1a')]?_[_0x8c6e('0x1c')](_0x33a0a3[_0x8c6e('0x1a')],function(_0x3429d1){return{'model':db[_0x3429d1[_0x8c6e('0x1b')]],'as':_0x3429d1['as'],'attributes':_0x3429d1[_0x8c6e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x177654){logger[_0x8c6e('0xb')](_0x8c6e('0x1d'),_0x7e5a7);logger[_0x8c6e('0xe')]('GetZohoAccount',_0x7e5a7,JSON['stringify'](_0x177654));_0x436279(_0x177654);})[_0x8c6e('0x13')](function(_0x30391b){logger[_0x8c6e('0xf')]('GetZohoAccount',_0x30391b[_0x8c6e('0x11')],_0x7e5a7);_0x58197d(_0x4be8d9[_0x8c6e('0xf')](0x1f4,_0x30391b[_0x8c6e('0x11')]));});});};exports['ShowZohoAccount']=function(_0x221027){var _0x5f16ed=this;return new Promise(function(_0x37e62a,_0xd568bc){return db[_0x8c6e('0x14')][_0x8c6e('0x1e')]({'raw':_0x221027['options']?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x17')]===undefined?!![]:![]:!![],'where':_0x221027[_0x8c6e('0x16')]?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x1f')]||null:null,'attributes':_0x221027['options']?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x18')]||null:null,'include':_0x221027[_0x8c6e('0x16')]?_0x221027[_0x8c6e('0x16')][_0x8c6e('0x1a')]?_[_0x8c6e('0x1c')](_0x221027[_0x8c6e('0x16')]['include'],function(_0x50ea97){return{'model':db[_0x50ea97[_0x8c6e('0x1b')]],'as':_0x50ea97['as'],'attributes':_0x50ea97['attributes'],'include':_0x50ea97[_0x8c6e('0x1a')]?_[_0x8c6e('0x1c')](_0x50ea97[_0x8c6e('0x1a')],function(_0x1501ef){return{'model':db[_0x1501ef['model']],'as':_0x1501ef['as'],'attributes':_0x1501ef[_0x8c6e('0x18')],'include':_0x1501ef[_0x8c6e('0x1a')]?_['map'](_0x1501ef['include'],function(_0x12f155){return{'model':db[_0x12f155['model']],'as':_0x12f155['as'],'attributes':_0x12f155[_0x8c6e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6d60f){logger[_0x8c6e('0xb')]('ShowZohoAccount',_0x221027);logger[_0x8c6e('0xe')]('ShowZohoAccount',_0x221027,JSON[_0x8c6e('0x20')](_0xd6d60f));_0x37e62a(_0xd6d60f);})[_0x8c6e('0x13')](function(_0x4064bc){logger[_0x8c6e('0xf')]('ShowZohoAccount',_0x4064bc['message'],_0x221027);_0xd568bc(_0x5f16ed[_0x8c6e('0xf')](0x1f4,_0x4064bc[_0x8c6e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index f0660e7..ca2850f 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 _0x7bbd=['../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getSubjects','put','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x26234b,_0x7b6c70){var _0x45a056=function(_0x1a5161){while(--_0x1a5161){_0x26234b['push'](_0x26234b['shift']());}};_0x45a056(++_0x7b6c70);}(_0x7bbd,0x12c));var _0xd7bb=function(_0x2b8ff8,_0x278755){_0x2b8ff8=_0x2b8ff8-0x0;var _0x1e0f36=_0x7bbd[_0x2b8ff8];return _0x1e0f36;};'use strict';var multer=require(_0xd7bb('0x0'));var util=require('util');var path=require(_0xd7bb('0x1'));var timeout=require(_0xd7bb('0x2'));var express=require(_0xd7bb('0x3'));var router=express['Router']();var auth=require(_0xd7bb('0x4'));var interaction=require(_0xd7bb('0x5'));var config=require(_0xd7bb('0x6'));var controller=require(_0xd7bb('0x7'));router[_0xd7bb('0x8')]('/',auth[_0xd7bb('0x9')](),controller['index']);router['get'](_0xd7bb('0xa'),auth[_0xd7bb('0x9')](),controller[_0xd7bb('0xb')]);router[_0xd7bb('0x8')](_0xd7bb('0xc'),auth[_0xd7bb('0x9')](),controller['getFields']);router[_0xd7bb('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xd7bb('0xd')]);router[_0xd7bb('0x8')]('/:id/descriptions',auth[_0xd7bb('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd7bb('0xe')](_0xd7bb('0xa'),auth[_0xd7bb('0x9')](),controller[_0xd7bb('0xf')]);router[_0xd7bb('0x10')](_0xd7bb('0xa'),auth['isAuthenticated'](),controller[_0xd7bb('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8ce1=['/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x528622,_0xcb18f0){var _0x1b12a0=function(_0x4d4065){while(--_0x4d4065){_0x528622['push'](_0x528622['shift']());}};_0x1b12a0(++_0xcb18f0);}(_0x8ce1,0x183));var _0x18ce=function(_0x1d7413,_0x39bed1){_0x1d7413=_0x1d7413-0x0;var _0x515d6c=_0x8ce1[_0x1d7413];return _0x515d6c;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var auth=require(_0x18ce('0x6'));var interaction=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var controller=require(_0x18ce('0x9'));router[_0x18ce('0xa')]('/',auth[_0x18ce('0xb')](),controller[_0x18ce('0xc')]);router[_0x18ce('0xa')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['show']);router[_0x18ce('0xa')](_0x18ce('0xe'),auth[_0x18ce('0xb')](),controller[_0x18ce('0xf')]);router['get'](_0x18ce('0x10'),auth[_0x18ce('0xb')](),controller[_0x18ce('0x11')]);router[_0x18ce('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/',auth[_0x18ce('0xb')](),controller[_0x18ce('0x14')]);router[_0x18ce('0x15')]('/:id',auth[_0x18ce('0xb')](),controller[_0x18ce('0x16')]);router[_0x18ce('0x17')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['destroy']);module[_0x18ce('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index e0e38bc..6c6555a 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 _0x5029=['sequelize','exports','STRING'];(function(_0x20b06a,_0x519b94){var _0xc17cb4=function(_0x4c0fc1){while(--_0x4c0fc1){_0x20b06a['push'](_0x20b06a['shift']());}};_0xc17cb4(++_0x519b94);}(_0x5029,0x1b9));var _0x9502=function(_0x583bf8,_0x1e81fd){_0x583bf8=_0x583bf8-0x0;var _0x588bb6=_0x5029[_0x583bf8];return _0x588bb6;};'use strict';var Sequelize=require(_0x9502('0x0'));module[_0x9502('0x1')]={'name':{'type':Sequelize[_0x9502('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6038=['STRING','sequelize','exports'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x6038,0x115));var _0x8603=function(_0x233c8d,_0x173255){_0x233c8d=_0x233c8d-0x0;var _0x3dbcd7=_0x6038[_0x233c8d];return _0x3dbcd7;};'use strict';var Sequelize=require(_0x8603('0x0'));module[_0x8603('0x1')]={'name':{'type':Sequelize[_0x8603('0x2')]},'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 40171f7..5c7c043 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 _0x12f1=['body','update','getFields','findOne','sort','pick','getSubjects','ZohoField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','destroy','stack','send','index','ZohoConfiguration','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filter','map','type','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','create'];(function(_0xc57e60,_0xe3399c){var _0x5222b3=function(_0x2d9c56){while(--_0x2d9c56){_0xc57e60['push'](_0xc57e60['shift']());}};_0x5222b3(++_0xe3399c);}(_0x12f1,0x11d));var _0x112f=function(_0x501697,_0x1da1e4){_0x501697=_0x501697-0x0;var _0x272971=_0x12f1[_0x501697];return _0x272971;};'use strict';var pdf=require(_0x112f('0x0'));var emlformat=require(_0x112f('0x1'));var rimraf=require(_0x112f('0x2'));var zipdir=require(_0x112f('0x3'));var jsonpatch=require(_0x112f('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x112f('0x5'));var util=require('util');var path=require(_0x112f('0x6'));var sox=require(_0x112f('0x7'));var csv=require(_0x112f('0x8'));var ejs=require(_0x112f('0x9'));var fs=require('fs');var _=require(_0x112f('0xa'));var squel=require(_0x112f('0xb'));var crypto=require(_0x112f('0xc'));var jsforce=require(_0x112f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x112f('0x8'));var querystring=require(_0x112f('0xe'));var Papa=require('papaparse');var Redis=require(_0x112f('0xf'));var authService=require(_0x112f('0x10'));var qs=require(_0x112f('0x11'));var hardwareService=require(_0x112f('0x12'));var logger=require(_0x112f('0x13'))(_0x112f('0x14'));var utils=require(_0x112f('0x15'));var config=require(_0x112f('0x16'));var db=require(_0x112f('0x17'))['db'];var jayson=require(_0x112f('0x18'));var client=jayson[_0x112f('0x19')][_0x112f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x494036,_0x13467c,_0x5e1f20){if(_0x5e1f20){var _0xa0db03=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa0db03[_0x112f('0x1b')](_0x13467c)){return _0x494036;}else{throw new Error(_0x112f('0x1c'));}}else{return _0x494036;}}function respondWithRpcPromise(_0x5de31b,_0x36a3de,_0x576ea2,_0x3d776a){return new BPromise(function(_0x379d5c,_0x180fb7){var _0x33b9bb=_0x3d776a||client;return _0x33b9bb['request'](_0x5de31b,_0x576ea2)[_0x112f('0x1d')](function(_0x3e85a0){logger[_0x112f('0x1e')](_0x112f('0x1f'),_0x36a3de,_0x112f('0x20'));logger[_0x112f('0x21')](_0x112f('0x22'),_0x36a3de,_0x112f('0x20'),JSON[_0x112f('0x23')](_0x3e85a0));if(_0x3e85a0[_0x112f('0x24')]){if(_0x3e85a0[_0x112f('0x24')][_0x112f('0x25')]===0x1f4){logger[_0x112f('0x24')](_0x112f('0x1f'),_0x36a3de,_0x3e85a0['error'][_0x112f('0x26')]);return _0x180fb7(_0x3e85a0[_0x112f('0x24')]['message']);}logger['error'](_0x112f('0x1f'),_0x36a3de,_0x3e85a0[_0x112f('0x24')][_0x112f('0x26')]);return _0x379d5c(_0x3e85a0[_0x112f('0x24')][_0x112f('0x26')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x36a3de,_0x112f('0x20'));_0x379d5c(_0x3e85a0[_0x112f('0x27')][_0x112f('0x26')]);}})[_0x112f('0x28')](function(_0x4f8dc9){logger[_0x112f('0x24')](_0x112f('0x1f'),_0x36a3de,_0x4f8dc9);_0x180fb7(_0x4f8dc9);});});}function respondWithStatusCode(_0x15c285,_0x3cc36f){_0x3cc36f=_0x3cc36f||0xcc;return function(_0xca9021){if(_0xca9021){return _0x15c285[_0x112f('0x29')](_0x3cc36f);}return _0x15c285[_0x112f('0x2a')](_0x3cc36f)[_0x112f('0x2b')]();};}function respondWithResult(_0x40237e,_0x4aa9d5){_0x4aa9d5=_0x4aa9d5||0xc8;return function(_0x8bb9c7){if(_0x8bb9c7){return _0x40237e[_0x112f('0x2a')](_0x4aa9d5)['json'](_0x8bb9c7);}};}function respondWithFilteredResult(_0xdffa43,_0x251eeb){return function(_0x4ca08b){if(_0x4ca08b){var _0x16ee99=_0x4ca08b['count'],_0x2d2027=_0x251eeb['offset'],_0x47f535=_0x251eeb[_0x112f('0x2c')]+_0x251eeb[_0x112f('0x2d')],_0x17d1b3;if(_0x47f535>=_0x16ee99){_0x47f535=_0x16ee99;_0x17d1b3=0xc8;}else{_0x17d1b3=0xce;}_0xdffa43[_0x112f('0x2a')](_0x17d1b3);return _0xdffa43['set'](_0x112f('0x2e'),_0x2d2027+'-'+_0x47f535+'/'+_0x16ee99)[_0x112f('0x2f')](_0x4ca08b);}return null;};}function patchUpdates(_0x3eeca4){return function(_0x489a32){try{jsonpatch[_0x112f('0x30')](_0x489a32,_0x3eeca4,!![]);}catch(_0x4c525f){return BPromise[_0x112f('0x31')](_0x4c525f);}return _0x489a32['save']();};}function saveUpdates(_0x2d5e84,_0xe4fcd1){return function(_0x2e229a){if(_0x2e229a){return _0x2e229a['update'](_0x2d5e84)[_0x112f('0x1d')](function(_0x458997){return _0x458997;});}return null;};}function removeEntity(_0xfb51d,_0x379b7b){return function(_0x1c3c13){if(_0x1c3c13){return _0x1c3c13[_0x112f('0x32')]()[_0x112f('0x1d')](function(){_0xfb51d[_0x112f('0x2a')](0xcc)[_0x112f('0x2b')]();});}};}function handleEntityNotFound(_0x57a6e8,_0x3e5ed6){return function(_0x450074){if(!_0x450074){_0x57a6e8[_0x112f('0x29')](0x194);}return _0x450074;};}function handleError(_0x5e04ac,_0x3c1eef){_0x3c1eef=_0x3c1eef||0x1f4;return function(_0x5c1503){logger[_0x112f('0x24')](_0x5c1503[_0x112f('0x33')]);if(_0x5c1503['name']){delete _0x5c1503['name'];}_0x5e04ac[_0x112f('0x2a')](_0x3c1eef)[_0x112f('0x34')](_0x5c1503);};}exports[_0x112f('0x35')]=function(_0x3f48bc,_0x16f9e){var _0x477073={},_0x5b4cfd={},_0x25e517={'count':0x0,'rows':[]};var _0x479e04=db[_0x112f('0x36')]['rawAttributes'];_0x5b4cfd[_0x112f('0x37')]=_[_0x112f('0x38')](_0x479e04);_0x5b4cfd[_0x112f('0x39')]=_[_0x112f('0x38')](_0x3f48bc[_0x112f('0x39')]);_0x5b4cfd[_0x112f('0x3a')]=_[_0x112f('0x3b')](_0x5b4cfd['model'],_0x5b4cfd[_0x112f('0x39')]);_0x477073['attributes']=_[_0x112f('0x3b')](_0x5b4cfd[_0x112f('0x37')],qs[_0x112f('0x3c')](_0x3f48bc[_0x112f('0x39')]['fields']));_0x477073[_0x112f('0x3d')]=_0x477073[_0x112f('0x3d')]['length']?_0x477073[_0x112f('0x3d')]:_0x5b4cfd[_0x112f('0x37')];if(!_0x3f48bc[_0x112f('0x39')][_0x112f('0x3e')](_0x112f('0x3f'))){_0x477073[_0x112f('0x2d')]=qs[_0x112f('0x2d')](_0x3f48bc[_0x112f('0x39')]['limit']);_0x477073[_0x112f('0x2c')]=qs[_0x112f('0x2c')](_0x3f48bc[_0x112f('0x39')][_0x112f('0x2c')]);}_0x477073[_0x112f('0x40')]=qs['sort'](_0x3f48bc[_0x112f('0x39')]['sort']);_0x477073[_0x112f('0x41')]=qs['filters'](_['pick'](_0x3f48bc[_0x112f('0x39')],_0x5b4cfd[_0x112f('0x3a')]));if(_0x3f48bc[_0x112f('0x39')][_0x112f('0x42')]){_0x477073['where']=_['merge'](_0x477073[_0x112f('0x41')],{'$or':_[_0x112f('0x43')](_0x479e04,function(_0x158599){if(_0x158599[_0x112f('0x44')]['key']!==_0x112f('0x45')){var _0x12e20f={};_0x12e20f[_0x158599['field']]={'$like':'%'+_0x3f48bc[_0x112f('0x39')]['filter']+'%'};return _0x12e20f;}})});}_0x477073=_[_0x112f('0x46')]({},_0x477073,_0x3f48bc[_0x112f('0x47')]);var _0x11ae38={'where':_0x477073[_0x112f('0x41')]};return db[_0x112f('0x36')][_0x112f('0x48')](_0x11ae38)['then'](function(_0x53280f){_0x25e517[_0x112f('0x48')]=_0x53280f;if(_0x3f48bc['query'][_0x112f('0x49')]){_0x477073[_0x112f('0x4a')]=[{'all':!![]}];}return db[_0x112f('0x36')][_0x112f('0x4b')](_0x477073);})[_0x112f('0x1d')](function(_0x5eb295){_0x25e517[_0x112f('0x4c')]=_0x5eb295;return _0x25e517;})[_0x112f('0x1d')](respondWithFilteredResult(_0x16f9e,_0x477073))[_0x112f('0x28')](handleError(_0x16f9e,null));};exports[_0x112f('0x4d')]=function(_0x2288f2,_0x9d5374){var _0x4f2a8a={'raw':![],'where':{'id':_0x2288f2[_0x112f('0x4e')]['id']}},_0x3e4ea1={};_0x3e4ea1[_0x112f('0x37')]=_[_0x112f('0x38')](db[_0x112f('0x36')][_0x112f('0x4f')]);_0x3e4ea1[_0x112f('0x39')]=_[_0x112f('0x38')](_0x2288f2[_0x112f('0x39')]);_0x3e4ea1[_0x112f('0x3a')]=_[_0x112f('0x3b')](_0x3e4ea1[_0x112f('0x37')],_0x3e4ea1[_0x112f('0x39')]);_0x4f2a8a['attributes']=_[_0x112f('0x3b')](_0x3e4ea1[_0x112f('0x37')],qs['fields'](_0x2288f2[_0x112f('0x39')][_0x112f('0x3c')]));_0x4f2a8a['attributes']=_0x4f2a8a['attributes'][_0x112f('0x50')]?_0x4f2a8a[_0x112f('0x3d')]:_0x3e4ea1['model'];if(_0x2288f2['query'][_0x112f('0x49')]){_0x4f2a8a[_0x112f('0x4a')]=[{'all':!![]}];}_0x4f2a8a=_[_0x112f('0x46')]({},_0x4f2a8a,_0x2288f2[_0x112f('0x47')]);return db[_0x112f('0x36')][_0x112f('0x51')](_0x4f2a8a)[_0x112f('0x1d')](handleEntityNotFound(_0x9d5374,null))[_0x112f('0x1d')](respondWithResult(_0x9d5374,null))[_0x112f('0x28')](handleError(_0x9d5374,null));};exports['create']=function(_0x2c8d57,_0x14c378){return db[_0x112f('0x36')][_0x112f('0x52')](_0x2c8d57[_0x112f('0x53')],{})['then'](respondWithResult(_0x14c378,0xc9))['catch'](handleError(_0x14c378,null));};exports[_0x112f('0x54')]=function(_0x15c867,_0x5bc029){if(_0x15c867[_0x112f('0x53')]['id']){delete _0x15c867[_0x112f('0x53')]['id'];}return db[_0x112f('0x36')][_0x112f('0x51')]({'where':{'id':_0x15c867['params']['id']}})['then'](handleEntityNotFound(_0x5bc029,null))[_0x112f('0x1d')](saveUpdates(_0x15c867[_0x112f('0x53')],null))[_0x112f('0x1d')](respondWithResult(_0x5bc029,null))[_0x112f('0x28')](handleError(_0x5bc029,null));};exports[_0x112f('0x32')]=function(_0x129aec,_0x4a77a7){return db[_0x112f('0x36')][_0x112f('0x51')]({'where':{'id':_0x129aec[_0x112f('0x4e')]['id']}})[_0x112f('0x1d')](handleEntityNotFound(_0x4a77a7,null))[_0x112f('0x1d')](removeEntity(_0x4a77a7,null))[_0x112f('0x28')](handleError(_0x4a77a7,null));};exports[_0x112f('0x55')]=function(_0x2d294d,_0x7e99ab,_0x3e3f62){var _0x16b326={};var _0x31e02c={};var _0x2c86d7;var _0x31a78e;return db['ZohoConfiguration'][_0x112f('0x56')]({'where':{'id':_0x2d294d[_0x112f('0x4e')]['id']}})[_0x112f('0x1d')](handleEntityNotFound(_0x7e99ab,null))[_0x112f('0x1d')](function(_0x4a5615){if(_0x4a5615){_0x2c86d7=_0x4a5615;_0x31e02c[_0x112f('0x37')]=_[_0x112f('0x38')](db['ZohoField'][_0x112f('0x4f')]);_0x31e02c['query']=_[_0x112f('0x38')](_0x2d294d['query']);_0x31e02c[_0x112f('0x3a')]=_[_0x112f('0x3b')](_0x31e02c[_0x112f('0x37')],_0x31e02c[_0x112f('0x39')]);_0x16b326[_0x112f('0x3d')]=_[_0x112f('0x3b')](_0x31e02c[_0x112f('0x37')],qs['fields'](_0x2d294d[_0x112f('0x39')][_0x112f('0x3c')]));_0x16b326['attributes']=_0x16b326[_0x112f('0x3d')][_0x112f('0x50')]?_0x16b326[_0x112f('0x3d')]:_0x31e02c['model'];_0x16b326[_0x112f('0x40')]=qs[_0x112f('0x57')](_0x2d294d['query'][_0x112f('0x57')]);_0x16b326[_0x112f('0x41')]=qs[_0x112f('0x3a')](_[_0x112f('0x58')](_0x2d294d[_0x112f('0x39')],_0x31e02c['filters']));if(_0x2d294d[_0x112f('0x39')][_0x112f('0x42')]){_0x16b326[_0x112f('0x41')]=_['merge'](_0x16b326['where'],{'$or':_['map'](_0x16b326['attributes'],function(_0x4e55c1){var _0x5dcf1c={};_0x5dcf1c[_0x4e55c1]={'$like':'%'+_0x2d294d[_0x112f('0x39')][_0x112f('0x42')]+'%'};return _0x5dcf1c;})});}_0x16b326=_[_0x112f('0x46')]({},_0x16b326,_0x2d294d['options']);return _0x2c86d7[_0x112f('0x55')](_0x16b326);}})[_0x112f('0x1d')](function(_0x4302cc){if(_0x4302cc){_0x31a78e=_0x4302cc['length'];if(!_0x2d294d[_0x112f('0x39')][_0x112f('0x3e')](_0x112f('0x3f'))){_0x16b326['limit']=qs[_0x112f('0x2d')](_0x2d294d[_0x112f('0x39')][_0x112f('0x2d')]);_0x16b326[_0x112f('0x2c')]=qs['offset'](_0x2d294d[_0x112f('0x39')][_0x112f('0x2c')]);}return _0x2c86d7[_0x112f('0x55')](_0x16b326);}})['then'](function(_0x1fc103){if(_0x1fc103){return _0x1fc103?{'count':_0x31a78e,'rows':_0x1fc103}:null;}})[_0x112f('0x1d')](respondWithResult(_0x7e99ab,null))[_0x112f('0x28')](handleError(_0x7e99ab,null));};exports[_0x112f('0x59')]=function(_0x2550ba,_0x164a90,_0x1e463d){var _0x931a7d={};var _0x438d66={};var _0x10c999;var _0x3f3bee;return db[_0x112f('0x36')][_0x112f('0x56')]({'where':{'id':_0x2550ba[_0x112f('0x4e')]['id']}})[_0x112f('0x1d')](handleEntityNotFound(_0x164a90,null))[_0x112f('0x1d')](function(_0x1bb174){if(_0x1bb174){_0x10c999=_0x1bb174;_0x438d66['model']=_[_0x112f('0x38')](db[_0x112f('0x5a')][_0x112f('0x4f')]);_0x438d66[_0x112f('0x39')]=_[_0x112f('0x38')](_0x2550ba[_0x112f('0x39')]);_0x438d66[_0x112f('0x3a')]=_[_0x112f('0x3b')](_0x438d66[_0x112f('0x37')],_0x438d66[_0x112f('0x39')]);_0x931a7d['attributes']=_[_0x112f('0x3b')](_0x438d66[_0x112f('0x37')],qs[_0x112f('0x3c')](_0x2550ba[_0x112f('0x39')]['fields']));_0x931a7d['attributes']=_0x931a7d[_0x112f('0x3d')][_0x112f('0x50')]?_0x931a7d[_0x112f('0x3d')]:_0x438d66[_0x112f('0x37')];_0x931a7d[_0x112f('0x40')]=qs[_0x112f('0x57')](_0x2550ba['query'][_0x112f('0x57')]);_0x931a7d[_0x112f('0x41')]=qs['filters'](_[_0x112f('0x58')](_0x2550ba[_0x112f('0x39')],_0x438d66['filters']));if(_0x2550ba[_0x112f('0x39')][_0x112f('0x42')]){_0x931a7d[_0x112f('0x41')]=_['merge'](_0x931a7d[_0x112f('0x41')],{'$or':_[_0x112f('0x43')](_0x931a7d['attributes'],function(_0x995dea){var _0x48586f={};_0x48586f[_0x995dea]={'$like':'%'+_0x2550ba[_0x112f('0x39')]['filter']+'%'};return _0x48586f;})});}_0x931a7d=_[_0x112f('0x46')]({},_0x931a7d,_0x2550ba[_0x112f('0x47')]);return _0x10c999[_0x112f('0x59')](_0x931a7d);}})['then'](function(_0x3b5e2f){if(_0x3b5e2f){_0x3f3bee=_0x3b5e2f[_0x112f('0x50')];if(!_0x2550ba[_0x112f('0x39')][_0x112f('0x3e')](_0x112f('0x3f'))){_0x931a7d[_0x112f('0x2d')]=qs[_0x112f('0x2d')](_0x2550ba[_0x112f('0x39')][_0x112f('0x2d')]);_0x931a7d['offset']=qs[_0x112f('0x2c')](_0x2550ba['query'][_0x112f('0x2c')]);}return _0x10c999[_0x112f('0x59')](_0x931a7d);}})[_0x112f('0x1d')](function(_0x4cbb68){if(_0x4cbb68){return _0x4cbb68?{'count':_0x3f3bee,'rows':_0x4cbb68}:null;}})[_0x112f('0x1d')](respondWithResult(_0x164a90,null))[_0x112f('0x28')](handleError(_0x164a90,null));};exports['getDescriptions']=function(_0xe51b48,_0x451b23,_0x8655ef){var _0x5bb4de={};var _0x33a99f={};var _0x5cf2c1;var _0xe9e0c9;return db[_0x112f('0x36')][_0x112f('0x56')]({'where':{'id':_0xe51b48[_0x112f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x451b23,null))[_0x112f('0x1d')](function(_0x39caef){if(_0x39caef){_0x5cf2c1=_0x39caef;_0x33a99f[_0x112f('0x37')]=_[_0x112f('0x38')](db[_0x112f('0x5a')]['rawAttributes']);_0x33a99f['query']=_[_0x112f('0x38')](_0xe51b48[_0x112f('0x39')]);_0x33a99f['filters']=_['intersection'](_0x33a99f['model'],_0x33a99f[_0x112f('0x39')]);_0x5bb4de['attributes']=_[_0x112f('0x3b')](_0x33a99f['model'],qs['fields'](_0xe51b48[_0x112f('0x39')][_0x112f('0x3c')]));_0x5bb4de[_0x112f('0x3d')]=_0x5bb4de['attributes'][_0x112f('0x50')]?_0x5bb4de['attributes']:_0x33a99f[_0x112f('0x37')];_0x5bb4de[_0x112f('0x40')]=qs['sort'](_0xe51b48['query'][_0x112f('0x57')]);_0x5bb4de[_0x112f('0x41')]=qs[_0x112f('0x3a')](_[_0x112f('0x58')](_0xe51b48['query'],_0x33a99f['filters']));if(_0xe51b48[_0x112f('0x39')][_0x112f('0x42')]){_0x5bb4de[_0x112f('0x41')]=_[_0x112f('0x46')](_0x5bb4de[_0x112f('0x41')],{'$or':_[_0x112f('0x43')](_0x5bb4de[_0x112f('0x3d')],function(_0x39c78a){var _0x409c4b={};_0x409c4b[_0x39c78a]={'$like':'%'+_0xe51b48['query'][_0x112f('0x42')]+'%'};return _0x409c4b;})});}_0x5bb4de=_['merge']({},_0x5bb4de,_0xe51b48[_0x112f('0x47')]);return _0x5cf2c1[_0x112f('0x5b')](_0x5bb4de);}})[_0x112f('0x1d')](function(_0x3f372f){if(_0x3f372f){_0xe9e0c9=_0x3f372f[_0x112f('0x50')];if(!_0xe51b48[_0x112f('0x39')][_0x112f('0x3e')](_0x112f('0x3f'))){_0x5bb4de['limit']=qs[_0x112f('0x2d')](_0xe51b48[_0x112f('0x39')]['limit']);_0x5bb4de['offset']=qs[_0x112f('0x2c')](_0xe51b48[_0x112f('0x39')]['offset']);}return _0x5cf2c1[_0x112f('0x5b')](_0x5bb4de);}})[_0x112f('0x1d')](function(_0x39ce60){if(_0x39ce60){return _0x39ce60?{'count':_0xe9e0c9,'rows':_0x39ce60}:null;}})[_0x112f('0x1d')](respondWithResult(_0x451b23,null))['catch'](handleError(_0x451b23,null));}; \ No newline at end of file +var _0x456e=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','stack','name','send','rawAttributes','model','keys','query','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','merge','map','type','key','field','filter','includeAll','include','ZohoConfiguration','findAll','params','length','options','create','body','destroy','find','findOne','ZohoField','getFields','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x15a26e,_0x334582){var _0x25bef6=function(_0x2fab4f){while(--_0x2fab4f){_0x15a26e['push'](_0x15a26e['shift']());}};_0x25bef6(++_0x334582);}(_0x456e,0xf6));var _0xe456=function(_0x1b5418,_0xa0747){_0x1b5418=_0x1b5418-0x0;var _0x1c189f=_0x456e[_0x1b5418];return _0x1c189f;};'use strict';var pdf=require(_0xe456('0x0'));var emlformat=require(_0xe456('0x1'));var rimraf=require(_0xe456('0x2'));var zipdir=require(_0xe456('0x3'));var jsonpatch=require(_0xe456('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe456('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe456('0x6'));var sox=require('sox');var csv=require(_0xe456('0x7'));var ejs=require(_0xe456('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe456('0x9'));var crypto=require(_0xe456('0xa'));var jsforce=require(_0xe456('0xb'));var deskjs=require(_0xe456('0xc'));var toCsv=require(_0xe456('0x7'));var querystring=require(_0xe456('0xd'));var Papa=require(_0xe456('0xe'));var Redis=require(_0xe456('0xf'));var authService=require(_0xe456('0x10'));var qs=require(_0xe456('0x11'));var hardwareService=require(_0xe456('0x12'));var logger=require(_0xe456('0x13'))(_0xe456('0x14'));var utils=require(_0xe456('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xe456('0x16')]({'port':0x232a});function checkPasswordPattern(_0x413ef9,_0x2de09c,_0x2c4580){if(_0x2c4580){var _0x399509=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x399509[_0xe456('0x17')](_0x2de09c)){return _0x413ef9;}else{throw new Error(_0xe456('0x18'));}}else{return _0x413ef9;}}function respondWithRpcPromise(_0x1d0f16,_0x5abc12,_0x3d7127,_0x5ec69c){return new BPromise(function(_0x5fafed,_0x5c908f){var _0x5d5b42=_0x5ec69c||client;return _0x5d5b42[_0xe456('0x19')](_0x1d0f16,_0x3d7127)[_0xe456('0x1a')](function(_0x2f327f){logger[_0xe456('0x1b')](_0xe456('0x1c'),_0x5abc12,'request\x20sent');logger[_0xe456('0x1d')](_0xe456('0x1e'),_0x5abc12,_0xe456('0x1f'),JSON[_0xe456('0x20')](_0x2f327f));if(_0x2f327f['error']){if(_0x2f327f[_0xe456('0x21')]['code']===0x1f4){logger['error'](_0xe456('0x1c'),_0x5abc12,_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);return _0x5c908f(_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);}logger['error'](_0xe456('0x1c'),_0x5abc12,_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);return _0x5fafed(_0x2f327f[_0xe456('0x21')][_0xe456('0x22')]);}else{logger[_0xe456('0x1b')](_0xe456('0x1c'),_0x5abc12,_0xe456('0x1f'));_0x5fafed(_0x2f327f[_0xe456('0x23')]['message']);}})[_0xe456('0x24')](function(_0x20247d){logger[_0xe456('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0x5abc12,_0x20247d);_0x5c908f(_0x20247d);});});}function respondWithStatusCode(_0x270816,_0x33d926){_0x33d926=_0x33d926||0xcc;return function(_0xb53b07){if(_0xb53b07){return _0x270816[_0xe456('0x25')](_0x33d926);}return _0x270816[_0xe456('0x26')](_0x33d926)[_0xe456('0x27')]();};}function respondWithResult(_0x12cd5f,_0x19c923){_0x19c923=_0x19c923||0xc8;return function(_0x5657ea){if(_0x5657ea){return _0x12cd5f[_0xe456('0x26')](_0x19c923)[_0xe456('0x28')](_0x5657ea);}};}function respondWithFilteredResult(_0x36a8f0,_0x26bb1a){return function(_0x4277d0){if(_0x4277d0){var _0x55b581=_0x4277d0[_0xe456('0x29')],_0x5912a8=_0x26bb1a[_0xe456('0x2a')],_0x598ca2=_0x26bb1a['offset']+_0x26bb1a['limit'],_0x150a27;if(_0x598ca2>=_0x55b581){_0x598ca2=_0x55b581;_0x150a27=0xc8;}else{_0x150a27=0xce;}_0x36a8f0[_0xe456('0x26')](_0x150a27);return _0x36a8f0[_0xe456('0x2b')](_0xe456('0x2c'),_0x5912a8+'-'+_0x598ca2+'/'+_0x55b581)[_0xe456('0x28')](_0x4277d0);}return null;};}function patchUpdates(_0x563986){return function(_0x228580){try{jsonpatch['apply'](_0x228580,_0x563986,!![]);}catch(_0x409322){return BPromise[_0xe456('0x2d')](_0x409322);}return _0x228580['save']();};}function saveUpdates(_0x1380c6,_0x45c3ef){return function(_0x32d1bd){if(_0x32d1bd){return _0x32d1bd[_0xe456('0x2e')](_0x1380c6)['then'](function(_0x1594fb){return _0x1594fb;});}return null;};}function removeEntity(_0xfd5165,_0x96e03b){return function(_0x11b8dd){if(_0x11b8dd){return _0x11b8dd['destroy']()['then'](function(){_0xfd5165['status'](0xcc)[_0xe456('0x27')]();});}};}function handleEntityNotFound(_0x5f0a0b,_0x9b0c9e){return function(_0x492d55){if(!_0x492d55){_0x5f0a0b['sendStatus'](0x194);}return _0x492d55;};}function handleError(_0x549cc1,_0x18d9e0){_0x18d9e0=_0x18d9e0||0x1f4;return function(_0x2ed7a7){logger['error'](_0x2ed7a7[_0xe456('0x2f')]);if(_0x2ed7a7['name']){delete _0x2ed7a7[_0xe456('0x30')];}_0x549cc1[_0xe456('0x26')](_0x18d9e0)[_0xe456('0x31')](_0x2ed7a7);};}exports['index']=function(_0x54f764,_0xdf906d){var _0x335861={},_0x4d0baf={},_0x308f0d={'count':0x0,'rows':[]};var _0x181d1a=db['ZohoConfiguration'][_0xe456('0x32')];_0x4d0baf[_0xe456('0x33')]=_[_0xe456('0x34')](_0x181d1a);_0x4d0baf[_0xe456('0x35')]=_[_0xe456('0x34')](_0x54f764['query']);_0x4d0baf[_0xe456('0x36')]=_[_0xe456('0x37')](_0x4d0baf[_0xe456('0x33')],_0x4d0baf[_0xe456('0x35')]);_0x335861[_0xe456('0x38')]=_[_0xe456('0x37')](_0x4d0baf[_0xe456('0x33')],qs['fields'](_0x54f764[_0xe456('0x35')][_0xe456('0x39')]));_0x335861[_0xe456('0x38')]=_0x335861[_0xe456('0x38')]['length']?_0x335861[_0xe456('0x38')]:_0x4d0baf['model'];if(!_0x54f764[_0xe456('0x35')]['hasOwnProperty'](_0xe456('0x3a'))){_0x335861['limit']=qs['limit'](_0x54f764['query'][_0xe456('0x3b')]);_0x335861[_0xe456('0x2a')]=qs[_0xe456('0x2a')](_0x54f764['query']['offset']);}_0x335861[_0xe456('0x3c')]=qs['sort'](_0x54f764['query'][_0xe456('0x3d')]);_0x335861[_0xe456('0x3e')]=qs[_0xe456('0x36')](_[_0xe456('0x3f')](_0x54f764[_0xe456('0x35')],_0x4d0baf[_0xe456('0x36')]));if(_0x54f764[_0xe456('0x35')]['filter']){_0x335861[_0xe456('0x3e')]=_[_0xe456('0x40')](_0x335861[_0xe456('0x3e')],{'$or':_[_0xe456('0x41')](_0x181d1a,function(_0x52eef3){if(_0x52eef3[_0xe456('0x42')][_0xe456('0x43')]!=='VIRTUAL'){var _0x104241={};_0x104241[_0x52eef3[_0xe456('0x44')]]={'$like':'%'+_0x54f764[_0xe456('0x35')][_0xe456('0x45')]+'%'};return _0x104241;}})});}_0x335861=_[_0xe456('0x40')]({},_0x335861,_0x54f764['options']);var _0x13f06d={'where':_0x335861['where']};return db['ZohoConfiguration'][_0xe456('0x29')](_0x13f06d)[_0xe456('0x1a')](function(_0x1f28f6){_0x308f0d[_0xe456('0x29')]=_0x1f28f6;if(_0x54f764[_0xe456('0x35')][_0xe456('0x46')]){_0x335861[_0xe456('0x47')]=[{'all':!![]}];}return db[_0xe456('0x48')][_0xe456('0x49')](_0x335861);})[_0xe456('0x1a')](function(_0x59e51c){_0x308f0d['rows']=_0x59e51c;return _0x308f0d;})[_0xe456('0x1a')](respondWithFilteredResult(_0xdf906d,_0x335861))[_0xe456('0x24')](handleError(_0xdf906d,null));};exports['show']=function(_0x2a3000,_0x4db2c6){var _0x3654e5={'raw':![],'where':{'id':_0x2a3000[_0xe456('0x4a')]['id']}},_0xb54e71={};_0xb54e71['model']=_['keys'](db[_0xe456('0x48')][_0xe456('0x32')]);_0xb54e71[_0xe456('0x35')]=_[_0xe456('0x34')](_0x2a3000[_0xe456('0x35')]);_0xb54e71[_0xe456('0x36')]=_[_0xe456('0x37')](_0xb54e71['model'],_0xb54e71[_0xe456('0x35')]);_0x3654e5[_0xe456('0x38')]=_[_0xe456('0x37')](_0xb54e71[_0xe456('0x33')],qs[_0xe456('0x39')](_0x2a3000[_0xe456('0x35')][_0xe456('0x39')]));_0x3654e5[_0xe456('0x38')]=_0x3654e5[_0xe456('0x38')][_0xe456('0x4b')]?_0x3654e5['attributes']:_0xb54e71[_0xe456('0x33')];if(_0x2a3000[_0xe456('0x35')][_0xe456('0x46')]){_0x3654e5[_0xe456('0x47')]=[{'all':!![]}];}_0x3654e5=_[_0xe456('0x40')]({},_0x3654e5,_0x2a3000[_0xe456('0x4c')]);return db['ZohoConfiguration']['find'](_0x3654e5)[_0xe456('0x1a')](handleEntityNotFound(_0x4db2c6,null))['then'](respondWithResult(_0x4db2c6,null))[_0xe456('0x24')](handleError(_0x4db2c6,null));};exports[_0xe456('0x4d')]=function(_0x566ef8,_0x188241){return db[_0xe456('0x48')]['create'](_0x566ef8[_0xe456('0x4e')],{})['then'](respondWithResult(_0x188241,0xc9))[_0xe456('0x24')](handleError(_0x188241,null));};exports['update']=function(_0x47f018,_0x3d44b5){if(_0x47f018[_0xe456('0x4e')]['id']){delete _0x47f018[_0xe456('0x4e')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x47f018[_0xe456('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d44b5,null))[_0xe456('0x1a')](saveUpdates(_0x47f018[_0xe456('0x4e')],null))[_0xe456('0x1a')](respondWithResult(_0x3d44b5,null))['catch'](handleError(_0x3d44b5,null));};exports[_0xe456('0x4f')]=function(_0x2d13a1,_0x444405){return db[_0xe456('0x48')][_0xe456('0x50')]({'where':{'id':_0x2d13a1[_0xe456('0x4a')]['id']}})[_0xe456('0x1a')](handleEntityNotFound(_0x444405,null))['then'](removeEntity(_0x444405,null))[_0xe456('0x24')](handleError(_0x444405,null));};exports['getFields']=function(_0x4d38e6,_0x75f849,_0x3e613a){var _0xa9d9b9={};var _0x14769c={};var _0x53c4ba;var _0x56b81b;return db['ZohoConfiguration'][_0xe456('0x51')]({'where':{'id':_0x4d38e6[_0xe456('0x4a')]['id']}})[_0xe456('0x1a')](handleEntityNotFound(_0x75f849,null))['then'](function(_0xf11e48){if(_0xf11e48){_0x53c4ba=_0xf11e48;_0x14769c['model']=_[_0xe456('0x34')](db[_0xe456('0x52')]['rawAttributes']);_0x14769c[_0xe456('0x35')]=_[_0xe456('0x34')](_0x4d38e6['query']);_0x14769c[_0xe456('0x36')]=_[_0xe456('0x37')](_0x14769c['model'],_0x14769c['query']);_0xa9d9b9[_0xe456('0x38')]=_['intersection'](_0x14769c[_0xe456('0x33')],qs[_0xe456('0x39')](_0x4d38e6[_0xe456('0x35')]['fields']));_0xa9d9b9[_0xe456('0x38')]=_0xa9d9b9[_0xe456('0x38')][_0xe456('0x4b')]?_0xa9d9b9[_0xe456('0x38')]:_0x14769c[_0xe456('0x33')];_0xa9d9b9[_0xe456('0x3c')]=qs[_0xe456('0x3d')](_0x4d38e6[_0xe456('0x35')][_0xe456('0x3d')]);_0xa9d9b9[_0xe456('0x3e')]=qs[_0xe456('0x36')](_[_0xe456('0x3f')](_0x4d38e6[_0xe456('0x35')],_0x14769c[_0xe456('0x36')]));if(_0x4d38e6[_0xe456('0x35')][_0xe456('0x45')]){_0xa9d9b9['where']=_[_0xe456('0x40')](_0xa9d9b9[_0xe456('0x3e')],{'$or':_['map'](_0xa9d9b9[_0xe456('0x38')],function(_0x5b3f28){var _0xd1b87d={};_0xd1b87d[_0x5b3f28]={'$like':'%'+_0x4d38e6[_0xe456('0x35')][_0xe456('0x45')]+'%'};return _0xd1b87d;})});}_0xa9d9b9=_[_0xe456('0x40')]({},_0xa9d9b9,_0x4d38e6[_0xe456('0x4c')]);return _0x53c4ba[_0xe456('0x53')](_0xa9d9b9);}})[_0xe456('0x1a')](function(_0x25ac1f){if(_0x25ac1f){_0x56b81b=_0x25ac1f[_0xe456('0x4b')];if(!_0x4d38e6[_0xe456('0x35')][_0xe456('0x54')]('nolimit')){_0xa9d9b9['limit']=qs[_0xe456('0x3b')](_0x4d38e6[_0xe456('0x35')]['limit']);_0xa9d9b9[_0xe456('0x2a')]=qs[_0xe456('0x2a')](_0x4d38e6[_0xe456('0x35')]['offset']);}return _0x53c4ba[_0xe456('0x53')](_0xa9d9b9);}})[_0xe456('0x1a')](function(_0x5b20de){if(_0x5b20de){return _0x5b20de?{'count':_0x56b81b,'rows':_0x5b20de}:null;}})[_0xe456('0x1a')](respondWithResult(_0x75f849,null))[_0xe456('0x24')](handleError(_0x75f849,null));};exports[_0xe456('0x55')]=function(_0x2d7271,_0x26a331,_0x2d8f4f){var _0x5ae2e8={};var _0x3eb084={};var _0x4d103b;var _0x422722;return db[_0xe456('0x48')][_0xe456('0x51')]({'where':{'id':_0x2d7271[_0xe456('0x4a')]['id']}})['then'](handleEntityNotFound(_0x26a331,null))[_0xe456('0x1a')](function(_0x543d15){if(_0x543d15){_0x4d103b=_0x543d15;_0x3eb084['model']=_['keys'](db['ZohoField'][_0xe456('0x32')]);_0x3eb084[_0xe456('0x35')]=_[_0xe456('0x34')](_0x2d7271[_0xe456('0x35')]);_0x3eb084[_0xe456('0x36')]=_[_0xe456('0x37')](_0x3eb084['model'],_0x3eb084[_0xe456('0x35')]);_0x5ae2e8['attributes']=_['intersection'](_0x3eb084[_0xe456('0x33')],qs[_0xe456('0x39')](_0x2d7271[_0xe456('0x35')][_0xe456('0x39')]));_0x5ae2e8['attributes']=_0x5ae2e8[_0xe456('0x38')][_0xe456('0x4b')]?_0x5ae2e8[_0xe456('0x38')]:_0x3eb084[_0xe456('0x33')];_0x5ae2e8[_0xe456('0x3c')]=qs[_0xe456('0x3d')](_0x2d7271['query'][_0xe456('0x3d')]);_0x5ae2e8[_0xe456('0x3e')]=qs[_0xe456('0x36')](_['pick'](_0x2d7271[_0xe456('0x35')],_0x3eb084[_0xe456('0x36')]));if(_0x2d7271['query']['filter']){_0x5ae2e8[_0xe456('0x3e')]=_[_0xe456('0x40')](_0x5ae2e8['where'],{'$or':_['map'](_0x5ae2e8[_0xe456('0x38')],function(_0x538067){var _0x18e595={};_0x18e595[_0x538067]={'$like':'%'+_0x2d7271[_0xe456('0x35')]['filter']+'%'};return _0x18e595;})});}_0x5ae2e8=_['merge']({},_0x5ae2e8,_0x2d7271[_0xe456('0x4c')]);return _0x4d103b[_0xe456('0x55')](_0x5ae2e8);}})[_0xe456('0x1a')](function(_0x2dce82){if(_0x2dce82){_0x422722=_0x2dce82['length'];if(!_0x2d7271[_0xe456('0x35')]['hasOwnProperty']('nolimit')){_0x5ae2e8['limit']=qs['limit'](_0x2d7271[_0xe456('0x35')][_0xe456('0x3b')]);_0x5ae2e8['offset']=qs[_0xe456('0x2a')](_0x2d7271[_0xe456('0x35')][_0xe456('0x2a')]);}return _0x4d103b[_0xe456('0x55')](_0x5ae2e8);}})['then'](function(_0x3c4ad2){if(_0x3c4ad2){return _0x3c4ad2?{'count':_0x422722,'rows':_0x3c4ad2}:null;}})['then'](respondWithResult(_0x26a331,null))[_0xe456('0x24')](handleError(_0x26a331,null));};exports['getDescriptions']=function(_0x2b92b9,_0x1f5418,_0x34524e){var _0x26018b={};var _0x3af7da={};var _0xb1716f;var _0x13f758;return db[_0xe456('0x48')][_0xe456('0x51')]({'where':{'id':_0x2b92b9[_0xe456('0x4a')]['id']}})[_0xe456('0x1a')](handleEntityNotFound(_0x1f5418,null))[_0xe456('0x1a')](function(_0x3f87f0){if(_0x3f87f0){_0xb1716f=_0x3f87f0;_0x3af7da[_0xe456('0x33')]=_[_0xe456('0x34')](db[_0xe456('0x52')]['rawAttributes']);_0x3af7da[_0xe456('0x35')]=_[_0xe456('0x34')](_0x2b92b9[_0xe456('0x35')]);_0x3af7da[_0xe456('0x36')]=_[_0xe456('0x37')](_0x3af7da['model'],_0x3af7da[_0xe456('0x35')]);_0x26018b[_0xe456('0x38')]=_[_0xe456('0x37')](_0x3af7da['model'],qs[_0xe456('0x39')](_0x2b92b9['query'][_0xe456('0x39')]));_0x26018b[_0xe456('0x38')]=_0x26018b['attributes']['length']?_0x26018b[_0xe456('0x38')]:_0x3af7da[_0xe456('0x33')];_0x26018b[_0xe456('0x3c')]=qs[_0xe456('0x3d')](_0x2b92b9[_0xe456('0x35')][_0xe456('0x3d')]);_0x26018b['where']=qs[_0xe456('0x36')](_[_0xe456('0x3f')](_0x2b92b9['query'],_0x3af7da[_0xe456('0x36')]));if(_0x2b92b9[_0xe456('0x35')][_0xe456('0x45')]){_0x26018b[_0xe456('0x3e')]=_[_0xe456('0x40')](_0x26018b[_0xe456('0x3e')],{'$or':_['map'](_0x26018b[_0xe456('0x38')],function(_0x5b1040){var _0x96232c={};_0x96232c[_0x5b1040]={'$like':'%'+_0x2b92b9[_0xe456('0x35')][_0xe456('0x45')]+'%'};return _0x96232c;})});}_0x26018b=_['merge']({},_0x26018b,_0x2b92b9[_0xe456('0x4c')]);return _0xb1716f[_0xe456('0x56')](_0x26018b);}})[_0xe456('0x1a')](function(_0x5048ef){if(_0x5048ef){_0x13f758=_0x5048ef[_0xe456('0x4b')];if(!_0x2b92b9[_0xe456('0x35')][_0xe456('0x54')](_0xe456('0x3a'))){_0x26018b[_0xe456('0x3b')]=qs['limit'](_0x2b92b9['query'][_0xe456('0x3b')]);_0x26018b[_0xe456('0x2a')]=qs[_0xe456('0x2a')](_0x2b92b9[_0xe456('0x35')][_0xe456('0x2a')]);}return _0xb1716f[_0xe456('0x56')](_0x26018b);}})[_0xe456('0x1a')](function(_0x4794c7){if(_0x4794c7){return _0x4794c7?{'count':_0x13f758,'rows':_0x4794c7}:null;}})[_0xe456('0x1a')](respondWithResult(_0x1f5418,null))['catch'](handleError(_0x1f5418,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 52f804d..f680895 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 _0xd139=['rimraf','../../config/environment','./intZohoConfiguration.attributes','ZohoConfiguration','lodash','util','moment','bluebird','request-promise','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd139,0x14e));var _0x9d13=function(_0x326b0f,_0x2eaa50){_0x326b0f=_0x326b0f-0x0;var _0x16ca4c=_0xd139[_0x326b0f];return _0x16ca4c;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d13('0x2'));var BPromise=require(_0x9d13('0x3'));var rp=require(_0x9d13('0x4'));var fs=require('fs');var path=require(_0x9d13('0x5'));var rimraf=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var attributes=require(_0x9d13('0x8'));module['exports']=function(_0x4c8e60,_0x2918eb){return _0x4c8e60['define'](_0x9d13('0x9'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x37f34c,_0x40d1c7){var _0x1ace64=function(_0x927ae7){while(--_0x927ae7){_0x37f34c['push'](_0x37f34c['shift']());}};_0x1ace64(++_0x40d1c7);}(_0xe706,0xa3));var _0x6e70=function(_0x2aba17,_0x128a30){_0x2aba17=_0x2aba17-0x0;var _0x5a9599=_0xe706[_0x2aba17];return _0x5a9599;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index a0a1724..d2526c3 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 _0xa160=['ZohoConfiguration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info'];(function(_0x2c0582,_0x556f94){var _0x1d1aa4=function(_0x3f68f9){while(--_0x3f68f9){_0x2c0582['push'](_0x2c0582['shift']());}};_0x1d1aa4(++_0x556f94);}(_0xa160,0x149));var _0x0a16=function(_0x303ed7,_0x4daabe){_0x303ed7=_0x303ed7-0x0;var _0x5dfda2=_0xa160[_0x303ed7];return _0x5dfda2;};'use strict';var _=require(_0x0a16('0x0'));var util=require(_0x0a16('0x1'));var moment=require(_0x0a16('0x2'));var BPromise=require(_0x0a16('0x3'));var rs=require(_0x0a16('0x4'));var fs=require('fs');var Redis=require(_0x0a16('0x5'));var db=require(_0x0a16('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a16('0x7'))('rpc');var config=require(_0x0a16('0x8'));var jayson=require(_0x0a16('0x9'));var client=jayson[_0x0a16('0xa')][_0x0a16('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ead4c,_0x2c4afc,_0x244185){return new BPromise(function(_0x1b199b,_0x4c1cfb){return client['request'](_0x5ead4c,_0x244185)['then'](function(_0x4e8a9d){logger[_0x0a16('0xc')](_0x0a16('0xd'),_0x2c4afc,'request\x20sent');logger[_0x0a16('0xe')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2c4afc,_0x0a16('0xf'),JSON['stringify'](_0x4e8a9d));if(_0x4e8a9d['error']){if(_0x4e8a9d[_0x0a16('0x10')][_0x0a16('0x11')]===0x1f4){logger[_0x0a16('0x10')](_0x0a16('0xd'),_0x2c4afc,_0x4e8a9d[_0x0a16('0x10')][_0x0a16('0x12')]);return _0x4c1cfb(_0x4e8a9d[_0x0a16('0x10')][_0x0a16('0x12')]);}logger[_0x0a16('0x10')](_0x0a16('0xd'),_0x2c4afc,_0x4e8a9d[_0x0a16('0x10')][_0x0a16('0x12')]);return _0x1b199b(_0x4e8a9d[_0x0a16('0x10')]['message']);}else{logger[_0x0a16('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x2c4afc,_0x0a16('0xf'));_0x1b199b(_0x4e8a9d['result'][_0x0a16('0x12')]);}})['catch'](function(_0x1b807e){logger['error'](_0x0a16('0xd'),_0x2c4afc,_0x1b807e);_0x4c1cfb(_0x1b807e);});});} \ No newline at end of file +var _0x03df=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0xc300b8,_0x29d449){var _0x28861f=function(_0x5d39b0){while(--_0x5d39b0){_0xc300b8['push'](_0xc300b8['shift']());}};_0x28861f(++_0x29d449);}(_0x03df,0x11c));var _0xf03d=function(_0x58c911,_0x5d1227){_0x58c911=_0x58c911-0x0;var _0x394dfd=_0x03df[_0x58c911];return _0x394dfd;};'use strict';var _=require(_0xf03d('0x0'));var util=require(_0xf03d('0x1'));var moment=require(_0xf03d('0x2'));var BPromise=require(_0xf03d('0x3'));var rs=require(_0xf03d('0x4'));var fs=require('fs');var Redis=require(_0xf03d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf03d('0x6'));var logger=require(_0xf03d('0x7'))(_0xf03d('0x8'));var config=require(_0xf03d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf03d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53d9e8,_0x46cfdf,_0x2e929a){return new BPromise(function(_0x275c2b,_0x3c3f70){return client[_0xf03d('0xb')](_0x53d9e8,_0x2e929a)[_0xf03d('0xc')](function(_0x26c4f1){logger[_0xf03d('0xd')](_0xf03d('0xe'),_0x46cfdf,_0xf03d('0xf'));logger[_0xf03d('0x10')](_0xf03d('0x11'),_0x46cfdf,'request\x20sent',JSON[_0xf03d('0x12')](_0x26c4f1));if(_0x26c4f1[_0xf03d('0x13')]){if(_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x14')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x46cfdf,_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x15')]);return _0x3c3f70(_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x15')]);}logger['error'](_0xf03d('0xe'),_0x46cfdf,_0x26c4f1[_0xf03d('0x13')]['message']);return _0x275c2b(_0x26c4f1[_0xf03d('0x13')][_0xf03d('0x15')]);}else{logger['info'](_0xf03d('0xe'),_0x46cfdf,'request\x20sent');_0x275c2b(_0x26c4f1[_0xf03d('0x16')][_0xf03d('0x15')]);}})[_0xf03d('0x17')](function(_0xaabcd9){logger['error'](_0xf03d('0xe'),_0x46cfdf,_0xaabcd9);_0x3c3f70(_0xaabcd9);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 130355d..bf9fe26 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 _0x01ce=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x1af6c5,_0x2ea45c){var _0x48ff63=function(_0x4a78d4){while(--_0x4a78d4){_0x1af6c5['push'](_0x1af6c5['shift']());}};_0x48ff63(++_0x2ea45c);}(_0x01ce,0x1b1));var _0xe01c=function(_0x59b10b,_0x501ad8){_0x59b10b=_0x59b10b-0x0;var _0x2900d9=_0x01ce[_0x59b10b];return _0x2900d9;};'use strict';var multer=require(_0xe01c('0x0'));var util=require(_0xe01c('0x1'));var path=require(_0xe01c('0x2'));var timeout=require(_0xe01c('0x3'));var express=require(_0xe01c('0x4'));var router=express[_0xe01c('0x5')]();var auth=require(_0xe01c('0x6'));var interaction=require(_0xe01c('0x7'));var config=require(_0xe01c('0x8'));var controller=require(_0xe01c('0x9'));router[_0xe01c('0xa')]('/',auth[_0xe01c('0xb')](),controller[_0xe01c('0xc')]);router[_0xe01c('0xa')](_0xe01c('0xd'),auth[_0xe01c('0xb')](),controller[_0xe01c('0xe')]);router['post']('/',auth[_0xe01c('0xb')](),controller[_0xe01c('0xf')]);router[_0xe01c('0x10')]('/:id',auth[_0xe01c('0xb')](),controller[_0xe01c('0x11')]);router[_0xe01c('0x12')](_0xe01c('0xd'),auth[_0xe01c('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x12ff=['index','/:id','post','isAuthenticated','create','update','delete','destroy','exports','util','path','express','Router','../../config/environment','./intZohoField.controller','get'];(function(_0x313139,_0x50cbee){var _0x4fb243=function(_0x250ac2){while(--_0x250ac2){_0x313139['push'](_0x313139['shift']());}};_0x4fb243(++_0x50cbee);}(_0x12ff,0x149));var _0xf12f=function(_0x2d5df5,_0x282cba){_0x2d5df5=_0x2d5df5-0x0;var _0x48d803=_0x12ff[_0x2d5df5];return _0x48d803;};'use strict';var multer=require('multer');var util=require(_0xf12f('0x0'));var path=require(_0xf12f('0x1'));var timeout=require('connect-timeout');var express=require(_0xf12f('0x2'));var router=express[_0xf12f('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf12f('0x4'));var controller=require(_0xf12f('0x5'));router[_0xf12f('0x6')]('/',auth['isAuthenticated'](),controller[_0xf12f('0x7')]);router[_0xf12f('0x6')](_0xf12f('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xf12f('0x9')]('/',auth[_0xf12f('0xa')](),controller[_0xf12f('0xb')]);router['put'](_0xf12f('0x8'),auth['isAuthenticated'](),controller[_0xf12f('0xc')]);router[_0xf12f('0xd')](_0xf12f('0x8'),auth[_0xf12f('0xa')](),controller[_0xf12f('0xe')]);module[_0xf12f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 417e7c7..dcba2ea 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 _0x6e6c=['variable','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x3e68cf,_0xf55158){var _0x4d6699=function(_0x22236c){while(--_0x22236c){_0x3e68cf['push'](_0x3e68cf['shift']());}};_0x4d6699(++_0xf55158);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable','keyValue'),'defaultValue':_0xc6e6('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc6e6('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xc6e6('0x2'),_0xc6e6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xc6e6('0x4')]},'idField':{'type':Sequelize[_0xc6e6('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc6e6('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6e6('0x4')]}}; \ No newline at end of file +var _0x3c81=['customVariable','BOOLEAN','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x3c81,0x102));var _0x13c8=function(_0x33a99c,_0x41f4b2){_0x33a99c=_0x33a99c-0x0;var _0x5956ae=_0x3c81[_0x33a99c];return _0x5956ae;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'type':{'type':Sequelize['ENUM'](_0x13c8('0x2'),_0x13c8('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x13c8('0x4')]},'keyType':{'type':Sequelize[_0x13c8('0x5')](_0x13c8('0x2'),_0x13c8('0x3'),_0x13c8('0x6'))},'keyContent':{'type':Sequelize[_0x13c8('0x4')]},'idField':{'type':Sequelize[_0x13c8('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13c8('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index dfad08e..4eccebe 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 _0xa4b9=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','ZohoField','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','field','includeAll','include','findAll','catch','params','options','create','body','find','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x45fa67,_0x54f9c8){var _0x2eddaf=function(_0x3a9aec){while(--_0x3a9aec){_0x45fa67['push'](_0x45fa67['shift']());}};_0x2eddaf(++_0x54f9c8);}(_0xa4b9,0x1ac));var _0x9a4b=function(_0x425ec8,_0x293ff){_0x425ec8=_0x425ec8-0x0;var _0x1cbf90=_0xa4b9[_0x425ec8];return _0x1cbf90;};'use strict';var pdf=require(_0x9a4b('0x0'));var emlformat=require(_0x9a4b('0x1'));var rimraf=require(_0x9a4b('0x2'));var zipdir=require(_0x9a4b('0x3'));var jsonpatch=require(_0x9a4b('0x4'));var rp=require(_0x9a4b('0x5'));var moment=require(_0x9a4b('0x6'));var BPromise=require(_0x9a4b('0x7'));var Mustache=require(_0x9a4b('0x8'));var util=require(_0x9a4b('0x9'));var path=require(_0x9a4b('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9a4b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9a4b('0xc'));var jsforce=require(_0x9a4b('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9a4b('0xe'));var Papa=require(_0x9a4b('0xf'));var Redis=require(_0x9a4b('0x10'));var authService=require(_0x9a4b('0x11'));var qs=require(_0x9a4b('0x12'));var hardwareService=require(_0x9a4b('0x13'));var logger=require(_0x9a4b('0x14'))(_0x9a4b('0x15'));var utils=require(_0x9a4b('0x16'));var config=require('../../config/environment');var db=require(_0x9a4b('0x17'))['db'];function respondWithStatusCode(_0x15715f,_0x2c9c80){_0x2c9c80=_0x2c9c80||0xcc;return function(_0x463087){if(_0x463087){return _0x15715f[_0x9a4b('0x18')](_0x2c9c80);}return _0x15715f[_0x9a4b('0x19')](_0x2c9c80)[_0x9a4b('0x1a')]();};}function respondWithResult(_0x1616f1,_0x3255eb){_0x3255eb=_0x3255eb||0xc8;return function(_0x37e0f5){if(_0x37e0f5){return _0x1616f1[_0x9a4b('0x19')](_0x3255eb)[_0x9a4b('0x1b')](_0x37e0f5);}};}function respondWithFilteredResult(_0x47df45,_0x5dcde6){return function(_0x5f2f05){if(_0x5f2f05){var _0x4faa51=_0x5f2f05[_0x9a4b('0x1c')],_0x35513d=_0x5dcde6[_0x9a4b('0x1d')],_0x2bcfe0=_0x5dcde6[_0x9a4b('0x1d')]+_0x5dcde6[_0x9a4b('0x1e')],_0x4f316a;if(_0x2bcfe0>=_0x4faa51){_0x2bcfe0=_0x4faa51;_0x4f316a=0xc8;}else{_0x4f316a=0xce;}_0x47df45['status'](_0x4f316a);return _0x47df45[_0x9a4b('0x1f')](_0x9a4b('0x20'),_0x35513d+'-'+_0x2bcfe0+'/'+_0x4faa51)[_0x9a4b('0x1b')](_0x5f2f05);}return null;};}function patchUpdates(_0xc8b1ea){return function(_0x421827){try{jsonpatch[_0x9a4b('0x21')](_0x421827,_0xc8b1ea,!![]);}catch(_0x1d91f8){return BPromise['reject'](_0x1d91f8);}return _0x421827[_0x9a4b('0x22')]();};}function saveUpdates(_0x1f4290,_0x2c0284){return function(_0x39c1c1){if(_0x39c1c1){return _0x39c1c1[_0x9a4b('0x23')](_0x1f4290)[_0x9a4b('0x24')](function(_0x106860){return _0x106860;});}return null;};}function removeEntity(_0x44423a,_0x34c430){return function(_0x605bda){if(_0x605bda){return _0x605bda[_0x9a4b('0x25')]()['then'](function(){_0x44423a[_0x9a4b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54df42,_0x33f699){return function(_0x4b0ff3){if(!_0x4b0ff3){_0x54df42[_0x9a4b('0x18')](0x194);}return _0x4b0ff3;};}function handleError(_0x16bd4c,_0x430192){_0x430192=_0x430192||0x1f4;return function(_0x10c109){logger[_0x9a4b('0x26')](_0x10c109[_0x9a4b('0x27')]);if(_0x10c109[_0x9a4b('0x28')]){delete _0x10c109[_0x9a4b('0x28')];}_0x16bd4c['status'](_0x430192)['send'](_0x10c109);};}exports[_0x9a4b('0x29')]=function(_0x44d4c2,_0x4497f2){var _0x44a3a7={},_0x2e4d2c={},_0xc2abc8={'count':0x0,'rows':[]};var _0x38c481=db[_0x9a4b('0x2a')][_0x9a4b('0x2b')];_0x2e4d2c[_0x9a4b('0x2c')]=_[_0x9a4b('0x2d')](_0x38c481);_0x2e4d2c[_0x9a4b('0x2e')]=_['keys'](_0x44d4c2[_0x9a4b('0x2e')]);_0x2e4d2c[_0x9a4b('0x2f')]=_[_0x9a4b('0x30')](_0x2e4d2c[_0x9a4b('0x2c')],_0x2e4d2c[_0x9a4b('0x2e')]);_0x44a3a7[_0x9a4b('0x31')]=_[_0x9a4b('0x30')](_0x2e4d2c[_0x9a4b('0x2c')],qs[_0x9a4b('0x32')](_0x44d4c2[_0x9a4b('0x2e')][_0x9a4b('0x32')]));_0x44a3a7['attributes']=_0x44a3a7[_0x9a4b('0x31')][_0x9a4b('0x33')]?_0x44a3a7['attributes']:_0x2e4d2c[_0x9a4b('0x2c')];if(!_0x44d4c2['query'][_0x9a4b('0x34')](_0x9a4b('0x35'))){_0x44a3a7['limit']=qs[_0x9a4b('0x1e')](_0x44d4c2[_0x9a4b('0x2e')][_0x9a4b('0x1e')]);_0x44a3a7[_0x9a4b('0x1d')]=qs['offset'](_0x44d4c2[_0x9a4b('0x2e')][_0x9a4b('0x1d')]);}_0x44a3a7[_0x9a4b('0x36')]=qs[_0x9a4b('0x37')](_0x44d4c2[_0x9a4b('0x2e')][_0x9a4b('0x37')]);_0x44a3a7[_0x9a4b('0x38')]=qs[_0x9a4b('0x2f')](_[_0x9a4b('0x39')](_0x44d4c2[_0x9a4b('0x2e')],_0x2e4d2c[_0x9a4b('0x2f')]));if(_0x44d4c2[_0x9a4b('0x2e')][_0x9a4b('0x3a')]){_0x44a3a7[_0x9a4b('0x38')]=_[_0x9a4b('0x3b')](_0x44a3a7['where'],{'$or':_['map'](_0x38c481,function(_0x4da974){if(_0x4da974[_0x9a4b('0x3c')][_0x9a4b('0x3d')]!=='VIRTUAL'){var _0x590e85={};_0x590e85[_0x4da974[_0x9a4b('0x3e')]]={'$like':'%'+_0x44d4c2[_0x9a4b('0x2e')]['filter']+'%'};return _0x590e85;}})});}_0x44a3a7=_[_0x9a4b('0x3b')]({},_0x44a3a7,_0x44d4c2['options']);var _0x4110cb={'where':_0x44a3a7[_0x9a4b('0x38')]};return db[_0x9a4b('0x2a')][_0x9a4b('0x1c')](_0x4110cb)['then'](function(_0x21da09){_0xc2abc8[_0x9a4b('0x1c')]=_0x21da09;if(_0x44d4c2[_0x9a4b('0x2e')][_0x9a4b('0x3f')]){_0x44a3a7[_0x9a4b('0x40')]=[{'all':!![]}];}return db[_0x9a4b('0x2a')][_0x9a4b('0x41')](_0x44a3a7);})[_0x9a4b('0x24')](function(_0x3daa65){_0xc2abc8['rows']=_0x3daa65;return _0xc2abc8;})[_0x9a4b('0x24')](respondWithFilteredResult(_0x4497f2,_0x44a3a7))[_0x9a4b('0x42')](handleError(_0x4497f2,null));};exports['show']=function(_0x118c55,_0x1d182b){var _0x2cb8e5={'raw':!![],'where':{'id':_0x118c55[_0x9a4b('0x43')]['id']}},_0x1672b0={};_0x1672b0[_0x9a4b('0x2c')]=_[_0x9a4b('0x2d')](db['ZohoField']['rawAttributes']);_0x1672b0[_0x9a4b('0x2e')]=_[_0x9a4b('0x2d')](_0x118c55[_0x9a4b('0x2e')]);_0x1672b0[_0x9a4b('0x2f')]=_['intersection'](_0x1672b0[_0x9a4b('0x2c')],_0x1672b0['query']);_0x2cb8e5[_0x9a4b('0x31')]=_[_0x9a4b('0x30')](_0x1672b0['model'],qs[_0x9a4b('0x32')](_0x118c55['query'][_0x9a4b('0x32')]));_0x2cb8e5[_0x9a4b('0x31')]=_0x2cb8e5[_0x9a4b('0x31')][_0x9a4b('0x33')]?_0x2cb8e5[_0x9a4b('0x31')]:_0x1672b0[_0x9a4b('0x2c')];if(_0x118c55[_0x9a4b('0x2e')][_0x9a4b('0x3f')]){_0x2cb8e5[_0x9a4b('0x40')]=[{'all':!![]}];}_0x2cb8e5=_[_0x9a4b('0x3b')]({},_0x2cb8e5,_0x118c55[_0x9a4b('0x44')]);return db[_0x9a4b('0x2a')]['find'](_0x2cb8e5)[_0x9a4b('0x24')](handleEntityNotFound(_0x1d182b,null))['then'](respondWithResult(_0x1d182b,null))[_0x9a4b('0x42')](handleError(_0x1d182b,null));};exports[_0x9a4b('0x45')]=function(_0x18f862,_0x163f10){return db[_0x9a4b('0x2a')][_0x9a4b('0x45')](_0x18f862[_0x9a4b('0x46')],{})['then'](respondWithResult(_0x163f10,0xc9))[_0x9a4b('0x42')](handleError(_0x163f10,null));};exports[_0x9a4b('0x23')]=function(_0x10bb97,_0x5b0ba6){if(_0x10bb97[_0x9a4b('0x46')]['id']){delete _0x10bb97[_0x9a4b('0x46')]['id'];}return db[_0x9a4b('0x2a')]['find']({'where':{'id':_0x10bb97[_0x9a4b('0x43')]['id']}})['then'](handleEntityNotFound(_0x5b0ba6,null))['then'](saveUpdates(_0x10bb97[_0x9a4b('0x46')],null))[_0x9a4b('0x24')](respondWithResult(_0x5b0ba6,null))['catch'](handleError(_0x5b0ba6,null));};exports[_0x9a4b('0x25')]=function(_0x3bf611,_0x1d7a3e){return db['ZohoField'][_0x9a4b('0x47')]({'where':{'id':_0x3bf611[_0x9a4b('0x43')]['id']}})['then'](handleEntityNotFound(_0x1d7a3e,null))[_0x9a4b('0x24')](removeEntity(_0x1d7a3e,null))[_0x9a4b('0x42')](handleError(_0x1d7a3e,null));}; \ No newline at end of file +var _0xf2f3=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','then','destroy','stack','name','send','ZohoField','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','map','key','field','includeAll','catch','show','params','length','include','options','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/logger'];(function(_0x1d1884,_0x437c94){var _0x16d120=function(_0x815287){while(--_0x815287){_0x1d1884['push'](_0x1d1884['shift']());}};_0x16d120(++_0x437c94);}(_0xf2f3,0x1d0));var _0x3f2f=function(_0x390702,_0x1298c3){_0x390702=_0x390702-0x0;var _0x2072ce=_0xf2f3[_0x390702];return _0x2072ce;};'use strict';var pdf=require(_0x3f2f('0x0'));var emlformat=require(_0x3f2f('0x1'));var rimraf=require(_0x3f2f('0x2'));var zipdir=require(_0x3f2f('0x3'));var jsonpatch=require(_0x3f2f('0x4'));var rp=require(_0x3f2f('0x5'));var moment=require(_0x3f2f('0x6'));var BPromise=require(_0x3f2f('0x7'));var Mustache=require(_0x3f2f('0x8'));var util=require('util');var path=require('path');var sox=require(_0x3f2f('0x9'));var csv=require('to-csv');var ejs=require(_0x3f2f('0xa'));var fs=require('fs');var _=require(_0x3f2f('0xb'));var squel=require(_0x3f2f('0xc'));var crypto=require(_0x3f2f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3f2f('0xe'));var querystring=require(_0x3f2f('0xf'));var Papa=require(_0x3f2f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f2f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f2f('0x12'))(_0x3f2f('0x13'));var utils=require(_0x3f2f('0x14'));var config=require(_0x3f2f('0x15'));var db=require(_0x3f2f('0x16'))['db'];function respondWithStatusCode(_0x5296ee,_0x42b7eb){_0x42b7eb=_0x42b7eb||0xcc;return function(_0x1c0047){if(_0x1c0047){return _0x5296ee[_0x3f2f('0x17')](_0x42b7eb);}return _0x5296ee[_0x3f2f('0x18')](_0x42b7eb)[_0x3f2f('0x19')]();};}function respondWithResult(_0x41c4ae,_0xa799c4){_0xa799c4=_0xa799c4||0xc8;return function(_0x227533){if(_0x227533){return _0x41c4ae['status'](_0xa799c4)[_0x3f2f('0x1a')](_0x227533);}};}function respondWithFilteredResult(_0x2e9db2,_0x418640){return function(_0x3cf4bb){if(_0x3cf4bb){var _0x976cdf=_0x3cf4bb[_0x3f2f('0x1b')],_0x5b0981=_0x418640[_0x3f2f('0x1c')],_0x48ded1=_0x418640[_0x3f2f('0x1c')]+_0x418640['limit'],_0x576120;if(_0x48ded1>=_0x976cdf){_0x48ded1=_0x976cdf;_0x576120=0xc8;}else{_0x576120=0xce;}_0x2e9db2[_0x3f2f('0x18')](_0x576120);return _0x2e9db2[_0x3f2f('0x1d')]('Content-Range',_0x5b0981+'-'+_0x48ded1+'/'+_0x976cdf)[_0x3f2f('0x1a')](_0x3cf4bb);}return null;};}function patchUpdates(_0x545b23){return function(_0x5dfdf5){try{jsonpatch[_0x3f2f('0x1e')](_0x5dfdf5,_0x545b23,!![]);}catch(_0x428bad){return BPromise[_0x3f2f('0x1f')](_0x428bad);}return _0x5dfdf5[_0x3f2f('0x20')]();};}function saveUpdates(_0x28403b,_0x57a466){return function(_0x46dc54){if(_0x46dc54){return _0x46dc54['update'](_0x28403b)[_0x3f2f('0x21')](function(_0x6855d6){return _0x6855d6;});}return null;};}function removeEntity(_0x5aac97,_0x926598){return function(_0x179619){if(_0x179619){return _0x179619[_0x3f2f('0x22')]()[_0x3f2f('0x21')](function(){_0x5aac97[_0x3f2f('0x18')](0xcc)[_0x3f2f('0x19')]();});}};}function handleEntityNotFound(_0x4f0e3a,_0x44c61c){return function(_0x32e397){if(!_0x32e397){_0x4f0e3a[_0x3f2f('0x17')](0x194);}return _0x32e397;};}function handleError(_0x10efb1,_0x195999){_0x195999=_0x195999||0x1f4;return function(_0x1dfd52){logger['error'](_0x1dfd52[_0x3f2f('0x23')]);if(_0x1dfd52[_0x3f2f('0x24')]){delete _0x1dfd52['name'];}_0x10efb1[_0x3f2f('0x18')](_0x195999)[_0x3f2f('0x25')](_0x1dfd52);};}exports['index']=function(_0x5f482e,_0x2ec4d4){var _0xa7ead5={},_0xa647b0={},_0x426d90={'count':0x0,'rows':[]};var _0x82ab27=db[_0x3f2f('0x26')][_0x3f2f('0x27')];_0xa647b0[_0x3f2f('0x28')]=_[_0x3f2f('0x29')](_0x82ab27);_0xa647b0[_0x3f2f('0x2a')]=_[_0x3f2f('0x29')](_0x5f482e[_0x3f2f('0x2a')]);_0xa647b0['filters']=_[_0x3f2f('0x2b')](_0xa647b0[_0x3f2f('0x28')],_0xa647b0[_0x3f2f('0x2a')]);_0xa7ead5[_0x3f2f('0x2c')]=_['intersection'](_0xa647b0[_0x3f2f('0x28')],qs[_0x3f2f('0x2d')](_0x5f482e[_0x3f2f('0x2a')]['fields']));_0xa7ead5['attributes']=_0xa7ead5[_0x3f2f('0x2c')]['length']?_0xa7ead5[_0x3f2f('0x2c')]:_0xa647b0[_0x3f2f('0x28')];if(!_0x5f482e[_0x3f2f('0x2a')]['hasOwnProperty'](_0x3f2f('0x2e'))){_0xa7ead5['limit']=qs[_0x3f2f('0x2f')](_0x5f482e[_0x3f2f('0x2a')]['limit']);_0xa7ead5[_0x3f2f('0x1c')]=qs[_0x3f2f('0x1c')](_0x5f482e[_0x3f2f('0x2a')]['offset']);}_0xa7ead5[_0x3f2f('0x30')]=qs[_0x3f2f('0x31')](_0x5f482e['query'][_0x3f2f('0x31')]);_0xa7ead5[_0x3f2f('0x32')]=qs[_0x3f2f('0x33')](_[_0x3f2f('0x34')](_0x5f482e[_0x3f2f('0x2a')],_0xa647b0[_0x3f2f('0x33')]));if(_0x5f482e[_0x3f2f('0x2a')][_0x3f2f('0x35')]){_0xa7ead5[_0x3f2f('0x32')]=_[_0x3f2f('0x36')](_0xa7ead5['where'],{'$or':_[_0x3f2f('0x37')](_0x82ab27,function(_0x32304b){if(_0x32304b['type'][_0x3f2f('0x38')]!=='VIRTUAL'){var _0x39a791={};_0x39a791[_0x32304b[_0x3f2f('0x39')]]={'$like':'%'+_0x5f482e['query']['filter']+'%'};return _0x39a791;}})});}_0xa7ead5=_['merge']({},_0xa7ead5,_0x5f482e['options']);var _0xf5983c={'where':_0xa7ead5[_0x3f2f('0x32')]};return db[_0x3f2f('0x26')]['count'](_0xf5983c)[_0x3f2f('0x21')](function(_0x183915){_0x426d90[_0x3f2f('0x1b')]=_0x183915;if(_0x5f482e[_0x3f2f('0x2a')][_0x3f2f('0x3a')]){_0xa7ead5['include']=[{'all':!![]}];}return db['ZohoField']['findAll'](_0xa7ead5);})[_0x3f2f('0x21')](function(_0x40c846){_0x426d90['rows']=_0x40c846;return _0x426d90;})[_0x3f2f('0x21')](respondWithFilteredResult(_0x2ec4d4,_0xa7ead5))[_0x3f2f('0x3b')](handleError(_0x2ec4d4,null));};exports[_0x3f2f('0x3c')]=function(_0x5de055,_0x556e98){var _0x3f0ea4={'raw':!![],'where':{'id':_0x5de055[_0x3f2f('0x3d')]['id']}},_0x4f3332={};_0x4f3332[_0x3f2f('0x28')]=_[_0x3f2f('0x29')](db['ZohoField'][_0x3f2f('0x27')]);_0x4f3332['query']=_[_0x3f2f('0x29')](_0x5de055['query']);_0x4f3332[_0x3f2f('0x33')]=_[_0x3f2f('0x2b')](_0x4f3332[_0x3f2f('0x28')],_0x4f3332[_0x3f2f('0x2a')]);_0x3f0ea4['attributes']=_[_0x3f2f('0x2b')](_0x4f3332[_0x3f2f('0x28')],qs[_0x3f2f('0x2d')](_0x5de055[_0x3f2f('0x2a')]['fields']));_0x3f0ea4[_0x3f2f('0x2c')]=_0x3f0ea4[_0x3f2f('0x2c')][_0x3f2f('0x3e')]?_0x3f0ea4[_0x3f2f('0x2c')]:_0x4f3332['model'];if(_0x5de055['query'][_0x3f2f('0x3a')]){_0x3f0ea4[_0x3f2f('0x3f')]=[{'all':!![]}];}_0x3f0ea4=_[_0x3f2f('0x36')]({},_0x3f0ea4,_0x5de055[_0x3f2f('0x40')]);return db[_0x3f2f('0x26')][_0x3f2f('0x41')](_0x3f0ea4)[_0x3f2f('0x21')](handleEntityNotFound(_0x556e98,null))[_0x3f2f('0x21')](respondWithResult(_0x556e98,null))[_0x3f2f('0x3b')](handleError(_0x556e98,null));};exports[_0x3f2f('0x42')]=function(_0x1e3fcf,_0x176a8a){return db[_0x3f2f('0x26')][_0x3f2f('0x42')](_0x1e3fcf[_0x3f2f('0x43')],{})[_0x3f2f('0x21')](respondWithResult(_0x176a8a,0xc9))['catch'](handleError(_0x176a8a,null));};exports[_0x3f2f('0x44')]=function(_0x3968b0,_0x3f8f57){if(_0x3968b0[_0x3f2f('0x43')]['id']){delete _0x3968b0['body']['id'];}return db[_0x3f2f('0x26')][_0x3f2f('0x41')]({'where':{'id':_0x3968b0[_0x3f2f('0x3d')]['id']}})[_0x3f2f('0x21')](handleEntityNotFound(_0x3f8f57,null))[_0x3f2f('0x21')](saveUpdates(_0x3968b0[_0x3f2f('0x43')],null))['then'](respondWithResult(_0x3f8f57,null))[_0x3f2f('0x3b')](handleError(_0x3f8f57,null));};exports['destroy']=function(_0x55a4bb,_0x348b25){return db['ZohoField']['find']({'where':{'id':_0x55a4bb['params']['id']}})['then'](handleEntityNotFound(_0x348b25,null))[_0x3f2f('0x21')](removeEntity(_0x348b25,null))[_0x3f2f('0x3b')](handleError(_0x348b25,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 0de5b30..5324fc1 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 _0x4d1d=['moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','lodash','../../config/logger','api'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x4d1d,0xeb));var _0xd4d1=function(_0x3287f0,_0x342622){_0x3287f0=_0x3287f0-0x0;var _0x4370a2=_0x4d1d[_0x3287f0];return _0x4370a2;};'use strict';var _=require(_0xd4d1('0x0'));var util=require('util');var logger=require(_0xd4d1('0x1'))(_0xd4d1('0x2'));var moment=require(_0xd4d1('0x3'));var BPromise=require('bluebird');var rp=require(_0xd4d1('0x4'));var fs=require('fs');var path=require(_0xd4d1('0x5'));var rimraf=require(_0xd4d1('0x6'));var config=require(_0xd4d1('0x7'));var attributes=require(_0xd4d1('0x8'));module[_0xd4d1('0x9')]=function(_0x3c0fdc,_0x253f21){return _0x3c0fdc[_0xd4d1('0xa')](_0xd4d1('0xb'),attributes,{'tableName':_0xd4d1('0xc'),'paranoid':![],'indexes':[{'name':_0xd4d1('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb3a5=['FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField'];(function(_0x3c460f,_0x1dcbed){var _0xb5842c=function(_0x4d15bf){while(--_0x4d15bf){_0x3c460f['push'](_0x3c460f['shift']());}};_0xb5842c(++_0x1dcbed);}(_0xb3a5,0x10b));var _0x5b3a=function(_0x36eef2,_0x299892){_0x36eef2=_0x36eef2-0x0;var _0x5aae86=_0xb3a5[_0x36eef2];return _0x5aae86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5b3a('0x0'))(_0x5b3a('0x1'));var moment=require(_0x5b3a('0x2'));var BPromise=require(_0x5b3a('0x3'));var rp=require(_0x5b3a('0x4'));var fs=require('fs');var path=require(_0x5b3a('0x5'));var rimraf=require(_0x5b3a('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b3a('0x7'));module[_0x5b3a('0x8')]=function(_0xa1d418,_0xe09216){return _0xa1d418[_0x5b3a('0x9')](_0x5b3a('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x5b3a('0xb'),'fields':[_0x5b3a('0xc'),_0x5b3a('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 734ebdd..93a8448 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 _0xffb2=['message','ZohoField,\x20%s,\x20%s','info','request\x20sent','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x9077f6,_0xc0577a){var _0x5a1414=function(_0x218d09){while(--_0x218d09){_0x9077f6['push'](_0x9077f6['shift']());}};_0x5a1414(++_0xc0577a);}(_0xffb2,0x9d));var _0x2ffb=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0xffb2[_0x34bd34];return _0x4e36d6;};'use strict';var _=require('lodash');var util=require(_0x2ffb('0x0'));var moment=require(_0x2ffb('0x1'));var BPromise=require(_0x2ffb('0x2'));var rs=require(_0x2ffb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2ffb('0x4'));var logger=require(_0x2ffb('0x5'))(_0x2ffb('0x6'));var config=require(_0x2ffb('0x7'));var jayson=require(_0x2ffb('0x8'));var client=jayson[_0x2ffb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x203e86,_0x15aaa6,_0x992f87){return new BPromise(function(_0x325e12,_0x1189f0){return client[_0x2ffb('0xa')](_0x203e86,_0x992f87)['then'](function(_0x3918b2){logger['info']('ZohoField,\x20%s,\x20%s',_0x15aaa6,'request\x20sent');logger['debug'](_0x2ffb('0xb'),_0x15aaa6,'request\x20sent',JSON[_0x2ffb('0xc')](_0x3918b2));if(_0x3918b2[_0x2ffb('0xd')]){if(_0x3918b2[_0x2ffb('0xd')]['code']===0x1f4){logger[_0x2ffb('0xd')]('ZohoField,\x20%s,\x20%s',_0x15aaa6,_0x3918b2[_0x2ffb('0xd')][_0x2ffb('0xe')]);return _0x1189f0(_0x3918b2['error']['message']);}logger[_0x2ffb('0xd')](_0x2ffb('0xf'),_0x15aaa6,_0x3918b2[_0x2ffb('0xd')][_0x2ffb('0xe')]);return _0x325e12(_0x3918b2[_0x2ffb('0xd')]['message']);}else{logger[_0x2ffb('0x10')]('ZohoField,\x20%s,\x20%s',_0x15aaa6,_0x2ffb('0x11'));_0x325e12(_0x3918b2['result'][_0x2ffb('0xe')]);}})[_0x2ffb('0x12')](function(_0x3ec931){logger[_0x2ffb('0xd')](_0x2ffb('0xf'),_0x15aaa6,_0x3ec931);_0x1189f0(_0x3ec931);});});} \ No newline at end of file +var _0xd014=['util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','http','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0xc85d23,_0x209ca3){var _0x4bbeef=function(_0x318b97){while(--_0x318b97){_0xc85d23['push'](_0xc85d23['shift']());}};_0x4bbeef(++_0x209ca3);}(_0xd014,0x1c1));var _0x4d01=function(_0x33f643,_0x223ef9){_0x33f643=_0x33f643-0x0;var _0xaf90d5=_0xd014[_0x33f643];return _0xaf90d5;};'use strict';var _=require(_0x4d01('0x0'));var util=require(_0x4d01('0x1'));var moment=require(_0x4d01('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d01('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4d01('0x4'));var logger=require(_0x4d01('0x5'))('rpc');var config=require(_0x4d01('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4d01('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x744bc6,_0x3e7c0f,_0xcb4209){return new BPromise(function(_0x5f39c6,_0xf5416a){return client['request'](_0x744bc6,_0xcb4209)['then'](function(_0x1cf4f6){logger[_0x4d01('0x8')](_0x4d01('0x9'),_0x3e7c0f,_0x4d01('0xa'));logger[_0x4d01('0xb')](_0x4d01('0xc'),_0x3e7c0f,_0x4d01('0xa'),JSON['stringify'](_0x1cf4f6));if(_0x1cf4f6[_0x4d01('0xd')]){if(_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xe')]===0x1f4){logger[_0x4d01('0xd')](_0x4d01('0x9'),_0x3e7c0f,_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xf')]);return _0xf5416a(_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xf')]);}logger[_0x4d01('0xd')](_0x4d01('0x9'),_0x3e7c0f,_0x1cf4f6[_0x4d01('0xd')]['message']);return _0x5f39c6(_0x1cf4f6[_0x4d01('0xd')][_0x4d01('0xf')]);}else{logger['info'](_0x4d01('0x9'),_0x3e7c0f,_0x4d01('0xa'));_0x5f39c6(_0x1cf4f6[_0x4d01('0x10')]['message']);}})[_0x4d01('0x11')](function(_0x43b8c0){logger[_0x4d01('0xd')]('ZohoField,\x20%s,\x20%s',_0x3e7c0f,_0x43b8c0);_0xf5416a(_0x43b8c0);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 7755125..63c27e9 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 _0x078a=['Router','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x1b9d17,_0xb39108){var _0x50ae0e=function(_0x175818){while(--_0x175818){_0x1b9d17['push'](_0x1b9d17['shift']());}};_0x50ae0e(++_0xb39108);}(_0x078a,0x12d));var _0xa078=function(_0x4351c3,_0x564fa8){_0x4351c3=_0x4351c3-0x0;var _0x43a6e0=_0x078a[_0x4351c3];return _0x43a6e0;};'use strict';var multer=require(_0xa078('0x0'));var util=require(_0xa078('0x1'));var path=require(_0xa078('0x2'));var timeout=require(_0xa078('0x3'));var express=require(_0xa078('0x4'));var router=express[_0xa078('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa078('0x6'));var config=require(_0xa078('0x7'));module[_0xa078('0x8')]=router; \ No newline at end of file +var _0x2f2e=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','express'];(function(_0x1a0c3d,_0x48f6c3){var _0x2a137f=function(_0x2e1710){while(--_0x2e1710){_0x1a0c3d['push'](_0x1a0c3d['shift']());}};_0x2a137f(++_0x48f6c3);}(_0x2f2e,0x146));var _0xe2f2=function(_0x2cc0b3,_0x120bf1){_0x2cc0b3=_0x2cc0b3-0x0;var _0x1667ef=_0x2f2e[_0x2cc0b3];return _0x1667ef;};'use strict';var multer=require('multer');var util=require(_0xe2f2('0x0'));var path=require(_0xe2f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xe2f2('0x2'));var router=express['Router']();var auth=require(_0xe2f2('0x3'));var interaction=require(_0xe2f2('0x4'));var config=require(_0xe2f2('0x5'));module[_0xe2f2('0x6')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 0d34eef..e390993 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 _0x28a5=['BOOLEAN','state','sequelize','unique_name_and_version','app.js','STRING','INTEGER'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x28a5,0x11a));var _0x528a=function(_0x3c6dce,_0x5424dd){_0x3c6dce=_0x3c6dce-0x0;var _0x1450e9=_0x28a5[_0x3c6dce];return _0x1450e9;};'use strict';var Sequelize=require(_0x528a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x528a('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x528a('0x1')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x528a('0x2')},'filename':{'type':Sequelize[_0x528a('0x3')]},'path':{'type':Sequelize[_0x528a('0x3')]},'type':{'type':Sequelize[_0x528a('0x3')]},'size':{'type':Sequelize[_0x528a('0x4')]},'active':{'type':Sequelize[_0x528a('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x528a('0x3')]},'logo':{'type':Sequelize[_0x528a('0x3')]},'state':{'type':Sequelize[_0x528a('0x3')],'unique':_0x528a('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x528a('0x3')]},'remoteUri':{'type':Sequelize[_0x528a('0x3')]},'link':{'type':Sequelize[_0x528a('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0xc52b=['unique_name_and_version','INTEGER','state','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc52b,0xd5));var _0xbc52=function(_0x17c05a,_0xde01fc){_0x17c05a=_0x17c05a-0x0;var _0x53f984=_0xc52b[_0x17c05a];return _0x53f984;};'use strict';var Sequelize=require('sequelize');module[_0xbc52('0x0')]={'name':{'type':Sequelize[_0xbc52('0x1')],'allowNull':![],'unique':_0xbc52('0x2')},'version':{'type':Sequelize[_0xbc52('0x1')],'allowNull':![],'unique':_0xbc52('0x2')},'main':{'type':Sequelize[_0xbc52('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xbc52('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xbc52('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xbc52('0x1')]},'logo':{'type':Sequelize[_0xbc52('0x1')]},'state':{'type':Sequelize[_0xbc52('0x1')],'unique':_0xbc52('0x4')},'description':{'type':Sequelize[_0xbc52('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbc52('0x1')]},'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 3a8a494..226aa39 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 _0x7512=['includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','Integration','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','key','field','options'];(function(_0x4342e9,_0x377d61){var _0x50acea=function(_0x35f759){while(--_0x35f759){_0x4342e9['push'](_0x4342e9['shift']());}};_0x50acea(++_0x377d61);}(_0x7512,0x122));var _0x2751=function(_0x5c620a,_0x200a52){_0x5c620a=_0x5c620a-0x0;var _0x5e6424=_0x7512[_0x5c620a];return _0x5e6424;};'use strict';var pdf=require(_0x2751('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2751('0x1'));var zipdir=require(_0x2751('0x2'));var jsonpatch=require(_0x2751('0x3'));var rp=require('request-promise');var moment=require(_0x2751('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2751('0x5'));var util=require(_0x2751('0x6'));var path=require(_0x2751('0x7'));var sox=require('sox');var csv=require(_0x2751('0x8'));var ejs=require(_0x2751('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2751('0xa'));var crypto=require('crypto');var jsforce=require(_0x2751('0xb'));var deskjs=require(_0x2751('0xc'));var toCsv=require(_0x2751('0x8'));var querystring=require(_0x2751('0xd'));var Papa=require(_0x2751('0xe'));var Redis=require('ioredis');var authService=require(_0x2751('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x2751('0x10'));var logger=require(_0x2751('0x11'))(_0x2751('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2751('0x13'))['db'];function respondWithStatusCode(_0x2d7b17,_0x511e4d){_0x511e4d=_0x511e4d||0xcc;return function(_0x114792){if(_0x114792){return _0x2d7b17['sendStatus'](_0x511e4d);}return _0x2d7b17['status'](_0x511e4d)[_0x2751('0x14')]();};}function respondWithResult(_0x48d2bf,_0xd04fc7){_0xd04fc7=_0xd04fc7||0xc8;return function(_0x1f2de5){if(_0x1f2de5){return _0x48d2bf['status'](_0xd04fc7)[_0x2751('0x15')](_0x1f2de5);}};}function respondWithFilteredResult(_0x1295bb,_0x28a4f0){return function(_0x3030fa){if(_0x3030fa){var _0x1397df=_0x3030fa[_0x2751('0x16')],_0x38d7c0=_0x28a4f0['offset'],_0x5e84ee=_0x28a4f0[_0x2751('0x17')]+_0x28a4f0[_0x2751('0x18')],_0x58d86f;if(_0x5e84ee>=_0x1397df){_0x5e84ee=_0x1397df;_0x58d86f=0xc8;}else{_0x58d86f=0xce;}_0x1295bb[_0x2751('0x19')](_0x58d86f);return _0x1295bb['set'](_0x2751('0x1a'),_0x38d7c0+'-'+_0x5e84ee+'/'+_0x1397df)['json'](_0x3030fa);}return null;};}function patchUpdates(_0x240001){return function(_0x30f238){try{jsonpatch[_0x2751('0x1b')](_0x30f238,_0x240001,!![]);}catch(_0x1b6e14){return BPromise[_0x2751('0x1c')](_0x1b6e14);}return _0x30f238[_0x2751('0x1d')]();};}function saveUpdates(_0x1c87e7,_0xea0e98){return function(_0x1d1e0f){if(_0x1d1e0f){return _0x1d1e0f[_0x2751('0x1e')](_0x1c87e7)[_0x2751('0x1f')](function(_0x2faed2){return _0x2faed2;});}return null;};}function removeEntity(_0x1efc60,_0x4f18a0){return function(_0x27683e){if(_0x27683e){return _0x27683e[_0x2751('0x20')]()[_0x2751('0x1f')](function(){_0x1efc60['status'](0xcc)[_0x2751('0x14')]();});}};}function handleEntityNotFound(_0x3259aa,_0x30b3a2){return function(_0x2fdd26){if(!_0x2fdd26){_0x3259aa[_0x2751('0x21')](0x194);}return _0x2fdd26;};}function handleError(_0x25cbef,_0x30a39c){_0x30a39c=_0x30a39c||0x1f4;return function(_0x1bdd95){logger['error'](_0x1bdd95[_0x2751('0x22')]);if(_0x1bdd95[_0x2751('0x23')]){delete _0x1bdd95[_0x2751('0x23')];}_0x25cbef['status'](_0x30a39c)[_0x2751('0x24')](_0x1bdd95);};}exports[_0x2751('0x25')]=function(_0x1dc0f2,_0x3d4a78){var _0xbbf30d={},_0x345df1={},_0x20829e={'count':0x0,'rows':[]};var _0x4b5667=db[_0x2751('0x26')][_0x2751('0x27')];_0x345df1[_0x2751('0x28')]=_[_0x2751('0x29')](_0x4b5667);_0x345df1[_0x2751('0x2a')]=_['keys'](_0x1dc0f2[_0x2751('0x2a')]);_0x345df1[_0x2751('0x2b')]=_[_0x2751('0x2c')](_0x345df1[_0x2751('0x28')],_0x345df1['query']);_0xbbf30d['attributes']=_[_0x2751('0x2c')](_0x345df1[_0x2751('0x28')],qs[_0x2751('0x2d')](_0x1dc0f2[_0x2751('0x2a')][_0x2751('0x2d')]));_0xbbf30d['attributes']=_0xbbf30d[_0x2751('0x2e')][_0x2751('0x2f')]?_0xbbf30d[_0x2751('0x2e')]:_0x345df1['model'];if(!_0x1dc0f2[_0x2751('0x2a')][_0x2751('0x30')]('nolimit')){_0xbbf30d['limit']=qs[_0x2751('0x18')](_0x1dc0f2[_0x2751('0x2a')]['limit']);_0xbbf30d[_0x2751('0x17')]=qs[_0x2751('0x17')](_0x1dc0f2[_0x2751('0x2a')]['offset']);}_0xbbf30d[_0x2751('0x31')]=qs[_0x2751('0x32')](_0x1dc0f2[_0x2751('0x2a')][_0x2751('0x32')]);_0xbbf30d[_0x2751('0x33')]=qs[_0x2751('0x2b')](_[_0x2751('0x34')](_0x1dc0f2[_0x2751('0x2a')],_0x345df1[_0x2751('0x2b')]));if(_0x1dc0f2[_0x2751('0x2a')][_0x2751('0x35')]){_0xbbf30d['where']=_[_0x2751('0x36')](_0xbbf30d['where'],{'$or':_[_0x2751('0x37')](_0x4b5667,function(_0x3ad849){if(_0x3ad849[_0x2751('0x38')][_0x2751('0x39')]!=='VIRTUAL'){var _0x2030e0={};_0x2030e0[_0x3ad849[_0x2751('0x3a')]]={'$like':'%'+_0x1dc0f2[_0x2751('0x2a')][_0x2751('0x35')]+'%'};return _0x2030e0;}})});}_0xbbf30d=_[_0x2751('0x36')]({},_0xbbf30d,_0x1dc0f2[_0x2751('0x3b')]);var _0x3a5162={'where':_0xbbf30d['where']};return db['Integration'][_0x2751('0x16')](_0x3a5162)['then'](function(_0xcc6304){_0x20829e[_0x2751('0x16')]=_0xcc6304;if(_0x1dc0f2[_0x2751('0x2a')][_0x2751('0x3c')]){_0xbbf30d[_0x2751('0x3d')]=[{'all':!![]}];}return db[_0x2751('0x26')][_0x2751('0x3e')](_0xbbf30d);})[_0x2751('0x1f')](function(_0x5dfab1){_0x20829e[_0x2751('0x3f')]=_0x5dfab1;return _0x20829e;})[_0x2751('0x1f')](respondWithFilteredResult(_0x3d4a78,_0xbbf30d))[_0x2751('0x40')](handleError(_0x3d4a78,null));};exports[_0x2751('0x41')]=function(_0x5579fa,_0x3cb814){var _0x3f76fb={'raw':![],'where':{'id':_0x5579fa[_0x2751('0x42')]['id']}},_0x578985={};_0x578985[_0x2751('0x28')]=_[_0x2751('0x29')](db[_0x2751('0x26')][_0x2751('0x27')]);_0x578985[_0x2751('0x2a')]=_[_0x2751('0x29')](_0x5579fa[_0x2751('0x2a')]);_0x578985[_0x2751('0x2b')]=_[_0x2751('0x2c')](_0x578985[_0x2751('0x28')],_0x578985[_0x2751('0x2a')]);_0x3f76fb[_0x2751('0x2e')]=_[_0x2751('0x2c')](_0x578985[_0x2751('0x28')],qs[_0x2751('0x2d')](_0x5579fa['query'][_0x2751('0x2d')]));_0x3f76fb[_0x2751('0x2e')]=_0x3f76fb['attributes'][_0x2751('0x2f')]?_0x3f76fb[_0x2751('0x2e')]:_0x578985[_0x2751('0x28')];if(_0x5579fa[_0x2751('0x2a')][_0x2751('0x3c')]){_0x3f76fb['include']=[{'all':!![]}];}_0x3f76fb=_['merge']({},_0x3f76fb,_0x5579fa[_0x2751('0x3b')]);return db[_0x2751('0x26')][_0x2751('0x43')](_0x3f76fb)['then'](handleEntityNotFound(_0x3cb814,null))['then'](respondWithResult(_0x3cb814,null))[_0x2751('0x40')](handleError(_0x3cb814,null));};exports[_0x2751('0x44')]=function(_0x151927,_0x30b578){return db[_0x2751('0x26')][_0x2751('0x44')](_0x151927[_0x2751('0x45')],{})['then'](respondWithResult(_0x30b578,0xc9))[_0x2751('0x40')](handleError(_0x30b578,null));};exports[_0x2751('0x1e')]=function(_0x35fab9,_0x26e9cf){if(_0x35fab9['body']['id']){delete _0x35fab9[_0x2751('0x45')]['id'];}return db[_0x2751('0x26')][_0x2751('0x43')]({'where':{'id':_0x35fab9[_0x2751('0x42')]['id']}})[_0x2751('0x1f')](handleEntityNotFound(_0x26e9cf,null))[_0x2751('0x1f')](saveUpdates(_0x35fab9['body'],null))[_0x2751('0x1f')](respondWithResult(_0x26e9cf,null))[_0x2751('0x40')](handleError(_0x26e9cf,null));};exports[_0x2751('0x20')]=function(_0x34d8fa,_0x1241d4){return db[_0x2751('0x26')]['find']({'where':{'id':_0x34d8fa['params']['id']}})[_0x2751('0x1f')](handleEntityNotFound(_0x1241d4,null))[_0x2751('0x1f')](removeEntity(_0x1241d4,null))['catch'](handleError(_0x1241d4,null));}; \ No newline at end of file +var _0x6360=['findAll','rows','show','params','intersection','length','includeAll','find','catch','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','Integration','rawAttributes','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','type','field','options','count','include'];(function(_0xaff616,_0x5c9424){var _0x3aa4c0=function(_0x2b6448){while(--_0x2b6448){_0xaff616['push'](_0xaff616['shift']());}};_0x3aa4c0(++_0x5c9424);}(_0x6360,0x1e7));var _0x0636=function(_0x3aedac,_0x2f4b1c){_0x3aedac=_0x3aedac-0x0;var _0x55e636=_0x6360[_0x3aedac];return _0x55e636;};'use strict';var pdf=require(_0x0636('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0636('0x1'));var jsonpatch=require(_0x0636('0x2'));var rp=require(_0x0636('0x3'));var moment=require(_0x0636('0x4'));var BPromise=require(_0x0636('0x5'));var Mustache=require(_0x0636('0x6'));var util=require('util');var path=require(_0x0636('0x7'));var sox=require(_0x0636('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0636('0x9'));var jsforce=require(_0x0636('0xa'));var deskjs=require(_0x0636('0xb'));var toCsv=require(_0x0636('0xc'));var querystring=require('querystring');var Papa=require(_0x0636('0xd'));var Redis=require(_0x0636('0xe'));var authService=require(_0x0636('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0636('0x10'));var logger=require(_0x0636('0x11'))('api');var utils=require(_0x0636('0x12'));var config=require(_0x0636('0x13'));var db=require(_0x0636('0x14'))['db'];function respondWithStatusCode(_0x1628fc,_0xca3042){_0xca3042=_0xca3042||0xcc;return function(_0xd39956){if(_0xd39956){return _0x1628fc['sendStatus'](_0xca3042);}return _0x1628fc[_0x0636('0x15')](_0xca3042)['end']();};}function respondWithResult(_0x52593a,_0x15137c){_0x15137c=_0x15137c||0xc8;return function(_0x378ec8){if(_0x378ec8){return _0x52593a['status'](_0x15137c)[_0x0636('0x16')](_0x378ec8);}};}function respondWithFilteredResult(_0xc40a80,_0x2ef41f){return function(_0xb795ca){if(_0xb795ca){var _0x52fe36=_0xb795ca['count'],_0x258fb0=_0x2ef41f[_0x0636('0x17')],_0x5dd798=_0x2ef41f['offset']+_0x2ef41f[_0x0636('0x18')],_0x25b06c;if(_0x5dd798>=_0x52fe36){_0x5dd798=_0x52fe36;_0x25b06c=0xc8;}else{_0x25b06c=0xce;}_0xc40a80[_0x0636('0x15')](_0x25b06c);return _0xc40a80[_0x0636('0x19')](_0x0636('0x1a'),_0x258fb0+'-'+_0x5dd798+'/'+_0x52fe36)[_0x0636('0x16')](_0xb795ca);}return null;};}function patchUpdates(_0x56707a){return function(_0x587c73){try{jsonpatch['apply'](_0x587c73,_0x56707a,!![]);}catch(_0x5222ef){return BPromise[_0x0636('0x1b')](_0x5222ef);}return _0x587c73[_0x0636('0x1c')]();};}function saveUpdates(_0x3c524d,_0x1ccc10){return function(_0xde55d2){if(_0xde55d2){return _0xde55d2[_0x0636('0x1d')](_0x3c524d)[_0x0636('0x1e')](function(_0x25dae3){return _0x25dae3;});}return null;};}function removeEntity(_0x472c41,_0xcaa884){return function(_0x5c7b79){if(_0x5c7b79){return _0x5c7b79[_0x0636('0x1f')]()[_0x0636('0x1e')](function(){_0x472c41[_0x0636('0x15')](0xcc)[_0x0636('0x20')]();});}};}function handleEntityNotFound(_0x5e194b,_0x304888){return function(_0x9897df){if(!_0x9897df){_0x5e194b[_0x0636('0x21')](0x194);}return _0x9897df;};}function handleError(_0x23b700,_0x2d3b96){_0x2d3b96=_0x2d3b96||0x1f4;return function(_0x4e18b8){logger['error'](_0x4e18b8[_0x0636('0x22')]);if(_0x4e18b8[_0x0636('0x23')]){delete _0x4e18b8['name'];}_0x23b700[_0x0636('0x15')](_0x2d3b96)[_0x0636('0x24')](_0x4e18b8);};}exports[_0x0636('0x25')]=function(_0x618a59,_0x5383fe){var _0x5703f7={},_0xf8c860={},_0x91a001={'count':0x0,'rows':[]};var _0x15bf2a=db[_0x0636('0x26')][_0x0636('0x27')];_0xf8c860[_0x0636('0x28')]=_['keys'](_0x15bf2a);_0xf8c860['query']=_[_0x0636('0x29')](_0x618a59[_0x0636('0x2a')]);_0xf8c860[_0x0636('0x2b')]=_['intersection'](_0xf8c860[_0x0636('0x28')],_0xf8c860[_0x0636('0x2a')]);_0x5703f7['attributes']=_['intersection'](_0xf8c860[_0x0636('0x28')],qs[_0x0636('0x2c')](_0x618a59[_0x0636('0x2a')][_0x0636('0x2c')]));_0x5703f7[_0x0636('0x2d')]=_0x5703f7[_0x0636('0x2d')]['length']?_0x5703f7[_0x0636('0x2d')]:_0xf8c860[_0x0636('0x28')];if(!_0x618a59[_0x0636('0x2a')][_0x0636('0x2e')](_0x0636('0x2f'))){_0x5703f7[_0x0636('0x18')]=qs[_0x0636('0x18')](_0x618a59[_0x0636('0x2a')][_0x0636('0x18')]);_0x5703f7[_0x0636('0x17')]=qs[_0x0636('0x17')](_0x618a59[_0x0636('0x2a')][_0x0636('0x17')]);}_0x5703f7['order']=qs['sort'](_0x618a59['query']['sort']);_0x5703f7[_0x0636('0x30')]=qs[_0x0636('0x2b')](_[_0x0636('0x31')](_0x618a59[_0x0636('0x2a')],_0xf8c860[_0x0636('0x2b')]));if(_0x618a59[_0x0636('0x2a')][_0x0636('0x32')]){_0x5703f7[_0x0636('0x30')]=_[_0x0636('0x33')](_0x5703f7['where'],{'$or':_['map'](_0x15bf2a,function(_0x13dd22){if(_0x13dd22[_0x0636('0x34')]['key']!=='VIRTUAL'){var _0x330268={};_0x330268[_0x13dd22[_0x0636('0x35')]]={'$like':'%'+_0x618a59[_0x0636('0x2a')]['filter']+'%'};return _0x330268;}})});}_0x5703f7=_[_0x0636('0x33')]({},_0x5703f7,_0x618a59[_0x0636('0x36')]);var _0x323807={'where':_0x5703f7[_0x0636('0x30')]};return db[_0x0636('0x26')][_0x0636('0x37')](_0x323807)['then'](function(_0x3061aa){_0x91a001['count']=_0x3061aa;if(_0x618a59[_0x0636('0x2a')]['includeAll']){_0x5703f7[_0x0636('0x38')]=[{'all':!![]}];}return db['Integration'][_0x0636('0x39')](_0x5703f7);})[_0x0636('0x1e')](function(_0x223161){_0x91a001[_0x0636('0x3a')]=_0x223161;return _0x91a001;})[_0x0636('0x1e')](respondWithFilteredResult(_0x5383fe,_0x5703f7))['catch'](handleError(_0x5383fe,null));};exports[_0x0636('0x3b')]=function(_0x3607ea,_0x562af6){var _0x4e90c0={'raw':![],'where':{'id':_0x3607ea[_0x0636('0x3c')]['id']}},_0xc30c0e={};_0xc30c0e[_0x0636('0x28')]=_[_0x0636('0x29')](db[_0x0636('0x26')][_0x0636('0x27')]);_0xc30c0e[_0x0636('0x2a')]=_[_0x0636('0x29')](_0x3607ea[_0x0636('0x2a')]);_0xc30c0e[_0x0636('0x2b')]=_[_0x0636('0x3d')](_0xc30c0e[_0x0636('0x28')],_0xc30c0e[_0x0636('0x2a')]);_0x4e90c0[_0x0636('0x2d')]=_[_0x0636('0x3d')](_0xc30c0e[_0x0636('0x28')],qs[_0x0636('0x2c')](_0x3607ea[_0x0636('0x2a')]['fields']));_0x4e90c0[_0x0636('0x2d')]=_0x4e90c0['attributes'][_0x0636('0x3e')]?_0x4e90c0[_0x0636('0x2d')]:_0xc30c0e[_0x0636('0x28')];if(_0x3607ea[_0x0636('0x2a')][_0x0636('0x3f')]){_0x4e90c0[_0x0636('0x38')]=[{'all':!![]}];}_0x4e90c0=_['merge']({},_0x4e90c0,_0x3607ea[_0x0636('0x36')]);return db[_0x0636('0x26')][_0x0636('0x40')](_0x4e90c0)[_0x0636('0x1e')](handleEntityNotFound(_0x562af6,null))[_0x0636('0x1e')](respondWithResult(_0x562af6,null))[_0x0636('0x41')](handleError(_0x562af6,null));};exports[_0x0636('0x42')]=function(_0x56c21c,_0x531fae){return db[_0x0636('0x26')][_0x0636('0x42')](_0x56c21c[_0x0636('0x43')],{})['then'](respondWithResult(_0x531fae,0xc9))[_0x0636('0x41')](handleError(_0x531fae,null));};exports[_0x0636('0x1d')]=function(_0x501e75,_0x40fa10){if(_0x501e75['body']['id']){delete _0x501e75['body']['id'];}return db[_0x0636('0x26')][_0x0636('0x40')]({'where':{'id':_0x501e75[_0x0636('0x3c')]['id']}})[_0x0636('0x1e')](handleEntityNotFound(_0x40fa10,null))[_0x0636('0x1e')](saveUpdates(_0x501e75['body'],null))[_0x0636('0x1e')](respondWithResult(_0x40fa10,null))[_0x0636('0x41')](handleError(_0x40fa10,null));};exports[_0x0636('0x1f')]=function(_0x594e77,_0xc1780a){return db['Integration'][_0x0636('0x40')]({'where':{'id':_0x594e77[_0x0636('0x3c')]['id']}})['then'](handleEntityNotFound(_0xc1780a,null))['then'](removeEntity(_0xc1780a,null))[_0x0636('0x41')](handleError(_0xc1780a,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 869db52..a9caf81 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 _0x8bfa=['./integration.attributes','define','Integration','integrations','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x268fca,_0x419926){var _0x1b8d1e=function(_0x39f14e){while(--_0x39f14e){_0x268fca['push'](_0x268fca['shift']());}};_0x1b8d1e(++_0x419926);}(_0x8bfa,0x16f));var _0xa8bf=function(_0xc02211,_0x39040b){_0xc02211=_0xc02211-0x0;var _0x2f4910=_0x8bfa[_0xc02211];return _0x2f4910;};'use strict';var _=require('lodash');var util=require(_0xa8bf('0x0'));var logger=require('../../config/logger')(_0xa8bf('0x1'));var moment=require(_0xa8bf('0x2'));var BPromise=require(_0xa8bf('0x3'));var rp=require(_0xa8bf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa8bf('0x5'));var config=require(_0xa8bf('0x6'));var attributes=require(_0xa8bf('0x7'));module['exports']=function(_0x19b4d5,_0x392ed1){return _0x19b4d5[_0xa8bf('0x8')](_0xa8bf('0x9'),attributes,{'tableName':_0xa8bf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb70=['../../config/environment','./integration.attributes','exports','define','Integration','util','api','request-promise','path','rimraf'];(function(_0x3fc048,_0x583e90){var _0x863355=function(_0x5b4c3e){while(--_0x5b4c3e){_0x3fc048['push'](_0x3fc048['shift']());}};_0x863355(++_0x583e90);}(_0xbb70,0x7d));var _0x0bb7=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xbb70[_0x46d0c9];return _0x174506;};'use strict';var _=require('lodash');var util=require(_0x0bb7('0x0'));var logger=require('../../config/logger')(_0x0bb7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0bb7('0x2'));var fs=require('fs');var path=require(_0x0bb7('0x3'));var rimraf=require(_0x0bb7('0x4'));var config=require(_0x0bb7('0x5'));var attributes=require(_0x0bb7('0x6'));module[_0x0bb7('0x7')]=function(_0x13113c,_0x2530fc){return _0x13113c[_0x0bb7('0x8')](_0x0bb7('0x9'),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 5ef57d8..36a8e2b 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 _0xde65=['../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x347908,_0x5a466d){var _0xbbdc18=function(_0x25dc46){while(--_0x25dc46){_0x347908['push'](_0x347908['shift']());}};_0xbbdc18(++_0x5a466d);}(_0xde65,0x1c4));var _0x5de6=function(_0x1eba81,_0x3e6c97){_0x1eba81=_0x1eba81-0x0;var _0x346f3d=_0xde65[_0x1eba81];return _0x346f3d;};'use strict';var _=require(_0x5de6('0x0'));var util=require(_0x5de6('0x1'));var moment=require('moment');var BPromise=require(_0x5de6('0x2'));var rs=require(_0x5de6('0x3'));var fs=require('fs');var Redis=require(_0x5de6('0x4'));var db=require(_0x5de6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5de6('0x6'))(_0x5de6('0x7'));var config=require(_0x5de6('0x8'));var jayson=require(_0x5de6('0x9'));var client=jayson[_0x5de6('0xa')][_0x5de6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x324300,_0x2d18e0,_0x1d3504){return new BPromise(function(_0x9354b,_0x5156f3){return client[_0x5de6('0xc')](_0x324300,_0x1d3504)['then'](function(_0x141147){logger[_0x5de6('0xd')](_0x5de6('0xe'),_0x2d18e0,'request\x20sent');logger[_0x5de6('0xf')](_0x5de6('0x10'),_0x2d18e0,_0x5de6('0x11'),JSON[_0x5de6('0x12')](_0x141147));if(_0x141147['error']){if(_0x141147[_0x5de6('0x13')][_0x5de6('0x14')]===0x1f4){logger[_0x5de6('0x13')](_0x5de6('0xe'),_0x2d18e0,_0x141147[_0x5de6('0x13')]['message']);return _0x5156f3(_0x141147[_0x5de6('0x13')][_0x5de6('0x15')]);}logger[_0x5de6('0x13')](_0x5de6('0xe'),_0x2d18e0,_0x141147[_0x5de6('0x13')][_0x5de6('0x15')]);return _0x9354b(_0x141147[_0x5de6('0x13')][_0x5de6('0x15')]);}else{logger[_0x5de6('0xd')](_0x5de6('0xe'),_0x2d18e0,'request\x20sent');_0x9354b(_0x141147['result'][_0x5de6('0x15')]);}})[_0x5de6('0x16')](function(_0x4decfe){logger[_0x5de6('0x13')](_0x5de6('0xe'),_0x2d18e0,_0x4decfe);_0x5156f3(_0x4decfe);});});} \ No newline at end of file +var _0x6919=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x6919,0x1a9));var _0x9691=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0x6919[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require('lodash');var util=require(_0x9691('0x0'));var moment=require(_0x9691('0x1'));var BPromise=require(_0x9691('0x2'));var rs=require(_0x9691('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9691('0x4'))['db'];var utils=require(_0x9691('0x5'));var logger=require(_0x9691('0x6'))(_0x9691('0x7'));var config=require(_0x9691('0x8'));var jayson=require(_0x9691('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x146fda,_0x236c85,_0x362db0){return new BPromise(function(_0x5d4283,_0x2b54a8){return client[_0x9691('0xa')](_0x146fda,_0x362db0)[_0x9691('0xb')](function(_0x46b665){logger[_0x9691('0xc')](_0x9691('0xd'),_0x236c85,'request\x20sent');logger[_0x9691('0xe')](_0x9691('0xf'),_0x236c85,_0x9691('0x10'),JSON[_0x9691('0x11')](_0x46b665));if(_0x46b665[_0x9691('0x12')]){if(_0x46b665[_0x9691('0x12')][_0x9691('0x13')]===0x1f4){logger['error'](_0x9691('0xd'),_0x236c85,_0x46b665[_0x9691('0x12')][_0x9691('0x14')]);return _0x2b54a8(_0x46b665[_0x9691('0x12')]['message']);}logger[_0x9691('0x12')](_0x9691('0xd'),_0x236c85,_0x46b665[_0x9691('0x12')]['message']);return _0x5d4283(_0x46b665[_0x9691('0x12')][_0x9691('0x14')]);}else{logger[_0x9691('0xc')]('Integration,\x20%s,\x20%s',_0x236c85,_0x9691('0x10'));_0x5d4283(_0x46b665[_0x9691('0x15')][_0x9691('0x14')]);}})[_0x9691('0x16')](function(_0x36a9e4){logger[_0x9691('0x12')](_0x9691('0xd'),_0x236c85,_0x36a9e4);_0x2b54a8(_0x36a9e4);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d4e568f..f98857f 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 _0x8c4a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','/describe','isAuthenticated','describe','/:id','show','create','update','delete','exports','multer','util','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c4a,0xb0));var _0xa8c4=function(_0x523e98,_0x2be496){_0x523e98=_0x523e98-0x0;var _0x2234ec=_0x8c4a[_0x523e98];return _0x2234ec;};'use strict';var multer=require(_0xa8c4('0x0'));var util=require(_0xa8c4('0x1'));var path=require('path');var timeout=require(_0xa8c4('0x2'));var express=require('express');var router=express[_0xa8c4('0x3')]();var auth=require(_0xa8c4('0x4'));var interaction=require(_0xa8c4('0x5'));var config=require(_0xa8c4('0x6'));var controller=require(_0xa8c4('0x7'));router[_0xa8c4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa8c4('0x8')](_0xa8c4('0x9'),auth[_0xa8c4('0xa')](),controller[_0xa8c4('0xb')]);router['get'](_0xa8c4('0xc'),auth['isAuthenticated'](),controller[_0xa8c4('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa8c4('0xe')]);router['put'](_0xa8c4('0xc'),auth[_0xa8c4('0xa')](),controller[_0xa8c4('0xf')]);router[_0xa8c4('0x10')](_0xa8c4('0xc'),auth[_0xa8c4('0xa')](),controller['destroy']);module[_0xa8c4('0x11')]=router; \ No newline at end of file +var _0x474d=['isAuthenticated','/describe','describe','/:id','show','post','create','put','update','destroy','multer','connect-timeout','express','../../config/environment','./integrationReport.controller','get'];(function(_0x37c836,_0x2a0079){var _0x1b89b1=function(_0x346c19){while(--_0x346c19){_0x37c836['push'](_0x37c836['shift']());}};_0x1b89b1(++_0x2a0079);}(_0x474d,0x13a));var _0xd474=function(_0x2b1d49,_0x57f1c1){_0x2b1d49=_0x2b1d49-0x0;var _0x728b99=_0x474d[_0x2b1d49];return _0x728b99;};'use strict';var multer=require(_0xd474('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd474('0x1'));var express=require(_0xd474('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd474('0x3'));var controller=require(_0xd474('0x4'));router[_0xd474('0x5')]('/',auth[_0xd474('0x6')](),controller['index']);router[_0xd474('0x5')](_0xd474('0x7'),auth['isAuthenticated'](),controller[_0xd474('0x8')]);router[_0xd474('0x5')](_0xd474('0x9'),auth[_0xd474('0x6')](),controller[_0xd474('0xa')]);router[_0xd474('0xb')]('/',auth[_0xd474('0x6')](),controller[_0xd474('0xc')]);router[_0xd474('0xd')](_0xd474('0x9'),auth[_0xd474('0x6')](),controller[_0xd474('0xe')]);router['delete']('/:id',auth[_0xd474('0x6')](),controller[_0xd474('0xf')]);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 23da5b2..281aa8a 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 _0x2a2f=['STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENDING','RECEIVED','sequelize','exports'];(function(_0xafdf47,_0x38b5b3){var _0x1e6c17=function(_0x6f64be){while(--_0x6f64be){_0xafdf47['push'](_0xafdf47['shift']());}};_0x1e6c17(++_0x38b5b3);}(_0x2a2f,0x15c));var _0xf2a2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2a2f[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xf2a2('0x0'));module[_0xf2a2('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xf2a2('0x2')]},'exitStatus':{'type':Sequelize[_0xf2a2('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xf2a2('0x3')]},'contacts':{'type':Sequelize[_0xf2a2('0x2')]},'uniqueid':{'type':Sequelize[_0xf2a2('0x2')]},'calleridnum':{'type':Sequelize[_0xf2a2('0x2')]},'calleridname':{'type':Sequelize[_0xf2a2('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xf2a2('0x2')]},'membername':{'type':Sequelize[_0xf2a2('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xf2a2('0x3')]},'agentcomplete':{'type':Sequelize[_0xf2a2('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf2a2('0x3')]},'reason':{'type':Sequelize[_0xf2a2('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xf2a2('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf2a2('0x5')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xf2a2('0x2')]},'channel':{'type':Sequelize[_0xf2a2('0x2')]},'channelstate':{'type':Sequelize[_0xf2a2('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf2a2('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf2a2('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf2a2('0x2')]},'context':{'type':Sequelize[_0xf2a2('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf2a2('0x2')]},'destchannel':{'type':Sequelize[_0xf2a2('0x2')]},'destchannelstate':{'type':Sequelize[_0xf2a2('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xf2a2('0x2')]},'destcalleridnum':{'type':Sequelize[_0xf2a2('0x2')]},'destcalleridname':{'type':Sequelize[_0xf2a2('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf2a2('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf2a2('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xf2a2('0x2')]},'destcontext':{'type':Sequelize[_0xf2a2('0x2')]},'destexten':{'type':Sequelize[_0xf2a2('0x2')]},'destpriority':{'type':Sequelize[_0xf2a2('0x2')]},'destuniqueid':{'type':Sequelize[_0xf2a2('0x2')]},'messageId':{'type':Sequelize[_0xf2a2('0x2')]},'inReplyTo':{'type':Sequelize[_0xf2a2('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xf2a2('0x2')]},'to':{'type':Sequelize[_0xf2a2('0x2')]},'cc':{'type':Sequelize[_0xf2a2('0x2')]},'attachment':{'type':Sequelize[_0xf2a2('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xf2a2('0x6')]},'status':{'type':Sequelize[_0xf2a2('0x7')]('SENT',_0xf2a2('0x8'),_0xf2a2('0x9'),'FAILED')},'url':{'type':Sequelize[_0xf2a2('0x2')]},'app':{'type':Sequelize[_0xf2a2('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xf2a2('0x3')]}}; \ No newline at end of file +var _0xff77=['INTEGER','BOOLEAN','TEXT','SENT','FAILED','sequelize','exports','STRING','DATE'];(function(_0x581617,_0x164cdc){var _0x635776=function(_0x3b8cc6){while(--_0x3b8cc6){_0x581617['push'](_0x581617['shift']());}};_0x635776(++_0x164cdc);}(_0xff77,0x191));var _0x7ff7=function(_0x1a1774,_0x4d5efa){_0x1a1774=_0x1a1774-0x0;var _0x9bf800=_0xff77[_0x1a1774];return _0x9bf800;};'use strict';var Sequelize=require(_0x7ff7('0x0'));module[_0x7ff7('0x1')]={'integration':{'type':Sequelize[_0x7ff7('0x2')]},'eventChannel':{'type':Sequelize[_0x7ff7('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x7ff7('0x2')]},'uniqueid':{'type':Sequelize[_0x7ff7('0x2')]},'calleridnum':{'type':Sequelize[_0x7ff7('0x2')]},'calleridname':{'type':Sequelize[_0x7ff7('0x2')]},'queue':{'type':Sequelize[_0x7ff7('0x2')]},'interface':{'type':Sequelize[_0x7ff7('0x2')]},'membername':{'type':Sequelize[_0x7ff7('0x2')]},'agentcalledAt':{'type':Sequelize[_0x7ff7('0x3')]},'agentconnectAt':{'type':Sequelize[_0x7ff7('0x3')]},'holdtime':{'type':Sequelize[_0x7ff7('0x4')]},'agentcomplete':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7ff7('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7ff7('0x4')]},'reason':{'type':Sequelize[_0x7ff7('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7ff7('0x3')]},'agentdump':{'type':Sequelize[_0x7ff7('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7ff7('0x3')]},'lastevent':{'type':Sequelize[_0x7ff7('0x2')]},'channel':{'type':Sequelize[_0x7ff7('0x2')]},'channelstate':{'type':Sequelize[_0x7ff7('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x7ff7('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x7ff7('0x2')]},'context':{'type':Sequelize[_0x7ff7('0x2')]},'exten':{'type':Sequelize[_0x7ff7('0x2')]},'priority':{'type':Sequelize[_0x7ff7('0x2')]},'destchannel':{'type':Sequelize[_0x7ff7('0x2')]},'destchannelstate':{'type':Sequelize[_0x7ff7('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x7ff7('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7ff7('0x2')]},'destcalleridname':{'type':Sequelize[_0x7ff7('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7ff7('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7ff7('0x2')]},'destcontext':{'type':Sequelize[_0x7ff7('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x7ff7('0x2')]},'inReplyTo':{'type':Sequelize[_0x7ff7('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x7ff7('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x7ff7('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x7ff7('0x6')]},'text':{'type':Sequelize[_0x7ff7('0x6')]},'status':{'type':Sequelize['ENUM'](_0x7ff7('0x7'),'SENDING','RECEIVED',_0x7ff7('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x7ff7('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x7ff7('0x4')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 68614f0..d571429 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 _0x705f=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','then','destroy','stack','send','rawAttributes','model','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','map','key','field','merge','IntegrationReport','includeAll','include','rows','catch','show','options','create','body','update','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','../../components/auth/service'];(function(_0x15d386,_0x30c0a4){var _0x12db16=function(_0x124a03){while(--_0x124a03){_0x15d386['push'](_0x15d386['shift']());}};_0x12db16(++_0x30c0a4);}(_0x705f,0x75));var _0xf705=function(_0x5f8000,_0x4a56b1){_0x5f8000=_0x5f8000-0x0;var _0xc8f261=_0x705f[_0x5f8000];return _0xc8f261;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf705('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf705('0x1'));var rp=require(_0xf705('0x2'));var moment=require(_0xf705('0x3'));var BPromise=require(_0xf705('0x4'));var Mustache=require(_0xf705('0x5'));var util=require(_0xf705('0x6'));var path=require(_0xf705('0x7'));var sox=require(_0xf705('0x8'));var csv=require(_0xf705('0x9'));var ejs=require(_0xf705('0xa'));var fs=require('fs');var _=require(_0xf705('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf705('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf705('0x9'));var querystring=require(_0xf705('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf705('0xe'));var qs=require(_0xf705('0xf'));var hardwareService=require(_0xf705('0x10'));var logger=require(_0xf705('0x11'))(_0xf705('0x12'));var utils=require(_0xf705('0x13'));var config=require(_0xf705('0x14'));var db=require(_0xf705('0x15'))['db'];function respondWithStatusCode(_0x4a92bb,_0x221589){_0x221589=_0x221589||0xcc;return function(_0x296a62){if(_0x296a62){return _0x4a92bb[_0xf705('0x16')](_0x221589);}return _0x4a92bb[_0xf705('0x17')](_0x221589)[_0xf705('0x18')]();};}function respondWithResult(_0x4ee865,_0x57a7bc){_0x57a7bc=_0x57a7bc||0xc8;return function(_0x26cb9a){if(_0x26cb9a){return _0x4ee865[_0xf705('0x17')](_0x57a7bc)[_0xf705('0x19')](_0x26cb9a);}};}function respondWithFilteredResult(_0x15ab66,_0x57d132){return function(_0x9c7b75){if(_0x9c7b75){var _0x23a64b=_0x9c7b75[_0xf705('0x1a')],_0x4555a8=_0x57d132['offset'],_0x32f48b=_0x57d132[_0xf705('0x1b')]+_0x57d132[_0xf705('0x1c')],_0x572efc;if(_0x32f48b>=_0x23a64b){_0x32f48b=_0x23a64b;_0x572efc=0xc8;}else{_0x572efc=0xce;}_0x15ab66['status'](_0x572efc);return _0x15ab66[_0xf705('0x1d')]('Content-Range',_0x4555a8+'-'+_0x32f48b+'/'+_0x23a64b)[_0xf705('0x19')](_0x9c7b75);}return null;};}function patchUpdates(_0x5c05ae){return function(_0x57d537){try{jsonpatch[_0xf705('0x1e')](_0x57d537,_0x5c05ae,!![]);}catch(_0xfee2a8){return BPromise[_0xf705('0x1f')](_0xfee2a8);}return _0x57d537['save']();};}function saveUpdates(_0x32597e,_0x7e27b4){return function(_0x8d5b49){if(_0x8d5b49){return _0x8d5b49['update'](_0x32597e)[_0xf705('0x20')](function(_0x4d34cd){return _0x4d34cd;});}return null;};}function removeEntity(_0x4b5724,_0x2fb99e){return function(_0x1052a6){if(_0x1052a6){return _0x1052a6[_0xf705('0x21')]()[_0xf705('0x20')](function(){_0x4b5724[_0xf705('0x17')](0xcc)[_0xf705('0x18')]();});}};}function handleEntityNotFound(_0xcab54f,_0x10dfc9){return function(_0x424d4e){if(!_0x424d4e){_0xcab54f[_0xf705('0x16')](0x194);}return _0x424d4e;};}function handleError(_0x2b5717,_0x55f5b9){_0x55f5b9=_0x55f5b9||0x1f4;return function(_0x1bb7f8){logger['error'](_0x1bb7f8[_0xf705('0x22')]);if(_0x1bb7f8['name']){delete _0x1bb7f8['name'];}_0x2b5717[_0xf705('0x17')](_0x55f5b9)[_0xf705('0x23')](_0x1bb7f8);};}exports['index']=function(_0x4f5435,_0x2caf6e){var _0xcf86d6={},_0x1c265f={},_0xabee0={'count':0x0,'rows':[]};var _0x2cd45c=db['IntegrationReport'][_0xf705('0x24')];_0x1c265f[_0xf705('0x25')]=_[_0xf705('0x26')](_0x2cd45c);_0x1c265f['query']=_['keys'](_0x4f5435['query']);_0x1c265f['filters']=_[_0xf705('0x27')](_0x1c265f['model'],_0x1c265f['query']);_0xcf86d6[_0xf705('0x28')]=_[_0xf705('0x27')](_0x1c265f[_0xf705('0x25')],qs[_0xf705('0x29')](_0x4f5435[_0xf705('0x2a')]['fields']));_0xcf86d6['attributes']=_0xcf86d6[_0xf705('0x28')][_0xf705('0x2b')]?_0xcf86d6[_0xf705('0x28')]:_0x1c265f[_0xf705('0x25')];if(!_0x4f5435[_0xf705('0x2a')][_0xf705('0x2c')](_0xf705('0x2d'))){_0xcf86d6[_0xf705('0x1c')]=qs['limit'](_0x4f5435[_0xf705('0x2a')]['limit']);_0xcf86d6[_0xf705('0x1b')]=qs['offset'](_0x4f5435[_0xf705('0x2a')][_0xf705('0x1b')]);}_0xcf86d6[_0xf705('0x2e')]=qs[_0xf705('0x2f')](_0x4f5435[_0xf705('0x2a')][_0xf705('0x2f')]);_0xcf86d6[_0xf705('0x30')]=qs['filters'](_[_0xf705('0x31')](_0x4f5435[_0xf705('0x2a')],_0x1c265f[_0xf705('0x32')]));if(_0x4f5435['query']['filter']){_0xcf86d6[_0xf705('0x30')]=_['merge'](_0xcf86d6[_0xf705('0x30')],{'$or':_[_0xf705('0x33')](_0x2cd45c,function(_0x15b6fa){if(_0x15b6fa['type'][_0xf705('0x34')]!=='VIRTUAL'){var _0x5ba49b={};_0x5ba49b[_0x15b6fa[_0xf705('0x35')]]={'$like':'%'+_0x4f5435[_0xf705('0x2a')]['filter']+'%'};return _0x5ba49b;}})});}_0xcf86d6=_[_0xf705('0x36')]({},_0xcf86d6,_0x4f5435['options']);var _0x34a5bd={'where':_0xcf86d6[_0xf705('0x30')]};return db[_0xf705('0x37')][_0xf705('0x1a')](_0x34a5bd)[_0xf705('0x20')](function(_0x353218){_0xabee0['count']=_0x353218;if(_0x4f5435[_0xf705('0x2a')][_0xf705('0x38')]){_0xcf86d6[_0xf705('0x39')]=[{'all':!![]}];}return db[_0xf705('0x37')]['findAll'](_0xcf86d6);})['then'](function(_0x3b02f7){_0xabee0[_0xf705('0x3a')]=_0x3b02f7;return _0xabee0;})['then'](respondWithFilteredResult(_0x2caf6e,_0xcf86d6))[_0xf705('0x3b')](handleError(_0x2caf6e,null));};exports[_0xf705('0x3c')]=function(_0x10e28b,_0x58cac8){var _0x339bbb={'raw':![],'where':{'id':_0x10e28b['params']['id']}},_0x3ad113={};_0x3ad113[_0xf705('0x25')]=_[_0xf705('0x26')](db[_0xf705('0x37')][_0xf705('0x24')]);_0x3ad113[_0xf705('0x2a')]=_[_0xf705('0x26')](_0x10e28b[_0xf705('0x2a')]);_0x3ad113[_0xf705('0x32')]=_[_0xf705('0x27')](_0x3ad113[_0xf705('0x25')],_0x3ad113[_0xf705('0x2a')]);_0x339bbb['attributes']=_['intersection'](_0x3ad113['model'],qs[_0xf705('0x29')](_0x10e28b[_0xf705('0x2a')][_0xf705('0x29')]));_0x339bbb['attributes']=_0x339bbb[_0xf705('0x28')][_0xf705('0x2b')]?_0x339bbb[_0xf705('0x28')]:_0x3ad113[_0xf705('0x25')];if(_0x10e28b[_0xf705('0x2a')][_0xf705('0x38')]){_0x339bbb['include']=[{'all':!![]}];}_0x339bbb=_['merge']({},_0x339bbb,_0x10e28b[_0xf705('0x3d')]);return db[_0xf705('0x37')]['find'](_0x339bbb)[_0xf705('0x20')](handleEntityNotFound(_0x58cac8,null))[_0xf705('0x20')](respondWithResult(_0x58cac8,null))[_0xf705('0x3b')](handleError(_0x58cac8,null));};exports[_0xf705('0x3e')]=function(_0x566406,_0x3f3f72){return db[_0xf705('0x37')]['create'](_0x566406[_0xf705('0x3f')],{})[_0xf705('0x20')](respondWithResult(_0x3f3f72,0xc9))[_0xf705('0x3b')](handleError(_0x3f3f72,null));};exports[_0xf705('0x40')]=function(_0x26867a,_0xec113){if(_0x26867a[_0xf705('0x3f')]['id']){delete _0x26867a[_0xf705('0x3f')]['id'];}return db[_0xf705('0x37')]['find']({'where':{'id':_0x26867a['params']['id']}})[_0xf705('0x20')](handleEntityNotFound(_0xec113,null))[_0xf705('0x20')](saveUpdates(_0x26867a['body'],null))[_0xf705('0x20')](respondWithResult(_0xec113,null))[_0xf705('0x3b')](handleError(_0xec113,null));};exports[_0xf705('0x21')]=function(_0x2c6861,_0x99c560){return db[_0xf705('0x37')]['find']({'where':{'id':_0x2c6861['params']['id']}})['then'](handleEntityNotFound(_0x99c560,null))[_0xf705('0x20')](removeEntity(_0x99c560,null))[_0xf705('0x3b')](handleError(_0x99c560,null));};exports[_0xf705('0x41')]=function(_0x48f54f,_0x20c7a3){return db[_0xf705('0x37')][_0xf705('0x41')]()['then'](respondWithResult(_0x20c7a3,null))['catch'](handleError(_0x20c7a3,null));}; \ No newline at end of file +var _0x4c71=['params','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','index','IntegrationReport','rawAttributes','filters','intersection','model','query','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','field','options','include','findAll','rows','catch','keys','includeAll','find','create','body'];(function(_0x29cf6f,_0x2062ac){var _0x5c69d0=function(_0x595ad2){while(--_0x595ad2){_0x29cf6f['push'](_0x29cf6f['shift']());}};_0x5c69d0(++_0x2062ac);}(_0x4c71,0x12b));var _0x14c7=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x4c71[_0x16b9ed];return _0x66b1f8;};'use strict';var pdf=require(_0x14c7('0x0'));var emlformat=require(_0x14c7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x14c7('0x2'));var jsonpatch=require(_0x14c7('0x3'));var rp=require(_0x14c7('0x4'));var moment=require(_0x14c7('0x5'));var BPromise=require(_0x14c7('0x6'));var Mustache=require('mustache');var util=require(_0x14c7('0x7'));var path=require(_0x14c7('0x8'));var sox=require(_0x14c7('0x9'));var csv=require(_0x14c7('0xa'));var ejs=require(_0x14c7('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x14c7('0xc'));var crypto=require(_0x14c7('0xd'));var jsforce=require(_0x14c7('0xe'));var deskjs=require(_0x14c7('0xf'));var toCsv=require(_0x14c7('0xa'));var querystring=require('querystring');var Papa=require(_0x14c7('0x10'));var Redis=require('ioredis');var authService=require(_0x14c7('0x11'));var qs=require(_0x14c7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x14c7('0x13'))(_0x14c7('0x14'));var utils=require(_0x14c7('0x15'));var config=require(_0x14c7('0x16'));var db=require(_0x14c7('0x17'))['db'];function respondWithStatusCode(_0x175835,_0x53f5fa){_0x53f5fa=_0x53f5fa||0xcc;return function(_0x5b3ff2){if(_0x5b3ff2){return _0x175835[_0x14c7('0x18')](_0x53f5fa);}return _0x175835[_0x14c7('0x19')](_0x53f5fa)[_0x14c7('0x1a')]();};}function respondWithResult(_0x268bde,_0x1199a1){_0x1199a1=_0x1199a1||0xc8;return function(_0x3e779f){if(_0x3e779f){return _0x268bde['status'](_0x1199a1)['json'](_0x3e779f);}};}function respondWithFilteredResult(_0x2428bc,_0x34b078){return function(_0x5db054){if(_0x5db054){var _0x5bb4de=_0x5db054[_0x14c7('0x1b')],_0x39c742=_0x34b078[_0x14c7('0x1c')],_0x2929bc=_0x34b078[_0x14c7('0x1c')]+_0x34b078['limit'],_0x1eff6b;if(_0x2929bc>=_0x5bb4de){_0x2929bc=_0x5bb4de;_0x1eff6b=0xc8;}else{_0x1eff6b=0xce;}_0x2428bc[_0x14c7('0x19')](_0x1eff6b);return _0x2428bc[_0x14c7('0x1d')](_0x14c7('0x1e'),_0x39c742+'-'+_0x2929bc+'/'+_0x5bb4de)[_0x14c7('0x1f')](_0x5db054);}return null;};}function patchUpdates(_0x57d383){return function(_0x4c504b){try{jsonpatch[_0x14c7('0x20')](_0x4c504b,_0x57d383,!![]);}catch(_0x3c6ab5){return BPromise[_0x14c7('0x21')](_0x3c6ab5);}return _0x4c504b['save']();};}function saveUpdates(_0x266940,_0xa4ab97){return function(_0x2622b5){if(_0x2622b5){return _0x2622b5[_0x14c7('0x22')](_0x266940)['then'](function(_0x5e1df1){return _0x5e1df1;});}return null;};}function removeEntity(_0x504790,_0x32ef89){return function(_0x4944ad){if(_0x4944ad){return _0x4944ad['destroy']()[_0x14c7('0x23')](function(){_0x504790[_0x14c7('0x19')](0xcc)[_0x14c7('0x1a')]();});}};}function handleEntityNotFound(_0x1c914b,_0x24a93b){return function(_0x4db89a){if(!_0x4db89a){_0x1c914b['sendStatus'](0x194);}return _0x4db89a;};}function handleError(_0x5a5349,_0x274c3c){_0x274c3c=_0x274c3c||0x1f4;return function(_0x1f24b4){logger[_0x14c7('0x24')](_0x1f24b4[_0x14c7('0x25')]);if(_0x1f24b4[_0x14c7('0x26')]){delete _0x1f24b4[_0x14c7('0x26')];}_0x5a5349[_0x14c7('0x19')](_0x274c3c)['send'](_0x1f24b4);};}exports[_0x14c7('0x27')]=function(_0x21be43,_0x17b2e5){var _0x30a959={},_0x3b4344={},_0x5a48e9={'count':0x0,'rows':[]};var _0x3dc18d=db[_0x14c7('0x28')][_0x14c7('0x29')];_0x3b4344['model']=_['keys'](_0x3dc18d);_0x3b4344['query']=_['keys'](_0x21be43['query']);_0x3b4344[_0x14c7('0x2a')]=_[_0x14c7('0x2b')](_0x3b4344[_0x14c7('0x2c')],_0x3b4344[_0x14c7('0x2d')]);_0x30a959['attributes']=_['intersection'](_0x3b4344['model'],qs[_0x14c7('0x2e')](_0x21be43[_0x14c7('0x2d')][_0x14c7('0x2e')]));_0x30a959[_0x14c7('0x2f')]=_0x30a959[_0x14c7('0x2f')][_0x14c7('0x30')]?_0x30a959['attributes']:_0x3b4344[_0x14c7('0x2c')];if(!_0x21be43[_0x14c7('0x2d')][_0x14c7('0x31')]('nolimit')){_0x30a959['limit']=qs[_0x14c7('0x32')](_0x21be43[_0x14c7('0x2d')]['limit']);_0x30a959[_0x14c7('0x1c')]=qs['offset'](_0x21be43[_0x14c7('0x2d')][_0x14c7('0x1c')]);}_0x30a959[_0x14c7('0x33')]=qs[_0x14c7('0x34')](_0x21be43[_0x14c7('0x2d')]['sort']);_0x30a959[_0x14c7('0x35')]=qs[_0x14c7('0x2a')](_[_0x14c7('0x36')](_0x21be43['query'],_0x3b4344['filters']));if(_0x21be43['query'][_0x14c7('0x37')]){_0x30a959['where']=_[_0x14c7('0x38')](_0x30a959[_0x14c7('0x35')],{'$or':_[_0x14c7('0x39')](_0x3dc18d,function(_0x8aaf8d){if(_0x8aaf8d['type'][_0x14c7('0x3a')]!==_0x14c7('0x3b')){var _0x441d27={};_0x441d27[_0x8aaf8d[_0x14c7('0x3c')]]={'$like':'%'+_0x21be43['query']['filter']+'%'};return _0x441d27;}})});}_0x30a959=_[_0x14c7('0x38')]({},_0x30a959,_0x21be43[_0x14c7('0x3d')]);var _0x43c9fc={'where':_0x30a959[_0x14c7('0x35')]};return db[_0x14c7('0x28')][_0x14c7('0x1b')](_0x43c9fc)[_0x14c7('0x23')](function(_0x4a71b3){_0x5a48e9[_0x14c7('0x1b')]=_0x4a71b3;if(_0x21be43['query']['includeAll']){_0x30a959[_0x14c7('0x3e')]=[{'all':!![]}];}return db['IntegrationReport'][_0x14c7('0x3f')](_0x30a959);})[_0x14c7('0x23')](function(_0x12e007){_0x5a48e9[_0x14c7('0x40')]=_0x12e007;return _0x5a48e9;})[_0x14c7('0x23')](respondWithFilteredResult(_0x17b2e5,_0x30a959))[_0x14c7('0x41')](handleError(_0x17b2e5,null));};exports['show']=function(_0x1b3da8,_0x2690a6){var _0x296417={'raw':![],'where':{'id':_0x1b3da8['params']['id']}},_0xce0c81={};_0xce0c81[_0x14c7('0x2c')]=_[_0x14c7('0x42')](db[_0x14c7('0x28')]['rawAttributes']);_0xce0c81[_0x14c7('0x2d')]=_[_0x14c7('0x42')](_0x1b3da8[_0x14c7('0x2d')]);_0xce0c81[_0x14c7('0x2a')]=_['intersection'](_0xce0c81[_0x14c7('0x2c')],_0xce0c81['query']);_0x296417['attributes']=_[_0x14c7('0x2b')](_0xce0c81['model'],qs[_0x14c7('0x2e')](_0x1b3da8[_0x14c7('0x2d')][_0x14c7('0x2e')]));_0x296417[_0x14c7('0x2f')]=_0x296417[_0x14c7('0x2f')]['length']?_0x296417['attributes']:_0xce0c81[_0x14c7('0x2c')];if(_0x1b3da8[_0x14c7('0x2d')][_0x14c7('0x43')]){_0x296417[_0x14c7('0x3e')]=[{'all':!![]}];}_0x296417=_[_0x14c7('0x38')]({},_0x296417,_0x1b3da8[_0x14c7('0x3d')]);return db[_0x14c7('0x28')][_0x14c7('0x44')](_0x296417)[_0x14c7('0x23')](handleEntityNotFound(_0x2690a6,null))['then'](respondWithResult(_0x2690a6,null))[_0x14c7('0x41')](handleError(_0x2690a6,null));};exports['create']=function(_0x2d0e17,_0x361ad4){return db[_0x14c7('0x28')][_0x14c7('0x45')](_0x2d0e17[_0x14c7('0x46')],{})['then'](respondWithResult(_0x361ad4,0xc9))['catch'](handleError(_0x361ad4,null));};exports['update']=function(_0x4239ff,_0x48bb32){if(_0x4239ff[_0x14c7('0x46')]['id']){delete _0x4239ff[_0x14c7('0x46')]['id'];}return db['IntegrationReport'][_0x14c7('0x44')]({'where':{'id':_0x4239ff[_0x14c7('0x47')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x48bb32,null))[_0x14c7('0x23')](saveUpdates(_0x4239ff['body'],null))[_0x14c7('0x23')](respondWithResult(_0x48bb32,null))[_0x14c7('0x41')](handleError(_0x48bb32,null));};exports[_0x14c7('0x48')]=function(_0x10509f,_0x3ca42c){return db[_0x14c7('0x28')]['find']({'where':{'id':_0x10509f[_0x14c7('0x47')]['id']}})[_0x14c7('0x23')](handleEntityNotFound(_0x3ca42c,null))['then'](removeEntity(_0x3ca42c,null))[_0x14c7('0x41')](handleError(_0x3ca42c,null));};exports[_0x14c7('0x49')]=function(_0xe9da42,_0xa0accb){return db[_0x14c7('0x28')][_0x14c7('0x49')]()[_0x14c7('0x23')](respondWithResult(_0xa0accb,null))[_0x14c7('0x41')](handleError(_0xa0accb,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 1c96bd7..9bff925 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 _0x038b=['report_integration','util','../../config/logger','api','bluebird','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x384a06,_0xa34400){var _0x2194ea=function(_0x5edcc7){while(--_0x5edcc7){_0x384a06['push'](_0x384a06['shift']());}};_0x2194ea(++_0xa34400);}(_0x038b,0x114));var _0xb038=function(_0x25955d,_0x495864){_0x25955d=_0x25955d-0x0;var _0xc7b871=_0x038b[_0x25955d];return _0xc7b871;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb647=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','util'];(function(_0x11207a,_0x149cef){var _0x2c17d1=function(_0x523099){while(--_0x523099){_0x11207a['push'](_0x11207a['shift']());}};_0x2c17d1(++_0x149cef);}(_0xb647,0xdb));var _0x7b64=function(_0x39e0fb,_0x448e21){_0x39e0fb=_0x39e0fb-0x0;var _0x52bf4c=_0xb647[_0x39e0fb];return _0x52bf4c;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var logger=require(_0x7b64('0x2'))(_0x7b64('0x3'));var moment=require(_0x7b64('0x4'));var BPromise=require(_0x7b64('0x5'));var rp=require(_0x7b64('0x6'));var fs=require('fs');var path=require(_0x7b64('0x7'));var rimraf=require('rimraf');var config=require(_0x7b64('0x8'));var attributes=require('./integrationReport.attributes');module[_0x7b64('0x9')]=function(_0x38ebf7,_0x31915b){return _0x38ebf7[_0x7b64('0xa')](_0x7b64('0xb'),attributes,{'tableName':_0x7b64('0xc'),'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 bf4a39d..55fedc9 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 _0x3a00=['request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x2882d0,_0x5a7129){var _0x3519a5=function(_0x52862f){while(--_0x52862f){_0x2882d0['push'](_0x2882d0['shift']());}};_0x3519a5(++_0x5a7129);}(_0x3a00,0xfc));var _0x03a0=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0x3a00[_0x1b8d87];return _0x182b74;};'use strict';var _=require(_0x03a0('0x0'));var util=require(_0x03a0('0x1'));var moment=require(_0x03a0('0x2'));var BPromise=require(_0x03a0('0x3'));var rs=require(_0x03a0('0x4'));var fs=require('fs');var Redis=require(_0x03a0('0x5'));var db=require(_0x03a0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x03a0('0x7'))(_0x03a0('0x8'));var config=require(_0x03a0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x03a0('0xa')][_0x03a0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33baab,_0x116a1b,_0x1e21df){return new BPromise(function(_0x5679e1,_0x28b16f){return client[_0x03a0('0xc')](_0x33baab,_0x1e21df)[_0x03a0('0xd')](function(_0x11af53){logger[_0x03a0('0xe')](_0x03a0('0xf'),_0x116a1b,_0x03a0('0x10'));logger[_0x03a0('0x11')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x116a1b,'request\x20sent',JSON['stringify'](_0x11af53));if(_0x11af53[_0x03a0('0x12')]){if(_0x11af53[_0x03a0('0x12')][_0x03a0('0x13')]===0x1f4){logger[_0x03a0('0x12')]('IntegrationReport,\x20%s,\x20%s',_0x116a1b,_0x11af53[_0x03a0('0x12')]['message']);return _0x28b16f(_0x11af53[_0x03a0('0x12')]['message']);}logger['error'](_0x03a0('0xf'),_0x116a1b,_0x11af53['error']['message']);return _0x5679e1(_0x11af53[_0x03a0('0x12')][_0x03a0('0x14')]);}else{logger['info'](_0x03a0('0xf'),_0x116a1b,_0x03a0('0x10'));_0x5679e1(_0x11af53[_0x03a0('0x15')][_0x03a0('0x14')]);}})['catch'](function(_0xa4388b){logger[_0x03a0('0x12')](_0x03a0('0xf'),_0x116a1b,_0xa4388b);_0x28b16f(_0xa4388b);});});} \ No newline at end of file +var _0x228c=['error','code','message','catch','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x228c,0x1be));var _0xc228=function(_0x2d08e1,_0x4f0f49){_0x2d08e1=_0x2d08e1-0x0;var _0x4e3398=_0x228c[_0x2d08e1];return _0x4e3398;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc228('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc228('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xc228('0x2'));var logger=require(_0xc228('0x3'))('rpc');var config=require(_0xc228('0x4'));var jayson=require(_0xc228('0x5'));var client=jayson[_0xc228('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb50eb4,_0x1db557,_0x174c48){return new BPromise(function(_0x3b8769,_0x245501){return client[_0xc228('0x7')](_0xb50eb4,_0x174c48)[_0xc228('0x8')](function(_0x3bcd8e){logger[_0xc228('0x9')](_0xc228('0xa'),_0x1db557,_0xc228('0xb'));logger['debug'](_0xc228('0xc'),_0x1db557,_0xc228('0xb'),JSON['stringify'](_0x3bcd8e));if(_0x3bcd8e[_0xc228('0xd')]){if(_0x3bcd8e['error'][_0xc228('0xe')]===0x1f4){logger[_0xc228('0xd')](_0xc228('0xa'),_0x1db557,_0x3bcd8e[_0xc228('0xd')]['message']);return _0x245501(_0x3bcd8e['error'][_0xc228('0xf')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x1db557,_0x3bcd8e[_0xc228('0xd')][_0xc228('0xf')]);return _0x3b8769(_0x3bcd8e[_0xc228('0xd')]['message']);}else{logger[_0xc228('0x9')]('IntegrationReport,\x20%s,\x20%s',_0x1db557,'request\x20sent');_0x3b8769(_0x3bcd8e['result'][_0xc228('0xf')]);}})[_0xc228('0x10')](function(_0x23b920){logger[_0xc228('0xd')](_0xc228('0xa'),_0x1db557,_0x23b920);_0x245501(_0x23b920);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b62ac22..0f63bfc 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 _0xd5ee=['post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','getIntervals'];(function(_0x35db17,_0x8d64da){var _0x73f088=function(_0x16f30a){while(--_0x16f30a){_0x35db17['push'](_0x35db17['shift']());}};_0x73f088(++_0x8d64da);}(_0xd5ee,0x93));var _0xed5e=function(_0x2ef251,_0x3687e5){_0x2ef251=_0x2ef251-0x0;var _0x5c931b=_0xd5ee[_0x2ef251];return _0x5c931b;};'use strict';var multer=require(_0xed5e('0x0'));var util=require('util');var path=require(_0xed5e('0x1'));var timeout=require(_0xed5e('0x2'));var express=require(_0xed5e('0x3'));var router=express['Router']();var auth=require(_0xed5e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xed5e('0x5'));var controller=require(_0xed5e('0x6'));router[_0xed5e('0x7')]('/',auth[_0xed5e('0x8')](),controller[_0xed5e('0x9')]);router[_0xed5e('0x7')](_0xed5e('0xa'),auth[_0xed5e('0x8')](),controller[_0xed5e('0xb')]);router[_0xed5e('0x7')](_0xed5e('0xc'),auth['isAuthenticated'](),controller[_0xed5e('0xd')]);router[_0xed5e('0xe')]('/',auth[_0xed5e('0x8')](),controller[_0xed5e('0xf')]);router[_0xed5e('0xe')](_0xed5e('0xc'),auth[_0xed5e('0x8')](),controller[_0xed5e('0x10')]);router[_0xed5e('0xe')](_0xed5e('0x11'),auth[_0xed5e('0x8')](),controller[_0xed5e('0x12')]);router['put'](_0xed5e('0xa'),auth[_0xed5e('0x8')](),controller[_0xed5e('0x13')]);router[_0xed5e('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xed5e('0x15')]);module[_0xed5e('0x16')]=router; \ No newline at end of file +var _0xdcec=['show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./interval.controller','get','isAuthenticated','/:id'];(function(_0x15850e,_0x58311a){var _0xc90e63=function(_0x51c5dd){while(--_0x51c5dd){_0x15850e['push'](_0x15850e['shift']());}};_0xc90e63(++_0x58311a);}(_0xdcec,0xf2));var _0xcdce=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0xdcec[_0x1ae31c];return _0x19519d;};'use strict';var multer=require('multer');var util=require(_0xcdce('0x0'));var path=require(_0xcdce('0x1'));var timeout=require(_0xcdce('0x2'));var express=require(_0xcdce('0x3'));var router=express[_0xcdce('0x4')]();var auth=require(_0xcdce('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcdce('0x6'));router[_0xcdce('0x7')]('/',auth[_0xcdce('0x8')](),controller['index']);router['get'](_0xcdce('0x9'),auth[_0xcdce('0x8')](),controller[_0xcdce('0xa')]);router[_0xcdce('0x7')](_0xcdce('0xb'),auth[_0xcdce('0x8')](),controller[_0xcdce('0xc')]);router[_0xcdce('0xd')]('/',auth['isAuthenticated'](),controller[_0xcdce('0xe')]);router[_0xcdce('0xd')](_0xcdce('0xb'),auth[_0xcdce('0x8')](),controller[_0xcdce('0xf')]);router[_0xcdce('0xd')](_0xcdce('0x10'),auth['isAuthenticated'](),controller[_0xcdce('0x11')]);router['put']('/:id',auth[_0xcdce('0x8')](),controller['update']);router[_0xcdce('0x12')](_0xcdce('0x9'),auth[_0xcdce('0x8')](),controller[_0xcdce('0x13')]);module[_0xcdce('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 94c4476..2086a62 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 _0xdc00=['sequelize','STRING'];(function(_0x10744b,_0x5efa59){var _0x3a9eea=function(_0x35ea2d){while(--_0x35ea2d){_0x10744b['push'](_0x10744b['shift']());}};_0x3a9eea(++_0x5efa59);}(_0xdc00,0xfe));var _0x0dc0=function(_0x1d1a4e,_0x3aa639){_0x1d1a4e=_0x1d1a4e-0x0;var _0x1ddaf0=_0xdc00[_0x1d1a4e];return _0x1ddaf0;};'use strict';var Sequelize=require(_0x0dc0('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dc0('0x1')]},'description':{'type':Sequelize[_0x0dc0('0x1')]},'interval':{'type':Sequelize[_0x0dc0('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xaf9d=['STRING','sequelize','exports'];(function(_0xddce0e,_0x12c9b4){var _0x3de9ff=function(_0x4f0073){while(--_0x4f0073){_0xddce0e['push'](_0xddce0e['shift']());}};_0x3de9ff(++_0x12c9b4);}(_0xaf9d,0x12d));var _0xdaf9=function(_0x164bf8,_0x1881b0){_0x164bf8=_0x164bf8-0x0;var _0x553015=_0xaf9d[_0x164bf8];return _0x553015;};'use strict';var Sequelize=require(_0xdaf9('0x0'));module[_0xdaf9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdaf9('0x2')]},'interval':{'type':Sequelize[_0xdaf9('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 06d5d26..eb1ac3a 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 _0xaaab=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','type','key','VIRTUAL','field','filter','options','findAll','rows','catch','show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addInterval','IntervalId','getIntervals','findOne','order','pick','addIntervals','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/extensions/rewrite','status','end','json','count','offset','set','Content-Range','reject','get','Intervals','then','sendStatus','error','stack','name','index','Interval','rawAttributes'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xaaab,0x18d));var _0xbaaa=function(_0x6fc917,_0x15124a){_0x6fc917=_0x6fc917-0x0;var _0x51b039=_0xaaab[_0x6fc917];return _0x51b039;};'use strict';var pdf=require(_0xbaaa('0x0'));var emlformat=require(_0xbaaa('0x1'));var rimraf=require(_0xbaaa('0x2'));var zipdir=require(_0xbaaa('0x3'));var jsonpatch=require(_0xbaaa('0x4'));var rp=require('request-promise');var moment=require(_0xbaaa('0x5'));var BPromise=require(_0xbaaa('0x6'));var Mustache=require(_0xbaaa('0x7'));var util=require(_0xbaaa('0x8'));var path=require(_0xbaaa('0x9'));var sox=require(_0xbaaa('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbaaa('0xb'));var squel=require(_0xbaaa('0xc'));var crypto=require(_0xbaaa('0xd'));var jsforce=require(_0xbaaa('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbaaa('0xf'));var Redis=require(_0xbaaa('0x10'));var authService=require(_0xbaaa('0x11'));var qs=require(_0xbaaa('0x12'));var hardwareService=require(_0xbaaa('0x13'));var logger=require(_0xbaaa('0x14'))(_0xbaaa('0x15'));var utils=require(_0xbaaa('0x16'));var config=require(_0xbaaa('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0xbaaa('0x18'));function respondWithStatusCode(_0x4054bd,_0x2b9607){_0x2b9607=_0x2b9607||0xcc;return function(_0x2f6074){if(_0x2f6074){return _0x4054bd['sendStatus'](_0x2b9607);}return _0x4054bd[_0xbaaa('0x19')](_0x2b9607)[_0xbaaa('0x1a')]();};}function respondWithResult(_0x1a0b95,_0x4c589b){_0x4c589b=_0x4c589b||0xc8;return function(_0x3596bb){if(_0x3596bb){return _0x1a0b95[_0xbaaa('0x19')](_0x4c589b)[_0xbaaa('0x1b')](_0x3596bb);}};}function respondWithFilteredResult(_0x28cdd7,_0x50690d){return function(_0x486142){if(_0x486142){var _0x59e841=_0x486142[_0xbaaa('0x1c')],_0x2db394=_0x50690d[_0xbaaa('0x1d')],_0x592fb5=_0x50690d[_0xbaaa('0x1d')]+_0x50690d['limit'],_0x299b3c;if(_0x592fb5>=_0x59e841){_0x592fb5=_0x59e841;_0x299b3c=0xc8;}else{_0x299b3c=0xce;}_0x28cdd7[_0xbaaa('0x19')](_0x299b3c);return _0x28cdd7[_0xbaaa('0x1e')](_0xbaaa('0x1f'),_0x2db394+'-'+_0x592fb5+'/'+_0x59e841)['json'](_0x486142);}return null;};}function patchUpdates(_0x5b55f8){return function(_0x18b0cb){try{jsonpatch['apply'](_0x18b0cb,_0x5b55f8,!![]);}catch(_0xec00b5){return BPromise[_0xbaaa('0x20')](_0xec00b5);}return _0x18b0cb['save']();};}function saveUpdates(_0x23573a,_0x187cc3){return function(_0x427593){if(_0x427593){return _0x427593['update'](_0x23573a)['then'](function(_0x523058){return _0x523058;});}return null;};}function removeEntity(_0x4004d6,_0xa7472c){return function(_0x4b64e0){if(_0x4b64e0){return _0x4b64e0['destroy']()['then'](function(){var _0x47b0ee=_0x4b64e0[_0xbaaa('0x21')]({'plain':!![]});var _0x592ef5=_0xbaaa('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x592ef5,'resourceId':_0x47b0ee['id']}})['then'](function(){return _0x4b64e0;});})[_0xbaaa('0x23')](function(){_0x4004d6[_0xbaaa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169fa9,_0x1d281c){return function(_0x189751){if(!_0x189751){_0x169fa9[_0xbaaa('0x24')](0x194);}return _0x189751;};}function handleError(_0x5c1a56,_0x375c9a){_0x375c9a=_0x375c9a||0x1f4;return function(_0x40f7d9){logger[_0xbaaa('0x25')](_0x40f7d9[_0xbaaa('0x26')]);if(_0x40f7d9[_0xbaaa('0x27')]){delete _0x40f7d9[_0xbaaa('0x27')];}_0x5c1a56[_0xbaaa('0x19')](_0x375c9a)['send'](_0x40f7d9);};}exports[_0xbaaa('0x28')]=function(_0x3b4bf1,_0x4772e3){var _0x441ead={},_0x453260={},_0x2467b0={'count':0x0,'rows':[]};var _0x899bec=db[_0xbaaa('0x29')][_0xbaaa('0x2a')];_0x453260[_0xbaaa('0x2b')]=_[_0xbaaa('0x2c')](_0x899bec);_0x453260[_0xbaaa('0x2d')]=_[_0xbaaa('0x2c')](_0x3b4bf1[_0xbaaa('0x2d')]);_0x453260[_0xbaaa('0x2e')]=_[_0xbaaa('0x2f')](_0x453260[_0xbaaa('0x2b')],_0x453260['query']);_0x441ead[_0xbaaa('0x30')]=_[_0xbaaa('0x2f')](_0x453260['model'],qs[_0xbaaa('0x31')](_0x3b4bf1[_0xbaaa('0x2d')][_0xbaaa('0x31')]));_0x441ead['attributes']=_0x441ead[_0xbaaa('0x30')][_0xbaaa('0x32')]?_0x441ead[_0xbaaa('0x30')]:_0x453260[_0xbaaa('0x2b')];if(!_0x3b4bf1['query'][_0xbaaa('0x33')](_0xbaaa('0x34'))){_0x441ead['limit']=qs[_0xbaaa('0x35')](_0x3b4bf1['query']['limit']);_0x441ead[_0xbaaa('0x1d')]=qs[_0xbaaa('0x1d')](_0x3b4bf1[_0xbaaa('0x2d')][_0xbaaa('0x1d')]);}_0x441ead['order']=qs['sort'](_0x3b4bf1['query'][_0xbaaa('0x36')]);_0x441ead[_0xbaaa('0x37')]=qs[_0xbaaa('0x2e')](_['pick'](_0x3b4bf1['query'],_0x453260[_0xbaaa('0x2e')]));if(_0x3b4bf1[_0xbaaa('0x2d')]['filter']){_0x441ead[_0xbaaa('0x37')]=_[_0xbaaa('0x38')](_0x441ead[_0xbaaa('0x37')],{'$or':_['map'](_0x899bec,function(_0x546628){if(_0x546628[_0xbaaa('0x39')][_0xbaaa('0x3a')]!==_0xbaaa('0x3b')){var _0x13880a={};_0x13880a[_0x546628[_0xbaaa('0x3c')]]={'$like':'%'+_0x3b4bf1[_0xbaaa('0x2d')][_0xbaaa('0x3d')]+'%'};return _0x13880a;}})});}_0x441ead=_['merge']({},_0x441ead,_0x3b4bf1[_0xbaaa('0x3e')]);var _0x370bcc={'where':_0x441ead[_0xbaaa('0x37')]};return db[_0xbaaa('0x29')][_0xbaaa('0x1c')](_0x370bcc)['then'](function(_0x29bbc1){_0x2467b0[_0xbaaa('0x1c')]=_0x29bbc1;if(_0x3b4bf1[_0xbaaa('0x2d')]['includeAll']){_0x441ead['include']=[{'all':!![]}];}return db[_0xbaaa('0x29')][_0xbaaa('0x3f')](_0x441ead);})[_0xbaaa('0x23')](function(_0x2e3a73){_0x2467b0[_0xbaaa('0x40')]=_0x2e3a73;return _0x2467b0;})[_0xbaaa('0x23')](respondWithFilteredResult(_0x4772e3,_0x441ead))[_0xbaaa('0x41')](handleError(_0x4772e3,null));};exports[_0xbaaa('0x42')]=function(_0x797cc2,_0x5064b7){var _0x2aa278={'raw':!![],'where':{'id':_0x797cc2[_0xbaaa('0x43')]['id']}},_0x1d0cbb={};_0x1d0cbb[_0xbaaa('0x2b')]=_[_0xbaaa('0x2c')](db[_0xbaaa('0x29')][_0xbaaa('0x2a')]);_0x1d0cbb[_0xbaaa('0x2d')]=_[_0xbaaa('0x2c')](_0x797cc2[_0xbaaa('0x2d')]);_0x1d0cbb[_0xbaaa('0x2e')]=_[_0xbaaa('0x2f')](_0x1d0cbb[_0xbaaa('0x2b')],_0x1d0cbb['query']);_0x2aa278[_0xbaaa('0x30')]=_[_0xbaaa('0x2f')](_0x1d0cbb[_0xbaaa('0x2b')],qs['fields'](_0x797cc2[_0xbaaa('0x2d')][_0xbaaa('0x31')]));_0x2aa278['attributes']=_0x2aa278[_0xbaaa('0x30')]['length']?_0x2aa278[_0xbaaa('0x30')]:_0x1d0cbb[_0xbaaa('0x2b')];if(_0x797cc2[_0xbaaa('0x2d')][_0xbaaa('0x44')]){_0x2aa278[_0xbaaa('0x45')]=[{'all':!![]}];}_0x2aa278=_['merge']({},_0x2aa278,_0x797cc2[_0xbaaa('0x3e')]);return db[_0xbaaa('0x29')]['find'](_0x2aa278)[_0xbaaa('0x23')](handleEntityNotFound(_0x5064b7,null))[_0xbaaa('0x23')](respondWithResult(_0x5064b7,null))[_0xbaaa('0x41')](handleError(_0x5064b7,null));};exports[_0xbaaa('0x46')]=function(_0x3da0a9,_0x5d3d84){return db[_0xbaaa('0x29')]['create'](_0x3da0a9[_0xbaaa('0x47')],{})[_0xbaaa('0x23')](function(_0x30cbd7){var _0x33e65f=_0x3da0a9[_0xbaaa('0x48')]['get']({'plain':!![]});if(!_0x33e65f)throw new Error(_0xbaaa('0x49'));if(_0x33e65f['role']==='user'){var _0x42e99a=_0x30cbd7['get']({'plain':!![]});var _0x56801d=_0xbaaa('0x22');return db[_0xbaaa('0x4a')][_0xbaaa('0x4b')]({'where':{'name':_0x56801d,'userProfileId':_0x33e65f['userProfileId']},'raw':!![]})['then'](function(_0x180563){if(_0x180563&&_0x180563[_0xbaaa('0x4c')]===0x0){return db['UserProfileResource'][_0xbaaa('0x46')]({'name':_0x42e99a['name'],'resourceId':_0x42e99a['id'],'type':_0x180563[_0xbaaa('0x27')],'sectionId':_0x180563['id']},{})[_0xbaaa('0x23')](function(){return _0x30cbd7;});}else{return _0x30cbd7;}})[_0xbaaa('0x41')](function(_0x589c61){logger[_0xbaaa('0x25')](_0xbaaa('0x4d'),_0x589c61);throw _0x589c61;});}return _0x30cbd7;})['then'](respondWithResult(_0x5d3d84,0xc9))[_0xbaaa('0x41')](handleError(_0x5d3d84,null));};exports['update']=function(_0x26e631,_0x325eba){if(_0x26e631[_0xbaaa('0x47')]['id']){delete _0x26e631[_0xbaaa('0x47')]['id'];}return db[_0xbaaa('0x29')]['find']({'where':{'id':_0x26e631[_0xbaaa('0x43')]['id']}})['then'](handleEntityNotFound(_0x325eba,null))[_0xbaaa('0x23')](saveUpdates(_0x26e631[_0xbaaa('0x47')],null))[_0xbaaa('0x23')](respondWithResult(_0x325eba,null))[_0xbaaa('0x41')](handleError(_0x325eba,null));};exports[_0xbaaa('0x4e')]=function(_0x5411b,_0x16b733){return db['Interval'][_0xbaaa('0x4b')]({'where':{'id':_0x5411b[_0xbaaa('0x43')]['id']}})[_0xbaaa('0x23')](handleEntityNotFound(_0x16b733,null))['then'](removeEntity(_0x16b733,null))['catch'](handleError(_0x16b733,null));};exports[_0xbaaa('0x4f')]=function(_0x51ecaf,_0x267d82,_0x4df872){if(_0x51ecaf[_0xbaaa('0x47')]['id']){delete _0x51ecaf['body']['id'];}return db[_0xbaaa('0x29')]['find']({'where':{'id':_0x51ecaf[_0xbaaa('0x43')]['id']}})[_0xbaaa('0x23')](handleEntityNotFound(_0x267d82,null))[_0xbaaa('0x23')](function(_0x5078fd){if(_0x5078fd){_0x51ecaf['body'][_0xbaaa('0x50')]=_0x5078fd['id'];return db[_0xbaaa('0x29')]['create'](_0x51ecaf['body']);}})[_0xbaaa('0x23')](respondWithResult(_0x267d82,null))[_0xbaaa('0x41')](handleError(_0x267d82,null));};exports[_0xbaaa('0x51')]=function(_0x227ed9,_0x493154,_0x50e5ea){var _0x341f28={};var _0x586441={};var _0x2f52ee;var _0x1e502b;return db[_0xbaaa('0x29')][_0xbaaa('0x52')]({'where':{'id':_0x227ed9[_0xbaaa('0x43')]['id']}})[_0xbaaa('0x23')](handleEntityNotFound(_0x493154,null))[_0xbaaa('0x23')](function(_0x103afd){if(_0x103afd){_0x2f52ee=_0x103afd;_0x586441[_0xbaaa('0x2b')]=_[_0xbaaa('0x2c')](db['Interval']['rawAttributes']);_0x586441[_0xbaaa('0x2d')]=_['keys'](_0x227ed9[_0xbaaa('0x2d')]);_0x586441[_0xbaaa('0x2e')]=_[_0xbaaa('0x2f')](_0x586441[_0xbaaa('0x2b')],_0x586441[_0xbaaa('0x2d')]);_0x341f28['attributes']=_[_0xbaaa('0x2f')](_0x586441[_0xbaaa('0x2b')],qs['fields'](_0x227ed9['query'][_0xbaaa('0x31')]));_0x341f28[_0xbaaa('0x30')]=_0x341f28[_0xbaaa('0x30')][_0xbaaa('0x32')]?_0x341f28[_0xbaaa('0x30')]:_0x586441[_0xbaaa('0x2b')];_0x341f28[_0xbaaa('0x53')]=qs[_0xbaaa('0x36')](_0x227ed9[_0xbaaa('0x2d')]['sort']);_0x341f28[_0xbaaa('0x37')]=qs[_0xbaaa('0x2e')](_[_0xbaaa('0x54')](_0x227ed9[_0xbaaa('0x2d')],_0x586441[_0xbaaa('0x2e')]));if(_0x227ed9[_0xbaaa('0x2d')]['filter']){_0x341f28[_0xbaaa('0x37')]=_['merge'](_0x341f28[_0xbaaa('0x37')],{'$or':_['map'](_0x341f28[_0xbaaa('0x30')],function(_0xa18078){var _0x42811d={};_0x42811d[_0xa18078]={'$like':'%'+_0x227ed9[_0xbaaa('0x2d')][_0xbaaa('0x3d')]+'%'};return _0x42811d;})});}_0x341f28=_[_0xbaaa('0x38')]({},_0x341f28,_0x227ed9[_0xbaaa('0x3e')]);return _0x2f52ee[_0xbaaa('0x51')](_0x341f28);}})[_0xbaaa('0x23')](function(_0x10262c){if(_0x10262c){_0x1e502b=_0x10262c['length'];if(!_0x227ed9[_0xbaaa('0x2d')]['hasOwnProperty'](_0xbaaa('0x34'))){_0x341f28['limit']=qs[_0xbaaa('0x35')](_0x227ed9[_0xbaaa('0x2d')][_0xbaaa('0x35')]);_0x341f28[_0xbaaa('0x1d')]=qs['offset'](_0x227ed9['query'][_0xbaaa('0x1d')]);}return _0x2f52ee[_0xbaaa('0x51')](_0x341f28);}})[_0xbaaa('0x23')](function(_0x2dd70e){if(_0x2dd70e){return _0x2dd70e?{'count':_0x1e502b,'rows':_0x2dd70e}:null;}})[_0xbaaa('0x23')](respondWithResult(_0x493154,null))[_0xbaaa('0x41')](handleError(_0x493154,null));};exports[_0xbaaa('0x55')]=function(_0x434e38,_0x3d8646,_0x514edf){return db['Interval']['findOne']({'where':{'id':_0x434e38[_0xbaaa('0x43')]['id']}})[_0xbaaa('0x23')](handleEntityNotFound(_0x3d8646,null))[_0xbaaa('0x23')](function(_0x37dd6e){if(_0x37dd6e){return db[_0xbaaa('0x56')][_0xbaaa('0x57')](function(_0x4cb3fd){return db[_0xbaaa('0x29')][_0xbaaa('0x4e')]({'where':{'IntervalId':_0x434e38[_0xbaaa('0x43')]['id']},'transaction':_0x4cb3fd})['then'](function(_0x476fe9){var _0x48ca65=_['map'](_0x434e38[_0xbaaa('0x47')],function(_0x2bd4e4){delete _0x2bd4e4['id'];_0x2bd4e4[_0xbaaa('0x50')]=_0x434e38['params']['id'];return _0x2bd4e4;});return db['Interval']['bulkCreate'](_0x48ca65,{'transaction':_0x4cb3fd});});})['then'](function(){return db[_0xbaaa('0x29')][_0xbaaa('0x3f')]({'where':{'IntervalId':_0x434e38[_0xbaaa('0x43')]['id']}});});}})[_0xbaaa('0x23')](respondWithResult(_0x3d8646,null))[_0xbaaa('0x41')](handleError(_0x3d8646,null));}; \ No newline at end of file +var _0xadbf=['nolimit','order','sort','where','merge','map','type','field','filter','options','count','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','pick','addIntervals','sequelize','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','stack','name','Interval','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x283d2,_0x326465){var _0x468ee3=function(_0x431edd){while(--_0x431edd){_0x283d2['push'](_0x283d2['shift']());}};_0x468ee3(++_0x326465);}(_0xadbf,0x7d));var _0xfadb=function(_0x1eea3a,_0x4f34bf){_0x1eea3a=_0x1eea3a-0x0;var _0x53d9b7=_0xadbf[_0x1eea3a];return _0x53d9b7;};'use strict';var pdf=require(_0xfadb('0x0'));var emlformat=require(_0xfadb('0x1'));var rimraf=require(_0xfadb('0x2'));var zipdir=require(_0xfadb('0x3'));var jsonpatch=require(_0xfadb('0x4'));var rp=require('request-promise');var moment=require(_0xfadb('0x5'));var BPromise=require(_0xfadb('0x6'));var Mustache=require(_0xfadb('0x7'));var util=require('util');var path=require(_0xfadb('0x8'));var sox=require(_0xfadb('0x9'));var csv=require(_0xfadb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfadb('0xb'));var squel=require(_0xfadb('0xc'));var crypto=require(_0xfadb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xfadb('0xe'));var toCsv=require(_0xfadb('0xa'));var querystring=require(_0xfadb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfadb('0x10'));var qs=require(_0xfadb('0x11'));var hardwareService=require(_0xfadb('0x12'));var logger=require('../../config/logger')(_0xfadb('0x13'));var utils=require(_0xfadb('0x14'));var config=require(_0xfadb('0x15'));var db=require(_0xfadb('0x16'))['db'];var extensions=require(_0xfadb('0x17'));function respondWithStatusCode(_0x417d43,_0x421a34){_0x421a34=_0x421a34||0xcc;return function(_0x3afe72){if(_0x3afe72){return _0x417d43[_0xfadb('0x18')](_0x421a34);}return _0x417d43[_0xfadb('0x19')](_0x421a34)['end']();};}function respondWithResult(_0x4dd132,_0x436918){_0x436918=_0x436918||0xc8;return function(_0x332728){if(_0x332728){return _0x4dd132[_0xfadb('0x19')](_0x436918)[_0xfadb('0x1a')](_0x332728);}};}function respondWithFilteredResult(_0xec2b4a,_0x17f7cc){return function(_0x2636d8){if(_0x2636d8){var _0x2b3a0b=_0x2636d8['count'],_0x456723=_0x17f7cc['offset'],_0x12b423=_0x17f7cc[_0xfadb('0x1b')]+_0x17f7cc[_0xfadb('0x1c')],_0x56261d;if(_0x12b423>=_0x2b3a0b){_0x12b423=_0x2b3a0b;_0x56261d=0xc8;}else{_0x56261d=0xce;}_0xec2b4a[_0xfadb('0x19')](_0x56261d);return _0xec2b4a[_0xfadb('0x1d')](_0xfadb('0x1e'),_0x456723+'-'+_0x12b423+'/'+_0x2b3a0b)[_0xfadb('0x1a')](_0x2636d8);}return null;};}function patchUpdates(_0x432ec4){return function(_0x171dfb){try{jsonpatch['apply'](_0x171dfb,_0x432ec4,!![]);}catch(_0x1af0e2){return BPromise[_0xfadb('0x1f')](_0x1af0e2);}return _0x171dfb[_0xfadb('0x20')]();};}function saveUpdates(_0xa8a5be,_0x35798a){return function(_0x5832e0){if(_0x5832e0){return _0x5832e0[_0xfadb('0x21')](_0xa8a5be)[_0xfadb('0x22')](function(_0x186d27){return _0x186d27;});}return null;};}function removeEntity(_0xdfd177,_0x4fc32a){return function(_0x4435ed){if(_0x4435ed){return _0x4435ed[_0xfadb('0x23')]()[_0xfadb('0x22')](function(){var _0x4f50b6=_0x4435ed[_0xfadb('0x24')]({'plain':!![]});var _0x4e60fa=_0xfadb('0x25');return db[_0xfadb('0x26')][_0xfadb('0x23')]({'where':{'type':_0x4e60fa,'resourceId':_0x4f50b6['id']}})[_0xfadb('0x22')](function(){return _0x4435ed;});})[_0xfadb('0x22')](function(){_0xdfd177[_0xfadb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59fc3c,_0x213a6a){return function(_0xf2a18){if(!_0xf2a18){_0x59fc3c[_0xfadb('0x18')](0x194);}return _0xf2a18;};}function handleError(_0x198c0a,_0x834f9e){_0x834f9e=_0x834f9e||0x1f4;return function(_0x2b4d89){logger[_0xfadb('0x27')](_0x2b4d89[_0xfadb('0x28')]);if(_0x2b4d89[_0xfadb('0x29')]){delete _0x2b4d89[_0xfadb('0x29')];}_0x198c0a[_0xfadb('0x19')](_0x834f9e)['send'](_0x2b4d89);};}exports['index']=function(_0x4eaf37,_0x2ad1bc){var _0x4ef0cd={},_0x4fbebb={},_0x47b3d1={'count':0x0,'rows':[]};var _0x38e363=db[_0xfadb('0x2a')][_0xfadb('0x2b')];_0x4fbebb[_0xfadb('0x2c')]=_['keys'](_0x38e363);_0x4fbebb[_0xfadb('0x2d')]=_[_0xfadb('0x2e')](_0x4eaf37[_0xfadb('0x2d')]);_0x4fbebb[_0xfadb('0x2f')]=_['intersection'](_0x4fbebb['model'],_0x4fbebb[_0xfadb('0x2d')]);_0x4ef0cd[_0xfadb('0x30')]=_[_0xfadb('0x31')](_0x4fbebb[_0xfadb('0x2c')],qs['fields'](_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x32')]));_0x4ef0cd[_0xfadb('0x30')]=_0x4ef0cd[_0xfadb('0x30')][_0xfadb('0x33')]?_0x4ef0cd[_0xfadb('0x30')]:_0x4fbebb[_0xfadb('0x2c')];if(!_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x34')](_0xfadb('0x35'))){_0x4ef0cd[_0xfadb('0x1c')]=qs[_0xfadb('0x1c')](_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x1c')]);_0x4ef0cd[_0xfadb('0x1b')]=qs[_0xfadb('0x1b')](_0x4eaf37[_0xfadb('0x2d')]['offset']);}_0x4ef0cd[_0xfadb('0x36')]=qs[_0xfadb('0x37')](_0x4eaf37[_0xfadb('0x2d')][_0xfadb('0x37')]);_0x4ef0cd['where']=qs['filters'](_['pick'](_0x4eaf37[_0xfadb('0x2d')],_0x4fbebb[_0xfadb('0x2f')]));if(_0x4eaf37[_0xfadb('0x2d')]['filter']){_0x4ef0cd[_0xfadb('0x38')]=_[_0xfadb('0x39')](_0x4ef0cd[_0xfadb('0x38')],{'$or':_[_0xfadb('0x3a')](_0x38e363,function(_0x4bf816){if(_0x4bf816[_0xfadb('0x3b')]['key']!=='VIRTUAL'){var _0x2faaf9={};_0x2faaf9[_0x4bf816[_0xfadb('0x3c')]]={'$like':'%'+_0x4eaf37['query'][_0xfadb('0x3d')]+'%'};return _0x2faaf9;}})});}_0x4ef0cd=_[_0xfadb('0x39')]({},_0x4ef0cd,_0x4eaf37[_0xfadb('0x3e')]);var _0x189810={'where':_0x4ef0cd[_0xfadb('0x38')]};return db['Interval'][_0xfadb('0x3f')](_0x189810)[_0xfadb('0x22')](function(_0x4b2997){_0x47b3d1[_0xfadb('0x3f')]=_0x4b2997;if(_0x4eaf37['query'][_0xfadb('0x40')]){_0x4ef0cd[_0xfadb('0x41')]=[{'all':!![]}];}return db[_0xfadb('0x2a')][_0xfadb('0x42')](_0x4ef0cd);})[_0xfadb('0x22')](function(_0x367fbb){_0x47b3d1[_0xfadb('0x43')]=_0x367fbb;return _0x47b3d1;})[_0xfadb('0x22')](respondWithFilteredResult(_0x2ad1bc,_0x4ef0cd))[_0xfadb('0x44')](handleError(_0x2ad1bc,null));};exports[_0xfadb('0x45')]=function(_0x3d164d,_0x287a51){var _0x53dbe9={'raw':!![],'where':{'id':_0x3d164d[_0xfadb('0x46')]['id']}},_0x17a89e={};_0x17a89e[_0xfadb('0x2c')]=_['keys'](db[_0xfadb('0x2a')]['rawAttributes']);_0x17a89e[_0xfadb('0x2d')]=_['keys'](_0x3d164d[_0xfadb('0x2d')]);_0x17a89e[_0xfadb('0x2f')]=_[_0xfadb('0x31')](_0x17a89e[_0xfadb('0x2c')],_0x17a89e[_0xfadb('0x2d')]);_0x53dbe9['attributes']=_[_0xfadb('0x31')](_0x17a89e[_0xfadb('0x2c')],qs['fields'](_0x3d164d[_0xfadb('0x2d')][_0xfadb('0x32')]));_0x53dbe9['attributes']=_0x53dbe9['attributes']['length']?_0x53dbe9[_0xfadb('0x30')]:_0x17a89e[_0xfadb('0x2c')];if(_0x3d164d[_0xfadb('0x2d')]['includeAll']){_0x53dbe9[_0xfadb('0x41')]=[{'all':!![]}];}_0x53dbe9=_['merge']({},_0x53dbe9,_0x3d164d[_0xfadb('0x3e')]);return db[_0xfadb('0x2a')]['find'](_0x53dbe9)[_0xfadb('0x22')](handleEntityNotFound(_0x287a51,null))[_0xfadb('0x22')](respondWithResult(_0x287a51,null))['catch'](handleError(_0x287a51,null));};exports[_0xfadb('0x47')]=function(_0x405d7c,_0x5c996c){return db[_0xfadb('0x2a')][_0xfadb('0x47')](_0x405d7c['body'],{})['then'](function(_0x5e551f){var _0x42e17d=_0x405d7c['user'][_0xfadb('0x24')]({'plain':!![]});if(!_0x42e17d)throw new Error(_0xfadb('0x48'));if(_0x42e17d[_0xfadb('0x49')]===_0xfadb('0x4a')){var _0x4ff9ee=_0x5e551f[_0xfadb('0x24')]({'plain':!![]});var _0x4bbdfa=_0xfadb('0x25');return db[_0xfadb('0x4b')][_0xfadb('0x4c')]({'where':{'name':_0x4bbdfa,'userProfileId':_0x42e17d[_0xfadb('0x4d')]},'raw':!![]})[_0xfadb('0x22')](function(_0x28e39a){if(_0x28e39a&&_0x28e39a[_0xfadb('0x4e')]===0x0){return db[_0xfadb('0x26')][_0xfadb('0x47')]({'name':_0x4ff9ee['name'],'resourceId':_0x4ff9ee['id'],'type':_0x28e39a[_0xfadb('0x29')],'sectionId':_0x28e39a['id']},{})[_0xfadb('0x22')](function(){return _0x5e551f;});}else{return _0x5e551f;}})['catch'](function(_0x568783){logger['error'](_0xfadb('0x4f'),_0x568783);throw _0x568783;});}return _0x5e551f;})[_0xfadb('0x22')](respondWithResult(_0x5c996c,0xc9))['catch'](handleError(_0x5c996c,null));};exports[_0xfadb('0x21')]=function(_0x48c8d4,_0x55663c){if(_0x48c8d4['body']['id']){delete _0x48c8d4[_0xfadb('0x50')]['id'];}return db[_0xfadb('0x2a')][_0xfadb('0x4c')]({'where':{'id':_0x48c8d4[_0xfadb('0x46')]['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x55663c,null))[_0xfadb('0x22')](saveUpdates(_0x48c8d4[_0xfadb('0x50')],null))[_0xfadb('0x22')](respondWithResult(_0x55663c,null))[_0xfadb('0x44')](handleError(_0x55663c,null));};exports[_0xfadb('0x23')]=function(_0x4fb0bb,_0x41f0e1){return db[_0xfadb('0x2a')]['find']({'where':{'id':_0x4fb0bb['params']['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x41f0e1,null))[_0xfadb('0x22')](removeEntity(_0x41f0e1,null))[_0xfadb('0x44')](handleError(_0x41f0e1,null));};exports[_0xfadb('0x51')]=function(_0xc37817,_0x46b6be,_0x471a32){if(_0xc37817[_0xfadb('0x50')]['id']){delete _0xc37817[_0xfadb('0x50')]['id'];}return db[_0xfadb('0x2a')][_0xfadb('0x4c')]({'where':{'id':_0xc37817[_0xfadb('0x46')]['id']}})['then'](handleEntityNotFound(_0x46b6be,null))[_0xfadb('0x22')](function(_0x4b8ecb){if(_0x4b8ecb){_0xc37817['body'][_0xfadb('0x52')]=_0x4b8ecb['id'];return db[_0xfadb('0x2a')][_0xfadb('0x47')](_0xc37817[_0xfadb('0x50')]);}})[_0xfadb('0x22')](respondWithResult(_0x46b6be,null))['catch'](handleError(_0x46b6be,null));};exports[_0xfadb('0x53')]=function(_0x6e4313,_0x14ba04,_0x272941){var _0x421608={};var _0x29960f={};var _0x2cdd6d;var _0x46ab4d;return db[_0xfadb('0x2a')][_0xfadb('0x54')]({'where':{'id':_0x6e4313[_0xfadb('0x46')]['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x14ba04,null))['then'](function(_0xa2be6a){if(_0xa2be6a){_0x2cdd6d=_0xa2be6a;_0x29960f[_0xfadb('0x2c')]=_[_0xfadb('0x2e')](db['Interval'][_0xfadb('0x2b')]);_0x29960f['query']=_[_0xfadb('0x2e')](_0x6e4313[_0xfadb('0x2d')]);_0x29960f[_0xfadb('0x2f')]=_[_0xfadb('0x31')](_0x29960f[_0xfadb('0x2c')],_0x29960f['query']);_0x421608[_0xfadb('0x30')]=_['intersection'](_0x29960f[_0xfadb('0x2c')],qs[_0xfadb('0x32')](_0x6e4313[_0xfadb('0x2d')][_0xfadb('0x32')]));_0x421608['attributes']=_0x421608[_0xfadb('0x30')][_0xfadb('0x33')]?_0x421608[_0xfadb('0x30')]:_0x29960f[_0xfadb('0x2c')];_0x421608[_0xfadb('0x36')]=qs[_0xfadb('0x37')](_0x6e4313['query'][_0xfadb('0x37')]);_0x421608[_0xfadb('0x38')]=qs[_0xfadb('0x2f')](_[_0xfadb('0x55')](_0x6e4313[_0xfadb('0x2d')],_0x29960f[_0xfadb('0x2f')]));if(_0x6e4313[_0xfadb('0x2d')][_0xfadb('0x3d')]){_0x421608[_0xfadb('0x38')]=_[_0xfadb('0x39')](_0x421608['where'],{'$or':_['map'](_0x421608['attributes'],function(_0x1bac5f){var _0x5ea6d3={};_0x5ea6d3[_0x1bac5f]={'$like':'%'+_0x6e4313['query'][_0xfadb('0x3d')]+'%'};return _0x5ea6d3;})});}_0x421608=_[_0xfadb('0x39')]({},_0x421608,_0x6e4313['options']);return _0x2cdd6d[_0xfadb('0x53')](_0x421608);}})[_0xfadb('0x22')](function(_0x49af48){if(_0x49af48){_0x46ab4d=_0x49af48[_0xfadb('0x33')];if(!_0x6e4313[_0xfadb('0x2d')]['hasOwnProperty']('nolimit')){_0x421608['limit']=qs[_0xfadb('0x1c')](_0x6e4313[_0xfadb('0x2d')][_0xfadb('0x1c')]);_0x421608[_0xfadb('0x1b')]=qs['offset'](_0x6e4313['query'][_0xfadb('0x1b')]);}return _0x2cdd6d['getIntervals'](_0x421608);}})[_0xfadb('0x22')](function(_0x4251b3){if(_0x4251b3){return _0x4251b3?{'count':_0x46ab4d,'rows':_0x4251b3}:null;}})[_0xfadb('0x22')](respondWithResult(_0x14ba04,null))['catch'](handleError(_0x14ba04,null));};exports[_0xfadb('0x56')]=function(_0x267bfc,_0x3db6ac,_0x4cd473){return db['Interval'][_0xfadb('0x54')]({'where':{'id':_0x267bfc[_0xfadb('0x46')]['id']}})[_0xfadb('0x22')](handleEntityNotFound(_0x3db6ac,null))['then'](function(_0xf7af8f){if(_0xf7af8f){return db[_0xfadb('0x57')]['transaction'](function(_0x2c14ae){return db[_0xfadb('0x2a')][_0xfadb('0x23')]({'where':{'IntervalId':_0x267bfc[_0xfadb('0x46')]['id']},'transaction':_0x2c14ae})['then'](function(_0x58ee7a){var _0x91fec5=_[_0xfadb('0x3a')](_0x267bfc[_0xfadb('0x50')],function(_0x34145e){delete _0x34145e['id'];_0x34145e[_0xfadb('0x52')]=_0x267bfc[_0xfadb('0x46')]['id'];return _0x34145e;});return db[_0xfadb('0x2a')][_0xfadb('0x58')](_0x91fec5,{'transaction':_0x2c14ae});});})[_0xfadb('0x22')](function(){return db[_0xfadb('0x2a')][_0xfadb('0x42')]({'where':{'IntervalId':_0x267bfc[_0xfadb('0x46')]['id']}});});}})[_0xfadb('0x22')](respondWithResult(_0x3db6ac,null))[_0xfadb('0x44')](handleError(_0x3db6ac,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 2aa0138..c690659 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 _0xac29=['define','Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x500cf3,_0x32c2c6){var _0x1d7911=function(_0x777dca){while(--_0x777dca){_0x500cf3['push'](_0x500cf3['shift']());}};_0x1d7911(++_0x32c2c6);}(_0xac29,0x13b));var _0x9ac2=function(_0x1fae66,_0xac6c78){_0x1fae66=_0x1fae66-0x0;var _0x2d08a9=_0xac29[_0x1fae66];return _0x2d08a9;};'use strict';var _=require(_0x9ac2('0x0'));var util=require(_0x9ac2('0x1'));var logger=require(_0x9ac2('0x2'))(_0x9ac2('0x3'));var moment=require(_0x9ac2('0x4'));var BPromise=require(_0x9ac2('0x5'));var rp=require(_0x9ac2('0x6'));var fs=require('fs');var path=require(_0x9ac2('0x7'));var rimraf=require('rimraf');var config=require(_0x9ac2('0x8'));var attributes=require('./interval.attributes');var extensions=require('../../components/extensions/rewrite');module[_0x9ac2('0x9')]=function(_0x2352dd,_0x2e45f9){return _0x2352dd[_0x9ac2('0xa')](_0x9ac2('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xa5ac8,_0x4e58d6){extensions[_0x9ac2('0xc')](_0x2352dd,_0xa5ac8);},'afterBulkCreate':function(_0x555d41,_0x3c81c0,_0x417873){_0x417873();extensions[_0x9ac2('0xc')](_0x2352dd,_0x555d41[0x0]);},'afterUpdate':function(_0xa44c0b,_0x3273dd){extensions[_0x9ac2('0xc')](_0x2352dd,_0xa44c0b);},'afterDestroy':function(_0xe5eee1,_0x10e95c){extensions[_0x9ac2('0xc')](_0x2352dd,_0xe5eee1);}}});}; \ No newline at end of file +var _0x1bf5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','exports','define','Interval','tools_intervals','rewrite'];(function(_0x1a4a6e,_0x152965){var _0x590be7=function(_0x59e8ba){while(--_0x59e8ba){_0x1a4a6e['push'](_0x1a4a6e['shift']());}};_0x590be7(++_0x152965);}(_0x1bf5,0xa0));var _0x51bf=function(_0x4c8540,_0x1243ae){_0x4c8540=_0x4c8540-0x0;var _0x32f264=_0x1bf5[_0x4c8540];return _0x32f264;};'use strict';var _=require(_0x51bf('0x0'));var util=require(_0x51bf('0x1'));var logger=require(_0x51bf('0x2'))(_0x51bf('0x3'));var moment=require(_0x51bf('0x4'));var BPromise=require(_0x51bf('0x5'));var rp=require(_0x51bf('0x6'));var fs=require('fs');var path=require(_0x51bf('0x7'));var rimraf=require(_0x51bf('0x8'));var config=require(_0x51bf('0x9'));var attributes=require(_0x51bf('0xa'));var extensions=require('../../components/extensions/rewrite');module[_0x51bf('0xb')]=function(_0x381488,_0x2e6566){return _0x381488[_0x51bf('0xc')](_0x51bf('0xd'),attributes,{'tableName':_0x51bf('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e408d,_0x111fd2){extensions[_0x51bf('0xf')](_0x381488,_0x2e408d);},'afterBulkCreate':function(_0x28ad3b,_0x31dee7,_0x27a4ba){_0x27a4ba();extensions[_0x51bf('0xf')](_0x381488,_0x28ad3b[0x0]);},'afterUpdate':function(_0x574329,_0x462744){extensions[_0x51bf('0xf')](_0x381488,_0x574329);},'afterDestroy':function(_0x2c1335,_0x13c21d){extensions['rewrite'](_0x381488,_0x2c1335);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 1c33600..8b143ef 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 _0xabce=['../../config/utils','../../config/logger','rpc','client','then','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetInterval','Interval','findAll','options','attributes','include','model','map','catch','ShowInterval','find','raw','where','lodash','util','moment','bluebird','randomstring'];(function(_0x215161,_0x250b6d){var _0x419855=function(_0x2d9134){while(--_0x2d9134){_0x215161['push'](_0x215161['shift']());}};_0x419855(++_0x250b6d);}(_0xabce,0x103));var _0xeabc=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xabce[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Interval,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'limit':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['limit']||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x19')]?_['map'](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x19')],function(_0x214953){return{'model':db[_0x214953[_0xeabc('0x1a')]],'as':_0x214953['as'],'attributes':_0x214953['attributes'],'include':_0x214953[_0xeabc('0x19')]?_['map'](_0x214953[_0xeabc('0x19')],function(_0x4d4e29){return{'model':db[_0x4d4e29[_0xeabc('0x1a')]],'as':_0x4d4e29['as'],'attributes':_0x4d4e29[_0xeabc('0x18')],'include':_0x4d4e29[_0xeabc('0x19')]?_[_0xeabc('0x1b')](_0x4d4e29[_0xeabc('0x19')],function(_0x137293){return{'model':db[_0x137293[_0xeabc('0x1a')]],'as':_0x137293['as'],'attributes':_0x137293['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x459c8a){logger['info'](_0xeabc('0x14'),_0x58a3c0);logger[_0xeabc('0xd')]('GetInterval',_0x58a3c0,JSON[_0xeabc('0xf')](_0x459c8a));_0x31dd53(_0x459c8a);})[_0xeabc('0x1c')](function(_0x2b568f){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x2b568f[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x2b568f[_0xeabc('0x12')]));});});};exports[_0xeabc('0x1d')]=function(_0x5ebb86){var _0x5b34dd=this;return new Promise(function(_0x5bb1f1,_0x2f03e8){return db[_0xeabc('0x15')][_0xeabc('0x1e')]({'raw':_0x5ebb86[_0xeabc('0x17')]?_0x5ebb86[_0xeabc('0x17')][_0xeabc('0x1f')]===undefined?!![]:![]:!![],'where':_0x5ebb86[_0xeabc('0x17')]?_0x5ebb86['options'][_0xeabc('0x20')]||null:null,'attributes':_0x5ebb86[_0xeabc('0x17')]?_0x5ebb86[_0xeabc('0x17')]['attributes']||null:null,'include':_0x5ebb86[_0xeabc('0x17')]?_0x5ebb86[_0xeabc('0x17')][_0xeabc('0x19')]?_['map'](_0x5ebb86[_0xeabc('0x17')][_0xeabc('0x19')],function(_0x1f910d){return{'model':db[_0x1f910d['model']],'as':_0x1f910d['as'],'attributes':_0x1f910d[_0xeabc('0x18')],'include':_0x1f910d[_0xeabc('0x19')]?_['map'](_0x1f910d['include'],function(_0x254568){return{'model':db[_0x254568[_0xeabc('0x1a')]],'as':_0x254568['as'],'attributes':_0x254568['attributes'],'include':_0x254568[_0xeabc('0x19')]?_[_0xeabc('0x1b')](_0x254568[_0xeabc('0x19')],function(_0x10434e){return{'model':db[_0x10434e[_0xeabc('0x1a')]],'as':_0x10434e['as'],'attributes':_0x10434e['attributes']};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x5b61fa){logger[_0xeabc('0xa')](_0xeabc('0x1d'),_0x5ebb86);logger[_0xeabc('0xd')]('ShowInterval',_0x5ebb86,JSON['stringify'](_0x5b61fa));_0x5bb1f1(_0x5b61fa);})[_0xeabc('0x1c')](function(_0x560d4a){logger[_0xeabc('0x10')]('ShowInterval',_0x560d4a['message'],_0x5ebb86);_0x2f03e8(_0x5b34dd['error'](0x1f4,_0x560d4a['message']));});});}; \ No newline at end of file +var _0xf494=['attributes','limit','include','map','model','debug','stringify','ShowInterval','Interval','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','error','message','catch','GetInterval','findAll','options','raw','where'];(function(_0x279860,_0x549387){var _0x1ed55e=function(_0x84716){while(--_0x84716){_0x279860['push'](_0x279860['shift']());}};_0x1ed55e(++_0x549387);}(_0xf494,0x1c6));var _0x4f49=function(_0x532f9e,_0x28cbce){_0x532f9e=_0x532f9e-0x0;var _0x589278=_0xf494[_0x532f9e];return _0x589278;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}exports[_0x4f49('0x16')]=function(_0x4e85df){var _0x49cdaf=this;return new Promise(function(_0x5bb23b,_0x560592){return db['Interval'][_0x4f49('0x17')]({'raw':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x4e85df[_0x4f49('0x18')]?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'limit':_0x4e85df['options']?_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1c')]||null:null,'include':_0x4e85df[_0x4f49('0x18')]?_0x4e85df['options'][_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x4e85df[_0x4f49('0x18')][_0x4f49('0x1d')],function(_0x9d30aa){return{'model':db[_0x9d30aa[_0x4f49('0x1f')]],'as':_0x9d30aa['as'],'attributes':_0x9d30aa['attributes'],'include':_0x9d30aa['include']?_[_0x4f49('0x1e')](_0x9d30aa[_0x4f49('0x1d')],function(_0x4fedbb){return{'model':db[_0x4fedbb[_0x4f49('0x1f')]],'as':_0x4fedbb['as'],'attributes':_0x4fedbb[_0x4f49('0x1b')],'include':_0x4fedbb[_0x4f49('0x1d')]?_['map'](_0x4fedbb[_0x4f49('0x1d')],function(_0x2eed1c){return{'model':db[_0x2eed1c[_0x4f49('0x1f')]],'as':_0x2eed1c['as'],'attributes':_0x2eed1c[_0x4f49('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x122404){logger['info']('GetInterval',_0x4e85df);logger[_0x4f49('0x20')](_0x4f49('0x16'),_0x4e85df,JSON[_0x4f49('0x21')](_0x122404));_0x5bb23b(_0x122404);})['catch'](function(_0x3cbfbd){logger[_0x4f49('0x13')](_0x4f49('0x16'),_0x3cbfbd['message'],_0x4e85df);_0x560592(_0x49cdaf['error'](0x1f4,_0x3cbfbd[_0x4f49('0x14')]));});});};exports[_0x4f49('0x22')]=function(_0x7a6ea0){var _0x5e7076=this;return new Promise(function(_0x1eaac6,_0x35aa33){return db[_0x4f49('0x23')][_0x4f49('0x24')]({'raw':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x19')]===undefined?!![]:![]:!![],'where':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1a')]||null:null,'attributes':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1b')]||null:null,'include':_0x7a6ea0[_0x4f49('0x18')]?_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x18')][_0x4f49('0x1d')],function(_0x492b16){return{'model':db[_0x492b16[_0x4f49('0x1f')]],'as':_0x492b16['as'],'attributes':_0x492b16[_0x4f49('0x1b')],'include':_0x492b16[_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x492b16[_0x4f49('0x1d')],function(_0x15e82b){return{'model':db[_0x15e82b[_0x4f49('0x1f')]],'as':_0x15e82b['as'],'attributes':_0x15e82b[_0x4f49('0x1b')],'include':_0x15e82b[_0x4f49('0x1d')]?_[_0x4f49('0x1e')](_0x15e82b[_0x4f49('0x1d')],function(_0x343365){return{'model':db[_0x343365[_0x4f49('0x1f')]],'as':_0x343365['as'],'attributes':_0x343365['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f49('0xe')](function(_0x27b7a9){logger[_0x4f49('0xf')](_0x4f49('0x22'),_0x7a6ea0);logger[_0x4f49('0x20')](_0x4f49('0x22'),_0x7a6ea0,JSON[_0x4f49('0x21')](_0x27b7a9));_0x1eaac6(_0x27b7a9);})[_0x4f49('0x15')](function(_0x10bfc4){logger[_0x4f49('0x13')](_0x4f49('0x22'),_0x10bfc4[_0x4f49('0x14')],_0x7a6ea0);_0x35aa33(_0x5e7076[_0x4f49('0x13')](0x1f4,_0x10bfc4[_0x4f49('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 9f6c360..118a128 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x4c5742,_0x430d55){var _0x19f3c9=function(_0x1615f4){while(--_0x1615f4){_0x4c5742['push'](_0x4c5742['shift']());}};_0x19f3c9(++_0x430d55);}(_0xadb5,0xad));var _0x5adb=function(_0xf3343b,_0x32644b){_0xf3343b=_0xf3343b-0x0;var _0x5eaee8=_0xadb5[_0xf3343b];return _0x5eaee8;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2032=['isAuthenticated','send','Router','../../components/auth/service','./jira.controller'];(function(_0x57c0cc,_0xc7c917){var _0xc5d912=function(_0x69246b){while(--_0x69246b){_0x57c0cc['push'](_0x57c0cc['shift']());}};_0xc5d912(++_0xc7c917);}(_0x2032,0xd9));var _0x2203=function(_0x2064fe,_0x227f68){_0x2064fe=_0x2064fe-0x0;var _0x559631=_0x2032[_0x2064fe];return _0x559631;};'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 9df935f..6ee5ac4 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 _0xbaf0=['description','stringify','issuetype','fields','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_10102','track.xcallymotion.com','POST','Basic\x20','toString','base64','setEncoding','utf8','data','end','statusCode','json','parse','error','status','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20'];(function(_0x190a6f,_0x2e77b4){var _0x3c0cb6=function(_0x10b53e){while(--_0x10b53e){_0x190a6f['push'](_0x190a6f['shift']());}};_0x3c0cb6(++_0x2e77b4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var BPromise=require('bluebird');var https=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var USERNAME=_0x0baf('0x3');var PASSWORD=_0x0baf('0x4');function openIssue(_0x4d2e72,_0x5a3e42){var _0x232cc7={'fields':{'project':{'key':_0x4d2e72[_0x0baf('0x5')]||_0x0baf('0x6')},'summary':(_0x4d2e72[_0x0baf('0x7')]||_0x0baf('0x8'))+_0x0baf('0x9')+_0x4d2e72['ip'],'description':_0x4d2e72[_0x0baf('0xa')]||JSON[_0x0baf('0xb')](_0x4d2e72),'issuetype':{'name':_0x4d2e72[_0x0baf('0xc')]||'Bug'}}};_0x232cc7[_0x0baf('0xd')]['customfield_11500']=_0x4d2e72[_0x0baf('0xe')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0xf')]=_0x4d2e72[_0x0baf('0x10')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x11')]=_0x4d2e72[_0x0baf('0x12')];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x13')]=_0x4d2e72[_0x0baf('0x14')];_0x232cc7[_0x0baf('0xd')]['customfield_11504']=_0x4d2e72['reason'];_0x232cc7[_0x0baf('0xd')][_0x0baf('0x15')]=_0x4d2e72['ip'];var _0x5db689={'host':_0x0baf('0x16'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x0baf('0x17'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0baf('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x0baf('0x19')](_0x0baf('0x1a'))}};var _0x2bc381=JSON[_0x0baf('0xb')](_0x232cc7);var _0x469599=https['request'](_0x5db689,function(_0x4cd79d){_0x4cd79d[_0x0baf('0x1b')](_0x0baf('0x1c'));var _0x283408='';_0x4cd79d['on'](_0x0baf('0x1d'),function(_0x2cf7da){_0x283408+=_0x2cf7da;});_0x4cd79d['on'](_0x0baf('0x1e'),function(){if(_0x5a3e42){return _0x5a3e42['status'](_0x4cd79d[_0x0baf('0x1f')])[_0x0baf('0x20')](JSON[_0x0baf('0x21')](_0x283408));}});});_0x469599['on'](_0x0baf('0x22'),function(_0x47070d){if(_0x5a3e42){return _0x5a3e42[_0x0baf('0x23')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x0baf('0x24')}]});}});_0x469599[_0x0baf('0x25')](_0x2bc381);_0x469599[_0x0baf('0x1e')]();}exports[_0x0baf('0x26')]=openIssue;exports[_0x0baf('0x27')]=function(_0x3e3e20,_0x210cd8){_0x3e3e20[_0x0baf('0x28')]['ip']=_0x3e3e20[_0x0baf('0x29')][_0x0baf('0x2a')]||_0x3e3e20['connection'][_0x0baf('0x2b')]||_0x3e3e20['socket'][_0x0baf('0x2b')]||_0x3e3e20['connection']['socket'][_0x0baf('0x2b')];return openIssue(_0x3e3e20['body'],_0x210cd8);}; \ No newline at end of file +var _0xe706=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','toString','utf8','end','statusCode','json','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','../../config/logger','support','3eAmWpBVP0'];(function(_0x3f3913,_0x4b43e1){var _0x16dea4=function(_0xaa6b41){while(--_0xaa6b41){_0x3f3913['push'](_0x3f3913['shift']());}};_0x16dea4(++_0x4b43e1);}(_0xe706,0xa3));var _0x6e70=function(_0x1c12bd,_0x348360){_0x1c12bd=_0x1c12bd-0x0;var _0x1de620=_0xe706[_0x1c12bd];return _0x1de620;};'use strict';var BPromise=require(_0x6e70('0x0'));var https=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var USERNAME=_0x6e70('0x3');var PASSWORD=_0x6e70('0x4');function openIssue(_0x2ca810,_0x7dfbc3){var _0x142c27={'fields':{'project':{'key':_0x2ca810[_0x6e70('0x5')]||_0x6e70('0x6')},'summary':(_0x2ca810[_0x6e70('0x7')]||_0x6e70('0x8'))+_0x6e70('0x9')+_0x2ca810['ip'],'description':_0x2ca810[_0x6e70('0xa')]||JSON[_0x6e70('0xb')](_0x2ca810),'issuetype':{'name':_0x2ca810[_0x6e70('0xc')]||_0x6e70('0xd')}}};_0x142c27[_0x6e70('0xe')][_0x6e70('0xf')]=_0x2ca810[_0x6e70('0x10')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x11')]=_0x2ca810[_0x6e70('0x12')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x13')]=_0x2ca810[_0x6e70('0x14')];_0x142c27[_0x6e70('0xe')]['customfield_11503']=_0x2ca810['name'];_0x142c27[_0x6e70('0xe')][_0x6e70('0x15')]=_0x2ca810[_0x6e70('0x16')];_0x142c27[_0x6e70('0xe')][_0x6e70('0x17')]=_0x2ca810['ip'];var _0x310eb7={'host':_0x6e70('0x18'),'port':0x1bb,'path':_0x6e70('0x19'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6e70('0x1a')]('base64')}};var _0x53aed0=JSON[_0x6e70('0xb')](_0x142c27);var _0x22c50c=https['request'](_0x310eb7,function(_0x24f3ac){_0x24f3ac['setEncoding'](_0x6e70('0x1b'));var _0x161f23='';_0x24f3ac['on']('data',function(_0x49029f){_0x161f23+=_0x49029f;});_0x24f3ac['on'](_0x6e70('0x1c'),function(){if(_0x7dfbc3){return _0x7dfbc3['status'](_0x24f3ac[_0x6e70('0x1d')])[_0x6e70('0x1e')](JSON['parse'](_0x161f23));}});});_0x22c50c['on']('error',function(_0xc238ba){if(_0x7dfbc3){return _0x7dfbc3[_0x6e70('0x1f')](0x1f4)[_0x6e70('0x1e')]({'errors':[{'message':_0x6e70('0x20'),'type':_0x6e70('0x21')}]});}});_0x22c50c[_0x6e70('0x22')](_0x53aed0);_0x22c50c[_0x6e70('0x1c')]();}exports[_0x6e70('0x23')]=openIssue;exports[_0x6e70('0x24')]=function(_0xb29a2a,_0x4a0cfe){_0xb29a2a[_0x6e70('0x25')]['ip']=_0xb29a2a[_0x6e70('0x26')][_0x6e70('0x27')]||_0xb29a2a['connection'][_0x6e70('0x28')]||_0xb29a2a[_0x6e70('0x29')][_0x6e70('0x28')]||_0xb29a2a['connection'][_0x6e70('0x29')]['remoteAddress'];return openIssue(_0xb29a2a['body'],_0x4a0cfe);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index f7f65db..8fef3d2 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 _0x9ead=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','index','/describe','describe','get','/:id','post','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x224890,_0x1eec5c){var _0x1f8055=function(_0x444b5a){while(--_0x444b5a){_0x224890['push'](_0x224890['shift']());}};_0x1f8055(++_0x1eec5c);}(_0x9ead,0x19f));var _0xd9ea=function(_0x1fcf1b,_0x214549){_0x1fcf1b=_0x1fcf1b-0x0;var _0x5d2952=_0x9ead[_0x1fcf1b];return _0x5d2952;};'use strict';var multer=require(_0xd9ea('0x0'));var util=require(_0xd9ea('0x1'));var path=require(_0xd9ea('0x2'));var timeout=require(_0xd9ea('0x3'));var express=require(_0xd9ea('0x4'));var router=express[_0xd9ea('0x5')]();var auth=require(_0xd9ea('0x6'));var interaction=require(_0xd9ea('0x7'));var config=require(_0xd9ea('0x8'));var controller=require(_0xd9ea('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xd9ea('0xa')]);router['get'](_0xd9ea('0xb'),auth['isAuthenticated'](),controller[_0xd9ea('0xc')]);router[_0xd9ea('0xd')](_0xd9ea('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xd9ea('0xf')]('/',auth[_0xd9ea('0x10')](),controller['create']);router['put']('/:id',auth[_0xd9ea('0x10')](),controller['update']);router['delete'](_0xd9ea('0xe'),auth[_0xd9ea('0x10')](),controller[_0xd9ea('0x11')]);module[_0xd9ea('0x12')]=router; \ No newline at end of file +var _0xbcde=['/describe','describe','/:id','show','create','put','update','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x486083,_0xeb3b54){var _0x1db44e=function(_0x2586fc){while(--_0x2586fc){_0x486083['push'](_0x486083['shift']());}};_0x1db44e(++_0xeb3b54);}(_0xbcde,0x13a));var _0xebcd=function(_0x254a6f,_0x18e991){_0x254a6f=_0x254a6f-0x0;var _0x2abc55=_0xbcde[_0x254a6f];return _0x2abc55;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xebcd('0x0'));var timeout=require(_0xebcd('0x1'));var express=require('express');var router=express[_0xebcd('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xebcd('0x3'));var config=require(_0xebcd('0x4'));var controller=require(_0xebcd('0x5'));router[_0xebcd('0x6')]('/',auth[_0xebcd('0x7')](),controller[_0xebcd('0x8')]);router[_0xebcd('0x6')](_0xebcd('0x9'),auth[_0xebcd('0x7')](),controller[_0xebcd('0xa')]);router[_0xebcd('0x6')](_0xebcd('0xb'),auth[_0xebcd('0x7')](),controller[_0xebcd('0xc')]);router['post']('/',auth[_0xebcd('0x7')](),controller[_0xebcd('0xd')]);router[_0xebcd('0xe')](_0xebcd('0xb'),auth['isAuthenticated'](),controller[_0xebcd('0xf')]);router['delete'](_0xebcd('0xb'),auth[_0xebcd('0x7')](),controller['destroy']);module[_0xebcd('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 120b77d..8109bf1 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 _0xdace=['long','sequelize','STRING','TEXT'];(function(_0x4c0073,_0x49fc3f){var _0x2cae23=function(_0x158f6d){while(--_0x158f6d){_0x4c0073['push'](_0x4c0073['shift']());}};_0x2cae23(++_0x49fc3f);}(_0xdace,0xc5));var _0xedac=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xdace[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'question':{'type':Sequelize[_0xedac('0x1')]},'answer':{'type':Sequelize[_0xedac('0x2')](_0xedac('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xedac('0x1')]},'queue':{'type':Sequelize[_0xedac('0x1')]},'uniqueid':{'type':Sequelize[_0xedac('0x1')]},'calleridname':{'type':Sequelize[_0xedac('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xedac('0x1')]}}; \ No newline at end of file +var _0x1be1=['STRING','TEXT'];(function(_0x7f9e59,_0x203192){var _0x1b505c=function(_0x234bb0){while(--_0x234bb0){_0x7f9e59['push'](_0x7f9e59['shift']());}};_0x1b505c(++_0x203192);}(_0x1be1,0x192));var _0x11be=function(_0x56c23a,_0x23e40a){_0x56c23a=_0x56c23a-0x0;var _0x4f965f=_0x1be1[_0x56c23a];return _0x4f965f;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0x11be('0x0')]},'answer':{'type':Sequelize[_0x11be('0x1')]('long')},'membername':{'type':Sequelize[_0x11be('0x0')]},'projectname':{'type':Sequelize[_0x11be('0x0')]},'queue':{'type':Sequelize[_0x11be('0x0')]},'uniqueid':{'type':Sequelize[_0x11be('0x0')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x11be('0x0')]},'questionId':{'type':Sequelize[_0x11be('0x0')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index c0d8f82..c9a496d 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 _0x66fa=['html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','update','error','stack','name','index','keys','query','filters','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','includeAll','JscriptyAnswerReport','findAll','then','show','params','rawAttributes','include','find','catch','create','body','destroy','describe'];(function(_0x21bad5,_0x23a39d){var _0x235106=function(_0x281b1f){while(--_0x281b1f){_0x21bad5['push'](_0x21bad5['shift']());}};_0x235106(++_0x23a39d);}(_0x66fa,0x168));var _0xa66f=function(_0x4e7ce0,_0x19712e){_0x4e7ce0=_0x4e7ce0-0x0;var _0x408792=_0x66fa[_0x4e7ce0];return _0x408792;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require(_0xa66f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require(_0xa66f('0x9'));var csv=require(_0xa66f('0xa'));var ejs=require(_0xa66f('0xb'));var fs=require('fs');var _=require(_0xa66f('0xc'));var squel=require(_0xa66f('0xd'));var crypto=require('crypto');var jsforce=require(_0xa66f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa66f('0xa'));var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require(_0xa66f('0x11'));var qs=require(_0xa66f('0x12'));var hardwareService=require(_0xa66f('0x13'));var logger=require(_0xa66f('0x14'))(_0xa66f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa66f('0x16'))['db'];function respondWithStatusCode(_0x59f8f8,_0x45dbb4){_0x45dbb4=_0x45dbb4||0xcc;return function(_0x6ad626){if(_0x6ad626){return _0x59f8f8[_0xa66f('0x17')](_0x45dbb4);}return _0x59f8f8['status'](_0x45dbb4)[_0xa66f('0x18')]();};}function respondWithResult(_0x1a1ab2,_0x4ad224){_0x4ad224=_0x4ad224||0xc8;return function(_0xaa9ef5){if(_0xaa9ef5){return _0x1a1ab2[_0xa66f('0x19')](_0x4ad224)[_0xa66f('0x1a')](_0xaa9ef5);}};}function respondWithFilteredResult(_0x96a262,_0x589665){return function(_0x3795cb){if(_0x3795cb){var _0x27f04e=_0x3795cb[_0xa66f('0x1b')],_0x5685c4=_0x589665[_0xa66f('0x1c')],_0x2d9ec7=_0x589665[_0xa66f('0x1c')]+_0x589665[_0xa66f('0x1d')],_0x33270b;if(_0x2d9ec7>=_0x27f04e){_0x2d9ec7=_0x27f04e;_0x33270b=0xc8;}else{_0x33270b=0xce;}_0x96a262['status'](_0x33270b);return _0x96a262['set'](_0xa66f('0x1e'),_0x5685c4+'-'+_0x2d9ec7+'/'+_0x27f04e)[_0xa66f('0x1a')](_0x3795cb);}return null;};}function patchUpdates(_0x1b4ab0){return function(_0x49c15b){try{jsonpatch['apply'](_0x49c15b,_0x1b4ab0,!![]);}catch(_0x1e448e){return BPromise[_0xa66f('0x1f')](_0x1e448e);}return _0x49c15b['save']();};}function saveUpdates(_0x427120,_0x4b4099){return function(_0x3f4977){if(_0x3f4977){return _0x3f4977[_0xa66f('0x20')](_0x427120)['then'](function(_0x585208){return _0x585208;});}return null;};}function removeEntity(_0xc87a54,_0x5e6856){return function(_0x5b2cf0){if(_0x5b2cf0){return _0x5b2cf0['destroy']()['then'](function(){_0xc87a54[_0xa66f('0x19')](0xcc)[_0xa66f('0x18')]();});}};}function handleEntityNotFound(_0x1aeaf2,_0x4cfec6){return function(_0x20bf81){if(!_0x20bf81){_0x1aeaf2[_0xa66f('0x17')](0x194);}return _0x20bf81;};}function handleError(_0x5e8c5b,_0x27fdba){_0x27fdba=_0x27fdba||0x1f4;return function(_0x473b00){logger[_0xa66f('0x21')](_0x473b00[_0xa66f('0x22')]);if(_0x473b00[_0xa66f('0x23')]){delete _0x473b00[_0xa66f('0x23')];}_0x5e8c5b['status'](_0x27fdba)['send'](_0x473b00);};}exports[_0xa66f('0x24')]=function(_0x5a03f7,_0x45dc65){var _0x278531={},_0x2cf4c9={},_0x49e1b3={'count':0x0,'rows':[]};var _0x161f53=db['JscriptyAnswerReport']['rawAttributes'];_0x2cf4c9['model']=_[_0xa66f('0x25')](_0x161f53);_0x2cf4c9['query']=_[_0xa66f('0x25')](_0x5a03f7[_0xa66f('0x26')]);_0x2cf4c9[_0xa66f('0x27')]=_['intersection'](_0x2cf4c9['model'],_0x2cf4c9[_0xa66f('0x26')]);_0x278531[_0xa66f('0x28')]=_[_0xa66f('0x29')](_0x2cf4c9['model'],qs[_0xa66f('0x2a')](_0x5a03f7['query'][_0xa66f('0x2a')]));_0x278531[_0xa66f('0x28')]=_0x278531[_0xa66f('0x28')][_0xa66f('0x2b')]?_0x278531[_0xa66f('0x28')]:_0x2cf4c9[_0xa66f('0x2c')];if(!_0x5a03f7['query'][_0xa66f('0x2d')](_0xa66f('0x2e'))){_0x278531['limit']=qs[_0xa66f('0x1d')](_0x5a03f7[_0xa66f('0x26')]['limit']);_0x278531['offset']=qs[_0xa66f('0x1c')](_0x5a03f7[_0xa66f('0x26')][_0xa66f('0x1c')]);}_0x278531[_0xa66f('0x2f')]=qs[_0xa66f('0x30')](_0x5a03f7[_0xa66f('0x26')]['sort']);_0x278531[_0xa66f('0x31')]=qs[_0xa66f('0x27')](_[_0xa66f('0x32')](_0x5a03f7[_0xa66f('0x26')],_0x2cf4c9['filters']));if(_0x5a03f7['query'][_0xa66f('0x33')]){_0x278531['where']=_[_0xa66f('0x34')](_0x278531[_0xa66f('0x31')],{'$or':_[_0xa66f('0x35')](_0x161f53,function(_0x1d95e7){if(_0x1d95e7[_0xa66f('0x36')][_0xa66f('0x37')]!==_0xa66f('0x38')){var _0x32ec77={};_0x32ec77[_0x1d95e7[_0xa66f('0x39')]]={'$like':'%'+_0x5a03f7[_0xa66f('0x26')][_0xa66f('0x33')]+'%'};return _0x32ec77;}})});}_0x278531=_[_0xa66f('0x34')]({},_0x278531,_0x5a03f7['options']);var _0x3487d1={'where':_0x278531[_0xa66f('0x31')]};return db['JscriptyAnswerReport'][_0xa66f('0x1b')](_0x3487d1)['then'](function(_0x3462f3){_0x49e1b3[_0xa66f('0x1b')]=_0x3462f3;if(_0x5a03f7[_0xa66f('0x26')][_0xa66f('0x3a')]){_0x278531['include']=[{'all':!![]}];}return db[_0xa66f('0x3b')][_0xa66f('0x3c')](_0x278531);})[_0xa66f('0x3d')](function(_0x34a742){_0x49e1b3['rows']=_0x34a742;return _0x49e1b3;})[_0xa66f('0x3d')](respondWithFilteredResult(_0x45dc65,_0x278531))['catch'](handleError(_0x45dc65,null));};exports[_0xa66f('0x3e')]=function(_0xe4601d,_0x1f598b){var _0x2dca82={'raw':!![],'where':{'id':_0xe4601d[_0xa66f('0x3f')]['id']}},_0x48c375={};_0x48c375['model']=_[_0xa66f('0x25')](db[_0xa66f('0x3b')][_0xa66f('0x40')]);_0x48c375[_0xa66f('0x26')]=_[_0xa66f('0x25')](_0xe4601d[_0xa66f('0x26')]);_0x48c375[_0xa66f('0x27')]=_[_0xa66f('0x29')](_0x48c375[_0xa66f('0x2c')],_0x48c375[_0xa66f('0x26')]);_0x2dca82[_0xa66f('0x28')]=_[_0xa66f('0x29')](_0x48c375[_0xa66f('0x2c')],qs[_0xa66f('0x2a')](_0xe4601d[_0xa66f('0x26')]['fields']));_0x2dca82[_0xa66f('0x28')]=_0x2dca82[_0xa66f('0x28')][_0xa66f('0x2b')]?_0x2dca82['attributes']:_0x48c375[_0xa66f('0x2c')];if(_0xe4601d['query'][_0xa66f('0x3a')]){_0x2dca82[_0xa66f('0x41')]=[{'all':!![]}];}_0x2dca82=_[_0xa66f('0x34')]({},_0x2dca82,_0xe4601d['options']);return db['JscriptyAnswerReport'][_0xa66f('0x42')](_0x2dca82)[_0xa66f('0x3d')](handleEntityNotFound(_0x1f598b,null))[_0xa66f('0x3d')](respondWithResult(_0x1f598b,null))[_0xa66f('0x43')](handleError(_0x1f598b,null));};exports[_0xa66f('0x44')]=function(_0xd3363,_0x4eea29){return db[_0xa66f('0x3b')][_0xa66f('0x44')](_0xd3363['body'],{})['then'](respondWithResult(_0x4eea29,0xc9))[_0xa66f('0x43')](handleError(_0x4eea29,null));};exports[_0xa66f('0x20')]=function(_0x31d7c0,_0x2687f0){if(_0x31d7c0[_0xa66f('0x45')]['id']){delete _0x31d7c0['body']['id'];}return db[_0xa66f('0x3b')][_0xa66f('0x42')]({'where':{'id':_0x31d7c0[_0xa66f('0x3f')]['id']}})[_0xa66f('0x3d')](handleEntityNotFound(_0x2687f0,null))[_0xa66f('0x3d')](saveUpdates(_0x31d7c0['body'],null))[_0xa66f('0x3d')](respondWithResult(_0x2687f0,null))[_0xa66f('0x43')](handleError(_0x2687f0,null));};exports[_0xa66f('0x46')]=function(_0x2dc004,_0x35108c){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x2dc004[_0xa66f('0x3f')]['id']}})[_0xa66f('0x3d')](handleEntityNotFound(_0x35108c,null))[_0xa66f('0x3d')](removeEntity(_0x35108c,null))[_0xa66f('0x43')](handleError(_0x35108c,null));};exports[_0xa66f('0x47')]=function(_0x349872,_0x3a1efc){return db[_0xa66f('0x3b')]['describe']()[_0xa66f('0x3d')](respondWithResult(_0x3a1efc,null))[_0xa66f('0x43')](handleError(_0x3a1efc,null));}; \ No newline at end of file +var _0x7579=['then','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','includeAll','JscriptyAnswerReport','findAll','rows','catch','params','include','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update'];(function(_0x2c69a1,_0x201903){var _0x24bb91=function(_0x3131ac){while(--_0x3131ac){_0x2c69a1['push'](_0x2c69a1['shift']());}};_0x24bb91(++_0x201903);}(_0x7579,0x1e2));var _0x9757=function(_0x5bce69,_0x2669c4){_0x5bce69=_0x5bce69-0x0;var _0x20c418=_0x7579[_0x5bce69];return _0x20c418;};'use strict';var pdf=require(_0x9757('0x0'));var emlformat=require(_0x9757('0x1'));var rimraf=require(_0x9757('0x2'));var zipdir=require(_0x9757('0x3'));var jsonpatch=require(_0x9757('0x4'));var rp=require(_0x9757('0x5'));var moment=require('moment');var BPromise=require(_0x9757('0x6'));var Mustache=require(_0x9757('0x7'));var util=require(_0x9757('0x8'));var path=require(_0x9757('0x9'));var sox=require('sox');var csv=require(_0x9757('0xa'));var ejs=require(_0x9757('0xb'));var fs=require('fs');var _=require(_0x9757('0xc'));var squel=require('squel');var crypto=require(_0x9757('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9757('0xe'));var toCsv=require(_0x9757('0xa'));var querystring=require(_0x9757('0xf'));var Papa=require('papaparse');var Redis=require(_0x9757('0x10'));var authService=require(_0x9757('0x11'));var qs=require(_0x9757('0x12'));var hardwareService=require(_0x9757('0x13'));var logger=require(_0x9757('0x14'))(_0x9757('0x15'));var utils=require(_0x9757('0x16'));var config=require(_0x9757('0x17'));var db=require(_0x9757('0x18'))['db'];function respondWithStatusCode(_0x141e64,_0x7491ea){_0x7491ea=_0x7491ea||0xcc;return function(_0x5c19c9){if(_0x5c19c9){return _0x141e64[_0x9757('0x19')](_0x7491ea);}return _0x141e64[_0x9757('0x1a')](_0x7491ea)[_0x9757('0x1b')]();};}function respondWithResult(_0x595a9e,_0x32d1c5){_0x32d1c5=_0x32d1c5||0xc8;return function(_0x39fa5c){if(_0x39fa5c){return _0x595a9e[_0x9757('0x1a')](_0x32d1c5)[_0x9757('0x1c')](_0x39fa5c);}};}function respondWithFilteredResult(_0x224229,_0x3abf05){return function(_0x105e56){if(_0x105e56){var _0x4b994d=_0x105e56[_0x9757('0x1d')],_0x1fd6f6=_0x3abf05[_0x9757('0x1e')],_0x55ded7=_0x3abf05[_0x9757('0x1e')]+_0x3abf05[_0x9757('0x1f')],_0x17ab45;if(_0x55ded7>=_0x4b994d){_0x55ded7=_0x4b994d;_0x17ab45=0xc8;}else{_0x17ab45=0xce;}_0x224229[_0x9757('0x1a')](_0x17ab45);return _0x224229['set'](_0x9757('0x20'),_0x1fd6f6+'-'+_0x55ded7+'/'+_0x4b994d)[_0x9757('0x1c')](_0x105e56);}return null;};}function patchUpdates(_0x1c9449){return function(_0x284952){try{jsonpatch[_0x9757('0x21')](_0x284952,_0x1c9449,!![]);}catch(_0xd2306b){return BPromise[_0x9757('0x22')](_0xd2306b);}return _0x284952['save']();};}function saveUpdates(_0x185506,_0x4c1b66){return function(_0x517504){if(_0x517504){return _0x517504[_0x9757('0x23')](_0x185506)[_0x9757('0x24')](function(_0x1443a9){return _0x1443a9;});}return null;};}function removeEntity(_0x36cf6d,_0x559135){return function(_0x4ef000){if(_0x4ef000){return _0x4ef000['destroy']()[_0x9757('0x24')](function(){_0x36cf6d[_0x9757('0x1a')](0xcc)[_0x9757('0x1b')]();});}};}function handleEntityNotFound(_0x21435e,_0x5dc2fa){return function(_0x11f5ac){if(!_0x11f5ac){_0x21435e[_0x9757('0x19')](0x194);}return _0x11f5ac;};}function handleError(_0x5d6554,_0x293951){_0x293951=_0x293951||0x1f4;return function(_0x956048){logger['error'](_0x956048[_0x9757('0x25')]);if(_0x956048[_0x9757('0x26')]){delete _0x956048[_0x9757('0x26')];}_0x5d6554[_0x9757('0x1a')](_0x293951)[_0x9757('0x27')](_0x956048);};}exports[_0x9757('0x28')]=function(_0x4e6b86,_0x2a9438){var _0x57c770={},_0x2f2fe7={},_0x398c48={'count':0x0,'rows':[]};var _0x58ae5e=db['JscriptyAnswerReport'][_0x9757('0x29')];_0x2f2fe7[_0x9757('0x2a')]=_[_0x9757('0x2b')](_0x58ae5e);_0x2f2fe7[_0x9757('0x2c')]=_['keys'](_0x4e6b86[_0x9757('0x2c')]);_0x2f2fe7[_0x9757('0x2d')]=_[_0x9757('0x2e')](_0x2f2fe7[_0x9757('0x2a')],_0x2f2fe7[_0x9757('0x2c')]);_0x57c770[_0x9757('0x2f')]=_['intersection'](_0x2f2fe7[_0x9757('0x2a')],qs[_0x9757('0x30')](_0x4e6b86[_0x9757('0x2c')][_0x9757('0x30')]));_0x57c770[_0x9757('0x2f')]=_0x57c770[_0x9757('0x2f')][_0x9757('0x31')]?_0x57c770['attributes']:_0x2f2fe7[_0x9757('0x2a')];if(!_0x4e6b86[_0x9757('0x2c')][_0x9757('0x32')](_0x9757('0x33'))){_0x57c770[_0x9757('0x1f')]=qs[_0x9757('0x1f')](_0x4e6b86[_0x9757('0x2c')][_0x9757('0x1f')]);_0x57c770['offset']=qs[_0x9757('0x1e')](_0x4e6b86['query'][_0x9757('0x1e')]);}_0x57c770[_0x9757('0x34')]=qs['sort'](_0x4e6b86[_0x9757('0x2c')][_0x9757('0x35')]);_0x57c770[_0x9757('0x36')]=qs[_0x9757('0x2d')](_[_0x9757('0x37')](_0x4e6b86[_0x9757('0x2c')],_0x2f2fe7[_0x9757('0x2d')]));if(_0x4e6b86[_0x9757('0x2c')][_0x9757('0x38')]){_0x57c770[_0x9757('0x36')]=_['merge'](_0x57c770[_0x9757('0x36')],{'$or':_[_0x9757('0x39')](_0x58ae5e,function(_0x457d6c){if(_0x457d6c['type'][_0x9757('0x3a')]!==_0x9757('0x3b')){var _0x1317d6={};_0x1317d6[_0x457d6c[_0x9757('0x3c')]]={'$like':'%'+_0x4e6b86[_0x9757('0x2c')][_0x9757('0x38')]+'%'};return _0x1317d6;}})});}_0x57c770=_[_0x9757('0x3d')]({},_0x57c770,_0x4e6b86[_0x9757('0x3e')]);var _0x12de51={'where':_0x57c770['where']};return db['JscriptyAnswerReport'][_0x9757('0x1d')](_0x12de51)[_0x9757('0x24')](function(_0x11c710){_0x398c48[_0x9757('0x1d')]=_0x11c710;if(_0x4e6b86['query'][_0x9757('0x3f')]){_0x57c770['include']=[{'all':!![]}];}return db[_0x9757('0x40')][_0x9757('0x41')](_0x57c770);})[_0x9757('0x24')](function(_0x59f7ca){_0x398c48[_0x9757('0x42')]=_0x59f7ca;return _0x398c48;})[_0x9757('0x24')](respondWithFilteredResult(_0x2a9438,_0x57c770))[_0x9757('0x43')](handleError(_0x2a9438,null));};exports['show']=function(_0x37b223,_0x5eea8b){var _0x50f0e4={'raw':!![],'where':{'id':_0x37b223[_0x9757('0x44')]['id']}},_0x3aea44={};_0x3aea44[_0x9757('0x2a')]=_[_0x9757('0x2b')](db[_0x9757('0x40')]['rawAttributes']);_0x3aea44['query']=_['keys'](_0x37b223[_0x9757('0x2c')]);_0x3aea44[_0x9757('0x2d')]=_[_0x9757('0x2e')](_0x3aea44['model'],_0x3aea44[_0x9757('0x2c')]);_0x50f0e4[_0x9757('0x2f')]=_['intersection'](_0x3aea44[_0x9757('0x2a')],qs[_0x9757('0x30')](_0x37b223[_0x9757('0x2c')][_0x9757('0x30')]));_0x50f0e4['attributes']=_0x50f0e4[_0x9757('0x2f')][_0x9757('0x31')]?_0x50f0e4[_0x9757('0x2f')]:_0x3aea44[_0x9757('0x2a')];if(_0x37b223[_0x9757('0x2c')][_0x9757('0x3f')]){_0x50f0e4[_0x9757('0x45')]=[{'all':!![]}];}_0x50f0e4=_[_0x9757('0x3d')]({},_0x50f0e4,_0x37b223[_0x9757('0x3e')]);return db['JscriptyAnswerReport']['find'](_0x50f0e4)[_0x9757('0x24')](handleEntityNotFound(_0x5eea8b,null))[_0x9757('0x24')](respondWithResult(_0x5eea8b,null))[_0x9757('0x43')](handleError(_0x5eea8b,null));};exports['create']=function(_0x229f8a,_0x20413a){return db[_0x9757('0x40')]['create'](_0x229f8a[_0x9757('0x46')],{})[_0x9757('0x24')](respondWithResult(_0x20413a,0xc9))['catch'](handleError(_0x20413a,null));};exports['update']=function(_0x4e613d,_0x45771a){if(_0x4e613d[_0x9757('0x46')]['id']){delete _0x4e613d[_0x9757('0x46')]['id'];}return db['JscriptyAnswerReport'][_0x9757('0x47')]({'where':{'id':_0x4e613d['params']['id']}})[_0x9757('0x24')](handleEntityNotFound(_0x45771a,null))[_0x9757('0x24')](saveUpdates(_0x4e613d['body'],null))[_0x9757('0x24')](respondWithResult(_0x45771a,null))[_0x9757('0x43')](handleError(_0x45771a,null));};exports[_0x9757('0x48')]=function(_0x4487a4,_0x118d02){return db['JscriptyAnswerReport'][_0x9757('0x47')]({'where':{'id':_0x4487a4[_0x9757('0x44')]['id']}})[_0x9757('0x24')](handleEntityNotFound(_0x118d02,null))[_0x9757('0x24')](removeEntity(_0x118d02,null))[_0x9757('0x43')](handleError(_0x118d02,null));};exports[_0x9757('0x49')]=function(_0x7a5cb9,_0x4e3ebc){return db['JscriptyAnswerReport'][_0x9757('0x49')]()['then'](respondWithResult(_0x4e3ebc,null))['catch'](handleError(_0x4e3ebc,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 359d76a..37c6558 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 _0xa150=['report_jscripty_answers','lodash','../../config/logger','api','bluebird','request-promise','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xa150,0x1b9));var _0x0a15=function(_0x3f80e9,_0x488e5e){_0x3f80e9=_0x3f80e9-0x0;var _0x5b7b00=_0xa150[_0x3f80e9];return _0x5b7b00;};'use strict';var _=require(_0x0a15('0x0'));var util=require('util');var logger=require(_0x0a15('0x1'))(_0x0a15('0x2'));var moment=require('moment');var BPromise=require(_0x0a15('0x3'));var rp=require(_0x0a15('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a15('0x5'));module[_0x0a15('0x6')]=function(_0x3f69e5,_0x2bde4c){return _0x3f69e5[_0x0a15('0x7')](_0x0a15('0x8'),attributes,{'tableName':_0x0a15('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bdc=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','report_jscripty_answers'];(function(_0x1744e1,_0x1d5cd9){var _0x5166a0=function(_0x5f28dd){while(--_0x5f28dd){_0x1744e1['push'](_0x1744e1['shift']());}};_0x5166a0(++_0x1d5cd9);}(_0x9bdc,0x197));var _0xc9bd=function(_0x4f702a,_0x1e0faf){_0x4f702a=_0x4f702a-0x0;var _0x5f24d0=_0x9bdc[_0x4f702a];return _0x5f24d0;};'use strict';var _=require(_0xc9bd('0x0'));var util=require('util');var logger=require(_0xc9bd('0x1'))(_0xc9bd('0x2'));var moment=require(_0xc9bd('0x3'));var BPromise=require(_0xc9bd('0x4'));var rp=require(_0xc9bd('0x5'));var fs=require('fs');var path=require(_0xc9bd('0x6'));var rimraf=require(_0xc9bd('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9bd('0x8'));module[_0xc9bd('0x9')]=function(_0x17c71d,_0x2ac14b){return _0x17c71d['define']('JscriptyAnswerReport',attributes,{'tableName':_0xc9bd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 6013d67..eab55fd 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 _0x01a4=['request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x32cc9a,_0xec746e){var _0x226b80=function(_0x5c266a){while(--_0x5c266a){_0x32cc9a['push'](_0x32cc9a['shift']());}};_0x226b80(++_0xec746e);}(_0x01a4,0x16d));var _0x401a=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x01a4[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x401a('0x0'));var util=require('util');var moment=require(_0x401a('0x1'));var BPromise=require(_0x401a('0x2'));var rs=require(_0x401a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x401a('0x4'))['db'];var utils=require(_0x401a('0x5'));var logger=require(_0x401a('0x6'))(_0x401a('0x7'));var config=require('../../config/environment');var jayson=require(_0x401a('0x8'));var client=jayson[_0x401a('0x9')][_0x401a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd8762d,_0x597344,_0x1cc468){return new BPromise(function(_0x289961,_0x1d768e){return client[_0x401a('0xb')](_0xd8762d,_0x1cc468)[_0x401a('0xc')](function(_0x4505c1){logger[_0x401a('0xd')](_0x401a('0xe'),_0x597344,_0x401a('0xf'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x597344,_0x401a('0xf'),JSON['stringify'](_0x4505c1));if(_0x4505c1[_0x401a('0x10')]){if(_0x4505c1[_0x401a('0x10')][_0x401a('0x11')]===0x1f4){logger[_0x401a('0x10')](_0x401a('0xe'),_0x597344,_0x4505c1[_0x401a('0x10')][_0x401a('0x12')]);return _0x1d768e(_0x4505c1[_0x401a('0x10')][_0x401a('0x12')]);}logger[_0x401a('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x597344,_0x4505c1[_0x401a('0x10')][_0x401a('0x12')]);return _0x289961(_0x4505c1[_0x401a('0x10')][_0x401a('0x12')]);}else{logger[_0x401a('0xd')](_0x401a('0xe'),_0x597344,_0x401a('0xf'));_0x289961(_0x4505c1[_0x401a('0x13')][_0x401a('0x12')]);}})['catch'](function(_0x46d4fb){logger['error'](_0x401a('0xe'),_0x597344,_0x46d4fb);_0x1d768e(_0x46d4fb);});});} \ No newline at end of file +var _0xf495=['stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2640fa,_0xaeaf32){var _0x5aa2cd=function(_0x3a0bf2){while(--_0x3a0bf2){_0x2640fa['push'](_0x2640fa['shift']());}};_0x5aa2cd(++_0xaeaf32);}(_0xf495,0x7d));var _0x5f49=function(_0x4c1176,_0xf999e9){_0x4c1176=_0x4c1176-0x0;var _0x2aca97=_0xf495[_0x4c1176];return _0x2aca97;};'use strict';var _=require('lodash');var util=require(_0x5f49('0x0'));var moment=require(_0x5f49('0x1'));var BPromise=require(_0x5f49('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f49('0x3'));var db=require(_0x5f49('0x4'))['db'];var utils=require(_0x5f49('0x5'));var logger=require(_0x5f49('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5f49('0x7'));var client=jayson['client'][_0x5f49('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x22dcfb,_0x24fd8d,_0x3674a7){return new BPromise(function(_0x30944d,_0x1c94d4){return client['request'](_0x22dcfb,_0x3674a7)[_0x5f49('0x9')](function(_0x462be5){logger[_0x5f49('0xa')](_0x5f49('0xb'),_0x24fd8d,'request\x20sent');logger[_0x5f49('0xc')](_0x5f49('0xd'),_0x24fd8d,_0x5f49('0xe'),JSON[_0x5f49('0xf')](_0x462be5));if(_0x462be5[_0x5f49('0x10')]){if(_0x462be5['error']['code']===0x1f4){logger[_0x5f49('0x10')](_0x5f49('0xb'),_0x24fd8d,_0x462be5[_0x5f49('0x10')][_0x5f49('0x11')]);return _0x1c94d4(_0x462be5['error'][_0x5f49('0x11')]);}logger['error'](_0x5f49('0xb'),_0x24fd8d,_0x462be5[_0x5f49('0x10')][_0x5f49('0x11')]);return _0x30944d(_0x462be5['error']['message']);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x24fd8d,_0x5f49('0xe'));_0x30944d(_0x462be5[_0x5f49('0x12')]['message']);}})[_0x5f49('0x13')](function(_0x5918a7){logger[_0x5f49('0x10')](_0x5f49('0xb'),_0x24fd8d,_0x5918a7);_0x1c94d4(_0x5918a7);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index a34c3e9..60fc01a 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 _0x093b=['../../components/auth/service','./jscriptyProject.controller','isAuthenticated','index','get','show','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','/:id','update','destroy','util','path','connect-timeout','express'];(function(_0x58260f,_0x24a44b){var _0x1d9829=function(_0x4e609f){while(--_0x4e609f){_0x58260f['push'](_0x58260f['shift']());}};_0x1d9829(++_0x24a44b);}(_0x093b,0x80));var _0xb093=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0x093b[_0x211087];return _0x2a581f;};'use strict';var multer=require('multer');var util=require(_0xb093('0x0'));var path=require(_0xb093('0x1'));var timeout=require(_0xb093('0x2'));var express=require(_0xb093('0x3'));var router=express['Router']();var auth=require(_0xb093('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb093('0x5'));router['get']('/',auth[_0xb093('0x6')](),controller[_0xb093('0x7')]);router[_0xb093('0x8')]('/:id',auth[_0xb093('0x6')](),controller[_0xb093('0x9')]);router[_0xb093('0x8')]('/:id/sessions',auth[_0xb093('0x6')](),controller[_0xb093('0xa')]);router[_0xb093('0x8')](_0xb093('0xb'),auth['isAuthenticated'](),controller[_0xb093('0xc')]);router[_0xb093('0x8')](_0xb093('0xd'),auth['isAuthenticated'](),timeout(_0xb093('0xe')),controller[_0xb093('0xf')]);router[_0xb093('0x10')]('/',auth[_0xb093('0x6')](),controller['create']);router[_0xb093('0x10')](_0xb093('0x11'),auth[_0xb093('0x6')](),controller[_0xb093('0x12')]);router['put'](_0xb093('0x13'),auth['isAuthenticated'](),controller[_0xb093('0x14')]);router['delete'](_0xb093('0x13'),auth[_0xb093('0x6')](),controller[_0xb093('0x15')]);module['exports']=router; \ No newline at end of file +var _0x79b5=['post','create','/:id/clone','/:id','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary'];(function(_0x4db243,_0x46aa0a){var _0x169997=function(_0x574228){while(--_0x574228){_0x4db243['push'](_0x4db243['shift']());}};_0x169997(++_0x46aa0a);}(_0x79b5,0x1bd));var _0x579b=function(_0x3d8c50,_0x4bb14c){_0x3d8c50=_0x3d8c50-0x0;var _0x2725db=_0x79b5[_0x3d8c50];return _0x2725db;};'use strict';var multer=require(_0x579b('0x0'));var util=require(_0x579b('0x1'));var path=require(_0x579b('0x2'));var timeout=require(_0x579b('0x3'));var express=require('express');var router=express[_0x579b('0x4')]();var auth=require(_0x579b('0x5'));var interaction=require(_0x579b('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router[_0x579b('0x7')]('/',auth[_0x579b('0x8')](),controller[_0x579b('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x579b('0xa')]);router['get'](_0x579b('0xb'),auth['isAuthenticated'](),controller[_0x579b('0xc')]);router[_0x579b('0x7')](_0x579b('0xd'),auth[_0x579b('0x8')](),controller[_0x579b('0xe')]);router[_0x579b('0x7')](_0x579b('0xf'),auth[_0x579b('0x8')](),timeout('30s'),controller[_0x579b('0x10')]);router[_0x579b('0x11')]('/',auth[_0x579b('0x8')](),controller[_0x579b('0x12')]);router[_0x579b('0x11')](_0x579b('0x13'),auth[_0x579b('0x8')](),controller['clone']);router['put'](_0x579b('0x14'),auth[_0x579b('0x8')](),controller['update']);router[_0x579b('0x15')]('/:id',auth[_0x579b('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 55bd5be..8601ee4 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 _0xe0f7=['formData','stringify','isString','format','getDataValue','description','BOOLEAN','sequelize','lodash','STRING','name','TEXT','long','setDataValue'];(function(_0x232890,_0x32ae31){var _0xdbb42b=function(_0x5e17de){while(--_0x5e17de){_0x232890['push'](_0x232890['shift']());}};_0xdbb42b(++_0x32ae31);}(_0xe0f7,0x85));var _0x7e0f=function(_0x7aa39a,_0x306e86){_0x7aa39a=_0x7aa39a-0x0;var _0x1e327f=_0xe0f7[_0x7aa39a];return _0x1e327f;};'use strict';var Sequelize=require(_0x7e0f('0x0'));var _=require(_0x7e0f('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x7e0f('0x2')],'unique':_0x7e0f('0x3')},'description':{'type':Sequelize[_0x7e0f('0x2')]},'formData':{'type':Sequelize[_0x7e0f('0x4')](_0x7e0f('0x5')),'set':function(_0x301c86){if(_['isObjectLike'](_0x301c86)){this[_0x7e0f('0x6')](_0x7e0f('0x7'),JSON[_0x7e0f('0x8')](_0x301c86));}else if(_[_0x7e0f('0x9')](_0x301c86)){this[_0x7e0f('0x6')]('formData',_0x301c86);}else{this['setDataValue'](_0x7e0f('0x7'),util[_0x7e0f('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue']('name')||'',this[_0x7e0f('0xb')](_0x7e0f('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x7e0f('0xd')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc2ba=['long','isObjectLike','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','lodash','util','exports','STRING','name','TEXT'];(function(_0x3452a8,_0x4bfaa4){var _0x233814=function(_0x40b537){while(--_0x40b537){_0x3452a8['push'](_0x3452a8['shift']());}};_0x233814(++_0x4bfaa4);}(_0xc2ba,0x1bc));var _0xac2b=function(_0x56fd4c,_0x5a753c){_0x56fd4c=_0x56fd4c-0x0;var _0x5a3d36=_0xc2ba[_0x56fd4c];return _0x5a3d36;};'use strict';var Sequelize=require('sequelize');var _=require(_0xac2b('0x0'));var util=require(_0xac2b('0x1'));module[_0xac2b('0x2')]={'name':{'type':Sequelize[_0xac2b('0x3')],'unique':_0xac2b('0x4')},'description':{'type':Sequelize[_0xac2b('0x3')]},'formData':{'type':Sequelize[_0xac2b('0x5')](_0xac2b('0x6')),'set':function(_0x27da5c){if(_[_0xac2b('0x7')](_0x27da5c)){this['setDataValue'](_0xac2b('0x8'),JSON['stringify'](_0x27da5c));}else if(_[_0xac2b('0x9')](_0x27da5c)){this[_0xac2b('0xa')](_0xac2b('0x8'),_0x27da5c);}else{this[_0xac2b('0xa')](_0xac2b('0x8'),util[_0xac2b('0xb')](_0xac2b('0xc'),this[_0xac2b('0xd')](_0xac2b('0x4'))||'',this[_0xac2b('0xd')](_0xac2b('0xe'))||''));}}},'enableUncompleteSave':{'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 c5ca12e..fcbbdd8 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 _0xb455=['map','findOne','ProjectId','JscriptyAnswerReport','findAll','number','toString','indexOf','replace','startTime','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','json','count','offset','limit','status','set','apply','reject','save','update','destroy','then','get','Projects','sendStatus','error','stack','name','send','index','JscriptyProject','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','nolimit','sort','where','pick','filter','merge','key','VIRTUAL','field','options','includeAll','rows','catch','show','params','find','create','body','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','JscriptySessionReport','hasOwnProperty'];(function(_0x45b439,_0x1c5b3f){var _0x43b642=function(_0x329239){while(--_0x329239){_0x45b439['push'](_0x45b439['shift']());}};_0x43b642(++_0x1c5b3f);}(_0xb455,0xf2));var _0x5b45=function(_0x44c466,_0x3375fd){_0x44c466=_0x44c466-0x0;var _0x4c1f74=_0xb455[_0x44c466];return _0x4c1f74;};'use strict';var pdf=require(_0x5b45('0x0'));var emlformat=require(_0x5b45('0x1'));var rimraf=require(_0x5b45('0x2'));var zipdir=require(_0x5b45('0x3'));var jsonpatch=require(_0x5b45('0x4'));var rp=require(_0x5b45('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5b45('0x6'));var path=require(_0x5b45('0x7'));var sox=require(_0x5b45('0x8'));var csv=require(_0x5b45('0x9'));var ejs=require(_0x5b45('0xa'));var fs=require('fs');var _=require(_0x5b45('0xb'));var squel=require(_0x5b45('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5b45('0x9'));var querystring=require('querystring');var Papa=require(_0x5b45('0xd'));var Redis=require(_0x5b45('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0x5b45('0xf'));var logger=require('../../config/logger')(_0x5b45('0x10'));var utils=require(_0x5b45('0x11'));var config=require('../../config/environment');var db=require(_0x5b45('0x12'))['db'];function respondWithStatusCode(_0x13dce0,_0x45e433){_0x45e433=_0x45e433||0xcc;return function(_0x51ea68){if(_0x51ea68){return _0x13dce0['sendStatus'](_0x45e433);}return _0x13dce0['status'](_0x45e433)[_0x5b45('0x13')]();};}function respondWithResult(_0x9ff934,_0x4835c9){_0x4835c9=_0x4835c9||0xc8;return function(_0x27fbad){if(_0x27fbad){return _0x9ff934['status'](_0x4835c9)[_0x5b45('0x14')](_0x27fbad);}};}function respondWithFilteredResult(_0x153d23,_0x2cf1d8){return function(_0x4be25b){if(_0x4be25b){var _0x14dd9e=_0x4be25b[_0x5b45('0x15')],_0x426a5a=_0x2cf1d8[_0x5b45('0x16')],_0x11ebaa=_0x2cf1d8['offset']+_0x2cf1d8[_0x5b45('0x17')],_0x125ced;if(_0x11ebaa>=_0x14dd9e){_0x11ebaa=_0x14dd9e;_0x125ced=0xc8;}else{_0x125ced=0xce;}_0x153d23[_0x5b45('0x18')](_0x125ced);return _0x153d23[_0x5b45('0x19')]('Content-Range',_0x426a5a+'-'+_0x11ebaa+'/'+_0x14dd9e)['json'](_0x4be25b);}return null;};}function patchUpdates(_0x32460c){return function(_0x251ea8){try{jsonpatch[_0x5b45('0x1a')](_0x251ea8,_0x32460c,!![]);}catch(_0x569631){return BPromise[_0x5b45('0x1b')](_0x569631);}return _0x251ea8[_0x5b45('0x1c')]();};}function saveUpdates(_0x192cb7,_0x4bdb0b){return function(_0x1053f2){if(_0x1053f2){return _0x1053f2[_0x5b45('0x1d')](_0x192cb7)['then'](function(_0x32bf26){return _0x32bf26;});}return null;};}function removeEntity(_0x44fd38,_0x45292e){return function(_0x1f7023){if(_0x1f7023){return _0x1f7023[_0x5b45('0x1e')]()[_0x5b45('0x1f')](function(){var _0x8120cb=_0x1f7023[_0x5b45('0x20')]({'plain':!![]});var _0x25be56=_0x5b45('0x21');return db['UserProfileResource'][_0x5b45('0x1e')]({'where':{'type':_0x25be56,'resourceId':_0x8120cb['id']}})[_0x5b45('0x1f')](function(){return _0x1f7023;});})[_0x5b45('0x1f')](function(){_0x44fd38[_0x5b45('0x18')](0xcc)[_0x5b45('0x13')]();});}};}function handleEntityNotFound(_0x5aff20,_0x1a1219){return function(_0x59123b){if(!_0x59123b){_0x5aff20[_0x5b45('0x22')](0x194);}return _0x59123b;};}function handleError(_0x353e7c,_0x3e1929){_0x3e1929=_0x3e1929||0x1f4;return function(_0x1713e6){logger[_0x5b45('0x23')](_0x1713e6[_0x5b45('0x24')]);if(_0x1713e6[_0x5b45('0x25')]){delete _0x1713e6[_0x5b45('0x25')];}_0x353e7c[_0x5b45('0x18')](_0x3e1929)[_0x5b45('0x26')](_0x1713e6);};}exports[_0x5b45('0x27')]=function(_0x45e7ff,_0x2ef951){var _0x539af2={},_0x921c96={},_0x28375c={'count':0x0,'rows':[]};var _0x47bc4d=db[_0x5b45('0x28')][_0x5b45('0x29')];_0x921c96['model']=_[_0x5b45('0x2a')](_0x47bc4d);_0x921c96[_0x5b45('0x2b')]=_['keys'](_0x45e7ff[_0x5b45('0x2b')]);_0x921c96[_0x5b45('0x2c')]=_[_0x5b45('0x2d')](_0x921c96['model'],_0x921c96[_0x5b45('0x2b')]);_0x539af2[_0x5b45('0x2e')]=_[_0x5b45('0x2d')](_0x921c96[_0x5b45('0x2f')],qs[_0x5b45('0x30')](_0x45e7ff[_0x5b45('0x2b')][_0x5b45('0x30')]));_0x539af2[_0x5b45('0x2e')]=_0x539af2[_0x5b45('0x2e')][_0x5b45('0x31')]?_0x539af2[_0x5b45('0x2e')]:_0x921c96[_0x5b45('0x2f')];if(!_0x45e7ff['query']['hasOwnProperty'](_0x5b45('0x32'))){_0x539af2[_0x5b45('0x17')]=qs['limit'](_0x45e7ff[_0x5b45('0x2b')][_0x5b45('0x17')]);_0x539af2[_0x5b45('0x16')]=qs[_0x5b45('0x16')](_0x45e7ff[_0x5b45('0x2b')]['offset']);}_0x539af2['order']=qs[_0x5b45('0x33')](_0x45e7ff[_0x5b45('0x2b')][_0x5b45('0x33')]);_0x539af2[_0x5b45('0x34')]=qs['filters'](_[_0x5b45('0x35')](_0x45e7ff['query'],_0x921c96[_0x5b45('0x2c')]));if(_0x45e7ff['query'][_0x5b45('0x36')]){_0x539af2[_0x5b45('0x34')]=_[_0x5b45('0x37')](_0x539af2[_0x5b45('0x34')],{'$or':_['map'](_0x47bc4d,function(_0x44a732){if(_0x44a732['type'][_0x5b45('0x38')]!==_0x5b45('0x39')){var _0x28f1cb={};_0x28f1cb[_0x44a732[_0x5b45('0x3a')]]={'$like':'%'+_0x45e7ff[_0x5b45('0x2b')][_0x5b45('0x36')]+'%'};return _0x28f1cb;}})});}_0x539af2=_['merge']({},_0x539af2,_0x45e7ff[_0x5b45('0x3b')]);var _0x50402b={'where':_0x539af2[_0x5b45('0x34')]};return db[_0x5b45('0x28')][_0x5b45('0x15')](_0x50402b)[_0x5b45('0x1f')](function(_0x2bc4a4){_0x28375c[_0x5b45('0x15')]=_0x2bc4a4;if(_0x45e7ff['query'][_0x5b45('0x3c')]){_0x539af2['include']=[{'all':!![]}];}return db[_0x5b45('0x28')]['findAll'](_0x539af2);})[_0x5b45('0x1f')](function(_0x3f27dc){_0x28375c[_0x5b45('0x3d')]=_0x3f27dc;return _0x28375c;})[_0x5b45('0x1f')](respondWithFilteredResult(_0x2ef951,_0x539af2))[_0x5b45('0x3e')](handleError(_0x2ef951,null));};exports[_0x5b45('0x3f')]=function(_0x419074,_0x185b42){var _0x28deab={'raw':![],'where':{'id':_0x419074[_0x5b45('0x40')]['id']}},_0x555823={};_0x555823['model']=_[_0x5b45('0x2a')](db[_0x5b45('0x28')][_0x5b45('0x29')]);_0x555823[_0x5b45('0x2b')]=_[_0x5b45('0x2a')](_0x419074['query']);_0x555823[_0x5b45('0x2c')]=_[_0x5b45('0x2d')](_0x555823[_0x5b45('0x2f')],_0x555823[_0x5b45('0x2b')]);_0x28deab[_0x5b45('0x2e')]=_[_0x5b45('0x2d')](_0x555823['model'],qs[_0x5b45('0x30')](_0x419074[_0x5b45('0x2b')]['fields']));_0x28deab[_0x5b45('0x2e')]=_0x28deab[_0x5b45('0x2e')][_0x5b45('0x31')]?_0x28deab[_0x5b45('0x2e')]:_0x555823[_0x5b45('0x2f')];if(_0x419074['query'][_0x5b45('0x3c')]){_0x28deab['include']=[{'all':!![]}];}_0x28deab=_['merge']({},_0x28deab,_0x419074[_0x5b45('0x3b')]);return db['JscriptyProject'][_0x5b45('0x41')](_0x28deab)[_0x5b45('0x1f')](handleEntityNotFound(_0x185b42,null))['then'](respondWithResult(_0x185b42,null))[_0x5b45('0x3e')](handleError(_0x185b42,null));};exports[_0x5b45('0x42')]=function(_0x511bf4,_0x264ecb){return db[_0x5b45('0x28')][_0x5b45('0x42')](_0x511bf4[_0x5b45('0x43')],{})[_0x5b45('0x1f')](function(_0x4b065d){var _0xb13bad=_0x511bf4['user'][_0x5b45('0x20')]({'plain':!![]});if(!_0xb13bad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb13bad[_0x5b45('0x44')]==='user'){var _0x19eecc=_0x4b065d[_0x5b45('0x20')]({'plain':!![]});var _0x24adaf='Projects';return db[_0x5b45('0x45')][_0x5b45('0x41')]({'where':{'name':_0x24adaf,'userProfileId':_0xb13bad['userProfileId']},'raw':!![]})[_0x5b45('0x1f')](function(_0x334584){if(_0x334584&&_0x334584[_0x5b45('0x46')]===0x0){return db[_0x5b45('0x47')][_0x5b45('0x42')]({'name':_0x19eecc[_0x5b45('0x25')],'resourceId':_0x19eecc['id'],'type':_0x334584[_0x5b45('0x25')],'sectionId':_0x334584['id']},{})['then'](function(){return _0x4b065d;});}else{return _0x4b065d;}})[_0x5b45('0x3e')](function(_0x4e7fef){logger[_0x5b45('0x23')](_0x5b45('0x48'),_0x4e7fef);throw _0x4e7fef;});}return _0x4b065d;})[_0x5b45('0x1f')](respondWithResult(_0x264ecb,0xc9))[_0x5b45('0x3e')](handleError(_0x264ecb,null));};exports[_0x5b45('0x49')]=function(_0x511a4a,_0x47e64b){var _0x5a7d14={'raw':![],'where':{'id':_0x511a4a[_0x5b45('0x40')]['id']}},_0x29c2a1={};_0x29c2a1['model']=_[_0x5b45('0x2a')](db[_0x5b45('0x28')][_0x5b45('0x29')]);_0x5a7d14[_0x5b45('0x2e')]=_[_0x5b45('0x2d')](_0x29c2a1['model'],qs[_0x5b45('0x30')](_0x511a4a['query']['fields']));_0x5a7d14[_0x5b45('0x2e')]=_0x5a7d14[_0x5b45('0x2e')]['length']?_0x5a7d14[_0x5b45('0x2e')]:_0x29c2a1['model'];if(_0x511a4a[_0x5b45('0x2b')]['includeAll']){_0x5a7d14[_0x5b45('0x4a')]=[{'all':!![]}];}_0x5a7d14=_[_0x5b45('0x37')]({},_0x5a7d14,_0x511a4a[_0x5b45('0x3b')]);return db[_0x5b45('0x28')][_0x5b45('0x41')](_0x5a7d14)[_0x5b45('0x1f')](handleEntityNotFound(_0x47e64b,null))['then'](function(_0x1e43e2){if(_0x1e43e2){var _0x2483e2=_0x1e43e2[_0x5b45('0x20')]({'plain':!![]});_0x2483e2=qs[_0x5b45('0x4b')](_0x2483e2,['id',_0x5b45('0x4c'),_0x5b45('0x4d')]);_0x511a4a[_0x5b45('0x43')]=_[_0x5b45('0x4b')](_0x511a4a[_0x5b45('0x43')],['id',_0x5b45('0x4c'),'updatedAt']);return db[_0x5b45('0x28')]['create'](_[_0x5b45('0x37')](_0x2483e2,_0x511a4a[_0x5b45('0x43')]),{'include':_0x511a4a[_0x5b45('0x2b')][_0x5b45('0x3c')]?[{'all':!![]}]:undefined})[_0x5b45('0x1f')](function(_0x5e2561){var _0x382ac2=_0x511a4a['user'][_0x5b45('0x20')]({'plain':!![]});if(!_0x382ac2)throw new Error(_0x5b45('0x4e'));if(_0x382ac2[_0x5b45('0x44')]===_0x5b45('0x4f')){var _0x4b0524=_0x5e2561[_0x5b45('0x20')]({'plain':!![]});var _0x19ac1d='Projects';return db[_0x5b45('0x45')][_0x5b45('0x41')]({'where':{'name':_0x19ac1d,'userProfileId':_0x382ac2['userProfileId']},'raw':!![]})[_0x5b45('0x1f')](function(_0x54fc3f){if(_0x54fc3f&&_0x54fc3f['autoAssociation']===0x0){return db[_0x5b45('0x47')][_0x5b45('0x42')]({'name':_0x4b0524['name'],'resourceId':_0x4b0524['id'],'type':_0x54fc3f[_0x5b45('0x25')],'sectionId':_0x54fc3f['id']},{})[_0x5b45('0x1f')](function(){return _0x5e2561;});}else{return _0x5e2561;}})[_0x5b45('0x3e')](function(_0x21ef41){logger[_0x5b45('0x23')](_0x5b45('0x48'),_0x21ef41);throw _0x21ef41;});}return _0x5e2561;});}})[_0x5b45('0x1f')](respondWithResult(_0x47e64b,0xc9))[_0x5b45('0x3e')](handleError(_0x47e64b,null));};exports[_0x5b45('0x1d')]=function(_0x285b17,_0x97aaa2){if(_0x285b17[_0x5b45('0x43')]['id']){delete _0x285b17['body']['id'];}return db['JscriptyProject'][_0x5b45('0x41')]({'where':{'id':_0x285b17[_0x5b45('0x40')]['id']}})[_0x5b45('0x1f')](handleEntityNotFound(_0x97aaa2,null))[_0x5b45('0x1f')](saveUpdates(_0x285b17['body'],null))[_0x5b45('0x1f')](respondWithResult(_0x97aaa2,null))[_0x5b45('0x3e')](handleError(_0x97aaa2,null));};exports[_0x5b45('0x1e')]=function(_0x490f20,_0x47806e){return db['JscriptyProject'][_0x5b45('0x41')]({'where':{'id':_0x490f20[_0x5b45('0x40')]['id']}})['then'](handleEntityNotFound(_0x47806e,null))[_0x5b45('0x1f')](removeEntity(_0x47806e,null))[_0x5b45('0x3e')](handleError(_0x47806e,null));};exports['getSessions']=function(_0x42e62b,_0xc9d704,_0x18813d){var _0xe6407e={'raw':!![],'where':{}};var _0x4f34cd={};var _0x2e53f9={'count':0x0,'rows':[]};return db[_0x5b45('0x28')]['findOne']({'where':{'id':_0x42e62b[_0x5b45('0x40')]['id']}})[_0x5b45('0x1f')](handleEntityNotFound(_0xc9d704,null))[_0x5b45('0x1f')](function(_0x4ed93e){if(_0x4ed93e){_0x4f34cd[_0x5b45('0x2f')]=_[_0x5b45('0x2a')](db[_0x5b45('0x50')][_0x5b45('0x29')]);_0x4f34cd[_0x5b45('0x2b')]=_[_0x5b45('0x2a')](_0x42e62b['query']);_0x4f34cd[_0x5b45('0x2c')]=_[_0x5b45('0x2d')](_0x4f34cd[_0x5b45('0x2f')],_0x4f34cd[_0x5b45('0x2b')]);_0xe6407e['attributes']=_[_0x5b45('0x2d')](_0x4f34cd[_0x5b45('0x2f')],qs['fields'](_0x42e62b[_0x5b45('0x2b')]['fields']));_0xe6407e[_0x5b45('0x2e')]=_0xe6407e[_0x5b45('0x2e')][_0x5b45('0x31')]?_0xe6407e[_0x5b45('0x2e')]:_0x4f34cd[_0x5b45('0x2f')];if(!_0x42e62b[_0x5b45('0x2b')][_0x5b45('0x51')](_0x5b45('0x32'))){_0xe6407e['limit']=qs[_0x5b45('0x17')](_0x42e62b[_0x5b45('0x2b')][_0x5b45('0x17')]);_0xe6407e['offset']=qs[_0x5b45('0x16')](_0x42e62b['query']['offset']);}_0xe6407e['order']=qs[_0x5b45('0x33')](_0x42e62b[_0x5b45('0x2b')][_0x5b45('0x33')]);_0xe6407e['where']=qs['filters'](_[_0x5b45('0x35')](_0x42e62b[_0x5b45('0x2b')],_0x4f34cd[_0x5b45('0x2c')]));_0xe6407e[_0x5b45('0x34')]['ProjectId']=_0x4ed93e['id'];if(_0x42e62b['query']['filter']){_0xe6407e[_0x5b45('0x34')]=_[_0x5b45('0x37')](_0xe6407e['where'],{'$or':_[_0x5b45('0x52')](_0xe6407e[_0x5b45('0x2e')],function(_0x2ed8dd){var _0x1eee2f={};_0x1eee2f[_0x2ed8dd]={'$like':'%'+_0x42e62b['query'][_0x5b45('0x36')]+'%'};return _0x1eee2f;})});}_0xe6407e=_['merge']({},_0xe6407e,_0x42e62b[_0x5b45('0x3b')]);return db[_0x5b45('0x50')][_0x5b45('0x15')]({'where':_0xe6407e[_0x5b45('0x34')]})['then'](function(_0x17572){_0x2e53f9[_0x5b45('0x15')]=_0x17572;if(_0x42e62b[_0x5b45('0x2b')][_0x5b45('0x3c')]){_0xe6407e[_0x5b45('0x4a')]=[{'all':!![]}];}return db[_0x5b45('0x50')]['findAll'](_0xe6407e);})[_0x5b45('0x1f')](function(_0x32ad65){_0x2e53f9[_0x5b45('0x3d')]=_0x32ad65;return _0x2e53f9;});}})[_0x5b45('0x1f')](respondWithFilteredResult(_0xc9d704,_0xe6407e))[_0x5b45('0x3e')](handleError(_0xc9d704,null));};exports['getAnswers']=function(_0x46ad67,_0x90f4,_0x59f76f){var _0x50e13b={'raw':!![],'where':{}};var _0x387812={};var _0x5a2f8c={'count':0x0,'rows':[]};return db[_0x5b45('0x28')][_0x5b45('0x53')]({'where':{'id':_0x46ad67[_0x5b45('0x40')]['id']}})[_0x5b45('0x1f')](handleEntityNotFound(_0x90f4,null))[_0x5b45('0x1f')](function(_0x1d9e0e){if(_0x1d9e0e){_0x387812['model']=_[_0x5b45('0x2a')](db['JscriptyAnswerReport'][_0x5b45('0x29')]);_0x387812['query']=_[_0x5b45('0x2a')](_0x46ad67[_0x5b45('0x2b')]);_0x387812[_0x5b45('0x2c')]=_[_0x5b45('0x2d')](_0x387812[_0x5b45('0x2f')],_0x387812[_0x5b45('0x2b')]);_0x50e13b[_0x5b45('0x2e')]=_[_0x5b45('0x2d')](_0x387812[_0x5b45('0x2f')],qs[_0x5b45('0x30')](_0x46ad67[_0x5b45('0x2b')][_0x5b45('0x30')]));_0x50e13b[_0x5b45('0x2e')]=_0x50e13b[_0x5b45('0x2e')][_0x5b45('0x31')]?_0x50e13b['attributes']:_0x387812[_0x5b45('0x2f')];if(!_0x46ad67['query'][_0x5b45('0x51')](_0x5b45('0x32'))){_0x50e13b[_0x5b45('0x17')]=qs['limit'](_0x46ad67[_0x5b45('0x2b')][_0x5b45('0x17')]);_0x50e13b[_0x5b45('0x16')]=qs[_0x5b45('0x16')](_0x46ad67[_0x5b45('0x2b')][_0x5b45('0x16')]);}_0x50e13b['order']=qs[_0x5b45('0x33')](_0x46ad67['query'][_0x5b45('0x33')]);_0x50e13b[_0x5b45('0x34')]=qs[_0x5b45('0x2c')](_['pick'](_0x46ad67[_0x5b45('0x2b')],_0x387812[_0x5b45('0x2c')]));_0x50e13b['where'][_0x5b45('0x54')]=_0x1d9e0e['id'];if(_0x46ad67['query'][_0x5b45('0x36')]){_0x50e13b[_0x5b45('0x34')]=_[_0x5b45('0x37')](_0x50e13b[_0x5b45('0x34')],{'$or':_[_0x5b45('0x52')](_0x50e13b['attributes'],function(_0x263539){var _0x32251b={};_0x32251b[_0x263539]={'$like':'%'+_0x46ad67[_0x5b45('0x2b')][_0x5b45('0x36')]+'%'};return _0x32251b;})});}_0x50e13b=_[_0x5b45('0x37')]({},_0x50e13b,_0x46ad67['options']);return db[_0x5b45('0x55')][_0x5b45('0x15')]({'where':_0x50e13b[_0x5b45('0x34')]})[_0x5b45('0x1f')](function(_0x9861dd){_0x5a2f8c['count']=_0x9861dd;if(_0x46ad67[_0x5b45('0x2b')][_0x5b45('0x3c')]){_0x50e13b[_0x5b45('0x4a')]=[{'all':!![]}];}return db[_0x5b45('0x55')][_0x5b45('0x56')](_0x50e13b);})['then'](function(_0x86acd4){_0x5a2f8c[_0x5b45('0x3d')]=_0x86acd4;return _0x5a2f8c;});}})[_0x5b45('0x1f')](respondWithFilteredResult(_0x90f4,_0x50e13b))[_0x5b45('0x3e')](handleError(_0x90f4,null));};function char(_0x59e8b5){return _0x5b45('0x57')===typeof _0x59e8b5?String['fromCharCode'][_0x5b45('0x1a')](null,arguments):_0x59e8b5;}function needsEncapsulation(_0x307d31){return!!_0x307d31&&(_0x307d31[_0x5b45('0x58')]()[_0x5b45('0x59')](char(0xd))>=0x0||_0x307d31['toString']()[_0x5b45('0x59')](char(0xa))>=0x0||_0x307d31[_0x5b45('0x58')]()[_0x5b45('0x59')](char(0x2c))>=0x0||_0x307d31['toString']()[_0x5b45('0x59')](char(0x22))>=0x0);}function encapsulate(_0x2f04b5){var _0x40d07e=char(0x22),_0x51c4cc='\x5c'+char(0x22),_0x282b27=_0x2f04b5[_0x5b45('0x58')]()[_0x5b45('0x5a')](new RegExp(_0x40d07e,'g'),_0x51c4cc);return _0x40d07e+_0x282b27+_0x40d07e;}exports['getSummary']=function(_0x5b22b8,_0x5cdd4b,_0x39a060){var _0x1fd70c,_0x494512;var _0x43c27a={'where':{'ProjectId':_0x5b22b8['params']['id']}};if(_0x5b22b8[_0x5b45('0x2b')][_0x5b45('0x5b')]){_0x43c27a[_0x5b45('0x34')]['starttime']=JSON['parse'](_0x5b22b8[_0x5b45('0x2b')][_0x5b45('0x5b')]);}return db[_0x5b45('0x50')][_0x5b45('0x56')](_0x43c27a)[_0x5b45('0x1f')](handleEntityNotFound(_0x5cdd4b,null))[_0x5b45('0x1f')](function(_0x59d05f){if(_0x59d05f){_0x1fd70c=_0x59d05f;return db['JscriptyQuestionReport'][_0x5b45('0x56')]({'where':{'SessionId':{'$in':_[_0x5b45('0x52')](_0x1fd70c,'id')},'ProjectId':_0x5b22b8[_0x5b45('0x40')]['id']},'order':'-createdAt'});}})[_0x5b45('0x1f')](handleEntityNotFound(_0x5cdd4b,null))['then'](function(_0x93f59e){if(_0x93f59e){_0x494512=_0x93f59e;var _0x1a95d4={};for(var _0x35aaad=0x0,_0x96a1=_0x494512['length'];_0x35aaad<_0x96a1;_0x35aaad++){if(!_0x1a95d4[_0x5b45('0x51')](_0x494512[_0x35aaad][_0x5b45('0x5c')])){_0x1a95d4[_0x494512[_0x35aaad][_0x5b45('0x5c')]]=needsEncapsulation(_0x494512[_0x35aaad][_0x5b45('0x5d')])?encapsulate(_0x494512[_0x35aaad][_0x5b45('0x5d')]):_0x494512[_0x35aaad][_0x5b45('0x5d')];}}var _0x3b7f97=[],_0x269a74={};for(var _0x56d1db=0x0,_0x5a7d91=_0x1fd70c[_0x5b45('0x31')];_0x56d1db<_0x5a7d91;_0x56d1db++){_0x269a74={'ProjectId':_0x5b22b8[_0x5b45('0x40')]['id'],'SessionId':_0x1fd70c[_0x56d1db]['id'],'StartTime':moment(_0x1fd70c[_0x56d1db]['starttime'])[_0x5b45('0x5e')](_0x5b45('0x5f'))};for(var _0x19690a=0x0,_0x203b88=_0x494512['length'];_0x19690a<_0x203b88;_0x19690a++){if(_0x494512[_0x19690a][_0x5b45('0x60')]==_0x1fd70c[_0x56d1db]['id']&&_0x1a95d4[_0x5b45('0x51')](_0x494512[_0x19690a][_0x5b45('0x5c')])){_0x269a74[_0x1a95d4[_0x494512[_0x19690a][_0x5b45('0x5c')]]]=_0x494512[_0x19690a][_0x5b45('0x61')];}}for(var _0xd22421 in _0x1a95d4){if(!_0x269a74['hasOwnProperty'](_0x1a95d4[_0xd22421])){_0x269a74[_0x1a95d4[_0xd22421]]=null;}}_0x3b7f97[_0x5b45('0x62')](_0x269a74);}return _0x3b7f97;}})['then'](function(_0x29186e){if(!_[_0x5b45('0x63')](_0x29186e)){var _0x9e2d=toCsv(_0x29186e);var _0x59d88f=Date[_0x5b45('0x64')]();fs[_0x5b45('0x65')](util[_0x5b45('0x5e')](_0x5b45('0x66'),_0x5b22b8[_0x5b45('0x40')]['id'],_0x59d88f),_0x9e2d);_0x5cdd4b[_0x5b45('0x67')]('Content-disposition',_0x5b45('0x68')+util['format'](_0x5b45('0x69'),_0x5b22b8['params']['id'],_0x59d88f));_0x5cdd4b['setHeader'](_0x5b45('0x6a'),'text/csv');return _0x5cdd4b[_0x5b45('0x6b')](util[_0x5b45('0x5e')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x5b22b8['params']['id'],_0x59d88f));}else{return _0x5cdd4b['sendStatus'](0xcc);}})[_0x5b45('0x3e')](handleError(_0x5cdd4b,null));}; \ No newline at end of file +var _0xc40b=['set','Content-Range','json','apply','reject','update','get','UserProfileResource','destroy','then','stack','name','send','index','JscriptyProject','rawAttributes','model','keys','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','key','field','options','includeAll','include','findAll','rows','catch','show','params','fields','length','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','user','UserProfileSection','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','format','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','limit'];(function(_0x7cf4e0,_0x57a36c){var _0x389461=function(_0x5e8b21){while(--_0x5e8b21){_0x7cf4e0['push'](_0x7cf4e0['shift']());}};_0x389461(++_0x57a36c);}(_0xc40b,0x151));var _0xbc40=function(_0x4f4379,_0x3b9c17){_0x4f4379=_0x4f4379-0x0;var _0x4d1468=_0xc40b[_0x4f4379];return _0x4d1468;};'use strict';var pdf=require(_0xbc40('0x0'));var emlformat=require(_0xbc40('0x1'));var rimraf=require(_0xbc40('0x2'));var zipdir=require(_0xbc40('0x3'));var jsonpatch=require(_0xbc40('0x4'));var rp=require(_0xbc40('0x5'));var moment=require(_0xbc40('0x6'));var BPromise=require(_0xbc40('0x7'));var Mustache=require(_0xbc40('0x8'));var util=require(_0xbc40('0x9'));var path=require(_0xbc40('0xa'));var sox=require(_0xbc40('0xb'));var csv=require(_0xbc40('0xc'));var ejs=require(_0xbc40('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbc40('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbc40('0xf'));var Papa=require('papaparse');var Redis=require(_0xbc40('0x10'));var authService=require(_0xbc40('0x11'));var qs=require(_0xbc40('0x12'));var hardwareService=require(_0xbc40('0x13'));var logger=require(_0xbc40('0x14'))(_0xbc40('0x15'));var utils=require(_0xbc40('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d6a70,_0x28b13f){_0x28b13f=_0x28b13f||0xcc;return function(_0xd4e758){if(_0xd4e758){return _0x3d6a70[_0xbc40('0x17')](_0x28b13f);}return _0x3d6a70[_0xbc40('0x18')](_0x28b13f)[_0xbc40('0x19')]();};}function respondWithResult(_0xf2b810,_0x211f5c){_0x211f5c=_0x211f5c||0xc8;return function(_0x44b1d4){if(_0x44b1d4){return _0xf2b810['status'](_0x211f5c)['json'](_0x44b1d4);}};}function respondWithFilteredResult(_0x302bab,_0x18429e){return function(_0x23e3d8){if(_0x23e3d8){var _0x48a622=_0x23e3d8[_0xbc40('0x1a')],_0x17bb19=_0x18429e[_0xbc40('0x1b')],_0x2d9944=_0x18429e[_0xbc40('0x1b')]+_0x18429e[_0xbc40('0x1c')],_0x189356;if(_0x2d9944>=_0x48a622){_0x2d9944=_0x48a622;_0x189356=0xc8;}else{_0x189356=0xce;}_0x302bab[_0xbc40('0x18')](_0x189356);return _0x302bab[_0xbc40('0x1d')](_0xbc40('0x1e'),_0x17bb19+'-'+_0x2d9944+'/'+_0x48a622)[_0xbc40('0x1f')](_0x23e3d8);}return null;};}function patchUpdates(_0x15e2b1){return function(_0x155f65){try{jsonpatch[_0xbc40('0x20')](_0x155f65,_0x15e2b1,!![]);}catch(_0x34c3e3){return BPromise[_0xbc40('0x21')](_0x34c3e3);}return _0x155f65['save']();};}function saveUpdates(_0x23cc3d,_0x542a8f){return function(_0x27289b){if(_0x27289b){return _0x27289b[_0xbc40('0x22')](_0x23cc3d)['then'](function(_0x10f5a3){return _0x10f5a3;});}return null;};}function removeEntity(_0x2c3c08,_0x1a6023){return function(_0x3be3bb){if(_0x3be3bb){return _0x3be3bb['destroy']()['then'](function(){var _0x508779=_0x3be3bb[_0xbc40('0x23')]({'plain':!![]});var _0x43b396='Projects';return db[_0xbc40('0x24')][_0xbc40('0x25')]({'where':{'type':_0x43b396,'resourceId':_0x508779['id']}})[_0xbc40('0x26')](function(){return _0x3be3bb;});})[_0xbc40('0x26')](function(){_0x2c3c08[_0xbc40('0x18')](0xcc)[_0xbc40('0x19')]();});}};}function handleEntityNotFound(_0x44c2e5,_0x54a40b){return function(_0x13cbee){if(!_0x13cbee){_0x44c2e5[_0xbc40('0x17')](0x194);}return _0x13cbee;};}function handleError(_0x756972,_0x3fb668){_0x3fb668=_0x3fb668||0x1f4;return function(_0x1d54d4){logger['error'](_0x1d54d4[_0xbc40('0x27')]);if(_0x1d54d4[_0xbc40('0x28')]){delete _0x1d54d4['name'];}_0x756972['status'](_0x3fb668)[_0xbc40('0x29')](_0x1d54d4);};}exports[_0xbc40('0x2a')]=function(_0x3a6ec4,_0x5d3247){var _0x3d198c={},_0x411ce6={},_0x29e062={'count':0x0,'rows':[]};var _0x1aa45c=db[_0xbc40('0x2b')][_0xbc40('0x2c')];_0x411ce6[_0xbc40('0x2d')]=_[_0xbc40('0x2e')](_0x1aa45c);_0x411ce6['query']=_['keys'](_0x3a6ec4[_0xbc40('0x2f')]);_0x411ce6['filters']=_[_0xbc40('0x30')](_0x411ce6['model'],_0x411ce6[_0xbc40('0x2f')]);_0x3d198c[_0xbc40('0x31')]=_[_0xbc40('0x30')](_0x411ce6['model'],qs['fields'](_0x3a6ec4['query']['fields']));_0x3d198c[_0xbc40('0x31')]=_0x3d198c[_0xbc40('0x31')]['length']?_0x3d198c['attributes']:_0x411ce6['model'];if(!_0x3a6ec4['query'][_0xbc40('0x32')](_0xbc40('0x33'))){_0x3d198c['limit']=qs[_0xbc40('0x1c')](_0x3a6ec4['query'][_0xbc40('0x1c')]);_0x3d198c[_0xbc40('0x1b')]=qs[_0xbc40('0x1b')](_0x3a6ec4[_0xbc40('0x2f')][_0xbc40('0x1b')]);}_0x3d198c[_0xbc40('0x34')]=qs[_0xbc40('0x35')](_0x3a6ec4['query']['sort']);_0x3d198c['where']=qs[_0xbc40('0x36')](_[_0xbc40('0x37')](_0x3a6ec4[_0xbc40('0x2f')],_0x411ce6[_0xbc40('0x36')]));if(_0x3a6ec4[_0xbc40('0x2f')][_0xbc40('0x38')]){_0x3d198c['where']=_['merge'](_0x3d198c[_0xbc40('0x39')],{'$or':_[_0xbc40('0x3a')](_0x1aa45c,function(_0x13149c){if(_0x13149c[_0xbc40('0x3b')][_0xbc40('0x3c')]!=='VIRTUAL'){var _0x48efe6={};_0x48efe6[_0x13149c[_0xbc40('0x3d')]]={'$like':'%'+_0x3a6ec4[_0xbc40('0x2f')][_0xbc40('0x38')]+'%'};return _0x48efe6;}})});}_0x3d198c=_['merge']({},_0x3d198c,_0x3a6ec4[_0xbc40('0x3e')]);var _0x382f4b={'where':_0x3d198c[_0xbc40('0x39')]};return db['JscriptyProject']['count'](_0x382f4b)['then'](function(_0x3d16a5){_0x29e062[_0xbc40('0x1a')]=_0x3d16a5;if(_0x3a6ec4['query'][_0xbc40('0x3f')]){_0x3d198c[_0xbc40('0x40')]=[{'all':!![]}];}return db[_0xbc40('0x2b')][_0xbc40('0x41')](_0x3d198c);})[_0xbc40('0x26')](function(_0xe81ca9){_0x29e062[_0xbc40('0x42')]=_0xe81ca9;return _0x29e062;})['then'](respondWithFilteredResult(_0x5d3247,_0x3d198c))[_0xbc40('0x43')](handleError(_0x5d3247,null));};exports[_0xbc40('0x44')]=function(_0x281e7f,_0x137e5d){var _0x5a6cff={'raw':![],'where':{'id':_0x281e7f[_0xbc40('0x45')]['id']}},_0x10af58={};_0x10af58[_0xbc40('0x2d')]=_[_0xbc40('0x2e')](db[_0xbc40('0x2b')][_0xbc40('0x2c')]);_0x10af58[_0xbc40('0x2f')]=_[_0xbc40('0x2e')](_0x281e7f[_0xbc40('0x2f')]);_0x10af58[_0xbc40('0x36')]=_['intersection'](_0x10af58[_0xbc40('0x2d')],_0x10af58[_0xbc40('0x2f')]);_0x5a6cff[_0xbc40('0x31')]=_[_0xbc40('0x30')](_0x10af58[_0xbc40('0x2d')],qs[_0xbc40('0x46')](_0x281e7f['query'][_0xbc40('0x46')]));_0x5a6cff['attributes']=_0x5a6cff['attributes'][_0xbc40('0x47')]?_0x5a6cff[_0xbc40('0x31')]:_0x10af58['model'];if(_0x281e7f[_0xbc40('0x2f')][_0xbc40('0x3f')]){_0x5a6cff[_0xbc40('0x40')]=[{'all':!![]}];}_0x5a6cff=_[_0xbc40('0x48')]({},_0x5a6cff,_0x281e7f['options']);return db['JscriptyProject'][_0xbc40('0x49')](_0x5a6cff)[_0xbc40('0x26')](handleEntityNotFound(_0x137e5d,null))['then'](respondWithResult(_0x137e5d,null))[_0xbc40('0x43')](handleError(_0x137e5d,null));};exports[_0xbc40('0x4a')]=function(_0x31b14c,_0x5177ba){return db[_0xbc40('0x2b')]['create'](_0x31b14c[_0xbc40('0x4b')],{})['then'](function(_0xa435d3){var _0x438a34=_0x31b14c['user'][_0xbc40('0x23')]({'plain':!![]});if(!_0x438a34)throw new Error(_0xbc40('0x4c'));if(_0x438a34[_0xbc40('0x4d')]==='user'){var _0x295e7b=_0xa435d3[_0xbc40('0x23')]({'plain':!![]});var _0x31f525=_0xbc40('0x4e');return db['UserProfileSection'][_0xbc40('0x49')]({'where':{'name':_0x31f525,'userProfileId':_0x438a34[_0xbc40('0x4f')]},'raw':!![]})['then'](function(_0x102378){if(_0x102378&&_0x102378['autoAssociation']===0x0){return db[_0xbc40('0x24')][_0xbc40('0x4a')]({'name':_0x295e7b[_0xbc40('0x28')],'resourceId':_0x295e7b['id'],'type':_0x102378[_0xbc40('0x28')],'sectionId':_0x102378['id']},{})[_0xbc40('0x26')](function(){return _0xa435d3;});}else{return _0xa435d3;}})['catch'](function(_0x547aed){logger[_0xbc40('0x50')](_0xbc40('0x51'),_0x547aed);throw _0x547aed;});}return _0xa435d3;})[_0xbc40('0x26')](respondWithResult(_0x5177ba,0xc9))['catch'](handleError(_0x5177ba,null));};exports[_0xbc40('0x52')]=function(_0x2dd03f,_0x19477b){var _0x377e7c={'raw':![],'where':{'id':_0x2dd03f[_0xbc40('0x45')]['id']}},_0x3f65c4={};_0x3f65c4['model']=_[_0xbc40('0x2e')](db[_0xbc40('0x2b')]['rawAttributes']);_0x377e7c['attributes']=_[_0xbc40('0x30')](_0x3f65c4[_0xbc40('0x2d')],qs[_0xbc40('0x46')](_0x2dd03f[_0xbc40('0x2f')]['fields']));_0x377e7c[_0xbc40('0x31')]=_0x377e7c['attributes'][_0xbc40('0x47')]?_0x377e7c[_0xbc40('0x31')]:_0x3f65c4[_0xbc40('0x2d')];if(_0x2dd03f[_0xbc40('0x2f')][_0xbc40('0x3f')]){_0x377e7c[_0xbc40('0x40')]=[{'all':!![]}];}_0x377e7c=_[_0xbc40('0x48')]({},_0x377e7c,_0x2dd03f[_0xbc40('0x3e')]);return db[_0xbc40('0x2b')]['find'](_0x377e7c)[_0xbc40('0x26')](handleEntityNotFound(_0x19477b,null))[_0xbc40('0x26')](function(_0x175fc5){if(_0x175fc5){var _0x42b99c=_0x175fc5['get']({'plain':!![]});_0x42b99c=qs[_0xbc40('0x53')](_0x42b99c,['id','createdAt',_0xbc40('0x54')]);_0x2dd03f[_0xbc40('0x4b')]=_['omit'](_0x2dd03f['body'],['id','createdAt',_0xbc40('0x54')]);return db[_0xbc40('0x2b')][_0xbc40('0x4a')](_['merge'](_0x42b99c,_0x2dd03f['body']),{'include':_0x2dd03f[_0xbc40('0x2f')][_0xbc40('0x3f')]?[{'all':!![]}]:undefined})[_0xbc40('0x26')](function(_0x55df0f){var _0x5acbac=_0x2dd03f[_0xbc40('0x55')][_0xbc40('0x23')]({'plain':!![]});if(!_0x5acbac)throw new Error(_0xbc40('0x4c'));if(_0x5acbac['role']===_0xbc40('0x55')){var _0x4362ae=_0x55df0f[_0xbc40('0x23')]({'plain':!![]});var _0x43f4ff=_0xbc40('0x4e');return db[_0xbc40('0x56')][_0xbc40('0x49')]({'where':{'name':_0x43f4ff,'userProfileId':_0x5acbac[_0xbc40('0x4f')]},'raw':!![]})[_0xbc40('0x26')](function(_0x22405f){if(_0x22405f&&_0x22405f['autoAssociation']===0x0){return db[_0xbc40('0x24')][_0xbc40('0x4a')]({'name':_0x4362ae['name'],'resourceId':_0x4362ae['id'],'type':_0x22405f['name'],'sectionId':_0x22405f['id']},{})[_0xbc40('0x26')](function(){return _0x55df0f;});}else{return _0x55df0f;}})[_0xbc40('0x43')](function(_0xc3b3de){logger['error'](_0xbc40('0x51'),_0xc3b3de);throw _0xc3b3de;});}return _0x55df0f;});}})[_0xbc40('0x26')](respondWithResult(_0x19477b,0xc9))[_0xbc40('0x43')](handleError(_0x19477b,null));};exports['update']=function(_0x25cdd2,_0x287034){if(_0x25cdd2[_0xbc40('0x4b')]['id']){delete _0x25cdd2[_0xbc40('0x4b')]['id'];}return db[_0xbc40('0x2b')][_0xbc40('0x49')]({'where':{'id':_0x25cdd2[_0xbc40('0x45')]['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x287034,null))[_0xbc40('0x26')](saveUpdates(_0x25cdd2[_0xbc40('0x4b')],null))[_0xbc40('0x26')](respondWithResult(_0x287034,null))[_0xbc40('0x43')](handleError(_0x287034,null));};exports[_0xbc40('0x25')]=function(_0x55d2d9,_0x5766d6){return db[_0xbc40('0x2b')][_0xbc40('0x49')]({'where':{'id':_0x55d2d9[_0xbc40('0x45')]['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x5766d6,null))[_0xbc40('0x26')](removeEntity(_0x5766d6,null))['catch'](handleError(_0x5766d6,null));};exports[_0xbc40('0x57')]=function(_0x45145a,_0x2272b4,_0x408293){var _0x5ead52={'raw':!![],'where':{}};var _0x107913={};var _0xb34ed7={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbc40('0x58')]({'where':{'id':_0x45145a['params']['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x2272b4,null))[_0xbc40('0x26')](function(_0x8a3c88){if(_0x8a3c88){_0x107913[_0xbc40('0x2d')]=_[_0xbc40('0x2e')](db[_0xbc40('0x59')]['rawAttributes']);_0x107913[_0xbc40('0x2f')]=_[_0xbc40('0x2e')](_0x45145a[_0xbc40('0x2f')]);_0x107913['filters']=_['intersection'](_0x107913[_0xbc40('0x2d')],_0x107913['query']);_0x5ead52[_0xbc40('0x31')]=_['intersection'](_0x107913[_0xbc40('0x2d')],qs['fields'](_0x45145a[_0xbc40('0x2f')][_0xbc40('0x46')]));_0x5ead52[_0xbc40('0x31')]=_0x5ead52[_0xbc40('0x31')][_0xbc40('0x47')]?_0x5ead52[_0xbc40('0x31')]:_0x107913[_0xbc40('0x2d')];if(!_0x45145a[_0xbc40('0x2f')]['hasOwnProperty'](_0xbc40('0x33'))){_0x5ead52[_0xbc40('0x1c')]=qs[_0xbc40('0x1c')](_0x45145a[_0xbc40('0x2f')]['limit']);_0x5ead52['offset']=qs[_0xbc40('0x1b')](_0x45145a['query'][_0xbc40('0x1b')]);}_0x5ead52[_0xbc40('0x34')]=qs[_0xbc40('0x35')](_0x45145a['query'][_0xbc40('0x35')]);_0x5ead52['where']=qs['filters'](_[_0xbc40('0x37')](_0x45145a[_0xbc40('0x2f')],_0x107913[_0xbc40('0x36')]));_0x5ead52['where'][_0xbc40('0x5a')]=_0x8a3c88['id'];if(_0x45145a[_0xbc40('0x2f')][_0xbc40('0x38')]){_0x5ead52[_0xbc40('0x39')]=_[_0xbc40('0x48')](_0x5ead52[_0xbc40('0x39')],{'$or':_[_0xbc40('0x3a')](_0x5ead52[_0xbc40('0x31')],function(_0x4bae09){var _0x23e694={};_0x23e694[_0x4bae09]={'$like':'%'+_0x45145a[_0xbc40('0x2f')]['filter']+'%'};return _0x23e694;})});}_0x5ead52=_[_0xbc40('0x48')]({},_0x5ead52,_0x45145a[_0xbc40('0x3e')]);return db[_0xbc40('0x59')][_0xbc40('0x1a')]({'where':_0x5ead52[_0xbc40('0x39')]})[_0xbc40('0x26')](function(_0x1cc867){_0xb34ed7[_0xbc40('0x1a')]=_0x1cc867;if(_0x45145a[_0xbc40('0x2f')][_0xbc40('0x3f')]){_0x5ead52[_0xbc40('0x40')]=[{'all':!![]}];}return db[_0xbc40('0x59')]['findAll'](_0x5ead52);})['then'](function(_0xb4d98){_0xb34ed7[_0xbc40('0x42')]=_0xb4d98;return _0xb34ed7;});}})[_0xbc40('0x26')](respondWithFilteredResult(_0x2272b4,_0x5ead52))[_0xbc40('0x43')](handleError(_0x2272b4,null));};exports[_0xbc40('0x5b')]=function(_0x10e602,_0x19ce0b,_0x453a2d){var _0x2a58ed={'raw':!![],'where':{}};var _0x3d5113={};var _0x501f7c={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xbc40('0x58')]({'where':{'id':_0x10e602[_0xbc40('0x45')]['id']}})[_0xbc40('0x26')](handleEntityNotFound(_0x19ce0b,null))['then'](function(_0x25676a){if(_0x25676a){_0x3d5113[_0xbc40('0x2d')]=_['keys'](db[_0xbc40('0x5c')]['rawAttributes']);_0x3d5113[_0xbc40('0x2f')]=_[_0xbc40('0x2e')](_0x10e602['query']);_0x3d5113[_0xbc40('0x36')]=_['intersection'](_0x3d5113[_0xbc40('0x2d')],_0x3d5113[_0xbc40('0x2f')]);_0x2a58ed[_0xbc40('0x31')]=_[_0xbc40('0x30')](_0x3d5113[_0xbc40('0x2d')],qs[_0xbc40('0x46')](_0x10e602[_0xbc40('0x2f')][_0xbc40('0x46')]));_0x2a58ed[_0xbc40('0x31')]=_0x2a58ed['attributes'][_0xbc40('0x47')]?_0x2a58ed['attributes']:_0x3d5113[_0xbc40('0x2d')];if(!_0x10e602[_0xbc40('0x2f')][_0xbc40('0x32')](_0xbc40('0x33'))){_0x2a58ed[_0xbc40('0x1c')]=qs[_0xbc40('0x1c')](_0x10e602['query'][_0xbc40('0x1c')]);_0x2a58ed[_0xbc40('0x1b')]=qs[_0xbc40('0x1b')](_0x10e602['query'][_0xbc40('0x1b')]);}_0x2a58ed[_0xbc40('0x34')]=qs['sort'](_0x10e602[_0xbc40('0x2f')][_0xbc40('0x35')]);_0x2a58ed['where']=qs['filters'](_[_0xbc40('0x37')](_0x10e602[_0xbc40('0x2f')],_0x3d5113[_0xbc40('0x36')]));_0x2a58ed[_0xbc40('0x39')][_0xbc40('0x5a')]=_0x25676a['id'];if(_0x10e602['query']['filter']){_0x2a58ed[_0xbc40('0x39')]=_[_0xbc40('0x48')](_0x2a58ed[_0xbc40('0x39')],{'$or':_[_0xbc40('0x3a')](_0x2a58ed[_0xbc40('0x31')],function(_0x148e96){var _0x4c1426={};_0x4c1426[_0x148e96]={'$like':'%'+_0x10e602[_0xbc40('0x2f')][_0xbc40('0x38')]+'%'};return _0x4c1426;})});}_0x2a58ed=_[_0xbc40('0x48')]({},_0x2a58ed,_0x10e602[_0xbc40('0x3e')]);return db[_0xbc40('0x5c')][_0xbc40('0x1a')]({'where':_0x2a58ed[_0xbc40('0x39')]})[_0xbc40('0x26')](function(_0x4a3a16){_0x501f7c[_0xbc40('0x1a')]=_0x4a3a16;if(_0x10e602['query']['includeAll']){_0x2a58ed[_0xbc40('0x40')]=[{'all':!![]}];}return db[_0xbc40('0x5c')][_0xbc40('0x41')](_0x2a58ed);})['then'](function(_0x168ce7){_0x501f7c[_0xbc40('0x42')]=_0x168ce7;return _0x501f7c;});}})[_0xbc40('0x26')](respondWithFilteredResult(_0x19ce0b,_0x2a58ed))[_0xbc40('0x43')](handleError(_0x19ce0b,null));};function char(_0x53d661){return _0xbc40('0x5d')===typeof _0x53d661?String[_0xbc40('0x5e')][_0xbc40('0x20')](null,arguments):_0x53d661;}function needsEncapsulation(_0x4b5d5d){return!!_0x4b5d5d&&(_0x4b5d5d[_0xbc40('0x5f')]()[_0xbc40('0x60')](char(0xd))>=0x0||_0x4b5d5d[_0xbc40('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x4b5d5d[_0xbc40('0x5f')]()[_0xbc40('0x60')](char(0x2c))>=0x0||_0x4b5d5d['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0xa7742){var _0x57e12d=char(0x22),_0x2bfdae='\x5c'+char(0x22),_0x27bee4=_0xa7742[_0xbc40('0x5f')]()[_0xbc40('0x61')](new RegExp(_0x57e12d,'g'),_0x2bfdae);return _0x57e12d+_0x27bee4+_0x57e12d;}exports[_0xbc40('0x62')]=function(_0x139628,_0x5abbb7,_0x2501e5){var _0x3cf595,_0x3ccace;var _0x49f82b={'where':{'ProjectId':_0x139628[_0xbc40('0x45')]['id']}};if(_0x139628[_0xbc40('0x2f')][_0xbc40('0x63')]){_0x49f82b[_0xbc40('0x39')][_0xbc40('0x64')]=JSON[_0xbc40('0x65')](_0x139628[_0xbc40('0x2f')][_0xbc40('0x63')]);}return db['JscriptySessionReport'][_0xbc40('0x41')](_0x49f82b)[_0xbc40('0x26')](handleEntityNotFound(_0x5abbb7,null))['then'](function(_0x584a0f){if(_0x584a0f){_0x3cf595=_0x584a0f;return db[_0xbc40('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0xbc40('0x3a')](_0x3cf595,'id')},'ProjectId':_0x139628['params']['id']},'order':_0xbc40('0x67')});}})['then'](handleEntityNotFound(_0x5abbb7,null))['then'](function(_0xa4b236){if(_0xa4b236){_0x3ccace=_0xa4b236;var _0x51b6d6={};for(var _0x475a0d=0x0,_0xa4f40=_0x3ccace[_0xbc40('0x47')];_0x475a0d<_0xa4f40;_0x475a0d++){if(!_0x51b6d6[_0xbc40('0x32')](_0x3ccace[_0x475a0d][_0xbc40('0x68')])){_0x51b6d6[_0x3ccace[_0x475a0d][_0xbc40('0x68')]]=needsEncapsulation(_0x3ccace[_0x475a0d][_0xbc40('0x69')])?encapsulate(_0x3ccace[_0x475a0d][_0xbc40('0x69')]):_0x3ccace[_0x475a0d][_0xbc40('0x69')];}}var _0x5bd1a5=[],_0x43a0e8={};for(var _0xfda5a2=0x0,_0xd74d7a=_0x3cf595[_0xbc40('0x47')];_0xfda5a2<_0xd74d7a;_0xfda5a2++){_0x43a0e8={'ProjectId':_0x139628[_0xbc40('0x45')]['id'],'SessionId':_0x3cf595[_0xfda5a2]['id'],'StartTime':moment(_0x3cf595[_0xfda5a2][_0xbc40('0x64')])['format'](_0xbc40('0x6a'))};for(var _0x3a5655=0x0,_0x545318=_0x3ccace[_0xbc40('0x47')];_0x3a5655<_0x545318;_0x3a5655++){if(_0x3ccace[_0x3a5655][_0xbc40('0x6b')]==_0x3cf595[_0xfda5a2]['id']&&_0x51b6d6[_0xbc40('0x32')](_0x3ccace[_0x3a5655]['questionId'])){_0x43a0e8[_0x51b6d6[_0x3ccace[_0x3a5655][_0xbc40('0x68')]]]=_0x3ccace[_0x3a5655][_0xbc40('0x6c')];}}for(var _0x5bb17c in _0x51b6d6){if(!_0x43a0e8[_0xbc40('0x32')](_0x51b6d6[_0x5bb17c])){_0x43a0e8[_0x51b6d6[_0x5bb17c]]=null;}}_0x5bd1a5[_0xbc40('0x6d')](_0x43a0e8);}return _0x5bd1a5;}})[_0xbc40('0x26')](function(_0x48aef7){if(!_[_0xbc40('0x6e')](_0x48aef7)){var _0x248c2c=toCsv(_0x48aef7);var _0x152bc8=Date[_0xbc40('0x6f')]();fs[_0xbc40('0x70')](util['format'](_0xbc40('0x71'),_0x139628[_0xbc40('0x45')]['id'],_0x152bc8),_0x248c2c);_0x5abbb7[_0xbc40('0x72')](_0xbc40('0x73'),_0xbc40('0x74')+util[_0xbc40('0x75')](_0xbc40('0x76'),_0x139628['params']['id'],_0x152bc8));_0x5abbb7[_0xbc40('0x72')](_0xbc40('0x77'),_0xbc40('0x78'));return _0x5abbb7[_0xbc40('0x79')](util['format'](_0xbc40('0x71'),_0x139628[_0xbc40('0x45')]['id'],_0x152bc8));}else{return _0x5abbb7[_0xbc40('0x17')](0xcc);}})[_0xbc40('0x43')](handleError(_0x5abbb7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 316419c..99a62e6 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 _0x5e8d=['request-promise','rimraf','../../config/environment','exports','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x291e69,_0x2ea810){var _0x15be59=function(_0x56cb16){while(--_0x56cb16){_0x291e69['push'](_0x291e69['shift']());}};_0x15be59(++_0x2ea810);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x1d59f,_0x131996){_0x1d59f=_0x1d59f-0x0;var _0x26ad0c=_0x5e8d[_0x1d59f];return _0x26ad0c;};'use strict';var _=require(_0xd5e8('0x0'));var util=require(_0xd5e8('0x1'));var logger=require(_0xd5e8('0x2'))(_0xd5e8('0x3'));var moment=require(_0xd5e8('0x4'));var BPromise=require(_0xd5e8('0x5'));var rp=require(_0xd5e8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd5e8('0x7'));var config=require(_0xd5e8('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0xd5e8('0x9')]=function(_0x2ea3be,_0x195f41){return _0x2ea3be['define'](_0xd5e8('0xa'),attributes,{'tableName':_0xd5e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd45e=['path','rimraf','./jscriptyProject.attributes','exports','define','JscriptyProject','util','../../config/logger','moment','request-promise'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xd45e,0x182));var _0xed45=function(_0x314e74,_0x2ca40f){_0x314e74=_0x314e74-0x0;var _0x3ebe54=_0xd45e[_0x314e74];return _0x3ebe54;};'use strict';var _=require('lodash');var util=require(_0xed45('0x0'));var logger=require(_0xed45('0x1'))('api');var moment=require(_0xed45('0x2'));var BPromise=require('bluebird');var rp=require(_0xed45('0x3'));var fs=require('fs');var path=require(_0xed45('0x4'));var rimraf=require(_0xed45('0x5'));var config=require('../../config/environment');var attributes=require(_0xed45('0x6'));module[_0xed45('0x7')]=function(_0x5332aa,_0x528ca3){return _0x5332aa[_0xed45('0x8')](_0xed45('0x9'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index 7f91241..544591c 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 _0x9eb8=['../../config/environment','jayson/promise','client','http','info','JscriptyProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1b322a,_0x402ec4){var _0x4d5445=function(_0x19da2b){while(--_0x19da2b){_0x1b322a['push'](_0x1b322a['shift']());}};_0x4d5445(++_0x402ec4);}(_0x9eb8,0xca));var _0x89eb=function(_0x5e582f,_0x2ebb96){_0x5e582f=_0x5e582f-0x0;var _0xb8a4f5=_0x9eb8[_0x5e582f];return _0xb8a4f5;};'use strict';var _=require('lodash');var util=require(_0x89eb('0x0'));var moment=require(_0x89eb('0x1'));var BPromise=require(_0x89eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89eb('0x3'));var db=require(_0x89eb('0x4'))['db'];var utils=require(_0x89eb('0x5'));var logger=require(_0x89eb('0x6'))('rpc');var config=require(_0x89eb('0x7'));var jayson=require(_0x89eb('0x8'));var client=jayson[_0x89eb('0x9')][_0x89eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4c69,_0x472606,_0x50c285){return new BPromise(function(_0x49d839,_0x635b6e){return client['request'](_0x3c4c69,_0x50c285)['then'](function(_0x5811a0){logger[_0x89eb('0xb')](_0x89eb('0xc'),_0x472606,'request\x20sent');logger[_0x89eb('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x472606,_0x89eb('0xe'),JSON[_0x89eb('0xf')](_0x5811a0));if(_0x5811a0[_0x89eb('0x10')]){if(_0x5811a0['error']['code']===0x1f4){logger[_0x89eb('0x10')](_0x89eb('0xc'),_0x472606,_0x5811a0[_0x89eb('0x10')][_0x89eb('0x11')]);return _0x635b6e(_0x5811a0[_0x89eb('0x10')][_0x89eb('0x11')]);}logger[_0x89eb('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x472606,_0x5811a0[_0x89eb('0x10')]['message']);return _0x49d839(_0x5811a0[_0x89eb('0x10')]['message']);}else{logger[_0x89eb('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x472606,_0x89eb('0xe'));_0x49d839(_0x5811a0[_0x89eb('0x12')]['message']);}})['catch'](function(_0x476b20){logger[_0x89eb('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x472606,_0x476b20);_0x635b6e(_0x476b20);});});} \ No newline at end of file +var _0xef8e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x3aef70,_0x56d200){var _0x26a1a1=function(_0x55e0a5){while(--_0x55e0a5){_0x3aef70['push'](_0x3aef70['shift']());}};_0x26a1a1(++_0x56d200);}(_0xef8e,0x17b));var _0xeef8=function(_0x395f0f,_0x5a2c92){_0x395f0f=_0x395f0f-0x0;var _0x368d59=_0xef8e[_0x395f0f];return _0x368d59;};'use strict';var _=require(_0xeef8('0x0'));var util=require('util');var moment=require(_0xeef8('0x1'));var BPromise=require(_0xeef8('0x2'));var rs=require(_0xeef8('0x3'));var fs=require('fs');var Redis=require(_0xeef8('0x4'));var db=require(_0xeef8('0x5'))['db'];var utils=require(_0xeef8('0x6'));var logger=require(_0xeef8('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeef8('0x8'));var client=jayson[_0xeef8('0x9')][_0xeef8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19bfc2,_0x11f698,_0x5e095a){return new BPromise(function(_0x490067,_0x2f3dd2){return client['request'](_0x19bfc2,_0x5e095a)[_0xeef8('0xb')](function(_0x1ccf20){logger[_0xeef8('0xc')](_0xeef8('0xd'),_0x11f698,'request\x20sent');logger['debug']('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x11f698,_0xeef8('0xe'),JSON[_0xeef8('0xf')](_0x1ccf20));if(_0x1ccf20[_0xeef8('0x10')]){if(_0x1ccf20[_0xeef8('0x10')][_0xeef8('0x11')]===0x1f4){logger[_0xeef8('0x10')](_0xeef8('0xd'),_0x11f698,_0x1ccf20['error'][_0xeef8('0x12')]);return _0x2f3dd2(_0x1ccf20['error'][_0xeef8('0x12')]);}logger[_0xeef8('0x10')](_0xeef8('0xd'),_0x11f698,_0x1ccf20['error'][_0xeef8('0x12')]);return _0x490067(_0x1ccf20[_0xeef8('0x10')][_0xeef8('0x12')]);}else{logger[_0xeef8('0xc')](_0xeef8('0xd'),_0x11f698,'request\x20sent');_0x490067(_0x1ccf20['result'][_0xeef8('0x12')]);}})[_0xeef8('0x13')](function(_0x124a50){logger[_0xeef8('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x11f698,_0x124a50);_0x2f3dd2(_0x124a50);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 16bb695..6376ea5 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 _0xb68a=['delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','post','put'];(function(_0x565fed,_0xb85768){var _0x3e018f=function(_0x104d8e){while(--_0x104d8e){_0x565fed['push'](_0x565fed['shift']());}};_0x3e018f(++_0xb85768);}(_0xb68a,0x93));var _0xab68=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xb68a[_0x616290];return _0x453879;};'use strict';var multer=require(_0xab68('0x0'));var util=require('util');var path=require(_0xab68('0x1'));var timeout=require('connect-timeout');var express=require(_0xab68('0x2'));var router=express[_0xab68('0x3')]();var auth=require(_0xab68('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xab68('0x5'));var controller=require('./jscriptyQuestionReport.controller');router[_0xab68('0x6')]('/',auth['isAuthenticated'](),controller[_0xab68('0x7')]);router[_0xab68('0x6')](_0xab68('0x8'),auth['isAuthenticated'](),controller[_0xab68('0x9')]);router['get'](_0xab68('0xa'),auth[_0xab68('0xb')](),controller[_0xab68('0xc')]);router[_0xab68('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xab68('0xe')](_0xab68('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xab68('0xf')](_0xab68('0xa'),auth[_0xab68('0xb')](),controller[_0xab68('0x10')]);module[_0xab68('0x11')]=router; \ No newline at end of file +var _0x47b9=['post','create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x47b9,0x110));var _0x947b=function(_0x44afa4,_0x5be27b){_0x44afa4=_0x44afa4-0x0;var _0xcad289=_0x47b9[_0x44afa4];return _0xcad289;};'use strict';var multer=require(_0x947b('0x0'));var util=require(_0x947b('0x1'));var path=require(_0x947b('0x2'));var timeout=require('connect-timeout');var express=require(_0x947b('0x3'));var router=express[_0x947b('0x4')]();var auth=require(_0x947b('0x5'));var interaction=require(_0x947b('0x6'));var config=require(_0x947b('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x947b('0x8')](),controller[_0x947b('0x9')]);router[_0x947b('0xa')]('/describe',auth[_0x947b('0x8')](),controller['describe']);router['get'](_0x947b('0xb'),auth[_0x947b('0x8')](),controller[_0x947b('0xc')]);router[_0x947b('0xd')]('/',auth[_0x947b('0x8')](),controller[_0x947b('0xe')]);router[_0x947b('0xf')](_0x947b('0xb'),auth[_0x947b('0x8')](),controller['update']);router[_0x947b('0x10')](_0x947b('0xb'),auth[_0x947b('0x8')](),controller[_0x947b('0x11')]);module[_0x947b('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 85cc878..59f99e8 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 _0xcffe=['TEXT','long','sequelize','exports','STRING'];(function(_0x1de256,_0x589e25){var _0x4a9eda=function(_0x413404){while(--_0x413404){_0x1de256['push'](_0x1de256['shift']());}};_0x4a9eda(++_0x589e25);}(_0xcffe,0x1a1));var _0xecff=function(_0x28666a,_0x3dc25d){_0x28666a=_0x28666a-0x0;var _0x19d752=_0xcffe[_0x28666a];return _0x19d752;};'use strict';var Sequelize=require(_0xecff('0x0'));module[_0xecff('0x1')]={'question':{'type':Sequelize[_0xecff('0x2')]},'answer':{'type':Sequelize[_0xecff('0x3')](_0xecff('0x4'))},'membername':{'type':Sequelize[_0xecff('0x2')]},'projectname':{'type':Sequelize[_0xecff('0x2')]},'queue':{'type':Sequelize[_0xecff('0x2')]},'uniqueid':{'type':Sequelize[_0xecff('0x2')]},'calleridname':{'type':Sequelize[_0xecff('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xef38=['STRING','TEXT','exports'];(function(_0x16dced,_0x2f8d60){var _0x40e9d7=function(_0x1fc94a){while(--_0x1fc94a){_0x16dced['push'](_0x16dced['shift']());}};_0x40e9d7(++_0x2f8d60);}(_0xef38,0x122));var _0x8ef3=function(_0x475922,_0x1e1886){_0x475922=_0x475922-0x0;var _0x531932=_0xef38[_0x475922];return _0x531932;};'use strict';var Sequelize=require('sequelize');module[_0x8ef3('0x0')]={'question':{'type':Sequelize[_0x8ef3('0x1')]},'answer':{'type':Sequelize[_0x8ef3('0x2')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x8ef3('0x1')]},'queue':{'type':Sequelize[_0x8ef3('0x1')]},'uniqueid':{'type':Sequelize[_0x8ef3('0x1')]},'calleridname':{'type':Sequelize[_0x8ef3('0x1')]},'calleridnum':{'type':Sequelize[_0x8ef3('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 33db853..1a2ee4b 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 _0x8d85=['fast-json-patch','request-promise','moment','sox','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','error','name','send','rawAttributes','model','keys','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','map','key','VIRTUAL','field','merge','options','JscriptyQuestionReport','then','includeAll','include','rows','catch','show','params','intersection','length','find','create','body','destroy','describe','rimraf'];(function(_0x4e4c6d,_0x2e5743){var _0x1e382e=function(_0x21fa80){while(--_0x21fa80){_0x4e4c6d['push'](_0x4e4c6d['shift']());}};_0x1e382e(++_0x2e5743);}(_0x8d85,0x7d));var _0x58d8=function(_0x15e0a4,_0x3dde54){_0x15e0a4=_0x15e0a4-0x0;var _0x514a15=_0x8d85[_0x15e0a4];return _0x514a15;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x58d8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x58d8('0x1'));var rp=require(_0x58d8('0x2'));var moment=require(_0x58d8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x58d8('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x58d8('0x5'));var jsforce=require(_0x58d8('0x6'));var deskjs=require('desk.js');var toCsv=require(_0x58d8('0x7'));var querystring=require(_0x58d8('0x8'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x58d8('0x9'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58d8('0xa'))(_0x58d8('0xb'));var utils=require('../../config/utils');var config=require(_0x58d8('0xc'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bfd86,_0xe1b416){_0xe1b416=_0xe1b416||0xcc;return function(_0x5c2f86){if(_0x5c2f86){return _0x1bfd86[_0x58d8('0xd')](_0xe1b416);}return _0x1bfd86[_0x58d8('0xe')](_0xe1b416)[_0x58d8('0xf')]();};}function respondWithResult(_0x33d9af,_0x1cf162){_0x1cf162=_0x1cf162||0xc8;return function(_0x77e069){if(_0x77e069){return _0x33d9af[_0x58d8('0xe')](_0x1cf162)[_0x58d8('0x10')](_0x77e069);}};}function respondWithFilteredResult(_0x2c3c8c,_0x4d91a1){return function(_0x18f882){if(_0x18f882){var _0x301ec0=_0x18f882[_0x58d8('0x11')],_0x4856f8=_0x4d91a1['offset'],_0x42619b=_0x4d91a1[_0x58d8('0x12')]+_0x4d91a1['limit'],_0x591106;if(_0x42619b>=_0x301ec0){_0x42619b=_0x301ec0;_0x591106=0xc8;}else{_0x591106=0xce;}_0x2c3c8c[_0x58d8('0xe')](_0x591106);return _0x2c3c8c[_0x58d8('0x13')](_0x58d8('0x14'),_0x4856f8+'-'+_0x42619b+'/'+_0x301ec0)[_0x58d8('0x10')](_0x18f882);}return null;};}function patchUpdates(_0x3a002b){return function(_0x57b732){try{jsonpatch[_0x58d8('0x15')](_0x57b732,_0x3a002b,!![]);}catch(_0x22266e){return BPromise[_0x58d8('0x16')](_0x22266e);}return _0x57b732['save']();};}function saveUpdates(_0x28eb93,_0x3afafc){return function(_0x49c837){if(_0x49c837){return _0x49c837[_0x58d8('0x17')](_0x28eb93)['then'](function(_0x29bae6){return _0x29bae6;});}return null;};}function removeEntity(_0x4bce86,_0x2cf44a){return function(_0x509c89){if(_0x509c89){return _0x509c89['destroy']()['then'](function(){_0x4bce86[_0x58d8('0xe')](0xcc)[_0x58d8('0xf')]();});}};}function handleEntityNotFound(_0x130796,_0x5cda0f){return function(_0x5b842c){if(!_0x5b842c){_0x130796[_0x58d8('0xd')](0x194);}return _0x5b842c;};}function handleError(_0x5d23ac,_0x168dac){_0x168dac=_0x168dac||0x1f4;return function(_0x221715){logger[_0x58d8('0x18')](_0x221715['stack']);if(_0x221715['name']){delete _0x221715[_0x58d8('0x19')];}_0x5d23ac[_0x58d8('0xe')](_0x168dac)[_0x58d8('0x1a')](_0x221715);};}exports['index']=function(_0x4b4e50,_0x38a6c3){var _0xf857b8={},_0x2da834={},_0x583e3d={'count':0x0,'rows':[]};var _0x45ede1=db['JscriptyQuestionReport'][_0x58d8('0x1b')];_0x2da834[_0x58d8('0x1c')]=_[_0x58d8('0x1d')](_0x45ede1);_0x2da834[_0x58d8('0x1e')]=_[_0x58d8('0x1d')](_0x4b4e50[_0x58d8('0x1e')]);_0x2da834['filters']=_['intersection'](_0x2da834[_0x58d8('0x1c')],_0x2da834[_0x58d8('0x1e')]);_0xf857b8[_0x58d8('0x1f')]=_['intersection'](_0x2da834[_0x58d8('0x1c')],qs[_0x58d8('0x20')](_0x4b4e50[_0x58d8('0x1e')][_0x58d8('0x20')]));_0xf857b8[_0x58d8('0x1f')]=_0xf857b8[_0x58d8('0x1f')]['length']?_0xf857b8[_0x58d8('0x1f')]:_0x2da834['model'];if(!_0x4b4e50[_0x58d8('0x1e')][_0x58d8('0x21')](_0x58d8('0x22'))){_0xf857b8['limit']=qs[_0x58d8('0x23')](_0x4b4e50[_0x58d8('0x1e')]['limit']);_0xf857b8['offset']=qs[_0x58d8('0x12')](_0x4b4e50[_0x58d8('0x1e')][_0x58d8('0x12')]);}_0xf857b8[_0x58d8('0x24')]=qs['sort'](_0x4b4e50[_0x58d8('0x1e')][_0x58d8('0x25')]);_0xf857b8[_0x58d8('0x26')]=qs[_0x58d8('0x27')](_[_0x58d8('0x28')](_0x4b4e50['query'],_0x2da834[_0x58d8('0x27')]));if(_0x4b4e50[_0x58d8('0x1e')][_0x58d8('0x29')]){_0xf857b8[_0x58d8('0x26')]=_['merge'](_0xf857b8[_0x58d8('0x26')],{'$or':_[_0x58d8('0x2a')](_0x45ede1,function(_0x298f39){if(_0x298f39['type'][_0x58d8('0x2b')]!==_0x58d8('0x2c')){var _0x6717e1={};_0x6717e1[_0x298f39[_0x58d8('0x2d')]]={'$like':'%'+_0x4b4e50[_0x58d8('0x1e')][_0x58d8('0x29')]+'%'};return _0x6717e1;}})});}_0xf857b8=_[_0x58d8('0x2e')]({},_0xf857b8,_0x4b4e50[_0x58d8('0x2f')]);var _0x5df685={'where':_0xf857b8[_0x58d8('0x26')]};return db[_0x58d8('0x30')][_0x58d8('0x11')](_0x5df685)[_0x58d8('0x31')](function(_0x2f7fed){_0x583e3d[_0x58d8('0x11')]=_0x2f7fed;if(_0x4b4e50['query'][_0x58d8('0x32')]){_0xf857b8[_0x58d8('0x33')]=[{'all':!![]}];}return db[_0x58d8('0x30')]['findAll'](_0xf857b8);})[_0x58d8('0x31')](function(_0x3b1c85){_0x583e3d[_0x58d8('0x34')]=_0x3b1c85;return _0x583e3d;})[_0x58d8('0x31')](respondWithFilteredResult(_0x38a6c3,_0xf857b8))[_0x58d8('0x35')](handleError(_0x38a6c3,null));};exports[_0x58d8('0x36')]=function(_0x21adf3,_0x169069){var _0x126592={'raw':!![],'where':{'id':_0x21adf3[_0x58d8('0x37')]['id']}},_0x4bf09d={};_0x4bf09d[_0x58d8('0x1c')]=_[_0x58d8('0x1d')](db[_0x58d8('0x30')][_0x58d8('0x1b')]);_0x4bf09d['query']=_[_0x58d8('0x1d')](_0x21adf3[_0x58d8('0x1e')]);_0x4bf09d['filters']=_['intersection'](_0x4bf09d[_0x58d8('0x1c')],_0x4bf09d[_0x58d8('0x1e')]);_0x126592[_0x58d8('0x1f')]=_[_0x58d8('0x38')](_0x4bf09d[_0x58d8('0x1c')],qs['fields'](_0x21adf3['query']['fields']));_0x126592['attributes']=_0x126592[_0x58d8('0x1f')][_0x58d8('0x39')]?_0x126592['attributes']:_0x4bf09d['model'];if(_0x21adf3[_0x58d8('0x1e')][_0x58d8('0x32')]){_0x126592['include']=[{'all':!![]}];}_0x126592=_[_0x58d8('0x2e')]({},_0x126592,_0x21adf3[_0x58d8('0x2f')]);return db['JscriptyQuestionReport'][_0x58d8('0x3a')](_0x126592)[_0x58d8('0x31')](handleEntityNotFound(_0x169069,null))[_0x58d8('0x31')](respondWithResult(_0x169069,null))['catch'](handleError(_0x169069,null));};exports[_0x58d8('0x3b')]=function(_0x5a487c,_0x32f8ae){return db['JscriptyQuestionReport'][_0x58d8('0x3b')](_0x5a487c[_0x58d8('0x3c')],{})[_0x58d8('0x31')](respondWithResult(_0x32f8ae,0xc9))[_0x58d8('0x35')](handleError(_0x32f8ae,null));};exports['update']=function(_0x8f96cd,_0x393d06){if(_0x8f96cd['body']['id']){delete _0x8f96cd[_0x58d8('0x3c')]['id'];}return db[_0x58d8('0x30')][_0x58d8('0x3a')]({'where':{'id':_0x8f96cd[_0x58d8('0x37')]['id']}})[_0x58d8('0x31')](handleEntityNotFound(_0x393d06,null))[_0x58d8('0x31')](saveUpdates(_0x8f96cd[_0x58d8('0x3c')],null))[_0x58d8('0x31')](respondWithResult(_0x393d06,null))['catch'](handleError(_0x393d06,null));};exports[_0x58d8('0x3d')]=function(_0x454859,_0xb7995b){return db[_0x58d8('0x30')][_0x58d8('0x3a')]({'where':{'id':_0x454859[_0x58d8('0x37')]['id']}})['then'](handleEntityNotFound(_0xb7995b,null))[_0x58d8('0x31')](removeEntity(_0xb7995b,null))['catch'](handleError(_0xb7995b,null));};exports[_0x58d8('0x3e')]=function(_0xb22879,_0x258503){return db[_0x58d8('0x30')]['describe']()['then'](respondWithResult(_0x258503,null))[_0x58d8('0x35')](handleError(_0x258503,null));}; \ No newline at end of file +var _0xf802=['name','index','JscriptyQuestionReport','rawAttributes','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','findAll','catch','params','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack'];(function(_0xa55099,_0x2356ef){var _0x3e425c=function(_0xb9ed6e){while(--_0xb9ed6e){_0xa55099['push'](_0xa55099['shift']());}};_0x3e425c(++_0x2356ef);}(_0xf802,0x100));var _0x2f80=function(_0x4f85e6,_0xa3cbca){_0x4f85e6=_0x4f85e6-0x0;var _0x970e75=_0xf802[_0x4f85e6];return _0x970e75;};'use strict';var pdf=require(_0x2f80('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2f80('0x1'));var zipdir=require(_0x2f80('0x2'));var jsonpatch=require(_0x2f80('0x3'));var rp=require(_0x2f80('0x4'));var moment=require('moment');var BPromise=require(_0x2f80('0x5'));var Mustache=require(_0x2f80('0x6'));var util=require(_0x2f80('0x7'));var path=require(_0x2f80('0x8'));var sox=require('sox');var csv=require(_0x2f80('0x9'));var ejs=require(_0x2f80('0xa'));var fs=require('fs');var _=require(_0x2f80('0xb'));var squel=require(_0x2f80('0xc'));var crypto=require(_0x2f80('0xd'));var jsforce=require(_0x2f80('0xe'));var deskjs=require(_0x2f80('0xf'));var toCsv=require(_0x2f80('0x9'));var querystring=require(_0x2f80('0x10'));var Papa=require(_0x2f80('0x11'));var Redis=require('ioredis');var authService=require(_0x2f80('0x12'));var qs=require(_0x2f80('0x13'));var hardwareService=require(_0x2f80('0x14'));var logger=require(_0x2f80('0x15'))(_0x2f80('0x16'));var utils=require('../../config/utils');var config=require(_0x2f80('0x17'));var db=require(_0x2f80('0x18'))['db'];function respondWithStatusCode(_0x39eb6,_0x1c9077){_0x1c9077=_0x1c9077||0xcc;return function(_0x2d2fe9){if(_0x2d2fe9){return _0x39eb6[_0x2f80('0x19')](_0x1c9077);}return _0x39eb6[_0x2f80('0x1a')](_0x1c9077)[_0x2f80('0x1b')]();};}function respondWithResult(_0x35ecc1,_0x2df602){_0x2df602=_0x2df602||0xc8;return function(_0x7ab6e3){if(_0x7ab6e3){return _0x35ecc1[_0x2f80('0x1a')](_0x2df602)[_0x2f80('0x1c')](_0x7ab6e3);}};}function respondWithFilteredResult(_0x53883a,_0x3d4461){return function(_0x2d7e4f){if(_0x2d7e4f){var _0x393b16=_0x2d7e4f[_0x2f80('0x1d')],_0x53f030=_0x3d4461[_0x2f80('0x1e')],_0x4d4c56=_0x3d4461[_0x2f80('0x1e')]+_0x3d4461['limit'],_0x55d5f0;if(_0x4d4c56>=_0x393b16){_0x4d4c56=_0x393b16;_0x55d5f0=0xc8;}else{_0x55d5f0=0xce;}_0x53883a[_0x2f80('0x1a')](_0x55d5f0);return _0x53883a[_0x2f80('0x1f')]('Content-Range',_0x53f030+'-'+_0x4d4c56+'/'+_0x393b16)[_0x2f80('0x1c')](_0x2d7e4f);}return null;};}function patchUpdates(_0x3c1403){return function(_0x31689d){try{jsonpatch[_0x2f80('0x20')](_0x31689d,_0x3c1403,!![]);}catch(_0xc1264e){return BPromise[_0x2f80('0x21')](_0xc1264e);}return _0x31689d[_0x2f80('0x22')]();};}function saveUpdates(_0x12dbaa,_0x4a52c7){return function(_0x151472){if(_0x151472){return _0x151472[_0x2f80('0x23')](_0x12dbaa)[_0x2f80('0x24')](function(_0xe3b732){return _0xe3b732;});}return null;};}function removeEntity(_0x1e5f6c,_0x57c0fd){return function(_0x183f42){if(_0x183f42){return _0x183f42[_0x2f80('0x25')]()[_0x2f80('0x24')](function(){_0x1e5f6c['status'](0xcc)[_0x2f80('0x1b')]();});}};}function handleEntityNotFound(_0x63c1c7,_0xb05d4f){return function(_0x596962){if(!_0x596962){_0x63c1c7['sendStatus'](0x194);}return _0x596962;};}function handleError(_0x23ceb1,_0x57e6bd){_0x57e6bd=_0x57e6bd||0x1f4;return function(_0x37a4f2){logger[_0x2f80('0x26')](_0x37a4f2[_0x2f80('0x27')]);if(_0x37a4f2['name']){delete _0x37a4f2[_0x2f80('0x28')];}_0x23ceb1[_0x2f80('0x1a')](_0x57e6bd)['send'](_0x37a4f2);};}exports[_0x2f80('0x29')]=function(_0xc8c92,_0x239582){var _0x45f145={},_0x47e0b0={},_0x1f0167={'count':0x0,'rows':[]};var _0x556d93=db[_0x2f80('0x2a')][_0x2f80('0x2b')];_0x47e0b0['model']=_['keys'](_0x556d93);_0x47e0b0[_0x2f80('0x2c')]=_[_0x2f80('0x2d')](_0xc8c92[_0x2f80('0x2c')]);_0x47e0b0[_0x2f80('0x2e')]=_['intersection'](_0x47e0b0[_0x2f80('0x2f')],_0x47e0b0[_0x2f80('0x2c')]);_0x45f145[_0x2f80('0x30')]=_[_0x2f80('0x31')](_0x47e0b0[_0x2f80('0x2f')],qs[_0x2f80('0x32')](_0xc8c92[_0x2f80('0x2c')]['fields']));_0x45f145[_0x2f80('0x30')]=_0x45f145[_0x2f80('0x30')][_0x2f80('0x33')]?_0x45f145['attributes']:_0x47e0b0[_0x2f80('0x2f')];if(!_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x34')](_0x2f80('0x35'))){_0x45f145[_0x2f80('0x36')]=qs[_0x2f80('0x36')](_0xc8c92['query'][_0x2f80('0x36')]);_0x45f145[_0x2f80('0x1e')]=qs[_0x2f80('0x1e')](_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x1e')]);}_0x45f145[_0x2f80('0x37')]=qs['sort'](_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x38')]);_0x45f145[_0x2f80('0x39')]=qs[_0x2f80('0x2e')](_[_0x2f80('0x3a')](_0xc8c92['query'],_0x47e0b0['filters']));if(_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x3b')]){_0x45f145['where']=_[_0x2f80('0x3c')](_0x45f145[_0x2f80('0x39')],{'$or':_[_0x2f80('0x3d')](_0x556d93,function(_0x4c73c0){if(_0x4c73c0[_0x2f80('0x3e')]['key']!==_0x2f80('0x3f')){var _0x553209={};_0x553209[_0x4c73c0[_0x2f80('0x40')]]={'$like':'%'+_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x3b')]+'%'};return _0x553209;}})});}_0x45f145=_[_0x2f80('0x3c')]({},_0x45f145,_0xc8c92[_0x2f80('0x41')]);var _0x1ba68c={'where':_0x45f145['where']};return db[_0x2f80('0x2a')][_0x2f80('0x1d')](_0x1ba68c)['then'](function(_0x44690b){_0x1f0167[_0x2f80('0x1d')]=_0x44690b;if(_0xc8c92[_0x2f80('0x2c')][_0x2f80('0x42')]){_0x45f145[_0x2f80('0x43')]=[{'all':!![]}];}return db[_0x2f80('0x2a')][_0x2f80('0x44')](_0x45f145);})[_0x2f80('0x24')](function(_0x4d45b1){_0x1f0167['rows']=_0x4d45b1;return _0x1f0167;})[_0x2f80('0x24')](respondWithFilteredResult(_0x239582,_0x45f145))[_0x2f80('0x45')](handleError(_0x239582,null));};exports['show']=function(_0x4f5f4a,_0x398699){var _0x45bc4b={'raw':!![],'where':{'id':_0x4f5f4a[_0x2f80('0x46')]['id']}},_0x4257ed={};_0x4257ed[_0x2f80('0x2f')]=_[_0x2f80('0x2d')](db[_0x2f80('0x2a')]['rawAttributes']);_0x4257ed[_0x2f80('0x2c')]=_[_0x2f80('0x2d')](_0x4f5f4a[_0x2f80('0x2c')]);_0x4257ed['filters']=_[_0x2f80('0x31')](_0x4257ed['model'],_0x4257ed[_0x2f80('0x2c')]);_0x45bc4b[_0x2f80('0x30')]=_[_0x2f80('0x31')](_0x4257ed[_0x2f80('0x2f')],qs['fields'](_0x4f5f4a[_0x2f80('0x2c')]['fields']));_0x45bc4b['attributes']=_0x45bc4b['attributes'][_0x2f80('0x33')]?_0x45bc4b[_0x2f80('0x30')]:_0x4257ed[_0x2f80('0x2f')];if(_0x4f5f4a['query'][_0x2f80('0x42')]){_0x45bc4b[_0x2f80('0x43')]=[{'all':!![]}];}_0x45bc4b=_[_0x2f80('0x3c')]({},_0x45bc4b,_0x4f5f4a[_0x2f80('0x41')]);return db[_0x2f80('0x2a')]['find'](_0x45bc4b)['then'](handleEntityNotFound(_0x398699,null))[_0x2f80('0x24')](respondWithResult(_0x398699,null))['catch'](handleError(_0x398699,null));};exports[_0x2f80('0x47')]=function(_0x4c44b5,_0x52e90e){return db['JscriptyQuestionReport'][_0x2f80('0x47')](_0x4c44b5['body'],{})[_0x2f80('0x24')](respondWithResult(_0x52e90e,0xc9))[_0x2f80('0x45')](handleError(_0x52e90e,null));};exports[_0x2f80('0x23')]=function(_0x8c4f21,_0x10fb47){if(_0x8c4f21['body']['id']){delete _0x8c4f21[_0x2f80('0x48')]['id'];}return db[_0x2f80('0x2a')][_0x2f80('0x49')]({'where':{'id':_0x8c4f21[_0x2f80('0x46')]['id']}})[_0x2f80('0x24')](handleEntityNotFound(_0x10fb47,null))[_0x2f80('0x24')](saveUpdates(_0x8c4f21[_0x2f80('0x48')],null))[_0x2f80('0x24')](respondWithResult(_0x10fb47,null))[_0x2f80('0x45')](handleError(_0x10fb47,null));};exports[_0x2f80('0x25')]=function(_0x39da59,_0x44c5df){return db[_0x2f80('0x2a')][_0x2f80('0x49')]({'where':{'id':_0x39da59['params']['id']}})[_0x2f80('0x24')](handleEntityNotFound(_0x44c5df,null))[_0x2f80('0x24')](removeEntity(_0x44c5df,null))['catch'](handleError(_0x44c5df,null));};exports['describe']=function(_0xf62f75,_0x3ed54e){return db['JscriptyQuestionReport']['describe']()[_0x2f80('0x24')](respondWithResult(_0x3ed54e,null))['catch'](handleError(_0x3ed54e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index c361125..430b6f5 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 _0x2d5e=['path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment','bluebird'];(function(_0x23e757,_0x193b0b){var _0x3c2b35=function(_0x4d9cbe){while(--_0x4d9cbe){_0x23e757['push'](_0x23e757['shift']());}};_0x3c2b35(++_0x193b0b);}(_0x2d5e,0x133));var _0xe2d5=function(_0x298fd3,_0x3fdc23){_0x298fd3=_0x298fd3-0x0;var _0x1f33a7=_0x2d5e[_0x298fd3];return _0x1f33a7;};'use strict';var _=require(_0xe2d5('0x0'));var util=require(_0xe2d5('0x1'));var logger=require(_0xe2d5('0x2'))('api');var moment=require(_0xe2d5('0x3'));var BPromise=require(_0xe2d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2d5('0x5'));var rimraf=require(_0xe2d5('0x6'));var config=require(_0xe2d5('0x7'));var attributes=require(_0xe2d5('0x8'));module[_0xe2d5('0x9')]=function(_0x995b8f,_0x4897ef){return _0x995b8f[_0xe2d5('0xa')](_0xe2d5('0xb'),attributes,{'tableName':_0xe2d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb3=['../../config/logger','api','moment','request-promise','../../config/environment','define','JscriptyQuestionReport','report_jscripty_questions','util'];(function(_0xa991d4,_0x170745){var _0x2cec75=function(_0xe72355){while(--_0xe72355){_0xa991d4['push'](_0xa991d4['shift']());}};_0x2cec75(++_0x170745);}(_0x1cb3,0x7d));var _0x31cb=function(_0x3577df,_0x161af3){_0x3577df=_0x3577df-0x0;var _0x3f2558=_0x1cb3[_0x3577df];return _0x3f2558;};'use strict';var _=require('lodash');var util=require(_0x31cb('0x0'));var logger=require(_0x31cb('0x1'))(_0x31cb('0x2'));var moment=require(_0x31cb('0x3'));var BPromise=require('bluebird');var rp=require(_0x31cb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x31cb('0x5'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x55f7ad,_0x3ba5d0){return _0x55f7ad[_0x31cb('0x6')](_0x31cb('0x7'),attributes,{'tableName':_0x31cb('0x8'),'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 fc36809..3032ad5 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 _0x9bac=['JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info'];(function(_0x13f94d,_0xc80b77){var _0x593ecd=function(_0x5ef281){while(--_0x5ef281){_0x13f94d['push'](_0x13f94d['shift']());}};_0x593ecd(++_0xc80b77);}(_0x9bac,0x194));var _0xc9ba=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9bac[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc9ba('0x0'));var util=require(_0xc9ba('0x1'));var moment=require(_0xc9ba('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9ba('0x3'));var fs=require('fs');var Redis=require(_0xc9ba('0x4'));var db=require(_0xc9ba('0x5'))['db'];var utils=require(_0xc9ba('0x6'));var logger=require(_0xc9ba('0x7'))(_0xc9ba('0x8'));var config=require(_0xc9ba('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xc9ba('0xa')][_0xc9ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x368fbd,_0x277673,_0x3b9309){return new BPromise(function(_0x53d7bb,_0x13853e){return client['request'](_0x368fbd,_0x3b9309)[_0xc9ba('0xc')](function(_0x29affa){logger[_0xc9ba('0xd')](_0xc9ba('0xe'),_0x277673,'request\x20sent');logger[_0xc9ba('0xf')](_0xc9ba('0x10'),_0x277673,_0xc9ba('0x11'),JSON['stringify'](_0x29affa));if(_0x29affa['error']){if(_0x29affa[_0xc9ba('0x12')][_0xc9ba('0x13')]===0x1f4){logger['error'](_0xc9ba('0xe'),_0x277673,_0x29affa[_0xc9ba('0x12')][_0xc9ba('0x14')]);return _0x13853e(_0x29affa[_0xc9ba('0x12')]['message']);}logger[_0xc9ba('0x12')](_0xc9ba('0xe'),_0x277673,_0x29affa[_0xc9ba('0x12')][_0xc9ba('0x14')]);return _0x53d7bb(_0x29affa[_0xc9ba('0x12')]['message']);}else{logger[_0xc9ba('0xd')](_0xc9ba('0xe'),_0x277673,_0xc9ba('0x11'));_0x53d7bb(_0x29affa[_0xc9ba('0x15')][_0xc9ba('0x14')]);}})['catch'](function(_0x37bed9){logger['error'](_0xc9ba('0xe'),_0x277673,_0x37bed9);_0x13853e(_0x37bed9);});});} \ No newline at end of file +var _0xe549=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x13dd89,_0x34cb0e){var _0x2d61ee=function(_0x2b268f){while(--_0x2b268f){_0x13dd89['push'](_0x13dd89['shift']());}};_0x2d61ee(++_0x34cb0e);}(_0xe549,0x140));var _0x9e54=function(_0x5857f3,_0x1bd9bb){_0x5857f3=_0x5857f3-0x0;var _0x295c0a=_0xe549[_0x5857f3];return _0x295c0a;};'use strict';var _=require(_0x9e54('0x0'));var util=require(_0x9e54('0x1'));var moment=require(_0x9e54('0x2'));var BPromise=require(_0x9e54('0x3'));var rs=require(_0x9e54('0x4'));var fs=require('fs');var Redis=require(_0x9e54('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e54('0x6'));var logger=require(_0x9e54('0x7'))('rpc');var config=require(_0x9e54('0x8'));var jayson=require(_0x9e54('0x9'));var client=jayson[_0x9e54('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2d13e6,_0x22ac85,_0xf2aeb){return new BPromise(function(_0x46f8ed,_0x48df92){return client[_0x9e54('0xb')](_0x2d13e6,_0xf2aeb)[_0x9e54('0xc')](function(_0x2cd8aa){logger[_0x9e54('0xd')](_0x9e54('0xe'),_0x22ac85,_0x9e54('0xf'));logger[_0x9e54('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x22ac85,_0x9e54('0xf'),JSON[_0x9e54('0x11')](_0x2cd8aa));if(_0x2cd8aa[_0x9e54('0x12')]){if(_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x13')]===0x1f4){logger[_0x9e54('0x12')](_0x9e54('0xe'),_0x22ac85,_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);return _0x48df92(_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);}logger[_0x9e54('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x22ac85,_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);return _0x46f8ed(_0x2cd8aa[_0x9e54('0x12')][_0x9e54('0x14')]);}else{logger[_0x9e54('0xd')](_0x9e54('0xe'),_0x22ac85,_0x9e54('0xf'));_0x46f8ed(_0x2cd8aa[_0x9e54('0x15')]['message']);}})[_0x9e54('0x16')](function(_0x34c365){logger['error'](_0x9e54('0xe'),_0x22ac85,_0x34c365);_0x48df92(_0x34c365);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0a0084e..33759ca 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 _0x5ebf=['../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/:id','show','/:id/questions','getQuestions','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5ebf,0x150));var _0xf5eb=function(_0x2d2810,_0x559205){_0x2d2810=_0x2d2810-0x0;var _0x3ced55=_0x5ebf[_0x2d2810];return _0x3ced55;};'use strict';var multer=require('multer');var util=require(_0xf5eb('0x0'));var path=require('path');var timeout=require(_0xf5eb('0x1'));var express=require(_0xf5eb('0x2'));var router=express[_0xf5eb('0x3')]();var auth=require(_0xf5eb('0x4'));var interaction=require(_0xf5eb('0x5'));var config=require(_0xf5eb('0x6'));var controller=require(_0xf5eb('0x7'));router[_0xf5eb('0x8')]('/',auth[_0xf5eb('0x9')](),controller[_0xf5eb('0xa')]);router[_0xf5eb('0x8')]('/describe',auth[_0xf5eb('0x9')](),controller['describe']);router[_0xf5eb('0x8')](_0xf5eb('0xb'),auth[_0xf5eb('0x9')](),controller[_0xf5eb('0xc')]);router[_0xf5eb('0x8')](_0xf5eb('0xd'),auth[_0xf5eb('0x9')](),controller[_0xf5eb('0xe')]);router['post']('/',auth[_0xf5eb('0x9')](),controller[_0xf5eb('0xf')]);router[_0xf5eb('0x10')](_0xf5eb('0xb'),auth[_0xf5eb('0x9')](),controller['update']);router[_0xf5eb('0x11')](_0xf5eb('0xb'),auth['isAuthenticated'](),controller[_0xf5eb('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9274=['connect-timeout','express','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','exports','util'];(function(_0x5ad219,_0x5f3e1d){var _0x5e1f82=function(_0x5074f1){while(--_0x5074f1){_0x5ad219['push'](_0x5ad219['shift']());}};_0x5e1f82(++_0x5f3e1d);}(_0x9274,0x1a3));var _0x4927=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9274[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x4927('0x0'));var path=require('path');var timeout=require(_0x4927('0x1'));var express=require(_0x4927('0x2'));var router=express['Router']();var auth=require(_0x4927('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4927('0x4'));var controller=require(_0x4927('0x5'));router['get']('/',auth[_0x4927('0x6')](),controller[_0x4927('0x7')]);router[_0x4927('0x8')](_0x4927('0x9'),auth['isAuthenticated'](),controller[_0x4927('0xa')]);router[_0x4927('0x8')](_0x4927('0xb'),auth[_0x4927('0x6')](),controller[_0x4927('0xc')]);router[_0x4927('0x8')](_0x4927('0xd'),auth[_0x4927('0x6')](),controller[_0x4927('0xe')]);router[_0x4927('0xf')]('/',auth[_0x4927('0x6')](),controller[_0x4927('0x10')]);router[_0x4927('0x11')](_0x4927('0xb'),auth[_0x4927('0x6')](),controller[_0x4927('0x12')]);router['delete'](_0x4927('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x4927('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 1d744e8..bb49867 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 _0xca91=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize','exports','DATE'];(function(_0x4e1a8c,_0x5a6e65){var _0x434448=function(_0x1f0f8c){while(--_0x1f0f8c){_0x4e1a8c['push'](_0x4e1a8c['shift']());}};_0x434448(++_0x5a6e65);}(_0xca91,0x1d2));var _0x1ca9=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0xca91[_0x48e1ec];return _0x3b33eb;};'use strict';var moment=require(_0x1ca9('0x0'));var Sequelize=require(_0x1ca9('0x1'));module[_0x1ca9('0x2')]={'starttime':{'type':Sequelize[_0x1ca9('0x3')],'set':function(_0x46c4f1){this[_0x1ca9('0x4')](_0x1ca9('0x5'),_0x46c4f1);this[_0x1ca9('0x4')](_0x1ca9('0x6'),moment()[_0x1ca9('0x7')](_0x1ca9('0x8')));}},'endtime':{'type':Sequelize[_0x1ca9('0x3')]},'membername':{'type':Sequelize[_0x1ca9('0x9')]},'projectname':{'type':Sequelize[_0x1ca9('0x9')]},'queue':{'type':Sequelize[_0x1ca9('0x9')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1ca9('0x9')]},'calleridnum':{'type':Sequelize[_0x1ca9('0x9')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb54c=['DATE','setDataValue','starttime','endtime','format','STRING','BOOLEAN','moment','exports'];(function(_0x33d606,_0x33d61a){var _0x3d1c1a=function(_0x2b2f9b){while(--_0x2b2f9b){_0x33d606['push'](_0x33d606['shift']());}};_0x3d1c1a(++_0x33d61a);}(_0xb54c,0x127));var _0xcb54=function(_0x35f6c6,_0x5baf42){_0x35f6c6=_0x35f6c6-0x0;var _0x1bc368=_0xb54c[_0x35f6c6];return _0x1bc368;};'use strict';var moment=require(_0xcb54('0x0'));var Sequelize=require('sequelize');module[_0xcb54('0x1')]={'starttime':{'type':Sequelize[_0xcb54('0x2')],'set':function(_0x4f5a5a){this[_0xcb54('0x3')](_0xcb54('0x4'),_0x4f5a5a);this[_0xcb54('0x3')](_0xcb54('0x5'),moment()[_0xcb54('0x6')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xcb54('0x7')]},'projectname':{'type':Sequelize[_0xcb54('0x7')]},'queue':{'type':Sequelize[_0xcb54('0x7')]},'uniqueid':{'type':Sequelize[_0xcb54('0x7')]},'calleridname':{'type':Sequelize[_0xcb54('0x7')]},'calleridnum':{'type':Sequelize[_0xcb54('0x7')]},'completed':{'type':Sequelize[_0xcb54('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index f2ef4f2..0036af0 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 _0xbbb0=['../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','reject','update','then','stack','name','send','JscriptySessionReport','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','key','VIRTUAL','field','options','count','include','rows','catch','show','length','find','create','body','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','pick','SessionId','includeAll','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4d5cfd,_0x5b5c6c){var _0x442f17=function(_0x32a375){while(--_0x32a375){_0x4d5cfd['push'](_0x4d5cfd['shift']());}};_0x442f17(++_0x5b5c6c);}(_0xbbb0,0x83));var _0x0bbb=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xbbb0[_0x220dbb];return _0x2b77de;};'use strict';var pdf=require(_0x0bbb('0x0'));var emlformat=require(_0x0bbb('0x1'));var rimraf=require(_0x0bbb('0x2'));var zipdir=require(_0x0bbb('0x3'));var jsonpatch=require(_0x0bbb('0x4'));var rp=require(_0x0bbb('0x5'));var moment=require(_0x0bbb('0x6'));var BPromise=require(_0x0bbb('0x7'));var Mustache=require('mustache');var util=require(_0x0bbb('0x8'));var path=require(_0x0bbb('0x9'));var sox=require(_0x0bbb('0xa'));var csv=require('to-csv');var ejs=require(_0x0bbb('0xb'));var fs=require('fs');var _=require(_0x0bbb('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bbb('0xd'));var deskjs=require(_0x0bbb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0bbb('0xf'));var Redis=require(_0x0bbb('0x10'));var authService=require(_0x0bbb('0x11'));var qs=require(_0x0bbb('0x12'));var hardwareService=require(_0x0bbb('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0bbb('0x14'));var config=require('../../config/environment');var db=require(_0x0bbb('0x15'))['db'];function respondWithStatusCode(_0x2fcff3,_0x2c9c00){_0x2c9c00=_0x2c9c00||0xcc;return function(_0x42cb55){if(_0x42cb55){return _0x2fcff3[_0x0bbb('0x16')](_0x2c9c00);}return _0x2fcff3[_0x0bbb('0x17')](_0x2c9c00)[_0x0bbb('0x18')]();};}function respondWithResult(_0x3d2177,_0x28578a){_0x28578a=_0x28578a||0xc8;return function(_0x25689f){if(_0x25689f){return _0x3d2177['status'](_0x28578a)[_0x0bbb('0x19')](_0x25689f);}};}function respondWithFilteredResult(_0x10bdb9,_0x3e94ea){return function(_0x353da3){if(_0x353da3){var _0xa52bfe=_0x353da3['count'],_0x431adc=_0x3e94ea['offset'],_0x3d25ac=_0x3e94ea[_0x0bbb('0x1a')]+_0x3e94ea['limit'],_0x5d1e5f;if(_0x3d25ac>=_0xa52bfe){_0x3d25ac=_0xa52bfe;_0x5d1e5f=0xc8;}else{_0x5d1e5f=0xce;}_0x10bdb9['status'](_0x5d1e5f);return _0x10bdb9[_0x0bbb('0x1b')]('Content-Range',_0x431adc+'-'+_0x3d25ac+'/'+_0xa52bfe)[_0x0bbb('0x19')](_0x353da3);}return null;};}function patchUpdates(_0x241126){return function(_0x46d381){try{jsonpatch['apply'](_0x46d381,_0x241126,!![]);}catch(_0x30577b){return BPromise[_0x0bbb('0x1c')](_0x30577b);}return _0x46d381['save']();};}function saveUpdates(_0x248299,_0x42f0bb){return function(_0x1d0773){if(_0x1d0773){return _0x1d0773[_0x0bbb('0x1d')](_0x248299)[_0x0bbb('0x1e')](function(_0x174eb8){return _0x174eb8;});}return null;};}function removeEntity(_0x27b8b8,_0x4752e1){return function(_0x436975){if(_0x436975){return _0x436975['destroy']()[_0x0bbb('0x1e')](function(){_0x27b8b8[_0x0bbb('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1421be,_0x58bfee){return function(_0x555615){if(!_0x555615){_0x1421be[_0x0bbb('0x16')](0x194);}return _0x555615;};}function handleError(_0x88e676,_0xa324af){_0xa324af=_0xa324af||0x1f4;return function(_0x1b042f){logger['error'](_0x1b042f[_0x0bbb('0x1f')]);if(_0x1b042f[_0x0bbb('0x20')]){delete _0x1b042f[_0x0bbb('0x20')];}_0x88e676[_0x0bbb('0x17')](_0xa324af)[_0x0bbb('0x21')](_0x1b042f);};}exports['index']=function(_0x1129c4,_0x31d973){var _0x19e3a2={},_0x357579={},_0x35ae80={'count':0x0,'rows':[]};var _0x1be018=db[_0x0bbb('0x22')][_0x0bbb('0x23')];_0x357579[_0x0bbb('0x24')]=_[_0x0bbb('0x25')](_0x1be018);_0x357579[_0x0bbb('0x26')]=_[_0x0bbb('0x25')](_0x1129c4['query']);_0x357579['filters']=_[_0x0bbb('0x27')](_0x357579[_0x0bbb('0x24')],_0x357579['query']);_0x19e3a2[_0x0bbb('0x28')]=_[_0x0bbb('0x27')](_0x357579['model'],qs[_0x0bbb('0x29')](_0x1129c4['query'][_0x0bbb('0x29')]));_0x19e3a2[_0x0bbb('0x28')]=_0x19e3a2['attributes']['length']?_0x19e3a2[_0x0bbb('0x28')]:_0x357579[_0x0bbb('0x24')];if(!_0x1129c4['query'][_0x0bbb('0x2a')](_0x0bbb('0x2b'))){_0x19e3a2[_0x0bbb('0x2c')]=qs[_0x0bbb('0x2c')](_0x1129c4[_0x0bbb('0x26')][_0x0bbb('0x2c')]);_0x19e3a2[_0x0bbb('0x1a')]=qs[_0x0bbb('0x1a')](_0x1129c4['query'][_0x0bbb('0x1a')]);}_0x19e3a2[_0x0bbb('0x2d')]=qs[_0x0bbb('0x2e')](_0x1129c4[_0x0bbb('0x26')][_0x0bbb('0x2e')]);_0x19e3a2[_0x0bbb('0x2f')]=qs[_0x0bbb('0x30')](_['pick'](_0x1129c4[_0x0bbb('0x26')],_0x357579[_0x0bbb('0x30')]));if(_0x1129c4['query'][_0x0bbb('0x31')]){_0x19e3a2['where']=_[_0x0bbb('0x32')](_0x19e3a2[_0x0bbb('0x2f')],{'$or':_['map'](_0x1be018,function(_0x3b9b03){if(_0x3b9b03[_0x0bbb('0x33')][_0x0bbb('0x34')]!==_0x0bbb('0x35')){var _0x356e05={};_0x356e05[_0x3b9b03[_0x0bbb('0x36')]]={'$like':'%'+_0x1129c4['query'][_0x0bbb('0x31')]+'%'};return _0x356e05;}})});}_0x19e3a2=_[_0x0bbb('0x32')]({},_0x19e3a2,_0x1129c4[_0x0bbb('0x37')]);var _0x154193={'where':_0x19e3a2[_0x0bbb('0x2f')]};return db[_0x0bbb('0x22')]['count'](_0x154193)[_0x0bbb('0x1e')](function(_0x296762){_0x35ae80[_0x0bbb('0x38')]=_0x296762;if(_0x1129c4[_0x0bbb('0x26')]['includeAll']){_0x19e3a2[_0x0bbb('0x39')]=[{'all':!![]}];}return db[_0x0bbb('0x22')]['findAll'](_0x19e3a2);})[_0x0bbb('0x1e')](function(_0x1fa910){_0x35ae80[_0x0bbb('0x3a')]=_0x1fa910;return _0x35ae80;})[_0x0bbb('0x1e')](respondWithFilteredResult(_0x31d973,_0x19e3a2))[_0x0bbb('0x3b')](handleError(_0x31d973,null));};exports[_0x0bbb('0x3c')]=function(_0x2e56f6,_0x152979){var _0x29d2c1={'raw':!![],'where':{'id':_0x2e56f6['params']['id']}},_0x17a9f7={};_0x17a9f7[_0x0bbb('0x24')]=_[_0x0bbb('0x25')](db[_0x0bbb('0x22')][_0x0bbb('0x23')]);_0x17a9f7[_0x0bbb('0x26')]=_[_0x0bbb('0x25')](_0x2e56f6[_0x0bbb('0x26')]);_0x17a9f7[_0x0bbb('0x30')]=_[_0x0bbb('0x27')](_0x17a9f7[_0x0bbb('0x24')],_0x17a9f7[_0x0bbb('0x26')]);_0x29d2c1[_0x0bbb('0x28')]=_['intersection'](_0x17a9f7[_0x0bbb('0x24')],qs['fields'](_0x2e56f6['query'][_0x0bbb('0x29')]));_0x29d2c1[_0x0bbb('0x28')]=_0x29d2c1['attributes'][_0x0bbb('0x3d')]?_0x29d2c1[_0x0bbb('0x28')]:_0x17a9f7[_0x0bbb('0x24')];if(_0x2e56f6[_0x0bbb('0x26')]['includeAll']){_0x29d2c1[_0x0bbb('0x39')]=[{'all':!![]}];}_0x29d2c1=_[_0x0bbb('0x32')]({},_0x29d2c1,_0x2e56f6[_0x0bbb('0x37')]);return db[_0x0bbb('0x22')][_0x0bbb('0x3e')](_0x29d2c1)[_0x0bbb('0x1e')](handleEntityNotFound(_0x152979,null))[_0x0bbb('0x1e')](respondWithResult(_0x152979,null))['catch'](handleError(_0x152979,null));};exports[_0x0bbb('0x3f')]=function(_0x2783d0,_0x3a27bd){return db[_0x0bbb('0x22')][_0x0bbb('0x3f')](_0x2783d0[_0x0bbb('0x40')],{})[_0x0bbb('0x1e')](respondWithResult(_0x3a27bd,0xc9))[_0x0bbb('0x3b')](handleError(_0x3a27bd,null));};exports[_0x0bbb('0x1d')]=function(_0x2a4d8d,_0x4a0f48){if(_0x2a4d8d['body']['id']){delete _0x2a4d8d[_0x0bbb('0x40')]['id'];}return db[_0x0bbb('0x22')][_0x0bbb('0x3e')]({'where':{'id':_0x2a4d8d[_0x0bbb('0x41')]['id']}})[_0x0bbb('0x1e')](handleEntityNotFound(_0x4a0f48,null))['then'](saveUpdates(_0x2a4d8d[_0x0bbb('0x40')],null))['then'](respondWithResult(_0x4a0f48,null))[_0x0bbb('0x3b')](handleError(_0x4a0f48,null));};exports[_0x0bbb('0x42')]=function(_0x5a98bb,_0xbd6884){return db[_0x0bbb('0x22')][_0x0bbb('0x3e')]({'where':{'id':_0x5a98bb['params']['id']}})[_0x0bbb('0x1e')](handleEntityNotFound(_0xbd6884,null))[_0x0bbb('0x1e')](removeEntity(_0xbd6884,null))[_0x0bbb('0x3b')](handleError(_0xbd6884,null));};exports[_0x0bbb('0x43')]=function(_0x366344,_0x11e3c5){return db['JscriptySessionReport']['describe']()[_0x0bbb('0x1e')](respondWithResult(_0x11e3c5,null))[_0x0bbb('0x3b')](handleError(_0x11e3c5,null));};exports[_0x0bbb('0x44')]=function(_0x3b484c,_0xb9ec21,_0x247c81){var _0x258fef={'raw':!![],'where':{}};var _0x2fa978={};var _0x252c6e={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x0bbb('0x45')]({'where':{'id':_0x3b484c['params']['id']}})[_0x0bbb('0x1e')](handleEntityNotFound(_0xb9ec21,null))[_0x0bbb('0x1e')](function(_0xb8e7d3){if(_0xb8e7d3){_0x2fa978[_0x0bbb('0x24')]=_[_0x0bbb('0x25')](db[_0x0bbb('0x46')][_0x0bbb('0x23')]);_0x2fa978[_0x0bbb('0x26')]=_[_0x0bbb('0x25')](_0x3b484c[_0x0bbb('0x26')]);_0x2fa978[_0x0bbb('0x30')]=_[_0x0bbb('0x27')](_0x2fa978['model'],_0x2fa978[_0x0bbb('0x26')]);_0x258fef[_0x0bbb('0x28')]=_[_0x0bbb('0x27')](_0x2fa978[_0x0bbb('0x24')],qs['fields'](_0x3b484c[_0x0bbb('0x26')][_0x0bbb('0x29')]));_0x258fef[_0x0bbb('0x28')]=_0x258fef[_0x0bbb('0x28')][_0x0bbb('0x3d')]?_0x258fef[_0x0bbb('0x28')]:_0x2fa978[_0x0bbb('0x24')];if(!_0x3b484c[_0x0bbb('0x26')][_0x0bbb('0x2a')]('nolimit')){_0x258fef['limit']=qs[_0x0bbb('0x2c')](_0x3b484c[_0x0bbb('0x26')][_0x0bbb('0x2c')]);_0x258fef['offset']=qs[_0x0bbb('0x1a')](_0x3b484c[_0x0bbb('0x26')][_0x0bbb('0x1a')]);}_0x258fef[_0x0bbb('0x2d')]=qs[_0x0bbb('0x2e')](_0x3b484c[_0x0bbb('0x26')]['sort']);_0x258fef['where']=qs['filters'](_[_0x0bbb('0x47')](_0x3b484c[_0x0bbb('0x26')],_0x2fa978[_0x0bbb('0x30')]));_0x258fef[_0x0bbb('0x2f')][_0x0bbb('0x48')]=_0xb8e7d3['id'];if(_0x3b484c[_0x0bbb('0x26')]['filter']){_0x258fef['where']=_[_0x0bbb('0x32')](_0x258fef[_0x0bbb('0x2f')],{'$or':_['map'](_0x258fef['attributes'],function(_0x3ea51c){var _0x51e08c={};_0x51e08c[_0x3ea51c]={'$like':'%'+_0x3b484c[_0x0bbb('0x26')][_0x0bbb('0x31')]+'%'};return _0x51e08c;})});}_0x258fef=_['merge']({},_0x258fef,_0x3b484c['options']);return db[_0x0bbb('0x46')][_0x0bbb('0x38')]({'where':_0x258fef[_0x0bbb('0x2f')]})[_0x0bbb('0x1e')](function(_0x539cce){_0x252c6e[_0x0bbb('0x38')]=_0x539cce;if(_0x3b484c['query'][_0x0bbb('0x49')]){_0x258fef[_0x0bbb('0x39')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x0bbb('0x4a')](_0x258fef);})[_0x0bbb('0x1e')](function(_0x480d0f){_0x252c6e[_0x0bbb('0x3a')]=_0x480d0f;return _0x252c6e;});}})[_0x0bbb('0x1e')](respondWithFilteredResult(_0xb9ec21,_0x258fef))[_0x0bbb('0x3b')](handleError(_0xb9ec21,null));}; \ No newline at end of file +var _0x5e3c=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','map','type','field','options','JscriptySessionReport','includeAll','include','findAll','show','params','find','create','catch','body','describe','findOne','JscriptyQuestionReport','pick','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x361ddd,_0x503739){var _0x3a92da=function(_0x439b0e){while(--_0x439b0e){_0x361ddd['push'](_0x361ddd['shift']());}};_0x3a92da(++_0x503739);}(_0x5e3c,0x92));var _0xc5e3=function(_0x36af3c,_0x2d2b8b){_0x36af3c=_0x36af3c-0x0;var _0x5c219a=_0x5e3c[_0x36af3c];return _0x5c219a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc5e3('0x0'));var rimraf=require(_0xc5e3('0x1'));var zipdir=require(_0xc5e3('0x2'));var jsonpatch=require(_0xc5e3('0x3'));var rp=require(_0xc5e3('0x4'));var moment=require(_0xc5e3('0x5'));var BPromise=require(_0xc5e3('0x6'));var Mustache=require(_0xc5e3('0x7'));var util=require(_0xc5e3('0x8'));var path=require(_0xc5e3('0x9'));var sox=require(_0xc5e3('0xa'));var csv=require(_0xc5e3('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc5e3('0xc'));var squel=require(_0xc5e3('0xd'));var crypto=require(_0xc5e3('0xe'));var jsforce=require(_0xc5e3('0xf'));var deskjs=require(_0xc5e3('0x10'));var toCsv=require(_0xc5e3('0xb'));var querystring=require('querystring');var Papa=require(_0xc5e3('0x11'));var Redis=require(_0xc5e3('0x12'));var authService=require(_0xc5e3('0x13'));var qs=require(_0xc5e3('0x14'));var hardwareService=require(_0xc5e3('0x15'));var logger=require(_0xc5e3('0x16'))(_0xc5e3('0x17'));var utils=require('../../config/utils');var config=require(_0xc5e3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1aec91,_0x2b07ec){_0x2b07ec=_0x2b07ec||0xcc;return function(_0x29f2dc){if(_0x29f2dc){return _0x1aec91[_0xc5e3('0x19')](_0x2b07ec);}return _0x1aec91[_0xc5e3('0x1a')](_0x2b07ec)[_0xc5e3('0x1b')]();};}function respondWithResult(_0xf286dc,_0x144784){_0x144784=_0x144784||0xc8;return function(_0x5a611b){if(_0x5a611b){return _0xf286dc['status'](_0x144784)[_0xc5e3('0x1c')](_0x5a611b);}};}function respondWithFilteredResult(_0xf2d80e,_0x1becb2){return function(_0x323891){if(_0x323891){var _0x4adc93=_0x323891[_0xc5e3('0x1d')],_0x143471=_0x1becb2[_0xc5e3('0x1e')],_0x356f00=_0x1becb2['offset']+_0x1becb2['limit'],_0x54ffdb;if(_0x356f00>=_0x4adc93){_0x356f00=_0x4adc93;_0x54ffdb=0xc8;}else{_0x54ffdb=0xce;}_0xf2d80e[_0xc5e3('0x1a')](_0x54ffdb);return _0xf2d80e['set'](_0xc5e3('0x1f'),_0x143471+'-'+_0x356f00+'/'+_0x4adc93)[_0xc5e3('0x1c')](_0x323891);}return null;};}function patchUpdates(_0x3eb230){return function(_0x494c5a){try{jsonpatch[_0xc5e3('0x20')](_0x494c5a,_0x3eb230,!![]);}catch(_0x173722){return BPromise[_0xc5e3('0x21')](_0x173722);}return _0x494c5a[_0xc5e3('0x22')]();};}function saveUpdates(_0x25a830,_0x21496c){return function(_0x1f9065){if(_0x1f9065){return _0x1f9065[_0xc5e3('0x23')](_0x25a830)[_0xc5e3('0x24')](function(_0x333f6a){return _0x333f6a;});}return null;};}function removeEntity(_0x1a17e7,_0x368e42){return function(_0x2aeae9){if(_0x2aeae9){return _0x2aeae9[_0xc5e3('0x25')]()['then'](function(){_0x1a17e7[_0xc5e3('0x1a')](0xcc)[_0xc5e3('0x1b')]();});}};}function handleEntityNotFound(_0x50e041,_0x43a1ca){return function(_0x288bd3){if(!_0x288bd3){_0x50e041[_0xc5e3('0x19')](0x194);}return _0x288bd3;};}function handleError(_0x29a0e6,_0x28e836){_0x28e836=_0x28e836||0x1f4;return function(_0x48af16){logger[_0xc5e3('0x26')](_0x48af16[_0xc5e3('0x27')]);if(_0x48af16[_0xc5e3('0x28')]){delete _0x48af16['name'];}_0x29a0e6['status'](_0x28e836)[_0xc5e3('0x29')](_0x48af16);};}exports[_0xc5e3('0x2a')]=function(_0x2a5686,_0x4b2acf){var _0x1b2d69={},_0x236a08={},_0x832249={'count':0x0,'rows':[]};var _0x58e73d=db['JscriptySessionReport'][_0xc5e3('0x2b')];_0x236a08[_0xc5e3('0x2c')]=_[_0xc5e3('0x2d')](_0x58e73d);_0x236a08[_0xc5e3('0x2e')]=_['keys'](_0x2a5686['query']);_0x236a08[_0xc5e3('0x2f')]=_[_0xc5e3('0x30')](_0x236a08[_0xc5e3('0x2c')],_0x236a08[_0xc5e3('0x2e')]);_0x1b2d69[_0xc5e3('0x31')]=_['intersection'](_0x236a08[_0xc5e3('0x2c')],qs['fields'](_0x2a5686['query'][_0xc5e3('0x32')]));_0x1b2d69[_0xc5e3('0x31')]=_0x1b2d69[_0xc5e3('0x31')][_0xc5e3('0x33')]?_0x1b2d69[_0xc5e3('0x31')]:_0x236a08['model'];if(!_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x34')](_0xc5e3('0x35'))){_0x1b2d69[_0xc5e3('0x36')]=qs[_0xc5e3('0x36')](_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x36')]);_0x1b2d69[_0xc5e3('0x1e')]=qs[_0xc5e3('0x1e')](_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x1e')]);}_0x1b2d69[_0xc5e3('0x37')]=qs['sort'](_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x38')]);_0x1b2d69[_0xc5e3('0x39')]=qs[_0xc5e3('0x2f')](_['pick'](_0x2a5686['query'],_0x236a08[_0xc5e3('0x2f')]));if(_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x3a')]){_0x1b2d69[_0xc5e3('0x39')]=_[_0xc5e3('0x3b')](_0x1b2d69[_0xc5e3('0x39')],{'$or':_[_0xc5e3('0x3c')](_0x58e73d,function(_0x52bd8b){if(_0x52bd8b[_0xc5e3('0x3d')]['key']!=='VIRTUAL'){var _0x50bfba={};_0x50bfba[_0x52bd8b[_0xc5e3('0x3e')]]={'$like':'%'+_0x2a5686[_0xc5e3('0x2e')][_0xc5e3('0x3a')]+'%'};return _0x50bfba;}})});}_0x1b2d69=_[_0xc5e3('0x3b')]({},_0x1b2d69,_0x2a5686[_0xc5e3('0x3f')]);var _0x53bade={'where':_0x1b2d69[_0xc5e3('0x39')]};return db[_0xc5e3('0x40')][_0xc5e3('0x1d')](_0x53bade)[_0xc5e3('0x24')](function(_0x1b6bf0){_0x832249['count']=_0x1b6bf0;if(_0x2a5686['query'][_0xc5e3('0x41')]){_0x1b2d69[_0xc5e3('0x42')]=[{'all':!![]}];}return db[_0xc5e3('0x40')][_0xc5e3('0x43')](_0x1b2d69);})[_0xc5e3('0x24')](function(_0x59fba3){_0x832249['rows']=_0x59fba3;return _0x832249;})['then'](respondWithFilteredResult(_0x4b2acf,_0x1b2d69))['catch'](handleError(_0x4b2acf,null));};exports[_0xc5e3('0x44')]=function(_0x3019d9,_0x188f0a){var _0x12ac95={'raw':!![],'where':{'id':_0x3019d9[_0xc5e3('0x45')]['id']}},_0x5eb672={};_0x5eb672['model']=_[_0xc5e3('0x2d')](db[_0xc5e3('0x40')][_0xc5e3('0x2b')]);_0x5eb672['query']=_[_0xc5e3('0x2d')](_0x3019d9[_0xc5e3('0x2e')]);_0x5eb672['filters']=_['intersection'](_0x5eb672[_0xc5e3('0x2c')],_0x5eb672[_0xc5e3('0x2e')]);_0x12ac95[_0xc5e3('0x31')]=_[_0xc5e3('0x30')](_0x5eb672['model'],qs['fields'](_0x3019d9[_0xc5e3('0x2e')][_0xc5e3('0x32')]));_0x12ac95[_0xc5e3('0x31')]=_0x12ac95[_0xc5e3('0x31')]['length']?_0x12ac95[_0xc5e3('0x31')]:_0x5eb672['model'];if(_0x3019d9[_0xc5e3('0x2e')][_0xc5e3('0x41')]){_0x12ac95[_0xc5e3('0x42')]=[{'all':!![]}];}_0x12ac95=_[_0xc5e3('0x3b')]({},_0x12ac95,_0x3019d9[_0xc5e3('0x3f')]);return db[_0xc5e3('0x40')][_0xc5e3('0x46')](_0x12ac95)[_0xc5e3('0x24')](handleEntityNotFound(_0x188f0a,null))[_0xc5e3('0x24')](respondWithResult(_0x188f0a,null))['catch'](handleError(_0x188f0a,null));};exports['create']=function(_0x2fe69d,_0x4551b0){return db[_0xc5e3('0x40')][_0xc5e3('0x47')](_0x2fe69d['body'],{})[_0xc5e3('0x24')](respondWithResult(_0x4551b0,0xc9))[_0xc5e3('0x48')](handleError(_0x4551b0,null));};exports[_0xc5e3('0x23')]=function(_0x5f1610,_0x2a40ea){if(_0x5f1610[_0xc5e3('0x49')]['id']){delete _0x5f1610[_0xc5e3('0x49')]['id'];}return db[_0xc5e3('0x40')][_0xc5e3('0x46')]({'where':{'id':_0x5f1610[_0xc5e3('0x45')]['id']}})[_0xc5e3('0x24')](handleEntityNotFound(_0x2a40ea,null))[_0xc5e3('0x24')](saveUpdates(_0x5f1610[_0xc5e3('0x49')],null))[_0xc5e3('0x24')](respondWithResult(_0x2a40ea,null))[_0xc5e3('0x48')](handleError(_0x2a40ea,null));};exports[_0xc5e3('0x25')]=function(_0x3ed67c,_0x3d57a4){return db[_0xc5e3('0x40')]['find']({'where':{'id':_0x3ed67c[_0xc5e3('0x45')]['id']}})[_0xc5e3('0x24')](handleEntityNotFound(_0x3d57a4,null))[_0xc5e3('0x24')](removeEntity(_0x3d57a4,null))[_0xc5e3('0x48')](handleError(_0x3d57a4,null));};exports[_0xc5e3('0x4a')]=function(_0x190038,_0x217a67){return db[_0xc5e3('0x40')][_0xc5e3('0x4a')]()[_0xc5e3('0x24')](respondWithResult(_0x217a67,null))[_0xc5e3('0x48')](handleError(_0x217a67,null));};exports['getQuestions']=function(_0x4e5cbd,_0x417811,_0x1708a1){var _0x56ab04={'raw':!![],'where':{}};var _0x567ea2={};var _0x110129={'count':0x0,'rows':[]};return db[_0xc5e3('0x40')][_0xc5e3('0x4b')]({'where':{'id':_0x4e5cbd[_0xc5e3('0x45')]['id']}})[_0xc5e3('0x24')](handleEntityNotFound(_0x417811,null))[_0xc5e3('0x24')](function(_0x3e86ac){if(_0x3e86ac){_0x567ea2[_0xc5e3('0x2c')]=_[_0xc5e3('0x2d')](db[_0xc5e3('0x4c')][_0xc5e3('0x2b')]);_0x567ea2[_0xc5e3('0x2e')]=_[_0xc5e3('0x2d')](_0x4e5cbd[_0xc5e3('0x2e')]);_0x567ea2[_0xc5e3('0x2f')]=_['intersection'](_0x567ea2['model'],_0x567ea2[_0xc5e3('0x2e')]);_0x56ab04[_0xc5e3('0x31')]=_[_0xc5e3('0x30')](_0x567ea2[_0xc5e3('0x2c')],qs[_0xc5e3('0x32')](_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x32')]));_0x56ab04[_0xc5e3('0x31')]=_0x56ab04[_0xc5e3('0x31')][_0xc5e3('0x33')]?_0x56ab04['attributes']:_0x567ea2[_0xc5e3('0x2c')];if(!_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x34')]('nolimit')){_0x56ab04[_0xc5e3('0x36')]=qs[_0xc5e3('0x36')](_0x4e5cbd['query'][_0xc5e3('0x36')]);_0x56ab04['offset']=qs['offset'](_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x1e')]);}_0x56ab04[_0xc5e3('0x37')]=qs[_0xc5e3('0x38')](_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x38')]);_0x56ab04[_0xc5e3('0x39')]=qs['filters'](_[_0xc5e3('0x4d')](_0x4e5cbd['query'],_0x567ea2[_0xc5e3('0x2f')]));_0x56ab04['where']['SessionId']=_0x3e86ac['id'];if(_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x3a')]){_0x56ab04[_0xc5e3('0x39')]=_[_0xc5e3('0x3b')](_0x56ab04[_0xc5e3('0x39')],{'$or':_['map'](_0x56ab04[_0xc5e3('0x31')],function(_0x3bdca9){var _0x417981={};_0x417981[_0x3bdca9]={'$like':'%'+_0x4e5cbd[_0xc5e3('0x2e')][_0xc5e3('0x3a')]+'%'};return _0x417981;})});}_0x56ab04=_[_0xc5e3('0x3b')]({},_0x56ab04,_0x4e5cbd[_0xc5e3('0x3f')]);return db[_0xc5e3('0x4c')]['count']({'where':_0x56ab04[_0xc5e3('0x39')]})[_0xc5e3('0x24')](function(_0x88eb2e){_0x110129[_0xc5e3('0x1d')]=_0x88eb2e;if(_0x4e5cbd['query']['includeAll']){_0x56ab04[_0xc5e3('0x42')]=[{'all':!![]}];}return db[_0xc5e3('0x4c')][_0xc5e3('0x43')](_0x56ab04);})['then'](function(_0x231ba5){_0x110129[_0xc5e3('0x4e')]=_0x231ba5;return _0x110129;});}})[_0xc5e3('0x24')](respondWithFilteredResult(_0x417811,_0x56ab04))['catch'](handleError(_0x417811,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 495997c..209b613 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 _0xbaf8=['exports','define','report_jscripty_sessions','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x25456c,_0x53db8a){var _0x3caecd=function(_0x15e49a){while(--_0x15e49a){_0x25456c['push'](_0x25456c['shift']());}};_0x3caecd(++_0x53db8a);}(_0xbaf8,0x125));var _0x8baf=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0xbaf8[_0x2ae2ad];return _0x26dbd7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8baf('0x0'))(_0x8baf('0x1'));var moment=require(_0x8baf('0x2'));var BPromise=require('bluebird');var rp=require(_0x8baf('0x3'));var fs=require('fs');var path=require(_0x8baf('0x4'));var rimraf=require(_0x8baf('0x5'));var config=require(_0x8baf('0x6'));var attributes=require('./jscriptySessionReport.attributes');module[_0x8baf('0x7')]=function(_0x52fd61,_0x32d60a){return _0x52fd61[_0x8baf('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x8baf('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7483=['lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x2f3f19,_0x3f47cc){var _0x4574be=function(_0x1b0aab){while(--_0x1b0aab){_0x2f3f19['push'](_0x2f3f19['shift']());}};_0x4574be(++_0x3f47cc);}(_0x7483,0x1c8));var _0x3748=function(_0x1ec8ec,_0x400f85){_0x1ec8ec=_0x1ec8ec-0x0;var _0x4ea607=_0x7483[_0x1ec8ec];return _0x4ea607;};'use strict';var _=require(_0x3748('0x0'));var util=require('util');var logger=require(_0x3748('0x1'))(_0x3748('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3748('0x3'));var fs=require('fs');var path=require(_0x3748('0x4'));var rimraf=require(_0x3748('0x5'));var config=require(_0x3748('0x6'));var attributes=require(_0x3748('0x7'));module[_0x3748('0x8')]=function(_0x28c391,_0xde1237){return _0x28c391[_0x3748('0x9')](_0x3748('0xa'),attributes,{'tableName':_0x3748('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 10281fa..cd4d7f5 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 _0xf06c=['client','info','JscriptySessionReport,\x20%s,\x20%s','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3eae7b,_0x23694f){var _0x250732=function(_0x63ce2c){while(--_0x63ce2c){_0x3eae7b['push'](_0x3eae7b['shift']());}};_0x250732(++_0x23694f);}(_0xf06c,0xc7));var _0xcf06=function(_0x30661d,_0x409562){_0x30661d=_0x30661d-0x0;var _0x5ea94c=_0xf06c[_0x30661d];return _0x5ea94c;};'use strict';var _=require(_0xcf06('0x0'));var util=require(_0xcf06('0x1'));var moment=require(_0xcf06('0x2'));var BPromise=require(_0xcf06('0x3'));var rs=require(_0xcf06('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf06('0x5'))['db'];var utils=require(_0xcf06('0x6'));var logger=require(_0xcf06('0x7'))('rpc');var config=require(_0xcf06('0x8'));var jayson=require(_0xcf06('0x9'));var client=jayson[_0xcf06('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22ac40,_0x5d1aa0,_0x2723ad){return new BPromise(function(_0x48ed0c,_0x4dd606){return client['request'](_0x22ac40,_0x2723ad)['then'](function(_0x6ecf1a){logger[_0xcf06('0xb')](_0xcf06('0xc'),_0x5d1aa0,'request\x20sent');logger['debug'](_0xcf06('0xd'),_0x5d1aa0,'request\x20sent',JSON[_0xcf06('0xe')](_0x6ecf1a));if(_0x6ecf1a['error']){if(_0x6ecf1a[_0xcf06('0xf')]['code']===0x1f4){logger[_0xcf06('0xf')](_0xcf06('0xc'),_0x5d1aa0,_0x6ecf1a[_0xcf06('0xf')][_0xcf06('0x10')]);return _0x4dd606(_0x6ecf1a['error']['message']);}logger[_0xcf06('0xf')](_0xcf06('0xc'),_0x5d1aa0,_0x6ecf1a[_0xcf06('0xf')][_0xcf06('0x10')]);return _0x48ed0c(_0x6ecf1a['error'][_0xcf06('0x10')]);}else{logger[_0xcf06('0xb')]('JscriptySessionReport,\x20%s,\x20%s',_0x5d1aa0,'request\x20sent');_0x48ed0c(_0x6ecf1a[_0xcf06('0x11')][_0xcf06('0x10')]);}})[_0xcf06('0x12')](function(_0x57c316){logger[_0xcf06('0xf')](_0xcf06('0xc'),_0x5d1aa0,_0x57c316);_0x4dd606(_0x57c316);});});} \ No newline at end of file +var _0x0755=['request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x9682c5,_0x5ed0ec){var _0x177062=function(_0x32724d){while(--_0x32724d){_0x9682c5['push'](_0x9682c5['shift']());}};_0x177062(++_0x5ed0ec);}(_0x0755,0x7c));var _0x5075=function(_0x4080d8,_0x298f9b){_0x4080d8=_0x4080d8-0x0;var _0x3d3bab=_0x0755[_0x4080d8];return _0x3d3bab;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var moment=require(_0x5075('0x2'));var BPromise=require(_0x5075('0x3'));var rs=require(_0x5075('0x4'));var fs=require('fs');var Redis=require(_0x5075('0x5'));var db=require(_0x5075('0x6'))['db'];var utils=require(_0x5075('0x7'));var logger=require(_0x5075('0x8'))(_0x5075('0x9'));var config=require('../../config/environment');var jayson=require(_0x5075('0xa'));var client=jayson[_0x5075('0xb')][_0x5075('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2e39f4,_0x57f9e8,_0x52bb37){return new BPromise(function(_0x4f882e,_0x41d88f){return client[_0x5075('0xd')](_0x2e39f4,_0x52bb37)['then'](function(_0x1782e9){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'));logger['debug']('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x57f9e8,_0x5075('0xe'),JSON[_0x5075('0xf')](_0x1782e9));if(_0x1782e9[_0x5075('0x10')]){if(_0x1782e9['error'][_0x5075('0x11')]===0x1f4){logger['error'](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x41d88f(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}logger[_0x5075('0x10')](_0x5075('0x12'),_0x57f9e8,_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);return _0x4f882e(_0x1782e9[_0x5075('0x10')][_0x5075('0x13')]);}else{logger[_0x5075('0x14')](_0x5075('0x12'),_0x57f9e8,'request\x20sent');_0x4f882e(_0x1782e9[_0x5075('0x15')][_0x5075('0x13')]);}})[_0x5075('0x16')](function(_0x381b3b){logger[_0x5075('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x57f9e8,_0x381b3b);_0x41d88f(_0x381b3b);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index aed4627..dc3e8a4 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 _0xbd87=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','put','/:id','isAuthenticated','update'];(function(_0x1eefe5,_0x13c28e){var _0x139055=function(_0x34683b){while(--_0x34683b){_0x1eefe5['push'](_0x1eefe5['shift']());}};_0x139055(++_0x13c28e);}(_0xbd87,0x76));var _0x7bd8=function(_0x3e41d8,_0x4deafd){_0x3e41d8=_0x3e41d8-0x0;var _0x2ba82a=_0xbd87[_0x3e41d8];return _0x2ba82a;};'use strict';var multer=require(_0x7bd8('0x0'));var util=require(_0x7bd8('0x1'));var path=require(_0x7bd8('0x2'));var timeout=require(_0x7bd8('0x3'));var express=require(_0x7bd8('0x4'));var router=express[_0x7bd8('0x5')]();var auth=require(_0x7bd8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bd8('0x7'));var controller=require('./license.controller');router['get']('/',controller['index']);router[_0x7bd8('0x8')](_0x7bd8('0x9'),auth[_0x7bd8('0xa')](),controller[_0x7bd8('0xb')]);module[_0x7bd8('0xc')]=router; \ No newline at end of file +var _0xf72d=['./license.controller','get','index','/:id','isAuthenticated','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x11525c,_0x169add){var _0x89cb90=function(_0x5affc9){while(--_0x5affc9){_0x11525c['push'](_0x11525c['shift']());}};_0x89cb90(++_0x169add);}(_0xf72d,0x101));var _0xdf72=function(_0x11a220,_0x4e470a){_0x11a220=_0x11a220-0x0;var _0x20d8fe=_0xf72d[_0x11a220];return _0x20d8fe;};'use strict';var multer=require('multer');var util=require(_0xdf72('0x0'));var path=require(_0xdf72('0x1'));var timeout=require(_0xdf72('0x2'));var express=require(_0xdf72('0x3'));var router=express[_0xdf72('0x4')]();var auth=require(_0xdf72('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdf72('0x6'));var controller=require(_0xdf72('0x7'));router[_0xdf72('0x8')]('/',controller[_0xdf72('0x9')]);router['put'](_0xdf72('0xa'),auth[_0xdf72('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e373d24..123c5fd 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 _0x39c9=['exports','TEXT','STRING','INTEGER'];(function(_0x48f7cf,_0x4baa04){var _0xc201c0=function(_0x23ff34){while(--_0x23ff34){_0x48f7cf['push'](_0x48f7cf['shift']());}};_0xc201c0(++_0x4baa04);}(_0x39c9,0x1b0));var _0x939c=function(_0x391b7,_0x48ef4e){_0x391b7=_0x391b7-0x0;var _0x11095d=_0x39c9[_0x391b7];return _0x11095d;};'use strict';var Sequelize=require('sequelize');module[_0x939c('0x0')]={'license':{'type':Sequelize[_0x939c('0x1')]},'data1':{'type':Sequelize[_0x939c('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0x939c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf093=['INTEGER','exports','TEXT','STRING'];(function(_0x5da73f,_0x592980){var _0x1b3d73=function(_0x4e62ba){while(--_0x4e62ba){_0x5da73f['push'](_0x5da73f['shift']());}};_0x1b3d73(++_0x592980);}(_0xf093,0xd5));var _0x3f09=function(_0x334f5f,_0x5f5496){_0x334f5f=_0x334f5f-0x0;var _0x123ca0=_0xf093[_0x334f5f];return _0x123ca0;};'use strict';var Sequelize=require('sequelize');module[_0x3f09('0x0')]={'license':{'type':Sequelize[_0x3f09('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x3f09('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x3f09('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index b4b4a99..06bcf9a 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 _0x7619=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','update','destroy','then','stack','name','index','model','keys','License','query','filters','intersection','attributes','fields','merge','options','catch','body','find','params','get','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0x7619,0xdb));var _0x9761=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7619[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9761('0x0'));var emlformat=require(_0x9761('0x1'));var rimraf=require(_0x9761('0x2'));var zipdir=require(_0x9761('0x3'));var jsonpatch=require(_0x9761('0x4'));var rp=require(_0x9761('0x5'));var moment=require(_0x9761('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9761('0x7'));var path=require(_0x9761('0x8'));var sox=require(_0x9761('0x9'));var csv=require(_0x9761('0xa'));var ejs=require(_0x9761('0xb'));var fs=require('fs');var _=require(_0x9761('0xc'));var squel=require(_0x9761('0xd'));var crypto=require('crypto');var jsforce=require(_0x9761('0xe'));var deskjs=require(_0x9761('0xf'));var toCsv=require(_0x9761('0xa'));var querystring=require(_0x9761('0x10'));var Papa=require(_0x9761('0x11'));var Redis=require(_0x9761('0x12'));var authService=require(_0x9761('0x13'));var qs=require(_0x9761('0x14'));var hardwareService=require(_0x9761('0x15'));var logger=require(_0x9761('0x16'))(_0x9761('0x17'));var utils=require(_0x9761('0x18'));var config=require(_0x9761('0x19'));var db=require(_0x9761('0x1a'))['db'];function respondWithStatusCode(_0xf0e397,_0x5a3b33){_0x5a3b33=_0x5a3b33||0xcc;return function(_0x33871d){if(_0x33871d){return _0xf0e397[_0x9761('0x1b')](_0x5a3b33);}return _0xf0e397[_0x9761('0x1c')](_0x5a3b33)[_0x9761('0x1d')]();};}function respondWithResult(_0x26082d,_0x107863){_0x107863=_0x107863||0xc8;return function(_0x37722d){if(_0x37722d){return _0x26082d[_0x9761('0x1c')](_0x107863)[_0x9761('0x1e')](_0x37722d);}};}function respondWithFilteredResult(_0x1995a3,_0x8109d4){return function(_0x318d74){if(_0x318d74){var _0x55e2ed=_0x318d74[_0x9761('0x1f')],_0x4c57d5=_0x8109d4[_0x9761('0x20')],_0xc70fc0=_0x8109d4['offset']+_0x8109d4[_0x9761('0x21')],_0x113f07;if(_0xc70fc0>=_0x55e2ed){_0xc70fc0=_0x55e2ed;_0x113f07=0xc8;}else{_0x113f07=0xce;}_0x1995a3[_0x9761('0x1c')](_0x113f07);return _0x1995a3['set']('Content-Range',_0x4c57d5+'-'+_0xc70fc0+'/'+_0x55e2ed)['json'](_0x318d74);}return null;};}function patchUpdates(_0x25c90a){return function(_0x27b71f){try{jsonpatch[_0x9761('0x22')](_0x27b71f,_0x25c90a,!![]);}catch(_0x181d5d){return BPromise['reject'](_0x181d5d);}return _0x27b71f['save']();};}function saveUpdates(_0x19458d,_0x1b85b2){return function(_0x583cfc){if(_0x583cfc){return _0x583cfc[_0x9761('0x23')](_0x19458d)['then'](function(_0x1295d2){return _0x1295d2;});}return null;};}function removeEntity(_0x4b2fce,_0x5e3a9e){return function(_0xd44a48){if(_0xd44a48){return _0xd44a48[_0x9761('0x24')]()[_0x9761('0x25')](function(){_0x4b2fce[_0x9761('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a25b,_0x5823ff){return function(_0x5cb830){if(!_0x5cb830){_0x23a25b['sendStatus'](0x194);}return _0x5cb830;};}function handleError(_0x3ac180,_0x35020e){_0x35020e=_0x35020e||0x1f4;return function(_0x1bcb69){logger['error'](_0x1bcb69[_0x9761('0x26')]);if(_0x1bcb69[_0x9761('0x27')]){delete _0x1bcb69[_0x9761('0x27')];}_0x3ac180[_0x9761('0x1c')](_0x35020e)['send'](_0x1bcb69);};}var utilLicense=require('../../config/license/util');exports[_0x9761('0x28')]=function(_0x3d6587,_0x2a79a4){var _0x3a3085={'raw':!![],'where':{'id':0x1}},_0x2180ef={};_0x2180ef[_0x9761('0x29')]=_[_0x9761('0x2a')](db[_0x9761('0x2b')]['rawAttributes']);_0x2180ef[_0x9761('0x2c')]=_[_0x9761('0x2a')](_0x3d6587[_0x9761('0x2c')]);_0x2180ef[_0x9761('0x2d')]=_[_0x9761('0x2e')](_0x2180ef[_0x9761('0x29')],_0x2180ef[_0x9761('0x2c')]);_0x3a3085[_0x9761('0x2f')]=_[_0x9761('0x2e')](_0x2180ef[_0x9761('0x29')],qs[_0x9761('0x30')](_0x3d6587[_0x9761('0x2c')][_0x9761('0x30')]));_0x3a3085['attributes']=_0x3a3085['attributes']['length']?_0x3a3085['attributes']:_0x2180ef[_0x9761('0x29')];_0x3a3085=_[_0x9761('0x31')]({},_0x3a3085,_0x3d6587[_0x9761('0x32')]);return utilLicense['getLicense'](_0x3a3085)[_0x9761('0x25')](respondWithResult(_0x2a79a4,null))[_0x9761('0x33')](handleError(_0x2a79a4,null));};exports[_0x9761('0x23')]=function(_0x3c12b5,_0x33b505){if(_0x3c12b5['body']['id']){delete _0x3c12b5[_0x9761('0x34')]['id'];}return db[_0x9761('0x2b')][_0x9761('0x35')]({'where':{'id':_0x3c12b5[_0x9761('0x36')]['id']}})[_0x9761('0x25')](handleEntityNotFound(_0x33b505,null))[_0x9761('0x25')](function(_0x24bbdb){var _0x58373c=_0x24bbdb[_0x9761('0x37')]({'plain':!![]});return utilLicense[_0x9761('0x38')](_0x58373c,_0x3c12b5[_0x9761('0x34')][_0x9761('0x39')]);})[_0x9761('0x25')](function(_0x11ff79){if(!_0x11ff79[_0x9761('0x3a')]){return saveUpdates(_0x3c12b5['body'],null);}return _0x11ff79;})['then'](respondWithResult(_0x33b505,null))['catch'](handleError(_0x33b505,null));}; \ No newline at end of file +var _0xc9d5=['get','checkLicense','key','demo','catch','html-pdf','rimraf','zip-dir','fast-json-patch','mustache','path','sox','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','save','destroy','then','error','stack','name','index','model','rawAttributes','query','filters','attributes','intersection','fields','length','merge','update','body','License'];(function(_0x5dd357,_0x3e06ad){var _0xef3936=function(_0x141316){while(--_0x141316){_0x5dd357['push'](_0x5dd357['shift']());}};_0xef3936(++_0x3e06ad);}(_0xc9d5,0x163));var _0x5c9d=function(_0x14fdbd,_0x58e34a){_0x14fdbd=_0x14fdbd-0x0;var _0x3c5953=_0xc9d5[_0x14fdbd];return _0x3c5953;};'use strict';var pdf=require(_0x5c9d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5c9d('0x1'));var zipdir=require(_0x5c9d('0x2'));var jsonpatch=require(_0x5c9d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5c9d('0x4'));var util=require('util');var path=require(_0x5c9d('0x5'));var sox=require(_0x5c9d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5c9d('0x7'));var crypto=require(_0x5c9d('0x8'));var jsforce=require(_0x5c9d('0x9'));var deskjs=require(_0x5c9d('0xa'));var toCsv=require(_0x5c9d('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5c9d('0xc'));var authService=require(_0x5c9d('0xd'));var qs=require(_0x5c9d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c9d('0xf'))(_0x5c9d('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5c9d('0x11'))['db'];function respondWithStatusCode(_0x3993c6,_0xb9fea){_0xb9fea=_0xb9fea||0xcc;return function(_0x34b448){if(_0x34b448){return _0x3993c6[_0x5c9d('0x12')](_0xb9fea);}return _0x3993c6['status'](_0xb9fea)[_0x5c9d('0x13')]();};}function respondWithResult(_0x40f6d4,_0xc52734){_0xc52734=_0xc52734||0xc8;return function(_0x25941b){if(_0x25941b){return _0x40f6d4[_0x5c9d('0x14')](_0xc52734)[_0x5c9d('0x15')](_0x25941b);}};}function respondWithFilteredResult(_0x498a06,_0x53621b){return function(_0x167c50){if(_0x167c50){var _0x50a6b8=_0x167c50['count'],_0x5631c2=_0x53621b[_0x5c9d('0x16')],_0x462503=_0x53621b[_0x5c9d('0x16')]+_0x53621b['limit'],_0x50f045;if(_0x462503>=_0x50a6b8){_0x462503=_0x50a6b8;_0x50f045=0xc8;}else{_0x50f045=0xce;}_0x498a06[_0x5c9d('0x14')](_0x50f045);return _0x498a06[_0x5c9d('0x17')](_0x5c9d('0x18'),_0x5631c2+'-'+_0x462503+'/'+_0x50a6b8)[_0x5c9d('0x15')](_0x167c50);}return null;};}function patchUpdates(_0x50f2d6){return function(_0x4c0df9){try{jsonpatch[_0x5c9d('0x19')](_0x4c0df9,_0x50f2d6,!![]);}catch(_0x37bbba){return BPromise['reject'](_0x37bbba);}return _0x4c0df9[_0x5c9d('0x1a')]();};}function saveUpdates(_0x5dc79d,_0x1c6718){return function(_0x98bce6){if(_0x98bce6){return _0x98bce6['update'](_0x5dc79d)['then'](function(_0x525b6c){return _0x525b6c;});}return null;};}function removeEntity(_0x2ae71c,_0x1600c2){return function(_0x182cf6){if(_0x182cf6){return _0x182cf6[_0x5c9d('0x1b')]()[_0x5c9d('0x1c')](function(){_0x2ae71c[_0x5c9d('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36df61,_0x18a999){return function(_0x5e53b9){if(!_0x5e53b9){_0x36df61['sendStatus'](0x194);}return _0x5e53b9;};}function handleError(_0x2af260,_0x2dd04d){_0x2dd04d=_0x2dd04d||0x1f4;return function(_0x3bbe46){logger[_0x5c9d('0x1d')](_0x3bbe46[_0x5c9d('0x1e')]);if(_0x3bbe46[_0x5c9d('0x1f')]){delete _0x3bbe46[_0x5c9d('0x1f')];}_0x2af260[_0x5c9d('0x14')](_0x2dd04d)['send'](_0x3bbe46);};}var utilLicense=require('../../config/license/util');exports[_0x5c9d('0x20')]=function(_0x58e59f,_0x2f7b88){var _0x34d5f4={'raw':!![],'where':{'id':0x1}},_0x310121={};_0x310121[_0x5c9d('0x21')]=_['keys'](db['License'][_0x5c9d('0x22')]);_0x310121[_0x5c9d('0x23')]=_['keys'](_0x58e59f[_0x5c9d('0x23')]);_0x310121[_0x5c9d('0x24')]=_['intersection'](_0x310121['model'],_0x310121['query']);_0x34d5f4[_0x5c9d('0x25')]=_[_0x5c9d('0x26')](_0x310121[_0x5c9d('0x21')],qs[_0x5c9d('0x27')](_0x58e59f['query'][_0x5c9d('0x27')]));_0x34d5f4[_0x5c9d('0x25')]=_0x34d5f4[_0x5c9d('0x25')][_0x5c9d('0x28')]?_0x34d5f4[_0x5c9d('0x25')]:_0x310121[_0x5c9d('0x21')];_0x34d5f4=_[_0x5c9d('0x29')]({},_0x34d5f4,_0x58e59f['options']);return utilLicense['getLicense'](_0x34d5f4)[_0x5c9d('0x1c')](respondWithResult(_0x2f7b88,null))['catch'](handleError(_0x2f7b88,null));};exports[_0x5c9d('0x2a')]=function(_0x5d7a86,_0x1d8596){if(_0x5d7a86['body']['id']){delete _0x5d7a86[_0x5c9d('0x2b')]['id'];}return db[_0x5c9d('0x2c')]['find']({'where':{'id':_0x5d7a86['params']['id']}})[_0x5c9d('0x1c')](handleEntityNotFound(_0x1d8596,null))['then'](function(_0x1bc2b2){var _0x38ea9d=_0x1bc2b2[_0x5c9d('0x2d')]({'plain':!![]});return utilLicense[_0x5c9d('0x2e')](_0x38ea9d,_0x5d7a86[_0x5c9d('0x2b')][_0x5c9d('0x2f')]);})[_0x5c9d('0x1c')](function(_0x2a85bd){if(!_0x2a85bd[_0x5c9d('0x30')]){return saveUpdates(_0x5d7a86[_0x5c9d('0x2b')],null);}return _0x2a85bd;})['then'](respondWithResult(_0x1d8596,null))[_0x5c9d('0x31')](handleError(_0x1d8596,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index f251375..75a8b61 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 _0x5ff3=['license','util','api','bluebird','request-promise','path','rimraf','./license.attributes','exports','define'];(function(_0x56085a,_0x2eca19){var _0x2d1aa4=function(_0x23c99c){while(--_0x23c99c){_0x56085a['push'](_0x56085a['shift']());}};_0x2d1aa4(++_0x2eca19);}(_0x5ff3,0x17d));var _0x35ff=function(_0x1b697b,_0xf18341){_0x1b697b=_0x1b697b-0x0;var _0x32ed9f=_0x5ff3[_0x1b697b];return _0x32ed9f;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('License',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcecc=['exports','define','License','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x2265da,_0xfbbd2e){var _0x430c2b=function(_0x20d671){while(--_0x20d671){_0x2265da['push'](_0x2265da['shift']());}};_0x430c2b(++_0xfbbd2e);}(_0xcecc,0x186));var _0xccec=function(_0x22a100,_0x3e6383){_0x22a100=_0x22a100-0x0;var _0x575540=_0xcecc[_0x22a100];return _0x575540;};'use strict';var _=require(_0xccec('0x0'));var util=require('util');var logger=require(_0xccec('0x1'))('api');var moment=require('moment');var BPromise=require(_0xccec('0x2'));var rp=require(_0xccec('0x3'));var fs=require('fs');var path=require(_0xccec('0x4'));var rimraf=require(_0xccec('0x5'));var config=require('../../config/environment');var attributes=require('./license.attributes');module[_0xccec('0x6')]=function(_0x5822af,_0x455556){return _0x5822af[_0xccec('0x7')](_0xccec('0x8'),attributes,{'tableName':'license','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 8a2e8f2..25c067a 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 _0xc402=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','http','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','License,\x20%s,\x20%s'];(function(_0x3bf052,_0x5531cb){var _0xae1ca6=function(_0x3917c6){while(--_0x3917c6){_0x3bf052['push'](_0x3bf052['shift']());}};_0xae1ca6(++_0x5531cb);}(_0xc402,0x66));var _0x2c40=function(_0x282c8d,_0x26ee7d){_0x282c8d=_0x282c8d-0x0;var _0x1536b5=_0xc402[_0x282c8d];return _0x1536b5;};'use strict';var _=require(_0x2c40('0x0'));var util=require(_0x2c40('0x1'));var moment=require('moment');var BPromise=require(_0x2c40('0x2'));var rs=require(_0x2c40('0x3'));var fs=require('fs');var Redis=require(_0x2c40('0x4'));var db=require(_0x2c40('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c40('0x6'));var config=require('../../config/environment');var jayson=require(_0x2c40('0x7'));var client=jayson['client'][_0x2c40('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2c0065,_0x466ec5,_0x705c5){return new BPromise(function(_0x3baccf,_0x454fa7){return client['request'](_0x2c0065,_0x705c5)[_0x2c40('0x9')](function(_0x5d0299){logger[_0x2c40('0xa')]('License,\x20%s,\x20%s',_0x466ec5,'request\x20sent');logger[_0x2c40('0xb')](_0x2c40('0xc'),_0x466ec5,_0x2c40('0xd'),JSON[_0x2c40('0xe')](_0x5d0299));if(_0x5d0299['error']){if(_0x5d0299['error'][_0x2c40('0xf')]===0x1f4){logger[_0x2c40('0x10')](_0x2c40('0x11'),_0x466ec5,_0x5d0299[_0x2c40('0x10')][_0x2c40('0x12')]);return _0x454fa7(_0x5d0299['error'][_0x2c40('0x12')]);}logger[_0x2c40('0x10')](_0x2c40('0x11'),_0x466ec5,_0x5d0299['error'][_0x2c40('0x12')]);return _0x3baccf(_0x5d0299[_0x2c40('0x10')][_0x2c40('0x12')]);}else{logger[_0x2c40('0xa')](_0x2c40('0x11'),_0x466ec5,'request\x20sent');_0x3baccf(_0x5d0299['result'][_0x2c40('0x12')]);}})[_0x2c40('0x13')](function(_0xda2f01){logger['error'](_0x2c40('0x11'),_0x466ec5,_0xda2f01);_0x454fa7(_0xda2f01);});});} \ No newline at end of file +var _0xd3bf=['error','code','License,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0xd3bf,0x16d));var _0xfd3b=function(_0x377f32,_0x2b032c){_0x377f32=_0x377f32-0x0;var _0x43a1b0=_0xd3bf[_0x377f32];return _0x43a1b0;};'use strict';var _=require(_0xfd3b('0x0'));var util=require('util');var moment=require(_0xfd3b('0x1'));var BPromise=require(_0xfd3b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd3b('0x3'));var db=require(_0xfd3b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd3b('0x5'))(_0xfd3b('0x6'));var config=require('../../config/environment');var jayson=require(_0xfd3b('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3da9cb,_0x182ed1,_0x335bb3){return new BPromise(function(_0x508be3,_0x3cdd25){return client[_0xfd3b('0x8')](_0x3da9cb,_0x335bb3)[_0xfd3b('0x9')](function(_0x39036d){logger[_0xfd3b('0xa')]('License,\x20%s,\x20%s',_0x182ed1,_0xfd3b('0xb'));logger[_0xfd3b('0xc')](_0xfd3b('0xd'),_0x182ed1,_0xfd3b('0xb'),JSON[_0xfd3b('0xe')](_0x39036d));if(_0x39036d[_0xfd3b('0xf')]){if(_0x39036d['error'][_0xfd3b('0x10')]===0x1f4){logger[_0xfd3b('0xf')](_0xfd3b('0x11'),_0x182ed1,_0x39036d['error'][_0xfd3b('0x12')]);return _0x3cdd25(_0x39036d[_0xfd3b('0xf')][_0xfd3b('0x12')]);}logger['error']('License,\x20%s,\x20%s',_0x182ed1,_0x39036d[_0xfd3b('0xf')]['message']);return _0x508be3(_0x39036d['error']['message']);}else{logger[_0xfd3b('0xa')](_0xfd3b('0x11'),_0x182ed1,_0xfd3b('0xb'));_0x508be3(_0x39036d['result'][_0xfd3b('0x12')]);}})[_0xfd3b('0x13')](function(_0x20dabe){logger['error'](_0xfd3b('0x11'),_0x182ed1,_0x20dabe);_0x3cdd25(_0x20dabe);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 0966503..f6c83e3 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 _0xa79f=['Router','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','addAgents','put','/:id','update','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','express'];(function(_0x2a1b68,_0x5ded42){var _0x526c10=function(_0x8fdb43){while(--_0x8fdb43){_0x2a1b68['push'](_0x2a1b68['shift']());}};_0x526c10(++_0x5ded42);}(_0xa79f,0x184));var _0xfa79=function(_0x2af6f0,_0x9538cc){_0x2af6f0=_0x2af6f0-0x0;var _0x4f4a2e=_0xa79f[_0x2af6f0];return _0x4f4a2e;};'use strict';var multer=require(_0xfa79('0x0'));var util=require(_0xfa79('0x1'));var path=require(_0xfa79('0x2'));var timeout=require('connect-timeout');var express=require(_0xfa79('0x3'));var router=express[_0xfa79('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfa79('0x5'));var config=require(_0xfa79('0x6'));var controller=require(_0xfa79('0x7'));router[_0xfa79('0x8')]('/',auth[_0xfa79('0x9')](),controller[_0xfa79('0xa')]);router[_0xfa79('0x8')](_0xfa79('0xb'),auth[_0xfa79('0x9')](),controller[_0xfa79('0xc')]);router[_0xfa79('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xfa79('0xd')]);router[_0xfa79('0x8')](_0xfa79('0xe'),auth['isAuthenticated'](),controller[_0xfa79('0xf')]);router['get']('/:id/canned_answers',auth[_0xfa79('0x9')](),controller['getAnswers']);router[_0xfa79('0x8')](_0xfa79('0x10'),auth['isAuthenticated'](),controller[_0xfa79('0x11')]);router['get'](_0xfa79('0x12'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x13')]);router[_0xfa79('0x8')]('/:id/interactions',auth[_0xfa79('0x9')](),controller[_0xfa79('0x14')]);router[_0xfa79('0x8')](_0xfa79('0x15'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x16')]);router[_0xfa79('0x8')](_0xfa79('0x17'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x18')]);router[_0xfa79('0x8')](_0xfa79('0x19'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x1a')]);router[_0xfa79('0x8')](_0xfa79('0x1b'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x1c')]);router['post'](_0xfa79('0xe'),auth[_0xfa79('0x9')](),controller['addDisposition']);router[_0xfa79('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0xfa79('0x1d')]('/',auth['isAuthenticated'](),controller[_0xfa79('0x1e')]);router[_0xfa79('0x1d')](_0xfa79('0x10'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x1f')]);router[_0xfa79('0x1d')](_0xfa79('0x12'),auth['isAuthenticated'](),controller[_0xfa79('0x20')]);router[_0xfa79('0x1d')](_0xfa79('0x21'),auth['isAuthenticated'](),controller[_0xfa79('0x22')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xfa79('0x23')]);router[_0xfa79('0x1d')](_0xfa79('0x24'),auth['isAuthenticated'](),controller['send']);router['post']('/:id/users',auth[_0xfa79('0x9')](),controller[_0xfa79('0x25')]);router[_0xfa79('0x26')](_0xfa79('0x27'),auth['isAuthenticated'](),controller[_0xfa79('0x28')]);router[_0xfa79('0x29')](_0xfa79('0xe'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x2a')]);router['delete'](_0xfa79('0x2b'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x2c')]);router[_0xfa79('0x29')](_0xfa79('0x10'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x2d')]);router[_0xfa79('0x29')](_0xfa79('0x12'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x2e')]);router[_0xfa79('0x29')]('/:id',auth['isAuthenticated'](),controller[_0xfa79('0x2f')]);router[_0xfa79('0x29')](_0xfa79('0x1b'),auth[_0xfa79('0x9')](),controller[_0xfa79('0x30')]);module['exports']=router; \ No newline at end of file +var _0xe77d=['post','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','removeDispositions','delete','removeAnswers','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','/:id/verify','verifySmtp','/:id/users','getAgents'];(function(_0x34507d,_0x4600ba){var _0x33d263=function(_0xf7c7b){while(--_0xf7c7b){_0x34507d['push'](_0x34507d['shift']());}};_0x33d263(++_0x4600ba);}(_0xe77d,0xc6));var _0xde77=function(_0x546ab6,_0x357f23){_0x546ab6=_0x546ab6-0x0;var _0x3952ca=_0xe77d[_0x546ab6];return _0x3952ca;};'use strict';var multer=require(_0xde77('0x0'));var util=require(_0xde77('0x1'));var path=require(_0xde77('0x2'));var timeout=require(_0xde77('0x3'));var express=require(_0xde77('0x4'));var router=express[_0xde77('0x5')]();var auth=require(_0xde77('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xde77('0x7'));var controller=require(_0xde77('0x8'));router[_0xde77('0x9')]('/',auth[_0xde77('0xa')](),controller[_0xde77('0xb')]);router[_0xde77('0x9')](_0xde77('0xc'),auth[_0xde77('0xa')](),controller[_0xde77('0xd')]);router['get'](_0xde77('0xe'),auth[_0xde77('0xa')](),controller['show']);router[_0xde77('0x9')](_0xde77('0xf'),auth[_0xde77('0xa')](),controller[_0xde77('0x10')]);router['get'](_0xde77('0x11'),auth[_0xde77('0xa')](),controller['getAnswers']);router[_0xde77('0x9')](_0xde77('0x12'),auth[_0xde77('0xa')](),controller['getImap']);router[_0xde77('0x9')](_0xde77('0x13'),auth[_0xde77('0xa')](),controller[_0xde77('0x14')]);router[_0xde77('0x9')](_0xde77('0x15'),auth[_0xde77('0xa')](),controller['getInteractions']);router[_0xde77('0x9')](_0xde77('0x16'),auth[_0xde77('0xa')](),controller['getApplications']);router[_0xde77('0x9')]('/:id/messages',auth[_0xde77('0xa')](),controller['getMessages']);router[_0xde77('0x9')](_0xde77('0x17'),auth['isAuthenticated'](),controller[_0xde77('0x18')]);router[_0xde77('0x9')](_0xde77('0x19'),auth['isAuthenticated'](),controller[_0xde77('0x1a')]);router[_0xde77('0x1b')](_0xde77('0xf'),auth[_0xde77('0xa')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0xde77('0xa')](),controller[_0xde77('0x1c')]);router['post']('/',auth[_0xde77('0xa')](),controller['create']);router[_0xde77('0x1b')](_0xde77('0x12'),auth['isAuthenticated'](),controller[_0xde77('0x1d')]);router[_0xde77('0x1b')](_0xde77('0x13'),auth[_0xde77('0xa')](),controller[_0xde77('0x1e')]);router['post'](_0xde77('0x15'),auth[_0xde77('0xa')](),controller[_0xde77('0x1f')]);router[_0xde77('0x1b')](_0xde77('0x16'),auth[_0xde77('0xa')](),controller[_0xde77('0x20')]);router['post'](_0xde77('0x21'),auth[_0xde77('0xa')](),controller[_0xde77('0x22')]);router[_0xde77('0x1b')](_0xde77('0x19'),auth[_0xde77('0xa')](),controller[_0xde77('0x23')]);router[_0xde77('0x24')]('/:id',auth['isAuthenticated'](),controller[_0xde77('0x25')]);router['delete'](_0xde77('0xf'),auth[_0xde77('0xa')](),controller[_0xde77('0x26')]);router[_0xde77('0x27')](_0xde77('0x11'),auth['isAuthenticated'](),controller[_0xde77('0x28')]);router[_0xde77('0x27')](_0xde77('0x12'),auth[_0xde77('0xa')](),controller['removeImap']);router[_0xde77('0x27')](_0xde77('0x13'),auth[_0xde77('0xa')](),controller[_0xde77('0x29')]);router[_0xde77('0x27')](_0xde77('0xe'),auth[_0xde77('0xa')](),controller[_0xde77('0x2a')]);router[_0xde77('0x27')](_0xde77('0x19'),auth[_0xde77('0xa')](),controller[_0xde77('0x2b')]);module[_0xde77('0x2c')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index d7498a8..7996360 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 _0x36be=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x36be,0x1ce));var _0xe36b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x36be[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xe36b('0x0'));module[_0xe36b('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe36b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xe36b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xe36b('0x4')]},'markAsUnread':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe36b('0x2')],'allowNull':![],'defaultValue':_0xe36b('0x5')},'fontSize':{'type':Sequelize[_0xe36b('0x6')](0x2)[_0xe36b('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xe36b('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe36b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe36b('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xe36b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xe36b('0x3')],'defaultValue':![],'comment':_0xe36b('0x9'),'set':function(_0x4083cf){if(!_0x4083cf)this['setDataValue'](_0xe36b('0xa'),null);this[_0xe36b('0xb')](_0xe36b('0xc'),_0x4083cf);}}}; \ No newline at end of file +var _0x5af0=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x5af0,0x89));var _0x05af=function(_0x2675da,_0x5a250e){_0x2675da=_0x2675da-0x0;var _0x5e6153=_0x5af0[_0x2675da];return _0x5e6153;};'use strict';var Sequelize=require(_0x05af('0x0'));module['exports']={'description':{'type':Sequelize[_0x05af('0x1')]},'name':{'type':Sequelize[_0x05af('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x05af('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x05af('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x05af('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x05af('0x3')]},'markAsUnread':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x05af('0x4')](0x2)[_0x05af('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x05af('0x3')],'defaultValue':function(){return _0x05af('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x05af('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x05af('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x05af('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x05af('0x2')],'defaultValue':![],'comment':_0x05af('0x8'),'set':function(_0x2e5d86){if(!_0x2e5d86)this[_0x05af('0x9')](_0x05af('0xa'),null);this['setDataValue'](_0x05af('0xb'),_0x2e5d86);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 89f3821..1251fa0 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 _0x18c9=['index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','key','VIRTUAL','options','include','rows','params','includeAll','find','update','body','describe','addDisposition','Disposition','getDispositions','findOne','sort','MailAccountId','findAll','ids','addAnswer','create','CannedAnswer','removeAnswers','email','ListId','active','cservice','cauthentication','user','password','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','User','Owner','fullname','internal','Tag','tag','addApplications','MailApplication','bulkCreate','priority','getApplications','getMessages','MailMessage','$gte','split','format','send','CmList','Contacts','updatedAt','DESC','isNil','from','attachments','root','server/files/attachments','auth','secure','SendMail','sendMail','List\x20not\x20found','List','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','Messages','verifySmtp','Sequelize','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','MailAccounts','stack','name'];(function(_0xc91015,_0x45113e){var _0x35fae5=function(_0x5432b8){while(--_0x5432b8){_0xc91015['push'](_0xc91015['shift']());}};_0x35fae5(++_0x45113e);}(_0x18c9,0x13c));var _0x918c=function(_0x5d8018,_0x588592){_0x5d8018=_0x5d8018-0x0;var _0x151ac4=_0x18c9[_0x5d8018];return _0x151ac4;};'use strict';var pdf=require(_0x918c('0x0'));var emlformat=require(_0x918c('0x1'));var rimraf=require(_0x918c('0x2'));var zipdir=require(_0x918c('0x3'));var jsonpatch=require(_0x918c('0x4'));var rp=require(_0x918c('0x5'));var moment=require('moment');var BPromise=require(_0x918c('0x6'));var Mustache=require(_0x918c('0x7'));var util=require('util');var path=require(_0x918c('0x8'));var sox=require('sox');var csv=require(_0x918c('0x9'));var ejs=require(_0x918c('0xa'));var fs=require('fs');var _=require(_0x918c('0xb'));var squel=require(_0x918c('0xc'));var crypto=require(_0x918c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x918c('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x918c('0xf'));var Redis=require(_0x918c('0x10'));var authService=require(_0x918c('0x11'));var qs=require(_0x918c('0x12'));var hardwareService=require(_0x918c('0x13'));var logger=require(_0x918c('0x14'))(_0x918c('0x15'));var utils=require(_0x918c('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x918c('0x17')]=_[_0x918c('0x18')](config[_0x918c('0x17')],{'host':_0x918c('0x19'),'port':0x18eb});var socket=require(_0x918c('0x1a'))(new Redis(config['redis']));require(_0x918c('0x1b'))[_0x918c('0x1c')](socket);var jayson=require(_0x918c('0x1d'));var client=jayson[_0x918c('0x1e')][_0x918c('0x1f')]({'port':0x232b});function checkPasswordPattern(_0x2e3470,_0x3c68a4,_0x32729f){if(_0x32729f){var _0x38f3b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x38f3b5['test'](_0x3c68a4)){return _0x2e3470;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2e3470;}}function respondWithRpcPromise(_0x50f880,_0x5baa51,_0x4fa363,_0x19d3eb){return new BPromise(function(_0x54f9fa,_0x382775){var _0x1cad82=_0x19d3eb||client;return _0x1cad82[_0x918c('0x20')](_0x50f880,_0x4fa363)['then'](function(_0x4832c3){logger[_0x918c('0x21')](_0x918c('0x22'),_0x5baa51,'request\x20sent');logger[_0x918c('0x23')](_0x918c('0x24'),_0x5baa51,_0x918c('0x25'),JSON[_0x918c('0x26')](_0x4832c3));if(_0x4832c3['error']){if(_0x4832c3[_0x918c('0x27')][_0x918c('0x28')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x5baa51,_0x4832c3[_0x918c('0x27')]['message']);return _0x382775(_0x4832c3['error'][_0x918c('0x29')]);}logger['error'](_0x918c('0x22'),_0x5baa51,_0x4832c3[_0x918c('0x27')]['message']);return _0x54f9fa(_0x4832c3[_0x918c('0x27')][_0x918c('0x29')]);}else{logger[_0x918c('0x21')](_0x918c('0x22'),_0x5baa51,'request\x20sent');_0x54f9fa(_0x4832c3[_0x918c('0x2a')][_0x918c('0x29')]);}})[_0x918c('0x2b')](function(_0x1b7f9c){logger[_0x918c('0x27')](_0x918c('0x22'),_0x5baa51,_0x1b7f9c);_0x382775(_0x1b7f9c);});});}function respondWithStatusCode(_0x4cf95c,_0xed8db9){_0xed8db9=_0xed8db9||0xcc;return function(_0x1f3f9b){if(_0x1f3f9b){return _0x4cf95c[_0x918c('0x2c')](_0xed8db9);}return _0x4cf95c[_0x918c('0x2d')](_0xed8db9)['end']();};}function respondWithResult(_0x194e7e,_0x3b16d0){_0x3b16d0=_0x3b16d0||0xc8;return function(_0x48fa8c){if(_0x48fa8c){return _0x194e7e[_0x918c('0x2d')](_0x3b16d0)[_0x918c('0x2e')](_0x48fa8c);}};}function respondWithFilteredResult(_0x1f4f17,_0x146579){return function(_0x1f1932){if(_0x1f1932){var _0x2a1a7e=_0x1f1932[_0x918c('0x2f')],_0xdf5735=_0x146579['offset'],_0x464341=_0x146579[_0x918c('0x30')]+_0x146579[_0x918c('0x31')],_0x1372a1;if(_0x464341>=_0x2a1a7e){_0x464341=_0x2a1a7e;_0x1372a1=0xc8;}else{_0x1372a1=0xce;}_0x1f4f17['status'](_0x1372a1);return _0x1f4f17['set'](_0x918c('0x32'),_0xdf5735+'-'+_0x464341+'/'+_0x2a1a7e)[_0x918c('0x2e')](_0x1f1932);}return null;};}function patchUpdates(_0x15d5d5){return function(_0x4ba726){try{jsonpatch[_0x918c('0x33')](_0x4ba726,_0x15d5d5,!![]);}catch(_0x551f56){return BPromise[_0x918c('0x34')](_0x551f56);}return _0x4ba726[_0x918c('0x35')]();};}function saveUpdates(_0x838800,_0x2c7693){return function(_0x1476cb){if(_0x1476cb){return _0x1476cb['update'](_0x838800)[_0x918c('0x36')](function(_0x593c0e){return _0x593c0e;});}return null;};}function removeEntity(_0x46555a,_0x132ccd){return function(_0x90222e){if(_0x90222e){return _0x90222e[_0x918c('0x37')]()['then'](function(){var _0x5f4a85=_0x90222e[_0x918c('0x38')]({'plain':!![]});var _0x58deca=_0x918c('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x58deca,'resourceId':_0x5f4a85['id']}})[_0x918c('0x36')](function(){return _0x90222e;});})[_0x918c('0x36')](function(){_0x46555a[_0x918c('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x511fb1,_0x415122){return function(_0x29c3a3){if(!_0x29c3a3){_0x511fb1['sendStatus'](0x194);}return _0x29c3a3;};}function handleError(_0x25ff9c,_0x1f10a3){_0x1f10a3=_0x1f10a3||0x1f4;return function(_0x2e7b53){logger[_0x918c('0x27')](_0x2e7b53[_0x918c('0x3a')]);if(_0x2e7b53['name']){delete _0x2e7b53[_0x918c('0x3b')];}_0x25ff9c[_0x918c('0x2d')](_0x1f10a3)['send'](_0x2e7b53);};}exports[_0x918c('0x3c')]=function(_0x581b93,_0x6b753e){var _0x5fc703={'include':[{'model':db[_0x918c('0x3d')],'as':_0x918c('0x3e')},{'model':db[_0x918c('0x3f')],'as':_0x918c('0x40')},{'model':db[_0x918c('0x41')],'as':_0x918c('0x42')}]},_0x5804ae={},_0x44c224={'count':0x0,'rows':[]};var _0x1df3e6=db[_0x918c('0x43')][_0x918c('0x44')];_0x5804ae['model']=_[_0x918c('0x45')](_0x1df3e6);_0x5804ae[_0x918c('0x46')]=_[_0x918c('0x45')](_0x581b93[_0x918c('0x46')]);_0x5804ae[_0x918c('0x47')]=_['intersection'](_0x5804ae[_0x918c('0x48')],_0x5804ae[_0x918c('0x46')]);_0x5fc703[_0x918c('0x49')]=_[_0x918c('0x4a')](_0x5804ae[_0x918c('0x48')],qs['fields'](_0x581b93[_0x918c('0x46')][_0x918c('0x4b')]));_0x5fc703[_0x918c('0x49')]=_0x5fc703['attributes'][_0x918c('0x4c')]?_0x5fc703['attributes']:_0x5804ae[_0x918c('0x48')];if(!_0x581b93[_0x918c('0x46')][_0x918c('0x4d')](_0x918c('0x4e'))){_0x5fc703['limit']=qs[_0x918c('0x31')](_0x581b93[_0x918c('0x46')][_0x918c('0x31')]);_0x5fc703[_0x918c('0x30')]=qs['offset'](_0x581b93[_0x918c('0x46')][_0x918c('0x30')]);}_0x5fc703[_0x918c('0x4f')]=qs['sort'](_0x581b93[_0x918c('0x46')]['sort']);_0x5fc703[_0x918c('0x50')]=qs[_0x918c('0x47')](_[_0x918c('0x51')](_0x581b93[_0x918c('0x46')],_0x5804ae[_0x918c('0x47')]));if(_0x581b93[_0x918c('0x46')][_0x918c('0x52')]){_0x5fc703[_0x918c('0x50')]=_[_0x918c('0x53')](_0x5fc703['where'],{'$or':_[_0x918c('0x54')](_0x1df3e6,function(_0x8d631f){if(_0x8d631f[_0x918c('0x55')][_0x918c('0x56')]!==_0x918c('0x57')){var _0x4106f2={};_0x4106f2[_0x8d631f['field']]={'$like':'%'+_0x581b93[_0x918c('0x46')]['filter']+'%'};return _0x4106f2;}})});}_0x5fc703=_[_0x918c('0x53')]({},_0x5fc703,_0x581b93[_0x918c('0x58')]);var _0x1450ec={'where':_0x5fc703[_0x918c('0x50')]};return db[_0x918c('0x43')][_0x918c('0x2f')](_0x1450ec)[_0x918c('0x36')](function(_0x23bc40){_0x44c224[_0x918c('0x2f')]=_0x23bc40;if(_0x581b93[_0x918c('0x46')]['includeAll']){_0x5fc703[_0x918c('0x59')]=[{'all':!![]}];}return db[_0x918c('0x43')]['findAll'](_0x5fc703);})[_0x918c('0x36')](function(_0x926a62){_0x44c224[_0x918c('0x5a')]=_0x926a62;return _0x44c224;})[_0x918c('0x36')](respondWithFilteredResult(_0x6b753e,_0x5fc703))[_0x918c('0x2b')](handleError(_0x6b753e,null));};exports['show']=function(_0x4d9c76,_0x23d7f7){var _0x411f34={'raw':![],'where':{'id':_0x4d9c76[_0x918c('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x918c('0x3e')},{'model':db[_0x918c('0x3f')],'as':_0x918c('0x40')},{'model':db[_0x918c('0x41')],'as':'mandatoryDispositionPause'}]},_0xbba721={};_0xbba721[_0x918c('0x48')]=_['keys'](db['MailAccount'][_0x918c('0x44')]);_0xbba721['query']=_[_0x918c('0x45')](_0x4d9c76[_0x918c('0x46')]);_0xbba721['filters']=_['intersection'](_0xbba721[_0x918c('0x48')],_0xbba721['query']);_0x411f34[_0x918c('0x49')]=_['intersection'](_0xbba721[_0x918c('0x48')],qs[_0x918c('0x4b')](_0x4d9c76[_0x918c('0x46')][_0x918c('0x4b')]));_0x411f34['attributes']=_0x411f34[_0x918c('0x49')][_0x918c('0x4c')]?_0x411f34['attributes']:_0xbba721[_0x918c('0x48')];if(_0x4d9c76[_0x918c('0x46')][_0x918c('0x5c')]){_0x411f34[_0x918c('0x59')]=[{'all':!![]}];}_0x411f34=_['merge']({},_0x411f34,_0x4d9c76[_0x918c('0x58')]);return db[_0x918c('0x43')][_0x918c('0x5d')](_0x411f34)[_0x918c('0x36')](handleEntityNotFound(_0x23d7f7,null))[_0x918c('0x36')](respondWithResult(_0x23d7f7,null))[_0x918c('0x2b')](handleError(_0x23d7f7,null));};exports[_0x918c('0x5e')]=function(_0x1d194f,_0x316c33){if(_0x1d194f['body']['id']){delete _0x1d194f[_0x918c('0x5f')]['id'];}return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x1d194f['params']['id']},'include':[{'model':db[_0x918c('0x3d')],'as':_0x918c('0x3e')},{'model':db[_0x918c('0x3f')],'as':_0x918c('0x40')},{'model':db[_0x918c('0x41')],'as':_0x918c('0x42')}]})[_0x918c('0x36')](handleEntityNotFound(_0x316c33,null))['then'](saveUpdates(_0x1d194f[_0x918c('0x5f')],null))['then'](function(_0x50fdda){if(_0x50fdda&&_0x1d194f[_0x918c('0x5f')][_0x918c('0x3e')]){return db[_0x918c('0x3d')]['update'](_0x1d194f[_0x918c('0x5f')][_0x918c('0x3e')],{'where':{'MailAccountId':_0x50fdda['id']}})['then'](function(){return _0x50fdda;});}return _0x50fdda;})[_0x918c('0x36')](function(_0xbfabce){if(_0xbfabce&&_0x1d194f['body'][_0x918c('0x40')]){return db[_0x918c('0x3f')][_0x918c('0x5e')](_0x1d194f[_0x918c('0x5f')]['Smtp'],{'where':{'MailAccountId':_0xbfabce['id']}})[_0x918c('0x36')](function(){return _0xbfabce;});}return _0xbfabce;})[_0x918c('0x36')](respondWithResult(_0x316c33,null))[_0x918c('0x2b')](handleError(_0x316c33,null));};exports[_0x918c('0x60')]=function(_0x39e82d,_0x57aa9c){return db['MailAccount'][_0x918c('0x60')]()['then'](respondWithResult(_0x57aa9c,null))[_0x918c('0x2b')](handleError(_0x57aa9c,null));};exports[_0x918c('0x61')]=function(_0x441820,_0x1111f1,_0x1dae3e){if(_0x441820['body']['id']){delete _0x441820[_0x918c('0x5f')]['id'];}return db['MailAccount'][_0x918c('0x5d')]({'where':{'id':_0x441820[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x1111f1,null))[_0x918c('0x36')](function(_0x3b8a1b){if(_0x3b8a1b){_0x441820['body']['MailAccountId']=_0x3b8a1b['id'];return db[_0x918c('0x62')]['create'](_0x441820[_0x918c('0x5f')]);}})['then'](respondWithResult(_0x1111f1,null))[_0x918c('0x2b')](handleError(_0x1111f1,null));};exports[_0x918c('0x63')]=function(_0x2a7400,_0xb0eec2,_0x6b7f49){var _0x1a2c39={'raw':![],'where':{}};var _0x39ae1e={};var _0xc69656={'count':0x0,'rows':[]};return db[_0x918c('0x43')][_0x918c('0x64')]({'where':{'id':_0x2a7400[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0xb0eec2,null))['then'](function(_0x489d56){if(_0x489d56){_0x39ae1e[_0x918c('0x48')]=_[_0x918c('0x45')](db[_0x918c('0x62')]['rawAttributes']);_0x39ae1e[_0x918c('0x46')]=_[_0x918c('0x45')](_0x2a7400[_0x918c('0x46')]);_0x39ae1e[_0x918c('0x47')]=_[_0x918c('0x4a')](_0x39ae1e[_0x918c('0x48')],_0x39ae1e[_0x918c('0x46')]);_0x1a2c39['attributes']=_[_0x918c('0x4a')](_0x39ae1e[_0x918c('0x48')],qs[_0x918c('0x4b')](_0x2a7400['query'][_0x918c('0x4b')]));_0x1a2c39[_0x918c('0x49')]=_0x1a2c39[_0x918c('0x49')][_0x918c('0x4c')]?_0x1a2c39['attributes']:_0x39ae1e['model'];if(!_0x2a7400[_0x918c('0x46')][_0x918c('0x4d')]('nolimit')){_0x1a2c39['limit']=qs['limit'](_0x2a7400[_0x918c('0x46')][_0x918c('0x31')]);_0x1a2c39['offset']=qs[_0x918c('0x30')](_0x2a7400[_0x918c('0x46')][_0x918c('0x30')]);}_0x1a2c39[_0x918c('0x4f')]=qs[_0x918c('0x65')](_0x2a7400[_0x918c('0x46')]['sort']);_0x1a2c39[_0x918c('0x50')]=qs['filters'](_['pick'](_0x2a7400[_0x918c('0x46')],_0x39ae1e[_0x918c('0x47')]));_0x1a2c39['where'][_0x918c('0x66')]=_0x489d56['id'];if(_0x2a7400['query'][_0x918c('0x52')]){_0x1a2c39[_0x918c('0x50')]=_[_0x918c('0x53')](_0x1a2c39[_0x918c('0x50')],{'$or':_[_0x918c('0x54')](_0x1a2c39[_0x918c('0x49')],function(_0x2c5858){var _0x525f07={};_0x525f07[_0x2c5858]={'$like':'%'+_0x2a7400[_0x918c('0x46')][_0x918c('0x52')]+'%'};return _0x525f07;})});}_0x1a2c39=_[_0x918c('0x53')]({},_0x1a2c39,_0x2a7400[_0x918c('0x58')]);return db[_0x918c('0x62')][_0x918c('0x2f')]({'where':_0x1a2c39[_0x918c('0x50')]})[_0x918c('0x36')](function(_0x52c5e4){_0xc69656[_0x918c('0x2f')]=_0x52c5e4;if(_0x2a7400[_0x918c('0x46')][_0x918c('0x5c')]){_0x1a2c39[_0x918c('0x59')]=[{'all':!![]}];}return db[_0x918c('0x62')][_0x918c('0x67')](_0x1a2c39);})['then'](function(_0x24fd42){_0xc69656[_0x918c('0x5a')]=_0x24fd42;return _0xc69656;});}})[_0x918c('0x36')](respondWithFilteredResult(_0xb0eec2,_0x1a2c39))[_0x918c('0x2b')](handleError(_0xb0eec2,null));};exports['removeDispositions']=function(_0x467b41,_0x358e4a,_0x3ca6bd){return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x467b41[_0x918c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x358e4a,null))['then'](function(_0x3fb26b){if(_0x3fb26b){return _0x3fb26b['removeDispositions'](_0x467b41[_0x918c('0x46')][_0x918c('0x68')]);}})[_0x918c('0x36')](respondWithStatusCode(_0x358e4a,null))['catch'](handleError(_0x358e4a,null));};exports[_0x918c('0x69')]=function(_0x76ba6d,_0x65fae8,_0x57317e){if(_0x76ba6d[_0x918c('0x5f')]['id']){delete _0x76ba6d[_0x918c('0x5f')]['id'];}return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x76ba6d[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x65fae8,null))['then'](function(_0x116dc7){if(_0x116dc7){_0x76ba6d['body'][_0x918c('0x66')]=_0x116dc7['id'];return db['CannedAnswer'][_0x918c('0x6a')](_0x76ba6d[_0x918c('0x5f')]);}})[_0x918c('0x36')](respondWithResult(_0x65fae8,null))['catch'](handleError(_0x65fae8,null));};exports['getAnswers']=function(_0xe4d8d7,_0x3d3d7e,_0x5f3de9){var _0x565718={'raw':![],'where':{}};var _0x3d71ed={};var _0x1c6fe7={'count':0x0,'rows':[]};return db[_0x918c('0x43')][_0x918c('0x64')]({'where':{'id':_0xe4d8d7['params']['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x3d3d7e,null))[_0x918c('0x36')](function(_0x3d09a2){if(_0x3d09a2){_0x3d71ed[_0x918c('0x48')]=_[_0x918c('0x45')](db['CannedAnswer'][_0x918c('0x44')]);_0x3d71ed['query']=_[_0x918c('0x45')](_0xe4d8d7[_0x918c('0x46')]);_0x3d71ed[_0x918c('0x47')]=_['intersection'](_0x3d71ed['model'],_0x3d71ed[_0x918c('0x46')]);_0x565718[_0x918c('0x49')]=_[_0x918c('0x4a')](_0x3d71ed['model'],qs[_0x918c('0x4b')](_0xe4d8d7[_0x918c('0x46')][_0x918c('0x4b')]));_0x565718[_0x918c('0x49')]=_0x565718[_0x918c('0x49')][_0x918c('0x4c')]?_0x565718['attributes']:_0x3d71ed['model'];if(!_0xe4d8d7[_0x918c('0x46')]['hasOwnProperty'](_0x918c('0x4e'))){_0x565718[_0x918c('0x31')]=qs['limit'](_0xe4d8d7[_0x918c('0x46')][_0x918c('0x31')]);_0x565718[_0x918c('0x30')]=qs[_0x918c('0x30')](_0xe4d8d7[_0x918c('0x46')][_0x918c('0x30')]);}_0x565718[_0x918c('0x4f')]=qs['sort'](_0xe4d8d7[_0x918c('0x46')][_0x918c('0x65')]);_0x565718[_0x918c('0x50')]=qs[_0x918c('0x47')](_[_0x918c('0x51')](_0xe4d8d7[_0x918c('0x46')],_0x3d71ed[_0x918c('0x47')]));_0x565718[_0x918c('0x50')][_0x918c('0x66')]=_0x3d09a2['id'];if(_0xe4d8d7[_0x918c('0x46')][_0x918c('0x52')]){_0x565718['where']=_[_0x918c('0x53')](_0x565718[_0x918c('0x50')],{'$or':_['map'](_0x565718[_0x918c('0x49')],function(_0xe79b42){var _0x5bb39d={};_0x5bb39d[_0xe79b42]={'$like':'%'+_0xe4d8d7[_0x918c('0x46')][_0x918c('0x52')]+'%'};return _0x5bb39d;})});}_0x565718=_[_0x918c('0x53')]({},_0x565718,_0xe4d8d7['options']);return db[_0x918c('0x6b')]['count']({'where':_0x565718['where']})['then'](function(_0x1fe341){_0x1c6fe7[_0x918c('0x2f')]=_0x1fe341;if(_0xe4d8d7[_0x918c('0x46')]['includeAll']){_0x565718['include']=[{'all':!![]}];}return db[_0x918c('0x6b')][_0x918c('0x67')](_0x565718);})[_0x918c('0x36')](function(_0xe63be0){_0x1c6fe7[_0x918c('0x5a')]=_0xe63be0;return _0x1c6fe7;});}})[_0x918c('0x36')](respondWithFilteredResult(_0x3d3d7e,_0x565718))[_0x918c('0x2b')](handleError(_0x3d3d7e,null));};exports[_0x918c('0x6c')]=function(_0x3b7b9d,_0x20185f,_0x1ee496){return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x3b7b9d[_0x918c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x20185f,null))[_0x918c('0x36')](function(_0x49e9ae){if(_0x49e9ae){return _0x49e9ae[_0x918c('0x6c')](_0x3b7b9d[_0x918c('0x46')][_0x918c('0x68')]);}})[_0x918c('0x36')](respondWithStatusCode(_0x20185f,null))[_0x918c('0x2b')](handleError(_0x20185f,null));};exports[_0x918c('0x6a')]=function(_0x43a9ec,_0x1c86fd){var _0x572eab={'name':_0x43a9ec[_0x918c('0x5f')][_0x918c('0x3b')],'key':_0x43a9ec['body']['key'],'email':_0x43a9ec['body'][_0x918c('0x6d')],'ListId':_0x43a9ec[_0x918c('0x5f')][_0x918c('0x6e')],'active':!_['isNil'](_0x43a9ec['body'][_0x918c('0x6f')])?_0x43a9ec[_0x918c('0x5f')][_0x918c('0x6f')]:!![],'description':_0x43a9ec[_0x918c('0x5f')]['description']||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x43a9ec['body'][_0x918c('0x70')])){if(_0x43a9ec[_0x918c('0x5f')][_0x918c('0x71')]){_0x572eab['Imap'][_0x918c('0x72')]=_0x572eab[_0x918c('0x40')]['user']=_0x43a9ec[_0x918c('0x5f')]['cuser'];_0x572eab[_0x918c('0x3e')][_0x918c('0x73')]=_0x572eab[_0x918c('0x40')][_0x918c('0x74')]=_0x43a9ec[_0x918c('0x5f')][_0x918c('0x75')];}else{_0x572eab[_0x918c('0x3e')][_0x918c('0x76')]=_0x572eab['Smtp'][_0x918c('0x76')]=![];}_0x572eab[_0x918c('0x3e')][_0x918c('0x77')]=_0x43a9ec[_0x918c('0x5f')][_0x918c('0x3e')][_0x918c('0x77')];_0x572eab[_0x918c('0x3e')][_0x918c('0x78')]=_0x43a9ec[_0x918c('0x5f')][_0x918c('0x3e')]['port'];_0x572eab[_0x918c('0x40')][_0x918c('0x77')]=_0x43a9ec['body']['Smtp'][_0x918c('0x77')];_0x572eab['Smtp'][_0x918c('0x78')]=_0x43a9ec[_0x918c('0x5f')][_0x918c('0x40')][_0x918c('0x78')];}else{_0x572eab[_0x918c('0x3e')]['service']=_0x572eab[_0x918c('0x40')][_0x918c('0x79')]=_0x43a9ec['body'][_0x918c('0x70')];_0x572eab[_0x918c('0x3e')]['user']=_0x572eab[_0x918c('0x40')][_0x918c('0x72')]=_0x43a9ec[_0x918c('0x5f')][_0x918c('0x7a')];_0x572eab[_0x918c('0x3e')][_0x918c('0x73')]=_0x572eab['Smtp']['pass']=_0x43a9ec[_0x918c('0x5f')][_0x918c('0x75')];}return db[_0x918c('0x43')][_0x918c('0x6a')](_0x572eab,{'include':[{'model':db[_0x918c('0x3f')],'as':_0x918c('0x40')},{'model':db[_0x918c('0x3d')],'as':_0x918c('0x3e')}]})[_0x918c('0x36')](function(_0xcadbcb){var _0x1cd768=_0x43a9ec[_0x918c('0x72')]['get']({'plain':!![]});if(!_0x1cd768)throw new Error(_0x918c('0x7b'));if(_0x1cd768[_0x918c('0x7c')]===_0x918c('0x72')){var _0x18d888=_0xcadbcb[_0x918c('0x38')]({'plain':!![]});return db['UserProfileSection'][_0x918c('0x5d')]({'where':{'name':_0x918c('0x39'),'userProfileId':_0x1cd768['userProfileId']},'raw':!![]})['then'](function(_0x1964f8){if(_0x1964f8&&_0x1964f8[_0x918c('0x7d')]===0x0){return db[_0x918c('0x7e')]['create']({'name':_0x18d888[_0x918c('0x3b')],'resourceId':_0x18d888['id'],'type':_0x1964f8['name'],'sectionId':_0x1964f8['id']},{})[_0x918c('0x36')](function(){return _0xcadbcb;});}else{return _0xcadbcb;}})[_0x918c('0x2b')](function(_0x2ecb91){logger[_0x918c('0x27')](_0x918c('0x7f'),_0x2ecb91);throw _0x2ecb91;});}return _0xcadbcb;})['then'](respondWithResult(_0x1c86fd,0xc9))[_0x918c('0x2b')](handleError(_0x1c86fd,null));};exports['getImap']=function(_0x636b81,_0x2e01e6,_0x268fec){return db[_0x918c('0x43')][_0x918c('0x64')]({'where':{'id':_0x636b81[_0x918c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2e01e6,null))[_0x918c('0x36')](function(_0x13ffb8){if(_0x13ffb8){return _0x13ffb8[_0x918c('0x80')]();}return null;})[_0x918c('0x36')](respondWithResult(_0x2e01e6,null))[_0x918c('0x2b')](handleError(_0x2e01e6,null));};exports['addImap']=function(_0x447898,_0x24e79d,_0x3d7202){if(_0x447898['body']['id']){delete _0x447898[_0x918c('0x5f')]['id'];}return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x447898[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x24e79d,null))[_0x918c('0x36')](function(_0x4e0885){if(_0x4e0885){_0x447898[_0x918c('0x5f')][_0x918c('0x66')]=_0x4e0885['id'];return db[_0x918c('0x3d')][_0x918c('0x6a')](_0x447898[_0x918c('0x5f')]);}})[_0x918c('0x36')](respondWithResult(_0x24e79d,null))[_0x918c('0x2b')](handleError(_0x24e79d,null));};exports[_0x918c('0x81')]=function(_0x7dd4d0,_0x4882d4,_0x3755ae){return db[_0x918c('0x43')]['findOne']({'where':{'id':_0x7dd4d0[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x4882d4,null))[_0x918c('0x36')](function(_0x3422a5){if(_0x3422a5){return _0x3422a5[_0x918c('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x4882d4,null))['catch'](handleError(_0x4882d4,null));};exports[_0x918c('0x83')]=function(_0x3889c3,_0x5e00eb,_0x16a07b){return db[_0x918c('0x43')][_0x918c('0x64')]({'where':{'id':_0x3889c3[_0x918c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5e00eb,null))[_0x918c('0x36')](function(_0x602d87){if(_0x602d87){return _0x602d87[_0x918c('0x83')]();}return null;})['then'](respondWithResult(_0x5e00eb,null))[_0x918c('0x2b')](handleError(_0x5e00eb,null));};exports[_0x918c('0x84')]=function(_0x1cd58b,_0x338e44,_0x54a424){if(_0x1cd58b['body']['id']){delete _0x1cd58b['body']['id'];}return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x1cd58b[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x338e44,null))[_0x918c('0x36')](function(_0x565c4c){if(_0x565c4c){_0x1cd58b[_0x918c('0x5f')][_0x918c('0x66')]=_0x565c4c['id'];return db['MailServerOut'][_0x918c('0x6a')](_0x1cd58b['body']);}})[_0x918c('0x36')](respondWithResult(_0x338e44,null))[_0x918c('0x2b')](handleError(_0x338e44,null));};exports[_0x918c('0x85')]=function(_0x503aad,_0x23a8b7,_0x21b926){return db[_0x918c('0x43')]['findOne']({'where':{'id':_0x503aad['params']['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x23a8b7,null))[_0x918c('0x36')](function(_0x4e2ef8){if(_0x4e2ef8){return _0x4e2ef8[_0x918c('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x23a8b7,null))[_0x918c('0x2b')](handleError(_0x23a8b7,null));};exports[_0x918c('0x87')]=function(_0x5e293c,_0x41e2a8,_0x47b44a){return db['MailInteraction'][_0x918c('0x5d')]({'where':{'id':_0x5e293c['params']['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x41e2a8,null))[_0x918c('0x36')](function(_0x3f854b){if(_0x3f854b){return _0x3f854b[_0x918c('0x87')](_0x5e293c['body']['ids'],_[_0x918c('0x88')](_0x5e293c[_0x918c('0x5f')],[_0x918c('0x68'),'id'])||{});}})[_0x918c('0x36')](respondWithResult(_0x41e2a8,null))[_0x918c('0x2b')](handleError(_0x41e2a8,null));};exports[_0x918c('0x89')]=function(_0x312a64,_0x44a783,_0x3b6adb){var _0x197218={'raw':![],'where':{}};var _0x2e7f13={};var _0x476e77={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x312a64[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x44a783,null))[_0x918c('0x36')](function(_0x368365){if(_0x368365){_0x2e7f13['model']=_[_0x918c('0x45')](db[_0x918c('0x8a')][_0x918c('0x44')]);_0x2e7f13[_0x918c('0x46')]=_[_0x918c('0x45')](_0x312a64[_0x918c('0x46')]);_0x2e7f13[_0x918c('0x47')]=_[_0x918c('0x4a')](_0x2e7f13[_0x918c('0x48')],_0x2e7f13[_0x918c('0x46')]);_0x197218['attributes']=_['intersection'](_0x2e7f13[_0x918c('0x48')],qs[_0x918c('0x4b')](_0x312a64[_0x918c('0x46')][_0x918c('0x4b')]));_0x197218[_0x918c('0x49')]=_0x197218[_0x918c('0x49')][_0x918c('0x4c')]?_0x197218[_0x918c('0x49')]:_0x2e7f13[_0x918c('0x48')];if(!_0x312a64[_0x918c('0x46')][_0x918c('0x4d')]('nolimit')){_0x197218[_0x918c('0x31')]=qs[_0x918c('0x31')](_0x312a64[_0x918c('0x46')]['limit']);_0x197218[_0x918c('0x30')]=qs['offset'](_0x312a64[_0x918c('0x46')][_0x918c('0x30')]);}_0x197218[_0x918c('0x4f')]=qs[_0x918c('0x65')](_0x312a64[_0x918c('0x46')]['sort']);_0x197218['where']=qs[_0x918c('0x47')](_[_0x918c('0x51')](_0x312a64['query'],_0x2e7f13['filters']));_0x197218[_0x918c('0x50')]['MailAccountId']=_0x368365['id'];if(_0x312a64[_0x918c('0x46')][_0x918c('0x52')]){_0x197218['where']=_[_0x918c('0x53')](_0x197218[_0x918c('0x50')],{'$or':_[_0x918c('0x54')](_0x197218[_0x918c('0x49')],function(_0x4d3d65){var _0xad0380={};_0xad0380[_0x4d3d65]={'$like':'%'+_0x312a64[_0x918c('0x46')][_0x918c('0x52')]+'%'};return _0xad0380;})});}_0x197218=_[_0x918c('0x53')]({},_0x197218,_0x312a64[_0x918c('0x58')]);return db[_0x918c('0x8a')]['count']({'where':_0x197218[_0x918c('0x50')]})[_0x918c('0x36')](function(_0x33952b){_0x476e77[_0x918c('0x2f')]=_0x33952b;if(_0x312a64[_0x918c('0x46')][_0x918c('0x5c')]){_0x197218[_0x918c('0x59')]=[{'model':db[_0x918c('0x8b')],'as':'Contact','required':![]},{'model':db[_0x918c('0x8c')],'as':_0x918c('0x8d'),'attributes':['name',_0x918c('0x8e'),_0x918c('0x8f')],'required':![]},{'model':db[_0x918c('0x90')],'as':'Tags','attributes':['id','name','color'],'where':_0x312a64[_0x918c('0x46')]['tag']?{'id':_0x312a64[_0x918c('0x46')][_0x918c('0x91')]}:undefined,'required':_0x312a64[_0x918c('0x46')][_0x918c('0x91')]?!![]:![]}];}return db[_0x918c('0x8a')]['findAll'](_0x197218);})[_0x918c('0x36')](function(_0x522294){_0x476e77[_0x918c('0x5a')]=_0x522294;return _0x476e77;});}})[_0x918c('0x36')](respondWithFilteredResult(_0x44a783,_0x197218))[_0x918c('0x2b')](handleError(_0x44a783,null));};exports[_0x918c('0x92')]=function(_0x1e6248,_0x1bcb37,_0xd155d5){return db['MailAccount'][_0x918c('0x64')]({'where':{'id':_0x1e6248[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x1bcb37,null))[_0x918c('0x36')](function(_0x204407){if(_0x204407){return db['sequelize']['transaction'](function(_0x597aa8){return db[_0x918c('0x93')]['destroy']({'where':{'MailAccountId':_0x1e6248[_0x918c('0x5b')]['id']},'transaction':_0x597aa8})[_0x918c('0x36')](function(_0x48f358){var _0x56e830=_['map'](_0x1e6248[_0x918c('0x5f')],function(_0x5892c0){_0x5892c0[_0x918c('0x66')]=_0x1e6248[_0x918c('0x5b')]['id'];return _0x5892c0;});return db['MailApplication'][_0x918c('0x94')](_0x56e830,{'transaction':_0x597aa8});});})[_0x918c('0x36')](function(){return db[_0x918c('0x93')]['findAndCountAll']({'where':{'MailAccountId':_0x1e6248[_0x918c('0x5b')]['id']},'order':_0x918c('0x95')});});}})[_0x918c('0x36')](respondWithResult(_0x1bcb37,null))[_0x918c('0x2b')](handleError(_0x1bcb37,null));};exports['getApplications']=function(_0x4d4271,_0x221c27,_0x30304a){var _0x7359ec={};var _0x3b1ecb={};var _0x5f08a7;var _0x5196a2;return db[_0x918c('0x43')][_0x918c('0x64')]({'where':{'id':_0x4d4271[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x221c27,null))[_0x918c('0x36')](function(_0x2c73d9){if(_0x2c73d9){_0x5f08a7=_0x2c73d9;_0x3b1ecb[_0x918c('0x48')]=_[_0x918c('0x45')](db[_0x918c('0x93')][_0x918c('0x44')]);_0x3b1ecb[_0x918c('0x46')]=_[_0x918c('0x45')](_0x4d4271[_0x918c('0x46')]);_0x3b1ecb[_0x918c('0x47')]=_[_0x918c('0x4a')](_0x3b1ecb[_0x918c('0x48')],_0x3b1ecb[_0x918c('0x46')]);_0x7359ec['attributes']=_['intersection'](_0x3b1ecb[_0x918c('0x48')],qs['fields'](_0x4d4271['query'][_0x918c('0x4b')]));_0x7359ec['attributes']=_0x7359ec[_0x918c('0x49')][_0x918c('0x4c')]?_0x7359ec[_0x918c('0x49')]:_0x3b1ecb['model'];_0x7359ec['order']=qs[_0x918c('0x65')](_0x4d4271['query'][_0x918c('0x65')]);_0x7359ec['where']=qs[_0x918c('0x47')](_[_0x918c('0x51')](_0x4d4271[_0x918c('0x46')],_0x3b1ecb[_0x918c('0x47')]));if(_0x4d4271[_0x918c('0x46')][_0x918c('0x52')]){_0x7359ec[_0x918c('0x50')]=_['merge'](_0x7359ec['where'],{'$or':_[_0x918c('0x54')](_0x7359ec[_0x918c('0x49')],function(_0x49756b){var _0x54393b={};_0x54393b[_0x49756b]={'$like':'%'+_0x4d4271[_0x918c('0x46')]['filter']+'%'};return _0x54393b;})});}_0x7359ec=_[_0x918c('0x53')]({},_0x7359ec,_0x4d4271['options']);return _0x5f08a7[_0x918c('0x96')](_0x7359ec);}})['then'](function(_0x1eac6e){if(_0x1eac6e){_0x5196a2=_0x1eac6e[_0x918c('0x4c')];if(!_0x4d4271[_0x918c('0x46')][_0x918c('0x4d')](_0x918c('0x4e'))){_0x7359ec[_0x918c('0x31')]=qs['limit'](_0x4d4271[_0x918c('0x46')][_0x918c('0x31')]);_0x7359ec[_0x918c('0x30')]=qs[_0x918c('0x30')](_0x4d4271[_0x918c('0x46')]['offset']);}return _0x5f08a7[_0x918c('0x96')](_0x7359ec);}})[_0x918c('0x36')](function(_0x44cd9b){if(_0x44cd9b){return _0x44cd9b?{'count':_0x5196a2,'rows':_0x44cd9b}:null;}})[_0x918c('0x36')](respondWithResult(_0x221c27,null))[_0x918c('0x2b')](handleError(_0x221c27,null));};exports[_0x918c('0x97')]=function(_0x145ea9,_0x48615c,_0x30a0ab){var _0xe7db6c={'raw':!![],'where':{}};var _0x5917d3={};var _0x49feb4={'count':0x0,'rows':[]};return db[_0x918c('0x43')]['findOne']({'where':{'id':_0x145ea9[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x48615c,null))[_0x918c('0x36')](function(_0x599423){if(_0x599423){_0x5917d3[_0x918c('0x48')]=_['keys'](db[_0x918c('0x98')][_0x918c('0x44')]);_0x5917d3[_0x918c('0x46')]=_[_0x918c('0x45')](_0x145ea9[_0x918c('0x46')]);_0x5917d3['filters']=_[_0x918c('0x4a')](_0x5917d3[_0x918c('0x48')],_0x5917d3[_0x918c('0x46')]);_0xe7db6c[_0x918c('0x49')]=_[_0x918c('0x4a')](_0x5917d3[_0x918c('0x48')],qs[_0x918c('0x4b')](_0x145ea9[_0x918c('0x46')][_0x918c('0x4b')]));_0xe7db6c[_0x918c('0x49')]=_0xe7db6c[_0x918c('0x49')][_0x918c('0x4c')]?_0xe7db6c[_0x918c('0x49')]:_0x5917d3[_0x918c('0x48')];if(!_0x145ea9['query'][_0x918c('0x4d')]('nolimit')){_0xe7db6c[_0x918c('0x31')]=qs[_0x918c('0x31')](_0x145ea9[_0x918c('0x46')][_0x918c('0x31')]);_0xe7db6c[_0x918c('0x30')]=qs[_0x918c('0x30')](_0x145ea9[_0x918c('0x46')][_0x918c('0x30')]);}_0xe7db6c[_0x918c('0x4f')]=qs[_0x918c('0x65')](_0x145ea9['query'][_0x918c('0x65')]);_0xe7db6c[_0x918c('0x50')]=qs['filters'](_[_0x918c('0x51')](_0x145ea9['query'],_0x5917d3[_0x918c('0x47')]));_0xe7db6c['where'][_0x918c('0x66')]=_0x599423['id'];if(_0x145ea9[_0x918c('0x46')][_0x918c('0x52')]){_0xe7db6c['where']=_[_0x918c('0x53')](_0xe7db6c[_0x918c('0x50')],{'$or':_['map'](_0xe7db6c[_0x918c('0x49')],function(_0x117538){var _0x565992={};_0x565992[_0x117538]={'$like':'%'+_0x145ea9[_0x918c('0x46')][_0x918c('0x52')]+'%'};return _0x565992;})});}if(_0x145ea9[_0x918c('0x46')][_0x918c('0x99')]){var _0x2fdf36=_0x145ea9[_0x918c('0x46')][_0x918c('0x99')][_0x918c('0x9a')](',');var _0x51595a={};_0x51595a[_0x2fdf36[0x0]]={'$gte':moment(_0x2fdf36[0x1])[_0x918c('0x9b')]('YYYY-MM-DD\x20HH:mm:ss')};_0xe7db6c[_0x918c('0x50')]=_[_0x918c('0x53')](_0xe7db6c[_0x918c('0x50')],_0x51595a);}_0xe7db6c=_[_0x918c('0x53')]({},_0xe7db6c,_0x145ea9[_0x918c('0x58')]);return db['MailMessage'][_0x918c('0x2f')]({'where':_0xe7db6c[_0x918c('0x50')]})[_0x918c('0x36')](function(_0x46ab61){_0x49feb4['count']=_0x46ab61;if(_0x145ea9['query'][_0x918c('0x5c')]){_0xe7db6c[_0x918c('0x59')]=[{'all':!![]}];}return db[_0x918c('0x98')][_0x918c('0x67')](_0xe7db6c);})[_0x918c('0x36')](function(_0x2ed796){_0x49feb4[_0x918c('0x5a')]=_0x2ed796;return _0x49feb4;});}})['then'](respondWithFilteredResult(_0x48615c,_0xe7db6c))[_0x918c('0x2b')](handleError(_0x48615c,null));};exports[_0x918c('0x9c')]=function(_0x14654f,_0x1d837f,_0x19bb7a){var _0x3c5ab9,_0x742d0e={},_0x2233d3;if(_0x14654f[_0x918c('0x5f')]['to']){_0x2233d3=_0x14654f[_0x918c('0x5f')]['to']['split'](',')[0x0];}return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x14654f['params']['id']},'include':[{'model':db[_0x918c('0x9d')],'as':'List','include':[{'model':db[_0x918c('0x8b')],'as':_0x918c('0x9e'),'where':{'email':_0x2233d3},'limit':0x1,'order':[[_0x918c('0x9f'),_0x918c('0xa0')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x1d837f,null))[_0x918c('0x36')](function(_0x1fe7f3){if(_0x1fe7f3){_0x3c5ab9=_0x1fe7f3;if(_0x1fe7f3['Smtp']){if(_[_0x918c('0xa1')](_0x14654f[_0x918c('0x5f')]['from'])){_0x14654f[_0x918c('0x5f')][_0x918c('0xa2')]=util[_0x918c('0x9b')]('%s\x20<%s>',_0x1fe7f3['name'],_0x1fe7f3[_0x918c('0x6d')]||_0x1fe7f3[_0x918c('0x40')]['user']);}if(_0x14654f[_0x918c('0x5f')][_0x918c('0xa3')]&&_0x14654f[_0x918c('0x5f')][_0x918c('0xa3')]['length']){for(var _0x355474=0x0;_0x355474<_0x14654f[_0x918c('0x5f')][_0x918c('0xa3')][_0x918c('0x4c')];_0x355474+=0x1){_0x14654f[_0x918c('0x5f')][_0x918c('0xa3')][_0x355474]={'filename':_0x14654f[_0x918c('0x5f')]['attachments'][_0x355474][_0x918c('0x3b')],'path':path['join'](config[_0x918c('0xa4')],_0x918c('0xa5'),_0x14654f[_0x918c('0x5f')][_0x918c('0xa3')][_0x355474]['basename'])};}}var _0x5d6014={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1fe7f3[_0x918c('0x40')]['service'])){if(_0x1fe7f3[_0x918c('0x40')][_0x918c('0x76')]){_0x5d6014[_0x918c('0xa6')]={'user':_0x1fe7f3[_0x918c('0x40')][_0x918c('0x72')],'pass':_0x1fe7f3[_0x918c('0x40')]['pass']};}_0x5d6014[_0x918c('0x77')]=_0x1fe7f3[_0x918c('0x40')][_0x918c('0x77')];_0x5d6014[_0x918c('0x78')]=_0x1fe7f3[_0x918c('0x40')][_0x918c('0x78')];_0x5d6014[_0x918c('0xa7')]=_0x1fe7f3['Smtp'][_0x918c('0xa7')];}else{_0x5d6014[_0x918c('0x79')]=_0x1fe7f3[_0x918c('0x40')][_0x918c('0x79')];_0x5d6014['auth']={'user':_0x1fe7f3[_0x918c('0x40')][_0x918c('0x72')],'pass':_0x1fe7f3['Smtp']['pass']};}return respondWithRpcPromise(_0x918c('0xa8'),_0x918c('0xa9'),{'account':_0x5d6014,'message':_0x14654f['body']});}else{throw new Error(_0x918c('0xaa'));}}})[_0x918c('0x36')](function(_0x1afc2f){if(_0x1afc2f){_0x742d0e=_0x1afc2f;if(_0x3c5ab9[_0x918c('0xab')]){if(_0x3c5ab9[_0x918c('0xab')]['Contacts'][_0x918c('0x4c')]){return _0x3c5ab9[_0x918c('0xab')]['Contacts'][0x0];}else{return db[_0x918c('0x8b')]['create'](_[_0x918c('0x18')](_0x14654f['body'],{'firstName':_0x14654f['body']['to'],'email':_0x14654f[_0x918c('0x5f')]['to'],'phone':_0x14654f[_0x918c('0x5f')]['to'],'ListId':_0x3c5ab9[_0x918c('0x6e')]}));}}else{throw new Error(_0x918c('0xaa'));}}})[_0x918c('0x36')](function(_0xfeb4a6){if(_0xfeb4a6){var _0x302c16={'UserId':_0x14654f[_0x918c('0x72')]['id'],'ContactId':_0xfeb4a6['id'],'MailAccountId':_0x3c5ab9['id'],'inReplyTo':_0x742d0e['messageId'],'to':_0x14654f[_0x918c('0x5f')]['from'],'cc':_0x14654f[_0x918c('0x5f')]['cc'],'subject':_0x14654f['body'][_0x918c('0xac')],'attach':_0x14654f[_0x918c('0x5f')][_0x918c('0xad')],'firstMsgDirection':_0x918c('0xae'),'lastMsgAt':moment()[_0x918c('0x9b')](_0x918c('0xaf')),'lastMsgDirection':_0x918c('0xae'),'lastMsgBody':_0x14654f[_0x918c('0x5f')]['body'],'Messages':[_[_0x918c('0x53')](_0x14654f[_0x918c('0x5f')],{'messageId':_0x742d0e[_0x918c('0xb0')],'sentAt':moment()[_0x918c('0x9b')](_0x918c('0xaf')),'read':!![],'MailAccountId':_0x3c5ab9['id'],'UserId':_0x14654f[_0x918c('0x72')]['id'],'ContactId':_0xfeb4a6['id']})]};if(_0x14654f['body']['Interaction']){_0x302c16=_[_0x918c('0x53')](_0x302c16,_0x14654f[_0x918c('0x5f')][_0x918c('0xb1')]);}return db['MailInteraction'][_0x918c('0x6a')](_0x302c16,{'include':[{'model':db[_0x918c('0x98')],'as':_0x918c('0xb2')}]});}})[_0x918c('0x36')](respondWithResult(_0x1d837f,null))[_0x918c('0x2b')](handleError(_0x1d837f,null));};exports[_0x918c('0xb3')]=function(_0x8559aa,_0x11de0c,_0x5d6aee){return db['MailAccount'][_0x918c('0x5d')]({'where':{'id':_0x8559aa[_0x918c('0x5b')]['id']},'include':[{'model':db[_0x918c('0x3f')],'as':'Smtp','raw':!![]}]})[_0x918c('0x36')](handleEntityNotFound(_0x11de0c,null))['then'](function(_0x3d4edf){if(_0x3d4edf&&_0x3d4edf[_0x918c('0x40')]){var _0x2332d4={'id':_0x3d4edf['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3d4edf['Smtp']['service']){_0x2332d4[_0x918c('0x79')]=_0x3d4edf[_0x918c('0x40')][_0x918c('0x79')];}else{_0x2332d4[_0x918c('0x77')]=_0x3d4edf[_0x918c('0x40')][_0x918c('0x77')];_0x2332d4[_0x918c('0x78')]=_0x3d4edf[_0x918c('0x40')]['port'];_0x2332d4['secure']=_0x3d4edf[_0x918c('0x40')]['secure'];}if(_0x3d4edf[_0x918c('0x40')][_0x918c('0x76')]){_0x2332d4['auth']={'user':_0x3d4edf[_0x918c('0x40')][_0x918c('0x72')],'pass':_0x3d4edf['Smtp']['pass']};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x2332d4});}})[_0x918c('0x36')](respondWithResult(_0x11de0c,null))[_0x918c('0x2b')](handleError(_0x11de0c,null));};exports[_0x918c('0x37')]=function(_0x451523,_0x2ce2ba){return db['MailAccount'][_0x918c('0x5d')]({'where':{'id':_0x451523[_0x918c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2ce2ba,null))[_0x918c('0x36')](function(_0x2a996b){if(_0x2a996b&&_0x2a996b[_0x918c('0x79')]){throw new db[(_0x918c('0xb4'))]['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x2a996b;})[_0x918c('0x36')](removeEntity(_0x2ce2ba,null))[_0x918c('0x2b')](handleError(_0x2ce2ba,null));};exports[_0x918c('0xb5')]=function(_0x11199a,_0xe6b718,_0x45250a){return db['MailAccount'][_0x918c('0x5d')]({'where':{'id':_0x11199a[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0xe6b718,null))[_0x918c('0x36')](function(_0x107a02){if(_0x107a02){return _0x107a02[_0x918c('0xb5')](_0x11199a[_0x918c('0x5f')][_0x918c('0x68')],_[_0x918c('0x88')](_0x11199a['body'],[_0x918c('0x68'),'id'])||{})[_0x918c('0xb6')](function(_0x256e3b){for(var _0x34eeb6=0x0;_0x34eeb6<_0x11199a[_0x918c('0x5f')][_0x918c('0x68')]['length'];_0x34eeb6+=0x1){socket[_0x918c('0xb7')](_0x918c('0xb8'),{'UserId':_0x11199a[_0x918c('0x5f')][_0x918c('0x68')][_0x34eeb6],'MailAccountId':_0x11199a[_0x918c('0x5b')]['id']});}return _0x256e3b;});}})[_0x918c('0x36')](respondWithResult(_0xe6b718,null))[_0x918c('0x2b')](handleError(_0xe6b718,null));};exports['removeAgents']=function(_0x1e55e0,_0x7e0ce9,_0x580479){return db[_0x918c('0x43')][_0x918c('0x5d')]({'where':{'id':_0x1e55e0['params']['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x7e0ce9,null))['then'](function(_0x4a877d){if(_0x4a877d){return _0x4a877d[_0x918c('0xb9')](_0x1e55e0[_0x918c('0x46')][_0x918c('0x68')])['then'](function(){if(_['isArray'](_0x1e55e0[_0x918c('0x46')][_0x918c('0x68')])){for(var _0xe86112=0x0;_0xe86112<_0x1e55e0[_0x918c('0x46')][_0x918c('0x68')][_0x918c('0x4c')];_0xe86112+=0x1){socket[_0x918c('0xb7')]('userMailAccount:remove',{'UserId':Number(_0x1e55e0[_0x918c('0x46')]['ids'][_0xe86112]),'MailAccountId':Number(_0x1e55e0['params']['id'])});}}else{socket[_0x918c('0xb7')](_0x918c('0xba'),{'UserId':Number(_0x1e55e0['query']['ids']),'MailAccountId':Number(_0x1e55e0[_0x918c('0x5b')]['id'])});}});}})[_0x918c('0x36')](respondWithStatusCode(_0x7e0ce9,null))[_0x918c('0x2b')](handleError(_0x7e0ce9,null));};exports[_0x918c('0xbb')]=function(_0x11d271,_0x572dd2,_0x3fe108){var _0x599fb2={};var _0x29b6a2={};var _0x5749f6;var _0x6061c6;return db['MailAccount'][_0x918c('0x64')]({'where':{'id':_0x11d271[_0x918c('0x5b')]['id']}})[_0x918c('0x36')](handleEntityNotFound(_0x572dd2,null))[_0x918c('0x36')](function(_0x4046bd){if(_0x4046bd){_0x5749f6=_0x4046bd;_0x29b6a2[_0x918c('0x48')]=_['keys'](db[_0x918c('0x8c')][_0x918c('0x44')]);_0x29b6a2[_0x918c('0x46')]=_[_0x918c('0x45')](_0x11d271['query']);_0x29b6a2[_0x918c('0x47')]=_[_0x918c('0x4a')](_0x29b6a2[_0x918c('0x48')],_0x29b6a2['query']);_0x599fb2[_0x918c('0x49')]=_[_0x918c('0x4a')](_0x29b6a2[_0x918c('0x48')],qs[_0x918c('0x4b')](_0x11d271[_0x918c('0x46')][_0x918c('0x4b')]));_0x599fb2['attributes']=_0x599fb2[_0x918c('0x49')]['length']?_0x599fb2['attributes']:_0x29b6a2['model'];_0x599fb2[_0x918c('0x4f')]=qs[_0x918c('0x65')](_0x11d271[_0x918c('0x46')][_0x918c('0x65')]);_0x599fb2['where']=qs[_0x918c('0x47')](_[_0x918c('0x51')](_0x11d271[_0x918c('0x46')],_0x29b6a2['filters']));if(_0x11d271[_0x918c('0x46')][_0x918c('0x52')]){_0x599fb2['where']=_[_0x918c('0x53')](_0x599fb2[_0x918c('0x50')],{'$or':_[_0x918c('0x54')](_0x599fb2[_0x918c('0x49')],function(_0x5906d7){var _0x174729={};_0x174729[_0x5906d7]={'$like':'%'+_0x11d271[_0x918c('0x46')][_0x918c('0x52')]+'%'};return _0x174729;})});}_0x599fb2=_[_0x918c('0x53')]({},_0x599fb2,_0x11d271[_0x918c('0x58')]);return _0x5749f6[_0x918c('0xbb')](_0x599fb2);}})[_0x918c('0x36')](function(_0x3dc755){if(_0x3dc755){_0x6061c6=_0x3dc755[_0x918c('0x4c')];if(!_0x11d271[_0x918c('0x46')][_0x918c('0x4d')](_0x918c('0x4e'))){_0x599fb2['limit']=qs[_0x918c('0x31')](_0x11d271[_0x918c('0x46')][_0x918c('0x31')]);_0x599fb2[_0x918c('0x30')]=qs['offset'](_0x11d271[_0x918c('0x46')][_0x918c('0x30')]);}return _0x5749f6[_0x918c('0xbb')](_0x599fb2);}})['then'](function(_0x4a048a){if(_0x4a048a){return _0x4a048a?{'count':_0x6061c6,'rows':_0x4a048a}:null;}})[_0x918c('0x36')](respondWithResult(_0x572dd2,null))[_0x918c('0x2b')](handleError(_0x572dd2,null));}; \ No newline at end of file +var _0xa30a=['updatedAt','DESC','from','attachments','join','server/files/attachments','basename','authentication','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','verifySmtp','destroy','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','MailAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','get','MailAccounts','UserProfileResource','sendStatus','stack','send','index','MailServerIn','Imap','MailServerOut','Pause','mandatoryDispositionPause','MailAccount','model','keys','query','intersection','attributes','fields','nolimit','order','sort','filters','pick','merge','map','type','key','VIRTUAL','field','filter','options','where','include','rows','show','Smtp','includeAll','find','body','params','describe','MailAccountId','create','getDispositions','Disposition','rawAttributes','hasOwnProperty','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','length','name','email','ListId','active','isNil','cservice','cauthentication','user','cuser','password','pass','host','port','service','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','ids','User','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','Contacts'];(function(_0x12d23a,_0x1cad42){var _0x239536=function(_0x2fe720){while(--_0x2fe720){_0x12d23a['push'](_0x12d23a['shift']());}};_0x239536(++_0x1cad42);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xaa30('0x0'));var emlformat=require(_0xaa30('0x1'));var rimraf=require(_0xaa30('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa30('0x3'));var rp=require(_0xaa30('0x4'));var moment=require(_0xaa30('0x5'));var BPromise=require(_0xaa30('0x6'));var Mustache=require(_0xaa30('0x7'));var util=require(_0xaa30('0x8'));var path=require(_0xaa30('0x9'));var sox=require('sox');var csv=require(_0xaa30('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa30('0xb'));var squel=require(_0xaa30('0xc'));var crypto=require(_0xaa30('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaa30('0xe'));var toCsv=require(_0xaa30('0xa'));var querystring=require(_0xaa30('0xf'));var Papa=require(_0xaa30('0x10'));var Redis=require(_0xaa30('0x11'));var authService=require(_0xaa30('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa30('0x13'))('api');var utils=require(_0xaa30('0x14'));var config=require(_0xaa30('0x15'));var db=require(_0xaa30('0x16'))['db'];config[_0xaa30('0x17')]=_['defaults'](config[_0xaa30('0x17')],{'host':_0xaa30('0x18'),'port':0x18eb});var socket=require(_0xaa30('0x19'))(new Redis(config['redis']));require(_0xaa30('0x1a'))[_0xaa30('0x1b')](socket);var jayson=require(_0xaa30('0x1c'));var client=jayson[_0xaa30('0x1d')][_0xaa30('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x31aa0b,_0x3240e9,_0x3b8095){if(_0x3b8095){var _0x2e37af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e37af[_0xaa30('0x1f')](_0x3240e9)){return _0x31aa0b;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x31aa0b;}}function respondWithRpcPromise(_0x91839d,_0x591478,_0x5eb356,_0x3247ea){return new BPromise(function(_0x153939,_0x130606){var _0x540e36=_0x3247ea||client;return _0x540e36['request'](_0x91839d,_0x5eb356)['then'](function(_0x23ad3b){logger['info'](_0xaa30('0x20'),_0x591478,_0xaa30('0x21'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x591478,'request\x20sent',JSON[_0xaa30('0x22')](_0x23ad3b));if(_0x23ad3b[_0xaa30('0x23')]){if(_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x24')]===0x1f4){logger[_0xaa30('0x23')]('MailAccount,\x20%s,\x20%s',_0x591478,_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);return _0x130606(_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);}logger[_0xaa30('0x23')]('MailAccount,\x20%s,\x20%s',_0x591478,_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);return _0x153939(_0x23ad3b[_0xaa30('0x23')][_0xaa30('0x25')]);}else{logger['info'](_0xaa30('0x20'),_0x591478,_0xaa30('0x21'));_0x153939(_0x23ad3b[_0xaa30('0x26')][_0xaa30('0x25')]);}})[_0xaa30('0x27')](function(_0x2a59ce){logger['error'](_0xaa30('0x20'),_0x591478,_0x2a59ce);_0x130606(_0x2a59ce);});});}function respondWithStatusCode(_0x465701,_0x5d4da8){_0x5d4da8=_0x5d4da8||0xcc;return function(_0xb043e4){if(_0xb043e4){return _0x465701['sendStatus'](_0x5d4da8);}return _0x465701[_0xaa30('0x28')](_0x5d4da8)[_0xaa30('0x29')]();};}function respondWithResult(_0x2aabf8,_0xd1eb3a){_0xd1eb3a=_0xd1eb3a||0xc8;return function(_0x37b4a6){if(_0x37b4a6){return _0x2aabf8[_0xaa30('0x28')](_0xd1eb3a)[_0xaa30('0x2a')](_0x37b4a6);}};}function respondWithFilteredResult(_0x39f708,_0x1f288c){return function(_0x43fb30){if(_0x43fb30){var _0x44aa9b=_0x43fb30[_0xaa30('0x2b')],_0x43003f=_0x1f288c[_0xaa30('0x2c')],_0x2038a6=_0x1f288c[_0xaa30('0x2c')]+_0x1f288c[_0xaa30('0x2d')],_0x46abb9;if(_0x2038a6>=_0x44aa9b){_0x2038a6=_0x44aa9b;_0x46abb9=0xc8;}else{_0x46abb9=0xce;}_0x39f708['status'](_0x46abb9);return _0x39f708[_0xaa30('0x2e')](_0xaa30('0x2f'),_0x43003f+'-'+_0x2038a6+'/'+_0x44aa9b)[_0xaa30('0x2a')](_0x43fb30);}return null;};}function patchUpdates(_0x20916f){return function(_0x2276e0){try{jsonpatch[_0xaa30('0x30')](_0x2276e0,_0x20916f,!![]);}catch(_0x4dae71){return BPromise['reject'](_0x4dae71);}return _0x2276e0['save']();};}function saveUpdates(_0x30909a,_0x407090){return function(_0xb48ef3){if(_0xb48ef3){return _0xb48ef3[_0xaa30('0x31')](_0x30909a)[_0xaa30('0x32')](function(_0x559013){return _0x559013;});}return null;};}function removeEntity(_0x499af0,_0x7a920e){return function(_0x2d26fb){if(_0x2d26fb){return _0x2d26fb['destroy']()[_0xaa30('0x32')](function(){var _0x4c83dd=_0x2d26fb[_0xaa30('0x33')]({'plain':!![]});var _0x5241d2=_0xaa30('0x34');return db[_0xaa30('0x35')]['destroy']({'where':{'type':_0x5241d2,'resourceId':_0x4c83dd['id']}})[_0xaa30('0x32')](function(){return _0x2d26fb;});})[_0xaa30('0x32')](function(){_0x499af0[_0xaa30('0x28')](0xcc)[_0xaa30('0x29')]();});}};}function handleEntityNotFound(_0x285b68,_0x61c959){return function(_0x5cfc85){if(!_0x5cfc85){_0x285b68[_0xaa30('0x36')](0x194);}return _0x5cfc85;};}function handleError(_0x1a2af6,_0x53dd7c){_0x53dd7c=_0x53dd7c||0x1f4;return function(_0x3769ea){logger[_0xaa30('0x23')](_0x3769ea[_0xaa30('0x37')]);if(_0x3769ea['name']){delete _0x3769ea['name'];}_0x1a2af6[_0xaa30('0x28')](_0x53dd7c)[_0xaa30('0x38')](_0x3769ea);};}exports[_0xaa30('0x39')]=function(_0x1b22ed,_0x1ec3cf){var _0x291854={'include':[{'model':db[_0xaa30('0x3a')],'as':_0xaa30('0x3b')},{'model':db[_0xaa30('0x3c')],'as':'Smtp'},{'model':db[_0xaa30('0x3d')],'as':_0xaa30('0x3e')}]},_0x4dd5df={},_0x5ca1b0={'count':0x0,'rows':[]};var _0x8fb95e=db[_0xaa30('0x3f')]['rawAttributes'];_0x4dd5df[_0xaa30('0x40')]=_[_0xaa30('0x41')](_0x8fb95e);_0x4dd5df[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x1b22ed[_0xaa30('0x42')]);_0x4dd5df['filters']=_[_0xaa30('0x43')](_0x4dd5df[_0xaa30('0x40')],_0x4dd5df[_0xaa30('0x42')]);_0x291854[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x4dd5df[_0xaa30('0x40')],qs[_0xaa30('0x45')](_0x1b22ed[_0xaa30('0x42')]['fields']));_0x291854['attributes']=_0x291854[_0xaa30('0x44')]['length']?_0x291854['attributes']:_0x4dd5df['model'];if(!_0x1b22ed[_0xaa30('0x42')]['hasOwnProperty'](_0xaa30('0x46'))){_0x291854['limit']=qs[_0xaa30('0x2d')](_0x1b22ed[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x291854[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x1b22ed[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x291854[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x1b22ed[_0xaa30('0x42')][_0xaa30('0x48')]);_0x291854['where']=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x1b22ed[_0xaa30('0x42')],_0x4dd5df[_0xaa30('0x49')]));if(_0x1b22ed[_0xaa30('0x42')]['filter']){_0x291854['where']=_[_0xaa30('0x4b')](_0x291854['where'],{'$or':_[_0xaa30('0x4c')](_0x8fb95e,function(_0xbf9edd){if(_0xbf9edd[_0xaa30('0x4d')][_0xaa30('0x4e')]!==_0xaa30('0x4f')){var _0x3ec15b={};_0x3ec15b[_0xbf9edd[_0xaa30('0x50')]]={'$like':'%'+_0x1b22ed['query'][_0xaa30('0x51')]+'%'};return _0x3ec15b;}})});}_0x291854=_[_0xaa30('0x4b')]({},_0x291854,_0x1b22ed[_0xaa30('0x52')]);var _0x5cacee={'where':_0x291854[_0xaa30('0x53')]};return db[_0xaa30('0x3f')]['count'](_0x5cacee)[_0xaa30('0x32')](function(_0x4a8fcc){_0x5ca1b0[_0xaa30('0x2b')]=_0x4a8fcc;if(_0x1b22ed['query']['includeAll']){_0x291854[_0xaa30('0x54')]=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x291854);})[_0xaa30('0x32')](function(_0x1083e2){_0x5ca1b0[_0xaa30('0x55')]=_0x1083e2;return _0x5ca1b0;})[_0xaa30('0x32')](respondWithFilteredResult(_0x1ec3cf,_0x291854))[_0xaa30('0x27')](handleError(_0x1ec3cf,null));};exports[_0xaa30('0x56')]=function(_0x5616cd,_0x17d75d){var _0x17868d={'raw':![],'where':{'id':_0x5616cd['params']['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0xaa30('0x57')},{'model':db[_0xaa30('0x3d')],'as':_0xaa30('0x3e')}]},_0x4531b7={};_0x4531b7[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x3f')]['rawAttributes']);_0x4531b7[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x5616cd[_0xaa30('0x42')]);_0x4531b7[_0xaa30('0x49')]=_['intersection'](_0x4531b7[_0xaa30('0x40')],_0x4531b7[_0xaa30('0x42')]);_0x17868d[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x4531b7[_0xaa30('0x40')],qs['fields'](_0x5616cd['query'][_0xaa30('0x45')]));_0x17868d[_0xaa30('0x44')]=_0x17868d[_0xaa30('0x44')]['length']?_0x17868d[_0xaa30('0x44')]:_0x4531b7['model'];if(_0x5616cd[_0xaa30('0x42')][_0xaa30('0x58')]){_0x17868d['include']=[{'all':!![]}];}_0x17868d=_[_0xaa30('0x4b')]({},_0x17868d,_0x5616cd[_0xaa30('0x52')]);return db['MailAccount'][_0xaa30('0x59')](_0x17868d)['then'](handleEntityNotFound(_0x17d75d,null))['then'](respondWithResult(_0x17d75d,null))[_0xaa30('0x27')](handleError(_0x17d75d,null));};exports[_0xaa30('0x31')]=function(_0x268359,_0x5a85aa){if(_0x268359[_0xaa30('0x5a')]['id']){delete _0x268359[_0xaa30('0x5a')]['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x268359[_0xaa30('0x5b')]['id']},'include':[{'model':db[_0xaa30('0x3a')],'as':_0xaa30('0x3b')},{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57')},{'model':db[_0xaa30('0x3d')],'as':_0xaa30('0x3e')}]})[_0xaa30('0x32')](handleEntityNotFound(_0x5a85aa,null))[_0xaa30('0x32')](saveUpdates(_0x268359['body'],null))[_0xaa30('0x32')](function(_0x3bc9d9){if(_0x3bc9d9&&_0x268359[_0xaa30('0x5a')]['Imap']){return db[_0xaa30('0x3a')][_0xaa30('0x31')](_0x268359[_0xaa30('0x5a')][_0xaa30('0x3b')],{'where':{'MailAccountId':_0x3bc9d9['id']}})[_0xaa30('0x32')](function(){return _0x3bc9d9;});}return _0x3bc9d9;})[_0xaa30('0x32')](function(_0x4f1d54){if(_0x4f1d54&&_0x268359[_0xaa30('0x5a')]['Smtp']){return db[_0xaa30('0x3c')][_0xaa30('0x31')](_0x268359[_0xaa30('0x5a')][_0xaa30('0x57')],{'where':{'MailAccountId':_0x4f1d54['id']}})['then'](function(){return _0x4f1d54;});}return _0x4f1d54;})[_0xaa30('0x32')](respondWithResult(_0x5a85aa,null))[_0xaa30('0x27')](handleError(_0x5a85aa,null));};exports['describe']=function(_0x26f6f9,_0x62b307){return db[_0xaa30('0x3f')][_0xaa30('0x5c')]()[_0xaa30('0x32')](respondWithResult(_0x62b307,null))[_0xaa30('0x27')](handleError(_0x62b307,null));};exports['addDisposition']=function(_0x401f5f,_0x33b2ef,_0x3a8bdc){if(_0x401f5f[_0xaa30('0x5a')]['id']){delete _0x401f5f[_0xaa30('0x5a')]['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x401f5f[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x33b2ef,null))[_0xaa30('0x32')](function(_0x46bdc4){if(_0x46bdc4){_0x401f5f[_0xaa30('0x5a')][_0xaa30('0x5d')]=_0x46bdc4['id'];return db['Disposition'][_0xaa30('0x5e')](_0x401f5f['body']);}})[_0xaa30('0x32')](respondWithResult(_0x33b2ef,null))['catch'](handleError(_0x33b2ef,null));};exports[_0xaa30('0x5f')]=function(_0x2d7725,_0x211a83,_0x5880b2){var _0x12347c={'raw':![],'where':{}};var _0x30f19a={};var _0x4c9643={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x2d7725[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x211a83,null))['then'](function(_0x17801d){if(_0x17801d){_0x30f19a[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x60')][_0xaa30('0x61')]);_0x30f19a[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x2d7725['query']);_0x30f19a[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x30f19a[_0xaa30('0x40')],_0x30f19a['query']);_0x12347c[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x30f19a[_0xaa30('0x40')],qs['fields'](_0x2d7725[_0xaa30('0x42')]['fields']));_0x12347c[_0xaa30('0x44')]=_0x12347c['attributes']['length']?_0x12347c[_0xaa30('0x44')]:_0x30f19a[_0xaa30('0x40')];if(!_0x2d7725['query'][_0xaa30('0x62')](_0xaa30('0x46'))){_0x12347c[_0xaa30('0x2d')]=qs['limit'](_0x2d7725[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x12347c[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x2d7725[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x12347c[_0xaa30('0x47')]=qs['sort'](_0x2d7725[_0xaa30('0x42')][_0xaa30('0x48')]);_0x12347c[_0xaa30('0x53')]=qs[_0xaa30('0x49')](_['pick'](_0x2d7725[_0xaa30('0x42')],_0x30f19a[_0xaa30('0x49')]));_0x12347c['where'][_0xaa30('0x5d')]=_0x17801d['id'];if(_0x2d7725[_0xaa30('0x42')][_0xaa30('0x51')]){_0x12347c[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x12347c[_0xaa30('0x53')],{'$or':_['map'](_0x12347c[_0xaa30('0x44')],function(_0x1ddae9){var _0x5948b4={};_0x5948b4[_0x1ddae9]={'$like':'%'+_0x2d7725[_0xaa30('0x42')][_0xaa30('0x51')]+'%'};return _0x5948b4;})});}_0x12347c=_[_0xaa30('0x4b')]({},_0x12347c,_0x2d7725[_0xaa30('0x52')]);return db[_0xaa30('0x60')]['count']({'where':_0x12347c[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x2216c0){_0x4c9643[_0xaa30('0x2b')]=_0x2216c0;if(_0x2d7725[_0xaa30('0x42')][_0xaa30('0x58')]){_0x12347c['include']=[{'all':!![]}];}return db[_0xaa30('0x60')][_0xaa30('0x63')](_0x12347c);})['then'](function(_0x4ecb6e){_0x4c9643[_0xaa30('0x55')]=_0x4ecb6e;return _0x4c9643;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0x211a83,_0x12347c))[_0xaa30('0x27')](handleError(_0x211a83,null));};exports[_0xaa30('0x64')]=function(_0x1e6e00,_0x25449c,_0x2548be){return db['MailAccount']['find']({'where':{'id':_0x1e6e00['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x25449c,null))[_0xaa30('0x32')](function(_0xba496a){if(_0xba496a){return _0xba496a[_0xaa30('0x64')](_0x1e6e00[_0xaa30('0x42')]['ids']);}})[_0xaa30('0x32')](respondWithStatusCode(_0x25449c,null))[_0xaa30('0x27')](handleError(_0x25449c,null));};exports[_0xaa30('0x65')]=function(_0x377454,_0x37af47,_0xf9624a){if(_0x377454[_0xaa30('0x5a')]['id']){delete _0x377454[_0xaa30('0x5a')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x377454['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x37af47,null))[_0xaa30('0x32')](function(_0x541d3b){if(_0x541d3b){_0x377454[_0xaa30('0x5a')][_0xaa30('0x5d')]=_0x541d3b['id'];return db[_0xaa30('0x66')][_0xaa30('0x5e')](_0x377454[_0xaa30('0x5a')]);}})['then'](respondWithResult(_0x37af47,null))[_0xaa30('0x27')](handleError(_0x37af47,null));};exports[_0xaa30('0x67')]=function(_0x4233de,_0x583eee,_0x21b87b){var _0x3792be={'raw':![],'where':{}};var _0x245787={};var _0x41873c={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0x4233de[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x583eee,null))[_0xaa30('0x32')](function(_0x25d030){if(_0x25d030){_0x245787[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x66')][_0xaa30('0x61')]);_0x245787[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x4233de[_0xaa30('0x42')]);_0x245787[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x245787[_0xaa30('0x40')],_0x245787[_0xaa30('0x42')]);_0x3792be['attributes']=_[_0xaa30('0x43')](_0x245787['model'],qs[_0xaa30('0x45')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x45')]));_0x3792be[_0xaa30('0x44')]=_0x3792be[_0xaa30('0x44')][_0xaa30('0x69')]?_0x3792be[_0xaa30('0x44')]:_0x245787[_0xaa30('0x40')];if(!_0x4233de[_0xaa30('0x42')][_0xaa30('0x62')](_0xaa30('0x46'))){_0x3792be[_0xaa30('0x2d')]=qs[_0xaa30('0x2d')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x3792be[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x3792be['order']=qs[_0xaa30('0x48')](_0x4233de[_0xaa30('0x42')][_0xaa30('0x48')]);_0x3792be[_0xaa30('0x53')]=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x4233de[_0xaa30('0x42')],_0x245787['filters']));_0x3792be[_0xaa30('0x53')][_0xaa30('0x5d')]=_0x25d030['id'];if(_0x4233de['query'][_0xaa30('0x51')]){_0x3792be[_0xaa30('0x53')]=_['merge'](_0x3792be[_0xaa30('0x53')],{'$or':_[_0xaa30('0x4c')](_0x3792be[_0xaa30('0x44')],function(_0x3b60f3){var _0x5eb209={};_0x5eb209[_0x3b60f3]={'$like':'%'+_0x4233de[_0xaa30('0x42')]['filter']+'%'};return _0x5eb209;})});}_0x3792be=_[_0xaa30('0x4b')]({},_0x3792be,_0x4233de[_0xaa30('0x52')]);return db[_0xaa30('0x66')][_0xaa30('0x2b')]({'where':_0x3792be[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x45ffba){_0x41873c[_0xaa30('0x2b')]=_0x45ffba;if(_0x4233de[_0xaa30('0x42')]['includeAll']){_0x3792be[_0xaa30('0x54')]=[{'all':!![]}];}return db[_0xaa30('0x66')]['findAll'](_0x3792be);})[_0xaa30('0x32')](function(_0x1550ce){_0x41873c['rows']=_0x1550ce;return _0x41873c;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0x583eee,_0x3792be))[_0xaa30('0x27')](handleError(_0x583eee,null));};exports['removeAnswers']=function(_0x44b202,_0x58920d,_0x5db1d5){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x44b202['params']['id']}})['then'](handleEntityNotFound(_0x58920d,null))[_0xaa30('0x32')](function(_0x30ba59){if(_0x30ba59){return _0x30ba59['removeAnswers'](_0x44b202[_0xaa30('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x58920d,null))[_0xaa30('0x27')](handleError(_0x58920d,null));};exports['create']=function(_0x2e6f5d,_0x4ce637){var _0x181692={'name':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6a')],'key':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x4e')],'email':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6b')],'ListId':_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6c')],'active':!_['isNil'](_0x2e6f5d['body'][_0xaa30('0x6d')])?_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6d')]:!![],'description':_0x2e6f5d['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0xaa30('0x6e')](_0x2e6f5d['body'][_0xaa30('0x6f')])){if(_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x70')]){_0x181692[_0xaa30('0x3b')]['user']=_0x181692[_0xaa30('0x57')][_0xaa30('0x71')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x72')];_0x181692[_0xaa30('0x3b')][_0xaa30('0x73')]=_0x181692['Smtp'][_0xaa30('0x74')]=_0x2e6f5d[_0xaa30('0x5a')]['cpassword'];}else{_0x181692[_0xaa30('0x3b')]['authentication']=_0x181692[_0xaa30('0x57')]['authentication']=![];}_0x181692[_0xaa30('0x3b')][_0xaa30('0x75')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x3b')][_0xaa30('0x75')];_0x181692[_0xaa30('0x3b')][_0xaa30('0x76')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x3b')]['port'];_0x181692[_0xaa30('0x57')][_0xaa30('0x75')]=_0x2e6f5d[_0xaa30('0x5a')]['Smtp'][_0xaa30('0x75')];_0x181692[_0xaa30('0x57')][_0xaa30('0x76')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x57')][_0xaa30('0x76')];}else{_0x181692[_0xaa30('0x3b')][_0xaa30('0x77')]=_0x181692[_0xaa30('0x57')]['service']=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x6f')];_0x181692[_0xaa30('0x3b')]['user']=_0x181692[_0xaa30('0x57')][_0xaa30('0x71')]=_0x2e6f5d['body'][_0xaa30('0x72')];_0x181692['Imap']['password']=_0x181692[_0xaa30('0x57')][_0xaa30('0x74')]=_0x2e6f5d[_0xaa30('0x5a')][_0xaa30('0x78')];}return db['MailAccount']['create'](_0x181692,{'include':[{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57')},{'model':db[_0xaa30('0x3a')],'as':_0xaa30('0x3b')}]})[_0xaa30('0x32')](function(_0x4add63){var _0x7db5d7=_0x2e6f5d['user'][_0xaa30('0x33')]({'plain':!![]});if(!_0x7db5d7)throw new Error(_0xaa30('0x79'));if(_0x7db5d7[_0xaa30('0x7a')]==='user'){var _0x1c25b1=_0x4add63[_0xaa30('0x33')]({'plain':!![]});return db[_0xaa30('0x7b')][_0xaa30('0x59')]({'where':{'name':_0xaa30('0x34'),'userProfileId':_0x7db5d7[_0xaa30('0x7c')]},'raw':!![]})['then'](function(_0x133a0f){if(_0x133a0f&&_0x133a0f[_0xaa30('0x7d')]===0x0){return db['UserProfileResource']['create']({'name':_0x1c25b1[_0xaa30('0x6a')],'resourceId':_0x1c25b1['id'],'type':_0x133a0f[_0xaa30('0x6a')],'sectionId':_0x133a0f['id']},{})[_0xaa30('0x32')](function(){return _0x4add63;});}else{return _0x4add63;}})[_0xaa30('0x27')](function(_0x405e93){logger[_0xaa30('0x23')](_0xaa30('0x7e'),_0x405e93);throw _0x405e93;});}return _0x4add63;})[_0xaa30('0x32')](respondWithResult(_0x4ce637,0xc9))[_0xaa30('0x27')](handleError(_0x4ce637,null));};exports[_0xaa30('0x7f')]=function(_0x4bba25,_0x73c665,_0x51c71a){return db['MailAccount'][_0xaa30('0x68')]({'where':{'id':_0x4bba25[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x73c665,null))['then'](function(_0x439016){if(_0x439016){return _0x439016[_0xaa30('0x7f')]();}return null;})['then'](respondWithResult(_0x73c665,null))[_0xaa30('0x27')](handleError(_0x73c665,null));};exports[_0xaa30('0x80')]=function(_0x2ebaa0,_0x3b0b3e,_0x420276){if(_0x2ebaa0[_0xaa30('0x5a')]['id']){delete _0x2ebaa0['body']['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x2ebaa0[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x3b0b3e,null))[_0xaa30('0x32')](function(_0x3afa1c){if(_0x3afa1c){_0x2ebaa0[_0xaa30('0x5a')]['MailAccountId']=_0x3afa1c['id'];return db['MailServerIn'][_0xaa30('0x5e')](_0x2ebaa0[_0xaa30('0x5a')]);}})[_0xaa30('0x32')](respondWithResult(_0x3b0b3e,null))[_0xaa30('0x27')](handleError(_0x3b0b3e,null));};exports[_0xaa30('0x81')]=function(_0xf61a64,_0x162810,_0x1a26ce){return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0xf61a64[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x162810,null))[_0xaa30('0x32')](function(_0x3a40b2){if(_0x3a40b2){return _0x3a40b2[_0xaa30('0x82')](null);}return null;})[_0xaa30('0x32')](respondWithStatusCode(_0x162810,null))[_0xaa30('0x27')](handleError(_0x162810,null));};exports[_0xaa30('0x83')]=function(_0x3c4df3,_0x25c239,_0x3174f6){return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0x3c4df3[_0xaa30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x25c239,null))[_0xaa30('0x32')](function(_0x17ca14){if(_0x17ca14){return _0x17ca14[_0xaa30('0x83')]();}return null;})['then'](respondWithResult(_0x25c239,null))['catch'](handleError(_0x25c239,null));};exports[_0xaa30('0x84')]=function(_0x5a756f,_0x23c31e,_0x483991){if(_0x5a756f[_0xaa30('0x5a')]['id']){delete _0x5a756f[_0xaa30('0x5a')]['id'];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x5a756f['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x23c31e,null))[_0xaa30('0x32')](function(_0x4521a4){if(_0x4521a4){_0x5a756f[_0xaa30('0x5a')]['MailAccountId']=_0x4521a4['id'];return db[_0xaa30('0x3c')]['create'](_0x5a756f[_0xaa30('0x5a')]);}})['then'](respondWithResult(_0x23c31e,null))[_0xaa30('0x27')](handleError(_0x23c31e,null));};exports[_0xaa30('0x85')]=function(_0x5feb07,_0x536eae,_0x2d8b6d){return db[_0xaa30('0x3f')][_0xaa30('0x68')]({'where':{'id':_0x5feb07['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x536eae,null))['then'](function(_0x2632a7){if(_0x2632a7){return _0x2632a7[_0xaa30('0x86')](null);}return null;})['then'](respondWithStatusCode(_0x536eae,null))[_0xaa30('0x27')](handleError(_0x536eae,null));};exports['addInteraction']=function(_0x397d88,_0x3a4f24,_0x58b8fe){return db[_0xaa30('0x87')][_0xaa30('0x59')]({'where':{'id':_0x397d88[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x3a4f24,null))[_0xaa30('0x32')](function(_0x1af8ef){if(_0x1af8ef){return _0x1af8ef[_0xaa30('0x88')](_0x397d88[_0xaa30('0x5a')]['ids'],_[_0xaa30('0x89')](_0x397d88['body'],[_0xaa30('0x8a'),'id'])||{});}})['then'](respondWithResult(_0x3a4f24,null))[_0xaa30('0x27')](handleError(_0x3a4f24,null));};exports['getInteractions']=function(_0x5253ab,_0xe20fd0,_0x22093c){var _0x329c69={'raw':![],'where':{}};var _0x2dab91={};var _0x53db5a={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x5253ab[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0xe20fd0,null))[_0xaa30('0x32')](function(_0x449bad){if(_0x449bad){_0x2dab91[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x87')]['rawAttributes']);_0x2dab91[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x5253ab[_0xaa30('0x42')]);_0x2dab91[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x2dab91[_0xaa30('0x40')],_0x2dab91[_0xaa30('0x42')]);_0x329c69[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x2dab91[_0xaa30('0x40')],qs['fields'](_0x5253ab[_0xaa30('0x42')][_0xaa30('0x45')]));_0x329c69[_0xaa30('0x44')]=_0x329c69['attributes'][_0xaa30('0x69')]?_0x329c69['attributes']:_0x2dab91[_0xaa30('0x40')];if(!_0x5253ab['query']['hasOwnProperty']('nolimit')){_0x329c69[_0xaa30('0x2d')]=qs['limit'](_0x5253ab[_0xaa30('0x42')]['limit']);_0x329c69[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x5253ab[_0xaa30('0x42')][_0xaa30('0x2c')]);}_0x329c69[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x5253ab[_0xaa30('0x42')][_0xaa30('0x48')]);_0x329c69[_0xaa30('0x53')]=qs['filters'](_[_0xaa30('0x4a')](_0x5253ab[_0xaa30('0x42')],_0x2dab91[_0xaa30('0x49')]));_0x329c69[_0xaa30('0x53')][_0xaa30('0x5d')]=_0x449bad['id'];if(_0x5253ab[_0xaa30('0x42')]['filter']){_0x329c69[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x329c69[_0xaa30('0x53')],{'$or':_[_0xaa30('0x4c')](_0x329c69[_0xaa30('0x44')],function(_0x1f941c){var _0x123328={};_0x123328[_0x1f941c]={'$like':'%'+_0x5253ab[_0xaa30('0x42')]['filter']+'%'};return _0x123328;})});}_0x329c69=_[_0xaa30('0x4b')]({},_0x329c69,_0x5253ab[_0xaa30('0x52')]);return db[_0xaa30('0x87')][_0xaa30('0x2b')]({'where':_0x329c69[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x22daa4){_0x53db5a[_0xaa30('0x2b')]=_0x22daa4;if(_0x5253ab['query'][_0xaa30('0x58')]){_0x329c69[_0xaa30('0x54')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xaa30('0x8b')],'as':'Owner','attributes':[_0xaa30('0x6a'),'fullname','internal'],'required':![]},{'model':db[_0xaa30('0x8c')],'as':'Tags','attributes':['id',_0xaa30('0x6a'),_0xaa30('0x8d')],'where':_0x5253ab['query']['tag']?{'id':_0x5253ab[_0xaa30('0x42')]['tag']}:undefined,'required':_0x5253ab[_0xaa30('0x42')][_0xaa30('0x8e')]?!![]:![]}];}return db['MailInteraction']['findAll'](_0x329c69);})[_0xaa30('0x32')](function(_0xcea48e){_0x53db5a[_0xaa30('0x55')]=_0xcea48e;return _0x53db5a;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0xe20fd0,_0x329c69))[_0xaa30('0x27')](handleError(_0xe20fd0,null));};exports[_0xaa30('0x8f')]=function(_0x2a258c,_0x9d7892,_0x301e6f){return db['MailAccount'][_0xaa30('0x68')]({'where':{'id':_0x2a258c['params']['id']}})['then'](handleEntityNotFound(_0x9d7892,null))[_0xaa30('0x32')](function(_0xd69c50){if(_0xd69c50){return db[_0xaa30('0x90')][_0xaa30('0x91')](function(_0xcf5d37){return db[_0xaa30('0x92')]['destroy']({'where':{'MailAccountId':_0x2a258c['params']['id']},'transaction':_0xcf5d37})[_0xaa30('0x32')](function(_0x38bdc4){var _0xd2d083=_['map'](_0x2a258c[_0xaa30('0x5a')],function(_0x4672a4){_0x4672a4[_0xaa30('0x5d')]=_0x2a258c['params']['id'];return _0x4672a4;});return db[_0xaa30('0x92')][_0xaa30('0x93')](_0xd2d083,{'transaction':_0xcf5d37});});})[_0xaa30('0x32')](function(){return db[_0xaa30('0x92')]['findAndCountAll']({'where':{'MailAccountId':_0x2a258c[_0xaa30('0x5b')]['id']},'order':_0xaa30('0x94')});});}})['then'](respondWithResult(_0x9d7892,null))[_0xaa30('0x27')](handleError(_0x9d7892,null));};exports[_0xaa30('0x95')]=function(_0x592619,_0xa76565,_0x2ee683){var _0x1ea804={};var _0x5738a0={};var _0x488dcf;var _0x1bc85b;return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x592619[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0xa76565,null))[_0xaa30('0x32')](function(_0x45d1d6){if(_0x45d1d6){_0x488dcf=_0x45d1d6;_0x5738a0[_0xaa30('0x40')]=_[_0xaa30('0x41')](db['MailApplication']['rawAttributes']);_0x5738a0[_0xaa30('0x42')]=_[_0xaa30('0x41')](_0x592619[_0xaa30('0x42')]);_0x5738a0[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x5738a0['model'],_0x5738a0[_0xaa30('0x42')]);_0x1ea804[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x5738a0['model'],qs[_0xaa30('0x45')](_0x592619[_0xaa30('0x42')][_0xaa30('0x45')]));_0x1ea804[_0xaa30('0x44')]=_0x1ea804[_0xaa30('0x44')][_0xaa30('0x69')]?_0x1ea804[_0xaa30('0x44')]:_0x5738a0[_0xaa30('0x40')];_0x1ea804[_0xaa30('0x47')]=qs['sort'](_0x592619[_0xaa30('0x42')]['sort']);_0x1ea804[_0xaa30('0x53')]=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x592619[_0xaa30('0x42')],_0x5738a0[_0xaa30('0x49')]));if(_0x592619[_0xaa30('0x42')][_0xaa30('0x51')]){_0x1ea804['where']=_[_0xaa30('0x4b')](_0x1ea804[_0xaa30('0x53')],{'$or':_['map'](_0x1ea804[_0xaa30('0x44')],function(_0x15dfac){var _0x2b9f8b={};_0x2b9f8b[_0x15dfac]={'$like':'%'+_0x592619[_0xaa30('0x42')][_0xaa30('0x51')]+'%'};return _0x2b9f8b;})});}_0x1ea804=_[_0xaa30('0x4b')]({},_0x1ea804,_0x592619[_0xaa30('0x52')]);return _0x488dcf['getApplications'](_0x1ea804);}})[_0xaa30('0x32')](function(_0x131227){if(_0x131227){_0x1bc85b=_0x131227['length'];if(!_0x592619[_0xaa30('0x42')][_0xaa30('0x62')](_0xaa30('0x46'))){_0x1ea804[_0xaa30('0x2d')]=qs['limit'](_0x592619[_0xaa30('0x42')][_0xaa30('0x2d')]);_0x1ea804[_0xaa30('0x2c')]=qs[_0xaa30('0x2c')](_0x592619[_0xaa30('0x42')]['offset']);}return _0x488dcf[_0xaa30('0x95')](_0x1ea804);}})['then'](function(_0x4ba244){if(_0x4ba244){return _0x4ba244?{'count':_0x1bc85b,'rows':_0x4ba244}:null;}})[_0xaa30('0x32')](respondWithResult(_0xa76565,null))['catch'](handleError(_0xa76565,null));};exports['getMessages']=function(_0x1216f9,_0x44fe23,_0x79fcc9){var _0x4228fc={'raw':!![],'where':{}};var _0x8aec1f={};var _0x569b70={'count':0x0,'rows':[]};return db[_0xaa30('0x3f')]['findOne']({'where':{'id':_0x1216f9['params']['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x44fe23,null))[_0xaa30('0x32')](function(_0x1ba4b6){if(_0x1ba4b6){_0x8aec1f[_0xaa30('0x40')]=_[_0xaa30('0x41')](db[_0xaa30('0x96')][_0xaa30('0x61')]);_0x8aec1f['query']=_[_0xaa30('0x41')](_0x1216f9[_0xaa30('0x42')]);_0x8aec1f[_0xaa30('0x49')]=_[_0xaa30('0x43')](_0x8aec1f[_0xaa30('0x40')],_0x8aec1f['query']);_0x4228fc['attributes']=_['intersection'](_0x8aec1f['model'],qs[_0xaa30('0x45')](_0x1216f9[_0xaa30('0x42')][_0xaa30('0x45')]));_0x4228fc[_0xaa30('0x44')]=_0x4228fc[_0xaa30('0x44')]['length']?_0x4228fc[_0xaa30('0x44')]:_0x8aec1f[_0xaa30('0x40')];if(!_0x1216f9[_0xaa30('0x42')][_0xaa30('0x62')](_0xaa30('0x46'))){_0x4228fc[_0xaa30('0x2d')]=qs['limit'](_0x1216f9['query'][_0xaa30('0x2d')]);_0x4228fc['offset']=qs[_0xaa30('0x2c')](_0x1216f9['query'][_0xaa30('0x2c')]);}_0x4228fc[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x1216f9[_0xaa30('0x42')][_0xaa30('0x48')]);_0x4228fc['where']=qs[_0xaa30('0x49')](_[_0xaa30('0x4a')](_0x1216f9[_0xaa30('0x42')],_0x8aec1f[_0xaa30('0x49')]));_0x4228fc[_0xaa30('0x53')][_0xaa30('0x5d')]=_0x1ba4b6['id'];if(_0x1216f9['query'][_0xaa30('0x51')]){_0x4228fc[_0xaa30('0x53')]=_['merge'](_0x4228fc[_0xaa30('0x53')],{'$or':_[_0xaa30('0x4c')](_0x4228fc[_0xaa30('0x44')],function(_0x29abb5){var _0x161b45={};_0x161b45[_0x29abb5]={'$like':'%'+_0x1216f9[_0xaa30('0x42')][_0xaa30('0x51')]+'%'};return _0x161b45;})});}if(_0x1216f9[_0xaa30('0x42')][_0xaa30('0x97')]){var _0x12c0b7=_0x1216f9[_0xaa30('0x42')][_0xaa30('0x97')][_0xaa30('0x98')](',');var _0x58147b={};_0x58147b[_0x12c0b7[0x0]]={'$gte':moment(_0x12c0b7[0x1])[_0xaa30('0x99')](_0xaa30('0x9a'))};_0x4228fc[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x4228fc[_0xaa30('0x53')],_0x58147b);}_0x4228fc=_['merge']({},_0x4228fc,_0x1216f9['options']);return db['MailMessage'][_0xaa30('0x2b')]({'where':_0x4228fc[_0xaa30('0x53')]})[_0xaa30('0x32')](function(_0x2d4c66){_0x569b70[_0xaa30('0x2b')]=_0x2d4c66;if(_0x1216f9[_0xaa30('0x42')][_0xaa30('0x58')]){_0x4228fc[_0xaa30('0x54')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x4228fc);})[_0xaa30('0x32')](function(_0x16583e){_0x569b70[_0xaa30('0x55')]=_0x16583e;return _0x569b70;});}})[_0xaa30('0x32')](respondWithFilteredResult(_0x44fe23,_0x4228fc))[_0xaa30('0x27')](handleError(_0x44fe23,null));};exports[_0xaa30('0x38')]=function(_0x3c0a6a,_0x478a2f,_0x40d756){var _0x43e1c1,_0x249cdc={},_0x16e6e1;if(_0x3c0a6a[_0xaa30('0x5a')]['to']){_0x16e6e1=_0x3c0a6a[_0xaa30('0x5a')]['to'][_0xaa30('0x98')](',')[0x0];}return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x3c0a6a[_0xaa30('0x5b')]['id']},'include':[{'model':db[_0xaa30('0x9b')],'as':_0xaa30('0x9c'),'include':[{'model':db[_0xaa30('0x9d')],'as':_0xaa30('0x9e'),'where':{'email':_0x16e6e1},'limit':0x1,'order':[[_0xaa30('0x9f'),_0xaa30('0xa0')]]}]},{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57'),'raw':!![]}]})[_0xaa30('0x32')](handleEntityNotFound(_0x478a2f,null))[_0xaa30('0x32')](function(_0x51ccc8){if(_0x51ccc8){_0x43e1c1=_0x51ccc8;if(_0x51ccc8[_0xaa30('0x57')]){if(_[_0xaa30('0x6e')](_0x3c0a6a['body'][_0xaa30('0xa1')])){_0x3c0a6a[_0xaa30('0x5a')]['from']=util[_0xaa30('0x99')]('%s\x20<%s>',_0x51ccc8[_0xaa30('0x6a')],_0x51ccc8[_0xaa30('0x6b')]||_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x71')]);}if(_0x3c0a6a['body'][_0xaa30('0xa2')]&&_0x3c0a6a['body'][_0xaa30('0xa2')]['length']){for(var _0x242176=0x0;_0x242176<_0x3c0a6a['body']['attachments'][_0xaa30('0x69')];_0x242176+=0x1){_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xa2')][_0x242176]={'filename':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xa2')][_0x242176]['name'],'path':path[_0xaa30('0xa3')](config['root'],_0xaa30('0xa4'),_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xa2')][_0x242176][_0xaa30('0xa5')])};}}var _0x460d3c={'tls':{'rejectUnauthorized':![]}};if(_[_0xaa30('0x6e')](_0x51ccc8['Smtp'][_0xaa30('0x77')])){if(_0x51ccc8[_0xaa30('0x57')][_0xaa30('0xa6')]){_0x460d3c[_0xaa30('0xa7')]={'user':_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x71')],'pass':_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x74')]};}_0x460d3c[_0xaa30('0x75')]=_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x75')];_0x460d3c[_0xaa30('0x76')]=_0x51ccc8[_0xaa30('0x57')]['port'];_0x460d3c['secure']=_0x51ccc8[_0xaa30('0x57')][_0xaa30('0xa8')];}else{_0x460d3c[_0xaa30('0x77')]=_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x77')];_0x460d3c[_0xaa30('0xa7')]={'user':_0x51ccc8['Smtp'][_0xaa30('0x71')],'pass':_0x51ccc8[_0xaa30('0x57')][_0xaa30('0x74')]};}return respondWithRpcPromise(_0xaa30('0xa9'),_0xaa30('0xaa'),{'account':_0x460d3c,'message':_0x3c0a6a['body']});}else{throw new Error(_0xaa30('0xab'));}}})[_0xaa30('0x32')](function(_0x5065f1){if(_0x5065f1){_0x249cdc=_0x5065f1;if(_0x43e1c1[_0xaa30('0x9c')]){if(_0x43e1c1[_0xaa30('0x9c')][_0xaa30('0x9e')]['length']){return _0x43e1c1[_0xaa30('0x9c')]['Contacts'][0x0];}else{return db[_0xaa30('0x9d')][_0xaa30('0x5e')](_['defaults'](_0x3c0a6a[_0xaa30('0x5a')],{'firstName':_0x3c0a6a[_0xaa30('0x5a')]['to'],'email':_0x3c0a6a[_0xaa30('0x5a')]['to'],'phone':_0x3c0a6a['body']['to'],'ListId':_0x43e1c1[_0xaa30('0x6c')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xaa30('0x32')](function(_0x389772){if(_0x389772){var _0x361f53={'UserId':_0x3c0a6a[_0xaa30('0x71')]['id'],'ContactId':_0x389772['id'],'MailAccountId':_0x43e1c1['id'],'inReplyTo':_0x249cdc[_0xaa30('0xac')],'to':_0x3c0a6a['body'][_0xaa30('0xa1')],'cc':_0x3c0a6a[_0xaa30('0x5a')]['cc'],'subject':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xad')],'attach':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xae')],'firstMsgDirection':_0xaa30('0xaf'),'lastMsgAt':moment()[_0xaa30('0x99')](_0xaa30('0x9a')),'lastMsgDirection':_0xaa30('0xaf'),'lastMsgBody':_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0x5a')],'Messages':[_['merge'](_0x3c0a6a[_0xaa30('0x5a')],{'messageId':_0x249cdc[_0xaa30('0xac')],'sentAt':moment()['format'](_0xaa30('0x9a')),'read':!![],'MailAccountId':_0x43e1c1['id'],'UserId':_0x3c0a6a[_0xaa30('0x71')]['id'],'ContactId':_0x389772['id']})]};if(_0x3c0a6a['body']['Interaction']){_0x361f53=_['merge'](_0x361f53,_0x3c0a6a[_0xaa30('0x5a')][_0xaa30('0xb0')]);}return db[_0xaa30('0x87')][_0xaa30('0x5e')](_0x361f53,{'include':[{'model':db['MailMessage'],'as':_0xaa30('0xb1')}]});}})[_0xaa30('0x32')](respondWithResult(_0x478a2f,null))[_0xaa30('0x27')](handleError(_0x478a2f,null));};exports[_0xaa30('0xb2')]=function(_0x2c8b64,_0xdaad2d,_0x9ed777){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x2c8b64[_0xaa30('0x5b')]['id']},'include':[{'model':db[_0xaa30('0x3c')],'as':_0xaa30('0x57'),'raw':!![]}]})[_0xaa30('0x32')](handleEntityNotFound(_0xdaad2d,null))[_0xaa30('0x32')](function(_0x965a92){if(_0x965a92&&_0x965a92[_0xaa30('0x57')]){var _0x8d4e59={'id':_0x965a92['id'],'tls':{'rejectUnauthorized':![]}};if(_0x965a92['Smtp'][_0xaa30('0x77')]){_0x8d4e59[_0xaa30('0x77')]=_0x965a92['Smtp'][_0xaa30('0x77')];}else{_0x8d4e59['host']=_0x965a92[_0xaa30('0x57')][_0xaa30('0x75')];_0x8d4e59[_0xaa30('0x76')]=_0x965a92['Smtp'][_0xaa30('0x76')];_0x8d4e59[_0xaa30('0xa8')]=_0x965a92[_0xaa30('0x57')][_0xaa30('0xa8')];}if(_0x965a92[_0xaa30('0x57')][_0xaa30('0xa6')]){_0x8d4e59[_0xaa30('0xa7')]={'user':_0x965a92['Smtp'][_0xaa30('0x71')],'pass':_0x965a92[_0xaa30('0x57')]['pass']};}return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x8d4e59});}})[_0xaa30('0x32')](respondWithResult(_0xdaad2d,null))[_0xaa30('0x27')](handleError(_0xdaad2d,null));};exports[_0xaa30('0xb3')]=function(_0x1235fb,_0x21540d){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x1235fb['params']['id']}})['then'](handleEntityNotFound(_0x21540d,null))[_0xaa30('0x32')](function(_0x355e22){if(_0x355e22&&_0x355e22['service']){throw new db['Sequelize']['ValidationError']('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x355e22;})[_0xaa30('0x32')](removeEntity(_0x21540d,null))[_0xaa30('0x27')](handleError(_0x21540d,null));};exports['addAgents']=function(_0x236319,_0x4a0607,_0x3b77eb){return db[_0xaa30('0x3f')][_0xaa30('0x59')]({'where':{'id':_0x236319[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x4a0607,null))[_0xaa30('0x32')](function(_0x312c94){if(_0x312c94){return _0x312c94[_0xaa30('0xb4')](_0x236319['body']['ids'],_[_0xaa30('0x89')](_0x236319['body'],[_0xaa30('0x8a'),'id'])||{})['spread'](function(_0x41f17f){for(var _0xabacee=0x0;_0xabacee<_0x236319[_0xaa30('0x5a')]['ids']['length'];_0xabacee+=0x1){socket[_0xaa30('0xb5')](_0xaa30('0xb6'),{'UserId':_0x236319[_0xaa30('0x5a')]['ids'][_0xabacee],'MailAccountId':_0x236319[_0xaa30('0x5b')]['id']});}return _0x41f17f;});}})['then'](respondWithResult(_0x4a0607,null))[_0xaa30('0x27')](handleError(_0x4a0607,null));};exports['removeAgents']=function(_0x1703f2,_0x416f4d,_0xcd26df){return db['MailAccount'][_0xaa30('0x59')]({'where':{'id':_0x1703f2[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x416f4d,null))[_0xaa30('0x32')](function(_0x425865){if(_0x425865){return _0x425865[_0xaa30('0xb7')](_0x1703f2['query'][_0xaa30('0x8a')])[_0xaa30('0x32')](function(){if(_[_0xaa30('0xb8')](_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')])){for(var _0x21048c=0x0;_0x21048c<_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')][_0xaa30('0x69')];_0x21048c+=0x1){socket[_0xaa30('0xb5')]('userMailAccount:remove',{'UserId':Number(_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')][_0x21048c]),'MailAccountId':Number(_0x1703f2[_0xaa30('0x5b')]['id'])});}}else{socket[_0xaa30('0xb5')](_0xaa30('0xb9'),{'UserId':Number(_0x1703f2[_0xaa30('0x42')][_0xaa30('0x8a')]),'MailAccountId':Number(_0x1703f2[_0xaa30('0x5b')]['id'])});}});}})[_0xaa30('0x32')](respondWithStatusCode(_0x416f4d,null))[_0xaa30('0x27')](handleError(_0x416f4d,null));};exports['getAgents']=function(_0x49d8fa,_0x430607,_0x11f771){var _0x4b20cd={};var _0x3a2449={};var _0x164c78;var _0xd182cc;return db['MailAccount'][_0xaa30('0x68')]({'where':{'id':_0x49d8fa[_0xaa30('0x5b')]['id']}})[_0xaa30('0x32')](handleEntityNotFound(_0x430607,null))[_0xaa30('0x32')](function(_0xf9158b){if(_0xf9158b){_0x164c78=_0xf9158b;_0x3a2449['model']=_['keys'](db[_0xaa30('0x8b')]['rawAttributes']);_0x3a2449['query']=_['keys'](_0x49d8fa[_0xaa30('0x42')]);_0x3a2449[_0xaa30('0x49')]=_['intersection'](_0x3a2449[_0xaa30('0x40')],_0x3a2449['query']);_0x4b20cd[_0xaa30('0x44')]=_[_0xaa30('0x43')](_0x3a2449[_0xaa30('0x40')],qs['fields'](_0x49d8fa[_0xaa30('0x42')][_0xaa30('0x45')]));_0x4b20cd[_0xaa30('0x44')]=_0x4b20cd[_0xaa30('0x44')][_0xaa30('0x69')]?_0x4b20cd[_0xaa30('0x44')]:_0x3a2449[_0xaa30('0x40')];_0x4b20cd[_0xaa30('0x47')]=qs[_0xaa30('0x48')](_0x49d8fa[_0xaa30('0x42')]['sort']);_0x4b20cd[_0xaa30('0x53')]=qs['filters'](_[_0xaa30('0x4a')](_0x49d8fa[_0xaa30('0x42')],_0x3a2449[_0xaa30('0x49')]));if(_0x49d8fa[_0xaa30('0x42')][_0xaa30('0x51')]){_0x4b20cd[_0xaa30('0x53')]=_[_0xaa30('0x4b')](_0x4b20cd['where'],{'$or':_[_0xaa30('0x4c')](_0x4b20cd[_0xaa30('0x44')],function(_0x2d6171){var _0x3555cf={};_0x3555cf[_0x2d6171]={'$like':'%'+_0x49d8fa['query'][_0xaa30('0x51')]+'%'};return _0x3555cf;})});}_0x4b20cd=_[_0xaa30('0x4b')]({},_0x4b20cd,_0x49d8fa[_0xaa30('0x52')]);return _0x164c78[_0xaa30('0xba')](_0x4b20cd);}})[_0xaa30('0x32')](function(_0x3d50d0){if(_0x3d50d0){_0xd182cc=_0x3d50d0[_0xaa30('0x69')];if(!_0x49d8fa['query'][_0xaa30('0x62')](_0xaa30('0x46'))){_0x4b20cd[_0xaa30('0x2d')]=qs[_0xaa30('0x2d')](_0x49d8fa['query'][_0xaa30('0x2d')]);_0x4b20cd[_0xaa30('0x2c')]=qs['offset'](_0x49d8fa[_0xaa30('0x42')][_0xaa30('0x2c')]);}return _0x164c78['getAgents'](_0x4b20cd);}})[_0xaa30('0x32')](function(_0x5bc808){if(_0x5bc808){return _0x5bc808?{'count':_0xd182cc,'rows':_0x5bc808}:null;}})[_0xaa30('0x32')](respondWithResult(_0x430607,null))[_0xaa30('0x27')](handleError(_0x430607,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 183b154..14ecd21 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 _0xe4fb=['exports','events','MailAccount','update','remove','emit','hook'];(function(_0x2fe395,_0x5c3817){var _0xa8cf24=function(_0x2e13cf){while(--_0x2e13cf){_0x2fe395['push'](_0x2fe395['shift']());}};_0xa8cf24(++_0x5c3817);}(_0xe4fb,0x158));var _0xbe4f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe4fb[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0xbe4f('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xbe4f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe4f('0x2'),'afterDestroy':_0xbe4f('0x3')};function emitEvent(_0x4c0dc4){return function(_0x3f111e,_0x40400a,_0xc04237){MailAccountEvents[_0xbe4f('0x4')](_0x4c0dc4+':'+_0x3f111e['id'],_0x3f111e);MailAccountEvents[_0xbe4f('0x4')](_0x4c0dc4,_0x3f111e);_0xc04237(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xbe4f('0x5')](e,emitEvent(event));}}module[_0xbe4f('0x6')]=MailAccountEvents; \ No newline at end of file +var _0x1a83=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners'];(function(_0x3b9fdf,_0x143f0b){var _0xd3bbd0=function(_0x4c4f61){while(--_0x4c4f61){_0x3b9fdf['push'](_0x3b9fdf['shift']());}};_0xd3bbd0(++_0x143f0b);}(_0x1a83,0x195));var _0x31a8=function(_0xa0383e,_0x3fb760){_0xa0383e=_0xa0383e-0x0;var _0xcfbbf=_0x1a83[_0xa0383e];return _0xcfbbf;};'use strict';var EventEmitter=require(_0x31a8('0x0'));var MailAccount=require(_0x31a8('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x31a8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x31a8('0x3'),'afterDestroy':_0x31a8('0x4')};function emitEvent(_0x34056d){return function(_0x46c0b9,_0x3aeab8,_0xc38f19){MailAccountEvents[_0x31a8('0x5')](_0x34056d+':'+_0x46c0b9['id'],_0x46c0b9);MailAccountEvents['emit'](_0x34056d,_0x46c0b9);_0xc38f19(null);};}for(var e in events){if(events[_0x31a8('0x6')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x31a8('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 5200d79..c097974 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 _0x5eef=['./mailAccount.attributes','define','MailAccount','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2b4609,_0x1cfe42){var _0x1ff663=function(_0x349860){while(--_0x349860){_0x2b4609['push'](_0x2b4609['shift']());}};_0x1ff663(++_0x1cfe42);}(_0x5eef,0x9c));var _0xf5ee=function(_0x2a4475,_0x3cb123){_0x2a4475=_0x2a4475-0x0;var _0x3ec19b=_0x5eef[_0x2a4475];return _0x3ec19b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf5ee('0x0'))('api');var moment=require(_0xf5ee('0x1'));var BPromise=require('bluebird');var rp=require(_0xf5ee('0x2'));var fs=require('fs');var path=require(_0xf5ee('0x3'));var rimraf=require(_0xf5ee('0x4'));var config=require(_0xf5ee('0x5'));var attributes=require(_0xf5ee('0x6'));module['exports']=function(_0x4d4175,_0x594128){return _0x4d4175[_0xf5ee('0x7')](_0xf5ee('0x8'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04d5=['moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','lodash','util','api'];(function(_0x549cb9,_0x4eac7f){var _0x42049c=function(_0x48b040){while(--_0x48b040){_0x549cb9['push'](_0x549cb9['shift']());}};_0x42049c(++_0x4eac7f);}(_0x04d5,0xe1));var _0x504d=function(_0x588582,_0x437d17){_0x588582=_0x588582-0x0;var _0x6a6800=_0x04d5[_0x588582];return _0x6a6800;};'use strict';var _=require(_0x504d('0x0'));var util=require(_0x504d('0x1'));var logger=require('../../config/logger')(_0x504d('0x2'));var moment=require(_0x504d('0x3'));var BPromise=require(_0x504d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x504d('0x5'));var rimraf=require(_0x504d('0x6'));var config=require(_0x504d('0x7'));var attributes=require(_0x504d('0x8'));module[_0x504d('0x9')]=function(_0x535671,_0x289d44){return _0x535671[_0x504d('0xa')](_0x504d('0xb'),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 4bf1126..21e5a71 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 _0xfda1=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','raw','where','limit','include','map','model','attributes','stringify','ShowMailAccount','find','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','from','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','List','Contacts','DESC','MailApplication','Smtp','get','omit','Applications','applications','list','orderBy','priority','asc','account','push','length','close','create','List\x20not\x20found','contact','messageId','generate','subject','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','attach','format','YYYY-MM-DD\x20HH:mm:ss','interaction','created','attachments','originTo','originCc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','lodash','util','moment','randomstring','ioredis'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xfda1,0xc5));var _0x1fda=function(_0x548657,_0x479937){_0x548657=_0x548657-0x0;var _0x8e3ae5=_0xfda1[_0x548657];return _0x8e3ae5;};'use strict';var _=require(_0x1fda('0x0'));var util=require(_0x1fda('0x1'));var moment=require(_0x1fda('0x2'));var BPromise=require('bluebird');var rs=require(_0x1fda('0x3'));var fs=require('fs');var Redis=require(_0x1fda('0x4'));var db=require(_0x1fda('0x5'))['db'];var utils=require(_0x1fda('0x6'));var logger=require(_0x1fda('0x7'))('rpc');var config=require(_0x1fda('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0x1fda('0x9')](config[_0x1fda('0xa')],{'host':_0x1fda('0xb'),'port':0x18eb});var socket=require(_0x1fda('0xc'))(new Redis(config[_0x1fda('0xa')]));require('./mailAccount.socket')[_0x1fda('0xd')](socket);function respondWithRpcPromise(_0x2c3af7,_0x3a1ada,_0x28560d){return new BPromise(function(_0x525c40,_0x1c8e26){return client[_0x1fda('0xe')](_0x2c3af7,_0x28560d)[_0x1fda('0xf')](function(_0x2c2322){logger[_0x1fda('0x10')](_0x1fda('0x11'),_0x3a1ada,_0x1fda('0x12'));logger[_0x1fda('0x13')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x3a1ada,_0x1fda('0x12'),JSON['stringify'](_0x2c2322));if(_0x2c2322['error']){if(_0x2c2322[_0x1fda('0x14')][_0x1fda('0x15')]===0x1f4){logger[_0x1fda('0x14')]('MailAccount,\x20%s,\x20%s',_0x3a1ada,_0x2c2322[_0x1fda('0x14')][_0x1fda('0x16')]);return _0x1c8e26(_0x2c2322[_0x1fda('0x14')][_0x1fda('0x16')]);}logger[_0x1fda('0x14')](_0x1fda('0x11'),_0x3a1ada,_0x2c2322['error'][_0x1fda('0x16')]);return _0x525c40(_0x2c2322[_0x1fda('0x14')]['message']);}else{logger['info'](_0x1fda('0x11'),_0x3a1ada,_0x1fda('0x12'));_0x525c40(_0x2c2322['result'][_0x1fda('0x16')]);}})[_0x1fda('0x17')](function(_0x19679d){logger[_0x1fda('0x14')](_0x1fda('0x11'),_0x3a1ada,_0x19679d);_0x1c8e26(_0x19679d);});});}exports[_0x1fda('0x18')]=function(_0x2b5eb8){var _0x45c17f=this;return new Promise(function(_0x207d6b,_0x4358b6){return db[_0x1fda('0x19')][_0x1fda('0x1a')]({'raw':_0x2b5eb8[_0x1fda('0x1b')]?_0x2b5eb8[_0x1fda('0x1b')][_0x1fda('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b5eb8[_0x1fda('0x1b')]?_0x2b5eb8[_0x1fda('0x1b')][_0x1fda('0x1d')]||null:null,'attributes':_0x2b5eb8[_0x1fda('0x1b')]?_0x2b5eb8[_0x1fda('0x1b')]['attributes']||null:null,'limit':_0x2b5eb8['options']?_0x2b5eb8['options'][_0x1fda('0x1e')]||null:null,'include':_0x2b5eb8['options']?_0x2b5eb8['options'][_0x1fda('0x1f')]?_[_0x1fda('0x20')](_0x2b5eb8[_0x1fda('0x1b')][_0x1fda('0x1f')],function(_0x48b595){return{'model':db[_0x48b595[_0x1fda('0x21')]],'as':_0x48b595['as'],'attributes':_0x48b595[_0x1fda('0x22')],'include':_0x48b595[_0x1fda('0x1f')]?_[_0x1fda('0x20')](_0x48b595['include'],function(_0x313926){return{'model':db[_0x313926[_0x1fda('0x21')]],'as':_0x313926['as'],'attributes':_0x313926['attributes'],'include':_0x313926[_0x1fda('0x1f')]?_[_0x1fda('0x20')](_0x313926[_0x1fda('0x1f')],function(_0x236761){return{'model':db[_0x236761[_0x1fda('0x21')]],'as':_0x236761['as'],'attributes':_0x236761[_0x1fda('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d8ad4){logger[_0x1fda('0x10')](_0x1fda('0x18'),_0x2b5eb8);logger[_0x1fda('0x13')]('GetMailAccount',_0x2b5eb8,JSON[_0x1fda('0x23')](_0x3d8ad4));_0x207d6b(_0x3d8ad4);})[_0x1fda('0x17')](function(_0x442740){logger[_0x1fda('0x14')](_0x1fda('0x18'),_0x442740[_0x1fda('0x16')],_0x2b5eb8);_0x4358b6(_0x45c17f[_0x1fda('0x14')](0x1f4,_0x442740[_0x1fda('0x16')]));});});};exports[_0x1fda('0x24')]=function(_0x3ea338){var _0x4baa68=this;return new Promise(function(_0x168135,_0x17e466){return db[_0x1fda('0x19')][_0x1fda('0x25')]({'raw':_0x3ea338['options']?_0x3ea338[_0x1fda('0x1b')][_0x1fda('0x1c')]===undefined?!![]:![]:!![],'where':_0x3ea338[_0x1fda('0x1b')]?_0x3ea338[_0x1fda('0x1b')][_0x1fda('0x1d')]||null:null,'attributes':_0x3ea338['options']?_0x3ea338[_0x1fda('0x1b')][_0x1fda('0x22')]||null:null,'include':_0x3ea338[_0x1fda('0x1b')]?_0x3ea338[_0x1fda('0x1b')][_0x1fda('0x1f')]?_[_0x1fda('0x20')](_0x3ea338[_0x1fda('0x1b')][_0x1fda('0x1f')],function(_0x1cd80c){return{'model':db[_0x1cd80c['model']],'as':_0x1cd80c['as'],'attributes':_0x1cd80c[_0x1fda('0x22')],'include':_0x1cd80c[_0x1fda('0x1f')]?_[_0x1fda('0x20')](_0x1cd80c[_0x1fda('0x1f')],function(_0x3615ae){return{'model':db[_0x3615ae[_0x1fda('0x21')]],'as':_0x3615ae['as'],'attributes':_0x3615ae[_0x1fda('0x22')],'include':_0x3615ae[_0x1fda('0x1f')]?_['map'](_0x3615ae[_0x1fda('0x1f')],function(_0x53500c){return{'model':db[_0x53500c[_0x1fda('0x21')]],'as':_0x53500c['as'],'attributes':_0x53500c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1fda('0xf')](function(_0x293713){logger[_0x1fda('0x10')]('ShowMailAccount',_0x3ea338);logger['debug'](_0x1fda('0x24'),_0x3ea338,JSON[_0x1fda('0x23')](_0x293713));_0x168135(_0x293713);})[_0x1fda('0x17')](function(_0x396851){logger['error']('ShowMailAccount',_0x396851[_0x1fda('0x16')],_0x3ea338);_0x17e466(_0x4baa68[_0x1fda('0x14')](0x1f4,_0x396851[_0x1fda('0x16')]));});});};exports['NotifyMailAccount']=function(_0x4f34b9){var _0x3c957c=this;return new Promise(function(_0x5cffaf,_0x2d6315){var _0x47c000={'body':_0x4f34b9['body'],'channel':_0x1fda('0x26')};var _0x2f2ab5=_[_0x1fda('0x27')](_['keys'](db[_0x1fda('0x28')][_0x1fda('0x29')]),[_0x1fda('0x2a'),_0x1fda('0x2b'),_0x1fda('0x2c'),_0x1fda('0x2d')]);var _0x4565bf=![];if(_0x4f34b9['body']['id']){delete _0x4f34b9[_0x1fda('0x2e')]['id'];}if(_['isNil'](_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x2f')])){return _0x2d6315(_0x3c957c['error'](0x1f4,_0x1fda('0x30')));}if(_[_0x1fda('0x31')](_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x2e')])||_0x4f34b9['body'][_0x1fda('0x2e')]===''){return _0x2d6315(_0x3c957c[_0x1fda('0x14')](0x1f4,_0x1fda('0x32')));}if(_[_0x1fda('0x31')](_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x33')])){return _0x2d6315(_0x3c957c[_0x1fda('0x14')](0x1f4,_0x1fda('0x34')+_0x2f2ab5));}if(!_['includes'](_0x2f2ab5,_0x4f34b9[_0x1fda('0x2e')]['mapKey'])){return _0x2d6315(_0x3c957c[_0x1fda('0x14')](0x1f4,_0x1fda('0x35')+_0x2f2ab5));}var _0x813316={};_0x813316[_0x4f34b9[_0x1fda('0x2e')]['mapKey']]=_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x2f')];return db[_0x1fda('0x19')][_0x1fda('0x25')]({'where':{'id':_0x4f34b9['account']['id']},'include':[{'model':db[_0x1fda('0x36')],'as':_0x1fda('0x37'),'include':[{'model':db[_0x1fda('0x28')],'as':_0x1fda('0x38'),'where':_0x813316,'limit':0x1,'order':[['updatedAt',_0x1fda('0x39')]]}]},{'model':db[_0x1fda('0x3a')],'as':'Applications'},{'model':db['MailServerOut'],'as':_0x1fda('0x3b')}]})[_0x1fda('0xf')](function(_0xeb06b1){if(_0xeb06b1&&_0xeb06b1['List']){var _0x1d7e84=_0xeb06b1[_0x1fda('0x3c')]({'plain':!![]});_0x47c000['account']=_[_0x1fda('0x3d')](_0x1d7e84,[_0x1fda('0x3e'),_0x1fda('0x37')]);_0x47c000[_0x1fda('0x3f')]=_0x1d7e84[_0x1fda('0x3e')];_0x47c000[_0x1fda('0x40')]=_0x1d7e84['List'];_0x47c000[_0x1fda('0x3f')]=_[_0x1fda('0x41')](_0x47c000[_0x1fda('0x3f')],[_0x1fda('0x42')],[_0x1fda('0x43')]);if(_0x47c000[_0x1fda('0x44')]&&_0x47c000['account']['autoclose']){_0x47c000[_0x1fda('0x3f')][_0x1fda('0x45')]({'id':0x0,'priority':_0x47c000[_0x1fda('0x3f')][_0x1fda('0x46')]+0x1,'app':_0x1fda('0x47'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x47c000[_0x1fda('0x44')][_0x1fda('0x3e')]){delete _0x47c000['account'][_0x1fda('0x3e')];}if(_0x47c000[_0x1fda('0x44')]['List']){delete _0x47c000[_0x1fda('0x44')][_0x1fda('0x37')];}if(_0x1d7e84[_0x1fda('0x37')]['Contacts']['length']){return _0x1d7e84[_0x1fda('0x37')][_0x1fda('0x38')][0x0];}var _0x5ba0cc=_[_0x1fda('0x9')](_0x4f34b9[_0x1fda('0x2e')],{'firstName':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x2f')],'ListId':_0x1d7e84[_0x1fda('0x2d')]});_0x5ba0cc[_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x33')]]=_0x4f34b9['body'][_0x1fda('0x2f')];return db[_0x1fda('0x28')][_0x1fda('0x48')](_0x5ba0cc);}else{throw new Error(_0x1fda('0x49'));}})[_0x1fda('0xf')](function(_0x242b52){_0x47c000[_0x1fda('0x4a')]=_0x242b52;if(_0x242b52){if(!_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x4b')]){_0x4f34b9[_0x1fda('0x2e')]['message'][_0x1fda('0x4b')]=rs[_0x1fda('0x4c')]()+'\x20'+_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x2f')];}var _0x48e298={'ContactId':_0x242b52['id'],'MailAccountId':_0x4f34b9[_0x1fda('0x44')]['id'],'inReplyTo':_0x4f34b9['body']['message'][_0x1fda('0x4b')],'to':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x2f')],'cc':_0x4f34b9['body'][_0x1fda('0x16')]['cc'],'subject':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x4d')],'attach':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')]['attach'],'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x2e')]};return db[_0x1fda('0x4e')][_0x1fda('0x25')]({'where':{'closed':![],'MailAccountId':_0x4f34b9[_0x1fda('0x44')]['id']},'include':[{'model':db[_0x1fda('0x4f')],'as':'Messages','attributes':['messageId'],'where':{'messageId':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x50')]}}]})[_0x1fda('0xf')](function(_0x4ec144){if(_0x4ec144){return[_0x4ec144,![]];}return db[_0x1fda('0x4e')][_0x1fda('0x48')](_0x48e298)[_0x1fda('0xf')](function(_0x30180c){return[_0x30180c,!![]];});});}else{throw new Error(_0x1fda('0x51'));}})[_0x1fda('0x52')](function(_0x357902,_0x31d12b){if(_0x357902){_0x4565bf=_0x31d12b;if(!_0x31d12b){return _0x357902[_0x1fda('0x53')]({'inReplyTo':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x4b')],'to':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x2f')],'cc':_0x4f34b9['body']['message']['cc'],'subject':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')]['subject'],'attach':_0x357902[_0x1fda('0x54')]?_0x357902['attach']:_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')]['attach'],'substatus':null,'substatusAt':moment()[_0x1fda('0x55')](_0x1fda('0x56')),'lastMsgAt':moment()[_0x1fda('0x55')](_0x1fda('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x2e')]});}else{return _0x357902;}}})[_0x1fda('0xf')](function(_0x3ad847){_0x47c000['interaction']=_0x3ad847[_0x1fda('0x3c')]({'plain':!![]});_0x47c000[_0x1fda('0x57')][_0x1fda('0x58')]=_0x4565bf;return db[_0x1fda('0x4f')][_0x1fda('0x48')]({'body':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x2e')],'MailAccountId':_0x4f34b9[_0x1fda('0x44')]['id'],'MailInteractionId':_0x3ad847['id'],'direction':'in','ContactId':_0x47c000[_0x1fda('0x4a')]['id'],'messageId':_0x4f34b9[_0x1fda('0x2e')]['message'][_0x1fda('0x4b')],'from':_0x4f34b9[_0x1fda('0x2e')]['message']['from'],'to':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')]['to'],'cc':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')]['cc'],'subject':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x4d')],'attach':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x54')],'Attachments':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x59')],'originTo':_0x4f34b9[_0x1fda('0x2e')][_0x1fda('0x16')][_0x1fda('0x5a')],'originCc':_0x4f34b9[_0x1fda('0x2e')]['message'][_0x1fda('0x5b')],'bcc':_0x4f34b9['body'][_0x1fda('0x16')]['bcc']},{'include':[{'model':db[_0x1fda('0x5c')],'as':_0x1fda('0x5d')}]});})[_0x1fda('0xf')](function(_0x4a1fb5){_0x47c000[_0x1fda('0x16')]=_0x4a1fb5;if(_0x47c000[_0x1fda('0x57')][_0x1fda('0x5e')]){return db[_0x1fda('0x5f')][_0x1fda('0x25')]({'attributes':['id',_0x1fda('0x60')],'where':{'id':_0x47c000[_0x1fda('0x57')][_0x1fda('0x5e')]}})['then'](function(_0x4c4c1d){if(_0x4c4c1d){_0x47c000['applications'][_0x1fda('0x61')]({'id':0x0,'priority':0x0,'app':_0x1fda('0x62'),'appdata':_0x4c4c1d[_0x1fda('0x60')]+','+(_0x47c000[_0x1fda('0x44')][_0x1fda('0x63')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1fda('0x64'),'startRouting',_0x47c000);});}return respondWithRpcPromise(_0x1fda('0x64'),'startRouting',_0x47c000);})['then'](function(_0x4a77a5){_0x5cffaf(_0x4a77a5);})[_0x1fda('0x17')](function(_0x300c8e){_0x2d6315(_0x3c957c[_0x1fda('0x14')](0x1f4,_0x300c8e['message']));});});}; \ No newline at end of file +var _0xd81c=['contact','messageId','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','find','ShowMailAccount','body','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','DESC','MailApplication','Applications','MailServerOut','Smtp','omit','List','applications','list','priority','asc','autoclose','close','*,*,*,*','length','Contacts','ListId','List\x20not\x20found'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xd81c,0xed));var _0xcd81=function(_0x2057c4,_0x1e9fa5){_0x2057c4=_0x2057c4-0x0;var _0x57ce25=_0xd81c[_0x2057c4];return _0x57ce25;};'use strict';var _=require(_0xcd81('0x0'));var util=require(_0xcd81('0x1'));var moment=require(_0xcd81('0x2'));var BPromise=require(_0xcd81('0x3'));var rs=require(_0xcd81('0x4'));var fs=require('fs');var Redis=require(_0xcd81('0x5'));var db=require(_0xcd81('0x6'))['db'];var utils=require(_0xcd81('0x7'));var logger=require(_0xcd81('0x8'))(_0xcd81('0x9'));var config=require(_0xcd81('0xa'));var jayson=require(_0xcd81('0xb'));var client=jayson['client'][_0xcd81('0xc')]({'port':0x232c});config['redis']=_[_0xcd81('0xd')](config[_0xcd81('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd81('0xf'))(new Redis(config[_0xcd81('0xe')]));require(_0xcd81('0x10'))['register'](socket);function respondWithRpcPromise(_0x6a04b1,_0x5801e9,_0x3ecfa0){return new BPromise(function(_0x1b8f11,_0x3a755f){return client[_0xcd81('0x11')](_0x6a04b1,_0x3ecfa0)['then'](function(_0x406c5e){logger[_0xcd81('0x12')](_0xcd81('0x13'),_0x5801e9,_0xcd81('0x14'));logger['debug'](_0xcd81('0x15'),_0x5801e9,_0xcd81('0x14'),JSON[_0xcd81('0x16')](_0x406c5e));if(_0x406c5e[_0xcd81('0x17')]){if(_0x406c5e['error'][_0xcd81('0x18')]===0x1f4){logger[_0xcd81('0x17')]('MailAccount,\x20%s,\x20%s',_0x5801e9,_0x406c5e[_0xcd81('0x17')][_0xcd81('0x19')]);return _0x3a755f(_0x406c5e['error'][_0xcd81('0x19')]);}logger[_0xcd81('0x17')]('MailAccount,\x20%s,\x20%s',_0x5801e9,_0x406c5e[_0xcd81('0x17')][_0xcd81('0x19')]);return _0x1b8f11(_0x406c5e[_0xcd81('0x17')][_0xcd81('0x19')]);}else{logger['info'](_0xcd81('0x13'),_0x5801e9,'request\x20sent');_0x1b8f11(_0x406c5e[_0xcd81('0x1a')]['message']);}})[_0xcd81('0x1b')](function(_0x6d3345){logger[_0xcd81('0x17')](_0xcd81('0x13'),_0x5801e9,_0x6d3345);_0x3a755f(_0x6d3345);});});}exports[_0xcd81('0x1c')]=function(_0x45e5f2){var _0x2c24c2=this;return new Promise(function(_0x44bbc5,_0xbeadb6){return db[_0xcd81('0x1d')][_0xcd81('0x1e')]({'raw':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x20')]===undefined?!![]:![]:!![],'where':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x21')]||null:null,'attributes':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x22')]||null:null,'limit':_0x45e5f2[_0xcd81('0x1f')]?_0x45e5f2[_0xcd81('0x1f')][_0xcd81('0x23')]||null:null,'include':_0x45e5f2['options']?_0x45e5f2['options'][_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x45e5f2['options'][_0xcd81('0x24')],function(_0x438d32){return{'model':db[_0x438d32[_0xcd81('0x26')]],'as':_0x438d32['as'],'attributes':_0x438d32[_0xcd81('0x22')],'include':_0x438d32[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x438d32[_0xcd81('0x24')],function(_0x1a3315){return{'model':db[_0x1a3315[_0xcd81('0x26')]],'as':_0x1a3315['as'],'attributes':_0x1a3315[_0xcd81('0x22')],'include':_0x1a3315[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x1a3315[_0xcd81('0x24')],function(_0x51ae1e){return{'model':db[_0x51ae1e['model']],'as':_0x51ae1e['as'],'attributes':_0x51ae1e[_0xcd81('0x22')]};}):[]};}):[]};}):[]:[]})[_0xcd81('0x27')](function(_0x25432f){logger['info'](_0xcd81('0x1c'),_0x45e5f2);logger[_0xcd81('0x28')](_0xcd81('0x1c'),_0x45e5f2,JSON[_0xcd81('0x16')](_0x25432f));_0x44bbc5(_0x25432f);})[_0xcd81('0x1b')](function(_0x595a69){logger[_0xcd81('0x17')](_0xcd81('0x1c'),_0x595a69[_0xcd81('0x19')],_0x45e5f2);_0xbeadb6(_0x2c24c2[_0xcd81('0x17')](0x1f4,_0x595a69[_0xcd81('0x19')]));});});};exports['ShowMailAccount']=function(_0x54791f){var _0x50137a=this;return new Promise(function(_0x2bec29,_0x50b980){return db[_0xcd81('0x1d')][_0xcd81('0x29')]({'raw':_0x54791f['options']?_0x54791f[_0xcd81('0x1f')][_0xcd81('0x20')]===undefined?!![]:![]:!![],'where':_0x54791f[_0xcd81('0x1f')]?_0x54791f[_0xcd81('0x1f')][_0xcd81('0x21')]||null:null,'attributes':_0x54791f[_0xcd81('0x1f')]?_0x54791f['options'][_0xcd81('0x22')]||null:null,'include':_0x54791f[_0xcd81('0x1f')]?_0x54791f[_0xcd81('0x1f')][_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x54791f[_0xcd81('0x1f')][_0xcd81('0x24')],function(_0x1b7904){return{'model':db[_0x1b7904['model']],'as':_0x1b7904['as'],'attributes':_0x1b7904['attributes'],'include':_0x1b7904[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x1b7904['include'],function(_0x2b0013){return{'model':db[_0x2b0013[_0xcd81('0x26')]],'as':_0x2b0013['as'],'attributes':_0x2b0013[_0xcd81('0x22')],'include':_0x2b0013[_0xcd81('0x24')]?_[_0xcd81('0x25')](_0x2b0013[_0xcd81('0x24')],function(_0x357f0f){return{'model':db[_0x357f0f[_0xcd81('0x26')]],'as':_0x357f0f['as'],'attributes':_0x357f0f['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd81('0x27')](function(_0x48f45b){logger['info'](_0xcd81('0x2a'),_0x54791f);logger[_0xcd81('0x28')](_0xcd81('0x2a'),_0x54791f,JSON[_0xcd81('0x16')](_0x48f45b));_0x2bec29(_0x48f45b);})['catch'](function(_0x1f4914){logger['error'](_0xcd81('0x2a'),_0x1f4914['message'],_0x54791f);_0x50b980(_0x50137a[_0xcd81('0x17')](0x1f4,_0x1f4914[_0xcd81('0x19')]));});});};exports['NotifyMailAccount']=function(_0x500834){var _0x163c13=this;return new Promise(function(_0x12508b,_0x2b861a){var _0x18bf1c={'body':_0x500834[_0xcd81('0x2b')],'channel':'mail'};var _0x514b79=_[_0xcd81('0x2c')](_[_0xcd81('0x2d')](db[_0xcd81('0x2e')][_0xcd81('0x2f')]),['createdAt',_0xcd81('0x30'),_0xcd81('0x31'),'ListId']);var _0x2e4c10=![];if(_0x500834[_0xcd81('0x2b')]['id']){delete _0x500834[_0xcd81('0x2b')]['id'];}if(_[_0xcd81('0x32')](_0x500834['body'][_0xcd81('0x33')])){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x34')));}if(_[_0xcd81('0x32')](_0x500834[_0xcd81('0x2b')][_0xcd81('0x2b')])||_0x500834['body'][_0xcd81('0x2b')]===''){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x35')));}if(_[_0xcd81('0x32')](_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')])){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x37')+_0x514b79));}if(!_[_0xcd81('0x38')](_0x514b79,_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')])){return _0x2b861a(_0x163c13[_0xcd81('0x17')](0x1f4,_0xcd81('0x39')+_0x514b79));}var _0x948a60={};_0x948a60[_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')]]=_0x500834[_0xcd81('0x2b')][_0xcd81('0x33')];return db[_0xcd81('0x1d')][_0xcd81('0x29')]({'where':{'id':_0x500834[_0xcd81('0x3a')]['id']},'include':[{'model':db[_0xcd81('0x3b')],'as':'List','include':[{'model':db[_0xcd81('0x2e')],'as':'Contacts','where':_0x948a60,'limit':0x1,'order':[[_0xcd81('0x30'),_0xcd81('0x3c')]]}]},{'model':db[_0xcd81('0x3d')],'as':_0xcd81('0x3e')},{'model':db[_0xcd81('0x3f')],'as':_0xcd81('0x40')}]})[_0xcd81('0x27')](function(_0x385600){if(_0x385600&&_0x385600['List']){var _0x427e93=_0x385600['get']({'plain':!![]});_0x18bf1c['account']=_[_0xcd81('0x41')](_0x427e93,['Applications',_0xcd81('0x42')]);_0x18bf1c[_0xcd81('0x43')]=_0x427e93['Applications'];_0x18bf1c[_0xcd81('0x44')]=_0x427e93[_0xcd81('0x42')];_0x18bf1c['applications']=_['orderBy'](_0x18bf1c[_0xcd81('0x43')],[_0xcd81('0x45')],[_0xcd81('0x46')]);if(_0x18bf1c['account']&&_0x18bf1c['account'][_0xcd81('0x47')]){_0x18bf1c[_0xcd81('0x43')]['push']({'id':0x0,'priority':_0x18bf1c[_0xcd81('0x43')]['length']+0x1,'app':_0xcd81('0x48'),'appdata':_0xcd81('0x47'),'interval':_0xcd81('0x49')});}if(_0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x3e')]){delete _0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x3e')];}if(_0x18bf1c[_0xcd81('0x3a')]['List']){delete _0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x42')];}if(_0x427e93[_0xcd81('0x42')]['Contacts'][_0xcd81('0x4a')]){return _0x427e93[_0xcd81('0x42')][_0xcd81('0x4b')][0x0];}var _0x42dc52=_[_0xcd81('0xd')](_0x500834[_0xcd81('0x2b')],{'firstName':_0x500834[_0xcd81('0x2b')][_0xcd81('0x33')],'ListId':_0x427e93[_0xcd81('0x4c')]});_0x42dc52[_0x500834[_0xcd81('0x2b')][_0xcd81('0x36')]]=_0x500834[_0xcd81('0x2b')]['from'];return db[_0xcd81('0x2e')]['create'](_0x42dc52);}else{throw new Error(_0xcd81('0x4d'));}})[_0xcd81('0x27')](function(_0x2d8932){_0x18bf1c[_0xcd81('0x4e')]=_0x2d8932;if(_0x2d8932){if(!_0x500834['body'][_0xcd81('0x19')]['messageId']){_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x4f')]=rs['generate']()+'\x20'+_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x33')];}var _0x472f8e={'ContactId':_0x2d8932['id'],'MailAccountId':_0x500834['account']['id'],'inReplyTo':_0x500834[_0xcd81('0x2b')]['message'][_0xcd81('0x4f')],'to':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['from'],'cc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['cc'],'subject':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x50')],'attach':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x51')],'lastMsgAt':moment()[_0xcd81('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x500834[_0xcd81('0x2b')]['body']};return db[_0xcd81('0x53')][_0xcd81('0x29')]({'where':{'closed':![],'MailAccountId':_0x500834['account']['id']},'include':[{'model':db[_0xcd81('0x54')],'as':_0xcd81('0x55'),'attributes':[_0xcd81('0x4f')],'where':{'messageId':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x56')]}}]})[_0xcd81('0x27')](function(_0x23e543){if(_0x23e543){return[_0x23e543,![]];}return db[_0xcd81('0x53')][_0xcd81('0x57')](_0x472f8e)['then'](function(_0xe32c9e){return[_0xe32c9e,!![]];});});}else{throw new Error(_0xcd81('0x58'));}})[_0xcd81('0x59')](function(_0x118233,_0x5b9b05){if(_0x118233){_0x2e4c10=_0x5b9b05;if(!_0x5b9b05){return _0x118233[_0xcd81('0x5a')]({'inReplyTo':_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x4f')],'to':_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x33')],'cc':_0x500834[_0xcd81('0x2b')]['message']['cc'],'subject':_0x500834['body']['message'][_0xcd81('0x50')],'attach':_0x118233['attach']?_0x118233[_0xcd81('0x51')]:_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x51')],'substatus':null,'substatusAt':moment()[_0xcd81('0x52')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xcd81('0x52')](_0xcd81('0x5b')),'lastMsgDirection':'in','lastMsgBody':_0x500834[_0xcd81('0x2b')]['body']});}else{return _0x118233;}}})[_0xcd81('0x27')](function(_0x4208c4){_0x18bf1c[_0xcd81('0x5c')]=_0x4208c4['get']({'plain':!![]});_0x18bf1c[_0xcd81('0x5c')]['created']=_0x2e4c10;return db['MailMessage']['create']({'body':_0x500834[_0xcd81('0x2b')]['body'],'MailAccountId':_0x500834[_0xcd81('0x3a')]['id'],'MailInteractionId':_0x4208c4['id'],'direction':'in','ContactId':_0x18bf1c['contact']['id'],'messageId':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x4f')],'from':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x33')],'to':_0x500834['body'][_0xcd81('0x19')]['to'],'cc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['cc'],'subject':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x50')],'attach':_0x500834[_0xcd81('0x2b')]['message'][_0xcd81('0x51')],'Attachments':_0x500834[_0xcd81('0x2b')]['message'][_0xcd81('0x5d')],'originTo':_0x500834['body'][_0xcd81('0x19')][_0xcd81('0x5e')],'originCc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')][_0xcd81('0x5f')],'bcc':_0x500834[_0xcd81('0x2b')][_0xcd81('0x19')]['bcc']},{'include':[{'model':db[_0xcd81('0x60')],'as':'Attachments'}]});})[_0xcd81('0x27')](function(_0x7b5b3d){_0x18bf1c[_0xcd81('0x19')]=_0x7b5b3d;if(_0x18bf1c[_0xcd81('0x5c')][_0xcd81('0x61')]){return db[_0xcd81('0x62')][_0xcd81('0x29')]({'attributes':['id',_0xcd81('0x63')],'where':{'id':_0x18bf1c[_0xcd81('0x5c')][_0xcd81('0x61')]}})[_0xcd81('0x27')](function(_0x1d9180){if(_0x1d9180){_0x18bf1c[_0xcd81('0x43')][_0xcd81('0x64')]({'id':0x0,'priority':0x0,'app':_0xcd81('0x65'),'appdata':_0x1d9180[_0xcd81('0x63')]+','+(_0x18bf1c[_0xcd81('0x3a')][_0xcd81('0x66')]||0xa),'interval':_0xcd81('0x49')});}return respondWithRpcPromise(_0xcd81('0x67'),_0xcd81('0x68'),_0x18bf1c);});}return respondWithRpcPromise(_0xcd81('0x67'),_0xcd81('0x68'),_0x18bf1c);})[_0xcd81('0x27')](function(_0x1d57b7){_0x12508b(_0x1d57b7);})['catch'](function(_0x476425){_0x2b861a(_0x163c13['error'](0x1f4,_0x476425[_0xcd81('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 4fe4d43..a9e9f01 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 _0x1680=['./mailAccount.events','remove','emit','removeListener','register','length','mailAccount:'];(function(_0x5af5d6,_0x537f43){var _0x5210ba=function(_0x5da932){while(--_0x5da932){_0x5af5d6['push'](_0x5af5d6['shift']());}};_0x5210ba(++_0x537f43);}(_0x1680,0x15e));var _0x0168=function(_0x4ca796,_0x10dc47){_0x4ca796=_0x4ca796-0x0;var _0x171f87=_0x1680[_0x4ca796];return _0x171f87;};'use strict';var MailAccountEvents=require(_0x0168('0x0'));var events=['save',_0x0168('0x1'),'update'];function createListener(_0x347c3f,_0x2585a5){return function(_0x351f3b){_0x2585a5[_0x0168('0x2')](_0x347c3f,_0x351f3b);};}function removeListener(_0x252d24,_0x31e864){return function(){MailAccountEvents[_0x0168('0x3')](_0x252d24,_0x31e864);};}exports[_0x0168('0x4')]=function(_0x20ff9e){for(var _0x55271c=0x0,_0x5c08ec=events[_0x0168('0x5')];_0x55271c<_0x5c08ec;_0x55271c++){var _0x2cfe0d=events[_0x55271c];var _0x2501c9=createListener(_0x0168('0x6')+_0x2cfe0d,_0x20ff9e);MailAccountEvents['on'](_0x2cfe0d,_0x2501c9);}}; \ No newline at end of file +var _0xc7d3=['./mailAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3efa3a,_0x5b6097){var _0x4b718d=function(_0x4224d1){while(--_0x4224d1){_0x3efa3a['push'](_0x3efa3a['shift']());}};_0x4b718d(++_0x5b6097);}(_0xc7d3,0x1d0));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0x3c7d('0x0'));var events=[_0x3c7d('0x1'),_0x3c7d('0x2'),_0x3c7d('0x3')];function createListener(_0x3aa791,_0x45e686){return function(_0x59cc93){_0x45e686[_0x3c7d('0x4')](_0x3aa791,_0x59cc93);};}function removeListener(_0x17ef76,_0x1e46f4){return function(){MailAccountEvents[_0x3c7d('0x5')](_0x17ef76,_0x1e46f4);};}exports[_0x3c7d('0x6')]=function(_0x19d2eb){for(var _0x320372=0x0,_0x5c8d38=events[_0x3c7d('0x7')];_0x320372<_0x5c8d38;_0x320372++){var _0x6a2c75=events[_0x320372];var _0x469346=createListener('mailAccount:'+_0x6a2c75,_0x19d2eb);MailAccountEvents['on'](_0x6a2c75,_0x469346);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b205dc4..6890ec7 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 _0x84ab=['../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','update','delete','isAuthenticated','exports','multer','util','path','connect-timeout','express'];(function(_0x2f1f13,_0xbfb5af){var _0x33be0b=function(_0x30ea15){while(--_0x30ea15){_0x2f1f13['push'](_0x2f1f13['shift']());}};_0x33be0b(++_0xbfb5af);}(_0x84ab,0x12f));var _0xb84a=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0x84ab[_0x369151];return _0x4292d5;};'use strict';var multer=require(_0xb84a('0x0'));var util=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var timeout=require(_0xb84a('0x3'));var express=require(_0xb84a('0x4'));var router=express['Router']();var auth=require(_0xb84a('0x5'));var interaction=require(_0xb84a('0x6'));var config=require('../../config/environment');var controller=require(_0xb84a('0x7'));router[_0xb84a('0x8')](_0xb84a('0x9'),auth['isAuthenticated'](),controller['show']);router['put'](_0xb84a('0x9'),auth['isAuthenticated'](),controller[_0xb84a('0xa')]);router[_0xb84a('0xb')]('/:id',auth[_0xb84a('0xc')](),controller['destroy']);module[_0xb84a('0xd')]=router; \ No newline at end of file +var _0xd52a=['./mailApplication.controller','get','put','isAuthenticated','delete','/:id','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x1e2414,_0x3687dc){var _0x5a2744=function(_0xa8c06a){while(--_0xa8c06a){_0x1e2414['push'](_0x1e2414['shift']());}};_0x5a2744(++_0x3687dc);}(_0xd52a,0xca));var _0xad52=function(_0x3363b9,_0xc41ba1){_0x3363b9=_0x3363b9-0x0;var _0x12ffbf=_0xd52a[_0x3363b9];return _0x12ffbf;};'use strict';var multer=require('multer');var util=require(_0xad52('0x0'));var path=require('path');var timeout=require(_0xad52('0x1'));var express=require(_0xad52('0x2'));var router=express[_0xad52('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xad52('0x4'));var config=require(_0xad52('0x5'));var controller=require(_0xad52('0x6'));router[_0xad52('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xad52('0x8')]('/:id',auth[_0xad52('0x9')](),controller['update']);router[_0xad52('0xa')](_0xad52('0xb'),auth['isAuthenticated'](),controller[_0xad52('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index fd0ed55..8849a18 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 _0x5800=['noop','exports','INTEGER','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5800,0x1b9));var _0x0580=function(_0x347f01,_0x16e3c7){_0x347f01=_0x347f01-0x0;var _0x501f05=_0x5800[_0x347f01];return _0x501f05;};'use strict';var Sequelize=require('sequelize');module[_0x0580('0x0')]={'priority':{'type':Sequelize[_0x0580('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x0580('0x2')],'allowNull':![],'defaultValue':_0x0580('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0580('0x2')]},'interval':{'type':Sequelize[_0x0580('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x5cc3=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x138142,_0x30308f){var _0x3d203d=function(_0x272735){while(--_0x272735){_0x138142['push'](_0x138142['shift']());}};_0x3d203d(++_0x30308f);}(_0x5cc3,0x144));var _0x35cc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5cc3[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x35cc('0x0'));module[_0x35cc('0x1')]={'priority':{'type':Sequelize[_0x35cc('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x35cc('0x3')],'allowNull':![],'defaultValue':_0x35cc('0x4')},'appdata':{'type':Sequelize[_0x35cc('0x5')]()},'description':{'type':Sequelize[_0x35cc('0x3')]},'interval':{'type':Sequelize[_0x35cc('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index d8c6da5..6905e1f 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 _0x6e77=['then','destroy','error','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','intersection','fields','length','include','merge','options','find','catch','body','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','Content-Range','json','apply','reject','update'];(function(_0x32739f,_0x1814e3){var _0x51371b=function(_0x59ee34){while(--_0x59ee34){_0x32739f['push'](_0x32739f['shift']());}};_0x51371b(++_0x1814e3);}(_0x6e77,0xef));var _0x76e7=function(_0x4f46f1,_0x2a39b9){_0x4f46f1=_0x4f46f1-0x0;var _0x5e146b=_0x6e77[_0x4f46f1];return _0x5e146b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x76e7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x76e7('0x1'));var rp=require(_0x76e7('0x2'));var moment=require('moment');var BPromise=require(_0x76e7('0x3'));var Mustache=require(_0x76e7('0x4'));var util=require(_0x76e7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x76e7('0x6'));var ejs=require(_0x76e7('0x7'));var fs=require('fs');var _=require(_0x76e7('0x8'));var squel=require('squel');var crypto=require(_0x76e7('0x9'));var jsforce=require(_0x76e7('0xa'));var deskjs=require(_0x76e7('0xb'));var toCsv=require('to-csv');var querystring=require(_0x76e7('0xc'));var Papa=require(_0x76e7('0xd'));var Redis=require('ioredis');var authService=require(_0x76e7('0xe'));var qs=require(_0x76e7('0xf'));var hardwareService=require(_0x76e7('0x10'));var logger=require(_0x76e7('0x11'))('api');var utils=require(_0x76e7('0x12'));var config=require(_0x76e7('0x13'));var db=require(_0x76e7('0x14'))['db'];function respondWithStatusCode(_0x274d21,_0x45fcc2){_0x45fcc2=_0x45fcc2||0xcc;return function(_0x12100e){if(_0x12100e){return _0x274d21[_0x76e7('0x15')](_0x45fcc2);}return _0x274d21[_0x76e7('0x16')](_0x45fcc2)[_0x76e7('0x17')]();};}function respondWithResult(_0x2670f6,_0x44c0b7){_0x44c0b7=_0x44c0b7||0xc8;return function(_0x5b4fc5){if(_0x5b4fc5){return _0x2670f6[_0x76e7('0x16')](_0x44c0b7)['json'](_0x5b4fc5);}};}function respondWithFilteredResult(_0x404975,_0x35f88c){return function(_0x52e19a){if(_0x52e19a){var _0x14cd60=_0x52e19a[_0x76e7('0x18')],_0x444184=_0x35f88c[_0x76e7('0x19')],_0x327d83=_0x35f88c[_0x76e7('0x19')]+_0x35f88c['limit'],_0xa98985;if(_0x327d83>=_0x14cd60){_0x327d83=_0x14cd60;_0xa98985=0xc8;}else{_0xa98985=0xce;}_0x404975[_0x76e7('0x16')](_0xa98985);return _0x404975['set'](_0x76e7('0x1a'),_0x444184+'-'+_0x327d83+'/'+_0x14cd60)[_0x76e7('0x1b')](_0x52e19a);}return null;};}function patchUpdates(_0x31cec6){return function(_0x1796c7){try{jsonpatch[_0x76e7('0x1c')](_0x1796c7,_0x31cec6,!![]);}catch(_0x490b86){return BPromise[_0x76e7('0x1d')](_0x490b86);}return _0x1796c7['save']();};}function saveUpdates(_0x143c36,_0x3ffa9f){return function(_0x2d8995){if(_0x2d8995){return _0x2d8995[_0x76e7('0x1e')](_0x143c36)[_0x76e7('0x1f')](function(_0x10216f){return _0x10216f;});}return null;};}function removeEntity(_0x13d8a8,_0x15ac29){return function(_0x43554c){if(_0x43554c){return _0x43554c[_0x76e7('0x20')]()[_0x76e7('0x1f')](function(){_0x13d8a8[_0x76e7('0x16')](0xcc)[_0x76e7('0x17')]();});}};}function handleEntityNotFound(_0x92d883,_0x58061d){return function(_0x11afe6){if(!_0x11afe6){_0x92d883['sendStatus'](0x194);}return _0x11afe6;};}function handleError(_0x344f51,_0x1cc628){_0x1cc628=_0x1cc628||0x1f4;return function(_0x39b3f8){logger[_0x76e7('0x21')](_0x39b3f8['stack']);if(_0x39b3f8[_0x76e7('0x22')]){delete _0x39b3f8[_0x76e7('0x22')];}_0x344f51['status'](_0x1cc628)[_0x76e7('0x23')](_0x39b3f8);};}exports[_0x76e7('0x24')]=function(_0x38238c,_0x471830){var _0x4a1f67={'raw':!![],'where':{'id':_0x38238c[_0x76e7('0x25')]['id']}},_0x3d2b3c={};_0x3d2b3c[_0x76e7('0x26')]=_[_0x76e7('0x27')](db[_0x76e7('0x28')][_0x76e7('0x29')]);_0x3d2b3c[_0x76e7('0x2a')]=_[_0x76e7('0x27')](_0x38238c[_0x76e7('0x2a')]);_0x3d2b3c[_0x76e7('0x2b')]=_['intersection'](_0x3d2b3c[_0x76e7('0x26')],_0x3d2b3c['query']);_0x4a1f67[_0x76e7('0x2c')]=_[_0x76e7('0x2d')](_0x3d2b3c[_0x76e7('0x26')],qs['fields'](_0x38238c[_0x76e7('0x2a')][_0x76e7('0x2e')]));_0x4a1f67['attributes']=_0x4a1f67[_0x76e7('0x2c')][_0x76e7('0x2f')]?_0x4a1f67['attributes']:_0x3d2b3c[_0x76e7('0x26')];if(_0x38238c[_0x76e7('0x2a')]['includeAll']){_0x4a1f67[_0x76e7('0x30')]=[{'all':!![]}];}_0x4a1f67=_[_0x76e7('0x31')]({},_0x4a1f67,_0x38238c[_0x76e7('0x32')]);return db[_0x76e7('0x28')][_0x76e7('0x33')](_0x4a1f67)[_0x76e7('0x1f')](handleEntityNotFound(_0x471830,null))['then'](respondWithResult(_0x471830,null))[_0x76e7('0x34')](handleError(_0x471830,null));};exports['update']=function(_0x1f8d3c,_0x2f9fab){if(_0x1f8d3c['body']['id']){delete _0x1f8d3c['body']['id'];}return db[_0x76e7('0x28')][_0x76e7('0x33')]({'where':{'id':_0x1f8d3c[_0x76e7('0x25')]['id']}})[_0x76e7('0x1f')](handleEntityNotFound(_0x2f9fab,null))[_0x76e7('0x1f')](saveUpdates(_0x1f8d3c[_0x76e7('0x35')],null))[_0x76e7('0x1f')](respondWithResult(_0x2f9fab,null))[_0x76e7('0x34')](handleError(_0x2f9fab,null));};exports[_0x76e7('0x20')]=function(_0x11b5ed,_0x5335b3){return db[_0x76e7('0x28')][_0x76e7('0x33')]({'where':{'id':_0x11b5ed[_0x76e7('0x25')]['id']}})[_0x76e7('0x1f')](handleEntityNotFound(_0x5335b3,null))['then'](removeEntity(_0x5335b3,null))['catch'](handleError(_0x5335b3,null));}; \ No newline at end of file +var _0xe13a=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','save','update','then','stack','name','send','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','include','merge','options','find','catch','body','destroy','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0xe13a,0x178));var _0xae13=function(_0x48b174,_0x5767b8){_0x48b174=_0x48b174-0x0;var _0x37fb93=_0xe13a[_0x48b174];return _0x37fb93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xae13('0x0'));var rimraf=require(_0xae13('0x1'));var zipdir=require(_0xae13('0x2'));var jsonpatch=require(_0xae13('0x3'));var rp=require('request-promise');var moment=require(_0xae13('0x4'));var BPromise=require(_0xae13('0x5'));var Mustache=require(_0xae13('0x6'));var util=require(_0xae13('0x7'));var path=require(_0xae13('0x8'));var sox=require(_0xae13('0x9'));var csv=require(_0xae13('0xa'));var ejs=require(_0xae13('0xb'));var fs=require('fs');var _=require(_0xae13('0xc'));var squel=require('squel');var crypto=require(_0xae13('0xd'));var jsforce=require(_0xae13('0xe'));var deskjs=require(_0xae13('0xf'));var toCsv=require(_0xae13('0xa'));var querystring=require(_0xae13('0x10'));var Papa=require(_0xae13('0x11'));var Redis=require(_0xae13('0x12'));var authService=require(_0xae13('0x13'));var qs=require(_0xae13('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xae13('0x15'))(_0xae13('0x16'));var utils=require(_0xae13('0x17'));var config=require(_0xae13('0x18'));var db=require(_0xae13('0x19'))['db'];function respondWithStatusCode(_0x3006f0,_0x1505c5){_0x1505c5=_0x1505c5||0xcc;return function(_0x4dd599){if(_0x4dd599){return _0x3006f0[_0xae13('0x1a')](_0x1505c5);}return _0x3006f0[_0xae13('0x1b')](_0x1505c5)['end']();};}function respondWithResult(_0x589803,_0x506411){_0x506411=_0x506411||0xc8;return function(_0x50f7c4){if(_0x50f7c4){return _0x589803['status'](_0x506411)[_0xae13('0x1c')](_0x50f7c4);}};}function respondWithFilteredResult(_0x148186,_0x44e141){return function(_0x90cdc1){if(_0x90cdc1){var _0x537889=_0x90cdc1['count'],_0x2912a2=_0x44e141[_0xae13('0x1d')],_0x5c25a4=_0x44e141[_0xae13('0x1d')]+_0x44e141[_0xae13('0x1e')],_0x3c488f;if(_0x5c25a4>=_0x537889){_0x5c25a4=_0x537889;_0x3c488f=0xc8;}else{_0x3c488f=0xce;}_0x148186[_0xae13('0x1b')](_0x3c488f);return _0x148186[_0xae13('0x1f')](_0xae13('0x20'),_0x2912a2+'-'+_0x5c25a4+'/'+_0x537889)[_0xae13('0x1c')](_0x90cdc1);}return null;};}function patchUpdates(_0x326471){return function(_0x42b307){try{jsonpatch['apply'](_0x42b307,_0x326471,!![]);}catch(_0x4462a5){return BPromise['reject'](_0x4462a5);}return _0x42b307[_0xae13('0x21')]();};}function saveUpdates(_0x1c66b7,_0x49c7d5){return function(_0x25a195){if(_0x25a195){return _0x25a195[_0xae13('0x22')](_0x1c66b7)[_0xae13('0x23')](function(_0x240802){return _0x240802;});}return null;};}function removeEntity(_0x184375,_0x2fd0e9){return function(_0x54b3b4){if(_0x54b3b4){return _0x54b3b4['destroy']()[_0xae13('0x23')](function(){_0x184375[_0xae13('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x168b92,_0x519a37){return function(_0x13c2de){if(!_0x13c2de){_0x168b92[_0xae13('0x1a')](0x194);}return _0x13c2de;};}function handleError(_0x3f12b0,_0x4b47d1){_0x4b47d1=_0x4b47d1||0x1f4;return function(_0x57124a){logger['error'](_0x57124a[_0xae13('0x24')]);if(_0x57124a[_0xae13('0x25')]){delete _0x57124a[_0xae13('0x25')];}_0x3f12b0['status'](_0x4b47d1)[_0xae13('0x26')](_0x57124a);};}exports['show']=function(_0x3d0d60,_0x5de054){var _0xbeda8d={'raw':!![],'where':{'id':_0x3d0d60['params']['id']}},_0x3117c2={};_0x3117c2[_0xae13('0x27')]=_[_0xae13('0x28')](db[_0xae13('0x29')][_0xae13('0x2a')]);_0x3117c2['query']=_[_0xae13('0x28')](_0x3d0d60[_0xae13('0x2b')]);_0x3117c2[_0xae13('0x2c')]=_[_0xae13('0x2d')](_0x3117c2[_0xae13('0x27')],_0x3117c2[_0xae13('0x2b')]);_0xbeda8d[_0xae13('0x2e')]=_['intersection'](_0x3117c2[_0xae13('0x27')],qs['fields'](_0x3d0d60[_0xae13('0x2b')][_0xae13('0x2f')]));_0xbeda8d[_0xae13('0x2e')]=_0xbeda8d[_0xae13('0x2e')][_0xae13('0x30')]?_0xbeda8d[_0xae13('0x2e')]:_0x3117c2[_0xae13('0x27')];if(_0x3d0d60['query']['includeAll']){_0xbeda8d[_0xae13('0x31')]=[{'all':!![]}];}_0xbeda8d=_[_0xae13('0x32')]({},_0xbeda8d,_0x3d0d60[_0xae13('0x33')]);return db[_0xae13('0x29')][_0xae13('0x34')](_0xbeda8d)[_0xae13('0x23')](handleEntityNotFound(_0x5de054,null))[_0xae13('0x23')](respondWithResult(_0x5de054,null))[_0xae13('0x35')](handleError(_0x5de054,null));};exports[_0xae13('0x22')]=function(_0x23f9d7,_0x5f1aeb){if(_0x23f9d7[_0xae13('0x36')]['id']){delete _0x23f9d7[_0xae13('0x36')]['id'];}return db[_0xae13('0x29')]['find']({'where':{'id':_0x23f9d7['params']['id']}})['then'](handleEntityNotFound(_0x5f1aeb,null))['then'](saveUpdates(_0x23f9d7['body'],null))['then'](respondWithResult(_0x5f1aeb,null))[_0xae13('0x35')](handleError(_0x5f1aeb,null));};exports[_0xae13('0x37')]=function(_0x34a801,_0x5bb32a){return db[_0xae13('0x29')][_0xae13('0x34')]({'where':{'id':_0x34a801[_0xae13('0x38')]['id']}})[_0xae13('0x23')](handleEntityNotFound(_0x5bb32a,null))[_0xae13('0x23')](removeEntity(_0x5bb32a,null))['catch'](handleError(_0x5bb32a,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 4291620..8b3f66a 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 _0xa3cb=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3cb,0x1e0));var _0xba3c=function(_0x549278,_0x450754){_0x549278=_0x549278-0x0;var _0x1ea9a1=_0xa3cb[_0x549278];return _0x1ea9a1;};'use strict';var _=require(_0xba3c('0x0'));var util=require('util');var logger=require(_0xba3c('0x1'))(_0xba3c('0x2'));var moment=require(_0xba3c('0x3'));var BPromise=require(_0xba3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba3c('0x5'));var rimraf=require(_0xba3c('0x6'));var config=require(_0xba3c('0x7'));var attributes=require(_0xba3c('0x8'));module[_0xba3c('0x9')]=function(_0x421d62,_0x2c4426){return _0x421d62[_0xba3c('0xa')](_0xba3c('0xb'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xba3c('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf70e=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x102b64,_0x43bd50){var _0x4217a1=function(_0x26f45e){while(--_0x26f45e){_0x102b64['push'](_0x102b64['shift']());}};_0x4217a1(++_0x43bd50);}(_0xf70e,0x1ae));var _0xef70=function(_0x4b8968,_0x5c9b44){_0x4b8968=_0x4b8968-0x0;var _0x3a0ab7=_0xf70e[_0x4b8968];return _0x3a0ab7;};'use strict';var _=require(_0xef70('0x0'));var util=require(_0xef70('0x1'));var logger=require(_0xef70('0x2'))(_0xef70('0x3'));var moment=require(_0xef70('0x4'));var BPromise=require(_0xef70('0x5'));var rp=require(_0xef70('0x6'));var fs=require('fs');var path=require(_0xef70('0x7'));var rimraf=require(_0xef70('0x8'));var config=require(_0xef70('0x9'));var attributes=require(_0xef70('0xa'));module[_0xef70('0xb')]=function(_0x48fc5f,_0xfb890){return _0x48fc5f[_0xef70('0xc')]('MailApplication',attributes,{'tableName':_0xef70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xef70('0xe'),'collate':_0xef70('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 009d741..a86570b 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 _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0xea0e29,_0x4edde0){var _0x35b910=function(_0x411c63){while(--_0x411c63){_0xea0e29['push'](_0xea0e29['shift']());}};_0x35b910(++_0x4edde0);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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']('MailApplication,\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['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x9957=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options','raw','attributes','limit','lodash','util','moment'];(function(_0x58652a,_0x1b8060){var _0x2caac0=function(_0x4b4e38){while(--_0x4b4e38){_0x58652a['push'](_0x58652a['shift']());}};_0x2caac0(++_0x1b8060);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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']('MailApplication,\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['MailApplication'][_0x7995('0x19')](_0x291317['body'],{'raw':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291317['options']?_0x291317[_0x7995('0x1a')]['where']||null:null,'attributes':_0x291317['options']?_0x291317[_0x7995('0x1a')][_0x7995('0x1c')]||null:null,'limit':_0x291317[_0x7995('0x1a')]?_0x291317[_0x7995('0x1a')][_0x7995('0x1d')]||null:null})[_0x7995('0xc')](function(_0x5d40ae){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x5d40ae));_0x37a7d4(_0x5d40ae);})[_0x7995('0x17')](function(_0x475351){logger[_0x7995('0x13')]('UpdateMailApplication',_0x475351[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x475351[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 496adda..a30a3a2 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 _0x6aa7=['mailinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailInteraction.controller','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','get','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','mail','update'];(function(_0x151334,_0x1e11ac){var _0x3d03da=function(_0x2099cf){while(--_0x2099cf){_0x151334['push'](_0x151334['shift']());}};_0x3d03da(++_0x1e11ac);}(_0x6aa7,0x178));var _0x76aa=function(_0x179818,_0xace14c){_0x179818=_0x179818-0x0;var _0x39aab0=_0x6aa7[_0x179818];return _0x39aab0;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x76aa('0x5'));var config=require(_0x76aa('0x6'));var controller=require(_0x76aa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x76aa('0x8')]);router['get'](_0x76aa('0x9'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xb')]);router['get'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xd')]);router['get'](_0x76aa('0xe'),auth[_0x76aa('0xa')](),controller[_0x76aa('0xf')]);router[_0x76aa('0x10')](_0x76aa('0x11'),auth[_0x76aa('0xa')](),controller[_0x76aa('0x12')]);router[_0x76aa('0x13')]('/',auth[_0x76aa('0xa')](),controller[_0x76aa('0x14')]);router['post'](_0x76aa('0xe'),auth['isAuthenticated'](),controller[_0x76aa('0x15')]);router[_0x76aa('0x13')](_0x76aa('0x16'),auth[_0x76aa('0xa')](),interaction[_0x76aa('0x17')]('mail','mailinteraction:addtags'),controller[_0x76aa('0x18')]);router['put'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),interaction['tracked'](_0x76aa('0x19'),'mailinteraction:update'),controller[_0x76aa('0x1a')]);router['delete'](_0x76aa('0xc'),auth[_0x76aa('0xa')](),interaction[_0x76aa('0x17')](_0x76aa('0x19'),_0x76aa('0x1b')),controller[_0x76aa('0x1c')]);router['delete']('/:id/tags',auth[_0x76aa('0xa')](),controller[_0x76aa('0x1d')]);module[_0x76aa('0x1e')]=router; \ No newline at end of file +var _0xedd9=['isAuthenticated','index','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x2f2bcf,_0x2348dc){var _0x1f7259=function(_0x2a12c5){while(--_0x2a12c5){_0x2f2bcf['push'](_0x2f2bcf['shift']());}};_0x1f7259(++_0x2348dc);}(_0xedd9,0xfc));var _0x9edd=function(_0x36ade4,_0x1faea0){_0x36ade4=_0x36ade4-0x0;var _0x8f7ac0=_0xedd9[_0x36ade4];return _0x8f7ac0;};'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 auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./mailInteraction.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/describe',auth[_0x9edd('0x9')](),controller['describe']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0x8')]('/:id/download',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router['post']('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')](_0x9edd('0xd'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x11')](_0x9edd('0x13'),auth['isAuthenticated'](),interaction[_0x9edd('0x14')](_0x9edd('0x15'),_0x9edd('0x16')),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),interaction[_0x9edd('0x14')]('mail',_0x9edd('0x19')),controller[_0x9edd('0x1a')]);router[_0x9edd('0x1b')]('/:id',auth[_0x9edd('0x9')](),interaction[_0x9edd('0x14')](_0x9edd('0x15'),'mailinteraction:destroy'),controller[_0x9edd('0x1c')]);router['delete'](_0x9edd('0x13'),auth[_0x9edd('0x9')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 870cb93..390d4dd 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 _0x6f32=['long','ENUM','out','BOOLEAN','DATE','STRING','TEXT'];(function(_0x11c552,_0x3acf1e){var _0x3ad282=function(_0x3a8ab3){while(--_0x3a8ab3){_0x11c552['push'](_0x11c552['shift']());}};_0x3ad282(++_0x3acf1e);}(_0x6f32,0x14c));var _0x26f3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x6f32[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize[_0x26f3('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x26f3('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x26f3('0x2')](0x1fe)},'to':{'type':Sequelize[_0x26f3('0x2')]},'cc':{'type':Sequelize[_0x26f3('0x3')](_0x26f3('0x4'))},'subject':{'type':Sequelize[_0x26f3('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x26f3('0x2')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x26f3('0x5')]('in',_0x26f3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x26f3('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x26f3('0x5')]('in',_0x26f3('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x26f3('0x3')](_0x26f3('0x4'))},'lastMsgText':{'type':Sequelize['TEXT']('long')}}; \ No newline at end of file +var _0x52db=['iconv','exports','BOOLEAN','STRING','TEXT','long','DATE','ENUM','out','sequelize'];(function(_0x5a30d7,_0x3e5e7b){var _0x29efa8=function(_0x905010){while(--_0x905010){_0x5a30d7['push'](_0x5a30d7['shift']());}};_0x29efa8(++_0x3e5e7b);}(_0x52db,0x1a3));var _0xb52d=function(_0x51d157,_0x2acf38){_0x51d157=_0x51d157-0x0;var _0x15d542=_0x52db[_0x51d157];return _0x15d542;};'use strict';var Sequelize=require(_0xb52d('0x0'));var iconv=require(_0xb52d('0x1'));module[_0xb52d('0x2')]={'closed':{'type':Sequelize[_0xb52d('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb52d('0x4')]},'inReplyTo':{'type':Sequelize[_0xb52d('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb52d('0x4')]},'cc':{'type':Sequelize[_0xb52d('0x5')](_0xb52d('0x6'))},'subject':{'type':Sequelize[_0xb52d('0x5')]()},'attach':{'type':Sequelize[_0xb52d('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb52d('0x7')]},'substatus':{'type':Sequelize[_0xb52d('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb52d('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb52d('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xb52d('0x8')]('in',_0xb52d('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xb52d('0x5')]('long')},'lastMsgText':{'type':Sequelize[_0xb52d('0x5')](_0xb52d('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 71be0f2..9719a4e 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 _0x041d=['and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','value','Messages.count','\x20IN\x20?','tableAlias','\x20=\x20?','LIKE','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','TagId','ContactId','map','filter','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','split','push','toString','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','DESC','SELECT','clone','having','%s\x20>\x200','tag','mail_interaction_has_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%s\x20=\x200','`Messages.count`\x20=\x200','sequelize','count','keyBy','merge','a.key','i.*','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','it.MailInteractionId\x20=\x20i.id','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Users','Tags','fromString','lastMsgBody','rows','catch','show','includeAll','include','options','find','create','body','params','describe','addMessage','omit','ids','getMessages','MailMessage','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','Tag','emit','mailInteractionTags:save','removeTags','root','server','files','join','interaction-%s.zip','subject','attachments','Attachment','Attachments','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','Bcc','basename','existsSync','type','readFileSync','build','writeFileSync','message%d.eml','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','MailInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','mail_messages','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','expr','advancedFilter','forEach','createdAt','dateStart','startOf','day','utc','format','endOf'];(function(_0xcdbcd3,_0x5c111c){var _0x45e5a9=function(_0x5874e8){while(--_0x5874e8){_0xcdbcd3['push'](_0xcdbcd3['shift']());}};_0x45e5a9(++_0x5c111c);}(_0x041d,0x74));var _0xd041=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x041d[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0xd041('0x0'));var emlformat=require(_0xd041('0x1'));var rimraf=require(_0xd041('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd041('0x3'));var rp=require(_0xd041('0x4'));var moment=require(_0xd041('0x5'));var BPromise=require(_0xd041('0x6'));var Mustache=require(_0xd041('0x7'));var util=require(_0xd041('0x8'));var path=require('path');var sox=require(_0xd041('0x9'));var csv=require(_0xd041('0xa'));var ejs=require(_0xd041('0xb'));var fs=require('fs');var _=require(_0xd041('0xc'));var squel=require('squel');var crypto=require(_0xd041('0xd'));var jsforce=require(_0xd041('0xe'));var deskjs=require(_0xd041('0xf'));var toCsv=require(_0xd041('0xa'));var querystring=require(_0xd041('0x10'));var Papa=require(_0xd041('0x11'));var htmlToText=require('html-to-text');var Redis=require(_0xd041('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd041('0x13'));var hardwareService=require(_0xd041('0x14'));var logger=require('../../config/logger')(_0xd041('0x15'));var utils=require(_0xd041('0x16'));var config=require(_0xd041('0x17'));var db=require(_0xd041('0x18'))['db'];config[_0xd041('0x19')]=_[_0xd041('0x1a')](config[_0xd041('0x19')],{'host':_0xd041('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd041('0x19')]));require(_0xd041('0x1c'))[_0xd041('0x1d')](socket);function respondWithStatusCode(_0x1befe3,_0x34f8fb){_0x34f8fb=_0x34f8fb||0xcc;return function(_0x1cf40c){if(_0x1cf40c){return _0x1befe3[_0xd041('0x1e')](_0x34f8fb);}return _0x1befe3[_0xd041('0x1f')](_0x34f8fb)[_0xd041('0x20')]();};}function respondWithResult(_0x3e5b97,_0x142d0f){_0x142d0f=_0x142d0f||0xc8;return function(_0x281e22){if(_0x281e22){return _0x3e5b97['status'](_0x142d0f)[_0xd041('0x21')](_0x281e22);}};}function respondWithFilteredResult(_0x18163a,_0x5b705e){return function(_0x17aada){if(_0x17aada){var _0x152507=_0x17aada['count'],_0x166860=_0x5b705e[_0xd041('0x22')],_0x366a95=_0x5b705e[_0xd041('0x22')]+_0x5b705e[_0xd041('0x23')],_0x2a656a;if(_0x366a95>=_0x152507){_0x366a95=_0x152507;_0x2a656a=0xc8;}else{_0x2a656a=0xce;}_0x18163a[_0xd041('0x1f')](_0x2a656a);return _0x18163a[_0xd041('0x24')](_0xd041('0x25'),_0x166860+'-'+_0x366a95+'/'+_0x152507)[_0xd041('0x21')](_0x17aada);}return null;};}function patchUpdates(_0x51abb2){return function(_0x44e34c){try{jsonpatch[_0xd041('0x26')](_0x44e34c,_0x51abb2,!![]);}catch(_0x110674){return BPromise[_0xd041('0x27')](_0x110674);}return _0x44e34c[_0xd041('0x28')]();};}function saveUpdates(_0x23141f,_0x4b2e6d){return function(_0x21004d){if(_0x21004d){return _0x21004d[_0xd041('0x29')](_0x23141f)[_0xd041('0x2a')](function(_0x340582){return _0x340582;});}return null;};}function removeEntity(_0x239081,_0x5cd1ff){return function(_0x446c03){if(_0x446c03){return _0x446c03[_0xd041('0x2b')]()['then'](function(){_0x239081[_0xd041('0x1f')](0xcc)[_0xd041('0x20')]();});}};}function handleEntityNotFound(_0xa7d0fb,_0x403fba){return function(_0x5ee020){if(!_0x5ee020){_0xa7d0fb[_0xd041('0x1e')](0x194);}return _0x5ee020;};}function handleError(_0x468e5d,_0x31a675){_0x31a675=_0x31a675||0x1f4;return function(_0x2fd0dc){logger[_0xd041('0x2c')](_0x2fd0dc[_0xd041('0x2d')]);if(_0x2fd0dc['name']){delete _0x2fd0dc[_0xd041('0x2e')];}_0x468e5d['status'](_0x31a675)[_0xd041('0x2f')](_0x2fd0dc);};}exports['index']=function(_0x5d2ce0,_0x65c8fe){var _0x281d25={},_0x1b7b87={},_0x2c45b1={'count':0x0,'rows':[]};var _0x3795cb=db[_0xd041('0x30')][_0xd041('0x31')];_0x1b7b87[_0xd041('0x32')]=_[_0xd041('0x33')](_0x3795cb);_0x1b7b87[_0xd041('0x34')]=_[_0xd041('0x33')](_0x5d2ce0[_0xd041('0x34')]);_0x1b7b87[_0xd041('0x35')]=_[_0xd041('0x36')](_0x1b7b87[_0xd041('0x32')],_0x1b7b87[_0xd041('0x34')]);_0x281d25['attributes']=_[_0xd041('0x36')](_0x1b7b87[_0xd041('0x32')],qs[_0xd041('0x37')](_0x5d2ce0[_0xd041('0x34')]['fields']));_0x281d25[_0xd041('0x38')]=_0x281d25[_0xd041('0x38')][_0xd041('0x39')]?_0x281d25[_0xd041('0x38')]:_0x1b7b87[_0xd041('0x32')];if(!_0x5d2ce0[_0xd041('0x34')][_0xd041('0x3a')](_0xd041('0x3b'))){_0x281d25[_0xd041('0x23')]=qs['limit'](_0x5d2ce0[_0xd041('0x34')][_0xd041('0x23')]);_0x281d25[_0xd041('0x22')]=qs[_0xd041('0x22')](_0x5d2ce0[_0xd041('0x34')][_0xd041('0x22')]);}_0x281d25[_0xd041('0x3c')]=qs[_0xd041('0x3d')](_0x5d2ce0[_0xd041('0x34')][_0xd041('0x3d')]);_0x281d25[_0xd041('0x3e')]=qs['filters'](_['pick'](_0x5d2ce0[_0xd041('0x34')],_0x1b7b87['filters']));var _0x262563=[];var _0x965168=squel[_0xd041('0x3f')]()['field']('id')[_0xd041('0x40')](_0xd041('0x2e'))[_0xd041('0x40')](_0xd041('0x41'))[_0xd041('0x42')](_0xd041('0x43'));var _0x1620e5=squel[_0xd041('0x3f')]()[_0xd041('0x40')]('COUNT(*)')[_0xd041('0x42')](_0xd041('0x44'),'me')[_0xd041('0x3e')](_0xd041('0x45'))[_0xd041('0x3e')](_0xd041('0x46'))[_0xd041('0x3e')](_0xd041('0x47'));var _0xbc5a30=squel[_0xd041('0x3f')]()[_0xd041('0x40')]('u.id')[_0xd041('0x40')]('ui.MailInteractionId')[_0xd041('0x42')](_0xd041('0x48'),'ui')[_0xd041('0x49')](_0xd041('0x4a'),'u',_0xd041('0x4b'));var _0x5c47ab=squel[_0xd041('0x3f')]()['from'](_0xd041('0x4c'),'i')[_0xd041('0x49')](_0xd041('0x48'),'ui',_0xd041('0x4d'))[_0xd041('0x49')]('users','u',_0xd041('0x4b'))[_0xd041('0x49')](_0xd041('0x4e'),'c',_0xd041('0x4f'))['left_join'](_0xd041('0x4a'),'o',_0xd041('0x50'))[_0xd041('0x49')]('mail_accounts','a',_0xd041('0x51'))[_0xd041('0x49')](_0xd041('0x44'),'me',_0xd041('0x45'));var _0x5e0bd8=squel[_0xd041('0x52')]();if(_0x5d2ce0['query'][_0xd041('0x53')]){var _0x1094bd=JSON['parse'](_0x5d2ce0[_0xd041('0x34')][_0xd041('0x53')]);_['keys'](_0x1094bd)[_0xd041('0x54')](function(_0x59a769){var _0x1c0503=_0x1094bd[_0x59a769];if(_0x59a769===_0xd041('0x55')){var _0x7ed09e=moment(_0x1c0503['value'][_0xd041('0x56')])[_0xd041('0x57')](_0xd041('0x58'))[_0xd041('0x59')]()[_0xd041('0x5a')]();var _0x5eed20=moment(_0x5eed20)[_0xd041('0x59')]()[_0xd041('0x5b')](_0xd041('0x58'))[_0xd041('0x5a')]();_0x5e0bd8[_0xd041('0x5c')](_0xd041('0x5d'),_0x7ed09e,_0x5eed20);}else{if(_['isArray'](_0x1c0503[_0xd041('0x5e')])){_0x1c0503[_0xd041('0x5e')][_0xd041('0x54')](function(_0x3165b9){switch(_0x1c0503[_0xd041('0x5e')][_0xd041('0x5f')]){case'IS':if(_0x59a769!=='TagId'&&_0x59a769!==_0xd041('0x60')){if(_['isArray'](_0x1c0503[_0xd041('0x5f')])&&_0x1c0503[_0xd041('0x5f')]['length']>0x1){_0x5e0bd8[_0xd041('0x5c')](_0x1c0503['tableAlias']+'.'+_0x59a769+_0xd041('0x61'),_0x1c0503[_0xd041('0x5f')]);}else{_0x5e0bd8['and'](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+'\x20=\x20?',_0x1c0503[_0xd041('0x5f')][0x0]);}}break;case'=':_0x5e0bd8['and'](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x63'),_0x1c0503['value']);break;case _0xd041('0x64'):if(_0x59a769==='ContactId'){_0x5e0bd8[_0xd041('0x5c')](_0xd041('0x65')+'\x20LIKE\x20?','%'+_0x1c0503[_0xd041('0x5f')]+'%');_0x5e0bd8['or'](_0xd041('0x66')+_0xd041('0x67'),'%'+_0x1c0503[_0xd041('0x5f')]+'%');_0x5e0bd8['or'](_0xd041('0x68')+_0xd041('0x67'),'%'+_0x1c0503['value']+'%');}else{_0x5e0bd8[_0xd041('0x5c')](_0x1c0503['tableAlias']+'.'+_0x59a769+_0xd041('0x67'),'%'+_0x1c0503['value']+'%');}break;case'>':_0x5e0bd8[_0xd041('0x5c')](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x69'),_0x1c0503[_0xd041('0x5f')]);break;case'<':_0x5e0bd8[_0xd041('0x5c')](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x6a'),_0x1c0503[_0xd041('0x5f')]);break;}});}else{switch(_0x1c0503[_0xd041('0x5e')][_0xd041('0x5f')]){case'IS':if(_0x59a769!==_0xd041('0x6b')&&_0x59a769!=='Messages.count'){if(_['isArray'](_0x1c0503[_0xd041('0x5f')])&&_0x1c0503[_0xd041('0x5f')]['length']>0x1){_0x5e0bd8['and'](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x61'),_0x1c0503['value']);}else{_0x5e0bd8[_0xd041('0x5c')](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x63'),_0x1c0503[_0xd041('0x5f')][0x0]);}}break;case'=':_0x5e0bd8['and'](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x63'),_0x1c0503[_0xd041('0x5f')]);break;case _0xd041('0x64'):if(_0x59a769===_0xd041('0x6c')){_0x5e0bd8[_0xd041('0x5c')](_0xd041('0x65')+_0xd041('0x67'),'%'+_0x1c0503['value']+'%');_0x5e0bd8['or'](_0xd041('0x66')+_0xd041('0x67'),'%'+_0x1c0503['value']+'%');_0x5e0bd8['or']('c.email'+_0xd041('0x67'),'%'+_0x1c0503[_0xd041('0x5f')]+'%');}else{_0x5e0bd8[_0xd041('0x5c')](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x67'),'%'+_0x1c0503[_0xd041('0x5f')]+'%');}break;case'>':_0x5e0bd8['and'](_0x1c0503['tableAlias']+'.'+_0x59a769+'\x20>\x20?',_0x1c0503[_0xd041('0x5f')]);break;case'<':_0x5e0bd8[_0xd041('0x5c')](_0x1c0503[_0xd041('0x62')]+'.'+_0x59a769+_0xd041('0x6a'),_0x1c0503['value']);break;}}}});}else{var _0x25db60=_(Object[_0xd041('0x33')](_0x5d2ce0[_0xd041('0x34')]))[_0xd041('0x6d')](function(_0x27b16b){return _0x3795cb[_0xd041('0x3a')](_0x27b16b)?_0x27b16b:undefined;})[_0xd041('0x6e')](function(_0x514e67){return!_['isNil'](_0x514e67);})['value']();if(!_[_0xd041('0x6f')](_0x25db60)){_0x25db60[_0xd041('0x54')](function(_0x2e84b5){if(_0x2e84b5===_0xd041('0x70')){_0x5c47ab[_0xd041('0x3e')](_0xd041('0x71'),[][_0xd041('0x72')](_0x5d2ce0[_0xd041('0x34')][_0x2e84b5]));}else if(_0x2e84b5==='createdAt'){var _0xd1898b=JSON[_0xd041('0x73')](_0x5d2ce0['query'][_0x2e84b5])[_0xd041('0x74')];var _0x3191c1=JSON[_0xd041('0x73')](_0x5d2ce0[_0xd041('0x34')][_0x2e84b5])[_0xd041('0x75')];_0x5c47ab[_0xd041('0x3e')](_0xd041('0x5d'),_0xd1898b,_0x3191c1);}else{_0x5c47ab[_0xd041('0x3e')]('i.'+_0x2e84b5+_0xd041('0x63'),_0x5d2ce0[_0xd041('0x34')][_0x2e84b5]);}});}if(_0x5d2ce0[_0xd041('0x34')]['filter']){var _0x39fc6b=_0x5d2ce0['query'][_0xd041('0x6e')]['replace']('\x5c','\x5c\x5c')[_0xd041('0x76')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xd041('0x77')](_0x39fc6b)){_0x5e0bd8['or'](_0xd041('0x78'),_0x39fc6b+'%');}else if(qs[_0xd041('0x79')](_0x39fc6b)){_0x5e0bd8['or']('c.email\x20LIKE\x20?',_0x39fc6b+'%');}else{var _0x52f07=[];_0x39fc6b[_0xd041('0x7a')]('\x20')['forEach'](function(_0x207290){_0x52f07[_0xd041('0x7b')]('+'+_0x207290[_0xd041('0x7c')]());});var _0x5bde91=_0x52f07['join']('\x20');_0x5e0bd8['or'](_0xd041('0x7d'),_0x5bde91)['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x5bde91);}}}_0x5c47ab[_0xd041('0x3e')](_0x5e0bd8);if(_0x281d25[_0xd041('0x3c')]){_0x281d25[_0xd041('0x3c')][_0xd041('0x54')](function(_0x21b69a){_0x5c47ab['order']('i.'+_0x21b69a[0x0],_0x21b69a[0x1]===_0xd041('0x7e')?![]:!![]);});}_0x5c47ab['group']('i.id');var _0x2670ae={'type':db['Sequelize']['QueryTypes'][_0xd041('0x7f')],'raw':!![]};var _0x44f5e3=_0x5c47ab[_0xd041('0x80')]()[_0xd041('0x40')]('COUNT(*)');if(!_0x5d2ce0[_0xd041('0x34')][_0xd041('0x53')]){if(_0x5d2ce0[_0xd041('0x34')]['read']){if(_0x5d2ce0[_0xd041('0x34')]['read']==0x1){_0x44f5e3[_0xd041('0x3e')](util['format']('%s\x20=\x200',_0x1620e5[_0xd041('0x7c')]()));_0x5c47ab[_0xd041('0x81')]('`Messages.count`\x20=\x200');}else{_0x44f5e3[_0xd041('0x3e')](util[_0xd041('0x5a')](_0xd041('0x82'),_0x1620e5[_0xd041('0x7c')]()));_0x5c47ab[_0xd041('0x81')]('`Messages.count`\x20>\x200');}}if(_0x5d2ce0[_0xd041('0x34')]['tag']){var _0x350206=_['isArray'](_0x5d2ce0['query'][_0xd041('0x83')])?_0x5d2ce0[_0xd041('0x34')][_0xd041('0x83')]:new Array(_0x5d2ce0[_0xd041('0x34')][_0xd041('0x83')]);var _0x8e864b=squel[_0xd041('0x52')]();_0x350206['forEach'](function(_0x5d2197){_0x8e864b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5d2197+',%');});_0x5c47ab[_0xd041('0x81')](_0x8e864b);_0x44f5e3['left_join'](_0xd041('0x84'),'it','it.MailInteractionId\x20=\x20i.id');_0x44f5e3[_0xd041('0x49')](_0xd041('0x43'),'t',_0xd041('0x85'));_0x44f5e3[_0xd041('0x3e')](_0xd041('0x86'),_0x350206);}}else{var _0x1094bd=JSON[_0xd041('0x73')](_0x5d2ce0[_0xd041('0x34')][_0xd041('0x53')]);_[_0xd041('0x33')](_0x1094bd)[_0xd041('0x54')](function(_0x29d3b2){var _0x9596f9=_0x1094bd[_0x29d3b2];if(_0x29d3b2===_0xd041('0x6b')){var _0x402c73=_0x9596f9[_0xd041('0x5f')];var _0x4efe2e=squel[_0xd041('0x52')]();_0x402c73[_0xd041('0x54')](function(_0x53cd89){_0x4efe2e['or'](_0xd041('0x87'),'%,'+_0x53cd89+',%');});_0x5c47ab['having'](_0x4efe2e);_0x44f5e3['left_join'](_0xd041('0x84'),'it','it.MailInteractionId\x20=\x20i.id');_0x44f5e3['left_join'](_0xd041('0x43'),'t','t.id\x20=\x20it.TagId');_0x44f5e3[_0xd041('0x3e')](_0xd041('0x86'),_0x402c73);}else if(_0x29d3b2===_0xd041('0x60')){if(_0x9596f9[_0xd041('0x5f')]['length']===0x1){if(_0x9596f9[_0xd041('0x5f')][0x0]===0x1){_0x44f5e3[_0xd041('0x3e')](util[_0xd041('0x5a')](_0xd041('0x88'),_0x1620e5[_0xd041('0x7c')]()));_0x5c47ab[_0xd041('0x81')](_0xd041('0x89'));}else{_0x44f5e3[_0xd041('0x3e')](util[_0xd041('0x5a')](_0xd041('0x82'),_0x1620e5[_0xd041('0x7c')]()));_0x5c47ab[_0xd041('0x81')]('`Messages.count`\x20>\x200');}}}});}db[_0xd041('0x8a')][_0xd041('0x34')](_0x44f5e3[_0xd041('0x7c')](),_0x2670ae)[_0xd041('0x2a')](function(_0x1016b8){_0x2c45b1[_0xd041('0x8b')]=_0x1016b8['length'];if(_0x2c45b1[_0xd041('0x8b')]===0x0)return[];return db[_0xd041('0x8a')][_0xd041('0x34')](_0x965168[_0xd041('0x7c')](),_0x2670ae)[_0xd041('0x2a')](function(_0x10c07d){_0x262563=_[_0xd041('0x8c')](_0x10c07d,'id');_0x2670ae=_[_0xd041('0x8d')](_0x2670ae,{'model':db[_0xd041('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5c47ab[_0xd041('0x40')](_0x1620e5,_0xd041('0x60'));_0x5c47ab[_0xd041('0x40')](_0xd041('0x8e'),'Account.key');_0x5c47ab[_0xd041('0x40')](_0xd041('0x8f'));_0x5c47ab['field']('c.firstName','Contact.firstName');_0x5c47ab[_0xd041('0x40')](_0xd041('0x66'),'Contact.lastName');_0x5c47ab[_0xd041('0x40')](_0xd041('0x68'),_0xd041('0x90'));_0x5c47ab['field'](_0xd041('0x91'),_0xd041('0x92'));_0x5c47ab[_0xd041('0x40')](_0xd041('0x93'),'Contact.mobile');_0x5c47ab['field'](_0xd041('0x94'),_0xd041('0x95'));_0x5c47ab['field']('u.fullname',_0xd041('0x96'));_0x5c47ab[_0xd041('0x40')](_0xd041('0x97'),_0xd041('0x98'));_0x5c47ab['left_join']('mail_interaction_has_tags','it',_0xd041('0x99'));_0x5c47ab[_0xd041('0x49')](_0xd041('0x43'),'t',_0xd041('0x85'));_0x5c47ab[_0xd041('0x23')](_0x281d25[_0xd041('0x23')]);_0x5c47ab[_0xd041('0x22')](_0x281d25[_0xd041('0x22')]);return db['sequelize'][_0xd041('0x34')](_0x5c47ab[_0xd041('0x7c')](),_0x2670ae);})[_0xd041('0x2a')](function(_0x28c14e){_0xbc5a30['where'](_0xd041('0x9a'),_[_0xd041('0x6d')](_0x28c14e,'id'));return db[_0xd041('0x8a')][_0xd041('0x34')](_0xbc5a30[_0xd041('0x7c')](),_0x2670ae)['then'](function(_0x54e610){var _0x2d1c20=_[_0xd041('0x9b')](_0x54e610,_0xd041('0x9c'));_0x28c14e[_0xd041('0x54')](function(_0x330914){if(_0x2d1c20[_0x330914['id']]){_0x330914[_0xd041('0x9d')]=_[_0xd041('0x6d')](_0x2d1c20[_0x330914['id']],function(_0x2322cd){return{'id':_0x2322cd['id']};});}if(_0x330914[_0xd041('0x98')]){_0x330914[_0xd041('0x9e')]=[];_0x330914['TagIds'][_0xd041('0x7a')](',')[_0xd041('0x54')](function(_0x18236d){_0x330914['Tags'][_0xd041('0x7b')](_0x262563[_0x18236d]);});}delete _0x330914['TagIds'];if(!_0x330914['lastMsgText']){_0x330914['lastMsgText']=_['trimStart'](htmlToText[_0xd041('0x9f')](_0x330914[_0xd041('0xa0')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x28c14e;});});})[_0xd041('0x2a')](function(_0x80b7a0){_0x2c45b1[_0xd041('0xa1')]=_0x80b7a0;return _0x2c45b1;})[_0xd041('0x2a')](respondWithFilteredResult(_0x65c8fe,_0x281d25))[_0xd041('0xa2')](handleError(_0x65c8fe,null));};exports[_0xd041('0xa3')]=function(_0x3137d2,_0x587eaa){var _0x3c021e={'raw':![],'where':{'id':_0x3137d2['params']['id']}},_0x14721d={};_0x14721d['model']=_[_0xd041('0x33')](db[_0xd041('0x30')][_0xd041('0x31')]);_0x14721d[_0xd041('0x34')]=_[_0xd041('0x33')](_0x3137d2[_0xd041('0x34')]);_0x14721d[_0xd041('0x35')]=_[_0xd041('0x36')](_0x14721d[_0xd041('0x32')],_0x14721d['query']);_0x3c021e['attributes']=_[_0xd041('0x36')](_0x14721d[_0xd041('0x32')],qs['fields'](_0x3137d2[_0xd041('0x34')][_0xd041('0x37')]));_0x3c021e[_0xd041('0x38')]=_0x3c021e[_0xd041('0x38')][_0xd041('0x39')]?_0x3c021e[_0xd041('0x38')]:_0x14721d[_0xd041('0x32')];if(_0x3137d2[_0xd041('0x34')][_0xd041('0xa4')]){_0x3c021e[_0xd041('0xa5')]=[{'all':!![]}];}_0x3c021e=_[_0xd041('0x8d')]({},_0x3c021e,_0x3137d2[_0xd041('0xa6')]);return db[_0xd041('0x30')][_0xd041('0xa7')](_0x3c021e)[_0xd041('0x2a')](handleEntityNotFound(_0x587eaa,null))[_0xd041('0x2a')](respondWithResult(_0x587eaa,null))[_0xd041('0xa2')](handleError(_0x587eaa,null));};exports['create']=function(_0x2f2354,_0x7b7957){return db[_0xd041('0x30')][_0xd041('0xa8')](_0x2f2354[_0xd041('0xa9')],{})[_0xd041('0x2a')](respondWithResult(_0x7b7957,0xc9))[_0xd041('0xa2')](handleError(_0x7b7957,null));};exports[_0xd041('0x29')]=function(_0x181aef,_0x2440f8){if(_0x181aef[_0xd041('0xa9')]['id']){delete _0x181aef['body']['id'];}return db[_0xd041('0x30')][_0xd041('0xa7')]({'where':{'id':_0x181aef[_0xd041('0xaa')]['id']}})['then'](handleEntityNotFound(_0x2440f8,null))[_0xd041('0x2a')](saveUpdates(_0x181aef[_0xd041('0xa9')],null))[_0xd041('0x2a')](respondWithResult(_0x2440f8,null))['catch'](handleError(_0x2440f8,null));};exports[_0xd041('0x2b')]=function(_0x54a607,_0x171168){return db['MailInteraction'][_0xd041('0xa7')]({'where':{'id':_0x54a607[_0xd041('0xaa')]['id']}})[_0xd041('0x2a')](handleEntityNotFound(_0x171168,null))[_0xd041('0x2a')](removeEntity(_0x171168,null))['catch'](handleError(_0x171168,null));};exports['describe']=function(_0x44ab41,_0x2492d1){return db[_0xd041('0x30')][_0xd041('0xab')]()[_0xd041('0x2a')](respondWithResult(_0x2492d1,null))['catch'](handleError(_0x2492d1,null));};exports['addMessage']=function(_0x53c372,_0x167ca2,_0x24a77b){return db['MailMessage'][_0xd041('0xa7')]({'where':{'id':_0x53c372[_0xd041('0xaa')]['id']}})[_0xd041('0x2a')](handleEntityNotFound(_0x167ca2,null))[_0xd041('0x2a')](function(_0x5bc886){if(_0x5bc886){return _0x5bc886[_0xd041('0xac')](_0x53c372[_0xd041('0xa9')]['ids'],_[_0xd041('0xad')](_0x53c372[_0xd041('0xa9')],[_0xd041('0xae'),'id'])||{});}})[_0xd041('0x2a')](respondWithResult(_0x167ca2,null))[_0xd041('0xa2')](handleError(_0x167ca2,null));};exports[_0xd041('0xaf')]=function(_0x52c886,_0x421467,_0x5f10e4){var _0xb335b2={'raw':![],'where':{}};var _0x3ef4ae={};var _0x571d08={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x52c886[_0xd041('0xaa')]['id']}})[_0xd041('0x2a')](handleEntityNotFound(_0x421467,null))[_0xd041('0x2a')](function(_0x5e296e){if(_0x5e296e){_0x3ef4ae[_0xd041('0x32')]=_['keys'](db[_0xd041('0xb0')]['rawAttributes']);_0x3ef4ae[_0xd041('0x34')]=_[_0xd041('0x33')](_0x52c886[_0xd041('0x34')]);_0x3ef4ae['filters']=_[_0xd041('0x36')](_0x3ef4ae['model'],_0x3ef4ae['query']);_0xb335b2[_0xd041('0x38')]=_[_0xd041('0x36')](_0x3ef4ae[_0xd041('0x32')],qs['fields'](_0x52c886[_0xd041('0x34')]['fields']));_0xb335b2[_0xd041('0x38')]=_0xb335b2[_0xd041('0x38')][_0xd041('0x39')]?_0xb335b2[_0xd041('0x38')]:_0x3ef4ae['model'];if(!_0x52c886['query'][_0xd041('0x3a')](_0xd041('0x3b'))){_0xb335b2[_0xd041('0x23')]=qs[_0xd041('0x23')](_0x52c886['query'][_0xd041('0x23')]);_0xb335b2[_0xd041('0x22')]=qs[_0xd041('0x22')](_0x52c886['query'][_0xd041('0x22')]);}_0xb335b2[_0xd041('0x3c')]=qs[_0xd041('0x3d')](_0x52c886[_0xd041('0x34')]['sort']);_0xb335b2[_0xd041('0x3e')]=qs[_0xd041('0x35')](_[_0xd041('0xb1')](_0x52c886[_0xd041('0x34')],_0x3ef4ae[_0xd041('0x35')]));_0xb335b2[_0xd041('0x3e')][_0xd041('0x9c')]=_0x5e296e['id'];if(_0x52c886[_0xd041('0x34')][_0xd041('0x6e')]){_0xb335b2['where']=_['merge'](_0xb335b2[_0xd041('0x3e')],{'$or':_['map'](_0xb335b2[_0xd041('0x38')],function(_0x32ac76){var _0x516a06={};_0x516a06[_0x32ac76]={'$like':'%'+_0x52c886['query'][_0xd041('0x6e')]+'%'};return _0x516a06;})});}if(_0x52c886['query'][_0xd041('0x74')]){var _0x12b754=_0x52c886[_0xd041('0x34')][_0xd041('0x74')][_0xd041('0x7a')](',');var _0x4185eb={};_0x4185eb[_0x12b754[0x0]]={'$gte':moment(_0x12b754[0x1])['format'](_0xd041('0xb2'))};_0xb335b2[_0xd041('0x3e')]=_[_0xd041('0x8d')](_0xb335b2[_0xd041('0x3e')],_0x4185eb);}_0xb335b2=_[_0xd041('0x8d')]({},_0xb335b2,_0x52c886['options']);return db[_0xd041('0xb0')]['count']({'where':_0xb335b2[_0xd041('0x3e')]})[_0xd041('0x2a')](function(_0x2e96d6){_0x571d08[_0xd041('0x8b')]=_0x2e96d6;if(_0x52c886['query'][_0xd041('0xa4')]){_0xb335b2[_0xd041('0xa5')]=[{'all':!![]}];}return db[_0xd041('0xb0')][_0xd041('0xb3')](_0xb335b2);})[_0xd041('0x2a')](function(_0x2c72eb){_0x571d08[_0xd041('0xa1')]=_0x2c72eb;return _0x571d08;});}})[_0xd041('0x2a')](respondWithFilteredResult(_0x421467,_0xb335b2))[_0xd041('0xa2')](handleError(_0x421467,null));};exports[_0xd041('0xb4')]=function(_0x4ad74a,_0xf4be70,_0x5f5c45){return db['MailInteraction'][_0xd041('0xa7')]({'where':{'id':_0x4ad74a['params']['id']}})[_0xd041('0x2a')](handleEntityNotFound(_0xf4be70,null))[_0xd041('0x2a')](function(_0x27da63){if(_0x27da63){return _0x27da63[_0xd041('0xb5')](_0x4ad74a[_0xd041('0xa9')]['ids'],_[_0xd041('0xad')](_0x4ad74a['body'],[_0xd041('0xae'),'id'])||{})['spread'](function(){return db[_0xd041('0xb6')]['findAll']({'attributes':['id','name',_0xd041('0x41')],'where':{'id':_0x4ad74a[_0xd041('0xa9')]['ids']}});})[_0xd041('0x2a')](function(_0x5e6d63){socket[_0xd041('0xb7')](_0xd041('0xb8'),{'id':Number(_0x4ad74a[_0xd041('0xaa')]['id']),'tags':_0x5e6d63||[]});return{'id':Number(_0x4ad74a[_0xd041('0xaa')]['id']),'tags':_0x5e6d63||[]};});}})['then'](respondWithResult(_0xf4be70,null))['catch'](handleError(_0xf4be70,null));};exports[_0xd041('0xb9')]=function(_0x49c097,_0x35c4b3,_0x5817eb){return db[_0xd041('0x30')][_0xd041('0xa7')]({'where':{'id':_0x49c097[_0xd041('0xaa')]['id']}})[_0xd041('0x2a')](handleEntityNotFound(_0x35c4b3,null))[_0xd041('0x2a')](function(_0x17d2b4){if(_0x17d2b4){return _0x17d2b4[_0xd041('0xb9')](_0x49c097['query'][_0xd041('0xae')]);}})[_0xd041('0x2a')](respondWithStatusCode(_0x35c4b3,null))[_0xd041('0xa2')](handleError(_0x35c4b3,null));};exports['download']=function(_0x3d37d5,_0x107dcf){var _0x38d9fb=moment()['unix']()['toString']();var _0x5b733f=path['join'](config[_0xd041('0xba')],_0xd041('0xbb'),_0xd041('0xbc'),'attachments');var _0x34f175=path[_0xd041('0xbd')](config[_0xd041('0xba')],_0xd041('0xbb'),_0xd041('0xbc'),'tmp');var _0x535227=path[_0xd041('0xbd')](_0x34f175,_0x38d9fb);var _0x19448d=util['format'](_0xd041('0xbe'),_0x38d9fb);var _0x3c21e0=path[_0xd041('0xbd')](_0x34f175,_0x19448d);var _0x3ec244=![];return db[_0xd041('0x30')][_0xd041('0xa7')]({'where':{'id':_0x3d37d5[_0xd041('0xaa')]['id']}})[_0xd041('0x2a')](handleEntityNotFound(_0x107dcf,null))[_0xd041('0x2a')](function(_0x53ed12){if(_0x53ed12){return _0x53ed12[_0xd041('0xaf')]({'attributes':['id',_0xd041('0xa9'),_0xd041('0x42'),'to','cc','bcc',_0xd041('0xbf'),'createdAt'],'where':{'secret':![]},'include':_0x3d37d5[_0xd041('0x34')][_0xd041('0xc0')]?[{'model':db[_0xd041('0xc1')],'as':_0xd041('0xc2')}]:undefined,'order':qs[_0xd041('0x3d')]('id')});}return[];})[_0xd041('0x2a')](function(_0x378a7c){_0x3ec244=_0x378a7c['length'];if(_0x378a7c[_0xd041('0x39')]){fs['mkdirSync'](_0x535227);return BPromise[_0xd041('0xc3')](_0x378a7c,function(_0x52b8d4,_0x3d845e){var _0x4ecfa4=_0x52b8d4;var _0x37c75b={'from':_0x4ecfa4[_0xd041('0x42')],'to':_0x4ecfa4['to'],'subject':_0x4ecfa4[_0xd041('0xbf')],'html':_0x4ecfa4[_0xd041('0xa9')],'headers':{'Date':moment(_0x4ecfa4[_0xd041('0x55')])['format'](_0xd041('0xc4'))},'attachments':[]};if(_0x52b8d4['cc']){_0x37c75b['headers']['Cc']=_0x52b8d4['cc'];}if(_0x52b8d4[_0xd041('0xc5')]){_0x37c75b['headers'][_0xd041('0xc6')]=_0x52b8d4['bcc'];}return new BPromise(function(_0x596409,_0x2f7b4e){if(_0x52b8d4['Attachments']){for(var _0x3e6af5=0x0;_0x3e6af5<_0x52b8d4[_0xd041('0xc2')][_0xd041('0x39')];_0x3e6af5++){var _0x35aff4=_0x52b8d4[_0xd041('0xc2')][_0x3e6af5];var _0x37e666=path['join'](_0x5b733f,_0x35aff4[_0xd041('0xc7')]);if(fs[_0xd041('0xc8')](_0x37e666)){_0x37c75b[_0xd041('0xc0')]['push']({'name':_0x35aff4[_0xd041('0x2e')],'contentType':_0x35aff4[_0xd041('0xc9')],'data':fs[_0xd041('0xca')](_0x37e666)});}}}emlformat[_0xd041('0xcb')](_0x37c75b,function(_0x2b76ea,_0x40f71a){if(_0x2b76ea)return _0x2f7b4e(_0x2b76ea);fs[_0xd041('0xcc')](path[_0xd041('0xbd')](_0x535227,util['format'](_0xd041('0xcd'),_0x3d845e)),_0x40f71a);return _0x596409(_0x40f71a);});});});}})[_0xd041('0x2a')](function(){if(_0x3ec244){return new BPromise(function(_0x3dee26,_0x2ab3ba){zipdir(_0x535227,{'saveTo':_0x3c21e0},function(_0xabbaa0,_0x5f284e){if(_0xabbaa0)return _0x2ab3ba(_0xabbaa0);return _0x3dee26(_0x5f284e);});});}})[_0xd041('0x2a')](function(){if(_0x3ec244){return new BPromise(function(_0x1ab7fb,_0x227716){rimraf(_0x535227,function(_0x4471a2){if(_0x4471a2)_0x227716(_0x4471a2);return _0x1ab7fb();});});}})['then'](function(){if(_0x3ec244){return _0x107dcf['download'](_0x3c21e0,_0x19448d,function(_0x36eeb5){if(_0x36eeb5){console[_0xd041('0xce')](_0xd041('0xcf'),_0x36eeb5);}else{fs['unlinkSync'](_0x3c21e0);}});}else{return _0x107dcf[_0xd041('0x1e')](0xc8);}})[_0xd041('0xa2')](handleError(_0x107dcf,null));}; \ No newline at end of file +var _0xa5d0=['lastMsgBody','rows','catch','show','params','includeAll','include','options','find','create','body','describe','MailMessage','ids','omit','sort','spread','findAll','emit','removeTags','download','unix','root','server','tmp','interaction-%s.zip','bcc','subject','attachments','Attachment','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','type','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailInteraction.socket','status','json','limit','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','send','MailInteraction','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','where','pick','select','field','color','COUNT(*)','from','me.MailInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','ui.UserId\x20=\x20i.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','mail_messages','parse','forEach','createdAt','value','dateStart','utc','endOf','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','isArray','condition','TagId','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','\x20LIKE\x20?','c.lastName','\x20>\x20?','\x20<\x20?','Messages.count','LIKE','c.firstName','c.email','map','filter','isEmpty','MailAccountId','concat','$gte','$lte','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','toString','join','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','advancedFilter','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','tag','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','mail_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','it.MailInteractionId\x20=\x20i.id','t.id\x20IN\x20?','%s\x20>\x200','sequelize','count','keyBy','merge','Account.key','i.*','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','User.name','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Users','Tags','push','lastMsgText','trimStart','fromString'];(function(_0x2ac0b0,_0x115490){var _0x352688=function(_0xbd450e){while(--_0xbd450e){_0x2ac0b0['push'](_0x2ac0b0['shift']());}};_0x352688(++_0x115490);}(_0xa5d0,0x100));var _0x0a5d=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa5d0[_0x484e36];return _0xafc85d;};'use strict';var pdf=require(_0x0a5d('0x0'));var emlformat=require(_0x0a5d('0x1'));var rimraf=require(_0x0a5d('0x2'));var zipdir=require(_0x0a5d('0x3'));var jsonpatch=require(_0x0a5d('0x4'));var rp=require(_0x0a5d('0x5'));var moment=require('moment');var BPromise=require(_0x0a5d('0x6'));var Mustache=require(_0x0a5d('0x7'));var util=require(_0x0a5d('0x8'));var path=require(_0x0a5d('0x9'));var sox=require(_0x0a5d('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0a5d('0xb'));var squel=require(_0x0a5d('0xc'));var crypto=require(_0x0a5d('0xd'));var jsforce=require(_0x0a5d('0xe'));var deskjs=require(_0x0a5d('0xf'));var toCsv=require(_0x0a5d('0x10'));var querystring=require(_0x0a5d('0x11'));var Papa=require(_0x0a5d('0x12'));var htmlToText=require(_0x0a5d('0x13'));var Redis=require(_0x0a5d('0x14'));var authService=require(_0x0a5d('0x15'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x0a5d('0x16'));var logger=require(_0x0a5d('0x17'))(_0x0a5d('0x18'));var utils=require(_0x0a5d('0x19'));var config=require(_0x0a5d('0x1a'));var db=require(_0x0a5d('0x1b'))['db'];config[_0x0a5d('0x1c')]=_[_0x0a5d('0x1d')](config[_0x0a5d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a5d('0x1e'))(new Redis(config[_0x0a5d('0x1c')]));require(_0x0a5d('0x1f'))['register'](socket);function respondWithStatusCode(_0x513422,_0x516931){_0x516931=_0x516931||0xcc;return function(_0x27c18b){if(_0x27c18b){return _0x513422['sendStatus'](_0x516931);}return _0x513422['status'](_0x516931)['end']();};}function respondWithResult(_0x19941b,_0x3be666){_0x3be666=_0x3be666||0xc8;return function(_0x58a021){if(_0x58a021){return _0x19941b[_0x0a5d('0x20')](_0x3be666)[_0x0a5d('0x21')](_0x58a021);}};}function respondWithFilteredResult(_0x4e3057,_0x40d35e){return function(_0x17bcd6){if(_0x17bcd6){var _0x1854b2=_0x17bcd6['count'],_0x4b548a=_0x40d35e['offset'],_0x52c14f=_0x40d35e['offset']+_0x40d35e[_0x0a5d('0x22')],_0x54f25f;if(_0x52c14f>=_0x1854b2){_0x52c14f=_0x1854b2;_0x54f25f=0xc8;}else{_0x54f25f=0xce;}_0x4e3057['status'](_0x54f25f);return _0x4e3057[_0x0a5d('0x23')](_0x0a5d('0x24'),_0x4b548a+'-'+_0x52c14f+'/'+_0x1854b2)['json'](_0x17bcd6);}return null;};}function patchUpdates(_0x2ae42b){return function(_0x3b407e){try{jsonpatch[_0x0a5d('0x25')](_0x3b407e,_0x2ae42b,!![]);}catch(_0x2490dd){return BPromise[_0x0a5d('0x26')](_0x2490dd);}return _0x3b407e['save']();};}function saveUpdates(_0x518f30,_0x32612c){return function(_0x43f07){if(_0x43f07){return _0x43f07[_0x0a5d('0x27')](_0x518f30)['then'](function(_0x4de918){return _0x4de918;});}return null;};}function removeEntity(_0x3e0437,_0xe21ce6){return function(_0x409e91){if(_0x409e91){return _0x409e91['destroy']()[_0x0a5d('0x28')](function(){_0x3e0437[_0x0a5d('0x20')](0xcc)[_0x0a5d('0x29')]();});}};}function handleEntityNotFound(_0x887fbf,_0x145b67){return function(_0x28b99a){if(!_0x28b99a){_0x887fbf[_0x0a5d('0x2a')](0x194);}return _0x28b99a;};}function handleError(_0x34fb16,_0x403d20){_0x403d20=_0x403d20||0x1f4;return function(_0x222b5c){logger[_0x0a5d('0x2b')](_0x222b5c['stack']);if(_0x222b5c[_0x0a5d('0x2c')]){delete _0x222b5c[_0x0a5d('0x2c')];}_0x34fb16[_0x0a5d('0x20')](_0x403d20)[_0x0a5d('0x2d')](_0x222b5c);};}exports['index']=function(_0x40dbed,_0x2b3aed){var _0xcbe1f={},_0x36cf23={},_0x1d97f7={'count':0x0,'rows':[]};var _0x5ac4e7=db[_0x0a5d('0x2e')][_0x0a5d('0x2f')];_0x36cf23[_0x0a5d('0x30')]=_[_0x0a5d('0x31')](_0x5ac4e7);_0x36cf23[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x40dbed['query']);_0x36cf23[_0x0a5d('0x33')]=_[_0x0a5d('0x34')](_0x36cf23[_0x0a5d('0x30')],_0x36cf23['query']);_0xcbe1f['attributes']=_[_0x0a5d('0x34')](_0x36cf23['model'],qs[_0x0a5d('0x35')](_0x40dbed[_0x0a5d('0x32')]['fields']));_0xcbe1f[_0x0a5d('0x36')]=_0xcbe1f[_0x0a5d('0x36')][_0x0a5d('0x37')]?_0xcbe1f['attributes']:_0x36cf23[_0x0a5d('0x30')];if(!_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x38')](_0x0a5d('0x39'))){_0xcbe1f[_0x0a5d('0x22')]=qs[_0x0a5d('0x22')](_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x22')]);_0xcbe1f[_0x0a5d('0x3a')]=qs[_0x0a5d('0x3a')](_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x3a')]);}_0xcbe1f[_0x0a5d('0x3b')]=qs['sort'](_0x40dbed[_0x0a5d('0x32')]['sort']);_0xcbe1f[_0x0a5d('0x3c')]=qs[_0x0a5d('0x33')](_[_0x0a5d('0x3d')](_0x40dbed[_0x0a5d('0x32')],_0x36cf23[_0x0a5d('0x33')]));var _0x20aa11=[];var _0x41ae64=squel[_0x0a5d('0x3e')]()[_0x0a5d('0x3f')]('id')[_0x0a5d('0x3f')](_0x0a5d('0x2c'))['field'](_0x0a5d('0x40'))['from']('tools_tags');var _0xba4ec7=squel[_0x0a5d('0x3e')]()[_0x0a5d('0x3f')](_0x0a5d('0x41'))[_0x0a5d('0x42')]('mail_messages','me')[_0x0a5d('0x3c')](_0x0a5d('0x43'))['where'](_0x0a5d('0x44'))[_0x0a5d('0x3c')](_0x0a5d('0x45'));var _0x2f1370=squel[_0x0a5d('0x3e')]()[_0x0a5d('0x3f')](_0x0a5d('0x46'))[_0x0a5d('0x3f')](_0x0a5d('0x47'))['from'](_0x0a5d('0x48'),'ui')[_0x0a5d('0x49')](_0x0a5d('0x4a'),'u',_0x0a5d('0x4b'));var _0x1f3b22=squel['select']()[_0x0a5d('0x42')](_0x0a5d('0x4c'),'i')[_0x0a5d('0x49')](_0x0a5d('0x48'),'ui',_0x0a5d('0x4d'))[_0x0a5d('0x49')](_0x0a5d('0x4a'),'u',_0x0a5d('0x4b'))[_0x0a5d('0x49')]('cm_contacts','c',_0x0a5d('0x4e'))[_0x0a5d('0x49')]('users','o','o.id\x20=\x20i.UserId')[_0x0a5d('0x49')]('mail_accounts','a',_0x0a5d('0x4f'))[_0x0a5d('0x49')](_0x0a5d('0x50'),'me','me.MailInteractionId\x20=\x20i.id');var _0x5c0538=squel['expr']();if(_0x40dbed[_0x0a5d('0x32')]['advancedFilter']){var _0x2d8ee7=JSON[_0x0a5d('0x51')](_0x40dbed['query']['advancedFilter']);_[_0x0a5d('0x31')](_0x2d8ee7)[_0x0a5d('0x52')](function(_0x36ab82){var _0x1ff7ea=_0x2d8ee7[_0x36ab82];if(_0x36ab82===_0x0a5d('0x53')){var _0x299b6f=moment(_0x1ff7ea[_0x0a5d('0x54')][_0x0a5d('0x55')])['startOf']('day')[_0x0a5d('0x56')]()['format']();var _0x5e5b9d=moment(_0x5e5b9d)[_0x0a5d('0x56')]()[_0x0a5d('0x57')]('day')[_0x0a5d('0x58')]();_0x5c0538[_0x0a5d('0x59')](_0x0a5d('0x5a'),_0x299b6f,_0x5e5b9d);}else{if(_[_0x0a5d('0x5b')](_0x1ff7ea['condition'])){_0x1ff7ea[_0x0a5d('0x5c')][_0x0a5d('0x52')](function(_0x50c196){switch(_0x1ff7ea[_0x0a5d('0x5c')]['value']){case'IS':if(_0x36ab82!==_0x0a5d('0x5d')&&_0x36ab82!=='Messages.count'){if(_[_0x0a5d('0x5b')](_0x1ff7ea[_0x0a5d('0x54')])&&_0x1ff7ea[_0x0a5d('0x54')][_0x0a5d('0x37')]>0x1){_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x5f'),_0x1ff7ea[_0x0a5d('0x54')]);}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea[_0x0a5d('0x54')][0x0]);}}break;case'=':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea[_0x0a5d('0x54')]);break;case'LIKE':if(_0x36ab82===_0x0a5d('0x61')){_0x5c0538[_0x0a5d('0x59')]('c.firstName'+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or'](_0x0a5d('0x63')+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or']('c.email'+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}break;case'>':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x64'),_0x1ff7ea[_0x0a5d('0x54')]);break;case'<':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x65'),_0x1ff7ea['value']);break;}});}else{switch(_0x1ff7ea[_0x0a5d('0x5c')][_0x0a5d('0x54')]){case'IS':if(_0x36ab82!==_0x0a5d('0x5d')&&_0x36ab82!==_0x0a5d('0x66')){if(_[_0x0a5d('0x5b')](_0x1ff7ea[_0x0a5d('0x54')])&&_0x1ff7ea[_0x0a5d('0x54')][_0x0a5d('0x37')]>0x1){_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x5f'),_0x1ff7ea[_0x0a5d('0x54')]);}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea['value'][0x0]);}}break;case'=':_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x60'),_0x1ff7ea['value']);break;case _0x0a5d('0x67'):if(_0x36ab82==='ContactId'){_0x5c0538[_0x0a5d('0x59')](_0x0a5d('0x68')+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or'](_0x0a5d('0x63')+'\x20LIKE\x20?','%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');_0x5c0538['or'](_0x0a5d('0x69')+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}else{_0x5c0538[_0x0a5d('0x59')](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x62'),'%'+_0x1ff7ea[_0x0a5d('0x54')]+'%');}break;case'>':_0x5c0538['and'](_0x1ff7ea['tableAlias']+'.'+_0x36ab82+_0x0a5d('0x64'),_0x1ff7ea[_0x0a5d('0x54')]);break;case'<':_0x5c0538['and'](_0x1ff7ea[_0x0a5d('0x5e')]+'.'+_0x36ab82+_0x0a5d('0x65'),_0x1ff7ea[_0x0a5d('0x54')]);break;}}}});}else{var _0x762871=_(Object[_0x0a5d('0x31')](_0x40dbed['query']))[_0x0a5d('0x6a')](function(_0x42e8f3){return _0x5ac4e7[_0x0a5d('0x38')](_0x42e8f3)?_0x42e8f3:undefined;})[_0x0a5d('0x6b')](function(_0x1bf258){return!_['isNil'](_0x1bf258);})[_0x0a5d('0x54')]();if(!_[_0x0a5d('0x6c')](_0x762871)){_0x762871[_0x0a5d('0x52')](function(_0x408823){if(_0x408823===_0x0a5d('0x6d')){_0x1f3b22['where']('i.MailAccountId\x20IN\x20?',[][_0x0a5d('0x6e')](_0x40dbed[_0x0a5d('0x32')][_0x408823]));}else if(_0x408823==='createdAt'){var _0x2715ac=JSON[_0x0a5d('0x51')](_0x40dbed[_0x0a5d('0x32')][_0x408823])[_0x0a5d('0x6f')];var _0x44319c=JSON[_0x0a5d('0x51')](_0x40dbed[_0x0a5d('0x32')][_0x408823])[_0x0a5d('0x70')];_0x1f3b22[_0x0a5d('0x3c')](_0x0a5d('0x5a'),_0x2715ac,_0x44319c);}else{_0x1f3b22[_0x0a5d('0x3c')]('i.'+_0x408823+_0x0a5d('0x60'),_0x40dbed[_0x0a5d('0x32')][_0x408823]);}});}if(_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x6b')]){var _0x3cf3ff=_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x6b')][_0x0a5d('0x71')]('\x5c','\x5c\x5c')[_0x0a5d('0x71')]('\x27\x27',_0x0a5d('0x72'));if(qs[_0x0a5d('0x73')](_0x3cf3ff)){_0x5c0538['or'](_0x0a5d('0x74'),_0x3cf3ff+'%');}else if(qs[_0x0a5d('0x75')](_0x3cf3ff)){_0x5c0538['or'](_0x0a5d('0x76'),_0x3cf3ff+'%');}else{var _0x2287db=[];_0x3cf3ff['split']('\x20')[_0x0a5d('0x52')](function(_0x42521c){_0x2287db['push']('+'+_0x42521c[_0x0a5d('0x77')]());});var _0x5b8230=_0x2287db[_0x0a5d('0x78')]('\x20');_0x5c0538['or'](_0x0a5d('0x79'),_0x5b8230)['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',_0x5b8230);}}}_0x1f3b22[_0x0a5d('0x3c')](_0x5c0538);if(_0xcbe1f[_0x0a5d('0x3b')]){_0xcbe1f[_0x0a5d('0x3b')][_0x0a5d('0x52')](function(_0x59a49a){_0x1f3b22['order']('i.'+_0x59a49a[0x0],_0x59a49a[0x1]==='DESC'?![]:!![]);});}_0x1f3b22[_0x0a5d('0x7a')](_0x0a5d('0x7b'));var _0x31796c={'type':db[_0x0a5d('0x7c')][_0x0a5d('0x7d')][_0x0a5d('0x7e')],'raw':!![]};var _0x4d7bc5=_0x1f3b22[_0x0a5d('0x7f')]()[_0x0a5d('0x3f')](_0x0a5d('0x41'));if(!_0x40dbed['query'][_0x0a5d('0x80')]){if(_0x40dbed['query'][_0x0a5d('0x81')]){if(_0x40dbed[_0x0a5d('0x32')]['read']==0x1){_0x4d7bc5[_0x0a5d('0x3c')](util[_0x0a5d('0x58')](_0x0a5d('0x82'),_0xba4ec7[_0x0a5d('0x77')]()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x84'));}else{_0x4d7bc5['where'](util[_0x0a5d('0x58')]('%s\x20>\x200',_0xba4ec7[_0x0a5d('0x77')]()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x85'));}}if(_0x40dbed[_0x0a5d('0x32')]['tag']){var _0x22f580=_[_0x0a5d('0x5b')](_0x40dbed[_0x0a5d('0x32')][_0x0a5d('0x86')])?_0x40dbed[_0x0a5d('0x32')]['tag']:new Array(_0x40dbed['query'][_0x0a5d('0x86')]);var _0x10487d=squel[_0x0a5d('0x87')]();_0x22f580['forEach'](function(_0x392741){_0x10487d['or'](_0x0a5d('0x88'),'%,'+_0x392741+',%');});_0x1f3b22[_0x0a5d('0x83')](_0x10487d);_0x4d7bc5[_0x0a5d('0x49')](_0x0a5d('0x89'),'it','it.MailInteractionId\x20=\x20i.id');_0x4d7bc5[_0x0a5d('0x49')](_0x0a5d('0x8a'),'t',_0x0a5d('0x8b'));_0x4d7bc5[_0x0a5d('0x3c')]('t.id\x20IN\x20?',_0x22f580);}}else{var _0x2d8ee7=JSON[_0x0a5d('0x51')](_0x40dbed['query']['advancedFilter']);_[_0x0a5d('0x31')](_0x2d8ee7)['forEach'](function(_0xc48998){var _0x3ad924=_0x2d8ee7[_0xc48998];if(_0xc48998==='TagId'){var _0x2c389e=_0x3ad924[_0x0a5d('0x54')];var _0x29b7ad=squel[_0x0a5d('0x87')]();_0x2c389e[_0x0a5d('0x52')](function(_0x557c93){_0x29b7ad['or'](_0x0a5d('0x88'),'%,'+_0x557c93+',%');});_0x1f3b22[_0x0a5d('0x83')](_0x29b7ad);_0x4d7bc5[_0x0a5d('0x49')]('mail_interaction_has_tags','it',_0x0a5d('0x8c'));_0x4d7bc5[_0x0a5d('0x49')](_0x0a5d('0x8a'),'t',_0x0a5d('0x8b'));_0x4d7bc5[_0x0a5d('0x3c')](_0x0a5d('0x8d'),_0x2c389e);}else if(_0xc48998===_0x0a5d('0x66')){if(_0x3ad924[_0x0a5d('0x54')][_0x0a5d('0x37')]===0x1){if(_0x3ad924[_0x0a5d('0x54')][0x0]===0x1){_0x4d7bc5[_0x0a5d('0x3c')](util['format'](_0x0a5d('0x82'),_0xba4ec7['toString']()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x84'));}else{_0x4d7bc5['where'](util[_0x0a5d('0x58')](_0x0a5d('0x8e'),_0xba4ec7['toString']()));_0x1f3b22[_0x0a5d('0x83')](_0x0a5d('0x85'));}}}});}db[_0x0a5d('0x8f')][_0x0a5d('0x32')](_0x4d7bc5[_0x0a5d('0x77')](),_0x31796c)['then'](function(_0x23879b){_0x1d97f7[_0x0a5d('0x90')]=_0x23879b['length'];if(_0x1d97f7[_0x0a5d('0x90')]===0x0)return[];return db[_0x0a5d('0x8f')]['query'](_0x41ae64[_0x0a5d('0x77')](),_0x31796c)[_0x0a5d('0x28')](function(_0x184348){_0x20aa11=_[_0x0a5d('0x91')](_0x184348,'id');_0x31796c=_[_0x0a5d('0x92')](_0x31796c,{'model':db[_0x0a5d('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1f3b22[_0x0a5d('0x3f')](_0xba4ec7,_0x0a5d('0x66'));_0x1f3b22[_0x0a5d('0x3f')]('a.key',_0x0a5d('0x93'));_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x94'));_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x68'),'Contact.firstName');_0x1f3b22['field'](_0x0a5d('0x63'),'Contact.lastName');_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x69'),_0x0a5d('0x95'));_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x96'),'Contact.phone');_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x97'),'Contact.mobile');_0x1f3b22[_0x0a5d('0x3f')](_0x0a5d('0x98'),_0x0a5d('0x99'));_0x1f3b22[_0x0a5d('0x3f')]('u.fullname',_0x0a5d('0x9a'));_0x1f3b22['field'](_0x0a5d('0x9b'),_0x0a5d('0x9c'));_0x1f3b22[_0x0a5d('0x49')](_0x0a5d('0x89'),'it',_0x0a5d('0x8c'));_0x1f3b22[_0x0a5d('0x49')]('tools_tags','t',_0x0a5d('0x8b'));_0x1f3b22[_0x0a5d('0x22')](_0xcbe1f[_0x0a5d('0x22')]);_0x1f3b22[_0x0a5d('0x3a')](_0xcbe1f['offset']);return db[_0x0a5d('0x8f')]['query'](_0x1f3b22[_0x0a5d('0x77')](),_0x31796c);})[_0x0a5d('0x28')](function(_0x2af292){_0x2f1370[_0x0a5d('0x3c')](_0x0a5d('0x9d'),_[_0x0a5d('0x6a')](_0x2af292,'id'));return db['sequelize'][_0x0a5d('0x32')](_0x2f1370[_0x0a5d('0x77')](),_0x31796c)['then'](function(_0x3c9ceb){var _0x1bb41f=_[_0x0a5d('0x9e')](_0x3c9ceb,_0x0a5d('0x9f'));_0x2af292[_0x0a5d('0x52')](function(_0x8cdbb0){if(_0x1bb41f[_0x8cdbb0['id']]){_0x8cdbb0[_0x0a5d('0xa0')]=_[_0x0a5d('0x6a')](_0x1bb41f[_0x8cdbb0['id']],function(_0x3d2f37){return{'id':_0x3d2f37['id']};});}if(_0x8cdbb0[_0x0a5d('0x9c')]){_0x8cdbb0['Tags']=[];_0x8cdbb0['TagIds']['split'](',')['forEach'](function(_0x3eb2a2){_0x8cdbb0[_0x0a5d('0xa1')][_0x0a5d('0xa2')](_0x20aa11[_0x3eb2a2]);});}delete _0x8cdbb0['TagIds'];if(!_0x8cdbb0[_0x0a5d('0xa3')]){_0x8cdbb0[_0x0a5d('0xa3')]=_[_0x0a5d('0xa4')](htmlToText[_0x0a5d('0xa5')](_0x8cdbb0[_0x0a5d('0xa6')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}});return _0x2af292;});});})[_0x0a5d('0x28')](function(_0x54d931){_0x1d97f7[_0x0a5d('0xa7')]=_0x54d931;return _0x1d97f7;})['then'](respondWithFilteredResult(_0x2b3aed,_0xcbe1f))[_0x0a5d('0xa8')](handleError(_0x2b3aed,null));};exports[_0x0a5d('0xa9')]=function(_0x2ca917,_0x4daec3){var _0xde5d1b={'raw':![],'where':{'id':_0x2ca917[_0x0a5d('0xaa')]['id']}},_0x39f04c={};_0x39f04c['model']=_['keys'](db[_0x0a5d('0x2e')][_0x0a5d('0x2f')]);_0x39f04c['query']=_[_0x0a5d('0x31')](_0x2ca917['query']);_0x39f04c['filters']=_[_0x0a5d('0x34')](_0x39f04c[_0x0a5d('0x30')],_0x39f04c[_0x0a5d('0x32')]);_0xde5d1b[_0x0a5d('0x36')]=_[_0x0a5d('0x34')](_0x39f04c[_0x0a5d('0x30')],qs[_0x0a5d('0x35')](_0x2ca917[_0x0a5d('0x32')]['fields']));_0xde5d1b[_0x0a5d('0x36')]=_0xde5d1b['attributes'][_0x0a5d('0x37')]?_0xde5d1b[_0x0a5d('0x36')]:_0x39f04c[_0x0a5d('0x30')];if(_0x2ca917[_0x0a5d('0x32')][_0x0a5d('0xab')]){_0xde5d1b[_0x0a5d('0xac')]=[{'all':!![]}];}_0xde5d1b=_[_0x0a5d('0x92')]({},_0xde5d1b,_0x2ca917[_0x0a5d('0xad')]);return db['MailInteraction'][_0x0a5d('0xae')](_0xde5d1b)['then'](handleEntityNotFound(_0x4daec3,null))[_0x0a5d('0x28')](respondWithResult(_0x4daec3,null))[_0x0a5d('0xa8')](handleError(_0x4daec3,null));};exports[_0x0a5d('0xaf')]=function(_0x489644,_0x571400){return db['MailInteraction'][_0x0a5d('0xaf')](_0x489644[_0x0a5d('0xb0')],{})[_0x0a5d('0x28')](respondWithResult(_0x571400,0xc9))['catch'](handleError(_0x571400,null));};exports[_0x0a5d('0x27')]=function(_0x4620b6,_0x2f3843){if(_0x4620b6[_0x0a5d('0xb0')]['id']){delete _0x4620b6[_0x0a5d('0xb0')]['id'];}return db[_0x0a5d('0x2e')][_0x0a5d('0xae')]({'where':{'id':_0x4620b6[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x2f3843,null))['then'](saveUpdates(_0x4620b6[_0x0a5d('0xb0')],null))['then'](respondWithResult(_0x2f3843,null))['catch'](handleError(_0x2f3843,null));};exports['destroy']=function(_0x39c547,_0x3c7d53){return db['MailInteraction'][_0x0a5d('0xae')]({'where':{'id':_0x39c547[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x3c7d53,null))[_0x0a5d('0x28')](removeEntity(_0x3c7d53,null))[_0x0a5d('0xa8')](handleError(_0x3c7d53,null));};exports[_0x0a5d('0xb1')]=function(_0x11aba2,_0x42593e){return db['MailInteraction'][_0x0a5d('0xb1')]()[_0x0a5d('0x28')](respondWithResult(_0x42593e,null))[_0x0a5d('0xa8')](handleError(_0x42593e,null));};exports['addMessage']=function(_0x3e0a31,_0x12c9a2,_0x46e1f9){return db[_0x0a5d('0xb2')]['find']({'where':{'id':_0x3e0a31[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x12c9a2,null))[_0x0a5d('0x28')](function(_0x33f43e){if(_0x33f43e){return _0x33f43e['addMessage'](_0x3e0a31['body'][_0x0a5d('0xb3')],_[_0x0a5d('0xb4')](_0x3e0a31[_0x0a5d('0xb0')],[_0x0a5d('0xb3'),'id'])||{});}})[_0x0a5d('0x28')](respondWithResult(_0x12c9a2,null))[_0x0a5d('0xa8')](handleError(_0x12c9a2,null));};exports['getMessages']=function(_0x450494,_0x555f90,_0x211447){var _0x2d7dcc={'raw':![],'where':{}};var _0x356d47={};var _0x1a183b={'count':0x0,'rows':[]};return db[_0x0a5d('0x2e')]['findOne']({'where':{'id':_0x450494[_0x0a5d('0xaa')]['id']}})['then'](handleEntityNotFound(_0x555f90,null))['then'](function(_0x1671ac){if(_0x1671ac){_0x356d47[_0x0a5d('0x30')]=_['keys'](db[_0x0a5d('0xb2')]['rawAttributes']);_0x356d47[_0x0a5d('0x32')]=_[_0x0a5d('0x31')](_0x450494[_0x0a5d('0x32')]);_0x356d47[_0x0a5d('0x33')]=_['intersection'](_0x356d47['model'],_0x356d47[_0x0a5d('0x32')]);_0x2d7dcc[_0x0a5d('0x36')]=_[_0x0a5d('0x34')](_0x356d47[_0x0a5d('0x30')],qs[_0x0a5d('0x35')](_0x450494[_0x0a5d('0x32')]['fields']));_0x2d7dcc[_0x0a5d('0x36')]=_0x2d7dcc['attributes'][_0x0a5d('0x37')]?_0x2d7dcc['attributes']:_0x356d47[_0x0a5d('0x30')];if(!_0x450494[_0x0a5d('0x32')][_0x0a5d('0x38')](_0x0a5d('0x39'))){_0x2d7dcc[_0x0a5d('0x22')]=qs[_0x0a5d('0x22')](_0x450494[_0x0a5d('0x32')][_0x0a5d('0x22')]);_0x2d7dcc[_0x0a5d('0x3a')]=qs[_0x0a5d('0x3a')](_0x450494[_0x0a5d('0x32')][_0x0a5d('0x3a')]);}_0x2d7dcc[_0x0a5d('0x3b')]=qs[_0x0a5d('0xb5')](_0x450494[_0x0a5d('0x32')][_0x0a5d('0xb5')]);_0x2d7dcc['where']=qs['filters'](_[_0x0a5d('0x3d')](_0x450494[_0x0a5d('0x32')],_0x356d47[_0x0a5d('0x33')]));_0x2d7dcc['where']['MailInteractionId']=_0x1671ac['id'];if(_0x450494[_0x0a5d('0x32')][_0x0a5d('0x6b')]){_0x2d7dcc[_0x0a5d('0x3c')]=_['merge'](_0x2d7dcc[_0x0a5d('0x3c')],{'$or':_[_0x0a5d('0x6a')](_0x2d7dcc[_0x0a5d('0x36')],function(_0x3af778){var _0x30f65d={};_0x30f65d[_0x3af778]={'$like':'%'+_0x450494[_0x0a5d('0x32')][_0x0a5d('0x6b')]+'%'};return _0x30f65d;})});}if(_0x450494['query'][_0x0a5d('0x6f')]){var _0x3c963f=_0x450494[_0x0a5d('0x32')][_0x0a5d('0x6f')]['split'](',');var _0x19a87f={};_0x19a87f[_0x3c963f[0x0]]={'$gte':moment(_0x3c963f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x2d7dcc[_0x0a5d('0x3c')]=_[_0x0a5d('0x92')](_0x2d7dcc[_0x0a5d('0x3c')],_0x19a87f);}_0x2d7dcc=_['merge']({},_0x2d7dcc,_0x450494[_0x0a5d('0xad')]);return db[_0x0a5d('0xb2')][_0x0a5d('0x90')]({'where':_0x2d7dcc[_0x0a5d('0x3c')]})[_0x0a5d('0x28')](function(_0x1c4e66){_0x1a183b[_0x0a5d('0x90')]=_0x1c4e66;if(_0x450494[_0x0a5d('0x32')][_0x0a5d('0xab')]){_0x2d7dcc[_0x0a5d('0xac')]=[{'all':!![]}];}return db[_0x0a5d('0xb2')]['findAll'](_0x2d7dcc);})['then'](function(_0xdedfa1){_0x1a183b[_0x0a5d('0xa7')]=_0xdedfa1;return _0x1a183b;});}})[_0x0a5d('0x28')](respondWithFilteredResult(_0x555f90,_0x2d7dcc))[_0x0a5d('0xa8')](handleError(_0x555f90,null));};exports['addTags']=function(_0x40082c,_0x418463,_0x1b8ef9){return db['MailInteraction'][_0x0a5d('0xae')]({'where':{'id':_0x40082c[_0x0a5d('0xaa')]['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x418463,null))[_0x0a5d('0x28')](function(_0xbd3fda){if(_0xbd3fda){return _0xbd3fda['setTags'](_0x40082c[_0x0a5d('0xb0')]['ids'],_['omit'](_0x40082c[_0x0a5d('0xb0')],['ids','id'])||{})[_0x0a5d('0xb6')](function(){return db['Tag'][_0x0a5d('0xb7')]({'attributes':['id',_0x0a5d('0x2c'),_0x0a5d('0x40')],'where':{'id':_0x40082c[_0x0a5d('0xb0')][_0x0a5d('0xb3')]}});})['then'](function(_0x2772c0){socket[_0x0a5d('0xb8')]('mailInteractionTags:save',{'id':Number(_0x40082c[_0x0a5d('0xaa')]['id']),'tags':_0x2772c0||[]});return{'id':Number(_0x40082c[_0x0a5d('0xaa')]['id']),'tags':_0x2772c0||[]};});}})[_0x0a5d('0x28')](respondWithResult(_0x418463,null))[_0x0a5d('0xa8')](handleError(_0x418463,null));};exports[_0x0a5d('0xb9')]=function(_0x137a55,_0x4d8a09,_0x132aa7){return db[_0x0a5d('0x2e')][_0x0a5d('0xae')]({'where':{'id':_0x137a55['params']['id']}})[_0x0a5d('0x28')](handleEntityNotFound(_0x4d8a09,null))['then'](function(_0xd4a59d){if(_0xd4a59d){return _0xd4a59d['removeTags'](_0x137a55[_0x0a5d('0x32')]['ids']);}})[_0x0a5d('0x28')](respondWithStatusCode(_0x4d8a09,null))[_0x0a5d('0xa8')](handleError(_0x4d8a09,null));};exports[_0x0a5d('0xba')]=function(_0x4710de,_0x3583ff){var _0x2f8ba3=moment()[_0x0a5d('0xbb')]()[_0x0a5d('0x77')]();var _0x48317e=path[_0x0a5d('0x78')](config[_0x0a5d('0xbc')],_0x0a5d('0xbd'),'files','attachments');var _0x15dc09=path['join'](config[_0x0a5d('0xbc')],'server','files',_0x0a5d('0xbe'));var _0xf39ef9=path['join'](_0x15dc09,_0x2f8ba3);var _0x214ea0=util[_0x0a5d('0x58')](_0x0a5d('0xbf'),_0x2f8ba3);var _0x13cd92=path[_0x0a5d('0x78')](_0x15dc09,_0x214ea0);var _0x35fed5=![];return db[_0x0a5d('0x2e')]['find']({'where':{'id':_0x4710de['params']['id']}})['then'](handleEntityNotFound(_0x3583ff,null))[_0x0a5d('0x28')](function(_0x2cadf6){if(_0x2cadf6){return _0x2cadf6['getMessages']({'attributes':['id','body',_0x0a5d('0x42'),'to','cc',_0x0a5d('0xc0'),_0x0a5d('0xc1'),'createdAt'],'where':{'secret':![]},'include':_0x4710de[_0x0a5d('0x32')][_0x0a5d('0xc2')]?[{'model':db[_0x0a5d('0xc3')],'as':'Attachments'}]:undefined,'order':qs[_0x0a5d('0xb5')]('id')});}return[];})[_0x0a5d('0x28')](function(_0x286225){_0x35fed5=_0x286225[_0x0a5d('0x37')];if(_0x286225[_0x0a5d('0x37')]){fs[_0x0a5d('0xc4')](_0xf39ef9);return BPromise[_0x0a5d('0xc5')](_0x286225,function(_0x4718ad,_0x28a2bb){var _0x1fc150=_0x4718ad;var _0x2469b4={'from':_0x1fc150[_0x0a5d('0x42')],'to':_0x1fc150['to'],'subject':_0x1fc150[_0x0a5d('0xc1')],'html':_0x1fc150['body'],'headers':{'Date':moment(_0x1fc150[_0x0a5d('0x53')])[_0x0a5d('0x58')](_0x0a5d('0xc6'))},'attachments':[]};if(_0x4718ad['cc']){_0x2469b4[_0x0a5d('0xc7')]['Cc']=_0x4718ad['cc'];}if(_0x4718ad[_0x0a5d('0xc0')]){_0x2469b4[_0x0a5d('0xc7')][_0x0a5d('0xc8')]=_0x4718ad[_0x0a5d('0xc0')];}return new BPromise(function(_0x599cc3,_0xae1d3e){if(_0x4718ad[_0x0a5d('0xc9')]){for(var _0x557f8e=0x0;_0x557f8e<_0x4718ad[_0x0a5d('0xc9')]['length'];_0x557f8e++){var _0x575401=_0x4718ad[_0x0a5d('0xc9')][_0x557f8e];var _0x86c814=path[_0x0a5d('0x78')](_0x48317e,_0x575401[_0x0a5d('0xca')]);if(fs[_0x0a5d('0xcb')](_0x86c814)){_0x2469b4[_0x0a5d('0xc2')]['push']({'name':_0x575401[_0x0a5d('0x2c')],'contentType':_0x575401[_0x0a5d('0xcc')],'data':fs[_0x0a5d('0xcd')](_0x86c814)});}}}emlformat[_0x0a5d('0xce')](_0x2469b4,function(_0x2e9312,_0x5878bd){if(_0x2e9312)return _0xae1d3e(_0x2e9312);fs[_0x0a5d('0xcf')](path['join'](_0xf39ef9,util[_0x0a5d('0x58')]('message%d.eml',_0x28a2bb)),_0x5878bd);return _0x599cc3(_0x5878bd);});});});}})[_0x0a5d('0x28')](function(){if(_0x35fed5){return new BPromise(function(_0x50b2f6,_0x2889c6){zipdir(_0xf39ef9,{'saveTo':_0x13cd92},function(_0x3b0c9f,_0x23b13b){if(_0x3b0c9f)return _0x2889c6(_0x3b0c9f);return _0x50b2f6(_0x23b13b);});});}})[_0x0a5d('0x28')](function(){if(_0x35fed5){return new BPromise(function(_0xaa7151,_0x4398e5){rimraf(_0xf39ef9,function(_0x1784b){if(_0x1784b)_0x4398e5(_0x1784b);return _0xaa7151();});});}})['then'](function(){if(_0x35fed5){return _0x3583ff['download'](_0x13cd92,_0x214ea0,function(_0x593ab7){if(_0x593ab7){console[_0x0a5d('0xd0')](_0x0a5d('0xd1'),_0x593ab7);}else{fs[_0x0a5d('0xd2')](_0x13cd92);}});}else{return _0x3583ff['sendStatus'](0xc8);}})['catch'](handleError(_0x3583ff,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index eccf81c..c9dcc01 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 _0x11c3=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x328a39,_0x4ea34d){var _0x1ce8e3=function(_0x235b15){while(--_0x235b15){_0x328a39['push'](_0x328a39['shift']());}};_0x1ce8e3(++_0x4ea34d);}(_0x11c3,0x1a7));var _0x311c=function(_0x102ad3,_0x42a978){_0x102ad3=_0x102ad3-0x0;var _0x4d8e6=_0x11c3[_0x102ad3];return _0x4d8e6;};'use strict';var EventEmitter=require(_0x311c('0x0'));var MailInteraction=require(_0x311c('0x1'))['db']['MailInteraction'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x311c('0x2')](0x0);var events={'afterCreate':_0x311c('0x3'),'afterUpdate':_0x311c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x519d45){return function(_0x23f551,_0x1d769c,_0x7b2527){MailInteractionEvents[_0x311c('0x5')](_0x519d45+':'+_0x23f551['id'],_0x23f551);MailInteractionEvents[_0x311c('0x5')](_0x519d45,_0x23f551);_0x7b2527(null);};}for(var e in events){if(events[_0x311c('0x6')](e)){var event=events[e];MailInteraction[_0x311c('0x7')](e,emitEvent(event));}}module[_0x311c('0x8')]=MailInteractionEvents; \ No newline at end of file +var _0x66b6=['../../mysqldb','MailInteraction','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x120bc2,_0x57a253){var _0x454a41=function(_0x21adfe){while(--_0x21adfe){_0x120bc2['push'](_0x120bc2['shift']());}};_0x454a41(++_0x57a253);}(_0x66b6,0x1c7));var _0x666b=function(_0x49aa7d,_0x5d46d8){_0x49aa7d=_0x49aa7d-0x0;var _0xdd0d26=_0x66b6[_0x49aa7d];return _0xdd0d26;};'use strict';var EventEmitter=require(_0x666b('0x0'));var MailInteraction=require(_0x666b('0x1'))['db'][_0x666b('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x666b('0x3')};function emitEvent(_0x3946b5){return function(_0x19b152,_0x5c25e8,_0x4dc813){MailInteractionEvents[_0x666b('0x4')](_0x3946b5+':'+_0x19b152['id'],_0x19b152);MailInteractionEvents[_0x666b('0x4')](_0x3946b5,_0x19b152);_0x4dc813(null);};}for(var e in events){if(events[_0x666b('0x5')](e)){var event=events[e];MailInteraction[_0x666b('0x6')](e,emitEvent(event));}}module[_0x666b('0x7')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index e00b232..0683be0 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 _0x1782=['rimraf','../../config/environment','fti_mail_interactions','subject','FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatus','changed','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40ba7c,_0x3622f5){var _0x59b6b6=function(_0x3bd990){while(--_0x3bd990){_0x40ba7c['push'](_0x40ba7c['shift']());}};_0x59b6b6(++_0x3622f5);}(_0x1782,0x13e));var _0x2178=function(_0x74a9ea,_0x22132f){_0x74a9ea=_0x74a9ea-0x0;var _0x353b38=_0x1782[_0x74a9ea];return _0x353b38;};'use strict';var _=require(_0x2178('0x0'));var util=require('util');var logger=require(_0x2178('0x1'))(_0x2178('0x2'));var moment=require(_0x2178('0x3'));var BPromise=require(_0x2178('0x4'));var rp=require(_0x2178('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2178('0x6'));var config=require(_0x2178('0x7'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x3c4dd1,_0x3b0f74){return _0x3c4dd1['define']('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0x2178('0x8'),'fields':[_0x2178('0x9'),'to'],'type':_0x2178('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x139567,_0x1cb1e6,_0x5ac52e){if(_0x139567['substatus']){_0x139567[_0x2178('0xb')]=moment()[_0x2178('0xc')](_0x2178('0xd'));}if(_0x139567[_0x2178('0xe')]){_0x139567[_0x2178('0xf')]=moment()[_0x2178('0xc')](_0x2178('0xd'));}_0x5ac52e(null,_0x1cb1e6);},'beforeUpdate':function(_0x114344,_0x3a4284,_0xd7dd49){if(_0x114344['changed'](_0x2178('0x10'))){_0x114344[_0x2178('0xb')]=moment()['format'](_0x2178('0xd'));}if(_0x114344[_0x2178('0x11')](_0x2178('0xe'))){_0x114344[_0x2178('0xf')]=moment()[_0x2178('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0xd7dd49(null,_0x114344);}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0eec=['changed','closedAt','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x349243,_0x244d3f){var _0x26b0ae=function(_0x151e68){while(--_0x151e68){_0x349243['push'](_0x349243['shift']());}};_0x26b0ae(++_0x244d3f);}(_0x0eec,0xac));var _0xc0ee=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0eec[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc0ee('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc0ee('0x1'));var moment=require(_0xc0ee('0x2'));var BPromise=require(_0xc0ee('0x3'));var rp=require(_0xc0ee('0x4'));var fs=require('fs');var path=require(_0xc0ee('0x5'));var rimraf=require(_0xc0ee('0x6'));var config=require(_0xc0ee('0x7'));var attributes=require('./mailInteraction.attributes');module[_0xc0ee('0x8')]=function(_0x4db3d6,_0x218797){return _0x4db3d6[_0xc0ee('0x9')](_0xc0ee('0xa'),attributes,{'tableName':_0xc0ee('0xb'),'paranoid':![],'indexes':[{'name':_0xc0ee('0xc'),'fields':[_0xc0ee('0xd'),'to'],'type':_0xc0ee('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4992d6,_0x141f4a,_0x3bb29a){if(_0x4992d6[_0xc0ee('0xf')]){_0x4992d6[_0xc0ee('0x10')]=moment()[_0xc0ee('0x11')](_0xc0ee('0x12'));}if(_0x4992d6[_0xc0ee('0x13')]){_0x4992d6['closedAt']=moment()[_0xc0ee('0x11')](_0xc0ee('0x12'));}_0x3bb29a(null,_0x141f4a);},'beforeUpdate':function(_0x153f7b,_0x157951,_0x22d46b){if(_0x153f7b[_0xc0ee('0x14')](_0xc0ee('0xf'))){_0x153f7b[_0xc0ee('0x10')]=moment()[_0xc0ee('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x153f7b['changed'](_0xc0ee('0x13'))){_0x153f7b[_0xc0ee('0x15')]=moment()[_0xc0ee('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x22d46b(null,_0x153f7b);}},'charset':_0xc0ee('0x16'),'collate':_0xc0ee('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 3e04262..2fc1344 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 _0xf03a=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','limit','then','stringify','catch','AddTagsToMailInteraction','find','addTags','omit','spread','AddTags','util','moment','bluebird','randomstring'];(function(_0x5595b2,_0x77241a){var _0x39ab87=function(_0x9be20c){while(--_0x9be20c){_0x5595b2['push'](_0x5595b2['shift']());}};_0x39ab87(++_0x77241a);}(_0xf03a,0x1a0));var _0xaf03=function(_0x29817e,_0x45f56d){_0x29817e=_0x29817e-0x0;var _0x3c66e6=_0xf03a[_0x29817e];return _0x3c66e6;};'use strict';var _=require('lodash');var util=require(_0xaf03('0x0'));var moment=require(_0xaf03('0x1'));var BPromise=require(_0xaf03('0x2'));var rs=require(_0xaf03('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf03('0x4'))['db'];var utils=require(_0xaf03('0x5'));var logger=require('../../config/logger')(_0xaf03('0x6'));var config=require(_0xaf03('0x7'));var jayson=require(_0xaf03('0x8'));var client=jayson[_0xaf03('0x9')]['http']({'port':0x232a});config[_0xaf03('0xa')]=_['defaults'](config[_0xaf03('0xa')],{'host':_0xaf03('0xb'),'port':0x18eb});var socket=require(_0xaf03('0xc'))(new Redis(config[_0xaf03('0xa')]));require(_0xaf03('0xd'))[_0xaf03('0xe')](socket);function respondWithRpcPromise(_0x52d7fe,_0x1f3a5c,_0x12e1a1){return new BPromise(function(_0x4766d1,_0x33803e){return client[_0xaf03('0xf')](_0x52d7fe,_0x12e1a1)['then'](function(_0x1bc5a0){logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));logger[_0xaf03('0x13')](_0xaf03('0x14'),_0x1f3a5c,_0xaf03('0x12'),JSON['stringify'](_0x1bc5a0));if(_0x1bc5a0['error']){if(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x16')]===0x1f4){logger[_0xaf03('0x15')]('MailInteraction,\x20%s,\x20%s',_0x1f3a5c,_0x1bc5a0['error'][_0xaf03('0x17')]);return _0x33803e(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1bc5a0[_0xaf03('0x15')]['message']);return _0x4766d1(_0x1bc5a0[_0xaf03('0x15')][_0xaf03('0x17')]);}else{logger[_0xaf03('0x10')](_0xaf03('0x11'),_0x1f3a5c,_0xaf03('0x12'));_0x4766d1(_0x1bc5a0[_0xaf03('0x18')]['message']);}})['catch'](function(_0x1e3508){logger[_0xaf03('0x15')](_0xaf03('0x11'),_0x1f3a5c,_0x1e3508);_0x33803e(_0x1e3508);});});}exports[_0xaf03('0x19')]=function(_0xfc2e57){var _0x59cf7c=this;return new Promise(function(_0x43a4a4,_0x55eca3){return db[_0xaf03('0x1a')][_0xaf03('0x1b')](_0xfc2e57[_0xaf03('0x1c')],{'raw':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')][_0xaf03('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')][_0xaf03('0x1f')]||null:null,'attributes':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')]['attributes']||null:null,'limit':_0xfc2e57[_0xaf03('0x1d')]?_0xfc2e57[_0xaf03('0x1d')][_0xaf03('0x20')]||null:null})[_0xaf03('0x21')](function(_0x4ef6cc){logger['info'](_0xaf03('0x19'),_0xfc2e57);logger[_0xaf03('0x13')]('UpdateMailInteraction',_0xfc2e57,JSON[_0xaf03('0x22')](_0x4ef6cc));_0x43a4a4(_0x4ef6cc);})[_0xaf03('0x23')](function(_0x247b05){logger[_0xaf03('0x15')](_0xaf03('0x19'),_0x247b05[_0xaf03('0x17')],_0xfc2e57);_0x55eca3(_0x59cf7c['error'](0x1f4,_0x247b05['message']));});});};exports[_0xaf03('0x24')]=function(_0x385aa9){return new Promise(function(_0xe104c2,_0x166a23){return db[_0xaf03('0x1a')][_0xaf03('0x25')]({'where':_0x385aa9[_0xaf03('0x1d')]?_0x385aa9[_0xaf03('0x1d')][_0xaf03('0x1f')]||null:null})[_0xaf03('0x21')](function(_0x18ad0c){if(_0x18ad0c){return _0x18ad0c[_0xaf03('0x26')](_0x385aa9[_0xaf03('0x1c')]['ids'],_[_0xaf03('0x27')](_0x385aa9[_0xaf03('0x1c')],['ids','id'])||{});}})[_0xaf03('0x28')](function(_0x480a3b){logger[_0xaf03('0x10')](_0xaf03('0x29'),_0x385aa9);logger[_0xaf03('0x13')](_0xaf03('0x29'),_0x385aa9,JSON[_0xaf03('0x22')](_0x480a3b));_0xe104c2(_0x480a3b);})[_0xaf03('0x23')](function(_0x5a6e1e){logger[_0xaf03('0x15')]('AddTags',_0x5a6e1e[_0xaf03('0x17')],_0x385aa9);_0x166a23(_this[_0xaf03('0x15')](0x1f4,_0x5a6e1e[_0xaf03('0x17')]));});});}; \ No newline at end of file +var _0x50e5=['MailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','update','body','raw','options','where','attributes','then','debug','AddTagsToMailInteraction'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x50e5,0xb7));var _0x550e=function(_0x559356,_0x2d0e8e){_0x559356=_0x559356-0x0;var _0x2c9c25=_0x50e5[_0x559356];return _0x2c9c25;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var moment=require('moment');var BPromise=require(_0x550e('0x2'));var rs=require(_0x550e('0x3'));var fs=require('fs');var Redis=require(_0x550e('0x4'));var db=require(_0x550e('0x5'))['db'];var utils=require(_0x550e('0x6'));var logger=require(_0x550e('0x7'))(_0x550e('0x8'));var config=require(_0x550e('0x9'));var jayson=require(_0x550e('0xa'));var client=jayson[_0x550e('0xb')][_0x550e('0xc')]({'port':0x232a});config[_0x550e('0xd')]=_['defaults'](config[_0x550e('0xd')],{'host':_0x550e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x550e('0xd')]));require(_0x550e('0xf'))[_0x550e('0x10')](socket);function respondWithRpcPromise(_0x4d236d,_0x1a1e3e,_0x49cc53){return new BPromise(function(_0x59c6c9,_0x116691){return client[_0x550e('0x11')](_0x4d236d,_0x49cc53)['then'](function(_0x13f7e9){logger[_0x550e('0x12')](_0x550e('0x13'),_0x1a1e3e,_0x550e('0x14'));logger['debug'](_0x550e('0x15'),_0x1a1e3e,'request\x20sent',JSON[_0x550e('0x16')](_0x13f7e9));if(_0x13f7e9['error']){if(_0x13f7e9[_0x550e('0x17')][_0x550e('0x18')]===0x1f4){logger[_0x550e('0x17')](_0x550e('0x13'),_0x1a1e3e,_0x13f7e9[_0x550e('0x17')]['message']);return _0x116691(_0x13f7e9[_0x550e('0x17')]['message']);}logger[_0x550e('0x17')]('MailInteraction,\x20%s,\x20%s',_0x1a1e3e,_0x13f7e9['error'][_0x550e('0x19')]);return _0x59c6c9(_0x13f7e9[_0x550e('0x17')]['message']);}else{logger['info']('MailInteraction,\x20%s,\x20%s',_0x1a1e3e,_0x550e('0x14'));_0x59c6c9(_0x13f7e9['result']['message']);}})[_0x550e('0x1a')](function(_0x3607ad){logger[_0x550e('0x17')](_0x550e('0x13'),_0x1a1e3e,_0x3607ad);_0x116691(_0x3607ad);});});}exports[_0x550e('0x1b')]=function(_0x29f2db){var _0x3b4dca=this;return new Promise(function(_0x38f12b,_0x1b9799){return db['MailInteraction'][_0x550e('0x1c')](_0x29f2db[_0x550e('0x1d')],{'raw':_0x29f2db['options']?_0x29f2db['options'][_0x550e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29f2db[_0x550e('0x1f')]?_0x29f2db['options'][_0x550e('0x20')]||null:null,'attributes':_0x29f2db[_0x550e('0x1f')]?_0x29f2db[_0x550e('0x1f')][_0x550e('0x21')]||null:null,'limit':_0x29f2db[_0x550e('0x1f')]?_0x29f2db[_0x550e('0x1f')]['limit']||null:null})[_0x550e('0x22')](function(_0x205e3a){logger[_0x550e('0x12')](_0x550e('0x1b'),_0x29f2db);logger[_0x550e('0x23')](_0x550e('0x1b'),_0x29f2db,JSON[_0x550e('0x16')](_0x205e3a));_0x38f12b(_0x205e3a);})[_0x550e('0x1a')](function(_0x13ca4e){logger[_0x550e('0x17')](_0x550e('0x1b'),_0x13ca4e[_0x550e('0x19')],_0x29f2db);_0x1b9799(_0x3b4dca['error'](0x1f4,_0x13ca4e[_0x550e('0x19')]));});});};exports[_0x550e('0x24')]=function(_0x48d367){return new Promise(function(_0x3a1d62,_0x78f04c){return db[_0x550e('0x25')][_0x550e('0x26')]({'where':_0x48d367[_0x550e('0x1f')]?_0x48d367[_0x550e('0x1f')][_0x550e('0x20')]||null:null})[_0x550e('0x22')](function(_0x209f30){if(_0x209f30){return _0x209f30[_0x550e('0x27')](_0x48d367[_0x550e('0x1d')][_0x550e('0x28')],_[_0x550e('0x29')](_0x48d367[_0x550e('0x1d')],['ids','id'])||{});}})[_0x550e('0x2a')](function(_0x1a544d){logger['info'](_0x550e('0x2b'),_0x48d367);logger[_0x550e('0x23')]('AddTags',_0x48d367,JSON[_0x550e('0x16')](_0x1a544d));_0x3a1d62(_0x1a544d);})[_0x550e('0x1a')](function(_0x1beb59){logger[_0x550e('0x17')](_0x550e('0x2b'),_0x1beb59[_0x550e('0x19')],_0x48d367);_0x78f04c(_this[_0x550e('0x17')](0x1f4,_0x1beb59[_0x550e('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 33113a4..10fb260 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 _0xf6a3=['register','length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener'];(function(_0x5d70ca,_0x338bb7){var _0x5e203f=function(_0x35a0d0){while(--_0x35a0d0){_0x5d70ca['push'](_0x5d70ca['shift']());}};_0x5e203f(++_0x338bb7);}(_0xf6a3,0x147));var _0x3f6a=function(_0x7b1048,_0xe45265){_0x7b1048=_0x7b1048-0x0;var _0x2b8cc5=_0xf6a3[_0x7b1048];return _0x2b8cc5;};'use strict';var MailInteractionEvents=require(_0x3f6a('0x0'));var events=[_0x3f6a('0x1'),_0x3f6a('0x2'),_0x3f6a('0x3')];function createListener(_0x552728,_0x3daa50){return function(_0x978c30){_0x3daa50[_0x3f6a('0x4')](_0x552728,_0x978c30);};}function removeListener(_0xf2f6e0,_0x2dd33f){return function(){MailInteractionEvents[_0x3f6a('0x5')](_0xf2f6e0,_0x2dd33f);};}exports[_0x3f6a('0x6')]=function(_0x5e99e6){for(var _0x3ff635=0x0,_0x5651bf=events[_0x3f6a('0x7')];_0x3ff635<_0x5651bf;_0x3ff635++){var _0x47cc07=events[_0x3ff635];var _0x3d1737=createListener(_0x3f6a('0x8')+_0x47cc07,_0x5e99e6);MailInteractionEvents['on'](_0x47cc07,_0x3d1737);}}; \ No newline at end of file +var _0x09a7=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x4d0df6,_0x4634f3){var _0x4e2615=function(_0x5285e2){while(--_0x5285e2){_0x4d0df6['push'](_0x4d0df6['shift']());}};_0x4e2615(++_0x4634f3);}(_0x09a7,0x13b));var _0x709a=function(_0x47c055,_0x18b00a){_0x47c055=_0x47c055-0x0;var _0x5a240b=_0x09a7[_0x47c055];return _0x5a240b;};'use strict';var MailInteractionEvents=require(_0x709a('0x0'));var events=[_0x709a('0x1'),_0x709a('0x2'),_0x709a('0x3')];function createListener(_0x423e88,_0x1e0b7e){return function(_0x5109fa){_0x1e0b7e[_0x709a('0x4')](_0x423e88,_0x5109fa);};}function removeListener(_0x370b33,_0x5c8e14){return function(){MailInteractionEvents[_0x709a('0x5')](_0x370b33,_0x5c8e14);};}exports[_0x709a('0x6')]=function(_0x850263){for(var _0x4bdacf=0x0,_0x9b3e1e=events[_0x709a('0x7')];_0x4bdacf<_0x9b3e1e;_0x4bdacf++){var _0x132286=events[_0x4bdacf];var _0x24164b=createListener(_0x709a('0x8')+_0x132286,_0x850263);MailInteractionEvents['on'](_0x132286,_0x24164b);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c2414db..5ef1ca1 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 _0x5fd1=['/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','/:id','download','mail','mailmessage:create','create','put','update','/:id/accept'];(function(_0x3f46d8,_0x30f9e8){var _0x54d4f1=function(_0x11dc8a){while(--_0x11dc8a){_0x3f46d8['push'](_0x3f46d8['shift']());}};_0x54d4f1(++_0x30f9e8);}(_0x5fd1,0x155));var _0x15fd=function(_0x1e40da,_0x5861ee){_0x1e40da=_0x1e40da-0x0;var _0x1e1b14=_0x5fd1[_0x1e40da];return _0x1e1b14;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x15fd('0x4'));var config=require(_0x15fd('0x5'));var controller=require(_0x15fd('0x6'));router['get']('/',auth[_0x15fd('0x7')](),controller[_0x15fd('0x8')]);router[_0x15fd('0x9')](_0x15fd('0xa'),auth[_0x15fd('0x7')](),controller['describe']);router[_0x15fd('0x9')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller['show']);router[_0x15fd('0x9')]('/:id/download',auth[_0x15fd('0x7')](),controller[_0x15fd('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0x15fd('0xd'),_0x15fd('0xe')),controller[_0x15fd('0xf')]);router[_0x15fd('0x10')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller[_0x15fd('0x11')]);router[_0x15fd('0x10')](_0x15fd('0x12'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x15fd('0x13'),auth[_0x15fd('0x7')](),controller[_0x15fd('0x14')]);router[_0x15fd('0x15')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller[_0x15fd('0x16')]);module[_0x15fd('0x17')]=router; \ No newline at end of file +var _0x9957=['download','post','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailMessage.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),interaction['tracked'](_0x7995('0x11'),_0x7995('0x12')),controller['create']);router[_0x7995('0x13')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x13')](_0x7995('0x15'),auth[_0x7995('0x9')](),controller['accept']);router['put'](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index c4da2c2..bb2a9e7 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 _0xd9cc=['long','DATE','INTEGER','sequelize','lodash','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0xaadc70,_0x2c050d){var _0x3ac647=function(_0x57f7d8){while(--_0x57f7d8){_0xaadc70['push'](_0xaadc70['shift']());}};_0x3ac647(++_0x2c050d);}(_0xd9cc,0x66));var _0xcd9c=function(_0x32d32b,_0x233c5b){_0x32d32b=_0x32d32b-0x0;var _0x292a17=_0xd9cc[_0x32d32b];return _0x292a17;};'use strict';var Sequelize=require(_0xcd9c('0x0'));var _=require(_0xcd9c('0x1'));module['exports']={'body':{'type':Sequelize[_0xcd9c('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xcd9c('0x3'))},'read':{'type':Sequelize[_0xcd9c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcd9c('0x5')]('in',_0xcd9c('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xcd9c('0x7')](0x1fe)},'from':{'type':Sequelize[_0xcd9c('0x7')]},'to':{'type':Sequelize[_0xcd9c('0x2')](_0xcd9c('0x8'))},'cc':{'type':Sequelize[_0xcd9c('0x2')](_0xcd9c('0x8'))},'bcc':{'type':Sequelize['TEXT'](_0xcd9c('0x8'))},'subject':{'type':Sequelize[_0xcd9c('0x2')]},'sentAt':{'type':Sequelize[_0xcd9c('0x9')]},'attach':{'type':Sequelize[_0xcd9c('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xcd9c('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xcd9c('0x9')]},'originTo':{'type':Sequelize[_0xcd9c('0x2')]('long')},'originCc':{'type':Sequelize[_0xcd9c('0x2')](_0xcd9c('0x8'))}}; \ No newline at end of file +var _0x4034=['TEXT','BOOLEAN','ENUM','out','long','INTEGER','DATE','lodash','exports'];(function(_0x2b522b,_0x15f23e){var _0xcc61ad=function(_0x603c08){while(--_0x603c08){_0x2b522b['push'](_0x2b522b['shift']());}};_0xcc61ad(++_0x15f23e);}(_0x4034,0x166));var _0x4403=function(_0x1486ce,_0x233c7f){_0x1486ce=_0x1486ce-0x0;var _0x10a7b2=_0x4034[_0x1486ce];return _0x10a7b2;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4403('0x0'));module[_0x4403('0x1')]={'body':{'type':Sequelize[_0x4403('0x2')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4403('0x2')]('medium')},'read':{'type':Sequelize[_0x4403('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4403('0x4')]('in','out'),'defaultValue':_0x4403('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x4403('0x6'))},'cc':{'type':Sequelize['TEXT'](_0x4403('0x6'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x4403('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4403('0x3')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4403('0x8')]},'originTo':{'type':Sequelize[_0x4403('0x2')](_0x4403('0x6'))},'originCc':{'type':Sequelize['TEXT'](_0x4403('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 69ec442..2068371 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 _0xa883=['debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','MailMessage','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','map','type','key','VIRTUAL','options','include','findAll','show','params','includeAll','find','body','describe','create','direction','secret','MailAccount','findOne','MailAccountId','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','format','mail-interactions','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','get','MailInteraction','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','RejectMessage','rejectMessage','interface','rejectmessage','download','toString','join','server','files','tmp','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','readFileSync','build','writeFileSync','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0xa883,0x1b7));var _0x3a88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa883[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x3a88('0x0'));var emlformat=require(_0x3a88('0x1'));var rimraf=require(_0x3a88('0x2'));var zipdir=require(_0x3a88('0x3'));var jsonpatch=require(_0x3a88('0x4'));var rp=require(_0x3a88('0x5'));var moment=require(_0x3a88('0x6'));var BPromise=require(_0x3a88('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a88('0x8'));var sox=require('sox');var csv=require(_0x3a88('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3a88('0xa'));var squel=require(_0x3a88('0xb'));var crypto=require(_0x3a88('0xc'));var jsforce=require(_0x3a88('0xd'));var deskjs=require(_0x3a88('0xe'));var toCsv=require(_0x3a88('0x9'));var querystring=require(_0x3a88('0xf'));var Papa=require(_0x3a88('0x10'));var Redis=require(_0x3a88('0x11'));var authService=require(_0x3a88('0x12'));var qs=require(_0x3a88('0x13'));var hardwareService=require(_0x3a88('0x14'));var logger=require(_0x3a88('0x15'))('api');var utils=require(_0x3a88('0x16'));var config=require(_0x3a88('0x17'));var db=require(_0x3a88('0x18'))['db'];config[_0x3a88('0x19')]=_['defaults'](config['redis'],{'host':_0x3a88('0x1a'),'port':0x18eb});var socket=require(_0x3a88('0x1b'))(new Redis(config[_0x3a88('0x19')]));require(_0x3a88('0x1c'))['register'](socket);var jayson=require(_0x3a88('0x1d'));var client=jayson[_0x3a88('0x1e')]['http']({'port':0x232c});var client9003=jayson[_0x3a88('0x1e')][_0x3a88('0x1f')]({'port':0x232b});var client9002=jayson['client'][_0x3a88('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x4937fc,_0x273ef0,_0x40a0e4){if(_0x40a0e4){var _0x4cd1bd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cd1bd[_0x3a88('0x20')](_0x273ef0)){return _0x4937fc;}else{throw new Error(_0x3a88('0x21'));}}else{return _0x4937fc;}}function respondWithRpcPromise(_0x3d0393,_0x316f97,_0xcad485,_0x9b0105){return new BPromise(function(_0x3559a7,_0x18d5f6){var _0x2cb48e=_0x9b0105||client;return _0x2cb48e[_0x3a88('0x22')](_0x3d0393,_0xcad485)[_0x3a88('0x23')](function(_0x1883a8){logger[_0x3a88('0x24')](_0x3a88('0x25'),_0x316f97,'request\x20sent');logger[_0x3a88('0x26')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x316f97,'request\x20sent',JSON[_0x3a88('0x27')](_0x1883a8));if(_0x1883a8['error']){if(_0x1883a8[_0x3a88('0x28')][_0x3a88('0x29')]===0x1f4){logger[_0x3a88('0x28')](_0x3a88('0x25'),_0x316f97,_0x1883a8[_0x3a88('0x28')][_0x3a88('0x2a')]);return _0x18d5f6(_0x1883a8['error'][_0x3a88('0x2a')]);}logger['error'](_0x3a88('0x25'),_0x316f97,_0x1883a8[_0x3a88('0x28')][_0x3a88('0x2a')]);return _0x3559a7(_0x1883a8[_0x3a88('0x28')]['message']);}else{logger[_0x3a88('0x24')](_0x3a88('0x25'),_0x316f97,_0x3a88('0x2b'));_0x3559a7(_0x1883a8[_0x3a88('0x2c')][_0x3a88('0x2a')]);}})[_0x3a88('0x2d')](function(_0x10be95){logger[_0x3a88('0x28')](_0x3a88('0x25'),_0x316f97,_0x10be95);_0x18d5f6(_0x10be95);});});}function respondWithStatusCode(_0x235469,_0x49ad0b){_0x49ad0b=_0x49ad0b||0xcc;return function(_0x14042c){if(_0x14042c){return _0x235469[_0x3a88('0x2e')](_0x49ad0b);}return _0x235469[_0x3a88('0x2f')](_0x49ad0b)[_0x3a88('0x30')]();};}function respondWithResult(_0x1af17f,_0xb77379){_0xb77379=_0xb77379||0xc8;return function(_0x23a91){if(_0x23a91){return _0x1af17f[_0x3a88('0x2f')](_0xb77379)['json'](_0x23a91);}};}function respondWithFilteredResult(_0x55b67d,_0x5d7724){return function(_0x25f838){if(_0x25f838){var _0x25dce9=_0x25f838[_0x3a88('0x31')],_0x58a724=_0x5d7724[_0x3a88('0x32')],_0x5b6955=_0x5d7724[_0x3a88('0x32')]+_0x5d7724[_0x3a88('0x33')],_0x39841f;if(_0x5b6955>=_0x25dce9){_0x5b6955=_0x25dce9;_0x39841f=0xc8;}else{_0x39841f=0xce;}_0x55b67d['status'](_0x39841f);return _0x55b67d[_0x3a88('0x34')](_0x3a88('0x35'),_0x58a724+'-'+_0x5b6955+'/'+_0x25dce9)['json'](_0x25f838);}return null;};}function patchUpdates(_0x4fdb41){return function(_0x32f53a){try{jsonpatch[_0x3a88('0x36')](_0x32f53a,_0x4fdb41,!![]);}catch(_0x1eb3ed){return BPromise[_0x3a88('0x37')](_0x1eb3ed);}return _0x32f53a['save']();};}function saveUpdates(_0x194146,_0x51b03f){return function(_0x3235e7){if(_0x3235e7){return _0x3235e7[_0x3a88('0x38')](_0x194146)[_0x3a88('0x23')](function(_0x2fb26d){return _0x2fb26d;});}return null;};}function removeEntity(_0xce56c6,_0x322c7b){return function(_0x355741){if(_0x355741){return _0x355741[_0x3a88('0x39')]()[_0x3a88('0x23')](function(){_0xce56c6[_0x3a88('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1808,_0x42d7b7){return function(_0x2b8143){if(!_0x2b8143){_0x3f1808['sendStatus'](0x194);}return _0x2b8143;};}function handleError(_0x2d702f,_0x34e090){_0x34e090=_0x34e090||0x1f4;return function(_0x2e4212){logger[_0x3a88('0x28')](_0x2e4212[_0x3a88('0x3a')]);if(_0x2e4212[_0x3a88('0x3b')]){delete _0x2e4212[_0x3a88('0x3b')];}_0x2d702f[_0x3a88('0x2f')](_0x34e090)[_0x3a88('0x3c')](_0x2e4212);};}exports[_0x3a88('0x3d')]=function(_0x1f9d0a,_0x3be733){var _0x22af06={},_0x4a358d={},_0x313f8a={'count':0x0,'rows':[]};var _0x24f769=db[_0x3a88('0x3e')][_0x3a88('0x3f')];_0x4a358d[_0x3a88('0x40')]=_[_0x3a88('0x41')](_0x24f769);_0x4a358d['query']=_[_0x3a88('0x41')](_0x1f9d0a[_0x3a88('0x42')]);_0x4a358d[_0x3a88('0x43')]=_[_0x3a88('0x44')](_0x4a358d[_0x3a88('0x40')],_0x4a358d[_0x3a88('0x42')]);_0x22af06['attributes']=_[_0x3a88('0x44')](_0x4a358d[_0x3a88('0x40')],qs['fields'](_0x1f9d0a[_0x3a88('0x42')][_0x3a88('0x45')]));_0x22af06[_0x3a88('0x46')]=_0x22af06[_0x3a88('0x46')][_0x3a88('0x47')]?_0x22af06[_0x3a88('0x46')]:_0x4a358d[_0x3a88('0x40')];if(!_0x1f9d0a[_0x3a88('0x42')][_0x3a88('0x48')]('nolimit')){_0x22af06['limit']=qs[_0x3a88('0x33')](_0x1f9d0a['query'][_0x3a88('0x33')]);_0x22af06[_0x3a88('0x32')]=qs['offset'](_0x1f9d0a[_0x3a88('0x42')][_0x3a88('0x32')]);}_0x22af06[_0x3a88('0x49')]=qs['sort'](_0x1f9d0a['query'][_0x3a88('0x4a')]);_0x22af06[_0x3a88('0x4b')]=qs[_0x3a88('0x43')](_['pick'](_0x1f9d0a[_0x3a88('0x42')],_0x4a358d[_0x3a88('0x43')]));if(_0x1f9d0a[_0x3a88('0x42')][_0x3a88('0x4c')]){_0x22af06['where']=_[_0x3a88('0x4d')](_0x22af06[_0x3a88('0x4b')],{'$or':_[_0x3a88('0x4e')](_0x24f769,function(_0x5689fe){if(_0x5689fe[_0x3a88('0x4f')][_0x3a88('0x50')]!==_0x3a88('0x51')){var _0xc6f6ea={};_0xc6f6ea[_0x5689fe['field']]={'$like':'%'+_0x1f9d0a['query'][_0x3a88('0x4c')]+'%'};return _0xc6f6ea;}})});}_0x22af06=_['merge']({},_0x22af06,_0x1f9d0a[_0x3a88('0x52')]);var _0x451b4a={'where':_0x22af06[_0x3a88('0x4b')]};return db[_0x3a88('0x3e')][_0x3a88('0x31')](_0x451b4a)[_0x3a88('0x23')](function(_0x5c0ef8){_0x313f8a[_0x3a88('0x31')]=_0x5c0ef8;if(_0x1f9d0a['query']['includeAll']){_0x22af06[_0x3a88('0x53')]=[{'all':!![]}];}return db[_0x3a88('0x3e')][_0x3a88('0x54')](_0x22af06);})[_0x3a88('0x23')](function(_0x1d82c0){_0x313f8a['rows']=_0x1d82c0;return _0x313f8a;})[_0x3a88('0x23')](respondWithFilteredResult(_0x3be733,_0x22af06))[_0x3a88('0x2d')](handleError(_0x3be733,null));};exports[_0x3a88('0x55')]=function(_0x20781f,_0x34c35d){var _0x1b1fed={'raw':!![],'where':{'id':_0x20781f[_0x3a88('0x56')]['id']}},_0x592786={};_0x592786['model']=_[_0x3a88('0x41')](db[_0x3a88('0x3e')][_0x3a88('0x3f')]);_0x592786['query']=_[_0x3a88('0x41')](_0x20781f[_0x3a88('0x42')]);_0x592786['filters']=_['intersection'](_0x592786[_0x3a88('0x40')],_0x592786[_0x3a88('0x42')]);_0x1b1fed[_0x3a88('0x46')]=_[_0x3a88('0x44')](_0x592786[_0x3a88('0x40')],qs[_0x3a88('0x45')](_0x20781f[_0x3a88('0x42')][_0x3a88('0x45')]));_0x1b1fed[_0x3a88('0x46')]=_0x1b1fed[_0x3a88('0x46')][_0x3a88('0x47')]?_0x1b1fed[_0x3a88('0x46')]:_0x592786[_0x3a88('0x40')];if(_0x20781f[_0x3a88('0x42')][_0x3a88('0x57')]){_0x1b1fed['include']=[{'all':!![]}];}_0x1b1fed=_[_0x3a88('0x4d')]({},_0x1b1fed,_0x20781f[_0x3a88('0x52')]);return db['MailMessage'][_0x3a88('0x58')](_0x1b1fed)[_0x3a88('0x23')](handleEntityNotFound(_0x34c35d,null))[_0x3a88('0x23')](respondWithResult(_0x34c35d,null))[_0x3a88('0x2d')](handleError(_0x34c35d,null));};exports['update']=function(_0x1dcab2,_0x5edf4d){if(_0x1dcab2[_0x3a88('0x59')]['id']){delete _0x1dcab2['body']['id'];}return db['MailMessage'][_0x3a88('0x58')]({'where':{'id':_0x1dcab2[_0x3a88('0x56')]['id']}})[_0x3a88('0x23')](handleEntityNotFound(_0x5edf4d,null))[_0x3a88('0x23')](saveUpdates(_0x1dcab2[_0x3a88('0x59')],null))[_0x3a88('0x23')](respondWithResult(_0x5edf4d,null))[_0x3a88('0x2d')](handleError(_0x5edf4d,null));};exports[_0x3a88('0x39')]=function(_0x5a0a61,_0x18de74){return db[_0x3a88('0x3e')][_0x3a88('0x58')]({'where':{'id':_0x5a0a61[_0x3a88('0x56')]['id']}})['then'](handleEntityNotFound(_0x18de74,null))['then'](removeEntity(_0x18de74,null))[_0x3a88('0x2d')](handleError(_0x18de74,null));};exports[_0x3a88('0x5a')]=function(_0x544655,_0x1310f0){return db[_0x3a88('0x3e')]['describe']()['then'](respondWithResult(_0x1310f0,null))[_0x3a88('0x2d')](handleError(_0x1310f0,null));};exports[_0x3a88('0x5b')]=function(_0xd82412,_0x425b73){return db[_0x3a88('0x3e')]['create'](_0xd82412[_0x3a88('0x59')])['then'](function(_0x2e77bd){if(_0x2e77bd){if(_0x2e77bd[_0x3a88('0x5c')]==='out'&&!_0x2e77bd[_0x3a88('0x5d')]){return db[_0x3a88('0x5e')][_0x3a88('0x5f')]({'where':{'id':_0x2e77bd[_0x3a88('0x60')]},'include':[{'model':db[_0x3a88('0x61')],'as':_0x3a88('0x62'),'raw':!![]}]})['then'](function(_0x32b4dd){if(_0x32b4dd&&_0x32b4dd[_0x3a88('0x62')]){var _0x746cee={'tls':{'rejectUnauthorized':![]}};if(_[_0x3a88('0x63')](_0x32b4dd['Smtp'][_0x3a88('0x64')])){_0x746cee[_0x3a88('0x65')]=_0x32b4dd[_0x3a88('0x62')][_0x3a88('0x65')];_0x746cee[_0x3a88('0x66')]=_0x32b4dd[_0x3a88('0x62')][_0x3a88('0x66')];_0x746cee['secure']=_0x32b4dd[_0x3a88('0x62')][_0x3a88('0x67')];if(_0x32b4dd['Smtp'][_0x3a88('0x68')]){_0x746cee[_0x3a88('0x69')]={'user':_0x32b4dd[_0x3a88('0x62')][_0x3a88('0x6a')],'pass':_0x32b4dd[_0x3a88('0x62')]['pass']};}}else{_0x746cee[_0x3a88('0x64')]=_0x32b4dd[_0x3a88('0x62')][_0x3a88('0x64')];_0x746cee[_0x3a88('0x69')]={'user':_0x32b4dd[_0x3a88('0x62')][_0x3a88('0x6a')],'pass':_0x32b4dd['Smtp'][_0x3a88('0x6b')]};_0x746cee[_0x3a88('0x67')]=_0x32b4dd[_0x3a88('0x62')][_0x3a88('0x67')];}if(_0xd82412['body'][_0x3a88('0x6c')]&&_0xd82412['body'][_0x3a88('0x6c')][_0x3a88('0x47')]){for(var _0x424e87=0x0;_0x424e87<_0xd82412[_0x3a88('0x59')][_0x3a88('0x6c')][_0x3a88('0x47')];_0x424e87+=0x1){_0xd82412[_0x3a88('0x59')][_0x3a88('0x6c')][_0x424e87]={'filename':_0xd82412[_0x3a88('0x59')][_0x3a88('0x6c')][_0x424e87][_0x3a88('0x3b')],'path':path['join'](config[_0x3a88('0x6d')],_0x3a88('0x6e'),_0xd82412[_0x3a88('0x59')][_0x3a88('0x6c')][_0x424e87]['basename'])};}}return{'account':_0x746cee,'message':_0xd82412['body']};}})['then'](function(_0x2b2243){if(_0x2b2243){return respondWithRpcPromise('SendMail','sendMail',_0x2b2243,client9003)[_0x3a88('0x23')](function(_0x5ddbac){return _0x2e77bd[_0x3a88('0x38')]({'read':!![],'messageId':_0x5ddbac['messageId'],'sentAt':moment()[_0x3a88('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x3a88('0x2d')](function(_0x2b1ef7){logger[_0x3a88('0x28')]('%s',JSON[_0x3a88('0x27')](_0x2b1ef7));return _0x2e77bd;});}return _0x2e77bd;});}return _0x2e77bd;}})[_0x3a88('0x23')](respondWithResult(_0x425b73,0xc9))[_0x3a88('0x2d')](handleError(_0x425b73,null));};var interaction_log=require(_0x3a88('0x15'))(_0x3a88('0x70'));exports[_0x3a88('0x71')]=function(_0x249f52,_0x269389,_0x39bc1a){var _0x2b8cd4={'channel':_0x3a88('0x72')};if(_0x249f52[_0x3a88('0x59')]['id']){delete _0x249f52[_0x3a88('0x59')]['id'];}_0x249f52['body'][_0x3a88('0x73')]=!![];_0x249f52[_0x3a88('0x59')][_0x3a88('0x74')]=moment()[_0x3a88('0x6f')](_0x3a88('0x75'));_0x249f52[_0x3a88('0x59')]['UserId']=_0x249f52['body'][_0x3a88('0x76')]||_0x249f52['user']['id'];return db['MailMessage'][_0x3a88('0x58')]({'where':{'id':_0x249f52[_0x3a88('0x56')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x3a88('0x23')](handleEntityNotFound(_0x269389,null))['then'](saveUpdates(_0x249f52[_0x3a88('0x59')],null))[_0x3a88('0x23')](function(_0x1522b9){if(_0x1522b9){_0x2b8cd4[_0x3a88('0x2a')]=_0x1522b9[_0x3a88('0x77')]({'plain':!![]});return db[_0x3a88('0x78')][_0x3a88('0x58')]({'where':{'id':_0x1522b9['MailInteractionId']}});}return null;})[_0x3a88('0x23')](handleEntityNotFound(_0x269389,null))[_0x3a88('0x23')](function(_0x17410e){if(_0x17410e){return _0x17410e[_0x3a88('0x38')]({'UserId':_0x249f52[_0x3a88('0x59')][_0x3a88('0x76')],'read1stAt':_['isNil'](_0x17410e[_0x3a88('0x79')])?moment()[_0x3a88('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x4ba8c4){if(_0x4ba8c4){_0x2b8cd4[_0x3a88('0x7a')]=_0x4ba8c4[_0x3a88('0x77')]({'plain':!![]});interaction_log['info'](_0x3a88('0x7b'),_0x249f52[_0x3a88('0x6a')]['id'],_0x249f52['user'][_0x3a88('0x3b')],_0x249f52[_0x3a88('0x6a')][_0x3a88('0x7c')],_0x2b8cd4[_0x3a88('0x7a')]['id'],_0x249f52[_0x3a88('0x59')]?JSON['stringify'](_0x249f52['body']):_0x3a88('0x7d'));return respondWithRpcPromise(_0x3a88('0x7e'),'acceptMessage',_0x2b8cd4);}return null;})['then'](function(_0x78c5a5){if(_0x78c5a5){if(_0x249f52[_0x3a88('0x59')]['manual']){_0x2b8cd4[_0x3a88('0x2a')]['interface']=util[_0x3a88('0x6f')](_0x3a88('0x7f'),_0x249f52['user'][_0x3a88('0x3b')]);_0x2b8cd4[_0x3a88('0x2a')]['channel']=_0x2b8cd4[_0x3a88('0x80')];_0x2b8cd4['message'][_0x3a88('0x81')]=_0x3a88('0x71');return respondWithRpcPromise(_0x3a88('0x82'),'EventManager',{'event':_0x3a88('0x83'),'message':_0x2b8cd4[_0x3a88('0x2a')]},client9002)['then'](function(){return _0x2b8cd4;});}return _0x2b8cd4;}return null;})[_0x3a88('0x23')](respondWithResult(_0x269389,null))[_0x3a88('0x2d')](handleError(_0x269389,null));};var interaction_log=require('../../config/logger')(_0x3a88('0x70'));exports[_0x3a88('0x37')]=function(_0x296fde,_0x2d6dd3,_0x175e8a){var _0xc01899={'agent':{},'channel':'mail'};if(_0x296fde['body']['id']){delete _0x296fde[_0x3a88('0x59')]['id'];}_0x296fde['body']['UserId']=_0x296fde[_0x3a88('0x59')][_0x3a88('0x76')]||_0x296fde[_0x3a88('0x6a')]['id'];_0xc01899[_0x3a88('0x84')]['id']=_0x296fde[_0x3a88('0x59')][_0x3a88('0x76')];return db[_0x3a88('0x3e')][_0x3a88('0x58')]({'where':{'id':_0x296fde[_0x3a88('0x56')]['id'],'UserId':null}})[_0x3a88('0x23')](handleEntityNotFound(_0x2d6dd3,null))[_0x3a88('0x23')](function(_0x1f83be){if(_0x1f83be){_0xc01899[_0x3a88('0x2a')]=_0x1f83be[_0x3a88('0x77')]({'plain':!![]});return db[_0x3a88('0x78')][_0x3a88('0x58')]({'where':{'id':_0x1f83be['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x2d6dd3,null))[_0x3a88('0x23')](function(_0x252904){if(_0x252904){_0xc01899['interaction']=_0x252904[_0x3a88('0x77')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x296fde[_0x3a88('0x6a')]['id'],_0x296fde[_0x3a88('0x6a')][_0x3a88('0x3b')],_0x296fde[_0x3a88('0x6a')]['role'],_0xc01899[_0x3a88('0x7a')]['id'],_0x296fde[_0x3a88('0x59')]?JSON[_0x3a88('0x27')](_0x296fde[_0x3a88('0x59')]):_0x3a88('0x7d'));return respondWithRpcPromise(_0x3a88('0x85'),_0x3a88('0x86'),_0xc01899);}return null;})[_0x3a88('0x23')](function(_0x16acf8){if(_0x16acf8){_0x16acf8[_0x3a88('0x2a')][_0x3a88('0x87')]=util['format'](_0x3a88('0x7f'),_0x296fde[_0x3a88('0x6a')]['name']);_0x16acf8[_0x3a88('0x2a')]['channel']=_0xc01899[_0x3a88('0x80')];_0x16acf8['message'][_0x3a88('0x81')]=_0x3a88('0x37');respondWithRpcPromise(_0x3a88('0x82'),_0x3a88('0x82'),{'event':_0x3a88('0x88'),'message':_0x16acf8[_0x3a88('0x2a')]},client9002);return _0xc01899;}return null;})['then'](respondWithResult(_0x2d6dd3,null))[_0x3a88('0x2d')](handleError(_0x2d6dd3,null));};exports[_0x3a88('0x89')]=function(_0xa34407,_0x58abbb){var _0x34805a=moment()['unix']()[_0x3a88('0x8a')]();var _0x283f95=path[_0x3a88('0x8b')](config[_0x3a88('0x6d')],_0x3a88('0x8c'),_0x3a88('0x8d'),_0x3a88('0x8e'));var _0x3a3392=path[_0x3a88('0x8b')](config['root'],_0x3a88('0x8c'),_0x3a88('0x8d'),_0x3a88('0x6c'));var _0x35a122=util['format']('message-%s.eml',_0x34805a);return db['MailMessage']['find']({'where':{'id':_0xa34407[_0x3a88('0x56')]['id']},'attributes':['id','body',_0x3a88('0x8f'),'to','cc',_0x3a88('0x90'),_0x3a88('0x91'),_0x3a88('0x92')],'include':_0xa34407[_0x3a88('0x42')][_0x3a88('0x6c')]?[{'model':db[_0x3a88('0x93')],'as':_0x3a88('0x94')}]:undefined})[_0x3a88('0x23')](handleEntityNotFound(_0x58abbb,null))['then'](function(_0x922411){if(_0x922411){var _0x279e2d=_0x922411;var _0x1d1a6b={'from':_0x279e2d[_0x3a88('0x8f')],'to':_0x279e2d['to'],'subject':_0x279e2d['subject'],'html':_0x279e2d[_0x3a88('0x59')],'headers':{'Date':moment(_0x279e2d['createdAt'])['format'](_0x3a88('0x95'))},'attachments':[]};if(_0x922411['cc']){_0x1d1a6b[_0x3a88('0x96')]['Cc']=_0x922411['cc'];}if(_0x922411[_0x3a88('0x90')]){_0x1d1a6b[_0x3a88('0x96')][_0x3a88('0x97')]=_0x922411['bcc'];}return new BPromise(function(_0x57a4f9,_0x28edb4){if(_0x922411['Attachments']){for(var _0xb65dd0=0x0;_0xb65dd0<_0x922411[_0x3a88('0x94')]['length'];_0xb65dd0++){var _0x2e65cd=_0x922411[_0x3a88('0x94')][_0xb65dd0];var _0xc99c8f=path[_0x3a88('0x8b')](_0x3a3392,_0x2e65cd[_0x3a88('0x98')]);if(fs[_0x3a88('0x99')](_0xc99c8f)){_0x1d1a6b['attachments'][_0x3a88('0x9a')]({'name':_0x2e65cd[_0x3a88('0x3b')],'contentType':_0x2e65cd[_0x3a88('0x4f')],'data':fs[_0x3a88('0x9b')](_0xc99c8f)});}}}emlformat[_0x3a88('0x9c')](_0x1d1a6b,function(_0x124efa,_0x573b63){if(_0x124efa)return _0x28edb4(_0x124efa);fs[_0x3a88('0x9d')](path['join'](_0x283f95,_0x35a122),_0x573b63);return _0x57a4f9(_0x573b63);});});}})[_0x3a88('0x23')](function(_0x4c7812){if(_0x4c7812){return _0x58abbb[_0x3a88('0x89')](path[_0x3a88('0x8b')](_0x283f95,_0x35a122),_0x35a122,function(_0x2e8bae){if(_0x2e8bae){console['log'](_0x3a88('0x9e'),_0x2e8bae);}else{fs['unlinkSync'](path[_0x3a88('0x8b')](_0x283f95,_0x35a122));}});}})[_0x3a88('0x2d')](handleError(_0x58abbb,null));}; \ No newline at end of file +var _0x9590=['Contact','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','download','toString','server','files','tmp','message-%s.eml','bcc','createdAt','Attachment','from','subject','headers','Bcc','Attachments','existsSync','push','type','readFileSync','build','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./mailMessage.socket','jayson/promise','http','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','apply','reject','save','destroy','then','end','stack','name','send','index','MailMessage','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','map','key','field','options','includeAll','include','findAll','show','find','body','params','describe','create','direction','out','secret','MailAccount','MailAccountId','MailServerOut','Smtp','isNil','host','port','secure','auth','pass','service','user','attachments','join','root','server/files/attachments','basename','SendMail','sendMail','update','format','stringify','mail-interactions','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0x9590,0xd3));var _0x0959=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0x9590[_0x30cc1a];return _0xb3f18f;};'use strict';var pdf=require(_0x0959('0x0'));var emlformat=require(_0x0959('0x1'));var rimraf=require(_0x0959('0x2'));var zipdir=require(_0x0959('0x3'));var jsonpatch=require(_0x0959('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0959('0x5'));var Mustache=require(_0x0959('0x6'));var util=require(_0x0959('0x7'));var path=require(_0x0959('0x8'));var sox=require(_0x0959('0x9'));var csv=require(_0x0959('0xa'));var ejs=require(_0x0959('0xb'));var fs=require('fs');var _=require(_0x0959('0xc'));var squel=require(_0x0959('0xd'));var crypto=require(_0x0959('0xe'));var jsforce=require(_0x0959('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0959('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0959('0x11'));var qs=require(_0x0959('0x12'));var hardwareService=require(_0x0959('0x13'));var logger=require(_0x0959('0x14'))('api');var utils=require(_0x0959('0x15'));var config=require('../../config/environment');var db=require(_0x0959('0x16'))['db'];config['redis']=_['defaults'](config[_0x0959('0x17')],{'host':_0x0959('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0959('0x19'))['register'](socket);var jayson=require(_0x0959('0x1a'));var client=jayson['client'][_0x0959('0x1b')]({'port':0x232c});var client9003=jayson[_0x0959('0x1c')][_0x0959('0x1b')]({'port':0x232b});var client9002=jayson[_0x0959('0x1c')][_0x0959('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x57c6ab,_0x2407ee,_0x15c79e){if(_0x15c79e){var _0x1e7ffd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e7ffd[_0x0959('0x1d')](_0x2407ee)){return _0x57c6ab;}else{throw new Error(_0x0959('0x1e'));}}else{return _0x57c6ab;}}function respondWithRpcPromise(_0x58f98d,_0x30e7db,_0xaacd76,_0x5e54b0){return new BPromise(function(_0x2d9d2e,_0x475476){var _0xf042c8=_0x5e54b0||client;return _0xf042c8[_0x0959('0x1f')](_0x58f98d,_0xaacd76)['then'](function(_0x516574){logger[_0x0959('0x20')](_0x0959('0x21'),_0x30e7db,_0x0959('0x22'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x30e7db,_0x0959('0x22'),JSON['stringify'](_0x516574));if(_0x516574[_0x0959('0x23')]){if(_0x516574[_0x0959('0x23')][_0x0959('0x24')]===0x1f4){logger[_0x0959('0x23')](_0x0959('0x21'),_0x30e7db,_0x516574[_0x0959('0x23')][_0x0959('0x25')]);return _0x475476(_0x516574[_0x0959('0x23')][_0x0959('0x25')]);}logger[_0x0959('0x23')]('MailMessage,\x20%s,\x20%s',_0x30e7db,_0x516574['error'][_0x0959('0x25')]);return _0x2d9d2e(_0x516574['error']['message']);}else{logger[_0x0959('0x20')](_0x0959('0x21'),_0x30e7db,_0x0959('0x22'));_0x2d9d2e(_0x516574[_0x0959('0x26')][_0x0959('0x25')]);}})[_0x0959('0x27')](function(_0x59d00f){logger['error'](_0x0959('0x21'),_0x30e7db,_0x59d00f);_0x475476(_0x59d00f);});});}function respondWithStatusCode(_0x314134,_0x113c8a){_0x113c8a=_0x113c8a||0xcc;return function(_0x3d33fc){if(_0x3d33fc){return _0x314134[_0x0959('0x28')](_0x113c8a);}return _0x314134[_0x0959('0x29')](_0x113c8a)['end']();};}function respondWithResult(_0x375c5b,_0x94d8f4){_0x94d8f4=_0x94d8f4||0xc8;return function(_0xcfc0e1){if(_0xcfc0e1){return _0x375c5b[_0x0959('0x29')](_0x94d8f4)[_0x0959('0x2a')](_0xcfc0e1);}};}function respondWithFilteredResult(_0x3ee493,_0x5e48e0){return function(_0x2c941f){if(_0x2c941f){var _0x13fbb6=_0x2c941f[_0x0959('0x2b')],_0x12221d=_0x5e48e0[_0x0959('0x2c')],_0x2efa15=_0x5e48e0[_0x0959('0x2c')]+_0x5e48e0[_0x0959('0x2d')],_0x3e89cf;if(_0x2efa15>=_0x13fbb6){_0x2efa15=_0x13fbb6;_0x3e89cf=0xc8;}else{_0x3e89cf=0xce;}_0x3ee493[_0x0959('0x29')](_0x3e89cf);return _0x3ee493['set']('Content-Range',_0x12221d+'-'+_0x2efa15+'/'+_0x13fbb6)[_0x0959('0x2a')](_0x2c941f);}return null;};}function patchUpdates(_0x2d1395){return function(_0x4cc7d7){try{jsonpatch[_0x0959('0x2e')](_0x4cc7d7,_0x2d1395,!![]);}catch(_0x591b92){return BPromise[_0x0959('0x2f')](_0x591b92);}return _0x4cc7d7[_0x0959('0x30')]();};}function saveUpdates(_0x249675,_0x2d7d4c){return function(_0x5bd3ba){if(_0x5bd3ba){return _0x5bd3ba['update'](_0x249675)['then'](function(_0x30dbda){return _0x30dbda;});}return null;};}function removeEntity(_0x4c1060,_0x561b2a){return function(_0x464b86){if(_0x464b86){return _0x464b86[_0x0959('0x31')]()[_0x0959('0x32')](function(){_0x4c1060['status'](0xcc)[_0x0959('0x33')]();});}};}function handleEntityNotFound(_0x44773c,_0x1ac00c){return function(_0x37492a){if(!_0x37492a){_0x44773c[_0x0959('0x28')](0x194);}return _0x37492a;};}function handleError(_0x4011f7,_0x1ac9a6){_0x1ac9a6=_0x1ac9a6||0x1f4;return function(_0x5c089e){logger[_0x0959('0x23')](_0x5c089e[_0x0959('0x34')]);if(_0x5c089e[_0x0959('0x35')]){delete _0x5c089e[_0x0959('0x35')];}_0x4011f7[_0x0959('0x29')](_0x1ac9a6)[_0x0959('0x36')](_0x5c089e);};}exports[_0x0959('0x37')]=function(_0x1b291e,_0x1e3e6e){var _0x52af80={},_0x22ebde={},_0x6d0a22={'count':0x0,'rows':[]};var _0x1265ac=db[_0x0959('0x38')][_0x0959('0x39')];_0x22ebde[_0x0959('0x3a')]=_[_0x0959('0x3b')](_0x1265ac);_0x22ebde[_0x0959('0x3c')]=_[_0x0959('0x3b')](_0x1b291e[_0x0959('0x3c')]);_0x22ebde['filters']=_[_0x0959('0x3d')](_0x22ebde[_0x0959('0x3a')],_0x22ebde[_0x0959('0x3c')]);_0x52af80[_0x0959('0x3e')]=_[_0x0959('0x3d')](_0x22ebde['model'],qs[_0x0959('0x3f')](_0x1b291e[_0x0959('0x3c')]['fields']));_0x52af80[_0x0959('0x3e')]=_0x52af80[_0x0959('0x3e')][_0x0959('0x40')]?_0x52af80[_0x0959('0x3e')]:_0x22ebde[_0x0959('0x3a')];if(!_0x1b291e[_0x0959('0x3c')][_0x0959('0x41')](_0x0959('0x42'))){_0x52af80['limit']=qs[_0x0959('0x2d')](_0x1b291e['query']['limit']);_0x52af80[_0x0959('0x2c')]=qs['offset'](_0x1b291e[_0x0959('0x3c')][_0x0959('0x2c')]);}_0x52af80['order']=qs[_0x0959('0x43')](_0x1b291e[_0x0959('0x3c')][_0x0959('0x43')]);_0x52af80[_0x0959('0x44')]=qs[_0x0959('0x45')](_[_0x0959('0x46')](_0x1b291e[_0x0959('0x3c')],_0x22ebde['filters']));if(_0x1b291e[_0x0959('0x3c')][_0x0959('0x47')]){_0x52af80[_0x0959('0x44')]=_[_0x0959('0x48')](_0x52af80[_0x0959('0x44')],{'$or':_[_0x0959('0x49')](_0x1265ac,function(_0x1a90ba){if(_0x1a90ba['type'][_0x0959('0x4a')]!=='VIRTUAL'){var _0x2ca010={};_0x2ca010[_0x1a90ba[_0x0959('0x4b')]]={'$like':'%'+_0x1b291e[_0x0959('0x3c')][_0x0959('0x47')]+'%'};return _0x2ca010;}})});}_0x52af80=_[_0x0959('0x48')]({},_0x52af80,_0x1b291e[_0x0959('0x4c')]);var _0x267d5c={'where':_0x52af80[_0x0959('0x44')]};return db[_0x0959('0x38')][_0x0959('0x2b')](_0x267d5c)['then'](function(_0x5acb9b){_0x6d0a22[_0x0959('0x2b')]=_0x5acb9b;if(_0x1b291e[_0x0959('0x3c')][_0x0959('0x4d')]){_0x52af80[_0x0959('0x4e')]=[{'all':!![]}];}return db[_0x0959('0x38')][_0x0959('0x4f')](_0x52af80);})[_0x0959('0x32')](function(_0x3afeab){_0x6d0a22['rows']=_0x3afeab;return _0x6d0a22;})[_0x0959('0x32')](respondWithFilteredResult(_0x1e3e6e,_0x52af80))['catch'](handleError(_0x1e3e6e,null));};exports[_0x0959('0x50')]=function(_0x35f750,_0x46b0f4){var _0x419f4c={'raw':!![],'where':{'id':_0x35f750['params']['id']}},_0x41ff08={};_0x41ff08[_0x0959('0x3a')]=_[_0x0959('0x3b')](db['MailMessage']['rawAttributes']);_0x41ff08[_0x0959('0x3c')]=_[_0x0959('0x3b')](_0x35f750[_0x0959('0x3c')]);_0x41ff08[_0x0959('0x45')]=_[_0x0959('0x3d')](_0x41ff08[_0x0959('0x3a')],_0x41ff08['query']);_0x419f4c[_0x0959('0x3e')]=_[_0x0959('0x3d')](_0x41ff08[_0x0959('0x3a')],qs[_0x0959('0x3f')](_0x35f750[_0x0959('0x3c')][_0x0959('0x3f')]));_0x419f4c[_0x0959('0x3e')]=_0x419f4c[_0x0959('0x3e')][_0x0959('0x40')]?_0x419f4c[_0x0959('0x3e')]:_0x41ff08[_0x0959('0x3a')];if(_0x35f750['query']['includeAll']){_0x419f4c['include']=[{'all':!![]}];}_0x419f4c=_[_0x0959('0x48')]({},_0x419f4c,_0x35f750[_0x0959('0x4c')]);return db['MailMessage'][_0x0959('0x51')](_0x419f4c)['then'](handleEntityNotFound(_0x46b0f4,null))[_0x0959('0x32')](respondWithResult(_0x46b0f4,null))[_0x0959('0x27')](handleError(_0x46b0f4,null));};exports['update']=function(_0x555298,_0x3d89fe){if(_0x555298['body']['id']){delete _0x555298[_0x0959('0x52')]['id'];}return db[_0x0959('0x38')][_0x0959('0x51')]({'where':{'id':_0x555298[_0x0959('0x53')]['id']}})[_0x0959('0x32')](handleEntityNotFound(_0x3d89fe,null))[_0x0959('0x32')](saveUpdates(_0x555298[_0x0959('0x52')],null))[_0x0959('0x32')](respondWithResult(_0x3d89fe,null))[_0x0959('0x27')](handleError(_0x3d89fe,null));};exports['destroy']=function(_0x5848f7,_0x580244){return db[_0x0959('0x38')][_0x0959('0x51')]({'where':{'id':_0x5848f7[_0x0959('0x53')]['id']}})[_0x0959('0x32')](handleEntityNotFound(_0x580244,null))[_0x0959('0x32')](removeEntity(_0x580244,null))[_0x0959('0x27')](handleError(_0x580244,null));};exports[_0x0959('0x54')]=function(_0xf96ffe,_0x5ac3c5){return db[_0x0959('0x38')]['describe']()[_0x0959('0x32')](respondWithResult(_0x5ac3c5,null))[_0x0959('0x27')](handleError(_0x5ac3c5,null));};exports[_0x0959('0x55')]=function(_0x4d55b2,_0x860bf0){return db['MailMessage'][_0x0959('0x55')](_0x4d55b2[_0x0959('0x52')])[_0x0959('0x32')](function(_0x137314){if(_0x137314){if(_0x137314[_0x0959('0x56')]===_0x0959('0x57')&&!_0x137314[_0x0959('0x58')]){return db[_0x0959('0x59')]['findOne']({'where':{'id':_0x137314[_0x0959('0x5a')]},'include':[{'model':db[_0x0959('0x5b')],'as':'Smtp','raw':!![]}]})['then'](function(_0x1d851e){if(_0x1d851e&&_0x1d851e[_0x0959('0x5c')]){var _0x171570={'tls':{'rejectUnauthorized':![]}};if(_[_0x0959('0x5d')](_0x1d851e[_0x0959('0x5c')]['service'])){_0x171570[_0x0959('0x5e')]=_0x1d851e[_0x0959('0x5c')][_0x0959('0x5e')];_0x171570[_0x0959('0x5f')]=_0x1d851e[_0x0959('0x5c')][_0x0959('0x5f')];_0x171570[_0x0959('0x60')]=_0x1d851e[_0x0959('0x5c')]['secure'];if(_0x1d851e[_0x0959('0x5c')]['authentication']){_0x171570[_0x0959('0x61')]={'user':_0x1d851e[_0x0959('0x5c')]['user'],'pass':_0x1d851e[_0x0959('0x5c')][_0x0959('0x62')]};}}else{_0x171570['service']=_0x1d851e[_0x0959('0x5c')][_0x0959('0x63')];_0x171570[_0x0959('0x61')]={'user':_0x1d851e[_0x0959('0x5c')][_0x0959('0x64')],'pass':_0x1d851e[_0x0959('0x5c')][_0x0959('0x62')]};_0x171570[_0x0959('0x60')]=_0x1d851e[_0x0959('0x5c')]['secure'];}if(_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')]&&_0x4d55b2['body'][_0x0959('0x65')][_0x0959('0x40')]){for(var _0x35692d=0x0;_0x35692d<_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x0959('0x40')];_0x35692d+=0x1){_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x35692d]={'filename':_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x35692d][_0x0959('0x35')],'path':path[_0x0959('0x66')](config[_0x0959('0x67')],_0x0959('0x68'),_0x4d55b2[_0x0959('0x52')][_0x0959('0x65')][_0x35692d][_0x0959('0x69')])};}}return{'account':_0x171570,'message':_0x4d55b2[_0x0959('0x52')]};}})[_0x0959('0x32')](function(_0x1dd908){if(_0x1dd908){return respondWithRpcPromise(_0x0959('0x6a'),_0x0959('0x6b'),_0x1dd908,client9003)['then'](function(_0x431da7){return _0x137314[_0x0959('0x6c')]({'read':!![],'messageId':_0x431da7['messageId'],'sentAt':moment()[_0x0959('0x6d')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x0959('0x27')](function(_0x4f135e){logger[_0x0959('0x23')]('%s',JSON[_0x0959('0x6e')](_0x4f135e));return _0x137314;});}return _0x137314;});}return _0x137314;}})[_0x0959('0x32')](respondWithResult(_0x860bf0,0xc9))[_0x0959('0x27')](handleError(_0x860bf0,null));};var interaction_log=require(_0x0959('0x14'))(_0x0959('0x6f'));exports[_0x0959('0x70')]=function(_0xed3c47,_0x286c20,_0x570bf8){var _0x489ca7={'channel':_0x0959('0x71')};if(_0xed3c47[_0x0959('0x52')]['id']){delete _0xed3c47['body']['id'];}_0xed3c47[_0x0959('0x52')][_0x0959('0x72')]=!![];_0xed3c47['body'][_0x0959('0x73')]=moment()[_0x0959('0x6d')](_0x0959('0x74'));_0xed3c47[_0x0959('0x52')][_0x0959('0x75')]=_0xed3c47[_0x0959('0x52')]['UserId']||_0xed3c47[_0x0959('0x64')]['id'];return db[_0x0959('0x38')]['find']({'where':{'id':_0xed3c47['params']['id'],'UserId':null},'include':[{'model':db[_0x0959('0x76')],'as':_0x0959('0x77')}]})[_0x0959('0x32')](handleEntityNotFound(_0x286c20,null))['then'](saveUpdates(_0xed3c47['body'],null))[_0x0959('0x32')](function(_0x32025a){if(_0x32025a){_0x489ca7[_0x0959('0x25')]=_0x32025a[_0x0959('0x78')]({'plain':!![]});return db[_0x0959('0x79')][_0x0959('0x51')]({'where':{'id':_0x32025a[_0x0959('0x7a')]}});}return null;})[_0x0959('0x32')](handleEntityNotFound(_0x286c20,null))[_0x0959('0x32')](function(_0x37a9cf){if(_0x37a9cf){return _0x37a9cf[_0x0959('0x6c')]({'UserId':_0xed3c47[_0x0959('0x52')][_0x0959('0x75')],'read1stAt':_[_0x0959('0x5d')](_0x37a9cf[_0x0959('0x7b')])?moment()[_0x0959('0x6d')](_0x0959('0x74')):undefined});}return null;})[_0x0959('0x32')](function(_0x27c1f2){if(_0x27c1f2){_0x489ca7[_0x0959('0x7c')]=_0x27c1f2[_0x0959('0x78')]({'plain':!![]});interaction_log[_0x0959('0x20')](_0x0959('0x7d'),_0xed3c47[_0x0959('0x64')]['id'],_0xed3c47[_0x0959('0x64')][_0x0959('0x35')],_0xed3c47[_0x0959('0x64')][_0x0959('0x7e')],_0x489ca7[_0x0959('0x7c')]['id'],_0xed3c47[_0x0959('0x52')]?JSON[_0x0959('0x6e')](_0xed3c47[_0x0959('0x52')]):_0x0959('0x7f'));return respondWithRpcPromise(_0x0959('0x80'),_0x0959('0x81'),_0x489ca7);}return null;})['then'](function(_0x2f9797){if(_0x2f9797){if(_0xed3c47[_0x0959('0x52')][_0x0959('0x82')]){_0x489ca7[_0x0959('0x25')][_0x0959('0x83')]=util['format'](_0x0959('0x84'),_0xed3c47[_0x0959('0x64')]['name']);_0x489ca7[_0x0959('0x25')][_0x0959('0x85')]=_0x489ca7[_0x0959('0x85')];_0x489ca7['message']['event']=_0x0959('0x70');return respondWithRpcPromise(_0x0959('0x86'),_0x0959('0x86'),{'event':_0x0959('0x87'),'message':_0x489ca7['message']},client9002)[_0x0959('0x32')](function(){return _0x489ca7;});}return _0x489ca7;}return null;})['then'](respondWithResult(_0x286c20,null))['catch'](handleError(_0x286c20,null));};var interaction_log=require(_0x0959('0x14'))('mail-interactions');exports[_0x0959('0x2f')]=function(_0x56c875,_0x2885f3,_0x532713){var _0x2f62c6={'agent':{},'channel':_0x0959('0x71')};if(_0x56c875[_0x0959('0x52')]['id']){delete _0x56c875['body']['id'];}_0x56c875['body'][_0x0959('0x75')]=_0x56c875['body'][_0x0959('0x75')]||_0x56c875['user']['id'];_0x2f62c6[_0x0959('0x88')]['id']=_0x56c875[_0x0959('0x52')][_0x0959('0x75')];return db[_0x0959('0x38')][_0x0959('0x51')]({'where':{'id':_0x56c875['params']['id'],'UserId':null}})[_0x0959('0x32')](handleEntityNotFound(_0x2885f3,null))['then'](function(_0x3d126f){if(_0x3d126f){_0x2f62c6['message']=_0x3d126f[_0x0959('0x78')]({'plain':!![]});return db[_0x0959('0x79')][_0x0959('0x51')]({'where':{'id':_0x3d126f['MailInteractionId']}});}return null;})[_0x0959('0x32')](handleEntityNotFound(_0x2885f3,null))[_0x0959('0x32')](function(_0x4c49f4){if(_0x4c49f4){_0x2f62c6['interaction']=_0x4c49f4['get']({'plain':!![]});interaction_log['info'](_0x0959('0x89'),_0x56c875[_0x0959('0x64')]['id'],_0x56c875[_0x0959('0x64')][_0x0959('0x35')],_0x56c875[_0x0959('0x64')][_0x0959('0x7e')],_0x2f62c6[_0x0959('0x7c')]['id'],_0x56c875[_0x0959('0x52')]?JSON[_0x0959('0x6e')](_0x56c875['body']):_0x0959('0x7f'));return respondWithRpcPromise(_0x0959('0x8a'),_0x0959('0x8b'),_0x2f62c6);}return null;})['then'](function(_0x21868b){if(_0x21868b){_0x21868b['message'][_0x0959('0x83')]=util['format'](_0x0959('0x84'),_0x56c875[_0x0959('0x64')][_0x0959('0x35')]);_0x21868b[_0x0959('0x25')][_0x0959('0x85')]=_0x2f62c6[_0x0959('0x85')];_0x21868b[_0x0959('0x25')][_0x0959('0x8c')]='reject';respondWithRpcPromise(_0x0959('0x86'),_0x0959('0x86'),{'event':_0x0959('0x8d'),'message':_0x21868b[_0x0959('0x25')]},client9002);return _0x2f62c6;}return null;})[_0x0959('0x32')](respondWithResult(_0x2885f3,null))[_0x0959('0x27')](handleError(_0x2885f3,null));};exports[_0x0959('0x8e')]=function(_0x2ed7e7,_0x2b987a){var _0x4ce49b=moment()['unix']()[_0x0959('0x8f')]();var _0x5307c0=path[_0x0959('0x66')](config[_0x0959('0x67')],_0x0959('0x90'),_0x0959('0x91'),_0x0959('0x92'));var _0x3627b1=path[_0x0959('0x66')](config['root'],_0x0959('0x90'),_0x0959('0x91'),_0x0959('0x65'));var _0x4ab456=util[_0x0959('0x6d')](_0x0959('0x93'),_0x4ce49b);return db[_0x0959('0x38')]['find']({'where':{'id':_0x2ed7e7[_0x0959('0x53')]['id']},'attributes':['id',_0x0959('0x52'),'from','to','cc',_0x0959('0x94'),'subject',_0x0959('0x95')],'include':_0x2ed7e7[_0x0959('0x3c')]['attachments']?[{'model':db[_0x0959('0x96')],'as':'Attachments'}]:undefined})[_0x0959('0x32')](handleEntityNotFound(_0x2b987a,null))[_0x0959('0x32')](function(_0xb48ed4){if(_0xb48ed4){var _0x1fda86=_0xb48ed4;var _0x14e712={'from':_0x1fda86[_0x0959('0x97')],'to':_0x1fda86['to'],'subject':_0x1fda86[_0x0959('0x98')],'html':_0x1fda86['body'],'headers':{'Date':moment(_0x1fda86['createdAt'])[_0x0959('0x6d')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0xb48ed4['cc']){_0x14e712[_0x0959('0x99')]['Cc']=_0xb48ed4['cc'];}if(_0xb48ed4['bcc']){_0x14e712['headers'][_0x0959('0x9a')]=_0xb48ed4[_0x0959('0x94')];}return new BPromise(function(_0x57c173,_0x14bd51){if(_0xb48ed4[_0x0959('0x9b')]){for(var _0x172beb=0x0;_0x172beb<_0xb48ed4[_0x0959('0x9b')]['length'];_0x172beb++){var _0x2ec1fd=_0xb48ed4[_0x0959('0x9b')][_0x172beb];var _0x32fc3d=path[_0x0959('0x66')](_0x3627b1,_0x2ec1fd[_0x0959('0x69')]);if(fs[_0x0959('0x9c')](_0x32fc3d)){_0x14e712[_0x0959('0x65')][_0x0959('0x9d')]({'name':_0x2ec1fd[_0x0959('0x35')],'contentType':_0x2ec1fd[_0x0959('0x9e')],'data':fs[_0x0959('0x9f')](_0x32fc3d)});}}}emlformat[_0x0959('0xa0')](_0x14e712,function(_0x281b95,_0x514bd3){if(_0x281b95)return _0x14bd51(_0x281b95);fs[_0x0959('0xa1')](path[_0x0959('0x66')](_0x5307c0,_0x4ab456),_0x514bd3);return _0x57c173(_0x514bd3);});});}})[_0x0959('0x32')](function(_0x491f74){if(_0x491f74){return _0x2b987a['download'](path['join'](_0x5307c0,_0x4ab456),_0x4ab456,function(_0x28ba66){if(_0x28ba66){console[_0x0959('0xa2')](_0x0959('0xa3'),_0x28ba66);}else{fs[_0x0959('0xa4')](path[_0x0959('0x66')](_0x5307c0,_0x4ab456));}});}})[_0x0959('0x27')](handleError(_0x2b987a,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index f8b0827..0a79f6c 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 _0xc99e=['hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0xaed222,_0x14be57){var _0x2ecd45=function(_0x3a2f8f){while(--_0x3a2f8f){_0xaed222['push'](_0xaed222['shift']());}};_0x2ecd45(++_0x14be57);}(_0xc99e,0x6e));var _0xec99=function(_0x5e96fd,_0xeb4596){_0x5e96fd=_0x5e96fd-0x0;var _0x37e7c=_0xc99e[_0x5e96fd];return _0x37e7c;};'use strict';var EventEmitter=require(_0xec99('0x0'));var MailMessage=require(_0xec99('0x1'))['db'][_0xec99('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xec99('0x3')](0x0);var events={'afterCreate':_0xec99('0x4'),'afterUpdate':_0xec99('0x5'),'afterDestroy':'remove'};function emitEvent(_0xdd6e94){return function(_0x4055ec,_0x111230,_0xc7b94f){MailMessageEvents[_0xec99('0x6')](_0xdd6e94+':'+_0x4055ec['id'],_0x4055ec);MailMessageEvents[_0xec99('0x6')](_0xdd6e94,_0x4055ec);_0xc7b94f(null);};}for(var e in events){if(events[_0xec99('0x7')](e)){var event=events[e];MailMessage[_0xec99('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xc949=['exports','events','MailMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0xe4dc99,_0x3f0e75){var _0x2d1561=function(_0x52b551){while(--_0x52b551){_0xe4dc99['push'](_0xe4dc99['shift']());}};_0x2d1561(++_0x3f0e75);}(_0xc949,0x181));var _0x9c94=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xc949[_0x491a7f];return _0x3d8f44;};'use strict';var EventEmitter=require(_0x9c94('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x9c94('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9c94('0x2')](0x0);var events={'afterCreate':_0x9c94('0x3'),'afterUpdate':_0x9c94('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11a56c){return function(_0x231762,_0x528a17,_0x405fe2){MailMessageEvents[_0x9c94('0x5')](_0x11a56c+':'+_0x231762['id'],_0x231762);MailMessageEvents[_0x9c94('0x5')](_0x11a56c,_0x231762);_0x405fe2(null);};}for(var e in events){if(events[_0x9c94('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x9c94('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 22719c5..a69225d 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 _0x3ff2=['createdAt','error','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailMessage.attributes','define','mail_messages','messageId','FULLTEXT','body','plainBody','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3ff2,0xe2));var _0x23ff=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3ff2[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x23ff('0x0'));var util=require(_0x23ff('0x1'));var logger=require(_0x23ff('0x2'))('api');var moment=require(_0x23ff('0x3'));var BPromise=require(_0x23ff('0x4'));var rp=require('request-promise');var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x23ff('0x5'));var rimraf=require(_0x23ff('0x6'));var config=require(_0x23ff('0x7'));var attributes=require(_0x23ff('0x8'));module['exports']=function(_0x5be373,_0x3f54ea){return _0x5be373[_0x23ff('0x9')]('MailMessage',attributes,{'tableName':_0x23ff('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x23ff('0xb')]},{'name':'fti_mail_messages','fields':['plainBody','subject'],'type':_0x23ff('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x555ea2,_0x4ac6fd,_0x8ef3a7){if(_0x555ea2[_0x23ff('0xd')]){_0x555ea2[_0x23ff('0xe')]=htmlToText[_0x23ff('0xf')](_0x555ea2[_0x23ff('0xd')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x8ef3a7(null,_0x4ac6fd);},'afterCreate':function(_0x5a0303,_0x5e7758,_0x639f02){var _0xd80564=_0x5be373[_0x23ff('0x10')];var _0xb3211e=_0x5a0303[_0x23ff('0x11')]({'plain':!![]});if(_0xb3211e[_0x23ff('0x12')][_0x23ff('0x13')]()==='in'||_0xb3211e['direction']['toLowerCase']()===_0x23ff('0x14')&&!_0xb3211e[_0x23ff('0x15')]&&!_[_0x23ff('0x16')](_0xb3211e[_0x23ff('0x17')])){_0xd80564[_0x23ff('0x18')][_0x23ff('0x19')]({'where':{'id':_0xb3211e['MailInteractionId']}})['then'](function(_0x320f4a){if(_0x320f4a){_0x320f4a['update']({'lastMsgAt':_0xb3211e[_0x23ff('0x1a')],'lastMsgDirection':_0xb3211e['direction'][_0x23ff('0x13')](),'lastMsgBody':_0xb3211e[_0x23ff('0xd')]});}})['catch'](function(_0x118233){console[_0x23ff('0x1b')](_0x118233);});}_0x639f02();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x97fb=['findOne','then','update','catch','utf8mb4','lodash','../../config/logger','api','moment','bluebird','html-to-text','rimraf','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x5ef905,_0x564b87){var _0x367808=function(_0x14f487){while(--_0x14f487){_0x5ef905['push'](_0x5ef905['shift']());}};_0x367808(++_0x564b87);}(_0x97fb,0x1b8));var _0xb97f=function(_0xe30e17,_0xce02be){_0xe30e17=_0xe30e17-0x0;var _0x2342c9=_0x97fb[_0xe30e17];return _0x2342c9;};'use strict';var _=require(_0xb97f('0x0'));var util=require('util');var logger=require(_0xb97f('0x1'))(_0xb97f('0x2'));var moment=require(_0xb97f('0x3'));var BPromise=require(_0xb97f('0x4'));var rp=require('request-promise');var htmlToText=require(_0xb97f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb97f('0x6'));var config=require(_0xb97f('0x7'));var attributes=require('./mailMessage.attributes');module[_0xb97f('0x8')]=function(_0x39a460,_0x24d53c){return _0x39a460[_0xb97f('0x9')]('MailMessage',attributes,{'tableName':_0xb97f('0xa'),'paranoid':![],'indexes':[{'name':_0xb97f('0xb'),'fields':['messageId']},{'name':_0xb97f('0xc'),'fields':[_0xb97f('0xd'),_0xb97f('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x45cbec,_0x3af14f,_0x2e4fda){if(_0x45cbec[_0xb97f('0xf')]){_0x45cbec[_0xb97f('0xd')]=htmlToText[_0xb97f('0x10')](_0x45cbec[_0xb97f('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2e4fda(null,_0x3af14f);},'afterCreate':function(_0x17e545,_0x52ab5b,_0xac01f6){var _0x525e90=_0x39a460[_0xb97f('0x11')];var _0x5b870b=_0x17e545['get']({'plain':!![]});if(_0x5b870b['direction'][_0xb97f('0x12')]()==='in'||_0x5b870b[_0xb97f('0x13')][_0xb97f('0x12')]()===_0xb97f('0x14')&&!_0x5b870b[_0xb97f('0x15')]&&!_[_0xb97f('0x16')](_0x5b870b[_0xb97f('0x17')])){_0x525e90['MailInteraction'][_0xb97f('0x18')]({'where':{'id':_0x5b870b['MailInteractionId']}})[_0xb97f('0x19')](function(_0x26ba48){if(_0x26ba48){_0x26ba48[_0xb97f('0x1a')]({'lastMsgAt':_0x5b870b['createdAt'],'lastMsgDirection':_0x5b870b[_0xb97f('0x13')][_0xb97f('0x12')](),'lastMsgBody':_0x5b870b[_0xb97f('0xf')]});}})[_0xb97f('0x1b')](function(_0x4f3d70){console['error'](_0x4f3d70);});}_0xac01f6();}},'charset':_0xb97f('0x1c'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 96f85c7..521c37d 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 _0x4fb4=['MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailMessage','body','options','CreateMailMessage','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then'];(function(_0x193d08,_0x5df3c7){var _0x241318=function(_0x49fa9c){while(--_0x49fa9c){_0x193d08['push'](_0x193d08['shift']());}};_0x241318(++_0x5df3c7);}(_0x4fb4,0x190));var _0x44fb=function(_0x12f728,_0x3dfdf6){_0x12f728=_0x12f728-0x0;var _0x21c1bb=_0x4fb4[_0x12f728];return _0x21c1bb;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var moment=require(_0x44fb('0x1'));var BPromise=require(_0x44fb('0x2'));var rs=require(_0x44fb('0x3'));var fs=require('fs');var Redis=require(_0x44fb('0x4'));var db=require(_0x44fb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x44fb('0x6'))(_0x44fb('0x7'));var config=require(_0x44fb('0x8'));var jayson=require(_0x44fb('0x9'));var client=jayson[_0x44fb('0xa')][_0x44fb('0xb')]({'port':0x232a});config[_0x44fb('0xc')]=_[_0x44fb('0xd')](config['redis'],{'host':_0x44fb('0xe'),'port':0x18eb});var socket=require(_0x44fb('0xf'))(new Redis(config['redis']));require(_0x44fb('0x10'))[_0x44fb('0x11')](socket);function respondWithRpcPromise(_0x2a1cb7,_0x34444f,_0x211fa3){return new BPromise(function(_0x44c83b,_0x184039){return client[_0x44fb('0x12')](_0x2a1cb7,_0x211fa3)[_0x44fb('0x13')](function(_0x2ae684){logger['info'](_0x44fb('0x14'),_0x34444f,_0x44fb('0x15'));logger[_0x44fb('0x16')](_0x44fb('0x17'),_0x34444f,_0x44fb('0x15'),JSON['stringify'](_0x2ae684));if(_0x2ae684[_0x44fb('0x18')]){if(_0x2ae684[_0x44fb('0x18')][_0x44fb('0x19')]===0x1f4){logger[_0x44fb('0x18')](_0x44fb('0x14'),_0x34444f,_0x2ae684['error'][_0x44fb('0x1a')]);return _0x184039(_0x2ae684[_0x44fb('0x18')][_0x44fb('0x1a')]);}logger[_0x44fb('0x18')](_0x44fb('0x14'),_0x34444f,_0x2ae684[_0x44fb('0x18')][_0x44fb('0x1a')]);return _0x44c83b(_0x2ae684['error'][_0x44fb('0x1a')]);}else{logger[_0x44fb('0x1b')](_0x44fb('0x14'),_0x34444f,_0x44fb('0x15'));_0x44c83b(_0x2ae684[_0x44fb('0x1c')][_0x44fb('0x1a')]);}})[_0x44fb('0x1d')](function(_0x1074cd){logger[_0x44fb('0x18')](_0x44fb('0x14'),_0x34444f,_0x1074cd);_0x184039(_0x1074cd);});});}exports['CreateMailMessage']=function(_0x4bd157){var _0x4b50f5=this;return new Promise(function(_0x4188f9,_0xca80c){return db[_0x44fb('0x1e')]['create'](_0x4bd157[_0x44fb('0x1f')],{'raw':_0x4bd157[_0x44fb('0x20')]?_0x4bd157[_0x44fb('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x38e834){logger[_0x44fb('0x1b')](_0x44fb('0x21'),_0x4bd157);logger['debug'](_0x44fb('0x21'),_0x4bd157,JSON[_0x44fb('0x22')](_0x38e834));_0x4188f9(_0x38e834);})[_0x44fb('0x1d')](function(_0x4a27b6){logger['error'](_0x44fb('0x21'),_0x4a27b6[_0x44fb('0x1a')],_0x4bd157);_0xca80c(_0x4b50f5[_0x44fb('0x18')](0x1f4,_0x4a27b6[_0x44fb('0x1a')]));});});}; \ No newline at end of file +var _0x1af3=['options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateMailMessage','create','body'];(function(_0x300e9e,_0xcbfa6b){var _0x53c501=function(_0x4bdeb0){while(--_0x4bdeb0){_0x300e9e['push'](_0x300e9e['shift']());}};_0x53c501(++_0xcbfa6b);}(_0x1af3,0x1ca));var _0x31af=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x1af3[_0x389832];return _0x59429e;};'use strict';var _=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var moment=require(_0x31af('0x2'));var BPromise=require(_0x31af('0x3'));var rs=require(_0x31af('0x4'));var fs=require('fs');var Redis=require(_0x31af('0x5'));var db=require(_0x31af('0x6'))['db'];var utils=require(_0x31af('0x7'));var logger=require(_0x31af('0x8'))(_0x31af('0x9'));var config=require('../../config/environment');var jayson=require(_0x31af('0xa'));var client=jayson[_0x31af('0xb')][_0x31af('0xc')]({'port':0x232a});config[_0x31af('0xd')]=_['defaults'](config[_0x31af('0xd')],{'host':_0x31af('0xe'),'port':0x18eb});var socket=require(_0x31af('0xf'))(new Redis(config['redis']));require(_0x31af('0x10'))[_0x31af('0x11')](socket);function respondWithRpcPromise(_0x1cfcf6,_0x1d2cd0,_0x2888dd){return new BPromise(function(_0x26c99f,_0x1fa064){return client[_0x31af('0x12')](_0x1cfcf6,_0x2888dd)['then'](function(_0x123fc8){logger[_0x31af('0x13')](_0x31af('0x14'),_0x1d2cd0,_0x31af('0x15'));logger[_0x31af('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1d2cd0,_0x31af('0x15'),JSON[_0x31af('0x17')](_0x123fc8));if(_0x123fc8['error']){if(_0x123fc8['error'][_0x31af('0x18')]===0x1f4){logger[_0x31af('0x19')](_0x31af('0x14'),_0x1d2cd0,_0x123fc8[_0x31af('0x19')][_0x31af('0x1a')]);return _0x1fa064(_0x123fc8[_0x31af('0x19')][_0x31af('0x1a')]);}logger[_0x31af('0x19')](_0x31af('0x14'),_0x1d2cd0,_0x123fc8[_0x31af('0x19')][_0x31af('0x1a')]);return _0x26c99f(_0x123fc8['error'][_0x31af('0x1a')]);}else{logger[_0x31af('0x13')](_0x31af('0x14'),_0x1d2cd0,_0x31af('0x15'));_0x26c99f(_0x123fc8[_0x31af('0x1b')][_0x31af('0x1a')]);}})[_0x31af('0x1c')](function(_0x1684d5){logger[_0x31af('0x19')]('MailMessage,\x20%s,\x20%s',_0x1d2cd0,_0x1684d5);_0x1fa064(_0x1684d5);});});}exports[_0x31af('0x1d')]=function(_0x230002){var _0x16be44=this;return new Promise(function(_0x2ce4c2,_0x414ad8){return db['MailMessage'][_0x31af('0x1e')](_0x230002[_0x31af('0x1f')],{'raw':_0x230002[_0x31af('0x20')]?_0x230002[_0x31af('0x20')][_0x31af('0x21')]===undefined?!![]:![]:!![]})[_0x31af('0x22')](function(_0x1ddfba){logger[_0x31af('0x13')](_0x31af('0x1d'),_0x230002);logger[_0x31af('0x16')](_0x31af('0x1d'),_0x230002,JSON[_0x31af('0x17')](_0x1ddfba));_0x2ce4c2(_0x1ddfba);})[_0x31af('0x1c')](function(_0x34a5a7){logger[_0x31af('0x19')]('CreateMailMessage',_0x34a5a7['message'],_0x230002);_0x414ad8(_0x16be44['error'](0x1f4,_0x34a5a7[_0x31af('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index af90c19..7d10feb 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 _0x0cb6=['removeListener','register','mailMessage:','./mailMessage.events','save','update'];(function(_0x2eb5bc,_0x4634c6){var _0x51c7b1=function(_0x1af430){while(--_0x1af430){_0x2eb5bc['push'](_0x2eb5bc['shift']());}};_0x51c7b1(++_0x4634c6);}(_0x0cb6,0xb7));var _0x60cb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0cb6[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0x60cb('0x0'));var events=[_0x60cb('0x1'),'remove',_0x60cb('0x2')];function createListener(_0x5b773e,_0x5f2c48){return function(_0x34d446){_0x5f2c48['emit'](_0x5b773e,_0x34d446);};}function removeListener(_0x34a385,_0x14f460){return function(){MailMessageEvents[_0x60cb('0x3')](_0x34a385,_0x14f460);};}exports[_0x60cb('0x4')]=function(_0x4654c2){for(var _0x36927b=0x0,_0x14eb03=events['length'];_0x36927b<_0x14eb03;_0x36927b++){var _0x161739=events[_0x36927b];var _0x605160=createListener(_0x60cb('0x5')+_0x161739,_0x4654c2);MailMessageEvents['on'](_0x161739,_0x605160);}}; \ No newline at end of file +var _0x46cf=['mailMessage:','remove','update','emit','removeListener','register','length'];(function(_0x525209,_0x256e19){var _0x4f438f=function(_0x1d027d){while(--_0x1d027d){_0x525209['push'](_0x525209['shift']());}};_0x4f438f(++_0x256e19);}(_0x46cf,0xda));var _0xf46c=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x46cf[_0x82129b];return _0x2ae5dc;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0xf46c('0x0'),_0xf46c('0x1')];function createListener(_0x4b8031,_0xd5e4ec){return function(_0x3f2570){_0xd5e4ec[_0xf46c('0x2')](_0x4b8031,_0x3f2570);};}function removeListener(_0x280e58,_0x51ba4f){return function(){MailMessageEvents[_0xf46c('0x3')](_0x280e58,_0x51ba4f);};}exports[_0xf46c('0x4')]=function(_0x2e1bc2){for(var _0x38fa7c=0x0,_0xb3c0d7=events[_0xf46c('0x5')];_0x38fa7c<_0xb3c0d7;_0x38fa7c++){var _0x5aaa4a=events[_0x38fa7c];var _0x2189f7=createListener(_0xf46c('0x6')+_0x5aaa4a,_0x2e1bc2);MailMessageEvents['on'](_0x5aaa4a,_0x2189f7);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 8f1a0e5..3af03d7 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 _0x6e96=['destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','/:id/teams','post','addTeams','/:id/users','addAgents','put','update'];(function(_0x4e2d7b,_0x423fb6){var _0x2a796c=function(_0x9281){while(--_0x9281){_0x4e2d7b['push'](_0x4e2d7b['shift']());}};_0x2a796c(++_0x423fb6);}(_0x6e96,0x87));var _0x66e9=function(_0xfe0a5e,_0x25f9d0){_0xfe0a5e=_0xfe0a5e-0x0;var _0xaf779c=_0x6e96[_0xfe0a5e];return _0xaf779c;};'use strict';var multer=require(_0x66e9('0x0'));var util=require(_0x66e9('0x1'));var path=require(_0x66e9('0x2'));var timeout=require(_0x66e9('0x3'));var express=require(_0x66e9('0x4'));var router=express['Router']();var auth=require(_0x66e9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x66e9('0x6'));var controller=require(_0x66e9('0x7'));router[_0x66e9('0x8')]('/',auth[_0x66e9('0x9')](),controller[_0x66e9('0xa')]);router['get']('/describe',auth[_0x66e9('0x9')](),controller[_0x66e9('0xb')]);router['get'](_0x66e9('0xc'),auth[_0x66e9('0x9')](),controller['show']);router[_0x66e9('0x8')](_0x66e9('0xd'),auth[_0x66e9('0x9')](),controller['getMembers']);router['get'](_0x66e9('0xe'),auth[_0x66e9('0x9')](),controller['getTeams']);router[_0x66e9('0x8')]('/:id/users',auth[_0x66e9('0x9')](),controller['getAgents']);router[_0x66e9('0xf')]('/',auth[_0x66e9('0x9')](),controller['create']);router[_0x66e9('0xf')]('/:id/teams',auth['isAuthenticated'](),controller[_0x66e9('0x10')]);router['post'](_0x66e9('0x11'),auth[_0x66e9('0x9')](),controller[_0x66e9('0x12')]);router[_0x66e9('0x13')](_0x66e9('0xc'),auth['isAuthenticated'](),controller[_0x66e9('0x14')]);router['delete']('/:id',auth[_0x66e9('0x9')](),controller[_0x66e9('0x15')]);router[_0x66e9('0x16')](_0x66e9('0xe'),auth[_0x66e9('0x9')](),controller[_0x66e9('0x17')]);router[_0x66e9('0x16')](_0x66e9('0x11'),auth['isAuthenticated'](),controller[_0x66e9('0x18')]);module[_0x66e9('0x19')]=router; \ No newline at end of file +var _0x424e=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','path','connect-timeout','./mailQueue.controller'];(function(_0x39d9e5,_0x18e770){var _0x4481f5=function(_0x2bcc92){while(--_0x2bcc92){_0x39d9e5['push'](_0x39d9e5['shift']());}};_0x4481f5(++_0x18e770);}(_0x424e,0x156));var _0xe424=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x424e[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe424('0x0'));var timeout=require(_0xe424('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe424('0x2'));router[_0xe424('0x3')]('/',auth[_0xe424('0x4')](),controller[_0xe424('0x5')]);router['get'](_0xe424('0x6'),auth[_0xe424('0x4')](),controller['describe']);router[_0xe424('0x3')](_0xe424('0x7'),auth[_0xe424('0x4')](),controller[_0xe424('0x8')]);router[_0xe424('0x3')](_0xe424('0x9'),auth['isAuthenticated'](),controller[_0xe424('0xa')]);router[_0xe424('0x3')](_0xe424('0xb'),auth[_0xe424('0x4')](),controller['getTeams']);router[_0xe424('0x3')](_0xe424('0xc'),auth[_0xe424('0x4')](),controller[_0xe424('0xd')]);router[_0xe424('0xe')]('/',auth[_0xe424('0x4')](),controller[_0xe424('0xf')]);router[_0xe424('0xe')](_0xe424('0xb'),auth[_0xe424('0x4')](),controller[_0xe424('0x10')]);router[_0xe424('0xe')](_0xe424('0xc'),auth[_0xe424('0x4')](),controller[_0xe424('0x11')]);router[_0xe424('0x12')](_0xe424('0x7'),auth[_0xe424('0x4')](),controller['update']);router[_0xe424('0x13')]('/:id',auth[_0xe424('0x4')](),controller[_0xe424('0x14')]);router[_0xe424('0x13')](_0xe424('0xb'),auth['isAuthenticated'](),controller[_0xe424('0x15')]);router['delete'](_0xe424('0xc'),auth[_0xe424('0x4')](),controller['removeAgents']);module[_0xe424('0x16')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 126b70b..4813875 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 _0x0d1a=['exports','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x281c6c,_0x3610ca){var _0x3b060b=function(_0x8508c6){while(--_0x8508c6){_0x281c6c['push'](_0x281c6c['shift']());}};_0x3b060b(++_0x3610ca);}(_0x0d1a,0x11a));var _0xa0d1=function(_0x3134c1,_0x3a70f1){_0x3134c1=_0x3134c1-0x0;var _0x7cb4f2=_0x0d1a[_0x3134c1];return _0x7cb4f2;};'use strict';var Sequelize=require('sequelize');module[_0xa0d1('0x0')]={'name':{'type':Sequelize[_0xa0d1('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa0d1('0x1')]},'timeout':{'type':Sequelize[_0xa0d1('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa0d1('0x3'),_0xa0d1('0x4'),_0xa0d1('0x5'))}}; \ No newline at end of file +var _0x0d49=['sequelize','exports','name','ENUM','beepall','roundrobin'];(function(_0x2e78bf,_0x16d495){var _0x43511b=function(_0x396e74){while(--_0x396e74){_0x2e78bf['push'](_0x2e78bf['shift']());}};_0x43511b(++_0x16d495);}(_0x0d49,0x1da));var _0x90d4=function(_0x190d80,_0x18d26c){_0x190d80=_0x190d80-0x0;var _0x3cef0d=_0x0d49[_0x190d80];return _0x3cef0d;};'use strict';var Sequelize=require(_0x90d4('0x0'));module[_0x90d4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x90d4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x90d4('0x3')]('rrmemory',_0x90d4('0x4'),_0x90d4('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 10d67f6..cdd8fb1 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 _0xf3a2=['find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','destroy','describe','getMembers','findOne','nolimit','MailQueueId','UserMailQueue','agent','mailPause','createdAt','format','%s/%s','updatedAt','getTeams','addTeams','teams','Team','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','User','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','toString','SELECT','every','TeamId','includes','compact','value','ids','isEmpty','removeAgents','userMailQueue:remove','addAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','UserProfileResource','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','pick','filter','where','merge','map','key','VIRTUAL','field','count','include','findAll','rows','catch','show','params','length','includeAll','options'];(function(_0x209736,_0x1737dc){var _0x2af54f=function(_0x393e43){while(--_0x393e43){_0x209736['push'](_0x209736['shift']());}};_0x2af54f(++_0x1737dc);}(_0xf3a2,0x14f));var _0x2f3a=function(_0x5d61c4,_0x965aa8){_0x5d61c4=_0x5d61c4-0x0;var _0x256581=_0xf3a2[_0x5d61c4];return _0x256581;};'use strict';var pdf=require(_0x2f3a('0x0'));var emlformat=require(_0x2f3a('0x1'));var rimraf=require(_0x2f3a('0x2'));var zipdir=require(_0x2f3a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f3a('0x4'));var moment=require('moment');var BPromise=require(_0x2f3a('0x5'));var Mustache=require(_0x2f3a('0x6'));var util=require(_0x2f3a('0x7'));var path=require('path');var sox=require(_0x2f3a('0x8'));var csv=require(_0x2f3a('0x9'));var ejs=require(_0x2f3a('0xa'));var fs=require('fs');var _=require(_0x2f3a('0xb'));var squel=require(_0x2f3a('0xc'));var crypto=require(_0x2f3a('0xd'));var jsforce=require(_0x2f3a('0xe'));var deskjs=require(_0x2f3a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2f3a('0x10'));var Papa=require(_0x2f3a('0x11'));var Redis=require(_0x2f3a('0x12'));var authService=require(_0x2f3a('0x13'));var qs=require(_0x2f3a('0x14'));var hardwareService=require(_0x2f3a('0x15'));var logger=require(_0x2f3a('0x16'))('api');var utils=require(_0x2f3a('0x17'));var config=require(_0x2f3a('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2f3a('0x19')](config[_0x2f3a('0x1a')],{'host':_0x2f3a('0x1b'),'port':0x18eb});var socket=require(_0x2f3a('0x1c'))(new Redis(config[_0x2f3a('0x1a')]));require('./mailQueue.socket')[_0x2f3a('0x1d')](socket);function respondWithStatusCode(_0x56e099,_0x12505c){_0x12505c=_0x12505c||0xcc;return function(_0x1485b2){if(_0x1485b2){return _0x56e099['sendStatus'](_0x12505c);}return _0x56e099[_0x2f3a('0x1e')](_0x12505c)[_0x2f3a('0x1f')]();};}function respondWithResult(_0x22bf3e,_0x253c90){_0x253c90=_0x253c90||0xc8;return function(_0x3c1da6){if(_0x3c1da6){return _0x22bf3e[_0x2f3a('0x1e')](_0x253c90)['json'](_0x3c1da6);}};}function respondWithFilteredResult(_0x4824ec,_0x16cd19){return function(_0x21cddd){if(_0x21cddd){var _0x3df736=_0x21cddd['count'],_0x56915b=_0x16cd19[_0x2f3a('0x20')],_0x389108=_0x16cd19[_0x2f3a('0x20')]+_0x16cd19[_0x2f3a('0x21')],_0x23be11;if(_0x389108>=_0x3df736){_0x389108=_0x3df736;_0x23be11=0xc8;}else{_0x23be11=0xce;}_0x4824ec[_0x2f3a('0x1e')](_0x23be11);return _0x4824ec[_0x2f3a('0x22')](_0x2f3a('0x23'),_0x56915b+'-'+_0x389108+'/'+_0x3df736)[_0x2f3a('0x24')](_0x21cddd);}return null;};}function patchUpdates(_0x16bc12){return function(_0x198bcd){try{jsonpatch[_0x2f3a('0x25')](_0x198bcd,_0x16bc12,!![]);}catch(_0x1f3d14){return BPromise[_0x2f3a('0x26')](_0x1f3d14);}return _0x198bcd[_0x2f3a('0x27')]();};}function saveUpdates(_0x1e4269,_0x2ca2d9){return function(_0xefb596){if(_0xefb596){return _0xefb596[_0x2f3a('0x28')](_0x1e4269)[_0x2f3a('0x29')](function(_0x480149){return _0x480149;});}return null;};}function removeEntity(_0x1b5329,_0x3e1003){return function(_0x45c55d){if(_0x45c55d){return _0x45c55d['destroy']()[_0x2f3a('0x29')](function(){var _0x47a2be=_0x45c55d['get']({'plain':!![]});var _0x19ffad='MailQueues';return db[_0x2f3a('0x2a')]['destroy']({'where':{'type':_0x19ffad,'resourceId':_0x47a2be['id']}})[_0x2f3a('0x29')](function(){return _0x45c55d;});})[_0x2f3a('0x29')](function(){_0x1b5329[_0x2f3a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a76ed,_0x1b24cd){return function(_0x566332){if(!_0x566332){_0x4a76ed[_0x2f3a('0x2b')](0x194);}return _0x566332;};}function handleError(_0x35fb3c,_0x3146a1){_0x3146a1=_0x3146a1||0x1f4;return function(_0x26ae23){logger[_0x2f3a('0x2c')](_0x26ae23[_0x2f3a('0x2d')]);if(_0x26ae23[_0x2f3a('0x2e')]){delete _0x26ae23['name'];}_0x35fb3c[_0x2f3a('0x1e')](_0x3146a1)[_0x2f3a('0x2f')](_0x26ae23);};}exports[_0x2f3a('0x30')]=function(_0x452ad0,_0x32ab41){var _0xf8074b={},_0x5c87c3={},_0x22e931={'count':0x0,'rows':[]};var _0x50ce6b=db[_0x2f3a('0x31')][_0x2f3a('0x32')];_0x5c87c3[_0x2f3a('0x33')]=_[_0x2f3a('0x34')](_0x50ce6b);_0x5c87c3[_0x2f3a('0x35')]=_[_0x2f3a('0x34')](_0x452ad0[_0x2f3a('0x35')]);_0x5c87c3[_0x2f3a('0x36')]=_[_0x2f3a('0x37')](_0x5c87c3[_0x2f3a('0x33')],_0x5c87c3['query']);_0xf8074b['attributes']=_[_0x2f3a('0x37')](_0x5c87c3[_0x2f3a('0x33')],qs[_0x2f3a('0x38')](_0x452ad0[_0x2f3a('0x35')][_0x2f3a('0x38')]));_0xf8074b[_0x2f3a('0x39')]=_0xf8074b[_0x2f3a('0x39')]['length']?_0xf8074b[_0x2f3a('0x39')]:_0x5c87c3[_0x2f3a('0x33')];if(!_0x452ad0[_0x2f3a('0x35')][_0x2f3a('0x3a')]('nolimit')){_0xf8074b['limit']=qs[_0x2f3a('0x21')](_0x452ad0[_0x2f3a('0x35')][_0x2f3a('0x21')]);_0xf8074b[_0x2f3a('0x20')]=qs['offset'](_0x452ad0[_0x2f3a('0x35')][_0x2f3a('0x20')]);}_0xf8074b[_0x2f3a('0x3b')]=qs[_0x2f3a('0x3c')](_0x452ad0[_0x2f3a('0x35')]['sort']);_0xf8074b['where']=qs[_0x2f3a('0x36')](_[_0x2f3a('0x3d')](_0x452ad0[_0x2f3a('0x35')],_0x5c87c3[_0x2f3a('0x36')]));if(_0x452ad0['query'][_0x2f3a('0x3e')]){_0xf8074b[_0x2f3a('0x3f')]=_[_0x2f3a('0x40')](_0xf8074b['where'],{'$or':_[_0x2f3a('0x41')](_0x50ce6b,function(_0x4c9460){if(_0x4c9460['type'][_0x2f3a('0x42')]!==_0x2f3a('0x43')){var _0x4a8aec={};_0x4a8aec[_0x4c9460[_0x2f3a('0x44')]]={'$like':'%'+_0x452ad0['query'][_0x2f3a('0x3e')]+'%'};return _0x4a8aec;}})});}_0xf8074b=_['merge']({},_0xf8074b,_0x452ad0['options']);var _0x193999={'where':_0xf8074b['where']};return db[_0x2f3a('0x31')]['count'](_0x193999)[_0x2f3a('0x29')](function(_0x3e9022){_0x22e931[_0x2f3a('0x45')]=_0x3e9022;if(_0x452ad0[_0x2f3a('0x35')]['includeAll']){_0xf8074b[_0x2f3a('0x46')]=[{'all':!![]}];}return db[_0x2f3a('0x31')][_0x2f3a('0x47')](_0xf8074b);})['then'](function(_0x1f8b3d){_0x22e931[_0x2f3a('0x48')]=_0x1f8b3d;return _0x22e931;})['then'](respondWithFilteredResult(_0x32ab41,_0xf8074b))[_0x2f3a('0x49')](handleError(_0x32ab41,null));};exports[_0x2f3a('0x4a')]=function(_0x1e16f6,_0x1035bd){var _0x51f5c2={'raw':!![],'where':{'id':_0x1e16f6[_0x2f3a('0x4b')]['id']}},_0x6e7a22={};_0x6e7a22[_0x2f3a('0x33')]=_[_0x2f3a('0x34')](db[_0x2f3a('0x31')][_0x2f3a('0x32')]);_0x6e7a22['query']=_[_0x2f3a('0x34')](_0x1e16f6[_0x2f3a('0x35')]);_0x6e7a22[_0x2f3a('0x36')]=_[_0x2f3a('0x37')](_0x6e7a22[_0x2f3a('0x33')],_0x6e7a22[_0x2f3a('0x35')]);_0x51f5c2[_0x2f3a('0x39')]=_['intersection'](_0x6e7a22['model'],qs['fields'](_0x1e16f6[_0x2f3a('0x35')]['fields']));_0x51f5c2[_0x2f3a('0x39')]=_0x51f5c2['attributes'][_0x2f3a('0x4c')]?_0x51f5c2[_0x2f3a('0x39')]:_0x6e7a22['model'];if(_0x1e16f6[_0x2f3a('0x35')][_0x2f3a('0x4d')]){_0x51f5c2[_0x2f3a('0x46')]=[{'all':!![]}];}_0x51f5c2=_[_0x2f3a('0x40')]({},_0x51f5c2,_0x1e16f6[_0x2f3a('0x4e')]);return db[_0x2f3a('0x31')][_0x2f3a('0x4f')](_0x51f5c2)[_0x2f3a('0x29')](handleEntityNotFound(_0x1035bd,null))[_0x2f3a('0x29')](respondWithResult(_0x1035bd,null))[_0x2f3a('0x49')](handleError(_0x1035bd,null));};exports[_0x2f3a('0x50')]=function(_0x10d869,_0x5c91f9){return db[_0x2f3a('0x31')]['create'](_0x10d869[_0x2f3a('0x51')],{})[_0x2f3a('0x29')](function(_0x41e777){var _0xb4757b=_0x10d869[_0x2f3a('0x52')][_0x2f3a('0x53')]({'plain':!![]});if(!_0xb4757b)throw new Error(_0x2f3a('0x54'));if(_0xb4757b['role']===_0x2f3a('0x52')){var _0x7473ed=_0x41e777['get']({'plain':!![]});var _0x45047b='MailQueues';return db[_0x2f3a('0x55')][_0x2f3a('0x4f')]({'where':{'name':_0x45047b,'userProfileId':_0xb4757b['userProfileId']},'raw':!![]})[_0x2f3a('0x29')](function(_0x5d7c7c){if(_0x5d7c7c&&_0x5d7c7c[_0x2f3a('0x56')]===0x0){return db[_0x2f3a('0x2a')][_0x2f3a('0x50')]({'name':_0x7473ed[_0x2f3a('0x2e')],'resourceId':_0x7473ed['id'],'type':_0x5d7c7c[_0x2f3a('0x2e')],'sectionId':_0x5d7c7c['id']},{})['then'](function(){return _0x41e777;});}else{return _0x41e777;}})[_0x2f3a('0x49')](function(_0x4921b2){logger[_0x2f3a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4921b2);throw _0x4921b2;});}return _0x41e777;})[_0x2f3a('0x29')](respondWithResult(_0x5c91f9,0xc9))[_0x2f3a('0x49')](handleError(_0x5c91f9,null));};exports[_0x2f3a('0x28')]=function(_0xee01ef,_0x2c3e34){if(_0xee01ef['body']['id']){delete _0xee01ef['body']['id'];}return db['MailQueue']['find']({'where':{'id':_0xee01ef[_0x2f3a('0x4b')]['id']}})[_0x2f3a('0x29')](handleEntityNotFound(_0x2c3e34,null))[_0x2f3a('0x29')](saveUpdates(_0xee01ef[_0x2f3a('0x51')],null))[_0x2f3a('0x29')](respondWithResult(_0x2c3e34,null))['catch'](handleError(_0x2c3e34,null));};exports[_0x2f3a('0x57')]=function(_0x4d93d8,_0x16563e){return db[_0x2f3a('0x31')][_0x2f3a('0x4f')]({'where':{'id':_0x4d93d8['params']['id']}})[_0x2f3a('0x29')](handleEntityNotFound(_0x16563e,null))['then'](removeEntity(_0x16563e,null))[_0x2f3a('0x49')](handleError(_0x16563e,null));};exports[_0x2f3a('0x58')]=function(_0x227ae9,_0x193e0c){return db[_0x2f3a('0x31')][_0x2f3a('0x58')]()['then'](respondWithResult(_0x193e0c,null))[_0x2f3a('0x49')](handleError(_0x193e0c,null));};exports[_0x2f3a('0x59')]=function(_0x344da9,_0x17425c,_0x3d5eca){var _0x3a0ca7={'raw':!![],'where':{}},_0x22ed27={},_0x4c588b;return db[_0x2f3a('0x31')][_0x2f3a('0x5a')]({'where':{'id':_0x344da9['params']['id']}})[_0x2f3a('0x29')](handleEntityNotFound(_0x17425c,null))[_0x2f3a('0x29')](function(_0x13145a){if(_0x13145a){_0x4c588b=_0x13145a[_0x2f3a('0x53')]({'plain':!![]});_0x22ed27[_0x2f3a('0x33')]=_[_0x2f3a('0x34')](db['UserMailQueue'][_0x2f3a('0x32')]);_0x22ed27['query']=_[_0x2f3a('0x34')](_0x344da9[_0x2f3a('0x35')]);_0x22ed27[_0x2f3a('0x36')]=_[_0x2f3a('0x37')](_0x22ed27[_0x2f3a('0x33')],_0x22ed27[_0x2f3a('0x35')]);_0x3a0ca7[_0x2f3a('0x39')]=_[_0x2f3a('0x37')](_0x22ed27[_0x2f3a('0x33')],qs[_0x2f3a('0x38')](_0x344da9[_0x2f3a('0x35')][_0x2f3a('0x38')]));_0x3a0ca7[_0x2f3a('0x39')]=_0x3a0ca7[_0x2f3a('0x39')][_0x2f3a('0x4c')]?_0x3a0ca7['attributes']:_0x22ed27[_0x2f3a('0x33')];if(!_0x344da9[_0x2f3a('0x35')][_0x2f3a('0x3a')](_0x2f3a('0x5b'))){_0x3a0ca7[_0x2f3a('0x21')]=qs[_0x2f3a('0x21')](_0x344da9[_0x2f3a('0x35')]['limit']);_0x3a0ca7[_0x2f3a('0x20')]=qs[_0x2f3a('0x20')](_0x344da9[_0x2f3a('0x35')][_0x2f3a('0x20')]);}_0x3a0ca7['order']=qs[_0x2f3a('0x3c')](_0x344da9[_0x2f3a('0x35')]['sort']);_0x3a0ca7['where']=qs['filters'](_['pick'](_0x344da9[_0x2f3a('0x35')],_0x22ed27[_0x2f3a('0x36')]));_0x3a0ca7[_0x2f3a('0x3f')][_0x2f3a('0x5c')]=_0x13145a['id'];if(_0x344da9[_0x2f3a('0x35')][_0x2f3a('0x3e')]){_0x3a0ca7['where']=_[_0x2f3a('0x40')](_0x3a0ca7['where'],{'$or':_[_0x2f3a('0x41')](_0x3a0ca7[_0x2f3a('0x39')],function(_0x2978af){var _0x76ec4d={};_0x76ec4d[_0x2978af]={'$like':'%'+_0x344da9[_0x2f3a('0x35')][_0x2f3a('0x3e')]+'%'};return _0x76ec4d;})});}_0x3a0ca7=_[_0x2f3a('0x40')]({},_0x3a0ca7,_0x344da9[_0x2f3a('0x4e')]);return db[_0x2f3a('0x5d')][_0x2f3a('0x47')](_0x3a0ca7);}})[_0x2f3a('0x29')](function(_0x5f0f4b){if(_0x5f0f4b){return db['User']['findAndCountAll']({'where':{'id':_[_0x2f3a('0x41')](_0x5f0f4b,'UserId'),'role':_0x2f3a('0x5e')},'attributes':['id',_0x2f3a('0x2e'),_0x2f3a('0x5f'),'updatedAt',_0x2f3a('0x60')]});}})[_0x2f3a('0x29')](function(_0x1bfe9d){if(_0x1bfe9d){return{'count':_0x1bfe9d[_0x2f3a('0x45')],'rows':_['map'](_0x1bfe9d['rows'],function(_0x57b8ae){return{'membername':_0x57b8ae[_0x2f3a('0x2e')],'UserId':_0x57b8ae['id'],'queue_name':_0x4c588b[_0x2f3a('0x2e')],'MailQueueId':_0x4c588b['id'],'interface':util[_0x2f3a('0x61')](_0x2f3a('0x62'),'SIP',_0x57b8ae[_0x2f3a('0x2e')]),'penalty':0x0,'paused':_0x57b8ae[_0x2f3a('0x5f')],'createdAt':_0x57b8ae[_0x2f3a('0x60')],'updatedAt':_0x57b8ae[_0x2f3a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2f3a('0x29')](respondWithFilteredResult(_0x17425c,_0x3a0ca7))[_0x2f3a('0x49')](handleError(_0x17425c,null));};exports[_0x2f3a('0x64')]=function(_0x258eaa,_0x537b40,_0x383eba){var _0x3e2e1d={};var _0xfbf90c={};var _0x5024bd;var _0x47f507;return db[_0x2f3a('0x31')][_0x2f3a('0x5a')]({'where':{'id':_0x258eaa[_0x2f3a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x537b40,null))[_0x2f3a('0x29')](function(_0x59c947){if(_0x59c947){_0x5024bd=_0x59c947;_0xfbf90c[_0x2f3a('0x33')]=_[_0x2f3a('0x34')](db['Team'][_0x2f3a('0x32')]);_0xfbf90c[_0x2f3a('0x35')]=_['keys'](_0x258eaa[_0x2f3a('0x35')]);_0xfbf90c['filters']=_[_0x2f3a('0x37')](_0xfbf90c[_0x2f3a('0x33')],_0xfbf90c['query']);_0x3e2e1d[_0x2f3a('0x39')]=_[_0x2f3a('0x37')](_0xfbf90c[_0x2f3a('0x33')],qs[_0x2f3a('0x38')](_0x258eaa[_0x2f3a('0x35')]['fields']));_0x3e2e1d['attributes']=_0x3e2e1d[_0x2f3a('0x39')]['length']?_0x3e2e1d[_0x2f3a('0x39')]:_0xfbf90c[_0x2f3a('0x33')];_0x3e2e1d[_0x2f3a('0x3b')]=qs['sort'](_0x258eaa[_0x2f3a('0x35')][_0x2f3a('0x3c')]);_0x3e2e1d['where']=qs[_0x2f3a('0x36')](_[_0x2f3a('0x3d')](_0x258eaa['query'],_0xfbf90c['filters']));if(_0x258eaa[_0x2f3a('0x35')]['filter']){_0x3e2e1d[_0x2f3a('0x3f')]=_['merge'](_0x3e2e1d[_0x2f3a('0x3f')],{'$or':_[_0x2f3a('0x41')](_0x3e2e1d['attributes'],function(_0x2df112){var _0x59d4cc={};_0x59d4cc[_0x2df112]={'$like':'%'+_0x258eaa[_0x2f3a('0x35')][_0x2f3a('0x3e')]+'%'};return _0x59d4cc;})});}_0x3e2e1d=_[_0x2f3a('0x40')]({},_0x3e2e1d,_0x258eaa['options']);return _0x5024bd[_0x2f3a('0x64')](_0x3e2e1d);}})[_0x2f3a('0x29')](function(_0x50f54f){if(_0x50f54f){_0x47f507=_0x50f54f[_0x2f3a('0x4c')];if(!_0x258eaa[_0x2f3a('0x35')]['hasOwnProperty']('nolimit')){_0x3e2e1d['limit']=qs[_0x2f3a('0x21')](_0x258eaa[_0x2f3a('0x35')][_0x2f3a('0x21')]);_0x3e2e1d['offset']=qs[_0x2f3a('0x20')](_0x258eaa['query'][_0x2f3a('0x20')]);}return _0x5024bd[_0x2f3a('0x64')](_0x3e2e1d);}})[_0x2f3a('0x29')](function(_0x51d3ae){if(_0x51d3ae){return _0x51d3ae?{'count':_0x47f507,'rows':_0x51d3ae}:null;}})[_0x2f3a('0x29')](respondWithResult(_0x537b40,null))['catch'](handleError(_0x537b40,null));};exports[_0x2f3a('0x65')]=function(_0x5421ea,_0x5ed384,_0x53cdd3){var _0x52dc0f=_0x5421ea[_0x2f3a('0x51')][_0x2f3a('0x66')];return db[_0x2f3a('0x67')][_0x2f3a('0x47')]({'where':{'id':_[_0x2f3a('0x41')](_0x52dc0f,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x2f3a('0x68'),'voicePause',_0x2f3a('0x69')],'raw':!![]}]})[_0x2f3a('0x29')](function(_0x1a37b3){if(_0x1a37b3){var _0x590476=_[_0x2f3a('0x6a')](_0x1a37b3,function(_0x43ef1a){var _0x30e569=_0x43ef1a[_0x2f3a('0x53')]({'plain':!![]});return _0x30e569[_0x2f3a('0x6b')];});return db[_0x2f3a('0x31')][_0x2f3a('0x4f')]({'where':{'id':_0x5421ea[_0x2f3a('0x4b')]['id']}})[_0x2f3a('0x29')](function(_0x5d7801){return db[_0x2f3a('0x6c')][_0x2f3a('0x6d')](function(_0x13d757){return _0x5d7801[_0x2f3a('0x65')](_[_0x2f3a('0x41')](_0x52dc0f,'id'),{'transaction':_0x13d757})[_0x2f3a('0x29')](function(){return BPromise[_0x2f3a('0x6e')](_0x590476,function(_0x3e16d0){return db[_0x2f3a('0x5d')][_0x2f3a('0x6f')]({'where':{'UserId':_0x3e16d0['id'],'MailQueueId':_0x5421ea['params']['id']},'transaction':_0x13d757});});})[_0x2f3a('0x29')](function(){_0x590476[_0x2f3a('0x70')](function(_0x3e1c0f){socket[_0x2f3a('0x71')](_0x2f3a('0x72'),{'UserId':_0x3e1c0f['id'],'MailQueueId':_0x5d7801['id']});});});});});}})['then'](respondWithStatusCode(_0x5ed384,null))['catch'](handleError(_0x5ed384,null));};exports[_0x2f3a('0x73')]=function(_0x189d1c,_0x30912c,_0x54072d){return db[_0x2f3a('0x67')][_0x2f3a('0x47')]({'where':{'id':_0x189d1c[_0x2f3a('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x2f3a('0x74')],'as':_0x2f3a('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x30912c,null))[_0x2f3a('0x29')](function(_0x4cf609){var _0x342681=_['map'](_0x4cf609,'id');var _0x39068f=[];var _0x185529=[];var _0x3c2156=squel['select']();_0x3c2156[_0x2f3a('0x44')](_0x2f3a('0x75'))[_0x2f3a('0x76')]('team_has_mail_queues','tq')[_0x2f3a('0x77')](_0x2f3a('0x78'),'ut',_0x2f3a('0x79'))[_0x2f3a('0x3f')](_0x2f3a('0x7a'),_0x189d1c[_0x2f3a('0x4b')]['id']);for(var _0x3984d1=0x0;_0x3984d1<_0x4cf609['length'];_0x3984d1+=0x1){let _0x3b48d5=_0x4cf609[_0x3984d1];for(var _0x385449=0x0;_0x385449<_0x3b48d5[_0x2f3a('0x6b')][_0x2f3a('0x4c')];_0x385449+=0x1){let _0x53bb64=_0x3b48d5[_0x2f3a('0x6b')][_0x385449];var _0x9915bd=_0x3c2156[_0x2f3a('0x7b')]();_0x9915bd[_0x2f3a('0x3f')]('ut.UserId\x20=\x20?',_0x53bb64['id']);_0x185529['push'](db[_0x2f3a('0x6c')][_0x2f3a('0x35')](_0x9915bd[_0x2f3a('0x7c')](),{'type':db[_0x2f3a('0x6c')]['QueryTypes'][_0x2f3a('0x7d')]})[_0x2f3a('0x29')](function(_0x414cea){if(_0x414cea[_0x2f3a('0x4c')]===0x1){return _0x53bb64['id'];}else{var _0x4e5042=_[_0x2f3a('0x7e')](_[_0x2f3a('0x41')](_0x414cea,_0x2f3a('0x7f')),function(_0xbdb8c3){return _[_0x2f3a('0x80')](_0x342681,_0xbdb8c3);});if(_0x4e5042){return _0x53bb64['id'];}}}));}}return BPromise['all'](_0x185529)[_0x2f3a('0x29')](function(_0x223a31){_0x39068f=_(_0x39068f)['union'](_0x223a31)[_0x2f3a('0x81')]()[_0x2f3a('0x82')]();return db['MailQueue'][_0x2f3a('0x4f')]({'where':{'id':_0x189d1c[_0x2f3a('0x4b')]['id']}})[_0x2f3a('0x29')](function(_0x3f1857){return db[_0x2f3a('0x6c')][_0x2f3a('0x6d')](function(_0x51a48d){return _0x3f1857[_0x2f3a('0x73')](_0x189d1c['query'][_0x2f3a('0x83')],{'transaction':_0x51a48d})['then'](function(){if(!_[_0x2f3a('0x84')](_0x39068f)){return _0x3f1857[_0x2f3a('0x85')](_0x39068f,{'transaction':_0x51a48d});}})[_0x2f3a('0x29')](function(){_0x39068f[_0x2f3a('0x70')](function(_0xa90c25){socket['emit'](_0x2f3a('0x86'),{'UserId':_0xa90c25,'MailQueueId':_0x3f1857['id']});});});});});});})[_0x2f3a('0x29')](respondWithStatusCode(_0x30912c,null))[_0x2f3a('0x49')](handleError(_0x30912c,null));};exports[_0x2f3a('0x87')]=function(_0x57d26f,_0x2757c2,_0x65e1c0){return db[_0x2f3a('0x31')][_0x2f3a('0x4f')]({'where':{'id':_0x57d26f[_0x2f3a('0x4b')]['id']}})[_0x2f3a('0x29')](handleEntityNotFound(_0x2757c2,null))['then'](function(_0x106218){if(_0x106218){return _0x106218[_0x2f3a('0x87')](_0x57d26f[_0x2f3a('0x51')][_0x2f3a('0x83')],_['omit'](_0x57d26f['body'],[_0x2f3a('0x83'),'id'])||{})['spread'](function(_0x2d4461){for(var _0x4f28f4=0x0;_0x4f28f4<_0x57d26f[_0x2f3a('0x51')][_0x2f3a('0x83')][_0x2f3a('0x4c')];_0x4f28f4+=0x1){socket[_0x2f3a('0x71')](_0x2f3a('0x72'),{'UserId':_0x57d26f[_0x2f3a('0x51')][_0x2f3a('0x83')][_0x4f28f4],'MailQueueId':_0x57d26f['params']['id']});}return _0x2d4461;});}})[_0x2f3a('0x29')](respondWithResult(_0x2757c2,null))['catch'](handleError(_0x2757c2,null));};exports[_0x2f3a('0x85')]=function(_0x57f453,_0x46e721,_0x2393a0){return db['MailQueue']['find']({'where':{'id':_0x57f453[_0x2f3a('0x4b')]['id']}})[_0x2f3a('0x29')](handleEntityNotFound(_0x46e721,null))[_0x2f3a('0x29')](function(_0x18b4e2){if(_0x18b4e2){return _0x18b4e2[_0x2f3a('0x85')](_0x57f453[_0x2f3a('0x35')]['ids'])[_0x2f3a('0x29')](function(){if(_[_0x2f3a('0x88')](_0x57f453[_0x2f3a('0x35')][_0x2f3a('0x83')])){for(var _0x282ae0=0x0;_0x282ae0<_0x57f453[_0x2f3a('0x35')][_0x2f3a('0x83')]['length'];_0x282ae0+=0x1){socket[_0x2f3a('0x71')](_0x2f3a('0x86'),{'UserId':Number(_0x57f453['query']['ids'][_0x282ae0]),'MailQueueId':Number(_0x57f453[_0x2f3a('0x4b')]['id'])});}}else{socket[_0x2f3a('0x71')](_0x2f3a('0x86'),{'UserId':Number(_0x57f453['query'][_0x2f3a('0x83')]),'MailQueueId':Number(_0x57f453['params']['id'])});}});}})[_0x2f3a('0x29')](respondWithStatusCode(_0x46e721,null))[_0x2f3a('0x49')](handleError(_0x46e721,null));};exports[_0x2f3a('0x89')]=function(_0x278a2c,_0x4189a9,_0x3e9d04){var _0xad525f={};var _0x4dfe45={};var _0x3e26f3;var _0x129a69;return db[_0x2f3a('0x31')][_0x2f3a('0x5a')]({'where':{'id':_0x278a2c['params']['id']}})[_0x2f3a('0x29')](handleEntityNotFound(_0x4189a9,null))['then'](function(_0x5b5c9c){if(_0x5b5c9c){_0x3e26f3=_0x5b5c9c;_0x4dfe45['model']=_[_0x2f3a('0x34')](db[_0x2f3a('0x74')]['rawAttributes']);_0x4dfe45['query']=_[_0x2f3a('0x34')](_0x278a2c[_0x2f3a('0x35')]);_0x4dfe45['filters']=_[_0x2f3a('0x37')](_0x4dfe45[_0x2f3a('0x33')],_0x4dfe45[_0x2f3a('0x35')]);_0xad525f[_0x2f3a('0x39')]=_[_0x2f3a('0x37')](_0x4dfe45[_0x2f3a('0x33')],qs[_0x2f3a('0x38')](_0x278a2c['query']['fields']));_0xad525f['attributes']=_0xad525f[_0x2f3a('0x39')][_0x2f3a('0x4c')]?_0xad525f[_0x2f3a('0x39')]:_0x4dfe45[_0x2f3a('0x33')];_0xad525f[_0x2f3a('0x3b')]=qs['sort'](_0x278a2c['query'][_0x2f3a('0x3c')]);_0xad525f[_0x2f3a('0x3f')]=qs[_0x2f3a('0x36')](_[_0x2f3a('0x3d')](_0x278a2c[_0x2f3a('0x35')],_0x4dfe45['filters']));if(_0x278a2c[_0x2f3a('0x35')][_0x2f3a('0x3e')]){_0xad525f[_0x2f3a('0x3f')]=_[_0x2f3a('0x40')](_0xad525f[_0x2f3a('0x3f')],{'$or':_[_0x2f3a('0x41')](_0xad525f['attributes'],function(_0x3e3eea){var _0x1307f4={};_0x1307f4[_0x3e3eea]={'$like':'%'+_0x278a2c[_0x2f3a('0x35')]['filter']+'%'};return _0x1307f4;})});}_0xad525f=_[_0x2f3a('0x40')]({},_0xad525f,_0x278a2c[_0x2f3a('0x4e')]);return _0x3e26f3[_0x2f3a('0x89')](_0xad525f);}})[_0x2f3a('0x29')](function(_0x5d82ed){if(_0x5d82ed){_0x129a69=_0x5d82ed[_0x2f3a('0x4c')];if(!_0x278a2c[_0x2f3a('0x35')]['hasOwnProperty'](_0x2f3a('0x5b'))){_0xad525f[_0x2f3a('0x21')]=qs[_0x2f3a('0x21')](_0x278a2c[_0x2f3a('0x35')][_0x2f3a('0x21')]);_0xad525f[_0x2f3a('0x20')]=qs['offset'](_0x278a2c[_0x2f3a('0x35')][_0x2f3a('0x20')]);}return _0x3e26f3['getAgents'](_0xad525f);}})[_0x2f3a('0x29')](function(_0x1b729e){if(_0x1b729e){return _0x1b729e?{'count':_0x129a69,'rows':_0x1b729e}:null;}})[_0x2f3a('0x29')](respondWithResult(_0x4189a9,null))[_0x2f3a('0x49')](handleError(_0x4189a9,null));}; \ No newline at end of file +var _0x1248=['status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','MailQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','options','count','include','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','order','pick','MailQueueId','UserMailQueue','findAll','User','UserId','mailPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','Team','Agents','online','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','ids','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','register'];(function(_0x584c28,_0x2e9d14){var _0x3b0810=function(_0xce6920){while(--_0xce6920){_0x584c28['push'](_0x584c28['shift']());}};_0x3b0810(++_0x2e9d14);}(_0x1248,0x180));var _0x8124=function(_0x200d3e,_0x592a2b){_0x200d3e=_0x200d3e-0x0;var _0x196fab=_0x1248[_0x200d3e];return _0x196fab;};'use strict';var pdf=require(_0x8124('0x0'));var emlformat=require(_0x8124('0x1'));var rimraf=require(_0x8124('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8124('0x3'));var rp=require(_0x8124('0x4'));var moment=require(_0x8124('0x5'));var BPromise=require(_0x8124('0x6'));var Mustache=require('mustache');var util=require(_0x8124('0x7'));var path=require('path');var sox=require(_0x8124('0x8'));var csv=require(_0x8124('0x9'));var ejs=require(_0x8124('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8124('0xb'));var jsforce=require(_0x8124('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8124('0x9'));var querystring=require(_0x8124('0xd'));var Papa=require(_0x8124('0xe'));var Redis=require(_0x8124('0xf'));var authService=require(_0x8124('0x10'));var qs=require(_0x8124('0x11'));var hardwareService=require(_0x8124('0x12'));var logger=require('../../config/logger')(_0x8124('0x13'));var utils=require('../../config/utils');var config=require(_0x8124('0x14'));var db=require(_0x8124('0x15'))['db'];config[_0x8124('0x16')]=_[_0x8124('0x17')](config[_0x8124('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x8124('0x18'))(new Redis(config['redis']));require(_0x8124('0x19'))[_0x8124('0x1a')](socket);function respondWithStatusCode(_0x34541f,_0x45f42e){_0x45f42e=_0x45f42e||0xcc;return function(_0x5da3c7){if(_0x5da3c7){return _0x34541f['sendStatus'](_0x45f42e);}return _0x34541f[_0x8124('0x1b')](_0x45f42e)[_0x8124('0x1c')]();};}function respondWithResult(_0x1f4f27,_0x3d1d7d){_0x3d1d7d=_0x3d1d7d||0xc8;return function(_0x252272){if(_0x252272){return _0x1f4f27['status'](_0x3d1d7d)[_0x8124('0x1d')](_0x252272);}};}function respondWithFilteredResult(_0xaf1a20,_0x39059c){return function(_0x18412c){if(_0x18412c){var _0xab3c19=_0x18412c['count'],_0x1bf2b4=_0x39059c['offset'],_0x2417f9=_0x39059c[_0x8124('0x1e')]+_0x39059c[_0x8124('0x1f')],_0x45e205;if(_0x2417f9>=_0xab3c19){_0x2417f9=_0xab3c19;_0x45e205=0xc8;}else{_0x45e205=0xce;}_0xaf1a20[_0x8124('0x1b')](_0x45e205);return _0xaf1a20['set'](_0x8124('0x20'),_0x1bf2b4+'-'+_0x2417f9+'/'+_0xab3c19)[_0x8124('0x1d')](_0x18412c);}return null;};}function patchUpdates(_0x1b8cb8){return function(_0x170ae6){try{jsonpatch[_0x8124('0x21')](_0x170ae6,_0x1b8cb8,!![]);}catch(_0x12b973){return BPromise[_0x8124('0x22')](_0x12b973);}return _0x170ae6[_0x8124('0x23')]();};}function saveUpdates(_0x219780,_0x3d424d){return function(_0x1f792a){if(_0x1f792a){return _0x1f792a[_0x8124('0x24')](_0x219780)['then'](function(_0x1e942a){return _0x1e942a;});}return null;};}function removeEntity(_0xa119e7,_0x192b89){return function(_0x493d69){if(_0x493d69){return _0x493d69[_0x8124('0x25')]()[_0x8124('0x26')](function(){var _0x3f1a40=_0x493d69[_0x8124('0x27')]({'plain':!![]});var _0x3e857b='MailQueues';return db[_0x8124('0x28')]['destroy']({'where':{'type':_0x3e857b,'resourceId':_0x3f1a40['id']}})[_0x8124('0x26')](function(){return _0x493d69;});})['then'](function(){_0xa119e7[_0x8124('0x1b')](0xcc)[_0x8124('0x1c')]();});}};}function handleEntityNotFound(_0x475352,_0x3962d2){return function(_0x285b30){if(!_0x285b30){_0x475352[_0x8124('0x29')](0x194);}return _0x285b30;};}function handleError(_0x903548,_0x2ebdf2){_0x2ebdf2=_0x2ebdf2||0x1f4;return function(_0x2115ef){logger[_0x8124('0x2a')](_0x2115ef[_0x8124('0x2b')]);if(_0x2115ef[_0x8124('0x2c')]){delete _0x2115ef['name'];}_0x903548[_0x8124('0x1b')](_0x2ebdf2)['send'](_0x2115ef);};}exports['index']=function(_0xb59085,_0x4f87fc){var _0x52238b={},_0x4824f2={},_0x1be16b={'count':0x0,'rows':[]};var _0xdfbd45=db[_0x8124('0x2d')][_0x8124('0x2e')];_0x4824f2[_0x8124('0x2f')]=_[_0x8124('0x30')](_0xdfbd45);_0x4824f2['query']=_[_0x8124('0x30')](_0xb59085[_0x8124('0x31')]);_0x4824f2[_0x8124('0x32')]=_[_0x8124('0x33')](_0x4824f2[_0x8124('0x2f')],_0x4824f2[_0x8124('0x31')]);_0x52238b[_0x8124('0x34')]=_[_0x8124('0x33')](_0x4824f2[_0x8124('0x2f')],qs['fields'](_0xb59085['query'][_0x8124('0x35')]));_0x52238b['attributes']=_0x52238b[_0x8124('0x34')][_0x8124('0x36')]?_0x52238b[_0x8124('0x34')]:_0x4824f2[_0x8124('0x2f')];if(!_0xb59085[_0x8124('0x31')][_0x8124('0x37')](_0x8124('0x38'))){_0x52238b['limit']=qs['limit'](_0xb59085[_0x8124('0x31')][_0x8124('0x1f')]);_0x52238b[_0x8124('0x1e')]=qs[_0x8124('0x1e')](_0xb59085['query'][_0x8124('0x1e')]);}_0x52238b['order']=qs[_0x8124('0x39')](_0xb59085['query'][_0x8124('0x39')]);_0x52238b[_0x8124('0x3a')]=qs['filters'](_['pick'](_0xb59085[_0x8124('0x31')],_0x4824f2[_0x8124('0x32')]));if(_0xb59085['query'][_0x8124('0x3b')]){_0x52238b['where']=_[_0x8124('0x3c')](_0x52238b[_0x8124('0x3a')],{'$or':_[_0x8124('0x3d')](_0xdfbd45,function(_0x177b62){if(_0x177b62[_0x8124('0x3e')][_0x8124('0x3f')]!=='VIRTUAL'){var _0x26129f={};_0x26129f[_0x177b62['field']]={'$like':'%'+_0xb59085['query'][_0x8124('0x3b')]+'%'};return _0x26129f;}})});}_0x52238b=_[_0x8124('0x3c')]({},_0x52238b,_0xb59085[_0x8124('0x40')]);var _0x4748b7={'where':_0x52238b['where']};return db[_0x8124('0x2d')]['count'](_0x4748b7)[_0x8124('0x26')](function(_0x529072){_0x1be16b[_0x8124('0x41')]=_0x529072;if(_0xb59085[_0x8124('0x31')]['includeAll']){_0x52238b[_0x8124('0x42')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x52238b);})[_0x8124('0x26')](function(_0x52c5fa){_0x1be16b['rows']=_0x52c5fa;return _0x1be16b;})[_0x8124('0x26')](respondWithFilteredResult(_0x4f87fc,_0x52238b))[_0x8124('0x43')](handleError(_0x4f87fc,null));};exports[_0x8124('0x44')]=function(_0x5ce646,_0x355caf){var _0x2749c3={'raw':!![],'where':{'id':_0x5ce646[_0x8124('0x45')]['id']}},_0x557c1c={};_0x557c1c[_0x8124('0x2f')]=_[_0x8124('0x30')](db[_0x8124('0x2d')][_0x8124('0x2e')]);_0x557c1c[_0x8124('0x31')]=_[_0x8124('0x30')](_0x5ce646[_0x8124('0x31')]);_0x557c1c['filters']=_[_0x8124('0x33')](_0x557c1c['model'],_0x557c1c[_0x8124('0x31')]);_0x2749c3[_0x8124('0x34')]=_['intersection'](_0x557c1c[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x5ce646[_0x8124('0x31')]['fields']));_0x2749c3[_0x8124('0x34')]=_0x2749c3[_0x8124('0x34')][_0x8124('0x36')]?_0x2749c3[_0x8124('0x34')]:_0x557c1c['model'];if(_0x5ce646[_0x8124('0x31')][_0x8124('0x46')]){_0x2749c3[_0x8124('0x42')]=[{'all':!![]}];}_0x2749c3=_[_0x8124('0x3c')]({},_0x2749c3,_0x5ce646[_0x8124('0x40')]);return db[_0x8124('0x2d')][_0x8124('0x47')](_0x2749c3)[_0x8124('0x26')](handleEntityNotFound(_0x355caf,null))[_0x8124('0x26')](respondWithResult(_0x355caf,null))[_0x8124('0x43')](handleError(_0x355caf,null));};exports[_0x8124('0x48')]=function(_0xfda0e5,_0x2173f6){return db['MailQueue'][_0x8124('0x48')](_0xfda0e5['body'],{})[_0x8124('0x26')](function(_0x23f1ec){var _0x3dde61=_0xfda0e5[_0x8124('0x49')]['get']({'plain':!![]});if(!_0x3dde61)throw new Error(_0x8124('0x4a'));if(_0x3dde61[_0x8124('0x4b')]===_0x8124('0x49')){var _0x187d81=_0x23f1ec['get']({'plain':!![]});var _0x2fc764=_0x8124('0x4c');return db[_0x8124('0x4d')][_0x8124('0x47')]({'where':{'name':_0x2fc764,'userProfileId':_0x3dde61[_0x8124('0x4e')]},'raw':!![]})[_0x8124('0x26')](function(_0x53a746){if(_0x53a746&&_0x53a746[_0x8124('0x4f')]===0x0){return db[_0x8124('0x28')]['create']({'name':_0x187d81[_0x8124('0x2c')],'resourceId':_0x187d81['id'],'type':_0x53a746[_0x8124('0x2c')],'sectionId':_0x53a746['id']},{})[_0x8124('0x26')](function(){return _0x23f1ec;});}else{return _0x23f1ec;}})[_0x8124('0x43')](function(_0x4256de){logger[_0x8124('0x2a')](_0x8124('0x50'),_0x4256de);throw _0x4256de;});}return _0x23f1ec;})[_0x8124('0x26')](respondWithResult(_0x2173f6,0xc9))[_0x8124('0x43')](handleError(_0x2173f6,null));};exports[_0x8124('0x24')]=function(_0x399381,_0x401c84){if(_0x399381[_0x8124('0x51')]['id']){delete _0x399381[_0x8124('0x51')]['id'];}return db[_0x8124('0x2d')][_0x8124('0x47')]({'where':{'id':_0x399381['params']['id']}})['then'](handleEntityNotFound(_0x401c84,null))[_0x8124('0x26')](saveUpdates(_0x399381['body'],null))[_0x8124('0x26')](respondWithResult(_0x401c84,null))[_0x8124('0x43')](handleError(_0x401c84,null));};exports[_0x8124('0x25')]=function(_0x1ac2f3,_0x1cacf5){return db[_0x8124('0x2d')][_0x8124('0x47')]({'where':{'id':_0x1ac2f3[_0x8124('0x45')]['id']}})['then'](handleEntityNotFound(_0x1cacf5,null))['then'](removeEntity(_0x1cacf5,null))['catch'](handleError(_0x1cacf5,null));};exports[_0x8124('0x52')]=function(_0x530fc5,_0x2c9b42){return db[_0x8124('0x2d')]['describe']()[_0x8124('0x26')](respondWithResult(_0x2c9b42,null))[_0x8124('0x43')](handleError(_0x2c9b42,null));};exports[_0x8124('0x53')]=function(_0x4c25b5,_0xfb4a12,_0x51f058){var _0x52a361={'raw':!![],'where':{}},_0x355796={},_0x15672c;return db[_0x8124('0x2d')]['findOne']({'where':{'id':_0x4c25b5[_0x8124('0x45')]['id']}})[_0x8124('0x26')](handleEntityNotFound(_0xfb4a12,null))[_0x8124('0x26')](function(_0x200c6c){if(_0x200c6c){_0x15672c=_0x200c6c[_0x8124('0x27')]({'plain':!![]});_0x355796[_0x8124('0x2f')]=_['keys'](db['UserMailQueue']['rawAttributes']);_0x355796[_0x8124('0x31')]=_[_0x8124('0x30')](_0x4c25b5[_0x8124('0x31')]);_0x355796[_0x8124('0x32')]=_[_0x8124('0x33')](_0x355796[_0x8124('0x2f')],_0x355796[_0x8124('0x31')]);_0x52a361[_0x8124('0x34')]=_[_0x8124('0x33')](_0x355796[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x4c25b5[_0x8124('0x31')][_0x8124('0x35')]));_0x52a361[_0x8124('0x34')]=_0x52a361[_0x8124('0x34')][_0x8124('0x36')]?_0x52a361['attributes']:_0x355796[_0x8124('0x2f')];if(!_0x4c25b5[_0x8124('0x31')][_0x8124('0x37')](_0x8124('0x38'))){_0x52a361[_0x8124('0x1f')]=qs[_0x8124('0x1f')](_0x4c25b5[_0x8124('0x31')][_0x8124('0x1f')]);_0x52a361[_0x8124('0x1e')]=qs['offset'](_0x4c25b5['query']['offset']);}_0x52a361[_0x8124('0x54')]=qs[_0x8124('0x39')](_0x4c25b5['query'][_0x8124('0x39')]);_0x52a361[_0x8124('0x3a')]=qs['filters'](_[_0x8124('0x55')](_0x4c25b5[_0x8124('0x31')],_0x355796[_0x8124('0x32')]));_0x52a361[_0x8124('0x3a')][_0x8124('0x56')]=_0x200c6c['id'];if(_0x4c25b5['query']['filter']){_0x52a361[_0x8124('0x3a')]=_[_0x8124('0x3c')](_0x52a361['where'],{'$or':_[_0x8124('0x3d')](_0x52a361['attributes'],function(_0x4fd232){var _0x3d2df9={};_0x3d2df9[_0x4fd232]={'$like':'%'+_0x4c25b5[_0x8124('0x31')][_0x8124('0x3b')]+'%'};return _0x3d2df9;})});}_0x52a361=_['merge']({},_0x52a361,_0x4c25b5['options']);return db[_0x8124('0x57')][_0x8124('0x58')](_0x52a361);}})['then'](function(_0x401537){if(_0x401537){return db[_0x8124('0x59')]['findAndCountAll']({'where':{'id':_['map'](_0x401537,_0x8124('0x5a')),'role':'agent'},'attributes':['id',_0x8124('0x2c'),_0x8124('0x5b'),_0x8124('0x5c'),_0x8124('0x5d')]});}})[_0x8124('0x26')](function(_0x1e55a9){if(_0x1e55a9){return{'count':_0x1e55a9[_0x8124('0x41')],'rows':_[_0x8124('0x3d')](_0x1e55a9[_0x8124('0x5e')],function(_0x652afb){return{'membername':_0x652afb[_0x8124('0x2c')],'UserId':_0x652afb['id'],'queue_name':_0x15672c[_0x8124('0x2c')],'MailQueueId':_0x15672c['id'],'interface':util[_0x8124('0x5f')](_0x8124('0x60'),_0x8124('0x61'),_0x652afb[_0x8124('0x2c')]),'penalty':0x0,'paused':_0x652afb[_0x8124('0x5b')],'createdAt':_0x652afb[_0x8124('0x5d')],'updatedAt':_0x652afb[_0x8124('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8124('0x26')](respondWithFilteredResult(_0xfb4a12,_0x52a361))[_0x8124('0x43')](handleError(_0xfb4a12,null));};exports[_0x8124('0x62')]=function(_0x2b6068,_0x574f12,_0x335aff){var _0x4146ff={};var _0x3c330c={};var _0x5bf56b;var _0x3a114b;return db[_0x8124('0x2d')][_0x8124('0x63')]({'where':{'id':_0x2b6068['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x574f12,null))['then'](function(_0x3229eb){if(_0x3229eb){_0x5bf56b=_0x3229eb;_0x3c330c[_0x8124('0x2f')]=_[_0x8124('0x30')](db[_0x8124('0x64')][_0x8124('0x2e')]);_0x3c330c[_0x8124('0x31')]=_[_0x8124('0x30')](_0x2b6068['query']);_0x3c330c[_0x8124('0x32')]=_[_0x8124('0x33')](_0x3c330c[_0x8124('0x2f')],_0x3c330c[_0x8124('0x31')]);_0x4146ff['attributes']=_[_0x8124('0x33')](_0x3c330c[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x2b6068[_0x8124('0x31')][_0x8124('0x35')]));_0x4146ff['attributes']=_0x4146ff[_0x8124('0x34')][_0x8124('0x36')]?_0x4146ff[_0x8124('0x34')]:_0x3c330c[_0x8124('0x2f')];_0x4146ff[_0x8124('0x54')]=qs[_0x8124('0x39')](_0x2b6068['query'][_0x8124('0x39')]);_0x4146ff['where']=qs['filters'](_[_0x8124('0x55')](_0x2b6068[_0x8124('0x31')],_0x3c330c['filters']));if(_0x2b6068[_0x8124('0x31')][_0x8124('0x3b')]){_0x4146ff[_0x8124('0x3a')]=_['merge'](_0x4146ff['where'],{'$or':_[_0x8124('0x3d')](_0x4146ff[_0x8124('0x34')],function(_0x1fe4db){var _0x306dc1={};_0x306dc1[_0x1fe4db]={'$like':'%'+_0x2b6068[_0x8124('0x31')][_0x8124('0x3b')]+'%'};return _0x306dc1;})});}_0x4146ff=_[_0x8124('0x3c')]({},_0x4146ff,_0x2b6068[_0x8124('0x40')]);return _0x5bf56b['getTeams'](_0x4146ff);}})[_0x8124('0x26')](function(_0x4ca50a){if(_0x4ca50a){_0x3a114b=_0x4ca50a[_0x8124('0x36')];if(!_0x2b6068['query'][_0x8124('0x37')](_0x8124('0x38'))){_0x4146ff[_0x8124('0x1f')]=qs[_0x8124('0x1f')](_0x2b6068[_0x8124('0x31')][_0x8124('0x1f')]);_0x4146ff[_0x8124('0x1e')]=qs[_0x8124('0x1e')](_0x2b6068[_0x8124('0x31')]['offset']);}return _0x5bf56b[_0x8124('0x62')](_0x4146ff);}})[_0x8124('0x26')](function(_0x4a7370){if(_0x4a7370){return _0x4a7370?{'count':_0x3a114b,'rows':_0x4a7370}:null;}})[_0x8124('0x26')](respondWithResult(_0x574f12,null))[_0x8124('0x43')](handleError(_0x574f12,null));};exports['addTeams']=function(_0x568273,_0xcf93e3,_0x382d03){var _0x1e9af5=_0x568273[_0x8124('0x51')]['teams'];return db[_0x8124('0x64')][_0x8124('0x58')]({'where':{'id':_[_0x8124('0x3d')](_0x1e9af5,'id')},'attributes':['id'],'include':[{'model':db[_0x8124('0x59')],'as':_0x8124('0x65'),'attributes':['id',_0x8124('0x2c'),_0x8124('0x66'),'voicePause',_0x8124('0x67')],'raw':!![]}]})['then'](function(_0x4b3962){if(_0x4b3962){var _0xeef4f0=_[_0x8124('0x68')](_0x4b3962,function(_0x453da2){var _0x251588=_0x453da2[_0x8124('0x27')]({'plain':!![]});return _0x251588[_0x8124('0x65')];});return db['MailQueue'][_0x8124('0x47')]({'where':{'id':_0x568273[_0x8124('0x45')]['id']}})[_0x8124('0x26')](function(_0x5e3c20){return db['sequelize'][_0x8124('0x69')](function(_0x562e67){return _0x5e3c20[_0x8124('0x6a')](_[_0x8124('0x3d')](_0x1e9af5,'id'),{'transaction':_0x562e67})[_0x8124('0x26')](function(){return BPromise[_0x8124('0x6b')](_0xeef4f0,function(_0x4ad129){return db[_0x8124('0x57')][_0x8124('0x6c')]({'where':{'UserId':_0x4ad129['id'],'MailQueueId':_0x568273[_0x8124('0x45')]['id']},'transaction':_0x562e67});});})[_0x8124('0x26')](function(){_0xeef4f0[_0x8124('0x6d')](function(_0x5246e1){socket[_0x8124('0x6e')](_0x8124('0x6f'),{'UserId':_0x5246e1['id'],'MailQueueId':_0x5e3c20['id']});});});});});}})[_0x8124('0x26')](respondWithStatusCode(_0xcf93e3,null))[_0x8124('0x43')](handleError(_0xcf93e3,null));};exports[_0x8124('0x70')]=function(_0x1ca19f,_0x505194,_0xf995c9){return db[_0x8124('0x64')][_0x8124('0x58')]({'where':{'id':_0x1ca19f[_0x8124('0x31')][_0x8124('0x71')]},'attributes':['id'],'include':[{'model':db[_0x8124('0x59')],'as':_0x8124('0x65'),'attributes':['id'],'raw':!![]}]})[_0x8124('0x26')](handleEntityNotFound(_0x505194,null))[_0x8124('0x26')](function(_0x50fcbf){var _0x2009e7=_[_0x8124('0x3d')](_0x50fcbf,'id');var _0x1ca7bc=[];var _0x35d385=[];var _0x7d8160=squel[_0x8124('0x72')]();_0x7d8160['field'](_0x8124('0x73'))[_0x8124('0x74')]('team_has_mail_queues','tq')[_0x8124('0x75')]('user_has_teams','ut',_0x8124('0x76'))[_0x8124('0x3a')](_0x8124('0x77'),_0x1ca19f['params']['id']);for(var _0x30fa79=0x0;_0x30fa79<_0x50fcbf[_0x8124('0x36')];_0x30fa79+=0x1){let _0x539d51=_0x50fcbf[_0x30fa79];for(var _0x582fe3=0x0;_0x582fe3<_0x539d51['Agents'][_0x8124('0x36')];_0x582fe3+=0x1){let _0x416f34=_0x539d51[_0x8124('0x65')][_0x582fe3];var _0x27525b=_0x7d8160['clone']();_0x27525b[_0x8124('0x3a')](_0x8124('0x78'),_0x416f34['id']);_0x35d385[_0x8124('0x79')](db['sequelize'][_0x8124('0x31')](_0x27525b['toString'](),{'type':db['sequelize'][_0x8124('0x7a')][_0x8124('0x7b')]})[_0x8124('0x26')](function(_0x282995){if(_0x282995[_0x8124('0x36')]===0x1){return _0x416f34['id'];}else{var _0x23c4f6=_[_0x8124('0x7c')](_[_0x8124('0x3d')](_0x282995,'TeamId'),function(_0x51b52b){return _[_0x8124('0x7d')](_0x2009e7,_0x51b52b);});if(_0x23c4f6){return _0x416f34['id'];}}}));}}return BPromise[_0x8124('0x7e')](_0x35d385)[_0x8124('0x26')](function(_0x4d7e43){_0x1ca7bc=_(_0x1ca7bc)[_0x8124('0x7f')](_0x4d7e43)[_0x8124('0x80')]()[_0x8124('0x81')]();return db[_0x8124('0x2d')][_0x8124('0x47')]({'where':{'id':_0x1ca19f[_0x8124('0x45')]['id']}})[_0x8124('0x26')](function(_0x2a1e6a){return db['sequelize']['transaction'](function(_0x45ffe7){return _0x2a1e6a[_0x8124('0x70')](_0x1ca19f['query'][_0x8124('0x71')],{'transaction':_0x45ffe7})[_0x8124('0x26')](function(){if(!_[_0x8124('0x82')](_0x1ca7bc)){return _0x2a1e6a[_0x8124('0x83')](_0x1ca7bc,{'transaction':_0x45ffe7});}})['then'](function(){_0x1ca7bc[_0x8124('0x6d')](function(_0x2c4e92){socket[_0x8124('0x6e')](_0x8124('0x84'),{'UserId':_0x2c4e92,'MailQueueId':_0x2a1e6a['id']});});});});});});})[_0x8124('0x26')](respondWithStatusCode(_0x505194,null))[_0x8124('0x43')](handleError(_0x505194,null));};exports[_0x8124('0x85')]=function(_0x143ca0,_0x3f0fa9,_0x1c498d){return db[_0x8124('0x2d')]['find']({'where':{'id':_0x143ca0['params']['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x3f0fa9,null))[_0x8124('0x26')](function(_0x62a90c){if(_0x62a90c){return _0x62a90c['addAgents'](_0x143ca0['body'][_0x8124('0x71')],_[_0x8124('0x86')](_0x143ca0[_0x8124('0x51')],[_0x8124('0x71'),'id'])||{})['spread'](function(_0x4434b6){for(var _0x571f12=0x0;_0x571f12<_0x143ca0[_0x8124('0x51')][_0x8124('0x71')][_0x8124('0x36')];_0x571f12+=0x1){socket[_0x8124('0x6e')]('userMailQueue:save',{'UserId':_0x143ca0[_0x8124('0x51')][_0x8124('0x71')][_0x571f12],'MailQueueId':_0x143ca0[_0x8124('0x45')]['id']});}return _0x4434b6;});}})['then'](respondWithResult(_0x3f0fa9,null))[_0x8124('0x43')](handleError(_0x3f0fa9,null));};exports[_0x8124('0x83')]=function(_0x419edd,_0x226790,_0x137e64){return db['MailQueue'][_0x8124('0x47')]({'where':{'id':_0x419edd[_0x8124('0x45')]['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x226790,null))['then'](function(_0x51c369){if(_0x51c369){return _0x51c369[_0x8124('0x83')](_0x419edd['query'][_0x8124('0x71')])[_0x8124('0x26')](function(){if(_[_0x8124('0x87')](_0x419edd[_0x8124('0x31')]['ids'])){for(var _0x245f9d=0x0;_0x245f9d<_0x419edd[_0x8124('0x31')][_0x8124('0x71')][_0x8124('0x36')];_0x245f9d+=0x1){socket[_0x8124('0x6e')](_0x8124('0x84'),{'UserId':Number(_0x419edd['query']['ids'][_0x245f9d]),'MailQueueId':Number(_0x419edd[_0x8124('0x45')]['id'])});}}else{socket[_0x8124('0x6e')](_0x8124('0x84'),{'UserId':Number(_0x419edd['query']['ids']),'MailQueueId':Number(_0x419edd[_0x8124('0x45')]['id'])});}});}})[_0x8124('0x26')](respondWithStatusCode(_0x226790,null))[_0x8124('0x43')](handleError(_0x226790,null));};exports[_0x8124('0x88')]=function(_0x296977,_0x33f4ca,_0x273cd7){var _0x5dd50f={};var _0x18ffe6={};var _0x150a75;var _0x413a2d;return db[_0x8124('0x2d')][_0x8124('0x63')]({'where':{'id':_0x296977[_0x8124('0x45')]['id']}})[_0x8124('0x26')](handleEntityNotFound(_0x33f4ca,null))[_0x8124('0x26')](function(_0x478565){if(_0x478565){_0x150a75=_0x478565;_0x18ffe6['model']=_[_0x8124('0x30')](db[_0x8124('0x59')][_0x8124('0x2e')]);_0x18ffe6[_0x8124('0x31')]=_[_0x8124('0x30')](_0x296977['query']);_0x18ffe6[_0x8124('0x32')]=_[_0x8124('0x33')](_0x18ffe6['model'],_0x18ffe6[_0x8124('0x31')]);_0x5dd50f[_0x8124('0x34')]=_[_0x8124('0x33')](_0x18ffe6[_0x8124('0x2f')],qs[_0x8124('0x35')](_0x296977[_0x8124('0x31')][_0x8124('0x35')]));_0x5dd50f['attributes']=_0x5dd50f[_0x8124('0x34')][_0x8124('0x36')]?_0x5dd50f[_0x8124('0x34')]:_0x18ffe6[_0x8124('0x2f')];_0x5dd50f[_0x8124('0x54')]=qs[_0x8124('0x39')](_0x296977[_0x8124('0x31')][_0x8124('0x39')]);_0x5dd50f['where']=qs['filters'](_[_0x8124('0x55')](_0x296977['query'],_0x18ffe6[_0x8124('0x32')]));if(_0x296977[_0x8124('0x31')][_0x8124('0x3b')]){_0x5dd50f[_0x8124('0x3a')]=_[_0x8124('0x3c')](_0x5dd50f[_0x8124('0x3a')],{'$or':_[_0x8124('0x3d')](_0x5dd50f[_0x8124('0x34')],function(_0x436763){var _0x1521bc={};_0x1521bc[_0x436763]={'$like':'%'+_0x296977['query'][_0x8124('0x3b')]+'%'};return _0x1521bc;})});}_0x5dd50f=_[_0x8124('0x3c')]({},_0x5dd50f,_0x296977['options']);return _0x150a75[_0x8124('0x88')](_0x5dd50f);}})[_0x8124('0x26')](function(_0x2e29f2){if(_0x2e29f2){_0x413a2d=_0x2e29f2['length'];if(!_0x296977[_0x8124('0x31')][_0x8124('0x37')](_0x8124('0x38'))){_0x5dd50f[_0x8124('0x1f')]=qs[_0x8124('0x1f')](_0x296977[_0x8124('0x31')]['limit']);_0x5dd50f[_0x8124('0x1e')]=qs[_0x8124('0x1e')](_0x296977[_0x8124('0x31')][_0x8124('0x1e')]);}return _0x150a75[_0x8124('0x88')](_0x5dd50f);}})[_0x8124('0x26')](function(_0x332a64){if(_0x332a64){return _0x332a64?{'count':_0x413a2d,'rows':_0x332a64}:null;}})[_0x8124('0x26')](respondWithResult(_0x33f4ca,null))['catch'](handleError(_0x33f4ca,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 807eff1..d9bcab4 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 _0xeecb=['emit','exports','events','../../mysqldb','MailQueue','setMaxListeners','update','remove'];(function(_0xb7dfc5,_0x408bb8){var _0x3d75e2=function(_0x455a48){while(--_0x455a48){_0xb7dfc5['push'](_0xb7dfc5['shift']());}};_0x3d75e2(++_0x408bb8);}(_0xeecb,0x82));var _0xbeec=function(_0x237c4a,_0x416580){_0x237c4a=_0x237c4a-0x0;var _0x46ccba=_0xeecb[_0x237c4a];return _0x46ccba;};'use strict';var EventEmitter=require(_0xbeec('0x0'));var MailQueue=require(_0xbeec('0x1'))['db'][_0xbeec('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbeec('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbeec('0x4'),'afterDestroy':_0xbeec('0x5')};function emitEvent(_0x219b7f){return function(_0x24acd9,_0x2a1fce,_0x407cbf){MailQueueEvents[_0xbeec('0x6')](_0x219b7f+':'+_0x24acd9['id'],_0x24acd9);MailQueueEvents[_0xbeec('0x6')](_0x219b7f,_0x24acd9);_0x407cbf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xbeec('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xe2a1=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x57f458,_0x288edf){var _0x5e2e77=function(_0x521fef){while(--_0x521fef){_0x57f458['push'](_0x57f458['shift']());}};_0x5e2e77(++_0x288edf);}(_0xe2a1,0x18c));var _0x1e2a=function(_0x1e1bd8,_0x25b2f6){_0x1e1bd8=_0x1e1bd8-0x0;var _0x4c944f=_0xe2a1[_0x1e1bd8];return _0x4c944f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x1e2a('0x0'))['db'][_0x1e2a('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1e2a('0x2')](0x0);var events={'afterCreate':_0x1e2a('0x3'),'afterUpdate':_0x1e2a('0x4'),'afterDestroy':_0x1e2a('0x5')};function emitEvent(_0x4abef9){return function(_0x5754e4,_0x3917ea,_0x26a1d0){MailQueueEvents[_0x1e2a('0x6')](_0x4abef9+':'+_0x5754e4['id'],_0x5754e4);MailQueueEvents[_0x1e2a('0x6')](_0x4abef9,_0x5754e4);_0x26a1d0(null);};}for(var e in events){if(events[_0x1e2a('0x7')](e)){var event=events[e];MailQueue[_0x1e2a('0x8')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 34deb83..e2c33a8 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 _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','MailQueue','mail_queues','lodash'];(function(_0x3c343b,_0x645b01){var _0xb5cc00=function(_0xe45182){while(--_0xe45182){_0x3c343b['push'](_0x3c343b['shift']());}};_0xb5cc00(++_0x645b01);}(_0xaa88,0x137));var _0x8aa8=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0xaa88[_0x2ade6c];return _0x2cb372;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4eb=['./mailQueue.attributes','exports','define','mail_queues','lodash','bluebird','rimraf','../../config/environment'];(function(_0x14a3cf,_0xae014f){var _0x5bcffb=function(_0x45fdad){while(--_0x45fdad){_0x14a3cf['push'](_0x14a3cf['shift']());}};_0x5bcffb(++_0xae014f);}(_0xf4eb,0xec));var _0xbf4e=function(_0x56c535,_0x5e7def){_0x56c535=_0x56c535-0x0;var _0x572797=_0xf4eb[_0x56c535];return _0x572797;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('MailQueue',attributes,{'tableName':_0xbf4e('0x7'),'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 e719c7a..68afb22 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 _0xd8a1=['GetMailQueue','ShowMailQueue','MailQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then'];(function(_0x2ce6d5,_0x333e0c){var _0x32d272=function(_0x399f0b){while(--_0x399f0b){_0x2ce6d5['push'](_0x2ce6d5['shift']());}};_0x32d272(++_0x333e0c);}(_0xd8a1,0x6f));var _0x1d8a=function(_0x657be,_0x1752b9){_0x657be=_0x657be-0x0;var _0x35a2ce=_0xd8a1[_0x657be];return _0x35a2ce;};'use strict';var _=require(_0x1d8a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1d8a('0x1'));var rs=require(_0x1d8a('0x2'));var fs=require('fs');var Redis=require(_0x1d8a('0x3'));var db=require(_0x1d8a('0x4'))['db'];var utils=require(_0x1d8a('0x5'));var logger=require('../../config/logger')(_0x1d8a('0x6'));var config=require(_0x1d8a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1d8a('0x8')]({'port':0x232a});config['redis']=_[_0x1d8a('0x9')](config[_0x1d8a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d8a('0xb'))(new Redis(config[_0x1d8a('0xa')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x33cb50,_0x240df3,_0x17f591){return new BPromise(function(_0x59b0f3,_0x4417db){return client[_0x1d8a('0xc')](_0x33cb50,_0x17f591)['then'](function(_0x10ddff){logger['info'](_0x1d8a('0xd'),_0x240df3,_0x1d8a('0xe'));logger[_0x1d8a('0xf')](_0x1d8a('0x10'),_0x240df3,_0x1d8a('0xe'),JSON[_0x1d8a('0x11')](_0x10ddff));if(_0x10ddff[_0x1d8a('0x12')]){if(_0x10ddff[_0x1d8a('0x12')]['code']===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x240df3,_0x10ddff[_0x1d8a('0x12')][_0x1d8a('0x13')]);return _0x4417db(_0x10ddff[_0x1d8a('0x12')][_0x1d8a('0x13')]);}logger[_0x1d8a('0x12')](_0x1d8a('0xd'),_0x240df3,_0x10ddff[_0x1d8a('0x12')]['message']);return _0x59b0f3(_0x10ddff['error'][_0x1d8a('0x13')]);}else{logger[_0x1d8a('0x14')](_0x1d8a('0xd'),_0x240df3,'request\x20sent');_0x59b0f3(_0x10ddff[_0x1d8a('0x15')][_0x1d8a('0x13')]);}})[_0x1d8a('0x16')](function(_0x23a500){logger[_0x1d8a('0x12')]('MailQueue,\x20%s,\x20%s',_0x240df3,_0x23a500);_0x4417db(_0x23a500);});});}exports['GetMailQueue']=function(_0x50e55d){var _0x3d54e5=this;return new Promise(function(_0x17056a,_0x48a34f){return db['MailQueue'][_0x1d8a('0x17')]({'raw':_0x50e55d[_0x1d8a('0x18')]?_0x50e55d[_0x1d8a('0x18')][_0x1d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x50e55d[_0x1d8a('0x18')]?_0x50e55d['options'][_0x1d8a('0x1a')]||null:null,'attributes':_0x50e55d[_0x1d8a('0x18')]?_0x50e55d['options'][_0x1d8a('0x1b')]||null:null,'limit':_0x50e55d[_0x1d8a('0x18')]?_0x50e55d[_0x1d8a('0x18')][_0x1d8a('0x1c')]||null:null,'include':_0x50e55d[_0x1d8a('0x18')]?_0x50e55d[_0x1d8a('0x18')][_0x1d8a('0x1d')]?_[_0x1d8a('0x1e')](_0x50e55d[_0x1d8a('0x18')][_0x1d8a('0x1d')],function(_0x3236eb){return{'model':db[_0x3236eb[_0x1d8a('0x1f')]],'as':_0x3236eb['as'],'attributes':_0x3236eb[_0x1d8a('0x1b')],'include':_0x3236eb['include']?_['map'](_0x3236eb[_0x1d8a('0x1d')],function(_0x3c8a67){return{'model':db[_0x3c8a67[_0x1d8a('0x1f')]],'as':_0x3c8a67['as'],'attributes':_0x3c8a67[_0x1d8a('0x1b')],'include':_0x3c8a67[_0x1d8a('0x1d')]?_[_0x1d8a('0x1e')](_0x3c8a67['include'],function(_0x1bd58a){return{'model':db[_0x1bd58a[_0x1d8a('0x1f')]],'as':_0x1bd58a['as'],'attributes':_0x1bd58a[_0x1d8a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1d8a('0x20')](function(_0x485b2b){logger['info'](_0x1d8a('0x21'),_0x50e55d);logger['debug'](_0x1d8a('0x21'),_0x50e55d,JSON['stringify'](_0x485b2b));_0x17056a(_0x485b2b);})[_0x1d8a('0x16')](function(_0x84ae5f){logger['error'](_0x1d8a('0x21'),_0x84ae5f['message'],_0x50e55d);_0x48a34f(_0x3d54e5['error'](0x1f4,_0x84ae5f[_0x1d8a('0x13')]));});});};exports[_0x1d8a('0x22')]=function(_0x5b4a77){var _0x5c1287=this;return new Promise(function(_0x2617d6,_0xa3243d){return db[_0x1d8a('0x23')]['find']({'raw':_0x5b4a77[_0x1d8a('0x18')]?_0x5b4a77['options'][_0x1d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x5b4a77[_0x1d8a('0x18')]?_0x5b4a77['options'][_0x1d8a('0x1a')]||null:null,'attributes':_0x5b4a77[_0x1d8a('0x18')]?_0x5b4a77[_0x1d8a('0x18')][_0x1d8a('0x1b')]||null:null,'include':_0x5b4a77['options']?_0x5b4a77['options'][_0x1d8a('0x1d')]?_['map'](_0x5b4a77[_0x1d8a('0x18')][_0x1d8a('0x1d')],function(_0x2784cf){return{'model':db[_0x2784cf[_0x1d8a('0x1f')]],'as':_0x2784cf['as'],'attributes':_0x2784cf[_0x1d8a('0x1b')],'include':_0x2784cf[_0x1d8a('0x1d')]?_['map'](_0x2784cf[_0x1d8a('0x1d')],function(_0x21c699){return{'model':db[_0x21c699[_0x1d8a('0x1f')]],'as':_0x21c699['as'],'attributes':_0x21c699[_0x1d8a('0x1b')],'include':_0x21c699[_0x1d8a('0x1d')]?_[_0x1d8a('0x1e')](_0x21c699[_0x1d8a('0x1d')],function(_0x5d3223){return{'model':db[_0x5d3223['model']],'as':_0x5d3223['as'],'attributes':_0x5d3223[_0x1d8a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1d8a('0x20')](function(_0x62ed00){logger[_0x1d8a('0x14')](_0x1d8a('0x22'),_0x5b4a77);logger[_0x1d8a('0xf')](_0x1d8a('0x22'),_0x5b4a77,JSON[_0x1d8a('0x11')](_0x62ed00));_0x2617d6(_0x62ed00);})[_0x1d8a('0x16')](function(_0x191ca5){logger['error'](_0x1d8a('0x22'),_0x191ca5[_0x1d8a('0x13')],_0x5b4a77);_0xa3243d(_0x5c1287['error'](0x1f4,_0x191ca5[_0x1d8a('0x13')]));});});}; \ No newline at end of file +var _0x8559=['localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetMailQueue','MailQueue','findAll','options','raw','include','map','model','attributes','ShowMailQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3bb5b4,_0x128455){var _0x586c60=function(_0x179226){while(--_0x179226){_0x3bb5b4['push'](_0x3bb5b4['shift']());}};_0x586c60(++_0x128455);}(_0x8559,0x181));var _0x9855=function(_0x803a26,_0x2210d0){_0x803a26=_0x803a26-0x0;var _0x5d1324=_0x8559[_0x803a26];return _0x5d1324;};'use strict';var _=require(_0x9855('0x0'));var util=require(_0x9855('0x1'));var moment=require(_0x9855('0x2'));var BPromise=require('bluebird');var rs=require(_0x9855('0x3'));var fs=require('fs');var Redis=require(_0x9855('0x4'));var db=require(_0x9855('0x5'))['db'];var utils=require(_0x9855('0x6'));var logger=require(_0x9855('0x7'))(_0x9855('0x8'));var config=require(_0x9855('0x9'));var jayson=require(_0x9855('0xa'));var client=jayson[_0x9855('0xb')][_0x9855('0xc')]({'port':0x232a});config[_0x9855('0xd')]=_[_0x9855('0xe')](config[_0x9855('0xd')],{'host':_0x9855('0xf'),'port':0x18eb});var socket=require(_0x9855('0x10'))(new Redis(config['redis']));require(_0x9855('0x11'))[_0x9855('0x12')](socket);function respondWithRpcPromise(_0x149a73,_0x1816b5,_0x21ca54){return new BPromise(function(_0x12a566,_0x5eacfc){return client[_0x9855('0x13')](_0x149a73,_0x21ca54)[_0x9855('0x14')](function(_0x1c4158){logger[_0x9855('0x15')](_0x9855('0x16'),_0x1816b5,_0x9855('0x17'));logger[_0x9855('0x18')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x1816b5,'request\x20sent',JSON[_0x9855('0x19')](_0x1c4158));if(_0x1c4158[_0x9855('0x1a')]){if(_0x1c4158[_0x9855('0x1a')]['code']===0x1f4){logger[_0x9855('0x1a')](_0x9855('0x16'),_0x1816b5,_0x1c4158['error'][_0x9855('0x1b')]);return _0x5eacfc(_0x1c4158[_0x9855('0x1a')]['message']);}logger[_0x9855('0x1a')](_0x9855('0x16'),_0x1816b5,_0x1c4158[_0x9855('0x1a')]['message']);return _0x12a566(_0x1c4158['error']['message']);}else{logger[_0x9855('0x15')](_0x9855('0x16'),_0x1816b5,'request\x20sent');_0x12a566(_0x1c4158['result'][_0x9855('0x1b')]);}})[_0x9855('0x1c')](function(_0x280593){logger[_0x9855('0x1a')](_0x9855('0x16'),_0x1816b5,_0x280593);_0x5eacfc(_0x280593);});});}exports[_0x9855('0x1d')]=function(_0x3caa1b){var _0x4a47cb=this;return new Promise(function(_0x2d78ee,_0x521dd5){return db[_0x9855('0x1e')][_0x9855('0x1f')]({'raw':_0x3caa1b[_0x9855('0x20')]?_0x3caa1b[_0x9855('0x20')][_0x9855('0x21')]===undefined?!![]:![]:!![],'where':_0x3caa1b[_0x9855('0x20')]?_0x3caa1b[_0x9855('0x20')]['where']||null:null,'attributes':_0x3caa1b['options']?_0x3caa1b[_0x9855('0x20')]['attributes']||null:null,'limit':_0x3caa1b['options']?_0x3caa1b[_0x9855('0x20')]['limit']||null:null,'include':_0x3caa1b[_0x9855('0x20')]?_0x3caa1b[_0x9855('0x20')][_0x9855('0x22')]?_[_0x9855('0x23')](_0x3caa1b[_0x9855('0x20')][_0x9855('0x22')],function(_0x568e5e){return{'model':db[_0x568e5e[_0x9855('0x24')]],'as':_0x568e5e['as'],'attributes':_0x568e5e[_0x9855('0x25')],'include':_0x568e5e[_0x9855('0x22')]?_[_0x9855('0x23')](_0x568e5e[_0x9855('0x22')],function(_0x24ae1b){return{'model':db[_0x24ae1b[_0x9855('0x24')]],'as':_0x24ae1b['as'],'attributes':_0x24ae1b['attributes'],'include':_0x24ae1b[_0x9855('0x22')]?_[_0x9855('0x23')](_0x24ae1b[_0x9855('0x22')],function(_0x7cc8c8){return{'model':db[_0x7cc8c8[_0x9855('0x24')]],'as':_0x7cc8c8['as'],'attributes':_0x7cc8c8[_0x9855('0x25')]};}):[]};}):[]};}):[]:[]})[_0x9855('0x14')](function(_0x1e1a00){logger[_0x9855('0x15')](_0x9855('0x1d'),_0x3caa1b);logger['debug'](_0x9855('0x1d'),_0x3caa1b,JSON[_0x9855('0x19')](_0x1e1a00));_0x2d78ee(_0x1e1a00);})[_0x9855('0x1c')](function(_0x1df931){logger[_0x9855('0x1a')](_0x9855('0x1d'),_0x1df931[_0x9855('0x1b')],_0x3caa1b);_0x521dd5(_0x4a47cb['error'](0x1f4,_0x1df931[_0x9855('0x1b')]));});});};exports[_0x9855('0x26')]=function(_0x2dcfb8){var _0x5d10d1=this;return new Promise(function(_0x36071d,_0x1fef9a){return db[_0x9855('0x1e')][_0x9855('0x27')]({'raw':_0x2dcfb8[_0x9855('0x20')]?_0x2dcfb8['options'][_0x9855('0x21')]===undefined?!![]:![]:!![],'where':_0x2dcfb8['options']?_0x2dcfb8['options']['where']||null:null,'attributes':_0x2dcfb8[_0x9855('0x20')]?_0x2dcfb8['options']['attributes']||null:null,'include':_0x2dcfb8[_0x9855('0x20')]?_0x2dcfb8[_0x9855('0x20')][_0x9855('0x22')]?_[_0x9855('0x23')](_0x2dcfb8[_0x9855('0x20')][_0x9855('0x22')],function(_0x14e144){return{'model':db[_0x14e144[_0x9855('0x24')]],'as':_0x14e144['as'],'attributes':_0x14e144[_0x9855('0x25')],'include':_0x14e144[_0x9855('0x22')]?_[_0x9855('0x23')](_0x14e144[_0x9855('0x22')],function(_0x3c38f6){return{'model':db[_0x3c38f6['model']],'as':_0x3c38f6['as'],'attributes':_0x3c38f6[_0x9855('0x25')],'include':_0x3c38f6[_0x9855('0x22')]?_[_0x9855('0x23')](_0x3c38f6[_0x9855('0x22')],function(_0x523627){return{'model':db[_0x523627[_0x9855('0x24')]],'as':_0x523627['as'],'attributes':_0x523627[_0x9855('0x25')]};}):[]};}):[]};}):[]:[]})[_0x9855('0x14')](function(_0xf4d2ea){logger['info'](_0x9855('0x26'),_0x2dcfb8);logger['debug']('ShowMailQueue',_0x2dcfb8,JSON[_0x9855('0x19')](_0xf4d2ea));_0x36071d(_0xf4d2ea);})[_0x9855('0x1c')](function(_0x47a9e0){logger[_0x9855('0x1a')](_0x9855('0x26'),_0x47a9e0[_0x9855('0x1b')],_0x2dcfb8);_0x1fef9a(_0x5d10d1[_0x9855('0x1a')](0x1f4,_0x47a9e0[_0x9855('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 68bef46..db121a5 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 _0xd487=['removeListener','length','save','remove','update','emit'];(function(_0xe3e514,_0x9d098c){var _0x37fc0f=function(_0x14f853){while(--_0x14f853){_0xe3e514['push'](_0xe3e514['shift']());}};_0x37fc0f(++_0x9d098c);}(_0xd487,0x1e2));var _0x7d48=function(_0x35c1db,_0xd75c15){_0x35c1db=_0x35c1db-0x0;var _0x4173ff=_0xd487[_0x35c1db];return _0x4173ff;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x7d48('0x0'),_0x7d48('0x1'),_0x7d48('0x2')];function createListener(_0x1eabee,_0x5a19a5){return function(_0x1c1546){_0x5a19a5[_0x7d48('0x3')](_0x1eabee,_0x1c1546);};}function removeListener(_0xc30ef5,_0x144460){return function(){MailQueueEvents[_0x7d48('0x4')](_0xc30ef5,_0x144460);};}exports['register']=function(_0x27f0b9){for(var _0x5f209d=0x0,_0x5c701b=events[_0x7d48('0x5')];_0x5f209d<_0x5c701b;_0x5f209d++){var _0x2be0d9=events[_0x5f209d];var _0x101305=createListener('mailQueue:'+_0x2be0d9,_0x27f0b9);MailQueueEvents['on'](_0x2be0d9,_0x101305);}}; \ No newline at end of file +var _0x003b=['update','emit','removeListener','register','length','./mailQueue.events','save','remove'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x003b,0xd5));var _0xb003=function(_0x3df247,_0x4ff38e){_0x3df247=_0x3df247-0x0;var _0x1dce03=_0x003b[_0x3df247];return _0x1dce03;};'use strict';var MailQueueEvents=require(_0xb003('0x0'));var events=[_0xb003('0x1'),_0xb003('0x2'),_0xb003('0x3')];function createListener(_0x2ce1f1,_0x498150){return function(_0x52e79d){_0x498150[_0xb003('0x4')](_0x2ce1f1,_0x52e79d);};}function removeListener(_0x44afc0,_0xedff6d){return function(){MailQueueEvents[_0xb003('0x5')](_0x44afc0,_0xedff6d);};}exports[_0xb003('0x6')]=function(_0x5ab87f){for(var _0x3f2556=0x0,_0x191643=events[_0xb003('0x7')];_0x3f2556<_0x191643;_0x3f2556++){var _0x4f6873=events[_0x3f2556];var _0x580ab=createListener('mailQueue:'+_0x4f6873,_0x5ab87f);MailQueueEvents['on'](_0x4f6873,_0x580ab);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index bf21ad6..8d8ef18 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 _0x6440=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','update'];(function(_0x47f9fa,_0x459f54){var _0x413aae=function(_0x1bc96f){while(--_0x1bc96f){_0x47f9fa['push'](_0x47f9fa['shift']());}};_0x413aae(++_0x459f54);}(_0x6440,0xfe));var _0x0644=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0x6440[_0x34a8c8];return _0x1fe6e5;};'use strict';var multer=require(_0x0644('0x0'));var util=require(_0x0644('0x1'));var path=require(_0x0644('0x2'));var timeout=require(_0x0644('0x3'));var express=require('express');var router=express[_0x0644('0x4')]();var auth=require(_0x0644('0x5'));var interaction=require(_0x0644('0x6'));var config=require('../../config/environment');var controller=require(_0x0644('0x7'));router[_0x0644('0x8')]('/',auth[_0x0644('0x9')](),controller[_0x0644('0xa')]);router[_0x0644('0x8')](_0x0644('0xb'),auth[_0x0644('0x9')](),controller['describe']);router['get'](_0x0644('0xc'),auth[_0x0644('0x9')](),controller[_0x0644('0xd')]);router[_0x0644('0xe')]('/',auth[_0x0644('0x9')](),controller['create']);router['put'](_0x0644('0xc'),auth[_0x0644('0x9')](),controller[_0x0644('0xf')]);router['delete']('/:id',auth[_0x0644('0x9')](),controller[_0x0644('0x10')]);module[_0x0644('0x11')]=router; \ No newline at end of file +var _0xfd6d=['create','put','/:id','update','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','describe','get','show'];(function(_0xdb447c,_0x1c0cc5){var _0x497b8c=function(_0x48d526){while(--_0x48d526){_0xdb447c['push'](_0xdb447c['shift']());}};_0x497b8c(++_0x1c0cc5);}(_0xfd6d,0xb0));var _0xdfd6=function(_0x51b06f,_0x424e3e){_0x51b06f=_0x51b06f-0x0;var _0x4e95f1=_0xfd6d[_0x51b06f];return _0x4e95f1;};'use strict';var multer=require(_0xdfd6('0x0'));var util=require('util');var path=require(_0xdfd6('0x1'));var timeout=require('connect-timeout');var express=require(_0xdfd6('0x2'));var router=express[_0xdfd6('0x3')]();var auth=require(_0xdfd6('0x4'));var interaction=require(_0xdfd6('0x5'));var config=require(_0xdfd6('0x6'));var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0xdfd6('0x7')](),controller['index']);router['get']('/describe',auth[_0xdfd6('0x7')](),controller[_0xdfd6('0x8')]);router[_0xdfd6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdfd6('0xa')]);router['post']('/',auth[_0xdfd6('0x7')](),controller[_0xdfd6('0xb')]);router[_0xdfd6('0xc')](_0xdfd6('0xd'),auth[_0xdfd6('0x7')](),controller[_0xdfd6('0xe')]);router[_0xdfd6('0xf')](_0xdfd6('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xdfd6('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 4757853..5b2c004 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 _0x119c=['DATE','moment','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x119c,0xc5));var _0xc119=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0x119c[_0x1e4f2d];return _0xd05ce5;};'use strict';var moment=require(_0xc119('0x0'));var Sequelize=require('sequelize');module[_0xc119('0x1')]={'uniqueid':{'type':Sequelize[_0xc119('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xc119('0x2')]},'joinAt':{'type':Sequelize[_0xc119('0x3')]},'leaveAt':{'type':Sequelize[_0xc119('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc119('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9437=['DATE','sequelize','exports','STRING'];(function(_0x11bc0f,_0x373666){var _0x3ab0d1=function(_0x4604a7){while(--_0x4604a7){_0x11bc0f['push'](_0x11bc0f['shift']());}};_0x3ab0d1(++_0x373666);}(_0x9437,0x99));var _0x7943=function(_0x320cf5,_0x4e437d){_0x320cf5=_0x320cf5-0x0;var _0xa77006=_0x9437[_0x320cf5];return _0xa77006;};'use strict';var moment=require('moment');var Sequelize=require(_0x7943('0x0'));module[_0x7943('0x1')]={'uniqueid':{'type':Sequelize[_0x7943('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7943('0x2')]},'joinAt':{'type':Sequelize[_0x7943('0x3')]},'leaveAt':{'type':Sequelize[_0x7943('0x3')]},'acceptAt':{'type':Sequelize[_0x7943('0x3')]},'exitAt':{'type':Sequelize[_0x7943('0x3')]},'reason':{'type':Sequelize[_0x7943('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 2b6643c..cc74dc1 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 _0x260a=['util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','reject','save','update','then','end','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','key','VIRTUAL','field','merge','MailQueueReport','include','catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2ecdbe,_0x114206){var _0x44d6d4=function(_0x2e592a){while(--_0x2e592a){_0x2ecdbe['push'](_0x2ecdbe['shift']());}};_0x44d6d4(++_0x114206);}(_0x260a,0x1a8));var _0xa260=function(_0x384f6f,_0x548ceb){_0x384f6f=_0x384f6f-0x0;var _0x3fe24d=_0x260a[_0x384f6f];return _0x3fe24d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa260('0x0'));var rimraf=require(_0xa260('0x1'));var zipdir=require(_0xa260('0x2'));var jsonpatch=require(_0xa260('0x3'));var rp=require(_0xa260('0x4'));var moment=require(_0xa260('0x5'));var BPromise=require(_0xa260('0x6'));var Mustache=require(_0xa260('0x7'));var util=require(_0xa260('0x8'));var path=require('path');var sox=require(_0xa260('0x9'));var csv=require('to-csv');var ejs=require(_0xa260('0xa'));var fs=require('fs');var _=require(_0xa260('0xb'));var squel=require(_0xa260('0xc'));var crypto=require(_0xa260('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa260('0xe'));var toCsv=require(_0xa260('0xf'));var querystring=require(_0xa260('0x10'));var Papa=require(_0xa260('0x11'));var Redis=require(_0xa260('0x12'));var authService=require(_0xa260('0x13'));var qs=require(_0xa260('0x14'));var hardwareService=require(_0xa260('0x15'));var logger=require(_0xa260('0x16'))(_0xa260('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xa260('0x18'))['db'];function respondWithStatusCode(_0x34bf50,_0x1b3fb8){_0x1b3fb8=_0x1b3fb8||0xcc;return function(_0x5c9bf3){if(_0x5c9bf3){return _0x34bf50[_0xa260('0x19')](_0x1b3fb8);}return _0x34bf50[_0xa260('0x1a')](_0x1b3fb8)['end']();};}function respondWithResult(_0x4989d1,_0x2afa28){_0x2afa28=_0x2afa28||0xc8;return function(_0x181157){if(_0x181157){return _0x4989d1[_0xa260('0x1a')](_0x2afa28)[_0xa260('0x1b')](_0x181157);}};}function respondWithFilteredResult(_0x1dc212,_0x24b6f9){return function(_0x33497d){if(_0x33497d){var _0x5a2e11=_0x33497d[_0xa260('0x1c')],_0xa7f89c=_0x24b6f9[_0xa260('0x1d')],_0x35555f=_0x24b6f9[_0xa260('0x1d')]+_0x24b6f9['limit'],_0x5697e9;if(_0x35555f>=_0x5a2e11){_0x35555f=_0x5a2e11;_0x5697e9=0xc8;}else{_0x5697e9=0xce;}_0x1dc212[_0xa260('0x1a')](_0x5697e9);return _0x1dc212['set'](_0xa260('0x1e'),_0xa7f89c+'-'+_0x35555f+'/'+_0x5a2e11)[_0xa260('0x1b')](_0x33497d);}return null;};}function patchUpdates(_0x205dce){return function(_0x5011fc){try{jsonpatch['apply'](_0x5011fc,_0x205dce,!![]);}catch(_0x373df0){return BPromise[_0xa260('0x1f')](_0x373df0);}return _0x5011fc[_0xa260('0x20')]();};}function saveUpdates(_0xb0fd66,_0x3d662f){return function(_0x519a49){if(_0x519a49){return _0x519a49[_0xa260('0x21')](_0xb0fd66)['then'](function(_0x380a4d){return _0x380a4d;});}return null;};}function removeEntity(_0x518349,_0x29da33){return function(_0xade03e){if(_0xade03e){return _0xade03e['destroy']()[_0xa260('0x22')](function(){_0x518349[_0xa260('0x1a')](0xcc)[_0xa260('0x23')]();});}};}function handleEntityNotFound(_0x399168,_0x5efe80){return function(_0x701701){if(!_0x701701){_0x399168[_0xa260('0x19')](0x194);}return _0x701701;};}function handleError(_0x5cdf35,_0x2998d4){_0x2998d4=_0x2998d4||0x1f4;return function(_0x40aef0){logger[_0xa260('0x24')](_0x40aef0['stack']);if(_0x40aef0['name']){delete _0x40aef0[_0xa260('0x25')];}_0x5cdf35[_0xa260('0x1a')](_0x2998d4)[_0xa260('0x26')](_0x40aef0);};}exports[_0xa260('0x27')]=function(_0x171c04,_0x185b89){var _0x36651a={},_0x335da3={},_0x22ec40={'count':0x0,'rows':[]};var _0x190f3d=db['MailQueueReport'][_0xa260('0x28')];_0x335da3[_0xa260('0x29')]=_[_0xa260('0x2a')](_0x190f3d);_0x335da3['query']=_[_0xa260('0x2a')](_0x171c04[_0xa260('0x2b')]);_0x335da3[_0xa260('0x2c')]=_[_0xa260('0x2d')](_0x335da3[_0xa260('0x29')],_0x335da3[_0xa260('0x2b')]);_0x36651a[_0xa260('0x2e')]=_[_0xa260('0x2d')](_0x335da3['model'],qs[_0xa260('0x2f')](_0x171c04['query']['fields']));_0x36651a[_0xa260('0x2e')]=_0x36651a['attributes'][_0xa260('0x30')]?_0x36651a[_0xa260('0x2e')]:_0x335da3[_0xa260('0x29')];if(!_0x171c04[_0xa260('0x2b')][_0xa260('0x31')](_0xa260('0x32'))){_0x36651a['limit']=qs[_0xa260('0x33')](_0x171c04[_0xa260('0x2b')][_0xa260('0x33')]);_0x36651a[_0xa260('0x1d')]=qs['offset'](_0x171c04[_0xa260('0x2b')][_0xa260('0x1d')]);}_0x36651a[_0xa260('0x34')]=qs['sort'](_0x171c04[_0xa260('0x2b')][_0xa260('0x35')]);_0x36651a[_0xa260('0x36')]=qs[_0xa260('0x2c')](_[_0xa260('0x37')](_0x171c04[_0xa260('0x2b')],_0x335da3[_0xa260('0x2c')]));if(_0x171c04[_0xa260('0x2b')][_0xa260('0x38')]){_0x36651a[_0xa260('0x36')]=_['merge'](_0x36651a[_0xa260('0x36')],{'$or':_['map'](_0x190f3d,function(_0xae1b38){if(_0xae1b38['type'][_0xa260('0x39')]!==_0xa260('0x3a')){var _0x3f3120={};_0x3f3120[_0xae1b38[_0xa260('0x3b')]]={'$like':'%'+_0x171c04[_0xa260('0x2b')][_0xa260('0x38')]+'%'};return _0x3f3120;}})});}_0x36651a=_[_0xa260('0x3c')]({},_0x36651a,_0x171c04['options']);var _0x5240f8={'where':_0x36651a[_0xa260('0x36')]};return db[_0xa260('0x3d')]['count'](_0x5240f8)[_0xa260('0x22')](function(_0x2188a2){_0x22ec40[_0xa260('0x1c')]=_0x2188a2;if(_0x171c04[_0xa260('0x2b')]['includeAll']){_0x36651a[_0xa260('0x3e')]=[{'all':!![]}];}return db[_0xa260('0x3d')]['findAll'](_0x36651a);})[_0xa260('0x22')](function(_0x21ed05){_0x22ec40['rows']=_0x21ed05;return _0x22ec40;})[_0xa260('0x22')](respondWithFilteredResult(_0x185b89,_0x36651a))[_0xa260('0x3f')](handleError(_0x185b89,null));};exports[_0xa260('0x40')]=function(_0x48891b,_0x597f60){var _0x45ec9f={'raw':!![],'where':{'id':_0x48891b[_0xa260('0x41')]['id']}},_0x34c594={};_0x34c594[_0xa260('0x29')]=_[_0xa260('0x2a')](db[_0xa260('0x3d')]['rawAttributes']);_0x34c594['query']=_[_0xa260('0x2a')](_0x48891b[_0xa260('0x2b')]);_0x34c594['filters']=_[_0xa260('0x2d')](_0x34c594[_0xa260('0x29')],_0x34c594[_0xa260('0x2b')]);_0x45ec9f[_0xa260('0x2e')]=_[_0xa260('0x2d')](_0x34c594[_0xa260('0x29')],qs[_0xa260('0x2f')](_0x48891b[_0xa260('0x2b')][_0xa260('0x2f')]));_0x45ec9f[_0xa260('0x2e')]=_0x45ec9f[_0xa260('0x2e')][_0xa260('0x30')]?_0x45ec9f[_0xa260('0x2e')]:_0x34c594['model'];if(_0x48891b[_0xa260('0x2b')]['includeAll']){_0x45ec9f[_0xa260('0x3e')]=[{'all':!![]}];}_0x45ec9f=_[_0xa260('0x3c')]({},_0x45ec9f,_0x48891b[_0xa260('0x42')]);return db['MailQueueReport'][_0xa260('0x43')](_0x45ec9f)[_0xa260('0x22')](handleEntityNotFound(_0x597f60,null))[_0xa260('0x22')](respondWithResult(_0x597f60,null))[_0xa260('0x3f')](handleError(_0x597f60,null));};exports[_0xa260('0x44')]=function(_0x4d1c47,_0x43fbcf){return db['MailQueueReport'][_0xa260('0x44')](_0x4d1c47[_0xa260('0x45')],{})[_0xa260('0x22')](respondWithResult(_0x43fbcf,0xc9))[_0xa260('0x3f')](handleError(_0x43fbcf,null));};exports['update']=function(_0x43c25e,_0x4095fb){if(_0x43c25e[_0xa260('0x45')]['id']){delete _0x43c25e[_0xa260('0x45')]['id'];}return db[_0xa260('0x3d')][_0xa260('0x43')]({'where':{'id':_0x43c25e[_0xa260('0x41')]['id']}})[_0xa260('0x22')](handleEntityNotFound(_0x4095fb,null))['then'](saveUpdates(_0x43c25e[_0xa260('0x45')],null))['then'](respondWithResult(_0x4095fb,null))['catch'](handleError(_0x4095fb,null));};exports[_0xa260('0x46')]=function(_0x28b55b,_0x58c517){return db[_0xa260('0x3d')]['find']({'where':{'id':_0x28b55b['params']['id']}})['then'](handleEntityNotFound(_0x58c517,null))[_0xa260('0x22')](removeEntity(_0x58c517,null))[_0xa260('0x3f')](handleError(_0x58c517,null));};exports[_0xa260('0x47')]=function(_0x46b268,_0x3a535c){return db[_0xa260('0x3d')][_0xa260('0x47')]()[_0xa260('0x22')](respondWithResult(_0x3a535c,null))[_0xa260('0x3f')](handleError(_0x3a535c,null));}; \ No newline at end of file +var _0xb9f9=['where','pick','filter','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','params','rawAttributes','catch','create','update','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','error','stack','name','index','MailQueueReport','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort'];(function(_0x5f1955,_0x15f0a5){var _0x1274c1=function(_0x39d84e){while(--_0x39d84e){_0x5f1955['push'](_0x5f1955['shift']());}};_0x1274c1(++_0x15f0a5);}(_0xb9f9,0x186));var _0x9b9f=function(_0x4c5100,_0x239163){_0x4c5100=_0x4c5100-0x0;var _0x1c2d75=_0xb9f9[_0x4c5100];return _0x1c2d75;};'use strict';var pdf=require(_0x9b9f('0x0'));var emlformat=require(_0x9b9f('0x1'));var rimraf=require(_0x9b9f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b9f('0x3'));var rp=require('request-promise');var moment=require(_0x9b9f('0x4'));var BPromise=require(_0x9b9f('0x5'));var Mustache=require(_0x9b9f('0x6'));var util=require(_0x9b9f('0x7'));var path=require(_0x9b9f('0x8'));var sox=require(_0x9b9f('0x9'));var csv=require(_0x9b9f('0xa'));var ejs=require(_0x9b9f('0xb'));var fs=require('fs');var _=require(_0x9b9f('0xc'));var squel=require(_0x9b9f('0xd'));var crypto=require('crypto');var jsforce=require(_0x9b9f('0xe'));var deskjs=require(_0x9b9f('0xf'));var toCsv=require(_0x9b9f('0xa'));var querystring=require(_0x9b9f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9b9f('0x11'));var authService=require(_0x9b9f('0x12'));var qs=require(_0x9b9f('0x13'));var hardwareService=require(_0x9b9f('0x14'));var logger=require('../../config/logger')(_0x9b9f('0x15'));var utils=require(_0x9b9f('0x16'));var config=require(_0x9b9f('0x17'));var db=require(_0x9b9f('0x18'))['db'];function respondWithStatusCode(_0x45d753,_0x58c705){_0x58c705=_0x58c705||0xcc;return function(_0x268e3e){if(_0x268e3e){return _0x45d753['sendStatus'](_0x58c705);}return _0x45d753[_0x9b9f('0x19')](_0x58c705)[_0x9b9f('0x1a')]();};}function respondWithResult(_0x426e51,_0x4d55ae){_0x4d55ae=_0x4d55ae||0xc8;return function(_0x4451f3){if(_0x4451f3){return _0x426e51[_0x9b9f('0x19')](_0x4d55ae)[_0x9b9f('0x1b')](_0x4451f3);}};}function respondWithFilteredResult(_0x19f4fb,_0x19f998){return function(_0x63b2f2){if(_0x63b2f2){var _0x1130bd=_0x63b2f2[_0x9b9f('0x1c')],_0xae44ab=_0x19f998['offset'],_0x18d6ce=_0x19f998[_0x9b9f('0x1d')]+_0x19f998['limit'],_0x515cf3;if(_0x18d6ce>=_0x1130bd){_0x18d6ce=_0x1130bd;_0x515cf3=0xc8;}else{_0x515cf3=0xce;}_0x19f4fb[_0x9b9f('0x19')](_0x515cf3);return _0x19f4fb[_0x9b9f('0x1e')](_0x9b9f('0x1f'),_0xae44ab+'-'+_0x18d6ce+'/'+_0x1130bd)[_0x9b9f('0x1b')](_0x63b2f2);}return null;};}function patchUpdates(_0x192fd6){return function(_0x8a69af){try{jsonpatch['apply'](_0x8a69af,_0x192fd6,!![]);}catch(_0x435fc4){return BPromise[_0x9b9f('0x20')](_0x435fc4);}return _0x8a69af[_0x9b9f('0x21')]();};}function saveUpdates(_0x1baafd,_0x1a004a){return function(_0x2fb029){if(_0x2fb029){return _0x2fb029['update'](_0x1baafd)[_0x9b9f('0x22')](function(_0x45939d){return _0x45939d;});}return null;};}function removeEntity(_0x441641,_0x47b579){return function(_0x2a2393){if(_0x2a2393){return _0x2a2393[_0x9b9f('0x23')]()['then'](function(){_0x441641['status'](0xcc)[_0x9b9f('0x1a')]();});}};}function handleEntityNotFound(_0x38b5ac,_0x204d28){return function(_0x21083b){if(!_0x21083b){_0x38b5ac[_0x9b9f('0x24')](0x194);}return _0x21083b;};}function handleError(_0x7e398b,_0x3feed3){_0x3feed3=_0x3feed3||0x1f4;return function(_0x2c5cd0){logger[_0x9b9f('0x25')](_0x2c5cd0[_0x9b9f('0x26')]);if(_0x2c5cd0[_0x9b9f('0x27')]){delete _0x2c5cd0[_0x9b9f('0x27')];}_0x7e398b[_0x9b9f('0x19')](_0x3feed3)['send'](_0x2c5cd0);};}exports[_0x9b9f('0x28')]=function(_0xe48bc8,_0x358cf9){var _0x27427d={},_0x346f08={},_0x13b118={'count':0x0,'rows':[]};var _0x6320f0=db[_0x9b9f('0x29')]['rawAttributes'];_0x346f08[_0x9b9f('0x2a')]=_['keys'](_0x6320f0);_0x346f08[_0x9b9f('0x2b')]=_[_0x9b9f('0x2c')](_0xe48bc8[_0x9b9f('0x2b')]);_0x346f08[_0x9b9f('0x2d')]=_['intersection'](_0x346f08[_0x9b9f('0x2a')],_0x346f08[_0x9b9f('0x2b')]);_0x27427d[_0x9b9f('0x2e')]=_[_0x9b9f('0x2f')](_0x346f08['model'],qs[_0x9b9f('0x30')](_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x30')]));_0x27427d[_0x9b9f('0x2e')]=_0x27427d[_0x9b9f('0x2e')][_0x9b9f('0x31')]?_0x27427d[_0x9b9f('0x2e')]:_0x346f08['model'];if(!_0xe48bc8[_0x9b9f('0x2b')]['hasOwnProperty'](_0x9b9f('0x32'))){_0x27427d['limit']=qs[_0x9b9f('0x33')](_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x33')]);_0x27427d[_0x9b9f('0x1d')]=qs[_0x9b9f('0x1d')](_0xe48bc8[_0x9b9f('0x2b')]['offset']);}_0x27427d[_0x9b9f('0x34')]=qs[_0x9b9f('0x35')](_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x35')]);_0x27427d[_0x9b9f('0x36')]=qs['filters'](_[_0x9b9f('0x37')](_0xe48bc8['query'],_0x346f08[_0x9b9f('0x2d')]));if(_0xe48bc8['query'][_0x9b9f('0x38')]){_0x27427d[_0x9b9f('0x36')]=_[_0x9b9f('0x39')](_0x27427d[_0x9b9f('0x36')],{'$or':_[_0x9b9f('0x3a')](_0x6320f0,function(_0x5e59a3){if(_0x5e59a3[_0x9b9f('0x3b')]['key']!==_0x9b9f('0x3c')){var _0x3f700b={};_0x3f700b[_0x5e59a3[_0x9b9f('0x3d')]]={'$like':'%'+_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x38')]+'%'};return _0x3f700b;}})});}_0x27427d=_[_0x9b9f('0x39')]({},_0x27427d,_0xe48bc8[_0x9b9f('0x3e')]);var _0x521556={'where':_0x27427d[_0x9b9f('0x36')]};return db['MailQueueReport'][_0x9b9f('0x1c')](_0x521556)[_0x9b9f('0x22')](function(_0x44d9c6){_0x13b118['count']=_0x44d9c6;if(_0xe48bc8[_0x9b9f('0x2b')][_0x9b9f('0x3f')]){_0x27427d[_0x9b9f('0x40')]=[{'all':!![]}];}return db[_0x9b9f('0x29')]['findAll'](_0x27427d);})['then'](function(_0x316cc9){_0x13b118[_0x9b9f('0x41')]=_0x316cc9;return _0x13b118;})['then'](respondWithFilteredResult(_0x358cf9,_0x27427d))['catch'](handleError(_0x358cf9,null));};exports['show']=function(_0x1bbf8f,_0x41de3e){var _0x13fe6f={'raw':!![],'where':{'id':_0x1bbf8f[_0x9b9f('0x42')]['id']}},_0x5ce871={};_0x5ce871['model']=_[_0x9b9f('0x2c')](db['MailQueueReport'][_0x9b9f('0x43')]);_0x5ce871[_0x9b9f('0x2b')]=_[_0x9b9f('0x2c')](_0x1bbf8f[_0x9b9f('0x2b')]);_0x5ce871[_0x9b9f('0x2d')]=_['intersection'](_0x5ce871[_0x9b9f('0x2a')],_0x5ce871['query']);_0x13fe6f[_0x9b9f('0x2e')]=_[_0x9b9f('0x2f')](_0x5ce871['model'],qs[_0x9b9f('0x30')](_0x1bbf8f['query'][_0x9b9f('0x30')]));_0x13fe6f[_0x9b9f('0x2e')]=_0x13fe6f[_0x9b9f('0x2e')][_0x9b9f('0x31')]?_0x13fe6f['attributes']:_0x5ce871['model'];if(_0x1bbf8f[_0x9b9f('0x2b')][_0x9b9f('0x3f')]){_0x13fe6f[_0x9b9f('0x40')]=[{'all':!![]}];}_0x13fe6f=_[_0x9b9f('0x39')]({},_0x13fe6f,_0x1bbf8f[_0x9b9f('0x3e')]);return db['MailQueueReport']['find'](_0x13fe6f)[_0x9b9f('0x22')](handleEntityNotFound(_0x41de3e,null))[_0x9b9f('0x22')](respondWithResult(_0x41de3e,null))[_0x9b9f('0x44')](handleError(_0x41de3e,null));};exports[_0x9b9f('0x45')]=function(_0x48fbc2,_0x5cee0f){return db['MailQueueReport'][_0x9b9f('0x45')](_0x48fbc2['body'],{})[_0x9b9f('0x22')](respondWithResult(_0x5cee0f,0xc9))[_0x9b9f('0x44')](handleError(_0x5cee0f,null));};exports[_0x9b9f('0x46')]=function(_0x4b95c2,_0x5de0c2){if(_0x4b95c2['body']['id']){delete _0x4b95c2[_0x9b9f('0x47')]['id'];}return db[_0x9b9f('0x29')][_0x9b9f('0x48')]({'where':{'id':_0x4b95c2[_0x9b9f('0x42')]['id']}})[_0x9b9f('0x22')](handleEntityNotFound(_0x5de0c2,null))['then'](saveUpdates(_0x4b95c2[_0x9b9f('0x47')],null))[_0x9b9f('0x22')](respondWithResult(_0x5de0c2,null))[_0x9b9f('0x44')](handleError(_0x5de0c2,null));};exports['destroy']=function(_0x5062d2,_0x163211){return db[_0x9b9f('0x29')]['find']({'where':{'id':_0x5062d2[_0x9b9f('0x42')]['id']}})[_0x9b9f('0x22')](handleEntityNotFound(_0x163211,null))[_0x9b9f('0x22')](removeEntity(_0x163211,null))['catch'](handleError(_0x163211,null));};exports['describe']=function(_0x423de8,_0x2082fb){return db[_0x9b9f('0x29')][_0x9b9f('0x49')]()[_0x9b9f('0x22')](respondWithResult(_0x2082fb,null))['catch'](handleError(_0x2082fb,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 5777a81..2df4829 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 _0xfe9d=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x499b24,_0x2fb32c){var _0x6ddcc0=function(_0x39c3b2){while(--_0x39c3b2){_0x499b24['push'](_0x499b24['shift']());}};_0x6ddcc0(++_0x2fb32c);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x56e489,_0x51fc53){_0x56e489=_0x56e489-0x0;var _0x5c121c=_0xfe9d[_0x56e489];return _0x5c121c;};'use strict';var _=require(_0xdfe9('0x0'));var util=require(_0xdfe9('0x1'));var logger=require(_0xdfe9('0x2'))(_0xdfe9('0x3'));var moment=require(_0xdfe9('0x4'));var BPromise=require('bluebird');var rp=require(_0xdfe9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdfe9('0x6'));var config=require(_0xdfe9('0x7'));var attributes=require(_0xdfe9('0x8'));module[_0xdfe9('0x9')]=function(_0xeb5238,_0x582904){return _0xeb5238['define'](_0xdfe9('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xdfe9('0xb'),'fields':[_0xdfe9('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe493=['path','../../config/environment','exports','define','MailQueueReport','report_mail_queue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x55b745,_0x36e0fa){var _0x1772a7=function(_0x2bf1e3){while(--_0x2bf1e3){_0x55b745['push'](_0x55b745['shift']());}};_0x1772a7(++_0x36e0fa);}(_0xe493,0x7e));var _0x3e49=function(_0x108c67,_0xdc716f){_0x108c67=_0x108c67-0x0;var _0xd4b72=_0xe493[_0x108c67];return _0xd4b72;};'use strict';var _=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var logger=require(_0x3e49('0x2'))(_0x3e49('0x3'));var moment=require(_0x3e49('0x4'));var BPromise=require('bluebird');var rp=require(_0x3e49('0x5'));var fs=require('fs');var path=require(_0x3e49('0x6'));var rimraf=require('rimraf');var config=require(_0x3e49('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x3e49('0x8')]=function(_0x2e79b6,_0x24f15c){return _0x2e79b6[_0x3e49('0x9')](_0x3e49('0xa'),attributes,{'tableName':_0x3e49('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3d29267..36ee2fc 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 _0xf626=['update','attributes','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','MailQueueReport','create','body','options','raw','CreateMailQueueReport','catch','UpdateMailQueueReport'];(function(_0x467165,_0x57a154){var _0x130cc5=function(_0x2e295e){while(--_0x2e295e){_0x467165['push'](_0x467165['shift']());}};_0x130cc5(++_0x57a154);}(_0xf626,0x123));var _0x6f62=function(_0x403db1,_0x59018e){_0x403db1=_0x403db1-0x0;var _0x47c48f=_0xf626[_0x403db1];return _0x47c48f;};'use strict';var _=require(_0x6f62('0x0'));var util=require(_0x6f62('0x1'));var moment=require(_0x6f62('0x2'));var BPromise=require(_0x6f62('0x3'));var rs=require(_0x6f62('0x4'));var fs=require('fs');var Redis=require(_0x6f62('0x5'));var db=require(_0x6f62('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6f62('0x7'))('rpc');var config=require(_0x6f62('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6f62('0x9')][_0x6f62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bceee,_0x1cba08,_0x3e4b60){return new BPromise(function(_0xefac2e,_0x2d8cf5){return client[_0x6f62('0xb')](_0x4bceee,_0x3e4b60)['then'](function(_0x53c0e2){logger[_0x6f62('0xc')](_0x6f62('0xd'),_0x1cba08,_0x6f62('0xe'));logger[_0x6f62('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x1cba08,_0x6f62('0xe'),JSON[_0x6f62('0x10')](_0x53c0e2));if(_0x53c0e2[_0x6f62('0x11')]){if(_0x53c0e2[_0x6f62('0x11')][_0x6f62('0x12')]===0x1f4){logger['error'](_0x6f62('0xd'),_0x1cba08,_0x53c0e2[_0x6f62('0x11')]['message']);return _0x2d8cf5(_0x53c0e2[_0x6f62('0x11')][_0x6f62('0x13')]);}logger[_0x6f62('0x11')](_0x6f62('0xd'),_0x1cba08,_0x53c0e2[_0x6f62('0x11')][_0x6f62('0x13')]);return _0xefac2e(_0x53c0e2['error']['message']);}else{logger[_0x6f62('0xc')](_0x6f62('0xd'),_0x1cba08,'request\x20sent');_0xefac2e(_0x53c0e2[_0x6f62('0x14')]['message']);}})['catch'](function(_0x2caf15){logger['error'](_0x6f62('0xd'),_0x1cba08,_0x2caf15);_0x2d8cf5(_0x2caf15);});});}exports['CreateMailQueueReport']=function(_0x3be2d7){var _0x5b4d20=this;return new Promise(function(_0xcf44ac,_0x2d7dea){return db[_0x6f62('0x15')][_0x6f62('0x16')](_0x3be2d7[_0x6f62('0x17')],{'raw':_0x3be2d7['options']?_0x3be2d7[_0x6f62('0x18')][_0x6f62('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x184e71){logger[_0x6f62('0xc')]('CreateMailQueueReport',_0x3be2d7);logger['debug'](_0x6f62('0x1a'),_0x3be2d7,JSON[_0x6f62('0x10')](_0x184e71));_0xcf44ac(_0x184e71);})[_0x6f62('0x1b')](function(_0x1a305d){logger[_0x6f62('0x11')](_0x6f62('0x1a'),_0x1a305d[_0x6f62('0x13')],_0x3be2d7);_0x2d7dea(_0x5b4d20[_0x6f62('0x11')](0x1f4,_0x1a305d[_0x6f62('0x13')]));});});};exports[_0x6f62('0x1c')]=function(_0x126fb8){var _0x243211=this;return new Promise(function(_0x35bfb3,_0x46da19){return db['MailQueueReport'][_0x6f62('0x1d')](_0x126fb8[_0x6f62('0x17')],{'raw':_0x126fb8[_0x6f62('0x18')]?_0x126fb8[_0x6f62('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x126fb8[_0x6f62('0x18')]?_0x126fb8[_0x6f62('0x18')]['where']||null:null,'attributes':_0x126fb8[_0x6f62('0x18')]?_0x126fb8[_0x6f62('0x18')][_0x6f62('0x1e')]||null:null,'limit':_0x126fb8[_0x6f62('0x18')]?_0x126fb8[_0x6f62('0x18')]['limit']||null:null})[_0x6f62('0x1f')](function(_0xca85eb){logger[_0x6f62('0xc')](_0x6f62('0x1c'),_0x126fb8);logger[_0x6f62('0xf')]('UpdateMailQueueReport',_0x126fb8,JSON['stringify'](_0xca85eb));_0x35bfb3(_0xca85eb);})[_0x6f62('0x1b')](function(_0x672a51){logger[_0x6f62('0x11')]('UpdateMailQueueReport',_0x672a51['message'],_0x126fb8);_0x46da19(_0x243211['error'](0x1f4,_0x672a51['message']));});});}; \ No newline at end of file +var _0xbad1=['request\x20sent','stringify','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbad1,0x147));var _0x1bad=function(_0x51a9c8,_0x1e0917){_0x51a9c8=_0x51a9c8-0x0;var _0x5d8b7f=_0xbad1[_0x51a9c8];return _0x5d8b7f;};'use strict';var _=require(_0x1bad('0x0'));var util=require('util');var moment=require(_0x1bad('0x1'));var BPromise=require(_0x1bad('0x2'));var rs=require(_0x1bad('0x3'));var fs=require('fs');var Redis=require(_0x1bad('0x4'));var db=require(_0x1bad('0x5'))['db'];var utils=require(_0x1bad('0x6'));var logger=require(_0x1bad('0x7'))('rpc');var config=require(_0x1bad('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1bad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b9dc1,_0x2ab7f9,_0x4d166b){return new BPromise(function(_0xdfbdce,_0x15732c){return client['request'](_0x4b9dc1,_0x4d166b)[_0x1bad('0xa')](function(_0x3a620f){logger['info'](_0x1bad('0xb'),_0x2ab7f9,'request\x20sent');logger[_0x1bad('0xc')](_0x1bad('0xd'),_0x2ab7f9,_0x1bad('0xe'),JSON[_0x1bad('0xf')](_0x3a620f));if(_0x3a620f[_0x1bad('0x10')]){if(_0x3a620f['error'][_0x1bad('0x11')]===0x1f4){logger[_0x1bad('0x10')]('MailQueueReport,\x20%s,\x20%s',_0x2ab7f9,_0x3a620f['error'][_0x1bad('0x12')]);return _0x15732c(_0x3a620f['error'][_0x1bad('0x12')]);}logger['error'](_0x1bad('0xb'),_0x2ab7f9,_0x3a620f[_0x1bad('0x10')][_0x1bad('0x12')]);return _0xdfbdce(_0x3a620f[_0x1bad('0x10')][_0x1bad('0x12')]);}else{logger[_0x1bad('0x13')]('MailQueueReport,\x20%s,\x20%s',_0x2ab7f9,_0x1bad('0xe'));_0xdfbdce(_0x3a620f['result'][_0x1bad('0x12')]);}})[_0x1bad('0x14')](function(_0x29cefb){logger[_0x1bad('0x10')](_0x1bad('0xb'),_0x2ab7f9,_0x29cefb);_0x15732c(_0x29cefb);});});}exports[_0x1bad('0x15')]=function(_0x32d81c){var _0x2d8669=this;return new Promise(function(_0x386d94,_0x2ec5b6){return db[_0x1bad('0x16')][_0x1bad('0x17')](_0x32d81c[_0x1bad('0x18')],{'raw':_0x32d81c[_0x1bad('0x19')]?_0x32d81c[_0x1bad('0x19')][_0x1bad('0x1a')]===undefined?!![]:![]:!![]})[_0x1bad('0xa')](function(_0xa42164){logger['info']('CreateMailQueueReport',_0x32d81c);logger[_0x1bad('0xc')]('CreateMailQueueReport',_0x32d81c,JSON['stringify'](_0xa42164));_0x386d94(_0xa42164);})[_0x1bad('0x14')](function(_0x230f72){logger[_0x1bad('0x10')]('CreateMailQueueReport',_0x230f72[_0x1bad('0x12')],_0x32d81c);_0x2ec5b6(_0x2d8669[_0x1bad('0x10')](0x1f4,_0x230f72['message']));});});};exports[_0x1bad('0x1b')]=function(_0x5165e6){var _0x49effa=this;return new Promise(function(_0x233207,_0x274a2a){return db['MailQueueReport']['update'](_0x5165e6[_0x1bad('0x18')],{'raw':_0x5165e6[_0x1bad('0x19')]?_0x5165e6[_0x1bad('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5165e6['options']?_0x5165e6[_0x1bad('0x19')][_0x1bad('0x1c')]||null:null,'attributes':_0x5165e6[_0x1bad('0x19')]?_0x5165e6['options'][_0x1bad('0x1d')]||null:null,'limit':_0x5165e6[_0x1bad('0x19')]?_0x5165e6['options'][_0x1bad('0x1e')]||null:null})['then'](function(_0x285543){logger['info'](_0x1bad('0x1b'),_0x5165e6);logger[_0x1bad('0xc')](_0x1bad('0x1b'),_0x5165e6,JSON[_0x1bad('0xf')](_0x285543));_0x233207(_0x285543);})[_0x1bad('0x14')](function(_0x24ed7e){logger[_0x1bad('0x10')](_0x1bad('0x1b'),_0x24ed7e['message'],_0x5165e6);_0x274a2a(_0x49effa[_0x1bad('0x10')](0x1f4,_0x24ed7e[_0x1bad('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index e9170eb..c214ed4 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 _0x41d0=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','Router'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x41d0,0x1c6));var _0x041d=function(_0x35b4b0,_0x1912ac){_0x35b4b0=_0x35b4b0-0x0;var _0x29935d=_0x41d0[_0x35b4b0];return _0x29935d;};'use strict';var multer=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var path=require(_0x041d('0x2'));var timeout=require(_0x041d('0x3'));var express=require('express');var router=express[_0x041d('0x4')]();var auth=require(_0x041d('0x5'));var interaction=require(_0x041d('0x6'));var config=require(_0x041d('0x7'));module[_0x041d('0x8')]=router; \ No newline at end of file +var _0xc4aa=['path','connect-timeout','express','Router','exports','multer','util'];(function(_0x2b9f8b,_0x404ea5){var _0x58d615=function(_0x1f117a){while(--_0x1f117a){_0x2b9f8b['push'](_0x2b9f8b['shift']());}};_0x58d615(++_0x404ea5);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xc4aa[_0x5a776b];return _0xbbef59;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xac4a('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 00644b9..32c9457 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 _0xeb74=['username','INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x395b9c,_0x3f2a61){var _0x490ee9=function(_0xd6f98f){while(--_0xd6f98f){_0x395b9c['push'](_0x395b9c['shift']());}};_0x490ee9(++_0x3f2a61);}(_0xeb74,0xe3));var _0x4eb7=function(_0x33481e,_0x2acd58){_0x33481e=_0x33481e-0x0;var _0x30a1a0=_0xeb74[_0x33481e];return _0x30a1a0;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'description':{'type':Sequelize[_0x4eb7('0x2')]},'host':{'type':Sequelize[_0x4eb7('0x2')]},'authentication':{'type':Sequelize[_0x4eb7('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x4eb7('0x2')],'unique':_0x4eb7('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x4eb7('0x5')]},'tls':{'type':Sequelize[_0x4eb7('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':_0x4eb7('0x6')},'connTimeout':{'type':Sequelize[_0x4eb7('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x4eb7('0x2')]}}; \ No newline at end of file +var _0xb7e7=['STRING','BOOLEAN','username','INTEGER','sequelize'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xb7e7[_0x34843e];return _0x598f7f;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':_0x7b7e('0x3')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7b7e('0x4')]},'tls':{'type':Sequelize[_0x7b7e('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7b7e('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 44a103a..c08bae5 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 _0xf866=['MailServerIn','mail_servers_in','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x2faf6e,_0x4499f0){var _0x44319f=function(_0x37df7d){while(--_0x37df7d){_0x2faf6e['push'](_0x2faf6e['shift']());}};_0x44319f(++_0x4499f0);}(_0xf866,0xb8));var _0x6f86=function(_0x588f1b,_0x3a6af5){_0x588f1b=_0x588f1b-0x0;var _0x43846d=_0xf866[_0x588f1b];return _0x43846d;};'use strict';var _=require(_0x6f86('0x0'));var util=require('util');var logger=require(_0x6f86('0x1'))(_0x6f86('0x2'));var moment=require('moment');var BPromise=require(_0x6f86('0x3'));var rp=require(_0x6f86('0x4'));var fs=require('fs');var path=require(_0x6f86('0x5'));var rimraf=require(_0x6f86('0x6'));var config=require(_0x6f86('0x7'));var attributes=require(_0x6f86('0x8'));module[_0x6f86('0x9')]=function(_0x3e47be,_0x38d3c2){return _0x3e47be[_0x6f86('0xa')](_0x6f86('0xb'),attributes,{'tableName':_0x6f86('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7833=['MailServerIn','mail_servers_in','lodash','util','api','bluebird','request-promise','path','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x5af978,_0x3a2a2f){var _0x3ec596=function(_0x1530d4){while(--_0x1530d4){_0x5af978['push'](_0x5af978['shift']());}};_0x3ec596(++_0x3a2a2f);}(_0x7833,0x1d6));var _0x3783=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x7833[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x3783('0x0'));var util=require(_0x3783('0x1'));var logger=require('../../config/logger')(_0x3783('0x2'));var moment=require('moment');var BPromise=require(_0x3783('0x3'));var rp=require(_0x3783('0x4'));var fs=require('fs');var path=require(_0x3783('0x5'));var rimraf=require('rimraf');var config=require(_0x3783('0x6'));var attributes=require(_0x3783('0x7'));module[_0x3783('0x8')]=function(_0x214860,_0x1f1887){return _0x214860[_0x3783('0x9')](_0x3783('0xa'),attributes,{'tableName':_0x3783('0xb'),'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 0445823..f3676df 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 _0xf53d=['attributes','debug','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','include','map','model'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xf53d,0xb0));var _0xdf53=function(_0x35e600,_0x3a7825){_0x35e600=_0x35e600-0x0;var _0x1d3e38=_0xf53d[_0x35e600];return _0x1d3e38;};'use strict';var _=require(_0xdf53('0x0'));var util=require(_0xdf53('0x1'));var moment=require('moment');var BPromise=require(_0xdf53('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdf53('0x3'));var logger=require(_0xdf53('0x4'))(_0xdf53('0x5'));var config=require(_0xdf53('0x6'));var jayson=require(_0xdf53('0x7'));var client=jayson[_0xdf53('0x8')][_0xdf53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d76c4,_0x4e5a95,_0x20bf8d){return new BPromise(function(_0x4232fc,_0x210e1f){return client[_0xdf53('0xa')](_0x1d76c4,_0x20bf8d)[_0xdf53('0xb')](function(_0x5b9421){logger[_0xdf53('0xc')](_0xdf53('0xd'),_0x4e5a95,'request\x20sent');logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x4e5a95,_0xdf53('0xe'),JSON[_0xdf53('0xf')](_0x5b9421));if(_0x5b9421[_0xdf53('0x10')]){if(_0x5b9421['error']['code']===0x1f4){logger[_0xdf53('0x10')](_0xdf53('0xd'),_0x4e5a95,_0x5b9421['error'][_0xdf53('0x11')]);return _0x210e1f(_0x5b9421[_0xdf53('0x10')][_0xdf53('0x11')]);}logger[_0xdf53('0x10')]('MailServerIn,\x20%s,\x20%s',_0x4e5a95,_0x5b9421['error']['message']);return _0x4232fc(_0x5b9421['error'][_0xdf53('0x11')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x4e5a95,_0xdf53('0xe'));_0x4232fc(_0x5b9421[_0xdf53('0x12')]['message']);}})[_0xdf53('0x13')](function(_0x549d57){logger['error'](_0xdf53('0xd'),_0x4e5a95,_0x549d57);_0x210e1f(_0x549d57);});});}exports[_0xdf53('0x14')]=function(_0x21a9ed){var _0x5543ad=this;return new Promise(function(_0x410eb9,_0x4aec73){return db[_0xdf53('0x15')][_0xdf53('0x16')]({'raw':_0x21a9ed[_0xdf53('0x17')]?_0x21a9ed[_0xdf53('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x21a9ed[_0xdf53('0x17')]?_0x21a9ed[_0xdf53('0x17')]['where']||null:null,'attributes':_0x21a9ed[_0xdf53('0x17')]?_0x21a9ed[_0xdf53('0x17')]['attributes']||null:null,'limit':_0x21a9ed[_0xdf53('0x17')]?_0x21a9ed[_0xdf53('0x17')]['limit']||null:null,'include':_0x21a9ed[_0xdf53('0x17')]?_0x21a9ed[_0xdf53('0x17')][_0xdf53('0x18')]?_[_0xdf53('0x19')](_0x21a9ed[_0xdf53('0x17')][_0xdf53('0x18')],function(_0x13f783){return{'model':db[_0x13f783[_0xdf53('0x1a')]],'as':_0x13f783['as'],'attributes':_0x13f783[_0xdf53('0x1b')],'include':_0x13f783[_0xdf53('0x18')]?_['map'](_0x13f783[_0xdf53('0x18')],function(_0x3d7557){return{'model':db[_0x3d7557[_0xdf53('0x1a')]],'as':_0x3d7557['as'],'attributes':_0x3d7557['attributes'],'include':_0x3d7557[_0xdf53('0x18')]?_['map'](_0x3d7557['include'],function(_0x38b81e){return{'model':db[_0x38b81e[_0xdf53('0x1a')]],'as':_0x38b81e['as'],'attributes':_0x38b81e[_0xdf53('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdf53('0xb')](function(_0x2e070a){logger['info'](_0xdf53('0x14'),_0x21a9ed);logger[_0xdf53('0x1c')]('GetMailServerIn',_0x21a9ed,JSON['stringify'](_0x2e070a));_0x410eb9(_0x2e070a);})[_0xdf53('0x13')](function(_0x53855c){logger['error'](_0xdf53('0x14'),_0x53855c[_0xdf53('0x11')],_0x21a9ed);_0x4aec73(_0x5543ad[_0xdf53('0x10')](0x1f4,_0x53855c[_0xdf53('0x11')]));});});}; \ No newline at end of file +var _0xebc3=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','include','model','map','stringify','util'];(function(_0x24e1ec,_0x43bf35){var _0x50f4d3=function(_0x1eeadf){while(--_0x1eeadf){_0x24e1ec['push'](_0x24e1ec['shift']());}};_0x50f4d3(++_0x43bf35);}(_0xebc3,0xb9));var _0x3ebc=function(_0x21180e,_0x6f75c3){_0x21180e=_0x21180e-0x0;var _0x47d472=_0xebc3[_0x21180e];return _0x47d472;};'use strict';var _=require('lodash');var util=require(_0x3ebc('0x0'));var moment=require(_0x3ebc('0x1'));var BPromise=require(_0x3ebc('0x2'));var rs=require(_0x3ebc('0x3'));var fs=require('fs');var Redis=require(_0x3ebc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ebc('0x5'));var logger=require(_0x3ebc('0x6'))('rpc');var config=require(_0x3ebc('0x7'));var jayson=require(_0x3ebc('0x8'));var client=jayson[_0x3ebc('0x9')][_0x3ebc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cd9a8,_0x34b4de,_0x1a00ef){return new BPromise(function(_0x4e03a6,_0x5ad39f){return client[_0x3ebc('0xb')](_0x5cd9a8,_0x1a00ef)[_0x3ebc('0xc')](function(_0x2f9233){logger['info'](_0x3ebc('0xd'),_0x34b4de,_0x3ebc('0xe'));logger[_0x3ebc('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x34b4de,_0x3ebc('0xe'),JSON['stringify'](_0x2f9233));if(_0x2f9233[_0x3ebc('0x10')]){if(_0x2f9233[_0x3ebc('0x10')]['code']===0x1f4){logger[_0x3ebc('0x10')](_0x3ebc('0xd'),_0x34b4de,_0x2f9233[_0x3ebc('0x10')][_0x3ebc('0x11')]);return _0x5ad39f(_0x2f9233[_0x3ebc('0x10')]['message']);}logger['error'](_0x3ebc('0xd'),_0x34b4de,_0x2f9233['error'][_0x3ebc('0x11')]);return _0x4e03a6(_0x2f9233[_0x3ebc('0x10')][_0x3ebc('0x11')]);}else{logger[_0x3ebc('0x12')]('MailServerIn,\x20%s,\x20%s',_0x34b4de,_0x3ebc('0xe'));_0x4e03a6(_0x2f9233[_0x3ebc('0x13')][_0x3ebc('0x11')]);}})[_0x3ebc('0x14')](function(_0x4882e4){logger[_0x3ebc('0x10')]('MailServerIn,\x20%s,\x20%s',_0x34b4de,_0x4882e4);_0x5ad39f(_0x4882e4);});});}exports[_0x3ebc('0x15')]=function(_0x5a5498){var _0xba9a9a=this;return new Promise(function(_0x4efe69,_0x3fc2f4){return db[_0x3ebc('0x16')]['findAll']({'raw':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498[_0x3ebc('0x17')][_0x3ebc('0x18')]===undefined?!![]:![]:!![],'where':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498[_0x3ebc('0x17')][_0x3ebc('0x19')]||null:null,'attributes':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498[_0x3ebc('0x17')][_0x3ebc('0x1a')]||null:null,'limit':_0x5a5498['options']?_0x5a5498[_0x3ebc('0x17')]['limit']||null:null,'include':_0x5a5498[_0x3ebc('0x17')]?_0x5a5498['options']['include']?_['map'](_0x5a5498['options'][_0x3ebc('0x1b')],function(_0x588afe){return{'model':db[_0x588afe[_0x3ebc('0x1c')]],'as':_0x588afe['as'],'attributes':_0x588afe['attributes'],'include':_0x588afe[_0x3ebc('0x1b')]?_['map'](_0x588afe['include'],function(_0x13da67){return{'model':db[_0x13da67[_0x3ebc('0x1c')]],'as':_0x13da67['as'],'attributes':_0x13da67['attributes'],'include':_0x13da67[_0x3ebc('0x1b')]?_[_0x3ebc('0x1d')](_0x13da67[_0x3ebc('0x1b')],function(_0x2d2f85){return{'model':db[_0x2d2f85[_0x3ebc('0x1c')]],'as':_0x2d2f85['as'],'attributes':_0x2d2f85['attributes']};}):[]};}):[]};}):[]:[]})[_0x3ebc('0xc')](function(_0x49915f){logger['info'](_0x3ebc('0x15'),_0x5a5498);logger[_0x3ebc('0xf')](_0x3ebc('0x15'),_0x5a5498,JSON[_0x3ebc('0x1e')](_0x49915f));_0x4efe69(_0x49915f);})[_0x3ebc('0x14')](function(_0x529d28){logger[_0x3ebc('0x10')](_0x3ebc('0x15'),_0x529d28[_0x3ebc('0x11')],_0x5a5498);_0x3fc2f4(_0xba9a9a[_0x3ebc('0x10')](0x1f4,_0x529d28[_0x3ebc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 9f6f9a2..df0ede1 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 _0x40da=['show','post','create','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./mailServerOut.controller','isAuthenticated','index','get','/:id'];(function(_0x13129d,_0x551008){var _0x32b0e6=function(_0xc8bd1a){while(--_0xc8bd1a){_0x13129d['push'](_0x13129d['shift']());}};_0x32b0e6(++_0x551008);}(_0x40da,0x9f));var _0xa40d=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x40da[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0xa40d('0x0'));var util=require(_0xa40d('0x1'));var path=require(_0xa40d('0x2'));var timeout=require(_0xa40d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xa40d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa40d('0x5'));var controller=require(_0xa40d('0x6'));router['get']('/',auth[_0xa40d('0x7')](),controller[_0xa40d('0x8')]);router[_0xa40d('0x9')](_0xa40d('0xa'),auth['isAuthenticated'](),controller[_0xa40d('0xb')]);router[_0xa40d('0xc')]('/',auth[_0xa40d('0x7')](),controller[_0xa40d('0xd')]);router['put'](_0xa40d('0xa'),auth[_0xa40d('0x7')](),controller[_0xa40d('0xe')]);router[_0xa40d('0xf')]('/:id',auth[_0xa40d('0x7')](),controller['destroy']);module[_0xa40d('0x10')]=router; \ No newline at end of file +var _0x3a26=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','put','/:id','update','delete','multer'];(function(_0x4452cb,_0x61bc73){var _0x5b429b=function(_0x11a568){while(--_0x11a568){_0x4452cb['push'](_0x4452cb['shift']());}};_0x5b429b(++_0x61bc73);}(_0x3a26,0x18f));var _0x63a2=function(_0x2f5411,_0x5059c8){_0x2f5411=_0x2f5411-0x0;var _0xf4e0ae=_0x3a26[_0x2f5411];return _0xf4e0ae;};'use strict';var multer=require(_0x63a2('0x0'));var util=require('util');var path=require(_0x63a2('0x1'));var timeout=require(_0x63a2('0x2'));var express=require('express');var router=express[_0x63a2('0x3')]();var auth=require(_0x63a2('0x4'));var interaction=require(_0x63a2('0x5'));var config=require(_0x63a2('0x6'));var controller=require('./mailServerOut.controller');router[_0x63a2('0x7')]('/',auth['isAuthenticated'](),controller[_0x63a2('0x8')]);router[_0x63a2('0x7')]('/:id',auth[_0x63a2('0x9')](),controller[_0x63a2('0xa')]);router[_0x63a2('0xb')]('/',auth[_0x63a2('0x9')](),controller['create']);router[_0x63a2('0xc')](_0x63a2('0xd'),auth['isAuthenticated'](),controller[_0x63a2('0xe')]);router[_0x63a2('0xf')](_0x63a2('0xd'),auth[_0x63a2('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 3430bda..a236134 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 _0x8aee=['INTEGER','BOOLEAN','sequelize','STRING'];(function(_0x5e85de,_0x38a3f6){var _0x13f453=function(_0x15f120){while(--_0x15f120){_0x5e85de['push'](_0x5e85de['shift']());}};_0x13f453(++_0x38a3f6);}(_0x8aee,0x102));var _0xe8ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8aee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe8ae('0x0'));module['exports']={'description':{'type':Sequelize[_0xe8ae('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xe8ae('0x1')]},'pass':{'type':Sequelize[_0xe8ae('0x1')]},'port':{'type':Sequelize[_0xe8ae('0x2')]},'secure':{'type':Sequelize[_0xe8ae('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xe8ae('0x1')]},'authentication':{'type':Sequelize[_0xe8ae('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x24b6=['exports','STRING','INTEGER','sequelize'];(function(_0x7f82c7,_0x2bec9d){var _0xccd46=function(_0x14083a){while(--_0x14083a){_0x7f82c7['push'](_0x7f82c7['shift']());}};_0xccd46(++_0x2bec9d);}(_0x24b6,0x7f));var _0x624b=function(_0x50e681,_0x5e3c70){_0x50e681=_0x50e681-0x0;var _0x12f126=_0x24b6[_0x50e681];return _0x12f126;};'use strict';var Sequelize=require(_0x624b('0x0'));module[_0x624b('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x624b('0x2')]},'pass':{'type':Sequelize[_0x624b('0x2')]},'port':{'type':Sequelize[_0x624b('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x624b('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 5f9a45e..6d7f96d 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 _0xfba7=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','MailServerOut','rawAttributes','model','query','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','key','VIRTUAL','field','options','includeAll','include','rows','catch','keys','intersection','find','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xfba7,0xc5));var _0x7fba=function(_0x34ef4a,_0x2902af){_0x34ef4a=_0x34ef4a-0x0;var _0x29d48c=_0xfba7[_0x34ef4a];return _0x29d48c;};'use strict';var pdf=require(_0x7fba('0x0'));var emlformat=require(_0x7fba('0x1'));var rimraf=require(_0x7fba('0x2'));var zipdir=require(_0x7fba('0x3'));var jsonpatch=require(_0x7fba('0x4'));var rp=require(_0x7fba('0x5'));var moment=require(_0x7fba('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7fba('0x7'));var util=require(_0x7fba('0x8'));var path=require(_0x7fba('0x9'));var sox=require(_0x7fba('0xa'));var csv=require(_0x7fba('0xb'));var ejs=require(_0x7fba('0xc'));var fs=require('fs');var _=require(_0x7fba('0xd'));var squel=require(_0x7fba('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7fba('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7fba('0x10'));var Papa=require(_0x7fba('0x11'));var Redis=require('ioredis');var authService=require(_0x7fba('0x12'));var qs=require(_0x7fba('0x13'));var hardwareService=require(_0x7fba('0x14'));var logger=require(_0x7fba('0x15'))(_0x7fba('0x16'));var utils=require('../../config/utils');var config=require(_0x7fba('0x17'));var db=require(_0x7fba('0x18'))['db'];function respondWithStatusCode(_0x571f17,_0x56131f){_0x56131f=_0x56131f||0xcc;return function(_0x9f6374){if(_0x9f6374){return _0x571f17[_0x7fba('0x19')](_0x56131f);}return _0x571f17[_0x7fba('0x1a')](_0x56131f)[_0x7fba('0x1b')]();};}function respondWithResult(_0x10c856,_0x4e81c8){_0x4e81c8=_0x4e81c8||0xc8;return function(_0x55d9f0){if(_0x55d9f0){return _0x10c856[_0x7fba('0x1a')](_0x4e81c8)[_0x7fba('0x1c')](_0x55d9f0);}};}function respondWithFilteredResult(_0x5b9e62,_0x44b280){return function(_0x290544){if(_0x290544){var _0x4c5bf6=_0x290544[_0x7fba('0x1d')],_0x3463d3=_0x44b280[_0x7fba('0x1e')],_0x2a4d82=_0x44b280['offset']+_0x44b280[_0x7fba('0x1f')],_0x357477;if(_0x2a4d82>=_0x4c5bf6){_0x2a4d82=_0x4c5bf6;_0x357477=0xc8;}else{_0x357477=0xce;}_0x5b9e62['status'](_0x357477);return _0x5b9e62['set'](_0x7fba('0x20'),_0x3463d3+'-'+_0x2a4d82+'/'+_0x4c5bf6)['json'](_0x290544);}return null;};}function patchUpdates(_0x128f0a){return function(_0x11713e){try{jsonpatch[_0x7fba('0x21')](_0x11713e,_0x128f0a,!![]);}catch(_0x2e045d){return BPromise[_0x7fba('0x22')](_0x2e045d);}return _0x11713e[_0x7fba('0x23')]();};}function saveUpdates(_0x4a90f2,_0x32a3f5){return function(_0x29dfea){if(_0x29dfea){return _0x29dfea[_0x7fba('0x24')](_0x4a90f2)['then'](function(_0x123950){return _0x123950;});}return null;};}function removeEntity(_0xa531ca,_0x52af13){return function(_0x45764d){if(_0x45764d){return _0x45764d[_0x7fba('0x25')]()[_0x7fba('0x26')](function(){_0xa531ca[_0x7fba('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da813,_0x2ac18d){return function(_0x2c9d93){if(!_0x2c9d93){_0x3da813[_0x7fba('0x19')](0x194);}return _0x2c9d93;};}function handleError(_0x970145,_0x40ab54){_0x40ab54=_0x40ab54||0x1f4;return function(_0x4d7a2a){logger[_0x7fba('0x27')](_0x4d7a2a['stack']);if(_0x4d7a2a[_0x7fba('0x28')]){delete _0x4d7a2a[_0x7fba('0x28')];}_0x970145[_0x7fba('0x1a')](_0x40ab54)[_0x7fba('0x29')](_0x4d7a2a);};}exports[_0x7fba('0x2a')]=function(_0x2c295e,_0x505cfb){var _0x36dbb6={},_0x4204c={},_0x111f4f={'count':0x0,'rows':[]};var _0x4b103d=db[_0x7fba('0x2b')][_0x7fba('0x2c')];_0x4204c[_0x7fba('0x2d')]=_['keys'](_0x4b103d);_0x4204c[_0x7fba('0x2e')]=_['keys'](_0x2c295e[_0x7fba('0x2e')]);_0x4204c['filters']=_['intersection'](_0x4204c[_0x7fba('0x2d')],_0x4204c[_0x7fba('0x2e')]);_0x36dbb6[_0x7fba('0x2f')]=_['intersection'](_0x4204c[_0x7fba('0x2d')],qs[_0x7fba('0x30')](_0x2c295e['query'][_0x7fba('0x30')]));_0x36dbb6[_0x7fba('0x2f')]=_0x36dbb6[_0x7fba('0x2f')][_0x7fba('0x31')]?_0x36dbb6[_0x7fba('0x2f')]:_0x4204c[_0x7fba('0x2d')];if(!_0x2c295e['query'][_0x7fba('0x32')]('nolimit')){_0x36dbb6[_0x7fba('0x1f')]=qs[_0x7fba('0x1f')](_0x2c295e['query'][_0x7fba('0x1f')]);_0x36dbb6[_0x7fba('0x1e')]=qs[_0x7fba('0x1e')](_0x2c295e['query']['offset']);}_0x36dbb6[_0x7fba('0x33')]=qs['sort'](_0x2c295e[_0x7fba('0x2e')][_0x7fba('0x34')]);_0x36dbb6['where']=qs[_0x7fba('0x35')](_[_0x7fba('0x36')](_0x2c295e[_0x7fba('0x2e')],_0x4204c[_0x7fba('0x35')]));if(_0x2c295e['query'][_0x7fba('0x37')]){_0x36dbb6[_0x7fba('0x38')]=_[_0x7fba('0x39')](_0x36dbb6[_0x7fba('0x38')],{'$or':_['map'](_0x4b103d,function(_0x33e39f){if(_0x33e39f['type'][_0x7fba('0x3a')]!==_0x7fba('0x3b')){var _0x44320b={};_0x44320b[_0x33e39f[_0x7fba('0x3c')]]={'$like':'%'+_0x2c295e[_0x7fba('0x2e')][_0x7fba('0x37')]+'%'};return _0x44320b;}})});}_0x36dbb6=_[_0x7fba('0x39')]({},_0x36dbb6,_0x2c295e[_0x7fba('0x3d')]);var _0x138092={'where':_0x36dbb6['where']};return db['MailServerOut']['count'](_0x138092)[_0x7fba('0x26')](function(_0x562c90){_0x111f4f[_0x7fba('0x1d')]=_0x562c90;if(_0x2c295e['query'][_0x7fba('0x3e')]){_0x36dbb6[_0x7fba('0x3f')]=[{'all':!![]}];}return db[_0x7fba('0x2b')]['findAll'](_0x36dbb6);})[_0x7fba('0x26')](function(_0xe67825){_0x111f4f[_0x7fba('0x40')]=_0xe67825;return _0x111f4f;})[_0x7fba('0x26')](respondWithFilteredResult(_0x505cfb,_0x36dbb6))[_0x7fba('0x41')](handleError(_0x505cfb,null));};exports['show']=function(_0xb590d8,_0x490199){var _0xdfe004={'raw':!![],'where':{'id':_0xb590d8['params']['id']}},_0x528b1a={};_0x528b1a[_0x7fba('0x2d')]=_[_0x7fba('0x42')](db[_0x7fba('0x2b')][_0x7fba('0x2c')]);_0x528b1a[_0x7fba('0x2e')]=_[_0x7fba('0x42')](_0xb590d8[_0x7fba('0x2e')]);_0x528b1a[_0x7fba('0x35')]=_[_0x7fba('0x43')](_0x528b1a[_0x7fba('0x2d')],_0x528b1a['query']);_0xdfe004[_0x7fba('0x2f')]=_['intersection'](_0x528b1a[_0x7fba('0x2d')],qs[_0x7fba('0x30')](_0xb590d8[_0x7fba('0x2e')][_0x7fba('0x30')]));_0xdfe004[_0x7fba('0x2f')]=_0xdfe004[_0x7fba('0x2f')][_0x7fba('0x31')]?_0xdfe004[_0x7fba('0x2f')]:_0x528b1a['model'];if(_0xb590d8[_0x7fba('0x2e')][_0x7fba('0x3e')]){_0xdfe004[_0x7fba('0x3f')]=[{'all':!![]}];}_0xdfe004=_[_0x7fba('0x39')]({},_0xdfe004,_0xb590d8['options']);return db[_0x7fba('0x2b')][_0x7fba('0x44')](_0xdfe004)[_0x7fba('0x26')](handleEntityNotFound(_0x490199,null))[_0x7fba('0x26')](respondWithResult(_0x490199,null))['catch'](handleError(_0x490199,null));};exports['create']=function(_0x2d4bcc,_0x4f8a02){return db[_0x7fba('0x2b')]['create'](_0x2d4bcc[_0x7fba('0x45')],{})[_0x7fba('0x26')](respondWithResult(_0x4f8a02,0xc9))[_0x7fba('0x41')](handleError(_0x4f8a02,null));};exports['update']=function(_0x2d5e7c,_0x1f64c1){if(_0x2d5e7c[_0x7fba('0x45')]['id']){delete _0x2d5e7c[_0x7fba('0x45')]['id'];}return db[_0x7fba('0x2b')][_0x7fba('0x44')]({'where':{'id':_0x2d5e7c['params']['id']}})[_0x7fba('0x26')](handleEntityNotFound(_0x1f64c1,null))[_0x7fba('0x26')](saveUpdates(_0x2d5e7c[_0x7fba('0x45')],null))[_0x7fba('0x26')](respondWithResult(_0x1f64c1,null))[_0x7fba('0x41')](handleError(_0x1f64c1,null));};exports[_0x7fba('0x25')]=function(_0x44ad08,_0x446047){return db['MailServerOut'][_0x7fba('0x44')]({'where':{'id':_0x44ad08[_0x7fba('0x46')]['id']}})[_0x7fba('0x26')](handleEntityNotFound(_0x446047,null))[_0x7fba('0x26')](removeEntity(_0x446047,null))['catch'](handleError(_0x446047,null));}; \ No newline at end of file +var _0xc37c=['MailServerOut','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','key','VIRTUAL','field','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0xc37c,0xf4));var _0xcc37=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc37c[_0x5c351c];return _0x26f3b3;};'use strict';var pdf=require(_0xcc37('0x0'));var emlformat=require(_0xcc37('0x1'));var rimraf=require(_0xcc37('0x2'));var zipdir=require(_0xcc37('0x3'));var jsonpatch=require(_0xcc37('0x4'));var rp=require(_0xcc37('0x5'));var moment=require(_0xcc37('0x6'));var BPromise=require(_0xcc37('0x7'));var Mustache=require(_0xcc37('0x8'));var util=require(_0xcc37('0x9'));var path=require('path');var sox=require(_0xcc37('0xa'));var csv=require(_0xcc37('0xb'));var ejs=require(_0xcc37('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xcc37('0xd'));var jsforce=require(_0xcc37('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc37('0xb'));var querystring=require(_0xcc37('0xf'));var Papa=require(_0xcc37('0x10'));var Redis=require(_0xcc37('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcc37('0x12'));var hardwareService=require(_0xcc37('0x13'));var logger=require('../../config/logger')(_0xcc37('0x14'));var utils=require(_0xcc37('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1013b0,_0x317e8a){_0x317e8a=_0x317e8a||0xcc;return function(_0x35221a){if(_0x35221a){return _0x1013b0[_0xcc37('0x16')](_0x317e8a);}return _0x1013b0[_0xcc37('0x17')](_0x317e8a)['end']();};}function respondWithResult(_0x53caf7,_0x2708f5){_0x2708f5=_0x2708f5||0xc8;return function(_0x420ec9){if(_0x420ec9){return _0x53caf7['status'](_0x2708f5)[_0xcc37('0x18')](_0x420ec9);}};}function respondWithFilteredResult(_0x26e19f,_0x3d77fa){return function(_0x4283e2){if(_0x4283e2){var _0x46e524=_0x4283e2[_0xcc37('0x19')],_0x245930=_0x3d77fa[_0xcc37('0x1a')],_0x5626b0=_0x3d77fa[_0xcc37('0x1a')]+_0x3d77fa[_0xcc37('0x1b')],_0x17540d;if(_0x5626b0>=_0x46e524){_0x5626b0=_0x46e524;_0x17540d=0xc8;}else{_0x17540d=0xce;}_0x26e19f['status'](_0x17540d);return _0x26e19f[_0xcc37('0x1c')](_0xcc37('0x1d'),_0x245930+'-'+_0x5626b0+'/'+_0x46e524)[_0xcc37('0x18')](_0x4283e2);}return null;};}function patchUpdates(_0x1c2e64){return function(_0x4f18d8){try{jsonpatch[_0xcc37('0x1e')](_0x4f18d8,_0x1c2e64,!![]);}catch(_0x2a2d8b){return BPromise[_0xcc37('0x1f')](_0x2a2d8b);}return _0x4f18d8['save']();};}function saveUpdates(_0x3a54b2,_0x460697){return function(_0x5d9ab7){if(_0x5d9ab7){return _0x5d9ab7[_0xcc37('0x20')](_0x3a54b2)[_0xcc37('0x21')](function(_0x1ad169){return _0x1ad169;});}return null;};}function removeEntity(_0x3f90e4,_0x238863){return function(_0x4b766f){if(_0x4b766f){return _0x4b766f[_0xcc37('0x22')]()[_0xcc37('0x21')](function(){_0x3f90e4['status'](0xcc)[_0xcc37('0x23')]();});}};}function handleEntityNotFound(_0xdf5084,_0x44d005){return function(_0x3abb4b){if(!_0x3abb4b){_0xdf5084[_0xcc37('0x16')](0x194);}return _0x3abb4b;};}function handleError(_0x11f9ee,_0xababbb){_0xababbb=_0xababbb||0x1f4;return function(_0x5b7f11){logger[_0xcc37('0x24')](_0x5b7f11[_0xcc37('0x25')]);if(_0x5b7f11[_0xcc37('0x26')]){delete _0x5b7f11[_0xcc37('0x26')];}_0x11f9ee[_0xcc37('0x17')](_0xababbb)[_0xcc37('0x27')](_0x5b7f11);};}exports['index']=function(_0xb5e8de,_0x528f82){var _0x5a9fcd={},_0x4714d0={},_0x54a60f={'count':0x0,'rows':[]};var _0x5ced6a=db[_0xcc37('0x28')]['rawAttributes'];_0x4714d0[_0xcc37('0x29')]=_['keys'](_0x5ced6a);_0x4714d0[_0xcc37('0x2a')]=_[_0xcc37('0x2b')](_0xb5e8de['query']);_0x4714d0[_0xcc37('0x2c')]=_[_0xcc37('0x2d')](_0x4714d0['model'],_0x4714d0[_0xcc37('0x2a')]);_0x5a9fcd['attributes']=_[_0xcc37('0x2d')](_0x4714d0['model'],qs['fields'](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x2e')]));_0x5a9fcd[_0xcc37('0x2f')]=_0x5a9fcd[_0xcc37('0x2f')][_0xcc37('0x30')]?_0x5a9fcd[_0xcc37('0x2f')]:_0x4714d0[_0xcc37('0x29')];if(!_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x31')](_0xcc37('0x32'))){_0x5a9fcd['limit']=qs[_0xcc37('0x1b')](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x1b')]);_0x5a9fcd['offset']=qs['offset'](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x1a')]);}_0x5a9fcd['order']=qs[_0xcc37('0x33')](_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x33')]);_0x5a9fcd[_0xcc37('0x34')]=qs[_0xcc37('0x2c')](_[_0xcc37('0x35')](_0xb5e8de[_0xcc37('0x2a')],_0x4714d0[_0xcc37('0x2c')]));if(_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x36')]){_0x5a9fcd[_0xcc37('0x34')]=_['merge'](_0x5a9fcd[_0xcc37('0x34')],{'$or':_['map'](_0x5ced6a,function(_0x15debe){if(_0x15debe[_0xcc37('0x37')][_0xcc37('0x38')]!==_0xcc37('0x39')){var _0x4eea32={};_0x4eea32[_0x15debe[_0xcc37('0x3a')]]={'$like':'%'+_0xb5e8de[_0xcc37('0x2a')]['filter']+'%'};return _0x4eea32;}})});}_0x5a9fcd=_[_0xcc37('0x3b')]({},_0x5a9fcd,_0xb5e8de[_0xcc37('0x3c')]);var _0x16813b={'where':_0x5a9fcd[_0xcc37('0x34')]};return db[_0xcc37('0x28')][_0xcc37('0x19')](_0x16813b)[_0xcc37('0x21')](function(_0x372b1f){_0x54a60f[_0xcc37('0x19')]=_0x372b1f;if(_0xb5e8de[_0xcc37('0x2a')][_0xcc37('0x3d')]){_0x5a9fcd['include']=[{'all':!![]}];}return db[_0xcc37('0x28')]['findAll'](_0x5a9fcd);})[_0xcc37('0x21')](function(_0x15424e){_0x54a60f[_0xcc37('0x3e')]=_0x15424e;return _0x54a60f;})['then'](respondWithFilteredResult(_0x528f82,_0x5a9fcd))[_0xcc37('0x3f')](handleError(_0x528f82,null));};exports[_0xcc37('0x40')]=function(_0x2d2b96,_0x56173e){var _0xf3f2c5={'raw':!![],'where':{'id':_0x2d2b96[_0xcc37('0x41')]['id']}},_0x31f796={};_0x31f796[_0xcc37('0x29')]=_[_0xcc37('0x2b')](db[_0xcc37('0x28')][_0xcc37('0x42')]);_0x31f796[_0xcc37('0x2a')]=_[_0xcc37('0x2b')](_0x2d2b96['query']);_0x31f796[_0xcc37('0x2c')]=_[_0xcc37('0x2d')](_0x31f796[_0xcc37('0x29')],_0x31f796['query']);_0xf3f2c5[_0xcc37('0x2f')]=_[_0xcc37('0x2d')](_0x31f796[_0xcc37('0x29')],qs[_0xcc37('0x2e')](_0x2d2b96['query']['fields']));_0xf3f2c5[_0xcc37('0x2f')]=_0xf3f2c5['attributes'][_0xcc37('0x30')]?_0xf3f2c5[_0xcc37('0x2f')]:_0x31f796[_0xcc37('0x29')];if(_0x2d2b96[_0xcc37('0x2a')]['includeAll']){_0xf3f2c5[_0xcc37('0x43')]=[{'all':!![]}];}_0xf3f2c5=_[_0xcc37('0x3b')]({},_0xf3f2c5,_0x2d2b96[_0xcc37('0x3c')]);return db[_0xcc37('0x28')]['find'](_0xf3f2c5)['then'](handleEntityNotFound(_0x56173e,null))[_0xcc37('0x21')](respondWithResult(_0x56173e,null))[_0xcc37('0x3f')](handleError(_0x56173e,null));};exports['create']=function(_0x2dcee7,_0x46ecb9){return db['MailServerOut'][_0xcc37('0x44')](_0x2dcee7[_0xcc37('0x45')],{})[_0xcc37('0x21')](respondWithResult(_0x46ecb9,0xc9))[_0xcc37('0x3f')](handleError(_0x46ecb9,null));};exports['update']=function(_0x4924ad,_0x194e83){if(_0x4924ad[_0xcc37('0x45')]['id']){delete _0x4924ad['body']['id'];}return db['MailServerOut'][_0xcc37('0x46')]({'where':{'id':_0x4924ad[_0xcc37('0x41')]['id']}})[_0xcc37('0x21')](handleEntityNotFound(_0x194e83,null))['then'](saveUpdates(_0x4924ad['body'],null))['then'](respondWithResult(_0x194e83,null))[_0xcc37('0x3f')](handleError(_0x194e83,null));};exports[_0xcc37('0x22')]=function(_0x447b0b,_0x2d8825){return db[_0xcc37('0x28')][_0xcc37('0x46')]({'where':{'id':_0x447b0b[_0xcc37('0x41')]['id']}})[_0xcc37('0x21')](handleEntityNotFound(_0x2d8825,null))['then'](removeEntity(_0x2d8825,null))['catch'](handleError(_0x2d8825,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 58a434a..3605b3c 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 _0x9348=['../../config/environment','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x5c870d,_0x2f3ba8){var _0x41450e=function(_0x2398af){while(--_0x2398af){_0x5c870d['push'](_0x5c870d['shift']());}};_0x41450e(++_0x2f3ba8);}(_0x9348,0x10d));var _0x8934=function(_0x166fdc,_0x2396d0){_0x166fdc=_0x166fdc-0x0;var _0x3a2e88=_0x9348[_0x166fdc];return _0x3a2e88;};'use strict';var _=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var logger=require(_0x8934('0x2'))(_0x8934('0x3'));var moment=require(_0x8934('0x4'));var BPromise=require('bluebird');var rp=require(_0x8934('0x5'));var fs=require('fs');var path=require(_0x8934('0x6'));var rimraf=require('rimraf');var config=require(_0x8934('0x7'));var attributes=require(_0x8934('0x8'));module[_0x8934('0x9')]=function(_0x2bce03,_0x4c70d7){return _0x2bce03[_0x8934('0xa')]('MailServerOut',attributes,{'tableName':_0x8934('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1eba=['define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailServerOut.attributes','exports'];(function(_0x12656b,_0x48c4a8){var _0x438fa6=function(_0x5dc77b){while(--_0x5dc77b){_0x12656b['push'](_0x12656b['shift']());}};_0x438fa6(++_0x48c4a8);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4e1a49,_0x4da738){_0x4e1a49=_0x4e1a49-0x0;var _0x136aae=_0x1eba[_0x4e1a49];return _0x136aae;};'use strict';var _=require(_0xa1eb('0x0'));var util=require(_0xa1eb('0x1'));var logger=require(_0xa1eb('0x2'))(_0xa1eb('0x3'));var moment=require(_0xa1eb('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1eb('0x5'));var rimraf=require(_0xa1eb('0x6'));var config=require(_0xa1eb('0x7'));var attributes=require(_0xa1eb('0x8'));module[_0xa1eb('0x9')]=function(_0x2933d0,_0x1d0d67){return _0x2933d0[_0xa1eb('0xa')](_0xa1eb('0xb'),attributes,{'tableName':_0xa1eb('0xc'),'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 a031975..8324803 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 _0x857b=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerOut,\x20%s,\x20%s'];(function(_0x148db7,_0x1c7d82){var _0x4c5607=function(_0xa055af){while(--_0xa055af){_0x148db7['push'](_0x148db7['shift']());}};_0x4c5607(++_0x1c7d82);}(_0x857b,0x144));var _0xb857=function(_0x1d5127,_0x2aab5f){_0x1d5127=_0x1d5127-0x0;var _0x1b1e28=_0x857b[_0x1d5127];return _0x1b1e28;};'use strict';var _=require('lodash');var util=require(_0xb857('0x0'));var moment=require(_0xb857('0x1'));var BPromise=require(_0xb857('0x2'));var rs=require(_0xb857('0x3'));var fs=require('fs');var Redis=require(_0xb857('0x4'));var db=require(_0xb857('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb857('0x6'))(_0xb857('0x7'));var config=require(_0xb857('0x8'));var jayson=require(_0xb857('0x9'));var client=jayson[_0xb857('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x458216,_0x1a61ad,_0x1b71bf){return new BPromise(function(_0x152031,_0x4ef191){return client['request'](_0x458216,_0x1b71bf)[_0xb857('0xb')](function(_0x4ef5c9){logger[_0xb857('0xc')]('MailServerOut,\x20%s,\x20%s',_0x1a61ad,_0xb857('0xd'));logger[_0xb857('0xe')](_0xb857('0xf'),_0x1a61ad,_0xb857('0xd'),JSON[_0xb857('0x10')](_0x4ef5c9));if(_0x4ef5c9[_0xb857('0x11')]){if(_0x4ef5c9['error'][_0xb857('0x12')]===0x1f4){logger['error']('MailServerOut,\x20%s,\x20%s',_0x1a61ad,_0x4ef5c9[_0xb857('0x11')]['message']);return _0x4ef191(_0x4ef5c9[_0xb857('0x11')][_0xb857('0x13')]);}logger[_0xb857('0x11')]('MailServerOut,\x20%s,\x20%s',_0x1a61ad,_0x4ef5c9['error'][_0xb857('0x13')]);return _0x152031(_0x4ef5c9[_0xb857('0x11')]['message']);}else{logger[_0xb857('0xc')](_0xb857('0x14'),_0x1a61ad,_0xb857('0xd'));_0x152031(_0x4ef5c9[_0xb857('0x15')]['message']);}})[_0xb857('0x16')](function(_0x497acd){logger[_0xb857('0x11')](_0xb857('0x14'),_0x1a61ad,_0x497acd);_0x4ef191(_0x497acd);});});} \ No newline at end of file +var _0xc52e=['stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s'];(function(_0x2a1096,_0x296e53){var _0xc3f754=function(_0x21e1aa){while(--_0x21e1aa){_0x2a1096['push'](_0x2a1096['shift']());}};_0xc3f754(++_0x296e53);}(_0xc52e,0xe9));var _0xec52=function(_0x31dfab,_0x2b9560){_0x31dfab=_0x31dfab-0x0;var _0x4eabe7=_0xc52e[_0x31dfab];return _0x4eabe7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xec52('0x0'));var rs=require(_0xec52('0x1'));var fs=require('fs');var Redis=require(_0xec52('0x2'));var db=require(_0xec52('0x3'))['db'];var utils=require(_0xec52('0x4'));var logger=require(_0xec52('0x5'))(_0xec52('0x6'));var config=require(_0xec52('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xec52('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xbf9934,_0x4c778f,_0x38c9ae){return new BPromise(function(_0x2a76fb,_0x3c9674){return client['request'](_0xbf9934,_0x38c9ae)[_0xec52('0x9')](function(_0x365bc5){logger[_0xec52('0xa')](_0xec52('0xb'),_0x4c778f,_0xec52('0xc'));logger['debug'](_0xec52('0xd'),_0x4c778f,'request\x20sent',JSON[_0xec52('0xe')](_0x365bc5));if(_0x365bc5[_0xec52('0xf')]){if(_0x365bc5['error'][_0xec52('0x10')]===0x1f4){logger[_0xec52('0xf')](_0xec52('0xb'),_0x4c778f,_0x365bc5[_0xec52('0xf')][_0xec52('0x11')]);return _0x3c9674(_0x365bc5[_0xec52('0xf')][_0xec52('0x11')]);}logger['error'](_0xec52('0xb'),_0x4c778f,_0x365bc5['error'][_0xec52('0x11')]);return _0x2a76fb(_0x365bc5[_0xec52('0xf')][_0xec52('0x11')]);}else{logger[_0xec52('0xa')](_0xec52('0xb'),_0x4c778f,_0xec52('0xc'));_0x2a76fb(_0x365bc5['result'][_0xec52('0x11')]);}})[_0xec52('0x12')](function(_0x214d53){logger[_0xec52('0xf')](_0xec52('0xb'),_0x4c778f,_0x214d53);_0x3c9674(_0x214d53);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 732d0a1..e3ed64a 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 _0xa308=['multer','util','path','connect-timeout','express','../../components/auth/service','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','update','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa308,0x77));var _0x8a30=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xa308[_0x576e2b];return _0x46461a;};'use strict';var multer=require(_0x8a30('0x0'));var util=require(_0x8a30('0x1'));var path=require(_0x8a30('0x2'));var timeout=require(_0x8a30('0x3'));var express=require(_0x8a30('0x4'));var router=express['Router']();var auth=require(_0x8a30('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8a30('0x6'));router['get']('/',auth[_0x8a30('0x7')](),controller[_0x8a30('0x8')]);router[_0x8a30('0x9')](_0x8a30('0xa'),auth[_0x8a30('0x7')](),controller[_0x8a30('0xb')]);router[_0x8a30('0x9')](_0x8a30('0xc'),auth[_0x8a30('0x7')](),controller[_0x8a30('0xd')]);router[_0x8a30('0xe')]('/',auth[_0x8a30('0x7')](),controller['create']);router['put'](_0x8a30('0xc'),auth[_0x8a30('0x7')](),controller[_0x8a30('0xf')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8a30('0x10')]=router; \ No newline at end of file +var _0xe579=['/:id','show','post','update','delete','exports','util','connect-timeout','Router','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x4862de,_0x3ea85f){var _0x59c5b0=function(_0x51d28e){while(--_0x51d28e){_0x4862de['push'](_0x4862de['shift']());}};_0x59c5b0(++_0x3ea85f);}(_0xe579,0x68));var _0x9e57=function(_0x5bf02f,_0x240e4d){_0x5bf02f=_0x5bf02f-0x0;var _0x1342a0=_0xe579[_0x5bf02f];return _0x1342a0;};'use strict';var multer=require('multer');var util=require(_0x9e57('0x0'));var path=require('path');var timeout=require(_0x9e57('0x1'));var express=require('express');var router=express[_0x9e57('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9e57('0x3'));var controller=require('./mailSubstatus.controller');router[_0x9e57('0x4')]('/',auth[_0x9e57('0x5')](),controller[_0x9e57('0x6')]);router[_0x9e57('0x4')](_0x9e57('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x9e57('0x4')](_0x9e57('0x8'),auth[_0x9e57('0x5')](),controller[_0x9e57('0x9')]);router[_0x9e57('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9e57('0xb')]);router[_0x9e57('0xc')](_0x9e57('0x8'),auth[_0x9e57('0x5')](),controller['destroy']);module[_0x9e57('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 1ab8ac1..cd6372d 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 _0x153c=['sequelize','exports','STRING','name'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x153c,0x8c));var _0xc153=function(_0x1cfc9c,_0x49ae58){_0x1cfc9c=_0x1cfc9c-0x0;var _0x4e6e8a=_0x153c[_0x1cfc9c];return _0x4e6e8a;};'use strict';var Sequelize=require(_0xc153('0x0'));module[_0xc153('0x1')]={'name':{'type':Sequelize[_0xc153('0x2')],'unique':_0xc153('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index c28077b..9b3b17e 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 _0x0db4=['end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','type','key','VIRTUAL','field','options','include','findAll','rows','catch','show','length','includeAll','create','body','update','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x15ba60,_0x384469){var _0x1cec65=function(_0x12ff5a){while(--_0x12ff5a){_0x15ba60['push'](_0x15ba60['shift']());}};_0x1cec65(++_0x384469);}(_0x0db4,0x84));var _0x40db=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0x0db4[_0x58547b];return _0x1d3fd2;};'use strict';var pdf=require(_0x40db('0x0'));var emlformat=require(_0x40db('0x1'));var rimraf=require(_0x40db('0x2'));var zipdir=require(_0x40db('0x3'));var jsonpatch=require(_0x40db('0x4'));var rp=require(_0x40db('0x5'));var moment=require(_0x40db('0x6'));var BPromise=require(_0x40db('0x7'));var Mustache=require(_0x40db('0x8'));var util=require(_0x40db('0x9'));var path=require('path');var sox=require(_0x40db('0xa'));var csv=require(_0x40db('0xb'));var ejs=require(_0x40db('0xc'));var fs=require('fs');var _=require(_0x40db('0xd'));var squel=require('squel');var crypto=require(_0x40db('0xe'));var jsforce=require(_0x40db('0xf'));var deskjs=require(_0x40db('0x10'));var toCsv=require(_0x40db('0xb'));var querystring=require('querystring');var Papa=require(_0x40db('0x11'));var Redis=require('ioredis');var authService=require(_0x40db('0x12'));var qs=require(_0x40db('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x40db('0x14'));var config=require(_0x40db('0x15'));var db=require(_0x40db('0x16'))['db'];function respondWithStatusCode(_0x533e36,_0x39901e){_0x39901e=_0x39901e||0xcc;return function(_0x398e12){if(_0x398e12){return _0x533e36[_0x40db('0x17')](_0x39901e);}return _0x533e36['status'](_0x39901e)[_0x40db('0x18')]();};}function respondWithResult(_0x545e8f,_0x1e72cd){_0x1e72cd=_0x1e72cd||0xc8;return function(_0x24ed1c){if(_0x24ed1c){return _0x545e8f[_0x40db('0x19')](_0x1e72cd)[_0x40db('0x1a')](_0x24ed1c);}};}function respondWithFilteredResult(_0x58606d,_0x2df8f1){return function(_0x3af7e1){if(_0x3af7e1){var _0x371a07=_0x3af7e1[_0x40db('0x1b')],_0x437798=_0x2df8f1['offset'],_0x4fb57e=_0x2df8f1[_0x40db('0x1c')]+_0x2df8f1[_0x40db('0x1d')],_0x3c1cc5;if(_0x4fb57e>=_0x371a07){_0x4fb57e=_0x371a07;_0x3c1cc5=0xc8;}else{_0x3c1cc5=0xce;}_0x58606d[_0x40db('0x19')](_0x3c1cc5);return _0x58606d[_0x40db('0x1e')](_0x40db('0x1f'),_0x437798+'-'+_0x4fb57e+'/'+_0x371a07)[_0x40db('0x1a')](_0x3af7e1);}return null;};}function patchUpdates(_0x4ca2ce){return function(_0x1ccf8e){try{jsonpatch[_0x40db('0x20')](_0x1ccf8e,_0x4ca2ce,!![]);}catch(_0x73dd54){return BPromise[_0x40db('0x21')](_0x73dd54);}return _0x1ccf8e[_0x40db('0x22')]();};}function saveUpdates(_0x6abce2,_0x18e65c){return function(_0xa64421){if(_0xa64421){return _0xa64421['update'](_0x6abce2)[_0x40db('0x23')](function(_0x5eec95){return _0x5eec95;});}return null;};}function removeEntity(_0x20c9d3,_0xaf3813){return function(_0x21be6f){if(_0x21be6f){return _0x21be6f[_0x40db('0x24')]()['then'](function(){_0x20c9d3[_0x40db('0x19')](0xcc)[_0x40db('0x18')]();});}};}function handleEntityNotFound(_0x35299f,_0x1d65a0){return function(_0x4a1efe){if(!_0x4a1efe){_0x35299f[_0x40db('0x17')](0x194);}return _0x4a1efe;};}function handleError(_0xbbe9b8,_0x34ceda){_0x34ceda=_0x34ceda||0x1f4;return function(_0x4bbaae){logger[_0x40db('0x25')](_0x4bbaae[_0x40db('0x26')]);if(_0x4bbaae[_0x40db('0x27')]){delete _0x4bbaae[_0x40db('0x27')];}_0xbbe9b8[_0x40db('0x19')](_0x34ceda)[_0x40db('0x28')](_0x4bbaae);};}exports[_0x40db('0x29')]=function(_0xd06fe4,_0x258de9){var _0x3422a0={},_0x4d658d={},_0x22e13f={'count':0x0,'rows':[]};var _0x300fbf=db[_0x40db('0x2a')][_0x40db('0x2b')];_0x4d658d[_0x40db('0x2c')]=_[_0x40db('0x2d')](_0x300fbf);_0x4d658d[_0x40db('0x2e')]=_['keys'](_0xd06fe4[_0x40db('0x2e')]);_0x4d658d['filters']=_[_0x40db('0x2f')](_0x4d658d['model'],_0x4d658d[_0x40db('0x2e')]);_0x3422a0[_0x40db('0x30')]=_[_0x40db('0x2f')](_0x4d658d['model'],qs[_0x40db('0x31')](_0xd06fe4[_0x40db('0x2e')]['fields']));_0x3422a0[_0x40db('0x30')]=_0x3422a0[_0x40db('0x30')]['length']?_0x3422a0[_0x40db('0x30')]:_0x4d658d[_0x40db('0x2c')];if(!_0xd06fe4[_0x40db('0x2e')][_0x40db('0x32')](_0x40db('0x33'))){_0x3422a0[_0x40db('0x1d')]=qs[_0x40db('0x1d')](_0xd06fe4[_0x40db('0x2e')]['limit']);_0x3422a0['offset']=qs['offset'](_0xd06fe4[_0x40db('0x2e')][_0x40db('0x1c')]);}_0x3422a0[_0x40db('0x34')]=qs[_0x40db('0x35')](_0xd06fe4[_0x40db('0x2e')][_0x40db('0x35')]);_0x3422a0[_0x40db('0x36')]=qs['filters'](_[_0x40db('0x37')](_0xd06fe4['query'],_0x4d658d[_0x40db('0x38')]));if(_0xd06fe4['query'][_0x40db('0x39')]){_0x3422a0[_0x40db('0x36')]=_[_0x40db('0x3a')](_0x3422a0[_0x40db('0x36')],{'$or':_[_0x40db('0x3b')](_0x300fbf,function(_0x4acfc8){if(_0x4acfc8[_0x40db('0x3c')][_0x40db('0x3d')]!==_0x40db('0x3e')){var _0x517153={};_0x517153[_0x4acfc8[_0x40db('0x3f')]]={'$like':'%'+_0xd06fe4[_0x40db('0x2e')][_0x40db('0x39')]+'%'};return _0x517153;}})});}_0x3422a0=_['merge']({},_0x3422a0,_0xd06fe4[_0x40db('0x40')]);var _0x28b6c3={'where':_0x3422a0[_0x40db('0x36')]};return db[_0x40db('0x2a')][_0x40db('0x1b')](_0x28b6c3)[_0x40db('0x23')](function(_0x1d3ae5){_0x22e13f[_0x40db('0x1b')]=_0x1d3ae5;if(_0xd06fe4[_0x40db('0x2e')]['includeAll']){_0x3422a0[_0x40db('0x41')]=[{'all':!![]}];}return db[_0x40db('0x2a')][_0x40db('0x42')](_0x3422a0);})['then'](function(_0x316afb){_0x22e13f[_0x40db('0x43')]=_0x316afb;return _0x22e13f;})['then'](respondWithFilteredResult(_0x258de9,_0x3422a0))[_0x40db('0x44')](handleError(_0x258de9,null));};exports[_0x40db('0x45')]=function(_0x222ad9,_0x50c8c6){var _0x361c50={'raw':!![],'where':{'id':_0x222ad9['params']['id']}},_0x38622d={};_0x38622d[_0x40db('0x2c')]=_[_0x40db('0x2d')](db[_0x40db('0x2a')]['rawAttributes']);_0x38622d['query']=_[_0x40db('0x2d')](_0x222ad9[_0x40db('0x2e')]);_0x38622d[_0x40db('0x38')]=_['intersection'](_0x38622d[_0x40db('0x2c')],_0x38622d[_0x40db('0x2e')]);_0x361c50[_0x40db('0x30')]=_[_0x40db('0x2f')](_0x38622d[_0x40db('0x2c')],qs[_0x40db('0x31')](_0x222ad9[_0x40db('0x2e')][_0x40db('0x31')]));_0x361c50[_0x40db('0x30')]=_0x361c50[_0x40db('0x30')][_0x40db('0x46')]?_0x361c50[_0x40db('0x30')]:_0x38622d[_0x40db('0x2c')];if(_0x222ad9[_0x40db('0x2e')][_0x40db('0x47')]){_0x361c50[_0x40db('0x41')]=[{'all':!![]}];}_0x361c50=_[_0x40db('0x3a')]({},_0x361c50,_0x222ad9[_0x40db('0x40')]);return db[_0x40db('0x2a')]['find'](_0x361c50)[_0x40db('0x23')](handleEntityNotFound(_0x50c8c6,null))[_0x40db('0x23')](respondWithResult(_0x50c8c6,null))[_0x40db('0x44')](handleError(_0x50c8c6,null));};exports[_0x40db('0x48')]=function(_0x50bd1f,_0x582bb4){return db['MailSubstatus']['create'](_0x50bd1f[_0x40db('0x49')],{})[_0x40db('0x23')](respondWithResult(_0x582bb4,0xc9))[_0x40db('0x44')](handleError(_0x582bb4,null));};exports[_0x40db('0x4a')]=function(_0x258233,_0x3b135d){if(_0x258233[_0x40db('0x49')]['id']){delete _0x258233[_0x40db('0x49')]['id'];}return db[_0x40db('0x2a')][_0x40db('0x4b')]({'where':{'id':_0x258233[_0x40db('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3b135d,null))[_0x40db('0x23')](saveUpdates(_0x258233[_0x40db('0x49')],null))[_0x40db('0x23')](respondWithResult(_0x3b135d,null))[_0x40db('0x44')](handleError(_0x3b135d,null));};exports[_0x40db('0x24')]=function(_0x41911b,_0x5a1d22){return db[_0x40db('0x2a')][_0x40db('0x4b')]({'where':{'id':_0x41911b[_0x40db('0x4c')]['id']}})[_0x40db('0x23')](handleEntityNotFound(_0x5a1d22,null))[_0x40db('0x23')](removeEntity(_0x5a1d22,null))[_0x40db('0x44')](handleError(_0x5a1d22,null));};exports[_0x40db('0x4d')]=function(_0x4fdc1e,_0x201690){return db[_0x40db('0x2a')][_0x40db('0x4d')]()[_0x40db('0x23')](respondWithResult(_0x201690,null))[_0x40db('0x44')](handleError(_0x201690,null));}; \ No newline at end of file +var _0x2350=['crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','end','name','send','index','MailSubstatus','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','key','field','filter','options','count','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x2350,0x84));var _0x0235=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x2350[_0x59befa];return _0x1dd63d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x0235('0x0'));var zipdir=require(_0x0235('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0235('0x2'));var moment=require('moment');var BPromise=require(_0x0235('0x3'));var Mustache=require(_0x0235('0x4'));var util=require(_0x0235('0x5'));var path=require(_0x0235('0x6'));var sox=require(_0x0235('0x7'));var csv=require(_0x0235('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x0235('0x9'));var crypto=require(_0x0235('0xa'));var jsforce=require(_0x0235('0xb'));var deskjs=require(_0x0235('0xc'));var toCsv=require(_0x0235('0x8'));var querystring=require(_0x0235('0xd'));var Papa=require('papaparse');var Redis=require(_0x0235('0xe'));var authService=require(_0x0235('0xf'));var qs=require(_0x0235('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0235('0x11'))(_0x0235('0x12'));var utils=require(_0x0235('0x13'));var config=require(_0x0235('0x14'));var db=require(_0x0235('0x15'))['db'];function respondWithStatusCode(_0x1a9ab4,_0x261b49){_0x261b49=_0x261b49||0xcc;return function(_0x259c29){if(_0x259c29){return _0x1a9ab4[_0x0235('0x16')](_0x261b49);}return _0x1a9ab4[_0x0235('0x17')](_0x261b49)['end']();};}function respondWithResult(_0x10fd13,_0x26b444){_0x26b444=_0x26b444||0xc8;return function(_0x1c8a74){if(_0x1c8a74){return _0x10fd13[_0x0235('0x17')](_0x26b444)[_0x0235('0x18')](_0x1c8a74);}};}function respondWithFilteredResult(_0x3f3bfc,_0x9477c2){return function(_0x2c29bd){if(_0x2c29bd){var _0x371756=_0x2c29bd['count'],_0x490f2f=_0x9477c2[_0x0235('0x19')],_0x32d888=_0x9477c2[_0x0235('0x19')]+_0x9477c2[_0x0235('0x1a')],_0x3be080;if(_0x32d888>=_0x371756){_0x32d888=_0x371756;_0x3be080=0xc8;}else{_0x3be080=0xce;}_0x3f3bfc[_0x0235('0x17')](_0x3be080);return _0x3f3bfc[_0x0235('0x1b')](_0x0235('0x1c'),_0x490f2f+'-'+_0x32d888+'/'+_0x371756)[_0x0235('0x18')](_0x2c29bd);}return null;};}function patchUpdates(_0x2f4562){return function(_0x5e5c28){try{jsonpatch['apply'](_0x5e5c28,_0x2f4562,!![]);}catch(_0x375f97){return BPromise[_0x0235('0x1d')](_0x375f97);}return _0x5e5c28[_0x0235('0x1e')]();};}function saveUpdates(_0x237813,_0x1abca1){return function(_0x2ecad2){if(_0x2ecad2){return _0x2ecad2[_0x0235('0x1f')](_0x237813)['then'](function(_0x443525){return _0x443525;});}return null;};}function removeEntity(_0x52c1b9,_0x5dc2e5){return function(_0x3e458c){if(_0x3e458c){return _0x3e458c[_0x0235('0x20')]()['then'](function(){_0x52c1b9[_0x0235('0x17')](0xcc)[_0x0235('0x21')]();});}};}function handleEntityNotFound(_0x234104,_0x4d6a39){return function(_0x475da6){if(!_0x475da6){_0x234104[_0x0235('0x16')](0x194);}return _0x475da6;};}function handleError(_0xa825d7,_0x1b3d29){_0x1b3d29=_0x1b3d29||0x1f4;return function(_0x56ec41){logger['error'](_0x56ec41['stack']);if(_0x56ec41[_0x0235('0x22')]){delete _0x56ec41['name'];}_0xa825d7['status'](_0x1b3d29)[_0x0235('0x23')](_0x56ec41);};}exports[_0x0235('0x24')]=function(_0x5c1343,_0x18a96a){var _0x4cb3a6={},_0x50b002={},_0x3b3b62={'count':0x0,'rows':[]};var _0x560906=db[_0x0235('0x25')][_0x0235('0x26')];_0x50b002[_0x0235('0x27')]=_['keys'](_0x560906);_0x50b002[_0x0235('0x28')]=_[_0x0235('0x29')](_0x5c1343['query']);_0x50b002[_0x0235('0x2a')]=_[_0x0235('0x2b')](_0x50b002[_0x0235('0x27')],_0x50b002[_0x0235('0x28')]);_0x4cb3a6[_0x0235('0x2c')]=_[_0x0235('0x2b')](_0x50b002[_0x0235('0x27')],qs[_0x0235('0x2d')](_0x5c1343[_0x0235('0x28')][_0x0235('0x2d')]));_0x4cb3a6[_0x0235('0x2c')]=_0x4cb3a6['attributes'][_0x0235('0x2e')]?_0x4cb3a6[_0x0235('0x2c')]:_0x50b002['model'];if(!_0x5c1343[_0x0235('0x28')][_0x0235('0x2f')](_0x0235('0x30'))){_0x4cb3a6[_0x0235('0x1a')]=qs[_0x0235('0x1a')](_0x5c1343['query'][_0x0235('0x1a')]);_0x4cb3a6['offset']=qs[_0x0235('0x19')](_0x5c1343['query'][_0x0235('0x19')]);}_0x4cb3a6[_0x0235('0x31')]=qs['sort'](_0x5c1343['query'][_0x0235('0x32')]);_0x4cb3a6['where']=qs[_0x0235('0x2a')](_['pick'](_0x5c1343['query'],_0x50b002['filters']));if(_0x5c1343['query']['filter']){_0x4cb3a6[_0x0235('0x33')]=_[_0x0235('0x34')](_0x4cb3a6[_0x0235('0x33')],{'$or':_[_0x0235('0x35')](_0x560906,function(_0x401c2e){if(_0x401c2e['type'][_0x0235('0x36')]!=='VIRTUAL'){var _0x4bcd2f={};_0x4bcd2f[_0x401c2e[_0x0235('0x37')]]={'$like':'%'+_0x5c1343[_0x0235('0x28')][_0x0235('0x38')]+'%'};return _0x4bcd2f;}})});}_0x4cb3a6=_[_0x0235('0x34')]({},_0x4cb3a6,_0x5c1343[_0x0235('0x39')]);var _0xd05fa6={'where':_0x4cb3a6[_0x0235('0x33')]};return db[_0x0235('0x25')][_0x0235('0x3a')](_0xd05fa6)[_0x0235('0x3b')](function(_0x182635){_0x3b3b62[_0x0235('0x3a')]=_0x182635;if(_0x5c1343[_0x0235('0x28')][_0x0235('0x3c')]){_0x4cb3a6[_0x0235('0x3d')]=[{'all':!![]}];}return db['MailSubstatus'][_0x0235('0x3e')](_0x4cb3a6);})[_0x0235('0x3b')](function(_0x2f0446){_0x3b3b62[_0x0235('0x3f')]=_0x2f0446;return _0x3b3b62;})[_0x0235('0x3b')](respondWithFilteredResult(_0x18a96a,_0x4cb3a6))[_0x0235('0x40')](handleError(_0x18a96a,null));};exports[_0x0235('0x41')]=function(_0xfebdd6,_0x3e581d){var _0x19a7d5={'raw':!![],'where':{'id':_0xfebdd6[_0x0235('0x42')]['id']}},_0x2c0736={};_0x2c0736[_0x0235('0x27')]=_['keys'](db[_0x0235('0x25')][_0x0235('0x26')]);_0x2c0736[_0x0235('0x28')]=_[_0x0235('0x29')](_0xfebdd6[_0x0235('0x28')]);_0x2c0736[_0x0235('0x2a')]=_[_0x0235('0x2b')](_0x2c0736[_0x0235('0x27')],_0x2c0736[_0x0235('0x28')]);_0x19a7d5[_0x0235('0x2c')]=_['intersection'](_0x2c0736[_0x0235('0x27')],qs[_0x0235('0x2d')](_0xfebdd6[_0x0235('0x28')]['fields']));_0x19a7d5['attributes']=_0x19a7d5[_0x0235('0x2c')][_0x0235('0x2e')]?_0x19a7d5['attributes']:_0x2c0736[_0x0235('0x27')];if(_0xfebdd6[_0x0235('0x28')][_0x0235('0x3c')]){_0x19a7d5[_0x0235('0x3d')]=[{'all':!![]}];}_0x19a7d5=_[_0x0235('0x34')]({},_0x19a7d5,_0xfebdd6[_0x0235('0x39')]);return db[_0x0235('0x25')][_0x0235('0x43')](_0x19a7d5)[_0x0235('0x3b')](handleEntityNotFound(_0x3e581d,null))[_0x0235('0x3b')](respondWithResult(_0x3e581d,null))[_0x0235('0x40')](handleError(_0x3e581d,null));};exports[_0x0235('0x44')]=function(_0x5cbb25,_0x15c1f0){return db[_0x0235('0x25')][_0x0235('0x44')](_0x5cbb25['body'],{})[_0x0235('0x3b')](respondWithResult(_0x15c1f0,0xc9))['catch'](handleError(_0x15c1f0,null));};exports['update']=function(_0x5ac1b0,_0x506c6a){if(_0x5ac1b0[_0x0235('0x45')]['id']){delete _0x5ac1b0[_0x0235('0x45')]['id'];}return db[_0x0235('0x25')][_0x0235('0x43')]({'where':{'id':_0x5ac1b0[_0x0235('0x42')]['id']}})[_0x0235('0x3b')](handleEntityNotFound(_0x506c6a,null))[_0x0235('0x3b')](saveUpdates(_0x5ac1b0['body'],null))['then'](respondWithResult(_0x506c6a,null))['catch'](handleError(_0x506c6a,null));};exports['destroy']=function(_0x5596b6,_0x44abee){return db[_0x0235('0x25')]['find']({'where':{'id':_0x5596b6[_0x0235('0x42')]['id']}})['then'](handleEntityNotFound(_0x44abee,null))[_0x0235('0x3b')](removeEntity(_0x44abee,null))[_0x0235('0x40')](handleError(_0x44abee,null));};exports[_0x0235('0x46')]=function(_0xf4ae8c,_0x5e7def){return db[_0x0235('0x25')][_0x0235('0x46')]()[_0x0235('0x3b')](respondWithResult(_0x5e7def,null))['catch'](handleError(_0x5e7def,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index ec0cd0e..d14a2a3 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 _0x723e=['./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x76c57e,_0x265d95){var _0x4c1fd0=function(_0x4f1456){while(--_0x4f1456){_0x76c57e['push'](_0x76c57e['shift']());}};_0x4c1fd0(++_0x265d95);}(_0x723e,0xe8));var _0xe723=function(_0x2a5740,_0x28eee8){_0x2a5740=_0x2a5740-0x0;var _0x5072bd=_0x723e[_0x2a5740];return _0x5072bd;};'use strict';var _=require(_0xe723('0x0'));var util=require(_0xe723('0x1'));var logger=require('../../config/logger')(_0xe723('0x2'));var moment=require('moment');var BPromise=require(_0xe723('0x3'));var rp=require(_0xe723('0x4'));var fs=require('fs');var path=require(_0xe723('0x5'));var rimraf=require(_0xe723('0x6'));var config=require(_0xe723('0x7'));var attributes=require(_0xe723('0x8'));module[_0xe723('0x9')]=function(_0x488be8,_0x7258c3){return _0x488be8[_0xe723('0xa')](_0xe723('0xb'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x19fe=['define','util','../../config/logger','api','moment','bluebird','./mailSubstatus.attributes','exports'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x19fe,0xa1));var _0xe19f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x19fe[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe19f('0x0'));var logger=require(_0xe19f('0x1'))(_0xe19f('0x2'));var moment=require(_0xe19f('0x3'));var BPromise=require(_0xe19f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe19f('0x5'));module[_0xe19f('0x6')]=function(_0x4890dc,_0x75f6c3){return _0x4890dc[_0xe19f('0x7')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 5ad470a..c9c7450 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 _0x1c88=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x18f152,_0x41585a){var _0xa10b34=function(_0x1e9798){while(--_0x1e9798){_0x18f152['push'](_0x18f152['shift']());}};_0xa10b34(++_0x41585a);}(_0x1c88,0x1cb));var _0x81c8=function(_0x23a959,_0x5c39dd){_0x23a959=_0x23a959-0x0;var _0x2b73dd=_0x1c88[_0x23a959];return _0x2b73dd;};'use strict';var _=require(_0x81c8('0x0'));var util=require(_0x81c8('0x1'));var moment=require(_0x81c8('0x2'));var BPromise=require(_0x81c8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81c8('0x4'));var db=require(_0x81c8('0x5'))['db'];var utils=require(_0x81c8('0x6'));var logger=require(_0x81c8('0x7'))(_0x81c8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x81c8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x145dbb,_0x4aa96c,_0x3d87cd){return new BPromise(function(_0x2d758f,_0x5368dc){return client['request'](_0x145dbb,_0x3d87cd)[_0x81c8('0xa')](function(_0x2fd68b){logger[_0x81c8('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x4aa96c,_0x81c8('0xc'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4aa96c,_0x81c8('0xc'),JSON[_0x81c8('0xd')](_0x2fd68b));if(_0x2fd68b[_0x81c8('0xe')]){if(_0x2fd68b[_0x81c8('0xe')][_0x81c8('0xf')]===0x1f4){logger[_0x81c8('0xe')](_0x81c8('0x10'),_0x4aa96c,_0x2fd68b[_0x81c8('0xe')][_0x81c8('0x11')]);return _0x5368dc(_0x2fd68b['error'][_0x81c8('0x11')]);}logger[_0x81c8('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x4aa96c,_0x2fd68b['error'][_0x81c8('0x11')]);return _0x2d758f(_0x2fd68b[_0x81c8('0xe')][_0x81c8('0x11')]);}else{logger['info'](_0x81c8('0x10'),_0x4aa96c,_0x81c8('0xc'));_0x2d758f(_0x2fd68b[_0x81c8('0x12')][_0x81c8('0x11')]);}})[_0x81c8('0x13')](function(_0x5361ba){logger[_0x81c8('0xe')](_0x81c8('0x10'),_0x4aa96c,_0x5361ba);_0x5368dc(_0x5361ba);});});} \ No newline at end of file +var _0x7f81=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x3b879b,_0x315b28){var _0x1c606d=function(_0x5e6904){while(--_0x5e6904){_0x3b879b['push'](_0x3b879b['shift']());}};_0x1c606d(++_0x315b28);}(_0x7f81,0xc1));var _0x17f8=function(_0x128ed7,_0x2aa09b){_0x128ed7=_0x128ed7-0x0;var _0x23eb41=_0x7f81[_0x128ed7];return _0x23eb41;};'use strict';var _=require(_0x17f8('0x0'));var util=require('util');var moment=require(_0x17f8('0x1'));var BPromise=require(_0x17f8('0x2'));var rs=require(_0x17f8('0x3'));var fs=require('fs');var Redis=require(_0x17f8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x17f8('0x5'));var logger=require('../../config/logger')(_0x17f8('0x6'));var config=require(_0x17f8('0x7'));var jayson=require(_0x17f8('0x8'));var client=jayson[_0x17f8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x446e13,_0xe68c7a,_0xd4c5f1){return new BPromise(function(_0x49f98b,_0x331c6f){return client[_0x17f8('0xa')](_0x446e13,_0xd4c5f1)[_0x17f8('0xb')](function(_0xf5f63b){logger[_0x17f8('0xc')](_0x17f8('0xd'),_0xe68c7a,_0x17f8('0xe'));logger[_0x17f8('0xf')](_0x17f8('0x10'),_0xe68c7a,'request\x20sent',JSON[_0x17f8('0x11')](_0xf5f63b));if(_0xf5f63b[_0x17f8('0x12')]){if(_0xf5f63b['error']['code']===0x1f4){logger[_0x17f8('0x12')](_0x17f8('0xd'),_0xe68c7a,_0xf5f63b[_0x17f8('0x12')]['message']);return _0x331c6f(_0xf5f63b['error'][_0x17f8('0x13')]);}logger['error'](_0x17f8('0xd'),_0xe68c7a,_0xf5f63b['error'][_0x17f8('0x13')]);return _0x49f98b(_0xf5f63b[_0x17f8('0x12')][_0x17f8('0x13')]);}else{logger[_0x17f8('0xc')](_0x17f8('0xd'),_0xe68c7a,_0x17f8('0xe'));_0x49f98b(_0xf5f63b[_0x17f8('0x14')][_0x17f8('0x13')]);}})[_0x17f8('0x15')](function(_0xb725f9){logger[_0x17f8('0x12')](_0x17f8('0xd'),_0xe68c7a,_0xb725f9);_0x331c6f(_0xb725f9);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d97b678..33092dd 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 _0x4745=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post','create','put','update'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4745,0x1e7));var _0x5474=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x4745[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var path=require(_0x5474('0x2'));var timeout=require(_0x5474('0x3'));var express=require(_0x5474('0x4'));var router=express[_0x5474('0x5')]();var auth=require(_0x5474('0x6'));var interaction=require(_0x5474('0x7'));var config=require(_0x5474('0x8'));var controller=require(_0x5474('0x9'));router[_0x5474('0xa')]('/',auth[_0x5474('0xb')](),controller['index']);router[_0x5474('0xa')](_0x5474('0xc'),auth['isAuthenticated'](),controller[_0x5474('0xd')]);router['get'](_0x5474('0xe'),auth[_0x5474('0xb')](),controller['show']);router[_0x5474('0xf')]('/',auth[_0x5474('0xb')](),controller[_0x5474('0x10')]);router[_0x5474('0x11')](_0x5474('0xe'),auth[_0x5474('0xb')](),controller[_0x5474('0x12')]);router[_0x5474('0x13')]('/:id',auth[_0x5474('0xb')](),controller[_0x5474('0x14')]);module[_0x5474('0x15')]=router; \ No newline at end of file +var _0x1883=['put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create'];(function(_0x56d764,_0x3f0652){var _0xec0df6=function(_0xe149fa){while(--_0xe149fa){_0x56d764['push'](_0x56d764['shift']());}};_0xec0df6(++_0x3f0652);}(_0x1883,0xab));var _0x3188=function(_0x5f41c9,_0x160beb){_0x5f41c9=_0x5f41c9-0x0;var _0xdb7812=_0x1883[_0x5f41c9];return _0xdb7812;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var auth=require(_0x3188('0x6'));var interaction=require(_0x3188('0x7'));var config=require(_0x3188('0x8'));var controller=require(_0x3188('0x9'));router[_0x3188('0xa')]('/',auth[_0x3188('0xb')](),controller[_0x3188('0xc')]);router[_0x3188('0xa')](_0x3188('0xd'),auth[_0x3188('0xb')](),controller[_0x3188('0xe')]);router['get'](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['show']);router[_0x3188('0x10')]('/',auth['isAuthenticated'](),controller[_0x3188('0x11')]);router[_0x3188('0x12')](_0x3188('0xf'),auth[_0x3188('0xb')](),controller['update']);router[_0x3188('0x13')](_0x3188('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x3188('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 6c262c7..128353d 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 _0xf74f=['STRING','ENUM','account','agent','moment','sequelize'];(function(_0xed53df,_0x3ebbc0){var _0x463d86=function(_0x115249){while(--_0x115249){_0xed53df['push'](_0xed53df['shift']());}};_0x463d86(++_0x3ebbc0);}(_0xf74f,0x1b4));var _0xff74=function(_0x303402,_0xdc2fb7){_0x303402=_0x303402-0x0;var _0x201eee=_0xf74f[_0x303402];return _0x201eee;};'use strict';var moment=require(_0xff74('0x0'));var Sequelize=require(_0xff74('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xff74('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xff74('0x3')](_0xff74('0x4'),_0xff74('0x5'),'queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xab9e=['queue','DATE','NOW','moment','exports','STRING','ENUM','account','agent'];(function(_0x2266b8,_0x5129b0){var _0x10f797=function(_0x3fed04){while(--_0x3fed04){_0x2266b8['push'](_0x2266b8['shift']());}};_0x10f797(++_0x5129b0);}(_0xab9e,0xed));var _0xeab9=function(_0x572382,_0x1cffda){_0x572382=_0x572382-0x0;var _0x2a1ddf=_0xab9e[_0x572382];return _0x2a1ddf;};'use strict';var moment=require(_0xeab9('0x0'));var Sequelize=require('sequelize');module[_0xeab9('0x1')]={'uniqueid':{'type':Sequelize[_0xeab9('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xeab9('0x3')](_0xeab9('0x4'),_0xeab9('0x5'),'queue'),'allowNull':![],'defaultValue':_0xeab9('0x6')},'transferredAt':{'type':Sequelize[_0xeab9('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xeab9('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index e1d8778..e87bcc6 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 _0xd0fc=['squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','error','stack','name','send','index','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','key','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash'];(function(_0x34b481,_0x52f958){var _0x38476d=function(_0x1e3c30){while(--_0x1e3c30){_0x34b481['push'](_0x34b481['shift']());}};_0x38476d(++_0x52f958);}(_0xd0fc,0x1e4));var _0xcd0f=function(_0x8a337d,_0xc514ed){_0x8a337d=_0x8a337d-0x0;var _0xfbc484=_0xd0fc[_0x8a337d];return _0xfbc484;};'use strict';var pdf=require(_0xcd0f('0x0'));var emlformat=require(_0xcd0f('0x1'));var rimraf=require(_0xcd0f('0x2'));var zipdir=require(_0xcd0f('0x3'));var jsonpatch=require(_0xcd0f('0x4'));var rp=require('request-promise');var moment=require(_0xcd0f('0x5'));var BPromise=require(_0xcd0f('0x6'));var Mustache=require(_0xcd0f('0x7'));var util=require(_0xcd0f('0x8'));var path=require(_0xcd0f('0x9'));var sox=require('sox');var csv=require(_0xcd0f('0xa'));var ejs=require(_0xcd0f('0xb'));var fs=require('fs');var _=require(_0xcd0f('0xc'));var squel=require(_0xcd0f('0xd'));var crypto=require(_0xcd0f('0xe'));var jsforce=require(_0xcd0f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcd0f('0xa'));var querystring=require(_0xcd0f('0x10'));var Papa=require('papaparse');var Redis=require(_0xcd0f('0x11'));var authService=require(_0xcd0f('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xcd0f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xcd0f('0x14'));var config=require('../../config/environment');var db=require(_0xcd0f('0x15'))['db'];function respondWithStatusCode(_0x4ed0ad,_0x140f2f){_0x140f2f=_0x140f2f||0xcc;return function(_0x1bf950){if(_0x1bf950){return _0x4ed0ad[_0xcd0f('0x16')](_0x140f2f);}return _0x4ed0ad[_0xcd0f('0x17')](_0x140f2f)[_0xcd0f('0x18')]();};}function respondWithResult(_0x3c5f90,_0x18d2f6){_0x18d2f6=_0x18d2f6||0xc8;return function(_0x43359a){if(_0x43359a){return _0x3c5f90['status'](_0x18d2f6)['json'](_0x43359a);}};}function respondWithFilteredResult(_0x131094,_0x2ed592){return function(_0x1a79d5){if(_0x1a79d5){var _0x49389a=_0x1a79d5[_0xcd0f('0x19')],_0xdf565b=_0x2ed592[_0xcd0f('0x1a')],_0x16beba=_0x2ed592['offset']+_0x2ed592[_0xcd0f('0x1b')],_0x50c55a;if(_0x16beba>=_0x49389a){_0x16beba=_0x49389a;_0x50c55a=0xc8;}else{_0x50c55a=0xce;}_0x131094[_0xcd0f('0x17')](_0x50c55a);return _0x131094[_0xcd0f('0x1c')]('Content-Range',_0xdf565b+'-'+_0x16beba+'/'+_0x49389a)[_0xcd0f('0x1d')](_0x1a79d5);}return null;};}function patchUpdates(_0x52a62b){return function(_0x8d9102){try{jsonpatch['apply'](_0x8d9102,_0x52a62b,!![]);}catch(_0x375892){return BPromise[_0xcd0f('0x1e')](_0x375892);}return _0x8d9102[_0xcd0f('0x1f')]();};}function saveUpdates(_0x456886,_0x171360){return function(_0x1b55ef){if(_0x1b55ef){return _0x1b55ef['update'](_0x456886)['then'](function(_0x34e346){return _0x34e346;});}return null;};}function removeEntity(_0x15d2ef,_0x447efb){return function(_0x381c85){if(_0x381c85){return _0x381c85['destroy']()['then'](function(){_0x15d2ef[_0xcd0f('0x17')](0xcc)[_0xcd0f('0x18')]();});}};}function handleEntityNotFound(_0x9b7906,_0x33701a){return function(_0x3b80d3){if(!_0x3b80d3){_0x9b7906[_0xcd0f('0x16')](0x194);}return _0x3b80d3;};}function handleError(_0x209c83,_0x8a35d5){_0x8a35d5=_0x8a35d5||0x1f4;return function(_0x1dc02b){logger[_0xcd0f('0x20')](_0x1dc02b[_0xcd0f('0x21')]);if(_0x1dc02b[_0xcd0f('0x22')]){delete _0x1dc02b[_0xcd0f('0x22')];}_0x209c83[_0xcd0f('0x17')](_0x8a35d5)[_0xcd0f('0x23')](_0x1dc02b);};}exports[_0xcd0f('0x24')]=function(_0x42616c,_0x36f7e5){var _0x2b17c0={},_0x553aa3={},_0x722614={'count':0x0,'rows':[]};var _0x491405=db[_0xcd0f('0x25')][_0xcd0f('0x26')];_0x553aa3[_0xcd0f('0x27')]=_[_0xcd0f('0x28')](_0x491405);_0x553aa3[_0xcd0f('0x29')]=_[_0xcd0f('0x28')](_0x42616c[_0xcd0f('0x29')]);_0x553aa3[_0xcd0f('0x2a')]=_[_0xcd0f('0x2b')](_0x553aa3['model'],_0x553aa3[_0xcd0f('0x29')]);_0x2b17c0['attributes']=_[_0xcd0f('0x2b')](_0x553aa3[_0xcd0f('0x27')],qs['fields'](_0x42616c[_0xcd0f('0x29')][_0xcd0f('0x2c')]));_0x2b17c0[_0xcd0f('0x2d')]=_0x2b17c0['attributes'][_0xcd0f('0x2e')]?_0x2b17c0[_0xcd0f('0x2d')]:_0x553aa3[_0xcd0f('0x27')];if(!_0x42616c[_0xcd0f('0x29')][_0xcd0f('0x2f')](_0xcd0f('0x30'))){_0x2b17c0[_0xcd0f('0x1b')]=qs[_0xcd0f('0x1b')](_0x42616c[_0xcd0f('0x29')][_0xcd0f('0x1b')]);_0x2b17c0[_0xcd0f('0x1a')]=qs[_0xcd0f('0x1a')](_0x42616c['query']['offset']);}_0x2b17c0[_0xcd0f('0x31')]=qs['sort'](_0x42616c[_0xcd0f('0x29')]['sort']);_0x2b17c0[_0xcd0f('0x32')]=qs[_0xcd0f('0x2a')](_[_0xcd0f('0x33')](_0x42616c[_0xcd0f('0x29')],_0x553aa3[_0xcd0f('0x2a')]));if(_0x42616c['query'][_0xcd0f('0x34')]){_0x2b17c0[_0xcd0f('0x32')]=_[_0xcd0f('0x35')](_0x2b17c0[_0xcd0f('0x32')],{'$or':_['map'](_0x491405,function(_0x29bcf5){if(_0x29bcf5[_0xcd0f('0x36')][_0xcd0f('0x37')]!=='VIRTUAL'){var _0x527c2c={};_0x527c2c[_0x29bcf5['field']]={'$like':'%'+_0x42616c[_0xcd0f('0x29')]['filter']+'%'};return _0x527c2c;}})});}_0x2b17c0=_[_0xcd0f('0x35')]({},_0x2b17c0,_0x42616c[_0xcd0f('0x38')]);var _0x4d695e={'where':_0x2b17c0['where']};return db[_0xcd0f('0x25')][_0xcd0f('0x19')](_0x4d695e)[_0xcd0f('0x39')](function(_0x3f1f13){_0x722614[_0xcd0f('0x19')]=_0x3f1f13;if(_0x42616c[_0xcd0f('0x29')]['includeAll']){_0x2b17c0[_0xcd0f('0x3a')]=[{'all':!![]}];}return db['MailTransferReport'][_0xcd0f('0x3b')](_0x2b17c0);})[_0xcd0f('0x39')](function(_0xe1c4b1){_0x722614[_0xcd0f('0x3c')]=_0xe1c4b1;return _0x722614;})['then'](respondWithFilteredResult(_0x36f7e5,_0x2b17c0))[_0xcd0f('0x3d')](handleError(_0x36f7e5,null));};exports[_0xcd0f('0x3e')]=function(_0x5196c4,_0x18cd2c){var _0x55e769={'raw':!![],'where':{'id':_0x5196c4[_0xcd0f('0x3f')]['id']}},_0x4bd7eb={};_0x4bd7eb['model']=_[_0xcd0f('0x28')](db[_0xcd0f('0x25')][_0xcd0f('0x26')]);_0x4bd7eb['query']=_['keys'](_0x5196c4[_0xcd0f('0x29')]);_0x4bd7eb[_0xcd0f('0x2a')]=_[_0xcd0f('0x2b')](_0x4bd7eb['model'],_0x4bd7eb[_0xcd0f('0x29')]);_0x55e769['attributes']=_['intersection'](_0x4bd7eb['model'],qs[_0xcd0f('0x2c')](_0x5196c4[_0xcd0f('0x29')][_0xcd0f('0x2c')]));_0x55e769[_0xcd0f('0x2d')]=_0x55e769[_0xcd0f('0x2d')]['length']?_0x55e769['attributes']:_0x4bd7eb[_0xcd0f('0x27')];if(_0x5196c4[_0xcd0f('0x29')][_0xcd0f('0x40')]){_0x55e769[_0xcd0f('0x3a')]=[{'all':!![]}];}_0x55e769=_['merge']({},_0x55e769,_0x5196c4[_0xcd0f('0x38')]);return db[_0xcd0f('0x25')][_0xcd0f('0x41')](_0x55e769)[_0xcd0f('0x39')](handleEntityNotFound(_0x18cd2c,null))[_0xcd0f('0x39')](respondWithResult(_0x18cd2c,null))['catch'](handleError(_0x18cd2c,null));};exports[_0xcd0f('0x42')]=function(_0x1fafd3,_0x189f52){return db[_0xcd0f('0x25')]['create'](_0x1fafd3['body'],{})[_0xcd0f('0x39')](respondWithResult(_0x189f52,0xc9))['catch'](handleError(_0x189f52,null));};exports[_0xcd0f('0x43')]=function(_0x492d89,_0x50ac55){if(_0x492d89['body']['id']){delete _0x492d89[_0xcd0f('0x44')]['id'];}return db[_0xcd0f('0x25')][_0xcd0f('0x41')]({'where':{'id':_0x492d89[_0xcd0f('0x3f')]['id']}})[_0xcd0f('0x39')](handleEntityNotFound(_0x50ac55,null))[_0xcd0f('0x39')](saveUpdates(_0x492d89[_0xcd0f('0x44')],null))[_0xcd0f('0x39')](respondWithResult(_0x50ac55,null))[_0xcd0f('0x3d')](handleError(_0x50ac55,null));};exports[_0xcd0f('0x45')]=function(_0x44c4f0,_0x2fc605){return db[_0xcd0f('0x25')][_0xcd0f('0x41')]({'where':{'id':_0x44c4f0[_0xcd0f('0x3f')]['id']}})[_0xcd0f('0x39')](handleEntityNotFound(_0x2fc605,null))['then'](removeEntity(_0x2fc605,null))[_0xcd0f('0x3d')](handleError(_0x2fc605,null));};exports[_0xcd0f('0x46')]=function(_0x4c0918,_0x16f781){return db[_0xcd0f('0x25')][_0xcd0f('0x46')]()[_0xcd0f('0x39')](respondWithResult(_0x16f781,null))[_0xcd0f('0x3d')](handleError(_0x16f781,null));}; \ No newline at end of file +var _0x2c91=['merge','map','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','length','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','ejs','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','end','error','name','index','MailTransferReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x3910de,_0x3c395b){var _0x1ef471=function(_0x1106dc){while(--_0x1106dc){_0x3910de['push'](_0x3910de['shift']());}};_0x1ef471(++_0x3c395b);}(_0x2c91,0xe0));var _0x12c9=function(_0x5d4eec,_0x58b311){_0x5d4eec=_0x5d4eec-0x0;var _0x444ebb=_0x2c91[_0x5d4eec];return _0x444ebb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x12c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x12c9('0x1'));var jsonpatch=require(_0x12c9('0x2'));var rp=require(_0x12c9('0x3'));var moment=require('moment');var BPromise=require(_0x12c9('0x4'));var Mustache=require('mustache');var util=require(_0x12c9('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x12c9('0x6'));var fs=require('fs');var _=require(_0x12c9('0x7'));var squel=require(_0x12c9('0x8'));var crypto=require('crypto');var jsforce=require(_0x12c9('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x12c9('0xa'));var querystring=require(_0x12c9('0xb'));var Papa=require('papaparse');var Redis=require(_0x12c9('0xc'));var authService=require(_0x12c9('0xd'));var qs=require(_0x12c9('0xe'));var hardwareService=require(_0x12c9('0xf'));var logger=require(_0x12c9('0x10'))(_0x12c9('0x11'));var utils=require(_0x12c9('0x12'));var config=require(_0x12c9('0x13'));var db=require(_0x12c9('0x14'))['db'];function respondWithStatusCode(_0x1949f5,_0x223787){_0x223787=_0x223787||0xcc;return function(_0x180d37){if(_0x180d37){return _0x1949f5[_0x12c9('0x15')](_0x223787);}return _0x1949f5[_0x12c9('0x16')](_0x223787)['end']();};}function respondWithResult(_0x2527cd,_0x4244ad){_0x4244ad=_0x4244ad||0xc8;return function(_0x2e73c9){if(_0x2e73c9){return _0x2527cd['status'](_0x4244ad)[_0x12c9('0x17')](_0x2e73c9);}};}function respondWithFilteredResult(_0xd20d4e,_0xcaa73c){return function(_0x4ef497){if(_0x4ef497){var _0x34a18b=_0x4ef497[_0x12c9('0x18')],_0x140dbd=_0xcaa73c[_0x12c9('0x19')],_0x1d4222=_0xcaa73c[_0x12c9('0x19')]+_0xcaa73c[_0x12c9('0x1a')],_0x4877c2;if(_0x1d4222>=_0x34a18b){_0x1d4222=_0x34a18b;_0x4877c2=0xc8;}else{_0x4877c2=0xce;}_0xd20d4e[_0x12c9('0x16')](_0x4877c2);return _0xd20d4e[_0x12c9('0x1b')]('Content-Range',_0x140dbd+'-'+_0x1d4222+'/'+_0x34a18b)[_0x12c9('0x17')](_0x4ef497);}return null;};}function patchUpdates(_0x1a702e){return function(_0x3ae12f){try{jsonpatch[_0x12c9('0x1c')](_0x3ae12f,_0x1a702e,!![]);}catch(_0xe948b2){return BPromise[_0x12c9('0x1d')](_0xe948b2);}return _0x3ae12f['save']();};}function saveUpdates(_0x5a747c,_0x548564){return function(_0x260b85){if(_0x260b85){return _0x260b85[_0x12c9('0x1e')](_0x5a747c)[_0x12c9('0x1f')](function(_0x57566e){return _0x57566e;});}return null;};}function removeEntity(_0xad52a0,_0x11c778){return function(_0x16a2f5){if(_0x16a2f5){return _0x16a2f5['destroy']()[_0x12c9('0x1f')](function(){_0xad52a0[_0x12c9('0x16')](0xcc)[_0x12c9('0x20')]();});}};}function handleEntityNotFound(_0x18ed27,_0x4ac038){return function(_0x238b4f){if(!_0x238b4f){_0x18ed27['sendStatus'](0x194);}return _0x238b4f;};}function handleError(_0x2e1fa6,_0x2859dc){_0x2859dc=_0x2859dc||0x1f4;return function(_0x30998f){logger[_0x12c9('0x21')](_0x30998f['stack']);if(_0x30998f[_0x12c9('0x22')]){delete _0x30998f[_0x12c9('0x22')];}_0x2e1fa6[_0x12c9('0x16')](_0x2859dc)['send'](_0x30998f);};}exports[_0x12c9('0x23')]=function(_0x2e9a2c,_0x2c6620){var _0x9c142e={},_0x15ce86={},_0x2176f9={'count':0x0,'rows':[]};var _0x32af10=db[_0x12c9('0x24')][_0x12c9('0x25')];_0x15ce86[_0x12c9('0x26')]=_[_0x12c9('0x27')](_0x32af10);_0x15ce86['query']=_[_0x12c9('0x27')](_0x2e9a2c[_0x12c9('0x28')]);_0x15ce86[_0x12c9('0x29')]=_[_0x12c9('0x2a')](_0x15ce86[_0x12c9('0x26')],_0x15ce86['query']);_0x9c142e[_0x12c9('0x2b')]=_['intersection'](_0x15ce86[_0x12c9('0x26')],qs[_0x12c9('0x2c')](_0x2e9a2c['query'][_0x12c9('0x2c')]));_0x9c142e[_0x12c9('0x2b')]=_0x9c142e[_0x12c9('0x2b')]['length']?_0x9c142e[_0x12c9('0x2b')]:_0x15ce86[_0x12c9('0x26')];if(!_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x2d')](_0x12c9('0x2e'))){_0x9c142e['limit']=qs[_0x12c9('0x1a')](_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x1a')]);_0x9c142e['offset']=qs[_0x12c9('0x19')](_0x2e9a2c['query'][_0x12c9('0x19')]);}_0x9c142e[_0x12c9('0x2f')]=qs[_0x12c9('0x30')](_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x30')]);_0x9c142e['where']=qs['filters'](_[_0x12c9('0x31')](_0x2e9a2c['query'],_0x15ce86['filters']));if(_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x32')]){_0x9c142e[_0x12c9('0x33')]=_[_0x12c9('0x34')](_0x9c142e['where'],{'$or':_[_0x12c9('0x35')](_0x32af10,function(_0x4c4840){if(_0x4c4840['type'][_0x12c9('0x36')]!==_0x12c9('0x37')){var _0x550c49={};_0x550c49[_0x4c4840[_0x12c9('0x38')]]={'$like':'%'+_0x2e9a2c[_0x12c9('0x28')][_0x12c9('0x32')]+'%'};return _0x550c49;}})});}_0x9c142e=_['merge']({},_0x9c142e,_0x2e9a2c[_0x12c9('0x39')]);var _0x4bab23={'where':_0x9c142e[_0x12c9('0x33')]};return db[_0x12c9('0x24')][_0x12c9('0x18')](_0x4bab23)[_0x12c9('0x1f')](function(_0x4cd540){_0x2176f9['count']=_0x4cd540;if(_0x2e9a2c['query'][_0x12c9('0x3a')]){_0x9c142e[_0x12c9('0x3b')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x9c142e);})['then'](function(_0x1f051c){_0x2176f9[_0x12c9('0x3c')]=_0x1f051c;return _0x2176f9;})[_0x12c9('0x1f')](respondWithFilteredResult(_0x2c6620,_0x9c142e))[_0x12c9('0x3d')](handleError(_0x2c6620,null));};exports['show']=function(_0x3775a7,_0x30c826){var _0x5e3ded={'raw':!![],'where':{'id':_0x3775a7[_0x12c9('0x3e')]['id']}},_0x5af74f={};_0x5af74f[_0x12c9('0x26')]=_[_0x12c9('0x27')](db[_0x12c9('0x24')][_0x12c9('0x25')]);_0x5af74f[_0x12c9('0x28')]=_[_0x12c9('0x27')](_0x3775a7[_0x12c9('0x28')]);_0x5af74f[_0x12c9('0x29')]=_[_0x12c9('0x2a')](_0x5af74f[_0x12c9('0x26')],_0x5af74f['query']);_0x5e3ded['attributes']=_[_0x12c9('0x2a')](_0x5af74f[_0x12c9('0x26')],qs[_0x12c9('0x2c')](_0x3775a7[_0x12c9('0x28')]['fields']));_0x5e3ded[_0x12c9('0x2b')]=_0x5e3ded['attributes'][_0x12c9('0x3f')]?_0x5e3ded['attributes']:_0x5af74f[_0x12c9('0x26')];if(_0x3775a7[_0x12c9('0x28')][_0x12c9('0x3a')]){_0x5e3ded[_0x12c9('0x3b')]=[{'all':!![]}];}_0x5e3ded=_[_0x12c9('0x34')]({},_0x5e3ded,_0x3775a7['options']);return db[_0x12c9('0x24')][_0x12c9('0x40')](_0x5e3ded)[_0x12c9('0x1f')](handleEntityNotFound(_0x30c826,null))['then'](respondWithResult(_0x30c826,null))['catch'](handleError(_0x30c826,null));};exports['create']=function(_0x4caca2,_0x2f6d66){return db[_0x12c9('0x24')][_0x12c9('0x41')](_0x4caca2[_0x12c9('0x42')],{})[_0x12c9('0x1f')](respondWithResult(_0x2f6d66,0xc9))['catch'](handleError(_0x2f6d66,null));};exports[_0x12c9('0x1e')]=function(_0x324e4f,_0x3ee9ad){if(_0x324e4f[_0x12c9('0x42')]['id']){delete _0x324e4f[_0x12c9('0x42')]['id'];}return db[_0x12c9('0x24')][_0x12c9('0x40')]({'where':{'id':_0x324e4f[_0x12c9('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3ee9ad,null))[_0x12c9('0x1f')](saveUpdates(_0x324e4f['body'],null))[_0x12c9('0x1f')](respondWithResult(_0x3ee9ad,null))[_0x12c9('0x3d')](handleError(_0x3ee9ad,null));};exports[_0x12c9('0x43')]=function(_0x3a00a3,_0x5b5d13){return db[_0x12c9('0x24')]['find']({'where':{'id':_0x3a00a3['params']['id']}})[_0x12c9('0x1f')](handleEntityNotFound(_0x5b5d13,null))[_0x12c9('0x1f')](removeEntity(_0x5b5d13,null))[_0x12c9('0x3d')](handleError(_0x5b5d13,null));};exports[_0x12c9('0x44')]=function(_0xb7fc30,_0x44b95a){return db[_0x12c9('0x24')][_0x12c9('0x44')]()[_0x12c9('0x1f')](respondWithResult(_0x44b95a,null))['catch'](handleError(_0x44b95a,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 071d9e8..22d886e 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 _0x98a8=['../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x19e89a,_0x3ef7ac){var _0x45a88f=function(_0xd8e85c){while(--_0xd8e85c){_0x19e89a['push'](_0x19e89a['shift']());}};_0x45a88f(++_0x3ef7ac);}(_0x98a8,0x12c));var _0x898a=function(_0x2c9721,_0x5ae27f){_0x2c9721=_0x2c9721-0x0;var _0x442f35=_0x98a8[_0x2c9721];return _0x442f35;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var logger=require(_0x898a('0x2'))(_0x898a('0x3'));var moment=require(_0x898a('0x4'));var BPromise=require(_0x898a('0x5'));var rp=require(_0x898a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var attributes=require(_0x898a('0x9'));module[_0x898a('0xa')]=function(_0x3e7ddd,_0x5d7e59){return _0x3e7ddd[_0x898a('0xb')]('MailTransferReport',attributes,{'tableName':_0x898a('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x898a('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d58=['request-promise','rimraf','../../config/environment','exports','define','report_mail_transfer','uniqueid','bluebird'];(function(_0xaef393,_0x3bb479){var _0x180e7e=function(_0x50ab2b){while(--_0x50ab2b){_0xaef393['push'](_0xaef393['shift']());}};_0x180e7e(++_0x3bb479);}(_0x5d58,0x187));var _0x85d5=function(_0x3bb65a,_0x5bbec4){_0x3bb65a=_0x3bb65a-0x0;var _0x3c83ec=_0x5d58[_0x3bb65a];return _0x3c83ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x85d5('0x0'));var rp=require(_0x85d5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x85d5('0x2'));var config=require(_0x85d5('0x3'));var attributes=require('./mailTransferReport.attributes');module[_0x85d5('0x4')]=function(_0x2d457a,_0x578fad){return _0x2d457a[_0x85d5('0x5')]('MailTransferReport',attributes,{'tableName':_0x85d5('0x6'),'paranoid':![],'indexes':[{'name':_0x85d5('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index fb7cde1..caf2391 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 _0x576f=['error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5b5e4a,_0x2cb583){var _0x1d6784=function(_0xcedf3c){while(--_0xcedf3c){_0x5b5e4a['push'](_0x5b5e4a['shift']());}};_0x1d6784(++_0x2cb583);}(_0x576f,0x9d));var _0xf576=function(_0x15c4dc,_0x28c495){_0x15c4dc=_0x15c4dc-0x0;var _0x18b4c5=_0x576f[_0x15c4dc];return _0x18b4c5;};'use strict';var _=require(_0xf576('0x0'));var util=require(_0xf576('0x1'));var moment=require(_0xf576('0x2'));var BPromise=require('bluebird');var rs=require(_0xf576('0x3'));var fs=require('fs');var Redis=require(_0xf576('0x4'));var db=require(_0xf576('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf576('0x6'))(_0xf576('0x7'));var config=require(_0xf576('0x8'));var jayson=require(_0xf576('0x9'));var client=jayson[_0xf576('0xa')][_0xf576('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f058a,_0x3e7706,_0x22298b){return new BPromise(function(_0x278ace,_0x306d27){return client[_0xf576('0xc')](_0x5f058a,_0x22298b)[_0xf576('0xd')](function(_0x33c206){logger[_0xf576('0xe')](_0xf576('0xf'),_0x3e7706,'request\x20sent');logger['debug'](_0xf576('0x10'),_0x3e7706,_0xf576('0x11'),JSON[_0xf576('0x12')](_0x33c206));if(_0x33c206[_0xf576('0x13')]){if(_0x33c206[_0xf576('0x13')][_0xf576('0x14')]===0x1f4){logger['error'](_0xf576('0xf'),_0x3e7706,_0x33c206[_0xf576('0x13')][_0xf576('0x15')]);return _0x306d27(_0x33c206[_0xf576('0x13')]['message']);}logger[_0xf576('0x13')](_0xf576('0xf'),_0x3e7706,_0x33c206[_0xf576('0x13')][_0xf576('0x15')]);return _0x278ace(_0x33c206[_0xf576('0x13')][_0xf576('0x15')]);}else{logger[_0xf576('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x3e7706,_0xf576('0x11'));_0x278ace(_0x33c206['result']['message']);}})['catch'](function(_0x40e296){logger[_0xf576('0x13')](_0xf576('0xf'),_0x3e7706,_0x40e296);_0x306d27(_0x40e296);});});} \ No newline at end of file +var _0xfbef=['request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailTransferReport,\x20%s,\x20%s'];(function(_0x30aca4,_0x54b849){var _0x5a8dfb=function(_0x445070){while(--_0x445070){_0x30aca4['push'](_0x30aca4['shift']());}};_0x5a8dfb(++_0x54b849);}(_0xfbef,0x8d));var _0xffbe=function(_0x5e9e04,_0x28a45f){_0x5e9e04=_0x5e9e04-0x0;var _0x2909d7=_0xfbef[_0x5e9e04];return _0x2909d7;};'use strict';var _=require(_0xffbe('0x0'));var util=require('util');var moment=require(_0xffbe('0x1'));var BPromise=require('bluebird');var rs=require(_0xffbe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xffbe('0x3'));var logger=require(_0xffbe('0x4'))(_0xffbe('0x5'));var config=require(_0xffbe('0x6'));var jayson=require(_0xffbe('0x7'));var client=jayson[_0xffbe('0x8')][_0xffbe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5eb5ff,_0x23a6c2,_0x4068ef){return new BPromise(function(_0x5a9dab,_0x174710){return client[_0xffbe('0xa')](_0x5eb5ff,_0x4068ef)[_0xffbe('0xb')](function(_0x3614e6){logger['info'](_0xffbe('0xc'),_0x23a6c2,_0xffbe('0xd'));logger['debug'](_0xffbe('0xe'),_0x23a6c2,_0xffbe('0xd'),JSON[_0xffbe('0xf')](_0x3614e6));if(_0x3614e6[_0xffbe('0x10')]){if(_0x3614e6[_0xffbe('0x10')][_0xffbe('0x11')]===0x1f4){logger[_0xffbe('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x23a6c2,_0x3614e6[_0xffbe('0x10')][_0xffbe('0x12')]);return _0x174710(_0x3614e6[_0xffbe('0x10')][_0xffbe('0x12')]);}logger[_0xffbe('0x10')](_0xffbe('0xc'),_0x23a6c2,_0x3614e6['error'][_0xffbe('0x12')]);return _0x5a9dab(_0x3614e6[_0xffbe('0x10')][_0xffbe('0x12')]);}else{logger[_0xffbe('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x23a6c2,'request\x20sent');_0x5a9dab(_0x3614e6[_0xffbe('0x14')][_0xffbe('0x12')]);}})[_0xffbe('0x15')](function(_0x1bf310){logger[_0xffbe('0x10')](_0xffbe('0xc'),_0x23a6c2,_0x1bf310);_0x174710(_0x1bf310);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index ec5d0e2..a529b74 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 _0xe6df=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x2199db,_0x64fe69){var _0x1823bc=function(_0x4f849b){while(--_0x4f849b){_0x2199db['push'](_0x2199db['shift']());}};_0x1823bc(++_0x64fe69);}(_0xe6df,0xe2));var _0xfe6d=function(_0x2e6108,_0x385dd5){_0x2e6108=_0x2e6108-0x0;var _0x5150ee=_0xe6df[_0x2e6108];return _0x5150ee;};'use strict';var multer=require(_0xfe6d('0x0'));var util=require(_0xfe6d('0x1'));var path=require(_0xfe6d('0x2'));var timeout=require(_0xfe6d('0x3'));var express=require('express');var router=express[_0xfe6d('0x4')]();var auth=require(_0xfe6d('0x5'));var interaction=require(_0xfe6d('0x6'));var config=require('../../config/environment');var controller=require(_0xfe6d('0x7'));router[_0xfe6d('0x8')]('/',auth[_0xfe6d('0x9')](),controller[_0xfe6d('0xa')]);router[_0xfe6d('0x8')](_0xfe6d('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfe6d('0xc'),auth[_0xfe6d('0x9')](),controller[_0xfe6d('0xd')]);router['post']('/',auth[_0xfe6d('0x9')](),controller[_0xfe6d('0xe')]);router[_0xfe6d('0xf')](_0xfe6d('0xc'),auth[_0xfe6d('0x9')](),controller[_0xfe6d('0x10')]);router[_0xfe6d('0x11')]('/:id',auth[_0xfe6d('0x9')](),controller[_0xfe6d('0x12')]);module[_0xfe6d('0x13')]=router; \ No newline at end of file +var _0xacb9=['update','exports','multer','util','path','express','../../components/auth/service','./memberReport.controller','get','isAuthenticated','describe','show','put','/:id'];(function(_0x41174b,_0x44e5ac){var _0x1930a5=function(_0x5f3fef){while(--_0x5f3fef){_0x41174b['push'](_0x41174b['shift']());}};_0x1930a5(++_0x44e5ac);}(_0xacb9,0x128));var _0x9acb=function(_0x45c262,_0x2e3ce5){_0x45c262=_0x45c262-0x0;var _0x4f2ba6=_0xacb9[_0x45c262];return _0x4f2ba6;};'use strict';var multer=require(_0x9acb('0x0'));var util=require(_0x9acb('0x1'));var path=require(_0x9acb('0x2'));var timeout=require('connect-timeout');var express=require(_0x9acb('0x3'));var router=express['Router']();var auth=require(_0x9acb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9acb('0x5'));router[_0x9acb('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9acb('0x6')]('/describe',auth[_0x9acb('0x7')](),controller[_0x9acb('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9acb('0x9')]);router['post']('/',auth[_0x9acb('0x7')](),controller['create']);router[_0x9acb('0xa')](_0x9acb('0xb'),auth[_0x9acb('0x7')](),controller[_0x9acb('0xc')]);router['delete'](_0x9acb('0xb'),auth[_0x9acb('0x7')](),controller['destroy']);module[_0x9acb('0xd')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 24c96a8..0d937d6 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 _0x57b4=['DATE','getDataValue','enterAt','diff','seconds','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER'];(function(_0x282ed6,_0x1244f6){var _0x1f85ca=function(_0x2083b6){while(--_0x2083b6){_0x282ed6['push'](_0x282ed6['shift']());}};_0x1f85ca(++_0x1244f6);}(_0x57b4,0x9a));var _0x457b=function(_0x591d49,_0x14b323){_0x591d49=_0x591d49-0x0;var _0x48ab1e=_0x57b4[_0x591d49];return _0x48ab1e;};'use strict';var Sequelize=require(_0x457b('0x0'));var moment=require(_0x457b('0x1'));module[_0x457b('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x457b('0x3')]},'interface':{'type':Sequelize[_0x457b('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x457b('0x4')},'duration':{'type':Sequelize[_0x457b('0x5')]},'enterAt':{'type':Sequelize[_0x457b('0x6')]},'exitAt':{'type':Sequelize[_0x457b('0x6')],'set':function(_0x1614cb){var _0x12cdfd=moment(_0x1614cb);var _0x195b05=moment(this[_0x457b('0x7')](_0x457b('0x8')));var _0xa3aedc=_0x12cdfd[_0x457b('0x9')](_0x195b05,_0x457b('0xa'));this['setDataValue']('exitAt',_0x1614cb);this['setDataValue'](_0x457b('0xb'),_0xa3aedc||null);}},'data1':{'type':Sequelize[_0x457b('0x3')],'comment':_0x457b('0xc')},'data2':{'type':Sequelize[_0x457b('0x3')],'comment':_0x457b('0xd')},'data3':{'type':Sequelize[_0x457b('0x3')],'comment':_0x457b('0xe')},'data4':{'type':Sequelize['STRING'],'comment':_0x457b('0xf')},'data5':{'type':Sequelize[_0x457b('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x457b('0x3')]}}; \ No newline at end of file +var _0x77c5=['talk:[start]','talk:[destination]','talk:[queue]','sequelize','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x77c5,0x1b3));var _0x577c=function(_0x44d42a,_0xe76ad8){_0x44d42a=_0x44d42a-0x0;var _0x172b8f=_0x77c5[_0x44d42a];return _0x172b8f;};'use strict';var Sequelize=require(_0x577c('0x0'));var moment=require('moment');module[_0x577c('0x1')]={'channel':{'type':Sequelize[_0x577c('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x577c('0x2')]},'type':{'type':Sequelize[_0x577c('0x2')],'defaultValue':_0x577c('0x3'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x577c('0x4')]},'enterAt':{'type':Sequelize[_0x577c('0x5')]},'exitAt':{'type':Sequelize[_0x577c('0x5')],'set':function(_0xd12109){var _0x5ce5e5=moment(_0xd12109);var _0xb2c84=moment(this[_0x577c('0x6')]('enterAt'));var _0x48d88a=_0x5ce5e5[_0x577c('0x7')](_0xb2c84,_0x577c('0x8'));this[_0x577c('0x9')](_0x577c('0xa'),_0xd12109);this[_0x577c('0x9')](_0x577c('0xb'),_0x48d88a||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x577c('0xc')},'data2':{'type':Sequelize[_0x577c('0x2')],'comment':_0x577c('0xd')},'data3':{'type':Sequelize[_0x577c('0x2')],'comment':_0x577c('0xe')},'data4':{'type':Sequelize[_0x577c('0x2')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x577c('0x2')],'comment':_0x577c('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x577c('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index efbfabf..1a37100 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 _0x340b=['show','params','keys','includeAll','include','find','catch','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','index','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','MemberReport','findAll','rows'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x340b,0xeb));var _0xb340=function(_0x4a9f98,_0x11179f){_0x4a9f98=_0x4a9f98-0x0;var _0x118a06=_0x340b[_0x4a9f98];return _0x118a06;};'use strict';var pdf=require(_0xb340('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb340('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb340('0x2'));var rp=require(_0xb340('0x3'));var moment=require(_0xb340('0x4'));var BPromise=require(_0xb340('0x5'));var Mustache=require(_0xb340('0x6'));var util=require(_0xb340('0x7'));var path=require('path');var sox=require(_0xb340('0x8'));var csv=require('to-csv');var ejs=require(_0xb340('0x9'));var fs=require('fs');var _=require(_0xb340('0xa'));var squel=require(_0xb340('0xb'));var crypto=require(_0xb340('0xc'));var jsforce=require(_0xb340('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb340('0xe'));var querystring=require(_0xb340('0xf'));var Papa=require(_0xb340('0x10'));var Redis=require('ioredis');var authService=require(_0xb340('0x11'));var qs=require(_0xb340('0x12'));var hardwareService=require(_0xb340('0x13'));var logger=require(_0xb340('0x14'))(_0xb340('0x15'));var utils=require(_0xb340('0x16'));var config=require('../../config/environment');var db=require(_0xb340('0x17'))['db'];function respondWithStatusCode(_0x303c01,_0x3ed921){_0x3ed921=_0x3ed921||0xcc;return function(_0x138d35){if(_0x138d35){return _0x303c01['sendStatus'](_0x3ed921);}return _0x303c01[_0xb340('0x18')](_0x3ed921)[_0xb340('0x19')]();};}function respondWithResult(_0x3a0e1e,_0x1780bc){_0x1780bc=_0x1780bc||0xc8;return function(_0x49dd1f){if(_0x49dd1f){return _0x3a0e1e[_0xb340('0x18')](_0x1780bc)[_0xb340('0x1a')](_0x49dd1f);}};}function respondWithFilteredResult(_0x44a000,_0x12560f){return function(_0x5d3223){if(_0x5d3223){var _0x10c33d=_0x5d3223[_0xb340('0x1b')],_0x2eec33=_0x12560f[_0xb340('0x1c')],_0xa3a8ac=_0x12560f[_0xb340('0x1c')]+_0x12560f[_0xb340('0x1d')],_0x84946b;if(_0xa3a8ac>=_0x10c33d){_0xa3a8ac=_0x10c33d;_0x84946b=0xc8;}else{_0x84946b=0xce;}_0x44a000[_0xb340('0x18')](_0x84946b);return _0x44a000[_0xb340('0x1e')]('Content-Range',_0x2eec33+'-'+_0xa3a8ac+'/'+_0x10c33d)[_0xb340('0x1a')](_0x5d3223);}return null;};}function patchUpdates(_0x5b326b){return function(_0x35103c){try{jsonpatch[_0xb340('0x1f')](_0x35103c,_0x5b326b,!![]);}catch(_0x78c6ad){return BPromise[_0xb340('0x20')](_0x78c6ad);}return _0x35103c[_0xb340('0x21')]();};}function saveUpdates(_0x419704,_0x24ebb8){return function(_0xda074e){if(_0xda074e){return _0xda074e[_0xb340('0x22')](_0x419704)[_0xb340('0x23')](function(_0x3d4f33){return _0x3d4f33;});}return null;};}function removeEntity(_0x391fbd,_0x373bcc){return function(_0x41bcb1){if(_0x41bcb1){return _0x41bcb1[_0xb340('0x24')]()['then'](function(){_0x391fbd['status'](0xcc)[_0xb340('0x19')]();});}};}function handleEntityNotFound(_0xfeae92,_0x25ea21){return function(_0xaaeb7c){if(!_0xaaeb7c){_0xfeae92['sendStatus'](0x194);}return _0xaaeb7c;};}function handleError(_0x5353d3,_0xcd1705){_0xcd1705=_0xcd1705||0x1f4;return function(_0x24fc06){logger[_0xb340('0x25')](_0x24fc06['stack']);if(_0x24fc06['name']){delete _0x24fc06[_0xb340('0x26')];}_0x5353d3[_0xb340('0x18')](_0xcd1705)['send'](_0x24fc06);};}exports[_0xb340('0x27')]=function(_0x4ca2d2,_0x4292a8){var _0x5727c0={},_0x3019ef={},_0x192dad={'count':0x0,'rows':[]};var _0x3c43e5=db['MemberReport'][_0xb340('0x28')];_0x3019ef[_0xb340('0x29')]=_['keys'](_0x3c43e5);_0x3019ef[_0xb340('0x2a')]=_['keys'](_0x4ca2d2[_0xb340('0x2a')]);_0x3019ef['filters']=_['intersection'](_0x3019ef[_0xb340('0x29')],_0x3019ef['query']);_0x5727c0[_0xb340('0x2b')]=_[_0xb340('0x2c')](_0x3019ef[_0xb340('0x29')],qs[_0xb340('0x2d')](_0x4ca2d2[_0xb340('0x2a')][_0xb340('0x2d')]));_0x5727c0[_0xb340('0x2b')]=_0x5727c0[_0xb340('0x2b')][_0xb340('0x2e')]?_0x5727c0[_0xb340('0x2b')]:_0x3019ef['model'];if(!_0x4ca2d2[_0xb340('0x2a')][_0xb340('0x2f')](_0xb340('0x30'))){_0x5727c0[_0xb340('0x1d')]=qs[_0xb340('0x1d')](_0x4ca2d2['query'][_0xb340('0x1d')]);_0x5727c0['offset']=qs['offset'](_0x4ca2d2[_0xb340('0x2a')]['offset']);}_0x5727c0[_0xb340('0x31')]=qs['sort'](_0x4ca2d2[_0xb340('0x2a')][_0xb340('0x32')]);_0x5727c0[_0xb340('0x33')]=qs[_0xb340('0x34')](_[_0xb340('0x35')](_0x4ca2d2[_0xb340('0x2a')],_0x3019ef[_0xb340('0x34')]));if(_0x4ca2d2[_0xb340('0x2a')][_0xb340('0x36')]){_0x5727c0[_0xb340('0x33')]=_[_0xb340('0x37')](_0x5727c0['where'],{'$or':_[_0xb340('0x38')](_0x3c43e5,function(_0x3d1700){if(_0x3d1700[_0xb340('0x39')][_0xb340('0x3a')]!==_0xb340('0x3b')){var _0x5f5c58={};_0x5f5c58[_0x3d1700[_0xb340('0x3c')]]={'$like':'%'+_0x4ca2d2['query'][_0xb340('0x36')]+'%'};return _0x5f5c58;}})});}_0x5727c0=_[_0xb340('0x37')]({},_0x5727c0,_0x4ca2d2[_0xb340('0x3d')]);var _0x480841={'where':_0x5727c0[_0xb340('0x33')]};return db[_0xb340('0x3e')][_0xb340('0x1b')](_0x480841)['then'](function(_0x2951c9){_0x192dad[_0xb340('0x1b')]=_0x2951c9;if(_0x4ca2d2[_0xb340('0x2a')]['includeAll']){_0x5727c0['include']=[{'all':!![]}];}return db[_0xb340('0x3e')][_0xb340('0x3f')](_0x5727c0);})['then'](function(_0xab97aa){_0x192dad[_0xb340('0x40')]=_0xab97aa;return _0x192dad;})[_0xb340('0x23')](respondWithFilteredResult(_0x4292a8,_0x5727c0))['catch'](handleError(_0x4292a8,null));};exports[_0xb340('0x41')]=function(_0x2b83bb,_0x3859ec){var _0x3c0f78={'raw':!![],'where':{'id':_0x2b83bb[_0xb340('0x42')]['id']}},_0x218ffa={};_0x218ffa[_0xb340('0x29')]=_[_0xb340('0x43')](db[_0xb340('0x3e')][_0xb340('0x28')]);_0x218ffa[_0xb340('0x2a')]=_[_0xb340('0x43')](_0x2b83bb[_0xb340('0x2a')]);_0x218ffa[_0xb340('0x34')]=_['intersection'](_0x218ffa[_0xb340('0x29')],_0x218ffa[_0xb340('0x2a')]);_0x3c0f78['attributes']=_['intersection'](_0x218ffa[_0xb340('0x29')],qs[_0xb340('0x2d')](_0x2b83bb['query'][_0xb340('0x2d')]));_0x3c0f78['attributes']=_0x3c0f78[_0xb340('0x2b')][_0xb340('0x2e')]?_0x3c0f78[_0xb340('0x2b')]:_0x218ffa[_0xb340('0x29')];if(_0x2b83bb[_0xb340('0x2a')][_0xb340('0x44')]){_0x3c0f78[_0xb340('0x45')]=[{'all':!![]}];}_0x3c0f78=_[_0xb340('0x37')]({},_0x3c0f78,_0x2b83bb['options']);return db[_0xb340('0x3e')][_0xb340('0x46')](_0x3c0f78)[_0xb340('0x23')](handleEntityNotFound(_0x3859ec,null))[_0xb340('0x23')](respondWithResult(_0x3859ec,null))[_0xb340('0x47')](handleError(_0x3859ec,null));};exports['create']=function(_0x453f98,_0x4cd526){return db[_0xb340('0x3e')][_0xb340('0x48')](_0x453f98[_0xb340('0x49')],{})['then'](respondWithResult(_0x4cd526,0xc9))[_0xb340('0x47')](handleError(_0x4cd526,null));};exports[_0xb340('0x22')]=function(_0xc8f048,_0x37f444){if(_0xc8f048[_0xb340('0x49')]['id']){delete _0xc8f048['body']['id'];}return db[_0xb340('0x3e')]['find']({'where':{'id':_0xc8f048['params']['id']}})[_0xb340('0x23')](handleEntityNotFound(_0x37f444,null))[_0xb340('0x23')](saveUpdates(_0xc8f048['body'],null))[_0xb340('0x23')](respondWithResult(_0x37f444,null))['catch'](handleError(_0x37f444,null));};exports[_0xb340('0x24')]=function(_0x208a8d,_0x3ba11a){return db['MemberReport'][_0xb340('0x46')]({'where':{'id':_0x208a8d[_0xb340('0x42')]['id']}})[_0xb340('0x23')](handleEntityNotFound(_0x3ba11a,null))[_0xb340('0x23')](removeEntity(_0x3ba11a,null))[_0xb340('0x47')](handleError(_0x3ba11a,null));};exports[_0xb340('0x4a')]=function(_0x34cc68,_0x4c4cad){return db[_0xb340('0x3e')][_0xb340('0x4a')]()['then'](respondWithResult(_0x4c4cad,null))[_0xb340('0x47')](handleError(_0x4c4cad,null));}; \ No newline at end of file +var _0xd03f=['VIRTUAL','field','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','describe','html-pdf','eml-format','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','send','index','MemberReport','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','type','key'];(function(_0x5573f9,_0x4c006f){var _0x1619d8=function(_0x2df9d7){while(--_0x2df9d7){_0x5573f9['push'](_0x5573f9['shift']());}};_0x1619d8(++_0x4c006f);}(_0xd03f,0xf0));var _0xfd03=function(_0x486c24,_0x3b3097){_0x486c24=_0x486c24-0x0;var _0x5a5943=_0xd03f[_0x486c24];return _0x5a5943;};'use strict';var pdf=require(_0xfd03('0x0'));var emlformat=require(_0xfd03('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfd03('0x2'));var moment=require(_0xfd03('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfd03('0x4'));var path=require(_0xfd03('0x5'));var sox=require(_0xfd03('0x6'));var csv=require(_0xfd03('0x7'));var ejs=require(_0xfd03('0x8'));var fs=require('fs');var _=require(_0xfd03('0x9'));var squel=require(_0xfd03('0xa'));var crypto=require(_0xfd03('0xb'));var jsforce=require(_0xfd03('0xc'));var deskjs=require(_0xfd03('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfd03('0xe'));var Papa=require(_0xfd03('0xf'));var Redis=require(_0xfd03('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xfd03('0x11'));var hardwareService=require(_0xfd03('0x12'));var logger=require(_0xfd03('0x13'))(_0xfd03('0x14'));var utils=require(_0xfd03('0x15'));var config=require('../../config/environment');var db=require(_0xfd03('0x16'))['db'];function respondWithStatusCode(_0x105857,_0x4ba3c6){_0x4ba3c6=_0x4ba3c6||0xcc;return function(_0x4cfecd){if(_0x4cfecd){return _0x105857['sendStatus'](_0x4ba3c6);}return _0x105857[_0xfd03('0x17')](_0x4ba3c6)['end']();};}function respondWithResult(_0x4942ac,_0x204165){_0x204165=_0x204165||0xc8;return function(_0x209e18){if(_0x209e18){return _0x4942ac[_0xfd03('0x17')](_0x204165)['json'](_0x209e18);}};}function respondWithFilteredResult(_0x1eb9ea,_0x3e2611){return function(_0x125ec5){if(_0x125ec5){var _0x25469=_0x125ec5[_0xfd03('0x18')],_0x43a87f=_0x3e2611[_0xfd03('0x19')],_0x77d403=_0x3e2611[_0xfd03('0x19')]+_0x3e2611[_0xfd03('0x1a')],_0x1b9eec;if(_0x77d403>=_0x25469){_0x77d403=_0x25469;_0x1b9eec=0xc8;}else{_0x1b9eec=0xce;}_0x1eb9ea[_0xfd03('0x17')](_0x1b9eec);return _0x1eb9ea[_0xfd03('0x1b')](_0xfd03('0x1c'),_0x43a87f+'-'+_0x77d403+'/'+_0x25469)[_0xfd03('0x1d')](_0x125ec5);}return null;};}function patchUpdates(_0x14af04){return function(_0x3ed22e){try{jsonpatch[_0xfd03('0x1e')](_0x3ed22e,_0x14af04,!![]);}catch(_0x42bd01){return BPromise[_0xfd03('0x1f')](_0x42bd01);}return _0x3ed22e[_0xfd03('0x20')]();};}function saveUpdates(_0x2eed6c,_0x9045ec){return function(_0x3d879e){if(_0x3d879e){return _0x3d879e[_0xfd03('0x21')](_0x2eed6c)[_0xfd03('0x22')](function(_0x6eee9e){return _0x6eee9e;});}return null;};}function removeEntity(_0xeefaea,_0x3cb518){return function(_0x3ddd0c){if(_0x3ddd0c){return _0x3ddd0c[_0xfd03('0x23')]()[_0xfd03('0x22')](function(){_0xeefaea['status'](0xcc)[_0xfd03('0x24')]();});}};}function handleEntityNotFound(_0xfd9bd1,_0x3239c9){return function(_0x11ee06){if(!_0x11ee06){_0xfd9bd1[_0xfd03('0x25')](0x194);}return _0x11ee06;};}function handleError(_0x5cb2ad,_0x1c638a){_0x1c638a=_0x1c638a||0x1f4;return function(_0x1a641c){logger['error'](_0x1a641c[_0xfd03('0x26')]);if(_0x1a641c['name']){delete _0x1a641c['name'];}_0x5cb2ad[_0xfd03('0x17')](_0x1c638a)[_0xfd03('0x27')](_0x1a641c);};}exports[_0xfd03('0x28')]=function(_0x3fed09,_0x301b3a){var _0x530b3a={},_0x18388a={},_0x2658e8={'count':0x0,'rows':[]};var _0xa77b2b=db[_0xfd03('0x29')]['rawAttributes'];_0x18388a[_0xfd03('0x2a')]=_[_0xfd03('0x2b')](_0xa77b2b);_0x18388a[_0xfd03('0x2c')]=_[_0xfd03('0x2b')](_0x3fed09[_0xfd03('0x2c')]);_0x18388a[_0xfd03('0x2d')]=_[_0xfd03('0x2e')](_0x18388a[_0xfd03('0x2a')],_0x18388a['query']);_0x530b3a[_0xfd03('0x2f')]=_[_0xfd03('0x2e')](_0x18388a[_0xfd03('0x2a')],qs[_0xfd03('0x30')](_0x3fed09[_0xfd03('0x2c')][_0xfd03('0x30')]));_0x530b3a[_0xfd03('0x2f')]=_0x530b3a[_0xfd03('0x2f')][_0xfd03('0x31')]?_0x530b3a[_0xfd03('0x2f')]:_0x18388a[_0xfd03('0x2a')];if(!_0x3fed09[_0xfd03('0x2c')]['hasOwnProperty'](_0xfd03('0x32'))){_0x530b3a[_0xfd03('0x1a')]=qs[_0xfd03('0x1a')](_0x3fed09[_0xfd03('0x2c')]['limit']);_0x530b3a[_0xfd03('0x19')]=qs[_0xfd03('0x19')](_0x3fed09[_0xfd03('0x2c')][_0xfd03('0x19')]);}_0x530b3a[_0xfd03('0x33')]=qs[_0xfd03('0x34')](_0x3fed09[_0xfd03('0x2c')]['sort']);_0x530b3a[_0xfd03('0x35')]=qs['filters'](_[_0xfd03('0x36')](_0x3fed09[_0xfd03('0x2c')],_0x18388a[_0xfd03('0x2d')]));if(_0x3fed09['query'][_0xfd03('0x37')]){_0x530b3a[_0xfd03('0x35')]=_[_0xfd03('0x38')](_0x530b3a[_0xfd03('0x35')],{'$or':_[_0xfd03('0x39')](_0xa77b2b,function(_0x2fc226){if(_0x2fc226[_0xfd03('0x3a')][_0xfd03('0x3b')]!==_0xfd03('0x3c')){var _0x5c61cf={};_0x5c61cf[_0x2fc226[_0xfd03('0x3d')]]={'$like':'%'+_0x3fed09[_0xfd03('0x2c')][_0xfd03('0x37')]+'%'};return _0x5c61cf;}})});}_0x530b3a=_[_0xfd03('0x38')]({},_0x530b3a,_0x3fed09[_0xfd03('0x3e')]);var _0xa63697={'where':_0x530b3a['where']};return db['MemberReport'][_0xfd03('0x18')](_0xa63697)['then'](function(_0x397454){_0x2658e8[_0xfd03('0x18')]=_0x397454;if(_0x3fed09[_0xfd03('0x2c')]['includeAll']){_0x530b3a['include']=[{'all':!![]}];}return db[_0xfd03('0x29')][_0xfd03('0x3f')](_0x530b3a);})[_0xfd03('0x22')](function(_0x5a9e99){_0x2658e8[_0xfd03('0x40')]=_0x5a9e99;return _0x2658e8;})[_0xfd03('0x22')](respondWithFilteredResult(_0x301b3a,_0x530b3a))[_0xfd03('0x41')](handleError(_0x301b3a,null));};exports[_0xfd03('0x42')]=function(_0x5ddd28,_0x577059){var _0x55bbd7={'raw':!![],'where':{'id':_0x5ddd28[_0xfd03('0x43')]['id']}},_0x2bb848={};_0x2bb848[_0xfd03('0x2a')]=_[_0xfd03('0x2b')](db[_0xfd03('0x29')][_0xfd03('0x44')]);_0x2bb848[_0xfd03('0x2c')]=_[_0xfd03('0x2b')](_0x5ddd28[_0xfd03('0x2c')]);_0x2bb848[_0xfd03('0x2d')]=_[_0xfd03('0x2e')](_0x2bb848[_0xfd03('0x2a')],_0x2bb848[_0xfd03('0x2c')]);_0x55bbd7[_0xfd03('0x2f')]=_[_0xfd03('0x2e')](_0x2bb848[_0xfd03('0x2a')],qs[_0xfd03('0x30')](_0x5ddd28[_0xfd03('0x2c')][_0xfd03('0x30')]));_0x55bbd7['attributes']=_0x55bbd7[_0xfd03('0x2f')][_0xfd03('0x31')]?_0x55bbd7['attributes']:_0x2bb848[_0xfd03('0x2a')];if(_0x5ddd28[_0xfd03('0x2c')][_0xfd03('0x45')]){_0x55bbd7[_0xfd03('0x46')]=[{'all':!![]}];}_0x55bbd7=_[_0xfd03('0x38')]({},_0x55bbd7,_0x5ddd28[_0xfd03('0x3e')]);return db[_0xfd03('0x29')][_0xfd03('0x47')](_0x55bbd7)[_0xfd03('0x22')](handleEntityNotFound(_0x577059,null))[_0xfd03('0x22')](respondWithResult(_0x577059,null))[_0xfd03('0x41')](handleError(_0x577059,null));};exports[_0xfd03('0x48')]=function(_0x3ed7e6,_0x16e4e8){return db[_0xfd03('0x29')][_0xfd03('0x48')](_0x3ed7e6['body'],{})['then'](respondWithResult(_0x16e4e8,0xc9))[_0xfd03('0x41')](handleError(_0x16e4e8,null));};exports[_0xfd03('0x21')]=function(_0x531a41,_0xb30925){if(_0x531a41['body']['id']){delete _0x531a41[_0xfd03('0x49')]['id'];}return db[_0xfd03('0x29')][_0xfd03('0x47')]({'where':{'id':_0x531a41[_0xfd03('0x43')]['id']}})[_0xfd03('0x22')](handleEntityNotFound(_0xb30925,null))[_0xfd03('0x22')](saveUpdates(_0x531a41[_0xfd03('0x49')],null))['then'](respondWithResult(_0xb30925,null))[_0xfd03('0x41')](handleError(_0xb30925,null));};exports[_0xfd03('0x23')]=function(_0x4906fb,_0x3c411a){return db[_0xfd03('0x29')]['find']({'where':{'id':_0x4906fb[_0xfd03('0x43')]['id']}})[_0xfd03('0x22')](handleEntityNotFound(_0x3c411a,null))[_0xfd03('0x22')](removeEntity(_0x3c411a,null))[_0xfd03('0x41')](handleError(_0x3c411a,null));};exports[_0xfd03('0x4a')]=function(_0x1e2cbe,_0x3b485e){return db[_0xfd03('0x29')][_0xfd03('0x4a')]()[_0xfd03('0x22')](respondWithResult(_0x3b485e,null))[_0xfd03('0x41')](handleError(_0x3b485e,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index d91f555..9d3b39f 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 _0x952a=['report_member','membername_interface','membername','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./memberReport.attributes','define','MemberReport'];(function(_0x599e2b,_0x3bcad4){var _0x38ff46=function(_0x26fb5b){while(--_0x26fb5b){_0x599e2b['push'](_0x599e2b['shift']());}};_0x38ff46(++_0x3bcad4);}(_0x952a,0x1df));var _0xa952=function(_0x232fb3,_0x489013){_0x232fb3=_0x232fb3-0x0;var _0x119086=_0x952a[_0x232fb3];return _0x119086;};'use strict';var _=require(_0xa952('0x0'));var util=require(_0xa952('0x1'));var logger=require(_0xa952('0x2'))(_0xa952('0x3'));var moment=require(_0xa952('0x4'));var BPromise=require(_0xa952('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa952('0x6'));var rimraf=require(_0xa952('0x7'));var config=require('../../config/environment');var attributes=require(_0xa952('0x8'));module['exports']=function(_0xc78f80,_0x12647e){return _0xc78f80[_0xa952('0x9')](_0xa952('0xa'),attributes,{'tableName':_0xa952('0xb'),'paranoid':![],'indexes':[{'name':_0xa952('0xc'),'fields':[_0xa952('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa6f0=['../../config/environment','exports','define','report_member','interface','util','../../config/logger','bluebird','rimraf'];(function(_0x44a784,_0x479da0){var _0x70d93a=function(_0x2774b8){while(--_0x2774b8){_0x44a784['push'](_0x44a784['shift']());}};_0x70d93a(++_0x479da0);}(_0xa6f0,0x1be));var _0x0a6f=function(_0x9463b5,_0x2707ba){_0x9463b5=_0x9463b5-0x0;var _0x4ca799=_0xa6f0[_0x9463b5];return _0x4ca799;};'use strict';var _=require('lodash');var util=require(_0x0a6f('0x0'));var logger=require(_0x0a6f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x0a6f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0a6f('0x3'));var config=require(_0x0a6f('0x4'));var attributes=require('./memberReport.attributes');module[_0x0a6f('0x5')]=function(_0x5c0b20,_0xb5161a){return _0x5c0b20[_0x0a6f('0x6')]('MemberReport',attributes,{'tableName':_0x0a6f('0x7'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0x0a6f('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index aa945e4..43692c4 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 _0x3251=['result','GetMemberReport','options','raw','where','attributes','limit','include','map','model','catch','CreateMemberReport','MemberReport','create','UpdateMemberReport','update','body','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x407654,_0x275ae3){var _0x521dbd=function(_0x355b83){while(--_0x355b83){_0x407654['push'](_0x407654['shift']());}};_0x521dbd(++_0x275ae3);}(_0x3251,0x10d));var _0x1325=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x3251[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x1325('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1325('0x1'));var rs=require(_0x1325('0x2'));var fs=require('fs');var Redis=require(_0x1325('0x3'));var db=require(_0x1325('0x4'))['db'];var utils=require(_0x1325('0x5'));var logger=require(_0x1325('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1325('0x7'));var client=jayson['client'][_0x1325('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ee0de,_0xc515e9,_0x51d0f5){return new BPromise(function(_0x4ae684,_0x135b4f){return client[_0x1325('0x9')](_0x2ee0de,_0x51d0f5)[_0x1325('0xa')](function(_0x492f84){logger['info'](_0x1325('0xb'),_0xc515e9,_0x1325('0xc'));logger[_0x1325('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0xc515e9,_0x1325('0xc'),JSON[_0x1325('0xe')](_0x492f84));if(_0x492f84[_0x1325('0xf')]){if(_0x492f84[_0x1325('0xf')][_0x1325('0x10')]===0x1f4){logger[_0x1325('0xf')](_0x1325('0xb'),_0xc515e9,_0x492f84[_0x1325('0xf')][_0x1325('0x11')]);return _0x135b4f(_0x492f84[_0x1325('0xf')][_0x1325('0x11')]);}logger[_0x1325('0xf')](_0x1325('0xb'),_0xc515e9,_0x492f84['error'][_0x1325('0x11')]);return _0x4ae684(_0x492f84[_0x1325('0xf')][_0x1325('0x11')]);}else{logger[_0x1325('0x12')](_0x1325('0xb'),_0xc515e9,_0x1325('0xc'));_0x4ae684(_0x492f84[_0x1325('0x13')][_0x1325('0x11')]);}})['catch'](function(_0x4ebe7d){logger[_0x1325('0xf')](_0x1325('0xb'),_0xc515e9,_0x4ebe7d);_0x135b4f(_0x4ebe7d);});});}exports[_0x1325('0x14')]=function(_0x472ed9){var _0x81d83e=this;return new Promise(function(_0x5ec570,_0x34eb59){return db['MemberReport']['findAll']({'raw':_0x472ed9[_0x1325('0x15')]?_0x472ed9[_0x1325('0x15')][_0x1325('0x16')]===undefined?!![]:![]:!![],'where':_0x472ed9[_0x1325('0x15')]?_0x472ed9[_0x1325('0x15')][_0x1325('0x17')]||null:null,'attributes':_0x472ed9[_0x1325('0x15')]?_0x472ed9[_0x1325('0x15')][_0x1325('0x18')]||null:null,'limit':_0x472ed9[_0x1325('0x15')]?_0x472ed9['options'][_0x1325('0x19')]||null:null,'include':_0x472ed9[_0x1325('0x15')]?_0x472ed9[_0x1325('0x15')][_0x1325('0x1a')]?_[_0x1325('0x1b')](_0x472ed9[_0x1325('0x15')][_0x1325('0x1a')],function(_0x21cdb4){return{'model':db[_0x21cdb4[_0x1325('0x1c')]],'as':_0x21cdb4['as'],'attributes':_0x21cdb4['attributes'],'include':_0x21cdb4[_0x1325('0x1a')]?_[_0x1325('0x1b')](_0x21cdb4[_0x1325('0x1a')],function(_0x3ed743){return{'model':db[_0x3ed743[_0x1325('0x1c')]],'as':_0x3ed743['as'],'attributes':_0x3ed743[_0x1325('0x18')],'include':_0x3ed743[_0x1325('0x1a')]?_[_0x1325('0x1b')](_0x3ed743[_0x1325('0x1a')],function(_0x39f37b){return{'model':db[_0x39f37b[_0x1325('0x1c')]],'as':_0x39f37b['as'],'attributes':_0x39f37b[_0x1325('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f332e){logger[_0x1325('0x12')](_0x1325('0x14'),_0x472ed9);logger[_0x1325('0xd')](_0x1325('0x14'),_0x472ed9,JSON['stringify'](_0x4f332e));_0x5ec570(_0x4f332e);})[_0x1325('0x1d')](function(_0x4ca277){logger[_0x1325('0xf')](_0x1325('0x14'),_0x4ca277[_0x1325('0x11')],_0x472ed9);_0x34eb59(_0x81d83e[_0x1325('0xf')](0x1f4,_0x4ca277[_0x1325('0x11')]));});});};exports[_0x1325('0x1e')]=function(_0x2f2a94){var _0x312a6=this;return new Promise(function(_0x440a76,_0x4c0f41){return db[_0x1325('0x1f')][_0x1325('0x20')](_0x2f2a94['body'],{'raw':_0x2f2a94[_0x1325('0x15')]?_0x2f2a94[_0x1325('0x15')][_0x1325('0x16')]===undefined?!![]:![]:!![]})[_0x1325('0xa')](function(_0x215ade){logger['info'](_0x1325('0x1e'),_0x2f2a94);logger['debug'](_0x1325('0x1e'),_0x2f2a94,JSON['stringify'](_0x215ade));_0x440a76(_0x215ade);})[_0x1325('0x1d')](function(_0x421c99){logger['error'](_0x1325('0x1e'),_0x421c99[_0x1325('0x11')],_0x2f2a94);_0x4c0f41(_0x312a6[_0x1325('0xf')](0x1f4,_0x421c99[_0x1325('0x11')]));});});};exports[_0x1325('0x21')]=function(_0x3467d6){var _0x1a32bd=this;return new Promise(function(_0x29e11c,_0x1f0c05){return db[_0x1325('0x1f')][_0x1325('0x22')](_0x3467d6[_0x1325('0x23')],{'raw':_0x3467d6['options']?_0x3467d6[_0x1325('0x15')][_0x1325('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3467d6[_0x1325('0x15')]?_0x3467d6[_0x1325('0x15')][_0x1325('0x17')]||null:null,'attributes':_0x3467d6[_0x1325('0x15')]?_0x3467d6['options'][_0x1325('0x18')]||null:null,'limit':_0x3467d6[_0x1325('0x15')]?_0x3467d6[_0x1325('0x15')]['limit']||null:null})['then'](function(_0x29f9dd){logger['info']('UpdateMemberReport',_0x3467d6);logger['debug'](_0x1325('0x21'),_0x3467d6,JSON[_0x1325('0xe')](_0x29f9dd));_0x29e11c(_0x29f9dd);})[_0x1325('0x1d')](function(_0x27196c){logger[_0x1325('0xf')](_0x1325('0x21'),_0x27196c[_0x1325('0x11')],_0x3467d6);_0x1f0c05(_0x1a32bd[_0x1325('0xf')](0x1f4,_0x27196c[_0x1325('0x11')]));});});}; \ No newline at end of file +var _0x088d=['UpdateMemberReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','map','include','model','create','raw','CreateMemberReport'];(function(_0x699049,_0x51d7d6){var _0x5e25e4=function(_0x331b29){while(--_0x331b29){_0x699049['push'](_0x699049['shift']());}};_0x5e25e4(++_0x51d7d6);}(_0x088d,0xb6));var _0xd088=function(_0x64d133,_0x566118){_0x64d133=_0x64d133-0x0;var _0x2e558d=_0x088d[_0x64d133];return _0x2e558d;};'use strict';var _=require(_0xd088('0x0'));var util=require(_0xd088('0x1'));var moment=require(_0xd088('0x2'));var BPromise=require(_0xd088('0x3'));var rs=require(_0xd088('0x4'));var fs=require('fs');var Redis=require(_0xd088('0x5'));var db=require(_0xd088('0x6'))['db'];var utils=require(_0xd088('0x7'));var logger=require('../../config/logger')(_0xd088('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xd088('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b7303,_0x121e0b,_0x2ab21b){return new BPromise(function(_0x1cbba2,_0x36df4){return client[_0xd088('0xa')](_0x2b7303,_0x2ab21b)[_0xd088('0xb')](function(_0x347a3a){logger[_0xd088('0xc')](_0xd088('0xd'),_0x121e0b,_0xd088('0xe'));logger[_0xd088('0xf')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x121e0b,_0xd088('0xe'),JSON[_0xd088('0x10')](_0x347a3a));if(_0x347a3a[_0xd088('0x11')]){if(_0x347a3a['error']['code']===0x1f4){logger[_0xd088('0x11')]('MemberReport,\x20%s,\x20%s',_0x121e0b,_0x347a3a['error'][_0xd088('0x12')]);return _0x36df4(_0x347a3a[_0xd088('0x11')][_0xd088('0x12')]);}logger[_0xd088('0x11')](_0xd088('0xd'),_0x121e0b,_0x347a3a[_0xd088('0x11')]['message']);return _0x1cbba2(_0x347a3a[_0xd088('0x11')][_0xd088('0x12')]);}else{logger[_0xd088('0xc')](_0xd088('0xd'),_0x121e0b,'request\x20sent');_0x1cbba2(_0x347a3a[_0xd088('0x13')][_0xd088('0x12')]);}})[_0xd088('0x14')](function(_0x3af792){logger[_0xd088('0x11')](_0xd088('0xd'),_0x121e0b,_0x3af792);_0x36df4(_0x3af792);});});}exports[_0xd088('0x15')]=function(_0x4f89a4){var _0x393534=this;return new Promise(function(_0x145ea0,_0x46e8f5){return db[_0xd088('0x16')][_0xd088('0x17')]({'raw':_0x4f89a4['options']?_0x4f89a4[_0xd088('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4f89a4[_0xd088('0x18')]?_0x4f89a4[_0xd088('0x18')][_0xd088('0x19')]||null:null,'attributes':_0x4f89a4[_0xd088('0x18')]?_0x4f89a4[_0xd088('0x18')][_0xd088('0x1a')]||null:null,'limit':_0x4f89a4[_0xd088('0x18')]?_0x4f89a4[_0xd088('0x18')][_0xd088('0x1b')]||null:null,'include':_0x4f89a4['options']?_0x4f89a4[_0xd088('0x18')]['include']?_[_0xd088('0x1c')](_0x4f89a4[_0xd088('0x18')][_0xd088('0x1d')],function(_0x105d27){return{'model':db[_0x105d27[_0xd088('0x1e')]],'as':_0x105d27['as'],'attributes':_0x105d27[_0xd088('0x1a')],'include':_0x105d27['include']?_['map'](_0x105d27['include'],function(_0x1522c7){return{'model':db[_0x1522c7['model']],'as':_0x1522c7['as'],'attributes':_0x1522c7['attributes'],'include':_0x1522c7['include']?_['map'](_0x1522c7['include'],function(_0x2b237b){return{'model':db[_0x2b237b['model']],'as':_0x2b237b['as'],'attributes':_0x2b237b['attributes']};}):[]};}):[]};}):[]:[]})[_0xd088('0xb')](function(_0x21c339){logger['info']('GetMemberReport',_0x4f89a4);logger[_0xd088('0xf')]('GetMemberReport',_0x4f89a4,JSON['stringify'](_0x21c339));_0x145ea0(_0x21c339);})[_0xd088('0x14')](function(_0x452a21){logger[_0xd088('0x11')](_0xd088('0x15'),_0x452a21[_0xd088('0x12')],_0x4f89a4);_0x46e8f5(_0x393534['error'](0x1f4,_0x452a21[_0xd088('0x12')]));});});};exports['CreateMemberReport']=function(_0x1d4f79){var _0x46264c=this;return new Promise(function(_0x5daa50,_0xc6af85){return db['MemberReport'][_0xd088('0x1f')](_0x1d4f79['body'],{'raw':_0x1d4f79[_0xd088('0x18')]?_0x1d4f79['options'][_0xd088('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0xeaada2){logger[_0xd088('0xc')](_0xd088('0x21'),_0x1d4f79);logger[_0xd088('0xf')]('CreateMemberReport',_0x1d4f79,JSON[_0xd088('0x10')](_0xeaada2));_0x5daa50(_0xeaada2);})[_0xd088('0x14')](function(_0x2f017c){logger[_0xd088('0x11')]('CreateMemberReport',_0x2f017c[_0xd088('0x12')],_0x1d4f79);_0xc6af85(_0x46264c[_0xd088('0x11')](0x1f4,_0x2f017c[_0xd088('0x12')]));});});};exports[_0xd088('0x22')]=function(_0x39f263){var _0x50ba41=this;return new Promise(function(_0x40d4d5,_0x223106){return db[_0xd088('0x16')][_0xd088('0x23')](_0x39f263['body'],{'raw':_0x39f263[_0xd088('0x18')]?_0x39f263['options'][_0xd088('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39f263['options']?_0x39f263['options'][_0xd088('0x19')]||null:null,'attributes':_0x39f263[_0xd088('0x18')]?_0x39f263[_0xd088('0x18')]['attributes']||null:null,'limit':_0x39f263[_0xd088('0x18')]?_0x39f263[_0xd088('0x18')][_0xd088('0x1b')]||null:null})[_0xd088('0xb')](function(_0x994c9f){logger[_0xd088('0xc')](_0xd088('0x22'),_0x39f263);logger[_0xd088('0xf')](_0xd088('0x22'),_0x39f263,JSON['stringify'](_0x994c9f));_0x40d4d5(_0x994c9f);})[_0xd088('0x14')](function(_0x1e6e2a){logger[_0xd088('0x11')](_0xd088('0x22'),_0x1e6e2a[_0xd088('0x12')],_0x39f263);_0x223106(_0x50ba41['error'](0x1f4,_0x1e6e2a[_0xd088('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 175da22..9d7f10e 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 _0xbb2f=['../../config/environment','./migration.controller','get','index','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x9f8752,_0x2ba064){var _0x5cf5ed=function(_0xb604dd){while(--_0xb604dd){_0x9f8752['push'](_0x9f8752['shift']());}};_0x5cf5ed(++_0x2ba064);}(_0xbb2f,0x1e9));var _0xfbb2=function(_0x2f272f,_0x2d6ff8){_0x2f272f=_0x2f272f-0x0;var _0x5cac20=_0xbb2f[_0x2f272f];return _0x5cac20;};'use strict';var multer=require('multer');var util=require(_0xfbb2('0x0'));var path=require(_0xfbb2('0x1'));var timeout=require(_0xfbb2('0x2'));var express=require(_0xfbb2('0x3'));var router=express['Router']();var auth=require(_0xfbb2('0x4'));var interaction=require(_0xfbb2('0x5'));var config=require(_0xfbb2('0x6'));var controller=require(_0xfbb2('0x7'));router[_0xfbb2('0x8')]('/',controller[_0xfbb2('0x9')]);module[_0xfbb2('0xa')]=router; \ No newline at end of file +var _0x8cfd=['Router','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer','util','path','express'];(function(_0x5169f5,_0x5065e7){var _0x330776=function(_0x136666){while(--_0x136666){_0x5169f5['push'](_0x5169f5['shift']());}};_0x330776(++_0x5065e7);}(_0x8cfd,0xa6));var _0xd8cf=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0x8cfd[_0x367361];return _0x195d2d;};'use strict';var multer=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var path=require(_0xd8cf('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8cf('0x3'));var router=express[_0xd8cf('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd8cf('0x5'));var config=require(_0xd8cf('0x6'));var controller=require(_0xd8cf('0x7'));router[_0xd8cf('0x8')]('/',controller['index']);module[_0xd8cf('0x9')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 94e89de..d02b82d 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 _0x3fca=['STRING'];(function(_0x35a457,_0x32428b){var _0x4474c1=function(_0x2c1b18){while(--_0x2c1b18){_0x35a457['push'](_0x35a457['shift']());}};_0x4474c1(++_0x32428b);}(_0x3fca,0x146));var _0xa3fc=function(_0x35822e,_0x57fc23){_0x35822e=_0x35822e-0x0;var _0x4a16c2=_0x3fca[_0x35822e];return _0x4a16c2;};'use strict';var Sequelize=require('sequelize');module['exports']={'version':{'type':Sequelize[_0xa3fc('0x0')],'unique':'version'}}; \ No newline at end of file +var _0xf4cf=['exports','STRING','version','sequelize'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf4cf,0x107));var _0xff4c=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xf4cf[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require(_0xff4c('0x0'));module[_0xff4c('0x1')]={'version':{'type':Sequelize[_0xff4c('0x2')],'unique':_0xff4c('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index bc5018e..af8e7bb 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 _0x256f=['sendStatus','error','stack','name','send','index','Migration','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filter','merge','type','key','VIRTUAL','field','options','include','findAll','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','count','offset','set','Content-Range','json','reject','update','then','destroy','end'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x256f,0x1de));var _0xf256=function(_0x37eff2,_0x5c1639){_0x37eff2=_0x37eff2-0x0;var _0x3c9e7f=_0x256f[_0x37eff2];return _0x3c9e7f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf256('0x0'));var rimraf=require(_0xf256('0x1'));var zipdir=require(_0xf256('0x2'));var jsonpatch=require(_0xf256('0x3'));var rp=require('request-promise');var moment=require(_0xf256('0x4'));var BPromise=require(_0xf256('0x5'));var Mustache=require('mustache');var util=require(_0xf256('0x6'));var path=require(_0xf256('0x7'));var sox=require(_0xf256('0x8'));var csv=require(_0xf256('0x9'));var ejs=require(_0xf256('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf256('0xb'));var crypto=require('crypto');var jsforce=require(_0xf256('0xc'));var deskjs=require(_0xf256('0xd'));var toCsv=require(_0xf256('0x9'));var querystring=require(_0xf256('0xe'));var Papa=require(_0xf256('0xf'));var Redis=require(_0xf256('0x10'));var authService=require(_0xf256('0x11'));var qs=require(_0xf256('0x12'));var hardwareService=require(_0xf256('0x13'));var logger=require(_0xf256('0x14'))('api');var utils=require(_0xf256('0x15'));var config=require('../../config/environment');var db=require(_0xf256('0x16'))['db'];function respondWithStatusCode(_0xdbb660,_0x4929b1){_0x4929b1=_0x4929b1||0xcc;return function(_0x5a38d4){if(_0x5a38d4){return _0xdbb660['sendStatus'](_0x4929b1);}return _0xdbb660[_0xf256('0x17')](_0x4929b1)['end']();};}function respondWithResult(_0x45a702,_0x4751bb){_0x4751bb=_0x4751bb||0xc8;return function(_0x379711){if(_0x379711){return _0x45a702[_0xf256('0x17')](_0x4751bb)['json'](_0x379711);}};}function respondWithFilteredResult(_0x45b0c9,_0x37660a){return function(_0x188cac){if(_0x188cac){var _0x41a836=_0x188cac[_0xf256('0x18')],_0x480900=_0x37660a['offset'],_0x3aba14=_0x37660a[_0xf256('0x19')]+_0x37660a['limit'],_0x8c7d27;if(_0x3aba14>=_0x41a836){_0x3aba14=_0x41a836;_0x8c7d27=0xc8;}else{_0x8c7d27=0xce;}_0x45b0c9[_0xf256('0x17')](_0x8c7d27);return _0x45b0c9[_0xf256('0x1a')](_0xf256('0x1b'),_0x480900+'-'+_0x3aba14+'/'+_0x41a836)[_0xf256('0x1c')](_0x188cac);}return null;};}function patchUpdates(_0x18861d){return function(_0x4959f6){try{jsonpatch['apply'](_0x4959f6,_0x18861d,!![]);}catch(_0x118776){return BPromise[_0xf256('0x1d')](_0x118776);}return _0x4959f6['save']();};}function saveUpdates(_0x42ea64,_0x476c91){return function(_0xd3c82b){if(_0xd3c82b){return _0xd3c82b[_0xf256('0x1e')](_0x42ea64)[_0xf256('0x1f')](function(_0x6fa126){return _0x6fa126;});}return null;};}function removeEntity(_0x4470c1,_0x13491e){return function(_0x59770e){if(_0x59770e){return _0x59770e[_0xf256('0x20')]()[_0xf256('0x1f')](function(){_0x4470c1['status'](0xcc)[_0xf256('0x21')]();});}};}function handleEntityNotFound(_0x13efb1,_0x32e046){return function(_0x82c29){if(!_0x82c29){_0x13efb1[_0xf256('0x22')](0x194);}return _0x82c29;};}function handleError(_0x423ab9,_0x40b7cf){_0x40b7cf=_0x40b7cf||0x1f4;return function(_0x46ea1d){logger[_0xf256('0x23')](_0x46ea1d[_0xf256('0x24')]);if(_0x46ea1d[_0xf256('0x25')]){delete _0x46ea1d[_0xf256('0x25')];}_0x423ab9['status'](_0x40b7cf)[_0xf256('0x26')](_0x46ea1d);};}exports[_0xf256('0x27')]=function(_0x5b493f,_0x474b76){var _0x5eda38={},_0x432db7={},_0x5c268f={'count':0x0,'rows':[]};var _0x3f7c47=db[_0xf256('0x28')]['rawAttributes'];_0x432db7[_0xf256('0x29')]=_[_0xf256('0x2a')](_0x3f7c47);_0x432db7[_0xf256('0x2b')]=_['keys'](_0x5b493f[_0xf256('0x2b')]);_0x432db7[_0xf256('0x2c')]=_[_0xf256('0x2d')](_0x432db7['model'],_0x432db7['query']);_0x5eda38['attributes']=_[_0xf256('0x2d')](_0x432db7[_0xf256('0x29')],qs[_0xf256('0x2e')](_0x5b493f[_0xf256('0x2b')][_0xf256('0x2e')]));_0x5eda38['attributes']=_0x5eda38[_0xf256('0x2f')][_0xf256('0x30')]?_0x5eda38[_0xf256('0x2f')]:_0x432db7[_0xf256('0x29')];if(!_0x5b493f[_0xf256('0x2b')]['hasOwnProperty'](_0xf256('0x31'))){_0x5eda38[_0xf256('0x32')]=qs[_0xf256('0x32')](_0x5b493f[_0xf256('0x2b')][_0xf256('0x32')]);_0x5eda38[_0xf256('0x19')]=qs[_0xf256('0x19')](_0x5b493f[_0xf256('0x2b')][_0xf256('0x19')]);}_0x5eda38[_0xf256('0x33')]=qs[_0xf256('0x34')](_0x5b493f[_0xf256('0x2b')][_0xf256('0x34')]);_0x5eda38[_0xf256('0x35')]=qs['filters'](_['pick'](_0x5b493f[_0xf256('0x2b')],_0x432db7[_0xf256('0x2c')]));if(_0x5b493f[_0xf256('0x2b')][_0xf256('0x36')]){_0x5eda38[_0xf256('0x35')]=_[_0xf256('0x37')](_0x5eda38['where'],{'$or':_['map'](_0x3f7c47,function(_0x55ea21){if(_0x55ea21[_0xf256('0x38')][_0xf256('0x39')]!==_0xf256('0x3a')){var _0x36519a={};_0x36519a[_0x55ea21[_0xf256('0x3b')]]={'$like':'%'+_0x5b493f['query'][_0xf256('0x36')]+'%'};return _0x36519a;}})});}_0x5eda38=_[_0xf256('0x37')]({},_0x5eda38,_0x5b493f[_0xf256('0x3c')]);var _0x5083f2={'where':_0x5eda38['where']};return db[_0xf256('0x28')][_0xf256('0x18')](_0x5083f2)[_0xf256('0x1f')](function(_0x494efe){_0x5c268f[_0xf256('0x18')]=_0x494efe;if(_0x5b493f[_0xf256('0x2b')]['includeAll']){_0x5eda38[_0xf256('0x3d')]=[{'all':!![]}];}return db['Migration'][_0xf256('0x3e')](_0x5eda38);})[_0xf256('0x1f')](function(_0x1a1c46){_0x5c268f['rows']=_0x1a1c46;return _0x5c268f;})[_0xf256('0x1f')](respondWithFilteredResult(_0x474b76,_0x5eda38))[_0xf256('0x3f')](handleError(_0x474b76,null));}; \ No newline at end of file +var _0x25c3=['where','merge','map','type','VIRTUAL','field','options','includeAll','include','rows','catch','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','Migration','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','pick'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x25c3,0xc2));var _0x325c=function(_0x3a3623,_0x53bf4e){_0x3a3623=_0x3a3623-0x0;var _0x338fb0=_0x25c3[_0x3a3623];return _0x338fb0;};'use strict';var pdf=require(_0x325c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x325c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x325c('0x2'));var rp=require(_0x325c('0x3'));var moment=require(_0x325c('0x4'));var BPromise=require(_0x325c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x325c('0x6'));var sox=require(_0x325c('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x325c('0x8'));var jsforce=require(_0x325c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x325c('0xa'));var querystring=require('querystring');var Papa=require(_0x325c('0xb'));var Redis=require('ioredis');var authService=require(_0x325c('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x325c('0xd'))(_0x325c('0xe'));var utils=require(_0x325c('0xf'));var config=require(_0x325c('0x10'));var db=require(_0x325c('0x11'))['db'];function respondWithStatusCode(_0x54c883,_0x510852){_0x510852=_0x510852||0xcc;return function(_0x2cf790){if(_0x2cf790){return _0x54c883[_0x325c('0x12')](_0x510852);}return _0x54c883['status'](_0x510852)[_0x325c('0x13')]();};}function respondWithResult(_0x5c20c1,_0x357bd0){_0x357bd0=_0x357bd0||0xc8;return function(_0x440a54){if(_0x440a54){return _0x5c20c1[_0x325c('0x14')](_0x357bd0)[_0x325c('0x15')](_0x440a54);}};}function respondWithFilteredResult(_0xacbd5d,_0x483da5){return function(_0x1a8af1){if(_0x1a8af1){var _0x4c6adb=_0x1a8af1[_0x325c('0x16')],_0x57a378=_0x483da5[_0x325c('0x17')],_0xed253a=_0x483da5[_0x325c('0x17')]+_0x483da5[_0x325c('0x18')],_0x318e95;if(_0xed253a>=_0x4c6adb){_0xed253a=_0x4c6adb;_0x318e95=0xc8;}else{_0x318e95=0xce;}_0xacbd5d[_0x325c('0x14')](_0x318e95);return _0xacbd5d[_0x325c('0x19')](_0x325c('0x1a'),_0x57a378+'-'+_0xed253a+'/'+_0x4c6adb)['json'](_0x1a8af1);}return null;};}function patchUpdates(_0x1addc6){return function(_0x5bc69a){try{jsonpatch[_0x325c('0x1b')](_0x5bc69a,_0x1addc6,!![]);}catch(_0x2b6b1b){return BPromise[_0x325c('0x1c')](_0x2b6b1b);}return _0x5bc69a[_0x325c('0x1d')]();};}function saveUpdates(_0x1e4a51,_0xd418c4){return function(_0x4c8f13){if(_0x4c8f13){return _0x4c8f13[_0x325c('0x1e')](_0x1e4a51)[_0x325c('0x1f')](function(_0x3897ef){return _0x3897ef;});}return null;};}function removeEntity(_0x46a843,_0x47d708){return function(_0x2170d7){if(_0x2170d7){return _0x2170d7[_0x325c('0x20')]()[_0x325c('0x1f')](function(){_0x46a843[_0x325c('0x14')](0xcc)[_0x325c('0x13')]();});}};}function handleEntityNotFound(_0x54aae8,_0xb0afff){return function(_0x55e997){if(!_0x55e997){_0x54aae8[_0x325c('0x12')](0x194);}return _0x55e997;};}function handleError(_0x537e8b,_0x380335){_0x380335=_0x380335||0x1f4;return function(_0x4d4ef8){logger[_0x325c('0x21')](_0x4d4ef8['stack']);if(_0x4d4ef8[_0x325c('0x22')]){delete _0x4d4ef8[_0x325c('0x22')];}_0x537e8b[_0x325c('0x14')](_0x380335)['send'](_0x4d4ef8);};}exports[_0x325c('0x23')]=function(_0x43c668,_0x145cfd){var _0x340fee={},_0xd7231={},_0x3f08f5={'count':0x0,'rows':[]};var _0x31b95b=db[_0x325c('0x24')][_0x325c('0x25')];_0xd7231[_0x325c('0x26')]=_[_0x325c('0x27')](_0x31b95b);_0xd7231['query']=_['keys'](_0x43c668['query']);_0xd7231[_0x325c('0x28')]=_[_0x325c('0x29')](_0xd7231[_0x325c('0x26')],_0xd7231[_0x325c('0x2a')]);_0x340fee[_0x325c('0x2b')]=_[_0x325c('0x29')](_0xd7231[_0x325c('0x26')],qs[_0x325c('0x2c')](_0x43c668['query'][_0x325c('0x2c')]));_0x340fee[_0x325c('0x2b')]=_0x340fee[_0x325c('0x2b')][_0x325c('0x2d')]?_0x340fee['attributes']:_0xd7231[_0x325c('0x26')];if(!_0x43c668[_0x325c('0x2a')][_0x325c('0x2e')]('nolimit')){_0x340fee[_0x325c('0x18')]=qs[_0x325c('0x18')](_0x43c668[_0x325c('0x2a')][_0x325c('0x18')]);_0x340fee[_0x325c('0x17')]=qs[_0x325c('0x17')](_0x43c668[_0x325c('0x2a')][_0x325c('0x17')]);}_0x340fee[_0x325c('0x2f')]=qs['sort'](_0x43c668[_0x325c('0x2a')][_0x325c('0x30')]);_0x340fee['where']=qs[_0x325c('0x28')](_[_0x325c('0x31')](_0x43c668['query'],_0xd7231[_0x325c('0x28')]));if(_0x43c668[_0x325c('0x2a')]['filter']){_0x340fee[_0x325c('0x32')]=_[_0x325c('0x33')](_0x340fee['where'],{'$or':_[_0x325c('0x34')](_0x31b95b,function(_0x5eacbe){if(_0x5eacbe[_0x325c('0x35')]['key']!==_0x325c('0x36')){var _0x3b18f8={};_0x3b18f8[_0x5eacbe[_0x325c('0x37')]]={'$like':'%'+_0x43c668[_0x325c('0x2a')]['filter']+'%'};return _0x3b18f8;}})});}_0x340fee=_[_0x325c('0x33')]({},_0x340fee,_0x43c668[_0x325c('0x38')]);var _0x4699c6={'where':_0x340fee[_0x325c('0x32')]};return db[_0x325c('0x24')][_0x325c('0x16')](_0x4699c6)['then'](function(_0xbb3285){_0x3f08f5[_0x325c('0x16')]=_0xbb3285;if(_0x43c668[_0x325c('0x2a')][_0x325c('0x39')]){_0x340fee[_0x325c('0x3a')]=[{'all':!![]}];}return db[_0x325c('0x24')]['findAll'](_0x340fee);})[_0x325c('0x1f')](function(_0xfdc0f5){_0x3f08f5[_0x325c('0x3b')]=_0xfdc0f5;return _0x3f08f5;})[_0x325c('0x1f')](respondWithFilteredResult(_0x145cfd,_0x340fee))[_0x325c('0x3c')](handleError(_0x145cfd,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 6258a84..0722fa5 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 _0xd22b=['../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','migrations','lodash','util'];(function(_0x220f49,_0x41b174){var _0x2852c3=function(_0x35cb77){while(--_0x35cb77){_0x220f49['push'](_0x220f49['shift']());}};_0x2852c3(++_0x41b174);}(_0xd22b,0x142));var _0xbd22=function(_0x238b1f,_0x49fe44){_0x238b1f=_0x238b1f-0x0;var _0x2856ae=_0xd22b[_0x238b1f];return _0x2856ae;};'use strict';var _=require(_0xbd22('0x0'));var util=require(_0xbd22('0x1'));var logger=require(_0xbd22('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbd22('0x3'));var rp=require(_0xbd22('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd22('0x5'));var config=require(_0xbd22('0x6'));var attributes=require(_0xbd22('0x7'));module['exports']=function(_0x43be67,_0x265bac){return _0x43be67['define']('Migration',attributes,{'tableName':_0xbd22('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf47f=['rimraf','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1a78d6,_0x140c67){var _0x30884a=function(_0x585924){while(--_0x585924){_0x1a78d6['push'](_0x1a78d6['shift']());}};_0x30884a(++_0x140c67);}(_0xf47f,0xa2));var _0xff47=function(_0x143d33,_0x5ae149){_0x143d33=_0x143d33-0x0;var _0x2ec94e=_0xf47f[_0x143d33];return _0x2ec94e;};'use strict';var _=require(_0xff47('0x0'));var util=require(_0xff47('0x1'));var logger=require(_0xff47('0x2'))(_0xff47('0x3'));var moment=require(_0xff47('0x4'));var BPromise=require(_0xff47('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xff47('0x6'));var config=require('../../config/environment');var attributes=require(_0xff47('0x7'));module[_0xff47('0x8')]=function(_0x4c723b,_0x3a9775){return _0x4c723b[_0xff47('0x9')](_0xff47('0xa'),attributes,{'tableName':_0xff47('0xb'),'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 7c4e915..59a04aa 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 _0xcb99=['moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','Migration,\x20%s,\x20%s','message','info','result','catch','lodash'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xcb99,0x8b));var _0x9cb9=function(_0x29eb10,_0x190cb3){_0x29eb10=_0x29eb10-0x0;var _0x5371a2=_0xcb99[_0x29eb10];return _0x5371a2;};'use strict';var _=require(_0x9cb9('0x0'));var util=require('util');var moment=require(_0x9cb9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9cb9('0x2'));var db=require(_0x9cb9('0x3'))['db'];var utils=require(_0x9cb9('0x4'));var logger=require('../../config/logger')(_0x9cb9('0x5'));var config=require(_0x9cb9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9cb9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ed26a,_0xa84493,_0x1bf9b7){return new BPromise(function(_0x1dd62f,_0x82e3e){return client[_0x9cb9('0x8')](_0x2ed26a,_0x1bf9b7)[_0x9cb9('0x9')](function(_0x3da50b){logger['info']('Migration,\x20%s,\x20%s',_0xa84493,_0x9cb9('0xa'));logger[_0x9cb9('0xb')](_0x9cb9('0xc'),_0xa84493,'request\x20sent',JSON[_0x9cb9('0xd')](_0x3da50b));if(_0x3da50b[_0x9cb9('0xe')]){if(_0x3da50b['error']['code']===0x1f4){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x82e3e(_0x3da50b['error'][_0x9cb9('0x10')]);}logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);return _0x1dd62f(_0x3da50b[_0x9cb9('0xe')][_0x9cb9('0x10')]);}else{logger[_0x9cb9('0x11')](_0x9cb9('0xf'),_0xa84493,_0x9cb9('0xa'));_0x1dd62f(_0x3da50b[_0x9cb9('0x12')][_0x9cb9('0x10')]);}})[_0x9cb9('0x13')](function(_0x140910){logger[_0x9cb9('0xe')](_0x9cb9('0xf'),_0xa84493,_0x140910);_0x82e3e(_0x140910);});});} \ No newline at end of file +var _0x5178=['request','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x5178,0x171));var _0x8517=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5178[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var moment=require(_0x8517('0x1'));var BPromise=require(_0x8517('0x2'));var rs=require(_0x8517('0x3'));var fs=require('fs');var Redis=require(_0x8517('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var config=require('../../config/environment');var jayson=require(_0x8517('0x7'));var client=jayson['client'][_0x8517('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45498e,_0x3615b2,_0x10f918){return new BPromise(function(_0x25146d,_0x49739b){return client[_0x8517('0x9')](_0x45498e,_0x10f918)['then'](function(_0x485677){logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,'request\x20sent');logger[_0x8517('0xc')](_0x8517('0xd'),_0x3615b2,_0x8517('0xe'),JSON[_0x8517('0xf')](_0x485677));if(_0x485677[_0x8517('0x10')]){if(_0x485677[_0x8517('0x10')][_0x8517('0x11')]===0x1f4){logger[_0x8517('0x10')]('Migration,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x49739b(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}logger[_0x8517('0x10')]('Migration,\x20%s,\x20%s',_0x3615b2,_0x485677[_0x8517('0x10')][_0x8517('0x12')]);return _0x25146d(_0x485677[_0x8517('0x10')][_0x8517('0x12')]);}else{logger[_0x8517('0xa')](_0x8517('0xb'),_0x3615b2,_0x8517('0xe'));_0x25146d(_0x485677[_0x8517('0x13')][_0x8517('0x12')]);}})[_0x8517('0x14')](function(_0x22b687){logger[_0x8517('0x10')]('Migration,\x20%s,\x20%s',_0x3615b2,_0x22b687);_0x49739b(_0x22b687);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 49623dc..0972654 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 _0x5331=['../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0xbf98e1,_0x194796){var _0x55e887=function(_0x2b4041){while(--_0x2b4041){_0xbf98e1['push'](_0xbf98e1['shift']());}};_0x55e887(++_0x194796);}(_0x5331,0x112));var _0x1533=function(_0x2c0ae9,_0x563ddd){_0x2c0ae9=_0x2c0ae9-0x0;var _0x3df456=_0x5331[_0x2c0ae9];return _0x3df456;};'use strict';var multer=require(_0x1533('0x0'));var util=require(_0x1533('0x1'));var path=require(_0x1533('0x2'));var timeout=require(_0x1533('0x3'));var express=require(_0x1533('0x4'));var router=express[_0x1533('0x5')]();var auth=require(_0x1533('0x6'));var interaction=require(_0x1533('0x7'));var config=require(_0x1533('0x8'));var controller=require(_0x1533('0x9'));router[_0x1533('0xa')]('/',auth[_0x1533('0xb')](),controller[_0x1533('0xc')]);router[_0x1533('0xa')](_0x1533('0xd'),auth[_0x1533('0xb')](),controller[_0x1533('0xe')]);router[_0x1533('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1533('0x10')]('/:id',auth[_0x1533('0xb')](),controller[_0x1533('0x11')]);router[_0x1533('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1533('0x13')]=router; \ No newline at end of file +var _0xfe5d=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfe5d,0x1ba));var _0xdfe5=function(_0x40c9af,_0x56d817){_0x40c9af=_0x40c9af-0x0;var _0x4dc475=_0xfe5d[_0x40c9af];return _0x4dc475;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdfe5('0x0'));var timeout=require('connect-timeout');var express=require(_0xdfe5('0x1'));var router=express[_0xdfe5('0x2')]();var auth=require(_0xdfe5('0x3'));var interaction=require(_0xdfe5('0x4'));var config=require(_0xdfe5('0x5'));var controller=require(_0xdfe5('0x6'));router[_0xdfe5('0x7')]('/',auth[_0xdfe5('0x8')](),controller[_0xdfe5('0x9')]);router['get'](_0xdfe5('0xa'),auth[_0xdfe5('0x8')](),controller[_0xdfe5('0xb')]);router[_0xdfe5('0xc')]('/',auth[_0xdfe5('0x8')](),controller['create']);router[_0xdfe5('0xd')](_0xdfe5('0xa'),auth[_0xdfe5('0x8')](),controller[_0xdfe5('0xe')]);router[_0xdfe5('0xf')]('/:id',auth[_0xdfe5('0x8')](),controller[_0xdfe5('0x10')]);module[_0xdfe5('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 0502689..9b7cebc 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 _0x4fdc=['sequelize','exports','ENUM','localnet','externip'];(function(_0x1c3162,_0x2cd635){var _0x480a0f=function(_0x2bfb66){while(--_0x2bfb66){_0x1c3162['push'](_0x1c3162['shift']());}};_0x480a0f(++_0x2cd635);}(_0x4fdc,0x1db));var _0xc4fd=function(_0x280a28,_0x5091eb){_0x280a28=_0x280a28-0x0;var _0xfeea48=_0x4fdc[_0x280a28];return _0xfeea48;};'use strict';var Sequelize=require(_0xc4fd('0x0'));module[_0xc4fd('0x1')]={'type':{'type':Sequelize[_0xc4fd('0x2')](_0xc4fd('0x3'),_0xc4fd('0x4'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x69ff=['sequelize','exports','localnet','externip','STRING'];(function(_0x3d4804,_0x48cfc0){var _0x2d8b76=function(_0x4866c1){while(--_0x4866c1){_0x3d4804['push'](_0x3d4804['shift']());}};_0x2d8b76(++_0x48cfc0);}(_0x69ff,0xaf));var _0xf69f=function(_0x1e59d8,_0x90c61a){_0x1e59d8=_0x1e59d8-0x0;var _0x5055b3=_0x69ff[_0x1e59d8];return _0x5055b3;};'use strict';var Sequelize=require(_0xf69f('0x0'));module[_0xf69f('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf69f('0x2'),_0xf69f('0x3'))},'value':{'type':Sequelize[_0xf69f('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 5cc01b2..d3b2f33 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 _0xa00b=['toLowerCase','chan_sip.so','update','params','utf8','/etc/asterisk/sip_xcally_%s.conf','Reload','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','destroy','stack','name','send','index','Network','keys','intersection','query','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge','key','VIRTUAL','field','options','includeAll','rows','rawAttributes','include','find','create','sequelize','transaction','findAll','body','type','readFileSync','join','root','server/files/templates/network.ejs','render','writeFileSync','format'];(function(_0x41ee80,_0x213dfa){var _0x2894ef=function(_0x71251e){while(--_0x71251e){_0x41ee80['push'](_0x41ee80['shift']());}};_0x2894ef(++_0x213dfa);}(_0xa00b,0x19f));var _0xba00=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa00b[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xba00('0x0'));var emlformat=require(_0xba00('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xba00('0x2'));var jsonpatch=require(_0xba00('0x3'));var rp=require('request-promise');var moment=require(_0xba00('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xba00('0x5'));var util=require(_0xba00('0x6'));var path=require(_0xba00('0x7'));var sox=require(_0xba00('0x8'));var csv=require(_0xba00('0x9'));var ejs=require(_0xba00('0xa'));var fs=require('fs');var _=require(_0xba00('0xb'));var squel=require(_0xba00('0xc'));var crypto=require(_0xba00('0xd'));var jsforce=require(_0xba00('0xe'));var deskjs=require(_0xba00('0xf'));var toCsv=require(_0xba00('0x9'));var querystring=require(_0xba00('0x10'));var Papa=require(_0xba00('0x11'));var Redis=require(_0xba00('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xba00('0x13'));var logger=require(_0xba00('0x14'))(_0xba00('0x15'));var utils=require('../../config/utils');var config=require(_0xba00('0x16'));var db=require(_0xba00('0x17'))['db'];var jayson=require(_0xba00('0x18'));var client=jayson['client'][_0xba00('0x19')]({'port':0x232a});function checkPasswordPattern(_0x51a3a1,_0x1a852f,_0x4d9083){if(_0x4d9083){var _0x506d71=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x506d71[_0xba00('0x1a')](_0x1a852f)){return _0x51a3a1;}else{throw new Error(_0xba00('0x1b'));}}else{return _0x51a3a1;}}function respondWithRpcPromise(_0x282640,_0xa278c1,_0x3b8104,_0x40a387){return new BPromise(function(_0x3f23b7,_0x44c5a7){var _0x2674de=_0x40a387||client;return _0x2674de[_0xba00('0x1c')](_0x282640,_0x3b8104)[_0xba00('0x1d')](function(_0x547385){logger[_0xba00('0x1e')](_0xba00('0x1f'),_0xa278c1,_0xba00('0x20'));logger[_0xba00('0x21')](_0xba00('0x22'),_0xa278c1,'request\x20sent',JSON[_0xba00('0x23')](_0x547385));if(_0x547385[_0xba00('0x24')]){if(_0x547385[_0xba00('0x24')][_0xba00('0x25')]===0x1f4){logger['error'](_0xba00('0x1f'),_0xa278c1,_0x547385[_0xba00('0x24')][_0xba00('0x26')]);return _0x44c5a7(_0x547385[_0xba00('0x24')][_0xba00('0x26')]);}logger[_0xba00('0x24')](_0xba00('0x1f'),_0xa278c1,_0x547385['error']['message']);return _0x3f23b7(_0x547385[_0xba00('0x24')]['message']);}else{logger[_0xba00('0x1e')](_0xba00('0x1f'),_0xa278c1,_0xba00('0x20'));_0x3f23b7(_0x547385[_0xba00('0x27')][_0xba00('0x26')]);}})[_0xba00('0x28')](function(_0x594187){logger['error'](_0xba00('0x1f'),_0xa278c1,_0x594187);_0x44c5a7(_0x594187);});});}function respondWithStatusCode(_0x34f3bf,_0x3fe02b){_0x3fe02b=_0x3fe02b||0xcc;return function(_0x3974c8){if(_0x3974c8){return _0x34f3bf[_0xba00('0x29')](_0x3fe02b);}return _0x34f3bf[_0xba00('0x2a')](_0x3fe02b)[_0xba00('0x2b')]();};}function respondWithResult(_0x4c54e3,_0x378a8e){_0x378a8e=_0x378a8e||0xc8;return function(_0x33592e){if(_0x33592e){return _0x4c54e3[_0xba00('0x2a')](_0x378a8e)['json'](_0x33592e);}};}function respondWithFilteredResult(_0x50001e,_0x2581b0){return function(_0x121c82){if(_0x121c82){var _0x535ef8=_0x121c82[_0xba00('0x2c')],_0x487880=_0x2581b0[_0xba00('0x2d')],_0x2d624d=_0x2581b0['offset']+_0x2581b0['limit'],_0x49aacf;if(_0x2d624d>=_0x535ef8){_0x2d624d=_0x535ef8;_0x49aacf=0xc8;}else{_0x49aacf=0xce;}_0x50001e['status'](_0x49aacf);return _0x50001e[_0xba00('0x2e')](_0xba00('0x2f'),_0x487880+'-'+_0x2d624d+'/'+_0x535ef8)[_0xba00('0x30')](_0x121c82);}return null;};}function patchUpdates(_0x13afff){return function(_0x3704bd){try{jsonpatch['apply'](_0x3704bd,_0x13afff,!![]);}catch(_0x499f17){return BPromise[_0xba00('0x31')](_0x499f17);}return _0x3704bd[_0xba00('0x32')]();};}function saveUpdates(_0x9284a2,_0xa677a5){return function(_0x3d98d2){if(_0x3d98d2){return _0x3d98d2['update'](_0x9284a2)['then'](function(_0x3bc899){return _0x3bc899;});}return null;};}function removeEntity(_0x10804e,_0x228fc0){return function(_0x2c10ad){if(_0x2c10ad){return _0x2c10ad[_0xba00('0x33')]()[_0xba00('0x1d')](function(){_0x10804e[_0xba00('0x2a')](0xcc)[_0xba00('0x2b')]();});}};}function handleEntityNotFound(_0x2af2b3,_0x20eccb){return function(_0x40f2f4){if(!_0x40f2f4){_0x2af2b3[_0xba00('0x29')](0x194);}return _0x40f2f4;};}function handleError(_0x525d68,_0x523c5d){_0x523c5d=_0x523c5d||0x1f4;return function(_0x55ffbe){logger[_0xba00('0x24')](_0x55ffbe[_0xba00('0x34')]);if(_0x55ffbe[_0xba00('0x35')]){delete _0x55ffbe[_0xba00('0x35')];}_0x525d68[_0xba00('0x2a')](_0x523c5d)[_0xba00('0x36')](_0x55ffbe);};}exports[_0xba00('0x37')]=function(_0x594748,_0x263ad0){var _0x6747dc={},_0x41ae13={},_0x1b2e1e={'count':0x0,'rows':[]};var _0x3122de=db[_0xba00('0x38')]['rawAttributes'];_0x41ae13['model']=_[_0xba00('0x39')](_0x3122de);_0x41ae13['query']=_[_0xba00('0x39')](_0x594748['query']);_0x41ae13['filters']=_[_0xba00('0x3a')](_0x41ae13['model'],_0x41ae13[_0xba00('0x3b')]);_0x6747dc['attributes']=_['intersection'](_0x41ae13[_0xba00('0x3c')],qs[_0xba00('0x3d')](_0x594748[_0xba00('0x3b')][_0xba00('0x3d')]));_0x6747dc[_0xba00('0x3e')]=_0x6747dc[_0xba00('0x3e')][_0xba00('0x3f')]?_0x6747dc[_0xba00('0x3e')]:_0x41ae13[_0xba00('0x3c')];if(!_0x594748['query'][_0xba00('0x40')](_0xba00('0x41'))){_0x6747dc['limit']=qs[_0xba00('0x42')](_0x594748[_0xba00('0x3b')][_0xba00('0x42')]);_0x6747dc[_0xba00('0x2d')]=qs['offset'](_0x594748[_0xba00('0x3b')]['offset']);}_0x6747dc['order']=qs[_0xba00('0x43')](_0x594748['query'][_0xba00('0x43')]);_0x6747dc[_0xba00('0x44')]=qs[_0xba00('0x45')](_[_0xba00('0x46')](_0x594748['query'],_0x41ae13[_0xba00('0x45')]));if(_0x594748[_0xba00('0x3b')][_0xba00('0x47')]){_0x6747dc['where']=_[_0xba00('0x48')](_0x6747dc[_0xba00('0x44')],{'$or':_['map'](_0x3122de,function(_0x26dc39){if(_0x26dc39['type'][_0xba00('0x49')]!==_0xba00('0x4a')){var _0xd35599={};_0xd35599[_0x26dc39[_0xba00('0x4b')]]={'$like':'%'+_0x594748[_0xba00('0x3b')][_0xba00('0x47')]+'%'};return _0xd35599;}})});}_0x6747dc=_[_0xba00('0x48')]({},_0x6747dc,_0x594748[_0xba00('0x4c')]);var _0x446a58={'where':_0x6747dc[_0xba00('0x44')]};return db[_0xba00('0x38')][_0xba00('0x2c')](_0x446a58)['then'](function(_0x3cbaa1){_0x1b2e1e[_0xba00('0x2c')]=_0x3cbaa1;if(_0x594748['query'][_0xba00('0x4d')]){_0x6747dc['include']=[{'all':!![]}];}return db[_0xba00('0x38')]['findAll'](_0x6747dc);})[_0xba00('0x1d')](function(_0x1dd083){_0x1b2e1e[_0xba00('0x4e')]=_0x1dd083;return _0x1b2e1e;})[_0xba00('0x1d')](respondWithFilteredResult(_0x263ad0,_0x6747dc))[_0xba00('0x28')](handleError(_0x263ad0,null));};exports['show']=function(_0x1631d5,_0xcbdb5d){var _0x1774c9={'raw':!![],'where':{'id':_0x1631d5['params']['id']}},_0x5af341={};_0x5af341[_0xba00('0x3c')]=_['keys'](db[_0xba00('0x38')][_0xba00('0x4f')]);_0x5af341[_0xba00('0x3b')]=_[_0xba00('0x39')](_0x1631d5[_0xba00('0x3b')]);_0x5af341[_0xba00('0x45')]=_[_0xba00('0x3a')](_0x5af341[_0xba00('0x3c')],_0x5af341[_0xba00('0x3b')]);_0x1774c9[_0xba00('0x3e')]=_[_0xba00('0x3a')](_0x5af341[_0xba00('0x3c')],qs['fields'](_0x1631d5[_0xba00('0x3b')][_0xba00('0x3d')]));_0x1774c9['attributes']=_0x1774c9['attributes'][_0xba00('0x3f')]?_0x1774c9[_0xba00('0x3e')]:_0x5af341[_0xba00('0x3c')];if(_0x1631d5[_0xba00('0x3b')]['includeAll']){_0x1774c9[_0xba00('0x50')]=[{'all':!![]}];}_0x1774c9=_[_0xba00('0x48')]({},_0x1774c9,_0x1631d5[_0xba00('0x4c')]);return db[_0xba00('0x38')][_0xba00('0x51')](_0x1774c9)[_0xba00('0x1d')](handleEntityNotFound(_0xcbdb5d,null))[_0xba00('0x1d')](respondWithResult(_0xcbdb5d,null))[_0xba00('0x28')](handleError(_0xcbdb5d,null));};exports[_0xba00('0x52')]=function(_0x2f58db,_0x1dd778,_0x52bf08){var _0x1850fc;return db[_0xba00('0x53')][_0xba00('0x54')](function(_0x5c9bab){return db['Network'][_0xba00('0x52')](_0x2f58db['body'],{'raw':!![]})['then'](function(_0x13d133){_0x1850fc=_0x13d133;return db[_0xba00('0x38')][_0xba00('0x55')]({'where':{'type':_0x2f58db[_0xba00('0x56')][_0xba00('0x57')]},'raw':!![]});})[_0xba00('0x1d')](function(_0x80b1ef){var _0x1b8608=fs[_0xba00('0x58')](path[_0xba00('0x59')](config[_0xba00('0x5a')],_0xba00('0x5b')),'utf8');var _0x23ec7c=ejs[_0xba00('0x5c')](_0x1b8608,{'networks':_0x80b1ef||[]});fs[_0xba00('0x5d')](util[_0xba00('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0x2f58db[_0xba00('0x56')][_0xba00('0x57')][_0xba00('0x5f')]()),_0x23ec7c);})[_0xba00('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':_0xba00('0x60')});})['then'](function(){return _0x1850fc;});})['then'](respondWithResult(_0x1dd778,0xc9))[_0xba00('0x28')](handleError(_0x1dd778,null));};exports[_0xba00('0x61')]=function(_0x5a1a80,_0x7ba4a5,_0x25af49){var _0x40eea2;return db['sequelize'][_0xba00('0x54')](function(_0x4bba01){return db[_0xba00('0x38')][_0xba00('0x51')]({'where':{'id':_0x5a1a80[_0xba00('0x62')]['id']}})[_0xba00('0x1d')](handleEntityNotFound(_0x7ba4a5,null))[_0xba00('0x1d')](saveUpdates(_0x5a1a80[_0xba00('0x56')],null))['then'](function(_0x3788cf){if(_0x3788cf){_0x40eea2=_0x3788cf;return db[_0xba00('0x38')]['findAll']({'where':{'type':_0x40eea2[_0xba00('0x57')]},'raw':!![]});}return null;})[_0xba00('0x1d')](function(_0x2a5fba){if(_0x2a5fba){var _0x10d546=fs['readFileSync'](path[_0xba00('0x59')](config[_0xba00('0x5a')],_0xba00('0x5b')),_0xba00('0x63'));var _0x4cf087=ejs[_0xba00('0x5c')](_0x10d546,{'networks':_0x2a5fba||[]});fs['writeFileSync'](util[_0xba00('0x5e')](_0xba00('0x64'),_0x40eea2[_0xba00('0x57')][_0xba00('0x5f')]()),_0x4cf087);return respondWithRpcPromise(_0xba00('0x65'),_0xba00('0x61'),{'module':_0xba00('0x60')});}return null;})[_0xba00('0x1d')](function(_0x45c024){if(_0x45c024){return _0x40eea2;}return null;});})[_0xba00('0x1d')](respondWithResult(_0x7ba4a5,null))[_0xba00('0x28')](handleError(_0x7ba4a5,null));};exports[_0xba00('0x33')]=function(_0x4e2f7a,_0x54f0b8,_0x26973e){var _0x1e7964;return db['Network']['find']({'where':{'id':_0x4e2f7a[_0xba00('0x62')]['id']}})[_0xba00('0x1d')](function(_0x2a5c63){_0x1e7964=_0x2a5c63;return _0x2a5c63;})[_0xba00('0x1d')](handleEntityNotFound(_0x54f0b8,null))[_0xba00('0x1d')](removeEntity(_0x54f0b8,null))[_0xba00('0x1d')](function(){if(_0x1e7964){return db['Network'][_0xba00('0x55')]({'where':{'type':_0x1e7964[_0xba00('0x57')]},'raw':!![]});}})[_0xba00('0x1d')](function(_0x3a02e6){if(_0x3a02e6){var _0x2b63a3=fs[_0xba00('0x58')](path[_0xba00('0x59')](config['root'],_0xba00('0x5b')),_0xba00('0x63'));var _0x5b0009=ejs['render'](_0x2b63a3,{'networks':_0x3a02e6||[]});fs[_0xba00('0x5d')](util['format'](_0xba00('0x64'),_0x1e7964[_0xba00('0x57')]['toLowerCase']()),_0x5b0009);return respondWithRpcPromise('Reload',_0xba00('0x33'),{'module':'chan_sip.so'});}})[_0xba00('0x28')](handleError(_0x54f0b8,null));}; \ No newline at end of file +var _0xe19d=['VIRTUAL','include','findAll','show','params','includeAll','options','create','transaction','body','type','readFileSync','join','root','server/files/templates/network.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','find','render','format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','Network,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','end','stack','name','index','Network','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','key'];(function(_0x47643e,_0x337374){var _0x2aa5db=function(_0x5dcbf2){while(--_0x5dcbf2){_0x47643e['push'](_0x47643e['shift']());}};_0x2aa5db(++_0x337374);}(_0xe19d,0xe6));var _0xde19=function(_0x1427e2,_0x5a60ba){_0x1427e2=_0x1427e2-0x0;var _0x3b2772=_0xe19d[_0x1427e2];return _0x3b2772;};'use strict';var pdf=require(_0xde19('0x0'));var emlformat=require(_0xde19('0x1'));var rimraf=require(_0xde19('0x2'));var zipdir=require(_0xde19('0x3'));var jsonpatch=require(_0xde19('0x4'));var rp=require(_0xde19('0x5'));var moment=require(_0xde19('0x6'));var BPromise=require(_0xde19('0x7'));var Mustache=require(_0xde19('0x8'));var util=require(_0xde19('0x9'));var path=require(_0xde19('0xa'));var sox=require(_0xde19('0xb'));var csv=require(_0xde19('0xc'));var ejs=require(_0xde19('0xd'));var fs=require('fs');var _=require(_0xde19('0xe'));var squel=require(_0xde19('0xf'));var crypto=require(_0xde19('0x10'));var jsforce=require(_0xde19('0x11'));var deskjs=require(_0xde19('0x12'));var toCsv=require(_0xde19('0xc'));var querystring=require(_0xde19('0x13'));var Papa=require(_0xde19('0x14'));var Redis=require(_0xde19('0x15'));var authService=require(_0xde19('0x16'));var qs=require(_0xde19('0x17'));var hardwareService=require(_0xde19('0x18'));var logger=require('../../config/logger')(_0xde19('0x19'));var utils=require(_0xde19('0x1a'));var config=require(_0xde19('0x1b'));var db=require(_0xde19('0x1c'))['db'];var jayson=require(_0xde19('0x1d'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x5bb1ea,_0x1679c,_0x3aab35){if(_0x3aab35){var _0x30381a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30381a[_0xde19('0x1e')](_0x1679c)){return _0x5bb1ea;}else{throw new Error(_0xde19('0x1f'));}}else{return _0x5bb1ea;}}function respondWithRpcPromise(_0x28b477,_0x5bba80,_0x440e31,_0x5e7e91){return new BPromise(function(_0x261ae2,_0x4a8bb7){var _0x5528bb=_0x5e7e91||client;return _0x5528bb[_0xde19('0x20')](_0x28b477,_0x440e31)[_0xde19('0x21')](function(_0x954c72){logger[_0xde19('0x22')]('Network,\x20%s,\x20%s',_0x5bba80,_0xde19('0x23'));logger[_0xde19('0x24')](_0xde19('0x25'),_0x5bba80,_0xde19('0x23'),JSON[_0xde19('0x26')](_0x954c72));if(_0x954c72['error']){if(_0x954c72['error'][_0xde19('0x27')]===0x1f4){logger['error'](_0xde19('0x28'),_0x5bba80,_0x954c72[_0xde19('0x29')][_0xde19('0x2a')]);return _0x4a8bb7(_0x954c72[_0xde19('0x29')]['message']);}logger[_0xde19('0x29')](_0xde19('0x28'),_0x5bba80,_0x954c72[_0xde19('0x29')][_0xde19('0x2a')]);return _0x261ae2(_0x954c72[_0xde19('0x29')][_0xde19('0x2a')]);}else{logger[_0xde19('0x22')](_0xde19('0x28'),_0x5bba80,'request\x20sent');_0x261ae2(_0x954c72[_0xde19('0x2b')][_0xde19('0x2a')]);}})[_0xde19('0x2c')](function(_0x64eb32){logger[_0xde19('0x29')](_0xde19('0x28'),_0x5bba80,_0x64eb32);_0x4a8bb7(_0x64eb32);});});}function respondWithStatusCode(_0x31ebd7,_0x369a8e){_0x369a8e=_0x369a8e||0xcc;return function(_0x5330ee){if(_0x5330ee){return _0x31ebd7[_0xde19('0x2d')](_0x369a8e);}return _0x31ebd7[_0xde19('0x2e')](_0x369a8e)['end']();};}function respondWithResult(_0x1320aa,_0x117511){_0x117511=_0x117511||0xc8;return function(_0x5d1042){if(_0x5d1042){return _0x1320aa[_0xde19('0x2e')](_0x117511)[_0xde19('0x2f')](_0x5d1042);}};}function respondWithFilteredResult(_0x4b829f,_0x2c79ca){return function(_0x4db06a){if(_0x4db06a){var _0x254bea=_0x4db06a[_0xde19('0x30')],_0x48938d=_0x2c79ca[_0xde19('0x31')],_0x3e6bb8=_0x2c79ca[_0xde19('0x31')]+_0x2c79ca[_0xde19('0x32')],_0x2ea9d8;if(_0x3e6bb8>=_0x254bea){_0x3e6bb8=_0x254bea;_0x2ea9d8=0xc8;}else{_0x2ea9d8=0xce;}_0x4b829f[_0xde19('0x2e')](_0x2ea9d8);return _0x4b829f[_0xde19('0x33')]('Content-Range',_0x48938d+'-'+_0x3e6bb8+'/'+_0x254bea)[_0xde19('0x2f')](_0x4db06a);}return null;};}function patchUpdates(_0x15447d){return function(_0x1254e2){try{jsonpatch[_0xde19('0x34')](_0x1254e2,_0x15447d,!![]);}catch(_0x110f04){return BPromise[_0xde19('0x35')](_0x110f04);}return _0x1254e2[_0xde19('0x36')]();};}function saveUpdates(_0x58950a,_0x120922){return function(_0x47cdc0){if(_0x47cdc0){return _0x47cdc0[_0xde19('0x37')](_0x58950a)['then'](function(_0x419511){return _0x419511;});}return null;};}function removeEntity(_0x1b64f5,_0x368cfa){return function(_0x16caec){if(_0x16caec){return _0x16caec[_0xde19('0x38')]()[_0xde19('0x21')](function(){_0x1b64f5[_0xde19('0x2e')](0xcc)[_0xde19('0x39')]();});}};}function handleEntityNotFound(_0x5a56fa,_0x130baa){return function(_0x3ed977){if(!_0x3ed977){_0x5a56fa[_0xde19('0x2d')](0x194);}return _0x3ed977;};}function handleError(_0x3e88d0,_0x99d155){_0x99d155=_0x99d155||0x1f4;return function(_0x19a3e0){logger[_0xde19('0x29')](_0x19a3e0[_0xde19('0x3a')]);if(_0x19a3e0['name']){delete _0x19a3e0[_0xde19('0x3b')];}_0x3e88d0[_0xde19('0x2e')](_0x99d155)['send'](_0x19a3e0);};}exports[_0xde19('0x3c')]=function(_0x2a2ed,_0x1ff590){var _0x28bcc8={},_0x592ad9={},_0x1051da={'count':0x0,'rows':[]};var _0x34a489=db[_0xde19('0x3d')][_0xde19('0x3e')];_0x592ad9[_0xde19('0x3f')]=_[_0xde19('0x40')](_0x34a489);_0x592ad9[_0xde19('0x41')]=_[_0xde19('0x40')](_0x2a2ed[_0xde19('0x41')]);_0x592ad9[_0xde19('0x42')]=_['intersection'](_0x592ad9[_0xde19('0x3f')],_0x592ad9['query']);_0x28bcc8[_0xde19('0x43')]=_[_0xde19('0x44')](_0x592ad9[_0xde19('0x3f')],qs[_0xde19('0x45')](_0x2a2ed[_0xde19('0x41')][_0xde19('0x45')]));_0x28bcc8['attributes']=_0x28bcc8['attributes'][_0xde19('0x46')]?_0x28bcc8[_0xde19('0x43')]:_0x592ad9[_0xde19('0x3f')];if(!_0x2a2ed['query'][_0xde19('0x47')](_0xde19('0x48'))){_0x28bcc8[_0xde19('0x32')]=qs[_0xde19('0x32')](_0x2a2ed[_0xde19('0x41')][_0xde19('0x32')]);_0x28bcc8[_0xde19('0x31')]=qs[_0xde19('0x31')](_0x2a2ed[_0xde19('0x41')]['offset']);}_0x28bcc8['order']=qs[_0xde19('0x49')](_0x2a2ed[_0xde19('0x41')][_0xde19('0x49')]);_0x28bcc8[_0xde19('0x4a')]=qs['filters'](_[_0xde19('0x4b')](_0x2a2ed[_0xde19('0x41')],_0x592ad9[_0xde19('0x42')]));if(_0x2a2ed[_0xde19('0x41')][_0xde19('0x4c')]){_0x28bcc8[_0xde19('0x4a')]=_[_0xde19('0x4d')](_0x28bcc8[_0xde19('0x4a')],{'$or':_['map'](_0x34a489,function(_0x2b648){if(_0x2b648['type'][_0xde19('0x4e')]!==_0xde19('0x4f')){var _0xa74496={};_0xa74496[_0x2b648['field']]={'$like':'%'+_0x2a2ed[_0xde19('0x41')][_0xde19('0x4c')]+'%'};return _0xa74496;}})});}_0x28bcc8=_[_0xde19('0x4d')]({},_0x28bcc8,_0x2a2ed['options']);var _0x1c7cef={'where':_0x28bcc8[_0xde19('0x4a')]};return db[_0xde19('0x3d')][_0xde19('0x30')](_0x1c7cef)[_0xde19('0x21')](function(_0x1167b3){_0x1051da[_0xde19('0x30')]=_0x1167b3;if(_0x2a2ed[_0xde19('0x41')]['includeAll']){_0x28bcc8[_0xde19('0x50')]=[{'all':!![]}];}return db['Network'][_0xde19('0x51')](_0x28bcc8);})[_0xde19('0x21')](function(_0x2b9fdf){_0x1051da['rows']=_0x2b9fdf;return _0x1051da;})[_0xde19('0x21')](respondWithFilteredResult(_0x1ff590,_0x28bcc8))[_0xde19('0x2c')](handleError(_0x1ff590,null));};exports[_0xde19('0x52')]=function(_0x24ff23,_0x39291d){var _0x58c92a={'raw':!![],'where':{'id':_0x24ff23[_0xde19('0x53')]['id']}},_0x5773d6={};_0x5773d6['model']=_['keys'](db['Network'][_0xde19('0x3e')]);_0x5773d6['query']=_[_0xde19('0x40')](_0x24ff23['query']);_0x5773d6['filters']=_[_0xde19('0x44')](_0x5773d6['model'],_0x5773d6[_0xde19('0x41')]);_0x58c92a[_0xde19('0x43')]=_[_0xde19('0x44')](_0x5773d6['model'],qs[_0xde19('0x45')](_0x24ff23[_0xde19('0x41')][_0xde19('0x45')]));_0x58c92a[_0xde19('0x43')]=_0x58c92a[_0xde19('0x43')][_0xde19('0x46')]?_0x58c92a[_0xde19('0x43')]:_0x5773d6[_0xde19('0x3f')];if(_0x24ff23[_0xde19('0x41')][_0xde19('0x54')]){_0x58c92a[_0xde19('0x50')]=[{'all':!![]}];}_0x58c92a=_[_0xde19('0x4d')]({},_0x58c92a,_0x24ff23[_0xde19('0x55')]);return db['Network']['find'](_0x58c92a)[_0xde19('0x21')](handleEntityNotFound(_0x39291d,null))[_0xde19('0x21')](respondWithResult(_0x39291d,null))['catch'](handleError(_0x39291d,null));};exports[_0xde19('0x56')]=function(_0x4323bd,_0x3c02e4,_0x449974){var _0x33cfe4;return db['sequelize'][_0xde19('0x57')](function(_0x44024c){return db[_0xde19('0x3d')][_0xde19('0x56')](_0x4323bd[_0xde19('0x58')],{'raw':!![]})[_0xde19('0x21')](function(_0x43a1bc){_0x33cfe4=_0x43a1bc;return db[_0xde19('0x3d')][_0xde19('0x51')]({'where':{'type':_0x4323bd[_0xde19('0x58')][_0xde19('0x59')]},'raw':!![]});})[_0xde19('0x21')](function(_0x29839b){var _0x401e64=fs[_0xde19('0x5a')](path[_0xde19('0x5b')](config[_0xde19('0x5c')],_0xde19('0x5d')),_0xde19('0x5e'));var _0x27e5ee=ejs['render'](_0x401e64,{'networks':_0x29839b||[]});fs[_0xde19('0x5f')](util['format'](_0xde19('0x60'),_0x4323bd[_0xde19('0x58')]['type'][_0xde19('0x61')]()),_0x27e5ee);})['then'](function(){return respondWithRpcPromise(_0xde19('0x62'),'create',{'module':_0xde19('0x63')});})[_0xde19('0x21')](function(){return _0x33cfe4;});})[_0xde19('0x21')](respondWithResult(_0x3c02e4,0xc9))['catch'](handleError(_0x3c02e4,null));};exports[_0xde19('0x37')]=function(_0x46f5a2,_0x31df87,_0x1c81cf){var _0x135fa2;return db['sequelize']['transaction'](function(_0x2f5933){return db[_0xde19('0x3d')][_0xde19('0x64')]({'where':{'id':_0x46f5a2[_0xde19('0x53')]['id']}})[_0xde19('0x21')](handleEntityNotFound(_0x31df87,null))['then'](saveUpdates(_0x46f5a2[_0xde19('0x58')],null))['then'](function(_0x470553){if(_0x470553){_0x135fa2=_0x470553;return db['Network']['findAll']({'where':{'type':_0x135fa2[_0xde19('0x59')]},'raw':!![]});}return null;})[_0xde19('0x21')](function(_0xff00c7){if(_0xff00c7){var _0x57cdf3=fs[_0xde19('0x5a')](path[_0xde19('0x5b')](config[_0xde19('0x5c')],_0xde19('0x5d')),'utf8');var _0xc53359=ejs[_0xde19('0x65')](_0x57cdf3,{'networks':_0xff00c7||[]});fs[_0xde19('0x5f')](util[_0xde19('0x66')](_0xde19('0x60'),_0x135fa2[_0xde19('0x59')][_0xde19('0x61')]()),_0xc53359);return respondWithRpcPromise(_0xde19('0x62'),'update',{'module':_0xde19('0x63')});}return null;})['then'](function(_0x1f14cf){if(_0x1f14cf){return _0x135fa2;}return null;});})[_0xde19('0x21')](respondWithResult(_0x31df87,null))[_0xde19('0x2c')](handleError(_0x31df87,null));};exports['destroy']=function(_0x55a7f2,_0x1f874d,_0x34d5a4){var _0x5b21d2;return db[_0xde19('0x3d')][_0xde19('0x64')]({'where':{'id':_0x55a7f2[_0xde19('0x53')]['id']}})['then'](function(_0x3839c4){_0x5b21d2=_0x3839c4;return _0x3839c4;})[_0xde19('0x21')](handleEntityNotFound(_0x1f874d,null))[_0xde19('0x21')](removeEntity(_0x1f874d,null))[_0xde19('0x21')](function(){if(_0x5b21d2){return db[_0xde19('0x3d')][_0xde19('0x51')]({'where':{'type':_0x5b21d2[_0xde19('0x59')]},'raw':!![]});}})[_0xde19('0x21')](function(_0x1a3406){if(_0x1a3406){var _0x351690=fs[_0xde19('0x5a')](path[_0xde19('0x5b')](config[_0xde19('0x5c')],_0xde19('0x5d')),_0xde19('0x5e'));var _0x5e959b=ejs[_0xde19('0x65')](_0x351690,{'networks':_0x1a3406||[]});fs[_0xde19('0x5f')](util[_0xde19('0x66')](_0xde19('0x60'),_0x5b21d2[_0xde19('0x59')][_0xde19('0x61')]()),_0x5e959b);return respondWithRpcPromise(_0xde19('0x62'),'destroy',{'module':_0xde19('0x63')});}})['catch'](handleError(_0x1f874d,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index bde01be..da039ae 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 _0x4cf1=['request-promise','path','rimraf','../../config/environment','./network.attributes','exports','Network','network','lodash','util','moment','bluebird'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x4cf1,0x158));var _0x14cf=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4cf1[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x14cf('0x0'));var util=require(_0x14cf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x14cf('0x2'));var BPromise=require(_0x14cf('0x3'));var rp=require(_0x14cf('0x4'));var fs=require('fs');var path=require(_0x14cf('0x5'));var rimraf=require(_0x14cf('0x6'));var config=require(_0x14cf('0x7'));var attributes=require(_0x14cf('0x8'));module[_0x14cf('0x9')]=function(_0x3bd46e,_0x4ff86e){return _0x3bd46e['define'](_0x14cf('0xa'),attributes,{'tableName':_0x14cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc197=['api','bluebird','request-promise','../../config/environment','./network.attributes','exports','define','network','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc197,0x1ac));var _0x7c19=function(_0x4dd6fc,_0x5653b0){_0x4dd6fc=_0x4dd6fc-0x0;var _0x2d6354=_0xc197[_0x4dd6fc];return _0x2d6354;};'use strict';var _=require(_0x7c19('0x0'));var util=require(_0x7c19('0x1'));var logger=require('../../config/logger')(_0x7c19('0x2'));var moment=require('moment');var BPromise=require(_0x7c19('0x3'));var rp=require(_0x7c19('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7c19('0x5'));var attributes=require(_0x7c19('0x6'));module[_0x7c19('0x7')]=function(_0x1655bf,_0x2add27){return _0x1655bf[_0x7c19('0x8')]('Network',attributes,{'tableName':_0x7c19('0x9'),'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 841dc4d..3f6321d 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 _0x2eb2=['request','then','info','request\x20sent','error','Network,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x4635db,_0x2a923f){var _0x219342=function(_0x45ae5e){while(--_0x45ae5e){_0x4635db['push'](_0x4635db['shift']());}};_0x219342(++_0x2a923f);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x2eb2[_0x4ae625];return _0x31accf;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var moment=require(_0x22eb('0x1'));var BPromise=require(_0x22eb('0x2'));var rs=require(_0x22eb('0x3'));var fs=require('fs');var Redis=require(_0x22eb('0x4'));var db=require(_0x22eb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22eb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x22eb('0x7'));var client=jayson[_0x22eb('0x8')][_0x22eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a9850,_0x4539d0,_0x396806){return new BPromise(function(_0x33ddef,_0x3375d6){return client[_0x22eb('0xa')](_0x2a9850,_0x396806)[_0x22eb('0xb')](function(_0xb9c8a4){logger[_0x22eb('0xc')]('Network,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x4539d0,_0x22eb('0xd'),JSON['stringify'](_0xb9c8a4));if(_0xb9c8a4[_0x22eb('0xe')]){if(_0xb9c8a4[_0x22eb('0xe')]['code']===0x1f4){logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);return _0x3375d6(_0xb9c8a4[_0x22eb('0xe')][_0x22eb('0x10')]);}logger['error'](_0x22eb('0xf'),_0x4539d0,_0xb9c8a4['error'][_0x22eb('0x10')]);return _0x33ddef(_0xb9c8a4['error'][_0x22eb('0x10')]);}else{logger[_0x22eb('0xc')]('Network,\x20%s,\x20%s',_0x4539d0,'request\x20sent');_0x33ddef(_0xb9c8a4['result'][_0x22eb('0x10')]);}})['catch'](function(_0x50176d){logger[_0x22eb('0xe')]('Network,\x20%s,\x20%s',_0x4539d0,_0x50176d);_0x3375d6(_0x50176d);});});} \ No newline at end of file +var _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x4ac63b,_0x380e76){var _0x206816=function(_0x1ae994){while(--_0x1ae994){_0x4ac63b['push'](_0x4ac63b['shift']());}};_0x206816(++_0x380e76);}(_0xeff8,0x186));var _0x8eff=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xeff8[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('Network,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 894480f..6541cba 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 _0x5349=['destroy','removeDispositions','removeAnswers','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','put','update','delete'];(function(_0x28e829,_0x16ea6c){var _0x2e75b2=function(_0x5c2099){while(--_0x5c2099){_0x28e829['push'](_0x28e829['shift']());}};_0x2e75b2(++_0x16ea6c);}(_0x5349,0x12d));var _0x9534=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x5349[_0x521929];return _0x632436;};'use strict';var multer=require('multer');var util=require(_0x9534('0x0'));var path=require('path');var timeout=require(_0x9534('0x1'));var express=require(_0x9534('0x2'));var router=express[_0x9534('0x3')]();var auth=require(_0x9534('0x4'));var interaction=require(_0x9534('0x5'));var config=require(_0x9534('0x6'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0x9534('0x7')](),controller[_0x9534('0x8')]);router[_0x9534('0x9')](_0x9534('0xa'),auth['isAuthenticated'](),controller[_0x9534('0xb')]);router[_0x9534('0x9')](_0x9534('0xc'),auth['isAuthenticated'](),controller[_0x9534('0xd')]);router['get'](_0x9534('0xe'),auth['isAuthenticated'](),controller[_0x9534('0xf')]);router[_0x9534('0x9')](_0x9534('0x10'),auth[_0x9534('0x7')](),controller[_0x9534('0x11')]);router[_0x9534('0x9')](_0x9534('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0x9534('0x9')](_0x9534('0x13'),auth[_0x9534('0x7')](),controller['getInteractions']);router[_0x9534('0x9')](_0x9534('0x14'),auth[_0x9534('0x7')](),controller['getAgents']);router[_0x9534('0x15')]('/',auth['isAuthenticated'](),controller[_0x9534('0x16')]);router[_0x9534('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9534('0x17')]);router[_0x9534('0x15')](_0x9534('0x10'),auth['isAuthenticated'](),controller[_0x9534('0x18')]);router[_0x9534('0x15')](_0x9534('0x19'),controller[_0x9534('0x1a')]);router[_0x9534('0x15')](_0x9534('0x12'),auth[_0x9534('0x7')](),controller[_0x9534('0x1b')]);router[_0x9534('0x15')](_0x9534('0x14'),auth[_0x9534('0x7')](),controller[_0x9534('0x1c')]);router[_0x9534('0x15')]('/:id/send',auth[_0x9534('0x7')](),controller['send']);router[_0x9534('0x1d')](_0x9534('0xc'),auth['isAuthenticated'](),controller[_0x9534('0x1e')]);router[_0x9534('0x1f')](_0x9534('0xc'),auth['isAuthenticated'](),controller[_0x9534('0x20')]);router[_0x9534('0x1f')](_0x9534('0xe'),auth[_0x9534('0x7')](),controller[_0x9534('0x21')]);router[_0x9534('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9534('0x22')]);router[_0x9534('0x1f')](_0x9534('0x14'),auth[_0x9534('0x7')](),controller[_0x9534('0x23')]);module[_0x9534('0x24')]=router; \ No newline at end of file +var _0x031c=['/:id/applications','getApplications','/:id/interactions','/:id/users','post','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x3c75e6,_0x6adf45){var _0x183ba2=function(_0x4dd7d0){while(--_0x4dd7d0){_0x3c75e6['push'](_0x3c75e6['shift']());}};_0x183ba2(++_0x6adf45);}(_0x031c,0x133));var _0xc031=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x031c[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xc031('0x0'));var util=require(_0xc031('0x1'));var path=require(_0xc031('0x2'));var timeout=require(_0xc031('0x3'));var express=require(_0xc031('0x4'));var router=express[_0xc031('0x5')]();var auth=require(_0xc031('0x6'));var interaction=require(_0xc031('0x7'));var config=require(_0xc031('0x8'));var controller=require(_0xc031('0x9'));router[_0xc031('0xa')]('/',auth[_0xc031('0xb')](),controller[_0xc031('0xc')]);router[_0xc031('0xa')](_0xc031('0xd'),auth[_0xc031('0xb')](),controller[_0xc031('0xe')]);router[_0xc031('0xa')](_0xc031('0xf'),auth[_0xc031('0xb')](),controller[_0xc031('0x10')]);router[_0xc031('0xa')](_0xc031('0x11'),auth['isAuthenticated'](),controller[_0xc031('0x12')]);router[_0xc031('0xa')](_0xc031('0x13'),auth[_0xc031('0xb')](),controller[_0xc031('0x14')]);router[_0xc031('0xa')](_0xc031('0x15'),auth[_0xc031('0xb')](),controller[_0xc031('0x16')]);router[_0xc031('0xa')](_0xc031('0x17'),auth[_0xc031('0xb')](),controller['getInteractions']);router[_0xc031('0xa')](_0xc031('0x18'),auth[_0xc031('0xb')](),controller['getAgents']);router['post']('/',auth[_0xc031('0xb')](),controller['create']);router[_0xc031('0x19')](_0xc031('0x11'),auth[_0xc031('0xb')](),controller[_0xc031('0x1a')]);router[_0xc031('0x19')](_0xc031('0x13'),auth[_0xc031('0xb')](),controller[_0xc031('0x1b')]);router[_0xc031('0x19')](_0xc031('0x1c'),controller[_0xc031('0x1d')]);router[_0xc031('0x19')]('/:id/applications',auth[_0xc031('0xb')](),controller[_0xc031('0x1e')]);router[_0xc031('0x19')](_0xc031('0x18'),auth[_0xc031('0xb')](),controller['addAgents']);router['post'](_0xc031('0x1f'),auth['isAuthenticated'](),controller[_0xc031('0x20')]);router[_0xc031('0x21')](_0xc031('0xf'),auth[_0xc031('0xb')](),controller[_0xc031('0x22')]);router[_0xc031('0x23')](_0xc031('0xf'),auth['isAuthenticated'](),controller[_0xc031('0x24')]);router[_0xc031('0x23')](_0xc031('0x11'),auth[_0xc031('0xb')](),controller[_0xc031('0x25')]);router[_0xc031('0x23')]('/:id/canned_answers',auth[_0xc031('0xb')](),controller[_0xc031('0x26')]);router[_0xc031('0x23')](_0xc031('0x18'),auth[_0xc031('0xb')](),controller[_0xc031('0x27')]);module[_0xc031('0x28')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index b046160..adfc3a2 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 _0x0166=['BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x0166,0x102));var _0x6016=function(_0x56b780,_0x473151){_0x56b780=_0x56b780-0x0;var _0x360500=_0x0166[_0x56b780];return _0x360500;};'use strict';var Sequelize=require(_0x6016('0x0'));var rs=require(_0x6016('0x1'));module[_0x6016('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x6016('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6016('0x4')]},'token':{'type':Sequelize[_0x6016('0x4')],'defaultValue':function(){return rs[_0x6016('0x5')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x6016('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x6016('0x6')],'defaultValue':function(){return _0x6016('0x7');}},'notificationSound':{'type':Sequelize[_0x6016('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6016('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6016('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x6016('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6016('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6016('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6016('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6016('0x9')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x6016('0x8')],'defaultValue':![],'comment':_0x6016('0xa'),'set':function(_0x232c0c){if(!_0x232c0c)this['setDataValue'](_0x6016('0xb'),null);this[_0x6016('0xc')](_0x6016('0xd'),_0x232c0c);}}}; \ No newline at end of file +var _0x79d3=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','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'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x79d3,0x13b));var _0x379d=function(_0x5dbb2,_0x1e3317){_0x5dbb2=_0x5dbb2-0x0;var _0x4ba922=_0x79d3[_0x5dbb2];return _0x4ba922;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x379d('0x0'));module[_0x379d('0x1')]={'name':{'type':Sequelize[_0x379d('0x2')],'unique':_0x379d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x379d('0x2')]},'token':{'type':Sequelize[_0x379d('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x379d('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x379d('0x4');}},'notificationSound':{'type':Sequelize[_0x379d('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x379d('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x379d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x379d('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x379d('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x379d('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x379d('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x379d('0x5')],'defaultValue':![],'comment':_0x379d('0x8'),'set':function(_0x178143){if(!_0x178143)this[_0x379d('0x9')](_0x379d('0xa'),null);this[_0x379d('0x9')](_0x379d('0xb'),_0x178143);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 06c45a7..346328a 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 _0xe5e3=['interaction','created','close','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','order','Contact','Owner','fullname','internal','color','tag','addAgents','omit','spread','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','User','CmList','out','OpenchannelMessage','Messages','dataValues','push','html-pdf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','./openchannelAccount.socket','register','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','map','key','VIRTUAL','field','merge','options','OpenchannelAccount','includeAll','include','findAll','rows','params','mandatoryDispositionPause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','hasOwnProperty','OpenchannelAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','CmContact','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','asc','from','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId'];(function(_0x1e6171,_0x529afb){var _0x43bc5e=function(_0x3ddb68){while(--_0x3ddb68){_0x1e6171['push'](_0x1e6171['shift']());}};_0x43bc5e(++_0x529afb);}(_0xe5e3,0xe1));var _0x3e5e=function(_0x4cb0ae,_0x103a36){_0x4cb0ae=_0x4cb0ae-0x0;var _0x3cd7bf=_0xe5e3[_0x4cb0ae];return _0x3cd7bf;};'use strict';var pdf=require(_0x3e5e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3e5e('0x1'));var rp=require(_0x3e5e('0x2'));var moment=require(_0x3e5e('0x3'));var BPromise=require(_0x3e5e('0x4'));var Mustache=require('mustache');var util=require(_0x3e5e('0x5'));var path=require(_0x3e5e('0x6'));var sox=require(_0x3e5e('0x7'));var csv=require(_0x3e5e('0x8'));var ejs=require(_0x3e5e('0x9'));var fs=require('fs');var _=require(_0x3e5e('0xa'));var squel=require('squel');var crypto=require(_0x3e5e('0xb'));var jsforce=require(_0x3e5e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5e('0xd'));var authService=require(_0x3e5e('0xe'));var qs=require(_0x3e5e('0xf'));var hardwareService=require(_0x3e5e('0x10'));var logger=require(_0x3e5e('0x11'))(_0x3e5e('0x12'));var utils=require(_0x3e5e('0x13'));var config=require(_0x3e5e('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x3e5e('0x15')](config[_0x3e5e('0x16')],{'host':_0x3e5e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e5e('0x16')]));require(_0x3e5e('0x18'))[_0x3e5e('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3e5e('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x3e5e('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x430690,_0x307e7e,_0x244e9f){if(_0x244e9f){var _0x537dd4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x537dd4['test'](_0x307e7e)){return _0x430690;}else{throw new Error(_0x3e5e('0x1b'));}}else{return _0x430690;}}function respondWithRpcPromise(_0xe873c,_0x159924,_0x2c66ed,_0x23d3e5){return new BPromise(function(_0x4c5728,_0x2d3abf){var _0x80748d=_0x23d3e5||client;return _0x80748d[_0x3e5e('0x1c')](_0xe873c,_0x2c66ed)[_0x3e5e('0x1d')](function(_0x4a3472){logger['info'](_0x3e5e('0x1e'),_0x159924,_0x3e5e('0x1f'));logger[_0x3e5e('0x20')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x159924,_0x3e5e('0x1f'),JSON[_0x3e5e('0x21')](_0x4a3472));if(_0x4a3472[_0x3e5e('0x22')]){if(_0x4a3472[_0x3e5e('0x22')][_0x3e5e('0x23')]===0x1f4){logger['error'](_0x3e5e('0x1e'),_0x159924,_0x4a3472['error'][_0x3e5e('0x24')]);return _0x2d3abf(_0x4a3472[_0x3e5e('0x22')][_0x3e5e('0x24')]);}logger[_0x3e5e('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0x159924,_0x4a3472[_0x3e5e('0x22')][_0x3e5e('0x24')]);return _0x4c5728(_0x4a3472['error'][_0x3e5e('0x24')]);}else{logger[_0x3e5e('0x25')](_0x3e5e('0x1e'),_0x159924,_0x3e5e('0x1f'));_0x4c5728(_0x4a3472[_0x3e5e('0x26')][_0x3e5e('0x24')]);}})[_0x3e5e('0x27')](function(_0x5d55e8){logger[_0x3e5e('0x22')](_0x3e5e('0x1e'),_0x159924,_0x5d55e8);_0x2d3abf(_0x5d55e8);});});}function respondWithStatusCode(_0x347df1,_0x2da2ad){_0x2da2ad=_0x2da2ad||0xcc;return function(_0x305d1c){if(_0x305d1c){return _0x347df1[_0x3e5e('0x28')](_0x2da2ad);}return _0x347df1[_0x3e5e('0x29')](_0x2da2ad)[_0x3e5e('0x2a')]();};}function respondWithResult(_0x5a00b7,_0x37515b){_0x37515b=_0x37515b||0xc8;return function(_0x30edef){if(_0x30edef){return _0x5a00b7[_0x3e5e('0x29')](_0x37515b)[_0x3e5e('0x2b')](_0x30edef);}};}function respondWithFilteredResult(_0xcc525e,_0x525eab){return function(_0x39bf66){if(_0x39bf66){var _0x3e3293=_0x39bf66[_0x3e5e('0x2c')],_0x54acd4=_0x525eab[_0x3e5e('0x2d')],_0x4450e0=_0x525eab[_0x3e5e('0x2d')]+_0x525eab[_0x3e5e('0x2e')],_0x152c9f;if(_0x4450e0>=_0x3e3293){_0x4450e0=_0x3e3293;_0x152c9f=0xc8;}else{_0x152c9f=0xce;}_0xcc525e['status'](_0x152c9f);return _0xcc525e[_0x3e5e('0x2f')](_0x3e5e('0x30'),_0x54acd4+'-'+_0x4450e0+'/'+_0x3e3293)[_0x3e5e('0x2b')](_0x39bf66);}return null;};}function patchUpdates(_0x1639c2){return function(_0x3a0e87){try{jsonpatch[_0x3e5e('0x31')](_0x3a0e87,_0x1639c2,!![]);}catch(_0x291230){return BPromise[_0x3e5e('0x32')](_0x291230);}return _0x3a0e87[_0x3e5e('0x33')]();};}function saveUpdates(_0xb3c0ed,_0x55dd7b){return function(_0x10fafa){if(_0x10fafa){return _0x10fafa[_0x3e5e('0x34')](_0xb3c0ed)[_0x3e5e('0x1d')](function(_0x2da3ca){return _0x2da3ca;});}return null;};}function removeEntity(_0x4246f1,_0x1e9d39){return function(_0x1426b5){if(_0x1426b5){return _0x1426b5[_0x3e5e('0x35')]()[_0x3e5e('0x1d')](function(){var _0x3c2a13=_0x1426b5[_0x3e5e('0x36')]({'plain':!![]});var _0x1359b7=_0x3e5e('0x37');return db[_0x3e5e('0x38')][_0x3e5e('0x35')]({'where':{'type':_0x1359b7,'resourceId':_0x3c2a13['id']}})[_0x3e5e('0x1d')](function(){return _0x1426b5;});})[_0x3e5e('0x1d')](function(){_0x4246f1[_0x3e5e('0x29')](0xcc)[_0x3e5e('0x2a')]();});}};}function handleEntityNotFound(_0x4bdac0,_0x2dc9b5){return function(_0x1ead51){if(!_0x1ead51){_0x4bdac0[_0x3e5e('0x28')](0x194);}return _0x1ead51;};}function handleError(_0x2a8c98,_0x257129){_0x257129=_0x257129||0x1f4;return function(_0xcedcd1){logger[_0x3e5e('0x22')](_0xcedcd1[_0x3e5e('0x39')]);if(_0xcedcd1[_0x3e5e('0x3a')]){delete _0xcedcd1[_0x3e5e('0x3a')];}_0x2a8c98[_0x3e5e('0x29')](_0x257129)[_0x3e5e('0x3b')](_0xcedcd1);};}exports[_0x3e5e('0x3c')]=function(_0x3bb850,_0x178596){var _0x352b54={'include':[{'model':db[_0x3e5e('0x3d')],'as':'mandatoryDispositionPause'}]},_0x47d5e8={},_0x4b1006={'count':0x0,'rows':[]};var _0x4b9123=db['OpenchannelAccount'][_0x3e5e('0x3e')];_0x47d5e8[_0x3e5e('0x3f')]=_[_0x3e5e('0x40')](_0x4b9123);_0x47d5e8[_0x3e5e('0x41')]=_['keys'](_0x3bb850[_0x3e5e('0x41')]);_0x47d5e8[_0x3e5e('0x42')]=_[_0x3e5e('0x43')](_0x47d5e8[_0x3e5e('0x3f')],_0x47d5e8[_0x3e5e('0x41')]);_0x352b54['attributes']=_[_0x3e5e('0x43')](_0x47d5e8[_0x3e5e('0x3f')],qs[_0x3e5e('0x44')](_0x3bb850[_0x3e5e('0x41')][_0x3e5e('0x44')]));_0x352b54['attributes']=_0x352b54[_0x3e5e('0x45')][_0x3e5e('0x46')]?_0x352b54[_0x3e5e('0x45')]:_0x47d5e8[_0x3e5e('0x3f')];if(!_0x3bb850[_0x3e5e('0x41')]['hasOwnProperty'](_0x3e5e('0x47'))){_0x352b54[_0x3e5e('0x2e')]=qs[_0x3e5e('0x2e')](_0x3bb850[_0x3e5e('0x41')][_0x3e5e('0x2e')]);_0x352b54[_0x3e5e('0x2d')]=qs[_0x3e5e('0x2d')](_0x3bb850[_0x3e5e('0x41')][_0x3e5e('0x2d')]);}_0x352b54['order']=qs[_0x3e5e('0x48')](_0x3bb850['query']['sort']);_0x352b54[_0x3e5e('0x49')]=qs[_0x3e5e('0x42')](_[_0x3e5e('0x4a')](_0x3bb850[_0x3e5e('0x41')],_0x47d5e8['filters']));if(_0x3bb850[_0x3e5e('0x41')][_0x3e5e('0x4b')]){_0x352b54[_0x3e5e('0x49')]=_['merge'](_0x352b54[_0x3e5e('0x49')],{'$or':_[_0x3e5e('0x4c')](_0x4b9123,function(_0x307fe3){if(_0x307fe3['type'][_0x3e5e('0x4d')]!==_0x3e5e('0x4e')){var _0x36e58c={};_0x36e58c[_0x307fe3[_0x3e5e('0x4f')]]={'$like':'%'+_0x3bb850[_0x3e5e('0x41')][_0x3e5e('0x4b')]+'%'};return _0x36e58c;}})});}_0x352b54=_[_0x3e5e('0x50')]({},_0x352b54,_0x3bb850[_0x3e5e('0x51')]);var _0x174f77={'where':_0x352b54[_0x3e5e('0x49')]};return db[_0x3e5e('0x52')][_0x3e5e('0x2c')](_0x174f77)[_0x3e5e('0x1d')](function(_0x1bbc1b){_0x4b1006[_0x3e5e('0x2c')]=_0x1bbc1b;if(_0x3bb850[_0x3e5e('0x41')][_0x3e5e('0x53')]){_0x352b54[_0x3e5e('0x54')]=[{'all':!![]}];}return db[_0x3e5e('0x52')][_0x3e5e('0x55')](_0x352b54);})[_0x3e5e('0x1d')](function(_0x9da028){_0x4b1006[_0x3e5e('0x56')]=_0x9da028;return _0x4b1006;})[_0x3e5e('0x1d')](respondWithFilteredResult(_0x178596,_0x352b54))[_0x3e5e('0x27')](handleError(_0x178596,null));};exports['show']=function(_0x3d49e0,_0xc760ad){var _0x4610d0={'raw':![],'where':{'id':_0x3d49e0[_0x3e5e('0x57')]['id']},'include':[{'model':db[_0x3e5e('0x3d')],'as':_0x3e5e('0x58')}]},_0x3c0f29={};_0x3c0f29[_0x3e5e('0x3f')]=_['keys'](db[_0x3e5e('0x52')][_0x3e5e('0x3e')]);_0x3c0f29[_0x3e5e('0x41')]=_['keys'](_0x3d49e0['query']);_0x3c0f29['filters']=_[_0x3e5e('0x43')](_0x3c0f29[_0x3e5e('0x3f')],_0x3c0f29['query']);_0x4610d0['attributes']=_[_0x3e5e('0x43')](_0x3c0f29[_0x3e5e('0x3f')],qs[_0x3e5e('0x44')](_0x3d49e0[_0x3e5e('0x41')][_0x3e5e('0x44')]));_0x4610d0['attributes']=_0x4610d0['attributes'][_0x3e5e('0x46')]?_0x4610d0[_0x3e5e('0x45')]:_0x3c0f29['model'];if(_0x3d49e0[_0x3e5e('0x41')][_0x3e5e('0x53')]){_0x4610d0[_0x3e5e('0x54')]=[{'all':!![]}];}_0x4610d0=_[_0x3e5e('0x50')]({},_0x4610d0,_0x3d49e0[_0x3e5e('0x51')]);return db[_0x3e5e('0x52')][_0x3e5e('0x59')](_0x4610d0)[_0x3e5e('0x1d')](handleEntityNotFound(_0xc760ad,null))[_0x3e5e('0x1d')](respondWithResult(_0xc760ad,null))['catch'](handleError(_0xc760ad,null));};exports['create']=function(_0x336eee,_0x16bf8d){return db[_0x3e5e('0x52')][_0x3e5e('0x5a')](_0x336eee[_0x3e5e('0x5b')],{})[_0x3e5e('0x1d')](function(_0x1e73c1){var _0x52b81e=_0x336eee['user']['get']({'plain':!![]});if(!_0x52b81e)throw new Error(_0x3e5e('0x5c'));if(_0x52b81e[_0x3e5e('0x5d')]===_0x3e5e('0x5e')){var _0x31ca3c=_0x1e73c1['get']({'plain':!![]});var _0x8c8e8e='OpenchannelAccounts';return db[_0x3e5e('0x5f')]['find']({'where':{'name':_0x8c8e8e,'userProfileId':_0x52b81e[_0x3e5e('0x60')]},'raw':!![]})['then'](function(_0x270b27){if(_0x270b27&&_0x270b27[_0x3e5e('0x61')]===0x0){return db[_0x3e5e('0x38')][_0x3e5e('0x5a')]({'name':_0x31ca3c[_0x3e5e('0x3a')],'resourceId':_0x31ca3c['id'],'type':_0x270b27[_0x3e5e('0x3a')],'sectionId':_0x270b27['id']},{})[_0x3e5e('0x1d')](function(){return _0x1e73c1;});}else{return _0x1e73c1;}})[_0x3e5e('0x27')](function(_0x20dfb8){logger[_0x3e5e('0x22')](_0x3e5e('0x62'),_0x20dfb8);throw _0x20dfb8;});}return _0x1e73c1;})[_0x3e5e('0x1d')](respondWithResult(_0x16bf8d,0xc9))[_0x3e5e('0x27')](handleError(_0x16bf8d,null));};exports[_0x3e5e('0x34')]=function(_0x21d5b0,_0x57c174){if(_0x21d5b0[_0x3e5e('0x5b')]['id']){delete _0x21d5b0[_0x3e5e('0x5b')]['id'];}return db[_0x3e5e('0x52')]['find']({'where':{'id':_0x21d5b0['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x3e5e('0x1d')](handleEntityNotFound(_0x57c174,null))['then'](saveUpdates(_0x21d5b0['body'],null))[_0x3e5e('0x1d')](respondWithResult(_0x57c174,null))['catch'](handleError(_0x57c174,null));};exports['destroy']=function(_0x525ad3,_0x2f9cd6){return db[_0x3e5e('0x52')]['find']({'where':{'id':_0x525ad3[_0x3e5e('0x57')]['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x2f9cd6,null))[_0x3e5e('0x1d')](removeEntity(_0x2f9cd6,null))[_0x3e5e('0x27')](handleError(_0x2f9cd6,null));};exports['describe']=function(_0x1bf8fa,_0x5c8fdc){return db['OpenchannelAccount'][_0x3e5e('0x63')]()[_0x3e5e('0x1d')](respondWithResult(_0x5c8fdc,null))[_0x3e5e('0x27')](handleError(_0x5c8fdc,null));};exports[_0x3e5e('0x64')]=function(_0x23b07d,_0x1b816d,_0x47b0b2){if(_0x23b07d[_0x3e5e('0x5b')]['id']){delete _0x23b07d[_0x3e5e('0x5b')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x23b07d['params']['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x1b816d,null))[_0x3e5e('0x1d')](function(_0x3d4004){if(_0x3d4004){_0x23b07d[_0x3e5e('0x5b')]['OpnechannelAccountId']=_0x3d4004['id'];return db[_0x3e5e('0x65')]['create'](_0x23b07d['body']);}})[_0x3e5e('0x1d')](respondWithResult(_0x1b816d,null))[_0x3e5e('0x27')](handleError(_0x1b816d,null));};exports[_0x3e5e('0x66')]=function(_0x57650d,_0x513060,_0x2ce41a){var _0x195b9d={'raw':![],'where':{}};var _0x367c30={};var _0x56fa00={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3e5e('0x67')]({'where':{'id':_0x57650d['params']['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x513060,null))[_0x3e5e('0x1d')](function(_0x5375df){if(_0x5375df){_0x367c30[_0x3e5e('0x3f')]=_[_0x3e5e('0x40')](db[_0x3e5e('0x65')][_0x3e5e('0x3e')]);_0x367c30[_0x3e5e('0x41')]=_[_0x3e5e('0x40')](_0x57650d[_0x3e5e('0x41')]);_0x367c30['filters']=_[_0x3e5e('0x43')](_0x367c30[_0x3e5e('0x3f')],_0x367c30[_0x3e5e('0x41')]);_0x195b9d[_0x3e5e('0x45')]=_[_0x3e5e('0x43')](_0x367c30[_0x3e5e('0x3f')],qs[_0x3e5e('0x44')](_0x57650d['query']['fields']));_0x195b9d[_0x3e5e('0x45')]=_0x195b9d[_0x3e5e('0x45')]['length']?_0x195b9d[_0x3e5e('0x45')]:_0x367c30[_0x3e5e('0x3f')];if(!_0x57650d['query'][_0x3e5e('0x68')](_0x3e5e('0x47'))){_0x195b9d[_0x3e5e('0x2e')]=qs['limit'](_0x57650d[_0x3e5e('0x41')][_0x3e5e('0x2e')]);_0x195b9d['offset']=qs[_0x3e5e('0x2d')](_0x57650d[_0x3e5e('0x41')][_0x3e5e('0x2d')]);}_0x195b9d['order']=qs['sort'](_0x57650d[_0x3e5e('0x41')][_0x3e5e('0x48')]);_0x195b9d[_0x3e5e('0x49')]=qs[_0x3e5e('0x42')](_[_0x3e5e('0x4a')](_0x57650d['query'],_0x367c30[_0x3e5e('0x42')]));_0x195b9d[_0x3e5e('0x49')][_0x3e5e('0x69')]=_0x5375df['id'];if(_0x57650d[_0x3e5e('0x41')]['filter']){_0x195b9d[_0x3e5e('0x49')]=_[_0x3e5e('0x50')](_0x195b9d['where'],{'$or':_['map'](_0x195b9d[_0x3e5e('0x45')],function(_0x9bd3a0){var _0x2cfd17={};_0x2cfd17[_0x9bd3a0]={'$like':'%'+_0x57650d['query'][_0x3e5e('0x4b')]+'%'};return _0x2cfd17;})});}_0x195b9d=_['merge']({},_0x195b9d,_0x57650d['options']);return db[_0x3e5e('0x65')]['count']({'where':_0x195b9d[_0x3e5e('0x49')]})[_0x3e5e('0x1d')](function(_0x5de262){_0x56fa00[_0x3e5e('0x2c')]=_0x5de262;if(_0x57650d[_0x3e5e('0x41')][_0x3e5e('0x53')]){_0x195b9d[_0x3e5e('0x54')]=[{'all':!![]}];}return db[_0x3e5e('0x65')][_0x3e5e('0x55')](_0x195b9d);})[_0x3e5e('0x1d')](function(_0xc412cf){_0x56fa00[_0x3e5e('0x56')]=_0xc412cf;return _0x56fa00;});}})['then'](respondWithFilteredResult(_0x513060,_0x195b9d))[_0x3e5e('0x27')](handleError(_0x513060,null));};exports[_0x3e5e('0x6a')]=function(_0x39af5a,_0x20f867,_0x53399b){return db['OpenchannelAccount'][_0x3e5e('0x59')]({'where':{'id':_0x39af5a['params']['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x20f867,null))[_0x3e5e('0x1d')](function(_0x47c3ac){if(_0x47c3ac){return _0x47c3ac[_0x3e5e('0x6a')](_0x39af5a[_0x3e5e('0x41')]['ids']);}})[_0x3e5e('0x1d')](respondWithStatusCode(_0x20f867,null))[_0x3e5e('0x27')](handleError(_0x20f867,null));};exports[_0x3e5e('0x6b')]=function(_0x53f0bc,_0x38be8b,_0x340a50){if(_0x53f0bc[_0x3e5e('0x5b')]['id']){delete _0x53f0bc[_0x3e5e('0x5b')]['id'];}return db[_0x3e5e('0x52')][_0x3e5e('0x59')]({'where':{'id':_0x53f0bc[_0x3e5e('0x57')]['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x38be8b,null))[_0x3e5e('0x1d')](function(_0x1152ab){if(_0x1152ab){_0x53f0bc[_0x3e5e('0x5b')]['OpenchannelAccountId']=_0x1152ab['id'];return db[_0x3e5e('0x6c')]['create'](_0x53f0bc[_0x3e5e('0x5b')]);}})[_0x3e5e('0x1d')](respondWithResult(_0x38be8b,null))['catch'](handleError(_0x38be8b,null));};exports[_0x3e5e('0x6d')]=function(_0x26bf80,_0x117d40,_0x30bc7e){var _0x223cfe={'raw':![],'where':{}};var _0x4b6fe1={};var _0x4f137b={'count':0x0,'rows':[]};return db[_0x3e5e('0x52')][_0x3e5e('0x67')]({'where':{'id':_0x26bf80['params']['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x117d40,null))[_0x3e5e('0x1d')](function(_0x39807e){if(_0x39807e){_0x4b6fe1['model']=_[_0x3e5e('0x40')](db[_0x3e5e('0x6c')][_0x3e5e('0x3e')]);_0x4b6fe1[_0x3e5e('0x41')]=_[_0x3e5e('0x40')](_0x26bf80[_0x3e5e('0x41')]);_0x4b6fe1[_0x3e5e('0x42')]=_[_0x3e5e('0x43')](_0x4b6fe1[_0x3e5e('0x3f')],_0x4b6fe1[_0x3e5e('0x41')]);_0x223cfe['attributes']=_[_0x3e5e('0x43')](_0x4b6fe1[_0x3e5e('0x3f')],qs[_0x3e5e('0x44')](_0x26bf80[_0x3e5e('0x41')]['fields']));_0x223cfe['attributes']=_0x223cfe[_0x3e5e('0x45')][_0x3e5e('0x46')]?_0x223cfe['attributes']:_0x4b6fe1['model'];if(!_0x26bf80['query'][_0x3e5e('0x68')](_0x3e5e('0x47'))){_0x223cfe[_0x3e5e('0x2e')]=qs[_0x3e5e('0x2e')](_0x26bf80[_0x3e5e('0x41')][_0x3e5e('0x2e')]);_0x223cfe[_0x3e5e('0x2d')]=qs['offset'](_0x26bf80[_0x3e5e('0x41')][_0x3e5e('0x2d')]);}_0x223cfe['order']=qs[_0x3e5e('0x48')](_0x26bf80[_0x3e5e('0x41')][_0x3e5e('0x48')]);_0x223cfe[_0x3e5e('0x49')]=qs[_0x3e5e('0x42')](_[_0x3e5e('0x4a')](_0x26bf80[_0x3e5e('0x41')],_0x4b6fe1[_0x3e5e('0x42')]));_0x223cfe['where'][_0x3e5e('0x69')]=_0x39807e['id'];if(_0x26bf80[_0x3e5e('0x41')][_0x3e5e('0x4b')]){_0x223cfe[_0x3e5e('0x49')]=_[_0x3e5e('0x50')](_0x223cfe['where'],{'$or':_[_0x3e5e('0x4c')](_0x223cfe[_0x3e5e('0x45')],function(_0x391df4){var _0x586323={};_0x586323[_0x391df4]={'$like':'%'+_0x26bf80[_0x3e5e('0x41')]['filter']+'%'};return _0x586323;})});}_0x223cfe=_[_0x3e5e('0x50')]({},_0x223cfe,_0x26bf80[_0x3e5e('0x51')]);return db[_0x3e5e('0x6c')][_0x3e5e('0x2c')]({'where':_0x223cfe[_0x3e5e('0x49')]})['then'](function(_0x42d9c3){_0x4f137b[_0x3e5e('0x2c')]=_0x42d9c3;if(_0x26bf80[_0x3e5e('0x41')][_0x3e5e('0x53')]){_0x223cfe[_0x3e5e('0x54')]=[{'all':!![]}];}return db[_0x3e5e('0x6c')][_0x3e5e('0x55')](_0x223cfe);})[_0x3e5e('0x1d')](function(_0x2ea9cb){_0x4f137b['rows']=_0x2ea9cb;return _0x4f137b;});}})[_0x3e5e('0x1d')](respondWithFilteredResult(_0x117d40,_0x223cfe))['catch'](handleError(_0x117d40,null));};exports[_0x3e5e('0x6e')]=function(_0x3af9f8,_0x4928fe,_0xb59ed3){return db[_0x3e5e('0x52')][_0x3e5e('0x59')]({'where':{'id':_0x3af9f8[_0x3e5e('0x57')]['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x4928fe,null))[_0x3e5e('0x1d')](function(_0x29db1a){if(_0x29db1a){return _0x29db1a[_0x3e5e('0x6e')](_0x3af9f8[_0x3e5e('0x41')][_0x3e5e('0x6f')]);}})[_0x3e5e('0x1d')](respondWithStatusCode(_0x4928fe,null))[_0x3e5e('0x27')](handleError(_0x4928fe,null));};exports[_0x3e5e('0x70')]=function(_0xdcfc40,_0x222d8e,_0x1259ae){var _0x429cf5={'body':_0xdcfc40[_0x3e5e('0x5b')],'channel':_0x3e5e('0x71')};var _0x4b818c=[];var _0x5d725c=[];var _0x52d0e6={};var _0x5d461d=![];return db['CmContact']['describe']()[_0x3e5e('0x1d')](function(_0x725e84){if(!_0x725e84){throw new db[(_0x3e5e('0x72'))][(_0x3e5e('0x73'))](_0x3e5e('0x74'));}_0x4b818c=_[_0x3e5e('0x75')](_[_0x3e5e('0x40')](_0x725e84),[_0x3e5e('0x76'),_0x3e5e('0x77')]);_0x5d725c=_[_0x3e5e('0x75')](_[_0x3e5e('0x40')](_0x725e84),[_0x3e5e('0x76'),_0x3e5e('0x77'),_0x3e5e('0x78'),_0x3e5e('0x79')]);if(_0xdcfc40[_0x3e5e('0x5b')]['id']){delete _0xdcfc40[_0x3e5e('0x5b')]['id'];}if(_[_0x3e5e('0x7a')](_0xdcfc40['body']['from'])){throw new db[(_0x3e5e('0x72'))][(_0x3e5e('0x73'))](_0x3e5e('0x7b'));}if(_[_0x3e5e('0x7a')](_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x5b')])||_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x5b')]===''){throw new db[(_0x3e5e('0x72'))][(_0x3e5e('0x73'))](_0x3e5e('0x7c'));}if(_[_0x3e5e('0x7a')](_0xdcfc40['body'][_0x3e5e('0x7d')])){throw new db[(_0x3e5e('0x72'))][(_0x3e5e('0x73'))](_0x3e5e('0x7e')+_0x5d725c);}if(!_['includes'](_0x5d725c,_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x7d')])){throw new db[(_0x3e5e('0x72'))]['ValidationError'](_0x3e5e('0x7f')+_0x5d725c);}_0x52d0e6[_0xdcfc40['body']['mapKey']]=_0xdcfc40[_0x3e5e('0x5b')]['from'];})[_0x3e5e('0x1d')](function(){return db[_0x3e5e('0x52')][_0x3e5e('0x59')]({'where':{'id':_0xdcfc40[_0x3e5e('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0x3e5e('0x80'),'include':[{'model':db[_0x3e5e('0x81')],'as':_0x3e5e('0x82'),'where':_0x52d0e6,'limit':0x1,'order':[[_0x3e5e('0x77'),_0x3e5e('0x83')]]}]},{'model':db[_0x3e5e('0x84')],'as':'Applications'}]});})[_0x3e5e('0x1d')](handleEntityNotFound(_0x222d8e,null))[_0x3e5e('0x1d')](function(_0x332e1b){if(_0x332e1b&&_0x332e1b['List']){_0x429cf5[_0x3e5e('0x85')]=_0x332e1b;_0x429cf5[_0x3e5e('0x86')]=_0x332e1b[_0x3e5e('0x87')];_0x429cf5[_0x3e5e('0x88')]=_0x332e1b[_0x3e5e('0x80')];_0x429cf5[_0x3e5e('0x86')]=_['orderBy'](_0x429cf5[_0x3e5e('0x86')],['priority'],[_0x3e5e('0x89')]);if(_0x429cf5['account']['Applications']){delete _0x429cf5[_0x3e5e('0x85')][_0x3e5e('0x87')];}if(_0x429cf5[_0x3e5e('0x85')][_0x3e5e('0x80')]&&_0x429cf5[_0x3e5e('0x85')][_0x3e5e('0x80')]['Contacts'][_0x3e5e('0x46')]){return _0x429cf5[_0x3e5e('0x85')][_0x3e5e('0x80')][_0x3e5e('0x82')][0x0];}var _0xacbf28=_[_0x3e5e('0x15')](_0xdcfc40[_0x3e5e('0x5b')],{'firstName':_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x8a')],'ListId':_0x332e1b[_0x3e5e('0x79')]});_0xacbf28[_0xdcfc40[_0x3e5e('0x5b')]['mapKey']]=_0xdcfc40['body'][_0x3e5e('0x8a')];return db[_0x3e5e('0x81')][_0x3e5e('0x5a')](_0xacbf28,{'fields':_0x4b818c,'raw':!![]});}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x222d8e,null))['then'](function(_0x2dd9ac){_0x429cf5[_0x3e5e('0x8b')]=_0x2dd9ac;if(_0x2dd9ac){var _0x1a2702={'ContactId':_0x2dd9ac['id'],'OpenchannelAccountId':_0xdcfc40[_0x3e5e('0x57')]['id'],'from':(_0x2dd9ac[_0x3e5e('0x8c')]||'')+'\x20'+(_0x2dd9ac[_0x3e5e('0x8d')]||'')};var _0x311180={'OpenchannelAccountId':_0xdcfc40[_0x3e5e('0x57')]['id'],'closed':![]};if(_0xdcfc40[_0x3e5e('0x5b')]['threadId']){_0x311180[_0x3e5e('0x8e')]=_0xdcfc40['body'][_0x3e5e('0x8e')];return db[_0x3e5e('0x8f')][_0x3e5e('0x59')]({'where':_0x311180})[_0x3e5e('0x1d')](function(_0x240354){if(_0x240354){return[_0x240354,![]];}_0x1a2702['threadId']=_0xdcfc40['body'][_0x3e5e('0x8e')];_0x1a2702[_0x3e5e('0x90')]=_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x90')];return db['OpenchannelInteraction']['create'](_0x1a2702)['then'](function(_0x145b9e){return[_0x145b9e,!![]];});});}else{_0x311180[_0x3e5e('0x8e')]=null;}_0x311180[_0x3e5e('0x91')]=_0x2dd9ac['id'];return db[_0x3e5e('0x8f')]['find']({'where':_0x311180})['then'](function(_0x2be309){if(_0x2be309){return[_0x2be309,![]];}return db[_0x3e5e('0x8f')][_0x3e5e('0x5a')](_0x1a2702)[_0x3e5e('0x1d')](function(_0x1031d7){return[_0x1031d7,!![]];});});}})['spread'](function(_0x4906b3,_0x1e287d){if(_0x4906b3){_0x5d461d=_0x1e287d;if(!_0x1e287d){var _0x5bb448={'from':(_0x429cf5['contact'][_0x3e5e('0x8c')]||'')+'\x20'+(_0x429cf5[_0x3e5e('0x8b')][_0x3e5e('0x8d')]||'')};if(_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x8e')]&&_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x92')]&&_0xdcfc40[_0x3e5e('0x5b')]['threadId']!=_0xdcfc40[_0x3e5e('0x5b')]['messageId']){_0x5bb448[_0x3e5e('0x8e')]=_0xdcfc40[_0x3e5e('0x5b')][_0x3e5e('0x92')];}return _0x4906b3[_0x3e5e('0x34')](_0x5bb448);}else{return _0x4906b3;}}})[_0x3e5e('0x1d')](function(_0x1f0e96){_0x429cf5['interaction']=_0x1f0e96[_0x3e5e('0x36')]({'plain':!![]});_0x429cf5[_0x3e5e('0x93')][_0x3e5e('0x94')]=_0x5d461d;if(_0x429cf5[_0x3e5e('0x93')][_0x3e5e('0x94')]){if(_0x429cf5[_0x3e5e('0x85')]['autoclose']){_0x429cf5[_0x3e5e('0x86')]['push']({'id':0x0,'priority':_0x429cf5[_0x3e5e('0x86')]['length']+0x1,'app':_0x3e5e('0x95'),'appdata':'unmanaged','interval':_0x3e5e('0x96')});}}return db['OpenchannelMessage'][_0x3e5e('0x5a')]({'body':_0xdcfc40['body'][_0x3e5e('0x5b')],'OpenchannelAccountId':_0xdcfc40['params']['id'],'OpenchannelInteractionId':_0x1f0e96['id'],'direction':'in','ContactId':_0x429cf5['contact']['id'],'AttachmentId':_0xdcfc40['body'][_0x3e5e('0x97')]});})[_0x3e5e('0x1d')](function(_0x3c177b){_0x429cf5[_0x3e5e('0x24')]=_0x3c177b;if(_0x429cf5[_0x3e5e('0x93')]['UserId']){return db['User'][_0x3e5e('0x59')]({'attributes':['id',_0x3e5e('0x3a')],'where':{'id':_0x429cf5['interaction'][_0x3e5e('0x98')]}})[_0x3e5e('0x1d')](function(_0x116497){if(_0x116497){_0x429cf5['applications'][_0x3e5e('0x99')]({'id':0x0,'priority':0x0,'app':_0x3e5e('0x9a'),'appdata':_0x116497[_0x3e5e('0x3a')]+','+(_0x429cf5['account'][_0x3e5e('0x9b')]||0xa),'interval':_0x3e5e('0x96')});_0x429cf5['forcedOwnership']=![];}return respondWithRpcPromise(_0x3e5e('0x9c'),_0x3e5e('0x9d'),_0x429cf5);});}return respondWithRpcPromise(_0x3e5e('0x9c'),'startRouting',_0x429cf5);})[_0x3e5e('0x1d')](function(_0x1f89e0){respondWithRpcPromise(_0x3e5e('0x9e'),_0x3e5e('0x9e'),{'event':'notify','message':_0x1f89e0},client9002);return _0x1f89e0;})['then'](respondWithResult(_0x222d8e,null))['catch'](handleError(_0x222d8e,null));};exports[_0x3e5e('0x9f')]=function(_0x1c1ee7,_0x168868,_0x55ad6e){return db['OpenchannelAccount'][_0x3e5e('0x67')]({'where':{'id':_0x1c1ee7[_0x3e5e('0x57')]['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x168868,null))['then'](function(_0x294327){if(_0x294327){return db['sequelize'][_0x3e5e('0xa0')](function(_0x357b0e){return db[_0x3e5e('0x84')]['destroy']({'where':{'OpenchannelAccountId':_0x1c1ee7[_0x3e5e('0x57')]['id']},'transaction':_0x357b0e})[_0x3e5e('0x1d')](function(_0x32f86a){var _0x418eec=_[_0x3e5e('0x4c')](_0x1c1ee7[_0x3e5e('0x5b')],function(_0x4178f3){_0x4178f3[_0x3e5e('0x69')]=_0x1c1ee7[_0x3e5e('0x57')]['id'];return _0x4178f3;});return db['OpenchannelApplication'][_0x3e5e('0xa1')](_0x418eec,{'transaction':_0x357b0e});});})[_0x3e5e('0x1d')](function(){return db[_0x3e5e('0x84')][_0x3e5e('0xa2')]({'where':{'OpenchannelAccountId':_0x1c1ee7[_0x3e5e('0x57')]['id']},'order':'priority'});});}})[_0x3e5e('0x1d')](respondWithResult(_0x168868,null))['catch'](handleError(_0x168868,null));};exports[_0x3e5e('0xa3')]=function(_0x4642e5,_0x1089ef,_0x6afc03){var _0x159a87={};var _0x5c9dcf={};var _0x3370a0;var _0x29a313;return db[_0x3e5e('0x52')]['findOne']({'where':{'id':_0x4642e5[_0x3e5e('0x57')]['id']}})['then'](handleEntityNotFound(_0x1089ef,null))[_0x3e5e('0x1d')](function(_0x3fabcf){if(_0x3fabcf){_0x3370a0=_0x3fabcf;_0x5c9dcf[_0x3e5e('0x3f')]=_[_0x3e5e('0x40')](db[_0x3e5e('0x84')][_0x3e5e('0x3e')]);_0x5c9dcf['query']=_[_0x3e5e('0x40')](_0x4642e5[_0x3e5e('0x41')]);_0x5c9dcf['filters']=_[_0x3e5e('0x43')](_0x5c9dcf[_0x3e5e('0x3f')],_0x5c9dcf[_0x3e5e('0x41')]);_0x159a87[_0x3e5e('0x45')]=_[_0x3e5e('0x43')](_0x5c9dcf[_0x3e5e('0x3f')],qs[_0x3e5e('0x44')](_0x4642e5['query'][_0x3e5e('0x44')]));_0x159a87[_0x3e5e('0x45')]=_0x159a87[_0x3e5e('0x45')][_0x3e5e('0x46')]?_0x159a87[_0x3e5e('0x45')]:_0x5c9dcf[_0x3e5e('0x3f')];_0x159a87[_0x3e5e('0xa4')]=qs[_0x3e5e('0x48')](_0x4642e5['query'][_0x3e5e('0x48')]);_0x159a87[_0x3e5e('0x49')]=qs[_0x3e5e('0x42')](_[_0x3e5e('0x4a')](_0x4642e5[_0x3e5e('0x41')],_0x5c9dcf[_0x3e5e('0x42')]));if(_0x4642e5[_0x3e5e('0x41')][_0x3e5e('0x4b')]){_0x159a87['where']=_['merge'](_0x159a87[_0x3e5e('0x49')],{'$or':_[_0x3e5e('0x4c')](_0x159a87[_0x3e5e('0x45')],function(_0xb0b618){var _0x19ba42={};_0x19ba42[_0xb0b618]={'$like':'%'+_0x4642e5[_0x3e5e('0x41')][_0x3e5e('0x4b')]+'%'};return _0x19ba42;})});}_0x159a87=_[_0x3e5e('0x50')]({},_0x159a87,_0x4642e5[_0x3e5e('0x51')]);return _0x3370a0['getApplications'](_0x159a87);}})[_0x3e5e('0x1d')](function(_0x552f6d){if(_0x552f6d){_0x29a313=_0x552f6d[_0x3e5e('0x46')];if(!_0x4642e5[_0x3e5e('0x41')][_0x3e5e('0x68')](_0x3e5e('0x47'))){_0x159a87[_0x3e5e('0x2e')]=qs[_0x3e5e('0x2e')](_0x4642e5['query'][_0x3e5e('0x2e')]);_0x159a87[_0x3e5e('0x2d')]=qs[_0x3e5e('0x2d')](_0x4642e5[_0x3e5e('0x41')]['offset']);}return _0x3370a0['getApplications'](_0x159a87);}})[_0x3e5e('0x1d')](function(_0x311448){if(_0x311448){return _0x311448?{'count':_0x29a313,'rows':_0x311448}:null;}})[_0x3e5e('0x1d')](respondWithResult(_0x1089ef,null))['catch'](handleError(_0x1089ef,null));};exports['getInteractions']=function(_0x227ca5,_0x1f7d36,_0x150e26){var _0xe064dd={'raw':![],'where':{}};var _0x39a76f={};var _0x57aeb5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x3e5e('0x67')]({'where':{'id':_0x227ca5[_0x3e5e('0x57')]['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x1f7d36,null))[_0x3e5e('0x1d')](function(_0x4d2b19){if(_0x4d2b19){_0x39a76f[_0x3e5e('0x3f')]=_[_0x3e5e('0x40')](db[_0x3e5e('0x8f')][_0x3e5e('0x3e')]);_0x39a76f['query']=_[_0x3e5e('0x40')](_0x227ca5[_0x3e5e('0x41')]);_0x39a76f[_0x3e5e('0x42')]=_[_0x3e5e('0x43')](_0x39a76f[_0x3e5e('0x3f')],_0x39a76f[_0x3e5e('0x41')]);_0xe064dd[_0x3e5e('0x45')]=_['intersection'](_0x39a76f[_0x3e5e('0x3f')],qs[_0x3e5e('0x44')](_0x227ca5[_0x3e5e('0x41')][_0x3e5e('0x44')]));_0xe064dd[_0x3e5e('0x45')]=_0xe064dd[_0x3e5e('0x45')][_0x3e5e('0x46')]?_0xe064dd[_0x3e5e('0x45')]:_0x39a76f[_0x3e5e('0x3f')];if(!_0x227ca5[_0x3e5e('0x41')][_0x3e5e('0x68')](_0x3e5e('0x47'))){_0xe064dd[_0x3e5e('0x2e')]=qs[_0x3e5e('0x2e')](_0x227ca5['query']['limit']);_0xe064dd[_0x3e5e('0x2d')]=qs[_0x3e5e('0x2d')](_0x227ca5['query']['offset']);}_0xe064dd[_0x3e5e('0xa4')]=qs[_0x3e5e('0x48')](_0x227ca5['query'][_0x3e5e('0x48')]);_0xe064dd['where']=qs[_0x3e5e('0x42')](_[_0x3e5e('0x4a')](_0x227ca5[_0x3e5e('0x41')],_0x39a76f[_0x3e5e('0x42')]));_0xe064dd[_0x3e5e('0x49')]['OpenchannelAccountId']=_0x4d2b19['id'];if(_0x227ca5[_0x3e5e('0x41')]['filter']){_0xe064dd[_0x3e5e('0x49')]=_[_0x3e5e('0x50')](_0xe064dd['where'],{'$or':_['map'](_0xe064dd[_0x3e5e('0x45')],function(_0x464914){var _0x228150={};_0x228150[_0x464914]={'$like':'%'+_0x227ca5['query'][_0x3e5e('0x4b')]+'%'};return _0x228150;})});}_0xe064dd=_[_0x3e5e('0x50')]({},_0xe064dd,_0x227ca5[_0x3e5e('0x51')]);return db[_0x3e5e('0x8f')][_0x3e5e('0x2c')]({'where':_0xe064dd[_0x3e5e('0x49')]})[_0x3e5e('0x1d')](function(_0x43fc00){_0x57aeb5[_0x3e5e('0x2c')]=_0x43fc00;if(_0x227ca5[_0x3e5e('0x41')][_0x3e5e('0x53')]){_0xe064dd[_0x3e5e('0x54')]=[{'model':db[_0x3e5e('0x81')],'as':_0x3e5e('0xa5'),'required':![]},{'model':db['User'],'as':_0x3e5e('0xa6'),'attributes':[_0x3e5e('0x3a'),_0x3e5e('0xa7'),_0x3e5e('0xa8')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id','name',_0x3e5e('0xa9')],'where':_0x227ca5[_0x3e5e('0x41')]['tag']?{'id':_0x227ca5['query'][_0x3e5e('0xaa')]}:undefined,'required':_0x227ca5[_0x3e5e('0x41')][_0x3e5e('0xaa')]?!![]:![]}];}return db[_0x3e5e('0x8f')][_0x3e5e('0x55')](_0xe064dd);})['then'](function(_0x2d0fb8){_0x57aeb5['rows']=_0x2d0fb8;return _0x57aeb5;});}})[_0x3e5e('0x1d')](respondWithFilteredResult(_0x1f7d36,_0xe064dd))[_0x3e5e('0x27')](handleError(_0x1f7d36,null));};exports[_0x3e5e('0xab')]=function(_0x4fc1ba,_0xb32bb0,_0x15e0ae){return db['OpenchannelAccount']['find']({'where':{'id':_0x4fc1ba['params']['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0xb32bb0,null))[_0x3e5e('0x1d')](function(_0x3935c1){if(_0x3935c1){return _0x3935c1[_0x3e5e('0xab')](_0x4fc1ba[_0x3e5e('0x5b')][_0x3e5e('0x6f')],_[_0x3e5e('0xac')](_0x4fc1ba[_0x3e5e('0x5b')],[_0x3e5e('0x6f'),'id'])||{})[_0x3e5e('0xad')](function(_0x430ae1){for(var _0x63c95f=0x0;_0x63c95f<_0x4fc1ba[_0x3e5e('0x5b')]['ids'][_0x3e5e('0x46')];_0x63c95f+=0x1){socket[_0x3e5e('0xae')]('userOpenchannelAccount:save',{'UserId':_0x4fc1ba[_0x3e5e('0x5b')][_0x3e5e('0x6f')][_0x63c95f],'OpenchannelAccountId':_0x4fc1ba[_0x3e5e('0x57')]['id']});}return _0x430ae1;});}})[_0x3e5e('0x1d')](respondWithResult(_0xb32bb0,null))[_0x3e5e('0x27')](handleError(_0xb32bb0,null));};exports[_0x3e5e('0xaf')]=function(_0x307b6b,_0x454629,_0x407efb){return db['OpenchannelAccount'][_0x3e5e('0x59')]({'where':{'id':_0x307b6b[_0x3e5e('0x57')]['id']}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x454629,null))[_0x3e5e('0x1d')](function(_0x1a92b2){if(_0x1a92b2){return _0x1a92b2[_0x3e5e('0xaf')](_0x307b6b['query'][_0x3e5e('0x6f')])['then'](function(){if(_[_0x3e5e('0xb0')](_0x307b6b['query'][_0x3e5e('0x6f')])){for(var _0x25720b=0x0;_0x25720b<_0x307b6b[_0x3e5e('0x41')][_0x3e5e('0x6f')]['length'];_0x25720b+=0x1){socket['emit'](_0x3e5e('0xb1'),{'UserId':Number(_0x307b6b['query']['ids'][_0x25720b]),'OpenchannelAccountId':Number(_0x307b6b[_0x3e5e('0x57')]['id'])});}}else{socket['emit'](_0x3e5e('0xb1'),{'UserId':Number(_0x307b6b[_0x3e5e('0x41')][_0x3e5e('0x6f')]),'OpenchannelAccountId':Number(_0x307b6b['params']['id'])});}});}})[_0x3e5e('0x1d')](respondWithStatusCode(_0x454629,null))[_0x3e5e('0x27')](handleError(_0x454629,null));};exports[_0x3e5e('0xb2')]=function(_0x3a6c59,_0x57bc88,_0x7d9081){var _0x4d59b0={};var _0x733865={};var _0x5bd663;var _0x5be6cf;return db['OpenchannelAccount'][_0x3e5e('0x67')]({'where':{'id':_0x3a6c59[_0x3e5e('0x57')]['id']}})['then'](handleEntityNotFound(_0x57bc88,null))[_0x3e5e('0x1d')](function(_0x5940e8){if(_0x5940e8){_0x5bd663=_0x5940e8;_0x733865[_0x3e5e('0x3f')]=_[_0x3e5e('0x40')](db[_0x3e5e('0xb3')]['rawAttributes']);_0x733865['query']=_['keys'](_0x3a6c59[_0x3e5e('0x41')]);_0x733865[_0x3e5e('0x42')]=_['intersection'](_0x733865['model'],_0x733865[_0x3e5e('0x41')]);_0x4d59b0[_0x3e5e('0x45')]=_[_0x3e5e('0x43')](_0x733865[_0x3e5e('0x3f')],qs[_0x3e5e('0x44')](_0x3a6c59[_0x3e5e('0x41')][_0x3e5e('0x44')]));_0x4d59b0[_0x3e5e('0x45')]=_0x4d59b0[_0x3e5e('0x45')][_0x3e5e('0x46')]?_0x4d59b0['attributes']:_0x733865[_0x3e5e('0x3f')];_0x4d59b0[_0x3e5e('0xa4')]=qs[_0x3e5e('0x48')](_0x3a6c59[_0x3e5e('0x41')][_0x3e5e('0x48')]);_0x4d59b0[_0x3e5e('0x49')]=qs[_0x3e5e('0x42')](_[_0x3e5e('0x4a')](_0x3a6c59['query'],_0x733865[_0x3e5e('0x42')]));if(_0x3a6c59['query'][_0x3e5e('0x4b')]){_0x4d59b0[_0x3e5e('0x49')]=_[_0x3e5e('0x50')](_0x4d59b0[_0x3e5e('0x49')],{'$or':_[_0x3e5e('0x4c')](_0x4d59b0[_0x3e5e('0x45')],function(_0x40a08d){var _0x1d4396={};_0x1d4396[_0x40a08d]={'$like':'%'+_0x3a6c59['query'][_0x3e5e('0x4b')]+'%'};return _0x1d4396;})});}_0x4d59b0=_[_0x3e5e('0x50')]({},_0x4d59b0,_0x3a6c59['options']);return _0x5bd663[_0x3e5e('0xb2')](_0x4d59b0);}})[_0x3e5e('0x1d')](function(_0x504315){if(_0x504315){_0x5be6cf=_0x504315[_0x3e5e('0x46')];if(!_0x3a6c59[_0x3e5e('0x41')][_0x3e5e('0x68')](_0x3e5e('0x47'))){_0x4d59b0[_0x3e5e('0x2e')]=qs['limit'](_0x3a6c59['query'][_0x3e5e('0x2e')]);_0x4d59b0[_0x3e5e('0x2d')]=qs[_0x3e5e('0x2d')](_0x3a6c59[_0x3e5e('0x41')][_0x3e5e('0x2d')]);}return _0x5bd663['getAgents'](_0x4d59b0);}})[_0x3e5e('0x1d')](function(_0x441130){if(_0x441130){return _0x441130?{'count':_0x5be6cf,'rows':_0x441130}:null;}})[_0x3e5e('0x1d')](respondWithResult(_0x57bc88,null))[_0x3e5e('0x27')](handleError(_0x57bc88,null));};exports[_0x3e5e('0x3b')]=function(_0x55c76e,_0x365141,_0x358de3){var _0x41e2d9,_0x52dd67,_0x498dc9;if(_[_0x3e5e('0x7a')](_0x55c76e[_0x3e5e('0x5b')]['body'])||_0x55c76e[_0x3e5e('0x5b')][_0x3e5e('0x5b')]===''){throw new db[(_0x3e5e('0x72'))][(_0x3e5e('0x73'))](_0x3e5e('0x7c'));}if(_[_0x3e5e('0x7a')](_0x55c76e[_0x3e5e('0x5b')]['to'])){}_0x41e2d9=_0x55c76e[_0x3e5e('0x5b')]['to'];return db['OpenchannelAccount'][_0x3e5e('0x67')]({'where':{'id':_0x55c76e['params']['id']}})['then'](handleEntityNotFound(_0x365141,null))[_0x3e5e('0x1d')](function(_0x8ea93a){if(_0x8ea93a){return db[_0x3e5e('0x52')][_0x3e5e('0x59')]({'where':{'id':_0x8ea93a['id']},'include':[{'model':db[_0x3e5e('0xb4')],'as':'List','include':[{'model':db[_0x3e5e('0x81')],'as':_0x3e5e('0x82'),'where':{[_0x8ea93a[_0x3e5e('0x7d')]]:_0x41e2d9},'limit':0x1,'order':[[_0x3e5e('0x77'),'DESC']]}]}]})[_0x3e5e('0x1d')](handleEntityNotFound(_0x365141,null))['then'](function(_0x3ce963){if(_0x3ce963&&_0x3ce963[_0x3e5e('0x80')]){_0x52dd67=_0x3ce963[_0x3e5e('0x36')]({'plain':!![]});if(_0x52dd67[_0x3e5e('0x80')]&&_0x52dd67[_0x3e5e('0x80')][_0x3e5e('0x82')][_0x3e5e('0x46')]){return _0x52dd67[_0x3e5e('0x80')][_0x3e5e('0x82')][0x0];}return db[_0x3e5e('0x81')][_0x3e5e('0x5a')](_[_0x3e5e('0x15')](_0x55c76e[_0x3e5e('0x5b')],{'firstName':_0x41e2d9,[_0x3ce963[_0x3e5e('0x7d')]]:_0x41e2d9,'phone':_0x41e2d9,'ListId':_0x52dd67[_0x3e5e('0x79')]}));}})[_0x3e5e('0x1d')](handleEntityNotFound(_0x365141,null))[_0x3e5e('0x1d')](function(_0x32f420){if(_0x32f420){_0x498dc9=_0x32f420;return db[_0x3e5e('0x8f')][_0x3e5e('0x59')]({'where':{'ContactId':_0x498dc9['id'],'closed':![],'OpenchannelAccountId':_0x52dd67['id']}})[_0x3e5e('0x1d')](function(_0x598ffc){if(_0x598ffc){return[_0x598ffc,![]];}return db[_0x3e5e('0x8f')][_0x3e5e('0x5a')]({'UserId':_0x55c76e[_0x3e5e('0x5e')]['id'],'ContactId':_0x498dc9['id'],'OpenchannelAccountId':_0x52dd67['id'],'lastMsgDirection':_0x3e5e('0xb5'),'Messages':[_[_0x3e5e('0x50')](_0x55c76e[_0x3e5e('0x5b')],{'read':![],'body':_0x55c76e[_0x3e5e('0x5b')][_0x3e5e('0x5b')],'OpenchannelAccountId':_0x52dd67['id'],'UserId':_0x55c76e[_0x3e5e('0x5e')]['id'],'ContactId':_0x498dc9['id']})]},{'include':[{'model':db[_0x3e5e('0xb6')],'as':_0x3e5e('0xb7')}]})[_0x3e5e('0x1d')](function(_0x5fcbfe){return[_0x5fcbfe,!![]];});});}})['spread'](function(_0x1ad9d9,_0x3798d1){if(_0x3798d1){return _0x1ad9d9;}return db[_0x3e5e('0xb6')][_0x3e5e('0x5a')](_[_0x3e5e('0x50')](_0x55c76e['body'],{'read':![],'body':_0x55c76e[_0x3e5e('0x5b')][_0x3e5e('0x5b')],'OpenchannelAccountId':_0x52dd67['id'],'OpenchannelInteractionId':_0x1ad9d9['id'],'UserId':_0x55c76e[_0x3e5e('0x5e')]['id'],'ContactId':_0x498dc9['id']}))[_0x3e5e('0x1d')](function(_0x46a2e3){_0x1ad9d9[_0x3e5e('0xb8')][_0x3e5e('0xb7')]=[];_0x1ad9d9[_0x3e5e('0xb8')][_0x3e5e('0xb7')][_0x3e5e('0xb9')](_0x46a2e3[_0x3e5e('0xb8')]);return _0x1ad9d9;});});}})[_0x3e5e('0x1d')](respondWithResult(_0x365141,null))[_0x3e5e('0x27')](handleError(_0x365141,null));}; \ No newline at end of file +var _0x3c11=['describe','OpnechannelAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','addAnswer','getAnswers','OpenchannelAccountId','CannedAnswer','removeAnswers','notify','openchannel','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','Applications','account','list','orderBy','priority','asc','Contacts','defaults','contact','firstName','lastName','threadId','externalUrl','spread','messageId','interaction','applications','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','sequelize','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','findOne','getApplications','getInteractions','OpenchannelInteraction','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','getAgents','out','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','register','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','status','end','json','count','offset','set','reject','save','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','map','type','key','field','options','includeAll','include','findAll','rows','catch','find','body','user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x498719,_0x1b25ca){var _0x5a8a90=function(_0x356f71){while(--_0x356f71){_0x498719['push'](_0x498719['shift']());}};_0x5a8a90(++_0x1b25ca);}(_0x3c11,0x1c2));var _0x13c1=function(_0x5d664b,_0x3c485c){_0x5d664b=_0x5d664b-0x0;var _0x49aeb3=_0x3c11[_0x5d664b];return _0x49aeb3;};'use strict';var pdf=require(_0x13c1('0x0'));var emlformat=require(_0x13c1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x13c1('0x2'));var jsonpatch=require(_0x13c1('0x3'));var rp=require(_0x13c1('0x4'));var moment=require(_0x13c1('0x5'));var BPromise=require(_0x13c1('0x6'));var Mustache=require(_0x13c1('0x7'));var util=require(_0x13c1('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x13c1('0x9'));var ejs=require(_0x13c1('0xa'));var fs=require('fs');var _=require(_0x13c1('0xb'));var squel=require('squel');var crypto=require(_0x13c1('0xc'));var jsforce=require(_0x13c1('0xd'));var deskjs=require(_0x13c1('0xe'));var toCsv=require(_0x13c1('0x9'));var querystring=require(_0x13c1('0xf'));var Papa=require(_0x13c1('0x10'));var Redis=require('ioredis');var authService=require(_0x13c1('0x11'));var qs=require(_0x13c1('0x12'));var hardwareService=require(_0x13c1('0x13'));var logger=require(_0x13c1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x13c1('0x15'));var db=require('../../mysqldb')['db'];config[_0x13c1('0x16')]=_['defaults'](config[_0x13c1('0x16')],{'host':_0x13c1('0x17'),'port':0x18eb});var socket=require(_0x13c1('0x18'))(new Redis(config[_0x13c1('0x16')]));require('./openchannelAccount.socket')[_0x13c1('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x13c1('0x1a')][_0x13c1('0x1b')]({'port':0x232c});var client9002=jayson[_0x13c1('0x1a')][_0x13c1('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x493aa0,_0xde6681,_0x21dbcc){if(_0x21dbcc){var _0x5c6ecc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5c6ecc[_0x13c1('0x1c')](_0xde6681)){return _0x493aa0;}else{throw new Error(_0x13c1('0x1d'));}}else{return _0x493aa0;}}function respondWithRpcPromise(_0x4f51a2,_0x44efd3,_0x89e5d4,_0x3f0bb7){return new BPromise(function(_0x109991,_0x26050f){var _0x1bcd91=_0x3f0bb7||client;return _0x1bcd91[_0x13c1('0x1e')](_0x4f51a2,_0x89e5d4)['then'](function(_0x478ef4){logger[_0x13c1('0x1f')](_0x13c1('0x20'),_0x44efd3,_0x13c1('0x21'));logger['debug'](_0x13c1('0x22'),_0x44efd3,'request\x20sent',JSON[_0x13c1('0x23')](_0x478ef4));if(_0x478ef4[_0x13c1('0x24')]){if(_0x478ef4[_0x13c1('0x24')]['code']===0x1f4){logger[_0x13c1('0x24')](_0x13c1('0x20'),_0x44efd3,_0x478ef4[_0x13c1('0x24')][_0x13c1('0x25')]);return _0x26050f(_0x478ef4[_0x13c1('0x24')][_0x13c1('0x25')]);}logger[_0x13c1('0x24')](_0x13c1('0x20'),_0x44efd3,_0x478ef4[_0x13c1('0x24')][_0x13c1('0x25')]);return _0x109991(_0x478ef4['error'][_0x13c1('0x25')]);}else{logger[_0x13c1('0x1f')](_0x13c1('0x20'),_0x44efd3,'request\x20sent');_0x109991(_0x478ef4['result'][_0x13c1('0x25')]);}})['catch'](function(_0x4297dc){logger['error'](_0x13c1('0x20'),_0x44efd3,_0x4297dc);_0x26050f(_0x4297dc);});});}function respondWithStatusCode(_0xdc972b,_0x1a1e53){_0x1a1e53=_0x1a1e53||0xcc;return function(_0x8efbef){if(_0x8efbef){return _0xdc972b['sendStatus'](_0x1a1e53);}return _0xdc972b[_0x13c1('0x26')](_0x1a1e53)[_0x13c1('0x27')]();};}function respondWithResult(_0x145121,_0x5c2dca){_0x5c2dca=_0x5c2dca||0xc8;return function(_0x58c0c2){if(_0x58c0c2){return _0x145121[_0x13c1('0x26')](_0x5c2dca)[_0x13c1('0x28')](_0x58c0c2);}};}function respondWithFilteredResult(_0x202b1f,_0x185e5a){return function(_0x3e330b){if(_0x3e330b){var _0x3b50ff=_0x3e330b[_0x13c1('0x29')],_0x47b264=_0x185e5a['offset'],_0x35fe76=_0x185e5a[_0x13c1('0x2a')]+_0x185e5a['limit'],_0x96773c;if(_0x35fe76>=_0x3b50ff){_0x35fe76=_0x3b50ff;_0x96773c=0xc8;}else{_0x96773c=0xce;}_0x202b1f[_0x13c1('0x26')](_0x96773c);return _0x202b1f[_0x13c1('0x2b')]('Content-Range',_0x47b264+'-'+_0x35fe76+'/'+_0x3b50ff)[_0x13c1('0x28')](_0x3e330b);}return null;};}function patchUpdates(_0x43e1f2){return function(_0x3a5bb5){try{jsonpatch['apply'](_0x3a5bb5,_0x43e1f2,!![]);}catch(_0x466963){return BPromise[_0x13c1('0x2c')](_0x466963);}return _0x3a5bb5[_0x13c1('0x2d')]();};}function saveUpdates(_0x338be2,_0x2e4a76){return function(_0x3798c4){if(_0x3798c4){return _0x3798c4[_0x13c1('0x2e')](_0x338be2)[_0x13c1('0x2f')](function(_0x265982){return _0x265982;});}return null;};}function removeEntity(_0x4cf8b0,_0x593585){return function(_0x4b7127){if(_0x4b7127){return _0x4b7127['destroy']()[_0x13c1('0x2f')](function(){var _0x1935e5=_0x4b7127[_0x13c1('0x30')]({'plain':!![]});var _0x47650a=_0x13c1('0x31');return db[_0x13c1('0x32')][_0x13c1('0x33')]({'where':{'type':_0x47650a,'resourceId':_0x1935e5['id']}})['then'](function(){return _0x4b7127;});})[_0x13c1('0x2f')](function(){_0x4cf8b0[_0x13c1('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51c5d6,_0x2840a9){return function(_0x295ad4){if(!_0x295ad4){_0x51c5d6[_0x13c1('0x34')](0x194);}return _0x295ad4;};}function handleError(_0x73be19,_0x9f77){_0x9f77=_0x9f77||0x1f4;return function(_0x7d45d7){logger[_0x13c1('0x24')](_0x7d45d7[_0x13c1('0x35')]);if(_0x7d45d7[_0x13c1('0x36')]){delete _0x7d45d7[_0x13c1('0x36')];}_0x73be19[_0x13c1('0x26')](_0x9f77)[_0x13c1('0x37')](_0x7d45d7);};}exports[_0x13c1('0x38')]=function(_0xda4454,_0x578f8a){var _0x5c2a14={'include':[{'model':db[_0x13c1('0x39')],'as':_0x13c1('0x3a')}]},_0xb8acb2={},_0x2b7194={'count':0x0,'rows':[]};var _0x281d4b=db[_0x13c1('0x3b')][_0x13c1('0x3c')];_0xb8acb2[_0x13c1('0x3d')]=_['keys'](_0x281d4b);_0xb8acb2['query']=_[_0x13c1('0x3e')](_0xda4454['query']);_0xb8acb2[_0x13c1('0x3f')]=_[_0x13c1('0x40')](_0xb8acb2[_0x13c1('0x3d')],_0xb8acb2[_0x13c1('0x41')]);_0x5c2a14[_0x13c1('0x42')]=_[_0x13c1('0x40')](_0xb8acb2[_0x13c1('0x3d')],qs['fields'](_0xda4454['query'][_0x13c1('0x43')]));_0x5c2a14[_0x13c1('0x42')]=_0x5c2a14[_0x13c1('0x42')][_0x13c1('0x44')]?_0x5c2a14[_0x13c1('0x42')]:_0xb8acb2[_0x13c1('0x3d')];if(!_0xda4454[_0x13c1('0x41')]['hasOwnProperty'](_0x13c1('0x45'))){_0x5c2a14[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0xda4454[_0x13c1('0x41')][_0x13c1('0x46')]);_0x5c2a14[_0x13c1('0x2a')]=qs[_0x13c1('0x2a')](_0xda4454['query']['offset']);}_0x5c2a14[_0x13c1('0x47')]=qs[_0x13c1('0x48')](_0xda4454[_0x13c1('0x41')]['sort']);_0x5c2a14['where']=qs[_0x13c1('0x3f')](_[_0x13c1('0x49')](_0xda4454[_0x13c1('0x41')],_0xb8acb2['filters']));if(_0xda4454['query'][_0x13c1('0x4a')]){_0x5c2a14[_0x13c1('0x4b')]=_[_0x13c1('0x4c')](_0x5c2a14[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x281d4b,function(_0x34b4dc){if(_0x34b4dc[_0x13c1('0x4e')][_0x13c1('0x4f')]!=='VIRTUAL'){var _0x3d6096={};_0x3d6096[_0x34b4dc[_0x13c1('0x50')]]={'$like':'%'+_0xda4454[_0x13c1('0x41')][_0x13c1('0x4a')]+'%'};return _0x3d6096;}})});}_0x5c2a14=_[_0x13c1('0x4c')]({},_0x5c2a14,_0xda4454[_0x13c1('0x51')]);var _0x55e544={'where':_0x5c2a14[_0x13c1('0x4b')]};return db[_0x13c1('0x3b')][_0x13c1('0x29')](_0x55e544)[_0x13c1('0x2f')](function(_0x21b66f){_0x2b7194[_0x13c1('0x29')]=_0x21b66f;if(_0xda4454[_0x13c1('0x41')][_0x13c1('0x52')]){_0x5c2a14[_0x13c1('0x53')]=[{'all':!![]}];}return db[_0x13c1('0x3b')][_0x13c1('0x54')](_0x5c2a14);})[_0x13c1('0x2f')](function(_0x283303){_0x2b7194[_0x13c1('0x55')]=_0x283303;return _0x2b7194;})[_0x13c1('0x2f')](respondWithFilteredResult(_0x578f8a,_0x5c2a14))[_0x13c1('0x56')](handleError(_0x578f8a,null));};exports['show']=function(_0x13d2f4,_0xc632aa){var _0xf9fdd6={'raw':![],'where':{'id':_0x13d2f4['params']['id']},'include':[{'model':db['Pause'],'as':_0x13c1('0x3a')}]},_0x2e2d00={};_0x2e2d00[_0x13c1('0x3d')]=_['keys'](db[_0x13c1('0x3b')][_0x13c1('0x3c')]);_0x2e2d00[_0x13c1('0x41')]=_[_0x13c1('0x3e')](_0x13d2f4['query']);_0x2e2d00[_0x13c1('0x3f')]=_['intersection'](_0x2e2d00[_0x13c1('0x3d')],_0x2e2d00[_0x13c1('0x41')]);_0xf9fdd6['attributes']=_['intersection'](_0x2e2d00[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x13d2f4['query'][_0x13c1('0x43')]));_0xf9fdd6[_0x13c1('0x42')]=_0xf9fdd6[_0x13c1('0x42')][_0x13c1('0x44')]?_0xf9fdd6['attributes']:_0x2e2d00['model'];if(_0x13d2f4[_0x13c1('0x41')][_0x13c1('0x52')]){_0xf9fdd6[_0x13c1('0x53')]=[{'all':!![]}];}_0xf9fdd6=_[_0x13c1('0x4c')]({},_0xf9fdd6,_0x13d2f4[_0x13c1('0x51')]);return db['OpenchannelAccount'][_0x13c1('0x57')](_0xf9fdd6)[_0x13c1('0x2f')](handleEntityNotFound(_0xc632aa,null))['then'](respondWithResult(_0xc632aa,null))['catch'](handleError(_0xc632aa,null));};exports['create']=function(_0x38d745,_0x4a3f4d){return db[_0x13c1('0x3b')]['create'](_0x38d745[_0x13c1('0x58')],{})['then'](function(_0x1dc16b){var _0x5a4902=_0x38d745[_0x13c1('0x59')][_0x13c1('0x30')]({'plain':!![]});if(!_0x5a4902)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a4902['role']===_0x13c1('0x59')){var _0x20ae90=_0x1dc16b[_0x13c1('0x30')]({'plain':!![]});var _0x50048a='OpenchannelAccounts';return db[_0x13c1('0x5a')][_0x13c1('0x57')]({'where':{'name':_0x50048a,'userProfileId':_0x5a4902[_0x13c1('0x5b')]},'raw':!![]})[_0x13c1('0x2f')](function(_0x1ca186){if(_0x1ca186&&_0x1ca186[_0x13c1('0x5c')]===0x0){return db[_0x13c1('0x32')][_0x13c1('0x5d')]({'name':_0x20ae90[_0x13c1('0x36')],'resourceId':_0x20ae90['id'],'type':_0x1ca186[_0x13c1('0x36')],'sectionId':_0x1ca186['id']},{})[_0x13c1('0x2f')](function(){return _0x1dc16b;});}else{return _0x1dc16b;}})['catch'](function(_0x4dc9e4){logger['error'](_0x13c1('0x5e'),_0x4dc9e4);throw _0x4dc9e4;});}return _0x1dc16b;})[_0x13c1('0x2f')](respondWithResult(_0x4a3f4d,0xc9))[_0x13c1('0x56')](handleError(_0x4a3f4d,null));};exports[_0x13c1('0x2e')]=function(_0x215d64,_0x3e16d8){if(_0x215d64[_0x13c1('0x58')]['id']){delete _0x215d64['body']['id'];}return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x215d64[_0x13c1('0x5f')]['id']},'include':[{'model':db[_0x13c1('0x39')],'as':_0x13c1('0x3a')}]})[_0x13c1('0x2f')](handleEntityNotFound(_0x3e16d8,null))[_0x13c1('0x2f')](saveUpdates(_0x215d64[_0x13c1('0x58')],null))[_0x13c1('0x2f')](respondWithResult(_0x3e16d8,null))['catch'](handleError(_0x3e16d8,null));};exports[_0x13c1('0x33')]=function(_0x94070a,_0x29d778){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x94070a['params']['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x29d778,null))[_0x13c1('0x2f')](removeEntity(_0x29d778,null))[_0x13c1('0x56')](handleError(_0x29d778,null));};exports[_0x13c1('0x60')]=function(_0x105729,_0x47adf6){return db['OpenchannelAccount']['describe']()[_0x13c1('0x2f')](respondWithResult(_0x47adf6,null))[_0x13c1('0x56')](handleError(_0x47adf6,null));};exports['addDisposition']=function(_0x594c59,_0x5b4bd9,_0x2cf4ac){if(_0x594c59[_0x13c1('0x58')]['id']){delete _0x594c59[_0x13c1('0x58')]['id'];}return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x594c59[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x5b4bd9,null))['then'](function(_0x1f6647){if(_0x1f6647){_0x594c59[_0x13c1('0x58')][_0x13c1('0x61')]=_0x1f6647['id'];return db[_0x13c1('0x62')]['create'](_0x594c59[_0x13c1('0x58')]);}})[_0x13c1('0x2f')](respondWithResult(_0x5b4bd9,null))[_0x13c1('0x56')](handleError(_0x5b4bd9,null));};exports[_0x13c1('0x63')]=function(_0x477a3e,_0x4d4534,_0x5667e2){var _0x123258={'raw':![],'where':{}};var _0x17d5f3={};var _0x4bc8f3={'count':0x0,'rows':[]};return db[_0x13c1('0x3b')]['findOne']({'where':{'id':_0x477a3e[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4d4534,null))[_0x13c1('0x2f')](function(_0x25ef8c){if(_0x25ef8c){_0x17d5f3[_0x13c1('0x3d')]=_['keys'](db['Disposition'][_0x13c1('0x3c')]);_0x17d5f3[_0x13c1('0x41')]=_['keys'](_0x477a3e['query']);_0x17d5f3['filters']=_[_0x13c1('0x40')](_0x17d5f3['model'],_0x17d5f3[_0x13c1('0x41')]);_0x123258[_0x13c1('0x42')]=_['intersection'](_0x17d5f3['model'],qs[_0x13c1('0x43')](_0x477a3e[_0x13c1('0x41')][_0x13c1('0x43')]));_0x123258[_0x13c1('0x42')]=_0x123258['attributes'][_0x13c1('0x44')]?_0x123258[_0x13c1('0x42')]:_0x17d5f3[_0x13c1('0x3d')];if(!_0x477a3e[_0x13c1('0x41')][_0x13c1('0x64')](_0x13c1('0x45'))){_0x123258[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x477a3e[_0x13c1('0x41')][_0x13c1('0x46')]);_0x123258[_0x13c1('0x2a')]=qs[_0x13c1('0x2a')](_0x477a3e[_0x13c1('0x41')]['offset']);}_0x123258['order']=qs[_0x13c1('0x48')](_0x477a3e[_0x13c1('0x41')]['sort']);_0x123258[_0x13c1('0x4b')]=qs['filters'](_['pick'](_0x477a3e[_0x13c1('0x41')],_0x17d5f3['filters']));_0x123258[_0x13c1('0x4b')]['OpenchannelAccountId']=_0x25ef8c['id'];if(_0x477a3e[_0x13c1('0x41')][_0x13c1('0x4a')]){_0x123258[_0x13c1('0x4b')]=_[_0x13c1('0x4c')](_0x123258['where'],{'$or':_[_0x13c1('0x4d')](_0x123258['attributes'],function(_0x202cad){var _0x514e6c={};_0x514e6c[_0x202cad]={'$like':'%'+_0x477a3e['query'][_0x13c1('0x4a')]+'%'};return _0x514e6c;})});}_0x123258=_['merge']({},_0x123258,_0x477a3e[_0x13c1('0x51')]);return db[_0x13c1('0x62')][_0x13c1('0x29')]({'where':_0x123258[_0x13c1('0x4b')]})[_0x13c1('0x2f')](function(_0x482259){_0x4bc8f3[_0x13c1('0x29')]=_0x482259;if(_0x477a3e[_0x13c1('0x41')][_0x13c1('0x52')]){_0x123258[_0x13c1('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x13c1('0x54')](_0x123258);})['then'](function(_0x3ae399){_0x4bc8f3[_0x13c1('0x55')]=_0x3ae399;return _0x4bc8f3;});}})['then'](respondWithFilteredResult(_0x4d4534,_0x123258))[_0x13c1('0x56')](handleError(_0x4d4534,null));};exports[_0x13c1('0x65')]=function(_0x5b5d20,_0x854986,_0x3cad81){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x5b5d20['params']['id']}})['then'](handleEntityNotFound(_0x854986,null))['then'](function(_0x7f132a){if(_0x7f132a){return _0x7f132a[_0x13c1('0x65')](_0x5b5d20[_0x13c1('0x41')][_0x13c1('0x66')]);}})[_0x13c1('0x2f')](respondWithStatusCode(_0x854986,null))[_0x13c1('0x56')](handleError(_0x854986,null));};exports[_0x13c1('0x67')]=function(_0x1a61f2,_0x4d598f,_0x2e0d6b){if(_0x1a61f2[_0x13c1('0x58')]['id']){delete _0x1a61f2[_0x13c1('0x58')]['id'];}return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x1a61f2['params']['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x4d598f,null))[_0x13c1('0x2f')](function(_0x16d70a){if(_0x16d70a){_0x1a61f2[_0x13c1('0x58')]['OpenchannelAccountId']=_0x16d70a['id'];return db['CannedAnswer'][_0x13c1('0x5d')](_0x1a61f2[_0x13c1('0x58')]);}})[_0x13c1('0x2f')](respondWithResult(_0x4d598f,null))[_0x13c1('0x56')](handleError(_0x4d598f,null));};exports[_0x13c1('0x68')]=function(_0x2290f0,_0x41a4ed,_0x3a5f27){var _0x4cb82f={'raw':![],'where':{}};var _0x6ec14e={};var _0x7d2b31={'count':0x0,'rows':[]};return db[_0x13c1('0x3b')]['findOne']({'where':{'id':_0x2290f0[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x41a4ed,null))[_0x13c1('0x2f')](function(_0x377394){if(_0x377394){_0x6ec14e[_0x13c1('0x3d')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x6ec14e[_0x13c1('0x41')]=_[_0x13c1('0x3e')](_0x2290f0['query']);_0x6ec14e[_0x13c1('0x3f')]=_['intersection'](_0x6ec14e[_0x13c1('0x3d')],_0x6ec14e[_0x13c1('0x41')]);_0x4cb82f['attributes']=_[_0x13c1('0x40')](_0x6ec14e[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x2290f0[_0x13c1('0x41')][_0x13c1('0x43')]));_0x4cb82f[_0x13c1('0x42')]=_0x4cb82f[_0x13c1('0x42')][_0x13c1('0x44')]?_0x4cb82f[_0x13c1('0x42')]:_0x6ec14e[_0x13c1('0x3d')];if(!_0x2290f0[_0x13c1('0x41')][_0x13c1('0x64')](_0x13c1('0x45'))){_0x4cb82f[_0x13c1('0x46')]=qs['limit'](_0x2290f0[_0x13c1('0x41')]['limit']);_0x4cb82f['offset']=qs[_0x13c1('0x2a')](_0x2290f0[_0x13c1('0x41')][_0x13c1('0x2a')]);}_0x4cb82f['order']=qs['sort'](_0x2290f0[_0x13c1('0x41')][_0x13c1('0x48')]);_0x4cb82f[_0x13c1('0x4b')]=qs['filters'](_['pick'](_0x2290f0[_0x13c1('0x41')],_0x6ec14e[_0x13c1('0x3f')]));_0x4cb82f['where'][_0x13c1('0x69')]=_0x377394['id'];if(_0x2290f0[_0x13c1('0x41')][_0x13c1('0x4a')]){_0x4cb82f['where']=_[_0x13c1('0x4c')](_0x4cb82f[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x4cb82f[_0x13c1('0x42')],function(_0x3b23d5){var _0x520c8e={};_0x520c8e[_0x3b23d5]={'$like':'%'+_0x2290f0['query']['filter']+'%'};return _0x520c8e;})});}_0x4cb82f=_[_0x13c1('0x4c')]({},_0x4cb82f,_0x2290f0[_0x13c1('0x51')]);return db[_0x13c1('0x6a')][_0x13c1('0x29')]({'where':_0x4cb82f[_0x13c1('0x4b')]})[_0x13c1('0x2f')](function(_0x1740a3){_0x7d2b31[_0x13c1('0x29')]=_0x1740a3;if(_0x2290f0[_0x13c1('0x41')][_0x13c1('0x52')]){_0x4cb82f['include']=[{'all':!![]}];}return db[_0x13c1('0x6a')][_0x13c1('0x54')](_0x4cb82f);})[_0x13c1('0x2f')](function(_0x29993c){_0x7d2b31['rows']=_0x29993c;return _0x7d2b31;});}})[_0x13c1('0x2f')](respondWithFilteredResult(_0x41a4ed,_0x4cb82f))[_0x13c1('0x56')](handleError(_0x41a4ed,null));};exports['removeAnswers']=function(_0x4a4e99,_0x155d01,_0xce3180){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x4a4e99['params']['id']}})['then'](handleEntityNotFound(_0x155d01,null))[_0x13c1('0x2f')](function(_0x1df203){if(_0x1df203){return _0x1df203[_0x13c1('0x6b')](_0x4a4e99[_0x13c1('0x41')][_0x13c1('0x66')]);}})[_0x13c1('0x2f')](respondWithStatusCode(_0x155d01,null))[_0x13c1('0x56')](handleError(_0x155d01,null));};exports[_0x13c1('0x6c')]=function(_0xc7835a,_0x1f306a,_0x5db277){var _0x597124={'body':_0xc7835a[_0x13c1('0x58')],'channel':_0x13c1('0x6d')};var _0x4de279=[];var _0x46f2e4=[];var _0x401daa={};var _0x3e8e26=![];return db['CmContact'][_0x13c1('0x60')]()['then'](function(_0x43c837){if(!_0x43c837){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))](_0x13c1('0x70'));}_0x4de279=_['difference'](_['keys'](_0x43c837),[_0x13c1('0x71'),'updatedAt']);_0x46f2e4=_[_0x13c1('0x72')](_[_0x13c1('0x3e')](_0x43c837),[_0x13c1('0x71'),_0x13c1('0x73'),_0x13c1('0x74'),_0x13c1('0x75')]);if(_0xc7835a[_0x13c1('0x58')]['id']){delete _0xc7835a['body']['id'];}if(_[_0x13c1('0x76')](_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')])){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))](_0x13c1('0x78'));}if(_[_0x13c1('0x76')](_0xc7835a[_0x13c1('0x58')][_0x13c1('0x58')])||_0xc7835a[_0x13c1('0x58')][_0x13c1('0x58')]===''){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))](_0x13c1('0x79'));}if(_['isNil'](_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')])){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x46f2e4);}if(!_['includes'](_0x46f2e4,_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')])){throw new db[(_0x13c1('0x6e'))]['ValidationError'](_0x13c1('0x7b')+_0x46f2e4);}_0x401daa[_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')]]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')];})['then'](function(){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0xc7835a['params']['id']},'include':[{'model':db[_0x13c1('0x7c')],'as':_0x13c1('0x7d'),'include':[{'model':db[_0x13c1('0x7e')],'as':'Contacts','where':_0x401daa,'limit':0x1,'order':[[_0x13c1('0x73'),_0x13c1('0x7f')]]}]},{'model':db['OpenchannelApplication'],'as':_0x13c1('0x80')}]});})[_0x13c1('0x2f')](handleEntityNotFound(_0x1f306a,null))[_0x13c1('0x2f')](function(_0x166abd){if(_0x166abd&&_0x166abd[_0x13c1('0x7d')]){_0x597124[_0x13c1('0x81')]=_0x166abd;_0x597124['applications']=_0x166abd['Applications'];_0x597124[_0x13c1('0x82')]=_0x166abd[_0x13c1('0x7d')];_0x597124['applications']=_[_0x13c1('0x83')](_0x597124['applications'],[_0x13c1('0x84')],[_0x13c1('0x85')]);if(_0x597124[_0x13c1('0x81')]['Applications']){delete _0x597124[_0x13c1('0x81')][_0x13c1('0x80')];}if(_0x597124[_0x13c1('0x81')][_0x13c1('0x7d')]&&_0x597124['account'][_0x13c1('0x7d')][_0x13c1('0x86')][_0x13c1('0x44')]){return _0x597124[_0x13c1('0x81')][_0x13c1('0x7d')][_0x13c1('0x86')][0x0];}var _0x3ee929=_[_0x13c1('0x87')](_0xc7835a[_0x13c1('0x58')],{'firstName':_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')],'ListId':_0x166abd[_0x13c1('0x75')]});_0x3ee929[_0xc7835a[_0x13c1('0x58')][_0x13c1('0x7a')]]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x77')];return db[_0x13c1('0x7e')][_0x13c1('0x5d')](_0x3ee929,{'fields':_0x4de279,'raw':!![]});}})[_0x13c1('0x2f')](handleEntityNotFound(_0x1f306a,null))[_0x13c1('0x2f')](function(_0xc8bcf9){_0x597124[_0x13c1('0x88')]=_0xc8bcf9;if(_0xc8bcf9){var _0x359f84={'ContactId':_0xc8bcf9['id'],'OpenchannelAccountId':_0xc7835a[_0x13c1('0x5f')]['id'],'from':(_0xc8bcf9[_0x13c1('0x89')]||'')+'\x20'+(_0xc8bcf9[_0x13c1('0x8a')]||'')};var _0x2d41b2={'OpenchannelAccountId':_0xc7835a[_0x13c1('0x5f')]['id'],'closed':![]};if(_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8b')]){_0x2d41b2['threadId']=_0xc7835a[_0x13c1('0x58')]['threadId'];return db['OpenchannelInteraction'][_0x13c1('0x57')]({'where':_0x2d41b2})[_0x13c1('0x2f')](function(_0x2537f2){if(_0x2537f2){return[_0x2537f2,![]];}_0x359f84['threadId']=_0xc7835a['body'][_0x13c1('0x8b')];_0x359f84[_0x13c1('0x8c')]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8c')];return db['OpenchannelInteraction'][_0x13c1('0x5d')](_0x359f84)[_0x13c1('0x2f')](function(_0x2136f0){return[_0x2136f0,!![]];});});}else{_0x2d41b2[_0x13c1('0x8b')]=null;}_0x2d41b2['ContactId']=_0xc8bcf9['id'];return db['OpenchannelInteraction'][_0x13c1('0x57')]({'where':_0x2d41b2})[_0x13c1('0x2f')](function(_0x367e2e){if(_0x367e2e){return[_0x367e2e,![]];}return db['OpenchannelInteraction'][_0x13c1('0x5d')](_0x359f84)[_0x13c1('0x2f')](function(_0x63b362){return[_0x63b362,!![]];});});}})[_0x13c1('0x8d')](function(_0x10bcff,_0xe428ed){if(_0x10bcff){_0x3e8e26=_0xe428ed;if(!_0xe428ed){var _0x1fd403={'from':(_0x597124[_0x13c1('0x88')][_0x13c1('0x89')]||'')+'\x20'+(_0x597124['contact']['lastName']||'')};if(_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8b')]&&_0xc7835a['body'][_0x13c1('0x8e')]&&_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8b')]!=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8e')]){_0x1fd403[_0x13c1('0x8b')]=_0xc7835a[_0x13c1('0x58')][_0x13c1('0x8e')];}return _0x10bcff[_0x13c1('0x2e')](_0x1fd403);}else{return _0x10bcff;}}})[_0x13c1('0x2f')](function(_0x45621a){_0x597124[_0x13c1('0x8f')]=_0x45621a[_0x13c1('0x30')]({'plain':!![]});_0x597124[_0x13c1('0x8f')]['created']=_0x3e8e26;if(_0x597124[_0x13c1('0x8f')]['created']){if(_0x597124['account']['autoclose']){_0x597124[_0x13c1('0x90')][_0x13c1('0x91')]({'id':0x0,'priority':_0x597124[_0x13c1('0x90')][_0x13c1('0x44')]+0x1,'app':_0x13c1('0x92'),'appdata':'unmanaged','interval':_0x13c1('0x93')});}}return db[_0x13c1('0x94')]['create']({'body':_0xc7835a[_0x13c1('0x58')][_0x13c1('0x58')],'OpenchannelAccountId':_0xc7835a[_0x13c1('0x5f')]['id'],'OpenchannelInteractionId':_0x45621a['id'],'direction':'in','ContactId':_0x597124[_0x13c1('0x88')]['id'],'AttachmentId':_0xc7835a[_0x13c1('0x58')][_0x13c1('0x95')]});})[_0x13c1('0x2f')](function(_0x417ee0){_0x597124[_0x13c1('0x25')]=_0x417ee0;if(_0x597124[_0x13c1('0x8f')]['UserId']){return db[_0x13c1('0x96')]['find']({'attributes':['id','name'],'where':{'id':_0x597124[_0x13c1('0x8f')][_0x13c1('0x97')]}})[_0x13c1('0x2f')](function(_0x2585e7){if(_0x2585e7){_0x597124[_0x13c1('0x90')][_0x13c1('0x98')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2585e7[_0x13c1('0x36')]+','+(_0x597124[_0x13c1('0x81')][_0x13c1('0x99')]||0xa),'interval':_0x13c1('0x93')});_0x597124[_0x13c1('0x9a')]=![];}return respondWithRpcPromise(_0x13c1('0x9b'),_0x13c1('0x9c'),_0x597124);});}return respondWithRpcPromise(_0x13c1('0x9b'),_0x13c1('0x9c'),_0x597124);})[_0x13c1('0x2f')](function(_0x51b492){respondWithRpcPromise('EventManager',_0x13c1('0x9d'),{'event':_0x13c1('0x6c'),'message':_0x51b492},client9002);return _0x51b492;})['then'](respondWithResult(_0x1f306a,null))['catch'](handleError(_0x1f306a,null));};exports['addApplications']=function(_0x4b750c,_0x3b9e78,_0x1ff114){return db[_0x13c1('0x3b')]['findOne']({'where':{'id':_0x4b750c[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3b9e78,null))[_0x13c1('0x2f')](function(_0x12ffff){if(_0x12ffff){return db[_0x13c1('0x9e')][_0x13c1('0x9f')](function(_0x113742){return db['OpenchannelApplication'][_0x13c1('0x33')]({'where':{'OpenchannelAccountId':_0x4b750c[_0x13c1('0x5f')]['id']},'transaction':_0x113742})[_0x13c1('0x2f')](function(_0x344273){var _0x17df41=_['map'](_0x4b750c[_0x13c1('0x58')],function(_0x295bbb){_0x295bbb[_0x13c1('0x69')]=_0x4b750c['params']['id'];return _0x295bbb;});return db[_0x13c1('0xa0')][_0x13c1('0xa1')](_0x17df41,{'transaction':_0x113742});});})[_0x13c1('0x2f')](function(){return db[_0x13c1('0xa0')][_0x13c1('0xa2')]({'where':{'OpenchannelAccountId':_0x4b750c[_0x13c1('0x5f')]['id']},'order':_0x13c1('0x84')});});}})['then'](respondWithResult(_0x3b9e78,null))[_0x13c1('0x56')](handleError(_0x3b9e78,null));};exports['getApplications']=function(_0x4f191c,_0x571a03,_0x308b27){var _0x197a25={};var _0x26914a={};var _0x3853e7;var _0x54debe;return db[_0x13c1('0x3b')][_0x13c1('0xa3')]({'where':{'id':_0x4f191c[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x571a03,null))['then'](function(_0xe1233d){if(_0xe1233d){_0x3853e7=_0xe1233d;_0x26914a['model']=_[_0x13c1('0x3e')](db[_0x13c1('0xa0')][_0x13c1('0x3c')]);_0x26914a['query']=_[_0x13c1('0x3e')](_0x4f191c['query']);_0x26914a[_0x13c1('0x3f')]=_[_0x13c1('0x40')](_0x26914a[_0x13c1('0x3d')],_0x26914a[_0x13c1('0x41')]);_0x197a25[_0x13c1('0x42')]=_[_0x13c1('0x40')](_0x26914a[_0x13c1('0x3d')],qs['fields'](_0x4f191c[_0x13c1('0x41')][_0x13c1('0x43')]));_0x197a25[_0x13c1('0x42')]=_0x197a25[_0x13c1('0x42')][_0x13c1('0x44')]?_0x197a25[_0x13c1('0x42')]:_0x26914a[_0x13c1('0x3d')];_0x197a25['order']=qs[_0x13c1('0x48')](_0x4f191c[_0x13c1('0x41')][_0x13c1('0x48')]);_0x197a25[_0x13c1('0x4b')]=qs['filters'](_[_0x13c1('0x49')](_0x4f191c[_0x13c1('0x41')],_0x26914a[_0x13c1('0x3f')]));if(_0x4f191c['query']['filter']){_0x197a25[_0x13c1('0x4b')]=_[_0x13c1('0x4c')](_0x197a25[_0x13c1('0x4b')],{'$or':_['map'](_0x197a25[_0x13c1('0x42')],function(_0x38496e){var _0xef424c={};_0xef424c[_0x38496e]={'$like':'%'+_0x4f191c[_0x13c1('0x41')][_0x13c1('0x4a')]+'%'};return _0xef424c;})});}_0x197a25=_[_0x13c1('0x4c')]({},_0x197a25,_0x4f191c[_0x13c1('0x51')]);return _0x3853e7[_0x13c1('0xa4')](_0x197a25);}})[_0x13c1('0x2f')](function(_0x31f4cc){if(_0x31f4cc){_0x54debe=_0x31f4cc[_0x13c1('0x44')];if(!_0x4f191c['query']['hasOwnProperty'](_0x13c1('0x45'))){_0x197a25[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x4f191c[_0x13c1('0x41')]['limit']);_0x197a25[_0x13c1('0x2a')]=qs['offset'](_0x4f191c[_0x13c1('0x41')][_0x13c1('0x2a')]);}return _0x3853e7[_0x13c1('0xa4')](_0x197a25);}})['then'](function(_0x36d2c7){if(_0x36d2c7){return _0x36d2c7?{'count':_0x54debe,'rows':_0x36d2c7}:null;}})[_0x13c1('0x2f')](respondWithResult(_0x571a03,null))[_0x13c1('0x56')](handleError(_0x571a03,null));};exports[_0x13c1('0xa5')]=function(_0x14dd9b,_0x464652,_0x20b114){var _0x3c50bc={'raw':![],'where':{}};var _0x10ce6d={};var _0xe73a4a={'count':0x0,'rows':[]};return db[_0x13c1('0x3b')][_0x13c1('0xa3')]({'where':{'id':_0x14dd9b[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x464652,null))[_0x13c1('0x2f')](function(_0x4a2b8c){if(_0x4a2b8c){_0x10ce6d[_0x13c1('0x3d')]=_[_0x13c1('0x3e')](db[_0x13c1('0xa6')][_0x13c1('0x3c')]);_0x10ce6d[_0x13c1('0x41')]=_[_0x13c1('0x3e')](_0x14dd9b['query']);_0x10ce6d[_0x13c1('0x3f')]=_['intersection'](_0x10ce6d[_0x13c1('0x3d')],_0x10ce6d[_0x13c1('0x41')]);_0x3c50bc[_0x13c1('0x42')]=_[_0x13c1('0x40')](_0x10ce6d[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x43')]));_0x3c50bc[_0x13c1('0x42')]=_0x3c50bc[_0x13c1('0x42')][_0x13c1('0x44')]?_0x3c50bc['attributes']:_0x10ce6d[_0x13c1('0x3d')];if(!_0x14dd9b[_0x13c1('0x41')]['hasOwnProperty'](_0x13c1('0x45'))){_0x3c50bc[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x46')]);_0x3c50bc['offset']=qs[_0x13c1('0x2a')](_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x2a')]);}_0x3c50bc[_0x13c1('0x47')]=qs['sort'](_0x14dd9b[_0x13c1('0x41')]['sort']);_0x3c50bc['where']=qs[_0x13c1('0x3f')](_[_0x13c1('0x49')](_0x14dd9b['query'],_0x10ce6d['filters']));_0x3c50bc[_0x13c1('0x4b')][_0x13c1('0x69')]=_0x4a2b8c['id'];if(_0x14dd9b[_0x13c1('0x41')]['filter']){_0x3c50bc['where']=_[_0x13c1('0x4c')](_0x3c50bc[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x3c50bc[_0x13c1('0x42')],function(_0x41fffc){var _0x2da97f={};_0x2da97f[_0x41fffc]={'$like':'%'+_0x14dd9b[_0x13c1('0x41')]['filter']+'%'};return _0x2da97f;})});}_0x3c50bc=_[_0x13c1('0x4c')]({},_0x3c50bc,_0x14dd9b[_0x13c1('0x51')]);return db[_0x13c1('0xa6')][_0x13c1('0x29')]({'where':_0x3c50bc[_0x13c1('0x4b')]})['then'](function(_0x483c57){_0xe73a4a[_0x13c1('0x29')]=_0x483c57;if(_0x14dd9b[_0x13c1('0x41')][_0x13c1('0x52')]){_0x3c50bc[_0x13c1('0x53')]=[{'model':db[_0x13c1('0x7e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x13c1('0xa7'),'attributes':[_0x13c1('0x36'),_0x13c1('0xa8'),_0x13c1('0xa9')],'required':![]},{'model':db[_0x13c1('0xaa')],'as':'Tags','attributes':['id',_0x13c1('0x36'),_0x13c1('0xab')],'where':_0x14dd9b[_0x13c1('0x41')][_0x13c1('0xac')]?{'id':_0x14dd9b[_0x13c1('0x41')][_0x13c1('0xac')]}:undefined,'required':_0x14dd9b[_0x13c1('0x41')][_0x13c1('0xac')]?!![]:![]}];}return db[_0x13c1('0xa6')][_0x13c1('0x54')](_0x3c50bc);})[_0x13c1('0x2f')](function(_0x93a00c){_0xe73a4a[_0x13c1('0x55')]=_0x93a00c;return _0xe73a4a;});}})['then'](respondWithFilteredResult(_0x464652,_0x3c50bc))[_0x13c1('0x56')](handleError(_0x464652,null));};exports['addAgents']=function(_0x527dc0,_0x410010,_0x2e1e9f){return db['OpenchannelAccount'][_0x13c1('0x57')]({'where':{'id':_0x527dc0['params']['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x410010,null))['then'](function(_0x3d301b){if(_0x3d301b){return _0x3d301b[_0x13c1('0xad')](_0x527dc0['body'][_0x13c1('0x66')],_[_0x13c1('0xae')](_0x527dc0['body'],['ids','id'])||{})[_0x13c1('0x8d')](function(_0x1bd5ed){for(var _0x8ea669=0x0;_0x8ea669<_0x527dc0[_0x13c1('0x58')][_0x13c1('0x66')][_0x13c1('0x44')];_0x8ea669+=0x1){socket[_0x13c1('0xaf')]('userOpenchannelAccount:save',{'UserId':_0x527dc0[_0x13c1('0x58')][_0x13c1('0x66')][_0x8ea669],'OpenchannelAccountId':_0x527dc0[_0x13c1('0x5f')]['id']});}return _0x1bd5ed;});}})[_0x13c1('0x2f')](respondWithResult(_0x410010,null))[_0x13c1('0x56')](handleError(_0x410010,null));};exports[_0x13c1('0xb0')]=function(_0x522d4f,_0x37c949,_0x192f4a){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x522d4f[_0x13c1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x37c949,null))[_0x13c1('0x2f')](function(_0x206026){if(_0x206026){return _0x206026[_0x13c1('0xb0')](_0x522d4f[_0x13c1('0x41')][_0x13c1('0x66')])['then'](function(){if(_[_0x13c1('0xb1')](_0x522d4f['query'][_0x13c1('0x66')])){for(var _0x20bdc4=0x0;_0x20bdc4<_0x522d4f[_0x13c1('0x41')]['ids'][_0x13c1('0x44')];_0x20bdc4+=0x1){socket[_0x13c1('0xaf')]('userOpenchannelAccount:remove',{'UserId':Number(_0x522d4f['query'][_0x13c1('0x66')][_0x20bdc4]),'OpenchannelAccountId':Number(_0x522d4f[_0x13c1('0x5f')]['id'])});}}else{socket[_0x13c1('0xaf')]('userOpenchannelAccount:remove',{'UserId':Number(_0x522d4f['query'][_0x13c1('0x66')]),'OpenchannelAccountId':Number(_0x522d4f[_0x13c1('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x37c949,null))[_0x13c1('0x56')](handleError(_0x37c949,null));};exports[_0x13c1('0xb2')]=function(_0x136ea4,_0x3a86f9,_0x4f52b1){var _0x4a60fb={};var _0x183f3e={};var _0xf8b3e2;var _0x3e7162;return db['OpenchannelAccount'][_0x13c1('0xa3')]({'where':{'id':_0x136ea4['params']['id']}})['then'](handleEntityNotFound(_0x3a86f9,null))[_0x13c1('0x2f')](function(_0x5d688a){if(_0x5d688a){_0xf8b3e2=_0x5d688a;_0x183f3e[_0x13c1('0x3d')]=_[_0x13c1('0x3e')](db[_0x13c1('0x96')][_0x13c1('0x3c')]);_0x183f3e['query']=_[_0x13c1('0x3e')](_0x136ea4[_0x13c1('0x41')]);_0x183f3e[_0x13c1('0x3f')]=_[_0x13c1('0x40')](_0x183f3e['model'],_0x183f3e['query']);_0x4a60fb['attributes']=_[_0x13c1('0x40')](_0x183f3e[_0x13c1('0x3d')],qs[_0x13c1('0x43')](_0x136ea4[_0x13c1('0x41')][_0x13c1('0x43')]));_0x4a60fb[_0x13c1('0x42')]=_0x4a60fb[_0x13c1('0x42')][_0x13c1('0x44')]?_0x4a60fb[_0x13c1('0x42')]:_0x183f3e[_0x13c1('0x3d')];_0x4a60fb['order']=qs[_0x13c1('0x48')](_0x136ea4['query'][_0x13c1('0x48')]);_0x4a60fb[_0x13c1('0x4b')]=qs[_0x13c1('0x3f')](_[_0x13c1('0x49')](_0x136ea4['query'],_0x183f3e['filters']));if(_0x136ea4[_0x13c1('0x41')][_0x13c1('0x4a')]){_0x4a60fb['where']=_['merge'](_0x4a60fb[_0x13c1('0x4b')],{'$or':_[_0x13c1('0x4d')](_0x4a60fb[_0x13c1('0x42')],function(_0x3e6d49){var _0x2d34fb={};_0x2d34fb[_0x3e6d49]={'$like':'%'+_0x136ea4[_0x13c1('0x41')][_0x13c1('0x4a')]+'%'};return _0x2d34fb;})});}_0x4a60fb=_[_0x13c1('0x4c')]({},_0x4a60fb,_0x136ea4['options']);return _0xf8b3e2[_0x13c1('0xb2')](_0x4a60fb);}})[_0x13c1('0x2f')](function(_0x34ca19){if(_0x34ca19){_0x3e7162=_0x34ca19['length'];if(!_0x136ea4[_0x13c1('0x41')][_0x13c1('0x64')](_0x13c1('0x45'))){_0x4a60fb[_0x13c1('0x46')]=qs[_0x13c1('0x46')](_0x136ea4[_0x13c1('0x41')][_0x13c1('0x46')]);_0x4a60fb[_0x13c1('0x2a')]=qs[_0x13c1('0x2a')](_0x136ea4[_0x13c1('0x41')]['offset']);}return _0xf8b3e2[_0x13c1('0xb2')](_0x4a60fb);}})[_0x13c1('0x2f')](function(_0x11369b){if(_0x11369b){return _0x11369b?{'count':_0x3e7162,'rows':_0x11369b}:null;}})['then'](respondWithResult(_0x3a86f9,null))[_0x13c1('0x56')](handleError(_0x3a86f9,null));};exports[_0x13c1('0x37')]=function(_0x58e629,_0x39411e,_0x471c5a){var _0x24435b,_0x231c0a,_0x23ef4c;if(_[_0x13c1('0x76')](_0x58e629[_0x13c1('0x58')][_0x13c1('0x58')])||_0x58e629['body'][_0x13c1('0x58')]===''){throw new db[(_0x13c1('0x6e'))][(_0x13c1('0x6f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x58e629['body']['to'])){}_0x24435b=_0x58e629[_0x13c1('0x58')]['to'];return db[_0x13c1('0x3b')][_0x13c1('0xa3')]({'where':{'id':_0x58e629[_0x13c1('0x5f')]['id']}})[_0x13c1('0x2f')](handleEntityNotFound(_0x39411e,null))['then'](function(_0x541836){if(_0x541836){return db[_0x13c1('0x3b')][_0x13c1('0x57')]({'where':{'id':_0x541836['id']},'include':[{'model':db['CmList'],'as':_0x13c1('0x7d'),'include':[{'model':db['CmContact'],'as':_0x13c1('0x86'),'where':{[_0x541836['mapKey']]:_0x24435b},'limit':0x1,'order':[[_0x13c1('0x73'),'DESC']]}]}]})[_0x13c1('0x2f')](handleEntityNotFound(_0x39411e,null))[_0x13c1('0x2f')](function(_0x34be74){if(_0x34be74&&_0x34be74[_0x13c1('0x7d')]){_0x231c0a=_0x34be74[_0x13c1('0x30')]({'plain':!![]});if(_0x231c0a[_0x13c1('0x7d')]&&_0x231c0a['List']['Contacts'][_0x13c1('0x44')]){return _0x231c0a[_0x13c1('0x7d')][_0x13c1('0x86')][0x0];}return db[_0x13c1('0x7e')]['create'](_[_0x13c1('0x87')](_0x58e629[_0x13c1('0x58')],{'firstName':_0x24435b,[_0x34be74[_0x13c1('0x7a')]]:_0x24435b,'phone':_0x24435b,'ListId':_0x231c0a[_0x13c1('0x75')]}));}})[_0x13c1('0x2f')](handleEntityNotFound(_0x39411e,null))[_0x13c1('0x2f')](function(_0x33d551){if(_0x33d551){_0x23ef4c=_0x33d551;return db[_0x13c1('0xa6')][_0x13c1('0x57')]({'where':{'ContactId':_0x23ef4c['id'],'closed':![],'OpenchannelAccountId':_0x231c0a['id']}})[_0x13c1('0x2f')](function(_0x4b444f){if(_0x4b444f){return[_0x4b444f,![]];}return db[_0x13c1('0xa6')][_0x13c1('0x5d')]({'UserId':_0x58e629[_0x13c1('0x59')]['id'],'ContactId':_0x23ef4c['id'],'OpenchannelAccountId':_0x231c0a['id'],'lastMsgDirection':_0x13c1('0xb3'),'Messages':[_[_0x13c1('0x4c')](_0x58e629[_0x13c1('0x58')],{'read':![],'body':_0x58e629[_0x13c1('0x58')]['body'],'OpenchannelAccountId':_0x231c0a['id'],'UserId':_0x58e629[_0x13c1('0x59')]['id'],'ContactId':_0x23ef4c['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x13c1('0xb4')}]})['then'](function(_0x11d825){return[_0x11d825,!![]];});});}})[_0x13c1('0x8d')](function(_0x2ff4c6,_0x11ff18){if(_0x11ff18){return _0x2ff4c6;}return db[_0x13c1('0x94')][_0x13c1('0x5d')](_[_0x13c1('0x4c')](_0x58e629[_0x13c1('0x58')],{'read':![],'body':_0x58e629[_0x13c1('0x58')]['body'],'OpenchannelAccountId':_0x231c0a['id'],'OpenchannelInteractionId':_0x2ff4c6['id'],'UserId':_0x58e629[_0x13c1('0x59')]['id'],'ContactId':_0x23ef4c['id']}))[_0x13c1('0x2f')](function(_0x553ba0){_0x2ff4c6['dataValues']['Messages']=[];_0x2ff4c6[_0x13c1('0xb5')][_0x13c1('0xb4')][_0x13c1('0x91')](_0x553ba0[_0x13c1('0xb5')]);return _0x2ff4c6;});});}})[_0x13c1('0x2f')](respondWithResult(_0x39411e,null))[_0x13c1('0x56')](handleError(_0x39411e,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 95b170a..811cfa7 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 _0xf72b=['update','emit','hook','exports','events','OpenchannelAccount','save'];(function(_0xab2048,_0x50baf6){var _0x80b1bd=function(_0x48186f){while(--_0x48186f){_0xab2048['push'](_0xab2048['shift']());}};_0x80b1bd(++_0x50baf6);}(_0xf72b,0x1d9));var _0xbf72=function(_0x184311,_0x302eeb){_0x184311=_0x184311-0x0;var _0x2f2594=_0xf72b[_0x184311];return _0x2f2594;};'use strict';var EventEmitter=require(_0xbf72('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xbf72('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbf72('0x2'),'afterUpdate':_0xbf72('0x3'),'afterDestroy':'remove'};function emitEvent(_0x339c11){return function(_0x550a9e,_0x37afc8,_0x3d3a6f){OpenchannelAccountEvents[_0xbf72('0x4')](_0x339c11+':'+_0x550a9e['id'],_0x550a9e);OpenchannelAccountEvents[_0xbf72('0x4')](_0x339c11,_0x550a9e);_0x3d3a6f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbf72('0x5')](e,emitEvent(event));}}module[_0xbf72('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xf9b4=['emit','hook','events','setMaxListeners','save','update','remove'];(function(_0xf1aa01,_0x477960){var _0x2e8946=function(_0x37e388){while(--_0x37e388){_0xf1aa01['push'](_0xf1aa01['shift']());}};_0x2e8946(++_0x477960);}(_0xf9b4,0x64));var _0x4f9b=function(_0x3a1077,_0x3bcd8c){_0x3a1077=_0x3a1077-0x0;var _0x44372d=_0xf9b4[_0x3a1077];return _0x44372d;};'use strict';var EventEmitter=require(_0x4f9b('0x0'));var OpenchannelAccount=require('../../mysqldb')['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x4f9b('0x1')](0x0);var events={'afterCreate':_0x4f9b('0x2'),'afterUpdate':_0x4f9b('0x3'),'afterDestroy':_0x4f9b('0x4')};function emitEvent(_0x561d1e){return function(_0x3e68ce,_0x1655ba,_0x3f37cb){OpenchannelAccountEvents[_0x4f9b('0x5')](_0x561d1e+':'+_0x3e68ce['id'],_0x3e68ce);OpenchannelAccountEvents[_0x4f9b('0x5')](_0x561d1e,_0x3e68ce);_0x3f37cb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x4f9b('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index aac846e..f4af0a2 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 _0x2b4c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x2b4c,0xc4));var _0xc2b4=function(_0x495086,_0x5e6898){_0x495086=_0x495086-0x0;var _0x1398cb=_0x2b4c[_0x495086];return _0x1398cb;};'use strict';var _=require(_0xc2b4('0x0'));var util=require(_0xc2b4('0x1'));var logger=require(_0xc2b4('0x2'))(_0xc2b4('0x3'));var moment=require(_0xc2b4('0x4'));var BPromise=require(_0xc2b4('0x5'));var rp=require(_0xc2b4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc2b4('0x7'));var config=require(_0xc2b4('0x8'));var attributes=require(_0xc2b4('0x9'));module[_0xc2b4('0xa')]=function(_0x440485,_0x6dbd56){return _0x440485[_0xc2b4('0xb')](_0xc2b4('0xc'),attributes,{'tableName':_0xc2b4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0c3=['exports','OpenchannelAccount','lodash','util','bluebird','path','rimraf','./openchannelAccount.attributes'];(function(_0x4aee5e,_0x4025de){var _0x4a900d=function(_0x394766){while(--_0x394766){_0x4aee5e['push'](_0x4aee5e['shift']());}};_0x4a900d(++_0x4025de);}(_0xb0c3,0x9a));var _0x3b0c=function(_0x230443,_0x2d27dc){_0x230443=_0x230443-0x0;var _0x245f39=_0xb0c3[_0x230443];return _0x245f39;};'use strict';var _=require(_0x3b0c('0x0'));var util=require(_0x3b0c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3b0c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b0c('0x3'));var rimraf=require(_0x3b0c('0x4'));var config=require('../../config/environment');var attributes=require(_0x3b0c('0x5'));module[_0x3b0c('0x6')]=function(_0x48b241,_0x14bb3e){return _0x48b241['define'](_0x3b0c('0x7'),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 ad1e645..d8ab362 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0x105a8e,_0x12dd9a){var _0x298729=function(_0x3e9079){while(--_0x3e9079){_0x105a8e['push'](_0x105a8e['shift']());}};_0x298729(++_0x12dd9a);}(_0xe14b,0x93));var _0xbe14=function(_0x21f315,_0x5c7226){_0x21f315=_0x21f315-0x0;var _0x2ba88b=_0xe14b[_0x21f315];return _0x2ba88b;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring'];(function(_0xe80a60,_0x482e2b){var _0x2cca08=function(_0x31c4da){while(--_0x31c4da){_0xe80a60['push'](_0xe80a60['shift']());}};_0x2cca08(++_0x482e2b);}(_0xe14b,0x93));var _0xbe14=function(_0x12cac1,_0x3b514c){_0x12cac1=_0x12cac1-0x0;var _0xa55f9f=_0xe14b[_0x12cac1];return _0xa55f9f;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});config[_0xbe14('0x9')]=_[_0xbe14('0xa')](config[_0xbe14('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe14('0xb'))[_0xbe14('0xc')](socket);function respondWithRpcPromise(_0xd68cd7,_0x90b4f,_0x53c7ea){return new BPromise(function(_0x5b9fc6,_0x113243){return client[_0xbe14('0xd')](_0xd68cd7,_0x53c7ea)['then'](function(_0x254c3b){logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));logger[_0xbe14('0x11')](_0xbe14('0x12'),_0x90b4f,_0xbe14('0x10'),JSON[_0xbe14('0x13')](_0x254c3b));if(_0x254c3b[_0xbe14('0x14')]){if(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x15')]===0x1f4){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error']['message']);return _0x113243(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x254c3b['error'][_0xbe14('0x16')]);return _0x5b9fc6(_0x254c3b[_0xbe14('0x14')][_0xbe14('0x16')]);}else{logger[_0xbe14('0xe')](_0xbe14('0xf'),_0x90b4f,_0xbe14('0x10'));_0x5b9fc6(_0x254c3b[_0xbe14('0x17')]['message']);}})[_0xbe14('0x18')](function(_0x456ca8){logger[_0xbe14('0x14')](_0xbe14('0xf'),_0x90b4f,_0x456ca8);_0x113243(_0x456ca8);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 07df75d..7d071b2 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 _0x7d17=['remove','update','emit','removeListener','length','save'];(function(_0x50859e,_0x2c958a){var _0x5847a2=function(_0x265a30){while(--_0x265a30){_0x50859e['push'](_0x50859e['shift']());}};_0x5847a2(++_0x2c958a);}(_0x7d17,0xc5));var _0x77d1=function(_0x557098,_0x3bd0ea){_0x557098=_0x557098-0x0;var _0x4effce=_0x7d17[_0x557098];return _0x4effce;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x77d1('0x0'),_0x77d1('0x1'),_0x77d1('0x2')];function createListener(_0x43fc13,_0x47e7ed){return function(_0x4bec1b){_0x47e7ed[_0x77d1('0x3')](_0x43fc13,_0x4bec1b);};}function removeListener(_0x3b04ba,_0x54b6f2){return function(){OpenchannelAccountEvents[_0x77d1('0x4')](_0x3b04ba,_0x54b6f2);};}exports['register']=function(_0x2199d8){for(var _0x597a92=0x0,_0x3f53f8=events[_0x77d1('0x5')];_0x597a92<_0x3f53f8;_0x597a92++){var _0x1d5cb6=events[_0x597a92];var _0x1f5efc=createListener('openchannelAccount:'+_0x1d5cb6,_0x2199d8);OpenchannelAccountEvents['on'](_0x1d5cb6,_0x1f5efc);}}; \ No newline at end of file +var _0xa47a=['./openchannelAccount.events','save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x910521,_0x23719d){var _0x3734a9=function(_0x32bcbb){while(--_0x32bcbb){_0x910521['push'](_0x910521['shift']());}};_0x3734a9(++_0x23719d);}(_0xa47a,0x75));var _0xaa47=function(_0x52b01a,_0x203c72){_0x52b01a=_0x52b01a-0x0;var _0x3b24de=_0xa47a[_0x52b01a];return _0x3b24de;};'use strict';var OpenchannelAccountEvents=require(_0xaa47('0x0'));var events=[_0xaa47('0x1'),_0xaa47('0x2'),_0xaa47('0x3')];function createListener(_0x5e35b6,_0x24274f){return function(_0x162849){_0x24274f[_0xaa47('0x4')](_0x5e35b6,_0x162849);};}function removeListener(_0x53041a,_0x53c9af){return function(){OpenchannelAccountEvents[_0xaa47('0x5')](_0x53041a,_0x53c9af);};}exports[_0xaa47('0x6')]=function(_0x2a70a3){for(var _0x42520d=0x0,_0x561f01=events[_0xaa47('0x7')];_0x42520d<_0x561f01;_0x42520d++){var _0x37f905=events[_0x42520d];var _0x1e309d=createListener(_0xaa47('0x8')+_0x37f905,_0x2a70a3);OpenchannelAccountEvents['on'](_0x37f905,_0x1e309d);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8807e63..a6bee0b 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 _0x65ee=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','index','get','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x192525,_0x1f5573){var _0x13c068=function(_0x110fda){while(--_0x110fda){_0x192525['push'](_0x192525['shift']());}};_0x13c068(++_0x1f5573);}(_0x65ee,0x1c8));var _0xe65e=function(_0xb8721d,_0xea5580){_0xb8721d=_0xb8721d-0x0;var _0x261ce3=_0x65ee[_0xb8721d];return _0x261ce3;};'use strict';var multer=require('multer');var util=require(_0xe65e('0x0'));var path=require(_0xe65e('0x1'));var timeout=require(_0xe65e('0x2'));var express=require(_0xe65e('0x3'));var router=express['Router']();var auth=require(_0xe65e('0x4'));var interaction=require(_0xe65e('0x5'));var config=require('../../config/environment');var controller=require(_0xe65e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xe65e('0x7')]);router[_0xe65e('0x8')](_0xe65e('0x9'),auth['isAuthenticated'](),controller[_0xe65e('0xa')]);router[_0xe65e('0xb')]('/',auth[_0xe65e('0xc')](),controller[_0xe65e('0xd')]);router[_0xe65e('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe65e('0xf')]);router[_0xe65e('0x10')](_0xe65e('0x9'),auth['isAuthenticated'](),controller[_0xe65e('0x11')]);module[_0xe65e('0x12')]=router; \ No newline at end of file +var _0xe7a0=['exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','update','destroy'];(function(_0x36b706,_0xb292c5){var _0x289b63=function(_0x5308b7){while(--_0x5308b7){_0x36b706['push'](_0x36b706['shift']());}};_0x289b63(++_0xb292c5);}(_0xe7a0,0x17b));var _0x0e7a=function(_0x2c45ab,_0x561f98){_0x2c45ab=_0x2c45ab-0x0;var _0x3ae668=_0xe7a0[_0x2c45ab];return _0x3ae668;};'use strict';var multer=require(_0x0e7a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0e7a('0x1'));var express=require('express');var router=express[_0x0e7a('0x2')]();var auth=require(_0x0e7a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0e7a('0x4'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x0e7a('0x5')](),controller[_0x0e7a('0x6')]);router[_0x0e7a('0x7')](_0x0e7a('0x8'),auth[_0x0e7a('0x5')](),controller['show']);router[_0x0e7a('0x9')]('/',auth[_0x0e7a('0x5')](),controller[_0x0e7a('0xa')]);router['put'](_0x0e7a('0x8'),auth[_0x0e7a('0x5')](),controller[_0x0e7a('0xb')]);router['delete'](_0x0e7a('0x8'),auth['isAuthenticated'](),controller[_0x0e7a('0xc')]);module[_0x0e7a('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 733d2f4..824e614 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 _0xf0f4=['*,*,*,*','exports','noop','TEXT','STRING'];(function(_0x4e999b,_0x4b3fdb){var _0x1d8b5a=function(_0x32b618){while(--_0x32b618){_0x4e999b['push'](_0x4e999b['shift']());}};_0x1d8b5a(++_0x4b3fdb);}(_0xf0f4,0x182));var _0x4f0f=function(_0x5468c3,_0x20fa98){_0x5468c3=_0x5468c3-0x0;var _0x1d0ee9=_0xf0f4[_0x5468c3];return _0x1d0ee9;};'use strict';var Sequelize=require('sequelize');module[_0x4f0f('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4f0f('0x1')},'appdata':{'type':Sequelize[_0x4f0f('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4f0f('0x3')],'defaultValue':_0x4f0f('0x4')}}; \ No newline at end of file +var _0x4b20=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x3cb667,_0x2eb960){var _0x59f23d=function(_0x29875d){while(--_0x29875d){_0x3cb667['push'](_0x3cb667['shift']());}};_0x59f23d(++_0x2eb960);}(_0x4b20,0x116));var _0x04b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b20[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x04b2('0x0'));module[_0x04b2('0x1')]={'priority':{'type':Sequelize[_0x04b2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x04b2('0x3')],'allowNull':![],'defaultValue':_0x04b2('0x4')},'appdata':{'type':Sequelize[_0x04b2('0x5')]()},'description':{'type':Sequelize[_0x04b2('0x3')]},'interval':{'type':Sequelize[_0x04b2('0x3')],'defaultValue':_0x04b2('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 3a4b0d7..0a2ec35 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 _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x3112e0,_0x3e59c7){var _0x425881=function(_0x535a9a){while(--_0x535a9a){_0x3112e0['push'](_0x3112e0['shift']());}};_0x425881(++_0x3e59c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file +var _0xa9e0=['fields','length','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelApplication','rawAttributes','model','keys','query','filters','attributes','intersection'];(function(_0x4f6cbc,_0x2b754d){var _0x388649=function(_0x3f09ba){while(--_0x3f09ba){_0x4f6cbc['push'](_0x4f6cbc['shift']());}};_0x388649(++_0x2b754d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelApplication'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelApplication'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 8abd698..af75eb8 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 _0xf58a=['OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','util','bluebird','request-promise','./openchannelApplication.attributes','define'];(function(_0x2a2f52,_0x37a983){var _0x1e1816=function(_0x35d531){while(--_0x35d531){_0x2a2f52['push'](_0x2a2f52['shift']());}};_0x1e1816(++_0x37a983);}(_0xf58a,0x1a3));var _0xaf58=function(_0x300b2f,_0x537721){_0x300b2f=_0x300b2f-0x0;var _0x155f75=_0xf58a[_0x300b2f];return _0x155f75;};'use strict';var _=require('lodash');var util=require(_0xaf58('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xaf58('0x1'));var rp=require(_0xaf58('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xaf58('0x3'));module['exports']=function(_0x198069,_0x5270cd){return _0x198069[_0xaf58('0x4')](_0xaf58('0x5'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf58('0x6'),'collate':_0xaf58('0x7')});}; \ No newline at end of file +var _0xdd86=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define'];(function(_0x412b2a,_0x11fb8a){var _0x5872e3=function(_0x202191){while(--_0x202191){_0x412b2a['push'](_0x412b2a['shift']());}};_0x5872e3(++_0x11fb8a);}(_0xdd86,0x15d));var _0x6dd8=function(_0x21b5ad,_0x2d7eb4){_0x21b5ad=_0x21b5ad-0x0;var _0x4c1f6=_0xdd86[_0x21b5ad];return _0x4c1f6;};'use strict';var _=require(_0x6dd8('0x0'));var util=require(_0x6dd8('0x1'));var logger=require(_0x6dd8('0x2'))('api');var moment=require(_0x6dd8('0x3'));var BPromise=require(_0x6dd8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6dd8('0x5'));var rimraf=require(_0x6dd8('0x6'));var config=require(_0x6dd8('0x7'));var attributes=require(_0x6dd8('0x8'));module[_0x6dd8('0x9')]=function(_0x52a55d,_0xde9f0e){return _0x52a55d[_0x6dd8('0xa')](_0x6dd8('0xb'),attributes,{'tableName':_0x6dd8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6dd8('0xd'),'collate':_0x6dd8('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 7b37938..bb796b4 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 _0x69a3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','body','options','attributes','limit','UpdateOpenchannelApplication','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c5032,_0x5117e2){var _0x899e91=function(_0x17c807){while(--_0x17c807){_0x2c5032['push'](_0x2c5032['shift']());}};_0x899e91(++_0x5117e2);}(_0x69a3,0x8f));var _0x369a=function(_0x2ede05,_0xdfc03e){_0x2ede05=_0x2ede05-0x0;var _0x837350=_0x69a3[_0x2ede05];return _0x837350;};'use strict';var _=require(_0x369a('0x0'));var util=require(_0x369a('0x1'));var moment=require(_0x369a('0x2'));var BPromise=require(_0x369a('0x3'));var rs=require(_0x369a('0x4'));var fs=require('fs');var Redis=require(_0x369a('0x5'));var db=require(_0x369a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x369a('0x7'))(_0x369a('0x8'));var config=require(_0x369a('0x9'));var jayson=require(_0x369a('0xa'));var client=jayson[_0x369a('0xb')][_0x369a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38f825,_0x539fbe,_0x730d84){return new BPromise(function(_0x14a6cb,_0x130bb1){return client[_0x369a('0xd')](_0x38f825,_0x730d84)[_0x369a('0xe')](function(_0x1c2f8b){logger[_0x369a('0xf')](_0x369a('0x10'),_0x539fbe,_0x369a('0x11'));logger['debug'](_0x369a('0x12'),_0x539fbe,'request\x20sent',JSON['stringify'](_0x1c2f8b));if(_0x1c2f8b[_0x369a('0x13')]){if(_0x1c2f8b[_0x369a('0x13')][_0x369a('0x14')]===0x1f4){logger[_0x369a('0x13')](_0x369a('0x10'),_0x539fbe,_0x1c2f8b[_0x369a('0x13')]['message']);return _0x130bb1(_0x1c2f8b[_0x369a('0x13')]['message']);}logger[_0x369a('0x13')](_0x369a('0x10'),_0x539fbe,_0x1c2f8b[_0x369a('0x13')]['message']);return _0x14a6cb(_0x1c2f8b[_0x369a('0x13')]['message']);}else{logger[_0x369a('0xf')](_0x369a('0x10'),_0x539fbe,_0x369a('0x11'));_0x14a6cb(_0x1c2f8b['result'][_0x369a('0x15')]);}})[_0x369a('0x16')](function(_0x2cea27){logger['error'](_0x369a('0x10'),_0x539fbe,_0x2cea27);_0x130bb1(_0x2cea27);});});}exports['UpdateOpenchannelApplication']=function(_0x2efd3f){var _0x12a9e6=this;return new Promise(function(_0x17ba65,_0x12f46a){return db['OpenchannelApplication']['update'](_0x2efd3f[_0x369a('0x17')],{'raw':_0x2efd3f[_0x369a('0x18')]?_0x2efd3f[_0x369a('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2efd3f['options']?_0x2efd3f[_0x369a('0x18')]['where']||null:null,'attributes':_0x2efd3f[_0x369a('0x18')]?_0x2efd3f[_0x369a('0x18')][_0x369a('0x19')]||null:null,'limit':_0x2efd3f[_0x369a('0x18')]?_0x2efd3f['options'][_0x369a('0x1a')]||null:null})[_0x369a('0xe')](function(_0x583494){logger[_0x369a('0xf')](_0x369a('0x1b'),_0x2efd3f);logger[_0x369a('0x1c')]('UpdateOpenchannelApplication',_0x2efd3f,JSON[_0x369a('0x1d')](_0x583494));_0x17ba65(_0x583494);})[_0x369a('0x16')](function(_0xad13b8){logger[_0x369a('0x13')](_0x369a('0x1b'),_0xad13b8[_0x369a('0x15')],_0x2efd3f);_0x12f46a(_0x12a9e6[_0x369a('0x13')](0x1f4,_0xad13b8[_0x369a('0x15')]));});});}; \ No newline at end of file +var _0x7831=['body','options','raw','attributes','limit','info','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelApplication,\x20%s,\x20%s','result','UpdateOpenchannelApplication','OpenchannelApplication','update'];(function(_0x5f03e6,_0x4bd4a8){var _0x195656=function(_0x475e54){while(--_0x475e54){_0x5f03e6['push'](_0x5f03e6['shift']());}};_0x195656(++_0x4bd4a8);}(_0x7831,0x1ba));var _0x1783=function(_0x4e3956,_0x25f786){_0x4e3956=_0x4e3956-0x0;var _0x66b1cb=_0x7831[_0x4e3956];return _0x66b1cb;};'use strict';var _=require(_0x1783('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1783('0x1'));var rs=require(_0x1783('0x2'));var fs=require('fs');var Redis=require(_0x1783('0x3'));var db=require(_0x1783('0x4'))['db'];var utils=require(_0x1783('0x5'));var logger=require(_0x1783('0x6'))('rpc');var config=require(_0x1783('0x7'));var jayson=require(_0x1783('0x8'));var client=jayson[_0x1783('0x9')][_0x1783('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be863,_0xa22ce8,_0x58e5a7){return new BPromise(function(_0x150dbc,_0x91996d){return client['request'](_0x1be863,_0x58e5a7)['then'](function(_0x1eb8fe){logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0xa22ce8,_0x1783('0xb'));logger[_0x1783('0xc')](_0x1783('0xd'),_0xa22ce8,_0x1783('0xb'),JSON[_0x1783('0xe')](_0x1eb8fe));if(_0x1eb8fe[_0x1783('0xf')]){if(_0x1eb8fe[_0x1783('0xf')]['code']===0x1f4){logger[_0x1783('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0xa22ce8,_0x1eb8fe[_0x1783('0xf')][_0x1783('0x10')]);return _0x91996d(_0x1eb8fe[_0x1783('0xf')][_0x1783('0x10')]);}logger[_0x1783('0xf')](_0x1783('0x11'),_0xa22ce8,_0x1eb8fe[_0x1783('0xf')][_0x1783('0x10')]);return _0x150dbc(_0x1eb8fe[_0x1783('0xf')]['message']);}else{logger['info'](_0x1783('0x11'),_0xa22ce8,_0x1783('0xb'));_0x150dbc(_0x1eb8fe[_0x1783('0x12')][_0x1783('0x10')]);}})['catch'](function(_0x554062){logger[_0x1783('0xf')](_0x1783('0x11'),_0xa22ce8,_0x554062);_0x91996d(_0x554062);});});}exports[_0x1783('0x13')]=function(_0x47085f){var _0x4fe34a=this;return new Promise(function(_0x5cfb4b,_0x124a08){return db[_0x1783('0x14')][_0x1783('0x15')](_0x47085f[_0x1783('0x16')],{'raw':_0x47085f[_0x1783('0x17')]?_0x47085f[_0x1783('0x17')][_0x1783('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47085f[_0x1783('0x17')]?_0x47085f[_0x1783('0x17')]['where']||null:null,'attributes':_0x47085f['options']?_0x47085f['options'][_0x1783('0x19')]||null:null,'limit':_0x47085f[_0x1783('0x17')]?_0x47085f[_0x1783('0x17')][_0x1783('0x1a')]||null:null})['then'](function(_0x285d34){logger[_0x1783('0x1b')](_0x1783('0x13'),_0x47085f);logger[_0x1783('0xc')](_0x1783('0x13'),_0x47085f,JSON[_0x1783('0xe')](_0x285d34));_0x5cfb4b(_0x285d34);})[_0x1783('0x1c')](function(_0x553891){logger['error'](_0x1783('0x13'),_0x553891[_0x1783('0x10')],_0x47085f);_0x124a08(_0x4fe34a[_0x1783('0xf')](0x1f4,_0x553891['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 3f7a39e..1900e21 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 _0xceb8=['/:id/tags','tracked','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/messages','/:id/download','download','post','create'];(function(_0x533251,_0x2a82cc){var _0x483a8d=function(_0x35043f){while(--_0x35043f){_0x533251['push'](_0x533251['shift']());}};_0x483a8d(++_0x2a82cc);}(_0xceb8,0x19e));var _0x8ceb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xceb8[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x8ceb('0x0'));var util=require('util');var path=require(_0x8ceb('0x1'));var timeout=require(_0x8ceb('0x2'));var express=require(_0x8ceb('0x3'));var router=express[_0x8ceb('0x4')]();var auth=require(_0x8ceb('0x5'));var interaction=require(_0x8ceb('0x6'));var config=require(_0x8ceb('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x8ceb('0x8')]('/',auth[_0x8ceb('0x9')](),controller[_0x8ceb('0xa')]);router['get']('/describe',auth[_0x8ceb('0x9')](),controller['describe']);router[_0x8ceb('0x8')](_0x8ceb('0xb'),auth[_0x8ceb('0x9')](),controller[_0x8ceb('0xc')]);router[_0x8ceb('0x8')](_0x8ceb('0xd'),auth[_0x8ceb('0x9')](),controller['getMessages']);router[_0x8ceb('0x8')](_0x8ceb('0xe'),auth[_0x8ceb('0x9')](),controller[_0x8ceb('0xf')]);router[_0x8ceb('0x10')]('/',auth[_0x8ceb('0x9')](),controller[_0x8ceb('0x11')]);router[_0x8ceb('0x10')](_0x8ceb('0xd'),auth[_0x8ceb('0x9')](),controller['addMessage']);router[_0x8ceb('0x10')](_0x8ceb('0x12'),auth[_0x8ceb('0x9')](),interaction[_0x8ceb('0x13')](_0x8ceb('0x14'),'openchannelinteraction:addtags'),controller['addTags']);router['put'](_0x8ceb('0xb'),auth[_0x8ceb('0x9')](),interaction[_0x8ceb('0x13')](_0x8ceb('0x14'),_0x8ceb('0x15')),controller[_0x8ceb('0x16')]);router['delete'](_0x8ceb('0xb'),auth[_0x8ceb('0x9')](),interaction[_0x8ceb('0x13')]('openchannel',_0x8ceb('0x17')),controller[_0x8ceb('0x18')]);router[_0x8ceb('0x19')](_0x8ceb('0x12'),auth[_0x8ceb('0x9')](),controller[_0x8ceb('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x5840=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','/:id','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','exports','multer','path','connect-timeout','express'];(function(_0x58e57c,_0x2a61c2){var _0x546654=function(_0x429cb1){while(--_0x429cb1){_0x58e57c['push'](_0x58e57c['shift']());}};_0x546654(++_0x2a61c2);}(_0x5840,0x13c));var _0x0584=function(_0x5a5c11,_0x358f6b){_0x5a5c11=_0x5a5c11-0x0;var _0x5d6ba7=_0x5840[_0x5a5c11];return _0x5d6ba7;};'use strict';var multer=require(_0x0584('0x0'));var util=require('util');var path=require(_0x0584('0x1'));var timeout=require(_0x0584('0x2'));var express=require(_0x0584('0x3'));var router=express[_0x0584('0x4')]();var auth=require(_0x0584('0x5'));var interaction=require(_0x0584('0x6'));var config=require(_0x0584('0x7'));var controller=require(_0x0584('0x8'));router[_0x0584('0x9')]('/',auth[_0x0584('0xa')](),controller[_0x0584('0xb')]);router[_0x0584('0x9')](_0x0584('0xc'),auth['isAuthenticated'](),controller[_0x0584('0xd')]);router[_0x0584('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x0584('0xe')]);router[_0x0584('0x9')](_0x0584('0xf'),auth[_0x0584('0xa')](),controller[_0x0584('0x10')]);router['get']('/:id/download',auth[_0x0584('0xa')](),controller[_0x0584('0x11')]);router[_0x0584('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0584('0x12')](_0x0584('0xf'),auth['isAuthenticated'](),controller[_0x0584('0x13')]);router[_0x0584('0x12')](_0x0584('0x14'),auth['isAuthenticated'](),interaction[_0x0584('0x15')](_0x0584('0x16'),_0x0584('0x17')),controller[_0x0584('0x18')]);router['put'](_0x0584('0x19'),auth[_0x0584('0xa')](),interaction[_0x0584('0x15')]('openchannel',_0x0584('0x1a')),controller[_0x0584('0x1b')]);router[_0x0584('0x1c')](_0x0584('0x19'),auth['isAuthenticated'](),interaction[_0x0584('0x15')](_0x0584('0x16'),_0x0584('0x1d')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x0584('0x1e')]);module[_0x0584('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 96dc24c..6c13724 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 _0x23bb=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x180a87,_0x3c3463){var _0x281e81=function(_0x15cacd){while(--_0x15cacd){_0x180a87['push'](_0x180a87['shift']());}};_0x281e81(++_0x3c3463);}(_0x23bb,0xc1));var _0xb23b=function(_0x1c518c,_0x383352){_0x1c518c=_0x1c518c-0x0;var _0x2650cb=_0x23bb[_0x1c518c];return _0x2650cb;};'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')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb23b('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xb23b('0x4')]},'lastMsgAt':{'type':Sequelize[_0xb23b('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb23b('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb23b('0x4')]}}; \ No newline at end of file +var _0x004c=['ENUM','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x004c,0x85));var _0xc004=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x004c[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require(_0xc004('0x0'));module[_0xc004('0x1')]={'closed':{'type':Sequelize[_0xc004('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc004('0x3')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xc004('0x4')]},'read1stAt':{'type':Sequelize[_0xc004('0x3')]},'threadId':{'type':Sequelize[_0xc004('0x4')]},'externalUrl':{'type':Sequelize[_0xc004('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xc004('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xc004('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 09b52a4..4f4a455 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 _0x6a1b=['N.A.','closed','closedAt','disposition','threadId','Private','existsSync','createReadStream','pipe','basename','direction','out','System','lastName','renderFile','views','downloadInteraction.html','toFile','.pdf','download','unlinkSync','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','set','Content-Range','apply','save','update','then','error','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','select','field','COUNT(*)','from','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','ui.UserId\x20=\x20i.UserId','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','expr','advancedFilter','parse','forEach','createdAt','dateStart','startOf','day','utc','format','endOf','and','isArray','condition','value','TagId','\x20IN\x20?','\x20=\x20?','tableAlias','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','Messages.count','map','isNil','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','sequelize','count','keyBy','merge','OpenchannelInteraction','Account.key','i.*','Contact.email','c.mobile','c.fax','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','Users','Tags','push','rows','show','params','includeAll','include','options','find','create','body','catch','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','root','tmp','server','files','attachments','transcript-%d-%s.zip','Messages','secret','fullname','Contact','firstName','Attachment','OpenchannelAccount','Account','User','get','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','Owner'];(function(_0x51e4fd,_0x3d0624){var _0x514c08=function(_0xd0e223){while(--_0xd0e223){_0x51e4fd['push'](_0x51e4fd['shift']());}};_0x514c08(++_0x3d0624);}(_0x6a1b,0x1e9));var _0xb6a1=function(_0x5b425a,_0x19830b){_0x5b425a=_0x5b425a-0x0;var _0x16e8ba=_0x6a1b[_0x5b425a];return _0x16e8ba;};'use strict';var pdf=require(_0xb6a1('0x0'));var emlformat=require(_0xb6a1('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6a1('0x2'));var rp=require(_0xb6a1('0x3'));var moment=require(_0xb6a1('0x4'));var BPromise=require(_0xb6a1('0x5'));var Mustache=require(_0xb6a1('0x6'));var util=require('util');var path=require(_0xb6a1('0x7'));var sox=require(_0xb6a1('0x8'));var csv=require('to-csv');var ejs=require(_0xb6a1('0x9'));var fs=require('fs');var _=require(_0xb6a1('0xa'));var squel=require(_0xb6a1('0xb'));var crypto=require(_0xb6a1('0xc'));var jsforce=require(_0xb6a1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb6a1('0xe'));var querystring=require(_0xb6a1('0xf'));var Papa=require(_0xb6a1('0x10'));var Redis=require(_0xb6a1('0x11'));var authService=require(_0xb6a1('0x12'));var qs=require(_0xb6a1('0x13'));var hardwareService=require(_0xb6a1('0x14'));var logger=require(_0xb6a1('0x15'))(_0xb6a1('0x16'));var utils=require(_0xb6a1('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xb6a1('0x18')]=_[_0xb6a1('0x19')](config[_0xb6a1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb6a1('0x1a'))(new Redis(config[_0xb6a1('0x18')]));require(_0xb6a1('0x1b'))[_0xb6a1('0x1c')](socket);function respondWithStatusCode(_0x2180c9,_0x2812f4){_0x2812f4=_0x2812f4||0xcc;return function(_0x4d641b){if(_0x4d641b){return _0x2180c9[_0xb6a1('0x1d')](_0x2812f4);}return _0x2180c9[_0xb6a1('0x1e')](_0x2812f4)[_0xb6a1('0x1f')]();};}function respondWithResult(_0x42161d,_0x239e51){_0x239e51=_0x239e51||0xc8;return function(_0x50f5c1){if(_0x50f5c1){return _0x42161d[_0xb6a1('0x1e')](_0x239e51)[_0xb6a1('0x20')](_0x50f5c1);}};}function respondWithFilteredResult(_0xa2b107,_0x13466f){return function(_0x4a4f67){if(_0x4a4f67){var _0xf2c10d=_0x4a4f67['count'],_0x354484=_0x13466f['offset'],_0x3a78e5=_0x13466f['offset']+_0x13466f['limit'],_0x5db947;if(_0x3a78e5>=_0xf2c10d){_0x3a78e5=_0xf2c10d;_0x5db947=0xc8;}else{_0x5db947=0xce;}_0xa2b107[_0xb6a1('0x1e')](_0x5db947);return _0xa2b107[_0xb6a1('0x21')](_0xb6a1('0x22'),_0x354484+'-'+_0x3a78e5+'/'+_0xf2c10d)['json'](_0x4a4f67);}return null;};}function patchUpdates(_0xc70e20){return function(_0x47f860){try{jsonpatch[_0xb6a1('0x23')](_0x47f860,_0xc70e20,!![]);}catch(_0x18cb70){return BPromise['reject'](_0x18cb70);}return _0x47f860[_0xb6a1('0x24')]();};}function saveUpdates(_0x25ed82,_0x4d6855){return function(_0x122bef){if(_0x122bef){return _0x122bef[_0xb6a1('0x25')](_0x25ed82)[_0xb6a1('0x26')](function(_0x2d290e){return _0x2d290e;});}return null;};}function removeEntity(_0x41405e,_0x162a59){return function(_0x34543f){if(_0x34543f){return _0x34543f['destroy']()[_0xb6a1('0x26')](function(){_0x41405e[_0xb6a1('0x1e')](0xcc)[_0xb6a1('0x1f')]();});}};}function handleEntityNotFound(_0x10ced6,_0x4ad7de){return function(_0x168712){if(!_0x168712){_0x10ced6['sendStatus'](0x194);}return _0x168712;};}function handleError(_0x462e18,_0x49e71b){_0x49e71b=_0x49e71b||0x1f4;return function(_0xf220db){logger[_0xb6a1('0x27')](_0xf220db['stack']);if(_0xf220db[_0xb6a1('0x28')]){delete _0xf220db['name'];}_0x462e18[_0xb6a1('0x1e')](_0x49e71b)[_0xb6a1('0x29')](_0xf220db);};}exports[_0xb6a1('0x2a')]=function(_0x493b04,_0x527ebe){var _0x7aef6d={},_0x57a3d5={},_0x2f219b={'count':0x0,'rows':[]};var _0x30faba=db['OpenchannelInteraction'][_0xb6a1('0x2b')];_0x57a3d5[_0xb6a1('0x2c')]=_[_0xb6a1('0x2d')](_0x30faba);_0x57a3d5[_0xb6a1('0x2e')]=_['keys'](_0x493b04[_0xb6a1('0x2e')]);_0x57a3d5[_0xb6a1('0x2f')]=_[_0xb6a1('0x30')](_0x57a3d5[_0xb6a1('0x2c')],_0x57a3d5[_0xb6a1('0x2e')]);_0x7aef6d[_0xb6a1('0x31')]=_['intersection'](_0x57a3d5[_0xb6a1('0x2c')],qs[_0xb6a1('0x32')](_0x493b04['query'][_0xb6a1('0x32')]));_0x7aef6d[_0xb6a1('0x31')]=_0x7aef6d['attributes'][_0xb6a1('0x33')]?_0x7aef6d[_0xb6a1('0x31')]:_0x57a3d5[_0xb6a1('0x2c')];if(!_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x34')](_0xb6a1('0x35'))){_0x7aef6d[_0xb6a1('0x36')]=qs[_0xb6a1('0x36')](_0x493b04['query'][_0xb6a1('0x36')]);_0x7aef6d[_0xb6a1('0x37')]=qs[_0xb6a1('0x37')](_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x37')]);}_0x7aef6d[_0xb6a1('0x38')]=qs[_0xb6a1('0x39')](_0x493b04['query'][_0xb6a1('0x39')]);_0x7aef6d[_0xb6a1('0x3a')]=qs['filters'](_[_0xb6a1('0x3b')](_0x493b04[_0xb6a1('0x2e')],_0x57a3d5[_0xb6a1('0x2f')]));var _0x34f7d6=[];var _0x4bfa2a=squel[_0xb6a1('0x3c')]()[_0xb6a1('0x3d')]('id')['field']('name')[_0xb6a1('0x3d')]('color')['from']('tools_tags');var _0x5ecfec=squel[_0xb6a1('0x3c')]()[_0xb6a1('0x3d')](_0xb6a1('0x3e'))[_0xb6a1('0x3f')](_0xb6a1('0x40'),'me')[_0xb6a1('0x3a')](_0xb6a1('0x41'))[_0xb6a1('0x3a')](_0xb6a1('0x42'))[_0xb6a1('0x3a')](_0xb6a1('0x43'));var _0x558fab=squel[_0xb6a1('0x3c')]()[_0xb6a1('0x3d')](_0xb6a1('0x44'))[_0xb6a1('0x3d')]('ui.OpenchannelInteractionId')['from'](_0xb6a1('0x45'),'ui')[_0xb6a1('0x46')]('users','u',_0xb6a1('0x47'));var _0x1ceb49=squel['select']()['from']('openchannel_interactions','i')[_0xb6a1('0x46')](_0xb6a1('0x45'),'ui',_0xb6a1('0x48'))[_0xb6a1('0x46')](_0xb6a1('0x49'),'u','u.id\x20=\x20ui.UserId')[_0xb6a1('0x46')](_0xb6a1('0x4a'),'c',_0xb6a1('0x4b'))['left_join'](_0xb6a1('0x49'),'o',_0xb6a1('0x4c'))[_0xb6a1('0x46')]('openchannel_accounts','a',_0xb6a1('0x4d'))[_0xb6a1('0x46')](_0xb6a1('0x40'),'me',_0xb6a1('0x41'));var _0x26c641=squel[_0xb6a1('0x4e')]();if(_0x493b04['query'][_0xb6a1('0x4f')]){var _0x25a36e=JSON[_0xb6a1('0x50')](_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x4f')]);_['keys'](_0x25a36e)[_0xb6a1('0x51')](function(_0x21252b){var _0x7d24b=_0x25a36e[_0x21252b];if(_0x21252b===_0xb6a1('0x52')){var _0x36742b=moment(_0x7d24b['value'][_0xb6a1('0x53')])[_0xb6a1('0x54')](_0xb6a1('0x55'))[_0xb6a1('0x56')]()[_0xb6a1('0x57')]();var _0x762d0a=moment(_0x762d0a)[_0xb6a1('0x56')]()[_0xb6a1('0x58')]('day')[_0xb6a1('0x57')]();_0x26c641[_0xb6a1('0x59')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x36742b,_0x762d0a);}else{if(_[_0xb6a1('0x5a')](_0x7d24b[_0xb6a1('0x5b')])){_0x7d24b[_0xb6a1('0x5b')][_0xb6a1('0x51')](function(_0x42f13b){switch(_0x7d24b[_0xb6a1('0x5b')][_0xb6a1('0x5c')]){case'IS':if(_0x21252b!==_0xb6a1('0x5d')&&_0x21252b!=='Messages.count'){if(_[_0xb6a1('0x5a')](_0x7d24b['value'])&&_0x7d24b['value'][_0xb6a1('0x33')]>0x1){_0x26c641[_0xb6a1('0x59')](_0x7d24b['tableAlias']+'.'+_0x21252b+_0xb6a1('0x5e'),_0x7d24b['value']);}else{_0x26c641[_0xb6a1('0x59')](_0x7d24b['tableAlias']+'.'+_0x21252b+_0xb6a1('0x5f'),_0x7d24b[_0xb6a1('0x5c')][0x0]);}}break;case'=':_0x26c641[_0xb6a1('0x59')](_0x7d24b[_0xb6a1('0x60')]+'.'+_0x21252b+_0xb6a1('0x5f'),_0x7d24b['value']);break;case'LIKE':if(_0x21252b===_0xb6a1('0x61')){_0x26c641[_0xb6a1('0x59')](_0xb6a1('0x62')+'\x20LIKE\x20?','%'+_0x7d24b['value']+'%');_0x26c641['or'](_0xb6a1('0x63')+_0xb6a1('0x64'),'%'+_0x7d24b[_0xb6a1('0x5c')]+'%');_0x26c641['or'](_0xb6a1('0x65')+_0xb6a1('0x64'),'%'+_0x7d24b[_0xb6a1('0x5c')]+'%');}else{_0x26c641[_0xb6a1('0x59')](_0x7d24b['tableAlias']+'.'+_0x21252b+_0xb6a1('0x64'),'%'+_0x7d24b[_0xb6a1('0x5c')]+'%');}break;case'>':_0x26c641[_0xb6a1('0x59')](_0x7d24b['tableAlias']+'.'+_0x21252b+_0xb6a1('0x66'),_0x7d24b[_0xb6a1('0x5c')]);break;case'<':_0x26c641['and'](_0x7d24b[_0xb6a1('0x60')]+'.'+_0x21252b+_0xb6a1('0x67'),_0x7d24b[_0xb6a1('0x5c')]);break;}});}else{switch(_0x7d24b[_0xb6a1('0x5b')][_0xb6a1('0x5c')]){case'IS':if(_0x21252b!==_0xb6a1('0x5d')&&_0x21252b!==_0xb6a1('0x68')){if(_['isArray'](_0x7d24b[_0xb6a1('0x5c')])&&_0x7d24b[_0xb6a1('0x5c')]['length']>0x1){_0x26c641['and'](_0x7d24b[_0xb6a1('0x60')]+'.'+_0x21252b+_0xb6a1('0x5e'),_0x7d24b['value']);}else{_0x26c641['and'](_0x7d24b[_0xb6a1('0x60')]+'.'+_0x21252b+_0xb6a1('0x5f'),_0x7d24b[_0xb6a1('0x5c')][0x0]);}}break;case'=':_0x26c641[_0xb6a1('0x59')](_0x7d24b['tableAlias']+'.'+_0x21252b+_0xb6a1('0x5f'),_0x7d24b[_0xb6a1('0x5c')]);break;case'LIKE':if(_0x21252b==='ContactId'){_0x26c641[_0xb6a1('0x59')](_0xb6a1('0x62')+_0xb6a1('0x64'),'%'+_0x7d24b[_0xb6a1('0x5c')]+'%');_0x26c641['or'](_0xb6a1('0x63')+_0xb6a1('0x64'),'%'+_0x7d24b['value']+'%');_0x26c641['or'](_0xb6a1('0x65')+_0xb6a1('0x64'),'%'+_0x7d24b[_0xb6a1('0x5c')]+'%');}else{_0x26c641[_0xb6a1('0x59')](_0x7d24b[_0xb6a1('0x60')]+'.'+_0x21252b+'\x20LIKE\x20?','%'+_0x7d24b['value']+'%');}break;case'>':_0x26c641[_0xb6a1('0x59')](_0x7d24b[_0xb6a1('0x60')]+'.'+_0x21252b+'\x20>\x20?',_0x7d24b[_0xb6a1('0x5c')]);break;case'<':_0x26c641[_0xb6a1('0x59')](_0x7d24b[_0xb6a1('0x60')]+'.'+_0x21252b+_0xb6a1('0x67'),_0x7d24b['value']);break;}}}});}else{var _0x43d1c7=_(Object[_0xb6a1('0x2d')](_0x493b04[_0xb6a1('0x2e')]))[_0xb6a1('0x69')](function(_0x291b65){return _0x30faba[_0xb6a1('0x34')](_0x291b65)?_0x291b65:undefined;})['filter'](function(_0xb565ee){return!_[_0xb6a1('0x6a')](_0xb565ee);})['value']();if(!_[_0xb6a1('0x6b')](_0x43d1c7)){_0x43d1c7[_0xb6a1('0x51')](function(_0x438746){if(_0x438746===_0xb6a1('0x6c')){_0x1ceb49[_0xb6a1('0x3a')](_0xb6a1('0x6d'),[][_0xb6a1('0x6e')](_0x493b04[_0xb6a1('0x2e')][_0x438746]));}else if(_0x438746===_0xb6a1('0x52')){var _0x29510f=JSON[_0xb6a1('0x50')](_0x493b04[_0xb6a1('0x2e')][_0x438746])[_0xb6a1('0x6f')];var _0x2db811=JSON[_0xb6a1('0x50')](_0x493b04[_0xb6a1('0x2e')][_0x438746])[_0xb6a1('0x70')];_0x1ceb49[_0xb6a1('0x3a')](_0xb6a1('0x71'),_0x29510f,_0x2db811);}else{_0x1ceb49[_0xb6a1('0x3a')]('i.'+_0x438746+_0xb6a1('0x5f'),_0x493b04[_0xb6a1('0x2e')][_0x438746]);}});}if(_0x493b04['query'][_0xb6a1('0x72')]){var _0x5b9b51=_0x493b04[_0xb6a1('0x2e')]['filter'][_0xb6a1('0x73')]('\x5c','\x5c\x5c')[_0xb6a1('0x73')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xb6a1('0x74')](_0x5b9b51)){_0x26c641['or'](_0xb6a1('0x75'),_0x5b9b51+'%');}else{var _0x47b3fe=[];_0x5b9b51[_0xb6a1('0x76')]('\x20')[_0xb6a1('0x51')](function(_0x470c76){_0x47b3fe['push']('+'+_0x470c76[_0xb6a1('0x77')]());});var _0x34541f=_0x47b3fe[_0xb6a1('0x78')]('\x20');_0x26c641['or'](_0xb6a1('0x79'),_0x34541f)['or'](_0xb6a1('0x7a'),_0x5b9b51+'%')['or'](_0xb6a1('0x7b'),_0x5b9b51+'%');}}}_0x1ceb49[_0xb6a1('0x3a')](_0x26c641);if(_0x7aef6d['order']){_0x7aef6d[_0xb6a1('0x38')]['forEach'](function(_0x2209a9){_0x1ceb49['order']('i.'+_0x2209a9[0x0],_0x2209a9[0x1]==='DESC'?![]:!![]);});}_0x1ceb49[_0xb6a1('0x7c')](_0xb6a1('0x7d'));var _0x489213={'type':db[_0xb6a1('0x7e')][_0xb6a1('0x7f')][_0xb6a1('0x80')],'raw':!![]};var _0x49aae1=_0x1ceb49[_0xb6a1('0x81')]()[_0xb6a1('0x3d')]('COUNT(*)');if(!_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x4f')]){if(_0x493b04['query']['read']){if(_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x82')]==0x1){_0x49aae1[_0xb6a1('0x3a')](util[_0xb6a1('0x57')](_0xb6a1('0x83'),_0x5ecfec['toString']()));_0x1ceb49[_0xb6a1('0x84')](_0xb6a1('0x85'));}else{_0x49aae1['where'](util[_0xb6a1('0x57')](_0xb6a1('0x86'),_0x5ecfec[_0xb6a1('0x77')]()));_0x1ceb49['having'](_0xb6a1('0x87'));}}if(_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x88')]){var _0x5a6475=_['isArray'](_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x88')])?_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x88')]:new Array(_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x88')]);var _0x264457=squel[_0xb6a1('0x4e')]();_0x5a6475['forEach'](function(_0x31dfbb){_0x264457['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x31dfbb+',%');});_0x1ceb49[_0xb6a1('0x84')](_0x264457);_0x49aae1['left_join'](_0xb6a1('0x89'),'it',_0xb6a1('0x8a'));_0x49aae1[_0xb6a1('0x46')](_0xb6a1('0x8b'),'t',_0xb6a1('0x8c'));_0x49aae1[_0xb6a1('0x3a')](_0xb6a1('0x8d'),_0x5a6475);}}else{var _0x25a36e=JSON[_0xb6a1('0x50')](_0x493b04[_0xb6a1('0x2e')][_0xb6a1('0x4f')]);_[_0xb6a1('0x2d')](_0x25a36e)[_0xb6a1('0x51')](function(_0x4dd615){var _0x48c01b=_0x25a36e[_0x4dd615];if(_0x4dd615===_0xb6a1('0x5d')){var _0x232baa=_0x48c01b[_0xb6a1('0x5c')];var _0x2d6ff5=squel['expr']();_0x232baa[_0xb6a1('0x51')](function(_0x1c1d76){_0x2d6ff5['or'](_0xb6a1('0x8e'),'%,'+_0x1c1d76+',%');});_0x1ceb49[_0xb6a1('0x84')](_0x2d6ff5);_0x49aae1['left_join']('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id');_0x49aae1[_0xb6a1('0x46')](_0xb6a1('0x8b'),'t',_0xb6a1('0x8c'));_0x49aae1[_0xb6a1('0x3a')](_0xb6a1('0x8d'),_0x232baa);}else if(_0x4dd615===_0xb6a1('0x68')){if(_0x48c01b[_0xb6a1('0x5c')][_0xb6a1('0x33')]===0x1){if(_0x48c01b['value'][0x0]===0x1){_0x49aae1[_0xb6a1('0x3a')](util['format'](_0xb6a1('0x83'),_0x5ecfec[_0xb6a1('0x77')]()));_0x1ceb49[_0xb6a1('0x84')](_0xb6a1('0x85'));}else{_0x49aae1[_0xb6a1('0x3a')](util['format'](_0xb6a1('0x86'),_0x5ecfec[_0xb6a1('0x77')]()));_0x1ceb49['having']('`Messages.count`\x20>\x200');}}}});}db[_0xb6a1('0x8f')][_0xb6a1('0x2e')](_0x49aae1[_0xb6a1('0x77')](),_0x489213)[_0xb6a1('0x26')](function(_0x30e2ac){_0x2f219b[_0xb6a1('0x90')]=_0x30e2ac[_0xb6a1('0x33')];if(_0x2f219b[_0xb6a1('0x90')]===0x0)return[];return db[_0xb6a1('0x8f')][_0xb6a1('0x2e')](_0x4bfa2a[_0xb6a1('0x77')](),_0x489213)[_0xb6a1('0x26')](function(_0x334bde){_0x34f7d6=_[_0xb6a1('0x91')](_0x334bde,'id');_0x489213=_[_0xb6a1('0x92')](_0x489213,{'model':db[_0xb6a1('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x1ceb49['field'](_0x5ecfec,_0xb6a1('0x68'));_0x1ceb49[_0xb6a1('0x3d')]('a.key',_0xb6a1('0x94'));_0x1ceb49[_0xb6a1('0x3d')](_0xb6a1('0x95'));_0x1ceb49[_0xb6a1('0x3d')](_0xb6a1('0x62'),'Contact.firstName');_0x1ceb49['field'](_0xb6a1('0x63'),'Contact.lastName');_0x1ceb49['field'](_0xb6a1('0x65'),_0xb6a1('0x96'));_0x1ceb49[_0xb6a1('0x3d')]('c.phone','Contact.phone');_0x1ceb49[_0xb6a1('0x3d')](_0xb6a1('0x97'),'Contact.mobile');_0x1ceb49[_0xb6a1('0x3d')](_0xb6a1('0x98'),_0xb6a1('0x99'));_0x1ceb49[_0xb6a1('0x3d')](_0xb6a1('0x9a'),'User.name');_0x1ceb49[_0xb6a1('0x3d')](_0xb6a1('0x9b'),_0xb6a1('0x9c'));_0x1ceb49[_0xb6a1('0x46')]('openchannel_interaction_has_tags','it',_0xb6a1('0x8a'));_0x1ceb49['left_join'](_0xb6a1('0x8b'),'t',_0xb6a1('0x8c'));_0x1ceb49['limit'](_0x7aef6d[_0xb6a1('0x36')]);_0x1ceb49[_0xb6a1('0x37')](_0x7aef6d[_0xb6a1('0x37')]);return db[_0xb6a1('0x8f')][_0xb6a1('0x2e')](_0x1ceb49['toString'](),_0x489213);})['then'](function(_0x356c2b){_0x558fab['where'](_0xb6a1('0x9d'),_['map'](_0x356c2b,'id'));return db['sequelize'][_0xb6a1('0x2e')](_0x558fab[_0xb6a1('0x77')](),_0x489213)[_0xb6a1('0x26')](function(_0x5883ea){var _0x3e4e9c=_[_0xb6a1('0x9e')](_0x5883ea,_0xb6a1('0x9f'));_0x356c2b[_0xb6a1('0x51')](function(_0x5a91bf){if(_0x3e4e9c[_0x5a91bf['id']]){_0x5a91bf[_0xb6a1('0xa0')]=_[_0xb6a1('0x69')](_0x3e4e9c[_0x5a91bf['id']],function(_0x50671e){return{'id':_0x50671e['id']};});}if(_0x5a91bf['TagIds']){_0x5a91bf[_0xb6a1('0xa1')]=[];_0x5a91bf[_0xb6a1('0x9c')][_0xb6a1('0x76')](',')[_0xb6a1('0x51')](function(_0x5e2233){_0x5a91bf[_0xb6a1('0xa1')][_0xb6a1('0xa2')](_0x34f7d6[_0x5e2233]);});}delete _0x5a91bf[_0xb6a1('0x9c')];});return _0x356c2b;});});})[_0xb6a1('0x26')](function(_0x523c15){_0x2f219b[_0xb6a1('0xa3')]=_0x523c15;return _0x2f219b;})[_0xb6a1('0x26')](respondWithFilteredResult(_0x527ebe,_0x7aef6d))['catch'](handleError(_0x527ebe,null));};exports[_0xb6a1('0xa4')]=function(_0x4721a3,_0x5d169b){var _0x36a762={'raw':![],'where':{'id':_0x4721a3[_0xb6a1('0xa5')]['id']}},_0x836a34={};_0x836a34['model']=_['keys'](db[_0xb6a1('0x93')][_0xb6a1('0x2b')]);_0x836a34['query']=_[_0xb6a1('0x2d')](_0x4721a3[_0xb6a1('0x2e')]);_0x836a34[_0xb6a1('0x2f')]=_[_0xb6a1('0x30')](_0x836a34['model'],_0x836a34[_0xb6a1('0x2e')]);_0x36a762['attributes']=_[_0xb6a1('0x30')](_0x836a34[_0xb6a1('0x2c')],qs[_0xb6a1('0x32')](_0x4721a3[_0xb6a1('0x2e')][_0xb6a1('0x32')]));_0x36a762[_0xb6a1('0x31')]=_0x36a762['attributes'][_0xb6a1('0x33')]?_0x36a762[_0xb6a1('0x31')]:_0x836a34[_0xb6a1('0x2c')];if(_0x4721a3[_0xb6a1('0x2e')][_0xb6a1('0xa6')]){_0x36a762[_0xb6a1('0xa7')]=[{'all':!![]}];}_0x36a762=_[_0xb6a1('0x92')]({},_0x36a762,_0x4721a3[_0xb6a1('0xa8')]);return db[_0xb6a1('0x93')][_0xb6a1('0xa9')](_0x36a762)[_0xb6a1('0x26')](handleEntityNotFound(_0x5d169b,null))[_0xb6a1('0x26')](respondWithResult(_0x5d169b,null))['catch'](handleError(_0x5d169b,null));};exports[_0xb6a1('0xaa')]=function(_0x45906d,_0xd9690a){return db[_0xb6a1('0x93')][_0xb6a1('0xaa')](_0x45906d[_0xb6a1('0xab')],{})[_0xb6a1('0x26')](respondWithResult(_0xd9690a,0xc9))['catch'](handleError(_0xd9690a,null));};exports[_0xb6a1('0x25')]=function(_0x48aad4,_0x2b7da9){if(_0x48aad4[_0xb6a1('0xab')]['id']){delete _0x48aad4[_0xb6a1('0xab')]['id'];}return db[_0xb6a1('0x93')][_0xb6a1('0xa9')]({'where':{'id':_0x48aad4[_0xb6a1('0xa5')]['id']}})['then'](handleEntityNotFound(_0x2b7da9,null))[_0xb6a1('0x26')](saveUpdates(_0x48aad4['body'],null))[_0xb6a1('0x26')](respondWithResult(_0x2b7da9,null))[_0xb6a1('0xac')](handleError(_0x2b7da9,null));};exports[_0xb6a1('0xad')]=function(_0x259728,_0x46c8c3){return db[_0xb6a1('0x93')][_0xb6a1('0xa9')]({'where':{'id':_0x259728['params']['id']}})[_0xb6a1('0x26')](handleEntityNotFound(_0x46c8c3,null))[_0xb6a1('0x26')](removeEntity(_0x46c8c3,null))[_0xb6a1('0xac')](handleError(_0x46c8c3,null));};exports[_0xb6a1('0xae')]=function(_0x3070cf,_0x3405d5){return db[_0xb6a1('0x93')][_0xb6a1('0xae')]()[_0xb6a1('0x26')](respondWithResult(_0x3405d5,null))[_0xb6a1('0xac')](handleError(_0x3405d5,null));};exports[_0xb6a1('0xaf')]=function(_0x3c901a,_0x29477f,_0x1ca9af){return db[_0xb6a1('0xb0')][_0xb6a1('0xa9')]({'where':{'id':_0x3c901a[_0xb6a1('0xa5')]['id']}})[_0xb6a1('0x26')](handleEntityNotFound(_0x29477f,null))['then'](function(_0x34d835){if(_0x34d835){return _0x34d835['addMessage'](_0x3c901a[_0xb6a1('0xab')][_0xb6a1('0xb1')],_[_0xb6a1('0xb2')](_0x3c901a[_0xb6a1('0xab')],['ids','id'])||{});}})[_0xb6a1('0x26')](respondWithResult(_0x29477f,null))[_0xb6a1('0xac')](handleError(_0x29477f,null));};exports[_0xb6a1('0xb3')]=function(_0x461a60,_0x39aa9a,_0x176670){var _0x31ad0b={'raw':![],'where':{}};var _0x164025={};var _0x2e8269={'count':0x0,'rows':[]};return db[_0xb6a1('0x93')][_0xb6a1('0xb4')]({'where':{'id':_0x461a60[_0xb6a1('0xa5')]['id']}})['then'](handleEntityNotFound(_0x39aa9a,null))[_0xb6a1('0x26')](function(_0x56fa7a){if(_0x56fa7a){_0x164025[_0xb6a1('0x2c')]=_[_0xb6a1('0x2d')](db[_0xb6a1('0xb0')][_0xb6a1('0x2b')]);_0x164025[_0xb6a1('0x2e')]=_[_0xb6a1('0x2d')](_0x461a60[_0xb6a1('0x2e')]);_0x164025[_0xb6a1('0x2f')]=_['intersection'](_0x164025[_0xb6a1('0x2c')],_0x164025[_0xb6a1('0x2e')]);_0x31ad0b[_0xb6a1('0x31')]=_['intersection'](_0x164025[_0xb6a1('0x2c')],qs['fields'](_0x461a60[_0xb6a1('0x2e')]['fields']));_0x31ad0b[_0xb6a1('0x31')]=_0x31ad0b[_0xb6a1('0x31')][_0xb6a1('0x33')]?_0x31ad0b[_0xb6a1('0x31')]:_0x164025[_0xb6a1('0x2c')];if(!_0x461a60[_0xb6a1('0x2e')][_0xb6a1('0x34')](_0xb6a1('0x35'))){_0x31ad0b[_0xb6a1('0x36')]=qs[_0xb6a1('0x36')](_0x461a60['query']['limit']);_0x31ad0b[_0xb6a1('0x37')]=qs['offset'](_0x461a60['query'][_0xb6a1('0x37')]);}_0x31ad0b[_0xb6a1('0x38')]=qs['sort'](_0x461a60[_0xb6a1('0x2e')][_0xb6a1('0x39')]);_0x31ad0b[_0xb6a1('0x3a')]=qs[_0xb6a1('0x2f')](_[_0xb6a1('0x3b')](_0x461a60[_0xb6a1('0x2e')],_0x164025['filters']));_0x31ad0b[_0xb6a1('0x3a')][_0xb6a1('0x9f')]=_0x56fa7a['id'];if(_0x461a60[_0xb6a1('0x2e')][_0xb6a1('0x72')]){_0x31ad0b[_0xb6a1('0x3a')]=_[_0xb6a1('0x92')](_0x31ad0b[_0xb6a1('0x3a')],{'$or':_[_0xb6a1('0x69')](_0x31ad0b[_0xb6a1('0x31')],function(_0x3a09f9){var _0x48d7b0={};_0x48d7b0[_0x3a09f9]={'$like':'%'+_0x461a60[_0xb6a1('0x2e')][_0xb6a1('0x72')]+'%'};return _0x48d7b0;})});}if(_0x461a60['query'][_0xb6a1('0x6f')]){var _0x373c6a=_0x461a60[_0xb6a1('0x2e')][_0xb6a1('0x6f')][_0xb6a1('0x76')](',');var _0xbeccaa={};_0xbeccaa[_0x373c6a[0x0]]={'$gte':moment(_0x373c6a[0x1])[_0xb6a1('0x57')](_0xb6a1('0xb5'))};_0x31ad0b[_0xb6a1('0x3a')]=_['merge'](_0x31ad0b[_0xb6a1('0x3a')],_0xbeccaa);}_0x31ad0b=_[_0xb6a1('0x92')]({},_0x31ad0b,_0x461a60['options']);return db[_0xb6a1('0xb0')][_0xb6a1('0x90')]({'where':_0x31ad0b[_0xb6a1('0x3a')]})[_0xb6a1('0x26')](function(_0x326983){_0x2e8269[_0xb6a1('0x90')]=_0x326983;if(_0x461a60[_0xb6a1('0x2e')]['includeAll']){_0x31ad0b[_0xb6a1('0xa7')]=[{'all':!![]}];}return db[_0xb6a1('0xb0')][_0xb6a1('0xb6')](_0x31ad0b);})[_0xb6a1('0x26')](function(_0x2ccee7){_0x2e8269[_0xb6a1('0xa3')]=_0x2ccee7;return _0x2e8269;});}})[_0xb6a1('0x26')](respondWithFilteredResult(_0x39aa9a,_0x31ad0b))['catch'](handleError(_0x39aa9a,null));};exports['addTags']=function(_0x2300dc,_0x157704,_0x57b700){return db[_0xb6a1('0x93')][_0xb6a1('0xa9')]({'where':{'id':_0x2300dc[_0xb6a1('0xa5')]['id']}})[_0xb6a1('0x26')](handleEntityNotFound(_0x157704,null))[_0xb6a1('0x26')](function(_0x273c29){if(_0x273c29){return _0x273c29[_0xb6a1('0xb7')](_0x2300dc[_0xb6a1('0xab')]['ids'],_[_0xb6a1('0xb2')](_0x2300dc['body'],[_0xb6a1('0xb1'),'id'])||{})[_0xb6a1('0xb8')](function(){return db['Tag'][_0xb6a1('0xb6')]({'attributes':['id','name',_0xb6a1('0xb9')],'where':{'id':_0x2300dc[_0xb6a1('0xab')]['ids']}});})[_0xb6a1('0x26')](function(_0x390491){socket[_0xb6a1('0xba')](_0xb6a1('0xbb'),{'id':Number(_0x2300dc['params']['id']),'tags':_0x390491||[]});return{'id':Number(_0x2300dc[_0xb6a1('0xa5')]['id']),'tags':_0x390491||[]};});}})[_0xb6a1('0x26')](respondWithResult(_0x157704,null))['catch'](handleError(_0x157704,null));};exports[_0xb6a1('0xbc')]=function(_0x3fcef1,_0x24b317,_0x527f5d){return db[_0xb6a1('0x93')][_0xb6a1('0xa9')]({'where':{'id':_0x3fcef1[_0xb6a1('0xa5')]['id']}})[_0xb6a1('0x26')](handleEntityNotFound(_0x24b317,null))[_0xb6a1('0x26')](function(_0x1f3c7f){if(_0x1f3c7f){return _0x1f3c7f[_0xb6a1('0xbc')](_0x3fcef1['query'][_0xb6a1('0xb1')]);}})[_0xb6a1('0x26')](respondWithStatusCode(_0x24b317,null))['catch'](handleError(_0x24b317,null));};exports['download']=function(_0x580b9d,_0x6981c9){var _0x430fef=moment()[_0xb6a1('0xbd')]()[_0xb6a1('0x77')]();var _0x1ca55f=path[_0xb6a1('0x78')](config[_0xb6a1('0xbe')],'server','files',_0xb6a1('0xbf'));var _0x43e2af=path[_0xb6a1('0x78')](config['root'],_0xb6a1('0xc0'),_0xb6a1('0xc1'),_0xb6a1('0xc2'));var _0x16ec5f=path[_0xb6a1('0x78')](_0x1ca55f,_0x430fef);var _0x314a03=util[_0xb6a1('0x57')](_0xb6a1('0xc3'),_0x580b9d[_0xb6a1('0xa5')]['id'],_0x430fef);var _0x12b88b=path[_0xb6a1('0x78')](_0x1ca55f,_0x314a03);var _0x4ed392=![];return db['OpenchannelInteraction'][_0xb6a1('0xa9')]({'where':{'id':_0x580b9d['params']['id']},'include':[{'model':db[_0xb6a1('0xb0')],'as':_0xb6a1('0xc4'),'attributes':['id',_0xb6a1('0xab'),'createdAt','direction',_0xb6a1('0xc5')],'include':[{'model':db['User'],'as':'User','attributes':['id',_0xb6a1('0xc6')],'raw':!![]},{'model':db['CmContact'],'as':_0xb6a1('0xc7'),'attributes':['id',_0xb6a1('0xc8'),'lastName'],'raw':!![]},{'model':db[_0xb6a1('0xc9')],'as':_0xb6a1('0xc9'),'raw':!![]}]},{'model':db[_0xb6a1('0xca')],'as':_0xb6a1('0xcb'),'attributes':['id','name']},{'model':db[_0xb6a1('0xcc')],'as':'Owner','attributes':['id',_0xb6a1('0xc6')]}]})[_0xb6a1('0x26')](handleEntityNotFound(_0x6981c9,null))[_0xb6a1('0x26')](function(_0x95372e){if(_0x95372e){var _0x544ddf=_0x95372e[_0xb6a1('0xcd')]({'plain':!![]});_0x4ed392=!![];var _0x28c1de={'format':'A4','border':_0xb6a1('0xce'),'header':{'height':_0xb6a1('0xcf'),'contents':{'first':_0xb6a1('0xd0')}},'footer':{'height':'30px','contents':{'default':util['format'](_0xb6a1('0xd1'),util[_0xb6a1('0x57')]('%s\x20#%d',_0xb6a1('0xd2'),_0x544ddf['id']),moment()[_0xb6a1('0x57')](_0xb6a1('0xd3'))[_0xb6a1('0x77')]())}}};fs['mkdirSync'](_0x16ec5f);var _0x1488d4={'channel':_0xb6a1('0xd2'),'account':_0x544ddf['Account'][_0xb6a1('0x28')],'agent':_0x544ddf[_0xb6a1('0xd4')]?_0x544ddf[_0xb6a1('0xd4')][_0xb6a1('0xc6')]:_0xb6a1('0xd5'),'createdAt':moment(_0x544ddf[_0xb6a1('0x52')])[_0xb6a1('0x57')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb6a1('0x77')](),'closedAt':_0x544ddf[_0xb6a1('0xd6')]?moment(_0x544ddf[_0xb6a1('0xd7')])[_0xb6a1('0x57')](_0xb6a1('0xb5'))[_0xb6a1('0x77')]():'','disposition':_0x544ddf[_0xb6a1('0xd8')],'visibility':_0x544ddf[_0xb6a1('0xd9')]?'Public':_0xb6a1('0xda'),'messages':_(_0x544ddf['Messages'])['filter']({'secret':![]})[_0xb6a1('0x69')](function(_0x39486e){if(_0x39486e[_0xb6a1('0xc9')]){var _0x1c0f90=path['join'](_0x43e2af,_0x39486e['Attachment']['basename']);if(fs[_0xb6a1('0xdb')](_0x1c0f90)){fs[_0xb6a1('0xdc')](_0x1c0f90)[_0xb6a1('0xdd')](fs['createWriteStream'](path[_0xb6a1('0x78')](_0x16ec5f,_0x39486e[_0xb6a1('0xc9')][_0xb6a1('0xde')])));}}return{'date':moment(_0x39486e[_0xb6a1('0x52')])[_0xb6a1('0x57')](_0xb6a1('0xb5'))[_0xb6a1('0x77')](),'sender':_0x39486e[_0xb6a1('0xdf')]===_0xb6a1('0xe0')?_0x39486e[_0xb6a1('0xcc')]?_0x39486e[_0xb6a1('0xcc')]['fullname']:_0xb6a1('0xe1'):_0x39486e[_0xb6a1('0xc7')][_0xb6a1('0xc8')]+(_0x39486e[_0xb6a1('0xc7')][_0xb6a1('0xe2')]?'\x20'+_0x39486e[_0xb6a1('0xc7')][_0xb6a1('0xe2')]:''),'body':_0x39486e[_0xb6a1('0xc9')]?_0x39486e[_0xb6a1('0xc9')]['basename']:_0x39486e['body'],'direction':_0x39486e[_0xb6a1('0xdf')]===_0xb6a1('0xe0')?'A':'C','secret':_0x39486e['secret'],'attachment':_0x39486e[_0xb6a1('0xc9')]};})[_0xb6a1('0x5c')]()};return ejs[_0xb6a1('0xe3')](path[_0xb6a1('0x78')](config['root'],'server',_0xb6a1('0xe4'),_0xb6a1('0xe5')),{'interaction':_0x1488d4})[_0xb6a1('0x26')](function(_0x4948d4){return new BPromise(function(_0x3ebbf7,_0x24fee1){pdf[_0xb6a1('0xaa')](_0x4948d4,_0x28c1de)[_0xb6a1('0xe6')](path[_0xb6a1('0x78')](_0x16ec5f,'transcript-'+_0x544ddf['id']+'-'+_0x430fef+_0xb6a1('0xe7')),function(_0x51c9ba,_0x4e30b8){if(_0x51c9ba)return _0x24fee1(_0x51c9ba);_0x3ebbf7(_0x4e30b8);});});});}})[_0xb6a1('0x26')](function(){if(_0x4ed392){return new BPromise(function(_0x15719d,_0x40cbae){zipdir(_0x16ec5f,{'saveTo':_0x12b88b},function(_0x5ec86a,_0x16d578){if(_0x5ec86a)return _0x40cbae(_0x5ec86a);return _0x15719d(_0x16d578);});})['then'](function(){return new BPromise(function(_0x4dcaeb,_0x2c81cb){rimraf(_0x16ec5f,function(_0x148df2){if(_0x148df2)_0x2c81cb(_0x148df2);return _0x4dcaeb();});});})[_0xb6a1('0x26')](function(){return _0x6981c9[_0xb6a1('0xe8')](_0x12b88b,_0x314a03,function(_0x2c653e){if(_0x2c653e){console['log']('err',_0x2c653e);}else{fs[_0xb6a1('0xe9')](_0x12b88b);}});});}else{return _0x6981c9[_0xb6a1('0x1d')](0xc8);}})[_0xb6a1('0xac')](handleError(_0x6981c9,null));}; \ No newline at end of file +var _0xfbde=['c.lastName','c.email','\x20>\x20?','\x20<\x20?','Messages.count','map','hasOwnProperty','filter','isNil','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','split','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','COUNT(*)','%s\x20=\x200','having','`Messages.count`\x20=\x200','`Messages.count`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','%s\x20>\x200','sequelize','keyBy','merge','a.key','i.*','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','u.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','openchannel_interaction_has_tags','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','Users','Tags','TagIds','rows','catch','params','includeAll','include','options','create','body','find','describe','addMessage','omit','getMessages','findOne','OpenchannelMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','spread','emit','removeTags','download','root','server','files','tmp','attachments','transcript-%d-%s.zip','Messages','direction','secret','User','CmContact','Contact','firstName','lastName','Attachment','Owner','fullname','get','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','Account','N.A.','closed','closedAt','disposition','threadId','Public','basename','existsSync','pipe','System','out','views','downloadInteraction.html','toFile','.pdf','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','OpenchannelInteraction','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','select','field','color','tools_tags','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','ui.OpenchannelInteractionId','from','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','user_has_openchannel_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','expr','parse','advancedFilter','forEach','createdAt','value','dateStart','startOf','utc','format','day','and','condition','TagId','isArray','tableAlias','\x20IN\x20?','\x20=\x20?','ContactId','c.firstName','\x20LIKE\x20?'];(function(_0x1a9ee9,_0x26d166){var _0x2b618a=function(_0x4a3003){while(--_0x4a3003){_0x1a9ee9['push'](_0x1a9ee9['shift']());}};_0x2b618a(++_0x26d166);}(_0xfbde,0x15d));var _0xefbd=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0xfbde[_0x62c958];return _0x57ec61;};'use strict';var pdf=require(_0xefbd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xefbd('0x1'));var zipdir=require(_0xefbd('0x2'));var jsonpatch=require(_0xefbd('0x3'));var rp=require(_0xefbd('0x4'));var moment=require(_0xefbd('0x5'));var BPromise=require(_0xefbd('0x6'));var Mustache=require(_0xefbd('0x7'));var util=require(_0xefbd('0x8'));var path=require('path');var sox=require(_0xefbd('0x9'));var csv=require('to-csv');var ejs=require(_0xefbd('0xa'));var fs=require('fs');var _=require(_0xefbd('0xb'));var squel=require(_0xefbd('0xc'));var crypto=require(_0xefbd('0xd'));var jsforce=require(_0xefbd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xefbd('0xf'));var querystring=require(_0xefbd('0x10'));var Papa=require(_0xefbd('0x11'));var Redis=require(_0xefbd('0x12'));var authService=require(_0xefbd('0x13'));var qs=require(_0xefbd('0x14'));var hardwareService=require(_0xefbd('0x15'));var logger=require(_0xefbd('0x16'))(_0xefbd('0x17'));var utils=require('../../config/utils');var config=require(_0xefbd('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xefbd('0x19')](config[_0xefbd('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xefbd('0x1b'))(new Redis(config[_0xefbd('0x1a')]));require(_0xefbd('0x1c'))[_0xefbd('0x1d')](socket);function respondWithStatusCode(_0x25a718,_0x3cabd8){_0x3cabd8=_0x3cabd8||0xcc;return function(_0x596c53){if(_0x596c53){return _0x25a718[_0xefbd('0x1e')](_0x3cabd8);}return _0x25a718[_0xefbd('0x1f')](_0x3cabd8)[_0xefbd('0x20')]();};}function respondWithResult(_0x42d3ab,_0x3a1871){_0x3a1871=_0x3a1871||0xc8;return function(_0x2ce3c8){if(_0x2ce3c8){return _0x42d3ab['status'](_0x3a1871)[_0xefbd('0x21')](_0x2ce3c8);}};}function respondWithFilteredResult(_0x47fcb8,_0x9b283){return function(_0x193a5d){if(_0x193a5d){var _0x4caeba=_0x193a5d[_0xefbd('0x22')],_0x4f9e6d=_0x9b283['offset'],_0x52df4d=_0x9b283[_0xefbd('0x23')]+_0x9b283[_0xefbd('0x24')],_0x68b831;if(_0x52df4d>=_0x4caeba){_0x52df4d=_0x4caeba;_0x68b831=0xc8;}else{_0x68b831=0xce;}_0x47fcb8['status'](_0x68b831);return _0x47fcb8[_0xefbd('0x25')](_0xefbd('0x26'),_0x4f9e6d+'-'+_0x52df4d+'/'+_0x4caeba)[_0xefbd('0x21')](_0x193a5d);}return null;};}function patchUpdates(_0x280867){return function(_0x35cda3){try{jsonpatch[_0xefbd('0x27')](_0x35cda3,_0x280867,!![]);}catch(_0x5e2f02){return BPromise[_0xefbd('0x28')](_0x5e2f02);}return _0x35cda3[_0xefbd('0x29')]();};}function saveUpdates(_0x2b0cea,_0x958544){return function(_0x4b2073){if(_0x4b2073){return _0x4b2073[_0xefbd('0x2a')](_0x2b0cea)[_0xefbd('0x2b')](function(_0x5cabf8){return _0x5cabf8;});}return null;};}function removeEntity(_0x22b5ce,_0x418056){return function(_0x440986){if(_0x440986){return _0x440986[_0xefbd('0x2c')]()[_0xefbd('0x2b')](function(){_0x22b5ce[_0xefbd('0x1f')](0xcc)[_0xefbd('0x20')]();});}};}function handleEntityNotFound(_0x2c061a,_0x43923f){return function(_0x4d73d7){if(!_0x4d73d7){_0x2c061a[_0xefbd('0x1e')](0x194);}return _0x4d73d7;};}function handleError(_0x59751c,_0x57dc38){_0x57dc38=_0x57dc38||0x1f4;return function(_0x278ab9){logger[_0xefbd('0x2d')](_0x278ab9[_0xefbd('0x2e')]);if(_0x278ab9[_0xefbd('0x2f')]){delete _0x278ab9[_0xefbd('0x2f')];}_0x59751c[_0xefbd('0x1f')](_0x57dc38)['send'](_0x278ab9);};}exports[_0xefbd('0x30')]=function(_0x19c485,_0x48e20a){var _0x45fb25={},_0x12a5d6={},_0x58c0ac={'count':0x0,'rows':[]};var _0x5c308c=db[_0xefbd('0x31')][_0xefbd('0x32')];_0x12a5d6[_0xefbd('0x33')]=_[_0xefbd('0x34')](_0x5c308c);_0x12a5d6[_0xefbd('0x35')]=_['keys'](_0x19c485[_0xefbd('0x35')]);_0x12a5d6[_0xefbd('0x36')]=_[_0xefbd('0x37')](_0x12a5d6['model'],_0x12a5d6[_0xefbd('0x35')]);_0x45fb25[_0xefbd('0x38')]=_['intersection'](_0x12a5d6[_0xefbd('0x33')],qs[_0xefbd('0x39')](_0x19c485[_0xefbd('0x35')]['fields']));_0x45fb25[_0xefbd('0x38')]=_0x45fb25[_0xefbd('0x38')][_0xefbd('0x3a')]?_0x45fb25[_0xefbd('0x38')]:_0x12a5d6[_0xefbd('0x33')];if(!_0x19c485[_0xefbd('0x35')]['hasOwnProperty'](_0xefbd('0x3b'))){_0x45fb25[_0xefbd('0x24')]=qs[_0xefbd('0x24')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x24')]);_0x45fb25[_0xefbd('0x23')]=qs[_0xefbd('0x23')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x23')]);}_0x45fb25[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x3d')]);_0x45fb25[_0xefbd('0x3e')]=qs[_0xefbd('0x36')](_[_0xefbd('0x3f')](_0x19c485[_0xefbd('0x35')],_0x12a5d6[_0xefbd('0x36')]));var _0x1b77e6=[];var _0x19ddb7=squel[_0xefbd('0x40')]()['field']('id')[_0xefbd('0x41')](_0xefbd('0x2f'))['field'](_0xefbd('0x42'))['from'](_0xefbd('0x43'));var _0x24ce10=squel[_0xefbd('0x40')]()['field']('COUNT(*)')['from'](_0xefbd('0x44'),'me')[_0xefbd('0x3e')](_0xefbd('0x45'))['where'](_0xefbd('0x46'))[_0xefbd('0x3e')]('me.read\x20=\x20false');var _0x532c0a=squel[_0xefbd('0x40')]()[_0xefbd('0x41')]('u.id')['field'](_0xefbd('0x47'))[_0xefbd('0x48')]('user_has_openchannel_interactions','ui')[_0xefbd('0x49')](_0xefbd('0x4a'),'u',_0xefbd('0x4b'));var _0x18626b=squel[_0xefbd('0x40')]()[_0xefbd('0x48')](_0xefbd('0x4c'),'i')[_0xefbd('0x49')](_0xefbd('0x4d'),'ui',_0xefbd('0x4e'))[_0xefbd('0x49')](_0xefbd('0x4a'),'u',_0xefbd('0x4b'))['left_join'](_0xefbd('0x4f'),'c',_0xefbd('0x50'))['left_join'](_0xefbd('0x4a'),'o',_0xefbd('0x51'))[_0xefbd('0x49')](_0xefbd('0x52'),'a',_0xefbd('0x53'))[_0xefbd('0x49')]('openchannel_messages','me',_0xefbd('0x45'));var _0x4b14c3=squel[_0xefbd('0x54')]();if(_0x19c485['query']['advancedFilter']){var _0x2f59e5=JSON[_0xefbd('0x55')](_0x19c485[_0xefbd('0x35')][_0xefbd('0x56')]);_[_0xefbd('0x34')](_0x2f59e5)[_0xefbd('0x57')](function(_0x390a39){var _0x3cc1c0=_0x2f59e5[_0x390a39];if(_0x390a39===_0xefbd('0x58')){var _0x4c8175=moment(_0x3cc1c0[_0xefbd('0x59')][_0xefbd('0x5a')])[_0xefbd('0x5b')]('day')[_0xefbd('0x5c')]()[_0xefbd('0x5d')]();var _0x2baa47=moment(_0x2baa47)[_0xefbd('0x5c')]()['endOf'](_0xefbd('0x5e'))['format']();_0x4b14c3[_0xefbd('0x5f')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4c8175,_0x2baa47);}else{if(_['isArray'](_0x3cc1c0['condition'])){_0x3cc1c0[_0xefbd('0x60')][_0xefbd('0x57')](function(_0x21e0d3){switch(_0x3cc1c0[_0xefbd('0x60')][_0xefbd('0x59')]){case'IS':if(_0x390a39!==_0xefbd('0x61')&&_0x390a39!=='Messages.count'){if(_[_0xefbd('0x62')](_0x3cc1c0[_0xefbd('0x59')])&&_0x3cc1c0[_0xefbd('0x59')][_0xefbd('0x3a')]>0x1){_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x64'),_0x3cc1c0[_0xefbd('0x59')]);}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0['value'][0x0]);}}break;case'=':_0x4b14c3['and'](_0x3cc1c0['tableAlias']+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0[_0xefbd('0x59')]);break;case'LIKE':if(_0x390a39===_0xefbd('0x66')){_0x4b14c3[_0xefbd('0x5f')](_0xefbd('0x67')+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or'](_0xefbd('0x69')+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or'](_0xefbd('0x6a')+_0xefbd('0x68'),'%'+_0x3cc1c0['value']+'%');}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0['tableAlias']+'.'+_0x390a39+_0xefbd('0x68'),'%'+_0x3cc1c0['value']+'%');}break;case'>':_0x4b14c3['and'](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x6b'),_0x3cc1c0[_0xefbd('0x59')]);break;case'<':_0x4b14c3['and'](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x6c'),_0x3cc1c0[_0xefbd('0x59')]);break;}});}else{switch(_0x3cc1c0[_0xefbd('0x60')][_0xefbd('0x59')]){case'IS':if(_0x390a39!==_0xefbd('0x61')&&_0x390a39!==_0xefbd('0x6d')){if(_[_0xefbd('0x62')](_0x3cc1c0[_0xefbd('0x59')])&&_0x3cc1c0[_0xefbd('0x59')]['length']>0x1){_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+'\x20IN\x20?',_0x3cc1c0[_0xefbd('0x59')]);}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0[_0xefbd('0x59')][0x0]);}}break;case'=':_0x4b14c3['and'](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x65'),_0x3cc1c0['value']);break;case'LIKE':if(_0x390a39===_0xefbd('0x66')){_0x4b14c3['and'](_0xefbd('0x67')+'\x20LIKE\x20?','%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or']('c.lastName'+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');_0x4b14c3['or'](_0xefbd('0x6a')+_0xefbd('0x68'),'%'+_0x3cc1c0['value']+'%');}else{_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+_0xefbd('0x68'),'%'+_0x3cc1c0[_0xefbd('0x59')]+'%');}break;case'>':_0x4b14c3[_0xefbd('0x5f')](_0x3cc1c0[_0xefbd('0x63')]+'.'+_0x390a39+'\x20>\x20?',_0x3cc1c0['value']);break;case'<':_0x4b14c3['and'](_0x3cc1c0['tableAlias']+'.'+_0x390a39+'\x20<\x20?',_0x3cc1c0[_0xefbd('0x59')]);break;}}}});}else{var _0x218f05=_(Object[_0xefbd('0x34')](_0x19c485[_0xefbd('0x35')]))[_0xefbd('0x6e')](function(_0x260527){return _0x5c308c[_0xefbd('0x6f')](_0x260527)?_0x260527:undefined;})[_0xefbd('0x70')](function(_0x312662){return!_[_0xefbd('0x71')](_0x312662);})['value']();if(!_['isEmpty'](_0x218f05)){_0x218f05['forEach'](function(_0x2778a9){if(_0x2778a9===_0xefbd('0x72')){_0x18626b[_0xefbd('0x3e')](_0xefbd('0x73'),[][_0xefbd('0x74')](_0x19c485[_0xefbd('0x35')][_0x2778a9]));}else if(_0x2778a9===_0xefbd('0x58')){var _0x4f158d=JSON[_0xefbd('0x55')](_0x19c485[_0xefbd('0x35')][_0x2778a9])['$gte'];var _0x22db69=JSON[_0xefbd('0x55')](_0x19c485[_0xefbd('0x35')][_0x2778a9])['$lte'];_0x18626b['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f158d,_0x22db69);}else{_0x18626b[_0xefbd('0x3e')]('i.'+_0x2778a9+_0xefbd('0x65'),_0x19c485[_0xefbd('0x35')][_0x2778a9]);}});}if(_0x19c485[_0xefbd('0x35')][_0xefbd('0x70')]){var _0x1b3f09=_0x19c485[_0xefbd('0x35')][_0xefbd('0x70')][_0xefbd('0x75')]('\x5c','\x5c\x5c')[_0xefbd('0x75')]('\x27\x27',_0xefbd('0x76'));if(qs[_0xefbd('0x77')](_0x1b3f09)){_0x4b14c3['or']('i.id\x20LIKE\x20?',_0x1b3f09+'%');}else{var _0xcdd42b=[];_0x1b3f09[_0xefbd('0x78')]('\x20')[_0xefbd('0x57')](function(_0x29d4c1){_0xcdd42b[_0xefbd('0x79')]('+'+_0x29d4c1[_0xefbd('0x7a')]());});var _0x9c4139=_0xcdd42b[_0xefbd('0x7b')]('\x20');_0x4b14c3['or'](_0xefbd('0x7c'),_0x9c4139)['or']('i.from\x20LIKE\x20?',_0x1b3f09+'%')['or'](_0xefbd('0x7d'),_0x1b3f09+'%');}}}_0x18626b[_0xefbd('0x3e')](_0x4b14c3);if(_0x45fb25[_0xefbd('0x3c')]){_0x45fb25['order'][_0xefbd('0x57')](function(_0x12acd8){_0x18626b['order']('i.'+_0x12acd8[0x0],_0x12acd8[0x1]==='DESC'?![]:!![]);});}_0x18626b[_0xefbd('0x7e')](_0xefbd('0x7f'));var _0x8873e9={'type':db['Sequelize']['QueryTypes'][_0xefbd('0x80')],'raw':!![]};var _0x491477=_0x18626b['clone']()[_0xefbd('0x41')](_0xefbd('0x81'));if(!_0x19c485[_0xefbd('0x35')][_0xefbd('0x56')]){if(_0x19c485[_0xefbd('0x35')]['read']){if(_0x19c485[_0xefbd('0x35')]['read']==0x1){_0x491477[_0xefbd('0x3e')](util[_0xefbd('0x5d')](_0xefbd('0x82'),_0x24ce10[_0xefbd('0x7a')]()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x84'));}else{_0x491477[_0xefbd('0x3e')](util[_0xefbd('0x5d')]('%s\x20>\x200',_0x24ce10[_0xefbd('0x7a')]()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x85'));}}if(_0x19c485['query'][_0xefbd('0x86')]){var _0x3085f5=_[_0xefbd('0x62')](_0x19c485['query']['tag'])?_0x19c485[_0xefbd('0x35')][_0xefbd('0x86')]:new Array(_0x19c485['query']['tag']);var _0x19807c=squel['expr']();_0x3085f5[_0xefbd('0x57')](function(_0x4423d8){_0x19807c['or'](_0xefbd('0x87'),'%,'+_0x4423d8+',%');});_0x18626b[_0xefbd('0x83')](_0x19807c);_0x491477[_0xefbd('0x49')]('openchannel_interaction_has_tags','it',_0xefbd('0x88'));_0x491477[_0xefbd('0x49')](_0xefbd('0x43'),'t','t.id\x20=\x20it.TagId');_0x491477['where'](_0xefbd('0x89'),_0x3085f5);}}else{var _0x2f59e5=JSON['parse'](_0x19c485['query'][_0xefbd('0x56')]);_[_0xefbd('0x34')](_0x2f59e5)['forEach'](function(_0x2d22b5){var _0x1ec907=_0x2f59e5[_0x2d22b5];if(_0x2d22b5===_0xefbd('0x61')){var _0x19424b=_0x1ec907['value'];var _0x27c3d3=squel[_0xefbd('0x54')]();_0x19424b[_0xefbd('0x57')](function(_0x14327f){_0x27c3d3['or'](_0xefbd('0x87'),'%,'+_0x14327f+',%');});_0x18626b[_0xefbd('0x83')](_0x27c3d3);_0x491477[_0xefbd('0x49')](_0xefbd('0x8a'),'it',_0xefbd('0x8b'));_0x491477['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x491477[_0xefbd('0x3e')](_0xefbd('0x89'),_0x19424b);}else if(_0x2d22b5==='Messages.count'){if(_0x1ec907[_0xefbd('0x59')]['length']===0x1){if(_0x1ec907[_0xefbd('0x59')][0x0]===0x1){_0x491477[_0xefbd('0x3e')](util[_0xefbd('0x5d')]('%s\x20=\x200',_0x24ce10['toString']()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x84'));}else{_0x491477['where'](util['format'](_0xefbd('0x8c'),_0x24ce10[_0xefbd('0x7a')]()));_0x18626b[_0xefbd('0x83')](_0xefbd('0x85'));}}}});}db[_0xefbd('0x8d')][_0xefbd('0x35')](_0x491477[_0xefbd('0x7a')](),_0x8873e9)[_0xefbd('0x2b')](function(_0xa81098){_0x58c0ac[_0xefbd('0x22')]=_0xa81098[_0xefbd('0x3a')];if(_0x58c0ac['count']===0x0)return[];return db[_0xefbd('0x8d')]['query'](_0x19ddb7[_0xefbd('0x7a')](),_0x8873e9)['then'](function(_0x4d8315){_0x1b77e6=_[_0xefbd('0x8e')](_0x4d8315,'id');_0x8873e9=_[_0xefbd('0x8f')](_0x8873e9,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x18626b[_0xefbd('0x41')](_0x24ce10,_0xefbd('0x6d'));_0x18626b[_0xefbd('0x41')](_0xefbd('0x90'),'Account.key');_0x18626b[_0xefbd('0x41')](_0xefbd('0x91'));_0x18626b['field'](_0xefbd('0x67'),'Contact.firstName');_0x18626b[_0xefbd('0x41')](_0xefbd('0x69'),'Contact.lastName');_0x18626b[_0xefbd('0x41')]('c.email',_0xefbd('0x92'));_0x18626b[_0xefbd('0x41')]('c.phone',_0xefbd('0x93'));_0x18626b[_0xefbd('0x41')](_0xefbd('0x94'),_0xefbd('0x95'));_0x18626b[_0xefbd('0x41')]('c.fax',_0xefbd('0x96'));_0x18626b[_0xefbd('0x41')](_0xefbd('0x97'),'User.name');_0x18626b[_0xefbd('0x41')](_0xefbd('0x98'),'TagIds');_0x18626b[_0xefbd('0x49')](_0xefbd('0x99'),'it',_0xefbd('0x88'));_0x18626b[_0xefbd('0x49')](_0xefbd('0x43'),'t','t.id\x20=\x20it.TagId');_0x18626b[_0xefbd('0x24')](_0x45fb25[_0xefbd('0x24')]);_0x18626b[_0xefbd('0x23')](_0x45fb25[_0xefbd('0x23')]);return db[_0xefbd('0x8d')][_0xefbd('0x35')](_0x18626b[_0xefbd('0x7a')](),_0x8873e9);})['then'](function(_0x4f05da){_0x532c0a[_0xefbd('0x3e')](_0xefbd('0x9a'),_[_0xefbd('0x6e')](_0x4f05da,'id'));return db[_0xefbd('0x8d')][_0xefbd('0x35')](_0x532c0a[_0xefbd('0x7a')](),_0x8873e9)[_0xefbd('0x2b')](function(_0x395cb3){var _0x45a8af=_['groupBy'](_0x395cb3,_0xefbd('0x9b'));_0x4f05da[_0xefbd('0x57')](function(_0x3edbce){if(_0x45a8af[_0x3edbce['id']]){_0x3edbce[_0xefbd('0x9c')]=_[_0xefbd('0x6e')](_0x45a8af[_0x3edbce['id']],function(_0x36a2df){return{'id':_0x36a2df['id']};});}if(_0x3edbce['TagIds']){_0x3edbce[_0xefbd('0x9d')]=[];_0x3edbce[_0xefbd('0x9e')][_0xefbd('0x78')](',')['forEach'](function(_0x54e08a){_0x3edbce[_0xefbd('0x9d')]['push'](_0x1b77e6[_0x54e08a]);});}delete _0x3edbce[_0xefbd('0x9e')];});return _0x4f05da;});});})[_0xefbd('0x2b')](function(_0x1a2a05){_0x58c0ac[_0xefbd('0x9f')]=_0x1a2a05;return _0x58c0ac;})[_0xefbd('0x2b')](respondWithFilteredResult(_0x48e20a,_0x45fb25))[_0xefbd('0xa0')](handleError(_0x48e20a,null));};exports['show']=function(_0x1b79bd,_0x550d48){var _0x1e7378={'raw':![],'where':{'id':_0x1b79bd[_0xefbd('0xa1')]['id']}},_0x319236={};_0x319236[_0xefbd('0x33')]=_[_0xefbd('0x34')](db[_0xefbd('0x31')][_0xefbd('0x32')]);_0x319236['query']=_[_0xefbd('0x34')](_0x1b79bd['query']);_0x319236['filters']=_[_0xefbd('0x37')](_0x319236[_0xefbd('0x33')],_0x319236[_0xefbd('0x35')]);_0x1e7378['attributes']=_['intersection'](_0x319236[_0xefbd('0x33')],qs[_0xefbd('0x39')](_0x1b79bd[_0xefbd('0x35')]['fields']));_0x1e7378[_0xefbd('0x38')]=_0x1e7378['attributes']['length']?_0x1e7378[_0xefbd('0x38')]:_0x319236[_0xefbd('0x33')];if(_0x1b79bd[_0xefbd('0x35')][_0xefbd('0xa2')]){_0x1e7378[_0xefbd('0xa3')]=[{'all':!![]}];}_0x1e7378=_[_0xefbd('0x8f')]({},_0x1e7378,_0x1b79bd[_0xefbd('0xa4')]);return db[_0xefbd('0x31')]['find'](_0x1e7378)[_0xefbd('0x2b')](handleEntityNotFound(_0x550d48,null))['then'](respondWithResult(_0x550d48,null))[_0xefbd('0xa0')](handleError(_0x550d48,null));};exports[_0xefbd('0xa5')]=function(_0x314da3,_0x158a67){return db[_0xefbd('0x31')][_0xefbd('0xa5')](_0x314da3[_0xefbd('0xa6')],{})[_0xefbd('0x2b')](respondWithResult(_0x158a67,0xc9))[_0xefbd('0xa0')](handleError(_0x158a67,null));};exports[_0xefbd('0x2a')]=function(_0x244a77,_0x1e94e3){if(_0x244a77['body']['id']){delete _0x244a77[_0xefbd('0xa6')]['id'];}return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x244a77[_0xefbd('0xa1')]['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0x1e94e3,null))[_0xefbd('0x2b')](saveUpdates(_0x244a77[_0xefbd('0xa6')],null))[_0xefbd('0x2b')](respondWithResult(_0x1e94e3,null))[_0xefbd('0xa0')](handleError(_0x1e94e3,null));};exports[_0xefbd('0x2c')]=function(_0x536976,_0xa8472b){return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x536976[_0xefbd('0xa1')]['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0xa8472b,null))[_0xefbd('0x2b')](removeEntity(_0xa8472b,null))[_0xefbd('0xa0')](handleError(_0xa8472b,null));};exports[_0xefbd('0xa8')]=function(_0xcb01d6,_0x30c5c3){return db[_0xefbd('0x31')][_0xefbd('0xa8')]()[_0xefbd('0x2b')](respondWithResult(_0x30c5c3,null))[_0xefbd('0xa0')](handleError(_0x30c5c3,null));};exports[_0xefbd('0xa9')]=function(_0x22fc90,_0x18f1e2,_0x14bc8b){return db['OpenchannelMessage']['find']({'where':{'id':_0x22fc90['params']['id']}})['then'](handleEntityNotFound(_0x18f1e2,null))[_0xefbd('0x2b')](function(_0x503385){if(_0x503385){return _0x503385[_0xefbd('0xa9')](_0x22fc90['body']['ids'],_[_0xefbd('0xaa')](_0x22fc90['body'],['ids','id'])||{});}})[_0xefbd('0x2b')](respondWithResult(_0x18f1e2,null))['catch'](handleError(_0x18f1e2,null));};exports[_0xefbd('0xab')]=function(_0x46ba97,_0x580193,_0x2faf6c){var _0x23ea1d={'raw':![],'where':{}};var _0x5917df={};var _0xe043f9={'count':0x0,'rows':[]};return db[_0xefbd('0x31')][_0xefbd('0xac')]({'where':{'id':_0x46ba97['params']['id']}})['then'](handleEntityNotFound(_0x580193,null))[_0xefbd('0x2b')](function(_0x5d740f){if(_0x5d740f){_0x5917df[_0xefbd('0x33')]=_[_0xefbd('0x34')](db[_0xefbd('0xad')][_0xefbd('0x32')]);_0x5917df[_0xefbd('0x35')]=_[_0xefbd('0x34')](_0x46ba97['query']);_0x5917df[_0xefbd('0x36')]=_[_0xefbd('0x37')](_0x5917df[_0xefbd('0x33')],_0x5917df[_0xefbd('0x35')]);_0x23ea1d[_0xefbd('0x38')]=_[_0xefbd('0x37')](_0x5917df[_0xefbd('0x33')],qs[_0xefbd('0x39')](_0x46ba97[_0xefbd('0x35')][_0xefbd('0x39')]));_0x23ea1d[_0xefbd('0x38')]=_0x23ea1d[_0xefbd('0x38')][_0xefbd('0x3a')]?_0x23ea1d[_0xefbd('0x38')]:_0x5917df[_0xefbd('0x33')];if(!_0x46ba97[_0xefbd('0x35')][_0xefbd('0x6f')]('nolimit')){_0x23ea1d['limit']=qs[_0xefbd('0x24')](_0x46ba97[_0xefbd('0x35')][_0xefbd('0x24')]);_0x23ea1d['offset']=qs[_0xefbd('0x23')](_0x46ba97['query']['offset']);}_0x23ea1d[_0xefbd('0x3c')]=qs[_0xefbd('0x3d')](_0x46ba97[_0xefbd('0x35')]['sort']);_0x23ea1d['where']=qs[_0xefbd('0x36')](_[_0xefbd('0x3f')](_0x46ba97[_0xefbd('0x35')],_0x5917df[_0xefbd('0x36')]));_0x23ea1d[_0xefbd('0x3e')][_0xefbd('0x9b')]=_0x5d740f['id'];if(_0x46ba97[_0xefbd('0x35')][_0xefbd('0x70')]){_0x23ea1d[_0xefbd('0x3e')]=_[_0xefbd('0x8f')](_0x23ea1d[_0xefbd('0x3e')],{'$or':_[_0xefbd('0x6e')](_0x23ea1d[_0xefbd('0x38')],function(_0x278a44){var _0x481063={};_0x481063[_0x278a44]={'$like':'%'+_0x46ba97['query'][_0xefbd('0x70')]+'%'};return _0x481063;})});}if(_0x46ba97[_0xefbd('0x35')][_0xefbd('0xae')]){var _0x190bfe=_0x46ba97[_0xefbd('0x35')][_0xefbd('0xae')]['split'](',');var _0x10dfec={};_0x10dfec[_0x190bfe[0x0]]={'$gte':moment(_0x190bfe[0x1])['format'](_0xefbd('0xaf'))};_0x23ea1d[_0xefbd('0x3e')]=_[_0xefbd('0x8f')](_0x23ea1d[_0xefbd('0x3e')],_0x10dfec);}_0x23ea1d=_[_0xefbd('0x8f')]({},_0x23ea1d,_0x46ba97[_0xefbd('0xa4')]);return db['OpenchannelMessage']['count']({'where':_0x23ea1d[_0xefbd('0x3e')]})[_0xefbd('0x2b')](function(_0x89510e){_0xe043f9[_0xefbd('0x22')]=_0x89510e;if(_0x46ba97[_0xefbd('0x35')][_0xefbd('0xa2')]){_0x23ea1d[_0xefbd('0xa3')]=[{'all':!![]}];}return db[_0xefbd('0xad')][_0xefbd('0xb0')](_0x23ea1d);})[_0xefbd('0x2b')](function(_0x302a0e){_0xe043f9[_0xefbd('0x9f')]=_0x302a0e;return _0xe043f9;});}})[_0xefbd('0x2b')](respondWithFilteredResult(_0x580193,_0x23ea1d))['catch'](handleError(_0x580193,null));};exports[_0xefbd('0xb1')]=function(_0xfc59a0,_0x518968,_0x251e8f){return db[_0xefbd('0x31')]['find']({'where':{'id':_0xfc59a0['params']['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0x518968,null))[_0xefbd('0x2b')](function(_0x1ded28){if(_0x1ded28){return _0x1ded28[_0xefbd('0xb2')](_0xfc59a0[_0xefbd('0xa6')][_0xefbd('0xb3')],_[_0xefbd('0xaa')](_0xfc59a0[_0xefbd('0xa6')],[_0xefbd('0xb3'),'id'])||{})[_0xefbd('0xb4')](function(){return db['Tag']['findAll']({'attributes':['id',_0xefbd('0x2f'),_0xefbd('0x42')],'where':{'id':_0xfc59a0['body'][_0xefbd('0xb3')]}});})[_0xefbd('0x2b')](function(_0x1b1d99){socket[_0xefbd('0xb5')]('openchannelInteractionTags:save',{'id':Number(_0xfc59a0[_0xefbd('0xa1')]['id']),'tags':_0x1b1d99||[]});return{'id':Number(_0xfc59a0[_0xefbd('0xa1')]['id']),'tags':_0x1b1d99||[]};});}})[_0xefbd('0x2b')](respondWithResult(_0x518968,null))['catch'](handleError(_0x518968,null));};exports[_0xefbd('0xb6')]=function(_0x442409,_0x109e96,_0x14c2e4){return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x442409[_0xefbd('0xa1')]['id']}})[_0xefbd('0x2b')](handleEntityNotFound(_0x109e96,null))[_0xefbd('0x2b')](function(_0x596683){if(_0x596683){return _0x596683[_0xefbd('0xb6')](_0x442409['query'][_0xefbd('0xb3')]);}})[_0xefbd('0x2b')](respondWithStatusCode(_0x109e96,null))[_0xefbd('0xa0')](handleError(_0x109e96,null));};exports[_0xefbd('0xb7')]=function(_0x49ddf9,_0x21b4e2){var _0x14db01=moment()['unix']()[_0xefbd('0x7a')]();var _0x12d71a=path[_0xefbd('0x7b')](config[_0xefbd('0xb8')],_0xefbd('0xb9'),_0xefbd('0xba'),_0xefbd('0xbb'));var _0x6f1d5e=path['join'](config[_0xefbd('0xb8')],_0xefbd('0xb9'),'files',_0xefbd('0xbc'));var _0x48eb8c=path[_0xefbd('0x7b')](_0x12d71a,_0x14db01);var _0x2452d6=util[_0xefbd('0x5d')](_0xefbd('0xbd'),_0x49ddf9[_0xefbd('0xa1')]['id'],_0x14db01);var _0x1f23b9=path[_0xefbd('0x7b')](_0x12d71a,_0x2452d6);var _0x26c7c1=![];return db[_0xefbd('0x31')][_0xefbd('0xa7')]({'where':{'id':_0x49ddf9[_0xefbd('0xa1')]['id']},'include':[{'model':db[_0xefbd('0xad')],'as':_0xefbd('0xbe'),'attributes':['id',_0xefbd('0xa6'),_0xefbd('0x58'),_0xefbd('0xbf'),_0xefbd('0xc0')],'include':[{'model':db[_0xefbd('0xc1')],'as':_0xefbd('0xc1'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0xefbd('0xc2')],'as':_0xefbd('0xc3'),'attributes':['id',_0xefbd('0xc4'),_0xefbd('0xc5')],'raw':!![]},{'model':db[_0xefbd('0xc6')],'as':_0xefbd('0xc6'),'raw':!![]}]},{'model':db['OpenchannelAccount'],'as':'Account','attributes':['id',_0xefbd('0x2f')]},{'model':db[_0xefbd('0xc1')],'as':_0xefbd('0xc7'),'attributes':['id',_0xefbd('0xc8')]}]})[_0xefbd('0x2b')](handleEntityNotFound(_0x21b4e2,null))[_0xefbd('0x2b')](function(_0xebb062){if(_0xebb062){var _0x52de7b=_0xebb062[_0xefbd('0xc9')]({'plain':!![]});_0x26c7c1=!![];var _0x21af63={'format':'A4','border':_0xefbd('0xca'),'header':{'height':_0xefbd('0xcb'),'contents':{'first':_0xefbd('0xcc')}},'footer':{'height':'30px','contents':{'default':util['format'](_0xefbd('0xcd'),util[_0xefbd('0x5d')](_0xefbd('0xce'),_0xefbd('0xcf'),_0x52de7b['id']),moment()[_0xefbd('0x5d')](_0xefbd('0xd0'))[_0xefbd('0x7a')]())}}};fs['mkdirSync'](_0x48eb8c);var _0x50912a={'channel':_0xefbd('0xcf'),'account':_0x52de7b[_0xefbd('0xd1')]['name'],'agent':_0x52de7b[_0xefbd('0xc7')]?_0x52de7b[_0xefbd('0xc7')][_0xefbd('0xc8')]:_0xefbd('0xd2'),'createdAt':moment(_0x52de7b[_0xefbd('0x58')])['format'](_0xefbd('0xaf'))[_0xefbd('0x7a')](),'closedAt':_0x52de7b[_0xefbd('0xd3')]?moment(_0x52de7b[_0xefbd('0xd4')])[_0xefbd('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xefbd('0x7a')]():'','disposition':_0x52de7b[_0xefbd('0xd5')],'visibility':_0x52de7b[_0xefbd('0xd6')]?_0xefbd('0xd7'):'Private','messages':_(_0x52de7b[_0xefbd('0xbe')])['filter']({'secret':![]})[_0xefbd('0x6e')](function(_0x18821b){if(_0x18821b['Attachment']){var _0x4c1b80=path[_0xefbd('0x7b')](_0x6f1d5e,_0x18821b[_0xefbd('0xc6')][_0xefbd('0xd8')]);if(fs[_0xefbd('0xd9')](_0x4c1b80)){fs['createReadStream'](_0x4c1b80)[_0xefbd('0xda')](fs['createWriteStream'](path['join'](_0x48eb8c,_0x18821b[_0xefbd('0xc6')]['basename'])));}}return{'date':moment(_0x18821b[_0xefbd('0x58')])[_0xefbd('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xefbd('0x7a')](),'sender':_0x18821b['direction']==='out'?_0x18821b[_0xefbd('0xc1')]?_0x18821b[_0xefbd('0xc1')][_0xefbd('0xc8')]:_0xefbd('0xdb'):_0x18821b[_0xefbd('0xc3')][_0xefbd('0xc4')]+(_0x18821b[_0xefbd('0xc3')][_0xefbd('0xc5')]?'\x20'+_0x18821b[_0xefbd('0xc3')][_0xefbd('0xc5')]:''),'body':_0x18821b[_0xefbd('0xc6')]?_0x18821b['Attachment']['basename']:_0x18821b[_0xefbd('0xa6')],'direction':_0x18821b['direction']===_0xefbd('0xdc')?'A':'C','secret':_0x18821b['secret'],'attachment':_0x18821b[_0xefbd('0xc6')]};})[_0xefbd('0x59')]()};return ejs['renderFile'](path[_0xefbd('0x7b')](config['root'],'server',_0xefbd('0xdd'),_0xefbd('0xde')),{'interaction':_0x50912a})[_0xefbd('0x2b')](function(_0x5560b5){return new BPromise(function(_0x505c67,_0x2c9204){pdf[_0xefbd('0xa5')](_0x5560b5,_0x21af63)[_0xefbd('0xdf')](path[_0xefbd('0x7b')](_0x48eb8c,'transcript-'+_0x52de7b['id']+'-'+_0x14db01+_0xefbd('0xe0')),function(_0x181386,_0x41b21b){if(_0x181386)return _0x2c9204(_0x181386);_0x505c67(_0x41b21b);});});});}})[_0xefbd('0x2b')](function(){if(_0x26c7c1){return new BPromise(function(_0x2996f6,_0x638bcc){zipdir(_0x48eb8c,{'saveTo':_0x1f23b9},function(_0x19a944,_0x196f95){if(_0x19a944)return _0x638bcc(_0x19a944);return _0x2996f6(_0x196f95);});})[_0xefbd('0x2b')](function(){return new BPromise(function(_0x10dac4,_0x2f3922){rimraf(_0x48eb8c,function(_0x3124a2){if(_0x3124a2)_0x2f3922(_0x3124a2);return _0x10dac4();});});})[_0xefbd('0x2b')](function(){return _0x21b4e2[_0xefbd('0xb7')](_0x1f23b9,_0x2452d6,function(_0x536b82){if(_0x536b82){console['log'](_0xefbd('0xe1'),_0x536b82);}else{fs[_0xefbd('0xe2')](_0x1f23b9);}});});}else{return _0x21b4e2[_0xefbd('0x1e')](0xc8);}})[_0xefbd('0xa0')](handleError(_0x21b4e2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 388e200..acbe0cf 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 _0x8856=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save'];(function(_0x28b30d,_0x181c40){var _0x4c2635=function(_0x43968d){while(--_0x43968d){_0x28b30d['push'](_0x28b30d['shift']());}};_0x4c2635(++_0x181c40);}(_0x8856,0x192));var _0x6885=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8856[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6885('0x0'));var OpenchannelInteraction=require(_0x6885('0x1'))['db'][_0x6885('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6885('0x3')](0x0);var events={'afterCreate':_0x6885('0x4'),'afterUpdate':_0x6885('0x5'),'afterDestroy':_0x6885('0x6')};function emitEvent(_0x4a80a0){return function(_0x3e9e89,_0x1fb51c,_0x381630){OpenchannelInteractionEvents[_0x6885('0x7')](_0x4a80a0+':'+_0x3e9e89['id'],_0x3e9e89);OpenchannelInteractionEvents['emit'](_0x4a80a0,_0x3e9e89);_0x381630(null);};}for(var e in events){if(events[_0x6885('0x8')](e)){var event=events[e];OpenchannelInteraction[_0x6885('0x9')](e,emitEvent(event));}}module[_0x6885('0xa')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x88bb=['remove','emit','hasOwnProperty','exports','events','OpenchannelInteraction','setMaxListeners'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x88bb,0xeb));var _0xb88b=function(_0x180b1e,_0x239a70){_0x180b1e=_0x180b1e-0x0;var _0x405198=_0x88bb[_0x180b1e];return _0x405198;};'use strict';var EventEmitter=require(_0xb88b('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xb88b('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb88b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb88b('0x3')};function emitEvent(_0x4002fb){return function(_0x50abfc,_0x12576e,_0x4be0c4){OpenchannelInteractionEvents['emit'](_0x4002fb+':'+_0x50abfc['id'],_0x50abfc);OpenchannelInteractionEvents[_0xb88b('0x4')](_0x4002fb,_0x50abfc);_0x4be0c4(null);};}for(var e in events){if(events[_0xb88b('0x5')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xb88b('0x6')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 0924c65..5010bc8 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 _0xb91a=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions'];(function(_0x3e63e3,_0xa10a24){var _0x2ad801=function(_0x285ca4){while(--_0x285ca4){_0x3e63e3['push'](_0x3e63e3['shift']());}};_0x2ad801(++_0xa10a24);}(_0xb91a,0xf4));var _0xab91=function(_0x189980,_0xe665f0){_0x189980=_0x189980-0x0;var _0x16cc94=_0xb91a[_0x189980];return _0x16cc94;};'use strict';var _=require(_0xab91('0x0'));var util=require(_0xab91('0x1'));var logger=require(_0xab91('0x2'))('api');var moment=require('moment');var BPromise=require(_0xab91('0x3'));var rp=require(_0xab91('0x4'));var fs=require('fs');var path=require(_0xab91('0x5'));var rimraf=require(_0xab91('0x6'));var config=require(_0xab91('0x7'));var attributes=require(_0xab91('0x8'));module[_0xab91('0x9')]=function(_0x429933,_0x290af9){return _0x429933[_0xab91('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0xab91('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1e8d52,_0x4bc8cd,_0x5f3771){if(_0x1e8d52['changed'](_0xab91('0xc'))){_0x1e8d52[_0xab91('0xd')]=moment()[_0xab91('0xe')](_0xab91('0xf'));}_0x5f3771(null,_0x1e8d52);}}});}; \ No newline at end of file +var _0xa4fb=['define','OpenchannelInteraction','openchannel_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','./openchannelInteraction.attributes','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa4fb,0x150));var _0xba4f=function(_0x5ac0f0,_0xee4d98){_0x5ac0f0=_0x5ac0f0-0x0;var _0x4aceec=_0xa4fb[_0x5ac0f0];return _0x4aceec;};'use strict';var _=require(_0xba4f('0x0'));var util=require(_0xba4f('0x1'));var logger=require(_0xba4f('0x2'))(_0xba4f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xba4f('0x4'));var fs=require('fs');var path=require(_0xba4f('0x5'));var rimraf=require(_0xba4f('0x6'));var config=require('../../config/environment');var attributes=require(_0xba4f('0x7'));module[_0xba4f('0x8')]=function(_0x379b0f,_0x18baa8){return _0x379b0f[_0xba4f('0x9')](_0xba4f('0xa'),attributes,{'tableName':_0xba4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1af837,_0x399847,_0x27f65a){if(_0x1af837['changed'](_0xba4f('0xc'))){_0x1af837['closedAt']=moment()[_0xba4f('0xd')](_0xba4f('0xe'));}_0x27f65a(null,_0x1af837);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index fda5d6e..c65617d 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 _0x3baf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','attributes','AddTagsToOpenchannelInteraction','addTags','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring'];(function(_0x1f713e,_0x3f1c2d){var _0x274e31=function(_0x4909ce){while(--_0x4909ce){_0x1f713e['push'](_0x1f713e['shift']());}};_0x274e31(++_0x3f1c2d);}(_0x3baf,0xf7));var _0xf3ba=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x3baf[_0x38af48];return _0x445384;};'use strict';var _=require(_0xf3ba('0x0'));var util=require(_0xf3ba('0x1'));var moment=require(_0xf3ba('0x2'));var BPromise=require(_0xf3ba('0x3'));var rs=require(_0xf3ba('0x4'));var fs=require('fs');var Redis=require(_0xf3ba('0x5'));var db=require(_0xf3ba('0x6'))['db'];var utils=require(_0xf3ba('0x7'));var logger=require(_0xf3ba('0x8'))(_0xf3ba('0x9'));var config=require(_0xf3ba('0xa'));var jayson=require(_0xf3ba('0xb'));var client=jayson[_0xf3ba('0xc')][_0xf3ba('0xd')]({'port':0x232a});config[_0xf3ba('0xe')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf3ba('0xf'))(new Redis(config['redis']));require(_0xf3ba('0x10'))[_0xf3ba('0x11')](socket);function respondWithRpcPromise(_0x3ae5fb,_0x40cff2,_0x3a5714){return new BPromise(function(_0x27ea37,_0x3c7c1d){return client[_0xf3ba('0x12')](_0x3ae5fb,_0x3a5714)[_0xf3ba('0x13')](function(_0x301ca1){logger[_0xf3ba('0x14')](_0xf3ba('0x15'),_0x40cff2,_0xf3ba('0x16'));logger[_0xf3ba('0x17')](_0xf3ba('0x18'),_0x40cff2,_0xf3ba('0x16'),JSON[_0xf3ba('0x19')](_0x301ca1));if(_0x301ca1[_0xf3ba('0x1a')]){if(_0x301ca1['error'][_0xf3ba('0x1b')]===0x1f4){logger['error'](_0xf3ba('0x15'),_0x40cff2,_0x301ca1[_0xf3ba('0x1a')][_0xf3ba('0x1c')]);return _0x3c7c1d(_0x301ca1[_0xf3ba('0x1a')][_0xf3ba('0x1c')]);}logger['error'](_0xf3ba('0x15'),_0x40cff2,_0x301ca1[_0xf3ba('0x1a')][_0xf3ba('0x1c')]);return _0x27ea37(_0x301ca1['error'][_0xf3ba('0x1c')]);}else{logger[_0xf3ba('0x14')](_0xf3ba('0x15'),_0x40cff2,_0xf3ba('0x16'));_0x27ea37(_0x301ca1['result'][_0xf3ba('0x1c')]);}})[_0xf3ba('0x1d')](function(_0x4e601c){logger['error'](_0xf3ba('0x15'),_0x40cff2,_0x4e601c);_0x3c7c1d(_0x4e601c);});});}exports[_0xf3ba('0x1e')]=function(_0x854fc4){var _0x5d351f=this;return new Promise(function(_0x375bcf,_0x327723){return db[_0xf3ba('0x1f')][_0xf3ba('0x20')](_0x854fc4[_0xf3ba('0x21')],{'raw':_0x854fc4[_0xf3ba('0x22')]?_0x854fc4[_0xf3ba('0x22')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x854fc4['options']?_0x854fc4['options'][_0xf3ba('0x23')]||null:null,'attributes':_0x854fc4[_0xf3ba('0x22')]?_0x854fc4[_0xf3ba('0x22')][_0xf3ba('0x24')]||null:null,'limit':_0x854fc4[_0xf3ba('0x22')]?_0x854fc4['options']['limit']||null:null})[_0xf3ba('0x13')](function(_0xd6c2da){logger['info'](_0xf3ba('0x1e'),_0x854fc4);logger[_0xf3ba('0x17')]('UpdateOpenchannelInteraction',_0x854fc4,JSON['stringify'](_0xd6c2da));_0x375bcf(_0xd6c2da);})[_0xf3ba('0x1d')](function(_0x7effa1){logger['error'](_0xf3ba('0x1e'),_0x7effa1[_0xf3ba('0x1c')],_0x854fc4);_0x327723(_0x5d351f[_0xf3ba('0x1a')](0x1f4,_0x7effa1['message']));});});};exports[_0xf3ba('0x25')]=function(_0x4e1708){return new Promise(function(_0x4e3094,_0x7c1a60){return db[_0xf3ba('0x1f')]['find']({'where':_0x4e1708[_0xf3ba('0x22')]?_0x4e1708[_0xf3ba('0x22')]['where']||null:null})['then'](function(_0x49f234){if(_0x49f234){return _0x49f234[_0xf3ba('0x26')](_0x4e1708[_0xf3ba('0x21')]['ids'],_[_0xf3ba('0x27')](_0x4e1708['body'],['ids','id'])||{});}})[_0xf3ba('0x28')](function(_0x2a426c){logger[_0xf3ba('0x14')](_0xf3ba('0x29'),_0x4e1708);logger[_0xf3ba('0x17')](_0xf3ba('0x29'),_0x4e1708,JSON['stringify'](_0x2a426c));_0x4e3094(_0x2a426c);})[_0xf3ba('0x1d')](function(_0x487ed6){logger[_0xf3ba('0x1a')](_0xf3ba('0x29'),_0x487ed6['message'],_0x4e1708);_0x7c1a60(_this[_0xf3ba('0x1a')](0x1f4,_0x487ed6[_0xf3ba('0x1c')]));});});}; \ No newline at end of file +var _0x8958=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','then','AddTagsToOpenchannelInteraction','find','ids','omit','AddTags','util'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8958,0x93));var _0x8895=function(_0x473db6,_0x12398){_0x473db6=_0x473db6-0x0;var _0x203e57=_0x8958[_0x473db6];return _0x203e57;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8895('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x8895('0x2'))(_0x8895('0x3'));var config=require(_0x8895('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x8895('0x5')][_0x8895('0x6')]({'port':0x232a});config[_0x8895('0x7')]=_[_0x8895('0x8')](config[_0x8895('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x8895('0x9'))(new Redis(config[_0x8895('0x7')]));require(_0x8895('0xa'))[_0x8895('0xb')](socket);function respondWithRpcPromise(_0x6eab1e,_0x29c126,_0x22a12b){return new BPromise(function(_0xdb3d59,_0x46c467){return client[_0x8895('0xc')](_0x6eab1e,_0x22a12b)['then'](function(_0x1cf600){logger[_0x8895('0xd')](_0x8895('0xe'),_0x29c126,_0x8895('0xf'));logger[_0x8895('0x10')](_0x8895('0x11'),_0x29c126,'request\x20sent',JSON[_0x8895('0x12')](_0x1cf600));if(_0x1cf600[_0x8895('0x13')]){if(_0x1cf600[_0x8895('0x13')]['code']===0x1f4){logger['error'](_0x8895('0xe'),_0x29c126,_0x1cf600['error'][_0x8895('0x14')]);return _0x46c467(_0x1cf600[_0x8895('0x13')][_0x8895('0x14')]);}logger[_0x8895('0x13')](_0x8895('0xe'),_0x29c126,_0x1cf600['error'][_0x8895('0x14')]);return _0xdb3d59(_0x1cf600[_0x8895('0x13')][_0x8895('0x14')]);}else{logger[_0x8895('0xd')](_0x8895('0xe'),_0x29c126,_0x8895('0xf'));_0xdb3d59(_0x1cf600[_0x8895('0x15')][_0x8895('0x14')]);}})[_0x8895('0x16')](function(_0x2da618){logger[_0x8895('0x13')](_0x8895('0xe'),_0x29c126,_0x2da618);_0x46c467(_0x2da618);});});}exports[_0x8895('0x17')]=function(_0x54e6d4){var _0x522a4e=this;return new Promise(function(_0x4fcbc3,_0x3daf43){return db[_0x8895('0x18')][_0x8895('0x19')](_0x54e6d4[_0x8895('0x1a')],{'raw':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4[_0x8895('0x1b')][_0x8895('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4['options'][_0x8895('0x1d')]||null:null,'attributes':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4[_0x8895('0x1b')][_0x8895('0x1e')]||null:null,'limit':_0x54e6d4[_0x8895('0x1b')]?_0x54e6d4['options']['limit']||null:null})[_0x8895('0x1f')](function(_0x398382){logger[_0x8895('0xd')](_0x8895('0x17'),_0x54e6d4);logger['debug'](_0x8895('0x17'),_0x54e6d4,JSON[_0x8895('0x12')](_0x398382));_0x4fcbc3(_0x398382);})[_0x8895('0x16')](function(_0x5486a6){logger['error'](_0x8895('0x17'),_0x5486a6['message'],_0x54e6d4);_0x3daf43(_0x522a4e[_0x8895('0x13')](0x1f4,_0x5486a6[_0x8895('0x14')]));});});};exports[_0x8895('0x20')]=function(_0xf5fb66){return new Promise(function(_0x153220,_0x5c03ea){return db['OpenchannelInteraction'][_0x8895('0x21')]({'where':_0xf5fb66[_0x8895('0x1b')]?_0xf5fb66[_0x8895('0x1b')][_0x8895('0x1d')]||null:null})[_0x8895('0x1f')](function(_0x560b93){if(_0x560b93){return _0x560b93['addTags'](_0xf5fb66[_0x8895('0x1a')][_0x8895('0x22')],_[_0x8895('0x23')](_0xf5fb66[_0x8895('0x1a')],[_0x8895('0x22'),'id'])||{});}})['spread'](function(_0x1da939){logger['info'](_0x8895('0x24'),_0xf5fb66);logger['debug'](_0x8895('0x24'),_0xf5fb66,JSON[_0x8895('0x12')](_0x1da939));_0x153220(_0x1da939);})[_0x8895('0x16')](function(_0x3e71fa){logger[_0x8895('0x13')]('AddTags',_0x3e71fa[_0x8895('0x14')],_0xf5fb66);_0x5c03ea(_this[_0x8895('0x13')](0x1f4,_0x3e71fa[_0x8895('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 2254e0f..a3a4c04 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 _0x724c=['update','emit','removeListener','openchannelInteraction:'];(function(_0x2d5a82,_0x20f34c){var _0x4ef2f4=function(_0x38500c){while(--_0x38500c){_0x2d5a82['push'](_0x2d5a82['shift']());}};_0x4ef2f4(++_0x20f34c);}(_0x724c,0xb0));var _0xc724=function(_0x1007bc,_0x238fa0){_0x1007bc=_0x1007bc-0x0;var _0x5bd2fb=_0x724c[_0x1007bc];return _0x5bd2fb;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save','remove',_0xc724('0x0')];function createListener(_0x34f97f,_0x3526f1){return function(_0x6228c6){_0x3526f1[_0xc724('0x1')](_0x34f97f,_0x6228c6);};}function removeListener(_0x35b41a,_0x426b1){return function(){OpenchannelInteractionEvents[_0xc724('0x2')](_0x35b41a,_0x426b1);};}exports['register']=function(_0x26a673){for(var _0x2728fe=0x0,_0x2419ae=events['length'];_0x2728fe<_0x2419ae;_0x2728fe++){var _0x4e6d1e=events[_0x2728fe];var _0x3a10a5=createListener(_0xc724('0x3')+_0x4e6d1e,_0x26a673);OpenchannelInteractionEvents['on'](_0x4e6d1e,_0x3a10a5);}}; \ No newline at end of file +var _0x2ae8=['emit','length','openchannelInteraction:','remove','update'];(function(_0x2e2973,_0x54dba4){var _0x21797c=function(_0x1c786d){while(--_0x1c786d){_0x2e2973['push'](_0x2e2973['shift']());}};_0x21797c(++_0x54dba4);}(_0x2ae8,0xe9));var _0x82ae=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x2ae8[_0x178e48];return _0x440d7e;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0x82ae('0x0'),_0x82ae('0x1')];function createListener(_0x46da09,_0x59fa43){return function(_0x33f03a){_0x59fa43[_0x82ae('0x2')](_0x46da09,_0x33f03a);};}function removeListener(_0x4210ee,_0x1d250d){return function(){OpenchannelInteractionEvents['removeListener'](_0x4210ee,_0x1d250d);};}exports['register']=function(_0x409022){for(var _0x3a1b64=0x0,_0x71e8b8=events[_0x82ae('0x3')];_0x3a1b64<_0x71e8b8;_0x3a1b64++){var _0x281dde=events[_0x3a1b64];var _0x534c7a=createListener(_0x82ae('0x4')+_0x281dde,_0x409022);OpenchannelInteractionEvents['on'](_0x281dde,_0x534c7a);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 23c51a7..44577ab 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 _0x65fd=['describe','show','post','openchannel','update','put','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','/describe'];(function(_0x3a119c,_0x565cf0){var _0x2d3151=function(_0xd699f8){while(--_0xd699f8){_0x3a119c['push'](_0x3a119c['shift']());}};_0x2d3151(++_0x565cf0);}(_0x65fd,0x185));var _0xd65f=function(_0x39c370,_0x179fdc){_0x39c370=_0x39c370-0x0;var _0x1bc3eb=_0x65fd[_0x39c370];return _0x1bc3eb;};'use strict';var multer=require(_0xd65f('0x0'));var util=require(_0xd65f('0x1'));var path=require(_0xd65f('0x2'));var timeout=require(_0xd65f('0x3'));var express=require('express');var router=express[_0xd65f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd65f('0x5'));var config=require(_0xd65f('0x6'));var controller=require(_0xd65f('0x7'));router[_0xd65f('0x8')]('/',auth[_0xd65f('0x9')](),controller['index']);router['get'](_0xd65f('0xa'),auth[_0xd65f('0x9')](),controller[_0xd65f('0xb')]);router[_0xd65f('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xd65f('0xc')]);router[_0xd65f('0xd')]('/',auth[_0xd65f('0x9')](),interaction['tracked'](_0xd65f('0xe'),'openchannelmessage:create'),controller['create']);router['put']('/:id',auth[_0xd65f('0x9')](),controller[_0xd65f('0xf')]);router[_0xd65f('0x10')](_0xd65f('0x11'),auth[_0xd65f('0x9')](),controller[_0xd65f('0x12')]);router[_0xd65f('0x10')](_0xd65f('0x13'),auth[_0xd65f('0x9')](),controller[_0xd65f('0x14')]);router[_0xd65f('0x15')](_0xd65f('0x16'),auth[_0xd65f('0x9')](),controller[_0xd65f('0x17')]);module[_0xd65f('0x18')]=router; \ No newline at end of file +var _0x4d7f=['get','index','/describe','describe','isAuthenticated','show','post','tracked','openchannel','openchannelmessage:create','create','put','/:id','accept','/:id/reject','reject','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xdca99a,_0x5c2571){var _0x31067e=function(_0xdc45fc){while(--_0xdc45fc){_0xdca99a['push'](_0xdca99a['shift']());}};_0x31067e(++_0x5c2571);}(_0x4d7f,0xc1));var _0xf4d7=function(_0x4e4ff8,_0x5c87e4){_0x4e4ff8=_0x4e4ff8-0x0;var _0xb41118=_0x4d7f[_0x4e4ff8];return _0xb41118;};'use strict';var multer=require(_0xf4d7('0x0'));var util=require('util');var path=require(_0xf4d7('0x1'));var timeout=require('connect-timeout');var express=require(_0xf4d7('0x2'));var router=express[_0xf4d7('0x3')]();var auth=require(_0xf4d7('0x4'));var interaction=require(_0xf4d7('0x5'));var config=require(_0xf4d7('0x6'));var controller=require('./openchannelMessage.controller');router[_0xf4d7('0x7')]('/',auth['isAuthenticated'](),controller[_0xf4d7('0x8')]);router[_0xf4d7('0x7')](_0xf4d7('0x9'),auth['isAuthenticated'](),controller[_0xf4d7('0xa')]);router[_0xf4d7('0x7')]('/:id',auth[_0xf4d7('0xb')](),controller[_0xf4d7('0xc')]);router[_0xf4d7('0xd')]('/',auth['isAuthenticated'](),interaction[_0xf4d7('0xe')](_0xf4d7('0xf'),_0xf4d7('0x10')),controller[_0xf4d7('0x11')]);router[_0xf4d7('0x12')](_0xf4d7('0x13'),auth[_0xf4d7('0xb')](),controller['update']);router[_0xf4d7('0x12')]('/:id/accept',auth[_0xf4d7('0xb')](),controller[_0xf4d7('0x14')]);router[_0xf4d7('0x12')](_0xf4d7('0x15'),auth[_0xf4d7('0xb')](),controller[_0xf4d7('0x16')]);router['delete']('/:id',auth[_0xf4d7('0xb')](),controller[_0xf4d7('0x17')]);module[_0xf4d7('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index a15159e..b4a21ce 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 _0xed73=['BOOLEAN','out','exports','medium'];(function(_0x42aba3,_0x4ef48f){var _0x33b03c=function(_0x424739){while(--_0x424739){_0x42aba3['push'](_0x42aba3['shift']());}};_0x33b03c(++_0x4ef48f);}(_0xed73,0x1ee));var _0x3ed7=function(_0x3aa4e9,_0x189b50){_0x3aa4e9=_0x3aa4e9-0x0;var _0xf5925b=_0xed73[_0x3aa4e9];return _0xf5925b;};'use strict';var Sequelize=require('sequelize');module[_0x3ed7('0x0')]={'body':{'type':Sequelize['TEXT'](_0x3ed7('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3ed7('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3ed7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3ed7('0x3')),'defaultValue':_0x3ed7('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x44a9=['out','DATE','exports','TEXT','BOOLEAN','ENUM'];(function(_0x5a1a51,_0x144c79){var _0x47edd7=function(_0x2259bb){while(--_0x2259bb){_0x5a1a51['push'](_0x5a1a51['shift']());}};_0x47edd7(++_0x144c79);}(_0x44a9,0x8c));var _0x944a=function(_0x5b3423,_0x74e895){_0x5b3423=_0x5b3423-0x0;var _0x56a8ec=_0x44a9[_0x5b3423];return _0x56a8ec;};'use strict';var Sequelize=require('sequelize');module[_0x944a('0x0')]={'body':{'type':Sequelize[_0x944a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x944a('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x944a('0x3')]('in','out'),'defaultValue':_0x944a('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x944a('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 055ebab..c93131e 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 _0x8757=['OpenchannelInteractionId','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','test','request','then','info','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','end','sendStatus','stack','name','send','index','OpenchannelMessage','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','key','VIRTUAL','filter','options','include','rows','show','params','includeAll','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteraction'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x8757,0xfc));var _0x7875=function(_0x40658b,_0x123128){_0x40658b=_0x40658b-0x0;var _0x302653=_0x8757[_0x40658b];return _0x302653;};'use strict';var pdf=require(_0x7875('0x0'));var emlformat=require(_0x7875('0x1'));var rimraf=require(_0x7875('0x2'));var zipdir=require(_0x7875('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7875('0x4'));var BPromise=require(_0x7875('0x5'));var Mustache=require(_0x7875('0x6'));var util=require(_0x7875('0x7'));var path=require(_0x7875('0x8'));var sox=require('sox');var csv=require(_0x7875('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7875('0xa'));var squel=require(_0x7875('0xb'));var crypto=require(_0x7875('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7875('0xd'));var toCsv=require(_0x7875('0x9'));var querystring=require(_0x7875('0xe'));var Papa=require('papaparse');var Redis=require(_0x7875('0xf'));var authService=require(_0x7875('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7875('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7875('0x12'));var config=require(_0x7875('0x13'));var db=require(_0x7875('0x14'))['db'];config[_0x7875('0x15')]=_['defaults'](config['redis'],{'host':_0x7875('0x16'),'port':0x18eb});var socket=require(_0x7875('0x17'))(new Redis(config[_0x7875('0x15')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x7875('0x18'));var client=jayson[_0x7875('0x19')][_0x7875('0x1a')]({'port':0x232c});var client9002=jayson[_0x7875('0x19')][_0x7875('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x81b86a,_0x5eda68,_0x4bca00){if(_0x4bca00){var _0x472194=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x472194[_0x7875('0x1b')](_0x5eda68)){return _0x81b86a;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x81b86a;}}function respondWithRpcPromise(_0x567c31,_0x2d4ad8,_0x59d948,_0x367969){return new BPromise(function(_0x491f9a,_0x1cfbd8){var _0x2b26b9=_0x367969||client;return _0x2b26b9[_0x7875('0x1c')](_0x567c31,_0x59d948)[_0x7875('0x1d')](function(_0x2bd1fd){logger[_0x7875('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x2d4ad8,'request\x20sent');logger['debug'](_0x7875('0x1f'),_0x2d4ad8,_0x7875('0x20'),JSON[_0x7875('0x21')](_0x2bd1fd));if(_0x2bd1fd[_0x7875('0x22')]){if(_0x2bd1fd[_0x7875('0x22')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x2d4ad8,_0x2bd1fd['error'][_0x7875('0x23')]);return _0x1cfbd8(_0x2bd1fd['error'][_0x7875('0x23')]);}logger[_0x7875('0x22')](_0x7875('0x24'),_0x2d4ad8,_0x2bd1fd['error']['message']);return _0x491f9a(_0x2bd1fd[_0x7875('0x22')]['message']);}else{logger[_0x7875('0x1e')](_0x7875('0x24'),_0x2d4ad8,_0x7875('0x20'));_0x491f9a(_0x2bd1fd[_0x7875('0x25')][_0x7875('0x23')]);}})[_0x7875('0x26')](function(_0x3499f8){logger['error'](_0x7875('0x24'),_0x2d4ad8,_0x3499f8);_0x1cfbd8(_0x3499f8);});});}function respondWithStatusCode(_0x4f0d93,_0x1fd0fe){_0x1fd0fe=_0x1fd0fe||0xcc;return function(_0x17e6a0){if(_0x17e6a0){return _0x4f0d93['sendStatus'](_0x1fd0fe);}return _0x4f0d93['status'](_0x1fd0fe)['end']();};}function respondWithResult(_0x2c2fd3,_0x507abe){_0x507abe=_0x507abe||0xc8;return function(_0x5e17d5){if(_0x5e17d5){return _0x2c2fd3[_0x7875('0x27')](_0x507abe)['json'](_0x5e17d5);}};}function respondWithFilteredResult(_0x184b59,_0x5c38f5){return function(_0x5cef01){if(_0x5cef01){var _0x35dff1=_0x5cef01[_0x7875('0x28')],_0x2de45f=_0x5c38f5[_0x7875('0x29')],_0x10398d=_0x5c38f5[_0x7875('0x29')]+_0x5c38f5[_0x7875('0x2a')],_0x4454a1;if(_0x10398d>=_0x35dff1){_0x10398d=_0x35dff1;_0x4454a1=0xc8;}else{_0x4454a1=0xce;}_0x184b59[_0x7875('0x27')](_0x4454a1);return _0x184b59[_0x7875('0x2b')](_0x7875('0x2c'),_0x2de45f+'-'+_0x10398d+'/'+_0x35dff1)[_0x7875('0x2d')](_0x5cef01);}return null;};}function patchUpdates(_0x3b7975){return function(_0x511c3c){try{jsonpatch[_0x7875('0x2e')](_0x511c3c,_0x3b7975,!![]);}catch(_0x4844f1){return BPromise[_0x7875('0x2f')](_0x4844f1);}return _0x511c3c[_0x7875('0x30')]();};}function saveUpdates(_0x41c89d,_0x366524){return function(_0x185f0c){if(_0x185f0c){return _0x185f0c[_0x7875('0x31')](_0x41c89d)['then'](function(_0x11a93a){return _0x11a93a;});}return null;};}function removeEntity(_0x3aff2f,_0x472d1e){return function(_0x140d99){if(_0x140d99){return _0x140d99['destroy']()['then'](function(){_0x3aff2f[_0x7875('0x27')](0xcc)[_0x7875('0x32')]();});}};}function handleEntityNotFound(_0x5bc716,_0x507e97){return function(_0x1bd1d5){if(!_0x1bd1d5){_0x5bc716[_0x7875('0x33')](0x194);}return _0x1bd1d5;};}function handleError(_0xd78abb,_0x25ec83){_0x25ec83=_0x25ec83||0x1f4;return function(_0x1424ff){logger[_0x7875('0x22')](_0x1424ff[_0x7875('0x34')]);if(_0x1424ff[_0x7875('0x35')]){delete _0x1424ff[_0x7875('0x35')];}_0xd78abb[_0x7875('0x27')](_0x25ec83)[_0x7875('0x36')](_0x1424ff);};}exports[_0x7875('0x37')]=function(_0x5511c6,_0x2115f5){var _0x44f32e={},_0x37eec1={},_0x187972={'count':0x0,'rows':[]};var _0x2c761e=db[_0x7875('0x38')][_0x7875('0x39')];_0x37eec1[_0x7875('0x3a')]=_['keys'](_0x2c761e);_0x37eec1['query']=_[_0x7875('0x3b')](_0x5511c6[_0x7875('0x3c')]);_0x37eec1[_0x7875('0x3d')]=_[_0x7875('0x3e')](_0x37eec1[_0x7875('0x3a')],_0x37eec1[_0x7875('0x3c')]);_0x44f32e[_0x7875('0x3f')]=_[_0x7875('0x3e')](_0x37eec1['model'],qs[_0x7875('0x40')](_0x5511c6[_0x7875('0x3c')][_0x7875('0x40')]));_0x44f32e['attributes']=_0x44f32e[_0x7875('0x3f')][_0x7875('0x41')]?_0x44f32e[_0x7875('0x3f')]:_0x37eec1[_0x7875('0x3a')];if(!_0x5511c6[_0x7875('0x3c')]['hasOwnProperty'](_0x7875('0x42'))){_0x44f32e[_0x7875('0x2a')]=qs[_0x7875('0x2a')](_0x5511c6[_0x7875('0x3c')][_0x7875('0x2a')]);_0x44f32e[_0x7875('0x29')]=qs[_0x7875('0x29')](_0x5511c6[_0x7875('0x3c')]['offset']);}_0x44f32e['order']=qs[_0x7875('0x43')](_0x5511c6[_0x7875('0x3c')]['sort']);_0x44f32e[_0x7875('0x44')]=qs[_0x7875('0x3d')](_[_0x7875('0x45')](_0x5511c6['query'],_0x37eec1[_0x7875('0x3d')]));if(_0x5511c6['query']['filter']){_0x44f32e[_0x7875('0x44')]=_[_0x7875('0x46')](_0x44f32e[_0x7875('0x44')],{'$or':_['map'](_0x2c761e,function(_0x23ada6){if(_0x23ada6[_0x7875('0x47')][_0x7875('0x48')]!==_0x7875('0x49')){var _0x76e54e={};_0x76e54e[_0x23ada6['field']]={'$like':'%'+_0x5511c6[_0x7875('0x3c')][_0x7875('0x4a')]+'%'};return _0x76e54e;}})});}_0x44f32e=_[_0x7875('0x46')]({},_0x44f32e,_0x5511c6[_0x7875('0x4b')]);var _0x3d3f43={'where':_0x44f32e[_0x7875('0x44')]};return db[_0x7875('0x38')][_0x7875('0x28')](_0x3d3f43)[_0x7875('0x1d')](function(_0x4ea8ed){_0x187972['count']=_0x4ea8ed;if(_0x5511c6[_0x7875('0x3c')]['includeAll']){_0x44f32e[_0x7875('0x4c')]=[{'all':!![]}];}return db[_0x7875('0x38')]['findAll'](_0x44f32e);})[_0x7875('0x1d')](function(_0x5d5743){_0x187972[_0x7875('0x4d')]=_0x5d5743;return _0x187972;})['then'](respondWithFilteredResult(_0x2115f5,_0x44f32e))[_0x7875('0x26')](handleError(_0x2115f5,null));};exports[_0x7875('0x4e')]=function(_0x2208a8,_0x4dc674){var _0x37875b={'raw':!![],'where':{'id':_0x2208a8[_0x7875('0x4f')]['id']}},_0x49c840={};_0x49c840[_0x7875('0x3a')]=_[_0x7875('0x3b')](db[_0x7875('0x38')][_0x7875('0x39')]);_0x49c840['query']=_[_0x7875('0x3b')](_0x2208a8['query']);_0x49c840[_0x7875('0x3d')]=_['intersection'](_0x49c840[_0x7875('0x3a')],_0x49c840[_0x7875('0x3c')]);_0x37875b['attributes']=_[_0x7875('0x3e')](_0x49c840['model'],qs[_0x7875('0x40')](_0x2208a8[_0x7875('0x3c')][_0x7875('0x40')]));_0x37875b[_0x7875('0x3f')]=_0x37875b[_0x7875('0x3f')][_0x7875('0x41')]?_0x37875b['attributes']:_0x49c840[_0x7875('0x3a')];if(_0x2208a8[_0x7875('0x3c')][_0x7875('0x50')]){_0x37875b[_0x7875('0x4c')]=[{'all':!![]}];}_0x37875b=_['merge']({},_0x37875b,_0x2208a8[_0x7875('0x4b')]);return db[_0x7875('0x38')]['find'](_0x37875b)[_0x7875('0x1d')](handleEntityNotFound(_0x4dc674,null))['then'](respondWithResult(_0x4dc674,null))[_0x7875('0x26')](handleError(_0x4dc674,null));};exports[_0x7875('0x51')]=function(_0x15e6ae,_0x18922e){return db[_0x7875('0x38')][_0x7875('0x51')](_0x15e6ae[_0x7875('0x52')],{})['then'](respondWithResult(_0x18922e,0xc9))[_0x7875('0x26')](handleError(_0x18922e,null));};exports['update']=function(_0x4a8a7e,_0xa5b84d){if(_0x4a8a7e['body']['id']){delete _0x4a8a7e[_0x7875('0x52')]['id'];}return db[_0x7875('0x38')][_0x7875('0x53')]({'where':{'id':_0x4a8a7e[_0x7875('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa5b84d,null))[_0x7875('0x1d')](saveUpdates(_0x4a8a7e[_0x7875('0x52')],null))['then'](respondWithResult(_0xa5b84d,null))[_0x7875('0x26')](handleError(_0xa5b84d,null));};exports['destroy']=function(_0xdc76d0,_0x1fdfbc){return db[_0x7875('0x38')]['find']({'where':{'id':_0xdc76d0[_0x7875('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1fdfbc,null))[_0x7875('0x1d')](removeEntity(_0x1fdfbc,null))[_0x7875('0x26')](handleError(_0x1fdfbc,null));};exports[_0x7875('0x54')]=function(_0x2327fe,_0x169052){return db[_0x7875('0x38')][_0x7875('0x54')]()[_0x7875('0x1d')](respondWithResult(_0x169052,null))[_0x7875('0x26')](handleError(_0x169052,null));};var interaction_log=require(_0x7875('0x55'))(_0x7875('0x56'));exports[_0x7875('0x57')]=function(_0x15e796,_0x5b2dc2,_0x56444a){var _0x1e9dbd={'channel':_0x7875('0x58')};if(_0x15e796[_0x7875('0x52')]['id']){delete _0x15e796[_0x7875('0x52')]['id'];}_0x15e796[_0x7875('0x52')][_0x7875('0x59')]=!![];_0x15e796['body'][_0x7875('0x5a')]=moment()[_0x7875('0x5b')](_0x7875('0x5c'));_0x15e796['body']['UserId']=_0x15e796[_0x7875('0x52')][_0x7875('0x5d')]||_0x15e796[_0x7875('0x5e')]['id'];return db[_0x7875('0x38')][_0x7875('0x53')]({'where':{'id':_0x15e796[_0x7875('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0x7875('0x5f')],'as':_0x7875('0x60')}]})[_0x7875('0x1d')](handleEntityNotFound(_0x5b2dc2,null))[_0x7875('0x1d')](saveUpdates(_0x15e796['body'],null))[_0x7875('0x1d')](function(_0x1a174a){if(_0x1a174a){_0x1e9dbd['message']=_0x1a174a[_0x7875('0x61')]({'plain':!![]});return db[_0x7875('0x62')][_0x7875('0x53')]({'where':{'id':_0x1a174a[_0x7875('0x63')]}});}return null;})[_0x7875('0x1d')](handleEntityNotFound(_0x5b2dc2,null))[_0x7875('0x1d')](function(_0x30eb9e){if(_0x30eb9e){return _0x30eb9e[_0x7875('0x31')]({'UserId':_0x15e796[_0x7875('0x52')][_0x7875('0x5d')],'read1stAt':_['isNil'](_0x30eb9e['read1stAt'])?moment()[_0x7875('0x5b')](_0x7875('0x5c')):undefined});}return null;})[_0x7875('0x1d')](function(_0xefcde3){if(_0xefcde3){_0x1e9dbd[_0x7875('0x64')]=_0xefcde3['get']({'plain':!![]});interaction_log[_0x7875('0x1e')](_0x7875('0x65'),_0x15e796[_0x7875('0x5e')]['id'],_0x15e796['user'][_0x7875('0x35')],_0x15e796[_0x7875('0x5e')][_0x7875('0x66')],_0x1e9dbd[_0x7875('0x64')]['id'],_0x15e796['body']?JSON[_0x7875('0x21')](_0x15e796[_0x7875('0x52')]):_0x7875('0x67'));return respondWithRpcPromise(_0x7875('0x68'),_0x7875('0x69'),_0x1e9dbd);}return null;})[_0x7875('0x1d')](function(_0x1ba50d){if(_0x1ba50d){if(_0x15e796[_0x7875('0x52')][_0x7875('0x6a')]){_0x1e9dbd[_0x7875('0x23')][_0x7875('0x6b')]=util[_0x7875('0x5b')](_0x7875('0x6c'),_0x15e796['user'][_0x7875('0x35')]);_0x1e9dbd[_0x7875('0x23')]['channel']=_0x1e9dbd[_0x7875('0x6d')];_0x1e9dbd[_0x7875('0x23')][_0x7875('0x6e')]=_0x7875('0x57');return respondWithRpcPromise('EventManager',_0x7875('0x6f'),{'event':'acceptmessage','message':_0x1e9dbd[_0x7875('0x23')]},client9002)[_0x7875('0x1d')](function(){return _0x1e9dbd;});}return _0x1e9dbd;}return null;})[_0x7875('0x1d')](respondWithResult(_0x5b2dc2,null))[_0x7875('0x26')](handleError(_0x5b2dc2,null));};var interaction_log=require(_0x7875('0x55'))(_0x7875('0x56'));exports[_0x7875('0x2f')]=function(_0x24b0f5,_0xe88a7e,_0x4186d6){var _0xb0f2d0={'agent':{},'channel':_0x7875('0x58')};if(_0x24b0f5[_0x7875('0x52')]['id']){delete _0x24b0f5[_0x7875('0x52')]['id'];}_0x24b0f5[_0x7875('0x52')][_0x7875('0x5d')]=_0x24b0f5[_0x7875('0x52')]['UserId']||_0x24b0f5[_0x7875('0x5e')]['id'];_0xb0f2d0[_0x7875('0x70')]['id']=_0x24b0f5[_0x7875('0x52')][_0x7875('0x5d')];return db[_0x7875('0x38')][_0x7875('0x53')]({'where':{'id':_0x24b0f5['params']['id'],'UserId':null}})[_0x7875('0x1d')](handleEntityNotFound(_0xe88a7e,null))['then'](function(_0x4c8727){if(_0x4c8727){_0xb0f2d0[_0x7875('0x23')]=_0x4c8727['get']({'plain':!![]});return db[_0x7875('0x62')][_0x7875('0x53')]({'where':{'id':_0x4c8727[_0x7875('0x63')]}});}return null;})[_0x7875('0x1d')](handleEntityNotFound(_0xe88a7e,null))[_0x7875('0x1d')](function(_0x2fb6ba){if(_0x2fb6ba){_0xb0f2d0['interaction']=_0x2fb6ba['get']({'plain':!![]});interaction_log[_0x7875('0x1e')](_0x7875('0x71'),_0x24b0f5['user']['id'],_0x24b0f5[_0x7875('0x5e')]['name'],_0x24b0f5[_0x7875('0x5e')][_0x7875('0x66')],_0xb0f2d0[_0x7875('0x64')]['id'],_0x24b0f5[_0x7875('0x52')]?JSON[_0x7875('0x21')](_0x24b0f5[_0x7875('0x52')]):_0x7875('0x67'));return respondWithRpcPromise(_0x7875('0x72'),_0x7875('0x73'),_0xb0f2d0);}return null;})[_0x7875('0x1d')](function(_0x3d80cd){if(_0x3d80cd){_0x3d80cd['message'][_0x7875('0x6b')]=util[_0x7875('0x5b')]('SIP/%s',_0x24b0f5[_0x7875('0x5e')][_0x7875('0x35')]);_0x3d80cd[_0x7875('0x23')][_0x7875('0x6d')]=_0xb0f2d0[_0x7875('0x6d')];_0x3d80cd[_0x7875('0x23')]['event']=_0x7875('0x2f');respondWithRpcPromise('EventManager','EventManager',{'event':_0x7875('0x74'),'message':_0x3d80cd[_0x7875('0x23')]},client9002);return _0xb0f2d0;}return null;})['then'](respondWithResult(_0xe88a7e,null))[_0x7875('0x26')](handleError(_0xe88a7e,null));}; \ No newline at end of file +var _0x7796=['query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','create','body','update','find','describe','accept','openchannel','read','readAt','format','UserId','user','CmContact','OpenchannelInteractionId','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','agent','OpenchannelInteraction','get','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','jayson/promise','http','client','test','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','destroy','end','stack','name','send','index','OpenchannelMessage','rawAttributes','model','keys'];(function(_0x17cb36,_0x3cfc3e){var _0x3ae236=function(_0x47530f){while(--_0x47530f){_0x17cb36['push'](_0x17cb36['shift']());}};_0x3ae236(++_0x3cfc3e);}(_0x7796,0x11f));var _0x6779=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7796[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6779('0x0'));var rimraf=require(_0x6779('0x1'));var zipdir=require(_0x6779('0x2'));var jsonpatch=require(_0x6779('0x3'));var rp=require(_0x6779('0x4'));var moment=require('moment');var BPromise=require(_0x6779('0x5'));var Mustache=require('mustache');var util=require(_0x6779('0x6'));var path=require(_0x6779('0x7'));var sox=require(_0x6779('0x8'));var csv=require('to-csv');var ejs=require(_0x6779('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6779('0xa'));var jsforce=require(_0x6779('0xb'));var deskjs=require(_0x6779('0xc'));var toCsv=require(_0x6779('0xd'));var querystring=require(_0x6779('0xe'));var Papa=require('papaparse');var Redis=require(_0x6779('0xf'));var authService=require(_0x6779('0x10'));var qs=require(_0x6779('0x11'));var hardwareService=require(_0x6779('0x12'));var logger=require(_0x6779('0x13'))(_0x6779('0x14'));var utils=require(_0x6779('0x15'));var config=require(_0x6779('0x16'));var db=require(_0x6779('0x17'))['db'];config[_0x6779('0x18')]=_[_0x6779('0x19')](config[_0x6779('0x18')],{'host':_0x6779('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x6779('0x1b'));var client=jayson['client'][_0x6779('0x1c')]({'port':0x232c});var client9002=jayson[_0x6779('0x1d')][_0x6779('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2e2669,_0x37b6c4,_0x2687f8){if(_0x2687f8){var _0x5a68aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a68aa[_0x6779('0x1e')](_0x37b6c4)){return _0x2e2669;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2e2669;}}function respondWithRpcPromise(_0x17e3c8,_0x956783,_0x40b728,_0x3b98e1){return new BPromise(function(_0x54e278,_0x48d1c8){var _0x527cd4=_0x3b98e1||client;return _0x527cd4[_0x6779('0x1f')](_0x17e3c8,_0x40b728)[_0x6779('0x20')](function(_0x5b8211){logger['info'](_0x6779('0x21'),_0x956783,_0x6779('0x22'));logger[_0x6779('0x23')](_0x6779('0x24'),_0x956783,_0x6779('0x22'),JSON[_0x6779('0x25')](_0x5b8211));if(_0x5b8211[_0x6779('0x26')]){if(_0x5b8211[_0x6779('0x26')][_0x6779('0x27')]===0x1f4){logger['error'](_0x6779('0x21'),_0x956783,_0x5b8211['error'][_0x6779('0x28')]);return _0x48d1c8(_0x5b8211[_0x6779('0x26')][_0x6779('0x28')]);}logger[_0x6779('0x26')](_0x6779('0x21'),_0x956783,_0x5b8211[_0x6779('0x26')][_0x6779('0x28')]);return _0x54e278(_0x5b8211['error'][_0x6779('0x28')]);}else{logger[_0x6779('0x29')](_0x6779('0x21'),_0x956783,_0x6779('0x22'));_0x54e278(_0x5b8211[_0x6779('0x2a')][_0x6779('0x28')]);}})[_0x6779('0x2b')](function(_0x50e49d){logger['error'](_0x6779('0x21'),_0x956783,_0x50e49d);_0x48d1c8(_0x50e49d);});});}function respondWithStatusCode(_0x4f734f,_0x730ee5){_0x730ee5=_0x730ee5||0xcc;return function(_0xe0965a){if(_0xe0965a){return _0x4f734f[_0x6779('0x2c')](_0x730ee5);}return _0x4f734f[_0x6779('0x2d')](_0x730ee5)['end']();};}function respondWithResult(_0x446d1a,_0x13de81){_0x13de81=_0x13de81||0xc8;return function(_0x55899a){if(_0x55899a){return _0x446d1a[_0x6779('0x2d')](_0x13de81)[_0x6779('0x2e')](_0x55899a);}};}function respondWithFilteredResult(_0x4cf3d0,_0x2ac766){return function(_0x1eab1c){if(_0x1eab1c){var _0x7b3379=_0x1eab1c[_0x6779('0x2f')],_0x47a845=_0x2ac766[_0x6779('0x30')],_0x4186fc=_0x2ac766['offset']+_0x2ac766[_0x6779('0x31')],_0x26870c;if(_0x4186fc>=_0x7b3379){_0x4186fc=_0x7b3379;_0x26870c=0xc8;}else{_0x26870c=0xce;}_0x4cf3d0[_0x6779('0x2d')](_0x26870c);return _0x4cf3d0[_0x6779('0x32')]('Content-Range',_0x47a845+'-'+_0x4186fc+'/'+_0x7b3379)[_0x6779('0x2e')](_0x1eab1c);}return null;};}function patchUpdates(_0x2f8bb9){return function(_0xec9a1){try{jsonpatch[_0x6779('0x33')](_0xec9a1,_0x2f8bb9,!![]);}catch(_0x2719f4){return BPromise[_0x6779('0x34')](_0x2719f4);}return _0xec9a1[_0x6779('0x35')]();};}function saveUpdates(_0x386507,_0x3dbb6f){return function(_0x46e9f2){if(_0x46e9f2){return _0x46e9f2['update'](_0x386507)[_0x6779('0x20')](function(_0x11b4db){return _0x11b4db;});}return null;};}function removeEntity(_0x43efb1,_0x3b01a0){return function(_0x35882b){if(_0x35882b){return _0x35882b[_0x6779('0x36')]()['then'](function(){_0x43efb1[_0x6779('0x2d')](0xcc)[_0x6779('0x37')]();});}};}function handleEntityNotFound(_0x551252,_0x142acf){return function(_0x333c0f){if(!_0x333c0f){_0x551252[_0x6779('0x2c')](0x194);}return _0x333c0f;};}function handleError(_0x20a40d,_0x53c98a){_0x53c98a=_0x53c98a||0x1f4;return function(_0x49c16c){logger[_0x6779('0x26')](_0x49c16c[_0x6779('0x38')]);if(_0x49c16c[_0x6779('0x39')]){delete _0x49c16c['name'];}_0x20a40d[_0x6779('0x2d')](_0x53c98a)[_0x6779('0x3a')](_0x49c16c);};}exports[_0x6779('0x3b')]=function(_0x1b6d0b,_0x39d5be){var _0xe20a27={},_0x4266ba={},_0x5cdb63={'count':0x0,'rows':[]};var _0x5930e9=db[_0x6779('0x3c')][_0x6779('0x3d')];_0x4266ba[_0x6779('0x3e')]=_[_0x6779('0x3f')](_0x5930e9);_0x4266ba[_0x6779('0x40')]=_[_0x6779('0x3f')](_0x1b6d0b['query']);_0x4266ba[_0x6779('0x41')]=_[_0x6779('0x42')](_0x4266ba[_0x6779('0x3e')],_0x4266ba[_0x6779('0x40')]);_0xe20a27[_0x6779('0x43')]=_[_0x6779('0x42')](_0x4266ba[_0x6779('0x3e')],qs['fields'](_0x1b6d0b[_0x6779('0x40')][_0x6779('0x44')]));_0xe20a27[_0x6779('0x43')]=_0xe20a27[_0x6779('0x43')][_0x6779('0x45')]?_0xe20a27[_0x6779('0x43')]:_0x4266ba['model'];if(!_0x1b6d0b[_0x6779('0x40')]['hasOwnProperty'](_0x6779('0x46'))){_0xe20a27[_0x6779('0x31')]=qs['limit'](_0x1b6d0b['query'][_0x6779('0x31')]);_0xe20a27[_0x6779('0x30')]=qs[_0x6779('0x30')](_0x1b6d0b[_0x6779('0x40')][_0x6779('0x30')]);}_0xe20a27['order']=qs[_0x6779('0x47')](_0x1b6d0b['query'][_0x6779('0x47')]);_0xe20a27[_0x6779('0x48')]=qs['filters'](_[_0x6779('0x49')](_0x1b6d0b[_0x6779('0x40')],_0x4266ba[_0x6779('0x41')]));if(_0x1b6d0b[_0x6779('0x40')][_0x6779('0x4a')]){_0xe20a27[_0x6779('0x48')]=_[_0x6779('0x4b')](_0xe20a27[_0x6779('0x48')],{'$or':_['map'](_0x5930e9,function(_0x29f19c){if(_0x29f19c[_0x6779('0x4c')]['key']!==_0x6779('0x4d')){var _0x1c70af={};_0x1c70af[_0x29f19c['field']]={'$like':'%'+_0x1b6d0b[_0x6779('0x40')][_0x6779('0x4a')]+'%'};return _0x1c70af;}})});}_0xe20a27=_[_0x6779('0x4b')]({},_0xe20a27,_0x1b6d0b[_0x6779('0x4e')]);var _0x5c177a={'where':_0xe20a27[_0x6779('0x48')]};return db['OpenchannelMessage'][_0x6779('0x2f')](_0x5c177a)[_0x6779('0x20')](function(_0x2109e4){_0x5cdb63[_0x6779('0x2f')]=_0x2109e4;if(_0x1b6d0b[_0x6779('0x40')][_0x6779('0x4f')]){_0xe20a27[_0x6779('0x50')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6779('0x51')](_0xe20a27);})[_0x6779('0x20')](function(_0x714b1){_0x5cdb63['rows']=_0x714b1;return _0x5cdb63;})['then'](respondWithFilteredResult(_0x39d5be,_0xe20a27))[_0x6779('0x2b')](handleError(_0x39d5be,null));};exports[_0x6779('0x52')]=function(_0x300563,_0x57e125){var _0x4ccc7c={'raw':!![],'where':{'id':_0x300563[_0x6779('0x53')]['id']}},_0x417ebd={};_0x417ebd[_0x6779('0x3e')]=_['keys'](db[_0x6779('0x3c')][_0x6779('0x3d')]);_0x417ebd[_0x6779('0x40')]=_[_0x6779('0x3f')](_0x300563[_0x6779('0x40')]);_0x417ebd[_0x6779('0x41')]=_[_0x6779('0x42')](_0x417ebd[_0x6779('0x3e')],_0x417ebd[_0x6779('0x40')]);_0x4ccc7c[_0x6779('0x43')]=_[_0x6779('0x42')](_0x417ebd[_0x6779('0x3e')],qs[_0x6779('0x44')](_0x300563[_0x6779('0x40')][_0x6779('0x44')]));_0x4ccc7c['attributes']=_0x4ccc7c[_0x6779('0x43')][_0x6779('0x45')]?_0x4ccc7c[_0x6779('0x43')]:_0x417ebd[_0x6779('0x3e')];if(_0x300563[_0x6779('0x40')][_0x6779('0x4f')]){_0x4ccc7c[_0x6779('0x50')]=[{'all':!![]}];}_0x4ccc7c=_['merge']({},_0x4ccc7c,_0x300563[_0x6779('0x4e')]);return db['OpenchannelMessage']['find'](_0x4ccc7c)[_0x6779('0x20')](handleEntityNotFound(_0x57e125,null))[_0x6779('0x20')](respondWithResult(_0x57e125,null))[_0x6779('0x2b')](handleError(_0x57e125,null));};exports['create']=function(_0x154379,_0x1e67df){return db[_0x6779('0x3c')][_0x6779('0x54')](_0x154379[_0x6779('0x55')],{})[_0x6779('0x20')](respondWithResult(_0x1e67df,0xc9))[_0x6779('0x2b')](handleError(_0x1e67df,null));};exports[_0x6779('0x56')]=function(_0xbf1ebb,_0x172f0e){if(_0xbf1ebb[_0x6779('0x55')]['id']){delete _0xbf1ebb[_0x6779('0x55')]['id'];}return db[_0x6779('0x3c')][_0x6779('0x57')]({'where':{'id':_0xbf1ebb[_0x6779('0x53')]['id']}})['then'](handleEntityNotFound(_0x172f0e,null))[_0x6779('0x20')](saveUpdates(_0xbf1ebb[_0x6779('0x55')],null))['then'](respondWithResult(_0x172f0e,null))[_0x6779('0x2b')](handleError(_0x172f0e,null));};exports[_0x6779('0x36')]=function(_0x2bdbe0,_0x3f9383){return db[_0x6779('0x3c')][_0x6779('0x57')]({'where':{'id':_0x2bdbe0['params']['id']}})[_0x6779('0x20')](handleEntityNotFound(_0x3f9383,null))[_0x6779('0x20')](removeEntity(_0x3f9383,null))[_0x6779('0x2b')](handleError(_0x3f9383,null));};exports[_0x6779('0x58')]=function(_0x2c5cee,_0x484497){return db[_0x6779('0x3c')]['describe']()[_0x6779('0x20')](respondWithResult(_0x484497,null))[_0x6779('0x2b')](handleError(_0x484497,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x6779('0x59')]=function(_0x1e2e22,_0x562274,_0x27d220){var _0x416578={'channel':_0x6779('0x5a')};if(_0x1e2e22[_0x6779('0x55')]['id']){delete _0x1e2e22[_0x6779('0x55')]['id'];}_0x1e2e22[_0x6779('0x55')][_0x6779('0x5b')]=!![];_0x1e2e22[_0x6779('0x55')][_0x6779('0x5c')]=moment()[_0x6779('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e2e22[_0x6779('0x55')][_0x6779('0x5e')]=_0x1e2e22['body'][_0x6779('0x5e')]||_0x1e2e22[_0x6779('0x5f')]['id'];return db[_0x6779('0x3c')][_0x6779('0x57')]({'where':{'id':_0x1e2e22[_0x6779('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x6779('0x60')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x562274,null))[_0x6779('0x20')](saveUpdates(_0x1e2e22[_0x6779('0x55')],null))[_0x6779('0x20')](function(_0x34f874){if(_0x34f874){_0x416578['message']=_0x34f874['get']({'plain':!![]});return db['OpenchannelInteraction'][_0x6779('0x57')]({'where':{'id':_0x34f874[_0x6779('0x61')]}});}return null;})[_0x6779('0x20')](handleEntityNotFound(_0x562274,null))[_0x6779('0x20')](function(_0x1db6ba){if(_0x1db6ba){return _0x1db6ba[_0x6779('0x56')]({'UserId':_0x1e2e22[_0x6779('0x55')][_0x6779('0x5e')],'read1stAt':_['isNil'](_0x1db6ba['read1stAt'])?moment()[_0x6779('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6779('0x20')](function(_0x4187a2){if(_0x4187a2){_0x416578['interaction']=_0x4187a2['get']({'plain':!![]});interaction_log['info'](_0x6779('0x62'),_0x1e2e22[_0x6779('0x5f')]['id'],_0x1e2e22[_0x6779('0x5f')][_0x6779('0x39')],_0x1e2e22[_0x6779('0x5f')][_0x6779('0x63')],_0x416578[_0x6779('0x64')]['id'],_0x1e2e22[_0x6779('0x55')]?JSON[_0x6779('0x25')](_0x1e2e22[_0x6779('0x55')]):_0x6779('0x65'));return respondWithRpcPromise(_0x6779('0x66'),'acceptMessage',_0x416578);}return null;})['then'](function(_0x5324de){if(_0x5324de){if(_0x1e2e22['body'][_0x6779('0x67')]){_0x416578[_0x6779('0x28')][_0x6779('0x68')]=util['format'](_0x6779('0x69'),_0x1e2e22['user'][_0x6779('0x39')]);_0x416578[_0x6779('0x28')][_0x6779('0x6a')]=_0x416578[_0x6779('0x6a')];_0x416578[_0x6779('0x28')][_0x6779('0x6b')]='accept';return respondWithRpcPromise(_0x6779('0x6c'),_0x6779('0x6c'),{'event':_0x6779('0x6d'),'message':_0x416578[_0x6779('0x28')]},client9002)['then'](function(){return _0x416578;});}return _0x416578;}return null;})[_0x6779('0x20')](respondWithResult(_0x562274,null))[_0x6779('0x2b')](handleError(_0x562274,null));};var interaction_log=require(_0x6779('0x13'))(_0x6779('0x6e'));exports[_0x6779('0x34')]=function(_0x411dc3,_0x494a6a,_0x1f668d){var _0x3bdc49={'agent':{},'channel':_0x6779('0x5a')};if(_0x411dc3[_0x6779('0x55')]['id']){delete _0x411dc3['body']['id'];}_0x411dc3[_0x6779('0x55')][_0x6779('0x5e')]=_0x411dc3[_0x6779('0x55')][_0x6779('0x5e')]||_0x411dc3[_0x6779('0x5f')]['id'];_0x3bdc49[_0x6779('0x6f')]['id']=_0x411dc3[_0x6779('0x55')][_0x6779('0x5e')];return db['OpenchannelMessage'][_0x6779('0x57')]({'where':{'id':_0x411dc3['params']['id'],'UserId':null}})[_0x6779('0x20')](handleEntityNotFound(_0x494a6a,null))[_0x6779('0x20')](function(_0x20692c){if(_0x20692c){_0x3bdc49[_0x6779('0x28')]=_0x20692c['get']({'plain':!![]});return db[_0x6779('0x70')][_0x6779('0x57')]({'where':{'id':_0x20692c[_0x6779('0x61')]}});}return null;})[_0x6779('0x20')](handleEntityNotFound(_0x494a6a,null))[_0x6779('0x20')](function(_0x555741){if(_0x555741){_0x3bdc49[_0x6779('0x64')]=_0x555741[_0x6779('0x71')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x411dc3['user']['id'],_0x411dc3[_0x6779('0x5f')][_0x6779('0x39')],_0x411dc3[_0x6779('0x5f')][_0x6779('0x63')],_0x3bdc49[_0x6779('0x64')]['id'],_0x411dc3[_0x6779('0x55')]?JSON['stringify'](_0x411dc3[_0x6779('0x55')]):_0x6779('0x65'));return respondWithRpcPromise(_0x6779('0x72'),_0x6779('0x73'),_0x3bdc49);}return null;})[_0x6779('0x20')](function(_0x3573a8){if(_0x3573a8){_0x3573a8[_0x6779('0x28')][_0x6779('0x68')]=util[_0x6779('0x5d')](_0x6779('0x69'),_0x411dc3['user']['name']);_0x3573a8['message'][_0x6779('0x6a')]=_0x3bdc49[_0x6779('0x6a')];_0x3573a8[_0x6779('0x28')]['event']=_0x6779('0x34');respondWithRpcPromise(_0x6779('0x6c'),_0x6779('0x6c'),{'event':_0x6779('0x74'),'message':_0x3573a8[_0x6779('0x28')]},client9002);return _0x3bdc49;}return null;})[_0x6779('0x20')](respondWithResult(_0x494a6a,null))[_0x6779('0x2b')](handleError(_0x494a6a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 0dc075e..ba20c3c 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 _0x68cc=['exports','events','../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x50889e,_0xeb0acf){var _0x4d59db=function(_0x33ff5a){while(--_0x33ff5a){_0x50889e['push'](_0x50889e['shift']());}};_0x4d59db(++_0xeb0acf);}(_0x68cc,0xc1));var _0xc68c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x68cc[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0xc68c('0x0'));var OpenchannelMessage=require(_0xc68c('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xc68c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc68c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5a1553){return function(_0x5f2532,_0x132ce0,_0x3fca3d){OpenchannelMessageEvents[_0xc68c('0x4')](_0x5a1553+':'+_0x5f2532['id'],_0x5f2532);OpenchannelMessageEvents[_0xc68c('0x4')](_0x5a1553,_0x5f2532);_0x3fca3d(null);};}for(var e in events){if(events[_0xc68c('0x5')](e)){var event=events[e];OpenchannelMessage[_0xc68c('0x6')](e,emitEvent(event));}}module[_0xc68c('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x0eab=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','hook'];(function(_0x44fa75,_0xa7d5fc){var _0x178278=function(_0x4ff50a){while(--_0x4ff50a){_0x44fa75['push'](_0x44fa75['shift']());}};_0x178278(++_0xa7d5fc);}(_0x0eab,0xd9));var _0xb0ea=function(_0x34fc01,_0x46c582){_0x34fc01=_0x34fc01-0x0;var _0x4ca1dd=_0x0eab[_0x34fc01];return _0x4ca1dd;};'use strict';var EventEmitter=require(_0xb0ea('0x0'));var OpenchannelMessage=require(_0xb0ea('0x1'))['db'][_0xb0ea('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb0ea('0x3')](0x0);var events={'afterCreate':_0xb0ea('0x4'),'afterUpdate':_0xb0ea('0x5'),'afterDestroy':_0xb0ea('0x6')};function emitEvent(_0x2aafad){return function(_0x59213c,_0x31701d,_0x29083f){OpenchannelMessageEvents['emit'](_0x2aafad+':'+_0x59213c['id'],_0x59213c);OpenchannelMessageEvents['emit'](_0x2aafad,_0x59213c);_0x29083f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xb0ea('0x7')](e,emitEvent(event));}}module[_0xb0ea('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 33c7868..78a6c4f 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 _0x177b=['method','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','body','models','get','direction','toLowerCase','secret','UserId','OpenchannelInteraction','findOne','then','update','createdAt','catch','error','out','CmContact','describe','OpenchannelAccount','find','Interactions','OpenchannelInteractionId','keys','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','omit','Contact'];(function(_0x45f111,_0x3a1a4a){var _0x483508=function(_0x3131ab){while(--_0x3131ab){_0x45f111['push'](_0x45f111['shift']());}};_0x483508(++_0x3a1a4a);}(_0x177b,0x158));var _0xb177=function(_0x2c24df,_0x2e46a3){_0x2c24df=_0x2c24df-0x0;var _0x309b15=_0x177b[_0x2c24df];return _0x309b15;};'use strict';var _=require('lodash');var util=require(_0xb177('0x0'));var logger=require(_0xb177('0x1'))('api');var moment=require(_0xb177('0x2'));var BPromise=require(_0xb177('0x3'));var rp=require(_0xb177('0x4'));var fs=require('fs');var path=require(_0xb177('0x5'));var rimraf=require(_0xb177('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelMessage.attributes');module[_0xb177('0x7')]=function(_0x5c5840,_0x17f4d3){return _0x5c5840[_0xb177('0x8')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xb177('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3bf43b,_0x47a880,_0x15a77c){var _0x4d9b52=_0x5c5840[_0xb177('0xa')];var _0x3f20b4=_0x3bf43b[_0xb177('0xb')]({'plain':!![]});if(_0x3f20b4[_0xb177('0xc')]['toLowerCase']()==='in'||_0x3f20b4[_0xb177('0xc')][_0xb177('0xd')]()==='out'&&!_0x3f20b4[_0xb177('0xe')]&&!_['isNil'](_0x3f20b4[_0xb177('0xf')])){_0x4d9b52[_0xb177('0x10')][_0xb177('0x11')]({'where':{'id':_0x3f20b4['OpenchannelInteractionId']}})[_0xb177('0x12')](function(_0x2ad677){if(_0x2ad677){_0x2ad677[_0xb177('0x13')]({'lastMsgAt':_0x3f20b4[_0xb177('0x14')],'lastMsgDirection':_0x3f20b4[_0xb177('0xc')][_0xb177('0xd')]()});}})[_0xb177('0x15')](function(_0x354f11){console[_0xb177('0x16')](_0x354f11);});}if(_0x3f20b4[_0xb177('0xc')]===_0xb177('0x17')&&!_0x3f20b4[_0xb177('0xe')]){var _0xf671a5;_0x4d9b52[_0xb177('0x18')][_0xb177('0x19')]()['then'](function(_0x512061){return _0x4d9b52[_0xb177('0x1a')][_0xb177('0x1b')]({'where':{'id':_0x3f20b4['OpenchannelAccountId']},'include':[{'model':_0x4d9b52[_0xb177('0x10')],'as':_0xb177('0x1c'),'where':{'id':_0x3f20b4[_0xb177('0x1d')]},'limit':0x1,'include':[{'model':_0x4d9b52[_0xb177('0x18')],'as':'Contact','attributes':_[_0xb177('0x1e')](_0x512061)}]}]});})[_0xb177('0x12')](function(_0x25575c){_0xf671a5=_0x25575c[_0xb177('0xb')]({'plain':!![]});if(_0xf671a5&&_0xf671a5['replyUri']){logger[_0xb177('0x1f')](_0xb177('0x20'),_0xb177('0x21'),util[_0xb177('0x22')](_0xb177('0x23'),_0x3f20b4['id'],_0xf671a5[_0xb177('0x24')]));if(_0xf671a5[_0xb177('0x1c')]&&_0xf671a5[_0xb177('0x1c')][_0xb177('0x25')]){_0x3f20b4['Interaction']=_[_0xb177('0x26')](_0xf671a5['Interactions'][0x0],'Contact');_0x3f20b4[_0xb177('0x27')]=_0xf671a5[_0xb177('0x1c')][0x0][_0xb177('0x27')];}var _0x47a880={'method':'POST','uri':encodeURI(_0xf671a5[_0xb177('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x47a880[_0xb177('0x28')]){case'GET':_0x47a880['qs']=_0x3f20b4;break;case _0xb177('0x29'):_0x47a880[_0xb177('0x9')]=_0x3f20b4;break;}return rp(_0x47a880)[_0xb177('0x12')](function(_0x3f9123){logger[_0xb177('0x1f')](_0xb177('0x20'),_0xb177('0x21'),util[_0xb177('0x22')](_0xb177('0x2a'),_0x3f20b4['id'],_0xf671a5['replyUri']));if(_0x3f9123[_0xb177('0x9')][_0xb177('0x2b')]&&_0x3f9123[_0xb177('0x9')][_0xb177('0x2b')]!=_0x3f20b4[_0xb177('0x2c')][_0xb177('0x2b')]){return _0x4d9b52[_0xb177('0x10')]['update']({'threadId':_0x3f9123[_0xb177('0x9')][_0xb177('0x2b')]},{'logging':!![],'where':{'id':_0x3f20b4[_0xb177('0x2c')]['id']}});}else{return;}})[_0xb177('0x12')](function(){return _0x3bf43b[_0xb177('0x13')]({'read':!![]});})[_0xb177('0x15')](function(_0x3df073){logger[_0xb177('0x16')](_0xb177('0x20'),'afterCreate',util['inspect'](_0x3df073,{'showHidden':![],'depth':null}));_0x15a77c();});}else{_0x15a77c();}})[_0xb177('0x2d')](function(){_0x15a77c();});}else{_0x15a77c();}}},'charset':_0xb177('0x2e'),'collate':_0xb177('0x2f')});}; \ No newline at end of file +var _0xa54b=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','method','GET','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','body','models','get','direction','toLowerCase','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','keys','replyUri'];(function(_0xc14960,_0x16f1b9){var _0x574335=function(_0x555bfe){while(--_0x555bfe){_0xc14960['push'](_0xc14960['shift']());}};_0x574335(++_0x16f1b9);}(_0xa54b,0x76));var _0xba54=function(_0x5abfd0,_0x2019a){_0x5abfd0=_0x5abfd0-0x0;var _0x174135=_0xa54b[_0x5abfd0];return _0x174135;};'use strict';var _=require(_0xba54('0x0'));var util=require(_0xba54('0x1'));var logger=require(_0xba54('0x2'))(_0xba54('0x3'));var moment=require('moment');var BPromise=require(_0xba54('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba54('0x5'));var rimraf=require('rimraf');var config=require(_0xba54('0x6'));var attributes=require(_0xba54('0x7'));module[_0xba54('0x8')]=function(_0x4dadcc,_0x534898){return _0x4dadcc[_0xba54('0x9')](_0xba54('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xba54('0xb'),'fields':[_0xba54('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x17914d,_0x49b8d7,_0x4f1aa5){var _0x377610=_0x4dadcc[_0xba54('0xd')];var _0x1097c5=_0x17914d[_0xba54('0xe')]({'plain':!![]});if(_0x1097c5[_0xba54('0xf')]['toLowerCase']()==='in'||_0x1097c5['direction'][_0xba54('0x10')]()==='out'&&!_0x1097c5['secret']&&!_[_0xba54('0x11')](_0x1097c5[_0xba54('0x12')])){_0x377610[_0xba54('0x13')][_0xba54('0x14')]({'where':{'id':_0x1097c5[_0xba54('0x15')]}})[_0xba54('0x16')](function(_0x51d697){if(_0x51d697){_0x51d697[_0xba54('0x17')]({'lastMsgAt':_0x1097c5[_0xba54('0x18')],'lastMsgDirection':_0x1097c5[_0xba54('0xf')][_0xba54('0x10')]()});}})[_0xba54('0x19')](function(_0x3cfd4f){console[_0xba54('0x1a')](_0x3cfd4f);});}if(_0x1097c5[_0xba54('0xf')]===_0xba54('0x1b')&&!_0x1097c5[_0xba54('0x1c')]){var _0x9aab2;_0x377610[_0xba54('0x1d')][_0xba54('0x1e')]()['then'](function(_0x5259a5){return _0x377610[_0xba54('0x1f')][_0xba54('0x20')]({'where':{'id':_0x1097c5[_0xba54('0x21')]},'include':[{'model':_0x377610[_0xba54('0x13')],'as':_0xba54('0x22'),'where':{'id':_0x1097c5[_0xba54('0x15')]},'limit':0x1,'include':[{'model':_0x377610[_0xba54('0x1d')],'as':_0xba54('0x23'),'attributes':_[_0xba54('0x24')](_0x5259a5)}]}]});})[_0xba54('0x16')](function(_0x2c35ac){_0x9aab2=_0x2c35ac[_0xba54('0xe')]({'plain':!![]});if(_0x9aab2&&_0x9aab2[_0xba54('0x25')]){logger['info'](_0xba54('0x26'),_0xba54('0x27'),util['format'](_0xba54('0x28'),_0x1097c5['id'],_0x9aab2[_0xba54('0x25')]));if(_0x9aab2[_0xba54('0x22')]&&_0x9aab2[_0xba54('0x22')][_0xba54('0x29')]){_0x1097c5[_0xba54('0x2a')]=_[_0xba54('0x2b')](_0x9aab2[_0xba54('0x22')][0x0],'Contact');_0x1097c5[_0xba54('0x23')]=_0x9aab2[_0xba54('0x22')][0x0][_0xba54('0x23')];}var _0x49b8d7={'method':'POST','uri':encodeURI(_0x9aab2[_0xba54('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x49b8d7[_0xba54('0x2c')]){case _0xba54('0x2d'):_0x49b8d7['qs']=_0x1097c5;break;case'POST':_0x49b8d7[_0xba54('0xc')]=_0x1097c5;break;}return rp(_0x49b8d7)[_0xba54('0x16')](function(_0x1ec9f5){logger['info']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xba54('0x2e')](_0xba54('0x2f'),_0x1097c5['id'],_0x9aab2['replyUri']));if(_0x1ec9f5[_0xba54('0xc')][_0xba54('0x30')]&&_0x1ec9f5[_0xba54('0xc')][_0xba54('0x30')]!=_0x1097c5[_0xba54('0x2a')]['threadId']){return _0x377610[_0xba54('0x13')][_0xba54('0x17')]({'threadId':_0x1ec9f5[_0xba54('0xc')][_0xba54('0x30')]},{'logging':!![],'where':{'id':_0x1097c5[_0xba54('0x2a')]['id']}});}else{return;}})[_0xba54('0x16')](function(){return _0x17914d[_0xba54('0x17')]({'read':!![]});})['catch'](function(_0x169382){logger[_0xba54('0x1a')](_0xba54('0x26'),_0xba54('0x27'),util[_0xba54('0x31')](_0x169382,{'showHidden':![],'depth':null}));_0x4f1aa5();});}else{_0x4f1aa5();}})[_0xba54('0x32')](function(){_0x4f1aa5();});}else{_0x4f1aa5();}}},'charset':_0xba54('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index ec4c929..d8e9462 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 _0x4725=['http','defaults','socket.io-emitter','./openchannelMessage.socket','register','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','create','raw','CreateOpenchannelMessage','lodash','util','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3ab3ed,_0xa69161){var _0x10638e=function(_0x56139a){while(--_0x56139a){_0x3ab3ed['push'](_0x3ab3ed['shift']());}};_0x10638e(++_0xa69161);}(_0x4725,0x14a));var _0x5472=function(_0x35a196,_0xa8245){_0x35a196=_0x35a196-0x0;var _0x414586=_0x4725[_0x35a196];return _0x414586;};'use strict';var _=require(_0x5472('0x0'));var util=require(_0x5472('0x1'));var moment=require('moment');var BPromise=require(_0x5472('0x2'));var rs=require(_0x5472('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5472('0x4'))(_0x5472('0x5'));var config=require(_0x5472('0x6'));var jayson=require(_0x5472('0x7'));var client=jayson['client'][_0x5472('0x8')]({'port':0x232a});config['redis']=_[_0x5472('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5472('0xa'))(new Redis(config['redis']));require(_0x5472('0xb'))[_0x5472('0xc')](socket);function respondWithRpcPromise(_0x12d306,_0x54afc0,_0x4080a0){return new BPromise(function(_0x18b542,_0xb200dd){return client['request'](_0x12d306,_0x4080a0)[_0x5472('0xd')](function(_0x339742){logger[_0x5472('0xe')](_0x5472('0xf'),_0x54afc0,_0x5472('0x10'));logger[_0x5472('0x11')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x54afc0,_0x5472('0x10'),JSON[_0x5472('0x12')](_0x339742));if(_0x339742[_0x5472('0x13')]){if(_0x339742[_0x5472('0x13')][_0x5472('0x14')]===0x1f4){logger[_0x5472('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x54afc0,_0x339742[_0x5472('0x13')][_0x5472('0x15')]);return _0xb200dd(_0x339742[_0x5472('0x13')][_0x5472('0x15')]);}logger[_0x5472('0x13')](_0x5472('0xf'),_0x54afc0,_0x339742['error']['message']);return _0x18b542(_0x339742[_0x5472('0x13')][_0x5472('0x15')]);}else{logger[_0x5472('0xe')](_0x5472('0xf'),_0x54afc0,_0x5472('0x10'));_0x18b542(_0x339742['result'][_0x5472('0x15')]);}})[_0x5472('0x16')](function(_0x3cf8cd){logger[_0x5472('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x54afc0,_0x3cf8cd);_0xb200dd(_0x3cf8cd);});});}exports['CreateOpenchannelMessage']=function(_0x331f96){var _0xbbcb2d=this;return new Promise(function(_0x3202c1,_0x2ff801){return db['OpenchannelMessage'][_0x5472('0x17')](_0x331f96['body'],{'raw':_0x331f96['options']?_0x331f96['options'][_0x5472('0x18')]===undefined?!![]:![]:!![]})[_0x5472('0xd')](function(_0x3661c4){logger['info']('CreateOpenchannelMessage',_0x331f96);logger[_0x5472('0x11')](_0x5472('0x19'),_0x331f96,JSON[_0x5472('0x12')](_0x3661c4));_0x3202c1(_0x3661c4);})[_0x5472('0x16')](function(_0x41c76d){logger[_0x5472('0x13')](_0x5472('0x19'),_0x41c76d[_0x5472('0x15')],_0x331f96);_0x2ff801(_0xbbcb2d[_0x5472('0x13')](0x1f4,_0x41c76d['message']));});});}; \ No newline at end of file +var _0xeab8=['raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','defaults','redis','socket.io-emitter','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelMessage','OpenchannelMessage','create','body','options'];(function(_0x47d8b9,_0x6865e3){var _0x1af849=function(_0x58dd9a){while(--_0x58dd9a){_0x47d8b9['push'](_0x47d8b9['shift']());}};_0x1af849(++_0x6865e3);}(_0xeab8,0x156));var _0x8eab=function(_0x43dc7f,_0x4ae704){_0x43dc7f=_0x43dc7f-0x0;var _0x18b20c=_0xeab8[_0x43dc7f];return _0x18b20c;};'use strict';var _=require(_0x8eab('0x0'));var util=require(_0x8eab('0x1'));var moment=require(_0x8eab('0x2'));var BPromise=require(_0x8eab('0x3'));var rs=require(_0x8eab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eab('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8eab('0x6'))(_0x8eab('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8eab('0x8')]['http']({'port':0x232a});config['redis']=_[_0x8eab('0x9')](config[_0x8eab('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8eab('0xb'))(new Redis(config[_0x8eab('0xa')]));require('./openchannelMessage.socket')[_0x8eab('0xc')](socket);function respondWithRpcPromise(_0x285ebe,_0x45aa5b,_0x106541){return new BPromise(function(_0x4e19d0,_0xab18ae){return client[_0x8eab('0xd')](_0x285ebe,_0x106541)[_0x8eab('0xe')](function(_0x8145cb){logger[_0x8eab('0xf')](_0x8eab('0x10'),_0x45aa5b,_0x8eab('0x11'));logger[_0x8eab('0x12')](_0x8eab('0x13'),_0x45aa5b,'request\x20sent',JSON[_0x8eab('0x14')](_0x8145cb));if(_0x8145cb[_0x8eab('0x15')]){if(_0x8145cb['error'][_0x8eab('0x16')]===0x1f4){logger[_0x8eab('0x15')](_0x8eab('0x10'),_0x45aa5b,_0x8145cb[_0x8eab('0x15')][_0x8eab('0x17')]);return _0xab18ae(_0x8145cb[_0x8eab('0x15')][_0x8eab('0x17')]);}logger[_0x8eab('0x15')](_0x8eab('0x10'),_0x45aa5b,_0x8145cb[_0x8eab('0x15')][_0x8eab('0x17')]);return _0x4e19d0(_0x8145cb['error'][_0x8eab('0x17')]);}else{logger['info'](_0x8eab('0x10'),_0x45aa5b,_0x8eab('0x11'));_0x4e19d0(_0x8145cb['result'][_0x8eab('0x17')]);}})[_0x8eab('0x18')](function(_0x19eb20){logger[_0x8eab('0x15')](_0x8eab('0x10'),_0x45aa5b,_0x19eb20);_0xab18ae(_0x19eb20);});});}exports[_0x8eab('0x19')]=function(_0x149ff1){var _0x34bff7=this;return new Promise(function(_0x7f1912,_0x4e706f){return db[_0x8eab('0x1a')][_0x8eab('0x1b')](_0x149ff1[_0x8eab('0x1c')],{'raw':_0x149ff1['options']?_0x149ff1[_0x8eab('0x1d')][_0x8eab('0x1e')]===undefined?!![]:![]:!![]})[_0x8eab('0xe')](function(_0x500815){logger[_0x8eab('0xf')](_0x8eab('0x19'),_0x149ff1);logger[_0x8eab('0x12')](_0x8eab('0x19'),_0x149ff1,JSON[_0x8eab('0x14')](_0x500815));_0x7f1912(_0x500815);})[_0x8eab('0x18')](function(_0x578170){logger[_0x8eab('0x15')]('CreateOpenchannelMessage',_0x578170[_0x8eab('0x17')],_0x149ff1);_0x4e706f(_0x34bff7['error'](0x1f4,_0x578170[_0x8eab('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index eb4138a..8ef615e 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 _0x6c32=['remove','update','emit','removeListener','register','openchannelMessage:','./openchannelMessage.events','save'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0x6c32,0x6e));var _0x26c3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6c32[_0x321bb2];return _0x9c12ed;};'use strict';var OpenchannelMessageEvents=require(_0x26c3('0x0'));var events=[_0x26c3('0x1'),_0x26c3('0x2'),_0x26c3('0x3')];function createListener(_0x2bbfc4,_0x44fc8c){return function(_0x40cb8e){_0x44fc8c[_0x26c3('0x4')](_0x2bbfc4,_0x40cb8e);};}function removeListener(_0x36528a,_0x49d4a1){return function(){OpenchannelMessageEvents[_0x26c3('0x5')](_0x36528a,_0x49d4a1);};}exports[_0x26c3('0x6')]=function(_0x15ac36){for(var _0x57d915=0x0,_0x187b81=events['length'];_0x57d915<_0x187b81;_0x57d915++){var _0x3dde22=events[_0x57d915];var _0x3ff8e7=createListener(_0x26c3('0x7')+_0x3dde22,_0x15ac36);OpenchannelMessageEvents['on'](_0x3dde22,_0x3ff8e7);}}; \ No newline at end of file +var _0xb138=['update','removeListener','length','./openchannelMessage.events','save','remove'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xb138,0x1dd));var _0x8b13=function(_0x3913e2,_0x35f74a){_0x3913e2=_0x3913e2-0x0;var _0x3b63b7=_0xb138[_0x3913e2];return _0x3b63b7;};'use strict';var OpenchannelMessageEvents=require(_0x8b13('0x0'));var events=[_0x8b13('0x1'),_0x8b13('0x2'),_0x8b13('0x3')];function createListener(_0xadad70,_0x185752){return function(_0x20c65c){_0x185752['emit'](_0xadad70,_0x20c65c);};}function removeListener(_0x4411a0,_0x241acb){return function(){OpenchannelMessageEvents[_0x8b13('0x4')](_0x4411a0,_0x241acb);};}exports['register']=function(_0xd19a0f){for(var _0x13f7bd=0x0,_0x5d51b1=events[_0x8b13('0x5')];_0x13f7bd<_0x5d51b1;_0x13f7bd++){var _0x33d1a7=events[_0x13f7bd];var _0x22e157=createListener('openchannelMessage:'+_0x33d1a7,_0xd19a0f);OpenchannelMessageEvents['on'](_0x33d1a7,_0x22e157);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 901a1a2..3586b3e 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 _0xe653=['getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./openchannelQueue.controller','isAuthenticated','index','get','/:id','show'];(function(_0x414cae,_0x366766){var _0x175b1d=function(_0x582ba4){while(--_0x582ba4){_0x414cae['push'](_0x414cae['shift']());}};_0x175b1d(++_0x366766);}(_0xe653,0xe6));var _0x3e65=function(_0x1e52bf,_0x4cfa32){_0x1e52bf=_0x1e52bf-0x0;var _0x2fdc63=_0xe653[_0x1e52bf];return _0x2fdc63;};'use strict';var multer=require(_0x3e65('0x0'));var util=require(_0x3e65('0x1'));var path=require(_0x3e65('0x2'));var timeout=require(_0x3e65('0x3'));var express=require(_0x3e65('0x4'));var router=express[_0x3e65('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3e65('0x6'));var config=require('../../config/environment');var controller=require(_0x3e65('0x7'));router['get']('/',auth[_0x3e65('0x8')](),controller[_0x3e65('0x9')]);router[_0x3e65('0xa')]('/describe',auth[_0x3e65('0x8')](),controller['describe']);router[_0x3e65('0xa')](_0x3e65('0xb'),auth[_0x3e65('0x8')](),controller[_0x3e65('0xc')]);router[_0x3e65('0xa')]('/:id/members',auth[_0x3e65('0x8')](),controller[_0x3e65('0xd')]);router[_0x3e65('0xa')]('/:id/teams',auth[_0x3e65('0x8')](),controller[_0x3e65('0xe')]);router['get'](_0x3e65('0xf'),auth[_0x3e65('0x8')](),controller[_0x3e65('0x10')]);router[_0x3e65('0x11')]('/',auth[_0x3e65('0x8')](),controller[_0x3e65('0x12')]);router[_0x3e65('0x11')](_0x3e65('0x13'),auth[_0x3e65('0x8')](),controller['addTeams']);router[_0x3e65('0x11')]('/:id/users',auth[_0x3e65('0x8')](),controller[_0x3e65('0x14')]);router[_0x3e65('0x15')](_0x3e65('0xb'),auth[_0x3e65('0x8')](),controller[_0x3e65('0x16')]);router[_0x3e65('0x17')](_0x3e65('0xb'),auth[_0x3e65('0x8')](),controller[_0x3e65('0x18')]);router[_0x3e65('0x17')](_0x3e65('0x13'),auth[_0x3e65('0x8')](),controller[_0x3e65('0x19')]);router[_0x3e65('0x17')](_0x3e65('0xf'),auth['isAuthenticated'](),controller[_0x3e65('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xd258=['delete','util','path','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','/:id','update'];(function(_0x5b2a96,_0x58480b){var _0x1c743c=function(_0xc626f7){while(--_0xc626f7){_0x5b2a96['push'](_0x5b2a96['shift']());}};_0x1c743c(++_0x58480b);}(_0xd258,0x199));var _0x8d25=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd258[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x8d25('0x0'));var path=require(_0x8d25('0x1'));var timeout=require('connect-timeout');var express=require(_0x8d25('0x2'));var router=express[_0x8d25('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8d25('0x4'));var config=require(_0x8d25('0x5'));var controller=require(_0x8d25('0x6'));router[_0x8d25('0x7')]('/',auth[_0x8d25('0x8')](),controller['index']);router[_0x8d25('0x7')]('/describe',auth[_0x8d25('0x8')](),controller[_0x8d25('0x9')]);router[_0x8d25('0x7')]('/:id',auth[_0x8d25('0x8')](),controller[_0x8d25('0xa')]);router[_0x8d25('0x7')](_0x8d25('0xb'),auth[_0x8d25('0x8')](),controller[_0x8d25('0xc')]);router[_0x8d25('0x7')]('/:id/teams',auth[_0x8d25('0x8')](),controller[_0x8d25('0xd')]);router[_0x8d25('0x7')](_0x8d25('0xe'),auth[_0x8d25('0x8')](),controller['getAgents']);router[_0x8d25('0xf')]('/',auth['isAuthenticated'](),controller[_0x8d25('0x10')]);router['post'](_0x8d25('0x11'),auth['isAuthenticated'](),controller[_0x8d25('0x12')]);router['post'](_0x8d25('0xe'),auth[_0x8d25('0x8')](),controller[_0x8d25('0x13')]);router[_0x8d25('0x14')](_0x8d25('0x15'),auth['isAuthenticated'](),controller[_0x8d25('0x16')]);router[_0x8d25('0x17')](_0x8d25('0x15'),auth[_0x8d25('0x8')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x8d25('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index efc4ed0..9229610 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 _0x3fbf=['ENUM','rrmemory','beepall','roundrobin','name','INTEGER'];(function(_0x36093f,_0x289456){var _0xbe418c=function(_0x447163){while(--_0x447163){_0x36093f['push'](_0x36093f['shift']());}};_0xbe418c(++_0x289456);}(_0x3fbf,0x178));var _0xf3fb=function(_0x36147b,_0x57f40b){_0x36147b=_0x36147b-0x0;var _0x141351=_0x3fbf[_0x36147b];return _0x141351;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf3fb('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf3fb('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf3fb('0x2')](_0xf3fb('0x3'),_0xf3fb('0x4'),_0xf3fb('0x5'))}}; \ No newline at end of file +var _0x9d83=['roundrobin','sequelize','STRING','name','rrmemory','beepall'];(function(_0x155413,_0x1c89b4){var _0x434c71=function(_0x5b74a0){while(--_0x5b74a0){_0x155413['push'](_0x155413['shift']());}};_0x434c71(++_0x1c89b4);}(_0x9d83,0x127));var _0x39d8=function(_0x48a17b,_0x15fe4b){_0x48a17b=_0x48a17b-0x0;var _0x3170db=_0x9d83[_0x48a17b];return _0x3170db;};'use strict';var Sequelize=require(_0x39d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x39d8('0x1')],'unique':_0x39d8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x39d8('0x3'),_0x39d8('0x4'),_0x39d8('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 05fc1e9..6df8854 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 _0xa334=['limit','set','Content-Range','reject','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','OpenchannelQueue','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','field','options','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','openchannelPause','getTeams','findOne','Team','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','each','forEach','userOpenchannelQueue:save','removeTeams','ids','select','team_has_openchannel_queues','join','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa334,0xe7));var _0x4a33=function(_0x4a6009,_0x155ab3){_0x4a6009=_0x4a6009-0x0;var _0x48978b=_0xa334[_0x4a6009];return _0x48978b;};'use strict';var pdf=require(_0x4a33('0x0'));var emlformat=require(_0x4a33('0x1'));var rimraf=require(_0x4a33('0x2'));var zipdir=require(_0x4a33('0x3'));var jsonpatch=require(_0x4a33('0x4'));var rp=require(_0x4a33('0x5'));var moment=require(_0x4a33('0x6'));var BPromise=require(_0x4a33('0x7'));var Mustache=require('mustache');var util=require(_0x4a33('0x8'));var path=require(_0x4a33('0x9'));var sox=require(_0x4a33('0xa'));var csv=require('to-csv');var ejs=require(_0x4a33('0xb'));var fs=require('fs');var _=require(_0x4a33('0xc'));var squel=require('squel');var crypto=require(_0x4a33('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a33('0xe'));var toCsv=require(_0x4a33('0xf'));var querystring=require(_0x4a33('0x10'));var Papa=require(_0x4a33('0x11'));var Redis=require(_0x4a33('0x12'));var authService=require(_0x4a33('0x13'));var qs=require(_0x4a33('0x14'));var hardwareService=require(_0x4a33('0x15'));var logger=require('../../config/logger')(_0x4a33('0x16'));var utils=require('../../config/utils');var config=require(_0x4a33('0x17'));var db=require(_0x4a33('0x18'))['db'];config[_0x4a33('0x19')]=_[_0x4a33('0x1a')](config[_0x4a33('0x19')],{'host':_0x4a33('0x1b'),'port':0x18eb});var socket=require(_0x4a33('0x1c'))(new Redis(config['redis']));require(_0x4a33('0x1d'))[_0x4a33('0x1e')](socket);function respondWithStatusCode(_0xf435e8,_0x28eb0a){_0x28eb0a=_0x28eb0a||0xcc;return function(_0x385e6a){if(_0x385e6a){return _0xf435e8[_0x4a33('0x1f')](_0x28eb0a);}return _0xf435e8[_0x4a33('0x20')](_0x28eb0a)[_0x4a33('0x21')]();};}function respondWithResult(_0x54ad7d,_0x290fa6){_0x290fa6=_0x290fa6||0xc8;return function(_0xfc5ecb){if(_0xfc5ecb){return _0x54ad7d['status'](_0x290fa6)[_0x4a33('0x22')](_0xfc5ecb);}};}function respondWithFilteredResult(_0xb96887,_0x4243ed){return function(_0x24b077){if(_0x24b077){var _0x2b672b=_0x24b077[_0x4a33('0x23')],_0x400d97=_0x4243ed[_0x4a33('0x24')],_0x53a68a=_0x4243ed[_0x4a33('0x24')]+_0x4243ed[_0x4a33('0x25')],_0x328a96;if(_0x53a68a>=_0x2b672b){_0x53a68a=_0x2b672b;_0x328a96=0xc8;}else{_0x328a96=0xce;}_0xb96887[_0x4a33('0x20')](_0x328a96);return _0xb96887[_0x4a33('0x26')](_0x4a33('0x27'),_0x400d97+'-'+_0x53a68a+'/'+_0x2b672b)[_0x4a33('0x22')](_0x24b077);}return null;};}function patchUpdates(_0x1d8237){return function(_0x477b9e){try{jsonpatch['apply'](_0x477b9e,_0x1d8237,!![]);}catch(_0x15846e){return BPromise[_0x4a33('0x28')](_0x15846e);}return _0x477b9e['save']();};}function saveUpdates(_0x4ec653,_0x491b5b){return function(_0x116fbf){if(_0x116fbf){return _0x116fbf['update'](_0x4ec653)[_0x4a33('0x29')](function(_0x1edcf6){return _0x1edcf6;});}return null;};}function removeEntity(_0x6be8e8,_0x59bdd5){return function(_0x5658bd){if(_0x5658bd){return _0x5658bd[_0x4a33('0x2a')]()['then'](function(){var _0x4eff89=_0x5658bd[_0x4a33('0x2b')]({'plain':!![]});var _0x19b602=_0x4a33('0x2c');return db[_0x4a33('0x2d')][_0x4a33('0x2a')]({'where':{'type':_0x19b602,'resourceId':_0x4eff89['id']}})[_0x4a33('0x29')](function(){return _0x5658bd;});})[_0x4a33('0x29')](function(){_0x6be8e8[_0x4a33('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x143dea,_0x42ff34){return function(_0x559ae6){if(!_0x559ae6){_0x143dea[_0x4a33('0x1f')](0x194);}return _0x559ae6;};}function handleError(_0x5bb852,_0x1343cf){_0x1343cf=_0x1343cf||0x1f4;return function(_0x237a44){logger[_0x4a33('0x2e')](_0x237a44['stack']);if(_0x237a44[_0x4a33('0x2f')]){delete _0x237a44['name'];}_0x5bb852['status'](_0x1343cf)['send'](_0x237a44);};}exports['index']=function(_0x246b74,_0x207001){var _0x35b193={},_0x5d8e12={},_0x54c5ea={'count':0x0,'rows':[]};var _0xcce1e9=db[_0x4a33('0x30')][_0x4a33('0x31')];_0x5d8e12[_0x4a33('0x32')]=_['keys'](_0xcce1e9);_0x5d8e12[_0x4a33('0x33')]=_[_0x4a33('0x34')](_0x246b74[_0x4a33('0x33')]);_0x5d8e12[_0x4a33('0x35')]=_['intersection'](_0x5d8e12['model'],_0x5d8e12['query']);_0x35b193[_0x4a33('0x36')]=_[_0x4a33('0x37')](_0x5d8e12[_0x4a33('0x32')],qs[_0x4a33('0x38')](_0x246b74[_0x4a33('0x33')][_0x4a33('0x38')]));_0x35b193[_0x4a33('0x36')]=_0x35b193[_0x4a33('0x36')][_0x4a33('0x39')]?_0x35b193[_0x4a33('0x36')]:_0x5d8e12['model'];if(!_0x246b74[_0x4a33('0x33')][_0x4a33('0x3a')]('nolimit')){_0x35b193['limit']=qs[_0x4a33('0x25')](_0x246b74[_0x4a33('0x33')][_0x4a33('0x25')]);_0x35b193[_0x4a33('0x24')]=qs[_0x4a33('0x24')](_0x246b74[_0x4a33('0x33')][_0x4a33('0x24')]);}_0x35b193[_0x4a33('0x3b')]=qs[_0x4a33('0x3c')](_0x246b74[_0x4a33('0x33')][_0x4a33('0x3c')]);_0x35b193[_0x4a33('0x3d')]=qs[_0x4a33('0x35')](_[_0x4a33('0x3e')](_0x246b74['query'],_0x5d8e12[_0x4a33('0x35')]));if(_0x246b74['query'][_0x4a33('0x3f')]){_0x35b193[_0x4a33('0x3d')]=_[_0x4a33('0x40')](_0x35b193[_0x4a33('0x3d')],{'$or':_[_0x4a33('0x41')](_0xcce1e9,function(_0x5d72fc){if(_0x5d72fc[_0x4a33('0x42')]['key']!=='VIRTUAL'){var _0x583c5e={};_0x583c5e[_0x5d72fc[_0x4a33('0x43')]]={'$like':'%'+_0x246b74['query'][_0x4a33('0x3f')]+'%'};return _0x583c5e;}})});}_0x35b193=_[_0x4a33('0x40')]({},_0x35b193,_0x246b74[_0x4a33('0x44')]);var _0x69e749={'where':_0x35b193[_0x4a33('0x3d')]};return db['OpenchannelQueue']['count'](_0x69e749)['then'](function(_0x16923d){_0x54c5ea[_0x4a33('0x23')]=_0x16923d;if(_0x246b74[_0x4a33('0x33')]['includeAll']){_0x35b193['include']=[{'all':!![]}];}return db[_0x4a33('0x30')][_0x4a33('0x45')](_0x35b193);})['then'](function(_0x3734b2){_0x54c5ea[_0x4a33('0x46')]=_0x3734b2;return _0x54c5ea;})[_0x4a33('0x29')](respondWithFilteredResult(_0x207001,_0x35b193))[_0x4a33('0x47')](handleError(_0x207001,null));};exports[_0x4a33('0x48')]=function(_0x1214b1,_0x451494){var _0x370d35={'raw':!![],'where':{'id':_0x1214b1[_0x4a33('0x49')]['id']}},_0x2b22b7={};_0x2b22b7[_0x4a33('0x32')]=_[_0x4a33('0x34')](db[_0x4a33('0x30')][_0x4a33('0x31')]);_0x2b22b7['query']=_[_0x4a33('0x34')](_0x1214b1[_0x4a33('0x33')]);_0x2b22b7['filters']=_[_0x4a33('0x37')](_0x2b22b7[_0x4a33('0x32')],_0x2b22b7[_0x4a33('0x33')]);_0x370d35[_0x4a33('0x36')]=_[_0x4a33('0x37')](_0x2b22b7[_0x4a33('0x32')],qs['fields'](_0x1214b1[_0x4a33('0x33')][_0x4a33('0x38')]));_0x370d35[_0x4a33('0x36')]=_0x370d35[_0x4a33('0x36')]['length']?_0x370d35['attributes']:_0x2b22b7['model'];if(_0x1214b1[_0x4a33('0x33')][_0x4a33('0x4a')]){_0x370d35['include']=[{'all':!![]}];}_0x370d35=_['merge']({},_0x370d35,_0x1214b1[_0x4a33('0x44')]);return db[_0x4a33('0x30')][_0x4a33('0x4b')](_0x370d35)[_0x4a33('0x29')](handleEntityNotFound(_0x451494,null))[_0x4a33('0x29')](respondWithResult(_0x451494,null))[_0x4a33('0x47')](handleError(_0x451494,null));};exports[_0x4a33('0x4c')]=function(_0x503a40,_0x59e57d){return db[_0x4a33('0x30')][_0x4a33('0x4c')](_0x503a40['body'],{})[_0x4a33('0x29')](function(_0x4b3584){var _0x2a57b2=_0x503a40[_0x4a33('0x4d')][_0x4a33('0x2b')]({'plain':!![]});if(!_0x2a57b2)throw new Error(_0x4a33('0x4e'));if(_0x2a57b2[_0x4a33('0x4f')]==='user'){var _0x26ecf8=_0x4b3584[_0x4a33('0x2b')]({'plain':!![]});var _0x3141c3=_0x4a33('0x2c');return db[_0x4a33('0x50')][_0x4a33('0x4b')]({'where':{'name':_0x3141c3,'userProfileId':_0x2a57b2['userProfileId']},'raw':!![]})[_0x4a33('0x29')](function(_0x40ea58){if(_0x40ea58&&_0x40ea58[_0x4a33('0x51')]===0x0){return db[_0x4a33('0x2d')]['create']({'name':_0x26ecf8['name'],'resourceId':_0x26ecf8['id'],'type':_0x40ea58[_0x4a33('0x2f')],'sectionId':_0x40ea58['id']},{})['then'](function(){return _0x4b3584;});}else{return _0x4b3584;}})[_0x4a33('0x47')](function(_0x12096d){logger[_0x4a33('0x2e')](_0x4a33('0x52'),_0x12096d);throw _0x12096d;});}return _0x4b3584;})[_0x4a33('0x29')](respondWithResult(_0x59e57d,0xc9))['catch'](handleError(_0x59e57d,null));};exports[_0x4a33('0x53')]=function(_0x16fd9f,_0x362337){if(_0x16fd9f[_0x4a33('0x54')]['id']){delete _0x16fd9f[_0x4a33('0x54')]['id'];}return db['OpenchannelQueue'][_0x4a33('0x4b')]({'where':{'id':_0x16fd9f[_0x4a33('0x49')]['id']}})[_0x4a33('0x29')](handleEntityNotFound(_0x362337,null))[_0x4a33('0x29')](saveUpdates(_0x16fd9f[_0x4a33('0x54')],null))[_0x4a33('0x29')](respondWithResult(_0x362337,null))[_0x4a33('0x47')](handleError(_0x362337,null));};exports[_0x4a33('0x2a')]=function(_0x3690c2,_0x364551){return db[_0x4a33('0x30')]['find']({'where':{'id':_0x3690c2[_0x4a33('0x49')]['id']}})[_0x4a33('0x29')](handleEntityNotFound(_0x364551,null))[_0x4a33('0x29')](removeEntity(_0x364551,null))[_0x4a33('0x47')](handleError(_0x364551,null));};exports[_0x4a33('0x55')]=function(_0x100461,_0x155a7f){return db[_0x4a33('0x30')]['describe']()[_0x4a33('0x29')](respondWithResult(_0x155a7f,null))[_0x4a33('0x47')](handleError(_0x155a7f,null));};exports[_0x4a33('0x56')]=function(_0x617490,_0x2e48b2,_0xcaa1f0){var _0x5a8906={'raw':!![],'where':{}},_0x3162e7={},_0x18c2ff;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x617490[_0x4a33('0x49')]['id']}})[_0x4a33('0x29')](handleEntityNotFound(_0x2e48b2,null))[_0x4a33('0x29')](function(_0x5e8562){if(_0x5e8562){_0x18c2ff=_0x5e8562[_0x4a33('0x2b')]({'plain':!![]});_0x3162e7['model']=_['keys'](db[_0x4a33('0x57')][_0x4a33('0x31')]);_0x3162e7[_0x4a33('0x33')]=_[_0x4a33('0x34')](_0x617490[_0x4a33('0x33')]);_0x3162e7[_0x4a33('0x35')]=_[_0x4a33('0x37')](_0x3162e7[_0x4a33('0x32')],_0x3162e7[_0x4a33('0x33')]);_0x5a8906['attributes']=_[_0x4a33('0x37')](_0x3162e7[_0x4a33('0x32')],qs['fields'](_0x617490[_0x4a33('0x33')][_0x4a33('0x38')]));_0x5a8906[_0x4a33('0x36')]=_0x5a8906['attributes'][_0x4a33('0x39')]?_0x5a8906[_0x4a33('0x36')]:_0x3162e7['model'];if(!_0x617490['query'][_0x4a33('0x3a')](_0x4a33('0x58'))){_0x5a8906[_0x4a33('0x25')]=qs[_0x4a33('0x25')](_0x617490[_0x4a33('0x33')]['limit']);_0x5a8906[_0x4a33('0x24')]=qs['offset'](_0x617490[_0x4a33('0x33')][_0x4a33('0x24')]);}_0x5a8906[_0x4a33('0x3b')]=qs[_0x4a33('0x3c')](_0x617490[_0x4a33('0x33')][_0x4a33('0x3c')]);_0x5a8906[_0x4a33('0x3d')]=qs[_0x4a33('0x35')](_['pick'](_0x617490[_0x4a33('0x33')],_0x3162e7[_0x4a33('0x35')]));_0x5a8906[_0x4a33('0x3d')][_0x4a33('0x59')]=_0x5e8562['id'];if(_0x617490[_0x4a33('0x33')][_0x4a33('0x3f')]){_0x5a8906[_0x4a33('0x3d')]=_[_0x4a33('0x40')](_0x5a8906[_0x4a33('0x3d')],{'$or':_[_0x4a33('0x41')](_0x5a8906[_0x4a33('0x36')],function(_0x54c078){var _0x4aec52={};_0x4aec52[_0x54c078]={'$like':'%'+_0x617490[_0x4a33('0x33')][_0x4a33('0x3f')]+'%'};return _0x4aec52;})});}_0x5a8906=_[_0x4a33('0x40')]({},_0x5a8906,_0x617490[_0x4a33('0x44')]);return db[_0x4a33('0x57')]['findAll'](_0x5a8906);}})[_0x4a33('0x29')](function(_0xba3df3){if(_0xba3df3){return db[_0x4a33('0x5a')][_0x4a33('0x5b')]({'where':{'id':_[_0x4a33('0x41')](_0xba3df3,_0x4a33('0x5c')),'role':_0x4a33('0x5d')},'attributes':['id',_0x4a33('0x2f'),'openchannelPause',_0x4a33('0x5e'),_0x4a33('0x5f')]});}})[_0x4a33('0x29')](function(_0x44f5b3){if(_0x44f5b3){return{'count':_0x44f5b3[_0x4a33('0x23')],'rows':_[_0x4a33('0x41')](_0x44f5b3[_0x4a33('0x46')],function(_0x40d4ea){return{'membername':_0x40d4ea[_0x4a33('0x2f')],'UserId':_0x40d4ea['id'],'queue_name':_0x18c2ff['name'],'OpenchannelQueueId':_0x18c2ff['id'],'interface':util[_0x4a33('0x60')]('%s/%s',_0x4a33('0x61'),_0x40d4ea[_0x4a33('0x2f')]),'penalty':0x0,'paused':_0x40d4ea[_0x4a33('0x62')],'createdAt':_0x40d4ea[_0x4a33('0x5f')],'updatedAt':_0x40d4ea[_0x4a33('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2e48b2,_0x5a8906))[_0x4a33('0x47')](handleError(_0x2e48b2,null));};exports[_0x4a33('0x63')]=function(_0x1d9b98,_0x1a2cef,_0xa206bb){var _0x1938a8={};var _0x22b4d4={};var _0x3d9dfc;var _0x33eb13;return db['OpenchannelQueue'][_0x4a33('0x64')]({'where':{'id':_0x1d9b98[_0x4a33('0x49')]['id']}})[_0x4a33('0x29')](handleEntityNotFound(_0x1a2cef,null))['then'](function(_0x14b690){if(_0x14b690){_0x3d9dfc=_0x14b690;_0x22b4d4['model']=_[_0x4a33('0x34')](db[_0x4a33('0x65')]['rawAttributes']);_0x22b4d4[_0x4a33('0x33')]=_[_0x4a33('0x34')](_0x1d9b98[_0x4a33('0x33')]);_0x22b4d4['filters']=_[_0x4a33('0x37')](_0x22b4d4[_0x4a33('0x32')],_0x22b4d4[_0x4a33('0x33')]);_0x1938a8[_0x4a33('0x36')]=_[_0x4a33('0x37')](_0x22b4d4[_0x4a33('0x32')],qs['fields'](_0x1d9b98[_0x4a33('0x33')][_0x4a33('0x38')]));_0x1938a8[_0x4a33('0x36')]=_0x1938a8['attributes'][_0x4a33('0x39')]?_0x1938a8[_0x4a33('0x36')]:_0x22b4d4[_0x4a33('0x32')];_0x1938a8['order']=qs['sort'](_0x1d9b98['query'][_0x4a33('0x3c')]);_0x1938a8['where']=qs[_0x4a33('0x35')](_['pick'](_0x1d9b98[_0x4a33('0x33')],_0x22b4d4['filters']));if(_0x1d9b98[_0x4a33('0x33')][_0x4a33('0x3f')]){_0x1938a8[_0x4a33('0x3d')]=_['merge'](_0x1938a8['where'],{'$or':_[_0x4a33('0x41')](_0x1938a8['attributes'],function(_0x217b8d){var _0x521311={};_0x521311[_0x217b8d]={'$like':'%'+_0x1d9b98[_0x4a33('0x33')][_0x4a33('0x3f')]+'%'};return _0x521311;})});}_0x1938a8=_[_0x4a33('0x40')]({},_0x1938a8,_0x1d9b98['options']);return _0x3d9dfc[_0x4a33('0x63')](_0x1938a8);}})[_0x4a33('0x29')](function(_0x5c3473){if(_0x5c3473){_0x33eb13=_0x5c3473[_0x4a33('0x39')];if(!_0x1d9b98['query'][_0x4a33('0x3a')](_0x4a33('0x58'))){_0x1938a8['limit']=qs[_0x4a33('0x25')](_0x1d9b98[_0x4a33('0x33')][_0x4a33('0x25')]);_0x1938a8[_0x4a33('0x24')]=qs[_0x4a33('0x24')](_0x1d9b98['query'][_0x4a33('0x24')]);}return _0x3d9dfc[_0x4a33('0x63')](_0x1938a8);}})[_0x4a33('0x29')](function(_0x33df66){if(_0x33df66){return _0x33df66?{'count':_0x33eb13,'rows':_0x33df66}:null;}})['then'](respondWithResult(_0x1a2cef,null))['catch'](handleError(_0x1a2cef,null));};exports['addTeams']=function(_0x1f84a0,_0x29a929,_0xc90f8c){var _0x2b5d4a=_0x1f84a0['body']['teams'];return db['Team'][_0x4a33('0x45')]({'where':{'id':_[_0x4a33('0x41')](_0x2b5d4a,'id')},'attributes':['id'],'include':[{'model':db[_0x4a33('0x5a')],'as':'Agents','attributes':['id',_0x4a33('0x2f'),'online',_0x4a33('0x66'),_0x4a33('0x67')],'raw':!![]}]})['then'](function(_0xd96173){if(_0xd96173){var _0x3404c2=_[_0x4a33('0x68')](_0xd96173,function(_0x2ebb21){var _0x21bebf=_0x2ebb21[_0x4a33('0x2b')]({'plain':!![]});return _0x21bebf[_0x4a33('0x69')];});return db[_0x4a33('0x30')]['find']({'where':{'id':_0x1f84a0[_0x4a33('0x49')]['id']}})[_0x4a33('0x29')](function(_0x4b6759){return db[_0x4a33('0x6a')][_0x4a33('0x6b')](function(_0x7444a6){return _0x4b6759[_0x4a33('0x6c')](_[_0x4a33('0x41')](_0x2b5d4a,'id'),{'transaction':_0x7444a6})[_0x4a33('0x29')](function(){return BPromise[_0x4a33('0x6d')](_0x3404c2,function(_0x374a3e){return db[_0x4a33('0x57')]['findOrCreate']({'where':{'UserId':_0x374a3e['id'],'OpenchannelQueueId':_0x1f84a0[_0x4a33('0x49')]['id']},'transaction':_0x7444a6});});})['then'](function(){_0x3404c2[_0x4a33('0x6e')](function(_0x3ade24){socket['emit'](_0x4a33('0x6f'),{'UserId':_0x3ade24['id'],'OpenchannelQueueId':_0x4b6759['id']});});});});});}})[_0x4a33('0x29')](respondWithStatusCode(_0x29a929,null))[_0x4a33('0x47')](handleError(_0x29a929,null));};exports[_0x4a33('0x70')]=function(_0x28fe29,_0x20d2a5,_0x558951){return db[_0x4a33('0x65')][_0x4a33('0x45')]({'where':{'id':_0x28fe29[_0x4a33('0x33')][_0x4a33('0x71')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4a33('0x69'),'attributes':['id'],'raw':!![]}]})[_0x4a33('0x29')](handleEntityNotFound(_0x20d2a5,null))[_0x4a33('0x29')](function(_0x2a0c33){var _0x1b53e4=_[_0x4a33('0x41')](_0x2a0c33,'id');var _0x4d1676=[];var _0x3a9dc6=[];var _0x46be21=squel[_0x4a33('0x72')]();_0x46be21['field']('tq.TeamId')['from'](_0x4a33('0x73'),'tq')[_0x4a33('0x74')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4a33('0x3d')]('OpenchannelQueueId\x20=\x20?',_0x28fe29['params']['id']);for(var _0x13d118=0x0;_0x13d118<_0x2a0c33['length'];_0x13d118+=0x1){let _0x2aa492=_0x2a0c33[_0x13d118];for(var _0x5b77df=0x0;_0x5b77df<_0x2aa492['Agents'][_0x4a33('0x39')];_0x5b77df+=0x1){let _0x20cc10=_0x2aa492[_0x4a33('0x69')][_0x5b77df];var _0x3c7ef0=_0x46be21['clone']();_0x3c7ef0[_0x4a33('0x3d')](_0x4a33('0x75'),_0x20cc10['id']);_0x3a9dc6[_0x4a33('0x76')](db[_0x4a33('0x6a')]['query'](_0x3c7ef0['toString'](),{'type':db[_0x4a33('0x6a')]['QueryTypes'][_0x4a33('0x77')]})[_0x4a33('0x29')](function(_0x41d13c){if(_0x41d13c[_0x4a33('0x39')]===0x1){return _0x20cc10['id'];}else{var _0x41210c=_[_0x4a33('0x78')](_[_0x4a33('0x41')](_0x41d13c,_0x4a33('0x79')),function(_0x2d2b29){return _[_0x4a33('0x7a')](_0x1b53e4,_0x2d2b29);});if(_0x41210c){return _0x20cc10['id'];}}}));}}return BPromise[_0x4a33('0x7b')](_0x3a9dc6)[_0x4a33('0x29')](function(_0x2a97fb){_0x4d1676=_(_0x4d1676)[_0x4a33('0x7c')](_0x2a97fb)[_0x4a33('0x7d')]()['value']();return db[_0x4a33('0x30')]['find']({'where':{'id':_0x28fe29[_0x4a33('0x49')]['id']}})['then'](function(_0x5d5576){return db[_0x4a33('0x6a')][_0x4a33('0x6b')](function(_0x4956d6){return _0x5d5576[_0x4a33('0x70')](_0x28fe29[_0x4a33('0x33')]['ids'],{'transaction':_0x4956d6})[_0x4a33('0x29')](function(){if(!_[_0x4a33('0x7e')](_0x4d1676)){return _0x5d5576[_0x4a33('0x7f')](_0x4d1676,{'transaction':_0x4956d6});}})['then'](function(){_0x4d1676['forEach'](function(_0x41ed98){socket[_0x4a33('0x80')](_0x4a33('0x81'),{'UserId':_0x41ed98,'OpenchannelQueueId':_0x5d5576['id']});});});});});});})[_0x4a33('0x29')](respondWithStatusCode(_0x20d2a5,null))['catch'](handleError(_0x20d2a5,null));};exports['addAgents']=function(_0x59eb09,_0x229787,_0x5bf258){return db[_0x4a33('0x30')][_0x4a33('0x4b')]({'where':{'id':_0x59eb09['params']['id']}})[_0x4a33('0x29')](handleEntityNotFound(_0x229787,null))['then'](function(_0x2fb4b4){if(_0x2fb4b4){return _0x2fb4b4['addAgents'](_0x59eb09[_0x4a33('0x54')]['ids'],_[_0x4a33('0x82')](_0x59eb09[_0x4a33('0x54')],['ids','id'])||{})[_0x4a33('0x83')](function(_0x59bcde){for(var _0x2dec01=0x0;_0x2dec01<_0x59eb09[_0x4a33('0x54')]['ids']['length'];_0x2dec01+=0x1){socket[_0x4a33('0x80')](_0x4a33('0x6f'),{'UserId':_0x59eb09[_0x4a33('0x54')][_0x4a33('0x71')][_0x2dec01],'OpenchannelQueueId':_0x59eb09['params']['id']});}return _0x59bcde;});}})[_0x4a33('0x29')](respondWithResult(_0x229787,null))[_0x4a33('0x47')](handleError(_0x229787,null));};exports[_0x4a33('0x7f')]=function(_0x54962d,_0x3bd7d5,_0x1feedd){return db[_0x4a33('0x30')][_0x4a33('0x4b')]({'where':{'id':_0x54962d[_0x4a33('0x49')]['id']}})[_0x4a33('0x29')](handleEntityNotFound(_0x3bd7d5,null))['then'](function(_0x235521){if(_0x235521){return _0x235521[_0x4a33('0x7f')](_0x54962d[_0x4a33('0x33')][_0x4a33('0x71')])[_0x4a33('0x29')](function(){if(_[_0x4a33('0x84')](_0x54962d[_0x4a33('0x33')][_0x4a33('0x71')])){for(var _0x41a3fb=0x0;_0x41a3fb<_0x54962d[_0x4a33('0x33')][_0x4a33('0x71')]['length'];_0x41a3fb+=0x1){socket[_0x4a33('0x80')]('userOpenchannelQueue:remove',{'UserId':Number(_0x54962d[_0x4a33('0x33')][_0x4a33('0x71')][_0x41a3fb]),'OpenchannelQueueId':Number(_0x54962d[_0x4a33('0x49')]['id'])});}}else{socket['emit'](_0x4a33('0x81'),{'UserId':Number(_0x54962d[_0x4a33('0x33')][_0x4a33('0x71')]),'OpenchannelQueueId':Number(_0x54962d['params']['id'])});}});}})[_0x4a33('0x29')](respondWithStatusCode(_0x3bd7d5,null))[_0x4a33('0x47')](handleError(_0x3bd7d5,null));};exports[_0x4a33('0x85')]=function(_0x2e735a,_0x4db917,_0x16677f){var _0x651863={};var _0x4bc24e={};var _0xb426b3;var _0x10bc0d;return db[_0x4a33('0x30')][_0x4a33('0x64')]({'where':{'id':_0x2e735a[_0x4a33('0x49')]['id']}})[_0x4a33('0x29')](handleEntityNotFound(_0x4db917,null))[_0x4a33('0x29')](function(_0x493c6f){if(_0x493c6f){_0xb426b3=_0x493c6f;_0x4bc24e[_0x4a33('0x32')]=_[_0x4a33('0x34')](db['User'][_0x4a33('0x31')]);_0x4bc24e[_0x4a33('0x33')]=_[_0x4a33('0x34')](_0x2e735a[_0x4a33('0x33')]);_0x4bc24e[_0x4a33('0x35')]=_['intersection'](_0x4bc24e[_0x4a33('0x32')],_0x4bc24e[_0x4a33('0x33')]);_0x651863[_0x4a33('0x36')]=_[_0x4a33('0x37')](_0x4bc24e['model'],qs[_0x4a33('0x38')](_0x2e735a[_0x4a33('0x33')][_0x4a33('0x38')]));_0x651863[_0x4a33('0x36')]=_0x651863[_0x4a33('0x36')][_0x4a33('0x39')]?_0x651863[_0x4a33('0x36')]:_0x4bc24e[_0x4a33('0x32')];_0x651863['order']=qs['sort'](_0x2e735a[_0x4a33('0x33')][_0x4a33('0x3c')]);_0x651863[_0x4a33('0x3d')]=qs[_0x4a33('0x35')](_[_0x4a33('0x3e')](_0x2e735a[_0x4a33('0x33')],_0x4bc24e[_0x4a33('0x35')]));if(_0x2e735a[_0x4a33('0x33')][_0x4a33('0x3f')]){_0x651863[_0x4a33('0x3d')]=_[_0x4a33('0x40')](_0x651863[_0x4a33('0x3d')],{'$or':_['map'](_0x651863['attributes'],function(_0x5a9426){var _0x25ea0a={};_0x25ea0a[_0x5a9426]={'$like':'%'+_0x2e735a[_0x4a33('0x33')]['filter']+'%'};return _0x25ea0a;})});}_0x651863=_[_0x4a33('0x40')]({},_0x651863,_0x2e735a[_0x4a33('0x44')]);return _0xb426b3[_0x4a33('0x85')](_0x651863);}})[_0x4a33('0x29')](function(_0x2ef64f){if(_0x2ef64f){_0x10bc0d=_0x2ef64f[_0x4a33('0x39')];if(!_0x2e735a['query'][_0x4a33('0x3a')]('nolimit')){_0x651863['limit']=qs[_0x4a33('0x25')](_0x2e735a[_0x4a33('0x33')][_0x4a33('0x25')]);_0x651863[_0x4a33('0x24')]=qs[_0x4a33('0x24')](_0x2e735a[_0x4a33('0x33')]['offset']);}return _0xb426b3[_0x4a33('0x85')](_0x651863);}})['then'](function(_0x598d63){if(_0x598d63){return _0x598d63?{'count':_0x10bc0d,'rows':_0x598d63}:null;}})[_0x4a33('0x29')](respondWithResult(_0x4db917,null))[_0x4a33('0x47')](handleError(_0x4db917,null));}; \ No newline at end of file +var _0xa3bd=['findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','teams','User','voicePause','interface','Agents','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','from','team_has_openchannel_queues','join','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','transaction','isEmpty','removeAgents','userOpenchannelQueue:remove','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','keys','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','OpenchannelQueue','includeAll','findAll','rows','catch','params','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','getMembers','UserOpenchannelQueue','hasOwnProperty','order','OpenchannelQueueId','map'];(function(_0x55b0ac,_0x443db2){var _0x5dcda2=function(_0x4c1305){while(--_0x4c1305){_0x55b0ac['push'](_0x55b0ac['shift']());}};_0x5dcda2(++_0x443db2);}(_0xa3bd,0x1d3));var _0xda3b=function(_0x2d90d8,_0x14503a){_0x2d90d8=_0x2d90d8-0x0;var _0x1ac508=_0xa3bd[_0x2d90d8];return _0x1ac508;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xda3b('0x0'));var rimraf=require(_0xda3b('0x1'));var zipdir=require(_0xda3b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xda3b('0x3'));var moment=require(_0xda3b('0x4'));var BPromise=require(_0xda3b('0x5'));var Mustache=require(_0xda3b('0x6'));var util=require(_0xda3b('0x7'));var path=require('path');var sox=require(_0xda3b('0x8'));var csv=require(_0xda3b('0x9'));var ejs=require(_0xda3b('0xa'));var fs=require('fs');var _=require(_0xda3b('0xb'));var squel=require(_0xda3b('0xc'));var crypto=require(_0xda3b('0xd'));var jsforce=require(_0xda3b('0xe'));var deskjs=require(_0xda3b('0xf'));var toCsv=require(_0xda3b('0x9'));var querystring=require(_0xda3b('0x10'));var Papa=require(_0xda3b('0x11'));var Redis=require(_0xda3b('0x12'));var authService=require(_0xda3b('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xda3b('0x14'));var logger=require(_0xda3b('0x15'))(_0xda3b('0x16'));var utils=require('../../config/utils');var config=require(_0xda3b('0x17'));var db=require(_0xda3b('0x18'))['db'];config[_0xda3b('0x19')]=_[_0xda3b('0x1a')](config['redis'],{'host':_0xda3b('0x1b'),'port':0x18eb});var socket=require(_0xda3b('0x1c'))(new Redis(config[_0xda3b('0x19')]));require(_0xda3b('0x1d'))[_0xda3b('0x1e')](socket);function respondWithStatusCode(_0x1c4465,_0x368c8f){_0x368c8f=_0x368c8f||0xcc;return function(_0x36d326){if(_0x36d326){return _0x1c4465[_0xda3b('0x1f')](_0x368c8f);}return _0x1c4465[_0xda3b('0x20')](_0x368c8f)['end']();};}function respondWithResult(_0x15bacd,_0x68718c){_0x68718c=_0x68718c||0xc8;return function(_0x7bfbca){if(_0x7bfbca){return _0x15bacd[_0xda3b('0x20')](_0x68718c)[_0xda3b('0x21')](_0x7bfbca);}};}function respondWithFilteredResult(_0x5e2f97,_0xd7f053){return function(_0xdab454){if(_0xdab454){var _0x364305=_0xdab454[_0xda3b('0x22')],_0x349da4=_0xd7f053[_0xda3b('0x23')],_0x331582=_0xd7f053['offset']+_0xd7f053[_0xda3b('0x24')],_0x4fcb13;if(_0x331582>=_0x364305){_0x331582=_0x364305;_0x4fcb13=0xc8;}else{_0x4fcb13=0xce;}_0x5e2f97[_0xda3b('0x20')](_0x4fcb13);return _0x5e2f97[_0xda3b('0x25')](_0xda3b('0x26'),_0x349da4+'-'+_0x331582+'/'+_0x364305)[_0xda3b('0x21')](_0xdab454);}return null;};}function patchUpdates(_0x2fa34e){return function(_0x4f70bb){try{jsonpatch[_0xda3b('0x27')](_0x4f70bb,_0x2fa34e,!![]);}catch(_0x1eb3c5){return BPromise[_0xda3b('0x28')](_0x1eb3c5);}return _0x4f70bb['save']();};}function saveUpdates(_0x42e05e,_0x338437){return function(_0x58d134){if(_0x58d134){return _0x58d134['update'](_0x42e05e)[_0xda3b('0x29')](function(_0x1befee){return _0x1befee;});}return null;};}function removeEntity(_0x12a011,_0x40366b){return function(_0x1cd424){if(_0x1cd424){return _0x1cd424[_0xda3b('0x2a')]()[_0xda3b('0x29')](function(){var _0x58abbd=_0x1cd424[_0xda3b('0x2b')]({'plain':!![]});var _0x48d74e='OpenchannelQueues';return db[_0xda3b('0x2c')][_0xda3b('0x2a')]({'where':{'type':_0x48d74e,'resourceId':_0x58abbd['id']}})[_0xda3b('0x29')](function(){return _0x1cd424;});})[_0xda3b('0x29')](function(){_0x12a011['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55d6ef,_0x2a6296){return function(_0x47caa6){if(!_0x47caa6){_0x55d6ef[_0xda3b('0x1f')](0x194);}return _0x47caa6;};}function handleError(_0x11b51b,_0x2bffbe){_0x2bffbe=_0x2bffbe||0x1f4;return function(_0x2beb3f){logger[_0xda3b('0x2d')](_0x2beb3f[_0xda3b('0x2e')]);if(_0x2beb3f[_0xda3b('0x2f')]){delete _0x2beb3f[_0xda3b('0x2f')];}_0x11b51b[_0xda3b('0x20')](_0x2bffbe)[_0xda3b('0x30')](_0x2beb3f);};}exports[_0xda3b('0x31')]=function(_0x2eedbd,_0xeeb93d){var _0xf9cdad={},_0x54b94b={},_0x39fc5c={'count':0x0,'rows':[]};var _0x4a2392=db['OpenchannelQueue']['rawAttributes'];_0x54b94b['model']=_[_0xda3b('0x32')](_0x4a2392);_0x54b94b[_0xda3b('0x33')]=_[_0xda3b('0x32')](_0x2eedbd[_0xda3b('0x33')]);_0x54b94b[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x54b94b[_0xda3b('0x36')],_0x54b94b[_0xda3b('0x33')]);_0xf9cdad['attributes']=_[_0xda3b('0x35')](_0x54b94b['model'],qs[_0xda3b('0x37')](_0x2eedbd['query'][_0xda3b('0x37')]));_0xf9cdad[_0xda3b('0x38')]=_0xf9cdad['attributes'][_0xda3b('0x39')]?_0xf9cdad[_0xda3b('0x38')]:_0x54b94b[_0xda3b('0x36')];if(!_0x2eedbd[_0xda3b('0x33')]['hasOwnProperty'](_0xda3b('0x3a'))){_0xf9cdad[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x2eedbd[_0xda3b('0x33')]['limit']);_0xf9cdad[_0xda3b('0x23')]=qs[_0xda3b('0x23')](_0x2eedbd['query'][_0xda3b('0x23')]);}_0xf9cdad['order']=qs[_0xda3b('0x3b')](_0x2eedbd['query'][_0xda3b('0x3b')]);_0xf9cdad[_0xda3b('0x3c')]=qs[_0xda3b('0x34')](_[_0xda3b('0x3d')](_0x2eedbd['query'],_0x54b94b[_0xda3b('0x34')]));if(_0x2eedbd['query'][_0xda3b('0x3e')]){_0xf9cdad['where']=_[_0xda3b('0x3f')](_0xf9cdad[_0xda3b('0x3c')],{'$or':_['map'](_0x4a2392,function(_0x3fe5cc){if(_0x3fe5cc[_0xda3b('0x40')][_0xda3b('0x41')]!==_0xda3b('0x42')){var _0x1acb45={};_0x1acb45[_0x3fe5cc[_0xda3b('0x43')]]={'$like':'%'+_0x2eedbd[_0xda3b('0x33')]['filter']+'%'};return _0x1acb45;}})});}_0xf9cdad=_[_0xda3b('0x3f')]({},_0xf9cdad,_0x2eedbd[_0xda3b('0x44')]);var _0x41ad16={'where':_0xf9cdad[_0xda3b('0x3c')]};return db[_0xda3b('0x45')][_0xda3b('0x22')](_0x41ad16)[_0xda3b('0x29')](function(_0x2ad3f9){_0x39fc5c[_0xda3b('0x22')]=_0x2ad3f9;if(_0x2eedbd[_0xda3b('0x33')][_0xda3b('0x46')]){_0xf9cdad['include']=[{'all':!![]}];}return db[_0xda3b('0x45')][_0xda3b('0x47')](_0xf9cdad);})['then'](function(_0x789cde){_0x39fc5c[_0xda3b('0x48')]=_0x789cde;return _0x39fc5c;})['then'](respondWithFilteredResult(_0xeeb93d,_0xf9cdad))[_0xda3b('0x49')](handleError(_0xeeb93d,null));};exports['show']=function(_0x1812fc,_0x5de5c4){var _0x41a23d={'raw':!![],'where':{'id':_0x1812fc[_0xda3b('0x4a')]['id']}},_0x2621ee={};_0x2621ee[_0xda3b('0x36')]=_[_0xda3b('0x32')](db[_0xda3b('0x45')][_0xda3b('0x4b')]);_0x2621ee['query']=_[_0xda3b('0x32')](_0x1812fc[_0xda3b('0x33')]);_0x2621ee[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x2621ee[_0xda3b('0x36')],_0x2621ee[_0xda3b('0x33')]);_0x41a23d[_0xda3b('0x38')]=_['intersection'](_0x2621ee['model'],qs[_0xda3b('0x37')](_0x1812fc['query'][_0xda3b('0x37')]));_0x41a23d[_0xda3b('0x38')]=_0x41a23d[_0xda3b('0x38')][_0xda3b('0x39')]?_0x41a23d[_0xda3b('0x38')]:_0x2621ee[_0xda3b('0x36')];if(_0x1812fc[_0xda3b('0x33')]['includeAll']){_0x41a23d['include']=[{'all':!![]}];}_0x41a23d=_[_0xda3b('0x3f')]({},_0x41a23d,_0x1812fc['options']);return db[_0xda3b('0x45')]['find'](_0x41a23d)[_0xda3b('0x29')](handleEntityNotFound(_0x5de5c4,null))[_0xda3b('0x29')](respondWithResult(_0x5de5c4,null))[_0xda3b('0x49')](handleError(_0x5de5c4,null));};exports['create']=function(_0x1d1596,_0x2a4e30){return db['OpenchannelQueue'][_0xda3b('0x4c')](_0x1d1596[_0xda3b('0x4d')],{})['then'](function(_0x40ea5c){var _0x238c51=_0x1d1596['user'][_0xda3b('0x2b')]({'plain':!![]});if(!_0x238c51)throw new Error(_0xda3b('0x4e'));if(_0x238c51[_0xda3b('0x4f')]===_0xda3b('0x50')){var _0x9550b=_0x40ea5c['get']({'plain':!![]});var _0xd4c1c6='OpenchannelQueues';return db[_0xda3b('0x51')]['find']({'where':{'name':_0xd4c1c6,'userProfileId':_0x238c51[_0xda3b('0x52')]},'raw':!![]})[_0xda3b('0x29')](function(_0x5f0ca2){if(_0x5f0ca2&&_0x5f0ca2['autoAssociation']===0x0){return db[_0xda3b('0x2c')]['create']({'name':_0x9550b[_0xda3b('0x2f')],'resourceId':_0x9550b['id'],'type':_0x5f0ca2['name'],'sectionId':_0x5f0ca2['id']},{})[_0xda3b('0x29')](function(){return _0x40ea5c;});}else{return _0x40ea5c;}})[_0xda3b('0x49')](function(_0x5d8af2){logger[_0xda3b('0x2d')](_0xda3b('0x53'),_0x5d8af2);throw _0x5d8af2;});}return _0x40ea5c;})['then'](respondWithResult(_0x2a4e30,0xc9))[_0xda3b('0x49')](handleError(_0x2a4e30,null));};exports[_0xda3b('0x54')]=function(_0x378170,_0x217264){if(_0x378170[_0xda3b('0x4d')]['id']){delete _0x378170[_0xda3b('0x4d')]['id'];}return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x378170[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x217264,null))[_0xda3b('0x29')](saveUpdates(_0x378170[_0xda3b('0x4d')],null))['then'](respondWithResult(_0x217264,null))[_0xda3b('0x49')](handleError(_0x217264,null));};exports[_0xda3b('0x2a')]=function(_0x4d4b95,_0x3aaf14){return db['OpenchannelQueue']['find']({'where':{'id':_0x4d4b95['params']['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x3aaf14,null))[_0xda3b('0x29')](removeEntity(_0x3aaf14,null))['catch'](handleError(_0x3aaf14,null));};exports[_0xda3b('0x56')]=function(_0x4db5d7,_0x32bfee){return db[_0xda3b('0x45')][_0xda3b('0x56')]()['then'](respondWithResult(_0x32bfee,null))['catch'](handleError(_0x32bfee,null));};exports[_0xda3b('0x57')]=function(_0x46775f,_0x540a71,_0x37e2a5){var _0x3837b4={'raw':!![],'where':{}},_0x5109e0={},_0x206d47;return db[_0xda3b('0x45')]['findOne']({'where':{'id':_0x46775f[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x540a71,null))[_0xda3b('0x29')](function(_0x59933b){if(_0x59933b){_0x206d47=_0x59933b['get']({'plain':!![]});_0x5109e0[_0xda3b('0x36')]=_[_0xda3b('0x32')](db[_0xda3b('0x58')][_0xda3b('0x4b')]);_0x5109e0['query']=_[_0xda3b('0x32')](_0x46775f[_0xda3b('0x33')]);_0x5109e0[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x5109e0['model'],_0x5109e0[_0xda3b('0x33')]);_0x3837b4['attributes']=_[_0xda3b('0x35')](_0x5109e0[_0xda3b('0x36')],qs[_0xda3b('0x37')](_0x46775f[_0xda3b('0x33')][_0xda3b('0x37')]));_0x3837b4[_0xda3b('0x38')]=_0x3837b4[_0xda3b('0x38')][_0xda3b('0x39')]?_0x3837b4[_0xda3b('0x38')]:_0x5109e0['model'];if(!_0x46775f['query'][_0xda3b('0x59')](_0xda3b('0x3a'))){_0x3837b4[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x46775f[_0xda3b('0x33')][_0xda3b('0x24')]);_0x3837b4[_0xda3b('0x23')]=qs['offset'](_0x46775f['query'][_0xda3b('0x23')]);}_0x3837b4[_0xda3b('0x5a')]=qs[_0xda3b('0x3b')](_0x46775f[_0xda3b('0x33')][_0xda3b('0x3b')]);_0x3837b4[_0xda3b('0x3c')]=qs[_0xda3b('0x34')](_[_0xda3b('0x3d')](_0x46775f[_0xda3b('0x33')],_0x5109e0[_0xda3b('0x34')]));_0x3837b4[_0xda3b('0x3c')][_0xda3b('0x5b')]=_0x59933b['id'];if(_0x46775f[_0xda3b('0x33')][_0xda3b('0x3e')]){_0x3837b4[_0xda3b('0x3c')]=_[_0xda3b('0x3f')](_0x3837b4[_0xda3b('0x3c')],{'$or':_[_0xda3b('0x5c')](_0x3837b4[_0xda3b('0x38')],function(_0x11288b){var _0x13c8dd={};_0x13c8dd[_0x11288b]={'$like':'%'+_0x46775f[_0xda3b('0x33')][_0xda3b('0x3e')]+'%'};return _0x13c8dd;})});}_0x3837b4=_[_0xda3b('0x3f')]({},_0x3837b4,_0x46775f[_0xda3b('0x44')]);return db[_0xda3b('0x58')]['findAll'](_0x3837b4);}})[_0xda3b('0x29')](function(_0x33d204){if(_0x33d204){return db['User'][_0xda3b('0x5d')]({'where':{'id':_[_0xda3b('0x5c')](_0x33d204,_0xda3b('0x5e')),'role':_0xda3b('0x5f')},'attributes':['id',_0xda3b('0x2f'),_0xda3b('0x60'),'updatedAt',_0xda3b('0x61')]});}})[_0xda3b('0x29')](function(_0x567c79){if(_0x567c79){return{'count':_0x567c79[_0xda3b('0x22')],'rows':_[_0xda3b('0x5c')](_0x567c79[_0xda3b('0x48')],function(_0x34c91e){return{'membername':_0x34c91e[_0xda3b('0x2f')],'UserId':_0x34c91e['id'],'queue_name':_0x206d47['name'],'OpenchannelQueueId':_0x206d47['id'],'interface':util[_0xda3b('0x62')](_0xda3b('0x63'),_0xda3b('0x64'),_0x34c91e[_0xda3b('0x2f')]),'penalty':0x0,'paused':_0x34c91e['openchannelPause'],'createdAt':_0x34c91e[_0xda3b('0x61')],'updatedAt':_0x34c91e[_0xda3b('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xda3b('0x29')](respondWithFilteredResult(_0x540a71,_0x3837b4))['catch'](handleError(_0x540a71,null));};exports[_0xda3b('0x66')]=function(_0x2490b5,_0x156c37,_0xfb0eb9){var _0x321796={};var _0x5a53cf={};var _0x23b3b1;var _0x1ee054;return db[_0xda3b('0x45')][_0xda3b('0x67')]({'where':{'id':_0x2490b5[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x156c37,null))[_0xda3b('0x29')](function(_0x555b40){if(_0x555b40){_0x23b3b1=_0x555b40;_0x5a53cf[_0xda3b('0x36')]=_['keys'](db[_0xda3b('0x68')][_0xda3b('0x4b')]);_0x5a53cf[_0xda3b('0x33')]=_['keys'](_0x2490b5['query']);_0x5a53cf[_0xda3b('0x34')]=_['intersection'](_0x5a53cf['model'],_0x5a53cf[_0xda3b('0x33')]);_0x321796[_0xda3b('0x38')]=_[_0xda3b('0x35')](_0x5a53cf['model'],qs[_0xda3b('0x37')](_0x2490b5[_0xda3b('0x33')]['fields']));_0x321796[_0xda3b('0x38')]=_0x321796['attributes'][_0xda3b('0x39')]?_0x321796['attributes']:_0x5a53cf[_0xda3b('0x36')];_0x321796['order']=qs[_0xda3b('0x3b')](_0x2490b5[_0xda3b('0x33')][_0xda3b('0x3b')]);_0x321796[_0xda3b('0x3c')]=qs['filters'](_[_0xda3b('0x3d')](_0x2490b5['query'],_0x5a53cf[_0xda3b('0x34')]));if(_0x2490b5[_0xda3b('0x33')]['filter']){_0x321796['where']=_[_0xda3b('0x3f')](_0x321796[_0xda3b('0x3c')],{'$or':_[_0xda3b('0x5c')](_0x321796['attributes'],function(_0x3a905c){var _0x380e37={};_0x380e37[_0x3a905c]={'$like':'%'+_0x2490b5['query'][_0xda3b('0x3e')]+'%'};return _0x380e37;})});}_0x321796=_['merge']({},_0x321796,_0x2490b5['options']);return _0x23b3b1[_0xda3b('0x66')](_0x321796);}})[_0xda3b('0x29')](function(_0x2a143d){if(_0x2a143d){_0x1ee054=_0x2a143d[_0xda3b('0x39')];if(!_0x2490b5[_0xda3b('0x33')][_0xda3b('0x59')](_0xda3b('0x3a'))){_0x321796[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x2490b5[_0xda3b('0x33')][_0xda3b('0x24')]);_0x321796[_0xda3b('0x23')]=qs[_0xda3b('0x23')](_0x2490b5[_0xda3b('0x33')][_0xda3b('0x23')]);}return _0x23b3b1['getTeams'](_0x321796);}})['then'](function(_0x31002e){if(_0x31002e){return _0x31002e?{'count':_0x1ee054,'rows':_0x31002e}:null;}})[_0xda3b('0x29')](respondWithResult(_0x156c37,null))[_0xda3b('0x49')](handleError(_0x156c37,null));};exports[_0xda3b('0x69')]=function(_0x3a599d,_0x5b6acf,_0x1b2b57){var _0x511b65=_0x3a599d[_0xda3b('0x4d')][_0xda3b('0x6a')];return db[_0xda3b('0x68')][_0xda3b('0x47')]({'where':{'id':_['map'](_0x511b65,'id')},'attributes':['id'],'include':[{'model':db[_0xda3b('0x6b')],'as':'Agents','attributes':['id',_0xda3b('0x2f'),'online',_0xda3b('0x6c'),_0xda3b('0x6d')],'raw':!![]}]})[_0xda3b('0x29')](function(_0x2f9e85){if(_0x2f9e85){var _0x471db1=_['flatMap'](_0x2f9e85,function(_0x555614){var _0x1709b9=_0x555614[_0xda3b('0x2b')]({'plain':!![]});return _0x1709b9[_0xda3b('0x6e')];});return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x3a599d[_0xda3b('0x4a')]['id']}})['then'](function(_0x4b029a){return db[_0xda3b('0x6f')]['transaction'](function(_0x5000cb){return _0x4b029a['addTeams'](_['map'](_0x511b65,'id'),{'transaction':_0x5000cb})[_0xda3b('0x29')](function(){return BPromise[_0xda3b('0x70')](_0x471db1,function(_0x15c1ea){return db[_0xda3b('0x58')][_0xda3b('0x71')]({'where':{'UserId':_0x15c1ea['id'],'OpenchannelQueueId':_0x3a599d[_0xda3b('0x4a')]['id']},'transaction':_0x5000cb});});})[_0xda3b('0x29')](function(){_0x471db1[_0xda3b('0x72')](function(_0x449393){socket[_0xda3b('0x73')](_0xda3b('0x74'),{'UserId':_0x449393['id'],'OpenchannelQueueId':_0x4b029a['id']});});});});});}})[_0xda3b('0x29')](respondWithStatusCode(_0x5b6acf,null))[_0xda3b('0x49')](handleError(_0x5b6acf,null));};exports[_0xda3b('0x75')]=function(_0x4844a7,_0x28e5be,_0x3006d8){return db[_0xda3b('0x68')][_0xda3b('0x47')]({'where':{'id':_0x4844a7[_0xda3b('0x33')][_0xda3b('0x76')]},'attributes':['id'],'include':[{'model':db[_0xda3b('0x6b')],'as':_0xda3b('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x28e5be,null))[_0xda3b('0x29')](function(_0x2243a1){var _0x437673=_[_0xda3b('0x5c')](_0x2243a1,'id');var _0x5826fb=[];var _0x521880=[];var _0x2debbe=squel[_0xda3b('0x77')]();_0x2debbe[_0xda3b('0x43')]('tq.TeamId')[_0xda3b('0x78')](_0xda3b('0x79'),'tq')[_0xda3b('0x7a')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xda3b('0x3c')](_0xda3b('0x7b'),_0x4844a7[_0xda3b('0x4a')]['id']);for(var _0x5d5cfa=0x0;_0x5d5cfa<_0x2243a1['length'];_0x5d5cfa+=0x1){let _0x57e9ee=_0x2243a1[_0x5d5cfa];for(var _0x590a91=0x0;_0x590a91<_0x57e9ee[_0xda3b('0x6e')][_0xda3b('0x39')];_0x590a91+=0x1){let _0x34eae4=_0x57e9ee[_0xda3b('0x6e')][_0x590a91];var _0x17d908=_0x2debbe['clone']();_0x17d908[_0xda3b('0x3c')](_0xda3b('0x7c'),_0x34eae4['id']);_0x521880['push'](db[_0xda3b('0x6f')][_0xda3b('0x33')](_0x17d908[_0xda3b('0x7d')](),{'type':db[_0xda3b('0x6f')][_0xda3b('0x7e')][_0xda3b('0x7f')]})[_0xda3b('0x29')](function(_0x2dffe8){if(_0x2dffe8[_0xda3b('0x39')]===0x1){return _0x34eae4['id'];}else{var _0x925356=_[_0xda3b('0x80')](_[_0xda3b('0x5c')](_0x2dffe8,_0xda3b('0x81')),function(_0x42beb1){return _['includes'](_0x437673,_0x42beb1);});if(_0x925356){return _0x34eae4['id'];}}}));}}return BPromise[_0xda3b('0x82')](_0x521880)[_0xda3b('0x29')](function(_0x547c00){_0x5826fb=_(_0x5826fb)[_0xda3b('0x83')](_0x547c00)[_0xda3b('0x84')]()[_0xda3b('0x85')]();return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x4844a7[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](function(_0x5d8f27){return db[_0xda3b('0x6f')][_0xda3b('0x86')](function(_0x121002){return _0x5d8f27[_0xda3b('0x75')](_0x4844a7[_0xda3b('0x33')]['ids'],{'transaction':_0x121002})[_0xda3b('0x29')](function(){if(!_[_0xda3b('0x87')](_0x5826fb)){return _0x5d8f27[_0xda3b('0x88')](_0x5826fb,{'transaction':_0x121002});}})['then'](function(){_0x5826fb[_0xda3b('0x72')](function(_0xd741bd){socket[_0xda3b('0x73')](_0xda3b('0x89'),{'UserId':_0xd741bd,'OpenchannelQueueId':_0x5d8f27['id']});});});});});});})[_0xda3b('0x29')](respondWithStatusCode(_0x28e5be,null))[_0xda3b('0x49')](handleError(_0x28e5be,null));};exports['addAgents']=function(_0x4c5885,_0x5d35d7,_0x3b758a){return db[_0xda3b('0x45')][_0xda3b('0x55')]({'where':{'id':_0x4c5885['params']['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x5d35d7,null))['then'](function(_0x58c570){if(_0x58c570){return _0x58c570['addAgents'](_0x4c5885[_0xda3b('0x4d')][_0xda3b('0x76')],_['omit'](_0x4c5885[_0xda3b('0x4d')],[_0xda3b('0x76'),'id'])||{})[_0xda3b('0x8a')](function(_0x1996bf){for(var _0x37e788=0x0;_0x37e788<_0x4c5885[_0xda3b('0x4d')][_0xda3b('0x76')][_0xda3b('0x39')];_0x37e788+=0x1){socket[_0xda3b('0x73')]('userOpenchannelQueue:save',{'UserId':_0x4c5885['body'][_0xda3b('0x76')][_0x37e788],'OpenchannelQueueId':_0x4c5885[_0xda3b('0x4a')]['id']});}return _0x1996bf;});}})[_0xda3b('0x29')](respondWithResult(_0x5d35d7,null))[_0xda3b('0x49')](handleError(_0x5d35d7,null));};exports[_0xda3b('0x88')]=function(_0x56c1bd,_0x23da8e,_0x5b12f9){return db[_0xda3b('0x45')]['find']({'where':{'id':_0x56c1bd['params']['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x23da8e,null))[_0xda3b('0x29')](function(_0x2d709f){if(_0x2d709f){return _0x2d709f['removeAgents'](_0x56c1bd[_0xda3b('0x33')]['ids'])[_0xda3b('0x29')](function(){if(_['isArray'](_0x56c1bd['query'][_0xda3b('0x76')])){for(var _0x222ac3=0x0;_0x222ac3<_0x56c1bd[_0xda3b('0x33')][_0xda3b('0x76')][_0xda3b('0x39')];_0x222ac3+=0x1){socket[_0xda3b('0x73')](_0xda3b('0x89'),{'UserId':Number(_0x56c1bd[_0xda3b('0x33')][_0xda3b('0x76')][_0x222ac3]),'OpenchannelQueueId':Number(_0x56c1bd[_0xda3b('0x4a')]['id'])});}}else{socket[_0xda3b('0x73')]('userOpenchannelQueue:remove',{'UserId':Number(_0x56c1bd[_0xda3b('0x33')][_0xda3b('0x76')]),'OpenchannelQueueId':Number(_0x56c1bd[_0xda3b('0x4a')]['id'])});}});}})[_0xda3b('0x29')](respondWithStatusCode(_0x23da8e,null))[_0xda3b('0x49')](handleError(_0x23da8e,null));};exports[_0xda3b('0x8b')]=function(_0x30aaea,_0x22d1a0,_0x12c342){var _0x3c88fb={};var _0x27c137={};var _0x2abb2f;var _0x4574c2;return db[_0xda3b('0x45')]['findOne']({'where':{'id':_0x30aaea[_0xda3b('0x4a')]['id']}})[_0xda3b('0x29')](handleEntityNotFound(_0x22d1a0,null))[_0xda3b('0x29')](function(_0x2fe491){if(_0x2fe491){_0x2abb2f=_0x2fe491;_0x27c137[_0xda3b('0x36')]=_[_0xda3b('0x32')](db['User'][_0xda3b('0x4b')]);_0x27c137['query']=_[_0xda3b('0x32')](_0x30aaea['query']);_0x27c137[_0xda3b('0x34')]=_[_0xda3b('0x35')](_0x27c137[_0xda3b('0x36')],_0x27c137['query']);_0x3c88fb['attributes']=_['intersection'](_0x27c137[_0xda3b('0x36')],qs[_0xda3b('0x37')](_0x30aaea['query'][_0xda3b('0x37')]));_0x3c88fb[_0xda3b('0x38')]=_0x3c88fb['attributes'][_0xda3b('0x39')]?_0x3c88fb[_0xda3b('0x38')]:_0x27c137[_0xda3b('0x36')];_0x3c88fb[_0xda3b('0x5a')]=qs[_0xda3b('0x3b')](_0x30aaea[_0xda3b('0x33')]['sort']);_0x3c88fb[_0xda3b('0x3c')]=qs[_0xda3b('0x34')](_[_0xda3b('0x3d')](_0x30aaea[_0xda3b('0x33')],_0x27c137[_0xda3b('0x34')]));if(_0x30aaea[_0xda3b('0x33')]['filter']){_0x3c88fb[_0xda3b('0x3c')]=_['merge'](_0x3c88fb[_0xda3b('0x3c')],{'$or':_[_0xda3b('0x5c')](_0x3c88fb[_0xda3b('0x38')],function(_0x1b27ff){var _0x30f0={};_0x30f0[_0x1b27ff]={'$like':'%'+_0x30aaea[_0xda3b('0x33')][_0xda3b('0x3e')]+'%'};return _0x30f0;})});}_0x3c88fb=_['merge']({},_0x3c88fb,_0x30aaea[_0xda3b('0x44')]);return _0x2abb2f['getAgents'](_0x3c88fb);}})[_0xda3b('0x29')](function(_0x31ecab){if(_0x31ecab){_0x4574c2=_0x31ecab[_0xda3b('0x39')];if(!_0x30aaea[_0xda3b('0x33')][_0xda3b('0x59')](_0xda3b('0x3a'))){_0x3c88fb[_0xda3b('0x24')]=qs[_0xda3b('0x24')](_0x30aaea[_0xda3b('0x33')][_0xda3b('0x24')]);_0x3c88fb[_0xda3b('0x23')]=qs[_0xda3b('0x23')](_0x30aaea[_0xda3b('0x33')][_0xda3b('0x23')]);}return _0x2abb2f['getAgents'](_0x3c88fb);}})[_0xda3b('0x29')](function(_0x2f7112){if(_0x2f7112){return _0x2f7112?{'count':_0x4574c2,'rows':_0x2f7112}:null;}})[_0xda3b('0x29')](respondWithResult(_0x22d1a0,null))[_0xda3b('0x49')](handleError(_0x22d1a0,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 4dcd610..48b3767 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 _0xf33a=['hook','events','OpenchannelQueue','save','remove','emit','hasOwnProperty'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf33a,0xa2));var _0xaf33=function(_0xc0375,_0xb2eeb0){_0xc0375=_0xc0375-0x0;var _0x41532f=_0xf33a[_0xc0375];return _0x41532f;};'use strict';var EventEmitter=require(_0xaf33('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xaf33('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf33('0x2'),'afterUpdate':'update','afterDestroy':_0xaf33('0x3')};function emitEvent(_0x4e156b){return function(_0x3ca85d,_0x170289,_0xd93628){OpenchannelQueueEvents['emit'](_0x4e156b+':'+_0x3ca85d['id'],_0x3ca85d);OpenchannelQueueEvents[_0xaf33('0x4')](_0x4e156b,_0x3ca85d);_0xd93628(null);};}for(var e in events){if(events[_0xaf33('0x5')](e)){var event=events[e];OpenchannelQueue[_0xaf33('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x7bdc=['exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','hook'];(function(_0x2d8035,_0x5b7620){var _0x17d217=function(_0x48268b){while(--_0x48268b){_0x2d8035['push'](_0x2d8035['shift']());}};_0x17d217(++_0x5b7620);}(_0x7bdc,0x133));var _0xc7bd=function(_0x45645f,_0x2bb92c){_0x45645f=_0x45645f-0x0;var _0x26bbe2=_0x7bdc[_0x45645f];return _0x26bbe2;};'use strict';var EventEmitter=require(_0xc7bd('0x0'));var OpenchannelQueue=require(_0xc7bd('0x1'))['db'][_0xc7bd('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc7bd('0x3')](0x0);var events={'afterCreate':_0xc7bd('0x4'),'afterUpdate':_0xc7bd('0x5'),'afterDestroy':_0xc7bd('0x6')};function emitEvent(_0x2984cb){return function(_0x1d7439,_0x39937b,_0x3e9fdb){OpenchannelQueueEvents['emit'](_0x2984cb+':'+_0x1d7439['id'],_0x1d7439);OpenchannelQueueEvents['emit'](_0x2984cb,_0x1d7439);_0x3e9fdb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xc7bd('0x7')](e,emitEvent(event));}}module[_0xc7bd('0x8')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 9037dd3..7ac6873 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 _0xcc65=['openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./openchannelQueue.attributes','exports','OpenchannelQueue'];(function(_0x3ab627,_0x39b221){var _0x1dab88=function(_0x5224a7){while(--_0x5224a7){_0x3ab627['push'](_0x3ab627['shift']());}};_0x1dab88(++_0x39b221);}(_0xcc65,0xe5));var _0x5cc6=function(_0x4320ce,_0x49f5f5){_0x4320ce=_0x4320ce-0x0;var _0x537dae=_0xcc65[_0x4320ce];return _0x537dae;};'use strict';var _=require(_0x5cc6('0x0'));var util=require(_0x5cc6('0x1'));var logger=require(_0x5cc6('0x2'))(_0x5cc6('0x3'));var moment=require(_0x5cc6('0x4'));var BPromise=require(_0x5cc6('0x5'));var rp=require(_0x5cc6('0x6'));var fs=require('fs');var path=require(_0x5cc6('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5cc6('0x8'));module[_0x5cc6('0x9')]=function(_0x520751,_0x1efe89){return _0x520751['define'](_0x5cc6('0xa'),attributes,{'tableName':_0x5cc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4afc=['OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelQueue.attributes'];(function(_0x2e6efa,_0x4de839){var _0x59f46c=function(_0x32b967){while(--_0x32b967){_0x2e6efa['push'](_0x2e6efa['shift']());}};_0x59f46c(++_0x4de839);}(_0x4afc,0x15e));var _0xc4af=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x4afc[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xc4af('0x0'));var util=require(_0xc4af('0x1'));var logger=require(_0xc4af('0x2'))(_0xc4af('0x3'));var moment=require(_0xc4af('0x4'));var BPromise=require(_0xc4af('0x5'));var rp=require(_0xc4af('0x6'));var fs=require('fs');var path=require(_0xc4af('0x7'));var rimraf=require(_0xc4af('0x8'));var config=require('../../config/environment');var attributes=require(_0xc4af('0x9'));module['exports']=function(_0x4f74d5,_0x5a1c0c){return _0x4f74d5['define'](_0xc4af('0xa'),attributes,{'tableName':_0xc4af('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 7dc1af7..b573cb3 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 _0x7250=['../../config/logger','../../config/environment','http','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','findAll','options','raw','limit','include','map','model','attributes','ShowOpenchannelQueue','OpenchannelQueue','find','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5aa023,_0x1cf1d2){var _0x31ceb5=function(_0x40f643){while(--_0x40f643){_0x5aa023['push'](_0x5aa023['shift']());}};_0x31ceb5(++_0x1cf1d2);}(_0x7250,0x1b1));var _0x0725=function(_0x137df4,_0x547dd5){_0x137df4=_0x137df4-0x0;var _0x16dc6c=_0x7250[_0x137df4];return _0x16dc6c;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var moment=require('moment');var BPromise=require(_0x0725('0x2'));var rs=require(_0x0725('0x3'));var fs=require('fs');var Redis=require(_0x0725('0x4'));var db=require(_0x0725('0x5'))['db'];var utils=require(_0x0725('0x6'));var logger=require(_0x0725('0x7'))('rpc');var config=require(_0x0725('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0725('0x9')]({'port':0x232a});config['redis']=_[_0x0725('0xa')](config[_0x0725('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0725('0xc'))(new Redis(config[_0x0725('0xb')]));require(_0x0725('0xd'))[_0x0725('0xe')](socket);function respondWithRpcPromise(_0x96e971,_0x26b7c4,_0x30c437){return new BPromise(function(_0x4c2f6a,_0x148b69){return client[_0x0725('0xf')](_0x96e971,_0x30c437)[_0x0725('0x10')](function(_0x5a6252){logger['info'](_0x0725('0x11'),_0x26b7c4,_0x0725('0x12'));logger[_0x0725('0x13')](_0x0725('0x14'),_0x26b7c4,_0x0725('0x12'),JSON[_0x0725('0x15')](_0x5a6252));if(_0x5a6252[_0x0725('0x16')]){if(_0x5a6252[_0x0725('0x16')][_0x0725('0x17')]===0x1f4){logger['error'](_0x0725('0x11'),_0x26b7c4,_0x5a6252[_0x0725('0x16')][_0x0725('0x18')]);return _0x148b69(_0x5a6252[_0x0725('0x16')][_0x0725('0x18')]);}logger[_0x0725('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x26b7c4,_0x5a6252['error'][_0x0725('0x18')]);return _0x4c2f6a(_0x5a6252['error'][_0x0725('0x18')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x26b7c4,'request\x20sent');_0x4c2f6a(_0x5a6252[_0x0725('0x19')][_0x0725('0x18')]);}})[_0x0725('0x1a')](function(_0x393bbb){logger[_0x0725('0x16')](_0x0725('0x11'),_0x26b7c4,_0x393bbb);_0x148b69(_0x393bbb);});});}exports[_0x0725('0x1b')]=function(_0x24c09a){var _0xbec8b9=this;return new Promise(function(_0x1f5b90,_0x194c5f){return db['OpenchannelQueue'][_0x0725('0x1c')]({'raw':_0x24c09a[_0x0725('0x1d')]?_0x24c09a[_0x0725('0x1d')][_0x0725('0x1e')]===undefined?!![]:![]:!![],'where':_0x24c09a[_0x0725('0x1d')]?_0x24c09a['options']['where']||null:null,'attributes':_0x24c09a[_0x0725('0x1d')]?_0x24c09a[_0x0725('0x1d')]['attributes']||null:null,'limit':_0x24c09a['options']?_0x24c09a[_0x0725('0x1d')][_0x0725('0x1f')]||null:null,'include':_0x24c09a[_0x0725('0x1d')]?_0x24c09a[_0x0725('0x1d')][_0x0725('0x20')]?_[_0x0725('0x21')](_0x24c09a['options'][_0x0725('0x20')],function(_0x5ec7de){return{'model':db[_0x5ec7de['model']],'as':_0x5ec7de['as'],'attributes':_0x5ec7de['attributes'],'include':_0x5ec7de['include']?_[_0x0725('0x21')](_0x5ec7de[_0x0725('0x20')],function(_0x4a9264){return{'model':db[_0x4a9264[_0x0725('0x22')]],'as':_0x4a9264['as'],'attributes':_0x4a9264[_0x0725('0x23')],'include':_0x4a9264[_0x0725('0x20')]?_[_0x0725('0x21')](_0x4a9264['include'],function(_0x587c61){return{'model':db[_0x587c61[_0x0725('0x22')]],'as':_0x587c61['as'],'attributes':_0x587c61[_0x0725('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0725('0x10')](function(_0xb1578b){logger['info'](_0x0725('0x1b'),_0x24c09a);logger[_0x0725('0x13')](_0x0725('0x1b'),_0x24c09a,JSON['stringify'](_0xb1578b));_0x1f5b90(_0xb1578b);})[_0x0725('0x1a')](function(_0x5151a5){logger[_0x0725('0x16')](_0x0725('0x1b'),_0x5151a5['message'],_0x24c09a);_0x194c5f(_0xbec8b9[_0x0725('0x16')](0x1f4,_0x5151a5[_0x0725('0x18')]));});});};exports[_0x0725('0x24')]=function(_0x136dca){var _0x462a17=this;return new Promise(function(_0x1aa4df,_0x1d5fe2){return db[_0x0725('0x25')][_0x0725('0x26')]({'raw':_0x136dca['options']?_0x136dca['options'][_0x0725('0x1e')]===undefined?!![]:![]:!![],'where':_0x136dca['options']?_0x136dca[_0x0725('0x1d')]['where']||null:null,'attributes':_0x136dca[_0x0725('0x1d')]?_0x136dca[_0x0725('0x1d')][_0x0725('0x23')]||null:null,'include':_0x136dca[_0x0725('0x1d')]?_0x136dca[_0x0725('0x1d')][_0x0725('0x20')]?_[_0x0725('0x21')](_0x136dca[_0x0725('0x1d')][_0x0725('0x20')],function(_0x5f28ce){return{'model':db[_0x5f28ce[_0x0725('0x22')]],'as':_0x5f28ce['as'],'attributes':_0x5f28ce['attributes'],'include':_0x5f28ce[_0x0725('0x20')]?_[_0x0725('0x21')](_0x5f28ce['include'],function(_0x4ef07e){return{'model':db[_0x4ef07e[_0x0725('0x22')]],'as':_0x4ef07e['as'],'attributes':_0x4ef07e[_0x0725('0x23')],'include':_0x4ef07e[_0x0725('0x20')]?_['map'](_0x4ef07e['include'],function(_0x483beb){return{'model':db[_0x483beb[_0x0725('0x22')]],'as':_0x483beb['as'],'attributes':_0x483beb[_0x0725('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0725('0x10')](function(_0xe5387e){logger[_0x0725('0x27')]('ShowOpenchannelQueue',_0x136dca);logger[_0x0725('0x13')](_0x0725('0x24'),_0x136dca,JSON[_0x0725('0x15')](_0xe5387e));_0x1aa4df(_0xe5387e);})[_0x0725('0x1a')](function(_0x38714d){logger[_0x0725('0x16')](_0x0725('0x24'),_0x38714d[_0x0725('0x18')],_0x136dca);_0x1d5fe2(_0x462a17[_0x0725('0x16')](0x1f4,_0x38714d[_0x0725('0x18')]));});});}; \ No newline at end of file +var _0x8388=['model','map','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueue','options','raw','where','attributes','limit','include'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x8388,0x18d));var _0x8838=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8388[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});config[_0x8838('0xb')]=_[_0x8838('0xc')](config[_0x8838('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8838('0xd'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x8838('0xe')](socket);function respondWithRpcPromise(_0x4b5419,_0x4aedc9,_0x336b66){return new BPromise(function(_0x28de3d,_0x1e728e){return client[_0x8838('0xf')](_0x4b5419,_0x336b66)['then'](function(_0xd472af){logger[_0x8838('0x10')](_0x8838('0x11'),_0x4aedc9,_0x8838('0x12'));logger['debug'](_0x8838('0x13'),_0x4aedc9,'request\x20sent',JSON['stringify'](_0xd472af));if(_0xd472af[_0x8838('0x14')]){if(_0xd472af[_0x8838('0x14')][_0x8838('0x15')]===0x1f4){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);return _0x1e728e(_0xd472af[_0x8838('0x14')]['message']);}logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0xd472af['error'][_0x8838('0x16')]);return _0x28de3d(_0xd472af[_0x8838('0x14')][_0x8838('0x16')]);}else{logger['info'](_0x8838('0x11'),_0x4aedc9,'request\x20sent');_0x28de3d(_0xd472af[_0x8838('0x17')][_0x8838('0x16')]);}})[_0x8838('0x18')](function(_0x4eb6e2){logger[_0x8838('0x14')](_0x8838('0x11'),_0x4aedc9,_0x4eb6e2);_0x1e728e(_0x4eb6e2);});});}exports['GetOpenchannelQueue']=function(_0x93171b){var _0x2a1ccd=this;return new Promise(function(_0x4c5bed,_0x9de0f6){return db[_0x8838('0x19')]['findAll']({'raw':_0x93171b['options']?_0x93171b[_0x8838('0x1a')][_0x8838('0x1b')]===undefined?!![]:![]:!![],'where':_0x93171b[_0x8838('0x1a')]?_0x93171b[_0x8838('0x1a')][_0x8838('0x1c')]||null:null,'attributes':_0x93171b[_0x8838('0x1a')]?_0x93171b[_0x8838('0x1a')][_0x8838('0x1d')]||null:null,'limit':_0x93171b[_0x8838('0x1a')]?_0x93171b['options'][_0x8838('0x1e')]||null:null,'include':_0x93171b['options']?_0x93171b[_0x8838('0x1a')][_0x8838('0x1f')]?_['map'](_0x93171b['options'][_0x8838('0x1f')],function(_0x2df92b){return{'model':db[_0x2df92b[_0x8838('0x20')]],'as':_0x2df92b['as'],'attributes':_0x2df92b[_0x8838('0x1d')],'include':_0x2df92b[_0x8838('0x1f')]?_[_0x8838('0x21')](_0x2df92b[_0x8838('0x1f')],function(_0x1fe141){return{'model':db[_0x1fe141[_0x8838('0x20')]],'as':_0x1fe141['as'],'attributes':_0x1fe141[_0x8838('0x1d')],'include':_0x1fe141['include']?_['map'](_0x1fe141[_0x8838('0x1f')],function(_0x52907a){return{'model':db[_0x52907a[_0x8838('0x20')]],'as':_0x52907a['as'],'attributes':_0x52907a[_0x8838('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x537c9d){logger[_0x8838('0x10')]('GetOpenchannelQueue',_0x93171b);logger['debug'](_0x8838('0x22'),_0x93171b,JSON[_0x8838('0x23')](_0x537c9d));_0x4c5bed(_0x537c9d);})['catch'](function(_0x3d1bbc){logger[_0x8838('0x14')]('GetOpenchannelQueue',_0x3d1bbc[_0x8838('0x16')],_0x93171b);_0x9de0f6(_0x2a1ccd[_0x8838('0x14')](0x1f4,_0x3d1bbc[_0x8838('0x16')]));});});};exports[_0x8838('0x24')]=function(_0x508ed4){var _0x1e8d12=this;return new Promise(function(_0x700132,_0x4a263b){return db['OpenchannelQueue'][_0x8838('0x25')]({'raw':_0x508ed4['options']?_0x508ed4[_0x8838('0x1a')][_0x8838('0x1b')]===undefined?!![]:![]:!![],'where':_0x508ed4[_0x8838('0x1a')]?_0x508ed4['options'][_0x8838('0x1c')]||null:null,'attributes':_0x508ed4[_0x8838('0x1a')]?_0x508ed4[_0x8838('0x1a')]['attributes']||null:null,'include':_0x508ed4[_0x8838('0x1a')]?_0x508ed4[_0x8838('0x1a')][_0x8838('0x1f')]?_['map'](_0x508ed4['options'][_0x8838('0x1f')],function(_0x1ec9f9){return{'model':db[_0x1ec9f9[_0x8838('0x20')]],'as':_0x1ec9f9['as'],'attributes':_0x1ec9f9[_0x8838('0x1d')],'include':_0x1ec9f9['include']?_[_0x8838('0x21')](_0x1ec9f9[_0x8838('0x1f')],function(_0x256d09){return{'model':db[_0x256d09[_0x8838('0x20')]],'as':_0x256d09['as'],'attributes':_0x256d09[_0x8838('0x1d')],'include':_0x256d09[_0x8838('0x1f')]?_[_0x8838('0x21')](_0x256d09[_0x8838('0x1f')],function(_0x53b47a){return{'model':db[_0x53b47a[_0x8838('0x20')]],'as':_0x53b47a['as'],'attributes':_0x53b47a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5af52e){logger['info'](_0x8838('0x24'),_0x508ed4);logger[_0x8838('0x26')](_0x8838('0x24'),_0x508ed4,JSON['stringify'](_0x5af52e));_0x700132(_0x5af52e);})[_0x8838('0x18')](function(_0x324900){logger[_0x8838('0x14')](_0x8838('0x24'),_0x324900[_0x8838('0x16')],_0x508ed4);_0x4a263b(_0x1e8d12[_0x8838('0x14')](0x1f4,_0x324900[_0x8838('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index d7a3d04..eb5056f 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 _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var OpenchannelQueueEvents=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(){OpenchannelQueueEvents[_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);OpenchannelQueueEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index df38215..5490e71 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index ce1d91b..018c0bf 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 _0x922d=['DATE','moment','sequelize','STRING'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0x922d,0x6d));var _0xd922=function(_0x14d3cb,_0x3c5f7c){_0x14d3cb=_0x14d3cb-0x0;var _0x204ed1=_0x922d[_0x14d3cb];return _0x204ed1;};'use strict';var moment=require(_0xd922('0x0'));var Sequelize=require(_0xd922('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd922('0x2')]},'joinAt':{'type':Sequelize[_0xd922('0x3')]},'leaveAt':{'type':Sequelize[_0xd922('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xd922('0x3')]},'reason':{'type':Sequelize[_0xd922('0x2')]}}; \ No newline at end of file +var _0x4a40=['DATE','moment','sequelize','STRING'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x4a40,0x75));var _0x04a4=function(_0x4990d5,_0xe2c486){_0x4990d5=_0x4990d5-0x0;var _0x275e25=_0x4a40[_0x4990d5];return _0x275e25;};'use strict';var moment=require(_0x04a4('0x0'));var Sequelize=require(_0x04a4('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x04a4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x04a4('0x2')]},'joinAt':{'type':Sequelize[_0x04a4('0x3')]},'leaveAt':{'type':Sequelize[_0x04a4('0x3')]},'acceptAt':{'type':Sequelize[_0x04a4('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x04a4('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a085f75..1ef1e0d 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 _0x3571=['sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','OpenchannelQueueReport','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','map','type','key','VIRTUAL','options','count','includeAll','include','rows','show','params','catch','create','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x3571,0xca));var _0x1357=function(_0x42ebba,_0x4cbf87){_0x42ebba=_0x42ebba-0x0;var _0x3fd2af=_0x3571[_0x42ebba];return _0x3fd2af;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1357('0x0'));var rimraf=require(_0x1357('0x1'));var zipdir=require(_0x1357('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1357('0x3'));var BPromise=require(_0x1357('0x4'));var Mustache=require(_0x1357('0x5'));var util=require(_0x1357('0x6'));var path=require(_0x1357('0x7'));var sox=require(_0x1357('0x8'));var csv=require('to-csv');var ejs=require(_0x1357('0x9'));var fs=require('fs');var _=require(_0x1357('0xa'));var squel=require('squel');var crypto=require(_0x1357('0xb'));var jsforce=require(_0x1357('0xc'));var deskjs=require(_0x1357('0xd'));var toCsv=require(_0x1357('0xe'));var querystring=require(_0x1357('0xf'));var Papa=require(_0x1357('0x10'));var Redis=require(_0x1357('0x11'));var authService=require(_0x1357('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1357('0x13'))(_0x1357('0x14'));var utils=require('../../config/utils');var config=require(_0x1357('0x15'));var db=require(_0x1357('0x16'))['db'];function respondWithStatusCode(_0xbcf977,_0xe845b9){_0xe845b9=_0xe845b9||0xcc;return function(_0x2c48f1){if(_0x2c48f1){return _0xbcf977['sendStatus'](_0xe845b9);}return _0xbcf977[_0x1357('0x17')](_0xe845b9)['end']();};}function respondWithResult(_0x5d5873,_0x1a73ad){_0x1a73ad=_0x1a73ad||0xc8;return function(_0xabfcb2){if(_0xabfcb2){return _0x5d5873[_0x1357('0x17')](_0x1a73ad)[_0x1357('0x18')](_0xabfcb2);}};}function respondWithFilteredResult(_0x2f5ff2,_0xc2c5f3){return function(_0x3fb161){if(_0x3fb161){var _0x58ba1d=_0x3fb161['count'],_0x1248a6=_0xc2c5f3[_0x1357('0x19')],_0x4aca76=_0xc2c5f3[_0x1357('0x19')]+_0xc2c5f3[_0x1357('0x1a')],_0x197b4f;if(_0x4aca76>=_0x58ba1d){_0x4aca76=_0x58ba1d;_0x197b4f=0xc8;}else{_0x197b4f=0xce;}_0x2f5ff2[_0x1357('0x17')](_0x197b4f);return _0x2f5ff2[_0x1357('0x1b')](_0x1357('0x1c'),_0x1248a6+'-'+_0x4aca76+'/'+_0x58ba1d)[_0x1357('0x18')](_0x3fb161);}return null;};}function patchUpdates(_0xf79dda){return function(_0x2f31f5){try{jsonpatch[_0x1357('0x1d')](_0x2f31f5,_0xf79dda,!![]);}catch(_0x1fecfc){return BPromise[_0x1357('0x1e')](_0x1fecfc);}return _0x2f31f5[_0x1357('0x1f')]();};}function saveUpdates(_0x429902,_0x27c63e){return function(_0x43f8a8){if(_0x43f8a8){return _0x43f8a8[_0x1357('0x20')](_0x429902)[_0x1357('0x21')](function(_0x2029e3){return _0x2029e3;});}return null;};}function removeEntity(_0x25ec54,_0x16c9d1){return function(_0x11dec1){if(_0x11dec1){return _0x11dec1[_0x1357('0x22')]()[_0x1357('0x21')](function(){_0x25ec54[_0x1357('0x17')](0xcc)[_0x1357('0x23')]();});}};}function handleEntityNotFound(_0x2f2a3b,_0x531e3c){return function(_0x1b999b){if(!_0x1b999b){_0x2f2a3b[_0x1357('0x24')](0x194);}return _0x1b999b;};}function handleError(_0x348a90,_0x10f687){_0x10f687=_0x10f687||0x1f4;return function(_0x2b565e){logger['error'](_0x2b565e[_0x1357('0x25')]);if(_0x2b565e['name']){delete _0x2b565e[_0x1357('0x26')];}_0x348a90[_0x1357('0x17')](_0x10f687)['send'](_0x2b565e);};}exports['index']=function(_0x1e6521,_0x431233){var _0x587033={},_0xdc26c9={},_0x4ad769={'count':0x0,'rows':[]};var _0x1d085a=db[_0x1357('0x27')]['rawAttributes'];_0xdc26c9[_0x1357('0x28')]=_['keys'](_0x1d085a);_0xdc26c9[_0x1357('0x29')]=_[_0x1357('0x2a')](_0x1e6521[_0x1357('0x29')]);_0xdc26c9[_0x1357('0x2b')]=_[_0x1357('0x2c')](_0xdc26c9[_0x1357('0x28')],_0xdc26c9['query']);_0x587033['attributes']=_['intersection'](_0xdc26c9[_0x1357('0x28')],qs['fields'](_0x1e6521['query'][_0x1357('0x2d')]));_0x587033['attributes']=_0x587033[_0x1357('0x2e')][_0x1357('0x2f')]?_0x587033[_0x1357('0x2e')]:_0xdc26c9[_0x1357('0x28')];if(!_0x1e6521[_0x1357('0x29')]['hasOwnProperty'](_0x1357('0x30'))){_0x587033[_0x1357('0x1a')]=qs['limit'](_0x1e6521['query'][_0x1357('0x1a')]);_0x587033[_0x1357('0x19')]=qs[_0x1357('0x19')](_0x1e6521['query'][_0x1357('0x19')]);}_0x587033[_0x1357('0x31')]=qs['sort'](_0x1e6521[_0x1357('0x29')][_0x1357('0x32')]);_0x587033[_0x1357('0x33')]=qs[_0x1357('0x2b')](_['pick'](_0x1e6521[_0x1357('0x29')],_0xdc26c9['filters']));if(_0x1e6521['query'][_0x1357('0x34')]){_0x587033[_0x1357('0x33')]=_[_0x1357('0x35')](_0x587033[_0x1357('0x33')],{'$or':_[_0x1357('0x36')](_0x1d085a,function(_0xed46ea){if(_0xed46ea[_0x1357('0x37')][_0x1357('0x38')]!==_0x1357('0x39')){var _0x21a28e={};_0x21a28e[_0xed46ea['field']]={'$like':'%'+_0x1e6521[_0x1357('0x29')][_0x1357('0x34')]+'%'};return _0x21a28e;}})});}_0x587033=_[_0x1357('0x35')]({},_0x587033,_0x1e6521[_0x1357('0x3a')]);var _0x485e0c={'where':_0x587033[_0x1357('0x33')]};return db[_0x1357('0x27')][_0x1357('0x3b')](_0x485e0c)[_0x1357('0x21')](function(_0x491362){_0x4ad769[_0x1357('0x3b')]=_0x491362;if(_0x1e6521[_0x1357('0x29')][_0x1357('0x3c')]){_0x587033[_0x1357('0x3d')]=[{'all':!![]}];}return db[_0x1357('0x27')]['findAll'](_0x587033);})[_0x1357('0x21')](function(_0x480921){_0x4ad769[_0x1357('0x3e')]=_0x480921;return _0x4ad769;})[_0x1357('0x21')](respondWithFilteredResult(_0x431233,_0x587033))['catch'](handleError(_0x431233,null));};exports[_0x1357('0x3f')]=function(_0x4553d8,_0x23622a){var _0x2d20ff={'raw':!![],'where':{'id':_0x4553d8[_0x1357('0x40')]['id']}},_0x4de880={};_0x4de880['model']=_[_0x1357('0x2a')](db[_0x1357('0x27')]['rawAttributes']);_0x4de880['query']=_[_0x1357('0x2a')](_0x4553d8[_0x1357('0x29')]);_0x4de880[_0x1357('0x2b')]=_[_0x1357('0x2c')](_0x4de880['model'],_0x4de880[_0x1357('0x29')]);_0x2d20ff[_0x1357('0x2e')]=_[_0x1357('0x2c')](_0x4de880[_0x1357('0x28')],qs[_0x1357('0x2d')](_0x4553d8[_0x1357('0x29')]['fields']));_0x2d20ff[_0x1357('0x2e')]=_0x2d20ff[_0x1357('0x2e')][_0x1357('0x2f')]?_0x2d20ff[_0x1357('0x2e')]:_0x4de880[_0x1357('0x28')];if(_0x4553d8[_0x1357('0x29')]['includeAll']){_0x2d20ff[_0x1357('0x3d')]=[{'all':!![]}];}_0x2d20ff=_[_0x1357('0x35')]({},_0x2d20ff,_0x4553d8[_0x1357('0x3a')]);return db[_0x1357('0x27')]['find'](_0x2d20ff)['then'](handleEntityNotFound(_0x23622a,null))['then'](respondWithResult(_0x23622a,null))[_0x1357('0x41')](handleError(_0x23622a,null));};exports['create']=function(_0xba3a08,_0x56fdb2){return db[_0x1357('0x27')][_0x1357('0x42')](_0xba3a08[_0x1357('0x43')],{})[_0x1357('0x21')](respondWithResult(_0x56fdb2,0xc9))[_0x1357('0x41')](handleError(_0x56fdb2,null));};exports[_0x1357('0x20')]=function(_0x586d8c,_0x26a6a7){if(_0x586d8c[_0x1357('0x43')]['id']){delete _0x586d8c[_0x1357('0x43')]['id'];}return db[_0x1357('0x27')][_0x1357('0x44')]({'where':{'id':_0x586d8c[_0x1357('0x40')]['id']}})[_0x1357('0x21')](handleEntityNotFound(_0x26a6a7,null))[_0x1357('0x21')](saveUpdates(_0x586d8c[_0x1357('0x43')],null))['then'](respondWithResult(_0x26a6a7,null))[_0x1357('0x41')](handleError(_0x26a6a7,null));};exports[_0x1357('0x22')]=function(_0x3a5aaa,_0x352ce6){return db[_0x1357('0x27')][_0x1357('0x44')]({'where':{'id':_0x3a5aaa[_0x1357('0x40')]['id']}})[_0x1357('0x21')](handleEntityNotFound(_0x352ce6,null))[_0x1357('0x21')](removeEntity(_0x352ce6,null))[_0x1357('0x41')](handleError(_0x352ce6,null));};exports[_0x1357('0x45')]=function(_0x22bf7a,_0x5bbbc4){return db[_0x1357('0x27')][_0x1357('0x45')]()[_0x1357('0x21')](respondWithResult(_0x5bbbc4,null))[_0x1357('0x41')](handleError(_0x5bbbc4,null));}; \ No newline at end of file +var _0x90d2=['util','path','sox','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','OpenchannelQueueReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','field','includeAll','include','rows','show','merge','options','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x139eba,_0x3bac75){var _0x315162=function(_0x3fbab2){while(--_0x3fbab2){_0x139eba['push'](_0x139eba['shift']());}};_0x315162(++_0x3bac75);}(_0x90d2,0x1aa));var _0x290d=function(_0xcfd44a,_0x165cc9){_0xcfd44a=_0xcfd44a-0x0;var _0x46af83=_0x90d2[_0xcfd44a];return _0x46af83;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x290d('0x0'));var rimraf=require(_0x290d('0x1'));var zipdir=require(_0x290d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x290d('0x3'));var moment=require(_0x290d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x290d('0x5'));var util=require(_0x290d('0x6'));var path=require(_0x290d('0x7'));var sox=require(_0x290d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x290d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x290d('0xa'));var deskjs=require(_0x290d('0xb'));var toCsv=require('to-csv');var querystring=require(_0x290d('0xc'));var Papa=require(_0x290d('0xd'));var Redis=require(_0x290d('0xe'));var authService=require(_0x290d('0xf'));var qs=require(_0x290d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x290d('0x11'))(_0x290d('0x12'));var utils=require(_0x290d('0x13'));var config=require(_0x290d('0x14'));var db=require(_0x290d('0x15'))['db'];function respondWithStatusCode(_0x5af173,_0x3afec8){_0x3afec8=_0x3afec8||0xcc;return function(_0x13eec2){if(_0x13eec2){return _0x5af173[_0x290d('0x16')](_0x3afec8);}return _0x5af173[_0x290d('0x17')](_0x3afec8)[_0x290d('0x18')]();};}function respondWithResult(_0x51da6c,_0x1b1339){_0x1b1339=_0x1b1339||0xc8;return function(_0x2bd6d3){if(_0x2bd6d3){return _0x51da6c[_0x290d('0x17')](_0x1b1339)[_0x290d('0x19')](_0x2bd6d3);}};}function respondWithFilteredResult(_0x2aaf29,_0x139ca3){return function(_0x4dba9e){if(_0x4dba9e){var _0xce6462=_0x4dba9e[_0x290d('0x1a')],_0x5564dd=_0x139ca3[_0x290d('0x1b')],_0x7c8bd4=_0x139ca3[_0x290d('0x1b')]+_0x139ca3[_0x290d('0x1c')],_0x40eb3b;if(_0x7c8bd4>=_0xce6462){_0x7c8bd4=_0xce6462;_0x40eb3b=0xc8;}else{_0x40eb3b=0xce;}_0x2aaf29[_0x290d('0x17')](_0x40eb3b);return _0x2aaf29[_0x290d('0x1d')](_0x290d('0x1e'),_0x5564dd+'-'+_0x7c8bd4+'/'+_0xce6462)[_0x290d('0x19')](_0x4dba9e);}return null;};}function patchUpdates(_0x1ab66f){return function(_0x52448d){try{jsonpatch[_0x290d('0x1f')](_0x52448d,_0x1ab66f,!![]);}catch(_0x5c4f0d){return BPromise[_0x290d('0x20')](_0x5c4f0d);}return _0x52448d['save']();};}function saveUpdates(_0x31981f,_0x1900ac){return function(_0x36c5ee){if(_0x36c5ee){return _0x36c5ee[_0x290d('0x21')](_0x31981f)[_0x290d('0x22')](function(_0x5c9d2a){return _0x5c9d2a;});}return null;};}function removeEntity(_0x59f8ff,_0x55b3cc){return function(_0x5d6aae){if(_0x5d6aae){return _0x5d6aae[_0x290d('0x23')]()[_0x290d('0x22')](function(){_0x59f8ff[_0x290d('0x17')](0xcc)[_0x290d('0x18')]();});}};}function handleEntityNotFound(_0x40998d,_0x5630bc){return function(_0x57c048){if(!_0x57c048){_0x40998d['sendStatus'](0x194);}return _0x57c048;};}function handleError(_0xf378f2,_0x5203b8){_0x5203b8=_0x5203b8||0x1f4;return function(_0x1ed444){logger['error'](_0x1ed444[_0x290d('0x24')]);if(_0x1ed444[_0x290d('0x25')]){delete _0x1ed444[_0x290d('0x25')];}_0xf378f2[_0x290d('0x17')](_0x5203b8)[_0x290d('0x26')](_0x1ed444);};}exports[_0x290d('0x27')]=function(_0x4759f9,_0x34e310){var _0x53bca1={},_0x3cfd44={},_0x2290df={'count':0x0,'rows':[]};var _0x3525b7=db[_0x290d('0x28')][_0x290d('0x29')];_0x3cfd44[_0x290d('0x2a')]=_[_0x290d('0x2b')](_0x3525b7);_0x3cfd44[_0x290d('0x2c')]=_['keys'](_0x4759f9[_0x290d('0x2c')]);_0x3cfd44[_0x290d('0x2d')]=_['intersection'](_0x3cfd44[_0x290d('0x2a')],_0x3cfd44[_0x290d('0x2c')]);_0x53bca1[_0x290d('0x2e')]=_[_0x290d('0x2f')](_0x3cfd44['model'],qs[_0x290d('0x30')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x30')]));_0x53bca1[_0x290d('0x2e')]=_0x53bca1[_0x290d('0x2e')][_0x290d('0x31')]?_0x53bca1[_0x290d('0x2e')]:_0x3cfd44[_0x290d('0x2a')];if(!_0x4759f9[_0x290d('0x2c')]['hasOwnProperty'](_0x290d('0x32'))){_0x53bca1['limit']=qs[_0x290d('0x1c')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x1c')]);_0x53bca1[_0x290d('0x1b')]=qs[_0x290d('0x1b')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x1b')]);}_0x53bca1[_0x290d('0x33')]=qs[_0x290d('0x34')](_0x4759f9[_0x290d('0x2c')][_0x290d('0x34')]);_0x53bca1[_0x290d('0x35')]=qs[_0x290d('0x2d')](_[_0x290d('0x36')](_0x4759f9[_0x290d('0x2c')],_0x3cfd44['filters']));if(_0x4759f9[_0x290d('0x2c')][_0x290d('0x37')]){_0x53bca1['where']=_['merge'](_0x53bca1[_0x290d('0x35')],{'$or':_[_0x290d('0x38')](_0x3525b7,function(_0x1a5907){if(_0x1a5907['type'][_0x290d('0x39')]!==_0x290d('0x3a')){var _0x202a02={};_0x202a02[_0x1a5907[_0x290d('0x3b')]]={'$like':'%'+_0x4759f9[_0x290d('0x2c')][_0x290d('0x37')]+'%'};return _0x202a02;}})});}_0x53bca1=_['merge']({},_0x53bca1,_0x4759f9['options']);var _0x204517={'where':_0x53bca1[_0x290d('0x35')]};return db[_0x290d('0x28')][_0x290d('0x1a')](_0x204517)[_0x290d('0x22')](function(_0x1f25bc){_0x2290df[_0x290d('0x1a')]=_0x1f25bc;if(_0x4759f9[_0x290d('0x2c')][_0x290d('0x3c')]){_0x53bca1[_0x290d('0x3d')]=[{'all':!![]}];}return db[_0x290d('0x28')]['findAll'](_0x53bca1);})['then'](function(_0x2109d3){_0x2290df[_0x290d('0x3e')]=_0x2109d3;return _0x2290df;})[_0x290d('0x22')](respondWithFilteredResult(_0x34e310,_0x53bca1))['catch'](handleError(_0x34e310,null));};exports[_0x290d('0x3f')]=function(_0x4a8b62,_0x41d381){var _0x420648={'raw':!![],'where':{'id':_0x4a8b62['params']['id']}},_0x5977b0={};_0x5977b0['model']=_['keys'](db['OpenchannelQueueReport'][_0x290d('0x29')]);_0x5977b0['query']=_['keys'](_0x4a8b62[_0x290d('0x2c')]);_0x5977b0[_0x290d('0x2d')]=_['intersection'](_0x5977b0['model'],_0x5977b0['query']);_0x420648['attributes']=_['intersection'](_0x5977b0[_0x290d('0x2a')],qs[_0x290d('0x30')](_0x4a8b62[_0x290d('0x2c')][_0x290d('0x30')]));_0x420648[_0x290d('0x2e')]=_0x420648['attributes']['length']?_0x420648['attributes']:_0x5977b0[_0x290d('0x2a')];if(_0x4a8b62[_0x290d('0x2c')]['includeAll']){_0x420648['include']=[{'all':!![]}];}_0x420648=_[_0x290d('0x40')]({},_0x420648,_0x4a8b62[_0x290d('0x41')]);return db[_0x290d('0x28')][_0x290d('0x42')](_0x420648)[_0x290d('0x22')](handleEntityNotFound(_0x41d381,null))['then'](respondWithResult(_0x41d381,null))[_0x290d('0x43')](handleError(_0x41d381,null));};exports[_0x290d('0x44')]=function(_0x45104e,_0x22b52e){return db[_0x290d('0x28')][_0x290d('0x44')](_0x45104e[_0x290d('0x45')],{})[_0x290d('0x22')](respondWithResult(_0x22b52e,0xc9))[_0x290d('0x43')](handleError(_0x22b52e,null));};exports[_0x290d('0x21')]=function(_0x413baf,_0x36bcc5){if(_0x413baf[_0x290d('0x45')]['id']){delete _0x413baf[_0x290d('0x45')]['id'];}return db[_0x290d('0x28')][_0x290d('0x42')]({'where':{'id':_0x413baf[_0x290d('0x46')]['id']}})[_0x290d('0x22')](handleEntityNotFound(_0x36bcc5,null))[_0x290d('0x22')](saveUpdates(_0x413baf['body'],null))[_0x290d('0x22')](respondWithResult(_0x36bcc5,null))[_0x290d('0x43')](handleError(_0x36bcc5,null));};exports[_0x290d('0x23')]=function(_0x168761,_0x5fa993){return db['OpenchannelQueueReport'][_0x290d('0x42')]({'where':{'id':_0x168761[_0x290d('0x46')]['id']}})[_0x290d('0x22')](handleEntityNotFound(_0x5fa993,null))[_0x290d('0x22')](removeEntity(_0x5fa993,null))[_0x290d('0x43')](handleError(_0x5fa993,null));};exports['describe']=function(_0x21a15f,_0x2038ab){return db[_0x290d('0x28')][_0x290d('0x47')]()[_0x290d('0x22')](respondWithResult(_0x2038ab,null))['catch'](handleError(_0x2038ab,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 422b121..b8ccd2c 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 _0x6f7f=['OpenchannelQueueReport','report_openchannel_queue','uniqueid','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./openchannelQueueReport.attributes','exports'];(function(_0x32571b,_0x57fd54){var _0x5e44f2=function(_0x3f561c){while(--_0x3f561c){_0x32571b['push'](_0x32571b['shift']());}};_0x5e44f2(++_0x57fd54);}(_0x6f7f,0x177));var _0xf6f7=function(_0x5e9291,_0x18f595){_0x5e9291=_0x5e9291-0x0;var _0x496fa8=_0x6f7f[_0x5e9291];return _0x496fa8;};'use strict';var _=require('lodash');var util=require(_0xf6f7('0x0'));var logger=require(_0xf6f7('0x1'))(_0xf6f7('0x2'));var moment=require(_0xf6f7('0x3'));var BPromise=require(_0xf6f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf6f7('0x5'));var rimraf=require('rimraf');var config=require(_0xf6f7('0x6'));var attributes=require(_0xf6f7('0x7'));module[_0xf6f7('0x8')]=function(_0x5495b9,_0x2f6df9){return _0x5495b9['define'](_0xf6f7('0x9'),attributes,{'tableName':_0xf6f7('0xa'),'paranoid':![],'indexes':[{'name':_0xf6f7('0xb'),'fields':[_0xf6f7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9567=['lodash','util','../../config/logger','api','moment','path','rimraf','./openchannelQueueReport.attributes','define','OpenchannelQueueReport','uniqueid'];(function(_0x406eea,_0x51d589){var _0x3b11ce=function(_0x4ccf9b){while(--_0x4ccf9b){_0x406eea['push'](_0x406eea['shift']());}};_0x3b11ce(++_0x51d589);}(_0x9567,0xdc));var _0x7956=function(_0x32c31d,_0x1b2935){_0x32c31d=_0x32c31d-0x0;var _0x14c6f5=_0x9567[_0x32c31d];return _0x14c6f5;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var logger=require(_0x7956('0x2'))(_0x7956('0x3'));var moment=require(_0x7956('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7956('0x5'));var rimraf=require(_0x7956('0x6'));var config=require('../../config/environment');var attributes=require(_0x7956('0x7'));module['exports']=function(_0x12c09e,_0x48c4b6){return _0x12c09e[_0x7956('0x8')](_0x7956('0x9'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x7956('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index c2856f5..9d08f0b 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 _0x0a08=['code','OpenchannelQueueReport,\x20%s,\x20%s','message','info','OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','debug','stringify','catch','UpdateOpenchannelQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0x0a08,0x1aa));var _0x80a0=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0a08[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0x80a0('0x0'));var moment=require(_0x80a0('0x1'));var BPromise=require(_0x80a0('0x2'));var rs=require(_0x80a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80a0('0x4'))['db'];var utils=require(_0x80a0('0x5'));var logger=require(_0x80a0('0x6'))('rpc');var config=require(_0x80a0('0x7'));var jayson=require(_0x80a0('0x8'));var client=jayson[_0x80a0('0x9')][_0x80a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4177fb,_0x58b605,_0x26de89){return new BPromise(function(_0x436b39,_0x4816e8){return client[_0x80a0('0xb')](_0x4177fb,_0x26de89)[_0x80a0('0xc')](function(_0x58e6ea){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x58b605,_0x80a0('0xd'));logger['debug'](_0x80a0('0xe'),_0x58b605,_0x80a0('0xd'),JSON['stringify'](_0x58e6ea));if(_0x58e6ea[_0x80a0('0xf')]){if(_0x58e6ea[_0x80a0('0xf')][_0x80a0('0x10')]===0x1f4){logger[_0x80a0('0xf')](_0x80a0('0x11'),_0x58b605,_0x58e6ea[_0x80a0('0xf')][_0x80a0('0x12')]);return _0x4816e8(_0x58e6ea[_0x80a0('0xf')][_0x80a0('0x12')]);}logger['error'](_0x80a0('0x11'),_0x58b605,_0x58e6ea[_0x80a0('0xf')]['message']);return _0x436b39(_0x58e6ea[_0x80a0('0xf')][_0x80a0('0x12')]);}else{logger[_0x80a0('0x13')](_0x80a0('0x11'),_0x58b605,'request\x20sent');_0x436b39(_0x58e6ea['result'][_0x80a0('0x12')]);}})['catch'](function(_0x3cf2bb){logger['error'](_0x80a0('0x11'),_0x58b605,_0x3cf2bb);_0x4816e8(_0x3cf2bb);});});}exports['CreateOpenchannelQueueReport']=function(_0x4ae9fb){var _0x5d8138=this;return new Promise(function(_0x8141a9,_0x58b60e){return db[_0x80a0('0x14')][_0x80a0('0x15')](_0x4ae9fb[_0x80a0('0x16')],{'raw':_0x4ae9fb['options']?_0x4ae9fb[_0x80a0('0x17')][_0x80a0('0x18')]===undefined?!![]:![]:!![]})[_0x80a0('0xc')](function(_0x499271){logger[_0x80a0('0x13')](_0x80a0('0x19'),_0x4ae9fb);logger[_0x80a0('0x1a')]('CreateOpenchannelQueueReport',_0x4ae9fb,JSON[_0x80a0('0x1b')](_0x499271));_0x8141a9(_0x499271);})[_0x80a0('0x1c')](function(_0x2e5633){logger[_0x80a0('0xf')]('CreateOpenchannelQueueReport',_0x2e5633[_0x80a0('0x12')],_0x4ae9fb);_0x58b60e(_0x5d8138[_0x80a0('0xf')](0x1f4,_0x2e5633[_0x80a0('0x12')]));});});};exports[_0x80a0('0x1d')]=function(_0x1818e0){var _0x4766c4=this;return new Promise(function(_0x2abacd,_0x308de4){return db[_0x80a0('0x14')][_0x80a0('0x1e')](_0x1818e0[_0x80a0('0x16')],{'raw':_0x1818e0[_0x80a0('0x17')]?_0x1818e0[_0x80a0('0x17')][_0x80a0('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1818e0[_0x80a0('0x17')]?_0x1818e0[_0x80a0('0x17')][_0x80a0('0x1f')]||null:null,'attributes':_0x1818e0[_0x80a0('0x17')]?_0x1818e0[_0x80a0('0x17')][_0x80a0('0x20')]||null:null,'limit':_0x1818e0['options']?_0x1818e0[_0x80a0('0x17')][_0x80a0('0x21')]||null:null})[_0x80a0('0xc')](function(_0xd5404c){logger[_0x80a0('0x13')](_0x80a0('0x1d'),_0x1818e0);logger[_0x80a0('0x1a')](_0x80a0('0x1d'),_0x1818e0,JSON[_0x80a0('0x1b')](_0xd5404c));_0x2abacd(_0xd5404c);})[_0x80a0('0x1c')](function(_0x5485ea){logger[_0x80a0('0xf')](_0x80a0('0x1d'),_0x5485ea[_0x80a0('0x12')],_0x1818e0);_0x308de4(_0x4766c4['error'](0x1f4,_0x5485ea['message']));});});}; \ No newline at end of file +var _0x4e06=['request','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','info','stringify','UpdateOpenchannelQueueReport','update','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4e06,0x1bb));var _0x64e0=function(_0x45996b,_0x145516){_0x45996b=_0x45996b-0x0;var _0x2defda=_0x4e06[_0x45996b];return _0x2defda;};'use strict';var _=require(_0x64e0('0x0'));var util=require(_0x64e0('0x1'));var moment=require(_0x64e0('0x2'));var BPromise=require('bluebird');var rs=require(_0x64e0('0x3'));var fs=require('fs');var Redis=require(_0x64e0('0x4'));var db=require(_0x64e0('0x5'))['db'];var utils=require(_0x64e0('0x6'));var logger=require(_0x64e0('0x7'))(_0x64e0('0x8'));var config=require(_0x64e0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x64e0('0xa')][_0x64e0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cea6c,_0x469504,_0x3bd2ff){return new BPromise(function(_0x1aeec8,_0x243777){return client[_0x64e0('0xc')](_0x2cea6c,_0x3bd2ff)['then'](function(_0x3b4736){logger['info'](_0x64e0('0xd'),_0x469504,_0x64e0('0xe'));logger[_0x64e0('0xf')](_0x64e0('0x10'),_0x469504,_0x64e0('0xe'),JSON['stringify'](_0x3b4736));if(_0x3b4736[_0x64e0('0x11')]){if(_0x3b4736[_0x64e0('0x11')][_0x64e0('0x12')]===0x1f4){logger[_0x64e0('0x11')](_0x64e0('0xd'),_0x469504,_0x3b4736['error']['message']);return _0x243777(_0x3b4736[_0x64e0('0x11')][_0x64e0('0x13')]);}logger[_0x64e0('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x469504,_0x3b4736[_0x64e0('0x11')][_0x64e0('0x13')]);return _0x1aeec8(_0x3b4736[_0x64e0('0x11')][_0x64e0('0x13')]);}else{logger['info'](_0x64e0('0xd'),_0x469504,_0x64e0('0xe'));_0x1aeec8(_0x3b4736[_0x64e0('0x14')][_0x64e0('0x13')]);}})[_0x64e0('0x15')](function(_0x54ce99){logger[_0x64e0('0x11')](_0x64e0('0xd'),_0x469504,_0x54ce99);_0x243777(_0x54ce99);});});}exports[_0x64e0('0x16')]=function(_0x393904){var _0x51b9a5=this;return new Promise(function(_0x401e18,_0x3d8320){return db[_0x64e0('0x17')][_0x64e0('0x18')](_0x393904[_0x64e0('0x19')],{'raw':_0x393904[_0x64e0('0x1a')]?_0x393904[_0x64e0('0x1a')][_0x64e0('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x57f1b4){logger[_0x64e0('0x1c')](_0x64e0('0x16'),_0x393904);logger[_0x64e0('0xf')](_0x64e0('0x16'),_0x393904,JSON[_0x64e0('0x1d')](_0x57f1b4));_0x401e18(_0x57f1b4);})[_0x64e0('0x15')](function(_0x245d9b){logger['error'](_0x64e0('0x16'),_0x245d9b[_0x64e0('0x13')],_0x393904);_0x3d8320(_0x51b9a5[_0x64e0('0x11')](0x1f4,_0x245d9b[_0x64e0('0x13')]));});});};exports[_0x64e0('0x1e')]=function(_0x5e7808){var _0x547c1e=this;return new Promise(function(_0x49fc91,_0x8d0862){return db['OpenchannelQueueReport'][_0x64e0('0x1f')](_0x5e7808[_0x64e0('0x19')],{'raw':_0x5e7808[_0x64e0('0x1a')]?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e7808['options']?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x20')]||null:null,'attributes':_0x5e7808['options']?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x21')]||null:null,'limit':_0x5e7808[_0x64e0('0x1a')]?_0x5e7808[_0x64e0('0x1a')][_0x64e0('0x22')]||null:null})['then'](function(_0x43b5f9){logger[_0x64e0('0x1c')](_0x64e0('0x1e'),_0x5e7808);logger[_0x64e0('0xf')](_0x64e0('0x1e'),_0x5e7808,JSON[_0x64e0('0x1d')](_0x43b5f9));_0x49fc91(_0x43b5f9);})['catch'](function(_0x5410a5){logger[_0x64e0('0x11')](_0x64e0('0x1e'),_0x5410a5['message'],_0x5e7808);_0x8d0862(_0x547c1e[_0x64e0('0x11')](0x1f4,_0x5410a5[_0x64e0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 51965d4..5d6d76c 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 _0xfc85=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','create','put','update','delete','destroy'];(function(_0xe78a99,_0x5a738c){var _0x1040f5=function(_0x4be092){while(--_0x4be092){_0xe78a99['push'](_0xe78a99['shift']());}};_0x1040f5(++_0x5a738c);}(_0xfc85,0x1a5));var _0x5fc8=function(_0x225688,_0x3f9406){_0x225688=_0x225688-0x0;var _0x5bc7dd=_0xfc85[_0x225688];return _0x5bc7dd;};'use strict';var multer=require(_0x5fc8('0x0'));var util=require(_0x5fc8('0x1'));var path=require(_0x5fc8('0x2'));var timeout=require(_0x5fc8('0x3'));var express=require(_0x5fc8('0x4'));var router=express[_0x5fc8('0x5')]();var auth=require(_0x5fc8('0x6'));var interaction=require(_0x5fc8('0x7'));var config=require(_0x5fc8('0x8'));var controller=require('./openchannelTransferReport.controller');router['get']('/',auth[_0x5fc8('0x9')](),controller[_0x5fc8('0xa')]);router[_0x5fc8('0xb')](_0x5fc8('0xc'),auth[_0x5fc8('0x9')](),controller[_0x5fc8('0xd')]);router[_0x5fc8('0xb')](_0x5fc8('0xe'),auth[_0x5fc8('0x9')](),controller['show']);router['post']('/',auth[_0x5fc8('0x9')](),controller[_0x5fc8('0xf')]);router[_0x5fc8('0x10')](_0x5fc8('0xe'),auth['isAuthenticated'](),controller[_0x5fc8('0x11')]);router[_0x5fc8('0x12')]('/:id',auth[_0x5fc8('0x9')](),controller[_0x5fc8('0x13')]);module[_0x5fc8('0x14')]=router; \ No newline at end of file +var _0x2525=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','describe','isAuthenticated','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2525,0x9f));var _0x5252=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x2525[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x5252('0x0'));var util=require('util');var path=require(_0x5252('0x1'));var timeout=require(_0x5252('0x2'));var express=require(_0x5252('0x3'));var router=express[_0x5252('0x4')]();var auth=require(_0x5252('0x5'));var interaction=require(_0x5252('0x6'));var config=require(_0x5252('0x7'));var controller=require(_0x5252('0x8'));router[_0x5252('0x9')]('/',auth['isAuthenticated'](),controller[_0x5252('0xa')]);router[_0x5252('0x9')](_0x5252('0xb'),auth['isAuthenticated'](),controller[_0x5252('0xc')]);router[_0x5252('0x9')]('/:id',auth[_0x5252('0xd')](),controller[_0x5252('0xe')]);router['post']('/',auth[_0x5252('0xd')](),controller[_0x5252('0xf')]);router[_0x5252('0x10')](_0x5252('0x11'),auth[_0x5252('0xd')](),controller[_0x5252('0x12')]);router[_0x5252('0x13')](_0x5252('0x11'),auth[_0x5252('0xd')](),controller[_0x5252('0x14')]);module[_0x5252('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 a0948b1..b27f607 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 _0x5fe4=['NOW','moment','sequelize','exports','STRING','ENUM','agent','queue','DATE'];(function(_0x50aaaf,_0x51b43a){var _0x162f02=function(_0x2c9966){while(--_0x2c9966){_0x50aaaf['push'](_0x50aaaf['shift']());}};_0x162f02(++_0x51b43a);}(_0x5fe4,0x184));var _0x45fe=function(_0x206b26,_0x5af0e7){_0x206b26=_0x206b26-0x0;var _0x512772=_0x5fe4[_0x206b26];return _0x512772;};'use strict';var moment=require(_0x45fe('0x0'));var Sequelize=require(_0x45fe('0x1'));module[_0x45fe('0x2')]={'uniqueid':{'type':Sequelize[_0x45fe('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x45fe('0x4')]('account',_0x45fe('0x5'),_0x45fe('0x6')),'allowNull':![],'defaultValue':_0x45fe('0x6')},'transferredAt':{'type':Sequelize[_0x45fe('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x45fe('0x8')]}}; \ No newline at end of file +var _0xd508=['sequelize','STRING','agent','queue','DATE','moment'];(function(_0x3d5d43,_0x9d65ef){var _0x54cebc=function(_0x27984e){while(--_0x27984e){_0x3d5d43['push'](_0x3d5d43['shift']());}};_0x54cebc(++_0x9d65ef);}(_0xd508,0xb9));var _0x8d50=function(_0x4ad720,_0x5e8523){_0x4ad720=_0x4ad720-0x0;var _0x30f9de=_0xd508[_0x4ad720];return _0x30f9de;};'use strict';var moment=require(_0x8d50('0x0'));var Sequelize=require(_0x8d50('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8d50('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x8d50('0x3'),_0x8d50('0x4')),'allowNull':![],'defaultValue':_0x8d50('0x4')},'transferredAt':{'type':Sequelize[_0x8d50('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index f573e68..474009c 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 _0xac4a=['Content-Range','apply','reject','save','then','destroy','stack','index','OpenchannelTransferReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','params','length','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset'];(function(_0x6b8170,_0x572786){var _0x5bbbe7=function(_0x3f7313){while(--_0x3f7313){_0x6b8170['push'](_0x6b8170['shift']());}};_0x5bbbe7(++_0x572786);}(_0xac4a,0x13f));var _0xaac4=function(_0x5bc120,_0x2987d3){_0x5bc120=_0x5bc120-0x0;var _0x146276=_0xac4a[_0x5bc120];return _0x146276;};'use strict';var pdf=require(_0xaac4('0x0'));var emlformat=require(_0xaac4('0x1'));var rimraf=require(_0xaac4('0x2'));var zipdir=require(_0xaac4('0x3'));var jsonpatch=require(_0xaac4('0x4'));var rp=require(_0xaac4('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xaac4('0x6'));var util=require(_0xaac4('0x7'));var path=require(_0xaac4('0x8'));var sox=require('sox');var csv=require(_0xaac4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var hardwareService=require(_0xaac4('0xf'));var logger=require(_0xaac4('0x10'))(_0xaac4('0x11'));var utils=require(_0xaac4('0x12'));var config=require(_0xaac4('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508e14,_0x2348c2){_0x2348c2=_0x2348c2||0xcc;return function(_0x2e2d02){if(_0x2e2d02){return _0x508e14[_0xaac4('0x14')](_0x2348c2);}return _0x508e14['status'](_0x2348c2)[_0xaac4('0x15')]();};}function respondWithResult(_0x45c129,_0x5bcacd){_0x5bcacd=_0x5bcacd||0xc8;return function(_0xf06b1d){if(_0xf06b1d){return _0x45c129[_0xaac4('0x16')](_0x5bcacd)[_0xaac4('0x17')](_0xf06b1d);}};}function respondWithFilteredResult(_0x150fdd,_0x187624){return function(_0x2fbeb7){if(_0x2fbeb7){var _0x31b7e5=_0x2fbeb7[_0xaac4('0x18')],_0x1df9ae=_0x187624[_0xaac4('0x19')],_0x233278=_0x187624[_0xaac4('0x19')]+_0x187624['limit'],_0xb8466e;if(_0x233278>=_0x31b7e5){_0x233278=_0x31b7e5;_0xb8466e=0xc8;}else{_0xb8466e=0xce;}_0x150fdd[_0xaac4('0x16')](_0xb8466e);return _0x150fdd['set'](_0xaac4('0x1a'),_0x1df9ae+'-'+_0x233278+'/'+_0x31b7e5)['json'](_0x2fbeb7);}return null;};}function patchUpdates(_0x3ce35a){return function(_0x27fe7b){try{jsonpatch[_0xaac4('0x1b')](_0x27fe7b,_0x3ce35a,!![]);}catch(_0x271bcb){return BPromise[_0xaac4('0x1c')](_0x271bcb);}return _0x27fe7b[_0xaac4('0x1d')]();};}function saveUpdates(_0x44f0e8,_0x25b946){return function(_0x4166ee){if(_0x4166ee){return _0x4166ee['update'](_0x44f0e8)[_0xaac4('0x1e')](function(_0x4e1e89){return _0x4e1e89;});}return null;};}function removeEntity(_0x3303f1,_0x2013b7){return function(_0x43625c){if(_0x43625c){return _0x43625c[_0xaac4('0x1f')]()[_0xaac4('0x1e')](function(){_0x3303f1[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43ccdc,_0x27a84d){return function(_0x174860){if(!_0x174860){_0x43ccdc[_0xaac4('0x14')](0x194);}return _0x174860;};}function handleError(_0x3dd059,_0x2dcc59){_0x2dcc59=_0x2dcc59||0x1f4;return function(_0xb2577b){logger['error'](_0xb2577b[_0xaac4('0x20')]);if(_0xb2577b['name']){delete _0xb2577b['name'];}_0x3dd059['status'](_0x2dcc59)['send'](_0xb2577b);};}exports[_0xaac4('0x21')]=function(_0x17d25f,_0x22cda2){var _0xe93120={},_0x3c1445={},_0x249a5d={'count':0x0,'rows':[]};var _0x43b122=db[_0xaac4('0x22')][_0xaac4('0x23')];_0x3c1445[_0xaac4('0x24')]=_['keys'](_0x43b122);_0x3c1445[_0xaac4('0x25')]=_[_0xaac4('0x26')](_0x17d25f[_0xaac4('0x25')]);_0x3c1445[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x3c1445[_0xaac4('0x24')],_0x3c1445['query']);_0xe93120[_0xaac4('0x29')]=_['intersection'](_0x3c1445[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2a')]));_0xe93120['attributes']=_0xe93120['attributes']['length']?_0xe93120[_0xaac4('0x29')]:_0x3c1445[_0xaac4('0x24')];if(!_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2b')](_0xaac4('0x2c'))){_0xe93120[_0xaac4('0x2d')]=qs[_0xaac4('0x2d')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x2d')]);_0xe93120[_0xaac4('0x19')]=qs[_0xaac4('0x19')](_0x17d25f[_0xaac4('0x25')][_0xaac4('0x19')]);}_0xe93120[_0xaac4('0x2e')]=qs[_0xaac4('0x2f')](_0x17d25f['query']['sort']);_0xe93120[_0xaac4('0x30')]=qs[_0xaac4('0x27')](_[_0xaac4('0x31')](_0x17d25f['query'],_0x3c1445[_0xaac4('0x27')]));if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x32')]){_0xe93120[_0xaac4('0x30')]=_[_0xaac4('0x33')](_0xe93120[_0xaac4('0x30')],{'$or':_[_0xaac4('0x34')](_0x43b122,function(_0x53b7cb){if(_0x53b7cb[_0xaac4('0x35')][_0xaac4('0x36')]!==_0xaac4('0x37')){var _0x5d64a2={};_0x5d64a2[_0x53b7cb[_0xaac4('0x38')]]={'$like':'%'+_0x17d25f['query']['filter']+'%'};return _0x5d64a2;}})});}_0xe93120=_[_0xaac4('0x33')]({},_0xe93120,_0x17d25f[_0xaac4('0x39')]);var _0x2da28a={'where':_0xe93120['where']};return db['OpenchannelTransferReport'][_0xaac4('0x18')](_0x2da28a)[_0xaac4('0x1e')](function(_0x2f7300){_0x249a5d[_0xaac4('0x18')]=_0x2f7300;if(_0x17d25f[_0xaac4('0x25')][_0xaac4('0x3a')]){_0xe93120['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xaac4('0x3b')](_0xe93120);})[_0xaac4('0x1e')](function(_0x5371b4){_0x249a5d[_0xaac4('0x3c')]=_0x5371b4;return _0x249a5d;})[_0xaac4('0x1e')](respondWithFilteredResult(_0x22cda2,_0xe93120))[_0xaac4('0x3d')](handleError(_0x22cda2,null));};exports['show']=function(_0x74a1c,_0x4a4773){var _0x2259fc={'raw':!![],'where':{'id':_0x74a1c[_0xaac4('0x3e')]['id']}},_0x5bc387={};_0x5bc387[_0xaac4('0x24')]=_[_0xaac4('0x26')](db[_0xaac4('0x22')]['rawAttributes']);_0x5bc387[_0xaac4('0x25')]=_['keys'](_0x74a1c['query']);_0x5bc387[_0xaac4('0x27')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],_0x5bc387[_0xaac4('0x25')]);_0x2259fc[_0xaac4('0x29')]=_[_0xaac4('0x28')](_0x5bc387[_0xaac4('0x24')],qs[_0xaac4('0x2a')](_0x74a1c['query'][_0xaac4('0x2a')]));_0x2259fc[_0xaac4('0x29')]=_0x2259fc[_0xaac4('0x29')][_0xaac4('0x3f')]?_0x2259fc['attributes']:_0x5bc387[_0xaac4('0x24')];if(_0x74a1c[_0xaac4('0x25')][_0xaac4('0x3a')]){_0x2259fc['include']=[{'all':!![]}];}_0x2259fc=_[_0xaac4('0x33')]({},_0x2259fc,_0x74a1c[_0xaac4('0x39')]);return db[_0xaac4('0x22')][_0xaac4('0x40')](_0x2259fc)['then'](handleEntityNotFound(_0x4a4773,null))[_0xaac4('0x1e')](respondWithResult(_0x4a4773,null))[_0xaac4('0x3d')](handleError(_0x4a4773,null));};exports[_0xaac4('0x41')]=function(_0x57a7ab,_0xf404b9){return db[_0xaac4('0x22')][_0xaac4('0x41')](_0x57a7ab[_0xaac4('0x42')],{})[_0xaac4('0x1e')](respondWithResult(_0xf404b9,0xc9))[_0xaac4('0x3d')](handleError(_0xf404b9,null));};exports[_0xaac4('0x43')]=function(_0xa8d1c9,_0x6c713){if(_0xa8d1c9['body']['id']){delete _0xa8d1c9[_0xaac4('0x42')]['id'];}return db[_0xaac4('0x22')][_0xaac4('0x40')]({'where':{'id':_0xa8d1c9[_0xaac4('0x3e')]['id']}})[_0xaac4('0x1e')](handleEntityNotFound(_0x6c713,null))['then'](saveUpdates(_0xa8d1c9['body'],null))[_0xaac4('0x1e')](respondWithResult(_0x6c713,null))[_0xaac4('0x3d')](handleError(_0x6c713,null));};exports[_0xaac4('0x1f')]=function(_0x16c7f4,_0x5f33ea){return db[_0xaac4('0x22')]['find']({'where':{'id':_0x16c7f4[_0xaac4('0x3e')]['id']}})[_0xaac4('0x1e')](handleEntityNotFound(_0x5f33ea,null))['then'](removeEntity(_0x5f33ea,null))[_0xaac4('0x3d')](handleError(_0x5f33ea,null));};exports[_0xaac4('0x44')]=function(_0x357bc6,_0x5cbbdc){return db['OpenchannelTransferReport'][_0xaac4('0x44')]()[_0xaac4('0x1e')](respondWithResult(_0x5cbbdc,null))[_0xaac4('0x3d')](handleError(_0x5cbbdc,null));}; \ No newline at end of file +var _0xa9e0=['where','pick','filter','merge','type','key','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','update','destroy','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','send','index','OpenchannelTransferReport','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort'];(function(_0x222dfe,_0x486655){var _0xd98a75=function(_0x8395f0){while(--_0x8395f0){_0x222dfe['push'](_0x222dfe['shift']());}};_0xd98a75(++_0x486655);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x30bae6,_0x4abc77){return function(_0xfb6e48){if(!_0xfb6e48){_0x30bae6[_0x0a9e('0x13')](0x194);}return _0xfb6e48;};}function handleError(_0x3b45bc,_0x4d00e6){_0x4d00e6=_0x4d00e6||0x1f4;return function(_0x370d86){logger[_0x0a9e('0x20')](_0x370d86[_0x0a9e('0x21')]);if(_0x370d86['name']){delete _0x370d86['name'];}_0x3b45bc[_0x0a9e('0x14')](_0x4d00e6)[_0x0a9e('0x22')](_0x370d86);};}exports[_0x0a9e('0x23')]=function(_0x33161b,_0x526cf3){var _0x384319={},_0x479bc4={},_0x45a1e7={'count':0x0,'rows':[]};var _0x5bfb33=db[_0x0a9e('0x24')][_0x0a9e('0x25')];_0x479bc4[_0x0a9e('0x26')]=_[_0x0a9e('0x27')](_0x5bfb33);_0x479bc4[_0x0a9e('0x28')]=_[_0x0a9e('0x27')](_0x33161b[_0x0a9e('0x28')]);_0x479bc4[_0x0a9e('0x29')]=_['intersection'](_0x479bc4[_0x0a9e('0x26')],_0x479bc4[_0x0a9e('0x28')]);_0x384319[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x479bc4['model'],qs[_0x0a9e('0x2c')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x384319[_0x0a9e('0x2a')]=_0x384319[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x384319[_0x0a9e('0x2a')]:_0x479bc4[_0x0a9e('0x26')];if(!_0x33161b[_0x0a9e('0x28')]['hasOwnProperty'](_0x0a9e('0x2e'))){_0x384319['limit']=qs[_0x0a9e('0x19')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x19')]);_0x384319[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x33161b['query'][_0x0a9e('0x18')]);}_0x384319[_0x0a9e('0x2f')]=qs[_0x0a9e('0x30')](_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x30')]);_0x384319[_0x0a9e('0x31')]=qs[_0x0a9e('0x29')](_[_0x0a9e('0x32')](_0x33161b['query'],_0x479bc4[_0x0a9e('0x29')]));if(_0x33161b['query'][_0x0a9e('0x33')]){_0x384319[_0x0a9e('0x31')]=_[_0x0a9e('0x34')](_0x384319[_0x0a9e('0x31')],{'$or':_['map'](_0x5bfb33,function(_0x191e91){if(_0x191e91[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4853b1={};_0x4853b1[_0x191e91['field']]={'$like':'%'+_0x33161b[_0x0a9e('0x28')]['filter']+'%'};return _0x4853b1;}})});}_0x384319=_[_0x0a9e('0x34')]({},_0x384319,_0x33161b[_0x0a9e('0x38')]);var _0x381c37={'where':_0x384319[_0x0a9e('0x31')]};return db['OpenchannelTransferReport'][_0x0a9e('0x17')](_0x381c37)[_0x0a9e('0x1f')](function(_0x3cae){_0x45a1e7['count']=_0x3cae;if(_0x33161b[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x384319[_0x0a9e('0x3a')]=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x384319);})[_0x0a9e('0x1f')](function(_0x40d766){_0x45a1e7['rows']=_0x40d766;return _0x45a1e7;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x526cf3,_0x384319))[_0x0a9e('0x3b')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x3c')]=function(_0x148f55,_0x4b38d9){var _0x5a594b={'raw':!![],'where':{'id':_0x148f55[_0x0a9e('0x3d')]['id']}},_0x15e37d={};_0x15e37d['model']=_[_0x0a9e('0x27')](db[_0x0a9e('0x24')][_0x0a9e('0x25')]);_0x15e37d['query']=_[_0x0a9e('0x27')](_0x148f55[_0x0a9e('0x28')]);_0x15e37d[_0x0a9e('0x29')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],_0x15e37d[_0x0a9e('0x28')]);_0x5a594b[_0x0a9e('0x2a')]=_[_0x0a9e('0x2b')](_0x15e37d[_0x0a9e('0x26')],qs[_0x0a9e('0x2c')](_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x2c')]));_0x5a594b[_0x0a9e('0x2a')]=_0x5a594b[_0x0a9e('0x2a')][_0x0a9e('0x2d')]?_0x5a594b['attributes']:_0x15e37d['model'];if(_0x148f55[_0x0a9e('0x28')][_0x0a9e('0x39')]){_0x5a594b[_0x0a9e('0x3a')]=[{'all':!![]}];}_0x5a594b=_[_0x0a9e('0x34')]({},_0x5a594b,_0x148f55[_0x0a9e('0x38')]);return db[_0x0a9e('0x24')][_0x0a9e('0x3e')](_0x5a594b)[_0x0a9e('0x1f')](handleEntityNotFound(_0x4b38d9,null))[_0x0a9e('0x1f')](respondWithResult(_0x4b38d9,null))[_0x0a9e('0x3b')](handleError(_0x4b38d9,null));};exports[_0x0a9e('0x3f')]=function(_0x35ed4a,_0x5026aa){return db[_0x0a9e('0x24')][_0x0a9e('0x3f')](_0x35ed4a[_0x0a9e('0x40')],{})[_0x0a9e('0x1f')](respondWithResult(_0x5026aa,0xc9))[_0x0a9e('0x3b')](handleError(_0x5026aa,null));};exports[_0x0a9e('0x41')]=function(_0x21eb86,_0x44dd99){if(_0x21eb86['body']['id']){delete _0x21eb86[_0x0a9e('0x40')]['id'];}return db['OpenchannelTransferReport'][_0x0a9e('0x3e')]({'where':{'id':_0x21eb86[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x44dd99,null))['then'](saveUpdates(_0x21eb86[_0x0a9e('0x40')],null))[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,null))[_0x0a9e('0x3b')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x42')]=function(_0x45c845,_0x37be73){return db[_0x0a9e('0x24')]['find']({'where':{'id':_0x45c845[_0x0a9e('0x3d')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x1f')](removeEntity(_0x37be73,null))[_0x0a9e('0x3b')](handleError(_0x37be73,null));};exports[_0x0a9e('0x43')]=function(_0x992c77,_0x6054ee){return db[_0x0a9e('0x24')][_0x0a9e('0x43')]()['then'](respondWithResult(_0x6054ee,null))[_0x0a9e('0x3b')](handleError(_0x6054ee,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 3304c4d..9864ff6 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 _0x3648=['moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x558910,_0x1a38ea){var _0x1b8228=function(_0x2a2bdd){while(--_0x2a2bdd){_0x558910['push'](_0x558910['shift']());}};_0x1b8228(++_0x1a38ea);}(_0x3648,0x13e));var _0x8364=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3648[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8364('0x0'));var util=require(_0x8364('0x1'));var logger=require(_0x8364('0x2'))(_0x8364('0x3'));var moment=require(_0x8364('0x4'));var BPromise=require(_0x8364('0x5'));var rp=require(_0x8364('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8364('0x7'));var config=require(_0x8364('0x8'));var attributes=require(_0x8364('0x9'));module[_0x8364('0xa')]=function(_0x7ac263,_0x45ca6e){return _0x7ac263[_0x8364('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0x8364('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8364('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda9a=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x321903,_0x43e0bf){var _0x5ef22a=function(_0xa541f3){while(--_0xa541f3){_0x321903['push'](_0x321903['shift']());}};_0x5ef22a(++_0x43e0bf);}(_0xda9a,0x1a3));var _0xada9=function(_0xd344ef,_0x132b5f){_0xd344ef=_0xd344ef-0x0;var _0x50a171=_0xda9a[_0xd344ef];return _0x50a171;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xada9('0x0'));var moment=require(_0xada9('0x1'));var BPromise=require(_0xada9('0x2'));var rp=require(_0xada9('0x3'));var fs=require('fs');var path=require(_0xada9('0x4'));var rimraf=require(_0xada9('0x5'));var config=require(_0xada9('0x6'));var attributes=require(_0xada9('0x7'));module[_0xada9('0x8')]=function(_0x5dee42,_0x5a7b0c){return _0x5dee42[_0xada9('0x9')](_0xada9('0xa'),attributes,{'tableName':_0xada9('0xb'),'paranoid':![],'indexes':[{'name':_0xada9('0xc'),'fields':[_0xada9('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 2856d56..4c65efe 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 _0x2b6d=['then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2dcbdf,_0x2a134f){var _0x3fe4f1=function(_0xa6bc7c){while(--_0xa6bc7c){_0x2dcbdf['push'](_0x2dcbdf['shift']());}};_0x3fe4f1(++_0x2a134f);}(_0x2b6d,0x1d6));var _0xd2b6=function(_0x946bf3,_0x344771){_0x946bf3=_0x946bf3-0x0;var _0x1d0523=_0x2b6d[_0x946bf3];return _0x1d0523;};'use strict';var _=require(_0xd2b6('0x0'));var util=require(_0xd2b6('0x1'));var moment=require(_0xd2b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xd2b6('0x3'));var fs=require('fs');var Redis=require(_0xd2b6('0x4'));var db=require(_0xd2b6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd2b6('0x6'))(_0xd2b6('0x7'));var config=require(_0xd2b6('0x8'));var jayson=require(_0xd2b6('0x9'));var client=jayson[_0xd2b6('0xa')][_0xd2b6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3af77e,_0x11ffc6,_0x2f43bb){return new BPromise(function(_0x37ba35,_0x577d34){return client[_0xd2b6('0xc')](_0x3af77e,_0x2f43bb)[_0xd2b6('0xd')](function(_0x3f09c8){logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,_0xd2b6('0x10'));logger[_0xd2b6('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x11ffc6,_0xd2b6('0x10'),JSON[_0xd2b6('0x12')](_0x3f09c8));if(_0x3f09c8[_0xd2b6('0x13')]){if(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x14')]===0x1f4){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);return _0x577d34(_0x3f09c8['error'][_0xd2b6('0x15')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x11ffc6,_0x3f09c8['error'][_0xd2b6('0x15')]);return _0x37ba35(_0x3f09c8[_0xd2b6('0x13')][_0xd2b6('0x15')]);}else{logger[_0xd2b6('0xe')](_0xd2b6('0xf'),_0x11ffc6,'request\x20sent');_0x37ba35(_0x3f09c8['result'][_0xd2b6('0x15')]);}})[_0xd2b6('0x16')](function(_0x4b73eb){logger[_0xd2b6('0x13')](_0xd2b6('0xf'),_0x11ffc6,_0x4b73eb);_0x577d34(_0x4b73eb);});});} \ No newline at end of file +var _0x30a7=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x1fe010,_0x5761eb){var _0x15e4a1=function(_0x45565d){while(--_0x45565d){_0x1fe010['push'](_0x1fe010['shift']());}};_0x15e4a1(++_0x5761eb);}(_0x30a7,0xf1));var _0x730a=function(_0x21b18c,_0x4b553f){_0x21b18c=_0x21b18c-0x0;var _0x5232d7=_0x30a7[_0x21b18c];return _0x5232d7;};'use strict';var _=require('lodash');var util=require(_0x730a('0x0'));var moment=require(_0x730a('0x1'));var BPromise=require(_0x730a('0x2'));var rs=require(_0x730a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x730a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x730a('0x5'))('rpc');var config=require(_0x730a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x730a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b0cca,_0x4d9cc5,_0x1c9ee1){return new BPromise(function(_0xfb74fb,_0x45a63b){return client['request'](_0x1b0cca,_0x1c9ee1)[_0x730a('0x8')](function(_0x324e00){logger[_0x730a('0x9')](_0x730a('0xa'),_0x4d9cc5,'request\x20sent');logger['debug'](_0x730a('0xb'),_0x4d9cc5,_0x730a('0xc'),JSON[_0x730a('0xd')](_0x324e00));if(_0x324e00[_0x730a('0xe')]){if(_0x324e00[_0x730a('0xe')]['code']===0x1f4){logger[_0x730a('0xe')](_0x730a('0xa'),_0x4d9cc5,_0x324e00[_0x730a('0xe')][_0x730a('0xf')]);return _0x45a63b(_0x324e00[_0x730a('0xe')]['message']);}logger[_0x730a('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4d9cc5,_0x324e00['error'][_0x730a('0xf')]);return _0xfb74fb(_0x324e00[_0x730a('0xe')]['message']);}else{logger['info'](_0x730a('0xa'),_0x4d9cc5,_0x730a('0xc'));_0xfb74fb(_0x324e00[_0x730a('0x10')][_0x730a('0xf')]);}})[_0x730a('0x11')](function(_0x515a8a){logger[_0x730a('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4d9cc5,_0x515a8a);_0x45a63b(_0x515a8a);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a78d285..22e118d 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 _0x0439=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./pause.controller','get','index','isAuthenticated','show'];(function(_0x720b1d,_0x3b9518){var _0x341a06=function(_0x2894a4){while(--_0x2894a4){_0x720b1d['push'](_0x720b1d['shift']());}};_0x341a06(++_0x3b9518);}(_0x0439,0xdd));var _0x9043=function(_0x4201de,_0x43ac07){_0x4201de=_0x4201de-0x0;var _0x3fef97=_0x0439[_0x4201de];return _0x3fef97;};'use strict';var multer=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var path=require(_0x9043('0x2'));var timeout=require(_0x9043('0x3'));var express=require(_0x9043('0x4'));var router=express[_0x9043('0x5')]();var auth=require(_0x9043('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9043('0x7'));var controller=require(_0x9043('0x8'));router[_0x9043('0x9')]('/',auth['isAuthenticated'](),controller[_0x9043('0xa')]);router['get']('/:id',auth[_0x9043('0xb')](),controller[_0x9043('0xc')]);router['post']('/',auth[_0x9043('0xb')](),controller['create']);router[_0x9043('0xd')](_0x9043('0xe'),auth['isAuthenticated'](),controller[_0x9043('0xf')]);router[_0x9043('0x10')](_0x9043('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x9043('0x11')]=router; \ No newline at end of file +var _0x0f73=['show','post','create','put','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','/:id'];(function(_0x3098ab,_0x56f9bd){var _0x2026b7=function(_0x50bd8d){while(--_0x50bd8d){_0x3098ab['push'](_0x3098ab['shift']());}};_0x2026b7(++_0x56f9bd);}(_0x0f73,0x146));var _0x30f7=function(_0xe3385a,_0x3258df){_0xe3385a=_0xe3385a-0x0;var _0x203820=_0x0f73[_0xe3385a];return _0x203820;};'use strict';var multer=require(_0x30f7('0x0'));var util=require(_0x30f7('0x1'));var path=require(_0x30f7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x30f7('0x3')]();var auth=require(_0x30f7('0x4'));var interaction=require(_0x30f7('0x5'));var config=require(_0x30f7('0x6'));var controller=require(_0x30f7('0x7'));router['get']('/',auth[_0x30f7('0x8')](),controller['index']);router['get'](_0x30f7('0x9'),auth[_0x30f7('0x8')](),controller[_0x30f7('0xa')]);router[_0x30f7('0xb')]('/',auth['isAuthenticated'](),controller[_0x30f7('0xc')]);router[_0x30f7('0xd')]('/:id',auth[_0x30f7('0x8')](),controller['update']);router['delete'](_0x30f7('0x9'),auth[_0x30f7('0x8')](),controller[_0x30f7('0xe')]);module[_0x30f7('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 37ed8a0..76ba107 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 _0x6867=['exports','STRING','sequelize'];(function(_0x5b72f6,_0x342ac8){var _0x47a75c=function(_0x2f8086){while(--_0x2f8086){_0x5b72f6['push'](_0x5b72f6['shift']());}};_0x47a75c(++_0x342ac8);}(_0x6867,0x146));var _0x7686=function(_0xc2fc17,_0x2b78be){_0xc2fc17=_0xc2fc17-0x0;var _0x5b4fe0=_0x6867[_0xc2fc17];return _0x5b4fe0;};'use strict';var Sequelize=require(_0x7686('0x0'));module[_0x7686('0x1')]={'name':{'type':Sequelize[_0x7686('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x7686('0x2')]}}; \ No newline at end of file +var _0x3a63=['name','sequelize','exports','STRING'];(function(_0x21a11d,_0x18d8ec){var _0x474e50=function(_0x45d33b){while(--_0x45d33b){_0x21a11d['push'](_0x21a11d['shift']());}};_0x474e50(++_0x18d8ec);}(_0x3a63,0x81));var _0x33a6=function(_0x516927,_0xb4aad0){_0x516927=_0x516927-0x0;var _0x30749b=_0x3a63[_0x516927];return _0x30749b;};'use strict';var Sequelize=require(_0x33a6('0x0'));module[_0x33a6('0x1')]={'name':{'type':Sequelize[_0x33a6('0x2')],'unique':_0x33a6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x33a6('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index c20f419..87b4ee3 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 _0xc4a1=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','catch','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','save','then','destroy','Pauses','UserProfileResource','end','error','stack','name','send','index','Pause','rawAttributes','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','nolimit','limit','sort','where','filter','map','type','key','VIRTUAL','options','includeAll','include','findAll','show','params','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation'];(function(_0x50c9a4,_0xb96053){var _0x17ef46=function(_0x2bbc3){while(--_0x2bbc3){_0x50c9a4['push'](_0x50c9a4['shift']());}};_0x17ef46(++_0xb96053);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x4b3154,_0x50f33b){_0x4b3154=_0x4b3154-0x0;var _0x323e43=_0xc4a1[_0x4b3154];return _0x323e43;};'use strict';var pdf=require(_0x1c4a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c4a('0x1'));var zipdir=require(_0x1c4a('0x2'));var jsonpatch=require(_0x1c4a('0x3'));var rp=require('request-promise');var moment=require(_0x1c4a('0x4'));var BPromise=require(_0x1c4a('0x5'));var Mustache=require(_0x1c4a('0x6'));var util=require(_0x1c4a('0x7'));var path=require(_0x1c4a('0x8'));var sox=require(_0x1c4a('0x9'));var csv=require(_0x1c4a('0xa'));var ejs=require(_0x1c4a('0xb'));var fs=require('fs');var _=require(_0x1c4a('0xc'));var squel=require(_0x1c4a('0xd'));var crypto=require(_0x1c4a('0xe'));var jsforce=require(_0x1c4a('0xf'));var deskjs=require(_0x1c4a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1c4a('0x11'));var Papa=require(_0x1c4a('0x12'));var Redis=require('ioredis');var authService=require(_0x1c4a('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c4a('0x14'))(_0x1c4a('0x15'));var utils=require('../../config/utils');var config=require(_0x1c4a('0x16'));var db=require(_0x1c4a('0x17'))['db'];function respondWithStatusCode(_0x55f35c,_0x56b1f0){_0x56b1f0=_0x56b1f0||0xcc;return function(_0x3aa5f4){if(_0x3aa5f4){return _0x55f35c[_0x1c4a('0x18')](_0x56b1f0);}return _0x55f35c['status'](_0x56b1f0)['end']();};}function respondWithResult(_0x2211e6,_0x4137d4){_0x4137d4=_0x4137d4||0xc8;return function(_0x343ec9){if(_0x343ec9){return _0x2211e6[_0x1c4a('0x19')](_0x4137d4)[_0x1c4a('0x1a')](_0x343ec9);}};}function respondWithFilteredResult(_0xd0a83f,_0x9a2091){return function(_0xa6e823){if(_0xa6e823){var _0x2867d4=_0xa6e823[_0x1c4a('0x1b')],_0x22b2f6=_0x9a2091[_0x1c4a('0x1c')],_0x48c1af=_0x9a2091[_0x1c4a('0x1c')]+_0x9a2091['limit'],_0x3be487;if(_0x48c1af>=_0x2867d4){_0x48c1af=_0x2867d4;_0x3be487=0xc8;}else{_0x3be487=0xce;}_0xd0a83f['status'](_0x3be487);return _0xd0a83f[_0x1c4a('0x1d')](_0x1c4a('0x1e'),_0x22b2f6+'-'+_0x48c1af+'/'+_0x2867d4)[_0x1c4a('0x1a')](_0xa6e823);}return null;};}function patchUpdates(_0x5f4cac){return function(_0x4a5055){try{jsonpatch[_0x1c4a('0x1f')](_0x4a5055,_0x5f4cac,!![]);}catch(_0x25252c){return BPromise['reject'](_0x25252c);}return _0x4a5055[_0x1c4a('0x20')]();};}function saveUpdates(_0x16dfe5,_0x22f46e){return function(_0x5324a9){if(_0x5324a9){return _0x5324a9['update'](_0x16dfe5)[_0x1c4a('0x21')](function(_0x119a48){return _0x119a48;});}return null;};}function removeEntity(_0x49a73a,_0x481d52){return function(_0x9843ce){if(_0x9843ce){return _0x9843ce[_0x1c4a('0x22')]()[_0x1c4a('0x21')](function(){var _0x2e75bd=_0x9843ce['get']({'plain':!![]});var _0x31bf76=_0x1c4a('0x23');return db[_0x1c4a('0x24')][_0x1c4a('0x22')]({'where':{'type':_0x31bf76,'resourceId':_0x2e75bd['id']}})[_0x1c4a('0x21')](function(){return _0x9843ce;});})[_0x1c4a('0x21')](function(){_0x49a73a[_0x1c4a('0x19')](0xcc)[_0x1c4a('0x25')]();});}};}function handleEntityNotFound(_0x84fcaf,_0x1a5c34){return function(_0xd10444){if(!_0xd10444){_0x84fcaf[_0x1c4a('0x18')](0x194);}return _0xd10444;};}function handleError(_0x56dd0e,_0x2a3545){_0x2a3545=_0x2a3545||0x1f4;return function(_0x41ffbc){logger[_0x1c4a('0x26')](_0x41ffbc[_0x1c4a('0x27')]);if(_0x41ffbc[_0x1c4a('0x28')]){delete _0x41ffbc[_0x1c4a('0x28')];}_0x56dd0e[_0x1c4a('0x19')](_0x2a3545)[_0x1c4a('0x29')](_0x41ffbc);};}exports[_0x1c4a('0x2a')]=function(_0x3ef241,_0x45ecdb){var _0x9ab900={},_0x1ebeee={},_0x13778f={'count':0x0,'rows':[]};var _0x28bf26=db[_0x1c4a('0x2b')][_0x1c4a('0x2c')];_0x1ebeee[_0x1c4a('0x2d')]=_[_0x1c4a('0x2e')](_0x28bf26);_0x1ebeee['query']=_[_0x1c4a('0x2e')](_0x3ef241['query']);_0x1ebeee[_0x1c4a('0x2f')]=_[_0x1c4a('0x30')](_0x1ebeee[_0x1c4a('0x2d')],_0x1ebeee['query']);_0x9ab900[_0x1c4a('0x31')]=_['intersection'](_0x1ebeee[_0x1c4a('0x2d')],qs[_0x1c4a('0x32')](_0x3ef241[_0x1c4a('0x33')][_0x1c4a('0x32')]));_0x9ab900[_0x1c4a('0x31')]=_0x9ab900['attributes']['length']?_0x9ab900[_0x1c4a('0x31')]:_0x1ebeee['model'];if(!_0x3ef241[_0x1c4a('0x33')][_0x1c4a('0x34')](_0x1c4a('0x35'))){_0x9ab900[_0x1c4a('0x36')]=qs['limit'](_0x3ef241['query'][_0x1c4a('0x36')]);_0x9ab900[_0x1c4a('0x1c')]=qs[_0x1c4a('0x1c')](_0x3ef241[_0x1c4a('0x33')][_0x1c4a('0x1c')]);}_0x9ab900['order']=qs[_0x1c4a('0x37')](_0x3ef241[_0x1c4a('0x33')]['sort']);_0x9ab900[_0x1c4a('0x38')]=qs[_0x1c4a('0x2f')](_['pick'](_0x3ef241['query'],_0x1ebeee['filters']));if(_0x3ef241[_0x1c4a('0x33')][_0x1c4a('0x39')]){_0x9ab900[_0x1c4a('0x38')]=_['merge'](_0x9ab900[_0x1c4a('0x38')],{'$or':_[_0x1c4a('0x3a')](_0x28bf26,function(_0x35875d){if(_0x35875d[_0x1c4a('0x3b')][_0x1c4a('0x3c')]!==_0x1c4a('0x3d')){var _0x56446c={};_0x56446c[_0x35875d['field']]={'$like':'%'+_0x3ef241[_0x1c4a('0x33')][_0x1c4a('0x39')]+'%'};return _0x56446c;}})});}_0x9ab900=_['merge']({},_0x9ab900,_0x3ef241[_0x1c4a('0x3e')]);var _0x2e84f9={'where':_0x9ab900[_0x1c4a('0x38')]};return db['Pause'][_0x1c4a('0x1b')](_0x2e84f9)['then'](function(_0x3f19da){_0x13778f[_0x1c4a('0x1b')]=_0x3f19da;if(_0x3ef241[_0x1c4a('0x33')][_0x1c4a('0x3f')]){_0x9ab900[_0x1c4a('0x40')]=[{'all':!![]}];}return db[_0x1c4a('0x2b')][_0x1c4a('0x41')](_0x9ab900);})[_0x1c4a('0x21')](function(_0x31e4c2){_0x13778f['rows']=_0x31e4c2;return _0x13778f;})[_0x1c4a('0x21')](respondWithFilteredResult(_0x45ecdb,_0x9ab900))['catch'](handleError(_0x45ecdb,null));};exports[_0x1c4a('0x42')]=function(_0x3df9ca,_0x545f36){var _0xfec7fa={'raw':!![],'where':{'id':_0x3df9ca[_0x1c4a('0x43')]['id']}},_0x27f4f1={};_0x27f4f1[_0x1c4a('0x2d')]=_[_0x1c4a('0x2e')](db[_0x1c4a('0x2b')][_0x1c4a('0x2c')]);_0x27f4f1[_0x1c4a('0x33')]=_[_0x1c4a('0x2e')](_0x3df9ca[_0x1c4a('0x33')]);_0x27f4f1[_0x1c4a('0x2f')]=_[_0x1c4a('0x30')](_0x27f4f1[_0x1c4a('0x2d')],_0x27f4f1['query']);_0xfec7fa[_0x1c4a('0x31')]=_[_0x1c4a('0x30')](_0x27f4f1[_0x1c4a('0x2d')],qs[_0x1c4a('0x32')](_0x3df9ca[_0x1c4a('0x33')][_0x1c4a('0x32')]));_0xfec7fa[_0x1c4a('0x31')]=_0xfec7fa[_0x1c4a('0x31')][_0x1c4a('0x44')]?_0xfec7fa[_0x1c4a('0x31')]:_0x27f4f1[_0x1c4a('0x2d')];if(_0x3df9ca[_0x1c4a('0x33')][_0x1c4a('0x3f')]){_0xfec7fa['include']=[{'all':!![]}];}_0xfec7fa=_['merge']({},_0xfec7fa,_0x3df9ca[_0x1c4a('0x3e')]);return db[_0x1c4a('0x2b')][_0x1c4a('0x45')](_0xfec7fa)[_0x1c4a('0x21')](handleEntityNotFound(_0x545f36,null))[_0x1c4a('0x21')](respondWithResult(_0x545f36,null))['catch'](handleError(_0x545f36,null));};exports[_0x1c4a('0x46')]=function(_0x50ae13,_0x5b6d1c){return db[_0x1c4a('0x2b')][_0x1c4a('0x46')](_0x50ae13[_0x1c4a('0x47')],{})[_0x1c4a('0x21')](function(_0x110e6a){var _0x35fb7d=_0x50ae13[_0x1c4a('0x48')][_0x1c4a('0x49')]({'plain':!![]});if(!_0x35fb7d)throw new Error(_0x1c4a('0x4a'));if(_0x35fb7d[_0x1c4a('0x4b')]===_0x1c4a('0x48')){var _0x376f68=_0x110e6a[_0x1c4a('0x49')]({'plain':!![]});var _0x951f26=_0x1c4a('0x23');return db[_0x1c4a('0x4c')]['find']({'where':{'name':_0x951f26,'userProfileId':_0x35fb7d[_0x1c4a('0x4d')]},'raw':!![]})[_0x1c4a('0x21')](function(_0xe7c587){if(_0xe7c587&&_0xe7c587[_0x1c4a('0x4e')]===0x0){return db['UserProfileResource'][_0x1c4a('0x46')]({'name':_0x376f68[_0x1c4a('0x28')],'resourceId':_0x376f68['id'],'type':_0xe7c587[_0x1c4a('0x28')],'sectionId':_0xe7c587['id']},{})['then'](function(){return _0x110e6a;});}else{return _0x110e6a;}})['catch'](function(_0xc82489){logger[_0x1c4a('0x26')](_0x1c4a('0x4f'),_0xc82489);throw _0xc82489;});}return _0x110e6a;})['then'](respondWithResult(_0x5b6d1c,0xc9))['catch'](handleError(_0x5b6d1c,null));};exports[_0x1c4a('0x50')]=function(_0x32f9b3,_0x3145d7){if(_0x32f9b3[_0x1c4a('0x47')]['id']){delete _0x32f9b3[_0x1c4a('0x47')]['id'];}return db['Pause'][_0x1c4a('0x45')]({'where':{'id':_0x32f9b3[_0x1c4a('0x43')]['id']}})[_0x1c4a('0x21')](handleEntityNotFound(_0x3145d7,null))[_0x1c4a('0x21')](saveUpdates(_0x32f9b3[_0x1c4a('0x47')],null))[_0x1c4a('0x21')](respondWithResult(_0x3145d7,null))[_0x1c4a('0x51')](handleError(_0x3145d7,null));};exports[_0x1c4a('0x22')]=function(_0x387c08,_0xa2e9f8){return db[_0x1c4a('0x2b')][_0x1c4a('0x45')]({'where':{'id':_0x387c08[_0x1c4a('0x43')]['id']}})[_0x1c4a('0x21')](handleEntityNotFound(_0xa2e9f8,null))[_0x1c4a('0x21')](removeEntity(_0xa2e9f8,null))[_0x1c4a('0x51')](handleError(_0xa2e9f8,null));}; \ No newline at end of file +var _0xd4a0=['map','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','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/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','Pauses','stack','name','send','Pause','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x11056d,_0x1826da){var _0x59f7d9=function(_0x5a3c54){while(--_0x5a3c54){_0x11056d['push'](_0x11056d['shift']());}};_0x59f7d9(++_0x1826da);}(_0xd4a0,0x15b));var _0x0d4a=function(_0x54dd39,_0x2b71a4){_0x54dd39=_0x54dd39-0x0;var _0x46926e=_0xd4a0[_0x54dd39];return _0x46926e;};'use strict';var pdf=require(_0x0d4a('0x0'));var emlformat=require(_0x0d4a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0d4a('0x2'));var rp=require(_0x0d4a('0x3'));var moment=require('moment');var BPromise=require(_0x0d4a('0x4'));var Mustache=require(_0x0d4a('0x5'));var util=require(_0x0d4a('0x6'));var path=require(_0x0d4a('0x7'));var sox=require(_0x0d4a('0x8'));var csv=require(_0x0d4a('0x9'));var ejs=require(_0x0d4a('0xa'));var fs=require('fs');var _=require(_0x0d4a('0xb'));var squel=require(_0x0d4a('0xc'));var crypto=require(_0x0d4a('0xd'));var jsforce=require(_0x0d4a('0xe'));var deskjs=require(_0x0d4a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0d4a('0x10'));var Papa=require(_0x0d4a('0x11'));var Redis=require(_0x0d4a('0x12'));var authService=require(_0x0d4a('0x13'));var qs=require(_0x0d4a('0x14'));var hardwareService=require(_0x0d4a('0x15'));var logger=require(_0x0d4a('0x16'))(_0x0d4a('0x17'));var utils=require('../../config/utils');var config=require(_0x0d4a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c60f8,_0x31c4ca){_0x31c4ca=_0x31c4ca||0xcc;return function(_0x43b07b){if(_0x43b07b){return _0x3c60f8[_0x0d4a('0x19')](_0x31c4ca);}return _0x3c60f8[_0x0d4a('0x1a')](_0x31c4ca)[_0x0d4a('0x1b')]();};}function respondWithResult(_0x5c8b0c,_0x42e647){_0x42e647=_0x42e647||0xc8;return function(_0x2c1dd8){if(_0x2c1dd8){return _0x5c8b0c['status'](_0x42e647)[_0x0d4a('0x1c')](_0x2c1dd8);}};}function respondWithFilteredResult(_0x3972dc,_0x29b45a){return function(_0x52a051){if(_0x52a051){var _0x65c64b=_0x52a051[_0x0d4a('0x1d')],_0x17cdf3=_0x29b45a[_0x0d4a('0x1e')],_0x1ece10=_0x29b45a[_0x0d4a('0x1e')]+_0x29b45a[_0x0d4a('0x1f')],_0x33256f;if(_0x1ece10>=_0x65c64b){_0x1ece10=_0x65c64b;_0x33256f=0xc8;}else{_0x33256f=0xce;}_0x3972dc[_0x0d4a('0x1a')](_0x33256f);return _0x3972dc['set'](_0x0d4a('0x20'),_0x17cdf3+'-'+_0x1ece10+'/'+_0x65c64b)[_0x0d4a('0x1c')](_0x52a051);}return null;};}function patchUpdates(_0x520043){return function(_0x5029f3){try{jsonpatch[_0x0d4a('0x21')](_0x5029f3,_0x520043,!![]);}catch(_0x1fd8fa){return BPromise['reject'](_0x1fd8fa);}return _0x5029f3['save']();};}function saveUpdates(_0x4f455b,_0xd85be3){return function(_0x7bb6c1){if(_0x7bb6c1){return _0x7bb6c1[_0x0d4a('0x22')](_0x4f455b)[_0x0d4a('0x23')](function(_0x1f1e8a){return _0x1f1e8a;});}return null;};}function removeEntity(_0x572beb,_0xd319ea){return function(_0x4dfa22){if(_0x4dfa22){return _0x4dfa22[_0x0d4a('0x24')]()[_0x0d4a('0x23')](function(){var _0x3a7bf9=_0x4dfa22[_0x0d4a('0x25')]({'plain':!![]});var _0x59bc41=_0x0d4a('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x59bc41,'resourceId':_0x3a7bf9['id']}})[_0x0d4a('0x23')](function(){return _0x4dfa22;});})[_0x0d4a('0x23')](function(){_0x572beb[_0x0d4a('0x1a')](0xcc)[_0x0d4a('0x1b')]();});}};}function handleEntityNotFound(_0x2694ad,_0x15b63e){return function(_0xe346fc){if(!_0xe346fc){_0x2694ad[_0x0d4a('0x19')](0x194);}return _0xe346fc;};}function handleError(_0x3af4a1,_0x3f190a){_0x3f190a=_0x3f190a||0x1f4;return function(_0xe55262){logger['error'](_0xe55262[_0x0d4a('0x27')]);if(_0xe55262[_0x0d4a('0x28')]){delete _0xe55262[_0x0d4a('0x28')];}_0x3af4a1[_0x0d4a('0x1a')](_0x3f190a)[_0x0d4a('0x29')](_0xe55262);};}exports['index']=function(_0x407b1d,_0x19983a){var _0x1b4879={},_0x5d9690={},_0x1a3d4b={'count':0x0,'rows':[]};var _0x28f88c=db[_0x0d4a('0x2a')]['rawAttributes'];_0x5d9690['model']=_['keys'](_0x28f88c);_0x5d9690['query']=_[_0x0d4a('0x2b')](_0x407b1d[_0x0d4a('0x2c')]);_0x5d9690[_0x0d4a('0x2d')]=_[_0x0d4a('0x2e')](_0x5d9690[_0x0d4a('0x2f')],_0x5d9690[_0x0d4a('0x2c')]);_0x1b4879['attributes']=_[_0x0d4a('0x2e')](_0x5d9690['model'],qs[_0x0d4a('0x30')](_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x30')]));_0x1b4879[_0x0d4a('0x31')]=_0x1b4879[_0x0d4a('0x31')][_0x0d4a('0x32')]?_0x1b4879['attributes']:_0x5d9690[_0x0d4a('0x2f')];if(!_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x33')](_0x0d4a('0x34'))){_0x1b4879['limit']=qs[_0x0d4a('0x1f')](_0x407b1d['query']['limit']);_0x1b4879[_0x0d4a('0x1e')]=qs['offset'](_0x407b1d[_0x0d4a('0x2c')]['offset']);}_0x1b4879[_0x0d4a('0x35')]=qs[_0x0d4a('0x36')](_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x36')]);_0x1b4879['where']=qs[_0x0d4a('0x2d')](_[_0x0d4a('0x37')](_0x407b1d[_0x0d4a('0x2c')],_0x5d9690['filters']));if(_0x407b1d[_0x0d4a('0x2c')]['filter']){_0x1b4879[_0x0d4a('0x38')]=_[_0x0d4a('0x39')](_0x1b4879[_0x0d4a('0x38')],{'$or':_[_0x0d4a('0x3a')](_0x28f88c,function(_0x4eb8d4){if(_0x4eb8d4['type']['key']!==_0x0d4a('0x3b')){var _0x20bb1e={};_0x20bb1e[_0x4eb8d4[_0x0d4a('0x3c')]]={'$like':'%'+_0x407b1d['query'][_0x0d4a('0x3d')]+'%'};return _0x20bb1e;}})});}_0x1b4879=_['merge']({},_0x1b4879,_0x407b1d[_0x0d4a('0x3e')]);var _0x21802b={'where':_0x1b4879[_0x0d4a('0x38')]};return db[_0x0d4a('0x2a')][_0x0d4a('0x1d')](_0x21802b)[_0x0d4a('0x23')](function(_0x74877b){_0x1a3d4b[_0x0d4a('0x1d')]=_0x74877b;if(_0x407b1d[_0x0d4a('0x2c')][_0x0d4a('0x3f')]){_0x1b4879[_0x0d4a('0x40')]=[{'all':!![]}];}return db['Pause'][_0x0d4a('0x41')](_0x1b4879);})['then'](function(_0x3ec770){_0x1a3d4b[_0x0d4a('0x42')]=_0x3ec770;return _0x1a3d4b;})['then'](respondWithFilteredResult(_0x19983a,_0x1b4879))[_0x0d4a('0x43')](handleError(_0x19983a,null));};exports[_0x0d4a('0x44')]=function(_0x1ad5a3,_0x325c25){var _0xb36453={'raw':!![],'where':{'id':_0x1ad5a3[_0x0d4a('0x45')]['id']}},_0xb427d7={};_0xb427d7[_0x0d4a('0x2f')]=_[_0x0d4a('0x2b')](db[_0x0d4a('0x2a')][_0x0d4a('0x46')]);_0xb427d7[_0x0d4a('0x2c')]=_['keys'](_0x1ad5a3[_0x0d4a('0x2c')]);_0xb427d7[_0x0d4a('0x2d')]=_['intersection'](_0xb427d7['model'],_0xb427d7[_0x0d4a('0x2c')]);_0xb36453['attributes']=_[_0x0d4a('0x2e')](_0xb427d7[_0x0d4a('0x2f')],qs['fields'](_0x1ad5a3[_0x0d4a('0x2c')]['fields']));_0xb36453[_0x0d4a('0x31')]=_0xb36453[_0x0d4a('0x31')][_0x0d4a('0x32')]?_0xb36453[_0x0d4a('0x31')]:_0xb427d7[_0x0d4a('0x2f')];if(_0x1ad5a3[_0x0d4a('0x2c')][_0x0d4a('0x3f')]){_0xb36453[_0x0d4a('0x40')]=[{'all':!![]}];}_0xb36453=_['merge']({},_0xb36453,_0x1ad5a3[_0x0d4a('0x3e')]);return db['Pause'][_0x0d4a('0x47')](_0xb36453)[_0x0d4a('0x23')](handleEntityNotFound(_0x325c25,null))[_0x0d4a('0x23')](respondWithResult(_0x325c25,null))[_0x0d4a('0x43')](handleError(_0x325c25,null));};exports[_0x0d4a('0x48')]=function(_0x5dbb36,_0x41f532){return db[_0x0d4a('0x2a')]['create'](_0x5dbb36[_0x0d4a('0x49')],{})['then'](function(_0x5113bb){var _0x344d2c=_0x5dbb36[_0x0d4a('0x4a')][_0x0d4a('0x25')]({'plain':!![]});if(!_0x344d2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x344d2c[_0x0d4a('0x4b')]==='user'){var _0x593f30=_0x5113bb['get']({'plain':!![]});var _0x5b5451='Pauses';return db[_0x0d4a('0x4c')][_0x0d4a('0x47')]({'where':{'name':_0x5b5451,'userProfileId':_0x344d2c[_0x0d4a('0x4d')]},'raw':!![]})[_0x0d4a('0x23')](function(_0x545c1){if(_0x545c1&&_0x545c1[_0x0d4a('0x4e')]===0x0){return db['UserProfileResource'][_0x0d4a('0x48')]({'name':_0x593f30[_0x0d4a('0x28')],'resourceId':_0x593f30['id'],'type':_0x545c1[_0x0d4a('0x28')],'sectionId':_0x545c1['id']},{})[_0x0d4a('0x23')](function(){return _0x5113bb;});}else{return _0x5113bb;}})[_0x0d4a('0x43')](function(_0x5dabd8){logger[_0x0d4a('0x4f')](_0x0d4a('0x50'),_0x5dabd8);throw _0x5dabd8;});}return _0x5113bb;})[_0x0d4a('0x23')](respondWithResult(_0x41f532,0xc9))[_0x0d4a('0x43')](handleError(_0x41f532,null));};exports[_0x0d4a('0x22')]=function(_0x3f99fc,_0x2421f0){if(_0x3f99fc[_0x0d4a('0x49')]['id']){delete _0x3f99fc['body']['id'];}return db[_0x0d4a('0x2a')][_0x0d4a('0x47')]({'where':{'id':_0x3f99fc['params']['id']}})[_0x0d4a('0x23')](handleEntityNotFound(_0x2421f0,null))[_0x0d4a('0x23')](saveUpdates(_0x3f99fc['body'],null))[_0x0d4a('0x23')](respondWithResult(_0x2421f0,null))['catch'](handleError(_0x2421f0,null));};exports['destroy']=function(_0x33bd67,_0xa6009d){return db[_0x0d4a('0x2a')][_0x0d4a('0x47')]({'where':{'id':_0x33bd67['params']['id']}})[_0x0d4a('0x23')](handleEntityNotFound(_0xa6009d,null))[_0x0d4a('0x23')](removeEntity(_0xa6009d,null))[_0x0d4a('0x43')](handleError(_0xa6009d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index bebe952..e1299ac 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 _0x61d0=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Pause','lodash'];(function(_0x191299,_0x4cf39f){var _0x1e61ee=function(_0x5ddc2){while(--_0x5ddc2){_0x191299['push'](_0x191299['shift']());}};_0x1e61ee(++_0x4cf39f);}(_0x61d0,0x1e3));var _0x061d=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x61d0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x061d('0x0'));var util=require(_0x061d('0x1'));var logger=require('../../config/logger')(_0x061d('0x2'));var moment=require('moment');var BPromise=require(_0x061d('0x3'));var rp=require(_0x061d('0x4'));var fs=require('fs');var path=require(_0x061d('0x5'));var rimraf=require(_0x061d('0x6'));var config=require(_0x061d('0x7'));var attributes=require('./pause.attributes');module[_0x061d('0x8')]=function(_0x415902,_0x5e6838){return _0x415902[_0x061d('0x9')](_0x061d('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0d0=['../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x51fea4,_0x48c945){var _0x6b9c34=function(_0x49d020){while(--_0x49d020){_0x51fea4['push'](_0x51fea4['shift']());}};_0x6b9c34(++_0x48c945);}(_0xa0d0,0x13d));var _0x0a0d=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa0d0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a0d('0x0'));var util=require('util');var logger=require(_0x0a0d('0x1'))(_0x0a0d('0x2'));var moment=require('moment');var BPromise=require(_0x0a0d('0x3'));var rp=require(_0x0a0d('0x4'));var fs=require('fs');var path=require(_0x0a0d('0x5'));var rimraf=require(_0x0a0d('0x6'));var config=require(_0x0a0d('0x7'));var attributes=require(_0x0a0d('0x8'));module[_0x0a0d('0x9')]=function(_0x41058b,_0xb885e){return _0x41058b['define'](_0x0a0d('0xa'),attributes,{'tableName':_0x0a0d('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 1db32dc..b4fe502 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 _0xe80d=['code','error','message','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','Pause,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x326a72,_0x3e5dfe){var _0x8da1ae=function(_0x138218){while(--_0x138218){_0x326a72['push'](_0x326a72['shift']());}};_0x8da1ae(++_0x3e5dfe);}(_0xe80d,0x183));var _0xde80=function(_0xb64e9e,_0x519fb2){_0xb64e9e=_0xb64e9e-0x0;var _0x1c63f4=_0xe80d[_0xb64e9e];return _0x1c63f4;};'use strict';var _=require(_0xde80('0x0'));var util=require(_0xde80('0x1'));var moment=require(_0xde80('0x2'));var BPromise=require('bluebird');var rs=require(_0xde80('0x3'));var fs=require('fs');var Redis=require(_0xde80('0x4'));var db=require(_0xde80('0x5'))['db'];var utils=require(_0xde80('0x6'));var logger=require('../../config/logger')(_0xde80('0x7'));var config=require(_0xde80('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xde80('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5c46,_0x2a8dae,_0x464766){return new BPromise(function(_0x5f4f15,_0x311166){return client['request'](_0x5c5c46,_0x464766)[_0xde80('0xa')](function(_0x342c33){logger[_0xde80('0xb')](_0xde80('0xc'),_0x2a8dae,'request\x20sent');logger[_0xde80('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x2a8dae,_0xde80('0xe'),JSON[_0xde80('0xf')](_0x342c33));if(_0x342c33['error']){if(_0x342c33['error'][_0xde80('0x10')]===0x1f4){logger[_0xde80('0x11')](_0xde80('0xc'),_0x2a8dae,_0x342c33[_0xde80('0x11')][_0xde80('0x12')]);return _0x311166(_0x342c33[_0xde80('0x11')][_0xde80('0x12')]);}logger[_0xde80('0x11')]('Pause,\x20%s,\x20%s',_0x2a8dae,_0x342c33[_0xde80('0x11')][_0xde80('0x12')]);return _0x5f4f15(_0x342c33['error'][_0xde80('0x12')]);}else{logger[_0xde80('0xb')](_0xde80('0xc'),_0x2a8dae,_0xde80('0xe'));_0x5f4f15(_0x342c33[_0xde80('0x13')]['message']);}})[_0xde80('0x14')](function(_0x45ea0b){logger['error'](_0xde80('0xc'),_0x2a8dae,_0x45ea0b);_0x311166(_0x45ea0b);});});}exports['ShowPause']=function(_0x2fe639){var _0x2ba22b=this;return new Promise(function(_0x3b80d5,_0x4db7ff){return db[_0xde80('0x15')][_0xde80('0x16')]({'raw':_0x2fe639[_0xde80('0x17')]?_0x2fe639[_0xde80('0x17')][_0xde80('0x18')]===undefined?!![]:![]:!![],'where':_0x2fe639[_0xde80('0x17')]?_0x2fe639[_0xde80('0x17')][_0xde80('0x19')]||null:null,'attributes':_0x2fe639[_0xde80('0x17')]?_0x2fe639[_0xde80('0x17')][_0xde80('0x1a')]||null:null,'include':_0x2fe639['options']?_0x2fe639[_0xde80('0x17')]['include']?_[_0xde80('0x1b')](_0x2fe639[_0xde80('0x17')][_0xde80('0x1c')],function(_0x4c7586){return{'model':db[_0x4c7586['model']],'as':_0x4c7586['as'],'attributes':_0x4c7586[_0xde80('0x1a')],'include':_0x4c7586[_0xde80('0x1c')]?_[_0xde80('0x1b')](_0x4c7586[_0xde80('0x1c')],function(_0x2f0bbb){return{'model':db[_0x2f0bbb[_0xde80('0x1d')]],'as':_0x2f0bbb['as'],'attributes':_0x2f0bbb[_0xde80('0x1a')],'include':_0x2f0bbb[_0xde80('0x1c')]?_[_0xde80('0x1b')](_0x2f0bbb['include'],function(_0x2d7ae8){return{'model':db[_0x2d7ae8[_0xde80('0x1d')]],'as':_0x2d7ae8['as'],'attributes':_0x2d7ae8[_0xde80('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf188a7){logger[_0xde80('0xb')]('ShowPause',_0x2fe639);logger[_0xde80('0xd')](_0xde80('0x1e'),_0x2fe639,JSON[_0xde80('0xf')](_0xf188a7));_0x3b80d5(_0xf188a7);})[_0xde80('0x14')](function(_0x2ce9d0){logger[_0xde80('0x11')]('ShowPause',_0x2ce9d0['message'],_0x2fe639);_0x4db7ff(_0x2ba22b['error'](0x1f4,_0x2ce9d0[_0xde80('0x12')]));});});}; \ No newline at end of file +var _0x68fc=['request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','ShowPause','Pause','find','options','raw','attributes','include','map','model','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x4b03c9,_0x17ce03){var _0x161ba2=function(_0xb952db){while(--_0xb952db){_0x4b03c9['push'](_0x4b03c9['shift']());}};_0x161ba2(++_0x17ce03);}(_0x68fc,0xa5));var _0xc68f=function(_0x238c2b,_0x3b9aae){_0x238c2b=_0x238c2b-0x0;var _0x16c704=_0x68fc[_0x238c2b];return _0x16c704;};'use strict';var _=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var moment=require(_0xc68f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc68f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc68f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc68f('0x5'));var jayson=require(_0xc68f('0x6'));var client=jayson[_0xc68f('0x7')][_0xc68f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fcce4,_0x4a6f7d,_0x9f2705){return new BPromise(function(_0x2bf3fd,_0x370977){return client[_0xc68f('0x9')](_0x4fcce4,_0x9f2705)[_0xc68f('0xa')](function(_0x1ee022){logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));logger[_0xc68f('0xe')]('Pause,\x20%s,\x20%s,\x20%s',_0x4a6f7d,_0xc68f('0xd'),JSON[_0xc68f('0xf')](_0x1ee022));if(_0x1ee022[_0xc68f('0x10')]){if(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x11')]===0x1f4){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x370977(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}logger['error'](_0xc68f('0xc'),_0x4a6f7d,_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);return _0x2bf3fd(_0x1ee022[_0xc68f('0x10')][_0xc68f('0x12')]);}else{logger[_0xc68f('0xb')](_0xc68f('0xc'),_0x4a6f7d,_0xc68f('0xd'));_0x2bf3fd(_0x1ee022[_0xc68f('0x13')]['message']);}})['catch'](function(_0x3a6c06){logger[_0xc68f('0x10')](_0xc68f('0xc'),_0x4a6f7d,_0x3a6c06);_0x370977(_0x3a6c06);});});}exports[_0xc68f('0x14')]=function(_0x2d9d85){var _0x2c7261=this;return new Promise(function(_0x50fab4,_0x385dbe){return db[_0xc68f('0x15')][_0xc68f('0x16')]({'raw':_0x2d9d85[_0xc68f('0x17')]?_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x18')]===undefined?!![]:![]:!![],'where':_0x2d9d85[_0xc68f('0x17')]?_0x2d9d85[_0xc68f('0x17')]['where']||null:null,'attributes':_0x2d9d85[_0xc68f('0x17')]?_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x19')]||null:null,'include':_0x2d9d85['options']?_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x1a')]?_[_0xc68f('0x1b')](_0x2d9d85[_0xc68f('0x17')][_0xc68f('0x1a')],function(_0x3da6d9){return{'model':db[_0x3da6d9[_0xc68f('0x1c')]],'as':_0x3da6d9['as'],'attributes':_0x3da6d9['attributes'],'include':_0x3da6d9[_0xc68f('0x1a')]?_[_0xc68f('0x1b')](_0x3da6d9['include'],function(_0x13dd7c){return{'model':db[_0x13dd7c[_0xc68f('0x1c')]],'as':_0x13dd7c['as'],'attributes':_0x13dd7c[_0xc68f('0x19')],'include':_0x13dd7c[_0xc68f('0x1a')]?_[_0xc68f('0x1b')](_0x13dd7c['include'],function(_0x1a0810){return{'model':db[_0x1a0810[_0xc68f('0x1c')]],'as':_0x1a0810['as'],'attributes':_0x1a0810['attributes']};}):[]};}):[]};}):[]:[]})[_0xc68f('0xa')](function(_0x27e5b8){logger['info'](_0xc68f('0x14'),_0x2d9d85);logger[_0xc68f('0xe')](_0xc68f('0x14'),_0x2d9d85,JSON[_0xc68f('0xf')](_0x27e5b8));_0x50fab4(_0x27e5b8);})['catch'](function(_0x477a1c){logger[_0xc68f('0x10')](_0xc68f('0x14'),_0x477a1c[_0xc68f('0x12')],_0x2d9d85);_0x385dbe(_0x2c7261[_0xc68f('0x10')](0x1f4,_0x477a1c[_0xc68f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 0794ec8..64c374c 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 _0x5602=['update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','post','file','upload','webhookPost','put'];(function(_0x2906e6,_0x5ccd59){var _0x12517a=function(_0x36d576){while(--_0x36d576){_0x2906e6['push'](_0x2906e6['shift']());}};_0x12517a(++_0x5ccd59);}(_0x5602,0x66));var _0x2560=function(_0x372433,_0x54e5a4){_0x372433=_0x372433-0x0;var _0xe8723b=_0x5602[_0x372433];return _0xe8723b;};'use strict';var multer=require(_0x2560('0x0'));var util=require(_0x2560('0x1'));var path=require(_0x2560('0x2'));var timeout=require(_0x2560('0x3'));var express=require('express');var router=express[_0x2560('0x4')]();var auth=require(_0x2560('0x5'));var interaction=require(_0x2560('0x6'));var config=require('../../config/environment');var controller=require(_0x2560('0x7'));router[_0x2560('0x8')]('/',auth[_0x2560('0x9')](),controller[_0x2560('0xa')]);router[_0x2560('0x8')](_0x2560('0xb'),controller[_0x2560('0xc')]);router[_0x2560('0x8')](_0x2560('0xd'),auth[_0x2560('0x9')](),controller['show']);router[_0x2560('0x8')](_0x2560('0xe'),auth['isAuthenticated'](),controller[_0x2560('0xf')]);var upload=multer({'storage':multer[_0x2560('0x10')]({'destination':function(_0x2c0ad0,_0x2f194f,_0x1ef3a2){_0x1ef3a2(null,path[_0x2560('0x11')](config[_0x2560('0x12')],_0x2560('0x13')));},'filename':function(_0xb61230,_0x3b6617,_0x368a0f){_0x3b6617[_0x2560('0x14')]=_0x3b6617['originalname'][_0x2560('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x368a0f(null,util[_0x2560('0x16')](_0x2560('0x17'),path[_0x2560('0x18')](_0x3b6617[_0x2560('0x14')],path['extname'](_0x3b6617[_0x2560('0x14')])),Date['now'](),path['extname'](_0x3b6617[_0x2560('0x14')])));}})});router[_0x2560('0x19')]('/',upload['single'](_0x2560('0x1a')),controller[_0x2560('0x1b')]);router[_0x2560('0x19')]('/webhook',controller[_0x2560('0x1c')]);router[_0x2560('0x1d')](_0x2560('0xd'),auth[_0x2560('0x9')](),controller[_0x2560('0x1e')]);router[_0x2560('0x1f')](_0x2560('0xd'),auth[_0x2560('0x9')](),controller['delete']);module[_0x2560('0x20')]=router; \ No newline at end of file +var _0xa665=['get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0xa665,0x1c8));var _0x5a66=function(_0x1ebc88,_0x638cd6){_0x1ebc88=_0x1ebc88-0x0;var _0xcef294=_0xa665[_0x1ebc88];return _0xcef294;};'use strict';var multer=require('multer');var util=require(_0x5a66('0x0'));var path=require('path');var timeout=require(_0x5a66('0x1'));var express=require(_0x5a66('0x2'));var router=express[_0x5a66('0x3')]();var auth=require(_0x5a66('0x4'));var interaction=require(_0x5a66('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router[_0x5a66('0x6')]('/',auth[_0x5a66('0x7')](),controller[_0x5a66('0x8')]);router['get'](_0x5a66('0x9'),controller[_0x5a66('0xa')]);router[_0x5a66('0x6')](_0x5a66('0xb'),auth[_0x5a66('0x7')](),controller[_0x5a66('0xc')]);router['get'](_0x5a66('0xd'),auth[_0x5a66('0x7')](),controller[_0x5a66('0xe')]);var upload=multer({'storage':multer[_0x5a66('0xf')]({'destination':function(_0x11fa5c,_0xf44892,_0x5895ad){_0x5895ad(null,path[_0x5a66('0x10')](config['root'],_0x5a66('0x11')));},'filename':function(_0x4cf395,_0x1c8453,_0x4ca70b){_0x1c8453[_0x5a66('0x12')]=_0x1c8453[_0x5a66('0x12')][_0x5a66('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4ca70b(null,util[_0x5a66('0x14')](_0x5a66('0x15'),path[_0x5a66('0x16')](_0x1c8453[_0x5a66('0x12')],path['extname'](_0x1c8453[_0x5a66('0x12')])),Date[_0x5a66('0x17')](),path[_0x5a66('0x18')](_0x1c8453[_0x5a66('0x12')])));}})});router[_0x5a66('0x19')]('/',upload[_0x5a66('0x1a')](_0x5a66('0x1b')),controller[_0x5a66('0x1c')]);router[_0x5a66('0x19')](_0x5a66('0x9'),controller[_0x5a66('0x1d')]);router[_0x5a66('0x1e')]('/:id',auth[_0x5a66('0x7')](),controller[_0x5a66('0x1f')]);router[_0x5a66('0x20')](_0x5a66('0xb'),auth[_0x5a66('0x7')](),controller[_0x5a66('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 55b5087..2d6a890 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 _0x8fc0=['adminOnly','always','never','sequelize','STRING','ENUM','html','script','TEXT','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'];(function(_0x43c8cf,_0x27c071){var _0x4bf422=function(_0x3d8ad0){while(--_0x3d8ad0){_0x43c8cf['push'](_0x43c8cf['shift']());}};_0x4bf422(++_0x27c071);}(_0x8fc0,0x16b));var _0x08fc=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x8fc0[_0x3e6729];return _0x535bcd;};'use strict';var Sequelize=require(_0x08fc('0x0'));module['exports']={'name':{'type':Sequelize[_0x08fc('0x1')]},'type':{'type':Sequelize[_0x08fc('0x2')](_0x08fc('0x3'),_0x08fc('0x4'))},'description':{'type':Sequelize[_0x08fc('0x5')]},'version':{'type':Sequelize[_0x08fc('0x5')]},'path':{'type':Sequelize[_0x08fc('0x1')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x08fc('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0x08fc('0x7'),'agentOnly',_0x08fc('0x8'),_0x08fc('0x9')),'defaultValue':_0x08fc('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x08fc('0x1')]},'agentUrl':{'type':Sequelize[_0x08fc('0x1')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6282=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x4ca10b,_0xe380a4){var _0x1395c9=function(_0x164769){while(--_0x164769){_0x4ca10b['push'](_0x4ca10b['shift']());}};_0x1395c9(++_0xe380a4);}(_0x6282,0x131));var _0x2628=function(_0x462d4b,_0x597689){_0x462d4b=_0x462d4b-0x0;var _0x606afe=_0x6282[_0x462d4b];return _0x606afe;};'use strict';var Sequelize=require(_0x2628('0x0'));module['exports']={'name':{'type':Sequelize[_0x2628('0x1')]},'type':{'type':Sequelize[_0x2628('0x2')](_0x2628('0x3'),_0x2628('0x4'))},'description':{'type':Sequelize[_0x2628('0x5')]},'version':{'type':Sequelize[_0x2628('0x5')]},'path':{'type':Sequelize[_0x2628('0x1')],'comment':_0x2628('0x6')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2628('0x7')},'sidebar':{'type':Sequelize[_0x2628('0x2')](_0x2628('0x8'),_0x2628('0x9'),_0x2628('0xa'),_0x2628('0xb')),'defaultValue':_0x2628('0xa'),'comment':_0x2628('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x2628('0x1')]},'agentUrl':{'type':Sequelize[_0x2628('0x1')]},'scriptName':{'type':Sequelize[_0x2628('0x1')]},'scriptPath':{'type':Sequelize[_0x2628('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index f6d0aab..24cea71 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 _0x77de=['content-type','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','http://localhost:','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','update','then','get','UserProfileResource','error','stack','name','send','index','Plugin','rawAttributes','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','count','include','findAll','rows','catch','includeAll','find','download','params','root','server/files/plugins','format','createWriteStream','zip','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','basename','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','agent','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','create','body','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','encoding','method','%s%s','headers','content-length'];(function(_0x21205e,_0x7eb8e7){var _0x136ebb=function(_0x54aac2){while(--_0x54aac2){_0x21205e['push'](_0x21205e['shift']());}};_0x136ebb(++_0x7eb8e7);}(_0x77de,0xb3));var _0xe77d=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x77de[_0x2f6541];return _0x4d76d8;};'use strict';var pdf=require(_0xe77d('0x0'));var emlformat=require(_0xe77d('0x1'));var rimraf=require(_0xe77d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe77d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe77d('0x4'));var Mustache=require(_0xe77d('0x5'));var util=require('util');var path=require(_0xe77d('0x6'));var sox=require(_0xe77d('0x7'));var csv=require(_0xe77d('0x8'));var ejs=require(_0xe77d('0x9'));var fs=require('fs');var _=require(_0xe77d('0xa'));var squel=require(_0xe77d('0xb'));var crypto=require(_0xe77d('0xc'));var jsforce=require(_0xe77d('0xd'));var deskjs=require(_0xe77d('0xe'));var toCsv=require(_0xe77d('0x8'));var querystring=require(_0xe77d('0xf'));var Papa=require(_0xe77d('0x10'));var extract=require(_0xe77d('0x11'));var rimraf=require(_0xe77d('0x2'));var archiver=require(_0xe77d('0x12'));var Redis=require(_0xe77d('0x13'));var authService=require(_0xe77d('0x14'));var qs=require(_0xe77d('0x15'));var hardwareService=require(_0xe77d('0x16'));var logger=require(_0xe77d('0x17'))(_0xe77d('0x18'));var utils=require('../../config/utils');var config=require(_0xe77d('0x19'));var db=require(_0xe77d('0x1a'))['db'];config[_0xe77d('0x1b')]=_[_0xe77d('0x1c')](config['redis'],{'host':_0xe77d('0x1d'),'port':0x18eb});var socket=require(_0xe77d('0x1e'))(new Redis(config[_0xe77d('0x1b')]));require(_0xe77d('0x1f'))[_0xe77d('0x20')](socket);function respondWithStatusCode(_0x3c2525,_0x3764e2){_0x3764e2=_0x3764e2||0xcc;return function(_0x359913){if(_0x359913){return _0x3c2525[_0xe77d('0x21')](_0x3764e2);}return _0x3c2525[_0xe77d('0x22')](_0x3764e2)[_0xe77d('0x23')]();};}function respondWithResult(_0x496f76,_0x2c20b9){_0x2c20b9=_0x2c20b9||0xc8;return function(_0x5d2785){if(_0x5d2785){return _0x496f76[_0xe77d('0x22')](_0x2c20b9)[_0xe77d('0x24')](_0x5d2785);}};}function respondWithFilteredResult(_0x2a359,_0x3cae6d){return function(_0xe0a1e1){if(_0xe0a1e1){var _0x10648a=_0xe0a1e1['count'],_0xf91d6d=_0x3cae6d[_0xe77d('0x25')],_0x46b8ba=_0x3cae6d[_0xe77d('0x25')]+_0x3cae6d[_0xe77d('0x26')],_0x14504e;if(_0x46b8ba>=_0x10648a){_0x46b8ba=_0x10648a;_0x14504e=0xc8;}else{_0x14504e=0xce;}_0x2a359[_0xe77d('0x22')](_0x14504e);return _0x2a359[_0xe77d('0x27')](_0xe77d('0x28'),_0xf91d6d+'-'+_0x46b8ba+'/'+_0x10648a)[_0xe77d('0x24')](_0xe0a1e1);}return null;};}function patchUpdates(_0x454b01){return function(_0x13748e){try{jsonpatch['apply'](_0x13748e,_0x454b01,!![]);}catch(_0x4bb222){return BPromise['reject'](_0x4bb222);}return _0x13748e['save']();};}function saveUpdates(_0x22eed9,_0x5d0322){return function(_0x42f848){if(_0x42f848){return _0x42f848[_0xe77d('0x29')](_0x22eed9)[_0xe77d('0x2a')](function(_0x44d367){return _0x44d367;});}return null;};}function removeEntity(_0x39d882,_0x24a216){return function(_0x462720){if(_0x462720){return _0x462720['destroy']()[_0xe77d('0x2a')](function(){var _0x2b8a55=_0x462720[_0xe77d('0x2b')]({'plain':!![]});var _0xb57e7b='Plugins';return db[_0xe77d('0x2c')]['destroy']({'where':{'type':_0xb57e7b,'resourceId':_0x2b8a55['id']}})[_0xe77d('0x2a')](function(){return _0x462720;});})[_0xe77d('0x2a')](function(){_0x39d882[_0xe77d('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4be156,_0x439ea4){return function(_0x297755){if(!_0x297755){_0x4be156[_0xe77d('0x21')](0x194);}return _0x297755;};}function handleError(_0x571b94,_0x5ae495){_0x5ae495=_0x5ae495||0x1f4;return function(_0x2e393a){logger[_0xe77d('0x2d')](_0x2e393a[_0xe77d('0x2e')]);if(_0x2e393a[_0xe77d('0x2f')]){delete _0x2e393a[_0xe77d('0x2f')];}_0x571b94[_0xe77d('0x22')](_0x5ae495)[_0xe77d('0x30')](_0x2e393a);};}exports[_0xe77d('0x31')]=function(_0x354d86,_0x3d1dfe){var _0x3c9b43={},_0xaff99f={},_0x2b2f7d={'count':0x0,'rows':[]};var _0x2d5603=db[_0xe77d('0x32')][_0xe77d('0x33')];_0xaff99f['model']=_[_0xe77d('0x34')](_0x2d5603);_0xaff99f[_0xe77d('0x35')]=_[_0xe77d('0x34')](_0x354d86[_0xe77d('0x35')]);_0xaff99f[_0xe77d('0x36')]=_['intersection'](_0xaff99f['model'],_0xaff99f[_0xe77d('0x35')]);_0x3c9b43['attributes']=_[_0xe77d('0x37')](_0xaff99f[_0xe77d('0x38')],qs['fields'](_0x354d86[_0xe77d('0x35')][_0xe77d('0x39')]));_0x3c9b43[_0xe77d('0x3a')]=_0x3c9b43['attributes'][_0xe77d('0x3b')]?_0x3c9b43[_0xe77d('0x3a')]:_0xaff99f[_0xe77d('0x38')];if(!_0x354d86[_0xe77d('0x35')][_0xe77d('0x3c')](_0xe77d('0x3d'))){_0x3c9b43['limit']=qs[_0xe77d('0x26')](_0x354d86[_0xe77d('0x35')]['limit']);_0x3c9b43[_0xe77d('0x25')]=qs[_0xe77d('0x25')](_0x354d86[_0xe77d('0x35')][_0xe77d('0x25')]);}_0x3c9b43[_0xe77d('0x3e')]=qs[_0xe77d('0x3f')](_0x354d86[_0xe77d('0x35')][_0xe77d('0x3f')]);_0x3c9b43[_0xe77d('0x40')]=qs['filters'](_[_0xe77d('0x41')](_0x354d86[_0xe77d('0x35')],_0xaff99f['filters']));if(_0x354d86['query'][_0xe77d('0x42')]){_0x3c9b43[_0xe77d('0x40')]=_[_0xe77d('0x43')](_0x3c9b43['where'],{'$or':_['map'](_0x2d5603,function(_0x479db9){if(_0x479db9[_0xe77d('0x44')][_0xe77d('0x45')]!==_0xe77d('0x46')){var _0x1c2650={};_0x1c2650[_0x479db9[_0xe77d('0x47')]]={'$like':'%'+_0x354d86[_0xe77d('0x35')][_0xe77d('0x42')]+'%'};return _0x1c2650;}})});}_0x3c9b43=_[_0xe77d('0x43')]({},_0x3c9b43,_0x354d86[_0xe77d('0x48')]);var _0x1ee976={'where':_0x3c9b43[_0xe77d('0x40')]};return db[_0xe77d('0x32')][_0xe77d('0x49')](_0x1ee976)[_0xe77d('0x2a')](function(_0x9a79b9){_0x2b2f7d[_0xe77d('0x49')]=_0x9a79b9;if(_0x354d86[_0xe77d('0x35')]['includeAll']){_0x3c9b43[_0xe77d('0x4a')]=[{'all':!![]}];}return db['Plugin'][_0xe77d('0x4b')](_0x3c9b43);})['then'](function(_0x394685){_0x2b2f7d[_0xe77d('0x4c')]=_0x394685;return _0x2b2f7d;})[_0xe77d('0x2a')](respondWithFilteredResult(_0x3d1dfe,_0x3c9b43))[_0xe77d('0x4d')](handleError(_0x3d1dfe,null));};exports['show']=function(_0x3f1fbd,_0x4c7a1f){var _0x5322a5={'raw':!![],'where':{'id':_0x3f1fbd['params']['id']}},_0xf59729={};_0xf59729[_0xe77d('0x38')]=_[_0xe77d('0x34')](db[_0xe77d('0x32')][_0xe77d('0x33')]);_0xf59729[_0xe77d('0x35')]=_['keys'](_0x3f1fbd[_0xe77d('0x35')]);_0xf59729[_0xe77d('0x36')]=_[_0xe77d('0x37')](_0xf59729[_0xe77d('0x38')],_0xf59729[_0xe77d('0x35')]);_0x5322a5[_0xe77d('0x3a')]=_['intersection'](_0xf59729[_0xe77d('0x38')],qs[_0xe77d('0x39')](_0x3f1fbd['query'][_0xe77d('0x39')]));_0x5322a5[_0xe77d('0x3a')]=_0x5322a5['attributes']['length']?_0x5322a5[_0xe77d('0x3a')]:_0xf59729[_0xe77d('0x38')];if(_0x3f1fbd['query'][_0xe77d('0x4e')]){_0x5322a5[_0xe77d('0x4a')]=[{'all':!![]}];}_0x5322a5=_[_0xe77d('0x43')]({},_0x5322a5,_0x3f1fbd[_0xe77d('0x48')]);return db['Plugin'][_0xe77d('0x4f')](_0x5322a5)[_0xe77d('0x2a')](handleEntityNotFound(_0x4c7a1f,null))[_0xe77d('0x2a')](respondWithResult(_0x4c7a1f,null))[_0xe77d('0x4d')](handleError(_0x4c7a1f,null));};exports[_0xe77d('0x50')]=function(_0x4c2187,_0x39e011,_0x528168){return db[_0xe77d('0x32')][_0xe77d('0x4f')]({'where':{'id':_0x4c2187[_0xe77d('0x51')]['id']},'attributes':[_0xe77d('0x2f'),'path'],'raw':!![]})[_0xe77d('0x2a')](handleEntityNotFound(_0x39e011,null))[_0xe77d('0x2a')](function(_0x16e2e9){if(_0x16e2e9){var _0x106280=path['join'](config[_0xe77d('0x52')],_0xe77d('0x53'),util[_0xe77d('0x54')]('%s.zip',path['basename'](_0x16e2e9[_0xe77d('0x6')])));var _0x519024=fs[_0xe77d('0x55')](_0x106280);var _0x20ad47=archiver(_0xe77d('0x56'),{'zlib':{'level':0x9}});_0x20ad47['on']('warning',function(_0x1a23bd){if(_0x1a23bd['code']===_0xe77d('0x57')){logger[_0xe77d('0x2d')](_0x1a23bd);}else{throw new db[(_0xe77d('0x58'))][(_0xe77d('0x59'))](_0xe77d('0x5a'));}});_0x20ad47['on']('error',function(_0x2a01ff){throw new db['Sequelize']['Error'](_0xe77d('0x5a'));});_0x20ad47[_0xe77d('0x5b')](_0x519024);_0x20ad47[_0xe77d('0x5c')](_0xe77d('0x5d'),{'cwd':path[_0xe77d('0x5e')](config[_0xe77d('0x52')],_0xe77d('0x53'),path['dirname'](_0x16e2e9[_0xe77d('0x6')])),'ignore':[path[_0xe77d('0x5e')](path[_0xe77d('0x5f')](_0x16e2e9['path']),'node_modules/**/*'),path[_0xe77d('0x5e')](path[_0xe77d('0x5f')](_0x16e2e9['path']),'attachments/**/*')],'nodir':!![]})[_0xe77d('0x60')]();_0x519024['on'](_0xe77d('0x61'),function(){if(!fs['existsSync'](_0x106280)){throw new db['Sequelize'][(_0xe77d('0x59'))](_0xe77d('0x62'));}return _0x39e011[_0xe77d('0x50')](_0x106280,util[_0xe77d('0x54')]('%s.zip',path['basename'](_0x16e2e9[_0xe77d('0x6')])),function(_0xc993cb){if(_0xc993cb){throw new db[(_0xe77d('0x58'))][(_0xe77d('0x59'))](_0xe77d('0x63'));}fs[_0xe77d('0x64')](_0x106280);logger[_0xe77d('0x65')](_0xe77d('0x66'));logger[_0xe77d('0x65')]('Temporary\x20file\x20removed');});});}return null;})[_0xe77d('0x4d')](handleError(_0x39e011,null));};exports[_0xe77d('0x67')]=function(_0x1bf419,_0xa34774,_0x1a5147){var _0x4dd236=path[_0xe77d('0x5f')](_0x1bf419['file'][_0xe77d('0x68')],path[_0xe77d('0x69')](_0x1bf419[_0xe77d('0x6a')]['filename']));var _0x5e3429=path[_0xe77d('0x5e')](config[_0xe77d('0x52')],_0xe77d('0x53'),_0x1bf419[_0xe77d('0x6a')][_0xe77d('0x68')]);var _0x5e951e=path[_0xe77d('0x5e')](config[_0xe77d('0x52')],_0xe77d('0x53'),_0x4dd236);logger['info'](_0xe77d('0x6b'),_0x5e3429);logger[_0xe77d('0x65')](_0xe77d('0x6c'),_0x5e951e);try{fs['chmodSync'](_0x5e3429,parseInt(_0xe77d('0x6d'),0x8));extract(_0x5e3429,{'dir':_0x5e951e},function(_0x5ca819){if(_0x5ca819){logger[_0xe77d('0x2d')](_0x5ca819);handleError(_0x5ca819,!![]);};var _0x1fe96f=fs[_0xe77d('0x6e')](_0x5e951e);if(_0x1fe96f['length']>0x1){removeReferences(_0x5e3429,_0x5e951e);logger[_0xe77d('0x2d')](_0xe77d('0x6f'));return _0x1a5147(new Error(_0xe77d('0x6f')));}var _0x32691c=fs[_0xe77d('0x70')](path['join'](_0x5e951e,_0x1fe96f[0x0]));if(_0x32691c[_0xe77d('0x71')]()){removeReferences(_0x5e3429,_0x5e951e);logger[_0xe77d('0x2d')]('Invalid\x20plugin\x20structure');return _0x1a5147(new Error('Invalid\x20plugin\x20structure'));}if(_0x32691c[_0xe77d('0x72')]()){var _0x43ec3f=fs[_0xe77d('0x6e')](path[_0xe77d('0x5e')](_0x5e951e,_0x1fe96f[0x0]));if(_0x43ec3f[_0xe77d('0x3b')]===0x0){removeReferences(_0x5e3429,_0x5e951e);logger[_0xe77d('0x2d')]('Invalid\x20plugin\x20structure');return _0x1a5147(new Error(_0xe77d('0x6f')));}var _0x588299=_0x43ec3f[_0xe77d('0x73')](function(_0x194791){return _0x194791==='manifest.json';});if(!_0x588299){return _0x1a5147(new Error(_0xe77d('0x74')));}var _0x4e3d5d=fs[_0xe77d('0x75')](path[_0xe77d('0x5e')](_0x5e951e,_0x1fe96f[0x0],_0xe77d('0x76')));var _0x5dc1bb=JSON[_0xe77d('0x77')](_0x4e3d5d);if(_0xe77d('0x78')==typeof _0x5dc1bb['name']){return _0x1a5147(new Error(_0xe77d('0x79')));}if(_0xe77d('0x78')==typeof _0x5dc1bb['type']){return _0x1a5147(new Error(_0xe77d('0x7a')));}if('undefined'==typeof _0x5dc1bb['version']){return _0x1a5147(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x5dc1bb[_0xe77d('0x7b')]){return _0x1a5147(new Error(_0xe77d('0x7c')));}if(_0x5dc1bb[_0xe77d('0x44')]===_0xe77d('0x7d')){if(_0xe77d('0x78')==typeof _0x5dc1bb[_0xe77d('0x7b')]['views']){return _0x1a5147(new Error(_0xe77d('0x7e')));}if(_0xe77d('0x78')==typeof _0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')]['admin']&&_0xe77d('0x78')==typeof _0x5dc1bb['parameters'][_0xe77d('0x7f')][_0xe77d('0x80')]){return _0x1a5147(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x5dc1bb['type']==='script'){if(_0xe77d('0x78')==typeof _0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x81')]){return _0x1a5147(new Error(_0xe77d('0x82')));}if(_0xe77d('0x78')==typeof _0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x83')]){return _0x1a5147(new Error(_0xe77d('0x84')));}}else{return _0x1a5147(new Error(_0xe77d('0x85')));}var _0x4cd35f=_0x5dc1bb['name'];var _0x226e2d=_0x5dc1bb[_0xe77d('0x86')];var _0xb6e9f=_0x5dc1bb['type'];var _0x498ff6=_0x5dc1bb[_0xe77d('0x87')]?_0x5dc1bb[_0xe77d('0x87')]:_0xe77d('0x88');var _0x273224=_0x5dc1bb[_0xe77d('0x89')]?_0x5dc1bb[_0xe77d('0x89')]:_0xe77d('0x8a');var _0x249f4d='';var _0xc72e74='';var _0x3fe179='';var _0x3053eb='';var _0x29451d=_0x5dc1bb[_0xe77d('0x8b')];if(_0xb6e9f==='html'){if(_0xe77d('0x78')!=typeof _0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')][_0xe77d('0x8c')]){var _0x121198=_0x5dc1bb['parameters'][_0xe77d('0x7f')][_0xe77d('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xe77d('0x8d')](_0x121198)){_0x249f4d=path[_0xe77d('0x5e')]('plugins',_0x4dd236,_0x1fe96f[0x0],_0x121198);}else{_0x249f4d=_0x121198;}}else{logger[_0xe77d('0x65')](_0xe77d('0x8e'));}if('undefined'!=typeof _0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')][_0xe77d('0x80')]){var _0x4a93c4=_0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xe77d('0x8d')](_0x4a93c4)){_0xc72e74=path[_0xe77d('0x5e')](_0xe77d('0x8f'),_0x4dd236,_0x1fe96f[0x0],_0x4a93c4);}else{_0xc72e74=_0x4a93c4;}}else{logger[_0xe77d('0x65')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0xb6e9f==='script'){_0x3fe179=_0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x81')];_0x3053eb=_0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x83')];if('undefined'!=typeof _0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')]){if('undefined'!=typeof _0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')][_0xe77d('0x8c')]){var _0x121198=_0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')][_0xe77d('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0xe77d('0x8d')](_0x121198)){_0x249f4d=path[_0xe77d('0x5e')]('plugins',_0x4dd236,_0x1fe96f[0x0],_0x121198);}else{_0x249f4d=_0x121198;}}if('undefined'!=typeof _0x5dc1bb['parameters'][_0xe77d('0x7f')][_0xe77d('0x80')]){var _0x4a93c4=_0x5dc1bb[_0xe77d('0x7b')][_0xe77d('0x7f')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xe77d('0x8d')](_0x4a93c4)){_0xc72e74=path[_0xe77d('0x5e')](_0xe77d('0x8f'),_0x4dd236,_0x1fe96f[0x0],_0x4a93c4);}else{_0xc72e74=_0x4a93c4;}}}}var _0x1a1da3={'name':_0x4cd35f,'description':_0x226e2d,'path':path[_0xe77d('0x5e')](_0x4dd236,_0x1fe96f[0x0]),'type':_0xb6e9f,'sidebar':_0x498ff6,'icon':_0x273224,'adminUrl':_0x249f4d,'agentUrl':_0xc72e74,'scriptName':_0x3fe179,'scriptPath':_0x3053eb,'version':_0x29451d};removeReferences(_0x5e3429,null);return db[_0xe77d('0x32')][_0xe77d('0x90')](_0x1a1da3)['then'](function(_0x519a00){var _0x12df87={'role':_0x1bf419[_0xe77d('0x91')][_0xe77d('0x92')],'userProfileId':_0x1bf419[_0xe77d('0x91')][_0xe77d('0x93')]};if(!_0x12df87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12df87[_0xe77d('0x92')]===_0xe77d('0x94')){var _0x18fbf3=_0x519a00[_0xe77d('0x2b')]({'plain':!![]});return db[_0xe77d('0x95')][_0xe77d('0x4f')]({'where':{'name':_0xe77d('0x96'),'userProfileId':_0x12df87['userProfileId']},'raw':!![]})[_0xe77d('0x2a')](function(_0x30c254){if(_0x30c254&&_0x30c254[_0xe77d('0x97')]===0x0){return db[_0xe77d('0x2c')][_0xe77d('0x90')]({'name':_0x18fbf3[_0xe77d('0x2f')],'resourceId':_0x18fbf3['id'],'type':_0x30c254[_0xe77d('0x2f')],'sectionId':_0x30c254['id']},{})[_0xe77d('0x2a')](function(){return _0x519a00;});}else{return _0x519a00;}})['catch'](function(_0x14539c){logger[_0xe77d('0x2d')](_0xe77d('0x98'),_0x14539c);throw _0x14539c;});}return _0x519a00;})[_0xe77d('0x2a')](respondWithResult(_0xa34774,null))['catch'](handleError(_0xa34774,null));}});}catch(_0x5d6419){_0xa34774[_0xe77d('0x22')](0x1f4)['send'](_0x5d6419);}};function removeReferences(_0x10946c,_0x156096){try{if(_0x10946c){fs[_0xe77d('0x64')](_0x10946c);logger[_0xe77d('0x65')](_0xe77d('0x99'));}if(_0x156096){rimraf(_0x156096,function(){});logger[_0xe77d('0x65')](_0xe77d('0x9a'));}}catch(_0x3eda17){logger[_0xe77d('0x2d')](_0x3eda17);}}exports[_0xe77d('0x29')]=function(_0xf7c2ab,_0x1a10ce,_0x4e51bc){return db[_0xe77d('0x32')][_0xe77d('0x4f')]({'where':{'id':_0xf7c2ab['params']['id']}})['then'](handleEntityNotFound(_0x1a10ce,null))['then'](saveUpdates(_0xf7c2ab['body'],null))[_0xe77d('0x2a')](respondWithResult(_0x1a10ce,null))[_0xe77d('0x4d')](handleError(_0x1a10ce,null));};exports[_0xe77d('0x9b')]=function(_0x4e50e1,_0x1e51e5,_0x4cc7ed){return db['Plugin']['find']({'where':{'id':_0x4e50e1['params']['id']}})[_0xe77d('0x2a')](function(_0x146721){if(_0x146721){return _0x146721['destroy']();}})['then'](function(_0x1886b1){rimraf(path[_0xe77d('0x5e')](config['root'],_0xe77d('0x53'),path['dirname'](_0x1886b1[_0xe77d('0x6')])),function(){});return _0x1886b1;})[_0xe77d('0x2a')](handleEntityNotFound(_0x1e51e5,null))[_0xe77d('0x2a')](respondWithStatusCode(_0x1e51e5,null))[_0xe77d('0x4d')](handleError(_0x1e51e5,null));};exports[_0xe77d('0x9c')]=function(_0x71ca6e,_0x54bc68,_0x412735){return BPromise['resolve']()[_0xe77d('0x2a')](function(){if(!_0x71ca6e[_0xe77d('0x35')][_0xe77d('0x6')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x71ca6e[_0xe77d('0x35')]['port']){throw new Error(_0xe77d('0x9d'));}var _0x4beff7=_0x71ca6e[_0xe77d('0x35')][_0xe77d('0x9e')]?_0x71ca6e[_0xe77d('0x35')][_0xe77d('0x9e')]+':'+_0x71ca6e['query'][_0xe77d('0x9f')]:'http://localhost:'+_0x71ca6e['query']['port'];var _0xa16342=_0x71ca6e['query'][_0xe77d('0x24')]?_0x71ca6e['query'][_0xe77d('0x24')]:!![];var _0x2c65e6=_0x71ca6e[_0xe77d('0x35')][_0xe77d('0xa0')]?_0x71ca6e[_0xe77d('0x35')][_0xe77d('0xa0')]:null;var _0x187680={'method':_0x71ca6e[_0xe77d('0xa1')],'uri':util[_0xe77d('0x54')](_0xe77d('0xa2'),_0x4beff7,_0x71ca6e[_0xe77d('0x35')][_0xe77d('0x6')]),'json':_0xa16342,'resolveWithFullResponse':!![],'encoding':_0x2c65e6,'qs':_0x71ca6e[_0xe77d('0x35')]};if(_0x71ca6e[_0xe77d('0xa3')]){_0x187680['headers']=_0x71ca6e[_0xe77d('0xa3')];if(_0x187680['headers'][_0xe77d('0xa4')]){delete _0x187680[_0xe77d('0xa3')][_0xe77d('0xa4')];}}if(_0x187680[_0xe77d('0xa3')][_0xe77d('0xa5')]){delete _0x187680[_0xe77d('0xa3')][_0xe77d('0xa5')];}return rp(_0x187680);})[_0xe77d('0x2a')](function(_0x285cf0){if(_0x285cf0){_0x54bc68['set'](_0x285cf0[_0xe77d('0xa3')]);logger[_0xe77d('0x65')](_0x285cf0[_0xe77d('0x91')]);if(_[_0xe77d('0xa6')](_0x71ca6e[_0xe77d('0x35')][_0xe77d('0x6')],_0xe77d('0x50'))&&_0x285cf0[_0xe77d('0xa7')]==0x1f4){return _0x54bc68[_0xe77d('0x21')](_0x285cf0[_0xe77d('0xa7')]);}else{return _0x54bc68['status'](_0x285cf0[_0xe77d('0xa7')])[_0xe77d('0x30')](_0x285cf0[_0xe77d('0x91')]);}}else{return _0x54bc68[_0xe77d('0x21')](0xc8);}})[_0xe77d('0x4d')](handleError(_0x54bc68,null));};exports[_0xe77d('0xa8')]=function(_0x18c1fa,_0x2a9961,_0x1178a3){return BPromise[_0xe77d('0xa9')]()[_0xe77d('0x2a')](function(){if(!_0x18c1fa[_0xe77d('0x35')][_0xe77d('0x6')]){throw new Error(_0xe77d('0xaa'));}if(!_0x18c1fa['query'][_0xe77d('0x9f')]){throw new Error(_0xe77d('0x9d'));}var _0x4e8f8e=_0x18c1fa[_0xe77d('0x35')][_0xe77d('0x9e')]?_0x18c1fa[_0xe77d('0x35')][_0xe77d('0x9e')]+':'+_0x18c1fa['query'][_0xe77d('0x9f')]:_0xe77d('0xab')+_0x18c1fa[_0xe77d('0x35')][_0xe77d('0x9f')];var _0x777971=_0x18c1fa[_0xe77d('0x35')][_0xe77d('0x24')]?_0x18c1fa[_0xe77d('0x35')][_0xe77d('0x24')]:!![];var _0x53c2af=_0x18c1fa[_0xe77d('0x35')][_0xe77d('0xa0')]?_0x18c1fa['query'][_0xe77d('0xa0')]:null;var _0x486022={'method':_0x18c1fa[_0xe77d('0xa1')],'uri':util[_0xe77d('0x54')](_0xe77d('0xa2'),_0x4e8f8e,_0x18c1fa['query'][_0xe77d('0x6')]),'json':_0x777971,'resolveWithFullResponse':!![],'encoding':_0x53c2af,'body':_0x18c1fa[_0xe77d('0x91')]};if(_0x18c1fa[_0xe77d('0xa3')]){_0x486022['headers']=_0x18c1fa['headers'];if(_0x486022[_0xe77d('0xa3')][_0xe77d('0xa4')]){delete _0x486022[_0xe77d('0xa3')][_0xe77d('0xa4')];}}if(_0x486022[_0xe77d('0xa3')][_0xe77d('0xa5')]){delete _0x486022[_0xe77d('0xa3')][_0xe77d('0xa5')];}return rp(_0x486022);})[_0xe77d('0x2a')](function(_0xed771c){if(_0xed771c){_0x2a9961[_0xe77d('0x27')](_0xed771c[_0xe77d('0xa3')]);logger[_0xe77d('0x65')](_0xed771c[_0xe77d('0x91')]);return _0x2a9961['status'](_0xed771c[_0xe77d('0xa7')])[_0xe77d('0x30')](_0xed771c['body']);}else{return _0x2a9961[_0xe77d('0x21')](0xc8);}})[_0xe77d('0x4d')](handleError(_0x2a9961,null));}; \ No newline at end of file +var _0xa6b5=['keys','query','filters','intersection','model','attributes','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','rows','catch','show','rawAttributes','fields','length','include','download','find','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','**/*','join','dirname','node_modules/**/*','attachments/**/*','finalize','close','Error','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','manifest.json','readFileSync','parse','undefined','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','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','icon','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptName','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','create','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','params','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','%s%s','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','sendStatus','error','stack','name','send','Plugin'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0xa6b5,0x7b));var _0x5a6b=function(_0x27ad12,_0x1ed7c8){_0x27ad12=_0x27ad12-0x0;var _0x21eef9=_0xa6b5[_0x27ad12];return _0x21eef9;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x5a6b('0x0'));var zipdir=require(_0x5a6b('0x1'));var jsonpatch=require(_0x5a6b('0x2'));var rp=require('request-promise');var moment=require(_0x5a6b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a6b('0x4'));var path=require(_0x5a6b('0x5'));var sox=require('sox');var csv=require(_0x5a6b('0x6'));var ejs=require(_0x5a6b('0x7'));var fs=require('fs');var _=require(_0x5a6b('0x8'));var squel=require('squel');var crypto=require(_0x5a6b('0x9'));var jsforce=require(_0x5a6b('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x5a6b('0x6'));var querystring=require(_0x5a6b('0xb'));var Papa=require(_0x5a6b('0xc'));var extract=require(_0x5a6b('0xd'));var rimraf=require(_0x5a6b('0x0'));var archiver=require(_0x5a6b('0xe'));var Redis=require(_0x5a6b('0xf'));var authService=require(_0x5a6b('0x10'));var qs=require(_0x5a6b('0x11'));var hardwareService=require(_0x5a6b('0x12'));var logger=require(_0x5a6b('0x13'))(_0x5a6b('0x14'));var utils=require(_0x5a6b('0x15'));var config=require('../../config/environment');var db=require(_0x5a6b('0x16'))['db'];config['redis']=_[_0x5a6b('0x17')](config['redis'],{'host':_0x5a6b('0x18'),'port':0x18eb});var socket=require(_0x5a6b('0x19'))(new Redis(config['redis']));require(_0x5a6b('0x1a'))[_0x5a6b('0x1b')](socket);function respondWithStatusCode(_0x184c32,_0x12169b){_0x12169b=_0x12169b||0xcc;return function(_0x565312){if(_0x565312){return _0x184c32['sendStatus'](_0x12169b);}return _0x184c32[_0x5a6b('0x1c')](_0x12169b)[_0x5a6b('0x1d')]();};}function respondWithResult(_0x58120f,_0x21f7fc){_0x21f7fc=_0x21f7fc||0xc8;return function(_0x71bdd){if(_0x71bdd){return _0x58120f[_0x5a6b('0x1c')](_0x21f7fc)[_0x5a6b('0x1e')](_0x71bdd);}};}function respondWithFilteredResult(_0x1876f1,_0x145518){return function(_0x26e8b6){if(_0x26e8b6){var _0x13f90b=_0x26e8b6[_0x5a6b('0x1f')],_0x3da61d=_0x145518['offset'],_0xd8d156=_0x145518[_0x5a6b('0x20')]+_0x145518[_0x5a6b('0x21')],_0x331dba;if(_0xd8d156>=_0x13f90b){_0xd8d156=_0x13f90b;_0x331dba=0xc8;}else{_0x331dba=0xce;}_0x1876f1[_0x5a6b('0x1c')](_0x331dba);return _0x1876f1[_0x5a6b('0x22')](_0x5a6b('0x23'),_0x3da61d+'-'+_0xd8d156+'/'+_0x13f90b)[_0x5a6b('0x1e')](_0x26e8b6);}return null;};}function patchUpdates(_0x2a2a3a){return function(_0x3e57bf){try{jsonpatch[_0x5a6b('0x24')](_0x3e57bf,_0x2a2a3a,!![]);}catch(_0x58763a){return BPromise[_0x5a6b('0x25')](_0x58763a);}return _0x3e57bf[_0x5a6b('0x26')]();};}function saveUpdates(_0x5802bf,_0x3172f7){return function(_0x4d5d75){if(_0x4d5d75){return _0x4d5d75[_0x5a6b('0x27')](_0x5802bf)[_0x5a6b('0x28')](function(_0x2acaf1){return _0x2acaf1;});}return null;};}function removeEntity(_0x484b83,_0x2340c8){return function(_0x151330){if(_0x151330){return _0x151330[_0x5a6b('0x29')]()['then'](function(){var _0x168d47=_0x151330[_0x5a6b('0x2a')]({'plain':!![]});var _0xa1799d=_0x5a6b('0x2b');return db[_0x5a6b('0x2c')][_0x5a6b('0x29')]({'where':{'type':_0xa1799d,'resourceId':_0x168d47['id']}})['then'](function(){return _0x151330;});})[_0x5a6b('0x28')](function(){_0x484b83['status'](0xcc)[_0x5a6b('0x1d')]();});}};}function handleEntityNotFound(_0xb3fb0,_0x26177b){return function(_0x175f72){if(!_0x175f72){_0xb3fb0[_0x5a6b('0x2d')](0x194);}return _0x175f72;};}function handleError(_0x3b86c7,_0x37655c){_0x37655c=_0x37655c||0x1f4;return function(_0x292712){logger[_0x5a6b('0x2e')](_0x292712[_0x5a6b('0x2f')]);if(_0x292712[_0x5a6b('0x30')]){delete _0x292712[_0x5a6b('0x30')];}_0x3b86c7[_0x5a6b('0x1c')](_0x37655c)[_0x5a6b('0x31')](_0x292712);};}exports['index']=function(_0x2183ae,_0x758171){var _0x2843b={},_0x4be0fb={},_0x3a888b={'count':0x0,'rows':[]};var _0x49c6fa=db[_0x5a6b('0x32')]['rawAttributes'];_0x4be0fb['model']=_[_0x5a6b('0x33')](_0x49c6fa);_0x4be0fb[_0x5a6b('0x34')]=_['keys'](_0x2183ae[_0x5a6b('0x34')]);_0x4be0fb[_0x5a6b('0x35')]=_[_0x5a6b('0x36')](_0x4be0fb[_0x5a6b('0x37')],_0x4be0fb[_0x5a6b('0x34')]);_0x2843b[_0x5a6b('0x38')]=_['intersection'](_0x4be0fb[_0x5a6b('0x37')],qs['fields'](_0x2183ae[_0x5a6b('0x34')]['fields']));_0x2843b['attributes']=_0x2843b[_0x5a6b('0x38')]['length']?_0x2843b[_0x5a6b('0x38')]:_0x4be0fb[_0x5a6b('0x37')];if(!_0x2183ae[_0x5a6b('0x34')]['hasOwnProperty'](_0x5a6b('0x39'))){_0x2843b['limit']=qs[_0x5a6b('0x21')](_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x21')]);_0x2843b['offset']=qs[_0x5a6b('0x20')](_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x20')]);}_0x2843b[_0x5a6b('0x3a')]=qs[_0x5a6b('0x3b')](_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x3b')]);_0x2843b[_0x5a6b('0x3c')]=qs['filters'](_[_0x5a6b('0x3d')](_0x2183ae['query'],_0x4be0fb['filters']));if(_0x2183ae[_0x5a6b('0x34')][_0x5a6b('0x3e')]){_0x2843b[_0x5a6b('0x3c')]=_[_0x5a6b('0x3f')](_0x2843b['where'],{'$or':_[_0x5a6b('0x40')](_0x49c6fa,function(_0x3368cb){if(_0x3368cb[_0x5a6b('0x41')][_0x5a6b('0x42')]!==_0x5a6b('0x43')){var _0x4935da={};_0x4935da[_0x3368cb[_0x5a6b('0x44')]]={'$like':'%'+_0x2183ae[_0x5a6b('0x34')]['filter']+'%'};return _0x4935da;}})});}_0x2843b=_[_0x5a6b('0x3f')]({},_0x2843b,_0x2183ae[_0x5a6b('0x45')]);var _0x1e37e6={'where':_0x2843b[_0x5a6b('0x3c')]};return db[_0x5a6b('0x32')]['count'](_0x1e37e6)[_0x5a6b('0x28')](function(_0x15db68){_0x3a888b[_0x5a6b('0x1f')]=_0x15db68;if(_0x2183ae['query'][_0x5a6b('0x46')]){_0x2843b['include']=[{'all':!![]}];}return db[_0x5a6b('0x32')][_0x5a6b('0x47')](_0x2843b);})['then'](function(_0xd1873d){_0x3a888b[_0x5a6b('0x48')]=_0xd1873d;return _0x3a888b;})[_0x5a6b('0x28')](respondWithFilteredResult(_0x758171,_0x2843b))[_0x5a6b('0x49')](handleError(_0x758171,null));};exports[_0x5a6b('0x4a')]=function(_0x7e9200,_0x258fa5){var _0x19125a={'raw':!![],'where':{'id':_0x7e9200['params']['id']}},_0x266c70={};_0x266c70[_0x5a6b('0x37')]=_[_0x5a6b('0x33')](db[_0x5a6b('0x32')][_0x5a6b('0x4b')]);_0x266c70[_0x5a6b('0x34')]=_['keys'](_0x7e9200[_0x5a6b('0x34')]);_0x266c70['filters']=_['intersection'](_0x266c70['model'],_0x266c70['query']);_0x19125a[_0x5a6b('0x38')]=_['intersection'](_0x266c70[_0x5a6b('0x37')],qs[_0x5a6b('0x4c')](_0x7e9200[_0x5a6b('0x34')][_0x5a6b('0x4c')]));_0x19125a[_0x5a6b('0x38')]=_0x19125a[_0x5a6b('0x38')][_0x5a6b('0x4d')]?_0x19125a[_0x5a6b('0x38')]:_0x266c70['model'];if(_0x7e9200[_0x5a6b('0x34')][_0x5a6b('0x46')]){_0x19125a[_0x5a6b('0x4e')]=[{'all':!![]}];}_0x19125a=_[_0x5a6b('0x3f')]({},_0x19125a,_0x7e9200[_0x5a6b('0x45')]);return db[_0x5a6b('0x32')]['find'](_0x19125a)[_0x5a6b('0x28')](handleEntityNotFound(_0x258fa5,null))[_0x5a6b('0x28')](respondWithResult(_0x258fa5,null))['catch'](handleError(_0x258fa5,null));};exports[_0x5a6b('0x4f')]=function(_0x536f5b,_0x4ffeb0,_0x11237b){return db['Plugin'][_0x5a6b('0x50')]({'where':{'id':_0x536f5b['params']['id']},'attributes':[_0x5a6b('0x30'),_0x5a6b('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x4ffeb0,null))[_0x5a6b('0x28')](function(_0x8dd3c){if(_0x8dd3c){var _0x2e9d7b=path['join'](config[_0x5a6b('0x51')],_0x5a6b('0x52'),util[_0x5a6b('0x53')](_0x5a6b('0x54'),path[_0x5a6b('0x55')](_0x8dd3c[_0x5a6b('0x5')])));var _0x29d7e3=fs[_0x5a6b('0x56')](_0x2e9d7b);var _0x4ddac2=archiver(_0x5a6b('0x57'),{'zlib':{'level':0x9}});_0x4ddac2['on'](_0x5a6b('0x58'),function(_0x32da26){if(_0x32da26[_0x5a6b('0x59')]===_0x5a6b('0x5a')){logger[_0x5a6b('0x2e')](_0x32da26);}else{throw new db[(_0x5a6b('0x5b'))]['Error'](_0x5a6b('0x5c'));}});_0x4ddac2['on'](_0x5a6b('0x2e'),function(_0x4803cd){throw new db[(_0x5a6b('0x5b'))]['Error'](_0x5a6b('0x5c'));});_0x4ddac2[_0x5a6b('0x5d')](_0x29d7e3);_0x4ddac2['glob'](_0x5a6b('0x5e'),{'cwd':path[_0x5a6b('0x5f')](config[_0x5a6b('0x51')],'server/files/plugins',path[_0x5a6b('0x60')](_0x8dd3c[_0x5a6b('0x5')])),'ignore':[path[_0x5a6b('0x5f')](path['basename'](_0x8dd3c[_0x5a6b('0x5')]),_0x5a6b('0x61')),path[_0x5a6b('0x5f')](path[_0x5a6b('0x55')](_0x8dd3c[_0x5a6b('0x5')]),_0x5a6b('0x62'))],'nodir':!![]})[_0x5a6b('0x63')]();_0x29d7e3['on'](_0x5a6b('0x64'),function(){if(!fs['existsSync'](_0x2e9d7b)){throw new db[(_0x5a6b('0x5b'))][(_0x5a6b('0x65'))](_0x5a6b('0x66'));}return _0x4ffeb0['download'](_0x2e9d7b,util[_0x5a6b('0x53')](_0x5a6b('0x54'),path[_0x5a6b('0x55')](_0x8dd3c[_0x5a6b('0x5')])),function(_0x571ea1){if(_0x571ea1){throw new db[(_0x5a6b('0x5b'))][(_0x5a6b('0x65'))](_0x5a6b('0x67'));}fs['unlinkSync'](_0x2e9d7b);logger[_0x5a6b('0x68')](_0x5a6b('0x69'));logger[_0x5a6b('0x68')](_0x5a6b('0x6a'));});});}return null;})[_0x5a6b('0x49')](handleError(_0x4ffeb0,null));};exports[_0x5a6b('0x6b')]=function(_0x38ad1b,_0x4448a4,_0x3e70ce){var _0x33d366=path[_0x5a6b('0x55')](_0x38ad1b[_0x5a6b('0x6c')][_0x5a6b('0x6d')],path['extname'](_0x38ad1b[_0x5a6b('0x6c')][_0x5a6b('0x6d')]));var _0x399c34=path[_0x5a6b('0x5f')](config['root'],_0x5a6b('0x52'),_0x38ad1b[_0x5a6b('0x6c')][_0x5a6b('0x6d')]);var _0x24515c=path[_0x5a6b('0x5f')](config[_0x5a6b('0x51')],_0x5a6b('0x52'),_0x33d366);logger[_0x5a6b('0x68')](_0x5a6b('0x6e'),_0x399c34);logger[_0x5a6b('0x68')](_0x5a6b('0x6f'),_0x24515c);try{fs[_0x5a6b('0x70')](_0x399c34,parseInt(_0x5a6b('0x71'),0x8));extract(_0x399c34,{'dir':_0x24515c},function(_0x2b1a59){if(_0x2b1a59){logger[_0x5a6b('0x2e')](_0x2b1a59);handleError(_0x2b1a59,!![]);};var _0x586ef9=fs[_0x5a6b('0x72')](_0x24515c);if(_0x586ef9[_0x5a6b('0x4d')]>0x1){removeReferences(_0x399c34,_0x24515c);logger['error'](_0x5a6b('0x73'));return _0x3e70ce(new Error(_0x5a6b('0x73')));}var _0x549cc9=fs[_0x5a6b('0x74')](path[_0x5a6b('0x5f')](_0x24515c,_0x586ef9[0x0]));if(_0x549cc9[_0x5a6b('0x75')]()){removeReferences(_0x399c34,_0x24515c);logger['error'](_0x5a6b('0x73'));return _0x3e70ce(new Error(_0x5a6b('0x73')));}if(_0x549cc9[_0x5a6b('0x76')]()){var _0x5d234b=fs[_0x5a6b('0x72')](path['join'](_0x24515c,_0x586ef9[0x0]));if(_0x5d234b[_0x5a6b('0x4d')]===0x0){removeReferences(_0x399c34,_0x24515c);logger[_0x5a6b('0x2e')](_0x5a6b('0x73'));return _0x3e70ce(new Error(_0x5a6b('0x73')));}var _0x14585d=_0x5d234b['some'](function(_0xac0697){return _0xac0697===_0x5a6b('0x77');});if(!_0x14585d){return _0x3e70ce(new Error('Plugin\x20manifest\x20missing'));}var _0x33a4b7=fs[_0x5a6b('0x78')](path[_0x5a6b('0x5f')](_0x24515c,_0x586ef9[0x0],_0x5a6b('0x77')));var _0x171d21=JSON[_0x5a6b('0x79')](_0x33a4b7);if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x30')]){return _0x3e70ce(new Error(_0x5a6b('0x7b')));}if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x41')]){return _0x3e70ce(new Error(_0x5a6b('0x7c')));}if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x7d')]){return _0x3e70ce(new Error(_0x5a6b('0x7e')));}if('undefined'==typeof _0x171d21[_0x5a6b('0x7f')]){return _0x3e70ce(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x171d21[_0x5a6b('0x41')]===_0x5a6b('0x80')){if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x7f')]['views']){return _0x3e70ce(new Error(_0x5a6b('0x81')));}if(_0x5a6b('0x7a')==typeof _0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')]&&'undefined'==typeof _0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x84')]){return _0x3e70ce(new Error(_0x5a6b('0x85')));}}else if(_0x171d21[_0x5a6b('0x41')]===_0x5a6b('0x86')){if('undefined'==typeof _0x171d21[_0x5a6b('0x7f')]['scriptName']){return _0x3e70ce(new Error(_0x5a6b('0x87')));}if('undefined'==typeof _0x171d21['parameters'][_0x5a6b('0x88')]){return _0x3e70ce(new Error(_0x5a6b('0x89')));}}else{return _0x3e70ce(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x619f2d=_0x171d21[_0x5a6b('0x30')];var _0x257680=_0x171d21[_0x5a6b('0x8a')];var _0x3fc3f2=_0x171d21[_0x5a6b('0x41')];var _0x53e42b=_0x171d21[_0x5a6b('0x8b')]?_0x171d21[_0x5a6b('0x8b')]:'always';var _0x38a1b7=_0x171d21[_0x5a6b('0x8c')]?_0x171d21[_0x5a6b('0x8c')]:'icon-apps';var _0x49fea4='';var _0x2024a9='';var _0x489c02='';var _0x2549ca='';var _0xa9bd89=_0x171d21['version'];if(_0x3fc3f2===_0x5a6b('0x80')){if('undefined'!=typeof _0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')]){var _0x139e2d=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x139e2d)){_0x49fea4=path['join'](_0x5a6b('0x8d'),_0x33d366,_0x586ef9[0x0],_0x139e2d);}else{_0x49fea4=_0x139e2d;}}else{logger[_0x5a6b('0x68')](_0x5a6b('0x8e'));}if(_0x5a6b('0x7a')!=typeof _0x171d21['parameters'][_0x5a6b('0x82')][_0x5a6b('0x84')]){var _0x43e8ff=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x5a6b('0x8f')](_0x43e8ff)){_0x2024a9=path[_0x5a6b('0x5f')](_0x5a6b('0x8d'),_0x33d366,_0x586ef9[0x0],_0x43e8ff);}else{_0x2024a9=_0x43e8ff;}}else{logger['info'](_0x5a6b('0x90'));}}else if(_0x3fc3f2==='script'){_0x489c02=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x91')];_0x2549ca=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x88')];if('undefined'!=typeof _0x171d21['parameters']['views']){if(_0x5a6b('0x7a')!=typeof _0x171d21['parameters'][_0x5a6b('0x82')][_0x5a6b('0x83')]){var _0x139e2d=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')][_0x5a6b('0x83')];if(!/^(f|ht)tps?:\/\//i['test'](_0x139e2d)){_0x49fea4=path[_0x5a6b('0x5f')]('plugins',_0x33d366,_0x586ef9[0x0],_0x139e2d);}else{_0x49fea4=_0x139e2d;}}if('undefined'!=typeof _0x171d21['parameters']['views'][_0x5a6b('0x84')]){var _0x43e8ff=_0x171d21[_0x5a6b('0x7f')][_0x5a6b('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x5a6b('0x8f')](_0x43e8ff)){_0x2024a9=path['join']('plugins',_0x33d366,_0x586ef9[0x0],_0x43e8ff);}else{_0x2024a9=_0x43e8ff;}}}}var _0x23d885={'name':_0x619f2d,'description':_0x257680,'path':path[_0x5a6b('0x5f')](_0x33d366,_0x586ef9[0x0]),'type':_0x3fc3f2,'sidebar':_0x53e42b,'icon':_0x38a1b7,'adminUrl':_0x49fea4,'agentUrl':_0x2024a9,'scriptName':_0x489c02,'scriptPath':_0x2549ca,'version':_0xa9bd89};removeReferences(_0x399c34,null);return db[_0x5a6b('0x32')]['create'](_0x23d885)['then'](function(_0xd5c97){var _0x56fa54={'role':_0x38ad1b['body'][_0x5a6b('0x92')],'userProfileId':_0x38ad1b[_0x5a6b('0x93')][_0x5a6b('0x94')]};if(!_0x56fa54)throw new Error(_0x5a6b('0x95'));if(_0x56fa54[_0x5a6b('0x92')]===_0x5a6b('0x96')){var _0x470e15=_0xd5c97['get']({'plain':!![]});return db['UserProfileSection'][_0x5a6b('0x50')]({'where':{'name':_0x5a6b('0x2b'),'userProfileId':_0x56fa54[_0x5a6b('0x94')]},'raw':!![]})[_0x5a6b('0x28')](function(_0x10f757){if(_0x10f757&&_0x10f757[_0x5a6b('0x97')]===0x0){return db['UserProfileResource'][_0x5a6b('0x98')]({'name':_0x470e15['name'],'resourceId':_0x470e15['id'],'type':_0x10f757[_0x5a6b('0x30')],'sectionId':_0x10f757['id']},{})[_0x5a6b('0x28')](function(){return _0xd5c97;});}else{return _0xd5c97;}})[_0x5a6b('0x49')](function(_0x42b689){logger[_0x5a6b('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42b689);throw _0x42b689;});}return _0xd5c97;})[_0x5a6b('0x28')](respondWithResult(_0x4448a4,null))[_0x5a6b('0x49')](handleError(_0x4448a4,null));}});}catch(_0x541ca6){_0x4448a4[_0x5a6b('0x1c')](0x1f4)[_0x5a6b('0x31')](_0x541ca6);}};function removeReferences(_0x20e23c,_0x452633){try{if(_0x20e23c){fs[_0x5a6b('0x99')](_0x20e23c);logger['info'](_0x5a6b('0x9a'));}if(_0x452633){rimraf(_0x452633,function(){});logger[_0x5a6b('0x68')](_0x5a6b('0x9b'));}}catch(_0x315ff5){logger[_0x5a6b('0x2e')](_0x315ff5);}}exports['update']=function(_0x57cf89,_0xec1f52,_0x20de7f){return db[_0x5a6b('0x32')]['find']({'where':{'id':_0x57cf89[_0x5a6b('0x9c')]['id']}})['then'](handleEntityNotFound(_0xec1f52,null))[_0x5a6b('0x28')](saveUpdates(_0x57cf89[_0x5a6b('0x93')],null))[_0x5a6b('0x28')](respondWithResult(_0xec1f52,null))[_0x5a6b('0x49')](handleError(_0xec1f52,null));};exports[_0x5a6b('0x9d')]=function(_0x1d523d,_0xef39b3,_0x35f9e3){return db[_0x5a6b('0x32')][_0x5a6b('0x50')]({'where':{'id':_0x1d523d[_0x5a6b('0x9c')]['id']}})[_0x5a6b('0x28')](function(_0x534e7e){if(_0x534e7e){return _0x534e7e[_0x5a6b('0x29')]();}})['then'](function(_0x3906be){rimraf(path[_0x5a6b('0x5f')](config['root'],'server/files/plugins',path[_0x5a6b('0x60')](_0x3906be[_0x5a6b('0x5')])),function(){});return _0x3906be;})[_0x5a6b('0x28')](handleEntityNotFound(_0xef39b3,null))[_0x5a6b('0x28')](respondWithStatusCode(_0xef39b3,null))[_0x5a6b('0x49')](handleError(_0xef39b3,null));};exports[_0x5a6b('0x9e')]=function(_0x1e2e83,_0x5f00cc,_0x3aa27d){return BPromise[_0x5a6b('0x9f')]()[_0x5a6b('0x28')](function(){if(!_0x1e2e83['query'][_0x5a6b('0x5')]){throw new Error(_0x5a6b('0xa0'));}if(!_0x1e2e83['query'][_0x5a6b('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3fa447=_0x1e2e83['query'][_0x5a6b('0xa2')]?_0x1e2e83['query'][_0x5a6b('0xa2')]+':'+_0x1e2e83[_0x5a6b('0x34')]['port']:_0x5a6b('0xa3')+_0x1e2e83[_0x5a6b('0x34')][_0x5a6b('0xa1')];var _0x54374b=_0x1e2e83[_0x5a6b('0x34')]['json']?_0x1e2e83[_0x5a6b('0x34')]['json']:!![];var _0x38dde0=_0x1e2e83['query']['encoding']?_0x1e2e83['query'][_0x5a6b('0xa4')]:null;var _0x1fd79b={'method':_0x1e2e83[_0x5a6b('0xa5')],'uri':util[_0x5a6b('0x53')]('%s%s',_0x3fa447,_0x1e2e83['query']['path']),'json':_0x54374b,'resolveWithFullResponse':!![],'encoding':_0x38dde0,'qs':_0x1e2e83[_0x5a6b('0x34')]};if(_0x1e2e83[_0x5a6b('0xa6')]){_0x1fd79b[_0x5a6b('0xa6')]=_0x1e2e83[_0x5a6b('0xa6')];if(_0x1fd79b[_0x5a6b('0xa6')]['content-length']){delete _0x1fd79b[_0x5a6b('0xa6')][_0x5a6b('0xa7')];}}if(_0x1fd79b[_0x5a6b('0xa6')][_0x5a6b('0xa8')]){delete _0x1fd79b[_0x5a6b('0xa6')]['content-type'];}return rp(_0x1fd79b);})['then'](function(_0xebd22b){if(_0xebd22b){_0x5f00cc['set'](_0xebd22b[_0x5a6b('0xa6')]);logger['info'](_0xebd22b['body']);if(_[_0x5a6b('0xa9')](_0x1e2e83[_0x5a6b('0x34')][_0x5a6b('0x5')],'download')&&_0xebd22b[_0x5a6b('0xaa')]==0x1f4){return _0x5f00cc[_0x5a6b('0x2d')](_0xebd22b[_0x5a6b('0xaa')]);}else{return _0x5f00cc[_0x5a6b('0x1c')](_0xebd22b[_0x5a6b('0xaa')])[_0x5a6b('0x31')](_0xebd22b['body']);}}else{return _0x5f00cc['sendStatus'](0xc8);}})[_0x5a6b('0x49')](handleError(_0x5f00cc,null));};exports[_0x5a6b('0xab')]=function(_0x2c5f4e,_0x30186c,_0x23a71a){return BPromise[_0x5a6b('0x9f')]()[_0x5a6b('0x28')](function(){if(!_0x2c5f4e[_0x5a6b('0x34')]['path']){throw new Error(_0x5a6b('0xa0'));}if(!_0x2c5f4e[_0x5a6b('0x34')]['port']){throw new Error(_0x5a6b('0xac'));}var _0x3e2249=_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa2')]?_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa2')]+':'+_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa1')]:'http://localhost:'+_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa1')];var _0x339a69=_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0x1e')]?_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0x1e')]:!![];var _0x2bbb93=_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0xa4')]?_0x2c5f4e[_0x5a6b('0x34')]['encoding']:null;var _0x19f65f={'method':_0x2c5f4e[_0x5a6b('0xa5')],'uri':util[_0x5a6b('0x53')](_0x5a6b('0xad'),_0x3e2249,_0x2c5f4e[_0x5a6b('0x34')][_0x5a6b('0x5')]),'json':_0x339a69,'resolveWithFullResponse':!![],'encoding':_0x2bbb93,'body':_0x2c5f4e[_0x5a6b('0x93')]};if(_0x2c5f4e['headers']){_0x19f65f[_0x5a6b('0xa6')]=_0x2c5f4e[_0x5a6b('0xa6')];if(_0x19f65f[_0x5a6b('0xa6')][_0x5a6b('0xa7')]){delete _0x19f65f[_0x5a6b('0xa6')][_0x5a6b('0xa7')];}}if(_0x19f65f['headers'][_0x5a6b('0xa8')]){delete _0x19f65f[_0x5a6b('0xa6')]['content-type'];}return rp(_0x19f65f);})[_0x5a6b('0x28')](function(_0x79cd95){if(_0x79cd95){_0x30186c[_0x5a6b('0x22')](_0x79cd95[_0x5a6b('0xa6')]);logger[_0x5a6b('0x68')](_0x79cd95[_0x5a6b('0x93')]);return _0x30186c[_0x5a6b('0x1c')](_0x79cd95['statusCode'])[_0x5a6b('0x31')](_0x79cd95[_0x5a6b('0x93')]);}else{return _0x30186c[_0x5a6b('0x2d')](0xc8);}})[_0x5a6b('0x49')](handleError(_0x30186c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2e2fb5a..a4df945 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 _0x7a54=['Plugin','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5acd5c,_0x12ba86){var _0x178087=function(_0x358c13){while(--_0x358c13){_0x5acd5c['push'](_0x5acd5c['shift']());}};_0x178087(++_0x12ba86);}(_0x7a54,0x106));var _0x47a5=function(_0x5336e8,_0x43dfa0){_0x5336e8=_0x5336e8-0x0;var _0x4c2ffe=_0x7a54[_0x5336e8];return _0x4c2ffe;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var Plugin=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){PluginEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);PluginEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x47a5('0x7')]=PluginEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','Plugin','setMaxListeners','save','remove','emit'];(function(_0x3959cf,_0x2bd925){var _0x41534f=function(_0x5b2e7b){while(--_0x5b2e7b){_0x3959cf['push'](_0x3959cf['shift']());}};_0x41534f(++_0x2bd925);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a30b3,_0x3ddbdb){_0x4a30b3=_0x4a30b3-0x0;var _0x161079=_0xb10b[_0x4a30b3];return _0x161079;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var Plugin=require('../../mysqldb')['db'][_0xbb10('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){PluginEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);PluginEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];Plugin[_0xbb10('0x7')](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 45dea1c..c5e1fa2 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 _0xb458=['../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1a4cfc,_0x53a1af){var _0x1bb003=function(_0x2396f5){while(--_0x2396f5){_0x1a4cfc['push'](_0x1a4cfc['shift']());}};_0x1bb003(++_0x53a1af);}(_0xb458,0x94));var _0x8b45=function(_0x399806,_0x18cd13){_0x399806=_0x399806-0x0;var _0x5ec53c=_0xb458[_0x399806];return _0x5ec53c;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8b45('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8b45('0x4'));var rimraf=require(_0x8b45('0x5'));var config=require(_0x8b45('0x6'));var attributes=require(_0x8b45('0x7'));module['exports']=function(_0xfe8757,_0xd23b88){return _0xfe8757[_0x8b45('0x8')](_0x8b45('0x9'),attributes,{'tableName':_0x8b45('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dbc=['path','rimraf','../../config/environment','exports','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x5dbc,0x166));var _0xc5db=function(_0x3ae189,_0x2c2ef6){_0x3ae189=_0x3ae189-0x0;var _0x38407d=_0x5dbc[_0x3ae189];return _0x38407d;};'use strict';var _=require(_0xc5db('0x0'));var util=require('util');var logger=require(_0xc5db('0x1'))(_0xc5db('0x2'));var moment=require(_0xc5db('0x3'));var BPromise=require(_0xc5db('0x4'));var rp=require(_0xc5db('0x5'));var fs=require('fs');var path=require(_0xc5db('0x6'));var rimraf=require(_0xc5db('0x7'));var config=require(_0xc5db('0x8'));var attributes=require('./plugin.attributes');module[_0xc5db('0x9')]=function(_0x3b4256,_0x49e0f3){return _0x3b4256[_0xc5db('0xa')](_0xc5db('0xb'),attributes,{'tableName':_0xc5db('0xc'),'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 606e38c..e6ea962 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 _0x4448=['stringify','error','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s'];(function(_0x40a740,_0x5e1944){var _0x2b5bbb=function(_0x2b3bed){while(--_0x2b3bed){_0x40a740['push'](_0x40a740['shift']());}};_0x2b5bbb(++_0x5e1944);}(_0x4448,0x135));var _0x8444=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4448[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8444('0x0'));var util=require(_0x8444('0x1'));var moment=require(_0x8444('0x2'));var BPromise=require(_0x8444('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8444('0x4'));var db=require(_0x8444('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8444('0x6'))(_0x8444('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8444('0x8')]['http']({'port':0x232a});config[_0x8444('0x9')]=_[_0x8444('0xa')](config[_0x8444('0x9')],{'host':_0x8444('0xb'),'port':0x18eb});var socket=require(_0x8444('0xc'))(new Redis(config[_0x8444('0x9')]));require(_0x8444('0xd'))[_0x8444('0xe')](socket);function respondWithRpcPromise(_0x5a6df5,_0x4f349e,_0x155813){return new BPromise(function(_0x50af8a,_0x337fae){return client[_0x8444('0xf')](_0x5a6df5,_0x155813)[_0x8444('0x10')](function(_0x28aa5f){logger[_0x8444('0x11')](_0x8444('0x12'),_0x4f349e,_0x8444('0x13'));logger['debug'](_0x8444('0x14'),_0x4f349e,'request\x20sent',JSON[_0x8444('0x15')](_0x28aa5f));if(_0x28aa5f[_0x8444('0x16')]){if(_0x28aa5f['error']['code']===0x1f4){logger[_0x8444('0x16')](_0x8444('0x12'),_0x4f349e,_0x28aa5f[_0x8444('0x16')]['message']);return _0x337fae(_0x28aa5f[_0x8444('0x16')][_0x8444('0x17')]);}logger[_0x8444('0x16')](_0x8444('0x12'),_0x4f349e,_0x28aa5f[_0x8444('0x16')][_0x8444('0x17')]);return _0x50af8a(_0x28aa5f[_0x8444('0x16')][_0x8444('0x17')]);}else{logger[_0x8444('0x11')](_0x8444('0x12'),_0x4f349e,'request\x20sent');_0x50af8a(_0x28aa5f[_0x8444('0x18')][_0x8444('0x17')]);}})[_0x8444('0x19')](function(_0x61752a){logger[_0x8444('0x16')]('Plugin,\x20%s,\x20%s',_0x4f349e,_0x61752a);_0x337fae(_0x61752a);});});}exports[_0x8444('0x1a')]=function(_0x56f576){var _0x9e24f8=this;return new Promise(function(_0xe209b3,_0x381a2c){return db[_0x8444('0x1b')][_0x8444('0x1c')](_0x56f576[_0x8444('0x1d')],{'raw':_0x56f576[_0x8444('0x1e')]?_0x56f576[_0x8444('0x1e')][_0x8444('0x1f')]===undefined?!![]:![]:!![]})[_0x8444('0x10')](function(_0x1e3eee){logger[_0x8444('0x11')](_0x8444('0x1a'),_0x56f576);logger[_0x8444('0x20')]('CreatePlugin',_0x56f576,JSON[_0x8444('0x15')](_0x1e3eee));_0xe209b3(_0x1e3eee);})[_0x8444('0x19')](function(_0x254b8a){logger[_0x8444('0x16')](_0x8444('0x1a'),_0x254b8a[_0x8444('0x17')],_0x56f576);_0x381a2c(_0x9e24f8[_0x8444('0x16')](0x1f4,_0x254b8a['message']));});});}; \ No newline at end of file +var _0x1819=['./plugin.socket','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost'];(function(_0x2b24cf,_0x55c607){var _0x49bc49=function(_0x2dc386){while(--_0x2dc386){_0x2b24cf['push'](_0x2b24cf['shift']());}};_0x49bc49(++_0x55c607);}(_0x1819,0x101));var _0x9181=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0x1819[_0x4b6778];return _0x22dbb9;};'use strict';var _=require(_0x9181('0x0'));var util=require(_0x9181('0x1'));var moment=require(_0x9181('0x2'));var BPromise=require('bluebird');var rs=require(_0x9181('0x3'));var fs=require('fs');var Redis=require(_0x9181('0x4'));var db=require(_0x9181('0x5'))['db'];var utils=require(_0x9181('0x6'));var logger=require('../../config/logger')(_0x9181('0x7'));var config=require(_0x9181('0x8'));var jayson=require(_0x9181('0x9'));var client=jayson[_0x9181('0xa')][_0x9181('0xb')]({'port':0x232a});config['redis']=_[_0x9181('0xc')](config[_0x9181('0xd')],{'host':_0x9181('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9181('0xf'))[_0x9181('0x10')](socket);function respondWithRpcPromise(_0x4ff4aa,_0x20544a,_0x3a99c8){return new BPromise(function(_0x2b9810,_0x45f714){return client[_0x9181('0x11')](_0x4ff4aa,_0x3a99c8)[_0x9181('0x12')](function(_0x269552){logger[_0x9181('0x13')]('Plugin,\x20%s,\x20%s',_0x20544a,_0x9181('0x14'));logger[_0x9181('0x15')](_0x9181('0x16'),_0x20544a,_0x9181('0x14'),JSON[_0x9181('0x17')](_0x269552));if(_0x269552['error']){if(_0x269552[_0x9181('0x18')]['code']===0x1f4){logger[_0x9181('0x18')](_0x9181('0x19'),_0x20544a,_0x269552['error'][_0x9181('0x1a')]);return _0x45f714(_0x269552[_0x9181('0x18')][_0x9181('0x1a')]);}logger[_0x9181('0x18')](_0x9181('0x19'),_0x20544a,_0x269552[_0x9181('0x18')][_0x9181('0x1a')]);return _0x2b9810(_0x269552[_0x9181('0x18')]['message']);}else{logger['info'](_0x9181('0x19'),_0x20544a,'request\x20sent');_0x2b9810(_0x269552[_0x9181('0x1b')][_0x9181('0x1a')]);}})[_0x9181('0x1c')](function(_0x3044e3){logger[_0x9181('0x18')](_0x9181('0x19'),_0x20544a,_0x3044e3);_0x45f714(_0x3044e3);});});}exports[_0x9181('0x1d')]=function(_0x4d377b){var _0x3a3ba8=this;return new Promise(function(_0x30ff3d,_0x138498){return db['Plugin'][_0x9181('0x1e')](_0x4d377b[_0x9181('0x1f')],{'raw':_0x4d377b[_0x9181('0x20')]?_0x4d377b[_0x9181('0x20')][_0x9181('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x453f32){logger[_0x9181('0x13')](_0x9181('0x1d'),_0x4d377b);logger['debug']('CreatePlugin',_0x4d377b,JSON[_0x9181('0x17')](_0x453f32));_0x30ff3d(_0x453f32);})[_0x9181('0x1c')](function(_0x422fb9){logger['error'](_0x9181('0x1d'),_0x422fb9[_0x9181('0x1a')],_0x4d377b);_0x138498(_0x3a3ba8[_0x9181('0x18')](0x1f4,_0x422fb9['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 932933a..052a83d 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 _0xf8d8=['length','plugin:','./plugin.events','save','remove','update','emit','removeListener','register'];(function(_0xfa0b32,_0xc9513a){var _0xa38279=function(_0x16d637){while(--_0x16d637){_0xfa0b32['push'](_0xfa0b32['shift']());}};_0xa38279(++_0xc9513a);}(_0xf8d8,0x122));var _0x8f8d=function(_0x1d9d4f,_0x504219){_0x1d9d4f=_0x1d9d4f-0x0;var _0x3577cf=_0xf8d8[_0x1d9d4f];return _0x3577cf;};'use strict';var PluginEvents=require(_0x8f8d('0x0'));var events=[_0x8f8d('0x1'),_0x8f8d('0x2'),_0x8f8d('0x3')];function createListener(_0x165487,_0x152541){return function(_0x172040){_0x152541[_0x8f8d('0x4')](_0x165487,_0x172040);};}function removeListener(_0x1a5822,_0x1e7beb){return function(){PluginEvents[_0x8f8d('0x5')](_0x1a5822,_0x1e7beb);};}exports[_0x8f8d('0x6')]=function(_0x4d5620){for(var _0x3e2f55=0x0,_0x1f7e56=events[_0x8f8d('0x7')];_0x3e2f55<_0x1f7e56;_0x3e2f55++){var _0x39a695=events[_0x3e2f55];var _0x5f09a5=createListener(_0x8f8d('0x8')+_0x39a695,_0x4d5620);PluginEvents['on'](_0x39a695,_0x5f09a5);}}; \ No newline at end of file +var _0xa0b3=['plugin:','update','emit','removeListener','register','length'];(function(_0x5d26ac,_0x18c21b){var _0x5464b3=function(_0x2c4563){while(--_0x2c4563){_0x5d26ac['push'](_0x5d26ac['shift']());}};_0x5464b3(++_0x18c21b);}(_0xa0b3,0x169));var _0x3a0b=function(_0x1c9996,_0x2ef167){_0x1c9996=_0x1c9996-0x0;var _0x3a10a2=_0xa0b3[_0x1c9996];return _0x3a10a2;};'use strict';var PluginEvents=require('./plugin.events');var events=['save','remove',_0x3a0b('0x0')];function createListener(_0x35cf34,_0x9f79af){return function(_0x142f10){_0x9f79af[_0x3a0b('0x1')](_0x35cf34,_0x142f10);};}function removeListener(_0x4b2c48,_0x2000e4){return function(){PluginEvents[_0x3a0b('0x2')](_0x4b2c48,_0x2000e4);};}exports[_0x3a0b('0x3')]=function(_0x36695a){for(var _0x455ba6=0x0,_0x5850f5=events[_0x3a0b('0x4')];_0x455ba6<_0x5850f5;_0x455ba6++){var _0x111a59=events[_0x455ba6];var _0x1e2115=createListener(_0x3a0b('0x5')+_0x111a59,_0x36695a);PluginEvents['on'](_0x111a59,_0x1e2115);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f36cf6f..2eb62b0 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(_0x11af91,_0x47cefe){var _0x15c42b=function(_0x39c74d){while(--_0x39c74d){_0x11af91['push'](_0x11af91['shift']());}};_0x15c42b(++_0x47cefe);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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(_0x491a95,_0x2c253c){var _0x1da527=function(_0x21b8e0){while(--_0x21b8e0){_0x491a95['push'](_0x491a95['shift']());}};_0x1da527(++_0x2c253c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'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 aaf870b..6489daf 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 _0xc7e1=['name','send','info','index','list','reject','express','motion2','then','catch','show','describe','params','body','script','join','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','update','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','status','error','stack'];(function(_0x272d10,_0x25b188){var _0x5162b6=function(_0x1becf9){while(--_0x1becf9){_0x272d10['push'](_0x272d10['shift']());}};_0x5162b6(++_0x25b188);}(_0xc7e1,0x15d));var _0x1c7e=function(_0x2c3c1a,_0x15d286){_0x2c3c1a=_0x2c3c1a-0x0;var _0x28c56d=_0xc7e1[_0x2c3c1a];return _0x28c56d;};'use strict';var _=require(_0x1c7e('0x0'));var pm2=require(_0x1c7e('0x1'));var logger=require(_0x1c7e('0x2'))(_0x1c7e('0x3'));var path=require(_0x1c7e('0x4'));var exec=require(_0x1c7e('0x5'))[_0x1c7e('0x6')];var BPromise=require('bluebird');function handleEntityNotFound(_0x3e01d3,_0x1b30ef){return function(_0x1a1a4c){if(!_0x1a1a4c){_0x3e01d3[_0x1c7e('0x7')](0x194);;}return _0x1a1a4c;};}function respondWithResult(_0x5bec3d,_0x26437f){_0x26437f=_0x26437f||0xc8;return function(_0x11bd52){if(_0x11bd52){return _0x5bec3d[_0x1c7e('0x8')](_0x26437f)['json'](_0x11bd52);}return null;};}function handleError(_0x45ab10,_0x2dd994){_0x2dd994=_0x2dd994||0x1f4;return function(_0x987a78){logger[_0x1c7e('0x9')](_0x987a78[_0x1c7e('0xa')]);if(_0x987a78[_0x1c7e('0xb')]){delete _0x987a78[_0x1c7e('0xb')];}_0x45ab10[_0x1c7e('0x8')](_0x2dd994)[_0x1c7e('0xc')](_0x987a78);};}function execChildProcess(){return new BPromise(function(_0x32a1c1,_0x5343e3){exec('npm\x20install',function(_0x456399,_0xa50405,_0x361134){logger[_0x1c7e('0xd')](_0xa50405);logger[_0x1c7e('0xd')](_0x361134);if(_0x456399){logger['error'](_0x456399);return _0x5343e3(_0x456399);}return _0x32a1c1(_0xa50405);});});}exports[_0x1c7e('0xe')]=function(_0xd83b4,_0x36dbf3){return pm2[_0x1c7e('0xf')]()['then'](function(_0x350a5a){if(_0x350a5a){var _0x2e6f9e=_[_0x1c7e('0x10')](_0x350a5a,function(_0x28f499){return _0x28f499[_0x1c7e('0xb')]===_0x1c7e('0x11')||_0x28f499['name']===_0x1c7e('0x12');});return{'rows':_0x2e6f9e,'count':_0x2e6f9e['length']};}return null;})[_0x1c7e('0x13')](respondWithResult(_0x36dbf3,null))[_0x1c7e('0x14')](handleError(_0x36dbf3,null));};exports[_0x1c7e('0x15')]=function(_0x8c4d3a,_0x490e3c){return pm2[_0x1c7e('0x16')](_0x8c4d3a[_0x1c7e('0x17')]['id'])[_0x1c7e('0x13')](respondWithResult(_0x490e3c,null))[_0x1c7e('0x13')](handleEntityNotFound(_0x490e3c,null))[_0x1c7e('0x14')](handleError(_0x490e3c,null));};exports['create']=function(_0x21566e,_0x11248c){if(_0x21566e[_0x1c7e('0x18')][_0x1c7e('0xb')]&&_0x21566e[_0x1c7e('0x18')][_0x1c7e('0x19')]){var _0x2e117b=path[_0x1c7e('0x1a')](__dirname,'../../files/plugins',_0x21566e['body'][_0x1c7e('0x19')]);var _0x4106b4=process[_0x1c7e('0x1b')]();process['chdir'](path['dirname'](_0x2e117b));return execChildProcess()[_0x1c7e('0x13')](function(_0x5eeeba){process[_0x1c7e('0x1c')](_0x4106b4);return pm2['start']({'name':_0x21566e[_0x1c7e('0x18')]['name'],'script':_0x2e117b});})[_0x1c7e('0x13')](function(_0x299662){pm2[_0x1c7e('0x1d')]();return _0x299662[0x0];})[_0x1c7e('0x13')](respondWithResult(_0x11248c,0xc9))[_0x1c7e('0x14')](handleError(_0x11248c,null));}else{return _0x11248c[_0x1c7e('0x8')](0x1f4)['send']({'message':_0x1c7e('0x1e')});}};exports[_0x1c7e('0x1f')]=function(_0x32fcd7,_0x232ba3){if(_0x32fcd7[_0x1c7e('0x18')]['id']){delete _0x32fcd7[_0x1c7e('0x18')]['id'];}var _0x10c388={'online':'restart','stopped':'stop'};if(_0x10c388['hasOwnProperty'](_0x32fcd7[_0x1c7e('0x18')][_0x1c7e('0x8')])){return pm2[_0x10c388[_0x32fcd7['body'][_0x1c7e('0x8')]]](_0x32fcd7['params']['id'])[_0x1c7e('0x13')](respondWithResult(_0x232ba3,0xc8))[_0x1c7e('0x14')](handleError(_0x232ba3,null));}else{return _0x232ba3[_0x1c7e('0x8')](0x1f4)['send']({'message':_0x1c7e('0x20')});}};exports[_0x1c7e('0x21')]=function(_0x4b82c1,_0x3d3c06){if(_0x4b82c1[_0x1c7e('0x18')]['id']){delete _0x4b82c1[_0x1c7e('0x18')]['id'];}if(_0x4b82c1[_0x1c7e('0x17')]['id']){return pm2[_0x1c7e('0x22')](_0x4b82c1[_0x1c7e('0x17')]['id'])['then'](function(_0x2f85db){pm2[_0x1c7e('0x1d')]();return _0x2f85db[0x0];})[_0x1c7e('0x13')](respondWithResult(_0x3d3c06,null))[_0x1c7e('0x14')](handleError(_0x3d3c06,null));}else{return _0x3d3c06[_0x1c7e('0x8')](0x1f4)[_0x1c7e('0xc')]({'message':_0x1c7e('0x23')});}}; \ No newline at end of file +var _0x9a5e=['../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list','reject','express','motion2','length','then','catch','params','create','body','script','join','../../files/plugins','cwd','dirname','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9a5e,0xee));var _0xe9a5=function(_0x3a941c,_0x5ced82){_0x3a941c=_0x3a941c-0x0;var _0x570582=_0x9a5e[_0x3a941c];return _0x570582;};'use strict';var _=require(_0xe9a5('0x0'));var pm2=require(_0xe9a5('0x1'));var logger=require(_0xe9a5('0x2'))(_0xe9a5('0x3'));var path=require(_0xe9a5('0x4'));var exec=require(_0xe9a5('0x5'))[_0xe9a5('0x6')];var BPromise=require(_0xe9a5('0x7'));function handleEntityNotFound(_0x3ba487,_0x58754b){return function(_0x4030b9){if(!_0x4030b9){_0x3ba487[_0xe9a5('0x8')](0x194);;}return _0x4030b9;};}function respondWithResult(_0x462b43,_0x4d1c37){_0x4d1c37=_0x4d1c37||0xc8;return function(_0x56f4f6){if(_0x56f4f6){return _0x462b43[_0xe9a5('0x9')](_0x4d1c37)['json'](_0x56f4f6);}return null;};}function handleError(_0xacd9ec,_0x5db440){_0x5db440=_0x5db440||0x1f4;return function(_0xa0039a){logger[_0xe9a5('0xa')](_0xa0039a[_0xe9a5('0xb')]);if(_0xa0039a[_0xe9a5('0xc')]){delete _0xa0039a['name'];}_0xacd9ec[_0xe9a5('0x9')](_0x5db440)[_0xe9a5('0xd')](_0xa0039a);};}function execChildProcess(){return new BPromise(function(_0x2e64ef,_0x4aa233){exec(_0xe9a5('0xe'),function(_0x47a0bc,_0x3fffcc,_0x1e7d7c){logger['info'](_0x3fffcc);logger[_0xe9a5('0xf')](_0x1e7d7c);if(_0x47a0bc){logger[_0xe9a5('0xa')](_0x47a0bc);return _0x4aa233(_0x47a0bc);}return _0x2e64ef(_0x3fffcc);});});}exports[_0xe9a5('0x10')]=function(_0x147c19,_0x54f676){return pm2[_0xe9a5('0x11')]()['then'](function(_0x242aea){if(_0x242aea){var _0x38dc39=_[_0xe9a5('0x12')](_0x242aea,function(_0x30d6f7){return _0x30d6f7[_0xe9a5('0xc')]===_0xe9a5('0x13')||_0x30d6f7['name']===_0xe9a5('0x14');});return{'rows':_0x38dc39,'count':_0x38dc39[_0xe9a5('0x15')]};}return null;})[_0xe9a5('0x16')](respondWithResult(_0x54f676,null))[_0xe9a5('0x17')](handleError(_0x54f676,null));};exports['show']=function(_0xaf8e1c,_0x584e02){return pm2['describe'](_0xaf8e1c[_0xe9a5('0x18')]['id'])[_0xe9a5('0x16')](respondWithResult(_0x584e02,null))[_0xe9a5('0x16')](handleEntityNotFound(_0x584e02,null))[_0xe9a5('0x17')](handleError(_0x584e02,null));};exports[_0xe9a5('0x19')]=function(_0x163199,_0x322f17){if(_0x163199['body'][_0xe9a5('0xc')]&&_0x163199[_0xe9a5('0x1a')][_0xe9a5('0x1b')]){var _0x158d40=path[_0xe9a5('0x1c')](__dirname,_0xe9a5('0x1d'),_0x163199['body']['script']);var _0x50c44e=process[_0xe9a5('0x1e')]();process['chdir'](path[_0xe9a5('0x1f')](_0x158d40));return execChildProcess()['then'](function(_0x50c18b){process['chdir'](_0x50c44e);return pm2['start']({'name':_0x163199[_0xe9a5('0x1a')]['name'],'script':_0x158d40});})[_0xe9a5('0x16')](function(_0x4d7ce9){pm2['dump']();return _0x4d7ce9[0x0];})['then'](respondWithResult(_0x322f17,0xc9))[_0xe9a5('0x17')](handleError(_0x322f17,null));}else{return _0x322f17['status'](0x1f4)[_0xe9a5('0xd')]({'message':_0xe9a5('0x20')});}};exports[_0xe9a5('0x21')]=function(_0x2a4bf2,_0x2eee61){if(_0x2a4bf2[_0xe9a5('0x1a')]['id']){delete _0x2a4bf2['body']['id'];}var _0x49da1b={'online':_0xe9a5('0x22'),'stopped':_0xe9a5('0x23')};if(_0x49da1b[_0xe9a5('0x24')](_0x2a4bf2[_0xe9a5('0x1a')][_0xe9a5('0x9')])){return pm2[_0x49da1b[_0x2a4bf2['body'][_0xe9a5('0x9')]]](_0x2a4bf2[_0xe9a5('0x18')]['id'])['then'](respondWithResult(_0x2eee61,0xc8))[_0xe9a5('0x17')](handleError(_0x2eee61,null));}else{return _0x2eee61[_0xe9a5('0x9')](0x1f4)['send']({'message':_0xe9a5('0x25')});}};exports['destroy']=function(_0x21d28a,_0x1e22f5){if(_0x21d28a['body']['id']){delete _0x21d28a[_0xe9a5('0x1a')]['id'];}if(_0x21d28a[_0xe9a5('0x18')]['id']){return pm2[_0xe9a5('0x26')](_0x21d28a['params']['id'])[_0xe9a5('0x16')](function(_0x1cdbaa){pm2['dump']();return _0x1cdbaa[0x0];})[_0xe9a5('0x16')](respondWithResult(_0x1e22f5,null))['catch'](handleError(_0x1e22f5,null));}else{return _0x1e22f5[_0xe9a5('0x9')](0x1f4)['send']({'message':_0xe9a5('0x27')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 7bb47f5..8526b69 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 _0xcaaf=['../../components/auth/service','../../config/environment','multer','path','Router'];(function(_0x36fce9,_0x383384){var _0x590b82=function(_0x2a820a){while(--_0x2a820a){_0x36fce9['push'](_0x36fce9['shift']());}};_0x590b82(++_0x383384);}(_0xcaaf,0x66));var _0xfcaa=function(_0x4a70e1,_0x4a4146){_0x4a70e1=_0x4a70e1-0x0;var _0x5162e7=_0xcaaf[_0x4a70e1];return _0x5162e7;};'use strict';var multer=require(_0xfcaa('0x0'));var util=require('util');var path=require(_0xfcaa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcaa('0x2')]();var auth=require(_0xfcaa('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfcaa('0x4'));module['exports']=router; \ No newline at end of file +var _0x8cad=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x474a22,_0x7f6cf2){var _0x3638b6=function(_0x485325){while(--_0x485325){_0x474a22['push'](_0x474a22['shift']());}};_0x3638b6(++_0x7f6cf2);}(_0x8cad,0xfe));var _0xd8ca=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x8cad[_0x368fb9];return _0x4892fb;};'use strict';var multer=require(_0xd8ca('0x0'));var util=require(_0xd8ca('0x1'));var path=require(_0xd8ca('0x2'));var timeout=require(_0xd8ca('0x3'));var express=require(_0xd8ca('0x4'));var router=express[_0xd8ca('0x5')]();var auth=require(_0xd8ca('0x6'));var interaction=require(_0xd8ca('0x7'));var config=require(_0xd8ca('0x8'));module[_0xd8ca('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 ebbe696..b5d097e 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 _0x4246=['DATE','STRING'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x4246,0x139));var _0x6424=function(_0x27a747,_0x20925e){_0x27a747=_0x27a747-0x0;var _0x15aeee=_0x4246[_0x27a747];return _0x15aeee;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x6424('0x0')]},'scheduledat':{'type':Sequelize[_0x6424('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6424('0x1')]},'responsetime':{'type':Sequelize[_0x6424('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6424('0x0')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x6424('0x0')]}}; \ No newline at end of file +var _0xe5ae=['DATE','INTEGER','STRING'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0xe5ae,0xf4));var _0xee5a=function(_0x3ff2f9,_0x544ba1){_0x3ff2f9=_0x3ff2f9-0x0;var _0x3b0913=_0xe5ae[_0x3ff2f9];return _0x3b0913;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xee5a('0x0')](0x2)},'statedesc':{'type':Sequelize[_0xee5a('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xee5a('0x1')]},'starttime':{'type':Sequelize[_0xee5a('0x2')]},'responsetime':{'type':Sequelize[_0xee5a('0x2')]},'ringtime':{'type':Sequelize[_0xee5a('0x0')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xee5a('0x1')]},'campaigntype':{'type':Sequelize[_0xee5a('0x1')]},'membername':{'type':Sequelize[_0xee5a('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 056eabe..9832b6c 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 _0x2bae=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','report_agent_preview','lodash','util','../../config/logger'];(function(_0x2442b9,_0x3d87e9){var _0x31b571=function(_0x1e10ee){while(--_0x1e10ee){_0x2442b9['push'](_0x2442b9['shift']());}};_0x31b571(++_0x3d87e9);}(_0x2bae,0x72));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe2ba('0x0'));var util=require(_0xe2ba('0x1'));var logger=require(_0xe2ba('0x2'))(_0xe2ba('0x3'));var moment=require(_0xe2ba('0x4'));var BPromise=require(_0xe2ba('0x5'));var rp=require(_0xe2ba('0x6'));var fs=require('fs');var path=require(_0xe2ba('0x7'));var rimraf=require(_0xe2ba('0x8'));var config=require(_0xe2ba('0x9'));var attributes=require(_0xe2ba('0xa'));module['exports']=function(_0x35f13d,_0x4601e4){return _0x35f13d[_0xe2ba('0xb')]('ReportAgentPreview',attributes,{'tableName':_0xe2ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20cc=['exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./reportAgentPreview.attributes'];(function(_0x386812,_0x27c823){var _0x4704d2=function(_0x513971){while(--_0x513971){_0x386812['push'](_0x386812['shift']());}};_0x4704d2(++_0x27c823);}(_0x20cc,0x19b));var _0xc20c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x20cc[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xc20c('0x0'));var util=require(_0xc20c('0x1'));var logger=require(_0xc20c('0x2'))('api');var moment=require(_0xc20c('0x3'));var BPromise=require(_0xc20c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc20c('0x5'));var rimraf=require(_0xc20c('0x6'));var config=require(_0xc20c('0x7'));var attributes=require(_0xc20c('0x8'));module[_0xc20c('0x9')]=function(_0x423e72,_0x17434c){return _0x423e72['define'](_0xc20c('0xa'),attributes,{'tableName':_0xc20c('0xb'),'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 dafcb18..9a5040e 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 _0xd2ca=['options','raw','CreateReportAgentPreview','debug','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','jayson/promise','client','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','message','result','catch','ReportAgentPreview','body'];(function(_0x12facf,_0x1b2cc1){var _0x2d80e9=function(_0x203220){while(--_0x203220){_0x12facf['push'](_0x12facf['shift']());}};_0x2d80e9(++_0x1b2cc1);}(_0xd2ca,0x13d));var _0xad2c=function(_0x57af83,_0xa8128e){_0x57af83=_0x57af83-0x0;var _0x171de5=_0xd2ca[_0x57af83];return _0x171de5;};'use strict';var _=require(_0xad2c('0x0'));var util=require(_0xad2c('0x1'));var moment=require(_0xad2c('0x2'));var BPromise=require(_0xad2c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad2c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xad2c('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xad2c('0x6'));var client=jayson[_0xad2c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x187881,_0x50da58,_0x302b72){return new BPromise(function(_0x1675de,_0x5c76a2){return client['request'](_0x187881,_0x302b72)[_0xad2c('0x8')](function(_0x41e5a4){logger[_0xad2c('0x9')](_0xad2c('0xa'),_0x50da58,_0xad2c('0xb'));logger['debug'](_0xad2c('0xc'),_0x50da58,_0xad2c('0xb'),JSON['stringify'](_0x41e5a4));if(_0x41e5a4[_0xad2c('0xd')]){if(_0x41e5a4[_0xad2c('0xd')]['code']===0x1f4){logger[_0xad2c('0xd')](_0xad2c('0xa'),_0x50da58,_0x41e5a4[_0xad2c('0xd')][_0xad2c('0xe')]);return _0x5c76a2(_0x41e5a4[_0xad2c('0xd')]['message']);}logger[_0xad2c('0xd')](_0xad2c('0xa'),_0x50da58,_0x41e5a4[_0xad2c('0xd')]['message']);return _0x1675de(_0x41e5a4[_0xad2c('0xd')]['message']);}else{logger[_0xad2c('0x9')](_0xad2c('0xa'),_0x50da58,_0xad2c('0xb'));_0x1675de(_0x41e5a4[_0xad2c('0xf')][_0xad2c('0xe')]);}})[_0xad2c('0x10')](function(_0x46e57a){logger[_0xad2c('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x50da58,_0x46e57a);_0x5c76a2(_0x46e57a);});});}exports['CreateReportAgentPreview']=function(_0x17aec2){var _0x1f73d7=this;return new Promise(function(_0x4580d3,_0x7509e2){return db[_0xad2c('0x11')]['create'](_0x17aec2[_0xad2c('0x12')],{'raw':_0x17aec2[_0xad2c('0x13')]?_0x17aec2[_0xad2c('0x13')][_0xad2c('0x14')]===undefined?!![]:![]:!![]})[_0xad2c('0x8')](function(_0x44a3b8){logger[_0xad2c('0x9')](_0xad2c('0x15'),_0x17aec2);logger[_0xad2c('0x16')](_0xad2c('0x15'),_0x17aec2,JSON[_0xad2c('0x17')](_0x44a3b8));_0x4580d3(_0x44a3b8);})[_0xad2c('0x10')](function(_0x10c9e6){logger[_0xad2c('0xd')](_0xad2c('0x15'),_0x10c9e6[_0xad2c('0xe')],_0x17aec2);_0x7509e2(_0x1f73d7['error'](0x1f4,_0x10c9e6[_0xad2c('0xe')]));});});}; \ No newline at end of file +var _0xdf2a=['client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xef2407,_0x2e717d){var _0x4980ae=function(_0x125a23){while(--_0x125a23){_0xef2407['push'](_0xef2407['shift']());}};_0x4980ae(++_0x2e717d);}(_0xdf2a,0x1f4));var _0xadf2=function(_0x45629,_0x50c90d){_0x45629=_0x45629-0x0;var _0x3584a6=_0xdf2a[_0x45629];return _0x3584a6;};'use strict';var _=require('lodash');var util=require(_0xadf2('0x0'));var moment=require(_0xadf2('0x1'));var BPromise=require(_0xadf2('0x2'));var rs=require(_0xadf2('0x3'));var fs=require('fs');var Redis=require(_0xadf2('0x4'));var db=require(_0xadf2('0x5'))['db'];var utils=require(_0xadf2('0x6'));var logger=require(_0xadf2('0x7'))(_0xadf2('0x8'));var config=require('../../config/environment');var jayson=require(_0xadf2('0x9'));var client=jayson[_0xadf2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cd279,_0x20579f,_0x4ba07){return new BPromise(function(_0x5f1d96,_0x48311f){return client[_0xadf2('0xb')](_0x4cd279,_0x4ba07)[_0xadf2('0xc')](function(_0x218349){logger[_0xadf2('0xd')](_0xadf2('0xe'),_0x20579f,_0xadf2('0xf'));logger['debug'](_0xadf2('0x10'),_0x20579f,'request\x20sent',JSON[_0xadf2('0x11')](_0x218349));if(_0x218349[_0xadf2('0x12')]){if(_0x218349['error'][_0xadf2('0x13')]===0x1f4){logger[_0xadf2('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x20579f,_0x218349['error']['message']);return _0x48311f(_0x218349[_0xadf2('0x12')]['message']);}logger[_0xadf2('0x12')](_0xadf2('0xe'),_0x20579f,_0x218349[_0xadf2('0x12')][_0xadf2('0x14')]);return _0x5f1d96(_0x218349[_0xadf2('0x12')]['message']);}else{logger[_0xadf2('0xd')](_0xadf2('0xe'),_0x20579f,'request\x20sent');_0x5f1d96(_0x218349[_0xadf2('0x15')]['message']);}})[_0xadf2('0x16')](function(_0x2afa6a){logger[_0xadf2('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x20579f,_0x2afa6a);_0x48311f(_0x2afa6a);});});}exports[_0xadf2('0x17')]=function(_0x4b286f){var _0x388aba=this;return new Promise(function(_0x502e85,_0x3ab075){return db[_0xadf2('0x18')][_0xadf2('0x19')](_0x4b286f[_0xadf2('0x1a')],{'raw':_0x4b286f[_0xadf2('0x1b')]?_0x4b286f['options'][_0xadf2('0x1c')]===undefined?!![]:![]:!![]})[_0xadf2('0xc')](function(_0xf3aba7){logger[_0xadf2('0xd')](_0xadf2('0x17'),_0x4b286f);logger[_0xadf2('0x1d')](_0xadf2('0x17'),_0x4b286f,JSON[_0xadf2('0x11')](_0xf3aba7));_0x502e85(_0xf3aba7);})[_0xadf2('0x16')](function(_0x4e51e7){logger[_0xadf2('0x12')](_0xadf2('0x17'),_0x4e51e7[_0xadf2('0x14')],_0x4b286f);_0x3ab075(_0x388aba[_0xadf2('0x12')](0x1f4,_0x4e51e7[_0xadf2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 4443b07..8021078 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 _0x20e8=['/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','/sms/queues','smsQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','agents','put','agentCapacity','/telephones','telephones'];(function(_0x597484,_0x199340){var _0x218e64=function(_0x390d55){while(--_0x390d55){_0x597484['push'](_0x597484['shift']());}};_0x218e64(++_0x199340);}(_0x20e8,0x6b));var _0x820e=function(_0x10b593,_0x4e497d){_0x10b593=_0x10b593-0x0;var _0x40cf20=_0x20e8[_0x10b593];return _0x40cf20;};'use strict';var multer=require(_0x820e('0x0'));var util=require(_0x820e('0x1'));var path=require(_0x820e('0x2'));var express=require(_0x820e('0x3'));var router=express[_0x820e('0x4')]();var auth=require(_0x820e('0x5'));var controller=require('./rpc.controller');router[_0x820e('0x6')](_0x820e('0x7'),auth[_0x820e('0x8')](),controller[_0x820e('0x9')]);router[_0x820e('0x6')](_0x820e('0xa'),auth[_0x820e('0x8')](),controller['voiceChannelMixMonitor']);router['get'](_0x820e('0xb'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x820e('0x6')](_0x820e('0xc'),auth[_0x820e('0x8')](),controller[_0x820e('0xd')]);router['get'](_0x820e('0xe'),auth[_0x820e('0x8')](),controller[_0x820e('0xf')]);router[_0x820e('0x6')](_0x820e('0x10'),auth[_0x820e('0x8')](),controller[_0x820e('0x11')]);router['get'](_0x820e('0x12'),auth[_0x820e('0x8')](),controller['mailAccounts']);router[_0x820e('0x6')](_0x820e('0x13'),auth[_0x820e('0x8')](),controller['openchannelQueues']);router[_0x820e('0x6')](_0x820e('0x14'),auth[_0x820e('0x8')](),controller[_0x820e('0x15')]);router[_0x820e('0x6')](_0x820e('0x16'),auth['isAuthenticated'](),controller[_0x820e('0x17')]);router[_0x820e('0x6')]('/voice/queues/preview/:id',auth[_0x820e('0x8')](),controller[_0x820e('0x18')]);router[_0x820e('0x6')](_0x820e('0x19'),auth['isAuthenticated'](),controller[_0x820e('0x1a')]);router[_0x820e('0x6')]('/voice/queues/channels/:uniqueid',auth[_0x820e('0x8')](),controller['voiceQueuesChannel']);router[_0x820e('0x6')](_0x820e('0x1b'),auth[_0x820e('0x8')](),controller[_0x820e('0x1c')]);router[_0x820e('0x6')](_0x820e('0x1d'),auth['isAuthenticated'](),controller[_0x820e('0x1e')]);router[_0x820e('0x6')]('/voice/queues/:id',auth[_0x820e('0x8')](),controller[_0x820e('0x1f')]);router[_0x820e('0x6')]('/outbound',auth[_0x820e('0x8')](),controller[_0x820e('0x20')]);router[_0x820e('0x6')](_0x820e('0x21'),auth[_0x820e('0x8')](),controller[_0x820e('0x22')]);router['get'](_0x820e('0x23'),auth['isAuthenticated'](),controller[_0x820e('0x24')]);router[_0x820e('0x25')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0x820e('0x26')]);router[_0x820e('0x6')](_0x820e('0x27'),auth[_0x820e('0x8')](),controller[_0x820e('0x28')]);router[_0x820e('0x6')](_0x820e('0x29'),auth[_0x820e('0x8')](),controller[_0x820e('0x2a')]);router['get'](_0x820e('0x2b'),auth[_0x820e('0x8')](),controller[_0x820e('0x2c')]);router[_0x820e('0x6')](_0x820e('0x2d'),auth[_0x820e('0x8')](),controller[_0x820e('0x2e')]);router[_0x820e('0x6')](_0x820e('0x2f'),auth['isAuthenticated'](),controller[_0x820e('0x30')]);router[_0x820e('0x6')]('/mail/queues/waitinginteractions',auth[_0x820e('0x8')](),controller[_0x820e('0x31')]);router[_0x820e('0x6')](_0x820e('0x32'),auth[_0x820e('0x8')](),controller[_0x820e('0x33')]);router[_0x820e('0x6')]('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x820e('0x34')]);router[_0x820e('0x6')](_0x820e('0x35'),auth[_0x820e('0x8')](),controller['faxQueuesWaitingInteractions']);router[_0x820e('0x36')](_0x820e('0x37'),auth['isAuthenticated'](),controller[_0x820e('0x38')](_0x820e('0x39')));router['get'](_0x820e('0x3a'),auth[_0x820e('0x8')](),controller[_0x820e('0x3b')]);router['post'](_0x820e('0x3c'),auth[_0x820e('0x8')](),controller[_0x820e('0x38')](_0x820e('0x3d')));router[_0x820e('0x6')](_0x820e('0x3e'),auth[_0x820e('0x8')](),controller[_0x820e('0x3f')]);router[_0x820e('0x36')]('/fax/queues/:id/notify',auth[_0x820e('0x8')](),controller[_0x820e('0x38')](_0x820e('0x40')));router[_0x820e('0x6')]('/fax/queues/:id',auth[_0x820e('0x8')](),controller[_0x820e('0x41')]);router[_0x820e('0x36')](_0x820e('0x42'),auth['isAuthenticated'](),controller[_0x820e('0x38')]('openchannel'));router[_0x820e('0x6')](_0x820e('0x43'),auth[_0x820e('0x8')](),controller[_0x820e('0x44')]);router[_0x820e('0x36')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x820e('0x38')](_0x820e('0x45')));router[_0x820e('0x6')](_0x820e('0x46'),auth['isAuthenticated'](),controller[_0x820e('0x47')]);router[_0x820e('0x36')](_0x820e('0x48'),auth[_0x820e('0x8')](),controller[_0x820e('0x49')]);module['exports']=router; \ No newline at end of file +var _0x110f=['showMailQueues','post','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','agentNotify','exports','multer','util','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','/agents','agents','put','/trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x110f,0x1e6));var _0xf110=function(_0x115cdf,_0x3247ae){_0x115cdf=_0x115cdf-0x0;var _0x316e36=_0x110f[_0x115cdf];return _0x316e36;};'use strict';var multer=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require(_0xf110('0x2'));var controller=require('./rpc.controller');router[_0xf110('0x3')](_0xf110('0x4'),auth[_0xf110('0x5')](),controller['voiceChannels']);router[_0xf110('0x3')](_0xf110('0x6'),auth[_0xf110('0x5')](),controller['voiceChannelMixMonitor']);router[_0xf110('0x3')](_0xf110('0x7'),auth[_0xf110('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0xf110('0x3')](_0xf110('0x8'),auth[_0xf110('0x5')](),controller['voiceQueues']);router[_0xf110('0x3')](_0xf110('0x9'),auth[_0xf110('0x5')](),controller[_0xf110('0xa')]);router['get'](_0xf110('0xb'),auth[_0xf110('0x5')](),controller['mailQueues']);router[_0xf110('0x3')](_0xf110('0xc'),auth[_0xf110('0x5')](),controller[_0xf110('0xd')]);router['get'](_0xf110('0xe'),auth[_0xf110('0x5')](),controller[_0xf110('0xf')]);router['get'](_0xf110('0x10'),auth[_0xf110('0x5')](),controller['smsQueues']);router[_0xf110('0x3')](_0xf110('0x11'),auth[_0xf110('0x5')](),controller[_0xf110('0x12')]);router[_0xf110('0x3')](_0xf110('0x13'),auth[_0xf110('0x5')](),controller[_0xf110('0x14')]);router[_0xf110('0x3')]('/voice/queues/channels',auth[_0xf110('0x5')](),controller[_0xf110('0x15')]);router[_0xf110('0x3')]('/voice/queues/channels/:uniqueid',auth[_0xf110('0x5')](),controller['voiceQueuesChannel']);router[_0xf110('0x3')](_0xf110('0x16'),auth[_0xf110('0x5')](),controller[_0xf110('0x17')]);router[_0xf110('0x3')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xf110('0x5')](),controller[_0xf110('0x18')]);router['get'](_0xf110('0x19'),auth[_0xf110('0x5')](),controller[_0xf110('0x1a')]);router[_0xf110('0x3')](_0xf110('0x1b'),auth['isAuthenticated'](),controller[_0xf110('0x1c')]);router[_0xf110('0x3')]('/outbound/channels',auth[_0xf110('0x5')](),controller[_0xf110('0x1d')]);router[_0xf110('0x3')](_0xf110('0x1e'),auth[_0xf110('0x5')](),controller[_0xf110('0x1f')]);router[_0xf110('0x20')]('/agents/:id/capacity',auth[_0xf110('0x5')](),controller['agentCapacity']);router[_0xf110('0x3')]('/telephones',auth['isAuthenticated'](),controller['telephones']);router['get'](_0xf110('0x21'),auth[_0xf110('0x5')](),controller['trunks']);router[_0xf110('0x3')](_0xf110('0x22'),auth[_0xf110('0x5')](),controller['campaigns']);router[_0xf110('0x3')](_0xf110('0x23'),auth['isAuthenticated'](),controller[_0xf110('0x24')]);router[_0xf110('0x3')](_0xf110('0x25'),auth[_0xf110('0x5')](),controller[_0xf110('0x26')]);router[_0xf110('0x3')](_0xf110('0x27'),auth[_0xf110('0x5')](),controller['mailQueuesWaitingInteractions']);router['get'](_0xf110('0x28'),auth['isAuthenticated'](),controller[_0xf110('0x29')]);router[_0xf110('0x3')](_0xf110('0x2a'),auth[_0xf110('0x5')](),controller[_0xf110('0x2b')]);router[_0xf110('0x3')](_0xf110('0x2c'),auth[_0xf110('0x5')](),controller[_0xf110('0x2d')]);router['post'](_0xf110('0x2e'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x30')));router[_0xf110('0x3')](_0xf110('0x31'),auth[_0xf110('0x5')](),controller[_0xf110('0x32')]);router[_0xf110('0x33')](_0xf110('0x34'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x35')));router[_0xf110('0x3')]('/chat/queues/:id',auth[_0xf110('0x5')](),controller[_0xf110('0x36')]);router[_0xf110('0x33')](_0xf110('0x37'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x38')));router[_0xf110('0x3')](_0xf110('0x39'),auth[_0xf110('0x5')](),controller['showFaxQueues']);router[_0xf110('0x33')](_0xf110('0x3a'),auth[_0xf110('0x5')](),controller[_0xf110('0x2f')](_0xf110('0x3b')));router[_0xf110('0x3')](_0xf110('0x3c'),auth[_0xf110('0x5')](),controller[_0xf110('0x3d')]);router[_0xf110('0x33')](_0xf110('0x3e'),auth[_0xf110('0x5')](),controller['queueNotify']('sms'));router[_0xf110('0x3')](_0xf110('0x3f'),auth[_0xf110('0x5')](),controller[_0xf110('0x40')]);router[_0xf110('0x33')]('/agents/:id/notify',auth[_0xf110('0x5')](),controller[_0xf110('0x41')]);module[_0xf110('0x42')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index a7878fc..4dd5690 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 _0x3268=['YYYY-MM-DD\x20HH:mm:ss','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','FaxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','queueNotify','chat','Website','Account','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','create','Start','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','capitalize','User','Agent\x20not\x20found','TransferReport','agent','agentTransferTimeout','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','then','error','code','message','catch','status','json','sendStatus','name','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','length','format','updateAttributes','MemberReport','findOrCreate','SIP/%s','interface'];(function(_0x32ff82,_0x337349){var _0x4366c0=function(_0x3286f6){while(--_0x3286f6){_0x32ff82['push'](_0x32ff82['shift']());}};_0x4366c0(++_0x337349);}(_0x3268,0xaa));var _0x8326=function(_0x58a5e1,_0x1ede54){_0x58a5e1=_0x58a5e1-0x0;var _0xd39d1a=_0x3268[_0x58a5e1];return _0xd39d1a;};'use strict';var BPromise=require('bluebird');var moment=require(_0x8326('0x0'));var _=require('lodash');var util=require(_0x8326('0x1'));var db=require(_0x8326('0x2'))['db'];var logger=require(_0x8326('0x3'))(_0x8326('0x4'));var jayson=require(_0x8326('0x5'));var amiClient=jayson[_0x8326('0x6')][_0x8326('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0x8326('0x7')]({'port':0x232b});var routingClient=jayson[_0x8326('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x134fa5,_0xbb30c1,_0x36006c){return new BPromise(function(_0x56315b,_0x584b79){var _0x50ebce=_0x36006c?_0x36006c:amiClient;return _0x50ebce['request'](_0x134fa5,_0xbb30c1)[_0x8326('0x8')](function(_0x2a3a9b){if(_0x2a3a9b[_0x8326('0x9')]){if(_0x2a3a9b[_0x8326('0x9')][_0x8326('0xa')]===0x1f4){return _0x584b79(_0x2a3a9b['error'][_0x8326('0xb')]);}return _0x56315b(_0x2a3a9b['error'][_0x8326('0xb')]);}else{_0x56315b(_0x2a3a9b['result']);}})[_0x8326('0xc')](function(_0x2eec2a){_0x584b79(_0x2eec2a);});});}function respondWithResult(_0x2fed96,_0x1a44c4){_0x1a44c4=_0x1a44c4||0xc8;return function(_0x3009d8){if(_0x3009d8){return _0x2fed96[_0x8326('0xd')](_0x1a44c4)[_0x8326('0xe')](_0x3009d8);}return _0x2fed96[_0x8326('0xf')](0x194);};}function handleError(_0x4e33de,_0x41bcfb){_0x41bcfb=_0x41bcfb||0x1f4;return function(_0x4025f8){logger['error'](_0x4025f8['stack']);if(_0x4025f8[_0x8326('0x10')]){delete _0x4025f8[_0x8326('0x10')];}_0x4e33de[_0x8326('0xd')](_0x41bcfb)['send'](_0x4025f8);};}function findById(_0x580968){return function(_0x29f1dd){if(!_[_0x8326('0x11')](_0x580968)&&!_[_0x8326('0x11')](_0x29f1dd)&&!_[_0x8326('0x11')](_0x29f1dd['rows'])){return _[_0x8326('0x12')](_0x29f1dd[_0x8326('0x13')],function(_0x294803){return _0x294803['id']==_0x580968;});}return null;};}exports[_0x8326('0x14')]=function(_0x1a109f,_0x5ccef1){return respondWithRpcPromise(_0x8326('0x15'),_0x1a109f[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0x5ccef1,null))[_0x8326('0xc')](handleError(_0x5ccef1,null));};exports[_0x8326('0x17')]=function(_0x48276d,_0x330715){return respondWithRpcPromise(_0x8326('0x18'),_[_0x8326('0x19')](_0x48276d[_0x8326('0x16')],_0x48276d['params']))[_0x8326('0x8')](respondWithResult(_0x330715,null))[_0x8326('0xc')](handleError(_0x330715,null));};exports[_0x8326('0x1a')]=function(_0x224372,_0x402975){return respondWithRpcPromise(_0x8326('0x1b'),_[_0x8326('0x19')](_0x224372[_0x8326('0x16')],_0x224372[_0x8326('0x1c')]))[_0x8326('0x8')](respondWithResult(_0x402975,null))[_0x8326('0xc')](handleError(_0x402975,null));};exports['voiceQueues']=function(_0x2b80e4,_0xbdbf03){return respondWithRpcPromise(_0x8326('0x1d'),_0x2b80e4[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0xbdbf03,null))[_0x8326('0xc')](handleError(_0xbdbf03,null));};exports[_0x8326('0x1e')]=function(_0x1d6af7,_0x36f54e){return respondWithRpcPromise(_0x8326('0x1d'),_0x1d6af7[_0x8326('0x16')])[_0x8326('0x8')](findById(_0x1d6af7[_0x8326('0x1c')]['id']))[_0x8326('0x8')](respondWithResult(_0x36f54e,null))[_0x8326('0xc')](handleError(_0x36f54e,null));};exports[_0x8326('0x1f')]=function(_0x539d70,_0x44b610){return respondWithRpcPromise(_0x8326('0x20'),_['merge'](_0x539d70['query'],_0x539d70[_0x8326('0x1c')]))[_0x8326('0x8')](respondWithResult(_0x44b610,null))['catch'](handleError(_0x44b610,null));};exports['voiceQueuesChannels']=function(_0x85c1a3,_0x31c682){return respondWithRpcPromise(_0x8326('0x21'),_0x85c1a3[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0x31c682,null))[_0x8326('0xc')](handleError(_0x31c682,null));};exports[_0x8326('0x22')]=function(_0x2c110c,_0x3a1061){return respondWithRpcPromise(_0x8326('0x23'),_[_0x8326('0x19')](_0x2c110c[_0x8326('0x16')],_0x2c110c[_0x8326('0x1c')]))[_0x8326('0x8')](respondWithResult(_0x3a1061,null))['catch'](handleError(_0x3a1061,null));};exports[_0x8326('0x24')]=function(_0x390ed7,_0x24fcdf){return respondWithRpcPromise(_0x8326('0x25'),_[_0x8326('0x19')](_0x390ed7['query'],_0x390ed7['params']))[_0x8326('0x8')](respondWithResult(_0x24fcdf,null))[_0x8326('0xc')](handleError(_0x24fcdf,null));};exports[_0x8326('0x26')]=function(_0x375cec,_0x5ccd36){return respondWithRpcPromise(_0x8326('0x27'),_['merge'](_0x375cec[_0x8326('0x16')],_0x375cec[_0x8326('0x1c')]))[_0x8326('0x8')](respondWithResult(_0x5ccd36,null))[_0x8326('0xc')](handleError(_0x5ccd36,null));};exports[_0x8326('0x28')]=function(_0x493074,_0x139d55){return respondWithRpcPromise(_0x8326('0x29'),_0x493074['query'])[_0x8326('0x8')](respondWithResult(_0x139d55,null))[_0x8326('0xc')](handleError(_0x139d55,null));};exports[_0x8326('0x2a')]=function(_0x4985c2,_0x16aa72){return respondWithRpcPromise(_0x8326('0x2b'),_0x4985c2[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0x16aa72,null))['catch'](handleError(_0x16aa72,null));};exports[_0x8326('0x2c')]=function(_0x196d3a,_0x4a1dce){var _0xf32f5e;return respondWithRpcPromise('Agents',_0x196d3a[_0x8326('0x16')])['then'](function(_0x641f07){_0xf32f5e=_0x641f07;return respondWithRpcPromise(_0x8326('0x2d'),_0x196d3a[_0x8326('0x16')],routingClient);})[_0x8326('0x8')](function(_0x3b7b73){return _[_0x8326('0x19')]({},_0x3b7b73,_0xf32f5e);})[_0x8326('0x8')](respondWithResult(_0x4a1dce,null))['catch'](handleError(_0x4a1dce,null));};exports[_0x8326('0x2e')]=function(_0x3128bc,_0x3be858){if(_0x3128bc['body']&&_0x3128bc[_0x8326('0x2f')][_0x8326('0x30')]&&_0x3128bc[_0x8326('0x31')]&&_0x3128bc[_0x8326('0x31')][_0x8326('0x10')]){for(var _0x230107 in _0x3128bc[_0x8326('0x2f')]['interaction']){if(_0x3128bc[_0x8326('0x2f')][_0x8326('0x30')][_0x8326('0x32')](_0x230107)){db['MemberReport'][_0x8326('0x33')]({'where':{'channel':_0x230107,'membername':_0x3128bc[_0x8326('0x31')][_0x8326('0x10')],'type':_0x8326('0x34'),'exitAt':null,'uniqueid':_0x3128bc['body']['interaction'][_0x230107]&&_0x3128bc[_0x8326('0x2f')]['interaction'][_0x230107][_0x8326('0x35')]?{'$notIn':_0x3128bc[_0x8326('0x2f')]['interaction'][_0x230107]}:{'$ne':null}}})[_0x8326('0x8')](function(_0x327a1e){var _0x281936=moment()[_0x8326('0x36')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2fc6a6=0x0,_0x1f07d7=_0x327a1e['length'];_0x2fc6a6<_0x1f07d7;_0x2fc6a6+=0x1){_0x327a1e[_0x2fc6a6][_0x8326('0x37')]({'exitAt':_0x281936});}});for(var _0x1cc693=0x0;_0x1cc693<_0x3128bc['body']['interaction'][_0x230107][_0x8326('0x35')];_0x1cc693+=0x1){db[_0x8326('0x38')][_0x8326('0x39')]({'where':{'channel':_0x230107,'membername':_0x3128bc[_0x8326('0x31')][_0x8326('0x10')],'type':'INTERACTION','uniqueid':_0x3128bc[_0x8326('0x2f')][_0x8326('0x30')][_0x230107][_0x1cc693],'exitAt':null},'defaults':{'channel':_0x230107,'membername':_0x3128bc['user']['name'],'interface':_['isNil'](_0x3128bc[_0x8326('0x31')]['interface'])?util[_0x8326('0x36')](_0x8326('0x3a'),_0x3128bc[_0x8326('0x31')][_0x8326('0x10')]):_0x3128bc['user'][_0x8326('0x3b')],'type':_0x8326('0x34'),'enterAt':moment()[_0x8326('0x36')](_0x8326('0x3c')),'role':'agent','internal':_0x3128bc[_0x8326('0x31')][_0x8326('0x3d')],'uniqueid':_0x3128bc[_0x8326('0x2f')][_0x8326('0x30')][_0x230107][_0x1cc693]}});}}}}return respondWithRpcPromise(_0x8326('0x3e'),{'id':_0x3128bc['params']['id'],'capacity':_0x3128bc['body'][_0x8326('0x3f')]},routingClient)[_0x8326('0x8')](respondWithResult(_0x3be858,null))['catch'](handleError(_0x3be858,null));};exports[_0x8326('0x40')]=function(_0x27ccb2,_0x2c816e){return respondWithRpcPromise(_0x8326('0x41'),_0x27ccb2[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0x2c816e,null))[_0x8326('0xc')](handleError(_0x2c816e,null));};exports[_0x8326('0x42')]=function(_0x5221e3,_0x46136d){return respondWithRpcPromise(_0x8326('0x43'),_0x5221e3[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0x46136d,null))['catch'](handleError(_0x46136d,null));};exports['campaigns']=function(_0x4edc8e,_0x5cab5f){return respondWithRpcPromise(_0x8326('0x44'),_0x4edc8e[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0x5cab5f,null))['catch'](handleError(_0x5cab5f,null));};exports[_0x8326('0x45')]=function(_0x524140,_0x22fcd5){return respondWithRpcPromise(_0x8326('0x46'),_0x524140[_0x8326('0x16')],routingClient)[_0x8326('0x8')](respondWithResult(_0x22fcd5,null))['catch'](handleError(_0x22fcd5,null));};exports['showChatQueues']=function(_0x169773,_0x52afd2){return respondWithRpcPromise('ChatQueues',_0x169773['query'],routingClient)[_0x8326('0x8')](findById(_0x169773[_0x8326('0x1c')]['id']))[_0x8326('0x8')](respondWithResult(_0x52afd2,null))['catch'](handleError(_0x52afd2,null));};exports[_0x8326('0x47')]=function(_0xff6773,_0x2c75c8){return respondWithRpcPromise('MailQueues',_0xff6773[_0x8326('0x16')],routingClient)['then'](respondWithResult(_0x2c75c8,null))['catch'](handleError(_0x2c75c8,null));};exports[_0x8326('0x48')]=function(_0x1f48cb,_0x51c261){return respondWithRpcPromise(_0x8326('0x49'),_0x1f48cb['query'],routingClient)[_0x8326('0x8')](findById(_0x1f48cb[_0x8326('0x1c')]['id']))[_0x8326('0x8')](respondWithResult(_0x51c261,null))[_0x8326('0xc')](handleError(_0x51c261,null));};exports[_0x8326('0x4a')]=function(_0x161020,_0x1508a0){return respondWithRpcPromise(_0x8326('0x4b'),_0x161020['query'],mailClient)[_0x8326('0x8')](respondWithResult(_0x1508a0,null))[_0x8326('0xc')](handleError(_0x1508a0,null));};exports[_0x8326('0x4c')]=function(_0x1cc882,_0x102975){return respondWithRpcPromise('OpenchannelQueues',_0x1cc882[_0x8326('0x16')],routingClient)['then'](respondWithResult(_0x102975,null))['catch'](handleError(_0x102975,null));};exports['showOpenchannelQueues']=function(_0x347646,_0x53ec94){return respondWithRpcPromise(_0x8326('0x4d'),_0x347646['query'],routingClient)['then'](findById(_0x347646[_0x8326('0x1c')]['id']))[_0x8326('0x8')](respondWithResult(_0x53ec94,null))[_0x8326('0xc')](handleError(_0x53ec94,null));};exports['smsQueues']=function(_0x1b7912,_0x120b5a){return respondWithRpcPromise(_0x8326('0x4e'),_0x1b7912[_0x8326('0x16')],routingClient)[_0x8326('0x8')](respondWithResult(_0x120b5a,null))[_0x8326('0xc')](handleError(_0x120b5a,null));};exports[_0x8326('0x4f')]=function(_0x281e5d,_0xde7a5d){return respondWithRpcPromise(_0x8326('0x4e'),_0x281e5d[_0x8326('0x16')],routingClient)[_0x8326('0x8')](findById(_0x281e5d[_0x8326('0x1c')]['id']))[_0x8326('0x8')](respondWithResult(_0xde7a5d,null))['catch'](handleError(_0xde7a5d,null));};exports['faxQueues']=function(_0x5695d1,_0x4bca30){return respondWithRpcPromise(_0x8326('0x50'),_0x5695d1[_0x8326('0x16')],routingClient)['then'](respondWithResult(_0x4bca30,null))[_0x8326('0xc')](handleError(_0x4bca30,null));};exports[_0x8326('0x51')]=function(_0x37830c,_0x61e0e7){return respondWithRpcPromise(_0x8326('0x50'),_0x37830c[_0x8326('0x16')],routingClient)[_0x8326('0x8')](findById(_0x37830c['params']['id']))['then'](respondWithResult(_0x61e0e7,null))[_0x8326('0xc')](handleError(_0x61e0e7,null));};exports['faxAccounts']=function(_0x52095f,_0x4a45b5){return respondWithRpcPromise(_0x8326('0x52'),_0x52095f[_0x8326('0x16')])[_0x8326('0x8')](respondWithResult(_0x4a45b5,null))[_0x8326('0xc')](handleError(_0x4a45b5,null));};exports['chatQueuesWaitingInteractions']=function(_0x621af7,_0x390edd){return respondWithRpcPromise(_0x8326('0x53'),_0x621af7[_0x8326('0x16')],routingClient)[_0x8326('0x8')](respondWithResult(_0x390edd,null))[_0x8326('0xc')](handleError(_0x390edd,null));};exports[_0x8326('0x54')]=function(_0x2c0aa8,_0x262422){return respondWithRpcPromise(_0x8326('0x55'),_0x2c0aa8[_0x8326('0x16')],routingClient)[_0x8326('0x8')](respondWithResult(_0x262422,null))[_0x8326('0xc')](handleError(_0x262422,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x272579,_0x11b04b){return respondWithRpcPromise(_0x8326('0x56'),_0x272579[_0x8326('0x16')],routingClient)[_0x8326('0x8')](respondWithResult(_0x11b04b,null))[_0x8326('0xc')](handleError(_0x11b04b,null));};exports[_0x8326('0x57')]=function(_0x1412ab,_0x24e864){return respondWithRpcPromise(_0x8326('0x58'),_0x1412ab[_0x8326('0x16')],routingClient)['then'](respondWithResult(_0x24e864,null))[_0x8326('0xc')](handleError(_0x24e864,null));};exports['faxQueuesWaitingInteractions']=function(_0x488376,_0x393d28){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x488376[_0x8326('0x16')],routingClient)[_0x8326('0x8')](respondWithResult(_0x393d28,null))[_0x8326('0xc')](handleError(_0x393d28,null));};exports[_0x8326('0x59')]=function(_0xf4c8d0){return function(_0x5ac384,_0x4de8d9){var _0x979428,_0x3012c4;var _0x4fd677=_['capitalize'](_0xf4c8d0);var _0x2e2fb2=_0xf4c8d0===_0x8326('0x5a')?_0x8326('0x5b'):_0x8326('0x5c');return db[_0x4fd677+'Queue']['findOne']({'raw':!![],'where':{'id':_0x5ac384[_0x8326('0x1c')]['id']}})[_0x8326('0x8')](function(_0x131536){if(_[_0x8326('0x11')](_0x131536)){throw new Error(_0x4fd677+_0x8326('0x5d'));}_0x979428=_0x131536;return db[_0x4fd677+_0x8326('0x5e')][_0x8326('0x5f')]({'where':{'id':_0x5ac384[_0x8326('0x2f')][_0x8326('0x60')]},'include':[{'model':db[_0x4fd677+_0x8326('0x61')],'as':_0x8326('0x61')},{'model':db[_0x4fd677+_0x2e2fb2],'as':_0x8326('0x5c')}]});})[_0x8326('0x8')](function(_0x2235a5){if(_['isNil'](_0x2235a5)){throw new Error(_0x4fd677+_0x8326('0x62'));}_0x3012c4=_0x2235a5;return _0x2235a5[_0x8326('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8326('0x8')](function(){var _0x221d5f={'uniqueid':_0xf4c8d0+'.'+_0x3012c4['id']+'.'+_0x3012c4[_0x8326('0x61')]['id'],'FromUserId':_0x5ac384[_0x8326('0x31')]['id'],'type':_0x8326('0x64')};_0x221d5f[_0x4fd677+_0x8326('0x65')]=_0x3012c4['id'];_0x221d5f[_0x4fd677+_0x8326('0x66')]=_0x3012c4[_0x8326('0x61')]['id'];_0x221d5f[_0x8326('0x67')+_0x4fd677+_0x2e2fb2+'Id']=_0x3012c4[_0x8326('0x5c')]['id'];_0x221d5f['To'+_0x4fd677+'QueueId']=_0x979428['id'];return db[_0x4fd677+'TransferReport'][_0x8326('0x68')](_0x221d5f);})[_0x8326('0x8')](function(){return respondWithRpcPromise(_0x8326('0x69'),{'channel':_0xf4c8d0,'interaction':_0x3012c4['Interaction'],'message':_0x3012c4,'account':_0x3012c4[_0x8326('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x979428['name']+','+(_0x3012c4[_0x8326('0x5c')]['queueTransferTimeout']||0x12c),'interval':_0x8326('0x6a')}]},routingClient);})[_0x8326('0x8')](respondWithResult(_0x4de8d9,null))[_0x8326('0xc')](handleError(_0x4de8d9,null));};};exports['agentNotify']=function(_0x18ea68,_0x27ba48){var _0x17385f,_0x47dffc;if(_[_0x8326('0x11')](_0x18ea68['body'][_0x8326('0x6b')])){throw new Error(_0x8326('0x6c'));}var _0x2dea13=_0x18ea68[_0x8326('0x2f')][_0x8326('0x6b')];var _0x345ccc=_[_0x8326('0x6d')](_0x2dea13);var _0x1e3360=_0x2dea13===_0x8326('0x5a')?_0x8326('0x5b'):_0x8326('0x5c');return db[_0x8326('0x6e')][_0x8326('0x5f')]({'raw':!![],'where':{'id':_0x18ea68[_0x8326('0x1c')]['id'],'role':'agent'}})[_0x8326('0x8')](function(_0x395501){if(_[_0x8326('0x11')](_0x395501)){throw new Error(_0x8326('0x6f'));}_0x17385f=_0x395501;return db[_0x345ccc+'Message'][_0x8326('0x5f')]({'where':{'id':_0x18ea68['body'][_0x8326('0x60')]},'include':[{'model':db[_0x345ccc+'Interaction'],'as':_0x8326('0x61')},{'model':db[_0x345ccc+_0x1e3360],'as':_0x8326('0x5c')}]});})['then'](function(_0x25550f){if(_[_0x8326('0x11')](_0x25550f)){throw new Error(_0x345ccc+_0x8326('0x62'));}_0x47dffc=_0x25550f;return _0x25550f[_0x8326('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8326('0x8')](function(){var _0x570db6={'uniqueid':_0x2dea13+'.'+_0x47dffc['id']+'.'+_0x47dffc['Interaction']['id'],'FromUserId':_0x18ea68[_0x8326('0x31')]['id'],'type':'queue','ToUserId':_0x17385f['id']};_0x570db6[_0x345ccc+_0x8326('0x65')]=_0x47dffc['id'];_0x570db6[_0x345ccc+_0x8326('0x66')]=_0x47dffc[_0x8326('0x61')]['id'];_0x570db6['From'+_0x345ccc+_0x1e3360+'Id']=_0x47dffc[_0x8326('0x5c')]['id'];return db[_0x345ccc+_0x8326('0x70')]['create'](_0x570db6);})[_0x8326('0x8')](function(){return respondWithRpcPromise(_0x8326('0x69'),{'channel':_0x2dea13,'interaction':_0x47dffc[_0x8326('0x61')],'message':_0x47dffc,'account':_0x47dffc[_0x8326('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8326('0x71'),'appdata':_0x17385f[_0x8326('0x10')]+','+(_0x47dffc[_0x8326('0x5c')][_0x8326('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x8326('0x8')](respondWithResult(_0x27ba48,null))[_0x8326('0xc')](handleError(_0x27ba48,null));}; \ No newline at end of file +var _0x0e00=['rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','body','MemberReport','findAll','user','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','INTERACTION','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','Message','findOne','messageId','Account','update','Interaction','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','\x20Message\x20not\x20found','Start','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','client','http','request','then','error','code','message','catch','status','sendStatus','name','send','isNil'];(function(_0x7ad661,_0x1e4efa){var _0x363e14=function(_0x507439){while(--_0x507439){_0x7ad661['push'](_0x7ad661['shift']());}};_0x363e14(++_0x1e4efa);}(_0x0e00,0xd5));var _0x00e0=function(_0x73d1fc,_0x456c85){_0x73d1fc=_0x73d1fc-0x0;var _0x3357c7=_0x0e00[_0x73d1fc];return _0x3357c7;};'use strict';var BPromise=require(_0x00e0('0x0'));var moment=require(_0x00e0('0x1'));var _=require(_0x00e0('0x2'));var util=require(_0x00e0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x00e0('0x4'))(_0x00e0('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x00e0('0x6')][_0x00e0('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0x00e0('0x7')]({'port':0x232b});var routingClient=jayson[_0x00e0('0x6')][_0x00e0('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x37a38e,_0x1c3f9e,_0x255846){return new BPromise(function(_0x511438,_0x354c19){var _0x49ae71=_0x255846?_0x255846:amiClient;return _0x49ae71[_0x00e0('0x8')](_0x37a38e,_0x1c3f9e)[_0x00e0('0x9')](function(_0x3f26a0){if(_0x3f26a0[_0x00e0('0xa')]){if(_0x3f26a0[_0x00e0('0xa')][_0x00e0('0xb')]===0x1f4){return _0x354c19(_0x3f26a0[_0x00e0('0xa')]['message']);}return _0x511438(_0x3f26a0['error'][_0x00e0('0xc')]);}else{_0x511438(_0x3f26a0['result']);}})[_0x00e0('0xd')](function(_0x4be184){_0x354c19(_0x4be184);});});}function respondWithResult(_0x44460f,_0x1948c4){_0x1948c4=_0x1948c4||0xc8;return function(_0x2b36e0){if(_0x2b36e0){return _0x44460f[_0x00e0('0xe')](_0x1948c4)['json'](_0x2b36e0);}return _0x44460f[_0x00e0('0xf')](0x194);};}function handleError(_0x1f2d77,_0x4f699d){_0x4f699d=_0x4f699d||0x1f4;return function(_0x7a4d3){logger['error'](_0x7a4d3['stack']);if(_0x7a4d3[_0x00e0('0x10')]){delete _0x7a4d3[_0x00e0('0x10')];}_0x1f2d77['status'](_0x4f699d)[_0x00e0('0x11')](_0x7a4d3);};}function findById(_0x11a07f){return function(_0x7ac30c){if(!_[_0x00e0('0x12')](_0x11a07f)&&!_[_0x00e0('0x12')](_0x7ac30c)&&!_['isNil'](_0x7ac30c[_0x00e0('0x13')])){return _['find'](_0x7ac30c[_0x00e0('0x13')],function(_0x138f6){return _0x138f6['id']==_0x11a07f;});}return null;};}exports['voiceChannels']=function(_0x3d53f3,_0x2533db){return respondWithRpcPromise(_0x00e0('0x14'),_0x3d53f3[_0x00e0('0x15')])[_0x00e0('0x9')](respondWithResult(_0x2533db,null))[_0x00e0('0xd')](handleError(_0x2533db,null));};exports[_0x00e0('0x16')]=function(_0x5bd400,_0x5477f1){return respondWithRpcPromise(_0x00e0('0x17'),_[_0x00e0('0x18')](_0x5bd400[_0x00e0('0x15')],_0x5bd400[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x5477f1,null))[_0x00e0('0xd')](handleError(_0x5477f1,null));};exports[_0x00e0('0x1a')]=function(_0x1232ce,_0x58bf4e){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_['merge'](_0x1232ce[_0x00e0('0x15')],_0x1232ce[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x58bf4e,null))['catch'](handleError(_0x58bf4e,null));};exports['voiceQueues']=function(_0x3203a9,_0x4c52ec){return respondWithRpcPromise(_0x00e0('0x1b'),_0x3203a9['query'])[_0x00e0('0x9')](respondWithResult(_0x4c52ec,null))[_0x00e0('0xd')](handleError(_0x4c52ec,null));};exports[_0x00e0('0x1c')]=function(_0x577f0b,_0x400ee1){return respondWithRpcPromise('VoiceQueues',_0x577f0b[_0x00e0('0x15')])[_0x00e0('0x9')](findById(_0x577f0b[_0x00e0('0x19')]['id']))[_0x00e0('0x9')](respondWithResult(_0x400ee1,null))[_0x00e0('0xd')](handleError(_0x400ee1,null));};exports[_0x00e0('0x1d')]=function(_0x2d4f3c,_0x222197){return respondWithRpcPromise(_0x00e0('0x1e'),_[_0x00e0('0x18')](_0x2d4f3c[_0x00e0('0x15')],_0x2d4f3c['params']))[_0x00e0('0x9')](respondWithResult(_0x222197,null))[_0x00e0('0xd')](handleError(_0x222197,null));};exports[_0x00e0('0x1f')]=function(_0x6c76ef,_0x2e1edc){return respondWithRpcPromise('VoiceQueuesChannels',_0x6c76ef[_0x00e0('0x15')])[_0x00e0('0x9')](respondWithResult(_0x2e1edc,null))['catch'](handleError(_0x2e1edc,null));};exports['voiceQueuesChannel']=function(_0x48827a,_0x15684b){return respondWithRpcPromise(_0x00e0('0x20'),_[_0x00e0('0x18')](_0x48827a[_0x00e0('0x15')],_0x48827a[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x15684b,null))['catch'](handleError(_0x15684b,null));};exports[_0x00e0('0x21')]=function(_0x5a55ff,_0x421b76){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x00e0('0x18')](_0x5a55ff[_0x00e0('0x15')],_0x5a55ff['params']))[_0x00e0('0x9')](respondWithResult(_0x421b76,null))['catch'](handleError(_0x421b76,null));};exports[_0x00e0('0x22')]=function(_0x544add,_0x4c0c18){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x00e0('0x18')](_0x544add[_0x00e0('0x15')],_0x544add[_0x00e0('0x19')]))[_0x00e0('0x9')](respondWithResult(_0x4c0c18,null))['catch'](handleError(_0x4c0c18,null));};exports[_0x00e0('0x23')]=function(_0x522dfb,_0x266dc7){return respondWithRpcPromise(_0x00e0('0x24'),_0x522dfb['query'])['then'](respondWithResult(_0x266dc7,null))['catch'](handleError(_0x266dc7,null));};exports[_0x00e0('0x25')]=function(_0x10f075,_0x3358cb){return respondWithRpcPromise(_0x00e0('0x26'),_0x10f075[_0x00e0('0x15')])[_0x00e0('0x9')](respondWithResult(_0x3358cb,null))[_0x00e0('0xd')](handleError(_0x3358cb,null));};exports[_0x00e0('0x27')]=function(_0x273201,_0x34b1ec){var _0xb353a1;return respondWithRpcPromise(_0x00e0('0x28'),_0x273201['query'])[_0x00e0('0x9')](function(_0x45619b){_0xb353a1=_0x45619b;return respondWithRpcPromise('Agents',_0x273201['query'],routingClient);})['then'](function(_0x3b4cab){return _['merge']({},_0x3b4cab,_0xb353a1);})['then'](respondWithResult(_0x34b1ec,null))[_0x00e0('0xd')](handleError(_0x34b1ec,null));};exports['agentCapacity']=function(_0x4b1cd9,_0xf1d0c2){if(_0x4b1cd9['body']&&_0x4b1cd9['body'][_0x00e0('0x29')]&&_0x4b1cd9['user']&&_0x4b1cd9['user'][_0x00e0('0x10')]){for(var _0x3b2ef2 in _0x4b1cd9['body'][_0x00e0('0x29')]){if(_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')]['hasOwnProperty'](_0x3b2ef2)){db[_0x00e0('0x2b')][_0x00e0('0x2c')]({'where':{'channel':_0x3b2ef2,'membername':_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2]&&_0x4b1cd9[_0x00e0('0x2a')]['interaction'][_0x3b2ef2][_0x00e0('0x2e')]?{'$notIn':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2]}:{'$ne':null}}})[_0x00e0('0x9')](function(_0xe1b7ed){var _0x16041d=moment()[_0x00e0('0x2f')](_0x00e0('0x30'));for(var _0x21e2e1=0x0,_0x30cf4c=_0xe1b7ed[_0x00e0('0x2e')];_0x21e2e1<_0x30cf4c;_0x21e2e1+=0x1){_0xe1b7ed[_0x21e2e1][_0x00e0('0x31')]({'exitAt':_0x16041d});}});for(var _0x34759f=0x0;_0x34759f<_0x4b1cd9[_0x00e0('0x2a')]['interaction'][_0x3b2ef2][_0x00e0('0x2e')];_0x34759f+=0x1){db['MemberReport'][_0x00e0('0x32')]({'where':{'channel':_0x3b2ef2,'membername':_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')],'type':_0x00e0('0x33'),'uniqueid':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2][_0x34759f],'exitAt':null},'defaults':{'channel':_0x3b2ef2,'membername':_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')],'interface':_['isNil'](_0x4b1cd9[_0x00e0('0x2d')]['interface'])?util[_0x00e0('0x2f')](_0x00e0('0x34'),_0x4b1cd9[_0x00e0('0x2d')][_0x00e0('0x10')]):_0x4b1cd9['user'][_0x00e0('0x35')],'type':_0x00e0('0x33'),'enterAt':moment()['format'](_0x00e0('0x30')),'role':_0x00e0('0x36'),'internal':_0x4b1cd9['user'][_0x00e0('0x37')],'uniqueid':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x29')][_0x3b2ef2][_0x34759f]}});}}}}return respondWithRpcPromise(_0x00e0('0x38'),{'id':_0x4b1cd9[_0x00e0('0x19')]['id'],'capacity':_0x4b1cd9[_0x00e0('0x2a')][_0x00e0('0x39')]},routingClient)['then'](respondWithResult(_0xf1d0c2,null))[_0x00e0('0xd')](handleError(_0xf1d0c2,null));};exports[_0x00e0('0x3a')]=function(_0x5014ff,_0x1f53fb){return respondWithRpcPromise(_0x00e0('0x3b'),_0x5014ff['query'])['then'](respondWithResult(_0x1f53fb,null))[_0x00e0('0xd')](handleError(_0x1f53fb,null));};exports[_0x00e0('0x3c')]=function(_0x487af1,_0x17172b){return respondWithRpcPromise(_0x00e0('0x3d'),_0x487af1[_0x00e0('0x15')])['then'](respondWithResult(_0x17172b,null))[_0x00e0('0xd')](handleError(_0x17172b,null));};exports[_0x00e0('0x3e')]=function(_0x271610,_0x596646){return respondWithRpcPromise(_0x00e0('0x3f'),_0x271610[_0x00e0('0x15')])['then'](respondWithResult(_0x596646,null))['catch'](handleError(_0x596646,null));};exports[_0x00e0('0x40')]=function(_0x147024,_0x45123d){return respondWithRpcPromise(_0x00e0('0x41'),_0x147024[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x45123d,null))['catch'](handleError(_0x45123d,null));};exports[_0x00e0('0x42')]=function(_0x4227de,_0x2b6598){return respondWithRpcPromise('ChatQueues',_0x4227de[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](findById(_0x4227de['params']['id']))['then'](respondWithResult(_0x2b6598,null))[_0x00e0('0xd')](handleError(_0x2b6598,null));};exports[_0x00e0('0x43')]=function(_0x3cc722,_0x212638){return respondWithRpcPromise('MailQueues',_0x3cc722[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x212638,null))[_0x00e0('0xd')](handleError(_0x212638,null));};exports[_0x00e0('0x44')]=function(_0x12f8a8,_0x4f9ada){return respondWithRpcPromise(_0x00e0('0x45'),_0x12f8a8[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](findById(_0x12f8a8[_0x00e0('0x19')]['id']))['then'](respondWithResult(_0x4f9ada,null))[_0x00e0('0xd')](handleError(_0x4f9ada,null));};exports[_0x00e0('0x46')]=function(_0x3fba99,_0x3d7b4c){return respondWithRpcPromise(_0x00e0('0x47'),_0x3fba99['query'],mailClient)[_0x00e0('0x9')](respondWithResult(_0x3d7b4c,null))[_0x00e0('0xd')](handleError(_0x3d7b4c,null));};exports[_0x00e0('0x48')]=function(_0x37fa9b,_0x1b71d6){return respondWithRpcPromise(_0x00e0('0x49'),_0x37fa9b[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x1b71d6,null))[_0x00e0('0xd')](handleError(_0x1b71d6,null));};exports[_0x00e0('0x4a')]=function(_0x56a507,_0x106b6a){return respondWithRpcPromise(_0x00e0('0x49'),_0x56a507[_0x00e0('0x15')],routingClient)['then'](findById(_0x56a507[_0x00e0('0x19')]['id']))['then'](respondWithResult(_0x106b6a,null))['catch'](handleError(_0x106b6a,null));};exports[_0x00e0('0x4b')]=function(_0x5b25dc,_0x55d292){return respondWithRpcPromise(_0x00e0('0x4c'),_0x5b25dc[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x55d292,null))[_0x00e0('0xd')](handleError(_0x55d292,null));};exports[_0x00e0('0x4d')]=function(_0x18e323,_0x2c3907){return respondWithRpcPromise(_0x00e0('0x4c'),_0x18e323['query'],routingClient)[_0x00e0('0x9')](findById(_0x18e323[_0x00e0('0x19')]['id']))[_0x00e0('0x9')](respondWithResult(_0x2c3907,null))[_0x00e0('0xd')](handleError(_0x2c3907,null));};exports['faxQueues']=function(_0x38f01a,_0x4edee2){return respondWithRpcPromise(_0x00e0('0x4e'),_0x38f01a[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x4edee2,null))[_0x00e0('0xd')](handleError(_0x4edee2,null));};exports[_0x00e0('0x4f')]=function(_0x5d0356,_0x2bf555){return respondWithRpcPromise(_0x00e0('0x4e'),_0x5d0356[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](findById(_0x5d0356[_0x00e0('0x19')]['id']))['then'](respondWithResult(_0x2bf555,null))[_0x00e0('0xd')](handleError(_0x2bf555,null));};exports['faxAccounts']=function(_0x3b7d5f,_0x47433b){return respondWithRpcPromise('FaxAccounts',_0x3b7d5f['query'])[_0x00e0('0x9')](respondWithResult(_0x47433b,null))[_0x00e0('0xd')](handleError(_0x47433b,null));};exports[_0x00e0('0x50')]=function(_0xe802c3,_0x5242f5){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0xe802c3[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x5242f5,null))[_0x00e0('0xd')](handleError(_0x5242f5,null));};exports[_0x00e0('0x51')]=function(_0x244fb3,_0x1dd259){return respondWithRpcPromise(_0x00e0('0x52'),_0x244fb3[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x1dd259,null))[_0x00e0('0xd')](handleError(_0x1dd259,null));};exports[_0x00e0('0x53')]=function(_0x8cb933,_0x166c68){return respondWithRpcPromise(_0x00e0('0x54'),_0x8cb933['query'],routingClient)['then'](respondWithResult(_0x166c68,null))[_0x00e0('0xd')](handleError(_0x166c68,null));};exports[_0x00e0('0x55')]=function(_0x33dee8,_0x4251c0){return respondWithRpcPromise(_0x00e0('0x56'),_0x33dee8[_0x00e0('0x15')],routingClient)[_0x00e0('0x9')](respondWithResult(_0x4251c0,null))[_0x00e0('0xd')](handleError(_0x4251c0,null));};exports[_0x00e0('0x57')]=function(_0x4f8ba0,_0x44f91a){return respondWithRpcPromise(_0x00e0('0x58'),_0x4f8ba0[_0x00e0('0x15')],routingClient)['then'](respondWithResult(_0x44f91a,null))[_0x00e0('0xd')](handleError(_0x44f91a,null));};exports[_0x00e0('0x59')]=function(_0x38eee5){return function(_0x32890c,_0x2b712e){var _0x2320ce,_0x35de80;var _0x53ae36=_[_0x00e0('0x5a')](_0x38eee5);var _0x2c38f6=_0x38eee5==='chat'?_0x00e0('0x5b'):'Account';return db[_0x53ae36+_0x00e0('0x5c')]['findOne']({'raw':!![],'where':{'id':_0x32890c[_0x00e0('0x19')]['id']}})['then'](function(_0x125000){if(_['isNil'](_0x125000)){throw new Error(_0x53ae36+'\x20Queue\x20not\x20found');}_0x2320ce=_0x125000;return db[_0x53ae36+_0x00e0('0x5d')][_0x00e0('0x5e')]({'where':{'id':_0x32890c[_0x00e0('0x2a')][_0x00e0('0x5f')]},'include':[{'model':db[_0x53ae36+'Interaction'],'as':'Interaction'},{'model':db[_0x53ae36+_0x2c38f6],'as':_0x00e0('0x60')}]});})[_0x00e0('0x9')](function(_0x1f526d){if(_[_0x00e0('0x12')](_0x1f526d)){throw new Error(_0x53ae36+'\x20Message\x20not\x20found');}_0x35de80=_0x1f526d;return _0x1f526d[_0x00e0('0x61')]({'read':0x0,'readAt':null,'UserId':null});})[_0x00e0('0x9')](function(){var _0x21df35={'uniqueid':_0x38eee5+'.'+_0x35de80['id']+'.'+_0x35de80[_0x00e0('0x62')]['id'],'FromUserId':_0x32890c[_0x00e0('0x2d')]['id'],'type':_0x00e0('0x63')};_0x21df35[_0x53ae36+_0x00e0('0x64')]=_0x35de80['id'];_0x21df35[_0x53ae36+_0x00e0('0x65')]=_0x35de80['Interaction']['id'];_0x21df35[_0x00e0('0x66')+_0x53ae36+_0x2c38f6+'Id']=_0x35de80[_0x00e0('0x60')]['id'];_0x21df35['To'+_0x53ae36+_0x00e0('0x67')]=_0x2320ce['id'];return db[_0x53ae36+_0x00e0('0x68')][_0x00e0('0x69')](_0x21df35);})[_0x00e0('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x38eee5,'interaction':_0x35de80['Interaction'],'message':_0x35de80,'account':_0x35de80['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x00e0('0x63'),'appdata':_0x2320ce['name']+','+(_0x35de80[_0x00e0('0x60')][_0x00e0('0x6a')]||0x12c),'interval':_0x00e0('0x6b')}]},routingClient);})[_0x00e0('0x9')](respondWithResult(_0x2b712e,null))['catch'](handleError(_0x2b712e,null));};};exports[_0x00e0('0x6c')]=function(_0x13af4c,_0xac1eb4){var _0x1640bf,_0x2139ab;if(_['isNil'](_0x13af4c[_0x00e0('0x2a')][_0x00e0('0x6d')])){throw new Error(_0x00e0('0x6e'));}var _0x178380=_0x13af4c[_0x00e0('0x2a')][_0x00e0('0x6d')];var _0x59cb7a=_['capitalize'](_0x178380);var _0x37117a=_0x178380===_0x00e0('0x6f')?'Website':_0x00e0('0x60');return db[_0x00e0('0x70')]['findOne']({'raw':!![],'where':{'id':_0x13af4c[_0x00e0('0x19')]['id'],'role':_0x00e0('0x36')}})[_0x00e0('0x9')](function(_0x2dc642){if(_['isNil'](_0x2dc642)){throw new Error('Agent\x20not\x20found');}_0x1640bf=_0x2dc642;return db[_0x59cb7a+_0x00e0('0x5d')]['findOne']({'where':{'id':_0x13af4c[_0x00e0('0x2a')][_0x00e0('0x5f')]},'include':[{'model':db[_0x59cb7a+_0x00e0('0x62')],'as':_0x00e0('0x62')},{'model':db[_0x59cb7a+_0x37117a],'as':_0x00e0('0x60')}]});})['then'](function(_0x410c4a){if(_[_0x00e0('0x12')](_0x410c4a)){throw new Error(_0x59cb7a+_0x00e0('0x71'));}_0x2139ab=_0x410c4a;return _0x410c4a[_0x00e0('0x61')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5bc983={'uniqueid':_0x178380+'.'+_0x2139ab['id']+'.'+_0x2139ab[_0x00e0('0x62')]['id'],'FromUserId':_0x13af4c[_0x00e0('0x2d')]['id'],'type':_0x00e0('0x63'),'ToUserId':_0x1640bf['id']};_0x5bc983[_0x59cb7a+_0x00e0('0x64')]=_0x2139ab['id'];_0x5bc983[_0x59cb7a+'InteractionId']=_0x2139ab[_0x00e0('0x62')]['id'];_0x5bc983[_0x00e0('0x66')+_0x59cb7a+_0x37117a+'Id']=_0x2139ab[_0x00e0('0x60')]['id'];return db[_0x59cb7a+_0x00e0('0x68')][_0x00e0('0x69')](_0x5bc983);})['then'](function(){return respondWithRpcPromise(_0x00e0('0x72'),{'channel':_0x178380,'interaction':_0x2139ab[_0x00e0('0x62')],'message':_0x2139ab,'account':_0x2139ab[_0x00e0('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':_0x00e0('0x36'),'appdata':_0x1640bf[_0x00e0('0x10')]+','+(_0x2139ab[_0x00e0('0x60')][_0x00e0('0x73')]||0x12c),'interval':_0x00e0('0x6b')}]},routingClient);})['then'](respondWithResult(_0xac1eb4,null))[_0x00e0('0xd')](handleError(_0xac1eb4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 4853bff..445926f 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 _0x31ad=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','/:id/run','create','update','delete','destroy'];(function(_0x443eba,_0x5db1b3){var _0x1df283=function(_0x2a0c5f){while(--_0x2a0c5f){_0x443eba['push'](_0x443eba['shift']());}};_0x1df283(++_0x5db1b3);}(_0x31ad,0xac));var _0xd31a=function(_0x41baa2,_0x1456a0){_0x41baa2=_0x41baa2-0x0;var _0x3f85fa=_0x31ad[_0x41baa2];return _0x3f85fa;};'use strict';var multer=require(_0xd31a('0x0'));var util=require(_0xd31a('0x1'));var path=require('path');var timeout=require(_0xd31a('0x2'));var express=require(_0xd31a('0x3'));var router=express[_0xd31a('0x4')]();var auth=require(_0xd31a('0x5'));var interaction=require(_0xd31a('0x6'));var config=require(_0xd31a('0x7'));var controller=require(_0xd31a('0x8'));router[_0xd31a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd31a('0x9')](_0xd31a('0xa'),auth[_0xd31a('0xb')](),controller[_0xd31a('0xc')]);router[_0xd31a('0x9')](_0xd31a('0xd'),auth[_0xd31a('0xb')](),controller['run']);router['post']('/',auth['isAuthenticated'](),controller[_0xd31a('0xe')]);router['put'](_0xd31a('0xa'),auth[_0xd31a('0xb')](),controller[_0xd31a('0xf')]);router[_0xd31a('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd31a('0x11')]);module[_0xd31a('0x12')]=router; \ No newline at end of file +var _0x2d5f=['update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put'];(function(_0x57dbc6,_0x40eaf0){var _0x362494=function(_0x4f6226){while(--_0x4f6226){_0x57dbc6['push'](_0x57dbc6['shift']());}};_0x362494(++_0x40eaf0);}(_0x2d5f,0xc9));var _0xf2d5=function(_0x5d5979,_0x3b4921){_0x5d5979=_0x5d5979-0x0;var _0x237182=_0x2d5f[_0x5d5979];return _0x237182;};'use strict';var multer=require(_0xf2d5('0x0'));var util=require(_0xf2d5('0x1'));var path=require(_0xf2d5('0x2'));var timeout=require(_0xf2d5('0x3'));var express=require('express');var router=express[_0xf2d5('0x4')]();var auth=require(_0xf2d5('0x5'));var interaction=require(_0xf2d5('0x6'));var config=require(_0xf2d5('0x7'));var controller=require(_0xf2d5('0x8'));router[_0xf2d5('0x9')]('/',auth[_0xf2d5('0xa')](),controller[_0xf2d5('0xb')]);router['get'](_0xf2d5('0xc'),auth[_0xf2d5('0xa')](),controller[_0xf2d5('0xd')]);router[_0xf2d5('0x9')](_0xf2d5('0xe'),auth['isAuthenticated'](),controller[_0xf2d5('0xf')]);router[_0xf2d5('0x10')]('/',auth[_0xf2d5('0xa')](),controller[_0xf2d5('0x11')]);router[_0xf2d5('0x12')](_0xf2d5('0xc'),auth[_0xf2d5('0xa')](),controller[_0xf2d5('0x13')]);router[_0xf2d5('0x14')](_0xf2d5('0xc'),auth[_0xf2d5('0xa')](),controller[_0xf2d5('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 3161b16..6f9fe6e 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 _0xd23f=['days','csv','custom','default','STRING','TEXT','sequelize','exports','BOOLEAN','DATE','INTEGER','ENUM','weeks','minutes'];(function(_0x5d0474,_0x390778){var _0xe038a2=function(_0x2e3f4c){while(--_0x2e3f4c){_0x5d0474['push'](_0x5d0474['shift']());}};_0xe038a2(++_0x390778);}(_0xd23f,0x1c6));var _0xfd23=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xd23f[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0xfd23('0x0'));module[_0xfd23('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xfd23('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xfd23('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xfd23('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xfd23('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xfd23('0x5')]('years','quarters','months',_0xfd23('0x6'),'days','hours',_0xfd23('0x7')),'allowNull':![],'defaultValue':_0xfd23('0x8')},'output':{'type':Sequelize[_0xfd23('0x5')](_0xfd23('0x9'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xfd23('0x9')},'type':{'type':Sequelize['ENUM'](_0xfd23('0xa'),_0xfd23('0xb')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xfd23('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xfd23('0xc')]},'cc':{'type':Sequelize[_0xfd23('0xd')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0xfd23('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa733=['BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','days','csv','xlsx','custom','default','TEXT','sequelize','exports'];(function(_0x37990d,_0x49b50e){var _0x46853d=function(_0x297f51){while(--_0x297f51){_0x37990d['push'](_0x37990d['shift']());}};_0x46853d(++_0x49b50e);}(_0xa733,0xdf));var _0x3a73=function(_0x33cbd4,_0x1162b2){_0x33cbd4=_0x33cbd4-0x0;var _0x1ce746=_0xa733[_0x33cbd4];return _0x1ce746;};'use strict';var Sequelize=require(_0x3a73('0x0'));module[_0x3a73('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3a73('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x3a73('0x3')],'allowNull':![],'defaultValue':_0x3a73('0x4')},'startAt':{'type':Sequelize[_0x3a73('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x3a73('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x3a73('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x3a73('0x7'),'quarters',_0x3a73('0x8'),'weeks',_0x3a73('0x9'),'hours','minutes'),'allowNull':![],'defaultValue':_0x3a73('0x9')},'output':{'type':Sequelize['ENUM'](_0x3a73('0xa'),'pdf',_0x3a73('0xb')),'allowNull':![],'defaultValue':_0x3a73('0xa')},'type':{'type':Sequelize['ENUM'](_0x3a73('0xc'),_0x3a73('0xd')),'allowNull':![],'defaultValue':_0x3a73('0xc')},'sendMail':{'type':Sequelize[_0x3a73('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x3a73('0x3')]},'cc':{'type':Sequelize[_0x3a73('0xe')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x3a73('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 39e944b..3875f8a 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 _0x471a=['body','run','../../config/schedule','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','sendStatus','stack','name','send','index','Schedule','rawAttributes','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','field','includeAll','include','findAll','show','params','options','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x2451ae,_0x2ff3a4){var _0x5d6db9=function(_0x1b0200){while(--_0x1b0200){_0x2451ae['push'](_0x2451ae['shift']());}};_0x5d6db9(++_0x2ff3a4);}(_0x471a,0xa9));var _0xa471=function(_0xacc326,_0x56bc9f){_0xacc326=_0xacc326-0x0;var _0x37143f=_0x471a[_0xacc326];return _0x37143f;};'use strict';var pdf=require(_0xa471('0x0'));var emlformat=require(_0xa471('0x1'));var rimraf=require(_0xa471('0x2'));var zipdir=require(_0xa471('0x3'));var jsonpatch=require(_0xa471('0x4'));var rp=require(_0xa471('0x5'));var moment=require('moment');var BPromise=require(_0xa471('0x6'));var Mustache=require(_0xa471('0x7'));var util=require(_0xa471('0x8'));var path=require('path');var sox=require(_0xa471('0x9'));var csv=require(_0xa471('0xa'));var ejs=require(_0xa471('0xb'));var fs=require('fs');var _=require(_0xa471('0xc'));var squel=require(_0xa471('0xd'));var crypto=require(_0xa471('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa471('0xf'));var toCsv=require(_0xa471('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa471('0x10'));var authService=require(_0xa471('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa471('0x12'));var logger=require(_0xa471('0x13'))(_0xa471('0x14'));var utils=require('../../config/utils');var config=require(_0xa471('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e2f07,_0x3ebd14){_0x3ebd14=_0x3ebd14||0xcc;return function(_0x42fe48){if(_0x42fe48){return _0x3e2f07['sendStatus'](_0x3ebd14);}return _0x3e2f07[_0xa471('0x16')](_0x3ebd14)['end']();};}function respondWithResult(_0x3d56b2,_0x286554){_0x286554=_0x286554||0xc8;return function(_0x19b10a){if(_0x19b10a){return _0x3d56b2[_0xa471('0x16')](_0x286554)[_0xa471('0x17')](_0x19b10a);}};}function respondWithFilteredResult(_0x2ae437,_0x6e6d0){return function(_0x447054){if(_0x447054){var _0x3641f7=_0x447054[_0xa471('0x18')],_0x518b77=_0x6e6d0['offset'],_0x53cf88=_0x6e6d0[_0xa471('0x19')]+_0x6e6d0[_0xa471('0x1a')],_0x25f918;if(_0x53cf88>=_0x3641f7){_0x53cf88=_0x3641f7;_0x25f918=0xc8;}else{_0x25f918=0xce;}_0x2ae437[_0xa471('0x16')](_0x25f918);return _0x2ae437[_0xa471('0x1b')](_0xa471('0x1c'),_0x518b77+'-'+_0x53cf88+'/'+_0x3641f7)[_0xa471('0x17')](_0x447054);}return null;};}function patchUpdates(_0x39287f){return function(_0x2fe61f){try{jsonpatch[_0xa471('0x1d')](_0x2fe61f,_0x39287f,!![]);}catch(_0x542ebf){return BPromise[_0xa471('0x1e')](_0x542ebf);}return _0x2fe61f[_0xa471('0x1f')]();};}function saveUpdates(_0x3e347a,_0x250974){return function(_0x212794){if(_0x212794){return _0x212794['update'](_0x3e347a)[_0xa471('0x20')](function(_0x298c8a){return _0x298c8a;});}return null;};}function removeEntity(_0x77b017,_0xa4c20f){return function(_0x285f66){if(_0x285f66){return _0x285f66[_0xa471('0x21')]()['then'](function(){var _0x4721c2=_0x285f66[_0xa471('0x22')]({'plain':!![]});var _0x16f7f9=_0xa471('0x23');return db[_0xa471('0x24')]['destroy']({'where':{'type':_0x16f7f9,'resourceId':_0x4721c2['id']}})[_0xa471('0x20')](function(){return _0x285f66;});})[_0xa471('0x20')](function(){_0x77b017[_0xa471('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8dad70,_0x169932){return function(_0x3c2f5e){if(!_0x3c2f5e){_0x8dad70[_0xa471('0x25')](0x194);}return _0x3c2f5e;};}function handleError(_0x36ba70,_0x2db63d){_0x2db63d=_0x2db63d||0x1f4;return function(_0x14295b){logger['error'](_0x14295b[_0xa471('0x26')]);if(_0x14295b['name']){delete _0x14295b[_0xa471('0x27')];}_0x36ba70[_0xa471('0x16')](_0x2db63d)[_0xa471('0x28')](_0x14295b);};}exports[_0xa471('0x29')]=function(_0x1184a3,_0xd3f73f){var _0x6b2209={},_0x3c367f={},_0x3fa4de={'count':0x0,'rows':[]};var _0x224748=db[_0xa471('0x2a')][_0xa471('0x2b')];_0x3c367f['model']=_['keys'](_0x224748);_0x3c367f[_0xa471('0x2c')]=_[_0xa471('0x2d')](_0x1184a3[_0xa471('0x2c')]);_0x3c367f[_0xa471('0x2e')]=_[_0xa471('0x2f')](_0x3c367f[_0xa471('0x30')],_0x3c367f[_0xa471('0x2c')]);_0x6b2209[_0xa471('0x31')]=_[_0xa471('0x2f')](_0x3c367f[_0xa471('0x30')],qs[_0xa471('0x32')](_0x1184a3[_0xa471('0x2c')][_0xa471('0x32')]));_0x6b2209[_0xa471('0x31')]=_0x6b2209[_0xa471('0x31')][_0xa471('0x33')]?_0x6b2209[_0xa471('0x31')]:_0x3c367f['model'];if(!_0x1184a3['query'][_0xa471('0x34')](_0xa471('0x35'))){_0x6b2209['limit']=qs[_0xa471('0x1a')](_0x1184a3['query'][_0xa471('0x1a')]);_0x6b2209[_0xa471('0x19')]=qs[_0xa471('0x19')](_0x1184a3[_0xa471('0x2c')][_0xa471('0x19')]);}_0x6b2209[_0xa471('0x36')]=qs[_0xa471('0x37')](_0x1184a3['query'][_0xa471('0x37')]);_0x6b2209[_0xa471('0x38')]=qs[_0xa471('0x2e')](_[_0xa471('0x39')](_0x1184a3[_0xa471('0x2c')],_0x3c367f['filters']));if(_0x1184a3[_0xa471('0x2c')][_0xa471('0x3a')]){_0x6b2209[_0xa471('0x38')]=_[_0xa471('0x3b')](_0x6b2209[_0xa471('0x38')],{'$or':_[_0xa471('0x3c')](_0x224748,function(_0x5e80cb){if(_0x5e80cb[_0xa471('0x3d')]['key']!==_0xa471('0x3e')){var _0x4ece7e={};_0x4ece7e[_0x5e80cb[_0xa471('0x3f')]]={'$like':'%'+_0x1184a3[_0xa471('0x2c')][_0xa471('0x3a')]+'%'};return _0x4ece7e;}})});}_0x6b2209=_[_0xa471('0x3b')]({},_0x6b2209,_0x1184a3['options']);var _0x3703cc={'where':_0x6b2209[_0xa471('0x38')]};return db[_0xa471('0x2a')][_0xa471('0x18')](_0x3703cc)[_0xa471('0x20')](function(_0x40ed5d){_0x3fa4de['count']=_0x40ed5d;if(_0x1184a3[_0xa471('0x2c')][_0xa471('0x40')]){_0x6b2209[_0xa471('0x41')]=[{'all':!![]}];}return db[_0xa471('0x2a')][_0xa471('0x42')](_0x6b2209);})[_0xa471('0x20')](function(_0x4f9764){_0x3fa4de['rows']=_0x4f9764;return _0x3fa4de;})[_0xa471('0x20')](respondWithFilteredResult(_0xd3f73f,_0x6b2209))['catch'](handleError(_0xd3f73f,null));};exports[_0xa471('0x43')]=function(_0x4d7b4f,_0x532acc){var _0x1711ad={'raw':![],'where':{'id':_0x4d7b4f[_0xa471('0x44')]['id']}},_0x24871c={};_0x24871c[_0xa471('0x30')]=_[_0xa471('0x2d')](db['Schedule']['rawAttributes']);_0x24871c[_0xa471('0x2c')]=_['keys'](_0x4d7b4f['query']);_0x24871c['filters']=_['intersection'](_0x24871c[_0xa471('0x30')],_0x24871c['query']);_0x1711ad['attributes']=_[_0xa471('0x2f')](_0x24871c[_0xa471('0x30')],qs['fields'](_0x4d7b4f[_0xa471('0x2c')][_0xa471('0x32')]));_0x1711ad[_0xa471('0x31')]=_0x1711ad['attributes'][_0xa471('0x33')]?_0x1711ad[_0xa471('0x31')]:_0x24871c[_0xa471('0x30')];if(_0x4d7b4f[_0xa471('0x2c')][_0xa471('0x40')]){_0x1711ad['include']=[{'all':!![]}];}_0x1711ad=_[_0xa471('0x3b')]({},_0x1711ad,_0x4d7b4f[_0xa471('0x45')]);return db[_0xa471('0x2a')]['find'](_0x1711ad)[_0xa471('0x20')](handleEntityNotFound(_0x532acc,null))['then'](respondWithResult(_0x532acc,null))[_0xa471('0x46')](handleError(_0x532acc,null));};exports[_0xa471('0x47')]=function(_0x862597,_0x121de8){return db[_0xa471('0x2a')][_0xa471('0x47')](_0x862597['body'],{})[_0xa471('0x20')](function(_0x5e58a7){var _0x16041c=_0x862597[_0xa471('0x48')][_0xa471('0x22')]({'plain':!![]});if(!_0x16041c)throw new Error(_0xa471('0x49'));if(_0x16041c[_0xa471('0x4a')]===_0xa471('0x48')){var _0x5b6d9f=_0x5e58a7[_0xa471('0x22')]({'plain':!![]});var _0xa34267=_0xa471('0x23');return db[_0xa471('0x4b')][_0xa471('0x4c')]({'where':{'name':_0xa34267,'userProfileId':_0x16041c[_0xa471('0x4d')]},'raw':!![]})[_0xa471('0x20')](function(_0x54bc61){if(_0x54bc61&&_0x54bc61['autoAssociation']===0x0){return db['UserProfileResource'][_0xa471('0x47')]({'name':_0x5b6d9f[_0xa471('0x27')],'resourceId':_0x5b6d9f['id'],'type':_0x54bc61[_0xa471('0x27')],'sectionId':_0x54bc61['id']},{})[_0xa471('0x20')](function(){return _0x5e58a7;});}else{return _0x5e58a7;}})['catch'](function(_0x3f7165){logger[_0xa471('0x4e')](_0xa471('0x4f'),_0x3f7165);throw _0x3f7165;});}return _0x5e58a7;})[_0xa471('0x20')](respondWithResult(_0x121de8,0xc9))['catch'](handleError(_0x121de8,null));};exports['update']=function(_0x23d8f1,_0x17f9a5){if(_0x23d8f1[_0xa471('0x50')]['id']){delete _0x23d8f1[_0xa471('0x50')]['id'];}return db[_0xa471('0x2a')][_0xa471('0x4c')]({'where':{'id':_0x23d8f1[_0xa471('0x44')]['id']}})[_0xa471('0x20')](handleEntityNotFound(_0x17f9a5,null))[_0xa471('0x20')](saveUpdates(_0x23d8f1[_0xa471('0x50')],null))['then'](respondWithResult(_0x17f9a5,null))[_0xa471('0x46')](handleError(_0x17f9a5,null));};exports['destroy']=function(_0x4a12dc,_0x2e77b3){return db['Schedule'][_0xa471('0x4c')]({'where':{'id':_0x4a12dc[_0xa471('0x44')]['id']}})[_0xa471('0x20')](handleEntityNotFound(_0x2e77b3,null))[_0xa471('0x20')](removeEntity(_0x2e77b3,null))[_0xa471('0x46')](handleError(_0x2e77b3,null));};exports[_0xa471('0x51')]=function(_0x37bad7,_0xc841e5,_0x258cc8){var _0x4ffc83=require(_0xa471('0x52'));return db[_0xa471('0x2a')]['find']({'where':{'id':_0x37bad7[_0xa471('0x44')]['id']},'raw':!![]})[_0xa471('0x20')](handleEntityNotFound(_0xc841e5,null))['then'](function(){_0x4ffc83[_0xa471('0x51')](_0x37bad7['params']['id']);})[_0xa471('0x20')](respondWithStatusCode(_0xc841e5,null))['catch'](handleError(_0xc841e5,null));}; \ No newline at end of file +var _0x18c8=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','run','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','map','key','VIRTUAL','merge','options','includeAll','include','Schedule','findAll','catch','show','params','find'];(function(_0x231055,_0x310bae){var _0x1a33fa=function(_0x3550a2){while(--_0x3550a2){_0x231055['push'](_0x231055['shift']());}};_0x1a33fa(++_0x310bae);}(_0x18c8,0x194));var _0x818c=function(_0x656edd,_0x4b9be1){_0x656edd=_0x656edd-0x0;var _0x101389=_0x18c8[_0x656edd];return _0x101389;};'use strict';var pdf=require(_0x818c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x818c('0x1'));var zipdir=require(_0x818c('0x2'));var jsonpatch=require(_0x818c('0x3'));var rp=require(_0x818c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x818c('0x5'));var path=require(_0x818c('0x6'));var sox=require(_0x818c('0x7'));var csv=require(_0x818c('0x8'));var ejs=require(_0x818c('0x9'));var fs=require('fs');var _=require(_0x818c('0xa'));var squel=require(_0x818c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x818c('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x818c('0xd'));var Redis=require(_0x818c('0xe'));var authService=require(_0x818c('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x818c('0x10'));var logger=require(_0x818c('0x11'))(_0x818c('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x818c('0x13'))['db'];function respondWithStatusCode(_0x20ba68,_0x221542){_0x221542=_0x221542||0xcc;return function(_0x2e0c3b){if(_0x2e0c3b){return _0x20ba68[_0x818c('0x14')](_0x221542);}return _0x20ba68[_0x818c('0x15')](_0x221542)['end']();};}function respondWithResult(_0x3da613,_0x1fb9ce){_0x1fb9ce=_0x1fb9ce||0xc8;return function(_0x707a81){if(_0x707a81){return _0x3da613[_0x818c('0x15')](_0x1fb9ce)[_0x818c('0x16')](_0x707a81);}};}function respondWithFilteredResult(_0x1ac660,_0x39d600){return function(_0x151943){if(_0x151943){var _0x45a167=_0x151943[_0x818c('0x17')],_0x5f1842=_0x39d600['offset'],_0xae557c=_0x39d600['offset']+_0x39d600[_0x818c('0x18')],_0x45b530;if(_0xae557c>=_0x45a167){_0xae557c=_0x45a167;_0x45b530=0xc8;}else{_0x45b530=0xce;}_0x1ac660[_0x818c('0x15')](_0x45b530);return _0x1ac660[_0x818c('0x19')](_0x818c('0x1a'),_0x5f1842+'-'+_0xae557c+'/'+_0x45a167)[_0x818c('0x16')](_0x151943);}return null;};}function patchUpdates(_0x516320){return function(_0x230e36){try{jsonpatch[_0x818c('0x1b')](_0x230e36,_0x516320,!![]);}catch(_0x46a875){return BPromise['reject'](_0x46a875);}return _0x230e36['save']();};}function saveUpdates(_0x54a404,_0xf56ae5){return function(_0x55dd17){if(_0x55dd17){return _0x55dd17[_0x818c('0x1c')](_0x54a404)[_0x818c('0x1d')](function(_0x2892ef){return _0x2892ef;});}return null;};}function removeEntity(_0xb067d7,_0x268efd){return function(_0x55c0c6){if(_0x55c0c6){return _0x55c0c6[_0x818c('0x1e')]()[_0x818c('0x1d')](function(){var _0xb425bf=_0x55c0c6[_0x818c('0x1f')]({'plain':!![]});var _0x54ed74=_0x818c('0x20');return db[_0x818c('0x21')][_0x818c('0x1e')]({'where':{'type':_0x54ed74,'resourceId':_0xb425bf['id']}})[_0x818c('0x1d')](function(){return _0x55c0c6;});})[_0x818c('0x1d')](function(){_0xb067d7['status'](0xcc)[_0x818c('0x22')]();});}};}function handleEntityNotFound(_0x4e9a71,_0x294581){return function(_0xc13300){if(!_0xc13300){_0x4e9a71[_0x818c('0x14')](0x194);}return _0xc13300;};}function handleError(_0x215a6d,_0x42951b){_0x42951b=_0x42951b||0x1f4;return function(_0x2a72fa){logger[_0x818c('0x23')](_0x2a72fa[_0x818c('0x24')]);if(_0x2a72fa[_0x818c('0x25')]){delete _0x2a72fa[_0x818c('0x25')];}_0x215a6d[_0x818c('0x15')](_0x42951b)[_0x818c('0x26')](_0x2a72fa);};}exports[_0x818c('0x27')]=function(_0x44eb44,_0x2c6baf){var _0x2ccd07={},_0x981931={},_0x5bb667={'count':0x0,'rows':[]};var _0x508167=db['Schedule'][_0x818c('0x28')];_0x981931['model']=_[_0x818c('0x29')](_0x508167);_0x981931[_0x818c('0x2a')]=_[_0x818c('0x29')](_0x44eb44[_0x818c('0x2a')]);_0x981931[_0x818c('0x2b')]=_[_0x818c('0x2c')](_0x981931[_0x818c('0x2d')],_0x981931[_0x818c('0x2a')]);_0x2ccd07[_0x818c('0x2e')]=_[_0x818c('0x2c')](_0x981931[_0x818c('0x2d')],qs[_0x818c('0x2f')](_0x44eb44['query']['fields']));_0x2ccd07[_0x818c('0x2e')]=_0x2ccd07[_0x818c('0x2e')][_0x818c('0x30')]?_0x2ccd07[_0x818c('0x2e')]:_0x981931[_0x818c('0x2d')];if(!_0x44eb44[_0x818c('0x2a')][_0x818c('0x31')](_0x818c('0x32'))){_0x2ccd07[_0x818c('0x18')]=qs['limit'](_0x44eb44['query']['limit']);_0x2ccd07[_0x818c('0x33')]=qs[_0x818c('0x33')](_0x44eb44[_0x818c('0x2a')][_0x818c('0x33')]);}_0x2ccd07[_0x818c('0x34')]=qs[_0x818c('0x35')](_0x44eb44[_0x818c('0x2a')]['sort']);_0x2ccd07[_0x818c('0x36')]=qs[_0x818c('0x2b')](_[_0x818c('0x37')](_0x44eb44[_0x818c('0x2a')],_0x981931[_0x818c('0x2b')]));if(_0x44eb44[_0x818c('0x2a')][_0x818c('0x38')]){_0x2ccd07['where']=_['merge'](_0x2ccd07[_0x818c('0x36')],{'$or':_[_0x818c('0x39')](_0x508167,function(_0x354707){if(_0x354707['type'][_0x818c('0x3a')]!==_0x818c('0x3b')){var _0x3a4bb0={};_0x3a4bb0[_0x354707['field']]={'$like':'%'+_0x44eb44[_0x818c('0x2a')]['filter']+'%'};return _0x3a4bb0;}})});}_0x2ccd07=_[_0x818c('0x3c')]({},_0x2ccd07,_0x44eb44[_0x818c('0x3d')]);var _0x20f79d={'where':_0x2ccd07[_0x818c('0x36')]};return db['Schedule'][_0x818c('0x17')](_0x20f79d)[_0x818c('0x1d')](function(_0x4e3d9a){_0x5bb667[_0x818c('0x17')]=_0x4e3d9a;if(_0x44eb44[_0x818c('0x2a')][_0x818c('0x3e')]){_0x2ccd07[_0x818c('0x3f')]=[{'all':!![]}];}return db[_0x818c('0x40')][_0x818c('0x41')](_0x2ccd07);})[_0x818c('0x1d')](function(_0x35ac4a){_0x5bb667['rows']=_0x35ac4a;return _0x5bb667;})['then'](respondWithFilteredResult(_0x2c6baf,_0x2ccd07))[_0x818c('0x42')](handleError(_0x2c6baf,null));};exports[_0x818c('0x43')]=function(_0x423c94,_0x5f3692){var _0x3e4745={'raw':![],'where':{'id':_0x423c94[_0x818c('0x44')]['id']}},_0x12968a={};_0x12968a['model']=_['keys'](db[_0x818c('0x40')]['rawAttributes']);_0x12968a[_0x818c('0x2a')]=_[_0x818c('0x29')](_0x423c94[_0x818c('0x2a')]);_0x12968a[_0x818c('0x2b')]=_['intersection'](_0x12968a[_0x818c('0x2d')],_0x12968a[_0x818c('0x2a')]);_0x3e4745[_0x818c('0x2e')]=_[_0x818c('0x2c')](_0x12968a[_0x818c('0x2d')],qs['fields'](_0x423c94[_0x818c('0x2a')][_0x818c('0x2f')]));_0x3e4745['attributes']=_0x3e4745[_0x818c('0x2e')]['length']?_0x3e4745[_0x818c('0x2e')]:_0x12968a['model'];if(_0x423c94[_0x818c('0x2a')][_0x818c('0x3e')]){_0x3e4745[_0x818c('0x3f')]=[{'all':!![]}];}_0x3e4745=_[_0x818c('0x3c')]({},_0x3e4745,_0x423c94[_0x818c('0x3d')]);return db[_0x818c('0x40')][_0x818c('0x45')](_0x3e4745)[_0x818c('0x1d')](handleEntityNotFound(_0x5f3692,null))[_0x818c('0x1d')](respondWithResult(_0x5f3692,null))[_0x818c('0x42')](handleError(_0x5f3692,null));};exports[_0x818c('0x46')]=function(_0x349718,_0x143947){return db[_0x818c('0x40')][_0x818c('0x46')](_0x349718[_0x818c('0x47')],{})[_0x818c('0x1d')](function(_0x10ea76){var _0x3c6fd4=_0x349718[_0x818c('0x48')][_0x818c('0x1f')]({'plain':!![]});if(!_0x3c6fd4)throw new Error(_0x818c('0x49'));if(_0x3c6fd4[_0x818c('0x4a')]===_0x818c('0x48')){var _0x58c8dd=_0x10ea76[_0x818c('0x1f')]({'plain':!![]});var _0x207106=_0x818c('0x20');return db['UserProfileSection'][_0x818c('0x45')]({'where':{'name':_0x207106,'userProfileId':_0x3c6fd4[_0x818c('0x4b')]},'raw':!![]})[_0x818c('0x1d')](function(_0x26b318){if(_0x26b318&&_0x26b318[_0x818c('0x4c')]===0x0){return db[_0x818c('0x21')][_0x818c('0x46')]({'name':_0x58c8dd['name'],'resourceId':_0x58c8dd['id'],'type':_0x26b318[_0x818c('0x25')],'sectionId':_0x26b318['id']},{})[_0x818c('0x1d')](function(){return _0x10ea76;});}else{return _0x10ea76;}})[_0x818c('0x42')](function(_0x60e24e){logger[_0x818c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x60e24e);throw _0x60e24e;});}return _0x10ea76;})[_0x818c('0x1d')](respondWithResult(_0x143947,0xc9))[_0x818c('0x42')](handleError(_0x143947,null));};exports['update']=function(_0x38ed75,_0x1b485a){if(_0x38ed75[_0x818c('0x47')]['id']){delete _0x38ed75['body']['id'];}return db[_0x818c('0x40')]['find']({'where':{'id':_0x38ed75[_0x818c('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b485a,null))['then'](saveUpdates(_0x38ed75[_0x818c('0x47')],null))[_0x818c('0x1d')](respondWithResult(_0x1b485a,null))['catch'](handleError(_0x1b485a,null));};exports[_0x818c('0x1e')]=function(_0x1952e4,_0x3893b5){return db[_0x818c('0x40')][_0x818c('0x45')]({'where':{'id':_0x1952e4[_0x818c('0x44')]['id']}})[_0x818c('0x1d')](handleEntityNotFound(_0x3893b5,null))[_0x818c('0x1d')](removeEntity(_0x3893b5,null))[_0x818c('0x42')](handleError(_0x3893b5,null));};exports[_0x818c('0x4d')]=function(_0x50b92b,_0x376642,_0x4c6ab7){var _0x363441=require(_0x818c('0x4e'));return db[_0x818c('0x40')][_0x818c('0x45')]({'where':{'id':_0x50b92b[_0x818c('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x376642,null))[_0x818c('0x1d')](function(){_0x363441[_0x818c('0x4d')](_0x50b92b[_0x818c('0x44')]['id']);})['then'](respondWithStatusCode(_0x376642,null))[_0x818c('0x42')](handleError(_0x376642,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 584bafd..f6ea46f 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 _0x2a94=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','api','moment'];(function(_0x2e6c8d,_0x17c7ef){var _0x259c0f=function(_0x97387a){while(--_0x97387a){_0x2e6c8d['push'](_0x2e6c8d['shift']());}};_0x259c0f(++_0x17c7ef);}(_0x2a94,0x169));var _0x42a9=function(_0x1e5bdd,_0x1957bb){_0x1e5bdd=_0x1e5bdd-0x0;var _0x542d06=_0x2a94[_0x1e5bdd];return _0x542d06;};'use strict';var _=require(_0x42a9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x42a9('0x1'));var moment=require(_0x42a9('0x2'));var BPromise=require(_0x42a9('0x3'));var rp=require(_0x42a9('0x4'));var fs=require('fs');var path=require(_0x42a9('0x5'));var rimraf=require(_0x42a9('0x6'));var config=require(_0x42a9('0x7'));var attributes=require(_0x42a9('0x8'));module[_0x42a9('0x9')]=function(_0x34a2bf,_0xe84649){return _0x34a2bf[_0x42a9('0xa')](_0x42a9('0xb'),attributes,{'tableName':_0x42a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53e2=['api','moment','request-promise','path','../../config/environment','define','Schedule','lodash','util','../../config/logger'];(function(_0x31bca3,_0x209a1e){var _0x2f10ea=function(_0x248a36){while(--_0x248a36){_0x31bca3['push'](_0x31bca3['shift']());}};_0x2f10ea(++_0x209a1e);}(_0x53e2,0x1c9));var _0x253e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x53e2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x253e('0x0'));var util=require(_0x253e('0x1'));var logger=require(_0x253e('0x2'))(_0x253e('0x3'));var moment=require(_0x253e('0x4'));var BPromise=require('bluebird');var rp=require(_0x253e('0x5'));var fs=require('fs');var path=require(_0x253e('0x6'));var rimraf=require('rimraf');var config=require(_0x253e('0x7'));var attributes=require('./schedule.attributes');module['exports']=function(_0x5515ba,_0x273e85){return _0x5515ba[_0x253e('0x8')](_0x253e('0x9'),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 2f5ed27..584cd5a 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 _0x2ccf=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','error','Schedule,\x20%s,\x20%s','message','result','catch'];(function(_0x341a8b,_0x5967e4){var _0x33d2f8=function(_0x1fc937){while(--_0x1fc937){_0x341a8b['push'](_0x341a8b['shift']());}};_0x33d2f8(++_0x5967e4);}(_0x2ccf,0x78));var _0xf2cc=function(_0x905d8c,_0x226379){_0x905d8c=_0x905d8c-0x0;var _0x4868d3=_0x2ccf[_0x905d8c];return _0x4868d3;};'use strict';var _=require(_0xf2cc('0x0'));var util=require('util');var moment=require(_0xf2cc('0x1'));var BPromise=require(_0xf2cc('0x2'));var rs=require(_0xf2cc('0x3'));var fs=require('fs');var Redis=require(_0xf2cc('0x4'));var db=require(_0xf2cc('0x5'))['db'];var utils=require(_0xf2cc('0x6'));var logger=require(_0xf2cc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf2cc('0x8')][_0xf2cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x285352,_0x32dd4b,_0x2b45e0){return new BPromise(function(_0x357ad6,_0x2cd478){return client[_0xf2cc('0xa')](_0x285352,_0x2b45e0)[_0xf2cc('0xb')](function(_0x25ff90){logger[_0xf2cc('0xc')]('Schedule,\x20%s,\x20%s',_0x32dd4b,_0xf2cc('0xd'));logger['debug'](_0xf2cc('0xe'),_0x32dd4b,_0xf2cc('0xd'),JSON['stringify'](_0x25ff90));if(_0x25ff90['error']){if(_0x25ff90['error']['code']===0x1f4){logger[_0xf2cc('0xf')](_0xf2cc('0x10'),_0x32dd4b,_0x25ff90[_0xf2cc('0xf')][_0xf2cc('0x11')]);return _0x2cd478(_0x25ff90[_0xf2cc('0xf')][_0xf2cc('0x11')]);}logger[_0xf2cc('0xf')](_0xf2cc('0x10'),_0x32dd4b,_0x25ff90['error'][_0xf2cc('0x11')]);return _0x357ad6(_0x25ff90[_0xf2cc('0xf')]['message']);}else{logger[_0xf2cc('0xc')](_0xf2cc('0x10'),_0x32dd4b,_0xf2cc('0xd'));_0x357ad6(_0x25ff90[_0xf2cc('0x12')]['message']);}})[_0xf2cc('0x13')](function(_0x49b747){logger['error']('Schedule,\x20%s,\x20%s',_0x32dd4b,_0x49b747);_0x2cd478(_0x49b747);});});} \ No newline at end of file +var _0x641a=['error','code','Schedule,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x641a,0x1d4));var _0xa641=function(_0x23ea67,_0x4774c3){_0x23ea67=_0x23ea67-0x0;var _0x234ff6=_0x641a[_0x23ea67];return _0x234ff6;};'use strict';var _=require(_0xa641('0x0'));var util=require(_0xa641('0x1'));var moment=require(_0xa641('0x2'));var BPromise=require('bluebird');var rs=require(_0xa641('0x3'));var fs=require('fs');var Redis=require(_0xa641('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa641('0x5'));var config=require('../../config/environment');var jayson=require(_0xa641('0x6'));var client=jayson[_0xa641('0x7')][_0xa641('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x471a6f,_0x57d154,_0x4391a3){return new BPromise(function(_0x2077c8,_0x5cd83c){return client[_0xa641('0x9')](_0x471a6f,_0x4391a3)[_0xa641('0xa')](function(_0x4d6a23){logger[_0xa641('0xb')]('Schedule,\x20%s,\x20%s',_0x57d154,_0xa641('0xc'));logger[_0xa641('0xd')](_0xa641('0xe'),_0x57d154,_0xa641('0xc'),JSON[_0xa641('0xf')](_0x4d6a23));if(_0x4d6a23[_0xa641('0x10')]){if(_0x4d6a23[_0xa641('0x10')][_0xa641('0x11')]===0x1f4){logger[_0xa641('0x10')](_0xa641('0x12'),_0x57d154,_0x4d6a23[_0xa641('0x10')][_0xa641('0x13')]);return _0x5cd83c(_0x4d6a23['error'][_0xa641('0x13')]);}logger[_0xa641('0x10')](_0xa641('0x12'),_0x57d154,_0x4d6a23[_0xa641('0x10')][_0xa641('0x13')]);return _0x2077c8(_0x4d6a23[_0xa641('0x10')][_0xa641('0x13')]);}else{logger['info'](_0xa641('0x12'),_0x57d154,_0xa641('0xc'));_0x2077c8(_0x4d6a23[_0xa641('0x14')][_0xa641('0x13')]);}})[_0xa641('0x15')](function(_0x5b1028){logger[_0xa641('0x10')](_0xa641('0x12'),_0x57d154,_0x5b1028);_0x5cd83c(_0x5b1028);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 61d464e..e3f119c 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 _0xe382=['../../components/auth/service','../../config/environment','./screenRecording.controller','isAuthenticated','/describe','describe','get','show','/:id/download','download','post','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe382,0x1b6));var _0x2e38=function(_0x1168a1,_0xa0d8c9){_0x1168a1=_0x1168a1-0x0;var _0xcc5ad8=_0xe382[_0x1168a1];return _0xcc5ad8;};'use strict';var multer=require('multer');var util=require(_0x2e38('0x0'));var path=require(_0x2e38('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x2e38('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x2e38('0x3'));var controller=require(_0x2e38('0x4'));router['get']('/',auth[_0x2e38('0x5')](),controller['index']);router['get'](_0x2e38('0x6'),auth['isAuthenticated'](),controller[_0x2e38('0x7')]);router[_0x2e38('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2e38('0x9')]);router[_0x2e38('0x8')](_0x2e38('0xa'),auth['isAuthenticated'](),controller[_0x2e38('0xb')]);router[_0x2e38('0xc')]('/',auth[_0x2e38('0x5')](),controller[_0x2e38('0xd')]);router[_0x2e38('0xe')](_0x2e38('0xf'),auth['isAuthenticated'](),controller[_0x2e38('0x10')]);router[_0x2e38('0x11')](_0x2e38('0xf'),auth[_0x2e38('0x5')](),controller[_0x2e38('0x12')]);module[_0x2e38('0x13')]=router; \ No newline at end of file +var _0x6d13=['/:id','show','/:id/download','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x6d13,0xd0));var _0x36d1=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0x6d13[_0x32b4aa];return _0x473160;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x36d1('0x0'));var timeout=require(_0x36d1('0x1'));var express=require(_0x36d1('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x36d1('0x3'));var config=require('../../config/environment');var controller=require(_0x36d1('0x4'));router[_0x36d1('0x5')]('/',auth[_0x36d1('0x6')](),controller['index']);router[_0x36d1('0x5')](_0x36d1('0x7'),auth[_0x36d1('0x6')](),controller['describe']);router[_0x36d1('0x5')](_0x36d1('0x8'),auth[_0x36d1('0x6')](),controller[_0x36d1('0x9')]);router[_0x36d1('0x5')](_0x36d1('0xa'),auth[_0x36d1('0x6')](),controller['download']);router[_0x36d1('0xb')]('/',auth[_0x36d1('0x6')](),controller[_0x36d1('0xc')]);router[_0x36d1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x36d1('0xe')]);router[_0x36d1('0xf')](_0x36d1('0x8'),auth[_0x36d1('0x6')](),controller[_0x36d1('0x10')]);module[_0x36d1('0x11')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index a63a8f1..d783581 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 _0x49aa=['INTEGER','setDataValue','startedAt','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','format','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING'];(function(_0x533ede,_0x2309d6){var _0xc29f7b=function(_0x1d9664){while(--_0x1d9664){_0x533ede['push'](_0x533ede['shift']());}};_0xc29f7b(++_0x2309d6);}(_0x49aa,0x173));var _0xa49a=function(_0x26aaab,_0x1b77b5){_0x26aaab=_0x26aaab-0x0;var _0x25edad=_0x49aa[_0x26aaab];return _0x25edad;};'use strict';var Sequelize=require(_0xa49a('0x0'));var moment=require(_0xa49a('0x1'));var path=require(_0xa49a('0x2'));var config=require('../../config/environment');module[_0xa49a('0x3')]={'format':{'type':Sequelize[_0xa49a('0x4')],'get':function(){return this[_0xa49a('0x5')](_0xa49a('0x6'))?path[_0xa49a('0x7')](this[_0xa49a('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xa49a('0x8')]},'channel':{'type':Sequelize[_0xa49a('0x8')]},'value':{'type':Sequelize[_0xa49a('0x8')],'set':function(_0x40ea52){var _0x16155a=_0x40ea52['replace'](/\\/g,'/');this['setDataValue'](_0xa49a('0x6'),_0x16155a);}},'rating':{'type':Sequelize[_0xa49a('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa49a('0x9')],'set':function(_0x76de4c){this[_0xa49a('0xa')](_0xa49a('0xb'),moment()['subtract'](_0x76de4c,'ms'));this[_0xa49a('0xa')](_0xa49a('0xc'),moment());this[_0xa49a('0xa')](_0xa49a('0xd'),_0x76de4c);}},'startedAt':{'type':Sequelize[_0xa49a('0xe')],'get':function(){return moment(this[_0xa49a('0x5')](_0xa49a('0xb')))['format'](_0xa49a('0xf'))[_0xa49a('0x10')]();}},'closedAt':{'type':Sequelize[_0xa49a('0xe')],'get':function(){return moment(this[_0xa49a('0x5')](_0xa49a('0xc')))[_0xa49a('0x11')](_0xa49a('0xf'))['toString']();}},'createdAt':{'type':Sequelize[_0xa49a('0xe')],'get':function(){return moment(this[_0xa49a('0x5')](_0xa49a('0x12')))[_0xa49a('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xa49a('0x10')]();}},'updatedAt':{'type':Sequelize[_0xa49a('0xe')],'get':function(){return moment(this['getDataValue'](_0xa49a('0x13')))[_0xa49a('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xa49a('0x10')]();}}}; \ No newline at end of file +var _0x5340=['path','exports','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5340,0x1cc));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0534('0x0'));var moment=require(_0x0534('0x1'));var path=require(_0x0534('0x2'));var config=require('../../config/environment');module[_0x0534('0x3')]={'format':{'type':Sequelize[_0x0534('0x4')],'get':function(){return this['getDataValue'](_0x0534('0x5'))?path[_0x0534('0x6')](this[_0x0534('0x7')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0x0534('0x8')]},'channel':{'type':Sequelize[_0x0534('0x8')]},'value':{'type':Sequelize[_0x0534('0x8')],'set':function(_0x515814){var _0x350f37=_0x515814[_0x0534('0x9')](/\\/g,'/');this[_0x0534('0xa')](_0x0534('0x5'),_0x350f37);}},'rating':{'type':Sequelize[_0x0534('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0534('0xb')],'set':function(_0x42ca5a){this[_0x0534('0xa')](_0x0534('0xc'),moment()['subtract'](_0x42ca5a,'ms'));this['setDataValue'](_0x0534('0xd'),moment());this[_0x0534('0xa')](_0x0534('0xe'),_0x42ca5a);}},'startedAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this[_0x0534('0x7')](_0x0534('0xc')))[_0x0534('0x10')](_0x0534('0x11'))[_0x0534('0x12')]();}},'closedAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this[_0x0534('0x7')](_0x0534('0xd')))[_0x0534('0x10')](_0x0534('0x11'))[_0x0534('0x12')]();}},'createdAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this['getDataValue'](_0x0534('0x13')))['format'](_0x0534('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0534('0xf')],'get':function(){return moment(this[_0x0534('0x7')](_0x0534('0x14')))[_0x0534('0x10')]('MM-DD-YYYY\x20HH:mm')[_0x0534('0x12')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 4a64d99..67e2549 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 _0x4a47=['util','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','error','stack','name','send','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','ScreenRecording','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','catch','update','createdAt','value','destroy','params','describe','download','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache'];(function(_0x5f1a41,_0x43da02){var _0x5a869b=function(_0x5019a3){while(--_0x5019a3){_0x5f1a41['push'](_0x5f1a41['shift']());}};_0x5a869b(++_0x43da02);}(_0x4a47,0xb5));var _0x74a4=function(_0x4456c9,_0x29aff0){_0x4456c9=_0x4456c9-0x0;var _0x3a9e5d=_0x4a47[_0x4456c9];return _0x3a9e5d;};'use strict';var pdf=require(_0x74a4('0x0'));var emlformat=require(_0x74a4('0x1'));var rimraf=require(_0x74a4('0x2'));var zipdir=require(_0x74a4('0x3'));var jsonpatch=require(_0x74a4('0x4'));var rp=require('request-promise');var moment=require(_0x74a4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x74a4('0x6'));var util=require(_0x74a4('0x7'));var path=require('path');var sox=require(_0x74a4('0x8'));var csv=require(_0x74a4('0x9'));var ejs=require(_0x74a4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x74a4('0xb'));var crypto=require('crypto');var jsforce=require(_0x74a4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x74a4('0x9'));var querystring=require(_0x74a4('0xd'));var Papa=require(_0x74a4('0xe'));var Redis=require(_0x74a4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74a4('0x10'));var hardwareService=require(_0x74a4('0x11'));var logger=require(_0x74a4('0x12'))(_0x74a4('0x13'));var utils=require('../../config/utils');var config=require(_0x74a4('0x14'));var db=require(_0x74a4('0x15'))['db'];function respondWithStatusCode(_0x3b9864,_0x5b9a8c){_0x5b9a8c=_0x5b9a8c||0xcc;return function(_0x509c1e){if(_0x509c1e){return _0x3b9864[_0x74a4('0x16')](_0x5b9a8c);}return _0x3b9864[_0x74a4('0x17')](_0x5b9a8c)[_0x74a4('0x18')]();};}function respondWithResult(_0x2274d8,_0x37d92f){_0x37d92f=_0x37d92f||0xc8;return function(_0x1208ac){if(_0x1208ac){return _0x2274d8[_0x74a4('0x17')](_0x37d92f)[_0x74a4('0x19')](_0x1208ac);}};}function respondWithFilteredResult(_0x39e2b4,_0xbf6e1e){return function(_0xef93e8){if(_0xef93e8){var _0x28c364=_0xef93e8[_0x74a4('0x1a')],_0xc6796e=_0xbf6e1e['offset'],_0x3c9fc9=_0xbf6e1e[_0x74a4('0x1b')]+_0xbf6e1e[_0x74a4('0x1c')],_0x3d9b8c;if(_0x3c9fc9>=_0x28c364){_0x3c9fc9=_0x28c364;_0x3d9b8c=0xc8;}else{_0x3d9b8c=0xce;}_0x39e2b4[_0x74a4('0x17')](_0x3d9b8c);return _0x39e2b4[_0x74a4('0x1d')]('Content-Range',_0xc6796e+'-'+_0x3c9fc9+'/'+_0x28c364)[_0x74a4('0x19')](_0xef93e8);}return null;};}function patchUpdates(_0x105998){return function(_0x42d72a){try{jsonpatch[_0x74a4('0x1e')](_0x42d72a,_0x105998,!![]);}catch(_0x49bfd7){return BPromise[_0x74a4('0x1f')](_0x49bfd7);}return _0x42d72a[_0x74a4('0x20')]();};}function saveUpdates(_0x59bb30,_0x12fc31){return function(_0x2d3075){if(_0x2d3075){return _0x2d3075['update'](_0x59bb30)['then'](function(_0x1da998){return _0x1da998;});}return null;};}function removeEntity(_0x3d6464,_0xea100d){return function(_0x1828d7){if(_0x1828d7){return _0x1828d7['destroy']()[_0x74a4('0x21')](function(){_0x3d6464['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dbecc,_0x404128){return function(_0x2eabd8){if(!_0x2eabd8){_0x2dbecc['sendStatus'](0x194);}return _0x2eabd8;};}function handleError(_0x22f0fa,_0x387d89){_0x387d89=_0x387d89||0x1f4;return function(_0x47c200){logger[_0x74a4('0x22')](_0x47c200[_0x74a4('0x23')]);if(_0x47c200['name']){delete _0x47c200[_0x74a4('0x24')];}_0x22f0fa[_0x74a4('0x17')](_0x387d89)[_0x74a4('0x25')](_0x47c200);};}exports['index']=function(_0x408140,_0x23a74c){var _0x1510fd={},_0x18f30a={},_0xe933f6={'count':0x0,'rows':[]};var _0x1703be=db['ScreenRecording']['rawAttributes'];_0x18f30a[_0x74a4('0x26')]=_['differenceBy'](_[_0x74a4('0x27')](_0x1703be),['format']);_0x18f30a[_0x74a4('0x28')]=_['keys'](_0x408140['query']);_0x18f30a[_0x74a4('0x29')]=_[_0x74a4('0x2a')](_0x18f30a[_0x74a4('0x26')],_0x18f30a['query']);_0x1510fd['attributes']=_['intersection'](_0x18f30a['model'],qs['fields'](_0x408140['query'][_0x74a4('0x2b')]));_0x1510fd['attributes']=_0x1510fd[_0x74a4('0x2c')][_0x74a4('0x2d')]?_0x1510fd[_0x74a4('0x2c')]:_0x18f30a['model'];if(!_0x408140[_0x74a4('0x28')][_0x74a4('0x2e')](_0x74a4('0x2f'))){_0x1510fd[_0x74a4('0x1c')]=qs[_0x74a4('0x1c')](_0x408140[_0x74a4('0x28')][_0x74a4('0x1c')]);_0x1510fd[_0x74a4('0x1b')]=qs['offset'](_0x408140[_0x74a4('0x28')][_0x74a4('0x1b')]);}_0x1510fd['order']=qs[_0x74a4('0x30')](_0x408140['query']['sort']);_0x1510fd[_0x74a4('0x31')]=qs[_0x74a4('0x29')](_[_0x74a4('0x32')](_0x408140[_0x74a4('0x28')],_0x18f30a[_0x74a4('0x29')]));if(_0x408140[_0x74a4('0x28')][_0x74a4('0x33')]){_0x1510fd[_0x74a4('0x31')]=_[_0x74a4('0x34')](_0x1510fd['where'],{'$or':_[_0x74a4('0x35')](_0x1703be,function(_0x3da4f6){if(_0x3da4f6[_0x74a4('0x36')][_0x74a4('0x37')]!==_0x74a4('0x38')){var _0x4ad9f9={};_0x4ad9f9[_0x3da4f6[_0x74a4('0x39')]]={'$like':'%'+_0x408140[_0x74a4('0x28')]['filter']+'%'};return _0x4ad9f9;}})});}_0x1510fd=_[_0x74a4('0x34')]({},_0x1510fd,_0x408140[_0x74a4('0x3a')]);var _0x461b22={'where':_0x1510fd[_0x74a4('0x31')]};return db[_0x74a4('0x3b')][_0x74a4('0x1a')](_0x461b22)['then'](function(_0x46dcc2){_0xe933f6[_0x74a4('0x1a')]=_0x46dcc2;if(_0x408140['query'][_0x74a4('0x3c')]){_0x1510fd[_0x74a4('0x3d')]=[{'all':!![]}];}return db[_0x74a4('0x3b')][_0x74a4('0x3e')](_0x1510fd);})[_0x74a4('0x21')](function(_0x54b45b){_0xe933f6[_0x74a4('0x3f')]=_0x54b45b;return _0xe933f6;})[_0x74a4('0x21')](respondWithFilteredResult(_0x23a74c,_0x1510fd))['catch'](handleError(_0x23a74c,null));};exports[_0x74a4('0x40')]=function(_0x204955,_0x13a04d){var _0xb4194={'raw':![],'where':{'id':_0x204955['params']['id']}},_0x52fcc5={};_0x52fcc5[_0x74a4('0x26')]=_['keys'](db['ScreenRecording'][_0x74a4('0x41')]);_0x52fcc5[_0x74a4('0x28')]=_[_0x74a4('0x27')](_0x204955['query']);_0x52fcc5[_0x74a4('0x29')]=_[_0x74a4('0x2a')](_0x52fcc5['model'],_0x52fcc5[_0x74a4('0x28')]);_0xb4194[_0x74a4('0x2c')]=_[_0x74a4('0x2a')](_0x52fcc5[_0x74a4('0x26')],qs['fields'](_0x204955[_0x74a4('0x28')][_0x74a4('0x2b')]));_0xb4194['attributes']=_0xb4194[_0x74a4('0x2c')][_0x74a4('0x2d')]?_0xb4194[_0x74a4('0x2c')]:_0x52fcc5[_0x74a4('0x26')];if(_0x204955[_0x74a4('0x28')][_0x74a4('0x3c')]){_0xb4194[_0x74a4('0x3d')]=[{'all':!![]}];}_0xb4194=_[_0x74a4('0x34')]({},_0xb4194,_0x204955[_0x74a4('0x3a')]);return db[_0x74a4('0x3b')][_0x74a4('0x42')](_0xb4194)['then'](handleEntityNotFound(_0x13a04d,null))[_0x74a4('0x21')](respondWithResult(_0x13a04d,null))['catch'](handleError(_0x13a04d,null));};exports[_0x74a4('0x43')]=function(_0x41820f,_0x2a799c){return db['ScreenRecording'][_0x74a4('0x43')](_0x41820f[_0x74a4('0x44')],{})['then'](respondWithResult(_0x2a799c,0xc9))[_0x74a4('0x45')](handleError(_0x2a799c,null));};exports[_0x74a4('0x46')]=function(_0x460feb,_0x444012){if(_0x460feb[_0x74a4('0x44')]['id']){delete _0x460feb['body']['id'];}delete _0x460feb['body']['duration'];delete _0x460feb[_0x74a4('0x44')][_0x74a4('0x47')];delete _0x460feb[_0x74a4('0x44')]['closedAt'];delete _0x460feb[_0x74a4('0x44')][_0x74a4('0x48')];return db[_0x74a4('0x3b')][_0x74a4('0x42')]({'where':{'id':_0x460feb['params']['id']}})[_0x74a4('0x21')](handleEntityNotFound(_0x444012,null))[_0x74a4('0x21')](saveUpdates(_0x460feb['body'],null))['then'](respondWithResult(_0x444012,null))[_0x74a4('0x45')](handleError(_0x444012,null));};exports[_0x74a4('0x49')]=function(_0x522181,_0x42ade1){return db[_0x74a4('0x3b')]['find']({'where':{'id':_0x522181[_0x74a4('0x4a')]['id']}})[_0x74a4('0x21')](handleEntityNotFound(_0x42ade1,null))[_0x74a4('0x21')](removeEntity(_0x42ade1,null))[_0x74a4('0x45')](handleError(_0x42ade1,null));};exports[_0x74a4('0x4b')]=function(_0x4578dd,_0x2fda73){return db[_0x74a4('0x3b')][_0x74a4('0x4b')]()[_0x74a4('0x21')](respondWithResult(_0x2fda73,null))[_0x74a4('0x45')](handleError(_0x2fda73,null));};exports[_0x74a4('0x4c')]=function(_0x9007b7,_0x29891c,_0x5d3ead){var _0xf2bbca=require('../../components/encryptor');var _0x31ad5a=![];var _0x2ecb82={};if(_0x9007b7[_0x74a4('0x28')][_0x74a4('0x36')]&&_0x9007b7[_0x74a4('0x28')][_0x74a4('0x36')]===_0x74a4('0x4d')){_0x2ecb82[_0x74a4('0x4d')]=_0x9007b7['params']['id'];}else{_0x2ecb82['id']=_0x9007b7[_0x74a4('0x4a')]['id'];}return db[_0x74a4('0x3b')]['find']({'where':_0x2ecb82,'attributes':['id',_0x74a4('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x29891c,null))[_0x74a4('0x21')](function(_0x1380d){if(_0x1380d){var _0x11a863=path[_0x74a4('0x4e')](config[_0x74a4('0x4f')],_0x74a4('0x50'),_0x1380d[_0x74a4('0x48')]);var _0x597857=util[_0x74a4('0x51')](_0x74a4('0x52'),_0x11a863);if(fs[_0x74a4('0x53')](_0x597857)){_0x31ad5a=!![];return _0xf2bbca[_0x74a4('0x54')](_0x597857,_0x11a863,config[_0x74a4('0x55')]['recording'])['then'](function(){return _0x1380d;});}return _0x1380d;}})['then'](function(_0x4a9673){if(_0x4a9673){var _0x33de39=path[_0x74a4('0x4e')](config[_0x74a4('0x4f')],_0x74a4('0x50'),_0x4a9673[_0x74a4('0x48')]);if(!fs[_0x74a4('0x53')](_0x33de39)){throw new db[(_0x74a4('0x56'))][(_0x74a4('0x57'))](_0x74a4('0x58'));}if(_0x4a9673[_0x74a4('0x59')]){return _0x29891c[_0x74a4('0x4c')](_0x33de39,_0x4a9673[_0x74a4('0x59')]+path[_0x74a4('0x5a')](_0x33de39),function(){if(_0x31ad5a){fs[_0x74a4('0x5b')](_0x33de39);}});}else{return _0x29891c['download'](_0x33de39,function(_0x17df43){if(_0x31ad5a){fs[_0x74a4('0x5b')](_0x33de39);}});}}})['catch'](function(_0x52f5fb){if(_0x52f5fb[_0x74a4('0x5c')]==='ScreenRecording\x20not\x20found'){_0x29891c[_0x74a4('0x17')](0x194)[_0x74a4('0x25')](_0x74a4('0x5d'));}else{return handleError(_0x29891c,null);}});}; \ No newline at end of file +var _0x35ba=['filters','attributes','intersection','fields','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','duration','createdAt','closedAt','destroy','download','../../components/encryptor','type','uniqueid','value','join','server/files/screen_recordings','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','send','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','stack','name','index','ScreenRecording','rawAttributes','model','differenceBy','format','query','keys'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x35ba,0x8c));var _0xa35b=function(_0x538a20,_0x5c14d6){_0x538a20=_0x538a20-0x0;var _0xec72f5=_0x35ba[_0x538a20];return _0xec72f5;};'use strict';var pdf=require(_0xa35b('0x0'));var emlformat=require(_0xa35b('0x1'));var rimraf=require(_0xa35b('0x2'));var zipdir=require(_0xa35b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa35b('0x4'));var moment=require(_0xa35b('0x5'));var BPromise=require(_0xa35b('0x6'));var Mustache=require(_0xa35b('0x7'));var util=require(_0xa35b('0x8'));var path=require(_0xa35b('0x9'));var sox=require('sox');var csv=require(_0xa35b('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa35b('0xb'));var squel=require(_0xa35b('0xc'));var crypto=require(_0xa35b('0xd'));var jsforce=require(_0xa35b('0xe'));var deskjs=require(_0xa35b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa35b('0x10'));var Papa=require(_0xa35b('0x11'));var Redis=require(_0xa35b('0x12'));var authService=require(_0xa35b('0x13'));var qs=require(_0xa35b('0x14'));var hardwareService=require(_0xa35b('0x15'));var logger=require(_0xa35b('0x16'))(_0xa35b('0x17'));var utils=require(_0xa35b('0x18'));var config=require('../../config/environment');var db=require(_0xa35b('0x19'))['db'];function respondWithStatusCode(_0x5826ab,_0x91d5ea){_0x91d5ea=_0x91d5ea||0xcc;return function(_0x3eb762){if(_0x3eb762){return _0x5826ab[_0xa35b('0x1a')](_0x91d5ea);}return _0x5826ab[_0xa35b('0x1b')](_0x91d5ea)[_0xa35b('0x1c')]();};}function respondWithResult(_0x52dd61,_0x32286e){_0x32286e=_0x32286e||0xc8;return function(_0x511f41){if(_0x511f41){return _0x52dd61[_0xa35b('0x1b')](_0x32286e)['json'](_0x511f41);}};}function respondWithFilteredResult(_0x1020d4,_0x15968f){return function(_0x559610){if(_0x559610){var _0x36a3c1=_0x559610[_0xa35b('0x1d')],_0x42b081=_0x15968f[_0xa35b('0x1e')],_0xd38665=_0x15968f[_0xa35b('0x1e')]+_0x15968f[_0xa35b('0x1f')],_0xb7b44f;if(_0xd38665>=_0x36a3c1){_0xd38665=_0x36a3c1;_0xb7b44f=0xc8;}else{_0xb7b44f=0xce;}_0x1020d4[_0xa35b('0x1b')](_0xb7b44f);return _0x1020d4[_0xa35b('0x20')](_0xa35b('0x21'),_0x42b081+'-'+_0xd38665+'/'+_0x36a3c1)['json'](_0x559610);}return null;};}function patchUpdates(_0x4ab9ab){return function(_0x158d90){try{jsonpatch['apply'](_0x158d90,_0x4ab9ab,!![]);}catch(_0x2283fa){return BPromise[_0xa35b('0x22')](_0x2283fa);}return _0x158d90[_0xa35b('0x23')]();};}function saveUpdates(_0x41cf10,_0x3f224e){return function(_0x36279e){if(_0x36279e){return _0x36279e[_0xa35b('0x24')](_0x41cf10)[_0xa35b('0x25')](function(_0x14951d){return _0x14951d;});}return null;};}function removeEntity(_0x317d62,_0x1cf77a){return function(_0x3a29c9){if(_0x3a29c9){return _0x3a29c9['destroy']()[_0xa35b('0x25')](function(){_0x317d62[_0xa35b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x301f9f,_0x1efafb){return function(_0x21896d){if(!_0x21896d){_0x301f9f['sendStatus'](0x194);}return _0x21896d;};}function handleError(_0x19c655,_0xd980d0){_0xd980d0=_0xd980d0||0x1f4;return function(_0x13aa9b){logger['error'](_0x13aa9b[_0xa35b('0x26')]);if(_0x13aa9b[_0xa35b('0x27')]){delete _0x13aa9b[_0xa35b('0x27')];}_0x19c655[_0xa35b('0x1b')](_0xd980d0)['send'](_0x13aa9b);};}exports[_0xa35b('0x28')]=function(_0x33da60,_0x4a98a5){var _0x463db2={},_0x3eda63={},_0xd5dfaa={'count':0x0,'rows':[]};var _0x4456af=db[_0xa35b('0x29')][_0xa35b('0x2a')];_0x3eda63[_0xa35b('0x2b')]=_[_0xa35b('0x2c')](_['keys'](_0x4456af),[_0xa35b('0x2d')]);_0x3eda63[_0xa35b('0x2e')]=_[_0xa35b('0x2f')](_0x33da60[_0xa35b('0x2e')]);_0x3eda63[_0xa35b('0x30')]=_['intersection'](_0x3eda63[_0xa35b('0x2b')],_0x3eda63[_0xa35b('0x2e')]);_0x463db2[_0xa35b('0x31')]=_[_0xa35b('0x32')](_0x3eda63['model'],qs[_0xa35b('0x33')](_0x33da60[_0xa35b('0x2e')]['fields']));_0x463db2[_0xa35b('0x31')]=_0x463db2['attributes']['length']?_0x463db2[_0xa35b('0x31')]:_0x3eda63[_0xa35b('0x2b')];if(!_0x33da60['query']['hasOwnProperty']('nolimit')){_0x463db2[_0xa35b('0x1f')]=qs[_0xa35b('0x1f')](_0x33da60[_0xa35b('0x2e')]['limit']);_0x463db2[_0xa35b('0x1e')]=qs[_0xa35b('0x1e')](_0x33da60['query'][_0xa35b('0x1e')]);}_0x463db2[_0xa35b('0x34')]=qs[_0xa35b('0x35')](_0x33da60['query'][_0xa35b('0x35')]);_0x463db2[_0xa35b('0x36')]=qs[_0xa35b('0x30')](_['pick'](_0x33da60[_0xa35b('0x2e')],_0x3eda63['filters']));if(_0x33da60[_0xa35b('0x2e')][_0xa35b('0x37')]){_0x463db2[_0xa35b('0x36')]=_[_0xa35b('0x38')](_0x463db2[_0xa35b('0x36')],{'$or':_[_0xa35b('0x39')](_0x4456af,function(_0x5c14a2){if(_0x5c14a2['type']['key']!==_0xa35b('0x3a')){var _0xecc523={};_0xecc523[_0x5c14a2['field']]={'$like':'%'+_0x33da60['query']['filter']+'%'};return _0xecc523;}})});}_0x463db2=_[_0xa35b('0x38')]({},_0x463db2,_0x33da60[_0xa35b('0x3b')]);var _0x31befd={'where':_0x463db2[_0xa35b('0x36')]};return db[_0xa35b('0x29')]['count'](_0x31befd)[_0xa35b('0x25')](function(_0x176f6b){_0xd5dfaa[_0xa35b('0x1d')]=_0x176f6b;if(_0x33da60[_0xa35b('0x2e')][_0xa35b('0x3c')]){_0x463db2[_0xa35b('0x3d')]=[{'all':!![]}];}return db['ScreenRecording'][_0xa35b('0x3e')](_0x463db2);})['then'](function(_0x309897){_0xd5dfaa[_0xa35b('0x3f')]=_0x309897;return _0xd5dfaa;})[_0xa35b('0x25')](respondWithFilteredResult(_0x4a98a5,_0x463db2))[_0xa35b('0x40')](handleError(_0x4a98a5,null));};exports[_0xa35b('0x41')]=function(_0x1b6ef4,_0x4162e5){var _0x795caa={'raw':![],'where':{'id':_0x1b6ef4[_0xa35b('0x42')]['id']}},_0x1915dc={};_0x1915dc['model']=_['keys'](db[_0xa35b('0x29')][_0xa35b('0x2a')]);_0x1915dc['query']=_[_0xa35b('0x2f')](_0x1b6ef4[_0xa35b('0x2e')]);_0x1915dc['filters']=_[_0xa35b('0x32')](_0x1915dc[_0xa35b('0x2b')],_0x1915dc[_0xa35b('0x2e')]);_0x795caa[_0xa35b('0x31')]=_[_0xa35b('0x32')](_0x1915dc[_0xa35b('0x2b')],qs[_0xa35b('0x33')](_0x1b6ef4[_0xa35b('0x2e')][_0xa35b('0x33')]));_0x795caa['attributes']=_0x795caa[_0xa35b('0x31')][_0xa35b('0x43')]?_0x795caa[_0xa35b('0x31')]:_0x1915dc[_0xa35b('0x2b')];if(_0x1b6ef4[_0xa35b('0x2e')][_0xa35b('0x3c')]){_0x795caa[_0xa35b('0x3d')]=[{'all':!![]}];}_0x795caa=_[_0xa35b('0x38')]({},_0x795caa,_0x1b6ef4[_0xa35b('0x3b')]);return db['ScreenRecording'][_0xa35b('0x44')](_0x795caa)[_0xa35b('0x25')](handleEntityNotFound(_0x4162e5,null))[_0xa35b('0x25')](respondWithResult(_0x4162e5,null))['catch'](handleError(_0x4162e5,null));};exports['create']=function(_0xfe1315,_0x18b04f){return db[_0xa35b('0x29')][_0xa35b('0x45')](_0xfe1315[_0xa35b('0x46')],{})[_0xa35b('0x25')](respondWithResult(_0x18b04f,0xc9))[_0xa35b('0x40')](handleError(_0x18b04f,null));};exports[_0xa35b('0x24')]=function(_0x167a4a,_0xa9cfec){if(_0x167a4a[_0xa35b('0x46')]['id']){delete _0x167a4a[_0xa35b('0x46')]['id'];}delete _0x167a4a[_0xa35b('0x46')][_0xa35b('0x47')];delete _0x167a4a['body'][_0xa35b('0x48')];delete _0x167a4a['body'][_0xa35b('0x49')];delete _0x167a4a[_0xa35b('0x46')]['value'];return db[_0xa35b('0x29')][_0xa35b('0x44')]({'where':{'id':_0x167a4a['params']['id']}})[_0xa35b('0x25')](handleEntityNotFound(_0xa9cfec,null))[_0xa35b('0x25')](saveUpdates(_0x167a4a[_0xa35b('0x46')],null))[_0xa35b('0x25')](respondWithResult(_0xa9cfec,null))[_0xa35b('0x40')](handleError(_0xa9cfec,null));};exports[_0xa35b('0x4a')]=function(_0x50436d,_0x4a2834){return db[_0xa35b('0x29')][_0xa35b('0x44')]({'where':{'id':_0x50436d[_0xa35b('0x42')]['id']}})[_0xa35b('0x25')](handleEntityNotFound(_0x4a2834,null))[_0xa35b('0x25')](removeEntity(_0x4a2834,null))['catch'](handleError(_0x4a2834,null));};exports['describe']=function(_0x3ca66a,_0x32c6a2){return db[_0xa35b('0x29')]['describe']()[_0xa35b('0x25')](respondWithResult(_0x32c6a2,null))[_0xa35b('0x40')](handleError(_0x32c6a2,null));};exports[_0xa35b('0x4b')]=function(_0x41ed89,_0x11a4b0,_0x5a764e){var _0x564ed6=require(_0xa35b('0x4c'));var _0xd41b2b=![];var _0x3721fa={};if(_0x41ed89[_0xa35b('0x2e')]['type']&&_0x41ed89[_0xa35b('0x2e')][_0xa35b('0x4d')]===_0xa35b('0x4e')){_0x3721fa[_0xa35b('0x4e')]=_0x41ed89[_0xa35b('0x42')]['id'];}else{_0x3721fa['id']=_0x41ed89['params']['id'];}return db[_0xa35b('0x29')]['find']({'where':_0x3721fa,'attributes':['id',_0xa35b('0x4f')],'raw':!![]})[_0xa35b('0x25')](handleEntityNotFound(_0x11a4b0,null))['then'](function(_0x561f11){if(_0x561f11){var _0x558b95=path[_0xa35b('0x50')](config['root'],_0xa35b('0x51'),_0x561f11[_0xa35b('0x4f')]);var _0x30c4d9=util['format'](_0xa35b('0x52'),_0x558b95);if(fs['existsSync'](_0x30c4d9)){_0xd41b2b=!![];return _0x564ed6['decryptFile'](_0x30c4d9,_0x558b95,config[_0xa35b('0x53')][_0xa35b('0x54')])[_0xa35b('0x25')](function(){return _0x561f11;});}return _0x561f11;}})[_0xa35b('0x25')](function(_0x46549c){if(_0x46549c){var _0x410d6e=path[_0xa35b('0x50')](config['root'],_0xa35b('0x51'),_0x46549c[_0xa35b('0x4f')]);if(!fs[_0xa35b('0x55')](_0x410d6e)){throw new db[(_0xa35b('0x56'))][(_0xa35b('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x46549c[_0xa35b('0x58')]){return _0x11a4b0[_0xa35b('0x4b')](_0x410d6e,_0x46549c['filename']+path[_0xa35b('0x59')](_0x410d6e),function(){if(_0xd41b2b){fs[_0xa35b('0x5a')](_0x410d6e);}});}else{return _0x11a4b0[_0xa35b('0x4b')](_0x410d6e,function(_0x3765ea){if(_0xd41b2b){fs[_0xa35b('0x5a')](_0x410d6e);}});}}})[_0xa35b('0x40')](function(_0x1f6a78){if(_0x1f6a78[_0xa35b('0x5b')]===_0xa35b('0x5c')){_0x11a4b0[_0xa35b('0x1b')](0x194)[_0xa35b('0x5d')]('Not\x20found');}else{return handleError(_0x11a4b0,null);}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 790a0a7..6e302ae 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 _0x540f=['api','moment','bluebird','request-promise','rimraf','./screenRecording.attributes','define','interactionid','isNil','value','root','screen_recordings','log','catch','resolve','finally','lodash','util'];(function(_0x49b653,_0x549808){var _0x2641f6=function(_0x44656b){while(--_0x44656b){_0x49b653['push'](_0x49b653['shift']());}};_0x2641f6(++_0x549808);}(_0x540f,0xa0));var _0xf540=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x540f[_0x59eefb];return _0x1a49e8;};'use strict';var _=require(_0xf540('0x0'));var util=require(_0xf540('0x1'));var logger=require('../../config/logger')(_0xf540('0x2'));var moment=require(_0xf540('0x3'));var BPromise=require(_0xf540('0x4'));var rp=require(_0xf540('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf540('0x6'));var config=require('../../config/environment');var attributes=require(_0xf540('0x7'));module['exports']=function(_0xe00652,_0x122cf9){return _0xe00652[_0xf540('0x8')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xf540('0x9'),'fields':[_0xf540('0x9')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0xda4309,_0x307af8,_0x5b156e){return new BPromise(function(_0x3e510e,_0x1b644d){if(!_[_0xf540('0xa')](_0xda4309[_0xf540('0xb')])){var _0x35bc3f=path['join'](config[_0xf540('0xc')],'server','files',_0xf540('0xd'),_0xda4309[_0xf540('0xb')]);if(fs['existsSync'](_0x35bc3f)){rimraf(_0x35bc3f,function(_0xddd85b){if(_0xddd85b){console[_0xf540('0xe')](_0xddd85b);}});}}_0x3e510e();})[_0xf540('0xf')](function(_0x1d8ff5){BPromise[_0xf540('0x10')]();})[_0xf540('0x11')](function(){_0x5b156e();});}}});}; \ No newline at end of file +var _0xab41=['moment','bluebird','request-promise','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','isNil','value','join','existsSync','catch','resolve','finally','lodash','util','../../config/logger','api'];(function(_0x338b26,_0x45d064){var _0x21d9da=function(_0x10c8bb){while(--_0x10c8bb){_0x338b26['push'](_0x338b26['shift']());}};_0x21d9da(++_0x45d064);}(_0xab41,0x1ea));var _0x1ab4=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xab41[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x1ab4('0x0'));var util=require(_0x1ab4('0x1'));var logger=require(_0x1ab4('0x2'))(_0x1ab4('0x3'));var moment=require(_0x1ab4('0x4'));var BPromise=require(_0x1ab4('0x5'));var rp=require(_0x1ab4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ab4('0x7'));module[_0x1ab4('0x8')]=function(_0x2d75a0,_0xe141fe){return _0x2d75a0['define'](_0x1ab4('0x9'),attributes,{'tableName':_0x1ab4('0xa'),'paranoid':![],'indexes':[{'name':_0x1ab4('0xb'),'fields':[_0x1ab4('0xb')]}],'timestamps':!![],'hooks':{'afterDestroy':function(_0x33c25b,_0x4cd512,_0x51c34c){return new BPromise(function(_0x23c5e0,_0x387988){if(!_[_0x1ab4('0xc')](_0x33c25b[_0x1ab4('0xd')])){var _0x52a588=path[_0x1ab4('0xe')](config['root'],'server','files',_0x1ab4('0xa'),_0x33c25b[_0x1ab4('0xd')]);if(fs[_0x1ab4('0xf')](_0x52a588)){rimraf(_0x52a588,function(_0x514300){if(_0x514300){console['log'](_0x514300);}});}}_0x23c5e0();})[_0x1ab4('0x10')](function(_0x2a0382){BPromise[_0x1ab4('0x11')]();})[_0x1ab4('0x12')](function(){_0x51c34c();});}}});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index f58fee6..752a8aa 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x772d81,_0x4d9177){var _0x1ca2ea=function(_0xbe4c4b){while(--_0xbe4c4b){_0x772d81['push'](_0x772d81['shift']());}};_0x1ca2ea(++_0x4d9177);}(_0xe14b,0x93));var _0xbe14=function(_0xa4c421,_0x115c8b){_0xa4c421=_0xa4c421-0x0;var _0x1a2922=_0xe14b[_0xa4c421];return _0x1a2922;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0xed1f=['request','then','info','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x24d464,_0x2e916e){var _0x3af34d=function(_0x272de1){while(--_0x272de1){_0x24d464['push'](_0x24d464['shift']());}};_0x3af34d(++_0x2e916e);}(_0xed1f,0x6a));var _0xfed1=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xed1f[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x380e18,_0x612b38,_0x2a6082){return new BPromise(function(_0x2967ef,_0x568d48){return client[_0xfed1('0xe')](_0x380e18,_0x2a6082)[_0xfed1('0xf')](function(_0x48862d){logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,'request\x20sent');logger[_0xfed1('0x12')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x612b38,_0xfed1('0x13'),JSON[_0xfed1('0x14')](_0x48862d));if(_0x48862d['error']){if(_0x48862d['error'][_0xfed1('0x15')]===0x1f4){logger[_0xfed1('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x568d48(_0x48862d['error'][_0xfed1('0x17')]);}logger[_0xfed1('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x612b38,_0x48862d[_0xfed1('0x16')]['message']);return _0x2967ef(_0x48862d['error'][_0xfed1('0x17')]);}else{logger[_0xfed1('0x10')](_0xfed1('0x11'),_0x612b38,_0xfed1('0x13'));_0x2967ef(_0x48862d['result'][_0xfed1('0x17')]);}})['catch'](function(_0x36ff34){logger[_0xfed1('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x612b38,_0x36ff34);_0x568d48(_0x36ff34);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index f981b9d..0a75eab 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 _0xb8c0=['root','server/files/images/logos/','%s%s','originalname','file','addLogo','diskStorage','logologin','extname','post','addLogoLogin','format','preferred','single','addPreferred','put','isAuthenticated','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','join'];(function(_0xbb4d85,_0x3939bf){var _0x6fcb61=function(_0x529ce2){while(--_0x529ce2){_0xbb4d85['push'](_0xbb4d85['shift']());}};_0x6fcb61(++_0x3939bf);}(_0xb8c0,0x139));var _0x0b8c=function(_0x30c6bd,_0x5da928){_0x30c6bd=_0x30c6bd-0x0;var _0x373512=_0xb8c0[_0x30c6bd];return _0x373512;};'use strict';var multer=require(_0x0b8c('0x0'));var util=require(_0x0b8c('0x1'));var path=require(_0x0b8c('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b8c('0x3'));var router=express[_0x0b8c('0x4')]();var auth=require(_0x0b8c('0x5'));var interaction=require(_0x0b8c('0x6'));var config=require(_0x0b8c('0x7'));var controller=require(_0x0b8c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0b8c('0x9')](_0x0b8c('0xa'),controller[_0x0b8c('0xb')]);router[_0x0b8c('0x9')](_0x0b8c('0xc'),controller[_0x0b8c('0xd')]);router[_0x0b8c('0x9')](_0x0b8c('0xe'),controller[_0x0b8c('0xf')]);router[_0x0b8c('0x9')](_0x0b8c('0x10'),controller[_0x0b8c('0x11')]);router[_0x0b8c('0x9')]('/:id/preferred',controller[_0x0b8c('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x67b6a1,_0x29d7ae,_0x1e18a9){_0x1e18a9(null,path[_0x0b8c('0x13')](config[_0x0b8c('0x14')],_0x0b8c('0x15')));},'filename':function(_0x39318d,_0x277810,_0x4b3ec5){_0x4b3ec5(null,util['format'](_0x0b8c('0x16'),'logo',path['extname'](_0x277810[_0x0b8c('0x17')])));}})});router['post'](_0x0b8c('0xc'),upload['single'](_0x0b8c('0x18')),controller[_0x0b8c('0x19')]);var upload=multer({'storage':multer[_0x0b8c('0x1a')]({'destination':function(_0x5cbd67,_0x5f3104,_0x4570d9){_0x4570d9(null,path['join'](config[_0x0b8c('0x14')],'server/files/images/logos/'));},'filename':function(_0x52c195,_0x1c9487,_0x5ea3d2){_0x5ea3d2(null,util['format']('%s%s',_0x0b8c('0x1b'),path[_0x0b8c('0x1c')](_0x1c9487[_0x0b8c('0x17')])));}})});router[_0x0b8c('0x1d')](_0x0b8c('0xe'),upload['single'](_0x0b8c('0x18')),controller[_0x0b8c('0x1e')]);var upload=multer({'storage':multer[_0x0b8c('0x1a')]({'destination':function(_0x149fba,_0x5dc692,_0x4896d7){_0x4896d7(null,path['join'](config[_0x0b8c('0x14')],_0x0b8c('0x15')));},'filename':function(_0x4aec17,_0xcf52bb,_0x219f86){_0x219f86(null,util[_0x0b8c('0x1f')]('%s%s',_0x0b8c('0x20'),path[_0x0b8c('0x1c')](_0xcf52bb[_0x0b8c('0x17')])));}})});router[_0x0b8c('0x1d')]('/:id/preferred',upload[_0x0b8c('0x21')](_0x0b8c('0x18')),controller[_0x0b8c('0x22')]);router[_0x0b8c('0x23')](_0x0b8c('0xa'),auth[_0x0b8c('0x24')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x790d=['file','addLogo','diskStorage','join','root','%s%s','post','addLogoLogin','preferred','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','server/files/images/logos/','format','logo','extname','originalname'];(function(_0x982a29,_0x596cf3){var _0x5598ec=function(_0x29441c){while(--_0x29441c){_0x982a29['push'](_0x982a29['shift']());}};_0x5598ec(++_0x596cf3);}(_0x790d,0x10f));var _0xd790=function(_0x5ad0d7,_0x2645f8){_0x5ad0d7=_0x5ad0d7-0x0;var _0xd83bd=_0x790d[_0x5ad0d7];return _0xd83bd;};'use strict';var multer=require(_0xd790('0x0'));var util=require(_0xd790('0x1'));var path=require(_0xd790('0x2'));var timeout=require(_0xd790('0x3'));var express=require(_0xd790('0x4'));var router=express[_0xd790('0x5')]();var auth=require(_0xd790('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd790('0x7'));var controller=require(_0xd790('0x8'));router[_0xd790('0x9')]('/',auth[_0xd790('0xa')](),controller[_0xd790('0xb')]);router[_0xd790('0x9')]('/:id',controller[_0xd790('0xc')]);router[_0xd790('0x9')](_0xd790('0xd'),controller[_0xd790('0xe')]);router[_0xd790('0x9')](_0xd790('0xf'),controller[_0xd790('0x10')]);router[_0xd790('0x9')](_0xd790('0x11'),controller['gdpr']);router[_0xd790('0x9')](_0xd790('0x12'),controller[_0xd790('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a0c62,_0x97cf0a,_0x13ddd7){_0x13ddd7(null,path['join'](config['root'],_0xd790('0x14')));},'filename':function(_0x51e1c2,_0x421ade,_0x57eb55){_0x57eb55(null,util[_0xd790('0x15')]('%s%s',_0xd790('0x16'),path[_0xd790('0x17')](_0x421ade[_0xd790('0x18')])));}})});router['post']('/:id/logo',upload['single'](_0xd790('0x19')),controller[_0xd790('0x1a')]);var upload=multer({'storage':multer[_0xd790('0x1b')]({'destination':function(_0x400d7e,_0x1b53c7,_0xba190d){_0xba190d(null,path[_0xd790('0x1c')](config[_0xd790('0x1d')],_0xd790('0x14')));},'filename':function(_0xb4ed46,_0x198f34,_0x2c00fd){_0x2c00fd(null,util[_0xd790('0x15')](_0xd790('0x1e'),'logologin',path[_0xd790('0x17')](_0x198f34[_0xd790('0x18')])));}})});router[_0xd790('0x1f')](_0xd790('0xf'),upload['single'](_0xd790('0x19')),controller[_0xd790('0x20')]);var upload=multer({'storage':multer[_0xd790('0x1b')]({'destination':function(_0x8573e5,_0x35cd69,_0x124abd){_0x124abd(null,path[_0xd790('0x1c')](config['root'],'server/files/images/logos/'));},'filename':function(_0x43c68a,_0x31d94b,_0x195984){_0x195984(null,util[_0xd790('0x15')](_0xd790('0x1e'),_0xd790('0x21'),path[_0xd790('0x17')](_0x31d94b[_0xd790('0x18')])));}})});router['post'](_0xd790('0x12'),upload['single'](_0xd790('0x19')),controller['addPreferred']);router[_0xd790('0x22')]('/:id',auth[_0xd790('0xa')](),controller[_0xd790('0x23')]);module[_0xd790('0x24')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 36061b9..745aefd 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 _0xe432=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize','exports','INTEGER','min_internal','STRING'];(function(_0x30bd9a,_0x204870){var _0x5dcc54=function(_0x2140f8){while(--_0x2140f8){_0x30bd9a['push'](_0x30bd9a['shift']());}};_0x5dcc54(++_0x204870);}(_0xe432,0x11b));var _0x2e43=function(_0x213794,_0x538066){_0x213794=_0x213794-0x0;var _0x1bd1c7=_0xe432[_0x213794];return _0x1bd1c7;};'use strict';var Sequelize=require(_0x2e43('0x0'));module[_0x2e43('0x1')]={'min_internal':{'type':Sequelize[_0x2e43('0x2')](0xb),'unique':_0x2e43('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x2e43('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x2e43('0x4')],'defaultValue':_0x2e43('0x5')},'logo':{'type':Sequelize[_0x2e43('0x4')]},'defaultLogo':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x2e43('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x2e43('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x2e43('0x4')]},'turnusername':{'type':Sequelize[_0x2e43('0x4')]},'turnpassword':{'type':Sequelize[_0x2e43('0x4')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x2e43('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x2e43('0x7')},'enableEmailPreview':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x2e43('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x2e43('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x2e43('0x4')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x2e43('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x2e43('0x4')]},'defaultPreferred':{'type':Sequelize[_0x2e43('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x2e43('0x4')]}}; \ No newline at end of file +var _0x9f21=['exports','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize'];(function(_0xcc4d3a,_0x1d49b2){var _0x1ab399=function(_0x24d259){while(--_0x24d259){_0xcc4d3a['push'](_0xcc4d3a['shift']());}};_0x1ab399(++_0x1d49b2);}(_0x9f21,0x98));var _0x19f2=function(_0x25bd2a,_0xc8fe7a){_0x25bd2a=_0x25bd2a-0x0;var _0xb6b479=_0x9f21[_0x25bd2a];return _0xb6b479;};'use strict';var Sequelize=require(_0x19f2('0x0'));module[_0x19f2('0x1')]={'min_internal':{'type':Sequelize[_0x19f2('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x19f2('0x2')](0xb),'unique':_0x19f2('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x19f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x19f2('0x4')},'logo':{'type':Sequelize[_0x19f2('0x5')]},'defaultLogo':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x19f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x19f2('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x19f2('0x5')]},'turnpassword':{'type':Sequelize[_0x19f2('0x5')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x19f2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x19f2('0x7')},'enableEmailPreview':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x19f2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x19f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x19f2('0x5')],'defaultValue':_0x19f2('0x8')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x19f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 68819dd..b7617b4 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 _0x89f0=['offset','limit','set','Content-Range','json','apply','reject','save','update','stack','send','index','Setting','rawAttributes','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','key','VIRTUAL','options','includeAll','include','findAll','show','params','intersection','length','merge','find','body','readFileSync','join','root','utf8','render','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','file','filename','logo','loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','toLower','default_logo.png','default','upperFirst','custom','existsSync','Sequelize','ValidationError','Logo\x20not\x20found','default_loginLogo.png','download','gdpr','securePassword','getPreferred','getLicense','default_preferred.png','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count'];(function(_0x321d43,_0x2a116a){var _0x2640e1=function(_0x4066bf){while(--_0x4066bf){_0x321d43['push'](_0x321d43['shift']());}};_0x2640e1(++_0x2a116a);}(_0x89f0,0xcd));var _0x089f=function(_0x3e70d0,_0x53da0d){_0x3e70d0=_0x3e70d0-0x0;var _0x4dbca6=_0x89f0[_0x3e70d0];return _0x4dbca6;};'use strict';var pdf=require(_0x089f('0x0'));var emlformat=require(_0x089f('0x1'));var rimraf=require(_0x089f('0x2'));var zipdir=require(_0x089f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x089f('0x4'));var moment=require(_0x089f('0x5'));var BPromise=require(_0x089f('0x6'));var Mustache=require('mustache');var util=require(_0x089f('0x7'));var path=require(_0x089f('0x8'));var sox=require(_0x089f('0x9'));var csv=require(_0x089f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x089f('0xb'));var squel=require(_0x089f('0xc'));var crypto=require('crypto');var jsforce=require(_0x089f('0xd'));var deskjs=require(_0x089f('0xe'));var toCsv=require(_0x089f('0xa'));var querystring=require(_0x089f('0xf'));var Papa=require(_0x089f('0x10'));var Redis=require(_0x089f('0x11'));var authService=require(_0x089f('0x12'));var qs=require(_0x089f('0x13'));var hardwareService=require(_0x089f('0x14'));var logger=require('../../config/logger')(_0x089f('0x15'));var utils=require(_0x089f('0x16'));var config=require(_0x089f('0x17'));var db=require(_0x089f('0x18'))['db'];var jayson=require(_0x089f('0x19'));var client=jayson[_0x089f('0x1a')][_0x089f('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x5dc032,_0x2e0e6f,_0x53d263){if(_0x53d263){var _0x415d2b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x415d2b[_0x089f('0x1c')](_0x2e0e6f)){return _0x5dc032;}else{throw new Error(_0x089f('0x1d'));}}else{return _0x5dc032;}}function respondWithRpcPromise(_0x1a13fe,_0x4e9cd0,_0x430044,_0x5860b0){return new BPromise(function(_0x26a1b4,_0x4160be){var _0x5555ea=_0x5860b0||client;return _0x5555ea[_0x089f('0x1e')](_0x1a13fe,_0x430044)[_0x089f('0x1f')](function(_0x1c1279){logger[_0x089f('0x20')](_0x089f('0x21'),_0x4e9cd0,'request\x20sent');logger[_0x089f('0x22')](_0x089f('0x23'),_0x4e9cd0,_0x089f('0x24'),JSON[_0x089f('0x25')](_0x1c1279));if(_0x1c1279[_0x089f('0x26')]){if(_0x1c1279['error'][_0x089f('0x27')]===0x1f4){logger[_0x089f('0x26')](_0x089f('0x21'),_0x4e9cd0,_0x1c1279[_0x089f('0x26')][_0x089f('0x28')]);return _0x4160be(_0x1c1279['error']['message']);}logger[_0x089f('0x26')](_0x089f('0x21'),_0x4e9cd0,_0x1c1279['error'][_0x089f('0x28')]);return _0x26a1b4(_0x1c1279[_0x089f('0x26')][_0x089f('0x28')]);}else{logger[_0x089f('0x20')](_0x089f('0x21'),_0x4e9cd0,_0x089f('0x24'));_0x26a1b4(_0x1c1279[_0x089f('0x29')][_0x089f('0x28')]);}})[_0x089f('0x2a')](function(_0x10345a){logger[_0x089f('0x26')](_0x089f('0x21'),_0x4e9cd0,_0x10345a);_0x4160be(_0x10345a);});});}function respondWithStatusCode(_0x20fb73,_0x41ad24){_0x41ad24=_0x41ad24||0xcc;return function(_0x51236d){if(_0x51236d){return _0x20fb73[_0x089f('0x2b')](_0x41ad24);}return _0x20fb73[_0x089f('0x2c')](_0x41ad24)[_0x089f('0x2d')]();};}function respondWithResult(_0x3b8dc9,_0x128f0c){_0x128f0c=_0x128f0c||0xc8;return function(_0x1b800b){if(_0x1b800b){return _0x3b8dc9[_0x089f('0x2c')](_0x128f0c)['json'](_0x1b800b);}};}function respondWithFilteredResult(_0x18790b,_0x3286f1){return function(_0x4a4179){if(_0x4a4179){var _0xe7fb27=_0x4a4179[_0x089f('0x2e')],_0x1744d0=_0x3286f1[_0x089f('0x2f')],_0x236774=_0x3286f1[_0x089f('0x2f')]+_0x3286f1[_0x089f('0x30')],_0x2e49a2;if(_0x236774>=_0xe7fb27){_0x236774=_0xe7fb27;_0x2e49a2=0xc8;}else{_0x2e49a2=0xce;}_0x18790b[_0x089f('0x2c')](_0x2e49a2);return _0x18790b[_0x089f('0x31')](_0x089f('0x32'),_0x1744d0+'-'+_0x236774+'/'+_0xe7fb27)[_0x089f('0x33')](_0x4a4179);}return null;};}function patchUpdates(_0x5dafcf){return function(_0x2ce304){try{jsonpatch[_0x089f('0x34')](_0x2ce304,_0x5dafcf,!![]);}catch(_0xa71083){return BPromise[_0x089f('0x35')](_0xa71083);}return _0x2ce304[_0x089f('0x36')]();};}function saveUpdates(_0x2cf33a,_0x32c70a){return function(_0x6be1e4){if(_0x6be1e4){return _0x6be1e4[_0x089f('0x37')](_0x2cf33a)['then'](function(_0x34b39f){return _0x34b39f;});}return null;};}function removeEntity(_0x4888e5,_0x28f4aa){return function(_0x10bdd4){if(_0x10bdd4){return _0x10bdd4['destroy']()[_0x089f('0x1f')](function(){_0x4888e5[_0x089f('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f4f8d,_0x1bcb79){return function(_0x330794){if(!_0x330794){_0x5f4f8d['sendStatus'](0x194);}return _0x330794;};}function handleError(_0x407cb8,_0x12f678){_0x12f678=_0x12f678||0x1f4;return function(_0x198909){logger[_0x089f('0x26')](_0x198909[_0x089f('0x38')]);if(_0x198909['name']){delete _0x198909['name'];}_0x407cb8[_0x089f('0x2c')](_0x12f678)[_0x089f('0x39')](_0x198909);};}exports[_0x089f('0x3a')]=function(_0x4bd338,_0x4a6a9f){var _0x507378={},_0x246875={},_0x2dca1d={'count':0x0,'rows':[]};var _0x23a223=db[_0x089f('0x3b')][_0x089f('0x3c')];_0x246875[_0x089f('0x3d')]=_[_0x089f('0x3e')](_0x23a223);_0x246875[_0x089f('0x3f')]=_['keys'](_0x4bd338[_0x089f('0x3f')]);_0x246875[_0x089f('0x40')]=_['intersection'](_0x246875[_0x089f('0x3d')],_0x246875[_0x089f('0x3f')]);_0x507378['attributes']=_['intersection'](_0x246875['model'],qs[_0x089f('0x41')](_0x4bd338['query']['fields']));_0x507378[_0x089f('0x42')]=_0x507378['attributes']['length']?_0x507378[_0x089f('0x42')]:_0x246875[_0x089f('0x3d')];if(!_0x4bd338['query'][_0x089f('0x43')](_0x089f('0x44'))){_0x507378['limit']=qs[_0x089f('0x30')](_0x4bd338[_0x089f('0x3f')][_0x089f('0x30')]);_0x507378['offset']=qs['offset'](_0x4bd338[_0x089f('0x3f')]['offset']);}_0x507378[_0x089f('0x45')]=qs['sort'](_0x4bd338['query'][_0x089f('0x46')]);_0x507378[_0x089f('0x47')]=qs[_0x089f('0x40')](_['pick'](_0x4bd338[_0x089f('0x3f')],_0x246875['filters']));if(_0x4bd338[_0x089f('0x3f')][_0x089f('0x48')]){_0x507378[_0x089f('0x47')]=_['merge'](_0x507378[_0x089f('0x47')],{'$or':_['map'](_0x23a223,function(_0x656457){if(_0x656457[_0x089f('0x49')][_0x089f('0x4a')]!==_0x089f('0x4b')){var _0x4e9c11={};_0x4e9c11[_0x656457['field']]={'$like':'%'+_0x4bd338[_0x089f('0x3f')][_0x089f('0x48')]+'%'};return _0x4e9c11;}})});}_0x507378=_['merge']({},_0x507378,_0x4bd338[_0x089f('0x4c')]);var _0x420290={'where':_0x507378[_0x089f('0x47')]};return db[_0x089f('0x3b')][_0x089f('0x2e')](_0x420290)[_0x089f('0x1f')](function(_0x1a5a50){_0x2dca1d[_0x089f('0x2e')]=_0x1a5a50;if(_0x4bd338[_0x089f('0x3f')][_0x089f('0x4d')]){_0x507378[_0x089f('0x4e')]=[{'all':!![]}];}return db[_0x089f('0x3b')][_0x089f('0x4f')](_0x507378);})['then'](function(_0x171557){_0x2dca1d['rows']=_0x171557;return _0x2dca1d;})[_0x089f('0x1f')](respondWithFilteredResult(_0x4a6a9f,_0x507378))['catch'](handleError(_0x4a6a9f,null));};exports[_0x089f('0x50')]=function(_0x435649,_0x4f8760){var _0x3eeacc={'raw':![],'where':{'id':_0x435649[_0x089f('0x51')]['id']}},_0x215d78={};_0x215d78[_0x089f('0x3d')]=_['keys'](db[_0x089f('0x3b')]['rawAttributes']);_0x215d78[_0x089f('0x3f')]=_[_0x089f('0x3e')](_0x435649[_0x089f('0x3f')]);_0x215d78[_0x089f('0x40')]=_[_0x089f('0x52')](_0x215d78[_0x089f('0x3d')],_0x215d78[_0x089f('0x3f')]);_0x3eeacc[_0x089f('0x42')]=_[_0x089f('0x52')](_0x215d78[_0x089f('0x3d')],qs[_0x089f('0x41')](_0x435649[_0x089f('0x3f')][_0x089f('0x41')]));_0x3eeacc[_0x089f('0x42')]=_0x3eeacc['attributes'][_0x089f('0x53')]?_0x3eeacc[_0x089f('0x42')]:_0x215d78[_0x089f('0x3d')];if(_0x435649[_0x089f('0x3f')][_0x089f('0x4d')]){_0x3eeacc['include']=[{'all':!![]}];}_0x3eeacc=_[_0x089f('0x54')]({},_0x3eeacc,_0x435649[_0x089f('0x4c')]);return db[_0x089f('0x3b')][_0x089f('0x55')](_0x3eeacc)[_0x089f('0x1f')](handleEntityNotFound(_0x4f8760,null))[_0x089f('0x1f')](respondWithResult(_0x4f8760,null))['catch'](handleError(_0x4f8760,null));};exports['update']=function(_0x319577,_0x41c904,_0x40391a){var _0x155e98;return db[_0x089f('0x3b')][_0x089f('0x55')]({'where':{'id':_0x319577['params']['id']}})[_0x089f('0x1f')](handleEntityNotFound(_0x41c904,null))['then'](saveUpdates(_0x319577[_0x089f('0x56')],null))[_0x089f('0x1f')](function(_0x205a4f){if(_0x205a4f){_0x155e98=_0x205a4f['get']({'plain':!![]});var _0x45a93e=fs[_0x089f('0x57')](path[_0x089f('0x58')](config[_0x089f('0x59')],'server/files/templates/stun.ejs'),_0x089f('0x5a'));var _0x523bf2=ejs[_0x089f('0x5b')](_0x45a93e,_0x155e98);var _0x235416=fs[_0x089f('0x57')](path[_0x089f('0x58')](config[_0x089f('0x59')],_0x089f('0x5c')),_0x089f('0x5a'));var _0x2befa4=ejs['render'](_0x235416,_0x155e98);fs[_0x089f('0x5d')](_0x089f('0x5e'),_0x523bf2);fs['writeFileSync'](_0x089f('0x5f'),_0x2befa4);return respondWithRpcPromise(_0x089f('0x60'),_0x089f('0x37'),{'module':_0x089f('0x61')});}})[_0x089f('0x1f')](function(){return respondWithRpcPromise(_0x089f('0x60'),'update',{'module':_0x089f('0x62')});})['then'](function(){return _0x155e98||null;})['then'](respondWithResult(_0x41c904,null))[_0x089f('0x2a')](handleError(_0x41c904,null));};exports['addLogo']=function(_0x619ca0,_0x2179d6,_0x500005){if(_0x619ca0[_0x089f('0x63')]&&_0x619ca0[_0x089f('0x63')][_0x089f('0x64')]){_0x619ca0[_0x089f('0x56')][_0x089f('0x65')]=_0x619ca0[_0x089f('0x63')][_0x089f('0x64')];}return db[_0x089f('0x3b')][_0x089f('0x55')]({'where':{'id':_0x619ca0['params']['id']}})[_0x089f('0x1f')](handleEntityNotFound(_0x2179d6,null))[_0x089f('0x1f')](saveUpdates(_0x619ca0['body'],null))[_0x089f('0x1f')](respondWithResult(_0x2179d6,null))['catch'](handleError(_0x2179d6,null));};exports['addLogoLogin']=function(_0x359c1c,_0x5451e4,_0x255b1d){if(_0x359c1c['file']&&_0x359c1c[_0x089f('0x63')][_0x089f('0x64')]){_0x359c1c[_0x089f('0x56')][_0x089f('0x66')]=_0x359c1c['file'][_0x089f('0x64')];}return db[_0x089f('0x3b')][_0x089f('0x55')]({'where':{'id':_0x359c1c[_0x089f('0x51')]['id']}})[_0x089f('0x1f')](handleEntityNotFound(_0x5451e4,null))[_0x089f('0x1f')](saveUpdates(_0x359c1c['body'],null))[_0x089f('0x1f')](respondWithResult(_0x5451e4,null))[_0x089f('0x2a')](handleError(_0x5451e4,null));};var utilLicense=require(_0x089f('0x67'));exports[_0x089f('0x68')]=function(_0xe0b5ba,_0x165b8c,_0x58d49f){var _0x3026a4=_0x089f('0x69');var _0x510cc3={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x1152e6){if(_0x1152e6){_0x510cc3=_0x1152e6;}return db[_0x089f('0x3b')][_0x089f('0x55')]({'where':{'id':_0xe0b5ba['params']['id']},'attributes':[_0x089f('0x65'),'loginLogo',_0x089f('0x6a'),_0x089f('0x6b'),_0x089f('0x6c'),_0x089f('0x6d')],'raw':!![]});})[_0x089f('0x1f')](handleEntityNotFound(_0x165b8c,null))[_0x089f('0x1f')](function(_0x16c058){if(_0x16c058){var _0xf27fbc=_0x16c058[_0x089f('0x65')]&&fs['existsSync'](path[_0x089f('0x58')](config[_0x089f('0x59')],_0x3026a4,_[_0x089f('0x6e')](_0x16c058['logo'])))?path[_0x089f('0x58')](config[_0x089f('0x59')],_0x3026a4,_[_0x089f('0x6e')](_0x16c058['logo'])):path[_0x089f('0x58')](config[_0x089f('0x59')],_0x3026a4,_['toLower'](_0x089f('0x6f')));var _0x378e00=_0x089f('0x70')+_[_0x089f('0x71')](_0x089f('0x65'));if(_0x16c058[_0x378e00]||!_0x510cc3[_0x089f('0x72')]){_0xf27fbc=path[_0x089f('0x58')](config[_0x089f('0x59')],_0x3026a4,_[_0x089f('0x6e')](_0x089f('0x6f')));}if(!fs[_0x089f('0x73')](_0xf27fbc)){throw new db[(_0x089f('0x74'))][(_0x089f('0x75'))](_0x089f('0x76'));}return _0x165b8c['download'](_0xf27fbc);}})[_0x089f('0x2a')](handleError(_0x165b8c,null));};var utilLicense=require(_0x089f('0x67'));exports['getLogoLogin']=function(_0x58de2e,_0x536c86,_0x30f42d){var _0x47d62a=_0x089f('0x69');var _0x1efeb9={'custom':![]};return utilLicense['getLicense']()[_0x089f('0x1f')](function(_0x6be3c1){if(_0x6be3c1){_0x1efeb9=_0x6be3c1;}return db[_0x089f('0x3b')]['find']({'where':{'id':_0x58de2e[_0x089f('0x51')]['id']},'attributes':[_0x089f('0x65'),_0x089f('0x66'),_0x089f('0x6a'),_0x089f('0x6b'),_0x089f('0x6c'),_0x089f('0x6d')],'raw':!![]});})[_0x089f('0x1f')](handleEntityNotFound(_0x536c86,null))[_0x089f('0x1f')](function(_0x40f776){if(_0x40f776){var _0x12361f=_0x40f776[_0x089f('0x66')]&&fs[_0x089f('0x73')](path['join'](config['root'],_0x47d62a,_[_0x089f('0x6e')](_0x40f776[_0x089f('0x66')])))?path['join'](config[_0x089f('0x59')],_0x47d62a,_[_0x089f('0x6e')](_0x40f776['loginLogo'])):path[_0x089f('0x58')](config[_0x089f('0x59')],_0x47d62a,_[_0x089f('0x6e')](_0x089f('0x77')));var _0x1ba2b4=_0x089f('0x70')+_[_0x089f('0x71')](_0x089f('0x66'));if(_0x40f776[_0x1ba2b4]||!_0x1efeb9[_0x089f('0x72')]){_0x12361f=path['join'](config[_0x089f('0x59')],_0x47d62a,_[_0x089f('0x6e')](_0x089f('0x77')));}if(!fs[_0x089f('0x73')](_0x12361f)){throw new db[(_0x089f('0x74'))][(_0x089f('0x75'))](_0x089f('0x76'));}return _0x536c86[_0x089f('0x78')](_0x12361f);}})['catch'](handleError(_0x536c86,null));};exports[_0x089f('0x79')]=function(_0x47ec90,_0x18b7a9){return db['Setting']['find']({'where':{'id':_0x47ec90[_0x089f('0x51')]['id']},'attributes':[_0x089f('0x7a')]})[_0x089f('0x1f')](respondWithResult(_0x18b7a9,null))[_0x089f('0x2a')](handleError(_0x18b7a9,null));};exports['addPreferred']=function(_0x21884f,_0x33b81a,_0x2d6e17){if(_0x21884f['file']&&_0x21884f[_0x089f('0x63')][_0x089f('0x64')]){_0x21884f[_0x089f('0x56')][_0x089f('0x6a')]=_0x21884f[_0x089f('0x63')][_0x089f('0x64')];}return db[_0x089f('0x3b')][_0x089f('0x55')]({'where':{'id':_0x21884f[_0x089f('0x51')]['id']}})[_0x089f('0x1f')](handleEntityNotFound(_0x33b81a,null))['then'](saveUpdates(_0x21884f['body'],null))[_0x089f('0x1f')](respondWithResult(_0x33b81a,null))[_0x089f('0x2a')](handleError(_0x33b81a,null));};var utilLicense=require(_0x089f('0x67'));exports[_0x089f('0x7b')]=function(_0x1fc53f,_0x18a3ca,_0x4df344){var _0x22734b='server/files/images/logos';var _0x2e729a={'custom':![]};return utilLicense[_0x089f('0x7c')]()[_0x089f('0x1f')](function(_0x241dbc){if(_0x241dbc){_0x2e729a=_0x241dbc;}return db[_0x089f('0x3b')][_0x089f('0x55')]({'where':{'id':_0x1fc53f[_0x089f('0x51')]['id']},'attributes':[_0x089f('0x65'),_0x089f('0x66'),_0x089f('0x6a'),'defaultLogo',_0x089f('0x6c'),_0x089f('0x6d')],'raw':!![]});})[_0x089f('0x1f')](handleEntityNotFound(_0x18a3ca,null))[_0x089f('0x1f')](function(_0x4719c6){if(_0x4719c6){var _0xac3721=_0x4719c6['preferred']&&fs[_0x089f('0x73')](path[_0x089f('0x58')](config['root'],_0x22734b,_[_0x089f('0x6e')](_0x4719c6['preferred'])))?path['join'](config['root'],_0x22734b,_[_0x089f('0x6e')](_0x4719c6['preferred'])):path['join'](config[_0x089f('0x59')],_0x22734b,_[_0x089f('0x6e')]('default_preferred.png'));var _0x566c23=_0x089f('0x70')+_['upperFirst']('preferred');if(_0x4719c6[_0x566c23]||!_0x2e729a[_0x089f('0x72')]||!_0x2e729a[_0x089f('0x6a')]){_0xac3721=path['join'](config[_0x089f('0x59')],_0x22734b,_[_0x089f('0x6e')](_0x089f('0x7d')));}if(!fs[_0x089f('0x73')](_0xac3721)){throw new db[(_0x089f('0x74'))]['ValidationError'](_0x089f('0x76'));}return _0x18a3ca[_0x089f('0x78')](_0xac3721);}})[_0x089f('0x2a')](handleError(_0x18a3ca,null));}; \ No newline at end of file +var _0x36e6=['VIRTUAL','field','include','findAll','show','params','length','includeAll','update','find','body','join','root','server/files/templates/stun.ejs','readFileSync','server/files/templates/turn.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','addLogo','file','logo','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','custom','ValidationError','download','getLogoLogin','preferred','default_loginLogo.png','upperFirst','Sequelize','Logo\x20not\x20found','securePassword','addPreferred','getPreferred','getLicense','default_preferred.png','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','then','end','stack','name','send','index','Setting','rawAttributes','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','type'];(function(_0x31a0a1,_0x333838){var _0x37436d=function(_0x58c142){while(--_0x58c142){_0x31a0a1['push'](_0x31a0a1['shift']());}};_0x37436d(++_0x333838);}(_0x36e6,0xad));var _0x636e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36e6[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x636e('0x0'));var emlformat=require(_0x636e('0x1'));var rimraf=require(_0x636e('0x2'));var zipdir=require(_0x636e('0x3'));var jsonpatch=require(_0x636e('0x4'));var rp=require(_0x636e('0x5'));var moment=require(_0x636e('0x6'));var BPromise=require(_0x636e('0x7'));var Mustache=require(_0x636e('0x8'));var util=require(_0x636e('0x9'));var path=require(_0x636e('0xa'));var sox=require(_0x636e('0xb'));var csv=require(_0x636e('0xc'));var ejs=require(_0x636e('0xd'));var fs=require('fs');var _=require(_0x636e('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x636e('0xf'));var deskjs=require(_0x636e('0x10'));var toCsv=require(_0x636e('0xc'));var querystring=require(_0x636e('0x11'));var Papa=require('papaparse');var Redis=require(_0x636e('0x12'));var authService=require(_0x636e('0x13'));var qs=require(_0x636e('0x14'));var hardwareService=require(_0x636e('0x15'));var logger=require(_0x636e('0x16'))(_0x636e('0x17'));var utils=require(_0x636e('0x18'));var config=require('../../config/environment');var db=require(_0x636e('0x19'))['db'];var jayson=require(_0x636e('0x1a'));var client=jayson[_0x636e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x43c0f8,_0x583750,_0x4273a6){if(_0x4273a6){var _0x9b209c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9b209c[_0x636e('0x1c')](_0x583750)){return _0x43c0f8;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x43c0f8;}}function respondWithRpcPromise(_0x325f38,_0x228e14,_0x43bbc2,_0x2bef45){return new BPromise(function(_0x12dc44,_0x16dd7d){var _0x497fba=_0x2bef45||client;return _0x497fba['request'](_0x325f38,_0x43bbc2)['then'](function(_0x513794){logger[_0x636e('0x1d')](_0x636e('0x1e'),_0x228e14,_0x636e('0x1f'));logger[_0x636e('0x20')](_0x636e('0x21'),_0x228e14,_0x636e('0x1f'),JSON[_0x636e('0x22')](_0x513794));if(_0x513794[_0x636e('0x23')]){if(_0x513794['error'][_0x636e('0x24')]===0x1f4){logger[_0x636e('0x23')](_0x636e('0x1e'),_0x228e14,_0x513794[_0x636e('0x23')][_0x636e('0x25')]);return _0x16dd7d(_0x513794[_0x636e('0x23')][_0x636e('0x25')]);}logger[_0x636e('0x23')](_0x636e('0x1e'),_0x228e14,_0x513794['error']['message']);return _0x12dc44(_0x513794[_0x636e('0x23')][_0x636e('0x25')]);}else{logger['info'](_0x636e('0x1e'),_0x228e14,_0x636e('0x1f'));_0x12dc44(_0x513794[_0x636e('0x26')][_0x636e('0x25')]);}})[_0x636e('0x27')](function(_0xa9453b){logger['error'](_0x636e('0x1e'),_0x228e14,_0xa9453b);_0x16dd7d(_0xa9453b);});});}function respondWithStatusCode(_0x523505,_0xd43a5b){_0xd43a5b=_0xd43a5b||0xcc;return function(_0x438ad4){if(_0x438ad4){return _0x523505[_0x636e('0x28')](_0xd43a5b);}return _0x523505[_0x636e('0x29')](_0xd43a5b)['end']();};}function respondWithResult(_0x250256,_0x1dad76){_0x1dad76=_0x1dad76||0xc8;return function(_0xbe62c5){if(_0xbe62c5){return _0x250256['status'](_0x1dad76)['json'](_0xbe62c5);}};}function respondWithFilteredResult(_0x7f871e,_0x509d62){return function(_0x3c9152){if(_0x3c9152){var _0x25dc8d=_0x3c9152[_0x636e('0x2a')],_0xf462f1=_0x509d62[_0x636e('0x2b')],_0x50918b=_0x509d62[_0x636e('0x2b')]+_0x509d62[_0x636e('0x2c')],_0x5658ba;if(_0x50918b>=_0x25dc8d){_0x50918b=_0x25dc8d;_0x5658ba=0xc8;}else{_0x5658ba=0xce;}_0x7f871e[_0x636e('0x29')](_0x5658ba);return _0x7f871e[_0x636e('0x2d')](_0x636e('0x2e'),_0xf462f1+'-'+_0x50918b+'/'+_0x25dc8d)[_0x636e('0x2f')](_0x3c9152);}return null;};}function patchUpdates(_0x35b234){return function(_0xae6adb){try{jsonpatch[_0x636e('0x30')](_0xae6adb,_0x35b234,!![]);}catch(_0x113ace){return BPromise[_0x636e('0x31')](_0x113ace);}return _0xae6adb[_0x636e('0x32')]();};}function saveUpdates(_0x29ef00,_0x4362bd){return function(_0x356dac){if(_0x356dac){return _0x356dac['update'](_0x29ef00)[_0x636e('0x33')](function(_0x2601b0){return _0x2601b0;});}return null;};}function removeEntity(_0x3e974b,_0x2a5ece){return function(_0x15e965){if(_0x15e965){return _0x15e965['destroy']()[_0x636e('0x33')](function(){_0x3e974b['status'](0xcc)[_0x636e('0x34')]();});}};}function handleEntityNotFound(_0x1b2c7a,_0x270b5f){return function(_0xf30790){if(!_0xf30790){_0x1b2c7a[_0x636e('0x28')](0x194);}return _0xf30790;};}function handleError(_0xbb5f09,_0x11adc2){_0x11adc2=_0x11adc2||0x1f4;return function(_0x1d60ea){logger[_0x636e('0x23')](_0x1d60ea[_0x636e('0x35')]);if(_0x1d60ea[_0x636e('0x36')]){delete _0x1d60ea[_0x636e('0x36')];}_0xbb5f09[_0x636e('0x29')](_0x11adc2)[_0x636e('0x37')](_0x1d60ea);};}exports[_0x636e('0x38')]=function(_0x300545,_0xfa8c7a){var _0x16f6f0={},_0x54a6f1={},_0x2ab630={'count':0x0,'rows':[]};var _0xf9b6c8=db[_0x636e('0x39')][_0x636e('0x3a')];_0x54a6f1[_0x636e('0x3b')]=_[_0x636e('0x3c')](_0xf9b6c8);_0x54a6f1[_0x636e('0x3d')]=_[_0x636e('0x3c')](_0x300545[_0x636e('0x3d')]);_0x54a6f1[_0x636e('0x3e')]=_['intersection'](_0x54a6f1[_0x636e('0x3b')],_0x54a6f1[_0x636e('0x3d')]);_0x16f6f0['attributes']=_[_0x636e('0x3f')](_0x54a6f1[_0x636e('0x3b')],qs['fields'](_0x300545[_0x636e('0x3d')][_0x636e('0x40')]));_0x16f6f0['attributes']=_0x16f6f0[_0x636e('0x41')]['length']?_0x16f6f0[_0x636e('0x41')]:_0x54a6f1[_0x636e('0x3b')];if(!_0x300545[_0x636e('0x3d')][_0x636e('0x42')]('nolimit')){_0x16f6f0['limit']=qs[_0x636e('0x2c')](_0x300545[_0x636e('0x3d')]['limit']);_0x16f6f0[_0x636e('0x2b')]=qs[_0x636e('0x2b')](_0x300545[_0x636e('0x3d')]['offset']);}_0x16f6f0[_0x636e('0x43')]=qs[_0x636e('0x44')](_0x300545[_0x636e('0x3d')][_0x636e('0x44')]);_0x16f6f0[_0x636e('0x45')]=qs[_0x636e('0x3e')](_[_0x636e('0x46')](_0x300545[_0x636e('0x3d')],_0x54a6f1[_0x636e('0x3e')]));if(_0x300545[_0x636e('0x3d')][_0x636e('0x47')]){_0x16f6f0[_0x636e('0x45')]=_[_0x636e('0x48')](_0x16f6f0['where'],{'$or':_[_0x636e('0x49')](_0xf9b6c8,function(_0x3f0340){if(_0x3f0340[_0x636e('0x4a')]['key']!==_0x636e('0x4b')){var _0x251eaf={};_0x251eaf[_0x3f0340[_0x636e('0x4c')]]={'$like':'%'+_0x300545[_0x636e('0x3d')]['filter']+'%'};return _0x251eaf;}})});}_0x16f6f0=_['merge']({},_0x16f6f0,_0x300545['options']);var _0x5c5d68={'where':_0x16f6f0[_0x636e('0x45')]};return db[_0x636e('0x39')][_0x636e('0x2a')](_0x5c5d68)['then'](function(_0x477f99){_0x2ab630[_0x636e('0x2a')]=_0x477f99;if(_0x300545[_0x636e('0x3d')]['includeAll']){_0x16f6f0[_0x636e('0x4d')]=[{'all':!![]}];}return db[_0x636e('0x39')][_0x636e('0x4e')](_0x16f6f0);})[_0x636e('0x33')](function(_0x2e4bf8){_0x2ab630['rows']=_0x2e4bf8;return _0x2ab630;})[_0x636e('0x33')](respondWithFilteredResult(_0xfa8c7a,_0x16f6f0))[_0x636e('0x27')](handleError(_0xfa8c7a,null));};exports[_0x636e('0x4f')]=function(_0x39dc0f,_0x17f326){var _0x16fe57={'raw':![],'where':{'id':_0x39dc0f[_0x636e('0x50')]['id']}},_0x1f29ca={};_0x1f29ca[_0x636e('0x3b')]=_[_0x636e('0x3c')](db[_0x636e('0x39')][_0x636e('0x3a')]);_0x1f29ca['query']=_['keys'](_0x39dc0f[_0x636e('0x3d')]);_0x1f29ca[_0x636e('0x3e')]=_[_0x636e('0x3f')](_0x1f29ca[_0x636e('0x3b')],_0x1f29ca[_0x636e('0x3d')]);_0x16fe57[_0x636e('0x41')]=_[_0x636e('0x3f')](_0x1f29ca[_0x636e('0x3b')],qs['fields'](_0x39dc0f[_0x636e('0x3d')]['fields']));_0x16fe57['attributes']=_0x16fe57[_0x636e('0x41')][_0x636e('0x51')]?_0x16fe57[_0x636e('0x41')]:_0x1f29ca[_0x636e('0x3b')];if(_0x39dc0f['query'][_0x636e('0x52')]){_0x16fe57[_0x636e('0x4d')]=[{'all':!![]}];}_0x16fe57=_[_0x636e('0x48')]({},_0x16fe57,_0x39dc0f['options']);return db['Setting']['find'](_0x16fe57)[_0x636e('0x33')](handleEntityNotFound(_0x17f326,null))[_0x636e('0x33')](respondWithResult(_0x17f326,null))[_0x636e('0x27')](handleError(_0x17f326,null));};exports[_0x636e('0x53')]=function(_0x306e63,_0x91bb7f,_0x2ebdca){var _0x2a9b3d;return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x306e63[_0x636e('0x50')]['id']}})['then'](handleEntityNotFound(_0x91bb7f,null))[_0x636e('0x33')](saveUpdates(_0x306e63[_0x636e('0x55')],null))[_0x636e('0x33')](function(_0xf03a11){if(_0xf03a11){_0x2a9b3d=_0xf03a11['get']({'plain':!![]});var _0x2be0eb=fs['readFileSync'](path[_0x636e('0x56')](config[_0x636e('0x57')],_0x636e('0x58')),'utf8');var _0x524184=ejs['render'](_0x2be0eb,_0x2a9b3d);var _0x27e1d3=fs[_0x636e('0x59')](path[_0x636e('0x56')](config[_0x636e('0x57')],_0x636e('0x5a')),_0x636e('0x5b'));var _0x2981cf=ejs['render'](_0x27e1d3,_0x2a9b3d);fs[_0x636e('0x5c')]('/etc/asterisk/stun_xcally.conf',_0x524184);fs[_0x636e('0x5c')](_0x636e('0x5d'),_0x2981cf);return respondWithRpcPromise(_0x636e('0x5e'),_0x636e('0x53'),{'module':'res_stun_monitor.so'});}})[_0x636e('0x33')](function(){return respondWithRpcPromise(_0x636e('0x5e'),_0x636e('0x53'),{'module':'res_rtp_asterisk.so'});})[_0x636e('0x33')](function(){return _0x2a9b3d||null;})[_0x636e('0x33')](respondWithResult(_0x91bb7f,null))[_0x636e('0x27')](handleError(_0x91bb7f,null));};exports[_0x636e('0x5f')]=function(_0x2de0db,_0x30f732,_0x42ec3b){if(_0x2de0db['file']&&_0x2de0db[_0x636e('0x60')]['filename']){_0x2de0db[_0x636e('0x55')][_0x636e('0x61')]=_0x2de0db[_0x636e('0x60')]['filename'];}return db[_0x636e('0x39')]['find']({'where':{'id':_0x2de0db['params']['id']}})[_0x636e('0x33')](handleEntityNotFound(_0x30f732,null))[_0x636e('0x33')](saveUpdates(_0x2de0db[_0x636e('0x55')],null))[_0x636e('0x33')](respondWithResult(_0x30f732,null))[_0x636e('0x27')](handleError(_0x30f732,null));};exports['addLogoLogin']=function(_0x12bca3,_0x165757,_0x275eb5){if(_0x12bca3[_0x636e('0x60')]&&_0x12bca3[_0x636e('0x60')][_0x636e('0x62')]){_0x12bca3[_0x636e('0x55')][_0x636e('0x63')]=_0x12bca3['file'][_0x636e('0x62')];}return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x12bca3[_0x636e('0x50')]['id']}})['then'](handleEntityNotFound(_0x165757,null))[_0x636e('0x33')](saveUpdates(_0x12bca3[_0x636e('0x55')],null))['then'](respondWithResult(_0x165757,null))[_0x636e('0x27')](handleError(_0x165757,null));};var utilLicense=require(_0x636e('0x64'));exports[_0x636e('0x65')]=function(_0x38045b,_0xfb64b4,_0x401164){var _0x16ed60=_0x636e('0x66');var _0x264798={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x2bb630){if(_0x2bb630){_0x264798=_0x2bb630;}return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x38045b['params']['id']},'attributes':[_0x636e('0x61'),_0x636e('0x63'),'preferred',_0x636e('0x67'),_0x636e('0x68'),_0x636e('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0xfb64b4,null))[_0x636e('0x33')](function(_0x10a3c6){if(_0x10a3c6){var _0x13a7dc=_0x10a3c6[_0x636e('0x61')]&&fs[_0x636e('0x6a')](path[_0x636e('0x56')](config['root'],_0x16ed60,_[_0x636e('0x6b')](_0x10a3c6[_0x636e('0x61')])))?path[_0x636e('0x56')](config[_0x636e('0x57')],_0x16ed60,_[_0x636e('0x6b')](_0x10a3c6[_0x636e('0x61')])):path['join'](config[_0x636e('0x57')],_0x16ed60,_[_0x636e('0x6b')](_0x636e('0x6c')));var _0x3fdb9c=_0x636e('0x6d')+_['upperFirst'](_0x636e('0x61'));if(_0x10a3c6[_0x3fdb9c]||!_0x264798[_0x636e('0x6e')]){_0x13a7dc=path[_0x636e('0x56')](config[_0x636e('0x57')],_0x16ed60,_[_0x636e('0x6b')](_0x636e('0x6c')));}if(!fs[_0x636e('0x6a')](_0x13a7dc)){throw new db['Sequelize'][(_0x636e('0x6f'))]('Logo\x20not\x20found');}return _0xfb64b4[_0x636e('0x70')](_0x13a7dc);}})['catch'](handleError(_0xfb64b4,null));};var utilLicense=require(_0x636e('0x64'));exports[_0x636e('0x71')]=function(_0xd4e11,_0xaddef2,_0xf80168){var _0x70510c=_0x636e('0x66');var _0x39d365={'custom':![]};return utilLicense['getLicense']()[_0x636e('0x33')](function(_0xcf51a6){if(_0xcf51a6){_0x39d365=_0xcf51a6;}return db['Setting'][_0x636e('0x54')]({'where':{'id':_0xd4e11[_0x636e('0x50')]['id']},'attributes':[_0x636e('0x61'),'loginLogo',_0x636e('0x72'),_0x636e('0x67'),_0x636e('0x68'),_0x636e('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0xaddef2,null))[_0x636e('0x33')](function(_0x41853c){if(_0x41853c){var _0x3bf6c0=_0x41853c['loginLogo']&&fs[_0x636e('0x6a')](path['join'](config['root'],_0x70510c,_[_0x636e('0x6b')](_0x41853c[_0x636e('0x63')])))?path[_0x636e('0x56')](config[_0x636e('0x57')],_0x70510c,_[_0x636e('0x6b')](_0x41853c[_0x636e('0x63')])):path[_0x636e('0x56')](config[_0x636e('0x57')],_0x70510c,_[_0x636e('0x6b')](_0x636e('0x73')));var _0x59ca15=_0x636e('0x6d')+_[_0x636e('0x74')]('loginLogo');if(_0x41853c[_0x59ca15]||!_0x39d365[_0x636e('0x6e')]){_0x3bf6c0=path[_0x636e('0x56')](config[_0x636e('0x57')],_0x70510c,_[_0x636e('0x6b')](_0x636e('0x73')));}if(!fs[_0x636e('0x6a')](_0x3bf6c0)){throw new db[(_0x636e('0x75'))][(_0x636e('0x6f'))](_0x636e('0x76'));}return _0xaddef2['download'](_0x3bf6c0);}})[_0x636e('0x27')](handleError(_0xaddef2,null));};exports['gdpr']=function(_0x28cd03,_0x4331de){return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x28cd03[_0x636e('0x50')]['id']},'attributes':[_0x636e('0x77')]})[_0x636e('0x33')](respondWithResult(_0x4331de,null))[_0x636e('0x27')](handleError(_0x4331de,null));};exports[_0x636e('0x78')]=function(_0x1a6efc,_0x31007a,_0xe96fcf){if(_0x1a6efc[_0x636e('0x60')]&&_0x1a6efc['file'][_0x636e('0x62')]){_0x1a6efc['body'][_0x636e('0x72')]=_0x1a6efc[_0x636e('0x60')]['filename'];}return db['Setting'][_0x636e('0x54')]({'where':{'id':_0x1a6efc[_0x636e('0x50')]['id']}})[_0x636e('0x33')](handleEntityNotFound(_0x31007a,null))[_0x636e('0x33')](saveUpdates(_0x1a6efc[_0x636e('0x55')],null))['then'](respondWithResult(_0x31007a,null))['catch'](handleError(_0x31007a,null));};var utilLicense=require(_0x636e('0x64'));exports[_0x636e('0x79')]=function(_0x6cdb99,_0x4a3245,_0x754c6d){var _0x26649b='server/files/images/logos';var _0x453825={'custom':![]};return utilLicense[_0x636e('0x7a')]()[_0x636e('0x33')](function(_0x3a967a){if(_0x3a967a){_0x453825=_0x3a967a;}return db[_0x636e('0x39')][_0x636e('0x54')]({'where':{'id':_0x6cdb99[_0x636e('0x50')]['id']},'attributes':[_0x636e('0x61'),_0x636e('0x63'),_0x636e('0x72'),'defaultLogo','defaultLoginLogo',_0x636e('0x69')],'raw':!![]});})['then'](handleEntityNotFound(_0x4a3245,null))[_0x636e('0x33')](function(_0x345ef3){if(_0x345ef3){var _0x4a55bd=_0x345ef3[_0x636e('0x72')]&&fs[_0x636e('0x6a')](path[_0x636e('0x56')](config[_0x636e('0x57')],_0x26649b,_[_0x636e('0x6b')](_0x345ef3['preferred'])))?path[_0x636e('0x56')](config['root'],_0x26649b,_[_0x636e('0x6b')](_0x345ef3[_0x636e('0x72')])):path['join'](config[_0x636e('0x57')],_0x26649b,_['toLower']('default_preferred.png'));var _0x130c10=_0x636e('0x6d')+_[_0x636e('0x74')](_0x636e('0x72'));if(_0x345ef3[_0x130c10]||!_0x453825[_0x636e('0x6e')]||!_0x453825[_0x636e('0x72')]){_0x4a55bd=path[_0x636e('0x56')](config[_0x636e('0x57')],_0x26649b,_[_0x636e('0x6b')](_0x636e('0x7b')));}if(!fs['existsSync'](_0x4a55bd)){throw new db['Sequelize'][(_0x636e('0x6f'))](_0x636e('0x76'));}return _0x4a3245['download'](_0x4a55bd);}})['catch'](handleError(_0x4a3245,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 2cb6c0f..f4bec14 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 _0x855b=['lodash','util','api','moment','bluebird','request-promise','rimraf','exports','Setting','settings'];(function(_0x26b2f2,_0x1cf7ad){var _0x46a2f8=function(_0x40f500){while(--_0x40f500){_0x26b2f2['push'](_0x26b2f2['shift']());}};_0x46a2f8(++_0x1cf7ad);}(_0x855b,0x10e));var _0xb855=function(_0x2891f3,_0x31e559){_0x2891f3=_0x2891f3-0x0;var _0x4b551f=_0x855b[_0x2891f3];return _0x4b551f;};'use strict';var _=require(_0xb855('0x0'));var util=require(_0xb855('0x1'));var logger=require('../../config/logger')(_0xb855('0x2'));var moment=require(_0xb855('0x3'));var BPromise=require(_0xb855('0x4'));var rp=require(_0xb855('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb855('0x6'));var config=require('../../config/environment');var attributes=require('./setting.attributes');module[_0xb855('0x7')]=function(_0x4a3d86,_0x36ef9c){return _0x4a3d86['define'](_0xb855('0x8'),attributes,{'tableName':_0xb855('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e40=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes','define','Setting','settings'];(function(_0x57e8e1,_0x6ad2c5){var _0x504ae0=function(_0x519cd7){while(--_0x519cd7){_0x57e8e1['push'](_0x57e8e1['shift']());}};_0x504ae0(++_0x6ad2c5);}(_0x5e40,0xd1));var _0x05e4=function(_0x1c546b,_0x304e8f){_0x1c546b=_0x1c546b-0x0;var _0x18398a=_0x5e40[_0x1c546b];return _0x18398a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x05e4('0x0'))('api');var moment=require(_0x05e4('0x1'));var BPromise=require(_0x05e4('0x2'));var rp=require(_0x05e4('0x3'));var fs=require('fs');var path=require(_0x05e4('0x4'));var rimraf=require(_0x05e4('0x5'));var config=require(_0x05e4('0x6'));var attributes=require(_0x05e4('0x7'));module['exports']=function(_0x47e8f6,_0x5a6190){return _0x47e8f6[_0x05e4('0x8')](_0x05e4('0x9'),attributes,{'tableName':_0x05e4('0xa'),'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 2de347f..0123f2a 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 _0xbf57=['request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x318ef0,_0x246230){var _0x19ff26=function(_0x2e7735){while(--_0x2e7735){_0x318ef0['push'](_0x318ef0['shift']());}};_0x19ff26(++_0x246230);}(_0xbf57,0x1bf));var _0x7bf5=function(_0x40123f,_0x39c2cc){_0x40123f=_0x40123f-0x0;var _0x50ddaf=_0xbf57[_0x40123f];return _0x50ddaf;};'use strict';var _=require('lodash');var util=require(_0x7bf5('0x0'));var moment=require('moment');var BPromise=require(_0x7bf5('0x1'));var rs=require(_0x7bf5('0x2'));var fs=require('fs');var Redis=require(_0x7bf5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bf5('0x4'));var logger=require(_0x7bf5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7bf5('0x6'));var client=jayson[_0x7bf5('0x7')][_0x7bf5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a488f,_0x4faa96,_0x279da0){return new BPromise(function(_0x493d38,_0x55e323){return client[_0x7bf5('0x9')](_0x5a488f,_0x279da0)[_0x7bf5('0xa')](function(_0x36e4b3){logger[_0x7bf5('0xb')](_0x7bf5('0xc'),_0x4faa96,_0x7bf5('0xd'));logger['debug'](_0x7bf5('0xe'),_0x4faa96,_0x7bf5('0xd'),JSON['stringify'](_0x36e4b3));if(_0x36e4b3['error']){if(_0x36e4b3[_0x7bf5('0xf')][_0x7bf5('0x10')]===0x1f4){logger[_0x7bf5('0xf')](_0x7bf5('0xc'),_0x4faa96,_0x36e4b3['error']['message']);return _0x55e323(_0x36e4b3['error'][_0x7bf5('0x11')]);}logger[_0x7bf5('0xf')]('Setting,\x20%s,\x20%s',_0x4faa96,_0x36e4b3[_0x7bf5('0xf')]['message']);return _0x493d38(_0x36e4b3['error']['message']);}else{logger[_0x7bf5('0xb')]('Setting,\x20%s,\x20%s',_0x4faa96,_0x7bf5('0xd'));_0x493d38(_0x36e4b3['result'][_0x7bf5('0x11')]);}})[_0x7bf5('0x12')](function(_0x47ec9e){logger[_0x7bf5('0xf')](_0x7bf5('0xc'),_0x4faa96,_0x47ec9e);_0x55e323(_0x47ec9e);});});} \ No newline at end of file +var _0xa258=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0xa258,0x155));var _0x8a25=function(_0x1d7487,_0x535d24){_0x1d7487=_0x1d7487-0x0;var _0xfbfd60=_0xa258[_0x1d7487];return _0xfbfd60;};'use strict';var _=require(_0x8a25('0x0'));var util=require(_0x8a25('0x1'));var moment=require(_0x8a25('0x2'));var BPromise=require(_0x8a25('0x3'));var rs=require(_0x8a25('0x4'));var fs=require('fs');var Redis=require(_0x8a25('0x5'));var db=require(_0x8a25('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8a25('0x7'))(_0x8a25('0x8'));var config=require(_0x8a25('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8a25('0xa')][_0x8a25('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3e64af,_0x3e1cec,_0x60b6bf){return new BPromise(function(_0x386256,_0x16a362){return client[_0x8a25('0xc')](_0x3e64af,_0x60b6bf)[_0x8a25('0xd')](function(_0x4c7125){logger[_0x8a25('0xe')](_0x8a25('0xf'),_0x3e1cec,_0x8a25('0x10'));logger[_0x8a25('0x11')]('Setting,\x20%s,\x20%s,\x20%s',_0x3e1cec,'request\x20sent',JSON[_0x8a25('0x12')](_0x4c7125));if(_0x4c7125[_0x8a25('0x13')]){if(_0x4c7125[_0x8a25('0x13')][_0x8a25('0x14')]===0x1f4){logger[_0x8a25('0x13')](_0x8a25('0xf'),_0x3e1cec,_0x4c7125[_0x8a25('0x13')][_0x8a25('0x15')]);return _0x16a362(_0x4c7125['error'][_0x8a25('0x15')]);}logger[_0x8a25('0x13')](_0x8a25('0xf'),_0x3e1cec,_0x4c7125['error'][_0x8a25('0x15')]);return _0x386256(_0x4c7125[_0x8a25('0x13')]['message']);}else{logger[_0x8a25('0xe')](_0x8a25('0xf'),_0x3e1cec,_0x8a25('0x10'));_0x386256(_0x4c7125[_0x8a25('0x16')][_0x8a25('0x15')]);}})[_0x8a25('0x17')](function(_0x31604f){logger['error'](_0x8a25('0xf'),_0x3e1cec,_0x31604f);_0x16a362(_0x31604f);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 8c1c968..c348471 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 _0x6cc1=['/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','/:id/users','create','post','addAnswer','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x320af8,_0x5eef12){var _0x35c4f3=function(_0xaff54c){while(--_0xaff54c){_0x320af8['push'](_0x320af8['shift']());}};_0x35c4f3(++_0x5eef12);}(_0x6cc1,0x126));var _0x16cc=function(_0x368e09,_0x2c1517){_0x368e09=_0x368e09-0x0;var _0x14b7df=_0x6cc1[_0x368e09];return _0x14b7df;};'use strict';var multer=require(_0x16cc('0x0'));var util=require(_0x16cc('0x1'));var path=require(_0x16cc('0x2'));var timeout=require(_0x16cc('0x3'));var express=require(_0x16cc('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x16cc('0x5'));var config=require(_0x16cc('0x6'));var controller=require(_0x16cc('0x7'));router[_0x16cc('0x8')]('/',auth[_0x16cc('0x9')](),controller[_0x16cc('0xa')]);router[_0x16cc('0x8')](_0x16cc('0xb'),auth[_0x16cc('0x9')](),controller[_0x16cc('0xc')]);router[_0x16cc('0x8')](_0x16cc('0xd'),auth[_0x16cc('0x9')](),controller[_0x16cc('0xe')]);router['get'](_0x16cc('0xf'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x10')]);router[_0x16cc('0x8')](_0x16cc('0x11'),auth[_0x16cc('0x9')](),controller['getAnswers']);router['get'](_0x16cc('0x12'),auth['isAuthenticated'](),controller[_0x16cc('0x13')]);router[_0x16cc('0x8')](_0x16cc('0x14'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x15')]);router[_0x16cc('0x8')](_0x16cc('0x16'),controller['statusGet']);router['get'](_0x16cc('0x17'),auth[_0x16cc('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x16cc('0x18')]);router[_0x16cc('0x19')](_0x16cc('0xf'),auth[_0x16cc('0x9')](),controller['addDisposition']);router[_0x16cc('0x19')](_0x16cc('0x11'),auth['isAuthenticated'](),controller[_0x16cc('0x1a')]);router[_0x16cc('0x19')]('/:id/notify',controller['notify']);router[_0x16cc('0x19')]('/:id/applications',auth[_0x16cc('0x9')](),controller['addApplications']);router[_0x16cc('0x19')](_0x16cc('0x1b'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x1c')]);router[_0x16cc('0x19')](_0x16cc('0x16'),controller[_0x16cc('0x1d')]);router[_0x16cc('0x19')](_0x16cc('0x17'),auth['isAuthenticated'](),controller[_0x16cc('0x1e')]);router[_0x16cc('0x1f')](_0x16cc('0xd'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x20')]);router[_0x16cc('0x21')](_0x16cc('0xd'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x22')]);router[_0x16cc('0x21')](_0x16cc('0xf'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x23')]);router[_0x16cc('0x21')](_0x16cc('0x11'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x24')]);router[_0x16cc('0x21')](_0x16cc('0x17'),auth[_0x16cc('0x9')](),controller[_0x16cc('0x25')]);module[_0x16cc('0x26')]=router; \ No newline at end of file +var _0xc9f7=['describe','get','/:id','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/canned_answers','notify','addApplications','/:id/send','send','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','/describe'];(function(_0xf60b0b,_0x2df608){var _0x21ec2a=function(_0x12d274){while(--_0x12d274){_0xf60b0b['push'](_0xf60b0b['shift']());}};_0x21ec2a(++_0x2df608);}(_0xc9f7,0x1e0));var _0x7c9f=function(_0x247408,_0x548427){_0x247408=_0x247408-0x0;var _0x74163b=_0xc9f7[_0x247408];return _0x74163b;};'use strict';var multer=require(_0x7c9f('0x0'));var util=require(_0x7c9f('0x1'));var path=require(_0x7c9f('0x2'));var timeout=require(_0x7c9f('0x3'));var express=require(_0x7c9f('0x4'));var router=express[_0x7c9f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7c9f('0x6'));var config=require('../../config/environment');var controller=require('./smsAccount.controller');router['get']('/',auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x8')]);router['get'](_0x7c9f('0x9'),auth['isAuthenticated'](),controller[_0x7c9f('0xa')]);router[_0x7c9f('0xb')](_0x7c9f('0xc'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x7c9f('0xb')]('/:id/canned_answers',auth[_0x7c9f('0x7')](),controller['getAnswers']);router['get'](_0x7c9f('0xd'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0xe')]);router[_0x7c9f('0xb')](_0x7c9f('0xf'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x10')]);router[_0x7c9f('0xb')](_0x7c9f('0x11'),controller[_0x7c9f('0x12')]);router[_0x7c9f('0xb')](_0x7c9f('0x13'),auth[_0x7c9f('0x7')](),controller['getAgents']);router['post']('/',auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x14')]);router[_0x7c9f('0x15')]('/:id/dispositions',auth[_0x7c9f('0x7')](),controller['addDisposition']);router[_0x7c9f('0x15')](_0x7c9f('0x16'),auth[_0x7c9f('0x7')](),controller['addAnswer']);router[_0x7c9f('0x15')]('/:id/notify',controller[_0x7c9f('0x17')]);router[_0x7c9f('0x15')](_0x7c9f('0xd'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x18')]);router[_0x7c9f('0x15')](_0x7c9f('0x19'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x1a')]);router[_0x7c9f('0x15')]('/:id/status',controller[_0x7c9f('0x1b')]);router[_0x7c9f('0x15')](_0x7c9f('0x13'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x1c')]);router[_0x7c9f('0x1d')](_0x7c9f('0xc'),auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x1e')]);router[_0x7c9f('0x1f')]('/:id',auth[_0x7c9f('0x7')](),controller[_0x7c9f('0x20')]);router[_0x7c9f('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x7c9f('0x21')]);router[_0x7c9f('0x1f')](_0x7c9f('0x16'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x7c9f('0x1f')]('/:id/users',auth[_0x7c9f('0x7')](),controller['removeAgents']);module[_0x7c9f('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 4afe90f..f3f6663 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 _0xf454=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','BOOLEAN'];(function(_0x43d198,_0x544ef4){var _0x3ed9cc=function(_0x339d26){while(--_0x339d26){_0x43d198['push'](_0x43d198['shift']());}};_0x3ed9cc(++_0x544ef4);}(_0xf454,0xee));var _0x4f45=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf454[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x4f45('0x0'));module[_0x4f45('0x1')]={'name':{'type':Sequelize[_0x4f45('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4f45('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x4f45('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x4f45('0x2')],'defaultValue':function(){return rs[_0x4f45('0x3')]();}},'phone':{'type':Sequelize[_0x4f45('0x2')]},'type':{'type':Sequelize[_0x4f45('0x4')](_0x4f45('0x5'),_0x4f45('0x6'),_0x4f45('0x7'),_0x4f45('0x8'),_0x4f45('0x9'),_0x4f45('0xa'),_0x4f45('0xb'),_0x4f45('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0x4f45('0x2')]},'authId':{'type':Sequelize[_0x4f45('0x2')]},'authToken':{'type':Sequelize[_0x4f45('0x2')]},'smsMethod':{'type':Sequelize[_0x4f45('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4f45('0x2')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x4f45('0x2')]},'deliveryReport':{'type':Sequelize[_0x4f45('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x4f45('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4f45('0xe')],'defaultValue':function(){return _0x4f45('0xf');}},'notificationSound':{'type':Sequelize[_0x4f45('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4f45('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4f45('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4f45('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4f45('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4f45('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4f45('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4f45('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x4f45('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x4f45('0xd')],'defaultValue':![],'comment':_0x4f45('0x12'),'set':function(_0x578d5a){if(!_0x578d5a)this['setDataValue'](_0x4f45('0x13'),null);this['setDataValue'](_0x4f45('0x14'),_0x578d5a);}}}; \ No newline at end of file +var _0x8c28=['intelepeer','BOOLEAN','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','STRING','name','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','csc'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x8c28,0x185));var _0x88c2=function(_0x4ed35d,_0x1ba6c8){_0x4ed35d=_0x4ed35d-0x0;var _0x3e1108=_0x8c28[_0x4ed35d];return _0x3e1108;};'use strict';var Sequelize=require(_0x88c2('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x88c2('0x1')],'unique':_0x88c2('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x88c2('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x88c2('0x1')],'defaultValue':function(){return rs[_0x88c2('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x88c2('0x4')](_0x88c2('0x5'),_0x88c2('0x6'),_0x88c2('0x7'),_0x88c2('0x8'),_0x88c2('0x9'),'clickatell',_0x88c2('0xa'),'infobip',_0x88c2('0xb'))},'accountSid':{'type':Sequelize[_0x88c2('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x88c2('0x1')]},'smsMethod':{'type':Sequelize[_0x88c2('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x88c2('0x1')]},'password':{'type':Sequelize[_0x88c2('0x1')]},'apiKey':{'type':Sequelize[_0x88c2('0x1')]},'senderString':{'type':Sequelize[_0x88c2('0x1')]},'deliveryReport':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x88c2('0xd');}},'notificationSound':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x88c2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x88c2('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x88c2('0xe')],'comment':_0x88c2('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x88c2('0xc')],'defaultValue':![],'comment':_0x88c2('0x10'),'set':function(_0x772c32){if(!_0x772c32)this[_0x88c2('0x11')](_0x88c2('0x12'),null);this[_0x88c2('0x11')](_0x88c2('0x13'),_0x772c32);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index bdb1099..6b40a53 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 _0x9d67=['body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','list','omit','contact','SmsInteraction','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','hasOwnProperty','User','Owner','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','spread','dataValues','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','limit','set','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','name','send','Pause','mandatoryDispositionPause','rawAttributes','model','keys','query','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','map','key','VIRTUAL','field','options','SmsAccount','count','include','findAll','rows','show','intersection','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getDispositions','findOne','Disposition','order','SmsAccountId','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','Applications','account','applications','orderBy','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','type','from','Body','messageId','MessageSid','skebby','sender','text','message_id','From','Text','MessageUUID','infobip','results','csc','originatingAddress','clickatell','intelepeer','refid','isNil','from\x20is\x20mandatory'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x9d67,0x130));var _0x79d6=function(_0x22815b,_0x47a268){_0x22815b=_0x22815b-0x0;var _0x5f42c7=_0x9d67[_0x22815b];return _0x5f42c7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x79d6('0x0'));var rimraf=require(_0x79d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x79d6('0x2'));var moment=require(_0x79d6('0x3'));var BPromise=require(_0x79d6('0x4'));var Mustache=require(_0x79d6('0x5'));var util=require(_0x79d6('0x6'));var path=require(_0x79d6('0x7'));var sox=require('sox');var csv=require(_0x79d6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x79d6('0x9'));var crypto=require(_0x79d6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x79d6('0xb'));var toCsv=require(_0x79d6('0x8'));var querystring=require(_0x79d6('0xc'));var Papa=require(_0x79d6('0xd'));var Redis=require(_0x79d6('0xe'));var authService=require(_0x79d6('0xf'));var qs=require(_0x79d6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x79d6('0x11'))(_0x79d6('0x12'));var utils=require(_0x79d6('0x13'));var config=require(_0x79d6('0x14'));var db=require(_0x79d6('0x15'))['db'];config['redis']=_[_0x79d6('0x16')](config[_0x79d6('0x17')],{'host':_0x79d6('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x79d6('0x19'))[_0x79d6('0x1a')](socket);var jayson=require(_0x79d6('0x1b'));var client=jayson[_0x79d6('0x1c')][_0x79d6('0x1d')]({'port':0x232c});function checkPasswordPattern(_0x2219d8,_0x4bfb3e,_0x2ef881){if(_0x2ef881){var _0x143e21=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x143e21['test'](_0x4bfb3e)){return _0x2219d8;}else{throw new Error(_0x79d6('0x1e'));}}else{return _0x2219d8;}}function respondWithRpcPromise(_0x3f9114,_0x3f8a0b,_0x31f44b,_0x4524a2){return new BPromise(function(_0x160a1e,_0x1edd10){var _0x2dae4b=_0x4524a2||client;return _0x2dae4b[_0x79d6('0x1f')](_0x3f9114,_0x31f44b)[_0x79d6('0x20')](function(_0x4cfef6){logger[_0x79d6('0x21')](_0x79d6('0x22'),_0x3f8a0b,_0x79d6('0x23'));logger[_0x79d6('0x24')](_0x79d6('0x25'),_0x3f8a0b,_0x79d6('0x23'),JSON[_0x79d6('0x26')](_0x4cfef6));if(_0x4cfef6[_0x79d6('0x27')]){if(_0x4cfef6['error'][_0x79d6('0x28')]===0x1f4){logger[_0x79d6('0x27')](_0x79d6('0x22'),_0x3f8a0b,_0x4cfef6[_0x79d6('0x27')][_0x79d6('0x29')]);return _0x1edd10(_0x4cfef6[_0x79d6('0x27')][_0x79d6('0x29')]);}logger[_0x79d6('0x27')]('SmsAccount,\x20%s,\x20%s',_0x3f8a0b,_0x4cfef6[_0x79d6('0x27')]['message']);return _0x160a1e(_0x4cfef6[_0x79d6('0x27')][_0x79d6('0x29')]);}else{logger[_0x79d6('0x21')](_0x79d6('0x22'),_0x3f8a0b,_0x79d6('0x23'));_0x160a1e(_0x4cfef6[_0x79d6('0x2a')][_0x79d6('0x29')]);}})[_0x79d6('0x2b')](function(_0x2b4f77){logger['error']('SmsAccount,\x20%s,\x20%s',_0x3f8a0b,_0x2b4f77);_0x1edd10(_0x2b4f77);});});}function respondWithStatusCode(_0x3a0ff1,_0x112b46){_0x112b46=_0x112b46||0xcc;return function(_0x43d152){if(_0x43d152){return _0x3a0ff1[_0x79d6('0x2c')](_0x112b46);}return _0x3a0ff1['status'](_0x112b46)[_0x79d6('0x2d')]();};}function respondWithResult(_0x5bbb42,_0x55f512){_0x55f512=_0x55f512||0xc8;return function(_0x5ad925){if(_0x5ad925){return _0x5bbb42[_0x79d6('0x2e')](_0x55f512)[_0x79d6('0x2f')](_0x5ad925);}};}function respondWithFilteredResult(_0x33a9c3,_0x3a2f0d){return function(_0x20347e){if(_0x20347e){var _0x5881e4=_0x20347e['count'],_0x521e6d=_0x3a2f0d[_0x79d6('0x30')],_0x2a14e7=_0x3a2f0d[_0x79d6('0x30')]+_0x3a2f0d[_0x79d6('0x31')],_0x59ccbc;if(_0x2a14e7>=_0x5881e4){_0x2a14e7=_0x5881e4;_0x59ccbc=0xc8;}else{_0x59ccbc=0xce;}_0x33a9c3['status'](_0x59ccbc);return _0x33a9c3[_0x79d6('0x32')]('Content-Range',_0x521e6d+'-'+_0x2a14e7+'/'+_0x5881e4)[_0x79d6('0x2f')](_0x20347e);}return null;};}function patchUpdates(_0x5ac038){return function(_0x46164f){try{jsonpatch[_0x79d6('0x33')](_0x46164f,_0x5ac038,!![]);}catch(_0x41ff51){return BPromise[_0x79d6('0x34')](_0x41ff51);}return _0x46164f['save']();};}function saveUpdates(_0x2227bd,_0x406dc8){return function(_0xf1718f){if(_0xf1718f){return _0xf1718f[_0x79d6('0x35')](_0x2227bd)[_0x79d6('0x20')](function(_0x415c40){return _0x415c40;});}return null;};}function removeEntity(_0x2fc035,_0x3927e2){return function(_0x47c847){if(_0x47c847){return _0x47c847[_0x79d6('0x36')]()[_0x79d6('0x20')](function(){var _0x2fc922=_0x47c847[_0x79d6('0x37')]({'plain':!![]});var _0x3d8cc9=_0x79d6('0x38');return db[_0x79d6('0x39')][_0x79d6('0x36')]({'where':{'type':_0x3d8cc9,'resourceId':_0x2fc922['id']}})[_0x79d6('0x20')](function(){return _0x47c847;});})[_0x79d6('0x20')](function(){_0x2fc035[_0x79d6('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3661e6,_0xd5b377){return function(_0x4e0eed){if(!_0x4e0eed){_0x3661e6[_0x79d6('0x2c')](0x194);}return _0x4e0eed;};}function handleError(_0x2b067c,_0x1dcc84){_0x1dcc84=_0x1dcc84||0x1f4;return function(_0x1929f7){logger[_0x79d6('0x27')](_0x1929f7['stack']);if(_0x1929f7[_0x79d6('0x3a')]){delete _0x1929f7[_0x79d6('0x3a')];}_0x2b067c[_0x79d6('0x2e')](_0x1dcc84)[_0x79d6('0x3b')](_0x1929f7);};}exports['index']=function(_0x276861,_0x319920){var _0x52af6f={'include':[{'model':db[_0x79d6('0x3c')],'as':_0x79d6('0x3d')}]},_0x14a70a={},_0x4d840f={'count':0x0,'rows':[]};var _0x5baae7=db['SmsAccount'][_0x79d6('0x3e')];_0x14a70a[_0x79d6('0x3f')]=_[_0x79d6('0x40')](_0x5baae7);_0x14a70a['query']=_['keys'](_0x276861['query']);_0x14a70a['filters']=_['intersection'](_0x14a70a['model'],_0x14a70a[_0x79d6('0x41')]);_0x52af6f[_0x79d6('0x42')]=_['intersection'](_0x14a70a[_0x79d6('0x3f')],qs[_0x79d6('0x43')](_0x276861[_0x79d6('0x41')][_0x79d6('0x43')]));_0x52af6f[_0x79d6('0x42')]=_0x52af6f['attributes'][_0x79d6('0x44')]?_0x52af6f[_0x79d6('0x42')]:_0x14a70a[_0x79d6('0x3f')];if(!_0x276861[_0x79d6('0x41')]['hasOwnProperty'](_0x79d6('0x45'))){_0x52af6f[_0x79d6('0x31')]=qs[_0x79d6('0x31')](_0x276861['query'][_0x79d6('0x31')]);_0x52af6f[_0x79d6('0x30')]=qs[_0x79d6('0x30')](_0x276861['query'][_0x79d6('0x30')]);}_0x52af6f['order']=qs[_0x79d6('0x46')](_0x276861[_0x79d6('0x41')]['sort']);_0x52af6f[_0x79d6('0x47')]=qs[_0x79d6('0x48')](_[_0x79d6('0x49')](_0x276861[_0x79d6('0x41')],_0x14a70a['filters']));if(_0x276861['query'][_0x79d6('0x4a')]){_0x52af6f[_0x79d6('0x47')]=_[_0x79d6('0x4b')](_0x52af6f['where'],{'$or':_[_0x79d6('0x4c')](_0x5baae7,function(_0x2bb855){if(_0x2bb855['type'][_0x79d6('0x4d')]!==_0x79d6('0x4e')){var _0x5d7e9c={};_0x5d7e9c[_0x2bb855[_0x79d6('0x4f')]]={'$like':'%'+_0x276861[_0x79d6('0x41')]['filter']+'%'};return _0x5d7e9c;}})});}_0x52af6f=_[_0x79d6('0x4b')]({},_0x52af6f,_0x276861[_0x79d6('0x50')]);var _0xa794e6={'where':_0x52af6f['where']};return db[_0x79d6('0x51')][_0x79d6('0x52')](_0xa794e6)[_0x79d6('0x20')](function(_0x50f665){_0x4d840f['count']=_0x50f665;if(_0x276861[_0x79d6('0x41')]['includeAll']){_0x52af6f[_0x79d6('0x53')]=[{'all':!![]}];}return db[_0x79d6('0x51')][_0x79d6('0x54')](_0x52af6f);})['then'](function(_0x2d0033){_0x4d840f[_0x79d6('0x55')]=_0x2d0033;return _0x4d840f;})[_0x79d6('0x20')](respondWithFilteredResult(_0x319920,_0x52af6f))[_0x79d6('0x2b')](handleError(_0x319920,null));};exports[_0x79d6('0x56')]=function(_0x175ea4,_0x1e448f){var _0x104e4a={'raw':![],'where':{'id':_0x175ea4['params']['id']},'include':[{'model':db['Pause'],'as':_0x79d6('0x3d')}]},_0x2a2db1={};_0x2a2db1[_0x79d6('0x3f')]=_[_0x79d6('0x40')](db[_0x79d6('0x51')][_0x79d6('0x3e')]);_0x2a2db1[_0x79d6('0x41')]=_[_0x79d6('0x40')](_0x175ea4[_0x79d6('0x41')]);_0x2a2db1[_0x79d6('0x48')]=_[_0x79d6('0x57')](_0x2a2db1['model'],_0x2a2db1['query']);_0x104e4a['attributes']=_['intersection'](_0x2a2db1['model'],qs['fields'](_0x175ea4[_0x79d6('0x41')]['fields']));_0x104e4a[_0x79d6('0x42')]=_0x104e4a['attributes'][_0x79d6('0x44')]?_0x104e4a[_0x79d6('0x42')]:_0x2a2db1[_0x79d6('0x3f')];if(_0x175ea4[_0x79d6('0x41')]['includeAll']){_0x104e4a[_0x79d6('0x53')]=[{'all':!![]}];}_0x104e4a=_[_0x79d6('0x4b')]({},_0x104e4a,_0x175ea4[_0x79d6('0x50')]);return db[_0x79d6('0x51')]['find'](_0x104e4a)[_0x79d6('0x20')](handleEntityNotFound(_0x1e448f,null))[_0x79d6('0x20')](respondWithResult(_0x1e448f,null))['catch'](handleError(_0x1e448f,null));};exports[_0x79d6('0x58')]=function(_0x13edc6,_0x277039){return db[_0x79d6('0x51')]['create'](_0x13edc6[_0x79d6('0x59')],{})[_0x79d6('0x20')](function(_0x387def){var _0x24babf=_0x13edc6[_0x79d6('0x5a')]['get']({'plain':!![]});if(!_0x24babf)throw new Error(_0x79d6('0x5b'));if(_0x24babf[_0x79d6('0x5c')]===_0x79d6('0x5a')){var _0x3085d1=_0x387def['get']({'plain':!![]});var _0x3bfcd2='SmsAccounts';return db[_0x79d6('0x5d')][_0x79d6('0x5e')]({'where':{'name':_0x3bfcd2,'userProfileId':_0x24babf['userProfileId']},'raw':!![]})['then'](function(_0x47b399){if(_0x47b399&&_0x47b399[_0x79d6('0x5f')]===0x0){return db[_0x79d6('0x39')][_0x79d6('0x58')]({'name':_0x3085d1[_0x79d6('0x3a')],'resourceId':_0x3085d1['id'],'type':_0x47b399[_0x79d6('0x3a')],'sectionId':_0x47b399['id']},{})['then'](function(){return _0x387def;});}else{return _0x387def;}})['catch'](function(_0x65ebc){logger[_0x79d6('0x27')](_0x79d6('0x60'),_0x65ebc);throw _0x65ebc;});}return _0x387def;})[_0x79d6('0x20')](respondWithResult(_0x277039,0xc9))[_0x79d6('0x2b')](handleError(_0x277039,null));};exports['update']=function(_0x5b467d,_0x4c2890){if(_0x5b467d[_0x79d6('0x59')]['id']){delete _0x5b467d[_0x79d6('0x59')]['id'];}return db['SmsAccount'][_0x79d6('0x5e')]({'where':{'id':_0x5b467d[_0x79d6('0x61')]['id']},'include':[{'model':db[_0x79d6('0x3c')],'as':'mandatoryDispositionPause'}]})[_0x79d6('0x20')](handleEntityNotFound(_0x4c2890,null))[_0x79d6('0x20')](saveUpdates(_0x5b467d[_0x79d6('0x59')],null))[_0x79d6('0x20')](respondWithResult(_0x4c2890,null))[_0x79d6('0x2b')](handleError(_0x4c2890,null));};exports[_0x79d6('0x36')]=function(_0x10dd7a,_0x19993f){return db['SmsAccount'][_0x79d6('0x5e')]({'where':{'id':_0x10dd7a[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x19993f,null))['then'](removeEntity(_0x19993f,null))['catch'](handleError(_0x19993f,null));};exports[_0x79d6('0x62')]=function(_0x434e40,_0x65a46){return db[_0x79d6('0x51')][_0x79d6('0x62')]()[_0x79d6('0x20')](respondWithResult(_0x65a46,null))['catch'](handleError(_0x65a46,null));};exports['addDisposition']=function(_0x11ccde,_0x5b693c,_0x548e40){if(_0x11ccde[_0x79d6('0x59')]['id']){delete _0x11ccde[_0x79d6('0x59')]['id'];}return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x11ccde[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x5b693c,null))[_0x79d6('0x20')](function(_0x402e5f){if(_0x402e5f){_0x11ccde[_0x79d6('0x59')]['SmsAccountId']=_0x402e5f['id'];return db['Disposition'][_0x79d6('0x58')](_0x11ccde[_0x79d6('0x59')]);}})[_0x79d6('0x20')](respondWithResult(_0x5b693c,null))['catch'](handleError(_0x5b693c,null));};exports[_0x79d6('0x63')]=function(_0x1e689d,_0x11ab65,_0xa044e4){var _0x446553={'raw':![],'where':{}};var _0x24ef65={};var _0x1ad196={'count':0x0,'rows':[]};return db[_0x79d6('0x51')][_0x79d6('0x64')]({'where':{'id':_0x1e689d[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x11ab65,null))['then'](function(_0x259572){if(_0x259572){_0x24ef65[_0x79d6('0x3f')]=_[_0x79d6('0x40')](db[_0x79d6('0x65')][_0x79d6('0x3e')]);_0x24ef65[_0x79d6('0x41')]=_[_0x79d6('0x40')](_0x1e689d[_0x79d6('0x41')]);_0x24ef65[_0x79d6('0x48')]=_[_0x79d6('0x57')](_0x24ef65['model'],_0x24ef65['query']);_0x446553[_0x79d6('0x42')]=_[_0x79d6('0x57')](_0x24ef65[_0x79d6('0x3f')],qs[_0x79d6('0x43')](_0x1e689d[_0x79d6('0x41')]['fields']));_0x446553[_0x79d6('0x42')]=_0x446553[_0x79d6('0x42')][_0x79d6('0x44')]?_0x446553[_0x79d6('0x42')]:_0x24ef65['model'];if(!_0x1e689d['query']['hasOwnProperty'](_0x79d6('0x45'))){_0x446553[_0x79d6('0x31')]=qs[_0x79d6('0x31')](_0x1e689d[_0x79d6('0x41')][_0x79d6('0x31')]);_0x446553[_0x79d6('0x30')]=qs[_0x79d6('0x30')](_0x1e689d[_0x79d6('0x41')][_0x79d6('0x30')]);}_0x446553[_0x79d6('0x66')]=qs[_0x79d6('0x46')](_0x1e689d[_0x79d6('0x41')][_0x79d6('0x46')]);_0x446553[_0x79d6('0x47')]=qs[_0x79d6('0x48')](_[_0x79d6('0x49')](_0x1e689d[_0x79d6('0x41')],_0x24ef65[_0x79d6('0x48')]));_0x446553['where'][_0x79d6('0x67')]=_0x259572['id'];if(_0x1e689d[_0x79d6('0x41')][_0x79d6('0x4a')]){_0x446553['where']=_[_0x79d6('0x4b')](_0x446553[_0x79d6('0x47')],{'$or':_[_0x79d6('0x4c')](_0x446553[_0x79d6('0x42')],function(_0x3cf957){var _0x14513c={};_0x14513c[_0x3cf957]={'$like':'%'+_0x1e689d['query']['filter']+'%'};return _0x14513c;})});}_0x446553=_[_0x79d6('0x4b')]({},_0x446553,_0x1e689d['options']);return db[_0x79d6('0x65')][_0x79d6('0x52')]({'where':_0x446553[_0x79d6('0x47')]})[_0x79d6('0x20')](function(_0xf253ba){_0x1ad196[_0x79d6('0x52')]=_0xf253ba;if(_0x1e689d[_0x79d6('0x41')][_0x79d6('0x68')]){_0x446553[_0x79d6('0x53')]=[{'all':!![]}];}return db[_0x79d6('0x65')][_0x79d6('0x54')](_0x446553);})['then'](function(_0x4d544c){_0x1ad196[_0x79d6('0x55')]=_0x4d544c;return _0x1ad196;});}})['then'](respondWithFilteredResult(_0x11ab65,_0x446553))[_0x79d6('0x2b')](handleError(_0x11ab65,null));};exports[_0x79d6('0x69')]=function(_0x28a58e,_0x34a5f6,_0x3c7927){return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x28a58e[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x34a5f6,null))[_0x79d6('0x20')](function(_0x37e682){if(_0x37e682){return _0x37e682[_0x79d6('0x69')](_0x28a58e['query'][_0x79d6('0x6a')]);}})['then'](respondWithStatusCode(_0x34a5f6,null))[_0x79d6('0x2b')](handleError(_0x34a5f6,null));};exports[_0x79d6('0x6b')]=function(_0x407986,_0x54a0b5,_0x4609d5){if(_0x407986['body']['id']){delete _0x407986[_0x79d6('0x59')]['id'];}return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x407986[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x54a0b5,null))[_0x79d6('0x20')](function(_0x90fcd0){if(_0x90fcd0){_0x407986[_0x79d6('0x59')]['SmsAccountId']=_0x90fcd0['id'];return db[_0x79d6('0x6c')][_0x79d6('0x58')](_0x407986[_0x79d6('0x59')]);}})[_0x79d6('0x20')](respondWithResult(_0x54a0b5,null))['catch'](handleError(_0x54a0b5,null));};exports[_0x79d6('0x6d')]=function(_0x184cda,_0x297c35,_0x17b232){var _0x20ad76={'raw':![],'where':{}};var _0xa9f0b9={};var _0x450c4f={'count':0x0,'rows':[]};return db[_0x79d6('0x51')][_0x79d6('0x64')]({'where':{'id':_0x184cda[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x297c35,null))['then'](function(_0x4677e2){if(_0x4677e2){_0xa9f0b9['model']=_[_0x79d6('0x40')](db[_0x79d6('0x6c')]['rawAttributes']);_0xa9f0b9[_0x79d6('0x41')]=_[_0x79d6('0x40')](_0x184cda[_0x79d6('0x41')]);_0xa9f0b9[_0x79d6('0x48')]=_[_0x79d6('0x57')](_0xa9f0b9[_0x79d6('0x3f')],_0xa9f0b9[_0x79d6('0x41')]);_0x20ad76[_0x79d6('0x42')]=_[_0x79d6('0x57')](_0xa9f0b9['model'],qs['fields'](_0x184cda[_0x79d6('0x41')][_0x79d6('0x43')]));_0x20ad76[_0x79d6('0x42')]=_0x20ad76['attributes'][_0x79d6('0x44')]?_0x20ad76[_0x79d6('0x42')]:_0xa9f0b9[_0x79d6('0x3f')];if(!_0x184cda['query']['hasOwnProperty']('nolimit')){_0x20ad76[_0x79d6('0x31')]=qs[_0x79d6('0x31')](_0x184cda['query']['limit']);_0x20ad76[_0x79d6('0x30')]=qs[_0x79d6('0x30')](_0x184cda['query'][_0x79d6('0x30')]);}_0x20ad76[_0x79d6('0x66')]=qs[_0x79d6('0x46')](_0x184cda['query'][_0x79d6('0x46')]);_0x20ad76[_0x79d6('0x47')]=qs['filters'](_[_0x79d6('0x49')](_0x184cda[_0x79d6('0x41')],_0xa9f0b9[_0x79d6('0x48')]));_0x20ad76[_0x79d6('0x47')][_0x79d6('0x67')]=_0x4677e2['id'];if(_0x184cda[_0x79d6('0x41')][_0x79d6('0x4a')]){_0x20ad76['where']=_[_0x79d6('0x4b')](_0x20ad76[_0x79d6('0x47')],{'$or':_['map'](_0x20ad76['attributes'],function(_0x16e99e){var _0x7bb3f9={};_0x7bb3f9[_0x16e99e]={'$like':'%'+_0x184cda['query'][_0x79d6('0x4a')]+'%'};return _0x7bb3f9;})});}_0x20ad76=_[_0x79d6('0x4b')]({},_0x20ad76,_0x184cda['options']);return db[_0x79d6('0x6c')]['count']({'where':_0x20ad76[_0x79d6('0x47')]})['then'](function(_0x5b2563){_0x450c4f[_0x79d6('0x52')]=_0x5b2563;if(_0x184cda[_0x79d6('0x41')][_0x79d6('0x68')]){_0x20ad76[_0x79d6('0x53')]=[{'all':!![]}];}return db[_0x79d6('0x6c')][_0x79d6('0x54')](_0x20ad76);})[_0x79d6('0x20')](function(_0x1379f9){_0x450c4f['rows']=_0x1379f9;return _0x450c4f;});}})[_0x79d6('0x20')](respondWithFilteredResult(_0x297c35,_0x20ad76))[_0x79d6('0x2b')](handleError(_0x297c35,null));};exports[_0x79d6('0x6e')]=function(_0x4c3bbb,_0x334c1f,_0x25c7b9){return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x4c3bbb['params']['id']}})['then'](handleEntityNotFound(_0x334c1f,null))['then'](function(_0x555ee3){if(_0x555ee3){return _0x555ee3['removeAnswers'](_0x4c3bbb[_0x79d6('0x41')][_0x79d6('0x6a')]);}})[_0x79d6('0x20')](respondWithStatusCode(_0x334c1f,null))[_0x79d6('0x2b')](handleError(_0x334c1f,null));};exports[_0x79d6('0x6f')]=function(_0x1a6648,_0x403636,_0x5dd45e){var _0x5ca4a0={'channel':'sms'};var _0x17eb34=[];var _0x507a7c=[];var _0x5cfa86={};return db[_0x79d6('0x51')]['find']({'where':{'id':_0x1a6648[_0x79d6('0x61')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x79d6('0x70')}]})['then'](handleEntityNotFound(_0x403636,null))[_0x79d6('0x20')](function(_0x55bd10){_0x5ca4a0[_0x79d6('0x71')]=_0x55bd10;_0x5ca4a0[_0x79d6('0x72')]=_[_0x79d6('0x73')](_0x55bd10['Applications'],['priority'],[_0x79d6('0x74')]);if(_0x5ca4a0[_0x79d6('0x71')]['Applications']){delete _0x5ca4a0[_0x79d6('0x71')][_0x79d6('0x70')];}return db['CmContact'][_0x79d6('0x62')]();})['then'](function(_0x43978a){if(!_0x43978a){throw new db[(_0x79d6('0x75'))][(_0x79d6('0x76'))](_0x79d6('0x77'));}_0x17eb34=_[_0x79d6('0x78')](_[_0x79d6('0x40')](_0x43978a),['createdAt',_0x79d6('0x79')]);_0x507a7c=_['difference'](_['keys'](_0x43978a),[_0x79d6('0x7a'),_0x79d6('0x79'),'CompanyId',_0x79d6('0x7b')]);_0x5ca4a0[_0x79d6('0x59')]={'mapKey':_0x79d6('0x7c')};if(_0x5ca4a0[_0x79d6('0x71')][_0x79d6('0x7d')]){switch(_0x5ca4a0[_0x79d6('0x71')][_0x79d6('0x7d')]){case'twilio':_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x7e')]=_0x1a6648[_0x79d6('0x59')]['From'];_0x5ca4a0['body'][_0x79d6('0x59')]=_0x1a6648['body'][_0x79d6('0x7f')];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x80')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x81')];break;case _0x79d6('0x82'):_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x7e')]='+'+_0x1a6648[_0x79d6('0x59')][_0x79d6('0x83')];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x59')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x84')];break;case'connectel':_0x5ca4a0['body']['from']=_0x1a6648['body'][_0x79d6('0x7e')];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x59')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x29')];break;case'clicksend':_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x7e')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x7e')];_0x5ca4a0['body']['body']=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x59')];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x80')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x85')];break;case'plivo':_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x7e')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x86')];_0x5ca4a0['body'][_0x79d6('0x59')]=_0x1a6648['body'][_0x79d6('0x87')];_0x5ca4a0[_0x79d6('0x59')]['messageId']=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x88')];break;case _0x79d6('0x89'):_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x7e')]='+'+_0x1a6648[_0x79d6('0x59')][_0x79d6('0x8a')][0x0][_0x79d6('0x7e')];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x59')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x8a')][0x0][_0x79d6('0x84')];_0x5ca4a0['body'][_0x79d6('0x80')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x8a')][0x0][_0x79d6('0x80')];break;case _0x79d6('0x8b'):_0x5ca4a0[_0x79d6('0x59')]['from']=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x8c')];_0x5ca4a0['body']['body']=_0x1a6648['body']['segmentedMessage'][_0x79d6('0x29')];break;case _0x79d6('0x8d'):_0x5ca4a0['body'][_0x79d6('0x7e')]=_0x1a6648[_0x79d6('0x59')]['fromNumber'];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x59')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x84')];_0x5ca4a0['body']['messageId']=_0x1a6648['body']['replyMessageId'];break;case _0x79d6('0x8e'):_0x5ca4a0[_0x79d6('0x59')]['from']=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x7e')];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x59')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x29')];_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x80')]=_0x1a6648[_0x79d6('0x59')][_0x79d6('0x8f')];break;}}if(_0x5ca4a0[_0x79d6('0x59')]['id']){delete _0x5ca4a0[_0x79d6('0x59')]['id'];}if(_[_0x79d6('0x90')](_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x7e')])){throw new db[(_0x79d6('0x75'))][(_0x79d6('0x76'))](_0x79d6('0x91'));}if(_[_0x79d6('0x90')](_0x5ca4a0['body'][_0x79d6('0x59')])||_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x59')]===''){throw new db['Sequelize'][(_0x79d6('0x76'))](_0x79d6('0x92'));}if(_[_0x79d6('0x90')](_0x5ca4a0['body'][_0x79d6('0x93')])){throw new db['Sequelize'][(_0x79d6('0x76'))](_0x79d6('0x94')+_0x507a7c);}if(!_[_0x79d6('0x95')](_0x507a7c,_0x5ca4a0[_0x79d6('0x59')]['mapKey'])){throw new db[(_0x79d6('0x75'))][(_0x79d6('0x76'))](_0x79d6('0x96')+_0x507a7c);}_0x5cfa86[_0x5ca4a0[_0x79d6('0x59')]['mapKey']]=_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x7e')];return db[_0x79d6('0x97')]['find']({'where':{'id':_0x5ca4a0[_0x79d6('0x71')][_0x79d6('0x7b')]},'include':[{'model':db[_0x79d6('0x98')],'as':_0x79d6('0x99'),'where':_0x5cfa86,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x79d6('0x20')](handleEntityNotFound(_0x403636,null))[_0x79d6('0x20')](function(_0x46bcb3){if(_0x46bcb3){_0x5ca4a0[_0x79d6('0x9a')]=_[_0x79d6('0x9b')](_0x46bcb3,[_0x79d6('0x99')]);if(_0x46bcb3[_0x79d6('0x99')][_0x79d6('0x44')]){return _0x46bcb3['Contacts'][0x0];}var _0x45d7fc=_['defaults'](_0x5ca4a0[_0x79d6('0x59')],{'firstName':_0x5ca4a0['body'][_0x79d6('0x7e')],'ListId':_0x46bcb3['id']});_0x45d7fc[_0x5ca4a0[_0x79d6('0x59')][_0x79d6('0x93')]]=_0x5ca4a0['body'][_0x79d6('0x7e')];return db[_0x79d6('0x98')]['create'](_0x45d7fc,{'fields':_0x17eb34,'raw':!![]});}})[_0x79d6('0x20')](handleEntityNotFound(_0x403636,null))['then'](function(_0x5c3ea5){if(_0x5c3ea5){_0x5ca4a0[_0x79d6('0x9c')]=_0x5c3ea5;var _0x2a542e={'ContactId':_0x5c3ea5['id'],'phone':_0x5ca4a0['body'][_0x79d6('0x7e')],'SmsAccountId':_0x1a6648[_0x79d6('0x61')]['id']};var _0x3d6511={'ContactId':_0x5c3ea5['id'],'SmsAccountId':_0x1a6648[_0x79d6('0x61')]['id'],'closed':![]};return db[_0x79d6('0x9d')][_0x79d6('0x5e')]({'where':_0x3d6511})[_0x79d6('0x20')](function(_0x151ae8){if(_0x151ae8){return[_0x151ae8,![]];}return db[_0x79d6('0x9d')]['create'](_0x2a542e)[_0x79d6('0x20')](function(_0x2351b5){return[_0x2351b5,!![]];});});}})['spread'](function(_0xabc27f,_0x380c21){_0x5ca4a0[_0x79d6('0x9e')]=_0xabc27f[_0x79d6('0x37')]({'plain':!![]});_0x5ca4a0[_0x79d6('0x9e')][_0x79d6('0x9f')]=![];if(_0x380c21){if(_0x5ca4a0[_0x79d6('0x71')][_0x79d6('0xa0')]){_0x5ca4a0['applications'][_0x79d6('0xa1')]({'id':0x0,'priority':_0x5ca4a0[_0x79d6('0x72')][_0x79d6('0x44')]+0x1,'app':_0x79d6('0xa2'),'appdata':'unmanaged','interval':_0x79d6('0xa3')});}_0x5ca4a0['interaction'][_0x79d6('0x9f')]=!![];}return db[_0x79d6('0xa4')]['create']({'phone':_0x5ca4a0[_0x79d6('0x59')]['from'],'messageId':_0x5ca4a0['body']['messageId'],'body':_0x5ca4a0[_0x79d6('0x59')]['body'],'SmsAccountId':_0x1a6648[_0x79d6('0x61')]['id'],'SmsInteractionId':_0xabc27f['id'],'direction':'in','ContactId':_0xabc27f[_0x79d6('0xa5')],'AttachmentId':_0x5ca4a0['body'][_0x79d6('0xa6')]});})[_0x79d6('0x20')](function(_0x98c58f){_0x5ca4a0['message']=_0x98c58f;if(_0x5ca4a0[_0x79d6('0x9e')][_0x79d6('0xa7')]){return db['User'][_0x79d6('0x5e')]({'attributes':['id','name'],'where':{'id':_0x5ca4a0[_0x79d6('0x9e')][_0x79d6('0xa7')]}})[_0x79d6('0x20')](function(_0x1f6327){if(_0x1f6327){_0x5ca4a0[_0x79d6('0x72')][_0x79d6('0xa8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1f6327[_0x79d6('0x3a')]+','+(_0x5ca4a0[_0x79d6('0x71')][_0x79d6('0xa9')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start','startRouting',_0x5ca4a0);});}return respondWithRpcPromise('Start',_0x79d6('0xaa'),_0x5ca4a0);})[_0x79d6('0x20')](function(_0x560066){if(_0x560066){var _0x4c5963=0xc8;var _0x40f214=_0x79d6('0xab');logger[_0x79d6('0x21')](_0x79d6('0x25'),_0x40f214,_0x4c5963,_0x79d6('0xac'));logger[_0x79d6('0x24')](_0x79d6('0xad'),_0x40f214,_0x4c5963,_0x79d6('0xac'),JSON[_0x79d6('0x26')](_0x560066));if(_0x5ca4a0[_0x79d6('0x71')]['type']===_0x79d6('0xae')){return _0x403636[_0x79d6('0x2e')](_0x4c5963)[_0x79d6('0x32')](_0x79d6('0xaf'),_0x79d6('0xb0'))['send'](_0x79d6('0xb1'));}else{return _0x403636[_0x79d6('0x2e')](_0x4c5963)[_0x79d6('0x2f')](_0x560066);}}})[_0x79d6('0x2b')](handleError(_0x403636,null));};exports[_0x79d6('0xb2')]=function(_0x177185,_0x41b05a,_0x2f707f){return db[_0x79d6('0x51')][_0x79d6('0x64')]({'where':{'id':_0x177185['params']['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x41b05a,null))[_0x79d6('0x20')](function(_0x1de67a){if(_0x1de67a){return db[_0x79d6('0xb3')][_0x79d6('0xb4')](function(_0x474f1c){return db[_0x79d6('0xb5')][_0x79d6('0x36')]({'where':{'SmsAccountId':_0x177185[_0x79d6('0x61')]['id']},'transaction':_0x474f1c})[_0x79d6('0x20')](function(_0x507789){var _0x284024=_[_0x79d6('0x4c')](_0x177185[_0x79d6('0x59')],function(_0x3deaee){_0x3deaee[_0x79d6('0x67')]=_0x177185['params']['id'];return _0x3deaee;});return db[_0x79d6('0xb5')][_0x79d6('0xb6')](_0x284024,{'transaction':_0x474f1c});});})[_0x79d6('0x20')](function(){return db[_0x79d6('0xb5')][_0x79d6('0xb7')]({'where':{'SmsAccountId':_0x177185[_0x79d6('0x61')]['id']},'order':_0x79d6('0xb8')});});}})[_0x79d6('0x20')](respondWithResult(_0x41b05a,null))[_0x79d6('0x2b')](handleError(_0x41b05a,null));};exports[_0x79d6('0xb9')]=function(_0x41aaa1,_0x335987,_0x27f04a){var _0x4e8a16={};var _0x2d8644={};var _0x207f37;var _0x41d3e6;return db[_0x79d6('0x51')][_0x79d6('0x64')]({'where':{'id':_0x41aaa1['params']['id']}})['then'](handleEntityNotFound(_0x335987,null))[_0x79d6('0x20')](function(_0x4d868d){if(_0x4d868d){_0x207f37=_0x4d868d;_0x2d8644[_0x79d6('0x3f')]=_[_0x79d6('0x40')](db[_0x79d6('0xb5')]['rawAttributes']);_0x2d8644['query']=_[_0x79d6('0x40')](_0x41aaa1[_0x79d6('0x41')]);_0x2d8644[_0x79d6('0x48')]=_[_0x79d6('0x57')](_0x2d8644['model'],_0x2d8644[_0x79d6('0x41')]);_0x4e8a16['attributes']=_[_0x79d6('0x57')](_0x2d8644[_0x79d6('0x3f')],qs[_0x79d6('0x43')](_0x41aaa1[_0x79d6('0x41')]['fields']));_0x4e8a16[_0x79d6('0x42')]=_0x4e8a16['attributes'][_0x79d6('0x44')]?_0x4e8a16[_0x79d6('0x42')]:_0x2d8644[_0x79d6('0x3f')];_0x4e8a16[_0x79d6('0x66')]=qs[_0x79d6('0x46')](_0x41aaa1[_0x79d6('0x41')][_0x79d6('0x46')]);_0x4e8a16[_0x79d6('0x47')]=qs[_0x79d6('0x48')](_[_0x79d6('0x49')](_0x41aaa1[_0x79d6('0x41')],_0x2d8644[_0x79d6('0x48')]));if(_0x41aaa1[_0x79d6('0x41')][_0x79d6('0x4a')]){_0x4e8a16[_0x79d6('0x47')]=_[_0x79d6('0x4b')](_0x4e8a16[_0x79d6('0x47')],{'$or':_[_0x79d6('0x4c')](_0x4e8a16['attributes'],function(_0x37d725){var _0x298b41={};_0x298b41[_0x37d725]={'$like':'%'+_0x41aaa1[_0x79d6('0x41')]['filter']+'%'};return _0x298b41;})});}_0x4e8a16=_['merge']({},_0x4e8a16,_0x41aaa1[_0x79d6('0x50')]);return _0x207f37[_0x79d6('0xb9')](_0x4e8a16);}})[_0x79d6('0x20')](function(_0x38dc6d){if(_0x38dc6d){_0x41d3e6=_0x38dc6d[_0x79d6('0x44')];if(!_0x41aaa1[_0x79d6('0x41')][_0x79d6('0xba')]('nolimit')){_0x4e8a16[_0x79d6('0x31')]=qs[_0x79d6('0x31')](_0x41aaa1[_0x79d6('0x41')][_0x79d6('0x31')]);_0x4e8a16['offset']=qs['offset'](_0x41aaa1[_0x79d6('0x41')][_0x79d6('0x30')]);}return _0x207f37[_0x79d6('0xb9')](_0x4e8a16);}})[_0x79d6('0x20')](function(_0x2d88cd){if(_0x2d88cd){return _0x2d88cd?{'count':_0x41d3e6,'rows':_0x2d88cd}:null;}})[_0x79d6('0x20')](respondWithResult(_0x335987,null))[_0x79d6('0x2b')](handleError(_0x335987,null));};exports['getInteractions']=function(_0x24a0dd,_0xebc0e1,_0x452794){var _0x39db92={'raw':![],'where':{}};var _0xea3bc1={};var _0x1050bf={'count':0x0,'rows':[]};return db[_0x79d6('0x51')][_0x79d6('0x64')]({'where':{'id':_0x24a0dd[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0xebc0e1,null))[_0x79d6('0x20')](function(_0x5ddecd){if(_0x5ddecd){_0xea3bc1[_0x79d6('0x3f')]=_[_0x79d6('0x40')](db[_0x79d6('0x9d')]['rawAttributes']);_0xea3bc1[_0x79d6('0x41')]=_[_0x79d6('0x40')](_0x24a0dd[_0x79d6('0x41')]);_0xea3bc1[_0x79d6('0x48')]=_[_0x79d6('0x57')](_0xea3bc1['model'],_0xea3bc1['query']);_0x39db92[_0x79d6('0x42')]=_['intersection'](_0xea3bc1['model'],qs[_0x79d6('0x43')](_0x24a0dd[_0x79d6('0x41')]['fields']));_0x39db92[_0x79d6('0x42')]=_0x39db92[_0x79d6('0x42')]['length']?_0x39db92[_0x79d6('0x42')]:_0xea3bc1[_0x79d6('0x3f')];if(!_0x24a0dd[_0x79d6('0x41')]['hasOwnProperty'](_0x79d6('0x45'))){_0x39db92[_0x79d6('0x31')]=qs['limit'](_0x24a0dd[_0x79d6('0x41')][_0x79d6('0x31')]);_0x39db92['offset']=qs[_0x79d6('0x30')](_0x24a0dd[_0x79d6('0x41')][_0x79d6('0x30')]);}_0x39db92[_0x79d6('0x66')]=qs['sort'](_0x24a0dd['query'][_0x79d6('0x46')]);_0x39db92['where']=qs['filters'](_['pick'](_0x24a0dd[_0x79d6('0x41')],_0xea3bc1[_0x79d6('0x48')]));_0x39db92['where']['SmsAccountId']=_0x5ddecd['id'];if(_0x24a0dd['query'][_0x79d6('0x4a')]){_0x39db92[_0x79d6('0x47')]=_[_0x79d6('0x4b')](_0x39db92['where'],{'$or':_[_0x79d6('0x4c')](_0x39db92['attributes'],function(_0x4f566f){var _0x35e153={};_0x35e153[_0x4f566f]={'$like':'%'+_0x24a0dd[_0x79d6('0x41')][_0x79d6('0x4a')]+'%'};return _0x35e153;})});}_0x39db92=_['merge']({},_0x39db92,_0x24a0dd[_0x79d6('0x50')]);return db[_0x79d6('0x9d')][_0x79d6('0x52')]({'where':_0x39db92[_0x79d6('0x47')]})[_0x79d6('0x20')](function(_0x5e0096){_0x1050bf['count']=_0x5e0096;if(_0x24a0dd[_0x79d6('0x41')][_0x79d6('0x68')]){_0x39db92[_0x79d6('0x53')]=[{'model':db[_0x79d6('0x98')],'as':'Contact','required':![]},{'model':db[_0x79d6('0xbb')],'as':_0x79d6('0xbc'),'attributes':[_0x79d6('0x3a'),_0x79d6('0xbd'),_0x79d6('0xbe')],'required':![]},{'model':db[_0x79d6('0xbf')],'as':_0x79d6('0xc0'),'attributes':['id',_0x79d6('0x3a'),_0x79d6('0xc1')],'where':_0x24a0dd[_0x79d6('0x41')][_0x79d6('0xc2')]?{'id':_0x24a0dd[_0x79d6('0x41')]['tag']}:undefined,'required':_0x24a0dd[_0x79d6('0x41')][_0x79d6('0xc2')]?!![]:![]}];}return db[_0x79d6('0x9d')][_0x79d6('0x54')](_0x39db92);})[_0x79d6('0x20')](function(_0x11a87){_0x1050bf[_0x79d6('0x55')]=_0x11a87;return _0x1050bf;});}})[_0x79d6('0x20')](respondWithFilteredResult(_0xebc0e1,_0x39db92))[_0x79d6('0x2b')](handleError(_0xebc0e1,null));};exports[_0x79d6('0x3b')]=function(_0x1ac611,_0x439355,_0x823f46){var _0x20e442,_0x88da92,_0x537f4e;if(_[_0x79d6('0x90')](_0x1ac611[_0x79d6('0x59')][_0x79d6('0x59')])||_0x1ac611[_0x79d6('0x59')][_0x79d6('0x59')]===''){throw new db['Sequelize']['ValidationError'](_0x79d6('0x92'));}if(_[_0x79d6('0x90')](_0x1ac611['body']['to'])){throw new db[(_0x79d6('0x75'))][(_0x79d6('0x76'))](_0x79d6('0xc3'));}_0x20e442=_0x1ac611['body']['to'];return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x1ac611['params']['id']},'include':[{'model':db[_0x79d6('0x97')],'as':_0x79d6('0xc4'),'include':[{'model':db[_0x79d6('0x98')],'as':_0x79d6('0x99'),'where':{'mobile':_0x20e442},'limit':0x1,'order':[[_0x79d6('0x79'),_0x79d6('0xc5')]]}]}]})[_0x79d6('0x20')](handleEntityNotFound(_0x439355,null))['then'](function(_0x424387){if(_0x424387&&_0x424387[_0x79d6('0xc4')]){_0x88da92=_0x424387['get']({'plain':!![]});if(_0x88da92[_0x79d6('0xc4')]&&_0x88da92[_0x79d6('0xc4')]['Contacts']['length']){return _0x88da92[_0x79d6('0xc4')][_0x79d6('0x99')][0x0];}return db[_0x79d6('0x98')][_0x79d6('0x58')](_[_0x79d6('0x16')](_0x1ac611['body'],{'firstName':_0x20e442,'mobile':_0x20e442,'phone':_0x20e442,'ListId':_0x88da92[_0x79d6('0x7b')]}));}})[_0x79d6('0x20')](handleEntityNotFound(_0x439355,null))['then'](function(_0x570118){if(_0x570118){_0x537f4e=_0x570118;return db[_0x79d6('0x9d')][_0x79d6('0x5e')]({'where':{'ContactId':_0x537f4e['id'],'closed':![],'SmsAccountId':_0x88da92['id']}})['then'](function(_0x1730ad){if(_0x1730ad){return[_0x1730ad,![]];}return db['SmsInteraction']['create']({'UserId':_0x1ac611[_0x79d6('0x5a')]['id'],'ContactId':_0x537f4e['id'],'SmsAccountId':_0x88da92['id'],'phone':_0x20e442,'firstMsgDirection':_0x79d6('0xc6'),'Messages':[_[_0x79d6('0x4b')](_0x1ac611[_0x79d6('0x59')],{'read':![],'body':_0x1ac611[_0x79d6('0x59')][_0x79d6('0x59')],'phone':_0x20e442,'SmsAccountId':_0x88da92['id'],'UserId':_0x1ac611[_0x79d6('0x5a')]['id'],'ContactId':_0x537f4e['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x79d6('0xc7')}]})[_0x79d6('0x20')](function(_0xbfcaca){return[_0xbfcaca,!![]];});});}})[_0x79d6('0xc8')](function(_0x2f274b,_0x4a400c){if(_0x4a400c){return _0x2f274b;}return db[_0x79d6('0xa4')][_0x79d6('0x58')](_[_0x79d6('0x4b')](_0x1ac611['body'],{'read':![],'body':_0x1ac611[_0x79d6('0x59')][_0x79d6('0x59')],'phone':_0x20e442,'SmsAccountId':_0x88da92['id'],'SmsInteractionId':_0x2f274b['id'],'UserId':_0x1ac611[_0x79d6('0x5a')]['id'],'ContactId':_0x537f4e['id']}))[_0x79d6('0x20')](function(_0x23adb0){_0x2f274b[_0x79d6('0xc9')][_0x79d6('0xc7')]=[];_0x2f274b[_0x79d6('0xc9')][_0x79d6('0xc7')][_0x79d6('0xa1')](_0x23adb0[_0x79d6('0xc9')]);return _0x2f274b;});})[_0x79d6('0x20')](respondWithResult(_0x439355,null))[_0x79d6('0x2b')](handleError(_0x439355,null));};exports[_0x79d6('0x2e')]=function(_0x21c060,_0x4d91df,_0x2e3e2a){if(_0x21c060[_0x79d6('0x59')]['id']){delete _0x21c060['body']['id'];}console[_0x79d6('0xca')](_0x79d6('0xcb'),_0x21c060[_0x79d6('0x59')]);var _0x55cbdd,_0x3925f6,_0x381d4c;return db['SmsAccount'][_0x79d6('0x5e')]({'where':{'id':_0x21c060[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x4d91df,null))[_0x79d6('0x20')](function(_0x5a8a29){if(_0x5a8a29){_0x381d4c=_0x5a8a29;logger['debug'](_0x79d6('0x25'),_0x79d6('0x2e'),_0x79d6('0xcc'),_0x5a8a29[_0x79d6('0x7d')],util[_0x79d6('0xcd')](_0x21c060[_0x79d6('0x59')],{'showHidden':![],'depth':null}));switch(_0x5a8a29[_0x79d6('0x7d')]){case'skebby':if(_0x21c060[_0x79d6('0x59')]['skebby_dispatch_id']&&_0x21c060[_0x79d6('0x59')]['status']){_0x3925f6=_0x21c060[_0x79d6('0x59')][_0x79d6('0x2e')];return db[_0x79d6('0xa4')]['find']({'where':{'messageId':_0x21c060[_0x79d6('0x59')][_0x79d6('0xce')]}});}break;case'connectel':if(_0x21c060[_0x79d6('0x59')][_0x79d6('0xcf')]&&_0x21c060['body'][_0x79d6('0xd0')]){_0x3925f6=_0x21c060['body'][_0x79d6('0xd0')];return db[_0x79d6('0xa4')]['find']({'where':{'messageId':_0x21c060[_0x79d6('0x59')]['requestid']}});}break;case _0x79d6('0xd1'):if(_0x21c060['body'][_0x79d6('0x85')]&&_0x21c060[_0x79d6('0x59')][_0x79d6('0xd2')]){_0x3925f6=_0x21c060[_0x79d6('0x59')][_0x79d6('0xd2')];return db['SmsMessage'][_0x79d6('0x5e')]({'where':{'messageId':_0x21c060[_0x79d6('0x59')][_0x79d6('0x85')]}});}break;case _0x79d6('0x89'):var _0x4bf1e2=_0x21c060[_0x79d6('0x59')][_0x79d6('0x8a')][0x0];if(_0x4bf1e2[_0x79d6('0x80')]&&_0x4bf1e2[_0x79d6('0x2e')][_0x79d6('0xd3')]===_0x79d6('0xd4')){_0x3925f6=_0x4bf1e2[_0x79d6('0x2e')][_0x79d6('0xd3')];return db[_0x79d6('0xa4')][_0x79d6('0x5e')]({'where':{'messageId':_0x4bf1e2['messageId']}});}break;case'clickatell':if(_0x21c060[_0x79d6('0x59')][_0x79d6('0x80')]&&_0x21c060['body'][_0x79d6('0x2e')]){_0x3925f6=_0x21c060['body'][_0x79d6('0x2e')];return db[_0x79d6('0xa4')][_0x79d6('0x5e')]({'where':{'messageId':_0x21c060[_0x79d6('0x59')][_0x79d6('0x80')]}});}break;case _0x79d6('0x8e'):if(_0x21c060[_0x79d6('0x59')]['redif']&&_0x21c060[_0x79d6('0x59')][_0x79d6('0x2e')]){_0x3925f6=_0x21c060['body'][_0x79d6('0x2e')];return db[_0x79d6('0xa4')][_0x79d6('0x5e')]({'where':{'messageId':_0x21c060[_0x79d6('0x59')]['redif']}});}break;}}})[_0x79d6('0x20')](handleEntityNotFound(_0x4d91df,null))[_0x79d6('0x20')](function(_0x1e8747){if(_0x1e8747){_0x55cbdd=_0x1e8747;switch(_0x381d4c[_0x79d6('0x7d')]){case'skebby':if(_0x3925f6==='DELIVERED'){return _0x55cbdd['update']({'read':!![]});}else{logger[_0x79d6('0x27')](_0x79d6('0x25'),_0x79d6('0x2e'),_0x79d6('0x82'),util[_0x79d6('0xcd')](_0x21c060[_0x79d6('0x59')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3925f6==='1'){return _0x55cbdd[_0x79d6('0x35')]({'read':!![]});}else{logger[_0x79d6('0x27')](_0x79d6('0x25'),_0x79d6('0x2e'),_0x79d6('0x82'),util[_0x79d6('0xcd')](_0x21c060[_0x79d6('0x59')],{'showHidden':![],'depth':null}));}break;case _0x79d6('0xd1'):if(!_0x21c060[_0x79d6('0x59')][_0x79d6('0xd5')]&&_0x3925f6>=0xc8&&_0x3925f6<=0xce){return _0x55cbdd['update']({'read':!![]});}else{logger['error'](_0x79d6('0x25'),_0x79d6('0x2e'),_0x79d6('0xd1'),util[_0x79d6('0xcd')](_0x21c060[_0x79d6('0x59')],{'showHidden':![],'depth':null}));}break;case _0x79d6('0x89'):var _0x21d404=_0x21c060['body'][_0x79d6('0x8a')][0x0];if(_0x21d404[_0x79d6('0x2e')][_0x79d6('0xd3')]===_0x79d6('0xd4')){return _0x55cbdd[_0x79d6('0x35')]({'read':!![]});}else{logger['error'](_0x79d6('0x25'),_0x79d6('0x2e'),_0x79d6('0x89'),util[_0x79d6('0xcd')](_0x21c060['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3925f6==_0x79d6('0xd6')||_0x3925f6==_0x79d6('0xd7')){return _0x55cbdd[_0x79d6('0x35')]({'read':!![]});}else{logger[_0x79d6('0x27')](_0x79d6('0x25'),'status',_0x79d6('0x8d'),util[_0x79d6('0xcd')](_0x21c060[_0x79d6('0x59')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3925f6==='DELIVRD'||_0x3925f6==='ACCEPTD'){return _0x55cbdd[_0x79d6('0x35')]({'read':!![]});}else{logger['error'](_0x79d6('0x25'),'status',_0x79d6('0x8e'),util[_0x79d6('0xcd')](_0x21c060[_0x79d6('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x55cbdd;}})[_0x79d6('0x20')](respondWithResult(_0x4d91df,null))['catch'](handleError(_0x4d91df,null));};exports[_0x79d6('0xd8')]=function(_0x4cbd55,_0x18f80a,_0x1e2149){var _0x5c0180,_0x557993,_0x1426d4;return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x4cbd55[_0x79d6('0x61')]['id']}})['then'](handleEntityNotFound(_0x18f80a,null))[_0x79d6('0x20')](function(_0x1819b5){if(_0x1819b5){_0x1426d4=_0x1819b5;logger[_0x79d6('0x24')](_0x79d6('0x25'),_0x79d6('0x2e'),_0x79d6('0xcc'),_0x1819b5[_0x79d6('0x7d')],util[_0x79d6('0xcd')](_0x4cbd55['query'],{'showHidden':![],'depth':null}));switch(_0x1819b5[_0x79d6('0x7d')]){case _0x79d6('0x8b'):if(_0x4cbd55[_0x79d6('0x41')]['message-id']&&_0x4cbd55['query'][_0x79d6('0xd9')]){_0x557993=_0x4cbd55['query'][_0x79d6('0xd9')];return db[_0x79d6('0xa4')]['find']({'where':{'messageId':_0x4cbd55[_0x79d6('0x41')][_0x79d6('0xda')]}});}break;}}})[_0x79d6('0x20')](handleEntityNotFound(_0x18f80a,null))[_0x79d6('0x20')](function(_0x53484a){if(_0x53484a){_0x5c0180=_0x53484a;switch(_0x1426d4[_0x79d6('0x7d')]){case _0x79d6('0x8b'):if(_0x557993==='2'||_0x557993==='6'){return _0x5c0180[_0x79d6('0x35')]({'read':!![]});}else{logger[_0x79d6('0x27')](_0x79d6('0x25'),_0x79d6('0x2e'),_0x79d6('0x8b'),util[_0x79d6('0xcd')](_0x4cbd55[_0x79d6('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x5c0180;}})[_0x79d6('0x20')](respondWithResult(_0x18f80a,null))[_0x79d6('0x2b')](handleError(_0x18f80a,null));};exports['addAgents']=function(_0x23fd2f,_0x2ecbe4,_0x44dd27){return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x23fd2f[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x2ecbe4,null))[_0x79d6('0x20')](function(_0xe905c5){if(_0xe905c5){return _0xe905c5[_0x79d6('0xdb')](_0x23fd2f['body'][_0x79d6('0x6a')],_[_0x79d6('0x9b')](_0x23fd2f[_0x79d6('0x59')],[_0x79d6('0x6a'),'id'])||{})[_0x79d6('0xc8')](function(_0x2f23fd){for(var _0x1fb13b=0x0;_0x1fb13b<_0x23fd2f[_0x79d6('0x59')][_0x79d6('0x6a')]['length'];_0x1fb13b+=0x1){socket[_0x79d6('0xdc')](_0x79d6('0xdd'),{'UserId':_0x23fd2f[_0x79d6('0x59')]['ids'][_0x1fb13b],'SmsAccountId':_0x23fd2f[_0x79d6('0x61')]['id']});}return _0x2f23fd;});}})[_0x79d6('0x20')](respondWithResult(_0x2ecbe4,null))[_0x79d6('0x2b')](handleError(_0x2ecbe4,null));};exports[_0x79d6('0xde')]=function(_0x34bfec,_0x12698a,_0x3867e2){return db[_0x79d6('0x51')][_0x79d6('0x5e')]({'where':{'id':_0x34bfec[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x12698a,null))[_0x79d6('0x20')](function(_0x2f80c1){if(_0x2f80c1){return _0x2f80c1[_0x79d6('0xde')](_0x34bfec[_0x79d6('0x41')][_0x79d6('0x6a')])[_0x79d6('0x20')](function(){if(_[_0x79d6('0xdf')](_0x34bfec['query'][_0x79d6('0x6a')])){for(var _0x54a2a1=0x0;_0x54a2a1<_0x34bfec[_0x79d6('0x41')][_0x79d6('0x6a')][_0x79d6('0x44')];_0x54a2a1+=0x1){socket[_0x79d6('0xdc')](_0x79d6('0xe0'),{'UserId':Number(_0x34bfec[_0x79d6('0x41')]['ids'][_0x54a2a1]),'SmsAccountId':Number(_0x34bfec[_0x79d6('0x61')]['id'])});}}else{socket[_0x79d6('0xdc')](_0x79d6('0xe0'),{'UserId':Number(_0x34bfec[_0x79d6('0x41')][_0x79d6('0x6a')]),'SmsAccountId':Number(_0x34bfec[_0x79d6('0x61')]['id'])});}});}})[_0x79d6('0x20')](respondWithStatusCode(_0x12698a,null))[_0x79d6('0x2b')](handleError(_0x12698a,null));};exports['getAgents']=function(_0x598674,_0x7f5498,_0x5017bc){var _0x1fd918={};var _0x187b81={};var _0x4e9d3f;var _0x33ff40;return db[_0x79d6('0x51')][_0x79d6('0x64')]({'where':{'id':_0x598674[_0x79d6('0x61')]['id']}})[_0x79d6('0x20')](handleEntityNotFound(_0x7f5498,null))['then'](function(_0x1798c5){if(_0x1798c5){_0x4e9d3f=_0x1798c5;_0x187b81[_0x79d6('0x3f')]=_[_0x79d6('0x40')](db[_0x79d6('0xbb')][_0x79d6('0x3e')]);_0x187b81['query']=_[_0x79d6('0x40')](_0x598674[_0x79d6('0x41')]);_0x187b81[_0x79d6('0x48')]=_[_0x79d6('0x57')](_0x187b81[_0x79d6('0x3f')],_0x187b81[_0x79d6('0x41')]);_0x1fd918[_0x79d6('0x42')]=_['intersection'](_0x187b81[_0x79d6('0x3f')],qs[_0x79d6('0x43')](_0x598674[_0x79d6('0x41')][_0x79d6('0x43')]));_0x1fd918[_0x79d6('0x42')]=_0x1fd918[_0x79d6('0x42')][_0x79d6('0x44')]?_0x1fd918['attributes']:_0x187b81[_0x79d6('0x3f')];_0x1fd918[_0x79d6('0x66')]=qs[_0x79d6('0x46')](_0x598674[_0x79d6('0x41')][_0x79d6('0x46')]);_0x1fd918[_0x79d6('0x47')]=qs['filters'](_[_0x79d6('0x49')](_0x598674['query'],_0x187b81[_0x79d6('0x48')]));if(_0x598674['query'][_0x79d6('0x4a')]){_0x1fd918[_0x79d6('0x47')]=_[_0x79d6('0x4b')](_0x1fd918[_0x79d6('0x47')],{'$or':_[_0x79d6('0x4c')](_0x1fd918['attributes'],function(_0x32be8a){var _0x5031de={};_0x5031de[_0x32be8a]={'$like':'%'+_0x598674['query'][_0x79d6('0x4a')]+'%'};return _0x5031de;})});}_0x1fd918=_[_0x79d6('0x4b')]({},_0x1fd918,_0x598674[_0x79d6('0x50')]);return _0x4e9d3f['getAgents'](_0x1fd918);}})[_0x79d6('0x20')](function(_0x885812){if(_0x885812){_0x33ff40=_0x885812[_0x79d6('0x44')];if(!_0x598674[_0x79d6('0x41')][_0x79d6('0xba')](_0x79d6('0x45'))){_0x1fd918[_0x79d6('0x31')]=qs['limit'](_0x598674['query'][_0x79d6('0x31')]);_0x1fd918[_0x79d6('0x30')]=qs[_0x79d6('0x30')](_0x598674[_0x79d6('0x41')]['offset']);}return _0x4e9d3f['getAgents'](_0x1fd918);}})[_0x79d6('0x20')](function(_0x2bcded){if(_0x2bcded){return _0x2bcded?{'count':_0x33ff40,'rows':_0x2bcded}:null;}})[_0x79d6('0x20')](respondWithResult(_0x7f5498,null))[_0x79d6('0x2b')](handleError(_0x7f5498,null));}; \ No newline at end of file +var _0x63ea=['inspect','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','http','test','request','then','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','keys','query','model','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','intersection','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','params','describe','addDisposition','SmsAccountId','Disposition','order','removeDispositions','CannedAnswer','getAnswers','findOne','hasOwnProperty','removeAnswers','ids','sms','SmsApplication','Applications','orderBy','priority','account','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','message_id','plivo','MessageUUID','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','isNil','Sequelize','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','interaction','created','applications','push','unmanaged','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','send','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','List','spread','dataValues','Messages','log','skebby_dispatch_id','connectel','statusInt','requestid','clicksend','status_code','infobip','DELIVERED','groupName'];(function(_0x384eb9,_0x36a714){var _0x1cae55=function(_0x41f31d){while(--_0x41f31d){_0x384eb9['push'](_0x384eb9['shift']());}};_0x1cae55(++_0x36a714);}(_0x63ea,0x1d0));var _0xa63e=function(_0x549844,_0x1eee6){_0x549844=_0x549844-0x0;var _0x2d6928=_0x63ea[_0x549844];return _0x2d6928;};'use strict';var pdf=require(_0xa63e('0x0'));var emlformat=require(_0xa63e('0x1'));var rimraf=require(_0xa63e('0x2'));var zipdir=require(_0xa63e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa63e('0x4'));var moment=require('moment');var BPromise=require(_0xa63e('0x5'));var Mustache=require(_0xa63e('0x6'));var util=require('util');var path=require(_0xa63e('0x7'));var sox=require('sox');var csv=require(_0xa63e('0x8'));var ejs=require(_0xa63e('0x9'));var fs=require('fs');var _=require(_0xa63e('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa63e('0xb'));var deskjs=require(_0xa63e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa63e('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa63e('0xe'));var qs=require(_0xa63e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa63e('0x10'))(_0xa63e('0x11'));var utils=require(_0xa63e('0x12'));var config=require('../../config/environment');var db=require(_0xa63e('0x13'))['db'];config['redis']=_[_0xa63e('0x14')](config[_0xa63e('0x15')],{'host':_0xa63e('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa63e('0x17'))[_0xa63e('0x18')](socket);var jayson=require(_0xa63e('0x19'));var client=jayson[_0xa63e('0x1a')][_0xa63e('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x331ef2,_0x1b5e95,_0x40b1a6){if(_0x40b1a6){var _0xe4aa87=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe4aa87[_0xa63e('0x1c')](_0x1b5e95)){return _0x331ef2;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x331ef2;}}function respondWithRpcPromise(_0x1d8244,_0x428d23,_0x192bc6,_0xd18831){return new BPromise(function(_0x518279,_0xb0f179){var _0xe98864=_0xd18831||client;return _0xe98864[_0xa63e('0x1d')](_0x1d8244,_0x192bc6)[_0xa63e('0x1e')](function(_0x2e57fe){logger['info'](_0xa63e('0x1f'),_0x428d23,'request\x20sent');logger[_0xa63e('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x428d23,_0xa63e('0x21'),JSON[_0xa63e('0x22')](_0x2e57fe));if(_0x2e57fe['error']){if(_0x2e57fe['error'][_0xa63e('0x23')]===0x1f4){logger['error'](_0xa63e('0x1f'),_0x428d23,_0x2e57fe[_0xa63e('0x24')][_0xa63e('0x25')]);return _0xb0f179(_0x2e57fe[_0xa63e('0x24')]['message']);}logger[_0xa63e('0x24')](_0xa63e('0x1f'),_0x428d23,_0x2e57fe[_0xa63e('0x24')]['message']);return _0x518279(_0x2e57fe[_0xa63e('0x24')][_0xa63e('0x25')]);}else{logger[_0xa63e('0x26')](_0xa63e('0x1f'),_0x428d23,'request\x20sent');_0x518279(_0x2e57fe[_0xa63e('0x27')]['message']);}})[_0xa63e('0x28')](function(_0x3ce648){logger[_0xa63e('0x24')](_0xa63e('0x1f'),_0x428d23,_0x3ce648);_0xb0f179(_0x3ce648);});});}function respondWithStatusCode(_0x10bf71,_0x255c60){_0x255c60=_0x255c60||0xcc;return function(_0xae9b39){if(_0xae9b39){return _0x10bf71[_0xa63e('0x29')](_0x255c60);}return _0x10bf71[_0xa63e('0x2a')](_0x255c60)[_0xa63e('0x2b')]();};}function respondWithResult(_0x3c9791,_0x1c65a1){_0x1c65a1=_0x1c65a1||0xc8;return function(_0x37fb5f){if(_0x37fb5f){return _0x3c9791['status'](_0x1c65a1)[_0xa63e('0x2c')](_0x37fb5f);}};}function respondWithFilteredResult(_0x3dad59,_0x131851){return function(_0x44cec6){if(_0x44cec6){var _0x38b23c=_0x44cec6[_0xa63e('0x2d')],_0x4ea500=_0x131851[_0xa63e('0x2e')],_0x2129cf=_0x131851['offset']+_0x131851[_0xa63e('0x2f')],_0xf71642;if(_0x2129cf>=_0x38b23c){_0x2129cf=_0x38b23c;_0xf71642=0xc8;}else{_0xf71642=0xce;}_0x3dad59['status'](_0xf71642);return _0x3dad59[_0xa63e('0x30')](_0xa63e('0x31'),_0x4ea500+'-'+_0x2129cf+'/'+_0x38b23c)[_0xa63e('0x2c')](_0x44cec6);}return null;};}function patchUpdates(_0x568b42){return function(_0x28c02b){try{jsonpatch[_0xa63e('0x32')](_0x28c02b,_0x568b42,!![]);}catch(_0x2d7b58){return BPromise['reject'](_0x2d7b58);}return _0x28c02b[_0xa63e('0x33')]();};}function saveUpdates(_0x4c460d,_0x422273){return function(_0x3e16fe){if(_0x3e16fe){return _0x3e16fe[_0xa63e('0x34')](_0x4c460d)[_0xa63e('0x1e')](function(_0x3dd324){return _0x3dd324;});}return null;};}function removeEntity(_0x2b57c9,_0x9c015a){return function(_0x4557e9){if(_0x4557e9){return _0x4557e9[_0xa63e('0x35')]()[_0xa63e('0x1e')](function(){var _0x21b462=_0x4557e9[_0xa63e('0x36')]({'plain':!![]});var _0x3ddad9=_0xa63e('0x37');return db[_0xa63e('0x38')][_0xa63e('0x35')]({'where':{'type':_0x3ddad9,'resourceId':_0x21b462['id']}})['then'](function(){return _0x4557e9;});})[_0xa63e('0x1e')](function(){_0x2b57c9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x131715,_0x3d054e){return function(_0x8e588b){if(!_0x8e588b){_0x131715[_0xa63e('0x29')](0x194);}return _0x8e588b;};}function handleError(_0x5606b4,_0x58acea){_0x58acea=_0x58acea||0x1f4;return function(_0x5c95fa){logger[_0xa63e('0x24')](_0x5c95fa[_0xa63e('0x39')]);if(_0x5c95fa[_0xa63e('0x3a')]){delete _0x5c95fa[_0xa63e('0x3a')];}_0x5606b4[_0xa63e('0x2a')](_0x58acea)['send'](_0x5c95fa);};}exports[_0xa63e('0x3b')]=function(_0x1c84fa,_0x410146){var _0x7bc704={'include':[{'model':db[_0xa63e('0x3c')],'as':_0xa63e('0x3d')}]},_0x420a6e={},_0x3ac5b9={'count':0x0,'rows':[]};var _0x546c99=db[_0xa63e('0x3e')][_0xa63e('0x3f')];_0x420a6e['model']=_[_0xa63e('0x40')](_0x546c99);_0x420a6e[_0xa63e('0x41')]=_['keys'](_0x1c84fa[_0xa63e('0x41')]);_0x420a6e['filters']=_['intersection'](_0x420a6e['model'],_0x420a6e['query']);_0x7bc704['attributes']=_['intersection'](_0x420a6e[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x43')]));_0x7bc704[_0xa63e('0x44')]=_0x7bc704[_0xa63e('0x44')]['length']?_0x7bc704[_0xa63e('0x44')]:_0x420a6e[_0xa63e('0x42')];if(!_0x1c84fa['query']['hasOwnProperty'](_0xa63e('0x45'))){_0x7bc704['limit']=qs[_0xa63e('0x2f')](_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x7bc704[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x1c84fa['query'][_0xa63e('0x2e')]);}_0x7bc704['order']=qs[_0xa63e('0x46')](_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x46')]);_0x7bc704[_0xa63e('0x47')]=qs[_0xa63e('0x48')](_[_0xa63e('0x49')](_0x1c84fa[_0xa63e('0x41')],_0x420a6e['filters']));if(_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x7bc704[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x7bc704[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x546c99,function(_0x27d03d){if(_0x27d03d[_0xa63e('0x4d')][_0xa63e('0x4e')]!=='VIRTUAL'){var _0x45ddc1={};_0x45ddc1[_0x27d03d[_0xa63e('0x4f')]]={'$like':'%'+_0x1c84fa[_0xa63e('0x41')][_0xa63e('0x4a')]+'%'};return _0x45ddc1;}})});}_0x7bc704=_[_0xa63e('0x4b')]({},_0x7bc704,_0x1c84fa[_0xa63e('0x50')]);var _0x2b6551={'where':_0x7bc704[_0xa63e('0x47')]};return db[_0xa63e('0x3e')][_0xa63e('0x2d')](_0x2b6551)[_0xa63e('0x1e')](function(_0x156c5e){_0x3ac5b9[_0xa63e('0x2d')]=_0x156c5e;if(_0x1c84fa['query'][_0xa63e('0x51')]){_0x7bc704[_0xa63e('0x52')]=[{'all':!![]}];}return db[_0xa63e('0x3e')][_0xa63e('0x53')](_0x7bc704);})[_0xa63e('0x1e')](function(_0x8e0d16){_0x3ac5b9[_0xa63e('0x54')]=_0x8e0d16;return _0x3ac5b9;})[_0xa63e('0x1e')](respondWithFilteredResult(_0x410146,_0x7bc704))[_0xa63e('0x28')](handleError(_0x410146,null));};exports[_0xa63e('0x55')]=function(_0x5a6a71,_0x4d1ffa){var _0x4d9c7f={'raw':![],'where':{'id':_0x5a6a71['params']['id']},'include':[{'model':db[_0xa63e('0x3c')],'as':_0xa63e('0x3d')}]},_0x5b0fe4={};_0x5b0fe4[_0xa63e('0x42')]=_[_0xa63e('0x40')](db['SmsAccount']['rawAttributes']);_0x5b0fe4[_0xa63e('0x41')]=_[_0xa63e('0x40')](_0x5a6a71[_0xa63e('0x41')]);_0x5b0fe4[_0xa63e('0x48')]=_[_0xa63e('0x56')](_0x5b0fe4['model'],_0x5b0fe4[_0xa63e('0x41')]);_0x4d9c7f[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x5b0fe4['model'],qs['fields'](_0x5a6a71[_0xa63e('0x41')][_0xa63e('0x43')]));_0x4d9c7f['attributes']=_0x4d9c7f[_0xa63e('0x44')][_0xa63e('0x57')]?_0x4d9c7f[_0xa63e('0x44')]:_0x5b0fe4[_0xa63e('0x42')];if(_0x5a6a71['query'][_0xa63e('0x51')]){_0x4d9c7f[_0xa63e('0x52')]=[{'all':!![]}];}_0x4d9c7f=_[_0xa63e('0x4b')]({},_0x4d9c7f,_0x5a6a71['options']);return db[_0xa63e('0x3e')]['find'](_0x4d9c7f)['then'](handleEntityNotFound(_0x4d1ffa,null))[_0xa63e('0x1e')](respondWithResult(_0x4d1ffa,null))[_0xa63e('0x28')](handleError(_0x4d1ffa,null));};exports[_0xa63e('0x58')]=function(_0x24ed2f,_0x2728c7){return db[_0xa63e('0x3e')]['create'](_0x24ed2f[_0xa63e('0x59')],{})[_0xa63e('0x1e')](function(_0x248a2e){var _0x6423a2=_0x24ed2f[_0xa63e('0x5a')][_0xa63e('0x36')]({'plain':!![]});if(!_0x6423a2)throw new Error(_0xa63e('0x5b'));if(_0x6423a2['role']===_0xa63e('0x5a')){var _0xd7b85a=_0x248a2e[_0xa63e('0x36')]({'plain':!![]});var _0x1792b9=_0xa63e('0x37');return db[_0xa63e('0x5c')][_0xa63e('0x5d')]({'where':{'name':_0x1792b9,'userProfileId':_0x6423a2[_0xa63e('0x5e')]},'raw':!![]})['then'](function(_0x27fb42){if(_0x27fb42&&_0x27fb42['autoAssociation']===0x0){return db[_0xa63e('0x38')]['create']({'name':_0xd7b85a[_0xa63e('0x3a')],'resourceId':_0xd7b85a['id'],'type':_0x27fb42[_0xa63e('0x3a')],'sectionId':_0x27fb42['id']},{})['then'](function(){return _0x248a2e;});}else{return _0x248a2e;}})[_0xa63e('0x28')](function(_0x507942){logger[_0xa63e('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x507942);throw _0x507942;});}return _0x248a2e;})[_0xa63e('0x1e')](respondWithResult(_0x2728c7,0xc9))[_0xa63e('0x28')](handleError(_0x2728c7,null));};exports[_0xa63e('0x34')]=function(_0x44e2ce,_0x7bffc1){if(_0x44e2ce['body']['id']){delete _0x44e2ce['body']['id'];}return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x44e2ce[_0xa63e('0x5f')]['id']},'include':[{'model':db[_0xa63e('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x7bffc1,null))['then'](saveUpdates(_0x44e2ce[_0xa63e('0x59')],null))['then'](respondWithResult(_0x7bffc1,null))[_0xa63e('0x28')](handleError(_0x7bffc1,null));};exports[_0xa63e('0x35')]=function(_0x4283a7,_0x244c59){return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x4283a7[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x244c59,null))[_0xa63e('0x1e')](removeEntity(_0x244c59,null))[_0xa63e('0x28')](handleError(_0x244c59,null));};exports[_0xa63e('0x60')]=function(_0x7a2b14,_0x566283){return db[_0xa63e('0x3e')][_0xa63e('0x60')]()[_0xa63e('0x1e')](respondWithResult(_0x566283,null))[_0xa63e('0x28')](handleError(_0x566283,null));};exports[_0xa63e('0x61')]=function(_0x234f03,_0x4850c6,_0x15ba20){if(_0x234f03['body']['id']){delete _0x234f03[_0xa63e('0x59')]['id'];}return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x234f03[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x4850c6,null))['then'](function(_0x106b23){if(_0x106b23){_0x234f03['body'][_0xa63e('0x62')]=_0x106b23['id'];return db[_0xa63e('0x63')][_0xa63e('0x58')](_0x234f03[_0xa63e('0x59')]);}})[_0xa63e('0x1e')](respondWithResult(_0x4850c6,null))['catch'](handleError(_0x4850c6,null));};exports['getDispositions']=function(_0x285264,_0x49b05e,_0x51387a){var _0x338de4={'raw':![],'where':{}};var _0x2236ac={};var _0xf6118f={'count':0x0,'rows':[]};return db[_0xa63e('0x3e')]['findOne']({'where':{'id':_0x285264[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x49b05e,null))[_0xa63e('0x1e')](function(_0x319132){if(_0x319132){_0x2236ac['model']=_[_0xa63e('0x40')](db[_0xa63e('0x63')][_0xa63e('0x3f')]);_0x2236ac[_0xa63e('0x41')]=_['keys'](_0x285264[_0xa63e('0x41')]);_0x2236ac[_0xa63e('0x48')]=_[_0xa63e('0x56')](_0x2236ac[_0xa63e('0x42')],_0x2236ac[_0xa63e('0x41')]);_0x338de4[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x2236ac[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x285264[_0xa63e('0x41')][_0xa63e('0x43')]));_0x338de4['attributes']=_0x338de4[_0xa63e('0x44')][_0xa63e('0x57')]?_0x338de4['attributes']:_0x2236ac[_0xa63e('0x42')];if(!_0x285264['query']['hasOwnProperty'](_0xa63e('0x45'))){_0x338de4['limit']=qs[_0xa63e('0x2f')](_0x285264[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x338de4[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x285264['query']['offset']);}_0x338de4[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x285264[_0xa63e('0x41')][_0xa63e('0x46')]);_0x338de4[_0xa63e('0x47')]=qs[_0xa63e('0x48')](_[_0xa63e('0x49')](_0x285264[_0xa63e('0x41')],_0x2236ac[_0xa63e('0x48')]));_0x338de4[_0xa63e('0x47')]['SmsAccountId']=_0x319132['id'];if(_0x285264[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x338de4[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x338de4[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x338de4['attributes'],function(_0x3bb453){var _0x1166ba={};_0x1166ba[_0x3bb453]={'$like':'%'+_0x285264['query'][_0xa63e('0x4a')]+'%'};return _0x1166ba;})});}_0x338de4=_[_0xa63e('0x4b')]({},_0x338de4,_0x285264[_0xa63e('0x50')]);return db[_0xa63e('0x63')][_0xa63e('0x2d')]({'where':_0x338de4[_0xa63e('0x47')]})[_0xa63e('0x1e')](function(_0x2055c9){_0xf6118f[_0xa63e('0x2d')]=_0x2055c9;if(_0x285264[_0xa63e('0x41')][_0xa63e('0x51')]){_0x338de4[_0xa63e('0x52')]=[{'all':!![]}];}return db[_0xa63e('0x63')][_0xa63e('0x53')](_0x338de4);})[_0xa63e('0x1e')](function(_0x2de13f){_0xf6118f['rows']=_0x2de13f;return _0xf6118f;});}})[_0xa63e('0x1e')](respondWithFilteredResult(_0x49b05e,_0x338de4))[_0xa63e('0x28')](handleError(_0x49b05e,null));};exports[_0xa63e('0x65')]=function(_0x55a5db,_0x5246e4,_0x309ada){return db['SmsAccount']['find']({'where':{'id':_0x55a5db[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x5246e4,null))[_0xa63e('0x1e')](function(_0x3328ad){if(_0x3328ad){return _0x3328ad[_0xa63e('0x65')](_0x55a5db['query']['ids']);}})[_0xa63e('0x1e')](respondWithStatusCode(_0x5246e4,null))['catch'](handleError(_0x5246e4,null));};exports['addAnswer']=function(_0x172167,_0x48fdf9,_0x57e071){if(_0x172167['body']['id']){delete _0x172167[_0xa63e('0x59')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x172167[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x48fdf9,null))['then'](function(_0x495ca2){if(_0x495ca2){_0x172167[_0xa63e('0x59')][_0xa63e('0x62')]=_0x495ca2['id'];return db[_0xa63e('0x66')][_0xa63e('0x58')](_0x172167[_0xa63e('0x59')]);}})[_0xa63e('0x1e')](respondWithResult(_0x48fdf9,null))[_0xa63e('0x28')](handleError(_0x48fdf9,null));};exports[_0xa63e('0x67')]=function(_0x32a38a,_0x271230,_0x5a8636){var _0x39219d={'raw':![],'where':{}};var _0x3651cd={};var _0x5aa561={'count':0x0,'rows':[]};return db['SmsAccount'][_0xa63e('0x68')]({'where':{'id':_0x32a38a[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x271230,null))[_0xa63e('0x1e')](function(_0x3d16bf){if(_0x3d16bf){_0x3651cd['model']=_['keys'](db[_0xa63e('0x66')][_0xa63e('0x3f')]);_0x3651cd['query']=_[_0xa63e('0x40')](_0x32a38a[_0xa63e('0x41')]);_0x3651cd[_0xa63e('0x48')]=_['intersection'](_0x3651cd[_0xa63e('0x42')],_0x3651cd[_0xa63e('0x41')]);_0x39219d[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x3651cd[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x32a38a[_0xa63e('0x41')][_0xa63e('0x43')]));_0x39219d[_0xa63e('0x44')]=_0x39219d[_0xa63e('0x44')][_0xa63e('0x57')]?_0x39219d[_0xa63e('0x44')]:_0x3651cd['model'];if(!_0x32a38a[_0xa63e('0x41')][_0xa63e('0x69')](_0xa63e('0x45'))){_0x39219d[_0xa63e('0x2f')]=qs[_0xa63e('0x2f')](_0x32a38a[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x39219d[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x32a38a['query']['offset']);}_0x39219d[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x32a38a['query'][_0xa63e('0x46')]);_0x39219d['where']=qs['filters'](_[_0xa63e('0x49')](_0x32a38a['query'],_0x3651cd['filters']));_0x39219d[_0xa63e('0x47')][_0xa63e('0x62')]=_0x3d16bf['id'];if(_0x32a38a[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x39219d[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x39219d[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x39219d[_0xa63e('0x44')],function(_0x1fdb8d){var _0x2b749d={};_0x2b749d[_0x1fdb8d]={'$like':'%'+_0x32a38a[_0xa63e('0x41')][_0xa63e('0x4a')]+'%'};return _0x2b749d;})});}_0x39219d=_[_0xa63e('0x4b')]({},_0x39219d,_0x32a38a[_0xa63e('0x50')]);return db[_0xa63e('0x66')]['count']({'where':_0x39219d['where']})[_0xa63e('0x1e')](function(_0x4646d6){_0x5aa561[_0xa63e('0x2d')]=_0x4646d6;if(_0x32a38a[_0xa63e('0x41')][_0xa63e('0x51')]){_0x39219d['include']=[{'all':!![]}];}return db[_0xa63e('0x66')][_0xa63e('0x53')](_0x39219d);})['then'](function(_0x24a5db){_0x5aa561[_0xa63e('0x54')]=_0x24a5db;return _0x5aa561;});}})[_0xa63e('0x1e')](respondWithFilteredResult(_0x271230,_0x39219d))[_0xa63e('0x28')](handleError(_0x271230,null));};exports[_0xa63e('0x6a')]=function(_0x20a616,_0xe30e1,_0xe8e486){return db[_0xa63e('0x3e')]['find']({'where':{'id':_0x20a616[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0xe30e1,null))[_0xa63e('0x1e')](function(_0x38a13e){if(_0x38a13e){return _0x38a13e[_0xa63e('0x6a')](_0x20a616[_0xa63e('0x41')][_0xa63e('0x6b')]);}})[_0xa63e('0x1e')](respondWithStatusCode(_0xe30e1,null))['catch'](handleError(_0xe30e1,null));};exports['notify']=function(_0x3e286,_0x3f75be,_0x4b6ede){var _0xc024a1={'channel':_0xa63e('0x6c')};var _0x27711e=[];var _0x495adb=[];var _0x1e824d={};return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x3e286['params']['id']},'include':[{'model':db[_0xa63e('0x6d')],'as':_0xa63e('0x6e')}]})[_0xa63e('0x1e')](handleEntityNotFound(_0x3f75be,null))[_0xa63e('0x1e')](function(_0x3cb56c){_0xc024a1['account']=_0x3cb56c;_0xc024a1['applications']=_[_0xa63e('0x6f')](_0x3cb56c[_0xa63e('0x6e')],[_0xa63e('0x70')],['asc']);if(_0xc024a1[_0xa63e('0x71')][_0xa63e('0x6e')]){delete _0xc024a1[_0xa63e('0x71')][_0xa63e('0x6e')];}return db[_0xa63e('0x72')][_0xa63e('0x60')]();})[_0xa63e('0x1e')](function(_0xdc9c47){if(!_0xdc9c47){throw new db['Sequelize']['ValidationError'](_0xa63e('0x73'));}_0x27711e=_[_0xa63e('0x74')](_[_0xa63e('0x40')](_0xdc9c47),['createdAt',_0xa63e('0x75')]);_0x495adb=_[_0xa63e('0x74')](_[_0xa63e('0x40')](_0xdc9c47),[_0xa63e('0x76'),_0xa63e('0x75'),_0xa63e('0x77'),_0xa63e('0x78')]);_0xc024a1['body']={'mapKey':'mobile'};if(_0xc024a1['account'][_0xa63e('0x4d')]){switch(_0xc024a1[_0xa63e('0x71')]['type']){case _0xa63e('0x79'):_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7b')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7c')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7d')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7e')];break;case _0xa63e('0x7f'):_0xc024a1[_0xa63e('0x59')]['from']='+'+_0x3e286[_0xa63e('0x59')][_0xa63e('0x80')];_0xc024a1['body'][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x81')];break;case'connectel':_0xc024a1[_0xa63e('0x59')]['from']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7a')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')]['message'];break;case'clicksend':_0xc024a1['body'][_0xa63e('0x7a')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x7a')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')]['body'];_0xc024a1['body'][_0xa63e('0x7d')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x82')];break;case _0xa63e('0x83'):_0xc024a1[_0xa63e('0x59')]['from']=_0x3e286[_0xa63e('0x59')]['From'];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')]['Text'];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7d')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x84')];break;case'infobip':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]='+'+_0x3e286['body']['results'][0x0][_0xa63e('0x7a')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x85')][0x0][_0xa63e('0x81')];_0xc024a1[_0xa63e('0x59')]['messageId']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x85')][0x0]['messageId'];break;case _0xa63e('0x86'):_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x87')];_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x88')][_0xa63e('0x25')];break;case _0xa63e('0x89'):_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')]=_0x3e286['body'][_0xa63e('0x8a')];_0xc024a1[_0xa63e('0x59')]['body']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x81')];_0xc024a1['body']['messageId']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x8b')];break;case _0xa63e('0x8c'):_0xc024a1[_0xa63e('0x59')]['from']=_0x3e286[_0xa63e('0x59')]['from'];_0xc024a1['body'][_0xa63e('0x59')]=_0x3e286[_0xa63e('0x59')][_0xa63e('0x25')];_0xc024a1[_0xa63e('0x59')]['messageId']=_0x3e286[_0xa63e('0x59')][_0xa63e('0x8d')];break;}}if(_0xc024a1[_0xa63e('0x59')]['id']){delete _0xc024a1['body']['id'];}if(_['isNil'](_0xc024a1[_0xa63e('0x59')]['from'])){throw new db['Sequelize']['ValidationError'](_0xa63e('0x8e'));}if(_[_0xa63e('0x8f')](_0xc024a1['body'][_0xa63e('0x59')])||_0xc024a1[_0xa63e('0x59')][_0xa63e('0x59')]===''){throw new db[(_0xa63e('0x90'))][(_0xa63e('0x91'))](_0xa63e('0x92'));}if(_[_0xa63e('0x8f')](_0xc024a1[_0xa63e('0x59')][_0xa63e('0x93')])){throw new db[(_0xa63e('0x90'))][(_0xa63e('0x91'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x495adb);}if(!_[_0xa63e('0x94')](_0x495adb,_0xc024a1[_0xa63e('0x59')][_0xa63e('0x93')])){throw new db[(_0xa63e('0x90'))][(_0xa63e('0x91'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x495adb);}_0x1e824d[_0xc024a1[_0xa63e('0x59')]['mapKey']]=_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')];return db[_0xa63e('0x95')]['find']({'where':{'id':_0xc024a1['account']['ListId']},'include':[{'model':db[_0xa63e('0x72')],'as':_0xa63e('0x96'),'where':_0x1e824d,'limit':0x1,'order':[[_0xa63e('0x75'),_0xa63e('0x97')]]}]});})[_0xa63e('0x1e')](handleEntityNotFound(_0x3f75be,null))[_0xa63e('0x1e')](function(_0x5baded){if(_0x5baded){_0xc024a1[_0xa63e('0x98')]=_[_0xa63e('0x99')](_0x5baded,[_0xa63e('0x96')]);if(_0x5baded['Contacts'][_0xa63e('0x57')]){return _0x5baded['Contacts'][0x0];}var _0x2606d1=_[_0xa63e('0x14')](_0xc024a1['body'],{'firstName':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')],'ListId':_0x5baded['id']});_0x2606d1[_0xc024a1[_0xa63e('0x59')][_0xa63e('0x93')]]=_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')];return db['CmContact'][_0xa63e('0x58')](_0x2606d1,{'fields':_0x27711e,'raw':!![]});}})[_0xa63e('0x1e')](handleEntityNotFound(_0x3f75be,null))[_0xa63e('0x1e')](function(_0x763fdb){if(_0x763fdb){_0xc024a1[_0xa63e('0x9a')]=_0x763fdb;var _0x9ab997={'ContactId':_0x763fdb['id'],'phone':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')],'SmsAccountId':_0x3e286['params']['id']};var _0x18f95b={'ContactId':_0x763fdb['id'],'SmsAccountId':_0x3e286[_0xa63e('0x5f')]['id'],'closed':![]};return db[_0xa63e('0x9b')][_0xa63e('0x5d')]({'where':_0x18f95b})[_0xa63e('0x1e')](function(_0x327648){if(_0x327648){return[_0x327648,![]];}return db[_0xa63e('0x9b')]['create'](_0x9ab997)[_0xa63e('0x1e')](function(_0x31d8eb){return[_0x31d8eb,!![]];});});}})['spread'](function(_0x25d842,_0x4f2650){_0xc024a1[_0xa63e('0x9c')]=_0x25d842[_0xa63e('0x36')]({'plain':!![]});_0xc024a1[_0xa63e('0x9c')][_0xa63e('0x9d')]=![];if(_0x4f2650){if(_0xc024a1[_0xa63e('0x71')]['autoclose']){_0xc024a1[_0xa63e('0x9e')][_0xa63e('0x9f')]({'id':0x0,'priority':_0xc024a1[_0xa63e('0x9e')][_0xa63e('0x57')]+0x1,'app':'close','appdata':_0xa63e('0xa0'),'interval':'*,*,*,*'});}_0xc024a1[_0xa63e('0x9c')][_0xa63e('0x9d')]=!![];}return db[_0xa63e('0xa1')][_0xa63e('0x58')]({'phone':_0xc024a1[_0xa63e('0x59')][_0xa63e('0x7a')],'messageId':_0xc024a1['body'][_0xa63e('0x7d')],'body':_0xc024a1[_0xa63e('0x59')]['body'],'SmsAccountId':_0x3e286['params']['id'],'SmsInteractionId':_0x25d842['id'],'direction':'in','ContactId':_0x25d842[_0xa63e('0xa2')],'AttachmentId':_0xc024a1[_0xa63e('0x59')][_0xa63e('0xa3')]});})['then'](function(_0x266555){_0xc024a1[_0xa63e('0x25')]=_0x266555;if(_0xc024a1[_0xa63e('0x9c')][_0xa63e('0xa4')]){return db[_0xa63e('0xa5')]['find']({'attributes':['id',_0xa63e('0x3a')],'where':{'id':_0xc024a1['interaction'][_0xa63e('0xa4')]}})[_0xa63e('0x1e')](function(_0x54eaab){if(_0x54eaab){_0xc024a1['applications'][_0xa63e('0xa6')]({'id':0x0,'priority':0x0,'app':_0xa63e('0xa7'),'appdata':_0x54eaab[_0xa63e('0x3a')]+','+(_0xc024a1[_0xa63e('0x71')][_0xa63e('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xa63e('0xa9'),_0xa63e('0xaa'),_0xc024a1);});}return respondWithRpcPromise('Start',_0xa63e('0xaa'),_0xc024a1);})[_0xa63e('0x1e')](function(_0xa43ee1){if(_0xa43ee1){var _0xa615ff=0xc8;var _0x34ebaa=_0xa63e('0xab');logger['info'](_0xa63e('0xac'),_0x34ebaa,_0xa615ff,_0xa63e('0xad'));logger[_0xa63e('0x20')](_0xa63e('0xae'),_0x34ebaa,_0xa615ff,_0xa63e('0xad'),JSON[_0xa63e('0x22')](_0xa43ee1));if(_0xc024a1[_0xa63e('0x71')]['type']===_0xa63e('0x79')){return _0x3f75be[_0xa63e('0x2a')](_0xa615ff)[_0xa63e('0x30')](_0xa63e('0xaf'),_0xa63e('0xb0'))[_0xa63e('0xb1')](_0xa63e('0xb2'));}else{return _0x3f75be[_0xa63e('0x2a')](_0xa615ff)['json'](_0xa43ee1);}}})[_0xa63e('0x28')](handleError(_0x3f75be,null));};exports[_0xa63e('0xb3')]=function(_0x6446f0,_0x104cd6,_0x368568){return db['SmsAccount'][_0xa63e('0x68')]({'where':{'id':_0x6446f0[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x104cd6,null))[_0xa63e('0x1e')](function(_0x2930a4){if(_0x2930a4){return db[_0xa63e('0xb4')][_0xa63e('0xb5')](function(_0x4486ec){return db[_0xa63e('0x6d')][_0xa63e('0x35')]({'where':{'SmsAccountId':_0x6446f0['params']['id']},'transaction':_0x4486ec})[_0xa63e('0x1e')](function(_0x12f58b){var _0x536498=_['map'](_0x6446f0['body'],function(_0x3c89c7){_0x3c89c7['SmsAccountId']=_0x6446f0[_0xa63e('0x5f')]['id'];return _0x3c89c7;});return db['SmsApplication'][_0xa63e('0xb6')](_0x536498,{'transaction':_0x4486ec});});})[_0xa63e('0x1e')](function(){return db['SmsApplication'][_0xa63e('0xb7')]({'where':{'SmsAccountId':_0x6446f0[_0xa63e('0x5f')]['id']},'order':_0xa63e('0x70')});});}})['then'](respondWithResult(_0x104cd6,null))[_0xa63e('0x28')](handleError(_0x104cd6,null));};exports[_0xa63e('0xb8')]=function(_0x30152c,_0x19adbf,_0x2c56d8){var _0x2cdf00={};var _0x284197={};var _0xc169a8;var _0x2d9393;return db[_0xa63e('0x3e')][_0xa63e('0x68')]({'where':{'id':_0x30152c[_0xa63e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x19adbf,null))[_0xa63e('0x1e')](function(_0x47c82b){if(_0x47c82b){_0xc169a8=_0x47c82b;_0x284197[_0xa63e('0x42')]=_[_0xa63e('0x40')](db[_0xa63e('0x6d')][_0xa63e('0x3f')]);_0x284197['query']=_[_0xa63e('0x40')](_0x30152c['query']);_0x284197['filters']=_['intersection'](_0x284197['model'],_0x284197[_0xa63e('0x41')]);_0x2cdf00[_0xa63e('0x44')]=_['intersection'](_0x284197[_0xa63e('0x42')],qs['fields'](_0x30152c[_0xa63e('0x41')][_0xa63e('0x43')]));_0x2cdf00[_0xa63e('0x44')]=_0x2cdf00['attributes'][_0xa63e('0x57')]?_0x2cdf00[_0xa63e('0x44')]:_0x284197[_0xa63e('0x42')];_0x2cdf00[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x30152c[_0xa63e('0x41')]['sort']);_0x2cdf00[_0xa63e('0x47')]=qs['filters'](_[_0xa63e('0x49')](_0x30152c[_0xa63e('0x41')],_0x284197[_0xa63e('0x48')]));if(_0x30152c[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x2cdf00[_0xa63e('0x47')]=_['merge'](_0x2cdf00[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x2cdf00['attributes'],function(_0xc1e569){var _0x4540ca={};_0x4540ca[_0xc1e569]={'$like':'%'+_0x30152c[_0xa63e('0x41')]['filter']+'%'};return _0x4540ca;})});}_0x2cdf00=_[_0xa63e('0x4b')]({},_0x2cdf00,_0x30152c['options']);return _0xc169a8['getApplications'](_0x2cdf00);}})[_0xa63e('0x1e')](function(_0xed2777){if(_0xed2777){_0x2d9393=_0xed2777[_0xa63e('0x57')];if(!_0x30152c[_0xa63e('0x41')]['hasOwnProperty'](_0xa63e('0x45'))){_0x2cdf00[_0xa63e('0x2f')]=qs[_0xa63e('0x2f')](_0x30152c[_0xa63e('0x41')]['limit']);_0x2cdf00[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x30152c[_0xa63e('0x41')][_0xa63e('0x2e')]);}return _0xc169a8['getApplications'](_0x2cdf00);}})[_0xa63e('0x1e')](function(_0x218c41){if(_0x218c41){return _0x218c41?{'count':_0x2d9393,'rows':_0x218c41}:null;}})[_0xa63e('0x1e')](respondWithResult(_0x19adbf,null))['catch'](handleError(_0x19adbf,null));};exports[_0xa63e('0xb9')]=function(_0x4645ed,_0x52eabf,_0x44053d){var _0x3b43e4={'raw':![],'where':{}};var _0x3697ea={};var _0x1a3122={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x4645ed[_0xa63e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x52eabf,null))['then'](function(_0x12bbeb){if(_0x12bbeb){_0x3697ea['model']=_[_0xa63e('0x40')](db[_0xa63e('0x9b')][_0xa63e('0x3f')]);_0x3697ea[_0xa63e('0x41')]=_[_0xa63e('0x40')](_0x4645ed[_0xa63e('0x41')]);_0x3697ea[_0xa63e('0x48')]=_[_0xa63e('0x56')](_0x3697ea[_0xa63e('0x42')],_0x3697ea[_0xa63e('0x41')]);_0x3b43e4[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x3697ea['model'],qs[_0xa63e('0x43')](_0x4645ed[_0xa63e('0x41')][_0xa63e('0x43')]));_0x3b43e4[_0xa63e('0x44')]=_0x3b43e4[_0xa63e('0x44')][_0xa63e('0x57')]?_0x3b43e4[_0xa63e('0x44')]:_0x3697ea[_0xa63e('0x42')];if(!_0x4645ed['query'][_0xa63e('0x69')]('nolimit')){_0x3b43e4[_0xa63e('0x2f')]=qs[_0xa63e('0x2f')](_0x4645ed[_0xa63e('0x41')]['limit']);_0x3b43e4[_0xa63e('0x2e')]=qs[_0xa63e('0x2e')](_0x4645ed['query'][_0xa63e('0x2e')]);}_0x3b43e4[_0xa63e('0x64')]=qs['sort'](_0x4645ed[_0xa63e('0x41')][_0xa63e('0x46')]);_0x3b43e4[_0xa63e('0x47')]=qs[_0xa63e('0x48')](_[_0xa63e('0x49')](_0x4645ed[_0xa63e('0x41')],_0x3697ea[_0xa63e('0x48')]));_0x3b43e4['where']['SmsAccountId']=_0x12bbeb['id'];if(_0x4645ed[_0xa63e('0x41')][_0xa63e('0x4a')]){_0x3b43e4[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x3b43e4[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x3b43e4['attributes'],function(_0x554ba5){var _0xed7248={};_0xed7248[_0x554ba5]={'$like':'%'+_0x4645ed['query'][_0xa63e('0x4a')]+'%'};return _0xed7248;})});}_0x3b43e4=_[_0xa63e('0x4b')]({},_0x3b43e4,_0x4645ed[_0xa63e('0x50')]);return db[_0xa63e('0x9b')][_0xa63e('0x2d')]({'where':_0x3b43e4[_0xa63e('0x47')]})[_0xa63e('0x1e')](function(_0x27eea3){_0x1a3122['count']=_0x27eea3;if(_0x4645ed[_0xa63e('0x41')]['includeAll']){_0x3b43e4[_0xa63e('0x52')]=[{'model':db[_0xa63e('0x72')],'as':_0xa63e('0xba'),'required':![]},{'model':db[_0xa63e('0xa5')],'as':_0xa63e('0xbb'),'attributes':[_0xa63e('0x3a'),_0xa63e('0xbc'),_0xa63e('0xbd')],'required':![]},{'model':db[_0xa63e('0xbe')],'as':_0xa63e('0xbf'),'attributes':['id','name',_0xa63e('0xc0')],'where':_0x4645ed[_0xa63e('0x41')][_0xa63e('0xc1')]?{'id':_0x4645ed[_0xa63e('0x41')]['tag']}:undefined,'required':_0x4645ed[_0xa63e('0x41')][_0xa63e('0xc1')]?!![]:![]}];}return db[_0xa63e('0x9b')][_0xa63e('0x53')](_0x3b43e4);})[_0xa63e('0x1e')](function(_0x596b16){_0x1a3122[_0xa63e('0x54')]=_0x596b16;return _0x1a3122;});}})[_0xa63e('0x1e')](respondWithFilteredResult(_0x52eabf,_0x3b43e4))['catch'](handleError(_0x52eabf,null));};exports[_0xa63e('0xb1')]=function(_0x49d2c6,_0x419bbb,_0x23d6ec){var _0x5d2067,_0x276bf4,_0x4639e6;if(_[_0xa63e('0x8f')](_0x49d2c6[_0xa63e('0x59')][_0xa63e('0x59')])||_0x49d2c6[_0xa63e('0x59')]['body']===''){throw new db[(_0xa63e('0x90'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x49d2c6[_0xa63e('0x59')]['to'])){throw new db['Sequelize'][(_0xa63e('0x91'))]('to\x20is\x20mandatory');}_0x5d2067=_0x49d2c6[_0xa63e('0x59')]['to'];return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x49d2c6[_0xa63e('0x5f')]['id']},'include':[{'model':db[_0xa63e('0x95')],'as':_0xa63e('0xc2'),'include':[{'model':db[_0xa63e('0x72')],'as':_0xa63e('0x96'),'where':{'mobile':_0x5d2067},'limit':0x1,'order':[[_0xa63e('0x75'),_0xa63e('0x97')]]}]}]})[_0xa63e('0x1e')](handleEntityNotFound(_0x419bbb,null))['then'](function(_0x4d590f){if(_0x4d590f&&_0x4d590f[_0xa63e('0xc2')]){_0x276bf4=_0x4d590f['get']({'plain':!![]});if(_0x276bf4[_0xa63e('0xc2')]&&_0x276bf4[_0xa63e('0xc2')][_0xa63e('0x96')][_0xa63e('0x57')]){return _0x276bf4[_0xa63e('0xc2')][_0xa63e('0x96')][0x0];}return db[_0xa63e('0x72')][_0xa63e('0x58')](_[_0xa63e('0x14')](_0x49d2c6[_0xa63e('0x59')],{'firstName':_0x5d2067,'mobile':_0x5d2067,'phone':_0x5d2067,'ListId':_0x276bf4[_0xa63e('0x78')]}));}})[_0xa63e('0x1e')](handleEntityNotFound(_0x419bbb,null))['then'](function(_0x25166d){if(_0x25166d){_0x4639e6=_0x25166d;return db['SmsInteraction'][_0xa63e('0x5d')]({'where':{'ContactId':_0x4639e6['id'],'closed':![],'SmsAccountId':_0x276bf4['id']}})[_0xa63e('0x1e')](function(_0x47b13e){if(_0x47b13e){return[_0x47b13e,![]];}return db[_0xa63e('0x9b')][_0xa63e('0x58')]({'UserId':_0x49d2c6[_0xa63e('0x5a')]['id'],'ContactId':_0x4639e6['id'],'SmsAccountId':_0x276bf4['id'],'phone':_0x5d2067,'firstMsgDirection':'out','Messages':[_[_0xa63e('0x4b')](_0x49d2c6[_0xa63e('0x59')],{'read':![],'body':_0x49d2c6[_0xa63e('0x59')][_0xa63e('0x59')],'phone':_0x5d2067,'SmsAccountId':_0x276bf4['id'],'UserId':_0x49d2c6[_0xa63e('0x5a')]['id'],'ContactId':_0x4639e6['id']})]},{'include':[{'model':db[_0xa63e('0xa1')],'as':'Messages'}]})[_0xa63e('0x1e')](function(_0x485a6f){return[_0x485a6f,!![]];});});}})[_0xa63e('0xc3')](function(_0x391559,_0x21b829){if(_0x21b829){return _0x391559;}return db[_0xa63e('0xa1')][_0xa63e('0x58')](_['merge'](_0x49d2c6['body'],{'read':![],'body':_0x49d2c6[_0xa63e('0x59')][_0xa63e('0x59')],'phone':_0x5d2067,'SmsAccountId':_0x276bf4['id'],'SmsInteractionId':_0x391559['id'],'UserId':_0x49d2c6[_0xa63e('0x5a')]['id'],'ContactId':_0x4639e6['id']}))[_0xa63e('0x1e')](function(_0x2e6cb4){_0x391559[_0xa63e('0xc4')][_0xa63e('0xc5')]=[];_0x391559['dataValues'][_0xa63e('0xc5')][_0xa63e('0x9f')](_0x2e6cb4[_0xa63e('0xc4')]);return _0x391559;});})[_0xa63e('0x1e')](respondWithResult(_0x419bbb,null))['catch'](handleError(_0x419bbb,null));};exports['status']=function(_0x493895,_0x1ef523,_0x452f61){if(_0x493895['body']['id']){delete _0x493895[_0xa63e('0x59')]['id'];}console[_0xa63e('0xc6')]('endpoint\x20/status\x20POST\x20/',_0x493895[_0xa63e('0x59')]);var _0xe1f0bb,_0x3faab1,_0xb1d7c2;return db[_0xa63e('0x3e')]['find']({'where':{'id':_0x493895['params']['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x1ef523,null))[_0xa63e('0x1e')](function(_0x216dba){if(_0x216dba){_0xb1d7c2=_0x216dba;logger['debug'](_0xa63e('0xac'),_0xa63e('0x2a'),'received\x20delivery\x20report\x20from',_0x216dba[_0xa63e('0x4d')],util['inspect'](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));switch(_0x216dba[_0xa63e('0x4d')]){case _0xa63e('0x7f'):if(_0x493895[_0xa63e('0x59')][_0xa63e('0xc7')]&&_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0xc7')]}});}break;case _0xa63e('0xc8'):if(_0x493895[_0xa63e('0x59')]['requestid']&&_0x493895[_0xa63e('0x59')][_0xa63e('0xc9')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0xc9')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0xca')]}});}break;case _0xa63e('0xcb'):if(_0x493895[_0xa63e('0x59')][_0xa63e('0x82')]&&_0x493895[_0xa63e('0x59')][_0xa63e('0xcc')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0xcc')];return db[_0xa63e('0xa1')][_0xa63e('0x5d')]({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0x82')]}});}break;case _0xa63e('0xcd'):var _0x2bc27a=_0x493895[_0xa63e('0x59')][_0xa63e('0x85')][0x0];if(_0x2bc27a['messageId']&&_0x2bc27a[_0xa63e('0x2a')]['groupName']===_0xa63e('0xce')){_0x3faab1=_0x2bc27a['status'][_0xa63e('0xcf')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x2bc27a[_0xa63e('0x7d')]}});}break;case _0xa63e('0x89'):if(_0x493895[_0xa63e('0x59')][_0xa63e('0x7d')]&&_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')]){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')];return db[_0xa63e('0xa1')]['find']({'where':{'messageId':_0x493895[_0xa63e('0x59')][_0xa63e('0x7d')]}});}break;case _0xa63e('0x8c'):if(_0x493895[_0xa63e('0x59')]['redif']&&_0x493895['body']['status']){_0x3faab1=_0x493895[_0xa63e('0x59')][_0xa63e('0x2a')];return db[_0xa63e('0xa1')][_0xa63e('0x5d')]({'where':{'messageId':_0x493895[_0xa63e('0x59')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x1ef523,null))['then'](function(_0x29fe04){if(_0x29fe04){_0xe1f0bb=_0x29fe04;switch(_0xb1d7c2[_0xa63e('0x4d')]){case _0xa63e('0x7f'):if(_0x3faab1===_0xa63e('0xce')){return _0xe1f0bb['update']({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x7f'),util[_0xa63e('0xd0')](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa63e('0xc8'):if(_0x3faab1==='1'){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util[_0xa63e('0xd0')](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa63e('0xcb'):if(!_0x493895['body'][_0xa63e('0xd1')]&&_0x3faab1>=0xc8&&_0x3faab1<=0xce){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0xcb'),util[_0xa63e('0xd0')](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;case _0xa63e('0xcd'):var _0x411565=_0x493895['body'][_0xa63e('0x85')][0x0];if(_0x411565['status'][_0xa63e('0xcf')]===_0xa63e('0xce')){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),'infobip',util['inspect'](_0x493895['body'],{'showHidden':![],'depth':null}));}break;case _0xa63e('0x89'):if(_0x3faab1=='DELIVERED_TO_GATEWAY'||_0x3faab1==_0xa63e('0xd2')){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x89'),util['inspect'](_0x493895['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3faab1===_0xa63e('0xd3')||_0x3faab1===_0xa63e('0xd4')){return _0xe1f0bb[_0xa63e('0x34')]({'read':!![]});}else{logger['error'](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x8c'),util['inspect'](_0x493895[_0xa63e('0x59')],{'showHidden':![],'depth':null}));}break;}return _0xe1f0bb;}})[_0xa63e('0x1e')](respondWithResult(_0x1ef523,null))['catch'](handleError(_0x1ef523,null));};exports[_0xa63e('0xd5')]=function(_0x53b5ff,_0x3b665d,_0x36f6c4){var _0x37d826,_0x1a8f51,_0x291a54;return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x53b5ff[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x3b665d,null))[_0xa63e('0x1e')](function(_0x21fb65){if(_0x21fb65){_0x291a54=_0x21fb65;logger[_0xa63e('0x20')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0xd6'),_0x21fb65['type'],util['inspect'](_0x53b5ff['query'],{'showHidden':![],'depth':null}));switch(_0x21fb65[_0xa63e('0x4d')]){case'csc':if(_0x53b5ff[_0xa63e('0x41')][_0xa63e('0xd7')]&&_0x53b5ff[_0xa63e('0x41')]['state']){_0x1a8f51=_0x53b5ff[_0xa63e('0x41')][_0xa63e('0xd8')];return db[_0xa63e('0xa1')][_0xa63e('0x5d')]({'where':{'messageId':_0x53b5ff[_0xa63e('0x41')][_0xa63e('0xd7')]}});}break;}}})[_0xa63e('0x1e')](handleEntityNotFound(_0x3b665d,null))[_0xa63e('0x1e')](function(_0x5c0ba5){if(_0x5c0ba5){_0x37d826=_0x5c0ba5;switch(_0x291a54[_0xa63e('0x4d')]){case _0xa63e('0x86'):if(_0x1a8f51==='2'||_0x1a8f51==='6'){return _0x37d826[_0xa63e('0x34')]({'read':!![]});}else{logger[_0xa63e('0x24')](_0xa63e('0xac'),_0xa63e('0x2a'),_0xa63e('0x86'),util[_0xa63e('0xd0')](_0x53b5ff[_0xa63e('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x37d826;}})[_0xa63e('0x1e')](respondWithResult(_0x3b665d,null))['catch'](handleError(_0x3b665d,null));};exports[_0xa63e('0xd9')]=function(_0x5599de,_0x3ff6fc,_0x249e79){return db[_0xa63e('0x3e')][_0xa63e('0x5d')]({'where':{'id':_0x5599de[_0xa63e('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3ff6fc,null))['then'](function(_0x92c35f){if(_0x92c35f){return _0x92c35f[_0xa63e('0xd9')](_0x5599de['body'][_0xa63e('0x6b')],_[_0xa63e('0x99')](_0x5599de[_0xa63e('0x59')],['ids','id'])||{})['spread'](function(_0x223333){for(var _0x4b94f1=0x0;_0x4b94f1<_0x5599de[_0xa63e('0x59')]['ids'][_0xa63e('0x57')];_0x4b94f1+=0x1){socket[_0xa63e('0xda')](_0xa63e('0xdb'),{'UserId':_0x5599de[_0xa63e('0x59')][_0xa63e('0x6b')][_0x4b94f1],'SmsAccountId':_0x5599de[_0xa63e('0x5f')]['id']});}return _0x223333;});}})[_0xa63e('0x1e')](respondWithResult(_0x3ff6fc,null))[_0xa63e('0x28')](handleError(_0x3ff6fc,null));};exports[_0xa63e('0xdc')]=function(_0x540321,_0x17d475,_0x241565){return db['SmsAccount'][_0xa63e('0x5d')]({'where':{'id':_0x540321[_0xa63e('0x5f')]['id']}})[_0xa63e('0x1e')](handleEntityNotFound(_0x17d475,null))[_0xa63e('0x1e')](function(_0x1fcf8a){if(_0x1fcf8a){return _0x1fcf8a[_0xa63e('0xdc')](_0x540321['query'][_0xa63e('0x6b')])[_0xa63e('0x1e')](function(){if(_[_0xa63e('0xdd')](_0x540321[_0xa63e('0x41')][_0xa63e('0x6b')])){for(var _0x32529b=0x0;_0x32529b<_0x540321['query']['ids']['length'];_0x32529b+=0x1){socket['emit'](_0xa63e('0xde'),{'UserId':Number(_0x540321[_0xa63e('0x41')][_0xa63e('0x6b')][_0x32529b]),'SmsAccountId':Number(_0x540321[_0xa63e('0x5f')]['id'])});}}else{socket[_0xa63e('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x540321[_0xa63e('0x41')]['ids']),'SmsAccountId':Number(_0x540321[_0xa63e('0x5f')]['id'])});}});}})[_0xa63e('0x1e')](respondWithStatusCode(_0x17d475,null))[_0xa63e('0x28')](handleError(_0x17d475,null));};exports['getAgents']=function(_0x39124e,_0x2f5f31,_0x238aa2){var _0x1c308a={};var _0x12f11d={};var _0x2c645a;var _0x54063b;return db['SmsAccount']['findOne']({'where':{'id':_0x39124e['params']['id']}})['then'](handleEntityNotFound(_0x2f5f31,null))[_0xa63e('0x1e')](function(_0x3a0537){if(_0x3a0537){_0x2c645a=_0x3a0537;_0x12f11d[_0xa63e('0x42')]=_['keys'](db[_0xa63e('0xa5')]['rawAttributes']);_0x12f11d[_0xa63e('0x41')]=_[_0xa63e('0x40')](_0x39124e['query']);_0x12f11d['filters']=_['intersection'](_0x12f11d[_0xa63e('0x42')],_0x12f11d[_0xa63e('0x41')]);_0x1c308a[_0xa63e('0x44')]=_[_0xa63e('0x56')](_0x12f11d[_0xa63e('0x42')],qs[_0xa63e('0x43')](_0x39124e[_0xa63e('0x41')][_0xa63e('0x43')]));_0x1c308a[_0xa63e('0x44')]=_0x1c308a['attributes']['length']?_0x1c308a[_0xa63e('0x44')]:_0x12f11d[_0xa63e('0x42')];_0x1c308a[_0xa63e('0x64')]=qs[_0xa63e('0x46')](_0x39124e['query'][_0xa63e('0x46')]);_0x1c308a['where']=qs[_0xa63e('0x48')](_['pick'](_0x39124e[_0xa63e('0x41')],_0x12f11d[_0xa63e('0x48')]));if(_0x39124e[_0xa63e('0x41')]['filter']){_0x1c308a[_0xa63e('0x47')]=_[_0xa63e('0x4b')](_0x1c308a[_0xa63e('0x47')],{'$or':_[_0xa63e('0x4c')](_0x1c308a[_0xa63e('0x44')],function(_0x5cda5a){var _0x5fe45b={};_0x5fe45b[_0x5cda5a]={'$like':'%'+_0x39124e[_0xa63e('0x41')][_0xa63e('0x4a')]+'%'};return _0x5fe45b;})});}_0x1c308a=_['merge']({},_0x1c308a,_0x39124e[_0xa63e('0x50')]);return _0x2c645a[_0xa63e('0xdf')](_0x1c308a);}})[_0xa63e('0x1e')](function(_0x37f886){if(_0x37f886){_0x54063b=_0x37f886[_0xa63e('0x57')];if(!_0x39124e[_0xa63e('0x41')][_0xa63e('0x69')](_0xa63e('0x45'))){_0x1c308a[_0xa63e('0x2f')]=qs['limit'](_0x39124e[_0xa63e('0x41')][_0xa63e('0x2f')]);_0x1c308a[_0xa63e('0x2e')]=qs['offset'](_0x39124e['query'][_0xa63e('0x2e')]);}return _0x2c645a['getAgents'](_0x1c308a);}})[_0xa63e('0x1e')](function(_0x102a2c){if(_0x102a2c){return _0x102a2c?{'count':_0x54063b,'rows':_0x102a2c}:null;}})[_0xa63e('0x1e')](respondWithResult(_0x2f5f31,null))[_0xa63e('0x28')](handleError(_0x2f5f31,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a4cd8a3..368631c 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 _0x81ac=['exports','events','setMaxListeners','update','emit','hook'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x81ac,0x1bd));var _0xc81a=function(_0x227660,_0x231d55){_0x227660=_0x227660-0x0;var _0x2a3b46=_0x81ac[_0x227660];return _0x2a3b46;};'use strict';var EventEmitter=require(_0xc81a('0x0'));var SmsAccount=require('../../mysqldb')['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc81a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc81a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x25761e){return function(_0x10248,_0x167855,_0x1b3b4e){SmsAccountEvents[_0xc81a('0x3')](_0x25761e+':'+_0x10248['id'],_0x10248);SmsAccountEvents[_0xc81a('0x3')](_0x25761e,_0x10248);_0x1b3b4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xc81a('0x4')](e,emitEvent(event));}}module[_0xc81a('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0xc2d4=['events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4267cd,_0x5a3600){var _0x27ecf1=function(_0x32c9b7){while(--_0x32c9b7){_0x4267cd['push'](_0x4267cd['shift']());}};_0x27ecf1(++_0x5a3600);}(_0xc2d4,0x6e));var _0x4c2d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc2d4[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x4c2d('0x0'));var SmsAccount=require(_0x4c2d('0x1'))['db'][_0x4c2d('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4c2d('0x3')](0x0);var events={'afterCreate':_0x4c2d('0x4'),'afterUpdate':_0x4c2d('0x5'),'afterDestroy':_0x4c2d('0x6')};function emitEvent(_0x331dd0){return function(_0x1338fe,_0x4c531e,_0x2e14d1){SmsAccountEvents[_0x4c2d('0x7')](_0x331dd0+':'+_0x1338fe['id'],_0x1338fe);SmsAccountEvents[_0x4c2d('0x7')](_0x331dd0,_0x1338fe);_0x2e14d1(null);};}for(var e in events){if(events[_0x4c2d('0x8')](e)){var event=events[e];SmsAccount[_0x4c2d('0x9')](e,emitEvent(event));}}module[_0x4c2d('0xa')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 5cd0ebd..ec06be5 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 _0xb6ef=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','lodash','util','../../config/logger'];(function(_0x4c5d2e,_0xf7da57){var _0x283939=function(_0xb8353e){while(--_0xb8353e){_0x4c5d2e['push'](_0x4c5d2e['shift']());}};_0x283939(++_0xf7da57);}(_0xb6ef,0x1de));var _0xfb6e=function(_0x513bbd,_0x2e3a14){_0x513bbd=_0x513bbd-0x0;var _0x490704=_0xb6ef[_0x513bbd];return _0x490704;};'use strict';var _=require(_0xfb6e('0x0'));var util=require(_0xfb6e('0x1'));var logger=require(_0xfb6e('0x2'))(_0xfb6e('0x3'));var moment=require(_0xfb6e('0x4'));var BPromise=require(_0xfb6e('0x5'));var rp=require(_0xfb6e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb6e('0x7'));var config=require(_0xfb6e('0x8'));var attributes=require(_0xfb6e('0x9'));module[_0xfb6e('0xa')]=function(_0x3f9c6e,_0x33b8dc){return _0x3f9c6e['define'](_0xfb6e('0xb'),attributes,{'tableName':_0xfb6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5b0=['define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports'];(function(_0x562843,_0x23a145){var _0x430d4b=function(_0x1db536){while(--_0x1db536){_0x562843['push'](_0x562843['shift']());}};_0x430d4b(++_0x23a145);}(_0xf5b0,0x18b));var _0x0f5b=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xf5b0[_0x543084];return _0x306a57;};'use strict';var _=require(_0x0f5b('0x0'));var util=require(_0x0f5b('0x1'));var logger=require(_0x0f5b('0x2'))(_0x0f5b('0x3'));var moment=require(_0x0f5b('0x4'));var BPromise=require(_0x0f5b('0x5'));var rp=require(_0x0f5b('0x6'));var fs=require('fs');var path=require(_0x0f5b('0x7'));var rimraf=require(_0x0f5b('0x8'));var config=require('../../config/environment');var attributes=require(_0x0f5b('0x9'));module[_0x0f5b('0xa')]=function(_0x6acbe7,_0x5b24f4){return _0x6acbe7[_0x0f5b('0xb')](_0x0f5b('0xc'),attributes,{'tableName':_0x0f5b('0xd'),'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 8af6057..d4bfbae 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 _0xcf0d=['options','where','attributes','include','map','model','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','SmsAccount','find','raw'];(function(_0x1eef37,_0x3829ac){var _0x233234=function(_0x1db4ae){while(--_0x1db4ae){_0x1eef37['push'](_0x1eef37['shift']());}};_0x233234(++_0x3829ac);}(_0xcf0d,0x14a));var _0xdcf0=function(_0x2af11a,_0x443532){_0x2af11a=_0x2af11a-0x0;var _0x40d52e=_0xcf0d[_0x2af11a];return _0x40d52e;};'use strict';var _=require(_0xdcf0('0x0'));var util=require(_0xdcf0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdcf0('0x2'));var fs=require('fs');var Redis=require(_0xdcf0('0x3'));var db=require(_0xdcf0('0x4'))['db'];var utils=require(_0xdcf0('0x5'));var logger=require(_0xdcf0('0x6'))(_0xdcf0('0x7'));var config=require('../../config/environment');var jayson=require(_0xdcf0('0x8'));var client=jayson[_0xdcf0('0x9')]['http']({'port':0x232a});config[_0xdcf0('0xa')]=_[_0xdcf0('0xb')](config[_0xdcf0('0xa')],{'host':_0xdcf0('0xc'),'port':0x18eb});var socket=require(_0xdcf0('0xd'))(new Redis(config['redis']));require(_0xdcf0('0xe'))['register'](socket);function respondWithRpcPromise(_0x32e4a4,_0x305f28,_0x5c2fe7){return new BPromise(function(_0x25a6c2,_0x1e2ab3){return client[_0xdcf0('0xf')](_0x32e4a4,_0x5c2fe7)[_0xdcf0('0x10')](function(_0x2b7e93){logger['info'](_0xdcf0('0x11'),_0x305f28,_0xdcf0('0x12'));logger[_0xdcf0('0x13')](_0xdcf0('0x14'),_0x305f28,_0xdcf0('0x12'),JSON[_0xdcf0('0x15')](_0x2b7e93));if(_0x2b7e93[_0xdcf0('0x16')]){if(_0x2b7e93[_0xdcf0('0x16')][_0xdcf0('0x17')]===0x1f4){logger[_0xdcf0('0x16')](_0xdcf0('0x11'),_0x305f28,_0x2b7e93[_0xdcf0('0x16')][_0xdcf0('0x18')]);return _0x1e2ab3(_0x2b7e93[_0xdcf0('0x16')][_0xdcf0('0x18')]);}logger[_0xdcf0('0x16')](_0xdcf0('0x11'),_0x305f28,_0x2b7e93['error'][_0xdcf0('0x18')]);return _0x25a6c2(_0x2b7e93[_0xdcf0('0x16')][_0xdcf0('0x18')]);}else{logger[_0xdcf0('0x19')](_0xdcf0('0x11'),_0x305f28,_0xdcf0('0x12'));_0x25a6c2(_0x2b7e93['result']['message']);}})[_0xdcf0('0x1a')](function(_0x54d0f7){logger[_0xdcf0('0x16')](_0xdcf0('0x11'),_0x305f28,_0x54d0f7);_0x1e2ab3(_0x54d0f7);});});}exports['ShowSmsAccount']=function(_0x115550){var _0x4f6a22=this;return new Promise(function(_0x24c1c5,_0x509f1f){return db[_0xdcf0('0x1b')][_0xdcf0('0x1c')]({'raw':_0x115550['options']?_0x115550['options'][_0xdcf0('0x1d')]===undefined?!![]:![]:!![],'where':_0x115550[_0xdcf0('0x1e')]?_0x115550[_0xdcf0('0x1e')][_0xdcf0('0x1f')]||null:null,'attributes':_0x115550[_0xdcf0('0x1e')]?_0x115550['options'][_0xdcf0('0x20')]||null:null,'include':_0x115550[_0xdcf0('0x1e')]?_0x115550[_0xdcf0('0x1e')][_0xdcf0('0x21')]?_[_0xdcf0('0x22')](_0x115550[_0xdcf0('0x1e')][_0xdcf0('0x21')],function(_0x250be6){return{'model':db[_0x250be6[_0xdcf0('0x23')]],'as':_0x250be6['as'],'attributes':_0x250be6['attributes'],'include':_0x250be6['include']?_[_0xdcf0('0x22')](_0x250be6[_0xdcf0('0x21')],function(_0xaa218c){return{'model':db[_0xaa218c[_0xdcf0('0x23')]],'as':_0xaa218c['as'],'attributes':_0xaa218c[_0xdcf0('0x20')],'include':_0xaa218c[_0xdcf0('0x21')]?_['map'](_0xaa218c[_0xdcf0('0x21')],function(_0x91cf4){return{'model':db[_0x91cf4[_0xdcf0('0x23')]],'as':_0x91cf4['as'],'attributes':_0x91cf4[_0xdcf0('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdcf0('0x10')](function(_0x380b27){logger[_0xdcf0('0x19')]('ShowSmsAccount',_0x115550);logger[_0xdcf0('0x13')]('ShowSmsAccount',_0x115550,JSON[_0xdcf0('0x15')](_0x380b27));_0x24c1c5(_0x380b27);})['catch'](function(_0x2aaca0){logger[_0xdcf0('0x16')]('ShowSmsAccount',_0x2aaca0[_0xdcf0('0x18')],_0x115550);_0x509f1f(_0x4f6a22['error'](0x1f4,_0x2aaca0['message']));});});}; \ No newline at end of file +var _0x6529=['model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsAccount.socket','request','then','SmsAccount,\x20%s,\x20%s','debug','stringify','code','error','message','info','request\x20sent','result','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map'];(function(_0x5781fc,_0x5ee24b){var _0x1e6e49=function(_0x4d077b){while(--_0x4d077b){_0x5781fc['push'](_0x5781fc['shift']());}};_0x1e6e49(++_0x5ee24b);}(_0x6529,0xbb));var _0x9652=function(_0x48e9b8,_0x4df457){_0x48e9b8=_0x48e9b8-0x0;var _0x449b7f=_0x6529[_0x48e9b8];return _0x449b7f;};'use strict';var _=require(_0x9652('0x0'));var util=require(_0x9652('0x1'));var moment=require(_0x9652('0x2'));var BPromise=require(_0x9652('0x3'));var rs=require(_0x9652('0x4'));var fs=require('fs');var Redis=require(_0x9652('0x5'));var db=require(_0x9652('0x6'))['db'];var utils=require(_0x9652('0x7'));var logger=require('../../config/logger')(_0x9652('0x8'));var config=require(_0x9652('0x9'));var jayson=require(_0x9652('0xa'));var client=jayson[_0x9652('0xb')][_0x9652('0xc')]({'port':0x232a});config[_0x9652('0xd')]=_[_0x9652('0xe')](config[_0x9652('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9652('0xf'))['register'](socket);function respondWithRpcPromise(_0x19d926,_0x2b2f6c,_0x328c9a){return new BPromise(function(_0x5d96c2,_0x2ac389){return client[_0x9652('0x10')](_0x19d926,_0x328c9a)[_0x9652('0x11')](function(_0x452a3e){logger['info'](_0x9652('0x12'),_0x2b2f6c,'request\x20sent');logger[_0x9652('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2b2f6c,'request\x20sent',JSON[_0x9652('0x14')](_0x452a3e));if(_0x452a3e['error']){if(_0x452a3e['error'][_0x9652('0x15')]===0x1f4){logger[_0x9652('0x16')](_0x9652('0x12'),_0x2b2f6c,_0x452a3e[_0x9652('0x16')][_0x9652('0x17')]);return _0x2ac389(_0x452a3e[_0x9652('0x16')]['message']);}logger[_0x9652('0x16')](_0x9652('0x12'),_0x2b2f6c,_0x452a3e[_0x9652('0x16')]['message']);return _0x5d96c2(_0x452a3e[_0x9652('0x16')]['message']);}else{logger[_0x9652('0x18')](_0x9652('0x12'),_0x2b2f6c,_0x9652('0x19'));_0x5d96c2(_0x452a3e[_0x9652('0x1a')][_0x9652('0x17')]);}})['catch'](function(_0x5338d4){logger['error'](_0x9652('0x12'),_0x2b2f6c,_0x5338d4);_0x2ac389(_0x5338d4);});});}exports[_0x9652('0x1b')]=function(_0xd1d677){var _0x56f0ed=this;return new Promise(function(_0x518b6e,_0x210642){return db[_0x9652('0x1c')][_0x9652('0x1d')]({'raw':_0xd1d677[_0x9652('0x1e')]?_0xd1d677[_0x9652('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xd1d677[_0x9652('0x1e')]?_0xd1d677[_0x9652('0x1e')][_0x9652('0x1f')]||null:null,'attributes':_0xd1d677['options']?_0xd1d677[_0x9652('0x1e')][_0x9652('0x20')]||null:null,'include':_0xd1d677[_0x9652('0x1e')]?_0xd1d677['options'][_0x9652('0x21')]?_[_0x9652('0x22')](_0xd1d677['options']['include'],function(_0xd3d636){return{'model':db[_0xd3d636[_0x9652('0x23')]],'as':_0xd3d636['as'],'attributes':_0xd3d636['attributes'],'include':_0xd3d636[_0x9652('0x21')]?_[_0x9652('0x22')](_0xd3d636['include'],function(_0x300730){return{'model':db[_0x300730[_0x9652('0x23')]],'as':_0x300730['as'],'attributes':_0x300730['attributes'],'include':_0x300730[_0x9652('0x21')]?_['map'](_0x300730[_0x9652('0x21')],function(_0x1024f2){return{'model':db[_0x1024f2[_0x9652('0x23')]],'as':_0x1024f2['as'],'attributes':_0x1024f2[_0x9652('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44446d){logger[_0x9652('0x18')]('ShowSmsAccount',_0xd1d677);logger[_0x9652('0x13')](_0x9652('0x1b'),_0xd1d677,JSON['stringify'](_0x44446d));_0x518b6e(_0x44446d);})[_0x9652('0x24')](function(_0x23b48c){logger[_0x9652('0x16')](_0x9652('0x1b'),_0x23b48c[_0x9652('0x17')],_0xd1d677);_0x210642(_0x56f0ed['error'](0x1f4,_0x23b48c['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index a332718..ca98741 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 _0xd6e4=['./smsAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2a6fd5,_0x3d6deb){var _0x43c6a4=function(_0x3aecb3){while(--_0x3aecb3){_0x2a6fd5['push'](_0x2a6fd5['shift']());}};_0x43c6a4(++_0x3d6deb);}(_0xd6e4,0x150));var _0x4d6e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xd6e4[_0x138adb];return _0x1b27f2;};'use strict';var SmsAccountEvents=require(_0x4d6e('0x0'));var events=[_0x4d6e('0x1'),_0x4d6e('0x2'),_0x4d6e('0x3')];function createListener(_0x33ed39,_0x2ae8af){return function(_0x2e6ddb){_0x2ae8af[_0x4d6e('0x4')](_0x33ed39,_0x2e6ddb);};}function removeListener(_0x5beed8,_0x2c96b5){return function(){SmsAccountEvents[_0x4d6e('0x5')](_0x5beed8,_0x2c96b5);};}exports[_0x4d6e('0x6')]=function(_0x4956cb){for(var _0x41435f=0x0,_0x4dc41a=events[_0x4d6e('0x7')];_0x41435f<_0x4dc41a;_0x41435f++){var _0x4be93d=events[_0x41435f];var _0x5da8a4=createListener('smsAccount:'+_0x4be93d,_0x4956cb);SmsAccountEvents['on'](_0x4be93d,_0x5da8a4);}}; \ No newline at end of file +var _0xd10b=['smsAccount:','./smsAccount.events','save','update','removeListener','length'];(function(_0x1217bd,_0x38c7da){var _0x2fc8e8=function(_0x3f4cbd){while(--_0x3f4cbd){_0x1217bd['push'](_0x1217bd['shift']());}};_0x2fc8e8(++_0x38c7da);}(_0xd10b,0x1d5));var _0xbd10=function(_0x1fc7b4,_0x44a971){_0x1fc7b4=_0x1fc7b4-0x0;var _0x3e2934=_0xd10b[_0x1fc7b4];return _0x3e2934;};'use strict';var SmsAccountEvents=require(_0xbd10('0x0'));var events=[_0xbd10('0x1'),'remove',_0xbd10('0x2')];function createListener(_0x19738a,_0x1d7412){return function(_0x473f0d){_0x1d7412['emit'](_0x19738a,_0x473f0d);};}function removeListener(_0x409108,_0x343a0d){return function(){SmsAccountEvents[_0xbd10('0x3')](_0x409108,_0x343a0d);};}exports['register']=function(_0x57bffd){for(var _0x17f97f=0x0,_0x27fce6=events[_0xbd10('0x4')];_0x17f97f<_0x27fce6;_0x17f97f++){var _0x19cd6f=events[_0x17f97f];var _0xace0fb=createListener(_0xbd10('0x5')+_0x19cd6f,_0x57bffd);SmsAccountEvents['on'](_0x19cd6f,_0xace0fb);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 57176c0..538a5d5 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 _0x16f2=['destroy','util','path','connect-timeout','express','Router','./smsApplication.controller','get','index','isAuthenticated','show','post','create','/:id','update','delete'];(function(_0x50c4df,_0x2f2b7f){var _0x4aee97=function(_0x2ed349){while(--_0x2ed349){_0x50c4df['push'](_0x50c4df['shift']());}};_0x4aee97(++_0x2f2b7f);}(_0x16f2,0x1f1));var _0x216f=function(_0x44e7b9,_0xf7f5cc){_0x44e7b9=_0x44e7b9-0x0;var _0x1de7ac=_0x16f2[_0x44e7b9];return _0x1de7ac;};'use strict';var multer=require('multer');var util=require(_0x216f('0x0'));var path=require(_0x216f('0x1'));var timeout=require(_0x216f('0x2'));var express=require(_0x216f('0x3'));var router=express[_0x216f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x216f('0x5'));router[_0x216f('0x6')]('/',auth['isAuthenticated'](),controller[_0x216f('0x7')]);router[_0x216f('0x6')]('/:id',auth[_0x216f('0x8')](),controller[_0x216f('0x9')]);router[_0x216f('0xa')]('/',auth[_0x216f('0x8')](),controller[_0x216f('0xb')]);router['put'](_0x216f('0xc'),auth[_0x216f('0x8')](),controller[_0x216f('0xd')]);router[_0x216f('0xe')]('/:id',auth[_0x216f('0x8')](),controller[_0x216f('0xf')]);module['exports']=router; \ No newline at end of file +var _0xa2b7=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','index','isAuthenticated','show','post','create','/:id','update','destroy'];(function(_0x1baa84,_0x3c938e){var _0x18523b=function(_0x120137){while(--_0x120137){_0x1baa84['push'](_0x1baa84['shift']());}};_0x18523b(++_0x3c938e);}(_0xa2b7,0x1e7));var _0x7a2b=function(_0x5c9d11,_0x56cc05){_0x5c9d11=_0x5c9d11-0x0;var _0x4783e7=_0xa2b7[_0x5c9d11];return _0x4783e7;};'use strict';var multer=require('multer');var util=require(_0x7a2b('0x0'));var path=require(_0x7a2b('0x1'));var timeout=require(_0x7a2b('0x2'));var express=require('express');var router=express[_0x7a2b('0x3')]();var auth=require(_0x7a2b('0x4'));var interaction=require(_0x7a2b('0x5'));var config=require(_0x7a2b('0x6'));var controller=require(_0x7a2b('0x7'));router[_0x7a2b('0x8')]('/',auth['isAuthenticated'](),controller[_0x7a2b('0x9')]);router[_0x7a2b('0x8')]('/:id',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xb')]);router[_0x7a2b('0xc')]('/',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xd')]);router['put'](_0x7a2b('0xe'),auth[_0x7a2b('0xa')](),controller[_0x7a2b('0xf')]);router['delete']('/:id',auth[_0x7a2b('0xa')](),controller[_0x7a2b('0x10')]);module[_0x7a2b('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index a2442ec..4cc32f3 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 _0xcf2f=['exports','INTEGER','STRING','noop','*,*,*,*','sequelize'];(function(_0x1901d3,_0x390aec){var _0x29c6f0=function(_0x246d2c){while(--_0x246d2c){_0x1901d3['push'](_0x1901d3['shift']());}};_0x29c6f0(++_0x390aec);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x3eb75c,_0x5206a7){_0x3eb75c=_0x3eb75c-0x0;var _0x2c8ced=_0xcf2f[_0x3eb75c];return _0x2c8ced;};'use strict';var Sequelize=require(_0xfcf2('0x0'));module[_0xfcf2('0x1')]={'priority':{'type':Sequelize[_0xfcf2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfcf2('0x3')],'allowNull':![],'defaultValue':_0xfcf2('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xfcf2('0x3')]},'interval':{'type':Sequelize[_0xfcf2('0x3')],'defaultValue':_0xfcf2('0x5')}}; \ No newline at end of file +var _0xf3e2=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x254233,_0x45e922){var _0x24d660=function(_0x46198b){while(--_0x46198b){_0x254233['push'](_0x254233['shift']());}};_0x24d660(++_0x45e922);}(_0xf3e2,0x168));var _0x2f3e=function(_0x12c263,_0x2d9bce){_0x12c263=_0x12c263-0x0;var _0x192cd7=_0xf3e2[_0x12c263];return _0x192cd7;};'use strict';var Sequelize=require(_0x2f3e('0x0'));module[_0x2f3e('0x1')]={'priority':{'type':Sequelize[_0x2f3e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2f3e('0x3')],'allowNull':![],'defaultValue':_0x2f3e('0x4')},'appdata':{'type':Sequelize[_0x2f3e('0x5')]()},'description':{'type':Sequelize[_0x2f3e('0x3')]},'interval':{'type':Sequelize[_0x2f3e('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 8033e79..16c452d 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 _0xf045=['params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','save','update','then','destroy','stack','name','send','SmsApplication','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','findAll','catch'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xf045,0x93));var _0x5f04=function(_0x564527,_0x10a786){_0x564527=_0x564527-0x0;var _0x11909f=_0xf045[_0x564527];return _0x11909f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5f04('0x0'));var rimraf=require(_0x5f04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5f04('0x2'));var rp=require(_0x5f04('0x3'));var moment=require('moment');var BPromise=require(_0x5f04('0x4'));var Mustache=require(_0x5f04('0x5'));var util=require('util');var path=require(_0x5f04('0x6'));var sox=require(_0x5f04('0x7'));var csv=require(_0x5f04('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5f04('0x9'));var squel=require(_0x5f04('0xa'));var crypto=require(_0x5f04('0xb'));var jsforce=require(_0x5f04('0xc'));var deskjs=require(_0x5f04('0xd'));var toCsv=require(_0x5f04('0x8'));var querystring=require(_0x5f04('0xe'));var Papa=require(_0x5f04('0xf'));var Redis=require(_0x5f04('0x10'));var authService=require(_0x5f04('0x11'));var qs=require(_0x5f04('0x12'));var hardwareService=require(_0x5f04('0x13'));var logger=require(_0x5f04('0x14'))('api');var utils=require(_0x5f04('0x15'));var config=require(_0x5f04('0x16'));var db=require(_0x5f04('0x17'))['db'];function respondWithStatusCode(_0x33a5de,_0x221550){_0x221550=_0x221550||0xcc;return function(_0x5c1d01){if(_0x5c1d01){return _0x33a5de[_0x5f04('0x18')](_0x221550);}return _0x33a5de[_0x5f04('0x19')](_0x221550)[_0x5f04('0x1a')]();};}function respondWithResult(_0x5b464f,_0x37c151){_0x37c151=_0x37c151||0xc8;return function(_0x3e7e35){if(_0x3e7e35){return _0x5b464f['status'](_0x37c151)[_0x5f04('0x1b')](_0x3e7e35);}};}function respondWithFilteredResult(_0x527498,_0x313166){return function(_0x1e9374){if(_0x1e9374){var _0xfc1d0=_0x1e9374[_0x5f04('0x1c')],_0xac25f4=_0x313166[_0x5f04('0x1d')],_0x4c73af=_0x313166[_0x5f04('0x1d')]+_0x313166['limit'],_0x2b7c61;if(_0x4c73af>=_0xfc1d0){_0x4c73af=_0xfc1d0;_0x2b7c61=0xc8;}else{_0x2b7c61=0xce;}_0x527498[_0x5f04('0x19')](_0x2b7c61);return _0x527498[_0x5f04('0x1e')]('Content-Range',_0xac25f4+'-'+_0x4c73af+'/'+_0xfc1d0)[_0x5f04('0x1b')](_0x1e9374);}return null;};}function patchUpdates(_0x367233){return function(_0x4b8469){try{jsonpatch['apply'](_0x4b8469,_0x367233,!![]);}catch(_0x4c815a){return BPromise[_0x5f04('0x1f')](_0x4c815a);}return _0x4b8469[_0x5f04('0x20')]();};}function saveUpdates(_0x356116,_0x1003f7){return function(_0x231a9b){if(_0x231a9b){return _0x231a9b[_0x5f04('0x21')](_0x356116)[_0x5f04('0x22')](function(_0x38a337){return _0x38a337;});}return null;};}function removeEntity(_0x5aafcc,_0x5a6ef8){return function(_0x54803d){if(_0x54803d){return _0x54803d[_0x5f04('0x23')]()['then'](function(){_0x5aafcc['status'](0xcc)[_0x5f04('0x1a')]();});}};}function handleEntityNotFound(_0x1e0697,_0x3e8c1f){return function(_0x58280c){if(!_0x58280c){_0x1e0697[_0x5f04('0x18')](0x194);}return _0x58280c;};}function handleError(_0xe6eb08,_0x329b62){_0x329b62=_0x329b62||0x1f4;return function(_0x4e6b3c){logger['error'](_0x4e6b3c[_0x5f04('0x24')]);if(_0x4e6b3c[_0x5f04('0x25')]){delete _0x4e6b3c['name'];}_0xe6eb08['status'](_0x329b62)[_0x5f04('0x26')](_0x4e6b3c);};}exports['index']=function(_0x4cca0b,_0x284914){var _0x2c7354={},_0x1fa7de={},_0x1cc385={'count':0x0,'rows':[]};var _0x3bf192=db[_0x5f04('0x27')][_0x5f04('0x28')];_0x1fa7de[_0x5f04('0x29')]=_['keys'](_0x3bf192);_0x1fa7de['query']=_[_0x5f04('0x2a')](_0x4cca0b[_0x5f04('0x2b')]);_0x1fa7de['filters']=_[_0x5f04('0x2c')](_0x1fa7de[_0x5f04('0x29')],_0x1fa7de[_0x5f04('0x2b')]);_0x2c7354[_0x5f04('0x2d')]=_[_0x5f04('0x2c')](_0x1fa7de[_0x5f04('0x29')],qs[_0x5f04('0x2e')](_0x4cca0b['query'][_0x5f04('0x2e')]));_0x2c7354['attributes']=_0x2c7354[_0x5f04('0x2d')][_0x5f04('0x2f')]?_0x2c7354['attributes']:_0x1fa7de[_0x5f04('0x29')];if(!_0x4cca0b[_0x5f04('0x2b')][_0x5f04('0x30')]('nolimit')){_0x2c7354[_0x5f04('0x31')]=qs[_0x5f04('0x31')](_0x4cca0b[_0x5f04('0x2b')][_0x5f04('0x31')]);_0x2c7354[_0x5f04('0x1d')]=qs[_0x5f04('0x1d')](_0x4cca0b['query'][_0x5f04('0x1d')]);}_0x2c7354[_0x5f04('0x32')]=qs[_0x5f04('0x33')](_0x4cca0b['query'][_0x5f04('0x33')]);_0x2c7354[_0x5f04('0x34')]=qs[_0x5f04('0x35')](_[_0x5f04('0x36')](_0x4cca0b[_0x5f04('0x2b')],_0x1fa7de['filters']));if(_0x4cca0b['query'][_0x5f04('0x37')]){_0x2c7354[_0x5f04('0x34')]=_[_0x5f04('0x38')](_0x2c7354['where'],{'$or':_[_0x5f04('0x39')](_0x3bf192,function(_0x39b229){if(_0x39b229[_0x5f04('0x3a')][_0x5f04('0x3b')]!==_0x5f04('0x3c')){var _0x136d0e={};_0x136d0e[_0x39b229[_0x5f04('0x3d')]]={'$like':'%'+_0x4cca0b[_0x5f04('0x2b')]['filter']+'%'};return _0x136d0e;}})});}_0x2c7354=_[_0x5f04('0x38')]({},_0x2c7354,_0x4cca0b[_0x5f04('0x3e')]);var _0x493256={'where':_0x2c7354[_0x5f04('0x34')]};return db[_0x5f04('0x27')][_0x5f04('0x1c')](_0x493256)[_0x5f04('0x22')](function(_0x414732){_0x1cc385[_0x5f04('0x1c')]=_0x414732;if(_0x4cca0b[_0x5f04('0x2b')][_0x5f04('0x3f')]){_0x2c7354['include']=[{'all':!![]}];}return db[_0x5f04('0x27')][_0x5f04('0x40')](_0x2c7354);})[_0x5f04('0x22')](function(_0x2b4513){_0x1cc385['rows']=_0x2b4513;return _0x1cc385;})[_0x5f04('0x22')](respondWithFilteredResult(_0x284914,_0x2c7354))[_0x5f04('0x41')](handleError(_0x284914,null));};exports['show']=function(_0x165f0a,_0x54f3d5){var _0x26ebee={'raw':!![],'where':{'id':_0x165f0a[_0x5f04('0x42')]['id']}},_0x49e555={};_0x49e555[_0x5f04('0x29')]=_['keys'](db[_0x5f04('0x27')][_0x5f04('0x28')]);_0x49e555[_0x5f04('0x2b')]=_['keys'](_0x165f0a[_0x5f04('0x2b')]);_0x49e555[_0x5f04('0x35')]=_[_0x5f04('0x2c')](_0x49e555[_0x5f04('0x29')],_0x49e555['query']);_0x26ebee['attributes']=_[_0x5f04('0x2c')](_0x49e555[_0x5f04('0x29')],qs[_0x5f04('0x2e')](_0x165f0a[_0x5f04('0x2b')][_0x5f04('0x2e')]));_0x26ebee[_0x5f04('0x2d')]=_0x26ebee[_0x5f04('0x2d')][_0x5f04('0x2f')]?_0x26ebee[_0x5f04('0x2d')]:_0x49e555[_0x5f04('0x29')];if(_0x165f0a[_0x5f04('0x2b')][_0x5f04('0x3f')]){_0x26ebee[_0x5f04('0x43')]=[{'all':!![]}];}_0x26ebee=_[_0x5f04('0x38')]({},_0x26ebee,_0x165f0a[_0x5f04('0x3e')]);return db[_0x5f04('0x27')][_0x5f04('0x44')](_0x26ebee)[_0x5f04('0x22')](handleEntityNotFound(_0x54f3d5,null))[_0x5f04('0x22')](respondWithResult(_0x54f3d5,null))[_0x5f04('0x41')](handleError(_0x54f3d5,null));};exports['create']=function(_0x886002,_0x4e9ad2){return db[_0x5f04('0x27')][_0x5f04('0x45')](_0x886002[_0x5f04('0x46')],{})[_0x5f04('0x22')](respondWithResult(_0x4e9ad2,0xc9))[_0x5f04('0x41')](handleError(_0x4e9ad2,null));};exports[_0x5f04('0x21')]=function(_0x2c766a,_0x958696){if(_0x2c766a[_0x5f04('0x46')]['id']){delete _0x2c766a[_0x5f04('0x46')]['id'];}return db[_0x5f04('0x27')][_0x5f04('0x44')]({'where':{'id':_0x2c766a[_0x5f04('0x42')]['id']}})[_0x5f04('0x22')](handleEntityNotFound(_0x958696,null))[_0x5f04('0x22')](saveUpdates(_0x2c766a[_0x5f04('0x46')],null))[_0x5f04('0x22')](respondWithResult(_0x958696,null))[_0x5f04('0x41')](handleError(_0x958696,null));};exports[_0x5f04('0x23')]=function(_0xc781e,_0x388780){return db[_0x5f04('0x27')][_0x5f04('0x44')]({'where':{'id':_0xc781e[_0x5f04('0x42')]['id']}})[_0x5f04('0x22')](handleEntityNotFound(_0x388780,null))[_0x5f04('0x22')](removeEntity(_0x388780,null))[_0x5f04('0x41')](handleError(_0x388780,null));}; \ No newline at end of file +var _0xd540=['sendStatus','status','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','SmsApplication','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x1ef3a8,_0x18083c){var _0x84ccc6=function(_0x2650bf){while(--_0x2650bf){_0x1ef3a8['push'](_0x1ef3a8['shift']());}};_0x84ccc6(++_0x18083c);}(_0xd540,0x7d));var _0x0d54=function(_0x23733d,_0x56f0a1){_0x23733d=_0x23733d-0x0;var _0x4a9cc4=_0xd540[_0x23733d];return _0x4a9cc4;};'use strict';var pdf=require(_0x0d54('0x0'));var emlformat=require(_0x0d54('0x1'));var rimraf=require(_0x0d54('0x2'));var zipdir=require(_0x0d54('0x3'));var jsonpatch=require(_0x0d54('0x4'));var rp=require(_0x0d54('0x5'));var moment=require(_0x0d54('0x6'));var BPromise=require(_0x0d54('0x7'));var Mustache=require(_0x0d54('0x8'));var util=require(_0x0d54('0x9'));var path=require(_0x0d54('0xa'));var sox=require(_0x0d54('0xb'));var csv=require(_0x0d54('0xc'));var ejs=require(_0x0d54('0xd'));var fs=require('fs');var _=require(_0x0d54('0xe'));var squel=require('squel');var crypto=require(_0x0d54('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x0d54('0x10'));var toCsv=require(_0x0d54('0xc'));var querystring=require('querystring');var Papa=require(_0x0d54('0x11'));var Redis=require(_0x0d54('0x12'));var authService=require(_0x0d54('0x13'));var qs=require(_0x0d54('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d54('0x15'))(_0x0d54('0x16'));var utils=require(_0x0d54('0x17'));var config=require('../../config/environment');var db=require(_0x0d54('0x18'))['db'];function respondWithStatusCode(_0x28d02e,_0x1d79e6){_0x1d79e6=_0x1d79e6||0xcc;return function(_0x35c26f){if(_0x35c26f){return _0x28d02e[_0x0d54('0x19')](_0x1d79e6);}return _0x28d02e[_0x0d54('0x1a')](_0x1d79e6)['end']();};}function respondWithResult(_0x5d81dd,_0x4933a6){_0x4933a6=_0x4933a6||0xc8;return function(_0x27f802){if(_0x27f802){return _0x5d81dd[_0x0d54('0x1a')](_0x4933a6)['json'](_0x27f802);}};}function respondWithFilteredResult(_0x49110c,_0x9f54bb){return function(_0xfab612){if(_0xfab612){var _0x6eb19d=_0xfab612[_0x0d54('0x1b')],_0x288e20=_0x9f54bb[_0x0d54('0x1c')],_0x1f85e1=_0x9f54bb[_0x0d54('0x1c')]+_0x9f54bb['limit'],_0x58c3e0;if(_0x1f85e1>=_0x6eb19d){_0x1f85e1=_0x6eb19d;_0x58c3e0=0xc8;}else{_0x58c3e0=0xce;}_0x49110c[_0x0d54('0x1a')](_0x58c3e0);return _0x49110c[_0x0d54('0x1d')](_0x0d54('0x1e'),_0x288e20+'-'+_0x1f85e1+'/'+_0x6eb19d)['json'](_0xfab612);}return null;};}function patchUpdates(_0x340f79){return function(_0x389f71){try{jsonpatch['apply'](_0x389f71,_0x340f79,!![]);}catch(_0x558d3c){return BPromise[_0x0d54('0x1f')](_0x558d3c);}return _0x389f71[_0x0d54('0x20')]();};}function saveUpdates(_0x12ba6c,_0x38d485){return function(_0x102e25){if(_0x102e25){return _0x102e25[_0x0d54('0x21')](_0x12ba6c)[_0x0d54('0x22')](function(_0xba524c){return _0xba524c;});}return null;};}function removeEntity(_0x20162e,_0x5ddab8){return function(_0x3c6709){if(_0x3c6709){return _0x3c6709[_0x0d54('0x23')]()[_0x0d54('0x22')](function(){_0x20162e[_0x0d54('0x1a')](0xcc)[_0x0d54('0x24')]();});}};}function handleEntityNotFound(_0x432664,_0x1c86a9){return function(_0x886ae0){if(!_0x886ae0){_0x432664[_0x0d54('0x19')](0x194);}return _0x886ae0;};}function handleError(_0x5b9f32,_0x580026){_0x580026=_0x580026||0x1f4;return function(_0x5a6c5f){logger[_0x0d54('0x25')](_0x5a6c5f['stack']);if(_0x5a6c5f[_0x0d54('0x26')]){delete _0x5a6c5f[_0x0d54('0x26')];}_0x5b9f32[_0x0d54('0x1a')](_0x580026)[_0x0d54('0x27')](_0x5a6c5f);};}exports[_0x0d54('0x28')]=function(_0x21d39b,_0x6af794){var _0x34f888={},_0x295713={},_0x2a2566={'count':0x0,'rows':[]};var _0x8d9760=db[_0x0d54('0x29')]['rawAttributes'];_0x295713[_0x0d54('0x2a')]=_[_0x0d54('0x2b')](_0x8d9760);_0x295713[_0x0d54('0x2c')]=_[_0x0d54('0x2b')](_0x21d39b[_0x0d54('0x2c')]);_0x295713[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x295713[_0x0d54('0x2a')],_0x295713['query']);_0x34f888['attributes']=_['intersection'](_0x295713['model'],qs[_0x0d54('0x2f')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x2f')]));_0x34f888[_0x0d54('0x30')]=_0x34f888[_0x0d54('0x30')][_0x0d54('0x31')]?_0x34f888[_0x0d54('0x30')]:_0x295713['model'];if(!_0x21d39b['query'][_0x0d54('0x32')](_0x0d54('0x33'))){_0x34f888['limit']=qs[_0x0d54('0x34')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x34')]);_0x34f888[_0x0d54('0x1c')]=qs[_0x0d54('0x1c')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x1c')]);}_0x34f888['order']=qs[_0x0d54('0x35')](_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x35')]);_0x34f888[_0x0d54('0x36')]=qs[_0x0d54('0x2d')](_[_0x0d54('0x37')](_0x21d39b[_0x0d54('0x2c')],_0x295713[_0x0d54('0x2d')]));if(_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x38')]){_0x34f888['where']=_['merge'](_0x34f888[_0x0d54('0x36')],{'$or':_[_0x0d54('0x39')](_0x8d9760,function(_0x41fe04){if(_0x41fe04[_0x0d54('0x3a')][_0x0d54('0x3b')]!==_0x0d54('0x3c')){var _0x37ab06={};_0x37ab06[_0x41fe04[_0x0d54('0x3d')]]={'$like':'%'+_0x21d39b[_0x0d54('0x2c')]['filter']+'%'};return _0x37ab06;}})});}_0x34f888=_[_0x0d54('0x3e')]({},_0x34f888,_0x21d39b[_0x0d54('0x3f')]);var _0x12ae2b={'where':_0x34f888[_0x0d54('0x36')]};return db[_0x0d54('0x29')][_0x0d54('0x1b')](_0x12ae2b)[_0x0d54('0x22')](function(_0x563ebc){_0x2a2566[_0x0d54('0x1b')]=_0x563ebc;if(_0x21d39b[_0x0d54('0x2c')][_0x0d54('0x40')]){_0x34f888[_0x0d54('0x41')]=[{'all':!![]}];}return db[_0x0d54('0x29')][_0x0d54('0x42')](_0x34f888);})[_0x0d54('0x22')](function(_0x1fd297){_0x2a2566[_0x0d54('0x43')]=_0x1fd297;return _0x2a2566;})[_0x0d54('0x22')](respondWithFilteredResult(_0x6af794,_0x34f888))[_0x0d54('0x44')](handleError(_0x6af794,null));};exports[_0x0d54('0x45')]=function(_0xce3ab0,_0x4b599a){var _0x4db01e={'raw':!![],'where':{'id':_0xce3ab0[_0x0d54('0x46')]['id']}},_0x1c60c7={};_0x1c60c7[_0x0d54('0x2a')]=_[_0x0d54('0x2b')](db['SmsApplication'][_0x0d54('0x47')]);_0x1c60c7[_0x0d54('0x2c')]=_[_0x0d54('0x2b')](_0xce3ab0[_0x0d54('0x2c')]);_0x1c60c7[_0x0d54('0x2d')]=_[_0x0d54('0x2e')](_0x1c60c7[_0x0d54('0x2a')],_0x1c60c7[_0x0d54('0x2c')]);_0x4db01e[_0x0d54('0x30')]=_[_0x0d54('0x2e')](_0x1c60c7[_0x0d54('0x2a')],qs[_0x0d54('0x2f')](_0xce3ab0[_0x0d54('0x2c')][_0x0d54('0x2f')]));_0x4db01e[_0x0d54('0x30')]=_0x4db01e[_0x0d54('0x30')][_0x0d54('0x31')]?_0x4db01e['attributes']:_0x1c60c7[_0x0d54('0x2a')];if(_0xce3ab0['query'][_0x0d54('0x40')]){_0x4db01e['include']=[{'all':!![]}];}_0x4db01e=_['merge']({},_0x4db01e,_0xce3ab0[_0x0d54('0x3f')]);return db[_0x0d54('0x29')]['find'](_0x4db01e)[_0x0d54('0x22')](handleEntityNotFound(_0x4b599a,null))['then'](respondWithResult(_0x4b599a,null))[_0x0d54('0x44')](handleError(_0x4b599a,null));};exports['create']=function(_0x524714,_0x2b7b73){return db[_0x0d54('0x29')][_0x0d54('0x48')](_0x524714[_0x0d54('0x49')],{})[_0x0d54('0x22')](respondWithResult(_0x2b7b73,0xc9))[_0x0d54('0x44')](handleError(_0x2b7b73,null));};exports[_0x0d54('0x21')]=function(_0x42e00a,_0x4e885e){if(_0x42e00a[_0x0d54('0x49')]['id']){delete _0x42e00a[_0x0d54('0x49')]['id'];}return db[_0x0d54('0x29')][_0x0d54('0x4a')]({'where':{'id':_0x42e00a[_0x0d54('0x46')]['id']}})[_0x0d54('0x22')](handleEntityNotFound(_0x4e885e,null))['then'](saveUpdates(_0x42e00a[_0x0d54('0x49')],null))[_0x0d54('0x22')](respondWithResult(_0x4e885e,null))[_0x0d54('0x44')](handleError(_0x4e885e,null));};exports[_0x0d54('0x23')]=function(_0x3ffa52,_0x181c5f){return db[_0x0d54('0x29')][_0x0d54('0x4a')]({'where':{'id':_0x3ffa52['params']['id']}})[_0x0d54('0x22')](handleEntityNotFound(_0x181c5f,null))[_0x0d54('0x22')](removeEntity(_0x181c5f,null))[_0x0d54('0x44')](handleError(_0x181c5f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 9259349..e23e6e9 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 _0xc4aa=['bluebird','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util','../../config/logger','api','moment'];(function(_0x192978,_0x56245c){var _0x32262c=function(_0xe697e7){while(--_0xe697e7){_0x192978['push'](_0x192978['shift']());}};_0x32262c(++_0x56245c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xc4aa[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','util','../../config/logger','api','moment'];(function(_0x5b5998,_0x49aac3){var _0x29b320=function(_0x4b42fe){while(--_0x4b42fe){_0x5b5998['push'](_0x5b5998['shift']());}};_0x29b320(++_0x49aac3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xc4aa[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 9a21bf5..1aa3f7e 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 _0x0aac=['debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','SmsApplication,\x20%s,\x20%s'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x0aac,0xff));var _0xc0aa=function(_0x296d93,_0x27ee37){_0x296d93=_0x296d93-0x0;var _0xba3f66=_0x0aac[_0x296d93];return _0xba3f66;};'use strict';var _=require(_0xc0aa('0x0'));var util=require(_0xc0aa('0x1'));var moment=require(_0xc0aa('0x2'));var BPromise=require(_0xc0aa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc0aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0aa('0x5'))(_0xc0aa('0x6'));var config=require(_0xc0aa('0x7'));var jayson=require(_0xc0aa('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0349,_0x9fc9cb,_0x143c5f){return new BPromise(function(_0x5b87b4,_0x40c571){return client[_0xc0aa('0x9')](_0x4e0349,_0x143c5f)['then'](function(_0x7d7d1b){logger['info'](_0xc0aa('0xa'),_0x9fc9cb,'request\x20sent');logger[_0xc0aa('0xb')](_0xc0aa('0xc'),_0x9fc9cb,_0xc0aa('0xd'),JSON[_0xc0aa('0xe')](_0x7d7d1b));if(_0x7d7d1b['error']){if(_0x7d7d1b[_0xc0aa('0xf')][_0xc0aa('0x10')]===0x1f4){logger[_0xc0aa('0xf')](_0xc0aa('0xa'),_0x9fc9cb,_0x7d7d1b[_0xc0aa('0xf')]['message']);return _0x40c571(_0x7d7d1b[_0xc0aa('0xf')][_0xc0aa('0x11')]);}logger[_0xc0aa('0xf')](_0xc0aa('0xa'),_0x9fc9cb,_0x7d7d1b[_0xc0aa('0xf')]['message']);return _0x5b87b4(_0x7d7d1b[_0xc0aa('0xf')][_0xc0aa('0x11')]);}else{logger['info'](_0xc0aa('0xa'),_0x9fc9cb,_0xc0aa('0xd'));_0x5b87b4(_0x7d7d1b[_0xc0aa('0x12')]['message']);}})['catch'](function(_0x314385){logger['error'](_0xc0aa('0xa'),_0x9fc9cb,_0x314385);_0x40c571(_0x314385);});});} \ No newline at end of file +var _0x21ca=['util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x305a06,_0xe9a81c){var _0x145f84=function(_0x3f7ec2){while(--_0x3f7ec2){_0x305a06['push'](_0x305a06['shift']());}};_0x145f84(++_0xe9a81c);}(_0x21ca,0xe5));var _0xa21c=function(_0x27a21c,_0x431713){_0x27a21c=_0x27a21c-0x0;var _0x47bbcf=_0x21ca[_0x27a21c];return _0x47bbcf;};'use strict';var _=require(_0xa21c('0x0'));var util=require(_0xa21c('0x1'));var moment=require(_0xa21c('0x2'));var BPromise=require(_0xa21c('0x3'));var rs=require(_0xa21c('0x4'));var fs=require('fs');var Redis=require(_0xa21c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa21c('0x6'));var config=require(_0xa21c('0x7'));var jayson=require(_0xa21c('0x8'));var client=jayson[_0xa21c('0x9')][_0xa21c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eeb36,_0x5a6ace,_0x1dc100){return new BPromise(function(_0x24daa8,_0x189f5e){return client['request'](_0x3eeb36,_0x1dc100)[_0xa21c('0xb')](function(_0x4aa830){logger[_0xa21c('0xc')]('SmsApplication,\x20%s,\x20%s',_0x5a6ace,'request\x20sent');logger[_0xa21c('0xd')](_0xa21c('0xe'),_0x5a6ace,_0xa21c('0xf'),JSON[_0xa21c('0x10')](_0x4aa830));if(_0x4aa830[_0xa21c('0x11')]){if(_0x4aa830[_0xa21c('0x11')][_0xa21c('0x12')]===0x1f4){logger[_0xa21c('0x11')](_0xa21c('0x13'),_0x5a6ace,_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);return _0x189f5e(_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);}logger['error'](_0xa21c('0x13'),_0x5a6ace,_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);return _0x24daa8(_0x4aa830[_0xa21c('0x11')][_0xa21c('0x14')]);}else{logger[_0xa21c('0xc')](_0xa21c('0x13'),_0x5a6ace,_0xa21c('0xf'));_0x24daa8(_0x4aa830[_0xa21c('0x15')][_0xa21c('0x14')]);}})[_0xa21c('0x16')](function(_0x289984){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5a6ace,_0x289984);_0x189f5e(_0x289984);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index a0d174a..7bb1208 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 _0x8dc1=['removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','destroy'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x8dc1,0x12e));var _0x18dc=function(_0x17c260,_0x53028c){_0x17c260=_0x17c260-0x0;var _0x518453=_0x8dc1[_0x17c260];return _0x518453;};'use strict';var multer=require(_0x18dc('0x0'));var util=require(_0x18dc('0x1'));var path=require(_0x18dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x18dc('0x3'));var router=express[_0x18dc('0x4')]();var auth=require(_0x18dc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x18dc('0x6'));var controller=require(_0x18dc('0x7'));router['get']('/',auth[_0x18dc('0x8')](),controller[_0x18dc('0x9')]);router['get']('/describe',auth[_0x18dc('0x8')](),controller['describe']);router[_0x18dc('0xa')](_0x18dc('0xb'),auth[_0x18dc('0x8')](),controller[_0x18dc('0xc')]);router['get'](_0x18dc('0xd'),auth[_0x18dc('0x8')](),controller['getMessages']);router[_0x18dc('0xa')]('/:id/download',auth[_0x18dc('0x8')](),controller[_0x18dc('0xe')]);router[_0x18dc('0xf')]('/',auth['isAuthenticated'](),controller[_0x18dc('0x10')]);router['post'](_0x18dc('0xd'),auth['isAuthenticated'](),controller[_0x18dc('0x11')]);router[_0x18dc('0xf')](_0x18dc('0x12'),auth[_0x18dc('0x8')](),interaction[_0x18dc('0x13')](_0x18dc('0x14'),_0x18dc('0x15')),controller[_0x18dc('0x16')]);router[_0x18dc('0x17')](_0x18dc('0xb'),auth[_0x18dc('0x8')](),interaction['tracked'](_0x18dc('0x14'),_0x18dc('0x18')),controller[_0x18dc('0x19')]);router[_0x18dc('0x1a')](_0x18dc('0xb'),auth[_0x18dc('0x8')](),interaction['tracked']('sms','smsinteraction:destroy'),controller[_0x18dc('0x1b')]);router['delete']('/:id/tags',auth[_0x18dc('0x8')](),controller[_0x18dc('0x1c')]);module[_0x18dc('0x1d')]=router; \ No newline at end of file +var _0x0ded=['./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','post','create','/:id/messages','tracked','sms','smsinteraction:addtags','addTags','put','update','smsinteraction:destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x230ba2,_0x49d042){var _0x1d18e1=function(_0x3ae23e){while(--_0x3ae23e){_0x230ba2['push'](_0x230ba2['shift']());}};_0x1d18e1(++_0x49d042);}(_0x0ded,0x14c));var _0xd0de=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x0ded[_0x466af7];return _0x348c96;};'use strict';var multer=require(_0xd0de('0x0'));var util=require(_0xd0de('0x1'));var path=require(_0xd0de('0x2'));var timeout=require(_0xd0de('0x3'));var express=require(_0xd0de('0x4'));var router=express[_0xd0de('0x5')]();var auth=require(_0xd0de('0x6'));var interaction=require(_0xd0de('0x7'));var config=require(_0xd0de('0x8'));var controller=require(_0xd0de('0x9'));router[_0xd0de('0xa')]('/',auth[_0xd0de('0xb')](),controller['index']);router[_0xd0de('0xa')](_0xd0de('0xc'),auth[_0xd0de('0xb')](),controller[_0xd0de('0xd')]);router['get'](_0xd0de('0xe'),auth[_0xd0de('0xb')](),controller[_0xd0de('0xf')]);router[_0xd0de('0xa')]('/:id/messages',auth[_0xd0de('0xb')](),controller[_0xd0de('0x10')]);router[_0xd0de('0xa')](_0xd0de('0x11'),auth[_0xd0de('0xb')](),controller['download']);router[_0xd0de('0x12')]('/',auth['isAuthenticated'](),controller[_0xd0de('0x13')]);router[_0xd0de('0x12')](_0xd0de('0x14'),auth['isAuthenticated'](),controller['addMessage']);router[_0xd0de('0x12')]('/:id/tags',auth[_0xd0de('0xb')](),interaction[_0xd0de('0x15')](_0xd0de('0x16'),_0xd0de('0x17')),controller[_0xd0de('0x18')]);router[_0xd0de('0x19')](_0xd0de('0xe'),auth[_0xd0de('0xb')](),interaction[_0xd0de('0x15')]('sms','smsinteraction:update'),controller[_0xd0de('0x1a')]);router['delete'](_0xd0de('0xe'),auth[_0xd0de('0xb')](),interaction['tracked'](_0xd0de('0x16'),_0xd0de('0x1b')),controller['destroy']);router[_0xd0de('0x1c')](_0xd0de('0x1d'),auth[_0xd0de('0xb')](),controller['removeTags']);module[_0xd0de('0x1e')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index e2a5089..fb2ee6f 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 _0x48e8=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x465b8c,_0x320c1b){var _0x459de9=function(_0x3bd93f){while(--_0x3bd93f){_0x465b8c['push'](_0x465b8c['shift']());}};_0x459de9(++_0x320c1b);}(_0x48e8,0x1ab));var _0x848e=function(_0x443947,_0x293f32){_0x443947=_0x443947-0x0;var _0x4ba739=_0x48e8[_0x443947];return _0x4ba739;};'use strict';var Sequelize=require(_0x848e('0x0'));var moment=require(_0x848e('0x1'));module[_0x848e('0x2')]={'closed':{'type':Sequelize[_0x848e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x848e('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x848e('0x5')]},'phone':{'type':Sequelize[_0x848e('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x848e('0x6')]('in',_0x848e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x848e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x848e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb686=['sequelize','moment','exports','STRING','DATE','ENUM','out'];(function(_0x288ca8,_0x47b4cb){var _0x17ebc4=function(_0x3e7bc2){while(--_0x3e7bc2){_0x288ca8['push'](_0x288ca8['shift']());}};_0x17ebc4(++_0x47b4cb);}(_0xb686,0xd2));var _0x6b68=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb686[_0x122096];return _0x3d1966;};'use strict';var Sequelize=require(_0x6b68('0x0'));var moment=require(_0x6b68('0x1'));module[_0x6b68('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6b68('0x3')]},'note':{'type':Sequelize[_0x6b68('0x3')]},'phone':{'type':Sequelize[_0x6b68('0x3')]},'read1stAt':{'type':Sequelize[_0x6b68('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6b68('0x5')]('in',_0x6b68('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6b68('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6b68('0x5')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ed5816e..f7c8cd4 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 _0x85d0=['a.id\x20=\x20i.SmsAccountId','expr','parse','advancedFilter','createdAt','dateStart','startOf','day','utc','format','and','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','condition','value','TagId','isArray','tableAlias','\x20IN\x20?','\x20=\x20?','LIKE','ContactId','c.firstName','\x20LIKE\x20?','c.lastName','Messages.count','c.email','\x20<\x20?','map','isNil','isEmpty','forEach','concat','$gte','filter','isNumeric','push','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','DESC','Sequelize','SELECT','clone','read','%s\x20=\x200','having','`Messages.count`\x20=\x200','%s\x20>\x200','`Messages.count`\x20>\x200','tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','sequelize','keyBy','merge','SmsInteraction','a.key','i.*','Contact.firstName','Contact.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','u.fullname','User.name','TagIds','t.id\x20=\x20it.TagId','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','catch','show','params','fields','include','options','create','body','find','describe','addMessage','SmsMessage','ids','omit','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','Tag','emit','removeTags','download','root','server','files','tmp','attachments','transcript-%d-%s.zip','secret','User','fullname','Contact','firstName','SmsAccount','Account','Owner','40px','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','mkdirSync','closed','closedAt','disposition','Messages','direction','out','System','lastName','views','transcript-','.pdf','log','err','unlinkSync','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./smsInteraction.socket','register','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','COUNT(*)','sms_messages','where','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','user_has_sms_interactions','ui.UserId\x20=\x20i.UserId','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts'];(function(_0x449f5b,_0x148b55){var _0x5afc7c=function(_0x1bb10e){while(--_0x1bb10e){_0x449f5b['push'](_0x449f5b['shift']());}};_0x5afc7c(++_0x148b55);}(_0x85d0,0x164));var _0x085d=function(_0x4e55ab,_0x1ca615){_0x4e55ab=_0x4e55ab-0x0;var _0x420f6d=_0x85d0[_0x4e55ab];return _0x420f6d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x085d('0x0'));var rp=require(_0x085d('0x1'));var moment=require(_0x085d('0x2'));var BPromise=require(_0x085d('0x3'));var Mustache=require(_0x085d('0x4'));var util=require(_0x085d('0x5'));var path=require('path');var sox=require(_0x085d('0x6'));var csv=require('to-csv');var ejs=require(_0x085d('0x7'));var fs=require('fs');var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0xc'));var querystring=require(_0x085d('0xd'));var Papa=require(_0x085d('0xe'));var Redis=require(_0x085d('0xf'));var authService=require(_0x085d('0x10'));var qs=require(_0x085d('0x11'));var hardwareService=require(_0x085d('0x12'));var logger=require('../../config/logger')(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var db=require(_0x085d('0x16'))['db'];config['redis']=_[_0x085d('0x17')](config[_0x085d('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x085d('0x19'))(new Redis(config[_0x085d('0x18')]));require(_0x085d('0x1a'))[_0x085d('0x1b')](socket);function respondWithStatusCode(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xcc;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['sendStatus'](_0x4b87b9);}return _0x5a5252['status'](_0x4b87b9)[_0x085d('0x1c')]();};}function respondWithResult(_0x334263,_0x1d041b){_0x1d041b=_0x1d041b||0xc8;return function(_0x5f8e18){if(_0x5f8e18){return _0x334263[_0x085d('0x1d')](_0x1d041b)['json'](_0x5f8e18);}};}function respondWithFilteredResult(_0x2b29be,_0x470a69){return function(_0x1efea9){if(_0x1efea9){var _0x1b0a6c=_0x1efea9[_0x085d('0x1e')],_0x3e566f=_0x470a69[_0x085d('0x1f')],_0x1c9de6=_0x470a69['offset']+_0x470a69[_0x085d('0x20')],_0x5c046e;if(_0x1c9de6>=_0x1b0a6c){_0x1c9de6=_0x1b0a6c;_0x5c046e=0xc8;}else{_0x5c046e=0xce;}_0x2b29be[_0x085d('0x1d')](_0x5c046e);return _0x2b29be[_0x085d('0x21')](_0x085d('0x22'),_0x3e566f+'-'+_0x1c9de6+'/'+_0x1b0a6c)[_0x085d('0x23')](_0x1efea9);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x24')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x25')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x26')](_0x5b3f9c)[_0x085d('0x27')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x28')]()[_0x085d('0x27')](function(){_0x4715d6[_0x085d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x29')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x2a')]);if(_0x5e5228[_0x085d('0x2b')]){delete _0x5e5228[_0x085d('0x2b')];}_0x300295['status'](_0x4b9032)[_0x085d('0x2c')](_0x5e5228);};}exports[_0x085d('0x2d')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=db['SmsInteraction'][_0x085d('0x2e')];_0x2eae2c[_0x085d('0x2f')]=_['keys'](_0x26aa90);_0x2eae2c[_0x085d('0x30')]=_[_0x085d('0x31')](_0x3faf6b['query']);_0x2eae2c[_0x085d('0x32')]=_[_0x085d('0x33')](_0x2eae2c[_0x085d('0x2f')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x34')]=_[_0x085d('0x33')](_0x2eae2c[_0x085d('0x2f')],qs['fields'](_0x3faf6b[_0x085d('0x30')]['fields']));_0x2f670c[_0x085d('0x34')]=_0x2f670c[_0x085d('0x34')][_0x085d('0x35')]?_0x2f670c[_0x085d('0x34')]:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x30')][_0x085d('0x36')](_0x085d('0x37'))){_0x2f670c[_0x085d('0x20')]=qs['limit'](_0x3faf6b['query'][_0x085d('0x20')]);_0x2f670c[_0x085d('0x1f')]=qs[_0x085d('0x1f')](_0x3faf6b[_0x085d('0x30')][_0x085d('0x1f')]);}_0x2f670c[_0x085d('0x38')]=qs[_0x085d('0x39')](_0x3faf6b[_0x085d('0x30')][_0x085d('0x39')]);_0x2f670c['where']=qs[_0x085d('0x32')](_[_0x085d('0x3a')](_0x3faf6b['query'],_0x2eae2c[_0x085d('0x32')]));var _0x5c82ef=[];var _0x1cc755=squel[_0x085d('0x3b')]()['field']('id')[_0x085d('0x3c')](_0x085d('0x2b'))[_0x085d('0x3c')](_0x085d('0x3d'))[_0x085d('0x3e')]('tools_tags');var _0x3fc23c=squel['select']()['field'](_0x085d('0x3f'))[_0x085d('0x3e')](_0x085d('0x40'),'me')[_0x085d('0x41')](_0x085d('0x42'))['where'](_0x085d('0x43'))['where'](_0x085d('0x44'));var _0x65ec6d=squel[_0x085d('0x3b')]()['field'](_0x085d('0x45'))['field'](_0x085d('0x46'))[_0x085d('0x3e')]('user_has_sms_interactions','ui')[_0x085d('0x47')](_0x085d('0x48'),'u',_0x085d('0x49'));var _0x51649b=squel['select']()[_0x085d('0x3e')](_0x085d('0x4a'),'i')[_0x085d('0x47')](_0x085d('0x4b'),'ui',_0x085d('0x4c'))[_0x085d('0x47')](_0x085d('0x48'),'u',_0x085d('0x49'))[_0x085d('0x47')](_0x085d('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x085d('0x48'),'o',_0x085d('0x4e'))[_0x085d('0x47')](_0x085d('0x4f'),'a',_0x085d('0x50'))[_0x085d('0x47')](_0x085d('0x40'),'me',_0x085d('0x42'));var _0x1041ff=squel[_0x085d('0x51')]();if(_0x3faf6b[_0x085d('0x30')]['advancedFilter']){var _0x153218=JSON[_0x085d('0x52')](_0x3faf6b[_0x085d('0x30')][_0x085d('0x53')]);_[_0x085d('0x31')](_0x153218)['forEach'](function(_0x13ba2d){var _0x544729=_0x153218[_0x13ba2d];if(_0x13ba2d===_0x085d('0x54')){var _0x4d5eb1=moment(_0x544729['value'][_0x085d('0x55')])[_0x085d('0x56')](_0x085d('0x57'))[_0x085d('0x58')]()[_0x085d('0x59')]();var _0x52148f=moment(_0x52148f)['utc']()['endOf']('day')['format']();_0x1041ff[_0x085d('0x5a')](_0x085d('0x5b'),_0x4d5eb1,_0x52148f);}else{if(_['isArray'](_0x544729[_0x085d('0x5c')])){_0x544729['condition']['forEach'](function(_0x415a4b){switch(_0x544729[_0x085d('0x5c')][_0x085d('0x5d')]){case'IS':if(_0x13ba2d!==_0x085d('0x5e')&&_0x13ba2d!=='Messages.count'){if(_[_0x085d('0x5f')](_0x544729['value'])&&_0x544729[_0x085d('0x5d')][_0x085d('0x35')]>0x1){_0x1041ff['and'](_0x544729[_0x085d('0x60')]+'.'+_0x13ba2d+_0x085d('0x61'),_0x544729[_0x085d('0x5d')]);}else{_0x1041ff[_0x085d('0x5a')](_0x544729['tableAlias']+'.'+_0x13ba2d+_0x085d('0x62'),_0x544729['value'][0x0]);}}break;case'=':_0x1041ff[_0x085d('0x5a')](_0x544729['tableAlias']+'.'+_0x13ba2d+'\x20=\x20?',_0x544729[_0x085d('0x5d')]);break;case _0x085d('0x63'):if(_0x13ba2d===_0x085d('0x64')){_0x1041ff[_0x085d('0x5a')](_0x085d('0x65')+_0x085d('0x66'),'%'+_0x544729[_0x085d('0x5d')]+'%');_0x1041ff['or'](_0x085d('0x67')+'\x20LIKE\x20?','%'+_0x544729['value']+'%');_0x1041ff['or']('c.email'+_0x085d('0x66'),'%'+_0x544729['value']+'%');}else{_0x1041ff[_0x085d('0x5a')](_0x544729['tableAlias']+'.'+_0x13ba2d+_0x085d('0x66'),'%'+_0x544729[_0x085d('0x5d')]+'%');}break;case'>':_0x1041ff[_0x085d('0x5a')](_0x544729[_0x085d('0x60')]+'.'+_0x13ba2d+'\x20>\x20?',_0x544729['value']);break;case'<':_0x1041ff[_0x085d('0x5a')](_0x544729[_0x085d('0x60')]+'.'+_0x13ba2d+'\x20<\x20?',_0x544729[_0x085d('0x5d')]);break;}});}else{switch(_0x544729[_0x085d('0x5c')][_0x085d('0x5d')]){case'IS':if(_0x13ba2d!==_0x085d('0x5e')&&_0x13ba2d!==_0x085d('0x68')){if(_[_0x085d('0x5f')](_0x544729[_0x085d('0x5d')])&&_0x544729[_0x085d('0x5d')]['length']>0x1){_0x1041ff[_0x085d('0x5a')](_0x544729['tableAlias']+'.'+_0x13ba2d+_0x085d('0x61'),_0x544729['value']);}else{_0x1041ff[_0x085d('0x5a')](_0x544729['tableAlias']+'.'+_0x13ba2d+_0x085d('0x62'),_0x544729[_0x085d('0x5d')][0x0]);}}break;case'=':_0x1041ff['and'](_0x544729['tableAlias']+'.'+_0x13ba2d+_0x085d('0x62'),_0x544729[_0x085d('0x5d')]);break;case _0x085d('0x63'):if(_0x13ba2d===_0x085d('0x64')){_0x1041ff[_0x085d('0x5a')](_0x085d('0x65')+_0x085d('0x66'),'%'+_0x544729[_0x085d('0x5d')]+'%');_0x1041ff['or'](_0x085d('0x67')+_0x085d('0x66'),'%'+_0x544729[_0x085d('0x5d')]+'%');_0x1041ff['or'](_0x085d('0x69')+_0x085d('0x66'),'%'+_0x544729[_0x085d('0x5d')]+'%');}else{_0x1041ff['and'](_0x544729['tableAlias']+'.'+_0x13ba2d+_0x085d('0x66'),'%'+_0x544729[_0x085d('0x5d')]+'%');}break;case'>':_0x1041ff['and'](_0x544729['tableAlias']+'.'+_0x13ba2d+'\x20>\x20?',_0x544729[_0x085d('0x5d')]);break;case'<':_0x1041ff[_0x085d('0x5a')](_0x544729['tableAlias']+'.'+_0x13ba2d+_0x085d('0x6a'),_0x544729[_0x085d('0x5d')]);break;}}}});}else{var _0x7abaa2=_(Object['keys'](_0x3faf6b[_0x085d('0x30')]))[_0x085d('0x6b')](function(_0x364694){return _0x26aa90[_0x085d('0x36')](_0x364694)?_0x364694:undefined;})['filter'](function(_0x3fc07e){return!_[_0x085d('0x6c')](_0x3fc07e);})['value']();if(!_[_0x085d('0x6d')](_0x7abaa2)){_0x7abaa2[_0x085d('0x6e')](function(_0x1a7ddc){if(_0x1a7ddc==='SmsAccountId'){_0x51649b['where']('i.SmsAccountId\x20IN\x20?',[][_0x085d('0x6f')](_0x3faf6b[_0x085d('0x30')][_0x1a7ddc]));}else if(_0x1a7ddc==='createdAt'){var _0x32ecfa=JSON['parse'](_0x3faf6b[_0x085d('0x30')][_0x1a7ddc])[_0x085d('0x70')];var _0x50fe13=JSON[_0x085d('0x52')](_0x3faf6b[_0x085d('0x30')][_0x1a7ddc])['$lte'];_0x51649b[_0x085d('0x41')](_0x085d('0x5b'),_0x32ecfa,_0x50fe13);}else{_0x51649b[_0x085d('0x41')]('i.'+_0x1a7ddc+_0x085d('0x62'),_0x3faf6b['query'][_0x1a7ddc]);}});}if(_0x3faf6b['query'][_0x085d('0x71')]){var _0x3b469e=_0x3faf6b[_0x085d('0x30')][_0x085d('0x71')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x085d('0x72')](_0x3b469e)){_0x1041ff['or']('i.id\x20LIKE\x20?',_0x3b469e+'%')['or']('i.phone\x20LIKE\x20?',_0x3b469e+'%');}else{var _0x133737=[];_0x3b469e['split']('\x20')[_0x085d('0x6e')](function(_0x1281fe){_0x133737[_0x085d('0x73')]('+'+_0x1281fe[_0x085d('0x74')]());});var _0x557bc3=_0x133737[_0x085d('0x75')]('\x20');_0x1041ff['or'](_0x085d('0x76'),_0x557bc3)['or'](_0x085d('0x77'),_0x3b469e+'%');}}}_0x51649b[_0x085d('0x41')](_0x1041ff);if(_0x2f670c[_0x085d('0x38')]){_0x2f670c[_0x085d('0x38')][_0x085d('0x6e')](function(_0x409a66){_0x51649b[_0x085d('0x38')]('i.'+_0x409a66[0x0],_0x409a66[0x1]===_0x085d('0x78')?![]:!![]);});}_0x51649b['group']('i.id');var _0x15ef7c={'type':db[_0x085d('0x79')]['QueryTypes'][_0x085d('0x7a')],'raw':!![]};var _0x3304b8=_0x51649b[_0x085d('0x7b')]()[_0x085d('0x3c')](_0x085d('0x3f'));if(!_0x3faf6b[_0x085d('0x30')][_0x085d('0x53')]){if(_0x3faf6b[_0x085d('0x30')][_0x085d('0x7c')]){if(_0x3faf6b[_0x085d('0x30')][_0x085d('0x7c')]==0x1){_0x3304b8[_0x085d('0x41')](util[_0x085d('0x59')](_0x085d('0x7d'),_0x3fc23c[_0x085d('0x74')]()));_0x51649b[_0x085d('0x7e')](_0x085d('0x7f'));}else{_0x3304b8['where'](util[_0x085d('0x59')](_0x085d('0x80'),_0x3fc23c[_0x085d('0x74')]()));_0x51649b['having'](_0x085d('0x81'));}}if(_0x3faf6b[_0x085d('0x30')]['tag']){var _0x261ac7=_[_0x085d('0x5f')](_0x3faf6b['query'][_0x085d('0x82')])?_0x3faf6b[_0x085d('0x30')][_0x085d('0x82')]:new Array(_0x3faf6b[_0x085d('0x30')][_0x085d('0x82')]);var _0x5f2071=squel[_0x085d('0x51')]();_0x261ac7[_0x085d('0x6e')](function(_0x5ada01){_0x5f2071['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ada01+',%');});_0x51649b[_0x085d('0x7e')](_0x5f2071);_0x3304b8['left_join'](_0x085d('0x83'),'it',_0x085d('0x84'));_0x3304b8[_0x085d('0x47')](_0x085d('0x85'),'t','t.id\x20=\x20it.TagId');_0x3304b8['where'](_0x085d('0x86'),_0x261ac7);}}else{var _0x153218=JSON[_0x085d('0x52')](_0x3faf6b['query'][_0x085d('0x53')]);_['keys'](_0x153218)[_0x085d('0x6e')](function(_0x116f37){var _0x5592d5=_0x153218[_0x116f37];if(_0x116f37==='TagId'){var _0x1642fc=_0x5592d5['value'];var _0x2ef3d9=squel[_0x085d('0x51')]();_0x1642fc[_0x085d('0x6e')](function(_0x4dc4ee){_0x2ef3d9['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4dc4ee+',%');});_0x51649b[_0x085d('0x7e')](_0x2ef3d9);_0x3304b8[_0x085d('0x47')](_0x085d('0x87'),'it',_0x085d('0x88'));_0x3304b8['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');_0x3304b8[_0x085d('0x41')](_0x085d('0x86'),_0x1642fc);}else if(_0x116f37===_0x085d('0x68')){if(_0x5592d5['value']['length']===0x1){if(_0x5592d5[_0x085d('0x5d')][0x0]===0x1){_0x3304b8[_0x085d('0x41')](util[_0x085d('0x59')]('%s\x20=\x200',_0x3fc23c[_0x085d('0x74')]()));_0x51649b['having'](_0x085d('0x7f'));}else{_0x3304b8[_0x085d('0x41')](util['format'](_0x085d('0x80'),_0x3fc23c[_0x085d('0x74')]()));_0x51649b[_0x085d('0x7e')]('`Messages.count`\x20>\x200');}}}});}db[_0x085d('0x89')][_0x085d('0x30')](_0x3304b8[_0x085d('0x74')](),_0x15ef7c)[_0x085d('0x27')](function(_0x2de70b){_0x3f905d['count']=_0x2de70b[_0x085d('0x35')];if(_0x3f905d[_0x085d('0x1e')]===0x0)return[];return db[_0x085d('0x89')]['query'](_0x1cc755[_0x085d('0x74')](),_0x15ef7c)[_0x085d('0x27')](function(_0x2b797b){_0x5c82ef=_[_0x085d('0x8a')](_0x2b797b,'id');_0x15ef7c=_[_0x085d('0x8b')](_0x15ef7c,{'model':db[_0x085d('0x8c')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x51649b[_0x085d('0x3c')](_0x3fc23c,_0x085d('0x68'));_0x51649b['field'](_0x085d('0x8d'),'Account.key');_0x51649b['field'](_0x085d('0x8e'));_0x51649b[_0x085d('0x3c')](_0x085d('0x65'),_0x085d('0x8f'));_0x51649b[_0x085d('0x3c')](_0x085d('0x67'),_0x085d('0x90'));_0x51649b[_0x085d('0x3c')]('c.email',_0x085d('0x91'));_0x51649b[_0x085d('0x3c')](_0x085d('0x92'),'Contact.phone');_0x51649b[_0x085d('0x3c')](_0x085d('0x93'),_0x085d('0x94'));_0x51649b[_0x085d('0x3c')]('c.fax',_0x085d('0x95'));_0x51649b['field'](_0x085d('0x96'),_0x085d('0x97'));_0x51649b[_0x085d('0x3c')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x085d('0x98'));_0x51649b[_0x085d('0x47')](_0x085d('0x83'),'it','it.SmsInteractionId\x20=\x20i.id');_0x51649b[_0x085d('0x47')](_0x085d('0x85'),'t',_0x085d('0x99'));_0x51649b['limit'](_0x2f670c[_0x085d('0x20')]);_0x51649b[_0x085d('0x1f')](_0x2f670c[_0x085d('0x1f')]);return db[_0x085d('0x89')]['query'](_0x51649b[_0x085d('0x74')](),_0x15ef7c);})[_0x085d('0x27')](function(_0x3230bc){_0x65ec6d[_0x085d('0x41')](_0x085d('0x9a'),_['map'](_0x3230bc,'id'));return db[_0x085d('0x89')][_0x085d('0x30')](_0x65ec6d[_0x085d('0x74')](),_0x15ef7c)[_0x085d('0x27')](function(_0x1ea8a3){var _0x2d786c=_[_0x085d('0x9b')](_0x1ea8a3,_0x085d('0x9c'));_0x3230bc[_0x085d('0x6e')](function(_0x52ba3b){if(_0x2d786c[_0x52ba3b['id']]){_0x52ba3b['Users']=_[_0x085d('0x6b')](_0x2d786c[_0x52ba3b['id']],function(_0x314bda){return{'id':_0x314bda['id']};});}if(_0x52ba3b[_0x085d('0x98')]){_0x52ba3b['Tags']=[];_0x52ba3b['TagIds']['split'](',')[_0x085d('0x6e')](function(_0x2b82e7){_0x52ba3b['Tags'][_0x085d('0x73')](_0x5c82ef[_0x2b82e7]);});}delete _0x52ba3b[_0x085d('0x98')];});return _0x3230bc;});});})[_0x085d('0x27')](function(_0x101e5e){_0x3f905d[_0x085d('0x9d')]=_0x101e5e;return _0x3f905d;})[_0x085d('0x27')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x9e')](handleError(_0x5c7849,null));};exports[_0x085d('0x9f')]=function(_0x3f5407,_0x353451){var _0x47a367={'raw':![],'where':{'id':_0x3f5407[_0x085d('0xa0')]['id']}},_0x50dc08={};_0x50dc08['model']=_[_0x085d('0x31')](db[_0x085d('0x8c')][_0x085d('0x2e')]);_0x50dc08['query']=_['keys'](_0x3f5407[_0x085d('0x30')]);_0x50dc08[_0x085d('0x32')]=_[_0x085d('0x33')](_0x50dc08[_0x085d('0x2f')],_0x50dc08[_0x085d('0x30')]);_0x47a367[_0x085d('0x34')]=_[_0x085d('0x33')](_0x50dc08['model'],qs[_0x085d('0xa1')](_0x3f5407['query'][_0x085d('0xa1')]));_0x47a367[_0x085d('0x34')]=_0x47a367[_0x085d('0x34')][_0x085d('0x35')]?_0x47a367['attributes']:_0x50dc08[_0x085d('0x2f')];if(_0x3f5407[_0x085d('0x30')]['includeAll']){_0x47a367[_0x085d('0xa2')]=[{'all':!![]}];}_0x47a367=_['merge']({},_0x47a367,_0x3f5407[_0x085d('0xa3')]);return db[_0x085d('0x8c')]['find'](_0x47a367)[_0x085d('0x27')](handleEntityNotFound(_0x353451,null))[_0x085d('0x27')](respondWithResult(_0x353451,null))[_0x085d('0x9e')](handleError(_0x353451,null));};exports[_0x085d('0xa4')]=function(_0x4b3391,_0x34b994){return db[_0x085d('0x8c')]['create'](_0x4b3391['body'],{})[_0x085d('0x27')](respondWithResult(_0x34b994,0xc9))[_0x085d('0x9e')](handleError(_0x34b994,null));};exports['update']=function(_0x21901a,_0x3eb92e){if(_0x21901a['body']['id']){delete _0x21901a[_0x085d('0xa5')]['id'];}return db[_0x085d('0x8c')]['find']({'where':{'id':_0x21901a[_0x085d('0xa0')]['id']}})['then'](handleEntityNotFound(_0x3eb92e,null))[_0x085d('0x27')](saveUpdates(_0x21901a[_0x085d('0xa5')],null))['then'](respondWithResult(_0x3eb92e,null))[_0x085d('0x9e')](handleError(_0x3eb92e,null));};exports[_0x085d('0x28')]=function(_0x1819c0,_0x5f4914){return db[_0x085d('0x8c')][_0x085d('0xa6')]({'where':{'id':_0x1819c0[_0x085d('0xa0')]['id']}})['then'](handleEntityNotFound(_0x5f4914,null))['then'](removeEntity(_0x5f4914,null))[_0x085d('0x9e')](handleError(_0x5f4914,null));};exports['describe']=function(_0x5551d0,_0x4d6c41){return db['SmsInteraction'][_0x085d('0xa7')]()[_0x085d('0x27')](respondWithResult(_0x4d6c41,null))[_0x085d('0x9e')](handleError(_0x4d6c41,null));};exports[_0x085d('0xa8')]=function(_0x369a83,_0xfb8013,_0x1a1e9f){return db[_0x085d('0xa9')][_0x085d('0xa6')]({'where':{'id':_0x369a83[_0x085d('0xa0')]['id']}})[_0x085d('0x27')](handleEntityNotFound(_0xfb8013,null))[_0x085d('0x27')](function(_0x450a85){if(_0x450a85){return _0x450a85['addMessage'](_0x369a83[_0x085d('0xa5')][_0x085d('0xaa')],_[_0x085d('0xab')](_0x369a83[_0x085d('0xa5')],['ids','id'])||{});}})[_0x085d('0x27')](respondWithResult(_0xfb8013,null))['catch'](handleError(_0xfb8013,null));};exports[_0x085d('0xac')]=function(_0xc739ab,_0x13e563,_0xee0067){var _0xc5dd6b={'raw':![],'where':{}};var _0x2f013e={};var _0x4109e8={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0xc739ab['params']['id']}})[_0x085d('0x27')](handleEntityNotFound(_0x13e563,null))[_0x085d('0x27')](function(_0x5de056){if(_0x5de056){_0x2f013e['model']=_[_0x085d('0x31')](db['SmsMessage'][_0x085d('0x2e')]);_0x2f013e[_0x085d('0x30')]=_['keys'](_0xc739ab[_0x085d('0x30')]);_0x2f013e[_0x085d('0x32')]=_[_0x085d('0x33')](_0x2f013e[_0x085d('0x2f')],_0x2f013e[_0x085d('0x30')]);_0xc5dd6b['attributes']=_[_0x085d('0x33')](_0x2f013e['model'],qs[_0x085d('0xa1')](_0xc739ab[_0x085d('0x30')][_0x085d('0xa1')]));_0xc5dd6b[_0x085d('0x34')]=_0xc5dd6b['attributes'][_0x085d('0x35')]?_0xc5dd6b[_0x085d('0x34')]:_0x2f013e[_0x085d('0x2f')];if(!_0xc739ab['query'][_0x085d('0x36')](_0x085d('0x37'))){_0xc5dd6b[_0x085d('0x20')]=qs[_0x085d('0x20')](_0xc739ab[_0x085d('0x30')]['limit']);_0xc5dd6b[_0x085d('0x1f')]=qs[_0x085d('0x1f')](_0xc739ab['query'][_0x085d('0x1f')]);}_0xc5dd6b['order']=qs[_0x085d('0x39')](_0xc739ab[_0x085d('0x30')][_0x085d('0x39')]);_0xc5dd6b[_0x085d('0x41')]=qs[_0x085d('0x32')](_[_0x085d('0x3a')](_0xc739ab[_0x085d('0x30')],_0x2f013e[_0x085d('0x32')]));_0xc5dd6b['where'][_0x085d('0x9c')]=_0x5de056['id'];if(_0xc739ab[_0x085d('0x30')][_0x085d('0x71')]){_0xc5dd6b['where']=_[_0x085d('0x8b')](_0xc5dd6b[_0x085d('0x41')],{'$or':_[_0x085d('0x6b')](_0xc5dd6b['attributes'],function(_0x4fa232){var _0x305c9b={};_0x305c9b[_0x4fa232]={'$like':'%'+_0xc739ab[_0x085d('0x30')][_0x085d('0x71')]+'%'};return _0x305c9b;})});}if(_0xc739ab[_0x085d('0x30')]['$gte']){var _0x22d92c=_0xc739ab[_0x085d('0x30')][_0x085d('0x70')][_0x085d('0xad')](',');var _0x4348ae={};_0x4348ae[_0x22d92c[0x0]]={'$gte':moment(_0x22d92c[0x1])[_0x085d('0x59')](_0x085d('0xae'))};_0xc5dd6b[_0x085d('0x41')]=_[_0x085d('0x8b')](_0xc5dd6b[_0x085d('0x41')],_0x4348ae);}_0xc5dd6b=_[_0x085d('0x8b')]({},_0xc5dd6b,_0xc739ab[_0x085d('0xa3')]);return db[_0x085d('0xa9')][_0x085d('0x1e')]({'where':_0xc5dd6b[_0x085d('0x41')]})[_0x085d('0x27')](function(_0x3b2665){_0x4109e8['count']=_0x3b2665;if(_0xc739ab[_0x085d('0x30')][_0x085d('0xaf')]){_0xc5dd6b[_0x085d('0xa2')]=[{'all':!![]}];}return db[_0x085d('0xa9')][_0x085d('0xb0')](_0xc5dd6b);})[_0x085d('0x27')](function(_0x298d00){_0x4109e8[_0x085d('0x9d')]=_0x298d00;return _0x4109e8;});}})[_0x085d('0x27')](respondWithFilteredResult(_0x13e563,_0xc5dd6b))[_0x085d('0x9e')](handleError(_0x13e563,null));};exports[_0x085d('0xb1')]=function(_0x326836,_0x53c72a,_0x2ccfbf){return db['SmsInteraction']['find']({'where':{'id':_0x326836[_0x085d('0xa0')]['id']}})['then'](handleEntityNotFound(_0x53c72a,null))[_0x085d('0x27')](function(_0x577365){if(_0x577365){return _0x577365[_0x085d('0xb2')](_0x326836[_0x085d('0xa5')]['ids'],_[_0x085d('0xab')](_0x326836['body'],[_0x085d('0xaa'),'id'])||{})['spread'](function(){return db[_0x085d('0xb3')][_0x085d('0xb0')]({'attributes':['id',_0x085d('0x2b'),_0x085d('0x3d')],'where':{'id':_0x326836[_0x085d('0xa5')]['ids']}});})[_0x085d('0x27')](function(_0x392764){socket[_0x085d('0xb4')]('smsInteractionTags:save',{'id':Number(_0x326836[_0x085d('0xa0')]['id']),'tags':_0x392764||[]});return{'id':Number(_0x326836[_0x085d('0xa0')]['id']),'tags':_0x392764||[]};});}})['then'](respondWithResult(_0x53c72a,null))[_0x085d('0x9e')](handleError(_0x53c72a,null));};exports[_0x085d('0xb5')]=function(_0x6031ed,_0x1fa5fd,_0x418359){return db[_0x085d('0x8c')][_0x085d('0xa6')]({'where':{'id':_0x6031ed[_0x085d('0xa0')]['id']}})[_0x085d('0x27')](handleEntityNotFound(_0x1fa5fd,null))[_0x085d('0x27')](function(_0x573185){if(_0x573185){return _0x573185[_0x085d('0xb5')](_0x6031ed[_0x085d('0x30')][_0x085d('0xaa')]);}})[_0x085d('0x27')](respondWithStatusCode(_0x1fa5fd,null))[_0x085d('0x9e')](handleError(_0x1fa5fd,null));};exports[_0x085d('0xb6')]=function(_0x26f992,_0x155d1c){var _0x464937=moment()['unix']()[_0x085d('0x74')]();var _0x478c79=path[_0x085d('0x75')](config[_0x085d('0xb7')],_0x085d('0xb8'),_0x085d('0xb9'),_0x085d('0xba'));var _0x1cb405=path[_0x085d('0x75')](config[_0x085d('0xb7')],_0x085d('0xb8'),'files',_0x085d('0xbb'));var _0x2232db=path[_0x085d('0x75')](_0x478c79,_0x464937);var _0x4ea8ce=util['format'](_0x085d('0xbc'),_0x26f992[_0x085d('0xa0')]['id'],_0x464937);var _0x50b1d6=path[_0x085d('0x75')](_0x478c79,_0x4ea8ce);var _0x38a6cb=![];return db[_0x085d('0x8c')][_0x085d('0xa6')]({'where':{'id':_0x26f992[_0x085d('0xa0')]['id']},'include':[{'model':db[_0x085d('0xa9')],'as':'Messages','attributes':['id',_0x085d('0xa5'),_0x085d('0x54'),'direction',_0x085d('0xbd')],'include':[{'model':db[_0x085d('0xbe')],'as':_0x085d('0xbe'),'attributes':['id',_0x085d('0xbf')],'raw':!![]},{'model':db['CmContact'],'as':_0x085d('0xc0'),'attributes':['id',_0x085d('0xc1'),'lastName'],'raw':!![]}]},{'model':db[_0x085d('0xc2')],'as':_0x085d('0xc3'),'attributes':['id','name']},{'model':db['User'],'as':_0x085d('0xc4'),'attributes':['id',_0x085d('0xbf')]}]})[_0x085d('0x27')](handleEntityNotFound(_0x155d1c,null))[_0x085d('0x27')](function(_0x1e41fc){if(_0x1e41fc){var _0x3e2ea9=_0x1e41fc['get']({'plain':!![]});_0x38a6cb=!![];var _0x38a6a1={'format':'A4','border':'10px','header':{'height':_0x085d('0xc5'),'contents':{'first':'\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x085d('0xc6'),'contents':{'default':util[_0x085d('0x59')](_0x085d('0xc7'),util[_0x085d('0x59')](_0x085d('0xc8'),_0x085d('0xc9'),_0x3e2ea9['id']),moment()['format'](_0x085d('0xca'))[_0x085d('0x74')]())}}};fs[_0x085d('0xcb')](_0x2232db);var _0xca753d={'channel':_0x085d('0xc9'),'account':_0x3e2ea9['Account'][_0x085d('0x2b')],'agent':_0x3e2ea9[_0x085d('0xc4')]?_0x3e2ea9[_0x085d('0xc4')]['fullname']:'N.A.','createdAt':moment(_0x3e2ea9[_0x085d('0x54')])[_0x085d('0x59')](_0x085d('0xae'))['toString'](),'closedAt':_0x3e2ea9[_0x085d('0xcc')]?moment(_0x3e2ea9[_0x085d('0xcd')])['format'](_0x085d('0xae'))[_0x085d('0x74')]():'','disposition':_0x3e2ea9[_0x085d('0xce')],'messages':_(_0x3e2ea9[_0x085d('0xcf')])['filter']({'secret':![]})[_0x085d('0x6b')](function(_0x33b91d){return{'date':moment(_0x33b91d[_0x085d('0x54')])[_0x085d('0x59')]('YYYY-MM-DD\x20HH:mm:ss')[_0x085d('0x74')](),'sender':_0x33b91d[_0x085d('0xd0')]===_0x085d('0xd1')?_0x33b91d[_0x085d('0xbe')]?_0x33b91d[_0x085d('0xbe')][_0x085d('0xbf')]:_0x085d('0xd2'):_0x33b91d[_0x085d('0xc0')]['firstName']+(_0x33b91d['Contact'][_0x085d('0xd3')]?'\x20'+_0x33b91d[_0x085d('0xc0')]['lastName']:''),'body':_0x33b91d[_0x085d('0xa5')],'direction':_0x33b91d[_0x085d('0xd0')]===_0x085d('0xd1')?'A':'C','secret':_0x33b91d[_0x085d('0xbd')]};})[_0x085d('0x5d')]()};return ejs['renderFile'](path[_0x085d('0x75')](config['root'],'server',_0x085d('0xd4'),'downloadInteraction.html'),{'interaction':_0xca753d})[_0x085d('0x27')](function(_0x40653d){return new BPromise(function(_0x31f056,_0x3efd92){pdf['create'](_0x40653d,_0x38a6a1)['toFile'](path['join'](_0x2232db,_0x085d('0xd5')+_0x3e2ea9['id']+'-'+_0x464937+_0x085d('0xd6')),function(_0x317ad2,_0xf2b9b0){if(_0x317ad2)return _0x3efd92(_0x317ad2);_0x31f056(_0xf2b9b0);});});});}})['then'](function(){if(_0x38a6cb){return new BPromise(function(_0x28964c,_0x2d22fc){zipdir(_0x2232db,{'saveTo':_0x50b1d6},function(_0x942976,_0x3b0c64){if(_0x942976)return _0x2d22fc(_0x942976);return _0x28964c(_0x3b0c64);});})['then'](function(){return new BPromise(function(_0x2abfca,_0x68f93c){rimraf(_0x2232db,function(_0x28eb83){if(_0x28eb83)_0x68f93c(_0x28eb83);return _0x2abfca();});});})[_0x085d('0x27')](function(){return _0x155d1c[_0x085d('0xb6')](_0x50b1d6,_0x4ea8ce,function(_0x24f364){if(_0x24f364){console[_0x085d('0xd7')](_0x085d('0xd8'),_0x24f364);}else{fs[_0x085d('0xd9')](_0x50b1d6);}});});}else{return _0x155d1c['sendStatus'](0xc8);}})[_0x085d('0x9e')](handleError(_0x155d1c,null));}; \ No newline at end of file +var _0x41d0=['disposition','Messages','out','System','renderFile','views','downloadInteraction.html','transcript-','.pdf','download','log','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','set','apply','reject','save','update','destroy','end','error','stack','name','send','index','SmsInteraction','model','keys','intersection','query','attributes','fields','length','nolimit','sort','where','pick','filters','select','field','color','from','COUNT(*)','sms_messages','me.SmsInteractionId\x20=\x20i.id','me.direction\x20=\x20\x27in\x27','me.read\x20=\x20false','u.id','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','ui.UserId\x20=\x20i.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','expr','advancedFilter','parse','forEach','createdAt','day','utc','format','endOf','isArray','condition','value','TagId','Messages.count','and','tableAlias','\x20=\x20?','LIKE','ContactId','c.firstName','c.lastName','\x20LIKE\x20?','c.email','\x20>\x20?','\x20<\x20?','\x20IN\x20?','map','filter','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','split','toString','join','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','order','DESC','group','Sequelize','QueryTypes','SELECT','clone','read','%s\x20=\x200','`Messages.count`\x20=\x200','%s\x20>\x200','having','tag','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','t.id\x20IN\x20?','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','`Messages.count`\x20>\x200','sequelize','count','then','keyBy','Account.key','i.*','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','u.fullname','User.name','TagIds','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','Users','Tags','push','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','hasOwnProperty','merge','$gte','options','include','findAll','spread','Tag','emit','removeTags','unix','root','server','files','tmp','attachments','transcript-%d-%s.zip','direction','User','CmContact','Contact','firstName','lastName','SmsAccount','fullname','get','10px','40px','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Sms','mkdirSync','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x41d0,0x1c6));var _0x041d=function(_0x1ff385,_0x2f30bb){_0x1ff385=_0x1ff385-0x0;var _0x563380=_0x41d0[_0x1ff385];return _0x563380;};'use strict';var pdf=require(_0x041d('0x0'));var emlformat=require(_0x041d('0x1'));var rimraf=require(_0x041d('0x2'));var zipdir=require(_0x041d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x041d('0x4'));var moment=require(_0x041d('0x5'));var BPromise=require(_0x041d('0x6'));var Mustache=require(_0x041d('0x7'));var util=require(_0x041d('0x8'));var path=require(_0x041d('0x9'));var sox=require(_0x041d('0xa'));var csv=require(_0x041d('0xb'));var ejs=require(_0x041d('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x041d('0xd'));var crypto=require('crypto');var jsforce=require(_0x041d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x041d('0xb'));var querystring=require(_0x041d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x041d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x041d('0x11'))('api');var utils=require(_0x041d('0x12'));var config=require(_0x041d('0x13'));var db=require(_0x041d('0x14'))['db'];config[_0x041d('0x15')]=_[_0x041d('0x16')](config[_0x041d('0x15')],{'host':_0x041d('0x17'),'port':0x18eb});var socket=require(_0x041d('0x18'))(new Redis(config[_0x041d('0x15')]));require('./smsInteraction.socket')[_0x041d('0x19')](socket);function respondWithStatusCode(_0x3205ea,_0x61dc3b){_0x61dc3b=_0x61dc3b||0xcc;return function(_0x1efe79){if(_0x1efe79){return _0x3205ea[_0x041d('0x1a')](_0x61dc3b);}return _0x3205ea[_0x041d('0x1b')](_0x61dc3b)['end']();};}function respondWithResult(_0xaadc6f,_0x167cfe){_0x167cfe=_0x167cfe||0xc8;return function(_0x362289){if(_0x362289){return _0xaadc6f[_0x041d('0x1b')](_0x167cfe)[_0x041d('0x1c')](_0x362289);}};}function respondWithFilteredResult(_0x1c581b,_0x5a5ecb){return function(_0x488468){if(_0x488468){var _0x239ac3=_0x488468['count'],_0x32a20e=_0x5a5ecb[_0x041d('0x1d')],_0x4fb80b=_0x5a5ecb[_0x041d('0x1d')]+_0x5a5ecb[_0x041d('0x1e')],_0x15b10b;if(_0x4fb80b>=_0x239ac3){_0x4fb80b=_0x239ac3;_0x15b10b=0xc8;}else{_0x15b10b=0xce;}_0x1c581b['status'](_0x15b10b);return _0x1c581b[_0x041d('0x1f')]('Content-Range',_0x32a20e+'-'+_0x4fb80b+'/'+_0x239ac3)['json'](_0x488468);}return null;};}function patchUpdates(_0x22a8d9){return function(_0x597c1d){try{jsonpatch[_0x041d('0x20')](_0x597c1d,_0x22a8d9,!![]);}catch(_0x339d10){return BPromise[_0x041d('0x21')](_0x339d10);}return _0x597c1d[_0x041d('0x22')]();};}function saveUpdates(_0xb6ec9a,_0x6ee379){return function(_0x437841){if(_0x437841){return _0x437841[_0x041d('0x23')](_0xb6ec9a)['then'](function(_0x1fee9a){return _0x1fee9a;});}return null;};}function removeEntity(_0x302aaa,_0x6058d7){return function(_0x6c8547){if(_0x6c8547){return _0x6c8547[_0x041d('0x24')]()['then'](function(){_0x302aaa[_0x041d('0x1b')](0xcc)[_0x041d('0x25')]();});}};}function handleEntityNotFound(_0x3e04e3,_0x3b34a7){return function(_0x315d73){if(!_0x315d73){_0x3e04e3[_0x041d('0x1a')](0x194);}return _0x315d73;};}function handleError(_0x2ae739,_0x927bb1){_0x927bb1=_0x927bb1||0x1f4;return function(_0x1ca19c){logger[_0x041d('0x26')](_0x1ca19c[_0x041d('0x27')]);if(_0x1ca19c[_0x041d('0x28')]){delete _0x1ca19c[_0x041d('0x28')];}_0x2ae739[_0x041d('0x1b')](_0x927bb1)[_0x041d('0x29')](_0x1ca19c);};}exports[_0x041d('0x2a')]=function(_0x1df7cc,_0x414dbc){var _0x189028={},_0x18b06b={},_0x3cd52c={'count':0x0,'rows':[]};var _0x30ec8f=db[_0x041d('0x2b')]['rawAttributes'];_0x18b06b[_0x041d('0x2c')]=_[_0x041d('0x2d')](_0x30ec8f);_0x18b06b['query']=_[_0x041d('0x2d')](_0x1df7cc['query']);_0x18b06b['filters']=_[_0x041d('0x2e')](_0x18b06b['model'],_0x18b06b[_0x041d('0x2f')]);_0x189028[_0x041d('0x30')]=_['intersection'](_0x18b06b[_0x041d('0x2c')],qs[_0x041d('0x31')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x31')]));_0x189028['attributes']=_0x189028[_0x041d('0x30')][_0x041d('0x32')]?_0x189028[_0x041d('0x30')]:_0x18b06b[_0x041d('0x2c')];if(!_0x1df7cc[_0x041d('0x2f')]['hasOwnProperty'](_0x041d('0x33'))){_0x189028['limit']=qs[_0x041d('0x1e')](_0x1df7cc[_0x041d('0x2f')]['limit']);_0x189028['offset']=qs[_0x041d('0x1d')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x1d')]);}_0x189028['order']=qs[_0x041d('0x34')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x34')]);_0x189028[_0x041d('0x35')]=qs['filters'](_[_0x041d('0x36')](_0x1df7cc['query'],_0x18b06b[_0x041d('0x37')]));var _0x229e2d=[];var _0x4831c8=squel[_0x041d('0x38')]()['field']('id')[_0x041d('0x39')](_0x041d('0x28'))['field'](_0x041d('0x3a'))[_0x041d('0x3b')]('tools_tags');var _0x1979f6=squel[_0x041d('0x38')]()[_0x041d('0x39')](_0x041d('0x3c'))[_0x041d('0x3b')](_0x041d('0x3d'),'me')[_0x041d('0x35')](_0x041d('0x3e'))[_0x041d('0x35')](_0x041d('0x3f'))[_0x041d('0x35')](_0x041d('0x40'));var _0x5887ac=squel[_0x041d('0x38')]()[_0x041d('0x39')](_0x041d('0x41'))[_0x041d('0x39')]('ui.SmsInteractionId')[_0x041d('0x3b')](_0x041d('0x42'),'ui')[_0x041d('0x43')](_0x041d('0x44'),'u',_0x041d('0x45'));var _0x10156e=squel[_0x041d('0x38')]()[_0x041d('0x3b')](_0x041d('0x46'),'i')['left_join'](_0x041d('0x42'),'ui',_0x041d('0x47'))['left_join']('users','u','u.id\x20=\x20ui.UserId')['left_join']('cm_contacts','c',_0x041d('0x48'))[_0x041d('0x43')]('users','o','o.id\x20=\x20i.UserId')[_0x041d('0x43')](_0x041d('0x49'),'a',_0x041d('0x4a'))[_0x041d('0x43')]('sms_messages','me','me.SmsInteractionId\x20=\x20i.id');var _0x2bbfa1=squel[_0x041d('0x4b')]();if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x4c')]){var _0x32a291=JSON[_0x041d('0x4d')](_0x1df7cc[_0x041d('0x2f')]['advancedFilter']);_[_0x041d('0x2d')](_0x32a291)[_0x041d('0x4e')](function(_0x2e9abc){var _0x12a2a1=_0x32a291[_0x2e9abc];if(_0x2e9abc===_0x041d('0x4f')){var _0x4f5045=moment(_0x12a2a1['value']['dateStart'])['startOf'](_0x041d('0x50'))[_0x041d('0x51')]()[_0x041d('0x52')]();var _0x59409c=moment(_0x59409c)['utc']()[_0x041d('0x53')](_0x041d('0x50'))[_0x041d('0x52')]();_0x2bbfa1['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4f5045,_0x59409c);}else{if(_[_0x041d('0x54')](_0x12a2a1['condition'])){_0x12a2a1['condition']['forEach'](function(_0x1d40f3){switch(_0x12a2a1[_0x041d('0x55')][_0x041d('0x56')]){case'IS':if(_0x2e9abc!==_0x041d('0x57')&&_0x2e9abc!==_0x041d('0x58')){if(_['isArray'](_0x12a2a1['value'])&&_0x12a2a1[_0x041d('0x56')][_0x041d('0x32')]>0x1){_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+'\x20IN\x20?',_0x12a2a1[_0x041d('0x56')]);}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+_0x041d('0x5b'),_0x12a2a1['value'][0x0]);}}break;case'=':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+_0x041d('0x5b'),_0x12a2a1['value']);break;case _0x041d('0x5c'):if(_0x2e9abc===_0x041d('0x5d')){_0x2bbfa1['and'](_0x041d('0x5e')+'\x20LIKE\x20?','%'+_0x12a2a1[_0x041d('0x56')]+'%');_0x2bbfa1['or'](_0x041d('0x5f')+_0x041d('0x60'),'%'+_0x12a2a1['value']+'%');_0x2bbfa1['or'](_0x041d('0x61')+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');}break;case'>':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x62'),_0x12a2a1['value']);break;case'<':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x63'),_0x12a2a1[_0x041d('0x56')]);break;}});}else{switch(_0x12a2a1['condition'][_0x041d('0x56')]){case'IS':if(_0x2e9abc!==_0x041d('0x57')&&_0x2e9abc!=='Messages.count'){if(_['isArray'](_0x12a2a1[_0x041d('0x56')])&&_0x12a2a1[_0x041d('0x56')]['length']>0x1){_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x64'),_0x12a2a1[_0x041d('0x56')]);}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+'\x20=\x20?',_0x12a2a1[_0x041d('0x56')][0x0]);}}break;case'=':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+'\x20=\x20?',_0x12a2a1[_0x041d('0x56')]);break;case _0x041d('0x5c'):if(_0x2e9abc===_0x041d('0x5d')){_0x2bbfa1[_0x041d('0x59')](_0x041d('0x5e')+_0x041d('0x60'),'%'+_0x12a2a1['value']+'%');_0x2bbfa1['or']('c.lastName'+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');_0x2bbfa1['or'](_0x041d('0x61')+'\x20LIKE\x20?','%'+_0x12a2a1[_0x041d('0x56')]+'%');}else{_0x2bbfa1[_0x041d('0x59')](_0x12a2a1['tableAlias']+'.'+_0x2e9abc+_0x041d('0x60'),'%'+_0x12a2a1[_0x041d('0x56')]+'%');}break;case'>':_0x2bbfa1[_0x041d('0x59')](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x62'),_0x12a2a1['value']);break;case'<':_0x2bbfa1['and'](_0x12a2a1[_0x041d('0x5a')]+'.'+_0x2e9abc+_0x041d('0x63'),_0x12a2a1[_0x041d('0x56')]);break;}}}});}else{var _0x3a42b4=_(Object['keys'](_0x1df7cc['query']))[_0x041d('0x65')](function(_0x5880f9){return _0x30ec8f['hasOwnProperty'](_0x5880f9)?_0x5880f9:undefined;})[_0x041d('0x66')](function(_0x3e5ea3){return!_['isNil'](_0x3e5ea3);})[_0x041d('0x56')]();if(!_[_0x041d('0x67')](_0x3a42b4)){_0x3a42b4[_0x041d('0x4e')](function(_0x5469a8){if(_0x5469a8===_0x041d('0x68')){_0x10156e[_0x041d('0x35')](_0x041d('0x69'),[][_0x041d('0x6a')](_0x1df7cc[_0x041d('0x2f')][_0x5469a8]));}else if(_0x5469a8==='createdAt'){var _0x1a6453=JSON[_0x041d('0x4d')](_0x1df7cc[_0x041d('0x2f')][_0x5469a8])['$gte'];var _0x30da8a=JSON[_0x041d('0x4d')](_0x1df7cc[_0x041d('0x2f')][_0x5469a8])['$lte'];_0x10156e['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1a6453,_0x30da8a);}else{_0x10156e['where']('i.'+_0x5469a8+_0x041d('0x5b'),_0x1df7cc[_0x041d('0x2f')][_0x5469a8]);}});}if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x66')]){var _0x3cefdc=_0x1df7cc[_0x041d('0x2f')]['filter']['replace']('\x5c','\x5c\x5c')[_0x041d('0x6b')]('\x27\x27',_0x041d('0x6c'));if(qs[_0x041d('0x6d')](_0x3cefdc)){_0x2bbfa1['or'](_0x041d('0x6e'),_0x3cefdc+'%')['or']('i.phone\x20LIKE\x20?',_0x3cefdc+'%');}else{var _0x5a969e=[];_0x3cefdc[_0x041d('0x6f')]('\x20')['forEach'](function(_0x1d09c1){_0x5a969e['push']('+'+_0x1d09c1[_0x041d('0x70')]());});var _0x17471e=_0x5a969e[_0x041d('0x71')]('\x20');_0x2bbfa1['or'](_0x041d('0x72'),_0x17471e)['or'](_0x041d('0x73'),_0x3cefdc+'%');}}}_0x10156e[_0x041d('0x35')](_0x2bbfa1);if(_0x189028[_0x041d('0x74')]){_0x189028['order'][_0x041d('0x4e')](function(_0x2b9359){_0x10156e[_0x041d('0x74')]('i.'+_0x2b9359[0x0],_0x2b9359[0x1]===_0x041d('0x75')?![]:!![]);});}_0x10156e[_0x041d('0x76')]('i.id');var _0x40fdfb={'type':db[_0x041d('0x77')][_0x041d('0x78')][_0x041d('0x79')],'raw':!![]};var _0x54e0f4=_0x10156e[_0x041d('0x7a')]()[_0x041d('0x39')]('COUNT(*)');if(!_0x1df7cc['query']['advancedFilter']){if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x7b')]){if(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x7b')]==0x1){_0x54e0f4['where'](util['format'](_0x041d('0x7c'),_0x1979f6[_0x041d('0x70')]()));_0x10156e['having'](_0x041d('0x7d'));}else{_0x54e0f4[_0x041d('0x35')](util[_0x041d('0x52')](_0x041d('0x7e'),_0x1979f6[_0x041d('0x70')]()));_0x10156e[_0x041d('0x7f')]('`Messages.count`\x20>\x200');}}if(_0x1df7cc['query'][_0x041d('0x80')]){var _0x1a383e=_[_0x041d('0x54')](_0x1df7cc[_0x041d('0x2f')][_0x041d('0x80')])?_0x1df7cc[_0x041d('0x2f')]['tag']:new Array(_0x1df7cc[_0x041d('0x2f')][_0x041d('0x80')]);var _0x33754a=squel[_0x041d('0x4b')]();_0x1a383e[_0x041d('0x4e')](function(_0x5d4418){_0x33754a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5d4418+',%');});_0x10156e[_0x041d('0x7f')](_0x33754a);_0x54e0f4[_0x041d('0x43')](_0x041d('0x81'),'it',_0x041d('0x82'));_0x54e0f4[_0x041d('0x43')]('tools_tags','t',_0x041d('0x83'));_0x54e0f4[_0x041d('0x35')](_0x041d('0x84'),_0x1a383e);}}else{var _0x32a291=JSON[_0x041d('0x4d')](_0x1df7cc['query']['advancedFilter']);_[_0x041d('0x2d')](_0x32a291)[_0x041d('0x4e')](function(_0x1f55e4){var _0x5569a2=_0x32a291[_0x1f55e4];if(_0x1f55e4===_0x041d('0x57')){var _0x999cbb=_0x5569a2[_0x041d('0x56')];var _0x3e7e22=squel[_0x041d('0x4b')]();_0x999cbb[_0x041d('0x4e')](function(_0x1fcabf){_0x3e7e22['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1fcabf+',%');});_0x10156e['having'](_0x3e7e22);_0x54e0f4[_0x041d('0x43')](_0x041d('0x85'),'it',_0x041d('0x86'));_0x54e0f4[_0x041d('0x43')](_0x041d('0x87'),'t',_0x041d('0x83'));_0x54e0f4[_0x041d('0x35')](_0x041d('0x84'),_0x999cbb);}else if(_0x1f55e4==='Messages.count'){if(_0x5569a2[_0x041d('0x56')][_0x041d('0x32')]===0x1){if(_0x5569a2[_0x041d('0x56')][0x0]===0x1){_0x54e0f4[_0x041d('0x35')](util[_0x041d('0x52')]('%s\x20=\x200',_0x1979f6['toString']()));_0x10156e[_0x041d('0x7f')]('`Messages.count`\x20=\x200');}else{_0x54e0f4['where'](util['format'](_0x041d('0x7e'),_0x1979f6[_0x041d('0x70')]()));_0x10156e['having'](_0x041d('0x88'));}}}});}db[_0x041d('0x89')][_0x041d('0x2f')](_0x54e0f4[_0x041d('0x70')](),_0x40fdfb)['then'](function(_0x48131e){_0x3cd52c[_0x041d('0x8a')]=_0x48131e[_0x041d('0x32')];if(_0x3cd52c[_0x041d('0x8a')]===0x0)return[];return db[_0x041d('0x89')][_0x041d('0x2f')](_0x4831c8[_0x041d('0x70')](),_0x40fdfb)[_0x041d('0x8b')](function(_0x465264){_0x229e2d=_[_0x041d('0x8c')](_0x465264,'id');_0x40fdfb=_['merge'](_0x40fdfb,{'model':db[_0x041d('0x2b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x10156e['field'](_0x1979f6,_0x041d('0x58'));_0x10156e[_0x041d('0x39')]('a.key',_0x041d('0x8d'));_0x10156e[_0x041d('0x39')](_0x041d('0x8e'));_0x10156e['field']('c.firstName','Contact.firstName');_0x10156e[_0x041d('0x39')]('c.lastName','Contact.lastName');_0x10156e[_0x041d('0x39')](_0x041d('0x61'),'Contact.email');_0x10156e['field'](_0x041d('0x8f'),_0x041d('0x90'));_0x10156e[_0x041d('0x39')](_0x041d('0x91'),_0x041d('0x92'));_0x10156e['field'](_0x041d('0x93'),'Contact.fax');_0x10156e['field'](_0x041d('0x94'),_0x041d('0x95'));_0x10156e[_0x041d('0x39')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x041d('0x96'));_0x10156e['left_join'](_0x041d('0x81'),'it',_0x041d('0x82'));_0x10156e[_0x041d('0x43')]('tools_tags','t',_0x041d('0x83'));_0x10156e['limit'](_0x189028['limit']);_0x10156e[_0x041d('0x1d')](_0x189028[_0x041d('0x1d')]);return db[_0x041d('0x89')][_0x041d('0x2f')](_0x10156e[_0x041d('0x70')](),_0x40fdfb);})[_0x041d('0x8b')](function(_0x39140a){_0x5887ac[_0x041d('0x35')](_0x041d('0x97'),_[_0x041d('0x65')](_0x39140a,'id'));return db['sequelize'][_0x041d('0x2f')](_0x5887ac[_0x041d('0x70')](),_0x40fdfb)[_0x041d('0x8b')](function(_0x3f6378){var _0x239235=_['groupBy'](_0x3f6378,_0x041d('0x98'));_0x39140a['forEach'](function(_0x1e32ae){if(_0x239235[_0x1e32ae['id']]){_0x1e32ae[_0x041d('0x99')]=_[_0x041d('0x65')](_0x239235[_0x1e32ae['id']],function(_0x1775ef){return{'id':_0x1775ef['id']};});}if(_0x1e32ae[_0x041d('0x96')]){_0x1e32ae[_0x041d('0x9a')]=[];_0x1e32ae[_0x041d('0x96')]['split'](',')[_0x041d('0x4e')](function(_0x35ff4b){_0x1e32ae['Tags'][_0x041d('0x9b')](_0x229e2d[_0x35ff4b]);});}delete _0x1e32ae[_0x041d('0x96')];});return _0x39140a;});});})[_0x041d('0x8b')](function(_0x370f5c){_0x3cd52c[_0x041d('0x9c')]=_0x370f5c;return _0x3cd52c;})[_0x041d('0x8b')](respondWithFilteredResult(_0x414dbc,_0x189028))[_0x041d('0x9d')](handleError(_0x414dbc,null));};exports[_0x041d('0x9e')]=function(_0x310417,_0x34d4da){var _0x4f02a7={'raw':![],'where':{'id':_0x310417[_0x041d('0x9f')]['id']}},_0x480bdf={};_0x480bdf['model']=_[_0x041d('0x2d')](db['SmsInteraction'][_0x041d('0xa0')]);_0x480bdf[_0x041d('0x2f')]=_['keys'](_0x310417[_0x041d('0x2f')]);_0x480bdf[_0x041d('0x37')]=_[_0x041d('0x2e')](_0x480bdf[_0x041d('0x2c')],_0x480bdf[_0x041d('0x2f')]);_0x4f02a7['attributes']=_[_0x041d('0x2e')](_0x480bdf[_0x041d('0x2c')],qs[_0x041d('0x31')](_0x310417[_0x041d('0x2f')][_0x041d('0x31')]));_0x4f02a7[_0x041d('0x30')]=_0x4f02a7[_0x041d('0x30')][_0x041d('0x32')]?_0x4f02a7['attributes']:_0x480bdf[_0x041d('0x2c')];if(_0x310417[_0x041d('0x2f')][_0x041d('0xa1')]){_0x4f02a7['include']=[{'all':!![]}];}_0x4f02a7=_['merge']({},_0x4f02a7,_0x310417['options']);return db['SmsInteraction']['find'](_0x4f02a7)[_0x041d('0x8b')](handleEntityNotFound(_0x34d4da,null))[_0x041d('0x8b')](respondWithResult(_0x34d4da,null))[_0x041d('0x9d')](handleError(_0x34d4da,null));};exports['create']=function(_0x16992c,_0x1cccbd){return db['SmsInteraction'][_0x041d('0xa2')](_0x16992c[_0x041d('0xa3')],{})['then'](respondWithResult(_0x1cccbd,0xc9))['catch'](handleError(_0x1cccbd,null));};exports[_0x041d('0x23')]=function(_0x103a30,_0x267330){if(_0x103a30[_0x041d('0xa3')]['id']){delete _0x103a30['body']['id'];}return db['SmsInteraction'][_0x041d('0xa4')]({'where':{'id':_0x103a30['params']['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x267330,null))[_0x041d('0x8b')](saveUpdates(_0x103a30['body'],null))[_0x041d('0x8b')](respondWithResult(_0x267330,null))[_0x041d('0x9d')](handleError(_0x267330,null));};exports['destroy']=function(_0x51bfca,_0x25ff2a){return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x51bfca[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x25ff2a,null))['then'](removeEntity(_0x25ff2a,null))['catch'](handleError(_0x25ff2a,null));};exports[_0x041d('0xa5')]=function(_0x4886f2,_0x161f74){return db['SmsInteraction'][_0x041d('0xa5')]()[_0x041d('0x8b')](respondWithResult(_0x161f74,null))[_0x041d('0x9d')](handleError(_0x161f74,null));};exports[_0x041d('0xa6')]=function(_0xd46f77,_0x1c542c,_0x424f20){return db[_0x041d('0xa7')]['find']({'where':{'id':_0xd46f77[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x1c542c,null))[_0x041d('0x8b')](function(_0x3e17c7){if(_0x3e17c7){return _0x3e17c7['addMessage'](_0xd46f77[_0x041d('0xa3')][_0x041d('0xa8')],_[_0x041d('0xa9')](_0xd46f77[_0x041d('0xa3')],['ids','id'])||{});}})[_0x041d('0x8b')](respondWithResult(_0x1c542c,null))[_0x041d('0x9d')](handleError(_0x1c542c,null));};exports[_0x041d('0xaa')]=function(_0x5340c6,_0x517d1c,_0x57e5ad){var _0x360073={'raw':![],'where':{}};var _0xdb5f1e={};var _0x1a0b70={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x041d('0xab')]({'where':{'id':_0x5340c6[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x517d1c,null))[_0x041d('0x8b')](function(_0x5e6578){if(_0x5e6578){_0xdb5f1e[_0x041d('0x2c')]=_[_0x041d('0x2d')](db['SmsMessage'][_0x041d('0xa0')]);_0xdb5f1e[_0x041d('0x2f')]=_[_0x041d('0x2d')](_0x5340c6[_0x041d('0x2f')]);_0xdb5f1e['filters']=_[_0x041d('0x2e')](_0xdb5f1e[_0x041d('0x2c')],_0xdb5f1e['query']);_0x360073[_0x041d('0x30')]=_[_0x041d('0x2e')](_0xdb5f1e[_0x041d('0x2c')],qs[_0x041d('0x31')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x31')]));_0x360073['attributes']=_0x360073[_0x041d('0x30')][_0x041d('0x32')]?_0x360073[_0x041d('0x30')]:_0xdb5f1e[_0x041d('0x2c')];if(!_0x5340c6[_0x041d('0x2f')][_0x041d('0xac')]('nolimit')){_0x360073[_0x041d('0x1e')]=qs[_0x041d('0x1e')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x1e')]);_0x360073['offset']=qs[_0x041d('0x1d')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x1d')]);}_0x360073['order']=qs[_0x041d('0x34')](_0x5340c6[_0x041d('0x2f')][_0x041d('0x34')]);_0x360073[_0x041d('0x35')]=qs[_0x041d('0x37')](_['pick'](_0x5340c6[_0x041d('0x2f')],_0xdb5f1e[_0x041d('0x37')]));_0x360073[_0x041d('0x35')][_0x041d('0x98')]=_0x5e6578['id'];if(_0x5340c6['query'][_0x041d('0x66')]){_0x360073[_0x041d('0x35')]=_[_0x041d('0xad')](_0x360073[_0x041d('0x35')],{'$or':_[_0x041d('0x65')](_0x360073[_0x041d('0x30')],function(_0x2846dd){var _0x51b7f2={};_0x51b7f2[_0x2846dd]={'$like':'%'+_0x5340c6[_0x041d('0x2f')][_0x041d('0x66')]+'%'};return _0x51b7f2;})});}if(_0x5340c6[_0x041d('0x2f')][_0x041d('0xae')]){var _0x503870=_0x5340c6[_0x041d('0x2f')][_0x041d('0xae')][_0x041d('0x6f')](',');var _0x24909d={};_0x24909d[_0x503870[0x0]]={'$gte':moment(_0x503870[0x1])[_0x041d('0x52')]('YYYY-MM-DD\x20HH:mm:ss')};_0x360073[_0x041d('0x35')]=_[_0x041d('0xad')](_0x360073[_0x041d('0x35')],_0x24909d);}_0x360073=_[_0x041d('0xad')]({},_0x360073,_0x5340c6[_0x041d('0xaf')]);return db['SmsMessage'][_0x041d('0x8a')]({'where':_0x360073['where']})[_0x041d('0x8b')](function(_0x2a45b8){_0x1a0b70[_0x041d('0x8a')]=_0x2a45b8;if(_0x5340c6['query']['includeAll']){_0x360073[_0x041d('0xb0')]=[{'all':!![]}];}return db[_0x041d('0xa7')][_0x041d('0xb1')](_0x360073);})[_0x041d('0x8b')](function(_0x56d271){_0x1a0b70[_0x041d('0x9c')]=_0x56d271;return _0x1a0b70;});}})['then'](respondWithFilteredResult(_0x517d1c,_0x360073))[_0x041d('0x9d')](handleError(_0x517d1c,null));};exports['addTags']=function(_0x4f2e51,_0x1c089e,_0x2f97a8){return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x4f2e51['params']['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x1c089e,null))[_0x041d('0x8b')](function(_0x1fb854){if(_0x1fb854){return _0x1fb854['setTags'](_0x4f2e51[_0x041d('0xa3')][_0x041d('0xa8')],_['omit'](_0x4f2e51[_0x041d('0xa3')],[_0x041d('0xa8'),'id'])||{})[_0x041d('0xb2')](function(){return db[_0x041d('0xb3')][_0x041d('0xb1')]({'attributes':['id',_0x041d('0x28'),_0x041d('0x3a')],'where':{'id':_0x4f2e51[_0x041d('0xa3')][_0x041d('0xa8')]}});})[_0x041d('0x8b')](function(_0x50536b){socket[_0x041d('0xb4')]('smsInteractionTags:save',{'id':Number(_0x4f2e51[_0x041d('0x9f')]['id']),'tags':_0x50536b||[]});return{'id':Number(_0x4f2e51[_0x041d('0x9f')]['id']),'tags':_0x50536b||[]};});}})['then'](respondWithResult(_0x1c089e,null))[_0x041d('0x9d')](handleError(_0x1c089e,null));};exports[_0x041d('0xb5')]=function(_0x5971a4,_0x27a807,_0x19cef7){return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x5971a4[_0x041d('0x9f')]['id']}})[_0x041d('0x8b')](handleEntityNotFound(_0x27a807,null))['then'](function(_0x5357a9){if(_0x5357a9){return _0x5357a9[_0x041d('0xb5')](_0x5971a4[_0x041d('0x2f')]['ids']);}})[_0x041d('0x8b')](respondWithStatusCode(_0x27a807,null))['catch'](handleError(_0x27a807,null));};exports['download']=function(_0x466677,_0x1cd4b3){var _0x63c94f=moment()[_0x041d('0xb6')]()[_0x041d('0x70')]();var _0x3bdccd=path[_0x041d('0x71')](config[_0x041d('0xb7')],_0x041d('0xb8'),_0x041d('0xb9'),_0x041d('0xba'));var _0x1b2a26=path[_0x041d('0x71')](config[_0x041d('0xb7')],_0x041d('0xb8'),_0x041d('0xb9'),_0x041d('0xbb'));var _0xd06f0a=path[_0x041d('0x71')](_0x3bdccd,_0x63c94f);var _0x5e0584=util['format'](_0x041d('0xbc'),_0x466677[_0x041d('0x9f')]['id'],_0x63c94f);var _0x5a5402=path['join'](_0x3bdccd,_0x5e0584);var _0x3eecfb=![];return db[_0x041d('0x2b')][_0x041d('0xa4')]({'where':{'id':_0x466677[_0x041d('0x9f')]['id']},'include':[{'model':db[_0x041d('0xa7')],'as':'Messages','attributes':['id',_0x041d('0xa3'),_0x041d('0x4f'),_0x041d('0xbd'),'secret'],'include':[{'model':db[_0x041d('0xbe')],'as':_0x041d('0xbe'),'attributes':['id','fullname'],'raw':!![]},{'model':db[_0x041d('0xbf')],'as':_0x041d('0xc0'),'attributes':['id',_0x041d('0xc1'),_0x041d('0xc2')],'raw':!![]}]},{'model':db[_0x041d('0xc3')],'as':'Account','attributes':['id','name']},{'model':db[_0x041d('0xbe')],'as':'Owner','attributes':['id',_0x041d('0xc4')]}]})['then'](handleEntityNotFound(_0x1cd4b3,null))[_0x041d('0x8b')](function(_0x1d7d1a){if(_0x1d7d1a){var _0x1543bd=_0x1d7d1a[_0x041d('0xc5')]({'plain':!![]});_0x3eecfb=!![];var _0x3e27a9={'format':'A4','border':_0x041d('0xc6'),'header':{'height':_0x041d('0xc7'),'contents':{'first':'\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x041d('0xc8'),'contents':{'default':util[_0x041d('0x52')](_0x041d('0xc9'),util[_0x041d('0x52')](_0x041d('0xca'),_0x041d('0xcb'),_0x1543bd['id']),moment()[_0x041d('0x52')]('YYYY-MM-DD')[_0x041d('0x70')]())}}};fs[_0x041d('0xcc')](_0xd06f0a);var _0x352945={'channel':_0x041d('0xcb'),'account':_0x1543bd['Account'][_0x041d('0x28')],'agent':_0x1543bd['Owner']?_0x1543bd[_0x041d('0xcd')][_0x041d('0xc4')]:_0x041d('0xce'),'createdAt':moment(_0x1543bd['createdAt'])[_0x041d('0x52')](_0x041d('0xcf'))['toString'](),'closedAt':_0x1543bd['closed']?moment(_0x1543bd[_0x041d('0xd0')])['format'](_0x041d('0xcf'))[_0x041d('0x70')]():'','disposition':_0x1543bd[_0x041d('0xd1')],'messages':_(_0x1543bd[_0x041d('0xd2')])[_0x041d('0x66')]({'secret':![]})[_0x041d('0x65')](function(_0x41ae39){return{'date':moment(_0x41ae39[_0x041d('0x4f')])[_0x041d('0x52')](_0x041d('0xcf'))[_0x041d('0x70')](),'sender':_0x41ae39['direction']===_0x041d('0xd3')?_0x41ae39[_0x041d('0xbe')]?_0x41ae39[_0x041d('0xbe')][_0x041d('0xc4')]:_0x041d('0xd4'):_0x41ae39['Contact']['firstName']+(_0x41ae39[_0x041d('0xc0')][_0x041d('0xc2')]?'\x20'+_0x41ae39[_0x041d('0xc0')]['lastName']:''),'body':_0x41ae39[_0x041d('0xa3')],'direction':_0x41ae39[_0x041d('0xbd')]===_0x041d('0xd3')?'A':'C','secret':_0x41ae39['secret']};})[_0x041d('0x56')]()};return ejs[_0x041d('0xd5')](path[_0x041d('0x71')](config[_0x041d('0xb7')],'server',_0x041d('0xd6'),_0x041d('0xd7')),{'interaction':_0x352945})[_0x041d('0x8b')](function(_0x3f1faa){return new BPromise(function(_0xbc4ab1,_0x1af156){pdf[_0x041d('0xa2')](_0x3f1faa,_0x3e27a9)['toFile'](path['join'](_0xd06f0a,_0x041d('0xd8')+_0x1543bd['id']+'-'+_0x63c94f+_0x041d('0xd9')),function(_0x4c036b,_0x5e9f3f){if(_0x4c036b)return _0x1af156(_0x4c036b);_0xbc4ab1(_0x5e9f3f);});});});}})['then'](function(){if(_0x3eecfb){return new BPromise(function(_0xf0fa5f,_0x4c1fe5){zipdir(_0xd06f0a,{'saveTo':_0x5a5402},function(_0x2c4576,_0x352f74){if(_0x2c4576)return _0x4c1fe5(_0x2c4576);return _0xf0fa5f(_0x352f74);});})['then'](function(){return new BPromise(function(_0x4c9030,_0x5f23d6){rimraf(_0xd06f0a,function(_0x1d36d5){if(_0x1d36d5)_0x5f23d6(_0x1d36d5);return _0x4c9030();});});})['then'](function(){return _0x1cd4b3[_0x041d('0xda')](_0x5a5402,_0x5e0584,function(_0x274106){if(_0x274106){console[_0x041d('0xdb')](_0x041d('0xdc'),_0x274106);}else{fs['unlinkSync'](_0x5a5402);}});});}else{return _0x1cd4b3[_0x041d('0x1a')](0xc8);}})[_0x041d('0x9d')](handleError(_0x1cd4b3,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 551a93e..95e1610 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 _0x6122=['exports','events','SmsInteraction','setMaxListeners','save','update','emit','hook'];(function(_0x805d02,_0x4b23be){var _0x5c09ad=function(_0xc8d95b){while(--_0xc8d95b){_0x805d02['push'](_0x805d02['shift']());}};_0x5c09ad(++_0x4b23be);}(_0x6122,0xb9));var _0x2612=function(_0x30cd7e,_0x4db10a){_0x30cd7e=_0x30cd7e-0x0;var _0x462a02=_0x6122[_0x30cd7e];return _0x462a02;};'use strict';var EventEmitter=require(_0x2612('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x2612('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2612('0x2')](0x0);var events={'afterCreate':_0x2612('0x3'),'afterUpdate':_0x2612('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3275ab){return function(_0x3a1ba1,_0x4b8456,_0x306f01){SmsInteractionEvents['emit'](_0x3275ab+':'+_0x3a1ba1['id'],_0x3a1ba1);SmsInteractionEvents[_0x2612('0x5')](_0x3275ab,_0x3a1ba1);_0x306f01(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x2612('0x6')](e,emitEvent(event));}}module[_0x2612('0x7')]=SmsInteractionEvents; \ No newline at end of file +var _0xa644=['../../mysqldb','setMaxListeners','update','emit','hook','events'];(function(_0x173f10,_0x35db61){var _0x53142d=function(_0x37bbef){while(--_0x37bbef){_0x173f10['push'](_0x173f10['shift']());}};_0x53142d(++_0x35db61);}(_0xa644,0x15b));var _0x4a64=function(_0x4111c4,_0x4351d6){_0x4111c4=_0x4111c4-0x0;var _0x2877f3=_0xa644[_0x4111c4];return _0x2877f3;};'use strict';var EventEmitter=require(_0x4a64('0x0'));var SmsInteraction=require(_0x4a64('0x1'))['db']['SmsInteraction'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4a64('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4a64('0x3'),'afterDestroy':'remove'};function emitEvent(_0xb913a5){return function(_0x292ba6,_0x236018,_0xa2deb9){SmsInteractionEvents[_0x4a64('0x4')](_0xb913a5+':'+_0x292ba6['id'],_0x292ba6);SmsInteractionEvents[_0x4a64('0x4')](_0xb913a5,_0x292ba6);_0xa2deb9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x4a64('0x5')](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 1d85409..daeacbc 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 _0x88a2=['../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed','format','util','../../config/logger','moment','path','rimraf'];(function(_0x4feea5,_0x343ed1){var _0x316384=function(_0x39b414){while(--_0x39b414){_0x4feea5['push'](_0x4feea5['shift']());}};_0x316384(++_0x343ed1);}(_0x88a2,0xa0));var _0x288a=function(_0x2469ae,_0x1fd9ba){_0x2469ae=_0x2469ae-0x0;var _0x5779e5=_0x88a2[_0x2469ae];return _0x5779e5;};'use strict';var _=require('lodash');var util=require(_0x288a('0x0'));var logger=require(_0x288a('0x1'))('api');var moment=require(_0x288a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x288a('0x3'));var rimraf=require(_0x288a('0x4'));var config=require(_0x288a('0x5'));var attributes=require(_0x288a('0x6'));module[_0x288a('0x7')]=function(_0x25a629,_0x1494c9){return _0x25a629['define']('SmsInteraction',attributes,{'tableName':_0x288a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3b6bfc,_0x2f7dad,_0x3ed2f2){if(_0x3b6bfc[_0x288a('0x9')]('closed')){_0x3b6bfc['closedAt']=moment()[_0x288a('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3ed2f2(null,_0x3b6bfc);}}});}; \ No newline at end of file +var _0x2bad=['rimraf','../../config/environment','./smsInteraction.attributes','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','request-promise'];(function(_0x11d12c,_0x2fa186){var _0x5d53ac=function(_0x443513){while(--_0x443513){_0x11d12c['push'](_0x11d12c['shift']());}};_0x5d53ac(++_0x2fa186);}(_0x2bad,0xb1));var _0xd2ba=function(_0x19faae,_0x5697bc){_0x19faae=_0x19faae-0x0;var _0x363543=_0x2bad[_0x19faae];return _0x363543;};'use strict';var _=require('lodash');var util=require(_0xd2ba('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd2ba('0x1'));var BPromise=require('bluebird');var rp=require(_0xd2ba('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2ba('0x3'));var config=require(_0xd2ba('0x4'));var attributes=require(_0xd2ba('0x5'));module['exports']=function(_0xd31c03,_0x55effd){return _0xd31c03['define'](_0xd2ba('0x6'),attributes,{'tableName':_0xd2ba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3cbe5b,_0x4b57f0,_0x47b179){if(_0x3cbe5b[_0xd2ba('0x8')]('closed')){_0x3cbe5b[_0xd2ba('0x9')]=moment()[_0xd2ba('0xa')](_0xd2ba('0xb'));}_0x47b179(null,_0x3cbe5b);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 7c26bfe..3487cf1 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 _0x1a96=['code','message','result','catch','update','options','where','attributes','limit','info','UpdateSmsInteraction','AddTagsToSmsInteraction','SmsInteraction','find','addTags','body','ids','AddTags','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1514d9,_0x5ae748){var _0x41a5e5=function(_0x478ed0){while(--_0x478ed0){_0x1514d9['push'](_0x1514d9['shift']());}};_0x41a5e5(++_0x5ae748);}(_0x1a96,0xae));var _0x61a9=function(_0x3c4680,_0x32dfc7){_0x3c4680=_0x3c4680-0x0;var _0x4037e3=_0x1a96[_0x3c4680];return _0x4037e3;};'use strict';var _=require(_0x61a9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x61a9('0x1'));var rs=require(_0x61a9('0x2'));var fs=require('fs');var Redis=require(_0x61a9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x61a9('0x4'));var logger=require(_0x61a9('0x5'))('rpc');var config=require(_0x61a9('0x6'));var jayson=require(_0x61a9('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x61a9('0x8')]=_[_0x61a9('0x9')](config[_0x61a9('0x8')],{'host':_0x61a9('0xa'),'port':0x18eb});var socket=require(_0x61a9('0xb'))(new Redis(config[_0x61a9('0x8')]));require(_0x61a9('0xc'))[_0x61a9('0xd')](socket);function respondWithRpcPromise(_0x5f4c42,_0x1800f1,_0x15bfad){return new BPromise(function(_0x3cd0db,_0x2073d9){return client[_0x61a9('0xe')](_0x5f4c42,_0x15bfad)[_0x61a9('0xf')](function(_0x295a96){logger['info'](_0x61a9('0x10'),_0x1800f1,_0x61a9('0x11'));logger[_0x61a9('0x12')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x1800f1,_0x61a9('0x11'),JSON[_0x61a9('0x13')](_0x295a96));if(_0x295a96['error']){if(_0x295a96[_0x61a9('0x14')][_0x61a9('0x15')]===0x1f4){logger[_0x61a9('0x14')](_0x61a9('0x10'),_0x1800f1,_0x295a96[_0x61a9('0x14')][_0x61a9('0x16')]);return _0x2073d9(_0x295a96[_0x61a9('0x14')][_0x61a9('0x16')]);}logger[_0x61a9('0x14')](_0x61a9('0x10'),_0x1800f1,_0x295a96[_0x61a9('0x14')]['message']);return _0x3cd0db(_0x295a96[_0x61a9('0x14')][_0x61a9('0x16')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x1800f1,'request\x20sent');_0x3cd0db(_0x295a96[_0x61a9('0x17')][_0x61a9('0x16')]);}})[_0x61a9('0x18')](function(_0x3b2028){logger[_0x61a9('0x14')](_0x61a9('0x10'),_0x1800f1,_0x3b2028);_0x2073d9(_0x3b2028);});});}exports['UpdateSmsInteraction']=function(_0x52ef79){var _0x2a513a=this;return new Promise(function(_0x217661,_0x155567){return db['SmsInteraction'][_0x61a9('0x19')](_0x52ef79['body'],{'raw':_0x52ef79[_0x61a9('0x1a')]?_0x52ef79[_0x61a9('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52ef79['options']?_0x52ef79[_0x61a9('0x1a')][_0x61a9('0x1b')]||null:null,'attributes':_0x52ef79[_0x61a9('0x1a')]?_0x52ef79[_0x61a9('0x1a')][_0x61a9('0x1c')]||null:null,'limit':_0x52ef79[_0x61a9('0x1a')]?_0x52ef79['options'][_0x61a9('0x1d')]||null:null})['then'](function(_0x1e370b){logger[_0x61a9('0x1e')]('UpdateSmsInteraction',_0x52ef79);logger[_0x61a9('0x12')](_0x61a9('0x1f'),_0x52ef79,JSON[_0x61a9('0x13')](_0x1e370b));_0x217661(_0x1e370b);})['catch'](function(_0xc08385){logger[_0x61a9('0x14')](_0x61a9('0x1f'),_0xc08385[_0x61a9('0x16')],_0x52ef79);_0x155567(_0x2a513a['error'](0x1f4,_0xc08385[_0x61a9('0x16')]));});});};exports[_0x61a9('0x20')]=function(_0x4be43c){return new Promise(function(_0x9dcb9a,_0x399263){return db[_0x61a9('0x21')][_0x61a9('0x22')]({'where':_0x4be43c[_0x61a9('0x1a')]?_0x4be43c['options'][_0x61a9('0x1b')]||null:null})['then'](function(_0x27bf8e){if(_0x27bf8e){return _0x27bf8e[_0x61a9('0x23')](_0x4be43c[_0x61a9('0x24')]['ids'],_['omit'](_0x4be43c['body'],[_0x61a9('0x25'),'id'])||{});}})['spread'](function(_0x50db9f){logger[_0x61a9('0x1e')](_0x61a9('0x26'),_0x4be43c);logger['debug'](_0x61a9('0x26'),_0x4be43c,JSON['stringify'](_0x50db9f));_0x9dcb9a(_0x50db9f);})[_0x61a9('0x18')](function(_0x4efa59){logger[_0x61a9('0x14')](_0x61a9('0x26'),_0x4efa59[_0x61a9('0x16')],_0x4be43c);_0x399263(_this['error'](0x1f4,_0x4efa59[_0x61a9('0x16')]));});});}; \ No newline at end of file +var _0x1405=['update','body','options','limit','then','info','AddTagsToSmsInteraction','ids','omit','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1405,0x7f));var _0x5140=function(_0x28d773,_0x132cce){_0x28d773=_0x28d773-0x0;var _0xb28fc0=_0x1405[_0x28d773];return _0xb28fc0;};'use strict';var _=require(_0x5140('0x0'));var util=require(_0x5140('0x1'));var moment=require(_0x5140('0x2'));var BPromise=require('bluebird');var rs=require(_0x5140('0x3'));var fs=require('fs');var Redis=require(_0x5140('0x4'));var db=require(_0x5140('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5140('0x6'))(_0x5140('0x7'));var config=require(_0x5140('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5140('0x9')][_0x5140('0xa')]({'port':0x232a});config[_0x5140('0xb')]=_[_0x5140('0xc')](config['redis'],{'host':_0x5140('0xd'),'port':0x18eb});var socket=require(_0x5140('0xe'))(new Redis(config[_0x5140('0xb')]));require(_0x5140('0xf'))[_0x5140('0x10')](socket);function respondWithRpcPromise(_0x467323,_0x5c7d56,_0x4c82c6){return new BPromise(function(_0x3c2c9e,_0x42edee){return client[_0x5140('0x11')](_0x467323,_0x4c82c6)['then'](function(_0x3fa967){logger['info'](_0x5140('0x12'),_0x5c7d56,_0x5140('0x13'));logger[_0x5140('0x14')](_0x5140('0x15'),_0x5c7d56,_0x5140('0x13'),JSON[_0x5140('0x16')](_0x3fa967));if(_0x3fa967[_0x5140('0x17')]){if(_0x3fa967[_0x5140('0x17')]['code']===0x1f4){logger[_0x5140('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x5c7d56,_0x3fa967['error'][_0x5140('0x18')]);return _0x42edee(_0x3fa967[_0x5140('0x17')][_0x5140('0x18')]);}logger[_0x5140('0x17')](_0x5140('0x12'),_0x5c7d56,_0x3fa967[_0x5140('0x17')][_0x5140('0x18')]);return _0x3c2c9e(_0x3fa967['error'][_0x5140('0x18')]);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x5c7d56,_0x5140('0x13'));_0x3c2c9e(_0x3fa967[_0x5140('0x19')][_0x5140('0x18')]);}})[_0x5140('0x1a')](function(_0x3afb38){logger[_0x5140('0x17')](_0x5140('0x12'),_0x5c7d56,_0x3afb38);_0x42edee(_0x3afb38);});});}exports[_0x5140('0x1b')]=function(_0x2326ae){var _0x900d98=this;return new Promise(function(_0x463841,_0x147fe1){return db[_0x5140('0x1c')][_0x5140('0x1d')](_0x2326ae[_0x5140('0x1e')],{'raw':_0x2326ae[_0x5140('0x1f')]?_0x2326ae['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2326ae[_0x5140('0x1f')]?_0x2326ae[_0x5140('0x1f')]['where']||null:null,'attributes':_0x2326ae['options']?_0x2326ae['options']['attributes']||null:null,'limit':_0x2326ae[_0x5140('0x1f')]?_0x2326ae[_0x5140('0x1f')][_0x5140('0x20')]||null:null})[_0x5140('0x21')](function(_0x146508){logger[_0x5140('0x22')](_0x5140('0x1b'),_0x2326ae);logger[_0x5140('0x14')](_0x5140('0x1b'),_0x2326ae,JSON['stringify'](_0x146508));_0x463841(_0x146508);})[_0x5140('0x1a')](function(_0x650073){logger['error'](_0x5140('0x1b'),_0x650073[_0x5140('0x18')],_0x2326ae);_0x147fe1(_0x900d98[_0x5140('0x17')](0x1f4,_0x650073[_0x5140('0x18')]));});});};exports[_0x5140('0x23')]=function(_0x3fc1d2){return new Promise(function(_0x31fa1e,_0x35d974){return db[_0x5140('0x1c')]['find']({'where':_0x3fc1d2['options']?_0x3fc1d2[_0x5140('0x1f')]['where']||null:null})[_0x5140('0x21')](function(_0x22c872){if(_0x22c872){return _0x22c872['addTags'](_0x3fc1d2['body'][_0x5140('0x24')],_[_0x5140('0x25')](_0x3fc1d2[_0x5140('0x1e')],[_0x5140('0x24'),'id'])||{});}})['spread'](function(_0xf62fec){logger[_0x5140('0x22')](_0x5140('0x26'),_0x3fc1d2);logger[_0x5140('0x14')](_0x5140('0x26'),_0x3fc1d2,JSON[_0x5140('0x16')](_0xf62fec));_0x31fa1e(_0xf62fec);})[_0x5140('0x1a')](function(_0x2f2b97){logger[_0x5140('0x17')]('AddTags',_0x2f2b97[_0x5140('0x18')],_0x3fc1d2);_0x35d974(_this[_0x5140('0x17')](0x1f4,_0x2f2b97[_0x5140('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 36cd252..a004412 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 _0x79f8=['length','smsInteraction:','./smsInteraction.events','save','emit','removeListener','register'];(function(_0x4c9d58,_0x1c83f0){var _0x3ad22d=function(_0xd95048){while(--_0xd95048){_0x4c9d58['push'](_0x4c9d58['shift']());}};_0x3ad22d(++_0x1c83f0);}(_0x79f8,0xcd));var _0x879f=function(_0x5098a5,_0x1df8f7){_0x5098a5=_0x5098a5-0x0;var _0x18f2d0=_0x79f8[_0x5098a5];return _0x18f2d0;};'use strict';var SmsInteractionEvents=require(_0x879f('0x0'));var events=[_0x879f('0x1'),'remove','update'];function createListener(_0x5bb87e,_0x59b0f0){return function(_0x12530d){_0x59b0f0[_0x879f('0x2')](_0x5bb87e,_0x12530d);};}function removeListener(_0x4b6369,_0x3d604b){return function(){SmsInteractionEvents[_0x879f('0x3')](_0x4b6369,_0x3d604b);};}exports[_0x879f('0x4')]=function(_0x1aaa39){for(var _0x34ff18=0x0,_0x53870f=events[_0x879f('0x5')];_0x34ff18<_0x53870f;_0x34ff18++){var _0x3be223=events[_0x34ff18];var _0x2c061d=createListener(_0x879f('0x6')+_0x3be223,_0x1aaa39);SmsInteractionEvents['on'](_0x3be223,_0x2c061d);}}; \ No newline at end of file +var _0x61b1=['./smsInteraction.events','save','remove','update','removeListener','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x61b1,0x1b0));var _0x161b=function(_0x585180,_0x32b440){_0x585180=_0x585180-0x0;var _0x1946df=_0x61b1[_0x585180];return _0x1946df;};'use strict';var SmsInteractionEvents=require(_0x161b('0x0'));var events=[_0x161b('0x1'),_0x161b('0x2'),_0x161b('0x3')];function createListener(_0x189691,_0x5b6e31){return function(_0x34e3b7){_0x5b6e31['emit'](_0x189691,_0x34e3b7);};}function removeListener(_0x26b38f,_0x3480a4){return function(){SmsInteractionEvents[_0x161b('0x4')](_0x26b38f,_0x3480a4);};}exports['register']=function(_0x53ecdc){for(var _0x3f2f24=0x0,_0x449a77=events[_0x161b('0x5')];_0x3f2f24<_0x449a77;_0x3f2f24++){var _0x5a8bcd=events[_0x3f2f24];var _0x105ef7=createListener('smsInteraction:'+_0x5a8bcd,_0x53ecdc);SmsInteractionEvents['on'](_0x5a8bcd,_0x105ef7);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 5a642e6..647e6fc 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 _0xce89=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','tracked','sms','smsmessage:create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce89,0x1aa));var _0x9ce8=function(_0x85b464,_0xb32a20){_0x85b464=_0x85b464-0x0;var _0x75dc19=_0xce89[_0x85b464];return _0x75dc19;};'use strict';var multer=require(_0x9ce8('0x0'));var util=require(_0x9ce8('0x1'));var path=require(_0x9ce8('0x2'));var timeout=require(_0x9ce8('0x3'));var express=require('express');var router=express[_0x9ce8('0x4')]();var auth=require(_0x9ce8('0x5'));var interaction=require(_0x9ce8('0x6'));var config=require(_0x9ce8('0x7'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x9ce8('0x8')](),controller[_0x9ce8('0x9')]);router['get']('/describe',auth[_0x9ce8('0x8')](),controller['describe']);router['get'](_0x9ce8('0xa'),auth[_0x9ce8('0x8')](),controller[_0x9ce8('0xb')]);router[_0x9ce8('0xc')]('/',auth[_0x9ce8('0x8')](),interaction[_0x9ce8('0xd')](_0x9ce8('0xe'),_0x9ce8('0xf')),controller['create']);router['post'](_0x9ce8('0x10'),controller['status']);router[_0x9ce8('0x11')](_0x9ce8('0xa'),auth[_0x9ce8('0x8')](),controller[_0x9ce8('0x12')]);router[_0x9ce8('0x11')](_0x9ce8('0x13'),auth['isAuthenticated'](),controller[_0x9ce8('0x14')]);router[_0x9ce8('0x11')](_0x9ce8('0x15'),auth[_0x9ce8('0x8')](),controller[_0x9ce8('0x16')]);router[_0x9ce8('0x17')]('/:id',auth[_0x9ce8('0x8')](),controller[_0x9ce8('0x18')]);module['exports']=router; \ No newline at end of file +var _0x93b5=['get','/describe','isAuthenticated','describe','post','tracked','sms','smsmessage:create','status','put','update','/:id/accept','reject','delete','/:id','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','index'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x93b5,0x178));var _0x593b=function(_0x495770,_0x3fee46){_0x495770=_0x495770-0x0;var _0x59c454=_0x93b5[_0x495770];return _0x59c454;};'use strict';var multer=require(_0x593b('0x0'));var util=require(_0x593b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x593b('0x2'));var router=express[_0x593b('0x3')]();var auth=require(_0x593b('0x4'));var interaction=require(_0x593b('0x5'));var config=require('../../config/environment');var controller=require(_0x593b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x593b('0x7')]);router[_0x593b('0x8')](_0x593b('0x9'),auth[_0x593b('0xa')](),controller[_0x593b('0xb')]);router['get']('/:id',auth[_0x593b('0xa')](),controller['show']);router[_0x593b('0xc')]('/',auth[_0x593b('0xa')](),interaction[_0x593b('0xd')](_0x593b('0xe'),_0x593b('0xf')),controller['create']);router[_0x593b('0xc')]('/:id/status',controller[_0x593b('0x10')]);router[_0x593b('0x11')]('/:id',auth[_0x593b('0xa')](),controller[_0x593b('0x12')]);router[_0x593b('0x11')](_0x593b('0x13'),auth[_0x593b('0xa')](),controller['accept']);router[_0x593b('0x11')]('/:id/reject',auth[_0x593b('0xa')](),controller[_0x593b('0x14')]);router[_0x593b('0x15')](_0x593b('0x16'),auth[_0x593b('0xa')](),controller['destroy']);module[_0x593b('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 04ca4db..1503e94 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 _0x4cfd=['sequelize','exports','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x39b732,_0x4fff2c){var _0x20176d=function(_0x39dbee){while(--_0x39dbee){_0x39b732['push'](_0x39b732['shift']());}};_0x20176d(++_0x4fff2c);}(_0x4cfd,0x170));var _0xd4cf=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x4cfd[_0x1627ae];return _0x34b38f;};'use strict';var Sequelize=require(_0xd4cf('0x0'));module[_0xd4cf('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd4cf('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd4cf('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd4cf('0x4')]('in',_0xd4cf('0x5')),'defaultValue':_0xd4cf('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd4cf('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xd4cf('0x7')]},'secret':{'type':Sequelize[_0xd4cf('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x9576=['DATE','BOOLEAN','sequelize','exports','TEXT','medium','out','STRING'];(function(_0x146982,_0x2e890d){var _0x4bc3d4=function(_0x13e8d4){while(--_0x13e8d4){_0x146982['push'](_0x146982['shift']());}};_0x4bc3d4(++_0x2e890d);}(_0x9576,0x182));var _0x6957=function(_0x19e73a,_0x38a3c6){_0x19e73a=_0x19e73a-0x0;var _0x55b7e9=_0x9576[_0x19e73a];return _0x55b7e9;};'use strict';var Sequelize=require(_0x6957('0x0'));module[_0x6957('0x1')]={'body':{'type':Sequelize[_0x6957('0x2')](_0x6957('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x6957('0x4')),'defaultValue':_0x6957('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6957('0x5')](0xbe)},'phone':{'type':Sequelize[_0x6957('0x5')]},'readAt':{'type':Sequelize[_0x6957('0x6')]},'secret':{'type':Sequelize[_0x6957('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index cef3d9f..3d040db 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 _0xe14b=['plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','DELIVERED','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','sendStatus','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','map','type','field','merge','SmsMessage','include','findAll','params','includeAll','options','create','update','body','find','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','SmsAccountId','debug','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect'];(function(_0x36e963,_0x61d1f9){var _0x5e4971=function(_0x1d1eeb){while(--_0x1d1eeb){_0x36e963['push'](_0x36e963['shift']());}};_0x5e4971(++_0x61d1f9);}(_0xe14b,0x93));var _0xbe14=function(_0xf8782,_0x1824ab){_0xf8782=_0xf8782-0x0;var _0x2d2f69=_0xe14b[_0xf8782];return _0x2d2f69;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbe14('0x10'))(_0xbe14('0x11'));var utils=require('../../config/utils');var config=require(_0xbe14('0x12'));var db=require(_0xbe14('0x13'))['db'];config[_0xbe14('0x14')]=_[_0xbe14('0x15')](config[_0xbe14('0x14')],{'host':_0xbe14('0x16'),'port':0x18eb});var socket=require(_0xbe14('0x17'))(new Redis(config[_0xbe14('0x14')]));require(_0xbe14('0x18'))[_0xbe14('0x19')](socket);var jayson=require(_0xbe14('0x1a'));var client=jayson[_0xbe14('0x1b')][_0xbe14('0x1c')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3f58f5,_0x3dc4a9,_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37ce4e['test'](_0x3dc4a9)){return _0x3f58f5;}else{throw new Error(_0xbe14('0x1d'));}}else{return _0x3f58f5;}}function respondWithRpcPromise(_0xe9c3ec,_0xfd7b8f,_0x123ede,_0x38f1ea){return new BPromise(function(_0x29ab73,_0x17ae86){var _0x5ea1f8=_0x38f1ea||client;return _0x5ea1f8[_0xbe14('0x1e')](_0xe9c3ec,_0x123ede)[_0xbe14('0x1f')](function(_0x329588){logger[_0xbe14('0x20')](_0xbe14('0x21'),_0xfd7b8f,_0xbe14('0x22'));logger['debug'](_0xbe14('0x23'),_0xfd7b8f,_0xbe14('0x22'),JSON[_0xbe14('0x24')](_0x329588));if(_0x329588[_0xbe14('0x25')]){if(_0x329588[_0xbe14('0x25')]['code']===0x1f4){logger[_0xbe14('0x25')]('SmsMessage,\x20%s,\x20%s',_0xfd7b8f,_0x329588[_0xbe14('0x25')]['message']);return _0x17ae86(_0x329588[_0xbe14('0x25')]['message']);}logger[_0xbe14('0x25')](_0xbe14('0x21'),_0xfd7b8f,_0x329588['error'][_0xbe14('0x26')]);return _0x29ab73(_0x329588['error'][_0xbe14('0x26')]);}else{logger['info'](_0xbe14('0x21'),_0xfd7b8f,_0xbe14('0x22'));_0x29ab73(_0x329588[_0xbe14('0x27')][_0xbe14('0x26')]);}})[_0xbe14('0x28')](function(_0x2703f5){logger['error'](_0xbe14('0x21'),_0xfd7b8f,_0x2703f5);_0x17ae86(_0x2703f5);});});}function respondWithStatusCode(_0x1ba46a,_0x391556){_0x391556=_0x391556||0xcc;return function(_0x169369){if(_0x169369){return _0x1ba46a['sendStatus'](_0x391556);}return _0x1ba46a[_0xbe14('0x29')](_0x391556)[_0xbe14('0x2a')]();};}function respondWithResult(_0x59bf34,_0x3c3613){_0x3c3613=_0x3c3613||0xc8;return function(_0x3b3e84){if(_0x3b3e84){return _0x59bf34[_0xbe14('0x29')](_0x3c3613)[_0xbe14('0x2b')](_0x3b3e84);}};}function respondWithFilteredResult(_0x34d648,_0x36d4b2){return function(_0x31a664){if(_0x31a664){var _0x2b05cb=_0x31a664[_0xbe14('0x2c')],_0x4168c8=_0x36d4b2[_0xbe14('0x2d')],_0x16a159=_0x36d4b2[_0xbe14('0x2d')]+_0x36d4b2[_0xbe14('0x2e')],_0x40538f;if(_0x16a159>=_0x2b05cb){_0x16a159=_0x2b05cb;_0x40538f=0xc8;}else{_0x40538f=0xce;}_0x34d648[_0xbe14('0x29')](_0x40538f);return _0x34d648[_0xbe14('0x2f')](_0xbe14('0x30'),_0x4168c8+'-'+_0x16a159+'/'+_0x2b05cb)[_0xbe14('0x2b')](_0x31a664);}return null;};}function patchUpdates(_0x14e7c4){return function(_0x581e86){try{jsonpatch[_0xbe14('0x31')](_0x581e86,_0x14e7c4,!![]);}catch(_0x499793){return BPromise['reject'](_0x499793);}return _0x581e86[_0xbe14('0x32')]();};}function saveUpdates(_0x4c1e7e,_0x243524){return function(_0x345b0){if(_0x345b0){return _0x345b0['update'](_0x4c1e7e)['then'](function(_0x5798c7){return _0x5798c7;});}return null;};}function removeEntity(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(_0x5f27b6){return _0x5f27b6[_0xbe14('0x33')]()[_0xbe14('0x1f')](function(){_0x412ad5[_0xbe14('0x29')](0xcc)[_0xbe14('0x2a')]();});}};}function handleEntityNotFound(_0x29c23e,_0x5ef1e5){return function(_0x591a36){if(!_0x591a36){_0x29c23e[_0xbe14('0x34')](0x194);}return _0x591a36;};}function handleError(_0x52b24c,_0x5dd7aa){_0x5dd7aa=_0x5dd7aa||0x1f4;return function(_0x5c5e9f){logger[_0xbe14('0x25')](_0x5c5e9f[_0xbe14('0x35')]);if(_0x5c5e9f[_0xbe14('0x36')]){delete _0x5c5e9f[_0xbe14('0x36')];}_0x52b24c[_0xbe14('0x29')](_0x5dd7aa)[_0xbe14('0x37')](_0x5c5e9f);};}exports[_0xbe14('0x38')]=function(_0x10ec3c,_0x2d9c12){var _0x2dfd5a={},_0x41652d={},_0x32c59d={'count':0x0,'rows':[]};var _0x539c41=db['SmsMessage'][_0xbe14('0x39')];_0x41652d[_0xbe14('0x3a')]=_[_0xbe14('0x3b')](_0x539c41);_0x41652d['query']=_[_0xbe14('0x3b')](_0x10ec3c[_0xbe14('0x3c')]);_0x41652d[_0xbe14('0x3d')]=_[_0xbe14('0x3e')](_0x41652d[_0xbe14('0x3a')],_0x41652d[_0xbe14('0x3c')]);_0x2dfd5a[_0xbe14('0x3f')]=_[_0xbe14('0x3e')](_0x41652d[_0xbe14('0x3a')],qs['fields'](_0x10ec3c[_0xbe14('0x3c')][_0xbe14('0x40')]));_0x2dfd5a[_0xbe14('0x3f')]=_0x2dfd5a[_0xbe14('0x3f')][_0xbe14('0x41')]?_0x2dfd5a[_0xbe14('0x3f')]:_0x41652d['model'];if(!_0x10ec3c[_0xbe14('0x3c')][_0xbe14('0x42')](_0xbe14('0x43'))){_0x2dfd5a[_0xbe14('0x2e')]=qs['limit'](_0x10ec3c['query'][_0xbe14('0x2e')]);_0x2dfd5a[_0xbe14('0x2d')]=qs[_0xbe14('0x2d')](_0x10ec3c['query']['offset']);}_0x2dfd5a[_0xbe14('0x44')]=qs['sort'](_0x10ec3c['query'][_0xbe14('0x45')]);_0x2dfd5a[_0xbe14('0x46')]=qs[_0xbe14('0x3d')](_['pick'](_0x10ec3c['query'],_0x41652d['filters']));if(_0x10ec3c[_0xbe14('0x3c')][_0xbe14('0x47')]){_0x2dfd5a[_0xbe14('0x46')]=_['merge'](_0x2dfd5a[_0xbe14('0x46')],{'$or':_[_0xbe14('0x48')](_0x539c41,function(_0x32f22e){if(_0x32f22e[_0xbe14('0x49')]['key']!=='VIRTUAL'){var _0x3e2fd3={};_0x3e2fd3[_0x32f22e[_0xbe14('0x4a')]]={'$like':'%'+_0x10ec3c[_0xbe14('0x3c')][_0xbe14('0x47')]+'%'};return _0x3e2fd3;}})});}_0x2dfd5a=_[_0xbe14('0x4b')]({},_0x2dfd5a,_0x10ec3c['options']);var _0x51023a={'where':_0x2dfd5a[_0xbe14('0x46')]};return db[_0xbe14('0x4c')][_0xbe14('0x2c')](_0x51023a)[_0xbe14('0x1f')](function(_0x4e65d2){_0x32c59d[_0xbe14('0x2c')]=_0x4e65d2;if(_0x10ec3c[_0xbe14('0x3c')]['includeAll']){_0x2dfd5a[_0xbe14('0x4d')]=[{'all':!![]}];}return db[_0xbe14('0x4c')][_0xbe14('0x4e')](_0x2dfd5a);})[_0xbe14('0x1f')](function(_0x589dac){_0x32c59d['rows']=_0x589dac;return _0x32c59d;})[_0xbe14('0x1f')](respondWithFilteredResult(_0x2d9c12,_0x2dfd5a))[_0xbe14('0x28')](handleError(_0x2d9c12,null));};exports['show']=function(_0x5acf90,_0xca8cdb){var _0x5d3726={'raw':!![],'where':{'id':_0x5acf90[_0xbe14('0x4f')]['id']}},_0x3f7f5b={};_0x3f7f5b[_0xbe14('0x3a')]=_[_0xbe14('0x3b')](db[_0xbe14('0x4c')]['rawAttributes']);_0x3f7f5b[_0xbe14('0x3c')]=_[_0xbe14('0x3b')](_0x5acf90[_0xbe14('0x3c')]);_0x3f7f5b[_0xbe14('0x3d')]=_[_0xbe14('0x3e')](_0x3f7f5b['model'],_0x3f7f5b[_0xbe14('0x3c')]);_0x5d3726[_0xbe14('0x3f')]=_[_0xbe14('0x3e')](_0x3f7f5b[_0xbe14('0x3a')],qs[_0xbe14('0x40')](_0x5acf90[_0xbe14('0x3c')]['fields']));_0x5d3726['attributes']=_0x5d3726[_0xbe14('0x3f')][_0xbe14('0x41')]?_0x5d3726[_0xbe14('0x3f')]:_0x3f7f5b['model'];if(_0x5acf90['query'][_0xbe14('0x50')]){_0x5d3726[_0xbe14('0x4d')]=[{'all':!![]}];}_0x5d3726=_['merge']({},_0x5d3726,_0x5acf90[_0xbe14('0x51')]);return db[_0xbe14('0x4c')]['find'](_0x5d3726)[_0xbe14('0x1f')](handleEntityNotFound(_0xca8cdb,null))['then'](respondWithResult(_0xca8cdb,null))[_0xbe14('0x28')](handleError(_0xca8cdb,null));};exports[_0xbe14('0x52')]=function(_0x12a9de,_0x550291){return db[_0xbe14('0x4c')][_0xbe14('0x52')](_0x12a9de['body'],{})[_0xbe14('0x1f')](respondWithResult(_0x550291,0xc9))[_0xbe14('0x28')](handleError(_0x550291,null));};exports[_0xbe14('0x53')]=function(_0x20c48d,_0x49322f){if(_0x20c48d['body']['id']){delete _0x20c48d[_0xbe14('0x54')]['id'];}return db[_0xbe14('0x4c')][_0xbe14('0x55')]({'where':{'id':_0x20c48d[_0xbe14('0x4f')]['id']}})[_0xbe14('0x1f')](handleEntityNotFound(_0x49322f,null))[_0xbe14('0x1f')](saveUpdates(_0x20c48d[_0xbe14('0x54')],null))['then'](respondWithResult(_0x49322f,null))[_0xbe14('0x28')](handleError(_0x49322f,null));};exports[_0xbe14('0x33')]=function(_0x941ee2,_0x1201e2){return db[_0xbe14('0x4c')][_0xbe14('0x55')]({'where':{'id':_0x941ee2[_0xbe14('0x4f')]['id']}})[_0xbe14('0x1f')](handleEntityNotFound(_0x1201e2,null))[_0xbe14('0x1f')](removeEntity(_0x1201e2,null))[_0xbe14('0x28')](handleError(_0x1201e2,null));};exports[_0xbe14('0x56')]=function(_0x4bccfc,_0x56bcd3){return db['SmsMessage'][_0xbe14('0x56')]()[_0xbe14('0x1f')](respondWithResult(_0x56bcd3,null))[_0xbe14('0x28')](handleError(_0x56bcd3,null));};var interaction_log=require(_0xbe14('0x10'))(_0xbe14('0x57'));exports[_0xbe14('0x58')]=function(_0x16ee48,_0x22bf69,_0x31d015){var _0x451b0b={'channel':_0xbe14('0x59')};if(_0x16ee48[_0xbe14('0x54')]['id']){delete _0x16ee48[_0xbe14('0x54')]['id'];}_0x16ee48[_0xbe14('0x54')][_0xbe14('0x5a')]=!![];_0x16ee48[_0xbe14('0x54')][_0xbe14('0x5b')]=moment()[_0xbe14('0x5c')](_0xbe14('0x5d'));_0x16ee48[_0xbe14('0x54')]['UserId']=_0x16ee48[_0xbe14('0x54')][_0xbe14('0x5e')]||_0x16ee48[_0xbe14('0x5f')]['id'];return db[_0xbe14('0x4c')][_0xbe14('0x55')]({'where':{'id':_0x16ee48[_0xbe14('0x4f')]['id'],'UserId':null},'include':[{'model':db[_0xbe14('0x60')],'as':_0xbe14('0x61')}]})[_0xbe14('0x1f')](handleEntityNotFound(_0x22bf69,null))[_0xbe14('0x1f')](saveUpdates(_0x16ee48['body'],null))[_0xbe14('0x1f')](function(_0x442ec4){if(_0x442ec4){_0x451b0b[_0xbe14('0x26')]=_0x442ec4[_0xbe14('0x62')]({'plain':!![]});return db[_0xbe14('0x63')]['find']({'where':{'id':_0x442ec4[_0xbe14('0x64')]}});}return null;})[_0xbe14('0x1f')](handleEntityNotFound(_0x22bf69,null))[_0xbe14('0x1f')](function(_0xd4e1c7){if(_0xd4e1c7){return _0xd4e1c7[_0xbe14('0x53')]({'UserId':_0x16ee48['body'][_0xbe14('0x5e')],'read1stAt':_[_0xbe14('0x65')](_0xd4e1c7[_0xbe14('0x66')])?moment()[_0xbe14('0x5c')](_0xbe14('0x5d')):undefined});}return null;})[_0xbe14('0x1f')](function(_0xd9dd1c){if(_0xd9dd1c){_0x451b0b[_0xbe14('0x67')]=_0xd9dd1c['get']({'plain':!![]});interaction_log[_0xbe14('0x20')](_0xbe14('0x68'),_0x16ee48[_0xbe14('0x5f')]['id'],_0x16ee48[_0xbe14('0x5f')][_0xbe14('0x36')],_0x16ee48[_0xbe14('0x5f')][_0xbe14('0x69')],_0x451b0b['interaction']['id'],_0x16ee48['body']?JSON[_0xbe14('0x24')](_0x16ee48[_0xbe14('0x54')]):_0xbe14('0x6a'));return respondWithRpcPromise(_0xbe14('0x6b'),_0xbe14('0x6c'),_0x451b0b);}return null;})[_0xbe14('0x1f')](function(_0x23a32f){if(_0x23a32f){if(_0x16ee48[_0xbe14('0x54')]['manual']){_0x451b0b['message'][_0xbe14('0x6d')]=util[_0xbe14('0x5c')](_0xbe14('0x6e'),_0x16ee48['user'][_0xbe14('0x36')]);_0x451b0b[_0xbe14('0x26')][_0xbe14('0x6f')]=_0x451b0b[_0xbe14('0x6f')];_0x451b0b[_0xbe14('0x26')][_0xbe14('0x70')]=_0xbe14('0x58');return respondWithRpcPromise('EventManager',_0xbe14('0x71'),{'event':_0xbe14('0x72'),'message':_0x451b0b[_0xbe14('0x26')]},client9002)[_0xbe14('0x1f')](function(){return _0x451b0b;});}return _0x451b0b;}return null;})[_0xbe14('0x1f')](respondWithResult(_0x22bf69,null))[_0xbe14('0x28')](handleError(_0x22bf69,null));};var interaction_log=require(_0xbe14('0x10'))('sms-interactions');exports[_0xbe14('0x73')]=function(_0x16b046,_0x3cd17e,_0x1c0932){var _0x28da4a={'agent':{},'channel':_0xbe14('0x59')};if(_0x16b046[_0xbe14('0x54')]['id']){delete _0x16b046[_0xbe14('0x54')]['id'];}_0x16b046['body'][_0xbe14('0x5e')]=_0x16b046[_0xbe14('0x54')][_0xbe14('0x5e')]||_0x16b046[_0xbe14('0x5f')]['id'];_0x28da4a[_0xbe14('0x74')]['id']=_0x16b046[_0xbe14('0x54')]['UserId'];return db[_0xbe14('0x4c')][_0xbe14('0x55')]({'where':{'id':_0x16b046[_0xbe14('0x4f')]['id'],'UserId':null}})[_0xbe14('0x1f')](handleEntityNotFound(_0x3cd17e,null))['then'](function(_0x7e9e5c){if(_0x7e9e5c){_0x28da4a[_0xbe14('0x26')]=_0x7e9e5c[_0xbe14('0x62')]({'plain':!![]});return db[_0xbe14('0x63')][_0xbe14('0x55')]({'where':{'id':_0x7e9e5c[_0xbe14('0x64')]}});}return null;})[_0xbe14('0x1f')](handleEntityNotFound(_0x3cd17e,null))['then'](function(_0x70ed08){if(_0x70ed08){_0x28da4a['interaction']=_0x70ed08[_0xbe14('0x62')]({'plain':!![]});interaction_log['info'](_0xbe14('0x75'),_0x16b046[_0xbe14('0x5f')]['id'],_0x16b046[_0xbe14('0x5f')]['name'],_0x16b046[_0xbe14('0x5f')][_0xbe14('0x69')],_0x28da4a[_0xbe14('0x67')]['id'],_0x16b046['body']?JSON[_0xbe14('0x24')](_0x16b046[_0xbe14('0x54')]):_0xbe14('0x6a'));return respondWithRpcPromise(_0xbe14('0x76'),'rejectMessage',_0x28da4a);}return null;})[_0xbe14('0x1f')](function(_0x39bc54){if(_0x39bc54){_0x39bc54[_0xbe14('0x26')][_0xbe14('0x6d')]=util[_0xbe14('0x5c')](_0xbe14('0x6e'),_0x16b046[_0xbe14('0x5f')]['name']);_0x39bc54[_0xbe14('0x26')][_0xbe14('0x6f')]=_0x28da4a[_0xbe14('0x6f')];_0x39bc54['message'][_0xbe14('0x70')]=_0xbe14('0x73');respondWithRpcPromise(_0xbe14('0x71'),'EventManager',{'event':_0xbe14('0x77'),'message':_0x39bc54[_0xbe14('0x26')]},client9002);return _0x28da4a;}return null;})['then'](respondWithResult(_0x3cd17e,null))[_0xbe14('0x28')](handleError(_0x3cd17e,null));};exports['status']=function(_0x4640b1,_0x337073,_0x4dfa19){if(_0x4640b1['body']['id']){delete _0x4640b1[_0xbe14('0x54')]['id'];}var _0x3db955;return db[_0xbe14('0x4c')]['find']({'where':{'id':_0x4640b1[_0xbe14('0x4f')]['id']}})[_0xbe14('0x1f')](handleEntityNotFound(_0x337073,null))[_0xbe14('0x1f')](function(_0x32c92c){if(_0x32c92c){_0x3db955=_0x32c92c;return db['SmsAccount']['find']({'where':{'id':_0x32c92c[_0xbe14('0x78')]}});}})[_0xbe14('0x1f')](handleEntityNotFound(_0x337073,null))[_0xbe14('0x1f')](function(_0x215d5b){if(_0x215d5b){logger[_0xbe14('0x79')](_0xbe14('0x23'),_0xbe14('0x29'),'received\x20delivery\x20report\x20from',_0x215d5b[_0xbe14('0x49')],util['inspect'](_0x4640b1[_0xbe14('0x54')],{'showHidden':![],'depth':null}));switch(_0x215d5b[_0xbe14('0x49')]){case _0xbe14('0x7a'):if(_0x4640b1[_0xbe14('0x54')]['MessageSid']&&_0x4640b1[_0xbe14('0x54')][_0xbe14('0x7b')]===_0x3db955[_0xbe14('0x7c')]){return _0x3db955['update']({'read':!![]});}else{logger[_0xbe14('0x25')](_0xbe14('0x7d'),_0xbe14('0x29'),_0xbe14('0x7a'),util[_0xbe14('0x7e')](_0x4640b1[_0xbe14('0x54')],{'showHidden':![],'depth':null}));}break;case _0xbe14('0x7f'):if(_0x4640b1[_0xbe14('0x54')][_0xbe14('0x80')]&&_0x4640b1[_0xbe14('0x54')][_0xbe14('0x80')]===_0x3db955[_0xbe14('0x7c')]&&_[_0xbe14('0x81')]([_0xbe14('0x82'),_0xbe14('0x83')],_0x4640b1[_0xbe14('0x54')][_0xbe14('0x84')])>=0x0){return _0x3db955[_0xbe14('0x53')]({'read':!![]});}else{logger[_0xbe14('0x25')](_0xbe14('0x7d'),'status',_0xbe14('0x85'),util['inspect'](_0x4640b1[_0xbe14('0x54')],{'showHidden':![],'depth':null}));}break;case _0xbe14('0x86'):var _0x262bc0=_0x4640b1[_0xbe14('0x54')][_0xbe14('0x87')][0x0];if(_0x262bc0['status']['groupName']===_0xbe14('0x88')){return _0x3db955[_0xbe14('0x53')]({'read':!![]});}else{logger[_0xbe14('0x25')](_0xbe14('0x7d'),'status',_0xbe14('0x86'),util[_0xbe14('0x7e')](_0x4640b1['body'],{'showHidden':![],'depth':null}));}break;}return _0x3db955;}})[_0xbe14('0x1f')](respondWithResult(_0x337073,null))[_0xbe14('0x28')](handleError(_0x337073,null));}; \ No newline at end of file +var _0xd8fb=['sms-interactions','sms','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','event','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','update','SmsAccount,\x20%s,\x20%s,\x20%s','twilio','plivo','indexOf','sent','delivered','plivio','infobip','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','offset','limit','json','apply','reject','save','sendStatus','stack','name','send','index','SmsMessage','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','merge','options','count','includeAll','include','findAll','rows','show','params','find','create','body','destroy','describe','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','interface','channel','EventManager','acceptmessage'];(function(_0x1c4205,_0x4cacf2){var _0x1c2598=function(_0x1df2c4){while(--_0x1df2c4){_0x1c4205['push'](_0x1c4205['shift']());}};_0x1c2598(++_0x4cacf2);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5e4531,_0x1ee689){_0x5e4531=_0x5e4531-0x0;var _0x741336=_0xd8fb[_0x5e4531];return _0x741336;};'use strict';var pdf=require(_0xbd8f('0x0'));var emlformat=require(_0xbd8f('0x1'));var rimraf=require(_0xbd8f('0x2'));var zipdir=require(_0xbd8f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbd8f('0x4'));var Mustache=require(_0xbd8f('0x5'));var util=require('util');var path=require(_0xbd8f('0x6'));var sox=require(_0xbd8f('0x7'));var csv=require('to-csv');var ejs=require(_0xbd8f('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbd8f('0x9'));var crypto=require('crypto');var jsforce=require(_0xbd8f('0xa'));var deskjs=require(_0xbd8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd8f('0xc'));var Redis=require(_0xbd8f('0xd'));var authService=require(_0xbd8f('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xbd8f('0xf'));var logger=require(_0xbd8f('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xbd8f('0x11'));var db=require(_0xbd8f('0x12'))['db'];config[_0xbd8f('0x13')]=_['defaults'](config[_0xbd8f('0x13')],{'host':_0xbd8f('0x14'),'port':0x18eb});var socket=require(_0xbd8f('0x15'))(new Redis(config[_0xbd8f('0x13')]));require(_0xbd8f('0x16'))[_0xbd8f('0x17')](socket);var jayson=require(_0xbd8f('0x18'));var client=jayson[_0xbd8f('0x19')][_0xbd8f('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xbd8f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x829fb2,_0xa57e91,_0x10d72e){if(_0x10d72e){var _0x4da96f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4da96f[_0xbd8f('0x1b')](_0xa57e91)){return _0x829fb2;}else{throw new Error(_0xbd8f('0x1c'));}}else{return _0x829fb2;}}function respondWithRpcPromise(_0x5ebf8b,_0x15be97,_0xf5e7a,_0x504adb){return new BPromise(function(_0x4435b9,_0x36a6af){var _0x47d317=_0x504adb||client;return _0x47d317['request'](_0x5ebf8b,_0xf5e7a)[_0xbd8f('0x1d')](function(_0x5d2fdb){logger['info'](_0xbd8f('0x1e'),_0x15be97,'request\x20sent');logger[_0xbd8f('0x1f')](_0xbd8f('0x20'),_0x15be97,_0xbd8f('0x21'),JSON[_0xbd8f('0x22')](_0x5d2fdb));if(_0x5d2fdb[_0xbd8f('0x23')]){if(_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x24')]===0x1f4){logger[_0xbd8f('0x23')](_0xbd8f('0x1e'),_0x15be97,_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x25')]);return _0x36a6af(_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x25')]);}logger[_0xbd8f('0x23')](_0xbd8f('0x1e'),_0x15be97,_0x5d2fdb[_0xbd8f('0x23')][_0xbd8f('0x25')]);return _0x4435b9(_0x5d2fdb['error'][_0xbd8f('0x25')]);}else{logger[_0xbd8f('0x26')](_0xbd8f('0x1e'),_0x15be97,_0xbd8f('0x21'));_0x4435b9(_0x5d2fdb[_0xbd8f('0x27')][_0xbd8f('0x25')]);}})[_0xbd8f('0x28')](function(_0x264e62){logger['error'](_0xbd8f('0x1e'),_0x15be97,_0x264e62);_0x36a6af(_0x264e62);});});}function respondWithStatusCode(_0x421f3e,_0x5a3a8c){_0x5a3a8c=_0x5a3a8c||0xcc;return function(_0x339df7){if(_0x339df7){return _0x421f3e['sendStatus'](_0x5a3a8c);}return _0x421f3e[_0xbd8f('0x29')](_0x5a3a8c)[_0xbd8f('0x2a')]();};}function respondWithResult(_0x991401,_0x202126){_0x202126=_0x202126||0xc8;return function(_0x2aefa2){if(_0x2aefa2){return _0x991401[_0xbd8f('0x29')](_0x202126)['json'](_0x2aefa2);}};}function respondWithFilteredResult(_0x166de7,_0x14f3cb){return function(_0x39714d){if(_0x39714d){var _0x3ee851=_0x39714d['count'],_0x3d2e1b=_0x14f3cb[_0xbd8f('0x2b')],_0x2ac26f=_0x14f3cb[_0xbd8f('0x2b')]+_0x14f3cb[_0xbd8f('0x2c')],_0x2a4b32;if(_0x2ac26f>=_0x3ee851){_0x2ac26f=_0x3ee851;_0x2a4b32=0xc8;}else{_0x2a4b32=0xce;}_0x166de7[_0xbd8f('0x29')](_0x2a4b32);return _0x166de7['set']('Content-Range',_0x3d2e1b+'-'+_0x2ac26f+'/'+_0x3ee851)[_0xbd8f('0x2d')](_0x39714d);}return null;};}function patchUpdates(_0x3cdec2){return function(_0x2fd6f8){try{jsonpatch[_0xbd8f('0x2e')](_0x2fd6f8,_0x3cdec2,!![]);}catch(_0x57c0cc){return BPromise[_0xbd8f('0x2f')](_0x57c0cc);}return _0x2fd6f8[_0xbd8f('0x30')]();};}function saveUpdates(_0x31d7be,_0x2137ed){return function(_0x25ad9a){if(_0x25ad9a){return _0x25ad9a['update'](_0x31d7be)[_0xbd8f('0x1d')](function(_0x407785){return _0x407785;});}return null;};}function removeEntity(_0x383807,_0x3949c2){return function(_0x2df6a6){if(_0x2df6a6){return _0x2df6a6['destroy']()[_0xbd8f('0x1d')](function(){_0x383807['status'](0xcc)[_0xbd8f('0x2a')]();});}};}function handleEntityNotFound(_0x1e77c7,_0x337bc4){return function(_0x386a29){if(!_0x386a29){_0x1e77c7[_0xbd8f('0x31')](0x194);}return _0x386a29;};}function handleError(_0x1569a0,_0x4a2bc8){_0x4a2bc8=_0x4a2bc8||0x1f4;return function(_0x4bafcd){logger['error'](_0x4bafcd[_0xbd8f('0x32')]);if(_0x4bafcd[_0xbd8f('0x33')]){delete _0x4bafcd[_0xbd8f('0x33')];}_0x1569a0[_0xbd8f('0x29')](_0x4a2bc8)[_0xbd8f('0x34')](_0x4bafcd);};}exports[_0xbd8f('0x35')]=function(_0x2f5f59,_0x30c1c2){var _0x2d4882={},_0x2a6145={},_0x3d4c9a={'count':0x0,'rows':[]};var _0x339c70=db[_0xbd8f('0x36')][_0xbd8f('0x37')];_0x2a6145[_0xbd8f('0x38')]=_['keys'](_0x339c70);_0x2a6145[_0xbd8f('0x39')]=_[_0xbd8f('0x3a')](_0x2f5f59['query']);_0x2a6145[_0xbd8f('0x3b')]=_[_0xbd8f('0x3c')](_0x2a6145[_0xbd8f('0x38')],_0x2a6145['query']);_0x2d4882[_0xbd8f('0x3d')]=_['intersection'](_0x2a6145[_0xbd8f('0x38')],qs[_0xbd8f('0x3e')](_0x2f5f59[_0xbd8f('0x39')]['fields']));_0x2d4882[_0xbd8f('0x3d')]=_0x2d4882[_0xbd8f('0x3d')][_0xbd8f('0x3f')]?_0x2d4882['attributes']:_0x2a6145[_0xbd8f('0x38')];if(!_0x2f5f59[_0xbd8f('0x39')][_0xbd8f('0x40')](_0xbd8f('0x41'))){_0x2d4882[_0xbd8f('0x2c')]=qs[_0xbd8f('0x2c')](_0x2f5f59[_0xbd8f('0x39')][_0xbd8f('0x2c')]);_0x2d4882[_0xbd8f('0x2b')]=qs['offset'](_0x2f5f59['query'][_0xbd8f('0x2b')]);}_0x2d4882[_0xbd8f('0x42')]=qs[_0xbd8f('0x43')](_0x2f5f59[_0xbd8f('0x39')]['sort']);_0x2d4882[_0xbd8f('0x44')]=qs[_0xbd8f('0x3b')](_[_0xbd8f('0x45')](_0x2f5f59[_0xbd8f('0x39')],_0x2a6145[_0xbd8f('0x3b')]));if(_0x2f5f59['query']['filter']){_0x2d4882[_0xbd8f('0x44')]=_['merge'](_0x2d4882[_0xbd8f('0x44')],{'$or':_[_0xbd8f('0x46')](_0x339c70,function(_0xede200){if(_0xede200[_0xbd8f('0x47')][_0xbd8f('0x48')]!==_0xbd8f('0x49')){var _0x1ea49a={};_0x1ea49a[_0xede200[_0xbd8f('0x4a')]]={'$like':'%'+_0x2f5f59['query'][_0xbd8f('0x4b')]+'%'};return _0x1ea49a;}})});}_0x2d4882=_[_0xbd8f('0x4c')]({},_0x2d4882,_0x2f5f59[_0xbd8f('0x4d')]);var _0x3e564f={'where':_0x2d4882[_0xbd8f('0x44')]};return db[_0xbd8f('0x36')][_0xbd8f('0x4e')](_0x3e564f)[_0xbd8f('0x1d')](function(_0x5668b6){_0x3d4c9a[_0xbd8f('0x4e')]=_0x5668b6;if(_0x2f5f59[_0xbd8f('0x39')][_0xbd8f('0x4f')]){_0x2d4882[_0xbd8f('0x50')]=[{'all':!![]}];}return db[_0xbd8f('0x36')][_0xbd8f('0x51')](_0x2d4882);})[_0xbd8f('0x1d')](function(_0x439bbd){_0x3d4c9a[_0xbd8f('0x52')]=_0x439bbd;return _0x3d4c9a;})[_0xbd8f('0x1d')](respondWithFilteredResult(_0x30c1c2,_0x2d4882))[_0xbd8f('0x28')](handleError(_0x30c1c2,null));};exports[_0xbd8f('0x53')]=function(_0x3d0ffa,_0x1457d6){var _0x467566={'raw':!![],'where':{'id':_0x3d0ffa[_0xbd8f('0x54')]['id']}},_0x21790b={};_0x21790b[_0xbd8f('0x38')]=_[_0xbd8f('0x3a')](db['SmsMessage'][_0xbd8f('0x37')]);_0x21790b[_0xbd8f('0x39')]=_[_0xbd8f('0x3a')](_0x3d0ffa[_0xbd8f('0x39')]);_0x21790b['filters']=_[_0xbd8f('0x3c')](_0x21790b['model'],_0x21790b[_0xbd8f('0x39')]);_0x467566[_0xbd8f('0x3d')]=_[_0xbd8f('0x3c')](_0x21790b[_0xbd8f('0x38')],qs['fields'](_0x3d0ffa[_0xbd8f('0x39')][_0xbd8f('0x3e')]));_0x467566[_0xbd8f('0x3d')]=_0x467566[_0xbd8f('0x3d')][_0xbd8f('0x3f')]?_0x467566[_0xbd8f('0x3d')]:_0x21790b['model'];if(_0x3d0ffa[_0xbd8f('0x39')]['includeAll']){_0x467566[_0xbd8f('0x50')]=[{'all':!![]}];}_0x467566=_[_0xbd8f('0x4c')]({},_0x467566,_0x3d0ffa[_0xbd8f('0x4d')]);return db[_0xbd8f('0x36')][_0xbd8f('0x55')](_0x467566)[_0xbd8f('0x1d')](handleEntityNotFound(_0x1457d6,null))[_0xbd8f('0x1d')](respondWithResult(_0x1457d6,null))[_0xbd8f('0x28')](handleError(_0x1457d6,null));};exports[_0xbd8f('0x56')]=function(_0x4a4247,_0xf7443b){return db['SmsMessage'][_0xbd8f('0x56')](_0x4a4247[_0xbd8f('0x57')],{})['then'](respondWithResult(_0xf7443b,0xc9))[_0xbd8f('0x28')](handleError(_0xf7443b,null));};exports['update']=function(_0x58d891,_0x5e924c){if(_0x58d891['body']['id']){delete _0x58d891[_0xbd8f('0x57')]['id'];}return db[_0xbd8f('0x36')][_0xbd8f('0x55')]({'where':{'id':_0x58d891[_0xbd8f('0x54')]['id']}})[_0xbd8f('0x1d')](handleEntityNotFound(_0x5e924c,null))['then'](saveUpdates(_0x58d891['body'],null))[_0xbd8f('0x1d')](respondWithResult(_0x5e924c,null))[_0xbd8f('0x28')](handleError(_0x5e924c,null));};exports[_0xbd8f('0x58')]=function(_0x120b58,_0x29e20a){return db['SmsMessage'][_0xbd8f('0x55')]({'where':{'id':_0x120b58['params']['id']}})[_0xbd8f('0x1d')](handleEntityNotFound(_0x29e20a,null))[_0xbd8f('0x1d')](removeEntity(_0x29e20a,null))[_0xbd8f('0x28')](handleError(_0x29e20a,null));};exports['describe']=function(_0x3255be,_0x1d1757){return db[_0xbd8f('0x36')][_0xbd8f('0x59')]()['then'](respondWithResult(_0x1d1757,null))['catch'](handleError(_0x1d1757,null));};var interaction_log=require(_0xbd8f('0x10'))('sms-interactions');exports[_0xbd8f('0x5a')]=function(_0x20226c,_0x33471e,_0x93452d){var _0x4a86a9={'channel':'sms'};if(_0x20226c[_0xbd8f('0x57')]['id']){delete _0x20226c[_0xbd8f('0x57')]['id'];}_0x20226c[_0xbd8f('0x57')][_0xbd8f('0x5b')]=!![];_0x20226c[_0xbd8f('0x57')][_0xbd8f('0x5c')]=moment()[_0xbd8f('0x5d')](_0xbd8f('0x5e'));_0x20226c[_0xbd8f('0x57')][_0xbd8f('0x5f')]=_0x20226c[_0xbd8f('0x57')]['UserId']||_0x20226c[_0xbd8f('0x60')]['id'];return db[_0xbd8f('0x36')][_0xbd8f('0x55')]({'where':{'id':_0x20226c[_0xbd8f('0x54')]['id'],'UserId':null},'include':[{'model':db[_0xbd8f('0x61')],'as':_0xbd8f('0x62')}]})['then'](handleEntityNotFound(_0x33471e,null))[_0xbd8f('0x1d')](saveUpdates(_0x20226c[_0xbd8f('0x57')],null))['then'](function(_0x5e18fc){if(_0x5e18fc){_0x4a86a9[_0xbd8f('0x25')]=_0x5e18fc[_0xbd8f('0x63')]({'plain':!![]});return db[_0xbd8f('0x64')]['find']({'where':{'id':_0x5e18fc['SmsInteractionId']}});}return null;})[_0xbd8f('0x1d')](handleEntityNotFound(_0x33471e,null))['then'](function(_0x565e63){if(_0x565e63){return _0x565e63['update']({'UserId':_0x20226c['body']['UserId'],'read1stAt':_[_0xbd8f('0x65')](_0x565e63['read1stAt'])?moment()[_0xbd8f('0x5d')](_0xbd8f('0x5e')):undefined});}return null;})['then'](function(_0x1fcb28){if(_0x1fcb28){_0x4a86a9[_0xbd8f('0x66')]=_0x1fcb28[_0xbd8f('0x63')]({'plain':!![]});interaction_log[_0xbd8f('0x26')](_0xbd8f('0x67'),_0x20226c['user']['id'],_0x20226c['user'][_0xbd8f('0x33')],_0x20226c[_0xbd8f('0x60')][_0xbd8f('0x68')],_0x4a86a9[_0xbd8f('0x66')]['id'],_0x20226c[_0xbd8f('0x57')]?JSON[_0xbd8f('0x22')](_0x20226c['body']):'null');return respondWithRpcPromise(_0xbd8f('0x69'),_0xbd8f('0x6a'),_0x4a86a9);}return null;})['then'](function(_0x31ce0d){if(_0x31ce0d){if(_0x20226c[_0xbd8f('0x57')]['manual']){_0x4a86a9[_0xbd8f('0x25')][_0xbd8f('0x6b')]=util[_0xbd8f('0x5d')]('SIP/%s',_0x20226c['user'][_0xbd8f('0x33')]);_0x4a86a9[_0xbd8f('0x25')][_0xbd8f('0x6c')]=_0x4a86a9[_0xbd8f('0x6c')];_0x4a86a9[_0xbd8f('0x25')]['event']=_0xbd8f('0x5a');return respondWithRpcPromise(_0xbd8f('0x6d'),_0xbd8f('0x6d'),{'event':_0xbd8f('0x6e'),'message':_0x4a86a9[_0xbd8f('0x25')]},client9002)[_0xbd8f('0x1d')](function(){return _0x4a86a9;});}return _0x4a86a9;}return null;})[_0xbd8f('0x1d')](respondWithResult(_0x33471e,null))[_0xbd8f('0x28')](handleError(_0x33471e,null));};var interaction_log=require(_0xbd8f('0x10'))(_0xbd8f('0x6f'));exports[_0xbd8f('0x2f')]=function(_0x3d5026,_0x34eec5,_0x40fc53){var _0x3fdecd={'agent':{},'channel':_0xbd8f('0x70')};if(_0x3d5026[_0xbd8f('0x57')]['id']){delete _0x3d5026[_0xbd8f('0x57')]['id'];}_0x3d5026['body'][_0xbd8f('0x5f')]=_0x3d5026[_0xbd8f('0x57')][_0xbd8f('0x5f')]||_0x3d5026[_0xbd8f('0x60')]['id'];_0x3fdecd[_0xbd8f('0x71')]['id']=_0x3d5026[_0xbd8f('0x57')]['UserId'];return db['SmsMessage'][_0xbd8f('0x55')]({'where':{'id':_0x3d5026[_0xbd8f('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x34eec5,null))[_0xbd8f('0x1d')](function(_0x4c2a24){if(_0x4c2a24){_0x3fdecd[_0xbd8f('0x25')]=_0x4c2a24[_0xbd8f('0x63')]({'plain':!![]});return db[_0xbd8f('0x64')][_0xbd8f('0x55')]({'where':{'id':_0x4c2a24['SmsInteractionId']}});}return null;})[_0xbd8f('0x1d')](handleEntityNotFound(_0x34eec5,null))[_0xbd8f('0x1d')](function(_0x84e98d){if(_0x84e98d){_0x3fdecd['interaction']=_0x84e98d[_0xbd8f('0x63')]({'plain':!![]});interaction_log[_0xbd8f('0x26')](_0xbd8f('0x72'),_0x3d5026[_0xbd8f('0x60')]['id'],_0x3d5026['user'][_0xbd8f('0x33')],_0x3d5026[_0xbd8f('0x60')][_0xbd8f('0x68')],_0x3fdecd[_0xbd8f('0x66')]['id'],_0x3d5026[_0xbd8f('0x57')]?JSON[_0xbd8f('0x22')](_0x3d5026[_0xbd8f('0x57')]):_0xbd8f('0x73'));return respondWithRpcPromise('RejectMessage',_0xbd8f('0x74'),_0x3fdecd);}return null;})['then'](function(_0x3da31b){if(_0x3da31b){_0x3da31b['message'][_0xbd8f('0x6b')]=util[_0xbd8f('0x5d')]('SIP/%s',_0x3d5026[_0xbd8f('0x60')][_0xbd8f('0x33')]);_0x3da31b[_0xbd8f('0x25')][_0xbd8f('0x6c')]=_0x3fdecd['channel'];_0x3da31b[_0xbd8f('0x25')][_0xbd8f('0x75')]=_0xbd8f('0x2f');respondWithRpcPromise(_0xbd8f('0x6d'),'EventManager',{'event':'rejectmessage','message':_0x3da31b[_0xbd8f('0x25')]},client9002);return _0x3fdecd;}return null;})[_0xbd8f('0x1d')](respondWithResult(_0x34eec5,null))[_0xbd8f('0x28')](handleError(_0x34eec5,null));};exports[_0xbd8f('0x29')]=function(_0x24a567,_0x53076d,_0xe5c73f){if(_0x24a567[_0xbd8f('0x57')]['id']){delete _0x24a567[_0xbd8f('0x57')]['id'];}var _0x11a05a;return db[_0xbd8f('0x36')]['find']({'where':{'id':_0x24a567['params']['id']}})['then'](handleEntityNotFound(_0x53076d,null))[_0xbd8f('0x1d')](function(_0x5df0e1){if(_0x5df0e1){_0x11a05a=_0x5df0e1;return db['SmsAccount']['find']({'where':{'id':_0x5df0e1[_0xbd8f('0x76')]}});}})[_0xbd8f('0x1d')](handleEntityNotFound(_0x53076d,null))[_0xbd8f('0x1d')](function(_0x258fe3){if(_0x258fe3){logger[_0xbd8f('0x1f')](_0xbd8f('0x20'),_0xbd8f('0x29'),_0xbd8f('0x77'),_0x258fe3['type'],util[_0xbd8f('0x78')](_0x24a567[_0xbd8f('0x57')],{'showHidden':![],'depth':null}));switch(_0x258fe3[_0xbd8f('0x47')]){case'twilio':if(_0x24a567[_0xbd8f('0x57')][_0xbd8f('0x79')]&&_0x24a567[_0xbd8f('0x57')][_0xbd8f('0x79')]===_0x11a05a[_0xbd8f('0x7a')]){return _0x11a05a[_0xbd8f('0x7b')]({'read':!![]});}else{logger[_0xbd8f('0x23')](_0xbd8f('0x7c'),_0xbd8f('0x29'),_0xbd8f('0x7d'),util['inspect'](_0x24a567[_0xbd8f('0x57')],{'showHidden':![],'depth':null}));}break;case _0xbd8f('0x7e'):if(_0x24a567[_0xbd8f('0x57')]['MessageUUID']&&_0x24a567[_0xbd8f('0x57')]['MessageUUID']===_0x11a05a[_0xbd8f('0x7a')]&&_[_0xbd8f('0x7f')]([_0xbd8f('0x80'),_0xbd8f('0x81')],_0x24a567[_0xbd8f('0x57')]['Status'])>=0x0){return _0x11a05a[_0xbd8f('0x7b')]({'read':!![]});}else{logger[_0xbd8f('0x23')](_0xbd8f('0x7c'),_0xbd8f('0x29'),_0xbd8f('0x82'),util[_0xbd8f('0x78')](_0x24a567['body'],{'showHidden':![],'depth':null}));}break;case _0xbd8f('0x83'):var _0x314308=_0x24a567['body']['results'][0x0];if(_0x314308[_0xbd8f('0x29')]['groupName']==='DELIVERED'){return _0x11a05a['update']({'read':!![]});}else{logger[_0xbd8f('0x23')](_0xbd8f('0x7c'),_0xbd8f('0x29'),_0xbd8f('0x83'),util['inspect'](_0x24a567[_0xbd8f('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x11a05a;}})[_0xbd8f('0x1d')](respondWithResult(_0x53076d,null))['catch'](handleError(_0x53076d,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index b0eb82e..4d4593d 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 _0x6d80=['SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6d80,0x9e));var _0x06d8=function(_0x1e9ec3,_0x36453f){_0x1e9ec3=_0x1e9ec3-0x0;var _0x5c8bce=_0x6d80[_0x1e9ec3];return _0x5c8bce;};'use strict';var EventEmitter=require(_0x06d8('0x0'));var SmsMessage=require(_0x06d8('0x1'))['db'][_0x06d8('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x06d8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x06d8('0x4'),'afterDestroy':_0x06d8('0x5')};function emitEvent(_0x381808){return function(_0x5c87ea,_0x392a5f,_0x4a797e){SmsMessageEvents[_0x06d8('0x6')](_0x381808+':'+_0x5c87ea['id'],_0x5c87ea);SmsMessageEvents[_0x06d8('0x6')](_0x381808,_0x5c87ea);_0x4a797e(null);};}for(var e in events){if(events[_0x06d8('0x7')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0xb56d=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0xb56d,0x14b));var _0xdb56=function(_0x30ff26,_0x2171ff){_0x30ff26=_0x30ff26-0x0;var _0x4ee1e1=_0xb56d[_0x30ff26];return _0x4ee1e1;};'use strict';var EventEmitter=require(_0xdb56('0x0'));var SmsMessage=require(_0xdb56('0x1'))['db'][_0xdb56('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdb56('0x3')](0x0);var events={'afterCreate':_0xdb56('0x4'),'afterUpdate':_0xdb56('0x5'),'afterDestroy':_0xdb56('0x6')};function emitEvent(_0x9c0474){return function(_0x296c1b,_0x170ade,_0x1fd92b){SmsMessageEvents['emit'](_0x9c0474+':'+_0x296c1b['id'],_0x296c1b);SmsMessageEvents[_0xdb56('0x7')](_0x9c0474,_0x296c1b);_0x1fd92b(null);};}for(var e in events){if(events[_0xdb56('0x8')](e)){var event=events[e];SmsMessage[_0xdb56('0x9')](e,emitEvent(event));}}module[_0xdb56('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 08e2aef..8ad9587 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 _0x61ef=['crypto','apiKey','login','sender','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','define','SmsMessage','sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteraction','then','update','createdAt','catch','error','SmsAccount','type','accountSid','phone','authToken','messages','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms','POST','user_key','session_key','deliveryReport','read','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','remote','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/sms/2/text/advanced','IBSSO\x20','messageId','infobip','Missing\x20parameters:\x20base_url','csc'];(function(_0x43e392,_0x52b558){var _0x2f64bc=function(_0x4f89e7){while(--_0x4f89e7){_0x43e392['push'](_0x43e392['shift']());}};_0x2f64bc(++_0x52b558);}(_0x61ef,0x10d));var _0xf61e=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x61ef[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0xf61e('0x0'));var util=require(_0xf61e('0x1'));var logger=require(_0xf61e('0x2'))(_0xf61e('0x3'));var moment=require(_0xf61e('0x4'));var BPromise=require('bluebird');var rp=require(_0xf61e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf61e('0x6'));var attributes=require('./smsMessage.attributes');module[_0xf61e('0x7')]=function(_0x53c8f2,_0x469783){return _0x53c8f2[_0xf61e('0x8')](_0xf61e('0x9'),attributes,{'tableName':_0xf61e('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_sms_messages','fields':[_0xf61e('0xb')],'type':_0xf61e('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40717f,_0x3a942b,_0x5d8801){var _0x56c30e=_0x53c8f2[_0xf61e('0xd')];var _0x2e6529=_0x40717f[_0xf61e('0xe')]({'plain':!![]});if(_0x2e6529['direction'][_0xf61e('0xf')]()==='in'||_0x2e6529[_0xf61e('0x10')]['toLowerCase']()===_0xf61e('0x11')&&!_0x2e6529[_0xf61e('0x12')]&&!_[_0xf61e('0x13')](_0x2e6529[_0xf61e('0x14')])){_0x56c30e[_0xf61e('0x15')]['findOne']({'where':{'id':_0x2e6529['SmsInteractionId']}})[_0xf61e('0x16')](function(_0x52ab46){if(_0x52ab46){_0x52ab46[_0xf61e('0x17')]({'lastMsgAt':_0x2e6529[_0xf61e('0x18')],'lastMsgDirection':_0x2e6529[_0xf61e('0x10')][_0xf61e('0xf')]()});}})[_0xf61e('0x19')](function(_0x376876){console[_0xf61e('0x1a')](_0x376876);});}if(_0x2e6529[_0xf61e('0x10')]===_0xf61e('0x11')&&!_0x2e6529[_0xf61e('0x12')]){var _0x397043;_0x56c30e[_0xf61e('0x1b')]['find']({'where':{'id':_0x2e6529['SmsAccountId']},'raw':!![]})[_0xf61e('0x16')](function(_0x5b3b56){_0x397043=_0x5b3b56;if(_0x397043&&_0x397043[_0xf61e('0x1c')]){switch(_0x397043[_0xf61e('0x1c')]){case'twilio':var _0x280a1a=require('twilio');if(_0x397043[_0xf61e('0x1d')]&&_0x397043['authToken']&&_0x397043[_0xf61e('0x1e')]){var _0xb9a396=new _0x280a1a(_0x397043[_0xf61e('0x1d')],_0x397043[_0xf61e('0x1f')]);_0xb9a396[_0xf61e('0x20')]['create']({'body':_0x2e6529[_0xf61e('0xb')],'to':_0x2e6529[_0xf61e('0x1e')],'from':_0x397043[_0xf61e('0x1e')],'statusCallback':_0x397043['remote']+_0xf61e('0x21')+_0x2e6529['id']+_0xf61e('0x22')+_0x397043[_0xf61e('0x23')]})[_0xf61e('0x16')](function(_0x5adb37){if(_0x5adb37[_0xf61e('0x24')]){return _0x40717f[_0xf61e('0x17')]({'messageId':_0x5adb37[_0xf61e('0x24')]});}})['catch'](function(_0x1253db){logger[_0xf61e('0x1a')](_0xf61e('0x25'),'afterCreate',_0xf61e('0x26'),util[_0xf61e('0x27')](_0x1253db,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x26'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf61e('0x29'):var _0x396d3a=_0xf61e('0x2a');if(_0x397043[_0xf61e('0x2b')]&&_0x397043[_0xf61e('0x2c')]){var _0x482b78={'recipient':[_0x2e6529['phone']],'message':_0x2e6529[_0xf61e('0xb')],'message_type':_0x397043[_0xf61e('0x2d')]};var _0x3b5859={'url':_0x396d3a+_0xf61e('0x2e')+_0x397043[_0xf61e('0x2b')]+_0xf61e('0x2f')+_0x397043[_0xf61e('0x2c')],'method':_0xf61e('0x30')};rp(_0x3b5859)[_0xf61e('0x16')](function(_0x3ddcc8){var _0x43036f=_0x3ddcc8[_0xf61e('0x31')](';');var _0x52f36b={'user_key':_0x43036f[0x0],'session_key':_0x43036f[0x1]};_0x3b5859={'url':_0x396d3a+_0xf61e('0x32'),'method':_0xf61e('0x33'),'headers':{'user_key':_0x52f36b[_0xf61e('0x34')],'Session_key':_0x52f36b[_0xf61e('0x35')]},'json':!![],'body':_0x482b78};return rp(_0x3b5859);})['then'](function(_0x19999a){if(_0x19999a['total_sent']>=0x1){var _0x48fc69={'messageId':_0x19999a['internal_order_id']};if(_0x397043[_0xf61e('0x2d')]!=='GP'||!_0x397043[_0xf61e('0x36')]){_0x48fc69[_0xf61e('0x37')]=!![];}return _0x40717f[_0xf61e('0x17')](_0x48fc69);}else{return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),'skebby',util['inspect'](_0x19999a,{'showHidden':![],'depth':null}));}})[_0xf61e('0x19')](function(_0x2da1cd){return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),'skebby',util[_0xf61e('0x27')](_0x2da1cd,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf61e('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf61e('0x38'):if(_0x397043['authToken']){var _0x34de5f={'recipient':_0x2e6529[_0xf61e('0x1e')],'message':_0x2e6529['body'],'sender':_0x397043[_0xf61e('0x39')]||_0x397043[_0xf61e('0x1e')],'authorization':_0x397043[_0xf61e('0x1f')]};var _0x3a942b={'method':_0xf61e('0x33'),'uri':_0xf61e('0x3a'),'body':_0x34de5f,'json':!![]};rp(_0x3a942b)[_0xf61e('0x16')](function(_0x18822e){var _0x1391f6={'messageId':_0x18822e[_0xf61e('0x3b')]};if(!_0x397043[_0xf61e('0x36')]){_0x1391f6['read']=!![];}return _0x40717f[_0xf61e('0x17')](_0x1391f6);})[_0xf61e('0x19')](function(_0xd39c89){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x38'),util[_0xf61e('0x27')](_0xd39c89,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x38'),_0xf61e('0x3c'));}break;case _0xf61e('0x3d'):if(_0x397043[_0xf61e('0x2b')]&&_0x397043[_0xf61e('0x2c')]){var _0x34de5f={'messages':[{'source':_0xf61e('0x3e'),'to':_0x2e6529[_0xf61e('0x1e')],'body':_0x2e6529[_0xf61e('0xb')],'from':_0x397043[_0xf61e('0x39')]||_0x397043[_0xf61e('0x1e')]}]};var _0x3a115a=util[_0xf61e('0x3f')]('%s:%s',_0x397043[_0xf61e('0x2b')],_0x397043[_0xf61e('0x2c')]);var _0x3a942b={'method':_0xf61e('0x33'),'uri':_0xf61e('0x40'),'body':_0x34de5f,'headers':{'Authorization':util[_0xf61e('0x3f')](_0xf61e('0x41'),new Buffer(_0x3a115a)[_0xf61e('0x42')](_0xf61e('0x43')))},'json':!![]};rp(_0x3a942b)[_0xf61e('0x16')](function(_0x3d7ff8){if(_0x3d7ff8[_0xf61e('0x44')]>=0xc8&&_0x3d7ff8[_0xf61e('0x44')]<=0xce){if(_0x3d7ff8[_0xf61e('0x45')]&&_0x3d7ff8[_0xf61e('0x45')][_0xf61e('0x46')]>0x0){var _0x48c4f9=_[_0xf61e('0x47')](_0x3d7ff8[_0xf61e('0x45')][_0xf61e('0x20')]);var _0x1ab032={'messageId':_0x48c4f9[_0xf61e('0x48')]};if(!_0x397043['deliveryReport']){_0x1ab032[_0xf61e('0x37')]=!![];}return _0x40717f[_0xf61e('0x17')](_0x1ab032);}else{logger[_0xf61e('0x1a')](_0xf61e('0x25'),'afterCreate',_0xf61e('0x49'),util[_0xf61e('0x27')](_0x3d7ff8,{'showHidden':![],'depth':null}));}}else{logger[_0xf61e('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x49'),util[_0xf61e('0x27')](_0x3d7ff8,{'showHidden':![],'depth':null}));}})[_0xf61e('0x19')](function(_0x28a3be){logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),'clickSend',util['inspect'](_0x28a3be,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x49'),_0xf61e('0x4a'));}break;case _0xf61e('0x4b'):if(_0x397043[_0xf61e('0x4c')]&&_0x397043['authToken']){var _0x34de5f={'dst':_0x2e6529['phone'],'text':_0x2e6529[_0xf61e('0xb')],'src':_0x397043[_0xf61e('0x39')]||_0x397043[_0xf61e('0x1e')],'url':_0x397043[_0xf61e('0x4d')]+_0xf61e('0x21')+_0x2e6529['id']+_0xf61e('0x22')+_0x397043['token']};var _0x3a115a=util[_0xf61e('0x3f')](_0xf61e('0x4e'),_0x397043[_0xf61e('0x4c')],_0x397043[_0xf61e('0x1f')]);var _0x3a942b={'method':_0xf61e('0x33'),'uri':util[_0xf61e('0x3f')](_0xf61e('0x4f'),_0x397043[_0xf61e('0x4c')]),'body':_0x34de5f,'headers':{'Authorization':util[_0xf61e('0x3f')](_0xf61e('0x41'),new Buffer(_0x3a115a)[_0xf61e('0x42')](_0xf61e('0x43')))},'json':!![]};rp(_0x3a942b)['then'](function(_0xf9c7f1){var _0x149f1f={'messageId':_0xf9c7f1['message_uuid'][0x0]};return _0x40717f[_0xf61e('0x17')](_0x149f1f);})[_0xf61e('0x19')](function(_0x5b1bb7){logger['error'](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x4b'),util[_0xf61e('0x27')](_0x5b1bb7,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x4b'),_0xf61e('0x50'));}break;case'infobip':if(_0x397043['username']&&_0x397043[_0xf61e('0x2c')]){if(_0x397043[_0xf61e('0x51')]){var _0x3fa47c={'method':_0xf61e('0x33'),'uri':_0x397043[_0xf61e('0x51')]+'/auth/1/session','body':{'username':_0x397043[_0xf61e('0x2b')],'password':_0x397043[_0xf61e('0x2c')]},'json':!![]};return rp(_0x3fa47c)[_0xf61e('0x16')](function(_0x108fdd){var _0x324526={'method':_0xf61e('0x33'),'uri':_0x397043[_0xf61e('0x51')]+_0xf61e('0x52'),'body':{'messages':[{'from':_0x397043['phone'],'destinations':[{'to':_0x2e6529[_0xf61e('0x1e')]}],'text':_0x2e6529[_0xf61e('0xb')],'notifyUrl':_0x397043[_0xf61e('0x4d')]+_0xf61e('0x21')+_0x2e6529['id']+_0xf61e('0x22')+_0x397043[_0xf61e('0x23')],'notifyContentType':'application/json','callbackData':_0x397043['phone']+';'+_0x2e6529[_0xf61e('0xb')]}]},'headers':{'Authorization':_0xf61e('0x53')+_0x108fdd[_0xf61e('0x23')]},'json':!![]};return rp(_0x324526)[_0xf61e('0x16')](function(_0xd0d0d8){if(_0xd0d0d8[_0xf61e('0x20')]){var _0x1c81ce={'messageId':_0xd0d0d8[_0xf61e('0x20')][0x0][_0xf61e('0x54')]};if(!_0x397043['deliveryReport']){_0x1c81ce['read']=!![];}return _0x40717f['update'](_0x1c81ce);}else{return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x55'),util['inspect'](_0xd0d0d8,{'showHidden':![],'depth':null}));}});})[_0xf61e('0x19')](function(_0xc96f7f){return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),'infobip',util[_0xf61e('0x27')](_0xc96f7f,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),'infobip',_0xf61e('0x56'));}}else{logger[_0xf61e('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf61e('0x28'),_0xf61e('0x55'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xf61e('0x57'):var _0x25e697=require(_0xf61e('0x58'));if(_0x397043[_0xf61e('0x59')]){var _0xd9ae32={};_0xd9ae32[_0xf61e('0x5a')]=_0x397043[_0xf61e('0x2b')];_0xd9ae32['phone']=_0x2e6529[_0xf61e('0x1e')];_0xd9ae32[_0xf61e('0x5b')]=_0x397043[_0xf61e('0x1e')];_0xd9ae32[_0xf61e('0x5c')]=_0x2e6529[_0xf61e('0xb')];_0xd9ae32[_0xf61e('0x5d')]=+new Date();var _0x163a05='';var _0x3cb854='';var _0x7c251d=Object[_0xf61e('0x5e')](_0xd9ae32);_0x7c251d[_0xf61e('0x5f')]();for(var _0x52cc55=0x0;_0x52cc55<_0x7c251d[_0xf61e('0x60')];_0x52cc55++){if(_0x163a05!=''){_0x163a05+='&';}_0x163a05+=_0x7c251d[_0x52cc55]+'='+encodeURIComponent(_0xd9ae32[_0x7c251d[_0x52cc55]]);_0x3cb854+=_0xd9ae32[_0x7c251d[_0x52cc55]];}_0x3cb854+=_0x397043[_0xf61e('0x59')];_0x3cb854=_0x25e697[_0xf61e('0x61')](_0xf61e('0x62'))[_0xf61e('0x17')](_0x3cb854)[_0xf61e('0x63')](_0xf61e('0x64'));if(_0x163a05!==''){_0x163a05+='&';}_0x163a05+=_0xf61e('0x65')+_0x3cb854;var _0x3b5859={'method':_0xf61e('0x30'),'uri':_0xf61e('0x66')+_0x163a05,'json':!![]};return rp(_0x3b5859)[_0xf61e('0x16')](function(_0x5c2175){var _0x38cc63=Object['keys'](_0x5c2175);if(_0x5c2175[_0x38cc63[0x0]][_0xf61e('0x1a')]&&parseInt(_0x5c2175[_0x38cc63[0x0]][_0xf61e('0x1a')])===0x0){var _0x2650a2={'messageId':_0x5c2175[_0x38cc63[0x0]]['id_sms']};if(!_0x397043[_0xf61e('0x36')]){_0x2650a2[_0xf61e('0x37')]=!![];}return _0x40717f['update'](_0x2650a2);}else{return logger[_0xf61e('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','csc',util[_0xf61e('0x27')](_0x5c2175[_0xf61e('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x11edbf){return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x57'),util['inspect'](_0x11edbf,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x57'),_0xf61e('0x67'));}break;case _0xf61e('0x68'):if(_0x397043[_0xf61e('0x59')]){var _0x48f6ca={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x397043['apiKey']},'body':{'content':_0x2e6529[_0xf61e('0xb')],'to':[_0x2e6529['phone']],'from':_0x397043[_0xf61e('0x1e')],'binary':![],'clientMessageId':_0xf61e('0x69'),'charset':'UTF-8'},'json':!![]};rp(_0x48f6ca)[_0xf61e('0x16')](function(_0x5c55cf){if(!_0x5c55cf[_0xf61e('0x1a')]){var _0x50691b={'messageId':_0x5c55cf[_0xf61e('0x20')][0x0][_0xf61e('0x6a')]};if(!_0x397043['deliveryReport']){_0x50691b[_0xf61e('0x37')]=!![];}return _0x40717f[_0xf61e('0x17')](_0x50691b);}else{return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x68'),util[_0xf61e('0x27')](_0x5c55cf[_0xf61e('0x1a')],{'showHidden':![],'depth':null}));}})[_0xf61e('0x19')](function(_0x43b33a){return logger['error'](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x68'),util[_0xf61e('0x27')](_0x43b33a,{'showHidden':![],'depth':null}));});}else{logger[_0xf61e('0x1a')](_0xf61e('0x25'),'afterCreate',_0xf61e('0x68'),_0xf61e('0x67'));}break;case _0xf61e('0x6b'):if(_0x397043['apiKey']){var _0x311ad7={};var _0x3b5859={'method':_0xf61e('0x33'),'uri':_0xf61e('0x6c'),'headers':{'Authorization':'Bearer\x20'+_0x397043[_0xf61e('0x59')],'Content-Type':_0xf61e('0x6d')},'body':{'from':_0x397043[_0xf61e('0x1e')],'to':_0x2e6529['phone'],'text':_0x2e6529[_0xf61e('0xb')]},'json':!![]};return rp(_0x3b5859)[_0xf61e('0x16')](function(_0xbf110a){if(_0xbf110a[_0xf61e('0x6e')]==0xca){_0x311ad7[_0xf61e('0x6f')]=_0xbf110a;var _0x178a74={'method':_0xf61e('0x33'),'uri':_0xf61e('0x70'),'headers':{'Authorization':_0xf61e('0x71')+_0x397043[_0xf61e('0x59')],'Content-Type':_0xf61e('0x6d')},'body':{'refid':_0x311ad7[_0xf61e('0x6f')]['refid']},'json':!![]};return rp(_0x178a74)[_0xf61e('0x16')](function(_0x4bf37a){_0x311ad7['status']=_0x4bf37a;var _0x166cc1={'messageId':_0x311ad7[_0xf61e('0x6f')][_0xf61e('0x72')],'read':!![]};return _0x40717f[_0xf61e('0x17')](_0x166cc1);});}else{return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),'intelepeer',util[_0xf61e('0x27')](_0xbf110a,{'showHidden':![],'depth':null}));}})[_0xf61e('0x19')](function(_0x147ffd){return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x6b'),util[_0xf61e('0x27')](_0x147ffd,{'showHidden':![],'depth':null}));});}else{return logger[_0xf61e('0x1a')](_0xf61e('0x25'),_0xf61e('0x28'),_0xf61e('0x6b'),_0xf61e('0x73'));}break;}}})[_0xf61e('0x74')](function(){_0x5d8801();});}else{_0x5d8801();}}},'charset':_0xf61e('0x75'),'collate':_0xf61e('0x76')});}; \ No newline at end of file +var _0x67c1=['isNil','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','split','POST','internal_order_id','deliveryReport','read','inspect','skebby','Missing\x20parameters:\x20username,\x20password','connectel','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','data','queued_count','clickSend','plivo','authId','remote','toString','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','sort','length','md5','hex','signature=','https://sms.csc.lv/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','UTF-8','apiMessageId','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','message','refid','intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','SmsMessage','messageId','body','models','get','direction','toLowerCase','out','secret'];(function(_0x50e669,_0x2ad6ea){var _0x33ad4b=function(_0x52af46){while(--_0x52af46){_0x50e669['push'](_0x50e669['shift']());}};_0x33ad4b(++_0x2ad6ea);}(_0x67c1,0xc6));var _0x167c=function(_0x659c6b,_0x4e04ae){_0x659c6b=_0x659c6b-0x0;var _0x441348=_0x67c1[_0x659c6b];return _0x441348;};'use strict';var _=require(_0x167c('0x0'));var util=require(_0x167c('0x1'));var logger=require(_0x167c('0x2'))(_0x167c('0x3'));var moment=require(_0x167c('0x4'));var BPromise=require('bluebird');var rp=require(_0x167c('0x5'));var fs=require('fs');var path=require(_0x167c('0x6'));var rimraf=require(_0x167c('0x7'));var config=require(_0x167c('0x8'));var attributes=require('./smsMessage.attributes');module['exports']=function(_0x226bb4,_0x48603c){return _0x226bb4['define'](_0x167c('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x167c('0xa'),'fields':[_0x167c('0xa')]},{'name':'fti_sms_messages','fields':[_0x167c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56cd4a,_0x9116ee,_0x1d128d){var _0x446d95=_0x226bb4[_0x167c('0xc')];var _0x51575d=_0x56cd4a[_0x167c('0xd')]({'plain':!![]});if(_0x51575d[_0x167c('0xe')][_0x167c('0xf')]()==='in'||_0x51575d[_0x167c('0xe')][_0x167c('0xf')]()===_0x167c('0x10')&&!_0x51575d[_0x167c('0x11')]&&!_[_0x167c('0x12')](_0x51575d['UserId'])){_0x446d95[_0x167c('0x13')][_0x167c('0x14')]({'where':{'id':_0x51575d['SmsInteractionId']}})[_0x167c('0x15')](function(_0x3b34bf){if(_0x3b34bf){_0x3b34bf[_0x167c('0x16')]({'lastMsgAt':_0x51575d[_0x167c('0x17')],'lastMsgDirection':_0x51575d[_0x167c('0xe')][_0x167c('0xf')]()});}})[_0x167c('0x18')](function(_0x5cd727){console[_0x167c('0x19')](_0x5cd727);});}if(_0x51575d[_0x167c('0xe')]===_0x167c('0x10')&&!_0x51575d[_0x167c('0x11')]){var _0xe4a51f;_0x446d95[_0x167c('0x1a')]['find']({'where':{'id':_0x51575d[_0x167c('0x1b')]},'raw':!![]})['then'](function(_0x5ea03a){_0xe4a51f=_0x5ea03a;if(_0xe4a51f&&_0xe4a51f[_0x167c('0x1c')]){switch(_0xe4a51f['type']){case _0x167c('0x1d'):var _0x1047ea=require(_0x167c('0x1d'));if(_0xe4a51f['accountSid']&&_0xe4a51f[_0x167c('0x1e')]&&_0xe4a51f[_0x167c('0x1f')]){var _0x5c69e4=new _0x1047ea(_0xe4a51f[_0x167c('0x20')],_0xe4a51f[_0x167c('0x1e')]);_0x5c69e4[_0x167c('0x21')][_0x167c('0x22')]({'body':_0x51575d[_0x167c('0xb')],'to':_0x51575d['phone'],'from':_0xe4a51f[_0x167c('0x1f')],'statusCallback':_0xe4a51f['remote']+_0x167c('0x23')+_0x51575d['id']+_0x167c('0x24')+_0xe4a51f[_0x167c('0x25')]})[_0x167c('0x15')](function(_0x15d6ea){if(_0x15d6ea[_0x167c('0x26')]){return _0x56cd4a[_0x167c('0x16')]({'messageId':_0x15d6ea[_0x167c('0x26')]});}})[_0x167c('0x18')](function(_0x160464){logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x1d'),util['inspect'](_0x160464,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'twilio',_0x167c('0x29'));}break;case'skebby':var _0x7f4d65=_0x167c('0x2a');if(_0xe4a51f[_0x167c('0x2b')]&&_0xe4a51f[_0x167c('0x2c')]){var _0x4d63f4={'recipient':[_0x51575d[_0x167c('0x1f')]],'message':_0x51575d[_0x167c('0xb')],'message_type':_0xe4a51f[_0x167c('0x2d')]};var _0x25133e={'url':_0x7f4d65+_0x167c('0x2e')+_0xe4a51f[_0x167c('0x2b')]+_0x167c('0x2f')+_0xe4a51f[_0x167c('0x2c')],'method':'GET'};rp(_0x25133e)[_0x167c('0x15')](function(_0x1a660b){var _0x51d090=_0x1a660b[_0x167c('0x30')](';');var _0x2e8cbd={'user_key':_0x51d090[0x0],'session_key':_0x51d090[0x1]};_0x25133e={'url':_0x7f4d65+'sms','method':_0x167c('0x31'),'headers':{'user_key':_0x2e8cbd['user_key'],'Session_key':_0x2e8cbd['session_key']},'json':!![],'body':_0x4d63f4};return rp(_0x25133e);})[_0x167c('0x15')](function(_0x2df058){if(_0x2df058['total_sent']>=0x1){var _0x4a7193={'messageId':_0x2df058[_0x167c('0x32')]};if(_0xe4a51f[_0x167c('0x2d')]!=='GP'||!_0xe4a51f[_0x167c('0x33')]){_0x4a7193[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x4a7193);}else{return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'skebby',util[_0x167c('0x35')](_0x2df058,{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x288b52){return logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x36'),util['inspect'](_0x288b52,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x36'),_0x167c('0x37'));}break;case _0x167c('0x38'):if(_0xe4a51f[_0x167c('0x1e')]){var _0x3cd8a1={'recipient':_0x51575d[_0x167c('0x1f')],'message':_0x51575d[_0x167c('0xb')],'sender':_0xe4a51f['senderString']||_0xe4a51f[_0x167c('0x1f')],'authorization':_0xe4a51f['authToken']};var _0x9116ee={'method':_0x167c('0x31'),'uri':'https://smsapi.connectel.se/api/send/','body':_0x3cd8a1,'json':!![]};rp(_0x9116ee)[_0x167c('0x15')](function(_0x4a167a){var _0x4a4545={'messageId':_0x4a167a[_0x167c('0x39')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x4a4545['read']=!![];}return _0x56cd4a[_0x167c('0x16')](_0x4a4545);})[_0x167c('0x18')](function(_0xb0c55c){logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x38'),util['inspect'](_0xb0c55c,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x38'),_0x167c('0x3a'));}break;case'clicksend':if(_0xe4a51f[_0x167c('0x2b')]&&_0xe4a51f[_0x167c('0x2c')]){var _0x3cd8a1={'messages':[{'source':_0x167c('0x3b'),'to':_0x51575d['phone'],'body':_0x51575d[_0x167c('0xb')],'from':_0xe4a51f[_0x167c('0x3c')]||_0xe4a51f[_0x167c('0x1f')]}]};var _0x6a2160=util['format']('%s:%s',_0xe4a51f[_0x167c('0x2b')],_0xe4a51f[_0x167c('0x2c')]);var _0x9116ee={'method':_0x167c('0x31'),'uri':_0x167c('0x3d'),'body':_0x3cd8a1,'headers':{'Authorization':util[_0x167c('0x3e')](_0x167c('0x3f'),new Buffer(_0x6a2160)['toString'](_0x167c('0x40')))},'json':!![]};rp(_0x9116ee)['then'](function(_0x236c3e){if(_0x236c3e['http_code']>=0xc8&&_0x236c3e[_0x167c('0x41')]<=0xce){if(_0x236c3e[_0x167c('0x42')]&&_0x236c3e[_0x167c('0x42')][_0x167c('0x43')]>0x0){var _0xc29080=_['head'](_0x236c3e['data'][_0x167c('0x21')]);var _0x27c60f={'messageId':_0xc29080['message_id']};if(!_0xe4a51f[_0x167c('0x33')]){_0x27c60f['read']=!![];}return _0x56cd4a[_0x167c('0x16')](_0x27c60f);}else{logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),'clickSend',util[_0x167c('0x35')](_0x236c3e,{'showHidden':![],'depth':null}));}}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x44'),util[_0x167c('0x35')](_0x236c3e,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4aae4e){logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x44'),util[_0x167c('0x35')](_0x4aae4e,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x44'),_0x167c('0x37'));}break;case _0x167c('0x45'):if(_0xe4a51f[_0x167c('0x46')]&&_0xe4a51f[_0x167c('0x1e')]){var _0x3cd8a1={'dst':_0x51575d[_0x167c('0x1f')],'text':_0x51575d[_0x167c('0xb')],'src':_0xe4a51f[_0x167c('0x3c')]||_0xe4a51f[_0x167c('0x1f')],'url':_0xe4a51f[_0x167c('0x47')]+_0x167c('0x23')+_0x51575d['id']+_0x167c('0x24')+_0xe4a51f[_0x167c('0x25')]};var _0x6a2160=util[_0x167c('0x3e')]('%s:%s',_0xe4a51f['authId'],_0xe4a51f[_0x167c('0x1e')]);var _0x9116ee={'method':_0x167c('0x31'),'uri':util[_0x167c('0x3e')]('https://api.plivo.com/v1/Account/%s/Message/',_0xe4a51f[_0x167c('0x46')]),'body':_0x3cd8a1,'headers':{'Authorization':util[_0x167c('0x3e')](_0x167c('0x3f'),new Buffer(_0x6a2160)[_0x167c('0x48')](_0x167c('0x40')))},'json':!![]};rp(_0x9116ee)[_0x167c('0x15')](function(_0x433a90){var _0x230c8b={'messageId':_0x433a90['message_uuid'][0x0]};return _0x56cd4a[_0x167c('0x16')](_0x230c8b);})['catch'](function(_0x10999e){logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x45'),util['inspect'](_0x10999e,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x45'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x167c('0x49'):if(_0xe4a51f['username']&&_0xe4a51f[_0x167c('0x2c')]){if(_0xe4a51f[_0x167c('0x4a')]){var _0x4f6d16={'method':'POST','uri':_0xe4a51f[_0x167c('0x4a')]+'/auth/1/session','body':{'username':_0xe4a51f[_0x167c('0x2b')],'password':_0xe4a51f[_0x167c('0x2c')]},'json':!![]};return rp(_0x4f6d16)['then'](function(_0x5c74c7){var _0x335cb0={'method':'POST','uri':_0xe4a51f[_0x167c('0x4a')]+_0x167c('0x4b'),'body':{'messages':[{'from':_0xe4a51f['phone'],'destinations':[{'to':_0x51575d[_0x167c('0x1f')]}],'text':_0x51575d['body'],'notifyUrl':_0xe4a51f['remote']+_0x167c('0x23')+_0x51575d['id']+_0x167c('0x24')+_0xe4a51f[_0x167c('0x25')],'notifyContentType':_0x167c('0x4c'),'callbackData':_0xe4a51f['phone']+';'+_0x51575d['body']}]},'headers':{'Authorization':_0x167c('0x4d')+_0x5c74c7[_0x167c('0x25')]},'json':!![]};return rp(_0x335cb0)['then'](function(_0x47e04d){if(_0x47e04d[_0x167c('0x21')]){var _0x35da93={'messageId':_0x47e04d['messages'][0x0][_0x167c('0xa')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x35da93[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x35da93);}else{return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x49'),util['inspect'](_0x47e04d,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x5c9073){return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'infobip',util[_0x167c('0x35')](_0x5c9073,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x167c('0x27'),'afterCreate',_0x167c('0x49'),_0x167c('0x4e'));}}else{logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x49'),_0x167c('0x37'));}break;case _0x167c('0x4f'):var _0x16d4ad=require(_0x167c('0x50'));if(_0xe4a51f[_0x167c('0x51')]){var _0x5a6231={};_0x5a6231[_0x167c('0x52')]=_0xe4a51f[_0x167c('0x2b')];_0x5a6231[_0x167c('0x1f')]=_0x51575d[_0x167c('0x1f')];_0x5a6231['sender']=_0xe4a51f[_0x167c('0x1f')];_0x5a6231[_0x167c('0x53')]=_0x51575d[_0x167c('0xb')];_0x5a6231[_0x167c('0x54')]=+new Date();var _0x620be3='';var _0x29574b='';var _0x1e0a46=Object['keys'](_0x5a6231);_0x1e0a46[_0x167c('0x55')]();for(var _0xc18042=0x0;_0xc18042<_0x1e0a46[_0x167c('0x56')];_0xc18042++){if(_0x620be3!=''){_0x620be3+='&';}_0x620be3+=_0x1e0a46[_0xc18042]+'='+encodeURIComponent(_0x5a6231[_0x1e0a46[_0xc18042]]);_0x29574b+=_0x5a6231[_0x1e0a46[_0xc18042]];}_0x29574b+=_0xe4a51f[_0x167c('0x51')];_0x29574b=_0x16d4ad['createHash'](_0x167c('0x57'))[_0x167c('0x16')](_0x29574b)['digest'](_0x167c('0x58'));if(_0x620be3!==''){_0x620be3+='&';}_0x620be3+=_0x167c('0x59')+_0x29574b;var _0x25133e={'method':'GET','uri':_0x167c('0x5a')+_0x620be3,'json':!![]};return rp(_0x25133e)['then'](function(_0x35282b){var _0x2fc41a=Object[_0x167c('0x5b')](_0x35282b);if(_0x35282b[_0x2fc41a[0x0]][_0x167c('0x19')]&&parseInt(_0x35282b[_0x2fc41a[0x0]][_0x167c('0x19')])===0x0){var _0x292239={'messageId':_0x35282b[_0x2fc41a[0x0]][_0x167c('0x5c')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x292239[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x292239);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x4f'),util['inspect'](_0x35282b[_0x167c('0x19')],{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x57aaa6){return logger['error'](_0x167c('0x27'),'afterCreate',_0x167c('0x4f'),util[_0x167c('0x35')](_0x57aaa6,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),'csc',_0x167c('0x5d'));}break;case _0x167c('0x5e'):if(_0xe4a51f[_0x167c('0x51')]){var _0x4562f1={'method':_0x167c('0x31'),'uri':_0x167c('0x5f'),'headers':{'Authorization':_0xe4a51f[_0x167c('0x51')]},'body':{'content':_0x51575d['body'],'to':[_0x51575d[_0x167c('0x1f')]],'from':_0xe4a51f[_0x167c('0x1f')],'binary':![],'clientMessageId':'uuid','charset':_0x167c('0x60')},'json':!![]};rp(_0x4562f1)['then'](function(_0x2b35cb){if(!_0x2b35cb['error']){var _0x3f5596={'messageId':_0x2b35cb['messages'][0x0][_0x167c('0x61')]};if(!_0xe4a51f[_0x167c('0x33')]){_0x3f5596[_0x167c('0x34')]=!![];}return _0x56cd4a[_0x167c('0x16')](_0x3f5596);}else{return logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),_0x167c('0x5e'),util['inspect'](_0x2b35cb[_0x167c('0x19')],{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x614ccf){return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x5e'),util['inspect'](_0x614ccf,{'showHidden':![],'depth':null}));});}else{logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case'intelepeer':if(_0xe4a51f[_0x167c('0x51')]){var _0x2f7a8d={};var _0x25133e={'method':_0x167c('0x31'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x167c('0x62')+_0xe4a51f[_0x167c('0x51')],'Content-Type':'application/json'},'body':{'from':_0xe4a51f['phone'],'to':_0x51575d[_0x167c('0x1f')],'text':_0x51575d[_0x167c('0xb')]},'json':!![]};return rp(_0x25133e)[_0x167c('0x15')](function(_0x17669e){if(_0x17669e[_0x167c('0x63')]==0xca){_0x2f7a8d['message']=_0x17669e;var _0x155567={'method':_0x167c('0x31'),'uri':_0x167c('0x64'),'headers':{'Authorization':_0x167c('0x62')+_0xe4a51f['apiKey'],'Content-Type':_0x167c('0x4c')},'body':{'refid':_0x2f7a8d['message']['refid']},'json':!![]};return rp(_0x155567)['then'](function(_0x35a835){_0x2f7a8d[_0x167c('0x65')]=_0x35a835;var _0x52b8fe={'messageId':_0x2f7a8d[_0x167c('0x66')][_0x167c('0x67')],'read':!![]};return _0x56cd4a[_0x167c('0x16')](_0x52b8fe);});}else{return logger[_0x167c('0x19')](_0x167c('0x27'),'afterCreate',_0x167c('0x68'),util[_0x167c('0x35')](_0x17669e,{'showHidden':![],'depth':null}));}})[_0x167c('0x18')](function(_0x178d20){return logger[_0x167c('0x19')](_0x167c('0x27'),_0x167c('0x28'),_0x167c('0x68'),util['inspect'](_0x178d20,{'showHidden':![],'depth':null}));});}else{return logger[_0x167c('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x167c('0x28'),'intelepeer',_0x167c('0x69'));}break;}}})[_0x167c('0x6a')](function(){_0x1d128d();});}else{_0x1d128d();}}},'charset':'utf8mb4','collate':_0x167c('0x6b')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 225c9fb..74e77e2 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 _0x7a86=['bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','SmsMessage','body','options','raw','CreateSmsMessage','lodash','util','moment'];(function(_0x34c928,_0x2ffa83){var _0x2601bf=function(_0xb50550){while(--_0xb50550){_0x34c928['push'](_0x34c928['shift']());}};_0x2601bf(++_0x2ffa83);}(_0x7a86,0xb7));var _0x67a8=function(_0x51172b,_0x56cf7a){_0x51172b=_0x51172b-0x0;var _0xeaa052=_0x7a86[_0x51172b];return _0xeaa052;};'use strict';var _=require(_0x67a8('0x0'));var util=require(_0x67a8('0x1'));var moment=require(_0x67a8('0x2'));var BPromise=require(_0x67a8('0x3'));var rs=require(_0x67a8('0x4'));var fs=require('fs');var Redis=require(_0x67a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x67a8('0x6'))('rpc');var config=require(_0x67a8('0x7'));var jayson=require(_0x67a8('0x8'));var client=jayson[_0x67a8('0x9')][_0x67a8('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x67a8('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67a8('0xb')]));require(_0x67a8('0xc'))[_0x67a8('0xd')](socket);function respondWithRpcPromise(_0x1b7741,_0x1a1968,_0x1bbfb7){return new BPromise(function(_0x37a89e,_0x4825bb){return client[_0x67a8('0xe')](_0x1b7741,_0x1bbfb7)[_0x67a8('0xf')](function(_0x4a0ccb){logger[_0x67a8('0x10')](_0x67a8('0x11'),_0x1a1968,'request\x20sent');logger[_0x67a8('0x12')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1a1968,'request\x20sent',JSON[_0x67a8('0x13')](_0x4a0ccb));if(_0x4a0ccb[_0x67a8('0x14')]){if(_0x4a0ccb['error'][_0x67a8('0x15')]===0x1f4){logger[_0x67a8('0x14')]('SmsMessage,\x20%s,\x20%s',_0x1a1968,_0x4a0ccb[_0x67a8('0x14')][_0x67a8('0x16')]);return _0x4825bb(_0x4a0ccb[_0x67a8('0x14')][_0x67a8('0x16')]);}logger[_0x67a8('0x14')](_0x67a8('0x11'),_0x1a1968,_0x4a0ccb[_0x67a8('0x14')][_0x67a8('0x16')]);return _0x37a89e(_0x4a0ccb['error'][_0x67a8('0x16')]);}else{logger[_0x67a8('0x10')](_0x67a8('0x11'),_0x1a1968,_0x67a8('0x17'));_0x37a89e(_0x4a0ccb[_0x67a8('0x18')][_0x67a8('0x16')]);}})[_0x67a8('0x19')](function(_0x5b166c){logger[_0x67a8('0x14')](_0x67a8('0x11'),_0x1a1968,_0x5b166c);_0x4825bb(_0x5b166c);});});}exports['CreateSmsMessage']=function(_0x564308){var _0x517950=this;return new Promise(function(_0x82a2bd,_0x454501){return db[_0x67a8('0x1a')]['create'](_0x564308[_0x67a8('0x1b')],{'raw':_0x564308['options']?_0x564308[_0x67a8('0x1c')][_0x67a8('0x1d')]===undefined?!![]:![]:!![]})[_0x67a8('0xf')](function(_0x20778f){logger[_0x67a8('0x10')](_0x67a8('0x1e'),_0x564308);logger[_0x67a8('0x12')](_0x67a8('0x1e'),_0x564308,JSON[_0x67a8('0x13')](_0x20778f));_0x82a2bd(_0x20778f);})['catch'](function(_0x5b009b){logger[_0x67a8('0x14')](_0x67a8('0x1e'),_0x5b009b[_0x67a8('0x16')],_0x564308);_0x454501(_0x517950[_0x67a8('0x14')](0x1f4,_0x5b009b['message']));});});}; \ No newline at end of file +var _0xf441=['http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSmsMessage','SmsMessage','options','raw','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x53eebd,_0x4c0421){var _0x197d85=function(_0x1b5122){while(--_0x1b5122){_0x53eebd['push'](_0x53eebd['shift']());}};_0x197d85(++_0x4c0421);}(_0xf441,0x156));var _0x1f44=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xf441[_0x59162a];return _0x35e50d;};'use strict';var _=require(_0x1f44('0x0'));var util=require(_0x1f44('0x1'));var moment=require(_0x1f44('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1f44('0x3'));var db=require(_0x1f44('0x4'))['db'];var utils=require(_0x1f44('0x5'));var logger=require(_0x1f44('0x6'))(_0x1f44('0x7'));var config=require(_0x1f44('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1f44('0x9')][_0x1f44('0xa')]({'port':0x232a});config[_0x1f44('0xb')]=_[_0x1f44('0xc')](config[_0x1f44('0xb')],{'host':_0x1f44('0xd'),'port':0x18eb});var socket=require(_0x1f44('0xe'))(new Redis(config[_0x1f44('0xb')]));require(_0x1f44('0xf'))[_0x1f44('0x10')](socket);function respondWithRpcPromise(_0x179adb,_0x49de25,_0x5e5a17){return new BPromise(function(_0x1c95bb,_0x272104){return client[_0x1f44('0x11')](_0x179adb,_0x5e5a17)[_0x1f44('0x12')](function(_0x8920b7){logger[_0x1f44('0x13')](_0x1f44('0x14'),_0x49de25,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49de25,_0x1f44('0x15'),JSON[_0x1f44('0x16')](_0x8920b7));if(_0x8920b7[_0x1f44('0x17')]){if(_0x8920b7[_0x1f44('0x17')]['code']===0x1f4){logger[_0x1f44('0x17')](_0x1f44('0x14'),_0x49de25,_0x8920b7[_0x1f44('0x17')][_0x1f44('0x18')]);return _0x272104(_0x8920b7['error']['message']);}logger['error'](_0x1f44('0x14'),_0x49de25,_0x8920b7[_0x1f44('0x17')][_0x1f44('0x18')]);return _0x1c95bb(_0x8920b7[_0x1f44('0x17')][_0x1f44('0x18')]);}else{logger['info'](_0x1f44('0x14'),_0x49de25,'request\x20sent');_0x1c95bb(_0x8920b7[_0x1f44('0x19')]['message']);}})[_0x1f44('0x1a')](function(_0x17af0b){logger[_0x1f44('0x17')](_0x1f44('0x14'),_0x49de25,_0x17af0b);_0x272104(_0x17af0b);});});}exports[_0x1f44('0x1b')]=function(_0x47cf51){var _0x30789a=this;return new Promise(function(_0xc50809,_0xffd8b4){return db[_0x1f44('0x1c')]['create'](_0x47cf51['body'],{'raw':_0x47cf51[_0x1f44('0x1d')]?_0x47cf51['options'][_0x1f44('0x1e')]===undefined?!![]:![]:!![]})[_0x1f44('0x12')](function(_0x2d9247){logger['info'](_0x1f44('0x1b'),_0x47cf51);logger[_0x1f44('0x1f')](_0x1f44('0x1b'),_0x47cf51,JSON['stringify'](_0x2d9247));_0xc50809(_0x2d9247);})['catch'](function(_0x1f9f4b){logger[_0x1f44('0x17')]('CreateSmsMessage',_0x1f9f4b[_0x1f44('0x18')],_0x47cf51);_0xffd8b4(_0x30789a[_0x1f44('0x17')](0x1f4,_0x1f9f4b[_0x1f44('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index e8932c9..e099a5a 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 _0x2963=['register','length','./smsMessage.events','remove','update','emit','removeListener'];(function(_0x430148,_0x414d52){var _0x30f5e6=function(_0x283725){while(--_0x283725){_0x430148['push'](_0x430148['shift']());}};_0x30f5e6(++_0x414d52);}(_0x2963,0x14b));var _0x3296=function(_0x4e8a32,_0x3dfc74){_0x4e8a32=_0x4e8a32-0x0;var _0x3e98eb=_0x2963[_0x4e8a32];return _0x3e98eb;};'use strict';var SmsMessageEvents=require(_0x3296('0x0'));var events=['save',_0x3296('0x1'),_0x3296('0x2')];function createListener(_0x23b658,_0x17916f){return function(_0xd71a55){_0x17916f[_0x3296('0x3')](_0x23b658,_0xd71a55);};}function removeListener(_0x405167,_0x413cd2){return function(){SmsMessageEvents[_0x3296('0x4')](_0x405167,_0x413cd2);};}exports[_0x3296('0x5')]=function(_0x2923ca){for(var _0x5a3313=0x0,_0x4d812a=events[_0x3296('0x6')];_0x5a3313<_0x4d812a;_0x5a3313++){var _0x295866=events[_0x5a3313];var _0x130acb=createListener('smsMessage:'+_0x295866,_0x2923ca);SmsMessageEvents['on'](_0x295866,_0x130acb);}}; \ No newline at end of file +var _0x4489=['register','smsMessage:','./smsMessage.events','remove'];(function(_0x393a34,_0x2486b3){var _0x7ad02c=function(_0x8c105b){while(--_0x8c105b){_0x393a34['push'](_0x393a34['shift']());}};_0x7ad02c(++_0x2486b3);}(_0x4489,0x1d2));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var SmsMessageEvents=require(_0x9448('0x0'));var events=['save',_0x9448('0x1'),'update'];function createListener(_0xce6228,_0x161084){return function(_0x15a44){_0x161084['emit'](_0xce6228,_0x15a44);};}function removeListener(_0x271a72,_0x6e86e7){return function(){SmsMessageEvents['removeListener'](_0x271a72,_0x6e86e7);};}exports[_0x9448('0x2')]=function(_0x2cf7b9){for(var _0x163759=0x0,_0x16dd22=events['length'];_0x163759<_0x16dd22;_0x163759++){var _0xf770d1=events[_0x163759];var _0x575243=createListener(_0x9448('0x3')+_0xf770d1,_0x2cf7b9);SmsMessageEvents['on'](_0xf770d1,_0x575243);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index ddcbba6..bf7beea 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 _0x8f57=['addTeams','addAgents','put','delete','/:id','destroy','removeTeams','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams'];(function(_0x44feb5,_0x3f7964){var _0x45e3b8=function(_0x2848be){while(--_0x2848be){_0x44feb5['push'](_0x44feb5['shift']());}};_0x45e3b8(++_0x3f7964);}(_0x8f57,0x131));var _0x78f5=function(_0x46bfdd,_0x342b59){_0x46bfdd=_0x46bfdd-0x0;var _0x5e42c5=_0x8f57[_0x46bfdd];return _0x5e42c5;};'use strict';var multer=require('multer');var util=require(_0x78f5('0x0'));var path=require('path');var timeout=require(_0x78f5('0x1'));var express=require(_0x78f5('0x2'));var router=express[_0x78f5('0x3')]();var auth=require(_0x78f5('0x4'));var interaction=require(_0x78f5('0x5'));var config=require('../../config/environment');var controller=require(_0x78f5('0x6'));router[_0x78f5('0x7')]('/',auth[_0x78f5('0x8')](),controller[_0x78f5('0x9')]);router[_0x78f5('0x7')]('/describe',auth[_0x78f5('0x8')](),controller[_0x78f5('0xa')]);router[_0x78f5('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x78f5('0x7')](_0x78f5('0xb'),auth['isAuthenticated'](),controller[_0x78f5('0xc')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x78f5('0xd')]);router[_0x78f5('0x7')](_0x78f5('0xe'),auth[_0x78f5('0x8')](),controller[_0x78f5('0xf')]);router[_0x78f5('0x10')]('/',auth[_0x78f5('0x8')](),controller[_0x78f5('0x11')]);router['post'](_0x78f5('0x12'),auth[_0x78f5('0x8')](),controller[_0x78f5('0x13')]);router[_0x78f5('0x10')](_0x78f5('0xe'),auth[_0x78f5('0x8')](),controller[_0x78f5('0x14')]);router[_0x78f5('0x15')]('/:id',auth[_0x78f5('0x8')](),controller['update']);router[_0x78f5('0x16')](_0x78f5('0x17'),auth['isAuthenticated'](),controller[_0x78f5('0x18')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x78f5('0x19')]);router[_0x78f5('0x16')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x78f5('0x1a')]=router; \ No newline at end of file +var _0xb12a=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xb12a,0x142));var _0xab12=function(_0x282da8,_0x20e762){_0x282da8=_0x282da8-0x0;var _0x3e9090=_0xb12a[_0x282da8];return _0x3e9090;};'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 auth=require(_0xab12('0x6'));var interaction=require(_0xab12('0x7'));var config=require(_0xab12('0x8'));var controller=require(_0xab12('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xab12('0xa')]);router[_0xab12('0xb')](_0xab12('0xc'),auth['isAuthenticated'](),controller[_0xab12('0xd')]);router[_0xab12('0xb')](_0xab12('0xe'),auth[_0xab12('0xf')](),controller[_0xab12('0x10')]);router['get'](_0xab12('0x11'),auth['isAuthenticated'](),controller[_0xab12('0x12')]);router[_0xab12('0xb')](_0xab12('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0xab12('0xb')](_0xab12('0x14'),auth[_0xab12('0xf')](),controller[_0xab12('0x15')]);router['post']('/',auth[_0xab12('0xf')](),controller[_0xab12('0x16')]);router[_0xab12('0x17')](_0xab12('0x13'),auth['isAuthenticated'](),controller[_0xab12('0x18')]);router[_0xab12('0x17')](_0xab12('0x14'),auth[_0xab12('0xf')](),controller[_0xab12('0x19')]);router[_0xab12('0x1a')](_0xab12('0xe'),auth['isAuthenticated'](),controller[_0xab12('0x1b')]);router[_0xab12('0x1c')](_0xab12('0xe'),auth[_0xab12('0xf')](),controller['destroy']);router[_0xab12('0x1c')](_0xab12('0x13'),auth[_0xab12('0xf')](),controller[_0xab12('0x1d')]);router['delete'](_0xab12('0x14'),auth[_0xab12('0xf')](),controller[_0xab12('0x1e')]);module[_0xab12('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 67b6485..cc415e3 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 _0x5ae6=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x30ecce,_0x1c114e){var _0x15c9b6=function(_0x1687b0){while(--_0x1687b0){_0x30ecce['push'](_0x30ecce['shift']());}};_0x15c9b6(++_0x1c114e);}(_0x5ae6,0x196));var _0x65ae=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x5ae6[_0x3da832];return _0xe602f2;};'use strict';var Sequelize=require('sequelize');module[_0x65ae('0x0')]={'name':{'type':Sequelize[_0x65ae('0x1')],'unique':_0x65ae('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x65ae('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x65ae('0x3')](_0x65ae('0x4'),_0x65ae('0x5'),_0x65ae('0x6'))}}; \ No newline at end of file +var _0xa90a=['exports','name','ENUM','rrmemory','roundrobin'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xa90a,0xb4));var _0xaa90=function(_0x35c094,_0x3bb7d3){_0x35c094=_0x35c094-0x0;var _0x2aa0bb=_0xa90a[_0x35c094];return _0x2aa0bb;};'use strict';var Sequelize=require('sequelize');module[_0xaa90('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xaa90('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaa90('0x2')](_0xaa90('0x3'),'beepall',_0xaa90('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 516a5a6..4ebf46e 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 _0x5636=['papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','UserProfileResource','error','stack','name','SmsQueue','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','key','VIRTUAL','field','count','includeAll','findAll','rows','catch','show','include','options','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','length','order','pick','addTeams','teams','Agents','online','voicePause','flatMap','sequelize','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','tq.TeamId','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5cf193,_0x10ae4f){var _0x4360d2=function(_0x396c41){while(--_0x396c41){_0x5cf193['push'](_0x5cf193['shift']());}};_0x4360d2(++_0x10ae4f);}(_0x5636,0x102));var _0x6563=function(_0x4ee2be,_0x3d00d8){_0x4ee2be=_0x4ee2be-0x0;var _0x457885=_0x5636[_0x4ee2be];return _0x457885;};'use strict';var pdf=require(_0x6563('0x0'));var emlformat=require(_0x6563('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6563('0x2'));var moment=require(_0x6563('0x3'));var BPromise=require(_0x6563('0x4'));var Mustache=require('mustache');var util=require(_0x6563('0x5'));var path=require(_0x6563('0x6'));var sox=require(_0x6563('0x7'));var csv=require(_0x6563('0x8'));var ejs=require(_0x6563('0x9'));var fs=require('fs');var _=require(_0x6563('0xa'));var squel=require(_0x6563('0xb'));var crypto=require(_0x6563('0xc'));var jsforce=require(_0x6563('0xd'));var deskjs=require(_0x6563('0xe'));var toCsv=require(_0x6563('0x8'));var querystring=require(_0x6563('0xf'));var Papa=require(_0x6563('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6563('0x11'));var hardwareService=require(_0x6563('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x6563('0x13'));var db=require(_0x6563('0x14'))['db'];config[_0x6563('0x15')]=_[_0x6563('0x16')](config[_0x6563('0x15')],{'host':_0x6563('0x17'),'port':0x18eb});var socket=require(_0x6563('0x18'))(new Redis(config[_0x6563('0x15')]));require(_0x6563('0x19'))['register'](socket);function respondWithStatusCode(_0xa0a0b6,_0x5e9329){_0x5e9329=_0x5e9329||0xcc;return function(_0x37131e){if(_0x37131e){return _0xa0a0b6[_0x6563('0x1a')](_0x5e9329);}return _0xa0a0b6[_0x6563('0x1b')](_0x5e9329)[_0x6563('0x1c')]();};}function respondWithResult(_0x5af5d0,_0x26f26e){_0x26f26e=_0x26f26e||0xc8;return function(_0x11baa2){if(_0x11baa2){return _0x5af5d0[_0x6563('0x1b')](_0x26f26e)[_0x6563('0x1d')](_0x11baa2);}};}function respondWithFilteredResult(_0x4e7282,_0x3563fd){return function(_0x589632){if(_0x589632){var _0x502694=_0x589632['count'],_0x47972a=_0x3563fd[_0x6563('0x1e')],_0x14c6a6=_0x3563fd[_0x6563('0x1e')]+_0x3563fd[_0x6563('0x1f')],_0x4f5609;if(_0x14c6a6>=_0x502694){_0x14c6a6=_0x502694;_0x4f5609=0xc8;}else{_0x4f5609=0xce;}_0x4e7282[_0x6563('0x1b')](_0x4f5609);return _0x4e7282[_0x6563('0x20')](_0x6563('0x21'),_0x47972a+'-'+_0x14c6a6+'/'+_0x502694)[_0x6563('0x1d')](_0x589632);}return null;};}function patchUpdates(_0x93a45){return function(_0x2a70f0){try{jsonpatch['apply'](_0x2a70f0,_0x93a45,!![]);}catch(_0x2f2905){return BPromise[_0x6563('0x22')](_0x2f2905);}return _0x2a70f0[_0x6563('0x23')]();};}function saveUpdates(_0x5a335c,_0x293db2){return function(_0x5c37bb){if(_0x5c37bb){return _0x5c37bb[_0x6563('0x24')](_0x5a335c)[_0x6563('0x25')](function(_0x5610b0){return _0x5610b0;});}return null;};}function removeEntity(_0x5773e2,_0x3ab7f6){return function(_0x492f45){if(_0x492f45){return _0x492f45[_0x6563('0x26')]()[_0x6563('0x25')](function(){var _0x20d152=_0x492f45['get']({'plain':!![]});var _0xd860d5='SmsQueues';return db[_0x6563('0x27')][_0x6563('0x26')]({'where':{'type':_0xd860d5,'resourceId':_0x20d152['id']}})['then'](function(){return _0x492f45;});})[_0x6563('0x25')](function(){_0x5773e2[_0x6563('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ddb2b,_0x5b03a7){return function(_0x1fe1cb){if(!_0x1fe1cb){_0x2ddb2b['sendStatus'](0x194);}return _0x1fe1cb;};}function handleError(_0x480408,_0x30f05a){_0x30f05a=_0x30f05a||0x1f4;return function(_0x118d31){logger[_0x6563('0x28')](_0x118d31[_0x6563('0x29')]);if(_0x118d31[_0x6563('0x2a')]){delete _0x118d31['name'];}_0x480408[_0x6563('0x1b')](_0x30f05a)['send'](_0x118d31);};}exports['index']=function(_0x3582c9,_0x35af37){var _0x1e2ecb={},_0xdbbdda={},_0x116605={'count':0x0,'rows':[]};var _0x305861=db[_0x6563('0x2b')][_0x6563('0x2c')];_0xdbbdda[_0x6563('0x2d')]=_[_0x6563('0x2e')](_0x305861);_0xdbbdda['query']=_[_0x6563('0x2e')](_0x3582c9[_0x6563('0x2f')]);_0xdbbdda[_0x6563('0x30')]=_[_0x6563('0x31')](_0xdbbdda[_0x6563('0x2d')],_0xdbbdda[_0x6563('0x2f')]);_0x1e2ecb[_0x6563('0x32')]=_['intersection'](_0xdbbdda[_0x6563('0x2d')],qs[_0x6563('0x33')](_0x3582c9[_0x6563('0x2f')][_0x6563('0x33')]));_0x1e2ecb[_0x6563('0x32')]=_0x1e2ecb[_0x6563('0x32')]['length']?_0x1e2ecb[_0x6563('0x32')]:_0xdbbdda[_0x6563('0x2d')];if(!_0x3582c9[_0x6563('0x2f')][_0x6563('0x34')](_0x6563('0x35'))){_0x1e2ecb[_0x6563('0x1f')]=qs[_0x6563('0x1f')](_0x3582c9['query'][_0x6563('0x1f')]);_0x1e2ecb[_0x6563('0x1e')]=qs['offset'](_0x3582c9[_0x6563('0x2f')][_0x6563('0x1e')]);}_0x1e2ecb['order']=qs['sort'](_0x3582c9[_0x6563('0x2f')][_0x6563('0x36')]);_0x1e2ecb[_0x6563('0x37')]=qs[_0x6563('0x30')](_['pick'](_0x3582c9[_0x6563('0x2f')],_0xdbbdda[_0x6563('0x30')]));if(_0x3582c9['query'][_0x6563('0x38')]){_0x1e2ecb[_0x6563('0x37')]=_[_0x6563('0x39')](_0x1e2ecb[_0x6563('0x37')],{'$or':_[_0x6563('0x3a')](_0x305861,function(_0x1f6341){if(_0x1f6341[_0x6563('0x3b')][_0x6563('0x3c')]!==_0x6563('0x3d')){var _0x54b601={};_0x54b601[_0x1f6341[_0x6563('0x3e')]]={'$like':'%'+_0x3582c9[_0x6563('0x2f')][_0x6563('0x38')]+'%'};return _0x54b601;}})});}_0x1e2ecb=_[_0x6563('0x39')]({},_0x1e2ecb,_0x3582c9['options']);var _0x5336b6={'where':_0x1e2ecb[_0x6563('0x37')]};return db[_0x6563('0x2b')][_0x6563('0x3f')](_0x5336b6)['then'](function(_0x3eadab){_0x116605['count']=_0x3eadab;if(_0x3582c9[_0x6563('0x2f')][_0x6563('0x40')]){_0x1e2ecb['include']=[{'all':!![]}];}return db[_0x6563('0x2b')][_0x6563('0x41')](_0x1e2ecb);})[_0x6563('0x25')](function(_0xcf92cd){_0x116605[_0x6563('0x42')]=_0xcf92cd;return _0x116605;})[_0x6563('0x25')](respondWithFilteredResult(_0x35af37,_0x1e2ecb))[_0x6563('0x43')](handleError(_0x35af37,null));};exports[_0x6563('0x44')]=function(_0xd30789,_0xfc7eb1){var _0x2acb52={'raw':!![],'where':{'id':_0xd30789['params']['id']}},_0x4eb5ef={};_0x4eb5ef[_0x6563('0x2d')]=_[_0x6563('0x2e')](db[_0x6563('0x2b')][_0x6563('0x2c')]);_0x4eb5ef[_0x6563('0x2f')]=_[_0x6563('0x2e')](_0xd30789[_0x6563('0x2f')]);_0x4eb5ef['filters']=_[_0x6563('0x31')](_0x4eb5ef[_0x6563('0x2d')],_0x4eb5ef[_0x6563('0x2f')]);_0x2acb52[_0x6563('0x32')]=_['intersection'](_0x4eb5ef[_0x6563('0x2d')],qs[_0x6563('0x33')](_0xd30789[_0x6563('0x2f')][_0x6563('0x33')]));_0x2acb52[_0x6563('0x32')]=_0x2acb52['attributes']['length']?_0x2acb52[_0x6563('0x32')]:_0x4eb5ef[_0x6563('0x2d')];if(_0xd30789[_0x6563('0x2f')]['includeAll']){_0x2acb52[_0x6563('0x45')]=[{'all':!![]}];}_0x2acb52=_[_0x6563('0x39')]({},_0x2acb52,_0xd30789[_0x6563('0x46')]);return db[_0x6563('0x2b')]['find'](_0x2acb52)[_0x6563('0x25')](handleEntityNotFound(_0xfc7eb1,null))[_0x6563('0x25')](respondWithResult(_0xfc7eb1,null))[_0x6563('0x43')](handleError(_0xfc7eb1,null));};exports['create']=function(_0x35b0ce,_0x4bcfff){return db[_0x6563('0x2b')]['create'](_0x35b0ce['body'],{})[_0x6563('0x25')](function(_0x11617b){var _0x2ebab0=_0x35b0ce[_0x6563('0x47')][_0x6563('0x48')]({'plain':!![]});if(!_0x2ebab0)throw new Error(_0x6563('0x49'));if(_0x2ebab0[_0x6563('0x4a')]===_0x6563('0x47')){var _0x3193f5=_0x11617b[_0x6563('0x48')]({'plain':!![]});var _0x4951a6=_0x6563('0x4b');return db['UserProfileSection'][_0x6563('0x4c')]({'where':{'name':_0x4951a6,'userProfileId':_0x2ebab0[_0x6563('0x4d')]},'raw':!![]})[_0x6563('0x25')](function(_0x528b26){if(_0x528b26&&_0x528b26[_0x6563('0x4e')]===0x0){return db[_0x6563('0x27')]['create']({'name':_0x3193f5[_0x6563('0x2a')],'resourceId':_0x3193f5['id'],'type':_0x528b26[_0x6563('0x2a')],'sectionId':_0x528b26['id']},{})[_0x6563('0x25')](function(){return _0x11617b;});}else{return _0x11617b;}})[_0x6563('0x43')](function(_0xbd920a){logger['error'](_0x6563('0x4f'),_0xbd920a);throw _0xbd920a;});}return _0x11617b;})['then'](respondWithResult(_0x4bcfff,0xc9))[_0x6563('0x43')](handleError(_0x4bcfff,null));};exports['update']=function(_0xd2ed6b,_0x5992c8){if(_0xd2ed6b['body']['id']){delete _0xd2ed6b['body']['id'];}return db['SmsQueue'][_0x6563('0x4c')]({'where':{'id':_0xd2ed6b['params']['id']}})[_0x6563('0x25')](handleEntityNotFound(_0x5992c8,null))['then'](saveUpdates(_0xd2ed6b[_0x6563('0x50')],null))[_0x6563('0x25')](respondWithResult(_0x5992c8,null))[_0x6563('0x43')](handleError(_0x5992c8,null));};exports[_0x6563('0x26')]=function(_0x39cf33,_0x199a0e){return db[_0x6563('0x2b')][_0x6563('0x4c')]({'where':{'id':_0x39cf33[_0x6563('0x51')]['id']}})['then'](handleEntityNotFound(_0x199a0e,null))[_0x6563('0x25')](removeEntity(_0x199a0e,null))[_0x6563('0x43')](handleError(_0x199a0e,null));};exports[_0x6563('0x52')]=function(_0x30e4a8,_0x3f40ad){return db[_0x6563('0x2b')][_0x6563('0x52')]()[_0x6563('0x25')](respondWithResult(_0x3f40ad,null))[_0x6563('0x43')](handleError(_0x3f40ad,null));};exports[_0x6563('0x53')]=function(_0x1fc431,_0x5c456b,_0x1a3317){var _0x1a6adb={'raw':!![],'where':{}},_0x23f38d={},_0x2e9c69;return db[_0x6563('0x2b')][_0x6563('0x54')]({'where':{'id':_0x1fc431[_0x6563('0x51')]['id']}})[_0x6563('0x25')](handleEntityNotFound(_0x5c456b,null))['then'](function(_0xbfb2a6){if(_0xbfb2a6){_0x2e9c69=_0xbfb2a6['get']({'plain':!![]});_0x23f38d[_0x6563('0x2d')]=_[_0x6563('0x2e')](db['UserSmsQueue']['rawAttributes']);_0x23f38d[_0x6563('0x2f')]=_[_0x6563('0x2e')](_0x1fc431[_0x6563('0x2f')]);_0x23f38d[_0x6563('0x30')]=_['intersection'](_0x23f38d[_0x6563('0x2d')],_0x23f38d['query']);_0x1a6adb[_0x6563('0x32')]=_[_0x6563('0x31')](_0x23f38d['model'],qs['fields'](_0x1fc431[_0x6563('0x2f')]['fields']));_0x1a6adb['attributes']=_0x1a6adb[_0x6563('0x32')]['length']?_0x1a6adb[_0x6563('0x32')]:_0x23f38d[_0x6563('0x2d')];if(!_0x1fc431[_0x6563('0x2f')][_0x6563('0x34')]('nolimit')){_0x1a6adb[_0x6563('0x1f')]=qs[_0x6563('0x1f')](_0x1fc431[_0x6563('0x2f')][_0x6563('0x1f')]);_0x1a6adb[_0x6563('0x1e')]=qs[_0x6563('0x1e')](_0x1fc431[_0x6563('0x2f')][_0x6563('0x1e')]);}_0x1a6adb['order']=qs['sort'](_0x1fc431[_0x6563('0x2f')][_0x6563('0x36')]);_0x1a6adb['where']=qs['filters'](_['pick'](_0x1fc431[_0x6563('0x2f')],_0x23f38d[_0x6563('0x30')]));_0x1a6adb[_0x6563('0x37')][_0x6563('0x55')]=_0xbfb2a6['id'];if(_0x1fc431['query'][_0x6563('0x38')]){_0x1a6adb[_0x6563('0x37')]=_[_0x6563('0x39')](_0x1a6adb[_0x6563('0x37')],{'$or':_[_0x6563('0x3a')](_0x1a6adb['attributes'],function(_0x4fd7fc){var _0x25e2e6={};_0x25e2e6[_0x4fd7fc]={'$like':'%'+_0x1fc431[_0x6563('0x2f')][_0x6563('0x38')]+'%'};return _0x25e2e6;})});}_0x1a6adb=_['merge']({},_0x1a6adb,_0x1fc431[_0x6563('0x46')]);return db['UserSmsQueue'][_0x6563('0x41')](_0x1a6adb);}})[_0x6563('0x25')](function(_0x417b8e){if(_0x417b8e){return db[_0x6563('0x56')][_0x6563('0x57')]({'where':{'id':_[_0x6563('0x3a')](_0x417b8e,_0x6563('0x58')),'role':'agent'},'attributes':['id','name',_0x6563('0x59'),_0x6563('0x5a'),_0x6563('0x5b')]});}})[_0x6563('0x25')](function(_0x961a12){if(_0x961a12){return{'count':_0x961a12[_0x6563('0x3f')],'rows':_['map'](_0x961a12['rows'],function(_0x504e05){return{'membername':_0x504e05[_0x6563('0x2a')],'UserId':_0x504e05['id'],'queue_name':_0x2e9c69[_0x6563('0x2a')],'SmsQueueId':_0x2e9c69['id'],'interface':util[_0x6563('0x5c')](_0x6563('0x5d'),_0x6563('0x5e'),_0x504e05['name']),'penalty':0x0,'paused':_0x504e05[_0x6563('0x59')],'createdAt':_0x504e05[_0x6563('0x5b')],'updatedAt':_0x504e05[_0x6563('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6563('0x25')](respondWithFilteredResult(_0x5c456b,_0x1a6adb))['catch'](handleError(_0x5c456b,null));};exports[_0x6563('0x5f')]=function(_0xd0ec42,_0x3e4687,_0x3d5186){var _0x3cef6d={};var _0x7d3479={};var _0xeefb21;var _0x937aae;return db[_0x6563('0x2b')][_0x6563('0x54')]({'where':{'id':_0xd0ec42[_0x6563('0x51')]['id']}})[_0x6563('0x25')](handleEntityNotFound(_0x3e4687,null))[_0x6563('0x25')](function(_0x25574b){if(_0x25574b){_0xeefb21=_0x25574b;_0x7d3479[_0x6563('0x2d')]=_['keys'](db[_0x6563('0x60')][_0x6563('0x2c')]);_0x7d3479[_0x6563('0x2f')]=_[_0x6563('0x2e')](_0xd0ec42[_0x6563('0x2f')]);_0x7d3479[_0x6563('0x30')]=_[_0x6563('0x31')](_0x7d3479[_0x6563('0x2d')],_0x7d3479[_0x6563('0x2f')]);_0x3cef6d[_0x6563('0x32')]=_['intersection'](_0x7d3479[_0x6563('0x2d')],qs[_0x6563('0x33')](_0xd0ec42[_0x6563('0x2f')][_0x6563('0x33')]));_0x3cef6d[_0x6563('0x32')]=_0x3cef6d[_0x6563('0x32')][_0x6563('0x61')]?_0x3cef6d['attributes']:_0x7d3479[_0x6563('0x2d')];_0x3cef6d[_0x6563('0x62')]=qs[_0x6563('0x36')](_0xd0ec42[_0x6563('0x2f')][_0x6563('0x36')]);_0x3cef6d[_0x6563('0x37')]=qs['filters'](_[_0x6563('0x63')](_0xd0ec42[_0x6563('0x2f')],_0x7d3479[_0x6563('0x30')]));if(_0xd0ec42['query'][_0x6563('0x38')]){_0x3cef6d[_0x6563('0x37')]=_[_0x6563('0x39')](_0x3cef6d['where'],{'$or':_['map'](_0x3cef6d['attributes'],function(_0x2712b4){var _0x144f9d={};_0x144f9d[_0x2712b4]={'$like':'%'+_0xd0ec42[_0x6563('0x2f')][_0x6563('0x38')]+'%'};return _0x144f9d;})});}_0x3cef6d=_['merge']({},_0x3cef6d,_0xd0ec42[_0x6563('0x46')]);return _0xeefb21[_0x6563('0x5f')](_0x3cef6d);}})['then'](function(_0x4ef39c){if(_0x4ef39c){_0x937aae=_0x4ef39c[_0x6563('0x61')];if(!_0xd0ec42[_0x6563('0x2f')][_0x6563('0x34')](_0x6563('0x35'))){_0x3cef6d['limit']=qs[_0x6563('0x1f')](_0xd0ec42[_0x6563('0x2f')][_0x6563('0x1f')]);_0x3cef6d[_0x6563('0x1e')]=qs[_0x6563('0x1e')](_0xd0ec42[_0x6563('0x2f')][_0x6563('0x1e')]);}return _0xeefb21[_0x6563('0x5f')](_0x3cef6d);}})[_0x6563('0x25')](function(_0x5797a5){if(_0x5797a5){return _0x5797a5?{'count':_0x937aae,'rows':_0x5797a5}:null;}})[_0x6563('0x25')](respondWithResult(_0x3e4687,null))[_0x6563('0x43')](handleError(_0x3e4687,null));};exports[_0x6563('0x64')]=function(_0x44c0f4,_0x1fbb3c,_0x2530b5){var _0x5c078f=_0x44c0f4[_0x6563('0x50')][_0x6563('0x65')];return db[_0x6563('0x60')]['findAll']({'where':{'id':_['map'](_0x5c078f,'id')},'attributes':['id'],'include':[{'model':db[_0x6563('0x56')],'as':_0x6563('0x66'),'attributes':['id',_0x6563('0x2a'),_0x6563('0x67'),_0x6563('0x68'),'interface'],'raw':!![]}]})['then'](function(_0x264aaa){if(_0x264aaa){var _0x546822=_[_0x6563('0x69')](_0x264aaa,function(_0x5c1f93){var _0x5bd03d=_0x5c1f93[_0x6563('0x48')]({'plain':!![]});return _0x5bd03d[_0x6563('0x66')];});return db[_0x6563('0x2b')][_0x6563('0x4c')]({'where':{'id':_0x44c0f4[_0x6563('0x51')]['id']}})[_0x6563('0x25')](function(_0x32c109){return db[_0x6563('0x6a')]['transaction'](function(_0x221f98){return _0x32c109[_0x6563('0x64')](_[_0x6563('0x3a')](_0x5c078f,'id'),{'transaction':_0x221f98})[_0x6563('0x25')](function(){return BPromise['each'](_0x546822,function(_0x2851d9){return db['UserSmsQueue'][_0x6563('0x6b')]({'where':{'UserId':_0x2851d9['id'],'SmsQueueId':_0x44c0f4[_0x6563('0x51')]['id']},'transaction':_0x221f98});});})[_0x6563('0x25')](function(){_0x546822[_0x6563('0x6c')](function(_0x2df77f){socket[_0x6563('0x6d')](_0x6563('0x6e'),{'UserId':_0x2df77f['id'],'SmsQueueId':_0x32c109['id']});});});});});}})[_0x6563('0x25')](respondWithStatusCode(_0x1fbb3c,null))[_0x6563('0x43')](handleError(_0x1fbb3c,null));};exports[_0x6563('0x6f')]=function(_0x5ef502,_0x2aa66e,_0x49eb6e){return db[_0x6563('0x60')]['findAll']({'where':{'id':_0x5ef502[_0x6563('0x2f')][_0x6563('0x70')]},'attributes':['id'],'include':[{'model':db[_0x6563('0x56')],'as':_0x6563('0x66'),'attributes':['id'],'raw':!![]}]})[_0x6563('0x25')](handleEntityNotFound(_0x2aa66e,null))[_0x6563('0x25')](function(_0x14f4a3){var _0x211568=_[_0x6563('0x3a')](_0x14f4a3,'id');var _0x2c17eb=[];var _0x25cb84=[];var _0x5a14e8=squel[_0x6563('0x71')]();_0x5a14e8[_0x6563('0x3e')](_0x6563('0x72'))['from'](_0x6563('0x73'),'tq')[_0x6563('0x74')](_0x6563('0x75'),'ut',_0x6563('0x76'))[_0x6563('0x37')](_0x6563('0x77'),_0x5ef502['params']['id']);for(var _0x40bb2f=0x0;_0x40bb2f<_0x14f4a3[_0x6563('0x61')];_0x40bb2f+=0x1){let _0x580893=_0x14f4a3[_0x40bb2f];for(var _0x162a57=0x0;_0x162a57<_0x580893['Agents']['length'];_0x162a57+=0x1){let _0x39e94d=_0x580893[_0x6563('0x66')][_0x162a57];var _0x43b966=_0x5a14e8[_0x6563('0x78')]();_0x43b966[_0x6563('0x37')](_0x6563('0x79'),_0x39e94d['id']);_0x25cb84[_0x6563('0x7a')](db[_0x6563('0x6a')][_0x6563('0x2f')](_0x43b966[_0x6563('0x7b')](),{'type':db['sequelize'][_0x6563('0x7c')][_0x6563('0x7d')]})['then'](function(_0x5711b7){if(_0x5711b7[_0x6563('0x61')]===0x1){return _0x39e94d['id'];}else{var _0x127207=_[_0x6563('0x7e')](_[_0x6563('0x3a')](_0x5711b7,'TeamId'),function(_0x144a2a){return _['includes'](_0x211568,_0x144a2a);});if(_0x127207){return _0x39e94d['id'];}}}));}}return BPromise[_0x6563('0x7f')](_0x25cb84)[_0x6563('0x25')](function(_0xbecb8b){_0x2c17eb=_(_0x2c17eb)[_0x6563('0x80')](_0xbecb8b)[_0x6563('0x81')]()[_0x6563('0x82')]();return db['SmsQueue']['find']({'where':{'id':_0x5ef502[_0x6563('0x51')]['id']}})[_0x6563('0x25')](function(_0x51ca9c){return db[_0x6563('0x6a')]['transaction'](function(_0x5362aa){return _0x51ca9c[_0x6563('0x6f')](_0x5ef502[_0x6563('0x2f')][_0x6563('0x70')],{'transaction':_0x5362aa})[_0x6563('0x25')](function(){if(!_['isEmpty'](_0x2c17eb)){return _0x51ca9c[_0x6563('0x83')](_0x2c17eb,{'transaction':_0x5362aa});}})[_0x6563('0x25')](function(){_0x2c17eb[_0x6563('0x6c')](function(_0x1241f9){socket[_0x6563('0x6d')](_0x6563('0x84'),{'UserId':_0x1241f9,'SmsQueueId':_0x51ca9c['id']});});});});});});})[_0x6563('0x25')](respondWithStatusCode(_0x2aa66e,null))['catch'](handleError(_0x2aa66e,null));};exports[_0x6563('0x85')]=function(_0x3499f2,_0x18a63b,_0x4586bb){return db['SmsQueue']['find']({'where':{'id':_0x3499f2[_0x6563('0x51')]['id']}})[_0x6563('0x25')](handleEntityNotFound(_0x18a63b,null))[_0x6563('0x25')](function(_0x424cf9){if(_0x424cf9){return _0x424cf9[_0x6563('0x85')](_0x3499f2[_0x6563('0x50')][_0x6563('0x70')],_[_0x6563('0x86')](_0x3499f2[_0x6563('0x50')],['ids','id'])||{})['spread'](function(_0x138fc9){for(var _0x822c8=0x0;_0x822c8<_0x3499f2[_0x6563('0x50')][_0x6563('0x70')][_0x6563('0x61')];_0x822c8+=0x1){socket[_0x6563('0x6d')]('userSmsQueue:save',{'UserId':_0x3499f2[_0x6563('0x50')][_0x6563('0x70')][_0x822c8],'SmsQueueId':_0x3499f2[_0x6563('0x51')]['id']});}return _0x138fc9;});}})[_0x6563('0x25')](respondWithResult(_0x18a63b,null))[_0x6563('0x43')](handleError(_0x18a63b,null));};exports[_0x6563('0x83')]=function(_0x1192f4,_0x54148d,_0x1a553d){return db[_0x6563('0x2b')][_0x6563('0x4c')]({'where':{'id':_0x1192f4[_0x6563('0x51')]['id']}})['then'](handleEntityNotFound(_0x54148d,null))[_0x6563('0x25')](function(_0x947664){if(_0x947664){return _0x947664[_0x6563('0x83')](_0x1192f4[_0x6563('0x2f')][_0x6563('0x70')])[_0x6563('0x25')](function(){if(_[_0x6563('0x87')](_0x1192f4['query']['ids'])){for(var _0x28e6e3=0x0;_0x28e6e3<_0x1192f4[_0x6563('0x2f')][_0x6563('0x70')][_0x6563('0x61')];_0x28e6e3+=0x1){socket['emit']('userSmsQueue:remove',{'UserId':Number(_0x1192f4[_0x6563('0x2f')][_0x6563('0x70')][_0x28e6e3]),'SmsQueueId':Number(_0x1192f4['params']['id'])});}}else{socket[_0x6563('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x1192f4[_0x6563('0x2f')]['ids']),'SmsQueueId':Number(_0x1192f4[_0x6563('0x51')]['id'])});}});}})[_0x6563('0x25')](respondWithStatusCode(_0x54148d,null))[_0x6563('0x43')](handleError(_0x54148d,null));};exports['getAgents']=function(_0x39e725,_0x3a9c86,_0x30e2a9){var _0x364aaf={};var _0x40a68a={};var _0x1692c4;var _0x482635;return db[_0x6563('0x2b')][_0x6563('0x54')]({'where':{'id':_0x39e725[_0x6563('0x51')]['id']}})[_0x6563('0x25')](handleEntityNotFound(_0x3a9c86,null))[_0x6563('0x25')](function(_0x35bdff){if(_0x35bdff){_0x1692c4=_0x35bdff;_0x40a68a[_0x6563('0x2d')]=_[_0x6563('0x2e')](db['User'][_0x6563('0x2c')]);_0x40a68a['query']=_[_0x6563('0x2e')](_0x39e725[_0x6563('0x2f')]);_0x40a68a['filters']=_[_0x6563('0x31')](_0x40a68a[_0x6563('0x2d')],_0x40a68a[_0x6563('0x2f')]);_0x364aaf[_0x6563('0x32')]=_[_0x6563('0x31')](_0x40a68a[_0x6563('0x2d')],qs[_0x6563('0x33')](_0x39e725['query'][_0x6563('0x33')]));_0x364aaf[_0x6563('0x32')]=_0x364aaf[_0x6563('0x32')][_0x6563('0x61')]?_0x364aaf[_0x6563('0x32')]:_0x40a68a[_0x6563('0x2d')];_0x364aaf[_0x6563('0x62')]=qs['sort'](_0x39e725['query']['sort']);_0x364aaf[_0x6563('0x37')]=qs[_0x6563('0x30')](_['pick'](_0x39e725[_0x6563('0x2f')],_0x40a68a[_0x6563('0x30')]));if(_0x39e725[_0x6563('0x2f')][_0x6563('0x38')]){_0x364aaf[_0x6563('0x37')]=_[_0x6563('0x39')](_0x364aaf[_0x6563('0x37')],{'$or':_['map'](_0x364aaf[_0x6563('0x32')],function(_0x392dca){var _0x3b984f={};_0x3b984f[_0x392dca]={'$like':'%'+_0x39e725[_0x6563('0x2f')][_0x6563('0x38')]+'%'};return _0x3b984f;})});}_0x364aaf=_[_0x6563('0x39')]({},_0x364aaf,_0x39e725[_0x6563('0x46')]);return _0x1692c4[_0x6563('0x88')](_0x364aaf);}})['then'](function(_0xbdfcc7){if(_0xbdfcc7){_0x482635=_0xbdfcc7['length'];if(!_0x39e725[_0x6563('0x2f')][_0x6563('0x34')](_0x6563('0x35'))){_0x364aaf[_0x6563('0x1f')]=qs['limit'](_0x39e725[_0x6563('0x2f')][_0x6563('0x1f')]);_0x364aaf[_0x6563('0x1e')]=qs[_0x6563('0x1e')](_0x39e725[_0x6563('0x2f')][_0x6563('0x1e')]);}return _0x1692c4[_0x6563('0x88')](_0x364aaf);}})[_0x6563('0x25')](function(_0x4fd06b){if(_0x4fd06b){return _0x4fd06b?{'count':_0x482635,'rows':_0x4fd06b}:null;}})[_0x6563('0x25')](respondWithResult(_0x3a9c86,null))['catch'](handleError(_0x3a9c86,null));}; \ No newline at end of file +var _0x0ba7=['query','filters','intersection','attributes','length','nolimit','order','sort','filter','where','merge','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','pick','SmsQueueId','User','findAndCountAll','UserId','agent','name','smsPause','updatedAt','createdAt','map','format','%s/%s','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','sequelize','each','forEach','emit','removeTeams','ids','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','isEmpty','removeAgents','addAgents','spread','userSmsQueue:save','userSmsQueue:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','send','index','SmsQueue','rawAttributes','model','keys'];(function(_0x435c80,_0x29a3a1){var _0x1795d7=function(_0x5c7e11){while(--_0x5c7e11){_0x435c80['push'](_0x435c80['shift']());}};_0x1795d7(++_0x29a3a1);}(_0x0ba7,0x16d));var _0x70ba=function(_0x1b66b3,_0x173c72){_0x1b66b3=_0x1b66b3-0x0;var _0x404b96=_0x0ba7[_0x1b66b3];return _0x404b96;};'use strict';var pdf=require(_0x70ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x70ba('0x1'));var zipdir=require(_0x70ba('0x2'));var jsonpatch=require(_0x70ba('0x3'));var rp=require(_0x70ba('0x4'));var moment=require('moment');var BPromise=require(_0x70ba('0x5'));var Mustache=require(_0x70ba('0x6'));var util=require(_0x70ba('0x7'));var path=require(_0x70ba('0x8'));var sox=require(_0x70ba('0x9'));var csv=require(_0x70ba('0xa'));var ejs=require(_0x70ba('0xb'));var fs=require('fs');var _=require(_0x70ba('0xc'));var squel=require(_0x70ba('0xd'));var crypto=require(_0x70ba('0xe'));var jsforce=require(_0x70ba('0xf'));var deskjs=require(_0x70ba('0x10'));var toCsv=require(_0x70ba('0xa'));var querystring=require(_0x70ba('0x11'));var Papa=require(_0x70ba('0x12'));var Redis=require('ioredis');var authService=require(_0x70ba('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x70ba('0x14'));var logger=require(_0x70ba('0x15'))(_0x70ba('0x16'));var utils=require(_0x70ba('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x70ba('0x18')]=_['defaults'](config[_0x70ba('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x70ba('0x19'))(new Redis(config[_0x70ba('0x18')]));require('./smsQueue.socket')[_0x70ba('0x1a')](socket);function respondWithStatusCode(_0x57d84e,_0x51321d){_0x51321d=_0x51321d||0xcc;return function(_0x2728e1){if(_0x2728e1){return _0x57d84e[_0x70ba('0x1b')](_0x51321d);}return _0x57d84e[_0x70ba('0x1c')](_0x51321d)[_0x70ba('0x1d')]();};}function respondWithResult(_0x29734b,_0x232138){_0x232138=_0x232138||0xc8;return function(_0x164521){if(_0x164521){return _0x29734b[_0x70ba('0x1c')](_0x232138)[_0x70ba('0x1e')](_0x164521);}};}function respondWithFilteredResult(_0x30ac22,_0x41e11b){return function(_0x3a52a8){if(_0x3a52a8){var _0xb6d69a=_0x3a52a8[_0x70ba('0x1f')],_0x5ed907=_0x41e11b[_0x70ba('0x20')],_0x5dad2d=_0x41e11b[_0x70ba('0x20')]+_0x41e11b[_0x70ba('0x21')],_0x489cf9;if(_0x5dad2d>=_0xb6d69a){_0x5dad2d=_0xb6d69a;_0x489cf9=0xc8;}else{_0x489cf9=0xce;}_0x30ac22[_0x70ba('0x1c')](_0x489cf9);return _0x30ac22[_0x70ba('0x22')](_0x70ba('0x23'),_0x5ed907+'-'+_0x5dad2d+'/'+_0xb6d69a)[_0x70ba('0x1e')](_0x3a52a8);}return null;};}function patchUpdates(_0x415879){return function(_0x40b82c){try{jsonpatch[_0x70ba('0x24')](_0x40b82c,_0x415879,!![]);}catch(_0x221529){return BPromise[_0x70ba('0x25')](_0x221529);}return _0x40b82c[_0x70ba('0x26')]();};}function saveUpdates(_0x273ce4,_0x5ebe9d){return function(_0x3b31ef){if(_0x3b31ef){return _0x3b31ef[_0x70ba('0x27')](_0x273ce4)['then'](function(_0x123b0c){return _0x123b0c;});}return null;};}function removeEntity(_0x5519d4,_0x4868a1){return function(_0x112aeb){if(_0x112aeb){return _0x112aeb['destroy']()[_0x70ba('0x28')](function(){var _0x304a41=_0x112aeb['get']({'plain':!![]});var _0xf403fc='SmsQueues';return db['UserProfileResource'][_0x70ba('0x29')]({'where':{'type':_0xf403fc,'resourceId':_0x304a41['id']}})['then'](function(){return _0x112aeb;});})[_0x70ba('0x28')](function(){_0x5519d4[_0x70ba('0x1c')](0xcc)[_0x70ba('0x1d')]();});}};}function handleEntityNotFound(_0x33e218,_0x2c6d18){return function(_0x265423){if(!_0x265423){_0x33e218['sendStatus'](0x194);}return _0x265423;};}function handleError(_0x2d840e,_0x190bb5){_0x190bb5=_0x190bb5||0x1f4;return function(_0x797467){logger['error'](_0x797467[_0x70ba('0x2a')]);if(_0x797467['name']){delete _0x797467['name'];}_0x2d840e['status'](_0x190bb5)[_0x70ba('0x2b')](_0x797467);};}exports[_0x70ba('0x2c')]=function(_0x5b6e6e,_0x51b3e3){var _0x16dc2f={},_0x4ff810={},_0x102661={'count':0x0,'rows':[]};var _0x45d972=db[_0x70ba('0x2d')][_0x70ba('0x2e')];_0x4ff810[_0x70ba('0x2f')]=_[_0x70ba('0x30')](_0x45d972);_0x4ff810[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x5b6e6e[_0x70ba('0x31')]);_0x4ff810[_0x70ba('0x32')]=_[_0x70ba('0x33')](_0x4ff810['model'],_0x4ff810['query']);_0x16dc2f[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0x4ff810[_0x70ba('0x2f')],qs['fields'](_0x5b6e6e['query']['fields']));_0x16dc2f[_0x70ba('0x34')]=_0x16dc2f[_0x70ba('0x34')][_0x70ba('0x35')]?_0x16dc2f['attributes']:_0x4ff810[_0x70ba('0x2f')];if(!_0x5b6e6e['query']['hasOwnProperty'](_0x70ba('0x36'))){_0x16dc2f['limit']=qs[_0x70ba('0x21')](_0x5b6e6e[_0x70ba('0x31')]['limit']);_0x16dc2f[_0x70ba('0x20')]=qs[_0x70ba('0x20')](_0x5b6e6e[_0x70ba('0x31')]['offset']);}_0x16dc2f[_0x70ba('0x37')]=qs[_0x70ba('0x38')](_0x5b6e6e[_0x70ba('0x31')][_0x70ba('0x38')]);_0x16dc2f['where']=qs[_0x70ba('0x32')](_['pick'](_0x5b6e6e[_0x70ba('0x31')],_0x4ff810[_0x70ba('0x32')]));if(_0x5b6e6e[_0x70ba('0x31')][_0x70ba('0x39')]){_0x16dc2f[_0x70ba('0x3a')]=_[_0x70ba('0x3b')](_0x16dc2f[_0x70ba('0x3a')],{'$or':_['map'](_0x45d972,function(_0x29bab7){if(_0x29bab7[_0x70ba('0x3c')][_0x70ba('0x3d')]!==_0x70ba('0x3e')){var _0x18d1f9={};_0x18d1f9[_0x29bab7[_0x70ba('0x3f')]]={'$like':'%'+_0x5b6e6e['query'][_0x70ba('0x39')]+'%'};return _0x18d1f9;}})});}_0x16dc2f=_[_0x70ba('0x3b')]({},_0x16dc2f,_0x5b6e6e[_0x70ba('0x40')]);var _0x499bd8={'where':_0x16dc2f['where']};return db['SmsQueue'][_0x70ba('0x1f')](_0x499bd8)[_0x70ba('0x28')](function(_0x3424ea){_0x102661['count']=_0x3424ea;if(_0x5b6e6e[_0x70ba('0x31')][_0x70ba('0x41')]){_0x16dc2f[_0x70ba('0x42')]=[{'all':!![]}];}return db[_0x70ba('0x2d')][_0x70ba('0x43')](_0x16dc2f);})['then'](function(_0x5ee74c){_0x102661[_0x70ba('0x44')]=_0x5ee74c;return _0x102661;})[_0x70ba('0x28')](respondWithFilteredResult(_0x51b3e3,_0x16dc2f))[_0x70ba('0x45')](handleError(_0x51b3e3,null));};exports['show']=function(_0x595645,_0x2fc262){var _0x4d6467={'raw':!![],'where':{'id':_0x595645[_0x70ba('0x46')]['id']}},_0x30fdcd={};_0x30fdcd[_0x70ba('0x2f')]=_[_0x70ba('0x30')](db[_0x70ba('0x2d')]['rawAttributes']);_0x30fdcd[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x595645[_0x70ba('0x31')]);_0x30fdcd[_0x70ba('0x32')]=_[_0x70ba('0x33')](_0x30fdcd[_0x70ba('0x2f')],_0x30fdcd[_0x70ba('0x31')]);_0x4d6467[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0x30fdcd[_0x70ba('0x2f')],qs[_0x70ba('0x47')](_0x595645[_0x70ba('0x31')][_0x70ba('0x47')]));_0x4d6467[_0x70ba('0x34')]=_0x4d6467[_0x70ba('0x34')]['length']?_0x4d6467[_0x70ba('0x34')]:_0x30fdcd[_0x70ba('0x2f')];if(_0x595645['query'][_0x70ba('0x41')]){_0x4d6467[_0x70ba('0x42')]=[{'all':!![]}];}_0x4d6467=_[_0x70ba('0x3b')]({},_0x4d6467,_0x595645[_0x70ba('0x40')]);return db[_0x70ba('0x2d')][_0x70ba('0x48')](_0x4d6467)[_0x70ba('0x28')](handleEntityNotFound(_0x2fc262,null))['then'](respondWithResult(_0x2fc262,null))[_0x70ba('0x45')](handleError(_0x2fc262,null));};exports[_0x70ba('0x49')]=function(_0x390cd0,_0x3d1f89){return db[_0x70ba('0x2d')][_0x70ba('0x49')](_0x390cd0[_0x70ba('0x4a')],{})[_0x70ba('0x28')](function(_0xc574b){var _0x23439d=_0x390cd0[_0x70ba('0x4b')][_0x70ba('0x4c')]({'plain':!![]});if(!_0x23439d)throw new Error(_0x70ba('0x4d'));if(_0x23439d[_0x70ba('0x4e')]===_0x70ba('0x4b')){var _0x2536cd=_0xc574b[_0x70ba('0x4c')]({'plain':!![]});var _0x4a848b=_0x70ba('0x4f');return db[_0x70ba('0x50')][_0x70ba('0x48')]({'where':{'name':_0x4a848b,'userProfileId':_0x23439d[_0x70ba('0x51')]},'raw':!![]})['then'](function(_0x47c40c){if(_0x47c40c&&_0x47c40c['autoAssociation']===0x0){return db[_0x70ba('0x52')][_0x70ba('0x49')]({'name':_0x2536cd['name'],'resourceId':_0x2536cd['id'],'type':_0x47c40c['name'],'sectionId':_0x47c40c['id']},{})[_0x70ba('0x28')](function(){return _0xc574b;});}else{return _0xc574b;}})[_0x70ba('0x45')](function(_0x3e3779){logger[_0x70ba('0x53')](_0x70ba('0x54'),_0x3e3779);throw _0x3e3779;});}return _0xc574b;})[_0x70ba('0x28')](respondWithResult(_0x3d1f89,0xc9))[_0x70ba('0x45')](handleError(_0x3d1f89,null));};exports['update']=function(_0x538e11,_0x361699){if(_0x538e11[_0x70ba('0x4a')]['id']){delete _0x538e11[_0x70ba('0x4a')]['id'];}return db[_0x70ba('0x2d')]['find']({'where':{'id':_0x538e11[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x361699,null))['then'](saveUpdates(_0x538e11['body'],null))['then'](respondWithResult(_0x361699,null))['catch'](handleError(_0x361699,null));};exports[_0x70ba('0x29')]=function(_0x2c4eaa,_0x1cb9c7){return db['SmsQueue'][_0x70ba('0x48')]({'where':{'id':_0x2c4eaa[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x1cb9c7,null))['then'](removeEntity(_0x1cb9c7,null))[_0x70ba('0x45')](handleError(_0x1cb9c7,null));};exports[_0x70ba('0x55')]=function(_0x4a231c,_0x49f89a){return db[_0x70ba('0x2d')][_0x70ba('0x55')]()[_0x70ba('0x28')](respondWithResult(_0x49f89a,null))[_0x70ba('0x45')](handleError(_0x49f89a,null));};exports[_0x70ba('0x56')]=function(_0x3717a0,_0x44cb31,_0x5e7a92){var _0x8ab9c6={'raw':!![],'where':{}},_0x27d101={},_0x4de412;return db['SmsQueue'][_0x70ba('0x57')]({'where':{'id':_0x3717a0[_0x70ba('0x46')]['id']}})['then'](handleEntityNotFound(_0x44cb31,null))['then'](function(_0x3279bf){if(_0x3279bf){_0x4de412=_0x3279bf['get']({'plain':!![]});_0x27d101['model']=_[_0x70ba('0x30')](db[_0x70ba('0x58')][_0x70ba('0x2e')]);_0x27d101[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x3717a0[_0x70ba('0x31')]);_0x27d101[_0x70ba('0x32')]=_['intersection'](_0x27d101[_0x70ba('0x2f')],_0x27d101[_0x70ba('0x31')]);_0x8ab9c6[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0x27d101[_0x70ba('0x2f')],qs[_0x70ba('0x47')](_0x3717a0['query'][_0x70ba('0x47')]));_0x8ab9c6['attributes']=_0x8ab9c6[_0x70ba('0x34')]['length']?_0x8ab9c6[_0x70ba('0x34')]:_0x27d101[_0x70ba('0x2f')];if(!_0x3717a0[_0x70ba('0x31')][_0x70ba('0x59')](_0x70ba('0x36'))){_0x8ab9c6[_0x70ba('0x21')]=qs['limit'](_0x3717a0[_0x70ba('0x31')]['limit']);_0x8ab9c6['offset']=qs[_0x70ba('0x20')](_0x3717a0[_0x70ba('0x31')]['offset']);}_0x8ab9c6[_0x70ba('0x37')]=qs['sort'](_0x3717a0[_0x70ba('0x31')][_0x70ba('0x38')]);_0x8ab9c6[_0x70ba('0x3a')]=qs['filters'](_[_0x70ba('0x5a')](_0x3717a0['query'],_0x27d101[_0x70ba('0x32')]));_0x8ab9c6['where'][_0x70ba('0x5b')]=_0x3279bf['id'];if(_0x3717a0[_0x70ba('0x31')][_0x70ba('0x39')]){_0x8ab9c6[_0x70ba('0x3a')]=_['merge'](_0x8ab9c6[_0x70ba('0x3a')],{'$or':_['map'](_0x8ab9c6[_0x70ba('0x34')],function(_0x28e490){var _0x1b69d7={};_0x1b69d7[_0x28e490]={'$like':'%'+_0x3717a0[_0x70ba('0x31')]['filter']+'%'};return _0x1b69d7;})});}_0x8ab9c6=_[_0x70ba('0x3b')]({},_0x8ab9c6,_0x3717a0[_0x70ba('0x40')]);return db[_0x70ba('0x58')][_0x70ba('0x43')](_0x8ab9c6);}})[_0x70ba('0x28')](function(_0x42c42f){if(_0x42c42f){return db[_0x70ba('0x5c')][_0x70ba('0x5d')]({'where':{'id':_['map'](_0x42c42f,_0x70ba('0x5e')),'role':_0x70ba('0x5f')},'attributes':['id',_0x70ba('0x60'),_0x70ba('0x61'),_0x70ba('0x62'),_0x70ba('0x63')]});}})[_0x70ba('0x28')](function(_0x4d83ab){if(_0x4d83ab){return{'count':_0x4d83ab[_0x70ba('0x1f')],'rows':_[_0x70ba('0x64')](_0x4d83ab[_0x70ba('0x44')],function(_0x139e9a){return{'membername':_0x139e9a[_0x70ba('0x60')],'UserId':_0x139e9a['id'],'queue_name':_0x4de412[_0x70ba('0x60')],'SmsQueueId':_0x4de412['id'],'interface':util[_0x70ba('0x65')](_0x70ba('0x66'),'SIP',_0x139e9a['name']),'penalty':0x0,'paused':_0x139e9a[_0x70ba('0x61')],'createdAt':_0x139e9a[_0x70ba('0x63')],'updatedAt':_0x139e9a[_0x70ba('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x44cb31,_0x8ab9c6))[_0x70ba('0x45')](handleError(_0x44cb31,null));};exports[_0x70ba('0x67')]=function(_0x6df701,_0x4985be,_0x3e341a){var _0x31f911={};var _0xa9009d={};var _0x466a8b;var _0x3877ce;return db[_0x70ba('0x2d')][_0x70ba('0x57')]({'where':{'id':_0x6df701['params']['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x4985be,null))['then'](function(_0x5a6009){if(_0x5a6009){_0x466a8b=_0x5a6009;_0xa9009d[_0x70ba('0x2f')]=_[_0x70ba('0x30')](db[_0x70ba('0x68')][_0x70ba('0x2e')]);_0xa9009d[_0x70ba('0x31')]=_[_0x70ba('0x30')](_0x6df701[_0x70ba('0x31')]);_0xa9009d[_0x70ba('0x32')]=_['intersection'](_0xa9009d[_0x70ba('0x2f')],_0xa9009d[_0x70ba('0x31')]);_0x31f911[_0x70ba('0x34')]=_['intersection'](_0xa9009d['model'],qs['fields'](_0x6df701[_0x70ba('0x31')]['fields']));_0x31f911['attributes']=_0x31f911['attributes'][_0x70ba('0x35')]?_0x31f911[_0x70ba('0x34')]:_0xa9009d[_0x70ba('0x2f')];_0x31f911[_0x70ba('0x37')]=qs[_0x70ba('0x38')](_0x6df701['query']['sort']);_0x31f911[_0x70ba('0x3a')]=qs[_0x70ba('0x32')](_['pick'](_0x6df701[_0x70ba('0x31')],_0xa9009d[_0x70ba('0x32')]));if(_0x6df701[_0x70ba('0x31')]['filter']){_0x31f911[_0x70ba('0x3a')]=_['merge'](_0x31f911[_0x70ba('0x3a')],{'$or':_[_0x70ba('0x64')](_0x31f911['attributes'],function(_0xf8e8){var _0x5d6dcb={};_0x5d6dcb[_0xf8e8]={'$like':'%'+_0x6df701[_0x70ba('0x31')][_0x70ba('0x39')]+'%'};return _0x5d6dcb;})});}_0x31f911=_['merge']({},_0x31f911,_0x6df701[_0x70ba('0x40')]);return _0x466a8b[_0x70ba('0x67')](_0x31f911);}})[_0x70ba('0x28')](function(_0xb3c58c){if(_0xb3c58c){_0x3877ce=_0xb3c58c[_0x70ba('0x35')];if(!_0x6df701[_0x70ba('0x31')][_0x70ba('0x59')](_0x70ba('0x36'))){_0x31f911[_0x70ba('0x21')]=qs[_0x70ba('0x21')](_0x6df701['query'][_0x70ba('0x21')]);_0x31f911[_0x70ba('0x20')]=qs[_0x70ba('0x20')](_0x6df701[_0x70ba('0x31')]['offset']);}return _0x466a8b[_0x70ba('0x67')](_0x31f911);}})['then'](function(_0x1ced9f){if(_0x1ced9f){return _0x1ced9f?{'count':_0x3877ce,'rows':_0x1ced9f}:null;}})['then'](respondWithResult(_0x4985be,null))[_0x70ba('0x45')](handleError(_0x4985be,null));};exports[_0x70ba('0x69')]=function(_0x56a430,_0x15a587,_0x849a57){var _0x8608f9=_0x56a430[_0x70ba('0x4a')][_0x70ba('0x6a')];return db[_0x70ba('0x68')][_0x70ba('0x43')]({'where':{'id':_[_0x70ba('0x64')](_0x8608f9,'id')},'attributes':['id'],'include':[{'model':db['User'],'as':_0x70ba('0x6b'),'attributes':['id',_0x70ba('0x60'),_0x70ba('0x6c'),_0x70ba('0x6d'),_0x70ba('0x6e')],'raw':!![]}]})[_0x70ba('0x28')](function(_0x263f33){if(_0x263f33){var _0x352146=_['flatMap'](_0x263f33,function(_0x17c4d1){var _0x3b4ee6=_0x17c4d1[_0x70ba('0x4c')]({'plain':!![]});return _0x3b4ee6['Agents'];});return db[_0x70ba('0x2d')][_0x70ba('0x48')]({'where':{'id':_0x56a430[_0x70ba('0x46')]['id']}})['then'](function(_0x5f29d0){return db[_0x70ba('0x6f')]['transaction'](function(_0x5e6759){return _0x5f29d0[_0x70ba('0x69')](_[_0x70ba('0x64')](_0x8608f9,'id'),{'transaction':_0x5e6759})[_0x70ba('0x28')](function(){return BPromise[_0x70ba('0x70')](_0x352146,function(_0x1eec17){return db[_0x70ba('0x58')]['findOrCreate']({'where':{'UserId':_0x1eec17['id'],'SmsQueueId':_0x56a430['params']['id']},'transaction':_0x5e6759});});})[_0x70ba('0x28')](function(){_0x352146[_0x70ba('0x71')](function(_0xa9e109){socket[_0x70ba('0x72')]('userSmsQueue:save',{'UserId':_0xa9e109['id'],'SmsQueueId':_0x5f29d0['id']});});});});});}})[_0x70ba('0x28')](respondWithStatusCode(_0x15a587,null))[_0x70ba('0x45')](handleError(_0x15a587,null));};exports[_0x70ba('0x73')]=function(_0xa1e932,_0x1aefed,_0x3e3e45){return db[_0x70ba('0x68')][_0x70ba('0x43')]({'where':{'id':_0xa1e932[_0x70ba('0x31')][_0x70ba('0x74')]},'attributes':['id'],'include':[{'model':db[_0x70ba('0x5c')],'as':_0x70ba('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x70ba('0x28')](handleEntityNotFound(_0x1aefed,null))[_0x70ba('0x28')](function(_0x53df7a){var _0x45bf67=_[_0x70ba('0x64')](_0x53df7a,'id');var _0x407b29=[];var _0x48efcc=[];var _0x5f2e0a=squel['select']();_0x5f2e0a[_0x70ba('0x3f')](_0x70ba('0x75'))[_0x70ba('0x76')](_0x70ba('0x77'),'tq')['join'](_0x70ba('0x78'),'ut',_0x70ba('0x79'))[_0x70ba('0x3a')](_0x70ba('0x7a'),_0xa1e932['params']['id']);for(var _0x488a4b=0x0;_0x488a4b<_0x53df7a['length'];_0x488a4b+=0x1){let _0x443ecb=_0x53df7a[_0x488a4b];for(var _0x5deba6=0x0;_0x5deba6<_0x443ecb[_0x70ba('0x6b')]['length'];_0x5deba6+=0x1){let _0x81bf0a=_0x443ecb[_0x70ba('0x6b')][_0x5deba6];var _0x4f9d65=_0x5f2e0a['clone']();_0x4f9d65[_0x70ba('0x3a')]('ut.UserId\x20=\x20?',_0x81bf0a['id']);_0x48efcc['push'](db[_0x70ba('0x6f')][_0x70ba('0x31')](_0x4f9d65[_0x70ba('0x7b')](),{'type':db[_0x70ba('0x6f')][_0x70ba('0x7c')][_0x70ba('0x7d')]})[_0x70ba('0x28')](function(_0x2c9391){if(_0x2c9391[_0x70ba('0x35')]===0x1){return _0x81bf0a['id'];}else{var _0x26c4a7=_[_0x70ba('0x7e')](_[_0x70ba('0x64')](_0x2c9391,_0x70ba('0x7f')),function(_0x3fcab5){return _[_0x70ba('0x80')](_0x45bf67,_0x3fcab5);});if(_0x26c4a7){return _0x81bf0a['id'];}}}));}}return BPromise['all'](_0x48efcc)[_0x70ba('0x28')](function(_0x3783f7){_0x407b29=_(_0x407b29)[_0x70ba('0x81')](_0x3783f7)['compact']()[_0x70ba('0x82')]();return db[_0x70ba('0x2d')]['find']({'where':{'id':_0xa1e932[_0x70ba('0x46')]['id']}})['then'](function(_0x4cf238){return db[_0x70ba('0x6f')]['transaction'](function(_0x33f16b){return _0x4cf238['removeTeams'](_0xa1e932[_0x70ba('0x31')][_0x70ba('0x74')],{'transaction':_0x33f16b})[_0x70ba('0x28')](function(){if(!_[_0x70ba('0x83')](_0x407b29)){return _0x4cf238[_0x70ba('0x84')](_0x407b29,{'transaction':_0x33f16b});}})[_0x70ba('0x28')](function(){_0x407b29[_0x70ba('0x71')](function(_0x360b23){socket[_0x70ba('0x72')]('userSmsQueue:remove',{'UserId':_0x360b23,'SmsQueueId':_0x4cf238['id']});});});});});});})[_0x70ba('0x28')](respondWithStatusCode(_0x1aefed,null))['catch'](handleError(_0x1aefed,null));};exports[_0x70ba('0x85')]=function(_0x2ad5a6,_0x14c624,_0x1359cc){return db[_0x70ba('0x2d')][_0x70ba('0x48')]({'where':{'id':_0x2ad5a6[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x14c624,null))[_0x70ba('0x28')](function(_0x5ebb9a){if(_0x5ebb9a){return _0x5ebb9a['addAgents'](_0x2ad5a6['body'][_0x70ba('0x74')],_['omit'](_0x2ad5a6[_0x70ba('0x4a')],[_0x70ba('0x74'),'id'])||{})[_0x70ba('0x86')](function(_0x5cbf63){for(var _0x1fc1a3=0x0;_0x1fc1a3<_0x2ad5a6[_0x70ba('0x4a')][_0x70ba('0x74')][_0x70ba('0x35')];_0x1fc1a3+=0x1){socket[_0x70ba('0x72')](_0x70ba('0x87'),{'UserId':_0x2ad5a6['body']['ids'][_0x1fc1a3],'SmsQueueId':_0x2ad5a6[_0x70ba('0x46')]['id']});}return _0x5cbf63;});}})[_0x70ba('0x28')](respondWithResult(_0x14c624,null))['catch'](handleError(_0x14c624,null));};exports[_0x70ba('0x84')]=function(_0x5905df,_0xe5e6ff,_0x2ef0af){return db['SmsQueue'][_0x70ba('0x48')]({'where':{'id':_0x5905df[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0xe5e6ff,null))[_0x70ba('0x28')](function(_0x4bb009){if(_0x4bb009){return _0x4bb009[_0x70ba('0x84')](_0x5905df[_0x70ba('0x31')][_0x70ba('0x74')])[_0x70ba('0x28')](function(){if(_['isArray'](_0x5905df[_0x70ba('0x31')][_0x70ba('0x74')])){for(var _0xeed7d5=0x0;_0xeed7d5<_0x5905df[_0x70ba('0x31')]['ids']['length'];_0xeed7d5+=0x1){socket[_0x70ba('0x72')](_0x70ba('0x88'),{'UserId':Number(_0x5905df['query'][_0x70ba('0x74')][_0xeed7d5]),'SmsQueueId':Number(_0x5905df[_0x70ba('0x46')]['id'])});}}else{socket[_0x70ba('0x72')](_0x70ba('0x88'),{'UserId':Number(_0x5905df[_0x70ba('0x31')][_0x70ba('0x74')]),'SmsQueueId':Number(_0x5905df[_0x70ba('0x46')]['id'])});}});}})[_0x70ba('0x28')](respondWithStatusCode(_0xe5e6ff,null))[_0x70ba('0x45')](handleError(_0xe5e6ff,null));};exports[_0x70ba('0x89')]=function(_0x2740ac,_0x2772f2,_0x1d90be){var _0xa83ff8={};var _0xf94e68={};var _0x203622;var _0x459a61;return db['SmsQueue'][_0x70ba('0x57')]({'where':{'id':_0x2740ac[_0x70ba('0x46')]['id']}})[_0x70ba('0x28')](handleEntityNotFound(_0x2772f2,null))[_0x70ba('0x28')](function(_0x322af0){if(_0x322af0){_0x203622=_0x322af0;_0xf94e68[_0x70ba('0x2f')]=_[_0x70ba('0x30')](db['User']['rawAttributes']);_0xf94e68[_0x70ba('0x31')]=_['keys'](_0x2740ac[_0x70ba('0x31')]);_0xf94e68[_0x70ba('0x32')]=_[_0x70ba('0x33')](_0xf94e68[_0x70ba('0x2f')],_0xf94e68[_0x70ba('0x31')]);_0xa83ff8[_0x70ba('0x34')]=_[_0x70ba('0x33')](_0xf94e68['model'],qs[_0x70ba('0x47')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x47')]));_0xa83ff8[_0x70ba('0x34')]=_0xa83ff8[_0x70ba('0x34')][_0x70ba('0x35')]?_0xa83ff8['attributes']:_0xf94e68[_0x70ba('0x2f')];_0xa83ff8[_0x70ba('0x37')]=qs[_0x70ba('0x38')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x38')]);_0xa83ff8[_0x70ba('0x3a')]=qs[_0x70ba('0x32')](_['pick'](_0x2740ac['query'],_0xf94e68[_0x70ba('0x32')]));if(_0x2740ac[_0x70ba('0x31')]['filter']){_0xa83ff8[_0x70ba('0x3a')]=_['merge'](_0xa83ff8[_0x70ba('0x3a')],{'$or':_[_0x70ba('0x64')](_0xa83ff8[_0x70ba('0x34')],function(_0x49aa28){var _0x4206b0={};_0x4206b0[_0x49aa28]={'$like':'%'+_0x2740ac[_0x70ba('0x31')][_0x70ba('0x39')]+'%'};return _0x4206b0;})});}_0xa83ff8=_[_0x70ba('0x3b')]({},_0xa83ff8,_0x2740ac[_0x70ba('0x40')]);return _0x203622['getAgents'](_0xa83ff8);}})[_0x70ba('0x28')](function(_0x237d3b){if(_0x237d3b){_0x459a61=_0x237d3b[_0x70ba('0x35')];if(!_0x2740ac['query'][_0x70ba('0x59')](_0x70ba('0x36'))){_0xa83ff8['limit']=qs[_0x70ba('0x21')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x21')]);_0xa83ff8[_0x70ba('0x20')]=qs[_0x70ba('0x20')](_0x2740ac[_0x70ba('0x31')][_0x70ba('0x20')]);}return _0x203622[_0x70ba('0x89')](_0xa83ff8);}})[_0x70ba('0x28')](function(_0x48c6c0){if(_0x48c6c0){return _0x48c6c0?{'count':_0x459a61,'rows':_0x48c6c0}:null;}})[_0x70ba('0x28')](respondWithResult(_0x2772f2,null))[_0x70ba('0x45')](handleError(_0x2772f2,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 42c6cae..a1bdfb6 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 _0x641a=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue'];(function(_0x2f7729,_0x2f3aa8){var _0x1196b0=function(_0xc047d0){while(--_0xc047d0){_0x2f7729['push'](_0x2f7729['shift']());}};_0x1196b0(++_0x2f3aa8);}(_0x641a,0x96));var _0xa641=function(_0x1714b2,_0x5b728){_0x1714b2=_0x1714b2-0x0;var _0x510d01=_0x641a[_0x1714b2];return _0x510d01;};'use strict';var EventEmitter=require(_0xa641('0x0'));var SmsQueue=require(_0xa641('0x1'))['db'][_0xa641('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa641('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa641('0x4')};function emitEvent(_0x3e156d){return function(_0x289726,_0x1f930d,_0x1ec755){SmsQueueEvents[_0xa641('0x5')](_0x3e156d+':'+_0x289726['id'],_0x289726);SmsQueueEvents[_0xa641('0x5')](_0x3e156d,_0x289726);_0x1ec755(null);};}for(var e in events){if(events[_0xa641('0x6')](e)){var event=events[e];SmsQueue[_0xa641('0x7')](e,emitEvent(event));}}module[_0xa641('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x10a6=['emit','hook','exports','events','SmsQueue','setMaxListeners','save','update','remove'];(function(_0x4cb487,_0x1502f3){var _0x4eabd9=function(_0x2842f3){while(--_0x2842f3){_0x4cb487['push'](_0x4cb487['shift']());}};_0x4eabd9(++_0x1502f3);}(_0x10a6,0x1e0));var _0x610a=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x10a6[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0x610a('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x610a('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x610a('0x2')](0x0);var events={'afterCreate':_0x610a('0x3'),'afterUpdate':_0x610a('0x4'),'afterDestroy':_0x610a('0x5')};function emitEvent(_0x30a39d){return function(_0x3ffeb1,_0x2cd2c7,_0x13e4d4){SmsQueueEvents[_0x610a('0x6')](_0x30a39d+':'+_0x3ffeb1['id'],_0x3ffeb1);SmsQueueEvents[_0x610a('0x6')](_0x30a39d,_0x3ffeb1);_0x13e4d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x610a('0x7')](e,emitEvent(event));}}module[_0x610a('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 05fc913..36cb840 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 _0x2581=['request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x382de2,_0xd49ce3){var _0x3b6fc6=function(_0x23536c){while(--_0x23536c){_0x382de2['push'](_0x382de2['shift']());}};_0x3b6fc6(++_0xd49ce3);}(_0x2581,0xcb));var _0x1258=function(_0x51ba9a,_0x3c5fb7){_0x51ba9a=_0x51ba9a-0x0;var _0x25eed7=_0x2581[_0x51ba9a];return _0x25eed7;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var logger=require(_0x1258('0x2'))(_0x1258('0x3'));var moment=require(_0x1258('0x4'));var BPromise=require('bluebird');var rp=require(_0x1258('0x5'));var fs=require('fs');var path=require(_0x1258('0x6'));var rimraf=require(_0x1258('0x7'));var config=require(_0x1258('0x8'));var attributes=require(_0x1258('0x9'));module[_0x1258('0xa')]=function(_0x16c926,_0x2aeafc){return _0x16c926['define'](_0x1258('0xb'),attributes,{'tableName':_0x1258('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb511=['rimraf','../../config/environment','exports','define','SmsQueue','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb511,0x165));var _0x1b51=function(_0x5231da,_0x4f4898){_0x5231da=_0x5231da-0x0;var _0x1a36c1=_0xb511[_0x5231da];return _0x1a36c1;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var logger=require(_0x1b51('0x2'))('api');var moment=require(_0x1b51('0x3'));var BPromise=require(_0x1b51('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1b51('0x5'));var rimraf=require(_0x1b51('0x6'));var config=require(_0x1b51('0x7'));var attributes=require('./smsQueue.attributes');module[_0x1b51('0x8')]=function(_0x463bec,_0x506653){return _0x463bec[_0x1b51('0x9')](_0x1b51('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index cde7ef0..e6fd154 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 _0x8e6a=['attributes','limit','include','map','model','GetSmsQueue','ShowSmsQueue','SmsQueue','find','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where'];(function(_0x567ef8,_0x835b91){var _0x4ec817=function(_0x2a78ce){while(--_0x2a78ce){_0x567ef8['push'](_0x567ef8['shift']());}};_0x4ec817(++_0x835b91);}(_0x8e6a,0x105));var _0xa8e6=function(_0x12f70f,_0x497a9a){_0x12f70f=_0x12f70f-0x0;var _0x52ab1f=_0x8e6a[_0x12f70f];return _0x52ab1f;};'use strict';var _=require(_0xa8e6('0x0'));var util=require(_0xa8e6('0x1'));var moment=require('moment');var BPromise=require(_0xa8e6('0x2'));var rs=require(_0xa8e6('0x3'));var fs=require('fs');var Redis=require(_0xa8e6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa8e6('0x5'));var logger=require(_0xa8e6('0x6'))('rpc');var config=require(_0xa8e6('0x7'));var jayson=require(_0xa8e6('0x8'));var client=jayson[_0xa8e6('0x9')][_0xa8e6('0xa')]({'port':0x232a});config[_0xa8e6('0xb')]=_[_0xa8e6('0xc')](config[_0xa8e6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa8e6('0xd'))(new Redis(config['redis']));require(_0xa8e6('0xe'))[_0xa8e6('0xf')](socket);function respondWithRpcPromise(_0x11a9b0,_0xa86791,_0x584433){return new BPromise(function(_0x7976f6,_0x21c487){return client[_0xa8e6('0x10')](_0x11a9b0,_0x584433)[_0xa8e6('0x11')](function(_0x580db1){logger[_0xa8e6('0x12')](_0xa8e6('0x13'),_0xa86791,_0xa8e6('0x14'));logger[_0xa8e6('0x15')](_0xa8e6('0x16'),_0xa86791,_0xa8e6('0x14'),JSON[_0xa8e6('0x17')](_0x580db1));if(_0x580db1[_0xa8e6('0x18')]){if(_0x580db1[_0xa8e6('0x18')][_0xa8e6('0x19')]===0x1f4){logger[_0xa8e6('0x18')](_0xa8e6('0x13'),_0xa86791,_0x580db1['error']['message']);return _0x21c487(_0x580db1[_0xa8e6('0x18')][_0xa8e6('0x1a')]);}logger[_0xa8e6('0x18')](_0xa8e6('0x13'),_0xa86791,_0x580db1['error'][_0xa8e6('0x1a')]);return _0x7976f6(_0x580db1[_0xa8e6('0x18')]['message']);}else{logger[_0xa8e6('0x12')]('SmsQueue,\x20%s,\x20%s',_0xa86791,_0xa8e6('0x14'));_0x7976f6(_0x580db1[_0xa8e6('0x1b')][_0xa8e6('0x1a')]);}})[_0xa8e6('0x1c')](function(_0x2ceb5e){logger[_0xa8e6('0x18')](_0xa8e6('0x13'),_0xa86791,_0x2ceb5e);_0x21c487(_0x2ceb5e);});});}exports['GetSmsQueue']=function(_0x2098af){var _0x3b5b83=this;return new Promise(function(_0x3ad4e3,_0x3697e4){return db['SmsQueue'][_0xa8e6('0x1d')]({'raw':_0x2098af[_0xa8e6('0x1e')]?_0x2098af[_0xa8e6('0x1e')][_0xa8e6('0x1f')]===undefined?!![]:![]:!![],'where':_0x2098af[_0xa8e6('0x1e')]?_0x2098af[_0xa8e6('0x1e')][_0xa8e6('0x20')]||null:null,'attributes':_0x2098af[_0xa8e6('0x1e')]?_0x2098af[_0xa8e6('0x1e')][_0xa8e6('0x21')]||null:null,'limit':_0x2098af[_0xa8e6('0x1e')]?_0x2098af[_0xa8e6('0x1e')][_0xa8e6('0x22')]||null:null,'include':_0x2098af[_0xa8e6('0x1e')]?_0x2098af[_0xa8e6('0x1e')][_0xa8e6('0x23')]?_[_0xa8e6('0x24')](_0x2098af[_0xa8e6('0x1e')][_0xa8e6('0x23')],function(_0x3ae558){return{'model':db[_0x3ae558[_0xa8e6('0x25')]],'as':_0x3ae558['as'],'attributes':_0x3ae558[_0xa8e6('0x21')],'include':_0x3ae558['include']?_[_0xa8e6('0x24')](_0x3ae558['include'],function(_0x243e4a){return{'model':db[_0x243e4a[_0xa8e6('0x25')]],'as':_0x243e4a['as'],'attributes':_0x243e4a[_0xa8e6('0x21')],'include':_0x243e4a[_0xa8e6('0x23')]?_[_0xa8e6('0x24')](_0x243e4a['include'],function(_0x5d9f26){return{'model':db[_0x5d9f26[_0xa8e6('0x25')]],'as':_0x5d9f26['as'],'attributes':_0x5d9f26['attributes']};}):[]};}):[]};}):[]:[]})[_0xa8e6('0x11')](function(_0x5981aa){logger['info']('GetSmsQueue',_0x2098af);logger[_0xa8e6('0x15')](_0xa8e6('0x26'),_0x2098af,JSON[_0xa8e6('0x17')](_0x5981aa));_0x3ad4e3(_0x5981aa);})[_0xa8e6('0x1c')](function(_0x2f5125){logger[_0xa8e6('0x18')](_0xa8e6('0x26'),_0x2f5125['message'],_0x2098af);_0x3697e4(_0x3b5b83[_0xa8e6('0x18')](0x1f4,_0x2f5125['message']));});});};exports[_0xa8e6('0x27')]=function(_0x3c0300){var _0x3193ca=this;return new Promise(function(_0x523fe5,_0x5a6f92){return db[_0xa8e6('0x28')][_0xa8e6('0x29')]({'raw':_0x3c0300[_0xa8e6('0x1e')]?_0x3c0300[_0xa8e6('0x1e')][_0xa8e6('0x1f')]===undefined?!![]:![]:!![],'where':_0x3c0300[_0xa8e6('0x1e')]?_0x3c0300[_0xa8e6('0x1e')][_0xa8e6('0x20')]||null:null,'attributes':_0x3c0300[_0xa8e6('0x1e')]?_0x3c0300[_0xa8e6('0x1e')][_0xa8e6('0x21')]||null:null,'include':_0x3c0300[_0xa8e6('0x1e')]?_0x3c0300[_0xa8e6('0x1e')][_0xa8e6('0x23')]?_[_0xa8e6('0x24')](_0x3c0300[_0xa8e6('0x1e')]['include'],function(_0x322f05){return{'model':db[_0x322f05[_0xa8e6('0x25')]],'as':_0x322f05['as'],'attributes':_0x322f05[_0xa8e6('0x21')],'include':_0x322f05[_0xa8e6('0x23')]?_[_0xa8e6('0x24')](_0x322f05[_0xa8e6('0x23')],function(_0x5f59bc){return{'model':db[_0x5f59bc[_0xa8e6('0x25')]],'as':_0x5f59bc['as'],'attributes':_0x5f59bc['attributes'],'include':_0x5f59bc[_0xa8e6('0x23')]?_['map'](_0x5f59bc[_0xa8e6('0x23')],function(_0x258aa9){return{'model':db[_0x258aa9['model']],'as':_0x258aa9['as'],'attributes':_0x258aa9[_0xa8e6('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa8e6('0x11')](function(_0x223a3f){logger['info'](_0xa8e6('0x27'),_0x3c0300);logger[_0xa8e6('0x15')]('ShowSmsQueue',_0x3c0300,JSON[_0xa8e6('0x17')](_0x223a3f));_0x523fe5(_0x223a3f);})[_0xa8e6('0x1c')](function(_0x255fbf){logger[_0xa8e6('0x18')](_0xa8e6('0x27'),_0x255fbf[_0xa8e6('0x1a')],_0x3c0300);_0x5a6f92(_0x3193ca[_0xa8e6('0x18')](0x1f4,_0x255fbf[_0xa8e6('0x1a')]));});});}; \ No newline at end of file +var _0x5c85=['options','where','attributes','limit','include','map','model','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','register','request','then','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsQueue,\x20%s,\x20%s','message','info','result','catch','GetSmsQueue','SmsQueue','findAll'];(function(_0x53f707,_0x51a2f7){var _0x10a9f5=function(_0x14b513){while(--_0x14b513){_0x53f707['push'](_0x53f707['shift']());}};_0x10a9f5(++_0x51a2f7);}(_0x5c85,0xc1));var _0x55c8=function(_0x4d0449,_0x12acb2){_0x4d0449=_0x4d0449-0x0;var _0x4b44c8=_0x5c85[_0x4d0449];return _0x4b44c8;};'use strict';var _=require(_0x55c8('0x0'));var util=require(_0x55c8('0x1'));var moment=require(_0x55c8('0x2'));var BPromise=require(_0x55c8('0x3'));var rs=require(_0x55c8('0x4'));var fs=require('fs');var Redis=require(_0x55c8('0x5'));var db=require(_0x55c8('0x6'))['db'];var utils=require(_0x55c8('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x55c8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x55c8('0x9')]({'port':0x232a});config[_0x55c8('0xa')]=_[_0x55c8('0xb')](config['redis'],{'host':_0x55c8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x55c8('0xa')]));require('./smsQueue.socket')[_0x55c8('0xd')](socket);function respondWithRpcPromise(_0x316791,_0x80f28e,_0x3064dc){return new BPromise(function(_0x26ed35,_0x1e548d){return client[_0x55c8('0xe')](_0x316791,_0x3064dc)[_0x55c8('0xf')](function(_0x3f994f){logger['info']('SmsQueue,\x20%s,\x20%s',_0x80f28e,'request\x20sent');logger[_0x55c8('0x10')](_0x55c8('0x11'),_0x80f28e,_0x55c8('0x12'),JSON[_0x55c8('0x13')](_0x3f994f));if(_0x3f994f[_0x55c8('0x14')]){if(_0x3f994f[_0x55c8('0x14')]['code']===0x1f4){logger['error'](_0x55c8('0x15'),_0x80f28e,_0x3f994f[_0x55c8('0x14')][_0x55c8('0x16')]);return _0x1e548d(_0x3f994f['error'][_0x55c8('0x16')]);}logger[_0x55c8('0x14')]('SmsQueue,\x20%s,\x20%s',_0x80f28e,_0x3f994f[_0x55c8('0x14')]['message']);return _0x26ed35(_0x3f994f[_0x55c8('0x14')][_0x55c8('0x16')]);}else{logger[_0x55c8('0x17')](_0x55c8('0x15'),_0x80f28e,_0x55c8('0x12'));_0x26ed35(_0x3f994f[_0x55c8('0x18')]['message']);}})[_0x55c8('0x19')](function(_0x1e83ef){logger[_0x55c8('0x14')](_0x55c8('0x15'),_0x80f28e,_0x1e83ef);_0x1e548d(_0x1e83ef);});});}exports[_0x55c8('0x1a')]=function(_0x3397de){var _0x8f3932=this;return new Promise(function(_0xe07cfe,_0x477e5a){return db[_0x55c8('0x1b')][_0x55c8('0x1c')]({'raw':_0x3397de[_0x55c8('0x1d')]?_0x3397de[_0x55c8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3397de[_0x55c8('0x1d')]?_0x3397de[_0x55c8('0x1d')][_0x55c8('0x1e')]||null:null,'attributes':_0x3397de['options']?_0x3397de['options'][_0x55c8('0x1f')]||null:null,'limit':_0x3397de[_0x55c8('0x1d')]?_0x3397de[_0x55c8('0x1d')][_0x55c8('0x20')]||null:null,'include':_0x3397de[_0x55c8('0x1d')]?_0x3397de['options'][_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x3397de['options'][_0x55c8('0x21')],function(_0x1dbef2){return{'model':db[_0x1dbef2[_0x55c8('0x23')]],'as':_0x1dbef2['as'],'attributes':_0x1dbef2['attributes'],'include':_0x1dbef2[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x1dbef2['include'],function(_0x2e25f1){return{'model':db[_0x2e25f1[_0x55c8('0x23')]],'as':_0x2e25f1['as'],'attributes':_0x2e25f1['attributes'],'include':_0x2e25f1[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x2e25f1[_0x55c8('0x21')],function(_0x29963f){return{'model':db[_0x29963f['model']],'as':_0x29963f['as'],'attributes':_0x29963f[_0x55c8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x55c8('0xf')](function(_0x2118cf){logger['info'](_0x55c8('0x1a'),_0x3397de);logger[_0x55c8('0x10')](_0x55c8('0x1a'),_0x3397de,JSON[_0x55c8('0x13')](_0x2118cf));_0xe07cfe(_0x2118cf);})['catch'](function(_0x2b179a){logger[_0x55c8('0x14')](_0x55c8('0x1a'),_0x2b179a['message'],_0x3397de);_0x477e5a(_0x8f3932[_0x55c8('0x14')](0x1f4,_0x2b179a[_0x55c8('0x16')]));});});};exports[_0x55c8('0x24')]=function(_0x996580){var _0x3f5215=this;return new Promise(function(_0x71aa89,_0x2f5598){return db[_0x55c8('0x1b')]['find']({'raw':_0x996580[_0x55c8('0x1d')]?_0x996580[_0x55c8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x996580[_0x55c8('0x1d')]?_0x996580[_0x55c8('0x1d')][_0x55c8('0x1e')]||null:null,'attributes':_0x996580[_0x55c8('0x1d')]?_0x996580['options'][_0x55c8('0x1f')]||null:null,'include':_0x996580[_0x55c8('0x1d')]?_0x996580[_0x55c8('0x1d')]['include']?_[_0x55c8('0x22')](_0x996580[_0x55c8('0x1d')][_0x55c8('0x21')],function(_0x364ef2){return{'model':db[_0x364ef2[_0x55c8('0x23')]],'as':_0x364ef2['as'],'attributes':_0x364ef2[_0x55c8('0x1f')],'include':_0x364ef2[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0x364ef2[_0x55c8('0x21')],function(_0xa7348a){return{'model':db[_0xa7348a[_0x55c8('0x23')]],'as':_0xa7348a['as'],'attributes':_0xa7348a[_0x55c8('0x1f')],'include':_0xa7348a[_0x55c8('0x21')]?_[_0x55c8('0x22')](_0xa7348a[_0x55c8('0x21')],function(_0x5ae700){return{'model':db[_0x5ae700['model']],'as':_0x5ae700['as'],'attributes':_0x5ae700[_0x55c8('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x55c8('0xf')](function(_0x57ead9){logger[_0x55c8('0x17')](_0x55c8('0x24'),_0x996580);logger[_0x55c8('0x10')](_0x55c8('0x24'),_0x996580,JSON['stringify'](_0x57ead9));_0x71aa89(_0x57ead9);})[_0x55c8('0x19')](function(_0x5117aa){logger[_0x55c8('0x14')]('ShowSmsQueue',_0x5117aa[_0x55c8('0x16')],_0x996580);_0x2f5598(_0x3f5215[_0x55c8('0x14')](0x1f4,_0x5117aa[_0x55c8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 596b2d3..948b53c 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 _0x0689=['update','emit','removeListener','register','smsQueue:','save'];(function(_0x729869,_0x6fecff){var _0x29cb9b=function(_0x3572d6){while(--_0x3572d6){_0x729869['push'](_0x729869['shift']());}};_0x29cb9b(++_0x6fecff);}(_0x0689,0x161));var _0x9068=function(_0x35ae3b,_0x303237){_0x35ae3b=_0x35ae3b-0x0;var _0x2c6943=_0x0689[_0x35ae3b];return _0x2c6943;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x9068('0x0'),'remove',_0x9068('0x1')];function createListener(_0xcea3b,_0x222292){return function(_0x45c9e5){_0x222292[_0x9068('0x2')](_0xcea3b,_0x45c9e5);};}function removeListener(_0x1c35ba,_0x3b12f4){return function(){SmsQueueEvents[_0x9068('0x3')](_0x1c35ba,_0x3b12f4);};}exports[_0x9068('0x4')]=function(_0x287846){for(var _0x5ce5a7=0x0,_0x34cb67=events['length'];_0x5ce5a7<_0x34cb67;_0x5ce5a7++){var _0x4bdd1b=events[_0x5ce5a7];var _0x17bc63=createListener(_0x9068('0x5')+_0x4bdd1b,_0x287846);SmsQueueEvents['on'](_0x4bdd1b,_0x17bc63);}}; \ No newline at end of file +var _0xdba3=['register','length','./smsQueue.events','save','update','emit','removeListener'];(function(_0x51f12a,_0x2371da){var _0xd378b=function(_0x5a00b0){while(--_0x5a00b0){_0x51f12a['push'](_0x51f12a['shift']());}};_0xd378b(++_0x2371da);}(_0xdba3,0x19f));var _0x3dba=function(_0xa9a402,_0x3d9102){_0xa9a402=_0xa9a402-0x0;var _0x497163=_0xdba3[_0xa9a402];return _0x497163;};'use strict';var SmsQueueEvents=require(_0x3dba('0x0'));var events=[_0x3dba('0x1'),'remove',_0x3dba('0x2')];function createListener(_0x36351d,_0x2d9be4){return function(_0x10ec9b){_0x2d9be4[_0x3dba('0x3')](_0x36351d,_0x10ec9b);};}function removeListener(_0x2a7760,_0x3e018a){return function(){SmsQueueEvents[_0x3dba('0x4')](_0x2a7760,_0x3e018a);};}exports[_0x3dba('0x5')]=function(_0x374134){for(var _0x50995d=0x0,_0xa6f5ad=events[_0x3dba('0x6')];_0x50995d<_0xa6f5ad;_0x50995d++){var _0x4ed4f8=events[_0x50995d];var _0x5c1f2a=createListener('smsQueue:'+_0x4ed4f8,_0x374134);SmsQueueEvents['on'](_0x4ed4f8,_0x5c1f2a);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 3e1068c..a7298c7 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 _0x7f94=['./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x7f94,0x65));var _0x47f9=function(_0x5c8cbd,_0x59d8fa){_0x5c8cbd=_0x5c8cbd-0x0;var _0x51da8a=_0x7f94[_0x5c8cbd];return _0x51da8a;};'use strict';var multer=require(_0x47f9('0x0'));var util=require('util');var path=require(_0x47f9('0x1'));var timeout=require(_0x47f9('0x2'));var express=require(_0x47f9('0x3'));var router=express[_0x47f9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47f9('0x5'));var config=require(_0x47f9('0x6'));var controller=require(_0x47f9('0x7'));router[_0x47f9('0x8')]('/',auth[_0x47f9('0x9')](),controller[_0x47f9('0xa')]);router[_0x47f9('0x8')]('/describe',auth[_0x47f9('0x9')](),controller[_0x47f9('0xb')]);router[_0x47f9('0x8')](_0x47f9('0xc'),auth[_0x47f9('0x9')](),controller[_0x47f9('0xd')]);router[_0x47f9('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x47f9('0x9')](),controller[_0x47f9('0xf')]);router[_0x47f9('0x10')](_0x47f9('0xc'),auth[_0x47f9('0x9')](),controller[_0x47f9('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf435=['get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsQueueReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf435,0x174));var _0x5f43=function(_0xa35025,_0x5a3c3d){_0xa35025=_0xa35025-0x0;var _0xcd1b2f=_0xf435[_0xa35025];return _0xcd1b2f;};'use strict';var multer=require('multer');var util=require(_0x5f43('0x0'));var path=require(_0x5f43('0x1'));var timeout=require(_0x5f43('0x2'));var express=require(_0x5f43('0x3'));var router=express[_0x5f43('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5f43('0x5'));var config=require(_0x5f43('0x6'));var controller=require(_0x5f43('0x7'));router[_0x5f43('0x8')]('/',auth['isAuthenticated'](),controller[_0x5f43('0x9')]);router[_0x5f43('0x8')](_0x5f43('0xa'),auth['isAuthenticated'](),controller[_0x5f43('0xb')]);router[_0x5f43('0x8')](_0x5f43('0xc'),auth[_0x5f43('0xd')](),controller[_0x5f43('0xe')]);router[_0x5f43('0xf')]('/',auth[_0x5f43('0xd')](),controller[_0x5f43('0x10')]);router[_0x5f43('0x11')](_0x5f43('0xc'),auth[_0x5f43('0xd')](),controller['update']);router['delete'](_0x5f43('0xc'),auth[_0x5f43('0xd')](),controller[_0x5f43('0x12')]);module[_0x5f43('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 4c62811..56f8cf4 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 _0x3b9f=['exports','STRING','DATE','moment','sequelize'];(function(_0x49aa7d,_0x5d46d8){var _0xdd0d26=function(_0x159df7){while(--_0x159df7){_0x49aa7d['push'](_0x49aa7d['shift']());}};_0xdd0d26(++_0x5d46d8);}(_0x3b9f,0x134));var _0xf3b9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3b9f[_0x40a045];return _0x1a687c;};'use strict';var moment=require(_0xf3b9('0x0'));var Sequelize=require(_0xf3b9('0x1'));module[_0xf3b9('0x2')]={'uniqueid':{'type':Sequelize[_0xf3b9('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf3b9('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xf3b9('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0c80=['STRING','DATE','sequelize','exports'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x0c80,0x8e));var _0x00c8=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0c80[_0x46698a];return _0x356db0;};'use strict';var moment=require('moment');var Sequelize=require(_0x00c8('0x0'));module[_0x00c8('0x1')]={'uniqueid':{'type':Sequelize[_0x00c8('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x00c8('0x2')]},'joinAt':{'type':Sequelize[_0x00c8('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 92f01bc..022f5c2 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 _0xb10d=['catch','show','length','find','create','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','name','send','index','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','rows'];(function(_0xf122c7,_0x215cef){var _0x4a9e3f=function(_0x129262){while(--_0x129262){_0xf122c7['push'](_0xf122c7['shift']());}};_0x4a9e3f(++_0x215cef);}(_0xb10d,0x17f));var _0xdb10=function(_0x219c40,_0x437941){_0x219c40=_0x219c40-0x0;var _0x26905a=_0xb10d[_0x219c40];return _0x26905a;};'use strict';var pdf=require(_0xdb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdb10('0x1'));var zipdir=require(_0xdb10('0x2'));var jsonpatch=require(_0xdb10('0x3'));var rp=require(_0xdb10('0x4'));var moment=require(_0xdb10('0x5'));var BPromise=require(_0xdb10('0x6'));var Mustache=require(_0xdb10('0x7'));var util=require(_0xdb10('0x8'));var path=require(_0xdb10('0x9'));var sox=require(_0xdb10('0xa'));var csv=require(_0xdb10('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdb10('0xc'));var squel=require(_0xdb10('0xd'));var crypto=require(_0xdb10('0xe'));var jsforce=require(_0xdb10('0xf'));var deskjs=require(_0xdb10('0x10'));var toCsv=require(_0xdb10('0xb'));var querystring=require(_0xdb10('0x11'));var Papa=require(_0xdb10('0x12'));var Redis=require(_0xdb10('0x13'));var authService=require(_0xdb10('0x14'));var qs=require(_0xdb10('0x15'));var hardwareService=require(_0xdb10('0x16'));var logger=require(_0xdb10('0x17'))(_0xdb10('0x18'));var utils=require(_0xdb10('0x19'));var config=require(_0xdb10('0x1a'));var db=require(_0xdb10('0x1b'))['db'];function respondWithStatusCode(_0xfba280,_0x36bad8){_0x36bad8=_0x36bad8||0xcc;return function(_0x3d4cda){if(_0x3d4cda){return _0xfba280[_0xdb10('0x1c')](_0x36bad8);}return _0xfba280[_0xdb10('0x1d')](_0x36bad8)[_0xdb10('0x1e')]();};}function respondWithResult(_0x22a2cb,_0x4a6978){_0x4a6978=_0x4a6978||0xc8;return function(_0x30b302){if(_0x30b302){return _0x22a2cb[_0xdb10('0x1d')](_0x4a6978)[_0xdb10('0x1f')](_0x30b302);}};}function respondWithFilteredResult(_0x3efe0e,_0x260d18){return function(_0x169a84){if(_0x169a84){var _0x489421=_0x169a84[_0xdb10('0x20')],_0x161e0d=_0x260d18[_0xdb10('0x21')],_0x21393b=_0x260d18['offset']+_0x260d18[_0xdb10('0x22')],_0x506de3;if(_0x21393b>=_0x489421){_0x21393b=_0x489421;_0x506de3=0xc8;}else{_0x506de3=0xce;}_0x3efe0e['status'](_0x506de3);return _0x3efe0e[_0xdb10('0x23')]('Content-Range',_0x161e0d+'-'+_0x21393b+'/'+_0x489421)[_0xdb10('0x1f')](_0x169a84);}return null;};}function patchUpdates(_0xe1d26e){return function(_0x2e85e0){try{jsonpatch[_0xdb10('0x24')](_0x2e85e0,_0xe1d26e,!![]);}catch(_0x5ec280){return BPromise[_0xdb10('0x25')](_0x5ec280);}return _0x2e85e0[_0xdb10('0x26')]();};}function saveUpdates(_0x51c553,_0x42c988){return function(_0x5b7409){if(_0x5b7409){return _0x5b7409[_0xdb10('0x27')](_0x51c553)[_0xdb10('0x28')](function(_0x373964){return _0x373964;});}return null;};}function removeEntity(_0xda224e,_0x1bbf8e){return function(_0x2b6244){if(_0x2b6244){return _0x2b6244[_0xdb10('0x29')]()[_0xdb10('0x28')](function(){_0xda224e[_0xdb10('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11a34b,_0x148f2b){return function(_0x5ba42a){if(!_0x5ba42a){_0x11a34b[_0xdb10('0x1c')](0x194);}return _0x5ba42a;};}function handleError(_0x7e43d,_0x199649){_0x199649=_0x199649||0x1f4;return function(_0x3d5a18){logger['error'](_0x3d5a18['stack']);if(_0x3d5a18[_0xdb10('0x2a')]){delete _0x3d5a18['name'];}_0x7e43d[_0xdb10('0x1d')](_0x199649)[_0xdb10('0x2b')](_0x3d5a18);};}exports[_0xdb10('0x2c')]=function(_0x4db7ba,_0xea9ba7){var _0x41c803={},_0xb5677={},_0xbccd7a={'count':0x0,'rows':[]};var _0xfa20a0=db[_0xdb10('0x2d')][_0xdb10('0x2e')];_0xb5677[_0xdb10('0x2f')]=_[_0xdb10('0x30')](_0xfa20a0);_0xb5677[_0xdb10('0x31')]=_[_0xdb10('0x30')](_0x4db7ba[_0xdb10('0x31')]);_0xb5677[_0xdb10('0x32')]=_[_0xdb10('0x33')](_0xb5677[_0xdb10('0x2f')],_0xb5677[_0xdb10('0x31')]);_0x41c803['attributes']=_[_0xdb10('0x33')](_0xb5677[_0xdb10('0x2f')],qs[_0xdb10('0x34')](_0x4db7ba[_0xdb10('0x31')][_0xdb10('0x34')]));_0x41c803[_0xdb10('0x35')]=_0x41c803[_0xdb10('0x35')]['length']?_0x41c803[_0xdb10('0x35')]:_0xb5677[_0xdb10('0x2f')];if(!_0x4db7ba[_0xdb10('0x31')]['hasOwnProperty']('nolimit')){_0x41c803['limit']=qs['limit'](_0x4db7ba[_0xdb10('0x31')][_0xdb10('0x22')]);_0x41c803['offset']=qs['offset'](_0x4db7ba['query'][_0xdb10('0x21')]);}_0x41c803['order']=qs[_0xdb10('0x36')](_0x4db7ba[_0xdb10('0x31')]['sort']);_0x41c803[_0xdb10('0x37')]=qs[_0xdb10('0x32')](_[_0xdb10('0x38')](_0x4db7ba['query'],_0xb5677[_0xdb10('0x32')]));if(_0x4db7ba[_0xdb10('0x31')][_0xdb10('0x39')]){_0x41c803[_0xdb10('0x37')]=_[_0xdb10('0x3a')](_0x41c803[_0xdb10('0x37')],{'$or':_[_0xdb10('0x3b')](_0xfa20a0,function(_0x271042){if(_0x271042[_0xdb10('0x3c')][_0xdb10('0x3d')]!==_0xdb10('0x3e')){var _0xa12d39={};_0xa12d39[_0x271042[_0xdb10('0x3f')]]={'$like':'%'+_0x4db7ba[_0xdb10('0x31')]['filter']+'%'};return _0xa12d39;}})});}_0x41c803=_['merge']({},_0x41c803,_0x4db7ba[_0xdb10('0x40')]);var _0x206d50={'where':_0x41c803[_0xdb10('0x37')]};return db[_0xdb10('0x2d')][_0xdb10('0x20')](_0x206d50)[_0xdb10('0x28')](function(_0x143d5a){_0xbccd7a['count']=_0x143d5a;if(_0x4db7ba['query'][_0xdb10('0x41')]){_0x41c803['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x41c803);})[_0xdb10('0x28')](function(_0x2540e1){_0xbccd7a[_0xdb10('0x42')]=_0x2540e1;return _0xbccd7a;})['then'](respondWithFilteredResult(_0xea9ba7,_0x41c803))[_0xdb10('0x43')](handleError(_0xea9ba7,null));};exports[_0xdb10('0x44')]=function(_0x1c3704,_0x3ee7f0){var _0x16e353={'raw':!![],'where':{'id':_0x1c3704['params']['id']}},_0x4529ad={};_0x4529ad[_0xdb10('0x2f')]=_[_0xdb10('0x30')](db['SmsQueueReport'][_0xdb10('0x2e')]);_0x4529ad['query']=_[_0xdb10('0x30')](_0x1c3704['query']);_0x4529ad['filters']=_[_0xdb10('0x33')](_0x4529ad[_0xdb10('0x2f')],_0x4529ad[_0xdb10('0x31')]);_0x16e353[_0xdb10('0x35')]=_[_0xdb10('0x33')](_0x4529ad[_0xdb10('0x2f')],qs[_0xdb10('0x34')](_0x1c3704[_0xdb10('0x31')][_0xdb10('0x34')]));_0x16e353['attributes']=_0x16e353['attributes'][_0xdb10('0x45')]?_0x16e353['attributes']:_0x4529ad[_0xdb10('0x2f')];if(_0x1c3704[_0xdb10('0x31')][_0xdb10('0x41')]){_0x16e353['include']=[{'all':!![]}];}_0x16e353=_[_0xdb10('0x3a')]({},_0x16e353,_0x1c3704[_0xdb10('0x40')]);return db[_0xdb10('0x2d')][_0xdb10('0x46')](_0x16e353)[_0xdb10('0x28')](handleEntityNotFound(_0x3ee7f0,null))[_0xdb10('0x28')](respondWithResult(_0x3ee7f0,null))[_0xdb10('0x43')](handleError(_0x3ee7f0,null));};exports[_0xdb10('0x47')]=function(_0x3fcb18,_0x3daf35){return db[_0xdb10('0x2d')][_0xdb10('0x47')](_0x3fcb18['body'],{})[_0xdb10('0x28')](respondWithResult(_0x3daf35,0xc9))[_0xdb10('0x43')](handleError(_0x3daf35,null));};exports[_0xdb10('0x27')]=function(_0x4c6260,_0xf3427b){if(_0x4c6260[_0xdb10('0x48')]['id']){delete _0x4c6260[_0xdb10('0x48')]['id'];}return db[_0xdb10('0x2d')][_0xdb10('0x46')]({'where':{'id':_0x4c6260[_0xdb10('0x49')]['id']}})[_0xdb10('0x28')](handleEntityNotFound(_0xf3427b,null))['then'](saveUpdates(_0x4c6260['body'],null))[_0xdb10('0x28')](respondWithResult(_0xf3427b,null))[_0xdb10('0x43')](handleError(_0xf3427b,null));};exports[_0xdb10('0x29')]=function(_0x2740d3,_0x3b2bc9){return db[_0xdb10('0x2d')][_0xdb10('0x46')]({'where':{'id':_0x2740d3[_0xdb10('0x49')]['id']}})[_0xdb10('0x28')](handleEntityNotFound(_0x3b2bc9,null))[_0xdb10('0x28')](removeEntity(_0x3b2bc9,null))[_0xdb10('0x43')](handleError(_0x3b2bc9,null));};exports[_0xdb10('0x4a')]=function(_0x460c21,_0x5121d2){return db['SmsQueueReport'][_0xdb10('0x4a')]()[_0xdb10('0x28')](respondWithResult(_0x5121d2,null))[_0xdb10('0x43')](handleError(_0x5121d2,null));}; \ No newline at end of file +var _0x3495=['../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name','index','SmsQueueReport','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','limit','order','sort','pick','filter','where','merge','VIRTUAL','field','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x58ae1c,_0x445cfe){var _0x316337=function(_0x131bef){while(--_0x131bef){_0x58ae1c['push'](_0x58ae1c['shift']());}};_0x316337(++_0x445cfe);}(_0x3495,0x1de));var _0x5349=function(_0x9a7dd6,_0x53af91){_0x9a7dd6=_0x9a7dd6-0x0;var _0x294df1=_0x3495[_0x9a7dd6];return _0x294df1;};'use strict';var pdf=require(_0x5349('0x0'));var emlformat=require(_0x5349('0x1'));var rimraf=require(_0x5349('0x2'));var zipdir=require(_0x5349('0x3'));var jsonpatch=require(_0x5349('0x4'));var rp=require(_0x5349('0x5'));var moment=require(_0x5349('0x6'));var BPromise=require(_0x5349('0x7'));var Mustache=require(_0x5349('0x8'));var util=require('util');var path=require(_0x5349('0x9'));var sox=require(_0x5349('0xa'));var csv=require('to-csv');var ejs=require(_0x5349('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5349('0xc'));var crypto=require('crypto');var jsforce=require(_0x5349('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5349('0xe'));var querystring=require(_0x5349('0xf'));var Papa=require(_0x5349('0x10'));var Redis=require(_0x5349('0x11'));var authService=require(_0x5349('0x12'));var qs=require(_0x5349('0x13'));var hardwareService=require(_0x5349('0x14'));var logger=require('../../config/logger')(_0x5349('0x15'));var utils=require('../../config/utils');var config=require(_0x5349('0x16'));var db=require(_0x5349('0x17'))['db'];function respondWithStatusCode(_0xcf06a8,_0x11d230){_0x11d230=_0x11d230||0xcc;return function(_0x2f5172){if(_0x2f5172){return _0xcf06a8[_0x5349('0x18')](_0x11d230);}return _0xcf06a8[_0x5349('0x19')](_0x11d230)[_0x5349('0x1a')]();};}function respondWithResult(_0x3227bd,_0x3890a8){_0x3890a8=_0x3890a8||0xc8;return function(_0x534e31){if(_0x534e31){return _0x3227bd[_0x5349('0x19')](_0x3890a8)[_0x5349('0x1b')](_0x534e31);}};}function respondWithFilteredResult(_0x47b25d,_0x1ed049){return function(_0x269f7f){if(_0x269f7f){var _0x2fe611=_0x269f7f[_0x5349('0x1c')],_0x49bbec=_0x1ed049['offset'],_0x5bcb3a=_0x1ed049[_0x5349('0x1d')]+_0x1ed049['limit'],_0x558fbb;if(_0x5bcb3a>=_0x2fe611){_0x5bcb3a=_0x2fe611;_0x558fbb=0xc8;}else{_0x558fbb=0xce;}_0x47b25d[_0x5349('0x19')](_0x558fbb);return _0x47b25d[_0x5349('0x1e')](_0x5349('0x1f'),_0x49bbec+'-'+_0x5bcb3a+'/'+_0x2fe611)[_0x5349('0x1b')](_0x269f7f);}return null;};}function patchUpdates(_0x4e128c){return function(_0x22d1ca){try{jsonpatch[_0x5349('0x20')](_0x22d1ca,_0x4e128c,!![]);}catch(_0x8abbe3){return BPromise[_0x5349('0x21')](_0x8abbe3);}return _0x22d1ca['save']();};}function saveUpdates(_0xeaab5a,_0x3594a4){return function(_0x4f2cb6){if(_0x4f2cb6){return _0x4f2cb6['update'](_0xeaab5a)['then'](function(_0x423581){return _0x423581;});}return null;};}function removeEntity(_0x48ba3c,_0x270593){return function(_0x1ff911){if(_0x1ff911){return _0x1ff911[_0x5349('0x22')]()[_0x5349('0x23')](function(){_0x48ba3c[_0x5349('0x19')](0xcc)[_0x5349('0x1a')]();});}};}function handleEntityNotFound(_0x303250,_0x43a0c2){return function(_0x2a3258){if(!_0x2a3258){_0x303250[_0x5349('0x18')](0x194);}return _0x2a3258;};}function handleError(_0x1a84ce,_0x52520){_0x52520=_0x52520||0x1f4;return function(_0x57af6c){logger[_0x5349('0x24')](_0x57af6c[_0x5349('0x25')]);if(_0x57af6c[_0x5349('0x26')]){delete _0x57af6c['name'];}_0x1a84ce[_0x5349('0x19')](_0x52520)['send'](_0x57af6c);};}exports[_0x5349('0x27')]=function(_0x203896,_0x1db8cc){var _0x49153e={},_0x1b5e87={},_0xc3e727={'count':0x0,'rows':[]};var _0x228dce=db[_0x5349('0x28')][_0x5349('0x29')];_0x1b5e87[_0x5349('0x2a')]=_[_0x5349('0x2b')](_0x228dce);_0x1b5e87[_0x5349('0x2c')]=_[_0x5349('0x2b')](_0x203896['query']);_0x1b5e87[_0x5349('0x2d')]=_[_0x5349('0x2e')](_0x1b5e87['model'],_0x1b5e87[_0x5349('0x2c')]);_0x49153e['attributes']=_[_0x5349('0x2e')](_0x1b5e87[_0x5349('0x2a')],qs[_0x5349('0x2f')](_0x203896[_0x5349('0x2c')][_0x5349('0x2f')]));_0x49153e[_0x5349('0x30')]=_0x49153e['attributes'][_0x5349('0x31')]?_0x49153e[_0x5349('0x30')]:_0x1b5e87[_0x5349('0x2a')];if(!_0x203896[_0x5349('0x2c')]['hasOwnProperty']('nolimit')){_0x49153e[_0x5349('0x32')]=qs[_0x5349('0x32')](_0x203896[_0x5349('0x2c')]['limit']);_0x49153e[_0x5349('0x1d')]=qs['offset'](_0x203896[_0x5349('0x2c')][_0x5349('0x1d')]);}_0x49153e[_0x5349('0x33')]=qs[_0x5349('0x34')](_0x203896[_0x5349('0x2c')][_0x5349('0x34')]);_0x49153e['where']=qs['filters'](_[_0x5349('0x35')](_0x203896[_0x5349('0x2c')],_0x1b5e87[_0x5349('0x2d')]));if(_0x203896[_0x5349('0x2c')][_0x5349('0x36')]){_0x49153e[_0x5349('0x37')]=_[_0x5349('0x38')](_0x49153e['where'],{'$or':_['map'](_0x228dce,function(_0x246f27){if(_0x246f27['type']['key']!==_0x5349('0x39')){var _0x4e5b28={};_0x4e5b28[_0x246f27[_0x5349('0x3a')]]={'$like':'%'+_0x203896[_0x5349('0x2c')][_0x5349('0x36')]+'%'};return _0x4e5b28;}})});}_0x49153e=_['merge']({},_0x49153e,_0x203896[_0x5349('0x3b')]);var _0x47a41a={'where':_0x49153e[_0x5349('0x37')]};return db[_0x5349('0x28')][_0x5349('0x1c')](_0x47a41a)['then'](function(_0x48a765){_0xc3e727['count']=_0x48a765;if(_0x203896[_0x5349('0x2c')][_0x5349('0x3c')]){_0x49153e[_0x5349('0x3d')]=[{'all':!![]}];}return db[_0x5349('0x28')][_0x5349('0x3e')](_0x49153e);})[_0x5349('0x23')](function(_0x50c506){_0xc3e727['rows']=_0x50c506;return _0xc3e727;})[_0x5349('0x23')](respondWithFilteredResult(_0x1db8cc,_0x49153e))[_0x5349('0x3f')](handleError(_0x1db8cc,null));};exports[_0x5349('0x40')]=function(_0x53f062,_0x7ca6dc){var _0x30ea46={'raw':!![],'where':{'id':_0x53f062[_0x5349('0x41')]['id']}},_0x30faff={};_0x30faff['model']=_[_0x5349('0x2b')](db['SmsQueueReport'][_0x5349('0x29')]);_0x30faff[_0x5349('0x2c')]=_['keys'](_0x53f062[_0x5349('0x2c')]);_0x30faff[_0x5349('0x2d')]=_[_0x5349('0x2e')](_0x30faff[_0x5349('0x2a')],_0x30faff[_0x5349('0x2c')]);_0x30ea46[_0x5349('0x30')]=_[_0x5349('0x2e')](_0x30faff['model'],qs['fields'](_0x53f062[_0x5349('0x2c')][_0x5349('0x2f')]));_0x30ea46[_0x5349('0x30')]=_0x30ea46[_0x5349('0x30')]['length']?_0x30ea46[_0x5349('0x30')]:_0x30faff['model'];if(_0x53f062['query'][_0x5349('0x3c')]){_0x30ea46[_0x5349('0x3d')]=[{'all':!![]}];}_0x30ea46=_[_0x5349('0x38')]({},_0x30ea46,_0x53f062[_0x5349('0x3b')]);return db['SmsQueueReport'][_0x5349('0x42')](_0x30ea46)[_0x5349('0x23')](handleEntityNotFound(_0x7ca6dc,null))[_0x5349('0x23')](respondWithResult(_0x7ca6dc,null))[_0x5349('0x3f')](handleError(_0x7ca6dc,null));};exports[_0x5349('0x43')]=function(_0x25b4c3,_0x2c42ee){return db[_0x5349('0x28')][_0x5349('0x43')](_0x25b4c3[_0x5349('0x44')],{})[_0x5349('0x23')](respondWithResult(_0x2c42ee,0xc9))[_0x5349('0x3f')](handleError(_0x2c42ee,null));};exports[_0x5349('0x45')]=function(_0x191cef,_0x591c50){if(_0x191cef['body']['id']){delete _0x191cef[_0x5349('0x44')]['id'];}return db[_0x5349('0x28')][_0x5349('0x42')]({'where':{'id':_0x191cef[_0x5349('0x41')]['id']}})[_0x5349('0x23')](handleEntityNotFound(_0x591c50,null))[_0x5349('0x23')](saveUpdates(_0x191cef['body'],null))[_0x5349('0x23')](respondWithResult(_0x591c50,null))[_0x5349('0x3f')](handleError(_0x591c50,null));};exports[_0x5349('0x22')]=function(_0x3652dc,_0x26d06a){return db[_0x5349('0x28')]['find']({'where':{'id':_0x3652dc[_0x5349('0x41')]['id']}})['then'](handleEntityNotFound(_0x26d06a,null))[_0x5349('0x23')](removeEntity(_0x26d06a,null))[_0x5349('0x3f')](handleError(_0x26d06a,null));};exports[_0x5349('0x46')]=function(_0x3f4db2,_0x259701){return db['SmsQueueReport'][_0x5349('0x46')]()[_0x5349('0x23')](respondWithResult(_0x259701,null))[_0x5349('0x3f')](handleError(_0x259701,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 38aa5db..29fada1 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 _0x218b=['path','rimraf','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x33e786,_0xed8be8){var _0x4f67ae=function(_0x16c843){while(--_0x16c843){_0x33e786['push'](_0x33e786['shift']());}};_0x4f67ae(++_0xed8be8);}(_0x218b,0xa4));var _0xb218=function(_0x473945,_0xc156bc){_0x473945=_0x473945-0x0;var _0x3e6f35=_0x218b[_0x473945];return _0x3e6f35;};'use strict';var _=require(_0xb218('0x0'));var util=require(_0xb218('0x1'));var logger=require(_0xb218('0x2'))(_0xb218('0x3'));var moment=require(_0xb218('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb218('0x5'));var rimraf=require(_0xb218('0x6'));var config=require('../../config/environment');var attributes=require(_0xb218('0x7'));module[_0xb218('0x8')]=function(_0x177e12,_0x349b7b){return _0x177e12[_0xb218('0x9')](_0xb218('0xa'),attributes,{'tableName':_0xb218('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb218('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6602=['request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','util','api','moment','bluebird'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x6602,0xf8));var _0x2660=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x6602[_0x346737];return _0x1ade2e;};'use strict';var _=require('lodash');var util=require(_0x2660('0x0'));var logger=require('../../config/logger')(_0x2660('0x1'));var moment=require(_0x2660('0x2'));var BPromise=require(_0x2660('0x3'));var rp=require(_0x2660('0x4'));var fs=require('fs');var path=require(_0x2660('0x5'));var rimraf=require(_0x2660('0x6'));var config=require(_0x2660('0x7'));var attributes=require(_0x2660('0x8'));module[_0x2660('0x9')]=function(_0x51ac83,_0x10dc1c){return _0x51ac83[_0x2660('0xa')](_0x2660('0xb'),attributes,{'tableName':_0x2660('0xc'),'paranoid':![],'indexes':[{'name':_0x2660('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index bd00afc..fd8eff1 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 _0x8bcc=['then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','debug','update','where','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x17a509,_0x30102b){var _0x3e9ef1=function(_0x2ae505){while(--_0x2ae505){_0x17a509['push'](_0x17a509['shift']());}};_0x3e9ef1(++_0x30102b);}(_0x8bcc,0x1c6));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8bc('0x0'));var util=require(_0xc8bc('0x1'));var moment=require(_0xc8bc('0x2'));var BPromise=require(_0xc8bc('0x3'));var rs=require(_0xc8bc('0x4'));var fs=require('fs');var Redis=require(_0xc8bc('0x5'));var db=require(_0xc8bc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8bc('0x7'))(_0xc8bc('0x8'));var config=require(_0xc8bc('0x9'));var jayson=require(_0xc8bc('0xa'));var client=jayson[_0xc8bc('0xb')][_0xc8bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e496a,_0xfacbe9,_0x5cf729){return new BPromise(function(_0x1874d9,_0x542845){return client[_0xc8bc('0xd')](_0x5e496a,_0x5cf729)[_0xc8bc('0xe')](function(_0x3da4b0){logger['info'](_0xc8bc('0xf'),_0xfacbe9,_0xc8bc('0x10'));logger['debug'](_0xc8bc('0x11'),_0xfacbe9,_0xc8bc('0x10'),JSON[_0xc8bc('0x12')](_0x3da4b0));if(_0x3da4b0[_0xc8bc('0x13')]){if(_0x3da4b0[_0xc8bc('0x13')][_0xc8bc('0x14')]===0x1f4){logger[_0xc8bc('0x13')](_0xc8bc('0xf'),_0xfacbe9,_0x3da4b0['error'][_0xc8bc('0x15')]);return _0x542845(_0x3da4b0[_0xc8bc('0x13')][_0xc8bc('0x15')]);}logger[_0xc8bc('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0xfacbe9,_0x3da4b0[_0xc8bc('0x13')][_0xc8bc('0x15')]);return _0x1874d9(_0x3da4b0['error'][_0xc8bc('0x15')]);}else{logger[_0xc8bc('0x16')](_0xc8bc('0xf'),_0xfacbe9,_0xc8bc('0x10'));_0x1874d9(_0x3da4b0[_0xc8bc('0x17')][_0xc8bc('0x15')]);}})[_0xc8bc('0x18')](function(_0x369135){logger[_0xc8bc('0x13')](_0xc8bc('0xf'),_0xfacbe9,_0x369135);_0x542845(_0x369135);});});}exports['CreateSmsQueueReport']=function(_0x1602b3){var _0x1b542a=this;return new Promise(function(_0x18bc84,_0x7bf526){return db[_0xc8bc('0x19')][_0xc8bc('0x1a')](_0x1602b3[_0xc8bc('0x1b')],{'raw':_0x1602b3[_0xc8bc('0x1c')]?_0x1602b3[_0xc8bc('0x1c')][_0xc8bc('0x1d')]===undefined?!![]:![]:!![]})[_0xc8bc('0xe')](function(_0x3dc1ae){logger[_0xc8bc('0x16')](_0xc8bc('0x1e'),_0x1602b3);logger[_0xc8bc('0x1f')](_0xc8bc('0x1e'),_0x1602b3,JSON[_0xc8bc('0x12')](_0x3dc1ae));_0x18bc84(_0x3dc1ae);})['catch'](function(_0x3633fe){logger['error'](_0xc8bc('0x1e'),_0x3633fe[_0xc8bc('0x15')],_0x1602b3);_0x7bf526(_0x1b542a[_0xc8bc('0x13')](0x1f4,_0x3633fe[_0xc8bc('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0xa3473e){var _0x42889d=this;return new Promise(function(_0x4c4d0a,_0x2982bf){return db[_0xc8bc('0x19')][_0xc8bc('0x20')](_0xa3473e['body'],{'raw':_0xa3473e[_0xc8bc('0x1c')]?_0xa3473e['options'][_0xc8bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa3473e['options']?_0xa3473e[_0xc8bc('0x1c')][_0xc8bc('0x21')]||null:null,'attributes':_0xa3473e[_0xc8bc('0x1c')]?_0xa3473e[_0xc8bc('0x1c')]['attributes']||null:null,'limit':_0xa3473e[_0xc8bc('0x1c')]?_0xa3473e[_0xc8bc('0x1c')][_0xc8bc('0x22')]||null:null})[_0xc8bc('0xe')](function(_0x4d3ee4){logger[_0xc8bc('0x16')]('UpdateSmsQueueReport',_0xa3473e);logger[_0xc8bc('0x1f')]('UpdateSmsQueueReport',_0xa3473e,JSON[_0xc8bc('0x12')](_0x4d3ee4));_0x4c4d0a(_0x4d3ee4);})[_0xc8bc('0x18')](function(_0x3c43d6){logger[_0xc8bc('0x13')](_0xc8bc('0x23'),_0x3c43d6[_0xc8bc('0x15')],_0xa3473e);_0x2982bf(_0x42889d[_0xc8bc('0x13')](0x1f4,_0x3c43d6[_0xc8bc('0x15')]));});});}; \ No newline at end of file +var _0x163d=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','create','body','options','CreateSmsQueueReport','stringify','SmsQueueReport','update','raw','where','attributes','limit','UpdateSmsQueueReport','lodash'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0x163d,0x128));var _0xd163=function(_0x4ed668,_0x4b6086){_0x4ed668=_0x4ed668-0x0;var _0xf3a788=_0x163d[_0x4ed668];return _0xf3a788;};'use strict';var _=require(_0xd163('0x0'));var util=require(_0xd163('0x1'));var moment=require('moment');var BPromise=require(_0xd163('0x2'));var rs=require(_0xd163('0x3'));var fs=require('fs');var Redis=require(_0xd163('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd163('0x5'))(_0xd163('0x6'));var config=require(_0xd163('0x7'));var jayson=require(_0xd163('0x8'));var client=jayson[_0xd163('0x9')][_0xd163('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fb37c,_0x2bcfa5,_0x338546){return new BPromise(function(_0x5a30db,_0x5ce866){return client[_0xd163('0xb')](_0x3fb37c,_0x338546)[_0xd163('0xc')](function(_0x12590d){logger[_0xd163('0xd')](_0xd163('0xe'),_0x2bcfa5,_0xd163('0xf'));logger[_0xd163('0x10')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2bcfa5,_0xd163('0xf'),JSON['stringify'](_0x12590d));if(_0x12590d[_0xd163('0x11')]){if(_0x12590d[_0xd163('0x11')]['code']===0x1f4){logger['error'](_0xd163('0xe'),_0x2bcfa5,_0x12590d[_0xd163('0x11')][_0xd163('0x12')]);return _0x5ce866(_0x12590d[_0xd163('0x11')][_0xd163('0x12')]);}logger[_0xd163('0x11')](_0xd163('0xe'),_0x2bcfa5,_0x12590d[_0xd163('0x11')][_0xd163('0x12')]);return _0x5a30db(_0x12590d[_0xd163('0x11')]['message']);}else{logger[_0xd163('0xd')](_0xd163('0xe'),_0x2bcfa5,_0xd163('0xf'));_0x5a30db(_0x12590d[_0xd163('0x13')][_0xd163('0x12')]);}})[_0xd163('0x14')](function(_0x13c092){logger['error'](_0xd163('0xe'),_0x2bcfa5,_0x13c092);_0x5ce866(_0x13c092);});});}exports['CreateSmsQueueReport']=function(_0x5bbf05){var _0x4eef91=this;return new Promise(function(_0x4364fb,_0x55ad01){return db['SmsQueueReport'][_0xd163('0x15')](_0x5bbf05[_0xd163('0x16')],{'raw':_0x5bbf05[_0xd163('0x17')]?_0x5bbf05[_0xd163('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x47e394){logger[_0xd163('0xd')](_0xd163('0x18'),_0x5bbf05);logger[_0xd163('0x10')]('CreateSmsQueueReport',_0x5bbf05,JSON[_0xd163('0x19')](_0x47e394));_0x4364fb(_0x47e394);})[_0xd163('0x14')](function(_0x93bc23){logger[_0xd163('0x11')](_0xd163('0x18'),_0x93bc23[_0xd163('0x12')],_0x5bbf05);_0x55ad01(_0x4eef91[_0xd163('0x11')](0x1f4,_0x93bc23['message']));});});};exports['UpdateSmsQueueReport']=function(_0x821720){var _0x43cb10=this;return new Promise(function(_0xc01737,_0x5d38df){return db[_0xd163('0x1a')][_0xd163('0x1b')](_0x821720[_0xd163('0x16')],{'raw':_0x821720[_0xd163('0x17')]?_0x821720[_0xd163('0x17')][_0xd163('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x821720[_0xd163('0x17')]?_0x821720[_0xd163('0x17')][_0xd163('0x1d')]||null:null,'attributes':_0x821720['options']?_0x821720['options'][_0xd163('0x1e')]||null:null,'limit':_0x821720['options']?_0x821720[_0xd163('0x17')][_0xd163('0x1f')]||null:null})[_0xd163('0xc')](function(_0x1424c7){logger['info'](_0xd163('0x20'),_0x821720);logger[_0xd163('0x10')](_0xd163('0x20'),_0x821720,JSON[_0xd163('0x19')](_0x1424c7));_0xc01737(_0x1424c7);})[_0xd163('0x14')](function(_0x139fe0){logger['error'](_0xd163('0x20'),_0x139fe0[_0xd163('0x12')],_0x821720);_0x5d38df(_0x43cb10['error'](0x1f4,_0x139fe0[_0xd163('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index cbcb6d8..7e9d926 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 _0x7cdd=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x510b4c,_0xe9759c){var _0x4910df=function(_0x81fadb){while(--_0x81fadb){_0x510b4c['push'](_0x510b4c['shift']());}};_0x4910df(++_0xe9759c);}(_0x7cdd,0x1e8));var _0xd7cd=function(_0x222fa7,_0x335832){_0x222fa7=_0x222fa7-0x0;var _0x4f2397=_0x7cdd[_0x222fa7];return _0x4f2397;};'use strict';var multer=require(_0xd7cd('0x0'));var util=require('util');var path=require(_0xd7cd('0x1'));var timeout=require(_0xd7cd('0x2'));var express=require(_0xd7cd('0x3'));var router=express[_0xd7cd('0x4')]();var auth=require(_0xd7cd('0x5'));var interaction=require(_0xd7cd('0x6'));var config=require(_0xd7cd('0x7'));var controller=require(_0xd7cd('0x8'));router[_0xd7cd('0x9')]('/',auth['isAuthenticated'](),controller[_0xd7cd('0xa')]);router[_0xd7cd('0x9')](_0xd7cd('0xb'),auth[_0xd7cd('0xc')](),controller[_0xd7cd('0xd')]);router[_0xd7cd('0x9')](_0xd7cd('0xe'),auth[_0xd7cd('0xc')](),controller[_0xd7cd('0xf')]);router[_0xd7cd('0x10')]('/',auth['isAuthenticated'](),controller[_0xd7cd('0x11')]);router[_0xd7cd('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd7cd('0x13')]);router[_0xd7cd('0x14')](_0xd7cd('0xe'),auth[_0xd7cd('0xc')](),controller[_0xd7cd('0x15')]);module[_0xd7cd('0x16')]=router; \ No newline at end of file +var _0xf3f3=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router'];(function(_0x1ced6b,_0x45fa84){var _0x17dd9c=function(_0x5d928c){while(--_0x5d928c){_0x1ced6b['push'](_0x1ced6b['shift']());}};_0x17dd9c(++_0x45fa84);}(_0xf3f3,0x119));var _0x3f3f=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0xf3f3[_0x2f54b6];return _0x169f21;};'use strict';var multer=require('multer');var util=require(_0x3f3f('0x0'));var path=require(_0x3f3f('0x1'));var timeout=require(_0x3f3f('0x2'));var express=require('express');var router=express[_0x3f3f('0x3')]();var auth=require(_0x3f3f('0x4'));var interaction=require(_0x3f3f('0x5'));var config=require(_0x3f3f('0x6'));var controller=require(_0x3f3f('0x7'));router['get']('/',auth[_0x3f3f('0x8')](),controller[_0x3f3f('0x9')]);router[_0x3f3f('0xa')]('/describe',auth[_0x3f3f('0x8')](),controller[_0x3f3f('0xb')]);router[_0x3f3f('0xa')](_0x3f3f('0xc'),auth[_0x3f3f('0x8')](),controller['show']);router[_0x3f3f('0xd')]('/',auth['isAuthenticated'](),controller[_0x3f3f('0xe')]);router[_0x3f3f('0xf')](_0x3f3f('0xc'),auth[_0x3f3f('0x8')](),controller[_0x3f3f('0x10')]);router['delete'](_0x3f3f('0xc'),auth[_0x3f3f('0x8')](),controller[_0x3f3f('0x11')]);module[_0x3f3f('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 0adb531..f28f809 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 _0x4f7e=['moment','account','queue','NOW'];(function(_0xefe08b,_0x3977ab){var _0x1f4f96=function(_0x2650da){while(--_0x2650da){_0xefe08b['push'](_0xefe08b['shift']());}};_0x1f4f96(++_0x3977ab);}(_0x4f7e,0x190));var _0xe4f7=function(_0x424b7d,_0x1b7804){_0x424b7d=_0x424b7d-0x0;var _0x2e9d69=_0x4f7e[_0x424b7d];return _0x2e9d69;};'use strict';var moment=require(_0xe4f7('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe4f7('0x1'),'agent',_0xe4f7('0x2')),'allowNull':![],'defaultValue':_0xe4f7('0x2')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xe4f7('0x3')]}}; \ No newline at end of file +var _0x244c=['STRING','account','agent','queue','NOW','moment','sequelize'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x244c,0x1d3));var _0xc244=function(_0x14f287,_0x51e926){_0x14f287=_0x14f287-0x0;var _0x528d52=_0x244c[_0x14f287];return _0x528d52;};'use strict';var moment=require(_0xc244('0x0'));var Sequelize=require(_0xc244('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xc244('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xc244('0x3'),_0xc244('0x4'),_0xc244('0x5')),'allowNull':![],'defaultValue':_0xc244('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xc244('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 2ad0b47..43cccde 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 _0xfc62=['field','includeAll','rows','show','params','rawAttributes','include','options','find','create','catch','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','apply','save','update','then','destroy','end','error','stack','name','send','index','SmsTransferReport','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xfc62,0x9d));var _0x2fc6=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xfc62[_0x1694f5];return _0x5b4321;};'use strict';var pdf=require(_0x2fc6('0x0'));var emlformat=require(_0x2fc6('0x1'));var rimraf=require(_0x2fc6('0x2'));var zipdir=require(_0x2fc6('0x3'));var jsonpatch=require(_0x2fc6('0x4'));var rp=require(_0x2fc6('0x5'));var moment=require('moment');var BPromise=require(_0x2fc6('0x6'));var Mustache=require(_0x2fc6('0x7'));var util=require('util');var path=require(_0x2fc6('0x8'));var sox=require('sox');var csv=require(_0x2fc6('0x9'));var ejs=require(_0x2fc6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2fc6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x2fc6('0x9'));var querystring=require(_0x2fc6('0xc'));var Papa=require(_0x2fc6('0xd'));var Redis=require(_0x2fc6('0xe'));var authService=require(_0x2fc6('0xf'));var qs=require(_0x2fc6('0x10'));var hardwareService=require(_0x2fc6('0x11'));var logger=require(_0x2fc6('0x12'))(_0x2fc6('0x13'));var utils=require(_0x2fc6('0x14'));var config=require(_0x2fc6('0x15'));var db=require(_0x2fc6('0x16'))['db'];function respondWithStatusCode(_0x35c0bd,_0x1db2d4){_0x1db2d4=_0x1db2d4||0xcc;return function(_0x1a3910){if(_0x1a3910){return _0x35c0bd[_0x2fc6('0x17')](_0x1db2d4);}return _0x35c0bd[_0x2fc6('0x18')](_0x1db2d4)['end']();};}function respondWithResult(_0x543e75,_0x1c966a){_0x1c966a=_0x1c966a||0xc8;return function(_0x3180a4){if(_0x3180a4){return _0x543e75[_0x2fc6('0x18')](_0x1c966a)['json'](_0x3180a4);}};}function respondWithFilteredResult(_0x29f217,_0x22d13d){return function(_0x41bc28){if(_0x41bc28){var _0x4b37c4=_0x41bc28[_0x2fc6('0x19')],_0x9be048=_0x22d13d[_0x2fc6('0x1a')],_0x582e42=_0x22d13d['offset']+_0x22d13d[_0x2fc6('0x1b')],_0x2365cb;if(_0x582e42>=_0x4b37c4){_0x582e42=_0x4b37c4;_0x2365cb=0xc8;}else{_0x2365cb=0xce;}_0x29f217['status'](_0x2365cb);return _0x29f217[_0x2fc6('0x1c')]('Content-Range',_0x9be048+'-'+_0x582e42+'/'+_0x4b37c4)['json'](_0x41bc28);}return null;};}function patchUpdates(_0x29a01e){return function(_0x5db086){try{jsonpatch[_0x2fc6('0x1d')](_0x5db086,_0x29a01e,!![]);}catch(_0x2bb81a){return BPromise['reject'](_0x2bb81a);}return _0x5db086[_0x2fc6('0x1e')]();};}function saveUpdates(_0x5ac3eb,_0x39d080){return function(_0x4be601){if(_0x4be601){return _0x4be601[_0x2fc6('0x1f')](_0x5ac3eb)[_0x2fc6('0x20')](function(_0x1f0e18){return _0x1f0e18;});}return null;};}function removeEntity(_0x550b4b,_0x396c7c){return function(_0x3d2145){if(_0x3d2145){return _0x3d2145[_0x2fc6('0x21')]()[_0x2fc6('0x20')](function(){_0x550b4b[_0x2fc6('0x18')](0xcc)[_0x2fc6('0x22')]();});}};}function handleEntityNotFound(_0x55ce44,_0x1f24d7){return function(_0x2dd2b7){if(!_0x2dd2b7){_0x55ce44[_0x2fc6('0x17')](0x194);}return _0x2dd2b7;};}function handleError(_0x236750,_0x23afec){_0x23afec=_0x23afec||0x1f4;return function(_0x648021){logger[_0x2fc6('0x23')](_0x648021[_0x2fc6('0x24')]);if(_0x648021[_0x2fc6('0x25')]){delete _0x648021[_0x2fc6('0x25')];}_0x236750[_0x2fc6('0x18')](_0x23afec)[_0x2fc6('0x26')](_0x648021);};}exports[_0x2fc6('0x27')]=function(_0x845f1c,_0x396578){var _0x311132={},_0x3f6737={},_0x5d5589={'count':0x0,'rows':[]};var _0x265f97=db[_0x2fc6('0x28')]['rawAttributes'];_0x3f6737['model']=_['keys'](_0x265f97);_0x3f6737[_0x2fc6('0x29')]=_['keys'](_0x845f1c[_0x2fc6('0x29')]);_0x3f6737[_0x2fc6('0x2a')]=_[_0x2fc6('0x2b')](_0x3f6737[_0x2fc6('0x2c')],_0x3f6737[_0x2fc6('0x29')]);_0x311132['attributes']=_[_0x2fc6('0x2b')](_0x3f6737['model'],qs[_0x2fc6('0x2d')](_0x845f1c[_0x2fc6('0x29')][_0x2fc6('0x2d')]));_0x311132['attributes']=_0x311132['attributes']['length']?_0x311132[_0x2fc6('0x2e')]:_0x3f6737[_0x2fc6('0x2c')];if(!_0x845f1c[_0x2fc6('0x29')][_0x2fc6('0x2f')](_0x2fc6('0x30'))){_0x311132[_0x2fc6('0x1b')]=qs[_0x2fc6('0x1b')](_0x845f1c[_0x2fc6('0x29')][_0x2fc6('0x1b')]);_0x311132['offset']=qs[_0x2fc6('0x1a')](_0x845f1c[_0x2fc6('0x29')][_0x2fc6('0x1a')]);}_0x311132[_0x2fc6('0x31')]=qs['sort'](_0x845f1c[_0x2fc6('0x29')][_0x2fc6('0x32')]);_0x311132[_0x2fc6('0x33')]=qs['filters'](_[_0x2fc6('0x34')](_0x845f1c[_0x2fc6('0x29')],_0x3f6737[_0x2fc6('0x2a')]));if(_0x845f1c[_0x2fc6('0x29')][_0x2fc6('0x35')]){_0x311132[_0x2fc6('0x33')]=_[_0x2fc6('0x36')](_0x311132[_0x2fc6('0x33')],{'$or':_[_0x2fc6('0x37')](_0x265f97,function(_0x3edc0f){if(_0x3edc0f[_0x2fc6('0x38')][_0x2fc6('0x39')]!==_0x2fc6('0x3a')){var _0x5ef399={};_0x5ef399[_0x3edc0f[_0x2fc6('0x3b')]]={'$like':'%'+_0x845f1c[_0x2fc6('0x29')][_0x2fc6('0x35')]+'%'};return _0x5ef399;}})});}_0x311132=_[_0x2fc6('0x36')]({},_0x311132,_0x845f1c['options']);var _0x269a10={'where':_0x311132['where']};return db[_0x2fc6('0x28')][_0x2fc6('0x19')](_0x269a10)[_0x2fc6('0x20')](function(_0x4858cc){_0x5d5589[_0x2fc6('0x19')]=_0x4858cc;if(_0x845f1c['query'][_0x2fc6('0x3c')]){_0x311132['include']=[{'all':!![]}];}return db[_0x2fc6('0x28')]['findAll'](_0x311132);})[_0x2fc6('0x20')](function(_0x10d9d9){_0x5d5589[_0x2fc6('0x3d')]=_0x10d9d9;return _0x5d5589;})[_0x2fc6('0x20')](respondWithFilteredResult(_0x396578,_0x311132))['catch'](handleError(_0x396578,null));};exports[_0x2fc6('0x3e')]=function(_0x3e91f5,_0x3be55d){var _0x297391={'raw':!![],'where':{'id':_0x3e91f5[_0x2fc6('0x3f')]['id']}},_0x22d0c={};_0x22d0c['model']=_['keys'](db[_0x2fc6('0x28')][_0x2fc6('0x40')]);_0x22d0c['query']=_['keys'](_0x3e91f5['query']);_0x22d0c['filters']=_[_0x2fc6('0x2b')](_0x22d0c['model'],_0x22d0c['query']);_0x297391['attributes']=_['intersection'](_0x22d0c[_0x2fc6('0x2c')],qs[_0x2fc6('0x2d')](_0x3e91f5['query']['fields']));_0x297391['attributes']=_0x297391['attributes']['length']?_0x297391[_0x2fc6('0x2e')]:_0x22d0c[_0x2fc6('0x2c')];if(_0x3e91f5[_0x2fc6('0x29')][_0x2fc6('0x3c')]){_0x297391[_0x2fc6('0x41')]=[{'all':!![]}];}_0x297391=_[_0x2fc6('0x36')]({},_0x297391,_0x3e91f5[_0x2fc6('0x42')]);return db[_0x2fc6('0x28')][_0x2fc6('0x43')](_0x297391)['then'](handleEntityNotFound(_0x3be55d,null))[_0x2fc6('0x20')](respondWithResult(_0x3be55d,null))['catch'](handleError(_0x3be55d,null));};exports[_0x2fc6('0x44')]=function(_0xce52c6,_0x1814b6){return db[_0x2fc6('0x28')][_0x2fc6('0x44')](_0xce52c6['body'],{})[_0x2fc6('0x20')](respondWithResult(_0x1814b6,0xc9))[_0x2fc6('0x45')](handleError(_0x1814b6,null));};exports[_0x2fc6('0x1f')]=function(_0x2c6549,_0x4a95de){if(_0x2c6549[_0x2fc6('0x46')]['id']){delete _0x2c6549['body']['id'];}return db[_0x2fc6('0x28')]['find']({'where':{'id':_0x2c6549['params']['id']}})[_0x2fc6('0x20')](handleEntityNotFound(_0x4a95de,null))[_0x2fc6('0x20')](saveUpdates(_0x2c6549[_0x2fc6('0x46')],null))[_0x2fc6('0x20')](respondWithResult(_0x4a95de,null))[_0x2fc6('0x45')](handleError(_0x4a95de,null));};exports['destroy']=function(_0x2bc414,_0x3fdcfa){return db[_0x2fc6('0x28')]['find']({'where':{'id':_0x2bc414[_0x2fc6('0x3f')]['id']}})[_0x2fc6('0x20')](handleEntityNotFound(_0x3fdcfa,null))['then'](removeEntity(_0x3fdcfa,null))[_0x2fc6('0x45')](handleError(_0x3fdcfa,null));};exports['describe']=function(_0x50c9da,_0x3c3431){return db[_0x2fc6('0x28')][_0x2fc6('0x47')]()[_0x2fc6('0x20')](respondWithResult(_0x3c3431,null))[_0x2fc6('0x45')](handleError(_0x3c3431,null));}; \ No newline at end of file +var _0xa46f=['keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','map','type','key','VIRTUAL','field','filter','includeAll','include','findAll','show','merge','options','find','catch','create','body','update','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','error','name','send','index','SmsTransferReport','rawAttributes'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0xa46f,0x140));var _0xfa46=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0xa46f[_0x58a4ac];return _0x545810;};'use strict';var pdf=require(_0xfa46('0x0'));var emlformat=require(_0xfa46('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa46('0x2'));var rp=require(_0xfa46('0x3'));var moment=require(_0xfa46('0x4'));var BPromise=require(_0xfa46('0x5'));var Mustache=require(_0xfa46('0x6'));var util=require(_0xfa46('0x7'));var path=require(_0xfa46('0x8'));var sox=require(_0xfa46('0x9'));var csv=require(_0xfa46('0xa'));var ejs=require(_0xfa46('0xb'));var fs=require('fs');var _=require(_0xfa46('0xc'));var squel=require(_0xfa46('0xd'));var crypto=require('crypto');var jsforce=require(_0xfa46('0xe'));var deskjs=require(_0xfa46('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfa46('0x10'));var Papa=require(_0xfa46('0x11'));var Redis=require('ioredis');var authService=require(_0xfa46('0x12'));var qs=require(_0xfa46('0x13'));var hardwareService=require(_0xfa46('0x14'));var logger=require(_0xfa46('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xfa46('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe05245,_0x2045f6){_0x2045f6=_0x2045f6||0xcc;return function(_0x271d9a){if(_0x271d9a){return _0xe05245[_0xfa46('0x17')](_0x2045f6);}return _0xe05245[_0xfa46('0x18')](_0x2045f6)[_0xfa46('0x19')]();};}function respondWithResult(_0x209414,_0x52ea67){_0x52ea67=_0x52ea67||0xc8;return function(_0xd14247){if(_0xd14247){return _0x209414[_0xfa46('0x18')](_0x52ea67)[_0xfa46('0x1a')](_0xd14247);}};}function respondWithFilteredResult(_0x21f05e,_0x57efa0){return function(_0x33a012){if(_0x33a012){var _0x274534=_0x33a012[_0xfa46('0x1b')],_0x43e638=_0x57efa0[_0xfa46('0x1c')],_0x443726=_0x57efa0[_0xfa46('0x1c')]+_0x57efa0[_0xfa46('0x1d')],_0x17fba0;if(_0x443726>=_0x274534){_0x443726=_0x274534;_0x17fba0=0xc8;}else{_0x17fba0=0xce;}_0x21f05e['status'](_0x17fba0);return _0x21f05e[_0xfa46('0x1e')]('Content-Range',_0x43e638+'-'+_0x443726+'/'+_0x274534)['json'](_0x33a012);}return null;};}function patchUpdates(_0x25af89){return function(_0x54be67){try{jsonpatch[_0xfa46('0x1f')](_0x54be67,_0x25af89,!![]);}catch(_0x544cbd){return BPromise['reject'](_0x544cbd);}return _0x54be67[_0xfa46('0x20')]();};}function saveUpdates(_0x2bad57,_0x432196){return function(_0x4ac4f6){if(_0x4ac4f6){return _0x4ac4f6['update'](_0x2bad57)[_0xfa46('0x21')](function(_0x527fb8){return _0x527fb8;});}return null;};}function removeEntity(_0x449295,_0x136b8a){return function(_0x5f221e){if(_0x5f221e){return _0x5f221e['destroy']()['then'](function(){_0x449295[_0xfa46('0x18')](0xcc)[_0xfa46('0x19')]();});}};}function handleEntityNotFound(_0x38f402,_0x266773){return function(_0x2c3bee){if(!_0x2c3bee){_0x38f402[_0xfa46('0x17')](0x194);}return _0x2c3bee;};}function handleError(_0x461900,_0x16b509){_0x16b509=_0x16b509||0x1f4;return function(_0x3710f6){logger[_0xfa46('0x22')](_0x3710f6['stack']);if(_0x3710f6[_0xfa46('0x23')]){delete _0x3710f6[_0xfa46('0x23')];}_0x461900['status'](_0x16b509)[_0xfa46('0x24')](_0x3710f6);};}exports[_0xfa46('0x25')]=function(_0x52379a,_0x2cdf1f){var _0x51eb1e={},_0x87c359={},_0xf4dfd1={'count':0x0,'rows':[]};var _0xb69860=db[_0xfa46('0x26')][_0xfa46('0x27')];_0x87c359['model']=_[_0xfa46('0x28')](_0xb69860);_0x87c359[_0xfa46('0x29')]=_['keys'](_0x52379a[_0xfa46('0x29')]);_0x87c359[_0xfa46('0x2a')]=_[_0xfa46('0x2b')](_0x87c359[_0xfa46('0x2c')],_0x87c359['query']);_0x51eb1e[_0xfa46('0x2d')]=_['intersection'](_0x87c359[_0xfa46('0x2c')],qs[_0xfa46('0x2e')](_0x52379a['query']['fields']));_0x51eb1e[_0xfa46('0x2d')]=_0x51eb1e['attributes'][_0xfa46('0x2f')]?_0x51eb1e[_0xfa46('0x2d')]:_0x87c359[_0xfa46('0x2c')];if(!_0x52379a[_0xfa46('0x29')][_0xfa46('0x30')]('nolimit')){_0x51eb1e[_0xfa46('0x1d')]=qs[_0xfa46('0x1d')](_0x52379a[_0xfa46('0x29')][_0xfa46('0x1d')]);_0x51eb1e['offset']=qs[_0xfa46('0x1c')](_0x52379a[_0xfa46('0x29')]['offset']);}_0x51eb1e[_0xfa46('0x31')]=qs[_0xfa46('0x32')](_0x52379a[_0xfa46('0x29')][_0xfa46('0x32')]);_0x51eb1e[_0xfa46('0x33')]=qs[_0xfa46('0x2a')](_[_0xfa46('0x34')](_0x52379a[_0xfa46('0x29')],_0x87c359['filters']));if(_0x52379a[_0xfa46('0x29')]['filter']){_0x51eb1e['where']=_['merge'](_0x51eb1e[_0xfa46('0x33')],{'$or':_[_0xfa46('0x35')](_0xb69860,function(_0x1845e8){if(_0x1845e8[_0xfa46('0x36')][_0xfa46('0x37')]!==_0xfa46('0x38')){var _0x3d1457={};_0x3d1457[_0x1845e8[_0xfa46('0x39')]]={'$like':'%'+_0x52379a[_0xfa46('0x29')][_0xfa46('0x3a')]+'%'};return _0x3d1457;}})});}_0x51eb1e=_['merge']({},_0x51eb1e,_0x52379a['options']);var _0x1652b4={'where':_0x51eb1e[_0xfa46('0x33')]};return db[_0xfa46('0x26')][_0xfa46('0x1b')](_0x1652b4)['then'](function(_0x4fe78f){_0xf4dfd1[_0xfa46('0x1b')]=_0x4fe78f;if(_0x52379a[_0xfa46('0x29')][_0xfa46('0x3b')]){_0x51eb1e[_0xfa46('0x3c')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xfa46('0x3d')](_0x51eb1e);})['then'](function(_0x5b6369){_0xf4dfd1['rows']=_0x5b6369;return _0xf4dfd1;})[_0xfa46('0x21')](respondWithFilteredResult(_0x2cdf1f,_0x51eb1e))['catch'](handleError(_0x2cdf1f,null));};exports[_0xfa46('0x3e')]=function(_0x184dfd,_0x1d55ff){var _0x3c97f3={'raw':!![],'where':{'id':_0x184dfd['params']['id']}},_0x520b4f={};_0x520b4f[_0xfa46('0x2c')]=_[_0xfa46('0x28')](db[_0xfa46('0x26')][_0xfa46('0x27')]);_0x520b4f[_0xfa46('0x29')]=_[_0xfa46('0x28')](_0x184dfd[_0xfa46('0x29')]);_0x520b4f[_0xfa46('0x2a')]=_[_0xfa46('0x2b')](_0x520b4f[_0xfa46('0x2c')],_0x520b4f[_0xfa46('0x29')]);_0x3c97f3[_0xfa46('0x2d')]=_['intersection'](_0x520b4f['model'],qs[_0xfa46('0x2e')](_0x184dfd[_0xfa46('0x29')]['fields']));_0x3c97f3[_0xfa46('0x2d')]=_0x3c97f3[_0xfa46('0x2d')][_0xfa46('0x2f')]?_0x3c97f3[_0xfa46('0x2d')]:_0x520b4f['model'];if(_0x184dfd['query'][_0xfa46('0x3b')]){_0x3c97f3['include']=[{'all':!![]}];}_0x3c97f3=_[_0xfa46('0x3f')]({},_0x3c97f3,_0x184dfd[_0xfa46('0x40')]);return db[_0xfa46('0x26')][_0xfa46('0x41')](_0x3c97f3)[_0xfa46('0x21')](handleEntityNotFound(_0x1d55ff,null))[_0xfa46('0x21')](respondWithResult(_0x1d55ff,null))[_0xfa46('0x42')](handleError(_0x1d55ff,null));};exports[_0xfa46('0x43')]=function(_0x45a0ed,_0x5aaff){return db[_0xfa46('0x26')]['create'](_0x45a0ed[_0xfa46('0x44')],{})[_0xfa46('0x21')](respondWithResult(_0x5aaff,0xc9))[_0xfa46('0x42')](handleError(_0x5aaff,null));};exports[_0xfa46('0x45')]=function(_0x3065cc,_0x197a32){if(_0x3065cc['body']['id']){delete _0x3065cc[_0xfa46('0x44')]['id'];}return db[_0xfa46('0x26')][_0xfa46('0x41')]({'where':{'id':_0x3065cc[_0xfa46('0x46')]['id']}})[_0xfa46('0x21')](handleEntityNotFound(_0x197a32,null))[_0xfa46('0x21')](saveUpdates(_0x3065cc[_0xfa46('0x44')],null))[_0xfa46('0x21')](respondWithResult(_0x197a32,null))[_0xfa46('0x42')](handleError(_0x197a32,null));};exports['destroy']=function(_0x28939c,_0x22bba5){return db[_0xfa46('0x26')]['find']({'where':{'id':_0x28939c['params']['id']}})[_0xfa46('0x21')](handleEntityNotFound(_0x22bba5,null))['then'](removeEntity(_0x22bba5,null))['catch'](handleError(_0x22bba5,null));};exports[_0xfa46('0x47')]=function(_0x285eee,_0x3936fd){return db[_0xfa46('0x26')]['describe']()['then'](respondWithResult(_0x3936fd,null))[_0xfa46('0x42')](handleError(_0x3936fd,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 65375fb..84c9fb3 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 _0x8338=['rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8338,0x1b4));var _0x8833=function(_0x5c9991,_0x551df8){_0x5c9991=_0x5c9991-0x0;var _0x34136=_0x8338[_0x5c9991];return _0x34136;};'use strict';var _=require('lodash');var util=require(_0x8833('0x0'));var logger=require(_0x8833('0x1'))(_0x8833('0x2'));var moment=require(_0x8833('0x3'));var BPromise=require('bluebird');var rp=require(_0x8833('0x4'));var fs=require('fs');var path=require(_0x8833('0x5'));var rimraf=require(_0x8833('0x6'));var config=require(_0x8833('0x7'));var attributes=require(_0x8833('0x8'));module[_0x8833('0x9')]=function(_0xe10745,_0xbf3b0f){return _0xe10745[_0x8833('0xa')]('SmsTransferReport',attributes,{'tableName':_0x8833('0xb'),'paranoid':![],'indexes':[{'name':_0x8833('0xc'),'fields':[_0x8833('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0eb4=['./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x13df12,_0xab501c){var _0x52d018=function(_0x1f2915){while(--_0x1f2915){_0x13df12['push'](_0x13df12['shift']());}};_0x52d018(++_0xab501c);}(_0x0eb4,0x1b8));var _0x40eb=function(_0x378447,_0x4c48e6){_0x378447=_0x378447-0x0;var _0x4a49dc=_0x0eb4[_0x378447];return _0x4a49dc;};'use strict';var _=require(_0x40eb('0x0'));var util=require(_0x40eb('0x1'));var logger=require(_0x40eb('0x2'))('api');var moment=require(_0x40eb('0x3'));var BPromise=require(_0x40eb('0x4'));var rp=require(_0x40eb('0x5'));var fs=require('fs');var path=require(_0x40eb('0x6'));var rimraf=require(_0x40eb('0x7'));var config=require('../../config/environment');var attributes=require(_0x40eb('0x8'));module[_0x40eb('0x9')]=function(_0x56e3ae,_0x74da4d){return _0x56e3ae[_0x40eb('0xa')](_0x40eb('0xb'),attributes,{'tableName':_0x40eb('0xc'),'paranoid':![],'indexes':[{'name':_0x40eb('0xd'),'fields':[_0x40eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 3532e26..7f6d114 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 _0xa456=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x65d13d,_0x49e929){var _0x309bb3=function(_0x2d7f73){while(--_0x2d7f73){_0x65d13d['push'](_0x65d13d['shift']());}};_0x309bb3(++_0x49e929);}(_0xa456,0x142));var _0x6a45=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xa456[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});} \ No newline at end of file +var _0xeca8=['../../config/environment','jayson/promise','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeca8,0x1f2));var _0x8eca=function(_0x1a13fc,_0x4cdc71){_0x1a13fc=_0x1a13fc-0x0;var _0x2cb974=_0xeca8[_0x1a13fc];return _0x2cb974;};'use strict';var _=require(_0x8eca('0x0'));var util=require(_0x8eca('0x1'));var moment=require(_0x8eca('0x2'));var BPromise=require(_0x8eca('0x3'));var rs=require(_0x8eca('0x4'));var fs=require('fs');var Redis=require(_0x8eca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eca('0x6'));var logger=require('../../config/logger')(_0x8eca('0x7'));var config=require(_0x8eca('0x8'));var jayson=require(_0x8eca('0x9'));var client=jayson['client'][_0x8eca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12c679,_0xe6e3f2,_0x39f40a){return new BPromise(function(_0xedaeca,_0x3b901f){return client['request'](_0x12c679,_0x39f40a)[_0x8eca('0xb')](function(_0x19208c){logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));logger[_0x8eca('0xf')](_0x8eca('0x10'),_0xe6e3f2,_0x8eca('0xe'),JSON[_0x8eca('0x11')](_0x19208c));if(_0x19208c[_0x8eca('0x12')]){if(_0x19208c['error'][_0x8eca('0x13')]===0x1f4){logger['error'](_0x8eca('0xd'),_0xe6e3f2,_0x19208c[_0x8eca('0x12')]['message']);return _0x3b901f(_0x19208c[_0x8eca('0x12')]['message']);}logger['error']('SmsTransferReport,\x20%s,\x20%s',_0xe6e3f2,_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);return _0xedaeca(_0x19208c[_0x8eca('0x12')][_0x8eca('0x14')]);}else{logger[_0x8eca('0xc')](_0x8eca('0xd'),_0xe6e3f2,_0x8eca('0xe'));_0xedaeca(_0x19208c['result'][_0x8eca('0x14')]);}})[_0x8eca('0x15')](function(_0x4b8c67){logger[_0x8eca('0x12')](_0x8eca('0xd'),_0xe6e3f2,_0x4b8c67);_0x3b901f(_0x4b8c67);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 5120926..b317cf5 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 _0x5155=['index','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','file','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated'];(function(_0x46a0ff,_0x364526){var _0x1436e8=function(_0x3069f9){while(--_0x3069f9){_0x46a0ff['push'](_0x46a0ff['shift']());}};_0x1436e8(++_0x364526);}(_0x5155,0x195));var _0x5515=function(_0x3f2327,_0x234948){_0x3f2327=_0x3f2327-0x0;var _0x34c873=_0x5155[_0x3f2327];return _0x34c873;};'use strict';var multer=require(_0x5515('0x0'));var util=require('util');var path=require(_0x5515('0x1'));var timeout=require(_0x5515('0x2'));var express=require(_0x5515('0x3'));var router=express[_0x5515('0x4')]();var auth=require(_0x5515('0x5'));var interaction=require(_0x5515('0x6'));var config=require(_0x5515('0x7'));var controller=require(_0x5515('0x8'));router[_0x5515('0x9')]('/',auth[_0x5515('0xa')](),controller[_0x5515('0xb')]);router[_0x5515('0x9')]('/:id',auth[_0x5515('0xa')](),controller[_0x5515('0xc')]);router['get'](_0x5515('0xd'),auth['isAuthenticated'](),controller[_0x5515('0xe')]);var upload=multer({'storage':multer[_0x5515('0xf')]({'destination':function(_0x31ba32,_0x50bdaf,_0x458e8d){_0x458e8d(null,path[_0x5515('0x10')](config[_0x5515('0x11')],_0x5515('0x12')));},'filename':function(_0x2c94ae,_0x2d0361,_0x2ab64f){_0x2d0361['originalname']=_0x2d0361[_0x5515('0x13')][_0x5515('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2ab64f(null,util[_0x5515('0x15')]('%s-%s%s',path[_0x5515('0x16')](_0x2d0361[_0x5515('0x13')],path[_0x5515('0x17')](_0x2d0361['originalname'])),Date[_0x5515('0x18')](),path[_0x5515('0x17')](_0x2d0361[_0x5515('0x13')])));}})});router[_0x5515('0x19')]('/',upload['single'](_0x5515('0x1a')),controller[_0x5515('0x1b')]);router[_0x5515('0x1c')](_0x5515('0x1d'),auth[_0x5515('0xa')](),controller[_0x5515('0x1e')]);router[_0x5515('0x1f')](_0x5515('0x1d'),auth[_0x5515('0xa')](),controller[_0x5515('0x1f')]);module['exports']=router; \ No newline at end of file +var _0xfb39=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','format','basename','originalname','extname','post','single','file','put','update','delete'];(function(_0x46330,_0x367396){var _0xdb4806=function(_0x3647d2){while(--_0x3647d2){_0x46330['push'](_0x46330['shift']());}};_0xdb4806(++_0x367396);}(_0xfb39,0xd3));var _0x9fb3=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xfb39[_0x1ac595];return _0x455fff;};'use strict';var multer=require('multer');var util=require(_0x9fb3('0x0'));var path=require(_0x9fb3('0x1'));var timeout=require(_0x9fb3('0x2'));var express=require(_0x9fb3('0x3'));var router=express[_0x9fb3('0x4')]();var auth=require(_0x9fb3('0x5'));var interaction=require(_0x9fb3('0x6'));var config=require(_0x9fb3('0x7'));var controller=require('./sound.controller');router[_0x9fb3('0x8')]('/',auth[_0x9fb3('0x9')](),controller[_0x9fb3('0xa')]);router[_0x9fb3('0x8')](_0x9fb3('0xb'),auth['isAuthenticated'](),controller[_0x9fb3('0xc')]);router[_0x9fb3('0x8')](_0x9fb3('0xd'),auth[_0x9fb3('0x9')](),controller[_0x9fb3('0xe')]);var upload=multer({'storage':multer[_0x9fb3('0xf')]({'destination':function(_0x1d6aec,_0x5e28ff,_0x5a6787){_0x5a6787(null,path[_0x9fb3('0x10')](config[_0x9fb3('0x11')],_0x9fb3('0x12')));},'filename':function(_0xfd408e,_0x29406f,_0x3556ad){_0x29406f['originalname']=_0x29406f['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3556ad(null,util[_0x9fb3('0x13')]('%s-%s%s',path[_0x9fb3('0x14')](_0x29406f[_0x9fb3('0x15')],path[_0x9fb3('0x16')](_0x29406f[_0x9fb3('0x15')])),Date['now'](),path[_0x9fb3('0x16')](_0x29406f[_0x9fb3('0x15')])));}})});router[_0x9fb3('0x17')]('/',upload[_0x9fb3('0x18')](_0x9fb3('0x19')),controller['create']);router[_0x9fb3('0x1a')](_0x9fb3('0xb'),auth[_0x9fb3('0x9')](),controller[_0x9fb3('0x1b')]);router[_0x9fb3('0x1c')](_0x9fb3('0xb'),auth['isAuthenticated'](),controller[_0x9fb3('0x1c')]);module[_0x9fb3('0x1d')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index e16714c..7cc13eb 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 _0x81e3=['INTEGER','sequelize','exports','STRING','FLOAT','BIGINT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81e3,0x109));var _0x381e=function(_0x1f29a8,_0x15ee9b){_0x1f29a8=_0x1f29a8-0x0;var _0xc62ab7=_0x81e3[_0x1f29a8];return _0xc62ab7;};'use strict';var Sequelize=require(_0x381e('0x0'));module[_0x381e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x381e('0x2')]},'display_name':{'type':Sequelize[_0x381e('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x381e('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x381e('0x3')]},'original_sampleCount':{'type':Sequelize[_0x381e('0x4')]},'original_channelCount':{'type':Sequelize[_0x381e('0x5')]},'original_bitRate':{'type':Sequelize[_0x381e('0x4')]},'original_sampleRate':{'type':Sequelize[_0x381e('0x5')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x381e('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x381e('0x5')]},'converted_bitRate':{'type':Sequelize[_0x381e('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x381e('0x5')]}}; \ No newline at end of file +var _0x32a7=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x44c79f,_0x21f727){var _0x4089ef=function(_0x5a237a){while(--_0x5a237a){_0x44c79f['push'](_0x44c79f['shift']());}};_0x4089ef(++_0x21f727);}(_0x32a7,0x100));var _0x732a=function(_0x716de7,_0x234dc5){_0x716de7=_0x716de7-0x0;var _0x55791c=_0x32a7[_0x716de7];return _0x55791c;};'use strict';var Sequelize=require(_0x732a('0x0'));module[_0x732a('0x1')]={'name':{'type':Sequelize[_0x732a('0x2')],'unique':_0x732a('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x732a('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x732a('0x2')]},'original_format':{'type':Sequelize[_0x732a('0x2')]},'original_duration':{'type':Sequelize[_0x732a('0x4')]},'original_sampleCount':{'type':Sequelize[_0x732a('0x5')]},'original_channelCount':{'type':Sequelize[_0x732a('0x6')]},'original_bitRate':{'type':Sequelize[_0x732a('0x5')]},'original_sampleRate':{'type':Sequelize[_0x732a('0x6')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize[_0x732a('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x732a('0x5')]},'converted_channelCount':{'type':Sequelize[_0x732a('0x6')]},'converted_bitRate':{'type':Sequelize[_0x732a('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index c37e293..85aff15 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 _0x4f45=['filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_sampleRate','end','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','catch','start','description','delete','original_format','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Sounds','UserProfileResource','error','stack','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','where','merge','map','type','VIRTUAL','field','filter','options','Sound','includeAll','include','rows','params','find','download','converted_format','existsSync','join','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','root','format','%s.%s','name','file','extname','originalname','basename'];(function(_0x395314,_0x1a215f){var _0x1fe274=function(_0x551f67){while(--_0x551f67){_0x395314['push'](_0x395314['shift']());}};_0x1fe274(++_0x1a215f);}(_0x4f45,0x9d));var _0x54f4=function(_0x66128e,_0x3d0c1b){_0x66128e=_0x66128e-0x0;var _0x5805d8=_0x4f45[_0x66128e];return _0x5805d8;};'use strict';var pdf=require(_0x54f4('0x0'));var emlformat=require(_0x54f4('0x1'));var rimraf=require(_0x54f4('0x2'));var zipdir=require(_0x54f4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x54f4('0x4'));var BPromise=require(_0x54f4('0x5'));var Mustache=require(_0x54f4('0x6'));var util=require(_0x54f4('0x7'));var path=require('path');var sox=require(_0x54f4('0x8'));var csv=require(_0x54f4('0x9'));var ejs=require(_0x54f4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x54f4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x54f4('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x54f4('0xd'));var logger=require(_0x54f4('0xe'))('api');var utils=require(_0x54f4('0xf'));var config=require('../../config/environment');var db=require(_0x54f4('0x10'))['db'];function respondWithStatusCode(_0x299ad7,_0x842d41){_0x842d41=_0x842d41||0xcc;return function(_0x50d120){if(_0x50d120){return _0x299ad7[_0x54f4('0x11')](_0x842d41);}return _0x299ad7['status'](_0x842d41)['end']();};}function respondWithResult(_0x130d21,_0x21359){_0x21359=_0x21359||0xc8;return function(_0x5644c1){if(_0x5644c1){return _0x130d21[_0x54f4('0x12')](_0x21359)[_0x54f4('0x13')](_0x5644c1);}};}function respondWithFilteredResult(_0x988784,_0x31a1eb){return function(_0x235151){if(_0x235151){var _0x35a64a=_0x235151[_0x54f4('0x14')],_0x32f637=_0x31a1eb[_0x54f4('0x15')],_0x5c804d=_0x31a1eb[_0x54f4('0x15')]+_0x31a1eb[_0x54f4('0x16')],_0x2fe240;if(_0x5c804d>=_0x35a64a){_0x5c804d=_0x35a64a;_0x2fe240=0xc8;}else{_0x2fe240=0xce;}_0x988784[_0x54f4('0x12')](_0x2fe240);return _0x988784[_0x54f4('0x17')](_0x54f4('0x18'),_0x32f637+'-'+_0x5c804d+'/'+_0x35a64a)[_0x54f4('0x13')](_0x235151);}return null;};}function patchUpdates(_0x381279){return function(_0x2dc227){try{jsonpatch[_0x54f4('0x19')](_0x2dc227,_0x381279,!![]);}catch(_0x965ef6){return BPromise[_0x54f4('0x1a')](_0x965ef6);}return _0x2dc227[_0x54f4('0x1b')]();};}function saveUpdates(_0x572466,_0x412d97){return function(_0x4de103){if(_0x4de103){return _0x4de103[_0x54f4('0x1c')](_0x572466)[_0x54f4('0x1d')](function(_0x5b92fe){return _0x5b92fe;});}return null;};}function removeEntity(_0xc99103,_0x2c7c76){return function(_0x3e6a3e){if(_0x3e6a3e){return _0x3e6a3e[_0x54f4('0x1e')]()['then'](function(){var _0x588230=_0x3e6a3e['get']({'plain':!![]});var _0x76b1da=_0x54f4('0x1f');return db[_0x54f4('0x20')]['destroy']({'where':{'type':_0x76b1da,'resourceId':_0x588230['id']}})[_0x54f4('0x1d')](function(){return _0x3e6a3e;});})[_0x54f4('0x1d')](function(){_0xc99103[_0x54f4('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34e856,_0x3bd385){return function(_0x217fb9){if(!_0x217fb9){_0x34e856[_0x54f4('0x11')](0x194);}return _0x217fb9;};}function handleError(_0x2562c9,_0xa5785b){_0xa5785b=_0xa5785b||0x1f4;return function(_0x588bac){logger[_0x54f4('0x21')](_0x588bac[_0x54f4('0x22')]);if(_0x588bac['name']){delete _0x588bac['name'];}_0x2562c9['status'](_0xa5785b)[_0x54f4('0x23')](_0x588bac);};}exports[_0x54f4('0x24')]=function(_0x4ad38a,_0x57820e){var _0x34eb5c={},_0x30a3f2={},_0x2c10d1={'count':0x0,'rows':[]};var _0x3260ad=db['Sound'][_0x54f4('0x25')];_0x30a3f2[_0x54f4('0x26')]=_[_0x54f4('0x27')](_0x3260ad);_0x30a3f2['query']=_['keys'](_0x4ad38a[_0x54f4('0x28')]);_0x30a3f2[_0x54f4('0x29')]=_[_0x54f4('0x2a')](_0x30a3f2[_0x54f4('0x26')],_0x30a3f2['query']);_0x34eb5c[_0x54f4('0x2b')]=_['intersection'](_0x30a3f2['model'],qs['fields'](_0x4ad38a[_0x54f4('0x28')][_0x54f4('0x2c')]));_0x34eb5c[_0x54f4('0x2b')]=_0x34eb5c[_0x54f4('0x2b')][_0x54f4('0x2d')]?_0x34eb5c[_0x54f4('0x2b')]:_0x30a3f2[_0x54f4('0x26')];if(!_0x4ad38a[_0x54f4('0x28')][_0x54f4('0x2e')]('nolimit')){_0x34eb5c[_0x54f4('0x16')]=qs[_0x54f4('0x16')](_0x4ad38a[_0x54f4('0x28')][_0x54f4('0x16')]);_0x34eb5c[_0x54f4('0x15')]=qs[_0x54f4('0x15')](_0x4ad38a[_0x54f4('0x28')][_0x54f4('0x15')]);}_0x34eb5c['order']=qs[_0x54f4('0x2f')](_0x4ad38a['query'][_0x54f4('0x2f')]);_0x34eb5c['where']=qs[_0x54f4('0x29')](_[_0x54f4('0x30')](_0x4ad38a['query'],_0x30a3f2[_0x54f4('0x29')]));if(_0x4ad38a[_0x54f4('0x28')]['filter']){_0x34eb5c[_0x54f4('0x31')]=_[_0x54f4('0x32')](_0x34eb5c['where'],{'$or':_[_0x54f4('0x33')](_0x3260ad,function(_0x16634a){if(_0x16634a[_0x54f4('0x34')]['key']!==_0x54f4('0x35')){var _0x4ca3a9={};_0x4ca3a9[_0x16634a[_0x54f4('0x36')]]={'$like':'%'+_0x4ad38a[_0x54f4('0x28')][_0x54f4('0x37')]+'%'};return _0x4ca3a9;}})});}_0x34eb5c=_['merge']({},_0x34eb5c,_0x4ad38a[_0x54f4('0x38')]);var _0x57b8f8={'where':_0x34eb5c[_0x54f4('0x31')]};return db[_0x54f4('0x39')][_0x54f4('0x14')](_0x57b8f8)[_0x54f4('0x1d')](function(_0x37cbd0){_0x2c10d1[_0x54f4('0x14')]=_0x37cbd0;if(_0x4ad38a[_0x54f4('0x28')][_0x54f4('0x3a')]){_0x34eb5c[_0x54f4('0x3b')]=[{'all':!![]}];}return db[_0x54f4('0x39')]['findAll'](_0x34eb5c);})['then'](function(_0xec601f){_0x2c10d1[_0x54f4('0x3c')]=_0xec601f;return _0x2c10d1;})[_0x54f4('0x1d')](respondWithFilteredResult(_0x57820e,_0x34eb5c))['catch'](handleError(_0x57820e,null));};exports['show']=function(_0x43d899,_0x55c723){var _0x2ec49f={'raw':!![],'where':{'id':_0x43d899[_0x54f4('0x3d')]['id']}},_0x2584fe={};_0x2584fe['model']=_['keys'](db[_0x54f4('0x39')][_0x54f4('0x25')]);_0x2584fe[_0x54f4('0x28')]=_[_0x54f4('0x27')](_0x43d899['query']);_0x2584fe['filters']=_[_0x54f4('0x2a')](_0x2584fe[_0x54f4('0x26')],_0x2584fe['query']);_0x2ec49f[_0x54f4('0x2b')]=_['intersection'](_0x2584fe[_0x54f4('0x26')],qs[_0x54f4('0x2c')](_0x43d899[_0x54f4('0x28')][_0x54f4('0x2c')]));_0x2ec49f[_0x54f4('0x2b')]=_0x2ec49f[_0x54f4('0x2b')][_0x54f4('0x2d')]?_0x2ec49f[_0x54f4('0x2b')]:_0x2584fe[_0x54f4('0x26')];if(_0x43d899[_0x54f4('0x28')][_0x54f4('0x3a')]){_0x2ec49f[_0x54f4('0x3b')]=[{'all':!![]}];}_0x2ec49f=_[_0x54f4('0x32')]({},_0x2ec49f,_0x43d899[_0x54f4('0x38')]);return db[_0x54f4('0x39')][_0x54f4('0x3e')](_0x2ec49f)[_0x54f4('0x1d')](handleEntityNotFound(_0x55c723,null))[_0x54f4('0x1d')](respondWithResult(_0x55c723,null))['catch'](handleError(_0x55c723,null));};exports[_0x54f4('0x3f')]=function(_0x395108,_0x14cf5d,_0x15449d){return db[_0x54f4('0x39')][_0x54f4('0x3e')]({'where':{'id':_0x395108[_0x54f4('0x3d')]['id']},'attributes':['name','save_name',_0x54f4('0x40')],'raw':!![]})[_0x54f4('0x1d')](handleEntityNotFound(_0x14cf5d,null))['then'](function(_0x45c37a){if(_0x45c37a){if(!fs[_0x54f4('0x41')](path[_0x54f4('0x42')](config['root'],_0x54f4('0x43'),_0x45c37a[_0x54f4('0x44')]+'.'+_0x45c37a[_0x54f4('0x40')]))){throw new db[(_0x54f4('0x45'))]['ValidationError'](_0x54f4('0x46'));}return _0x14cf5d['download'](path['join'](config[_0x54f4('0x47')],'server/files/sounds/converted',util[_0x54f4('0x48')](_0x54f4('0x49'),_0x45c37a[_0x54f4('0x44')],_0x45c37a[_0x54f4('0x40')])),util['format'](_0x54f4('0x49'),_0x45c37a[_0x54f4('0x4a')],_0x45c37a[_0x54f4('0x40')]));}return null;})['catch'](handleError(_0x14cf5d,null));};exports['create']=function(_0x386e67,_0x12675b,_0x4803f6){var _0x13f438={'name':path['basename'](_0x386e67[_0x54f4('0x4b')]['originalname'],path[_0x54f4('0x4c')](_0x386e67[_0x54f4('0x4b')][_0x54f4('0x4d')])),'save_name':path[_0x54f4('0x4e')](_0x386e67[_0x54f4('0x4b')]['filename'],path[_0x54f4('0x4c')](_0x386e67['file'][_0x54f4('0x4f')])),'original_format':path[_0x54f4('0x4c')](_0x386e67[_0x54f4('0x4b')]['originalname'])[_0x54f4('0x50')](0x1),'converted_format':'wav'};var _0x4390b3=path['join'](config[_0x54f4('0x47')],_0x54f4('0x51'),_0x386e67[_0x54f4('0x4b')][_0x54f4('0x4f')]);var _0x29e894=path[_0x54f4('0x42')](config['root'],_0x54f4('0x43'),util[_0x54f4('0x48')](_0x54f4('0x49'),path[_0x54f4('0x4e')](_0x386e67[_0x54f4('0x4b')]['filename'],path[_0x54f4('0x4c')](_0x386e67[_0x54f4('0x4b')][_0x54f4('0x4f')])),_0x13f438[_0x54f4('0x40')]));logger[_0x54f4('0x52')](_0x54f4('0x53'),_0x4390b3);logger[_0x54f4('0x52')](_0x54f4('0x54'),_0x29e894);try{fs[_0x54f4('0x55')](_0x4390b3,parseInt(_0x54f4('0x56'),0x8));var _0x22fef9=sox[_0x54f4('0x57')](_0x4390b3,_0x29e894,{'sampleRate':0x1f40,'format':_0x54f4('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x22fef9['on'](_0x54f4('0x21'),function(_0x59815d){fs['unlinkSync'](_0x4390b3);_0x12675b[_0x54f4('0x12')](0x1f4)['send'](_0x59815d);});_0x22fef9['on']('src',function(_0x14ecdf){_0x13f438[_0x54f4('0x59')]=isNaN(_0x14ecdf[_0x54f4('0x5a')])?null:_0x14ecdf[_0x54f4('0x5a')]*0x3e8;_0x13f438[_0x54f4('0x5b')]=isNaN(_0x14ecdf[_0x54f4('0x5c')])?null:_0x14ecdf[_0x54f4('0x5c')];_0x13f438[_0x54f4('0x5d')]=isNaN(_0x14ecdf['channelCount'])?null:_0x14ecdf[_0x54f4('0x5e')];_0x13f438[_0x54f4('0x5f')]=isNaN(_0x14ecdf[_0x54f4('0x60')])?null:_0x14ecdf[_0x54f4('0x60')];_0x13f438['original_sampleRate']=isNaN(_0x14ecdf[_0x54f4('0x61')])?null:_0x14ecdf['sampleRate'];});_0x22fef9['on'](_0x54f4('0x62'),function(_0x460c80){_0x13f438['converted_duration']=isNaN(_0x460c80['duration'])?null:_0x460c80['duration']*0x3e8;_0x13f438[_0x54f4('0x63')]=isNaN(_0x460c80[_0x54f4('0x5c')])?null:_0x460c80[_0x54f4('0x5c')];_0x13f438[_0x54f4('0x64')]=isNaN(_0x460c80[_0x54f4('0x5e')])?null:_0x460c80[_0x54f4('0x5e')];_0x13f438['converted_bitRate']=isNaN(_0x460c80[_0x54f4('0x60')])?null:_0x460c80[_0x54f4('0x60')];_0x13f438[_0x54f4('0x65')]=isNaN(_0x460c80['sampleRate'])?null:_0x460c80[_0x54f4('0x61')];});_0x22fef9['on'](_0x54f4('0x66'),function(){fs[_0x54f4('0x55')](_0x29e894,parseInt(_0x54f4('0x56'),0x8));return db[_0x54f4('0x39')][_0x54f4('0x67')](_0x13f438)[_0x54f4('0x1d')](function(_0x89470f){var _0x3bcc8e={'role':_0x386e67[_0x54f4('0x68')][_0x54f4('0x69')],'userProfileId':_0x386e67[_0x54f4('0x68')]['userProfileId']};if(!_0x3bcc8e)throw new Error(_0x54f4('0x6a'));if(_0x3bcc8e[_0x54f4('0x69')]===_0x54f4('0x6b')){var _0x4b4140=_0x89470f[_0x54f4('0x6c')]({'plain':!![]});return db[_0x54f4('0x6d')][_0x54f4('0x3e')]({'where':{'name':'Sounds','userProfileId':_0x3bcc8e[_0x54f4('0x6e')]},'raw':!![]})[_0x54f4('0x1d')](function(_0x1385fb){if(_0x1385fb&&_0x1385fb[_0x54f4('0x6f')]===0x0){return db['UserProfileResource'][_0x54f4('0x67')]({'name':_0x4b4140[_0x54f4('0x4a')],'resourceId':_0x4b4140['id'],'type':_0x1385fb[_0x54f4('0x4a')],'sectionId':_0x1385fb['id']},{})[_0x54f4('0x1d')](function(){return _0x89470f;});}else{return _0x89470f;}})[_0x54f4('0x70')](function(_0x11a479){logger[_0x54f4('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11a479);throw _0x11a479;});}return _0x89470f;})[_0x54f4('0x1d')](respondWithResult(_0x12675b,null))[_0x54f4('0x70')](handleError(_0x12675b,null));});_0x22fef9[_0x54f4('0x71')]();}catch(_0x3d211c){_0x12675b[_0x54f4('0x12')](0x1f4)[_0x54f4('0x23')](_0x3d211c);}};exports[_0x54f4('0x1c')]=function(_0x1692c9,_0x54ca1e,_0x659635){return db[_0x54f4('0x39')][_0x54f4('0x3e')]({'where':{'id':_0x1692c9[_0x54f4('0x3d')]['id']}})[_0x54f4('0x1d')](handleEntityNotFound(_0x54ca1e,null))[_0x54f4('0x1d')](saveUpdates(_[_0x54f4('0x30')](_0x1692c9[_0x54f4('0x68')],['name',_0x54f4('0x72')]),null))[_0x54f4('0x1d')](respondWithResult(_0x54ca1e,null))[_0x54f4('0x70')](handleError(_0x54ca1e,null));};exports[_0x54f4('0x73')]=function(_0x3d7935,_0x4d04ad,_0x452ae1){return db[_0x54f4('0x39')][_0x54f4('0x3e')]({'where':{'id':_0x3d7935[_0x54f4('0x3d')]['id']}})[_0x54f4('0x1d')](function(_0x21e33c){if(_0x21e33c){return _0x21e33c['destroy']();}})[_0x54f4('0x1d')](function(_0x5d63c9){var _0xd3e9e1=path[_0x54f4('0x42')](config[_0x54f4('0x47')],_0x54f4('0x51'),util[_0x54f4('0x48')](_0x54f4('0x49'),_0x5d63c9['save_name'],_0x5d63c9[_0x54f4('0x74')]));var _0x2e9b5c=path[_0x54f4('0x42')](config['root'],'server/files/sounds/converted',util[_0x54f4('0x48')]('%s.%s',_0x5d63c9['save_name'],_0x5d63c9[_0x54f4('0x40')]));fs['unlinkSync'](_0xd3e9e1);fs[_0x54f4('0x75')](_0x2e9b5c);return _0x5d63c9;})[_0x54f4('0x1d')](function(_0x244230){if(_0x244230){return _0x4d04ad['status'](0xcc)[_0x54f4('0x66')]();}})[_0x54f4('0x1d')](handleEntityNotFound(_0x4d04ad,null))[_0x54f4('0x70')](handleError(_0x4d04ad,null));}; \ No newline at end of file +var _0x1e94=['../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','end','sendStatus','stack','name','send','index','Sound','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','error','unlinkSync','original_duration','duration','original_sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','description','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x50ab95,_0x480438){var _0x2c62cd=function(_0x2af369){while(--_0x2af369){_0x50ab95['push'](_0x50ab95['shift']());}};_0x2c62cd(++_0x480438);}(_0x1e94,0x1ed));var _0x41e9=function(_0x596c9b,_0x10b4a6){_0x596c9b=_0x596c9b-0x0;var _0x43e0ba=_0x1e94[_0x596c9b];return _0x43e0ba;};'use strict';var pdf=require(_0x41e9('0x0'));var emlformat=require(_0x41e9('0x1'));var rimraf=require(_0x41e9('0x2'));var zipdir=require(_0x41e9('0x3'));var jsonpatch=require(_0x41e9('0x4'));var rp=require(_0x41e9('0x5'));var moment=require('moment');var BPromise=require(_0x41e9('0x6'));var Mustache=require(_0x41e9('0x7'));var util=require('util');var path=require(_0x41e9('0x8'));var sox=require(_0x41e9('0x9'));var csv=require('to-csv');var ejs=require(_0x41e9('0xa'));var fs=require('fs');var _=require(_0x41e9('0xb'));var squel=require('squel');var crypto=require(_0x41e9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x41e9('0xd'));var toCsv=require(_0x41e9('0xe'));var querystring=require('querystring');var Papa=require(_0x41e9('0xf'));var Redis=require('ioredis');var authService=require(_0x41e9('0x10'));var qs=require(_0x41e9('0x11'));var hardwareService=require(_0x41e9('0x12'));var logger=require(_0x41e9('0x13'))(_0x41e9('0x14'));var utils=require('../../config/utils');var config=require(_0x41e9('0x15'));var db=require(_0x41e9('0x16'))['db'];function respondWithStatusCode(_0x2eb8df,_0x3ffca7){_0x3ffca7=_0x3ffca7||0xcc;return function(_0x1af719){if(_0x1af719){return _0x2eb8df['sendStatus'](_0x3ffca7);}return _0x2eb8df['status'](_0x3ffca7)['end']();};}function respondWithResult(_0x9baf7f,_0x3930ec){_0x3930ec=_0x3930ec||0xc8;return function(_0x56d4f3){if(_0x56d4f3){return _0x9baf7f[_0x41e9('0x17')](_0x3930ec)[_0x41e9('0x18')](_0x56d4f3);}};}function respondWithFilteredResult(_0x284196,_0x41ef97){return function(_0xacfd0a){if(_0xacfd0a){var _0x1f8317=_0xacfd0a['count'],_0x87bda5=_0x41ef97[_0x41e9('0x19')],_0x4025b9=_0x41ef97['offset']+_0x41ef97[_0x41e9('0x1a')],_0x3677a8;if(_0x4025b9>=_0x1f8317){_0x4025b9=_0x1f8317;_0x3677a8=0xc8;}else{_0x3677a8=0xce;}_0x284196[_0x41e9('0x17')](_0x3677a8);return _0x284196[_0x41e9('0x1b')](_0x41e9('0x1c'),_0x87bda5+'-'+_0x4025b9+'/'+_0x1f8317)[_0x41e9('0x18')](_0xacfd0a);}return null;};}function patchUpdates(_0x4099d5){return function(_0x425915){try{jsonpatch[_0x41e9('0x1d')](_0x425915,_0x4099d5,!![]);}catch(_0x5dbd3c){return BPromise[_0x41e9('0x1e')](_0x5dbd3c);}return _0x425915[_0x41e9('0x1f')]();};}function saveUpdates(_0x4358a9,_0xd77a28){return function(_0x59600){if(_0x59600){return _0x59600[_0x41e9('0x20')](_0x4358a9)[_0x41e9('0x21')](function(_0x6e17f){return _0x6e17f;});}return null;};}function removeEntity(_0x376dd8,_0x3891be){return function(_0x278cf3){if(_0x278cf3){return _0x278cf3[_0x41e9('0x22')]()['then'](function(){var _0xcdd8b9=_0x278cf3[_0x41e9('0x23')]({'plain':!![]});var _0x12bb63=_0x41e9('0x24');return db[_0x41e9('0x25')][_0x41e9('0x22')]({'where':{'type':_0x12bb63,'resourceId':_0xcdd8b9['id']}})[_0x41e9('0x21')](function(){return _0x278cf3;});})['then'](function(){_0x376dd8['status'](0xcc)[_0x41e9('0x26')]();});}};}function handleEntityNotFound(_0x5a2eda,_0x3b6f8d){return function(_0x597009){if(!_0x597009){_0x5a2eda[_0x41e9('0x27')](0x194);}return _0x597009;};}function handleError(_0x19ebac,_0x342a78){_0x342a78=_0x342a78||0x1f4;return function(_0xd5edbf){logger['error'](_0xd5edbf[_0x41e9('0x28')]);if(_0xd5edbf[_0x41e9('0x29')]){delete _0xd5edbf['name'];}_0x19ebac[_0x41e9('0x17')](_0x342a78)[_0x41e9('0x2a')](_0xd5edbf);};}exports[_0x41e9('0x2b')]=function(_0x26af6c,_0x13b75e){var _0x1de780={},_0x518977={},_0x1a466e={'count':0x0,'rows':[]};var _0x521d77=db[_0x41e9('0x2c')]['rawAttributes'];_0x518977[_0x41e9('0x2d')]=_[_0x41e9('0x2e')](_0x521d77);_0x518977[_0x41e9('0x2f')]=_[_0x41e9('0x2e')](_0x26af6c[_0x41e9('0x2f')]);_0x518977[_0x41e9('0x30')]=_[_0x41e9('0x31')](_0x518977['model'],_0x518977[_0x41e9('0x2f')]);_0x1de780['attributes']=_[_0x41e9('0x31')](_0x518977[_0x41e9('0x2d')],qs[_0x41e9('0x32')](_0x26af6c[_0x41e9('0x2f')]['fields']));_0x1de780[_0x41e9('0x33')]=_0x1de780['attributes'][_0x41e9('0x34')]?_0x1de780[_0x41e9('0x33')]:_0x518977['model'];if(!_0x26af6c[_0x41e9('0x2f')][_0x41e9('0x35')](_0x41e9('0x36'))){_0x1de780[_0x41e9('0x1a')]=qs['limit'](_0x26af6c[_0x41e9('0x2f')]['limit']);_0x1de780[_0x41e9('0x19')]=qs[_0x41e9('0x19')](_0x26af6c['query'][_0x41e9('0x19')]);}_0x1de780[_0x41e9('0x37')]=qs['sort'](_0x26af6c['query'][_0x41e9('0x38')]);_0x1de780[_0x41e9('0x39')]=qs[_0x41e9('0x30')](_[_0x41e9('0x3a')](_0x26af6c[_0x41e9('0x2f')],_0x518977[_0x41e9('0x30')]));if(_0x26af6c['query'][_0x41e9('0x3b')]){_0x1de780[_0x41e9('0x39')]=_[_0x41e9('0x3c')](_0x1de780['where'],{'$or':_[_0x41e9('0x3d')](_0x521d77,function(_0x411844){if(_0x411844[_0x41e9('0x3e')][_0x41e9('0x3f')]!==_0x41e9('0x40')){var _0x148fd1={};_0x148fd1[_0x411844['field']]={'$like':'%'+_0x26af6c[_0x41e9('0x2f')][_0x41e9('0x3b')]+'%'};return _0x148fd1;}})});}_0x1de780=_[_0x41e9('0x3c')]({},_0x1de780,_0x26af6c['options']);var _0x535be4={'where':_0x1de780['where']};return db['Sound'][_0x41e9('0x41')](_0x535be4)['then'](function(_0x512123){_0x1a466e['count']=_0x512123;if(_0x26af6c[_0x41e9('0x2f')][_0x41e9('0x42')]){_0x1de780[_0x41e9('0x43')]=[{'all':!![]}];}return db['Sound'][_0x41e9('0x44')](_0x1de780);})[_0x41e9('0x21')](function(_0x4ba825){_0x1a466e[_0x41e9('0x45')]=_0x4ba825;return _0x1a466e;})['then'](respondWithFilteredResult(_0x13b75e,_0x1de780))[_0x41e9('0x46')](handleError(_0x13b75e,null));};exports[_0x41e9('0x47')]=function(_0xa89087,_0x5a27ea){var _0x39ac6f={'raw':!![],'where':{'id':_0xa89087[_0x41e9('0x48')]['id']}},_0x55e7bd={};_0x55e7bd['model']=_[_0x41e9('0x2e')](db[_0x41e9('0x2c')][_0x41e9('0x49')]);_0x55e7bd[_0x41e9('0x2f')]=_[_0x41e9('0x2e')](_0xa89087[_0x41e9('0x2f')]);_0x55e7bd[_0x41e9('0x30')]=_[_0x41e9('0x31')](_0x55e7bd[_0x41e9('0x2d')],_0x55e7bd[_0x41e9('0x2f')]);_0x39ac6f['attributes']=_[_0x41e9('0x31')](_0x55e7bd[_0x41e9('0x2d')],qs[_0x41e9('0x32')](_0xa89087[_0x41e9('0x2f')][_0x41e9('0x32')]));_0x39ac6f['attributes']=_0x39ac6f['attributes'][_0x41e9('0x34')]?_0x39ac6f[_0x41e9('0x33')]:_0x55e7bd[_0x41e9('0x2d')];if(_0xa89087[_0x41e9('0x2f')]['includeAll']){_0x39ac6f[_0x41e9('0x43')]=[{'all':!![]}];}_0x39ac6f=_[_0x41e9('0x3c')]({},_0x39ac6f,_0xa89087[_0x41e9('0x4a')]);return db[_0x41e9('0x2c')][_0x41e9('0x4b')](_0x39ac6f)[_0x41e9('0x21')](handleEntityNotFound(_0x5a27ea,null))[_0x41e9('0x21')](respondWithResult(_0x5a27ea,null))[_0x41e9('0x46')](handleError(_0x5a27ea,null));};exports[_0x41e9('0x4c')]=function(_0x26c66b,_0x840b2f,_0x44fee9){return db['Sound'][_0x41e9('0x4b')]({'where':{'id':_0x26c66b[_0x41e9('0x48')]['id']},'attributes':['name',_0x41e9('0x4d'),'converted_format'],'raw':!![]})[_0x41e9('0x21')](handleEntityNotFound(_0x840b2f,null))[_0x41e9('0x21')](function(_0x151122){if(_0x151122){if(!fs[_0x41e9('0x4e')](path[_0x41e9('0x4f')](config[_0x41e9('0x50')],_0x41e9('0x51'),_0x151122['save_name']+'.'+_0x151122[_0x41e9('0x52')]))){throw new db[(_0x41e9('0x53'))][(_0x41e9('0x54'))](_0x41e9('0x55'));}return _0x840b2f['download'](path[_0x41e9('0x4f')](config['root'],_0x41e9('0x51'),util[_0x41e9('0x56')](_0x41e9('0x57'),_0x151122[_0x41e9('0x4d')],_0x151122['converted_format'])),util['format'](_0x41e9('0x57'),_0x151122['name'],_0x151122[_0x41e9('0x52')]));}return null;})[_0x41e9('0x46')](handleError(_0x840b2f,null));};exports[_0x41e9('0x58')]=function(_0x2544ad,_0x14aa7d,_0x417a7d){var _0x403fe7={'name':path[_0x41e9('0x59')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5b')],path[_0x41e9('0x5c')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5b')])),'save_name':path[_0x41e9('0x59')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')],path['extname'](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')])),'original_format':path[_0x41e9('0x5c')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5b')])[_0x41e9('0x5e')](0x1),'converted_format':_0x41e9('0x5f')};var _0x40d55b=path[_0x41e9('0x4f')](config['root'],_0x41e9('0x60'),_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')]);var _0x3f50c8=path[_0x41e9('0x4f')](config[_0x41e9('0x50')],'server/files/sounds/converted',util['format'](_0x41e9('0x57'),path[_0x41e9('0x59')](_0x2544ad['file'][_0x41e9('0x5d')],path[_0x41e9('0x5c')](_0x2544ad[_0x41e9('0x5a')][_0x41e9('0x5d')])),_0x403fe7['converted_format']));logger[_0x41e9('0x61')](_0x41e9('0x62'),_0x40d55b);logger[_0x41e9('0x61')]('Sound\x20upload\x20destination:\x20%s',_0x3f50c8);try{fs[_0x41e9('0x63')](_0x40d55b,parseInt(_0x41e9('0x64'),0x8));var _0x779ee1=sox['transcode'](_0x40d55b,_0x3f50c8,{'sampleRate':0x1f40,'format':_0x41e9('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x779ee1['on'](_0x41e9('0x65'),function(_0x4dc9fb){fs[_0x41e9('0x66')](_0x40d55b);_0x14aa7d[_0x41e9('0x17')](0x1f4)['send'](_0x4dc9fb);});_0x779ee1['on']('src',function(_0xc9da33){_0x403fe7[_0x41e9('0x67')]=isNaN(_0xc9da33[_0x41e9('0x68')])?null:_0xc9da33['duration']*0x3e8;_0x403fe7[_0x41e9('0x69')]=isNaN(_0xc9da33['sampleCount'])?null:_0xc9da33['sampleCount'];_0x403fe7[_0x41e9('0x6a')]=isNaN(_0xc9da33['channelCount'])?null:_0xc9da33[_0x41e9('0x6b')];_0x403fe7[_0x41e9('0x6c')]=isNaN(_0xc9da33[_0x41e9('0x6d')])?null:_0xc9da33['bitRate'];_0x403fe7[_0x41e9('0x6e')]=isNaN(_0xc9da33[_0x41e9('0x6f')])?null:_0xc9da33[_0x41e9('0x6f')];});_0x779ee1['on'](_0x41e9('0x70'),function(_0x298272){_0x403fe7[_0x41e9('0x71')]=isNaN(_0x298272[_0x41e9('0x68')])?null:_0x298272['duration']*0x3e8;_0x403fe7['converted_sampleCount']=isNaN(_0x298272[_0x41e9('0x72')])?null:_0x298272[_0x41e9('0x72')];_0x403fe7[_0x41e9('0x73')]=isNaN(_0x298272[_0x41e9('0x6b')])?null:_0x298272[_0x41e9('0x6b')];_0x403fe7[_0x41e9('0x74')]=isNaN(_0x298272['bitRate'])?null:_0x298272[_0x41e9('0x6d')];_0x403fe7[_0x41e9('0x75')]=isNaN(_0x298272['sampleRate'])?null:_0x298272[_0x41e9('0x6f')];});_0x779ee1['on'](_0x41e9('0x26'),function(){fs[_0x41e9('0x63')](_0x3f50c8,parseInt(_0x41e9('0x64'),0x8));return db[_0x41e9('0x2c')][_0x41e9('0x58')](_0x403fe7)[_0x41e9('0x21')](function(_0x5fb9af){var _0x10153e={'role':_0x2544ad['body'][_0x41e9('0x76')],'userProfileId':_0x2544ad['body']['userProfileId']};if(!_0x10153e)throw new Error(_0x41e9('0x77'));if(_0x10153e[_0x41e9('0x76')]==='user'){var _0x14eafb=_0x5fb9af['get']({'plain':!![]});return db[_0x41e9('0x78')][_0x41e9('0x4b')]({'where':{'name':_0x41e9('0x24'),'userProfileId':_0x10153e[_0x41e9('0x79')]},'raw':!![]})[_0x41e9('0x21')](function(_0x34c1d6){if(_0x34c1d6&&_0x34c1d6[_0x41e9('0x7a')]===0x0){return db[_0x41e9('0x25')][_0x41e9('0x58')]({'name':_0x14eafb[_0x41e9('0x29')],'resourceId':_0x14eafb['id'],'type':_0x34c1d6[_0x41e9('0x29')],'sectionId':_0x34c1d6['id']},{})['then'](function(){return _0x5fb9af;});}else{return _0x5fb9af;}})['catch'](function(_0xa8cc7f){logger[_0x41e9('0x65')](_0x41e9('0x7b'),_0xa8cc7f);throw _0xa8cc7f;});}return _0x5fb9af;})[_0x41e9('0x21')](respondWithResult(_0x14aa7d,null))['catch'](handleError(_0x14aa7d,null));});_0x779ee1['start']();}catch(_0x3d795e){_0x14aa7d['status'](0x1f4)['send'](_0x3d795e);}};exports[_0x41e9('0x20')]=function(_0x209dcf,_0x419327,_0x18692e){return db[_0x41e9('0x2c')][_0x41e9('0x4b')]({'where':{'id':_0x209dcf['params']['id']}})['then'](handleEntityNotFound(_0x419327,null))[_0x41e9('0x21')](saveUpdates(_[_0x41e9('0x3a')](_0x209dcf[_0x41e9('0x7c')],[_0x41e9('0x29'),_0x41e9('0x7d')]),null))[_0x41e9('0x21')](respondWithResult(_0x419327,null))['catch'](handleError(_0x419327,null));};exports[_0x41e9('0x7e')]=function(_0x559511,_0x3bea6b,_0x5cd27d){return db['Sound']['find']({'where':{'id':_0x559511[_0x41e9('0x48')]['id']}})[_0x41e9('0x21')](function(_0x1bc8b4){if(_0x1bc8b4){return _0x1bc8b4['destroy']();}})['then'](function(_0x77e128){var _0x30d3f0=path[_0x41e9('0x4f')](config[_0x41e9('0x50')],_0x41e9('0x60'),util[_0x41e9('0x56')](_0x41e9('0x57'),_0x77e128[_0x41e9('0x4d')],_0x77e128[_0x41e9('0x7f')]));var _0x2e7725=path[_0x41e9('0x4f')](config['root'],_0x41e9('0x51'),util[_0x41e9('0x56')](_0x41e9('0x57'),_0x77e128[_0x41e9('0x4d')],_0x77e128[_0x41e9('0x52')]));fs[_0x41e9('0x66')](_0x30d3f0);fs['unlinkSync'](_0x2e7725);return _0x77e128;})[_0x41e9('0x21')](function(_0xed8681){if(_0xed8681){return _0x3bea6b['status'](0xcc)[_0x41e9('0x26')]();}})[_0x41e9('0x21')](handleEntityNotFound(_0x3bea6b,null))['catch'](handleError(_0x3bea6b,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 62d1eee..0a4dfb9 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 _0x3b64=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Sound'];(function(_0x1881ac,_0x57ecf4){var _0x3b966e=function(_0x134036){while(--_0x134036){_0x1881ac['push'](_0x1881ac['shift']());}};_0x3b966e(++_0x57ecf4);}(_0x3b64,0x8c));var _0x43b6=function(_0x1f59e8,_0x19d992){_0x1f59e8=_0x1f59e8-0x0;var _0x3c18f6=_0x3b64[_0x1f59e8];return _0x3c18f6;};'use strict';var _=require(_0x43b6('0x0'));var util=require(_0x43b6('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x43b6('0x2'));var rp=require(_0x43b6('0x3'));var fs=require('fs');var path=require(_0x43b6('0x4'));var rimraf=require(_0x43b6('0x5'));var config=require(_0x43b6('0x6'));var attributes=require('./sound.attributes');module[_0x43b6('0x7')]=function(_0xacaaa,_0x6e9b6b){return _0xacaaa[_0x43b6('0x8')](_0x43b6('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53b4=['bluebird','request-promise','path','../../config/environment','./sound.attributes','exports','define','Sound','lodash','util','../../config/logger','api','moment'];(function(_0x933a0b,_0x8985b0){var _0x3d4991=function(_0x52a0aa){while(--_0x52a0aa){_0x933a0b['push'](_0x933a0b['shift']());}};_0x3d4991(++_0x8985b0);}(_0x53b4,0xb1));var _0x453b=function(_0x46a14f,_0x46ca40){_0x46a14f=_0x46a14f-0x0;var _0x4e26f9=_0x53b4[_0x46a14f];return _0x4e26f9;};'use strict';var _=require(_0x453b('0x0'));var util=require(_0x453b('0x1'));var logger=require(_0x453b('0x2'))(_0x453b('0x3'));var moment=require(_0x453b('0x4'));var BPromise=require(_0x453b('0x5'));var rp=require(_0x453b('0x6'));var fs=require('fs');var path=require(_0x453b('0x7'));var rimraf=require('rimraf');var config=require(_0x453b('0x8'));var attributes=require(_0x453b('0x9'));module[_0x453b('0xa')]=function(_0x37f584,_0x5d996e){return _0x37f584[_0x453b('0xb')](_0x453b('0xc'),attributes,{'tableName':'tools_sounds','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 9399704..f9fec1e 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 _0xa9e0=['then','stringify','ShowSound','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','Sound','find','options','raw','where','attributes','include','model','map'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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['ShowSound']=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,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['include']?_['map'](_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')],function(_0x38e7c4){return{'model':db[_0x38e7c4[_0x0a9e('0x1b')]],'as':_0x38e7c4['as'],'attributes':_0x38e7c4['attributes'],'include':_0x38e7c4[_0x0a9e('0x1a')]?_[_0x0a9e('0x1c')](_0x38e7c4[_0x0a9e('0x1a')],function(_0x4d00e6){return{'model':db[_0x4d00e6[_0x0a9e('0x1b')]],'as':_0x4d00e6['as'],'attributes':_0x4d00e6[_0x0a9e('0x19')],'include':_0x4d00e6[_0x0a9e('0x1a')]?_['map'](_0x4d00e6['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x1b')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x1d')](function(_0x526cf3){logger[_0x0a9e('0xa')]('ShowSound',_0x459eb1);logger[_0x0a9e('0xd')]('ShowSound',_0x459eb1,JSON[_0x0a9e('0x1e')](_0x526cf3));_0x106033(_0x526cf3);})[_0x0a9e('0x13')](function(_0x25fba9){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x25fba9[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x25fba9[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSound','Sound','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x417a02,_0x7ec2d2){var _0x207bea=function(_0x410280){while(--_0x410280){_0x417a02['push'](_0x417a02['shift']());}};_0x207bea(++_0x7ec2d2);}(_0xb10b,0x12a));var _0xbb10=function(_0x56d550,_0x1c3fd0){_0x56d550=_0x56d550-0x0;var _0x5e6a91=_0xb10b[_0x56d550];return _0x5e6a91;};'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/squareMessage/index.js b/server/api/squareMessage/index.js index 4a4a020..116bd66 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 _0xdbf0=['./squareMessage.controller','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x592029,_0x4e1c86){var _0x48a22b=function(_0x1f9f4f){while(--_0x1f9f4f){_0x592029['push'](_0x592029['shift']());}};_0x48a22b(++_0x4e1c86);}(_0xdbf0,0x1db));var _0x0dbf=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdbf0[_0x4e676e];return _0x336a3c;};'use strict';var multer=require('multer');var util=require(_0x0dbf('0x0'));var path=require(_0x0dbf('0x1'));var timeout=require(_0x0dbf('0x2'));var express=require(_0x0dbf('0x3'));var router=express['Router']();var auth=require(_0x0dbf('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0dbf('0x5'));router[_0x0dbf('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x0dbf('0x6')](_0x0dbf('0x7'),auth[_0x0dbf('0x8')](),controller[_0x0dbf('0x9')]);router[_0x0dbf('0xa')]('/',auth['isAuthenticated'](),controller[_0x0dbf('0xb')]);router[_0x0dbf('0xc')](_0x0dbf('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x0dbf('0xd')](_0x0dbf('0x7'),auth[_0x0dbf('0x8')](),controller[_0x0dbf('0xe')]);module[_0x0dbf('0xf')]=router; \ No newline at end of file +var _0xc8be=['index','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated'];(function(_0x3345bb,_0x5bd0ce){var _0x1a0975=function(_0x10fcc0){while(--_0x10fcc0){_0x3345bb['push'](_0x3345bb['shift']());}};_0x1a0975(++_0x5bd0ce);}(_0xc8be,0x15d));var _0xec8b=function(_0x176770,_0xcba693){_0x176770=_0x176770-0x0;var _0x36885a=_0xc8be[_0x176770];return _0x36885a;};'use strict';var multer=require(_0xec8b('0x0'));var util=require(_0xec8b('0x1'));var path=require(_0xec8b('0x2'));var timeout=require(_0xec8b('0x3'));var express=require(_0xec8b('0x4'));var router=express[_0xec8b('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xec8b('0x6'));var config=require(_0xec8b('0x7'));var controller=require(_0xec8b('0x8'));router[_0xec8b('0x9')]('/',auth[_0xec8b('0xa')](),controller[_0xec8b('0xb')]);router[_0xec8b('0x9')]('/:id',auth[_0xec8b('0xa')](),controller['show']);router[_0xec8b('0xc')]('/',auth[_0xec8b('0xa')](),controller[_0xec8b('0xd')]);router[_0xec8b('0xe')](_0xec8b('0xf'),auth['isAuthenticated'](),controller[_0xec8b('0x10')]);router[_0xec8b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xec8b('0x12')]);module[_0xec8b('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 0dea30a..aae53a6 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 _0x310b=['out','sequelize','STRING','TEXT','medium','ENUM'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x310b,0x16f));var _0xb310=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x310b[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xb310('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb310('0x1')]},'body':{'type':Sequelize[_0xb310('0x2')](_0xb310('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xb310('0x4')]('in',_0xb310('0x5')),'defaultValue':_0xb310('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x5f90=['medium','out','exports','TEXT'];(function(_0x261ef8,_0xb95320){var _0x46069e=function(_0x2518c6){while(--_0x2518c6){_0x261ef8['push'](_0x261ef8['shift']());}};_0x46069e(++_0xb95320);}(_0x5f90,0x1de));var _0x05f9=function(_0x2009f2,_0x5dd74e){_0x2009f2=_0x2009f2-0x0;var _0x9b0e1d=_0x5f90[_0x2009f2];return _0x9b0e1d;};'use strict';var Sequelize=require('sequelize');module[_0x05f9('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x05f9('0x1')](_0x05f9('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x05f9('0x3')),'defaultValue':_0x05f9('0x3'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 0b8c0df..c533ac7 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 _0x0c67=['show','fields','includeAll','catch','create','body','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SquareMessage','rawAttributes','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','key','VIRTUAL','field','filter','options','include','findAll','rows'];(function(_0x3b4499,_0x5ac028){var _0x5e22c2=function(_0x8392d0){while(--_0x8392d0){_0x3b4499['push'](_0x3b4499['shift']());}};_0x5e22c2(++_0x5ac028);}(_0x0c67,0x189));var _0x70c6=function(_0x3b4b38,_0x11a059){_0x3b4b38=_0x3b4b38-0x0;var _0x561d6f=_0x0c67[_0x3b4b38];return _0x561d6f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x70c6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x70c6('0x1'));var jsonpatch=require(_0x70c6('0x2'));var rp=require(_0x70c6('0x3'));var moment=require(_0x70c6('0x4'));var BPromise=require(_0x70c6('0x5'));var Mustache=require(_0x70c6('0x6'));var util=require(_0x70c6('0x7'));var path=require(_0x70c6('0x8'));var sox=require(_0x70c6('0x9'));var csv=require(_0x70c6('0xa'));var ejs=require(_0x70c6('0xb'));var fs=require('fs');var _=require(_0x70c6('0xc'));var squel=require(_0x70c6('0xd'));var crypto=require('crypto');var jsforce=require(_0x70c6('0xe'));var deskjs=require(_0x70c6('0xf'));var toCsv=require(_0x70c6('0xa'));var querystring=require(_0x70c6('0x10'));var Papa=require(_0x70c6('0x11'));var Redis=require(_0x70c6('0x12'));var authService=require(_0x70c6('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x70c6('0x14'));var logger=require(_0x70c6('0x15'))('api');var utils=require(_0x70c6('0x16'));var config=require(_0x70c6('0x17'));var db=require(_0x70c6('0x18'))['db'];function respondWithStatusCode(_0x57d2eb,_0x384d78){_0x384d78=_0x384d78||0xcc;return function(_0x314aa3){if(_0x314aa3){return _0x57d2eb[_0x70c6('0x19')](_0x384d78);}return _0x57d2eb['status'](_0x384d78)[_0x70c6('0x1a')]();};}function respondWithResult(_0xce1e9d,_0x1ccbe9){_0x1ccbe9=_0x1ccbe9||0xc8;return function(_0x5ab001){if(_0x5ab001){return _0xce1e9d[_0x70c6('0x1b')](_0x1ccbe9)[_0x70c6('0x1c')](_0x5ab001);}};}function respondWithFilteredResult(_0x182af3,_0x1ed105){return function(_0x2253f8){if(_0x2253f8){var _0x377e07=_0x2253f8[_0x70c6('0x1d')],_0x23c438=_0x1ed105[_0x70c6('0x1e')],_0x4aea29=_0x1ed105[_0x70c6('0x1e')]+_0x1ed105[_0x70c6('0x1f')],_0x456ed1;if(_0x4aea29>=_0x377e07){_0x4aea29=_0x377e07;_0x456ed1=0xc8;}else{_0x456ed1=0xce;}_0x182af3[_0x70c6('0x1b')](_0x456ed1);return _0x182af3[_0x70c6('0x20')](_0x70c6('0x21'),_0x23c438+'-'+_0x4aea29+'/'+_0x377e07)[_0x70c6('0x1c')](_0x2253f8);}return null;};}function patchUpdates(_0x1230c1){return function(_0x2917f5){try{jsonpatch[_0x70c6('0x22')](_0x2917f5,_0x1230c1,!![]);}catch(_0x3909a5){return BPromise[_0x70c6('0x23')](_0x3909a5);}return _0x2917f5[_0x70c6('0x24')]();};}function saveUpdates(_0x91552,_0x35da8c){return function(_0x5bf911){if(_0x5bf911){return _0x5bf911[_0x70c6('0x25')](_0x91552)[_0x70c6('0x26')](function(_0x15d673){return _0x15d673;});}return null;};}function removeEntity(_0x8a0359,_0x37c913){return function(_0x257983){if(_0x257983){return _0x257983[_0x70c6('0x27')]()[_0x70c6('0x26')](function(){_0x8a0359[_0x70c6('0x1b')](0xcc)[_0x70c6('0x1a')]();});}};}function handleEntityNotFound(_0xb304df,_0x591dcd){return function(_0x209343){if(!_0x209343){_0xb304df['sendStatus'](0x194);}return _0x209343;};}function handleError(_0xf72291,_0x1b4c6b){_0x1b4c6b=_0x1b4c6b||0x1f4;return function(_0x18c24d){logger[_0x70c6('0x28')](_0x18c24d[_0x70c6('0x29')]);if(_0x18c24d[_0x70c6('0x2a')]){delete _0x18c24d[_0x70c6('0x2a')];}_0xf72291[_0x70c6('0x1b')](_0x1b4c6b)[_0x70c6('0x2b')](_0x18c24d);};}exports[_0x70c6('0x2c')]=function(_0x17f8ed,_0x243ae2){var _0x3f9d4b={},_0x5d5c94={},_0x2984b2={'count':0x0,'rows':[]};var _0x2685c0=db[_0x70c6('0x2d')][_0x70c6('0x2e')];_0x5d5c94[_0x70c6('0x2f')]=_['keys'](_0x2685c0);_0x5d5c94['query']=_[_0x70c6('0x30')](_0x17f8ed[_0x70c6('0x31')]);_0x5d5c94[_0x70c6('0x32')]=_[_0x70c6('0x33')](_0x5d5c94[_0x70c6('0x2f')],_0x5d5c94[_0x70c6('0x31')]);_0x3f9d4b[_0x70c6('0x34')]=_['intersection'](_0x5d5c94[_0x70c6('0x2f')],qs['fields'](_0x17f8ed[_0x70c6('0x31')]['fields']));_0x3f9d4b[_0x70c6('0x34')]=_0x3f9d4b[_0x70c6('0x34')][_0x70c6('0x35')]?_0x3f9d4b[_0x70c6('0x34')]:_0x5d5c94[_0x70c6('0x2f')];if(!_0x17f8ed[_0x70c6('0x31')][_0x70c6('0x36')](_0x70c6('0x37'))){_0x3f9d4b[_0x70c6('0x1f')]=qs['limit'](_0x17f8ed[_0x70c6('0x31')][_0x70c6('0x1f')]);_0x3f9d4b[_0x70c6('0x1e')]=qs[_0x70c6('0x1e')](_0x17f8ed[_0x70c6('0x31')][_0x70c6('0x1e')]);}_0x3f9d4b[_0x70c6('0x38')]=qs[_0x70c6('0x39')](_0x17f8ed[_0x70c6('0x31')]['sort']);_0x3f9d4b[_0x70c6('0x3a')]=qs[_0x70c6('0x32')](_[_0x70c6('0x3b')](_0x17f8ed[_0x70c6('0x31')],_0x5d5c94[_0x70c6('0x32')]));if(_0x17f8ed[_0x70c6('0x31')]['filter']){_0x3f9d4b[_0x70c6('0x3a')]=_[_0x70c6('0x3c')](_0x3f9d4b[_0x70c6('0x3a')],{'$or':_['map'](_0x2685c0,function(_0x2bb3b2){if(_0x2bb3b2['type'][_0x70c6('0x3d')]!==_0x70c6('0x3e')){var _0x59a446={};_0x59a446[_0x2bb3b2[_0x70c6('0x3f')]]={'$like':'%'+_0x17f8ed[_0x70c6('0x31')][_0x70c6('0x40')]+'%'};return _0x59a446;}})});}_0x3f9d4b=_[_0x70c6('0x3c')]({},_0x3f9d4b,_0x17f8ed[_0x70c6('0x41')]);var _0x51b5f6={'where':_0x3f9d4b[_0x70c6('0x3a')]};return db[_0x70c6('0x2d')][_0x70c6('0x1d')](_0x51b5f6)['then'](function(_0x431f6a){_0x2984b2[_0x70c6('0x1d')]=_0x431f6a;if(_0x17f8ed[_0x70c6('0x31')]['includeAll']){_0x3f9d4b[_0x70c6('0x42')]=[{'all':!![]}];}return db['SquareMessage'][_0x70c6('0x43')](_0x3f9d4b);})[_0x70c6('0x26')](function(_0xe6af8){_0x2984b2[_0x70c6('0x44')]=_0xe6af8;return _0x2984b2;})[_0x70c6('0x26')](respondWithFilteredResult(_0x243ae2,_0x3f9d4b))['catch'](handleError(_0x243ae2,null));};exports[_0x70c6('0x45')]=function(_0x1a9e69,_0x7d7704){var _0x3e774d={'raw':!![],'where':{'id':_0x1a9e69['params']['id']}},_0x596e18={};_0x596e18[_0x70c6('0x2f')]=_['keys'](db[_0x70c6('0x2d')]['rawAttributes']);_0x596e18[_0x70c6('0x31')]=_[_0x70c6('0x30')](_0x1a9e69[_0x70c6('0x31')]);_0x596e18[_0x70c6('0x32')]=_[_0x70c6('0x33')](_0x596e18[_0x70c6('0x2f')],_0x596e18[_0x70c6('0x31')]);_0x3e774d['attributes']=_[_0x70c6('0x33')](_0x596e18[_0x70c6('0x2f')],qs[_0x70c6('0x46')](_0x1a9e69[_0x70c6('0x31')][_0x70c6('0x46')]));_0x3e774d['attributes']=_0x3e774d['attributes'][_0x70c6('0x35')]?_0x3e774d['attributes']:_0x596e18[_0x70c6('0x2f')];if(_0x1a9e69[_0x70c6('0x31')][_0x70c6('0x47')]){_0x3e774d['include']=[{'all':!![]}];}_0x3e774d=_[_0x70c6('0x3c')]({},_0x3e774d,_0x1a9e69[_0x70c6('0x41')]);return db['SquareMessage']['find'](_0x3e774d)[_0x70c6('0x26')](handleEntityNotFound(_0x7d7704,null))[_0x70c6('0x26')](respondWithResult(_0x7d7704,null))[_0x70c6('0x48')](handleError(_0x7d7704,null));};exports['create']=function(_0xde0d81,_0x156df8){return db[_0x70c6('0x2d')][_0x70c6('0x49')](_0xde0d81[_0x70c6('0x4a')],{})[_0x70c6('0x26')](respondWithResult(_0x156df8,0xc9))[_0x70c6('0x48')](handleError(_0x156df8,null));};exports[_0x70c6('0x25')]=function(_0x46db8d,_0x5dda8e){if(_0x46db8d[_0x70c6('0x4a')]['id']){delete _0x46db8d[_0x70c6('0x4a')]['id'];}return db[_0x70c6('0x2d')][_0x70c6('0x4b')]({'where':{'id':_0x46db8d['params']['id']}})[_0x70c6('0x26')](handleEntityNotFound(_0x5dda8e,null))[_0x70c6('0x26')](saveUpdates(_0x46db8d[_0x70c6('0x4a')],null))[_0x70c6('0x26')](respondWithResult(_0x5dda8e,null))[_0x70c6('0x48')](handleError(_0x5dda8e,null));};exports[_0x70c6('0x27')]=function(_0x497040,_0x17b40e){return db[_0x70c6('0x2d')]['find']({'where':{'id':_0x497040[_0x70c6('0x4c')]['id']}})[_0x70c6('0x26')](handleEntityNotFound(_0x17b40e,null))[_0x70c6('0x26')](removeEntity(_0x17b40e,null))[_0x70c6('0x48')](handleError(_0x17b40e,null));}; \ No newline at end of file +var _0xe81d=['json','count','offset','limit','set','apply','reject','then','end','error','stack','name','send','index','SquareMessage','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','merge','map','type','key','field','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','body','update','destroy','html-pdf','eml-format','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1dee17,_0x5dc47c){var _0x24c740=function(_0x434a51){while(--_0x434a51){_0x1dee17['push'](_0x1dee17['shift']());}};_0x24c740(++_0x5dc47c);}(_0xe81d,0x142));var _0xde81=function(_0x10dc60,_0x52cc33){_0x10dc60=_0x10dc60-0x0;var _0x31366d=_0xe81d[_0x10dc60];return _0x31366d;};'use strict';var pdf=require(_0xde81('0x0'));var emlformat=require(_0xde81('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde81('0x2'));var moment=require(_0xde81('0x3'));var BPromise=require(_0xde81('0x4'));var Mustache=require('mustache');var util=require(_0xde81('0x5'));var path=require(_0xde81('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xde81('0x7'));var fs=require('fs');var _=require(_0xde81('0x8'));var squel=require(_0xde81('0x9'));var crypto=require(_0xde81('0xa'));var jsforce=require(_0xde81('0xb'));var deskjs=require(_0xde81('0xc'));var toCsv=require('to-csv');var querystring=require(_0xde81('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xde81('0xe'));var qs=require(_0xde81('0xf'));var hardwareService=require(_0xde81('0x10'));var logger=require(_0xde81('0x11'))('api');var utils=require(_0xde81('0x12'));var config=require(_0xde81('0x13'));var db=require(_0xde81('0x14'))['db'];function respondWithStatusCode(_0x18b742,_0x3a3280){_0x3a3280=_0x3a3280||0xcc;return function(_0x58ba52){if(_0x58ba52){return _0x18b742[_0xde81('0x15')](_0x3a3280);}return _0x18b742[_0xde81('0x16')](_0x3a3280)['end']();};}function respondWithResult(_0x4e320e,_0x5570d9){_0x5570d9=_0x5570d9||0xc8;return function(_0x146dd9){if(_0x146dd9){return _0x4e320e[_0xde81('0x16')](_0x5570d9)[_0xde81('0x17')](_0x146dd9);}};}function respondWithFilteredResult(_0x4e8af6,_0x3d07c1){return function(_0x2b8407){if(_0x2b8407){var _0x2992cb=_0x2b8407[_0xde81('0x18')],_0x446052=_0x3d07c1['offset'],_0x2f3e0c=_0x3d07c1[_0xde81('0x19')]+_0x3d07c1[_0xde81('0x1a')],_0x5ca7fb;if(_0x2f3e0c>=_0x2992cb){_0x2f3e0c=_0x2992cb;_0x5ca7fb=0xc8;}else{_0x5ca7fb=0xce;}_0x4e8af6[_0xde81('0x16')](_0x5ca7fb);return _0x4e8af6[_0xde81('0x1b')]('Content-Range',_0x446052+'-'+_0x2f3e0c+'/'+_0x2992cb)[_0xde81('0x17')](_0x2b8407);}return null;};}function patchUpdates(_0x4e0e77){return function(_0x56b30d){try{jsonpatch[_0xde81('0x1c')](_0x56b30d,_0x4e0e77,!![]);}catch(_0x516d0d){return BPromise[_0xde81('0x1d')](_0x516d0d);}return _0x56b30d['save']();};}function saveUpdates(_0x27975c,_0x241e8e){return function(_0x562160){if(_0x562160){return _0x562160['update'](_0x27975c)[_0xde81('0x1e')](function(_0x4d353d){return _0x4d353d;});}return null;};}function removeEntity(_0x7e19c8,_0x159297){return function(_0x1f0a22){if(_0x1f0a22){return _0x1f0a22['destroy']()[_0xde81('0x1e')](function(){_0x7e19c8[_0xde81('0x16')](0xcc)[_0xde81('0x1f')]();});}};}function handleEntityNotFound(_0x489cf9,_0xd8a8a6){return function(_0x130fd4){if(!_0x130fd4){_0x489cf9[_0xde81('0x15')](0x194);}return _0x130fd4;};}function handleError(_0x200968,_0x3d65cb){_0x3d65cb=_0x3d65cb||0x1f4;return function(_0x5cf373){logger[_0xde81('0x20')](_0x5cf373[_0xde81('0x21')]);if(_0x5cf373[_0xde81('0x22')]){delete _0x5cf373['name'];}_0x200968['status'](_0x3d65cb)[_0xde81('0x23')](_0x5cf373);};}exports[_0xde81('0x24')]=function(_0x4412df,_0x2b851d){var _0x9778e9={},_0x57c88f={},_0x2eb51b={'count':0x0,'rows':[]};var _0x1f2e0c=db[_0xde81('0x25')]['rawAttributes'];_0x57c88f[_0xde81('0x26')]=_[_0xde81('0x27')](_0x1f2e0c);_0x57c88f[_0xde81('0x28')]=_[_0xde81('0x27')](_0x4412df[_0xde81('0x28')]);_0x57c88f[_0xde81('0x29')]=_['intersection'](_0x57c88f[_0xde81('0x26')],_0x57c88f['query']);_0x9778e9[_0xde81('0x2a')]=_[_0xde81('0x2b')](_0x57c88f['model'],qs[_0xde81('0x2c')](_0x4412df['query'][_0xde81('0x2c')]));_0x9778e9['attributes']=_0x9778e9[_0xde81('0x2a')]['length']?_0x9778e9[_0xde81('0x2a')]:_0x57c88f[_0xde81('0x26')];if(!_0x4412df[_0xde81('0x28')]['hasOwnProperty'](_0xde81('0x2d'))){_0x9778e9[_0xde81('0x1a')]=qs['limit'](_0x4412df[_0xde81('0x28')][_0xde81('0x1a')]);_0x9778e9[_0xde81('0x19')]=qs['offset'](_0x4412df[_0xde81('0x28')][_0xde81('0x19')]);}_0x9778e9[_0xde81('0x2e')]=qs[_0xde81('0x2f')](_0x4412df[_0xde81('0x28')][_0xde81('0x2f')]);_0x9778e9['where']=qs[_0xde81('0x29')](_['pick'](_0x4412df[_0xde81('0x28')],_0x57c88f['filters']));if(_0x4412df[_0xde81('0x28')]['filter']){_0x9778e9[_0xde81('0x30')]=_[_0xde81('0x31')](_0x9778e9[_0xde81('0x30')],{'$or':_[_0xde81('0x32')](_0x1f2e0c,function(_0x32bc94){if(_0x32bc94[_0xde81('0x33')][_0xde81('0x34')]!=='VIRTUAL'){var _0x3bee39={};_0x3bee39[_0x32bc94[_0xde81('0x35')]]={'$like':'%'+_0x4412df['query'][_0xde81('0x36')]+'%'};return _0x3bee39;}})});}_0x9778e9=_['merge']({},_0x9778e9,_0x4412df[_0xde81('0x37')]);var _0x2ac874={'where':_0x9778e9[_0xde81('0x30')]};return db[_0xde81('0x25')][_0xde81('0x18')](_0x2ac874)['then'](function(_0x44ee3b){_0x2eb51b['count']=_0x44ee3b;if(_0x4412df['query'][_0xde81('0x38')]){_0x9778e9[_0xde81('0x39')]=[{'all':!![]}];}return db['SquareMessage'][_0xde81('0x3a')](_0x9778e9);})['then'](function(_0x2efb61){_0x2eb51b['rows']=_0x2efb61;return _0x2eb51b;})[_0xde81('0x1e')](respondWithFilteredResult(_0x2b851d,_0x9778e9))[_0xde81('0x3b')](handleError(_0x2b851d,null));};exports[_0xde81('0x3c')]=function(_0x2016b6,_0x389226){var _0x347ab2={'raw':!![],'where':{'id':_0x2016b6[_0xde81('0x3d')]['id']}},_0x43abdc={};_0x43abdc['model']=_['keys'](db['SquareMessage'][_0xde81('0x3e')]);_0x43abdc['query']=_[_0xde81('0x27')](_0x2016b6[_0xde81('0x28')]);_0x43abdc[_0xde81('0x29')]=_['intersection'](_0x43abdc[_0xde81('0x26')],_0x43abdc[_0xde81('0x28')]);_0x347ab2[_0xde81('0x2a')]=_[_0xde81('0x2b')](_0x43abdc[_0xde81('0x26')],qs[_0xde81('0x2c')](_0x2016b6[_0xde81('0x28')][_0xde81('0x2c')]));_0x347ab2[_0xde81('0x2a')]=_0x347ab2[_0xde81('0x2a')][_0xde81('0x3f')]?_0x347ab2['attributes']:_0x43abdc['model'];if(_0x2016b6[_0xde81('0x28')]['includeAll']){_0x347ab2[_0xde81('0x39')]=[{'all':!![]}];}_0x347ab2=_['merge']({},_0x347ab2,_0x2016b6[_0xde81('0x37')]);return db['SquareMessage'][_0xde81('0x40')](_0x347ab2)['then'](handleEntityNotFound(_0x389226,null))['then'](respondWithResult(_0x389226,null))[_0xde81('0x3b')](handleError(_0x389226,null));};exports[_0xde81('0x41')]=function(_0x2c8089,_0x456120){return db['SquareMessage'][_0xde81('0x41')](_0x2c8089[_0xde81('0x42')],{})[_0xde81('0x1e')](respondWithResult(_0x456120,0xc9))[_0xde81('0x3b')](handleError(_0x456120,null));};exports[_0xde81('0x43')]=function(_0x3d6722,_0x1eae0b){if(_0x3d6722[_0xde81('0x42')]['id']){delete _0x3d6722['body']['id'];}return db['SquareMessage'][_0xde81('0x40')]({'where':{'id':_0x3d6722[_0xde81('0x3d')]['id']}})[_0xde81('0x1e')](handleEntityNotFound(_0x1eae0b,null))['then'](saveUpdates(_0x3d6722[_0xde81('0x42')],null))[_0xde81('0x1e')](respondWithResult(_0x1eae0b,null))[_0xde81('0x3b')](handleError(_0x1eae0b,null));};exports[_0xde81('0x44')]=function(_0x7addfd,_0x2a1f5e){return db[_0xde81('0x25')][_0xde81('0x40')]({'where':{'id':_0x7addfd[_0xde81('0x3d')]['id']}})[_0xde81('0x1e')](handleEntityNotFound(_0x2a1f5e,null))[_0xde81('0x1e')](removeEntity(_0x2a1f5e,null))[_0xde81('0x3b')](handleError(_0x2a1f5e,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 04ecae4..66b8153 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 _0xabf6=['moment','path','../../config/environment','exports','SquareMessage','square_messages','util','api'];(function(_0x5eed2d,_0x479f83){var _0x6d4a65=function(_0x351eca){while(--_0x351eca){_0x5eed2d['push'](_0x5eed2d['shift']());}};_0x6d4a65(++_0x479f83);}(_0xabf6,0x9e));var _0x6abf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabf6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6abf('0x0'));var logger=require('../../config/logger')(_0x6abf('0x1'));var moment=require(_0x6abf('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6abf('0x3'));var rimraf=require('rimraf');var config=require(_0x6abf('0x4'));var attributes=require('./squareMessage.attributes');module[_0x6abf('0x5')]=function(_0x3e8ceb,_0x32a9ce){return _0x3e8ceb['define'](_0x6abf('0x6'),attributes,{'tableName':_0x6abf('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a73=['exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x28bddc,_0x386002){var _0x4d6757=function(_0xc1b8e0){while(--_0xc1b8e0){_0x28bddc['push'](_0x28bddc['shift']());}};_0x4d6757(++_0x386002);}(_0x5a73,0x19c));var _0x35a7=function(_0x2e19a6,_0x1e4a33){_0x2e19a6=_0x2e19a6-0x0;var _0x37cd23=_0x5a73[_0x2e19a6];return _0x37cd23;};'use strict';var _=require(_0x35a7('0x0'));var util=require(_0x35a7('0x1'));var logger=require(_0x35a7('0x2'))('api');var moment=require(_0x35a7('0x3'));var BPromise=require(_0x35a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x35a7('0x5'));var config=require(_0x35a7('0x6'));var attributes=require(_0x35a7('0x7'));module[_0x35a7('0x8')]=function(_0x4b81a0,_0x44e2d1){return _0x4b81a0[_0x35a7('0x9')](_0x35a7('0xa'),attributes,{'tableName':_0x35a7('0xb'),'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 65dc952..0e3e03b 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 _0xa311=['CreateSquareMessage','SquareMessage','create','options','raw','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0xa311,0x1a6));var _0x1a31=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0xa311[_0x291f8b];return _0x275171;};'use strict';var _=require(_0x1a31('0x0'));var util=require('util');var moment=require(_0x1a31('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a31('0x2'));var fs=require('fs');var Redis=require(_0x1a31('0x3'));var db=require(_0x1a31('0x4'))['db'];var utils=require(_0x1a31('0x5'));var logger=require(_0x1a31('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1a31('0x7'));var client=jayson[_0x1a31('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4adbfb,_0x181405,_0x3ab405){return new BPromise(function(_0x300cf4,_0x255a22){return client[_0x1a31('0x9')](_0x4adbfb,_0x3ab405)[_0x1a31('0xa')](function(_0x370abf){logger['info'](_0x1a31('0xb'),_0x181405,_0x1a31('0xc'));logger[_0x1a31('0xd')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x181405,_0x1a31('0xc'),JSON['stringify'](_0x370abf));if(_0x370abf[_0x1a31('0xe')]){if(_0x370abf['error'][_0x1a31('0xf')]===0x1f4){logger[_0x1a31('0xe')](_0x1a31('0xb'),_0x181405,_0x370abf[_0x1a31('0xe')][_0x1a31('0x10')]);return _0x255a22(_0x370abf[_0x1a31('0xe')][_0x1a31('0x10')]);}logger[_0x1a31('0xe')](_0x1a31('0xb'),_0x181405,_0x370abf[_0x1a31('0xe')][_0x1a31('0x10')]);return _0x300cf4(_0x370abf[_0x1a31('0xe')][_0x1a31('0x10')]);}else{logger[_0x1a31('0x11')](_0x1a31('0xb'),_0x181405,_0x1a31('0xc'));_0x300cf4(_0x370abf[_0x1a31('0x12')][_0x1a31('0x10')]);}})[_0x1a31('0x13')](function(_0x29f6a1){logger[_0x1a31('0xe')](_0x1a31('0xb'),_0x181405,_0x29f6a1);_0x255a22(_0x29f6a1);});});}exports[_0x1a31('0x14')]=function(_0x425730){var _0x4d1e7c=this;return new Promise(function(_0x19f043,_0x5124d0){return db[_0x1a31('0x15')][_0x1a31('0x16')](_0x425730['body'],{'raw':_0x425730[_0x1a31('0x17')]?_0x425730[_0x1a31('0x17')][_0x1a31('0x18')]===undefined?!![]:![]:!![]})[_0x1a31('0xa')](function(_0x56281d){logger[_0x1a31('0x11')](_0x1a31('0x14'),_0x425730);logger[_0x1a31('0xd')](_0x1a31('0x14'),_0x425730,JSON[_0x1a31('0x19')](_0x56281d));_0x19f043(_0x56281d);})['catch'](function(_0x239791){logger[_0x1a31('0xe')](_0x1a31('0x14'),_0x239791[_0x1a31('0x10')],_0x425730);_0x5124d0(_0x4d1e7c[_0x1a31('0xe')](0x1f4,_0x239791[_0x1a31('0x10')]));});});}; \ No newline at end of file +var _0x16a2=['SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x417c49,_0x38059c){var _0x54b704=function(_0x322a85){while(--_0x322a85){_0x417c49['push'](_0x417c49['shift']());}};_0x54b704(++_0x38059c);}(_0x16a2,0x83));var _0x216a=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x16a2[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0x216a('0x0'));var util=require(_0x216a('0x1'));var moment=require(_0x216a('0x2'));var BPromise=require(_0x216a('0x3'));var rs=require(_0x216a('0x4'));var fs=require('fs');var Redis=require(_0x216a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x216a('0x6'));var logger=require(_0x216a('0x7'))('rpc');var config=require(_0x216a('0x8'));var jayson=require(_0x216a('0x9'));var client=jayson[_0x216a('0xa')][_0x216a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16361d,_0x524b49,_0x1202f6){return new BPromise(function(_0x217034,_0x3df27a){return client[_0x216a('0xc')](_0x16361d,_0x1202f6)['then'](function(_0x142ba0){logger[_0x216a('0xd')](_0x216a('0xe'),_0x524b49,_0x216a('0xf'));logger[_0x216a('0x10')](_0x216a('0x11'),_0x524b49,_0x216a('0xf'),JSON['stringify'](_0x142ba0));if(_0x142ba0[_0x216a('0x12')]){if(_0x142ba0[_0x216a('0x12')][_0x216a('0x13')]===0x1f4){logger[_0x216a('0x12')](_0x216a('0xe'),_0x524b49,_0x142ba0['error']['message']);return _0x3df27a(_0x142ba0[_0x216a('0x12')][_0x216a('0x14')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x524b49,_0x142ba0[_0x216a('0x12')][_0x216a('0x14')]);return _0x217034(_0x142ba0['error'][_0x216a('0x14')]);}else{logger['info'](_0x216a('0xe'),_0x524b49,_0x216a('0xf'));_0x217034(_0x142ba0[_0x216a('0x15')][_0x216a('0x14')]);}})[_0x216a('0x16')](function(_0xde4955){logger[_0x216a('0x12')](_0x216a('0xe'),_0x524b49,_0xde4955);_0x3df27a(_0xde4955);});});}exports[_0x216a('0x17')]=function(_0x3bec76){var _0x580b24=this;return new Promise(function(_0x241d6e,_0x2da589){return db[_0x216a('0x18')][_0x216a('0x19')](_0x3bec76[_0x216a('0x1a')],{'raw':_0x3bec76[_0x216a('0x1b')]?_0x3bec76[_0x216a('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x216a('0x1c')](function(_0x59ab91){logger[_0x216a('0xd')]('CreateSquareMessage',_0x3bec76);logger[_0x216a('0x10')](_0x216a('0x17'),_0x3bec76,JSON['stringify'](_0x59ab91));_0x241d6e(_0x59ab91);})[_0x216a('0x16')](function(_0x2abd9d){logger[_0x216a('0x12')]('CreateSquareMessage',_0x2abd9d[_0x216a('0x14')],_0x3bec76);_0x2da589(_0x580b24['error'](0x1f4,_0x2abd9d['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d905c0d..a1f8eb4 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 _0x0cee=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','/:id/test','15s','test','post','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cee,0x12f));var _0xe0ce=function(_0x45ab67,_0xc105fc){_0x45ab67=_0x45ab67-0x0;var _0x469778=_0x0cee[_0x45ab67];return _0x469778;};'use strict';var multer=require(_0xe0ce('0x0'));var util=require(_0xe0ce('0x1'));var path=require(_0xe0ce('0x2'));var timeout=require(_0xe0ce('0x3'));var express=require(_0xe0ce('0x4'));var router=express[_0xe0ce('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe0ce('0x6'));var controller=require(_0xe0ce('0x7'));router[_0xe0ce('0x8')]('/',auth[_0xe0ce('0x9')](),controller[_0xe0ce('0xa')]);router[_0xe0ce('0x8')](_0xe0ce('0xb'),auth[_0xe0ce('0x9')](),controller['show']);router[_0xe0ce('0x8')](_0xe0ce('0xc'),auth['isAuthenticated'](),timeout(_0xe0ce('0xd')),controller[_0xe0ce('0xe')]);router[_0xe0ce('0xf')]('/',auth[_0xe0ce('0x9')](),controller['create']);router['put']('/:id',auth[_0xe0ce('0x9')](),controller[_0xe0ce('0x10')]);router[_0xe0ce('0x11')](_0xe0ce('0xb'),auth[_0xe0ce('0x9')](),controller[_0xe0ce('0x12')]);module[_0xe0ce('0x13')]=router; \ No newline at end of file +var _0xca56=['test','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','15s'];(function(_0x3a7933,_0xf6cdf8){var _0x5c5815=function(_0x51a6ca){while(--_0x51a6ca){_0x3a7933['push'](_0x3a7933['shift']());}};_0x5c5815(++_0xf6cdf8);}(_0xca56,0xee));var _0x6ca5=function(_0x48d05c,_0x3e5459){_0x48d05c=_0x48d05c-0x0;var _0x21cd3a=_0xca56[_0x48d05c];return _0x21cd3a;};'use strict';var multer=require(_0x6ca5('0x0'));var util=require(_0x6ca5('0x1'));var path=require(_0x6ca5('0x2'));var timeout=require(_0x6ca5('0x3'));var express=require(_0x6ca5('0x4'));var router=express[_0x6ca5('0x5')]();var auth=require(_0x6ca5('0x6'));var interaction=require(_0x6ca5('0x7'));var config=require(_0x6ca5('0x8'));var controller=require('./squareOdbc.controller');router[_0x6ca5('0x9')]('/',auth[_0x6ca5('0xa')](),controller[_0x6ca5('0xb')]);router[_0x6ca5('0x9')]('/:id',auth[_0x6ca5('0xa')](),controller[_0x6ca5('0xc')]);router['get']('/:id/test',auth[_0x6ca5('0xa')](),timeout(_0x6ca5('0xd')),controller[_0x6ca5('0xe')]);router[_0x6ca5('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6ca5('0x10')](_0x6ca5('0x11'),auth[_0x6ca5('0xa')](),controller[_0x6ca5('0x12')]);router[_0x6ca5('0x13')]('/:id',auth[_0x6ca5('0xa')](),controller['destroy']);module[_0x6ca5('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 35c4f7a..db2cab9 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 _0xa5cf=['exports','STRING','name'];(function(_0x229386,_0x2a6129){var _0x7b6bf4=function(_0x36aa99){while(--_0x36aa99){_0x229386['push'](_0x229386['shift']());}};_0x7b6bf4(++_0x2a6129);}(_0xa5cf,0xa5));var _0xfa5c=function(_0x3fa64c,_0x16a52b){_0x3fa64c=_0x3fa64c-0x0;var _0x28f208=_0xa5cf[_0x3fa64c];return _0x28f208;};'use strict';var Sequelize=require('sequelize');module[_0xfa5c('0x0')]={'name':{'type':Sequelize[_0xfa5c('0x1')],'unique':_0xfa5c('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xfa5c('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe34c=['name','sequelize','exports','STRING'];(function(_0x15ec84,_0x4e3947){var _0x5f476e=function(_0x4bd083){while(--_0x4bd083){_0x15ec84['push'](_0x15ec84['shift']());}};_0x5f476e(++_0x4e3947);}(_0xe34c,0x121));var _0xce34=function(_0x57d194,_0x43c173){_0x57d194=_0x57d194-0x0;var _0x224a92=_0xe34c[_0x57d194];return _0x224a92;};'use strict';var Sequelize=require(_0xce34('0x0'));module[_0xce34('0x1')]={'name':{'type':Sequelize[_0xce34('0x2')],'unique':_0xce34('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xce34('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 016c108..9c5830c 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 _0xec31=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','stack','name','send','index','SquareOdbc','keys','query','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','merge','map','type','key','field','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','html-pdf'];(function(_0x2af9e9,_0x132989){var _0x20b045=function(_0xcb61e0){while(--_0xcb61e0){_0x2af9e9['push'](_0x2af9e9['shift']());}};_0x20b045(++_0x132989);}(_0xec31,0xa3));var _0x1ec3=function(_0x29b0ed,_0x554cc3){_0x29b0ed=_0x29b0ed-0x0;var _0x1232f9=_0xec31[_0x29b0ed];return _0x1232f9;};'use strict';var pdf=require(_0x1ec3('0x0'));var emlformat=require(_0x1ec3('0x1'));var rimraf=require(_0x1ec3('0x2'));var zipdir=require(_0x1ec3('0x3'));var jsonpatch=require(_0x1ec3('0x4'));var rp=require(_0x1ec3('0x5'));var moment=require(_0x1ec3('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1ec3('0x7'));var util=require(_0x1ec3('0x8'));var path=require(_0x1ec3('0x9'));var sox=require('sox');var csv=require(_0x1ec3('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ec3('0xb'));var squel=require(_0x1ec3('0xc'));var crypto=require(_0x1ec3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ec3('0xe'));var toCsv=require(_0x1ec3('0xa'));var querystring=require(_0x1ec3('0xf'));var Papa=require(_0x1ec3('0x10'));var Redis=require('ioredis');var authService=require(_0x1ec3('0x11'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1ec3('0x12'));var config=require(_0x1ec3('0x13'));var db=require(_0x1ec3('0x14'))['db'];function respondWithStatusCode(_0x1a0588,_0x226826){_0x226826=_0x226826||0xcc;return function(_0x169454){if(_0x169454){return _0x1a0588['sendStatus'](_0x226826);}return _0x1a0588[_0x1ec3('0x15')](_0x226826)[_0x1ec3('0x16')]();};}function respondWithResult(_0x1b2404,_0x523de1){_0x523de1=_0x523de1||0xc8;return function(_0x3f49fe){if(_0x3f49fe){return _0x1b2404[_0x1ec3('0x15')](_0x523de1)[_0x1ec3('0x17')](_0x3f49fe);}};}function respondWithFilteredResult(_0x396cab,_0x38ac06){return function(_0x2e1ace){if(_0x2e1ace){var _0x5c9260=_0x2e1ace[_0x1ec3('0x18')],_0x3898c1=_0x38ac06[_0x1ec3('0x19')],_0x520656=_0x38ac06['offset']+_0x38ac06[_0x1ec3('0x1a')],_0x5a3514;if(_0x520656>=_0x5c9260){_0x520656=_0x5c9260;_0x5a3514=0xc8;}else{_0x5a3514=0xce;}_0x396cab[_0x1ec3('0x15')](_0x5a3514);return _0x396cab[_0x1ec3('0x1b')]('Content-Range',_0x3898c1+'-'+_0x520656+'/'+_0x5c9260)[_0x1ec3('0x17')](_0x2e1ace);}return null;};}function patchUpdates(_0x8c7627){return function(_0x12b1b7){try{jsonpatch[_0x1ec3('0x1c')](_0x12b1b7,_0x8c7627,!![]);}catch(_0x27ebf1){return BPromise[_0x1ec3('0x1d')](_0x27ebf1);}return _0x12b1b7['save']();};}function saveUpdates(_0x281b2d,_0x4094a3){return function(_0x1ed64b){if(_0x1ed64b){return _0x1ed64b[_0x1ec3('0x1e')](_0x281b2d)[_0x1ec3('0x1f')](function(_0x4e8e56){return _0x4e8e56;});}return null;};}function removeEntity(_0x10dc4a,_0x2a3ef0){return function(_0x4a304e){if(_0x4a304e){return _0x4a304e[_0x1ec3('0x20')]()[_0x1ec3('0x1f')](function(){var _0x9fc037=_0x4a304e[_0x1ec3('0x21')]({'plain':!![]});var _0x40e1e1=_0x1ec3('0x22');return db[_0x1ec3('0x23')][_0x1ec3('0x20')]({'where':{'type':_0x40e1e1,'resourceId':_0x9fc037['id']}})[_0x1ec3('0x1f')](function(){return _0x4a304e;});})['then'](function(){_0x10dc4a[_0x1ec3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x844981,_0x1db731){return function(_0x4982ec){if(!_0x4982ec){_0x844981[_0x1ec3('0x24')](0x194);}return _0x4982ec;};}function handleError(_0x5afdc3,_0x43cd41){_0x43cd41=_0x43cd41||0x1f4;return function(_0x2e6730){logger['error'](_0x2e6730[_0x1ec3('0x25')]);if(_0x2e6730[_0x1ec3('0x26')]){delete _0x2e6730[_0x1ec3('0x26')];}_0x5afdc3[_0x1ec3('0x15')](_0x43cd41)[_0x1ec3('0x27')](_0x2e6730);};}exports[_0x1ec3('0x28')]=function(_0x11d58f,_0x5d7b96){var _0x2b35ae={},_0x6dfbd8={},_0x35dbd5={'count':0x0,'rows':[]};var _0x45fae1=db[_0x1ec3('0x29')]['rawAttributes'];_0x6dfbd8['model']=_[_0x1ec3('0x2a')](_0x45fae1);_0x6dfbd8[_0x1ec3('0x2b')]=_[_0x1ec3('0x2a')](_0x11d58f[_0x1ec3('0x2b')]);_0x6dfbd8[_0x1ec3('0x2c')]=_[_0x1ec3('0x2d')](_0x6dfbd8['model'],_0x6dfbd8[_0x1ec3('0x2b')]);_0x2b35ae[_0x1ec3('0x2e')]=_['intersection'](_0x6dfbd8['model'],qs[_0x1ec3('0x2f')](_0x11d58f[_0x1ec3('0x2b')]['fields']));_0x2b35ae['attributes']=_0x2b35ae[_0x1ec3('0x2e')][_0x1ec3('0x30')]?_0x2b35ae[_0x1ec3('0x2e')]:_0x6dfbd8[_0x1ec3('0x31')];if(!_0x11d58f['query']['hasOwnProperty'](_0x1ec3('0x32'))){_0x2b35ae[_0x1ec3('0x1a')]=qs[_0x1ec3('0x1a')](_0x11d58f[_0x1ec3('0x2b')]['limit']);_0x2b35ae[_0x1ec3('0x19')]=qs[_0x1ec3('0x19')](_0x11d58f[_0x1ec3('0x2b')][_0x1ec3('0x19')]);}_0x2b35ae[_0x1ec3('0x33')]=qs['sort'](_0x11d58f[_0x1ec3('0x2b')][_0x1ec3('0x34')]);_0x2b35ae[_0x1ec3('0x35')]=qs[_0x1ec3('0x2c')](_['pick'](_0x11d58f[_0x1ec3('0x2b')],_0x6dfbd8[_0x1ec3('0x2c')]));if(_0x11d58f[_0x1ec3('0x2b')][_0x1ec3('0x36')]){_0x2b35ae[_0x1ec3('0x35')]=_[_0x1ec3('0x37')](_0x2b35ae['where'],{'$or':_[_0x1ec3('0x38')](_0x45fae1,function(_0x120f7d){if(_0x120f7d[_0x1ec3('0x39')][_0x1ec3('0x3a')]!=='VIRTUAL'){var _0xb3968d={};_0xb3968d[_0x120f7d[_0x1ec3('0x3b')]]={'$like':'%'+_0x11d58f[_0x1ec3('0x2b')][_0x1ec3('0x36')]+'%'};return _0xb3968d;}})});}_0x2b35ae=_[_0x1ec3('0x37')]({},_0x2b35ae,_0x11d58f[_0x1ec3('0x3c')]);var _0x383ea1={'where':_0x2b35ae['where']};return db['SquareOdbc'][_0x1ec3('0x18')](_0x383ea1)[_0x1ec3('0x1f')](function(_0x3cb25f){_0x35dbd5[_0x1ec3('0x18')]=_0x3cb25f;if(_0x11d58f['query'][_0x1ec3('0x3d')]){_0x2b35ae[_0x1ec3('0x3e')]=[{'all':!![]}];}return db[_0x1ec3('0x29')][_0x1ec3('0x3f')](_0x2b35ae);})[_0x1ec3('0x1f')](function(_0x3925dc){_0x35dbd5[_0x1ec3('0x40')]=_0x3925dc;return _0x35dbd5;})['then'](respondWithFilteredResult(_0x5d7b96,_0x2b35ae))['catch'](handleError(_0x5d7b96,null));};exports[_0x1ec3('0x41')]=function(_0x447f2a,_0x135d40){var _0x3ec627={'raw':!![],'where':{'id':_0x447f2a[_0x1ec3('0x42')]['id']}},_0x133926={};_0x133926['model']=_[_0x1ec3('0x2a')](db[_0x1ec3('0x29')][_0x1ec3('0x43')]);_0x133926['query']=_[_0x1ec3('0x2a')](_0x447f2a[_0x1ec3('0x2b')]);_0x133926['filters']=_[_0x1ec3('0x2d')](_0x133926['model'],_0x133926[_0x1ec3('0x2b')]);_0x3ec627['attributes']=_[_0x1ec3('0x2d')](_0x133926[_0x1ec3('0x31')],qs[_0x1ec3('0x2f')](_0x447f2a[_0x1ec3('0x2b')]['fields']));_0x3ec627['attributes']=_0x3ec627[_0x1ec3('0x2e')][_0x1ec3('0x30')]?_0x3ec627[_0x1ec3('0x2e')]:_0x133926[_0x1ec3('0x31')];if(_0x447f2a['query']['includeAll']){_0x3ec627[_0x1ec3('0x3e')]=[{'all':!![]}];}_0x3ec627=_[_0x1ec3('0x37')]({},_0x3ec627,_0x447f2a[_0x1ec3('0x3c')]);return db[_0x1ec3('0x29')]['find'](_0x3ec627)[_0x1ec3('0x1f')](handleEntityNotFound(_0x135d40,null))[_0x1ec3('0x1f')](respondWithResult(_0x135d40,null))[_0x1ec3('0x44')](handleError(_0x135d40,null));};exports['create']=function(_0x2efd5e,_0xb48e70){return db['SquareOdbc'][_0x1ec3('0x45')](_0x2efd5e[_0x1ec3('0x46')],{})['then'](function(_0xf4744d){var _0x19c660=_0x2efd5e[_0x1ec3('0x47')][_0x1ec3('0x21')]({'plain':!![]});if(!_0x19c660)throw new Error(_0x1ec3('0x48'));if(_0x19c660[_0x1ec3('0x49')]===_0x1ec3('0x47')){var _0x36fe72=_0xf4744d['get']({'plain':!![]});var _0x26bc80=_0x1ec3('0x22');return db['UserProfileSection'][_0x1ec3('0x4a')]({'where':{'name':_0x26bc80,'userProfileId':_0x19c660[_0x1ec3('0x4b')]},'raw':!![]})[_0x1ec3('0x1f')](function(_0x5b0c7a){if(_0x5b0c7a&&_0x5b0c7a[_0x1ec3('0x4c')]===0x0){return db[_0x1ec3('0x23')][_0x1ec3('0x45')]({'name':_0x36fe72[_0x1ec3('0x26')],'resourceId':_0x36fe72['id'],'type':_0x5b0c7a[_0x1ec3('0x26')],'sectionId':_0x5b0c7a['id']},{})[_0x1ec3('0x1f')](function(){return _0xf4744d;});}else{return _0xf4744d;}})[_0x1ec3('0x44')](function(_0x494861){logger['error'](_0x1ec3('0x4d'),_0x494861);throw _0x494861;});}return _0xf4744d;})[_0x1ec3('0x1f')](respondWithResult(_0xb48e70,0xc9))[_0x1ec3('0x44')](handleError(_0xb48e70,null));};exports[_0x1ec3('0x1e')]=function(_0x1cd155,_0x73651e){if(_0x1cd155[_0x1ec3('0x46')]['id']){delete _0x1cd155['body']['id'];}return db[_0x1ec3('0x29')][_0x1ec3('0x4a')]({'where':{'id':_0x1cd155['params']['id']}})[_0x1ec3('0x1f')](handleEntityNotFound(_0x73651e,null))['then'](saveUpdates(_0x1cd155['body'],null))[_0x1ec3('0x1f')](respondWithResult(_0x73651e,null))[_0x1ec3('0x44')](handleError(_0x73651e,null));};exports[_0x1ec3('0x20')]=function(_0x33e5e1,_0x1ac9be){return db['SquareOdbc']['find']({'where':{'id':_0x33e5e1[_0x1ec3('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ac9be,null))[_0x1ec3('0x1f')](removeEntity(_0x1ac9be,null))[_0x1ec3('0x44')](handleError(_0x1ac9be,null));};exports[_0x1ec3('0x4e')]=function(_0x38e19f,_0x2718d0,_0x56d4a7){var _0x224faf;return db[_0x1ec3('0x29')][_0x1ec3('0x4a')]({'where':{'id':_0x38e19f[_0x1ec3('0x42')]['id']},'attributes':['id',_0x1ec3('0x4f')]})[_0x1ec3('0x1f')](handleEntityNotFound(_0x2718d0,null))[_0x1ec3('0x1f')](function(_0x2cfa8b){if(_0x2cfa8b){var _0x4957ef=require(_0x1ec3('0x50'))();_0x4957ef[_0x1ec3('0x51')](_0x2cfa8b[_0x1ec3('0x4f')]);_0x4957ef['closeSync']();return _0x2cfa8b;}})['then'](respondWithResult(_0x2718d0,null))[_0x1ec3('0x44')](handleError(_0x2718d0,null));}; \ No newline at end of file +var _0xc6f2=['count','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','stack','index','SquareOdbc','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','merge','map','key','VIRTUAL','field','options','includeAll','findAll','catch','show','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','closeSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json'];(function(_0x54e83f,_0x4977f7){var _0x1bfd30=function(_0x50d170){while(--_0x50d170){_0x54e83f['push'](_0x54e83f['shift']());}};_0x1bfd30(++_0x4977f7);}(_0xc6f2,0xdd));var _0x2c6f=function(_0x10b6d1,_0x1244dd){_0x10b6d1=_0x10b6d1-0x0;var _0x11c1f4=_0xc6f2[_0x10b6d1];return _0x11c1f4;};'use strict';var pdf=require(_0x2c6f('0x0'));var emlformat=require(_0x2c6f('0x1'));var rimraf=require(_0x2c6f('0x2'));var zipdir=require(_0x2c6f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c6f('0x4'));var moment=require('moment');var BPromise=require(_0x2c6f('0x5'));var Mustache=require('mustache');var util=require(_0x2c6f('0x6'));var path=require('path');var sox=require(_0x2c6f('0x7'));var csv=require(_0x2c6f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x2c6f('0x9'));var crypto=require('crypto');var jsforce=require(_0x2c6f('0xa'));var deskjs=require(_0x2c6f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c6f('0xc'));var Redis=require(_0x2c6f('0xd'));var authService=require(_0x2c6f('0xe'));var qs=require(_0x2c6f('0xf'));var hardwareService=require(_0x2c6f('0x10'));var logger=require(_0x2c6f('0x11'))(_0x2c6f('0x12'));var utils=require(_0x2c6f('0x13'));var config=require(_0x2c6f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29d784,_0x20aa54){_0x20aa54=_0x20aa54||0xcc;return function(_0x4b39e8){if(_0x4b39e8){return _0x29d784[_0x2c6f('0x15')](_0x20aa54);}return _0x29d784['status'](_0x20aa54)[_0x2c6f('0x16')]();};}function respondWithResult(_0x17fdd2,_0x92cccb){_0x92cccb=_0x92cccb||0xc8;return function(_0x419e94){if(_0x419e94){return _0x17fdd2[_0x2c6f('0x17')](_0x92cccb)[_0x2c6f('0x18')](_0x419e94);}};}function respondWithFilteredResult(_0x442ce4,_0x4e9497){return function(_0x4aa22a){if(_0x4aa22a){var _0x540f2c=_0x4aa22a[_0x2c6f('0x19')],_0x3c78bf=_0x4e9497[_0x2c6f('0x1a')],_0x24fb0d=_0x4e9497[_0x2c6f('0x1a')]+_0x4e9497['limit'],_0x3e381d;if(_0x24fb0d>=_0x540f2c){_0x24fb0d=_0x540f2c;_0x3e381d=0xc8;}else{_0x3e381d=0xce;}_0x442ce4[_0x2c6f('0x17')](_0x3e381d);return _0x442ce4[_0x2c6f('0x1b')](_0x2c6f('0x1c'),_0x3c78bf+'-'+_0x24fb0d+'/'+_0x540f2c)[_0x2c6f('0x18')](_0x4aa22a);}return null;};}function patchUpdates(_0x2e05d8){return function(_0x3b298b){try{jsonpatch['apply'](_0x3b298b,_0x2e05d8,!![]);}catch(_0x4337db){return BPromise[_0x2c6f('0x1d')](_0x4337db);}return _0x3b298b[_0x2c6f('0x1e')]();};}function saveUpdates(_0x876134,_0x133f95){return function(_0xa5357b){if(_0xa5357b){return _0xa5357b[_0x2c6f('0x1f')](_0x876134)[_0x2c6f('0x20')](function(_0x33d241){return _0x33d241;});}return null;};}function removeEntity(_0xae0faf,_0x3485d1){return function(_0x52ce97){if(_0x52ce97){return _0x52ce97[_0x2c6f('0x21')]()[_0x2c6f('0x20')](function(){var _0x148526=_0x52ce97[_0x2c6f('0x22')]({'plain':!![]});var _0x425e57='ODBC';return db[_0x2c6f('0x23')][_0x2c6f('0x21')]({'where':{'type':_0x425e57,'resourceId':_0x148526['id']}})[_0x2c6f('0x20')](function(){return _0x52ce97;});})[_0x2c6f('0x20')](function(){_0xae0faf[_0x2c6f('0x17')](0xcc)[_0x2c6f('0x16')]();});}};}function handleEntityNotFound(_0x4c7cd7,_0x14f80a){return function(_0x44a403){if(!_0x44a403){_0x4c7cd7[_0x2c6f('0x15')](0x194);}return _0x44a403;};}function handleError(_0x5d35d5,_0x528530){_0x528530=_0x528530||0x1f4;return function(_0x2db40b){logger['error'](_0x2db40b[_0x2c6f('0x24')]);if(_0x2db40b['name']){delete _0x2db40b['name'];}_0x5d35d5[_0x2c6f('0x17')](_0x528530)['send'](_0x2db40b);};}exports[_0x2c6f('0x25')]=function(_0x43848f,_0x170333){var _0x591198={},_0xa36aea={},_0x527cdd={'count':0x0,'rows':[]};var _0x1a9b9e=db[_0x2c6f('0x26')][_0x2c6f('0x27')];_0xa36aea[_0x2c6f('0x28')]=_[_0x2c6f('0x29')](_0x1a9b9e);_0xa36aea[_0x2c6f('0x2a')]=_[_0x2c6f('0x29')](_0x43848f[_0x2c6f('0x2a')]);_0xa36aea[_0x2c6f('0x2b')]=_['intersection'](_0xa36aea['model'],_0xa36aea[_0x2c6f('0x2a')]);_0x591198[_0x2c6f('0x2c')]=_[_0x2c6f('0x2d')](_0xa36aea[_0x2c6f('0x28')],qs[_0x2c6f('0x2e')](_0x43848f[_0x2c6f('0x2a')][_0x2c6f('0x2e')]));_0x591198[_0x2c6f('0x2c')]=_0x591198[_0x2c6f('0x2c')][_0x2c6f('0x2f')]?_0x591198[_0x2c6f('0x2c')]:_0xa36aea[_0x2c6f('0x28')];if(!_0x43848f[_0x2c6f('0x2a')]['hasOwnProperty']('nolimit')){_0x591198[_0x2c6f('0x30')]=qs[_0x2c6f('0x30')](_0x43848f['query'][_0x2c6f('0x30')]);_0x591198[_0x2c6f('0x1a')]=qs['offset'](_0x43848f[_0x2c6f('0x2a')][_0x2c6f('0x1a')]);}_0x591198[_0x2c6f('0x31')]=qs[_0x2c6f('0x32')](_0x43848f[_0x2c6f('0x2a')]['sort']);_0x591198[_0x2c6f('0x33')]=qs[_0x2c6f('0x2b')](_['pick'](_0x43848f[_0x2c6f('0x2a')],_0xa36aea[_0x2c6f('0x2b')]));if(_0x43848f['query'][_0x2c6f('0x34')]){_0x591198[_0x2c6f('0x33')]=_[_0x2c6f('0x35')](_0x591198[_0x2c6f('0x33')],{'$or':_[_0x2c6f('0x36')](_0x1a9b9e,function(_0x30417f){if(_0x30417f['type'][_0x2c6f('0x37')]!==_0x2c6f('0x38')){var _0x31ff99={};_0x31ff99[_0x30417f[_0x2c6f('0x39')]]={'$like':'%'+_0x43848f['query']['filter']+'%'};return _0x31ff99;}})});}_0x591198=_[_0x2c6f('0x35')]({},_0x591198,_0x43848f[_0x2c6f('0x3a')]);var _0x59acce={'where':_0x591198[_0x2c6f('0x33')]};return db[_0x2c6f('0x26')][_0x2c6f('0x19')](_0x59acce)[_0x2c6f('0x20')](function(_0x25b874){_0x527cdd[_0x2c6f('0x19')]=_0x25b874;if(_0x43848f[_0x2c6f('0x2a')][_0x2c6f('0x3b')]){_0x591198['include']=[{'all':!![]}];}return db[_0x2c6f('0x26')][_0x2c6f('0x3c')](_0x591198);})[_0x2c6f('0x20')](function(_0x16383c){_0x527cdd['rows']=_0x16383c;return _0x527cdd;})['then'](respondWithFilteredResult(_0x170333,_0x591198))[_0x2c6f('0x3d')](handleError(_0x170333,null));};exports[_0x2c6f('0x3e')]=function(_0x37c06e,_0x1bee8e){var _0xb40948={'raw':!![],'where':{'id':_0x37c06e['params']['id']}},_0x5ecee0={};_0x5ecee0[_0x2c6f('0x28')]=_['keys'](db['SquareOdbc']['rawAttributes']);_0x5ecee0['query']=_[_0x2c6f('0x29')](_0x37c06e[_0x2c6f('0x2a')]);_0x5ecee0[_0x2c6f('0x2b')]=_['intersection'](_0x5ecee0[_0x2c6f('0x28')],_0x5ecee0[_0x2c6f('0x2a')]);_0xb40948['attributes']=_[_0x2c6f('0x2d')](_0x5ecee0[_0x2c6f('0x28')],qs[_0x2c6f('0x2e')](_0x37c06e[_0x2c6f('0x2a')][_0x2c6f('0x2e')]));_0xb40948['attributes']=_0xb40948['attributes'][_0x2c6f('0x2f')]?_0xb40948[_0x2c6f('0x2c')]:_0x5ecee0[_0x2c6f('0x28')];if(_0x37c06e[_0x2c6f('0x2a')][_0x2c6f('0x3b')]){_0xb40948[_0x2c6f('0x3f')]=[{'all':!![]}];}_0xb40948=_[_0x2c6f('0x35')]({},_0xb40948,_0x37c06e['options']);return db[_0x2c6f('0x26')][_0x2c6f('0x40')](_0xb40948)['then'](handleEntityNotFound(_0x1bee8e,null))[_0x2c6f('0x20')](respondWithResult(_0x1bee8e,null))[_0x2c6f('0x3d')](handleError(_0x1bee8e,null));};exports[_0x2c6f('0x41')]=function(_0x4c6d07,_0x31eff5){return db[_0x2c6f('0x26')]['create'](_0x4c6d07[_0x2c6f('0x42')],{})[_0x2c6f('0x20')](function(_0x14966b){var _0x2efab5=_0x4c6d07[_0x2c6f('0x43')][_0x2c6f('0x22')]({'plain':!![]});if(!_0x2efab5)throw new Error(_0x2c6f('0x44'));if(_0x2efab5[_0x2c6f('0x45')]===_0x2c6f('0x43')){var _0x598a6b=_0x14966b[_0x2c6f('0x22')]({'plain':!![]});var _0x30e1cd=_0x2c6f('0x46');return db[_0x2c6f('0x47')][_0x2c6f('0x40')]({'where':{'name':_0x30e1cd,'userProfileId':_0x2efab5[_0x2c6f('0x48')]},'raw':!![]})[_0x2c6f('0x20')](function(_0x55caeb){if(_0x55caeb&&_0x55caeb[_0x2c6f('0x49')]===0x0){return db[_0x2c6f('0x23')][_0x2c6f('0x41')]({'name':_0x598a6b[_0x2c6f('0x4a')],'resourceId':_0x598a6b['id'],'type':_0x55caeb[_0x2c6f('0x4a')],'sectionId':_0x55caeb['id']},{})[_0x2c6f('0x20')](function(){return _0x14966b;});}else{return _0x14966b;}})[_0x2c6f('0x3d')](function(_0x549d1){logger[_0x2c6f('0x4b')](_0x2c6f('0x4c'),_0x549d1);throw _0x549d1;});}return _0x14966b;})[_0x2c6f('0x20')](respondWithResult(_0x31eff5,0xc9))[_0x2c6f('0x3d')](handleError(_0x31eff5,null));};exports['update']=function(_0x453cc9,_0x1b770b){if(_0x453cc9[_0x2c6f('0x42')]['id']){delete _0x453cc9[_0x2c6f('0x42')]['id'];}return db['SquareOdbc'][_0x2c6f('0x40')]({'where':{'id':_0x453cc9[_0x2c6f('0x4d')]['id']}})[_0x2c6f('0x20')](handleEntityNotFound(_0x1b770b,null))[_0x2c6f('0x20')](saveUpdates(_0x453cc9[_0x2c6f('0x42')],null))[_0x2c6f('0x20')](respondWithResult(_0x1b770b,null))[_0x2c6f('0x3d')](handleError(_0x1b770b,null));};exports['destroy']=function(_0x48d5ac,_0x13249b){return db[_0x2c6f('0x26')][_0x2c6f('0x40')]({'where':{'id':_0x48d5ac[_0x2c6f('0x4d')]['id']}})[_0x2c6f('0x20')](handleEntityNotFound(_0x13249b,null))['then'](removeEntity(_0x13249b,null))[_0x2c6f('0x3d')](handleError(_0x13249b,null));};exports[_0x2c6f('0x4e')]=function(_0x18efff,_0x245ce2,_0x27ef5e){var _0x1d8924;return db[_0x2c6f('0x26')][_0x2c6f('0x40')]({'where':{'id':_0x18efff[_0x2c6f('0x4d')]['id']},'attributes':['id',_0x2c6f('0x4f')]})['then'](handleEntityNotFound(_0x245ce2,null))['then'](function(_0x216192){if(_0x216192){var _0x627497=require(_0x2c6f('0x50'))();_0x627497['openSync'](_0x216192[_0x2c6f('0x4f')]);_0x627497[_0x2c6f('0x51')]();return _0x216192;}})[_0x2c6f('0x20')](respondWithResult(_0x245ce2,null))[_0x2c6f('0x3d')](handleError(_0x245ce2,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 924067b..6e1927a 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 _0x7d09=['bluebird','request-promise','rimraf','../../config/environment','SquareOdbc','square_odbc','util','api','moment'];(function(_0x504691,_0x2d34f4){var _0x24364c=function(_0x5cb917){while(--_0x5cb917){_0x504691['push'](_0x504691['shift']());}};_0x24364c(++_0x2d34f4);}(_0x7d09,0x192));var _0x97d0=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0x7d09[_0x249e96];return _0x17444c;};'use strict';var _=require('lodash');var util=require(_0x97d0('0x0'));var logger=require('../../config/logger')(_0x97d0('0x1'));var moment=require(_0x97d0('0x2'));var BPromise=require(_0x97d0('0x3'));var rp=require(_0x97d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97d0('0x5'));var config=require(_0x97d0('0x6'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x1707c9,_0x31f036){return _0x1707c9['define'](_0x97d0('0x7'),attributes,{'tableName':_0x97d0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1966=['define','SquareOdbc','square_odbc','lodash','util','../../config/logger','request-promise','path','./squareOdbc.attributes','exports'];(function(_0x3a2225,_0xb6600){var _0x5c8040=function(_0x2bdb09){while(--_0x2bdb09){_0x3a2225['push'](_0x3a2225['shift']());}};_0x5c8040(++_0xb6600);}(_0x1966,0x1a7));var _0x6196=function(_0x5eed81,_0x131d60){_0x5eed81=_0x5eed81-0x0;var _0x50b1cf=_0x1966[_0x5eed81];return _0x50b1cf;};'use strict';var _=require(_0x6196('0x0'));var util=require(_0x6196('0x1'));var logger=require(_0x6196('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6196('0x3'));var fs=require('fs');var path=require(_0x6196('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6196('0x5'));module[_0x6196('0x6')]=function(_0x36efd9,_0x509e0d){return _0x36efd9[_0x6196('0x7')](_0x6196('0x8'),attributes,{'tableName':_0x6196('0x9'),'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 2233043..f29e609 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 _0xe617=['message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','map','model','include','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x492c19,_0x323efe){var _0x498a29=function(_0x5a4aff){while(--_0x5a4aff){_0x492c19['push'](_0x492c19['shift']());}};_0x498a29(++_0x323efe);}(_0xe617,0xec));var _0x7e61=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe617[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0x7e61('0x0'));var moment=require('moment');var BPromise=require(_0x7e61('0x1'));var rs=require(_0x7e61('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7e61('0x3'));var logger=require(_0x7e61('0x4'))(_0x7e61('0x5'));var config=require('../../config/environment');var jayson=require(_0x7e61('0x6'));var client=jayson['client'][_0x7e61('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfd8f64,_0x41466a,_0x9d3750){return new BPromise(function(_0x1c9827,_0x278464){return client[_0x7e61('0x8')](_0xfd8f64,_0x9d3750)[_0x7e61('0x9')](function(_0x365bd2){logger['info'](_0x7e61('0xa'),_0x41466a,_0x7e61('0xb'));logger[_0x7e61('0xc')](_0x7e61('0xd'),_0x41466a,_0x7e61('0xb'),JSON[_0x7e61('0xe')](_0x365bd2));if(_0x365bd2[_0x7e61('0xf')]){if(_0x365bd2[_0x7e61('0xf')]['code']===0x1f4){logger[_0x7e61('0xf')](_0x7e61('0xa'),_0x41466a,_0x365bd2[_0x7e61('0xf')][_0x7e61('0x10')]);return _0x278464(_0x365bd2[_0x7e61('0xf')][_0x7e61('0x10')]);}logger[_0x7e61('0xf')](_0x7e61('0xa'),_0x41466a,_0x365bd2[_0x7e61('0xf')][_0x7e61('0x10')]);return _0x1c9827(_0x365bd2[_0x7e61('0xf')][_0x7e61('0x10')]);}else{logger[_0x7e61('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x41466a,'request\x20sent');_0x1c9827(_0x365bd2['result'][_0x7e61('0x10')]);}})[_0x7e61('0x12')](function(_0x324c6d){logger[_0x7e61('0xf')](_0x7e61('0xa'),_0x41466a,_0x324c6d);_0x278464(_0x324c6d);});});}exports[_0x7e61('0x13')]=function(_0x2469d6){var _0xf639b2=this;return new Promise(function(_0x254fa0,_0x4b1b3b){return db[_0x7e61('0x14')][_0x7e61('0x15')]({'raw':_0x2469d6[_0x7e61('0x16')]?_0x2469d6[_0x7e61('0x16')][_0x7e61('0x17')]===undefined?!![]:![]:!![],'where':_0x2469d6['options']?_0x2469d6['options']['where']||null:null,'attributes':_0x2469d6[_0x7e61('0x16')]?_0x2469d6[_0x7e61('0x16')][_0x7e61('0x18')]||null:null,'include':_0x2469d6['options']?_0x2469d6[_0x7e61('0x16')]['include']?_[_0x7e61('0x19')](_0x2469d6['options']['include'],function(_0x257639){return{'model':db[_0x257639[_0x7e61('0x1a')]],'as':_0x257639['as'],'attributes':_0x257639[_0x7e61('0x18')],'include':_0x257639['include']?_[_0x7e61('0x19')](_0x257639[_0x7e61('0x1b')],function(_0x504bac){return{'model':db[_0x504bac['model']],'as':_0x504bac['as'],'attributes':_0x504bac['attributes'],'include':_0x504bac['include']?_[_0x7e61('0x19')](_0x504bac['include'],function(_0x5db1fc){return{'model':db[_0x5db1fc[_0x7e61('0x1a')]],'as':_0x5db1fc['as'],'attributes':_0x5db1fc[_0x7e61('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7e61('0x9')](function(_0x57247f){logger['info'](_0x7e61('0x13'),_0x2469d6);logger[_0x7e61('0xc')](_0x7e61('0x13'),_0x2469d6,JSON[_0x7e61('0xe')](_0x57247f));_0x254fa0(_0x57247f);})[_0x7e61('0x12')](function(_0x148b8){logger[_0x7e61('0xf')](_0x7e61('0x13'),_0x148b8['message'],_0x2469d6);_0x4b1b3b(_0xf639b2[_0x7e61('0xf')](0x1f4,_0x148b8[_0x7e61('0x10')]));});});}; \ No newline at end of file +var _0xcc47=['include','map','model','then','stringify','lodash','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','ShowSquareOdbc','find','options','raw','where','attributes'];(function(_0x1e4134,_0x202371){var _0x57ea60=function(_0x475646){while(--_0x475646){_0x1e4134['push'](_0x1e4134['shift']());}};_0x57ea60(++_0x202371);}(_0xcc47,0x18b));var _0x7cc4=function(_0xf8dd1f,_0x5288ae){_0xf8dd1f=_0xf8dd1f-0x0;var _0x53993f=_0xcc47[_0xf8dd1f];return _0x53993f;};'use strict';var _=require(_0x7cc4('0x0'));var util=require('util');var moment=require(_0x7cc4('0x1'));var BPromise=require(_0x7cc4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7cc4('0x3'));var logger=require('../../config/logger')(_0x7cc4('0x4'));var config=require(_0x7cc4('0x5'));var jayson=require(_0x7cc4('0x6'));var client=jayson[_0x7cc4('0x7')][_0x7cc4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x521841,_0x38d00d,_0x48390e){return new BPromise(function(_0x2b9d83,_0x94dc1e){return client[_0x7cc4('0x9')](_0x521841,_0x48390e)['then'](function(_0x36bfc0){logger['info'](_0x7cc4('0xa'),_0x38d00d,_0x7cc4('0xb'));logger[_0x7cc4('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x38d00d,'request\x20sent',JSON['stringify'](_0x36bfc0));if(_0x36bfc0['error']){if(_0x36bfc0[_0x7cc4('0xd')][_0x7cc4('0xe')]===0x1f4){logger[_0x7cc4('0xd')](_0x7cc4('0xa'),_0x38d00d,_0x36bfc0[_0x7cc4('0xd')][_0x7cc4('0xf')]);return _0x94dc1e(_0x36bfc0[_0x7cc4('0xd')]['message']);}logger[_0x7cc4('0xd')](_0x7cc4('0xa'),_0x38d00d,_0x36bfc0['error']['message']);return _0x2b9d83(_0x36bfc0[_0x7cc4('0xd')][_0x7cc4('0xf')]);}else{logger[_0x7cc4('0x10')](_0x7cc4('0xa'),_0x38d00d,_0x7cc4('0xb'));_0x2b9d83(_0x36bfc0[_0x7cc4('0x11')][_0x7cc4('0xf')]);}})[_0x7cc4('0x12')](function(_0x555c5a){logger[_0x7cc4('0xd')](_0x7cc4('0xa'),_0x38d00d,_0x555c5a);_0x94dc1e(_0x555c5a);});});}exports[_0x7cc4('0x13')]=function(_0x129fa9){var _0x233f37=this;return new Promise(function(_0x305a03,_0x3351f7){return db['SquareOdbc'][_0x7cc4('0x14')]({'raw':_0x129fa9['options']?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x16')]===undefined?!![]:![]:!![],'where':_0x129fa9[_0x7cc4('0x15')]?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x17')]||null:null,'attributes':_0x129fa9[_0x7cc4('0x15')]?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x18')]||null:null,'include':_0x129fa9[_0x7cc4('0x15')]?_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x19')]?_[_0x7cc4('0x1a')](_0x129fa9[_0x7cc4('0x15')][_0x7cc4('0x19')],function(_0x3f37a2){return{'model':db[_0x3f37a2[_0x7cc4('0x1b')]],'as':_0x3f37a2['as'],'attributes':_0x3f37a2[_0x7cc4('0x18')],'include':_0x3f37a2[_0x7cc4('0x19')]?_[_0x7cc4('0x1a')](_0x3f37a2[_0x7cc4('0x19')],function(_0x226407){return{'model':db[_0x226407[_0x7cc4('0x1b')]],'as':_0x226407['as'],'attributes':_0x226407[_0x7cc4('0x18')],'include':_0x226407['include']?_[_0x7cc4('0x1a')](_0x226407['include'],function(_0x292aaa){return{'model':db[_0x292aaa[_0x7cc4('0x1b')]],'as':_0x292aaa['as'],'attributes':_0x292aaa[_0x7cc4('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7cc4('0x1c')](function(_0x3184b6){logger[_0x7cc4('0x10')](_0x7cc4('0x13'),_0x129fa9);logger[_0x7cc4('0xc')](_0x7cc4('0x13'),_0x129fa9,JSON[_0x7cc4('0x1d')](_0x3184b6));_0x305a03(_0x3184b6);})['catch'](function(_0x2b683c){logger[_0x7cc4('0xd')](_0x7cc4('0x13'),_0x2b683c[_0x7cc4('0xf')],_0x129fa9);_0x3351f7(_0x233f37[_0x7cc4('0xd')](0x1f4,_0x2b683c[_0x7cc4('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 360458a..35da973 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 _0xd7fa=['isAuthenticated','get','/:id','getUsers','post','create','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd7fa,0x93));var _0xad7f=function(_0x3e954d,_0x4cc3a0){_0x3e954d=_0x3e954d-0x0;var _0x59649b=_0xd7fa[_0x3e954d];return _0x59649b;};'use strict';var multer=require(_0xad7f('0x0'));var util=require(_0xad7f('0x1'));var path=require(_0xad7f('0x2'));var timeout=require(_0xad7f('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xad7f('0x4'));var interaction=require(_0xad7f('0x5'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router['get']('/',auth[_0xad7f('0x6')](),controller['index']);router[_0xad7f('0x7')](_0xad7f('0x8'),auth[_0xad7f('0x6')](),controller['show']);router[_0xad7f('0x7')]('/:id/users',auth['isAuthenticated'](),controller[_0xad7f('0x9')]);router[_0xad7f('0xa')]('/',auth[_0xad7f('0x6')](),controller[_0xad7f('0xb')]);router[_0xad7f('0xa')]('/:id/users',auth[_0xad7f('0x6')](),controller['addUsers']);router['put']('/:id',auth[_0xad7f('0x6')](),controller[_0xad7f('0xc')]);router[_0xad7f('0xd')]('/:id',auth[_0xad7f('0x6')](),controller[_0xad7f('0xe')]);router['delete']('/:id/users',auth[_0xad7f('0x6')](),controller[_0xad7f('0xf')]);module[_0xad7f('0x10')]=router; \ No newline at end of file +var _0x7144=['show','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0x7144,0x129));var _0x4714=function(_0x5979b7,_0x4326a7){_0x5979b7=_0x5979b7-0x0;var _0x4d85c9=_0x7144[_0x5979b7];return _0x4d85c9;};'use strict';var multer=require(_0x4714('0x0'));var util=require(_0x4714('0x1'));var path=require(_0x4714('0x2'));var timeout=require('connect-timeout');var express=require(_0x4714('0x3'));var router=express['Router']();var auth=require(_0x4714('0x4'));var interaction=require(_0x4714('0x5'));var config=require(_0x4714('0x6'));var controller=require(_0x4714('0x7'));router[_0x4714('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4714('0x8')](_0x4714('0x9'),auth[_0x4714('0xa')](),controller[_0x4714('0xb')]);router[_0x4714('0x8')](_0x4714('0xc'),auth['isAuthenticated'](),controller[_0x4714('0xd')]);router[_0x4714('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4714('0xe')](_0x4714('0xc'),auth[_0x4714('0xa')](),controller[_0x4714('0xf')]);router[_0x4714('0x10')]('/:id',auth[_0x4714('0xa')](),controller[_0x4714('0x11')]);router[_0x4714('0x12')](_0x4714('0x9'),auth['isAuthenticated'](),controller[_0x4714('0x13')]);router[_0x4714('0x12')](_0x4714('0xc'),auth[_0x4714('0xa')](),controller[_0x4714('0x14')]);module[_0x4714('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 43c5b80..9a97f8e 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 _0x5353=['long','getDataValue','preproduction','utf8','production','toString','sequelize','STRING','name','TEXT','BLOB'];(function(_0x499210,_0x325b29){var _0x2e153d=function(_0x951263){while(--_0x951263){_0x499210['push'](_0x499210['shift']());}};_0x2e153d(++_0x325b29);}(_0x5353,0x12f));var _0x3535=function(_0x3e53f5,_0x5ad7e8){_0x3e53f5=_0x3e53f5-0x0;var _0x49c5a7=_0x5353[_0x3e53f5];return _0x49c5a7;};'use strict';var Sequelize=require(_0x3535('0x0'));module['exports']={'name':{'type':Sequelize[_0x3535('0x1')],'unique':_0x3535('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3535('0x1')]},'notes':{'type':Sequelize[_0x3535('0x3')]},'preproduction':{'type':Sequelize[_0x3535('0x4')](_0x3535('0x5')),'get':function(){if(this[_0x3535('0x6')](_0x3535('0x7'))){return this[_0x3535('0x6')](_0x3535('0x7'))['toString'](_0x3535('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x3535('0x5')),'get':function(){if(this[_0x3535('0x6')](_0x3535('0x9'))){return this['getDataValue'](_0x3535('0x9'))[_0x3535('0xa')](_0x3535('0x8'));}}}}; \ No newline at end of file +var _0x80c3=['getDataValue','production','utf8','sequelize','name','TEXT','BLOB','long','preproduction'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x80c3,0x18f));var _0x380c=function(_0x1bbc08,_0x444008){_0x1bbc08=_0x1bbc08-0x0;var _0x5d825b=_0x80c3[_0x1bbc08];return _0x5d825b;};'use strict';var Sequelize=require(_0x380c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x380c('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x380c('0x2')]},'preproduction':{'type':Sequelize[_0x380c('0x3')](_0x380c('0x4')),'get':function(){if(this['getDataValue']('preproduction')){return this['getDataValue'](_0x380c('0x5'))['toString']('utf8');}}},'production':{'type':Sequelize[_0x380c('0x3')](_0x380c('0x4')),'get':function(){if(this[_0x380c('0x6')]('production')){return this[_0x380c('0x6')](_0x380c('0x7'))['toString'](_0x380c('0x8'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 99ec2fc..ffe2391 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 _0x5784=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','offset','limit','set','apply','update','then','destroy','SquareProjects','UserProfileResource','sendStatus','error','stack','send','index','SquareProject','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','type','key','field','options','count','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','user','get','role','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','pick','getUsers','html-pdf','eml-format','zip-dir','fast-json-patch','moment'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0x5784,0x112));var _0x4578=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5784[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0x4578('0x0'));var emlformat=require(_0x4578('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4578('0x2'));var jsonpatch=require(_0x4578('0x3'));var rp=require('request-promise');var moment=require(_0x4578('0x4'));var BPromise=require(_0x4578('0x5'));var Mustache=require(_0x4578('0x6'));var util=require(_0x4578('0x7'));var path=require(_0x4578('0x8'));var sox=require(_0x4578('0x9'));var csv=require(_0x4578('0xa'));var ejs=require(_0x4578('0xb'));var fs=require('fs');var _=require(_0x4578('0xc'));var squel=require(_0x4578('0xd'));var crypto=require('crypto');var jsforce=require(_0x4578('0xe'));var deskjs=require(_0x4578('0xf'));var toCsv=require(_0x4578('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4578('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4578('0x11'));var hardwareService=require(_0x4578('0x12'));var logger=require(_0x4578('0x13'))('api');var utils=require(_0x4578('0x14'));var config=require(_0x4578('0x15'));var db=require(_0x4578('0x16'))['db'];config[_0x4578('0x17')]=_[_0x4578('0x18')](config[_0x4578('0x17')],{'host':_0x4578('0x19'),'port':0x18eb});var socket=require(_0x4578('0x1a'))(new Redis(config['redis']));require(_0x4578('0x1b'))[_0x4578('0x1c')](socket);function respondWithStatusCode(_0xef8f7e,_0xb5499e){_0xb5499e=_0xb5499e||0xcc;return function(_0x47c0ef){if(_0x47c0ef){return _0xef8f7e['sendStatus'](_0xb5499e);}return _0xef8f7e[_0x4578('0x1d')](_0xb5499e)['end']();};}function respondWithResult(_0xf24fa6,_0x1cb5a1){_0x1cb5a1=_0x1cb5a1||0xc8;return function(_0x3ef840){if(_0x3ef840){return _0xf24fa6[_0x4578('0x1d')](_0x1cb5a1)[_0x4578('0x1e')](_0x3ef840);}};}function respondWithFilteredResult(_0x45ed7c,_0x2b45d){return function(_0x226b2a){if(_0x226b2a){var _0x426d8c=_0x226b2a['count'],_0x5c78e8=_0x2b45d[_0x4578('0x1f')],_0x265310=_0x2b45d[_0x4578('0x1f')]+_0x2b45d[_0x4578('0x20')],_0xac11c8;if(_0x265310>=_0x426d8c){_0x265310=_0x426d8c;_0xac11c8=0xc8;}else{_0xac11c8=0xce;}_0x45ed7c[_0x4578('0x1d')](_0xac11c8);return _0x45ed7c[_0x4578('0x21')]('Content-Range',_0x5c78e8+'-'+_0x265310+'/'+_0x426d8c)[_0x4578('0x1e')](_0x226b2a);}return null;};}function patchUpdates(_0x20cbf5){return function(_0x1871d9){try{jsonpatch[_0x4578('0x22')](_0x1871d9,_0x20cbf5,!![]);}catch(_0x2bace6){return BPromise['reject'](_0x2bace6);}return _0x1871d9['save']();};}function saveUpdates(_0x5df4b6,_0x16ec82){return function(_0x4a8441){if(_0x4a8441){return _0x4a8441[_0x4578('0x23')](_0x5df4b6)[_0x4578('0x24')](function(_0x59d863){return _0x59d863;});}return null;};}function removeEntity(_0x14ac18,_0x4548e6){return function(_0x59197a){if(_0x59197a){return _0x59197a[_0x4578('0x25')]()[_0x4578('0x24')](function(){var _0x59dfa3=_0x59197a['get']({'plain':!![]});var _0x20b962=_0x4578('0x26');return db[_0x4578('0x27')][_0x4578('0x25')]({'where':{'type':_0x20b962,'resourceId':_0x59dfa3['id']}})[_0x4578('0x24')](function(){return _0x59197a;});})[_0x4578('0x24')](function(){_0x14ac18[_0x4578('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19508e,_0x5f0bbe){return function(_0x25d361){if(!_0x25d361){_0x19508e[_0x4578('0x28')](0x194);}return _0x25d361;};}function handleError(_0x1461c3,_0x29a1cd){_0x29a1cd=_0x29a1cd||0x1f4;return function(_0x275911){logger[_0x4578('0x29')](_0x275911[_0x4578('0x2a')]);if(_0x275911['name']){delete _0x275911['name'];}_0x1461c3[_0x4578('0x1d')](_0x29a1cd)[_0x4578('0x2b')](_0x275911);};}exports[_0x4578('0x2c')]=function(_0x57a227,_0x22a2af){var _0x58a20e={},_0x1be0b4={},_0x1f87ba={'count':0x0,'rows':[]};var _0x7494da=db[_0x4578('0x2d')]['rawAttributes'];_0x1be0b4[_0x4578('0x2e')]=_[_0x4578('0x2f')](_0x7494da);_0x1be0b4['query']=_['keys'](_0x57a227[_0x4578('0x30')]);_0x1be0b4[_0x4578('0x31')]=_[_0x4578('0x32')](_0x1be0b4['model'],_0x1be0b4[_0x4578('0x30')]);_0x58a20e[_0x4578('0x33')]=_['intersection'](_0x1be0b4[_0x4578('0x2e')],qs[_0x4578('0x34')](_0x57a227[_0x4578('0x30')][_0x4578('0x34')]));_0x58a20e[_0x4578('0x33')]=_0x58a20e[_0x4578('0x33')][_0x4578('0x35')]?_0x58a20e[_0x4578('0x33')]:_0x1be0b4[_0x4578('0x2e')];if(!_0x57a227['query'][_0x4578('0x36')](_0x4578('0x37'))){_0x58a20e['limit']=qs['limit'](_0x57a227[_0x4578('0x30')][_0x4578('0x20')]);_0x58a20e[_0x4578('0x1f')]=qs[_0x4578('0x1f')](_0x57a227['query'][_0x4578('0x1f')]);}_0x58a20e[_0x4578('0x38')]=qs['sort'](_0x57a227[_0x4578('0x30')][_0x4578('0x39')]);_0x58a20e['where']=qs[_0x4578('0x31')](_['pick'](_0x57a227[_0x4578('0x30')],_0x1be0b4[_0x4578('0x31')]));if(_0x57a227['query'][_0x4578('0x3a')]){_0x58a20e['where']=_[_0x4578('0x3b')](_0x58a20e[_0x4578('0x3c')],{'$or':_['map'](_0x7494da,function(_0x25be56){if(_0x25be56[_0x4578('0x3d')][_0x4578('0x3e')]!=='VIRTUAL'){var _0x2e8356={};_0x2e8356[_0x25be56[_0x4578('0x3f')]]={'$like':'%'+_0x57a227[_0x4578('0x30')][_0x4578('0x3a')]+'%'};return _0x2e8356;}})});}_0x58a20e=_[_0x4578('0x3b')]({},_0x58a20e,_0x57a227[_0x4578('0x40')]);var _0x48a91d={'where':_0x58a20e[_0x4578('0x3c')]};return db[_0x4578('0x2d')][_0x4578('0x41')](_0x48a91d)[_0x4578('0x24')](function(_0x3ae5c1){_0x1f87ba[_0x4578('0x41')]=_0x3ae5c1;if(_0x57a227[_0x4578('0x30')]['includeAll']){_0x58a20e[_0x4578('0x42')]=[{'all':!![]}];}return db[_0x4578('0x2d')][_0x4578('0x43')](_0x58a20e);})['then'](function(_0xadd235){_0x1f87ba[_0x4578('0x44')]=_0xadd235;return _0x1f87ba;})[_0x4578('0x24')](respondWithFilteredResult(_0x22a2af,_0x58a20e))[_0x4578('0x45')](handleError(_0x22a2af,null));};exports['show']=function(_0x2266fc,_0x202ce5){var _0x3ddcba={'raw':![],'where':{'id':_0x2266fc[_0x4578('0x46')]['id']}},_0x3b9f97={};_0x3b9f97['model']=_[_0x4578('0x2f')](db[_0x4578('0x2d')][_0x4578('0x47')]);_0x3b9f97[_0x4578('0x30')]=_['keys'](_0x2266fc[_0x4578('0x30')]);_0x3b9f97[_0x4578('0x31')]=_['intersection'](_0x3b9f97[_0x4578('0x2e')],_0x3b9f97[_0x4578('0x30')]);_0x3ddcba[_0x4578('0x33')]=_['intersection'](_0x3b9f97[_0x4578('0x2e')],qs[_0x4578('0x34')](_0x2266fc[_0x4578('0x30')][_0x4578('0x34')]));_0x3ddcba[_0x4578('0x33')]=_0x3ddcba['attributes'][_0x4578('0x35')]?_0x3ddcba[_0x4578('0x33')]:_0x3b9f97[_0x4578('0x2e')];if(_0x2266fc[_0x4578('0x30')][_0x4578('0x48')]){_0x3ddcba['include']=[{'all':!![]}];}_0x3ddcba=_[_0x4578('0x3b')]({},_0x3ddcba,_0x2266fc[_0x4578('0x40')]);return db['SquareProject'][_0x4578('0x49')](_0x3ddcba)[_0x4578('0x24')](handleEntityNotFound(_0x202ce5,null))['then'](respondWithResult(_0x202ce5,null))[_0x4578('0x45')](handleError(_0x202ce5,null));};exports[_0x4578('0x4a')]=function(_0x720fe1,_0x40ce63){return db[_0x4578('0x2d')]['create'](_0x720fe1['body'],{})[_0x4578('0x24')](function(_0x2010e6){var _0x5e993d=_0x720fe1[_0x4578('0x4b')][_0x4578('0x4c')]({'plain':!![]});if(!_0x5e993d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e993d[_0x4578('0x4d')]==='user'){var _0x2b09a4=_0x2010e6[_0x4578('0x4c')]({'plain':!![]});var _0x51b05f=_0x4578('0x26');return db['UserProfileSection'][_0x4578('0x49')]({'where':{'name':_0x51b05f,'userProfileId':_0x5e993d['userProfileId']},'raw':!![]})[_0x4578('0x24')](function(_0x2220bf){if(_0x2220bf&&_0x2220bf[_0x4578('0x4e')]===0x0){return db[_0x4578('0x27')][_0x4578('0x4a')]({'name':_0x2b09a4['name'],'resourceId':_0x2b09a4['id'],'type':_0x2220bf[_0x4578('0x4f')],'sectionId':_0x2220bf['id']},{})['then'](function(){return _0x2010e6;});}else{return _0x2010e6;}})[_0x4578('0x45')](function(_0x150f90){logger[_0x4578('0x29')](_0x4578('0x50'),_0x150f90);throw _0x150f90;});}return _0x2010e6;})[_0x4578('0x24')](respondWithResult(_0x40ce63,0xc9))['catch'](handleError(_0x40ce63,null));};exports[_0x4578('0x23')]=function(_0x41ee58,_0x456ae2){if(_0x41ee58[_0x4578('0x51')]['id']){delete _0x41ee58[_0x4578('0x51')]['id'];}return db[_0x4578('0x2d')][_0x4578('0x49')]({'where':{'id':_0x41ee58[_0x4578('0x46')]['id']}})[_0x4578('0x24')](handleEntityNotFound(_0x456ae2,null))[_0x4578('0x24')](saveUpdates(_0x41ee58[_0x4578('0x51')],null))[_0x4578('0x24')](respondWithResult(_0x456ae2,null))[_0x4578('0x45')](handleError(_0x456ae2,null));};exports[_0x4578('0x25')]=function(_0x29fafe,_0x1e271c){return db[_0x4578('0x2d')][_0x4578('0x49')]({'where':{'id':_0x29fafe[_0x4578('0x46')]['id']}})[_0x4578('0x24')](handleEntityNotFound(_0x1e271c,null))[_0x4578('0x24')](removeEntity(_0x1e271c,null))[_0x4578('0x45')](handleError(_0x1e271c,null));};exports[_0x4578('0x52')]=function(_0x4cc021,_0x4a1ea6,_0x541b43){return db[_0x4578('0x2d')][_0x4578('0x49')]({'where':{'id':_0x4cc021['params']['id']}})[_0x4578('0x24')](handleEntityNotFound(_0x4a1ea6,null))[_0x4578('0x24')](function(_0x1b9f63){if(_0x1b9f63){return _0x1b9f63['addUsers'](_0x4cc021[_0x4578('0x51')]['ids'],_[_0x4578('0x53')](_0x4cc021[_0x4578('0x51')],[_0x4578('0x54'),'id'])||{});}})[_0x4578('0x24')](respondWithResult(_0x4a1ea6,null))[_0x4578('0x45')](handleError(_0x4a1ea6,null));};exports[_0x4578('0x55')]=function(_0x34d45b,_0x4fbb32,_0x3d00fe){return db[_0x4578('0x2d')][_0x4578('0x49')]({'where':{'id':_0x34d45b[_0x4578('0x46')]['id']}})[_0x4578('0x24')](handleEntityNotFound(_0x4fbb32,null))['then'](function(_0x321787){if(_0x321787){return _0x321787[_0x4578('0x55')](_0x34d45b['query']['ids'])[_0x4578('0x24')](function(){if(_[_0x4578('0x56')](_0x34d45b[_0x4578('0x30')][_0x4578('0x54')])){for(var _0x5b6353=0x0;_0x5b6353<_0x34d45b[_0x4578('0x30')][_0x4578('0x54')][_0x4578('0x35')];_0x5b6353+=0x1){socket[_0x4578('0x57')](_0x4578('0x58'),{'UserId':Number(_0x34d45b[_0x4578('0x30')][_0x4578('0x54')][_0x5b6353]),'SquareProjectId':Number(_0x34d45b['params']['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x34d45b[_0x4578('0x30')][_0x4578('0x54')]),'SquareProjectId':Number(_0x34d45b[_0x4578('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x4fbb32,null))[_0x4578('0x45')](handleError(_0x4fbb32,null));};exports['getUsers']=function(_0x50deba,_0x3eac88,_0x579b9b){var _0x31e85a={};var _0x53d414={};var _0x2d88cf;var _0x5c58a0;return db[_0x4578('0x2d')][_0x4578('0x59')]({'where':{'id':_0x50deba[_0x4578('0x46')]['id']}})[_0x4578('0x24')](handleEntityNotFound(_0x3eac88,null))[_0x4578('0x24')](function(_0x5907ed){if(_0x5907ed){_0x2d88cf=_0x5907ed;_0x53d414[_0x4578('0x2e')]=_[_0x4578('0x2f')](db[_0x4578('0x5a')]['rawAttributes']);_0x53d414[_0x4578('0x30')]=_[_0x4578('0x2f')](_0x50deba[_0x4578('0x30')]);_0x53d414[_0x4578('0x31')]=_['intersection'](_0x53d414['model'],_0x53d414[_0x4578('0x30')]);_0x31e85a[_0x4578('0x33')]=_[_0x4578('0x32')](_0x53d414[_0x4578('0x2e')],qs['fields'](_0x50deba[_0x4578('0x30')][_0x4578('0x34')]));_0x31e85a['attributes']=_0x31e85a[_0x4578('0x33')][_0x4578('0x35')]?_0x31e85a[_0x4578('0x33')]:_0x53d414[_0x4578('0x2e')];_0x31e85a['order']=qs[_0x4578('0x39')](_0x50deba[_0x4578('0x30')][_0x4578('0x39')]);_0x31e85a['where']=qs['filters'](_[_0x4578('0x5b')](_0x50deba[_0x4578('0x30')],_0x53d414[_0x4578('0x31')]));if(_0x50deba['query'][_0x4578('0x3a')]){_0x31e85a[_0x4578('0x3c')]=_[_0x4578('0x3b')](_0x31e85a[_0x4578('0x3c')],{'$or':_['map'](_0x31e85a[_0x4578('0x33')],function(_0x5f3e19){var _0x41e7a6={};_0x41e7a6[_0x5f3e19]={'$like':'%'+_0x50deba[_0x4578('0x30')][_0x4578('0x3a')]+'%'};return _0x41e7a6;})});}_0x31e85a=_[_0x4578('0x3b')]({},_0x31e85a,_0x50deba[_0x4578('0x40')]);return _0x2d88cf[_0x4578('0x5c')](_0x31e85a);}})[_0x4578('0x24')](function(_0x5cf31e){if(_0x5cf31e){_0x5c58a0=_0x5cf31e[_0x4578('0x35')];if(!_0x50deba[_0x4578('0x30')]['hasOwnProperty'](_0x4578('0x37'))){_0x31e85a[_0x4578('0x20')]=qs['limit'](_0x50deba['query'][_0x4578('0x20')]);_0x31e85a['offset']=qs[_0x4578('0x1f')](_0x50deba['query'][_0x4578('0x1f')]);}return _0x2d88cf[_0x4578('0x5c')](_0x31e85a);}})[_0x4578('0x24')](function(_0x35f1f4){if(_0x35f1f4){return _0x35f1f4?{'count':_0x5c58a0,'rows':_0x35f1f4}:null;}})[_0x4578('0x24')](respondWithResult(_0x3eac88,null))[_0x4578('0x45')](handleError(_0x3eac88,null));}; \ No newline at end of file +var _0x1c73=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addUsers','omit','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','SquareProjects','UserProfileResource','error','stack','name','send','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','field','options','SquareProject','include','findAll','rows','catch','show','params','create','body'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x1c73,0x1ec));var _0x31c7=function(_0x207177,_0x5d450c){_0x207177=_0x207177-0x0;var _0x1ed60c=_0x1c73[_0x207177];return _0x1ed60c;};'use strict';var pdf=require(_0x31c7('0x0'));var emlformat=require(_0x31c7('0x1'));var rimraf=require(_0x31c7('0x2'));var zipdir=require(_0x31c7('0x3'));var jsonpatch=require(_0x31c7('0x4'));var rp=require('request-promise');var moment=require(_0x31c7('0x5'));var BPromise=require(_0x31c7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x31c7('0x7'));var sox=require('sox');var csv=require(_0x31c7('0x8'));var ejs=require(_0x31c7('0x9'));var fs=require('fs');var _=require(_0x31c7('0xa'));var squel=require(_0x31c7('0xb'));var crypto=require(_0x31c7('0xc'));var jsforce=require(_0x31c7('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x31c7('0x8'));var querystring=require(_0x31c7('0xe'));var Papa=require('papaparse');var Redis=require(_0x31c7('0xf'));var authService=require(_0x31c7('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x31c7('0x11'));var logger=require(_0x31c7('0x12'))(_0x31c7('0x13'));var utils=require(_0x31c7('0x14'));var config=require(_0x31c7('0x15'));var db=require(_0x31c7('0x16'))['db'];config[_0x31c7('0x17')]=_[_0x31c7('0x18')](config[_0x31c7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x31c7('0x19'))(new Redis(config[_0x31c7('0x17')]));require(_0x31c7('0x1a'))[_0x31c7('0x1b')](socket);function respondWithStatusCode(_0x425b5d,_0x3abe82){_0x3abe82=_0x3abe82||0xcc;return function(_0x558c5b){if(_0x558c5b){return _0x425b5d[_0x31c7('0x1c')](_0x3abe82);}return _0x425b5d[_0x31c7('0x1d')](_0x3abe82)[_0x31c7('0x1e')]();};}function respondWithResult(_0x145b32,_0x45168b){_0x45168b=_0x45168b||0xc8;return function(_0x51d1b9){if(_0x51d1b9){return _0x145b32[_0x31c7('0x1d')](_0x45168b)['json'](_0x51d1b9);}};}function respondWithFilteredResult(_0x461115,_0x2dee14){return function(_0x3677f8){if(_0x3677f8){var _0x40e258=_0x3677f8[_0x31c7('0x1f')],_0x27d1e7=_0x2dee14[_0x31c7('0x20')],_0x1257bd=_0x2dee14[_0x31c7('0x20')]+_0x2dee14[_0x31c7('0x21')],_0x1e3098;if(_0x1257bd>=_0x40e258){_0x1257bd=_0x40e258;_0x1e3098=0xc8;}else{_0x1e3098=0xce;}_0x461115[_0x31c7('0x1d')](_0x1e3098);return _0x461115[_0x31c7('0x22')](_0x31c7('0x23'),_0x27d1e7+'-'+_0x1257bd+'/'+_0x40e258)['json'](_0x3677f8);}return null;};}function patchUpdates(_0x4d2377){return function(_0x1a5aa2){try{jsonpatch[_0x31c7('0x24')](_0x1a5aa2,_0x4d2377,!![]);}catch(_0x2338e7){return BPromise[_0x31c7('0x25')](_0x2338e7);}return _0x1a5aa2[_0x31c7('0x26')]();};}function saveUpdates(_0x56b8f2,_0x1b6318){return function(_0x5e2cf3){if(_0x5e2cf3){return _0x5e2cf3[_0x31c7('0x27')](_0x56b8f2)['then'](function(_0x48a8c0){return _0x48a8c0;});}return null;};}function removeEntity(_0x56d683,_0x2a5d48){return function(_0x1ff008){if(_0x1ff008){return _0x1ff008[_0x31c7('0x28')]()[_0x31c7('0x29')](function(){var _0x4f3075=_0x1ff008[_0x31c7('0x2a')]({'plain':!![]});var _0x501e6c=_0x31c7('0x2b');return db[_0x31c7('0x2c')]['destroy']({'where':{'type':_0x501e6c,'resourceId':_0x4f3075['id']}})['then'](function(){return _0x1ff008;});})[_0x31c7('0x29')](function(){_0x56d683[_0x31c7('0x1d')](0xcc)[_0x31c7('0x1e')]();});}};}function handleEntityNotFound(_0xa5db9a,_0x617fbb){return function(_0x2f7980){if(!_0x2f7980){_0xa5db9a[_0x31c7('0x1c')](0x194);}return _0x2f7980;};}function handleError(_0x4bba92,_0x24488d){_0x24488d=_0x24488d||0x1f4;return function(_0x56f0fe){logger[_0x31c7('0x2d')](_0x56f0fe[_0x31c7('0x2e')]);if(_0x56f0fe[_0x31c7('0x2f')]){delete _0x56f0fe[_0x31c7('0x2f')];}_0x4bba92[_0x31c7('0x1d')](_0x24488d)[_0x31c7('0x30')](_0x56f0fe);};}exports['index']=function(_0x48ffdd,_0x4edb86){var _0x2386bb={},_0x3f7ad7={},_0x46b1b2={'count':0x0,'rows':[]};var _0x3d9ac5=db['SquareProject'][_0x31c7('0x31')];_0x3f7ad7[_0x31c7('0x32')]=_[_0x31c7('0x33')](_0x3d9ac5);_0x3f7ad7[_0x31c7('0x34')]=_[_0x31c7('0x33')](_0x48ffdd['query']);_0x3f7ad7[_0x31c7('0x35')]=_['intersection'](_0x3f7ad7[_0x31c7('0x32')],_0x3f7ad7[_0x31c7('0x34')]);_0x2386bb['attributes']=_[_0x31c7('0x36')](_0x3f7ad7['model'],qs[_0x31c7('0x37')](_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x37')]));_0x2386bb['attributes']=_0x2386bb[_0x31c7('0x38')][_0x31c7('0x39')]?_0x2386bb[_0x31c7('0x38')]:_0x3f7ad7[_0x31c7('0x32')];if(!_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x3a')](_0x31c7('0x3b'))){_0x2386bb[_0x31c7('0x21')]=qs['limit'](_0x48ffdd['query'][_0x31c7('0x21')]);_0x2386bb[_0x31c7('0x20')]=qs[_0x31c7('0x20')](_0x48ffdd['query'][_0x31c7('0x20')]);}_0x2386bb[_0x31c7('0x3c')]=qs[_0x31c7('0x3d')](_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x3d')]);_0x2386bb[_0x31c7('0x3e')]=qs[_0x31c7('0x35')](_[_0x31c7('0x3f')](_0x48ffdd[_0x31c7('0x34')],_0x3f7ad7[_0x31c7('0x35')]));if(_0x48ffdd['query'][_0x31c7('0x40')]){_0x2386bb[_0x31c7('0x3e')]=_[_0x31c7('0x41')](_0x2386bb[_0x31c7('0x3e')],{'$or':_['map'](_0x3d9ac5,function(_0x5e4acd){if(_0x5e4acd['type']['key']!==_0x31c7('0x42')){var _0x20ec32={};_0x20ec32[_0x5e4acd[_0x31c7('0x43')]]={'$like':'%'+_0x48ffdd[_0x31c7('0x34')][_0x31c7('0x40')]+'%'};return _0x20ec32;}})});}_0x2386bb=_[_0x31c7('0x41')]({},_0x2386bb,_0x48ffdd[_0x31c7('0x44')]);var _0x2be2dc={'where':_0x2386bb[_0x31c7('0x3e')]};return db[_0x31c7('0x45')][_0x31c7('0x1f')](_0x2be2dc)[_0x31c7('0x29')](function(_0x155e92){_0x46b1b2[_0x31c7('0x1f')]=_0x155e92;if(_0x48ffdd[_0x31c7('0x34')]['includeAll']){_0x2386bb[_0x31c7('0x46')]=[{'all':!![]}];}return db[_0x31c7('0x45')][_0x31c7('0x47')](_0x2386bb);})['then'](function(_0x13dc4c){_0x46b1b2[_0x31c7('0x48')]=_0x13dc4c;return _0x46b1b2;})['then'](respondWithFilteredResult(_0x4edb86,_0x2386bb))[_0x31c7('0x49')](handleError(_0x4edb86,null));};exports[_0x31c7('0x4a')]=function(_0x4ff15b,_0x1f4c2e){var _0x4ba556={'raw':![],'where':{'id':_0x4ff15b[_0x31c7('0x4b')]['id']}},_0x110b9c={};_0x110b9c['model']=_[_0x31c7('0x33')](db[_0x31c7('0x45')][_0x31c7('0x31')]);_0x110b9c[_0x31c7('0x34')]=_['keys'](_0x4ff15b[_0x31c7('0x34')]);_0x110b9c[_0x31c7('0x35')]=_['intersection'](_0x110b9c[_0x31c7('0x32')],_0x110b9c[_0x31c7('0x34')]);_0x4ba556[_0x31c7('0x38')]=_['intersection'](_0x110b9c[_0x31c7('0x32')],qs[_0x31c7('0x37')](_0x4ff15b[_0x31c7('0x34')][_0x31c7('0x37')]));_0x4ba556[_0x31c7('0x38')]=_0x4ba556['attributes'][_0x31c7('0x39')]?_0x4ba556[_0x31c7('0x38')]:_0x110b9c[_0x31c7('0x32')];if(_0x4ff15b['query']['includeAll']){_0x4ba556['include']=[{'all':!![]}];}_0x4ba556=_[_0x31c7('0x41')]({},_0x4ba556,_0x4ff15b[_0x31c7('0x44')]);return db[_0x31c7('0x45')]['find'](_0x4ba556)[_0x31c7('0x29')](handleEntityNotFound(_0x1f4c2e,null))[_0x31c7('0x29')](respondWithResult(_0x1f4c2e,null))[_0x31c7('0x49')](handleError(_0x1f4c2e,null));};exports[_0x31c7('0x4c')]=function(_0x24ba28,_0x4943ae){return db[_0x31c7('0x45')][_0x31c7('0x4c')](_0x24ba28[_0x31c7('0x4d')],{})['then'](function(_0x4aab13){var _0x1d5072=_0x24ba28['user']['get']({'plain':!![]});if(!_0x1d5072)throw new Error(_0x31c7('0x4e'));if(_0x1d5072[_0x31c7('0x4f')]===_0x31c7('0x50')){var _0x4523d0=_0x4aab13[_0x31c7('0x2a')]({'plain':!![]});var _0x324a71=_0x31c7('0x2b');return db[_0x31c7('0x51')]['find']({'where':{'name':_0x324a71,'userProfileId':_0x1d5072[_0x31c7('0x52')]},'raw':!![]})[_0x31c7('0x29')](function(_0x16855e){if(_0x16855e&&_0x16855e[_0x31c7('0x53')]===0x0){return db[_0x31c7('0x2c')][_0x31c7('0x4c')]({'name':_0x4523d0['name'],'resourceId':_0x4523d0['id'],'type':_0x16855e[_0x31c7('0x2f')],'sectionId':_0x16855e['id']},{})[_0x31c7('0x29')](function(){return _0x4aab13;});}else{return _0x4aab13;}})[_0x31c7('0x49')](function(_0x3a8a9f){logger[_0x31c7('0x2d')](_0x31c7('0x54'),_0x3a8a9f);throw _0x3a8a9f;});}return _0x4aab13;})[_0x31c7('0x29')](respondWithResult(_0x4943ae,0xc9))[_0x31c7('0x49')](handleError(_0x4943ae,null));};exports[_0x31c7('0x27')]=function(_0x5c952b,_0x1ac9b7){if(_0x5c952b[_0x31c7('0x4d')]['id']){delete _0x5c952b[_0x31c7('0x4d')]['id'];}return db[_0x31c7('0x45')]['find']({'where':{'id':_0x5c952b[_0x31c7('0x4b')]['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x1ac9b7,null))[_0x31c7('0x29')](saveUpdates(_0x5c952b['body'],null))[_0x31c7('0x29')](respondWithResult(_0x1ac9b7,null))[_0x31c7('0x49')](handleError(_0x1ac9b7,null));};exports[_0x31c7('0x28')]=function(_0x529f6d,_0x1dc763){return db[_0x31c7('0x45')][_0x31c7('0x55')]({'where':{'id':_0x529f6d['params']['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x1dc763,null))[_0x31c7('0x29')](removeEntity(_0x1dc763,null))[_0x31c7('0x49')](handleError(_0x1dc763,null));};exports[_0x31c7('0x56')]=function(_0x81e6b3,_0x35b09a,_0x1a74cf){return db[_0x31c7('0x45')]['find']({'where':{'id':_0x81e6b3['params']['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x35b09a,null))[_0x31c7('0x29')](function(_0x2a3fd7){if(_0x2a3fd7){return _0x2a3fd7[_0x31c7('0x56')](_0x81e6b3[_0x31c7('0x4d')]['ids'],_[_0x31c7('0x57')](_0x81e6b3[_0x31c7('0x4d')],[_0x31c7('0x58'),'id'])||{});}})[_0x31c7('0x29')](respondWithResult(_0x35b09a,null))[_0x31c7('0x49')](handleError(_0x35b09a,null));};exports[_0x31c7('0x59')]=function(_0x6dc0c6,_0x3a5384,_0x14229f){return db['SquareProject']['find']({'where':{'id':_0x6dc0c6[_0x31c7('0x4b')]['id']}})[_0x31c7('0x29')](handleEntityNotFound(_0x3a5384,null))[_0x31c7('0x29')](function(_0x54da24){if(_0x54da24){return _0x54da24[_0x31c7('0x59')](_0x6dc0c6[_0x31c7('0x34')][_0x31c7('0x58')])['then'](function(){if(_['isArray'](_0x6dc0c6['query'][_0x31c7('0x58')])){for(var _0x28ed85=0x0;_0x28ed85<_0x6dc0c6['query'][_0x31c7('0x58')][_0x31c7('0x39')];_0x28ed85+=0x1){socket[_0x31c7('0x5a')](_0x31c7('0x5b'),{'UserId':Number(_0x6dc0c6[_0x31c7('0x34')][_0x31c7('0x58')][_0x28ed85]),'SquareProjectId':Number(_0x6dc0c6[_0x31c7('0x4b')]['id'])});}}else{socket[_0x31c7('0x5a')](_0x31c7('0x5b'),{'UserId':Number(_0x6dc0c6[_0x31c7('0x34')][_0x31c7('0x58')]),'SquareProjectId':Number(_0x6dc0c6[_0x31c7('0x4b')]['id'])});}});}})[_0x31c7('0x29')](respondWithStatusCode(_0x3a5384,null))[_0x31c7('0x49')](handleError(_0x3a5384,null));};exports[_0x31c7('0x5c')]=function(_0x49ca98,_0x28be35,_0x897a50){var _0x1aea32={};var _0x2626b4={};var _0x1bb1fd;var _0x4e876f;return db[_0x31c7('0x45')][_0x31c7('0x5d')]({'where':{'id':_0x49ca98[_0x31c7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x28be35,null))['then'](function(_0x3cc48e){if(_0x3cc48e){_0x1bb1fd=_0x3cc48e;_0x2626b4['model']=_['keys'](db[_0x31c7('0x5e')]['rawAttributes']);_0x2626b4[_0x31c7('0x34')]=_[_0x31c7('0x33')](_0x49ca98[_0x31c7('0x34')]);_0x2626b4[_0x31c7('0x35')]=_[_0x31c7('0x36')](_0x2626b4[_0x31c7('0x32')],_0x2626b4[_0x31c7('0x34')]);_0x1aea32[_0x31c7('0x38')]=_[_0x31c7('0x36')](_0x2626b4[_0x31c7('0x32')],qs[_0x31c7('0x37')](_0x49ca98[_0x31c7('0x34')][_0x31c7('0x37')]));_0x1aea32['attributes']=_0x1aea32['attributes'][_0x31c7('0x39')]?_0x1aea32[_0x31c7('0x38')]:_0x2626b4[_0x31c7('0x32')];_0x1aea32[_0x31c7('0x3c')]=qs[_0x31c7('0x3d')](_0x49ca98[_0x31c7('0x34')][_0x31c7('0x3d')]);_0x1aea32[_0x31c7('0x3e')]=qs[_0x31c7('0x35')](_[_0x31c7('0x3f')](_0x49ca98[_0x31c7('0x34')],_0x2626b4[_0x31c7('0x35')]));if(_0x49ca98['query'][_0x31c7('0x40')]){_0x1aea32['where']=_[_0x31c7('0x41')](_0x1aea32[_0x31c7('0x3e')],{'$or':_['map'](_0x1aea32[_0x31c7('0x38')],function(_0x3a0ff1){var _0x2e0731={};_0x2e0731[_0x3a0ff1]={'$like':'%'+_0x49ca98[_0x31c7('0x34')][_0x31c7('0x40')]+'%'};return _0x2e0731;})});}_0x1aea32=_[_0x31c7('0x41')]({},_0x1aea32,_0x49ca98[_0x31c7('0x44')]);return _0x1bb1fd[_0x31c7('0x5c')](_0x1aea32);}})['then'](function(_0x17c9ab){if(_0x17c9ab){_0x4e876f=_0x17c9ab[_0x31c7('0x39')];if(!_0x49ca98[_0x31c7('0x34')][_0x31c7('0x3a')]('nolimit')){_0x1aea32[_0x31c7('0x21')]=qs[_0x31c7('0x21')](_0x49ca98['query'][_0x31c7('0x21')]);_0x1aea32[_0x31c7('0x20')]=qs['offset'](_0x49ca98[_0x31c7('0x34')][_0x31c7('0x20')]);}return _0x1bb1fd[_0x31c7('0x5c')](_0x1aea32);}})[_0x31c7('0x29')](function(_0x15f716){if(_0x15f716){return _0x15f716?{'count':_0x4e876f,'rows':_0x15f716}:null;}})[_0x31c7('0x29')](respondWithResult(_0x28be35,null))['catch'](handleError(_0x28be35,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index ffe65be..f9a99c0 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 _0x9fd0=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','remove'];(function(_0x5cef93,_0x15b4bf){var _0x17676d=function(_0x12197a){while(--_0x12197a){_0x5cef93['push'](_0x5cef93['shift']());}};_0x17676d(++_0x15b4bf);}(_0x9fd0,0x13c));var _0x09fd=function(_0x51c440,_0x3b6802){_0x51c440=_0x51c440-0x0;var _0x67a2d6=_0x9fd0[_0x51c440];return _0x67a2d6;};'use strict';var EventEmitter=require(_0x09fd('0x0'));var SquareProject=require(_0x09fd('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x09fd('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x09fd('0x3')};function emitEvent(_0x752da2){return function(_0x57bfae,_0xced3b3,_0x2c354f){SquareProjectEvents[_0x09fd('0x4')](_0x752da2+':'+_0x57bfae['id'],_0x57bfae);SquareProjectEvents['emit'](_0x752da2,_0x57bfae);_0x2c354f(null);};}for(var e in events){if(events[_0x09fd('0x5')](e)){var event=events[e];SquareProject[_0x09fd('0x6')](e,emitEvent(event));}}module[_0x09fd('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xe149=['exports','SquareProject','save','update','remove','emit','hasOwnProperty'];(function(_0x4e6766,_0x43c16a){var _0x13fc37=function(_0x3e7a3b){while(--_0x3e7a3b){_0x4e6766['push'](_0x4e6766['shift']());}};_0x13fc37(++_0x43c16a);}(_0xe149,0xf6));var _0x9e14=function(_0x4a6e97,_0x48375b){_0x4a6e97=_0x4a6e97-0x0;var _0x216a49=_0xe149[_0x4a6e97];return _0x216a49;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x9e14('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e14('0x1'),'afterUpdate':_0x9e14('0x2'),'afterDestroy':_0x9e14('0x3')};function emitEvent(_0xb0ef36){return function(_0x3794a9,_0x3a8fa9,_0x813cde){SquareProjectEvents[_0x9e14('0x4')](_0xb0ef36+':'+_0x3794a9['id'],_0x3794a9);SquareProjectEvents[_0x9e14('0x4')](_0xb0ef36,_0x3794a9);_0x813cde(null);};}for(var e in events){if(events[_0x9e14('0x5')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x9e14('0x6')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index a7c2501..17193e6 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 _0x1449=['rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','moment','bluebird','request-promise'];(function(_0x4aac7b,_0x15087c){var _0x142982=function(_0x20a7e8){while(--_0x20a7e8){_0x4aac7b['push'](_0x4aac7b['shift']());}};_0x142982(++_0x15087c);}(_0x1449,0xde));var _0x9144=function(_0x2c3a88,_0x48637e){_0x2c3a88=_0x2c3a88-0x0;var _0x4a7925=_0x1449[_0x2c3a88];return _0x4a7925;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9144('0x0'));var BPromise=require(_0x9144('0x1'));var rp=require(_0x9144('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9144('0x3'));var config=require('../../config/environment');var attributes=require(_0x9144('0x4'));module[_0x9144('0x5')]=function(_0x372c16,_0x1db28f){return _0x372c16[_0x9144('0x6')](_0x9144('0x7'),attributes,{'tableName':_0x9144('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa887=['square_projects','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x220b5f,_0x10f186){var _0x28389e=function(_0x10de49){while(--_0x10de49){_0x220b5f['push'](_0x220b5f['shift']());}};_0x28389e(++_0x10f186);}(_0xa887,0x1a5));var _0x7a88=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa887[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x7a88('0x0'));var util=require(_0x7a88('0x1'));var logger=require(_0x7a88('0x2'))(_0x7a88('0x3'));var moment=require('moment');var BPromise=require(_0x7a88('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a88('0x5'));var rimraf=require('rimraf');var config=require(_0x7a88('0x6'));var attributes=require(_0x7a88('0x7'));module[_0x7a88('0x8')]=function(_0x4f1491,_0x39e597){return _0x4f1491[_0x7a88('0x9')](_0x7a88('0xa'),attributes,{'tableName':_0x7a88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index b1ca9ef..1412a9f 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 _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x55aa15,_0x203620){var _0x3d7314=function(_0x748537){while(--_0x748537){_0x55aa15['push'](_0x55aa15['shift']());}};_0x3d7314(++_0x203620);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file +var _0xa9e0=['catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x57fabd,_0x632258){var _0x24cdd7=function(_0xab78c3){while(--_0xab78c3){_0x57fabd['push'](_0x57fabd['shift']());}};_0x24cdd7(++_0x632258);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./squareProject.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('SquareProject,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['SquareProject'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')],function(_0x42ac8f){return{'model':db[_0x42ac8f[_0x0a9e('0x21')]],'as':_0x42ac8f['as'],'attributes':_0x42ac8f['attributes'],'include':_0x42ac8f['include']?_[_0x0a9e('0x20')](_0x42ac8f[_0x0a9e('0x1f')],function(_0x40c424){return{'model':db[_0x40c424[_0x0a9e('0x21')]],'as':_0x40c424['as'],'attributes':_0x40c424['attributes'],'include':_0x40c424[_0x0a9e('0x1f')]?_['map'](_0x40c424[_0x0a9e('0x1f')],function(_0x5bfb33){return{'model':db[_0x5bfb33[_0x0a9e('0x21')]],'as':_0x5bfb33['as'],'attributes':_0x5bfb33[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x22')](function(_0x14433c){logger[_0x0a9e('0x16')](_0x0a9e('0x19'),_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON['stringify'](_0x14433c));_0x1c696a(_0x14433c);})[_0x0a9e('0x18')](function(_0x468813){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x468813['message'],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x468813[_0x0a9e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 759ac64..bd05fe5 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 _0xed95=['emit','removeListener','register','length','squareProject:','./squareProject.events','save','remove','update'];(function(_0x5f42f1,_0x956be5){var _0x5534ee=function(_0x532333){while(--_0x532333){_0x5f42f1['push'](_0x5f42f1['shift']());}};_0x5534ee(++_0x956be5);}(_0xed95,0xb9));var _0x5ed9=function(_0x1876d3,_0x17659f){_0x1876d3=_0x1876d3-0x0;var _0x368766=_0xed95[_0x1876d3];return _0x368766;};'use strict';var SquareProjectEvents=require(_0x5ed9('0x0'));var events=[_0x5ed9('0x1'),_0x5ed9('0x2'),_0x5ed9('0x3')];function createListener(_0x43e62c,_0x7b6960){return function(_0x453f85){_0x7b6960[_0x5ed9('0x4')](_0x43e62c,_0x453f85);};}function removeListener(_0x2a28e9,_0x7b84d6){return function(){SquareProjectEvents[_0x5ed9('0x5')](_0x2a28e9,_0x7b84d6);};}exports[_0x5ed9('0x6')]=function(_0x52a57d){for(var _0x48efa8=0x0,_0x2612a8=events[_0x5ed9('0x7')];_0x48efa8<_0x2612a8;_0x48efa8++){var _0x2fe2dd=events[_0x48efa8];var _0x34688d=createListener(_0x5ed9('0x8')+_0x2fe2dd,_0x52a57d);SquareProjectEvents['on'](_0x2fe2dd,_0x34688d);}}; \ No newline at end of file +var _0xf3dc=['squareProject:','./squareProject.events','save','remove','emit'];(function(_0x26c06d,_0x1c3890){var _0x3e648a=function(_0x13aeb4){while(--_0x13aeb4){_0x26c06d['push'](_0x26c06d['shift']());}};_0x3e648a(++_0x1c3890);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xf3dc[_0x49052b];return _0x48c045;};'use strict';var SquareProjectEvents=require(_0xcf3d('0x0'));var events=[_0xcf3d('0x1'),_0xcf3d('0x2'),'update'];function createListener(_0x44bb46,_0x1b869b){return function(_0x42319d){_0x1b869b[_0xcf3d('0x3')](_0x44bb46,_0x42319d);};}function removeListener(_0x17b83e,_0x44b3da){return function(){SquareProjectEvents['removeListener'](_0x17b83e,_0x44b3da);};}exports['register']=function(_0x55074b){for(var _0x5b1441=0x0,_0x4e3427=events['length'];_0x5b1441<_0x4e3427;_0x5b1441++){var _0x1a69de=events[_0x5b1441];var _0x10d808=createListener(_0xcf3d('0x4')+_0x1a69de,_0x55074b);SquareProjectEvents['on'](_0x1a69de,_0x10d808);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 8e91a6c..8dbaa17 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 _0x14e4=['../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','download','create','put','update','delete','exports','util','path','connect-timeout','../../components/auth/service'];(function(_0x2163f4,_0x5a4cdf){var _0x1cc1db=function(_0x53f7cf){while(--_0x53f7cf){_0x2163f4['push'](_0x2163f4['shift']());}};_0x1cc1db(++_0x5a4cdf);}(_0x14e4,0x8c));var _0x414e=function(_0x3095e4,_0x16cbb2){_0x3095e4=_0x3095e4-0x0;var _0x2d65d9=_0x14e4[_0x3095e4];return _0x2d65d9;};'use strict';var multer=require('multer');var util=require(_0x414e('0x0'));var path=require(_0x414e('0x1'));var timeout=require(_0x414e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x414e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x414e('0x4'));var controller=require(_0x414e('0x5'));router['get']('/',auth[_0x414e('0x6')](),controller['index']);router[_0x414e('0x7')](_0x414e('0x8'),auth[_0x414e('0x6')](),controller[_0x414e('0x9')]);router['get']('/:id/download',auth[_0x414e('0x6')](),controller[_0x414e('0xa')]);router['post']('/',auth[_0x414e('0x6')](),controller[_0x414e('0xb')]);router[_0x414e('0xc')](_0x414e('0x8'),auth['isAuthenticated'](),controller[_0x414e('0xd')]);router[_0x414e('0xe')](_0x414e('0x8'),auth[_0x414e('0x6')](),controller['destroy']);module[_0x414e('0xf')]=router; \ No newline at end of file +var _0x6cba=['get','isAuthenticated','index','show','/:id/download','download','post','put','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller'];(function(_0x45d2fc,_0x487f93){var _0x4e2cd7=function(_0x58a8b5){while(--_0x58a8b5){_0x45d2fc['push'](_0x45d2fc['shift']());}};_0x4e2cd7(++_0x487f93);}(_0x6cba,0x173));var _0xa6cb=function(_0x25c208,_0x2d8234){_0x25c208=_0x25c208-0x0;var _0x32cae8=_0x6cba[_0x25c208];return _0x32cae8;};'use strict';var multer=require(_0xa6cb('0x0'));var util=require(_0xa6cb('0x1'));var path=require(_0xa6cb('0x2'));var timeout=require('connect-timeout');var express=require(_0xa6cb('0x3'));var router=express[_0xa6cb('0x4')]();var auth=require(_0xa6cb('0x5'));var interaction=require(_0xa6cb('0x6'));var config=require(_0xa6cb('0x7'));var controller=require(_0xa6cb('0x8'));router[_0xa6cb('0x9')]('/',auth[_0xa6cb('0xa')](),controller[_0xa6cb('0xb')]);router[_0xa6cb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa6cb('0xc')]);router[_0xa6cb('0x9')](_0xa6cb('0xd'),auth[_0xa6cb('0xa')](),controller[_0xa6cb('0xe')]);router[_0xa6cb('0xf')]('/',auth[_0xa6cb('0xa')](),controller['create']);router[_0xa6cb('0x10')](_0xa6cb('0x11'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xa6cb('0x11'),auth['isAuthenticated'](),controller[_0xa6cb('0x12')]);module[_0xa6cb('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index c773250..9b673bd 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 _0x1b35=['STRING','sequelize','exports'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x1b35,0x7f));var _0x51b3=function(_0x1da19b,_0x266787){_0x1da19b=_0x1da19b-0x0;var _0x2eedb2=_0x1b35[_0x1da19b];return _0x2eedb2;};'use strict';var Sequelize=require(_0x51b3('0x0'));module[_0x51b3('0x1')]={'uniqueid':{'type':Sequelize[_0x51b3('0x2')]},'callerid':{'type':Sequelize[_0x51b3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x51b3('0x2')]},'priority':{'type':Sequelize[_0x51b3('0x2')]},'accountcode':{'type':Sequelize[_0x51b3('0x2')]},'dnid':{'type':Sequelize[_0x51b3('0x2')]},'projectName':{'type':Sequelize[_0x51b3('0x2')]},'saveName':{'type':Sequelize[_0x51b3('0x2')]},'filename':{'type':Sequelize[_0x51b3('0x2')]},'savePath':{'type':Sequelize[_0x51b3('0x2')]}}; \ No newline at end of file +var _0x0240=['STRING'];(function(_0x1bd2e7,_0x2dc5e9){var _0x41e060=function(_0x29f108){while(--_0x29f108){_0x1bd2e7['push'](_0x1bd2e7['shift']());}};_0x41e060(++_0x2dc5e9);}(_0x0240,0x16a));var _0x0024=function(_0x2dffff,_0x8639df){_0x2dffff=_0x2dffff-0x0;var _0x44e79b=_0x0240[_0x2dffff];return _0x44e79b;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0024('0x0')]},'callerid':{'type':Sequelize[_0x0024('0x0')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x0024('0x0')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x0024('0x0')]},'dnid':{'type':Sequelize[_0x0024('0x0')]},'projectName':{'type':Sequelize[_0x0024('0x0')]},'saveName':{'type':Sequelize[_0x0024('0x0')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x0024('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2a750f4..5301935 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 _0xb7e7=['sort','where','pick','filter','merge','map','type','key','field','options','SquareRecording','includeAll','findAll','show','params','rawAttributes','include','catch','create','body','find','download','uniqueid','filename','savePath','%s.cypher','existsSync','decryptFile','secrets','ValidationError','SquareRecording\x20not\x20found','extname','message','Not\x20found','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','send','index','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xb7e7[_0x2763f2];return _0x3ef471;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x7b7e('0x11'));var logger=require(_0x7b7e('0x12'))(_0x7b7e('0x13'));var utils=require(_0x7b7e('0x14'));var config=require(_0x7b7e('0x15'));var db=require(_0x7b7e('0x16'))['db'];function respondWithStatusCode(_0x36d2a3,_0x55620b){_0x55620b=_0x55620b||0xcc;return function(_0xaadda){if(_0xaadda){return _0x36d2a3['sendStatus'](_0x55620b);}return _0x36d2a3[_0x7b7e('0x17')](_0x55620b)[_0x7b7e('0x18')]();};}function respondWithResult(_0x50d7d2,_0x422d3a){_0x422d3a=_0x422d3a||0xc8;return function(_0x5976ac){if(_0x5976ac){return _0x50d7d2['status'](_0x422d3a)[_0x7b7e('0x19')](_0x5976ac);}};}function respondWithFilteredResult(_0xd304f5,_0xf067da){return function(_0x457ec5){if(_0x457ec5){var _0x3d2fb2=_0x457ec5[_0x7b7e('0x1a')],_0x5703fd=_0xf067da[_0x7b7e('0x1b')],_0x51baf6=_0xf067da[_0x7b7e('0x1b')]+_0xf067da[_0x7b7e('0x1c')],_0xc7f087;if(_0x51baf6>=_0x3d2fb2){_0x51baf6=_0x3d2fb2;_0xc7f087=0xc8;}else{_0xc7f087=0xce;}_0xd304f5[_0x7b7e('0x17')](_0xc7f087);return _0xd304f5[_0x7b7e('0x1d')](_0x7b7e('0x1e'),_0x5703fd+'-'+_0x51baf6+'/'+_0x3d2fb2)[_0x7b7e('0x19')](_0x457ec5);}return null;};}function patchUpdates(_0x429a0e){return function(_0x12e8e9){try{jsonpatch[_0x7b7e('0x1f')](_0x12e8e9,_0x429a0e,!![]);}catch(_0x448980){return BPromise[_0x7b7e('0x20')](_0x448980);}return _0x12e8e9[_0x7b7e('0x21')]();};}function saveUpdates(_0x864287,_0x3a7b8b){return function(_0x49eddb){if(_0x49eddb){return _0x49eddb[_0x7b7e('0x22')](_0x864287)[_0x7b7e('0x23')](function(_0x24718c){return _0x24718c;});}return null;};}function removeEntity(_0x4c0647,_0x313122){return function(_0xbf0cb3){if(_0xbf0cb3){return _0xbf0cb3[_0x7b7e('0x24')]()[_0x7b7e('0x23')](function(){_0x4c0647[_0x7b7e('0x17')](0xcc)[_0x7b7e('0x18')]();});}};}function handleEntityNotFound(_0x28bf43,_0x10a66a){return function(_0x53bbb3){if(!_0x53bbb3){_0x28bf43['sendStatus'](0x194);}return _0x53bbb3;};}function handleError(_0x4a836a,_0x26ee14){_0x26ee14=_0x26ee14||0x1f4;return function(_0x22598e){logger[_0x7b7e('0x25')](_0x22598e['stack']);if(_0x22598e['name']){delete _0x22598e['name'];}_0x4a836a[_0x7b7e('0x17')](_0x26ee14)[_0x7b7e('0x26')](_0x22598e);};}exports[_0x7b7e('0x27')]=function(_0x7aa71,_0x3ceaf5){var _0x48fad1={},_0x6a1e71={},_0x21a15={'count':0x0,'rows':[]};var _0x4c46b8=db['SquareRecording']['rawAttributes'];_0x6a1e71[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](_0x4c46b8);_0x6a1e71['query']=_[_0x7b7e('0x29')](_0x7aa71['query']);_0x6a1e71[_0x7b7e('0x2a')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],_0x6a1e71['query']);_0x48fad1[_0x7b7e('0x2c')]=_[_0x7b7e('0x2b')](_0x6a1e71[_0x7b7e('0x28')],qs[_0x7b7e('0x2d')](_0x7aa71[_0x7b7e('0x2e')]['fields']));_0x48fad1[_0x7b7e('0x2c')]=_0x48fad1['attributes'][_0x7b7e('0x2f')]?_0x48fad1[_0x7b7e('0x2c')]:_0x6a1e71[_0x7b7e('0x28')];if(!_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x30')](_0x7b7e('0x31'))){_0x48fad1[_0x7b7e('0x1c')]=qs['limit'](_0x7aa71['query'][_0x7b7e('0x1c')]);_0x48fad1[_0x7b7e('0x1b')]=qs['offset'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x1b')]);}_0x48fad1[_0x7b7e('0x32')]=qs['sort'](_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x33')]);_0x48fad1[_0x7b7e('0x34')]=qs[_0x7b7e('0x2a')](_[_0x7b7e('0x35')](_0x7aa71[_0x7b7e('0x2e')],_0x6a1e71[_0x7b7e('0x2a')]));if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]){_0x48fad1[_0x7b7e('0x34')]=_[_0x7b7e('0x37')](_0x48fad1[_0x7b7e('0x34')],{'$or':_[_0x7b7e('0x38')](_0x4c46b8,function(_0xdcb8ef){if(_0xdcb8ef[_0x7b7e('0x39')][_0x7b7e('0x3a')]!=='VIRTUAL'){var _0x8c80d5={};_0x8c80d5[_0xdcb8ef[_0x7b7e('0x3b')]]={'$like':'%'+_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x36')]+'%'};return _0x8c80d5;}})});}_0x48fad1=_[_0x7b7e('0x37')]({},_0x48fad1,_0x7aa71[_0x7b7e('0x3c')]);var _0x7f15={'where':_0x48fad1[_0x7b7e('0x34')]};return db[_0x7b7e('0x3d')][_0x7b7e('0x1a')](_0x7f15)['then'](function(_0x3d6571){_0x21a15[_0x7b7e('0x1a')]=_0x3d6571;if(_0x7aa71[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0x48fad1['include']=[{'all':!![]}];}return db[_0x7b7e('0x3d')][_0x7b7e('0x3f')](_0x48fad1);})[_0x7b7e('0x23')](function(_0x5c58c0){_0x21a15['rows']=_0x5c58c0;return _0x21a15;})[_0x7b7e('0x23')](respondWithFilteredResult(_0x3ceaf5,_0x48fad1))['catch'](handleError(_0x3ceaf5,null));};exports[_0x7b7e('0x40')]=function(_0x3b16d7,_0x4de331){var _0xa5daaa={'raw':!![],'where':{'id':_0x3b16d7[_0x7b7e('0x41')]['id']}},_0x2074d1={};_0x2074d1[_0x7b7e('0x28')]=_[_0x7b7e('0x29')](db[_0x7b7e('0x3d')][_0x7b7e('0x42')]);_0x2074d1[_0x7b7e('0x2e')]=_[_0x7b7e('0x29')](_0x3b16d7['query']);_0x2074d1['filters']=_[_0x7b7e('0x2b')](_0x2074d1['model'],_0x2074d1[_0x7b7e('0x2e')]);_0xa5daaa['attributes']=_['intersection'](_0x2074d1[_0x7b7e('0x28')],qs['fields'](_0x3b16d7[_0x7b7e('0x2e')]['fields']));_0xa5daaa[_0x7b7e('0x2c')]=_0xa5daaa[_0x7b7e('0x2c')][_0x7b7e('0x2f')]?_0xa5daaa[_0x7b7e('0x2c')]:_0x2074d1['model'];if(_0x3b16d7[_0x7b7e('0x2e')][_0x7b7e('0x3e')]){_0xa5daaa[_0x7b7e('0x43')]=[{'all':!![]}];}_0xa5daaa=_[_0x7b7e('0x37')]({},_0xa5daaa,_0x3b16d7[_0x7b7e('0x3c')]);return db[_0x7b7e('0x3d')]['find'](_0xa5daaa)['then'](handleEntityNotFound(_0x4de331,null))['then'](respondWithResult(_0x4de331,null))[_0x7b7e('0x44')](handleError(_0x4de331,null));};exports[_0x7b7e('0x45')]=function(_0x2f9de2,_0x2cfe70){return db[_0x7b7e('0x3d')][_0x7b7e('0x45')](_0x2f9de2['body'],{})[_0x7b7e('0x23')](respondWithResult(_0x2cfe70,0xc9))[_0x7b7e('0x44')](handleError(_0x2cfe70,null));};exports['update']=function(_0x5efcb8,_0x1dcb88){if(_0x5efcb8[_0x7b7e('0x46')]['id']){delete _0x5efcb8[_0x7b7e('0x46')]['id'];}return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5efcb8[_0x7b7e('0x41')]['id']}})['then'](handleEntityNotFound(_0x1dcb88,null))[_0x7b7e('0x23')](saveUpdates(_0x5efcb8['body'],null))[_0x7b7e('0x23')](respondWithResult(_0x1dcb88,null))[_0x7b7e('0x44')](handleError(_0x1dcb88,null));};exports[_0x7b7e('0x24')]=function(_0x5874e2,_0x58e4e6){return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':{'id':_0x5874e2[_0x7b7e('0x41')]['id']}})[_0x7b7e('0x23')](handleEntityNotFound(_0x58e4e6,null))[_0x7b7e('0x23')](removeEntity(_0x58e4e6,null))['catch'](handleError(_0x58e4e6,null));};exports[_0x7b7e('0x48')]=function(_0x270c4a,_0x21868a,_0xcb5186){var _0x4767f0=require('../../components/encryptor');var _0x1d6d18=![];var _0x29024e={};if(_0x270c4a[_0x7b7e('0x2e')][_0x7b7e('0x39')]&&_0x270c4a[_0x7b7e('0x2e')][_0x7b7e('0x39')]===_0x7b7e('0x49')){_0x29024e['uniqueid']=_0x270c4a[_0x7b7e('0x41')]['id'];}else{_0x29024e['id']=_0x270c4a['params']['id'];}return db[_0x7b7e('0x3d')][_0x7b7e('0x47')]({'where':_0x29024e,'attributes':['id','savePath',_0x7b7e('0x4a')],'raw':!![]})[_0x7b7e('0x23')](handleEntityNotFound(_0x21868a,null))[_0x7b7e('0x23')](function(_0x3afe88){if(_0x3afe88){var _0x412d1b=_0x3afe88[_0x7b7e('0x4b')];var _0x337d06=util['format'](_0x7b7e('0x4c'),_0x412d1b);if(fs[_0x7b7e('0x4d')](_0x337d06)){_0x1d6d18=!![];return _0x4767f0[_0x7b7e('0x4e')](_0x337d06,_0x412d1b,config[_0x7b7e('0x4f')]['recording'])['then'](function(){return _0x3afe88;});}return _0x3afe88;}})['then'](function(_0x2471ad){if(_0x2471ad){var _0x41530f=_0x2471ad[_0x7b7e('0x4b')];if(!fs['existsSync'](_0x41530f)){throw new db['Sequelize'][(_0x7b7e('0x50'))](_0x7b7e('0x51'));}if(_0x2471ad['filename']){return _0x21868a[_0x7b7e('0x48')](_0x41530f,_0x2471ad[_0x7b7e('0x4a')]+path[_0x7b7e('0x52')](_0x41530f),function(){if(_0x1d6d18){fs['unlink'](_0x41530f);}});}else{return _0x21868a[_0x7b7e('0x48')](_0x41530f,function(_0x1d9af5){if(_0x1d6d18){fs['unlink'](_0x41530f);}});}}})[_0x7b7e('0x44')](function(_0x441c3c){if(_0x441c3c[_0x7b7e('0x53')]===_0x7b7e('0x51')){_0x21868a[_0x7b7e('0x17')](0x194)[_0x7b7e('0x26')](_0x7b7e('0x54'));}else{return handleError(_0x21868a,null);}});}; \ No newline at end of file +var _0x4e81=['eml-format','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','SquareRecording','rawAttributes','model','query','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','map','type','VIRTUAL','field','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','body','update','download','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x4e81,0x1bc));var _0x14e8=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x4e81[_0x56ba92];return _0x8fe94d;};'use strict';var pdf=require(_0x14e8('0x0'));var emlformat=require(_0x14e8('0x1'));var rimraf=require(_0x14e8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e8('0x3'));var BPromise=require(_0x14e8('0x4'));var Mustache=require(_0x14e8('0x5'));var util=require(_0x14e8('0x6'));var path=require(_0x14e8('0x7'));var sox=require(_0x14e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0xe'));var querystring=require(_0x14e8('0xf'));var Papa=require(_0x14e8('0x10'));var Redis=require(_0x14e8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var db=require(_0x14e8('0x18'))['db'];function respondWithStatusCode(_0x30df66,_0x52d13c){_0x52d13c=_0x52d13c||0xcc;return function(_0x37eccb){if(_0x37eccb){return _0x30df66['sendStatus'](_0x52d13c);}return _0x30df66[_0x14e8('0x19')](_0x52d13c)[_0x14e8('0x1a')]();};}function respondWithResult(_0x32a01d,_0x5a95b7){_0x5a95b7=_0x5a95b7||0xc8;return function(_0x22fa86){if(_0x22fa86){return _0x32a01d['status'](_0x5a95b7)[_0x14e8('0x1b')](_0x22fa86);}};}function respondWithFilteredResult(_0x58d26e,_0x347216){return function(_0x3761a1){if(_0x3761a1){var _0xc6101f=_0x3761a1[_0x14e8('0x1c')],_0x135996=_0x347216[_0x14e8('0x1d')],_0x52e64f=_0x347216[_0x14e8('0x1d')]+_0x347216[_0x14e8('0x1e')],_0x10c4a9;if(_0x52e64f>=_0xc6101f){_0x52e64f=_0xc6101f;_0x10c4a9=0xc8;}else{_0x10c4a9=0xce;}_0x58d26e[_0x14e8('0x19')](_0x10c4a9);return _0x58d26e[_0x14e8('0x1f')](_0x14e8('0x20'),_0x135996+'-'+_0x52e64f+'/'+_0xc6101f)['json'](_0x3761a1);}return null;};}function patchUpdates(_0x328c5a){return function(_0x233cd8){try{jsonpatch[_0x14e8('0x21')](_0x233cd8,_0x328c5a,!![]);}catch(_0x7b10f2){return BPromise[_0x14e8('0x22')](_0x7b10f2);}return _0x233cd8['save']();};}function saveUpdates(_0xc967c9,_0x1cefdc){return function(_0x2abfec){if(_0x2abfec){return _0x2abfec['update'](_0xc967c9)[_0x14e8('0x23')](function(_0x47f060){return _0x47f060;});}return null;};}function removeEntity(_0x4cca43,_0xb33beb){return function(_0x3e8d5c){if(_0x3e8d5c){return _0x3e8d5c[_0x14e8('0x24')]()[_0x14e8('0x23')](function(){_0x4cca43['status'](0xcc)[_0x14e8('0x1a')]();});}};}function handleEntityNotFound(_0x5b11f9,_0x31bdd3){return function(_0x185a0e){if(!_0x185a0e){_0x5b11f9['sendStatus'](0x194);}return _0x185a0e;};}function handleError(_0x58a3a1,_0x4e7ec5){_0x4e7ec5=_0x4e7ec5||0x1f4;return function(_0x4a758c){logger[_0x14e8('0x25')](_0x4a758c[_0x14e8('0x26')]);if(_0x4a758c[_0x14e8('0x27')]){delete _0x4a758c[_0x14e8('0x27')];}_0x58a3a1['status'](_0x4e7ec5)[_0x14e8('0x28')](_0x4a758c);};}exports[_0x14e8('0x29')]=function(_0x3c09cb,_0x2f5818){var _0x28035a={},_0xfc0545={},_0x2813ae={'count':0x0,'rows':[]};var _0x4abc29=db[_0x14e8('0x2a')][_0x14e8('0x2b')];_0xfc0545[_0x14e8('0x2c')]=_['keys'](_0x4abc29);_0xfc0545['query']=_['keys'](_0x3c09cb[_0x14e8('0x2d')]);_0xfc0545[_0x14e8('0x2e')]=_['intersection'](_0xfc0545[_0x14e8('0x2c')],_0xfc0545[_0x14e8('0x2d')]);_0x28035a[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0xfc0545['model'],qs[_0x14e8('0x31')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x31')]));_0x28035a[_0x14e8('0x2f')]=_0x28035a[_0x14e8('0x2f')]['length']?_0x28035a[_0x14e8('0x2f')]:_0xfc0545[_0x14e8('0x2c')];if(!_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x32')]('nolimit')){_0x28035a[_0x14e8('0x1e')]=qs['limit'](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x1e')]);_0x28035a[_0x14e8('0x1d')]=qs[_0x14e8('0x1d')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x1d')]);}_0x28035a[_0x14e8('0x33')]=qs[_0x14e8('0x34')](_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x34')]);_0x28035a[_0x14e8('0x35')]=qs[_0x14e8('0x2e')](_['pick'](_0x3c09cb['query'],_0xfc0545['filters']));if(_0x3c09cb[_0x14e8('0x2d')]['filter']){_0x28035a[_0x14e8('0x35')]=_['merge'](_0x28035a[_0x14e8('0x35')],{'$or':_[_0x14e8('0x36')](_0x4abc29,function(_0x41fe2a){if(_0x41fe2a[_0x14e8('0x37')]['key']!==_0x14e8('0x38')){var _0x514415={};_0x514415[_0x41fe2a[_0x14e8('0x39')]]={'$like':'%'+_0x3c09cb[_0x14e8('0x2d')][_0x14e8('0x3a')]+'%'};return _0x514415;}})});}_0x28035a=_[_0x14e8('0x3b')]({},_0x28035a,_0x3c09cb[_0x14e8('0x3c')]);var _0x4ede06={'where':_0x28035a['where']};return db[_0x14e8('0x2a')]['count'](_0x4ede06)[_0x14e8('0x23')](function(_0x20f69d){_0x2813ae[_0x14e8('0x1c')]=_0x20f69d;if(_0x3c09cb['query'][_0x14e8('0x3d')]){_0x28035a[_0x14e8('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0x14e8('0x3f')](_0x28035a);})[_0x14e8('0x23')](function(_0x1f429a){_0x2813ae[_0x14e8('0x40')]=_0x1f429a;return _0x2813ae;})[_0x14e8('0x23')](respondWithFilteredResult(_0x2f5818,_0x28035a))[_0x14e8('0x41')](handleError(_0x2f5818,null));};exports[_0x14e8('0x42')]=function(_0x38ec58,_0x33743a){var _0x18faf5={'raw':!![],'where':{'id':_0x38ec58[_0x14e8('0x43')]['id']}},_0x11f0ee={};_0x11f0ee[_0x14e8('0x2c')]=_[_0x14e8('0x44')](db[_0x14e8('0x2a')]['rawAttributes']);_0x11f0ee[_0x14e8('0x2d')]=_['keys'](_0x38ec58['query']);_0x11f0ee['filters']=_[_0x14e8('0x30')](_0x11f0ee['model'],_0x11f0ee[_0x14e8('0x2d')]);_0x18faf5[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x11f0ee[_0x14e8('0x2c')],qs[_0x14e8('0x31')](_0x38ec58[_0x14e8('0x2d')][_0x14e8('0x31')]));_0x18faf5[_0x14e8('0x2f')]=_0x18faf5[_0x14e8('0x2f')][_0x14e8('0x45')]?_0x18faf5[_0x14e8('0x2f')]:_0x11f0ee['model'];if(_0x38ec58[_0x14e8('0x2d')][_0x14e8('0x3d')]){_0x18faf5[_0x14e8('0x3e')]=[{'all':!![]}];}_0x18faf5=_[_0x14e8('0x3b')]({},_0x18faf5,_0x38ec58['options']);return db[_0x14e8('0x2a')][_0x14e8('0x46')](_0x18faf5)['then'](handleEntityNotFound(_0x33743a,null))['then'](respondWithResult(_0x33743a,null))[_0x14e8('0x41')](handleError(_0x33743a,null));};exports['create']=function(_0x58b609,_0x257cc1){return db[_0x14e8('0x2a')]['create'](_0x58b609[_0x14e8('0x47')],{})[_0x14e8('0x23')](respondWithResult(_0x257cc1,0xc9))['catch'](handleError(_0x257cc1,null));};exports[_0x14e8('0x48')]=function(_0x1994fb,_0x1dee01){if(_0x1994fb[_0x14e8('0x47')]['id']){delete _0x1994fb[_0x14e8('0x47')]['id'];}return db[_0x14e8('0x2a')][_0x14e8('0x46')]({'where':{'id':_0x1994fb[_0x14e8('0x43')]['id']}})[_0x14e8('0x23')](handleEntityNotFound(_0x1dee01,null))[_0x14e8('0x23')](saveUpdates(_0x1994fb[_0x14e8('0x47')],null))[_0x14e8('0x23')](respondWithResult(_0x1dee01,null))[_0x14e8('0x41')](handleError(_0x1dee01,null));};exports[_0x14e8('0x24')]=function(_0x1bf742,_0x1f50bc){return db['SquareRecording'][_0x14e8('0x46')]({'where':{'id':_0x1bf742['params']['id']}})[_0x14e8('0x23')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x23')](removeEntity(_0x1f50bc,null))[_0x14e8('0x41')](handleError(_0x1f50bc,null));};exports[_0x14e8('0x49')]=function(_0x5dcb68,_0x4d91df,_0x59b172){var _0x291fe2=require('../../components/encryptor');var _0x55f9b0=![];var _0xd2b281={};if(_0x5dcb68[_0x14e8('0x2d')]['type']&&_0x5dcb68[_0x14e8('0x2d')][_0x14e8('0x37')]===_0x14e8('0x4a')){_0xd2b281[_0x14e8('0x4a')]=_0x5dcb68['params']['id'];}else{_0xd2b281['id']=_0x5dcb68['params']['id'];}return db[_0x14e8('0x2a')][_0x14e8('0x46')]({'where':_0xd2b281,'attributes':['id',_0x14e8('0x4b'),_0x14e8('0x4c')],'raw':!![]})[_0x14e8('0x23')](handleEntityNotFound(_0x4d91df,null))[_0x14e8('0x23')](function(_0x5686f6){if(_0x5686f6){var _0xff7f40=_0x5686f6[_0x14e8('0x4b')];var _0x2baf94=util[_0x14e8('0x4d')]('%s.cypher',_0xff7f40);if(fs[_0x14e8('0x4e')](_0x2baf94)){_0x55f9b0=!![];return _0x291fe2[_0x14e8('0x4f')](_0x2baf94,_0xff7f40,config[_0x14e8('0x50')][_0x14e8('0x51')])['then'](function(){return _0x5686f6;});}return _0x5686f6;}})[_0x14e8('0x23')](function(_0x45020b){if(_0x45020b){var _0x17e482=_0x45020b[_0x14e8('0x4b')];if(!fs[_0x14e8('0x4e')](_0x17e482)){throw new db[(_0x14e8('0x52'))][(_0x14e8('0x53'))](_0x14e8('0x54'));}if(_0x45020b['filename']){return _0x4d91df['download'](_0x17e482,_0x45020b[_0x14e8('0x4c')]+path[_0x14e8('0x55')](_0x17e482),function(){if(_0x55f9b0){fs[_0x14e8('0x56')](_0x17e482);}});}else{return _0x4d91df[_0x14e8('0x49')](_0x17e482,function(_0x3f0b2a){if(_0x55f9b0){fs['unlink'](_0x17e482);}});}}})['catch'](function(_0x4c49e5){if(_0x4c49e5[_0x14e8('0x57')]===_0x14e8('0x54')){_0x4d91df[_0x14e8('0x19')](0x194)['send'](_0x14e8('0x58'));}else{return handleError(_0x4d91df,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 8838b5b..0bc24dc 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 _0x2b90=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','lodash','util','../../config/logger'];(function(_0x24ad5f,_0x4fcf81){var _0xabb54e=function(_0x3b4e86){while(--_0x3b4e86){_0x24ad5f['push'](_0x24ad5f['shift']());}};_0xabb54e(++_0x4fcf81);}(_0x2b90,0x129));var _0x02b9=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x2b90[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x02b9('0x0'));var util=require(_0x02b9('0x1'));var logger=require(_0x02b9('0x2'))('api');var moment=require(_0x02b9('0x3'));var BPromise=require(_0x02b9('0x4'));var rp=require(_0x02b9('0x5'));var fs=require('fs');var path=require(_0x02b9('0x6'));var rimraf=require(_0x02b9('0x7'));var config=require(_0x02b9('0x8'));var attributes=require(_0x02b9('0x9'));module[_0x02b9('0xa')]=function(_0x5dd19a,_0x2a2cb0){return _0x5dd19a[_0x02b9('0xb')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x943a=['square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','SquareRecording'];(function(_0x30ec42,_0x3639e1){var _0x2d8415=function(_0x4dcb3c){while(--_0x4dcb3c){_0x30ec42['push'](_0x30ec42['shift']());}};_0x2d8415(++_0x3639e1);}(_0x943a,0x1c9));var _0xa943=function(_0x5f5632,_0x3cba31){_0x5f5632=_0x5f5632-0x0;var _0x3c00f0=_0x943a[_0x5f5632];return _0x3c00f0;};'use strict';var _=require(_0xa943('0x0'));var util=require(_0xa943('0x1'));var logger=require(_0xa943('0x2'))(_0xa943('0x3'));var moment=require(_0xa943('0x4'));var BPromise=require(_0xa943('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa943('0x6'));var rimraf=require(_0xa943('0x7'));var config=require(_0xa943('0x8'));var attributes=require('./squareRecording.attributes');module[_0xa943('0x9')]=function(_0xd66edf,_0x3d2ac3){return _0xd66edf['define'](_0xa943('0xa'),attributes,{'tableName':_0xa943('0xb'),'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 2650c07..6ddfdc2 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 _0xfb2b=['error','code','message','info','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1475dc,_0x9fb023){var _0x19c5a9=function(_0x2febc6){while(--_0x2febc6){_0x1475dc['push'](_0x1475dc['shift']());}};_0x19c5a9(++_0x9fb023);}(_0xfb2b,0x1ac));var _0xbfb2=function(_0x2f2e0e,_0xbeb776){_0x2f2e0e=_0x2f2e0e-0x0;var _0x465367=_0xfb2b[_0x2f2e0e];return _0x465367;};'use strict';var _=require(_0xbfb2('0x0'));var util=require('util');var moment=require(_0xbfb2('0x1'));var BPromise=require(_0xbfb2('0x2'));var rs=require(_0xbfb2('0x3'));var fs=require('fs');var Redis=require(_0xbfb2('0x4'));var db=require(_0xbfb2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbfb2('0x6'))('rpc');var config=require(_0xbfb2('0x7'));var jayson=require(_0xbfb2('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4581f6,_0x20990a,_0xb57c11){return new BPromise(function(_0x2933fa,_0x4ac5f1){return client[_0xbfb2('0x9')](_0x4581f6,_0xb57c11)[_0xbfb2('0xa')](function(_0x32744b){logger['info'](_0xbfb2('0xb'),_0x20990a,_0xbfb2('0xc'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x20990a,_0xbfb2('0xc'),JSON[_0xbfb2('0xd')](_0x32744b));if(_0x32744b[_0xbfb2('0xe')]){if(_0x32744b['error'][_0xbfb2('0xf')]===0x1f4){logger['error'](_0xbfb2('0xb'),_0x20990a,_0x32744b[_0xbfb2('0xe')][_0xbfb2('0x10')]);return _0x4ac5f1(_0x32744b[_0xbfb2('0xe')][_0xbfb2('0x10')]);}logger[_0xbfb2('0xe')](_0xbfb2('0xb'),_0x20990a,_0x32744b[_0xbfb2('0xe')][_0xbfb2('0x10')]);return _0x2933fa(_0x32744b[_0xbfb2('0xe')][_0xbfb2('0x10')]);}else{logger[_0xbfb2('0x11')](_0xbfb2('0xb'),_0x20990a,_0xbfb2('0xc'));_0x2933fa(_0x32744b[_0xbfb2('0x12')]['message']);}})[_0xbfb2('0x13')](function(_0x272cbd){logger[_0xbfb2('0xe')]('SquareRecording,\x20%s,\x20%s',_0x20990a,_0x272cbd);_0x4ac5f1(_0x272cbd);});});}exports[_0xbfb2('0x14')]=function(_0x42b996){var _0x5bbe05=this;return new Promise(function(_0x57babb,_0x39ba09){return db[_0xbfb2('0x15')][_0xbfb2('0x16')](_0x42b996[_0xbfb2('0x17')],{'raw':_0x42b996[_0xbfb2('0x18')]?_0x42b996['options'][_0xbfb2('0x19')]===undefined?!![]:![]:!![]})[_0xbfb2('0xa')](function(_0x2ecc3d){logger[_0xbfb2('0x11')](_0xbfb2('0x14'),_0x42b996);logger['debug'](_0xbfb2('0x14'),_0x42b996,JSON[_0xbfb2('0xd')](_0x2ecc3d));_0x57babb(_0x2ecc3d);})[_0xbfb2('0x13')](function(_0x2d7df0){logger[_0xbfb2('0xe')](_0xbfb2('0x14'),_0x2d7df0[_0xbfb2('0x10')],_0x42b996);_0x39ba09(_0x5bbe05[_0xbfb2('0xe')](0x1f4,_0x2d7df0[_0xbfb2('0x10')]));});});}; \ No newline at end of file +var _0xe3f2=['stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x453424,_0x1ea996){var _0x96ddad=function(_0x68f1a3){while(--_0x68f1a3){_0x453424['push'](_0x453424['shift']());}};_0x96ddad(++_0x1ea996);}(_0xe3f2,0x1b0));var _0x2e3f=function(_0xfbd83a,_0x433eea){_0xfbd83a=_0xfbd83a-0x0;var _0x3729ad=_0xe3f2[_0xfbd83a];return _0x3729ad;};'use strict';var _=require(_0x2e3f('0x0'));var util=require(_0x2e3f('0x1'));var moment=require(_0x2e3f('0x2'));var BPromise=require(_0x2e3f('0x3'));var rs=require(_0x2e3f('0x4'));var fs=require('fs');var Redis=require(_0x2e3f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e3f('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2e3f('0x7'));var client=jayson[_0x2e3f('0x8')][_0x2e3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a9ff,_0x15c394,_0x325ec9){return new BPromise(function(_0x2e746b,_0x57c0e2){return client['request'](_0x14a9ff,_0x325ec9)[_0x2e3f('0xa')](function(_0x5ab5df){logger[_0x2e3f('0xb')](_0x2e3f('0xc'),_0x15c394,_0x2e3f('0xd'));logger[_0x2e3f('0xe')](_0x2e3f('0xf'),_0x15c394,_0x2e3f('0xd'),JSON[_0x2e3f('0x10')](_0x5ab5df));if(_0x5ab5df['error']){if(_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x12')]===0x1f4){logger[_0x2e3f('0x11')](_0x2e3f('0xc'),_0x15c394,_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x13')]);return _0x57c0e2(_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x13')]);}logger[_0x2e3f('0x11')](_0x2e3f('0xc'),_0x15c394,_0x5ab5df[_0x2e3f('0x11')][_0x2e3f('0x13')]);return _0x2e746b(_0x5ab5df['error']['message']);}else{logger[_0x2e3f('0xb')](_0x2e3f('0xc'),_0x15c394,_0x2e3f('0xd'));_0x2e746b(_0x5ab5df[_0x2e3f('0x14')][_0x2e3f('0x13')]);}})[_0x2e3f('0x15')](function(_0x20b61a){logger[_0x2e3f('0x11')]('SquareRecording,\x20%s,\x20%s',_0x15c394,_0x20b61a);_0x57c0e2(_0x20b61a);});});}exports[_0x2e3f('0x16')]=function(_0xf0a0a6){var _0x462dc9=this;return new Promise(function(_0x56c6e7,_0x285944){return db[_0x2e3f('0x17')][_0x2e3f('0x18')](_0xf0a0a6[_0x2e3f('0x19')],{'raw':_0xf0a0a6[_0x2e3f('0x1a')]?_0xf0a0a6[_0x2e3f('0x1a')][_0x2e3f('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x42b3f8){logger[_0x2e3f('0xb')](_0x2e3f('0x16'),_0xf0a0a6);logger[_0x2e3f('0xe')](_0x2e3f('0x16'),_0xf0a0a6,JSON[_0x2e3f('0x10')](_0x42b3f8));_0x56c6e7(_0x42b3f8);})['catch'](function(_0x9fbda7){logger['error'](_0x2e3f('0x16'),_0x9fbda7[_0x2e3f('0x13')],_0xf0a0a6);_0x285944(_0x462dc9[_0x2e3f('0x11')](0x1f4,_0x9fbda7[_0x2e3f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 3b9cf26..b4d14bd 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 _0xdc21=['describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x59a1d9,_0x181115){var _0x577f9c=function(_0x364f7d){while(--_0x364f7d){_0x59a1d9['push'](_0x59a1d9['shift']());}};_0x577f9c(++_0x181115);}(_0xdc21,0x1dd));var _0x1dc2=function(_0x21ab04,_0x187167){_0x21ab04=_0x21ab04-0x0;var _0x449d6b=_0xdc21[_0x21ab04];return _0x449d6b;};'use strict';var multer=require(_0x1dc2('0x0'));var util=require(_0x1dc2('0x1'));var path=require('path');var timeout=require(_0x1dc2('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x1dc2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1dc2('0x4'));var controller=require(_0x1dc2('0x5'));router[_0x1dc2('0x6')]('/',auth[_0x1dc2('0x7')](),controller[_0x1dc2('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1dc2('0x9')]);router[_0x1dc2('0x6')](_0x1dc2('0xa'),auth[_0x1dc2('0x7')](),controller[_0x1dc2('0xb')]);router[_0x1dc2('0xc')]('/',auth[_0x1dc2('0x7')](),controller[_0x1dc2('0xd')]);router[_0x1dc2('0xe')]('/:id',auth[_0x1dc2('0x7')](),controller[_0x1dc2('0xf')]);router[_0x1dc2('0x10')](_0x1dc2('0xa'),auth[_0x1dc2('0x7')](),controller['destroy']);module[_0x1dc2('0x11')]=router; \ No newline at end of file +var _0xf76d=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','describe','/:id','isAuthenticated','post','create','destroy','exports','multer'];(function(_0x501ab8,_0x4cfecd){var _0x3527c5=function(_0x5dc4f5){while(--_0x5dc4f5){_0x501ab8['push'](_0x501ab8['shift']());}};_0x3527c5(++_0x4cfecd);}(_0xf76d,0x164));var _0xdf76=function(_0x1b64dd,_0x2cf769){_0x1b64dd=_0x1b64dd-0x0;var _0xeb464c=_0xf76d[_0x1b64dd];return _0xeb464c;};'use strict';var multer=require(_0xdf76('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdf76('0x1'));var express=require(_0xdf76('0x2'));var router=express[_0xdf76('0x3')]();var auth=require(_0xdf76('0x4'));var interaction=require(_0xdf76('0x5'));var config=require(_0xdf76('0x6'));var controller=require(_0xdf76('0x7'));router[_0xdf76('0x8')]('/',auth['isAuthenticated'](),controller[_0xdf76('0x9')]);router[_0xdf76('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xdf76('0xa')]);router[_0xdf76('0x8')](_0xdf76('0xb'),auth[_0xdf76('0xc')](),controller['show']);router[_0xdf76('0xd')]('/',auth[_0xdf76('0xc')](),controller[_0xdf76('0xe')]);router['put'](_0xdf76('0xb'),auth[_0xdf76('0xc')](),controller['update']);router['delete'](_0xdf76('0xb'),auth['isAuthenticated'](),controller[_0xdf76('0xf')]);module[_0xdf76('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 782cd52..e325e63 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 _0x7b6b=['sequelize','STRING','DATE','BOOLEAN'];(function(_0x44c97e,_0x3be0d0){var _0x25ea43=function(_0x5088e2){while(--_0x5088e2){_0x44c97e['push'](_0x44c97e['shift']());}};_0x25ea43(++_0x3be0d0);}(_0x7b6b,0xac));var _0xb7b6=function(_0xc35bd5,_0x3b2f31){_0xc35bd5=_0xc35bd5-0x0;var _0xa6aae9=_0x7b6b[_0xc35bd5];return _0xa6aae9;};'use strict';var Sequelize=require(_0xb7b6('0x0'));module['exports']={'network':{'type':Sequelize[_0xb7b6('0x1')]},'network_script':{'type':Sequelize[_0xb7b6('0x1')]},'request':{'type':Sequelize[_0xb7b6('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xb7b6('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb7b6('0x1')]},'version':{'type':Sequelize[_0xb7b6('0x1')]},'callerid':{'type':Sequelize[_0xb7b6('0x1')]},'calleridname':{'type':Sequelize[_0xb7b6('0x1')]},'callingpres':{'type':Sequelize[_0xb7b6('0x1')]},'callingani2':{'type':Sequelize[_0xb7b6('0x1')]},'callington':{'type':Sequelize[_0xb7b6('0x1')]},'callingtns':{'type':Sequelize[_0xb7b6('0x1')]},'dnid':{'type':Sequelize[_0xb7b6('0x1')]},'rdnis':{'type':Sequelize[_0xb7b6('0x1')]},'context':{'type':Sequelize[_0xb7b6('0x1')]},'extension':{'type':Sequelize[_0xb7b6('0x1')]},'priority':{'type':Sequelize[_0xb7b6('0x1')]},'enhanced':{'type':Sequelize[_0xb7b6('0x1')]},'accountcode':{'type':Sequelize[_0xb7b6('0x1')]},'threadid':{'type':Sequelize[_0xb7b6('0x1')]},'project_name':{'type':Sequelize[_0xb7b6('0x1')]},'joinAt':{'type':Sequelize[_0xb7b6('0x2')]},'leaveAt':{'type':Sequelize[_0xb7b6('0x2')]},'bot':{'type':Sequelize[_0xb7b6('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe13e=['STRING','DATE'];(function(_0x946518,_0x22816f){var _0x909b69=function(_0x2fa5a4){while(--_0x2fa5a4){_0x946518['push'](_0x946518['shift']());}};_0x909b69(++_0x22816f);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize[_0xee13('0x0')]},'network_script':{'type':Sequelize[_0xee13('0x0')]},'request':{'type':Sequelize[_0xee13('0x0')]},'channel':{'type':Sequelize[_0xee13('0x0')]},'language':{'type':Sequelize[_0xee13('0x0')]},'type':{'type':Sequelize[_0xee13('0x0')]},'uniqueid':{'type':Sequelize[_0xee13('0x0')]},'version':{'type':Sequelize[_0xee13('0x0')]},'callerid':{'type':Sequelize[_0xee13('0x0')]},'calleridname':{'type':Sequelize[_0xee13('0x0')]},'callingpres':{'type':Sequelize[_0xee13('0x0')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xee13('0x0')]},'callingtns':{'type':Sequelize[_0xee13('0x0')]},'dnid':{'type':Sequelize[_0xee13('0x0')]},'rdnis':{'type':Sequelize[_0xee13('0x0')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xee13('0x0')]},'priority':{'type':Sequelize[_0xee13('0x0')]},'enhanced':{'type':Sequelize[_0xee13('0x0')]},'accountcode':{'type':Sequelize[_0xee13('0x0')]},'threadid':{'type':Sequelize[_0xee13('0x0')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xee13('0x1')]},'leaveAt':{'type':Sequelize[_0xee13('0x1')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 1a5b4b2..f7ab05e 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 _0x290a=['where','filters','pick','filter','key','field','SquareReport','include','findAll','rows','show','params','includeAll','merge','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x143fa1,_0x3f6ce5){var _0x10a8f7=function(_0xde0fbc){while(--_0xde0fbc){_0x143fa1['push'](_0x143fa1['shift']());}};_0x10a8f7(++_0x3f6ce5);}(_0x290a,0x137));var _0xa290=function(_0x1590f8,_0x3cb633){_0x1590f8=_0x1590f8-0x0;var _0x16bf33=_0x290a[_0x1590f8];return _0x16bf33;};'use strict';var pdf=require(_0xa290('0x0'));var emlformat=require(_0xa290('0x1'));var rimraf=require(_0xa290('0x2'));var zipdir=require(_0xa290('0x3'));var jsonpatch=require(_0xa290('0x4'));var rp=require(_0xa290('0x5'));var moment=require(_0xa290('0x6'));var BPromise=require(_0xa290('0x7'));var Mustache=require('mustache');var util=require(_0xa290('0x8'));var path=require('path');var sox=require(_0xa290('0x9'));var csv=require(_0xa290('0xa'));var ejs=require(_0xa290('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa290('0xc'));var jsforce=require(_0xa290('0xd'));var deskjs=require(_0xa290('0xe'));var toCsv=require(_0xa290('0xa'));var querystring=require(_0xa290('0xf'));var Papa=require(_0xa290('0x10'));var Redis=require(_0xa290('0x11'));var authService=require(_0xa290('0x12'));var qs=require(_0xa290('0x13'));var hardwareService=require(_0xa290('0x14'));var logger=require('../../config/logger')(_0xa290('0x15'));var utils=require(_0xa290('0x16'));var config=require(_0xa290('0x17'));var db=require(_0xa290('0x18'))['db'];function respondWithStatusCode(_0x84079d,_0x57db08){_0x57db08=_0x57db08||0xcc;return function(_0x2fa715){if(_0x2fa715){return _0x84079d[_0xa290('0x19')](_0x57db08);}return _0x84079d[_0xa290('0x1a')](_0x57db08)[_0xa290('0x1b')]();};}function respondWithResult(_0x32c46c,_0x2e02f9){_0x2e02f9=_0x2e02f9||0xc8;return function(_0x1d3c06){if(_0x1d3c06){return _0x32c46c[_0xa290('0x1a')](_0x2e02f9)[_0xa290('0x1c')](_0x1d3c06);}};}function respondWithFilteredResult(_0x3608a7,_0x2ce33d){return function(_0x44e44f){if(_0x44e44f){var _0x564524=_0x44e44f[_0xa290('0x1d')],_0x6ee05d=_0x2ce33d[_0xa290('0x1e')],_0x242c7c=_0x2ce33d[_0xa290('0x1e')]+_0x2ce33d[_0xa290('0x1f')],_0x5000e8;if(_0x242c7c>=_0x564524){_0x242c7c=_0x564524;_0x5000e8=0xc8;}else{_0x5000e8=0xce;}_0x3608a7[_0xa290('0x1a')](_0x5000e8);return _0x3608a7['set']('Content-Range',_0x6ee05d+'-'+_0x242c7c+'/'+_0x564524)[_0xa290('0x1c')](_0x44e44f);}return null;};}function patchUpdates(_0x59e8da){return function(_0x50f82b){try{jsonpatch[_0xa290('0x20')](_0x50f82b,_0x59e8da,!![]);}catch(_0x36519d){return BPromise['reject'](_0x36519d);}return _0x50f82b[_0xa290('0x21')]();};}function saveUpdates(_0x243b11,_0x84c683){return function(_0x4980a1){if(_0x4980a1){return _0x4980a1[_0xa290('0x22')](_0x243b11)[_0xa290('0x23')](function(_0x535e98){return _0x535e98;});}return null;};}function removeEntity(_0x3d314c,_0x5cba3e){return function(_0xec7adf){if(_0xec7adf){return _0xec7adf[_0xa290('0x24')]()['then'](function(){_0x3d314c['status'](0xcc)[_0xa290('0x1b')]();});}};}function handleEntityNotFound(_0xc33baf,_0x39f2a2){return function(_0x4df888){if(!_0x4df888){_0xc33baf[_0xa290('0x19')](0x194);}return _0x4df888;};}function handleError(_0xcc8c10,_0x18bd03){_0x18bd03=_0x18bd03||0x1f4;return function(_0x2d267e){logger[_0xa290('0x25')](_0x2d267e[_0xa290('0x26')]);if(_0x2d267e[_0xa290('0x27')]){delete _0x2d267e[_0xa290('0x27')];}_0xcc8c10[_0xa290('0x1a')](_0x18bd03)[_0xa290('0x28')](_0x2d267e);};}exports[_0xa290('0x29')]=function(_0x2ca10f,_0xc27eef){var _0x50f0c1={},_0x179fd9={},_0x5f2a34={'count':0x0,'rows':[]};var _0x4f8ee2=db['SquareReport'][_0xa290('0x2a')];_0x179fd9[_0xa290('0x2b')]=_[_0xa290('0x2c')](_0x4f8ee2);_0x179fd9[_0xa290('0x2d')]=_[_0xa290('0x2c')](_0x2ca10f[_0xa290('0x2d')]);_0x179fd9['filters']=_[_0xa290('0x2e')](_0x179fd9[_0xa290('0x2b')],_0x179fd9['query']);_0x50f0c1[_0xa290('0x2f')]=_[_0xa290('0x2e')](_0x179fd9[_0xa290('0x2b')],qs[_0xa290('0x30')](_0x2ca10f[_0xa290('0x2d')][_0xa290('0x30')]));_0x50f0c1['attributes']=_0x50f0c1[_0xa290('0x2f')][_0xa290('0x31')]?_0x50f0c1[_0xa290('0x2f')]:_0x179fd9['model'];if(!_0x2ca10f[_0xa290('0x2d')][_0xa290('0x32')](_0xa290('0x33'))){_0x50f0c1['limit']=qs[_0xa290('0x1f')](_0x2ca10f[_0xa290('0x2d')][_0xa290('0x1f')]);_0x50f0c1[_0xa290('0x1e')]=qs[_0xa290('0x1e')](_0x2ca10f[_0xa290('0x2d')]['offset']);}_0x50f0c1[_0xa290('0x34')]=qs[_0xa290('0x35')](_0x2ca10f[_0xa290('0x2d')][_0xa290('0x35')]);_0x50f0c1[_0xa290('0x36')]=qs[_0xa290('0x37')](_[_0xa290('0x38')](_0x2ca10f[_0xa290('0x2d')],_0x179fd9['filters']));if(_0x2ca10f[_0xa290('0x2d')][_0xa290('0x39')]){_0x50f0c1[_0xa290('0x36')]=_['merge'](_0x50f0c1['where'],{'$or':_['map'](_0x4f8ee2,function(_0x38b72b){if(_0x38b72b['type'][_0xa290('0x3a')]!=='VIRTUAL'){var _0x3e6efe={};_0x3e6efe[_0x38b72b[_0xa290('0x3b')]]={'$like':'%'+_0x2ca10f[_0xa290('0x2d')][_0xa290('0x39')]+'%'};return _0x3e6efe;}})});}_0x50f0c1=_['merge']({},_0x50f0c1,_0x2ca10f['options']);var _0x13bde1={'where':_0x50f0c1[_0xa290('0x36')]};return db[_0xa290('0x3c')][_0xa290('0x1d')](_0x13bde1)['then'](function(_0xcfa174){_0x5f2a34[_0xa290('0x1d')]=_0xcfa174;if(_0x2ca10f[_0xa290('0x2d')]['includeAll']){_0x50f0c1[_0xa290('0x3d')]=[{'all':!![]}];}return db[_0xa290('0x3c')][_0xa290('0x3e')](_0x50f0c1);})[_0xa290('0x23')](function(_0x28f2a7){_0x5f2a34[_0xa290('0x3f')]=_0x28f2a7;return _0x5f2a34;})[_0xa290('0x23')](respondWithFilteredResult(_0xc27eef,_0x50f0c1))['catch'](handleError(_0xc27eef,null));};exports[_0xa290('0x40')]=function(_0x5724b9,_0x251a31){var _0x3bd488={'raw':!![],'where':{'id':_0x5724b9[_0xa290('0x41')]['id']}},_0x3642f3={};_0x3642f3[_0xa290('0x2b')]=_[_0xa290('0x2c')](db[_0xa290('0x3c')]['rawAttributes']);_0x3642f3[_0xa290('0x2d')]=_[_0xa290('0x2c')](_0x5724b9['query']);_0x3642f3[_0xa290('0x37')]=_['intersection'](_0x3642f3[_0xa290('0x2b')],_0x3642f3[_0xa290('0x2d')]);_0x3bd488[_0xa290('0x2f')]=_[_0xa290('0x2e')](_0x3642f3['model'],qs[_0xa290('0x30')](_0x5724b9['query'][_0xa290('0x30')]));_0x3bd488[_0xa290('0x2f')]=_0x3bd488['attributes']['length']?_0x3bd488[_0xa290('0x2f')]:_0x3642f3[_0xa290('0x2b')];if(_0x5724b9[_0xa290('0x2d')][_0xa290('0x42')]){_0x3bd488[_0xa290('0x3d')]=[{'all':!![]}];}_0x3bd488=_[_0xa290('0x43')]({},_0x3bd488,_0x5724b9['options']);return db['SquareReport'][_0xa290('0x44')](_0x3bd488)[_0xa290('0x23')](handleEntityNotFound(_0x251a31,null))['then'](respondWithResult(_0x251a31,null))[_0xa290('0x45')](handleError(_0x251a31,null));};exports[_0xa290('0x46')]=function(_0x16e2c0,_0x7fddda){return db[_0xa290('0x3c')][_0xa290('0x46')](_0x16e2c0[_0xa290('0x47')],{})['then'](respondWithResult(_0x7fddda,0xc9))[_0xa290('0x45')](handleError(_0x7fddda,null));};exports['update']=function(_0x2d8134,_0x393912){if(_0x2d8134[_0xa290('0x47')]['id']){delete _0x2d8134['body']['id'];}return db[_0xa290('0x3c')]['find']({'where':{'id':_0x2d8134[_0xa290('0x41')]['id']}})['then'](handleEntityNotFound(_0x393912,null))[_0xa290('0x23')](saveUpdates(_0x2d8134[_0xa290('0x47')],null))[_0xa290('0x23')](respondWithResult(_0x393912,null))[_0xa290('0x45')](handleError(_0x393912,null));};exports[_0xa290('0x24')]=function(_0x473bb5,_0x4f4168){return db[_0xa290('0x3c')][_0xa290('0x44')]({'where':{'id':_0x473bb5[_0xa290('0x41')]['id']}})[_0xa290('0x23')](handleEntityNotFound(_0x4f4168,null))[_0xa290('0x23')](removeEntity(_0x4f4168,null))[_0xa290('0x45')](handleError(_0x4f4168,null));};exports[_0xa290('0x48')]=function(_0x1aa142,_0x3bb8a3){return db[_0xa290('0x3c')]['describe']()[_0xa290('0x23')](respondWithResult(_0x3bb8a3,null))[_0xa290('0x45')](handleError(_0x3bb8a3,null));}; \ No newline at end of file +var _0x48a0=['intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','include','rows','params','length','includeAll','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','SquareReport','rawAttributes','model','keys','filters'];(function(_0x2ffd40,_0x66e6e){var _0x2d13b2=function(_0x4db30b){while(--_0x4db30b){_0x2ffd40['push'](_0x2ffd40['shift']());}};_0x2d13b2(++_0x66e6e);}(_0x48a0,0xac));var _0x048a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x48a0[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0x048a('0x0'));var emlformat=require(_0x048a('0x1'));var rimraf=require(_0x048a('0x2'));var zipdir=require(_0x048a('0x3'));var jsonpatch=require(_0x048a('0x4'));var rp=require(_0x048a('0x5'));var moment=require(_0x048a('0x6'));var BPromise=require(_0x048a('0x7'));var Mustache=require('mustache');var util=require(_0x048a('0x8'));var path=require(_0x048a('0x9'));var sox=require(_0x048a('0xa'));var csv=require(_0x048a('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x048a('0xc'));var crypto=require(_0x048a('0xd'));var jsforce=require(_0x048a('0xe'));var deskjs=require(_0x048a('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x048a('0x10'));var Redis=require('ioredis');var authService=require(_0x048a('0x11'));var qs=require(_0x048a('0x12'));var hardwareService=require(_0x048a('0x13'));var logger=require('../../config/logger')(_0x048a('0x14'));var utils=require('../../config/utils');var config=require(_0x048a('0x15'));var db=require(_0x048a('0x16'))['db'];function respondWithStatusCode(_0x454368,_0xa42781){_0xa42781=_0xa42781||0xcc;return function(_0xc7780c){if(_0xc7780c){return _0x454368[_0x048a('0x17')](_0xa42781);}return _0x454368[_0x048a('0x18')](_0xa42781)[_0x048a('0x19')]();};}function respondWithResult(_0x26ec91,_0x1f4700){_0x1f4700=_0x1f4700||0xc8;return function(_0x42fcdd){if(_0x42fcdd){return _0x26ec91[_0x048a('0x18')](_0x1f4700)[_0x048a('0x1a')](_0x42fcdd);}};}function respondWithFilteredResult(_0x3ddcba,_0x34bea3){return function(_0x257bea){if(_0x257bea){var _0x2ab916=_0x257bea[_0x048a('0x1b')],_0x26a145=_0x34bea3[_0x048a('0x1c')],_0x46814b=_0x34bea3['offset']+_0x34bea3[_0x048a('0x1d')],_0x46e489;if(_0x46814b>=_0x2ab916){_0x46814b=_0x2ab916;_0x46e489=0xc8;}else{_0x46e489=0xce;}_0x3ddcba['status'](_0x46e489);return _0x3ddcba[_0x048a('0x1e')](_0x048a('0x1f'),_0x26a145+'-'+_0x46814b+'/'+_0x2ab916)[_0x048a('0x1a')](_0x257bea);}return null;};}function patchUpdates(_0x47345d){return function(_0x49b64a){try{jsonpatch[_0x048a('0x20')](_0x49b64a,_0x47345d,!![]);}catch(_0x235c8d){return BPromise[_0x048a('0x21')](_0x235c8d);}return _0x49b64a[_0x048a('0x22')]();};}function saveUpdates(_0x36c348,_0x2a1b8f){return function(_0x388bc2){if(_0x388bc2){return _0x388bc2[_0x048a('0x23')](_0x36c348)[_0x048a('0x24')](function(_0x4c22a9){return _0x4c22a9;});}return null;};}function removeEntity(_0x17f20b,_0x57ff1e){return function(_0x2905f8){if(_0x2905f8){return _0x2905f8[_0x048a('0x25')]()[_0x048a('0x24')](function(){_0x17f20b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2193ac,_0x37fea5){return function(_0x5cce36){if(!_0x5cce36){_0x2193ac['sendStatus'](0x194);}return _0x5cce36;};}function handleError(_0x53304a,_0x3bf2c0){_0x3bf2c0=_0x3bf2c0||0x1f4;return function(_0xc1258b){logger[_0x048a('0x26')](_0xc1258b[_0x048a('0x27')]);if(_0xc1258b[_0x048a('0x28')]){delete _0xc1258b[_0x048a('0x28')];}_0x53304a['status'](_0x3bf2c0)[_0x048a('0x29')](_0xc1258b);};}exports['index']=function(_0x5b69ea,_0x4bd3a0){var _0x4860e9={},_0x53c32f={},_0x14ed93={'count':0x0,'rows':[]};var _0x11413d=db[_0x048a('0x2a')][_0x048a('0x2b')];_0x53c32f[_0x048a('0x2c')]=_[_0x048a('0x2d')](_0x11413d);_0x53c32f['query']=_[_0x048a('0x2d')](_0x5b69ea['query']);_0x53c32f[_0x048a('0x2e')]=_[_0x048a('0x2f')](_0x53c32f[_0x048a('0x2c')],_0x53c32f[_0x048a('0x30')]);_0x4860e9[_0x048a('0x31')]=_[_0x048a('0x2f')](_0x53c32f[_0x048a('0x2c')],qs['fields'](_0x5b69ea[_0x048a('0x30')][_0x048a('0x32')]));_0x4860e9[_0x048a('0x31')]=_0x4860e9[_0x048a('0x31')]['length']?_0x4860e9['attributes']:_0x53c32f[_0x048a('0x2c')];if(!_0x5b69ea[_0x048a('0x30')][_0x048a('0x33')](_0x048a('0x34'))){_0x4860e9[_0x048a('0x1d')]=qs[_0x048a('0x1d')](_0x5b69ea[_0x048a('0x30')][_0x048a('0x1d')]);_0x4860e9[_0x048a('0x1c')]=qs[_0x048a('0x1c')](_0x5b69ea[_0x048a('0x30')][_0x048a('0x1c')]);}_0x4860e9[_0x048a('0x35')]=qs[_0x048a('0x36')](_0x5b69ea[_0x048a('0x30')][_0x048a('0x36')]);_0x4860e9[_0x048a('0x37')]=qs['filters'](_[_0x048a('0x38')](_0x5b69ea[_0x048a('0x30')],_0x53c32f[_0x048a('0x2e')]));if(_0x5b69ea[_0x048a('0x30')][_0x048a('0x39')]){_0x4860e9[_0x048a('0x37')]=_[_0x048a('0x3a')](_0x4860e9[_0x048a('0x37')],{'$or':_[_0x048a('0x3b')](_0x11413d,function(_0x2797e6){if(_0x2797e6['type']['key']!==_0x048a('0x3c')){var _0x38f6a1={};_0x38f6a1[_0x2797e6[_0x048a('0x3d')]]={'$like':'%'+_0x5b69ea[_0x048a('0x30')][_0x048a('0x39')]+'%'};return _0x38f6a1;}})});}_0x4860e9=_[_0x048a('0x3a')]({},_0x4860e9,_0x5b69ea[_0x048a('0x3e')]);var _0xab490a={'where':_0x4860e9[_0x048a('0x37')]};return db[_0x048a('0x2a')]['count'](_0xab490a)[_0x048a('0x24')](function(_0x1928ec){_0x14ed93[_0x048a('0x1b')]=_0x1928ec;if(_0x5b69ea[_0x048a('0x30')]['includeAll']){_0x4860e9[_0x048a('0x3f')]=[{'all':!![]}];}return db[_0x048a('0x2a')]['findAll'](_0x4860e9);})['then'](function(_0x2f1869){_0x14ed93[_0x048a('0x40')]=_0x2f1869;return _0x14ed93;})['then'](respondWithFilteredResult(_0x4bd3a0,_0x4860e9))['catch'](handleError(_0x4bd3a0,null));};exports['show']=function(_0x213099,_0x2920f1){var _0x49c147={'raw':!![],'where':{'id':_0x213099[_0x048a('0x41')]['id']}},_0x3a4488={};_0x3a4488[_0x048a('0x2c')]=_[_0x048a('0x2d')](db[_0x048a('0x2a')][_0x048a('0x2b')]);_0x3a4488[_0x048a('0x30')]=_[_0x048a('0x2d')](_0x213099['query']);_0x3a4488[_0x048a('0x2e')]=_[_0x048a('0x2f')](_0x3a4488[_0x048a('0x2c')],_0x3a4488['query']);_0x49c147[_0x048a('0x31')]=_[_0x048a('0x2f')](_0x3a4488[_0x048a('0x2c')],qs[_0x048a('0x32')](_0x213099[_0x048a('0x30')][_0x048a('0x32')]));_0x49c147[_0x048a('0x31')]=_0x49c147['attributes'][_0x048a('0x42')]?_0x49c147[_0x048a('0x31')]:_0x3a4488[_0x048a('0x2c')];if(_0x213099['query'][_0x048a('0x43')]){_0x49c147[_0x048a('0x3f')]=[{'all':!![]}];}_0x49c147=_[_0x048a('0x3a')]({},_0x49c147,_0x213099[_0x048a('0x3e')]);return db['SquareReport'][_0x048a('0x44')](_0x49c147)[_0x048a('0x24')](handleEntityNotFound(_0x2920f1,null))[_0x048a('0x24')](respondWithResult(_0x2920f1,null))[_0x048a('0x45')](handleError(_0x2920f1,null));};exports[_0x048a('0x46')]=function(_0x4129ab,_0x36ec66){return db[_0x048a('0x2a')][_0x048a('0x46')](_0x4129ab[_0x048a('0x47')],{})[_0x048a('0x24')](respondWithResult(_0x36ec66,0xc9))['catch'](handleError(_0x36ec66,null));};exports[_0x048a('0x23')]=function(_0x3ad95f,_0x457230){if(_0x3ad95f['body']['id']){delete _0x3ad95f[_0x048a('0x47')]['id'];}return db[_0x048a('0x2a')][_0x048a('0x44')]({'where':{'id':_0x3ad95f['params']['id']}})[_0x048a('0x24')](handleEntityNotFound(_0x457230,null))['then'](saveUpdates(_0x3ad95f[_0x048a('0x47')],null))[_0x048a('0x24')](respondWithResult(_0x457230,null))[_0x048a('0x45')](handleError(_0x457230,null));};exports[_0x048a('0x25')]=function(_0x2fd272,_0x2efa96){return db[_0x048a('0x2a')][_0x048a('0x44')]({'where':{'id':_0x2fd272[_0x048a('0x41')]['id']}})[_0x048a('0x24')](handleEntityNotFound(_0x2efa96,null))[_0x048a('0x24')](removeEntity(_0x2efa96,null))['catch'](handleError(_0x2efa96,null));};exports[_0x048a('0x48')]=function(_0x23a50a,_0x3c578d){return db['SquareReport']['describe']()['then'](respondWithResult(_0x3c578d,null))[_0x048a('0x45')](handleError(_0x3c578d,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 27264ec..b8bbdf8 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 _0xa9e0=['exports','define','SquareReport','uniqueid','leaveAt','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReport.attributes'];(function(_0x1223ff,_0xfa47b7){var _0x432e80=function(_0x1b7360){while(--_0x1b7360){_0x1223ff['push'](_0x1223ff['shift']());}};_0x432e80(++_0xfa47b7);}(_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 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_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x0a9e('0xb'),'project_name']},{'name':'leaveAt','fields':[_0x0a9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger'];(function(_0x3f406e,_0x84a1f8){var _0x3da112=function(_0x4f5644){while(--_0x4f5644){_0x3f406e['push'](_0x3f406e['shift']());}};_0x3da112(++_0x84a1f8);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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':'report_square','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'project_name']},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index bb9731c..d72baa9 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 _0x368a=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','create','raw','debug','UpdateSquareReport','update','body','options','attributes','limit','lodash','bluebird','randomstring','ioredis'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x368a,0x1a9));var _0xa368=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x368a[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xa368('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa368('0x1'));var rs=require(_0xa368('0x2'));var fs=require('fs');var Redis=require(_0xa368('0x3'));var db=require(_0xa368('0x4'))['db'];var utils=require(_0xa368('0x5'));var logger=require(_0xa368('0x6'))(_0xa368('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa368('0x8')][_0xa368('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6b711,_0x23c510,_0x5b397f){return new BPromise(function(_0x47ddd4,_0x4477c3){return client[_0xa368('0xa')](_0x6b711,_0x5b397f)[_0xa368('0xb')](function(_0x292cd3){logger[_0xa368('0xc')](_0xa368('0xd'),_0x23c510,_0xa368('0xe'));logger['debug'](_0xa368('0xf'),_0x23c510,_0xa368('0xe'),JSON[_0xa368('0x10')](_0x292cd3));if(_0x292cd3[_0xa368('0x11')]){if(_0x292cd3[_0xa368('0x11')][_0xa368('0x12')]===0x1f4){logger['error'](_0xa368('0xd'),_0x23c510,_0x292cd3['error'][_0xa368('0x13')]);return _0x4477c3(_0x292cd3[_0xa368('0x11')][_0xa368('0x13')]);}logger[_0xa368('0x11')](_0xa368('0xd'),_0x23c510,_0x292cd3['error']['message']);return _0x47ddd4(_0x292cd3[_0xa368('0x11')][_0xa368('0x13')]);}else{logger[_0xa368('0xc')](_0xa368('0xd'),_0x23c510,_0xa368('0xe'));_0x47ddd4(_0x292cd3[_0xa368('0x14')][_0xa368('0x13')]);}})[_0xa368('0x15')](function(_0x3c7533){logger[_0xa368('0x11')]('SquareReport,\x20%s,\x20%s',_0x23c510,_0x3c7533);_0x4477c3(_0x3c7533);});});}exports[_0xa368('0x16')]=function(_0x4bb68e){var _0x5ea1e4=this;return new Promise(function(_0x42e207,_0x45e9df){return db[_0xa368('0x17')][_0xa368('0x18')](_0x4bb68e['body'],{'raw':_0x4bb68e['options']?_0x4bb68e['options'][_0xa368('0x19')]===undefined?!![]:![]:!![]})[_0xa368('0xb')](function(_0x3da136){logger[_0xa368('0xc')](_0xa368('0x16'),_0x4bb68e);logger[_0xa368('0x1a')](_0xa368('0x16'),_0x4bb68e,JSON[_0xa368('0x10')](_0x3da136));_0x42e207(_0x3da136);})[_0xa368('0x15')](function(_0x1127f5){logger[_0xa368('0x11')]('CreateSquareReport',_0x1127f5[_0xa368('0x13')],_0x4bb68e);_0x45e9df(_0x5ea1e4[_0xa368('0x11')](0x1f4,_0x1127f5[_0xa368('0x13')]));});});};exports[_0xa368('0x1b')]=function(_0x1d0f3d){var _0x42a04f=this;return new Promise(function(_0x25e426,_0x5680c3){return db['SquareReport'][_0xa368('0x1c')](_0x1d0f3d[_0xa368('0x1d')],{'raw':_0x1d0f3d['options']?_0x1d0f3d[_0xa368('0x1e')][_0xa368('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0f3d[_0xa368('0x1e')]?_0x1d0f3d[_0xa368('0x1e')]['where']||null:null,'attributes':_0x1d0f3d[_0xa368('0x1e')]?_0x1d0f3d[_0xa368('0x1e')][_0xa368('0x1f')]||null:null,'limit':_0x1d0f3d['options']?_0x1d0f3d[_0xa368('0x1e')][_0xa368('0x20')]||null:null})['then'](function(_0x15bd07){logger[_0xa368('0xc')](_0xa368('0x1b'),_0x1d0f3d);logger['debug'](_0xa368('0x1b'),_0x1d0f3d,JSON[_0xa368('0x10')](_0x15bd07));_0x25e426(_0x15bd07);})['catch'](function(_0x538e05){logger['error'](_0xa368('0x1b'),_0x538e05[_0xa368('0x13')],_0x1d0f3d);_0x5680c3(_0x42a04f[_0xa368('0x11')](0x1f4,_0x538e05['message']));});});}; \ No newline at end of file +var _0x5a2a=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateSquareReport','create','body','options','raw','then','UpdateSquareReport','SquareReport','where','attributes','limit'];(function(_0x1336fc,_0x5c10d6){var _0x25a6ef=function(_0x5f1041){while(--_0x5f1041){_0x1336fc['push'](_0x1336fc['shift']());}};_0x25a6ef(++_0x5c10d6);}(_0x5a2a,0xaa));var _0xa5a2=function(_0x4c5935,_0x54f9d9){_0x4c5935=_0x4c5935-0x0;var _0x2d5230=_0x5a2a[_0x4c5935];return _0x2d5230;};'use strict';var _=require(_0xa5a2('0x0'));var util=require(_0xa5a2('0x1'));var moment=require(_0xa5a2('0x2'));var BPromise=require(_0xa5a2('0x3'));var rs=require(_0xa5a2('0x4'));var fs=require('fs');var Redis=require(_0xa5a2('0x5'));var db=require(_0xa5a2('0x6'))['db'];var utils=require(_0xa5a2('0x7'));var logger=require(_0xa5a2('0x8'))('rpc');var config=require(_0xa5a2('0x9'));var jayson=require(_0xa5a2('0xa'));var client=jayson[_0xa5a2('0xb')][_0xa5a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3dee23,_0x4199a0,_0x4b0f47){return new BPromise(function(_0x11c253,_0x46fc5a){return client['request'](_0x3dee23,_0x4b0f47)['then'](function(_0x2397c0){logger[_0xa5a2('0xd')](_0xa5a2('0xe'),_0x4199a0,'request\x20sent');logger[_0xa5a2('0xf')](_0xa5a2('0x10'),_0x4199a0,_0xa5a2('0x11'),JSON[_0xa5a2('0x12')](_0x2397c0));if(_0x2397c0['error']){if(_0x2397c0[_0xa5a2('0x13')]['code']===0x1f4){logger['error'](_0xa5a2('0xe'),_0x4199a0,_0x2397c0[_0xa5a2('0x13')][_0xa5a2('0x14')]);return _0x46fc5a(_0x2397c0[_0xa5a2('0x13')]['message']);}logger[_0xa5a2('0x13')](_0xa5a2('0xe'),_0x4199a0,_0x2397c0[_0xa5a2('0x13')][_0xa5a2('0x14')]);return _0x11c253(_0x2397c0[_0xa5a2('0x13')][_0xa5a2('0x14')]);}else{logger[_0xa5a2('0xd')](_0xa5a2('0xe'),_0x4199a0,'request\x20sent');_0x11c253(_0x2397c0[_0xa5a2('0x15')][_0xa5a2('0x14')]);}})[_0xa5a2('0x16')](function(_0x5c0e57){logger[_0xa5a2('0x13')]('SquareReport,\x20%s,\x20%s',_0x4199a0,_0x5c0e57);_0x46fc5a(_0x5c0e57);});});}exports[_0xa5a2('0x17')]=function(_0x403c6c){var _0x5bab49=this;return new Promise(function(_0x23d795,_0x537d8d){return db['SquareReport'][_0xa5a2('0x18')](_0x403c6c[_0xa5a2('0x19')],{'raw':_0x403c6c[_0xa5a2('0x1a')]?_0x403c6c[_0xa5a2('0x1a')][_0xa5a2('0x1b')]===undefined?!![]:![]:!![]})[_0xa5a2('0x1c')](function(_0x5520d3){logger[_0xa5a2('0xd')](_0xa5a2('0x17'),_0x403c6c);logger[_0xa5a2('0xf')](_0xa5a2('0x17'),_0x403c6c,JSON[_0xa5a2('0x12')](_0x5520d3));_0x23d795(_0x5520d3);})['catch'](function(_0x5ebfbf){logger[_0xa5a2('0x13')](_0xa5a2('0x17'),_0x5ebfbf[_0xa5a2('0x14')],_0x403c6c);_0x537d8d(_0x5bab49[_0xa5a2('0x13')](0x1f4,_0x5ebfbf[_0xa5a2('0x14')]));});});};exports[_0xa5a2('0x1d')]=function(_0x35e690){var _0x1b0fcc=this;return new Promise(function(_0x32ff48,_0x57c6c1){return db[_0xa5a2('0x1e')]['update'](_0x35e690['body'],{'raw':_0x35e690[_0xa5a2('0x1a')]?_0x35e690[_0xa5a2('0x1a')][_0xa5a2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35e690['options']?_0x35e690[_0xa5a2('0x1a')][_0xa5a2('0x1f')]||null:null,'attributes':_0x35e690[_0xa5a2('0x1a')]?_0x35e690[_0xa5a2('0x1a')][_0xa5a2('0x20')]||null:null,'limit':_0x35e690[_0xa5a2('0x1a')]?_0x35e690['options'][_0xa5a2('0x21')]||null:null})[_0xa5a2('0x1c')](function(_0x1a3688){logger['info'](_0xa5a2('0x1d'),_0x35e690);logger[_0xa5a2('0xf')](_0xa5a2('0x1d'),_0x35e690,JSON['stringify'](_0x1a3688));_0x32ff48(_0x1a3688);})[_0xa5a2('0x16')](function(_0x21f03c){logger['error'](_0xa5a2('0x1d'),_0x21f03c[_0xa5a2('0x14')],_0x35e690);_0x57c6c1(_0x1b0fcc['error'](0x1f4,_0x21f03c[_0xa5a2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4b16d29..0908c67 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 _0xb98b=['get','/describe','describe','show','post','create','put','/:id','delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x374b19,_0xbdccbf){var _0x5ed87f=function(_0x4e93b5){while(--_0x4e93b5){_0x374b19['push'](_0x374b19['shift']());}};_0x5ed87f(++_0xbdccbf);}(_0xb98b,0x8f));var _0xbb98=function(_0x57507d,_0x33b2d9){_0x57507d=_0x57507d-0x0;var _0x164d12=_0xb98b[_0x57507d];return _0x164d12;};'use strict';var multer=require(_0xbb98('0x0'));var util=require(_0xbb98('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbb98('0x2'));var router=express[_0xbb98('0x3')]();var auth=require(_0xbb98('0x4'));var interaction=require(_0xbb98('0x5'));var config=require(_0xbb98('0x6'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0xbb98('0x7')](),controller[_0xbb98('0x8')]);router[_0xbb98('0x9')](_0xbb98('0xa'),auth[_0xbb98('0x7')](),controller[_0xbb98('0xb')]);router[_0xbb98('0x9')]('/:id',auth[_0xbb98('0x7')](),controller[_0xbb98('0xc')]);router[_0xbb98('0xd')]('/',auth[_0xbb98('0x7')](),controller[_0xbb98('0xe')]);router[_0xbb98('0xf')](_0xbb98('0x10'),auth[_0xbb98('0x7')](),controller['update']);router[_0xbb98('0x11')](_0xbb98('0x10'),auth[_0xbb98('0x7')](),controller['destroy']);module[_0xbb98('0x12')]=router; \ No newline at end of file +var _0x31d5=['util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','describe','/:id','post','create','update','delete','destroy','exports','multer'];(function(_0x5f62d2,_0x134074){var _0x5ba5d0=function(_0x2498e9){while(--_0x2498e9){_0x5f62d2['push'](_0x5f62d2['shift']());}};_0x5ba5d0(++_0x134074);}(_0x31d5,0x76));var _0x531d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x31d5[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x531d('0x0'));var util=require(_0x531d('0x1'));var path=require(_0x531d('0x2'));var timeout=require(_0x531d('0x3'));var express=require(_0x531d('0x4'));var router=express[_0x531d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x531d('0x6'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x531d('0x7')]('/describe',auth[_0x531d('0x8')](),controller[_0x531d('0x9')]);router[_0x531d('0x7')](_0x531d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x531d('0xb')]('/',auth[_0x531d('0x8')](),controller[_0x531d('0xc')]);router['put'](_0x531d('0xa'),auth['isAuthenticated'](),controller[_0x531d('0xd')]);router[_0x531d('0xe')](_0x531d('0xa'),auth['isAuthenticated'](),controller[_0x531d('0xf')]);module[_0x531d('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index f009d02..ee4c64c 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 _0xb92b=['sequelize','exports','STRING','TEXT'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xb92b,0x12c));var _0xbb92=function(_0x4036b9,_0x5297d6){_0x4036b9=_0x4036b9-0x0;var _0x32257d=_0xb92b[_0x4036b9];return _0x32257d;};'use strict';var Sequelize=require(_0xbb92('0x0'));module[_0xbb92('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xbb92('0x2')]},'application':{'type':Sequelize[_0xbb92('0x2')]},'data':{'type':Sequelize[_0xbb92('0x3')]},'project_name':{'type':Sequelize[_0xbb92('0x2')]},'callerid':{'type':Sequelize[_0xbb92('0x2')]}}; \ No newline at end of file +var _0xf948=['STRING','TEXT','sequelize','exports'];(function(_0x3551b7,_0x15bf71){var _0x462856=function(_0x332453){while(--_0x332453){_0x3551b7['push'](_0x3551b7['shift']());}};_0x462856(++_0x15bf71);}(_0xf948,0x1ea));var _0x8f94=function(_0x33bca4,_0x220097){_0x33bca4=_0x33bca4-0x0;var _0xdf637d=_0xf948[_0x33bca4];return _0xdf637d;};'use strict';var Sequelize=require(_0x8f94('0x0'));module[_0x8f94('0x1')]={'uniqueid':{'type':Sequelize[_0x8f94('0x2')]},'node':{'type':Sequelize[_0x8f94('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x8f94('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x8f94('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 4ae65dd..6f9ee9f 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 _0x5d42=['name','send','index','SquareDetailsReport','rawAttributes','model','keys','query','intersection','attributes','length','nolimit','limit','sort','pick','filter','where','map','type','key','VIRTUAL','field','options','count','includeAll','findAll','rows','catch','show','params','filters','fields','include','merge','find','create','body','update','destroy','describe','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','offset','set','Content-Range','apply','save','then','status','sendStatus','error','stack'];(function(_0x380307,_0x440ccd){var _0x9ea14b=function(_0x51024c){while(--_0x51024c){_0x380307['push'](_0x380307['shift']());}};_0x9ea14b(++_0x440ccd);}(_0x5d42,0x186));var _0x25d4=function(_0x561e4c,_0xdda854){_0x561e4c=_0x561e4c-0x0;var _0x5eafc3=_0x5d42[_0x561e4c];return _0x5eafc3;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x25d4('0x0'));var zipdir=require(_0x25d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25d4('0x2'));var moment=require('moment');var BPromise=require(_0x25d4('0x3'));var Mustache=require(_0x25d4('0x4'));var util=require(_0x25d4('0x5'));var path=require(_0x25d4('0x6'));var sox=require('sox');var csv=require(_0x25d4('0x7'));var ejs=require(_0x25d4('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x25d4('0x9'));var crypto=require(_0x25d4('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x25d4('0x7'));var querystring=require(_0x25d4('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x25d4('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x25d4('0xd'));var logger=require(_0x25d4('0xe'))('api');var utils=require(_0x25d4('0xf'));var config=require(_0x25d4('0x10'));var db=require(_0x25d4('0x11'))['db'];function respondWithStatusCode(_0x2f72df,_0x56f8ec){_0x56f8ec=_0x56f8ec||0xcc;return function(_0x127039){if(_0x127039){return _0x2f72df['sendStatus'](_0x56f8ec);}return _0x2f72df['status'](_0x56f8ec)[_0x25d4('0x12')]();};}function respondWithResult(_0x59fac9,_0x35d147){_0x35d147=_0x35d147||0xc8;return function(_0x3892ef){if(_0x3892ef){return _0x59fac9['status'](_0x35d147)[_0x25d4('0x13')](_0x3892ef);}};}function respondWithFilteredResult(_0x2e6ee3,_0x318bc6){return function(_0x15cb29){if(_0x15cb29){var _0x133ff4=_0x15cb29['count'],_0x535347=_0x318bc6[_0x25d4('0x14')],_0x5eab64=_0x318bc6[_0x25d4('0x14')]+_0x318bc6['limit'],_0x597de6;if(_0x5eab64>=_0x133ff4){_0x5eab64=_0x133ff4;_0x597de6=0xc8;}else{_0x597de6=0xce;}_0x2e6ee3['status'](_0x597de6);return _0x2e6ee3[_0x25d4('0x15')](_0x25d4('0x16'),_0x535347+'-'+_0x5eab64+'/'+_0x133ff4)[_0x25d4('0x13')](_0x15cb29);}return null;};}function patchUpdates(_0x37c03f){return function(_0xe0a3ae){try{jsonpatch[_0x25d4('0x17')](_0xe0a3ae,_0x37c03f,!![]);}catch(_0x17ed1b){return BPromise['reject'](_0x17ed1b);}return _0xe0a3ae[_0x25d4('0x18')]();};}function saveUpdates(_0x268121,_0x55605a){return function(_0x129572){if(_0x129572){return _0x129572['update'](_0x268121)['then'](function(_0x41e72c){return _0x41e72c;});}return null;};}function removeEntity(_0x162796,_0x11b2ef){return function(_0x136984){if(_0x136984){return _0x136984['destroy']()[_0x25d4('0x19')](function(){_0x162796[_0x25d4('0x1a')](0xcc)[_0x25d4('0x12')]();});}};}function handleEntityNotFound(_0x52e6c4,_0x46e652){return function(_0x2909fb){if(!_0x2909fb){_0x52e6c4[_0x25d4('0x1b')](0x194);}return _0x2909fb;};}function handleError(_0x51e5fd,_0x59a915){_0x59a915=_0x59a915||0x1f4;return function(_0x25a9f3){logger[_0x25d4('0x1c')](_0x25a9f3[_0x25d4('0x1d')]);if(_0x25a9f3[_0x25d4('0x1e')]){delete _0x25a9f3[_0x25d4('0x1e')];}_0x51e5fd['status'](_0x59a915)[_0x25d4('0x1f')](_0x25a9f3);};}exports[_0x25d4('0x20')]=function(_0x539993,_0x717347){var _0x3ade58={},_0x1ae95f={},_0xb8d6d5={'count':0x0,'rows':[]};var _0x20d903=db[_0x25d4('0x21')][_0x25d4('0x22')];_0x1ae95f[_0x25d4('0x23')]=_[_0x25d4('0x24')](_0x20d903);_0x1ae95f[_0x25d4('0x25')]=_[_0x25d4('0x24')](_0x539993[_0x25d4('0x25')]);_0x1ae95f['filters']=_[_0x25d4('0x26')](_0x1ae95f[_0x25d4('0x23')],_0x1ae95f[_0x25d4('0x25')]);_0x3ade58[_0x25d4('0x27')]=_[_0x25d4('0x26')](_0x1ae95f[_0x25d4('0x23')],qs['fields'](_0x539993[_0x25d4('0x25')]['fields']));_0x3ade58['attributes']=_0x3ade58[_0x25d4('0x27')][_0x25d4('0x28')]?_0x3ade58[_0x25d4('0x27')]:_0x1ae95f['model'];if(!_0x539993[_0x25d4('0x25')]['hasOwnProperty'](_0x25d4('0x29'))){_0x3ade58['limit']=qs[_0x25d4('0x2a')](_0x539993[_0x25d4('0x25')][_0x25d4('0x2a')]);_0x3ade58['offset']=qs['offset'](_0x539993[_0x25d4('0x25')]['offset']);}_0x3ade58['order']=qs[_0x25d4('0x2b')](_0x539993[_0x25d4('0x25')][_0x25d4('0x2b')]);_0x3ade58['where']=qs['filters'](_[_0x25d4('0x2c')](_0x539993['query'],_0x1ae95f['filters']));if(_0x539993[_0x25d4('0x25')][_0x25d4('0x2d')]){_0x3ade58[_0x25d4('0x2e')]=_['merge'](_0x3ade58[_0x25d4('0x2e')],{'$or':_[_0x25d4('0x2f')](_0x20d903,function(_0x41f95a){if(_0x41f95a[_0x25d4('0x30')][_0x25d4('0x31')]!==_0x25d4('0x32')){var _0x221778={};_0x221778[_0x41f95a[_0x25d4('0x33')]]={'$like':'%'+_0x539993[_0x25d4('0x25')][_0x25d4('0x2d')]+'%'};return _0x221778;}})});}_0x3ade58=_['merge']({},_0x3ade58,_0x539993[_0x25d4('0x34')]);var _0x4f2627={'where':_0x3ade58[_0x25d4('0x2e')]};return db[_0x25d4('0x21')][_0x25d4('0x35')](_0x4f2627)['then'](function(_0x11a537){_0xb8d6d5[_0x25d4('0x35')]=_0x11a537;if(_0x539993[_0x25d4('0x25')][_0x25d4('0x36')]){_0x3ade58['include']=[{'all':!![]}];}return db[_0x25d4('0x21')][_0x25d4('0x37')](_0x3ade58);})[_0x25d4('0x19')](function(_0x32e7ec){_0xb8d6d5[_0x25d4('0x38')]=_0x32e7ec;return _0xb8d6d5;})[_0x25d4('0x19')](respondWithFilteredResult(_0x717347,_0x3ade58))[_0x25d4('0x39')](handleError(_0x717347,null));};exports[_0x25d4('0x3a')]=function(_0x10af75,_0x721f6){var _0x4a9d02={'raw':!![],'where':{'id':_0x10af75[_0x25d4('0x3b')]['id']}},_0x1e4a4a={};_0x1e4a4a[_0x25d4('0x23')]=_['keys'](db['SquareDetailsReport'][_0x25d4('0x22')]);_0x1e4a4a[_0x25d4('0x25')]=_[_0x25d4('0x24')](_0x10af75[_0x25d4('0x25')]);_0x1e4a4a[_0x25d4('0x3c')]=_['intersection'](_0x1e4a4a['model'],_0x1e4a4a[_0x25d4('0x25')]);_0x4a9d02[_0x25d4('0x27')]=_[_0x25d4('0x26')](_0x1e4a4a['model'],qs['fields'](_0x10af75['query'][_0x25d4('0x3d')]));_0x4a9d02[_0x25d4('0x27')]=_0x4a9d02[_0x25d4('0x27')][_0x25d4('0x28')]?_0x4a9d02[_0x25d4('0x27')]:_0x1e4a4a[_0x25d4('0x23')];if(_0x10af75[_0x25d4('0x25')][_0x25d4('0x36')]){_0x4a9d02[_0x25d4('0x3e')]=[{'all':!![]}];}_0x4a9d02=_[_0x25d4('0x3f')]({},_0x4a9d02,_0x10af75[_0x25d4('0x34')]);return db['SquareDetailsReport'][_0x25d4('0x40')](_0x4a9d02)['then'](handleEntityNotFound(_0x721f6,null))[_0x25d4('0x19')](respondWithResult(_0x721f6,null))[_0x25d4('0x39')](handleError(_0x721f6,null));};exports[_0x25d4('0x41')]=function(_0x228d1f,_0x337bf3){return db[_0x25d4('0x21')][_0x25d4('0x41')](_0x228d1f[_0x25d4('0x42')],{})[_0x25d4('0x19')](respondWithResult(_0x337bf3,0xc9))['catch'](handleError(_0x337bf3,null));};exports[_0x25d4('0x43')]=function(_0x52ca6d,_0x1789f7){if(_0x52ca6d['body']['id']){delete _0x52ca6d[_0x25d4('0x42')]['id'];}return db[_0x25d4('0x21')][_0x25d4('0x40')]({'where':{'id':_0x52ca6d['params']['id']}})[_0x25d4('0x19')](handleEntityNotFound(_0x1789f7,null))[_0x25d4('0x19')](saveUpdates(_0x52ca6d[_0x25d4('0x42')],null))['then'](respondWithResult(_0x1789f7,null))[_0x25d4('0x39')](handleError(_0x1789f7,null));};exports[_0x25d4('0x44')]=function(_0x10849d,_0x3c3a70){return db['SquareDetailsReport'][_0x25d4('0x40')]({'where':{'id':_0x10849d[_0x25d4('0x3b')]['id']}})[_0x25d4('0x19')](handleEntityNotFound(_0x3c3a70,null))[_0x25d4('0x19')](removeEntity(_0x3c3a70,null))[_0x25d4('0x39')](handleError(_0x3c3a70,null));};exports[_0x25d4('0x45')]=function(_0x54da09,_0x143829){return db[_0x25d4('0x21')][_0x25d4('0x45')]()[_0x25d4('0x19')](respondWithResult(_0x143829,null))[_0x25d4('0x39')](handleError(_0x143829,null));}; \ No newline at end of file +var _0x252d=['destroy','then','stack','name','index','SquareDetailsReport','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','map','type','VIRTUAL','field','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','merge','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x252d,0x6c));var _0xd252=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0x252d[_0x5401ae];return _0x286068;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd252('0x0'));var rimraf=require(_0xd252('0x1'));var zipdir=require(_0xd252('0x2'));var jsonpatch=require(_0xd252('0x3'));var rp=require(_0xd252('0x4'));var moment=require('moment');var BPromise=require(_0xd252('0x5'));var Mustache=require('mustache');var util=require(_0xd252('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd252('0x7'));var ejs=require(_0xd252('0x8'));var fs=require('fs');var _=require(_0xd252('0x9'));var squel=require(_0xd252('0xa'));var crypto=require(_0xd252('0xb'));var jsforce=require(_0xd252('0xc'));var deskjs=require(_0xd252('0xd'));var toCsv=require(_0xd252('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd252('0xe'));var authService=require(_0xd252('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd252('0x10'))(_0xd252('0x11'));var utils=require('../../config/utils');var config=require(_0xd252('0x12'));var db=require(_0xd252('0x13'))['db'];function respondWithStatusCode(_0xe4a64c,_0x108387){_0x108387=_0x108387||0xcc;return function(_0x48e896){if(_0x48e896){return _0xe4a64c[_0xd252('0x14')](_0x108387);}return _0xe4a64c['status'](_0x108387)[_0xd252('0x15')]();};}function respondWithResult(_0x1f2cb9,_0x4ff005){_0x4ff005=_0x4ff005||0xc8;return function(_0x211f0e){if(_0x211f0e){return _0x1f2cb9[_0xd252('0x16')](_0x4ff005)[_0xd252('0x17')](_0x211f0e);}};}function respondWithFilteredResult(_0x407e19,_0x2cd5c7){return function(_0x28965e){if(_0x28965e){var _0x905adc=_0x28965e['count'],_0x2b07bd=_0x2cd5c7['offset'],_0xd2bc30=_0x2cd5c7[_0xd252('0x18')]+_0x2cd5c7[_0xd252('0x19')],_0x52a415;if(_0xd2bc30>=_0x905adc){_0xd2bc30=_0x905adc;_0x52a415=0xc8;}else{_0x52a415=0xce;}_0x407e19['status'](_0x52a415);return _0x407e19[_0xd252('0x1a')](_0xd252('0x1b'),_0x2b07bd+'-'+_0xd2bc30+'/'+_0x905adc)[_0xd252('0x17')](_0x28965e);}return null;};}function patchUpdates(_0x2c459e){return function(_0x1b77ee){try{jsonpatch[_0xd252('0x1c')](_0x1b77ee,_0x2c459e,!![]);}catch(_0x295be7){return BPromise[_0xd252('0x1d')](_0x295be7);}return _0x1b77ee[_0xd252('0x1e')]();};}function saveUpdates(_0x19da9d,_0x4a876f){return function(_0x535404){if(_0x535404){return _0x535404[_0xd252('0x1f')](_0x19da9d)['then'](function(_0x4ffb77){return _0x4ffb77;});}return null;};}function removeEntity(_0x2239f2,_0x2ffe72){return function(_0x4103f6){if(_0x4103f6){return _0x4103f6[_0xd252('0x20')]()[_0xd252('0x21')](function(){_0x2239f2[_0xd252('0x16')](0xcc)[_0xd252('0x15')]();});}};}function handleEntityNotFound(_0x13105c,_0x5e5e66){return function(_0x59d30b){if(!_0x59d30b){_0x13105c['sendStatus'](0x194);}return _0x59d30b;};}function handleError(_0x26b4b4,_0x192654){_0x192654=_0x192654||0x1f4;return function(_0x3a89bb){logger['error'](_0x3a89bb[_0xd252('0x22')]);if(_0x3a89bb[_0xd252('0x23')]){delete _0x3a89bb['name'];}_0x26b4b4['status'](_0x192654)['send'](_0x3a89bb);};}exports[_0xd252('0x24')]=function(_0x56c98a,_0xb168bc){var _0x44bae3={},_0x4ec665={},_0x257c7d={'count':0x0,'rows':[]};var _0xf60c5=db[_0xd252('0x25')]['rawAttributes'];_0x4ec665[_0xd252('0x26')]=_['keys'](_0xf60c5);_0x4ec665[_0xd252('0x27')]=_[_0xd252('0x28')](_0x56c98a[_0xd252('0x27')]);_0x4ec665[_0xd252('0x29')]=_[_0xd252('0x2a')](_0x4ec665['model'],_0x4ec665[_0xd252('0x27')]);_0x44bae3['attributes']=_['intersection'](_0x4ec665[_0xd252('0x26')],qs[_0xd252('0x2b')](_0x56c98a['query'][_0xd252('0x2b')]));_0x44bae3[_0xd252('0x2c')]=_0x44bae3[_0xd252('0x2c')][_0xd252('0x2d')]?_0x44bae3[_0xd252('0x2c')]:_0x4ec665[_0xd252('0x26')];if(!_0x56c98a[_0xd252('0x27')][_0xd252('0x2e')](_0xd252('0x2f'))){_0x44bae3['limit']=qs['limit'](_0x56c98a[_0xd252('0x27')][_0xd252('0x19')]);_0x44bae3['offset']=qs[_0xd252('0x18')](_0x56c98a[_0xd252('0x27')]['offset']);}_0x44bae3['order']=qs[_0xd252('0x30')](_0x56c98a['query'][_0xd252('0x30')]);_0x44bae3['where']=qs[_0xd252('0x29')](_[_0xd252('0x31')](_0x56c98a[_0xd252('0x27')],_0x4ec665['filters']));if(_0x56c98a[_0xd252('0x27')][_0xd252('0x32')]){_0x44bae3['where']=_['merge'](_0x44bae3[_0xd252('0x33')],{'$or':_[_0xd252('0x34')](_0xf60c5,function(_0x37bac4){if(_0x37bac4[_0xd252('0x35')]['key']!==_0xd252('0x36')){var _0x439384={};_0x439384[_0x37bac4[_0xd252('0x37')]]={'$like':'%'+_0x56c98a[_0xd252('0x27')][_0xd252('0x32')]+'%'};return _0x439384;}})});}_0x44bae3=_['merge']({},_0x44bae3,_0x56c98a[_0xd252('0x38')]);var _0x218efb={'where':_0x44bae3[_0xd252('0x33')]};return db[_0xd252('0x25')]['count'](_0x218efb)['then'](function(_0x3f674e){_0x257c7d[_0xd252('0x39')]=_0x3f674e;if(_0x56c98a[_0xd252('0x27')][_0xd252('0x3a')]){_0x44bae3[_0xd252('0x3b')]=[{'all':!![]}];}return db[_0xd252('0x25')][_0xd252('0x3c')](_0x44bae3);})['then'](function(_0x36fc84){_0x257c7d[_0xd252('0x3d')]=_0x36fc84;return _0x257c7d;})[_0xd252('0x21')](respondWithFilteredResult(_0xb168bc,_0x44bae3))[_0xd252('0x3e')](handleError(_0xb168bc,null));};exports['show']=function(_0x222779,_0x1b3e67){var _0xd83ddc={'raw':!![],'where':{'id':_0x222779[_0xd252('0x3f')]['id']}},_0x33bb3d={};_0x33bb3d[_0xd252('0x26')]=_[_0xd252('0x28')](db['SquareDetailsReport'][_0xd252('0x40')]);_0x33bb3d[_0xd252('0x27')]=_['keys'](_0x222779['query']);_0x33bb3d[_0xd252('0x29')]=_[_0xd252('0x2a')](_0x33bb3d[_0xd252('0x26')],_0x33bb3d['query']);_0xd83ddc[_0xd252('0x2c')]=_[_0xd252('0x2a')](_0x33bb3d[_0xd252('0x26')],qs[_0xd252('0x2b')](_0x222779[_0xd252('0x27')][_0xd252('0x2b')]));_0xd83ddc['attributes']=_0xd83ddc[_0xd252('0x2c')]['length']?_0xd83ddc[_0xd252('0x2c')]:_0x33bb3d['model'];if(_0x222779[_0xd252('0x27')][_0xd252('0x3a')]){_0xd83ddc[_0xd252('0x3b')]=[{'all':!![]}];}_0xd83ddc=_[_0xd252('0x41')]({},_0xd83ddc,_0x222779[_0xd252('0x38')]);return db[_0xd252('0x25')]['find'](_0xd83ddc)[_0xd252('0x21')](handleEntityNotFound(_0x1b3e67,null))[_0xd252('0x21')](respondWithResult(_0x1b3e67,null))[_0xd252('0x3e')](handleError(_0x1b3e67,null));};exports[_0xd252('0x42')]=function(_0x5220cc,_0x1d998a){return db[_0xd252('0x25')][_0xd252('0x42')](_0x5220cc[_0xd252('0x43')],{})['then'](respondWithResult(_0x1d998a,0xc9))['catch'](handleError(_0x1d998a,null));};exports[_0xd252('0x1f')]=function(_0x30c00e,_0x4bcee2){if(_0x30c00e[_0xd252('0x43')]['id']){delete _0x30c00e[_0xd252('0x43')]['id'];}return db['SquareDetailsReport'][_0xd252('0x44')]({'where':{'id':_0x30c00e[_0xd252('0x3f')]['id']}})[_0xd252('0x21')](handleEntityNotFound(_0x4bcee2,null))[_0xd252('0x21')](saveUpdates(_0x30c00e[_0xd252('0x43')],null))[_0xd252('0x21')](respondWithResult(_0x4bcee2,null))[_0xd252('0x3e')](handleError(_0x4bcee2,null));};exports[_0xd252('0x20')]=function(_0x1ec6f3,_0x2f96d){return db[_0xd252('0x25')]['find']({'where':{'id':_0x1ec6f3[_0xd252('0x3f')]['id']}})[_0xd252('0x21')](handleEntityNotFound(_0x2f96d,null))[_0xd252('0x21')](removeEntity(_0x2f96d,null))[_0xd252('0x3e')](handleError(_0x2f96d,null));};exports[_0xd252('0x45')]=function(_0x552088,_0x37a218){return db['SquareDetailsReport'][_0xd252('0x45')]()[_0xd252('0x21')](respondWithResult(_0x37a218,null))[_0xd252('0x3e')](handleError(_0x37a218,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index f239318..f373a1c 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 _0x24ce=['report_square_details','util','../../config/logger','api','moment','path','./squareReportDetail.attributes','exports','define'];(function(_0x37b12e,_0x30a063){var _0xfcd0a6=function(_0x172271){while(--_0x172271){_0x37b12e['push'](_0x37b12e['shift']());}};_0xfcd0a6(++_0x30a063);}(_0x24ce,0x1de));var _0xe24c=function(_0x945794,_0x1c2193){_0x945794=_0x945794-0x0;var _0x22a99a=_0x24ce[_0x945794];return _0x22a99a;};'use strict';var _=require('lodash');var util=require(_0xe24c('0x0'));var logger=require(_0xe24c('0x1'))(_0xe24c('0x2'));var moment=require(_0xe24c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe24c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe24c('0x5'));module[_0xe24c('0x6')]=function(_0x6f92e0,_0x1ac59c){return _0x6f92e0[_0xe24c('0x7')]('SquareDetailsReport',attributes,{'tableName':_0xe24c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67d1=['define','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x67d1,0xf1));var _0x167d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x67d1[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x167d('0x0'));var logger=require(_0x167d('0x1'))('api');var moment=require(_0x167d('0x2'));var BPromise=require(_0x167d('0x3'));var rp=require(_0x167d('0x4'));var fs=require('fs');var path=require(_0x167d('0x5'));var rimraf=require('rimraf');var config=require(_0x167d('0x6'));var attributes=require(_0x167d('0x7'));module[_0x167d('0x8')]=function(_0xb7d8b7,_0x4960de){return _0xb7d8b7[_0x167d('0x9')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 4f56066..b852e35 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 _0x72a2=['then','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','http','request','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','info','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw'];(function(_0x403573,_0x298bd9){var _0x52d156=function(_0x5a3df9){while(--_0x5a3df9){_0x403573['push'](_0x403573['shift']());}};_0x52d156(++_0x298bd9);}(_0x72a2,0x161));var _0x272a=function(_0x55da94,_0x1c3bb4){_0x55da94=_0x55da94-0x0;var _0xc91098=_0x72a2[_0x55da94];return _0xc91098;};'use strict';var _=require('lodash');var util=require(_0x272a('0x0'));var moment=require(_0x272a('0x1'));var BPromise=require(_0x272a('0x2'));var rs=require(_0x272a('0x3'));var fs=require('fs');var Redis=require(_0x272a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x272a('0x5'));var logger=require('../../config/logger')(_0x272a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x272a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43d188,_0x220b90,_0x283070){return new BPromise(function(_0x54dbfb,_0x484f88){return client[_0x272a('0x8')](_0x43d188,_0x283070)['then'](function(_0x830fb6){logger['info'](_0x272a('0x9'),_0x220b90,_0x272a('0xa'));logger[_0x272a('0xb')](_0x272a('0xc'),_0x220b90,'request\x20sent',JSON['stringify'](_0x830fb6));if(_0x830fb6[_0x272a('0xd')]){if(_0x830fb6[_0x272a('0xd')]['code']===0x1f4){logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x484f88(_0x830fb6[_0x272a('0xd')]['message']);}logger[_0x272a('0xd')](_0x272a('0x9'),_0x220b90,_0x830fb6[_0x272a('0xd')][_0x272a('0xe')]);return _0x54dbfb(_0x830fb6['error'][_0x272a('0xe')]);}else{logger[_0x272a('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x220b90,'request\x20sent');_0x54dbfb(_0x830fb6['result']['message']);}})['catch'](function(_0x567955){logger[_0x272a('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x220b90,_0x567955);_0x484f88(_0x567955);});});}exports[_0x272a('0x10')]=function(_0x327f68){var _0x2bc720=this;return new Promise(function(_0x3325b2,_0x5db9c4){return db[_0x272a('0x11')][_0x272a('0x12')](_0x327f68[_0x272a('0x13')],{'raw':_0x327f68[_0x272a('0x14')]?_0x327f68[_0x272a('0x14')][_0x272a('0x15')]===undefined?!![]:![]:!![]})[_0x272a('0x16')](function(_0x5cc0d6){logger[_0x272a('0xf')](_0x272a('0x10'),_0x327f68);logger[_0x272a('0xb')](_0x272a('0x10'),_0x327f68,JSON[_0x272a('0x17')](_0x5cc0d6));_0x3325b2(_0x5cc0d6);})[_0x272a('0x18')](function(_0x4ac0bb){logger[_0x272a('0xd')]('CreateSquareDetailsReport',_0x4ac0bb[_0x272a('0xe')],_0x327f68);_0x5db9c4(_0x2bc720['error'](0x1f4,_0x4ac0bb[_0x272a('0xe')]));});});}; \ No newline at end of file +var _0xd9c8=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','debug','lodash','util','bluebird'];(function(_0x26b1a0,_0x3b6d37){var _0x452f84=function(_0x5baec2){while(--_0x5baec2){_0x26b1a0['push'](_0x26b1a0['shift']());}};_0x452f84(++_0x3b6d37);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd9c8[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var moment=require('moment');var BPromise=require(_0x8d9c('0x2'));var rs=require(_0x8d9c('0x3'));var fs=require('fs');var Redis=require(_0x8d9c('0x4'));var db=require(_0x8d9c('0x5'))['db'];var utils=require(_0x8d9c('0x6'));var logger=require(_0x8d9c('0x7'))(_0x8d9c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8d9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ebb5a,_0x475edd,_0x49c96f){return new BPromise(function(_0x3790f6,_0x3de357){return client[_0x8d9c('0xa')](_0x1ebb5a,_0x49c96f)[_0x8d9c('0xb')](function(_0x2db4b3){logger[_0x8d9c('0xc')](_0x8d9c('0xd'),_0x475edd,_0x8d9c('0xe'));logger['debug'](_0x8d9c('0xf'),_0x475edd,'request\x20sent',JSON[_0x8d9c('0x10')](_0x2db4b3));if(_0x2db4b3['error']){if(_0x2db4b3[_0x8d9c('0x11')]['code']===0x1f4){logger['error'](_0x8d9c('0xd'),_0x475edd,_0x2db4b3['error'][_0x8d9c('0x12')]);return _0x3de357(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);return _0x3790f6(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}else{logger[_0x8d9c('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x475edd,_0x8d9c('0xe'));_0x3790f6(_0x2db4b3[_0x8d9c('0x13')][_0x8d9c('0x12')]);}})[_0x8d9c('0x14')](function(_0x1a071d){logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x1a071d);_0x3de357(_0x1a071d);});});}exports[_0x8d9c('0x15')]=function(_0x1ed27d){var _0x44896d=this;return new Promise(function(_0x48fffd,_0x105952){return db[_0x8d9c('0x16')]['create'](_0x1ed27d[_0x8d9c('0x17')],{'raw':_0x1ed27d[_0x8d9c('0x18')]?_0x1ed27d['options'][_0x8d9c('0x19')]===undefined?!![]:![]:!![]})[_0x8d9c('0xb')](function(_0xa8391d){logger[_0x8d9c('0xc')]('CreateSquareDetailsReport',_0x1ed27d);logger[_0x8d9c('0x1a')](_0x8d9c('0x15'),_0x1ed27d,JSON['stringify'](_0xa8391d));_0x48fffd(_0xa8391d);})['catch'](function(_0x13de89){logger[_0x8d9c('0x11')](_0x8d9c('0x15'),_0x13de89[_0x8d9c('0x12')],_0x1ed27d);_0x105952(_0x44896d[_0x8d9c('0x11')](0x1f4,_0x13de89[_0x8d9c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index b0fcea1..85f817a 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 _0x4f0c=['killProcess','exports','express','Router','./system.controller','get','isAuthenticated','/process/:pid/kill'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0x4f0c,0x18a));var _0xc4f0=function(_0x537040,_0x109c10){_0x537040=_0x537040-0x0;var _0x1ba0e=_0x4f0c[_0x537040];return _0x1ba0e;};'use strict';var express=require(_0xc4f0('0x0'));var router=express[_0xc4f0('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xc4f0('0x2'));router[_0xc4f0('0x3')]('/',auth[_0xc4f0('0x4')](),controller['index']);router[_0xc4f0('0x3')](_0xc4f0('0x5'),auth[_0xc4f0('0x4')](),controller[_0xc4f0('0x6')]);module[_0xc4f0('0x7')]=router; \ No newline at end of file +var _0x28eb=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x11e001,_0xb3367b){var _0x417419=function(_0x33f535){while(--_0x33f535){_0x11e001['push'](_0x11e001['shift']());}};_0x417419(++_0xb3367b);}(_0x28eb,0x16e));var _0xb28e=function(_0xdf55bb,_0x152935){_0xdf55bb=_0xdf55bb-0x0;var _0x4ad697=_0x28eb[_0xdf55bb];return _0x4ad697;};'use strict';var express=require(_0xb28e('0x0'));var router=express[_0xb28e('0x1')]();var auth=require(_0xb28e('0x2'));var controller=require(_0xb28e('0x3'));router[_0xb28e('0x4')]('/',auth[_0xb28e('0x5')](),controller['index']);router[_0xb28e('0x4')](_0xb28e('0x6'),auth[_0xb28e('0x5')](),controller[_0xb28e('0x7')]);module[_0xb28e('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 620a68a..37891eb 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 _0x32b7=['send','index','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','systeminformation','exec','../../config/logger','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status'];(function(_0x4acf20,_0x3f4636){var _0x50eabc=function(_0x20c518){while(--_0x20c518){_0x4acf20['push'](_0x4acf20['shift']());}};_0x50eabc(++_0x3f4636);}(_0x32b7,0x18b));var _0x732b=function(_0x329662,_0x3a00e4){_0x329662=_0x329662-0x0;var _0x63c696=_0x32b7[_0x329662];return _0x63c696;};'use strict';var info=require(_0x732b('0x0'));var exec=require('child_process')[_0x732b('0x1')];var logger=require(_0x732b('0x2'))('api');var util=require(_0x732b('0x3'));var BPromise=require(_0x732b('0x4'));var _=require('lodash');function handleError(_0x2f809f,_0x21cc23,_0xbcb893){_0x21cc23=_0x21cc23||0x1f4;return function(_0x21c79d){logger[_0x732b('0x5')](_0x732b('0x6'),_0xbcb893,_0x21cc23,util[_0x732b('0x7')](_0x21c79d,{'showHidden':![],'depth':null}));delete _0x21c79d[_0x732b('0x8')];_0x2f809f[_0x732b('0x9')](_0x21cc23)[_0x732b('0xa')](_0x21c79d);};}exports[_0x732b('0xb')]=function(_0x50b6b7,_0x1a0490){return info['getAllData']()[_0x732b('0xc')](function(_0x3ea9ea){return _0x1a0490[_0x732b('0x9')](0xc8)[_0x732b('0xd')](_0x3ea9ea);})['catch'](function(_0x4c3ab3){return _0x1a0490[_0x732b('0x9')](0x1f4)[_0x732b('0xd')](_0x4c3ab3);});};exports[_0x732b('0xe')]=function(_0x370f82,_0x56d3a2){var _0x901594=[_0x732b('0xf')];return new BPromise(function(_0x306396,_0x38a93d){return exec(util[_0x732b('0x10')](_0x732b('0x11'),_0x370f82['params'][_0x732b('0x12')]),function(_0x2d077f,_0x34b874,_0x2f526f){if(_0x2d077f){return _0x38a93d(_0x2d077f);}return _0x306396(_0x34b874);});})[_0x732b('0xc')](function(_0x3811b8){var _0x41b32a=![];var _0xafa8b5=_0x3811b8[_0x732b('0x13')](/\n/);for(var _0x11a515=0x0,_0x474ba4=_0x901594[_0x732b('0x14')];_0x11a515<_0x474ba4,_0x41b32a===![];_0x11a515+=0x1){if(_0x3811b8[_0x732b('0x15')](_0x901594[_0x11a515])>=0x0){_0x41b32a=!![];}}if(!_0x41b32a){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x370f82[_0x732b('0x16')][_0x732b('0x12')]));}process[_0x732b('0x17')](_0x370f82[_0x732b('0x16')][_0x732b('0x12')],_0x732b('0x18'));return _0x56d3a2[_0x732b('0x9')](0xc8)[_0x732b('0xd')]({'message':util[_0x732b('0x10')](_0x732b('0x19'),_0x370f82['params'][_0x732b('0x12')])});})[_0x732b('0x1a')](handleError(_0x56d3a2,null,_0x732b('0xe')));}; \ No newline at end of file +var _0x3dd3=['systeminformation','child_process','exec','util','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','getAllData','then','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x5a2e9d,_0x24f07c){var _0x3ce833=function(_0x2cef35){while(--_0x2cef35){_0x5a2e9d['push'](_0x5a2e9d['shift']());}};_0x3ce833(++_0x24f07c);}(_0x3dd3,0x16c));var _0x33dd=function(_0x382d9b,_0x4342a9){_0x382d9b=_0x382d9b-0x0;var _0x3b1825=_0x3dd3[_0x382d9b];return _0x3b1825;};'use strict';var info=require(_0x33dd('0x0'));var exec=require(_0x33dd('0x1'))[_0x33dd('0x2')];var logger=require('../../config/logger')('api');var util=require(_0x33dd('0x3'));var BPromise=require(_0x33dd('0x4'));var _=require('lodash');function handleError(_0x558815,_0x3310d0,_0x9fef4e){_0x3310d0=_0x3310d0||0x1f4;return function(_0x544d8c){logger[_0x33dd('0x5')](_0x33dd('0x6'),_0x9fef4e,_0x3310d0,util[_0x33dd('0x7')](_0x544d8c,{'showHidden':![],'depth':null}));delete _0x544d8c[_0x33dd('0x8')];_0x558815[_0x33dd('0x9')](_0x3310d0)['send'](_0x544d8c);};}exports['index']=function(_0x4540ad,_0x343a1e){return info[_0x33dd('0xa')]()[_0x33dd('0xb')](function(_0xa48926){return _0x343a1e[_0x33dd('0x9')](0xc8)[_0x33dd('0xc')](_0xa48926);})['catch'](function(_0x292952){return _0x343a1e[_0x33dd('0x9')](0x1f4)[_0x33dd('0xc')](_0x292952);});};exports[_0x33dd('0xd')]=function(_0x4339b9,_0x60cc9c){var _0x12b165=[_0x33dd('0xe')];return new BPromise(function(_0x4db28b,_0x27691d){return exec(util[_0x33dd('0xf')](_0x33dd('0x10'),_0x4339b9['params'][_0x33dd('0x11')]),function(_0xb1e333,_0x503dff,_0x42bc6e){if(_0xb1e333){return _0x27691d(_0xb1e333);}return _0x4db28b(_0x503dff);});})[_0x33dd('0xb')](function(_0x574987){var _0x30ef3c=![];var _0x2041a0=_0x574987[_0x33dd('0x12')](/\n/);for(var _0x299e48=0x0,_0x69fd61=_0x12b165[_0x33dd('0x13')];_0x299e48<_0x69fd61,_0x30ef3c===![];_0x299e48+=0x1){if(_0x574987[_0x33dd('0x14')](_0x12b165[_0x299e48])>=0x0){_0x30ef3c=!![];}}if(!_0x30ef3c){throw new Error(util[_0x33dd('0xf')](_0x33dd('0x15'),_0x4339b9[_0x33dd('0x16')][_0x33dd('0x11')]));}process[_0x33dd('0x17')](_0x4339b9['params'][_0x33dd('0x11')],_0x33dd('0x18'));return _0x60cc9c[_0x33dd('0x9')](0xc8)[_0x33dd('0xc')]({'message':util[_0x33dd('0xf')](_0x33dd('0x19'),_0x4339b9[_0x33dd('0x16')][_0x33dd('0x11')])});})['catch'](handleError(_0x60cc9c,null,_0x33dd('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index af2e9b5..e0db1e0 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 _0x5eb8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete','destroy','path','connect-timeout','express','Router'];(function(_0x21ecd6,_0x53e0a6){var _0x5b2b5a=function(_0x13e95b){while(--_0x13e95b){_0x21ecd6['push'](_0x21ecd6['shift']());}};_0x5b2b5a(++_0x53e0a6);}(_0x5eb8,0xb0));var _0x85eb=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0x5eb8[_0x152449];return _0x5b58b2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x85eb('0x0'));var timeout=require(_0x85eb('0x1'));var express=require(_0x85eb('0x2'));var router=express[_0x85eb('0x3')]();var auth=require(_0x85eb('0x4'));var interaction=require(_0x85eb('0x5'));var config=require(_0x85eb('0x6'));var controller=require(_0x85eb('0x7'));router[_0x85eb('0x8')]('/',auth[_0x85eb('0x9')](),controller[_0x85eb('0xa')]);router[_0x85eb('0x8')]('/:id',auth[_0x85eb('0x9')](),controller[_0x85eb('0xb')]);router[_0x85eb('0xc')]('/',auth['isAuthenticated'](),controller[_0x85eb('0xd')]);router['put'](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xe'),auth[_0x85eb('0x9')](),controller[_0x85eb('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8603=['../../config/environment','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x297d6f,_0x12c8be){var _0x4e0852=function(_0x37780e){while(--_0x37780e){_0x297d6f['push'](_0x297d6f['shift']());}};_0x4e0852(++_0x12c8be);}(_0x8603,0x190));var _0x3860=function(_0x1eff1a,_0x5d05a9){_0x1eff1a=_0x1eff1a-0x0;var _0x478b4b=_0x8603[_0x1eff1a];return _0x478b4b;};'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 auth=require(_0x3860('0x3'));var interaction=require(_0x3860('0x4'));var config=require(_0x3860('0x5'));var controller=require('./tag.controller');router[_0x3860('0x6')]('/',auth['isAuthenticated'](),controller[_0x3860('0x7')]);router[_0x3860('0x6')](_0x3860('0x8'),auth[_0x3860('0x9')](),controller[_0x3860('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3860('0xb')](_0x3860('0x8'),auth['isAuthenticated'](),controller[_0x3860('0xc')]);router[_0x3860('0xd')]('/:id',auth[_0x3860('0x9')](),controller[_0x3860('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3c6dd00..7e77a8c 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 _0xbe30=['exports','STRING','#0091EA','sequelize'];(function(_0x518647,_0x1ca11d){var _0x5c319c=function(_0x21a377){while(--_0x21a377){_0x518647['push'](_0x518647['shift']());}};_0x5c319c(++_0x1ca11d);}(_0xbe30,0x17b));var _0x0be3=function(_0x33177f,_0x30e2c2){_0x33177f=_0x33177f-0x0;var _0x102bf9=_0xbe30[_0x33177f];return _0x102bf9;};'use strict';var Sequelize=require(_0x0be3('0x0'));module[_0x0be3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x0be3('0x2')],'defaultValue':_0x0be3('0x3')},'description':{'type':Sequelize[_0x0be3('0x2')]}}; \ No newline at end of file +var _0x77a9=['name','#0091EA','sequelize','exports','STRING'];(function(_0x202606,_0x2555f5){var _0x3bce6c=function(_0x4d461a){while(--_0x4d461a){_0x202606['push'](_0x202606['shift']());}};_0x3bce6c(++_0x2555f5);}(_0x77a9,0xe8));var _0x977a=function(_0x298d35,_0x416e41){_0x298d35=_0x298d35-0x0;var _0x495725=_0x77a9[_0x298d35];return _0x495725;};'use strict';var Sequelize=require(_0x977a('0x0'));module[_0x977a('0x1')]={'name':{'type':Sequelize[_0x977a('0x2')],'unique':_0x977a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x977a('0x2')],'defaultValue':_0x977a('0x4')},'description':{'type':Sequelize[_0x977a('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 6e583fd..f0fdac3 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 _0x152d=['VIRTUAL','field','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','save','update','destroy','then','get','Tags','UserProfileResource','name','index','Tag','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','type'];(function(_0x9d1180,_0x2f71fb){var _0x155274=function(_0x1867c1){while(--_0x1867c1){_0x9d1180['push'](_0x9d1180['shift']());}};_0x155274(++_0x2f71fb);}(_0x152d,0x18f));var _0xd152=function(_0xc6e47b,_0x55e17b){_0xc6e47b=_0xc6e47b-0x0;var _0x1ce1e8=_0x152d[_0xc6e47b];return _0x1ce1e8;};'use strict';var pdf=require(_0xd152('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd152('0x1'));var zipdir=require(_0xd152('0x2'));var jsonpatch=require(_0xd152('0x3'));var rp=require(_0xd152('0x4'));var moment=require(_0xd152('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd152('0x6'));var path=require(_0xd152('0x7'));var sox=require('sox');var csv=require(_0xd152('0x8'));var ejs=require(_0xd152('0x9'));var fs=require('fs');var _=require(_0xd152('0xa'));var squel=require(_0xd152('0xb'));var crypto=require(_0xd152('0xc'));var jsforce=require(_0xd152('0xd'));var deskjs=require(_0xd152('0xe'));var toCsv=require(_0xd152('0x8'));var querystring=require('querystring');var Papa=require(_0xd152('0xf'));var Redis=require(_0xd152('0x10'));var authService=require(_0xd152('0x11'));var qs=require(_0xd152('0x12'));var hardwareService=require(_0xd152('0x13'));var logger=require(_0xd152('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd152('0x15'));var db=require(_0xd152('0x16'))['db'];function respondWithStatusCode(_0x4666f5,_0x240c3d){_0x240c3d=_0x240c3d||0xcc;return function(_0x4c9568){if(_0x4c9568){return _0x4666f5[_0xd152('0x17')](_0x240c3d);}return _0x4666f5[_0xd152('0x18')](_0x240c3d)['end']();};}function respondWithResult(_0x1a43e1,_0x46f3d3){_0x46f3d3=_0x46f3d3||0xc8;return function(_0x423294){if(_0x423294){return _0x1a43e1[_0xd152('0x18')](_0x46f3d3)[_0xd152('0x19')](_0x423294);}};}function respondWithFilteredResult(_0x541bd0,_0x579c50){return function(_0x325021){if(_0x325021){var _0x2dffda=_0x325021[_0xd152('0x1a')],_0x5ade75=_0x579c50[_0xd152('0x1b')],_0x34b6da=_0x579c50[_0xd152('0x1b')]+_0x579c50[_0xd152('0x1c')],_0x149d72;if(_0x34b6da>=_0x2dffda){_0x34b6da=_0x2dffda;_0x149d72=0xc8;}else{_0x149d72=0xce;}_0x541bd0[_0xd152('0x18')](_0x149d72);return _0x541bd0[_0xd152('0x1d')]('Content-Range',_0x5ade75+'-'+_0x34b6da+'/'+_0x2dffda)[_0xd152('0x19')](_0x325021);}return null;};}function patchUpdates(_0x496e01){return function(_0x4ea89e){try{jsonpatch[_0xd152('0x1e')](_0x4ea89e,_0x496e01,!![]);}catch(_0x23ecff){return BPromise['reject'](_0x23ecff);}return _0x4ea89e[_0xd152('0x1f')]();};}function saveUpdates(_0x7e60c5,_0x2954dc){return function(_0x3efafb){if(_0x3efafb){return _0x3efafb[_0xd152('0x20')](_0x7e60c5)['then'](function(_0x4c6f3c){return _0x4c6f3c;});}return null;};}function removeEntity(_0x221ac4,_0x4b1c44){return function(_0x300fa9){if(_0x300fa9){return _0x300fa9[_0xd152('0x21')]()[_0xd152('0x22')](function(){var _0x1b57bb=_0x300fa9[_0xd152('0x23')]({'plain':!![]});var _0x4ca389=_0xd152('0x24');return db[_0xd152('0x25')][_0xd152('0x21')]({'where':{'type':_0x4ca389,'resourceId':_0x1b57bb['id']}})[_0xd152('0x22')](function(){return _0x300fa9;});})['then'](function(){_0x221ac4[_0xd152('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24e49b,_0x726b23){return function(_0x255f28){if(!_0x255f28){_0x24e49b['sendStatus'](0x194);}return _0x255f28;};}function handleError(_0x41aa38,_0xb4b277){_0xb4b277=_0xb4b277||0x1f4;return function(_0x444244){logger['error'](_0x444244['stack']);if(_0x444244[_0xd152('0x26')]){delete _0x444244['name'];}_0x41aa38[_0xd152('0x18')](_0xb4b277)['send'](_0x444244);};}exports[_0xd152('0x27')]=function(_0x3eb677,_0x28b2f0){var _0x294fe9={},_0x3262a4={},_0x13c2a0={'count':0x0,'rows':[]};var _0x5d79b9=db[_0xd152('0x28')]['rawAttributes'];_0x3262a4[_0xd152('0x29')]=_[_0xd152('0x2a')](_0x5d79b9);_0x3262a4['query']=_['keys'](_0x3eb677[_0xd152('0x2b')]);_0x3262a4[_0xd152('0x2c')]=_[_0xd152('0x2d')](_0x3262a4[_0xd152('0x29')],_0x3262a4[_0xd152('0x2b')]);_0x294fe9[_0xd152('0x2e')]=_['intersection'](_0x3262a4[_0xd152('0x29')],qs[_0xd152('0x2f')](_0x3eb677[_0xd152('0x2b')]['fields']));_0x294fe9[_0xd152('0x2e')]=_0x294fe9[_0xd152('0x2e')][_0xd152('0x30')]?_0x294fe9[_0xd152('0x2e')]:_0x3262a4[_0xd152('0x29')];if(!_0x3eb677[_0xd152('0x2b')]['hasOwnProperty'](_0xd152('0x31'))){_0x294fe9['limit']=qs[_0xd152('0x1c')](_0x3eb677[_0xd152('0x2b')]['limit']);_0x294fe9[_0xd152('0x1b')]=qs[_0xd152('0x1b')](_0x3eb677[_0xd152('0x2b')][_0xd152('0x1b')]);}_0x294fe9['order']=qs[_0xd152('0x32')](_0x3eb677['query'][_0xd152('0x32')]);_0x294fe9[_0xd152('0x33')]=qs[_0xd152('0x2c')](_[_0xd152('0x34')](_0x3eb677[_0xd152('0x2b')],_0x3262a4[_0xd152('0x2c')]));if(_0x3eb677[_0xd152('0x2b')][_0xd152('0x35')]){_0x294fe9[_0xd152('0x33')]=_[_0xd152('0x36')](_0x294fe9['where'],{'$or':_[_0xd152('0x37')](_0x5d79b9,function(_0x2b75cb){if(_0x2b75cb[_0xd152('0x38')]['key']!==_0xd152('0x39')){var _0xbf9684={};_0xbf9684[_0x2b75cb[_0xd152('0x3a')]]={'$like':'%'+_0x3eb677[_0xd152('0x2b')]['filter']+'%'};return _0xbf9684;}})});}_0x294fe9=_[_0xd152('0x36')]({},_0x294fe9,_0x3eb677['options']);var _0x34acf3={'where':_0x294fe9[_0xd152('0x33')]};return db[_0xd152('0x28')]['count'](_0x34acf3)['then'](function(_0x3783b2){_0x13c2a0[_0xd152('0x1a')]=_0x3783b2;if(_0x3eb677[_0xd152('0x2b')][_0xd152('0x3b')]){_0x294fe9[_0xd152('0x3c')]=[{'all':!![]}];}return db[_0xd152('0x28')][_0xd152('0x3d')](_0x294fe9);})[_0xd152('0x22')](function(_0x1717eb){_0x13c2a0[_0xd152('0x3e')]=_0x1717eb;return _0x13c2a0;})[_0xd152('0x22')](respondWithFilteredResult(_0x28b2f0,_0x294fe9))[_0xd152('0x3f')](handleError(_0x28b2f0,null));};exports[_0xd152('0x40')]=function(_0x100752,_0x35cc23){var _0x500fb7={'raw':!![],'where':{'id':_0x100752[_0xd152('0x41')]['id']}},_0x19d4d9={};_0x19d4d9[_0xd152('0x29')]=_[_0xd152('0x2a')](db[_0xd152('0x28')]['rawAttributes']);_0x19d4d9[_0xd152('0x2b')]=_[_0xd152('0x2a')](_0x100752[_0xd152('0x2b')]);_0x19d4d9[_0xd152('0x2c')]=_[_0xd152('0x2d')](_0x19d4d9[_0xd152('0x29')],_0x19d4d9[_0xd152('0x2b')]);_0x500fb7[_0xd152('0x2e')]=_[_0xd152('0x2d')](_0x19d4d9[_0xd152('0x29')],qs[_0xd152('0x2f')](_0x100752['query'][_0xd152('0x2f')]));_0x500fb7[_0xd152('0x2e')]=_0x500fb7['attributes']['length']?_0x500fb7[_0xd152('0x2e')]:_0x19d4d9[_0xd152('0x29')];if(_0x100752['query']['includeAll']){_0x500fb7['include']=[{'all':!![]}];}_0x500fb7=_[_0xd152('0x36')]({},_0x500fb7,_0x100752[_0xd152('0x42')]);return db[_0xd152('0x28')][_0xd152('0x43')](_0x500fb7)[_0xd152('0x22')](handleEntityNotFound(_0x35cc23,null))[_0xd152('0x22')](respondWithResult(_0x35cc23,null))['catch'](handleError(_0x35cc23,null));};exports['create']=function(_0x2c04e7,_0x5d44ba){return db[_0xd152('0x28')][_0xd152('0x44')](_0x2c04e7[_0xd152('0x45')],{})['then'](function(_0xb20764){var _0x3f54ec=_0x2c04e7[_0xd152('0x46')]['get']({'plain':!![]});if(!_0x3f54ec)throw new Error(_0xd152('0x47'));if(_0x3f54ec['role']===_0xd152('0x46')){var _0x5f2f1b=_0xb20764[_0xd152('0x23')]({'plain':!![]});var _0x21a4cd=_0xd152('0x24');return db[_0xd152('0x48')][_0xd152('0x43')]({'where':{'name':_0x21a4cd,'userProfileId':_0x3f54ec[_0xd152('0x49')]},'raw':!![]})[_0xd152('0x22')](function(_0x2b0524){if(_0x2b0524&&_0x2b0524['autoAssociation']===0x0){return db[_0xd152('0x25')][_0xd152('0x44')]({'name':_0x5f2f1b[_0xd152('0x26')],'resourceId':_0x5f2f1b['id'],'type':_0x2b0524['name'],'sectionId':_0x2b0524['id']},{})[_0xd152('0x22')](function(){return _0xb20764;});}else{return _0xb20764;}})['catch'](function(_0x55ba03){logger[_0xd152('0x4a')](_0xd152('0x4b'),_0x55ba03);throw _0x55ba03;});}return _0xb20764;})['then'](respondWithResult(_0x5d44ba,0xc9))[_0xd152('0x3f')](handleError(_0x5d44ba,null));};exports[_0xd152('0x20')]=function(_0x27ea7f,_0x520581){if(_0x27ea7f['body']['id']){delete _0x27ea7f[_0xd152('0x45')]['id'];}return db[_0xd152('0x28')][_0xd152('0x43')]({'where':{'id':_0x27ea7f[_0xd152('0x41')]['id']}})[_0xd152('0x22')](handleEntityNotFound(_0x520581,null))[_0xd152('0x22')](saveUpdates(_0x27ea7f[_0xd152('0x45')],null))[_0xd152('0x22')](respondWithResult(_0x520581,null))[_0xd152('0x3f')](handleError(_0x520581,null));};exports[_0xd152('0x21')]=function(_0xa3391f,_0x204237){return db[_0xd152('0x28')][_0xd152('0x43')]({'where':{'id':_0xa3391f[_0xd152('0x41')]['id']}})[_0xd152('0x22')](handleEntityNotFound(_0x204237,null))['then'](removeEntity(_0x204237,null))['catch'](handleError(_0x204237,null));}; \ No newline at end of file +var _0xbfdd=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','sendStatus','stack','name','send','index','Tag','rawAttributes','keys','query','intersection','model','attributes','fields','order','sort','where','filters','pick','merge','map','key','field','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','role','UserProfileSection','find','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x584a03,_0x59e0c8){var _0x29d9c9=function(_0x27ea6f){while(--_0x27ea6f){_0x584a03['push'](_0x584a03['shift']());}};_0x29d9c9(++_0x59e0c8);}(_0xbfdd,0xe6));var _0xdbfd=function(_0x1e5725,_0x3f4e13){_0x1e5725=_0x1e5725-0x0;var _0x4b5cf8=_0xbfdd[_0x1e5725];return _0x4b5cf8;};'use strict';var pdf=require(_0xdbfd('0x0'));var emlformat=require(_0xdbfd('0x1'));var rimraf=require(_0xdbfd('0x2'));var zipdir=require(_0xdbfd('0x3'));var jsonpatch=require(_0xdbfd('0x4'));var rp=require(_0xdbfd('0x5'));var moment=require(_0xdbfd('0x6'));var BPromise=require(_0xdbfd('0x7'));var Mustache=require(_0xdbfd('0x8'));var util=require('util');var path=require(_0xdbfd('0x9'));var sox=require('sox');var csv=require(_0xdbfd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdbfd('0xb'));var squel=require('squel');var crypto=require(_0xdbfd('0xc'));var jsforce=require(_0xdbfd('0xd'));var deskjs=require(_0xdbfd('0xe'));var toCsv=require(_0xdbfd('0xa'));var querystring=require(_0xdbfd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdbfd('0x10'));var hardwareService=require(_0xdbfd('0x11'));var logger=require(_0xdbfd('0x12'))(_0xdbfd('0x13'));var utils=require(_0xdbfd('0x14'));var config=require(_0xdbfd('0x15'));var db=require(_0xdbfd('0x16'))['db'];function respondWithStatusCode(_0x526bc6,_0x1d5525){_0x1d5525=_0x1d5525||0xcc;return function(_0x1a0877){if(_0x1a0877){return _0x526bc6['sendStatus'](_0x1d5525);}return _0x526bc6[_0xdbfd('0x17')](_0x1d5525)[_0xdbfd('0x18')]();};}function respondWithResult(_0x3c5131,_0x18b0df){_0x18b0df=_0x18b0df||0xc8;return function(_0x2b891a){if(_0x2b891a){return _0x3c5131['status'](_0x18b0df)[_0xdbfd('0x19')](_0x2b891a);}};}function respondWithFilteredResult(_0x50c4e9,_0x5e1894){return function(_0x24963f){if(_0x24963f){var _0x10800c=_0x24963f[_0xdbfd('0x1a')],_0x8dd8e7=_0x5e1894[_0xdbfd('0x1b')],_0x38ff8a=_0x5e1894[_0xdbfd('0x1b')]+_0x5e1894[_0xdbfd('0x1c')],_0x566321;if(_0x38ff8a>=_0x10800c){_0x38ff8a=_0x10800c;_0x566321=0xc8;}else{_0x566321=0xce;}_0x50c4e9[_0xdbfd('0x17')](_0x566321);return _0x50c4e9[_0xdbfd('0x1d')](_0xdbfd('0x1e'),_0x8dd8e7+'-'+_0x38ff8a+'/'+_0x10800c)['json'](_0x24963f);}return null;};}function patchUpdates(_0x631db1){return function(_0x472fea){try{jsonpatch[_0xdbfd('0x1f')](_0x472fea,_0x631db1,!![]);}catch(_0x3f277d){return BPromise[_0xdbfd('0x20')](_0x3f277d);}return _0x472fea[_0xdbfd('0x21')]();};}function saveUpdates(_0x551d13,_0x3d519a){return function(_0x207a92){if(_0x207a92){return _0x207a92[_0xdbfd('0x22')](_0x551d13)[_0xdbfd('0x23')](function(_0x35a965){return _0x35a965;});}return null;};}function removeEntity(_0x2849dc,_0x3b0941){return function(_0x3e6183){if(_0x3e6183){return _0x3e6183[_0xdbfd('0x24')]()['then'](function(){var _0x3e436d=_0x3e6183[_0xdbfd('0x25')]({'plain':!![]});var _0x69d6ce=_0xdbfd('0x26');return db['UserProfileResource'][_0xdbfd('0x24')]({'where':{'type':_0x69d6ce,'resourceId':_0x3e436d['id']}})[_0xdbfd('0x23')](function(){return _0x3e6183;});})[_0xdbfd('0x23')](function(){_0x2849dc[_0xdbfd('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4459ee,_0x2becfe){return function(_0x4d1117){if(!_0x4d1117){_0x4459ee[_0xdbfd('0x27')](0x194);}return _0x4d1117;};}function handleError(_0x20b1d9,_0x5f3a0e){_0x5f3a0e=_0x5f3a0e||0x1f4;return function(_0xc080c){logger['error'](_0xc080c[_0xdbfd('0x28')]);if(_0xc080c[_0xdbfd('0x29')]){delete _0xc080c[_0xdbfd('0x29')];}_0x20b1d9['status'](_0x5f3a0e)[_0xdbfd('0x2a')](_0xc080c);};}exports[_0xdbfd('0x2b')]=function(_0x6bff36,_0x1eb232){var _0x1f95d4={},_0x83076c={},_0x3802a0={'count':0x0,'rows':[]};var _0x3b29a8=db[_0xdbfd('0x2c')][_0xdbfd('0x2d')];_0x83076c['model']=_[_0xdbfd('0x2e')](_0x3b29a8);_0x83076c[_0xdbfd('0x2f')]=_[_0xdbfd('0x2e')](_0x6bff36['query']);_0x83076c['filters']=_[_0xdbfd('0x30')](_0x83076c[_0xdbfd('0x31')],_0x83076c['query']);_0x1f95d4[_0xdbfd('0x32')]=_[_0xdbfd('0x30')](_0x83076c[_0xdbfd('0x31')],qs['fields'](_0x6bff36[_0xdbfd('0x2f')][_0xdbfd('0x33')]));_0x1f95d4[_0xdbfd('0x32')]=_0x1f95d4['attributes']['length']?_0x1f95d4[_0xdbfd('0x32')]:_0x83076c[_0xdbfd('0x31')];if(!_0x6bff36[_0xdbfd('0x2f')]['hasOwnProperty']('nolimit')){_0x1f95d4['limit']=qs['limit'](_0x6bff36[_0xdbfd('0x2f')][_0xdbfd('0x1c')]);_0x1f95d4[_0xdbfd('0x1b')]=qs[_0xdbfd('0x1b')](_0x6bff36[_0xdbfd('0x2f')]['offset']);}_0x1f95d4[_0xdbfd('0x34')]=qs[_0xdbfd('0x35')](_0x6bff36['query'][_0xdbfd('0x35')]);_0x1f95d4[_0xdbfd('0x36')]=qs[_0xdbfd('0x37')](_[_0xdbfd('0x38')](_0x6bff36['query'],_0x83076c[_0xdbfd('0x37')]));if(_0x6bff36[_0xdbfd('0x2f')]['filter']){_0x1f95d4[_0xdbfd('0x36')]=_[_0xdbfd('0x39')](_0x1f95d4['where'],{'$or':_[_0xdbfd('0x3a')](_0x3b29a8,function(_0x4b7bbb){if(_0x4b7bbb['type'][_0xdbfd('0x3b')]!=='VIRTUAL'){var _0x9421f1={};_0x9421f1[_0x4b7bbb[_0xdbfd('0x3c')]]={'$like':'%'+_0x6bff36[_0xdbfd('0x2f')]['filter']+'%'};return _0x9421f1;}})});}_0x1f95d4=_[_0xdbfd('0x39')]({},_0x1f95d4,_0x6bff36[_0xdbfd('0x3d')]);var _0x2afe64={'where':_0x1f95d4['where']};return db[_0xdbfd('0x2c')][_0xdbfd('0x1a')](_0x2afe64)['then'](function(_0x3a9c07){_0x3802a0[_0xdbfd('0x1a')]=_0x3a9c07;if(_0x6bff36[_0xdbfd('0x2f')][_0xdbfd('0x3e')]){_0x1f95d4[_0xdbfd('0x3f')]=[{'all':!![]}];}return db[_0xdbfd('0x2c')][_0xdbfd('0x40')](_0x1f95d4);})[_0xdbfd('0x23')](function(_0x3318d8){_0x3802a0[_0xdbfd('0x41')]=_0x3318d8;return _0x3802a0;})['then'](respondWithFilteredResult(_0x1eb232,_0x1f95d4))[_0xdbfd('0x42')](handleError(_0x1eb232,null));};exports[_0xdbfd('0x43')]=function(_0x68360d,_0x1cd93a){var _0x4022bf={'raw':!![],'where':{'id':_0x68360d[_0xdbfd('0x44')]['id']}},_0x43da7e={};_0x43da7e[_0xdbfd('0x31')]=_[_0xdbfd('0x2e')](db['Tag'][_0xdbfd('0x2d')]);_0x43da7e[_0xdbfd('0x2f')]=_[_0xdbfd('0x2e')](_0x68360d[_0xdbfd('0x2f')]);_0x43da7e[_0xdbfd('0x37')]=_[_0xdbfd('0x30')](_0x43da7e[_0xdbfd('0x31')],_0x43da7e[_0xdbfd('0x2f')]);_0x4022bf[_0xdbfd('0x32')]=_[_0xdbfd('0x30')](_0x43da7e[_0xdbfd('0x31')],qs[_0xdbfd('0x33')](_0x68360d[_0xdbfd('0x2f')]['fields']));_0x4022bf[_0xdbfd('0x32')]=_0x4022bf['attributes'][_0xdbfd('0x45')]?_0x4022bf['attributes']:_0x43da7e[_0xdbfd('0x31')];if(_0x68360d[_0xdbfd('0x2f')][_0xdbfd('0x3e')]){_0x4022bf[_0xdbfd('0x3f')]=[{'all':!![]}];}_0x4022bf=_['merge']({},_0x4022bf,_0x68360d['options']);return db[_0xdbfd('0x2c')]['find'](_0x4022bf)[_0xdbfd('0x23')](handleEntityNotFound(_0x1cd93a,null))[_0xdbfd('0x23')](respondWithResult(_0x1cd93a,null))['catch'](handleError(_0x1cd93a,null));};exports[_0xdbfd('0x46')]=function(_0x4cbec2,_0x4a5aa3){return db[_0xdbfd('0x2c')][_0xdbfd('0x46')](_0x4cbec2[_0xdbfd('0x47')],{})[_0xdbfd('0x23')](function(_0x550106){var _0x2434fa=_0x4cbec2[_0xdbfd('0x48')][_0xdbfd('0x25')]({'plain':!![]});if(!_0x2434fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2434fa[_0xdbfd('0x49')]===_0xdbfd('0x48')){var _0x4ea613=_0x550106[_0xdbfd('0x25')]({'plain':!![]});var _0xf74ecf=_0xdbfd('0x26');return db[_0xdbfd('0x4a')][_0xdbfd('0x4b')]({'where':{'name':_0xf74ecf,'userProfileId':_0x2434fa['userProfileId']},'raw':!![]})[_0xdbfd('0x23')](function(_0x36b668){if(_0x36b668&&_0x36b668['autoAssociation']===0x0){return db[_0xdbfd('0x4c')][_0xdbfd('0x46')]({'name':_0x4ea613[_0xdbfd('0x29')],'resourceId':_0x4ea613['id'],'type':_0x36b668['name'],'sectionId':_0x36b668['id']},{})[_0xdbfd('0x23')](function(){return _0x550106;});}else{return _0x550106;}})[_0xdbfd('0x42')](function(_0x45b09f){logger['error'](_0xdbfd('0x4d'),_0x45b09f);throw _0x45b09f;});}return _0x550106;})['then'](respondWithResult(_0x4a5aa3,0xc9))[_0xdbfd('0x42')](handleError(_0x4a5aa3,null));};exports[_0xdbfd('0x22')]=function(_0x460fa0,_0x5bf341){if(_0x460fa0[_0xdbfd('0x47')]['id']){delete _0x460fa0[_0xdbfd('0x47')]['id'];}return db[_0xdbfd('0x2c')][_0xdbfd('0x4b')]({'where':{'id':_0x460fa0[_0xdbfd('0x44')]['id']}})[_0xdbfd('0x23')](handleEntityNotFound(_0x5bf341,null))[_0xdbfd('0x23')](saveUpdates(_0x460fa0[_0xdbfd('0x47')],null))[_0xdbfd('0x23')](respondWithResult(_0x5bf341,null))[_0xdbfd('0x42')](handleError(_0x5bf341,null));};exports['destroy']=function(_0x3dc0fc,_0x1dbbbf){return db['Tag'][_0xdbfd('0x4b')]({'where':{'id':_0x3dc0fc['params']['id']}})['then'](handleEntityNotFound(_0x1dbbbf,null))[_0xdbfd('0x23')](removeEntity(_0x1dbbbf,null))[_0xdbfd('0x42')](handleError(_0x1dbbbf,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 3dce77b..7d542a0 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 _0x7ade=['exports','define','Tag','tools_tags','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./tag.attributes'];(function(_0x3aacc9,_0x4e8148){var _0xd6209a=function(_0xc97914){while(--_0xc97914){_0x3aacc9['push'](_0x3aacc9['shift']());}};_0xd6209a(++_0x4e8148);}(_0x7ade,0x184));var _0xe7ad=function(_0x2a0ad3,_0x3e5795){_0x2a0ad3=_0x2a0ad3-0x0;var _0x1e501b=_0x7ade[_0x2a0ad3];return _0x1e501b;};'use strict';var _=require(_0xe7ad('0x0'));var util=require('util');var logger=require(_0xe7ad('0x1'))('api');var moment=require(_0xe7ad('0x2'));var BPromise=require(_0xe7ad('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ad('0x4'));var rimraf=require(_0xe7ad('0x5'));var config=require(_0xe7ad('0x6'));var attributes=require(_0xe7ad('0x7'));module[_0xe7ad('0x8')]=function(_0x1650ad,_0x20be0d){return _0x1650ad[_0xe7ad('0x9')](_0xe7ad('0xa'),attributes,{'tableName':_0xe7ad('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16db=['api','bluebird','path','rimraf','define','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x16db,0x147));var _0xb16d=function(_0x5205e7,_0x2ebe05){_0x5205e7=_0x5205e7-0x0;var _0x459853=_0x16db[_0x5205e7];return _0x459853;};'use strict';var _=require(_0xb16d('0x0'));var util=require(_0xb16d('0x1'));var logger=require(_0xb16d('0x2'))(_0xb16d('0x3'));var moment=require('moment');var BPromise=require(_0xb16d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb16d('0x5'));var rimraf=require(_0xb16d('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module['exports']=function(_0x28e2d9,_0xa15963){return _0x28e2d9[_0xb16d('0x7')](_0xb16d('0x8'),attributes,{'tableName':_0xb16d('0x9'),'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 b039bba..fed7899 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 _0x57c3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x57c3,0x17d));var _0x357c=function(_0x380c90,_0xc939f6){_0x380c90=_0x380c90-0x0;var _0x404d81=_0x57c3[_0x380c90];return _0x404d81;};'use strict';var _=require(_0x357c('0x0'));var util=require(_0x357c('0x1'));var moment=require(_0x357c('0x2'));var BPromise=require(_0x357c('0x3'));var rs=require(_0x357c('0x4'));var fs=require('fs');var Redis=require(_0x357c('0x5'));var db=require(_0x357c('0x6'))['db'];var utils=require(_0x357c('0x7'));var logger=require(_0x357c('0x8'))('rpc');var config=require(_0x357c('0x9'));var jayson=require(_0x357c('0xa'));var client=jayson[_0x357c('0xb')][_0x357c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x201335,_0x207d38,_0x29341d){return new BPromise(function(_0x2ef005,_0x1b65ae){return client[_0x357c('0xd')](_0x201335,_0x29341d)['then'](function(_0x5951f){logger[_0x357c('0xe')](_0x357c('0xf'),_0x207d38,_0x357c('0x10'));logger[_0x357c('0x11')](_0x357c('0x12'),_0x207d38,_0x357c('0x10'),JSON[_0x357c('0x13')](_0x5951f));if(_0x5951f[_0x357c('0x14')]){if(_0x5951f[_0x357c('0x14')][_0x357c('0x15')]===0x1f4){logger[_0x357c('0x14')](_0x357c('0xf'),_0x207d38,_0x5951f[_0x357c('0x14')][_0x357c('0x16')]);return _0x1b65ae(_0x5951f[_0x357c('0x14')][_0x357c('0x16')]);}logger[_0x357c('0x14')](_0x357c('0xf'),_0x207d38,_0x5951f['error'][_0x357c('0x16')]);return _0x2ef005(_0x5951f[_0x357c('0x14')][_0x357c('0x16')]);}else{logger[_0x357c('0xe')](_0x357c('0xf'),_0x207d38,_0x357c('0x10'));_0x2ef005(_0x5951f['result']['message']);}})[_0x357c('0x17')](function(_0x32b769){logger[_0x357c('0x14')]('Tag,\x20%s,\x20%s',_0x207d38,_0x32b769);_0x1b65ae(_0x32b769);});});} \ No newline at end of file +var _0x435c=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1aef47,_0x302cc9){var _0x4cf42b=function(_0x17184f){while(--_0x17184f){_0x1aef47['push'](_0x1aef47['shift']());}};_0x4cf42b(++_0x302cc9);}(_0x435c,0x178));var _0xc435=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0x435c[_0x1d6a82];return _0x5834ac;};'use strict';var _=require(_0xc435('0x0'));var util=require(_0xc435('0x1'));var moment=require(_0xc435('0x2'));var BPromise=require(_0xc435('0x3'));var rs=require(_0xc435('0x4'));var fs=require('fs');var Redis=require(_0xc435('0x5'));var db=require(_0xc435('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc435('0x7'));var config=require('../../config/environment');var jayson=require(_0xc435('0x8'));var client=jayson[_0xc435('0x9')][_0xc435('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22890d,_0x3bc103,_0x3730f3){return new BPromise(function(_0x55acff,_0xf061b0){return client[_0xc435('0xb')](_0x22890d,_0x3730f3)[_0xc435('0xc')](function(_0x5e86c4){logger['info'](_0xc435('0xd'),_0x3bc103,_0xc435('0xe'));logger['debug'](_0xc435('0xf'),_0x3bc103,'request\x20sent',JSON[_0xc435('0x10')](_0x5e86c4));if(_0x5e86c4[_0xc435('0x11')]){if(_0x5e86c4['error'][_0xc435('0x12')]===0x1f4){logger[_0xc435('0x11')]('Tag,\x20%s,\x20%s',_0x3bc103,_0x5e86c4[_0xc435('0x11')]['message']);return _0xf061b0(_0x5e86c4[_0xc435('0x11')][_0xc435('0x13')]);}logger[_0xc435('0x11')](_0xc435('0xd'),_0x3bc103,_0x5e86c4['error'][_0xc435('0x13')]);return _0x55acff(_0x5e86c4['error']['message']);}else{logger[_0xc435('0x14')](_0xc435('0xd'),_0x3bc103,_0xc435('0xe'));_0x55acff(_0x5e86c4['result'][_0xc435('0x13')]);}})[_0xc435('0x15')](function(_0x9f39e8){logger[_0xc435('0x11')](_0xc435('0xd'),_0x3bc103,_0x9f39e8);_0xf061b0(_0x9f39e8);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 7cf24bc..514d80b 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 _0x7337=['/:id','show','/:id/queues','getQueues','getAgents','post','create','addQueues','put','update','delete','destroy','removeQueues','/:id/users','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./team.controller','get','isAuthenticated','index'];(function(_0x59e625,_0x1cb50a){var _0x532f9e=function(_0xe2df35){while(--_0xe2df35){_0x59e625['push'](_0x59e625['shift']());}};_0x532f9e(++_0x1cb50a);}(_0x7337,0xcd));var _0x7733=function(_0x17a192,_0x451b90){_0x17a192=_0x17a192-0x0;var _0x113d65=_0x7337[_0x17a192];return _0x113d65;};'use strict';var multer=require(_0x7733('0x0'));var util=require(_0x7733('0x1'));var path=require(_0x7733('0x2'));var timeout=require('connect-timeout');var express=require(_0x7733('0x3'));var router=express[_0x7733('0x4')]();var auth=require(_0x7733('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7733('0x6'));var controller=require(_0x7733('0x7'));router[_0x7733('0x8')]('/',auth[_0x7733('0x9')](),controller[_0x7733('0xa')]);router[_0x7733('0x8')](_0x7733('0xb'),auth[_0x7733('0x9')](),controller[_0x7733('0xc')]);router[_0x7733('0x8')](_0x7733('0xd'),auth[_0x7733('0x9')](),controller[_0x7733('0xe')]);router[_0x7733('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x7733('0xf')]);router[_0x7733('0x10')]('/',auth[_0x7733('0x9')](),controller[_0x7733('0x11')]);router[_0x7733('0x10')]('/:id/queues',auth[_0x7733('0x9')](),controller[_0x7733('0x12')]);router[_0x7733('0x10')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x7733('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x7733('0x14')]);router[_0x7733('0x15')](_0x7733('0xb'),auth[_0x7733('0x9')](),controller[_0x7733('0x16')]);router['delete']('/:id/queues',auth['isAuthenticated'](),controller[_0x7733('0x17')]);router['delete'](_0x7733('0x18'),auth[_0x7733('0x9')](),controller[_0x7733('0x19')]);module[_0x7733('0x1a')]=router; \ No newline at end of file +var _0xab3c=['/:id/queues','addQueues','post','addAgents','put','update','destroy','delete','removeQueues','removeAgents','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','getQueues','/:id/users','getAgents'];(function(_0x784a9f,_0x1acdd7){var _0x23c18b=function(_0x3bc9d2){while(--_0x3bc9d2){_0x784a9f['push'](_0x784a9f['shift']());}};_0x23c18b(++_0x1acdd7);}(_0xab3c,0x150));var _0xcab3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab3c[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xcab3('0x0'));var path=require(_0xcab3('0x1'));var timeout=require('connect-timeout');var express=require(_0xcab3('0x2'));var router=express[_0xcab3('0x3')]();var auth=require(_0xcab3('0x4'));var interaction=require(_0xcab3('0x5'));var config=require(_0xcab3('0x6'));var controller=require('./team.controller');router[_0xcab3('0x7')]('/',auth['isAuthenticated'](),controller[_0xcab3('0x8')]);router['get'](_0xcab3('0x9'),auth[_0xcab3('0xa')](),controller['show']);router[_0xcab3('0x7')]('/:id/queues',auth[_0xcab3('0xa')](),controller[_0xcab3('0xb')]);router[_0xcab3('0x7')](_0xcab3('0xc'),auth[_0xcab3('0xa')](),controller[_0xcab3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xcab3('0xe'),auth[_0xcab3('0xa')](),controller[_0xcab3('0xf')]);router[_0xcab3('0x10')](_0xcab3('0xc'),auth['isAuthenticated'](),controller[_0xcab3('0x11')]);router[_0xcab3('0x12')](_0xcab3('0x9'),auth[_0xcab3('0xa')](),controller[_0xcab3('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xcab3('0x14')]);router[_0xcab3('0x15')](_0xcab3('0xe'),auth[_0xcab3('0xa')](),controller[_0xcab3('0x16')]);router[_0xcab3('0x15')](_0xcab3('0xc'),auth[_0xcab3('0xa')](),controller[_0xcab3('0x17')]);module[_0xcab3('0x18')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index e233f1d..45cba1b 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 _0x4782=['STRING','sequelize','exports'];(function(_0x3e6c81,_0xfe637c){var _0x2b5590=function(_0x4b359a){while(--_0x4b359a){_0x3e6c81['push'](_0x3e6c81['shift']());}};_0x2b5590(++_0xfe637c);}(_0x4782,0xc4));var _0x2478=function(_0x11de9c,_0x4adf0d){_0x11de9c=_0x11de9c-0x0;var _0x398935=_0x4782[_0x11de9c];return _0x398935;};'use strict';var Sequelize=require(_0x2478('0x0'));module[_0x2478('0x1')]={'name':{'type':Sequelize[_0x2478('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x2478('0x2')]}}; \ No newline at end of file +var _0x836f=['STRING','name','sequelize','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x836f,0x132));var _0xf836=function(_0x428396,_0x5612fa){_0x428396=_0x428396-0x0;var _0x31b899=_0x836f[_0x428396];return _0x31b899;};'use strict';var Sequelize=require(_0xf836('0x0'));module[_0xf836('0x1')]={'name':{'type':Sequelize[_0xf836('0x2')],'allowNull':![],'unique':_0xf836('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index b4e79e1..758b2a6 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 _0x18f3=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','toLowerCase','Queue','pick','Queues','add','capitalize','ids','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','each','User','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userTeam:save','voice','chat','mail','sms','fax','removeAgents','isArray','userTeam:remove','getAgents','nolimit','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./team.socket','register','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','get','Teams','UserProfileResource','error','name','send','index','Team','rawAttributes','model','keys','filters','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','key','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x18f3,0x19f));var _0x318f=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x18f3[_0x13b8f3];return _0x1a6d06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x318f('0x0'));var rimraf=require(_0x318f('0x1'));var zipdir=require(_0x318f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x318f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x318f('0x4'));var util=require(_0x318f('0x5'));var path=require(_0x318f('0x6'));var sox=require(_0x318f('0x7'));var csv=require('to-csv');var ejs=require(_0x318f('0x8'));var fs=require('fs');var _=require(_0x318f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x318f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x318f('0xb'));var querystring=require(_0x318f('0xc'));var Papa=require(_0x318f('0xd'));var Redis=require(_0x318f('0xe'));var authService=require(_0x318f('0xf'));var qs=require(_0x318f('0x10'));var hardwareService=require(_0x318f('0x11'));var logger=require(_0x318f('0x12'))(_0x318f('0x13'));var utils=require(_0x318f('0x14'));var config=require(_0x318f('0x15'));var db=require(_0x318f('0x16'))['db'];config[_0x318f('0x17')]=_[_0x318f('0x18')](config[_0x318f('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x318f('0x17')]));require(_0x318f('0x19'))[_0x318f('0x1a')](socket);function respondWithStatusCode(_0x419cc4,_0x25d749){_0x25d749=_0x25d749||0xcc;return function(_0x3dc225){if(_0x3dc225){return _0x419cc4[_0x318f('0x1b')](_0x25d749);}return _0x419cc4['status'](_0x25d749)[_0x318f('0x1c')]();};}function respondWithResult(_0x4dbaf4,_0x47cfdb){_0x47cfdb=_0x47cfdb||0xc8;return function(_0x2651ec){if(_0x2651ec){return _0x4dbaf4[_0x318f('0x1d')](_0x47cfdb)['json'](_0x2651ec);}};}function respondWithFilteredResult(_0x594af8,_0x679877){return function(_0x56b0ed){if(_0x56b0ed){var _0x3b0932=_0x56b0ed[_0x318f('0x1e')],_0x1b67e4=_0x679877['offset'],_0x2ff62b=_0x679877[_0x318f('0x1f')]+_0x679877[_0x318f('0x20')],_0x386b33;if(_0x2ff62b>=_0x3b0932){_0x2ff62b=_0x3b0932;_0x386b33=0xc8;}else{_0x386b33=0xce;}_0x594af8[_0x318f('0x1d')](_0x386b33);return _0x594af8[_0x318f('0x21')](_0x318f('0x22'),_0x1b67e4+'-'+_0x2ff62b+'/'+_0x3b0932)[_0x318f('0x23')](_0x56b0ed);}return null;};}function patchUpdates(_0x27dcd1){return function(_0x2b0b06){try{jsonpatch[_0x318f('0x24')](_0x2b0b06,_0x27dcd1,!![]);}catch(_0x5b09a5){return BPromise['reject'](_0x5b09a5);}return _0x2b0b06[_0x318f('0x25')]();};}function saveUpdates(_0x21f42b,_0x39e131){return function(_0x5617f4){if(_0x5617f4){return _0x5617f4[_0x318f('0x26')](_0x21f42b)['then'](function(_0x414236){return _0x414236;});}return null;};}function removeEntity(_0x5237b6,_0x47087a){return function(_0x3c9aaa){if(_0x3c9aaa){return _0x3c9aaa[_0x318f('0x27')]()[_0x318f('0x28')](function(){var _0x1df501=_0x3c9aaa[_0x318f('0x29')]({'plain':!![]});var _0x1a86fb=_0x318f('0x2a');return db[_0x318f('0x2b')][_0x318f('0x27')]({'where':{'type':_0x1a86fb,'resourceId':_0x1df501['id']}})[_0x318f('0x28')](function(){return _0x3c9aaa;});})[_0x318f('0x28')](function(){_0x5237b6[_0x318f('0x1d')](0xcc)[_0x318f('0x1c')]();});}};}function handleEntityNotFound(_0xf2374f,_0x236766){return function(_0x2cab68){if(!_0x2cab68){_0xf2374f[_0x318f('0x1b')](0x194);}return _0x2cab68;};}function handleError(_0x2f326b,_0x3e82aa){_0x3e82aa=_0x3e82aa||0x1f4;return function(_0x1628de){logger[_0x318f('0x2c')](_0x1628de['stack']);if(_0x1628de[_0x318f('0x2d')]){delete _0x1628de['name'];}_0x2f326b[_0x318f('0x1d')](_0x3e82aa)[_0x318f('0x2e')](_0x1628de);};}exports[_0x318f('0x2f')]=function(_0x3fe614,_0x17fcf1){var _0x1547f4={},_0x44cb65={},_0x253e2e={'count':0x0,'rows':[]};var _0x3a2103=db[_0x318f('0x30')][_0x318f('0x31')];_0x44cb65[_0x318f('0x32')]=_[_0x318f('0x33')](_0x3a2103);_0x44cb65['query']=_[_0x318f('0x33')](_0x3fe614['query']);_0x44cb65[_0x318f('0x34')]=_['intersection'](_0x44cb65[_0x318f('0x32')],_0x44cb65[_0x318f('0x35')]);_0x1547f4[_0x318f('0x36')]=_['intersection'](_0x44cb65[_0x318f('0x32')],qs[_0x318f('0x37')](_0x3fe614[_0x318f('0x35')]['fields']));_0x1547f4[_0x318f('0x36')]=_0x1547f4['attributes'][_0x318f('0x38')]?_0x1547f4[_0x318f('0x36')]:_0x44cb65['model'];if(!_0x3fe614['query'][_0x318f('0x39')]('nolimit')){_0x1547f4[_0x318f('0x20')]=qs[_0x318f('0x20')](_0x3fe614[_0x318f('0x35')][_0x318f('0x20')]);_0x1547f4[_0x318f('0x1f')]=qs[_0x318f('0x1f')](_0x3fe614[_0x318f('0x35')][_0x318f('0x1f')]);}_0x1547f4[_0x318f('0x3a')]=qs[_0x318f('0x3b')](_0x3fe614[_0x318f('0x35')][_0x318f('0x3b')]);_0x1547f4[_0x318f('0x3c')]=qs['filters'](_['pick'](_0x3fe614['query'],_0x44cb65[_0x318f('0x34')]));if(_0x3fe614['query'][_0x318f('0x3d')]){_0x1547f4['where']=_[_0x318f('0x3e')](_0x1547f4['where'],{'$or':_[_0x318f('0x3f')](_0x3a2103,function(_0x533feb){if(_0x533feb['type'][_0x318f('0x40')]!=='VIRTUAL'){var _0x35a2d8={};_0x35a2d8[_0x533feb['field']]={'$like':'%'+_0x3fe614[_0x318f('0x35')][_0x318f('0x3d')]+'%'};return _0x35a2d8;}})});}_0x1547f4=_[_0x318f('0x3e')]({},_0x1547f4,_0x3fe614[_0x318f('0x41')]);var _0x4bd04f={'where':_0x1547f4[_0x318f('0x3c')]};return db[_0x318f('0x30')][_0x318f('0x1e')](_0x4bd04f)[_0x318f('0x28')](function(_0x99fdfe){_0x253e2e[_0x318f('0x1e')]=_0x99fdfe;if(_0x3fe614[_0x318f('0x35')][_0x318f('0x42')]){_0x1547f4[_0x318f('0x43')]=[{'all':!![]}];}return db[_0x318f('0x30')][_0x318f('0x44')](_0x1547f4);})[_0x318f('0x28')](function(_0x531059){_0x253e2e[_0x318f('0x45')]=_0x531059;return _0x253e2e;})[_0x318f('0x28')](respondWithFilteredResult(_0x17fcf1,_0x1547f4))[_0x318f('0x46')](handleError(_0x17fcf1,null));};exports[_0x318f('0x47')]=function(_0x6a4876,_0x4f97d8){var _0x5626af={'raw':![],'where':{'id':_0x6a4876[_0x318f('0x48')]['id']}},_0xf69320={};_0xf69320[_0x318f('0x32')]=_['keys'](db[_0x318f('0x30')][_0x318f('0x31')]);_0xf69320[_0x318f('0x35')]=_['keys'](_0x6a4876['query']);_0xf69320[_0x318f('0x34')]=_[_0x318f('0x49')](_0xf69320[_0x318f('0x32')],_0xf69320[_0x318f('0x35')]);_0x5626af[_0x318f('0x36')]=_[_0x318f('0x49')](_0xf69320[_0x318f('0x32')],qs[_0x318f('0x37')](_0x6a4876[_0x318f('0x35')][_0x318f('0x37')]));_0x5626af['attributes']=_0x5626af[_0x318f('0x36')][_0x318f('0x38')]?_0x5626af[_0x318f('0x36')]:_0xf69320[_0x318f('0x32')];if(_0x6a4876[_0x318f('0x35')][_0x318f('0x42')]){_0x5626af['include']=[{'all':!![]}];}_0x5626af=_[_0x318f('0x3e')]({},_0x5626af,_0x6a4876[_0x318f('0x41')]);return db[_0x318f('0x30')][_0x318f('0x4a')](_0x5626af)[_0x318f('0x28')](handleEntityNotFound(_0x4f97d8,null))['then'](respondWithResult(_0x4f97d8,null))[_0x318f('0x46')](handleError(_0x4f97d8,null));};exports[_0x318f('0x4b')]=function(_0x445693,_0x57ed8d){return db['Team']['create'](_0x445693[_0x318f('0x4c')],{})['then'](function(_0x572fb1){var _0x416259=_0x445693[_0x318f('0x4d')]['get']({'plain':!![]});if(!_0x416259)throw new Error(_0x318f('0x4e'));if(_0x416259[_0x318f('0x4f')]==='user'){var _0x212c3a=_0x572fb1[_0x318f('0x29')]({'plain':!![]});var _0x30e8bd=_0x318f('0x2a');return db[_0x318f('0x50')][_0x318f('0x4a')]({'where':{'name':_0x30e8bd,'userProfileId':_0x416259['userProfileId']},'raw':!![]})['then'](function(_0x487d96){if(_0x487d96&&_0x487d96[_0x318f('0x51')]===0x0){return db[_0x318f('0x2b')][_0x318f('0x4b')]({'name':_0x212c3a['name'],'resourceId':_0x212c3a['id'],'type':_0x487d96[_0x318f('0x2d')],'sectionId':_0x487d96['id']},{})[_0x318f('0x28')](function(){return _0x572fb1;});}else{return _0x572fb1;}})[_0x318f('0x46')](function(_0x5752e4){logger['error'](_0x318f('0x52'),_0x5752e4);throw _0x5752e4;});}return _0x572fb1;})[_0x318f('0x28')](respondWithResult(_0x57ed8d,0xc9))[_0x318f('0x46')](handleError(_0x57ed8d,null));};exports[_0x318f('0x26')]=function(_0x472807,_0x577cfd){if(_0x472807[_0x318f('0x4c')]['id']){delete _0x472807[_0x318f('0x4c')]['id'];}return db[_0x318f('0x30')][_0x318f('0x4a')]({'where':{'id':_0x472807[_0x318f('0x48')]['id']}})['then'](handleEntityNotFound(_0x577cfd,null))['then'](saveUpdates(_0x472807[_0x318f('0x4c')],null))[_0x318f('0x28')](respondWithResult(_0x577cfd,null))[_0x318f('0x46')](handleError(_0x577cfd,null));};exports[_0x318f('0x27')]=function(_0x27ef14,_0x25ee14){return db[_0x318f('0x30')][_0x318f('0x4a')]({'where':{'id':_0x27ef14[_0x318f('0x48')]['id']}})[_0x318f('0x28')](handleEntityNotFound(_0x25ee14,null))[_0x318f('0x28')](removeEntity(_0x25ee14,null))['catch'](handleError(_0x25ee14,null));};exports['getQueues']=function(_0x4ca80c,_0x953d33,_0x20d8cd){return db[_0x318f('0x30')][_0x318f('0x53')]({'where':{'id':_0x4ca80c[_0x318f('0x48')]['id']}})['then'](handleEntityNotFound(_0x953d33,null))[_0x318f('0x28')](function(_0x48598c){if(!_0x4ca80c[_0x318f('0x35')][_0x318f('0x54')]||!utils[_0x318f('0x55')](_0x4ca80c[_0x318f('0x35')][_0x318f('0x54')])){throw new db[(_0x318f('0x56'))][(_0x318f('0x57'))](_0x318f('0x58'));}var _0x5db015={};var _0x3af030={};_0x3af030[_0x318f('0x32')]=_['keys'](db[_['capitalize'](_0x4ca80c[_0x318f('0x35')]['channel'][_0x318f('0x59')]())+_0x318f('0x5a')][_0x318f('0x31')]);_0x3af030[_0x318f('0x35')]=_[_0x318f('0x33')](_0x4ca80c[_0x318f('0x35')]);_0x3af030[_0x318f('0x34')]=_[_0x318f('0x49')](_0x3af030['model'],_0x3af030[_0x318f('0x35')]);_0x5db015[_0x318f('0x36')]=_[_0x318f('0x49')](_0x3af030[_0x318f('0x32')],qs['fields'](_0x4ca80c[_0x318f('0x35')][_0x318f('0x37')]));_0x5db015[_0x318f('0x36')]=_0x5db015['attributes'][_0x318f('0x38')]?_0x5db015[_0x318f('0x36')]:_0x3af030[_0x318f('0x32')];_0x5db015[_0x318f('0x20')]=qs[_0x318f('0x20')](_0x4ca80c[_0x318f('0x35')][_0x318f('0x20')]);_0x5db015[_0x318f('0x1f')]=qs[_0x318f('0x1f')](_0x4ca80c[_0x318f('0x35')][_0x318f('0x1f')]);_0x5db015['order']=qs[_0x318f('0x3b')](_0x4ca80c[_0x318f('0x35')][_0x318f('0x3b')]);_0x5db015['where']=qs[_0x318f('0x34')](_[_0x318f('0x5b')](_0x4ca80c[_0x318f('0x35')],_0x3af030[_0x318f('0x34')]));_0x5db015=_[_0x318f('0x3e')]({},_0x5db015,_0x4ca80c[_0x318f('0x41')]);return _0x48598c[_0x318f('0x29')+_['capitalize'](_0x4ca80c[_0x318f('0x35')][_0x318f('0x54')]['toLowerCase']())+_0x318f('0x5c')](_0x5db015);})[_0x318f('0x28')](respondWithResult(_0x953d33,null))[_0x318f('0x46')](handleError(_0x953d33,null));};exports['addQueues']=function(_0x33ccb4,_0x1c235f,_0x496195){return db['Team'][_0x318f('0x53')]({'where':{'id':_0x33ccb4[_0x318f('0x48')]['id']}})[_0x318f('0x28')](function(_0x6b1e38){if(_0x6b1e38){if(!_0x33ccb4['body'][_0x318f('0x54')]||!utils['isValidChannel'](_0x33ccb4[_0x318f('0x4c')][_0x318f('0x54')])){throw new db[(_0x318f('0x56'))][(_0x318f('0x57'))](_0x318f('0x58'));}return _0x6b1e38[_0x318f('0x5d')+_[_0x318f('0x5e')](_0x33ccb4['body']['channel'][_0x318f('0x59')]())+_0x318f('0x5c')](_0x33ccb4[_0x318f('0x4c')][_0x318f('0x5f')]);}return null;})[_0x318f('0x28')](handleEntityNotFound(_0x1c235f,null))[_0x318f('0x28')](respondWithStatusCode(_0x1c235f,null))[_0x318f('0x46')](handleError(_0x1c235f,null));};exports['removeQueues']=function(_0x3d635f,_0x489cae,_0x37be3f){return db[_0x318f('0x30')][_0x318f('0x53')]({'where':{'id':_0x3d635f[_0x318f('0x48')]['id']}})[_0x318f('0x28')](function(_0x44659e){if(_0x44659e){if(!_0x3d635f[_0x318f('0x35')][_0x318f('0x54')]||!utils[_0x318f('0x55')](_0x3d635f['query'][_0x318f('0x54')])){throw new db[(_0x318f('0x56'))][(_0x318f('0x57'))](_0x318f('0x58'));}return _0x44659e[_0x318f('0x60')+_[_0x318f('0x5e')](_0x3d635f[_0x318f('0x35')][_0x318f('0x54')][_0x318f('0x59')]())+'Queues'](_0x3d635f[_0x318f('0x35')][_0x318f('0x5f')]);}return null;})[_0x318f('0x28')](handleEntityNotFound(_0x489cae,null))[_0x318f('0x28')](respondWithStatusCode(_0x489cae,null))['catch'](handleError(_0x489cae,null));};exports[_0x318f('0x61')]=function(_0x3e50c2,_0x2714d4,_0x4489a8){return db['Team'][_0x318f('0x4a')]({'where':{'id':_0x3e50c2[_0x318f('0x48')]['id']}})[_0x318f('0x28')](handleEntityNotFound(_0x2714d4,null))[_0x318f('0x28')](function(_0x2c578d){if(_0x2c578d){var _0x10d486=['Voice',_0x318f('0x62'),_0x318f('0x63'),_0x318f('0x64'),_0x318f('0x65'),_0x318f('0x66')];return BPromise[_0x318f('0x67')](_0x10d486,function(_0x118c7d){return _0x2c578d[_0x318f('0x29')+_0x118c7d+_0x318f('0x5c')]({'attributes':['id',_0x318f('0x2d')]})[_0x318f('0x28')](function(_0x58fdd4){return BPromise['each'](_0x58fdd4,function(_0x1476fd){return _0x1476fd[_0x318f('0x61')](_0x3e50c2[_0x318f('0x4c')][_0x318f('0x5f')])['then'](function(){if(_0x118c7d==='Voice'){return db[_0x318f('0x68')][_0x318f('0x44')]({'where':{'id':_0x3e50c2[_0x318f('0x4c')][_0x318f('0x5f')]},'attributes':['id',_0x318f('0x2d'),_0x318f('0x69'),_0x318f('0x6a'),_0x318f('0x6b')],'raw':!![]})[_0x318f('0x28')](function(_0x2e9826){return BPromise[_0x318f('0x67')](_[_0x318f('0x3d')](_0x2e9826,{'online':0x1}),function(_0x1a34b4){return db[_0x318f('0x6c')]['upsert']({'membername':_0x1a34b4[_0x318f('0x2d')],'UserId':_0x1a34b4['id'],'queue_name':_0x1476fd[_0x318f('0x2d')],'VoiceQueueId':_0x1476fd['id'],'interface':_[_0x318f('0x6d')](_0x1a34b4[_0x318f('0x6b')])?util[_0x318f('0x6e')](_0x318f('0x6f'),_0x1a34b4['name']):_0x1a34b4['interface'],'paused':_0x1a34b4[_0x318f('0x6a')]||![],'penalty':0x0});});});}});});})[_0x318f('0x28')](function(){return _0x2c578d;});})['then'](function(){return _0x2c578d;});}})[_0x318f('0x28')](function(_0x540856){if(_0x540856){return _0x540856['addAgents'](_0x3e50c2[_0x318f('0x4c')][_0x318f('0x5f')],_['omit'](_0x3e50c2[_0x318f('0x4c')],[_0x318f('0x5f'),'id'])||{})['spread'](function(_0x25a292){for(var _0x5a5113=0x0;_0x5a5113<_0x3e50c2[_0x318f('0x4c')]['ids'][_0x318f('0x38')];_0x5a5113+=0x1){socket[_0x318f('0x70')](_0x318f('0x71'),{'UserId':_0x3e50c2[_0x318f('0x4c')][_0x318f('0x5f')][_0x5a5113],'TeamId':_0x3e50c2[_0x318f('0x48')]['id']});}return _0x25a292;});}})[_0x318f('0x28')](respondWithResult(_0x2714d4,null))[_0x318f('0x46')](handleError(_0x2714d4,null));};exports['removeAgents']=function(_0x36440c,_0x53b3d4,_0x4f2c99){return db[_0x318f('0x30')]['find']({'where':{'id':_0x36440c[_0x318f('0x48')]['id']}})['then'](handleEntityNotFound(_0x53b3d4,null))[_0x318f('0x28')](function(_0x5c3488){if(_0x5c3488){return BPromise[_0x318f('0x67')]([_0x318f('0x72'),_0x318f('0x73'),_0x318f('0x74'),_0x318f('0x75'),_0x318f('0x76'),'openchannel'],function(_0x326aa1){return _0x5c3488[_0x318f('0x29')+_['capitalize'](_0x326aa1)+'Queues']({'attributes':['id',_0x318f('0x2d')]})[_0x318f('0x28')](function(_0x4e56bd){return BPromise[_0x318f('0x67')](_0x4e56bd,function(_0xd91147){return _0xd91147[_0x318f('0x77')](_0x36440c[_0x318f('0x35')][_0x318f('0x5f')])[_0x318f('0x28')](function(){if(_0x326aa1==='voice'){return db['UserVoiceQueueRt'][_0x318f('0x27')]({'where':{'VoiceQueueId':_0xd91147['id'],'UserId':_0x36440c[_0x318f('0x35')][_0x318f('0x5f')]}});}});});})[_0x318f('0x28')](function(){return _0x5c3488;});})[_0x318f('0x28')](function(){return _0x5c3488;});}})[_0x318f('0x28')](function(_0x137ea7){if(_0x137ea7){return _0x137ea7[_0x318f('0x77')](_0x36440c[_0x318f('0x35')]['ids'])['then'](function(){if(_[_0x318f('0x78')](_0x36440c[_0x318f('0x35')]['ids'])){for(var _0x5cc871=0x0;_0x5cc871<_0x36440c[_0x318f('0x35')][_0x318f('0x5f')]['length'];_0x5cc871+=0x1){socket[_0x318f('0x70')](_0x318f('0x79'),{'UserId':Number(_0x36440c['query']['ids'][_0x5cc871]),'TeamId':Number(_0x36440c[_0x318f('0x48')]['id'])});}}else{socket[_0x318f('0x70')](_0x318f('0x79'),{'UserId':Number(_0x36440c[_0x318f('0x35')][_0x318f('0x5f')]),'TeamId':Number(_0x36440c[_0x318f('0x48')]['id'])});}});}})[_0x318f('0x28')](respondWithStatusCode(_0x53b3d4,null))[_0x318f('0x46')](handleError(_0x53b3d4,null));};exports['getAgents']=function(_0x49dddb,_0x5f2c9b,_0x1a9952){var _0x4da86a={};var _0x2e0ad2={};var _0x2f78be;var _0x10b0f8;return db[_0x318f('0x30')]['findOne']({'where':{'id':_0x49dddb[_0x318f('0x48')]['id']}})[_0x318f('0x28')](handleEntityNotFound(_0x5f2c9b,null))[_0x318f('0x28')](function(_0x23f637){if(_0x23f637){_0x2f78be=_0x23f637;_0x2e0ad2['model']=_[_0x318f('0x33')](db[_0x318f('0x68')]['rawAttributes']);_0x2e0ad2['query']=_['keys'](_0x49dddb[_0x318f('0x35')]);_0x2e0ad2[_0x318f('0x34')]=_[_0x318f('0x49')](_0x2e0ad2[_0x318f('0x32')],_0x2e0ad2[_0x318f('0x35')]);_0x4da86a[_0x318f('0x36')]=_[_0x318f('0x49')](_0x2e0ad2[_0x318f('0x32')],qs[_0x318f('0x37')](_0x49dddb['query'][_0x318f('0x37')]));_0x4da86a[_0x318f('0x36')]=_0x4da86a[_0x318f('0x36')][_0x318f('0x38')]?_0x4da86a[_0x318f('0x36')]:_0x2e0ad2[_0x318f('0x32')];_0x4da86a['order']=qs['sort'](_0x49dddb[_0x318f('0x35')][_0x318f('0x3b')]);_0x4da86a[_0x318f('0x3c')]=qs[_0x318f('0x34')](_[_0x318f('0x5b')](_0x49dddb[_0x318f('0x35')],_0x2e0ad2[_0x318f('0x34')]));if(_0x49dddb[_0x318f('0x35')]['filter']){_0x4da86a[_0x318f('0x3c')]=_[_0x318f('0x3e')](_0x4da86a[_0x318f('0x3c')],{'$or':_[_0x318f('0x3f')](_0x4da86a['attributes'],function(_0x37be22){var _0x366044={};_0x366044[_0x37be22]={'$like':'%'+_0x49dddb[_0x318f('0x35')]['filter']+'%'};return _0x366044;})});}_0x4da86a=_[_0x318f('0x3e')]({},_0x4da86a,_0x49dddb[_0x318f('0x41')]);return _0x2f78be[_0x318f('0x7a')](_0x4da86a);}})[_0x318f('0x28')](function(_0x212788){if(_0x212788){_0x10b0f8=_0x212788[_0x318f('0x38')];if(!_0x49dddb['query'][_0x318f('0x39')](_0x318f('0x7b'))){_0x4da86a[_0x318f('0x20')]=qs[_0x318f('0x20')](_0x49dddb[_0x318f('0x35')][_0x318f('0x20')]);_0x4da86a[_0x318f('0x1f')]=qs[_0x318f('0x1f')](_0x49dddb[_0x318f('0x35')][_0x318f('0x1f')]);}return _0x2f78be['getAgents'](_0x4da86a);}})[_0x318f('0x28')](function(_0x377a15){if(_0x377a15){return _0x377a15?{'count':_0x10b0f8,'rows':_0x377a15}:null;}})[_0x318f('0x28')](respondWithResult(_0x5f2c9b,null))['catch'](handleError(_0x5f2c9b,null));}; \ No newline at end of file +var _0x22b4=['omit','spread','emit','removeAgents','voice','chat','fax','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./team.socket','register','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','get','Teams','UserProfileResource','end','error','stack','name','send','index','Team','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','key','VIRTUAL','options','count','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','getQueues','findOne','channel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','Sequelize','add','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','each','User','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s'];(function(_0x3450af,_0x56beae){var _0x489a90=function(_0x451db1){while(--_0x451db1){_0x3450af['push'](_0x3450af['shift']());}};_0x489a90(++_0x56beae);}(_0x22b4,0x8b));var _0x422b=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x22b4[_0x49b207];return _0x2dc8fa;};'use strict';var pdf=require(_0x422b('0x0'));var emlformat=require(_0x422b('0x1'));var rimraf=require(_0x422b('0x2'));var zipdir=require(_0x422b('0x3'));var jsonpatch=require(_0x422b('0x4'));var rp=require(_0x422b('0x5'));var moment=require('moment');var BPromise=require(_0x422b('0x6'));var Mustache=require(_0x422b('0x7'));var util=require('util');var path=require(_0x422b('0x8'));var sox=require(_0x422b('0x9'));var csv=require(_0x422b('0xa'));var ejs=require(_0x422b('0xb'));var fs=require('fs');var _=require(_0x422b('0xc'));var squel=require(_0x422b('0xd'));var crypto=require('crypto');var jsforce=require(_0x422b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x422b('0xa'));var querystring=require(_0x422b('0xf'));var Papa=require(_0x422b('0x10'));var Redis=require(_0x422b('0x11'));var authService=require(_0x422b('0x12'));var qs=require(_0x422b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x422b('0x14'))(_0x422b('0x15'));var utils=require(_0x422b('0x16'));var config=require(_0x422b('0x17'));var db=require(_0x422b('0x18'))['db'];config[_0x422b('0x19')]=_[_0x422b('0x1a')](config[_0x422b('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x422b('0x19')]));require(_0x422b('0x1b'))[_0x422b('0x1c')](socket);function respondWithStatusCode(_0x803900,_0x2eadaa){_0x2eadaa=_0x2eadaa||0xcc;return function(_0x310622){if(_0x310622){return _0x803900[_0x422b('0x1d')](_0x2eadaa);}return _0x803900[_0x422b('0x1e')](_0x2eadaa)['end']();};}function respondWithResult(_0x1e40eb,_0x50a914){_0x50a914=_0x50a914||0xc8;return function(_0x3a98d6){if(_0x3a98d6){return _0x1e40eb[_0x422b('0x1e')](_0x50a914)[_0x422b('0x1f')](_0x3a98d6);}};}function respondWithFilteredResult(_0x2718e3,_0x328f45){return function(_0x433d0b){if(_0x433d0b){var _0x5aa006=_0x433d0b['count'],_0x338cf4=_0x328f45[_0x422b('0x20')],_0x29bef6=_0x328f45[_0x422b('0x20')]+_0x328f45[_0x422b('0x21')],_0x1fdb00;if(_0x29bef6>=_0x5aa006){_0x29bef6=_0x5aa006;_0x1fdb00=0xc8;}else{_0x1fdb00=0xce;}_0x2718e3[_0x422b('0x1e')](_0x1fdb00);return _0x2718e3[_0x422b('0x22')](_0x422b('0x23'),_0x338cf4+'-'+_0x29bef6+'/'+_0x5aa006)[_0x422b('0x1f')](_0x433d0b);}return null;};}function patchUpdates(_0x51049c){return function(_0x38665f){try{jsonpatch['apply'](_0x38665f,_0x51049c,!![]);}catch(_0x542b3c){return BPromise[_0x422b('0x24')](_0x542b3c);}return _0x38665f['save']();};}function saveUpdates(_0x44f98c,_0x5d1582){return function(_0x3f7619){if(_0x3f7619){return _0x3f7619[_0x422b('0x25')](_0x44f98c)[_0x422b('0x26')](function(_0x5d0f47){return _0x5d0f47;});}return null;};}function removeEntity(_0x394c50,_0x21fb07){return function(_0x3c34db){if(_0x3c34db){return _0x3c34db[_0x422b('0x27')]()[_0x422b('0x26')](function(){var _0x3e4c83=_0x3c34db[_0x422b('0x28')]({'plain':!![]});var _0x1f7d44=_0x422b('0x29');return db[_0x422b('0x2a')][_0x422b('0x27')]({'where':{'type':_0x1f7d44,'resourceId':_0x3e4c83['id']}})['then'](function(){return _0x3c34db;});})[_0x422b('0x26')](function(){_0x394c50[_0x422b('0x1e')](0xcc)[_0x422b('0x2b')]();});}};}function handleEntityNotFound(_0x5b375f,_0x48d2d9){return function(_0x49e645){if(!_0x49e645){_0x5b375f[_0x422b('0x1d')](0x194);}return _0x49e645;};}function handleError(_0x33fb06,_0x556d53){_0x556d53=_0x556d53||0x1f4;return function(_0xf19907){logger[_0x422b('0x2c')](_0xf19907[_0x422b('0x2d')]);if(_0xf19907[_0x422b('0x2e')]){delete _0xf19907[_0x422b('0x2e')];}_0x33fb06[_0x422b('0x1e')](_0x556d53)[_0x422b('0x2f')](_0xf19907);};}exports[_0x422b('0x30')]=function(_0x51c408,_0x55779d){var _0xb8eaaa={},_0x429cff={},_0x1a73c6={'count':0x0,'rows':[]};var _0x58d571=db[_0x422b('0x31')][_0x422b('0x32')];_0x429cff['model']=_[_0x422b('0x33')](_0x58d571);_0x429cff[_0x422b('0x34')]=_[_0x422b('0x33')](_0x51c408[_0x422b('0x34')]);_0x429cff[_0x422b('0x35')]=_[_0x422b('0x36')](_0x429cff[_0x422b('0x37')],_0x429cff[_0x422b('0x34')]);_0xb8eaaa[_0x422b('0x38')]=_[_0x422b('0x36')](_0x429cff[_0x422b('0x37')],qs[_0x422b('0x39')](_0x51c408['query'][_0x422b('0x39')]));_0xb8eaaa[_0x422b('0x38')]=_0xb8eaaa['attributes'][_0x422b('0x3a')]?_0xb8eaaa[_0x422b('0x38')]:_0x429cff[_0x422b('0x37')];if(!_0x51c408[_0x422b('0x34')][_0x422b('0x3b')](_0x422b('0x3c'))){_0xb8eaaa[_0x422b('0x21')]=qs[_0x422b('0x21')](_0x51c408[_0x422b('0x34')][_0x422b('0x21')]);_0xb8eaaa['offset']=qs[_0x422b('0x20')](_0x51c408[_0x422b('0x34')][_0x422b('0x20')]);}_0xb8eaaa[_0x422b('0x3d')]=qs[_0x422b('0x3e')](_0x51c408[_0x422b('0x34')][_0x422b('0x3e')]);_0xb8eaaa[_0x422b('0x3f')]=qs[_0x422b('0x35')](_[_0x422b('0x40')](_0x51c408['query'],_0x429cff[_0x422b('0x35')]));if(_0x51c408[_0x422b('0x34')][_0x422b('0x41')]){_0xb8eaaa[_0x422b('0x3f')]=_[_0x422b('0x42')](_0xb8eaaa[_0x422b('0x3f')],{'$or':_[_0x422b('0x43')](_0x58d571,function(_0x3a0c12){if(_0x3a0c12['type'][_0x422b('0x44')]!==_0x422b('0x45')){var _0xc37ba7={};_0xc37ba7[_0x3a0c12['field']]={'$like':'%'+_0x51c408[_0x422b('0x34')][_0x422b('0x41')]+'%'};return _0xc37ba7;}})});}_0xb8eaaa=_[_0x422b('0x42')]({},_0xb8eaaa,_0x51c408[_0x422b('0x46')]);var _0x219d5c={'where':_0xb8eaaa[_0x422b('0x3f')]};return db[_0x422b('0x31')][_0x422b('0x47')](_0x219d5c)[_0x422b('0x26')](function(_0xc06469){_0x1a73c6[_0x422b('0x47')]=_0xc06469;if(_0x51c408[_0x422b('0x34')][_0x422b('0x48')]){_0xb8eaaa[_0x422b('0x49')]=[{'all':!![]}];}return db[_0x422b('0x31')][_0x422b('0x4a')](_0xb8eaaa);})[_0x422b('0x26')](function(_0x386eaa){_0x1a73c6[_0x422b('0x4b')]=_0x386eaa;return _0x1a73c6;})['then'](respondWithFilteredResult(_0x55779d,_0xb8eaaa))[_0x422b('0x4c')](handleError(_0x55779d,null));};exports[_0x422b('0x4d')]=function(_0x40d3f8,_0x239cf9){var _0x35853e={'raw':![],'where':{'id':_0x40d3f8[_0x422b('0x4e')]['id']}},_0x45862b={};_0x45862b[_0x422b('0x37')]=_['keys'](db[_0x422b('0x31')][_0x422b('0x32')]);_0x45862b[_0x422b('0x34')]=_[_0x422b('0x33')](_0x40d3f8[_0x422b('0x34')]);_0x45862b[_0x422b('0x35')]=_['intersection'](_0x45862b[_0x422b('0x37')],_0x45862b[_0x422b('0x34')]);_0x35853e[_0x422b('0x38')]=_[_0x422b('0x36')](_0x45862b[_0x422b('0x37')],qs[_0x422b('0x39')](_0x40d3f8[_0x422b('0x34')][_0x422b('0x39')]));_0x35853e[_0x422b('0x38')]=_0x35853e[_0x422b('0x38')][_0x422b('0x3a')]?_0x35853e['attributes']:_0x45862b[_0x422b('0x37')];if(_0x40d3f8[_0x422b('0x34')][_0x422b('0x48')]){_0x35853e['include']=[{'all':!![]}];}_0x35853e=_[_0x422b('0x42')]({},_0x35853e,_0x40d3f8[_0x422b('0x46')]);return db[_0x422b('0x31')][_0x422b('0x4f')](_0x35853e)['then'](handleEntityNotFound(_0x239cf9,null))['then'](respondWithResult(_0x239cf9,null))[_0x422b('0x4c')](handleError(_0x239cf9,null));};exports[_0x422b('0x50')]=function(_0x26ac0,_0x5b70de){return db[_0x422b('0x31')][_0x422b('0x50')](_0x26ac0[_0x422b('0x51')],{})[_0x422b('0x26')](function(_0x4db99b){var _0x427f2e=_0x26ac0[_0x422b('0x52')]['get']({'plain':!![]});if(!_0x427f2e)throw new Error(_0x422b('0x53'));if(_0x427f2e[_0x422b('0x54')]===_0x422b('0x52')){var _0x3b3a92=_0x4db99b[_0x422b('0x28')]({'plain':!![]});var _0x530234='Teams';return db[_0x422b('0x55')][_0x422b('0x4f')]({'where':{'name':_0x530234,'userProfileId':_0x427f2e[_0x422b('0x56')]},'raw':!![]})['then'](function(_0x23f45d){if(_0x23f45d&&_0x23f45d[_0x422b('0x57')]===0x0){return db[_0x422b('0x2a')][_0x422b('0x50')]({'name':_0x3b3a92[_0x422b('0x2e')],'resourceId':_0x3b3a92['id'],'type':_0x23f45d['name'],'sectionId':_0x23f45d['id']},{})['then'](function(){return _0x4db99b;});}else{return _0x4db99b;}})[_0x422b('0x4c')](function(_0x222220){logger[_0x422b('0x2c')](_0x422b('0x58'),_0x222220);throw _0x222220;});}return _0x4db99b;})[_0x422b('0x26')](respondWithResult(_0x5b70de,0xc9))[_0x422b('0x4c')](handleError(_0x5b70de,null));};exports[_0x422b('0x25')]=function(_0x181f07,_0x36d650){if(_0x181f07['body']['id']){delete _0x181f07['body']['id'];}return db['Team'][_0x422b('0x4f')]({'where':{'id':_0x181f07['params']['id']}})['then'](handleEntityNotFound(_0x36d650,null))[_0x422b('0x26')](saveUpdates(_0x181f07[_0x422b('0x51')],null))[_0x422b('0x26')](respondWithResult(_0x36d650,null))[_0x422b('0x4c')](handleError(_0x36d650,null));};exports[_0x422b('0x27')]=function(_0x1797a9,_0x841d5){return db[_0x422b('0x31')][_0x422b('0x4f')]({'where':{'id':_0x1797a9[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x841d5,null))['then'](removeEntity(_0x841d5,null))[_0x422b('0x4c')](handleError(_0x841d5,null));};exports[_0x422b('0x59')]=function(_0xfa0b09,_0x186779,_0x22b617){return db[_0x422b('0x31')][_0x422b('0x5a')]({'where':{'id':_0xfa0b09[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x186779,null))['then'](function(_0x7d8316){if(!_0xfa0b09[_0x422b('0x34')][_0x422b('0x5b')]||!utils['isValidChannel'](_0xfa0b09[_0x422b('0x34')][_0x422b('0x5b')])){throw new db['Sequelize'][(_0x422b('0x5c'))](_0x422b('0x5d'));}var _0x46b99f={};var _0x7bce93={};_0x7bce93[_0x422b('0x37')]=_['keys'](db[_[_0x422b('0x5e')](_0xfa0b09['query'][_0x422b('0x5b')][_0x422b('0x5f')]())+_0x422b('0x60')][_0x422b('0x32')]);_0x7bce93['query']=_[_0x422b('0x33')](_0xfa0b09[_0x422b('0x34')]);_0x7bce93[_0x422b('0x35')]=_[_0x422b('0x36')](_0x7bce93[_0x422b('0x37')],_0x7bce93['query']);_0x46b99f[_0x422b('0x38')]=_['intersection'](_0x7bce93['model'],qs[_0x422b('0x39')](_0xfa0b09['query']['fields']));_0x46b99f[_0x422b('0x38')]=_0x46b99f[_0x422b('0x38')]['length']?_0x46b99f[_0x422b('0x38')]:_0x7bce93[_0x422b('0x37')];_0x46b99f['limit']=qs[_0x422b('0x21')](_0xfa0b09['query'][_0x422b('0x21')]);_0x46b99f[_0x422b('0x20')]=qs[_0x422b('0x20')](_0xfa0b09[_0x422b('0x34')][_0x422b('0x20')]);_0x46b99f['order']=qs[_0x422b('0x3e')](_0xfa0b09[_0x422b('0x34')][_0x422b('0x3e')]);_0x46b99f[_0x422b('0x3f')]=qs[_0x422b('0x35')](_['pick'](_0xfa0b09[_0x422b('0x34')],_0x7bce93[_0x422b('0x35')]));_0x46b99f=_[_0x422b('0x42')]({},_0x46b99f,_0xfa0b09[_0x422b('0x46')]);return _0x7d8316[_0x422b('0x28')+_['capitalize'](_0xfa0b09[_0x422b('0x34')][_0x422b('0x5b')][_0x422b('0x5f')]())+_0x422b('0x61')](_0x46b99f);})[_0x422b('0x26')](respondWithResult(_0x186779,null))[_0x422b('0x4c')](handleError(_0x186779,null));};exports[_0x422b('0x62')]=function(_0x3c28c2,_0x5247fc,_0x46010f){return db[_0x422b('0x31')][_0x422b('0x5a')]({'where':{'id':_0x3c28c2[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](function(_0x3b9c74){if(_0x3b9c74){if(!_0x3c28c2[_0x422b('0x51')][_0x422b('0x5b')]||!utils[_0x422b('0x63')](_0x3c28c2[_0x422b('0x51')][_0x422b('0x5b')])){throw new db[(_0x422b('0x64'))][(_0x422b('0x5c'))](_0x422b('0x5d'));}return _0x3b9c74[_0x422b('0x65')+_[_0x422b('0x5e')](_0x3c28c2[_0x422b('0x51')][_0x422b('0x5b')]['toLowerCase']())+_0x422b('0x61')](_0x3c28c2[_0x422b('0x51')][_0x422b('0x66')]);}return null;})[_0x422b('0x26')](handleEntityNotFound(_0x5247fc,null))['then'](respondWithStatusCode(_0x5247fc,null))['catch'](handleError(_0x5247fc,null));};exports[_0x422b('0x67')]=function(_0xa76faf,_0x42c934,_0x585c30){return db[_0x422b('0x31')]['findOne']({'where':{'id':_0xa76faf[_0x422b('0x4e')]['id']}})['then'](function(_0x562ab2){if(_0x562ab2){if(!_0xa76faf[_0x422b('0x34')][_0x422b('0x5b')]||!utils[_0x422b('0x63')](_0xa76faf[_0x422b('0x34')][_0x422b('0x5b')])){throw new db[(_0x422b('0x64'))]['ValidationError']('Unknown\x20channel');}return _0x562ab2[_0x422b('0x68')+_[_0x422b('0x5e')](_0xa76faf['query'][_0x422b('0x5b')]['toLowerCase']())+_0x422b('0x61')](_0xa76faf['query'][_0x422b('0x66')]);}return null;})['then'](handleEntityNotFound(_0x42c934,null))[_0x422b('0x26')](respondWithStatusCode(_0x42c934,null))['catch'](handleError(_0x42c934,null));};exports[_0x422b('0x69')]=function(_0x1702d5,_0x740647,_0x274538){return db[_0x422b('0x31')][_0x422b('0x4f')]({'where':{'id':_0x1702d5[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x740647,null))[_0x422b('0x26')](function(_0x2b04d1){if(_0x2b04d1){var _0x4e3545=['Voice',_0x422b('0x6a'),_0x422b('0x6b'),_0x422b('0x6c'),_0x422b('0x6d'),_0x422b('0x6e')];return BPromise[_0x422b('0x6f')](_0x4e3545,function(_0x4e8047){return _0x2b04d1[_0x422b('0x28')+_0x4e8047+_0x422b('0x61')]({'attributes':['id','name']})['then'](function(_0x231724){return BPromise['each'](_0x231724,function(_0x5da4d0){return _0x5da4d0[_0x422b('0x69')](_0x1702d5[_0x422b('0x51')][_0x422b('0x66')])[_0x422b('0x26')](function(){if(_0x4e8047==='Voice'){return db[_0x422b('0x70')][_0x422b('0x4a')]({'where':{'id':_0x1702d5[_0x422b('0x51')][_0x422b('0x66')]},'attributes':['id',_0x422b('0x2e'),_0x422b('0x71'),_0x422b('0x72'),_0x422b('0x73')],'raw':!![]})[_0x422b('0x26')](function(_0x3ee2bd){return BPromise[_0x422b('0x6f')](_[_0x422b('0x41')](_0x3ee2bd,{'online':0x1}),function(_0x52cd7a){return db[_0x422b('0x74')][_0x422b('0x75')]({'membername':_0x52cd7a[_0x422b('0x2e')],'UserId':_0x52cd7a['id'],'queue_name':_0x5da4d0[_0x422b('0x2e')],'VoiceQueueId':_0x5da4d0['id'],'interface':_[_0x422b('0x76')](_0x52cd7a[_0x422b('0x73')])?util[_0x422b('0x77')](_0x422b('0x78'),_0x52cd7a[_0x422b('0x2e')]):_0x52cd7a[_0x422b('0x73')],'paused':_0x52cd7a[_0x422b('0x72')]||![],'penalty':0x0});});});}});});})[_0x422b('0x26')](function(){return _0x2b04d1;});})[_0x422b('0x26')](function(){return _0x2b04d1;});}})[_0x422b('0x26')](function(_0xecafb0){if(_0xecafb0){return _0xecafb0[_0x422b('0x69')](_0x1702d5['body'][_0x422b('0x66')],_[_0x422b('0x79')](_0x1702d5['body'],[_0x422b('0x66'),'id'])||{})[_0x422b('0x7a')](function(_0x42dbad){for(var _0x3a1371=0x0;_0x3a1371<_0x1702d5[_0x422b('0x51')][_0x422b('0x66')][_0x422b('0x3a')];_0x3a1371+=0x1){socket[_0x422b('0x7b')]('userTeam:save',{'UserId':_0x1702d5[_0x422b('0x51')][_0x422b('0x66')][_0x3a1371],'TeamId':_0x1702d5[_0x422b('0x4e')]['id']});}return _0x42dbad;});}})[_0x422b('0x26')](respondWithResult(_0x740647,null))[_0x422b('0x4c')](handleError(_0x740647,null));};exports[_0x422b('0x7c')]=function(_0x3bfe00,_0xa1ce61,_0x4ae1ca){return db['Team'][_0x422b('0x4f')]({'where':{'id':_0x3bfe00[_0x422b('0x4e')]['id']}})[_0x422b('0x26')](handleEntityNotFound(_0xa1ce61,null))['then'](function(_0x535de9){if(_0x535de9){return BPromise[_0x422b('0x6f')]([_0x422b('0x7d'),_0x422b('0x7e'),'mail','sms',_0x422b('0x7f'),'openchannel'],function(_0x3b6f6c){return _0x535de9[_0x422b('0x28')+_[_0x422b('0x5e')](_0x3b6f6c)+_0x422b('0x61')]({'attributes':['id',_0x422b('0x2e')]})[_0x422b('0x26')](function(_0x5947c5){return BPromise[_0x422b('0x6f')](_0x5947c5,function(_0x1c8e9d){return _0x1c8e9d[_0x422b('0x7c')](_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')])['then'](function(){if(_0x3b6f6c===_0x422b('0x7d')){return db[_0x422b('0x74')]['destroy']({'where':{'VoiceQueueId':_0x1c8e9d['id'],'UserId':_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')]}});}});});})[_0x422b('0x26')](function(){return _0x535de9;});})[_0x422b('0x26')](function(){return _0x535de9;});}})[_0x422b('0x26')](function(_0x705a04){if(_0x705a04){return _0x705a04['removeAgents'](_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')])['then'](function(){if(_['isArray'](_0x3bfe00['query']['ids'])){for(var _0x2a1333=0x0;_0x2a1333<_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')]['length'];_0x2a1333+=0x1){socket['emit'](_0x422b('0x80'),{'UserId':Number(_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')][_0x2a1333]),'TeamId':Number(_0x3bfe00[_0x422b('0x4e')]['id'])});}}else{socket[_0x422b('0x7b')](_0x422b('0x80'),{'UserId':Number(_0x3bfe00[_0x422b('0x34')][_0x422b('0x66')]),'TeamId':Number(_0x3bfe00[_0x422b('0x4e')]['id'])});}});}})[_0x422b('0x26')](respondWithStatusCode(_0xa1ce61,null))[_0x422b('0x4c')](handleError(_0xa1ce61,null));};exports['getAgents']=function(_0x11518b,_0x571686,_0x4d956e){var _0x5e8bbd={};var _0x1e774a={};var _0x119b72;var _0x30db8e;return db[_0x422b('0x31')]['findOne']({'where':{'id':_0x11518b['params']['id']}})[_0x422b('0x26')](handleEntityNotFound(_0x571686,null))[_0x422b('0x26')](function(_0xa65fa8){if(_0xa65fa8){_0x119b72=_0xa65fa8;_0x1e774a[_0x422b('0x37')]=_[_0x422b('0x33')](db[_0x422b('0x70')][_0x422b('0x32')]);_0x1e774a[_0x422b('0x34')]=_['keys'](_0x11518b[_0x422b('0x34')]);_0x1e774a[_0x422b('0x35')]=_[_0x422b('0x36')](_0x1e774a[_0x422b('0x37')],_0x1e774a[_0x422b('0x34')]);_0x5e8bbd[_0x422b('0x38')]=_[_0x422b('0x36')](_0x1e774a[_0x422b('0x37')],qs[_0x422b('0x39')](_0x11518b[_0x422b('0x34')][_0x422b('0x39')]));_0x5e8bbd['attributes']=_0x5e8bbd[_0x422b('0x38')]['length']?_0x5e8bbd[_0x422b('0x38')]:_0x1e774a[_0x422b('0x37')];_0x5e8bbd[_0x422b('0x3d')]=qs[_0x422b('0x3e')](_0x11518b[_0x422b('0x34')]['sort']);_0x5e8bbd[_0x422b('0x3f')]=qs['filters'](_[_0x422b('0x40')](_0x11518b[_0x422b('0x34')],_0x1e774a[_0x422b('0x35')]));if(_0x11518b[_0x422b('0x34')][_0x422b('0x41')]){_0x5e8bbd[_0x422b('0x3f')]=_['merge'](_0x5e8bbd[_0x422b('0x3f')],{'$or':_[_0x422b('0x43')](_0x5e8bbd[_0x422b('0x38')],function(_0x31ec57){var _0x3d160a={};_0x3d160a[_0x31ec57]={'$like':'%'+_0x11518b[_0x422b('0x34')][_0x422b('0x41')]+'%'};return _0x3d160a;})});}_0x5e8bbd=_[_0x422b('0x42')]({},_0x5e8bbd,_0x11518b['options']);return _0x119b72[_0x422b('0x81')](_0x5e8bbd);}})[_0x422b('0x26')](function(_0x50f2b6){if(_0x50f2b6){_0x30db8e=_0x50f2b6[_0x422b('0x3a')];if(!_0x11518b[_0x422b('0x34')][_0x422b('0x3b')](_0x422b('0x3c'))){_0x5e8bbd[_0x422b('0x21')]=qs[_0x422b('0x21')](_0x11518b['query'][_0x422b('0x21')]);_0x5e8bbd[_0x422b('0x20')]=qs['offset'](_0x11518b['query']['offset']);}return _0x119b72['getAgents'](_0x5e8bbd);}})[_0x422b('0x26')](function(_0x369c08){if(_0x369c08){return _0x369c08?{'count':_0x30db8e,'rows':_0x369c08}:null;}})[_0x422b('0x26')](respondWithResult(_0x571686,null))[_0x422b('0x4c')](handleError(_0x571686,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index f612980..d3c8d45 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 _0x4dd8=['exports','events','../../mysqldb','Team','setMaxListeners','save','emit','hasOwnProperty','hook'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4dd8,0x1e7));var _0x84dd=function(_0x55f42c,_0x2d652d){_0x55f42c=_0x55f42c-0x0;var _0x45eb0f=_0x4dd8[_0x55f42c];return _0x45eb0f;};'use strict';var EventEmitter=require(_0x84dd('0x0'));var Team=require(_0x84dd('0x1'))['db'][_0x84dd('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x84dd('0x3')](0x0);var events={'afterCreate':_0x84dd('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb8349c){return function(_0x5dd377,_0x36f1a2,_0x271f33){TeamEvents[_0x84dd('0x5')](_0xb8349c+':'+_0x5dd377['id'],_0x5dd377);TeamEvents[_0x84dd('0x5')](_0xb8349c,_0x5dd377);_0x271f33(null);};}for(var e in events){if(events[_0x84dd('0x6')](e)){var event=events[e];Team[_0x84dd('0x7')](e,emitEvent(event));}}module[_0x84dd('0x8')]=TeamEvents; \ No newline at end of file +var _0xf634=['remove','emit','hasOwnProperty','exports','save','update'];(function(_0x346252,_0x59b4c4){var _0xe534a=function(_0x5a9a62){while(--_0x5a9a62){_0x346252['push'](_0x346252['shift']());}};_0xe534a(++_0x59b4c4);}(_0xf634,0x7c));var _0x4f63=function(_0x4d48d7,_0xdc8e0c){_0x4d48d7=_0x4d48d7-0x0;var _0x1c0b2f=_0xf634[_0x4d48d7];return _0x1c0b2f;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4f63('0x0'),'afterUpdate':_0x4f63('0x1'),'afterDestroy':_0x4f63('0x2')};function emitEvent(_0x30f8b4){return function(_0x3d14b3,_0x172bf8,_0x5c513d){TeamEvents[_0x4f63('0x3')](_0x30f8b4+':'+_0x3d14b3['id'],_0x3d14b3);TeamEvents['emit'](_0x30f8b4,_0x3d14b3);_0x5c513d(null);};}for(var e in events){if(events[_0x4f63('0x4')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0x4f63('0x5')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 86162f9..4e62e65 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 _0xab25=['./team.attributes','exports','define','Team','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0xab25,0x11c));var _0x5ab2=function(_0x59328b,_0x3e1186){_0x59328b=_0x59328b-0x0;var _0x2593ea=_0xab25[_0x59328b];return _0x2593ea;};'use strict';var _=require('lodash');var util=require(_0x5ab2('0x0'));var logger=require('../../config/logger')(_0x5ab2('0x1'));var moment=require(_0x5ab2('0x2'));var BPromise=require(_0x5ab2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5ab2('0x4'));var config=require(_0x5ab2('0x5'));var attributes=require(_0x5ab2('0x6'));module[_0x5ab2('0x7')]=function(_0x107bf7,_0x34bd79){return _0x107bf7[_0x5ab2('0x8')](_0x5ab2('0x9'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e23=['api','bluebird','path','rimraf','../../config/environment','define','Team','teams','lodash','util','../../config/logger'];(function(_0xb81bad,_0x36a4df){var _0x4ebc82=function(_0x3f8581){while(--_0x3f8581){_0xb81bad['push'](_0xb81bad['shift']());}};_0x4ebc82(++_0x36a4df);}(_0x5e23,0xd9));var _0x35e2=function(_0x19d587,_0x24fb5b){_0x19d587=_0x19d587-0x0;var _0x254247=_0x5e23[_0x19d587];return _0x254247;};'use strict';var _=require(_0x35e2('0x0'));var util=require(_0x35e2('0x1'));var logger=require(_0x35e2('0x2'))(_0x35e2('0x3'));var moment=require('moment');var BPromise=require(_0x35e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x35e2('0x5'));var rimraf=require(_0x35e2('0x6'));var config=require(_0x35e2('0x7'));var attributes=require('./team.attributes');module['exports']=function(_0xe4b37,_0x520b05){return _0xe4b37[_0x35e2('0x8')](_0x35e2('0x9'),attributes,{'tableName':_0x35e2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 0683f33..26f17b3 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 _0xd4de=['Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','then','info'];(function(_0xdad237,_0x361a1d){var _0x15c575=function(_0x8db2f6){while(--_0x8db2f6){_0xdad237['push'](_0xdad237['shift']());}};_0x15c575(++_0x361a1d);}(_0xd4de,0x18e));var _0xed4d=function(_0x1131f8,_0x4d267f){_0x1131f8=_0x1131f8-0x0;var _0x43cec8=_0xd4de[_0x1131f8];return _0x43cec8;};'use strict';var _=require(_0xed4d('0x0'));var util=require('util');var moment=require(_0xed4d('0x1'));var BPromise=require(_0xed4d('0x2'));var rs=require(_0xed4d('0x3'));var fs=require('fs');var Redis=require(_0xed4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed4d('0x5'));var logger=require(_0xed4d('0x6'))(_0xed4d('0x7'));var config=require('../../config/environment');var jayson=require(_0xed4d('0x8'));var client=jayson[_0xed4d('0x9')][_0xed4d('0xa')]({'port':0x232a});config[_0xed4d('0xb')]=_['defaults'](config[_0xed4d('0xb')],{'host':_0xed4d('0xc'),'port':0x18eb});var socket=require(_0xed4d('0xd'))(new Redis(config[_0xed4d('0xb')]));require(_0xed4d('0xe'))[_0xed4d('0xf')](socket);function respondWithRpcPromise(_0xfb0eb6,_0x3a01df,_0x4b9c17){return new BPromise(function(_0x2052a1,_0x43ab67){return client['request'](_0xfb0eb6,_0x4b9c17)[_0xed4d('0x10')](function(_0x3b0445){logger[_0xed4d('0x11')](_0xed4d('0x12'),_0x3a01df,_0xed4d('0x13'));logger['debug'](_0xed4d('0x14'),_0x3a01df,_0xed4d('0x13'),JSON[_0xed4d('0x15')](_0x3b0445));if(_0x3b0445[_0xed4d('0x16')]){if(_0x3b0445[_0xed4d('0x16')][_0xed4d('0x17')]===0x1f4){logger[_0xed4d('0x16')](_0xed4d('0x12'),_0x3a01df,_0x3b0445[_0xed4d('0x16')][_0xed4d('0x18')]);return _0x43ab67(_0x3b0445['error'][_0xed4d('0x18')]);}logger[_0xed4d('0x16')](_0xed4d('0x12'),_0x3a01df,_0x3b0445[_0xed4d('0x16')][_0xed4d('0x18')]);return _0x2052a1(_0x3b0445['error'][_0xed4d('0x18')]);}else{logger[_0xed4d('0x11')](_0xed4d('0x12'),_0x3a01df,_0xed4d('0x13'));_0x2052a1(_0x3b0445['result'][_0xed4d('0x18')]);}})[_0xed4d('0x19')](function(_0x2b4fc3){logger['error'](_0xed4d('0x12'),_0x3a01df,_0x2b4fc3);_0x43ab67(_0x2b4fc3);});});} \ No newline at end of file +var _0x5e5e=['Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./team.socket','info'];(function(_0x41699c,_0x317092){var _0xb1e0ad=function(_0x205f83){while(--_0x205f83){_0x41699c['push'](_0x41699c['shift']());}};_0xb1e0ad(++_0x317092);}(_0x5e5e,0xf9));var _0xe5e5=function(_0x445ab3,_0x4671d8){_0x445ab3=_0x445ab3-0x0;var _0x4e5ae9=_0x5e5e[_0x445ab3];return _0x4e5ae9;};'use strict';var _=require(_0xe5e5('0x0'));var util=require('util');var moment=require(_0xe5e5('0x1'));var BPromise=require(_0xe5e5('0x2'));var rs=require(_0xe5e5('0x3'));var fs=require('fs');var Redis=require(_0xe5e5('0x4'));var db=require(_0xe5e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe5e5('0x6'))(_0xe5e5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe5e5('0x8')]['http']({'port':0x232a});config[_0xe5e5('0x9')]=_[_0xe5e5('0xa')](config[_0xe5e5('0x9')],{'host':_0xe5e5('0xb'),'port':0x18eb});var socket=require(_0xe5e5('0xc'))(new Redis(config[_0xe5e5('0x9')]));require(_0xe5e5('0xd'))['register'](socket);function respondWithRpcPromise(_0x15b992,_0x49b6b7,_0x5b5c5b){return new BPromise(function(_0x422c9a,_0x5d591a){return client['request'](_0x15b992,_0x5b5c5b)['then'](function(_0x4f9514){logger[_0xe5e5('0xe')](_0xe5e5('0xf'),_0x49b6b7,'request\x20sent');logger[_0xe5e5('0x10')](_0xe5e5('0x11'),_0x49b6b7,'request\x20sent',JSON[_0xe5e5('0x12')](_0x4f9514));if(_0x4f9514[_0xe5e5('0x13')]){if(_0x4f9514[_0xe5e5('0x13')]['code']===0x1f4){logger[_0xe5e5('0x13')](_0xe5e5('0xf'),_0x49b6b7,_0x4f9514[_0xe5e5('0x13')][_0xe5e5('0x14')]);return _0x5d591a(_0x4f9514[_0xe5e5('0x13')]['message']);}logger[_0xe5e5('0x13')](_0xe5e5('0xf'),_0x49b6b7,_0x4f9514[_0xe5e5('0x13')][_0xe5e5('0x14')]);return _0x422c9a(_0x4f9514[_0xe5e5('0x13')][_0xe5e5('0x14')]);}else{logger[_0xe5e5('0xe')]('Team,\x20%s,\x20%s',_0x49b6b7,_0xe5e5('0x15'));_0x422c9a(_0x4f9514[_0xe5e5('0x16')][_0xe5e5('0x14')]);}})[_0xe5e5('0x17')](function(_0x33cbc8){logger[_0xe5e5('0x13')]('Team,\x20%s,\x20%s',_0x49b6b7,_0x33cbc8);_0x5d591a(_0x33cbc8);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2e82d23..4f2959d 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 _0xf173=['./team.events','remove','update','emit','removeListener','length','team:'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf173,0x12d));var _0x3f17=function(_0x49bb49,_0x2d775b){_0x49bb49=_0x49bb49-0x0;var _0x119f83=_0xf173[_0x49bb49];return _0x119f83;};'use strict';var TeamEvents=require(_0x3f17('0x0'));var events=['save',_0x3f17('0x1'),_0x3f17('0x2')];function createListener(_0x906ce0,_0x31e990){return function(_0x5b7b34){_0x31e990[_0x3f17('0x3')](_0x906ce0,_0x5b7b34);};}function removeListener(_0x102671,_0x309a85){return function(){TeamEvents[_0x3f17('0x4')](_0x102671,_0x309a85);};}exports['register']=function(_0x43750e){for(var _0x2ce77d=0x0,_0x557e80=events[_0x3f17('0x5')];_0x2ce77d<_0x557e80;_0x2ce77d++){var _0x27829e=events[_0x2ce77d];var _0x1fdd87=createListener(_0x3f17('0x6')+_0x27829e,_0x43750e);TeamEvents['on'](_0x27829e,_0x1fdd87);}}; \ No newline at end of file +var _0xd9c5=['length','team:','./team.events','save','remove','update','emit'];(function(_0x1dfb5d,_0x7ee3f6){var _0x112a9e=function(_0x360f64){while(--_0x360f64){_0x1dfb5d['push'](_0x1dfb5d['shift']());}};_0x112a9e(++_0x7ee3f6);}(_0xd9c5,0x1ec));var _0x5d9c=function(_0xb491dd,_0x494e4c){_0xb491dd=_0xb491dd-0x0;var _0x341aaf=_0xd9c5[_0xb491dd];return _0x341aaf;};'use strict';var TeamEvents=require(_0x5d9c('0x0'));var events=[_0x5d9c('0x1'),_0x5d9c('0x2'),_0x5d9c('0x3')];function createListener(_0x568d88,_0x241185){return function(_0x2298a2){_0x241185[_0x5d9c('0x4')](_0x568d88,_0x2298a2);};}function removeListener(_0x58daf4,_0x1c2666){return function(){TeamEvents['removeListener'](_0x58daf4,_0x1c2666);};}exports['register']=function(_0x273580){for(var _0x4367ff=0x0,_0x3f6769=events[_0x5d9c('0x5')];_0x4367ff<_0x3f6769;_0x4367ff++){var _0xa58d83=events[_0x4367ff];var _0x222d5e=createListener(_0x5d9c('0x6')+_0xa58d83,_0x273580);TeamEvents['on'](_0xa58d83,_0x222d5e);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index f99bae2..ca1579c 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 _0xeec2=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','show','put'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0xeec2,0x7d));var _0x2eec=function(_0x240ff5,_0x1fe1fe){_0x240ff5=_0x240ff5-0x0;var _0x584e65=_0xeec2[_0x240ff5];return _0x584e65;};'use strict';var multer=require(_0x2eec('0x0'));var util=require(_0x2eec('0x1'));var path=require(_0x2eec('0x2'));var timeout=require(_0x2eec('0x3'));var express=require(_0x2eec('0x4'));var router=express[_0x2eec('0x5')]();var auth=require(_0x2eec('0x6'));var interaction=require(_0x2eec('0x7'));var config=require(_0x2eec('0x8'));var controller=require(_0x2eec('0x9'));router[_0x2eec('0xa')]('/',auth[_0x2eec('0xb')](),controller[_0x2eec('0xc')]);router[_0x2eec('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2eec('0xd')]);router['post']('/',auth[_0x2eec('0xb')](),controller['create']);router[_0x2eec('0xe')](_0x2eec('0xf'),auth['isAuthenticated'](),controller[_0x2eec('0x10')]);router[_0x2eec('0x11')](_0x2eec('0xf'),auth[_0x2eec('0xb')](),controller[_0x2eec('0x12')]);module[_0x2eec('0x13')]=router; \ No newline at end of file +var _0xbca8=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x2512e4,_0x2f98ee){var _0x5a7f2d=function(_0x3bbece){while(--_0x3bbece){_0x2512e4['push'](_0x2512e4['shift']());}};_0x5a7f2d(++_0x2f98ee);}(_0xbca8,0x180));var _0x8bca=function(_0x1cd1fe,_0x291046){_0x1cd1fe=_0x1cd1fe-0x0;var _0x444601=_0xbca8[_0x1cd1fe];return _0x444601;};'use strict';var multer=require('multer');var util=require(_0x8bca('0x0'));var path=require(_0x8bca('0x1'));var timeout=require(_0x8bca('0x2'));var express=require(_0x8bca('0x3'));var router=express[_0x8bca('0x4')]();var auth=require(_0x8bca('0x5'));var interaction=require(_0x8bca('0x6'));var config=require('../../config/environment');var controller=require(_0x8bca('0x7'));router[_0x8bca('0x8')]('/',auth[_0x8bca('0x9')](),controller[_0x8bca('0xa')]);router[_0x8bca('0x8')]('/:id',auth[_0x8bca('0x9')](),controller[_0x8bca('0xb')]);router[_0x8bca('0xc')]('/',auth['isAuthenticated'](),controller[_0x8bca('0xd')]);router[_0x8bca('0xe')](_0x8bca('0xf'),auth[_0x8bca('0x9')](),controller['update']);router['delete'](_0x8bca('0xf'),auth[_0x8bca('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 69e931a..d4ba93c 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 _0xa40a=['exports','STRING','TEXT'];(function(_0x22afad,_0x27f3df){var _0x50f64c=function(_0x1ad132){while(--_0x1ad132){_0x22afad['push'](_0x22afad['shift']());}};_0x50f64c(++_0x27f3df);}(_0xa40a,0x1bc));var _0xaa40=function(_0x302ebd,_0x75a305){_0x302ebd=_0x302ebd-0x0;var _0xead486=_0xa40a[_0x302ebd];return _0xead486;};'use strict';var Sequelize=require('sequelize');module[_0xaa40('0x0')]={'name':{'type':Sequelize[_0xaa40('0x1')]},'description':{'type':Sequelize[_0xaa40('0x1')]},'html':{'type':Sequelize[_0xaa40('0x2')]}}; \ No newline at end of file +var _0x8431=['exports','STRING'];(function(_0x389213,_0x14a50d){var _0x4ad6ca=function(_0x45203b){while(--_0x45203b){_0x389213['push'](_0x389213['shift']());}};_0x4ad6ca(++_0x14a50d);}(_0x8431,0xfe));var _0x1843=function(_0x3acdff,_0x535535){_0x3acdff=_0x3acdff-0x0;var _0x23348b=_0x8431[_0x3acdff];return _0x23348b;};'use strict';var Sequelize=require('sequelize');module[_0x1843('0x0')]={'name':{'type':Sequelize[_0x1843('0x1')]},'description':{'type':Sequelize[_0x1843('0x1')]},'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 9556f6c..262df13 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 _0x4e1a=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','map','key','VIRTUAL','filter','options','includeAll','findAll','show','params','rawAttributes','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','count','offset','limit','json','apply','reject','save','then','get','Templates','UserProfileResource','destroy','error','stack','name','send','index','Template','model','query','keys','intersection','attributes'];(function(_0x1adee7,_0x2c214d){var _0x9ae51=function(_0x5b1e5c){while(--_0x5b1e5c){_0x1adee7['push'](_0x1adee7['shift']());}};_0x9ae51(++_0x2c214d);}(_0x4e1a,0x1af));var _0xa4e1=function(_0xbf8b6b,_0x57ecfe){_0xbf8b6b=_0xbf8b6b-0x0;var _0x4cb5b8=_0x4e1a[_0xbf8b6b];return _0x4cb5b8;};'use strict';var pdf=require(_0xa4e1('0x0'));var emlformat=require(_0xa4e1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa4e1('0x2'));var jsonpatch=require(_0xa4e1('0x3'));var rp=require('request-promise');var moment=require(_0xa4e1('0x4'));var BPromise=require(_0xa4e1('0x5'));var Mustache=require('mustache');var util=require(_0xa4e1('0x6'));var path=require(_0xa4e1('0x7'));var sox=require(_0xa4e1('0x8'));var csv=require(_0xa4e1('0x9'));var ejs=require(_0xa4e1('0xa'));var fs=require('fs');var _=require(_0xa4e1('0xb'));var squel=require(_0xa4e1('0xc'));var crypto=require(_0xa4e1('0xd'));var jsforce=require(_0xa4e1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa4e1('0xf'));var Papa=require(_0xa4e1('0x10'));var Redis=require(_0xa4e1('0x11'));var authService=require(_0xa4e1('0x12'));var qs=require(_0xa4e1('0x13'));var hardwareService=require(_0xa4e1('0x14'));var logger=require(_0xa4e1('0x15'))('api');var utils=require(_0xa4e1('0x16'));var config=require(_0xa4e1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac4a3,_0x2bd319){_0x2bd319=_0x2bd319||0xcc;return function(_0x434fce){if(_0x434fce){return _0x1ac4a3['sendStatus'](_0x2bd319);}return _0x1ac4a3[_0xa4e1('0x18')](_0x2bd319)[_0xa4e1('0x19')]();};}function respondWithResult(_0x52e842,_0x1fea8b){_0x1fea8b=_0x1fea8b||0xc8;return function(_0x2347b8){if(_0x2347b8){return _0x52e842[_0xa4e1('0x18')](_0x1fea8b)['json'](_0x2347b8);}};}function respondWithFilteredResult(_0x55eca2,_0x5a7864){return function(_0x4c0c5f){if(_0x4c0c5f){var _0x5b6010=_0x4c0c5f[_0xa4e1('0x1a')],_0x503969=_0x5a7864[_0xa4e1('0x1b')],_0x24b431=_0x5a7864['offset']+_0x5a7864[_0xa4e1('0x1c')],_0x43cfe0;if(_0x24b431>=_0x5b6010){_0x24b431=_0x5b6010;_0x43cfe0=0xc8;}else{_0x43cfe0=0xce;}_0x55eca2[_0xa4e1('0x18')](_0x43cfe0);return _0x55eca2['set']('Content-Range',_0x503969+'-'+_0x24b431+'/'+_0x5b6010)[_0xa4e1('0x1d')](_0x4c0c5f);}return null;};}function patchUpdates(_0x277f68){return function(_0x2bc363){try{jsonpatch[_0xa4e1('0x1e')](_0x2bc363,_0x277f68,!![]);}catch(_0x394c08){return BPromise[_0xa4e1('0x1f')](_0x394c08);}return _0x2bc363[_0xa4e1('0x20')]();};}function saveUpdates(_0x56a188,_0x3c872d){return function(_0x4c764d){if(_0x4c764d){return _0x4c764d['update'](_0x56a188)[_0xa4e1('0x21')](function(_0x4a0ae6){return _0x4a0ae6;});}return null;};}function removeEntity(_0x3833f3,_0x463196){return function(_0x5349a0){if(_0x5349a0){return _0x5349a0['destroy']()[_0xa4e1('0x21')](function(){var _0x2b9a06=_0x5349a0[_0xa4e1('0x22')]({'plain':!![]});var _0x17816f=_0xa4e1('0x23');return db[_0xa4e1('0x24')][_0xa4e1('0x25')]({'where':{'type':_0x17816f,'resourceId':_0x2b9a06['id']}})[_0xa4e1('0x21')](function(){return _0x5349a0;});})[_0xa4e1('0x21')](function(){_0x3833f3[_0xa4e1('0x18')](0xcc)[_0xa4e1('0x19')]();});}};}function handleEntityNotFound(_0x1a5bb6,_0x4918e7){return function(_0x5ec8c5){if(!_0x5ec8c5){_0x1a5bb6['sendStatus'](0x194);}return _0x5ec8c5;};}function handleError(_0xd84d8,_0x241b45){_0x241b45=_0x241b45||0x1f4;return function(_0x57d46e){logger[_0xa4e1('0x26')](_0x57d46e[_0xa4e1('0x27')]);if(_0x57d46e['name']){delete _0x57d46e[_0xa4e1('0x28')];}_0xd84d8[_0xa4e1('0x18')](_0x241b45)[_0xa4e1('0x29')](_0x57d46e);};}exports[_0xa4e1('0x2a')]=function(_0x186c01,_0x2b2e45){var _0x339991={},_0x36a817={},_0x5e32be={'count':0x0,'rows':[]};var _0x1a0974=db[_0xa4e1('0x2b')]['rawAttributes'];_0x36a817[_0xa4e1('0x2c')]=_['keys'](_0x1a0974);_0x36a817[_0xa4e1('0x2d')]=_[_0xa4e1('0x2e')](_0x186c01['query']);_0x36a817['filters']=_[_0xa4e1('0x2f')](_0x36a817[_0xa4e1('0x2c')],_0x36a817[_0xa4e1('0x2d')]);_0x339991[_0xa4e1('0x30')]=_['intersection'](_0x36a817[_0xa4e1('0x2c')],qs[_0xa4e1('0x31')](_0x186c01[_0xa4e1('0x2d')]['fields']));_0x339991[_0xa4e1('0x30')]=_0x339991[_0xa4e1('0x30')][_0xa4e1('0x32')]?_0x339991[_0xa4e1('0x30')]:_0x36a817['model'];if(!_0x186c01['query'][_0xa4e1('0x33')](_0xa4e1('0x34'))){_0x339991[_0xa4e1('0x1c')]=qs['limit'](_0x186c01[_0xa4e1('0x2d')][_0xa4e1('0x1c')]);_0x339991['offset']=qs[_0xa4e1('0x1b')](_0x186c01['query'][_0xa4e1('0x1b')]);}_0x339991[_0xa4e1('0x35')]=qs[_0xa4e1('0x36')](_0x186c01[_0xa4e1('0x2d')][_0xa4e1('0x36')]);_0x339991[_0xa4e1('0x37')]=qs[_0xa4e1('0x38')](_[_0xa4e1('0x39')](_0x186c01[_0xa4e1('0x2d')],_0x36a817['filters']));if(_0x186c01[_0xa4e1('0x2d')]['filter']){_0x339991[_0xa4e1('0x37')]=_[_0xa4e1('0x3a')](_0x339991['where'],{'$or':_[_0xa4e1('0x3b')](_0x1a0974,function(_0x47dc74){if(_0x47dc74['type'][_0xa4e1('0x3c')]!==_0xa4e1('0x3d')){var _0x36d3be={};_0x36d3be[_0x47dc74['field']]={'$like':'%'+_0x186c01[_0xa4e1('0x2d')][_0xa4e1('0x3e')]+'%'};return _0x36d3be;}})});}_0x339991=_[_0xa4e1('0x3a')]({},_0x339991,_0x186c01[_0xa4e1('0x3f')]);var _0x2be243={'where':_0x339991[_0xa4e1('0x37')]};return db['Template'][_0xa4e1('0x1a')](_0x2be243)[_0xa4e1('0x21')](function(_0x4f8662){_0x5e32be[_0xa4e1('0x1a')]=_0x4f8662;if(_0x186c01[_0xa4e1('0x2d')][_0xa4e1('0x40')]){_0x339991['include']=[{'all':!![]}];}return db[_0xa4e1('0x2b')][_0xa4e1('0x41')](_0x339991);})[_0xa4e1('0x21')](function(_0xd7afe1){_0x5e32be['rows']=_0xd7afe1;return _0x5e32be;})[_0xa4e1('0x21')](respondWithFilteredResult(_0x2b2e45,_0x339991))['catch'](handleError(_0x2b2e45,null));};exports[_0xa4e1('0x42')]=function(_0x30b582,_0x426d65){var _0x40d94b={'raw':!![],'where':{'id':_0x30b582[_0xa4e1('0x43')]['id']}},_0x208310={};_0x208310[_0xa4e1('0x2c')]=_['keys'](db['Template'][_0xa4e1('0x44')]);_0x208310[_0xa4e1('0x2d')]=_[_0xa4e1('0x2e')](_0x30b582[_0xa4e1('0x2d')]);_0x208310[_0xa4e1('0x38')]=_[_0xa4e1('0x2f')](_0x208310[_0xa4e1('0x2c')],_0x208310[_0xa4e1('0x2d')]);_0x40d94b['attributes']=_['intersection'](_0x208310[_0xa4e1('0x2c')],qs[_0xa4e1('0x31')](_0x30b582[_0xa4e1('0x2d')][_0xa4e1('0x31')]));_0x40d94b['attributes']=_0x40d94b['attributes'][_0xa4e1('0x32')]?_0x40d94b[_0xa4e1('0x30')]:_0x208310[_0xa4e1('0x2c')];if(_0x30b582[_0xa4e1('0x2d')][_0xa4e1('0x40')]){_0x40d94b[_0xa4e1('0x45')]=[{'all':!![]}];}_0x40d94b=_['merge']({},_0x40d94b,_0x30b582['options']);return db['Template'][_0xa4e1('0x46')](_0x40d94b)[_0xa4e1('0x21')](handleEntityNotFound(_0x426d65,null))[_0xa4e1('0x21')](respondWithResult(_0x426d65,null))[_0xa4e1('0x47')](handleError(_0x426d65,null));};exports[_0xa4e1('0x48')]=function(_0x53d806,_0x32ad54){return db[_0xa4e1('0x2b')][_0xa4e1('0x48')](_0x53d806[_0xa4e1('0x49')],{})['then'](function(_0x326fc6){var _0x212b38=_0x53d806[_0xa4e1('0x4a')][_0xa4e1('0x22')]({'plain':!![]});if(!_0x212b38)throw new Error(_0xa4e1('0x4b'));if(_0x212b38[_0xa4e1('0x4c')]===_0xa4e1('0x4a')){var _0x484e9a=_0x326fc6['get']({'plain':!![]});var _0x12a73c=_0xa4e1('0x23');return db[_0xa4e1('0x4d')][_0xa4e1('0x46')]({'where':{'name':_0x12a73c,'userProfileId':_0x212b38['userProfileId']},'raw':!![]})['then'](function(_0x3d767f){if(_0x3d767f&&_0x3d767f[_0xa4e1('0x4e')]===0x0){return db[_0xa4e1('0x24')][_0xa4e1('0x48')]({'name':_0x484e9a[_0xa4e1('0x28')],'resourceId':_0x484e9a['id'],'type':_0x3d767f['name'],'sectionId':_0x3d767f['id']},{})[_0xa4e1('0x21')](function(){return _0x326fc6;});}else{return _0x326fc6;}})[_0xa4e1('0x47')](function(_0x45af6e){logger[_0xa4e1('0x26')](_0xa4e1('0x4f'),_0x45af6e);throw _0x45af6e;});}return _0x326fc6;})[_0xa4e1('0x21')](respondWithResult(_0x32ad54,0xc9))[_0xa4e1('0x47')](handleError(_0x32ad54,null));};exports['update']=function(_0x216fc2,_0x8873cc){if(_0x216fc2[_0xa4e1('0x49')]['id']){delete _0x216fc2[_0xa4e1('0x49')]['id'];}return db[_0xa4e1('0x2b')][_0xa4e1('0x46')]({'where':{'id':_0x216fc2[_0xa4e1('0x43')]['id']}})[_0xa4e1('0x21')](handleEntityNotFound(_0x8873cc,null))[_0xa4e1('0x21')](saveUpdates(_0x216fc2[_0xa4e1('0x49')],null))[_0xa4e1('0x21')](respondWithResult(_0x8873cc,null))[_0xa4e1('0x47')](handleError(_0x8873cc,null));};exports[_0xa4e1('0x25')]=function(_0xd4bbab,_0x41421e){return db[_0xa4e1('0x2b')][_0xa4e1('0x46')]({'where':{'id':_0xd4bbab[_0xa4e1('0x43')]['id']}})['then'](handleEntityNotFound(_0x41421e,null))[_0xa4e1('0x21')](removeEntity(_0x41421e,null))['catch'](handleError(_0x41421e,null));}; \ No newline at end of file +var _0x8032=['destroy','Templates','UserProfileResource','error','name','send','index','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','VIRTUAL','merge','Template','count','includeAll','rows','show','params','length','catch','create','body','user','get','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8032,0x11e));var _0x2803=function(_0x1a2ed5,_0x255d82){_0x1a2ed5=_0x1a2ed5-0x0;var _0x5c9cc1=_0x8032[_0x1a2ed5];return _0x5c9cc1;};'use strict';var pdf=require(_0x2803('0x0'));var emlformat=require(_0x2803('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2803('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2803('0x3'));var moment=require(_0x2803('0x4'));var BPromise=require(_0x2803('0x5'));var Mustache=require(_0x2803('0x6'));var util=require(_0x2803('0x7'));var path=require(_0x2803('0x8'));var sox=require(_0x2803('0x9'));var csv=require(_0x2803('0xa'));var ejs=require(_0x2803('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2803('0xc'));var crypto=require(_0x2803('0xd'));var jsforce=require(_0x2803('0xe'));var deskjs=require(_0x2803('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2803('0x10'));var Papa=require(_0x2803('0x11'));var Redis=require(_0x2803('0x12'));var authService=require(_0x2803('0x13'));var qs=require(_0x2803('0x14'));var hardwareService=require(_0x2803('0x15'));var logger=require('../../config/logger')(_0x2803('0x16'));var utils=require(_0x2803('0x17'));var config=require(_0x2803('0x18'));var db=require(_0x2803('0x19'))['db'];function respondWithStatusCode(_0x215cd7,_0x160dfe){_0x160dfe=_0x160dfe||0xcc;return function(_0x53681f){if(_0x53681f){return _0x215cd7[_0x2803('0x1a')](_0x160dfe);}return _0x215cd7[_0x2803('0x1b')](_0x160dfe)[_0x2803('0x1c')]();};}function respondWithResult(_0x43f8a3,_0x5c7c09){_0x5c7c09=_0x5c7c09||0xc8;return function(_0x1e57f4){if(_0x1e57f4){return _0x43f8a3[_0x2803('0x1b')](_0x5c7c09)[_0x2803('0x1d')](_0x1e57f4);}};}function respondWithFilteredResult(_0x2af117,_0x519621){return function(_0x294c8a){if(_0x294c8a){var _0x448847=_0x294c8a['count'],_0x20bd59=_0x519621[_0x2803('0x1e')],_0x4a0da5=_0x519621[_0x2803('0x1e')]+_0x519621[_0x2803('0x1f')],_0x1a7a8f;if(_0x4a0da5>=_0x448847){_0x4a0da5=_0x448847;_0x1a7a8f=0xc8;}else{_0x1a7a8f=0xce;}_0x2af117['status'](_0x1a7a8f);return _0x2af117[_0x2803('0x20')](_0x2803('0x21'),_0x20bd59+'-'+_0x4a0da5+'/'+_0x448847)[_0x2803('0x1d')](_0x294c8a);}return null;};}function patchUpdates(_0x3b4d9d){return function(_0x4de8ed){try{jsonpatch[_0x2803('0x22')](_0x4de8ed,_0x3b4d9d,!![]);}catch(_0x25d9bf){return BPromise['reject'](_0x25d9bf);}return _0x4de8ed[_0x2803('0x23')]();};}function saveUpdates(_0x2e1960,_0xd9105a){return function(_0xe44be2){if(_0xe44be2){return _0xe44be2[_0x2803('0x24')](_0x2e1960)[_0x2803('0x25')](function(_0x423529){return _0x423529;});}return null;};}function removeEntity(_0x540e41,_0x16cfde){return function(_0x3b9122){if(_0x3b9122){return _0x3b9122[_0x2803('0x26')]()[_0x2803('0x25')](function(){var _0xf31406=_0x3b9122['get']({'plain':!![]});var _0x56a312=_0x2803('0x27');return db[_0x2803('0x28')][_0x2803('0x26')]({'where':{'type':_0x56a312,'resourceId':_0xf31406['id']}})[_0x2803('0x25')](function(){return _0x3b9122;});})[_0x2803('0x25')](function(){_0x540e41['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15b10e,_0x327825){return function(_0x7eaa32){if(!_0x7eaa32){_0x15b10e[_0x2803('0x1a')](0x194);}return _0x7eaa32;};}function handleError(_0x3c31fb,_0x4bb843){_0x4bb843=_0x4bb843||0x1f4;return function(_0x44220f){logger[_0x2803('0x29')](_0x44220f['stack']);if(_0x44220f[_0x2803('0x2a')]){delete _0x44220f[_0x2803('0x2a')];}_0x3c31fb[_0x2803('0x1b')](_0x4bb843)[_0x2803('0x2b')](_0x44220f);};}exports[_0x2803('0x2c')]=function(_0x341d07,_0xa87fb9){var _0x2e4f0a={},_0x1367d6={},_0x24397c={'count':0x0,'rows':[]};var _0x447cd5=db['Template'][_0x2803('0x2d')];_0x1367d6['model']=_[_0x2803('0x2e')](_0x447cd5);_0x1367d6[_0x2803('0x2f')]=_[_0x2803('0x2e')](_0x341d07['query']);_0x1367d6[_0x2803('0x30')]=_[_0x2803('0x31')](_0x1367d6['model'],_0x1367d6[_0x2803('0x2f')]);_0x2e4f0a['attributes']=_['intersection'](_0x1367d6[_0x2803('0x32')],qs[_0x2803('0x33')](_0x341d07[_0x2803('0x2f')][_0x2803('0x33')]));_0x2e4f0a[_0x2803('0x34')]=_0x2e4f0a[_0x2803('0x34')]['length']?_0x2e4f0a[_0x2803('0x34')]:_0x1367d6[_0x2803('0x32')];if(!_0x341d07[_0x2803('0x2f')][_0x2803('0x35')](_0x2803('0x36'))){_0x2e4f0a['limit']=qs[_0x2803('0x1f')](_0x341d07[_0x2803('0x2f')]['limit']);_0x2e4f0a[_0x2803('0x1e')]=qs['offset'](_0x341d07[_0x2803('0x2f')][_0x2803('0x1e')]);}_0x2e4f0a[_0x2803('0x37')]=qs[_0x2803('0x38')](_0x341d07[_0x2803('0x2f')][_0x2803('0x38')]);_0x2e4f0a[_0x2803('0x39')]=qs['filters'](_[_0x2803('0x3a')](_0x341d07[_0x2803('0x2f')],_0x1367d6[_0x2803('0x30')]));if(_0x341d07[_0x2803('0x2f')][_0x2803('0x3b')]){_0x2e4f0a[_0x2803('0x39')]=_['merge'](_0x2e4f0a['where'],{'$or':_[_0x2803('0x3c')](_0x447cd5,function(_0x4cf6d3){if(_0x4cf6d3['type'][_0x2803('0x3d')]!==_0x2803('0x3e')){var _0x30e8b0={};_0x30e8b0[_0x4cf6d3['field']]={'$like':'%'+_0x341d07['query'][_0x2803('0x3b')]+'%'};return _0x30e8b0;}})});}_0x2e4f0a=_[_0x2803('0x3f')]({},_0x2e4f0a,_0x341d07['options']);var _0x519377={'where':_0x2e4f0a['where']};return db[_0x2803('0x40')][_0x2803('0x41')](_0x519377)['then'](function(_0x3cd0db){_0x24397c[_0x2803('0x41')]=_0x3cd0db;if(_0x341d07[_0x2803('0x2f')][_0x2803('0x42')]){_0x2e4f0a['include']=[{'all':!![]}];}return db[_0x2803('0x40')]['findAll'](_0x2e4f0a);})[_0x2803('0x25')](function(_0xf61afc){_0x24397c[_0x2803('0x43')]=_0xf61afc;return _0x24397c;})[_0x2803('0x25')](respondWithFilteredResult(_0xa87fb9,_0x2e4f0a))['catch'](handleError(_0xa87fb9,null));};exports[_0x2803('0x44')]=function(_0x206fca,_0x34eaff){var _0x34dd3a={'raw':!![],'where':{'id':_0x206fca[_0x2803('0x45')]['id']}},_0x1f626d={};_0x1f626d[_0x2803('0x32')]=_['keys'](db[_0x2803('0x40')]['rawAttributes']);_0x1f626d[_0x2803('0x2f')]=_['keys'](_0x206fca[_0x2803('0x2f')]);_0x1f626d[_0x2803('0x30')]=_['intersection'](_0x1f626d[_0x2803('0x32')],_0x1f626d['query']);_0x34dd3a['attributes']=_[_0x2803('0x31')](_0x1f626d[_0x2803('0x32')],qs[_0x2803('0x33')](_0x206fca[_0x2803('0x2f')][_0x2803('0x33')]));_0x34dd3a['attributes']=_0x34dd3a[_0x2803('0x34')][_0x2803('0x46')]?_0x34dd3a[_0x2803('0x34')]:_0x1f626d[_0x2803('0x32')];if(_0x206fca[_0x2803('0x2f')]['includeAll']){_0x34dd3a['include']=[{'all':!![]}];}_0x34dd3a=_[_0x2803('0x3f')]({},_0x34dd3a,_0x206fca['options']);return db['Template']['find'](_0x34dd3a)[_0x2803('0x25')](handleEntityNotFound(_0x34eaff,null))[_0x2803('0x25')](respondWithResult(_0x34eaff,null))[_0x2803('0x47')](handleError(_0x34eaff,null));};exports[_0x2803('0x48')]=function(_0x4f83cb,_0x2c6e07){return db['Template'][_0x2803('0x48')](_0x4f83cb[_0x2803('0x49')],{})[_0x2803('0x25')](function(_0x2f12de){var _0x3c5eb8=_0x4f83cb[_0x2803('0x4a')][_0x2803('0x4b')]({'plain':!![]});if(!_0x3c5eb8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c5eb8[_0x2803('0x4c')]===_0x2803('0x4a')){var _0x26ab31=_0x2f12de[_0x2803('0x4b')]({'plain':!![]});var _0x538cbe='Templates';return db['UserProfileSection'][_0x2803('0x4d')]({'where':{'name':_0x538cbe,'userProfileId':_0x3c5eb8[_0x2803('0x4e')]},'raw':!![]})[_0x2803('0x25')](function(_0x36aeb9){if(_0x36aeb9&&_0x36aeb9[_0x2803('0x4f')]===0x0){return db[_0x2803('0x28')][_0x2803('0x48')]({'name':_0x26ab31['name'],'resourceId':_0x26ab31['id'],'type':_0x36aeb9[_0x2803('0x2a')],'sectionId':_0x36aeb9['id']},{})[_0x2803('0x25')](function(){return _0x2f12de;});}else{return _0x2f12de;}})[_0x2803('0x47')](function(_0x46b798){logger[_0x2803('0x29')](_0x2803('0x50'),_0x46b798);throw _0x46b798;});}return _0x2f12de;})[_0x2803('0x25')](respondWithResult(_0x2c6e07,0xc9))[_0x2803('0x47')](handleError(_0x2c6e07,null));};exports['update']=function(_0x5a1927,_0x33d64e){if(_0x5a1927[_0x2803('0x49')]['id']){delete _0x5a1927['body']['id'];}return db[_0x2803('0x40')][_0x2803('0x4d')]({'where':{'id':_0x5a1927['params']['id']}})[_0x2803('0x25')](handleEntityNotFound(_0x33d64e,null))['then'](saveUpdates(_0x5a1927[_0x2803('0x49')],null))[_0x2803('0x25')](respondWithResult(_0x33d64e,null))['catch'](handleError(_0x33d64e,null));};exports[_0x2803('0x26')]=function(_0x38560e,_0x11b5a5){return db['Template'][_0x2803('0x4d')]({'where':{'id':_0x38560e[_0x2803('0x45')]['id']}})['then'](handleEntityNotFound(_0x11b5a5,null))['then'](removeEntity(_0x11b5a5,null))['catch'](handleError(_0x11b5a5,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 072d8be..61998a7 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 _0xd4a2=['Template','tools_templates','lodash','api','bluebird','path','../../config/environment','./template.attributes','exports'];(function(_0x19b7e9,_0x4b88c9){var _0x2759a6=function(_0x1cdf72){while(--_0x1cdf72){_0x19b7e9['push'](_0x19b7e9['shift']());}};_0x2759a6(++_0x4b88c9);}(_0xd4a2,0x173));var _0x2d4a=function(_0x943e22,_0x4983dd){_0x943e22=_0x943e22-0x0;var _0x449ec8=_0xd4a2[_0x943e22];return _0x449ec8;};'use strict';var _=require(_0x2d4a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2d4a('0x1'));var moment=require('moment');var BPromise=require(_0x2d4a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2d4a('0x3'));var rimraf=require('rimraf');var config=require(_0x2d4a('0x4'));var attributes=require(_0x2d4a('0x5'));module[_0x2d4a('0x6')]=function(_0x3a88e2,_0x1ca10b){return _0x3a88e2['define'](_0x2d4a('0x7'),attributes,{'tableName':_0x2d4a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5b5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash'];(function(_0x5f1bb2,_0x3d0ec3){var _0x5b0d1e=function(_0x4d8720){while(--_0x4d8720){_0x5f1bb2['push'](_0x5f1bb2['shift']());}};_0x5b0d1e(++_0x3d0ec3);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0xe5b5[_0x488ca1];return _0x4dd0a4;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var rp=require(_0x5e5b('0x6'));var fs=require('fs');var path=require(_0x5e5b('0x7'));var rimraf=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var attributes=require(_0x5e5b('0xa'));module[_0x5e5b('0xb')]=function(_0xf1fbe2,_0x11e0e0){return _0xf1fbe2[_0x5e5b('0xc')](_0x5e5b('0xd'),attributes,{'tableName':_0x5e5b('0xe'),'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 79daced..3258f3d 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 _0x1f60=['code','Template,\x20%s,\x20%s','message','catch','GetTemplate','Template','findAll','options','where','attributes','include','model','map','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x28c626,_0x2cd7d5){var _0xfcf881=function(_0x2c391a){while(--_0x2c391a){_0x28c626['push'](_0x28c626['shift']());}};_0xfcf881(++_0x2cd7d5);}(_0x1f60,0x1bf));var _0x01f6=function(_0x17db98,_0x1209e8){_0x17db98=_0x17db98-0x0;var _0x30ad44=_0x1f60[_0x17db98];return _0x30ad44;};'use strict';var _=require(_0x01f6('0x0'));var util=require(_0x01f6('0x1'));var moment=require('moment');var BPromise=require(_0x01f6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01f6('0x3'))['db'];var utils=require(_0x01f6('0x4'));var logger=require(_0x01f6('0x5'))(_0x01f6('0x6'));var config=require(_0x01f6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x01f6('0x8')][_0x01f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x122f5f,_0x17d191,_0x18d27e){return new BPromise(function(_0x162a18,_0x4078ab){return client[_0x01f6('0xa')](_0x122f5f,_0x18d27e)[_0x01f6('0xb')](function(_0x2934b4){logger[_0x01f6('0xc')]('Template,\x20%s,\x20%s',_0x17d191,_0x01f6('0xd'));logger[_0x01f6('0xe')](_0x01f6('0xf'),_0x17d191,_0x01f6('0xd'),JSON[_0x01f6('0x10')](_0x2934b4));if(_0x2934b4['error']){if(_0x2934b4[_0x01f6('0x11')][_0x01f6('0x12')]===0x1f4){logger[_0x01f6('0x11')](_0x01f6('0x13'),_0x17d191,_0x2934b4[_0x01f6('0x11')][_0x01f6('0x14')]);return _0x4078ab(_0x2934b4['error'][_0x01f6('0x14')]);}logger[_0x01f6('0x11')](_0x01f6('0x13'),_0x17d191,_0x2934b4[_0x01f6('0x11')][_0x01f6('0x14')]);return _0x162a18(_0x2934b4[_0x01f6('0x11')][_0x01f6('0x14')]);}else{logger[_0x01f6('0xc')](_0x01f6('0x13'),_0x17d191,_0x01f6('0xd'));_0x162a18(_0x2934b4['result']['message']);}})[_0x01f6('0x15')](function(_0x5524b0){logger['error'](_0x01f6('0x13'),_0x17d191,_0x5524b0);_0x4078ab(_0x5524b0);});});}exports[_0x01f6('0x16')]=function(_0x16ecbd){var _0x2d06c8=this;return new Promise(function(_0x5d1ef2,_0x3f16b1){return db[_0x01f6('0x17')][_0x01f6('0x18')]({'raw':_0x16ecbd[_0x01f6('0x19')]?_0x16ecbd[_0x01f6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x16ecbd[_0x01f6('0x19')]?_0x16ecbd['options'][_0x01f6('0x1a')]||null:null,'attributes':_0x16ecbd[_0x01f6('0x19')]?_0x16ecbd[_0x01f6('0x19')][_0x01f6('0x1b')]||null:null,'limit':_0x16ecbd['options']?_0x16ecbd[_0x01f6('0x19')]['limit']||null:null,'include':_0x16ecbd[_0x01f6('0x19')]?_0x16ecbd[_0x01f6('0x19')][_0x01f6('0x1c')]?_['map'](_0x16ecbd[_0x01f6('0x19')][_0x01f6('0x1c')],function(_0x69ba8a){return{'model':db[_0x69ba8a[_0x01f6('0x1d')]],'as':_0x69ba8a['as'],'attributes':_0x69ba8a['attributes'],'include':_0x69ba8a['include']?_[_0x01f6('0x1e')](_0x69ba8a[_0x01f6('0x1c')],function(_0x527ff5){return{'model':db[_0x527ff5[_0x01f6('0x1d')]],'as':_0x527ff5['as'],'attributes':_0x527ff5[_0x01f6('0x1b')],'include':_0x527ff5[_0x01f6('0x1c')]?_['map'](_0x527ff5['include'],function(_0x3358b3){return{'model':db[_0x3358b3[_0x01f6('0x1d')]],'as':_0x3358b3['as'],'attributes':_0x3358b3[_0x01f6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x12d263){logger[_0x01f6('0xc')]('GetTemplate',_0x16ecbd);logger['debug'](_0x01f6('0x16'),_0x16ecbd,JSON[_0x01f6('0x10')](_0x12d263));_0x5d1ef2(_0x12d263);})[_0x01f6('0x15')](function(_0x411b15){logger['error'](_0x01f6('0x16'),_0x411b15[_0x01f6('0x14')],_0x16ecbd);_0x3f16b1(_0x2d06c8[_0x01f6('0x11')](0x1f4,_0x411b15[_0x01f6('0x14')]));});});}; \ No newline at end of file +var _0x39d2=['where','attributes','limit','include','map','model','GetTemplate','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Template','findAll','options'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x39d2,0xf5));var _0x239d=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x39d2[_0x58175c];return _0x55b88f;};'use strict';var _=require(_0x239d('0x0'));var util=require('util');var moment=require(_0x239d('0x1'));var BPromise=require(_0x239d('0x2'));var rs=require(_0x239d('0x3'));var fs=require('fs');var Redis=require(_0x239d('0x4'));var db=require(_0x239d('0x5'))['db'];var utils=require(_0x239d('0x6'));var logger=require(_0x239d('0x7'))(_0x239d('0x8'));var config=require(_0x239d('0x9'));var jayson=require(_0x239d('0xa'));var client=jayson[_0x239d('0xb')][_0x239d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f0947,_0x53d457,_0x262efe){return new BPromise(function(_0x2a6811,_0x3f9948){return client[_0x239d('0xd')](_0x1f0947,_0x262efe)[_0x239d('0xe')](function(_0x3d7f32){logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));logger[_0x239d('0x12')](_0x239d('0x13'),_0x53d457,_0x239d('0x11'),JSON[_0x239d('0x14')](_0x3d7f32));if(_0x3d7f32[_0x239d('0x15')]){if(_0x3d7f32[_0x239d('0x15')]['code']===0x1f4){logger['error'](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x3f9948(_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);}logger[_0x239d('0x15')](_0x239d('0x10'),_0x53d457,_0x3d7f32[_0x239d('0x15')][_0x239d('0x16')]);return _0x2a6811(_0x3d7f32['error'][_0x239d('0x16')]);}else{logger[_0x239d('0xf')](_0x239d('0x10'),_0x53d457,_0x239d('0x11'));_0x2a6811(_0x3d7f32[_0x239d('0x17')]['message']);}})['catch'](function(_0x141582){logger['error'](_0x239d('0x10'),_0x53d457,_0x141582);_0x3f9948(_0x141582);});});}exports['GetTemplate']=function(_0x33f01d){var _0x39627f=this;return new Promise(function(_0x1d6687,_0x472963){return db[_0x239d('0x18')][_0x239d('0x19')]({'raw':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x33f01d[_0x239d('0x1a')]?_0x33f01d['options'][_0x239d('0x1b')]||null:null,'attributes':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')][_0x239d('0x1c')]||null:null,'limit':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')][_0x239d('0x1d')]||null:null,'include':_0x33f01d[_0x239d('0x1a')]?_0x33f01d[_0x239d('0x1a')][_0x239d('0x1e')]?_[_0x239d('0x1f')](_0x33f01d[_0x239d('0x1a')][_0x239d('0x1e')],function(_0x4f1142){return{'model':db[_0x4f1142[_0x239d('0x20')]],'as':_0x4f1142['as'],'attributes':_0x4f1142[_0x239d('0x1c')],'include':_0x4f1142[_0x239d('0x1e')]?_[_0x239d('0x1f')](_0x4f1142[_0x239d('0x1e')],function(_0x72802){return{'model':db[_0x72802[_0x239d('0x20')]],'as':_0x72802['as'],'attributes':_0x72802[_0x239d('0x1c')],'include':_0x72802[_0x239d('0x1e')]?_['map'](_0x72802[_0x239d('0x1e')],function(_0x395cc4){return{'model':db[_0x395cc4['model']],'as':_0x395cc4['as'],'attributes':_0x395cc4['attributes']};}):[]};}):[]};}):[]:[]})[_0x239d('0xe')](function(_0x47ade8){logger['info'](_0x239d('0x21'),_0x33f01d);logger[_0x239d('0x12')]('GetTemplate',_0x33f01d,JSON[_0x239d('0x14')](_0x47ade8));_0x1d6687(_0x47ade8);})['catch'](function(_0x5de926){logger['error'](_0x239d('0x21'),_0x5de926[_0x239d('0x16')],_0x33f01d);_0x472963(_0x39627f[_0x239d('0x15')](0x1f4,_0x5de926[_0x239d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index ec68977..b7c272d 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 _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x2d247b,_0x1a3e2f){var _0x2ba665=function(_0x3db869){while(--_0x3db869){_0x2d247b['push'](_0x2d247b['shift']());}};_0x2ba665(++_0x1a3e2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAnyCondition','addAction','update','exports','multer','util','path'];(function(_0x4fa493,_0x47bcc4){var _0xe55584=function(_0x24a689){while(--_0x24a689){_0x4fa493['push'](_0x4fa493['shift']());}};_0xe55584(++_0x47bcc4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['show']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')]('/:id/any_conditions',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0xf')](_0x0a9e('0xd'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x12')]);router['put'](_0x0a9e('0x9'),auth['isAuthenticated'](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 95bd36b..afc694c 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 _0x9fb0=['exports','STRING','BOOLEAN','sequelize'];(function(_0x7eee15,_0x3fe21a){var _0x7ad23=function(_0x2de173){while(--_0x2de173){_0x7eee15['push'](_0x7eee15['shift']());}};_0x7ad23(++_0x3fe21a);}(_0x9fb0,0x12b));var _0x09fb=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x9fb0[_0x164eca];return _0x2ce562;};'use strict';var Sequelize=require(_0x09fb('0x0'));module[_0x09fb('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x09fb('0x2')]},'description':{'type':Sequelize[_0x09fb('0x2')]},'status':{'type':Sequelize[_0x09fb('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xba96=['exports','STRING','sequelize'];(function(_0x1074ae,_0x2470f6){var _0x27c0a3=function(_0x271106){while(--_0x271106){_0x1074ae['push'](_0x1074ae['shift']());}};_0x27c0a3(++_0x2470f6);}(_0xba96,0x146));var _0x6ba9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xba96[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6ba9('0x0'));module[_0x6ba9('0x1')]={'name':{'type':Sequelize[_0x6ba9('0x2')]},'channel':{'type':Sequelize[_0x6ba9('0x2')]},'description':{'type':Sequelize[_0x6ba9('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 1832011..330d8d2 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 _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));}; \ No newline at end of file +var _0xa9e0=['merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','addAllCondition','Condition','TriggerAnyId','findOne','map','getAllConditions','hasOwnProperty','getAnyConditions','pick','addAction','TriggerId','getActions','Action','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','options','includeAll','include','Trigger','rows','catch','show','params'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 hardwareService=require(_0x0a9e('0x11'));var logger=require(_0x0a9e('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xcc;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x13')](_0x36471c);}return _0x273d4d[_0x0a9e('0x14')](_0x36471c)[_0x0a9e('0x15')]();};}function respondWithResult(_0x5db4b0,_0x4283ce){_0x4283ce=_0x4283ce||0xc8;return function(_0x239b12){if(_0x239b12){return _0x5db4b0[_0x0a9e('0x14')](_0x4283ce)[_0x0a9e('0x16')](_0x239b12);}};}function respondWithFilteredResult(_0x44dcfd,_0x4d5611){return function(_0x52a03d){if(_0x52a03d){var _0x22dccb=_0x52a03d[_0x0a9e('0x17')],_0x5d0880=_0x4d5611[_0x0a9e('0x18')],_0x1985b6=_0x4d5611['offset']+_0x4d5611[_0x0a9e('0x19')],_0x519dfd;if(_0x1985b6>=_0x22dccb){_0x1985b6=_0x22dccb;_0x519dfd=0xc8;}else{_0x519dfd=0xce;}_0x44dcfd['status'](_0x519dfd);return _0x44dcfd[_0x0a9e('0x1a')](_0x0a9e('0x1b'),_0x5d0880+'-'+_0x1985b6+'/'+_0x22dccb)[_0x0a9e('0x16')](_0x52a03d);}return null;};}function patchUpdates(_0x205fd6){return function(_0x31b1ca){try{jsonpatch[_0x0a9e('0x1c')](_0x31b1ca,_0x205fd6,!![]);}catch(_0x530eb7){return BPromise[_0x0a9e('0x1d')](_0x530eb7);}return _0x31b1ca[_0x0a9e('0x1e')]();};}function saveUpdates(_0x112016,_0x1c696a){return function(_0x105080){if(_0x105080){return _0x105080['update'](_0x112016)[_0x0a9e('0x1f')](function(_0x155cce){return _0x155cce;});}return null;};}function removeEntity(_0x53682f,_0x20f109){return function(_0x5a09ef){if(_0x5a09ef){return _0x5a09ef['destroy']()[_0x0a9e('0x1f')](function(){var _0x432e56=_0x5a09ef[_0x0a9e('0x20')]({'plain':!![]});var _0x30bae6='Triggers';return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'type':_0x30bae6,'resourceId':_0x432e56['id']}})[_0x0a9e('0x1f')](function(){return _0x5a09ef;});})[_0x0a9e('0x1f')](function(){_0x53682f[_0x0a9e('0x14')](0xcc)[_0x0a9e('0x15')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x13')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x23')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x24')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x25')](_0x33161b);};}exports[_0x0a9e('0x26')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=db['Trigger'][_0x0a9e('0x27')];_0x1538a4[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](_0x14de77);_0x1538a4[_0x0a9e('0x2a')]=_['keys'](_0x25fba9[_0x0a9e('0x2a')]);_0x1538a4[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],_0x1538a4[_0x0a9e('0x2a')]);_0x140511[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0x1538a4[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x25fba9['query'][_0x0a9e('0x2e')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x140511[_0x0a9e('0x2d')]:_0x1538a4[_0x0a9e('0x28')];if(!_0x25fba9[_0x0a9e('0x2a')]['hasOwnProperty'](_0x0a9e('0x30'))){_0x140511[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x140511[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x25fba9[_0x0a9e('0x2a')]['offset']);}_0x140511[_0x0a9e('0x31')]=qs['sort'](_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x140511[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_['pick'](_0x25fba9[_0x0a9e('0x2a')],_0x1538a4[_0x0a9e('0x2b')]));if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x140511['where']=_['merge'](_0x140511[_0x0a9e('0x33')],{'$or':_['map'](_0x14de77,function(_0x24936a){if(_0x24936a[_0x0a9e('0x35')][_0x0a9e('0x36')]!==_0x0a9e('0x37')){var _0x4f41ae={};_0x4f41ae[_0x24936a[_0x0a9e('0x38')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x4f41ae;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x39')]);var _0x1a180b={'where':_0x140511[_0x0a9e('0x33')]};return db['Trigger']['count'](_0x1a180b)[_0x0a9e('0x1f')](function(_0x40d766){_0x11c3b6['count']=_0x40d766;if(_0x25fba9[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x140511[_0x0a9e('0x3b')]=[{'all':!![]}];}return db[_0x0a9e('0x3c')]['findAll'](_0x140511);})['then'](function(_0x15e37d){_0x11c3b6[_0x0a9e('0x3d')]=_0x15e37d;return _0x11c3b6;})['then'](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x3e')](handleError(_0x14433c,null));};exports[_0x0a9e('0x3f')]=function(_0x1459bb,_0x5b4f5e){var _0x316c8f={'raw':![],'where':{'id':_0x1459bb[_0x0a9e('0x40')]['id']}},_0x2cfea9={};_0x2cfea9[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x3c')][_0x0a9e('0x27')]);_0x2cfea9[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1459bb[_0x0a9e('0x2a')]);_0x2cfea9[_0x0a9e('0x2b')]=_[_0x0a9e('0x2c')](_0x2cfea9[_0x0a9e('0x28')],_0x2cfea9[_0x0a9e('0x2a')]);_0x316c8f[_0x0a9e('0x2d')]=_['intersection'](_0x2cfea9['model'],qs[_0x0a9e('0x2e')](_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x316c8f[_0x0a9e('0x2d')]=_0x316c8f[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x316c8f[_0x0a9e('0x2d')]:_0x2cfea9[_0x0a9e('0x28')];if(_0x1459bb[_0x0a9e('0x2a')][_0x0a9e('0x3a')]){_0x316c8f[_0x0a9e('0x3b')]=[{'all':!![]}];}_0x316c8f=_[_0x0a9e('0x41')]({},_0x316c8f,_0x1459bb['options']);return db[_0x0a9e('0x3c')][_0x0a9e('0x42')](_0x316c8f)[_0x0a9e('0x1f')](handleEntityNotFound(_0x5b4f5e,null))[_0x0a9e('0x1f')](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0x3e')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x43')]=function(_0x21eb86,_0x44dd99){return db['Trigger'][_0x0a9e('0x43')](_0x21eb86['body'],{})[_0x0a9e('0x1f')](function(_0x476688){var _0x8d6dd1=_0x21eb86['user'][_0x0a9e('0x20')]({'plain':!![]});if(!_0x8d6dd1)throw new Error(_0x0a9e('0x44'));if(_0x8d6dd1[_0x0a9e('0x45')]===_0x0a9e('0x46')){var _0x45c845=_0x476688[_0x0a9e('0x20')]({'plain':!![]});var _0x45bf7f='Triggers';return db[_0x0a9e('0x47')][_0x0a9e('0x42')]({'where':{'name':_0x45bf7f,'userProfileId':_0x8d6dd1[_0x0a9e('0x48')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x409789){if(_0x409789&&_0x409789[_0x0a9e('0x49')]===0x0){return db[_0x0a9e('0x21')][_0x0a9e('0x43')]({'name':_0x45c845[_0x0a9e('0x24')],'resourceId':_0x45c845['id'],'type':_0x409789['name'],'sectionId':_0x409789['id']},{})[_0x0a9e('0x1f')](function(){return _0x476688;});}else{return _0x476688;}})[_0x0a9e('0x3e')](function(_0x4f7240){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f7240);throw _0x4f7240;});}return _0x476688;})[_0x0a9e('0x1f')](respondWithResult(_0x44dd99,0xc9))[_0x0a9e('0x3e')](handleError(_0x44dd99,null));};exports[_0x0a9e('0x4a')]=function(_0x11545a,_0x61bb17){if(_0x11545a[_0x0a9e('0x4b')]['id']){delete _0x11545a[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')]['find']({'where':{'id':_0x11545a['params']['id']}})['then'](handleEntityNotFound(_0x61bb17,null))[_0x0a9e('0x1f')](saveUpdates(_0x11545a[_0x0a9e('0x4b')],null))[_0x0a9e('0x1f')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};exports[_0x0a9e('0x22')]=function(_0x161aa7,_0x53d113){return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x161aa7['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x53d113,null))['then'](removeEntity(_0x53d113,null))[_0x0a9e('0x3e')](handleError(_0x53d113,null));};exports[_0x0a9e('0x4c')]=function(_0x439340,_0x53613a,_0x2f82da){if(_0x439340[_0x0a9e('0x4b')]['id']){delete _0x439340['body']['id'];}return db['Trigger'][_0x0a9e('0x42')]({'where':{'id':_0x439340[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x53613a,null))[_0x0a9e('0x1f')](function(_0x5ce9ac){if(_0x5ce9ac){_0x439340[_0x0a9e('0x4b')]['TriggerAllId']=_0x5ce9ac['id'];return db[_0x0a9e('0x4d')]['create'](_0x439340['body']);}})['then'](respondWithResult(_0x53613a,null))[_0x0a9e('0x3e')](handleError(_0x53613a,null));};exports['addAnyCondition']=function(_0x2f7092,_0x65432,_0x3cfd00){if(_0x2f7092[_0x0a9e('0x4b')]['id']){delete _0x2f7092[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0x2f7092[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x65432,null))[_0x0a9e('0x1f')](function(_0x121cef){if(_0x121cef){_0x2f7092[_0x0a9e('0x4b')][_0x0a9e('0x4e')]=_0x121cef['id'];return db[_0x0a9e('0x4d')][_0x0a9e('0x43')](_0x2f7092['body']);}})[_0x0a9e('0x1f')](respondWithResult(_0x65432,null))[_0x0a9e('0x3e')](handleError(_0x65432,null));};exports['getAllConditions']=function(_0x3649cc,_0x5cc8fb,_0x20c668){var _0x5ba1f9={};var _0x4b3c1a={};var _0x5674ee;var _0x273cb5;return db['Trigger'][_0x0a9e('0x4f')]({'where':{'id':_0x3649cc[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5cc8fb,null))[_0x0a9e('0x1f')](function(_0x1cca9f){if(_0x1cca9f){_0x5674ee=_0x1cca9f;_0x4b3c1a[_0x0a9e('0x28')]=_['keys'](db[_0x0a9e('0x4d')]['rawAttributes']);_0x4b3c1a[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x3649cc[_0x0a9e('0x2a')]);_0x4b3c1a['filters']=_[_0x0a9e('0x2c')](_0x4b3c1a[_0x0a9e('0x28')],_0x4b3c1a[_0x0a9e('0x2a')]);_0x5ba1f9[_0x0a9e('0x2d')]=_['intersection'](_0x4b3c1a[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x3649cc['query'][_0x0a9e('0x2e')]));_0x5ba1f9[_0x0a9e('0x2d')]=_0x5ba1f9[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x5ba1f9[_0x0a9e('0x2d')]:_0x4b3c1a['model'];_0x5ba1f9[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x3649cc[_0x0a9e('0x2a')]['sort']);_0x5ba1f9[_0x0a9e('0x33')]=qs['filters'](_['pick'](_0x3649cc[_0x0a9e('0x2a')],_0x4b3c1a[_0x0a9e('0x2b')]));if(_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x5ba1f9[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x5ba1f9[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x5ba1f9[_0x0a9e('0x2d')],function(_0x1cc4f3){var _0x2e89b7={};_0x2e89b7[_0x1cc4f3]={'$like':'%'+_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x2e89b7;})});}_0x5ba1f9=_[_0x0a9e('0x41')]({},_0x5ba1f9,_0x3649cc[_0x0a9e('0x39')]);return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})[_0x0a9e('0x1f')](function(_0x4257c9){if(_0x4257c9){_0x273cb5=_0x4257c9['length'];if(!_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x5ba1f9['limit']=qs[_0x0a9e('0x19')](_0x3649cc[_0x0a9e('0x2a')]['limit']);_0x5ba1f9[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x3649cc[_0x0a9e('0x2a')][_0x0a9e('0x18')]);}return _0x5674ee[_0x0a9e('0x51')](_0x5ba1f9);}})['then'](function(_0x50cdce){if(_0x50cdce){return _0x50cdce?{'count':_0x273cb5,'rows':_0x50cdce}:null;}})['then'](respondWithResult(_0x5cc8fb,null))[_0x0a9e('0x3e')](handleError(_0x5cc8fb,null));};exports[_0x0a9e('0x53')]=function(_0x1104ad,_0x23a7d3,_0x6abd03){var _0x380ab3={};var _0xeef20={};var _0x1a0677;var _0x5512d1;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x1104ad[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x23a7d3,null))[_0x0a9e('0x1f')](function(_0x583b2e){if(_0x583b2e){_0x1a0677=_0x583b2e;_0xeef20[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db['Condition'][_0x0a9e('0x27')]);_0xeef20[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x1104ad[_0x0a9e('0x2a')]);_0xeef20['filters']=_[_0x0a9e('0x2c')](_0xeef20[_0x0a9e('0x28')],_0xeef20[_0x0a9e('0x2a')]);_0x380ab3[_0x0a9e('0x2d')]=_['intersection'](_0xeef20[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x2e')]));_0x380ab3['attributes']=_0x380ab3[_0x0a9e('0x2d')][_0x0a9e('0x2f')]?_0x380ab3[_0x0a9e('0x2d')]:_0xeef20[_0x0a9e('0x28')];_0x380ab3[_0x0a9e('0x31')]=qs[_0x0a9e('0x32')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x32')]);_0x380ab3[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x1104ad[_0x0a9e('0x2a')],_0xeef20[_0x0a9e('0x2b')]));if(_0x1104ad[_0x0a9e('0x2a')]['filter']){_0x380ab3[_0x0a9e('0x33')]=_[_0x0a9e('0x41')](_0x380ab3[_0x0a9e('0x33')],{'$or':_['map'](_0x380ab3[_0x0a9e('0x2d')],function(_0x33dda0){var _0x8cea96={};_0x8cea96[_0x33dda0]={'$like':'%'+_0x1104ad[_0x0a9e('0x2a')]['filter']+'%'};return _0x8cea96;})});}_0x380ab3=_['merge']({},_0x380ab3,_0x1104ad[_0x0a9e('0x39')]);return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})['then'](function(_0x45108c){if(_0x45108c){_0x5512d1=_0x45108c['length'];if(!_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x52')]('nolimit')){_0x380ab3[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x1104ad[_0x0a9e('0x2a')][_0x0a9e('0x19')]);_0x380ab3[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x1104ad[_0x0a9e('0x2a')]['offset']);}return _0x1a0677[_0x0a9e('0x53')](_0x380ab3);}})[_0x0a9e('0x1f')](function(_0x45c109){if(_0x45c109){return _0x45c109?{'count':_0x5512d1,'rows':_0x45c109}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x23a7d3,null))['catch'](handleError(_0x23a7d3,null));};exports[_0x0a9e('0x55')]=function(_0xf0db1,_0x4bf3a5,_0x1d6834){if(_0xf0db1['body']['id']){delete _0xf0db1[_0x0a9e('0x4b')]['id'];}return db[_0x0a9e('0x3c')][_0x0a9e('0x42')]({'where':{'id':_0xf0db1[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x4bf3a5,null))['then'](function(_0x353384){if(_0x353384){_0xf0db1[_0x0a9e('0x4b')][_0x0a9e('0x56')]=_0x353384['id'];return db['Action'][_0x0a9e('0x43')](_0xf0db1[_0x0a9e('0x4b')]);}})['then'](respondWithResult(_0x4bf3a5,null))['catch'](handleError(_0x4bf3a5,null));};exports[_0x0a9e('0x57')]=function(_0x56acca,_0x5ea541,_0x4dc6b3){var _0x81d748={};var _0xf3601c={};var _0x9044fe;var _0x3bfadf;return db[_0x0a9e('0x3c')][_0x0a9e('0x4f')]({'where':{'id':_0x56acca['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x5ea541,null))['then'](function(_0x2871c1){if(_0x2871c1){_0x9044fe=_0x2871c1;_0xf3601c[_0x0a9e('0x28')]=_[_0x0a9e('0x29')](db[_0x0a9e('0x58')]['rawAttributes']);_0xf3601c[_0x0a9e('0x2a')]=_[_0x0a9e('0x29')](_0x56acca[_0x0a9e('0x2a')]);_0xf3601c['filters']=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],_0xf3601c[_0x0a9e('0x2a')]);_0x81d748[_0x0a9e('0x2d')]=_[_0x0a9e('0x2c')](_0xf3601c[_0x0a9e('0x28')],qs[_0x0a9e('0x2e')](_0x56acca[_0x0a9e('0x2a')]['fields']));_0x81d748[_0x0a9e('0x2d')]=_0x81d748[_0x0a9e('0x2d')]['length']?_0x81d748[_0x0a9e('0x2d')]:_0xf3601c[_0x0a9e('0x28')];_0x81d748[_0x0a9e('0x31')]=qs['sort'](_0x56acca[_0x0a9e('0x2a')]['sort']);_0x81d748[_0x0a9e('0x33')]=qs[_0x0a9e('0x2b')](_[_0x0a9e('0x54')](_0x56acca[_0x0a9e('0x2a')],_0xf3601c[_0x0a9e('0x2b')]));if(_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]){_0x81d748[_0x0a9e('0x33')]=_['merge'](_0x81d748[_0x0a9e('0x33')],{'$or':_[_0x0a9e('0x50')](_0x81d748[_0x0a9e('0x2d')],function(_0x30ef6e){var _0x28e60a={};_0x28e60a[_0x30ef6e]={'$like':'%'+_0x56acca[_0x0a9e('0x2a')][_0x0a9e('0x34')]+'%'};return _0x28e60a;})});}_0x81d748=_[_0x0a9e('0x41')]({},_0x81d748,_0x56acca[_0x0a9e('0x39')]);return _0x9044fe[_0x0a9e('0x57')](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x3754e2){if(_0x3754e2){_0x3bfadf=_0x3754e2[_0x0a9e('0x2f')];if(!_0x56acca['query'][_0x0a9e('0x52')](_0x0a9e('0x30'))){_0x81d748[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x56acca[_0x0a9e('0x2a')]['limit']);_0x81d748[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x56acca['query'][_0x0a9e('0x18')]);}return _0x9044fe['getActions'](_0x81d748);}})[_0x0a9e('0x1f')](function(_0x27041d){if(_0x27041d){return _0x27041d?{'count':_0x3bfadf,'rows':_0x27041d}:null;}})[_0x0a9e('0x1f')](respondWithResult(_0x5ea541,null))[_0x0a9e('0x3e')](handleError(_0x5ea541,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index a1b6eea..d30aca5 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 _0xe706=['request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1c393f,_0x5a2a3b){var _0x2fe89d=function(_0x10b173){while(--_0x10b173){_0x1c393f['push'](_0x1c393f['shift']());}};_0x2fe89d(++_0x5a2a3b);}(_0xe706,0xa3));var _0x6e70=function(_0x3403d5,_0x3d99fc){_0x3403d5=_0x3403d5-0x0;var _0xf9df4f=_0xe706[_0x3403d5];return _0xf9df4f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./trigger.attributes','Trigger','tools_triggers','lodash','util'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0x4fc2,0x111));var _0x24fc=function(_0x2ab8f4,_0x192abd){_0x2ab8f4=_0x2ab8f4-0x0;var _0xf1bee6=_0x4fc2[_0x2ab8f4];return _0xf1bee6;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 7f2ff1f..3c3fc90 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 _0xee41=['then','info','Trigger,\x20%s,\x20%s','request\x20sent','error','message','result','GetTrigger','Trigger','findAll','options','where','limit','include','map','model','attributes','debug','catch','find','raw','ShowTrigger','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x2bfacb,_0x515cc6){var _0x41d9fc=function(_0x24da0f){while(--_0x24da0f){_0x2bfacb['push'](_0x2bfacb['shift']());}};_0x41d9fc(++_0x515cc6);}(_0xee41,0x7c));var _0x1ee4=function(_0x5e462b,_0x187b06){_0x5e462b=_0x5e462b-0x0;var _0xb01a65=_0xee41[_0x5e462b];return _0xb01a65;};'use strict';var _=require(_0x1ee4('0x0'));var util=require('util');var moment=require(_0x1ee4('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ee4('0x2'));var fs=require('fs');var Redis=require(_0x1ee4('0x3'));var db=require(_0x1ee4('0x4'))['db'];var utils=require(_0x1ee4('0x5'));var logger=require(_0x1ee4('0x6'))(_0x1ee4('0x7'));var config=require(_0x1ee4('0x8'));var jayson=require(_0x1ee4('0x9'));var client=jayson[_0x1ee4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47c16b,_0x704121,_0x180ce7){return new BPromise(function(_0x5854cc,_0x195197){return client[_0x1ee4('0xb')](_0x47c16b,_0x180ce7)[_0x1ee4('0xc')](function(_0x129824){logger[_0x1ee4('0xd')](_0x1ee4('0xe'),_0x704121,'request\x20sent');logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x704121,_0x1ee4('0xf'),JSON['stringify'](_0x129824));if(_0x129824['error']){if(_0x129824['error']['code']===0x1f4){logger[_0x1ee4('0x10')](_0x1ee4('0xe'),_0x704121,_0x129824[_0x1ee4('0x10')][_0x1ee4('0x11')]);return _0x195197(_0x129824['error'][_0x1ee4('0x11')]);}logger[_0x1ee4('0x10')](_0x1ee4('0xe'),_0x704121,_0x129824[_0x1ee4('0x10')]['message']);return _0x5854cc(_0x129824[_0x1ee4('0x10')][_0x1ee4('0x11')]);}else{logger[_0x1ee4('0xd')](_0x1ee4('0xe'),_0x704121,'request\x20sent');_0x5854cc(_0x129824[_0x1ee4('0x12')]['message']);}})['catch'](function(_0x2238b1){logger[_0x1ee4('0x10')]('Trigger,\x20%s,\x20%s',_0x704121,_0x2238b1);_0x195197(_0x2238b1);});});}exports[_0x1ee4('0x13')]=function(_0xe25917){var _0x5ab102=this;return new Promise(function(_0x3ad220,_0x83dd08){return db[_0x1ee4('0x14')][_0x1ee4('0x15')]({'raw':_0xe25917[_0x1ee4('0x16')]?_0xe25917[_0x1ee4('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xe25917['options']?_0xe25917[_0x1ee4('0x16')][_0x1ee4('0x17')]||null:null,'attributes':_0xe25917['options']?_0xe25917[_0x1ee4('0x16')]['attributes']||null:null,'limit':_0xe25917['options']?_0xe25917[_0x1ee4('0x16')][_0x1ee4('0x18')]||null:null,'include':_0xe25917[_0x1ee4('0x16')]?_0xe25917[_0x1ee4('0x16')][_0x1ee4('0x19')]?_[_0x1ee4('0x1a')](_0xe25917[_0x1ee4('0x16')][_0x1ee4('0x19')],function(_0x39dd17){return{'model':db[_0x39dd17[_0x1ee4('0x1b')]],'as':_0x39dd17['as'],'attributes':_0x39dd17[_0x1ee4('0x1c')],'include':_0x39dd17[_0x1ee4('0x19')]?_['map'](_0x39dd17[_0x1ee4('0x19')],function(_0xac1563){return{'model':db[_0xac1563[_0x1ee4('0x1b')]],'as':_0xac1563['as'],'attributes':_0xac1563['attributes'],'include':_0xac1563[_0x1ee4('0x19')]?_[_0x1ee4('0x1a')](_0xac1563[_0x1ee4('0x19')],function(_0x5b121a){return{'model':db[_0x5b121a[_0x1ee4('0x1b')]],'as':_0x5b121a['as'],'attributes':_0x5b121a[_0x1ee4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a8160){logger[_0x1ee4('0xd')](_0x1ee4('0x13'),_0xe25917);logger[_0x1ee4('0x1d')](_0x1ee4('0x13'),_0xe25917,JSON['stringify'](_0x3a8160));_0x3ad220(_0x3a8160);})[_0x1ee4('0x1e')](function(_0x19983f){logger['error'](_0x1ee4('0x13'),_0x19983f[_0x1ee4('0x11')],_0xe25917);_0x83dd08(_0x5ab102[_0x1ee4('0x10')](0x1f4,_0x19983f[_0x1ee4('0x11')]));});});};exports['ShowTrigger']=function(_0x55d198){var _0xdef3fc=this;return new Promise(function(_0x3cfef7,_0x211b46){return db[_0x1ee4('0x14')][_0x1ee4('0x1f')]({'raw':_0x55d198[_0x1ee4('0x16')]?_0x55d198['options'][_0x1ee4('0x20')]===undefined?!![]:![]:!![],'where':_0x55d198['options']?_0x55d198[_0x1ee4('0x16')][_0x1ee4('0x17')]||null:null,'attributes':_0x55d198[_0x1ee4('0x16')]?_0x55d198[_0x1ee4('0x16')][_0x1ee4('0x1c')]||null:null,'include':_0x55d198[_0x1ee4('0x16')]?_0x55d198[_0x1ee4('0x16')][_0x1ee4('0x19')]?_[_0x1ee4('0x1a')](_0x55d198['options'][_0x1ee4('0x19')],function(_0x24cab1){return{'model':db[_0x24cab1[_0x1ee4('0x1b')]],'as':_0x24cab1['as'],'attributes':_0x24cab1[_0x1ee4('0x1c')],'include':_0x24cab1['include']?_[_0x1ee4('0x1a')](_0x24cab1[_0x1ee4('0x19')],function(_0x572e7b){return{'model':db[_0x572e7b[_0x1ee4('0x1b')]],'as':_0x572e7b['as'],'attributes':_0x572e7b[_0x1ee4('0x1c')],'include':_0x572e7b['include']?_['map'](_0x572e7b['include'],function(_0x3fe58d){return{'model':db[_0x3fe58d['model']],'as':_0x3fe58d['as'],'attributes':_0x3fe58d[_0x1ee4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fe5ce){logger[_0x1ee4('0xd')](_0x1ee4('0x21'),_0x55d198);logger[_0x1ee4('0x1d')](_0x1ee4('0x21'),_0x55d198,JSON['stringify'](_0x1fe5ce));_0x3cfef7(_0x1fe5ce);})[_0x1ee4('0x1e')](function(_0x2f00f1){logger[_0x1ee4('0x10')](_0x1ee4('0x21'),_0x2f00f1['message'],_0x55d198);_0x211b46(_0xdef3fc[_0x1ee4('0x10')](0x1f4,_0x2f00f1['message']));});});}; \ No newline at end of file +var _0xd841=['limit','include','map','GetTrigger','debug','ShowTrigger','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trigger','findAll','options','raw','where','attributes'];(function(_0x1f48c5,_0x49ede3){var _0x10d7e4=function(_0x2bfe32){while(--_0x2bfe32){_0x1f48c5['push'](_0x1f48c5['shift']());}};_0x10d7e4(++_0x49ede3);}(_0xd841,0x186));var _0x1d84=function(_0x50125a,_0x3aaaf0){_0x50125a=_0x50125a-0x0;var _0x5d9ed1=_0xd841[_0x50125a];return _0x5d9ed1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1d84('0x0'));var rs=require(_0x1d84('0x1'));var fs=require('fs');var Redis=require(_0x1d84('0x2'));var db=require(_0x1d84('0x3'))['db'];var utils=require(_0x1d84('0x4'));var logger=require('../../config/logger')(_0x1d84('0x5'));var config=require(_0x1d84('0x6'));var jayson=require(_0x1d84('0x7'));var client=jayson[_0x1d84('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x210125,_0x4b746d,_0x5801c7){return new BPromise(function(_0x5e715d,_0xd05f68){return client[_0x1d84('0x9')](_0x210125,_0x5801c7)[_0x1d84('0xa')](function(_0x143adb){logger[_0x1d84('0xb')](_0x1d84('0xc'),_0x4b746d,_0x1d84('0xd'));logger['debug'](_0x1d84('0xe'),_0x4b746d,_0x1d84('0xd'),JSON[_0x1d84('0xf')](_0x143adb));if(_0x143adb['error']){if(_0x143adb[_0x1d84('0x10')][_0x1d84('0x11')]===0x1f4){logger[_0x1d84('0x10')](_0x1d84('0xc'),_0x4b746d,_0x143adb[_0x1d84('0x10')][_0x1d84('0x12')]);return _0xd05f68(_0x143adb[_0x1d84('0x10')]['message']);}logger[_0x1d84('0x10')]('Trigger,\x20%s,\x20%s',_0x4b746d,_0x143adb[_0x1d84('0x10')]['message']);return _0x5e715d(_0x143adb['error']['message']);}else{logger[_0x1d84('0xb')](_0x1d84('0xc'),_0x4b746d,_0x1d84('0xd'));_0x5e715d(_0x143adb['result'][_0x1d84('0x12')]);}})[_0x1d84('0x13')](function(_0x3ef061){logger[_0x1d84('0x10')](_0x1d84('0xc'),_0x4b746d,_0x3ef061);_0xd05f68(_0x3ef061);});});}exports['GetTrigger']=function(_0x24e2de){var _0x1614bf=this;return new Promise(function(_0x5df731,_0x252aa1){return db[_0x1d84('0x14')][_0x1d84('0x15')]({'raw':_0x24e2de[_0x1d84('0x16')]?_0x24e2de[_0x1d84('0x16')][_0x1d84('0x17')]===undefined?!![]:![]:!![],'where':_0x24e2de['options']?_0x24e2de[_0x1d84('0x16')][_0x1d84('0x18')]||null:null,'attributes':_0x24e2de[_0x1d84('0x16')]?_0x24e2de[_0x1d84('0x16')][_0x1d84('0x19')]||null:null,'limit':_0x24e2de[_0x1d84('0x16')]?_0x24e2de['options'][_0x1d84('0x1a')]||null:null,'include':_0x24e2de[_0x1d84('0x16')]?_0x24e2de['options']['include']?_['map'](_0x24e2de[_0x1d84('0x16')][_0x1d84('0x1b')],function(_0x2f3b04){return{'model':db[_0x2f3b04['model']],'as':_0x2f3b04['as'],'attributes':_0x2f3b04[_0x1d84('0x19')],'include':_0x2f3b04[_0x1d84('0x1b')]?_[_0x1d84('0x1c')](_0x2f3b04[_0x1d84('0x1b')],function(_0x282363){return{'model':db[_0x282363['model']],'as':_0x282363['as'],'attributes':_0x282363[_0x1d84('0x19')],'include':_0x282363['include']?_['map'](_0x282363[_0x1d84('0x1b')],function(_0x40bb52){return{'model':db[_0x40bb52['model']],'as':_0x40bb52['as'],'attributes':_0x40bb52[_0x1d84('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1d84('0xa')](function(_0x43f0e5){logger[_0x1d84('0xb')](_0x1d84('0x1d'),_0x24e2de);logger[_0x1d84('0x1e')](_0x1d84('0x1d'),_0x24e2de,JSON[_0x1d84('0xf')](_0x43f0e5));_0x5df731(_0x43f0e5);})[_0x1d84('0x13')](function(_0x4ae0da){logger['error'](_0x1d84('0x1d'),_0x4ae0da[_0x1d84('0x12')],_0x24e2de);_0x252aa1(_0x1614bf[_0x1d84('0x10')](0x1f4,_0x4ae0da['message']));});});};exports['ShowTrigger']=function(_0x3be392){var _0x3ac07a=this;return new Promise(function(_0x424715,_0x25ce68){return db[_0x1d84('0x14')]['find']({'raw':_0x3be392[_0x1d84('0x16')]?_0x3be392[_0x1d84('0x16')][_0x1d84('0x17')]===undefined?!![]:![]:!![],'where':_0x3be392['options']?_0x3be392[_0x1d84('0x16')][_0x1d84('0x18')]||null:null,'attributes':_0x3be392[_0x1d84('0x16')]?_0x3be392[_0x1d84('0x16')]['attributes']||null:null,'include':_0x3be392[_0x1d84('0x16')]?_0x3be392['options']['include']?_[_0x1d84('0x1c')](_0x3be392[_0x1d84('0x16')][_0x1d84('0x1b')],function(_0xc5edf5){return{'model':db[_0xc5edf5['model']],'as':_0xc5edf5['as'],'attributes':_0xc5edf5['attributes'],'include':_0xc5edf5[_0x1d84('0x1b')]?_[_0x1d84('0x1c')](_0xc5edf5['include'],function(_0x447cdb){return{'model':db[_0x447cdb['model']],'as':_0x447cdb['as'],'attributes':_0x447cdb['attributes'],'include':_0x447cdb[_0x1d84('0x1b')]?_[_0x1d84('0x1c')](_0x447cdb[_0x1d84('0x1b')],function(_0x15c4fd){return{'model':db[_0x15c4fd['model']],'as':_0x15c4fd['as'],'attributes':_0x15c4fd[_0x1d84('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1d84('0xa')](function(_0x14c0a5){logger[_0x1d84('0xb')](_0x1d84('0x1f'),_0x3be392);logger[_0x1d84('0x1e')](_0x1d84('0x1f'),_0x3be392,JSON[_0x1d84('0xf')](_0x14c0a5));_0x424715(_0x14c0a5);})[_0x1d84('0x13')](function(_0x29d121){logger[_0x1d84('0x10')](_0x1d84('0x1f'),_0x29d121[_0x1d84('0x12')],_0x3be392);_0x25ce68(_0x3ac07a['error'](0x1f4,_0x29d121['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 6f9e1bd..50b2deb 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 _0xeb8e=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','/:id/clone','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1ea38f,_0x36531c){var _0x4f2002=function(_0x28d112){while(--_0x28d112){_0x1ea38f['push'](_0x1ea38f['shift']());}};_0x4f2002(++_0x36531c);}(_0xeb8e,0x1ef));var _0xeeb8=function(_0x51bddf,_0x240876){_0x51bddf=_0x51bddf-0x0;var _0x2d2875=_0xeb8e[_0x51bddf];return _0x2d2875;};'use strict';var multer=require('multer');var util=require(_0xeeb8('0x0'));var path=require('path');var timeout=require(_0xeeb8('0x1'));var express=require(_0xeeb8('0x2'));var router=express[_0xeeb8('0x3')]();var auth=require(_0xeeb8('0x4'));var interaction=require(_0xeeb8('0x5'));var config=require(_0xeeb8('0x6'));var controller=require(_0xeeb8('0x7'));router[_0xeeb8('0x8')]('/',auth[_0xeeb8('0x9')](),controller[_0xeeb8('0xa')]);router[_0xeeb8('0x8')](_0xeeb8('0xb'),auth[_0xeeb8('0x9')](),controller['show']);router['post'](_0xeeb8('0xc'),auth['isAuthenticated'](),controller['clone']);router[_0xeeb8('0xd')]('/',auth['isAuthenticated'](),controller[_0xeeb8('0xe')]);router[_0xeeb8('0xf')](_0xeeb8('0xb'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x10')]);router[_0xeeb8('0x11')](_0xeeb8('0xb'),auth[_0xeeb8('0x9')](),controller[_0xeeb8('0x12')]);module[_0xeeb8('0x13')]=router; \ No newline at end of file +var _0x9ecf=['connect-timeout','express','Router','../../components/auth/service','./trunk.controller','get','isAuthenticated','/:id','show','post','/:id/clone','clone','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x520e2a,_0x248968){var _0x4ea24f=function(_0x1c9a31){while(--_0x1c9a31){_0x520e2a['push'](_0x520e2a['shift']());}};_0x4ea24f(++_0x248968);}(_0x9ecf,0xe4));var _0xf9ec=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0x9ecf[_0x38af48];return _0x445384;};'use strict';var multer=require(_0xf9ec('0x0'));var util=require(_0xf9ec('0x1'));var path=require(_0xf9ec('0x2'));var timeout=require(_0xf9ec('0x3'));var express=require(_0xf9ec('0x4'));var router=express[_0xf9ec('0x5')]();var auth=require(_0xf9ec('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf9ec('0x7'));router[_0xf9ec('0x8')]('/',auth[_0xf9ec('0x9')](),controller['index']);router[_0xf9ec('0x8')](_0xf9ec('0xa'),auth['isAuthenticated'](),controller[_0xf9ec('0xb')]);router[_0xf9ec('0xc')](_0xf9ec('0xd'),auth[_0xf9ec('0x9')](),controller[_0xf9ec('0xe')]);router[_0xf9ec('0xc')]('/',auth[_0xf9ec('0x9')](),controller[_0xf9ec('0xf')]);router[_0xf9ec('0x10')](_0xf9ec('0xa'),auth[_0xf9ec('0x9')](),controller[_0xf9ec('0x11')]);router[_0xf9ec('0x12')]('/:id',auth[_0xf9ec('0x9')](),controller[_0xf9ec('0x13')]);module[_0xf9ec('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index be893c0..eb24eec 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 _0x0b0e=['setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','insecure','yes','never','\x22\x22\x20<>','INTEGER','always','accept','originate','uac','uas','pai','fingerprint','active','passive','dynamic','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp'];(function(_0x1e081a,_0x482d6b){var _0x428209=function(_0x524b53){while(--_0x524b53){_0x1e081a['push'](_0x1e081a['shift']());}};_0x428209(++_0x482d6b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x40b66c,_0x5c1d58){_0x40b66c=_0x40b66c-0x0;var _0x159671=_0x0b0e[_0x40b66c];return _0x159671;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'name':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5')),'allowNull':![],'defaultValue':_0xe0b0('0x3')},'context':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':_0xe0b0('0x6')},'callingpres':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'))},'deny':{'type':Sequelize[_0xe0b0('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xe0b0('0x1')]},'md5secret':{'type':Sequelize[_0xe0b0('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0xd'),'set':function(_0x574d96){this[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x574d96?_0x574d96[_0xe0b0('0x10')](','):null);},'get':function(){return this['getDataValue'](_0xe0b0('0xf'))?this[_0xe0b0('0x11')](_0xe0b0('0xf'))[_0xe0b0('0x12')](','):null;},'comment':_0xe0b0('0x13')},'dtmfmode':{'type':Sequelize['ENUM'](_0xe0b0('0x14'),_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),_0xe0b0('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xe0b0('0x2')]('yes','no',_0xe0b0('0x19'),_0xe0b0('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe0b0('0x1')]},'directmediadeny':{'type':Sequelize[_0xe0b0('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x46bb44){this['setDataValue']('nat',_0x46bb44?_0x46bb44['join'](','):null);},'get':function(){return this[_0xe0b0('0x11')]('nat')?this['getDataValue'](_0xe0b0('0x1b'))['split'](','):null;},'comment':_0xe0b0('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe0b0('0x1')]},'pickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe0b0('0x1')]},'language':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x12b260){this[_0xe0b0('0xe')]('allow',_0x12b260?_0x12b260[_0xe0b0('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe0b0('0x11')]('allow')?this[_0xe0b0('0x11')]('allow')[_0xe0b0('0x12')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'port,invite','set':function(_0x362aba){this[_0xe0b0('0xe')](_0xe0b0('0x1d'),_0x362aba?_0x362aba[_0xe0b0('0x10')](','):null);},'get':function(){return this[_0xe0b0('0x11')](_0xe0b0('0x1d'))?this['getDataValue'](_0xe0b0('0x1d'))[_0xe0b0('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x1f'))},'promiscredir':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no')},'useclientcode':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0xe0b0('0x1')]},'callerid':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x20')},'amaflags':{'type':Sequelize[_0xe0b0('0x1')]},'callcounter':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':_0xe0b0('0x1e')},'busylevel':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'allowoverlap':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'allowsubscribe':{'type':Sequelize[_0xe0b0('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribecontext':{'type':Sequelize[_0xe0b0('0x1')]},'template':{'type':Sequelize[_0xe0b0('0x1')]},'videosupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'session_timers':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x23'),'refuse',_0xe0b0('0x24'))},'session_expires':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_minse':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x25'),_0xe0b0('0x26')),'defaultValue':_0xe0b0('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xe0b0('0x21')](0x5)},'qualify':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'defaultip':{'type':Sequelize[_0xe0b0('0x1')]},'defaultuser':{'type':Sequelize[_0xe0b0('0x1')]},'rtptimeout':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no',_0xe0b0('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xe0b0('0x1')]},'callbackextension':{'type':Sequelize[_0xe0b0('0x1')]},'timert1':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'timerb':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xe0b0('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xe0b0('0x1')]},'use_q850_reason':{'type':Sequelize[_0xe0b0('0x1')]},'maxforwards':{'type':Sequelize[_0xe0b0('0x21')](0xb)},'encryption':{'type':Sequelize[_0xe0b0('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'force_avp':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'icesupport':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsenable':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xe0b0('0x1')]},'dtlscapath':{'type':Sequelize[_0xe0b0('0x1')]},'dtlssetup':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x29'),_0xe0b0('0x2a'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe0b0('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xe0b0('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'subscribemwi':{'type':Sequelize[_0xe0b0('0x2')](_0xe0b0('0x1e'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xe0b0('0x1')]},'parkinglot':{'type':Sequelize[_0xe0b0('0x1')]},'description':{'type':Sequelize[_0xe0b0('0x1')]},'host':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':_0xe0b0('0x2b')},'canreinvite':{'type':Sequelize['ENUM'](_0xe0b0('0x1e'),'no',_0xe0b0('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xe0b0('0x1')]},'active':{'type':Sequelize[_0xe0b0('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x757a=['always','accept','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update,nonat','exports','STRING','user','peer','friend','from-voip-provider','ENUM','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','nat','join','getDataValue','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>'];(function(_0xa72749,_0x5ca5ee){var _0x27463f=function(_0xd68f2a){while(--_0xd68f2a){_0xa72749['push'](_0xa72749['shift']());}};_0x27463f(++_0x5ca5ee);}(_0x757a,0xde));var _0xa757=function(_0x16fe56,_0x2d0cbd){_0x16fe56=_0x16fe56-0x0;var _0x3602e3=_0x757a[_0x16fe56];return _0x3602e3;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend',_0xa757('0x2'),_0xa757('0x3')),'allowNull':![],'defaultValue':_0xa757('0x4')},'context':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'defaultValue':_0xa757('0x5')},'callingpres':{'type':Sequelize[_0xa757('0x6')]('ALLOWED_NOT_SCREENED',_0xa757('0x7'),_0xa757('0x8'),'ALLOWED',_0xa757('0x9'),_0xa757('0xa'),_0xa757('0xb'),_0xa757('0xc'))},'deny':{'type':Sequelize[_0xa757('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xa757('0x1')]},'md5secret':{'type':Sequelize[_0xa757('0x1')]},'remotesecret':{'type':Sequelize[_0xa757('0x1')]},'transport':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0xd'),'set':function(_0x188ad5){this[_0xa757('0xe')]('transport',_0x188ad5?_0x188ad5['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this['getDataValue'](_0xa757('0xf'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xa757('0x6')]('rfc2833','info',_0xa757('0x10'),_0xa757('0x11'),_0xa757('0x12')),'defaultValue':_0xa757('0x13')},'directmedia':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x15'),_0xa757('0x16'),_0xa757('0x17')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa757('0x6')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xa757('0x1')]},'directmediadeny':{'type':Sequelize[_0xa757('0x1')]},'nat':{'type':Sequelize[_0xa757('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x54b305){this[_0xa757('0xe')](_0xa757('0x18'),_0x54b305?_0x54b305[_0xa757('0x19')](','):null);},'get':function(){return this[_0xa757('0x1a')](_0xa757('0x18'))?this[_0xa757('0x1a')]('nat')[_0xa757('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xa757('0x1')]},'namedcallgroup':{'type':Sequelize[_0xa757('0x1')]},'pickupgroup':{'type':Sequelize[_0xa757('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xa757('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x1c')},'allow':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'defaultValue':_0xa757('0x1d'),'set':function(_0x1d6e2){this[_0xa757('0xe')](_0xa757('0x1e'),_0x1d6e2?_0x1d6e2[_0xa757('0x19')](';'):_0xa757('0x1d'));},'get':function(){return this['getDataValue'](_0xa757('0x1e'))?this['getDataValue'](_0xa757('0x1e'))['split'](';'):null;},'comment':_0xa757('0x1f')},'autoframing':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xa757('0x20'),'set':function(_0xcd98bd){this[_0xa757('0xe')](_0xa757('0x21'),_0xcd98bd?_0xcd98bd['join'](','):null);},'get':function(){return this[_0xa757('0x1a')]('insecure')?this['getDataValue']('insecure')['split'](','):null;},'comment':_0xa757('0x22')},'trustrpid':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa757('0x6')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa757('0x6')]('yes','no',_0xa757('0x23'))},'promiscredir':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'useclientcode':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'accountcode':{'type':Sequelize[_0xa757('0x24')](0xb)},'setvar':{'type':Sequelize[_0xa757('0x1')]},'callerid':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x25')},'amaflags':{'type':Sequelize[_0xa757('0x1')]},'callcounter':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':_0xa757('0x14')},'busylevel':{'type':Sequelize[_0xa757('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0xa757('0x1')]},'template':{'type':Sequelize[_0xa757('0x1')]},'videosupport':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xa757('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'mailbox':{'type':Sequelize[_0xa757('0x1')]},'session_timers':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x27'),_0xa757('0x28'),_0xa757('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xa757('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x2a'),_0xa757('0x2b')),'defaultValue':_0xa757('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0xa757('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0xa757('0x1')]},'fromuser':{'type':Sequelize[_0xa757('0x1')]},'port':{'type':Sequelize[_0xa757('0x24')](0x5)},'qualify':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':_0xa757('0x14')},'keepalive':{'type':Sequelize[_0xa757('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xa757('0x1')]},'defaultuser':{'type':Sequelize[_0xa757('0x1')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xa757('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa757('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no',_0xa757('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa757('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xa757('0x24')](0xb)},'timerb':{'type':Sequelize[_0xa757('0x24')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xa757('0x1')]},'contactacl':{'type':Sequelize[_0xa757('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xa757('0x24')](0xb)},'encryption':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'force_avp':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'icesupport':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x14'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xa757('0x2d'),_0xa757('0x2e'))},'dtlsrekey':{'type':Sequelize[_0xa757('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xa757('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xa757('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xa757('0x1')]},'dtlssetup':{'type':Sequelize[_0xa757('0x6')](_0xa757('0x2f'),_0xa757('0x30'),_0xa757('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa757('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa757('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xa757('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0xa757('0x6')]('yes','no')},'vmexten':{'type':Sequelize[_0xa757('0x1')]},'mohinterpret':{'type':Sequelize[_0xa757('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xa757('0x1')]},'description':{'type':Sequelize[_0xa757('0x1')]},'host':{'type':Sequelize[_0xa757('0x1')],'defaultValue':_0xa757('0x32')},'canreinvite':{'type':Sequelize['ENUM'](_0xa757('0x14'),'no',_0xa757('0x15'),_0xa757('0x16'),_0xa757('0x33')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xa757('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index c82bd28..d4b5887 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 _0x727a=['params','rawAttributes','find','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','utf8','server/files/templates/registry.ejs','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','role','update','server/files/templates/trunk.ejs','Reload','chan_sip.so','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','json','save','destroy','get','Trunks','UserProfileResource','name','send','index','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','map','type','key','VIRTUAL','options','includeAll','include','Trunk','findAll','rows','show','merge','clone'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x727a,0x15c));var _0xa727=function(_0x488710,_0x5e5d23){_0x488710=_0x488710-0x0;var _0x1a9aa1=_0x727a[_0x488710];return _0x1a9aa1;};'use strict';var pdf=require(_0xa727('0x0'));var emlformat=require(_0xa727('0x1'));var rimraf=require(_0xa727('0x2'));var zipdir=require(_0xa727('0x3'));var jsonpatch=require(_0xa727('0x4'));var rp=require('request-promise');var moment=require(_0xa727('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa727('0x6'));var util=require('util');var path=require(_0xa727('0x7'));var sox=require('sox');var csv=require(_0xa727('0x8'));var ejs=require(_0xa727('0x9'));var fs=require('fs');var _=require(_0xa727('0xa'));var squel=require(_0xa727('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa727('0xc'));var toCsv=require(_0xa727('0x8'));var querystring=require('querystring');var Papa=require(_0xa727('0xd'));var Redis=require(_0xa727('0xe'));var authService=require(_0xa727('0xf'));var qs=require(_0xa727('0x10'));var hardwareService=require(_0xa727('0x11'));var logger=require(_0xa727('0x12'))(_0xa727('0x13'));var utils=require(_0xa727('0x14'));var config=require('../../config/environment');var db=require(_0xa727('0x15'))['db'];var jayson=require(_0xa727('0x16'));var client=jayson['client'][_0xa727('0x17')]({'port':0x232a});function checkPasswordPattern(_0x5158e1,_0xeb0af3,_0x1c927e){if(_0x1c927e){var _0x21a5e0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21a5e0[_0xa727('0x18')](_0xeb0af3)){return _0x5158e1;}else{throw new Error(_0xa727('0x19'));}}else{return _0x5158e1;}}function respondWithRpcPromise(_0x1c2299,_0x102325,_0x48a8e1,_0x57dee6){return new BPromise(function(_0x32c296,_0xd1a0a4){var _0x1bb0e9=_0x57dee6||client;return _0x1bb0e9['request'](_0x1c2299,_0x48a8e1)[_0xa727('0x1a')](function(_0x429ea9){logger[_0xa727('0x1b')](_0xa727('0x1c'),_0x102325,_0xa727('0x1d'));logger[_0xa727('0x1e')](_0xa727('0x1f'),_0x102325,_0xa727('0x1d'),JSON[_0xa727('0x20')](_0x429ea9));if(_0x429ea9[_0xa727('0x21')]){if(_0x429ea9[_0xa727('0x21')][_0xa727('0x22')]===0x1f4){logger['error'](_0xa727('0x1c'),_0x102325,_0x429ea9[_0xa727('0x21')][_0xa727('0x23')]);return _0xd1a0a4(_0x429ea9[_0xa727('0x21')][_0xa727('0x23')]);}logger[_0xa727('0x21')]('Trunk,\x20%s,\x20%s',_0x102325,_0x429ea9[_0xa727('0x21')][_0xa727('0x23')]);return _0x32c296(_0x429ea9[_0xa727('0x21')][_0xa727('0x23')]);}else{logger[_0xa727('0x1b')]('Trunk,\x20%s,\x20%s',_0x102325,_0xa727('0x1d'));_0x32c296(_0x429ea9['result'][_0xa727('0x23')]);}})[_0xa727('0x24')](function(_0x154ffd){logger[_0xa727('0x21')](_0xa727('0x1c'),_0x102325,_0x154ffd);_0xd1a0a4(_0x154ffd);});});}function respondWithStatusCode(_0x312eba,_0x6596a4){_0x6596a4=_0x6596a4||0xcc;return function(_0x3330a5){if(_0x3330a5){return _0x312eba[_0xa727('0x25')](_0x6596a4);}return _0x312eba[_0xa727('0x26')](_0x6596a4)[_0xa727('0x27')]();};}function respondWithResult(_0xfdc12d,_0x1b1ac0){_0x1b1ac0=_0x1b1ac0||0xc8;return function(_0x2eb8e4){if(_0x2eb8e4){return _0xfdc12d[_0xa727('0x26')](_0x1b1ac0)['json'](_0x2eb8e4);}};}function respondWithFilteredResult(_0x508ff0,_0x2a1f2d){return function(_0x3772ae){if(_0x3772ae){var _0x7ee055=_0x3772ae[_0xa727('0x28')],_0x5a7183=_0x2a1f2d[_0xa727('0x29')],_0x4efdf4=_0x2a1f2d[_0xa727('0x29')]+_0x2a1f2d[_0xa727('0x2a')],_0x45b094;if(_0x4efdf4>=_0x7ee055){_0x4efdf4=_0x7ee055;_0x45b094=0xc8;}else{_0x45b094=0xce;}_0x508ff0['status'](_0x45b094);return _0x508ff0[_0xa727('0x2b')]('Content-Range',_0x5a7183+'-'+_0x4efdf4+'/'+_0x7ee055)[_0xa727('0x2c')](_0x3772ae);}return null;};}function patchUpdates(_0x36d654){return function(_0x65ee99){try{jsonpatch['apply'](_0x65ee99,_0x36d654,!![]);}catch(_0x54dbc6){return BPromise['reject'](_0x54dbc6);}return _0x65ee99[_0xa727('0x2d')]();};}function saveUpdates(_0x27db6e,_0x293d85){return function(_0x4c1eeb){if(_0x4c1eeb){return _0x4c1eeb['update'](_0x27db6e)['then'](function(_0x168595){return _0x168595;});}return null;};}function removeEntity(_0x344aae,_0x2d1967){return function(_0x2cd978){if(_0x2cd978){return _0x2cd978[_0xa727('0x2e')]()['then'](function(){var _0x24e334=_0x2cd978[_0xa727('0x2f')]({'plain':!![]});var _0x5c6237=_0xa727('0x30');return db[_0xa727('0x31')]['destroy']({'where':{'type':_0x5c6237,'resourceId':_0x24e334['id']}})[_0xa727('0x1a')](function(){return _0x2cd978;});})[_0xa727('0x1a')](function(){_0x344aae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41158f,_0x19cfac){return function(_0x963830){if(!_0x963830){_0x41158f[_0xa727('0x25')](0x194);}return _0x963830;};}function handleError(_0x15a0f4,_0x37f703){_0x37f703=_0x37f703||0x1f4;return function(_0x10dead){logger[_0xa727('0x21')](_0x10dead['stack']);if(_0x10dead[_0xa727('0x32')]){delete _0x10dead[_0xa727('0x32')];}_0x15a0f4[_0xa727('0x26')](_0x37f703)[_0xa727('0x33')](_0x10dead);};}exports[_0xa727('0x34')]=function(_0x323a7c,_0xbf9597){var _0x2b6362={},_0x4b24cd={},_0x472ced={'count':0x0,'rows':[]};var _0x2ae00d=db['Trunk']['rawAttributes'];_0x4b24cd['model']=_[_0xa727('0x35')](_0x2ae00d);_0x4b24cd[_0xa727('0x36')]=_[_0xa727('0x35')](_0x323a7c[_0xa727('0x36')]);_0x4b24cd[_0xa727('0x37')]=_[_0xa727('0x38')](_0x4b24cd['model'],_0x4b24cd[_0xa727('0x36')]);_0x2b6362[_0xa727('0x39')]=_[_0xa727('0x38')](_0x4b24cd[_0xa727('0x3a')],qs[_0xa727('0x3b')](_0x323a7c[_0xa727('0x36')]['fields']));_0x2b6362[_0xa727('0x39')]=_0x2b6362[_0xa727('0x39')][_0xa727('0x3c')]?_0x2b6362[_0xa727('0x39')]:_0x4b24cd['model'];if(!_0x323a7c[_0xa727('0x36')][_0xa727('0x3d')](_0xa727('0x3e'))){_0x2b6362[_0xa727('0x2a')]=qs[_0xa727('0x2a')](_0x323a7c[_0xa727('0x36')][_0xa727('0x2a')]);_0x2b6362[_0xa727('0x29')]=qs[_0xa727('0x29')](_0x323a7c[_0xa727('0x36')]['offset']);}_0x2b6362[_0xa727('0x3f')]=qs['sort'](_0x323a7c[_0xa727('0x36')]['sort']);_0x2b6362['where']=qs['filters'](_[_0xa727('0x40')](_0x323a7c[_0xa727('0x36')],_0x4b24cd[_0xa727('0x37')]));if(_0x323a7c[_0xa727('0x36')][_0xa727('0x41')]){_0x2b6362[_0xa727('0x42')]=_['merge'](_0x2b6362['where'],{'$or':_[_0xa727('0x43')](_0x2ae00d,function(_0xe9b4d4){if(_0xe9b4d4[_0xa727('0x44')][_0xa727('0x45')]!==_0xa727('0x46')){var _0x5d784b={};_0x5d784b[_0xe9b4d4['field']]={'$like':'%'+_0x323a7c[_0xa727('0x36')][_0xa727('0x41')]+'%'};return _0x5d784b;}})});}_0x2b6362=_['merge']({},_0x2b6362,_0x323a7c[_0xa727('0x47')]);var _0x4597a1={'where':_0x2b6362[_0xa727('0x42')]};return db['Trunk'][_0xa727('0x28')](_0x4597a1)['then'](function(_0x16ecae){_0x472ced['count']=_0x16ecae;if(_0x323a7c[_0xa727('0x36')][_0xa727('0x48')]){_0x2b6362[_0xa727('0x49')]=[{'all':!![]}];}return db[_0xa727('0x4a')][_0xa727('0x4b')](_0x2b6362);})[_0xa727('0x1a')](function(_0x15f4d6){_0x472ced[_0xa727('0x4c')]=_0x15f4d6;return _0x472ced;})[_0xa727('0x1a')](respondWithFilteredResult(_0xbf9597,_0x2b6362))[_0xa727('0x24')](handleError(_0xbf9597,null));};exports[_0xa727('0x4d')]=function(_0x299488,_0x2df005){var _0x3fb4d3={'raw':![],'where':{'id':_0x299488['params']['id']}},_0x8d89b4={};_0x8d89b4['model']=_[_0xa727('0x35')](db[_0xa727('0x4a')]['rawAttributes']);_0x8d89b4[_0xa727('0x36')]=_['keys'](_0x299488['query']);_0x8d89b4[_0xa727('0x37')]=_['intersection'](_0x8d89b4['model'],_0x8d89b4[_0xa727('0x36')]);_0x3fb4d3['attributes']=_[_0xa727('0x38')](_0x8d89b4[_0xa727('0x3a')],qs[_0xa727('0x3b')](_0x299488[_0xa727('0x36')][_0xa727('0x3b')]));_0x3fb4d3[_0xa727('0x39')]=_0x3fb4d3[_0xa727('0x39')][_0xa727('0x3c')]?_0x3fb4d3[_0xa727('0x39')]:_0x8d89b4[_0xa727('0x3a')];if(_0x299488[_0xa727('0x36')]['includeAll']){_0x3fb4d3['include']=[{'all':!![]}];}_0x3fb4d3=_[_0xa727('0x4e')]({},_0x3fb4d3,_0x299488[_0xa727('0x47')]);return db[_0xa727('0x4a')]['find'](_0x3fb4d3)[_0xa727('0x1a')](handleEntityNotFound(_0x2df005,null))[_0xa727('0x1a')](respondWithResult(_0x2df005,null))[_0xa727('0x24')](handleError(_0x2df005,null));};exports[_0xa727('0x4f')]=function(_0x248488,_0x1ea921){var _0x1529fc={'raw':![],'where':{'id':_0x248488[_0xa727('0x50')]['id']}},_0x3c33d2={};_0x3c33d2[_0xa727('0x3a')]=_['keys'](db[_0xa727('0x4a')][_0xa727('0x51')]);_0x1529fc[_0xa727('0x39')]=_[_0xa727('0x38')](_0x3c33d2['model'],qs[_0xa727('0x3b')](_0x248488[_0xa727('0x36')][_0xa727('0x3b')]));_0x1529fc['attributes']=_0x1529fc[_0xa727('0x39')]['length']?_0x1529fc[_0xa727('0x39')]:_0x3c33d2[_0xa727('0x3a')];if(_0x248488[_0xa727('0x36')][_0xa727('0x48')]){_0x1529fc['include']=[{'all':!![]}];}_0x1529fc=_['merge']({},_0x1529fc,_0x248488[_0xa727('0x47')]);return db[_0xa727('0x4a')][_0xa727('0x52')](_0x1529fc)['then'](handleEntityNotFound(_0x1ea921,null))[_0xa727('0x1a')](function(_0x21d9ba){if(_0x21d9ba){var _0x18f2f8=_0x21d9ba[_0xa727('0x2f')]({'plain':!![]});_0x18f2f8=qs['omit'](_0x18f2f8,['id','createdAt',_0xa727('0x53')]);_0x248488[_0xa727('0x54')]=_[_0xa727('0x55')](_0x248488['body'],['id','createdAt',_0xa727('0x53')]);return db[_0xa727('0x4a')][_0xa727('0x56')](_['merge'](_0x18f2f8,_0x248488['body']),{'include':_0x248488[_0xa727('0x36')][_0xa727('0x48')]?[{'all':!![]}]:undefined})[_0xa727('0x1a')](function(_0x4f0558){var _0x2bcca8=_0x248488[_0xa727('0x57')][_0xa727('0x2f')]({'plain':!![]});if(!_0x2bcca8)throw new Error(_0xa727('0x58'));if(_0x2bcca8['role']===_0xa727('0x57')){var _0x492ecc=_0x4f0558[_0xa727('0x2f')]({'plain':!![]});var _0x43c31d=_0xa727('0x30');return db[_0xa727('0x59')][_0xa727('0x52')]({'where':{'name':_0x43c31d,'userProfileId':_0x2bcca8[_0xa727('0x5a')]},'raw':!![]})['then'](function(_0x5babe4){if(_0x5babe4&&_0x5babe4[_0xa727('0x5b')]===0x0){return db['UserProfileResource'][_0xa727('0x56')]({'name':_0x492ecc[_0xa727('0x32')],'resourceId':_0x492ecc['id'],'type':_0x5babe4[_0xa727('0x32')],'sectionId':_0x5babe4['id']},{})[_0xa727('0x1a')](function(){return _0x4f0558;});}else{return _0x4f0558;}})[_0xa727('0x24')](function(_0x1c10b5){logger['error'](_0xa727('0x5c'),_0x1c10b5);throw _0x1c10b5;});}return _0x4f0558;});}})[_0xa727('0x1a')](respondWithResult(_0x1ea921,0xc9))[_0xa727('0x24')](handleError(_0x1ea921,null));};exports['create']=function(_0x4b6de6,_0x5868fd,_0x31ea68){var _0x5247a2;return db[_0xa727('0x4a')][_0xa727('0x56')](_0x4b6de6[_0xa727('0x54')],{'raw':!![]})[_0xa727('0x1a')](function(_0x3fbd8d){_0x5247a2=_0x3fbd8d;return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x31f2c1){var _0x3d4f0f=fs[_0xa727('0x5d')](path[_0xa727('0x5e')](config[_0xa727('0x5f')],'server/files/templates/trunk.ejs'),_0xa727('0x60'));var _0x2f298d=fs[_0xa727('0x5d')](path[_0xa727('0x5e')](config[_0xa727('0x5f')],_0xa727('0x61')),_0xa727('0x60'));var _0x1f712f=ejs['render'](_0x3d4f0f,{'trunks':_0x31f2c1||[]});fs[_0xa727('0x62')](_0xa727('0x63'),_0x1f712f);if(_0x5247a2['registry']){var _0x25a199=ejs[_0xa727('0x64')](_0x2f298d,{'trunks':_0x31f2c1||[]});fs['writeFileSync'](_0xa727('0x65'),_0x25a199);}})[_0xa727('0x1a')](function(){return respondWithRpcPromise('Reload',_0xa727('0x56'),{'module':'chan_sip.so'});})[_0xa727('0x1a')](function(){var _0x4b1a5b=_0x4b6de6['user'][_0xa727('0x2f')]({'plain':!![]});if(!_0x4b1a5b)throw new Error(_0xa727('0x58'));if(_0x4b1a5b[_0xa727('0x66')]===_0xa727('0x57')){var _0x2f5cd2=_0x5247a2[_0xa727('0x2f')]({'plain':!![]});return db[_0xa727('0x59')]['find']({'where':{'name':_0xa727('0x30'),'userProfileId':_0x4b1a5b['userProfileId']},'raw':!![]})[_0xa727('0x1a')](function(_0x5a1d15){if(_0x5a1d15&&_0x5a1d15[_0xa727('0x5b')]===0x0){return db['UserProfileResource'][_0xa727('0x56')]({'name':_0x2f5cd2[_0xa727('0x32')],'resourceId':_0x2f5cd2['id'],'type':_0x5a1d15['name'],'sectionId':_0x5a1d15['id']},{})[_0xa727('0x1a')](function(){return _0x5247a2;});}else{return _0x5247a2;}})['catch'](function(_0x300959){logger[_0xa727('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x300959);throw _0x300959;});}return _0x5247a2;})[_0xa727('0x1a')](respondWithResult(_0x5868fd,0xc9))[_0xa727('0x24')](handleError(_0x5868fd,null));};exports[_0xa727('0x67')]=function(_0x2b9a9d,_0x30ae41,_0x249e08){var _0x2cfa2a;return db[_0xa727('0x4a')][_0xa727('0x52')]({'where':{'id':_0x2b9a9d['params']['id']}})[_0xa727('0x1a')](handleEntityNotFound(_0x30ae41,null))[_0xa727('0x1a')](saveUpdates(_0x2b9a9d[_0xa727('0x54')],null))[_0xa727('0x1a')](function(_0x2abb69){if(_0x2abb69){_0x2cfa2a=_0x2abb69;return db['Trunk'][_0xa727('0x4b')]({'raw':!![]});}})[_0xa727('0x1a')](function(_0x50ca41){if(_0x50ca41){var _0x4193d9=fs[_0xa727('0x5d')](path[_0xa727('0x5e')](config[_0xa727('0x5f')],_0xa727('0x68')),_0xa727('0x60'));var _0x14e9f8=fs[_0xa727('0x5d')](path[_0xa727('0x5e')](config[_0xa727('0x5f')],_0xa727('0x61')),_0xa727('0x60'));var _0x42f9ec=ejs['render'](_0x4193d9,{'trunks':_0x50ca41||[]});fs[_0xa727('0x62')]('/etc/asterisk/sip_xcally_trunks.conf',_0x42f9ec);var _0x42de61=ejs[_0xa727('0x64')](_0x14e9f8,{'trunks':_0x50ca41||[]});fs[_0xa727('0x62')](_0xa727('0x65'),_0x42de61);return respondWithRpcPromise(_0xa727('0x69'),_0xa727('0x67'),{'module':'chan_sip.so'});}return null;})['then'](function(_0x4e140f){if(_0x4e140f){return _0x2cfa2a;}})[_0xa727('0x1a')](respondWithResult(_0x30ae41,null))['catch'](handleError(_0x30ae41,null));};exports[_0xa727('0x2e')]=function(_0x1f3bd3,_0x41df0a,_0x2cf8ff){var _0x1a3886;return db[_0xa727('0x4a')][_0xa727('0x52')]({'where':{'id':_0x1f3bd3[_0xa727('0x50')]['id']}})[_0xa727('0x1a')](handleEntityNotFound(_0x41df0a,null))[_0xa727('0x1a')](removeEntity(_0x41df0a,null))['then'](function(){return db[_0xa727('0x4a')][_0xa727('0x4b')]({'raw':!![]});})[_0xa727('0x1a')](function(_0x14ada6){var _0x1edfbe=fs['readFileSync'](path[_0xa727('0x5e')](config[_0xa727('0x5f')],_0xa727('0x68')),_0xa727('0x60'));var _0x55a2f1=fs[_0xa727('0x5d')](path['join'](config[_0xa727('0x5f')],_0xa727('0x61')),_0xa727('0x60'));var _0xb90be8=ejs[_0xa727('0x64')](_0x1edfbe,{'trunks':_0x14ada6});var _0x4a83c7=ejs['render'](_0x55a2f1,{'trunks':_0x14ada6});fs['writeFileSync'](_0xa727('0x63'),_0xb90be8);fs[_0xa727('0x62')](_0xa727('0x65'),_0x4a83c7);return respondWithRpcPromise(_0xa727('0x69'),_0xa727('0x2e'),{'module':_0xa727('0x6a')});})[_0xa727('0x24')](handleError(_0x41df0a,null));}; \ No newline at end of file +var _0x2b28=['limit','order','where','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','Trunk','findAll','rows','catch','show','params','includeAll','include','find','clone','length','createdAt','omit','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','create','readFileSync','join','root','utf8','server/files/templates/registry.ejs','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','status','end','count','offset','set','Content-Range','json','apply','reject','save','destroy','get','UserProfileResource','sendStatus','stack','name','send','rawAttributes','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit'];(function(_0x108048,_0x2f90e9){var _0x1882b6=function(_0x53de27){while(--_0x53de27){_0x108048['push'](_0x108048['shift']());}};_0x1882b6(++_0x2f90e9);}(_0x2b28,0x184));var _0x82b2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2b28[_0x4b369d];return _0x571a98;};'use strict';var pdf=require(_0x82b2('0x0'));var emlformat=require(_0x82b2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x82b2('0x2'));var jsonpatch=require(_0x82b2('0x3'));var rp=require('request-promise');var moment=require(_0x82b2('0x4'));var BPromise=require(_0x82b2('0x5'));var Mustache=require(_0x82b2('0x6'));var util=require(_0x82b2('0x7'));var path=require(_0x82b2('0x8'));var sox=require(_0x82b2('0x9'));var csv=require(_0x82b2('0xa'));var ejs=require(_0x82b2('0xb'));var fs=require('fs');var _=require(_0x82b2('0xc'));var squel=require(_0x82b2('0xd'));var crypto=require(_0x82b2('0xe'));var jsforce=require(_0x82b2('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x82b2('0x10'));var Papa=require(_0x82b2('0x11'));var Redis=require(_0x82b2('0x12'));var authService=require(_0x82b2('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x82b2('0x14'));var logger=require(_0x82b2('0x15'))(_0x82b2('0x16'));var utils=require(_0x82b2('0x17'));var config=require(_0x82b2('0x18'));var db=require(_0x82b2('0x19'))['db'];var jayson=require(_0x82b2('0x1a'));var client=jayson[_0x82b2('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x365862,_0x97b0f0,_0x35da64){if(_0x35da64){var _0x3d4e04=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d4e04[_0x82b2('0x1c')](_0x97b0f0)){return _0x365862;}else{throw new Error('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x365862;}}function respondWithRpcPromise(_0x3b720e,_0x1c96bc,_0x32ca9f,_0x2d25a4){return new BPromise(function(_0x54b45b,_0x46b9f3){var _0x13e2d4=_0x2d25a4||client;return _0x13e2d4['request'](_0x3b720e,_0x32ca9f)[_0x82b2('0x1d')](function(_0xe658ea){logger[_0x82b2('0x1e')](_0x82b2('0x1f'),_0x1c96bc,'request\x20sent');logger[_0x82b2('0x20')](_0x82b2('0x21'),_0x1c96bc,_0x82b2('0x22'),JSON['stringify'](_0xe658ea));if(_0xe658ea[_0x82b2('0x23')]){if(_0xe658ea[_0x82b2('0x23')]['code']===0x1f4){logger[_0x82b2('0x23')](_0x82b2('0x1f'),_0x1c96bc,_0xe658ea[_0x82b2('0x23')]['message']);return _0x46b9f3(_0xe658ea['error']['message']);}logger['error'](_0x82b2('0x1f'),_0x1c96bc,_0xe658ea[_0x82b2('0x23')][_0x82b2('0x24')]);return _0x54b45b(_0xe658ea[_0x82b2('0x23')]['message']);}else{logger[_0x82b2('0x1e')](_0x82b2('0x1f'),_0x1c96bc,_0x82b2('0x22'));_0x54b45b(_0xe658ea[_0x82b2('0x25')][_0x82b2('0x24')]);}})['catch'](function(_0x31333e){logger[_0x82b2('0x23')](_0x82b2('0x1f'),_0x1c96bc,_0x31333e);_0x46b9f3(_0x31333e);});});}function respondWithStatusCode(_0x2b99f8,_0x330177){_0x330177=_0x330177||0xcc;return function(_0x477dfa){if(_0x477dfa){return _0x2b99f8['sendStatus'](_0x330177);}return _0x2b99f8[_0x82b2('0x26')](_0x330177)[_0x82b2('0x27')]();};}function respondWithResult(_0x3216b5,_0x50dd9){_0x50dd9=_0x50dd9||0xc8;return function(_0x53862d){if(_0x53862d){return _0x3216b5[_0x82b2('0x26')](_0x50dd9)['json'](_0x53862d);}};}function respondWithFilteredResult(_0x2b0f8d,_0x4e07d9){return function(_0x3846c9){if(_0x3846c9){var _0x4ef112=_0x3846c9[_0x82b2('0x28')],_0x4dbd1e=_0x4e07d9['offset'],_0x24c3cb=_0x4e07d9[_0x82b2('0x29')]+_0x4e07d9['limit'],_0x32aef1;if(_0x24c3cb>=_0x4ef112){_0x24c3cb=_0x4ef112;_0x32aef1=0xc8;}else{_0x32aef1=0xce;}_0x2b0f8d[_0x82b2('0x26')](_0x32aef1);return _0x2b0f8d[_0x82b2('0x2a')](_0x82b2('0x2b'),_0x4dbd1e+'-'+_0x24c3cb+'/'+_0x4ef112)[_0x82b2('0x2c')](_0x3846c9);}return null;};}function patchUpdates(_0x139789){return function(_0x383fa2){try{jsonpatch[_0x82b2('0x2d')](_0x383fa2,_0x139789,!![]);}catch(_0x16dcc2){return BPromise[_0x82b2('0x2e')](_0x16dcc2);}return _0x383fa2[_0x82b2('0x2f')]();};}function saveUpdates(_0x4d2422,_0x5eca7f){return function(_0x1050bb){if(_0x1050bb){return _0x1050bb['update'](_0x4d2422)[_0x82b2('0x1d')](function(_0x12531e){return _0x12531e;});}return null;};}function removeEntity(_0x2b62f2,_0x56f3b2){return function(_0x37b3c4){if(_0x37b3c4){return _0x37b3c4[_0x82b2('0x30')]()['then'](function(){var _0x444887=_0x37b3c4[_0x82b2('0x31')]({'plain':!![]});var _0xe77d9d='Trunks';return db[_0x82b2('0x32')][_0x82b2('0x30')]({'where':{'type':_0xe77d9d,'resourceId':_0x444887['id']}})[_0x82b2('0x1d')](function(){return _0x37b3c4;});})[_0x82b2('0x1d')](function(){_0x2b62f2['status'](0xcc)[_0x82b2('0x27')]();});}};}function handleEntityNotFound(_0x34925e,_0x3ce35f){return function(_0x188757){if(!_0x188757){_0x34925e[_0x82b2('0x33')](0x194);}return _0x188757;};}function handleError(_0xcab386,_0x376158){_0x376158=_0x376158||0x1f4;return function(_0x4f2322){logger[_0x82b2('0x23')](_0x4f2322[_0x82b2('0x34')]);if(_0x4f2322[_0x82b2('0x35')]){delete _0x4f2322[_0x82b2('0x35')];}_0xcab386[_0x82b2('0x26')](_0x376158)[_0x82b2('0x36')](_0x4f2322);};}exports['index']=function(_0x12acd0,_0x54e6c6){var _0x2b686e={},_0x1b7eb0={},_0x2bac49={'count':0x0,'rows':[]};var _0xbcab86=db['Trunk'][_0x82b2('0x37')];_0x1b7eb0[_0x82b2('0x38')]=_[_0x82b2('0x39')](_0xbcab86);_0x1b7eb0[_0x82b2('0x3a')]=_['keys'](_0x12acd0['query']);_0x1b7eb0['filters']=_[_0x82b2('0x3b')](_0x1b7eb0['model'],_0x1b7eb0[_0x82b2('0x3a')]);_0x2b686e['attributes']=_[_0x82b2('0x3b')](_0x1b7eb0[_0x82b2('0x38')],qs[_0x82b2('0x3c')](_0x12acd0[_0x82b2('0x3a')]['fields']));_0x2b686e['attributes']=_0x2b686e[_0x82b2('0x3d')]['length']?_0x2b686e['attributes']:_0x1b7eb0[_0x82b2('0x38')];if(!_0x12acd0[_0x82b2('0x3a')][_0x82b2('0x3e')](_0x82b2('0x3f'))){_0x2b686e[_0x82b2('0x40')]=qs['limit'](_0x12acd0['query'][_0x82b2('0x40')]);_0x2b686e[_0x82b2('0x29')]=qs['offset'](_0x12acd0['query'][_0x82b2('0x29')]);}_0x2b686e[_0x82b2('0x41')]=qs['sort'](_0x12acd0[_0x82b2('0x3a')]['sort']);_0x2b686e[_0x82b2('0x42')]=qs[_0x82b2('0x43')](_[_0x82b2('0x44')](_0x12acd0[_0x82b2('0x3a')],_0x1b7eb0[_0x82b2('0x43')]));if(_0x12acd0[_0x82b2('0x3a')][_0x82b2('0x45')]){_0x2b686e['where']=_[_0x82b2('0x46')](_0x2b686e['where'],{'$or':_[_0x82b2('0x47')](_0xbcab86,function(_0x5407ea){if(_0x5407ea[_0x82b2('0x48')][_0x82b2('0x49')]!==_0x82b2('0x4a')){var _0x15da8d={};_0x15da8d[_0x5407ea[_0x82b2('0x4b')]]={'$like':'%'+_0x12acd0[_0x82b2('0x3a')][_0x82b2('0x45')]+'%'};return _0x15da8d;}})});}_0x2b686e=_['merge']({},_0x2b686e,_0x12acd0[_0x82b2('0x4c')]);var _0x22bc06={'where':_0x2b686e[_0x82b2('0x42')]};return db[_0x82b2('0x4d')][_0x82b2('0x28')](_0x22bc06)[_0x82b2('0x1d')](function(_0x5883f8){_0x2bac49[_0x82b2('0x28')]=_0x5883f8;if(_0x12acd0[_0x82b2('0x3a')]['includeAll']){_0x2b686e['include']=[{'all':!![]}];}return db[_0x82b2('0x4d')][_0x82b2('0x4e')](_0x2b686e);})[_0x82b2('0x1d')](function(_0x3e6fe2){_0x2bac49[_0x82b2('0x4f')]=_0x3e6fe2;return _0x2bac49;})[_0x82b2('0x1d')](respondWithFilteredResult(_0x54e6c6,_0x2b686e))[_0x82b2('0x50')](handleError(_0x54e6c6,null));};exports[_0x82b2('0x51')]=function(_0x2d07be,_0x2d4a95){var _0x1d2ef1={'raw':![],'where':{'id':_0x2d07be[_0x82b2('0x52')]['id']}},_0x14ace2={};_0x14ace2[_0x82b2('0x38')]=_[_0x82b2('0x39')](db['Trunk']['rawAttributes']);_0x14ace2[_0x82b2('0x3a')]=_[_0x82b2('0x39')](_0x2d07be[_0x82b2('0x3a')]);_0x14ace2[_0x82b2('0x43')]=_['intersection'](_0x14ace2[_0x82b2('0x38')],_0x14ace2[_0x82b2('0x3a')]);_0x1d2ef1[_0x82b2('0x3d')]=_[_0x82b2('0x3b')](_0x14ace2[_0x82b2('0x38')],qs['fields'](_0x2d07be[_0x82b2('0x3a')][_0x82b2('0x3c')]));_0x1d2ef1[_0x82b2('0x3d')]=_0x1d2ef1['attributes']['length']?_0x1d2ef1[_0x82b2('0x3d')]:_0x14ace2[_0x82b2('0x38')];if(_0x2d07be[_0x82b2('0x3a')][_0x82b2('0x53')]){_0x1d2ef1[_0x82b2('0x54')]=[{'all':!![]}];}_0x1d2ef1=_[_0x82b2('0x46')]({},_0x1d2ef1,_0x2d07be['options']);return db[_0x82b2('0x4d')][_0x82b2('0x55')](_0x1d2ef1)[_0x82b2('0x1d')](handleEntityNotFound(_0x2d4a95,null))[_0x82b2('0x1d')](respondWithResult(_0x2d4a95,null))[_0x82b2('0x50')](handleError(_0x2d4a95,null));};exports[_0x82b2('0x56')]=function(_0x505faa,_0xe79328){var _0x46940b={'raw':![],'where':{'id':_0x505faa['params']['id']}},_0xec35df={};_0xec35df[_0x82b2('0x38')]=_[_0x82b2('0x39')](db[_0x82b2('0x4d')]['rawAttributes']);_0x46940b[_0x82b2('0x3d')]=_[_0x82b2('0x3b')](_0xec35df[_0x82b2('0x38')],qs[_0x82b2('0x3c')](_0x505faa[_0x82b2('0x3a')][_0x82b2('0x3c')]));_0x46940b[_0x82b2('0x3d')]=_0x46940b[_0x82b2('0x3d')][_0x82b2('0x57')]?_0x46940b[_0x82b2('0x3d')]:_0xec35df[_0x82b2('0x38')];if(_0x505faa[_0x82b2('0x3a')][_0x82b2('0x53')]){_0x46940b[_0x82b2('0x54')]=[{'all':!![]}];}_0x46940b=_[_0x82b2('0x46')]({},_0x46940b,_0x505faa[_0x82b2('0x4c')]);return db[_0x82b2('0x4d')][_0x82b2('0x55')](_0x46940b)['then'](handleEntityNotFound(_0xe79328,null))[_0x82b2('0x1d')](function(_0x1b4650){if(_0x1b4650){var _0x2aee14=_0x1b4650[_0x82b2('0x31')]({'plain':!![]});_0x2aee14=qs['omit'](_0x2aee14,['id',_0x82b2('0x58'),'updatedAt']);_0x505faa['body']=_[_0x82b2('0x59')](_0x505faa[_0x82b2('0x5a')],['id','createdAt','updatedAt']);return db['Trunk']['create'](_[_0x82b2('0x46')](_0x2aee14,_0x505faa[_0x82b2('0x5a')]),{'include':_0x505faa[_0x82b2('0x3a')][_0x82b2('0x53')]?[{'all':!![]}]:undefined})[_0x82b2('0x1d')](function(_0x471f83){var _0x410c96=_0x505faa[_0x82b2('0x5b')]['get']({'plain':!![]});if(!_0x410c96)throw new Error(_0x82b2('0x5c'));if(_0x410c96[_0x82b2('0x5d')]===_0x82b2('0x5b')){var _0x3530c3=_0x471f83[_0x82b2('0x31')]({'plain':!![]});var _0x38ed7c=_0x82b2('0x5e');return db[_0x82b2('0x5f')][_0x82b2('0x55')]({'where':{'name':_0x38ed7c,'userProfileId':_0x410c96[_0x82b2('0x60')]},'raw':!![]})[_0x82b2('0x1d')](function(_0x597bec){if(_0x597bec&&_0x597bec[_0x82b2('0x61')]===0x0){return db['UserProfileResource'][_0x82b2('0x62')]({'name':_0x3530c3[_0x82b2('0x35')],'resourceId':_0x3530c3['id'],'type':_0x597bec['name'],'sectionId':_0x597bec['id']},{})['then'](function(){return _0x471f83;});}else{return _0x471f83;}})['catch'](function(_0x3ad9c0){logger[_0x82b2('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ad9c0);throw _0x3ad9c0;});}return _0x471f83;});}})[_0x82b2('0x1d')](respondWithResult(_0xe79328,0xc9))[_0x82b2('0x50')](handleError(_0xe79328,null));};exports[_0x82b2('0x62')]=function(_0x16efc6,_0x50b964,_0x3b794d){var _0x21f65b;return db[_0x82b2('0x4d')][_0x82b2('0x62')](_0x16efc6['body'],{'raw':!![]})[_0x82b2('0x1d')](function(_0x15279a){_0x21f65b=_0x15279a;return db['Trunk'][_0x82b2('0x4e')]({'raw':!![]});})['then'](function(_0x55be60){var _0x358dfd=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config[_0x82b2('0x65')],'server/files/templates/trunk.ejs'),_0x82b2('0x66'));var _0x3c97b0=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config[_0x82b2('0x65')],_0x82b2('0x67')),_0x82b2('0x66'));var _0x4478cd=ejs[_0x82b2('0x68')](_0x358dfd,{'trunks':_0x55be60||[]});fs[_0x82b2('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4478cd);if(_0x21f65b[_0x82b2('0x6a')]){var _0x56b041=ejs[_0x82b2('0x68')](_0x3c97b0,{'trunks':_0x55be60||[]});fs[_0x82b2('0x69')](_0x82b2('0x6b'),_0x56b041);}})['then'](function(){return respondWithRpcPromise(_0x82b2('0x6c'),_0x82b2('0x62'),{'module':_0x82b2('0x6d')});})[_0x82b2('0x1d')](function(){var _0x5b4815=_0x16efc6['user'][_0x82b2('0x31')]({'plain':!![]});if(!_0x5b4815)throw new Error(_0x82b2('0x5c'));if(_0x5b4815[_0x82b2('0x5d')]==='user'){var _0x3f315d=_0x21f65b[_0x82b2('0x31')]({'plain':!![]});return db[_0x82b2('0x5f')]['find']({'where':{'name':_0x82b2('0x5e'),'userProfileId':_0x5b4815[_0x82b2('0x60')]},'raw':!![]})['then'](function(_0x21f9c6){if(_0x21f9c6&&_0x21f9c6[_0x82b2('0x61')]===0x0){return db[_0x82b2('0x32')]['create']({'name':_0x3f315d['name'],'resourceId':_0x3f315d['id'],'type':_0x21f9c6[_0x82b2('0x35')],'sectionId':_0x21f9c6['id']},{})[_0x82b2('0x1d')](function(){return _0x21f65b;});}else{return _0x21f65b;}})[_0x82b2('0x50')](function(_0xb751e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb751e7);throw _0xb751e7;});}return _0x21f65b;})[_0x82b2('0x1d')](respondWithResult(_0x50b964,0xc9))[_0x82b2('0x50')](handleError(_0x50b964,null));};exports[_0x82b2('0x6e')]=function(_0x3e0ff2,_0x43cc15,_0x3f344b){var _0x472b1b;return db[_0x82b2('0x4d')][_0x82b2('0x55')]({'where':{'id':_0x3e0ff2[_0x82b2('0x52')]['id']}})[_0x82b2('0x1d')](handleEntityNotFound(_0x43cc15,null))['then'](saveUpdates(_0x3e0ff2[_0x82b2('0x5a')],null))['then'](function(_0x458068){if(_0x458068){_0x472b1b=_0x458068;return db[_0x82b2('0x4d')]['findAll']({'raw':!![]});}})[_0x82b2('0x1d')](function(_0xa00187){if(_0xa00187){var _0x2b7b12=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config['root'],_0x82b2('0x6f')),_0x82b2('0x66'));var _0x511c6a=fs['readFileSync'](path[_0x82b2('0x64')](config[_0x82b2('0x65')],_0x82b2('0x67')),'utf8');var _0x30db07=ejs['render'](_0x2b7b12,{'trunks':_0xa00187||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x30db07);var _0x1f3bf1=ejs[_0x82b2('0x68')](_0x511c6a,{'trunks':_0xa00187||[]});fs['writeFileSync'](_0x82b2('0x6b'),_0x1f3bf1);return respondWithRpcPromise(_0x82b2('0x6c'),'update',{'module':_0x82b2('0x6d')});}return null;})[_0x82b2('0x1d')](function(_0x3e31d8){if(_0x3e31d8){return _0x472b1b;}})['then'](respondWithResult(_0x43cc15,null))['catch'](handleError(_0x43cc15,null));};exports[_0x82b2('0x30')]=function(_0x2e6f19,_0x41c711,_0x43738c){var _0x41aeae;return db[_0x82b2('0x4d')][_0x82b2('0x55')]({'where':{'id':_0x2e6f19[_0x82b2('0x52')]['id']}})[_0x82b2('0x1d')](handleEntityNotFound(_0x41c711,null))[_0x82b2('0x1d')](removeEntity(_0x41c711,null))[_0x82b2('0x1d')](function(){return db[_0x82b2('0x4d')][_0x82b2('0x4e')]({'raw':!![]});})[_0x82b2('0x1d')](function(_0x1e242b){var _0x3aae8c=fs[_0x82b2('0x63')](path[_0x82b2('0x64')](config[_0x82b2('0x65')],'server/files/templates/trunk.ejs'),_0x82b2('0x66'));var _0x5c1711=fs[_0x82b2('0x63')](path['join'](config[_0x82b2('0x65')],_0x82b2('0x67')),_0x82b2('0x66'));var _0x397b09=ejs[_0x82b2('0x68')](_0x3aae8c,{'trunks':_0x1e242b});var _0x56d4cf=ejs['render'](_0x5c1711,{'trunks':_0x1e242b});fs[_0x82b2('0x69')](_0x82b2('0x70'),_0x397b09);fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x56d4cf);return respondWithRpcPromise(_0x82b2('0x6c'),_0x82b2('0x30'),{'module':_0x82b2('0x6d')});})[_0x82b2('0x50')](handleError(_0x41c711,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index b9ef238..e5bb9be 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 _0x294b=['exports','define','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./trunk.attributes'];(function(_0x289a52,_0x99cef9){var _0x410fe7=function(_0x4d8b3a){while(--_0x4d8b3a){_0x289a52['push'](_0x289a52['shift']());}};_0x410fe7(++_0x99cef9);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb294('0x0'));var util=require('util');var logger=require(_0xb294('0x1'))(_0xb294('0x2'));var moment=require(_0xb294('0x3'));var BPromise=require(_0xb294('0x4'));var rp=require(_0xb294('0x5'));var fs=require('fs');var path=require(_0xb294('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb294('0x7'));module[_0xb294('0x8')]=function(_0xaa6a67,_0x181f5e){return _0xaa6a67[_0xb294('0x9')]('Trunk',attributes,{'tableName':_0xb294('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d86=['exports','define','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./trunk.attributes'];(function(_0x145d77,_0x43130d){var _0x4bdb7e=function(_0x2f2540){while(--_0x2f2540){_0x145d77['push'](_0x145d77['shift']());}};_0x4bdb7e(++_0x43130d);}(_0x7d86,0x86));var _0x67d8=function(_0x4e8665,_0x13738f){_0x4e8665=_0x4e8665-0x0;var _0x1dd146=_0x7d86[_0x4e8665];return _0x1dd146;};'use strict';var _=require(_0x67d8('0x0'));var util=require('util');var logger=require(_0x67d8('0x1'))(_0x67d8('0x2'));var moment=require(_0x67d8('0x3'));var BPromise=require(_0x67d8('0x4'));var rp=require(_0x67d8('0x5'));var fs=require('fs');var path=require(_0x67d8('0x6'));var rimraf=require(_0x67d8('0x7'));var config=require('../../config/environment');var attributes=require(_0x67d8('0x8'));module[_0x67d8('0x9')]=function(_0x8dd593,_0x2bc414){return _0x8dd593[_0x67d8('0xa')](_0x67d8('0xb'),attributes,{'tableName':_0x67d8('0xc'),'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 3778ce9..df74dbd 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 _0x155d=['map','model','ShowTrunk','find','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','code','message','Trunk,\x20%s,\x20%s','result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include'];(function(_0x2a5099,_0x329e92){var _0x2802f1=function(_0x53f99b){while(--_0x53f99b){_0x2a5099['push'](_0x2a5099['shift']());}};_0x2802f1(++_0x329e92);}(_0x155d,0x1b1));var _0xd155=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x155d[_0x28aea5];return _0x6a55f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd155('0x0'));var fs=require('fs');var Redis=require(_0xd155('0x1'));var db=require(_0xd155('0x2'))['db'];var utils=require(_0xd155('0x3'));var logger=require(_0xd155('0x4'))(_0xd155('0x5'));var config=require(_0xd155('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd155('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45b6f6,_0x10fa56,_0x3296ce){return new BPromise(function(_0x1a4f9c,_0x2e507d){return client[_0xd155('0x8')](_0x45b6f6,_0x3296ce)[_0xd155('0x9')](function(_0x508897){logger[_0xd155('0xa')]('Trunk,\x20%s,\x20%s',_0x10fa56,_0xd155('0xb'));logger[_0xd155('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x10fa56,_0xd155('0xb'),JSON[_0xd155('0xd')](_0x508897));if(_0x508897['error']){if(_0x508897[_0xd155('0xe')][_0xd155('0xf')]===0x1f4){logger[_0xd155('0xe')]('Trunk,\x20%s,\x20%s',_0x10fa56,_0x508897[_0xd155('0xe')][_0xd155('0x10')]);return _0x2e507d(_0x508897[_0xd155('0xe')]['message']);}logger[_0xd155('0xe')](_0xd155('0x11'),_0x10fa56,_0x508897['error']['message']);return _0x1a4f9c(_0x508897[_0xd155('0xe')]['message']);}else{logger[_0xd155('0xa')](_0xd155('0x11'),_0x10fa56,_0xd155('0xb'));_0x1a4f9c(_0x508897[_0xd155('0x12')][_0xd155('0x10')]);}})[_0xd155('0x13')](function(_0x3a0ab9){logger['error'](_0xd155('0x11'),_0x10fa56,_0x3a0ab9);_0x2e507d(_0x3a0ab9);});});}exports[_0xd155('0x14')]=function(_0xd25594){var _0x4791f4=this;return new Promise(function(_0x4eba7c,_0x35a8d8){return db[_0xd155('0x15')][_0xd155('0x16')]({'raw':_0xd25594[_0xd155('0x17')]?_0xd25594['options'][_0xd155('0x18')]===undefined?!![]:![]:!![],'where':_0xd25594[_0xd155('0x17')]?_0xd25594[_0xd155('0x17')][_0xd155('0x19')]||null:null,'attributes':_0xd25594['options']?_0xd25594[_0xd155('0x17')][_0xd155('0x1a')]||null:null,'limit':_0xd25594[_0xd155('0x17')]?_0xd25594[_0xd155('0x17')][_0xd155('0x1b')]||null:null,'include':_0xd25594[_0xd155('0x17')]?_0xd25594[_0xd155('0x17')][_0xd155('0x1c')]?_[_0xd155('0x1d')](_0xd25594['options'][_0xd155('0x1c')],function(_0x3c7b2c){return{'model':db[_0x3c7b2c['model']],'as':_0x3c7b2c['as'],'attributes':_0x3c7b2c[_0xd155('0x1a')],'include':_0x3c7b2c[_0xd155('0x1c')]?_[_0xd155('0x1d')](_0x3c7b2c[_0xd155('0x1c')],function(_0x16f72c){return{'model':db[_0x16f72c[_0xd155('0x1e')]],'as':_0x16f72c['as'],'attributes':_0x16f72c['attributes'],'include':_0x16f72c[_0xd155('0x1c')]?_[_0xd155('0x1d')](_0x16f72c[_0xd155('0x1c')],function(_0x3ed17b){return{'model':db[_0x3ed17b[_0xd155('0x1e')]],'as':_0x3ed17b['as'],'attributes':_0x3ed17b[_0xd155('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16607b){logger['info'](_0xd155('0x14'),_0xd25594);logger['debug'](_0xd155('0x14'),_0xd25594,JSON['stringify'](_0x16607b));_0x4eba7c(_0x16607b);})[_0xd155('0x13')](function(_0x254157){logger[_0xd155('0xe')](_0xd155('0x14'),_0x254157[_0xd155('0x10')],_0xd25594);_0x35a8d8(_0x4791f4[_0xd155('0xe')](0x1f4,_0x254157[_0xd155('0x10')]));});});};exports[_0xd155('0x1f')]=function(_0x29ae83){var _0x50d1a4=this;return new Promise(function(_0x35c557,_0x5c846c){return db[_0xd155('0x15')][_0xd155('0x20')]({'raw':_0x29ae83[_0xd155('0x17')]?_0x29ae83['options'][_0xd155('0x18')]===undefined?!![]:![]:!![],'where':_0x29ae83[_0xd155('0x17')]?_0x29ae83[_0xd155('0x17')][_0xd155('0x19')]||null:null,'attributes':_0x29ae83['options']?_0x29ae83[_0xd155('0x17')][_0xd155('0x1a')]||null:null,'include':_0x29ae83[_0xd155('0x17')]?_0x29ae83['options'][_0xd155('0x1c')]?_[_0xd155('0x1d')](_0x29ae83[_0xd155('0x17')][_0xd155('0x1c')],function(_0x5569a8){return{'model':db[_0x5569a8[_0xd155('0x1e')]],'as':_0x5569a8['as'],'attributes':_0x5569a8[_0xd155('0x1a')],'include':_0x5569a8[_0xd155('0x1c')]?_[_0xd155('0x1d')](_0x5569a8[_0xd155('0x1c')],function(_0x4164de){return{'model':db[_0x4164de['model']],'as':_0x4164de['as'],'attributes':_0x4164de[_0xd155('0x1a')],'include':_0x4164de[_0xd155('0x1c')]?_[_0xd155('0x1d')](_0x4164de['include'],function(_0x393e1a){return{'model':db[_0x393e1a[_0xd155('0x1e')]],'as':_0x393e1a['as'],'attributes':_0x393e1a[_0xd155('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd155('0x9')](function(_0x4cda85){logger[_0xd155('0xa')]('ShowTrunk',_0x29ae83);logger[_0xd155('0xc')](_0xd155('0x1f'),_0x29ae83,JSON[_0xd155('0xd')](_0x4cda85));_0x35c557(_0x4cda85);})['catch'](function(_0x109f32){logger[_0xd155('0xe')]('ShowTrunk',_0x109f32[_0xd155('0x10')],_0x29ae83);_0x5c846c(_0x50d1a4['error'](0x1f4,_0x109f32['message']));});});}; \ No newline at end of file +var _0x6080=['stringify','error','message','catch','GetTrunk','findAll','options','where','map','include','model','attributes','debug','ShowTrunk','Trunk','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x52b52b,_0x3cf1d1){var _0x4c5141=function(_0x3f2f12){while(--_0x3f2f12){_0x52b52b['push'](_0x52b52b['shift']());}};_0x4c5141(++_0x3cf1d1);}(_0x6080,0x1a8));var _0x0608=function(_0x3b576a,_0x3263f9){_0x3b576a=_0x3b576a-0x0;var _0x527de1=_0x6080[_0x3b576a];return _0x527de1;};'use strict';var _=require(_0x0608('0x0'));var util=require(_0x0608('0x1'));var moment=require(_0x0608('0x2'));var BPromise=require(_0x0608('0x3'));var rs=require(_0x0608('0x4'));var fs=require('fs');var Redis=require(_0x0608('0x5'));var db=require(_0x0608('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0608('0x7'))(_0x0608('0x8'));var config=require('../../config/environment');var jayson=require(_0x0608('0x9'));var client=jayson[_0x0608('0xa')][_0x0608('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d3a63,_0x1f0d3e,_0xcb8e3c){return new BPromise(function(_0x110f9d,_0x116b7e){return client[_0x0608('0xc')](_0x5d3a63,_0xcb8e3c)[_0x0608('0xd')](function(_0xf6cca3){logger[_0x0608('0xe')](_0x0608('0xf'),_0x1f0d3e,_0x0608('0x10'));logger['debug'](_0x0608('0x11'),_0x1f0d3e,_0x0608('0x10'),JSON[_0x0608('0x12')](_0xf6cca3));if(_0xf6cca3[_0x0608('0x13')]){if(_0xf6cca3[_0x0608('0x13')]['code']===0x1f4){logger[_0x0608('0x13')]('Trunk,\x20%s,\x20%s',_0x1f0d3e,_0xf6cca3[_0x0608('0x13')]['message']);return _0x116b7e(_0xf6cca3[_0x0608('0x13')][_0x0608('0x14')]);}logger[_0x0608('0x13')](_0x0608('0xf'),_0x1f0d3e,_0xf6cca3[_0x0608('0x13')]['message']);return _0x110f9d(_0xf6cca3[_0x0608('0x13')][_0x0608('0x14')]);}else{logger[_0x0608('0xe')]('Trunk,\x20%s,\x20%s',_0x1f0d3e,'request\x20sent');_0x110f9d(_0xf6cca3['result'][_0x0608('0x14')]);}})[_0x0608('0x15')](function(_0x26ccfb){logger['error'](_0x0608('0xf'),_0x1f0d3e,_0x26ccfb);_0x116b7e(_0x26ccfb);});});}exports[_0x0608('0x16')]=function(_0x3a7fab){var _0xc47971=this;return new Promise(function(_0x331fdb,_0x1976ae){return db['Trunk'][_0x0608('0x17')]({'raw':_0x3a7fab[_0x0608('0x18')]?_0x3a7fab['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a7fab[_0x0608('0x18')]?_0x3a7fab[_0x0608('0x18')][_0x0608('0x19')]||null:null,'attributes':_0x3a7fab[_0x0608('0x18')]?_0x3a7fab['options']['attributes']||null:null,'limit':_0x3a7fab['options']?_0x3a7fab[_0x0608('0x18')]['limit']||null:null,'include':_0x3a7fab['options']?_0x3a7fab[_0x0608('0x18')]['include']?_[_0x0608('0x1a')](_0x3a7fab[_0x0608('0x18')][_0x0608('0x1b')],function(_0x14362c){return{'model':db[_0x14362c[_0x0608('0x1c')]],'as':_0x14362c['as'],'attributes':_0x14362c[_0x0608('0x1d')],'include':_0x14362c[_0x0608('0x1b')]?_[_0x0608('0x1a')](_0x14362c['include'],function(_0x58d74f){return{'model':db[_0x58d74f[_0x0608('0x1c')]],'as':_0x58d74f['as'],'attributes':_0x58d74f[_0x0608('0x1d')],'include':_0x58d74f['include']?_[_0x0608('0x1a')](_0x58d74f[_0x0608('0x1b')],function(_0xe0ce74){return{'model':db[_0xe0ce74[_0x0608('0x1c')]],'as':_0xe0ce74['as'],'attributes':_0xe0ce74['attributes']};}):[]};}):[]};}):[]:[]})[_0x0608('0xd')](function(_0x4a4580){logger[_0x0608('0xe')](_0x0608('0x16'),_0x3a7fab);logger[_0x0608('0x1e')](_0x0608('0x16'),_0x3a7fab,JSON[_0x0608('0x12')](_0x4a4580));_0x331fdb(_0x4a4580);})[_0x0608('0x15')](function(_0x358458){logger[_0x0608('0x13')](_0x0608('0x16'),_0x358458[_0x0608('0x14')],_0x3a7fab);_0x1976ae(_0xc47971['error'](0x1f4,_0x358458[_0x0608('0x14')]));});});};exports[_0x0608('0x1f')]=function(_0x3c3a58){var _0x47811b=this;return new Promise(function(_0x1b9a78,_0x1334c1){return db[_0x0608('0x20')]['find']({'raw':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58[_0x0608('0x18')][_0x0608('0x21')]===undefined?!![]:![]:!![],'where':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58[_0x0608('0x18')][_0x0608('0x19')]||null:null,'attributes':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58['options'][_0x0608('0x1d')]||null:null,'include':_0x3c3a58[_0x0608('0x18')]?_0x3c3a58['options'][_0x0608('0x1b')]?_[_0x0608('0x1a')](_0x3c3a58[_0x0608('0x18')][_0x0608('0x1b')],function(_0x200c6a){return{'model':db[_0x200c6a['model']],'as':_0x200c6a['as'],'attributes':_0x200c6a['attributes'],'include':_0x200c6a['include']?_[_0x0608('0x1a')](_0x200c6a[_0x0608('0x1b')],function(_0x32a016){return{'model':db[_0x32a016[_0x0608('0x1c')]],'as':_0x32a016['as'],'attributes':_0x32a016[_0x0608('0x1d')],'include':_0x32a016['include']?_['map'](_0x32a016[_0x0608('0x1b')],function(_0x101961){return{'model':db[_0x101961[_0x0608('0x1c')]],'as':_0x101961['as'],'attributes':_0x101961[_0x0608('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0608('0xd')](function(_0xb3402f){logger[_0x0608('0xe')](_0x0608('0x1f'),_0x3c3a58);logger['debug'](_0x0608('0x1f'),_0x3c3a58,JSON['stringify'](_0xb3402f));_0x1b9a78(_0xb3402f);})[_0x0608('0x15')](function(_0x47344c){logger[_0x0608('0x13')](_0x0608('0x1f'),_0x47344c[_0x0608('0x14')],_0x3c3a58);_0x1334c1(_0x47811b[_0x0608('0x13')](0x1f4,_0x47344c['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 1f58282..571b925 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 _0xfc8a=['addSquareProjects','update','put','/:id/password','changePassword','removeQueues','delete','removeTeams','/:id','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeSmsInteractions','/:id/openchannel_interactions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./user.controller','isAuthenticated','index','get','/describe','describe','show','/:id/avatar','getAvatar','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/lists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','diskStorage','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xfc8a,0x15b));var _0xafc8=function(_0xfb86f6,_0x127103){_0xfb86f6=_0xfb86f6-0x0;var _0x534a4b=_0xfc8a[_0xfb86f6];return _0x534a4b;};'use strict';var multer=require(_0xafc8('0x0'));var util=require(_0xafc8('0x1'));var path=require(_0xafc8('0x2'));var timeout=require(_0xafc8('0x3'));var express=require(_0xafc8('0x4'));var router=express[_0xafc8('0x5')]();var auth=require(_0xafc8('0x6'));var interaction=require(_0xafc8('0x7'));var config=require('../../config/environment');var controller=require(_0xafc8('0x8'));router['get']('/',auth[_0xafc8('0x9')](),controller[_0xafc8('0xa')]);router[_0xafc8('0xb')](_0xafc8('0xc'),auth[_0xafc8('0x9')](),controller[_0xafc8('0xd')]);router['get']('/:id',auth[_0xafc8('0x9')](),controller[_0xafc8('0xe')]);router['get'](_0xafc8('0xf'),controller[_0xafc8('0x10')]);router[_0xafc8('0xb')](_0xafc8('0x11'),auth[_0xafc8('0x9')](),controller['getContacts']);router[_0xafc8('0xb')](_0xafc8('0x12'),auth['isAuthenticated'](),controller[_0xafc8('0x13')]);router[_0xafc8('0xb')](_0xafc8('0x14'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x15')]);router['get'](_0xafc8('0x16'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x17')]);router['get'](_0xafc8('0x18'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x19')]);router[_0xafc8('0xb')](_0xafc8('0x1a'),auth[_0xafc8('0x9')](),controller['getScreenRecordings']);router[_0xafc8('0xb')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0xafc8('0x1b')]);router[_0xafc8('0xb')](_0xafc8('0x1c'),auth['isAuthenticated'](),controller[_0xafc8('0x1d')]);router[_0xafc8('0xb')](_0xafc8('0x1e'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x1f')]);router[_0xafc8('0xb')]('/:id/sms/interactions',auth[_0xafc8('0x9')](),controller[_0xafc8('0x20')]);router[_0xafc8('0xb')](_0xafc8('0x21'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x22')]);router[_0xafc8('0xb')]('/:id/teams',auth[_0xafc8('0x9')](),controller['getTeams']);router[_0xafc8('0xb')](_0xafc8('0x23'),auth[_0xafc8('0x9')](),controller['getLists']);router['get']('/:id/agents',auth[_0xafc8('0x9')](),controller['getAgents']);router[_0xafc8('0xb')](_0xafc8('0x24'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x25')]);router[_0xafc8('0xb')](_0xafc8('0x26'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x27')]);router[_0xafc8('0xb')](_0xafc8('0x28'),auth[_0xafc8('0x9')](),controller['getMailAccounts']);router[_0xafc8('0xb')](_0xafc8('0x29'),auth[_0xafc8('0x9')](),controller['getOpenchannelAccounts']);router['get'](_0xafc8('0x2a'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x2b')]);router[_0xafc8('0xb')](_0xafc8('0x2c'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x2d')]);router[_0xafc8('0xb')](_0xafc8('0x2e'),auth['isAuthenticated'](),controller[_0xafc8('0x2f')]);router[_0xafc8('0xb')](_0xafc8('0x30'),auth[_0xafc8('0x9')](),controller['getScheduledCalls']);router[_0xafc8('0xb')](_0xafc8('0x31'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x32')]);router[_0xafc8('0x33')](_0xafc8('0x34'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x35')]);router[_0xafc8('0x33')]('/:id/contacts',auth[_0xafc8('0x9')](),controller[_0xafc8('0x36')]);router[_0xafc8('0x33')]('/',auth[_0xafc8('0x9')](),controller[_0xafc8('0x37')]);router[_0xafc8('0x33')](_0xafc8('0x12'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x38')]);var upload=multer({'storage':multer[_0xafc8('0x39')]({'destination':function(_0x4971da,_0x120bd3,_0x381348){_0x381348(null,path['join'](config[_0xafc8('0x3a')],_0xafc8('0x3b')));},'filename':function(_0x4a8982,_0x1e4147,_0x805d60){_0x805d60(null,util[_0xafc8('0x3c')](_0xafc8('0x3d'),Date['now'](),_0x1e4147[_0xafc8('0x3e')]));}})});router[_0xafc8('0x33')](_0xafc8('0xf'),upload[_0xafc8('0x3f')](_0xafc8('0x40')),controller[_0xafc8('0x41')]);router['post'](_0xafc8('0x42'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x43')]);router[_0xafc8('0x33')](_0xafc8('0x44'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x45')]);router['post'](_0xafc8('0x46'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x47')]);router[_0xafc8('0x33')](_0xafc8('0x48'),auth['isAuthenticated'](),controller[_0xafc8('0x49')]);router[_0xafc8('0x33')](_0xafc8('0x4a'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x4b')]);router[_0xafc8('0x33')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0xafc8('0x4c')]);router['post'](_0xafc8('0x4d'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x4e')]);router[_0xafc8('0x33')](_0xafc8('0x4f'),auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0xafc8('0x33')](_0xafc8('0x50'),auth['isAuthenticated'](),controller['addSmsInteractions']);router[_0xafc8('0x33')]('/:id/openchannel_interactions',auth[_0xafc8('0x9')](),controller['addOpenchannelInteractions']);router[_0xafc8('0x33')](_0xafc8('0x26'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x51')]);router[_0xafc8('0x33')]('/:id/mail_accounts',auth['isAuthenticated'](),controller['addMailAccounts']);router['post']('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xafc8('0x52')]);router[_0xafc8('0x33')]('/:id/sms_accounts',auth[_0xafc8('0x9')](),controller[_0xafc8('0x53')]);router[_0xafc8('0x33')](_0xafc8('0x2c'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x54')]);router[_0xafc8('0x33')]('/:id/square_projects',auth[_0xafc8('0x9')](),controller[_0xafc8('0x55')]);router['post']('/:id/api_key',auth['isAuthenticated'](),controller['createApiKey']);router['put']('/:id',auth[_0xafc8('0x9')](),controller[_0xafc8('0x56')]);router[_0xafc8('0x57')](_0xafc8('0x58'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x59')]);router['delete']('/:id/queues',auth[_0xafc8('0x9')](),controller[_0xafc8('0x5a')]);router[_0xafc8('0x5b')](_0xafc8('0x4a'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x5c')]);router[_0xafc8('0x5b')](_0xafc8('0x5d'),auth[_0xafc8('0x9')](),controller['destroy']);router[_0xafc8('0x5b')](_0xafc8('0x5e'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x5f')]);router[_0xafc8('0x5b')](_0xafc8('0x4d'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x60')]);router[_0xafc8('0x5b')](_0xafc8('0x4f'),auth[_0xafc8('0x9')](),controller['removeFaxInteractions']);router[_0xafc8('0x5b')](_0xafc8('0x50'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x61')]);router[_0xafc8('0x5b')](_0xafc8('0x62'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x63')]);router['delete'](_0xafc8('0x26'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x64')]);router[_0xafc8('0x5b')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xafc8('0x65')]);router['delete'](_0xafc8('0x29'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x66')]);router[_0xafc8('0x5b')](_0xafc8('0x2a'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x67')]);router[_0xafc8('0x5b')](_0xafc8('0x2c'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x68')]);router[_0xafc8('0x5b')](_0xafc8('0x2e'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x69')]);router['delete'](_0xafc8('0x31'),auth[_0xafc8('0x9')](),controller[_0xafc8('0x6a')]);module[_0xafc8('0x6b')]=router; \ No newline at end of file +var _0xa73c=['getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','addQueues','join','root','server/files/images/','format','%s-%s','now','single','file','addAvatar','login','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/:id','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getVoiceQueuesRt','getRecordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes'];(function(_0x1275ca,_0x3bd8a0){var _0x473a9d=function(_0x5b1b56){while(--_0x5b1b56){_0x1275ca['push'](_0x1275ca['shift']());}};_0x473a9d(++_0x3bd8a0);}(_0xa73c,0x15e));var _0xca73=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa73c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xca73('0x0'));var util=require('util');var path=require(_0xca73('0x1'));var timeout=require(_0xca73('0x2'));var express=require('express');var router=express[_0xca73('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xca73('0x4'));var config=require(_0xca73('0x5'));var controller=require(_0xca73('0x6'));router[_0xca73('0x7')]('/',auth[_0xca73('0x8')](),controller['index']);router['get'](_0xca73('0x9'),auth[_0xca73('0x8')](),controller[_0xca73('0xa')]);router[_0xca73('0x7')](_0xca73('0xb'),auth[_0xca73('0x8')](),controller['show']);router[_0xca73('0x7')](_0xca73('0xc'),controller[_0xca73('0xd')]);router[_0xca73('0x7')](_0xca73('0xe'),auth[_0xca73('0x8')](),controller[_0xca73('0xf')]);router[_0xca73('0x7')](_0xca73('0x10'),auth[_0xca73('0x8')](),controller['getQueues']);router[_0xca73('0x7')]('/:id/queues_rt',auth[_0xca73('0x8')](),controller[_0xca73('0x11')]);router['get']('/:id/groups',auth[_0xca73('0x8')](),controller['getGroups']);router[_0xca73('0x7')]('/:id/recordings',auth[_0xca73('0x8')](),controller[_0xca73('0x12')]);router[_0xca73('0x7')]('/:id/screen_recordings',auth[_0xca73('0x8')](),controller[_0xca73('0x13')]);router[_0xca73('0x7')](_0xca73('0x14'),auth[_0xca73('0x8')](),controller[_0xca73('0x15')]);router[_0xca73('0x7')](_0xca73('0x16'),auth[_0xca73('0x8')](),controller[_0xca73('0x17')]);router[_0xca73('0x7')](_0xca73('0x18'),auth['isAuthenticated'](),controller[_0xca73('0x19')]);router[_0xca73('0x7')](_0xca73('0x1a'),auth[_0xca73('0x8')](),controller['getSmsInteractions']);router[_0xca73('0x7')]('/:id/fax/interactions',auth[_0xca73('0x8')](),controller['getFaxInteractions']);router[_0xca73('0x7')](_0xca73('0x1b'),auth[_0xca73('0x8')](),controller[_0xca73('0x1c')]);router['get'](_0xca73('0x1d'),auth[_0xca73('0x8')](),controller[_0xca73('0x1e')]);router[_0xca73('0x7')](_0xca73('0x1f'),auth[_0xca73('0x8')](),controller[_0xca73('0x20')]);router[_0xca73('0x7')](_0xca73('0x21'),auth[_0xca73('0x8')](),controller[_0xca73('0x22')]);router['get']('/:id/fax_accounts',auth[_0xca73('0x8')](),controller[_0xca73('0x23')]);router['get'](_0xca73('0x24'),auth[_0xca73('0x8')](),controller['getMailAccounts']);router[_0xca73('0x7')](_0xca73('0x25'),auth[_0xca73('0x8')](),controller['getOpenchannelAccounts']);router['get'](_0xca73('0x26'),auth[_0xca73('0x8')](),controller[_0xca73('0x27')]);router[_0xca73('0x7')](_0xca73('0x28'),auth['isAuthenticated'](),controller[_0xca73('0x29')]);router[_0xca73('0x7')](_0xca73('0x2a'),auth[_0xca73('0x8')](),controller['getSquareProjects']);router['get'](_0xca73('0x2b'),auth[_0xca73('0x8')](),controller[_0xca73('0x2c')]);router[_0xca73('0x7')]('/:id/api_key',auth['isAuthenticated'](),controller['getApiKey']);router[_0xca73('0x2d')](_0xca73('0x2e'),auth[_0xca73('0x8')](),controller['bulkCreate']);router['post'](_0xca73('0xe'),auth[_0xca73('0x8')](),controller['addContacts']);router[_0xca73('0x2d')]('/',auth['isAuthenticated'](),controller['create']);router[_0xca73('0x2d')]('/:id/queues',auth['isAuthenticated'](),controller[_0xca73('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a7ff1,_0x2228e6,_0x4a4339){_0x4a4339(null,path[_0xca73('0x30')](config[_0xca73('0x31')],_0xca73('0x32')));},'filename':function(_0x1ba463,_0x958577,_0x3b42f3){_0x3b42f3(null,util[_0xca73('0x33')](_0xca73('0x34'),Date[_0xca73('0x35')](),_0x958577['originalname']));}})});router[_0xca73('0x2d')](_0xca73('0xc'),upload[_0xca73('0x36')](_0xca73('0x37')),controller[_0xca73('0x38')]);router[_0xca73('0x2d')]('/:id/login',auth[_0xca73('0x8')](),controller[_0xca73('0x39')]);router[_0xca73('0x2d')]('/:id/logout',auth[_0xca73('0x8')](),controller['logout']);router[_0xca73('0x2d')]('/:id/pause',auth[_0xca73('0x8')](),controller['pause']);router['post'](_0xca73('0x3a'),auth[_0xca73('0x8')](),controller['unpause']);router[_0xca73('0x2d')](_0xca73('0x1b'),auth[_0xca73('0x8')](),controller[_0xca73('0x3b')]);router[_0xca73('0x2d')](_0xca73('0x3c'),auth[_0xca73('0x8')](),controller[_0xca73('0x3d')]);router[_0xca73('0x2d')](_0xca73('0x3e'),auth[_0xca73('0x8')](),controller[_0xca73('0x3f')]);router[_0xca73('0x2d')](_0xca73('0x40'),auth[_0xca73('0x8')](),controller[_0xca73('0x41')]);router[_0xca73('0x2d')](_0xca73('0x42'),auth[_0xca73('0x8')](),controller['addSmsInteractions']);router[_0xca73('0x2d')](_0xca73('0x43'),auth[_0xca73('0x8')](),controller[_0xca73('0x44')]);router[_0xca73('0x2d')](_0xca73('0x45'),auth[_0xca73('0x8')](),controller[_0xca73('0x46')]);router[_0xca73('0x2d')](_0xca73('0x24'),auth[_0xca73('0x8')](),controller[_0xca73('0x47')]);router[_0xca73('0x2d')]('/:id/openchannel_accounts',auth[_0xca73('0x8')](),controller['addOpenchannelAccounts']);router['post']('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xca73('0x48')]);router['post']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0xca73('0x49')]);router['post'](_0xca73('0x2a'),auth['isAuthenticated'](),controller[_0xca73('0x4a')]);router[_0xca73('0x2d')](_0xca73('0x4b'),auth[_0xca73('0x8')](),controller[_0xca73('0x4c')]);router[_0xca73('0x4d')]('/:id',auth[_0xca73('0x8')](),controller[_0xca73('0x4e')]);router[_0xca73('0x4d')](_0xca73('0x4f'),auth[_0xca73('0x8')](),controller[_0xca73('0x50')]);router[_0xca73('0x51')](_0xca73('0x10'),auth[_0xca73('0x8')](),controller[_0xca73('0x52')]);router['delete'](_0xca73('0x1b'),auth['isAuthenticated'](),controller[_0xca73('0x53')]);router[_0xca73('0x51')](_0xca73('0xb'),auth[_0xca73('0x8')](),controller[_0xca73('0x54')]);router[_0xca73('0x51')](_0xca73('0x3c'),auth[_0xca73('0x8')](),controller[_0xca73('0x55')]);router[_0xca73('0x51')](_0xca73('0x3e'),auth[_0xca73('0x8')](),controller[_0xca73('0x56')]);router[_0xca73('0x51')](_0xca73('0x40'),auth[_0xca73('0x8')](),controller[_0xca73('0x57')]);router[_0xca73('0x51')](_0xca73('0x42'),auth[_0xca73('0x8')](),controller[_0xca73('0x58')]);router['delete']('/:id/openchannel_interactions',auth[_0xca73('0x8')](),controller[_0xca73('0x59')]);router[_0xca73('0x51')](_0xca73('0x45'),auth[_0xca73('0x8')](),controller[_0xca73('0x5a')]);router[_0xca73('0x51')](_0xca73('0x24'),auth[_0xca73('0x8')](),controller[_0xca73('0x5b')]);router[_0xca73('0x51')](_0xca73('0x25'),auth[_0xca73('0x8')](),controller['removeOpenchannelAccounts']);router[_0xca73('0x51')](_0xca73('0x26'),auth['isAuthenticated'](),controller[_0xca73('0x5c')]);router[_0xca73('0x51')](_0xca73('0x28'),auth[_0xca73('0x8')](),controller[_0xca73('0x5d')]);router[_0xca73('0x51')](_0xca73('0x2a'),auth[_0xca73('0x8')](),controller[_0xca73('0x5e')]);router[_0xca73('0x51')]('/:id/api_key',auth['isAuthenticated'](),controller['removeApiKey']);module[_0xca73('0x5f')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 362b915..5ffb9fc 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 _0xb7df=['name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','ENUM','user','agent','telephone','local','INTEGER','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','uac','uas','passive','update,nonat','get','wss','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','force_avp','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','moment','util','exports','STRING'];(function(_0x493108,_0x1a8881){var _0x23540d=function(_0x8655eb){while(--_0x8655eb){_0x493108['push'](_0x493108['shift']());}};_0x23540d(++_0x1a8881);}(_0xb7df,0xa6));var _0xfb7d=function(_0x81d267,_0x2ac60f){_0x81d267=_0x81d267-0x0;var _0x4c795f=_0xb7df[_0x81d267];return _0x4c795f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfb7d('0x0'));var util=require(_0xfb7d('0x1'));var _=require('lodash');module[_0xfb7d('0x2')]={'name':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':![],'unique':_0xfb7d('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x18f35e){this[_0xfb7d('0x5')](_0xfb7d('0x4'),_0x18f35e);this['setDataValue'](_0xfb7d('0x6'),_0x18f35e);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':![],'set':function(_0x5f57c5){this[_0xfb7d('0x5')](_0xfb7d('0x7'),_0x5f57c5);this[_0xfb7d('0x5')](_0xfb7d('0x8'),util[_0xfb7d('0x9')](_0xfb7d('0xa'),_0x5f57c5,this[_0xfb7d('0xb')](_0xfb7d('0xc'))));}},'alias':{'type':Sequelize[_0xfb7d('0x3')]},'email':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':![],'unique':_0xfb7d('0xd'),'validate':{'isEmail':!![]},'set':function(_0x76de14){if(_0x76de14){this[_0xfb7d('0x5')](_0xfb7d('0xd'),_0x76de14['toLowerCase']());}}},'role':{'type':Sequelize[_0xfb7d('0xe')]('admin',_0xfb7d('0xf'),_0xfb7d('0x10'),_0xfb7d('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xfb7d('0x3')],'defaultValue':_0xfb7d('0x12')},'internal':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':![],'unique':_0xfb7d('0xc'),'set':function(_0x43bdb0){this[_0xfb7d('0x5')]('internal',_0x43bdb0);this['setDataValue']('accountcode',_0x43bdb0);this['setDataValue'](_0xfb7d('0x8'),util[_0xfb7d('0x9')]('\x22%s\x22\x20<%s>',this[_0xfb7d('0xb')](_0xfb7d('0x7')),_0x43bdb0));}},'salt':{'type':Sequelize[_0xfb7d('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xfb7d('0x3')]},'address':{'type':Sequelize[_0xfb7d('0x3')]},'zipcode':{'type':Sequelize[_0xfb7d('0x3')]},'userpic':{'type':Sequelize[_0xfb7d('0x3')]},'city':{'type':Sequelize[_0xfb7d('0x3')]},'country':{'type':Sequelize[_0xfb7d('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xfb7d('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xfb7d('0x3')],'defaultValue':_0xfb7d('0x16')},'lastPauseAt':{'type':Sequelize[_0xfb7d('0x14')]},'chatCapacity':{'type':Sequelize[_0xfb7d('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xfb7d('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xfb7d('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xfb7d('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xfb7d('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![],'defaultValue':_0xfb7d('0x17')},'ipaddr':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xfb7d('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xfb7d('0x18'),_0xfb7d('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xfb7d('0x18')},'context':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![],'defaultValue':_0xfb7d('0x19')},'callingpres':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x1a'),_0xfb7d('0x1b'),'ALLOWED_FAILED_SCREEN',_0xfb7d('0x1c'),_0xfb7d('0x1d'),_0xfb7d('0x1e'),_0xfb7d('0x1f'),_0xfb7d('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![],'defaultValue':_0xfb7d('0x21'),'set':function(_0x227bf5){this[_0xfb7d('0x5')]('transport',_0x227bf5?_0x227bf5[_0xfb7d('0x22')](','):null);},'get':function(){return this[_0xfb7d('0xb')](_0xfb7d('0x23'))?this[_0xfb7d('0xb')](_0xfb7d('0x23'))[_0xfb7d('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xfb7d('0x25'),_0xfb7d('0x26'),_0xfb7d('0x27'),_0xfb7d('0x28'),_0xfb7d('0x29')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no',_0xfb7d('0x2b'),_0xfb7d('0x2c'),_0xfb7d('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xfb7d('0x2e'),'set':function(_0x3ef36f){this[_0xfb7d('0x5')]('nat',_0x3ef36f?_0x3ef36f[_0xfb7d('0x22')](','):null);},'get':function(){return this[_0xfb7d('0xb')]('nat')?this[_0xfb7d('0xb')](_0xfb7d('0x2f'))[_0xfb7d('0x24')](','):null;},'comment':_0xfb7d('0x30')},'callgroup':{'type':Sequelize[_0xfb7d('0x3')]},'namedcallgroup':{'type':Sequelize[_0xfb7d('0x3')]},'pickupgroup':{'type':Sequelize[_0xfb7d('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xfb7d('0x3')]},'language':{'type':Sequelize[_0xfb7d('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xfb7d('0x3')]},'disallow':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':![],'defaultValue':_0xfb7d('0x31'),'set':function(_0x3007d4){this[_0xfb7d('0x5')]('allow',_0x3007d4?_0x3007d4[_0xfb7d('0x22')](';'):_0xfb7d('0x31'));},'get':function(){return this[_0xfb7d('0xb')](_0xfb7d('0x32'))?this[_0xfb7d('0xb')](_0xfb7d('0x32'))[_0xfb7d('0x24')](';'):null;},'comment':_0xfb7d('0x33')},'autoframing':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x545795){this['setDataValue'](_0xfb7d('0x34'),_0x545795?_0x545795[_0xfb7d('0x22')](','):null);},'get':function(){return this[_0xfb7d('0xb')](_0xfb7d('0x34'))?this[_0xfb7d('0xb')]('insecure')[_0xfb7d('0x24')](','):null;},'comment':_0xfb7d('0x35')},'trustrpid':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xfb7d('0x2a'),'no',_0xfb7d('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![],'defaultValue':_0xfb7d('0x37')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xfb7d('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no',_0xfb7d('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x39'),'refuse',_0xfb7d('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0xfb7d('0x3c')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no','fingerprint','certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xfb7d('0xe')]('active',_0xfb7d('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xfb7d('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xfb7d('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no',_0xfb7d('0x2b'),_0xfb7d('0x2c'),_0xfb7d('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize[_0xfb7d('0x13')],'defaultValue':0x0,'set':function(_0x22482e){this['setDataValue']('showWebBar',_0x22482e);var _0x7c3790=this[_0xfb7d('0x3f')]({'plain':!![]});switch(_0x22482e){case 0x0:case 0x1:var _0x32aa29=_0x7c3790[_0xfb7d('0x23')]?_['isArray'](_0x7c3790[_0xfb7d('0x23')])?_0x7c3790[_0xfb7d('0x23')][_0xfb7d('0x22')]():_0x7c3790[_0xfb7d('0x23')]:'udp';if(_0x32aa29===_0xfb7d('0x40')){_0x32aa29=_0xfb7d('0x21');}this[_0xfb7d('0x5')](_0xfb7d('0x23'),_0x32aa29);this[_0xfb7d('0x5')]('encryption','no');this['setDataValue'](_0xfb7d('0x41'),null);this['setDataValue']('force_avp',null);this[_0xfb7d('0x5')](_0xfb7d('0x42'),null);this[_0xfb7d('0x5')](_0xfb7d('0x43'),null);this['setDataValue'](_0xfb7d('0x44'),null);this[_0xfb7d('0x5')](_0xfb7d('0x45'),null);this['setDataValue']('dtlscertfile',null);this[_0xfb7d('0x5')](_0xfb7d('0x46'),null);this['setDataValue'](_0xfb7d('0x47'),'no');break;case 0x2:this[_0xfb7d('0x5')](_0xfb7d('0x23'),_0xfb7d('0x40'));this[_0xfb7d('0x5')](_0xfb7d('0x48'),'yes');this[_0xfb7d('0x5')](_0xfb7d('0x41'),'yes');this[_0xfb7d('0x5')](_0xfb7d('0x49'),'yes');this['setDataValue'](_0xfb7d('0x42'),'yes');this[_0xfb7d('0x5')]('dtlsenable',_0xfb7d('0x2a'));this[_0xfb7d('0x5')](_0xfb7d('0x44'),'no');this[_0xfb7d('0x5')](_0xfb7d('0x45'),_0xfb7d('0x4a'));this[_0xfb7d('0x5')]('dtlscertfile',_0x7c3790['dtlscertfile']||_0xfb7d('0x4b'));this['setDataValue'](_0xfb7d('0x46'),_0x7c3790[_0xfb7d('0x46')]||_0xfb7d('0x4c'));this[_0xfb7d('0x5')]('rtcp_mux',_0xfb7d('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xfb7d('0x4d')],'set':function(_0x1f1cc6){this[_0xfb7d('0x5')]('permissions',_0x1f1cc6?_0x1f1cc6[_0xfb7d('0x22')](','):[]);},'get':function(){return this['getDataValue'](_0xfb7d('0x4e'))?_[_0xfb7d('0x4f')](this[_0xfb7d('0xb')]('permissions')[_0xfb7d('0x24')](','),function(_0x3d3bb2){return parseInt(_0x3d3bb2,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xfb7d('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xfb7d('0x3')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xfb7d('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xfb7d('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xfb7d('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xfb7d('0xe')](_0xfb7d('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xfb7d('0x3')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0xfb7d('0xb')](_0xfb7d('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xfb7d('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xfb7d('0x15')],'defaultValue':![],'set':function(_0x428949){if(typeof _0x428949===_0xfb7d('0x51')){var _0x29cb5d=_0x428949==='1'?!![]:_0x428949==='0'?![]:_0x428949===_0xfb7d('0x52')?!![]:_0x428949===_0xfb7d('0x53')?![]:![];this['setDataValue']('screenrecording',_0x29cb5d);}else{this[_0xfb7d('0x5')](_0xfb7d('0x54'),_0x428949);}}}}; \ No newline at end of file +var _0xa3fc=['screenrecording','sequelize','moment','util','lodash','STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','\x22%s\x22\x20<%s>','internal','toLowerCase','admin','user','telephone','INTEGER','accountcode','callerid','format','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','ENUM','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update','update,nonat','showWebBar','get','isArray','encryption','avpf','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','/etc/pki/tls/certs/motion.crt','TEXT','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false'];(function(_0x11bc3c,_0x1293f0){var _0x234a8b=function(_0x3c15ac){while(--_0x3c15ac){_0x11bc3c['push'](_0x11bc3c['shift']());}};_0x234a8b(++_0x1293f0);}(_0xa3fc,0xb1));var _0xca3f=function(_0x307c57,_0x2ff9e5){_0x307c57=_0x307c57-0x0;var _0x232faa=_0xa3fc[_0x307c57];return _0x232faa;};'use strict';var Sequelize=require(_0xca3f('0x0'));var moment=require(_0xca3f('0x1'));var util=require(_0xca3f('0x2'));var _=require(_0xca3f('0x3'));module['exports']={'name':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x496ba6){this[_0xca3f('0x5')](_0xca3f('0x6'),_0x496ba6);this[_0xca3f('0x5')](_0xca3f('0x7'),_0x496ba6);},'comment':_0xca3f('0x8')},'fullname':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'set':function(_0x4ecf10){this['setDataValue'](_0xca3f('0x9'),_0x4ecf10);this['setDataValue']('callerid',util['format'](_0xca3f('0xa'),_0x4ecf10,this['getDataValue'](_0xca3f('0xb'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x56f9df){if(_0x56f9df){this[_0xca3f('0x5')]('email',_0x56f9df[_0xca3f('0xc')]());}}},'role':{'type':Sequelize['ENUM'](_0xca3f('0xd'),_0xca3f('0xe'),'agent',_0xca3f('0xf')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':![],'unique':'internal','set':function(_0x42f0ce){this[_0xca3f('0x5')](_0xca3f('0xb'),_0x42f0ce);this[_0xca3f('0x5')](_0xca3f('0x11'),_0x42f0ce);this['setDataValue'](_0xca3f('0x12'),util[_0xca3f('0x13')]('\x22%s\x22\x20<%s>',this[_0xca3f('0x14')]('fullname'),_0x42f0ce));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xca3f('0x4')]},'mobile':{'type':Sequelize[_0xca3f('0x4')]},'address':{'type':Sequelize[_0xca3f('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xca3f('0x4')]},'city':{'type':Sequelize[_0xca3f('0x4')]},'country':{'type':Sequelize[_0xca3f('0x4')]},'online':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':_0xca3f('0x16')},'lastPauseAt':{'type':Sequelize[_0xca3f('0x17')]},'chatCapacity':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xca3f('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xca3f('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xca3f('0x18')},'ipaddr':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xca3f('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x1a'),_0xca3f('0xe'),_0xca3f('0x1b')),'allowNull':!![],'defaultValue':_0xca3f('0x1a')},'context':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x1c'),_0xca3f('0x1d'),_0xca3f('0x1e'),_0xca3f('0x1f'),'PROHIB_NOT_SCREENED',_0xca3f('0x20'),_0xca3f('0x21'),_0xca3f('0x22')),'allowNull':!![]},'deny':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':_0xca3f('0x23'),'set':function(_0x122d81){this[_0xca3f('0x5')](_0xca3f('0x24'),_0x122d81?_0x122d81['join'](','):null);},'get':function(){return this[_0xca3f('0x14')]('transport')?this[_0xca3f('0x14')](_0xca3f('0x24'))['split'](','):null;},'comment':_0xca3f('0x25')},'dtmfmode':{'type':Sequelize[_0xca3f('0x19')]('rfc2833',_0xca3f('0x26'),_0xca3f('0x27'),_0xca3f('0x28'),'auto'),'allowNull':!![],'defaultValue':_0xca3f('0x29')},'directmedia':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x2b'),'update',_0xca3f('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':_0xca3f('0x2d'),'set':function(_0x5a722c){this[_0xca3f('0x5')](_0xca3f('0x2e'),_0x5a722c?_0x5a722c[_0xca3f('0x2f')](','):null);},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x2e'))?this[_0xca3f('0x14')](_0xca3f('0x2e'))['split'](','):null;},'comment':_0xca3f('0x30')},'callgroup':{'type':Sequelize[_0xca3f('0x4')]},'namedcallgroup':{'type':Sequelize[_0xca3f('0x4')]},'pickupgroup':{'type':Sequelize[_0xca3f('0x4')]},'namedpickupgroup':{'type':Sequelize[_0xca3f('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xca3f('0x4')]},'disallow':{'type':Sequelize[_0xca3f('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca3f('0x31'),'set':function(_0x39337f){this[_0xca3f('0x5')]('allow',_0x39337f?_0x39337f['join'](';'):_0xca3f('0x31'));},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x32'))?this[_0xca3f('0x14')](_0xca3f('0x32'))[_0xca3f('0x33')](';'):null;},'comment':_0xca3f('0x34')},'autoframing':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'set':function(_0x4cf75d){this[_0xca3f('0x5')](_0xca3f('0x35'),_0x4cf75d?_0x4cf75d[_0xca3f('0x2f')](','):null);},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x35'))?this[_0xca3f('0x14')](_0xca3f('0x35'))[_0xca3f('0x33')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![],'defaultValue':_0xca3f('0x37')},'amaflags':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM'](_0xca3f('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0xca3f('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xca3f('0x19')]('yes','no',_0xca3f('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x39'),_0xca3f('0x3a'),_0xca3f('0x3b')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x3c'),_0xca3f('0x3d')),'allowNull':!![],'defaultValue':_0xca3f('0x3d')},'t38pt_usertpsource':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xca3f('0x2a')},'keepalive':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x3e'),_0xca3f('0x3f')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x40'),_0xca3f('0x41'),_0xca3f('0x42')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xca3f('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xca3f('0x19')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xca3f('0x19')](_0xca3f('0x2a'),'no',_0xca3f('0x2b'),_0xca3f('0x43'),_0xca3f('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xca3f('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1402c3){this[_0xca3f('0x5')](_0xca3f('0x45'),_0x1402c3);var _0x221d6f=this[_0xca3f('0x46')]({'plain':!![]});switch(_0x1402c3){case 0x0:case 0x1:var _0x4a308f=_0x221d6f[_0xca3f('0x24')]?_[_0xca3f('0x47')](_0x221d6f[_0xca3f('0x24')])?_0x221d6f[_0xca3f('0x24')]['join']():_0x221d6f[_0xca3f('0x24')]:'udp';if(_0x4a308f==='wss'){_0x4a308f=_0xca3f('0x23');}this[_0xca3f('0x5')](_0xca3f('0x24'),_0x4a308f);this['setDataValue'](_0xca3f('0x48'),'no');this[_0xca3f('0x5')](_0xca3f('0x49'),null);this[_0xca3f('0x5')]('force_avp',null);this[_0xca3f('0x5')](_0xca3f('0x4a'),null);this[_0xca3f('0x5')](_0xca3f('0x4b'),null);this[_0xca3f('0x5')](_0xca3f('0x4c'),null);this[_0xca3f('0x5')](_0xca3f('0x4d'),null);this[_0xca3f('0x5')]('dtlscertfile',null);this[_0xca3f('0x5')](_0xca3f('0x4e'),null);this['setDataValue'](_0xca3f('0x4f'),'no');break;case 0x2:this[_0xca3f('0x5')](_0xca3f('0x24'),'wss');this[_0xca3f('0x5')](_0xca3f('0x48'),_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x49'),_0xca3f('0x2a'));this[_0xca3f('0x5')]('force_avp',_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x4a'),_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x4b'),_0xca3f('0x2a'));this[_0xca3f('0x5')](_0xca3f('0x4c'),'no');this[_0xca3f('0x5')]('dtlssetup',_0xca3f('0x42'));this['setDataValue']('dtlscertfile',_0x221d6f['dtlscertfile']||_0xca3f('0x50'));this[_0xca3f('0x5')]('dtlsprivatekey',_0x221d6f[_0xca3f('0x4e')]||'/etc/pki/tls/private/motion.key');this[_0xca3f('0x5')](_0xca3f('0x4f'),_0xca3f('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xca3f('0x51')],'set':function(_0x2aabf5){this[_0xca3f('0x5')](_0xca3f('0x52'),_0x2aabf5?_0x2aabf5[_0xca3f('0x2f')](','):[]);},'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x52'))?_['map'](this[_0xca3f('0x14')](_0xca3f('0x52'))[_0xca3f('0x33')](','),function(_0xa46643){return parseInt(_0xa46643,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xca3f('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xca3f('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xca3f('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0xca3f('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xca3f('0x4')]},'passwordResetAt':{'type':Sequelize[_0xca3f('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xca3f('0x14')](_0xca3f('0x53'))?this['getDataValue'](_0xca3f('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xca3f('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xca3f('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xca3f('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x874595){if(typeof _0x874595===_0xca3f('0x54')){var _0x32c68c=_0x874595==='1'?!![]:_0x874595==='0'?![]:_0x874595===_0xca3f('0x55')?!![]:_0x874595===_0xca3f('0x56')?![]:![];this[_0xca3f('0x5')]('screenrecording',_0x32c68c);}else{this[_0xca3f('0x5')](_0xca3f('0x57'),_0x874595);}}}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index aeebb08..4d237ad 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 _0xeb7c=['rawAttributes','differenceBy','password','salt','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','merge','map','sequelize','lower','col','field','options','User','include','rows','includeAll','bulkCreate','body','params','catch','describe','addContacts','omit','role','agent\x20role','admin','../../config/license/util','getLicense','isNil','License\x20limit\x20reached','format','count\x20%s:\x20%s','create','internal','Setting','findById','securePassword','min_internal','max','SELECT','from','mailbox','VoiceMail','fullname','email','101','102','103','110','104','105','106','107','109','100','111','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','addQueues','channel','online','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','ids','penalty','spread','toLowerCase','QueueId','emit','Queue:save','voice','VoiceQueue','push','SIP/%s','each','UserVoiceQueueRt','upsert','removeQueues','find','remove','Queues','Queue:remove','addAvatar','userpic','filename','getAvatar','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','root','getContacts','CmContact','sort','CmList','List','Tag','Tags','color','tag','Queue','findAll','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','mobile','loginInPause','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','all','getChannels','LOGIN','PAUSE','LOGININPAUSE','concat','pause','QueuePause','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','pauseType','lastPauseAt','mail','fax','openchannel','manual','Pause','getTeams','Team','addTeams','removeTeams','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','firstName','lastName','phone','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privelages\x20to\x20access\x20this\x20resource.','createApiKey','apiKeyNonce','apiKeyIat','removeApiKey','API\x20key\x20not\x20available','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./user.socket','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','User,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','get','Users','user','Agents','agent','Telephones','telephone','filter','ignore','value','includes','name','UserProfileResource','destroy','stack','send','index'];(function(_0x344e51,_0x246ec5){var _0x5c603c=function(_0x363ba6){while(--_0x363ba6){_0x344e51['push'](_0x344e51['shift']());}};_0x5c603c(++_0x246ec5);}(_0xeb7c,0x10b));var _0xceb7=function(_0x2e22f3,_0x53c7d6){_0x2e22f3=_0x2e22f3-0x0;var _0x35fe51=_0xeb7c[_0x2e22f3];return _0x35fe51;};'use strict';var pdf=require(_0xceb7('0x0'));var emlformat=require(_0xceb7('0x1'));var rimraf=require(_0xceb7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xceb7('0x3'));var rp=require(_0xceb7('0x4'));var moment=require('moment');var BPromise=require(_0xceb7('0x5'));var Mustache=require(_0xceb7('0x6'));var util=require(_0xceb7('0x7'));var path=require(_0xceb7('0x8'));var sox=require(_0xceb7('0x9'));var csv=require(_0xceb7('0xa'));var ejs=require(_0xceb7('0xb'));var fs=require('fs');var _=require(_0xceb7('0xc'));var squel=require(_0xceb7('0xd'));var crypto=require(_0xceb7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xceb7('0xf'));var toCsv=require('to-csv');var querystring=require(_0xceb7('0x10'));var Papa=require(_0xceb7('0x11'));var Redis=require(_0xceb7('0x12'));var authService=require(_0xceb7('0x13'));var qs=require(_0xceb7('0x14'));var hardwareService=require(_0xceb7('0x15'));var logger=require(_0xceb7('0x16'))('api');var utils=require(_0xceb7('0x17'));var config=require(_0xceb7('0x18'));var db=require(_0xceb7('0x19'))['db'];config['redis']=_[_0xceb7('0x1a')](config[_0xceb7('0x1b')],{'host':_0xceb7('0x1c'),'port':0x18eb});var socket=require(_0xceb7('0x1d'))(new Redis(config[_0xceb7('0x1b')]));require(_0xceb7('0x1e'))[_0xceb7('0x1f')](socket);var jayson=require(_0xceb7('0x20'));var client=jayson[_0xceb7('0x21')][_0xceb7('0x22')]({'port':0x232a});function checkPasswordPattern(_0x18083e,_0x520bcf,_0x338648){if(_0x338648){var _0x2d9491=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d9491[_0xceb7('0x23')](_0x520bcf)){return _0x18083e;}else{throw new Error(_0xceb7('0x24'));}}else{return _0x18083e;}}function respondWithRpcPromise(_0x2ba8cb,_0x5ba559,_0x331d53,_0x391f8d){return new BPromise(function(_0x73ad4d,_0x3575a2){var _0x493d03=_0x391f8d||client;return _0x493d03[_0xceb7('0x25')](_0x2ba8cb,_0x331d53)[_0xceb7('0x26')](function(_0x3a6c30){logger['info'](_0xceb7('0x27'),_0x5ba559,'request\x20sent');logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x5ba559,_0xceb7('0x28'),JSON['stringify'](_0x3a6c30));if(_0x3a6c30[_0xceb7('0x29')]){if(_0x3a6c30['error'][_0xceb7('0x2a')]===0x1f4){logger[_0xceb7('0x29')](_0xceb7('0x27'),_0x5ba559,_0x3a6c30[_0xceb7('0x29')][_0xceb7('0x2b')]);return _0x3575a2(_0x3a6c30['error']['message']);}logger[_0xceb7('0x29')](_0xceb7('0x27'),_0x5ba559,_0x3a6c30[_0xceb7('0x29')][_0xceb7('0x2b')]);return _0x73ad4d(_0x3a6c30['error'][_0xceb7('0x2b')]);}else{logger[_0xceb7('0x2c')]('User,\x20%s,\x20%s',_0x5ba559,_0xceb7('0x28'));_0x73ad4d(_0x3a6c30[_0xceb7('0x2d')][_0xceb7('0x2b')]);}})['catch'](function(_0x1246ae){logger[_0xceb7('0x29')](_0xceb7('0x27'),_0x5ba559,_0x1246ae);_0x3575a2(_0x1246ae);});});}function respondWithStatusCode(_0x5b2b87,_0x5430ee){_0x5430ee=_0x5430ee||0xcc;return function(_0x5efc58){if(_0x5efc58){return _0x5b2b87[_0xceb7('0x2e')](_0x5430ee);}return _0x5b2b87['status'](_0x5430ee)[_0xceb7('0x2f')]();};}function respondWithResult(_0x27b12c,_0x1d8c90){_0x1d8c90=_0x1d8c90||0xc8;return function(_0xa0b8c6){if(_0xa0b8c6){return _0x27b12c['status'](_0x1d8c90)[_0xceb7('0x30')](_0xa0b8c6);}};}function respondWithFilteredResult(_0x2e4a6f,_0x36bc38){return function(_0x388f11){if(_0x388f11){var _0x40938f=_0x388f11[_0xceb7('0x31')],_0x31a1ed=_0x36bc38[_0xceb7('0x32')],_0x14582d=_0x36bc38[_0xceb7('0x32')]+_0x36bc38['limit'],_0x2516ed;if(_0x14582d>=_0x40938f){_0x14582d=_0x40938f;_0x2516ed=0xc8;}else{_0x2516ed=0xce;}_0x2e4a6f[_0xceb7('0x33')](_0x2516ed);return _0x2e4a6f[_0xceb7('0x34')](_0xceb7('0x35'),_0x31a1ed+'-'+_0x14582d+'/'+_0x40938f)['json'](_0x388f11);}return null;};}function patchUpdates(_0x2a2a1f){return function(_0x1c13dd){try{jsonpatch[_0xceb7('0x36')](_0x1c13dd,_0x2a2a1f,!![]);}catch(_0x19112c){return BPromise[_0xceb7('0x37')](_0x19112c);}return _0x1c13dd[_0xceb7('0x38')]();};}function saveUpdates(_0x45cbdd,_0x3a6dd9){return function(_0x235d36){if(_0x235d36){return _0x235d36[_0xceb7('0x39')](_0x45cbdd)[_0xceb7('0x26')](function(_0xcbee95){return _0xcbee95;});}return null;};}function removeEntity(_0x321a1b,_0x262bba){return function(_0x5e5252){if(_0x5e5252){return _0x5e5252['destroy']()['then'](function(){var _0x33067b=_0x5e5252[_0xceb7('0x3a')]({'plain':!![]});var _0x270cd2=[{'name':_0xceb7('0x3b'),'value':_0xceb7('0x3c'),'ignore':!![]},{'name':_0xceb7('0x3d'),'value':_0xceb7('0x3e'),'ignore':![]},{'name':_0xceb7('0x3f'),'value':_0xceb7('0x40'),'ignore':![]}];var _0x4bd1c5=_(_0x270cd2)[_0xceb7('0x41')](_0xceb7('0x42'))['map'](_0xceb7('0x43'))['value']();if(_[_0xceb7('0x44')](_0x4bd1c5,_0x33067b['role'])){return;}var _0x48507b=_['find'](_0x270cd2,[_0xceb7('0x43'),_0x33067b['role']])[_0xceb7('0x45')];return db[_0xceb7('0x46')][_0xceb7('0x47')]({'where':{'type':_0x48507b,'resourceId':_0x33067b['id']}})[_0xceb7('0x26')](function(){return _0x5e5252;});})[_0xceb7('0x26')](function(){_0x321a1b[_0xceb7('0x33')](0xcc)[_0xceb7('0x2f')]();});}};}function handleEntityNotFound(_0x48899d,_0x310754){return function(_0x2a1305){if(!_0x2a1305){_0x48899d[_0xceb7('0x2e')](0x194);}return _0x2a1305;};}function handleError(_0x515fac,_0x4a39aa){_0x4a39aa=_0x4a39aa||0x1f4;return function(_0x470a5b){logger[_0xceb7('0x29')](_0x470a5b[_0xceb7('0x48')]);if(_0x470a5b[_0xceb7('0x45')]){delete _0x470a5b['name'];}_0x515fac[_0xceb7('0x33')](_0x4a39aa)[_0xceb7('0x49')](_0x470a5b);};}exports[_0xceb7('0x4a')]=function(_0x32c703,_0x12443){var _0x453603={},_0xef99ce={},_0x208d79={'count':0x0,'rows':[]};var _0x61ae12=db['User'][_0xceb7('0x4b')];_0xef99ce['model']=_[_0xceb7('0x4c')](_['keys'](_0x61ae12),[_0xceb7('0x4d'),_0xceb7('0x4e')]);_0xef99ce[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x32c703['query']);_0xef99ce[_0xceb7('0x51')]=_['intersection'](_0xef99ce[_0xceb7('0x52')],_0xef99ce[_0xceb7('0x4f')]);_0x453603['attributes']=_[_0xceb7('0x53')](_0xef99ce[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x32c703[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x453603[_0xceb7('0x55')]=_0x453603[_0xceb7('0x55')][_0xceb7('0x56')]?_0x453603[_0xceb7('0x55')]:_0xef99ce['model'];if(!_0x32c703[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x453603['limit']=qs[_0xceb7('0x59')](_0x32c703[_0xceb7('0x4f')][_0xceb7('0x59')]);_0x453603[_0xceb7('0x32')]=qs['offset'](_0x32c703[_0xceb7('0x4f')][_0xceb7('0x32')]);}_0x453603[_0xceb7('0x5a')]=qs['sort'](_0x32c703[_0xceb7('0x4f')]['sort']);_0x453603[_0xceb7('0x5b')]=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x32c703[_0xceb7('0x4f')],_0xef99ce['filters']));if(_0x32c703[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x453603[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x453603['where'],{'$or':_[_0xceb7('0x5e')](_0x61ae12,function(_0x33ffcd){return db[_0xceb7('0x5f')]['where'](db[_0xceb7('0x5f')]['fn'](_0xceb7('0x60'),db[_0xceb7('0x5f')][_0xceb7('0x61')](_0x33ffcd[_0xceb7('0x62')])),{'$like':db[_0xceb7('0x5f')]['fn']('lower','%'+_0x32c703[_0xceb7('0x4f')][_0xceb7('0x41')]+'%')});})});}_0x453603=_[_0xceb7('0x5d')]({},_0x453603,_0x32c703[_0xceb7('0x63')]);var _0x4ac172={'where':_0x453603[_0xceb7('0x5b')]};return db[_0xceb7('0x64')][_0xceb7('0x31')](_0x4ac172)['then'](function(_0x2608f8){_0x208d79['count']=_0x2608f8;if(_0x32c703[_0xceb7('0x4f')]['includeAll']){_0x453603[_0xceb7('0x65')]=[{'all':!![]}];}return db[_0xceb7('0x64')]['findAll'](_0x453603);})[_0xceb7('0x26')](function(_0x1423c3){_0x208d79[_0xceb7('0x66')]=_0x1423c3;return _0x208d79;})[_0xceb7('0x26')](respondWithFilteredResult(_0x12443,_0x453603))['catch'](handleError(_0x12443,null));};exports['show']=function(_0x2fefb5,_0x31c35c){var _0x175e77={'raw':![],'where':{'id':_0x2fefb5['params']['id']}},_0x53d1a3={};_0x53d1a3['model']=_[_0xceb7('0x4c')](_[_0xceb7('0x50')](db[_0xceb7('0x64')]['rawAttributes']),[_0xceb7('0x4d'),'salt']);_0x53d1a3[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x2fefb5[_0xceb7('0x4f')]);_0x53d1a3[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x53d1a3['model'],_0x53d1a3[_0xceb7('0x4f')]);_0x175e77[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x53d1a3[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x2fefb5[_0xceb7('0x4f')]['fields']));_0x175e77['attributes']=_0x175e77[_0xceb7('0x55')][_0xceb7('0x56')]?_0x175e77[_0xceb7('0x55')]:_0x53d1a3[_0xceb7('0x52')];if(_0x2fefb5['query'][_0xceb7('0x67')]){_0x175e77[_0xceb7('0x65')]=[{'all':!![]}];}_0x175e77=_[_0xceb7('0x5d')]({},_0x175e77,_0x2fefb5[_0xceb7('0x63')]);return db[_0xceb7('0x64')]['find'](_0x175e77)[_0xceb7('0x26')](handleEntityNotFound(_0x31c35c,null))[_0xceb7('0x26')](respondWithResult(_0x31c35c,null))['catch'](handleError(_0x31c35c,null));};exports[_0xceb7('0x68')]=function(_0x5f1c7a,_0x1947be){return db['User'][_0xceb7('0x68')](_0x5f1c7a['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1947be,0xc9))['catch'](handleError(_0x1947be,null));};exports[_0xceb7('0x39')]=function(_0x1b52b1,_0x54728a){if(_0x1b52b1['body']['id']){delete _0x1b52b1[_0xceb7('0x69')]['id'];}delete _0x1b52b1[_0xceb7('0x69')]['role'];return db[_0xceb7('0x64')]['find']({'where':{'id':_0x1b52b1[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x54728a,null))[_0xceb7('0x26')](saveUpdates(_0x1b52b1[_0xceb7('0x69')],null))['then'](respondWithResult(_0x54728a,null))[_0xceb7('0x6b')](handleError(_0x54728a,null));};exports[_0xceb7('0x6c')]=function(_0x31e094,_0x1b4b5c){return db[_0xceb7('0x64')][_0xceb7('0x6c')]()[_0xceb7('0x26')](respondWithResult(_0x1b4b5c,null))[_0xceb7('0x6b')](handleError(_0x1b4b5c,null));};exports[_0xceb7('0x6d')]=function(_0x2f5512,_0x414147,_0x27fb47){return db[_0xceb7('0x64')]['find']({'where':{'id':_0x2f5512[_0xceb7('0x6a')]['id']}})['then'](handleEntityNotFound(_0x414147,null))[_0xceb7('0x26')](function(_0x1525e8){if(_0x1525e8){return _0x1525e8['addContacts'](_0x2f5512['body']['ids'],_[_0xceb7('0x6e')](_0x2f5512[_0xceb7('0x69')],['ids','id'])||{});}})[_0xceb7('0x26')](respondWithResult(_0x414147,null))[_0xceb7('0x6b')](handleError(_0x414147,null));};var getLicense=function(_0x4493d6){return new BPromise(function(_0x28b902,_0x28809a){var _0xfdd315=0x0;_0x4493d6['body'][_0xceb7('0x6f')]===_0xceb7('0x3e')&&_0x28b902(_0xceb7('0x70'));return db[_0xceb7('0x64')][_0xceb7('0x31')]({'where':{'$or':[{'role':_0x4493d6[_0xceb7('0x69')][_0xceb7('0x6f')]===_0xceb7('0x40')?_0xceb7('0x40'):[_0xceb7('0x71'),_0xceb7('0x3c')]}]}})[_0xceb7('0x26')](function(_0x2e0724){_0xfdd315=_0x2e0724;return require(_0xceb7('0x72'))[_0xceb7('0x73')]();})['then'](function(_0x513304){var _0x26b621=_0x4493d6[_0xceb7('0x69')][_0xceb7('0x6f')]===_0xceb7('0x40')?'telephones':'users';if(!_[_0xceb7('0x74')](_0x513304[_0x26b621])&&_0xfdd315>=_0x513304[_0x26b621]){return _0x28809a({'message':_0xceb7('0x75')});}return _0x28b902(util[_0xceb7('0x76')](_0xceb7('0x77'),_0x26b621,_0xfdd315));})[_0xceb7('0x6b')](function(_0x1d81e6){return _0x28809a(_0x1d81e6);});});};exports[_0xceb7('0x78')]=function(_0xe4ce7,_0x15b8d7){return getLicense(_0xe4ce7)[_0xceb7('0x26')](function(_0x507307){if(!_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')]){var _0x1aa677;return db[_0xceb7('0x7a')][_0xceb7('0x7b')](0x1)['then'](function(_0x2f7be6){_0x2f7be6[_0xceb7('0x7c')]=!![];return checkPasswordPattern(_0x2f7be6,_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x4d')],_0x2f7be6[_0xceb7('0x7c')]);})[_0xceb7('0x26')](function(_0x568049){_0x1aa677=_0x568049[_0xceb7('0x7d')];return db[_0xceb7('0x64')][_0xceb7('0x7e')](_0xceb7('0x79'));})['then'](function(_0x443ad1){if(_[_0xceb7('0x74')](_0x443ad1)){if(_0x1aa677){_0xe4ce7[_0xceb7('0x69')]['internal']=_0x1aa677;}else{_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')]=0x1;}}else{if(_[_0xceb7('0x74')](_0x1aa677)||_0x1aa677==_0x443ad1){_0xe4ce7[_0xceb7('0x69')]['internal']=_0x443ad1+0x1;}else if(_0x1aa677>_0x443ad1){_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')]=_0x1aa677;}else{return db['sequelize']['query']('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[_0xceb7('0x5f')]['QueryTypes'][_0xceb7('0x7f')]})[_0xceb7('0x26')](function(_0x19d202){if(_0x19d202&&_0x19d202['length']){for(var _0x134153=0x0,_0xfc4982=_0x19d202[_0xceb7('0x56')];_0x134153<_0xfc4982&&_[_0xceb7('0x74')](_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')]);_0x134153++){if(_0x1aa677<=_0x19d202[_0x134153]['from']){_0xe4ce7['body']['internal']=_0x19d202[_0x134153][_0xceb7('0x80')];}else if(_0x1aa677>_0x19d202[_0x134153][_0xceb7('0x80')]&&_0x1aa677<=_0x19d202[_0x134153]['to']){_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')]=_0x1aa677;}}}if(_[_0xceb7('0x74')](_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')])){_0xe4ce7['body'][_0xceb7('0x79')]=_0x443ad1+0x1;}});}}});}})[_0xceb7('0x26')](function(){if(_0xe4ce7[_0xceb7('0x69')]['voicemail']){_0xe4ce7['body'][_0xceb7('0x81')]=_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')];_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x82')]={'mailbox':_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x79')],'password':_0xe4ce7['body'][_0xceb7('0x4d')],'fullname':_0xe4ce7['body'][_0xceb7('0x83')],'email':_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x84')]};}if(_0xe4ce7[_0xceb7('0x69')]&&_0xe4ce7[_0xceb7('0x69')][_0xceb7('0x6f')]===_0xceb7('0x3e')){_0xe4ce7[_0xceb7('0x69')]['permissions']=[_0xceb7('0x85'),_0xceb7('0x86'),_0xceb7('0x87'),_0xceb7('0x88'),_0xceb7('0x89'),_0xceb7('0x8a'),_0xceb7('0x8b'),_0xceb7('0x8c'),'108',_0xceb7('0x8d'),_0xceb7('0x8e'),_0xceb7('0x8f')];}return db[_0xceb7('0x64')]['create'](_0xe4ce7[_0xceb7('0x69')],{'include':[{'model':db[_0xceb7('0x82')],'as':_0xceb7('0x82')}]});})[_0xceb7('0x26')](function(_0x1d89a0){if(_0xe4ce7['body'][_0xceb7('0x6f')]==='user')return _0x1d89a0;var _0x2a449e=_0xe4ce7['user'][_0xceb7('0x3a')]({'plain':!![]});if(!_0x2a449e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a449e[_0xceb7('0x6f')]===_0xceb7('0x3c')){var _0x54c2be=_0x1d89a0[_0xceb7('0x3a')]({'plain':!![]});var _0x52399a=[{'name':_0xceb7('0x3d'),'value':_0xceb7('0x3e')},{'name':_0xceb7('0x3f'),'value':'telephone'}];var _0x3322a9=_['find'](_0x52399a,['value',_0x54c2be[_0xceb7('0x6f')]])[_0xceb7('0x45')];return db['UserProfileSection']['find']({'where':{'name':_0x3322a9,'userProfileId':_0x2a449e[_0xceb7('0x90')]},'raw':!![]})[_0xceb7('0x26')](function(_0x2054c1){if(_0x2054c1&&_0x2054c1[_0xceb7('0x91')]===0x0){return db[_0xceb7('0x46')][_0xceb7('0x78')]({'name':_0x54c2be['name'],'resourceId':_0x54c2be['id'],'type':_0x2054c1[_0xceb7('0x45')],'sectionId':_0x2054c1['id']},{})[_0xceb7('0x26')](function(){return _0x1d89a0;});}else{return _0x1d89a0;}})['catch'](function(_0x4c84c9){logger[_0xceb7('0x29')](_0xceb7('0x92'),_0x4c84c9);throw _0x4c84c9;});}return _0x1d89a0;})[_0xceb7('0x26')](respondWithResult(_0x15b8d7,0xc9))['catch'](handleError(_0x15b8d7,null));};exports[_0xceb7('0x93')]=function(_0x88f79e,_0x1482dd,_0x2e18e7){var _0x554e2a=![];if(_0x88f79e[_0xceb7('0x69')]['id']){delete _0x88f79e[_0xceb7('0x69')]['id'];}if(!_[_0xceb7('0x74')](_0x88f79e[_0xceb7('0x69')][_0xceb7('0x94')])){if(_0x88f79e['body'][_0xceb7('0x94')]===_0x88f79e['body'][_0xceb7('0x95')]){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db['User']['find']({'where':{'id':_0x88f79e[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](function(_0x11d813){if(_0x11d813){if(_0x11d813['id']==_0x88f79e['user']['id']){if(!_0x88f79e[_0xceb7('0x69')][_0xceb7('0x94')]||!_0x88f79e[_0xceb7('0x69')][_0xceb7('0x95')]){throw new db[(_0xceb7('0x96'))]['ValidationError'](_0xceb7('0x97'));}if(!_0x11d813[_0xceb7('0x98')](_0x88f79e[_0xceb7('0x69')][_0xceb7('0x94')])){throw new db[(_0xceb7('0x96'))]['ValidationError']('Wrong\x20credentials');}if(_0x88f79e[_0xceb7('0x69')][_0xceb7('0x94')]==_0x88f79e['body']['newPassword']){throw new db[(_0xceb7('0x96'))][(_0xceb7('0x99'))](_0xceb7('0x9a'));}return _0x11d813;}else if(_0x88f79e[_0xceb7('0x3c')][_0xceb7('0x6f')]==_0xceb7('0x71')){if(!_0x88f79e['body']['newPassword']){throw new db[(_0xceb7('0x96'))][(_0xceb7('0x99'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x11d813;}else if(_0x88f79e[_0xceb7('0x3c')][_0xceb7('0x6f')]==_0xceb7('0x3c')){if(!_0x88f79e['body'][_0xceb7('0x95')]){throw new db[(_0xceb7('0x96'))]['ValidationError'](_0xceb7('0x9b'));}if(_0x11d813['role']!=_0xceb7('0x3e')){throw new db[(_0xceb7('0x96'))][(_0xceb7('0x99'))](_0xceb7('0x9c'));}return _0x11d813;}else{throw new db[(_0xceb7('0x96'))]['ValidationError'](_0xceb7('0x9c'));}}return null;})[_0xceb7('0x26')](handleEntityNotFound(_0x1482dd,null))[_0xceb7('0x26')](function(_0x1508ef){return db['Setting'][_0xceb7('0x9d')]({'attributes':['id',_0xceb7('0x7c')]})['then'](function(_0x1b7acb){_0x554e2a=_0x1b7acb[_0xceb7('0x7c')];return checkPasswordPattern(_0x1508ef,_0x88f79e['body'][_0xceb7('0x95')],_0x554e2a);});})[_0xceb7('0x26')](saveUpdates({'password':_0x88f79e['body']['newPassword'],'passwordResetAt':_0x88f79e[_0xceb7('0x3c')]['id']==_0x88f79e[_0xceb7('0x6a')]['id']?moment():null},null))[_0xceb7('0x26')](respondWithResult(_0x1482dd,null))[_0xceb7('0x6b')](handleError(_0x1482dd,null));};exports[_0xceb7('0x9e')]=function(_0x2edf24,_0x5201db,_0x1996d5){var _0xfdad33=_0x2edf24[_0xceb7('0x69')][_0xceb7('0x9f')];return db[_0xceb7('0x64')]['find']({'where':{'id':_0x2edf24['params']['id']},'attributes':['id',_0xceb7('0x45'),_0xceb7('0x6f'),_0xceb7('0xa0'),'loginInPause',_0xceb7('0xa1'),_0xceb7('0xa2')]})[_0xceb7('0x26')](handleEntityNotFound(_0x5201db,null))[_0xceb7('0x26')](function(_0x113270){if(_0x113270){if(!utils[_0xceb7('0xa3')](_0xfdad33)){throw new db['Sequelize'][(_0xceb7('0x99'))](_0xceb7('0xa4'));}return _0x113270[_0xceb7('0xa5')+_[_0xceb7('0xa6')](_0xfdad33['toLowerCase']())+'Queues'](_0x2edf24[_0xceb7('0x69')][_0xceb7('0xa7')],{'penalty':_0x2edf24[_0xceb7('0x69')][_0xceb7('0xa8')]||0x0})[_0xceb7('0xa9')](function(_0x3cb96f){for(var _0xcf5fac=0x0;_0xcf5fac<_0x2edf24['body'][_0xceb7('0xa7')][_0xceb7('0x56')];_0xcf5fac+=0x1){var _0x448d24={'UserId':_0x2edf24['params']['id']};_0x448d24[_[_0xceb7('0xa6')](_0xfdad33[_0xceb7('0xaa')]())+_0xceb7('0xab')]=_0x2edf24[_0xceb7('0x69')][_0xceb7('0xa7')][_0xcf5fac];socket[_0xceb7('0xac')](_0xceb7('0x3c')+_['capitalize'](_0xfdad33['toLowerCase']())+_0xceb7('0xad'),_0x448d24);}return _0x3cb96f;})[_0xceb7('0x26')](function(){if(_0xfdad33===_0xceb7('0xae')){return db[_0xceb7('0xaf')]['findAll']({'where':{'id':_0x2edf24[_0xceb7('0x69')][_0xceb7('0xa7')]||[]},'raw':!![],'attributes':['id',_0xceb7('0x45')]});}})['then'](function(_0x53ffba){var _0x2c512d=_0x113270[_0xceb7('0x3a')]({'plain':!![]});var _0x34738c=[];if(_0xfdad33==='voice'&&_0x2c512d[_0xceb7('0x6f')]===_0xceb7('0x3e')&&_0x2c512d[_0xceb7('0xa0')]){for(var _0x7862c7=0x0;_0x7862c7<_0x53ffba[_0xceb7('0x56')];_0x7862c7+=0x1){_0x34738c[_0xceb7('0xb0')]({'membername':_0x2c512d[_0xceb7('0x45')],'UserId':_0x2c512d['id'],'queue_name':_0x53ffba[_0x7862c7][_0xceb7('0x45')],'VoiceQueueId':_0x53ffba[_0x7862c7]['id'],'interface':_[_0xceb7('0x74')](_0x2c512d[_0xceb7('0xa2')])?util[_0xceb7('0x76')](_0xceb7('0xb1'),_0x2c512d[_0xceb7('0x45')]):_0x2c512d[_0xceb7('0xa2')],'paused':_0x2c512d['voicePause']||![],'penalty':_0x2edf24['body'][_0xceb7('0xa8')]||0x0});}return BPromise[_0xceb7('0xb2')](_0x34738c,function(_0x446998){return db[_0xceb7('0xb3')][_0xceb7('0xb4')](_0x446998);});}return _0x113270;});}})[_0xceb7('0x26')](respondWithStatusCode(_0x5201db,null))[_0xceb7('0x6b')](handleError(_0x5201db,null));};exports[_0xceb7('0xb5')]=function(_0x3adcbb,_0x2c1572,_0x10006e){var _0xc2b2d6;return db['User'][_0xceb7('0xb6')]({'where':{'id':_0x3adcbb[_0xceb7('0x6a')]['id']},'attributes':['id',_0xceb7('0x45'),_0xceb7('0x6f')]})['then'](handleEntityNotFound(_0x2c1572,null))[_0xceb7('0x26')](function(_0x5c845b){if(_0x5c845b){_0xc2b2d6=_0x5c845b;if(!_0x3adcbb[_0xceb7('0x4f')][_0xceb7('0x9f')]||!utils[_0xceb7('0xa3')](_0x3adcbb['query'][_0xceb7('0x9f')])){throw new db[(_0xceb7('0x96'))][(_0xceb7('0x99'))](_0xceb7('0xa4'));}return _0x5c845b[_0xceb7('0xb7')+_[_0xceb7('0xa6')](_0x3adcbb['query']['channel'][_0xceb7('0xaa')]())+_0xceb7('0xb8')](_0x3adcbb[_0xceb7('0x4f')][_0xceb7('0xa7')]);}})[_0xceb7('0x26')](function(_0x5ec498){for(var _0x3312d5=0x0;_0x3312d5<_0x3adcbb[_0xceb7('0x4f')][_0xceb7('0xa7')]['length'];_0x3312d5+=0x1){var _0x14f583={'UserId':_0x3adcbb[_0xceb7('0x6a')]['id']};_0x14f583[_[_0xceb7('0xa6')](_0x3adcbb['query'][_0xceb7('0x9f')][_0xceb7('0xaa')]())+_0xceb7('0xab')]=_0x3adcbb[_0xceb7('0x4f')][_0xceb7('0xa7')][_0x3312d5];socket[_0xceb7('0xac')](_0xceb7('0x3c')+_['capitalize'](_0x3adcbb['query'][_0xceb7('0x9f')][_0xceb7('0xaa')]())+_0xceb7('0xb9'),_0x14f583);}return _0x5ec498;})[_0xceb7('0x26')](function(){if(_0x3adcbb[_0xceb7('0x4f')][_0xceb7('0x9f')]===_0xceb7('0xae')){return db[_0xceb7('0xb3')][_0xceb7('0x47')]({'where':{'UserId':_0x3adcbb[_0xceb7('0x6a')]['id'],'VoiceQueueId':_0x3adcbb[_0xceb7('0x4f')][_0xceb7('0xa7')]},'individualHooks':!![]})[_0xceb7('0x26')](function(){return _0xc2b2d6;});}return _0xc2b2d6;})[_0xceb7('0x26')](respondWithStatusCode(_0x2c1572,null))['catch'](handleError(_0x2c1572,null));};exports[_0xceb7('0xba')]=function(_0x3314b0,_0x53ca7d,_0x30f6f4){_0x3314b0['body'][_0xceb7('0xbb')]=_0x3314b0['file'][_0xceb7('0xbc')];return db[_0xceb7('0x64')]['find']({'where':{'id':_0x3314b0[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x53ca7d,null))[_0xceb7('0x26')](saveUpdates(_0x3314b0[_0xceb7('0x69')],null))[_0xceb7('0x26')](respondWithResult(_0x53ca7d,null))[_0xceb7('0x6b')](handleError(_0x53ca7d,null));};exports[_0xceb7('0xbd')]=function(_0x274623,_0x425bcd,_0x325495){var _0x556979=path['join'](config['root'],_0xceb7('0xbe'));return db[_0xceb7('0x64')][_0xceb7('0xb6')]({'where':{'id':_0x274623[_0xceb7('0x6a')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xceb7('0x26')](handleEntityNotFound(_0x425bcd,null))[_0xceb7('0x26')](function(_0x4a5d76){if(_0x4a5d76){if(_[_0xceb7('0x74')](_0x4a5d76[_0xceb7('0xbb')])){return _0x425bcd[_0xceb7('0xbf')](_0x556979);}else{if(!fs[_0xceb7('0xc0')](path[_0xceb7('0xc1')](config['root'],_0xceb7('0xc2'),_0x4a5d76['userpic']))){return _0x425bcd['download'](_0x556979);}return _0x425bcd[_0xceb7('0xbf')](path['join'](config[_0xceb7('0xc3')],_0xceb7('0xc2'),_0x4a5d76[_0xceb7('0xbb')]));}}})['catch'](handleError(_0x425bcd,null));};exports[_0xceb7('0xc4')]=function(_0x570e79,_0x406f08,_0x5d228e){var _0x1f8c1e={};var _0x17570b={};var _0x58b37e;var _0x154754;return db[_0xceb7('0x64')][_0xceb7('0x9d')]({'where':{'id':_0x570e79[_0xceb7('0x6a')]['id']}})['then'](handleEntityNotFound(_0x406f08,null))[_0xceb7('0x26')](function(_0x249d95){if(_0x249d95){_0x58b37e=_0x249d95;_0x17570b[_0xceb7('0x52')]=_[_0xceb7('0x50')](db[_0xceb7('0xc5')]['rawAttributes']);_0x17570b[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x570e79['query']);_0x17570b['filters']=_['intersection'](_0x17570b[_0xceb7('0x52')],_0x17570b[_0xceb7('0x4f')]);_0x1f8c1e[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x17570b[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x570e79['query'][_0xceb7('0x54')]));_0x1f8c1e[_0xceb7('0x55')]=_0x1f8c1e[_0xceb7('0x55')][_0xceb7('0x56')]?_0x1f8c1e[_0xceb7('0x55')]:_0x17570b[_0xceb7('0x52')];_0x1f8c1e[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x570e79[_0xceb7('0x4f')]['sort']);_0x1f8c1e[_0xceb7('0x5b')]=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x570e79[_0xceb7('0x4f')],_0x17570b[_0xceb7('0x51')]));if(_0x570e79[_0xceb7('0x4f')]['filter']){_0x1f8c1e['where']=_[_0xceb7('0x5d')](_0x1f8c1e[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x1f8c1e[_0xceb7('0x55')],function(_0x32a4ca){var _0x513897={};_0x513897[_0x32a4ca]={'$like':'%'+_0x570e79[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x513897;})});}_0x1f8c1e=_['merge']({},_0x1f8c1e,_0x570e79[_0xceb7('0x63')]);return _0x58b37e['getContacts'](_0x1f8c1e);}})['then'](function(_0x1a8c77){if(_0x1a8c77){_0x154754=_0x1a8c77[_0xceb7('0x56')];if(_0x570e79[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x67'))){_0x1f8c1e[_0xceb7('0x65')]=[{'model':db[_0xceb7('0xc7')],'as':_0xceb7('0xc8'),'required':![]},{'model':db[_0xceb7('0xc9')],'as':_0xceb7('0xca'),'attributes':['id','name',_0xceb7('0xcb')],'where':_0x570e79[_0xceb7('0x4f')][_0xceb7('0xcc')]?{'id':_0x570e79[_0xceb7('0x4f')][_0xceb7('0xcc')]}:undefined,'required':_0x570e79[_0xceb7('0x4f')][_0xceb7('0xcc')]?!![]:![]}];}if(!_0x570e79[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x1f8c1e[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x570e79[_0xceb7('0x4f')][_0xceb7('0x59')]);_0x1f8c1e[_0xceb7('0x32')]=qs['offset'](_0x570e79['query'][_0xceb7('0x32')]);}return _0x58b37e[_0xceb7('0xc4')](_0x1f8c1e);}})['then'](function(_0x56ad63){if(_0x56ad63){return _0x56ad63?{'count':_0x154754,'rows':_0x56ad63}:null;}})[_0xceb7('0x26')](respondWithResult(_0x406f08,null))[_0xceb7('0x6b')](handleError(_0x406f08,null));};exports['getQueues']=function(_0x20daa3,_0x579002,_0x1b71b1){var _0x442553;var _0x56fcca;var _0x86f828={};var _0x667b57;return db[_0xceb7('0x64')]['findOne']({'where':{'id':_0x20daa3[_0xceb7('0x6a')]['id']},'attributes':['id','name','role']})['then'](handleEntityNotFound(_0x579002,null))[_0xceb7('0x26')](function(_0x2da6f2){if(!utils[_0xceb7('0xa3')](_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x9f')])){throw new db[(_0xceb7('0x96'))]['ValidationError']('Unknown\x20channel');}_0x442553=_0x2da6f2;var _0x55f404={};_0x55f404['model']=_[_0xceb7('0x50')](db[_[_0xceb7('0xa6')](_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x9f')])+_0xceb7('0xcd')]['rawAttributes']);_0x55f404[_0xceb7('0x4f')]=_['keys'](_0x20daa3[_0xceb7('0x4f')]);_0x55f404[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x55f404['model'],_0x55f404[_0xceb7('0x4f')]);_0x86f828[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x55f404[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x86f828['attributes']=_0x86f828['attributes'][_0xceb7('0x56')]?_0x86f828[_0xceb7('0x55')]:_0x55f404[_0xceb7('0x52')];_0x86f828[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x20daa3[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x86f828[_0xceb7('0x5b')]=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x20daa3[_0xceb7('0x4f')],_0x55f404[_0xceb7('0x51')]));if(_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x86f828[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x86f828[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x86f828[_0xceb7('0x55')],function(_0x5d9fcd){var _0x43a4cd={};_0x43a4cd[_0x5d9fcd]={'$like':'%'+_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x43a4cd;})});}_0x86f828=_['merge']({},_0x86f828,_0x20daa3[_0xceb7('0x63')]);switch(_0x442553['role']){case _0xceb7('0x71'):return db[_[_0xceb7('0xa6')](_0x20daa3['query']['channel'])+_0xceb7('0xcd')][_0xceb7('0xce')](_0x86f828);case _0xceb7('0x3c'):case _0xceb7('0x3e'):return _0x442553[_0xceb7('0x3a')+_[_0xceb7('0xa6')](_0x20daa3['query'][_0xceb7('0x9f')])+'Queues'](_0x86f828);default:throw new db[(_0xceb7('0x96'))][(_0xceb7('0x99'))]('Unknown\x20role');}})[_0xceb7('0x26')](function(_0x2a1103){_0x667b57=_0x2a1103[_0xceb7('0x56')];if(!_0x20daa3[_0xceb7('0x4f')]['hasOwnProperty']('nolimit')){_0x86f828[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x59')]);_0x86f828[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0x20daa3[_0xceb7('0x4f')]['offset']);}switch(_0x442553[_0xceb7('0x6f')]){case _0xceb7('0x71'):return db[_[_0xceb7('0xa6')](_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x9f')])+_0xceb7('0xcd')][_0xceb7('0xce')](_0x86f828);case _0xceb7('0x3c'):case _0xceb7('0x3e'):return _0x442553[_0xceb7('0x3a')+_['capitalize'](_0x20daa3[_0xceb7('0x4f')][_0xceb7('0x9f')])+_0xceb7('0xb8')](_0x86f828);}})[_0xceb7('0x26')](function(_0xe071d){return{'count':_0x667b57,'rows':_0xe071d};})['then'](respondWithResult(_0x579002,null))[_0xceb7('0x6b')](handleError(_0x579002,null));};exports[_0xceb7('0xcf')]=function(_0x207b9d,_0x447785,_0x45b3bb){var _0x13cee1={};var _0x438ba7={};var _0x44973c;var _0x1023a8;return db[_0xceb7('0x64')][_0xceb7('0x9d')]({'where':{'id':_0x207b9d['params']['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x447785,null))[_0xceb7('0x26')](function(_0xe7ff16){if(_0xe7ff16){_0x44973c=_0xe7ff16;_0x438ba7[_0xceb7('0x52')]=_[_0xceb7('0x50')](db[_0xceb7('0xb3')]['rawAttributes']);_0x438ba7['query']=_[_0xceb7('0x50')](_0x207b9d[_0xceb7('0x4f')]);_0x438ba7[_0xceb7('0x51')]=_['intersection'](_0x438ba7['model'],_0x438ba7[_0xceb7('0x4f')]);_0x13cee1['attributes']=_['intersection'](_0x438ba7['model'],qs[_0xceb7('0x54')](_0x207b9d[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x13cee1['attributes']=_0x13cee1['attributes'][_0xceb7('0x56')]?_0x13cee1[_0xceb7('0x55')]:_0x438ba7[_0xceb7('0x52')];_0x13cee1[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x207b9d['query']['sort']);_0x13cee1[_0xceb7('0x5b')]=qs['filters'](_[_0xceb7('0x5c')](_0x207b9d[_0xceb7('0x4f')],_0x438ba7['filters']));if(_0x207b9d[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x13cee1['where']=_['merge'](_0x13cee1[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x13cee1[_0xceb7('0x55')],function(_0x48c315){var _0x179939={};_0x179939[_0x48c315]={'$like':'%'+_0x207b9d['query'][_0xceb7('0x41')]+'%'};return _0x179939;})});}_0x13cee1=_['merge']({},_0x13cee1,_0x207b9d['options']);return _0x44973c[_0xceb7('0xcf')](_0x13cee1);}})[_0xceb7('0x26')](function(_0x5a57f6){if(_0x5a57f6){_0x1023a8=_0x5a57f6[_0xceb7('0x56')];if(!_0x207b9d[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x13cee1[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x207b9d[_0xceb7('0x4f')][_0xceb7('0x59')]);_0x13cee1[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0x207b9d[_0xceb7('0x4f')][_0xceb7('0x32')]);}return _0x44973c[_0xceb7('0xcf')](_0x13cee1);}})[_0xceb7('0x26')](function(_0x2b198d){if(_0x2b198d){return _0x2b198d?{'count':_0x1023a8,'rows':_0x2b198d}:null;}})[_0xceb7('0x26')](respondWithResult(_0x447785,null))[_0xceb7('0x6b')](handleError(_0x447785,null));};exports['getGroups']=function(_0x4cda1d,_0x4c8d9c,_0x1f110b){var _0x1c68e3={};var _0x38a630={};var _0xeb474;var _0x27a7ab;return db[_0xceb7('0x64')]['findOne']({'where':{'id':_0x4cda1d[_0xceb7('0x6a')]['id']}})['then'](handleEntityNotFound(_0x4c8d9c,null))[_0xceb7('0x26')](function(_0x282ba7){if(_0x282ba7){_0xeb474=_0x282ba7;_0x38a630[_0xceb7('0x52')]=_[_0xceb7('0x50')](db[_0xceb7('0xd0')][_0xceb7('0x4b')]);_0x38a630[_0xceb7('0x4f')]=_['keys'](_0x4cda1d[_0xceb7('0x4f')]);_0x38a630['filters']=_[_0xceb7('0x53')](_0x38a630[_0xceb7('0x52')],_0x38a630[_0xceb7('0x4f')]);_0x1c68e3[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x38a630[_0xceb7('0x52')],qs['fields'](_0x4cda1d[_0xceb7('0x4f')]['fields']));_0x1c68e3['attributes']=_0x1c68e3['attributes'][_0xceb7('0x56')]?_0x1c68e3[_0xceb7('0x55')]:_0x38a630[_0xceb7('0x52')];_0x1c68e3[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x4cda1d[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x1c68e3[_0xceb7('0x5b')]=qs['filters'](_[_0xceb7('0x5c')](_0x4cda1d['query'],_0x38a630[_0xceb7('0x51')]));if(_0x4cda1d[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x1c68e3[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x1c68e3[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x1c68e3[_0xceb7('0x55')],function(_0x14b181){var _0xbc56ed={};_0xbc56ed[_0x14b181]={'$like':'%'+_0x4cda1d['query'][_0xceb7('0x41')]+'%'};return _0xbc56ed;})});}_0x1c68e3=_[_0xceb7('0x5d')]({},_0x1c68e3,_0x4cda1d[_0xceb7('0x63')]);return _0xeb474[_0xceb7('0xd1')](_0x1c68e3);}})[_0xceb7('0x26')](function(_0x592fb6){if(_0x592fb6){_0x27a7ab=_0x592fb6[_0xceb7('0x56')];if(!_0x4cda1d[_0xceb7('0x4f')][_0xceb7('0x57')]('nolimit')){_0x1c68e3[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x4cda1d['query'][_0xceb7('0x59')]);_0x1c68e3[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0x4cda1d[_0xceb7('0x4f')][_0xceb7('0x32')]);}return _0xeb474[_0xceb7('0xd1')](_0x1c68e3);}})[_0xceb7('0x26')](function(_0x5a944e){if(_0x5a944e){return _0x5a944e?{'count':_0x27a7ab,'rows':_0x5a944e}:null;}})['then'](respondWithResult(_0x4c8d9c,null))[_0xceb7('0x6b')](handleError(_0x4c8d9c,null));};exports[_0xceb7('0xd2')]=function(_0x2393e5,_0x1b29d9,_0x13f46c){var _0x3daeaa={'raw':!![],'where':{}};var _0x10dd84={};var _0x5c6b99={'count':0x0,'rows':[]};return db[_0xceb7('0x64')]['findOne']({'where':{'id':_0x2393e5['params']['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x1b29d9,null))[_0xceb7('0x26')](function(_0x55c69c){if(_0x55c69c){_0x10dd84[_0xceb7('0x52')]=_['keys'](db['VoiceRecording'][_0xceb7('0x4b')]);_0x10dd84[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x2393e5[_0xceb7('0x4f')]);_0x10dd84['filters']=_[_0xceb7('0x53')](_0x10dd84['model'],_0x10dd84[_0xceb7('0x4f')]);_0x3daeaa['attributes']=_[_0xceb7('0x53')](_0x10dd84[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x2393e5['query'][_0xceb7('0x54')]));_0x3daeaa['attributes']=_0x3daeaa['attributes']['length']?_0x3daeaa['attributes']:_0x10dd84[_0xceb7('0x52')];if(!_0x2393e5['query'][_0xceb7('0x57')]('nolimit')){_0x3daeaa[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x2393e5[_0xceb7('0x4f')][_0xceb7('0x59')]);_0x3daeaa[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0x2393e5['query'][_0xceb7('0x32')]);}_0x3daeaa[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x2393e5[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x3daeaa[_0xceb7('0x5b')]=qs[_0xceb7('0x51')](_['pick'](_0x2393e5['query'],_0x10dd84[_0xceb7('0x51')]));_0x3daeaa[_0xceb7('0x5b')]['UserId']=_0x55c69c['id'];if(_0x2393e5[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x3daeaa[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x3daeaa['where'],{'$or':_[_0xceb7('0x5e')](_0x3daeaa['attributes'],function(_0x1926ca){var _0x1d9caf={};_0x1d9caf[_0x1926ca]={'$like':'%'+_0x2393e5[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x1d9caf;})});}_0x3daeaa=_[_0xceb7('0x5d')]({},_0x3daeaa,_0x2393e5[_0xceb7('0x63')]);return db['VoiceRecording']['count']({'where':_0x3daeaa[_0xceb7('0x5b')]})[_0xceb7('0x26')](function(_0x2e0067){_0x5c6b99[_0xceb7('0x31')]=_0x2e0067;if(_0x2393e5['query'][_0xceb7('0x67')]){_0x3daeaa[_0xceb7('0x65')]=[{'all':!![]}];}return db[_0xceb7('0xd3')][_0xceb7('0xce')](_0x3daeaa);})['then'](function(_0x5af5ea){_0x5c6b99[_0xceb7('0x66')]=_0x5af5ea;return _0x5c6b99;});}})['then'](respondWithFilteredResult(_0x1b29d9,_0x3daeaa))[_0xceb7('0x6b')](handleError(_0x1b29d9,null));};exports[_0xceb7('0xd4')]=function(_0x3cafb9,_0x54576b,_0x592553){var _0x12b0a4={'raw':!![],'where':{}};var _0x3a8f19={};var _0x3462e6={'count':0x0,'rows':[]};return db[_0xceb7('0x64')][_0xceb7('0x9d')]({'where':{'id':_0x3cafb9[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x54576b,null))[_0xceb7('0x26')](function(_0x7443ef){if(_0x7443ef){_0x3a8f19[_0xceb7('0x52')]=_[_0xceb7('0x50')](db[_0xceb7('0xd5')][_0xceb7('0x4b')]);_0x3a8f19[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x3cafb9[_0xceb7('0x4f')]);_0x3a8f19[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x3a8f19['model'],_0x3a8f19[_0xceb7('0x4f')]);_0x12b0a4[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x3a8f19[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x3cafb9[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x12b0a4['attributes']=_0x12b0a4['attributes'][_0xceb7('0x56')]?_0x12b0a4[_0xceb7('0x55')]:_0x3a8f19[_0xceb7('0x52')];if(!_0x3cafb9[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x12b0a4['limit']=qs[_0xceb7('0x59')](_0x3cafb9[_0xceb7('0x4f')]['limit']);_0x12b0a4[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0x3cafb9[_0xceb7('0x4f')][_0xceb7('0x32')]);}_0x12b0a4[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x3cafb9[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x12b0a4[_0xceb7('0x5b')]=qs['filters'](_[_0xceb7('0x5c')](_0x3cafb9[_0xceb7('0x4f')],_0x3a8f19[_0xceb7('0x51')]));_0x12b0a4[_0xceb7('0x5b')][_0xceb7('0xd6')]=_0x7443ef['id'];if(_0x3cafb9[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x12b0a4[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x12b0a4['where'],{'$or':_[_0xceb7('0x5e')](_0x12b0a4[_0xceb7('0x55')],function(_0x1adca3){var _0x16e881={};_0x16e881[_0x1adca3]={'$like':'%'+_0x3cafb9[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x16e881;})});}_0x12b0a4=_['merge']({},_0x12b0a4,_0x3cafb9[_0xceb7('0x63')]);return db[_0xceb7('0xd5')][_0xceb7('0x31')]({'where':_0x12b0a4['where']})[_0xceb7('0x26')](function(_0x455f7e){_0x3462e6[_0xceb7('0x31')]=_0x455f7e;if(_0x3cafb9[_0xceb7('0x4f')][_0xceb7('0x67')]){_0x12b0a4['include']=[{'all':!![]}];}return db[_0xceb7('0xd5')]['findAll'](_0x12b0a4);})[_0xceb7('0x26')](function(_0x4937ae){_0x3462e6[_0xceb7('0x66')]=_0x4937ae;return _0x3462e6;});}})[_0xceb7('0x26')](respondWithFilteredResult(_0x54576b,_0x12b0a4))['catch'](handleError(_0x54576b,null));};exports['getChatInteractions']=function(_0x492118,_0x6135b5,_0x2d7774){var _0x33d836={};var _0x4e40c9={};var _0x569695;var _0x68228a;return db['User'][_0xceb7('0x9d')]({'where':{'id':_0x492118[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x6135b5,null))[_0xceb7('0x26')](function(_0x2e698e){if(_0x2e698e){_0x569695=_0x2e698e;_0x4e40c9[_0xceb7('0x52')]=_[_0xceb7('0x50')](db['ChatInteraction'][_0xceb7('0x4b')]);_0x4e40c9[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x492118[_0xceb7('0x4f')]);_0x4e40c9['filters']=_[_0xceb7('0x53')](_0x4e40c9['model'],_0x4e40c9[_0xceb7('0x4f')]);_0x33d836[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x4e40c9[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x492118[_0xceb7('0x4f')]['fields']));_0x33d836[_0xceb7('0x55')]=_0x33d836['attributes']['length']?_0x33d836['attributes']:_0x4e40c9[_0xceb7('0x52')];_0x33d836[_0xceb7('0x5a')]=qs['sort'](_0x492118['query'][_0xceb7('0xc6')]);_0x33d836[_0xceb7('0x5b')]=qs['filters'](_[_0xceb7('0x5c')](_0x492118[_0xceb7('0x4f')],_0x4e40c9[_0xceb7('0x51')]));if(_0x492118[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x33d836[_0xceb7('0x5b')]=_['merge'](_0x33d836['where'],{'$or':_['map'](_0x33d836[_0xceb7('0x55')],function(_0x521af8){var _0x3eb3bd={};_0x3eb3bd[_0x521af8]={'$like':'%'+_0x492118[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x3eb3bd;})});}_0x33d836=_['merge']({},_0x33d836,_0x492118[_0xceb7('0x63')]);return _0x569695[_0xceb7('0xd7')](_0x33d836);}})['then'](function(_0x188292){if(_0x188292){_0x68228a=_0x188292['length'];if(!_0x492118[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x33d836[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x492118[_0xceb7('0x4f')][_0xceb7('0x59')]);_0x33d836['offset']=qs[_0xceb7('0x32')](_0x492118[_0xceb7('0x4f')]['offset']);}return _0x569695[_0xceb7('0xd7')](_0x33d836);}})[_0xceb7('0x26')](function(_0x4a89af){if(_0x4a89af){return _0x4a89af?{'count':_0x68228a,'rows':_0x4a89af}:null;}})[_0xceb7('0x26')](respondWithResult(_0x6135b5,null))['catch'](handleError(_0x6135b5,null));};exports[_0xceb7('0xd8')]=function(_0x2bc57c,_0x5f01a5,_0x5cdd87){var _0x350d3f={};var _0x5114cb={};var _0xfec2e8;var _0x38048c;return db['User'][_0xceb7('0x9d')]({'where':{'id':_0x2bc57c['params']['id']}})['then'](handleEntityNotFound(_0x5f01a5,null))[_0xceb7('0x26')](function(_0x58778c){if(_0x58778c){_0xfec2e8=_0x58778c;_0x5114cb[_0xceb7('0x52')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x5114cb[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x2bc57c[_0xceb7('0x4f')]);_0x5114cb[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x5114cb[_0xceb7('0x52')],_0x5114cb[_0xceb7('0x4f')]);_0x350d3f[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x5114cb[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x2bc57c[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x350d3f['attributes']=_0x350d3f[_0xceb7('0x55')][_0xceb7('0x56')]?_0x350d3f[_0xceb7('0x55')]:_0x5114cb['model'];_0x350d3f[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x2bc57c['query'][_0xceb7('0xc6')]);_0x350d3f[_0xceb7('0x5b')]=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x2bc57c['query'],_0x5114cb[_0xceb7('0x51')]));if(_0x2bc57c[_0xceb7('0x4f')][_0xceb7('0x41')]){_0x350d3f[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x350d3f[_0xceb7('0x5b')],{'$or':_['map'](_0x350d3f[_0xceb7('0x55')],function(_0x3d1598){var _0x5e7bfc={};_0x5e7bfc[_0x3d1598]={'$like':'%'+_0x2bc57c[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x5e7bfc;})});}_0x350d3f=_[_0xceb7('0x5d')]({},_0x350d3f,_0x2bc57c['options']);return _0xfec2e8[_0xceb7('0xd8')](_0x350d3f);}})[_0xceb7('0x26')](function(_0x129adb){if(_0x129adb){_0x38048c=_0x129adb['length'];if(!_0x2bc57c[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x350d3f[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x2bc57c[_0xceb7('0x4f')][_0xceb7('0x59')]);_0x350d3f[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0x2bc57c[_0xceb7('0x4f')][_0xceb7('0x32')]);}return _0xfec2e8[_0xceb7('0xd8')](_0x350d3f);}})['then'](function(_0x54a632){if(_0x54a632){return _0x54a632?{'count':_0x38048c,'rows':_0x54a632}:null;}})[_0xceb7('0x26')](respondWithResult(_0x5f01a5,null))[_0xceb7('0x6b')](handleError(_0x5f01a5,null));};exports[_0xceb7('0xd9')]=function(_0x52238c,_0x2c0b0d,_0x164925){var _0x5f4b61={'raw':!![],'where':{}};var _0x4f0844={};var _0x512299={'count':0x0,'rows':[]};return db[_0xceb7('0x64')][_0xceb7('0x9d')]({'where':{'id':_0x52238c[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x2c0b0d,null))[_0xceb7('0x26')](function(_0x1fd4c0){if(_0x1fd4c0){_0x4f0844['model']=_[_0xceb7('0x50')](db[_0xceb7('0xda')][_0xceb7('0x4b')]);_0x4f0844[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x52238c['query']);_0x4f0844[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x4f0844[_0xceb7('0x52')],_0x4f0844[_0xceb7('0x4f')]);_0x5f4b61[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x4f0844[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x52238c[_0xceb7('0x4f')]['fields']));_0x5f4b61['attributes']=_0x5f4b61[_0xceb7('0x55')][_0xceb7('0x56')]?_0x5f4b61[_0xceb7('0x55')]:_0x4f0844[_0xceb7('0x52')];if(!_0x52238c['query'][_0xceb7('0x57')](_0xceb7('0x58'))){_0x5f4b61[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x52238c['query']['limit']);_0x5f4b61[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0x52238c[_0xceb7('0x4f')][_0xceb7('0x32')]);}_0x5f4b61[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x52238c['query'][_0xceb7('0xc6')]);_0x5f4b61['where']=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x52238c[_0xceb7('0x4f')],_0x4f0844[_0xceb7('0x51')]));_0x5f4b61[_0xceb7('0x5b')]['UserId']=_0x1fd4c0['id'];if(_0x52238c[_0xceb7('0x4f')]['filter']){_0x5f4b61['where']=_[_0xceb7('0x5d')](_0x5f4b61[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x5f4b61[_0xceb7('0x55')],function(_0x233585){var _0x46cb71={};_0x46cb71[_0x233585]={'$like':'%'+_0x52238c[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x46cb71;})});}_0x5f4b61=_[_0xceb7('0x5d')]({},_0x5f4b61,_0x52238c[_0xceb7('0x63')]);return db['MailInteraction'][_0xceb7('0x31')]({'where':_0x5f4b61['where']})[_0xceb7('0x26')](function(_0x30c806){_0x512299[_0xceb7('0x31')]=_0x30c806;if(_0x52238c['query']['includeAll']){_0x5f4b61[_0xceb7('0x65')]=[{'all':!![]}];}return db['MailInteraction'][_0xceb7('0xce')](_0x5f4b61);})[_0xceb7('0x26')](function(_0x10b4ca){_0x512299['rows']=_0x10b4ca;return _0x512299;});}})[_0xceb7('0x26')](respondWithFilteredResult(_0x2c0b0d,_0x5f4b61))[_0xceb7('0x6b')](handleError(_0x2c0b0d,null));};exports[_0xceb7('0xdb')]=function(_0x3c84af,_0x5679c8,_0x248101){var _0x4ad9f2={};var _0x323ac8={};var _0x5d7ed0;var _0x102995;return db[_0xceb7('0x64')][_0xceb7('0x9d')]({'where':{'id':_0x3c84af[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x5679c8,null))[_0xceb7('0x26')](function(_0x9f64d5){if(_0x9f64d5){_0x5d7ed0=_0x9f64d5;_0x323ac8[_0xceb7('0x52')]=_[_0xceb7('0x50')](db[_0xceb7('0xdc')][_0xceb7('0x4b')]);_0x323ac8['query']=_['keys'](_0x3c84af[_0xceb7('0x4f')]);_0x323ac8[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x323ac8['model'],_0x323ac8[_0xceb7('0x4f')]);_0x4ad9f2[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x323ac8[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x3c84af[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x4ad9f2['attributes']=_0x4ad9f2['attributes'][_0xceb7('0x56')]?_0x4ad9f2[_0xceb7('0x55')]:_0x323ac8[_0xceb7('0x52')];_0x4ad9f2['order']=qs['sort'](_0x3c84af[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x4ad9f2['where']=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x3c84af['query'],_0x323ac8[_0xceb7('0x51')]));if(_0x3c84af['query'][_0xceb7('0x41')]){_0x4ad9f2[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x4ad9f2['where'],{'$or':_[_0xceb7('0x5e')](_0x4ad9f2[_0xceb7('0x55')],function(_0x2e5c99){var _0x370541={};_0x370541[_0x2e5c99]={'$like':'%'+_0x3c84af[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x370541;})});}_0x4ad9f2=_[_0xceb7('0x5d')]({},_0x4ad9f2,_0x3c84af[_0xceb7('0x63')]);return _0x5d7ed0[_0xceb7('0xdb')](_0x4ad9f2);}})[_0xceb7('0x26')](function(_0x18459d){if(_0x18459d){_0x102995=_0x18459d['length'];if(!_0x3c84af[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x4ad9f2[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x3c84af[_0xceb7('0x4f')]['limit']);_0x4ad9f2['offset']=qs['offset'](_0x3c84af[_0xceb7('0x4f')][_0xceb7('0x32')]);}return _0x5d7ed0[_0xceb7('0xdb')](_0x4ad9f2);}})['then'](function(_0x1fd9e2){if(_0x1fd9e2){return _0x1fd9e2?{'count':_0x102995,'rows':_0x1fd9e2}:null;}})[_0xceb7('0x26')](respondWithResult(_0x5679c8,null))[_0xceb7('0x6b')](handleError(_0x5679c8,null));};exports[_0xceb7('0xdd')]=function(_0x157263,_0x2ef6d3,_0x135106){var _0x2887ac={};var _0xfebc2b={};var _0x11d6c7;var _0x21e433;return db['User']['findOne']({'where':{'id':_0x157263[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x2ef6d3,null))[_0xceb7('0x26')](function(_0x5bfe80){if(_0x5bfe80){_0x11d6c7=_0x5bfe80;_0xfebc2b[_0xceb7('0x52')]=_[_0xceb7('0x50')](db['FaxInteraction'][_0xceb7('0x4b')]);_0xfebc2b['query']=_['keys'](_0x157263[_0xceb7('0x4f')]);_0xfebc2b[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0xfebc2b[_0xceb7('0x52')],_0xfebc2b[_0xceb7('0x4f')]);_0x2887ac['attributes']=_['intersection'](_0xfebc2b[_0xceb7('0x52')],qs['fields'](_0x157263[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x2887ac['attributes']=_0x2887ac['attributes'][_0xceb7('0x56')]?_0x2887ac[_0xceb7('0x55')]:_0xfebc2b['model'];_0x2887ac[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x157263[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x2887ac['where']=qs[_0xceb7('0x51')](_['pick'](_0x157263[_0xceb7('0x4f')],_0xfebc2b['filters']));if(_0x157263[_0xceb7('0x4f')]['filter']){_0x2887ac[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x2887ac[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x2887ac['attributes'],function(_0x423e24){var _0x498e7e={};_0x498e7e[_0x423e24]={'$like':'%'+_0x157263[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x498e7e;})});}_0x2887ac=_[_0xceb7('0x5d')]({},_0x2887ac,_0x157263['options']);return _0x11d6c7[_0xceb7('0xdd')](_0x2887ac);}})['then'](function(_0x2f55df){if(_0x2f55df){_0x21e433=_0x2f55df[_0xceb7('0x56')];if(!_0x157263[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x2887ac['limit']=qs[_0xceb7('0x59')](_0x157263['query'][_0xceb7('0x59')]);_0x2887ac['offset']=qs['offset'](_0x157263[_0xceb7('0x4f')][_0xceb7('0x32')]);}return _0x11d6c7[_0xceb7('0xdd')](_0x2887ac);}})[_0xceb7('0x26')](function(_0x190f20){if(_0x190f20){return _0x190f20?{'count':_0x21e433,'rows':_0x190f20}:null;}})['then'](respondWithResult(_0x2ef6d3,null))[_0xceb7('0x6b')](handleError(_0x2ef6d3,null));};exports['login']=function(_0x112ef3,_0x57b88c,_0x25e20f){var _0x59597b;var _0x5ee6d0;var _0x123535;return db['User'][_0xceb7('0xb6')]({'where':{'id':_0x112ef3['params']['id'],'role':_0xceb7('0x3e')},'attributes':['id',_0xceb7('0x45'),'phone',_0xceb7('0xde'),_0xceb7('0x6f'),_0xceb7('0x79'),_0xceb7('0xdf')]})[_0xceb7('0x26')](handleEntityNotFound(_0x57b88c,null))[_0xceb7('0x26')](function(_0x300954){if(_0x300954){_0x59597b=_0x300954;if(_0x112ef3[_0xceb7('0x69')][_0xceb7('0xa2')]){_0x123535=util['format'](_0xceb7('0xe0'),_0x59597b[_0x112ef3[_0xceb7('0x69')]['interface']]);}else if(_0x112ef3[_0xceb7('0x69')][_0xceb7('0xe1')]){_0x123535=util[_0xceb7('0x76')](_0xceb7('0xb1'),_0x112ef3[_0xceb7('0x69')][_0xceb7('0xe1')]);}else{_0x123535=util[_0xceb7('0x76')](_0xceb7('0xb1'),_0x59597b[_0xceb7('0x45')]);}socket['to'](util['format'](_0xceb7('0xe2'),_0x59597b[_0xceb7('0x45')]))['emit'](_0xceb7('0xe3'),{'ip':_0x112ef3['headers'][_0xceb7('0xe4')]||_0x112ef3[_0xceb7('0xe5')][_0xceb7('0xe6')]||_0x112ef3[_0xceb7('0xe7')][_0xceb7('0xe6')]||_0x112ef3[_0xceb7('0xe5')]['socket'][_0xceb7('0xe6')]});return db[_0xceb7('0xb3')][_0xceb7('0x47')]({'where':{'membername':_0x59597b[_0xceb7('0x45')]},'individualHooks':!![]});}})['then'](function(_0x3f08e1){if(_0x59597b){return _0x59597b[_0xceb7('0xe8')]({'raw':!![]});}})[_0xceb7('0x26')](function(_0x297cf3){var _0x390256=[];if(_0x297cf3){_0x5ee6d0=_0x297cf3;if(_0x5ee6d0[_0xceb7('0x56')]){for(var _0x5bbfcd=0x0;_0x5bbfcd<_0x5ee6d0['length'];_0x5bbfcd++){_0x390256[_0xceb7('0xb0')]({'membername':_0x59597b[_0xceb7('0x45')],'UserId':_0x59597b['id'],'queue_name':_0x5ee6d0[_0x5bbfcd][_0xceb7('0x45')],'VoiceQueueId':_0x5ee6d0[_0x5bbfcd]['id'],'interface':_0x123535,'paused':_0x59597b[_0xceb7('0xdf')]||![],'penalty':_0x5ee6d0[_0x5bbfcd][_0xceb7('0xe9')]||0x0});}return BPromise['each'](_0x390256,function(_0x3fe05c){return db['UserVoiceQueueRt'][_0xceb7('0xb4')](_0x3fe05c);});}}})[_0xceb7('0x26')](function(){return db[_0xceb7('0xea')][_0xceb7('0xce')]({'where':{'membername':_0x59597b[_0xceb7('0x45')],'exitAt':null}});})['then'](function(_0x331e9a){var _0x47e601=[];_0x331e9a[_0xceb7('0xeb')](function(_0x36b590){_0x47e601['push'](_0x36b590['update']({'exitAt':moment()['format'](_0xceb7('0xec'))}));});return BPromise[_0xceb7('0xed')](_0x47e601);})[_0xceb7('0x26')](function(){var _0x4ff507=[];var _0x3da65e=[];var _0x4d964f=utils[_0xceb7('0xee')]();var _0x34e28f={'membername':_0x59597b[_0xceb7('0x45')],'interface':_0x123535,'enterAt':moment()[_0xceb7('0x76')](_0xceb7('0xec')),'role':_0x59597b[_0xceb7('0x6f')],'internal':_0x59597b[_0xceb7('0x79')]};_0x4d964f[_0xceb7('0xeb')](function(_0x3ee2cf){_0x4ff507['push'](_[_0xceb7('0x5d')]({'channel':_0x3ee2cf,'type':_0xceb7('0xef'),'data1':_0x112ef3[_0xceb7('0x69')]['device'],'data2':_0x123535},_0x34e28f));if(_0x59597b[_0xceb7('0xdf')]){_0x3da65e['push'](_[_0xceb7('0x5d')]({'channel':_0x3ee2cf,'type':_0xceb7('0xf0'),'data1':_0xceb7('0xf1')},_0x34e28f));}});return db['MemberReport'][_0xceb7('0x68')](_0x4ff507[_0xceb7('0xf2')](_0x3da65e),{'individualHooks':!![]});})['then'](function(){return _0x59597b['update']({'online':!![],'lastLoginAt':moment()[_0xceb7('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x59597b[_0xceb7('0xdf')]||![],'mailPause':_0x59597b[_0xceb7('0xdf')]||![],'chatPause':_0x59597b[_0xceb7('0xdf')]||![],'faxPause':_0x59597b[_0xceb7('0xdf')]||![],'smsPause':_0x59597b[_0xceb7('0xdf')]||![],'openchannelPause':_0x59597b[_0xceb7('0xdf')]||![],'pauseType':_0x59597b[_0xceb7('0xdf')]?_0xceb7('0xf1'):null,'interface':_0x123535,'lastPauseAt':moment()['format'](_0xceb7('0xec'))});})[_0xceb7('0x26')](respondWithResult(_0x57b88c,null))[_0xceb7('0x6b')](handleError(_0x57b88c,null));};exports['logout']=function(_0x1a7032,_0x5742d2,_0x33d823){var _0x2fb069;return db[_0xceb7('0x64')][_0xceb7('0xb6')]({'where':{'id':_0x1a7032[_0xceb7('0x6a')]['id'],'role':_0xceb7('0x3e')},'attributes':['id',_0xceb7('0x45'),_0xceb7('0x6f')]})['then'](handleEntityNotFound(_0x5742d2,null))[_0xceb7('0x26')](function(_0x288c99){if(_0x288c99){_0x2fb069=_0x288c99;return db[_0xceb7('0xb3')]['destroy']({'where':{'membername':_0x2fb069[_0xceb7('0x45')]},'individualHooks':!![]});}})[_0xceb7('0x26')](function(){return db[_0xceb7('0xea')][_0xceb7('0xce')]({'where':{'membername':_0x2fb069[_0xceb7('0x45')],'exitAt':null}});})[_0xceb7('0x26')](function(_0x5595bf){var _0x597d2e=[];_0x5595bf[_0xceb7('0xeb')](function(_0x367674){_0x597d2e[_0xceb7('0xb0')](_0x367674[_0xceb7('0x39')]({'exitAt':moment()[_0xceb7('0x76')](_0xceb7('0xec'))}));});return BPromise[_0xceb7('0xed')](_0x597d2e);})['then'](function(){return _0x2fb069['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xceb7('0x26')](respondWithResult(_0x5742d2,null))[_0xceb7('0x6b')](handleError(_0x5742d2,null));};exports[_0xceb7('0xf3')]=function(_0x848374,_0x1c4238,_0x2e5942){var _0x355dde;return db[_0xceb7('0xb3')][_0xceb7('0x39')]({'paused':0x1},{'where':{'UserId':_0x848374[_0xceb7('0x6a')]['id']},'individualHooks':!![]})[_0xceb7('0x26')](function(){return db[_0xceb7('0x64')][_0xceb7('0xb6')]({'where':{'id':_0x848374[_0xceb7('0x6a')]['id'],'role':_0xceb7('0x3e')},'attributes':['id',_0xceb7('0x45'),_0xceb7('0x6f'),_0xceb7('0x79'),_0xceb7('0xa2')]});})[_0xceb7('0x26')](handleEntityNotFound(_0x1c4238,null))[_0xceb7('0x26')](function(_0x4693f9){if(_0x4693f9){_0x355dde=_0x4693f9;return respondWithRpcPromise(_0xceb7('0xf4'),_0xceb7('0xf3'),{'id':_0x355dde['id'],'name':_0x355dde['name'],'pause':!![]});}})['then'](function(){if(_0x355dde){return db['MemberReport'][_0xceb7('0xce')]({'where':{'membername':_0x355dde[_0xceb7('0x45')],'type':_0xceb7('0xf0'),'exitAt':null}});}})['then'](function(_0x3c1105){if(_0x3c1105[_0xceb7('0x56')]){var _0x549891=moment()['format'](_0xceb7('0xec'));for(var _0x1c8899=0x0,_0x462d59=_0x3c1105[_0xceb7('0x56')];_0x1c8899<_0x462d59;_0x1c8899++){_0x3c1105[_0x1c8899]['updateAttributes']({'exitAt':_0x549891});}}})[_0xceb7('0x26')](function(){var _0x3ed138=[];var _0x2acaca=utils[_0xceb7('0xee')]();_0x2acaca[_0xceb7('0xeb')](function(_0x47bb36){_0x3ed138['push']({'channel':_0x47bb36,'membername':_0x355dde[_0xceb7('0x45')],'interface':_['isNil'](_0x355dde[_0xceb7('0xa2')])?util[_0xceb7('0x76')](_0xceb7('0xb1'),_0x355dde[_0xceb7('0x45')]):_0x355dde[_0xceb7('0xa2')],'type':'PAUSE','enterAt':moment()[_0xceb7('0x76')](_0xceb7('0xec')),'data1':_0x848374[_0xceb7('0x69')][_0xceb7('0xf5')]||'DEFAULT\x20PAUSE','role':_0x355dde[_0xceb7('0x6f')],'internal':_0x355dde[_0xceb7('0x79')]});});return db[_0xceb7('0xea')][_0xceb7('0x68')](_0x3ed138,{'individualHooks':!![]});})['then'](function(){return _0x355dde[_0xceb7('0x39')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x848374[_0xceb7('0x69')][_0xceb7('0xf5')]||_0xceb7('0xf6'),'lastPauseAt':moment()['format'](_0xceb7('0xec'))});})[_0xceb7('0x26')](respondWithResult(_0x1c4238,null))[_0xceb7('0x6b')](handleError(_0x1c4238,null));};exports[_0xceb7('0xf7')]=function(_0x58a866,_0x5c6490,_0x380577){var _0x3abc5a;return db[_0xceb7('0x64')]['find']({'where':{'id':_0x58a866['params']['id']},'attributes':['id',_0xceb7('0x45'),_0xceb7('0x6f'),_0xceb7('0xa1'),_0xceb7('0xf8'),_0xceb7('0xf9'),_0xceb7('0xfa'),_0xceb7('0xfb'),_0xceb7('0xfc'),_0xceb7('0xfd'),_0xceb7('0xfe')]})[_0xceb7('0x26')](handleEntityNotFound(_0x5c6490,null))[_0xceb7('0x26')](function(_0x3e5e30){if(_0x3e5e30){_0x3abc5a=_0x3e5e30;if(_0x58a866['body'][_0xceb7('0x9f')]&&!utils[_0xceb7('0xa3')](_0x58a866[_0xceb7('0x69')][_0xceb7('0x9f')])){throw new db[(_0xceb7('0x96'))][(_0xceb7('0x99'))](_0xceb7('0xa4'));}switch(_0x58a866['body'][_0xceb7('0x9f')]){case _0xceb7('0xae'):return respondWithRpcPromise(_0xceb7('0xf4'),_0xceb7('0xf7'),{'id':_0x3abc5a['id'],'name':_0x3abc5a[_0xceb7('0x45')],'pause':![]})[_0xceb7('0x26')](function(){return db[_0xceb7('0xb3')]['update']({'paused':0x0},{'where':{'UserId':_0x3abc5a['id']},'individualHooks':!![]});})[_0xceb7('0x26')](function(){return db[_0xceb7('0xea')][_0xceb7('0xb6')]({'where':{'channel':_0x58a866[_0xceb7('0x69')][_0xceb7('0x9f')],'membername':_0x3abc5a[_0xceb7('0x45')],'type':_0xceb7('0xf0'),'exitAt':null}});})[_0xceb7('0x26')](function(_0x4a7c8c){if(_0x4a7c8c){return _0x4a7c8c[_0xceb7('0x39')]({'exitAt':moment()[_0xceb7('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xceb7('0x26')](function(){return _0x3abc5a[_0xceb7('0x39')]({'voicePause':![]});});case _0xceb7('0xff'):case'chat':case _0xceb7('0x100'):case'sms':case _0xceb7('0x101'):return db[_0xceb7('0xea')][_0xceb7('0xb6')]({'where':{'channel':_0x58a866['body'][_0xceb7('0x9f')],'membername':_0x3abc5a[_0xceb7('0x45')],'type':'PAUSE','exitAt':null}})[_0xceb7('0x26')](function(_0x1f6b94){if(_0x1f6b94){return _0x1f6b94[_0xceb7('0x39')]({'exitAt':moment()[_0xceb7('0x76')](_0xceb7('0xec')),'data2':_0xceb7('0x102')},{'individualHooks':!![]});}return null;})[_0xceb7('0x26')](function(){var _0x2c4b9d={};_[_0xceb7('0x34')](_0x2c4b9d,util[_0xceb7('0x76')]('%s%s',_0x58a866[_0xceb7('0x69')][_0xceb7('0x9f')],_0xceb7('0x103')),![]);return _0x3abc5a[_0xceb7('0x39')](_0x2c4b9d);});default:return respondWithRpcPromise(_0xceb7('0xf4'),_0xceb7('0xf7'),{'id':_0x3abc5a['id'],'name':_0x3abc5a[_0xceb7('0x45')],'pause':![]})[_0xceb7('0x26')](function(){return db['UserVoiceQueueRt'][_0xceb7('0x39')]({'paused':0x0},{'where':{'UserId':_0x3abc5a['id']}});})[_0xceb7('0x26')](function(){return db['MemberReport'][_0xceb7('0xce')]({'where':{'membername':_0x3abc5a[_0xceb7('0x45')],'type':_0xceb7('0xf0'),'exitAt':null}});})['then'](function(_0xd69edb){var _0x32e504=[];_0xd69edb[_0xceb7('0xeb')](function(_0x255cf1){_0x32e504[_0xceb7('0xb0')](_0x255cf1['update']({'exitAt':moment()[_0xceb7('0x76')](_0xceb7('0xec')),'data2':_0xceb7('0x102')}));});return BPromise[_0xceb7('0xed')](_0x32e504);})[_0xceb7('0x26')](function(){return _0x3abc5a[_0xceb7('0x39')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xceb7('0x26')](respondWithResult(_0x5c6490,null))[_0xceb7('0x6b')](handleError(_0x5c6490,null));};exports[_0xceb7('0x104')]=function(_0xb3d9d3,_0x314065,_0x430738){var _0x390e67={};var _0x3caf37={};var _0x45a570;var _0x30fa44;return db['User']['findOne']({'where':{'id':_0xb3d9d3[_0xceb7('0x6a')]['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x314065,null))[_0xceb7('0x26')](function(_0x44b662){if(_0x44b662){_0x45a570=_0x44b662;_0x3caf37[_0xceb7('0x52')]=_[_0xceb7('0x50')](db[_0xceb7('0x105')][_0xceb7('0x4b')]);_0x3caf37[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0xb3d9d3[_0xceb7('0x4f')]);_0x3caf37[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x3caf37[_0xceb7('0x52')],_0x3caf37[_0xceb7('0x4f')]);_0x390e67[_0xceb7('0x55')]=_['intersection'](_0x3caf37[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0xb3d9d3['query'][_0xceb7('0x54')]));_0x390e67[_0xceb7('0x55')]=_0x390e67['attributes'][_0xceb7('0x56')]?_0x390e67['attributes']:_0x3caf37[_0xceb7('0x52')];_0x390e67[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0xb3d9d3[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x390e67['where']=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0xb3d9d3['query'],_0x3caf37[_0xceb7('0x51')]));if(_0xb3d9d3['query'][_0xceb7('0x41')]){_0x390e67['where']=_[_0xceb7('0x5d')](_0x390e67[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x390e67[_0xceb7('0x55')],function(_0xd3e2c3){var _0x586e2a={};_0x586e2a[_0xd3e2c3]={'$like':'%'+_0xb3d9d3[_0xceb7('0x4f')]['filter']+'%'};return _0x586e2a;})});}_0x390e67=_[_0xceb7('0x5d')]({},_0x390e67,_0xb3d9d3[_0xceb7('0x63')]);return _0x45a570[_0xceb7('0x104')](_0x390e67);}})[_0xceb7('0x26')](function(_0x9675fb){if(_0x9675fb){_0x30fa44=_0x9675fb[_0xceb7('0x56')];if(!_0xb3d9d3[_0xceb7('0x4f')][_0xceb7('0x57')]('nolimit')){_0x390e67[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0xb3d9d3[_0xceb7('0x4f')]['limit']);_0x390e67[_0xceb7('0x32')]=qs[_0xceb7('0x32')](_0xb3d9d3[_0xceb7('0x4f')][_0xceb7('0x32')]);}return _0x45a570[_0xceb7('0x104')](_0x390e67);}})[_0xceb7('0x26')](function(_0x572472){if(_0x572472){return _0x572472?{'count':_0x30fa44,'rows':_0x572472}:null;}})[_0xceb7('0x26')](respondWithResult(_0x314065,null))['catch'](handleError(_0x314065,null));};exports[_0xceb7('0x106')]=function(_0x331877,_0x48c427,_0x538dc4){return db[_0xceb7('0x64')][_0xceb7('0xb6')]({'where':{'id':_0x331877[_0xceb7('0x6a')]['id']}})['then'](handleEntityNotFound(_0x48c427,null))[_0xceb7('0x26')](function(_0x15d3a1){if(_0x15d3a1){return _0x15d3a1[_0xceb7('0x106')](_0x331877[_0xceb7('0x69')]['ids'],_[_0xceb7('0x6e')](_0x331877[_0xceb7('0x69')],[_0xceb7('0xa7'),'id'])||{});}})[_0xceb7('0x26')](respondWithResult(_0x48c427,null))[_0xceb7('0x6b')](handleError(_0x48c427,null));};exports['removeTeams']=function(_0xbb4ba,_0x5ce28e,_0x5ac994){return db[_0xceb7('0x64')][_0xceb7('0xb6')]({'where':{'id':_0xbb4ba[_0xceb7('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5ce28e,null))['then'](function(_0x131550){if(_0x131550){return _0x131550[_0xceb7('0x107')](_0xbb4ba[_0xceb7('0x4f')][_0xceb7('0xa7')]);}})['then'](respondWithStatusCode(_0x5ce28e,null))[_0xceb7('0x6b')](handleError(_0x5ce28e,null));};exports[_0xceb7('0x108')]=function(_0x49551d,_0x46d0ba,_0x2db7c1){var _0x36507a={};var _0xd99e65={};var _0x281434;var _0x36f83b;return db[_0xceb7('0x64')][_0xceb7('0x9d')]({'where':{'id':_0x49551d[_0xceb7('0x6a')]['id']}})['then'](handleEntityNotFound(_0x46d0ba,null))[_0xceb7('0x26')](function(_0x1d4325){if(_0x1d4325){_0x281434=_0x1d4325;_0xd99e65['model']=_[_0xceb7('0x50')](db[_0xceb7('0xc7')][_0xceb7('0x4b')]);_0xd99e65['query']=_['keys'](_0x49551d[_0xceb7('0x4f')]);_0xd99e65[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0xd99e65[_0xceb7('0x52')],_0xd99e65['query']);_0x36507a[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0xd99e65['model'],qs[_0xceb7('0x54')](_0x49551d[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x36507a[_0xceb7('0x55')]=_0x36507a[_0xceb7('0x55')]['length']?_0x36507a[_0xceb7('0x55')]:_0xd99e65['model'];_0x36507a[_0xceb7('0x5a')]=qs[_0xceb7('0xc6')](_0x49551d[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x36507a[_0xceb7('0x5b')]=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x49551d['query'],_0xd99e65['filters']));if(_0x49551d['query'][_0xceb7('0x41')]){_0x36507a[_0xceb7('0x5b')]=_[_0xceb7('0x5d')](_0x36507a[_0xceb7('0x5b')],{'$or':_[_0xceb7('0x5e')](_0x36507a['attributes'],function(_0x44b8d6){var _0x5b95a4={};_0x5b95a4[_0x44b8d6]={'$like':'%'+_0x49551d[_0xceb7('0x4f')][_0xceb7('0x41')]+'%'};return _0x5b95a4;})});}_0x36507a=_[_0xceb7('0x5d')]({},_0x36507a,_0x49551d[_0xceb7('0x63')]);return _0x281434[_0xceb7('0x108')](_0x36507a);}})['then'](function(_0x19a5ad){if(_0x19a5ad){_0x36f83b=_0x19a5ad['length'];if(!_0x49551d[_0xceb7('0x4f')][_0xceb7('0x57')](_0xceb7('0x58'))){_0x36507a[_0xceb7('0x59')]=qs[_0xceb7('0x59')](_0x49551d['query']['limit']);_0x36507a['offset']=qs['offset'](_0x49551d[_0xceb7('0x4f')][_0xceb7('0x32')]);}return _0x281434['getLists'](_0x36507a);}})[_0xceb7('0x26')](function(_0x3fa84c){if(_0x3fa84c){return _0x3fa84c?{'count':_0x36f83b,'rows':_0x3fa84c}:null;}})[_0xceb7('0x26')](respondWithResult(_0x46d0ba,null))['catch'](handleError(_0x46d0ba,null));};exports[_0xceb7('0x109')]=function(_0x44bb35,_0x1e0356,_0x373a88){var _0x84e19f={};var _0x54b9bb={};var _0x3f177a;var _0x38542d;return db[_0xceb7('0x64')][_0xceb7('0x9d')]({'where':{'id':_0x44bb35['params']['id']}})[_0xceb7('0x26')](handleEntityNotFound(_0x1e0356,null))[_0xceb7('0x26')](function(_0x3746ba){if(_0x3746ba){_0x3f177a=_0x3746ba;_0x54b9bb[_0xceb7('0x52')]=_[_0xceb7('0x50')](db[_0xceb7('0x64')][_0xceb7('0x4b')]);_0x54b9bb[_0xceb7('0x4f')]=_[_0xceb7('0x50')](_0x44bb35[_0xceb7('0x4f')]);_0x54b9bb[_0xceb7('0x51')]=_[_0xceb7('0x53')](_0x54b9bb['model'],_0x54b9bb[_0xceb7('0x4f')]);_0x84e19f[_0xceb7('0x55')]=_[_0xceb7('0x53')](_0x54b9bb[_0xceb7('0x52')],qs[_0xceb7('0x54')](_0x44bb35[_0xceb7('0x4f')][_0xceb7('0x54')]));_0x84e19f[_0xceb7('0x55')]=_0x84e19f['attributes'][_0xceb7('0x56')]?_0x84e19f[_0xceb7('0x55')]:_0x54b9bb['model'];_0x84e19f['order']=qs[_0xceb7('0xc6')](_0x44bb35[_0xceb7('0x4f')][_0xceb7('0xc6')]);_0x84e19f['where']=qs[_0xceb7('0x51')](_[_0xceb7('0x5c')](_0x44bb35[_0xceb7('0x4f')],_0x54b9bb[_0xceb7('0x51')]));if(_0x44bb35['query'][_0xceb7('0x41')]){_0x84e19f['where']=_[_0xceb7('0x5d')](_0x84e19f['where'],{'$or':_[_0xceb7('0x5e')](_0x84e19f[_0xceb7('0x55')],function(_0x2bf86b){var _0x4857c9={};_0x4857c9[_0x2bf86b]={'$like':'%'+_0x44bb35['query']['filter']+'%'};return _0x4857c9;})});}_0x84e19f[_0xceb7('0x52')]=db[_0xceb7('0x64')];_0x84e19f['as']=_0xceb7('0x3d');_0x84e19f=_[_0xceb7('0x5d')]({},_0x84e19f,_0x44bb35[_0xceb7('0x63')]);return _0x3f177a[_0xceb7('0xe8')]({'include':[_0x84e19f]});}})[_0xceb7('0x26')](function(_0x2a5d05){if(_0x2a5d05){var _0x4b926b={},_0x129ff5=[],_0x479247=0x0;for(var _0x2459d0=0x0;_0x2459d0<_0x2a5d05[_0xceb7('0x56')];_0x2459d0+=0x1){for(var _0x5b3e01=0x0,_0x419e57;_0x5b3e01<_0x2a5d05[_0x2459d0][_0xceb7('0x3d')][_0xceb7('0x56')];_0x5b3e01+=0x1){_0x419e57=_0x2a5d05[_0x2459d0][_0xceb7('0x3d')][_0x5b3e01]['get']({'plain':!![]});_0x4b926b[_0x419e57['id']]=_0x419e57;}}_0x4b926b=_[_0xceb7('0x10a')](_0x4b926b);for(var _0x5210c4=qs[_0xceb7('0x32')](_0x44bb35[_0xceb7('0x4f')][_0xceb7('0x32')]);_0x5210c4<_0x4b926b[_0xceb7('0x56')]&&_0x129ff5[_0xceb7('0x56')]=_0x136bb2){_0x4f6061=_0x136bb2;_0x29b9be=0xc8;}else{_0x29b9be=0xce;}_0x295427[_0xed73('0x29')](_0x29b9be);return _0x295427[_0xed73('0x2f')](_0xed73('0x30'),_0x467ef6+'-'+_0x4f6061+'/'+_0x136bb2)[_0xed73('0x2b')](_0x179898);}return null;};}function patchUpdates(_0x58ee22){return function(_0x1747e7){try{jsonpatch['apply'](_0x1747e7,_0x58ee22,!![]);}catch(_0x42fa3a){return BPromise['reject'](_0x42fa3a);}return _0x1747e7[_0xed73('0x31')]();};}function saveUpdates(_0x583804,_0x3db005){return function(_0x34a352){if(_0x34a352){return _0x34a352['update'](_0x583804)['then'](function(_0xe224f){return _0xe224f;});}return null;};}function removeEntity(_0x5041ce,_0x2f7caf){return function(_0x1e8cb0){if(_0x1e8cb0){return _0x1e8cb0[_0xed73('0x32')]()[_0xed73('0x1f')](function(){var _0x2ec51f=_0x1e8cb0[_0xed73('0x33')]({'plain':!![]});var _0x313fa2=[{'name':_0xed73('0x34'),'value':'user','ignore':!![]},{'name':_0xed73('0x35'),'value':_0xed73('0x36'),'ignore':![]},{'name':_0xed73('0x37'),'value':'telephone','ignore':![]}];var _0x175678=_(_0x313fa2)[_0xed73('0x38')]('ignore')[_0xed73('0x39')]('value')[_0xed73('0x3a')]();if(_['includes'](_0x175678,_0x2ec51f[_0xed73('0x3b')])){return;}var _0x15a1f0=_[_0xed73('0x3c')](_0x313fa2,[_0xed73('0x3a'),_0x2ec51f[_0xed73('0x3b')]])[_0xed73('0x3d')];return db[_0xed73('0x3e')][_0xed73('0x32')]({'where':{'type':_0x15a1f0,'resourceId':_0x2ec51f['id']}})[_0xed73('0x1f')](function(){return _0x1e8cb0;});})[_0xed73('0x1f')](function(){_0x5041ce[_0xed73('0x29')](0xcc)[_0xed73('0x2a')]();});}};}function handleEntityNotFound(_0x5bb983,_0x308de1){return function(_0x1da25e){if(!_0x1da25e){_0x5bb983[_0xed73('0x28')](0x194);}return _0x1da25e;};}function handleError(_0x20d528,_0x3c5055){_0x3c5055=_0x3c5055||0x1f4;return function(_0xb603d8){logger['error'](_0xb603d8[_0xed73('0x3f')]);if(_0xb603d8[_0xed73('0x3d')]){delete _0xb603d8['name'];}_0x20d528[_0xed73('0x29')](_0x3c5055)[_0xed73('0x40')](_0xb603d8);};}exports[_0xed73('0x41')]=function(_0x5f18b6,_0x4ee537){var _0xb3749d={},_0x5610d0={},_0x36439f={'count':0x0,'rows':[]};var _0x41d672=db['User'][_0xed73('0x42')];_0x5610d0['model']=_['differenceBy'](_[_0xed73('0x43')](_0x41d672),[_0xed73('0x44'),_0xed73('0x45')]);_0x5610d0['query']=_['keys'](_0x5f18b6['query']);_0x5610d0['filters']=_['intersection'](_0x5610d0[_0xed73('0x46')],_0x5610d0['query']);_0xb3749d[_0xed73('0x47')]=_['intersection'](_0x5610d0[_0xed73('0x46')],qs[_0xed73('0x48')](_0x5f18b6[_0xed73('0x49')][_0xed73('0x48')]));_0xb3749d[_0xed73('0x47')]=_0xb3749d['attributes'][_0xed73('0x4a')]?_0xb3749d[_0xed73('0x47')]:_0x5610d0[_0xed73('0x46')];if(!_0x5f18b6[_0xed73('0x49')][_0xed73('0x4b')](_0xed73('0x4c'))){_0xb3749d['limit']=qs[_0xed73('0x2e')](_0x5f18b6[_0xed73('0x49')]['limit']);_0xb3749d[_0xed73('0x2d')]=qs['offset'](_0x5f18b6[_0xed73('0x49')][_0xed73('0x2d')]);}_0xb3749d[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x5f18b6[_0xed73('0x49')]['sort']);_0xb3749d[_0xed73('0x4f')]=qs['filters'](_['pick'](_0x5f18b6[_0xed73('0x49')],_0x5610d0[_0xed73('0x50')]));if(_0x5f18b6[_0xed73('0x49')][_0xed73('0x38')]){_0xb3749d[_0xed73('0x4f')]=_[_0xed73('0x51')](_0xb3749d[_0xed73('0x4f')],{'$or':_['map'](_0x41d672,function(_0x2b58ce){return db['sequelize']['where'](db[_0xed73('0x52')]['fn']('lower',db[_0xed73('0x52')][_0xed73('0x53')](_0x2b58ce[_0xed73('0x54')])),{'$like':db[_0xed73('0x52')]['fn'](_0xed73('0x55'),'%'+_0x5f18b6['query']['filter']+'%')});})});}_0xb3749d=_[_0xed73('0x51')]({},_0xb3749d,_0x5f18b6['options']);var _0x271694={'where':_0xb3749d['where']};return db[_0xed73('0x56')][_0xed73('0x2c')](_0x271694)['then'](function(_0x44290d){_0x36439f[_0xed73('0x2c')]=_0x44290d;if(_0x5f18b6[_0xed73('0x49')]['includeAll']){_0xb3749d['include']=[{'all':!![]}];}return db['User']['findAll'](_0xb3749d);})['then'](function(_0x560d0a){_0x36439f[_0xed73('0x57')]=_0x560d0a;return _0x36439f;})[_0xed73('0x1f')](respondWithFilteredResult(_0x4ee537,_0xb3749d))[_0xed73('0x27')](handleError(_0x4ee537,null));};exports[_0xed73('0x58')]=function(_0x4a072f,_0x3d63ef){var _0x14099c={'raw':![],'where':{'id':_0x4a072f[_0xed73('0x59')]['id']}},_0x2f4856={};_0x2f4856['model']=_[_0xed73('0x5a')](_['keys'](db[_0xed73('0x56')][_0xed73('0x42')]),[_0xed73('0x44'),_0xed73('0x45')]);_0x2f4856[_0xed73('0x49')]=_[_0xed73('0x43')](_0x4a072f[_0xed73('0x49')]);_0x2f4856[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x2f4856[_0xed73('0x46')],_0x2f4856[_0xed73('0x49')]);_0x14099c['attributes']=_['intersection'](_0x2f4856[_0xed73('0x46')],qs[_0xed73('0x48')](_0x4a072f['query'][_0xed73('0x48')]));_0x14099c[_0xed73('0x47')]=_0x14099c[_0xed73('0x47')][_0xed73('0x4a')]?_0x14099c[_0xed73('0x47')]:_0x2f4856['model'];if(_0x4a072f[_0xed73('0x49')][_0xed73('0x5c')]){_0x14099c[_0xed73('0x5d')]=[{'all':!![]}];}_0x14099c=_[_0xed73('0x51')]({},_0x14099c,_0x4a072f['options']);return db[_0xed73('0x56')]['find'](_0x14099c)[_0xed73('0x1f')](handleEntityNotFound(_0x3d63ef,null))[_0xed73('0x1f')](respondWithResult(_0x3d63ef,null))['catch'](handleError(_0x3d63ef,null));};exports[_0xed73('0x5e')]=function(_0x30a8fe,_0x339e05){return db[_0xed73('0x56')][_0xed73('0x5e')](_0x30a8fe['body'],{'raw':![],'individualHooks':!![]})[_0xed73('0x1f')](respondWithResult(_0x339e05,0xc9))['catch'](handleError(_0x339e05,null));};exports[_0xed73('0x5f')]=function(_0x442364,_0x14f626){if(_0x442364[_0xed73('0x60')]['id']){delete _0x442364['body']['id'];}delete _0x442364['body'][_0xed73('0x3b')];return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x442364[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x14f626,null))[_0xed73('0x1f')](saveUpdates(_0x442364['body'],null))['then'](respondWithResult(_0x14f626,null))[_0xed73('0x27')](handleError(_0x14f626,null));};exports[_0xed73('0x61')]=function(_0x5c2fe8,_0x165649){return db[_0xed73('0x56')][_0xed73('0x61')]()['then'](respondWithResult(_0x165649,null))['catch'](handleError(_0x165649,null));};exports[_0xed73('0x62')]=function(_0x359f38,_0x3b30af,_0x2e1e30){return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x359f38[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x3b30af,null))[_0xed73('0x1f')](function(_0x136d14){if(_0x136d14){return _0x136d14[_0xed73('0x62')](_0x359f38['body']['ids'],_[_0xed73('0x63')](_0x359f38[_0xed73('0x60')],['ids','id'])||{});}})[_0xed73('0x1f')](respondWithResult(_0x3b30af,null))[_0xed73('0x27')](handleError(_0x3b30af,null));};var getLicense=function(_0x376a98){return new BPromise(function(_0x55e68a,_0x494821){var _0x1e0ef5=0x0;_0x376a98[_0xed73('0x60')]['role']===_0xed73('0x36')&&_0x55e68a(_0xed73('0x64'));return db[_0xed73('0x56')][_0xed73('0x2c')]({'where':{'$or':[{'role':_0x376a98[_0xed73('0x60')]['role']==='telephone'?_0xed73('0x65'):[_0xed73('0x66'),_0xed73('0x67')]}]}})[_0xed73('0x1f')](function(_0x2fa4b5){_0x1e0ef5=_0x2fa4b5;return require(_0xed73('0x68'))['getLicense']();})[_0xed73('0x1f')](function(_0x5513a6){var _0xf51195=_0x376a98[_0xed73('0x60')][_0xed73('0x3b')]===_0xed73('0x65')?'telephones':_0xed73('0x69');if(!_[_0xed73('0x6a')](_0x5513a6[_0xf51195])&&_0x1e0ef5>=_0x5513a6[_0xf51195]){return _0x494821({'message':'License\x20limit\x20reached'});}return _0x55e68a(util[_0xed73('0x6b')](_0xed73('0x6c'),_0xf51195,_0x1e0ef5));})[_0xed73('0x27')](function(_0x337ad9){return _0x494821(_0x337ad9);});});};exports['create']=function(_0x1ce2c,_0x26d9bc){return getLicense(_0x1ce2c)[_0xed73('0x1f')](function(_0x10ae6c){if(!_0x1ce2c[_0xed73('0x60')]['internal']){var _0x565477;return db[_0xed73('0x6d')]['findById'](0x1)[_0xed73('0x1f')](function(_0x2dee05){_0x2dee05['securePassword']=!![];return checkPasswordPattern(_0x2dee05,_0x1ce2c[_0xed73('0x60')][_0xed73('0x44')],_0x2dee05[_0xed73('0x6e')]);})[_0xed73('0x1f')](function(_0x2e5e91){_0x565477=_0x2e5e91[_0xed73('0x6f')];return db[_0xed73('0x56')][_0xed73('0x70')](_0xed73('0x71'));})[_0xed73('0x1f')](function(_0x2e335c){if(_[_0xed73('0x6a')](_0x2e335c)){if(_0x565477){_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=_0x565477;}else{_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=0x1;}}else{if(_['isNil'](_0x565477)||_0x565477==_0x2e335c){_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=_0x2e335c+0x1;}else if(_0x565477>_0x2e335c){_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]=_0x565477;}else{return db['sequelize'][_0xed73('0x49')]('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[_0xed73('0x52')][_0xed73('0x72')][_0xed73('0x73')]})[_0xed73('0x1f')](function(_0x253b21){if(_0x253b21&&_0x253b21[_0xed73('0x4a')]){for(var _0xb4df8c=0x0,_0x3114f5=_0x253b21[_0xed73('0x4a')];_0xb4df8c<_0x3114f5&&_[_0xed73('0x6a')](_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')]);_0xb4df8c++){if(_0x565477<=_0x253b21[_0xb4df8c]['from']){_0x1ce2c[_0xed73('0x60')]['internal']=_0x253b21[_0xb4df8c]['from'];}else if(_0x565477>_0x253b21[_0xb4df8c][_0xed73('0x74')]&&_0x565477<=_0x253b21[_0xb4df8c]['to']){_0x1ce2c[_0xed73('0x60')]['internal']=_0x565477;}}}if(_[_0xed73('0x6a')](_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')])){_0x1ce2c[_0xed73('0x60')]['internal']=_0x2e335c+0x1;}});}}});}})[_0xed73('0x1f')](function(){if(_0x1ce2c[_0xed73('0x60')][_0xed73('0x75')]){_0x1ce2c[_0xed73('0x60')][_0xed73('0x76')]=_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')];_0x1ce2c[_0xed73('0x60')][_0xed73('0x77')]={'mailbox':_0x1ce2c[_0xed73('0x60')][_0xed73('0x71')],'password':_0x1ce2c[_0xed73('0x60')][_0xed73('0x44')],'fullname':_0x1ce2c[_0xed73('0x60')]['fullname'],'email':_0x1ce2c[_0xed73('0x60')]['email']};}if(_0x1ce2c[_0xed73('0x60')]&&_0x1ce2c['body'][_0xed73('0x3b')]===_0xed73('0x36')){_0x1ce2c[_0xed73('0x60')][_0xed73('0x78')]=[_0xed73('0x79'),_0xed73('0x7a'),'103',_0xed73('0x7b'),_0xed73('0x7c'),'105',_0xed73('0x7d'),'107','108',_0xed73('0x7e'),_0xed73('0x7f'),'111'];}return db['User'][_0xed73('0x80')](_0x1ce2c[_0xed73('0x60')],{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0xed73('0x1f')](function(_0x10c1bf){if(_0x1ce2c[_0xed73('0x60')]['role']===_0xed73('0x67'))return _0x10c1bf;var _0x5dc721=_0x1ce2c[_0xed73('0x67')]['get']({'plain':!![]});if(!_0x5dc721)throw new Error(_0xed73('0x81'));if(_0x5dc721['role']==='user'){var _0xd0a7ed=_0x10c1bf[_0xed73('0x33')]({'plain':!![]});var _0x15d42e=[{'name':_0xed73('0x35'),'value':'agent'},{'name':'Telephones','value':_0xed73('0x65')}];var _0x1ef12c=_[_0xed73('0x3c')](_0x15d42e,[_0xed73('0x3a'),_0xd0a7ed[_0xed73('0x3b')]])[_0xed73('0x3d')];return db[_0xed73('0x82')][_0xed73('0x3c')]({'where':{'name':_0x1ef12c,'userProfileId':_0x5dc721['userProfileId']},'raw':!![]})['then'](function(_0xa9509a){if(_0xa9509a&&_0xa9509a[_0xed73('0x83')]===0x0){return db['UserProfileResource'][_0xed73('0x80')]({'name':_0xd0a7ed['name'],'resourceId':_0xd0a7ed['id'],'type':_0xa9509a[_0xed73('0x3d')],'sectionId':_0xa9509a['id']},{})[_0xed73('0x1f')](function(){return _0x10c1bf;});}else{return _0x10c1bf;}})[_0xed73('0x27')](function(_0x4e4e18){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e4e18);throw _0x4e4e18;});}return _0x10c1bf;})[_0xed73('0x1f')](respondWithResult(_0x26d9bc,0xc9))['catch'](handleError(_0x26d9bc,null));};exports['changePassword']=function(_0x10d740,_0x2219fd,_0x4d099a){var _0x18f975=![];if(_0x10d740[_0xed73('0x60')]['id']){delete _0x10d740[_0xed73('0x60')]['id'];}if(!_[_0xed73('0x6a')](_0x10d740[_0xed73('0x60')][_0xed73('0x84')])){if(_0x10d740[_0xed73('0x60')][_0xed73('0x84')]===_0x10d740[_0xed73('0x60')][_0xed73('0x85')]){throw new Error('New\x20password\x20must\x20be\x20different\x20from\x20old\x20one');}}return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x10d740['params']['id']}})[_0xed73('0x1f')](function(_0x219805){if(_0x219805){if(_0x219805['id']==_0x10d740['user']['id']){if(!_0x10d740['body']['oldPassword']||!_0x10d740[_0xed73('0x60')]['newPassword']){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x88'));}if(!_0x219805[_0xed73('0x89')](_0x10d740[_0xed73('0x60')][_0xed73('0x84')])){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x8a'));}if(_0x10d740[_0xed73('0x60')]['oldPassword']==_0x10d740[_0xed73('0x60')][_0xed73('0x85')]){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x8b'));}return _0x219805;}else if(_0x10d740['user']['role']==_0xed73('0x66')){if(!_0x10d740[_0xed73('0x60')]['newPassword']){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x219805;}else if(_0x10d740[_0xed73('0x67')][_0xed73('0x3b')]=='user'){if(!_0x10d740[_0xed73('0x60')][_0xed73('0x85')]){throw new db[(_0xed73('0x86'))]['ValidationError'](_0xed73('0x8c'));}if(_0x219805[_0xed73('0x3b')]!=_0xed73('0x36')){throw new db['Sequelize'][(_0xed73('0x87'))](_0xed73('0x8d'));}return _0x219805;}else{throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x8d'));}}return null;})[_0xed73('0x1f')](handleEntityNotFound(_0x2219fd,null))[_0xed73('0x1f')](function(_0x2f554e){return db[_0xed73('0x6d')]['findOne']({'attributes':['id',_0xed73('0x6e')]})[_0xed73('0x1f')](function(_0x563c78){_0x18f975=_0x563c78['securePassword'];return checkPasswordPattern(_0x2f554e,_0x10d740[_0xed73('0x60')]['newPassword'],_0x18f975);});})[_0xed73('0x1f')](saveUpdates({'password':_0x10d740[_0xed73('0x60')][_0xed73('0x85')],'passwordResetAt':_0x10d740[_0xed73('0x67')]['id']==_0x10d740['params']['id']?moment():null},null))['then'](respondWithResult(_0x2219fd,null))[_0xed73('0x27')](handleError(_0x2219fd,null));};exports['addQueues']=function(_0x4d1386,_0x509104,_0x1319f6){var _0x50d7af=_0x4d1386['body']['channel'];return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x4d1386[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0x3d'),_0xed73('0x3b'),_0xed73('0x8e'),'loginInPause',_0xed73('0x8f'),_0xed73('0x90')]})[_0xed73('0x1f')](handleEntityNotFound(_0x509104,null))[_0xed73('0x1f')](function(_0x20b20d){if(_0x20b20d){if(!utils[_0xed73('0x91')](_0x50d7af)){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))]('Unknown\x20channel');}return _0x20b20d[_0xed73('0x92')+_[_0xed73('0x93')](_0x50d7af[_0xed73('0x94')]())+_0xed73('0x95')](_0x4d1386[_0xed73('0x60')][_0xed73('0x96')],{'penalty':_0x4d1386[_0xed73('0x60')][_0xed73('0x97')]||0x0})[_0xed73('0x98')](function(_0x4dac07){for(var _0x4c7492=0x0;_0x4c7492<_0x4d1386[_0xed73('0x60')]['ids'][_0xed73('0x4a')];_0x4c7492+=0x1){var _0x114cd7={'UserId':_0x4d1386[_0xed73('0x59')]['id']};_0x114cd7[_[_0xed73('0x93')](_0x50d7af['toLowerCase']())+'QueueId']=_0x4d1386[_0xed73('0x60')][_0xed73('0x96')][_0x4c7492];socket['emit'](_0xed73('0x67')+_[_0xed73('0x93')](_0x50d7af[_0xed73('0x94')]())+'Queue:save',_0x114cd7);}return _0x4dac07;})['then'](function(){if(_0x50d7af===_0xed73('0x99')){return db[_0xed73('0x9a')][_0xed73('0x9b')]({'where':{'id':_0x4d1386[_0xed73('0x60')][_0xed73('0x96')]||[]},'raw':!![],'attributes':['id',_0xed73('0x3d')]});}})[_0xed73('0x1f')](function(_0x256f1c){var _0x5dc60f=_0x20b20d[_0xed73('0x33')]({'plain':!![]});var _0x5dc87c=[];if(_0x50d7af==='voice'&&_0x5dc60f['role']===_0xed73('0x36')&&_0x5dc60f[_0xed73('0x8e')]){for(var _0x39bcde=0x0;_0x39bcde<_0x256f1c['length'];_0x39bcde+=0x1){_0x5dc87c['push']({'membername':_0x5dc60f[_0xed73('0x3d')],'UserId':_0x5dc60f['id'],'queue_name':_0x256f1c[_0x39bcde][_0xed73('0x3d')],'VoiceQueueId':_0x256f1c[_0x39bcde]['id'],'interface':_[_0xed73('0x6a')](_0x5dc60f[_0xed73('0x90')])?util[_0xed73('0x6b')](_0xed73('0x9c'),_0x5dc60f['name']):_0x5dc60f[_0xed73('0x90')],'paused':_0x5dc60f[_0xed73('0x8f')]||![],'penalty':_0x4d1386[_0xed73('0x60')][_0xed73('0x97')]||0x0});}return BPromise['each'](_0x5dc87c,function(_0x32c4ba){return db['UserVoiceQueueRt']['upsert'](_0x32c4ba);});}return _0x20b20d;});}})[_0xed73('0x1f')](respondWithStatusCode(_0x509104,null))[_0xed73('0x27')](handleError(_0x509104,null));};exports['removeQueues']=function(_0x17a671,_0x58e8cc,_0x1c45a1){var _0x2868d7;return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x17a671[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0x3d'),'role']})[_0xed73('0x1f')](handleEntityNotFound(_0x58e8cc,null))['then'](function(_0x1b1be0){if(_0x1b1be0){_0x2868d7=_0x1b1be0;if(!_0x17a671[_0xed73('0x49')][_0xed73('0x9d')]||!utils['isValidChannel'](_0x17a671[_0xed73('0x49')]['channel'])){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0x9e'));}return _0x1b1be0[_0xed73('0x9f')+_[_0xed73('0x93')](_0x17a671[_0xed73('0x49')][_0xed73('0x9d')][_0xed73('0x94')]())+'Queues'](_0x17a671[_0xed73('0x49')]['ids']);}})['then'](function(_0x1fd107){for(var _0x534ad5=0x0;_0x534ad5<_0x17a671[_0xed73('0x49')]['ids'][_0xed73('0x4a')];_0x534ad5+=0x1){var _0x3b3162={'UserId':_0x17a671[_0xed73('0x59')]['id']};_0x3b3162[_['capitalize'](_0x17a671[_0xed73('0x49')][_0xed73('0x9d')][_0xed73('0x94')]())+'QueueId']=_0x17a671[_0xed73('0x49')][_0xed73('0x96')][_0x534ad5];socket[_0xed73('0xa0')](_0xed73('0x67')+_[_0xed73('0x93')](_0x17a671[_0xed73('0x49')]['channel'][_0xed73('0x94')]())+_0xed73('0xa1'),_0x3b3162);}return _0x1fd107;})[_0xed73('0x1f')](function(){if(_0x17a671[_0xed73('0x49')][_0xed73('0x9d')]===_0xed73('0x99')){return db[_0xed73('0xa2')][_0xed73('0x32')]({'where':{'UserId':_0x17a671[_0xed73('0x59')]['id'],'VoiceQueueId':_0x17a671[_0xed73('0x49')][_0xed73('0x96')]},'individualHooks':!![]})['then'](function(){return _0x2868d7;});}return _0x2868d7;})[_0xed73('0x1f')](respondWithStatusCode(_0x58e8cc,null))[_0xed73('0x27')](handleError(_0x58e8cc,null));};exports[_0xed73('0xa3')]=function(_0x2bc846,_0x21df9d,_0x59dbe6){_0x2bc846['body'][_0xed73('0xa4')]=_0x2bc846[_0xed73('0xa5')][_0xed73('0xa6')];return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x2bc846[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x21df9d,null))[_0xed73('0x1f')](saveUpdates(_0x2bc846[_0xed73('0x60')],null))[_0xed73('0x1f')](respondWithResult(_0x21df9d,null))[_0xed73('0x27')](handleError(_0x21df9d,null));};exports[_0xed73('0xa7')]=function(_0x5a7233,_0x448d40,_0xbdbf4){var _0xd11f2d=path[_0xed73('0xa8')](config[_0xed73('0xa9')],'server/files/images/logos/default_profile.png');return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x5a7233[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0xa4')],'raw':!![]})[_0xed73('0x1f')](handleEntityNotFound(_0x448d40,null))[_0xed73('0x1f')](function(_0x223c11){if(_0x223c11){if(_['isNil'](_0x223c11[_0xed73('0xa4')])){return _0x448d40[_0xed73('0xaa')](_0xd11f2d);}else{if(!fs['existsSync'](path['join'](config[_0xed73('0xa9')],_0xed73('0xab'),_0x223c11[_0xed73('0xa4')]))){return _0x448d40[_0xed73('0xaa')](_0xd11f2d);}return _0x448d40['download'](path[_0xed73('0xa8')](config[_0xed73('0xa9')],_0xed73('0xab'),_0x223c11['userpic']));}}})[_0xed73('0x27')](handleError(_0x448d40,null));};exports['getContacts']=function(_0x552145,_0x15d073,_0x1dfd13){var _0x3bf695={};var _0x25dc4d={};var _0x1e736a;var _0x5c5523;return db['User'][_0xed73('0xac')]({'where':{'id':_0x552145[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x15d073,null))['then'](function(_0xcaec55){if(_0xcaec55){_0x1e736a=_0xcaec55;_0x25dc4d[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xad')][_0xed73('0x42')]);_0x25dc4d['query']=_[_0xed73('0x43')](_0x552145['query']);_0x25dc4d[_0xed73('0x50')]=_['intersection'](_0x25dc4d[_0xed73('0x46')],_0x25dc4d[_0xed73('0x49')]);_0x3bf695[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x25dc4d['model'],qs['fields'](_0x552145[_0xed73('0x49')]['fields']));_0x3bf695[_0xed73('0x47')]=_0x3bf695[_0xed73('0x47')][_0xed73('0x4a')]?_0x3bf695[_0xed73('0x47')]:_0x25dc4d[_0xed73('0x46')];_0x3bf695[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x552145[_0xed73('0x49')]['sort']);_0x3bf695[_0xed73('0x4f')]=qs['filters'](_['pick'](_0x552145[_0xed73('0x49')],_0x25dc4d[_0xed73('0x50')]));if(_0x552145[_0xed73('0x49')]['filter']){_0x3bf695[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x3bf695['where'],{'$or':_[_0xed73('0x39')](_0x3bf695[_0xed73('0x47')],function(_0x52a327){var _0x887269={};_0x887269[_0x52a327]={'$like':'%'+_0x552145[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x887269;})});}_0x3bf695=_[_0xed73('0x51')]({},_0x3bf695,_0x552145[_0xed73('0xae')]);return _0x1e736a[_0xed73('0xaf')](_0x3bf695);}})[_0xed73('0x1f')](function(_0x2afa85){if(_0x2afa85){_0x5c5523=_0x2afa85[_0xed73('0x4a')];if(_0x552145[_0xed73('0x49')][_0xed73('0x4b')]('includeAll')){_0x3bf695[_0xed73('0x5d')]=[{'model':db['CmList'],'as':_0xed73('0xb0'),'required':![]},{'model':db['Tag'],'as':_0xed73('0xb1'),'attributes':['id','name','color'],'where':_0x552145[_0xed73('0x49')]['tag']?{'id':_0x552145[_0xed73('0x49')][_0xed73('0xb2')]}:undefined,'required':_0x552145[_0xed73('0x49')][_0xed73('0xb2')]?!![]:![]}];}if(!_0x552145['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x3bf695[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x552145[_0xed73('0x49')][_0xed73('0x2e')]);_0x3bf695[_0xed73('0x2d')]=qs['offset'](_0x552145['query'][_0xed73('0x2d')]);}return _0x1e736a[_0xed73('0xaf')](_0x3bf695);}})['then'](function(_0x18ef2b){if(_0x18ef2b){return _0x18ef2b?{'count':_0x5c5523,'rows':_0x18ef2b}:null;}})[_0xed73('0x1f')](respondWithResult(_0x15d073,null))[_0xed73('0x27')](handleError(_0x15d073,null));};exports[_0xed73('0xb3')]=function(_0x1baeba,_0x898308,_0x4532ec){var _0x2d500e;var _0xc4a61b;var _0x4d3488={};var _0x2e019c;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x1baeba[_0xed73('0x59')]['id']},'attributes':['id',_0xed73('0x3d'),_0xed73('0x3b')]})[_0xed73('0x1f')](handleEntityNotFound(_0x898308,null))['then'](function(_0x119035){if(!utils[_0xed73('0x91')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])){throw new db[(_0xed73('0x86'))]['ValidationError'](_0xed73('0x9e'));}_0x2d500e=_0x119035;var _0x1cc9a8={};_0x1cc9a8[_0xed73('0x46')]=_[_0xed73('0x43')](db[_[_0xed73('0x93')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+'Queue'][_0xed73('0x42')]);_0x1cc9a8[_0xed73('0x49')]=_['keys'](_0x1baeba[_0xed73('0x49')]);_0x1cc9a8['filters']=_[_0xed73('0x5b')](_0x1cc9a8[_0xed73('0x46')],_0x1cc9a8[_0xed73('0x49')]);_0x4d3488[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x1cc9a8[_0xed73('0x46')],qs['fields'](_0x1baeba[_0xed73('0x49')]['fields']));_0x4d3488['attributes']=_0x4d3488['attributes'][_0xed73('0x4a')]?_0x4d3488[_0xed73('0x47')]:_0x1cc9a8[_0xed73('0x46')];_0x4d3488[_0xed73('0x4d')]=qs['sort'](_0x1baeba['query'][_0xed73('0x4e')]);_0x4d3488[_0xed73('0x4f')]=qs['filters'](_[_0xed73('0xb4')](_0x1baeba[_0xed73('0x49')],_0x1cc9a8['filters']));if(_0x1baeba[_0xed73('0x49')][_0xed73('0x38')]){_0x4d3488['where']=_['merge'](_0x4d3488[_0xed73('0x4f')],{'$or':_['map'](_0x4d3488[_0xed73('0x47')],function(_0x31bc64){var _0x269e61={};_0x269e61[_0x31bc64]={'$like':'%'+_0x1baeba['query']['filter']+'%'};return _0x269e61;})});}_0x4d3488=_[_0xed73('0x51')]({},_0x4d3488,_0x1baeba[_0xed73('0xae')]);switch(_0x2d500e['role']){case'admin':return db[_[_0xed73('0x93')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+_0xed73('0xb5')][_0xed73('0x9b')](_0x4d3488);case _0xed73('0x67'):case _0xed73('0x36'):return _0x2d500e[_0xed73('0x33')+_[_0xed73('0x93')](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+_0xed73('0x95')](_0x4d3488);default:throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))](_0xed73('0xb6'));}})['then'](function(_0x1be691){_0x2e019c=_0x1be691[_0xed73('0x4a')];if(!_0x1baeba['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x4d3488[_0xed73('0x2e')]=qs['limit'](_0x1baeba[_0xed73('0x49')][_0xed73('0x2e')]);_0x4d3488[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x1baeba[_0xed73('0x49')][_0xed73('0x2d')]);}switch(_0x2d500e[_0xed73('0x3b')]){case _0xed73('0x66'):return db[_[_0xed73('0x93')](_0x1baeba['query']['channel'])+_0xed73('0xb5')][_0xed73('0x9b')](_0x4d3488);case _0xed73('0x67'):case _0xed73('0x36'):return _0x2d500e[_0xed73('0x33')+_['capitalize'](_0x1baeba[_0xed73('0x49')][_0xed73('0x9d')])+_0xed73('0x95')](_0x4d3488);}})['then'](function(_0x4d947e){return{'count':_0x2e019c,'rows':_0x4d947e};})[_0xed73('0x1f')](respondWithResult(_0x898308,null))[_0xed73('0x27')](handleError(_0x898308,null));};exports[_0xed73('0xb7')]=function(_0x4fbfe4,_0x548dc7,_0x2248e3){var _0x18b291={};var _0x4464d8={};var _0x554865;var _0x22ca3c;return db['User']['findOne']({'where':{'id':_0x4fbfe4[_0xed73('0x59')]['id']}})['then'](handleEntityNotFound(_0x548dc7,null))[_0xed73('0x1f')](function(_0x50a46a){if(_0x50a46a){_0x554865=_0x50a46a;_0x4464d8[_0xed73('0x46')]=_[_0xed73('0x43')](db['UserVoiceQueueRt'][_0xed73('0x42')]);_0x4464d8[_0xed73('0x49')]=_[_0xed73('0x43')](_0x4fbfe4[_0xed73('0x49')]);_0x4464d8['filters']=_[_0xed73('0x5b')](_0x4464d8[_0xed73('0x46')],_0x4464d8[_0xed73('0x49')]);_0x18b291[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x4464d8['model'],qs['fields'](_0x4fbfe4['query'][_0xed73('0x48')]));_0x18b291['attributes']=_0x18b291[_0xed73('0x47')][_0xed73('0x4a')]?_0x18b291[_0xed73('0x47')]:_0x4464d8['model'];_0x18b291[_0xed73('0x4d')]=qs['sort'](_0x4fbfe4[_0xed73('0x49')][_0xed73('0x4e')]);_0x18b291['where']=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x4fbfe4[_0xed73('0x49')],_0x4464d8['filters']));if(_0x4fbfe4[_0xed73('0x49')][_0xed73('0x38')]){_0x18b291[_0xed73('0x4f')]=_['merge'](_0x18b291[_0xed73('0x4f')],{'$or':_['map'](_0x18b291[_0xed73('0x47')],function(_0x2a2caf){var _0x679991={};_0x679991[_0x2a2caf]={'$like':'%'+_0x4fbfe4[_0xed73('0x49')]['filter']+'%'};return _0x679991;})});}_0x18b291=_['merge']({},_0x18b291,_0x4fbfe4['options']);return _0x554865[_0xed73('0xb7')](_0x18b291);}})[_0xed73('0x1f')](function(_0xac6cc5){if(_0xac6cc5){_0x22ca3c=_0xac6cc5['length'];if(!_0x4fbfe4[_0xed73('0x49')][_0xed73('0x4b')]('nolimit')){_0x18b291[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x4fbfe4['query']['limit']);_0x18b291[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x4fbfe4[_0xed73('0x49')][_0xed73('0x2d')]);}return _0x554865[_0xed73('0xb7')](_0x18b291);}})[_0xed73('0x1f')](function(_0x5740d4){if(_0x5740d4){return _0x5740d4?{'count':_0x22ca3c,'rows':_0x5740d4}:null;}})[_0xed73('0x1f')](respondWithResult(_0x548dc7,null))[_0xed73('0x27')](handleError(_0x548dc7,null));};exports[_0xed73('0xb8')]=function(_0x4f328b,_0x3389ec,_0x33a064){var _0x1114fc={};var _0xc1996f={};var _0x390441;var _0x418e10;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x4f328b[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x3389ec,null))[_0xed73('0x1f')](function(_0x5510f1){if(_0x5510f1){_0x390441=_0x5510f1;_0xc1996f['model']=_[_0xed73('0x43')](db[_0xed73('0xb9')][_0xed73('0x42')]);_0xc1996f[_0xed73('0x49')]=_['keys'](_0x4f328b[_0xed73('0x49')]);_0xc1996f[_0xed73('0x50')]=_[_0xed73('0x5b')](_0xc1996f[_0xed73('0x46')],_0xc1996f[_0xed73('0x49')]);_0x1114fc[_0xed73('0x47')]=_[_0xed73('0x5b')](_0xc1996f[_0xed73('0x46')],qs[_0xed73('0x48')](_0x4f328b[_0xed73('0x49')][_0xed73('0x48')]));_0x1114fc[_0xed73('0x47')]=_0x1114fc[_0xed73('0x47')][_0xed73('0x4a')]?_0x1114fc[_0xed73('0x47')]:_0xc1996f[_0xed73('0x46')];_0x1114fc['order']=qs[_0xed73('0x4e')](_0x4f328b[_0xed73('0x49')][_0xed73('0x4e')]);_0x1114fc['where']=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x4f328b[_0xed73('0x49')],_0xc1996f[_0xed73('0x50')]));if(_0x4f328b[_0xed73('0x49')][_0xed73('0x38')]){_0x1114fc['where']=_[_0xed73('0x51')](_0x1114fc[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x1114fc[_0xed73('0x47')],function(_0x3fd3ed){var _0x2b9e86={};_0x2b9e86[_0x3fd3ed]={'$like':'%'+_0x4f328b['query'][_0xed73('0x38')]+'%'};return _0x2b9e86;})});}_0x1114fc=_[_0xed73('0x51')]({},_0x1114fc,_0x4f328b[_0xed73('0xae')]);return _0x390441['getGroups'](_0x1114fc);}})['then'](function(_0x3f2535){if(_0x3f2535){_0x418e10=_0x3f2535[_0xed73('0x4a')];if(!_0x4f328b['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x1114fc[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x4f328b[_0xed73('0x49')][_0xed73('0x2e')]);_0x1114fc['offset']=qs['offset'](_0x4f328b['query']['offset']);}return _0x390441[_0xed73('0xb8')](_0x1114fc);}})[_0xed73('0x1f')](function(_0x115bde){if(_0x115bde){return _0x115bde?{'count':_0x418e10,'rows':_0x115bde}:null;}})['then'](respondWithResult(_0x3389ec,null))['catch'](handleError(_0x3389ec,null));};exports[_0xed73('0xba')]=function(_0x26e6ae,_0x490432,_0x257f2e){var _0x117776={'raw':!![],'where':{}};var _0x531f3c={};var _0x262d94={'count':0x0,'rows':[]};return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x26e6ae[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x490432,null))[_0xed73('0x1f')](function(_0x4e33d7){if(_0x4e33d7){_0x531f3c[_0xed73('0x46')]=_[_0xed73('0x43')](db['VoiceRecording'][_0xed73('0x42')]);_0x531f3c[_0xed73('0x49')]=_[_0xed73('0x43')](_0x26e6ae[_0xed73('0x49')]);_0x531f3c[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x531f3c[_0xed73('0x46')],_0x531f3c[_0xed73('0x49')]);_0x117776[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x531f3c[_0xed73('0x46')],qs[_0xed73('0x48')](_0x26e6ae[_0xed73('0x49')]['fields']));_0x117776[_0xed73('0x47')]=_0x117776['attributes'][_0xed73('0x4a')]?_0x117776[_0xed73('0x47')]:_0x531f3c['model'];if(!_0x26e6ae[_0xed73('0x49')][_0xed73('0x4b')](_0xed73('0x4c'))){_0x117776['limit']=qs['limit'](_0x26e6ae['query']['limit']);_0x117776[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x26e6ae[_0xed73('0x49')][_0xed73('0x2d')]);}_0x117776[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x26e6ae['query'][_0xed73('0x4e')]);_0x117776[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x26e6ae[_0xed73('0x49')],_0x531f3c[_0xed73('0x50')]));_0x117776[_0xed73('0x4f')][_0xed73('0xbb')]=_0x4e33d7['id'];if(_0x26e6ae[_0xed73('0x49')][_0xed73('0x38')]){_0x117776[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x117776['where'],{'$or':_[_0xed73('0x39')](_0x117776[_0xed73('0x47')],function(_0x5b0401){var _0x3c94c4={};_0x3c94c4[_0x5b0401]={'$like':'%'+_0x26e6ae[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x3c94c4;})});}_0x117776=_[_0xed73('0x51')]({},_0x117776,_0x26e6ae[_0xed73('0xae')]);return db[_0xed73('0xbc')][_0xed73('0x2c')]({'where':_0x117776['where']})[_0xed73('0x1f')](function(_0x2b2429){_0x262d94[_0xed73('0x2c')]=_0x2b2429;if(_0x26e6ae[_0xed73('0x49')][_0xed73('0x5c')]){_0x117776[_0xed73('0x5d')]=[{'all':!![]}];}return db[_0xed73('0xbc')][_0xed73('0x9b')](_0x117776);})['then'](function(_0x299cb2){_0x262d94[_0xed73('0x57')]=_0x299cb2;return _0x262d94;});}})[_0xed73('0x1f')](respondWithFilteredResult(_0x490432,_0x117776))[_0xed73('0x27')](handleError(_0x490432,null));};exports[_0xed73('0xbd')]=function(_0x564f59,_0x26907b,_0x35bda2){var _0x2ef911={'raw':!![],'where':{}};var _0x53dabc={};var _0x555d44={'count':0x0,'rows':[]};return db[_0xed73('0x56')]['findOne']({'where':{'id':_0x564f59[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x26907b,null))['then'](function(_0x5498bd){if(_0x5498bd){_0x53dabc['model']=_[_0xed73('0x43')](db[_0xed73('0xbe')][_0xed73('0x42')]);_0x53dabc[_0xed73('0x49')]=_['keys'](_0x564f59['query']);_0x53dabc[_0xed73('0x50')]=_['intersection'](_0x53dabc['model'],_0x53dabc[_0xed73('0x49')]);_0x2ef911['attributes']=_[_0xed73('0x5b')](_0x53dabc[_0xed73('0x46')],qs[_0xed73('0x48')](_0x564f59[_0xed73('0x49')][_0xed73('0x48')]));_0x2ef911['attributes']=_0x2ef911[_0xed73('0x47')][_0xed73('0x4a')]?_0x2ef911[_0xed73('0x47')]:_0x53dabc[_0xed73('0x46')];if(!_0x564f59['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x2ef911['limit']=qs[_0xed73('0x2e')](_0x564f59[_0xed73('0x49')][_0xed73('0x2e')]);_0x2ef911[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x564f59[_0xed73('0x49')][_0xed73('0x2d')]);}_0x2ef911[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x564f59[_0xed73('0x49')][_0xed73('0x4e')]);_0x2ef911['where']=qs['filters'](_['pick'](_0x564f59[_0xed73('0x49')],_0x53dabc['filters']));_0x2ef911[_0xed73('0x4f')][_0xed73('0xbb')]=_0x5498bd['id'];if(_0x564f59[_0xed73('0x49')][_0xed73('0x38')]){_0x2ef911['where']=_[_0xed73('0x51')](_0x2ef911[_0xed73('0x4f')],{'$or':_['map'](_0x2ef911[_0xed73('0x47')],function(_0x2912aa){var _0x33f63e={};_0x33f63e[_0x2912aa]={'$like':'%'+_0x564f59[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x33f63e;})});}_0x2ef911=_['merge']({},_0x2ef911,_0x564f59['options']);return db[_0xed73('0xbe')][_0xed73('0x2c')]({'where':_0x2ef911['where']})[_0xed73('0x1f')](function(_0x3ea2b9){_0x555d44[_0xed73('0x2c')]=_0x3ea2b9;if(_0x564f59[_0xed73('0x49')][_0xed73('0x5c')]){_0x2ef911[_0xed73('0x5d')]=[{'all':!![]}];}return db[_0xed73('0xbe')]['findAll'](_0x2ef911);})[_0xed73('0x1f')](function(_0x1173cb){_0x555d44[_0xed73('0x57')]=_0x1173cb;return _0x555d44;});}})[_0xed73('0x1f')](respondWithFilteredResult(_0x26907b,_0x2ef911))[_0xed73('0x27')](handleError(_0x26907b,null));};exports[_0xed73('0xbf')]=function(_0x2cd7ea,_0x2927a5,_0x162aba){var _0x413471={};var _0x42ae8b={};var _0xfcbad4;var _0x2fce3e;return db[_0xed73('0x56')]['findOne']({'where':{'id':_0x2cd7ea['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x2927a5,null))[_0xed73('0x1f')](function(_0x67b6bb){if(_0x67b6bb){_0xfcbad4=_0x67b6bb;_0x42ae8b['model']=_[_0xed73('0x43')](db['ChatInteraction'][_0xed73('0x42')]);_0x42ae8b['query']=_[_0xed73('0x43')](_0x2cd7ea['query']);_0x42ae8b[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x42ae8b['model'],_0x42ae8b[_0xed73('0x49')]);_0x413471['attributes']=_[_0xed73('0x5b')](_0x42ae8b[_0xed73('0x46')],qs[_0xed73('0x48')](_0x2cd7ea[_0xed73('0x49')]['fields']));_0x413471[_0xed73('0x47')]=_0x413471[_0xed73('0x47')][_0xed73('0x4a')]?_0x413471[_0xed73('0x47')]:_0x42ae8b[_0xed73('0x46')];_0x413471['order']=qs[_0xed73('0x4e')](_0x2cd7ea[_0xed73('0x49')][_0xed73('0x4e')]);_0x413471['where']=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x2cd7ea[_0xed73('0x49')],_0x42ae8b[_0xed73('0x50')]));if(_0x2cd7ea[_0xed73('0x49')][_0xed73('0x38')]){_0x413471[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x413471['where'],{'$or':_[_0xed73('0x39')](_0x413471[_0xed73('0x47')],function(_0x138f99){var _0x3d699b={};_0x3d699b[_0x138f99]={'$like':'%'+_0x2cd7ea[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x3d699b;})});}_0x413471=_[_0xed73('0x51')]({},_0x413471,_0x2cd7ea['options']);return _0xfcbad4['getChatInteractions'](_0x413471);}})[_0xed73('0x1f')](function(_0x16e734){if(_0x16e734){_0x2fce3e=_0x16e734['length'];if(!_0x2cd7ea['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x413471['limit']=qs['limit'](_0x2cd7ea[_0xed73('0x49')][_0xed73('0x2e')]);_0x413471['offset']=qs[_0xed73('0x2d')](_0x2cd7ea[_0xed73('0x49')]['offset']);}return _0xfcbad4['getChatInteractions'](_0x413471);}})[_0xed73('0x1f')](function(_0xde401){if(_0xde401){return _0xde401?{'count':_0x2fce3e,'rows':_0xde401}:null;}})[_0xed73('0x1f')](respondWithResult(_0x2927a5,null))[_0xed73('0x27')](handleError(_0x2927a5,null));};exports[_0xed73('0xc0')]=function(_0x2f97f4,_0x21cd8a,_0x2d7be7){var _0x26c473={};var _0x293d0e={};var _0x48735b;var _0xd0f2e8;return db['User'][_0xed73('0xac')]({'where':{'id':_0x2f97f4[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x21cd8a,null))['then'](function(_0x45d9db){if(_0x45d9db){_0x48735b=_0x45d9db;_0x293d0e[_0xed73('0x46')]=_[_0xed73('0x43')](db['OpenchannelInteraction'][_0xed73('0x42')]);_0x293d0e[_0xed73('0x49')]=_[_0xed73('0x43')](_0x2f97f4[_0xed73('0x49')]);_0x293d0e[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x293d0e[_0xed73('0x46')],_0x293d0e[_0xed73('0x49')]);_0x26c473[_0xed73('0x47')]=_['intersection'](_0x293d0e[_0xed73('0x46')],qs[_0xed73('0x48')](_0x2f97f4['query'][_0xed73('0x48')]));_0x26c473[_0xed73('0x47')]=_0x26c473[_0xed73('0x47')][_0xed73('0x4a')]?_0x26c473['attributes']:_0x293d0e[_0xed73('0x46')];_0x26c473[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x2f97f4['query'][_0xed73('0x4e')]);_0x26c473[_0xed73('0x4f')]=qs['filters'](_[_0xed73('0xb4')](_0x2f97f4['query'],_0x293d0e[_0xed73('0x50')]));if(_0x2f97f4[_0xed73('0x49')][_0xed73('0x38')]){_0x26c473[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x26c473[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x26c473['attributes'],function(_0x4c51d8){var _0x19a672={};_0x19a672[_0x4c51d8]={'$like':'%'+_0x2f97f4[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x19a672;})});}_0x26c473=_[_0xed73('0x51')]({},_0x26c473,_0x2f97f4[_0xed73('0xae')]);return _0x48735b[_0xed73('0xc0')](_0x26c473);}})['then'](function(_0x3b6db6){if(_0x3b6db6){_0xd0f2e8=_0x3b6db6[_0xed73('0x4a')];if(!_0x2f97f4['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x26c473[_0xed73('0x2e')]=qs['limit'](_0x2f97f4[_0xed73('0x49')][_0xed73('0x2e')]);_0x26c473[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x2f97f4[_0xed73('0x49')][_0xed73('0x2d')]);}return _0x48735b[_0xed73('0xc0')](_0x26c473);}})[_0xed73('0x1f')](function(_0x3d3b35){if(_0x3d3b35){return _0x3d3b35?{'count':_0xd0f2e8,'rows':_0x3d3b35}:null;}})['then'](respondWithResult(_0x21cd8a,null))[_0xed73('0x27')](handleError(_0x21cd8a,null));};exports[_0xed73('0xc1')]=function(_0x5dc2c8,_0x26e44a,_0x386a7b){var _0x1f6fcd={'raw':!![],'where':{}};var _0x179a47={};var _0x34d0e5={'count':0x0,'rows':[]};return db['User'][_0xed73('0xac')]({'where':{'id':_0x5dc2c8['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x26e44a,null))[_0xed73('0x1f')](function(_0x1ec1ce){if(_0x1ec1ce){_0x179a47[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xc2')][_0xed73('0x42')]);_0x179a47['query']=_[_0xed73('0x43')](_0x5dc2c8[_0xed73('0x49')]);_0x179a47[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x179a47[_0xed73('0x46')],_0x179a47[_0xed73('0x49')]);_0x1f6fcd[_0xed73('0x47')]=_['intersection'](_0x179a47[_0xed73('0x46')],qs[_0xed73('0x48')](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x48')]));_0x1f6fcd[_0xed73('0x47')]=_0x1f6fcd['attributes']['length']?_0x1f6fcd[_0xed73('0x47')]:_0x179a47[_0xed73('0x46')];if(!_0x5dc2c8['query'][_0xed73('0x4b')](_0xed73('0x4c'))){_0x1f6fcd[_0xed73('0x2e')]=qs['limit'](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x2e')]);_0x1f6fcd[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x2d')]);}_0x1f6fcd[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x5dc2c8[_0xed73('0x49')][_0xed73('0x4e')]);_0x1f6fcd[_0xed73('0x4f')]=qs['filters'](_[_0xed73('0xb4')](_0x5dc2c8['query'],_0x179a47[_0xed73('0x50')]));_0x1f6fcd[_0xed73('0x4f')][_0xed73('0xbb')]=_0x1ec1ce['id'];if(_0x5dc2c8[_0xed73('0x49')][_0xed73('0x38')]){_0x1f6fcd[_0xed73('0x4f')]=_['merge'](_0x1f6fcd[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x1f6fcd[_0xed73('0x47')],function(_0x2b9ac6){var _0x281858={};_0x281858[_0x2b9ac6]={'$like':'%'+_0x5dc2c8[_0xed73('0x49')]['filter']+'%'};return _0x281858;})});}_0x1f6fcd=_[_0xed73('0x51')]({},_0x1f6fcd,_0x5dc2c8[_0xed73('0xae')]);return db[_0xed73('0xc2')][_0xed73('0x2c')]({'where':_0x1f6fcd['where']})[_0xed73('0x1f')](function(_0x5a5f47){_0x34d0e5[_0xed73('0x2c')]=_0x5a5f47;if(_0x5dc2c8[_0xed73('0x49')]['includeAll']){_0x1f6fcd[_0xed73('0x5d')]=[{'all':!![]}];}return db[_0xed73('0xc2')][_0xed73('0x9b')](_0x1f6fcd);})[_0xed73('0x1f')](function(_0x2a48f4){_0x34d0e5[_0xed73('0x57')]=_0x2a48f4;return _0x34d0e5;});}})[_0xed73('0x1f')](respondWithFilteredResult(_0x26e44a,_0x1f6fcd))[_0xed73('0x27')](handleError(_0x26e44a,null));};exports[_0xed73('0xc3')]=function(_0x269ef5,_0x361e98,_0x4037bc){var _0x37cb67={};var _0x13e2f9={};var _0x131f11;var _0x2158fc;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x269ef5[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x361e98,null))['then'](function(_0xc29326){if(_0xc29326){_0x131f11=_0xc29326;_0x13e2f9[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xc4')][_0xed73('0x42')]);_0x13e2f9[_0xed73('0x49')]=_[_0xed73('0x43')](_0x269ef5[_0xed73('0x49')]);_0x13e2f9[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x13e2f9[_0xed73('0x46')],_0x13e2f9['query']);_0x37cb67[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x13e2f9[_0xed73('0x46')],qs[_0xed73('0x48')](_0x269ef5[_0xed73('0x49')][_0xed73('0x48')]));_0x37cb67[_0xed73('0x47')]=_0x37cb67[_0xed73('0x47')]['length']?_0x37cb67[_0xed73('0x47')]:_0x13e2f9[_0xed73('0x46')];_0x37cb67[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x269ef5[_0xed73('0x49')][_0xed73('0x4e')]);_0x37cb67[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x269ef5[_0xed73('0x49')],_0x13e2f9[_0xed73('0x50')]));if(_0x269ef5[_0xed73('0x49')][_0xed73('0x38')]){_0x37cb67[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x37cb67[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x37cb67[_0xed73('0x47')],function(_0x568556){var _0x291004={};_0x291004[_0x568556]={'$like':'%'+_0x269ef5[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x291004;})});}_0x37cb67=_[_0xed73('0x51')]({},_0x37cb67,_0x269ef5[_0xed73('0xae')]);return _0x131f11[_0xed73('0xc3')](_0x37cb67);}})[_0xed73('0x1f')](function(_0x4541b8){if(_0x4541b8){_0x2158fc=_0x4541b8[_0xed73('0x4a')];if(!_0x269ef5[_0xed73('0x49')][_0xed73('0x4b')]('nolimit')){_0x37cb67[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x269ef5[_0xed73('0x49')][_0xed73('0x2e')]);_0x37cb67['offset']=qs[_0xed73('0x2d')](_0x269ef5['query'][_0xed73('0x2d')]);}return _0x131f11[_0xed73('0xc3')](_0x37cb67);}})[_0xed73('0x1f')](function(_0x2b0d0c){if(_0x2b0d0c){return _0x2b0d0c?{'count':_0x2158fc,'rows':_0x2b0d0c}:null;}})[_0xed73('0x1f')](respondWithResult(_0x361e98,null))[_0xed73('0x27')](handleError(_0x361e98,null));};exports[_0xed73('0xc5')]=function(_0x1f275f,_0x99f59f,_0x465356){var _0x43bd23={};var _0xd6d0df={};var _0x5efef8;var _0x2e774b;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x1f275f[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x99f59f,null))[_0xed73('0x1f')](function(_0x41e054){if(_0x41e054){_0x5efef8=_0x41e054;_0xd6d0df[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xc6')][_0xed73('0x42')]);_0xd6d0df['query']=_[_0xed73('0x43')](_0x1f275f[_0xed73('0x49')]);_0xd6d0df[_0xed73('0x50')]=_[_0xed73('0x5b')](_0xd6d0df[_0xed73('0x46')],_0xd6d0df[_0xed73('0x49')]);_0x43bd23[_0xed73('0x47')]=_[_0xed73('0x5b')](_0xd6d0df[_0xed73('0x46')],qs['fields'](_0x1f275f[_0xed73('0x49')][_0xed73('0x48')]));_0x43bd23[_0xed73('0x47')]=_0x43bd23[_0xed73('0x47')][_0xed73('0x4a')]?_0x43bd23[_0xed73('0x47')]:_0xd6d0df['model'];_0x43bd23[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x1f275f[_0xed73('0x49')][_0xed73('0x4e')]);_0x43bd23[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x1f275f[_0xed73('0x49')],_0xd6d0df[_0xed73('0x50')]));if(_0x1f275f[_0xed73('0x49')][_0xed73('0x38')]){_0x43bd23[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x43bd23[_0xed73('0x4f')],{'$or':_['map'](_0x43bd23[_0xed73('0x47')],function(_0x308204){var _0x4055d9={};_0x4055d9[_0x308204]={'$like':'%'+_0x1f275f[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x4055d9;})});}_0x43bd23=_[_0xed73('0x51')]({},_0x43bd23,_0x1f275f['options']);return _0x5efef8['getFaxInteractions'](_0x43bd23);}})['then'](function(_0x2bc6e4){if(_0x2bc6e4){_0x2e774b=_0x2bc6e4[_0xed73('0x4a')];if(!_0x1f275f[_0xed73('0x49')][_0xed73('0x4b')](_0xed73('0x4c'))){_0x43bd23[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x1f275f[_0xed73('0x49')][_0xed73('0x2e')]);_0x43bd23['offset']=qs[_0xed73('0x2d')](_0x1f275f['query'][_0xed73('0x2d')]);}return _0x5efef8[_0xed73('0xc5')](_0x43bd23);}})[_0xed73('0x1f')](function(_0x59e22e){if(_0x59e22e){return _0x59e22e?{'count':_0x2e774b,'rows':_0x59e22e}:null;}})[_0xed73('0x1f')](respondWithResult(_0x99f59f,null))['catch'](handleError(_0x99f59f,null));};exports[_0xed73('0xc7')]=function(_0x19fb26,_0x38e807,_0x8c0b46){var _0x125b60;var _0x1e8736;var _0x417c25;return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x19fb26[_0xed73('0x59')]['id'],'role':'agent'},'attributes':['id',_0xed73('0x3d'),_0xed73('0xc8'),'mobile',_0xed73('0x3b'),_0xed73('0x71'),'loginInPause']})['then'](handleEntityNotFound(_0x38e807,null))[_0xed73('0x1f')](function(_0x482a9c){if(_0x482a9c){_0x125b60=_0x482a9c;if(_0x19fb26['body'][_0xed73('0x90')]){_0x417c25=util['format']('LOCAL/%s@from-sip/n',_0x125b60[_0x19fb26[_0xed73('0x60')][_0xed73('0x90')]]);}else if(_0x19fb26[_0xed73('0x60')]['intrf']){_0x417c25=util[_0xed73('0x6b')](_0xed73('0x9c'),_0x19fb26[_0xed73('0x60')][_0xed73('0xc9')]);}else{_0x417c25=util['format'](_0xed73('0x9c'),_0x125b60[_0xed73('0x3d')]);}socket['to'](util['format'](_0xed73('0xca'),_0x125b60['name']))['emit']('user:forcelogout',{'ip':_0x19fb26['headers'][_0xed73('0xcb')]||_0x19fb26[_0xed73('0xcc')][_0xed73('0xcd')]||_0x19fb26[_0xed73('0xce')][_0xed73('0xcd')]||_0x19fb26['connection']['socket']['remoteAddress']});return db[_0xed73('0xa2')]['destroy']({'where':{'membername':_0x125b60[_0xed73('0x3d')]},'individualHooks':!![]});}})[_0xed73('0x1f')](function(_0x4c44ef){if(_0x125b60){return _0x125b60[_0xed73('0xcf')]({'raw':!![]});}})[_0xed73('0x1f')](function(_0x1862ed){var _0x203980=[];if(_0x1862ed){_0x1e8736=_0x1862ed;if(_0x1e8736['length']){for(var _0x3a4aa5=0x0;_0x3a4aa5<_0x1e8736[_0xed73('0x4a')];_0x3a4aa5++){_0x203980[_0xed73('0xd0')]({'membername':_0x125b60['name'],'UserId':_0x125b60['id'],'queue_name':_0x1e8736[_0x3a4aa5][_0xed73('0x3d')],'VoiceQueueId':_0x1e8736[_0x3a4aa5]['id'],'interface':_0x417c25,'paused':_0x125b60['loginInPause']||![],'penalty':_0x1e8736[_0x3a4aa5][_0xed73('0xd1')]||0x0});}return BPromise[_0xed73('0xd2')](_0x203980,function(_0x8287c7){return db[_0xed73('0xa2')][_0xed73('0xd3')](_0x8287c7);});}}})['then'](function(){return db[_0xed73('0xd4')]['findAll']({'where':{'membername':_0x125b60[_0xed73('0x3d')],'exitAt':null}});})[_0xed73('0x1f')](function(_0x1f56c3){var _0x4d3940=[];_0x1f56c3['forEach'](function(_0x1c9d2a){_0x4d3940[_0xed73('0xd0')](_0x1c9d2a[_0xed73('0x5f')]({'exitAt':moment()[_0xed73('0x6b')](_0xed73('0xd5'))}));});return BPromise['all'](_0x4d3940);})[_0xed73('0x1f')](function(){var _0x2b1b19=[];var _0x49e8c4=[];var _0x498cfe=utils[_0xed73('0xd6')]();var _0x4f7a1d={'membername':_0x125b60[_0xed73('0x3d')],'interface':_0x417c25,'enterAt':moment()[_0xed73('0x6b')](_0xed73('0xd5')),'role':_0x125b60[_0xed73('0x3b')],'internal':_0x125b60[_0xed73('0x71')]};_0x498cfe['forEach'](function(_0x140f11){_0x2b1b19[_0xed73('0xd0')](_['merge']({'channel':_0x140f11,'type':_0xed73('0xd7'),'data1':_0x19fb26[_0xed73('0x60')][_0xed73('0xd8')],'data2':_0x417c25},_0x4f7a1d));if(_0x125b60[_0xed73('0xd9')]){_0x49e8c4['push'](_[_0xed73('0x51')]({'channel':_0x140f11,'type':_0xed73('0xda'),'data1':_0xed73('0xdb')},_0x4f7a1d));}});return db[_0xed73('0xd4')][_0xed73('0x5e')](_0x2b1b19[_0xed73('0xdc')](_0x49e8c4),{'individualHooks':!![]});})['then'](function(){return _0x125b60[_0xed73('0x5f')]({'online':!![],'lastLoginAt':moment()['format'](_0xed73('0xd5')),'voicePause':_0x125b60[_0xed73('0xd9')]||![],'mailPause':_0x125b60['loginInPause']||![],'chatPause':_0x125b60[_0xed73('0xd9')]||![],'faxPause':_0x125b60[_0xed73('0xd9')]||![],'smsPause':_0x125b60[_0xed73('0xd9')]||![],'openchannelPause':_0x125b60[_0xed73('0xd9')]||![],'pauseType':_0x125b60[_0xed73('0xd9')]?_0xed73('0xdb'):null,'interface':_0x417c25,'lastPauseAt':moment()['format'](_0xed73('0xd5'))});})['then'](respondWithResult(_0x38e807,null))[_0xed73('0x27')](handleError(_0x38e807,null));};exports[_0xed73('0xdd')]=function(_0x4ba230,_0x369de6,_0x4306c7){var _0x2a6c39;return db[_0xed73('0x56')]['find']({'where':{'id':_0x4ba230['params']['id'],'role':'agent'},'attributes':['id',_0xed73('0x3d'),'role']})['then'](handleEntityNotFound(_0x369de6,null))['then'](function(_0x1457eb){if(_0x1457eb){_0x2a6c39=_0x1457eb;return db[_0xed73('0xa2')][_0xed73('0x32')]({'where':{'membername':_0x2a6c39['name']},'individualHooks':!![]});}})[_0xed73('0x1f')](function(){return db['MemberReport'][_0xed73('0x9b')]({'where':{'membername':_0x2a6c39['name'],'exitAt':null}});})[_0xed73('0x1f')](function(_0x5622f0){var _0x9cc3f6=[];_0x5622f0[_0xed73('0xde')](function(_0x2a81fc){_0x9cc3f6[_0xed73('0xd0')](_0x2a81fc[_0xed73('0x5f')]({'exitAt':moment()[_0xed73('0x6b')](_0xed73('0xd5'))}));});return BPromise[_0xed73('0xdf')](_0x9cc3f6);})[_0xed73('0x1f')](function(){return _0x2a6c39[_0xed73('0x5f')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xed73('0x1f')](respondWithResult(_0x369de6,null))[_0xed73('0x27')](handleError(_0x369de6,null));};exports[_0xed73('0xe0')]=function(_0xec8731,_0x8da06c,_0x2aed27){var _0x46e910;return db[_0xed73('0xa2')][_0xed73('0x5f')]({'paused':0x1},{'where':{'UserId':_0xec8731[_0xed73('0x59')]['id']},'individualHooks':!![]})[_0xed73('0x1f')](function(){return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0xec8731[_0xed73('0x59')]['id'],'role':_0xed73('0x36')},'attributes':['id','name',_0xed73('0x3b'),'internal',_0xed73('0x90')]});})['then'](handleEntityNotFound(_0x8da06c,null))[_0xed73('0x1f')](function(_0x62f4a2){if(_0x62f4a2){_0x46e910=_0x62f4a2;return respondWithRpcPromise(_0xed73('0xe1'),_0xed73('0xe0'),{'id':_0x46e910['id'],'name':_0x46e910[_0xed73('0x3d')],'pause':!![]});}})[_0xed73('0x1f')](function(){if(_0x46e910){return db['MemberReport'][_0xed73('0x9b')]({'where':{'membername':_0x46e910[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}});}})[_0xed73('0x1f')](function(_0x2a1cc8){if(_0x2a1cc8[_0xed73('0x4a')]){var _0x368619=moment()['format'](_0xed73('0xd5'));for(var _0x271648=0x0,_0x40e62c=_0x2a1cc8['length'];_0x271648<_0x40e62c;_0x271648++){_0x2a1cc8[_0x271648][_0xed73('0xe2')]({'exitAt':_0x368619});}}})[_0xed73('0x1f')](function(){var _0x19f85c=[];var _0x1be889=utils[_0xed73('0xd6')]();_0x1be889[_0xed73('0xde')](function(_0x3dd287){_0x19f85c[_0xed73('0xd0')]({'channel':_0x3dd287,'membername':_0x46e910[_0xed73('0x3d')],'interface':_[_0xed73('0x6a')](_0x46e910['interface'])?util[_0xed73('0x6b')]('SIP/%s',_0x46e910[_0xed73('0x3d')]):_0x46e910[_0xed73('0x90')],'type':_0xed73('0xda'),'enterAt':moment()[_0xed73('0x6b')](_0xed73('0xd5')),'data1':_0xec8731[_0xed73('0x60')]['type']||_0xed73('0xe3'),'role':_0x46e910[_0xed73('0x3b')],'internal':_0x46e910[_0xed73('0x71')]});});return db[_0xed73('0xd4')][_0xed73('0x5e')](_0x19f85c,{'individualHooks':!![]});})[_0xed73('0x1f')](function(){return _0x46e910['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xec8731['body'][_0xed73('0xe4')]||_0xed73('0xe3'),'lastPauseAt':moment()[_0xed73('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x8da06c,null))[_0xed73('0x27')](handleError(_0x8da06c,null));};exports[_0xed73('0xe5')]=function(_0x593172,_0xda8253,_0x340f15){var _0x4e75fc;return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x593172['params']['id']},'attributes':['id','name',_0xed73('0x3b'),_0xed73('0x8f'),'mailPause',_0xed73('0xe6'),_0xed73('0xe7'),'openchannelPause',_0xed73('0xe8'),_0xed73('0xe9'),_0xed73('0xea')]})[_0xed73('0x1f')](handleEntityNotFound(_0xda8253,null))[_0xed73('0x1f')](function(_0x5d618f){if(_0x5d618f){_0x4e75fc=_0x5d618f;if(_0x593172[_0xed73('0x60')][_0xed73('0x9d')]&&!utils[_0xed73('0x91')](_0x593172[_0xed73('0x60')][_0xed73('0x9d')])){throw new db[(_0xed73('0x86'))][(_0xed73('0x87'))]('Unknown\x20channel');}switch(_0x593172[_0xed73('0x60')][_0xed73('0x9d')]){case _0xed73('0x99'):return respondWithRpcPromise(_0xed73('0xe1'),_0xed73('0xe5'),{'id':_0x4e75fc['id'],'name':_0x4e75fc[_0xed73('0x3d')],'pause':![]})[_0xed73('0x1f')](function(){return db[_0xed73('0xa2')][_0xed73('0x5f')]({'paused':0x0},{'where':{'UserId':_0x4e75fc['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0xed73('0x3c')]({'where':{'channel':_0x593172['body'][_0xed73('0x9d')],'membername':_0x4e75fc[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}});})[_0xed73('0x1f')](function(_0x27335e){if(_0x27335e){return _0x27335e[_0xed73('0x5f')]({'exitAt':moment()['format'](_0xed73('0xd5')),'data2':_0xed73('0xeb')},{'individualHooks':!![]});}return null;})[_0xed73('0x1f')](function(){return _0x4e75fc[_0xed73('0x5f')]({'voicePause':![]});});case'mail':case _0xed73('0xec'):case'fax':case _0xed73('0xed'):case _0xed73('0xee'):return db['MemberReport'][_0xed73('0x3c')]({'where':{'channel':_0x593172[_0xed73('0x60')][_0xed73('0x9d')],'membername':_0x4e75fc[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}})[_0xed73('0x1f')](function(_0x4046f4){if(_0x4046f4){return _0x4046f4['update']({'exitAt':moment()[_0xed73('0x6b')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xed73('0xeb')},{'individualHooks':!![]});}return null;})[_0xed73('0x1f')](function(){var _0x2b2dbe={};_[_0xed73('0x2f')](_0x2b2dbe,util[_0xed73('0x6b')]('%s%s',_0x593172[_0xed73('0x60')][_0xed73('0x9d')],'Pause'),![]);return _0x4e75fc[_0xed73('0x5f')](_0x2b2dbe);});default:return respondWithRpcPromise('QueuePause',_0xed73('0xe5'),{'id':_0x4e75fc['id'],'name':_0x4e75fc[_0xed73('0x3d')],'pause':![]})[_0xed73('0x1f')](function(){return db[_0xed73('0xa2')][_0xed73('0x5f')]({'paused':0x0},{'where':{'UserId':_0x4e75fc['id']}});})[_0xed73('0x1f')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x4e75fc[_0xed73('0x3d')],'type':_0xed73('0xda'),'exitAt':null}});})[_0xed73('0x1f')](function(_0x51544a){var _0xf0d577=[];_0x51544a[_0xed73('0xde')](function(_0x1b695f){_0xf0d577[_0xed73('0xd0')](_0x1b695f[_0xed73('0x5f')]({'exitAt':moment()[_0xed73('0x6b')](_0xed73('0xd5')),'data2':_0xed73('0xeb')}));});return BPromise[_0xed73('0xdf')](_0xf0d577);})[_0xed73('0x1f')](function(){return _0x4e75fc['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xed73('0x1f')](respondWithResult(_0xda8253,null))[_0xed73('0x27')](handleError(_0xda8253,null));};exports['getTeams']=function(_0x639a07,_0x56453b,_0x3043b2){var _0x21ddf3={};var _0x5830fa={};var _0x2286bc;var _0x4ec2ba;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x639a07[_0xed73('0x59')]['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x56453b,null))[_0xed73('0x1f')](function(_0x52163a){if(_0x52163a){_0x2286bc=_0x52163a;_0x5830fa[_0xed73('0x46')]=_[_0xed73('0x43')](db[_0xed73('0xef')][_0xed73('0x42')]);_0x5830fa['query']=_['keys'](_0x639a07[_0xed73('0x49')]);_0x5830fa[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x5830fa[_0xed73('0x46')],_0x5830fa[_0xed73('0x49')]);_0x21ddf3['attributes']=_[_0xed73('0x5b')](_0x5830fa[_0xed73('0x46')],qs[_0xed73('0x48')](_0x639a07[_0xed73('0x49')][_0xed73('0x48')]));_0x21ddf3[_0xed73('0x47')]=_0x21ddf3[_0xed73('0x47')][_0xed73('0x4a')]?_0x21ddf3[_0xed73('0x47')]:_0x5830fa[_0xed73('0x46')];_0x21ddf3[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x639a07[_0xed73('0x49')]['sort']);_0x21ddf3['where']=qs['filters'](_[_0xed73('0xb4')](_0x639a07[_0xed73('0x49')],_0x5830fa[_0xed73('0x50')]));if(_0x639a07[_0xed73('0x49')]['filter']){_0x21ddf3[_0xed73('0x4f')]=_[_0xed73('0x51')](_0x21ddf3['where'],{'$or':_[_0xed73('0x39')](_0x21ddf3[_0xed73('0x47')],function(_0x11d7cf){var _0x441088={};_0x441088[_0x11d7cf]={'$like':'%'+_0x639a07['query']['filter']+'%'};return _0x441088;})});}_0x21ddf3=_[_0xed73('0x51')]({},_0x21ddf3,_0x639a07[_0xed73('0xae')]);return _0x2286bc[_0xed73('0xf0')](_0x21ddf3);}})[_0xed73('0x1f')](function(_0x1e6e73){if(_0x1e6e73){_0x4ec2ba=_0x1e6e73[_0xed73('0x4a')];if(!_0x639a07['query'][_0xed73('0x4b')]('nolimit')){_0x21ddf3[_0xed73('0x2e')]=qs[_0xed73('0x2e')](_0x639a07[_0xed73('0x49')][_0xed73('0x2e')]);_0x21ddf3[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x639a07[_0xed73('0x49')][_0xed73('0x2d')]);}return _0x2286bc[_0xed73('0xf0')](_0x21ddf3);}})[_0xed73('0x1f')](function(_0x20289f){if(_0x20289f){return _0x20289f?{'count':_0x4ec2ba,'rows':_0x20289f}:null;}})[_0xed73('0x1f')](respondWithResult(_0x56453b,null))['catch'](handleError(_0x56453b,null));};exports[_0xed73('0xf1')]=function(_0x4f9664,_0x3fd36a,_0x59d609){return db[_0xed73('0x56')][_0xed73('0x3c')]({'where':{'id':_0x4f9664['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x3fd36a,null))[_0xed73('0x1f')](function(_0x5774f7){if(_0x5774f7){return _0x5774f7[_0xed73('0xf1')](_0x4f9664[_0xed73('0x60')][_0xed73('0x96')],_[_0xed73('0x63')](_0x4f9664[_0xed73('0x60')],['ids','id'])||{});}})['then'](respondWithResult(_0x3fd36a,null))[_0xed73('0x27')](handleError(_0x3fd36a,null));};exports[_0xed73('0xf2')]=function(_0x476ec0,_0x4420e9,_0x589b04){return db['User']['find']({'where':{'id':_0x476ec0[_0xed73('0x59')]['id']}})['then'](handleEntityNotFound(_0x4420e9,null))[_0xed73('0x1f')](function(_0x2bf18e){if(_0x2bf18e){return _0x2bf18e['removeTeams'](_0x476ec0[_0xed73('0x49')]['ids']);}})[_0xed73('0x1f')](respondWithStatusCode(_0x4420e9,null))[_0xed73('0x27')](handleError(_0x4420e9,null));};exports[_0xed73('0xf3')]=function(_0x2df8dd,_0x1beb3e,_0x2c26ce){var _0x889d36={};var _0x4a15df={};var _0x2305f0;var _0x546a75;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x2df8dd['params']['id']}})[_0xed73('0x1f')](handleEntityNotFound(_0x1beb3e,null))[_0xed73('0x1f')](function(_0x10c8ee){if(_0x10c8ee){_0x2305f0=_0x10c8ee;_0x4a15df['model']=_[_0xed73('0x43')](db['CmList'][_0xed73('0x42')]);_0x4a15df[_0xed73('0x49')]=_[_0xed73('0x43')](_0x2df8dd[_0xed73('0x49')]);_0x4a15df[_0xed73('0x50')]=_['intersection'](_0x4a15df[_0xed73('0x46')],_0x4a15df[_0xed73('0x49')]);_0x889d36[_0xed73('0x47')]=_[_0xed73('0x5b')](_0x4a15df[_0xed73('0x46')],qs['fields'](_0x2df8dd[_0xed73('0x49')][_0xed73('0x48')]));_0x889d36[_0xed73('0x47')]=_0x889d36[_0xed73('0x47')][_0xed73('0x4a')]?_0x889d36[_0xed73('0x47')]:_0x4a15df[_0xed73('0x46')];_0x889d36[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x2df8dd[_0xed73('0x49')][_0xed73('0x4e')]);_0x889d36[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x2df8dd[_0xed73('0x49')],_0x4a15df['filters']));if(_0x2df8dd['query'][_0xed73('0x38')]){_0x889d36['where']=_['merge'](_0x889d36[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x889d36[_0xed73('0x47')],function(_0x3252f4){var _0x564e6f={};_0x564e6f[_0x3252f4]={'$like':'%'+_0x2df8dd[_0xed73('0x49')][_0xed73('0x38')]+'%'};return _0x564e6f;})});}_0x889d36=_[_0xed73('0x51')]({},_0x889d36,_0x2df8dd[_0xed73('0xae')]);return _0x2305f0[_0xed73('0xf3')](_0x889d36);}})['then'](function(_0x3cfb31){if(_0x3cfb31){_0x546a75=_0x3cfb31[_0xed73('0x4a')];if(!_0x2df8dd[_0xed73('0x49')][_0xed73('0x4b')]('nolimit')){_0x889d36['limit']=qs['limit'](_0x2df8dd[_0xed73('0x49')][_0xed73('0x2e')]);_0x889d36[_0xed73('0x2d')]=qs[_0xed73('0x2d')](_0x2df8dd[_0xed73('0x49')]['offset']);}return _0x2305f0['getLists'](_0x889d36);}})['then'](function(_0x458239){if(_0x458239){return _0x458239?{'count':_0x546a75,'rows':_0x458239}:null;}})[_0xed73('0x1f')](respondWithResult(_0x1beb3e,null))['catch'](handleError(_0x1beb3e,null));};exports[_0xed73('0xf4')]=function(_0x2ccae1,_0x222d34,_0x41f8e2){var _0x4d4cf8={};var _0x597e85={};var _0x1eec66;var _0x4b180a;return db[_0xed73('0x56')][_0xed73('0xac')]({'where':{'id':_0x2ccae1[_0xed73('0x59')]['id']}})['then'](handleEntityNotFound(_0x222d34,null))[_0xed73('0x1f')](function(_0x1fa8aa){if(_0x1fa8aa){_0x1eec66=_0x1fa8aa;_0x597e85[_0xed73('0x46')]=_[_0xed73('0x43')](db['User'][_0xed73('0x42')]);_0x597e85[_0xed73('0x49')]=_['keys'](_0x2ccae1['query']);_0x597e85[_0xed73('0x50')]=_[_0xed73('0x5b')](_0x597e85[_0xed73('0x46')],_0x597e85[_0xed73('0x49')]);_0x4d4cf8['attributes']=_['intersection'](_0x597e85['model'],qs['fields'](_0x2ccae1[_0xed73('0x49')][_0xed73('0x48')]));_0x4d4cf8[_0xed73('0x47')]=_0x4d4cf8[_0xed73('0x47')][_0xed73('0x4a')]?_0x4d4cf8[_0xed73('0x47')]:_0x597e85['model'];_0x4d4cf8[_0xed73('0x4d')]=qs[_0xed73('0x4e')](_0x2ccae1[_0xed73('0x49')]['sort']);_0x4d4cf8[_0xed73('0x4f')]=qs[_0xed73('0x50')](_[_0xed73('0xb4')](_0x2ccae1[_0xed73('0x49')],_0x597e85[_0xed73('0x50')]));if(_0x2ccae1[_0xed73('0x49')][_0xed73('0x38')]){_0x4d4cf8['where']=_['merge'](_0x4d4cf8[_0xed73('0x4f')],{'$or':_[_0xed73('0x39')](_0x4d4cf8[_0xed73('0x47')],function(_0x477cb1){var _0x2edca5={};_0x2edca5[_0x477cb1]={'$like':'%'+_0x2ccae1[_0xed73('0x49')]['filter']+'%'};return _0x2edca5;})});}_0x4d4cf8[_0xed73('0x46')]=db[_0xed73('0x56')];_0x4d4cf8['as']=_0xed73('0x35');_0x4d4cf8=_[_0xed73('0x51')]({},_0x4d4cf8,_0x2ccae1[_0xed73('0xae')]);return _0x1eec66[_0xed73('0xcf')]({'include':[_0x4d4cf8]});}})[_0xed73('0x1f')](function(_0x4188f4){if(_0x4188f4){var _0x2e3d6d={},_0x57df59=[],_0x6649ef=0x0;for(var _0x1f78ef=0x0;_0x1f78ef<_0x4188f4['length'];_0x1f78ef+=0x1){for(var _0xccf836=0x0,_0x552308;_0xccf836<_0x4188f4[_0x1f78ef][_0xed73('0x35')]['length'];_0xccf836+=0x1){_0x552308=_0x4188f4[_0x1f78ef][_0xed73('0x35')][_0xccf836][_0xed73('0x33')]({'plain':!![]});_0x2e3d6d[_0x552308['id']]=_0x552308;}}_0x2e3d6d=_['values'](_0x2e3d6d);for(var _0x443adc=qs[_0xed73('0x2d')](_0x2ccae1[_0xed73('0x49')][_0xed73('0x2d')]);_0x443adc<_0x2e3d6d[_0xed73('0x4a')]&&_0x57df59[_0xed73('0x4a')]=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file +var _0xb10b=['destroy','length','LoginUser','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./user.socket','register','request','then','info','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','result','catch','GetUser','User','options','where','attributes','limit','include','map','model','ShowUser','find','raw','PauseUser','name','role','interface','UserVoiceQueueRt','MemberReport','findAll','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','DEFAULT\x20PAUSE','internal','uniqueid','bulkCreate','type','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','update','system','chat','fax','sms','openchannel','set','Pause','all','LogoutUser'];(function(_0x2ae57a,_0x57ce3){var _0x59e2fc=function(_0x57f169){while(--_0x57f169){_0x2ae57a['push'](_0x2ae57a['shift']());}};_0x59e2fc(++_0x57ce3);}(_0xb10b,0x12a));var _0xbb10=function(_0x239650,_0x56aeda){_0x239650=_0x239650-0x0;var _0xee0bd6=_0xb10b[_0x239650];return _0xee0bd6;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('User,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['findAll']({'raw':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x19f48d['options']?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'limit':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x22')]||null:null,'include':_0x19f48d[_0xbb10('0x1f')]?_0x19f48d[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x19f48d['options']['include'],function(_0x4fb5e0){return{'model':db[_0x4fb5e0[_0xbb10('0x25')]],'as':_0x4fb5e0['as'],'attributes':_0x4fb5e0[_0xbb10('0x21')],'include':_0x4fb5e0[_0xbb10('0x23')]?_['map'](_0x4fb5e0[_0xbb10('0x23')],function(_0x24d586){return{'model':db[_0x24d586[_0xbb10('0x25')]],'as':_0x24d586['as'],'attributes':_0x24d586[_0xbb10('0x21')],'include':_0x24d586[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x24d586[_0xbb10('0x23')],function(_0x4aabb9){return{'model':db[_0x4aabb9[_0xbb10('0x25')]],'as':_0x4aabb9['as'],'attributes':_0x4aabb9[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x2e0249){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger['debug'](_0xbb10('0x1d'),_0x19f48d,JSON['stringify'](_0x2e0249));_0x109908(_0x2e0249);})[_0xbb10('0x1c')](function(_0x56f2da){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x56f2da[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x56f2da['message']));});});};exports[_0xbb10('0x26')]=function(_0x34f65e){var _0x4f590d=this;return new Promise(function(_0x359ad4,_0x37dde7){return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'raw':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x28')]===undefined?!![]:![]:!![],'where':_0x34f65e['options']?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x20')]||null:null,'attributes':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x21')]||null:null,'include':_0x34f65e[_0xbb10('0x1f')]?_0x34f65e[_0xbb10('0x1f')][_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x34f65e['options'][_0xbb10('0x23')],function(_0x150107){return{'model':db[_0x150107[_0xbb10('0x25')]],'as':_0x150107['as'],'attributes':_0x150107[_0xbb10('0x21')],'include':_0x150107['include']?_[_0xbb10('0x24')](_0x150107['include'],function(_0x4e2754){return{'model':db[_0x4e2754[_0xbb10('0x25')]],'as':_0x4e2754['as'],'attributes':_0x4e2754[_0xbb10('0x21')],'include':_0x4e2754[_0xbb10('0x23')]?_[_0xbb10('0x24')](_0x4e2754[_0xbb10('0x23')],function(_0x29d11a){return{'model':db[_0x29d11a['model']],'as':_0x29d11a['as'],'attributes':_0x29d11a[_0xbb10('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbb10('0x11')](function(_0x52de31){logger['info']('ShowUser',_0x34f65e);logger[_0xbb10('0x14')](_0xbb10('0x26'),_0x34f65e,JSON[_0xbb10('0x16')](_0x52de31));_0x359ad4(_0x52de31);})['catch'](function(_0x3c0cd7){logger[_0xbb10('0x17')](_0xbb10('0x26'),_0x3c0cd7['message'],_0x34f65e);_0x37dde7(_0x4f590d[_0xbb10('0x17')](0x1f4,_0x3c0cd7[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x29')]=function(_0x446f49){var _0x4f1cdd=this;return new Promise(function(_0xd238e9,_0x110eb5){var _0x5835fd;return db[_0xbb10('0x1e')][_0xbb10('0x27')]({'where':_0x446f49[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'internal',_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x3e7b4c){if(_0x3e7b4c){_0x5835fd=_0x3e7b4c;return db[_0xbb10('0x2d')]['update']({'paused':0x1},{'where':{'UserId':_0x5835fd['id']},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0x5835fd){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5835fd[_0xbb10('0x2a')],'type':'PAUSE','exitAt':null}});}})[_0xbb10('0x11')](function(_0x202c60){if(_0x5835fd){if(_0x202c60&&_0x202c60['length']){var _0x5d9a4f=moment()[_0xbb10('0x30')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x318984=0x0,_0x180933=_0x202c60['length'];_0x318984<_0x180933;_0x318984++){_0x202c60[_0x318984][_0xbb10('0x31')]({'exitAt':_0x5d9a4f});}}}})[_0xbb10('0x11')](function(){if(_0x5835fd){var _0x474e99=[];var _0x5cf4f8=utils[_0xbb10('0x32')]();_0x5cf4f8[_0xbb10('0x33')](function(_0x3b9fdf){_0x474e99[_0xbb10('0x34')]({'channel':_0x3b9fdf,'membername':_0x5835fd[_0xbb10('0x2a')],'interface':_[_0xbb10('0x35')](_0x5835fd[_0xbb10('0x2c')])?util[_0xbb10('0x30')](_0xbb10('0x36'),_0x5835fd[_0xbb10('0x2a')]):_0x5835fd[_0xbb10('0x2c')],'type':_0xbb10('0x37'),'enterAt':moment()['format'](_0xbb10('0x38')),'data1':_0x446f49[_0xbb10('0x39')]['type']||_0xbb10('0x3a'),'role':_0x5835fd[_0xbb10('0x2b')],'internal':_0x5835fd[_0xbb10('0x3b')],'uniqueid':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3c')]||null});});return db[_0xbb10('0x2e')][_0xbb10('0x3d')](_0x474e99,{'individualHooks':!![]});}})['then'](function(){if(_0x5835fd){return _0x5835fd['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x446f49[_0xbb10('0x39')][_0xbb10('0x3e')]||_0xbb10('0x3a'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xbb10('0x11')](function(_0x34cf4e){_0xd238e9(_0x34cf4e);})[_0xbb10('0x1c')](function(_0xf820fe){_0x110eb5(_0x4f1cdd[_0xbb10('0x17')](0x1f4,_0xf820fe[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x3f')]=function(_0x460788){var _0x2626d8=this;return new Promise(function(_0x3d7e7e,_0x550111){var _0x5eafac;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x460788[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x358e7e){if(_0x358e7e){_0x5eafac=_0x358e7e;if(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]&&!utils[_0xbb10('0x42')](_0x460788[_0xbb10('0x39')][_0xbb10('0x41')])){throw new Error(_0xbb10('0x43'));}switch(_0x460788[_0xbb10('0x39')][_0xbb10('0x41')]){case'voice':return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})[_0xbb10('0x11')](function(){return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788[_0xbb10('0x39')][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x180400){if(_0x180400){return _0x180400[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});}return null;})[_0xbb10('0x11')](function(){return _0x5eafac[_0xbb10('0x44')]({'voicePause':![]});});case'mail':case _0xbb10('0x46'):case _0xbb10('0x47'):case _0xbb10('0x48'):case _0xbb10('0x49'):return db[_0xbb10('0x2e')][_0xbb10('0x27')]({'where':{'channel':_0x460788['body'][_0xbb10('0x41')],'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}})[_0xbb10('0x11')](function(_0x432728){return _0x432728[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'data2':_0xbb10('0x45')},{'individualHooks':!![]});})[_0xbb10('0x11')](function(){var _0x2eb05a={};_[_0xbb10('0x4a')](_0x2eb05a,util[_0xbb10('0x30')]('%s%s',_0x460788['body'][_0xbb10('0x41')],_0xbb10('0x4b')),![]);return _0x5eafac[_0xbb10('0x44')](_0x2eb05a);});default:return db[_0xbb10('0x2d')]['update']({'paused':0x0},{'where':{'UserId':_0x5eafac['id']}})['then'](function(){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x5eafac[_0xbb10('0x2a')],'type':_0xbb10('0x37'),'exitAt':null}});})[_0xbb10('0x11')](function(_0x3e9753){var _0x45c0dc=[];_0x3e9753['forEach'](function(_0x117e84){_0x45c0dc[_0xbb10('0x34')](_0x117e84['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0x45')}));});return BPromise[_0xbb10('0x4c')](_0x45c0dc);})[_0xbb10('0x11')](function(){return _0x5eafac['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x5846d1){_0x3d7e7e(_0x5846d1);})[_0xbb10('0x1c')](function(_0x249b33){_0x550111(_0x2626d8[_0xbb10('0x17')](0x1f4,_0x249b33['message']));});});};exports[_0xbb10('0x4d')]=function(_0x13131c){var _0x5a6538=this;return new Promise(function(_0x4a560c,_0x27d7b9){var _0x308896;return db[_0xbb10('0x1e')][_0xbb10('0x40')]({'where':_0x13131c['options'][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a')]})[_0xbb10('0x11')](function(_0x5202d7){if(_0x5202d7){_0x308896=_0x5202d7;return db[_0xbb10('0x2d')][_0xbb10('0x4e')]({'where':{'membername':_0x308896[_0xbb10('0x2a')]},'individualHooks':!![]});}})['then'](function(){if(_0x308896){return db[_0xbb10('0x2e')][_0xbb10('0x2f')]({'where':{'membername':_0x308896[_0xbb10('0x2a')],'exitAt':null}});}})[_0xbb10('0x11')](function(_0x5e4a6e){if(_0x308896){if(_0x5e4a6e&&_0x5e4a6e[_0xbb10('0x4f')]){var _0x258e55=[];_0x5e4a6e[_0xbb10('0x33')](function(_0x2d0f4b){_0x258e55['push'](_0x2d0f4b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x258e55);}}})[_0xbb10('0x11')](function(){if(_0x308896){return _0x308896[_0xbb10('0x44')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbb10('0x11')](function(_0x4a30c5){_0x4a560c(_0x4a30c5);})['catch'](function(_0x5acd5e){_0x27d7b9(_0x5a6538[_0xbb10('0x17')](0x1f4,_0x5acd5e[_0xbb10('0x1a')]));});});};exports[_0xbb10('0x50')]=function(_0x5c9afc){var _0x5cd089=this;return new Promise(function(_0x46f462,_0x1b11c0){var _0xd9e743;var _0x3a9677;var _0x260e06;var _0x1ad2ed;return db['User'][_0xbb10('0x40')]({'where':_0x5c9afc[_0xbb10('0x1f')][_0xbb10('0x20')]||{},'attributes':['id',_0xbb10('0x2a'),_0xbb10('0x2b'),'mobile','phone','internal',_0xbb10('0x51'),_0xbb10('0x2c')]})[_0xbb10('0x11')](function(_0x21459e){if(_0x21459e){_0xd9e743=_0x21459e;_0x1ad2ed=_0x5c9afc[_0xbb10('0x39')][_0xbb10('0x2c')]?_0x5c9afc['body'][_0xbb10('0x2c')]:util['format']('SIP/%s',_0xd9e743['name']);return db[_0xbb10('0x1e')][_0xbb10('0x52')]({'where':{'role':_0xbb10('0x53'),'online':!![],'id':{'$ne':_0xd9e743['id']}}});}})[_0xbb10('0x11')](function(_0x5ce94f){if(_0x5ce94f){_0x260e06=_0x5ce94f;return require(_0xbb10('0x54'))['getLicense']();}})['then'](function(_0x165fe9){if(_0x165fe9&&_0x165fe9[_0xbb10('0x55')]&&_0x260e06>=_0x165fe9[_0xbb10('0x55')]){throw new Error(_0xbb10('0x56'));}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db['UserVoiceQueueRt'][_0xbb10('0x4e')]({'where':{'membername':_0xd9e743[_0xbb10('0x2a')]},'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743[_0xbb10('0x57')]({'raw':!![]});}})[_0xbb10('0x11')](function(_0x27f42f){if(_0xd9e743){if(_0x27f42f){var _0x174395=[];_0x3a9677=_0x27f42f;if(_0x3a9677['length']){for(var _0x387b10=0x0;_0x387b10<_0x3a9677[_0xbb10('0x4f')];_0x387b10++){_0x174395[_0xbb10('0x34')](db[_0xbb10('0x2d')][_0xbb10('0x58')]({'membername':_0xd9e743[_0xbb10('0x2a')],'UserId':_0xd9e743['id'],'queue_name':_0x3a9677[_0x387b10][_0xbb10('0x2a')],'VoiceQueueId':_0x3a9677[_0x387b10]['id'],'interface':_0x1ad2ed,'paused':_0xd9e743[_0xbb10('0x51')]||![],'penalty':_0x3a9677[_0x387b10]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xbb10('0x4c')](_0x174395);}}}})[_0xbb10('0x11')](function(){if(_0xd9e743){return db[_0xbb10('0x2e')]['findAll']({'where':{'membername':_0xd9e743['name'],'exitAt':null}});}})['then'](function(_0x23286d){if(_0xd9e743){if(_0x23286d&&_0x23286d['length']){var _0x4e3d6a=[];_0x23286d[_0xbb10('0x33')](function(_0x3ee56b){_0x4e3d6a[_0xbb10('0x34')](_0x3ee56b[_0xbb10('0x44')]({'exitAt':moment()[_0xbb10('0x30')](_0xbb10('0x38'))}));});return BPromise[_0xbb10('0x4c')](_0x4e3d6a);}}})[_0xbb10('0x11')](function(_0x188b97){if(_0xd9e743){var _0x5206e1=[];var _0x318a14=[];var _0x1351eb=utils[_0xbb10('0x32')]();var _0x35b811={'membername':_0xd9e743['name'],'interface':_0x1ad2ed,'enterAt':moment()['format'](_0xbb10('0x38')),'role':_0xd9e743[_0xbb10('0x2b')],'internal':_0xd9e743[_0xbb10('0x3b')]};_0x1351eb[_0xbb10('0x33')](function(_0x5ee705){_0x5206e1[_0xbb10('0x34')](_[_0xbb10('0x59')]({'channel':_0x5ee705,'type':_0xbb10('0x5a'),'data1':_0xbb10('0x5b'),'data2':_0x1ad2ed},_0x35b811));if(_0xd9e743[_0xbb10('0x51')]){_0x318a14['push'](_['merge']({'channel':_0x5ee705,'type':_0xbb10('0x37'),'data1':_0xbb10('0x5c')},_0x35b811));}});return db[_0xbb10('0x2e')]['bulkCreate'](_0x5206e1[_0xbb10('0x5d')](_0x318a14),{'individualHooks':!![]});}})[_0xbb10('0x11')](function(){if(_0xd9e743){return _0xd9e743['update']({'online':!![],'lastLoginAt':moment()['format'](_0xbb10('0x38')),'voicePause':_0xd9e743[_0xbb10('0x51')]||![],'mailPause':_0xd9e743[_0xbb10('0x51')]||![],'chatPause':_0xd9e743['loginInPause']||![],'faxPause':_0xd9e743[_0xbb10('0x51')]||![],'smsPause':_0xd9e743[_0xbb10('0x51')]||![],'openchannelPause':_0xd9e743[_0xbb10('0x51')]||![],'pauseType':_0xd9e743[_0xbb10('0x51')]?_0xbb10('0x5c'):null,'lastPauseAt':moment()[_0xbb10('0x30')](_0xbb10('0x38')),'interface':_0x1ad2ed});}})[_0xbb10('0x11')](function(_0x3e6246){_0x46f462(_0x3e6246);})['catch'](function(_0x3367d4){_0x1b11c0(_0x5cd089[_0xbb10('0x17')](0x1f4,_0x3367d4[_0xbb10('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 3a55bd7..fb4cee6 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 _0xc3fc=['register','user:','./user.events','save','remove','update','emit','removeListener'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xc3fc,0x7a));var _0xcc3f=function(_0x5344e9,_0x1f60e4){_0x5344e9=_0x5344e9-0x0;var _0x3711c3=_0xc3fc[_0x5344e9];return _0x3711c3;};'use strict';var UserEvents=require(_0xcc3f('0x0'));var events=[_0xcc3f('0x1'),_0xcc3f('0x2'),_0xcc3f('0x3')];function createListener(_0x38cf3f,_0xa19e79){return function(_0x5a30b6){_0xa19e79[_0xcc3f('0x4')](_0x38cf3f,_0x5a30b6);};}function removeListener(_0x1a023e,_0x4bb794){return function(){UserEvents[_0xcc3f('0x5')](_0x1a023e,_0x4bb794);};}exports[_0xcc3f('0x6')]=function(_0x1612f3){for(var _0x2fc294=0x0,_0x2dbe77=events['length'];_0x2fc294<_0x2dbe77;_0x2fc294++){var _0x478490=events[_0x2fc294];var _0x468c63=createListener(_0xcc3f('0x7')+_0x478490,_0x1612f3);UserEvents['on'](_0x478490,_0x468c63);}}; \ No newline at end of file +var _0x0b26=['length','user:','./user.events','remove','update','removeListener'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0x0b26,0x104));var _0x60b2=function(_0xb47dc0,_0x407032){_0xb47dc0=_0xb47dc0-0x0;var _0x57f0b0=_0x0b26[_0xb47dc0];return _0x57f0b0;};'use strict';var UserEvents=require(_0x60b2('0x0'));var events=['save',_0x60b2('0x1'),_0x60b2('0x2')];function createListener(_0x1c4c43,_0x45eeab){return function(_0x2c7dae){_0x45eeab['emit'](_0x1c4c43,_0x2c7dae);};}function removeListener(_0xf44d58,_0x4673c2){return function(){UserEvents[_0x60b2('0x3')](_0xf44d58,_0x4673c2);};}exports['register']=function(_0x3f58f7){for(var _0x42e4a3=0x0,_0x364cb7=events[_0x60b2('0x4')];_0x42e4a3<_0x364cb7;_0x42e4a3++){var _0x56576c=events[_0x42e4a3];var _0x2016fb=createListener(_0x60b2('0x5')+_0x56576c,_0x3f58f7);UserEvents['on'](_0x56576c,_0x2016fb);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index bd81518..f89d646 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 _0xd046=['Router','../../config/environment','util','path','connect-timeout'];(function(_0x4bd9d0,_0x4e0812){var _0x116b69=function(_0x4821e1){while(--_0x4821e1){_0x4bd9d0['push'](_0x4bd9d0['shift']());}};_0x116b69(++_0x4e0812);}(_0xd046,0x129));var _0x6d04=function(_0x401f98,_0xfc6415){_0x401f98=_0x401f98-0x0;var _0x5bc069=_0xd046[_0x401f98];return _0x5bc069;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d04('0x4'));module['exports']=router; \ No newline at end of file +var _0x90b5=['connect-timeout','express','Router','../../config/environment','exports','multer','path'];(function(_0x7d5b1b,_0x20e692){var _0x51988c=function(_0x4b8e77){while(--_0x4b8e77){_0x7d5b1b['push'](_0x7d5b1b['shift']());}};_0x51988c(++_0x20e692);}(_0x90b5,0x139));var _0x590b=function(_0xed40c9,_0x2539d8){_0xed40c9=_0xed40c9-0x0;var _0x3b5d78=_0x90b5[_0xed40c9];return _0x3b5d78;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x590b('0x5'));module[_0x590b('0x6')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 1843158..288bab1 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 _0xaebe=['exports','INTEGER','sequelize'];(function(_0x370c4d,_0x38ac8d){var _0x3d2648=function(_0x32b19c){while(--_0x32b19c){_0x370c4d['push'](_0x370c4d['shift']());}};_0x3d2648(++_0x38ac8d);}(_0xaebe,0xc5));var _0xeaeb=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xaebe[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xeaeb('0x0'));module[_0xeaeb('0x1')]={'penalty':{'type':Sequelize[_0xeaeb('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4a9b=['exports','sequelize'];(function(_0x25ed73,_0x8a06c0){var _0x2d44ad=function(_0x503673){while(--_0x503673){_0x25ed73['push'](_0x25ed73['shift']());}};_0x2d44ad(++_0x8a06c0);}(_0x4a9b,0x19f));var _0xb4a9=function(_0x32b017,_0x311116){_0x32b017=_0x32b017-0x0;var _0x344911=_0x4a9b[_0x32b017];return _0x344911;};'use strict';var Sequelize=require(_0xb4a9('0x0'));module[_0xb4a9('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 4995a6a..7726342 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 _0x4393=['api','moment','request-promise','path','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x4393,0x14f));var _0x3439=function(_0x246184,_0x1849f4){_0x246184=_0x246184-0x0;var _0x4e39d2=_0x4393[_0x246184];return _0x4e39d2;};'use strict';var _=require(_0x3439('0x0'));var util=require(_0x3439('0x1'));var logger=require(_0x3439('0x2'))(_0x3439('0x3'));var moment=require(_0x3439('0x4'));var BPromise=require('bluebird');var rp=require(_0x3439('0x5'));var fs=require('fs');var path=require(_0x3439('0x6'));var rimraf=require('rimraf');var config=require(_0x3439('0x7'));var attributes=require(_0x3439('0x8'));module[_0x3439('0x9')]=function(_0x3910e9,_0x1036be){return _0x3910e9[_0x3439('0xa')](_0x3439('0xb'),attributes,{'tableName':_0x3439('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x87fe=['moment','bluebird','request-promise','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api'];(function(_0x1824d2,_0x382926){var _0x4d9feb=function(_0x3f648b){while(--_0x3f648b){_0x1824d2['push'](_0x1824d2['shift']());}};_0x4d9feb(++_0x382926);}(_0x87fe,0x19f));var _0xe87f=function(_0x135704,_0x539aee){_0x135704=_0x135704-0x0;var _0x24e9fd=_0x87fe[_0x135704];return _0x24e9fd;};'use strict';var _=require(_0xe87f('0x0'));var util=require('util');var logger=require(_0xe87f('0x1'))(_0xe87f('0x2'));var moment=require(_0xe87f('0x3'));var BPromise=require(_0xe87f('0x4'));var rp=require(_0xe87f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe87f('0x6'));var attributes=require(_0xe87f('0x7'));module['exports']=function(_0x55801c,_0x2fcb15){return _0x55801c[_0xe87f('0x8')](_0xe87f('0x9'),attributes,{'tableName':_0xe87f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 07871f5..f01e01a 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 _0x97f7=['debug','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1b892b,_0x4efe48){var _0xa99e57=function(_0x3f957a){while(--_0x3f957a){_0x1b892b['push'](_0x1b892b['shift']());}};_0xa99e57(++_0x4efe48);}(_0x97f7,0x10f));var _0x797f=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x97f7[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x797f('0x0'));var util=require(_0x797f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x797f('0x2'));var db=require(_0x797f('0x3'))['db'];var utils=require(_0x797f('0x4'));var logger=require(_0x797f('0x5'))(_0x797f('0x6'));var config=require(_0x797f('0x7'));var jayson=require(_0x797f('0x8'));var client=jayson[_0x797f('0x9')][_0x797f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24742a,_0x2c05d1,_0x41caee){return new BPromise(function(_0x1dbb36,_0x32e1f3){return client[_0x797f('0xb')](_0x24742a,_0x41caee)[_0x797f('0xc')](function(_0x23f2d1){logger['info'](_0x797f('0xd'),_0x2c05d1,_0x797f('0xe'));logger[_0x797f('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2c05d1,_0x797f('0xe'),JSON['stringify'](_0x23f2d1));if(_0x23f2d1[_0x797f('0x10')]){if(_0x23f2d1[_0x797f('0x10')][_0x797f('0x11')]===0x1f4){logger[_0x797f('0x10')](_0x797f('0xd'),_0x2c05d1,_0x23f2d1[_0x797f('0x10')]['message']);return _0x32e1f3(_0x23f2d1[_0x797f('0x10')][_0x797f('0x12')]);}logger['error'](_0x797f('0xd'),_0x2c05d1,_0x23f2d1[_0x797f('0x10')][_0x797f('0x12')]);return _0x1dbb36(_0x23f2d1[_0x797f('0x10')][_0x797f('0x12')]);}else{logger[_0x797f('0x13')](_0x797f('0xd'),_0x2c05d1,_0x797f('0xe'));_0x1dbb36(_0x23f2d1[_0x797f('0x14')][_0x797f('0x12')]);}})[_0x797f('0x15')](function(_0x3a48d2){logger[_0x797f('0x10')](_0x797f('0xd'),_0x2c05d1,_0x3a48d2);_0x32e1f3(_0x3a48d2);});});} \ No newline at end of file +var _0xb5bb=['result','catch','lodash','util','moment','randomstring','ioredis','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3bbda1,_0x3261b0){var _0xf33156=function(_0x52fd12){while(--_0x52fd12){_0x3bbda1['push'](_0x3bbda1['shift']());}};_0xf33156(++_0x3261b0);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x40c6a0,_0x1cc177){_0x40c6a0=_0x40c6a0-0x0;var _0x57deb1=_0xb5bb[_0x40c6a0];return _0x57deb1;};'use strict';var _=require(_0xbb5b('0x0'));var util=require(_0xbb5b('0x1'));var moment=require(_0xbb5b('0x2'));var BPromise=require('bluebird');var rs=require(_0xbb5b('0x3'));var fs=require('fs');var Redis=require(_0xbb5b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb5b('0x5')][_0xbb5b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5b03cd,_0x1d8453,_0x10d8fb){return new BPromise(function(_0x31eaa6,_0x11cc7e){return client[_0xbb5b('0x7')](_0x5b03cd,_0x10d8fb)[_0xbb5b('0x8')](function(_0x1b90ec){logger[_0xbb5b('0x9')](_0xbb5b('0xa'),_0x1d8453,_0xbb5b('0xb'));logger[_0xbb5b('0xc')](_0xbb5b('0xd'),_0x1d8453,_0xbb5b('0xb'),JSON[_0xbb5b('0xe')](_0x1b90ec));if(_0x1b90ec[_0xbb5b('0xf')]){if(_0x1b90ec[_0xbb5b('0xf')][_0xbb5b('0x10')]===0x1f4){logger[_0xbb5b('0xf')](_0xbb5b('0xa'),_0x1d8453,_0x1b90ec[_0xbb5b('0xf')]['message']);return _0x11cc7e(_0x1b90ec[_0xbb5b('0xf')]['message']);}logger[_0xbb5b('0xf')](_0xbb5b('0xa'),_0x1d8453,_0x1b90ec[_0xbb5b('0xf')][_0xbb5b('0x11')]);return _0x31eaa6(_0x1b90ec['error'][_0xbb5b('0x11')]);}else{logger[_0xbb5b('0x9')](_0xbb5b('0xa'),_0x1d8453,_0xbb5b('0xb'));_0x31eaa6(_0x1b90ec[_0xbb5b('0x12')]['message']);}})[_0xbb5b('0x13')](function(_0x380044){logger[_0xbb5b('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x1d8453,_0x380044);_0x11cc7e(_0x380044);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index ea6dd05..5fe5137 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 _0xbacd=['express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout'];(function(_0x53a8d3,_0x1a0799){var _0x15e434=function(_0x21f7ac){while(--_0x21f7ac){_0x53a8d3['push'](_0x53a8d3['shift']());}};_0x15e434(++_0x1a0799);}(_0xbacd,0x1c5));var _0xdbac=function(_0x4a7196,_0x2fbfa8){_0x4a7196=_0x4a7196-0x0;var _0x570c30=_0xbacd[_0x4a7196];return _0x570c30;};'use strict';var multer=require(_0xdbac('0x0'));var util=require(_0xdbac('0x1'));var path=require('path');var timeout=require(_0xdbac('0x2'));var express=require(_0xdbac('0x3'));var router=express[_0xdbac('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdbac('0x5'));var config=require(_0xdbac('0x6'));module[_0xdbac('0x7')]=router; \ No newline at end of file +var _0x2d72=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x28a87b,_0x564dfe){var _0x333015=function(_0x2d14d3){while(--_0x2d14d3){_0x28a87b['push'](_0x28a87b['shift']());}};_0x333015(++_0x564dfe);}(_0x2d72,0xa8));var _0x22d7=function(_0x3a5309,_0x5bf491){_0x3a5309=_0x3a5309-0x0;var _0x2c24d0=_0x2d72[_0x3a5309];return _0x2c24d0;};'use strict';var multer=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var path=require(_0x22d7('0x2'));var timeout=require(_0x22d7('0x3'));var express=require(_0x22d7('0x4'));var router=express[_0x22d7('0x5')]();var auth=require(_0x22d7('0x6'));var interaction=require(_0x22d7('0x7'));var config=require(_0x22d7('0x8'));module[_0x22d7('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c416e87..c3bd2e0 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 _0x413a=['STRING','sequelize','INTEGER'];(function(_0x40c3e2,_0x5932e5){var _0x577968=function(_0x3a7239){while(--_0x3a7239){_0x40c3e2['push'](_0x40c3e2['shift']());}};_0x577968(++_0x5932e5);}(_0x413a,0x1ba));var _0xa413=function(_0x2cd659,_0x3bd13e){_0x2cd659=_0x2cd659-0x0;var _0x329ffd=_0x413a[_0x2cd659];return _0x329ffd;};'use strict';var Sequelize=require(_0xa413('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xa413('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa413('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa413('0x2')]}}; \ No newline at end of file +var _0x8cf2=['exports','INTEGER','STRING','sequelize'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x8cf2,0x1a7));var _0x28cf=function(_0x503710,_0x128925){_0x503710=_0x503710-0x0;var _0x27d67f=_0x8cf2[_0x503710];return _0x27d67f;};'use strict';var Sequelize=require(_0x28cf('0x0'));module[_0x28cf('0x1')]={'penalty':{'type':Sequelize[_0x28cf('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x28cf('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x28cf('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 47e5a64..3f78696 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 _0x0dfd=['path','rimraf','../../config/environment','define','UserFaxQueue','user_has_fax_queues','lodash','util','api','moment','bluebird'];(function(_0x4ce498,_0x2a4ce1){var _0x25617b=function(_0x27fa9f){while(--_0x27fa9f){_0x4ce498['push'](_0x4ce498['shift']());}};_0x25617b(++_0x2a4ce1);}(_0x0dfd,0x150));var _0xd0df=function(_0x3d576f,_0x58e756){_0x3d576f=_0x3d576f-0x0;var _0x174ebd=_0x0dfd[_0x3d576f];return _0x174ebd;};'use strict';var _=require(_0xd0df('0x0'));var util=require(_0xd0df('0x1'));var logger=require('../../config/logger')(_0xd0df('0x2'));var moment=require(_0xd0df('0x3'));var BPromise=require(_0xd0df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0df('0x5'));var rimraf=require(_0xd0df('0x6'));var config=require(_0xd0df('0x7'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x445372,_0xa4a740){return _0x445372[_0xd0df('0x8')](_0xd0df('0x9'),attributes,{'tableName':_0xd0df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1396=['moment','request-promise','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','lodash','util','../../config/logger','api'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x1396,0x14c));var _0x6139=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0x1396[_0x50cfc3];return _0x5c11ef;};'use strict';var _=require(_0x6139('0x0'));var util=require(_0x6139('0x1'));var logger=require(_0x6139('0x2'))(_0x6139('0x3'));var moment=require(_0x6139('0x4'));var BPromise=require('bluebird');var rp=require(_0x6139('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6139('0x6'));var config=require(_0x6139('0x7'));var attributes=require(_0x6139('0x8'));module[_0x6139('0x9')]=function(_0x5b1679,_0x22bc4b){return _0x5b1679[_0x6139('0xa')](_0x6139('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 5565c7e..a5a84d8 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 _0xbc6f=['then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0xbc6f,0x1c2));var _0xfbc6=function(_0x21c76e,_0x657e32){_0x21c76e=_0x21c76e-0x0;var _0x1c28c7=_0xbc6f[_0x21c76e];return _0x1c28c7;};'use strict';var _=require(_0xfbc6('0x0'));var util=require(_0xfbc6('0x1'));var moment=require(_0xfbc6('0x2'));var BPromise=require(_0xfbc6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfbc6('0x4'));var logger=require(_0xfbc6('0x5'))(_0xfbc6('0x6'));var config=require(_0xfbc6('0x7'));var jayson=require(_0xfbc6('0x8'));var client=jayson[_0xfbc6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bc855,_0xc2c441,_0x419904){return new BPromise(function(_0x4e8461,_0x2521cc){return client['request'](_0x2bc855,_0x419904)[_0xfbc6('0xa')](function(_0x1455cc){logger['info'](_0xfbc6('0xb'),_0xc2c441,_0xfbc6('0xc'));logger[_0xfbc6('0xd')](_0xfbc6('0xe'),_0xc2c441,_0xfbc6('0xc'),JSON['stringify'](_0x1455cc));if(_0x1455cc[_0xfbc6('0xf')]){if(_0x1455cc['error']['code']===0x1f4){logger['error'](_0xfbc6('0xb'),_0xc2c441,_0x1455cc[_0xfbc6('0xf')][_0xfbc6('0x10')]);return _0x2521cc(_0x1455cc[_0xfbc6('0xf')]['message']);}logger['error'](_0xfbc6('0xb'),_0xc2c441,_0x1455cc[_0xfbc6('0xf')][_0xfbc6('0x10')]);return _0x4e8461(_0x1455cc[_0xfbc6('0xf')]['message']);}else{logger[_0xfbc6('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0xc2c441,_0xfbc6('0xc'));_0x4e8461(_0x1455cc[_0xfbc6('0x12')][_0xfbc6('0x10')]);}})[_0xfbc6('0x13')](function(_0x138ceb){logger[_0xfbc6('0xf')](_0xfbc6('0xb'),_0xc2c441,_0x138ceb);_0x2521cc(_0x138ceb);});});} \ No newline at end of file +var _0xc28b=['message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserFaxQueue,\x20%s,\x20%s'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xc28b,0xb3));var _0xbc28=function(_0x3d839a,_0x259485){_0x3d839a=_0x3d839a-0x0;var _0x26d010=_0xc28b[_0x3d839a];return _0x26d010;};'use strict';var _=require('lodash');var util=require(_0xbc28('0x0'));var moment=require(_0xbc28('0x1'));var BPromise=require(_0xbc28('0x2'));var rs=require(_0xbc28('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc28('0x4'))['db'];var utils=require(_0xbc28('0x5'));var logger=require(_0xbc28('0x6'))('rpc');var config=require(_0xbc28('0x7'));var jayson=require(_0xbc28('0x8'));var client=jayson[_0xbc28('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0d49,_0x4d15bd,_0x345b7a){return new BPromise(function(_0x2e62ed,_0x37143b){return client[_0xbc28('0xa')](_0x4e0d49,_0x345b7a)['then'](function(_0x597382){logger[_0xbc28('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x4d15bd,'request\x20sent');logger[_0xbc28('0xc')](_0xbc28('0xd'),_0x4d15bd,_0xbc28('0xe'),JSON[_0xbc28('0xf')](_0x597382));if(_0x597382[_0xbc28('0x10')]){if(_0x597382[_0xbc28('0x10')][_0xbc28('0x11')]===0x1f4){logger[_0xbc28('0x10')](_0xbc28('0x12'),_0x4d15bd,_0x597382[_0xbc28('0x10')]['message']);return _0x37143b(_0x597382[_0xbc28('0x10')][_0xbc28('0x13')]);}logger[_0xbc28('0x10')](_0xbc28('0x12'),_0x4d15bd,_0x597382[_0xbc28('0x10')][_0xbc28('0x13')]);return _0x2e62ed(_0x597382[_0xbc28('0x10')][_0xbc28('0x13')]);}else{logger['info'](_0xbc28('0x12'),_0x4d15bd,_0xbc28('0xe'));_0x2e62ed(_0x597382[_0xbc28('0x14')]['message']);}})[_0xbc28('0x15')](function(_0x3f123b){logger[_0xbc28('0x10')](_0xbc28('0x12'),_0x4d15bd,_0x3f123b);_0x37143b(_0x3f123b);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7bddea8..4901e9e 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 _0x3fa4=['../../config/environment','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3d1b60,_0x3d1e53){var _0x2c8e7d=function(_0x224e6b){while(--_0x224e6b){_0x3d1b60['push'](_0x3d1b60['shift']());}};_0x2c8e7d(++_0x3d1e53);}(_0x3fa4,0xf0));var _0x43fa=function(_0x217f8,_0x369f44){_0x217f8=_0x217f8-0x0;var _0x2ae878=_0x3fa4[_0x217f8];return _0x2ae878;};'use strict';var multer=require(_0x43fa('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x43fa('0x1'));var router=express[_0x43fa('0x2')]();var auth=require(_0x43fa('0x3'));var interaction=require(_0x43fa('0x4'));var config=require(_0x43fa('0x5'));module[_0x43fa('0x6')]=router; \ No newline at end of file +var _0x41fe=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x41fe,0xd1));var _0xe41f=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0x41fe[_0x45b034];return _0x509cb0;};'use strict';var multer=require(_0xe41f('0x0'));var util=require(_0xe41f('0x1'));var path=require(_0xe41f('0x2'));var timeout=require(_0xe41f('0x3'));var express=require(_0xe41f('0x4'));var router=express[_0xe41f('0x5')]();var auth=require(_0xe41f('0x6'));var interaction=require(_0xe41f('0x7'));var config=require(_0xe41f('0x8'));module[_0xe41f('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index b02b1ce..8404ff6 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 _0xc800=['INTEGER','sequelize','exports'];(function(_0x283293,_0x14d7ce){var _0x2f5ad1=function(_0x379e14){while(--_0x379e14){_0x283293['push'](_0x283293['shift']());}};_0x2f5ad1(++_0x14d7ce);}(_0xc800,0x94));var _0x0c80=function(_0x5f3de3,_0x40f0f5){_0x5f3de3=_0x5f3de3-0x0;var _0x287e0d=_0xc800[_0x5f3de3];return _0x287e0d;};'use strict';var Sequelize=require(_0x0c80('0x0'));module[_0x0c80('0x1')]={'penalty':{'type':Sequelize[_0x0c80('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb6df=['sequelize','INTEGER'];(function(_0x752903,_0x26e702){var _0x4fe306=function(_0x5f124b){while(--_0x5f124b){_0x752903['push'](_0x752903['shift']());}};_0x4fe306(++_0x26e702);}(_0xb6df,0x74));var _0xfb6d=function(_0x55e732,_0x3a9bb5){_0x55e732=_0x55e732-0x0;var _0x92659=_0xb6df[_0x55e732];return _0x92659;};'use strict';var Sequelize=require(_0xfb6d('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xfb6d('0x1')],'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 988f92c..2c25fe1 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 _0x1967=['path','rimraf','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x235326,_0x251051){var _0x43a1d7=function(_0x1e79d9){while(--_0x1e79d9){_0x235326['push'](_0x235326['shift']());}};_0x43a1d7(++_0x251051);}(_0x1967,0x173));var _0x7196=function(_0x23b915,_0x33fee4){_0x23b915=_0x23b915-0x0;var _0x2c98d3=_0x1967[_0x23b915];return _0x2c98d3;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2542=['api','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger'];(function(_0x5a125c,_0x155fa2){var _0x4c70af=function(_0x5dccb6){while(--_0x5dccb6){_0x5a125c['push'](_0x5a125c['shift']());}};_0x4c70af(++_0x155fa2);}(_0x2542,0x169));var _0x2254=function(_0x3e7c63,_0x50abe9){_0x3e7c63=_0x3e7c63-0x0;var _0x156116=_0x2542[_0x3e7c63];return _0x156116;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 0155b2f..1221e27 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 _0x43d5=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x43d5,0x12e));var _0x543d=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0x43d5[_0x58db4e];return _0x40139a;};'use strict';var _=require(_0x543d('0x0'));var util=require(_0x543d('0x1'));var moment=require(_0x543d('0x2'));var BPromise=require(_0x543d('0x3'));var rs=require(_0x543d('0x4'));var fs=require('fs');var Redis=require(_0x543d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x543d('0x6'));var logger=require(_0x543d('0x7'))(_0x543d('0x8'));var config=require(_0x543d('0x9'));var jayson=require(_0x543d('0xa'));var client=jayson[_0x543d('0xb')][_0x543d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33ea8b,_0x887c7,_0x4055f2){return new BPromise(function(_0x37a924,_0xadc0e7){return client[_0x543d('0xd')](_0x33ea8b,_0x4055f2)[_0x543d('0xe')](function(_0x1f4a71){logger['info'](_0x543d('0xf'),_0x887c7,'request\x20sent');logger['debug'](_0x543d('0x10'),_0x887c7,_0x543d('0x11'),JSON[_0x543d('0x12')](_0x1f4a71));if(_0x1f4a71[_0x543d('0x13')]){if(_0x1f4a71[_0x543d('0x13')][_0x543d('0x14')]===0x1f4){logger[_0x543d('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x887c7,_0x1f4a71[_0x543d('0x13')][_0x543d('0x15')]);return _0xadc0e7(_0x1f4a71[_0x543d('0x13')][_0x543d('0x15')]);}logger[_0x543d('0x13')](_0x543d('0xf'),_0x887c7,_0x1f4a71[_0x543d('0x13')]['message']);return _0x37a924(_0x1f4a71[_0x543d('0x13')][_0x543d('0x15')]);}else{logger[_0x543d('0x16')](_0x543d('0xf'),_0x887c7,'request\x20sent');_0x37a924(_0x1f4a71[_0x543d('0x17')][_0x543d('0x15')]);}})[_0x543d('0x18')](function(_0x41558e){logger['error'](_0x543d('0xf'),_0x887c7,_0x41558e);_0xadc0e7(_0x41558e);});});} \ No newline at end of file +var _0xeb5f=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserMailQueue,\x20%s,\x20%s','debug','stringify','error','message'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xeb5f,0x1e2));var _0xfeb5=function(_0x32b350,_0x467208){_0x32b350=_0x32b350-0x0;var _0x3b54a9=_0xeb5f[_0x32b350];return _0x3b54a9;};'use strict';var _=require(_0xfeb5('0x0'));var util=require('util');var moment=require(_0xfeb5('0x1'));var BPromise=require('bluebird');var rs=require(_0xfeb5('0x2'));var fs=require('fs');var Redis=require(_0xfeb5('0x3'));var db=require(_0xfeb5('0x4'))['db'];var utils=require(_0xfeb5('0x5'));var logger=require(_0xfeb5('0x6'))(_0xfeb5('0x7'));var config=require(_0xfeb5('0x8'));var jayson=require(_0xfeb5('0x9'));var client=jayson[_0xfeb5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x594e32,_0x4aa9af,_0x2230a4){return new BPromise(function(_0x45d4fc,_0x5c8752){return client['request'](_0x594e32,_0x2230a4)[_0xfeb5('0xb')](function(_0x2d9f2c){logger[_0xfeb5('0xc')](_0xfeb5('0xd'),_0x4aa9af,'request\x20sent');logger[_0xfeb5('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x4aa9af,'request\x20sent',JSON[_0xfeb5('0xf')](_0x2d9f2c));if(_0x2d9f2c[_0xfeb5('0x10')]){if(_0x2d9f2c[_0xfeb5('0x10')]['code']===0x1f4){logger[_0xfeb5('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4aa9af,_0x2d9f2c[_0xfeb5('0x10')][_0xfeb5('0x11')]);return _0x5c8752(_0x2d9f2c[_0xfeb5('0x10')][_0xfeb5('0x11')]);}logger[_0xfeb5('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4aa9af,_0x2d9f2c[_0xfeb5('0x10')]['message']);return _0x45d4fc(_0x2d9f2c[_0xfeb5('0x10')][_0xfeb5('0x11')]);}else{logger[_0xfeb5('0xc')](_0xfeb5('0xd'),_0x4aa9af,'request\x20sent');_0x45d4fc(_0x2d9f2c[_0xfeb5('0x12')][_0xfeb5('0x11')]);}})[_0xfeb5('0x13')](function(_0x50b4ec){logger[_0xfeb5('0x10')](_0xfeb5('0xd'),_0x4aa9af,_0x50b4ec);_0x5c8752(_0x50b4ec);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 4a2012f..025ca0d 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 _0x677a=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer','path'];(function(_0x70f85,_0x5670cf){var _0x4e76d0=function(_0x1432a1){while(--_0x1432a1){_0x70f85['push'](_0x70f85['shift']());}};_0x4e76d0(++_0x5670cf);}(_0x677a,0xd6));var _0xa677=function(_0x36041e,_0x3d6420){_0x36041e=_0x36041e-0x0;var _0x4fce84=_0x677a[_0x36041e];return _0x4fce84;};'use strict';var multer=require(_0xa677('0x0'));var util=require('util');var path=require(_0xa677('0x1'));var timeout=require(_0xa677('0x2'));var express=require(_0xa677('0x3'));var router=express[_0xa677('0x4')]();var auth=require(_0xa677('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa677('0x6'));module[_0xa677('0x7')]=router; \ No newline at end of file +var _0xc9c3=['../../components/interaction/service','../../config/environment','exports','path','express','Router','../../components/auth/service'];(function(_0x5b2d6e,_0x325992){var _0x10919f=function(_0xb9c5de){while(--_0xb9c5de){_0x5b2d6e['push'](_0x5b2d6e['shift']());}};_0x10919f(++_0x325992);}(_0xc9c3,0x96));var _0x3c9c=function(_0x347235,_0x3ddc43){_0x347235=_0x347235-0x0;var _0x5b5d21=_0xc9c3[_0x347235];return _0x5b5d21;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x3c9c('0x1'));var router=express[_0x3c9c('0x2')]();var auth=require(_0x3c9c('0x3'));var interaction=require(_0x3c9c('0x4'));var config=require(_0x3c9c('0x5'));module[_0x3c9c('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 03aae31..4bc4884 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 _0x41f4=['sequelize','INTEGER'];(function(_0x4cc765,_0x136732){var _0x5e4a03=function(_0x4042e5){while(--_0x4042e5){_0x4cc765['push'](_0x4cc765['shift']());}};_0x5e4a03(++_0x136732);}(_0x41f4,0x80));var _0x441f=function(_0x18cb50,_0x8144e9){_0x18cb50=_0x18cb50-0x0;var _0x33ad47=_0x41f4[_0x18cb50];return _0x33ad47;};'use strict';var Sequelize=require(_0x441f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x441f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x483e=['sequelize'];(function(_0x5c8383,_0x1f04c3){var _0x327bc5=function(_0x466952){while(--_0x466952){_0x5c8383['push'](_0x5c8383['shift']());}};_0x327bc5(++_0x1f04c3);}(_0x483e,0x128));var _0xe483=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x483e[_0x68c979];return _0x4f0001;};'use strict';var Sequelize=require(_0xe483('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'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 03c8121..196e4a7 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 _0xaf2f=['user_has_openchannel_queues','../../config/logger','api','request-promise','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0x19098f,_0x544dc5){var _0x951d0d=function(_0x408b53){while(--_0x408b53){_0x19098f['push'](_0x19098f['shift']());}};_0x951d0d(++_0x544dc5);}(_0xaf2f,0xfd));var _0xfaf2=function(_0x480ee3,_0x2b4309){_0x480ee3=_0x480ee3-0x0;var _0x409556=_0xaf2f[_0x480ee3];return _0x409556;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfaf2('0x0'))(_0xfaf2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfaf2('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfaf2('0x3'));var config=require('../../config/environment');var attributes=require(_0xfaf2('0x4'));module[_0xfaf2('0x5')]=function(_0x3534c0,_0x48f930){return _0x3534c0[_0xfaf2('0x6')](_0xfaf2('0x7'),attributes,{'tableName':_0xfaf2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6fd=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x56e2ed,_0x1c4781){var _0x5237b2=function(_0x587150){while(--_0x587150){_0x56e2ed['push'](_0x56e2ed['shift']());}};_0x5237b2(++_0x1c4781);}(_0xd6fd,0x10b));var _0xdd6f=function(_0x4721a5,_0x2e5cd8){_0x4721a5=_0x4721a5-0x0;var _0x21e6d8=_0xd6fd[_0x4721a5];return _0x21e6d8;};'use strict';var _=require(_0xdd6f('0x0'));var util=require(_0xdd6f('0x1'));var logger=require(_0xdd6f('0x2'))(_0xdd6f('0x3'));var moment=require(_0xdd6f('0x4'));var BPromise=require(_0xdd6f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd6f('0x6'));var rimraf=require(_0xdd6f('0x7'));var config=require(_0xdd6f('0x8'));var attributes=require(_0xdd6f('0x9'));module[_0xdd6f('0xa')]=function(_0x32ba06,_0x1d7c39){return _0x32ba06['define'](_0xdd6f('0xb'),attributes,{'tableName':_0xdd6f('0xc'),'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 28529cf..2eac0cd 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 _0x8cda=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8cda,0x136));var _0xa8cd=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8cda[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa8cd('0x0'));var util=require('util');var moment=require(_0xa8cd('0x1'));var BPromise=require(_0xa8cd('0x2'));var rs=require(_0xa8cd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa8cd('0x4'))['db'];var utils=require(_0xa8cd('0x5'));var logger=require(_0xa8cd('0x6'))(_0xa8cd('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa8cd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x268c70,_0x54fa3a,_0xd5f4fd){return new BPromise(function(_0x542152,_0x17380f){return client[_0xa8cd('0x9')](_0x268c70,_0xd5f4fd)[_0xa8cd('0xa')](function(_0x4853cf){logger[_0xa8cd('0xb')](_0xa8cd('0xc'),_0x54fa3a,'request\x20sent');logger[_0xa8cd('0xd')](_0xa8cd('0xe'),_0x54fa3a,_0xa8cd('0xf'),JSON['stringify'](_0x4853cf));if(_0x4853cf[_0xa8cd('0x10')]){if(_0x4853cf['error'][_0xa8cd('0x11')]===0x1f4){logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x54fa3a,_0x4853cf['error'][_0xa8cd('0x12')]);return _0x17380f(_0x4853cf[_0xa8cd('0x10')][_0xa8cd('0x12')]);}logger[_0xa8cd('0x10')](_0xa8cd('0xc'),_0x54fa3a,_0x4853cf['error']['message']);return _0x542152(_0x4853cf[_0xa8cd('0x10')][_0xa8cd('0x12')]);}else{logger[_0xa8cd('0xb')](_0xa8cd('0xc'),_0x54fa3a,_0xa8cd('0xf'));_0x542152(_0x4853cf['result'][_0xa8cd('0x12')]);}})[_0xa8cd('0x13')](function(_0xaad366){logger[_0xa8cd('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x54fa3a,_0xaad366);_0x17380f(_0xaad366);});});} \ No newline at end of file +var _0xde5c=['then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xde5c,0x1ad));var _0xcde5=function(_0x128443,_0x2fe025){_0x128443=_0x128443-0x0;var _0x1a4ce1=_0xde5c[_0x128443];return _0x1a4ce1;};'use strict';var _=require('lodash');var util=require(_0xcde5('0x0'));var moment=require(_0xcde5('0x1'));var BPromise=require(_0xcde5('0x2'));var rs=require(_0xcde5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcde5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcde5('0x5'))('rpc');var config=require(_0xcde5('0x6'));var jayson=require(_0xcde5('0x7'));var client=jayson[_0xcde5('0x8')][_0xcde5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x439faf,_0x3a6353,_0x4e14de){return new BPromise(function(_0x3495c7,_0x47961a){return client[_0xcde5('0xa')](_0x439faf,_0x4e14de)[_0xcde5('0xb')](function(_0x3399e9){logger[_0xcde5('0xc')](_0xcde5('0xd'),_0x3a6353,_0xcde5('0xe'));logger[_0xcde5('0xf')](_0xcde5('0x10'),_0x3a6353,'request\x20sent',JSON['stringify'](_0x3399e9));if(_0x3399e9[_0xcde5('0x11')]){if(_0x3399e9['error'][_0xcde5('0x12')]===0x1f4){logger[_0xcde5('0x11')](_0xcde5('0xd'),_0x3a6353,_0x3399e9[_0xcde5('0x11')]['message']);return _0x47961a(_0x3399e9['error'][_0xcde5('0x13')]);}logger['error'](_0xcde5('0xd'),_0x3a6353,_0x3399e9['error'][_0xcde5('0x13')]);return _0x3495c7(_0x3399e9['error'][_0xcde5('0x13')]);}else{logger[_0xcde5('0xc')](_0xcde5('0xd'),_0x3a6353,_0xcde5('0xe'));_0x3495c7(_0x3399e9[_0xcde5('0x14')][_0xcde5('0x13')]);}})[_0xcde5('0x15')](function(_0x292891){logger[_0xcde5('0x11')](_0xcde5('0xd'),_0x3a6353,_0x292891);_0x47961a(_0x292891);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index facaaa8..6766781 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 _0xab25=['put','update','delete','removeSections','exports','multer','path','express','Router','../../config/environment','./userProfile.controller','get','isAuthenticated','describe','/:id','show','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addResources'];(function(_0x2e0c40,_0x32c98f){var _0x47a395=function(_0x4ec28b){while(--_0x4ec28b){_0x2e0c40['push'](_0x2e0c40['shift']());}};_0x47a395(++_0x32c98f);}(_0xab25,0x7d));var _0x5ab2=function(_0x334e97,_0x3fefaa){_0x334e97=_0x334e97-0x0;var _0x42e74d=_0xab25[_0x334e97];return _0x42e74d;};'use strict';var multer=require(_0x5ab2('0x0'));var util=require('util');var path=require(_0x5ab2('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ab2('0x2'));var router=express[_0x5ab2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5ab2('0x4'));var controller=require(_0x5ab2('0x5'));router[_0x5ab2('0x6')]('/',auth[_0x5ab2('0x7')](),controller['index']);router[_0x5ab2('0x6')]('/describe',auth[_0x5ab2('0x7')](),controller[_0x5ab2('0x8')]);router[_0x5ab2('0x6')](_0x5ab2('0x9'),auth[_0x5ab2('0x7')](),controller[_0x5ab2('0xa')]);router['get'](_0x5ab2('0xb'),auth[_0x5ab2('0x7')](),controller[_0x5ab2('0xc')]);router[_0x5ab2('0xd')]('/',auth[_0x5ab2('0x7')](),controller[_0x5ab2('0xe')]);router[_0x5ab2('0xd')](_0x5ab2('0xf'),auth['isAuthenticated'](),controller[_0x5ab2('0x10')]);router['post'](_0x5ab2('0x11'),auth['isAuthenticated'](),controller['addSections']);router[_0x5ab2('0xd')](_0x5ab2('0xb'),auth[_0x5ab2('0x7')](),controller[_0x5ab2('0x12')]);router[_0x5ab2('0x13')]('/:id',auth[_0x5ab2('0x7')](),controller[_0x5ab2('0x14')]);router['delete'](_0x5ab2('0x9'),auth[_0x5ab2('0x7')](),controller['destroy']);router[_0x5ab2('0x15')]('/:id/sections',auth[_0x5ab2('0x7')](),controller[_0x5ab2('0x16')]);router[_0x5ab2('0x15')](_0x5ab2('0xb'),auth[_0x5ab2('0x7')](),controller['removeResources']);module[_0x5ab2('0x17')]=router; \ No newline at end of file +var _0x9647=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','delete','destroy','removeSections','multer','util','path'];(function(_0x3f6ea3,_0xadcd50){var _0x3a0ac2=function(_0x1c2051){while(--_0x1c2051){_0x3f6ea3['push'](_0x3f6ea3['shift']());}};_0x3a0ac2(++_0xadcd50);}(_0x9647,0x1ea));var _0x7964=function(_0x5e32ab,_0x565baa){_0x5e32ab=_0x5e32ab-0x0;var _0x45f6db=_0x9647[_0x5e32ab];return _0x45f6db;};'use strict';var multer=require(_0x7964('0x0'));var util=require(_0x7964('0x1'));var path=require(_0x7964('0x2'));var timeout=require(_0x7964('0x3'));var express=require(_0x7964('0x4'));var router=express[_0x7964('0x5')]();var auth=require(_0x7964('0x6'));var interaction=require(_0x7964('0x7'));var config=require(_0x7964('0x8'));var controller=require(_0x7964('0x9'));router[_0x7964('0xa')]('/',auth[_0x7964('0xb')](),controller[_0x7964('0xc')]);router[_0x7964('0xa')](_0x7964('0xd'),auth[_0x7964('0xb')](),controller[_0x7964('0xe')]);router[_0x7964('0xa')](_0x7964('0xf'),auth[_0x7964('0xb')](),controller[_0x7964('0x10')]);router['get'](_0x7964('0x11'),auth[_0x7964('0xb')](),controller['getResources']);router[_0x7964('0x12')]('/',auth[_0x7964('0xb')](),controller[_0x7964('0x13')]);router[_0x7964('0x12')](_0x7964('0x14'),auth[_0x7964('0xb')](),controller[_0x7964('0x15')]);router[_0x7964('0x12')](_0x7964('0x16'),auth[_0x7964('0xb')](),controller[_0x7964('0x17')]);router[_0x7964('0x12')](_0x7964('0x11'),auth[_0x7964('0xb')](),controller[_0x7964('0x18')]);router[_0x7964('0x19')](_0x7964('0xf'),auth[_0x7964('0xb')](),controller['update']);router[_0x7964('0x1a')](_0x7964('0xf'),auth[_0x7964('0xb')](),controller[_0x7964('0x1b')]);router[_0x7964('0x1a')]('/:id/sections',auth['isAuthenticated'](),controller[_0x7964('0x1c')]);router[_0x7964('0x1a')]('/:id/resources',auth['isAuthenticated'](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 663ab32..446f4fc 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 _0x5334=['exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x3315be,_0x1aacf3){var _0x5aba49=function(_0x293b99){while(--_0x293b99){_0x3315be['push'](_0x3315be['shift']());}};_0x5aba49(++_0x1aacf3);}(_0x5334,0x13f));var _0x4533=function(_0x283ef9,_0xf48013){_0x283ef9=_0x283ef9-0x0;var _0x169e98=_0x5334[_0x283ef9];return _0x169e98;};'use strict';var Sequelize=require(_0x4533('0x0'));module[_0x4533('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4533('0x2')},'crudPermissions':{'type':Sequelize[_0x4533('0x3')],'set':function(_0x23326c){this[_0x4533('0x4')](_0x4533('0x5'),_0x23326c?_0x23326c[_0x4533('0x6')](''):[]);},'get':function(){return this[_0x4533('0x7')]('crudPermissions')?this['getDataValue'](_0x4533('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4533('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0xfa28=['getDataValue','split','exports','STRING','crudPermissions','join'];(function(_0x4fba5e,_0x2f6a46){var _0x15b4e7=function(_0x390e1f){while(--_0x390e1f){_0x4fba5e['push'](_0x4fba5e['shift']());}};_0x15b4e7(++_0x2f6a46);}(_0xfa28,0x98));var _0x8fa2=function(_0x50a004,_0x193d84){_0x50a004=_0x50a004-0x0;var _0x5e9992=_0xfa28[_0x50a004];return _0x5e9992;};'use strict';var Sequelize=require('sequelize');module[_0x8fa2('0x0')]={'name':{'type':Sequelize[_0x8fa2('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x8fa2('0x1')],'set':function(_0x2190dc){this['setDataValue'](_0x8fa2('0x2'),_0x2190dc?_0x2190dc[_0x8fa2('0x3')](''):[]);},'get':function(){return this[_0x8fa2('0x4')]('crudPermissions')?this[_0x8fa2('0x4')](_0x8fa2('0x2'))[_0x8fa2('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x8fa2('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 250c80b..ca276d1 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 _0x3e62=['Tags','color','tag','ThroughTags','value','AnalyticExtractedReport','resourceId','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','projects','contacts','Lists','ListId','CmList','companies','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','telephone','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','QueueCampaigns','users','telephones','Users','Telephones','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','customdashboards','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','templates','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','Reports','AnalyticMetric','html-pdf','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','status','end','offset','limit','set','Content-Range','json','reject','save','update','destroy','sendStatus','error','name','send','model','keys','query','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','key','VIRTUAL','field','merge','options','UserProfile','count','includeAll','include','findAll','then','rows','catch','show','params','rawAttributes','intersection','find','create','body','clone','get','omit','updatedAt','crudPermissions','sequelize','UserProfileSection','each','autoAssociation','UserProfileResource','map','createdAt','userProfileId','Resources','describe','addSections','sectionId','removeSections','transaction','bulkCreate','removeResources','ids','getResources','section','undefined','Unknown\x20section','mergeResources','childModel','Sequelize','ValidationError','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','length','push','all','ignore','union','pick','foreignKey','associatedResources','forEach','reportType','default','DefaultReports','custom','reportId','CustomReports','CmContact','Tag'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x3e62,0x66));var _0x23e6=function(_0x448fc4,_0x2a8ba1){_0x448fc4=_0x448fc4-0x0;var _0x2a1bd9=_0x3e62[_0x448fc4];return _0x2a1bd9;};'use strict';var pdf=require(_0x23e6('0x0'));var emlformat=require(_0x23e6('0x1'));var rimraf=require(_0x23e6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x23e6('0x3'));var BPromise=require(_0x23e6('0x4'));var Mustache=require(_0x23e6('0x5'));var util=require('util');var path=require(_0x23e6('0x6'));var sox=require(_0x23e6('0x7'));var csv=require('to-csv');var ejs=require(_0x23e6('0x8'));var fs=require('fs');var _=require(_0x23e6('0x9'));var squel=require('squel');var crypto=require(_0x23e6('0xa'));var jsforce=require(_0x23e6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x23e6('0xc'));var querystring=require('querystring');var Papa=require(_0x23e6('0xd'));var Redis=require('ioredis');var authService=require(_0x23e6('0xe'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x23e6('0xf'));var logger=require('../../config/logger')(_0x23e6('0x10'));var utils=require(_0x23e6('0x11'));var config=require(_0x23e6('0x12'));var db=require(_0x23e6('0x13'))['db'];config[_0x23e6('0x14')]=_[_0x23e6('0x15')](config['redis'],{'host':_0x23e6('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x23e6('0x14')]));require(_0x23e6('0x17'))[_0x23e6('0x18')](socket);function respondWithStatusCode(_0xed05c7,_0x4595aa){_0x4595aa=_0x4595aa||0xcc;return function(_0x2af30d){if(_0x2af30d){return _0xed05c7['sendStatus'](_0x4595aa);}return _0xed05c7[_0x23e6('0x19')](_0x4595aa)[_0x23e6('0x1a')]();};}function respondWithResult(_0x3e436e,_0x3a4c24){_0x3a4c24=_0x3a4c24||0xc8;return function(_0x3c0248){if(_0x3c0248){return _0x3e436e[_0x23e6('0x19')](_0x3a4c24)['json'](_0x3c0248);}};}function respondWithFilteredResult(_0x26ee62,_0x3b0c39){return function(_0x246972){if(_0x246972){var _0x62173c=_0x246972['count'],_0x34be23=_0x3b0c39[_0x23e6('0x1b')],_0x65b28b=_0x3b0c39[_0x23e6('0x1b')]+_0x3b0c39[_0x23e6('0x1c')],_0x537696;if(_0x65b28b>=_0x62173c){_0x65b28b=_0x62173c;_0x537696=0xc8;}else{_0x537696=0xce;}_0x26ee62[_0x23e6('0x19')](_0x537696);return _0x26ee62[_0x23e6('0x1d')](_0x23e6('0x1e'),_0x34be23+'-'+_0x65b28b+'/'+_0x62173c)[_0x23e6('0x1f')](_0x246972);}return null;};}function patchUpdates(_0x5983f1){return function(_0x981b5c){try{jsonpatch['apply'](_0x981b5c,_0x5983f1,!![]);}catch(_0x480582){return BPromise[_0x23e6('0x20')](_0x480582);}return _0x981b5c[_0x23e6('0x21')]();};}function saveUpdates(_0x5a5db6,_0x49ad31){return function(_0x358949){if(_0x358949){return _0x358949[_0x23e6('0x22')](_0x5a5db6)['then'](function(_0xf49b7){return _0xf49b7;});}return null;};}function removeEntity(_0x36622a,_0x4c8fb3){return function(_0x4a628f){if(_0x4a628f){return _0x4a628f[_0x23e6('0x23')]()['then'](function(){_0x36622a[_0x23e6('0x19')](0xcc)[_0x23e6('0x1a')]();});}};}function handleEntityNotFound(_0x38f573,_0x227d9c){return function(_0x2bc2cb){if(!_0x2bc2cb){_0x38f573[_0x23e6('0x24')](0x194);}return _0x2bc2cb;};}function handleError(_0x56288f,_0x51cb2d){_0x51cb2d=_0x51cb2d||0x1f4;return function(_0x2c1ed5){logger[_0x23e6('0x25')](_0x2c1ed5['stack']);if(_0x2c1ed5['name']){delete _0x2c1ed5[_0x23e6('0x26')];}_0x56288f[_0x23e6('0x19')](_0x51cb2d)[_0x23e6('0x27')](_0x2c1ed5);};}exports['index']=function(_0xc7e38,_0x3655df){var _0x4570ca={},_0x56fb24={},_0x43a56a={'count':0x0,'rows':[]};var _0x36d498=db['UserProfile']['rawAttributes'];_0x56fb24[_0x23e6('0x28')]=_[_0x23e6('0x29')](_0x36d498);_0x56fb24[_0x23e6('0x2a')]=_['keys'](_0xc7e38[_0x23e6('0x2a')]);_0x56fb24[_0x23e6('0x2b')]=_['intersection'](_0x56fb24[_0x23e6('0x28')],_0x56fb24[_0x23e6('0x2a')]);_0x4570ca['attributes']=_['intersection'](_0x56fb24[_0x23e6('0x28')],qs[_0x23e6('0x2c')](_0xc7e38['query'][_0x23e6('0x2c')]));_0x4570ca[_0x23e6('0x2d')]=_0x4570ca['attributes']['length']?_0x4570ca[_0x23e6('0x2d')]:_0x56fb24['model'];if(!_0xc7e38[_0x23e6('0x2a')][_0x23e6('0x2e')](_0x23e6('0x2f'))){_0x4570ca['limit']=qs[_0x23e6('0x1c')](_0xc7e38[_0x23e6('0x2a')][_0x23e6('0x1c')]);_0x4570ca[_0x23e6('0x1b')]=qs[_0x23e6('0x1b')](_0xc7e38[_0x23e6('0x2a')][_0x23e6('0x1b')]);}_0x4570ca[_0x23e6('0x30')]=qs[_0x23e6('0x31')](_0xc7e38[_0x23e6('0x2a')]['sort']);_0x4570ca[_0x23e6('0x32')]=qs['filters'](_['pick'](_0xc7e38['query'],_0x56fb24[_0x23e6('0x2b')]));if(_0xc7e38['query'][_0x23e6('0x33')]){_0x4570ca['where']=_['merge'](_0x4570ca[_0x23e6('0x32')],{'$or':_['map'](_0x36d498,function(_0x2789c3){if(_0x2789c3[_0x23e6('0x34')][_0x23e6('0x35')]!==_0x23e6('0x36')){var _0x34144a={};_0x34144a[_0x2789c3[_0x23e6('0x37')]]={'$like':'%'+_0xc7e38[_0x23e6('0x2a')]['filter']+'%'};return _0x34144a;}})});}_0x4570ca=_[_0x23e6('0x38')]({},_0x4570ca,_0xc7e38[_0x23e6('0x39')]);var _0x19a671={'where':_0x4570ca['where']};return db[_0x23e6('0x3a')][_0x23e6('0x3b')](_0x19a671)['then'](function(_0x551ac0){_0x43a56a[_0x23e6('0x3b')]=_0x551ac0;if(_0xc7e38[_0x23e6('0x2a')][_0x23e6('0x3c')]){_0x4570ca[_0x23e6('0x3d')]=[{'all':!![]}];}return db['UserProfile'][_0x23e6('0x3e')](_0x4570ca);})[_0x23e6('0x3f')](function(_0x14d296){_0x43a56a[_0x23e6('0x40')]=_0x14d296;return _0x43a56a;})[_0x23e6('0x3f')](respondWithFilteredResult(_0x3655df,_0x4570ca))[_0x23e6('0x41')](handleError(_0x3655df,null));};exports[_0x23e6('0x42')]=function(_0x1ebe60,_0x237fc1){var _0x42c6a0={'raw':![],'where':{'id':_0x1ebe60[_0x23e6('0x43')]['id']}},_0x3b0ad1={};_0x3b0ad1[_0x23e6('0x28')]=_[_0x23e6('0x29')](db[_0x23e6('0x3a')][_0x23e6('0x44')]);_0x3b0ad1[_0x23e6('0x2a')]=_[_0x23e6('0x29')](_0x1ebe60['query']);_0x3b0ad1['filters']=_[_0x23e6('0x45')](_0x3b0ad1['model'],_0x3b0ad1[_0x23e6('0x2a')]);_0x42c6a0['attributes']=_[_0x23e6('0x45')](_0x3b0ad1['model'],qs[_0x23e6('0x2c')](_0x1ebe60[_0x23e6('0x2a')]['fields']));_0x42c6a0[_0x23e6('0x2d')]=_0x42c6a0['attributes']['length']?_0x42c6a0[_0x23e6('0x2d')]:_0x3b0ad1[_0x23e6('0x28')];if(_0x1ebe60[_0x23e6('0x2a')]['includeAll']){_0x42c6a0[_0x23e6('0x3d')]=[{'all':!![]}];}_0x42c6a0=_[_0x23e6('0x38')]({},_0x42c6a0,_0x1ebe60[_0x23e6('0x39')]);return db[_0x23e6('0x3a')][_0x23e6('0x46')](_0x42c6a0)['then'](handleEntityNotFound(_0x237fc1,null))[_0x23e6('0x3f')](respondWithResult(_0x237fc1,null))['catch'](handleError(_0x237fc1,null));};exports['create']=function(_0x50dc5c,_0x448104){return db['UserProfile'][_0x23e6('0x47')](_0x50dc5c[_0x23e6('0x48')],{})[_0x23e6('0x3f')](respondWithResult(_0x448104,0xc9))['catch'](handleError(_0x448104,null));};exports[_0x23e6('0x49')]=function(_0x4f96a6,_0x553804){var _0x566c41={'raw':![],'where':{'id':_0x4f96a6['params']['id']}},_0x477bd7={};_0x477bd7[_0x23e6('0x28')]=_[_0x23e6('0x29')](db['UserProfile'][_0x23e6('0x44')]);_0x566c41[_0x23e6('0x2d')]=_[_0x23e6('0x45')](_0x477bd7[_0x23e6('0x28')],qs[_0x23e6('0x2c')](_0x4f96a6[_0x23e6('0x2a')]['fields']));_0x566c41[_0x23e6('0x2d')]=_0x566c41['attributes']['length']?_0x566c41[_0x23e6('0x2d')]:_0x477bd7['model'];if(_0x4f96a6[_0x23e6('0x2a')][_0x23e6('0x3c')]){_0x566c41[_0x23e6('0x3d')]=[{'all':!![]}];}_0x566c41=_['merge']({},_0x566c41,_0x4f96a6['options']);return db[_0x23e6('0x3a')]['find'](_0x566c41)['then'](handleEntityNotFound(_0x553804,null))[_0x23e6('0x3f')](function(_0x50a289){if(_0x50a289){var _0x154406=_0x50a289[_0x23e6('0x4a')]({'plain':!![]});_0x154406=qs[_0x23e6('0x4b')](_0x154406,['id','createdAt',_0x23e6('0x4c'),_0x23e6('0x4d')]);_0x4f96a6['body']=_[_0x23e6('0x4b')](_0x4f96a6[_0x23e6('0x48')],['id','createdAt','updatedAt']);return db[_0x23e6('0x4e')]['transaction'](function(_0x25dc55){return db[_0x23e6('0x3a')][_0x23e6('0x47')](_[_0x23e6('0x38')](_0x154406,_0x4f96a6[_0x23e6('0x48')]),{'include':_0x4f96a6[_0x23e6('0x2a')][_0x23e6('0x3c')]?[{'all':!![]}]:undefined,'transaction':_0x25dc55})['then'](function(_0x5ad8e5){var _0x460c6f=_0x5ad8e5['get']({'plain':!![]});return db[_0x23e6('0x4f')][_0x23e6('0x3e')]({'where':{'userProfileId':_0x4f96a6['params']['id']},'raw':!![]})[_0x23e6('0x3f')](function(_0x5eb2ab){if(_0x5eb2ab){return BPromise[_0x23e6('0x50')](_0x5eb2ab,function(_0x2fc6bc){return new BPromise(function(_0x2ec011,_0x575381){if(_0x2fc6bc[_0x23e6('0x51')]===null||_0x2fc6bc['autoAssociation']===0x1)_0x2ec011(null);return db[_0x23e6('0x52')][_0x23e6('0x3e')]({'where':{'sectionId':_0x2fc6bc['id']},'raw':!![]})[_0x23e6('0x3f')](function(_0xec7422){var _0x10b37c=_[_0x23e6('0x53')](_0xec7422,function(_0x47e81a){return qs[_0x23e6('0x4b')](_0x47e81a,['id',_0x23e6('0x54'),_0x23e6('0x4c'),'sectionId']);});_0x2ec011(_0x10b37c);})[_0x23e6('0x41')](function(_0x30e2e1){_0x575381(_0x30e2e1);});})[_0x23e6('0x3f')](function(_0x4d505c){var _0x1815c2=qs['omit'](_0x2fc6bc,['id',_0x23e6('0x54'),_0x23e6('0x4c')]);_0x1815c2[_0x23e6('0x55')]=_0x460c6f['id'];if(_0x4d505c)_0x1815c2[_0x23e6('0x56')]=_0x4d505c;return _0x1815c2;})['then'](function(_0x8f54fe){return db[_0x23e6('0x4f')][_0x23e6('0x47')](_0x8f54fe,{'include':[{'model':db[_0x23e6('0x52')],'as':'Resources'}],'raw':!![],'transaction':_0x25dc55});});})['then'](function(){return _0x460c6f;});}});});});}})['then'](respondWithResult(_0x553804,0xc9))[_0x23e6('0x41')](handleError(_0x553804,null));};exports[_0x23e6('0x22')]=function(_0x7a69fd,_0x4594b4){if(_0x7a69fd[_0x23e6('0x48')]['id']){delete _0x7a69fd[_0x23e6('0x48')]['id'];}return db[_0x23e6('0x3a')][_0x23e6('0x46')]({'where':{'id':_0x7a69fd[_0x23e6('0x43')]['id']}})[_0x23e6('0x3f')](handleEntityNotFound(_0x4594b4,null))[_0x23e6('0x3f')](saveUpdates(_0x7a69fd[_0x23e6('0x48')],null))[_0x23e6('0x3f')](respondWithResult(_0x4594b4,null))[_0x23e6('0x41')](handleError(_0x4594b4,null));};exports[_0x23e6('0x23')]=function(_0x45556e,_0x33abbb){return db[_0x23e6('0x3a')]['find']({'where':{'id':_0x45556e['params']['id']}})[_0x23e6('0x3f')](handleEntityNotFound(_0x33abbb,null))[_0x23e6('0x3f')](removeEntity(_0x33abbb,null))[_0x23e6('0x41')](handleError(_0x33abbb,null));};exports[_0x23e6('0x57')]=function(_0x17b7cb,_0x49b941){return db[_0x23e6('0x3a')][_0x23e6('0x57')]()[_0x23e6('0x3f')](respondWithResult(_0x49b941,null))[_0x23e6('0x41')](handleError(_0x49b941,null));};exports[_0x23e6('0x58')]=function(_0x563faf,_0x240b2f){var _0x4328ad=_0x563faf[_0x23e6('0x48')];return db[_0x23e6('0x3a')][_0x23e6('0x46')]({'where':{'id':_0x563faf['params']['id']}})[_0x23e6('0x3f')](handleEntityNotFound(_0x240b2f,null))[_0x23e6('0x3f')](function(_0x46e948){if(_0x46e948){return db['sequelize']['transaction'](function(_0xf0ace8){return db[_0x23e6('0x4f')][_0x23e6('0x23')]({'where':{'userProfileId':_0x563faf[_0x23e6('0x43')]['id'],'sectionId':_['map'](_0x4328ad,function(_0x36d043){return _0x36d043[_0x23e6('0x59')];})},'transaction':_0xf0ace8})[_0x23e6('0x3f')](function(){var _0x239e26=_['map'](_0x4328ad,function(_0xaee61c){_0xaee61c[_0x23e6('0x55')]=_0x563faf[_0x23e6('0x43')]['id'];return _0xaee61c;});var _0x277434=[];return BPromise[_0x23e6('0x50')](_0x239e26,function(_0x1290d2){return db[_0x23e6('0x4f')][_0x23e6('0x47')](_0x1290d2,{'include':[{'model':db[_0x23e6('0x52')],'as':_0x23e6('0x56')}],'raw':!![],'transaction':_0xf0ace8})['then'](function(_0x1e5b26){_0x277434['push'](_0x1e5b26[_0x23e6('0x4a')]({'plain':!![]}));});})[_0x23e6('0x3f')](function(){return _0x277434;});});});}})[_0x23e6('0x3f')](function(_0x1e2f61){return _0x1e2f61;})['then'](respondWithResult(_0x240b2f,null))[_0x23e6('0x41')](handleError(_0x240b2f,null));};exports[_0x23e6('0x5a')]=function(_0x511757,_0x38695f){var _0x1a53be;return db[_0x23e6('0x3a')][_0x23e6('0x46')]({'where':{'id':_0x511757[_0x23e6('0x43')]['id']},'attributes':['id',_0x23e6('0x26')]})[_0x23e6('0x3f')](handleEntityNotFound(_0x38695f,null))[_0x23e6('0x3f')](function(_0x32bb62){if(_0x32bb62){_0x1a53be=_0x32bb62;return db[_0x23e6('0x4f')]['destroy']({'where':{'userProfileId':_0x511757[_0x23e6('0x43')]['id'],'sectionId':_0x511757['query']['ids']}});}})[_0x23e6('0x3f')](function(){return _0x1a53be;})['then'](respondWithStatusCode(_0x38695f,null))[_0x23e6('0x41')](handleError(_0x38695f,null));};exports['addResources']=function(_0x2e31b3,_0x358bcd){return db[_0x23e6('0x3a')][_0x23e6('0x46')]({'where':{'id':_0x2e31b3[_0x23e6('0x43')]['id']}})[_0x23e6('0x3f')](handleEntityNotFound(_0x358bcd,null))['then'](function(_0x590d73){if(_0x590d73){return db['sequelize'][_0x23e6('0x5b')](function(_0xb0d9a4){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2e31b3[_0x23e6('0x43')]['id']},'attributes':['id'],'raw':!![]})[_0x23e6('0x3f')](function(_0x291273){if(_0x291273){return db[_0x23e6('0x4f')]['destroy']({'where':{'userProfileId':_0x2e31b3[_0x23e6('0x43')]['id'],'id':_[_0x23e6('0x53')](_0x291273,function(_0x1ce2cb){return _0x1ce2cb['id'];})},'transaction':_0xb0d9a4});}})['then'](function(_0x178993){var _0x49fb33=_[_0x23e6('0x53')](_0x2e31b3[_0x23e6('0x48')],function(_0x15f2b3){_0x15f2b3[_0x23e6('0x55')]=_0x2e31b3[_0x23e6('0x43')]['id'];return _0x15f2b3;});return db[_0x23e6('0x4f')][_0x23e6('0x5c')](_0x49fb33,{'raw':!![],'transaction':_0xb0d9a4});})['then'](function(_0x5a0800){var _0x14a7c2=_['filter'](_[_0x23e6('0x53')](_0x5a0800,function(_0x1ba5ee){return _0x1ba5ee['get']({'plain':!![]});}),{'includeAll':![]});if(_0x14a7c2){return db[_0x23e6('0x4f')]['findAll']({'where':{'userProfileId':_0x2e31b3['params']['id'],'sectionId':_[_0x23e6('0x53')](_0x14a7c2,function(_0x44a3c6){return _0x44a3c6['sectionId'];})},'attributes':['id',_0x23e6('0x59')],'raw':!![]})['then'](function(_0x521d12){var _0x1d0cbe=_['map'](_0x2e31b3[_0x23e6('0x48')],function(_0xa23c2f){_0xa23c2f[_0x23e6('0x55')]=_0x2e31b3[_0x23e6('0x43')]['id'];return _0xa23c2f;});return db['UserProfileResource'][_0x23e6('0x5c')](_0x1d0cbe,{'raw':!![],'transaction':_0xb0d9a4});});}})['catch'](handleError(_0x358bcd,null));});}})[_0x23e6('0x3f')](function(_0x5b65ed){var _0x4b6e83=_[_0x23e6('0x53')](_0x5b65ed,function(_0x27fff6){return _0x27fff6[_0x23e6('0x4a')]({'plain':!![]});});})['then'](respondWithResult(_0x358bcd,null))['catch'](handleError(_0x358bcd,null));};exports[_0x23e6('0x5d')]=function(_0x18fd32,_0x4ca209,_0x21dfd7){return db[_0x23e6('0x3a')][_0x23e6('0x46')]({'where':{'id':_0x18fd32['params']['id']}})['then'](handleEntityNotFound(_0x4ca209,null))['then'](function(_0x39d87e){if(_0x39d87e){return _0x39d87e[_0x23e6('0x5d')](_0x18fd32[_0x23e6('0x2a')][_0x23e6('0x5e')]);}})[_0x23e6('0x3f')](respondWithStatusCode(_0x4ca209,null))[_0x23e6('0x41')](handleError(_0x4ca209,null));};exports[_0x23e6('0x5f')]=function(_0x18ec1f,_0x2f04ae){var _0x5d2d25={'raw':![],'where':{}};var _0x26e0b5={};var _0x3baf3e={'count':0x0,'rows':[]};var _0x5ab572=_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x60')];if(typeof _0x5ab572===_0x23e6('0x61')){throw new db['Sequelize']['ValidationError'](_0x23e6('0x62'));}var _0x3d17ac=_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x63')]||![];var _0x120296=getQueryModels(_0x5ab572,_0x3d17ac);if(typeof _0x120296[_0x23e6('0x64')]===_0x23e6('0x61')){throw new db[(_0x23e6('0x65'))][(_0x23e6('0x66'))](_0x23e6('0x67')+_0x5ab572+'\x27');}var _0x558cdf=[];if(!_[_0x23e6('0x68')](_0x120296[_0x23e6('0x69')])){_0x558cdf=_0x120296[_0x23e6('0x69')];}else{_0x558cdf=[{'name':_0x5ab572}];}return db[_0x23e6('0x3a')][_0x23e6('0x6a')]({'where':{'id':_0x18ec1f[_0x23e6('0x43')]['id']}})[_0x23e6('0x3f')](handleEntityNotFound(_0x2f04ae,null))[_0x23e6('0x3f')](function(_0x31906a){if(_0x31906a){var _0x256797=[];for(var _0x4e9de6=0x0;_0x4e9de6<_0x558cdf[_0x23e6('0x6b')];_0x4e9de6++){_0x256797[_0x23e6('0x6c')](db[_0x23e6('0x4f')][_0x23e6('0x6a')]({'where':{'userProfileId':_0x31906a['id'],'name':_0x558cdf[_0x4e9de6][_0x23e6('0x26')]},'raw':!![]}));}return BPromise[_0x23e6('0x6d')](_0x256797);}})['then'](function(_0x2e6b61){var _0x21f963=_[_0x23e6('0x33')](_0x2e6b61,function(_0x2d4123){return _0x2d4123?_0x2d4123:undefined;});var _0x5eb2f3=_[_0x23e6('0x33')](_0x558cdf,[_0x23e6('0x6e'),!![]]);var _0x183570=_[_0x23e6('0x68')](_0x21f963)&&_['isEmpty'](_0x5eb2f3)?null:_[_0x23e6('0x6f')](_0x5eb2f3,_0x21f963);if(_0x183570){var _0x58a5ce=[];for(var _0x37e900=0x0;_0x37e900<_0x183570[_0x23e6('0x6b')];_0x37e900++){var _0x3f4d8c=_[_0x23e6('0x46')](_0x558cdf,function(_0x21a4b3){return _0x183570[_0x37e900]?_0x21a4b3[_0x23e6('0x26')]===_0x183570[_0x37e900]['name']:null;});if(_0x3f4d8c){if(_0x183570[_0x37e900][_0x23e6('0x6e')]){_0x58a5ce[_0x23e6('0x6c')](getAllResources(_0x120296[_0x23e6('0x64')],_0x183570[_0x37e900]));}else{if(!_0x183570[_0x37e900]['autoAssociation']){_0x58a5ce[_0x23e6('0x6c')](getAllowedResources(_0x3f4d8c,_0x183570[_0x37e900],_0x120296[_0x23e6('0x64')]));}else{if(_0x3f4d8c[_0x23e6('0x28')]){_0x58a5ce['push'](getAllFilteredResources(_0x3f4d8c,_0x183570[_0x37e900]));}}}}}return BPromise[_0x23e6('0x6d')](_0x58a5ce);}else{return null;}})['then'](function(_0x233980){var _0x4bc36a=_0x233980;var _0x2cc5b8=null;if(_0x4bc36a){_0x2cc5b8=_0x4bc36a[_0x23e6('0x6b')]===0x1?_0x4bc36a[0x0]:null;}if(_0x2cc5b8||_0x4bc36a){var _0xa6295e=db[_0x120296['childModel']][_0x23e6('0x44')];_0x26e0b5[_0x23e6('0x28')]=_['keys'](_0xa6295e);_0x26e0b5[_0x23e6('0x2a')]=_[_0x23e6('0x29')](_0x18ec1f[_0x23e6('0x2a')]);_0x26e0b5['filters']=_[_0x23e6('0x45')](_0x26e0b5[_0x23e6('0x28')],_0x26e0b5[_0x23e6('0x2a')]);_0x5d2d25[_0x23e6('0x2d')]=_['intersection'](_0x26e0b5[_0x23e6('0x28')],qs[_0x23e6('0x2c')](_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x2c')]));_0x5d2d25[_0x23e6('0x2d')]=_0x5d2d25[_0x23e6('0x2d')]['length']?_0x5d2d25[_0x23e6('0x2d')]:_0x26e0b5['model'];if(!_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x2e')]('nolimit')){_0x5d2d25[_0x23e6('0x1c')]=qs[_0x23e6('0x1c')](_0x18ec1f['query'][_0x23e6('0x1c')]);_0x5d2d25[_0x23e6('0x1b')]=qs[_0x23e6('0x1b')](_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x1b')]);}_0x5d2d25[_0x23e6('0x30')]=qs[_0x23e6('0x31')](_0x18ec1f[_0x23e6('0x2a')]['sort']);_0x5d2d25['where']=qs['filters'](_[_0x23e6('0x70')](_0x18ec1f[_0x23e6('0x2a')],_0x26e0b5[_0x23e6('0x2b')]));if(_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x33')]){_0x5d2d25['where']=_[_0x23e6('0x38')](_0x5d2d25[_0x23e6('0x32')],{'$or':_[_0x23e6('0x53')](_0xa6295e,function(_0x1e7d03){if(_0x1e7d03['type']['key']!==_0x23e6('0x36')){var _0x172546={};_0x172546[_0x1e7d03[_0x23e6('0x37')]]={'$like':'%'+_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x33')]+'%'};return _0x172546;}})});}var _0x4b49b4=[];if(_0x2cc5b8){var _0x1cd741=_[_0x23e6('0x46')](_0x558cdf,['name',_0x2cc5b8[_0x23e6('0x26')]]);if(_0x1cd741[_0x23e6('0x37')]){var _0x228484={};if(_0x120296[_0x23e6('0x64')]==='AnalyticExtractedReport'){_0x228484[_0x1cd741[_0x23e6('0x71')]]=_['map'](_0x2cc5b8[_0x23e6('0x72')],'id');}else{_0x228484[_0x1cd741['foreignKey']]=_0x2cc5b8[_0x23e6('0x72')];}_0x4b49b4[_0x23e6('0x6c')](_0x228484);}else{_0x5d2d25['where']['id']=_0x2cc5b8[_0x23e6('0x72')];}}else{for(var _0x30321f=0x0;_0x30321f<_0x4bc36a['length'];_0x30321f++){var _0x1cd741=_[_0x23e6('0x46')](_0x558cdf,[_0x23e6('0x26'),_0x4bc36a[_0x30321f][_0x23e6('0x26')]]);if(_0x1cd741[_0x23e6('0x37')]){var _0x228484={};_0x228484[_0x1cd741[_0x23e6('0x71')]]=_0x4bc36a[_0x30321f][_0x23e6('0x72')];_0x4b49b4[_0x23e6('0x6c')](_0x228484);}else{if(!_0x5d2d25[_0x23e6('0x32')]['id'])_0x5d2d25[_0x23e6('0x32')]['id']=[];_0x4bc36a[_0x30321f][_0x23e6('0x72')][_0x23e6('0x73')](function(_0x944bd2){_0x5d2d25[_0x23e6('0x32')]['id']['push'](_0x944bd2);});}}}if(!_[_0x23e6('0x68')](_0x4b49b4)){_0x5d2d25['where']=_[_0x23e6('0x38')](_0x5d2d25[_0x23e6('0x32')],{'$and':{'$or':_0x4b49b4}});}_0x5d2d25=_[_0x23e6('0x38')]({},_0x5d2d25,_0x18ec1f[_0x23e6('0x39')]);if(_0x2cc5b8&&!_0x2cc5b8['autoAssociation']&&_0x120296[_0x23e6('0x64')]==='AnalyticExtractedReport'){if(_0x18ec1f['query'][_0x23e6('0x3c')]){_0x5d2d25['include']=[{'all':!![]}];}return db[_0x120296[_0x23e6('0x64')]][_0x23e6('0x3e')](_0x5d2d25)[_0x23e6('0x3f')](function(_0x636595){var _0x57c3fe=[];_0x636595[_0x23e6('0x73')](function(_0x4922e5){var _0x1f579b;switch(_0x4922e5[_0x23e6('0x74')]){case _0x23e6('0x75'):_0x1f579b=_[_0x23e6('0x46')](_0x2cc5b8[_0x23e6('0x72')],function(_0x168ae2){return _0x168ae2['id']===_0x4922e5['reportId']&&_0x168ae2[_0x23e6('0x34')]===_0x23e6('0x76');});break;case _0x23e6('0x77'):_0x1f579b=_[_0x23e6('0x46')](_0x2cc5b8[_0x23e6('0x72')],function(_0x5310a5){return _0x5310a5['id']===_0x4922e5[_0x23e6('0x78')]&&_0x5310a5[_0x23e6('0x34')]===_0x23e6('0x79');});break;}if(_0x1f579b)_0x57c3fe[_0x23e6('0x6c')](_0x4922e5);});_0x3baf3e[_0x23e6('0x3b')]=_0x57c3fe[_0x23e6('0x6b')];_0x3baf3e[_0x23e6('0x40')]=_0x57c3fe;return _0x3baf3e;});}else{return db[_0x120296[_0x23e6('0x64')]][_0x23e6('0x3b')]({'where':_0x5d2d25[_0x23e6('0x32')]})[_0x23e6('0x3f')](function(_0x3caa15){_0x3baf3e[_0x23e6('0x3b')]=_0x3caa15;if(_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x3c')]){if(_0x120296[_0x23e6('0x64')]===_0x23e6('0x7a')){_0x5d2d25[_0x23e6('0x3d')]=[{'model':db[_0x23e6('0x7b')],'as':_0x23e6('0x7c'),'attributes':['id',_0x23e6('0x26'),_0x23e6('0x7d')],'required':_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x7e')]?!![]:![]},{'model':db[_0x23e6('0x7b')],'as':_0x23e6('0x7f'),'attributes':['id','name',_0x23e6('0x7d')],'through':_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x7e')]?{'attributes':[],'where':{'TagId':_0x18ec1f[_0x23e6('0x2a')][_0x23e6('0x7e')]||undefined}}:{},'required':_0x18ec1f[_0x23e6('0x2a')]['tag']?!![]:![]}];}else{_0x5d2d25[_0x23e6('0x3d')]=[{'all':!![]}];}}return db[_0x120296[_0x23e6('0x64')]][_0x23e6('0x3e')](_0x5d2d25);})[_0x23e6('0x3f')](function(_0x3aabdb){_0x3baf3e[_0x23e6('0x40')]=_0x3aabdb;return _0x3baf3e;});}}else{return _0x3baf3e;}})[_0x23e6('0x3f')](respondWithFilteredResult(_0x2f04ae,_0x5d2d25))['catch'](handleError(_0x2f04ae,null));};function getAllResources(_0x2fbd89,_0x42b4c3){return new BPromise(function(_0x5058f7,_0x5e693c){if(_0x42b4c3){var _0x35666d=_0x42b4c3[_0x23e6('0x33')]?{[_0x42b4c3[_0x23e6('0x33')][_0x23e6('0x37')]]:_0x42b4c3[_0x23e6('0x33')][_0x23e6('0x80')]}:undefined;return db[_0x2fbd89]['findAll']({'where':_0x35666d,'raw':!![]})[_0x23e6('0x3f')](function(_0x2fd56f){_0x42b4c3[_0x23e6('0x72')]=_[_0x23e6('0x53')](_0x2fd56f,'id');_0x5058f7(_0x42b4c3);})[_0x23e6('0x41')](function(_0x3bd21a){_0x5e693c(_0x3bd21a);});}else{_0x5058f7(null);}});}function getAllFilteredResources(_0x30b790,_0x4edb3a){return new BPromise(function(_0x5e9a58,_0x4c7f0f){var _0x34d90a=_0x30b790['filter']?{[_0x30b790[_0x23e6('0x33')][_0x23e6('0x37')]]:_0x30b790['filter'][_0x23e6('0x80')]}:undefined;return db[_0x30b790[_0x23e6('0x28')]]['findAll']({'where':_0x34d90a,'raw':!![]})[_0x23e6('0x3f')](function(_0x5ab590){_0x4edb3a[_0x23e6('0x72')]=_[_0x23e6('0x53')](_0x5ab590,function(_0x2c2777){return _0x2c2777[_0x23e6('0x26')];});_0x5e9a58(_0x4edb3a);})[_0x23e6('0x41')](function(_0x182e65){_0x4c7f0f(_0x182e65);});});}function getAllowedResources(_0x33e833,_0x48b0ce,_0x3efc68){return new BPromise(function(_0x15a71a,_0x5b9422){if(_0x48b0ce){return db['UserProfileResource'][_0x23e6('0x3e')]({'where':{'sectionId':_0x48b0ce['id']},'raw':!![]})[_0x23e6('0x3f')](function(_0x8867f0){if(_0x33e833[_0x23e6('0x37')]&&_0x33e833['field']!=='id'){_0x48b0ce[_0x23e6('0x72')]=_[_0x23e6('0x53')](_0x8867f0,function(_0xc48f92){return _0xc48f92[_0x33e833[_0x23e6('0x37')]];});}else{if(_0x3efc68===_0x23e6('0x81')){_0x48b0ce[_0x23e6('0x72')]=_[_0x23e6('0x53')](_0x8867f0,function(_0x3c334a){return{'id':_0x3c334a['resourceId'],'type':_0x3c334a[_0x23e6('0x34')]};});}else{_0x48b0ce['associatedResources']=_[_0x23e6('0x53')](_0x8867f0,function(_0x1c8bd8){return _0x1c8bd8[_0x23e6('0x82')];});}}_0x15a71a(_0x48b0ce);})[_0x23e6('0x41')](function(_0xa33b32){_0x5b9422(_0xa33b32);});}else{_0x15a71a(null);}});}function getQueryModels(_0x3da5a9,_0x46c2b9){var _0x73d00e=_0x3da5a9['toLowerCase']();var _0x1892c1={'childModel':undefined,'parentSections':[]};switch(_0x73d00e){case _0x23e6('0x83'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x84');break;case _0x23e6('0x85'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x86');break;case _0x23e6('0x87'):_0x1892c1[_0x23e6('0x64')]='SquareRecording';_0x1892c1['parentSections']=[{'name':'SquareProjects','field':_0x23e6('0x26'),'foreignKey':'projectName'}];break;case _0x23e6('0x88'):_0x1892c1[_0x23e6('0x64')]='JscriptyProject';break;case _0x23e6('0x89'):_0x1892c1['childModel']=_0x23e6('0x7a');_0x1892c1[_0x23e6('0x69')]=[{'name':_0x23e6('0x8a'),'field':'id','foreignKey':_0x23e6('0x8b')}];break;case'lists':_0x1892c1['childModel']=_0x23e6('0x8c');break;case _0x23e6('0x8d'):_0x1892c1[_0x23e6('0x64')]='CmCompany';break;case _0x23e6('0x8e'):_0x1892c1['childModel']=_0x23e6('0x8f');break;case'chatqueues':_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x90');break;case _0x23e6('0x91'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x92');break;case'faxqueues':_0x1892c1['childModel']=_0x23e6('0x93');break;case _0x23e6('0x94'):_0x1892c1['childModel']=_0x23e6('0x95');break;case _0x23e6('0x96'):case _0x23e6('0x97'):case _0x23e6('0x98'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x99');break;case _0x23e6('0x9a'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x9b');break;case _0x23e6('0x9c'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x9d');break;case _0x23e6('0x9e'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x9f');_0x1892c1[_0x23e6('0x69')]=[{'name':_0x23e6('0xa0'),'field':_0x23e6('0x26'),'foreignKey':_0x23e6('0xa1'),'model':_0x23e6('0xa2'),'filter':{'field':_0x23e6('0xa3'),'value':[_0x23e6('0xa4')]}},{'name':'Telephones','field':_0x23e6('0x26'),'foreignKey':_0x23e6('0xa1'),'model':'User','filter':{'field':_0x23e6('0xa3'),'value':[_0x23e6('0xa5')]}},{'name':_0x23e6('0xa6'),'field':_0x23e6('0x26'),'foreignKey':_0x23e6('0xa7'),'model':_0x23e6('0xa8'),'filter':{'field':_0x23e6('0x34'),'value':[_0x23e6('0xa9')]}},{'name':'QueueCampaigns','field':_0x23e6('0x26'),'foreignKey':_0x23e6('0xa7'),'model':_0x23e6('0xa8'),'filter':{'field':_0x23e6('0x34'),'value':[_0x23e6('0xaa')]}}];break;case _0x23e6('0xab'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xac');break;case _0x23e6('0xad'):_0x1892c1['childModel']=_0x23e6('0xae');break;case _0x23e6('0xaf'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xb0');break;case _0x23e6('0xb1'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xb2');break;case _0x23e6('0xb3'):_0x1892c1[_0x23e6('0x64')]='MailQueue';break;case _0x23e6('0xb4'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xb5');break;case _0x23e6('0xb6'):_0x1892c1[_0x23e6('0x64')]='MailSubstatus';break;case _0x23e6('0xb7'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xb8');break;case'openchannelaccounts':_0x1892c1[_0x23e6('0x64')]='OpenchannelAccount';break;case'smsqueues':_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xb9');break;case _0x23e6('0xba'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xbb');break;case _0x23e6('0xbc'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xbd');break;case _0x23e6('0xbe'):case'queuecampaigns':_0x1892c1['childModel']=_0x23e6('0xa8');if(_0x46c2b9){_0x1892c1[_0x23e6('0x69')]=[{'name':_0x23e6('0xa6')},{'name':_0x23e6('0xbf')}];}break;case _0x23e6('0xc0'):case'agents':case _0x23e6('0xc1'):_0x1892c1[_0x23e6('0x64')]='User';if(_0x46c2b9){_0x1892c1[_0x23e6('0x69')]=[{'name':_0x23e6('0xc2'),'filter':{'field':_0x23e6('0xa3'),'value':['admin','user']},'ignore':!![]},{'name':_0x23e6('0xa0')},{'name':_0x23e6('0xc3')}];}break;case'zendeskaccounts':_0x1892c1[_0x23e6('0x64')]='ZendeskAccount';break;case _0x23e6('0xc4'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xc5');break;case _0x23e6('0xc6'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xc7');break;case _0x23e6('0xc8'):_0x1892c1['childModel']=_0x23e6('0xc9');break;case'deskaccounts':_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xca');break;case'zohoaccounts':_0x1892c1['childModel']=_0x23e6('0xcb');break;case _0x23e6('0xcc'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xa2');break;case _0x23e6('0xcd'):_0x1892c1['childModel']=_0x23e6('0xce');break;case _0x23e6('0xcf'):_0x1892c1[_0x23e6('0x64')]='Disposition';break;case _0x23e6('0xd0'):_0x1892c1[_0x23e6('0x64')]='Dashboard';break;case'intervals':_0x1892c1['childModel']=_0x23e6('0xd1');break;case _0x23e6('0xd2'):_0x1892c1['childModel']=_0x23e6('0xd3');break;case _0x23e6('0xd4'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xd5');break;case'sounds':_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xd6');break;case _0x23e6('0xd7'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0x7b');break;case _0x23e6('0xd8'):_0x1892c1['childModel']='Template';break;case _0x23e6('0xd9'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xda');break;case _0x23e6('0xdb'):_0x1892c1[_0x23e6('0x64')]='Trunk';break;case _0x23e6('0xdc'):_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xdd');break;case _0x23e6('0xde'):_0x1892c1['childModel']=_0x23e6('0xdf');break;case'extractedreports':_0x1892c1[_0x23e6('0x64')]='AnalyticExtractedReport';_0x1892c1[_0x23e6('0x69')]=[{'name':_0x23e6('0xe0'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x1892c1[_0x23e6('0x64')]=_0x23e6('0xe1');break;default:return _0x1892c1;}return _0x1892c1;} \ No newline at end of file +var _0x687d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','UserProfile','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','type','field','options','includeAll','include','findAll','rows','catch','find','create','clone','params','length','omit','updatedAt','crudPermissions','createdAt','sequelize','transaction','get','each','autoAssociation','UserProfileResource','userProfileId','Resources','body','describe','addSections','sectionId','UserProfileSection','push','removeSections','ids','addResources','bulkCreate','filter','removeResources','getResources','section','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','isEmpty','parentSections','findOne','all','ignore','key','VIRTUAL','AnalyticExtractedReport','foreignKey','associatedResources','forEach','reportType','default','custom','reportId','CustomReports','CmContact','Tags','tag','ThroughTags','color','value','resourceId','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','projects','contacts','Lists','ListId','lists','CmList','companies','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueue','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','Team','voicequeues','VoiceQueues','users','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','Trigger','Trunk','Variable','plugins','extractedreports','Reports','AnalyticMetric','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','crypto','jsforce','to-csv','querystring'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x687d,0xdc));var _0xd687=function(_0x356c85,_0x22b9c7){_0x356c85=_0x356c85-0x0;var _0x4d6fa1=_0x687d[_0x356c85];return _0x4d6fa1;};'use strict';var pdf=require(_0xd687('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd687('0x1'));var zipdir=require(_0xd687('0x2'));var jsonpatch=require(_0xd687('0x3'));var rp=require(_0xd687('0x4'));var moment=require('moment');var BPromise=require(_0xd687('0x5'));var Mustache=require(_0xd687('0x6'));var util=require(_0xd687('0x7'));var path=require('path');var sox=require(_0xd687('0x8'));var csv=require('to-csv');var ejs=require(_0xd687('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd687('0xa'));var jsforce=require(_0xd687('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd687('0xc'));var querystring=require(_0xd687('0xd'));var Papa=require(_0xd687('0xe'));var Redis=require(_0xd687('0xf'));var authService=require(_0xd687('0x10'));var qs=require(_0xd687('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd687('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xd687('0x13'));var db=require(_0xd687('0x14'))['db'];config[_0xd687('0x15')]=_[_0xd687('0x16')](config['redis'],{'host':_0xd687('0x17'),'port':0x18eb});var socket=require(_0xd687('0x18'))(new Redis(config[_0xd687('0x15')]));require(_0xd687('0x19'))[_0xd687('0x1a')](socket);function respondWithStatusCode(_0x1d908e,_0x28f5f7){_0x28f5f7=_0x28f5f7||0xcc;return function(_0x3c205f){if(_0x3c205f){return _0x1d908e[_0xd687('0x1b')](_0x28f5f7);}return _0x1d908e['status'](_0x28f5f7)[_0xd687('0x1c')]();};}function respondWithResult(_0x478310,_0x4b138d){_0x4b138d=_0x4b138d||0xc8;return function(_0x265c45){if(_0x265c45){return _0x478310[_0xd687('0x1d')](_0x4b138d)[_0xd687('0x1e')](_0x265c45);}};}function respondWithFilteredResult(_0x1df816,_0x2f552c){return function(_0x35b9fe){if(_0x35b9fe){var _0x21186f=_0x35b9fe[_0xd687('0x1f')],_0xcece58=_0x2f552c['offset'],_0x7db91e=_0x2f552c['offset']+_0x2f552c[_0xd687('0x20')],_0x2c5a65;if(_0x7db91e>=_0x21186f){_0x7db91e=_0x21186f;_0x2c5a65=0xc8;}else{_0x2c5a65=0xce;}_0x1df816[_0xd687('0x1d')](_0x2c5a65);return _0x1df816[_0xd687('0x21')]('Content-Range',_0xcece58+'-'+_0x7db91e+'/'+_0x21186f)[_0xd687('0x1e')](_0x35b9fe);}return null;};}function patchUpdates(_0x175c3d){return function(_0x4a7400){try{jsonpatch[_0xd687('0x22')](_0x4a7400,_0x175c3d,!![]);}catch(_0x4368f5){return BPromise[_0xd687('0x23')](_0x4368f5);}return _0x4a7400[_0xd687('0x24')]();};}function saveUpdates(_0x25aa01,_0x271591){return function(_0x8c49c2){if(_0x8c49c2){return _0x8c49c2[_0xd687('0x25')](_0x25aa01)[_0xd687('0x26')](function(_0x34fa48){return _0x34fa48;});}return null;};}function removeEntity(_0xd8c8bf,_0x3d676a){return function(_0xd4c6e7){if(_0xd4c6e7){return _0xd4c6e7[_0xd687('0x27')]()[_0xd687('0x26')](function(){_0xd8c8bf[_0xd687('0x1d')](0xcc)[_0xd687('0x1c')]();});}};}function handleEntityNotFound(_0xe11a4,_0x4b380d){return function(_0x12c9bf){if(!_0x12c9bf){_0xe11a4[_0xd687('0x1b')](0x194);}return _0x12c9bf;};}function handleError(_0x1f42bc,_0x2b1646){_0x2b1646=_0x2b1646||0x1f4;return function(_0x1e3ec1){logger['error'](_0x1e3ec1[_0xd687('0x28')]);if(_0x1e3ec1[_0xd687('0x29')]){delete _0x1e3ec1['name'];}_0x1f42bc[_0xd687('0x1d')](_0x2b1646)[_0xd687('0x2a')](_0x1e3ec1);};}exports[_0xd687('0x2b')]=function(_0x353d97,_0xe76348){var _0x5b7698={},_0x52bb11={},_0x325d41={'count':0x0,'rows':[]};var _0xc35cbb=db[_0xd687('0x2c')][_0xd687('0x2d')];_0x52bb11[_0xd687('0x2e')]=_[_0xd687('0x2f')](_0xc35cbb);_0x52bb11['query']=_['keys'](_0x353d97[_0xd687('0x30')]);_0x52bb11[_0xd687('0x31')]=_[_0xd687('0x32')](_0x52bb11[_0xd687('0x2e')],_0x52bb11['query']);_0x5b7698[_0xd687('0x33')]=_[_0xd687('0x32')](_0x52bb11[_0xd687('0x2e')],qs[_0xd687('0x34')](_0x353d97[_0xd687('0x30')][_0xd687('0x34')]));_0x5b7698[_0xd687('0x33')]=_0x5b7698['attributes']['length']?_0x5b7698['attributes']:_0x52bb11[_0xd687('0x2e')];if(!_0x353d97[_0xd687('0x30')][_0xd687('0x35')](_0xd687('0x36'))){_0x5b7698['limit']=qs[_0xd687('0x20')](_0x353d97[_0xd687('0x30')][_0xd687('0x20')]);_0x5b7698[_0xd687('0x37')]=qs['offset'](_0x353d97[_0xd687('0x30')][_0xd687('0x37')]);}_0x5b7698[_0xd687('0x38')]=qs[_0xd687('0x39')](_0x353d97[_0xd687('0x30')][_0xd687('0x39')]);_0x5b7698[_0xd687('0x3a')]=qs[_0xd687('0x31')](_[_0xd687('0x3b')](_0x353d97[_0xd687('0x30')],_0x52bb11[_0xd687('0x31')]));if(_0x353d97[_0xd687('0x30')]['filter']){_0x5b7698[_0xd687('0x3a')]=_[_0xd687('0x3c')](_0x5b7698[_0xd687('0x3a')],{'$or':_[_0xd687('0x3d')](_0xc35cbb,function(_0x548168){if(_0x548168[_0xd687('0x3e')]['key']!=='VIRTUAL'){var _0x362e99={};_0x362e99[_0x548168[_0xd687('0x3f')]]={'$like':'%'+_0x353d97[_0xd687('0x30')]['filter']+'%'};return _0x362e99;}})});}_0x5b7698=_[_0xd687('0x3c')]({},_0x5b7698,_0x353d97[_0xd687('0x40')]);var _0x449cca={'where':_0x5b7698[_0xd687('0x3a')]};return db['UserProfile']['count'](_0x449cca)[_0xd687('0x26')](function(_0x678dcd){_0x325d41['count']=_0x678dcd;if(_0x353d97[_0xd687('0x30')][_0xd687('0x41')]){_0x5b7698[_0xd687('0x42')]=[{'all':!![]}];}return db[_0xd687('0x2c')][_0xd687('0x43')](_0x5b7698);})[_0xd687('0x26')](function(_0x44de8c){_0x325d41[_0xd687('0x44')]=_0x44de8c;return _0x325d41;})[_0xd687('0x26')](respondWithFilteredResult(_0xe76348,_0x5b7698))[_0xd687('0x45')](handleError(_0xe76348,null));};exports['show']=function(_0x48397d,_0x4f3d61){var _0x31b9b7={'raw':![],'where':{'id':_0x48397d['params']['id']}},_0x2e1c75={};_0x2e1c75[_0xd687('0x2e')]=_[_0xd687('0x2f')](db[_0xd687('0x2c')]['rawAttributes']);_0x2e1c75['query']=_[_0xd687('0x2f')](_0x48397d[_0xd687('0x30')]);_0x2e1c75[_0xd687('0x31')]=_['intersection'](_0x2e1c75[_0xd687('0x2e')],_0x2e1c75['query']);_0x31b9b7[_0xd687('0x33')]=_[_0xd687('0x32')](_0x2e1c75['model'],qs[_0xd687('0x34')](_0x48397d['query'][_0xd687('0x34')]));_0x31b9b7[_0xd687('0x33')]=_0x31b9b7[_0xd687('0x33')]['length']?_0x31b9b7[_0xd687('0x33')]:_0x2e1c75[_0xd687('0x2e')];if(_0x48397d[_0xd687('0x30')][_0xd687('0x41')]){_0x31b9b7[_0xd687('0x42')]=[{'all':!![]}];}_0x31b9b7=_['merge']({},_0x31b9b7,_0x48397d[_0xd687('0x40')]);return db[_0xd687('0x2c')][_0xd687('0x46')](_0x31b9b7)[_0xd687('0x26')](handleEntityNotFound(_0x4f3d61,null))['then'](respondWithResult(_0x4f3d61,null))[_0xd687('0x45')](handleError(_0x4f3d61,null));};exports['create']=function(_0x40618d,_0xd5d9c1){return db['UserProfile'][_0xd687('0x47')](_0x40618d['body'],{})[_0xd687('0x26')](respondWithResult(_0xd5d9c1,0xc9))[_0xd687('0x45')](handleError(_0xd5d9c1,null));};exports[_0xd687('0x48')]=function(_0x1e2a72,_0x60378f){var _0x554950={'raw':![],'where':{'id':_0x1e2a72[_0xd687('0x49')]['id']}},_0x2f5c86={};_0x2f5c86[_0xd687('0x2e')]=_[_0xd687('0x2f')](db[_0xd687('0x2c')][_0xd687('0x2d')]);_0x554950['attributes']=_[_0xd687('0x32')](_0x2f5c86['model'],qs[_0xd687('0x34')](_0x1e2a72[_0xd687('0x30')][_0xd687('0x34')]));_0x554950[_0xd687('0x33')]=_0x554950[_0xd687('0x33')][_0xd687('0x4a')]?_0x554950[_0xd687('0x33')]:_0x2f5c86['model'];if(_0x1e2a72[_0xd687('0x30')][_0xd687('0x41')]){_0x554950[_0xd687('0x42')]=[{'all':!![]}];}_0x554950=_[_0xd687('0x3c')]({},_0x554950,_0x1e2a72[_0xd687('0x40')]);return db[_0xd687('0x2c')][_0xd687('0x46')](_0x554950)[_0xd687('0x26')](handleEntityNotFound(_0x60378f,null))['then'](function(_0x2a2313){if(_0x2a2313){var _0xada3f4=_0x2a2313['get']({'plain':!![]});_0xada3f4=qs[_0xd687('0x4b')](_0xada3f4,['id','createdAt',_0xd687('0x4c'),_0xd687('0x4d')]);_0x1e2a72['body']=_[_0xd687('0x4b')](_0x1e2a72['body'],['id',_0xd687('0x4e'),_0xd687('0x4c')]);return db[_0xd687('0x4f')][_0xd687('0x50')](function(_0x2aa52f){return db['UserProfile'][_0xd687('0x47')](_[_0xd687('0x3c')](_0xada3f4,_0x1e2a72['body']),{'include':_0x1e2a72[_0xd687('0x30')][_0xd687('0x41')]?[{'all':!![]}]:undefined,'transaction':_0x2aa52f})[_0xd687('0x26')](function(_0x48fe76){var _0x465830=_0x48fe76[_0xd687('0x51')]({'plain':!![]});return db['UserProfileSection'][_0xd687('0x43')]({'where':{'userProfileId':_0x1e2a72[_0xd687('0x49')]['id']},'raw':!![]})[_0xd687('0x26')](function(_0x290a2f){if(_0x290a2f){return BPromise[_0xd687('0x52')](_0x290a2f,function(_0x3bda6c){return new BPromise(function(_0x29d1ec,_0x2059b2){if(_0x3bda6c[_0xd687('0x53')]===null||_0x3bda6c[_0xd687('0x53')]===0x1)_0x29d1ec(null);return db[_0xd687('0x54')][_0xd687('0x43')]({'where':{'sectionId':_0x3bda6c['id']},'raw':!![]})['then'](function(_0x281867){var _0x1d4a30=_[_0xd687('0x3d')](_0x281867,function(_0x38c4c4){return qs[_0xd687('0x4b')](_0x38c4c4,['id',_0xd687('0x4e'),'updatedAt','sectionId']);});_0x29d1ec(_0x1d4a30);})[_0xd687('0x45')](function(_0x4a5b6a){_0x2059b2(_0x4a5b6a);});})[_0xd687('0x26')](function(_0x2847c9){var _0x3d4c0b=qs[_0xd687('0x4b')](_0x3bda6c,['id','createdAt',_0xd687('0x4c')]);_0x3d4c0b[_0xd687('0x55')]=_0x465830['id'];if(_0x2847c9)_0x3d4c0b['Resources']=_0x2847c9;return _0x3d4c0b;})[_0xd687('0x26')](function(_0x27852d){return db['UserProfileSection']['create'](_0x27852d,{'include':[{'model':db[_0xd687('0x54')],'as':_0xd687('0x56')}],'raw':!![],'transaction':_0x2aa52f});});})[_0xd687('0x26')](function(){return _0x465830;});}});});});}})[_0xd687('0x26')](respondWithResult(_0x60378f,0xc9))[_0xd687('0x45')](handleError(_0x60378f,null));};exports['update']=function(_0x33b599,_0x1bedd7){if(_0x33b599[_0xd687('0x57')]['id']){delete _0x33b599[_0xd687('0x57')]['id'];}return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x33b599['params']['id']}})['then'](handleEntityNotFound(_0x1bedd7,null))[_0xd687('0x26')](saveUpdates(_0x33b599[_0xd687('0x57')],null))[_0xd687('0x26')](respondWithResult(_0x1bedd7,null))[_0xd687('0x45')](handleError(_0x1bedd7,null));};exports[_0xd687('0x27')]=function(_0x3ba65d,_0x5b7659){return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x3ba65d[_0xd687('0x49')]['id']}})[_0xd687('0x26')](handleEntityNotFound(_0x5b7659,null))[_0xd687('0x26')](removeEntity(_0x5b7659,null))['catch'](handleError(_0x5b7659,null));};exports[_0xd687('0x58')]=function(_0x52da76,_0x2b11a2){return db['UserProfile'][_0xd687('0x58')]()[_0xd687('0x26')](respondWithResult(_0x2b11a2,null))[_0xd687('0x45')](handleError(_0x2b11a2,null));};exports[_0xd687('0x59')]=function(_0x389685,_0x119437){var _0x5286c8=_0x389685[_0xd687('0x57')];return db[_0xd687('0x2c')]['find']({'where':{'id':_0x389685['params']['id']}})['then'](handleEntityNotFound(_0x119437,null))[_0xd687('0x26')](function(_0x25d47a){if(_0x25d47a){return db[_0xd687('0x4f')]['transaction'](function(_0x46cf9c){return db['UserProfileSection'][_0xd687('0x27')]({'where':{'userProfileId':_0x389685[_0xd687('0x49')]['id'],'sectionId':_[_0xd687('0x3d')](_0x5286c8,function(_0x487f11){return _0x487f11[_0xd687('0x5a')];})},'transaction':_0x46cf9c})[_0xd687('0x26')](function(){var _0x458386=_['map'](_0x5286c8,function(_0x42398f){_0x42398f[_0xd687('0x55')]=_0x389685[_0xd687('0x49')]['id'];return _0x42398f;});var _0x711212=[];return BPromise[_0xd687('0x52')](_0x458386,function(_0xb5df8d){return db[_0xd687('0x5b')][_0xd687('0x47')](_0xb5df8d,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x46cf9c})[_0xd687('0x26')](function(_0x1d0be8){_0x711212[_0xd687('0x5c')](_0x1d0be8[_0xd687('0x51')]({'plain':!![]}));});})[_0xd687('0x26')](function(){return _0x711212;});});});}})[_0xd687('0x26')](function(_0x5253d4){return _0x5253d4;})[_0xd687('0x26')](respondWithResult(_0x119437,null))['catch'](handleError(_0x119437,null));};exports[_0xd687('0x5d')]=function(_0x414c14,_0x319f71){var _0x220f8a;return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x414c14['params']['id']},'attributes':['id',_0xd687('0x29')]})[_0xd687('0x26')](handleEntityNotFound(_0x319f71,null))[_0xd687('0x26')](function(_0x36290f){if(_0x36290f){_0x220f8a=_0x36290f;return db[_0xd687('0x5b')][_0xd687('0x27')]({'where':{'userProfileId':_0x414c14['params']['id'],'sectionId':_0x414c14[_0xd687('0x30')][_0xd687('0x5e')]}});}})['then'](function(){return _0x220f8a;})[_0xd687('0x26')](respondWithStatusCode(_0x319f71,null))[_0xd687('0x45')](handleError(_0x319f71,null));};exports[_0xd687('0x5f')]=function(_0x3433e0,_0x3c8d48){return db[_0xd687('0x2c')]['find']({'where':{'id':_0x3433e0['params']['id']}})['then'](handleEntityNotFound(_0x3c8d48,null))[_0xd687('0x26')](function(_0x547553){if(_0x547553){return db[_0xd687('0x4f')]['transaction'](function(_0x402c3a){return db[_0xd687('0x5b')][_0xd687('0x43')]({'where':{'userProfileId':_0x3433e0[_0xd687('0x49')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4bfddf){if(_0x4bfddf){return db['UserProfileSection'][_0xd687('0x27')]({'where':{'userProfileId':_0x3433e0['params']['id'],'id':_[_0xd687('0x3d')](_0x4bfddf,function(_0x558db8){return _0x558db8['id'];})},'transaction':_0x402c3a});}})[_0xd687('0x26')](function(_0x2ed8ae){var _0x38f58a=_['map'](_0x3433e0[_0xd687('0x57')],function(_0x26654e){_0x26654e['userProfileId']=_0x3433e0['params']['id'];return _0x26654e;});return db[_0xd687('0x5b')][_0xd687('0x60')](_0x38f58a,{'raw':!![],'transaction':_0x402c3a});})[_0xd687('0x26')](function(_0x3983b8){var _0x3c94cc=_[_0xd687('0x61')](_[_0xd687('0x3d')](_0x3983b8,function(_0x1d3605){return _0x1d3605[_0xd687('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x3c94cc){return db[_0xd687('0x5b')][_0xd687('0x43')]({'where':{'userProfileId':_0x3433e0[_0xd687('0x49')]['id'],'sectionId':_[_0xd687('0x3d')](_0x3c94cc,function(_0x4c5d8d){return _0x4c5d8d[_0xd687('0x5a')];})},'attributes':['id','sectionId'],'raw':!![]})['then'](function(_0x182edd){var _0x57f06e=_[_0xd687('0x3d')](_0x3433e0[_0xd687('0x57')],function(_0x202ca7){_0x202ca7[_0xd687('0x55')]=_0x3433e0[_0xd687('0x49')]['id'];return _0x202ca7;});return db['UserProfileResource']['bulkCreate'](_0x57f06e,{'raw':!![],'transaction':_0x402c3a});});}})[_0xd687('0x45')](handleError(_0x3c8d48,null));});}})[_0xd687('0x26')](function(_0x2cbf14){var _0xf2bb6c=_['map'](_0x2cbf14,function(_0x212f8c){return _0x212f8c[_0xd687('0x51')]({'plain':!![]});});})[_0xd687('0x26')](respondWithResult(_0x3c8d48,null))[_0xd687('0x45')](handleError(_0x3c8d48,null));};exports[_0xd687('0x62')]=function(_0x54535a,_0x2cab7d,_0x29c631){return db[_0xd687('0x2c')][_0xd687('0x46')]({'where':{'id':_0x54535a[_0xd687('0x49')]['id']}})['then'](handleEntityNotFound(_0x2cab7d,null))[_0xd687('0x26')](function(_0x196ecb){if(_0x196ecb){return _0x196ecb[_0xd687('0x62')](_0x54535a['query']['ids']);}})[_0xd687('0x26')](respondWithStatusCode(_0x2cab7d,null))[_0xd687('0x45')](handleError(_0x2cab7d,null));};exports[_0xd687('0x63')]=function(_0x2571ef,_0xa71449){var _0x2384bb={'raw':![],'where':{}};var _0x98ac4d={};var _0x247d07={'count':0x0,'rows':[]};var _0x1e9544=_0x2571ef[_0xd687('0x30')][_0xd687('0x64')];if(typeof _0x1e9544==='undefined'){throw new db[(_0xd687('0x65'))][(_0xd687('0x66'))](_0xd687('0x67'));}var _0x27abf5=_0x2571ef['query'][_0xd687('0x68')]||![];var _0x35e560=getQueryModels(_0x1e9544,_0x27abf5);if(typeof _0x35e560[_0xd687('0x69')]==='undefined'){throw new db[(_0xd687('0x65'))][(_0xd687('0x66'))](_0xd687('0x6a')+_0x1e9544+'\x27');}var _0x52e2f4=[];if(!_[_0xd687('0x6b')](_0x35e560[_0xd687('0x6c')])){_0x52e2f4=_0x35e560[_0xd687('0x6c')];}else{_0x52e2f4=[{'name':_0x1e9544}];}return db[_0xd687('0x2c')][_0xd687('0x6d')]({'where':{'id':_0x2571ef[_0xd687('0x49')]['id']}})[_0xd687('0x26')](handleEntityNotFound(_0xa71449,null))['then'](function(_0x58b13c){if(_0x58b13c){var _0x24d8f3=[];for(var _0xba8a6d=0x0;_0xba8a6d<_0x52e2f4[_0xd687('0x4a')];_0xba8a6d++){_0x24d8f3[_0xd687('0x5c')](db[_0xd687('0x5b')][_0xd687('0x6d')]({'where':{'userProfileId':_0x58b13c['id'],'name':_0x52e2f4[_0xba8a6d]['name']},'raw':!![]}));}return BPromise[_0xd687('0x6e')](_0x24d8f3);}})[_0xd687('0x26')](function(_0x1984b4){var _0x476038=_['filter'](_0x1984b4,function(_0x29dc0c){return _0x29dc0c?_0x29dc0c:undefined;});var _0x2dad22=_[_0xd687('0x61')](_0x52e2f4,[_0xd687('0x6f'),!![]]);var _0x6b2bfc=_[_0xd687('0x6b')](_0x476038)&&_[_0xd687('0x6b')](_0x2dad22)?null:_['union'](_0x2dad22,_0x476038);if(_0x6b2bfc){var _0x1dd8c9=[];for(var _0x4e9a36=0x0;_0x4e9a36<_0x6b2bfc['length'];_0x4e9a36++){var _0xb8eda=_[_0xd687('0x46')](_0x52e2f4,function(_0x598fb6){return _0x6b2bfc[_0x4e9a36]?_0x598fb6[_0xd687('0x29')]===_0x6b2bfc[_0x4e9a36]['name']:null;});if(_0xb8eda){if(_0x6b2bfc[_0x4e9a36][_0xd687('0x6f')]){_0x1dd8c9[_0xd687('0x5c')](getAllResources(_0x35e560[_0xd687('0x69')],_0x6b2bfc[_0x4e9a36]));}else{if(!_0x6b2bfc[_0x4e9a36][_0xd687('0x53')]){_0x1dd8c9[_0xd687('0x5c')](getAllowedResources(_0xb8eda,_0x6b2bfc[_0x4e9a36],_0x35e560['childModel']));}else{if(_0xb8eda['model']){_0x1dd8c9[_0xd687('0x5c')](getAllFilteredResources(_0xb8eda,_0x6b2bfc[_0x4e9a36]));}}}}}return BPromise[_0xd687('0x6e')](_0x1dd8c9);}else{return null;}})['then'](function(_0x14f386){var _0xb94683=_0x14f386;var _0x3498cf=null;if(_0xb94683){_0x3498cf=_0xb94683['length']===0x1?_0xb94683[0x0]:null;}if(_0x3498cf||_0xb94683){var _0x213068=db[_0x35e560[_0xd687('0x69')]][_0xd687('0x2d')];_0x98ac4d[_0xd687('0x2e')]=_[_0xd687('0x2f')](_0x213068);_0x98ac4d[_0xd687('0x30')]=_[_0xd687('0x2f')](_0x2571ef['query']);_0x98ac4d['filters']=_[_0xd687('0x32')](_0x98ac4d[_0xd687('0x2e')],_0x98ac4d[_0xd687('0x30')]);_0x2384bb['attributes']=_[_0xd687('0x32')](_0x98ac4d[_0xd687('0x2e')],qs[_0xd687('0x34')](_0x2571ef['query']['fields']));_0x2384bb[_0xd687('0x33')]=_0x2384bb[_0xd687('0x33')][_0xd687('0x4a')]?_0x2384bb[_0xd687('0x33')]:_0x98ac4d[_0xd687('0x2e')];if(!_0x2571ef['query'][_0xd687('0x35')](_0xd687('0x36'))){_0x2384bb[_0xd687('0x20')]=qs['limit'](_0x2571ef[_0xd687('0x30')]['limit']);_0x2384bb[_0xd687('0x37')]=qs[_0xd687('0x37')](_0x2571ef[_0xd687('0x30')][_0xd687('0x37')]);}_0x2384bb[_0xd687('0x38')]=qs[_0xd687('0x39')](_0x2571ef[_0xd687('0x30')]['sort']);_0x2384bb[_0xd687('0x3a')]=qs['filters'](_[_0xd687('0x3b')](_0x2571ef[_0xd687('0x30')],_0x98ac4d[_0xd687('0x31')]));if(_0x2571ef[_0xd687('0x30')]['filter']){_0x2384bb[_0xd687('0x3a')]=_[_0xd687('0x3c')](_0x2384bb[_0xd687('0x3a')],{'$or':_['map'](_0x213068,function(_0x52b992){if(_0x52b992[_0xd687('0x3e')][_0xd687('0x70')]!==_0xd687('0x71')){var _0x36912e={};_0x36912e[_0x52b992[_0xd687('0x3f')]]={'$like':'%'+_0x2571ef[_0xd687('0x30')][_0xd687('0x61')]+'%'};return _0x36912e;}})});}var _0x456bfb=[];if(_0x3498cf){var _0x512cd6=_[_0xd687('0x46')](_0x52e2f4,[_0xd687('0x29'),_0x3498cf[_0xd687('0x29')]]);if(_0x512cd6[_0xd687('0x3f')]){var _0x362016={};if(_0x35e560[_0xd687('0x69')]===_0xd687('0x72')){_0x362016[_0x512cd6[_0xd687('0x73')]]=_[_0xd687('0x3d')](_0x3498cf[_0xd687('0x74')],'id');}else{_0x362016[_0x512cd6[_0xd687('0x73')]]=_0x3498cf[_0xd687('0x74')];}_0x456bfb[_0xd687('0x5c')](_0x362016);}else{_0x2384bb['where']['id']=_0x3498cf[_0xd687('0x74')];}}else{for(var _0xe59214=0x0;_0xe59214<_0xb94683[_0xd687('0x4a')];_0xe59214++){var _0x512cd6=_['find'](_0x52e2f4,[_0xd687('0x29'),_0xb94683[_0xe59214][_0xd687('0x29')]]);if(_0x512cd6[_0xd687('0x3f')]){var _0x362016={};_0x362016[_0x512cd6[_0xd687('0x73')]]=_0xb94683[_0xe59214][_0xd687('0x74')];_0x456bfb[_0xd687('0x5c')](_0x362016);}else{if(!_0x2384bb[_0xd687('0x3a')]['id'])_0x2384bb[_0xd687('0x3a')]['id']=[];_0xb94683[_0xe59214][_0xd687('0x74')][_0xd687('0x75')](function(_0x4e741){_0x2384bb['where']['id']['push'](_0x4e741);});}}}if(!_['isEmpty'](_0x456bfb)){_0x2384bb['where']=_['merge'](_0x2384bb[_0xd687('0x3a')],{'$and':{'$or':_0x456bfb}});}_0x2384bb=_[_0xd687('0x3c')]({},_0x2384bb,_0x2571ef[_0xd687('0x40')]);if(_0x3498cf&&!_0x3498cf[_0xd687('0x53')]&&_0x35e560['childModel']==='AnalyticExtractedReport'){if(_0x2571ef[_0xd687('0x30')][_0xd687('0x41')]){_0x2384bb[_0xd687('0x42')]=[{'all':!![]}];}return db[_0x35e560[_0xd687('0x69')]][_0xd687('0x43')](_0x2384bb)[_0xd687('0x26')](function(_0x5d2dfe){var _0x561028=[];_0x5d2dfe[_0xd687('0x75')](function(_0x469b17){var _0x2c57dc;switch(_0x469b17[_0xd687('0x76')]){case _0xd687('0x77'):_0x2c57dc=_[_0xd687('0x46')](_0x3498cf['associatedResources'],function(_0x3c77e2){return _0x3c77e2['id']===_0x469b17['reportId']&&_0x3c77e2[_0xd687('0x3e')]==='DefaultReports';});break;case _0xd687('0x78'):_0x2c57dc=_[_0xd687('0x46')](_0x3498cf[_0xd687('0x74')],function(_0xa831f7){return _0xa831f7['id']===_0x469b17[_0xd687('0x79')]&&_0xa831f7[_0xd687('0x3e')]===_0xd687('0x7a');});break;}if(_0x2c57dc)_0x561028[_0xd687('0x5c')](_0x469b17);});_0x247d07[_0xd687('0x1f')]=_0x561028[_0xd687('0x4a')];_0x247d07['rows']=_0x561028;return _0x247d07;});}else{return db[_0x35e560[_0xd687('0x69')]]['count']({'where':_0x2384bb['where']})[_0xd687('0x26')](function(_0x25ccb1){_0x247d07[_0xd687('0x1f')]=_0x25ccb1;if(_0x2571ef['query'][_0xd687('0x41')]){if(_0x35e560[_0xd687('0x69')]===_0xd687('0x7b')){_0x2384bb[_0xd687('0x42')]=[{'model':db['Tag'],'as':_0xd687('0x7c'),'attributes':['id',_0xd687('0x29'),'color'],'required':_0x2571ef['query'][_0xd687('0x7d')]?!![]:![]},{'model':db['Tag'],'as':_0xd687('0x7e'),'attributes':['id',_0xd687('0x29'),_0xd687('0x7f')],'through':_0x2571ef['query']['tag']?{'attributes':[],'where':{'TagId':_0x2571ef[_0xd687('0x30')][_0xd687('0x7d')]||undefined}}:{},'required':_0x2571ef[_0xd687('0x30')][_0xd687('0x7d')]?!![]:![]}];}else{_0x2384bb['include']=[{'all':!![]}];}}return db[_0x35e560[_0xd687('0x69')]][_0xd687('0x43')](_0x2384bb);})['then'](function(_0x59ce96){_0x247d07['rows']=_0x59ce96;return _0x247d07;});}}else{return _0x247d07;}})['then'](respondWithFilteredResult(_0xa71449,_0x2384bb))[_0xd687('0x45')](handleError(_0xa71449,null));};function getAllResources(_0x9388aa,_0x48bde4){return new BPromise(function(_0x3067ea,_0x4d466c){if(_0x48bde4){var _0x23fe62=_0x48bde4[_0xd687('0x61')]?{[_0x48bde4[_0xd687('0x61')][_0xd687('0x3f')]]:_0x48bde4[_0xd687('0x61')][_0xd687('0x80')]}:undefined;return db[_0x9388aa][_0xd687('0x43')]({'where':_0x23fe62,'raw':!![]})[_0xd687('0x26')](function(_0x505e30){_0x48bde4[_0xd687('0x74')]=_['map'](_0x505e30,'id');_0x3067ea(_0x48bde4);})[_0xd687('0x45')](function(_0x4a9c85){_0x4d466c(_0x4a9c85);});}else{_0x3067ea(null);}});}function getAllFilteredResources(_0x323c47,_0xdbff7d){return new BPromise(function(_0x1ea4d1,_0x3a82db){var _0x15156b=_0x323c47[_0xd687('0x61')]?{[_0x323c47[_0xd687('0x61')][_0xd687('0x3f')]]:_0x323c47[_0xd687('0x61')][_0xd687('0x80')]}:undefined;return db[_0x323c47[_0xd687('0x2e')]][_0xd687('0x43')]({'where':_0x15156b,'raw':!![]})[_0xd687('0x26')](function(_0x216a22){_0xdbff7d[_0xd687('0x74')]=_[_0xd687('0x3d')](_0x216a22,function(_0x243981){return _0x243981[_0xd687('0x29')];});_0x1ea4d1(_0xdbff7d);})[_0xd687('0x45')](function(_0xe86319){_0x3a82db(_0xe86319);});});}function getAllowedResources(_0x506d96,_0x34be08,_0x13ef0e){return new BPromise(function(_0x55a709,_0x33d1ae){if(_0x34be08){return db[_0xd687('0x54')][_0xd687('0x43')]({'where':{'sectionId':_0x34be08['id']},'raw':!![]})[_0xd687('0x26')](function(_0xa14776){if(_0x506d96[_0xd687('0x3f')]&&_0x506d96[_0xd687('0x3f')]!=='id'){_0x34be08[_0xd687('0x74')]=_[_0xd687('0x3d')](_0xa14776,function(_0x1fa23c){return _0x1fa23c[_0x506d96[_0xd687('0x3f')]];});}else{if(_0x13ef0e===_0xd687('0x72')){_0x34be08['associatedResources']=_[_0xd687('0x3d')](_0xa14776,function(_0x16acbf){return{'id':_0x16acbf[_0xd687('0x81')],'type':_0x16acbf[_0xd687('0x3e')]};});}else{_0x34be08['associatedResources']=_[_0xd687('0x3d')](_0xa14776,function(_0x32de27){return _0x32de27[_0xd687('0x81')];});}}_0x55a709(_0x34be08);})[_0xd687('0x45')](function(_0x208b84){_0x33d1ae(_0x208b84);});}else{_0x55a709(null);}});}function getQueryModels(_0xd3283e,_0x1ba69e){var _0xb4a27d=_0xd3283e['toLowerCase']();var _0x3323f3={'childModel':undefined,'parentSections':[]};switch(_0xb4a27d){case _0xd687('0x82'):_0x3323f3['childModel']=_0xd687('0x83');break;case'odbc':_0x3323f3[_0xd687('0x69')]=_0xd687('0x84');break;case _0xd687('0x85'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x86');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0x87'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0x88')}];break;case _0xd687('0x89'):_0x3323f3['childModel']='JscriptyProject';break;case _0xd687('0x8a'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x7b');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0x8b'),'field':'id','foreignKey':_0xd687('0x8c')}];break;case _0xd687('0x8d'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x8e');break;case _0xd687('0x8f'):_0x3323f3[_0xd687('0x69')]='CmCompany';break;case'globalcustomfields':_0x3323f3[_0xd687('0x69')]=_0xd687('0x90');break;case _0xd687('0x91'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x92');break;case'chatwebsites':_0x3323f3['childModel']=_0xd687('0x93');break;case _0xd687('0x94'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x95');break;case _0xd687('0x96'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x97');break;case _0xd687('0x98'):case _0xd687('0x99'):case _0xd687('0x9a'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x9b');break;case _0xd687('0x9c'):_0x3323f3[_0xd687('0x69')]=_0xd687('0x9d');break;case _0xd687('0x9e'):_0x3323f3[_0xd687('0x69')]='VoiceMail';break;case _0xd687('0x9f'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xa0');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xa1'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0xa2'),'model':_0xd687('0xa3'),'filter':{'field':_0xd687('0xa4'),'value':[_0xd687('0xa5')]}},{'name':_0xd687('0xa6'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0xa2'),'model':'User','filter':{'field':'role','value':[_0xd687('0xa7')]}},{'name':'VoiceQueues','field':'name','foreignKey':'queue','model':_0xd687('0xa8'),'filter':{'field':_0xd687('0x3e'),'value':[_0xd687('0xa9')]}},{'name':_0xd687('0xaa'),'field':_0xd687('0x29'),'foreignKey':_0xd687('0xab'),'model':'VoiceQueue','filter':{'field':_0xd687('0x3e'),'value':[_0xd687('0xac')]}}];break;case _0xd687('0xad'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xae');break;case _0xd687('0xaf'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xb0');break;case _0xd687('0xb1'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xb2');break;case'ivrcampaigns':_0x3323f3[_0xd687('0x69')]=_0xd687('0xb3');break;case _0xd687('0xb4'):_0x3323f3['childModel']=_0xd687('0xb5');break;case'mailaccounts':_0x3323f3[_0xd687('0x69')]=_0xd687('0xb6');break;case _0xd687('0xb7'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xb8');break;case _0xd687('0xb9'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xba');break;case _0xd687('0xbb'):_0x3323f3['childModel']=_0xd687('0xbc');break;case _0xd687('0xbd'):_0x3323f3['childModel']=_0xd687('0xbe');break;case _0xd687('0xbf'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xc0');break;case'teams':_0x3323f3['childModel']=_0xd687('0xc1');break;case _0xd687('0xc2'):case'queuecampaigns':_0x3323f3[_0xd687('0x69')]=_0xd687('0xa8');if(_0x1ba69e){_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xc3')},{'name':_0xd687('0xaa')}];}break;case _0xd687('0xc4'):case'agents':case _0xd687('0xc5'):_0x3323f3[_0xd687('0x69')]='User';if(_0x1ba69e){_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xc6'),'filter':{'field':'role','value':[_0xd687('0xc7'),_0xd687('0xc8')]},'ignore':!![]},{'name':_0xd687('0xa1')},{'name':_0xd687('0xa6')}];}break;case _0xd687('0xc9'):_0x3323f3['childModel']='ZendeskAccount';break;case _0xd687('0xca'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xcb');break;case'freshdeskaccounts':_0x3323f3[_0xd687('0x69')]=_0xd687('0xcc');break;case _0xd687('0xcd'):_0x3323f3[_0xd687('0x69')]='SugarcrmAccount';break;case _0xd687('0xce'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xcf');break;case _0xd687('0xd0'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xd1');break;case _0xd687('0xd2'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xa3');break;case _0xd687('0xd3'):_0x3323f3['childModel']='CannedAnswer';break;case _0xd687('0xd4'):_0x3323f3['childModel']=_0xd687('0xd5');break;case _0xd687('0xd6'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xd7');break;case _0xd687('0xd8'):_0x3323f3['childModel']=_0xd687('0xd9');break;case _0xd687('0xda'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xdb');break;case _0xd687('0xdc'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xdd');break;case'sounds':_0x3323f3[_0xd687('0x69')]=_0xd687('0xde');break;case _0xd687('0xdf'):_0x3323f3['childModel']=_0xd687('0xe0');break;case _0xd687('0xe1'):_0x3323f3[_0xd687('0x69')]=_0xd687('0xe2');break;case'triggers':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe3');break;case'trunks':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe4');break;case'variables':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe5');break;case _0xd687('0xe6'):_0x3323f3[_0xd687('0x69')]='Plugin';break;case _0xd687('0xe7'):_0x3323f3['childModel']=_0xd687('0x72');_0x3323f3[_0xd687('0x6c')]=[{'name':_0xd687('0xe8'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x3323f3[_0xd687('0x69')]=_0xd687('0xe9');break;default:return _0x3323f3;}return _0x3323f3;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 816212d..40fd52c 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 _0x4210=['remove','emit','hook','exports','events','../../mysqldb','UserProfile','save','update'];(function(_0x4ebd7f,_0x38cfe2){var _0x43467a=function(_0x263b01){while(--_0x263b01){_0x4ebd7f['push'](_0x4ebd7f['shift']());}};_0x43467a(++_0x38cfe2);}(_0x4210,0xca));var _0x0421=function(_0x2adf9c,_0x3e0045){_0x2adf9c=_0x2adf9c-0x0;var _0x13887f=_0x4210[_0x2adf9c];return _0x13887f;};'use strict';var EventEmitter=require(_0x0421('0x0'));var UserProfile=require(_0x0421('0x1'))['db'][_0x0421('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0421('0x3'),'afterUpdate':_0x0421('0x4'),'afterDestroy':_0x0421('0x5')};function emitEvent(_0x49eaa9){return function(_0xff9faa,_0x4e3aaa,_0x4747ee){UserProfileEvents['emit'](_0x49eaa9+':'+_0xff9faa['id'],_0xff9faa);UserProfileEvents[_0x0421('0x6')](_0x49eaa9,_0xff9faa);_0x4747ee(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x0421('0x7')](e,emitEvent(event));}}module[_0x0421('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x069e=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x8a376f,_0x3aa020){var _0x53278d=function(_0x216492){while(--_0x216492){_0x8a376f['push'](_0x8a376f['shift']());}};_0x53278d(++_0x3aa020);}(_0x069e,0x108));var _0xe069=function(_0x4a73f2,_0x352409){_0x4a73f2=_0x4a73f2-0x0;var _0x4190ee=_0x069e[_0x4a73f2];return _0x4190ee;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xe069('0x0'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe069('0x1')](0x0);var events={'afterCreate':_0xe069('0x2'),'afterUpdate':_0xe069('0x3'),'afterDestroy':_0xe069('0x4')};function emitEvent(_0x3e83dc){return function(_0x4631eb,_0x43383f,_0x2f5a5c){UserProfileEvents[_0xe069('0x5')](_0x3e83dc+':'+_0x4631eb['id'],_0x4631eb);UserProfileEvents[_0xe069('0x5')](_0x3e83dc,_0x4631eb);_0x2f5a5c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xe069('0x6')](e,emitEvent(event));}}module[_0xe069('0x7')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 6bc409a..a067cc7 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 _0xf1b0=['../../config/environment','./userProfile.attributes','exports','define','UserProfile','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x6b910b,_0x38ce8f){var _0x3408a7=function(_0x4f6676){while(--_0x4f6676){_0x6b910b['push'](_0x6b910b['shift']());}};_0x3408a7(++_0x38ce8f);}(_0xf1b0,0xc8));var _0x0f1b=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xf1b0[_0x4ae625];return _0x31accf;};'use strict';var _=require(_0x0f1b('0x0'));var util=require(_0x0f1b('0x1'));var logger=require(_0x0f1b('0x2'))(_0x0f1b('0x3'));var moment=require(_0x0f1b('0x4'));var BPromise=require(_0x0f1b('0x5'));var rp=require(_0x0f1b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f1b('0x7'));var config=require(_0x0f1b('0x8'));var attributes=require(_0x0f1b('0x9'));module[_0x0f1b('0xa')]=function(_0x532a3a,_0x19d499){return _0x532a3a[_0x0f1b('0xb')](_0x0f1b('0xc'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd96a=['moment','bluebird','../../config/environment','exports','define','user_profiles','../../config/logger','api'];(function(_0x81767f,_0x1ac614){var _0x17a9ee=function(_0x5ac3ac){while(--_0x5ac3ac){_0x81767f['push'](_0x81767f['shift']());}};_0x17a9ee(++_0x1ac614);}(_0xd96a,0x15e));var _0xad96=function(_0x9c6b63,_0x33bbd4){_0x9c6b63=_0x9c6b63-0x0;var _0x15d177=_0xd96a[_0x9c6b63];return _0x15d177;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xad96('0x0'))(_0xad96('0x1'));var moment=require(_0xad96('0x2'));var BPromise=require(_0xad96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad96('0x4'));var attributes=require('./userProfile.attributes');module[_0xad96('0x5')]=function(_0x3560d8,_0x3faf15){return _0x3560d8[_0xad96('0x6')]('UserProfile',attributes,{'tableName':_0xad96('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 745a3f1..fc2d369 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 _0x829c=['../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x829c,0x1e9));var _0xc829=function(_0x2aada1,_0x205f27){_0x2aada1=_0x2aada1-0x0;var _0x50a99e=_0x829c[_0x2aada1];return _0x50a99e;};'use strict';var _=require(_0xc829('0x0'));var util=require(_0xc829('0x1'));var moment=require(_0xc829('0x2'));var BPromise=require(_0xc829('0x3'));var rs=require(_0xc829('0x4'));var fs=require('fs');var Redis=require(_0xc829('0x5'));var db=require(_0xc829('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc829('0x7'))('rpc');var config=require(_0xc829('0x8'));var jayson=require(_0xc829('0x9'));var client=jayson[_0xc829('0xa')][_0xc829('0xb')]({'port':0x232a});config['redis']=_[_0xc829('0xc')](config[_0xc829('0xd')],{'host':_0xc829('0xe'),'port':0x18eb});var socket=require(_0xc829('0xf'))(new Redis(config[_0xc829('0xd')]));require(_0xc829('0x10'))[_0xc829('0x11')](socket);function respondWithRpcPromise(_0x287a00,_0x19d4c4,_0x1b07aa){return new BPromise(function(_0x38397a,_0x18f191){return client[_0xc829('0x12')](_0x287a00,_0x1b07aa)[_0xc829('0x13')](function(_0x15114a){logger[_0xc829('0x14')](_0xc829('0x15'),_0x19d4c4,'request\x20sent');logger[_0xc829('0x16')](_0xc829('0x17'),_0x19d4c4,'request\x20sent',JSON[_0xc829('0x18')](_0x15114a));if(_0x15114a['error']){if(_0x15114a[_0xc829('0x19')][_0xc829('0x1a')]===0x1f4){logger[_0xc829('0x19')](_0xc829('0x15'),_0x19d4c4,_0x15114a['error'][_0xc829('0x1b')]);return _0x18f191(_0x15114a[_0xc829('0x19')][_0xc829('0x1b')]);}logger[_0xc829('0x19')]('UserProfile,\x20%s,\x20%s',_0x19d4c4,_0x15114a['error'][_0xc829('0x1b')]);return _0x38397a(_0x15114a[_0xc829('0x19')][_0xc829('0x1b')]);}else{logger[_0xc829('0x14')](_0xc829('0x15'),_0x19d4c4,_0xc829('0x1c'));_0x38397a(_0x15114a[_0xc829('0x1d')][_0xc829('0x1b')]);}})[_0xc829('0x1e')](function(_0x3b68d2){logger[_0xc829('0x19')](_0xc829('0x15'),_0x19d4c4,_0x3b68d2);_0x18f191(_0x3b68d2);});});} \ No newline at end of file +var _0xb348=['request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','UserProfile,\x20%s,\x20%s','result','catch','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./userProfile.socket','register'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xb348,0xa6));var _0x8b34=function(_0x41c911,_0x1c1a3a){_0x41c911=_0x41c911-0x0;var _0x30b972=_0xb348[_0x41c911];return _0x30b972;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8b34('0x0'));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(_0x8b34('0x1'))(_0x8b34('0x2'));var config=require(_0x8b34('0x3'));var jayson=require(_0x8b34('0x4'));var client=jayson[_0x8b34('0x5')]['http']({'port':0x232a});config['redis']=_[_0x8b34('0x6')](config[_0x8b34('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b34('0x7')]));require(_0x8b34('0x8'))[_0x8b34('0x9')](socket);function respondWithRpcPromise(_0x1fa56c,_0x56006a,_0x583335){return new BPromise(function(_0x3dfce8,_0x77efc9){return client[_0x8b34('0xa')](_0x1fa56c,_0x583335)['then'](function(_0x8f1ec7){logger[_0x8b34('0xb')]('UserProfile,\x20%s,\x20%s',_0x56006a,_0x8b34('0xc'));logger[_0x8b34('0xd')](_0x8b34('0xe'),_0x56006a,_0x8b34('0xc'),JSON[_0x8b34('0xf')](_0x8f1ec7));if(_0x8f1ec7['error']){if(_0x8f1ec7['error'][_0x8b34('0x10')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x56006a,_0x8f1ec7[_0x8b34('0x11')][_0x8b34('0x12')]);return _0x77efc9(_0x8f1ec7['error'][_0x8b34('0x12')]);}logger[_0x8b34('0x11')](_0x8b34('0x13'),_0x56006a,_0x8f1ec7[_0x8b34('0x11')][_0x8b34('0x12')]);return _0x3dfce8(_0x8f1ec7[_0x8b34('0x11')][_0x8b34('0x12')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x56006a,_0x8b34('0xc'));_0x3dfce8(_0x8f1ec7[_0x8b34('0x14')][_0x8b34('0x12')]);}})[_0x8b34('0x15')](function(_0x606fa0){logger['error'](_0x8b34('0x13'),_0x56006a,_0x606fa0);_0x77efc9(_0x606fa0);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 174028a..2b399bd 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 _0xdfe7=['length','userProfile:','save','remove','emit','removeListener'];(function(_0x4ec4b6,_0x22b597){var _0x57d0ee=function(_0x3b44fc){while(--_0x3b44fc){_0x4ec4b6['push'](_0x4ec4b6['shift']());}};_0x57d0ee(++_0x22b597);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x3915d9,_0x18070b){_0x3915d9=_0x3915d9-0x0;var _0x4c24fb=_0xdfe7[_0x3915d9];return _0x4c24fb;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x7dfe('0x0'),_0x7dfe('0x1'),'update'];function createListener(_0x162e75,_0x36c721){return function(_0x388848){_0x36c721[_0x7dfe('0x2')](_0x162e75,_0x388848);};}function removeListener(_0x527490,_0x2c07d2){return function(){UserProfileEvents[_0x7dfe('0x3')](_0x527490,_0x2c07d2);};}exports['register']=function(_0x262561){for(var _0x3d8220=0x0,_0x23d0c1=events[_0x7dfe('0x4')];_0x3d8220<_0x23d0c1;_0x3d8220++){var _0x56d67e=events[_0x3d8220];var _0x3fc0a0=createListener(_0x7dfe('0x5')+_0x56d67e,_0x262561);UserProfileEvents['on'](_0x56d67e,_0x3fc0a0);}}; \ No newline at end of file +var _0xdfe7=['length','userProfile:','save','remove','emit','removeListener'];(function(_0x302129,_0xfc7610){var _0x439552=function(_0x1177da){while(--_0x1177da){_0x302129['push'](_0x302129['shift']());}};_0x439552(++_0xfc7610);}(_0xdfe7,0xc8));var _0x7dfe=function(_0x42941c,_0x502f33){_0x42941c=_0x42941c-0x0;var _0x210723=_0xdfe7[_0x42941c];return _0x210723;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x7dfe('0x0'),_0x7dfe('0x1'),'update'];function createListener(_0x162e75,_0x36c721){return function(_0x388848){_0x36c721[_0x7dfe('0x2')](_0x162e75,_0x388848);};}function removeListener(_0x527490,_0x2c07d2){return function(){UserProfileEvents[_0x7dfe('0x3')](_0x527490,_0x2c07d2);};}exports['register']=function(_0x262561){for(var _0x3d8220=0x0,_0x23d0c1=events[_0x7dfe('0x4')];_0x3d8220<_0x23d0c1;_0x3d8220++){var _0x56d67e=events[_0x3d8220];var _0x3fc0a0=createListener(_0x7dfe('0x5')+_0x56d67e,_0x262561);UserProfileEvents['on'](_0x56d67e,_0x3fc0a0);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index d39887e..c6fe3ca 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 _0xf3aa=['put','update','exports','multer','util','path','connect-timeout','Router','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','/:id','show','create'];(function(_0x58abac,_0x312d6a){var _0x2b4e36=function(_0x4fbfbd){while(--_0x4fbfbd){_0x58abac['push'](_0x58abac['shift']());}};_0x2b4e36(++_0x312d6a);}(_0xf3aa,0xf1));var _0xaf3a=function(_0x5457a1,_0x2478b3){_0x5457a1=_0x5457a1-0x0;var _0x52ad60=_0xf3aa[_0x5457a1];return _0x52ad60;};'use strict';var multer=require(_0xaf3a('0x0'));var util=require(_0xaf3a('0x1'));var path=require(_0xaf3a('0x2'));var timeout=require(_0xaf3a('0x3'));var express=require('express');var router=express[_0xaf3a('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf3a('0x5'));var controller=require(_0xaf3a('0x6'));router[_0xaf3a('0x7')]('/',auth[_0xaf3a('0x8')](),controller[_0xaf3a('0x9')]);router[_0xaf3a('0x7')](_0xaf3a('0xa'),auth[_0xaf3a('0x8')](),controller['describe']);router['get'](_0xaf3a('0xb'),auth[_0xaf3a('0x8')](),controller[_0xaf3a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaf3a('0xd')]);router[_0xaf3a('0xe')](_0xaf3a('0xb'),auth[_0xaf3a('0x8')](),controller[_0xaf3a('0xf')]);router['delete'](_0xaf3a('0xb'),auth[_0xaf3a('0x8')](),controller['destroy']);module[_0xaf3a('0x10')]=router; \ No newline at end of file +var _0xbc95=['create','delete','destroy','exports','multer','util','path','connect-timeout','express','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/:id','show','post'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xbc95,0x1f4));var _0x5bc9=function(_0x47e70a,_0x1c3714){_0x47e70a=_0x47e70a-0x0;var _0x3a9900=_0xbc95[_0x47e70a];return _0x3a9900;};'use strict';var multer=require(_0x5bc9('0x0'));var util=require(_0x5bc9('0x1'));var path=require(_0x5bc9('0x2'));var timeout=require(_0x5bc9('0x3'));var express=require(_0x5bc9('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5bc9('0x5'));var controller=require(_0x5bc9('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5bc9('0x7')]('/describe',auth[_0x5bc9('0x8')](),controller['describe']);router['get'](_0x5bc9('0x9'),auth[_0x5bc9('0x8')](),controller[_0x5bc9('0xa')]);router[_0x5bc9('0xb')]('/',auth[_0x5bc9('0x8')](),controller[_0x5bc9('0xc')]);router['put'](_0x5bc9('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x5bc9('0xd')]('/:id',auth[_0x5bc9('0x8')](),controller[_0x5bc9('0xe')]);module[_0x5bc9('0xf')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 3ea4a1e..829a563 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 _0x73c1=['STRING','INTEGER'];(function(_0x6182ff,_0x59d492){var _0x1cec22=function(_0x2e96f8){while(--_0x2e96f8){_0x6182ff['push'](_0x6182ff['shift']());}};_0x1cec22(++_0x59d492);}(_0x73c1,0xf7));var _0x173c=function(_0x52a897,_0x5c3e2e){_0x52a897=_0x52a897-0x0;var _0x5eced0=_0x73c1[_0x52a897];return _0x5eced0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x173c('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x173c('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xee32=['exports','STRING'];(function(_0x186339,_0x2a828a){var _0x128945=function(_0x92fcd4){while(--_0x92fcd4){_0x186339['push'](_0x186339['shift']());}};_0x128945(++_0x2a828a);}(_0xee32,0x172));var _0x2ee3=function(_0x2fd09,_0x2c20ea){_0x2fd09=_0x2fd09-0x0;var _0x13be55=_0xee32[_0x2fd09];return _0x13be55;};'use strict';var Sequelize=require('sequelize');module[_0x2ee3('0x0')]={'name':{'type':Sequelize[_0x2ee3('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x2ee3('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 3a8ba46..851a1c5 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 _0xd73a=['catch','show','params','rawAttributes','length','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','findAll','rows'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xd73a,0x171));var _0xad73=function(_0xd58e21,_0x36311f){_0xd58e21=_0xd58e21-0x0;var _0x2c4a40=_0xd73a[_0xd58e21];return _0x2c4a40;};'use strict';var pdf=require(_0xad73('0x0'));var emlformat=require(_0xad73('0x1'));var rimraf=require(_0xad73('0x2'));var zipdir=require(_0xad73('0x3'));var jsonpatch=require(_0xad73('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad73('0x5'));var Mustache=require(_0xad73('0x6'));var util=require(_0xad73('0x7'));var path=require(_0xad73('0x8'));var sox=require(_0xad73('0x9'));var csv=require(_0xad73('0xa'));var ejs=require(_0xad73('0xb'));var fs=require('fs');var _=require(_0xad73('0xc'));var squel=require(_0xad73('0xd'));var crypto=require(_0xad73('0xe'));var jsforce=require(_0xad73('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xad73('0xa'));var querystring=require('querystring');var Papa=require(_0xad73('0x10'));var Redis=require(_0xad73('0x11'));var authService=require(_0xad73('0x12'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xad73('0x13'));var logger=require('../../config/logger')(_0xad73('0x14'));var utils=require('../../config/utils');var config=require(_0xad73('0x15'));var db=require(_0xad73('0x16'))['db'];function respondWithStatusCode(_0x2c10cc,_0x49d817){_0x49d817=_0x49d817||0xcc;return function(_0x1045be){if(_0x1045be){return _0x2c10cc[_0xad73('0x17')](_0x49d817);}return _0x2c10cc['status'](_0x49d817)[_0xad73('0x18')]();};}function respondWithResult(_0xadb4c0,_0x2ba4d5){_0x2ba4d5=_0x2ba4d5||0xc8;return function(_0x27a9d2){if(_0x27a9d2){return _0xadb4c0[_0xad73('0x19')](_0x2ba4d5)[_0xad73('0x1a')](_0x27a9d2);}};}function respondWithFilteredResult(_0x49d705,_0x3b5e73){return function(_0x35c2c5){if(_0x35c2c5){var _0x4336fa=_0x35c2c5[_0xad73('0x1b')],_0x155548=_0x3b5e73[_0xad73('0x1c')],_0x2f0dcd=_0x3b5e73[_0xad73('0x1c')]+_0x3b5e73[_0xad73('0x1d')],_0x9de467;if(_0x2f0dcd>=_0x4336fa){_0x2f0dcd=_0x4336fa;_0x9de467=0xc8;}else{_0x9de467=0xce;}_0x49d705['status'](_0x9de467);return _0x49d705[_0xad73('0x1e')]('Content-Range',_0x155548+'-'+_0x2f0dcd+'/'+_0x4336fa)['json'](_0x35c2c5);}return null;};}function patchUpdates(_0x28bd73){return function(_0x522010){try{jsonpatch[_0xad73('0x1f')](_0x522010,_0x28bd73,!![]);}catch(_0x578068){return BPromise[_0xad73('0x20')](_0x578068);}return _0x522010[_0xad73('0x21')]();};}function saveUpdates(_0x50c353,_0x3a8830){return function(_0x4289df){if(_0x4289df){return _0x4289df[_0xad73('0x22')](_0x50c353)[_0xad73('0x23')](function(_0x2e6cdb){return _0x2e6cdb;});}return null;};}function removeEntity(_0x3882c5,_0x7de098){return function(_0x497c3d){if(_0x497c3d){return _0x497c3d[_0xad73('0x24')]()[_0xad73('0x23')](function(){_0x3882c5[_0xad73('0x19')](0xcc)[_0xad73('0x18')]();});}};}function handleEntityNotFound(_0xb3e0b0,_0x2a1295){return function(_0xbfb297){if(!_0xbfb297){_0xb3e0b0[_0xad73('0x17')](0x194);}return _0xbfb297;};}function handleError(_0xcdb93d,_0x68aa8c){_0x68aa8c=_0x68aa8c||0x1f4;return function(_0x18e58b){logger[_0xad73('0x25')](_0x18e58b[_0xad73('0x26')]);if(_0x18e58b[_0xad73('0x27')]){delete _0x18e58b[_0xad73('0x27')];}_0xcdb93d[_0xad73('0x19')](_0x68aa8c)[_0xad73('0x28')](_0x18e58b);};}exports[_0xad73('0x29')]=function(_0xb7700c,_0x44fdd3){var _0x5bd387={},_0x4e0855={},_0x5cd6a6={'count':0x0,'rows':[]};var _0x366d96=db[_0xad73('0x2a')]['rawAttributes'];_0x4e0855[_0xad73('0x2b')]=_['keys'](_0x366d96);_0x4e0855['query']=_[_0xad73('0x2c')](_0xb7700c[_0xad73('0x2d')]);_0x4e0855[_0xad73('0x2e')]=_[_0xad73('0x2f')](_0x4e0855['model'],_0x4e0855[_0xad73('0x2d')]);_0x5bd387[_0xad73('0x30')]=_[_0xad73('0x2f')](_0x4e0855['model'],qs[_0xad73('0x31')](_0xb7700c[_0xad73('0x2d')][_0xad73('0x31')]));_0x5bd387[_0xad73('0x30')]=_0x5bd387[_0xad73('0x30')]['length']?_0x5bd387['attributes']:_0x4e0855['model'];if(!_0xb7700c[_0xad73('0x2d')]['hasOwnProperty'](_0xad73('0x32'))){_0x5bd387['limit']=qs[_0xad73('0x1d')](_0xb7700c[_0xad73('0x2d')]['limit']);_0x5bd387['offset']=qs[_0xad73('0x1c')](_0xb7700c[_0xad73('0x2d')]['offset']);}_0x5bd387['order']=qs[_0xad73('0x33')](_0xb7700c['query'][_0xad73('0x33')]);_0x5bd387[_0xad73('0x34')]=qs['filters'](_[_0xad73('0x35')](_0xb7700c['query'],_0x4e0855[_0xad73('0x2e')]));if(_0xb7700c[_0xad73('0x2d')][_0xad73('0x36')]){_0x5bd387[_0xad73('0x34')]=_[_0xad73('0x37')](_0x5bd387[_0xad73('0x34')],{'$or':_[_0xad73('0x38')](_0x366d96,function(_0x6ae389){if(_0x6ae389[_0xad73('0x39')]['key']!==_0xad73('0x3a')){var _0x3db333={};_0x3db333[_0x6ae389['field']]={'$like':'%'+_0xb7700c[_0xad73('0x2d')][_0xad73('0x36')]+'%'};return _0x3db333;}})});}_0x5bd387=_[_0xad73('0x37')]({},_0x5bd387,_0xb7700c[_0xad73('0x3b')]);var _0x45210f={'where':_0x5bd387[_0xad73('0x34')]};return db[_0xad73('0x2a')][_0xad73('0x1b')](_0x45210f)[_0xad73('0x23')](function(_0x4830f6){_0x5cd6a6[_0xad73('0x1b')]=_0x4830f6;if(_0xb7700c[_0xad73('0x2d')][_0xad73('0x3c')]){_0x5bd387['include']=[{'all':!![]}];}return db['UserProfileResource'][_0xad73('0x3d')](_0x5bd387);})['then'](function(_0x539e3a){_0x5cd6a6[_0xad73('0x3e')]=_0x539e3a;return _0x5cd6a6;})[_0xad73('0x23')](respondWithFilteredResult(_0x44fdd3,_0x5bd387))[_0xad73('0x3f')](handleError(_0x44fdd3,null));};exports[_0xad73('0x40')]=function(_0x4e68b5,_0x1f0bae){var _0x22130e={'raw':![],'where':{'id':_0x4e68b5[_0xad73('0x41')]['id']}},_0x486961={};_0x486961[_0xad73('0x2b')]=_['keys'](db[_0xad73('0x2a')][_0xad73('0x42')]);_0x486961[_0xad73('0x2d')]=_['keys'](_0x4e68b5[_0xad73('0x2d')]);_0x486961[_0xad73('0x2e')]=_[_0xad73('0x2f')](_0x486961[_0xad73('0x2b')],_0x486961[_0xad73('0x2d')]);_0x22130e['attributes']=_['intersection'](_0x486961['model'],qs[_0xad73('0x31')](_0x4e68b5[_0xad73('0x2d')][_0xad73('0x31')]));_0x22130e[_0xad73('0x30')]=_0x22130e[_0xad73('0x30')][_0xad73('0x43')]?_0x22130e[_0xad73('0x30')]:_0x486961['model'];if(_0x4e68b5[_0xad73('0x2d')][_0xad73('0x3c')]){_0x22130e['include']=[{'all':!![]}];}_0x22130e=_['merge']({},_0x22130e,_0x4e68b5[_0xad73('0x3b')]);return db[_0xad73('0x2a')][_0xad73('0x44')](_0x22130e)[_0xad73('0x23')](handleEntityNotFound(_0x1f0bae,null))['then'](respondWithResult(_0x1f0bae,null))[_0xad73('0x3f')](handleError(_0x1f0bae,null));};exports[_0xad73('0x45')]=function(_0xfea484,_0x5d8d87){return db[_0xad73('0x2a')][_0xad73('0x45')](_0xfea484[_0xad73('0x46')],{})[_0xad73('0x23')](respondWithResult(_0x5d8d87,0xc9))['catch'](handleError(_0x5d8d87,null));};exports['update']=function(_0x1abeb7,_0x24c9ab){if(_0x1abeb7[_0xad73('0x46')]['id']){delete _0x1abeb7[_0xad73('0x46')]['id'];}return db[_0xad73('0x2a')][_0xad73('0x44')]({'where':{'id':_0x1abeb7[_0xad73('0x41')]['id']}})[_0xad73('0x23')](handleEntityNotFound(_0x24c9ab,null))[_0xad73('0x23')](saveUpdates(_0x1abeb7['body'],null))['then'](respondWithResult(_0x24c9ab,null))[_0xad73('0x3f')](handleError(_0x24c9ab,null));};exports[_0xad73('0x24')]=function(_0xd5f21,_0x5b6e41){return db[_0xad73('0x2a')][_0xad73('0x44')]({'where':{'id':_0xd5f21[_0xad73('0x41')]['id']}})[_0xad73('0x23')](handleEntityNotFound(_0x5b6e41,null))['then'](removeEntity(_0x5b6e41,null))[_0xad73('0x3f')](handleError(_0x5b6e41,null));};exports[_0xad73('0x47')]=function(_0x2d3c38,_0x57473a){return db[_0xad73('0x2a')][_0xad73('0x47')]()[_0xad73('0x23')](respondWithResult(_0x57473a,null))[_0xad73('0x3f')](handleError(_0x57473a,null));}; \ No newline at end of file +var _0xf452=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','UserProfileResource','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0xd74d2,_0xab9924){var _0xfd602=function(_0xe708fc){while(--_0xe708fc){_0xd74d2['push'](_0xd74d2['shift']());}};_0xfd602(++_0xab9924);}(_0xf452,0x13b));var _0x2f45=function(_0x45e34a,_0x7473c2){_0x45e34a=_0x45e34a-0x0;var _0x3193fa=_0xf452[_0x45e34a];return _0x3193fa;};'use strict';var pdf=require(_0x2f45('0x0'));var emlformat=require(_0x2f45('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2f45('0x2'));var jsonpatch=require(_0x2f45('0x3'));var rp=require(_0x2f45('0x4'));var moment=require(_0x2f45('0x5'));var BPromise=require(_0x2f45('0x6'));var Mustache=require(_0x2f45('0x7'));var util=require(_0x2f45('0x8'));var path=require(_0x2f45('0x9'));var sox=require(_0x2f45('0xa'));var csv=require(_0x2f45('0xb'));var ejs=require(_0x2f45('0xc'));var fs=require('fs');var _=require(_0x2f45('0xd'));var squel=require(_0x2f45('0xe'));var crypto=require(_0x2f45('0xf'));var jsforce=require(_0x2f45('0x10'));var deskjs=require(_0x2f45('0x11'));var toCsv=require(_0x2f45('0xb'));var querystring=require(_0x2f45('0x12'));var Papa=require(_0x2f45('0x13'));var Redis=require(_0x2f45('0x14'));var authService=require(_0x2f45('0x15'));var qs=require(_0x2f45('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f45('0x17'));var utils=require(_0x2f45('0x18'));var config=require(_0x2f45('0x19'));var db=require(_0x2f45('0x1a'))['db'];function respondWithStatusCode(_0x148d14,_0x58b083){_0x58b083=_0x58b083||0xcc;return function(_0x14b367){if(_0x14b367){return _0x148d14['sendStatus'](_0x58b083);}return _0x148d14[_0x2f45('0x1b')](_0x58b083)[_0x2f45('0x1c')]();};}function respondWithResult(_0x4b6ee9,_0x2c3a9d){_0x2c3a9d=_0x2c3a9d||0xc8;return function(_0x2b43e7){if(_0x2b43e7){return _0x4b6ee9[_0x2f45('0x1b')](_0x2c3a9d)['json'](_0x2b43e7);}};}function respondWithFilteredResult(_0x141b82,_0x4c8274){return function(_0x70b84b){if(_0x70b84b){var _0x469fbe=_0x70b84b[_0x2f45('0x1d')],_0x5bd134=_0x4c8274['offset'],_0x2ac0bf=_0x4c8274['offset']+_0x4c8274['limit'],_0xf24703;if(_0x2ac0bf>=_0x469fbe){_0x2ac0bf=_0x469fbe;_0xf24703=0xc8;}else{_0xf24703=0xce;}_0x141b82[_0x2f45('0x1b')](_0xf24703);return _0x141b82[_0x2f45('0x1e')](_0x2f45('0x1f'),_0x5bd134+'-'+_0x2ac0bf+'/'+_0x469fbe)[_0x2f45('0x20')](_0x70b84b);}return null;};}function patchUpdates(_0x589c2f){return function(_0xb71b1f){try{jsonpatch[_0x2f45('0x21')](_0xb71b1f,_0x589c2f,!![]);}catch(_0x2cf411){return BPromise[_0x2f45('0x22')](_0x2cf411);}return _0xb71b1f[_0x2f45('0x23')]();};}function saveUpdates(_0x33c5ba,_0x4e748b){return function(_0x54683c){if(_0x54683c){return _0x54683c[_0x2f45('0x24')](_0x33c5ba)[_0x2f45('0x25')](function(_0x3d64b4){return _0x3d64b4;});}return null;};}function removeEntity(_0x434dfa,_0x275a61){return function(_0x303dbf){if(_0x303dbf){return _0x303dbf[_0x2f45('0x26')]()[_0x2f45('0x25')](function(){_0x434dfa['status'](0xcc)[_0x2f45('0x1c')]();});}};}function handleEntityNotFound(_0x190636,_0x4cfd00){return function(_0x7ff562){if(!_0x7ff562){_0x190636[_0x2f45('0x27')](0x194);}return _0x7ff562;};}function handleError(_0x53a10d,_0x1b8870){_0x1b8870=_0x1b8870||0x1f4;return function(_0x19bef7){logger[_0x2f45('0x28')](_0x19bef7[_0x2f45('0x29')]);if(_0x19bef7[_0x2f45('0x2a')]){delete _0x19bef7['name'];}_0x53a10d['status'](_0x1b8870)[_0x2f45('0x2b')](_0x19bef7);};}exports['index']=function(_0x4a5df2,_0x3c9541){var _0x507d86={},_0x44bf0f={},_0x264139={'count':0x0,'rows':[]};var _0x166792=db[_0x2f45('0x2c')][_0x2f45('0x2d')];_0x44bf0f[_0x2f45('0x2e')]=_[_0x2f45('0x2f')](_0x166792);_0x44bf0f[_0x2f45('0x30')]=_['keys'](_0x4a5df2[_0x2f45('0x30')]);_0x44bf0f[_0x2f45('0x31')]=_['intersection'](_0x44bf0f[_0x2f45('0x2e')],_0x44bf0f['query']);_0x507d86[_0x2f45('0x32')]=_[_0x2f45('0x33')](_0x44bf0f[_0x2f45('0x2e')],qs['fields'](_0x4a5df2['query'][_0x2f45('0x34')]));_0x507d86['attributes']=_0x507d86[_0x2f45('0x32')][_0x2f45('0x35')]?_0x507d86['attributes']:_0x44bf0f[_0x2f45('0x2e')];if(!_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x36')](_0x2f45('0x37'))){_0x507d86[_0x2f45('0x38')]=qs['limit'](_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x38')]);_0x507d86[_0x2f45('0x39')]=qs['offset'](_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x39')]);}_0x507d86[_0x2f45('0x3a')]=qs[_0x2f45('0x3b')](_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x3b')]);_0x507d86[_0x2f45('0x3c')]=qs[_0x2f45('0x31')](_[_0x2f45('0x3d')](_0x4a5df2['query'],_0x44bf0f['filters']));if(_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x3e')]){_0x507d86[_0x2f45('0x3c')]=_[_0x2f45('0x3f')](_0x507d86[_0x2f45('0x3c')],{'$or':_[_0x2f45('0x40')](_0x166792,function(_0x5cb0dd){if(_0x5cb0dd[_0x2f45('0x41')][_0x2f45('0x42')]!==_0x2f45('0x43')){var _0x4d4219={};_0x4d4219[_0x5cb0dd[_0x2f45('0x44')]]={'$like':'%'+_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x3e')]+'%'};return _0x4d4219;}})});}_0x507d86=_['merge']({},_0x507d86,_0x4a5df2[_0x2f45('0x45')]);var _0xd3b524={'where':_0x507d86[_0x2f45('0x3c')]};return db[_0x2f45('0x2c')][_0x2f45('0x1d')](_0xd3b524)['then'](function(_0x125538){_0x264139[_0x2f45('0x1d')]=_0x125538;if(_0x4a5df2[_0x2f45('0x30')][_0x2f45('0x46')]){_0x507d86[_0x2f45('0x47')]=[{'all':!![]}];}return db['UserProfileResource'][_0x2f45('0x48')](_0x507d86);})[_0x2f45('0x25')](function(_0x38910c){_0x264139[_0x2f45('0x49')]=_0x38910c;return _0x264139;})[_0x2f45('0x25')](respondWithFilteredResult(_0x3c9541,_0x507d86))[_0x2f45('0x4a')](handleError(_0x3c9541,null));};exports['show']=function(_0x4cc893,_0x5a8fc6){var _0x428f36={'raw':![],'where':{'id':_0x4cc893[_0x2f45('0x4b')]['id']}},_0x921194={};_0x921194[_0x2f45('0x2e')]=_[_0x2f45('0x2f')](db[_0x2f45('0x2c')][_0x2f45('0x2d')]);_0x921194['query']=_['keys'](_0x4cc893[_0x2f45('0x30')]);_0x921194['filters']=_['intersection'](_0x921194[_0x2f45('0x2e')],_0x921194[_0x2f45('0x30')]);_0x428f36[_0x2f45('0x32')]=_[_0x2f45('0x33')](_0x921194['model'],qs[_0x2f45('0x34')](_0x4cc893[_0x2f45('0x30')][_0x2f45('0x34')]));_0x428f36[_0x2f45('0x32')]=_0x428f36[_0x2f45('0x32')]['length']?_0x428f36[_0x2f45('0x32')]:_0x921194['model'];if(_0x4cc893[_0x2f45('0x30')][_0x2f45('0x46')]){_0x428f36[_0x2f45('0x47')]=[{'all':!![]}];}_0x428f36=_[_0x2f45('0x3f')]({},_0x428f36,_0x4cc893['options']);return db[_0x2f45('0x2c')][_0x2f45('0x4c')](_0x428f36)[_0x2f45('0x25')](handleEntityNotFound(_0x5a8fc6,null))['then'](respondWithResult(_0x5a8fc6,null))[_0x2f45('0x4a')](handleError(_0x5a8fc6,null));};exports[_0x2f45('0x4d')]=function(_0x30b948,_0xfa4d68){return db['UserProfileResource']['create'](_0x30b948[_0x2f45('0x4e')],{})['then'](respondWithResult(_0xfa4d68,0xc9))[_0x2f45('0x4a')](handleError(_0xfa4d68,null));};exports['update']=function(_0x42da7c,_0x5c16c7){if(_0x42da7c[_0x2f45('0x4e')]['id']){delete _0x42da7c[_0x2f45('0x4e')]['id'];}return db[_0x2f45('0x2c')][_0x2f45('0x4c')]({'where':{'id':_0x42da7c['params']['id']}})[_0x2f45('0x25')](handleEntityNotFound(_0x5c16c7,null))['then'](saveUpdates(_0x42da7c[_0x2f45('0x4e')],null))[_0x2f45('0x25')](respondWithResult(_0x5c16c7,null))[_0x2f45('0x4a')](handleError(_0x5c16c7,null));};exports[_0x2f45('0x26')]=function(_0x93e709,_0x34eca8){return db['UserProfileResource'][_0x2f45('0x4c')]({'where':{'id':_0x93e709[_0x2f45('0x4b')]['id']}})[_0x2f45('0x25')](handleEntityNotFound(_0x34eca8,null))['then'](removeEntity(_0x34eca8,null))[_0x2f45('0x4a')](handleError(_0x34eca8,null));};exports[_0x2f45('0x4f')]=function(_0x1e212b,_0x10e452){return db[_0x2f45('0x2c')][_0x2f45('0x4f')]()[_0x2f45('0x25')](respondWithResult(_0x10e452,null))[_0x2f45('0x4a')](handleError(_0x10e452,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f67b204..4020f27 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 _0x8e26=['rimraf','../../config/environment','exports','define','UserProfileResource','compositeIndex','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x4c9790,_0x314046){var _0x3282a4=function(_0x5b3e88){while(--_0x5b3e88){_0x4c9790['push'](_0x4c9790['shift']());}};_0x3282a4(++_0x314046);}(_0x8e26,0x10e));var _0x68e2=function(_0xf3633c,_0x4f389c){_0xf3633c=_0xf3633c-0x0;var _0x3644b1=_0x8e26[_0xf3633c];return _0x3644b1;};'use strict';var _=require(_0x68e2('0x0'));var util=require(_0x68e2('0x1'));var logger=require(_0x68e2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x68e2('0x3'));var rp=require(_0x68e2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68e2('0x5'));var config=require(_0x68e2('0x6'));var attributes=require('./userProfileResource.attributes');module[_0x68e2('0x7')]=function(_0x18ae2e,_0x2dfaae){return _0x18ae2e[_0x68e2('0x8')](_0x68e2('0x9'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x68e2('0xa'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc714=['resourceId','sectionId','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc714,0x144));var _0x4c71=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xc714[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c71('0x0'))(_0x4c71('0x1'));var moment=require(_0x4c71('0x2'));var BPromise=require('bluebird');var rp=require(_0x4c71('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c71('0x4'));var config=require(_0x4c71('0x5'));var attributes=require(_0x4c71('0x6'));module[_0x4c71('0x7')]=function(_0x466862,_0x2edd53){return _0x466862[_0x4c71('0x8')](_0x4c71('0x9'),attributes,{'tableName':_0x4c71('0xa'),'paranoid':![],'indexes':[{'name':_0x4c71('0xb'),'fields':[_0x4c71('0xc'),_0x4c71('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index e9d935f..e1b0844 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 _0x6455=['client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4d5929,_0x2b0ce7){var _0x3e8c6d=function(_0x34d45f){while(--_0x34d45f){_0x4d5929['push'](_0x4d5929['shift']());}};_0x3e8c6d(++_0x2b0ce7);}(_0x6455,0x97));var _0x5645=function(_0x19ed8b,_0x1b8e31){_0x19ed8b=_0x19ed8b-0x0;var _0x314727=_0x6455[_0x19ed8b];return _0x314727;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37d672,_0xa14a06,_0x278d86){return new BPromise(function(_0x518a28,_0x5f4037){return client[_0x5645('0xc')](_0x37d672,_0x278d86)[_0x5645('0xd')](function(_0x38c07a){logger[_0x5645('0xe')](_0x5645('0xf'),_0xa14a06,_0x5645('0x10'));logger['debug'](_0x5645('0x11'),_0xa14a06,_0x5645('0x10'),JSON[_0x5645('0x12')](_0x38c07a));if(_0x38c07a[_0x5645('0x13')]){if(_0x38c07a['error'][_0x5645('0x14')]===0x1f4){logger['error'](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);return _0x5f4037(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x38c07a[_0x5645('0x13')]['message']);return _0x518a28(_0x38c07a[_0x5645('0x13')][_0x5645('0x15')]);}else{logger[_0x5645('0xe')]('UserProfileResource,\x20%s,\x20%s',_0xa14a06,'request\x20sent');_0x518a28(_0x38c07a[_0x5645('0x16')][_0x5645('0x15')]);}})['catch'](function(_0x35e0c7){logger[_0x5645('0x13')](_0x5645('0xf'),_0xa14a06,_0x35e0c7);_0x5f4037(_0x35e0c7);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x53ec,0x192));var _0xc53e=function(_0x1bd85d,_0xdc683f){_0x1bd85d=_0x1bd85d-0x0;var _0xd40669=_0x53ec[_0x1bd85d];return _0xd40669;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9d37abd..11afc2f 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 _0xb4db=['show','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb4db,0x137));var _0xbb4d=function(_0x6d12c,_0x146c9c){_0x6d12c=_0x6d12c-0x0;var _0x50833b=_0xb4db[_0x6d12c];return _0x50833b;};'use strict';var multer=require(_0xbb4d('0x0'));var util=require('util');var path=require(_0xbb4d('0x1'));var timeout=require(_0xbb4d('0x2'));var express=require(_0xbb4d('0x3'));var router=express['Router']();var auth=require(_0xbb4d('0x4'));var interaction=require(_0xbb4d('0x5'));var config=require('../../config/environment');var controller=require(_0xbb4d('0x6'));router[_0xbb4d('0x7')]('/',auth[_0xbb4d('0x8')](),controller[_0xbb4d('0x9')]);router[_0xbb4d('0x7')](_0xbb4d('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xbb4d('0x7')](_0xbb4d('0xb'),auth[_0xbb4d('0x8')](),controller[_0xbb4d('0xc')]);router[_0xbb4d('0xd')]('/',auth[_0xbb4d('0x8')](),controller['create']);router[_0xbb4d('0xe')]('/:id',auth[_0xbb4d('0x8')](),controller[_0xbb4d('0xf')]);router[_0xbb4d('0x10')](_0xbb4d('0xb'),auth[_0xbb4d('0x8')](),controller[_0xbb4d('0x11')]);module[_0xbb4d('0x12')]=router; \ No newline at end of file +var _0x2621=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x186d17,_0x9fa8ef){var _0x5d4b89=function(_0x57bd70){while(--_0x57bd70){_0x186d17['push'](_0x186d17['shift']());}};_0x5d4b89(++_0x9fa8ef);}(_0x2621,0x14c));var _0x1262=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2621[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1262('0x0'));var util=require(_0x1262('0x1'));var path=require(_0x1262('0x2'));var timeout=require('connect-timeout');var express=require(_0x1262('0x3'));var router=express[_0x1262('0x4')]();var auth=require(_0x1262('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router[_0x1262('0x6')]('/',auth[_0x1262('0x7')](),controller[_0x1262('0x8')]);router[_0x1262('0x6')](_0x1262('0x9'),auth['isAuthenticated'](),controller[_0x1262('0xa')]);router[_0x1262('0x6')](_0x1262('0xb'),auth['isAuthenticated'](),controller[_0x1262('0xc')]);router[_0x1262('0xd')]('/',auth['isAuthenticated'](),controller[_0x1262('0xe')]);router[_0x1262('0xf')](_0x1262('0xb'),auth[_0x1262('0x7')](),controller[_0x1262('0x10')]);router[_0x1262('0x11')](_0x1262('0xb'),auth[_0x1262('0x7')](),controller[_0x1262('0x12')]);module[_0x1262('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index ea25b16..fc45853 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 _0xedd9=['exports','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue'];(function(_0x252dd1,_0x2d1129){var _0x4b1237=function(_0x4c66c9){while(--_0x4c66c9){_0x252dd1['push'](_0x252dd1['shift']());}};_0x4b1237(++_0x2d1129);}(_0xedd9,0xfc));var _0x9edd=function(_0x598446,_0x2045ef){_0x598446=_0x598446-0x0;var _0x24ff68=_0xedd9[_0x598446];return _0x24ff68;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9edd('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9edd('0x1')],'set':function(_0x36b53f){this['setDataValue'](_0x9edd('0x4'),_0x36b53f?_0x36b53f[_0x9edd('0x5')](''):[]);},'get':function(){return this[_0x9edd('0x6')](_0x9edd('0x4'))?this['getDataValue'](_0x9edd('0x4'))['split'](''):[];}}}; \ No newline at end of file +var _0xcb91=['BOOLEAN','crudPermissions','join','getDataValue','split','STRING','INTEGER'];(function(_0x4a1534,_0x3aca4c){var _0x292e20=function(_0x98dca1){while(--_0x98dca1){_0x4a1534['push'](_0x4a1534['shift']());}};_0x292e20(++_0x3aca4c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0xcb91[_0x4c1ec2];return _0x3f6f1c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x1cb9('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x1cb9('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x1cb9('0x0')],'set':function(_0x2c17b8){this['setDataValue'](_0x1cb9('0x3'),_0x2c17b8?_0x2c17b8[_0x1cb9('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0x1cb9('0x3'))?this[_0x1cb9('0x5')]('crudPermissions')[_0x1cb9('0x6')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 7cec486..2f93a8f 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 _0x7756=['show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','set','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','UserProfileSection','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','type','VIRTUAL','field','merge','options','include','findAll','rows','catch'];(function(_0xe113c4,_0x4b18b3){var _0x2cb97c=function(_0x580914){while(--_0x580914){_0xe113c4['push'](_0xe113c4['shift']());}};_0x2cb97c(++_0x4b18b3);}(_0x7756,0x16a));var _0x6775=function(_0x22de03,_0x493b71){_0x22de03=_0x22de03-0x0;var _0x4bae59=_0x7756[_0x22de03];return _0x4bae59;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6775('0x0'));var rimraf=require(_0x6775('0x1'));var zipdir=require(_0x6775('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6775('0x3'));var moment=require('moment');var BPromise=require(_0x6775('0x4'));var Mustache=require('mustache');var util=require(_0x6775('0x5'));var path=require('path');var sox=require(_0x6775('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6775('0x7'));var squel=require(_0x6775('0x8'));var crypto=require(_0x6775('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x6775('0xa'));var toCsv=require(_0x6775('0xb'));var querystring=require(_0x6775('0xc'));var Papa=require(_0x6775('0xd'));var Redis=require(_0x6775('0xe'));var authService=require(_0x6775('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x6775('0x10'));var logger=require(_0x6775('0x11'))(_0x6775('0x12'));var utils=require(_0x6775('0x13'));var config=require(_0x6775('0x14'));var db=require(_0x6775('0x15'))['db'];function respondWithStatusCode(_0x2e1515,_0x497819){_0x497819=_0x497819||0xcc;return function(_0x18a14b){if(_0x18a14b){return _0x2e1515['sendStatus'](_0x497819);}return _0x2e1515[_0x6775('0x16')](_0x497819)[_0x6775('0x17')]();};}function respondWithResult(_0x5abf9a,_0x304e3d){_0x304e3d=_0x304e3d||0xc8;return function(_0x58499b){if(_0x58499b){return _0x5abf9a[_0x6775('0x16')](_0x304e3d)['json'](_0x58499b);}};}function respondWithFilteredResult(_0x10f2a0,_0x493212){return function(_0x1899c0){if(_0x1899c0){var _0x47d2e1=_0x1899c0[_0x6775('0x18')],_0x314c5d=_0x493212[_0x6775('0x19')],_0x228370=_0x493212[_0x6775('0x19')]+_0x493212['limit'],_0x25b6d3;if(_0x228370>=_0x47d2e1){_0x228370=_0x47d2e1;_0x25b6d3=0xc8;}else{_0x25b6d3=0xce;}_0x10f2a0[_0x6775('0x16')](_0x25b6d3);return _0x10f2a0[_0x6775('0x1a')]('Content-Range',_0x314c5d+'-'+_0x228370+'/'+_0x47d2e1)[_0x6775('0x1b')](_0x1899c0);}return null;};}function patchUpdates(_0x4b4267){return function(_0x517fbb){try{jsonpatch[_0x6775('0x1c')](_0x517fbb,_0x4b4267,!![]);}catch(_0x43b997){return BPromise[_0x6775('0x1d')](_0x43b997);}return _0x517fbb[_0x6775('0x1e')]();};}function saveUpdates(_0x423c40,_0xf85ac2){return function(_0x2eb614){if(_0x2eb614){return _0x2eb614[_0x6775('0x1f')](_0x423c40)[_0x6775('0x20')](function(_0x5ed7d7){return _0x5ed7d7;});}return null;};}function removeEntity(_0x43decd,_0x356fcf){return function(_0x19fdf3){if(_0x19fdf3){return _0x19fdf3['destroy']()['then'](function(){_0x43decd[_0x6775('0x16')](0xcc)[_0x6775('0x17')]();});}};}function handleEntityNotFound(_0xbb6f6f,_0x4b2564){return function(_0x5e8512){if(!_0x5e8512){_0xbb6f6f[_0x6775('0x21')](0x194);}return _0x5e8512;};}function handleError(_0x16dc67,_0x256b08){_0x256b08=_0x256b08||0x1f4;return function(_0x561da4){logger['error'](_0x561da4[_0x6775('0x22')]);if(_0x561da4[_0x6775('0x23')]){delete _0x561da4[_0x6775('0x23')];}_0x16dc67['status'](_0x256b08)[_0x6775('0x24')](_0x561da4);};}exports[_0x6775('0x25')]=function(_0x2557fc,_0xe59237){var _0x1bea32={},_0x3f47c7={},_0x23548e={'count':0x0,'rows':[]};var _0x3f744d=db[_0x6775('0x26')][_0x6775('0x27')];_0x3f47c7[_0x6775('0x28')]=_[_0x6775('0x29')](_0x3f744d);_0x3f47c7[_0x6775('0x2a')]=_[_0x6775('0x29')](_0x2557fc['query']);_0x3f47c7[_0x6775('0x2b')]=_['intersection'](_0x3f47c7[_0x6775('0x28')],_0x3f47c7[_0x6775('0x2a')]);_0x1bea32[_0x6775('0x2c')]=_[_0x6775('0x2d')](_0x3f47c7[_0x6775('0x28')],qs[_0x6775('0x2e')](_0x2557fc['query'][_0x6775('0x2e')]));_0x1bea32['attributes']=_0x1bea32['attributes'][_0x6775('0x2f')]?_0x1bea32['attributes']:_0x3f47c7[_0x6775('0x28')];if(!_0x2557fc[_0x6775('0x2a')][_0x6775('0x30')]('nolimit')){_0x1bea32['limit']=qs[_0x6775('0x31')](_0x2557fc[_0x6775('0x2a')][_0x6775('0x31')]);_0x1bea32[_0x6775('0x19')]=qs[_0x6775('0x19')](_0x2557fc[_0x6775('0x2a')][_0x6775('0x19')]);}_0x1bea32[_0x6775('0x32')]=qs[_0x6775('0x33')](_0x2557fc['query'][_0x6775('0x33')]);_0x1bea32[_0x6775('0x34')]=qs[_0x6775('0x2b')](_[_0x6775('0x35')](_0x2557fc['query'],_0x3f47c7[_0x6775('0x2b')]));if(_0x2557fc[_0x6775('0x2a')][_0x6775('0x36')]){_0x1bea32[_0x6775('0x34')]=_['merge'](_0x1bea32['where'],{'$or':_['map'](_0x3f744d,function(_0x13a4e8){if(_0x13a4e8[_0x6775('0x37')]['key']!==_0x6775('0x38')){var _0x3c3d6d={};_0x3c3d6d[_0x13a4e8[_0x6775('0x39')]]={'$like':'%'+_0x2557fc['query'][_0x6775('0x36')]+'%'};return _0x3c3d6d;}})});}_0x1bea32=_[_0x6775('0x3a')]({},_0x1bea32,_0x2557fc[_0x6775('0x3b')]);var _0x2c7b59={'where':_0x1bea32[_0x6775('0x34')]};return db['UserProfileSection'][_0x6775('0x18')](_0x2c7b59)['then'](function(_0x264357){_0x23548e['count']=_0x264357;if(_0x2557fc[_0x6775('0x2a')]['includeAll']){_0x1bea32[_0x6775('0x3c')]=[{'all':!![]}];}return db[_0x6775('0x26')][_0x6775('0x3d')](_0x1bea32);})[_0x6775('0x20')](function(_0x152089){_0x23548e[_0x6775('0x3e')]=_0x152089;return _0x23548e;})[_0x6775('0x20')](respondWithFilteredResult(_0xe59237,_0x1bea32))[_0x6775('0x3f')](handleError(_0xe59237,null));};exports[_0x6775('0x40')]=function(_0x47163a,_0xd0bcc8){var _0x3966ef={'raw':![],'where':{'id':_0x47163a[_0x6775('0x41')]['id']}},_0x2b6a55={};_0x2b6a55[_0x6775('0x28')]=_[_0x6775('0x29')](db[_0x6775('0x26')]['rawAttributes']);_0x2b6a55['query']=_['keys'](_0x47163a[_0x6775('0x2a')]);_0x2b6a55[_0x6775('0x2b')]=_[_0x6775('0x2d')](_0x2b6a55['model'],_0x2b6a55[_0x6775('0x2a')]);_0x3966ef['attributes']=_[_0x6775('0x2d')](_0x2b6a55[_0x6775('0x28')],qs[_0x6775('0x2e')](_0x47163a[_0x6775('0x2a')][_0x6775('0x2e')]));_0x3966ef[_0x6775('0x2c')]=_0x3966ef['attributes'][_0x6775('0x2f')]?_0x3966ef[_0x6775('0x2c')]:_0x2b6a55[_0x6775('0x28')];if(_0x47163a[_0x6775('0x2a')]['includeAll']){_0x3966ef[_0x6775('0x3c')]=[{'all':!![]}];}_0x3966ef=_[_0x6775('0x3a')]({},_0x3966ef,_0x47163a[_0x6775('0x3b')]);return db[_0x6775('0x26')][_0x6775('0x42')](_0x3966ef)[_0x6775('0x20')](handleEntityNotFound(_0xd0bcc8,null))[_0x6775('0x20')](respondWithResult(_0xd0bcc8,null))['catch'](handleError(_0xd0bcc8,null));};exports[_0x6775('0x43')]=function(_0x3bab08,_0x5cf98f){return db[_0x6775('0x26')][_0x6775('0x43')](_0x3bab08[_0x6775('0x44')],{})[_0x6775('0x20')](respondWithResult(_0x5cf98f,0xc9))[_0x6775('0x3f')](handleError(_0x5cf98f,null));};exports[_0x6775('0x1f')]=function(_0x4e44a9,_0x47fa68){if(_0x4e44a9[_0x6775('0x44')]['id']){delete _0x4e44a9[_0x6775('0x44')]['id'];}return db[_0x6775('0x26')][_0x6775('0x42')]({'where':{'id':_0x4e44a9['params']['id']}})['then'](handleEntityNotFound(_0x47fa68,null))[_0x6775('0x20')](saveUpdates(_0x4e44a9['body'],null))[_0x6775('0x20')](respondWithResult(_0x47fa68,null))[_0x6775('0x3f')](handleError(_0x47fa68,null));};exports[_0x6775('0x45')]=function(_0x5f07ba,_0x4601fd){return db['UserProfileSection'][_0x6775('0x42')]({'where':{'id':_0x5f07ba['params']['id']}})['then'](handleEntityNotFound(_0x4601fd,null))['then'](removeEntity(_0x4601fd,null))[_0x6775('0x3f')](handleError(_0x4601fd,null));};exports[_0x6775('0x46')]=function(_0xafd427,_0x5425fc){return db['UserProfileSection'][_0x6775('0x46')]()[_0x6775('0x20')](respondWithResult(_0x5425fc,null))[_0x6775('0x3f')](handleError(_0x5425fc,null));}; \ No newline at end of file +var _0x0274=['count','offset','set','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','UserProfileSection','rawAttributes','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','key','field','filter','options','include','findAll','rows','show','params','length','includeAll','create','body','update','find','catch','describe','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','status','json'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x0274,0x1e9));var _0x4027=function(_0x36969d,_0x4d8059){_0x36969d=_0x36969d-0x0;var _0xbb52dc=_0x0274[_0x36969d];return _0xbb52dc;};'use strict';var pdf=require(_0x4027('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4027('0x1'));var jsonpatch=require(_0x4027('0x2'));var rp=require(_0x4027('0x3'));var moment=require(_0x4027('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4027('0x5'));var util=require(_0x4027('0x6'));var path=require(_0x4027('0x7'));var sox=require('sox');var csv=require(_0x4027('0x8'));var ejs=require(_0x4027('0x9'));var fs=require('fs');var _=require(_0x4027('0xa'));var squel=require(_0x4027('0xb'));var crypto=require(_0x4027('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4027('0x8'));var querystring=require('querystring');var Papa=require(_0x4027('0xd'));var Redis=require(_0x4027('0xe'));var authService=require(_0x4027('0xf'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0x4027('0x10'));var logger=require(_0x4027('0x11'))(_0x4027('0x12'));var utils=require(_0x4027('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d9009,_0x27e62b){_0x27e62b=_0x27e62b||0xcc;return function(_0x2f3893){if(_0x2f3893){return _0x3d9009['sendStatus'](_0x27e62b);}return _0x3d9009[_0x4027('0x14')](_0x27e62b)['end']();};}function respondWithResult(_0x4d15a7,_0x7fea70){_0x7fea70=_0x7fea70||0xc8;return function(_0x50094d){if(_0x50094d){return _0x4d15a7[_0x4027('0x14')](_0x7fea70)[_0x4027('0x15')](_0x50094d);}};}function respondWithFilteredResult(_0x5db33b,_0x34b306){return function(_0x347eae){if(_0x347eae){var _0x599ba7=_0x347eae[_0x4027('0x16')],_0x1364d1=_0x34b306['offset'],_0x4fa85e=_0x34b306[_0x4027('0x17')]+_0x34b306['limit'],_0xbcf1bb;if(_0x4fa85e>=_0x599ba7){_0x4fa85e=_0x599ba7;_0xbcf1bb=0xc8;}else{_0xbcf1bb=0xce;}_0x5db33b[_0x4027('0x14')](_0xbcf1bb);return _0x5db33b[_0x4027('0x18')](_0x4027('0x19'),_0x1364d1+'-'+_0x4fa85e+'/'+_0x599ba7)['json'](_0x347eae);}return null;};}function patchUpdates(_0x2c8fc6){return function(_0x310856){try{jsonpatch[_0x4027('0x1a')](_0x310856,_0x2c8fc6,!![]);}catch(_0x37176d){return BPromise[_0x4027('0x1b')](_0x37176d);}return _0x310856[_0x4027('0x1c')]();};}function saveUpdates(_0x5f0bfb,_0x8bede6){return function(_0x12e8ce){if(_0x12e8ce){return _0x12e8ce['update'](_0x5f0bfb)[_0x4027('0x1d')](function(_0x502045){return _0x502045;});}return null;};}function removeEntity(_0x40d125,_0x1214c5){return function(_0x3beac5){if(_0x3beac5){return _0x3beac5[_0x4027('0x1e')]()[_0x4027('0x1d')](function(){_0x40d125[_0x4027('0x14')](0xcc)[_0x4027('0x1f')]();});}};}function handleEntityNotFound(_0x1c849a,_0x24c20d){return function(_0x3c48ef){if(!_0x3c48ef){_0x1c849a[_0x4027('0x20')](0x194);}return _0x3c48ef;};}function handleError(_0x360401,_0x54ec9f){_0x54ec9f=_0x54ec9f||0x1f4;return function(_0x2d4710){logger[_0x4027('0x21')](_0x2d4710[_0x4027('0x22')]);if(_0x2d4710[_0x4027('0x23')]){delete _0x2d4710[_0x4027('0x23')];}_0x360401[_0x4027('0x14')](_0x54ec9f)[_0x4027('0x24')](_0x2d4710);};}exports['index']=function(_0x4cbcb2,_0x2c3e26){var _0x3ba3ca={},_0xd3d7dd={},_0x635f7c={'count':0x0,'rows':[]};var _0x23dd02=db[_0x4027('0x25')][_0x4027('0x26')];_0xd3d7dd[_0x4027('0x27')]=_[_0x4027('0x28')](_0x23dd02);_0xd3d7dd['query']=_[_0x4027('0x28')](_0x4cbcb2[_0x4027('0x29')]);_0xd3d7dd[_0x4027('0x2a')]=_[_0x4027('0x2b')](_0xd3d7dd['model'],_0xd3d7dd['query']);_0x3ba3ca[_0x4027('0x2c')]=_[_0x4027('0x2b')](_0xd3d7dd[_0x4027('0x27')],qs[_0x4027('0x2d')](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x2d')]));_0x3ba3ca['attributes']=_0x3ba3ca[_0x4027('0x2c')]['length']?_0x3ba3ca['attributes']:_0xd3d7dd['model'];if(!_0x4cbcb2[_0x4027('0x29')][_0x4027('0x2e')](_0x4027('0x2f'))){_0x3ba3ca[_0x4027('0x30')]=qs['limit'](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x30')]);_0x3ba3ca[_0x4027('0x17')]=qs['offset'](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x17')]);}_0x3ba3ca[_0x4027('0x31')]=qs[_0x4027('0x32')](_0x4cbcb2[_0x4027('0x29')][_0x4027('0x32')]);_0x3ba3ca[_0x4027('0x33')]=qs[_0x4027('0x2a')](_[_0x4027('0x34')](_0x4cbcb2['query'],_0xd3d7dd[_0x4027('0x2a')]));if(_0x4cbcb2[_0x4027('0x29')]['filter']){_0x3ba3ca[_0x4027('0x33')]=_[_0x4027('0x35')](_0x3ba3ca['where'],{'$or':_[_0x4027('0x36')](_0x23dd02,function(_0x371a24){if(_0x371a24[_0x4027('0x37')][_0x4027('0x38')]!=='VIRTUAL'){var _0x44e040={};_0x44e040[_0x371a24[_0x4027('0x39')]]={'$like':'%'+_0x4cbcb2[_0x4027('0x29')][_0x4027('0x3a')]+'%'};return _0x44e040;}})});}_0x3ba3ca=_[_0x4027('0x35')]({},_0x3ba3ca,_0x4cbcb2[_0x4027('0x3b')]);var _0x4de376={'where':_0x3ba3ca[_0x4027('0x33')]};return db[_0x4027('0x25')][_0x4027('0x16')](_0x4de376)[_0x4027('0x1d')](function(_0x2a5abc){_0x635f7c[_0x4027('0x16')]=_0x2a5abc;if(_0x4cbcb2['query']['includeAll']){_0x3ba3ca[_0x4027('0x3c')]=[{'all':!![]}];}return db[_0x4027('0x25')][_0x4027('0x3d')](_0x3ba3ca);})[_0x4027('0x1d')](function(_0x2ae16d){_0x635f7c[_0x4027('0x3e')]=_0x2ae16d;return _0x635f7c;})[_0x4027('0x1d')](respondWithFilteredResult(_0x2c3e26,_0x3ba3ca))['catch'](handleError(_0x2c3e26,null));};exports[_0x4027('0x3f')]=function(_0x99ed9d,_0x5306a1){var _0x5998ec={'raw':![],'where':{'id':_0x99ed9d[_0x4027('0x40')]['id']}},_0x20b790={};_0x20b790[_0x4027('0x27')]=_[_0x4027('0x28')](db[_0x4027('0x25')][_0x4027('0x26')]);_0x20b790['query']=_[_0x4027('0x28')](_0x99ed9d['query']);_0x20b790[_0x4027('0x2a')]=_[_0x4027('0x2b')](_0x20b790[_0x4027('0x27')],_0x20b790[_0x4027('0x29')]);_0x5998ec[_0x4027('0x2c')]=_[_0x4027('0x2b')](_0x20b790[_0x4027('0x27')],qs['fields'](_0x99ed9d[_0x4027('0x29')][_0x4027('0x2d')]));_0x5998ec[_0x4027('0x2c')]=_0x5998ec[_0x4027('0x2c')][_0x4027('0x41')]?_0x5998ec[_0x4027('0x2c')]:_0x20b790['model'];if(_0x99ed9d['query'][_0x4027('0x42')]){_0x5998ec[_0x4027('0x3c')]=[{'all':!![]}];}_0x5998ec=_['merge']({},_0x5998ec,_0x99ed9d[_0x4027('0x3b')]);return db[_0x4027('0x25')]['find'](_0x5998ec)[_0x4027('0x1d')](handleEntityNotFound(_0x5306a1,null))['then'](respondWithResult(_0x5306a1,null))['catch'](handleError(_0x5306a1,null));};exports[_0x4027('0x43')]=function(_0x1ec156,_0x5ad280){return db['UserProfileSection']['create'](_0x1ec156[_0x4027('0x44')],{})['then'](respondWithResult(_0x5ad280,0xc9))['catch'](handleError(_0x5ad280,null));};exports[_0x4027('0x45')]=function(_0x47fad7,_0x4656ad){if(_0x47fad7[_0x4027('0x44')]['id']){delete _0x47fad7['body']['id'];}return db['UserProfileSection'][_0x4027('0x46')]({'where':{'id':_0x47fad7[_0x4027('0x40')]['id']}})[_0x4027('0x1d')](handleEntityNotFound(_0x4656ad,null))['then'](saveUpdates(_0x47fad7['body'],null))[_0x4027('0x1d')](respondWithResult(_0x4656ad,null))[_0x4027('0x47')](handleError(_0x4656ad,null));};exports[_0x4027('0x1e')]=function(_0x2469ca,_0x76bd5c){return db['UserProfileSection'][_0x4027('0x46')]({'where':{'id':_0x2469ca[_0x4027('0x40')]['id']}})[_0x4027('0x1d')](handleEntityNotFound(_0x76bd5c,null))[_0x4027('0x1d')](removeEntity(_0x76bd5c,null))[_0x4027('0x47')](handleError(_0x76bd5c,null));};exports[_0x4027('0x48')]=function(_0x5f6740,_0x3c88f4){return db[_0x4027('0x25')][_0x4027('0x48')]()[_0x4027('0x1d')](respondWithResult(_0x3c88f4,null))[_0x4027('0x47')](handleError(_0x3c88f4,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 53dbff6..c90c4a8 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 _0xf40b=['define','user_profile_has_sections','compositeIndex','sectionId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./userProfileSection.attributes','exports'];(function(_0x27f42d,_0x5f506a){var _0x4be09b=function(_0x4c2a76){while(--_0x4c2a76){_0x27f42d['push'](_0x27f42d['shift']());}};_0x4be09b(++_0x5f506a);}(_0xf40b,0xfb));var _0xbf40=function(_0x3520c1,_0x1257ad){_0x3520c1=_0x3520c1-0x0;var _0x24e55c=_0xf40b[_0x3520c1];return _0x24e55c;};'use strict';var _=require('lodash');var util=require(_0xbf40('0x0'));var logger=require(_0xbf40('0x1'))('api');var moment=require(_0xbf40('0x2'));var BPromise=require(_0xbf40('0x3'));var rp=require(_0xbf40('0x4'));var fs=require('fs');var path=require(_0xbf40('0x5'));var rimraf=require(_0xbf40('0x6'));var config=require('../../config/environment');var attributes=require(_0xbf40('0x7'));module[_0xbf40('0x8')]=function(_0x26f871,_0x8d8bf7){return _0x26f871[_0xbf40('0x9')]('UserProfileSection',attributes,{'tableName':_0xbf40('0xa'),'paranoid':![],'indexes':[{'name':_0xbf40('0xb'),'fields':[_0xbf40('0xc'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x53cf=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x5a097c,_0x28506f){var _0x51b539=function(_0xd64448){while(--_0xd64448){_0x5a097c['push'](_0x5a097c['shift']());}};_0x51b539(++_0x28506f);}(_0x53cf,0xd4));var _0xf53c=function(_0x35b15b,_0x566c8f){_0x35b15b=_0x35b15b-0x0;var _0x46cbfb=_0x53cf[_0x35b15b];return _0x46cbfb;};'use strict';var _=require(_0xf53c('0x0'));var util=require(_0xf53c('0x1'));var logger=require('../../config/logger')(_0xf53c('0x2'));var moment=require(_0xf53c('0x3'));var BPromise=require(_0xf53c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf53c('0x5'));var rimraf=require(_0xf53c('0x6'));var config=require(_0xf53c('0x7'));var attributes=require(_0xf53c('0x8'));module[_0xf53c('0x9')]=function(_0x3f9a3f,_0x427a48){return _0x3f9a3f[_0xf53c('0xa')](_0xf53c('0xb'),attributes,{'tableName':_0xf53c('0xc'),'paranoid':![],'indexes':[{'name':_0xf53c('0xd'),'fields':[_0xf53c('0xe'),_0xf53c('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fde594c..0f20d51 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 _0xd21e=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x348729,_0x3df3bb){var _0x4cff5e=function(_0x428bd0){while(--_0x428bd0){_0x348729['push'](_0x348729['shift']());}};_0x4cff5e(++_0x3df3bb);}(_0xd21e,0x1e5));var _0xed21=function(_0x56ac85,_0x3b9f06){_0x56ac85=_0x56ac85-0x0;var _0x232bf5=_0xd21e[_0x56ac85];return _0x232bf5;};'use strict';var _=require(_0xed21('0x0'));var util=require(_0xed21('0x1'));var moment=require(_0xed21('0x2'));var BPromise=require(_0xed21('0x3'));var rs=require(_0xed21('0x4'));var fs=require('fs');var Redis=require(_0xed21('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xed21('0x6'));var logger=require(_0xed21('0x7'))(_0xed21('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed21('0x9')][_0xed21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e5385,_0x18b2a9,_0xbfa6e0){return new BPromise(function(_0x443237,_0x3735e3){return client[_0xed21('0xb')](_0x5e5385,_0xbfa6e0)[_0xed21('0xc')](function(_0x44ceab){logger['info'](_0xed21('0xd'),_0x18b2a9,_0xed21('0xe'));logger[_0xed21('0xf')](_0xed21('0x10'),_0x18b2a9,_0xed21('0xe'),JSON['stringify'](_0x44ceab));if(_0x44ceab[_0xed21('0x11')]){if(_0x44ceab[_0xed21('0x11')][_0xed21('0x12')]===0x1f4){logger[_0xed21('0x11')](_0xed21('0xd'),_0x18b2a9,_0x44ceab[_0xed21('0x11')][_0xed21('0x13')]);return _0x3735e3(_0x44ceab[_0xed21('0x11')][_0xed21('0x13')]);}logger['error'](_0xed21('0xd'),_0x18b2a9,_0x44ceab[_0xed21('0x11')][_0xed21('0x13')]);return _0x443237(_0x44ceab[_0xed21('0x11')][_0xed21('0x13')]);}else{logger[_0xed21('0x14')](_0xed21('0xd'),_0x18b2a9,_0xed21('0xe'));_0x443237(_0x44ceab[_0xed21('0x15')]['message']);}})['catch'](function(_0x453e90){logger[_0xed21('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x18b2a9,_0x453e90);_0x3735e3(_0x453e90);});});} \ No newline at end of file +var _0x4d4e=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x4d4e,0xa4));var _0xe4d4=function(_0x5b3aca,_0x3d0d08){_0x5b3aca=_0x5b3aca-0x0;var _0x3c93b1=_0x4d4e[_0x5b3aca];return _0x3c93b1;};'use strict';var _=require(_0xe4d4('0x0'));var util=require('util');var moment=require(_0xe4d4('0x1'));var BPromise=require(_0xe4d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4d4('0x3'));var db=require(_0xe4d4('0x4'))['db'];var utils=require(_0xe4d4('0x5'));var logger=require(_0xe4d4('0x6'))(_0xe4d4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4d4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6652,_0x4e9d70,_0xf010c6){return new BPromise(function(_0x3e422b,_0x14ec7a){return client[_0xe4d4('0x9')](_0x5b6652,_0xf010c6)[_0xe4d4('0xa')](function(_0x58cce7){logger['info'](_0xe4d4('0xb'),_0x4e9d70,_0xe4d4('0xc'));logger[_0xe4d4('0xd')](_0xe4d4('0xe'),_0x4e9d70,_0xe4d4('0xc'),JSON[_0xe4d4('0xf')](_0x58cce7));if(_0x58cce7[_0xe4d4('0x10')]){if(_0x58cce7[_0xe4d4('0x10')]['code']===0x1f4){logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0x58cce7[_0xe4d4('0x10')]['message']);return _0x14ec7a(_0x58cce7[_0xe4d4('0x10')][_0xe4d4('0x11')]);}logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0x58cce7['error']['message']);return _0x3e422b(_0x58cce7[_0xe4d4('0x10')]['message']);}else{logger[_0xe4d4('0x12')](_0xe4d4('0xb'),_0x4e9d70,'request\x20sent');_0x3e422b(_0x58cce7[_0xe4d4('0x13')][_0xe4d4('0x11')]);}})[_0xe4d4('0x14')](function(_0xad05a7){logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0xad05a7);_0x14ec7a(_0xad05a7);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index f3906df..77a79d7 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 _0xf417=['connect-timeout','Router','../../config/environment','util','path'];(function(_0x24759b,_0x2d5d64){var _0x27a029=function(_0xc1acab){while(--_0xc1acab){_0x24759b['push'](_0x24759b['shift']());}};_0x27a029(++_0x2d5d64);}(_0xf417,0x8f));var _0x7f41=function(_0x3d18af,_0x5b4fa0){_0x3d18af=_0x3d18af-0x0;var _0x2ef919=_0xf417[_0x3d18af];return _0x2ef919;};'use strict';var multer=require('multer');var util=require(_0x7f41('0x0'));var path=require(_0x7f41('0x1'));var timeout=require(_0x7f41('0x2'));var express=require('express');var router=express[_0x7f41('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f41('0x4'));module['exports']=router; \ No newline at end of file +var _0xf52f=['../../components/auth/service','../../config/environment','exports','multer','util','path','express','Router'];(function(_0x495537,_0x5bd4b3){var _0x719f9b=function(_0x5b3cc6){while(--_0x5b3cc6){_0x495537['push'](_0x495537['shift']());}};_0x719f9b(++_0x5bd4b3);}(_0xf52f,0x113));var _0xff52=function(_0x246568,_0x57af04){_0x246568=_0x246568-0x0;var _0x19b302=_0xf52f[_0x246568];return _0x19b302;};'use strict';var multer=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var path=require(_0xff52('0x2'));var timeout=require('connect-timeout');var express=require(_0xff52('0x3'));var router=express[_0xff52('0x4')]();var auth=require(_0xff52('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xff52('0x6'));module[_0xff52('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index c776d42..825ff27 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 _0x71e0=['exports','sequelize'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x71e0,0x6f));var _0x071e=function(_0x4f7c98,_0x48624b){_0x4f7c98=_0x4f7c98-0x0;var _0x370c1c=_0x71e0[_0x4f7c98];return _0x370c1c;};'use strict';var Sequelize=require(_0x071e('0x0'));module[_0x071e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xcf7e=['INTEGER','sequelize','exports'];(function(_0x240525,_0x4c1624){var _0x162759=function(_0x5cc0e0){while(--_0x5cc0e0){_0x240525['push'](_0x240525['shift']());}};_0x162759(++_0x4c1624);}(_0xcf7e,0x64));var _0xecf7=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xcf7e[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require(_0xecf7('0x0'));module[_0xecf7('0x1')]={'penalty':{'type':Sequelize[_0xecf7('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 226d2d1..288ad91 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 _0xb9e0=['./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x109f48,_0x40847c){var _0x197fff=function(_0x3b995b){while(--_0x3b995b){_0x109f48['push'](_0x109f48['shift']());}};_0x197fff(++_0x40847c);}(_0xb9e0,0x18c));var _0x0b9e=function(_0x2a3e5f,_0x24c745){_0x2a3e5f=_0x2a3e5f-0x0;var _0xfdbebc=_0xb9e0[_0x2a3e5f];return _0xfdbebc;};'use strict';var _=require(_0x0b9e('0x0'));var util=require(_0x0b9e('0x1'));var logger=require(_0x0b9e('0x2'))(_0x0b9e('0x3'));var moment=require(_0x0b9e('0x4'));var BPromise=require(_0x0b9e('0x5'));var rp=require(_0x0b9e('0x6'));var fs=require('fs');var path=require(_0x0b9e('0x7'));var rimraf=require(_0x0b9e('0x8'));var config=require(_0x0b9e('0x9'));var attributes=require(_0x0b9e('0xa'));module[_0x0b9e('0xb')]=function(_0x101c1c,_0x1c94fa){return _0x101c1c[_0x0b9e('0xc')](_0x0b9e('0xd'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa282=['exports','define','UserSmsQueue','user_has_sms_queues','lodash','api','bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x37b196,_0x2f3ad3){var _0x2dc4ec=function(_0x6dabad){while(--_0x6dabad){_0x37b196['push'](_0x37b196['shift']());}};_0x2dc4ec(++_0x2f3ad3);}(_0xa282,0x1f3));var _0x2a28=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xa282[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x2a28('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2a28('0x1'));var moment=require('moment');var BPromise=require(_0x2a28('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a28('0x3'));var rimraf=require(_0x2a28('0x4'));var config=require(_0x2a28('0x5'));var attributes=require(_0x2a28('0x6'));module[_0x2a28('0x7')]=function(_0x133fe9,_0x19b6e9){return _0x133fe9[_0x2a28('0x8')](_0x2a28('0x9'),attributes,{'tableName':_0x2a28('0xa'),'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 1918ed5..c672cca 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 _0x784a=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x266f14,_0x3b0b6e){var _0x10d394=function(_0x1ee3e5){while(--_0x1ee3e5){_0x266f14['push'](_0x266f14['shift']());}};_0x10d394(++_0x3b0b6e);}(_0x784a,0x97));var _0xa784=function(_0x2586ad,_0x3a2816){_0x2586ad=_0x2586ad-0x0;var _0x4128db=_0x784a[_0x2586ad];return _0x4128db;};'use strict';var _=require(_0xa784('0x0'));var util=require(_0xa784('0x1'));var moment=require(_0xa784('0x2'));var BPromise=require(_0xa784('0x3'));var rs=require(_0xa784('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa784('0x5'))(_0xa784('0x6'));var config=require(_0xa784('0x7'));var jayson=require(_0xa784('0x8'));var client=jayson[_0xa784('0x9')][_0xa784('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e09dc,_0x1e60ae,_0x69d9ba){return new BPromise(function(_0x1b33c6,_0x1b714f){return client[_0xa784('0xb')](_0x2e09dc,_0x69d9ba)[_0xa784('0xc')](function(_0x56b3e6){logger['info'](_0xa784('0xd'),_0x1e60ae,_0xa784('0xe'));logger[_0xa784('0xf')](_0xa784('0x10'),_0x1e60ae,_0xa784('0xe'),JSON[_0xa784('0x11')](_0x56b3e6));if(_0x56b3e6[_0xa784('0x12')]){if(_0x56b3e6['error'][_0xa784('0x13')]===0x1f4){logger[_0xa784('0x12')](_0xa784('0xd'),_0x1e60ae,_0x56b3e6[_0xa784('0x12')][_0xa784('0x14')]);return _0x1b714f(_0x56b3e6['error']['message']);}logger['error'](_0xa784('0xd'),_0x1e60ae,_0x56b3e6['error'][_0xa784('0x14')]);return _0x1b33c6(_0x56b3e6[_0xa784('0x12')][_0xa784('0x14')]);}else{logger[_0xa784('0x15')](_0xa784('0xd'),_0x1e60ae,_0xa784('0xe'));_0x1b33c6(_0x56b3e6[_0xa784('0x16')]['message']);}})[_0xa784('0x17')](function(_0x133154){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1e60ae,_0x133154);_0x1b714f(_0x133154);});});} \ No newline at end of file +var _0x12a1=['code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','stringify','error'];(function(_0x11acf3,_0x2b6ffb){var _0x27ab14=function(_0x5cd819){while(--_0x5cd819){_0x11acf3['push'](_0x11acf3['shift']());}};_0x27ab14(++_0x2b6ffb);}(_0x12a1,0x190));var _0x112a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x12a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x112a('0x0'));var util=require(_0x112a('0x1'));var moment=require(_0x112a('0x2'));var BPromise=require(_0x112a('0x3'));var rs=require(_0x112a('0x4'));var fs=require('fs');var Redis=require(_0x112a('0x5'));var db=require(_0x112a('0x6'))['db'];var utils=require(_0x112a('0x7'));var logger=require('../../config/logger')(_0x112a('0x8'));var config=require(_0x112a('0x9'));var jayson=require(_0x112a('0xa'));var client=jayson['client'][_0x112a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7e6787,_0x9b4a24,_0x5211e4){return new BPromise(function(_0x576817,_0x25050d){return client[_0x112a('0xc')](_0x7e6787,_0x5211e4)[_0x112a('0xd')](function(_0x1d06d3){logger[_0x112a('0xe')](_0x112a('0xf'),_0x9b4a24,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x9b4a24,'request\x20sent',JSON[_0x112a('0x10')](_0x1d06d3));if(_0x1d06d3[_0x112a('0x11')]){if(_0x1d06d3[_0x112a('0x11')][_0x112a('0x12')]===0x1f4){logger[_0x112a('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x9b4a24,_0x1d06d3[_0x112a('0x11')][_0x112a('0x13')]);return _0x25050d(_0x1d06d3[_0x112a('0x11')][_0x112a('0x13')]);}logger[_0x112a('0x11')](_0x112a('0xf'),_0x9b4a24,_0x1d06d3['error'][_0x112a('0x13')]);return _0x576817(_0x1d06d3[_0x112a('0x11')]['message']);}else{logger[_0x112a('0xe')](_0x112a('0xf'),_0x9b4a24,_0x112a('0x14'));_0x576817(_0x1d06d3['result']['message']);}})[_0x112a('0x15')](function(_0x3f976f){logger[_0x112a('0x11')](_0x112a('0xf'),_0x9b4a24,_0x3f976f);_0x25050d(_0x3f976f);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 94d9081..82b7d36 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 _0x7278=['../../config/environment','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x184b09,_0x3f0349){var _0xf01065=function(_0x42ee48){while(--_0x42ee48){_0x184b09['push'](_0x184b09['shift']());}};_0xf01065(++_0x3f0349);}(_0x7278,0x161));var _0x8727=function(_0x2e892f,_0x54bbc8){_0x2e892f=_0x2e892f-0x0;var _0x5b4a2a=_0x7278[_0x2e892f];return _0x5b4a2a;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var auth=require(_0x8727('0x5'));var interaction=require(_0x8727('0x6'));var config=require(_0x8727('0x7'));module[_0x8727('0x8')]=router; \ No newline at end of file +var _0x277c=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout'];(function(_0x2b91ea,_0x3904c4){var _0x30a5ec=function(_0x1b6351){while(--_0x1b6351){_0x2b91ea['push'](_0x2b91ea['shift']());}};_0x30a5ec(++_0x3904c4);}(_0x277c,0x153));var _0xc277=function(_0x2ec2ba,_0x26d588){_0x2ec2ba=_0x2ec2ba-0x0;var _0x1d7eeb=_0x277c[_0x2ec2ba];return _0x1d7eeb;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var auth=require(_0xc277('0x5'));var interaction=require(_0xc277('0x6'));var config=require(_0xc277('0x7'));module[_0xc277('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index c54117e..b4ad6f5 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 _0xd65c=['exports','INTEGER','sequelize'];(function(_0x2e0838,_0x113cbb){var _0x16741b=function(_0x3fc69b){while(--_0x3fc69b){_0x2e0838['push'](_0x2e0838['shift']());}};_0x16741b(++_0x113cbb);}(_0xd65c,0x143));var _0xcd65=function(_0x4a1ccd,_0x4e69c6){_0x4a1ccd=_0x4a1ccd-0x0;var _0x4a04f9=_0xd65c[_0x4a1ccd];return _0x4a04f9;};'use strict';var Sequelize=require(_0xcd65('0x0'));module[_0xcd65('0x1')]={'penalty':{'type':Sequelize[_0xcd65('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd2d5=['INTEGER','sequelize','exports'];(function(_0x49efb2,_0x4b9081){var _0x2cd91b=function(_0x34a682){while(--_0x34a682){_0x49efb2['push'](_0x49efb2['shift']());}};_0x2cd91b(++_0x4b9081);}(_0xd2d5,0x18a));var _0x5d2d=function(_0x9b2bb0,_0x3965b1){_0x9b2bb0=_0x9b2bb0-0x0;var _0x2cdb3b=_0xd2d5[_0x9b2bb0];return _0x2cdb3b;};'use strict';var Sequelize=require(_0x5d2d('0x0'));module[_0x5d2d('0x1')]={'penalty':{'type':Sequelize[_0x5d2d('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 3dcddb3..9ae8302 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 _0x4e51=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x948cd0,_0x33fe6e){var _0x57c054=function(_0x2479be){while(--_0x2479be){_0x948cd0['push'](_0x948cd0['shift']());}};_0x57c054(++_0x33fe6e);}(_0x4e51,0x162));var _0x14e5=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x4e51[_0x256e32];return _0x464070;};'use strict';var _=require(_0x14e5('0x0'));var util=require(_0x14e5('0x1'));var logger=require(_0x14e5('0x2'))(_0x14e5('0x3'));var moment=require(_0x14e5('0x4'));var BPromise=require(_0x14e5('0x5'));var rp=require(_0x14e5('0x6'));var fs=require('fs');var path=require(_0x14e5('0x7'));var rimraf=require(_0x14e5('0x8'));var config=require(_0x14e5('0x9'));var attributes=require(_0x14e5('0xa'));module['exports']=function(_0x168128,_0x552e2e){return _0x168128[_0x14e5('0xb')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x909e=['request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','util','api','bluebird'];(function(_0x4e074e,_0x35a42e){var _0x1fb96a=function(_0x432263){while(--_0x432263){_0x4e074e['push'](_0x4e074e['shift']());}};_0x1fb96a(++_0x35a42e);}(_0x909e,0x1a0));var _0xe909=function(_0x450518,_0x4f223b){_0x450518=_0x450518-0x0;var _0x180686=_0x909e[_0x450518];return _0x180686;};'use strict';var _=require(_0xe909('0x0'));var util=require(_0xe909('0x1'));var logger=require('../../config/logger')(_0xe909('0x2'));var moment=require('moment');var BPromise=require(_0xe909('0x3'));var rp=require(_0xe909('0x4'));var fs=require('fs');var path=require(_0xe909('0x5'));var rimraf=require(_0xe909('0x6'));var config=require(_0xe909('0x7'));var attributes=require(_0xe909('0x8'));module[_0xe909('0x9')]=function(_0x5064f0,_0x2a32e6){return _0x5064f0['define'](_0xe909('0xa'),attributes,{'tableName':_0xe909('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 3287e36..416939a 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 _0xdb1b=['catch','lodash','util','moment','bluebird','ioredis','../../config/utils','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdb1b,0x91));var _0xbdb1=function(_0x147cbf,_0x978989){_0x147cbf=_0x147cbf-0x0;var _0x583fa1=_0xdb1b[_0x147cbf];return _0x583fa1;};'use strict';var _=require(_0xbdb1('0x0'));var util=require(_0xbdb1('0x1'));var moment=require(_0xbdb1('0x2'));var BPromise=require(_0xbdb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdb1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdb1('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbdb1('0x6')][_0xbdb1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43257f,_0x4c15f4,_0x291da2){return new BPromise(function(_0x75eb5a,_0x3f0648){return client['request'](_0x43257f,_0x291da2)[_0xbdb1('0x8')](function(_0xba7ce9){logger[_0xbdb1('0x9')](_0xbdb1('0xa'),_0x4c15f4,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x4c15f4,_0xbdb1('0xb'),JSON[_0xbdb1('0xc')](_0xba7ce9));if(_0xba7ce9[_0xbdb1('0xd')]){if(_0xba7ce9[_0xbdb1('0xd')][_0xbdb1('0xe')]===0x1f4){logger[_0xbdb1('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x4c15f4,_0xba7ce9[_0xbdb1('0xd')]['message']);return _0x3f0648(_0xba7ce9[_0xbdb1('0xd')][_0xbdb1('0xf')]);}logger[_0xbdb1('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x4c15f4,_0xba7ce9['error'][_0xbdb1('0xf')]);return _0x75eb5a(_0xba7ce9['error']['message']);}else{logger[_0xbdb1('0x9')](_0xbdb1('0xa'),_0x4c15f4,'request\x20sent');_0x75eb5a(_0xba7ce9[_0xbdb1('0x10')]['message']);}})[_0xbdb1('0x11')](function(_0x26ccdc){logger[_0xbdb1('0xd')](_0xbdb1('0xa'),_0x4c15f4,_0x26ccdc);_0x3f0648(_0x26ccdc);});});} \ No newline at end of file +var _0x4a71=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x4a71,0xf7));var _0x14a7=function(_0x57b691,_0x47652b){_0x57b691=_0x57b691-0x0;var _0xb096bc=_0x4a71[_0x57b691];return _0xb096bc;};'use strict';var _=require(_0x14a7('0x0'));var util=require(_0x14a7('0x1'));var moment=require(_0x14a7('0x2'));var BPromise=require(_0x14a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14a7('0x4'))['db'];var utils=require(_0x14a7('0x5'));var logger=require(_0x14a7('0x6'))(_0x14a7('0x7'));var config=require(_0x14a7('0x8'));var jayson=require(_0x14a7('0x9'));var client=jayson[_0x14a7('0xa')][_0x14a7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24b2ac,_0x2c7094,_0x59e14b){return new BPromise(function(_0x4198cc,_0x4980c8){return client[_0x14a7('0xc')](_0x24b2ac,_0x59e14b)[_0x14a7('0xd')](function(_0x44b140){logger['info'](_0x14a7('0xe'),_0x2c7094,_0x14a7('0xf'));logger[_0x14a7('0x10')](_0x14a7('0x11'),_0x2c7094,_0x14a7('0xf'),JSON['stringify'](_0x44b140));if(_0x44b140[_0x14a7('0x12')]){if(_0x44b140[_0x14a7('0x12')][_0x14a7('0x13')]===0x1f4){logger['error'](_0x14a7('0xe'),_0x2c7094,_0x44b140['error']['message']);return _0x4980c8(_0x44b140[_0x14a7('0x12')]['message']);}logger[_0x14a7('0x12')](_0x14a7('0xe'),_0x2c7094,_0x44b140[_0x14a7('0x12')][_0x14a7('0x14')]);return _0x4198cc(_0x44b140[_0x14a7('0x12')][_0x14a7('0x14')]);}else{logger[_0x14a7('0x15')](_0x14a7('0xe'),_0x2c7094,_0x14a7('0xf'));_0x4198cc(_0x44b140[_0x14a7('0x16')][_0x14a7('0x14')]);}})[_0x14a7('0x17')](function(_0x1e1598){logger[_0x14a7('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x2c7094,_0x1e1598);_0x4980c8(_0x1e1598);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 3373bcd..503c2ff 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 _0x80c3=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','multer'];(function(_0x5f2e0e,_0x723550){var _0x5bc4c5=function(_0x343e22){while(--_0x343e22){_0x5f2e0e['push'](_0x5f2e0e['shift']());}};_0x5bc4c5(++_0x723550);}(_0x80c3,0x18f));var _0x380c=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x80c3[_0x13cab0];return _0x38804f;};'use strict';var multer=require(_0x380c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x380c('0x1'));var express=require('express');var router=express[_0x380c('0x2')]();var auth=require(_0x380c('0x3'));var interaction=require(_0x380c('0x4'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x8085=['connect-timeout','express','Router','../../components/auth/service','exports','multer'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8085,0x71));var _0x5808=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x8085[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var auth=require(_0x5808('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x5808('0x5')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index e635b76..5d8d915 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 _0x571c=['STRING','queue_interface','INTEGER','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x3ce978,_0x9b9581){var _0x2bf352=function(_0x131c8e){while(--_0x131c8e){_0x3ce978['push'](_0x3ce978['shift']());}};_0x2bf352(++_0x9b9581);}(_0x571c,0x19b));var _0xc571=function(_0x2ff19b,_0x1599ec){_0x2ff19b=_0x2ff19b-0x0;var _0x4f88ef=_0x571c[_0x2ff19b];return _0x4f88ef;};'use strict';var Sequelize=require(_0xc571('0x0'));module[_0xc571('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc571('0x2')},'membername':{'type':Sequelize[_0xc571('0x3')],'allowNull':![],'comment':_0xc571('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc571('0x4'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xc571('0x5')],'allowNull':![]},'interface':{'type':Sequelize[_0xc571('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xc571('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xc571('0x5')](0xb),'defaultValue':0x0,'comment':_0xc571('0x2')}}; \ No newline at end of file +var _0xd79e=['Required\x20by\x20Asterisk','STRING','queue_interface','INTEGER'];(function(_0x1a23d,_0xabcefd){var _0x1e2fb4=function(_0xacd27){while(--_0xacd27){_0x1a23d['push'](_0x1a23d['shift']());}};_0x1e2fb4(++_0xabcefd);}(_0xd79e,0x70));var _0xed79=function(_0x5bceca,_0x4eb998){_0x5bceca=_0x5bceca-0x0;var _0x2d3889=_0xd79e[_0x5bceca];return _0x2d3889;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xed79('0x0')},'membername':{'type':Sequelize[_0xed79('0x1')],'allowNull':![],'comment':_0xed79('0x0')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xed79('0x1')],'allowNull':![],'unique':'queue_interface','comment':_0xed79('0x0')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xed79('0x1')],'allowNull':![],'unique':_0xed79('0x2'),'comment':_0xed79('0x0')},'penalty':{'type':Sequelize[_0xed79('0x3')](0xb),'defaultValue':0x0,'comment':_0xed79('0x0')},'paused':{'type':Sequelize[_0xed79('0x3')](0xb),'defaultValue':0x0,'comment':_0xed79('0x0')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index f029b02..0227ceb 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 _0xddae=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5400fe,_0xe573ea){var _0x8af9f5=function(_0x15abc2){while(--_0x15abc2){_0x5400fe['push'](_0x5400fe['shift']());}};_0x8af9f5(++_0xe573ea);}(_0xddae,0x8c));var _0xedda=function(_0x535d41,_0x1e37dd){_0x535d41=_0x535d41-0x0;var _0x512047=_0xddae[_0x535d41];return _0x512047;};'use strict';var EventEmitter=require(_0xedda('0x0'));var UserVoiceQueueRt=require(_0xedda('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xedda('0x2')](0x0);var events={'afterCreate':_0xedda('0x3'),'afterUpdate':_0xedda('0x4'),'afterDestroy':_0xedda('0x5')};function emitEvent(_0xc641fd){return function(_0x430e14,_0x12d3af,_0x1c934c){UserVoiceQueueRtEvents[_0xedda('0x6')](_0xc641fd+':'+_0x430e14['id'],_0x430e14);UserVoiceQueueRtEvents[_0xedda('0x6')](_0xc641fd,_0x430e14);_0x1c934c(null);};}for(var e in events){if(events[_0xedda('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xedda('0x8')](e,emitEvent(event));}}module[_0xedda('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x3445=['update','remove','emit','hook','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save'];(function(_0x4829be,_0x1c3f24){var _0x1333e7=function(_0x2348be){while(--_0x2348be){_0x4829be['push'](_0x4829be['shift']());}};_0x1333e7(++_0x1c3f24);}(_0x3445,0x95));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x5344('0x0'))['db'][_0x5344('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5344('0x2')](0x0);var events={'afterCreate':_0x5344('0x3'),'afterUpdate':_0x5344('0x4'),'afterDestroy':_0x5344('0x5')};function emitEvent(_0x2d520c){return function(_0x563962,_0x20a77f,_0x27c2d4){UserVoiceQueueRtEvents[_0x5344('0x6')](_0x2d520c+':'+_0x563962['id'],_0x563962);UserVoiceQueueRtEvents[_0x5344('0x6')](_0x2d520c,_0x563962);_0x27c2d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x5344('0x7')](e,emitEvent(event));}}module[_0x5344('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index dea062a..8d913c0 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 _0xb24a=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./userVoiceQueueRt.attributes'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0xb24a,0x19b));var _0xab24=function(_0xd60031,_0x5efb93){_0xd60031=_0xd60031-0x0;var _0x43d00a=_0xb24a[_0xd60031];return _0x43d00a;};'use strict';var _=require(_0xab24('0x0'));var util=require(_0xab24('0x1'));var logger=require(_0xab24('0x2'))('api');var moment=require(_0xab24('0x3'));var BPromise=require(_0xab24('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xab24('0x5'));var attributes=require(_0xab24('0x6'));module[_0xab24('0x7')]=function(_0x3c3d09,_0x264d30){return _0x3c3d09[_0xab24('0x8')](_0xab24('0x9'),attributes,{'tableName':_0xab24('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x26ad=['UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define'];(function(_0x321c7b,_0x589c78){var _0x31e12b=function(_0x2d4ded){while(--_0x2d4ded){_0x321c7b['push'](_0x321c7b['shift']());}};_0x31e12b(++_0x589c78);}(_0x26ad,0x17c));var _0xd26a=function(_0xc83285,_0x3860f3){_0xc83285=_0xc83285-0x0;var _0x59ef36=_0x26ad[_0xc83285];return _0x59ef36;};'use strict';var _=require(_0xd26a('0x0'));var util=require(_0xd26a('0x1'));var logger=require(_0xd26a('0x2'))(_0xd26a('0x3'));var moment=require(_0xd26a('0x4'));var BPromise=require(_0xd26a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd26a('0x6'));var rimraf=require(_0xd26a('0x7'));var config=require(_0xd26a('0x8'));var attributes=require(_0xd26a('0x9'));module[_0xd26a('0xa')]=function(_0x3126df,_0x4cf662){return _0x3126df[_0xd26a('0xb')](_0xd26a('0xc'),attributes,{'tableName':_0xd26a('0xd'),'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 10a4c78..32db451 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 _0x55e5=['rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x128e7e,_0x2f9b63){var _0x4ab22e=function(_0x123692){while(--_0x123692){_0x128e7e['push'](_0x128e7e['shift']());}};_0x4ab22e(++_0x2f9b63);}(_0x55e5,0xd0));var _0x555e=function(_0x8b285,_0x2e7ffb){_0x8b285=_0x8b285-0x0;var _0x360376=_0x55e5[_0x8b285];return _0x360376;};'use strict';var _=require(_0x555e('0x0'));var util=require(_0x555e('0x1'));var moment=require('moment');var BPromise=require(_0x555e('0x2'));var rs=require(_0x555e('0x3'));var fs=require('fs');var Redis=require(_0x555e('0x4'));var db=require(_0x555e('0x5'))['db'];var utils=require(_0x555e('0x6'));var logger=require(_0x555e('0x7'))(_0x555e('0x8'));var config=require(_0x555e('0x9'));var jayson=require(_0x555e('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x555e('0xb')]=_[_0x555e('0xc')](config['redis'],{'host':_0x555e('0xd'),'port':0x18eb});var socket=require(_0x555e('0xe'))(new Redis(config[_0x555e('0xb')]));require(_0x555e('0xf'))['register'](socket);function respondWithRpcPromise(_0x4a32e6,_0x1036eb,_0x33f8ae){return new BPromise(function(_0x3e1c41,_0x1b268e){return client[_0x555e('0x10')](_0x4a32e6,_0x33f8ae)['then'](function(_0x1a7256){logger[_0x555e('0x11')](_0x555e('0x12'),_0x1036eb,_0x555e('0x13'));logger['debug'](_0x555e('0x14'),_0x1036eb,'request\x20sent',JSON[_0x555e('0x15')](_0x1a7256));if(_0x1a7256[_0x555e('0x16')]){if(_0x1a7256[_0x555e('0x16')][_0x555e('0x17')]===0x1f4){logger[_0x555e('0x16')](_0x555e('0x12'),_0x1036eb,_0x1a7256[_0x555e('0x16')][_0x555e('0x18')]);return _0x1b268e(_0x1a7256[_0x555e('0x16')][_0x555e('0x18')]);}logger[_0x555e('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1036eb,_0x1a7256['error']['message']);return _0x3e1c41(_0x1a7256[_0x555e('0x16')][_0x555e('0x18')]);}else{logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x1036eb,_0x555e('0x13'));_0x3e1c41(_0x1a7256[_0x555e('0x19')]['message']);}})[_0x555e('0x1a')](function(_0x104a4c){logger[_0x555e('0x16')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1036eb,_0x104a4c);_0x1b268e(_0x104a4c);});});}exports[_0x555e('0x1b')]=function(_0x2050bf){var _0x4b309c=this;return new Promise(function(_0x34e0a3,_0x55179a){return db['UserVoiceQueueRt'][_0x555e('0x1c')]({'raw':_0x2050bf[_0x555e('0x1d')]?_0x2050bf[_0x555e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2050bf[_0x555e('0x1d')]?_0x2050bf[_0x555e('0x1d')][_0x555e('0x1e')]||null:null,'attributes':[[db[_0x555e('0x1f')]['fn'](_0x555e('0x20'),db[_0x555e('0x1f')]['fn']('IF',db[_0x555e('0x1f')][_0x555e('0x21')](_0x555e('0x22')))),'outboundQueuePauses']]})['then'](function(_0x33cf90){logger['info'](_0x555e('0x1b'),_0x2050bf);logger[_0x555e('0x23')](_0x555e('0x1b'),_0x2050bf,JSON['stringify'](_0x33cf90));_0x34e0a3(_0x33cf90);})[_0x555e('0x1a')](function(_0x5f1ea0){logger[_0x555e('0x16')](_0x555e('0x1b'),_0x5f1ea0[_0x555e('0x18')],_0x2050bf);_0x55179a(_0x4b309c[_0x555e('0x16')](0x1f4,_0x5f1ea0[_0x555e('0x18')]));});});}; \ No newline at end of file +var _0x58e6=['redis','defaults','localhost','register','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x44d9b8,_0x261968){var _0x2e2c3e=function(_0x45ce77){while(--_0x45ce77){_0x44d9b8['push'](_0x44d9b8['shift']());}};_0x2e2c3e(++_0x261968);}(_0x58e6,0xe4));var _0x658e=function(_0x2bdaf8,_0x36cb7d){_0x2bdaf8=_0x2bdaf8-0x0;var _0x3a31a3=_0x58e6[_0x2bdaf8];return _0x3a31a3;};'use strict';var _=require(_0x658e('0x0'));var util=require(_0x658e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x658e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x658e('0x3'))['db'];var utils=require(_0x658e('0x4'));var logger=require(_0x658e('0x5'))(_0x658e('0x6'));var config=require(_0x658e('0x7'));var jayson=require(_0x658e('0x8'));var client=jayson['client'][_0x658e('0x9')]({'port':0x232a});config[_0x658e('0xa')]=_[_0x658e('0xb')](config[_0x658e('0xa')],{'host':_0x658e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x658e('0xd')](socket);function respondWithRpcPromise(_0x23754f,_0x4a38df,_0x15799a){return new BPromise(function(_0x127d78,_0x45db85){return client['request'](_0x23754f,_0x15799a)[_0x658e('0xe')](function(_0x42061a){logger[_0x658e('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4a38df,_0x658e('0x10'));logger[_0x658e('0x11')](_0x658e('0x12'),_0x4a38df,'request\x20sent',JSON[_0x658e('0x13')](_0x42061a));if(_0x42061a[_0x658e('0x14')]){if(_0x42061a['error']['code']===0x1f4){logger[_0x658e('0x14')](_0x658e('0x15'),_0x4a38df,_0x42061a[_0x658e('0x14')]['message']);return _0x45db85(_0x42061a[_0x658e('0x14')][_0x658e('0x16')]);}logger[_0x658e('0x14')](_0x658e('0x15'),_0x4a38df,_0x42061a[_0x658e('0x14')][_0x658e('0x16')]);return _0x127d78(_0x42061a[_0x658e('0x14')][_0x658e('0x16')]);}else{logger[_0x658e('0xf')](_0x658e('0x15'),_0x4a38df,_0x658e('0x10'));_0x127d78(_0x42061a[_0x658e('0x17')][_0x658e('0x16')]);}})[_0x658e('0x18')](function(_0x4e0405){logger[_0x658e('0x14')](_0x658e('0x15'),_0x4a38df,_0x4e0405);_0x45db85(_0x4e0405);});});}exports['GetVoiceQueueRtPauses']=function(_0x2bbf51){var _0x3101fe=this;return new Promise(function(_0x49b273,_0x492b96){return db['UserVoiceQueueRt'][_0x658e('0x19')]({'raw':_0x2bbf51[_0x658e('0x1a')]?_0x2bbf51[_0x658e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x2bbf51[_0x658e('0x1a')]?_0x2bbf51[_0x658e('0x1a')][_0x658e('0x1b')]||null:null,'attributes':[[db[_0x658e('0x1c')]['fn'](_0x658e('0x1d'),db[_0x658e('0x1c')]['fn']('IF',db[_0x658e('0x1c')][_0x658e('0x1e')](_0x658e('0x1f')))),_0x658e('0x20')]]})[_0x658e('0xe')](function(_0x360853){logger[_0x658e('0xf')]('GetVoiceQueueRtPauses',_0x2bbf51);logger['debug'](_0x658e('0x21'),_0x2bbf51,JSON[_0x658e('0x13')](_0x360853));_0x49b273(_0x360853);})['catch'](function(_0x149ee5){logger['error'](_0x658e('0x21'),_0x149ee5[_0x658e('0x16')],_0x2bbf51);_0x492b96(_0x3101fe[_0x658e('0x14')](0x1f4,_0x149ee5['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 47f1f6e..2ae7433 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 _0x56e7=['emit','removeListener','length','save','remove'];(function(_0x25aed1,_0x169850){var _0x53378c=function(_0x1aa8f7){while(--_0x1aa8f7){_0x25aed1['push'](_0x25aed1['shift']());}};_0x53378c(++_0x169850);}(_0x56e7,0x7b));var _0x756e=function(_0x320000,_0x2d4067){_0x320000=_0x320000-0x0;var _0x1f6901=_0x56e7[_0x320000];return _0x1f6901;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x756e('0x0'),_0x756e('0x1'),'update'];function createListener(_0x2eadee,_0x3efe5c){return function(_0x46a672){_0x3efe5c[_0x756e('0x2')](_0x2eadee,_0x46a672);};}function removeListener(_0x11ce5f,_0x38546a){return function(){UserVoiceQueueRtEvents[_0x756e('0x3')](_0x11ce5f,_0x38546a);};}exports['register']=function(_0x3b3b8f){for(var _0x404189=0x0,_0x26519d=events[_0x756e('0x4')];_0x404189<_0x26519d;_0x404189++){var _0x5c8589=events[_0x404189];var _0x1c6a22=createListener('userVoiceQueueRt:'+_0x5c8589,_0x3b3b8f);UserVoiceQueueRtEvents['on'](_0x5c8589,_0x1c6a22);}}; \ No newline at end of file +var _0x84e7=['save','remove','emit','removeListener','register'];(function(_0x4f8e3a,_0x4b3bce){var _0x3e78bb=function(_0x1423a3){while(--_0x1423a3){_0x4f8e3a['push'](_0x4f8e3a['shift']());}};_0x3e78bb(++_0x4b3bce);}(_0x84e7,0x122));var _0x784e=function(_0x59521a,_0x5d9ace){_0x59521a=_0x59521a-0x0;var _0x11fd4d=_0x84e7[_0x59521a];return _0x11fd4d;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x784e('0x0'),_0x784e('0x1'),'update'];function createListener(_0x3548d2,_0x2c1d96){return function(_0x50f44d){_0x2c1d96[_0x784e('0x2')](_0x3548d2,_0x50f44d);};}function removeListener(_0x14cee2,_0x205619){return function(){UserVoiceQueueRtEvents[_0x784e('0x3')](_0x14cee2,_0x205619);};}exports[_0x784e('0x4')]=function(_0x133296){for(var _0x48ed22=0x0,_0x3cbdd1=events['length'];_0x48ed22<_0x3cbdd1;_0x48ed22++){var _0xfaa170=events[_0x48ed22];var _0x24654d=createListener('userVoiceQueueRt:'+_0xfaa170,_0x133296);UserVoiceQueueRtEvents['on'](_0xfaa170,_0x24654d);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2ef7733..b235dba 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 _0xb4e6=['index','/:id','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x406eb7,_0x5cc124){var _0x38fdd1=function(_0x2d46d8){while(--_0x2d46d8){_0x406eb7['push'](_0x406eb7['shift']());}};_0x38fdd1(++_0x5cc124);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0xb4e6[_0x15cbce];return _0x257f29;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var auth=require(_0x6b4e('0x5'));var interaction=require(_0x6b4e('0x6'));var config=require(_0x6b4e('0x7'));var controller=require('./variable.controller');router[_0x6b4e('0x8')]('/',auth[_0x6b4e('0x9')](),controller[_0x6b4e('0xa')]);router['get'](_0x6b4e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6b4e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b4e('0xd')](_0x6b4e('0xb'),auth[_0x6b4e('0x9')](),controller[_0x6b4e('0xe')]);router[_0x6b4e('0xf')](_0x6b4e('0xb'),auth[_0x6b4e('0x9')](),controller['destroy']);module[_0x6b4e('0x10')]=router; \ No newline at end of file +var _0x4483=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x237ca6,_0x438308){var _0x3465c3=function(_0x3eab93){while(--_0x3eab93){_0x237ca6['push'](_0x237ca6['shift']());}};_0x3465c3(++_0x438308);}(_0x4483,0x1a3));var _0x3448=function(_0x38e7da,_0x50474a){_0x38e7da=_0x38e7da-0x0;var _0xf24a25=_0x4483[_0x38e7da];return _0xf24a25;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var auth=require(_0x3448('0x5'));var interaction=require(_0x3448('0x6'));var config=require(_0x3448('0x7'));var controller=require('./variable.controller');router[_0x3448('0x8')]('/',auth[_0x3448('0x9')](),controller[_0x3448('0xa')]);router[_0x3448('0x8')](_0x3448('0xb'),auth[_0x3448('0x9')](),controller[_0x3448('0xc')]);router[_0x3448('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3448('0xe')](_0x3448('0xb'),auth[_0x3448('0x9')](),controller[_0x3448('0xf')]);router[_0x3448('0x10')](_0x3448('0xb'),auth[_0x3448('0x9')](),controller[_0x3448('0x11')]);module[_0x3448('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 30dc002..598ef91 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 _0x3863=['STRING','name'];(function(_0x57c30d,_0x177c08){var _0x59d14b=function(_0x9b0ed){while(--_0x9b0ed){_0x57c30d['push'](_0x57c30d['shift']());}};_0x59d14b(++_0x177c08);}(_0x3863,0x72));var _0x3386=function(_0x1e8e29,_0x44eac6){_0x1e8e29=_0x1e8e29-0x0;var _0x4a973d=_0x3863[_0x1e8e29];return _0x4a973d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3386('0x0')],'unique':_0x3386('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x3386('0x0')]}}; \ No newline at end of file +var _0x97a0=['exports','STRING','sequelize'];(function(_0x15a8fa,_0x4652b2){var _0x1355c2=function(_0x203292){while(--_0x203292){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x1355c2(++_0x4652b2);}(_0x97a0,0xc5));var _0x097a=function(_0x27c2dd,_0x45aec3){_0x27c2dd=_0x27c2dd-0x0;var _0x9456e1=_0x97a0[_0x27c2dd];return _0x9456e1;};'use strict';var Sequelize=require(_0x097a('0x0'));module[_0x097a('0x1')]={'name':{'type':Sequelize[_0x097a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x097a('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index b9dcf79..2a20f22 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 _0x4d9e=['where','pick','filter','merge','map','type','key','VIRTUAL','field','findAll','rows','catch','show','params','includeAll','options','create','body','user','get','role','Variables','find','userProfileId','name','error','html-pdf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','set','apply','reject','update','then','UserProfileResource','destroy','index','Variable','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','limit','order','sort'];(function(_0x294032,_0x4ed889){var _0x5e9616=function(_0x4a5648){while(--_0x4a5648){_0x294032['push'](_0x294032['shift']());}};_0x5e9616(++_0x4ed889);}(_0x4d9e,0x18c));var _0xe4d9=function(_0x4a56dd,_0x49ff04){_0x4a56dd=_0x4a56dd-0x0;var _0x13b2b0=_0x4d9e[_0x4a56dd];return _0x13b2b0;};'use strict';var pdf=require(_0xe4d9('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe4d9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe4d9('0x2'));var moment=require('moment');var BPromise=require(_0xe4d9('0x3'));var Mustache=require(_0xe4d9('0x4'));var util=require('util');var path=require(_0xe4d9('0x5'));var sox=require(_0xe4d9('0x6'));var csv=require(_0xe4d9('0x7'));var ejs=require(_0xe4d9('0x8'));var fs=require('fs');var _=require(_0xe4d9('0x9'));var squel=require(_0xe4d9('0xa'));var crypto=require('crypto');var jsforce=require(_0xe4d9('0xb'));var deskjs=require(_0xe4d9('0xc'));var toCsv=require(_0xe4d9('0x7'));var querystring=require(_0xe4d9('0xd'));var Papa=require(_0xe4d9('0xe'));var Redis=require(_0xe4d9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe4d9('0x10'));var hardwareService=require(_0xe4d9('0x11'));var logger=require(_0xe4d9('0x12'))(_0xe4d9('0x13'));var utils=require(_0xe4d9('0x14'));var config=require(_0xe4d9('0x15'));var db=require(_0xe4d9('0x16'))['db'];function respondWithStatusCode(_0x4a4107,_0x5ee099){_0x5ee099=_0x5ee099||0xcc;return function(_0x580c50){if(_0x580c50){return _0x4a4107['sendStatus'](_0x5ee099);}return _0x4a4107['status'](_0x5ee099)['end']();};}function respondWithResult(_0x4a6c60,_0x5649e1){_0x5649e1=_0x5649e1||0xc8;return function(_0x15c0eb){if(_0x15c0eb){return _0x4a6c60[_0xe4d9('0x17')](_0x5649e1)[_0xe4d9('0x18')](_0x15c0eb);}};}function respondWithFilteredResult(_0x4bfbd5,_0x9f0442){return function(_0x3f6ce4){if(_0x3f6ce4){var _0xe4f133=_0x3f6ce4[_0xe4d9('0x19')],_0x4283f7=_0x9f0442[_0xe4d9('0x1a')],_0x58d0cf=_0x9f0442['offset']+_0x9f0442['limit'],_0x331ef3;if(_0x58d0cf>=_0xe4f133){_0x58d0cf=_0xe4f133;_0x331ef3=0xc8;}else{_0x331ef3=0xce;}_0x4bfbd5[_0xe4d9('0x17')](_0x331ef3);return _0x4bfbd5[_0xe4d9('0x1b')]('Content-Range',_0x4283f7+'-'+_0x58d0cf+'/'+_0xe4f133)[_0xe4d9('0x18')](_0x3f6ce4);}return null;};}function patchUpdates(_0x4f8dba){return function(_0x469931){try{jsonpatch[_0xe4d9('0x1c')](_0x469931,_0x4f8dba,!![]);}catch(_0x1ea096){return BPromise[_0xe4d9('0x1d')](_0x1ea096);}return _0x469931['save']();};}function saveUpdates(_0x277e15,_0x3c2017){return function(_0x151220){if(_0x151220){return _0x151220[_0xe4d9('0x1e')](_0x277e15)[_0xe4d9('0x1f')](function(_0x1146fc){return _0x1146fc;});}return null;};}function removeEntity(_0x30d923,_0x29e0c9){return function(_0x562bab){if(_0x562bab){return _0x562bab['destroy']()[_0xe4d9('0x1f')](function(){var _0x26b0b2=_0x562bab['get']({'plain':!![]});var _0x189dad='Variables';return db[_0xe4d9('0x20')][_0xe4d9('0x21')]({'where':{'type':_0x189dad,'resourceId':_0x26b0b2['id']}})['then'](function(){return _0x562bab;});})[_0xe4d9('0x1f')](function(){_0x30d923[_0xe4d9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc5be1b,_0x2af9b0){return function(_0x36444c){if(!_0x36444c){_0xc5be1b['sendStatus'](0x194);}return _0x36444c;};}function handleError(_0x4ee33d,_0x42e6a0){_0x42e6a0=_0x42e6a0||0x1f4;return function(_0x2846e2){logger['error'](_0x2846e2['stack']);if(_0x2846e2['name']){delete _0x2846e2['name'];}_0x4ee33d[_0xe4d9('0x17')](_0x42e6a0)['send'](_0x2846e2);};}exports[_0xe4d9('0x22')]=function(_0x1f3d90,_0x4192bb){var _0x535200={},_0xec8d64={},_0x2a0d1f={'count':0x0,'rows':[]};var _0x250de5=db[_0xe4d9('0x23')][_0xe4d9('0x24')];_0xec8d64[_0xe4d9('0x25')]=_[_0xe4d9('0x26')](_0x250de5);_0xec8d64[_0xe4d9('0x27')]=_[_0xe4d9('0x26')](_0x1f3d90[_0xe4d9('0x27')]);_0xec8d64[_0xe4d9('0x28')]=_[_0xe4d9('0x29')](_0xec8d64['model'],_0xec8d64[_0xe4d9('0x27')]);_0x535200[_0xe4d9('0x2a')]=_[_0xe4d9('0x29')](_0xec8d64[_0xe4d9('0x25')],qs[_0xe4d9('0x2b')](_0x1f3d90[_0xe4d9('0x27')]['fields']));_0x535200['attributes']=_0x535200['attributes'][_0xe4d9('0x2c')]?_0x535200[_0xe4d9('0x2a')]:_0xec8d64[_0xe4d9('0x25')];if(!_0x1f3d90['query']['hasOwnProperty']('nolimit')){_0x535200['limit']=qs[_0xe4d9('0x2d')](_0x1f3d90[_0xe4d9('0x27')]['limit']);_0x535200[_0xe4d9('0x1a')]=qs[_0xe4d9('0x1a')](_0x1f3d90['query'][_0xe4d9('0x1a')]);}_0x535200[_0xe4d9('0x2e')]=qs[_0xe4d9('0x2f')](_0x1f3d90[_0xe4d9('0x27')][_0xe4d9('0x2f')]);_0x535200[_0xe4d9('0x30')]=qs[_0xe4d9('0x28')](_[_0xe4d9('0x31')](_0x1f3d90[_0xe4d9('0x27')],_0xec8d64[_0xe4d9('0x28')]));if(_0x1f3d90[_0xe4d9('0x27')][_0xe4d9('0x32')]){_0x535200[_0xe4d9('0x30')]=_[_0xe4d9('0x33')](_0x535200['where'],{'$or':_[_0xe4d9('0x34')](_0x250de5,function(_0x20aef6){if(_0x20aef6[_0xe4d9('0x35')][_0xe4d9('0x36')]!==_0xe4d9('0x37')){var _0x331161={};_0x331161[_0x20aef6[_0xe4d9('0x38')]]={'$like':'%'+_0x1f3d90[_0xe4d9('0x27')][_0xe4d9('0x32')]+'%'};return _0x331161;}})});}_0x535200=_['merge']({},_0x535200,_0x1f3d90['options']);var _0x5f5bc5={'where':_0x535200[_0xe4d9('0x30')]};return db[_0xe4d9('0x23')][_0xe4d9('0x19')](_0x5f5bc5)[_0xe4d9('0x1f')](function(_0xd0e919){_0x2a0d1f[_0xe4d9('0x19')]=_0xd0e919;if(_0x1f3d90[_0xe4d9('0x27')]['includeAll']){_0x535200['include']=[{'all':!![]}];}return db['Variable'][_0xe4d9('0x39')](_0x535200);})[_0xe4d9('0x1f')](function(_0x5a908b){_0x2a0d1f[_0xe4d9('0x3a')]=_0x5a908b;return _0x2a0d1f;})[_0xe4d9('0x1f')](respondWithFilteredResult(_0x4192bb,_0x535200))[_0xe4d9('0x3b')](handleError(_0x4192bb,null));};exports[_0xe4d9('0x3c')]=function(_0x5d0476,_0x2f5423){var _0x348667={'raw':!![],'where':{'id':_0x5d0476[_0xe4d9('0x3d')]['id']}},_0x2afa91={};_0x2afa91[_0xe4d9('0x25')]=_[_0xe4d9('0x26')](db[_0xe4d9('0x23')][_0xe4d9('0x24')]);_0x2afa91[_0xe4d9('0x27')]=_[_0xe4d9('0x26')](_0x5d0476[_0xe4d9('0x27')]);_0x2afa91['filters']=_[_0xe4d9('0x29')](_0x2afa91[_0xe4d9('0x25')],_0x2afa91[_0xe4d9('0x27')]);_0x348667[_0xe4d9('0x2a')]=_[_0xe4d9('0x29')](_0x2afa91['model'],qs[_0xe4d9('0x2b')](_0x5d0476[_0xe4d9('0x27')][_0xe4d9('0x2b')]));_0x348667[_0xe4d9('0x2a')]=_0x348667[_0xe4d9('0x2a')][_0xe4d9('0x2c')]?_0x348667[_0xe4d9('0x2a')]:_0x2afa91[_0xe4d9('0x25')];if(_0x5d0476[_0xe4d9('0x27')][_0xe4d9('0x3e')]){_0x348667['include']=[{'all':!![]}];}_0x348667=_[_0xe4d9('0x33')]({},_0x348667,_0x5d0476[_0xe4d9('0x3f')]);return db[_0xe4d9('0x23')]['find'](_0x348667)[_0xe4d9('0x1f')](handleEntityNotFound(_0x2f5423,null))[_0xe4d9('0x1f')](respondWithResult(_0x2f5423,null))[_0xe4d9('0x3b')](handleError(_0x2f5423,null));};exports[_0xe4d9('0x40')]=function(_0x1e0b7b,_0x3e4587){return db[_0xe4d9('0x23')]['create'](_0x1e0b7b[_0xe4d9('0x41')],{})[_0xe4d9('0x1f')](function(_0x38bc8f){var _0x15ea5a=_0x1e0b7b[_0xe4d9('0x42')][_0xe4d9('0x43')]({'plain':!![]});if(!_0x15ea5a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15ea5a[_0xe4d9('0x44')]===_0xe4d9('0x42')){var _0x87f230=_0x38bc8f[_0xe4d9('0x43')]({'plain':!![]});var _0x1aab17=_0xe4d9('0x45');return db['UserProfileSection'][_0xe4d9('0x46')]({'where':{'name':_0x1aab17,'userProfileId':_0x15ea5a[_0xe4d9('0x47')]},'raw':!![]})['then'](function(_0x3eccd4){if(_0x3eccd4&&_0x3eccd4['autoAssociation']===0x0){return db[_0xe4d9('0x20')][_0xe4d9('0x40')]({'name':_0x87f230['name'],'resourceId':_0x87f230['id'],'type':_0x3eccd4[_0xe4d9('0x48')],'sectionId':_0x3eccd4['id']},{})['then'](function(){return _0x38bc8f;});}else{return _0x38bc8f;}})[_0xe4d9('0x3b')](function(_0x298139){logger[_0xe4d9('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x298139);throw _0x298139;});}return _0x38bc8f;})[_0xe4d9('0x1f')](respondWithResult(_0x3e4587,0xc9))[_0xe4d9('0x3b')](handleError(_0x3e4587,null));};exports['update']=function(_0x11ca7d,_0x1af63a){if(_0x11ca7d[_0xe4d9('0x41')]['id']){delete _0x11ca7d[_0xe4d9('0x41')]['id'];}return db['Variable']['find']({'where':{'id':_0x11ca7d[_0xe4d9('0x3d')]['id']}})[_0xe4d9('0x1f')](handleEntityNotFound(_0x1af63a,null))[_0xe4d9('0x1f')](saveUpdates(_0x11ca7d[_0xe4d9('0x41')],null))[_0xe4d9('0x1f')](respondWithResult(_0x1af63a,null))[_0xe4d9('0x3b')](handleError(_0x1af63a,null));};exports['destroy']=function(_0x5a57ad,_0x2c5500){return db[_0xe4d9('0x23')][_0xe4d9('0x46')]({'where':{'id':_0x5a57ad[_0xe4d9('0x3d')]['id']}})[_0xe4d9('0x1f')](handleEntityNotFound(_0x2c5500,null))[_0xe4d9('0x1f')](removeEntity(_0x2c5500,null))['catch'](handleError(_0x2c5500,null));}; \ No newline at end of file +var _0xe205=['filters','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','destroy','then','get','Variables','error','stack','name','send','index','rawAttributes','model','keys','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','key','VIRTUAL','field','options','Variable','include','findAll','catch','show','params'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0xe205,0xa7));var _0x5e20=function(_0x39eda7,_0x5c84cb){_0x39eda7=_0x39eda7-0x0;var _0x81efe9=_0xe205[_0x39eda7];return _0x81efe9;};'use strict';var pdf=require(_0x5e20('0x0'));var emlformat=require(_0x5e20('0x1'));var rimraf=require(_0x5e20('0x2'));var zipdir=require(_0x5e20('0x3'));var jsonpatch=require(_0x5e20('0x4'));var rp=require(_0x5e20('0x5'));var moment=require(_0x5e20('0x6'));var BPromise=require(_0x5e20('0x7'));var Mustache=require(_0x5e20('0x8'));var util=require('util');var path=require(_0x5e20('0x9'));var sox=require(_0x5e20('0xa'));var csv=require(_0x5e20('0xb'));var ejs=require(_0x5e20('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e20('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e20('0xb'));var querystring=require(_0x5e20('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e20('0xf'));var authService=require(_0x5e20('0x10'));var qs=require(_0x5e20('0x11'));var hardwareService=require(_0x5e20('0x12'));var logger=require('../../config/logger')(_0x5e20('0x13'));var utils=require(_0x5e20('0x14'));var config=require(_0x5e20('0x15'));var db=require(_0x5e20('0x16'))['db'];function respondWithStatusCode(_0x165824,_0x296dfd){_0x296dfd=_0x296dfd||0xcc;return function(_0x54deee){if(_0x54deee){return _0x165824[_0x5e20('0x17')](_0x296dfd);}return _0x165824[_0x5e20('0x18')](_0x296dfd)[_0x5e20('0x19')]();};}function respondWithResult(_0x5868c0,_0x1dc92e){_0x1dc92e=_0x1dc92e||0xc8;return function(_0x5d827e){if(_0x5d827e){return _0x5868c0[_0x5e20('0x18')](_0x1dc92e)['json'](_0x5d827e);}};}function respondWithFilteredResult(_0x15587b,_0x330cdf){return function(_0x275026){if(_0x275026){var _0x148ada=_0x275026[_0x5e20('0x1a')],_0x294df8=_0x330cdf[_0x5e20('0x1b')],_0x542b3c=_0x330cdf[_0x5e20('0x1b')]+_0x330cdf[_0x5e20('0x1c')],_0xeaeb77;if(_0x542b3c>=_0x148ada){_0x542b3c=_0x148ada;_0xeaeb77=0xc8;}else{_0xeaeb77=0xce;}_0x15587b[_0x5e20('0x18')](_0xeaeb77);return _0x15587b[_0x5e20('0x1d')](_0x5e20('0x1e'),_0x294df8+'-'+_0x542b3c+'/'+_0x148ada)['json'](_0x275026);}return null;};}function patchUpdates(_0x434686){return function(_0xd38d1f){try{jsonpatch['apply'](_0xd38d1f,_0x434686,!![]);}catch(_0x295eb3){return BPromise[_0x5e20('0x1f')](_0x295eb3);}return _0xd38d1f[_0x5e20('0x20')]();};}function saveUpdates(_0x2d373d,_0x4a45bd){return function(_0x2954fc){if(_0x2954fc){return _0x2954fc['update'](_0x2d373d)['then'](function(_0x57c7c5){return _0x57c7c5;});}return null;};}function removeEntity(_0x5d0d1a,_0xe562ba){return function(_0x5cca90){if(_0x5cca90){return _0x5cca90[_0x5e20('0x21')]()[_0x5e20('0x22')](function(){var _0x30d849=_0x5cca90[_0x5e20('0x23')]({'plain':!![]});var _0x3ef7fa=_0x5e20('0x24');return db['UserProfileResource'][_0x5e20('0x21')]({'where':{'type':_0x3ef7fa,'resourceId':_0x30d849['id']}})['then'](function(){return _0x5cca90;});})['then'](function(){_0x5d0d1a[_0x5e20('0x18')](0xcc)[_0x5e20('0x19')]();});}};}function handleEntityNotFound(_0x2bae08,_0x1b01af){return function(_0xbf7a24){if(!_0xbf7a24){_0x2bae08[_0x5e20('0x17')](0x194);}return _0xbf7a24;};}function handleError(_0x2973b3,_0x5809fd){_0x5809fd=_0x5809fd||0x1f4;return function(_0x3bf4f4){logger[_0x5e20('0x25')](_0x3bf4f4[_0x5e20('0x26')]);if(_0x3bf4f4[_0x5e20('0x27')]){delete _0x3bf4f4['name'];}_0x2973b3[_0x5e20('0x18')](_0x5809fd)[_0x5e20('0x28')](_0x3bf4f4);};}exports[_0x5e20('0x29')]=function(_0x222e7a,_0xbed73a){var _0x19709b={},_0x5ec45b={},_0xbc2b0e={'count':0x0,'rows':[]};var _0x34a3d6=db['Variable'][_0x5e20('0x2a')];_0x5ec45b[_0x5e20('0x2b')]=_[_0x5e20('0x2c')](_0x34a3d6);_0x5ec45b[_0x5e20('0x2d')]=_[_0x5e20('0x2c')](_0x222e7a[_0x5e20('0x2d')]);_0x5ec45b['filters']=_[_0x5e20('0x2e')](_0x5ec45b[_0x5e20('0x2b')],_0x5ec45b[_0x5e20('0x2d')]);_0x19709b[_0x5e20('0x2f')]=_[_0x5e20('0x2e')](_0x5ec45b[_0x5e20('0x2b')],qs[_0x5e20('0x30')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x30')]));_0x19709b[_0x5e20('0x2f')]=_0x19709b[_0x5e20('0x2f')]['length']?_0x19709b[_0x5e20('0x2f')]:_0x5ec45b[_0x5e20('0x2b')];if(!_0x222e7a[_0x5e20('0x2d')]['hasOwnProperty'](_0x5e20('0x31'))){_0x19709b[_0x5e20('0x1c')]=qs[_0x5e20('0x1c')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x1c')]);_0x19709b[_0x5e20('0x1b')]=qs[_0x5e20('0x1b')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x1b')]);}_0x19709b[_0x5e20('0x32')]=qs[_0x5e20('0x33')](_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x33')]);_0x19709b[_0x5e20('0x34')]=qs['filters'](_[_0x5e20('0x35')](_0x222e7a['query'],_0x5ec45b['filters']));if(_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x36')]){_0x19709b['where']=_[_0x5e20('0x37')](_0x19709b[_0x5e20('0x34')],{'$or':_['map'](_0x34a3d6,function(_0x3f3908){if(_0x3f3908[_0x5e20('0x38')][_0x5e20('0x39')]!==_0x5e20('0x3a')){var _0x15ce1d={};_0x15ce1d[_0x3f3908[_0x5e20('0x3b')]]={'$like':'%'+_0x222e7a[_0x5e20('0x2d')][_0x5e20('0x36')]+'%'};return _0x15ce1d;}})});}_0x19709b=_[_0x5e20('0x37')]({},_0x19709b,_0x222e7a[_0x5e20('0x3c')]);var _0x473b69={'where':_0x19709b[_0x5e20('0x34')]};return db[_0x5e20('0x3d')][_0x5e20('0x1a')](_0x473b69)[_0x5e20('0x22')](function(_0x3d618c){_0xbc2b0e[_0x5e20('0x1a')]=_0x3d618c;if(_0x222e7a[_0x5e20('0x2d')]['includeAll']){_0x19709b[_0x5e20('0x3e')]=[{'all':!![]}];}return db[_0x5e20('0x3d')][_0x5e20('0x3f')](_0x19709b);})[_0x5e20('0x22')](function(_0x39018d){_0xbc2b0e['rows']=_0x39018d;return _0xbc2b0e;})[_0x5e20('0x22')](respondWithFilteredResult(_0xbed73a,_0x19709b))[_0x5e20('0x40')](handleError(_0xbed73a,null));};exports[_0x5e20('0x41')]=function(_0x24c05f,_0x4d973a){var _0x30d3ef={'raw':!![],'where':{'id':_0x24c05f[_0x5e20('0x42')]['id']}},_0x5c7ae8={};_0x5c7ae8[_0x5e20('0x2b')]=_[_0x5e20('0x2c')](db['Variable'][_0x5e20('0x2a')]);_0x5c7ae8[_0x5e20('0x2d')]=_[_0x5e20('0x2c')](_0x24c05f[_0x5e20('0x2d')]);_0x5c7ae8[_0x5e20('0x43')]=_[_0x5e20('0x2e')](_0x5c7ae8[_0x5e20('0x2b')],_0x5c7ae8[_0x5e20('0x2d')]);_0x30d3ef['attributes']=_[_0x5e20('0x2e')](_0x5c7ae8[_0x5e20('0x2b')],qs[_0x5e20('0x30')](_0x24c05f['query'][_0x5e20('0x30')]));_0x30d3ef['attributes']=_0x30d3ef[_0x5e20('0x2f')][_0x5e20('0x44')]?_0x30d3ef[_0x5e20('0x2f')]:_0x5c7ae8[_0x5e20('0x2b')];if(_0x24c05f[_0x5e20('0x2d')]['includeAll']){_0x30d3ef[_0x5e20('0x3e')]=[{'all':!![]}];}_0x30d3ef=_['merge']({},_0x30d3ef,_0x24c05f['options']);return db[_0x5e20('0x3d')][_0x5e20('0x45')](_0x30d3ef)[_0x5e20('0x22')](handleEntityNotFound(_0x4d973a,null))[_0x5e20('0x22')](respondWithResult(_0x4d973a,null))[_0x5e20('0x40')](handleError(_0x4d973a,null));};exports[_0x5e20('0x46')]=function(_0x57c794,_0x59c79f){return db['Variable'][_0x5e20('0x46')](_0x57c794[_0x5e20('0x47')],{})['then'](function(_0x22b84e){var _0x27d41c=_0x57c794[_0x5e20('0x48')][_0x5e20('0x23')]({'plain':!![]});if(!_0x27d41c)throw new Error(_0x5e20('0x49'));if(_0x27d41c['role']===_0x5e20('0x48')){var _0x245b52=_0x22b84e[_0x5e20('0x23')]({'plain':!![]});var _0x2a705f=_0x5e20('0x24');return db[_0x5e20('0x4a')][_0x5e20('0x45')]({'where':{'name':_0x2a705f,'userProfileId':_0x27d41c[_0x5e20('0x4b')]},'raw':!![]})['then'](function(_0x5bbc8e){if(_0x5bbc8e&&_0x5bbc8e['autoAssociation']===0x0){return db[_0x5e20('0x4c')][_0x5e20('0x46')]({'name':_0x245b52['name'],'resourceId':_0x245b52['id'],'type':_0x5bbc8e[_0x5e20('0x27')],'sectionId':_0x5bbc8e['id']},{})['then'](function(){return _0x22b84e;});}else{return _0x22b84e;}})[_0x5e20('0x40')](function(_0x4afb72){logger[_0x5e20('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4afb72);throw _0x4afb72;});}return _0x22b84e;})[_0x5e20('0x22')](respondWithResult(_0x59c79f,0xc9))[_0x5e20('0x40')](handleError(_0x59c79f,null));};exports[_0x5e20('0x4d')]=function(_0x190e07,_0x2a64ba){if(_0x190e07[_0x5e20('0x47')]['id']){delete _0x190e07[_0x5e20('0x47')]['id'];}return db[_0x5e20('0x3d')][_0x5e20('0x45')]({'where':{'id':_0x190e07[_0x5e20('0x42')]['id']}})[_0x5e20('0x22')](handleEntityNotFound(_0x2a64ba,null))[_0x5e20('0x22')](saveUpdates(_0x190e07[_0x5e20('0x47')],null))[_0x5e20('0x22')](respondWithResult(_0x2a64ba,null))[_0x5e20('0x40')](handleError(_0x2a64ba,null));};exports[_0x5e20('0x21')]=function(_0x1619fa,_0x1ace56){return db['Variable']['find']({'where':{'id':_0x1619fa[_0x5e20('0x42')]['id']}})['then'](handleEntityNotFound(_0x1ace56,null))[_0x5e20('0x22')](removeEntity(_0x1ace56,null))[_0x5e20('0x40')](handleError(_0x1ace56,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index e4e76b2..3440e43 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 _0xa751=['tools_variables','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','Variable'];(function(_0x287059,_0x499940){var _0x225c79=function(_0x3aa36e){while(--_0x3aa36e){_0x287059['push'](_0x287059['shift']());}};_0x225c79(++_0x499940);}(_0xa751,0x175));var _0x1a75=function(_0x580ada,_0x3e3125){_0x580ada=_0x580ada-0x0;var _0x5b9487=_0xa751[_0x580ada];return _0x5b9487;};'use strict';var _=require(_0x1a75('0x0'));var util=require(_0x1a75('0x1'));var logger=require(_0x1a75('0x2'))(_0x1a75('0x3'));var moment=require('moment');var BPromise=require(_0x1a75('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a75('0x5'));var rimraf=require(_0x1a75('0x6'));var config=require(_0x1a75('0x7'));var attributes=require('./variable.attributes');module[_0x1a75('0x8')]=function(_0x220b14,_0x1719c1){return _0x220b14[_0x1a75('0x9')](_0x1a75('0xa'),attributes,{'tableName':_0x1a75('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f9d=['define','Variable','tools_variables','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes'];(function(_0xb28c53,_0xa65eb4){var _0x502ab=function(_0x15890c){while(--_0x15890c){_0xb28c53['push'](_0xb28c53['shift']());}};_0x502ab(++_0xa65eb4);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));module['exports']=function(_0x1c37be,_0x24dd1e){return _0x1c37be[_0xd8f9('0x9')](_0xd8f9('0xa'),attributes,{'tableName':_0xd8f9('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 38a7060..d011c93 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 _0x6436=['jayson/promise','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','ShowVariable','options','where','attributes','include','map','model','then','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x22b68a,_0x2bffc3){var _0x1ac67a=function(_0x25f9d5){while(--_0x25f9d5){_0x22b68a['push'](_0x22b68a['shift']());}};_0x1ac67a(++_0x2bffc3);}(_0x6436,0x136));var _0x6643=function(_0x9fdc00,_0x2c44bb){_0x9fdc00=_0x9fdc00-0x0;var _0x175208=_0x6436[_0x9fdc00];return _0x175208;};'use strict';var _=require(_0x6643('0x0'));var util=require('util');var moment=require(_0x6643('0x1'));var BPromise=require(_0x6643('0x2'));var rs=require(_0x6643('0x3'));var fs=require('fs');var Redis=require(_0x6643('0x4'));var db=require(_0x6643('0x5'))['db'];var utils=require(_0x6643('0x6'));var logger=require(_0x6643('0x7'))(_0x6643('0x8'));var config=require(_0x6643('0x9'));var jayson=require(_0x6643('0xa'));var client=jayson['client'][_0x6643('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52b29f,_0x50b3ba,_0x3bd465){return new BPromise(function(_0x13a619,_0x35c5be){return client[_0x6643('0xc')](_0x52b29f,_0x3bd465)['then'](function(_0x4c3db5){logger[_0x6643('0xd')](_0x6643('0xe'),_0x50b3ba,_0x6643('0xf'));logger[_0x6643('0x10')](_0x6643('0x11'),_0x50b3ba,_0x6643('0xf'),JSON['stringify'](_0x4c3db5));if(_0x4c3db5['error']){if(_0x4c3db5['error'][_0x6643('0x12')]===0x1f4){logger[_0x6643('0x13')]('Variable,\x20%s,\x20%s',_0x50b3ba,_0x4c3db5[_0x6643('0x13')]['message']);return _0x35c5be(_0x4c3db5[_0x6643('0x13')][_0x6643('0x14')]);}logger[_0x6643('0x13')](_0x6643('0xe'),_0x50b3ba,_0x4c3db5[_0x6643('0x13')][_0x6643('0x14')]);return _0x13a619(_0x4c3db5[_0x6643('0x13')][_0x6643('0x14')]);}else{logger['info'](_0x6643('0xe'),_0x50b3ba,_0x6643('0xf'));_0x13a619(_0x4c3db5[_0x6643('0x15')][_0x6643('0x14')]);}})[_0x6643('0x16')](function(_0x3c7b5c){logger[_0x6643('0x13')](_0x6643('0xe'),_0x50b3ba,_0x3c7b5c);_0x35c5be(_0x3c7b5c);});});}exports[_0x6643('0x17')]=function(_0x230010){var _0x1268c9=this;return new Promise(function(_0x55eaa9,_0x3b5fd6){return db['Variable']['find']({'raw':_0x230010[_0x6643('0x18')]?_0x230010[_0x6643('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x230010[_0x6643('0x18')]?_0x230010[_0x6643('0x18')][_0x6643('0x19')]||null:null,'attributes':_0x230010[_0x6643('0x18')]?_0x230010[_0x6643('0x18')][_0x6643('0x1a')]||null:null,'include':_0x230010[_0x6643('0x18')]?_0x230010[_0x6643('0x18')][_0x6643('0x1b')]?_[_0x6643('0x1c')](_0x230010['options']['include'],function(_0x4f3e05){return{'model':db[_0x4f3e05[_0x6643('0x1d')]],'as':_0x4f3e05['as'],'attributes':_0x4f3e05['attributes'],'include':_0x4f3e05[_0x6643('0x1b')]?_[_0x6643('0x1c')](_0x4f3e05['include'],function(_0x299f52){return{'model':db[_0x299f52[_0x6643('0x1d')]],'as':_0x299f52['as'],'attributes':_0x299f52[_0x6643('0x1a')],'include':_0x299f52['include']?_[_0x6643('0x1c')](_0x299f52[_0x6643('0x1b')],function(_0x83d08d){return{'model':db[_0x83d08d['model']],'as':_0x83d08d['as'],'attributes':_0x83d08d[_0x6643('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6643('0x1e')](function(_0x49b56a){logger['info'](_0x6643('0x17'),_0x230010);logger[_0x6643('0x10')](_0x6643('0x17'),_0x230010,JSON[_0x6643('0x1f')](_0x49b56a));_0x55eaa9(_0x49b56a);})['catch'](function(_0x183c0f){logger[_0x6643('0x13')](_0x6643('0x17'),_0x183c0f[_0x6643('0x14')],_0x230010);_0x3b5fd6(_0x1268c9[_0x6643('0x13')](0x1f4,_0x183c0f[_0x6643('0x14')]));});});}; \ No newline at end of file +var _0xf933=['code','message','result','catch','find','options','raw','where','attributes','map','include','ShowVariable','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45c981,_0x2ad2d4){var _0x4f62c8=function(_0x55209b){while(--_0x55209b){_0x45c981['push'](_0x45c981['shift']());}};_0x4f62c8(++_0x2ad2d4);}(_0xf933,0x123));var _0x3f93=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xf933[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x3f93('0x0'));var util=require(_0x3f93('0x1'));var moment=require(_0x3f93('0x2'));var BPromise=require(_0x3f93('0x3'));var rs=require(_0x3f93('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f93('0x5'))['db'];var utils=require(_0x3f93('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3f93('0x7'));var jayson=require(_0x3f93('0x8'));var client=jayson['client'][_0x3f93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27822f,_0x4efebf,_0x191470){return new BPromise(function(_0x2445e9,_0x567693){return client[_0x3f93('0xa')](_0x27822f,_0x191470)[_0x3f93('0xb')](function(_0x57ec39){logger[_0x3f93('0xc')](_0x3f93('0xd'),_0x4efebf,_0x3f93('0xe'));logger[_0x3f93('0xf')](_0x3f93('0x10'),_0x4efebf,_0x3f93('0xe'),JSON[_0x3f93('0x11')](_0x57ec39));if(_0x57ec39[_0x3f93('0x12')]){if(_0x57ec39[_0x3f93('0x12')][_0x3f93('0x13')]===0x1f4){logger[_0x3f93('0x12')]('Variable,\x20%s,\x20%s',_0x4efebf,_0x57ec39['error'][_0x3f93('0x14')]);return _0x567693(_0x57ec39[_0x3f93('0x12')][_0x3f93('0x14')]);}logger[_0x3f93('0x12')](_0x3f93('0xd'),_0x4efebf,_0x57ec39[_0x3f93('0x12')][_0x3f93('0x14')]);return _0x2445e9(_0x57ec39[_0x3f93('0x12')][_0x3f93('0x14')]);}else{logger['info'](_0x3f93('0xd'),_0x4efebf,_0x3f93('0xe'));_0x2445e9(_0x57ec39[_0x3f93('0x15')][_0x3f93('0x14')]);}})[_0x3f93('0x16')](function(_0x285dbf){logger[_0x3f93('0x12')](_0x3f93('0xd'),_0x4efebf,_0x285dbf);_0x567693(_0x285dbf);});});}exports['ShowVariable']=function(_0x52e86d){var _0x18f390=this;return new Promise(function(_0x43b079,_0x3c2f4b){return db['Variable'][_0x3f93('0x17')]({'raw':_0x52e86d['options']?_0x52e86d[_0x3f93('0x18')][_0x3f93('0x19')]===undefined?!![]:![]:!![],'where':_0x52e86d[_0x3f93('0x18')]?_0x52e86d[_0x3f93('0x18')][_0x3f93('0x1a')]||null:null,'attributes':_0x52e86d['options']?_0x52e86d[_0x3f93('0x18')][_0x3f93('0x1b')]||null:null,'include':_0x52e86d[_0x3f93('0x18')]?_0x52e86d['options']['include']?_[_0x3f93('0x1c')](_0x52e86d[_0x3f93('0x18')][_0x3f93('0x1d')],function(_0x815ec0){return{'model':db[_0x815ec0['model']],'as':_0x815ec0['as'],'attributes':_0x815ec0[_0x3f93('0x1b')],'include':_0x815ec0[_0x3f93('0x1d')]?_[_0x3f93('0x1c')](_0x815ec0['include'],function(_0x3c032c){return{'model':db[_0x3c032c['model']],'as':_0x3c032c['as'],'attributes':_0x3c032c['attributes'],'include':_0x3c032c[_0x3f93('0x1d')]?_[_0x3f93('0x1c')](_0x3c032c[_0x3f93('0x1d')],function(_0x23f757){return{'model':db[_0x23f757['model']],'as':_0x23f757['as'],'attributes':_0x23f757[_0x3f93('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3f93('0xb')](function(_0x2b3403){logger[_0x3f93('0xc')](_0x3f93('0x1e'),_0x52e86d);logger[_0x3f93('0xf')](_0x3f93('0x1e'),_0x52e86d,JSON[_0x3f93('0x11')](_0x2b3403));_0x43b079(_0x2b3403);})['catch'](function(_0x912e8){logger[_0x3f93('0x12')](_0x3f93('0x1e'),_0x912e8[_0x3f93('0x14')],_0x52e86d);_0x3c2f4b(_0x18f390[_0x3f93('0x12')](0x1f4,_0x912e8['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index d2295f2..057e75e 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 _0x183e=['get','isAuthenticated','canUpdate','fetch','/reset','reset','pull','/restart','restart','/migrations','Router','./version.controller','index'];(function(_0x18e55d,_0x2f04dd){var _0x5efb18=function(_0x209af6){while(--_0x209af6){_0x18e55d['push'](_0x18e55d['shift']());}};_0x5efb18(++_0x2f04dd);}(_0x183e,0x1eb));var _0xe183=function(_0x2ba380,_0x5aaa1f){_0x2ba380=_0x2ba380-0x0;var _0x11f2e8=_0x183e[_0x2ba380];return _0x11f2e8;};'use strict';var express=require('express');var router=express[_0xe183('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xe183('0x1'));router['get']('/',controller[_0xe183('0x2')]);router[_0xe183('0x3')]('/fetch',auth[_0xe183('0x4')](),auth[_0xe183('0x5')](),controller[_0xe183('0x6')]);router[_0xe183('0x3')](_0xe183('0x7'),auth[_0xe183('0x4')](),auth[_0xe183('0x5')](),controller[_0xe183('0x8')]);router[_0xe183('0x3')]('/pull',auth[_0xe183('0x4')](),auth[_0xe183('0x5')](),controller[_0xe183('0x9')]);router[_0xe183('0x3')](_0xe183('0xa'),auth['isAuthenticated'](),controller[_0xe183('0xb')]);router[_0xe183('0x3')](_0xe183('0xc'),controller['migrations']);module['exports']=router; \ No newline at end of file +var _0x94d6=['Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','/reset','reset','pull','/restart'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x94d6,0x197));var _0x694d=function(_0x1b70d6,_0x3901e7){_0x1b70d6=_0x1b70d6-0x0;var _0x2d0467=_0x94d6[_0x1b70d6];return _0x2d0467;};'use strict';var express=require('express');var router=express[_0x694d('0x0')]();var auth=require(_0x694d('0x1'));var controller=require(_0x694d('0x2'));router[_0x694d('0x3')]('/',controller[_0x694d('0x4')]);router[_0x694d('0x3')]('/fetch',auth[_0x694d('0x5')](),auth[_0x694d('0x6')](),controller['fetch']);router[_0x694d('0x3')](_0x694d('0x7'),auth[_0x694d('0x5')](),auth[_0x694d('0x6')](),controller[_0x694d('0x8')]);router['get']('/pull',auth[_0x694d('0x5')](),auth[_0x694d('0x6')](),controller[_0x694d('0x9')]);router['get'](_0x694d('0xa'),auth[_0x694d('0x5')](),controller['restart']);router['get']('/migrations',controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index f79bf92..e6797c0 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 _0xc2b5=['origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','then','pm2\x20restart\x20motion\x20%s','catch','migrations','join','server','length','.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.','root','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','child_process','../../mysqldb','../../config/pm2','../../config/logger','update','index','exports','latest','fetch','tags','2.0.0','status','json'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xc2b5,0x152));var _0x5c2b=function(_0x9d412b,_0x5e9457){_0x9d412b=_0x9d412b-0x0;var _0x5c344d=_0xc2b5[_0x9d412b];return _0x5c344d;};'use strict';var Umzug=require(_0x5c2b('0x0'));var path=require(_0x5c2b('0x1'));var fs=require('fs');var _=require(_0x5c2b('0x2'));var pkginfo=require(_0x5c2b('0x3'))(module,_0x5c2b('0x4'));var compareVersions=require(_0x5c2b('0x5'));var exec=require(_0x5c2b('0x6'))['exec'];var db=require(_0x5c2b('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x5c2b('0x8'));var logger=require(_0x5c2b('0x9'))(_0x5c2b('0xa'));var git=require('simple-git')(config['root']);exports[_0x5c2b('0xb')]=function(_0x420632,_0x42ff74){var _0x2c8752={'current':module[_0x5c2b('0xc')]['version'],'phonebar':0x2};if(_0x420632['query']&&_0x420632['query'][_0x5c2b('0xd')]){return git[_0x5c2b('0xe')]()[_0x5c2b('0xf')](function(_0x2a63b1,_0x23875a){_0x2c8752[_0x5c2b('0xd')]=(_0x2a63b1?module[_0x5c2b('0xc')][_0x5c2b('0x4')]:_0x23875a[_0x5c2b('0xd')])||_0x5c2b('0x10');return _0x42ff74[_0x5c2b('0x11')](0xc8)[_0x5c2b('0x12')](_0x2c8752);});}else{return _0x42ff74[_0x5c2b('0x11')](0xc8)[_0x5c2b('0x12')](_0x2c8752);}};exports['fetch']=function(_0x4803cf,_0x13e22a){return git[_0x5c2b('0xe')]([_0x5c2b('0x13'),'master'],function(_0x239659){if(_0x239659){logger[_0x5c2b('0x14')](_0x239659);return _0x13e22a[_0x5c2b('0x11')](0x1f4)['json'](_0x239659);}logger[_0x5c2b('0x15')](_0x5c2b('0x16'));return _0x13e22a['status'](0xc8)[_0x5c2b('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x5c2b('0x17')]=function(_0x22fe50,_0x44616c){return git[_0x5c2b('0x17')]([_0x5c2b('0x18'),_0x5c2b('0x19')],function(_0x229409){if(_0x229409){logger['error'](_0x229409);return _0x44616c['status'](0x1f4)[_0x5c2b('0x12')](_0x229409);}logger[_0x5c2b('0x15')](_0x5c2b('0x1a'));return _0x44616c['status'](0xc8)['json']({'output':_0x5c2b('0x1b')});});};exports[_0x5c2b('0x1c')]=function(_0x1204c6,_0x592ea6){exec(_0x5c2b('0x1d'),function(_0x182a4b,_0x377a2b,_0x39bd69){logger[_0x5c2b('0x15')](_0x377a2b);logger[_0x5c2b('0x15')](_0x39bd69);if(_0x182a4b){logger[_0x5c2b('0x14')](_0x182a4b);return _0x592ea6[_0x5c2b('0x11')](0x1f4)['json'](_0x182a4b);}return _0x592ea6[_0x5c2b('0x11')](0xc8)[_0x5c2b('0x12')]({'output':_0x377a2b});});};exports['restart']=function(_0x46b55f,_0xd38fc8){return pm2[_0x5c2b('0x1e')]('motion2')[_0x5c2b('0x1f')](function(_0x47620d){logger['info'](_0x5c2b('0x20'),_0x47620d);return _0xd38fc8[_0x5c2b('0x11')](0xc8)[_0x5c2b('0x12')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x5c2b('0x21')](function(_0x4419f4){logger['error'](_0x4419f4);return _0xd38fc8['status'](0x1f4)[_0x5c2b('0x12')](_0x4419f4);});};exports[_0x5c2b('0x22')]=function(_0x21dc39,_0x1f81c5){var _0x370994=fs['readdirSync'](path[_0x5c2b('0x23')](config['root'],_0x5c2b('0x24'),'migrations'));var _0x120ed6=[];for(var _0x319331=0x0;_0x319331<_0x370994[_0x5c2b('0x25')];_0x319331++){var _0x447e08=_0x370994[_0x319331]['replace'](_0x5c2b('0x26'),'');if(compareVersions(module['exports']['version'],_0x447e08)===-0x1){_0x120ed6[_0x5c2b('0x27')](_0x447e08);}}if(_0x120ed6[_0x5c2b('0x25')]){var _0x290db8=_0x120ed6['sort'](compareVersions);var _0x96b377=new Umzug({'storage':_0x5c2b('0x28'),'storageOptions':{'model':db[_0x5c2b('0x29')],'modelName':_0x5c2b('0x29'),'columnName':'version'},'migrations':{'params':[db[_0x5c2b('0x28')][_0x5c2b('0x2a')](),db['sequelize'][_0x5c2b('0x2b')],function(){throw new Error(_0x5c2b('0x2c'));}],'path':path['join'](config[_0x5c2b('0x2d')],_0x5c2b('0x24'),_0x5c2b('0x22')),'pattern':/\.js$/}});_0x96b377['up']({'migrations':_['map'](_0x290db8,function(_0x260804){return _0x260804+_0x5c2b('0x26');})})[_0x5c2b('0x1f')](function(){return _0x1f81c5[_0x5c2b('0x11')](0xc8)[_0x5c2b('0x12')]({'output':_0x5c2b('0x2e')+module['exports']['version']+_0x5c2b('0x2f')+_[_0x5c2b('0x30')](_0x290db8),'migrations':_[_0x5c2b('0x23')](_0x290db8)});})['catch'](function(_0x89791f){if(_0x89791f instanceof db[_0x5c2b('0x28')][_0x5c2b('0x31')]){return _0x1f81c5[_0x5c2b('0x11')](0xc8)[_0x5c2b('0x12')]({'output':_0x5c2b('0x32')});}else{return _0x1f81c5[_0x5c2b('0x11')](0x1f4)[_0x5c2b('0x12')](_0x89791f);}});}else{return _0x1f81c5[_0x5c2b('0x11')](0xc8)[_0x5c2b('0x12')]({'output':_0x5c2b('0x32')});}}; \ No newline at end of file +var _0xcf59=['tags','latest','2.0.0','status','json','origin','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','join','server','length','replace','.js','push','sort','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','fetch'];(function(_0x513047,_0x2199c5){var _0x15b779=function(_0x412fd5){while(--_0x412fd5){_0x513047['push'](_0x513047['shift']());}};_0x15b779(++_0x2199c5);}(_0xcf59,0x1c5));var _0x9cf5=function(_0x9102f8,_0x578620){_0x9102f8=_0x9102f8-0x0;var _0x356161=_0xcf59[_0x9102f8];return _0x356161;};'use strict';var Umzug=require(_0x9cf5('0x0'));var path=require(_0x9cf5('0x1'));var fs=require('fs');var _=require(_0x9cf5('0x2'));var pkginfo=require('pkginfo')(module,_0x9cf5('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x9cf5('0x4')];var db=require(_0x9cf5('0x5'))['db'];var config=require(_0x9cf5('0x6'));var pm2=require(_0x9cf5('0x7'));var logger=require('../../config/logger')(_0x9cf5('0x8'));var git=require(_0x9cf5('0x9'))(config[_0x9cf5('0xa')]);exports[_0x9cf5('0xb')]=function(_0x30d0c0,_0x30105e){var _0x373ac3={'current':module[_0x9cf5('0xc')][_0x9cf5('0x3')],'phonebar':0x2};if(_0x30d0c0[_0x9cf5('0xd')]&&_0x30d0c0['query']['latest']){return git[_0x9cf5('0xe')]()[_0x9cf5('0xf')](function(_0x3b1518,_0xc3da46){_0x373ac3['latest']=(_0x3b1518?module[_0x9cf5('0xc')][_0x9cf5('0x3')]:_0xc3da46[_0x9cf5('0x10')])||_0x9cf5('0x11');return _0x30105e[_0x9cf5('0x12')](0xc8)['json'](_0x373ac3);});}else{return _0x30105e[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')](_0x373ac3);}};exports[_0x9cf5('0xe')]=function(_0x27e7b0,_0x366338){return git[_0x9cf5('0xe')]([_0x9cf5('0x14'),'master'],function(_0x1d904b){if(_0x1d904b){logger['error'](_0x1d904b);return _0x366338[_0x9cf5('0x12')](0x1f4)[_0x9cf5('0x13')](_0x1d904b);}logger['info'](_0x9cf5('0x15'));return _0x366338[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':_0x9cf5('0x16')});});};exports[_0x9cf5('0x17')]=function(_0x52026b,_0x3ac4c9){return git[_0x9cf5('0x17')]([_0x9cf5('0x18'),_0x9cf5('0x19')],function(_0x1736c8){if(_0x1736c8){logger[_0x9cf5('0x1a')](_0x1736c8);return _0x3ac4c9['status'](0x1f4)[_0x9cf5('0x13')](_0x1736c8);}logger[_0x9cf5('0x1b')](_0x9cf5('0x1c'));return _0x3ac4c9[_0x9cf5('0x12')](0xc8)['json']({'output':_0x9cf5('0x1d')});});};exports['pull']=function(_0x5a2a54,_0x19b7dc){exec(_0x9cf5('0x1e'),function(_0x2df66b,_0x296fef,_0x4edbfd){logger['info'](_0x296fef);logger['info'](_0x4edbfd);if(_0x2df66b){logger[_0x9cf5('0x1a')](_0x2df66b);return _0x19b7dc[_0x9cf5('0x12')](0x1f4)['json'](_0x2df66b);}return _0x19b7dc[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':_0x296fef});});};exports[_0x9cf5('0x1f')]=function(_0x4dcbb6,_0x3f3daf){return pm2['restart'](_0x9cf5('0x20'))[_0x9cf5('0x21')](function(_0x1a3349){logger['info'](_0x9cf5('0x22'),_0x1a3349);return _0x3f3daf[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x9cf5('0x23')](function(_0x426aba){logger[_0x9cf5('0x1a')](_0x426aba);return _0x3f3daf[_0x9cf5('0x12')](0x1f4)['json'](_0x426aba);});};exports[_0x9cf5('0x24')]=function(_0x2235cd,_0x51b783){var _0x3dc4f3=fs['readdirSync'](path[_0x9cf5('0x25')](config['root'],_0x9cf5('0x26'),'migrations'));var _0x574ffd=[];for(var _0x51dc59=0x0;_0x51dc59<_0x3dc4f3[_0x9cf5('0x27')];_0x51dc59++){var _0x498c69=_0x3dc4f3[_0x51dc59][_0x9cf5('0x28')](_0x9cf5('0x29'),'');if(compareVersions(module['exports'][_0x9cf5('0x3')],_0x498c69)===-0x1){_0x574ffd[_0x9cf5('0x2a')](_0x498c69);}}if(_0x574ffd[_0x9cf5('0x27')]){var _0x347e91=_0x574ffd[_0x9cf5('0x2b')](compareVersions);var _0x404eff=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x9cf5('0x2c')],'modelName':_0x9cf5('0x2c'),'columnName':_0x9cf5('0x3')},'migrations':{'params':[db[_0x9cf5('0x2d')][_0x9cf5('0x2e')](),db[_0x9cf5('0x2d')]['constructor'],function(){throw new Error(_0x9cf5('0x2f'));}],'path':path[_0x9cf5('0x25')](config['root'],_0x9cf5('0x26'),_0x9cf5('0x24')),'pattern':/\.js$/}});_0x404eff['up']({'migrations':_[_0x9cf5('0x30')](_0x347e91,function(_0x3427d0){return _0x3427d0+_0x9cf5('0x29');})})[_0x9cf5('0x21')](function(){return _0x51b783[_0x9cf5('0x12')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x9cf5('0xc')]['version']+'\x20to\x20'+_[_0x9cf5('0x31')](_0x347e91),'migrations':_[_0x9cf5('0x25')](_0x347e91)});})['catch'](function(_0x31fa9b){if(_0x31fa9b instanceof db[_0x9cf5('0x2d')][_0x9cf5('0x32')]){return _0x51b783['status'](0xc8)['json']({'output':_0x9cf5('0x33')});}else{return _0x51b783[_0x9cf5('0x12')](0x1f4)['json'](_0x31fa9b);}});}else{return _0x51b783[_0x9cf5('0x12')](0xc8)[_0x9cf5('0x13')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index bc54eee..daf115c 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 _0x7278=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x46a3ff,_0x470b9a){var _0x404bc2=function(_0x20f25f){while(--_0x20f25f){_0x46a3ff['push'](_0x46a3ff['shift']());}};_0x404bc2(++_0x470b9a);}(_0x7278,0x161));var _0x8727=function(_0x31e795,_0x5566f6){_0x31e795=_0x31e795-0x0;var _0x6bd683=_0x7278[_0x31e795];return _0x6bd683;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var auth=require(_0x8727('0x5'));var interaction=require(_0x8727('0x6'));var config=require(_0x8727('0x7'));var controller=require(_0x8727('0x8'));router[_0x8727('0x9')]('/',auth[_0x8727('0xa')](),controller[_0x8727('0xb')]);router['get'](_0x8727('0xc'),auth[_0x8727('0xa')](),controller[_0x8727('0xd')]);router[_0x8727('0x9')](_0x8727('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8727('0xa')](),controller[_0x8727('0xf')]);router[_0x8727('0x10')](_0x8727('0xe'),auth[_0x8727('0xa')](),controller[_0x8727('0x11')]);router[_0x8727('0x12')](_0x8727('0xe'),auth['isAuthenticated'](),controller[_0x8727('0x13')]);module[_0x8727('0x14')]=router; \ No newline at end of file +var _0x8aad=['delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./voiceAgentReport.controller','index','get','/describe','describe','/:id','isAuthenticated','create','put'];(function(_0xb4824c,_0x103c51){var _0x2cc444=function(_0x50ddad){while(--_0x50ddad){_0xb4824c['push'](_0xb4824c['shift']());}};_0x2cc444(++_0x103c51);}(_0x8aad,0x146));var _0xd8aa=function(_0x156a40,_0x124b9f){_0x156a40=_0x156a40-0x0;var _0x2189b7=_0x8aad[_0x156a40];return _0x2189b7;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var auth=require(_0xd8aa('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd8aa('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xd8aa('0x6')]);router[_0xd8aa('0x7')](_0xd8aa('0x8'),auth['isAuthenticated'](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x7')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller['show']);router['post']('/',auth[_0xd8aa('0xb')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0xd')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller['update']);router[_0xd8aa('0xe')](_0xd8aa('0xa'),auth[_0xd8aa('0xb')](),controller[_0xd8aa('0xf')]);module[_0xd8aa('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8b81f6e..5502275 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 _0x3a40=['exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3a40,0x163));var _0x03a4=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x3a40[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require('sequelize');module[_0x03a4('0x0')]={'type':{'type':Sequelize[_0x03a4('0x1')]},'uniqueid':{'type':Sequelize[_0x03a4('0x1')]},'calleridnum':{'type':Sequelize[_0x03a4('0x1')]},'calleridname':{'type':Sequelize[_0x03a4('0x1')]},'queue':{'type':Sequelize[_0x03a4('0x1')]},'interface':{'type':Sequelize[_0x03a4('0x1')]},'membername':{'type':Sequelize[_0x03a4('0x1')]},'agentcalledAt':{'type':Sequelize[_0x03a4('0x2')]},'agentconnectAt':{'type':Sequelize[_0x03a4('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x03a4('0x2')]},'agentdumpAt':{'type':Sequelize[_0x03a4('0x2')]},'holdtime':{'type':Sequelize[_0x03a4('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x03a4('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x03a4('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x03a4('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x03a4('0x3')]},'reason':{'type':Sequelize[_0x03a4('0x1')]},'lastevent':{'type':Sequelize[_0x03a4('0x1')]},'channel':{'type':Sequelize[_0x03a4('0x1')]},'channelstate':{'type':Sequelize[_0x03a4('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x03a4('0x1')]},'connectedlinename':{'type':Sequelize[_0x03a4('0x1')]},'language':{'type':Sequelize[_0x03a4('0x1')]},'accountcode':{'type':Sequelize[_0x03a4('0x1')]},'context':{'type':Sequelize[_0x03a4('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x03a4('0x1')]},'destchannelstate':{'type':Sequelize[_0x03a4('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x03a4('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x03a4('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x03a4('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x03a4('0x1')]},'destlanguage':{'type':Sequelize[_0x03a4('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x03a4('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x03a4('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x03a4('0x1')]},'transfer':{'type':Sequelize[_0x03a4('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x03a4('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x03a4('0x1')]},'transferuniqueid':{'type':Sequelize[_0x03a4('0x1')]},'agententerreason':{'type':Sequelize[_0x03a4('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x64a7=['FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x40e21d,_0xe32def){var _0x30f13e=function(_0x9ae612){while(--_0x9ae612){_0x40e21d['push'](_0x40e21d['shift']());}};_0x30f13e(++_0xe32def);}(_0x64a7,0xfd));var _0x764a=function(_0x1d4118,_0x50aa9d){_0x1d4118=_0x1d4118-0x0;var _0x2d61e2=_0x64a7[_0x1d4118];return _0x2d61e2;};'use strict';var Sequelize=require(_0x764a('0x0'));module[_0x764a('0x1')]={'type':{'type':Sequelize[_0x764a('0x2')]},'uniqueid':{'type':Sequelize[_0x764a('0x2')]},'calleridnum':{'type':Sequelize[_0x764a('0x2')]},'calleridname':{'type':Sequelize[_0x764a('0x2')]},'queue':{'type':Sequelize[_0x764a('0x2')]},'interface':{'type':Sequelize[_0x764a('0x2')]},'membername':{'type':Sequelize[_0x764a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x764a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x764a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x764a('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x764a('0x3')]},'agentdumpAt':{'type':Sequelize[_0x764a('0x3')]},'holdtime':{'type':Sequelize[_0x764a('0x4')]},'agentcomplete':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x764a('0x4')]},'agentacw':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x764a('0x2')]},'lastevent':{'type':Sequelize[_0x764a('0x2')]},'channel':{'type':Sequelize[_0x764a('0x2')]},'channelstate':{'type':Sequelize[_0x764a('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x764a('0x2')]},'connectedlinename':{'type':Sequelize[_0x764a('0x2')]},'language':{'type':Sequelize[_0x764a('0x2')]},'accountcode':{'type':Sequelize[_0x764a('0x2')]},'context':{'type':Sequelize[_0x764a('0x2')]},'exten':{'type':Sequelize[_0x764a('0x2')]},'priority':{'type':Sequelize[_0x764a('0x2')]},'destchannel':{'type':Sequelize[_0x764a('0x2')]},'destchannelstate':{'type':Sequelize[_0x764a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x764a('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x764a('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x764a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x764a('0x2')]},'destlanguage':{'type':Sequelize[_0x764a('0x2')]},'destaccountcode':{'type':Sequelize[_0x764a('0x2')]},'destcontext':{'type':Sequelize[_0x764a('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x764a('0x2')]},'destuniqueid':{'type':Sequelize[_0x764a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x764a('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x764a('0x2')]},'transfer':{'type':Sequelize[_0x764a('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x764a('0x6')},'transferexten':{'type':Sequelize[_0x764a('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x764a('0x4')],'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 03c4190..6033b27 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 _0x62bd=['status','json','count','offset','limit','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','VoiceAgentReport','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','type','key','VIRTUAL','field','options','includeAll','include','findAll','show','params','length','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end'];(function(_0x4e7a29,_0x49b9e9){var _0x1a7e5b=function(_0x47b2d3){while(--_0x47b2d3){_0x4e7a29['push'](_0x4e7a29['shift']());}};_0x1a7e5b(++_0x49b9e9);}(_0x62bd,0x1a9));var _0xd62b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x62bd[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xd62b('0x0'));var emlformat=require(_0xd62b('0x1'));var rimraf=require(_0xd62b('0x2'));var zipdir=require(_0xd62b('0x3'));var jsonpatch=require(_0xd62b('0x4'));var rp=require(_0xd62b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd62b('0x6'));var util=require('util');var path=require(_0xd62b('0x7'));var sox=require(_0xd62b('0x8'));var csv=require(_0xd62b('0x9'));var ejs=require(_0xd62b('0xa'));var fs=require('fs');var _=require(_0xd62b('0xb'));var squel=require(_0xd62b('0xc'));var crypto=require(_0xd62b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd62b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd62b('0xf'));var Papa=require(_0xd62b('0x10'));var Redis=require(_0xd62b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd62b('0x12'));var hardwareService=require(_0xd62b('0x13'));var logger=require(_0xd62b('0x14'))(_0xd62b('0x15'));var utils=require(_0xd62b('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x105fdf,_0x17b733){_0x17b733=_0x17b733||0xcc;return function(_0x313270){if(_0x313270){return _0x105fdf[_0xd62b('0x17')](_0x17b733);}return _0x105fdf['status'](_0x17b733)[_0xd62b('0x18')]();};}function respondWithResult(_0x4a0101,_0x239a70){_0x239a70=_0x239a70||0xc8;return function(_0x26410f){if(_0x26410f){return _0x4a0101[_0xd62b('0x19')](_0x239a70)[_0xd62b('0x1a')](_0x26410f);}};}function respondWithFilteredResult(_0x44a0c8,_0x287a19){return function(_0x24a417){if(_0x24a417){var _0x4b7741=_0x24a417[_0xd62b('0x1b')],_0x4a8e06=_0x287a19[_0xd62b('0x1c')],_0x25f82b=_0x287a19[_0xd62b('0x1c')]+_0x287a19[_0xd62b('0x1d')],_0x2a42f1;if(_0x25f82b>=_0x4b7741){_0x25f82b=_0x4b7741;_0x2a42f1=0xc8;}else{_0x2a42f1=0xce;}_0x44a0c8[_0xd62b('0x19')](_0x2a42f1);return _0x44a0c8[_0xd62b('0x1e')]('Content-Range',_0x4a8e06+'-'+_0x25f82b+'/'+_0x4b7741)[_0xd62b('0x1a')](_0x24a417);}return null;};}function patchUpdates(_0x7d8d43){return function(_0xadd8fa){try{jsonpatch[_0xd62b('0x1f')](_0xadd8fa,_0x7d8d43,!![]);}catch(_0xf9e513){return BPromise[_0xd62b('0x20')](_0xf9e513);}return _0xadd8fa[_0xd62b('0x21')]();};}function saveUpdates(_0x1b20cb,_0x165843){return function(_0x587d7a){if(_0x587d7a){return _0x587d7a[_0xd62b('0x22')](_0x1b20cb)['then'](function(_0x1d1bf1){return _0x1d1bf1;});}return null;};}function removeEntity(_0xcf681b,_0x1c0af1){return function(_0x39621a){if(_0x39621a){return _0x39621a[_0xd62b('0x23')]()[_0xd62b('0x24')](function(){_0xcf681b[_0xd62b('0x19')](0xcc)[_0xd62b('0x18')]();});}};}function handleEntityNotFound(_0x5c1d0c,_0x205f6e){return function(_0x1c438c){if(!_0x1c438c){_0x5c1d0c[_0xd62b('0x17')](0x194);}return _0x1c438c;};}function handleError(_0x558af5,_0x5e73e8){_0x5e73e8=_0x5e73e8||0x1f4;return function(_0x4c794c){logger[_0xd62b('0x25')](_0x4c794c[_0xd62b('0x26')]);if(_0x4c794c[_0xd62b('0x27')]){delete _0x4c794c['name'];}_0x558af5['status'](_0x5e73e8)[_0xd62b('0x28')](_0x4c794c);};}exports[_0xd62b('0x29')]=function(_0x2fe29b,_0x20be4c){var _0x49541a={},_0x179f4e={},_0x327061={'count':0x0,'rows':[]};var _0x19b01c=db[_0xd62b('0x2a')][_0xd62b('0x2b')];_0x179f4e[_0xd62b('0x2c')]=_[_0xd62b('0x2d')](_0x19b01c);_0x179f4e[_0xd62b('0x2e')]=_[_0xd62b('0x2d')](_0x2fe29b[_0xd62b('0x2e')]);_0x179f4e['filters']=_[_0xd62b('0x2f')](_0x179f4e[_0xd62b('0x2c')],_0x179f4e[_0xd62b('0x2e')]);_0x49541a[_0xd62b('0x30')]=_[_0xd62b('0x2f')](_0x179f4e[_0xd62b('0x2c')],qs[_0xd62b('0x31')](_0x2fe29b[_0xd62b('0x2e')][_0xd62b('0x31')]));_0x49541a[_0xd62b('0x30')]=_0x49541a[_0xd62b('0x30')]['length']?_0x49541a[_0xd62b('0x30')]:_0x179f4e[_0xd62b('0x2c')];if(!_0x2fe29b[_0xd62b('0x2e')][_0xd62b('0x32')](_0xd62b('0x33'))){_0x49541a[_0xd62b('0x1d')]=qs[_0xd62b('0x1d')](_0x2fe29b['query']['limit']);_0x49541a[_0xd62b('0x1c')]=qs['offset'](_0x2fe29b['query'][_0xd62b('0x1c')]);}_0x49541a[_0xd62b('0x34')]=qs[_0xd62b('0x35')](_0x2fe29b[_0xd62b('0x2e')][_0xd62b('0x35')]);_0x49541a['where']=qs[_0xd62b('0x36')](_[_0xd62b('0x37')](_0x2fe29b['query'],_0x179f4e[_0xd62b('0x36')]));if(_0x2fe29b['query'][_0xd62b('0x38')]){_0x49541a['where']=_[_0xd62b('0x39')](_0x49541a[_0xd62b('0x3a')],{'$or':_['map'](_0x19b01c,function(_0x549351){if(_0x549351[_0xd62b('0x3b')][_0xd62b('0x3c')]!==_0xd62b('0x3d')){var _0x563e26={};_0x563e26[_0x549351[_0xd62b('0x3e')]]={'$like':'%'+_0x2fe29b[_0xd62b('0x2e')][_0xd62b('0x38')]+'%'};return _0x563e26;}})});}_0x49541a=_[_0xd62b('0x39')]({},_0x49541a,_0x2fe29b[_0xd62b('0x3f')]);var _0x555307={'where':_0x49541a[_0xd62b('0x3a')]};return db[_0xd62b('0x2a')][_0xd62b('0x1b')](_0x555307)[_0xd62b('0x24')](function(_0x552bba){_0x327061[_0xd62b('0x1b')]=_0x552bba;if(_0x2fe29b[_0xd62b('0x2e')][_0xd62b('0x40')]){_0x49541a[_0xd62b('0x41')]=[{'all':!![]}];}return db[_0xd62b('0x2a')][_0xd62b('0x42')](_0x49541a);})[_0xd62b('0x24')](function(_0x22e003){_0x327061['rows']=_0x22e003;return _0x327061;})[_0xd62b('0x24')](respondWithFilteredResult(_0x20be4c,_0x49541a))['catch'](handleError(_0x20be4c,null));};exports[_0xd62b('0x43')]=function(_0x312aaa,_0x2dea19){var _0x4d80c3={'raw':![],'where':{'id':_0x312aaa[_0xd62b('0x44')]['id']}},_0x58b310={};_0x58b310[_0xd62b('0x2c')]=_[_0xd62b('0x2d')](db[_0xd62b('0x2a')][_0xd62b('0x2b')]);_0x58b310[_0xd62b('0x2e')]=_[_0xd62b('0x2d')](_0x312aaa[_0xd62b('0x2e')]);_0x58b310[_0xd62b('0x36')]=_[_0xd62b('0x2f')](_0x58b310['model'],_0x58b310[_0xd62b('0x2e')]);_0x4d80c3['attributes']=_[_0xd62b('0x2f')](_0x58b310[_0xd62b('0x2c')],qs[_0xd62b('0x31')](_0x312aaa[_0xd62b('0x2e')]['fields']));_0x4d80c3[_0xd62b('0x30')]=_0x4d80c3[_0xd62b('0x30')][_0xd62b('0x45')]?_0x4d80c3[_0xd62b('0x30')]:_0x58b310['model'];if(_0x312aaa['query'][_0xd62b('0x40')]){_0x4d80c3[_0xd62b('0x41')]=[{'all':!![]}];}_0x4d80c3=_[_0xd62b('0x39')]({},_0x4d80c3,_0x312aaa[_0xd62b('0x3f')]);return db['VoiceAgentReport'][_0xd62b('0x46')](_0x4d80c3)['then'](handleEntityNotFound(_0x2dea19,null))[_0xd62b('0x24')](respondWithResult(_0x2dea19,null))[_0xd62b('0x47')](handleError(_0x2dea19,null));};exports['create']=function(_0x587cb0,_0xb3e075){return db[_0xd62b('0x2a')][_0xd62b('0x48')](_0x587cb0['body'],{})['then'](respondWithResult(_0xb3e075,0xc9))[_0xd62b('0x47')](handleError(_0xb3e075,null));};exports[_0xd62b('0x22')]=function(_0xbca7d5,_0x40e1eb){if(_0xbca7d5[_0xd62b('0x49')]['id']){delete _0xbca7d5[_0xd62b('0x49')]['id'];}return db[_0xd62b('0x2a')]['find']({'where':{'id':_0xbca7d5[_0xd62b('0x44')]['id']}})['then'](handleEntityNotFound(_0x40e1eb,null))[_0xd62b('0x24')](saveUpdates(_0xbca7d5[_0xd62b('0x49')],null))[_0xd62b('0x24')](respondWithResult(_0x40e1eb,null))[_0xd62b('0x47')](handleError(_0x40e1eb,null));};exports[_0xd62b('0x23')]=function(_0x14295d,_0x4822f9){return db['VoiceAgentReport'][_0xd62b('0x46')]({'where':{'id':_0x14295d['params']['id']}})[_0xd62b('0x24')](handleEntityNotFound(_0x4822f9,null))[_0xd62b('0x24')](removeEntity(_0x4822f9,null))[_0xd62b('0x47')](handleError(_0x4822f9,null));};exports[_0xd62b('0x4a')]=function(_0x4d358c,_0x417ce4){return db[_0xd62b('0x2a')][_0xd62b('0x4a')]()[_0xd62b('0x24')](respondWithResult(_0x417ce4,null))[_0xd62b('0x47')](handleError(_0x417ce4,null));}; \ No newline at end of file +var _0x8572=['update','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','VoiceAgentReport','includeAll','findAll','show','params','options','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save'];(function(_0xc6e36,_0x28947c){var _0x183089=function(_0x46dabb){while(--_0x46dabb){_0xc6e36['push'](_0xc6e36['shift']());}};_0x183089(++_0x28947c);}(_0x8572,0x14d));var _0x2857=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0x8572[_0x4a7631];return _0x1a5a6f;};'use strict';var pdf=require(_0x2857('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2857('0x1'));var zipdir=require(_0x2857('0x2'));var jsonpatch=require(_0x2857('0x3'));var rp=require(_0x2857('0x4'));var moment=require(_0x2857('0x5'));var BPromise=require(_0x2857('0x6'));var Mustache=require(_0x2857('0x7'));var util=require(_0x2857('0x8'));var path=require(_0x2857('0x9'));var sox=require(_0x2857('0xa'));var csv=require('to-csv');var ejs=require(_0x2857('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2857('0xc'));var deskjs=require(_0x2857('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2857('0xe'));var Papa=require(_0x2857('0xf'));var Redis=require(_0x2857('0x10'));var authService=require(_0x2857('0x11'));var qs=require(_0x2857('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2857('0x13'));var utils=require(_0x2857('0x14'));var config=require(_0x2857('0x15'));var db=require(_0x2857('0x16'))['db'];function respondWithStatusCode(_0x27f386,_0x348168){_0x348168=_0x348168||0xcc;return function(_0x2d6534){if(_0x2d6534){return _0x27f386[_0x2857('0x17')](_0x348168);}return _0x27f386[_0x2857('0x18')](_0x348168)[_0x2857('0x19')]();};}function respondWithResult(_0x34f7ec,_0x13b683){_0x13b683=_0x13b683||0xc8;return function(_0x5eb87c){if(_0x5eb87c){return _0x34f7ec[_0x2857('0x18')](_0x13b683)[_0x2857('0x1a')](_0x5eb87c);}};}function respondWithFilteredResult(_0x3db4de,_0x46862f){return function(_0x470e45){if(_0x470e45){var _0x10cbf3=_0x470e45[_0x2857('0x1b')],_0x5eb998=_0x46862f[_0x2857('0x1c')],_0x5dd712=_0x46862f[_0x2857('0x1c')]+_0x46862f['limit'],_0x51f7f7;if(_0x5dd712>=_0x10cbf3){_0x5dd712=_0x10cbf3;_0x51f7f7=0xc8;}else{_0x51f7f7=0xce;}_0x3db4de[_0x2857('0x18')](_0x51f7f7);return _0x3db4de['set'](_0x2857('0x1d'),_0x5eb998+'-'+_0x5dd712+'/'+_0x10cbf3)['json'](_0x470e45);}return null;};}function patchUpdates(_0x229e35){return function(_0x1ebf5b){try{jsonpatch[_0x2857('0x1e')](_0x1ebf5b,_0x229e35,!![]);}catch(_0x678f4d){return BPromise['reject'](_0x678f4d);}return _0x1ebf5b[_0x2857('0x1f')]();};}function saveUpdates(_0xfd40fb,_0x57f83a){return function(_0x2f6168){if(_0x2f6168){return _0x2f6168[_0x2857('0x20')](_0xfd40fb)[_0x2857('0x21')](function(_0x333ce3){return _0x333ce3;});}return null;};}function removeEntity(_0x43cc52,_0x4dcd4b){return function(_0x1c241a){if(_0x1c241a){return _0x1c241a[_0x2857('0x22')]()[_0x2857('0x21')](function(){_0x43cc52[_0x2857('0x18')](0xcc)[_0x2857('0x19')]();});}};}function handleEntityNotFound(_0x552029,_0x2399bf){return function(_0x1800f7){if(!_0x1800f7){_0x552029[_0x2857('0x17')](0x194);}return _0x1800f7;};}function handleError(_0x3e0ed1,_0x50d7ac){_0x50d7ac=_0x50d7ac||0x1f4;return function(_0x4b2a6b){logger[_0x2857('0x23')](_0x4b2a6b[_0x2857('0x24')]);if(_0x4b2a6b[_0x2857('0x25')]){delete _0x4b2a6b[_0x2857('0x25')];}_0x3e0ed1[_0x2857('0x18')](_0x50d7ac)[_0x2857('0x26')](_0x4b2a6b);};}exports[_0x2857('0x27')]=function(_0x5c9111,_0x32e4ed){var _0x2c5974={},_0x301a31={},_0x57d3dd={'count':0x0,'rows':[]};var _0x16a243=db['VoiceAgentReport'][_0x2857('0x28')];_0x301a31[_0x2857('0x29')]=_['keys'](_0x16a243);_0x301a31['query']=_[_0x2857('0x2a')](_0x5c9111[_0x2857('0x2b')]);_0x301a31[_0x2857('0x2c')]=_[_0x2857('0x2d')](_0x301a31[_0x2857('0x29')],_0x301a31[_0x2857('0x2b')]);_0x2c5974[_0x2857('0x2e')]=_['intersection'](_0x301a31[_0x2857('0x29')],qs['fields'](_0x5c9111[_0x2857('0x2b')][_0x2857('0x2f')]));_0x2c5974[_0x2857('0x2e')]=_0x2c5974['attributes'][_0x2857('0x30')]?_0x2c5974[_0x2857('0x2e')]:_0x301a31[_0x2857('0x29')];if(!_0x5c9111['query']['hasOwnProperty'](_0x2857('0x31'))){_0x2c5974[_0x2857('0x32')]=qs[_0x2857('0x32')](_0x5c9111['query']['limit']);_0x2c5974[_0x2857('0x1c')]=qs[_0x2857('0x1c')](_0x5c9111[_0x2857('0x2b')]['offset']);}_0x2c5974[_0x2857('0x33')]=qs[_0x2857('0x34')](_0x5c9111[_0x2857('0x2b')]['sort']);_0x2c5974[_0x2857('0x35')]=qs[_0x2857('0x2c')](_[_0x2857('0x36')](_0x5c9111[_0x2857('0x2b')],_0x301a31['filters']));if(_0x5c9111['query'][_0x2857('0x37')]){_0x2c5974['where']=_['merge'](_0x2c5974[_0x2857('0x35')],{'$or':_[_0x2857('0x38')](_0x16a243,function(_0x51da48){if(_0x51da48[_0x2857('0x39')][_0x2857('0x3a')]!==_0x2857('0x3b')){var _0x538c05={};_0x538c05[_0x51da48[_0x2857('0x3c')]]={'$like':'%'+_0x5c9111[_0x2857('0x2b')]['filter']+'%'};return _0x538c05;}})});}_0x2c5974=_[_0x2857('0x3d')]({},_0x2c5974,_0x5c9111['options']);var _0x443eea={'where':_0x2c5974[_0x2857('0x35')]};return db[_0x2857('0x3e')][_0x2857('0x1b')](_0x443eea)[_0x2857('0x21')](function(_0x235dda){_0x57d3dd[_0x2857('0x1b')]=_0x235dda;if(_0x5c9111[_0x2857('0x2b')][_0x2857('0x3f')]){_0x2c5974['include']=[{'all':!![]}];}return db[_0x2857('0x3e')][_0x2857('0x40')](_0x2c5974);})['then'](function(_0x362a4b){_0x57d3dd['rows']=_0x362a4b;return _0x57d3dd;})[_0x2857('0x21')](respondWithFilteredResult(_0x32e4ed,_0x2c5974))['catch'](handleError(_0x32e4ed,null));};exports[_0x2857('0x41')]=function(_0x415989,_0x3151bc){var _0x112755={'raw':![],'where':{'id':_0x415989[_0x2857('0x42')]['id']}},_0x29736b={};_0x29736b[_0x2857('0x29')]=_[_0x2857('0x2a')](db[_0x2857('0x3e')][_0x2857('0x28')]);_0x29736b[_0x2857('0x2b')]=_['keys'](_0x415989[_0x2857('0x2b')]);_0x29736b[_0x2857('0x2c')]=_[_0x2857('0x2d')](_0x29736b[_0x2857('0x29')],_0x29736b[_0x2857('0x2b')]);_0x112755['attributes']=_['intersection'](_0x29736b[_0x2857('0x29')],qs[_0x2857('0x2f')](_0x415989['query']['fields']));_0x112755[_0x2857('0x2e')]=_0x112755[_0x2857('0x2e')][_0x2857('0x30')]?_0x112755[_0x2857('0x2e')]:_0x29736b[_0x2857('0x29')];if(_0x415989[_0x2857('0x2b')][_0x2857('0x3f')]){_0x112755['include']=[{'all':!![]}];}_0x112755=_[_0x2857('0x3d')]({},_0x112755,_0x415989[_0x2857('0x43')]);return db[_0x2857('0x3e')][_0x2857('0x44')](_0x112755)[_0x2857('0x21')](handleEntityNotFound(_0x3151bc,null))[_0x2857('0x21')](respondWithResult(_0x3151bc,null))[_0x2857('0x45')](handleError(_0x3151bc,null));};exports[_0x2857('0x46')]=function(_0x2c0b89,_0x58d8fe){return db['VoiceAgentReport'][_0x2857('0x46')](_0x2c0b89['body'],{})[_0x2857('0x21')](respondWithResult(_0x58d8fe,0xc9))['catch'](handleError(_0x58d8fe,null));};exports[_0x2857('0x20')]=function(_0x14222f,_0x5b684d){if(_0x14222f[_0x2857('0x47')]['id']){delete _0x14222f[_0x2857('0x47')]['id'];}return db[_0x2857('0x3e')][_0x2857('0x44')]({'where':{'id':_0x14222f[_0x2857('0x42')]['id']}})['then'](handleEntityNotFound(_0x5b684d,null))['then'](saveUpdates(_0x14222f[_0x2857('0x47')],null))['then'](respondWithResult(_0x5b684d,null))[_0x2857('0x45')](handleError(_0x5b684d,null));};exports[_0x2857('0x22')]=function(_0x2589d9,_0x3a862d){return db[_0x2857('0x3e')][_0x2857('0x44')]({'where':{'id':_0x2589d9[_0x2857('0x42')]['id']}})[_0x2857('0x21')](handleEntityNotFound(_0x3a862d,null))[_0x2857('0x21')](removeEntity(_0x3a862d,null))['catch'](handleError(_0x3a862d,null));};exports[_0x2857('0x48')]=function(_0x229d31,_0x1fceb7){return db[_0x2857('0x3e')]['describe']()[_0x2857('0x21')](respondWithResult(_0x1fceb7,null))[_0x2857('0x45')](handleError(_0x1fceb7,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 93300b6..2c806cf 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 _0x980a=['lodash','../../config/logger','moment','path','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','destuniqueid'];(function(_0x5a91d9,_0x47cedb){var _0x5275e2=function(_0x15de79){while(--_0x15de79){_0x5a91d9['push'](_0x5a91d9['shift']());}};_0x5275e2(++_0x47cedb);}(_0x980a,0x12c));var _0xa980=function(_0x68aaf8,_0x4a9479){_0x68aaf8=_0x68aaf8-0x0;var _0x17da3a=_0x980a[_0x68aaf8];return _0x17da3a;};'use strict';var _=require(_0xa980('0x0'));var util=require('util');var logger=require(_0xa980('0x1'))('api');var moment=require(_0xa980('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa980('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa980('0x4'));module[_0xa980('0x5')]=function(_0x3a64c8,_0x412412){return _0x3a64c8[_0xa980('0x6')](_0xa980('0x7'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0xa980('0x8'),_0xa980('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf295=['util','api','moment','bluebird','path','rimraf','../../config/environment','exports','VoiceAgentReport','uniqueid','destuniqueid','lodash'];(function(_0x153ad6,_0x237146){var _0x261f02=function(_0x402f77){while(--_0x402f77){_0x153ad6['push'](_0x153ad6['shift']());}};_0x261f02(++_0x237146);}(_0xf295,0x137));var _0x5f29=function(_0x423a85,_0x59e206){_0x423a85=_0x423a85-0x0;var _0x5bb0dc=_0xf295[_0x423a85];return _0x5bb0dc;};'use strict';var _=require(_0x5f29('0x0'));var util=require(_0x5f29('0x1'));var logger=require('../../config/logger')(_0x5f29('0x2'));var moment=require(_0x5f29('0x3'));var BPromise=require(_0x5f29('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f29('0x5'));var rimraf=require(_0x5f29('0x6'));var config=require(_0x5f29('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x5f29('0x8')]=function(_0x283c77,_0xf99f23){return _0x283c77['define'](_0x5f29('0x9'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x5f29('0xa'),_0x5f29('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 c40481e..a91d8b0 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 _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceAgentReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','VoiceAgentReport','create','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','then','lodash','util'];(function(_0x41d028,_0x4bb06f){var _0x1d5a2c=function(_0x467cd6){while(--_0x467cd6){_0x41d028['push'](_0x41d028['shift']());}};_0x1d5a2c(++_0x4bb06f);}(_0x7a54,0x106));var _0x47a5=function(_0x5ad332,_0x4e7c62){_0x5ad332=_0x5ad332-0x0;var _0x2166fc=_0x7a54[_0x5ad332];return _0x2166fc;};'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')]('VoiceAgentReport,\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['CreateVoiceAgentReport']=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')]('CreateVoiceAgentReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceAgentReport','body','raw','stringify','VoiceAgentReport','update','options','where','attributes','limit','UpdateVoiceAgentReport','lodash','util'];(function(_0x21383b,_0x5158af){var _0x1e55ed=function(_0x3bbc5d){while(--_0x3bbc5d){_0x21383b['push'](_0x21383b['shift']());}};_0x1e55ed(++_0x5158af);}(_0x814b,0x1a2));var _0xb814=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x814b[_0x1ad926];return _0x1b81dc;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['VoiceAgentReport']['create'](_0x55ba16[_0xb814('0x19')],{'raw':_0x55ba16['options']?_0x55ba16['options'][_0xb814('0x1a')]===undefined?!![]:![]:!![]})[_0xb814('0xd')](function(_0x25b6b6){logger['info'](_0xb814('0x18'),_0x55ba16);logger['debug'](_0xb814('0x18'),_0x55ba16,JSON[_0xb814('0x1b')](_0x25b6b6));_0xfac75b(_0x25b6b6);})[_0xb814('0x17')](function(_0x470e81){logger[_0xb814('0x13')](_0xb814('0x18'),_0x470e81[_0xb814('0x15')],_0x55ba16);_0x4c3007(_0x270598['error'](0x1f4,_0x470e81[_0xb814('0x15')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3f81d0){var _0x457dac=this;return new Promise(function(_0x31c7ec,_0x208927){return db[_0xb814('0x1c')][_0xb814('0x1d')](_0x3f81d0[_0xb814('0x19')],{'raw':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x1f')]||null:null,'attributes':_0x3f81d0[_0xb814('0x1e')]?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x20')]||null:null,'limit':_0x3f81d0['options']?_0x3f81d0[_0xb814('0x1e')][_0xb814('0x21')]||null:null})['then'](function(_0x9008b2){logger[_0xb814('0xe')](_0xb814('0x22'),_0x3f81d0);logger['debug'](_0xb814('0x22'),_0x3f81d0,JSON[_0xb814('0x1b')](_0x9008b2));_0x31c7ec(_0x9008b2);})['catch'](function(_0x338a28){logger['error'](_0xb814('0x22'),_0x338a28['message'],_0x3f81d0);_0x208927(_0x457dac['error'](0x1f4,_0x338a28[_0xb814('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 5834a54..093ae2e 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 _0xfc26=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','describe','get','/:id','create','put','update','delete','path','connect-timeout'];(function(_0x3f1710,_0x3877a2){var _0x528458=function(_0x4b5d0f){while(--_0x4b5d0f){_0x3f1710['push'](_0x3f1710['shift']());}};_0x528458(++_0x3877a2);}(_0xfc26,0x86));var _0x6fc2=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xfc26[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6fc2('0x0'));var timeout=require(_0x6fc2('0x1'));var express=require(_0x6fc2('0x2'));var router=express[_0x6fc2('0x3')]();var auth=require(_0x6fc2('0x4'));var interaction=require(_0x6fc2('0x5'));var config=require(_0x6fc2('0x6'));var controller=require(_0x6fc2('0x7'));router['get']('/',auth[_0x6fc2('0x8')](),controller[_0x6fc2('0x9')]);router['get']('/describe',auth[_0x6fc2('0x8')](),controller[_0x6fc2('0xa')]);router[_0x6fc2('0xb')](_0x6fc2('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6fc2('0x8')](),controller[_0x6fc2('0xd')]);router[_0x6fc2('0xe')](_0x6fc2('0xc'),auth[_0x6fc2('0x8')](),controller[_0x6fc2('0xf')]);router[_0x6fc2('0x10')]('/:id',auth[_0x6fc2('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x71fe=['describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','index','/describe'];(function(_0xc4891,_0x5b95eb){var _0x15225b=function(_0x52db55){while(--_0x52db55){_0xc4891['push'](_0xc4891['shift']());}};_0x15225b(++_0x5b95eb);}(_0x71fe,0xaa));var _0xe71f=function(_0x1db6e1,_0x79416c){_0x1db6e1=_0x1db6e1-0x0;var _0x262d7c=_0x71fe[_0x1db6e1];return _0x262d7c;};'use strict';var multer=require(_0xe71f('0x0'));var util=require(_0xe71f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe71f('0x2'));var router=express[_0xe71f('0x3')]();var auth=require(_0xe71f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe71f('0x5'));var controller=require(_0xe71f('0x6'));router[_0xe71f('0x7')]('/',auth['isAuthenticated'](),controller[_0xe71f('0x8')]);router[_0xe71f('0x7')](_0xe71f('0x9'),auth['isAuthenticated'](),controller[_0xe71f('0xa')]);router['get'](_0xe71f('0xb'),auth[_0xe71f('0xc')](),controller[_0xe71f('0xd')]);router[_0xe71f('0xe')]('/',auth[_0xe71f('0xc')](),controller['create']);router[_0xe71f('0xf')](_0xe71f('0xb'),auth[_0xe71f('0xc')](),controller[_0xe71f('0x10')]);router[_0xe71f('0x11')](_0xe71f('0xb'),auth[_0xe71f('0xc')](),controller[_0xe71f('0x12')]);module[_0xe71f('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index b719665..89e9e52 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 _0xd82b=['internal','outbound','outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','exports','ENUM','inbound'];(function(_0x252597,_0x5c5412){var _0x808d5c=function(_0x4db57e){while(--_0x4db57e){_0x252597['push'](_0x252597['shift']());}};_0x808d5c(++_0x5c5412);}(_0xd82b,0x105));var _0xbd82=function(_0x9b5fde,_0x527f59){_0x9b5fde=_0x9b5fde-0x0;var _0x3b08a1=_0xd82b[_0x9b5fde];return _0x3b08a1;};'use strict';var Sequelize=require('sequelize');module[_0xbd82('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbd82('0x1')](_0xbd82('0x2'),_0xbd82('0x3'),_0xbd82('0x4'),'inbound-fax',_0xbd82('0x5'),_0xbd82('0x6'))},'tag':{'type':Sequelize[_0xbd82('0x7')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xbd82('0x7')]},'destinationcontext':{'type':Sequelize[_0xbd82('0x7')]},'callerid':{'type':Sequelize[_0xbd82('0x7')]},'channel':{'type':Sequelize[_0xbd82('0x7')]},'destinationchannel':{'type':Sequelize[_0xbd82('0x7')]},'lastapplication':{'type':Sequelize[_0xbd82('0x7')]},'lastdata':{'type':Sequelize[_0xbd82('0x8')]},'starttime':{'type':Sequelize[_0xbd82('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xbd82('0x9')]},'endtime':{'type':Sequelize[_0xbd82('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xbd82('0x7')]},'userfield':{'type':Sequelize[_0xbd82('0x7')]},'userDisposition':{'type':Sequelize[_0xbd82('0x7')]},'note':{'type':Sequelize[_0xbd82('0x7')]},'prefix':{'type':Sequelize[_0xbd82('0x7')]},'routeid':{'type':Sequelize[_0xbd82('0xa')]},'sipcallid':{'type':Sequelize[_0xbd82('0x7')]}}; \ No newline at end of file +var _0xe740=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x3b5964,_0x2f21c4){var _0xbc8296=function(_0x1f0789){while(--_0x1f0789){_0x3b5964['push'](_0x3b5964['shift']());}};_0xbc8296(++_0x2f21c4);}(_0xe740,0x1a9));var _0x0e74=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0xe740[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x0e74('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0e74('0x1')](_0x0e74('0x2'),_0x0e74('0x3'),_0x0e74('0x4'),_0x0e74('0x5'),_0x0e74('0x6'),_0x0e74('0x7'))},'tag':{'type':Sequelize[_0x0e74('0x8')]},'accountcode':{'type':Sequelize[_0x0e74('0x8')]},'source':{'type':Sequelize[_0x0e74('0x8')]},'destination':{'type':Sequelize[_0x0e74('0x8')]},'destinationcontext':{'type':Sequelize[_0x0e74('0x8')]},'callerid':{'type':Sequelize[_0x0e74('0x8')]},'channel':{'type':Sequelize[_0x0e74('0x8')]},'destinationchannel':{'type':Sequelize[_0x0e74('0x8')]},'lastapplication':{'type':Sequelize[_0x0e74('0x8')]},'lastdata':{'type':Sequelize[_0x0e74('0x9')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0e74('0xa')]},'answertime':{'type':Sequelize[_0x0e74('0xa')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x0e74('0xb')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x0e74('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0e74('0x8')]},'amaflags':{'type':Sequelize[_0x0e74('0x8')]},'userfield':{'type':Sequelize[_0x0e74('0x8')]},'userDisposition':{'type':Sequelize[_0x0e74('0x8')]},'note':{'type':Sequelize[_0x0e74('0x8')]},'prefix':{'type':Sequelize[_0x0e74('0x8')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 244654c..98dd117 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 _0xd959=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','error','name','send','index','VoiceCallReport','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','map','type','key','field','options','includeAll','fullname','User','findAll','rows','catch','find','create','body','destroy','params','describe','user','html-pdf','eml-format'];(function(_0x3467e4,_0x5873c7){var _0x119d29=function(_0x5cbe0d){while(--_0x5cbe0d){_0x3467e4['push'](_0x3467e4['shift']());}};_0x119d29(++_0x5873c7);}(_0xd959,0x94));var _0x9d95=function(_0x2a458b,_0x302879){_0x2a458b=_0x2a458b-0x0;var _0x1245a=_0xd959[_0x2a458b];return _0x1245a;};'use strict';var pdf=require(_0x9d95('0x0'));var emlformat=require(_0x9d95('0x1'));var rimraf=require(_0x9d95('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d95('0x3'));var rp=require(_0x9d95('0x4'));var moment=require(_0x9d95('0x5'));var BPromise=require(_0x9d95('0x6'));var Mustache=require(_0x9d95('0x7'));var util=require('util');var path=require(_0x9d95('0x8'));var sox=require(_0x9d95('0x9'));var csv=require(_0x9d95('0xa'));var ejs=require(_0x9d95('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9d95('0xc'));var crypto=require(_0x9d95('0xd'));var jsforce=require(_0x9d95('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9d95('0xa'));var querystring=require('querystring');var Papa=require(_0x9d95('0xf'));var Redis=require(_0x9d95('0x10'));var authService=require(_0x9d95('0x11'));var qs=require(_0x9d95('0x12'));var hardwareService=require(_0x9d95('0x13'));var logger=require('../../config/logger')(_0x9d95('0x14'));var utils=require(_0x9d95('0x15'));var config=require('../../config/environment');var db=require(_0x9d95('0x16'))['db'];function respondWithStatusCode(_0x182a73,_0x510b67){_0x510b67=_0x510b67||0xcc;return function(_0x53d59c){if(_0x53d59c){return _0x182a73[_0x9d95('0x17')](_0x510b67);}return _0x182a73[_0x9d95('0x18')](_0x510b67)[_0x9d95('0x19')]();};}function respondWithResult(_0x568622,_0x1ff6a9){_0x1ff6a9=_0x1ff6a9||0xc8;return function(_0x430bfe){if(_0x430bfe){return _0x568622['status'](_0x1ff6a9)[_0x9d95('0x1a')](_0x430bfe);}};}function respondWithFilteredResult(_0x1aee2b,_0xcd7ba8){return function(_0x4b4f1b){if(_0x4b4f1b){var _0x2d5ab2=_0x4b4f1b[_0x9d95('0x1b')],_0x4bae6f=_0xcd7ba8['offset'],_0x4cabfd=_0xcd7ba8[_0x9d95('0x1c')]+_0xcd7ba8['limit'],_0x3e3471;if(_0x4cabfd>=_0x2d5ab2){_0x4cabfd=_0x2d5ab2;_0x3e3471=0xc8;}else{_0x3e3471=0xce;}_0x1aee2b[_0x9d95('0x18')](_0x3e3471);return _0x1aee2b[_0x9d95('0x1d')](_0x9d95('0x1e'),_0x4bae6f+'-'+_0x4cabfd+'/'+_0x2d5ab2)[_0x9d95('0x1a')](_0x4b4f1b);}return null;};}function patchUpdates(_0x481fd6){return function(_0x5a2a22){try{jsonpatch[_0x9d95('0x1f')](_0x5a2a22,_0x481fd6,!![]);}catch(_0x4ec46d){return BPromise[_0x9d95('0x20')](_0x4ec46d);}return _0x5a2a22[_0x9d95('0x21')]();};}function saveUpdates(_0x28dd35,_0x19cfc7){return function(_0x281c3a){if(_0x281c3a){return _0x281c3a[_0x9d95('0x22')](_0x28dd35)[_0x9d95('0x23')](function(_0x3ac1a3){return _0x3ac1a3;});}return null;};}function removeEntity(_0x4a6a8e,_0x31e950){return function(_0x5c8095){if(_0x5c8095){return _0x5c8095['destroy']()[_0x9d95('0x23')](function(){_0x4a6a8e[_0x9d95('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfbe0,_0x29a832){return function(_0x4fcf09){if(!_0x4fcf09){_0x2bfbe0['sendStatus'](0x194);}return _0x4fcf09;};}function handleError(_0x2b1d01,_0x2f4684){_0x2f4684=_0x2f4684||0x1f4;return function(_0x41abf6){logger[_0x9d95('0x24')](_0x41abf6['stack']);if(_0x41abf6[_0x9d95('0x25')]){delete _0x41abf6[_0x9d95('0x25')];}_0x2b1d01[_0x9d95('0x18')](_0x2f4684)[_0x9d95('0x26')](_0x41abf6);};}exports[_0x9d95('0x27')]=function(_0x6c3c73,_0x295f58){var _0x32067a={},_0x154834={},_0xb69ff8={'count':0x0,'rows':[]};var _0x4eb5de=db[_0x9d95('0x28')][_0x9d95('0x29')];_0x154834[_0x9d95('0x2a')]=_[_0x9d95('0x2b')](_0x4eb5de);_0x154834[_0x9d95('0x2c')]=_[_0x9d95('0x2b')](_0x6c3c73[_0x9d95('0x2c')]);_0x154834[_0x9d95('0x2d')]=_[_0x9d95('0x2e')](_0x154834[_0x9d95('0x2a')],_0x154834['query']);_0x32067a[_0x9d95('0x2f')]=_[_0x9d95('0x2e')](_0x154834[_0x9d95('0x2a')],qs[_0x9d95('0x30')](_0x6c3c73[_0x9d95('0x2c')]['fields']));_0x32067a[_0x9d95('0x2f')]=_0x32067a[_0x9d95('0x2f')][_0x9d95('0x31')]?_0x32067a[_0x9d95('0x2f')]:_0x154834['model'];if(!_0x6c3c73[_0x9d95('0x2c')]['hasOwnProperty'](_0x9d95('0x32'))){_0x32067a[_0x9d95('0x33')]=qs[_0x9d95('0x33')](_0x6c3c73['query'][_0x9d95('0x33')]);_0x32067a['offset']=qs['offset'](_0x6c3c73[_0x9d95('0x2c')]['offset']);}_0x32067a['order']=qs[_0x9d95('0x34')](_0x6c3c73['query']['sort']);_0x32067a[_0x9d95('0x35')]=qs[_0x9d95('0x2d')](_[_0x9d95('0x36')](_0x6c3c73[_0x9d95('0x2c')],_0x154834['filters']));if(_0x6c3c73[_0x9d95('0x2c')][_0x9d95('0x37')]){_0x32067a[_0x9d95('0x35')]=_[_0x9d95('0x38')](_0x32067a[_0x9d95('0x35')],{'$or':_[_0x9d95('0x39')](_0x4eb5de,function(_0x2e65f6){if(_0x2e65f6[_0x9d95('0x3a')][_0x9d95('0x3b')]!=='VIRTUAL'){var _0x56431c={};_0x56431c[_0x2e65f6[_0x9d95('0x3c')]]={'$like':'%'+_0x6c3c73[_0x9d95('0x2c')][_0x9d95('0x37')]+'%'};return _0x56431c;}})});}_0x32067a=_['merge']({},_0x32067a,_0x6c3c73[_0x9d95('0x3d')]);var _0x1d21ca={'where':_0x32067a[_0x9d95('0x35')]};return db[_0x9d95('0x28')]['count'](_0x1d21ca)[_0x9d95('0x23')](function(_0x3fa74c){_0xb69ff8[_0x9d95('0x1b')]=_0x3fa74c;if(_0x6c3c73['query'][_0x9d95('0x3e')]){_0x32067a['include']=[{'attributes':['id',_0x9d95('0x25'),_0x9d95('0x3f'),'alias'],'model':db['User'],'as':_0x9d95('0x40')}];}return db['VoiceCallReport'][_0x9d95('0x41')](_0x32067a);})[_0x9d95('0x23')](function(_0x3a4b0a){_0xb69ff8[_0x9d95('0x42')]=_0x3a4b0a;return _0xb69ff8;})['then'](respondWithFilteredResult(_0x295f58,_0x32067a))[_0x9d95('0x43')](handleError(_0x295f58,null));};exports['show']=function(_0x2356d8,_0x3b4dff){var _0x10b755={'raw':!![],'where':{'id':_0x2356d8['params']['id']}},_0x3c677e={};_0x3c677e[_0x9d95('0x2a')]=_[_0x9d95('0x2b')](db[_0x9d95('0x28')]['rawAttributes']);_0x3c677e[_0x9d95('0x2c')]=_[_0x9d95('0x2b')](_0x2356d8[_0x9d95('0x2c')]);_0x3c677e[_0x9d95('0x2d')]=_[_0x9d95('0x2e')](_0x3c677e[_0x9d95('0x2a')],_0x3c677e[_0x9d95('0x2c')]);_0x10b755[_0x9d95('0x2f')]=_[_0x9d95('0x2e')](_0x3c677e[_0x9d95('0x2a')],qs[_0x9d95('0x30')](_0x2356d8[_0x9d95('0x2c')][_0x9d95('0x30')]));_0x10b755[_0x9d95('0x2f')]=_0x10b755[_0x9d95('0x2f')][_0x9d95('0x31')]?_0x10b755[_0x9d95('0x2f')]:_0x3c677e[_0x9d95('0x2a')];if(_0x2356d8[_0x9d95('0x2c')]['includeAll']){_0x10b755['include']=[{'all':!![]}];}_0x10b755=_[_0x9d95('0x38')]({},_0x10b755,_0x2356d8[_0x9d95('0x3d')]);return db[_0x9d95('0x28')][_0x9d95('0x44')](_0x10b755)[_0x9d95('0x23')](handleEntityNotFound(_0x3b4dff,null))[_0x9d95('0x23')](respondWithResult(_0x3b4dff,null))[_0x9d95('0x43')](handleError(_0x3b4dff,null));};exports[_0x9d95('0x45')]=function(_0x4d472a,_0x5f3fe3){return db[_0x9d95('0x28')]['create'](_0x4d472a[_0x9d95('0x46')],{})[_0x9d95('0x23')](respondWithResult(_0x5f3fe3,0xc9))[_0x9d95('0x43')](handleError(_0x5f3fe3,null));};exports[_0x9d95('0x47')]=function(_0x442c56,_0x4e439d){return db[_0x9d95('0x28')][_0x9d95('0x44')]({'where':{'id':_0x442c56[_0x9d95('0x48')]['id']}})['then'](handleEntityNotFound(_0x4e439d,null))[_0x9d95('0x23')](removeEntity(_0x4e439d,null))[_0x9d95('0x43')](handleError(_0x4e439d,null));};exports[_0x9d95('0x49')]=function(_0x32f1dd,_0x3ae9d7){return db['VoiceCallReport'][_0x9d95('0x49')]()['then'](respondWithResult(_0x3ae9d7,null))[_0x9d95('0x43')](handleError(_0x3ae9d7,null));};exports[_0x9d95('0x22')]=function(_0x163ed2,_0x7555ad){if(_0x163ed2[_0x9d95('0x46')]['uniqueid']){delete _0x163ed2[_0x9d95('0x46')]['uniqueid'];}return db[_0x9d95('0x28')]['find']({'where':{'uniqueid':_0x163ed2[_0x9d95('0x48')]['id'],'UserId':{'$or':[null,_0x163ed2[_0x9d95('0x4a')]['id']]}}})[_0x9d95('0x23')](handleEntityNotFound(_0x7555ad,null))[_0x9d95('0x23')](saveUpdates(_0x163ed2[_0x9d95('0x46')],null))[_0x9d95('0x23')](respondWithResult(_0x7555ad,null))[_0x9d95('0x43')](handleError(_0x7555ad,null));}; \ No newline at end of file +var _0xd9fb=['includeAll','include','alias','User','rows','catch','find','create','params','describe','uniqueid','body','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','map','type','VIRTUAL','field','options','VoiceCallReport'];(function(_0x1319c7,_0x55b9d8){var _0x4a6dca=function(_0x144739){while(--_0x144739){_0x1319c7['push'](_0x1319c7['shift']());}};_0x4a6dca(++_0x55b9d8);}(_0xd9fb,0x189));var _0xbd9f=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xd9fb[_0x2f3848];return _0x102668;};'use strict';var pdf=require(_0xbd9f('0x0'));var emlformat=require(_0xbd9f('0x1'));var rimraf=require(_0xbd9f('0x2'));var zipdir=require(_0xbd9f('0x3'));var jsonpatch=require(_0xbd9f('0x4'));var rp=require(_0xbd9f('0x5'));var moment=require(_0xbd9f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xbd9f('0x7'));var util=require(_0xbd9f('0x8'));var path=require('path');var sox=require(_0xbd9f('0x9'));var csv=require('to-csv');var ejs=require(_0xbd9f('0xa'));var fs=require('fs');var _=require(_0xbd9f('0xb'));var squel=require('squel');var crypto=require(_0xbd9f('0xc'));var jsforce=require(_0xbd9f('0xd'));var deskjs=require(_0xbd9f('0xe'));var toCsv=require(_0xbd9f('0xf'));var querystring=require('querystring');var Papa=require(_0xbd9f('0x10'));var Redis=require(_0xbd9f('0x11'));var authService=require(_0xbd9f('0x12'));var qs=require(_0xbd9f('0x13'));var hardwareService=require(_0xbd9f('0x14'));var logger=require(_0xbd9f('0x15'))(_0xbd9f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x513cdc,_0x135923){_0x135923=_0x135923||0xcc;return function(_0x5e800a){if(_0x5e800a){return _0x513cdc[_0xbd9f('0x17')](_0x135923);}return _0x513cdc[_0xbd9f('0x18')](_0x135923)[_0xbd9f('0x19')]();};}function respondWithResult(_0x530513,_0x1430fc){_0x1430fc=_0x1430fc||0xc8;return function(_0x5beefe){if(_0x5beefe){return _0x530513[_0xbd9f('0x18')](_0x1430fc)[_0xbd9f('0x1a')](_0x5beefe);}};}function respondWithFilteredResult(_0x91c2bc,_0x1c6ade){return function(_0x5ec72a){if(_0x5ec72a){var _0x442253=_0x5ec72a[_0xbd9f('0x1b')],_0x25557f=_0x1c6ade[_0xbd9f('0x1c')],_0x104cfd=_0x1c6ade[_0xbd9f('0x1c')]+_0x1c6ade['limit'],_0x1deb0f;if(_0x104cfd>=_0x442253){_0x104cfd=_0x442253;_0x1deb0f=0xc8;}else{_0x1deb0f=0xce;}_0x91c2bc['status'](_0x1deb0f);return _0x91c2bc[_0xbd9f('0x1d')]('Content-Range',_0x25557f+'-'+_0x104cfd+'/'+_0x442253)[_0xbd9f('0x1a')](_0x5ec72a);}return null;};}function patchUpdates(_0x3cc2ce){return function(_0x1b78d0){try{jsonpatch[_0xbd9f('0x1e')](_0x1b78d0,_0x3cc2ce,!![]);}catch(_0x2c276b){return BPromise[_0xbd9f('0x1f')](_0x2c276b);}return _0x1b78d0[_0xbd9f('0x20')]();};}function saveUpdates(_0xe82e22,_0x5af956){return function(_0x365775){if(_0x365775){return _0x365775[_0xbd9f('0x21')](_0xe82e22)[_0xbd9f('0x22')](function(_0x144051){return _0x144051;});}return null;};}function removeEntity(_0x17bc1d,_0x135f49){return function(_0x5f7881){if(_0x5f7881){return _0x5f7881[_0xbd9f('0x23')]()[_0xbd9f('0x22')](function(){_0x17bc1d[_0xbd9f('0x18')](0xcc)[_0xbd9f('0x19')]();});}};}function handleEntityNotFound(_0x4e929d,_0x3bde09){return function(_0x10697a){if(!_0x10697a){_0x4e929d[_0xbd9f('0x17')](0x194);}return _0x10697a;};}function handleError(_0x18b387,_0x5d74e0){_0x5d74e0=_0x5d74e0||0x1f4;return function(_0x3e0ba5){logger[_0xbd9f('0x24')](_0x3e0ba5[_0xbd9f('0x25')]);if(_0x3e0ba5[_0xbd9f('0x26')]){delete _0x3e0ba5[_0xbd9f('0x26')];}_0x18b387[_0xbd9f('0x18')](_0x5d74e0)[_0xbd9f('0x27')](_0x3e0ba5);};}exports['index']=function(_0xd89fc2,_0xd54e7c){var _0xa46ce3={},_0x892315={},_0x25a5c8={'count':0x0,'rows':[]};var _0x5ac251=db['VoiceCallReport'][_0xbd9f('0x28')];_0x892315[_0xbd9f('0x29')]=_[_0xbd9f('0x2a')](_0x5ac251);_0x892315['query']=_[_0xbd9f('0x2a')](_0xd89fc2[_0xbd9f('0x2b')]);_0x892315[_0xbd9f('0x2c')]=_['intersection'](_0x892315[_0xbd9f('0x29')],_0x892315[_0xbd9f('0x2b')]);_0xa46ce3[_0xbd9f('0x2d')]=_[_0xbd9f('0x2e')](_0x892315[_0xbd9f('0x29')],qs[_0xbd9f('0x2f')](_0xd89fc2[_0xbd9f('0x2b')]['fields']));_0xa46ce3['attributes']=_0xa46ce3[_0xbd9f('0x2d')][_0xbd9f('0x30')]?_0xa46ce3[_0xbd9f('0x2d')]:_0x892315[_0xbd9f('0x29')];if(!_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x31')](_0xbd9f('0x32'))){_0xa46ce3[_0xbd9f('0x33')]=qs[_0xbd9f('0x33')](_0xd89fc2['query']['limit']);_0xa46ce3[_0xbd9f('0x1c')]=qs['offset'](_0xd89fc2['query'][_0xbd9f('0x1c')]);}_0xa46ce3[_0xbd9f('0x34')]=qs[_0xbd9f('0x35')](_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x35')]);_0xa46ce3[_0xbd9f('0x36')]=qs[_0xbd9f('0x2c')](_[_0xbd9f('0x37')](_0xd89fc2['query'],_0x892315[_0xbd9f('0x2c')]));if(_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x38')]){_0xa46ce3['where']=_['merge'](_0xa46ce3[_0xbd9f('0x36')],{'$or':_[_0xbd9f('0x39')](_0x5ac251,function(_0x505d00){if(_0x505d00[_0xbd9f('0x3a')]['key']!==_0xbd9f('0x3b')){var _0x2483e2={};_0x2483e2[_0x505d00[_0xbd9f('0x3c')]]={'$like':'%'+_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x38')]+'%'};return _0x2483e2;}})});}_0xa46ce3=_['merge']({},_0xa46ce3,_0xd89fc2[_0xbd9f('0x3d')]);var _0x2c9943={'where':_0xa46ce3['where']};return db[_0xbd9f('0x3e')][_0xbd9f('0x1b')](_0x2c9943)[_0xbd9f('0x22')](function(_0x1aa397){_0x25a5c8['count']=_0x1aa397;if(_0xd89fc2[_0xbd9f('0x2b')][_0xbd9f('0x3f')]){_0xa46ce3[_0xbd9f('0x40')]=[{'attributes':['id',_0xbd9f('0x26'),'fullname',_0xbd9f('0x41')],'model':db[_0xbd9f('0x42')],'as':_0xbd9f('0x42')}];}return db[_0xbd9f('0x3e')]['findAll'](_0xa46ce3);})['then'](function(_0x39eb9e){_0x25a5c8[_0xbd9f('0x43')]=_0x39eb9e;return _0x25a5c8;})['then'](respondWithFilteredResult(_0xd54e7c,_0xa46ce3))[_0xbd9f('0x44')](handleError(_0xd54e7c,null));};exports['show']=function(_0x3e6caf,_0x47a5b4){var _0x32395e={'raw':!![],'where':{'id':_0x3e6caf['params']['id']}},_0x342ada={};_0x342ada['model']=_['keys'](db[_0xbd9f('0x3e')][_0xbd9f('0x28')]);_0x342ada['query']=_['keys'](_0x3e6caf[_0xbd9f('0x2b')]);_0x342ada[_0xbd9f('0x2c')]=_[_0xbd9f('0x2e')](_0x342ada[_0xbd9f('0x29')],_0x342ada['query']);_0x32395e[_0xbd9f('0x2d')]=_[_0xbd9f('0x2e')](_0x342ada[_0xbd9f('0x29')],qs[_0xbd9f('0x2f')](_0x3e6caf[_0xbd9f('0x2b')]['fields']));_0x32395e[_0xbd9f('0x2d')]=_0x32395e[_0xbd9f('0x2d')][_0xbd9f('0x30')]?_0x32395e[_0xbd9f('0x2d')]:_0x342ada['model'];if(_0x3e6caf[_0xbd9f('0x2b')][_0xbd9f('0x3f')]){_0x32395e[_0xbd9f('0x40')]=[{'all':!![]}];}_0x32395e=_['merge']({},_0x32395e,_0x3e6caf['options']);return db[_0xbd9f('0x3e')][_0xbd9f('0x45')](_0x32395e)[_0xbd9f('0x22')](handleEntityNotFound(_0x47a5b4,null))[_0xbd9f('0x22')](respondWithResult(_0x47a5b4,null))['catch'](handleError(_0x47a5b4,null));};exports[_0xbd9f('0x46')]=function(_0x174125,_0x11ad68){return db[_0xbd9f('0x3e')]['create'](_0x174125['body'],{})[_0xbd9f('0x22')](respondWithResult(_0x11ad68,0xc9))[_0xbd9f('0x44')](handleError(_0x11ad68,null));};exports[_0xbd9f('0x23')]=function(_0x585065,_0x381646){return db[_0xbd9f('0x3e')][_0xbd9f('0x45')]({'where':{'id':_0x585065[_0xbd9f('0x47')]['id']}})[_0xbd9f('0x22')](handleEntityNotFound(_0x381646,null))[_0xbd9f('0x22')](removeEntity(_0x381646,null))[_0xbd9f('0x44')](handleError(_0x381646,null));};exports[_0xbd9f('0x48')]=function(_0xcaa162,_0x3e4c37){return db[_0xbd9f('0x3e')][_0xbd9f('0x48')]()[_0xbd9f('0x22')](respondWithResult(_0x3e4c37,null))[_0xbd9f('0x44')](handleError(_0x3e4c37,null));};exports[_0xbd9f('0x21')]=function(_0x53dd0d,_0x14ac76){if(_0x53dd0d['body'][_0xbd9f('0x49')]){delete _0x53dd0d[_0xbd9f('0x4a')]['uniqueid'];}return db['VoiceCallReport'][_0xbd9f('0x45')]({'where':{'uniqueid':_0x53dd0d[_0xbd9f('0x47')]['id'],'UserId':{'$or':[null,_0x53dd0d[_0xbd9f('0x4b')]['id']]}}})[_0xbd9f('0x22')](handleEntityNotFound(_0x14ac76,null))[_0xbd9f('0x22')](saveUpdates(_0x53dd0d[_0xbd9f('0x4a')],null))[_0xbd9f('0x22')](respondWithResult(_0x14ac76,null))[_0xbd9f('0x44')](handleError(_0x14ac76,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 49b493b..3348bc4 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 _0x2207=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','report_call','uniqueid','lodash','util'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x2207,0x67));var _0x7220=function(_0x534193,_0x18f883){_0x534193=_0x534193-0x0;var _0x48ef7e=_0x2207[_0x534193];return _0x48ef7e;};'use strict';var _=require(_0x7220('0x0'));var util=require(_0x7220('0x1'));var logger=require(_0x7220('0x2'))(_0x7220('0x3'));var moment=require(_0x7220('0x4'));var BPromise=require(_0x7220('0x5'));var rp=require(_0x7220('0x6'));var fs=require('fs');var path=require(_0x7220('0x7'));var rimraf=require(_0x7220('0x8'));var config=require(_0x7220('0x9'));var attributes=require(_0x7220('0xa'));module[_0x7220('0xb')]=function(_0x259340,_0x4d2723){return _0x259340[_0x7220('0xc')]('VoiceCallReport',attributes,{'tableName':_0x7220('0xd'),'paranoid':![],'indexes':[{'fields':[_0x7220('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc01e=['bluebird','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','uniqueid','lodash','util','../../config/logger'];(function(_0x5a3af,_0x5a9f06){var _0x2c54f2=function(_0x3335af){while(--_0x3335af){_0x5a3af['push'](_0x5a3af['shift']());}};_0x2c54f2(++_0x5a9f06);}(_0xc01e,0x1f1));var _0xec01=function(_0x348885,_0x13a871){_0x348885=_0x348885-0x0;var _0x7c01ef=_0xc01e[_0x348885];return _0x7c01ef;};'use strict';var _=require(_0xec01('0x0'));var util=require(_0xec01('0x1'));var logger=require(_0xec01('0x2'))('api');var moment=require('moment');var BPromise=require(_0xec01('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xec01('0x4'));var rimraf=require(_0xec01('0x5'));var config=require(_0xec01('0x6'));var attributes=require(_0xec01('0x7'));module[_0xec01('0x8')]=function(_0x54d1ad,_0x1841c2){return _0x54d1ad['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xec01('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index e5d0f37..ecd1cd2 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 _0xdee6=['VoiceCallReport','findAll','options','raw','where','attributes','include','map','model','stringify','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport'];(function(_0x4a5b28,_0x1970eb){var _0x2fa5e9=function(_0x16db4a){while(--_0x16db4a){_0x4a5b28['push'](_0x4a5b28['shift']());}};_0x2fa5e9(++_0x1970eb);}(_0xdee6,0x147));var _0x6dee=function(_0x4f4320,_0x211542){_0x4f4320=_0x4f4320-0x0;var _0x2f0349=_0xdee6[_0x4f4320];return _0x2f0349;};'use strict';var _=require(_0x6dee('0x0'));var util=require(_0x6dee('0x1'));var moment=require(_0x6dee('0x2'));var BPromise=require(_0x6dee('0x3'));var rs=require(_0x6dee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dee('0x5'))['db'];var utils=require(_0x6dee('0x6'));var logger=require(_0x6dee('0x7'))(_0x6dee('0x8'));var config=require(_0x6dee('0x9'));var jayson=require(_0x6dee('0xa'));var client=jayson[_0x6dee('0xb')][_0x6dee('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2db3f7,_0x5d4e8c,_0x1816cb){return new BPromise(function(_0x57950f,_0x5527a0){return client['request'](_0x2db3f7,_0x1816cb)[_0x6dee('0xd')](function(_0x479be4){logger[_0x6dee('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x5d4e8c,_0x6dee('0xf'));logger[_0x6dee('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5d4e8c,_0x6dee('0xf'),JSON['stringify'](_0x479be4));if(_0x479be4[_0x6dee('0x11')]){if(_0x479be4[_0x6dee('0x11')][_0x6dee('0x12')]===0x1f4){logger[_0x6dee('0x11')](_0x6dee('0x13'),_0x5d4e8c,_0x479be4[_0x6dee('0x11')][_0x6dee('0x14')]);return _0x5527a0(_0x479be4[_0x6dee('0x11')]['message']);}logger[_0x6dee('0x11')](_0x6dee('0x13'),_0x5d4e8c,_0x479be4['error'][_0x6dee('0x14')]);return _0x57950f(_0x479be4['error']['message']);}else{logger['info'](_0x6dee('0x13'),_0x5d4e8c,_0x6dee('0xf'));_0x57950f(_0x479be4[_0x6dee('0x15')][_0x6dee('0x14')]);}})[_0x6dee('0x16')](function(_0x256e5f){logger[_0x6dee('0x11')](_0x6dee('0x13'),_0x5d4e8c,_0x256e5f);_0x5527a0(_0x256e5f);});});}exports[_0x6dee('0x17')]=function(_0x5804d4){var _0x1edb41=this;return new Promise(function(_0x1c4524,_0x49dd4b){return db[_0x6dee('0x18')][_0x6dee('0x19')]({'raw':_0x5804d4[_0x6dee('0x1a')]?_0x5804d4[_0x6dee('0x1a')][_0x6dee('0x1b')]===undefined?!![]:![]:!![],'where':_0x5804d4[_0x6dee('0x1a')]?_0x5804d4[_0x6dee('0x1a')][_0x6dee('0x1c')]||null:null,'attributes':_0x5804d4[_0x6dee('0x1a')]?_0x5804d4[_0x6dee('0x1a')][_0x6dee('0x1d')]||null:null,'limit':_0x5804d4[_0x6dee('0x1a')]?_0x5804d4[_0x6dee('0x1a')]['limit']||null:null,'include':_0x5804d4[_0x6dee('0x1a')]?_0x5804d4['options'][_0x6dee('0x1e')]?_[_0x6dee('0x1f')](_0x5804d4['options'][_0x6dee('0x1e')],function(_0x4dc327){return{'model':db[_0x4dc327[_0x6dee('0x20')]],'as':_0x4dc327['as'],'attributes':_0x4dc327[_0x6dee('0x1d')],'include':_0x4dc327[_0x6dee('0x1e')]?_[_0x6dee('0x1f')](_0x4dc327[_0x6dee('0x1e')],function(_0x5c91fe){return{'model':db[_0x5c91fe[_0x6dee('0x20')]],'as':_0x5c91fe['as'],'attributes':_0x5c91fe[_0x6dee('0x1d')],'include':_0x5c91fe[_0x6dee('0x1e')]?_[_0x6dee('0x1f')](_0x5c91fe[_0x6dee('0x1e')],function(_0x2182a3){return{'model':db[_0x2182a3['model']],'as':_0x2182a3['as'],'attributes':_0x2182a3[_0x6dee('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ad489){logger['info'](_0x6dee('0x17'),_0x5804d4);logger[_0x6dee('0x10')](_0x6dee('0x17'),_0x5804d4,JSON[_0x6dee('0x21')](_0x1ad489));_0x1c4524(_0x1ad489);})['catch'](function(_0x5b9d08){logger['error'](_0x6dee('0x17'),_0x5b9d08['message'],_0x5804d4);_0x49dd4b(_0x1edb41[_0x6dee('0x11')](0x1f4,_0x5b9d08[_0x6dee('0x14')]));});});};exports[_0x6dee('0x22')]=function(_0x4c8438){var _0x1094b7=this;return new Promise(function(_0x2f5e27,_0x321eac){return db[_0x6dee('0x18')][_0x6dee('0x23')](_0x4c8438['body'],{'raw':_0x4c8438[_0x6dee('0x1a')]?_0x4c8438[_0x6dee('0x1a')][_0x6dee('0x1b')]===undefined?!![]:![]:!![]})[_0x6dee('0xd')](function(_0x3641a4){logger['info']('CreateVoiceCallReport',_0x4c8438);logger['debug'](_0x6dee('0x22'),_0x4c8438,JSON[_0x6dee('0x21')](_0x3641a4));_0x2f5e27(_0x3641a4);})[_0x6dee('0x16')](function(_0x5e8778){logger['error']('CreateVoiceCallReport',_0x5e8778[_0x6dee('0x14')],_0x4c8438);_0x321eac(_0x1094b7[_0x6dee('0x11')](0x1f4,_0x5e8778[_0x6dee('0x14')]));});});};exports[_0x6dee('0x24')]=function(_0x115f8c){var _0x316617=this;return new Promise(function(_0x3a9d9c,_0x202f69){return db[_0x6dee('0x18')][_0x6dee('0x25')](_0x115f8c['body'],{'raw':_0x115f8c[_0x6dee('0x1a')]?_0x115f8c[_0x6dee('0x1a')][_0x6dee('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x115f8c['options']?_0x115f8c[_0x6dee('0x1a')][_0x6dee('0x1c')]||null:null,'attributes':_0x115f8c[_0x6dee('0x1a')]?_0x115f8c['options'][_0x6dee('0x1d')]||null:null,'limit':_0x115f8c['options']?_0x115f8c['options'][_0x6dee('0x26')]||null:null})[_0x6dee('0xd')](function(_0x1bdb94){logger['info']('UpdateVoiceCallReport',_0x115f8c);logger[_0x6dee('0x10')]('UpdateVoiceCallReport',_0x115f8c,JSON[_0x6dee('0x21')](_0x1bdb94));_0x3a9d9c(_0x1bdb94);})[_0x6dee('0x16')](function(_0x2f9e91){logger[_0x6dee('0x11')](_0x6dee('0x24'),_0x2f9e91[_0x6dee('0x14')],_0x115f8c);_0x202f69(_0x316617['error'](0x1f4,_0x2f9e91[_0x6dee('0x14')]));});});}; \ No newline at end of file +var _0x1a85=['../../config/logger','rpc','client','request','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','VoiceCallReport,\x20%s,\x20%s','message','info','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','CreateVoiceCallReport','VoiceCallReport','UpdateVoiceCallReport','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3d6941,_0x543ea6){var _0x590de9=function(_0x2ac022){while(--_0x2ac022){_0x3d6941['push'](_0x3d6941['shift']());}};_0x590de9(++_0x543ea6);}(_0x1a85,0x170));var _0x51a8=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x1a85[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0x51a8('0x0'));var util=require(_0x51a8('0x1'));var moment=require('moment');var BPromise=require(_0x51a8('0x2'));var rs=require(_0x51a8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51a8('0x4'))['db'];var utils=require(_0x51a8('0x5'));var logger=require(_0x51a8('0x6'))(_0x51a8('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x51a8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcb575b,_0x3c851a,_0x3faf3f){return new BPromise(function(_0xbb3677,_0x2ab0fe){return client[_0x51a8('0x9')](_0xcb575b,_0x3faf3f)['then'](function(_0x239960){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x3c851a,'request\x20sent');logger['debug'](_0x51a8('0xa'),_0x3c851a,_0x51a8('0xb'),JSON['stringify'](_0x239960));if(_0x239960[_0x51a8('0xc')]){if(_0x239960[_0x51a8('0xc')]['code']===0x1f4){logger[_0x51a8('0xc')](_0x51a8('0xd'),_0x3c851a,_0x239960['error'][_0x51a8('0xe')]);return _0x2ab0fe(_0x239960[_0x51a8('0xc')][_0x51a8('0xe')]);}logger[_0x51a8('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x3c851a,_0x239960[_0x51a8('0xc')][_0x51a8('0xe')]);return _0xbb3677(_0x239960['error'][_0x51a8('0xe')]);}else{logger[_0x51a8('0xf')]('VoiceCallReport,\x20%s,\x20%s',_0x3c851a,_0x51a8('0xb'));_0xbb3677(_0x239960[_0x51a8('0x10')][_0x51a8('0xe')]);}})[_0x51a8('0x11')](function(_0x2c0122){logger[_0x51a8('0xc')](_0x51a8('0xd'),_0x3c851a,_0x2c0122);_0x2ab0fe(_0x2c0122);});});}exports[_0x51a8('0x12')]=function(_0x140931){var _0x3b0fd4=this;return new Promise(function(_0x58ba50,_0x4a00c2){return db['VoiceCallReport'][_0x51a8('0x13')]({'raw':_0x140931['options']?_0x140931[_0x51a8('0x14')][_0x51a8('0x15')]===undefined?!![]:![]:!![],'where':_0x140931[_0x51a8('0x14')]?_0x140931[_0x51a8('0x14')][_0x51a8('0x16')]||null:null,'attributes':_0x140931['options']?_0x140931[_0x51a8('0x14')][_0x51a8('0x17')]||null:null,'limit':_0x140931[_0x51a8('0x14')]?_0x140931[_0x51a8('0x14')][_0x51a8('0x18')]||null:null,'include':_0x140931[_0x51a8('0x14')]?_0x140931['options'][_0x51a8('0x19')]?_['map'](_0x140931[_0x51a8('0x14')][_0x51a8('0x19')],function(_0xb7e940){return{'model':db[_0xb7e940['model']],'as':_0xb7e940['as'],'attributes':_0xb7e940['attributes'],'include':_0xb7e940[_0x51a8('0x19')]?_[_0x51a8('0x1a')](_0xb7e940[_0x51a8('0x19')],function(_0x3a7ac5){return{'model':db[_0x3a7ac5[_0x51a8('0x1b')]],'as':_0x3a7ac5['as'],'attributes':_0x3a7ac5[_0x51a8('0x17')],'include':_0x3a7ac5[_0x51a8('0x19')]?_[_0x51a8('0x1a')](_0x3a7ac5[_0x51a8('0x19')],function(_0xf503f8){return{'model':db[_0xf503f8['model']],'as':_0xf503f8['as'],'attributes':_0xf503f8[_0x51a8('0x17')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1c')](function(_0x556658){logger[_0x51a8('0xf')]('GetVoiceCallReport',_0x140931);logger[_0x51a8('0x1d')](_0x51a8('0x12'),_0x140931,JSON[_0x51a8('0x1e')](_0x556658));_0x58ba50(_0x556658);})[_0x51a8('0x11')](function(_0x4fc148){logger[_0x51a8('0xc')](_0x51a8('0x12'),_0x4fc148[_0x51a8('0xe')],_0x140931);_0x4a00c2(_0x3b0fd4['error'](0x1f4,_0x4fc148['message']));});});};exports[_0x51a8('0x1f')]=function(_0x35af62){var _0x28fb3c=this;return new Promise(function(_0xac53e8,_0x270e10){return db[_0x51a8('0x20')]['create'](_0x35af62['body'],{'raw':_0x35af62['options']?_0x35af62[_0x51a8('0x14')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4313c7){logger[_0x51a8('0xf')]('CreateVoiceCallReport',_0x35af62);logger['debug'](_0x51a8('0x1f'),_0x35af62,JSON['stringify'](_0x4313c7));_0xac53e8(_0x4313c7);})[_0x51a8('0x11')](function(_0x5169f6){logger[_0x51a8('0xc')](_0x51a8('0x1f'),_0x5169f6[_0x51a8('0xe')],_0x35af62);_0x270e10(_0x28fb3c['error'](0x1f4,_0x5169f6[_0x51a8('0xe')]));});});};exports[_0x51a8('0x21')]=function(_0x4fea28){var _0x40a9a3=this;return new Promise(function(_0x5421c1,_0x20cea8){return db['VoiceCallReport']['update'](_0x4fea28['body'],{'raw':_0x4fea28['options']?_0x4fea28[_0x51a8('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fea28[_0x51a8('0x14')]?_0x4fea28[_0x51a8('0x14')][_0x51a8('0x16')]||null:null,'attributes':_0x4fea28[_0x51a8('0x14')]?_0x4fea28['options'][_0x51a8('0x17')]||null:null,'limit':_0x4fea28[_0x51a8('0x14')]?_0x4fea28[_0x51a8('0x14')][_0x51a8('0x18')]||null:null})[_0x51a8('0x1c')](function(_0x512be3){logger[_0x51a8('0xf')](_0x51a8('0x21'),_0x4fea28);logger[_0x51a8('0x1d')](_0x51a8('0x21'),_0x4fea28,JSON[_0x51a8('0x1e')](_0x512be3));_0x5421c1(_0x512be3);})[_0x51a8('0x11')](function(_0x21957d){logger[_0x51a8('0xc')](_0x51a8('0x21'),_0x21957d[_0x51a8('0xe')],_0x4fea28);_0x20cea8(_0x40a9a3[_0x51a8('0xc')](0x1f4,_0x21957d[_0x51a8('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 29e1b26..f60f945 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 _0x1e6a=['path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x1e6a,0x163));var _0xa1e6=function(_0x3e06bb,_0x397bba){_0x3e06bb=_0x3e06bb-0x0;var _0x29faef=_0x1e6a[_0x3e06bb];return _0x29faef;};'use strict';var multer=require(_0xa1e6('0x0'));var util=require(_0xa1e6('0x1'));var path=require(_0xa1e6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xa1e6('0x3'));var interaction=require(_0xa1e6('0x4'));var config=require(_0xa1e6('0x5'));var controller=require(_0xa1e6('0x6'));router[_0xa1e6('0x7')]('/',auth[_0xa1e6('0x8')](),controller[_0xa1e6('0x9')]);router[_0xa1e6('0x7')]('/:id',auth[_0xa1e6('0x8')](),controller[_0xa1e6('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa1e6('0xb')]);router[_0xa1e6('0xc')](_0xa1e6('0xd'),auth['isAuthenticated'](),controller[_0xa1e6('0xe')]);router[_0xa1e6('0xf')](_0xa1e6('0xd'),auth[_0xa1e6('0x8')](),controller[_0xa1e6('0x10')]);module['exports']=router; \ No newline at end of file +var _0xa90d=['multer','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports'];(function(_0x2a960f,_0x5aab73){var _0x5027df=function(_0x13bf75){while(--_0x13bf75){_0x2a960f['push'](_0x2a960f['shift']());}};_0x5027df(++_0x5aab73);}(_0xa90d,0x186));var _0xda90=function(_0x10c899,_0x6d4d75){_0x10c899=_0x10c899-0x0;var _0x2c89d7=_0xa90d[_0x10c899];return _0x2c89d7;};'use strict';var multer=require(_0xda90('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xda90('0x1'));var express=require('express');var router=express[_0xda90('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xda90('0x3'));var config=require(_0xda90('0x4'));var controller=require('./voiceChanSpy.controller');router[_0xda90('0x5')]('/',auth[_0xda90('0x6')](),controller[_0xda90('0x7')]);router[_0xda90('0x5')](_0xda90('0x8'),auth[_0xda90('0x6')](),controller[_0xda90('0x9')]);router['post']('/',auth[_0xda90('0x6')](),controller[_0xda90('0xa')]);router[_0xda90('0xb')](_0xda90('0x8'),auth[_0xda90('0x6')](),controller[_0xda90('0xc')]);router[_0xda90('0xd')](_0xda90('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xda90('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fc69594..3f9f745 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 _0x2fa6=['join','getDataValue','BOOLEAN','exports','STRING','name','options'];(function(_0x588fbf,_0x367c67){var _0x3d3de5=function(_0x298cb6){while(--_0x298cb6){_0x588fbf['push'](_0x588fbf['shift']());}};_0x3d3de5(++_0x367c67);}(_0x2fa6,0xa4));var _0x62fa=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2fa6[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require('sequelize');module[_0x62fa('0x0')]={'name':{'type':Sequelize[_0x62fa('0x1')]},'prefix':{'type':Sequelize[_0x62fa('0x1')],'unique':_0x62fa('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x62fa('0x1')],'set':function(_0x238bbb){this['setDataValue'](_0x62fa('0x3'),_0x238bbb?_0x238bbb[_0x62fa('0x4')](''):[]);},'get':function(){return this[_0x62fa('0x5')](_0x62fa('0x3'))?this[_0x62fa('0x5')]('options')['split'](''):[];}},'auth':{'type':Sequelize[_0x62fa('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0x62fa('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x62fa('0x1')]},'description':{'type':Sequelize[_0x62fa('0x1')]}}; \ No newline at end of file +var _0xdd49=['STRING','name','options','join','getDataValue','split','BOOLEAN','exports'];(function(_0x2612dd,_0x1b3ed){var _0x15af02=function(_0x41b8cc){while(--_0x41b8cc){_0x2612dd['push'](_0x2612dd['shift']());}};_0x15af02(++_0x1b3ed);}(_0xdd49,0x177));var _0x9dd4=function(_0x153846,_0x1227ad){_0x153846=_0x153846-0x0;var _0x3ee557=_0xdd49[_0x153846];return _0x3ee557;};'use strict';var Sequelize=require('sequelize');module[_0x9dd4('0x0')]={'name':{'type':Sequelize[_0x9dd4('0x1')]},'prefix':{'type':Sequelize[_0x9dd4('0x1')],'unique':_0x9dd4('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x575dc5){this['setDataValue'](_0x9dd4('0x3'),_0x575dc5?_0x575dc5[_0x9dd4('0x4')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x9dd4('0x5')](_0x9dd4('0x3'))[_0x9dd4('0x6')](''):[];}},'auth':{'type':Sequelize[_0x9dd4('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x9dd4('0x1')]},'record':{'type':Sequelize[_0x9dd4('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x9dd4('0x1')]},'description':{'type':Sequelize[_0x9dd4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 8fe09b4..4909d34 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 _0x0c33=['merge','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChanSpies','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','name','send','index','VoiceChanSpy','rawAttributes','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c33,0x107));var _0x30c3=function(_0x5af97c,_0x24a49f){_0x5af97c=_0x5af97c-0x0;var _0x3472ae=_0x0c33[_0x5af97c];return _0x3472ae;};'use strict';var pdf=require(_0x30c3('0x0'));var emlformat=require(_0x30c3('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x30c3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x30c3('0x3'));var Mustache=require(_0x30c3('0x4'));var util=require('util');var path=require(_0x30c3('0x5'));var sox=require(_0x30c3('0x6'));var csv=require(_0x30c3('0x7'));var ejs=require(_0x30c3('0x8'));var fs=require('fs');var _=require(_0x30c3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x30c3('0xa'));var deskjs=require(_0x30c3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x30c3('0xc'));var Papa=require(_0x30c3('0xd'));var Redis=require(_0x30c3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x30c3('0xf'));var hardwareService=require(_0x30c3('0x10'));var logger=require(_0x30c3('0x11'))(_0x30c3('0x12'));var utils=require('../../config/utils');var config=require(_0x30c3('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x58ca47,_0x5a4496){_0x5a4496=_0x5a4496||0xcc;return function(_0x3f6a30){if(_0x3f6a30){return _0x58ca47[_0x30c3('0x14')](_0x5a4496);}return _0x58ca47['status'](_0x5a4496)[_0x30c3('0x15')]();};}function respondWithResult(_0x3e1604,_0x1680ab){_0x1680ab=_0x1680ab||0xc8;return function(_0x534aa6){if(_0x534aa6){return _0x3e1604[_0x30c3('0x16')](_0x1680ab)[_0x30c3('0x17')](_0x534aa6);}};}function respondWithFilteredResult(_0x316744,_0x396a75){return function(_0x42843a){if(_0x42843a){var _0x5b5856=_0x42843a[_0x30c3('0x18')],_0x1f7ddf=_0x396a75[_0x30c3('0x19')],_0x2fd248=_0x396a75[_0x30c3('0x19')]+_0x396a75['limit'],_0x192f0f;if(_0x2fd248>=_0x5b5856){_0x2fd248=_0x5b5856;_0x192f0f=0xc8;}else{_0x192f0f=0xce;}_0x316744[_0x30c3('0x16')](_0x192f0f);return _0x316744[_0x30c3('0x1a')](_0x30c3('0x1b'),_0x1f7ddf+'-'+_0x2fd248+'/'+_0x5b5856)[_0x30c3('0x17')](_0x42843a);}return null;};}function patchUpdates(_0x4c6539){return function(_0x3d4192){try{jsonpatch[_0x30c3('0x1c')](_0x3d4192,_0x4c6539,!![]);}catch(_0x486396){return BPromise[_0x30c3('0x1d')](_0x486396);}return _0x3d4192[_0x30c3('0x1e')]();};}function saveUpdates(_0x273422,_0x194a06){return function(_0x3e1f4e){if(_0x3e1f4e){return _0x3e1f4e['update'](_0x273422)[_0x30c3('0x1f')](function(_0x24ca2a){return _0x24ca2a;});}return null;};}function removeEntity(_0x3d8165,_0x48679d){return function(_0x3788f1){if(_0x3788f1){return _0x3788f1[_0x30c3('0x20')]()[_0x30c3('0x1f')](function(){var _0x2123ba=_0x3788f1[_0x30c3('0x21')]({'plain':!![]});var _0x596ee1='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x596ee1,'resourceId':_0x2123ba['id']}})[_0x30c3('0x1f')](function(){return _0x3788f1;});})[_0x30c3('0x1f')](function(){_0x3d8165['status'](0xcc)[_0x30c3('0x15')]();});}};}function handleEntityNotFound(_0x458046,_0x4d4c39){return function(_0x3ea70d){if(!_0x3ea70d){_0x458046[_0x30c3('0x14')](0x194);}return _0x3ea70d;};}function handleError(_0x2964b9,_0x341bc0){_0x341bc0=_0x341bc0||0x1f4;return function(_0x57ecb5){logger['error'](_0x57ecb5['stack']);if(_0x57ecb5[_0x30c3('0x22')]){delete _0x57ecb5[_0x30c3('0x22')];}_0x2964b9[_0x30c3('0x16')](_0x341bc0)[_0x30c3('0x23')](_0x57ecb5);};}exports[_0x30c3('0x24')]=function(_0x161929,_0x952469){var _0x40b5b9={},_0x3f80b4={},_0x59ba12={'count':0x0,'rows':[]};var _0x1dc066=db[_0x30c3('0x25')][_0x30c3('0x26')];_0x3f80b4[_0x30c3('0x27')]=_[_0x30c3('0x28')](_0x1dc066);_0x3f80b4[_0x30c3('0x29')]=_[_0x30c3('0x28')](_0x161929[_0x30c3('0x29')]);_0x3f80b4['filters']=_[_0x30c3('0x2a')](_0x3f80b4[_0x30c3('0x27')],_0x3f80b4[_0x30c3('0x29')]);_0x40b5b9[_0x30c3('0x2b')]=_[_0x30c3('0x2a')](_0x3f80b4[_0x30c3('0x27')],qs[_0x30c3('0x2c')](_0x161929[_0x30c3('0x29')][_0x30c3('0x2c')]));_0x40b5b9[_0x30c3('0x2b')]=_0x40b5b9['attributes']['length']?_0x40b5b9['attributes']:_0x3f80b4[_0x30c3('0x27')];if(!_0x161929[_0x30c3('0x29')][_0x30c3('0x2d')](_0x30c3('0x2e'))){_0x40b5b9[_0x30c3('0x2f')]=qs['limit'](_0x161929['query'][_0x30c3('0x2f')]);_0x40b5b9['offset']=qs['offset'](_0x161929['query'][_0x30c3('0x19')]);}_0x40b5b9[_0x30c3('0x30')]=qs[_0x30c3('0x31')](_0x161929['query'][_0x30c3('0x31')]);_0x40b5b9[_0x30c3('0x32')]=qs['filters'](_[_0x30c3('0x33')](_0x161929['query'],_0x3f80b4['filters']));if(_0x161929[_0x30c3('0x29')][_0x30c3('0x34')]){_0x40b5b9[_0x30c3('0x32')]=_[_0x30c3('0x35')](_0x40b5b9['where'],{'$or':_['map'](_0x1dc066,function(_0x52050a){if(_0x52050a['type']['key']!==_0x30c3('0x36')){var _0x592cc3={};_0x592cc3[_0x52050a[_0x30c3('0x37')]]={'$like':'%'+_0x161929[_0x30c3('0x29')]['filter']+'%'};return _0x592cc3;}})});}_0x40b5b9=_[_0x30c3('0x35')]({},_0x40b5b9,_0x161929[_0x30c3('0x38')]);var _0x350828={'where':_0x40b5b9[_0x30c3('0x32')]};return db['VoiceChanSpy'][_0x30c3('0x18')](_0x350828)[_0x30c3('0x1f')](function(_0x1c0731){_0x59ba12[_0x30c3('0x18')]=_0x1c0731;if(_0x161929[_0x30c3('0x29')][_0x30c3('0x39')]){_0x40b5b9[_0x30c3('0x3a')]=[{'all':!![]}];}return db[_0x30c3('0x25')][_0x30c3('0x3b')](_0x40b5b9);})[_0x30c3('0x1f')](function(_0x256d6f){_0x59ba12[_0x30c3('0x3c')]=_0x256d6f;return _0x59ba12;})[_0x30c3('0x1f')](respondWithFilteredResult(_0x952469,_0x40b5b9))[_0x30c3('0x3d')](handleError(_0x952469,null));};exports[_0x30c3('0x3e')]=function(_0x1a2827,_0x1a4dad){var _0x22d584={'raw':![],'where':{'id':_0x1a2827[_0x30c3('0x3f')]['id']}},_0x30fb50={};_0x30fb50['model']=_[_0x30c3('0x28')](db[_0x30c3('0x25')][_0x30c3('0x26')]);_0x30fb50[_0x30c3('0x29')]=_[_0x30c3('0x28')](_0x1a2827[_0x30c3('0x29')]);_0x30fb50['filters']=_[_0x30c3('0x2a')](_0x30fb50[_0x30c3('0x27')],_0x30fb50[_0x30c3('0x29')]);_0x22d584[_0x30c3('0x2b')]=_[_0x30c3('0x2a')](_0x30fb50[_0x30c3('0x27')],qs[_0x30c3('0x2c')](_0x1a2827[_0x30c3('0x29')]['fields']));_0x22d584['attributes']=_0x22d584['attributes'][_0x30c3('0x40')]?_0x22d584[_0x30c3('0x2b')]:_0x30fb50[_0x30c3('0x27')];if(_0x1a2827['query']['includeAll']){_0x22d584[_0x30c3('0x3a')]=[{'all':!![]}];}_0x22d584=_['merge']({},_0x22d584,_0x1a2827[_0x30c3('0x38')]);return db[_0x30c3('0x25')][_0x30c3('0x41')](_0x22d584)['then'](handleEntityNotFound(_0x1a4dad,null))['then'](respondWithResult(_0x1a4dad,null))[_0x30c3('0x3d')](handleError(_0x1a4dad,null));};exports[_0x30c3('0x42')]=function(_0x3649aa,_0x28af76){return db[_0x30c3('0x25')]['create'](_0x3649aa[_0x30c3('0x43')],{})[_0x30c3('0x1f')](function(_0x327a2f){var _0x1afed0=_0x3649aa['user'][_0x30c3('0x21')]({'plain':!![]});if(!_0x1afed0)throw new Error(_0x30c3('0x44'));if(_0x1afed0[_0x30c3('0x45')]===_0x30c3('0x46')){var _0x296ecd=_0x327a2f[_0x30c3('0x21')]({'plain':!![]});var _0xf5e5cb=_0x30c3('0x47');return db[_0x30c3('0x48')][_0x30c3('0x41')]({'where':{'name':_0xf5e5cb,'userProfileId':_0x1afed0[_0x30c3('0x49')]},'raw':!![]})['then'](function(_0x4d20ba){if(_0x4d20ba&&_0x4d20ba[_0x30c3('0x4a')]===0x0){return db[_0x30c3('0x4b')]['create']({'name':_0x296ecd[_0x30c3('0x22')],'resourceId':_0x296ecd['id'],'type':_0x4d20ba[_0x30c3('0x22')],'sectionId':_0x4d20ba['id']},{})['then'](function(){return _0x327a2f;});}else{return _0x327a2f;}})['catch'](function(_0x3b5d6d){logger[_0x30c3('0x4c')](_0x30c3('0x4d'),_0x3b5d6d);throw _0x3b5d6d;});}return _0x327a2f;})[_0x30c3('0x1f')](respondWithResult(_0x28af76,0xc9))[_0x30c3('0x3d')](handleError(_0x28af76,null));};exports[_0x30c3('0x4e')]=function(_0x5450eb,_0xc33435){if(_0x5450eb[_0x30c3('0x43')]['id']){delete _0x5450eb['body']['id'];}return db[_0x30c3('0x25')][_0x30c3('0x41')]({'where':{'id':_0x5450eb[_0x30c3('0x3f')]['id']}})[_0x30c3('0x1f')](handleEntityNotFound(_0xc33435,null))[_0x30c3('0x1f')](saveUpdates(_0x5450eb[_0x30c3('0x43')],null))[_0x30c3('0x1f')](respondWithResult(_0xc33435,null))[_0x30c3('0x3d')](handleError(_0xc33435,null));};exports[_0x30c3('0x20')]=function(_0x4cc7ef,_0x254955){return db[_0x30c3('0x25')][_0x30c3('0x41')]({'where':{'id':_0x4cc7ef['params']['id']}})[_0x30c3('0x1f')](handleEntityNotFound(_0x254955,null))[_0x30c3('0x1f')](removeEntity(_0x254955,null))[_0x30c3('0x3d')](handleError(_0x254955,null));}; \ No newline at end of file +var _0x4cbd=['include','findAll','catch','params','options','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','name','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','send','index','VoiceChanSpy','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','map','type','key','VIRTUAL','field','merge','includeAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4cbd,0xb2));var _0xd4cb=function(_0x42701f,_0x3d2f90){_0x42701f=_0x42701f-0x0;var _0x36aafb=_0x4cbd[_0x42701f];return _0x36aafb;};'use strict';var pdf=require(_0xd4cb('0x0'));var emlformat=require(_0xd4cb('0x1'));var rimraf=require(_0xd4cb('0x2'));var zipdir=require(_0xd4cb('0x3'));var jsonpatch=require(_0xd4cb('0x4'));var rp=require(_0xd4cb('0x5'));var moment=require('moment');var BPromise=require(_0xd4cb('0x6'));var Mustache=require(_0xd4cb('0x7'));var util=require(_0xd4cb('0x8'));var path=require(_0xd4cb('0x9'));var sox=require('sox');var csv=require(_0xd4cb('0xa'));var ejs=require(_0xd4cb('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd4cb('0xc'));var crypto=require(_0xd4cb('0xd'));var jsforce=require(_0xd4cb('0xe'));var deskjs=require(_0xd4cb('0xf'));var toCsv=require(_0xd4cb('0xa'));var querystring=require(_0xd4cb('0x10'));var Papa=require(_0xd4cb('0x11'));var Redis=require(_0xd4cb('0x12'));var authService=require(_0xd4cb('0x13'));var qs=require(_0xd4cb('0x14'));var hardwareService=require(_0xd4cb('0x15'));var logger=require('../../config/logger')(_0xd4cb('0x16'));var utils=require(_0xd4cb('0x17'));var config=require(_0xd4cb('0x18'));var db=require(_0xd4cb('0x19'))['db'];function respondWithStatusCode(_0x39a77a,_0x224c4a){_0x224c4a=_0x224c4a||0xcc;return function(_0xa91591){if(_0xa91591){return _0x39a77a[_0xd4cb('0x1a')](_0x224c4a);}return _0x39a77a[_0xd4cb('0x1b')](_0x224c4a)[_0xd4cb('0x1c')]();};}function respondWithResult(_0x2b73cc,_0x312a43){_0x312a43=_0x312a43||0xc8;return function(_0x240353){if(_0x240353){return _0x2b73cc[_0xd4cb('0x1b')](_0x312a43)[_0xd4cb('0x1d')](_0x240353);}};}function respondWithFilteredResult(_0x4e26cd,_0x1c44ad){return function(_0x842b41){if(_0x842b41){var _0xb59120=_0x842b41[_0xd4cb('0x1e')],_0x5ac614=_0x1c44ad[_0xd4cb('0x1f')],_0x5dfcfa=_0x1c44ad['offset']+_0x1c44ad[_0xd4cb('0x20')],_0x544f72;if(_0x5dfcfa>=_0xb59120){_0x5dfcfa=_0xb59120;_0x544f72=0xc8;}else{_0x544f72=0xce;}_0x4e26cd[_0xd4cb('0x1b')](_0x544f72);return _0x4e26cd['set'](_0xd4cb('0x21'),_0x5ac614+'-'+_0x5dfcfa+'/'+_0xb59120)['json'](_0x842b41);}return null;};}function patchUpdates(_0x5736d9){return function(_0x38fc6e){try{jsonpatch[_0xd4cb('0x22')](_0x38fc6e,_0x5736d9,!![]);}catch(_0x1c08e8){return BPromise['reject'](_0x1c08e8);}return _0x38fc6e[_0xd4cb('0x23')]();};}function saveUpdates(_0x4f0292,_0x514ecb){return function(_0x5b2e03){if(_0x5b2e03){return _0x5b2e03[_0xd4cb('0x24')](_0x4f0292)[_0xd4cb('0x25')](function(_0x1b5bd1){return _0x1b5bd1;});}return null;};}function removeEntity(_0x59f25f,_0x59221e){return function(_0x5be89e){if(_0x5be89e){return _0x5be89e[_0xd4cb('0x26')]()[_0xd4cb('0x25')](function(){var _0x18d283=_0x5be89e[_0xd4cb('0x27')]({'plain':!![]});var _0x4275cc=_0xd4cb('0x28');return db[_0xd4cb('0x29')][_0xd4cb('0x26')]({'where':{'type':_0x4275cc,'resourceId':_0x18d283['id']}})[_0xd4cb('0x25')](function(){return _0x5be89e;});})[_0xd4cb('0x25')](function(){_0x59f25f[_0xd4cb('0x1b')](0xcc)[_0xd4cb('0x1c')]();});}};}function handleEntityNotFound(_0x107903,_0x2433fc){return function(_0x2e24ed){if(!_0x2e24ed){_0x107903[_0xd4cb('0x1a')](0x194);}return _0x2e24ed;};}function handleError(_0x26d53e,_0x22e471){_0x22e471=_0x22e471||0x1f4;return function(_0x4a992e){logger[_0xd4cb('0x2a')](_0x4a992e[_0xd4cb('0x2b')]);if(_0x4a992e['name']){delete _0x4a992e['name'];}_0x26d53e[_0xd4cb('0x1b')](_0x22e471)[_0xd4cb('0x2c')](_0x4a992e);};}exports[_0xd4cb('0x2d')]=function(_0x720774,_0xb2951e){var _0x2c10c4={},_0x171e41={},_0xd9bff0={'count':0x0,'rows':[]};var _0x4e86bf=db[_0xd4cb('0x2e')][_0xd4cb('0x2f')];_0x171e41[_0xd4cb('0x30')]=_[_0xd4cb('0x31')](_0x4e86bf);_0x171e41[_0xd4cb('0x32')]=_['keys'](_0x720774[_0xd4cb('0x32')]);_0x171e41[_0xd4cb('0x33')]=_[_0xd4cb('0x34')](_0x171e41[_0xd4cb('0x30')],_0x171e41[_0xd4cb('0x32')]);_0x2c10c4['attributes']=_[_0xd4cb('0x34')](_0x171e41['model'],qs[_0xd4cb('0x35')](_0x720774[_0xd4cb('0x32')][_0xd4cb('0x35')]));_0x2c10c4[_0xd4cb('0x36')]=_0x2c10c4[_0xd4cb('0x36')][_0xd4cb('0x37')]?_0x2c10c4[_0xd4cb('0x36')]:_0x171e41[_0xd4cb('0x30')];if(!_0x720774[_0xd4cb('0x32')]['hasOwnProperty']('nolimit')){_0x2c10c4[_0xd4cb('0x20')]=qs[_0xd4cb('0x20')](_0x720774[_0xd4cb('0x32')]['limit']);_0x2c10c4[_0xd4cb('0x1f')]=qs['offset'](_0x720774[_0xd4cb('0x32')][_0xd4cb('0x1f')]);}_0x2c10c4[_0xd4cb('0x38')]=qs[_0xd4cb('0x39')](_0x720774[_0xd4cb('0x32')][_0xd4cb('0x39')]);_0x2c10c4[_0xd4cb('0x3a')]=qs[_0xd4cb('0x33')](_[_0xd4cb('0x3b')](_0x720774[_0xd4cb('0x32')],_0x171e41[_0xd4cb('0x33')]));if(_0x720774[_0xd4cb('0x32')][_0xd4cb('0x3c')]){_0x2c10c4['where']=_['merge'](_0x2c10c4[_0xd4cb('0x3a')],{'$or':_[_0xd4cb('0x3d')](_0x4e86bf,function(_0x62f8ca){if(_0x62f8ca[_0xd4cb('0x3e')][_0xd4cb('0x3f')]!==_0xd4cb('0x40')){var _0x5540c3={};_0x5540c3[_0x62f8ca[_0xd4cb('0x41')]]={'$like':'%'+_0x720774['query'][_0xd4cb('0x3c')]+'%'};return _0x5540c3;}})});}_0x2c10c4=_[_0xd4cb('0x42')]({},_0x2c10c4,_0x720774['options']);var _0x324b81={'where':_0x2c10c4[_0xd4cb('0x3a')]};return db['VoiceChanSpy'][_0xd4cb('0x1e')](_0x324b81)[_0xd4cb('0x25')](function(_0x2ff096){_0xd9bff0[_0xd4cb('0x1e')]=_0x2ff096;if(_0x720774[_0xd4cb('0x32')][_0xd4cb('0x43')]){_0x2c10c4[_0xd4cb('0x44')]=[{'all':!![]}];}return db[_0xd4cb('0x2e')][_0xd4cb('0x45')](_0x2c10c4);})[_0xd4cb('0x25')](function(_0x55d3df){_0xd9bff0['rows']=_0x55d3df;return _0xd9bff0;})['then'](respondWithFilteredResult(_0xb2951e,_0x2c10c4))[_0xd4cb('0x46')](handleError(_0xb2951e,null));};exports['show']=function(_0x3b4d21,_0x296609){var _0x39c419={'raw':![],'where':{'id':_0x3b4d21[_0xd4cb('0x47')]['id']}},_0x51f30b={};_0x51f30b['model']=_[_0xd4cb('0x31')](db['VoiceChanSpy']['rawAttributes']);_0x51f30b[_0xd4cb('0x32')]=_[_0xd4cb('0x31')](_0x3b4d21[_0xd4cb('0x32')]);_0x51f30b[_0xd4cb('0x33')]=_[_0xd4cb('0x34')](_0x51f30b[_0xd4cb('0x30')],_0x51f30b['query']);_0x39c419[_0xd4cb('0x36')]=_[_0xd4cb('0x34')](_0x51f30b[_0xd4cb('0x30')],qs['fields'](_0x3b4d21[_0xd4cb('0x32')][_0xd4cb('0x35')]));_0x39c419[_0xd4cb('0x36')]=_0x39c419[_0xd4cb('0x36')][_0xd4cb('0x37')]?_0x39c419[_0xd4cb('0x36')]:_0x51f30b['model'];if(_0x3b4d21['query']['includeAll']){_0x39c419['include']=[{'all':!![]}];}_0x39c419=_[_0xd4cb('0x42')]({},_0x39c419,_0x3b4d21[_0xd4cb('0x48')]);return db[_0xd4cb('0x2e')][_0xd4cb('0x49')](_0x39c419)[_0xd4cb('0x25')](handleEntityNotFound(_0x296609,null))[_0xd4cb('0x25')](respondWithResult(_0x296609,null))[_0xd4cb('0x46')](handleError(_0x296609,null));};exports[_0xd4cb('0x4a')]=function(_0x33683b,_0x1f154b){return db[_0xd4cb('0x2e')][_0xd4cb('0x4a')](_0x33683b[_0xd4cb('0x4b')],{})['then'](function(_0x244fed){var _0x2ee13f=_0x33683b['user'][_0xd4cb('0x27')]({'plain':!![]});if(!_0x2ee13f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ee13f[_0xd4cb('0x4c')]===_0xd4cb('0x4d')){var _0x4f3688=_0x244fed[_0xd4cb('0x27')]({'plain':!![]});var _0xc561b1=_0xd4cb('0x28');return db[_0xd4cb('0x4e')]['find']({'where':{'name':_0xc561b1,'userProfileId':_0x2ee13f[_0xd4cb('0x4f')]},'raw':!![]})['then'](function(_0x3128eb){if(_0x3128eb&&_0x3128eb[_0xd4cb('0x50')]===0x0){return db[_0xd4cb('0x29')][_0xd4cb('0x4a')]({'name':_0x4f3688[_0xd4cb('0x51')],'resourceId':_0x4f3688['id'],'type':_0x3128eb[_0xd4cb('0x51')],'sectionId':_0x3128eb['id']},{})[_0xd4cb('0x25')](function(){return _0x244fed;});}else{return _0x244fed;}})[_0xd4cb('0x46')](function(_0x126e93){logger[_0xd4cb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x126e93);throw _0x126e93;});}return _0x244fed;})[_0xd4cb('0x25')](respondWithResult(_0x1f154b,0xc9))[_0xd4cb('0x46')](handleError(_0x1f154b,null));};exports['update']=function(_0x64fb02,_0x49bd3b){if(_0x64fb02[_0xd4cb('0x4b')]['id']){delete _0x64fb02[_0xd4cb('0x4b')]['id'];}return db[_0xd4cb('0x2e')][_0xd4cb('0x49')]({'where':{'id':_0x64fb02[_0xd4cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x49bd3b,null))['then'](saveUpdates(_0x64fb02[_0xd4cb('0x4b')],null))[_0xd4cb('0x25')](respondWithResult(_0x49bd3b,null))[_0xd4cb('0x46')](handleError(_0x49bd3b,null));};exports[_0xd4cb('0x26')]=function(_0x38382f,_0xdf670b){return db[_0xd4cb('0x2e')][_0xd4cb('0x49')]({'where':{'id':_0x38382f[_0xd4cb('0x47')]['id']}})[_0xd4cb('0x25')](handleEntityNotFound(_0xdf670b,null))[_0xd4cb('0x25')](removeEntity(_0xdf670b,null))[_0xd4cb('0x46')](handleError(_0xdf670b,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 10866d7..39f57e4 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 _0xf268=['from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','record','StopMixMonitor','length','concat','User','findAll','name','internal','agent','then','catch','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','util','./voiceChanSpy.attributes'];(function(_0x421196,_0x1cbd94){var _0x2738af=function(_0xc956ff){while(--_0xc956ff){_0x421196['push'](_0x421196['shift']());}};_0x2738af(++_0x1cbd94);}(_0xf268,0x11e));var _0x8f26=function(_0x423c77,_0x468893){_0x423c77=_0x423c77-0x0;var _0x709302=_0xf268[_0x423c77];return _0x709302;};'use strict';var _=require('lodash');var util=require(_0x8f26('0x0'));var BPromise=require('bluebird');var attributes=require(_0x8f26('0x1'));var getUserApplications=function(_0x102e57,_0x353404,_0x112283){var _0x19f2ec=0x1;var _0x416908=[];var _0x5e32c8={'context':_0x353404['context']||_0x8f26('0x2'),'exten':util[_0x8f26('0x3')](_0x8f26('0x4'),_0x102e57[_0x8f26('0x5')],_0x112283),'type':_0x8f26('0x6'),'isApp':![],'ChanSpyId':_0x102e57['id'],'UserId':_0x353404['id']};_0x416908[_0x8f26('0x7')](_[_0x8f26('0x8')]({'app':'Set','appdata':util['format'](_0x8f26('0x9'),'chanspy'),'priority':_0x19f2ec++},_0x5e32c8));if(_0x102e57['record']){_0x416908[_0x8f26('0x7')](_[_0x8f26('0x8')]({'app':_0x8f26('0xa'),'appdata':util[_0x8f26('0x3')](_0x8f26('0xb'),_0x102e57[_0x8f26('0xc')]),'priority':_0x19f2ec++},_0x5e32c8));}if(_0x102e57[_0x8f26('0xd')]){_0x416908[_0x8f26('0x7')](_[_0x8f26('0x8')]({'app':_0x8f26('0xe'),'appdata':_0x102e57['password'],'priority':_0x19f2ec++},_0x5e32c8));}_0x416908['push'](_[_0x8f26('0x8')]({'app':_0x8f26('0xf'),'appdata':util[_0x8f26('0x3')](_0x8f26('0x10'),_0x353404['name'],_0x102e57[_0x8f26('0x11')]?_0x102e57[_0x8f26('0x11')][_0x8f26('0x12')](''):''),'priority':_0x19f2ec++},_0x5e32c8));if(_0x102e57[_0x8f26('0x13')]){_0x416908[_0x8f26('0x7')](_['merge']({'app':_0x8f26('0x14'),'priority':_0x19f2ec++},_0x5e32c8));}return _0x416908;};var getChanSpyApplications=function(_0x51d02a,_0x59023e){var _0x333059=[];for(var _0x3666f1=0x0,_0x49ed9d=0x1;_0x3666f1<_0x59023e[_0x8f26('0x15')];_0x3666f1++,_0x49ed9d=0x1){_0x333059=_0x333059[_0x8f26('0x16')](getUserApplications(_0x51d02a,_0x59023e[_0x3666f1],_0x59023e[_0x3666f1]['internal']));if(_0x59023e[_0x3666f1]['internal']!=_0x59023e[_0x3666f1]['name']){_0x333059=_0x333059[_0x8f26('0x16')](getUserApplications(_0x51d02a,_0x59023e[_0x3666f1],_0x59023e[_0x3666f1]['name']));}}return _0x333059;};var getChanSpyPromise=function(_0x45c23f,_0x40f313){return new BPromise(function(_0x3703c4,_0x44c359){return _0x45c23f[_0x8f26('0x17')][_0x8f26('0x18')]({'attributes':['id',_0x8f26('0x19'),_0x8f26('0x1a')],'where':{'role':_0x8f26('0x1b'),'chanspy':!![]},'raw':!![]})[_0x8f26('0x1c')](function(_0x236080){if(_0x236080){return _0x3703c4(getChanSpyApplications(_0x40f313,_0x236080));}return _0x3703c4([]);})[_0x8f26('0x1d')](function(_0xe76a88){_0x44c359(_0xe76a88);});});};module['exports']=function(_0x56da33,_0xce205f){var _0x40b482=_0x56da33[_0x8f26('0x1e')];return _0x56da33[_0x8f26('0x1f')](_0x8f26('0x20'),attributes,{'tableName':_0x8f26('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x6da3e2,_0x50900b,_0x5470fe){return getChanSpyPromise(_0x40b482,_0x6da3e2)[_0x8f26('0x1c')](function(_0x49c681){if(_0x49c681&&_0x49c681[_0x8f26('0x15')]){return _0x40b482[_0x8f26('0x22')]['bulkCreate'](_0x49c681);}})[_0x8f26('0x1c')](function(){_0x5470fe();})[_0x8f26('0x1d')](function(_0x4d90a0){_0x5470fe(_0x4d90a0);});},'afterUpdate':function(_0x155049,_0x54b00e,_0x50a1f3){return _0x40b482['VoiceExtension'][_0x8f26('0x23')]({'where':{'ChanSpyId':_0x155049['id']}})['then'](function(){return getChanSpyPromise(_0x40b482,_0x155049);})['then'](function(_0x4a7b39){if(_0x4a7b39&&_0x4a7b39[_0x8f26('0x15')]){return _0x40b482['VoiceExtension']['bulkCreate'](_0x4a7b39);}})[_0x8f26('0x1c')](function(){_0x50a1f3();})['catch'](function(_0xfb260f){_0x50a1f3(_0xfb260f);});},'afterDestroy':function(_0x1296a5,_0x7060c4,_0x264d5f){return _0x40b482[_0x8f26('0x22')]['destroy']({'where':{'ChanSpyId':_0x1296a5['id']}})[_0x8f26('0x1c')](function(){_0x264d5f();})['catch'](function(_0x9a159d){_0x264d5f(_0x9a159d);});}}});}; \ No newline at end of file +var _0xc805=['bluebird','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','merge','Set','format','CDR(type)=%s','push','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','record','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash'];(function(_0x59b24d,_0x4debc7){var _0x1da612=function(_0x407752){while(--_0x407752){_0x59b24d['push'](_0x59b24d['shift']());}};_0x1da612(++_0x4debc7);}(_0xc805,0x171));var _0x5c80=function(_0x531b74,_0x3a473b){_0x531b74=_0x531b74-0x0;var _0x513d17=_0xc805[_0x531b74];return _0x513d17;};'use strict';var _=require(_0x5c80('0x0'));var util=require('util');var BPromise=require(_0x5c80('0x1'));var attributes=require(_0x5c80('0x2'));var getUserApplications=function(_0x3767f4,_0x116744,_0x222706){var _0x516604=0x1;var _0xc535db=[];var _0xcc02b3={'context':_0x116744['context']||_0x5c80('0x3'),'exten':util['format'](_0x5c80('0x4'),_0x3767f4[_0x5c80('0x5')],_0x222706),'type':_0x5c80('0x6'),'isApp':![],'ChanSpyId':_0x3767f4['id'],'UserId':_0x116744['id']};_0xc535db['push'](_[_0x5c80('0x7')]({'app':_0x5c80('0x8'),'appdata':util[_0x5c80('0x9')](_0x5c80('0xa'),'chanspy'),'priority':_0x516604++},_0xcc02b3));if(_0x3767f4['record']){_0xc535db[_0x5c80('0xb')](_[_0x5c80('0x7')]({'app':'MixMonitor','appdata':util[_0x5c80('0x9')](_0x5c80('0xc'),_0x3767f4[_0x5c80('0xd')]),'priority':_0x516604++},_0xcc02b3));}if(_0x3767f4[_0x5c80('0xe')]){_0xc535db['push'](_[_0x5c80('0x7')]({'app':_0x5c80('0xf'),'appdata':_0x3767f4['password'],'priority':_0x516604++},_0xcc02b3));}_0xc535db[_0x5c80('0xb')](_[_0x5c80('0x7')]({'app':_0x5c80('0x10'),'appdata':util[_0x5c80('0x9')](_0x5c80('0x11'),_0x116744[_0x5c80('0x12')],_0x3767f4[_0x5c80('0x13')]?_0x3767f4['options']['join'](''):''),'priority':_0x516604++},_0xcc02b3));if(_0x3767f4[_0x5c80('0x14')]){_0xc535db[_0x5c80('0xb')](_[_0x5c80('0x7')]({'app':_0x5c80('0x15'),'priority':_0x516604++},_0xcc02b3));}return _0xc535db;};var getChanSpyApplications=function(_0x86f337,_0x4c943b){var _0x1d42f7=[];for(var _0x164726=0x0,_0xe36edd=0x1;_0x164726<_0x4c943b[_0x5c80('0x16')];_0x164726++,_0xe36edd=0x1){_0x1d42f7=_0x1d42f7[_0x5c80('0x17')](getUserApplications(_0x86f337,_0x4c943b[_0x164726],_0x4c943b[_0x164726][_0x5c80('0x18')]));if(_0x4c943b[_0x164726][_0x5c80('0x18')]!=_0x4c943b[_0x164726][_0x5c80('0x12')]){_0x1d42f7=_0x1d42f7[_0x5c80('0x17')](getUserApplications(_0x86f337,_0x4c943b[_0x164726],_0x4c943b[_0x164726][_0x5c80('0x12')]));}}return _0x1d42f7;};var getChanSpyPromise=function(_0x3338d5,_0x18a225){return new BPromise(function(_0x38e3ee,_0x4e2447){return _0x3338d5[_0x5c80('0x19')][_0x5c80('0x1a')]({'attributes':['id',_0x5c80('0x12'),_0x5c80('0x18')],'where':{'role':_0x5c80('0x1b'),'chanspy':!![]},'raw':!![]})[_0x5c80('0x1c')](function(_0x4c1147){if(_0x4c1147){return _0x38e3ee(getChanSpyApplications(_0x18a225,_0x4c1147));}return _0x38e3ee([]);})[_0x5c80('0x1d')](function(_0x4f1dba){_0x4e2447(_0x4f1dba);});});};module[_0x5c80('0x1e')]=function(_0x3b1585,_0x1a9fdb){var _0x4b305a=_0x3b1585['models'];return _0x3b1585[_0x5c80('0x1f')](_0x5c80('0x20'),attributes,{'tableName':_0x5c80('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x33f83c,_0x31cf79,_0x28981b){return getChanSpyPromise(_0x4b305a,_0x33f83c)['then'](function(_0x5ae145){if(_0x5ae145&&_0x5ae145[_0x5c80('0x16')]){return _0x4b305a[_0x5c80('0x22')][_0x5c80('0x23')](_0x5ae145);}})[_0x5c80('0x1c')](function(){_0x28981b();})[_0x5c80('0x1d')](function(_0x5aa162){_0x28981b(_0x5aa162);});},'afterUpdate':function(_0x4e0fb3,_0x9519c3,_0x3778da){return _0x4b305a['VoiceExtension'][_0x5c80('0x24')]({'where':{'ChanSpyId':_0x4e0fb3['id']}})[_0x5c80('0x1c')](function(){return getChanSpyPromise(_0x4b305a,_0x4e0fb3);})[_0x5c80('0x1c')](function(_0x1bf8a6){if(_0x1bf8a6&&_0x1bf8a6[_0x5c80('0x16')]){return _0x4b305a[_0x5c80('0x22')][_0x5c80('0x23')](_0x1bf8a6);}})[_0x5c80('0x1c')](function(){_0x3778da();})[_0x5c80('0x1d')](function(_0x446527){_0x3778da(_0x446527);});},'afterDestroy':function(_0x2c6380,_0x347986,_0x2bcccc){return _0x4b305a['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x2c6380['id']}})[_0x5c80('0x1c')](function(){_0x2bcccc();})[_0x5c80('0x1d')](function(_0x536a20){_0x2bcccc(_0x536a20);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index cbbb7c4..5e61216 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 _0x00ad=['code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x8dc6eb,_0x3de0f6){var _0x247729=function(_0x2d33f2){while(--_0x2d33f2){_0x8dc6eb['push'](_0x8dc6eb['shift']());}};_0x247729(++_0x3de0f6);}(_0x00ad,0x65));var _0xd00a=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x00ad[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0xd00a('0x0'));var util=require(_0xd00a('0x1'));var moment=require('moment');var BPromise=require(_0xd00a('0x2'));var rs=require(_0xd00a('0x3'));var fs=require('fs');var Redis=require(_0xd00a('0x4'));var db=require(_0xd00a('0x5'))['db'];var utils=require(_0xd00a('0x6'));var logger=require('../../config/logger')(_0xd00a('0x7'));var config=require(_0xd00a('0x8'));var jayson=require(_0xd00a('0x9'));var client=jayson['client'][_0xd00a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x885f6b,_0x2b980f,_0x5afe02){return new BPromise(function(_0xee48fa,_0x1d1b2c){return client[_0xd00a('0xb')](_0x885f6b,_0x5afe02)[_0xd00a('0xc')](function(_0x278643){logger[_0xd00a('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x2b980f,'request\x20sent');logger[_0xd00a('0xe')](_0xd00a('0xf'),_0x2b980f,_0xd00a('0x10'),JSON[_0xd00a('0x11')](_0x278643));if(_0x278643[_0xd00a('0x12')]){if(_0x278643[_0xd00a('0x12')][_0xd00a('0x13')]===0x1f4){logger[_0xd00a('0x12')](_0xd00a('0x14'),_0x2b980f,_0x278643[_0xd00a('0x12')]['message']);return _0x1d1b2c(_0x278643[_0xd00a('0x12')][_0xd00a('0x15')]);}logger[_0xd00a('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x2b980f,_0x278643[_0xd00a('0x12')][_0xd00a('0x15')]);return _0xee48fa(_0x278643[_0xd00a('0x12')][_0xd00a('0x15')]);}else{logger[_0xd00a('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x2b980f,_0xd00a('0x10'));_0xee48fa(_0x278643[_0xd00a('0x16')][_0xd00a('0x15')]);}})[_0xd00a('0x17')](function(_0x5e1401){logger[_0xd00a('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x2b980f,_0x5e1401);_0x1d1b2c(_0x5e1401);});});} \ No newline at end of file +var _0x7341=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x1a265f,_0x30b296){var _0x13a6ac=function(_0x10c4ce){while(--_0x10c4ce){_0x1a265f['push'](_0x1a265f['shift']());}};_0x13a6ac(++_0x30b296);}(_0x7341,0xe4));var _0x1734=function(_0x2459a6,_0x3b270b){_0x2459a6=_0x2459a6-0x0;var _0x16d459=_0x7341[_0x2459a6];return _0x16d459;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1734('0x0'));var BPromise=require('bluebird');var rs=require(_0x1734('0x1'));var fs=require('fs');var Redis=require(_0x1734('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x1734('0x3'));var logger=require(_0x1734('0x4'))(_0x1734('0x5'));var config=require(_0x1734('0x6'));var jayson=require(_0x1734('0x7'));var client=jayson[_0x1734('0x8')][_0x1734('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c7349,_0x1ca30b,_0x2c223d){return new BPromise(function(_0x45c529,_0x5b8977){return client[_0x1734('0xa')](_0x4c7349,_0x2c223d)['then'](function(_0x56f0d5){logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));logger[_0x1734('0xe')](_0x1734('0xf'),_0x1ca30b,_0x1734('0xd'),JSON[_0x1734('0x10')](_0x56f0d5));if(_0x56f0d5[_0x1734('0x11')]){if(_0x56f0d5[_0x1734('0x11')][_0x1734('0x12')]===0x1f4){logger['error'](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x5b8977(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}logger[_0x1734('0x11')](_0x1734('0xc'),_0x1ca30b,_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);return _0x45c529(_0x56f0d5[_0x1734('0x11')][_0x1734('0x13')]);}else{logger[_0x1734('0xb')](_0x1734('0xc'),_0x1ca30b,_0x1734('0xd'));_0x45c529(_0x56f0d5[_0x1734('0x14')][_0x1734('0x13')]);}})[_0x1734('0x15')](function(_0x1ea188){logger[_0x1734('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x1ca30b,_0x1ea188);_0x5b8977(_0x1ea188);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4b09b55..944506d 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 _0xc0d7=['/:id','show','create','put','update','delete','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x12fff4,_0x58d6e4){var _0x30aaf4=function(_0xf8e818){while(--_0xf8e818){_0x12fff4['push'](_0x12fff4['shift']());}};_0x30aaf4(++_0x58d6e4);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x4299ab,_0x885d8){_0x4299ab=_0x4299ab-0x0;var _0x9492f6=_0xc0d7[_0x4299ab];return _0x9492f6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c0d('0x0'));var express=require(_0x7c0d('0x1'));var router=express[_0x7c0d('0x2')]();var auth=require(_0x7c0d('0x3'));var interaction=require(_0x7c0d('0x4'));var config=require(_0x7c0d('0x5'));var controller=require(_0x7c0d('0x6'));router[_0x7c0d('0x7')]('/',auth[_0x7c0d('0x8')](),controller['index']);router[_0x7c0d('0x7')](_0x7c0d('0x9'),auth[_0x7c0d('0x8')](),controller[_0x7c0d('0xa')]);router['post']('/',auth[_0x7c0d('0x8')](),controller[_0x7c0d('0xb')]);router[_0x7c0d('0xc')](_0x7c0d('0x9'),auth['isAuthenticated'](),controller[_0x7c0d('0xd')]);router[_0x7c0d('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7c0d('0xf')]);module[_0x7c0d('0x10')]=router; \ No newline at end of file +var _0xdf5d=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x50077e,_0x4e3100){var _0x3fbe80=function(_0x5a6541){while(--_0x5a6541){_0x50077e['push'](_0x50077e['shift']());}};_0x3fbe80(++_0x4e3100);}(_0xdf5d,0x126));var _0xddf5=function(_0x4776cf,_0x354d03){_0x4776cf=_0x4776cf-0x0;var _0x197de4=_0xdf5d[_0x4776cf];return _0x197de4;};'use strict';var multer=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var path=require(_0xddf5('0x2'));var timeout=require(_0xddf5('0x3'));var express=require(_0xddf5('0x4'));var router=express[_0xddf5('0x5')]();var auth=require(_0xddf5('0x6'));var interaction=require(_0xddf5('0x7'));var config=require('../../config/environment');var controller=require(_0xddf5('0x8'));router[_0xddf5('0x9')]('/',auth[_0xddf5('0xa')](),controller[_0xddf5('0xb')]);router[_0xddf5('0x9')](_0xddf5('0xc'),auth[_0xddf5('0xa')](),controller[_0xddf5('0xd')]);router[_0xddf5('0xe')]('/',auth[_0xddf5('0xa')](),controller[_0xddf5('0xf')]);router[_0xddf5('0x10')](_0xddf5('0xc'),auth[_0xddf5('0xa')](),controller[_0xddf5('0x11')]);router[_0xddf5('0x12')]('/:id',auth[_0xddf5('0xa')](),controller[_0xddf5('0x13')]);module[_0xddf5('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 6f7cb8b..7f0d88e 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 _0x68f8=['STRING','BOOLEAN','name'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x68f8,0x19d));var _0x868f=function(_0x160c9e,_0x42a025){_0x160c9e=_0x160c9e-0x0;var _0x32f7fc=_0x68f8[_0x160c9e];return _0x32f7fc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x868f('0x0')},'description':{'type':Sequelize[_0x868f('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x868f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x372d=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x358413,_0x35fd8f){var _0x1faeed=function(_0x283063){while(--_0x283063){_0x358413['push'](_0x358413['shift']());}};_0x1faeed(++_0x35fd8f);}(_0x372d,0x15e));var _0xd372=function(_0x260aaa,_0x172c23){_0x260aaa=_0x260aaa-0x0;var _0xc3f81d=_0x372d[_0x260aaa];return _0xc3f81d;};'use strict';var Sequelize=require(_0xd372('0x0'));module[_0xd372('0x1')]={'name':{'type':Sequelize[_0xd372('0x2')],'unique':_0xd372('0x3')},'description':{'type':Sequelize[_0xd372('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd372('0x4')],'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 c9af3d5..850bf13 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 _0x55da=['name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','Reload','chan_sip.so','readFileSync','/etc/asterisk/extensions_xcally_contexts.conf','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','save','update','destroy','UserProfileResource','stack','send','index','VoiceContext','rawAttributes','model','keys','query','intersection','fields','attributes','nolimit','sort','filters','pick','filter','where','merge','map','type','key','VIRTUAL','field','options','count','includeAll','include','findAll','rows','show','params','length','find','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation'];(function(_0x571c29,_0x2f8e4a){var _0x5765b4=function(_0x1c18b8){while(--_0x1c18b8){_0x571c29['push'](_0x571c29['shift']());}};_0x5765b4(++_0x2f8e4a);}(_0x55da,0x13c));var _0xa55d=function(_0x55ce83,_0x25758e){_0x55ce83=_0x55ce83-0x0;var _0x43a7cc=_0x55da[_0x55ce83];return _0x43a7cc;};'use strict';var pdf=require(_0xa55d('0x0'));var emlformat=require(_0xa55d('0x1'));var rimraf=require(_0xa55d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa55d('0x3'));var rp=require(_0xa55d('0x4'));var moment=require(_0xa55d('0x5'));var BPromise=require(_0xa55d('0x6'));var Mustache=require(_0xa55d('0x7'));var util=require('util');var path=require(_0xa55d('0x8'));var sox=require(_0xa55d('0x9'));var csv=require(_0xa55d('0xa'));var ejs=require(_0xa55d('0xb'));var fs=require('fs');var _=require(_0xa55d('0xc'));var squel=require(_0xa55d('0xd'));var crypto=require(_0xa55d('0xe'));var jsforce=require(_0xa55d('0xf'));var deskjs=require(_0xa55d('0x10'));var toCsv=require(_0xa55d('0xa'));var querystring=require(_0xa55d('0x11'));var Papa=require(_0xa55d('0x12'));var Redis=require(_0xa55d('0x13'));var authService=require(_0xa55d('0x14'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xa55d('0x15'));var logger=require('../../config/logger')(_0xa55d('0x16'));var utils=require(_0xa55d('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xa55d('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2387df,_0xcc9be8,_0xee04dd){if(_0xee04dd){var _0x479ac7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x479ac7[_0xa55d('0x19')](_0xcc9be8)){return _0x2387df;}else{throw new Error(_0xa55d('0x1a'));}}else{return _0x2387df;}}function respondWithRpcPromise(_0x3fe45e,_0x2b6e14,_0x49ad1f,_0x110504){return new BPromise(function(_0x158142,_0xdb2b07){var _0x5e3189=_0x110504||client;return _0x5e3189['request'](_0x3fe45e,_0x49ad1f)[_0xa55d('0x1b')](function(_0x1eb3e8){logger[_0xa55d('0x1c')](_0xa55d('0x1d'),_0x2b6e14,_0xa55d('0x1e'));logger[_0xa55d('0x1f')](_0xa55d('0x20'),_0x2b6e14,_0xa55d('0x1e'),JSON[_0xa55d('0x21')](_0x1eb3e8));if(_0x1eb3e8['error']){if(_0x1eb3e8[_0xa55d('0x22')][_0xa55d('0x23')]===0x1f4){logger[_0xa55d('0x22')](_0xa55d('0x1d'),_0x2b6e14,_0x1eb3e8[_0xa55d('0x22')][_0xa55d('0x24')]);return _0xdb2b07(_0x1eb3e8[_0xa55d('0x22')]['message']);}logger[_0xa55d('0x22')](_0xa55d('0x1d'),_0x2b6e14,_0x1eb3e8['error'][_0xa55d('0x24')]);return _0x158142(_0x1eb3e8[_0xa55d('0x22')][_0xa55d('0x24')]);}else{logger[_0xa55d('0x1c')](_0xa55d('0x1d'),_0x2b6e14,_0xa55d('0x1e'));_0x158142(_0x1eb3e8['result'][_0xa55d('0x24')]);}})[_0xa55d('0x25')](function(_0x37cd8b){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2b6e14,_0x37cd8b);_0xdb2b07(_0x37cd8b);});});}function respondWithStatusCode(_0x18df3b,_0x5d40bd){_0x5d40bd=_0x5d40bd||0xcc;return function(_0x91741f){if(_0x91741f){return _0x18df3b[_0xa55d('0x26')](_0x5d40bd);}return _0x18df3b[_0xa55d('0x27')](_0x5d40bd)[_0xa55d('0x28')]();};}function respondWithResult(_0x25755f,_0xfb4201){_0xfb4201=_0xfb4201||0xc8;return function(_0x24ec0c){if(_0x24ec0c){return _0x25755f[_0xa55d('0x27')](_0xfb4201)['json'](_0x24ec0c);}};}function respondWithFilteredResult(_0x3a5561,_0x105a02){return function(_0x477247){if(_0x477247){var _0x523201=_0x477247['count'],_0x39b8d9=_0x105a02[_0xa55d('0x29')],_0x191e1a=_0x105a02[_0xa55d('0x29')]+_0x105a02[_0xa55d('0x2a')],_0x25ea93;if(_0x191e1a>=_0x523201){_0x191e1a=_0x523201;_0x25ea93=0xc8;}else{_0x25ea93=0xce;}_0x3a5561[_0xa55d('0x27')](_0x25ea93);return _0x3a5561[_0xa55d('0x2b')](_0xa55d('0x2c'),_0x39b8d9+'-'+_0x191e1a+'/'+_0x523201)[_0xa55d('0x2d')](_0x477247);}return null;};}function patchUpdates(_0x1eecf3){return function(_0x3d3486){try{jsonpatch['apply'](_0x3d3486,_0x1eecf3,!![]);}catch(_0x36a924){return BPromise['reject'](_0x36a924);}return _0x3d3486[_0xa55d('0x2e')]();};}function saveUpdates(_0x462171,_0x4ff396){return function(_0x226a8a){if(_0x226a8a){return _0x226a8a[_0xa55d('0x2f')](_0x462171)[_0xa55d('0x1b')](function(_0x416730){return _0x416730;});}return null;};}function removeEntity(_0x12f324,_0x1516b5){return function(_0x3e4f54){if(_0x3e4f54){return _0x3e4f54[_0xa55d('0x30')]()['then'](function(){var _0x19aa3d=_0x3e4f54['get']({'plain':!![]});var _0x2813ff='Contexts';return db[_0xa55d('0x31')][_0xa55d('0x30')]({'where':{'type':_0x2813ff,'resourceId':_0x19aa3d['id']}})[_0xa55d('0x1b')](function(){return _0x3e4f54;});})[_0xa55d('0x1b')](function(){_0x12f324['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e5b27,_0x33e522){return function(_0x45ca8d){if(!_0x45ca8d){_0x5e5b27[_0xa55d('0x26')](0x194);}return _0x45ca8d;};}function handleError(_0xeae120,_0x27ca69){_0x27ca69=_0x27ca69||0x1f4;return function(_0xe187ea){logger[_0xa55d('0x22')](_0xe187ea[_0xa55d('0x32')]);if(_0xe187ea['name']){delete _0xe187ea['name'];}_0xeae120[_0xa55d('0x27')](_0x27ca69)[_0xa55d('0x33')](_0xe187ea);};}exports[_0xa55d('0x34')]=function(_0x43dd8f,_0x33310d){var _0x335637={},_0x15c3ca={},_0x2b9885={'count':0x0,'rows':[]};var _0x4de9a0=db[_0xa55d('0x35')][_0xa55d('0x36')];_0x15c3ca[_0xa55d('0x37')]=_[_0xa55d('0x38')](_0x4de9a0);_0x15c3ca[_0xa55d('0x39')]=_[_0xa55d('0x38')](_0x43dd8f[_0xa55d('0x39')]);_0x15c3ca['filters']=_[_0xa55d('0x3a')](_0x15c3ca['model'],_0x15c3ca[_0xa55d('0x39')]);_0x335637['attributes']=_[_0xa55d('0x3a')](_0x15c3ca[_0xa55d('0x37')],qs[_0xa55d('0x3b')](_0x43dd8f['query'][_0xa55d('0x3b')]));_0x335637[_0xa55d('0x3c')]=_0x335637[_0xa55d('0x3c')]['length']?_0x335637[_0xa55d('0x3c')]:_0x15c3ca[_0xa55d('0x37')];if(!_0x43dd8f[_0xa55d('0x39')]['hasOwnProperty'](_0xa55d('0x3d'))){_0x335637[_0xa55d('0x2a')]=qs[_0xa55d('0x2a')](_0x43dd8f[_0xa55d('0x39')][_0xa55d('0x2a')]);_0x335637['offset']=qs[_0xa55d('0x29')](_0x43dd8f[_0xa55d('0x39')][_0xa55d('0x29')]);}_0x335637['order']=qs['sort'](_0x43dd8f[_0xa55d('0x39')][_0xa55d('0x3e')]);_0x335637['where']=qs[_0xa55d('0x3f')](_[_0xa55d('0x40')](_0x43dd8f[_0xa55d('0x39')],_0x15c3ca[_0xa55d('0x3f')]));if(_0x43dd8f[_0xa55d('0x39')][_0xa55d('0x41')]){_0x335637[_0xa55d('0x42')]=_[_0xa55d('0x43')](_0x335637[_0xa55d('0x42')],{'$or':_[_0xa55d('0x44')](_0x4de9a0,function(_0x44b21f){if(_0x44b21f[_0xa55d('0x45')][_0xa55d('0x46')]!==_0xa55d('0x47')){var _0x3260b8={};_0x3260b8[_0x44b21f[_0xa55d('0x48')]]={'$like':'%'+_0x43dd8f[_0xa55d('0x39')]['filter']+'%'};return _0x3260b8;}})});}_0x335637=_[_0xa55d('0x43')]({},_0x335637,_0x43dd8f[_0xa55d('0x49')]);var _0x4fdd7e={'where':_0x335637[_0xa55d('0x42')]};return db[_0xa55d('0x35')][_0xa55d('0x4a')](_0x4fdd7e)[_0xa55d('0x1b')](function(_0x3013d3){_0x2b9885['count']=_0x3013d3;if(_0x43dd8f[_0xa55d('0x39')][_0xa55d('0x4b')]){_0x335637[_0xa55d('0x4c')]=[{'all':!![]}];}return db[_0xa55d('0x35')][_0xa55d('0x4d')](_0x335637);})[_0xa55d('0x1b')](function(_0x2fcaea){_0x2b9885[_0xa55d('0x4e')]=_0x2fcaea;return _0x2b9885;})[_0xa55d('0x1b')](respondWithFilteredResult(_0x33310d,_0x335637))[_0xa55d('0x25')](handleError(_0x33310d,null));};exports[_0xa55d('0x4f')]=function(_0xd53bf9,_0x399ddd){var _0x2efd91={'raw':![],'where':{'id':_0xd53bf9[_0xa55d('0x50')]['id']}},_0x5d797b={};_0x5d797b[_0xa55d('0x37')]=_[_0xa55d('0x38')](db[_0xa55d('0x35')][_0xa55d('0x36')]);_0x5d797b[_0xa55d('0x39')]=_[_0xa55d('0x38')](_0xd53bf9['query']);_0x5d797b['filters']=_[_0xa55d('0x3a')](_0x5d797b[_0xa55d('0x37')],_0x5d797b[_0xa55d('0x39')]);_0x2efd91['attributes']=_['intersection'](_0x5d797b[_0xa55d('0x37')],qs[_0xa55d('0x3b')](_0xd53bf9[_0xa55d('0x39')]['fields']));_0x2efd91['attributes']=_0x2efd91[_0xa55d('0x3c')][_0xa55d('0x51')]?_0x2efd91[_0xa55d('0x3c')]:_0x5d797b[_0xa55d('0x37')];if(_0xd53bf9[_0xa55d('0x39')][_0xa55d('0x4b')]){_0x2efd91[_0xa55d('0x4c')]=[{'all':!![]}];}_0x2efd91=_[_0xa55d('0x43')]({},_0x2efd91,_0xd53bf9[_0xa55d('0x49')]);return db['VoiceContext'][_0xa55d('0x52')](_0x2efd91)['then'](handleEntityNotFound(_0x399ddd,null))['then'](respondWithResult(_0x399ddd,null))[_0xa55d('0x25')](handleError(_0x399ddd,null));};exports['create']=function(_0x3acea0,_0x12bff2,_0x3cce82){var _0x42edff;return db[_0xa55d('0x35')][_0xa55d('0x53')](_0x3acea0[_0xa55d('0x54')],{'raw':!![]})[_0xa55d('0x1b')](function(_0x2e1ba6){_0x42edff=_0x2e1ba6;return db[_0xa55d('0x35')]['findAll']({'raw':!![]});})[_0xa55d('0x1b')](function(_0x205cae){var _0x4d79d7=fs['readFileSync'](path[_0xa55d('0x55')](config[_0xa55d('0x56')],_0xa55d('0x57')),'utf8');var _0x2ea6ad=ejs[_0xa55d('0x58')](_0x4d79d7,{'contexts':_0x205cae||[]});fs[_0xa55d('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2ea6ad);})['then'](function(){return respondWithRpcPromise('Reload',_0xa55d('0x53'),{'module':'chan_sip.so'});})[_0xa55d('0x1b')](function(){var _0x122d0c=_0x3acea0[_0xa55d('0x5a')][_0xa55d('0x5b')]({'plain':!![]});if(!_0x122d0c)throw new Error(_0xa55d('0x5c'));if(_0x122d0c[_0xa55d('0x5d')]===_0xa55d('0x5a')){var _0x1bfbda=_0x42edff['get']({'plain':!![]});return db[_0xa55d('0x5e')][_0xa55d('0x52')]({'where':{'name':'Contexts','userProfileId':_0x122d0c['userProfileId']},'raw':!![]})[_0xa55d('0x1b')](function(_0x4aa31b){if(_0x4aa31b&&_0x4aa31b[_0xa55d('0x5f')]===0x0){return db['UserProfileResource'][_0xa55d('0x53')]({'name':_0x1bfbda[_0xa55d('0x60')],'resourceId':_0x1bfbda['id'],'type':_0x4aa31b[_0xa55d('0x60')],'sectionId':_0x4aa31b['id']},{})[_0xa55d('0x1b')](function(){return _0x42edff;});}else{return _0x42edff;}})[_0xa55d('0x25')](function(_0x43410d){logger[_0xa55d('0x22')](_0xa55d('0x61'),_0x43410d);throw _0x43410d;});}return _0x42edff;})[_0xa55d('0x1b')](respondWithResult(_0x12bff2,0xc9))[_0xa55d('0x25')](handleError(_0x12bff2,null));};exports[_0xa55d('0x2f')]=function(_0x2291a8,_0xa20b84,_0x1af106){var _0x581bb9;return db[_0xa55d('0x35')][_0xa55d('0x52')]({'where':{'id':_0x2291a8[_0xa55d('0x50')]['id']}})[_0xa55d('0x1b')](handleEntityNotFound(_0xa20b84,null))[_0xa55d('0x1b')](saveUpdates(_0x2291a8[_0xa55d('0x54')],null))[_0xa55d('0x1b')](function(_0x289057){if(_0x289057){_0x581bb9=_0x289057;return db[_0xa55d('0x35')][_0xa55d('0x4d')]({'raw':!![]});}})['then'](function(_0x451b20){var _0x31a2bc=fs['readFileSync'](path['join'](config[_0xa55d('0x56')],_0xa55d('0x57')),_0xa55d('0x62'));var _0x394817=ejs['render'](_0x31a2bc,{'contexts':_0x451b20||[]});fs[_0xa55d('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x394817);})[_0xa55d('0x1b')](function(){return respondWithRpcPromise(_0xa55d('0x63'),'update',{'module':_0xa55d('0x64')});})[_0xa55d('0x1b')](function(){return _0x581bb9;})[_0xa55d('0x1b')](respondWithResult(_0xa20b84,null))[_0xa55d('0x25')](handleError(_0xa20b84,null));};exports['destroy']=function(_0x567474,_0x1f5cb7,_0xd19c34){var _0x4f8546;return db[_0xa55d('0x35')][_0xa55d('0x52')]({'where':{'id':_0x567474[_0xa55d('0x50')]['id']}})['then'](handleEntityNotFound(_0x1f5cb7,null))['then'](removeEntity(_0x1f5cb7,null))[_0xa55d('0x1b')](function(){return db[_0xa55d('0x35')][_0xa55d('0x4d')]({'raw':!![]});})[_0xa55d('0x1b')](function(_0x35809a){var _0x345123=fs[_0xa55d('0x65')](path[_0xa55d('0x55')](config[_0xa55d('0x56')],_0xa55d('0x57')),_0xa55d('0x62'));var _0x2f0a07=ejs[_0xa55d('0x58')](_0x345123,{'contexts':_0x35809a});fs[_0xa55d('0x59')](_0xa55d('0x66'),_0x2f0a07);return respondWithRpcPromise(_0xa55d('0x63'),_0xa55d('0x30'),{'module':_0xa55d('0x64')});})[_0xa55d('0x25')](handleError(_0x1f5cb7,null));}; \ No newline at end of file +var _0xbbe9=['rawAttributes','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','key','VIRTUAL','field','filter','options','includeAll','include','findAll','rows','show','params','merge','find','create','body','readFileSync','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','chan_sip.so','server/files/templates/context.ejs','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','status','end','json','count','offset','Content-Range','apply','reject','save','destroy','get','Contexts','sendStatus','name','send','index','VoiceContext'];(function(_0x242371,_0xaef678){var _0x364ed9=function(_0x1d67d6){while(--_0x1d67d6){_0x242371['push'](_0x242371['shift']());}};_0x364ed9(++_0xaef678);}(_0xbbe9,0x16b));var _0x9bbe=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xbbe9[_0x1969a7];return _0x3d665f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9bbe('0x0'));var rimraf=require(_0x9bbe('0x1'));var zipdir=require(_0x9bbe('0x2'));var jsonpatch=require(_0x9bbe('0x3'));var rp=require(_0x9bbe('0x4'));var moment=require(_0x9bbe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9bbe('0x6'));var util=require(_0x9bbe('0x7'));var path=require(_0x9bbe('0x8'));var sox=require(_0x9bbe('0x9'));var csv=require('to-csv');var ejs=require(_0x9bbe('0xa'));var fs=require('fs');var _=require(_0x9bbe('0xb'));var squel=require(_0x9bbe('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9bbe('0xd'));var toCsv=require(_0x9bbe('0xe'));var querystring=require(_0x9bbe('0xf'));var Papa=require('papaparse');var Redis=require(_0x9bbe('0x10'));var authService=require(_0x9bbe('0x11'));var qs=require(_0x9bbe('0x12'));var hardwareService=require(_0x9bbe('0x13'));var logger=require(_0x9bbe('0x14'))(_0x9bbe('0x15'));var utils=require('../../config/utils');var config=require(_0x9bbe('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x9bbe('0x17'));var client=jayson[_0x9bbe('0x18')][_0x9bbe('0x19')]({'port':0x232a});function checkPasswordPattern(_0xf2c299,_0x4e293b,_0x21e576){if(_0x21e576){var _0x32290e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32290e[_0x9bbe('0x1a')](_0x4e293b)){return _0xf2c299;}else{throw new Error(_0x9bbe('0x1b'));}}else{return _0xf2c299;}}function respondWithRpcPromise(_0x587096,_0x2b3ab7,_0x203f75,_0x1f2a08){return new BPromise(function(_0x44a417,_0x67af6){var _0x55d3a2=_0x1f2a08||client;return _0x55d3a2[_0x9bbe('0x1c')](_0x587096,_0x203f75)[_0x9bbe('0x1d')](function(_0x31004e){logger[_0x9bbe('0x1e')](_0x9bbe('0x1f'),_0x2b3ab7,'request\x20sent');logger[_0x9bbe('0x20')](_0x9bbe('0x21'),_0x2b3ab7,'request\x20sent',JSON[_0x9bbe('0x22')](_0x31004e));if(_0x31004e[_0x9bbe('0x23')]){if(_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x24')]===0x1f4){logger['error'](_0x9bbe('0x1f'),_0x2b3ab7,_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);return _0x67af6(_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);}logger[_0x9bbe('0x23')]('VoiceContext,\x20%s,\x20%s',_0x2b3ab7,_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);return _0x44a417(_0x31004e[_0x9bbe('0x23')][_0x9bbe('0x25')]);}else{logger[_0x9bbe('0x1e')](_0x9bbe('0x1f'),_0x2b3ab7,_0x9bbe('0x26'));_0x44a417(_0x31004e['result']['message']);}})[_0x9bbe('0x27')](function(_0x25310c){logger[_0x9bbe('0x23')](_0x9bbe('0x1f'),_0x2b3ab7,_0x25310c);_0x67af6(_0x25310c);});});}function respondWithStatusCode(_0x48885d,_0x2fa438){_0x2fa438=_0x2fa438||0xcc;return function(_0x1813f9){if(_0x1813f9){return _0x48885d['sendStatus'](_0x2fa438);}return _0x48885d[_0x9bbe('0x28')](_0x2fa438)[_0x9bbe('0x29')]();};}function respondWithResult(_0x45eb6f,_0x16e9b2){_0x16e9b2=_0x16e9b2||0xc8;return function(_0x5776a2){if(_0x5776a2){return _0x45eb6f['status'](_0x16e9b2)[_0x9bbe('0x2a')](_0x5776a2);}};}function respondWithFilteredResult(_0x59c947,_0x425c3e){return function(_0x2984be){if(_0x2984be){var _0x3a796e=_0x2984be[_0x9bbe('0x2b')],_0x265f61=_0x425c3e[_0x9bbe('0x2c')],_0x512a09=_0x425c3e[_0x9bbe('0x2c')]+_0x425c3e['limit'],_0xbd0d7b;if(_0x512a09>=_0x3a796e){_0x512a09=_0x3a796e;_0xbd0d7b=0xc8;}else{_0xbd0d7b=0xce;}_0x59c947[_0x9bbe('0x28')](_0xbd0d7b);return _0x59c947['set'](_0x9bbe('0x2d'),_0x265f61+'-'+_0x512a09+'/'+_0x3a796e)[_0x9bbe('0x2a')](_0x2984be);}return null;};}function patchUpdates(_0xcd681){return function(_0x296cf1){try{jsonpatch[_0x9bbe('0x2e')](_0x296cf1,_0xcd681,!![]);}catch(_0x8f66aa){return BPromise[_0x9bbe('0x2f')](_0x8f66aa);}return _0x296cf1[_0x9bbe('0x30')]();};}function saveUpdates(_0x2bd37f,_0x15fa43){return function(_0x256bad){if(_0x256bad){return _0x256bad['update'](_0x2bd37f)['then'](function(_0x165e81){return _0x165e81;});}return null;};}function removeEntity(_0x4cc036,_0x9a74b2){return function(_0x5451b6){if(_0x5451b6){return _0x5451b6[_0x9bbe('0x31')]()[_0x9bbe('0x1d')](function(){var _0x545bea=_0x5451b6[_0x9bbe('0x32')]({'plain':!![]});var _0x51e45b=_0x9bbe('0x33');return db['UserProfileResource'][_0x9bbe('0x31')]({'where':{'type':_0x51e45b,'resourceId':_0x545bea['id']}})[_0x9bbe('0x1d')](function(){return _0x5451b6;});})[_0x9bbe('0x1d')](function(){_0x4cc036[_0x9bbe('0x28')](0xcc)[_0x9bbe('0x29')]();});}};}function handleEntityNotFound(_0x268550,_0x43b3b7){return function(_0x15f44d){if(!_0x15f44d){_0x268550[_0x9bbe('0x34')](0x194);}return _0x15f44d;};}function handleError(_0x134e6e,_0x53d3bc){_0x53d3bc=_0x53d3bc||0x1f4;return function(_0x1fc648){logger[_0x9bbe('0x23')](_0x1fc648['stack']);if(_0x1fc648[_0x9bbe('0x35')]){delete _0x1fc648['name'];}_0x134e6e[_0x9bbe('0x28')](_0x53d3bc)[_0x9bbe('0x36')](_0x1fc648);};}exports[_0x9bbe('0x37')]=function(_0x4c0e98,_0x28d425){var _0x373c31={},_0x2cdb8a={},_0x35acb4={'count':0x0,'rows':[]};var _0x5d2004=db[_0x9bbe('0x38')][_0x9bbe('0x39')];_0x2cdb8a['model']=_[_0x9bbe('0x3a')](_0x5d2004);_0x2cdb8a[_0x9bbe('0x3b')]=_[_0x9bbe('0x3a')](_0x4c0e98[_0x9bbe('0x3b')]);_0x2cdb8a[_0x9bbe('0x3c')]=_['intersection'](_0x2cdb8a[_0x9bbe('0x3d')],_0x2cdb8a[_0x9bbe('0x3b')]);_0x373c31[_0x9bbe('0x3e')]=_[_0x9bbe('0x3f')](_0x2cdb8a[_0x9bbe('0x3d')],qs[_0x9bbe('0x40')](_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x40')]));_0x373c31[_0x9bbe('0x3e')]=_0x373c31['attributes'][_0x9bbe('0x41')]?_0x373c31[_0x9bbe('0x3e')]:_0x2cdb8a['model'];if(!_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x42')](_0x9bbe('0x43'))){_0x373c31['limit']=qs[_0x9bbe('0x44')](_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x44')]);_0x373c31['offset']=qs[_0x9bbe('0x2c')](_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x2c')]);}_0x373c31[_0x9bbe('0x45')]=qs[_0x9bbe('0x46')](_0x4c0e98['query'][_0x9bbe('0x46')]);_0x373c31[_0x9bbe('0x47')]=qs[_0x9bbe('0x3c')](_[_0x9bbe('0x48')](_0x4c0e98['query'],_0x2cdb8a[_0x9bbe('0x3c')]));if(_0x4c0e98['query']['filter']){_0x373c31[_0x9bbe('0x47')]=_['merge'](_0x373c31[_0x9bbe('0x47')],{'$or':_['map'](_0x5d2004,function(_0x19cb02){if(_0x19cb02[_0x9bbe('0x49')][_0x9bbe('0x4a')]!==_0x9bbe('0x4b')){var _0x34f115={};_0x34f115[_0x19cb02[_0x9bbe('0x4c')]]={'$like':'%'+_0x4c0e98[_0x9bbe('0x3b')][_0x9bbe('0x4d')]+'%'};return _0x34f115;}})});}_0x373c31=_['merge']({},_0x373c31,_0x4c0e98[_0x9bbe('0x4e')]);var _0x44d066={'where':_0x373c31[_0x9bbe('0x47')]};return db[_0x9bbe('0x38')][_0x9bbe('0x2b')](_0x44d066)[_0x9bbe('0x1d')](function(_0x31e13c){_0x35acb4[_0x9bbe('0x2b')]=_0x31e13c;if(_0x4c0e98['query'][_0x9bbe('0x4f')]){_0x373c31[_0x9bbe('0x50')]=[{'all':!![]}];}return db[_0x9bbe('0x38')][_0x9bbe('0x51')](_0x373c31);})[_0x9bbe('0x1d')](function(_0x5b5d6b){_0x35acb4[_0x9bbe('0x52')]=_0x5b5d6b;return _0x35acb4;})['then'](respondWithFilteredResult(_0x28d425,_0x373c31))[_0x9bbe('0x27')](handleError(_0x28d425,null));};exports[_0x9bbe('0x53')]=function(_0x40110e,_0x216946){var _0x57e0c6={'raw':![],'where':{'id':_0x40110e[_0x9bbe('0x54')]['id']}},_0x153d8a={};_0x153d8a[_0x9bbe('0x3d')]=_[_0x9bbe('0x3a')](db['VoiceContext'][_0x9bbe('0x39')]);_0x153d8a['query']=_[_0x9bbe('0x3a')](_0x40110e[_0x9bbe('0x3b')]);_0x153d8a[_0x9bbe('0x3c')]=_[_0x9bbe('0x3f')](_0x153d8a[_0x9bbe('0x3d')],_0x153d8a['query']);_0x57e0c6[_0x9bbe('0x3e')]=_[_0x9bbe('0x3f')](_0x153d8a['model'],qs[_0x9bbe('0x40')](_0x40110e['query'][_0x9bbe('0x40')]));_0x57e0c6['attributes']=_0x57e0c6[_0x9bbe('0x3e')][_0x9bbe('0x41')]?_0x57e0c6['attributes']:_0x153d8a[_0x9bbe('0x3d')];if(_0x40110e[_0x9bbe('0x3b')]['includeAll']){_0x57e0c6[_0x9bbe('0x50')]=[{'all':!![]}];}_0x57e0c6=_[_0x9bbe('0x55')]({},_0x57e0c6,_0x40110e['options']);return db[_0x9bbe('0x38')][_0x9bbe('0x56')](_0x57e0c6)[_0x9bbe('0x1d')](handleEntityNotFound(_0x216946,null))[_0x9bbe('0x1d')](respondWithResult(_0x216946,null))[_0x9bbe('0x27')](handleError(_0x216946,null));};exports[_0x9bbe('0x57')]=function(_0x128a32,_0xf26e7b,_0x2aa07f){var _0x56b61a;return db[_0x9bbe('0x38')][_0x9bbe('0x57')](_0x128a32[_0x9bbe('0x58')],{'raw':!![]})[_0x9bbe('0x1d')](function(_0x4705e5){_0x56b61a=_0x4705e5;return db['VoiceContext'][_0x9bbe('0x51')]({'raw':!![]});})[_0x9bbe('0x1d')](function(_0x5f471f){var _0x40b950=fs[_0x9bbe('0x59')](path[_0x9bbe('0x5a')](config[_0x9bbe('0x5b')],'server/files/templates/context.ejs'),_0x9bbe('0x5c'));var _0x50102f=ejs[_0x9bbe('0x5d')](_0x40b950,{'contexts':_0x5f471f||[]});fs['writeFileSync'](_0x9bbe('0x5e'),_0x50102f);})['then'](function(){return respondWithRpcPromise(_0x9bbe('0x5f'),_0x9bbe('0x57'),{'module':'chan_sip.so'});})[_0x9bbe('0x1d')](function(){var _0x2c6e03=_0x128a32[_0x9bbe('0x60')][_0x9bbe('0x32')]({'plain':!![]});if(!_0x2c6e03)throw new Error(_0x9bbe('0x61'));if(_0x2c6e03[_0x9bbe('0x62')]===_0x9bbe('0x60')){var _0xbc499f=_0x56b61a['get']({'plain':!![]});return db['UserProfileSection'][_0x9bbe('0x56')]({'where':{'name':_0x9bbe('0x33'),'userProfileId':_0x2c6e03['userProfileId']},'raw':!![]})[_0x9bbe('0x1d')](function(_0x555eb0){if(_0x555eb0&&_0x555eb0[_0x9bbe('0x63')]===0x0){return db['UserProfileResource'][_0x9bbe('0x57')]({'name':_0xbc499f[_0x9bbe('0x35')],'resourceId':_0xbc499f['id'],'type':_0x555eb0['name'],'sectionId':_0x555eb0['id']},{})['then'](function(){return _0x56b61a;});}else{return _0x56b61a;}})[_0x9bbe('0x27')](function(_0x6906f8){logger[_0x9bbe('0x23')](_0x9bbe('0x64'),_0x6906f8);throw _0x6906f8;});}return _0x56b61a;})[_0x9bbe('0x1d')](respondWithResult(_0xf26e7b,0xc9))[_0x9bbe('0x27')](handleError(_0xf26e7b,null));};exports['update']=function(_0x1b153c,_0x107da9,_0xdf99cf){var _0x5532a1;return db[_0x9bbe('0x38')][_0x9bbe('0x56')]({'where':{'id':_0x1b153c[_0x9bbe('0x54')]['id']}})[_0x9bbe('0x1d')](handleEntityNotFound(_0x107da9,null))[_0x9bbe('0x1d')](saveUpdates(_0x1b153c[_0x9bbe('0x58')],null))[_0x9bbe('0x1d')](function(_0x733378){if(_0x733378){_0x5532a1=_0x733378;return db[_0x9bbe('0x38')]['findAll']({'raw':!![]});}})[_0x9bbe('0x1d')](function(_0x41cade){var _0x322d4a=fs['readFileSync'](path['join'](config[_0x9bbe('0x5b')],'server/files/templates/context.ejs'),_0x9bbe('0x5c'));var _0x5890c1=ejs[_0x9bbe('0x5d')](_0x322d4a,{'contexts':_0x41cade||[]});fs['writeFileSync'](_0x9bbe('0x5e'),_0x5890c1);})['then'](function(){return respondWithRpcPromise(_0x9bbe('0x5f'),_0x9bbe('0x65'),{'module':_0x9bbe('0x66')});})[_0x9bbe('0x1d')](function(){return _0x5532a1;})[_0x9bbe('0x1d')](respondWithResult(_0x107da9,null))[_0x9bbe('0x27')](handleError(_0x107da9,null));};exports[_0x9bbe('0x31')]=function(_0x4bf98c,_0x20663b,_0x20f091){var _0x3e9b2f;return db[_0x9bbe('0x38')]['find']({'where':{'id':_0x4bf98c[_0x9bbe('0x54')]['id']}})[_0x9bbe('0x1d')](handleEntityNotFound(_0x20663b,null))['then'](removeEntity(_0x20663b,null))[_0x9bbe('0x1d')](function(){return db[_0x9bbe('0x38')][_0x9bbe('0x51')]({'raw':!![]});})[_0x9bbe('0x1d')](function(_0x5f25b6){var _0x731518=fs[_0x9bbe('0x59')](path[_0x9bbe('0x5a')](config[_0x9bbe('0x5b')],_0x9bbe('0x67')),'utf8');var _0x2aa6da=ejs['render'](_0x731518,{'contexts':_0x5f25b6});fs[_0x9bbe('0x68')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2aa6da);return respondWithRpcPromise(_0x9bbe('0x5f'),'destroy',{'module':'chan_sip.so'});})['catch'](handleError(_0x20663b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index b1c9d9e..bc37598 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 _0xa4cb=['moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','VoiceContext','lodash','../../config/logger'];(function(_0xe39f5,_0x594bb3){var _0x3d722f=function(_0x239a01){while(--_0x239a01){_0xe39f5['push'](_0xe39f5['shift']());}};_0x3d722f(++_0x594bb3);}(_0xa4cb,0xa8));var _0xba4c=function(_0x4dafb6,_0x3eab83){_0x4dafb6=_0x4dafb6-0x0;var _0x3026e1=_0xa4cb[_0x4dafb6];return _0x3026e1;};'use strict';var _=require(_0xba4c('0x0'));var util=require('util');var logger=require(_0xba4c('0x1'))('api');var moment=require(_0xba4c('0x2'));var BPromise=require(_0xba4c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba4c('0x4'));var rimraf=require(_0xba4c('0x5'));var config=require(_0xba4c('0x6'));var attributes=require(_0xba4c('0x7'));module[_0xba4c('0x8')]=function(_0x493134,_0x4bb984){return _0x493134['define'](_0xba4c('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bac=['exports','define','VoiceContext','voice_contexts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x2b7238,_0x22e973){var _0x413e1b=function(_0x53b78e){while(--_0x53b78e){_0x2b7238['push'](_0x2b7238['shift']());}};_0x413e1b(++_0x22e973);}(_0x6bac,0x7c));var _0xc6ba=function(_0x91641f,_0x53bd1b){_0x91641f=_0x91641f-0x0;var _0x4f94d2=_0x6bac[_0x91641f];return _0x4f94d2;};'use strict';var _=require('lodash');var util=require(_0xc6ba('0x0'));var logger=require(_0xc6ba('0x1'))('api');var moment=require(_0xc6ba('0x2'));var BPromise=require(_0xc6ba('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6ba('0x4'));var rimraf=require(_0xc6ba('0x5'));var config=require(_0xc6ba('0x6'));var attributes=require(_0xc6ba('0x7'));module[_0xc6ba('0x8')]=function(_0xe0f12f,_0x375fdc){return _0xe0f12f[_0xc6ba('0x9')](_0xc6ba('0xa'),attributes,{'tableName':_0xc6ba('0xb'),'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 0fcce29..3434669 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 _0x9d18=['message','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9d18,0x121));var _0x89d1=function(_0x5d5ab2,_0x1d3681){_0x5d5ab2=_0x5d5ab2-0x0;var _0xb8fe37=_0x9d18[_0x5d5ab2];return _0xb8fe37;};'use strict';var _=require(_0x89d1('0x0'));var util=require('util');var moment=require(_0x89d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x89d1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x89d1('0x3'));var logger=require(_0x89d1('0x4'))(_0x89d1('0x5'));var config=require(_0x89d1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x89d1('0x7')][_0x89d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1efdd2,_0x1a7557,_0x5c23ff){return new BPromise(function(_0x194c03,_0x460252){return client[_0x89d1('0x9')](_0x1efdd2,_0x5c23ff)[_0x89d1('0xa')](function(_0x4f82f9){logger[_0x89d1('0xb')](_0x89d1('0xc'),_0x1a7557,_0x89d1('0xd'));logger[_0x89d1('0xe')](_0x89d1('0xf'),_0x1a7557,_0x89d1('0xd'),JSON[_0x89d1('0x10')](_0x4f82f9));if(_0x4f82f9[_0x89d1('0x11')]){if(_0x4f82f9[_0x89d1('0x11')][_0x89d1('0x12')]===0x1f4){logger[_0x89d1('0x11')](_0x89d1('0xc'),_0x1a7557,_0x4f82f9[_0x89d1('0x11')][_0x89d1('0x13')]);return _0x460252(_0x4f82f9['error'][_0x89d1('0x13')]);}logger[_0x89d1('0x11')](_0x89d1('0xc'),_0x1a7557,_0x4f82f9[_0x89d1('0x11')]['message']);return _0x194c03(_0x4f82f9[_0x89d1('0x11')]['message']);}else{logger[_0x89d1('0xb')](_0x89d1('0xc'),_0x1a7557,_0x89d1('0xd'));_0x194c03(_0x4f82f9[_0x89d1('0x14')][_0x89d1('0x13')]);}})[_0x89d1('0x15')](function(_0x209dc3){logger[_0x89d1('0x11')](_0x89d1('0xc'),_0x1a7557,_0x209dc3);_0x460252(_0x209dc3);});});} \ No newline at end of file +var _0x3339=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','VoiceContext,\x20%s,\x20%s','info','result','catch','lodash'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x3339,0xf1));var _0x9333=function(_0x462f03,_0x5d5aba){_0x462f03=_0x462f03-0x0;var _0x5268ed=_0x3339[_0x462f03];return _0x5268ed;};'use strict';var _=require(_0x9333('0x0'));var util=require(_0x9333('0x1'));var moment=require(_0x9333('0x2'));var BPromise=require(_0x9333('0x3'));var rs=require(_0x9333('0x4'));var fs=require('fs');var Redis=require(_0x9333('0x5'));var db=require(_0x9333('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9333('0x7'));var config=require(_0x9333('0x8'));var jayson=require(_0x9333('0x9'));var client=jayson['client'][_0x9333('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x379ec9,_0x3af575,_0x3ce4f8){return new BPromise(function(_0x449dd5,_0x37d034){return client[_0x9333('0xb')](_0x379ec9,_0x3ce4f8)[_0x9333('0xc')](function(_0x5e7019){logger['info']('VoiceContext,\x20%s,\x20%s',_0x3af575,'request\x20sent');logger[_0x9333('0xd')](_0x9333('0xe'),_0x3af575,'request\x20sent',JSON['stringify'](_0x5e7019));if(_0x5e7019[_0x9333('0xf')]){if(_0x5e7019[_0x9333('0xf')][_0x9333('0x10')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x3af575,_0x5e7019[_0x9333('0xf')][_0x9333('0x11')]);return _0x37d034(_0x5e7019[_0x9333('0xf')]['message']);}logger['error'](_0x9333('0x12'),_0x3af575,_0x5e7019[_0x9333('0xf')][_0x9333('0x11')]);return _0x449dd5(_0x5e7019[_0x9333('0xf')][_0x9333('0x11')]);}else{logger[_0x9333('0x13')](_0x9333('0x12'),_0x3af575,'request\x20sent');_0x449dd5(_0x5e7019[_0x9333('0x14')][_0x9333('0x11')]);}})[_0x9333('0x15')](function(_0x26aef8){logger[_0x9333('0xf')](_0x9333('0x12'),_0x3af575,_0x26aef8);_0x37d034(_0x26aef8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 79cb6e6..c18d75b 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 _0x5872=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','delete','destroy','exports','multer','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5872,0x7c));var _0x2587=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0x5872[_0x492535];return _0x256620;};'use strict';var multer=require(_0x2587('0x0'));var util=require(_0x2587('0x1'));var path=require(_0x2587('0x2'));var timeout=require(_0x2587('0x3'));var express=require('express');var router=express[_0x2587('0x4')]();var auth=require(_0x2587('0x5'));var interaction=require(_0x2587('0x6'));var config=require('../../config/environment');var controller=require(_0x2587('0x7'));router['get']('/',auth[_0x2587('0x8')](),controller[_0x2587('0x9')]);router['get'](_0x2587('0xa'),auth[_0x2587('0x8')](),controller[_0x2587('0xb')]);router[_0x2587('0xc')](_0x2587('0xd'),auth[_0x2587('0x8')](),controller[_0x2587('0xe')]);router['post']('/',auth[_0x2587('0x8')](),controller['create']);router['put'](_0x2587('0xd'),auth[_0x2587('0x8')](),controller['update']);router[_0x2587('0xf')](_0x2587('0xd'),auth[_0x2587('0x8')](),controller[_0x2587('0x10')]);module[_0x2587('0x11')]=router; \ No newline at end of file +var _0x0628=['delete','destroy','util','path','express','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','describe','/:id','put','update'];(function(_0xe28053,_0x42d05c){var _0x344c2a=function(_0x1532c4){while(--_0x1532c4){_0xe28053['push'](_0xe28053['shift']());}};_0x344c2a(++_0x42d05c);}(_0x0628,0x1af));var _0x8062=function(_0x11d65b,_0x175964){_0x11d65b=_0x11d65b-0x0;var _0x41e1c9=_0x0628[_0x11d65b];return _0x41e1c9;};'use strict';var multer=require('multer');var util=require(_0x8062('0x0'));var path=require(_0x8062('0x1'));var timeout=require('connect-timeout');var express=require(_0x8062('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8062('0x3'));var config=require('../../config/environment');var controller=require(_0x8062('0x4'));router[_0x8062('0x5')]('/',auth[_0x8062('0x6')](),controller['index']);router['get']('/describe',auth[_0x8062('0x6')](),controller[_0x8062('0x7')]);router['get'](_0x8062('0x8'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x8062('0x6')](),controller['create']);router[_0x8062('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8062('0xa')]);router[_0x8062('0xb')](_0x8062('0x8'),auth[_0x8062('0x6')](),controller[_0x8062('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 2596fda..a831647 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 _0xd2e3=['STRING','INTEGER','DATE','sequelize'];(function(_0x492dc0,_0x93b557){var _0x5d03d5=function(_0x1daa5c){while(--_0x1daa5c){_0x492dc0['push'](_0x492dc0['shift']());}};_0x5d03d5(++_0x93b557);}(_0xd2e3,0x1e3));var _0x3d2e=function(_0x2d3af7,_0x3b69ba){_0x2d3af7=_0x2d3af7-0x0;var _0xc050dd=_0xd2e3[_0x2d3af7];return _0xc050dd;};'use strict';var Sequelize=require(_0x3d2e('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x3d2e('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3d2e('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3d2e('0x1')]},'calleridnum':{'type':Sequelize[_0x3d2e('0x1')]},'calleridname':{'type':Sequelize[_0x3d2e('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3d2e('0x1')]},'connectedlinename':{'type':Sequelize[_0x3d2e('0x1')]},'language':{'type':Sequelize[_0x3d2e('0x1')]},'accountcode':{'type':Sequelize[_0x3d2e('0x1')]},'context':{'type':Sequelize[_0x3d2e('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3d2e('0x2')]},'uniqueid':{'type':Sequelize[_0x3d2e('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x3d2e('0x1')]},'destchannelstate':{'type':Sequelize[_0x3d2e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3d2e('0x1')]},'destcalleridnum':{'type':Sequelize[_0x3d2e('0x1')]},'destcalleridname':{'type':Sequelize[_0x3d2e('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x3d2e('0x1')]},'destlanguage':{'type':Sequelize[_0x3d2e('0x1')]},'destaccountcode':{'type':Sequelize[_0x3d2e('0x1')]},'destcontext':{'type':Sequelize[_0x3d2e('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3d2e('0x2')]},'destuniqueid':{'type':Sequelize[_0x3d2e('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x3d2e('0x1')]},'dialstatus':{'type':Sequelize[_0x3d2e('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x3d2e('0x3')]},'endtime':{'type':Sequelize[_0x3d2e('0x3')]},'lastevent':{'type':Sequelize[_0x3d2e('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3d2e('0x2')]},'duration':{'type':Sequelize[_0x3d2e('0x2')]},'holdtime':{'type':Sequelize[_0x3d2e('0x2')]},'billableseconds':{'type':Sequelize[_0x3d2e('0x2')]}}; \ No newline at end of file +var _0xbba2=['STRING','INTEGER','DATE','sequelize','exports'];(function(_0x5db569,_0x25707b){var _0x247b44=function(_0x4b7dfd){while(--_0x4b7dfd){_0x5db569['push'](_0x5db569['shift']());}};_0x247b44(++_0x25707b);}(_0xbba2,0x6c));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2bba('0x0'));module[_0x2bba('0x1')]={'privilege':{'type':Sequelize[_0x2bba('0x2')]},'channel':{'type':Sequelize[_0x2bba('0x2')]},'channelstate':{'type':Sequelize[_0x2bba('0x3')]},'channelstatedesc':{'type':Sequelize[_0x2bba('0x2')]},'calleridnum':{'type':Sequelize[_0x2bba('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2bba('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2bba('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2bba('0x2')]},'exten':{'type':Sequelize[_0x2bba('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x2bba('0x2')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x2bba('0x2')]},'destchannelstate':{'type':Sequelize[_0x2bba('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2bba('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x2bba('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2bba('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2bba('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x2bba('0x2')]},'destcontext':{'type':Sequelize[_0x2bba('0x2')]},'destexten':{'type':Sequelize[_0x2bba('0x2')]},'destpriority':{'type':Sequelize[_0x2bba('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x2bba('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x2bba('0x2')]},'starttime':{'type':Sequelize[_0x2bba('0x4')]},'answertime':{'type':Sequelize[_0x2bba('0x4')]},'endtime':{'type':Sequelize[_0x2bba('0x4')]},'lastevent':{'type':Sequelize[_0x2bba('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x2bba('0x3')]},'duration':{'type':Sequelize[_0x2bba('0x3')]},'holdtime':{'type':Sequelize[_0x2bba('0x3')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index ad2b31e..d20a26a 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 _0x4ddf=['map','VIRTUAL','field','include','VoiceDialReport','findAll','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','update','then','destroy','error','name','send','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge'];(function(_0x4ba380,_0x259bee){var _0x4b111b=function(_0x2bf227){while(--_0x2bf227){_0x4ba380['push'](_0x4ba380['shift']());}};_0x4b111b(++_0x259bee);}(_0x4ddf,0x1f1));var _0xf4dd=function(_0x3b6246,_0x1aaa58){_0x3b6246=_0x3b6246-0x0;var _0x2002c4=_0x4ddf[_0x3b6246];return _0x2002c4;};'use strict';var pdf=require(_0xf4dd('0x0'));var emlformat=require(_0xf4dd('0x1'));var rimraf=require(_0xf4dd('0x2'));var zipdir=require(_0xf4dd('0x3'));var jsonpatch=require(_0xf4dd('0x4'));var rp=require(_0xf4dd('0x5'));var moment=require(_0xf4dd('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf4dd('0x7'));var util=require(_0xf4dd('0x8'));var path=require(_0xf4dd('0x9'));var sox=require('sox');var csv=require(_0xf4dd('0xa'));var ejs=require(_0xf4dd('0xb'));var fs=require('fs');var _=require(_0xf4dd('0xc'));var squel=require(_0xf4dd('0xd'));var crypto=require(_0xf4dd('0xe'));var jsforce=require(_0xf4dd('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf4dd('0x10'));var Papa=require(_0xf4dd('0x11'));var Redis=require(_0xf4dd('0x12'));var authService=require(_0xf4dd('0x13'));var qs=require('../../components/parsers/qs');var hardwareService=require(_0xf4dd('0x14'));var logger=require(_0xf4dd('0x15'))('api');var utils=require(_0xf4dd('0x16'));var config=require(_0xf4dd('0x17'));var db=require(_0xf4dd('0x18'))['db'];function respondWithStatusCode(_0x4b584b,_0x58ac63){_0x58ac63=_0x58ac63||0xcc;return function(_0xc73ade){if(_0xc73ade){return _0x4b584b[_0xf4dd('0x19')](_0x58ac63);}return _0x4b584b[_0xf4dd('0x1a')](_0x58ac63)[_0xf4dd('0x1b')]();};}function respondWithResult(_0x244cb2,_0x264637){_0x264637=_0x264637||0xc8;return function(_0x2acfe3){if(_0x2acfe3){return _0x244cb2['status'](_0x264637)[_0xf4dd('0x1c')](_0x2acfe3);}};}function respondWithFilteredResult(_0x23f653,_0x281c53){return function(_0x589042){if(_0x589042){var _0x3f02fb=_0x589042[_0xf4dd('0x1d')],_0x174a62=_0x281c53[_0xf4dd('0x1e')],_0x54d27d=_0x281c53['offset']+_0x281c53[_0xf4dd('0x1f')],_0x3d733e;if(_0x54d27d>=_0x3f02fb){_0x54d27d=_0x3f02fb;_0x3d733e=0xc8;}else{_0x3d733e=0xce;}_0x23f653[_0xf4dd('0x1a')](_0x3d733e);return _0x23f653[_0xf4dd('0x20')]('Content-Range',_0x174a62+'-'+_0x54d27d+'/'+_0x3f02fb)[_0xf4dd('0x1c')](_0x589042);}return null;};}function patchUpdates(_0x3f8d79){return function(_0x140a64){try{jsonpatch[_0xf4dd('0x21')](_0x140a64,_0x3f8d79,!![]);}catch(_0x536e2a){return BPromise[_0xf4dd('0x22')](_0x536e2a);}return _0x140a64['save']();};}function saveUpdates(_0x4e33d7,_0xf76677){return function(_0x11348b){if(_0x11348b){return _0x11348b[_0xf4dd('0x23')](_0x4e33d7)[_0xf4dd('0x24')](function(_0x1feba3){return _0x1feba3;});}return null;};}function removeEntity(_0xbe77c4,_0x28bc8d){return function(_0x595a2e){if(_0x595a2e){return _0x595a2e[_0xf4dd('0x25')]()['then'](function(){_0xbe77c4[_0xf4dd('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c9bfb,_0x47059a){return function(_0x38a7d3){if(!_0x38a7d3){_0x8c9bfb['sendStatus'](0x194);}return _0x38a7d3;};}function handleError(_0x146ada,_0xb723f){_0xb723f=_0xb723f||0x1f4;return function(_0x298c56){logger[_0xf4dd('0x26')](_0x298c56['stack']);if(_0x298c56[_0xf4dd('0x27')]){delete _0x298c56[_0xf4dd('0x27')];}_0x146ada[_0xf4dd('0x1a')](_0xb723f)[_0xf4dd('0x28')](_0x298c56);};}exports['index']=function(_0x493c73,_0x587098){var _0x305865={},_0xf7f418={},_0x4aaafc={'count':0x0,'rows':[]};var _0x283bd1=db['VoiceDialReport']['rawAttributes'];_0xf7f418[_0xf4dd('0x29')]=_[_0xf4dd('0x2a')](_0x283bd1);_0xf7f418['query']=_[_0xf4dd('0x2a')](_0x493c73['query']);_0xf7f418[_0xf4dd('0x2b')]=_[_0xf4dd('0x2c')](_0xf7f418[_0xf4dd('0x29')],_0xf7f418[_0xf4dd('0x2d')]);_0x305865[_0xf4dd('0x2e')]=_[_0xf4dd('0x2c')](_0xf7f418['model'],qs[_0xf4dd('0x2f')](_0x493c73[_0xf4dd('0x2d')][_0xf4dd('0x2f')]));_0x305865[_0xf4dd('0x2e')]=_0x305865[_0xf4dd('0x2e')][_0xf4dd('0x30')]?_0x305865['attributes']:_0xf7f418['model'];if(!_0x493c73['query'][_0xf4dd('0x31')](_0xf4dd('0x32'))){_0x305865['limit']=qs['limit'](_0x493c73['query'][_0xf4dd('0x1f')]);_0x305865[_0xf4dd('0x1e')]=qs[_0xf4dd('0x1e')](_0x493c73[_0xf4dd('0x2d')]['offset']);}_0x305865['order']=qs[_0xf4dd('0x33')](_0x493c73['query'][_0xf4dd('0x33')]);_0x305865['where']=qs[_0xf4dd('0x2b')](_[_0xf4dd('0x34')](_0x493c73[_0xf4dd('0x2d')],_0xf7f418[_0xf4dd('0x2b')]));if(_0x493c73[_0xf4dd('0x2d')]['filter']){_0x305865[_0xf4dd('0x35')]=_[_0xf4dd('0x36')](_0x305865['where'],{'$or':_[_0xf4dd('0x37')](_0x283bd1,function(_0x2a9a4a){if(_0x2a9a4a['type']['key']!==_0xf4dd('0x38')){var _0x3b8bbf={};_0x3b8bbf[_0x2a9a4a[_0xf4dd('0x39')]]={'$like':'%'+_0x493c73[_0xf4dd('0x2d')]['filter']+'%'};return _0x3b8bbf;}})});}_0x305865=_['merge']({},_0x305865,_0x493c73['options']);var _0x176a4c={'where':_0x305865['where']};return db['VoiceDialReport'][_0xf4dd('0x1d')](_0x176a4c)[_0xf4dd('0x24')](function(_0xbf6151){_0x4aaafc[_0xf4dd('0x1d')]=_0xbf6151;if(_0x493c73['query']['includeAll']){_0x305865[_0xf4dd('0x3a')]=[{'all':!![]}];}return db[_0xf4dd('0x3b')][_0xf4dd('0x3c')](_0x305865);})[_0xf4dd('0x24')](function(_0x13a23a){_0x4aaafc['rows']=_0x13a23a;return _0x4aaafc;})[_0xf4dd('0x24')](respondWithFilteredResult(_0x587098,_0x305865))[_0xf4dd('0x3d')](handleError(_0x587098,null));};exports[_0xf4dd('0x3e')]=function(_0x54959a,_0x47ebcb){var _0x5e8b3e={'raw':!![],'where':{'id':_0x54959a[_0xf4dd('0x3f')]['id']}},_0x18d830={};_0x18d830[_0xf4dd('0x29')]=_[_0xf4dd('0x2a')](db[_0xf4dd('0x3b')][_0xf4dd('0x40')]);_0x18d830[_0xf4dd('0x2d')]=_[_0xf4dd('0x2a')](_0x54959a['query']);_0x18d830[_0xf4dd('0x2b')]=_['intersection'](_0x18d830[_0xf4dd('0x29')],_0x18d830[_0xf4dd('0x2d')]);_0x5e8b3e[_0xf4dd('0x2e')]=_[_0xf4dd('0x2c')](_0x18d830['model'],qs[_0xf4dd('0x2f')](_0x54959a[_0xf4dd('0x2d')][_0xf4dd('0x2f')]));_0x5e8b3e[_0xf4dd('0x2e')]=_0x5e8b3e['attributes'][_0xf4dd('0x30')]?_0x5e8b3e[_0xf4dd('0x2e')]:_0x18d830[_0xf4dd('0x29')];if(_0x54959a[_0xf4dd('0x2d')]['includeAll']){_0x5e8b3e[_0xf4dd('0x3a')]=[{'all':!![]}];}_0x5e8b3e=_[_0xf4dd('0x36')]({},_0x5e8b3e,_0x54959a['options']);return db['VoiceDialReport'][_0xf4dd('0x41')](_0x5e8b3e)['then'](handleEntityNotFound(_0x47ebcb,null))[_0xf4dd('0x24')](respondWithResult(_0x47ebcb,null))[_0xf4dd('0x3d')](handleError(_0x47ebcb,null));};exports['create']=function(_0xc0243c,_0x3b7437){return db[_0xf4dd('0x3b')][_0xf4dd('0x42')](_0xc0243c[_0xf4dd('0x43')],{})['then'](respondWithResult(_0x3b7437,0xc9))[_0xf4dd('0x3d')](handleError(_0x3b7437,null));};exports[_0xf4dd('0x23')]=function(_0xbc09ac,_0x5e629c){if(_0xbc09ac[_0xf4dd('0x43')]['id']){delete _0xbc09ac['body']['id'];}return db['VoiceDialReport'][_0xf4dd('0x41')]({'where':{'id':_0xbc09ac[_0xf4dd('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5e629c,null))[_0xf4dd('0x24')](saveUpdates(_0xbc09ac[_0xf4dd('0x43')],null))[_0xf4dd('0x24')](respondWithResult(_0x5e629c,null))[_0xf4dd('0x3d')](handleError(_0x5e629c,null));};exports['destroy']=function(_0x14cdea,_0x334cc1){return db[_0xf4dd('0x3b')][_0xf4dd('0x41')]({'where':{'id':_0x14cdea[_0xf4dd('0x3f')]['id']}})[_0xf4dd('0x24')](handleEntityNotFound(_0x334cc1,null))[_0xf4dd('0x24')](removeEntity(_0x334cc1,null))[_0xf4dd('0x3d')](handleError(_0x334cc1,null));};exports[_0xf4dd('0x44')]=function(_0x2f5f92,_0x7e4198){return db[_0xf4dd('0x3b')][_0xf4dd('0x44')]()['then'](respondWithResult(_0x7e4198,null))[_0xf4dd('0x3d')](handleError(_0x7e4198,null));}; \ No newline at end of file +var _0xc9d4=['findAll','catch','keys','fields','include','find','create','VoiceDialReport','body','params','destroy','describe','html-pdf','eml-format','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/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','count','offset','limit','set','apply','reject','update','then','end','error','stack','name','send','index','rawAttributes','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','type','key','VIRTUAL','field','options','includeAll'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc9d4,0xf0));var _0x4c9d=function(_0x5ee72e,_0x489c74){_0x5ee72e=_0x5ee72e-0x0;var _0x96d856=_0xc9d4[_0x5ee72e];return _0x96d856;};'use strict';var pdf=require(_0x4c9d('0x0'));var emlformat=require(_0x4c9d('0x1'));var rimraf=require(_0x4c9d('0x2'));var zipdir=require(_0x4c9d('0x3'));var jsonpatch=require(_0x4c9d('0x4'));var rp=require(_0x4c9d('0x5'));var moment=require(_0x4c9d('0x6'));var BPromise=require(_0x4c9d('0x7'));var Mustache=require(_0x4c9d('0x8'));var util=require(_0x4c9d('0x9'));var path=require(_0x4c9d('0xa'));var sox=require(_0x4c9d('0xb'));var csv=require(_0x4c9d('0xc'));var ejs=require(_0x4c9d('0xd'));var fs=require('fs');var _=require(_0x4c9d('0xe'));var squel=require(_0x4c9d('0xf'));var crypto=require('crypto');var jsforce=require(_0x4c9d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4c9d('0xc'));var querystring=require(_0x4c9d('0x11'));var Papa=require(_0x4c9d('0x12'));var Redis=require(_0x4c9d('0x13'));var authService=require(_0x4c9d('0x14'));var qs=require(_0x4c9d('0x15'));var hardwareService=require(_0x4c9d('0x16'));var logger=require(_0x4c9d('0x17'))(_0x4c9d('0x18'));var utils=require(_0x4c9d('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x449d01,_0x3fea59){_0x3fea59=_0x3fea59||0xcc;return function(_0x28badc){if(_0x28badc){return _0x449d01[_0x4c9d('0x1a')](_0x3fea59);}return _0x449d01[_0x4c9d('0x1b')](_0x3fea59)['end']();};}function respondWithResult(_0x23ee64,_0x25bf2f){_0x25bf2f=_0x25bf2f||0xc8;return function(_0x579bd6){if(_0x579bd6){return _0x23ee64['status'](_0x25bf2f)[_0x4c9d('0x1c')](_0x579bd6);}};}function respondWithFilteredResult(_0xb0fa62,_0x3a81d4){return function(_0x2522e3){if(_0x2522e3){var _0x399c69=_0x2522e3[_0x4c9d('0x1d')],_0x3d2980=_0x3a81d4[_0x4c9d('0x1e')],_0x5eadc0=_0x3a81d4[_0x4c9d('0x1e')]+_0x3a81d4[_0x4c9d('0x1f')],_0x65ca85;if(_0x5eadc0>=_0x399c69){_0x5eadc0=_0x399c69;_0x65ca85=0xc8;}else{_0x65ca85=0xce;}_0xb0fa62[_0x4c9d('0x1b')](_0x65ca85);return _0xb0fa62[_0x4c9d('0x20')]('Content-Range',_0x3d2980+'-'+_0x5eadc0+'/'+_0x399c69)[_0x4c9d('0x1c')](_0x2522e3);}return null;};}function patchUpdates(_0x122063){return function(_0x4d36f3){try{jsonpatch[_0x4c9d('0x21')](_0x4d36f3,_0x122063,!![]);}catch(_0x64fd5b){return BPromise[_0x4c9d('0x22')](_0x64fd5b);}return _0x4d36f3['save']();};}function saveUpdates(_0x317565,_0x30ccaf){return function(_0x3ff54b){if(_0x3ff54b){return _0x3ff54b[_0x4c9d('0x23')](_0x317565)[_0x4c9d('0x24')](function(_0x5e064a){return _0x5e064a;});}return null;};}function removeEntity(_0x5b5202,_0x5acc74){return function(_0x471c1a){if(_0x471c1a){return _0x471c1a['destroy']()[_0x4c9d('0x24')](function(){_0x5b5202['status'](0xcc)[_0x4c9d('0x25')]();});}};}function handleEntityNotFound(_0x3b6c98,_0x1f77a0){return function(_0x580c94){if(!_0x580c94){_0x3b6c98[_0x4c9d('0x1a')](0x194);}return _0x580c94;};}function handleError(_0x27d5a9,_0x18806b){_0x18806b=_0x18806b||0x1f4;return function(_0x3cbd5d){logger[_0x4c9d('0x26')](_0x3cbd5d[_0x4c9d('0x27')]);if(_0x3cbd5d[_0x4c9d('0x28')]){delete _0x3cbd5d[_0x4c9d('0x28')];}_0x27d5a9[_0x4c9d('0x1b')](_0x18806b)[_0x4c9d('0x29')](_0x3cbd5d);};}exports[_0x4c9d('0x2a')]=function(_0x588f07,_0x2c86bb){var _0xfc6d04={},_0x19cca6={},_0x5745b7={'count':0x0,'rows':[]};var _0xa050fa=db['VoiceDialReport'][_0x4c9d('0x2b')];_0x19cca6['model']=_['keys'](_0xa050fa);_0x19cca6[_0x4c9d('0x2c')]=_['keys'](_0x588f07[_0x4c9d('0x2c')]);_0x19cca6[_0x4c9d('0x2d')]=_[_0x4c9d('0x2e')](_0x19cca6[_0x4c9d('0x2f')],_0x19cca6['query']);_0xfc6d04[_0x4c9d('0x30')]=_[_0x4c9d('0x2e')](_0x19cca6[_0x4c9d('0x2f')],qs['fields'](_0x588f07['query']['fields']));_0xfc6d04[_0x4c9d('0x30')]=_0xfc6d04[_0x4c9d('0x30')][_0x4c9d('0x31')]?_0xfc6d04['attributes']:_0x19cca6[_0x4c9d('0x2f')];if(!_0x588f07[_0x4c9d('0x2c')][_0x4c9d('0x32')](_0x4c9d('0x33'))){_0xfc6d04[_0x4c9d('0x1f')]=qs[_0x4c9d('0x1f')](_0x588f07['query'][_0x4c9d('0x1f')]);_0xfc6d04[_0x4c9d('0x1e')]=qs['offset'](_0x588f07[_0x4c9d('0x2c')]['offset']);}_0xfc6d04[_0x4c9d('0x34')]=qs[_0x4c9d('0x35')](_0x588f07['query'][_0x4c9d('0x35')]);_0xfc6d04['where']=qs[_0x4c9d('0x2d')](_['pick'](_0x588f07[_0x4c9d('0x2c')],_0x19cca6[_0x4c9d('0x2d')]));if(_0x588f07[_0x4c9d('0x2c')][_0x4c9d('0x36')]){_0xfc6d04[_0x4c9d('0x37')]=_[_0x4c9d('0x38')](_0xfc6d04[_0x4c9d('0x37')],{'$or':_[_0x4c9d('0x39')](_0xa050fa,function(_0x41580b){if(_0x41580b[_0x4c9d('0x3a')][_0x4c9d('0x3b')]!==_0x4c9d('0x3c')){var _0x143286={};_0x143286[_0x41580b[_0x4c9d('0x3d')]]={'$like':'%'+_0x588f07[_0x4c9d('0x2c')][_0x4c9d('0x36')]+'%'};return _0x143286;}})});}_0xfc6d04=_[_0x4c9d('0x38')]({},_0xfc6d04,_0x588f07[_0x4c9d('0x3e')]);var _0x16cbea={'where':_0xfc6d04['where']};return db['VoiceDialReport']['count'](_0x16cbea)[_0x4c9d('0x24')](function(_0x40eebe){_0x5745b7[_0x4c9d('0x1d')]=_0x40eebe;if(_0x588f07['query'][_0x4c9d('0x3f')]){_0xfc6d04['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0x4c9d('0x40')](_0xfc6d04);})[_0x4c9d('0x24')](function(_0x4a1c3d){_0x5745b7['rows']=_0x4a1c3d;return _0x5745b7;})[_0x4c9d('0x24')](respondWithFilteredResult(_0x2c86bb,_0xfc6d04))[_0x4c9d('0x41')](handleError(_0x2c86bb,null));};exports['show']=function(_0x2b0b0a,_0x5aa548){var _0x4ee746={'raw':!![],'where':{'id':_0x2b0b0a['params']['id']}},_0x42c4f2={};_0x42c4f2[_0x4c9d('0x2f')]=_[_0x4c9d('0x42')](db['VoiceDialReport'][_0x4c9d('0x2b')]);_0x42c4f2['query']=_[_0x4c9d('0x42')](_0x2b0b0a['query']);_0x42c4f2[_0x4c9d('0x2d')]=_['intersection'](_0x42c4f2[_0x4c9d('0x2f')],_0x42c4f2['query']);_0x4ee746[_0x4c9d('0x30')]=_[_0x4c9d('0x2e')](_0x42c4f2[_0x4c9d('0x2f')],qs[_0x4c9d('0x43')](_0x2b0b0a[_0x4c9d('0x2c')][_0x4c9d('0x43')]));_0x4ee746[_0x4c9d('0x30')]=_0x4ee746['attributes'][_0x4c9d('0x31')]?_0x4ee746[_0x4c9d('0x30')]:_0x42c4f2[_0x4c9d('0x2f')];if(_0x2b0b0a['query'][_0x4c9d('0x3f')]){_0x4ee746[_0x4c9d('0x44')]=[{'all':!![]}];}_0x4ee746=_[_0x4c9d('0x38')]({},_0x4ee746,_0x2b0b0a['options']);return db['VoiceDialReport'][_0x4c9d('0x45')](_0x4ee746)[_0x4c9d('0x24')](handleEntityNotFound(_0x5aa548,null))[_0x4c9d('0x24')](respondWithResult(_0x5aa548,null))[_0x4c9d('0x41')](handleError(_0x5aa548,null));};exports[_0x4c9d('0x46')]=function(_0x4c5c1d,_0x1a901f){return db[_0x4c9d('0x47')][_0x4c9d('0x46')](_0x4c5c1d[_0x4c9d('0x48')],{})[_0x4c9d('0x24')](respondWithResult(_0x1a901f,0xc9))[_0x4c9d('0x41')](handleError(_0x1a901f,null));};exports[_0x4c9d('0x23')]=function(_0x12c737,_0x419289){if(_0x12c737[_0x4c9d('0x48')]['id']){delete _0x12c737[_0x4c9d('0x48')]['id'];}return db['VoiceDialReport'][_0x4c9d('0x45')]({'where':{'id':_0x12c737[_0x4c9d('0x49')]['id']}})[_0x4c9d('0x24')](handleEntityNotFound(_0x419289,null))[_0x4c9d('0x24')](saveUpdates(_0x12c737[_0x4c9d('0x48')],null))[_0x4c9d('0x24')](respondWithResult(_0x419289,null))[_0x4c9d('0x41')](handleError(_0x419289,null));};exports[_0x4c9d('0x4a')]=function(_0x2269d3,_0x2690d9){return db[_0x4c9d('0x47')][_0x4c9d('0x45')]({'where':{'id':_0x2269d3['params']['id']}})[_0x4c9d('0x24')](handleEntityNotFound(_0x2690d9,null))['then'](removeEntity(_0x2690d9,null))[_0x4c9d('0x41')](handleError(_0x2690d9,null));};exports[_0x4c9d('0x4b')]=function(_0x512f64,_0xe2681f){return db[_0x4c9d('0x47')][_0x4c9d('0x4b')]()[_0x4c9d('0x24')](respondWithResult(_0xe2681f,null))[_0x4c9d('0x41')](handleError(_0xe2681f,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index d43dc6a..1b9f90b 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 _0x082b=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','report_dial','uniqueid'];(function(_0x221761,_0x38ac79){var _0x3b4f6b=function(_0x475f67){while(--_0x475f67){_0x221761['push'](_0x221761['shift']());}};_0x3b4f6b(++_0x38ac79);}(_0x082b,0x1ec));var _0xb082=function(_0x349f69,_0x2138e5){_0x349f69=_0x349f69-0x0;var _0x174511=_0x082b[_0x349f69];return _0x174511;};'use strict';var _=require(_0xb082('0x0'));var util=require(_0xb082('0x1'));var logger=require(_0xb082('0x2'))(_0xb082('0x3'));var moment=require('moment');var BPromise=require(_0xb082('0x4'));var rp=require(_0xb082('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb082('0x6'));var config=require(_0xb082('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0xb082('0x8')]=function(_0x37b715,_0x16e0b8){return _0x37b715[_0xb082('0x9')]('VoiceDialReport',attributes,{'tableName':_0xb082('0xa'),'paranoid':![],'indexes':[{'fields':[_0xb082('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x94df=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x94df,0xa3));var _0xf94d=function(_0x5975af,_0x4aac11){_0x5975af=_0x5975af-0x0;var _0x1e4e07=_0x94df[_0x5975af];return _0x1e4e07;};'use strict';var _=require(_0xf94d('0x0'));var util=require(_0xf94d('0x1'));var logger=require(_0xf94d('0x2'))(_0xf94d('0x3'));var moment=require(_0xf94d('0x4'));var BPromise=require(_0xf94d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf94d('0x6'));var rimraf=require(_0xf94d('0x7'));var config=require(_0xf94d('0x8'));var attributes=require(_0xf94d('0x9'));module[_0xf94d('0xa')]=function(_0x32b0bd,_0x40bfd4){return _0x32b0bd[_0xf94d('0xb')](_0xf94d('0xc'),attributes,{'tableName':_0xf94d('0xd'),'paranoid':![],'indexes':[{'fields':[_0xf94d('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 ac170d4..46c28e5 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 _0x976a=['result','VoiceDialReport','create','options','raw','debug','CreateVoiceDialReport','catch','UpdateVoiceDialReport','update','body','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message'];(function(_0x48e5ac,_0x2793c5){var _0x350c34=function(_0x2ca226){while(--_0x2ca226){_0x48e5ac['push'](_0x48e5ac['shift']());}};_0x350c34(++_0x2793c5);}(_0x976a,0xf4));var _0xa976=function(_0x523d5b,_0x1808f0){_0x523d5b=_0x523d5b-0x0;var _0x4d5b4c=_0x976a[_0x523d5b];return _0x4d5b4c;};'use strict';var _=require(_0xa976('0x0'));var util=require(_0xa976('0x1'));var moment=require(_0xa976('0x2'));var BPromise=require('bluebird');var rs=require(_0xa976('0x3'));var fs=require('fs');var Redis=require(_0xa976('0x4'));var db=require(_0xa976('0x5'))['db'];var utils=require(_0xa976('0x6'));var logger=require(_0xa976('0x7'))(_0xa976('0x8'));var config=require(_0xa976('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5caa7a,_0x3a4a2,_0x12a073){return new BPromise(function(_0x1a9983,_0xc3661d){return client[_0xa976('0xa')](_0x5caa7a,_0x12a073)[_0xa976('0xb')](function(_0x197ebf){logger[_0xa976('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x3a4a2,'request\x20sent');logger['debug'](_0xa976('0xd'),_0x3a4a2,_0xa976('0xe'),JSON[_0xa976('0xf')](_0x197ebf));if(_0x197ebf[_0xa976('0x10')]){if(_0x197ebf['error'][_0xa976('0x11')]===0x1f4){logger[_0xa976('0x10')](_0xa976('0x12'),_0x3a4a2,_0x197ebf[_0xa976('0x10')][_0xa976('0x13')]);return _0xc3661d(_0x197ebf[_0xa976('0x10')]['message']);}logger[_0xa976('0x10')](_0xa976('0x12'),_0x3a4a2,_0x197ebf[_0xa976('0x10')][_0xa976('0x13')]);return _0x1a9983(_0x197ebf[_0xa976('0x10')][_0xa976('0x13')]);}else{logger[_0xa976('0xc')](_0xa976('0x12'),_0x3a4a2,_0xa976('0xe'));_0x1a9983(_0x197ebf[_0xa976('0x14')][_0xa976('0x13')]);}})['catch'](function(_0xf5f9b){logger[_0xa976('0x10')](_0xa976('0x12'),_0x3a4a2,_0xf5f9b);_0xc3661d(_0xf5f9b);});});}exports['CreateVoiceDialReport']=function(_0x4848d8){var _0x3f2cd5=this;return new Promise(function(_0x36b47a,_0x3ca2dd){return db[_0xa976('0x15')][_0xa976('0x16')](_0x4848d8['body'],{'raw':_0x4848d8[_0xa976('0x17')]?_0x4848d8[_0xa976('0x17')][_0xa976('0x18')]===undefined?!![]:![]:!![]})[_0xa976('0xb')](function(_0x44f7d4){logger['info']('CreateVoiceDialReport',_0x4848d8);logger[_0xa976('0x19')](_0xa976('0x1a'),_0x4848d8,JSON['stringify'](_0x44f7d4));_0x36b47a(_0x44f7d4);})[_0xa976('0x1b')](function(_0x4f60ff){logger['error'](_0xa976('0x1a'),_0x4f60ff[_0xa976('0x13')],_0x4848d8);_0x3ca2dd(_0x3f2cd5[_0xa976('0x10')](0x1f4,_0x4f60ff[_0xa976('0x13')]));});});};exports[_0xa976('0x1c')]=function(_0xe572fe){var _0x31231f=this;return new Promise(function(_0x54b5ba,_0x5a2f6f){return db['VoiceDialReport'][_0xa976('0x1d')](_0xe572fe[_0xa976('0x1e')],{'raw':_0xe572fe[_0xa976('0x17')]?_0xe572fe['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe572fe[_0xa976('0x17')]?_0xe572fe[_0xa976('0x17')][_0xa976('0x1f')]||null:null,'attributes':_0xe572fe[_0xa976('0x17')]?_0xe572fe[_0xa976('0x17')][_0xa976('0x20')]||null:null,'limit':_0xe572fe[_0xa976('0x17')]?_0xe572fe[_0xa976('0x17')]['limit']||null:null})['then'](function(_0x52c58b){logger[_0xa976('0xc')]('UpdateVoiceDialReport',_0xe572fe);logger['debug'](_0xa976('0x1c'),_0xe572fe,JSON['stringify'](_0x52c58b));_0x54b5ba(_0x52c58b);})[_0xa976('0x1b')](function(_0x100a24){logger[_0xa976('0x10')](_0xa976('0x1c'),_0x100a24['message'],_0xe572fe);_0x5a2f6f(_0x31231f['error'](0x1f4,_0x100a24[_0xa976('0x13')]));});});}; \ No newline at end of file +var _0x4f99=['message','result','create','body','options','raw','CreateVoiceDialReport','VoiceDialReport','update','attributes','limit','UpdateVoiceDialReport','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f99,0x157));var _0x94f9=function(_0xe6055a,_0x51b582){_0xe6055a=_0xe6055a-0x0;var _0x66d236=_0x4f99[_0xe6055a];return _0x66d236;};'use strict';var _=require(_0x94f9('0x0'));var util=require(_0x94f9('0x1'));var moment=require('moment');var BPromise=require(_0x94f9('0x2'));var rs=require(_0x94f9('0x3'));var fs=require('fs');var Redis=require(_0x94f9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x94f9('0x5'));var logger=require(_0x94f9('0x6'))('rpc');var config=require(_0x94f9('0x7'));var jayson=require(_0x94f9('0x8'));var client=jayson[_0x94f9('0x9')][_0x94f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36bfd9,_0x484a54,_0x1e4823){return new BPromise(function(_0x5a4301,_0x3550f0){return client['request'](_0x36bfd9,_0x1e4823)[_0x94f9('0xb')](function(_0x50af31){logger[_0x94f9('0xc')](_0x94f9('0xd'),_0x484a54,_0x94f9('0xe'));logger[_0x94f9('0xf')](_0x94f9('0x10'),_0x484a54,_0x94f9('0xe'),JSON[_0x94f9('0x11')](_0x50af31));if(_0x50af31['error']){if(_0x50af31[_0x94f9('0x12')][_0x94f9('0x13')]===0x1f4){logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);return _0x3550f0(_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);}logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);return _0x5a4301(_0x50af31[_0x94f9('0x12')][_0x94f9('0x14')]);}else{logger[_0x94f9('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x484a54,_0x94f9('0xe'));_0x5a4301(_0x50af31[_0x94f9('0x15')][_0x94f9('0x14')]);}})['catch'](function(_0x490841){logger[_0x94f9('0x12')](_0x94f9('0xd'),_0x484a54,_0x490841);_0x3550f0(_0x490841);});});}exports['CreateVoiceDialReport']=function(_0x2d1f09){var _0x5b0e86=this;return new Promise(function(_0x2f3ded,_0x46372b){return db['VoiceDialReport'][_0x94f9('0x16')](_0x2d1f09[_0x94f9('0x17')],{'raw':_0x2d1f09[_0x94f9('0x18')]?_0x2d1f09[_0x94f9('0x18')][_0x94f9('0x19')]===undefined?!![]:![]:!![]})[_0x94f9('0xb')](function(_0x4b9051){logger[_0x94f9('0xc')]('CreateVoiceDialReport',_0x2d1f09);logger['debug'](_0x94f9('0x1a'),_0x2d1f09,JSON[_0x94f9('0x11')](_0x4b9051));_0x2f3ded(_0x4b9051);})['catch'](function(_0x8dca1c){logger[_0x94f9('0x12')](_0x94f9('0x1a'),_0x8dca1c[_0x94f9('0x14')],_0x2d1f09);_0x46372b(_0x5b0e86[_0x94f9('0x12')](0x1f4,_0x8dca1c[_0x94f9('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x35851e){var _0x152f40=this;return new Promise(function(_0x16f655,_0x267216){return db[_0x94f9('0x1b')][_0x94f9('0x1c')](_0x35851e['body'],{'raw':_0x35851e['options']?_0x35851e['options'][_0x94f9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35851e['options']?_0x35851e['options']['where']||null:null,'attributes':_0x35851e[_0x94f9('0x18')]?_0x35851e[_0x94f9('0x18')][_0x94f9('0x1d')]||null:null,'limit':_0x35851e[_0x94f9('0x18')]?_0x35851e[_0x94f9('0x18')][_0x94f9('0x1e')]||null:null})['then'](function(_0x4a6e12){logger[_0x94f9('0xc')](_0x94f9('0x1f'),_0x35851e);logger['debug'](_0x94f9('0x1f'),_0x35851e,JSON[_0x94f9('0x11')](_0x4a6e12));_0x16f655(_0x4a6e12);})[_0x94f9('0x20')](function(_0x20984c){logger[_0x94f9('0x12')](_0x94f9('0x1f'),_0x20984c[_0x94f9('0x14')],_0x35851e);_0x267216(_0x152f40['error'](0x1f4,_0x20984c[_0x94f9('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 78bd47d..5c1ca71 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 _0x30fc=['../../components/auth/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','show','post','create','/:id/applications','addApplications','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x30fc,0x64));var _0xc30f=function(_0x1ad7fc,_0x444145){_0x1ad7fc=_0x1ad7fc-0x0;var _0x3bb433=_0x30fc[_0x1ad7fc];return _0x3bb433;};'use strict';var multer=require(_0xc30f('0x0'));var util=require(_0xc30f('0x1'));var path=require('path');var timeout=require(_0xc30f('0x2'));var express=require(_0xc30f('0x3'));var router=express[_0xc30f('0x4')]();var auth=require(_0xc30f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc30f('0x6'));var controller=require(_0xc30f('0x7'));router[_0xc30f('0x8')]('/',auth[_0xc30f('0x9')](),controller[_0xc30f('0xa')]);router[_0xc30f('0x8')]('/:id',auth[_0xc30f('0x9')](),controller[_0xc30f('0xb')]);router[_0xc30f('0xc')]('/',auth[_0xc30f('0x9')](),controller[_0xc30f('0xd')]);router[_0xc30f('0xc')](_0xc30f('0xe'),auth[_0xc30f('0x9')](),controller[_0xc30f('0xf')]);router['put'](_0xc30f('0x10'),auth['isAuthenticated'](),controller[_0xc30f('0x11')]);router[_0xc30f('0x12')](_0xc30f('0x10'),auth[_0xc30f('0x9')](),controller[_0xc30f('0x13')]);module[_0xc30f('0x14')]=router; \ No newline at end of file +var _0x390a=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','post','/:id/applications','update','exports','multer','util','path'];(function(_0x342116,_0x51b80a){var _0x166870=function(_0x550702){while(--_0x550702){_0x342116['push'](_0x342116['shift']());}};_0x166870(++_0x51b80a);}(_0x390a,0xc9));var _0xa390=function(_0x484fbe,_0x322832){_0x484fbe=_0x484fbe-0x0;var _0x2f9ebb=_0x390a[_0x484fbe];return _0x2f9ebb;};'use strict';var multer=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var path=require(_0xa390('0x2'));var timeout=require(_0xa390('0x3'));var express=require('express');var router=express[_0xa390('0x4')]();var auth=require(_0xa390('0x5'));var interaction=require(_0xa390('0x6'));var config=require(_0xa390('0x7'));var controller=require('./voiceExtension.controller');router[_0xa390('0x8')]('/',auth[_0xa390('0x9')](),controller[_0xa390('0xa')]);router['get'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller['show']);router['post']('/',auth[_0xa390('0x9')](),controller[_0xa390('0xc')]);router[_0xa390('0xd')](_0xa390('0xe'),auth[_0xa390('0x9')](),controller['addApplications']);router['put'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller[_0xa390('0xf')]);router['delete'](_0xa390('0xb'),auth[_0xa390('0x9')](),controller['destroy']);module[_0xa390('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 64f63c5..4e7d385 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 _0xeb74=['getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','outbound','inbound-fax','outbound-fax','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0xdf36fe,_0x3ee414){var _0x4ddbcf=function(_0x386eab){while(--_0x386eab){_0xdf36fe['push'](_0xdf36fe['shift']());}};_0x4ddbcf(++_0x3ee414);}(_0xeb74,0xe3));var _0x4eb7=function(_0x4e51ee,_0x3ab85b){_0x4e51ee=_0x4e51ee-0x0;var _0x2d816f=_0xeb74[_0x4e51ee];return _0x2d816f;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'context':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'unique':_0x4eb7('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'unique':_0x4eb7('0x3')},'priority':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'defaultValue':_0x4eb7('0x4')},'appdata':{'type':Sequelize[_0x4eb7('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4eb7('0x5')]('inbound',_0x4eb7('0x6'),'internal',_0x4eb7('0x7'),_0x4eb7('0x8'),'system','any'),'allowNull':![]},'description':{'type':Sequelize[_0x4eb7('0x2')]},'interval':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x4eb7('0x9')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4eb7('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x4eb7('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':_0x4eb7('0xb')},'answer':{'type':Sequelize[_0x4eb7('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x4eb7('0xc')],'get':function(_0x35fa89){return this[_0x4eb7('0xd')](_0x4eb7('0xe'));}}}; \ No newline at end of file +var _0x9354=['NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','any','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','exports','STRING','compositeIndex'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x9354,0x96));var _0x4935=function(_0x494a42,_0x1f2103){_0x494a42=_0x494a42-0x0;var _0x254792=_0x9354[_0x494a42];return _0x254792;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'context':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'unique':_0x4935('0x2')},'priority':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x4935('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'defaultValue':_0x4935('0x3')},'appdata':{'type':Sequelize[_0x4935('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x4935('0x4')](_0x4935('0x5'),_0x4935('0x6'),_0x4935('0x7'),_0x4935('0x8'),_0x4935('0x9'),'system',_0x4935('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4935('0x1')],'allowNull':![],'defaultValue':_0x4935('0xb')},'IntervalId':{'type':Sequelize[_0x4935('0xc')]},'isApp':{'type':Sequelize[_0x4935('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x4935('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x4935('0x1')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0x4935('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x4935('0xe')],'get':function(_0x32916f){return this[_0x4935('0xf')](_0x4935('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 8f8da98..6707798 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 _0x7c31=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','sendStatus','error','stack','name','send','index','VoiceExtension','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','merge','field','options','includeAll','include','rows','params','rawAttributes','fields','catch','create','body','outbound','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','update','pick','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf'];(function(_0x2e235f,_0x5aa4f6){var _0x2e708a=function(_0x19c184){while(--_0x19c184){_0x2e235f['push'](_0x2e235f['shift']());}};_0x2e708a(++_0x5aa4f6);}(_0x7c31,0x68));var _0x17c3=function(_0x335751,_0x49c228){_0x335751=_0x335751-0x0;var _0x39077b=_0x7c31[_0x335751];return _0x39077b;};'use strict';var pdf=require(_0x17c3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x17c3('0x1'));var zipdir=require(_0x17c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x17c3('0x3'));var moment=require(_0x17c3('0x4'));var BPromise=require(_0x17c3('0x5'));var Mustache=require(_0x17c3('0x6'));var util=require(_0x17c3('0x7'));var path=require(_0x17c3('0x8'));var sox=require('sox');var csv=require(_0x17c3('0x9'));var ejs=require(_0x17c3('0xa'));var fs=require('fs');var _=require(_0x17c3('0xb'));var squel=require(_0x17c3('0xc'));var crypto=require(_0x17c3('0xd'));var jsforce=require(_0x17c3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x17c3('0x9'));var querystring=require(_0x17c3('0xf'));var Papa=require(_0x17c3('0x10'));var Redis=require(_0x17c3('0x11'));var authService=require(_0x17c3('0x12'));var qs=require(_0x17c3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x17c3('0x14'))(_0x17c3('0x15'));var utils=require(_0x17c3('0x16'));var config=require('../../config/environment');var db=require(_0x17c3('0x17'))['db'];config[_0x17c3('0x18')]=_[_0x17c3('0x19')](config['redis'],{'host':_0x17c3('0x1a'),'port':0x18eb});var socket=require(_0x17c3('0x1b'))(new Redis(config['redis']));require(_0x17c3('0x1c'))['register'](socket);function respondWithStatusCode(_0x278064,_0x42f64e){_0x42f64e=_0x42f64e||0xcc;return function(_0x4c31d4){if(_0x4c31d4){return _0x278064['sendStatus'](_0x42f64e);}return _0x278064[_0x17c3('0x1d')](_0x42f64e)[_0x17c3('0x1e')]();};}function respondWithResult(_0x584fd6,_0x5a79bb){_0x5a79bb=_0x5a79bb||0xc8;return function(_0x255030){if(_0x255030){return _0x584fd6[_0x17c3('0x1d')](_0x5a79bb)[_0x17c3('0x1f')](_0x255030);}};}function respondWithFilteredResult(_0x2ad53b,_0x51f09e){return function(_0x514077){if(_0x514077){var _0x124e47=_0x514077[_0x17c3('0x20')],_0x1862ae=_0x51f09e[_0x17c3('0x21')],_0x5abd9f=_0x51f09e['offset']+_0x51f09e[_0x17c3('0x22')],_0x740b03;if(_0x5abd9f>=_0x124e47){_0x5abd9f=_0x124e47;_0x740b03=0xc8;}else{_0x740b03=0xce;}_0x2ad53b[_0x17c3('0x1d')](_0x740b03);return _0x2ad53b['set'](_0x17c3('0x23'),_0x1862ae+'-'+_0x5abd9f+'/'+_0x124e47)[_0x17c3('0x1f')](_0x514077);}return null;};}function patchUpdates(_0x575d96){return function(_0x4734ee){try{jsonpatch[_0x17c3('0x24')](_0x4734ee,_0x575d96,!![]);}catch(_0x3c5200){return BPromise[_0x17c3('0x25')](_0x3c5200);}return _0x4734ee['save']();};}function saveUpdates(_0x2dabb6,_0xd39efe){return function(_0x5dd7b2){if(_0x5dd7b2){return _0x5dd7b2['update'](_0x2dabb6)[_0x17c3('0x26')](function(_0x33c03a){return _0x33c03a;});}return null;};}function removeEntity(_0x20c2c7,_0x39c4bb){return function(_0x33e868){if(_0x33e868){return _0x33e868[_0x17c3('0x27')]()['then'](function(){var _0xcdf6e8=_0x33e868[_0x17c3('0x28')]({'plain':!![]});var _0x5a3901=[{'name':_0x17c3('0x29'),'value':_0x17c3('0x2a'),'ignore':![]},{'name':_0x17c3('0x2b'),'value':'outbound','ignore':![]},{'name':_0x17c3('0x2c'),'value':_0x17c3('0x2d'),'ignore':![]}];var _0x5eb73b=_(_0x5a3901)[_0x17c3('0x2e')](_0x17c3('0x2f'))[_0x17c3('0x30')](_0x17c3('0x31'))['value']();if(_[_0x17c3('0x32')](_0x5eb73b,_0xcdf6e8[_0x17c3('0x33')])){return;}var _0x14b7cf=_[_0x17c3('0x34')](_0x5a3901,['value',_0xcdf6e8[_0x17c3('0x33')]])['name'];return db[_0x17c3('0x35')][_0x17c3('0x27')]({'where':{'type':_0x14b7cf,'resourceId':_0xcdf6e8['id']}})[_0x17c3('0x26')](function(){return _0x33e868;});})[_0x17c3('0x26')](function(){_0x20c2c7[_0x17c3('0x1d')](0xcc)[_0x17c3('0x1e')]();});}};}function handleEntityNotFound(_0x3cb84d,_0x2afca9){return function(_0x5cfce1){if(!_0x5cfce1){_0x3cb84d[_0x17c3('0x36')](0x194);}return _0x5cfce1;};}function handleError(_0x597666,_0xdc518a){_0xdc518a=_0xdc518a||0x1f4;return function(_0x358bab){logger[_0x17c3('0x37')](_0x358bab[_0x17c3('0x38')]);if(_0x358bab[_0x17c3('0x39')]){delete _0x358bab[_0x17c3('0x39')];}_0x597666[_0x17c3('0x1d')](_0xdc518a)[_0x17c3('0x3a')](_0x358bab);};}exports[_0x17c3('0x3b')]=function(_0x24a7a4,_0x33aa55){var _0x435894={},_0x4b26dc={},_0x355256={'count':0x0,'rows':[]};var _0x11a563=db[_0x17c3('0x3c')]['rawAttributes'];_0x4b26dc[_0x17c3('0x3d')]=_[_0x17c3('0x3e')](_0x11a563);_0x4b26dc[_0x17c3('0x3f')]=_[_0x17c3('0x3e')](_0x24a7a4['query']);_0x4b26dc[_0x17c3('0x40')]=_[_0x17c3('0x41')](_0x4b26dc['model'],_0x4b26dc['query']);_0x435894['attributes']=_[_0x17c3('0x41')](_0x4b26dc[_0x17c3('0x3d')],qs['fields'](_0x24a7a4['query']['fields']));_0x435894['attributes']=_0x435894[_0x17c3('0x42')][_0x17c3('0x43')]?_0x435894[_0x17c3('0x42')]:_0x4b26dc[_0x17c3('0x3d')];if(!_0x24a7a4[_0x17c3('0x3f')][_0x17c3('0x44')]('nolimit')){_0x435894[_0x17c3('0x22')]=qs['limit'](_0x24a7a4[_0x17c3('0x3f')][_0x17c3('0x22')]);_0x435894[_0x17c3('0x21')]=qs[_0x17c3('0x21')](_0x24a7a4[_0x17c3('0x3f')][_0x17c3('0x21')]);}_0x435894[_0x17c3('0x45')]=qs['sort'](_0x24a7a4[_0x17c3('0x3f')][_0x17c3('0x46')]);_0x435894[_0x17c3('0x47')]=qs[_0x17c3('0x40')](_['pick'](_0x24a7a4[_0x17c3('0x3f')],_0x4b26dc[_0x17c3('0x40')]));if(_0x24a7a4[_0x17c3('0x3f')][_0x17c3('0x2e')]){_0x435894['where']=_[_0x17c3('0x48')](_0x435894[_0x17c3('0x47')],{'$or':_[_0x17c3('0x30')](_0x11a563,function(_0x4acc16){if(_0x4acc16[_0x17c3('0x33')]['key']!=='VIRTUAL'){var _0x34e5c1={};_0x34e5c1[_0x4acc16[_0x17c3('0x49')]]={'$like':'%'+_0x24a7a4[_0x17c3('0x3f')][_0x17c3('0x2e')]+'%'};return _0x34e5c1;}})});}_0x435894=_[_0x17c3('0x48')]({},_0x435894,_0x24a7a4[_0x17c3('0x4a')]);var _0x5a259c={'where':_0x435894[_0x17c3('0x47')]};return db[_0x17c3('0x3c')][_0x17c3('0x20')](_0x5a259c)[_0x17c3('0x26')](function(_0x5cb3e4){_0x355256[_0x17c3('0x20')]=_0x5cb3e4;if(_0x24a7a4['query'][_0x17c3('0x4b')]){_0x435894[_0x17c3('0x4c')]=[{'all':!![]}];}return db[_0x17c3('0x3c')]['findAll'](_0x435894);})[_0x17c3('0x26')](function(_0x2e6f9a){_0x355256[_0x17c3('0x4d')]=_0x2e6f9a;return _0x355256;})[_0x17c3('0x26')](respondWithFilteredResult(_0x33aa55,_0x435894))['catch'](handleError(_0x33aa55,null));};exports['show']=function(_0x795601,_0x50b1d8){var _0x5017c8={'raw':![],'where':{'id':_0x795601[_0x17c3('0x4e')]['id']}},_0x36c765={};_0x36c765['model']=_[_0x17c3('0x3e')](db[_0x17c3('0x3c')][_0x17c3('0x4f')]);_0x36c765[_0x17c3('0x3f')]=_['keys'](_0x795601[_0x17c3('0x3f')]);_0x36c765[_0x17c3('0x40')]=_['intersection'](_0x36c765[_0x17c3('0x3d')],_0x36c765[_0x17c3('0x3f')]);_0x5017c8[_0x17c3('0x42')]=_[_0x17c3('0x41')](_0x36c765[_0x17c3('0x3d')],qs[_0x17c3('0x50')](_0x795601[_0x17c3('0x3f')][_0x17c3('0x50')]));_0x5017c8[_0x17c3('0x42')]=_0x5017c8[_0x17c3('0x42')][_0x17c3('0x43')]?_0x5017c8['attributes']:_0x36c765[_0x17c3('0x3d')];if(_0x795601['query'][_0x17c3('0x4b')]){_0x5017c8[_0x17c3('0x4c')]=[{'all':!![]}];}_0x5017c8=_['merge']({},_0x5017c8,_0x795601[_0x17c3('0x4a')]);return db[_0x17c3('0x3c')][_0x17c3('0x34')](_0x5017c8)[_0x17c3('0x26')](handleEntityNotFound(_0x50b1d8,null))[_0x17c3('0x26')](respondWithResult(_0x50b1d8,null))[_0x17c3('0x51')](handleError(_0x50b1d8,null));};exports['destroy']=function(_0x112938,_0x2f425a){return db[_0x17c3('0x3c')][_0x17c3('0x34')]({'where':{'id':_0x112938['params']['id']}})[_0x17c3('0x26')](handleEntityNotFound(_0x2f425a,null))['then'](removeEntity(_0x2f425a,null))[_0x17c3('0x51')](handleError(_0x2f425a,null));};exports[_0x17c3('0x52')]=function(_0x28b312,_0xaae746){if(_0x28b312[_0x17c3('0x53')][_0x17c3('0x33')]===_0x17c3('0x54')&&!_[_0x17c3('0x55')](_0x28b312[_0x17c3('0x53')][_0x17c3('0x56')],'_')){_0x28b312['body']['exten']='_'[_0x17c3('0x57')](_0x28b312[_0x17c3('0x53')]['exten']);}return db[_0x17c3('0x3c')][_0x17c3('0x52')](_0x28b312[_0x17c3('0x53')],{'raw':![]})[_0x17c3('0x26')](function(_0x4a9bb0){var _0x592094=_0x28b312['user'][_0x17c3('0x28')]({'plain':!![]});if(!_0x592094)throw new Error(_0x17c3('0x58'));if(_0x592094[_0x17c3('0x59')]===_0x17c3('0x5a')){var _0x12e4bc=_0x4a9bb0[_0x17c3('0x28')]({'plain':!![]});var _0x4af42d=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x17c3('0x2b'),'value':'outbound'},{'name':_0x17c3('0x2c'),'value':'internal'}];var _0x5a8883=_[_0x17c3('0x34')](_0x4af42d,['value',_0x12e4bc['type']])[_0x17c3('0x39')];return db['UserProfileSection'][_0x17c3('0x34')]({'where':{'name':_0x5a8883,'userProfileId':_0x592094[_0x17c3('0x5b')]},'raw':!![]})[_0x17c3('0x26')](function(_0x5b1844){if(_0x5b1844&&_0x5b1844[_0x17c3('0x5c')]===0x0){return db[_0x17c3('0x35')]['create']({'name':_0x12e4bc[_0x17c3('0x39')],'resourceId':_0x12e4bc['id'],'type':_0x5b1844[_0x17c3('0x39')],'sectionId':_0x5b1844['id']},{})[_0x17c3('0x26')](function(){return _0x4a9bb0;});}else{return _0x4a9bb0;}})[_0x17c3('0x51')](function(_0x464868){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x464868);throw _0x464868;});}return _0x4a9bb0;})[_0x17c3('0x26')](respondWithResult(_0xaae746,0xc9))['catch'](handleError(_0xaae746,null));};exports[_0x17c3('0x5d')]=function(_0x2eda50,_0x58e637){if(_0x2eda50[_0x17c3('0x53')]['id']){delete _0x2eda50['body']['id'];}return db[_0x17c3('0x3c')][_0x17c3('0x34')]({'where':{'id':_0x2eda50[_0x17c3('0x4e')]['id']}})[_0x17c3('0x26')](handleEntityNotFound(_0x58e637,null))['then'](function(_0x880fe4){if(_0x880fe4){return db[_0x17c3('0x3c')]['update'](_[_0x17c3('0x5e')](_0x2eda50[_0x17c3('0x53')],['exten',_0x17c3('0x5f'),'description',_0x17c3('0x60'),_0x17c3('0x61'),_0x17c3('0x62')]),{'where':{'context':_0x880fe4[_0x17c3('0x5f')],'exten':_0x880fe4[_0x17c3('0x56')]},'individualHooks':!![]})[_0x17c3('0x26')](function(_0x4c7a4f){return _0x4c7a4f;});}return null;})[_0x17c3('0x26')](respondWithStatusCode(_0x58e637,null))[_0x17c3('0x51')](handleError(_0x58e637,null));};exports[_0x17c3('0x63')]=function(_0x59f2e6,_0x275a44,_0x3ed736){return db['VoiceExtension'][_0x17c3('0x64')]({'where':{'id':_0x59f2e6[_0x17c3('0x4e')]['id']}})['then'](handleEntityNotFound(_0x275a44,null))[_0x17c3('0x26')](function(_0x1a6e84){if(_0x1a6e84){return db['sequelize']['transaction'](function(_0x95af3a){return db[_0x17c3('0x3c')][_0x17c3('0x27')]({'where':{'VoiceExtensionId':_0x59f2e6[_0x17c3('0x4e')]['id']},'transaction':_0x95af3a})[_0x17c3('0x26')](function(_0x23a91a){var _0x156460=_[_0x17c3('0x30')](_0x59f2e6[_0x17c3('0x53')],function(_0x1c6142){_0x1c6142[_0x17c3('0x65')]=_0x59f2e6[_0x17c3('0x4e')]['id'];return _0x1c6142;});return db[_0x17c3('0x3c')][_0x17c3('0x66')](_0x156460,{'transaction':_0x95af3a});});})[_0x17c3('0x26')](function(){return db[_0x17c3('0x3c')][_0x17c3('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x59f2e6[_0x17c3('0x4e')]['id']},'order':_0x17c3('0x68')});});}})[_0x17c3('0x26')](respondWithResult(_0x275a44,null))['catch'](handleError(_0x275a44,null));}; \ No newline at end of file +var _0xc97f=['apply','reject','save','update','destroy','then','inbound','OutboundRoutes','InternalRoutes','internal','ignore','map','value','includes','type','UserProfileResource','error','stack','name','send','index','VoiceExtension','rawAttributes','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','key','field','options','includeAll','include','rows','catch','show','params','length','find','body','outbound','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','json','count','offset','limit','Content-Range'];(function(_0x4fdb24,_0x1cbee6){var _0x21abd1=function(_0x3e4c28){while(--_0x3e4c28){_0x4fdb24['push'](_0x4fdb24['shift']());}};_0x21abd1(++_0x1cbee6);}(_0xc97f,0xb0));var _0xfc97=function(_0xefebe8,_0x3c9675){_0xefebe8=_0xefebe8-0x0;var _0x1f0046=_0xc97f[_0xefebe8];return _0x1f0046;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc97('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfc97('0x1'));var rp=require(_0xfc97('0x2'));var moment=require('moment');var BPromise=require(_0xfc97('0x3'));var Mustache=require(_0xfc97('0x4'));var util=require(_0xfc97('0x5'));var path=require(_0xfc97('0x6'));var sox=require('sox');var csv=require(_0xfc97('0x7'));var ejs=require(_0xfc97('0x8'));var fs=require('fs');var _=require(_0xfc97('0x9'));var squel=require(_0xfc97('0xa'));var crypto=require(_0xfc97('0xb'));var jsforce=require(_0xfc97('0xc'));var deskjs=require(_0xfc97('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfc97('0xe'));var authService=require(_0xfc97('0xf'));var qs=require(_0xfc97('0x10'));var hardwareService=require(_0xfc97('0x11'));var logger=require('../../config/logger')(_0xfc97('0x12'));var utils=require(_0xfc97('0x13'));var config=require(_0xfc97('0x14'));var db=require(_0xfc97('0x15'))['db'];config['redis']=_[_0xfc97('0x16')](config[_0xfc97('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc97('0x18'))(new Redis(config['redis']));require(_0xfc97('0x19'))['register'](socket);function respondWithStatusCode(_0x3d9c8c,_0x32e2c0){_0x32e2c0=_0x32e2c0||0xcc;return function(_0x4bad2b){if(_0x4bad2b){return _0x3d9c8c[_0xfc97('0x1a')](_0x32e2c0);}return _0x3d9c8c[_0xfc97('0x1b')](_0x32e2c0)[_0xfc97('0x1c')]();};}function respondWithResult(_0x3200c9,_0x592bf2){_0x592bf2=_0x592bf2||0xc8;return function(_0x5c0bbf){if(_0x5c0bbf){return _0x3200c9[_0xfc97('0x1b')](_0x592bf2)[_0xfc97('0x1d')](_0x5c0bbf);}};}function respondWithFilteredResult(_0x311a27,_0x53a720){return function(_0x5c1bcb){if(_0x5c1bcb){var _0x506cbe=_0x5c1bcb[_0xfc97('0x1e')],_0x3cf127=_0x53a720[_0xfc97('0x1f')],_0x340071=_0x53a720['offset']+_0x53a720[_0xfc97('0x20')],_0x133848;if(_0x340071>=_0x506cbe){_0x340071=_0x506cbe;_0x133848=0xc8;}else{_0x133848=0xce;}_0x311a27['status'](_0x133848);return _0x311a27['set'](_0xfc97('0x21'),_0x3cf127+'-'+_0x340071+'/'+_0x506cbe)[_0xfc97('0x1d')](_0x5c1bcb);}return null;};}function patchUpdates(_0x27c789){return function(_0x23a727){try{jsonpatch[_0xfc97('0x22')](_0x23a727,_0x27c789,!![]);}catch(_0x299bd3){return BPromise[_0xfc97('0x23')](_0x299bd3);}return _0x23a727[_0xfc97('0x24')]();};}function saveUpdates(_0x36df40,_0x546f23){return function(_0x2cf679){if(_0x2cf679){return _0x2cf679[_0xfc97('0x25')](_0x36df40)['then'](function(_0x462a47){return _0x462a47;});}return null;};}function removeEntity(_0x46d233,_0x5ea573){return function(_0x55693c){if(_0x55693c){return _0x55693c[_0xfc97('0x26')]()[_0xfc97('0x27')](function(){var _0x1e8340=_0x55693c['get']({'plain':!![]});var _0x1c8cb4=[{'name':'InboundRoutes','value':_0xfc97('0x28'),'ignore':![]},{'name':_0xfc97('0x29'),'value':'outbound','ignore':![]},{'name':_0xfc97('0x2a'),'value':_0xfc97('0x2b'),'ignore':![]}];var _0x811c86=_(_0x1c8cb4)['filter'](_0xfc97('0x2c'))[_0xfc97('0x2d')]('value')[_0xfc97('0x2e')]();if(_[_0xfc97('0x2f')](_0x811c86,_0x1e8340['type'])){return;}var _0x2d29dc=_['find'](_0x1c8cb4,[_0xfc97('0x2e'),_0x1e8340[_0xfc97('0x30')]])['name'];return db[_0xfc97('0x31')][_0xfc97('0x26')]({'where':{'type':_0x2d29dc,'resourceId':_0x1e8340['id']}})[_0xfc97('0x27')](function(){return _0x55693c;});})[_0xfc97('0x27')](function(){_0x46d233['status'](0xcc)[_0xfc97('0x1c')]();});}};}function handleEntityNotFound(_0xb0f5d2,_0x3e69b9){return function(_0x19dc43){if(!_0x19dc43){_0xb0f5d2[_0xfc97('0x1a')](0x194);}return _0x19dc43;};}function handleError(_0x2bf631,_0x13f7c4){_0x13f7c4=_0x13f7c4||0x1f4;return function(_0x3039fb){logger[_0xfc97('0x32')](_0x3039fb[_0xfc97('0x33')]);if(_0x3039fb[_0xfc97('0x34')]){delete _0x3039fb['name'];}_0x2bf631[_0xfc97('0x1b')](_0x13f7c4)[_0xfc97('0x35')](_0x3039fb);};}exports[_0xfc97('0x36')]=function(_0x37c0b3,_0x25e517){var _0x4df3e4={},_0xcc0eaa={},_0x2c8bbf={'count':0x0,'rows':[]};var _0x1e8e90=db[_0xfc97('0x37')][_0xfc97('0x38')];_0xcc0eaa[_0xfc97('0x39')]=_[_0xfc97('0x3a')](_0x1e8e90);_0xcc0eaa[_0xfc97('0x3b')]=_[_0xfc97('0x3a')](_0x37c0b3[_0xfc97('0x3b')]);_0xcc0eaa[_0xfc97('0x3c')]=_['intersection'](_0xcc0eaa[_0xfc97('0x39')],_0xcc0eaa[_0xfc97('0x3b')]);_0x4df3e4[_0xfc97('0x3d')]=_[_0xfc97('0x3e')](_0xcc0eaa[_0xfc97('0x39')],qs['fields'](_0x37c0b3['query'][_0xfc97('0x3f')]));_0x4df3e4[_0xfc97('0x3d')]=_0x4df3e4[_0xfc97('0x3d')]['length']?_0x4df3e4[_0xfc97('0x3d')]:_0xcc0eaa['model'];if(!_0x37c0b3['query'][_0xfc97('0x40')](_0xfc97('0x41'))){_0x4df3e4[_0xfc97('0x20')]=qs[_0xfc97('0x20')](_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x20')]);_0x4df3e4[_0xfc97('0x1f')]=qs['offset'](_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x1f')]);}_0x4df3e4[_0xfc97('0x42')]=qs[_0xfc97('0x43')](_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x43')]);_0x4df3e4[_0xfc97('0x44')]=qs[_0xfc97('0x3c')](_['pick'](_0x37c0b3[_0xfc97('0x3b')],_0xcc0eaa[_0xfc97('0x3c')]));if(_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x45')]){_0x4df3e4[_0xfc97('0x44')]=_[_0xfc97('0x46')](_0x4df3e4[_0xfc97('0x44')],{'$or':_[_0xfc97('0x2d')](_0x1e8e90,function(_0x8a3e74){if(_0x8a3e74['type'][_0xfc97('0x47')]!=='VIRTUAL'){var _0x42de8a={};_0x42de8a[_0x8a3e74[_0xfc97('0x48')]]={'$like':'%'+_0x37c0b3[_0xfc97('0x3b')][_0xfc97('0x45')]+'%'};return _0x42de8a;}})});}_0x4df3e4=_[_0xfc97('0x46')]({},_0x4df3e4,_0x37c0b3[_0xfc97('0x49')]);var _0x40280a={'where':_0x4df3e4[_0xfc97('0x44')]};return db[_0xfc97('0x37')][_0xfc97('0x1e')](_0x40280a)[_0xfc97('0x27')](function(_0xdaed4d){_0x2c8bbf[_0xfc97('0x1e')]=_0xdaed4d;if(_0x37c0b3['query'][_0xfc97('0x4a')]){_0x4df3e4[_0xfc97('0x4b')]=[{'all':!![]}];}return db['VoiceExtension']['findAll'](_0x4df3e4);})['then'](function(_0x240bd){_0x2c8bbf[_0xfc97('0x4c')]=_0x240bd;return _0x2c8bbf;})[_0xfc97('0x27')](respondWithFilteredResult(_0x25e517,_0x4df3e4))[_0xfc97('0x4d')](handleError(_0x25e517,null));};exports[_0xfc97('0x4e')]=function(_0xb7d1c2,_0x579bb2){var _0x3ccaa7={'raw':![],'where':{'id':_0xb7d1c2[_0xfc97('0x4f')]['id']}},_0x11aa8c={};_0x11aa8c[_0xfc97('0x39')]=_[_0xfc97('0x3a')](db[_0xfc97('0x37')][_0xfc97('0x38')]);_0x11aa8c['query']=_[_0xfc97('0x3a')](_0xb7d1c2[_0xfc97('0x3b')]);_0x11aa8c[_0xfc97('0x3c')]=_[_0xfc97('0x3e')](_0x11aa8c[_0xfc97('0x39')],_0x11aa8c['query']);_0x3ccaa7[_0xfc97('0x3d')]=_[_0xfc97('0x3e')](_0x11aa8c[_0xfc97('0x39')],qs[_0xfc97('0x3f')](_0xb7d1c2[_0xfc97('0x3b')][_0xfc97('0x3f')]));_0x3ccaa7['attributes']=_0x3ccaa7['attributes'][_0xfc97('0x50')]?_0x3ccaa7[_0xfc97('0x3d')]:_0x11aa8c[_0xfc97('0x39')];if(_0xb7d1c2['query'][_0xfc97('0x4a')]){_0x3ccaa7[_0xfc97('0x4b')]=[{'all':!![]}];}_0x3ccaa7=_['merge']({},_0x3ccaa7,_0xb7d1c2[_0xfc97('0x49')]);return db[_0xfc97('0x37')]['find'](_0x3ccaa7)[_0xfc97('0x27')](handleEntityNotFound(_0x579bb2,null))['then'](respondWithResult(_0x579bb2,null))[_0xfc97('0x4d')](handleError(_0x579bb2,null));};exports[_0xfc97('0x26')]=function(_0x4a897a,_0x1e8d13){return db['VoiceExtension'][_0xfc97('0x51')]({'where':{'id':_0x4a897a[_0xfc97('0x4f')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x1e8d13,null))[_0xfc97('0x27')](removeEntity(_0x1e8d13,null))[_0xfc97('0x4d')](handleError(_0x1e8d13,null));};exports['create']=function(_0x145476,_0x553909){if(_0x145476[_0xfc97('0x52')][_0xfc97('0x30')]===_0xfc97('0x53')&&!_['startsWith'](_0x145476[_0xfc97('0x52')][_0xfc97('0x54')],'_')){_0x145476[_0xfc97('0x52')][_0xfc97('0x54')]='_'[_0xfc97('0x55')](_0x145476['body']['exten']);}return db[_0xfc97('0x37')]['create'](_0x145476[_0xfc97('0x52')],{'raw':![]})['then'](function(_0x2ec97d){var _0x49681c=_0x145476[_0xfc97('0x56')][_0xfc97('0x57')]({'plain':!![]});if(!_0x49681c)throw new Error(_0xfc97('0x58'));if(_0x49681c[_0xfc97('0x59')]===_0xfc97('0x56')){var _0x523511=_0x2ec97d[_0xfc97('0x57')]({'plain':!![]});var _0x100503=[{'name':'InboundRoutes','value':_0xfc97('0x28')},{'name':'OutboundRoutes','value':_0xfc97('0x53')},{'name':_0xfc97('0x2a'),'value':_0xfc97('0x2b')}];var _0x3c6887=_[_0xfc97('0x51')](_0x100503,[_0xfc97('0x2e'),_0x523511[_0xfc97('0x30')]])[_0xfc97('0x34')];return db[_0xfc97('0x5a')][_0xfc97('0x51')]({'where':{'name':_0x3c6887,'userProfileId':_0x49681c[_0xfc97('0x5b')]},'raw':!![]})['then'](function(_0x26ac2b){if(_0x26ac2b&&_0x26ac2b[_0xfc97('0x5c')]===0x0){return db['UserProfileResource'][_0xfc97('0x5d')]({'name':_0x523511[_0xfc97('0x34')],'resourceId':_0x523511['id'],'type':_0x26ac2b[_0xfc97('0x34')],'sectionId':_0x26ac2b['id']},{})['then'](function(){return _0x2ec97d;});}else{return _0x2ec97d;}})['catch'](function(_0x357fce){logger[_0xfc97('0x32')](_0xfc97('0x5e'),_0x357fce);throw _0x357fce;});}return _0x2ec97d;})['then'](respondWithResult(_0x553909,0xc9))[_0xfc97('0x4d')](handleError(_0x553909,null));};exports['update']=function(_0x3f2189,_0x2cee1f){if(_0x3f2189[_0xfc97('0x52')]['id']){delete _0x3f2189['body']['id'];}return db[_0xfc97('0x37')][_0xfc97('0x51')]({'where':{'id':_0x3f2189[_0xfc97('0x4f')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x2cee1f,null))[_0xfc97('0x27')](function(_0xef36e){if(_0xef36e){return db[_0xfc97('0x37')][_0xfc97('0x25')](_['pick'](_0x3f2189['body'],[_0xfc97('0x54'),_0xfc97('0x5f'),_0xfc97('0x60'),_0xfc97('0x61'),_0xfc97('0x62'),_0xfc97('0x63')]),{'where':{'context':_0xef36e[_0xfc97('0x5f')],'exten':_0xef36e['exten']},'individualHooks':!![]})['then'](function(_0x3f49d4){return _0x3f49d4;});}return null;})[_0xfc97('0x27')](respondWithStatusCode(_0x2cee1f,null))[_0xfc97('0x4d')](handleError(_0x2cee1f,null));};exports[_0xfc97('0x64')]=function(_0x5c854a,_0x1c66bb,_0x4951ab){return db[_0xfc97('0x37')]['findOne']({'where':{'id':_0x5c854a[_0xfc97('0x4f')]['id']}})[_0xfc97('0x27')](handleEntityNotFound(_0x1c66bb,null))[_0xfc97('0x27')](function(_0x258c97){if(_0x258c97){return db['sequelize'][_0xfc97('0x65')](function(_0x345c0d){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0x5c854a[_0xfc97('0x4f')]['id']},'transaction':_0x345c0d})[_0xfc97('0x27')](function(_0x3713a0){var _0x326039=_['map'](_0x5c854a[_0xfc97('0x52')],function(_0x12e59b){_0x12e59b[_0xfc97('0x66')]=_0x5c854a[_0xfc97('0x4f')]['id'];return _0x12e59b;});return db[_0xfc97('0x37')][_0xfc97('0x67')](_0x326039,{'transaction':_0x345c0d});});})[_0xfc97('0x27')](function(){return db[_0xfc97('0x37')][_0xfc97('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5c854a[_0xfc97('0x4f')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xfc97('0x27')](respondWithResult(_0x1c66bb,null))['catch'](handleError(_0x1c66bb,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 0e85dad..303ec3c 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 _0x31e3=['emit','hasOwnProperty','events','../../mysqldb','VoiceExtension','remove'];(function(_0x127187,_0x4f7f5c){var _0xcb9e8e=function(_0x2ed907){while(--_0x2ed907){_0x127187['push'](_0x127187['shift']());}};_0xcb9e8e(++_0x4f7f5c);}(_0x31e3,0xbc));var _0x331e=function(_0x566c34,_0xb3d07b){_0x566c34=_0x566c34-0x0;var _0x564a7c=_0x31e3[_0x566c34];return _0x564a7c;};'use strict';var EventEmitter=require(_0x331e('0x0'));var VoiceExtension=require(_0x331e('0x1'))['db'][_0x331e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x331e('0x3')};function emitEvent(_0x53141c){return function(_0x4cbc66,_0x15f876,_0x4d0223){VoiceExtensionEvents[_0x331e('0x4')](_0x53141c+':'+_0x4cbc66['id'],_0x4cbc66);VoiceExtensionEvents[_0x331e('0x4')](_0x53141c,_0x4cbc66);_0x4d0223(null);};}for(var e in events){if(events[_0x331e('0x5')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xe55d=['hasOwnProperty','../../mysqldb','VoiceExtension','setMaxListeners','save','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe55d,0x1db));var _0xde55=function(_0x2053ac,_0x2ecb7a){_0x2053ac=_0x2053ac-0x0;var _0x48aa7c=_0xe55d[_0x2053ac];return _0x48aa7c;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0xde55('0x0'))['db'][_0xde55('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xde55('0x2')](0x0);var events={'afterCreate':_0xde55('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x524122){return function(_0x130fca,_0x5c1aab,_0x1a05e8){VoiceExtensionEvents[_0xde55('0x4')](_0x524122+':'+_0x130fca['id'],_0x130fca);VoiceExtensionEvents['emit'](_0x524122,_0x130fca);_0x1a05e8(null);};}for(var e in events){if(events[_0xde55('0x5')](e)){var event=events[e];VoiceExtension['hook'](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 6ccc83c..9ba47a5 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 _0x47a0=['./voiceExtension.attributes','exports','define','VoiceExtension','voice_extensions','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x452de8,_0x47018a){var _0x20c012=function(_0x3429f2){while(--_0x3429f2){_0x452de8['push'](_0x452de8['shift']());}};_0x20c012(++_0x47018a);}(_0x47a0,0x15a));var _0x047a=function(_0x33d0e8,_0x3a6536){_0x33d0e8=_0x33d0e8-0x0;var _0x3ecc87=_0x47a0[_0x33d0e8];return _0x3ecc87;};'use strict';var _=require(_0x047a('0x0'));var util=require('util');var logger=require(_0x047a('0x1'))(_0x047a('0x2'));var moment=require(_0x047a('0x3'));var BPromise=require('bluebird');var rp=require(_0x047a('0x4'));var fs=require('fs');var path=require(_0x047a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x047a('0x6'));module[_0x047a('0x7')]=function(_0x1d60e1,_0x56908d){return _0x1d60e1[_0x047a('0x8')](_0x047a('0x9'),attributes,{'tableName':_0x047a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe96f=['util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','lodash'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0xe96f,0x199));var _0xfe96=function(_0x2d3e94,_0x5b5398){_0x2d3e94=_0x2d3e94-0x0;var _0x5ad0bf=_0xe96f[_0x2d3e94];return _0x5ad0bf;};'use strict';var _=require(_0xfe96('0x0'));var util=require(_0xfe96('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfe96('0x2'));var BPromise=require(_0xfe96('0x3'));var rp=require(_0xfe96('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfe96('0x5'));var config=require(_0xfe96('0x6'));var attributes=require(_0xfe96('0x7'));module[_0xfe96('0x8')]=function(_0x1c300f,_0x35947d){return _0x1c300f[_0xfe96('0x9')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 8fb3acf..d5ea77a 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 _0x4024=['info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','map','include','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','redis','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x4024,0x89));var _0x4402=function(_0x584b75,_0x4462bb){_0x584b75=_0x584b75-0x0;var _0x312200=_0x4024[_0x584b75];return _0x312200;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});config[_0x4402('0x9')]=_['defaults'](config[_0x4402('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4402('0x9')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x30fd34,_0x4f56aa,_0x1a4a47){return new BPromise(function(_0x4e1a7e,_0x34b4a6){return client['request'](_0x30fd34,_0x1a4a47)[_0x4402('0xa')](function(_0x251286){logger['info'](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));logger[_0x4402('0xd')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4f56aa,_0x4402('0xc'),JSON[_0x4402('0xe')](_0x251286));if(_0x251286[_0x4402('0xf')]){if(_0x251286[_0x4402('0xf')][_0x4402('0x10')]===0x1f4){logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x34b4a6(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}logger[_0x4402('0xf')](_0x4402('0xb'),_0x4f56aa,_0x251286[_0x4402('0xf')][_0x4402('0x11')]);return _0x4e1a7e(_0x251286[_0x4402('0xf')][_0x4402('0x11')]);}else{logger[_0x4402('0x12')](_0x4402('0xb'),_0x4f56aa,_0x4402('0xc'));_0x4e1a7e(_0x251286['result']['message']);}})[_0x4402('0x13')](function(_0x2a7afc){logger['error'](_0x4402('0xb'),_0x4f56aa,_0x2a7afc);_0x34b4a6(_0x2a7afc);});});}exports[_0x4402('0x14')]=function(_0x5cb0c5){var _0x38b459=this;return new Promise(function(_0x4e0340,_0x55cc8c){return db[_0x4402('0x15')][_0x4402('0x16')]({'raw':_0x5cb0c5[_0x4402('0x17')]?_0x5cb0c5['options'][_0x4402('0x18')]===undefined?!![]:![]:!![],'where':_0x5cb0c5['options']?_0x5cb0c5['options'][_0x4402('0x19')]||null:null,'attributes':_0x5cb0c5[_0x4402('0x17')]?_0x5cb0c5[_0x4402('0x17')][_0x4402('0x1a')]||null:null,'limit':_0x5cb0c5[_0x4402('0x17')]?_0x5cb0c5[_0x4402('0x17')][_0x4402('0x1b')]||null:null,'include':_0x5cb0c5[_0x4402('0x17')]?_0x5cb0c5[_0x4402('0x17')]['include']?_[_0x4402('0x1c')](_0x5cb0c5['options'][_0x4402('0x1d')],function(_0x5ab28d){return{'model':db[_0x5ab28d[_0x4402('0x1e')]],'as':_0x5ab28d['as'],'attributes':_0x5ab28d[_0x4402('0x1a')],'include':_0x5ab28d['include']?_[_0x4402('0x1c')](_0x5ab28d['include'],function(_0x59d52f){return{'model':db[_0x59d52f[_0x4402('0x1e')]],'as':_0x59d52f['as'],'attributes':_0x59d52f[_0x4402('0x1a')],'include':_0x59d52f[_0x4402('0x1d')]?_[_0x4402('0x1c')](_0x59d52f[_0x4402('0x1d')],function(_0x514e41){return{'model':db[_0x514e41[_0x4402('0x1e')]],'as':_0x514e41['as'],'attributes':_0x514e41['attributes']};}):[]};}):[]};}):[]:[]})[_0x4402('0xa')](function(_0x1e2340){logger[_0x4402('0x12')]('GetVoiceExtension',_0x5cb0c5);logger[_0x4402('0xd')](_0x4402('0x14'),_0x5cb0c5,JSON[_0x4402('0xe')](_0x1e2340));_0x4e0340(_0x1e2340);})[_0x4402('0x13')](function(_0x2526d1){logger[_0x4402('0xf')](_0x4402('0x14'),_0x2526d1[_0x4402('0x11')],_0x5cb0c5);_0x55cc8c(_0x38b459[_0x4402('0xf')](0x1f4,_0x2526d1[_0x4402('0x11')]));});});}; \ No newline at end of file +var _0x9ffd=['./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','include','map','model','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3e8201,_0x5eebdb){var _0x171226=function(_0x26872a){while(--_0x26872a){_0x3e8201['push'](_0x3e8201['shift']());}};_0x171226(++_0x5eebdb);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x3adda4,_0x4c0598){_0x3adda4=_0x3adda4-0x0;var _0x496381=_0x9ffd[_0x3adda4];return _0x496381;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});config[_0xd9ff('0xb')]=_[_0xd9ff('0xc')](config[_0xd9ff('0xb')],{'host':_0xd9ff('0xd'),'port':0x18eb});var socket=require(_0xd9ff('0xe'))(new Redis(config[_0xd9ff('0xb')]));require(_0xd9ff('0xf'))['register'](socket);function respondWithRpcPromise(_0x54a555,_0x567f79,_0x5aa954){return new BPromise(function(_0x2355ab,_0x2fd77a){return client[_0xd9ff('0x10')](_0x54a555,_0x5aa954)[_0xd9ff('0x11')](function(_0x37d2c0){logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x567f79,_0xd9ff('0x14'),JSON[_0xd9ff('0x15')](_0x37d2c0));if(_0x37d2c0[_0xd9ff('0x16')]){if(_0x37d2c0[_0xd9ff('0x16')][_0xd9ff('0x17')]===0x1f4){logger['error'](_0xd9ff('0x13'),_0x567f79,_0x37d2c0[_0xd9ff('0x16')]['message']);return _0x2fd77a(_0x37d2c0[_0xd9ff('0x16')]['message']);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x567f79,_0x37d2c0['error'][_0xd9ff('0x18')]);return _0x2355ab(_0x37d2c0['error'][_0xd9ff('0x18')]);}else{logger[_0xd9ff('0x12')](_0xd9ff('0x13'),_0x567f79,_0xd9ff('0x14'));_0x2355ab(_0x37d2c0[_0xd9ff('0x19')][_0xd9ff('0x18')]);}})[_0xd9ff('0x1a')](function(_0x128588){logger[_0xd9ff('0x16')](_0xd9ff('0x13'),_0x567f79,_0x128588);_0x2fd77a(_0x128588);});});}exports[_0xd9ff('0x1b')]=function(_0x39ef37){var _0x46a6ab=this;return new Promise(function(_0x4c8740,_0x4cf8ec){return db[_0xd9ff('0x1c')][_0xd9ff('0x1d')]({'raw':_0x39ef37['options']?_0x39ef37['options']['raw']===undefined?!![]:![]:!![],'where':_0x39ef37['options']?_0x39ef37[_0xd9ff('0x1e')]['where']||null:null,'attributes':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x1f')]||null:null,'limit':_0x39ef37[_0xd9ff('0x1e')]?_0x39ef37[_0xd9ff('0x1e')][_0xd9ff('0x20')]||null:null,'include':_0x39ef37['options']?_0x39ef37['options'][_0xd9ff('0x21')]?_['map'](_0x39ef37[_0xd9ff('0x1e')]['include'],function(_0x285002){return{'model':db[_0x285002['model']],'as':_0x285002['as'],'attributes':_0x285002[_0xd9ff('0x1f')],'include':_0x285002[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x285002[_0xd9ff('0x21')],function(_0x5d685e){return{'model':db[_0x5d685e[_0xd9ff('0x23')]],'as':_0x5d685e['as'],'attributes':_0x5d685e[_0xd9ff('0x1f')],'include':_0x5d685e[_0xd9ff('0x21')]?_[_0xd9ff('0x22')](_0x5d685e['include'],function(_0x1d3684){return{'model':db[_0x1d3684[_0xd9ff('0x23')]],'as':_0x1d3684['as'],'attributes':_0x1d3684[_0xd9ff('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd9ff('0x11')](function(_0x263d3a){logger[_0xd9ff('0x12')](_0xd9ff('0x1b'),_0x39ef37);logger[_0xd9ff('0x24')](_0xd9ff('0x1b'),_0x39ef37,JSON['stringify'](_0x263d3a));_0x4c8740(_0x263d3a);})[_0xd9ff('0x1a')](function(_0x4ba2be){logger[_0xd9ff('0x16')](_0xd9ff('0x1b'),_0x4ba2be[_0xd9ff('0x18')],_0x39ef37);_0x4cf8ec(_0x46a6ab['error'](0x1f4,_0x4ba2be[_0xd9ff('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 88656ba..59e89b2 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 _0xb60c=['length','voiceExtension:','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x4b9806,_0x1517c0){var _0x12f4d4=function(_0x2f0984){while(--_0x2f0984){_0x4b9806['push'](_0x4b9806['shift']());}};_0x12f4d4(++_0x1517c0);}(_0xb60c,0x1a2));var _0xcb60=function(_0x1ff7f0,_0x38a79f){_0x1ff7f0=_0x1ff7f0-0x0;var _0x52c479=_0xb60c[_0x1ff7f0];return _0x52c479;};'use strict';var VoiceExtensionEvents=require(_0xcb60('0x0'));var events=['save',_0xcb60('0x1'),_0xcb60('0x2')];function createListener(_0x4f3300,_0x3e3705){return function(_0x449beb){_0x3e3705[_0xcb60('0x3')](_0x4f3300,_0x449beb);};}function removeListener(_0x468119,_0x170c5e){return function(){VoiceExtensionEvents[_0xcb60('0x4')](_0x468119,_0x170c5e);};}exports[_0xcb60('0x5')]=function(_0x42ef18){for(var _0x2b7a2d=0x0,_0x3c7077=events[_0xcb60('0x6')];_0x2b7a2d<_0x3c7077;_0x2b7a2d++){var _0x44e136=events[_0x2b7a2d];var _0x31fd77=createListener(_0xcb60('0x7')+_0x44e136,_0x42ef18);VoiceExtensionEvents['on'](_0x44e136,_0x31fd77);}}; \ No newline at end of file +var _0xccbe=['save','remove','update','emit'];(function(_0x5f3f91,_0xfc0e59){var _0x15cc1d=function(_0x1ea56c){while(--_0x1ea56c){_0x5f3f91['push'](_0x5f3f91['shift']());}};_0x15cc1d(++_0xfc0e59);}(_0xccbe,0x188));var _0xeccb=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xccbe[_0x4c12ec];return _0x3ae42c;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xeccb('0x0'),_0xeccb('0x1'),_0xeccb('0x2')];function createListener(_0x47292c,_0x383101){return function(_0x4b05c0){_0x383101[_0xeccb('0x3')](_0x47292c,_0x4b05c0);};}function removeListener(_0x48bc6b,_0x58162f){return function(){VoiceExtensionEvents['removeListener'](_0x48bc6b,_0x58162f);};}exports['register']=function(_0xf60748){for(var _0x578a94=0x0,_0x5567c1=events['length'];_0x578a94<_0x5567c1;_0x578a94++){var _0x23871e=events[_0x578a94];var _0x3e2936=createListener('voiceExtension:'+_0x23871e,_0xf60748);VoiceExtensionEvents['on'](_0x23871e,_0x3e2936);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 9af4263..16f038c 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 _0x29d6=['post','update','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','/:id/messages','getMessages'];(function(_0x3917ad,_0x2caf3e){var _0x26c3ec=function(_0x4583d1){while(--_0x4583d1){_0x3917ad['push'](_0x3917ad['shift']());}};_0x26c3ec(++_0x2caf3e);}(_0x29d6,0x104));var _0x629d=function(_0x71a438,_0x4646b1){_0x71a438=_0x71a438-0x0;var _0x501dfc=_0x29d6[_0x71a438];return _0x501dfc;};'use strict';var multer=require(_0x629d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x629d('0x1'));var express=require('express');var router=express[_0x629d('0x2')]();var auth=require(_0x629d('0x3'));var interaction=require(_0x629d('0x4'));var config=require(_0x629d('0x5'));var controller=require(_0x629d('0x6'));router[_0x629d('0x7')]('/',auth[_0x629d('0x8')](),controller['index']);router[_0x629d('0x7')](_0x629d('0x9'),auth[_0x629d('0x8')](),controller['show']);router['get'](_0x629d('0xa'),auth[_0x629d('0x8')](),controller[_0x629d('0xb')]);router[_0x629d('0xc')]('/',auth[_0x629d('0x8')](),controller['create']);router['put'](_0x629d('0x9'),auth['isAuthenticated'](),controller[_0x629d('0xd')]);router['delete']('/:id',auth[_0x629d('0x8')](),controller[_0x629d('0xe')]);module[_0x629d('0xf')]=router; \ No newline at end of file +var _0xbf02=['isAuthenticated','get','/:id','show','/:id/messages','post','create','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5366bd,_0x14b8b8){var _0xc46787=function(_0x450fb1){while(--_0x450fb1){_0x5366bd['push'](_0x5366bd['shift']());}};_0xc46787(++_0x14b8b8);}(_0xbf02,0x1bb));var _0x2bf0=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xbf02[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x2bf0('0x0'));var path=require(_0x2bf0('0x1'));var timeout=require(_0x2bf0('0x2'));var express=require(_0x2bf0('0x3'));var router=express[_0x2bf0('0x4')]();var auth=require(_0x2bf0('0x5'));var interaction=require(_0x2bf0('0x6'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router['get']('/',auth[_0x2bf0('0x7')](),controller['index']);router[_0x2bf0('0x8')](_0x2bf0('0x9'),auth['isAuthenticated'](),controller[_0x2bf0('0xa')]);router[_0x2bf0('0x8')](_0x2bf0('0xb'),auth[_0x2bf0('0x7')](),controller['getMessages']);router[_0x2bf0('0xc')]('/',auth[_0x2bf0('0x7')](),controller[_0x2bf0('0xd')]);router['put'](_0x2bf0('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2bf0('0x9'),auth[_0x2bf0('0x7')](),controller[_0x2bf0('0xe')]);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 67b2ffe..6ce7dac 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 _0x4085=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize'];(function(_0x254257,_0x3bf85f){var _0x112ea9=function(_0x3b9c85){while(--_0x3b9c85){_0x254257['push'](_0x254257['shift']());}};_0x112ea9(++_0x3bf85f);}(_0x4085,0x167));var _0x5408=function(_0x321b26,_0x5c54b6){_0x321b26=_0x321b26-0x0;var _0x32c112=_0x4085[_0x321b26];return _0x32c112;};'use strict';var Sequelize=require(_0x5408('0x0'));module[_0x5408('0x1')]={'customer_id':{'type':Sequelize[_0x5408('0x2')]},'context':{'type':Sequelize[_0x5408('0x2')],'defaultValue':_0x5408('0x3'),'unique':_0x5408('0x4')},'mailbox':{'type':Sequelize[_0x5408('0x2')],'defaultValue':'','allowNull':![],'unique':_0x5408('0x4')},'password':{'type':Sequelize[_0x5408('0x2')]},'fullname':{'type':Sequelize[_0x5408('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x14fdc2){this[_0x5408('0x5')](_0x5408('0x6'),typeof _0x14fdc2===_0x5408('0x7')&&_0x14fdc2[_0x5408('0x8')]()?_0x14fdc2['trim']():null);}},'pager':{'type':Sequelize[_0x5408('0x2')]},'tz':{'type':Sequelize[_0x5408('0x2')],'defaultValue':_0x5408('0x9')},'attach':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':_0x5408('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5408('0xa')]('yes','no'),'defaultValue':_0x5408('0xb'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x5408('0x2')]},'review':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':_0x5408('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5408('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5408('0xa')](_0x5408('0xb'),'no'),'defaultValue':_0x5408('0xb'),'allowNull':![]},'stamp':{'type':_0x5408('0xc')},'emailsubject':{'type':Sequelize[_0x5408('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x5408('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5408('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5408('0xe')],'get':function(){return this[_0x5408('0xf')](_0x5408('0x10'))+'\x20-\x20'+this[_0x5408('0xf')](_0x5408('0x11'));}}}; \ No newline at end of file +var _0xa1b3=['mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20'];(function(_0x6deac7,_0x2d8aa4){var _0x23e545=function(_0x492df5){while(--_0x492df5){_0x6deac7['push'](_0x6deac7['shift']());}};_0x23e545(++_0x2d8aa4);}(_0xa1b3,0x1a3));var _0x3a1b=function(_0x13b3b8,_0x112fd7){_0x13b3b8=_0x13b3b8-0x0;var _0x438623=_0xa1b3[_0x13b3b8];return _0x438623;};'use strict';var Sequelize=require('sequelize');module[_0x3a1b('0x0')]={'customer_id':{'type':Sequelize[_0x3a1b('0x1')]},'context':{'type':Sequelize[_0x3a1b('0x1')],'defaultValue':_0x3a1b('0x2'),'unique':_0x3a1b('0x3')},'mailbox':{'type':Sequelize[_0x3a1b('0x1')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x3a1b('0x1')]},'email':{'type':Sequelize[_0x3a1b('0x1')],'validate':{'isEmail':!![]},'set':function(_0x41cc7c){this[_0x3a1b('0x4')](_0x3a1b('0x5'),typeof _0x41cc7c===_0x3a1b('0x6')&&_0x41cc7c[_0x3a1b('0x7')]()?_0x41cc7c['trim']():null);}},'pager':{'type':Sequelize[_0x3a1b('0x1')]},'tz':{'type':Sequelize[_0x3a1b('0x1')],'defaultValue':_0x3a1b('0x8')},'attach':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':_0x3a1b('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x3a1b('0x1')]},'callback':{'type':Sequelize[_0x3a1b('0x1')]},'review':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3a1b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3a1b('0xa')](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3a1b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3a1b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3a1b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3a1b('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x3a1b('0xc')},'emailsubject':{'type':Sequelize[_0x3a1b('0x1')]},'emailbody':{'type':Sequelize[_0x3a1b('0x1')]},'maxsecs':{'type':Sequelize[_0x3a1b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3a1b('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3a1b('0xe')],'get':function(){return this[_0x3a1b('0xf')](_0x3a1b('0x10'))+_0x3a1b('0x11')+this[_0x3a1b('0xf')](_0x3a1b('0x12'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 3f199e1..efe197e 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 _0x1c4d=['html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','status','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','sendStatus','name','send','VoiceMail','rawAttributes','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','type','field','filter','merge','options','includeAll','findAll','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','getMessages','findOne','VoiceMailMessage','map','mailbox','findAndCountAll'];(function(_0x3e7769,_0x1d6cda){var _0x148eb6=function(_0x201562){while(--_0x201562){_0x3e7769['push'](_0x3e7769['shift']());}};_0x148eb6(++_0x1d6cda);}(_0x1c4d,0x19f));var _0xd1c4=function(_0x391e93,_0x49957d){_0x391e93=_0x391e93-0x0;var _0x3fea23=_0x1c4d[_0x391e93];return _0x3fea23;};'use strict';var pdf=require(_0xd1c4('0x0'));var emlformat=require(_0xd1c4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd1c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd1c4('0x3'));var moment=require('moment');var BPromise=require(_0xd1c4('0x4'));var Mustache=require(_0xd1c4('0x5'));var util=require('util');var path=require(_0xd1c4('0x6'));var sox=require(_0xd1c4('0x7'));var csv=require('to-csv');var ejs=require(_0xd1c4('0x8'));var fs=require('fs');var _=require(_0xd1c4('0x9'));var squel=require(_0xd1c4('0xa'));var crypto=require(_0xd1c4('0xb'));var jsforce=require(_0xd1c4('0xc'));var deskjs=require(_0xd1c4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd1c4('0xe'));var Papa=require(_0xd1c4('0xf'));var Redis=require(_0xd1c4('0x10'));var authService=require(_0xd1c4('0x11'));var qs=require(_0xd1c4('0x12'));var hardwareService=require(_0xd1c4('0x13'));var logger=require('../../config/logger')(_0xd1c4('0x14'));var utils=require(_0xd1c4('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x297d96,_0x287662){_0x287662=_0x287662||0xcc;return function(_0x2450f3){if(_0x2450f3){return _0x297d96['sendStatus'](_0x287662);}return _0x297d96[_0xd1c4('0x16')](_0x287662)['end']();};}function respondWithResult(_0x4b8138,_0x1ebac7){_0x1ebac7=_0x1ebac7||0xc8;return function(_0xad3d6b){if(_0xad3d6b){return _0x4b8138[_0xd1c4('0x16')](_0x1ebac7)['json'](_0xad3d6b);}};}function respondWithFilteredResult(_0x32abbb,_0x1e345d){return function(_0x396335){if(_0x396335){var _0x59a4f7=_0x396335[_0xd1c4('0x17')],_0x55cf2e=_0x1e345d[_0xd1c4('0x18')],_0x3d387d=_0x1e345d['offset']+_0x1e345d[_0xd1c4('0x19')],_0x4a98b7;if(_0x3d387d>=_0x59a4f7){_0x3d387d=_0x59a4f7;_0x4a98b7=0xc8;}else{_0x4a98b7=0xce;}_0x32abbb[_0xd1c4('0x16')](_0x4a98b7);return _0x32abbb['set'](_0xd1c4('0x1a'),_0x55cf2e+'-'+_0x3d387d+'/'+_0x59a4f7)[_0xd1c4('0x1b')](_0x396335);}return null;};}function patchUpdates(_0x5f48c8){return function(_0x595e4b){try{jsonpatch[_0xd1c4('0x1c')](_0x595e4b,_0x5f48c8,!![]);}catch(_0x3b1541){return BPromise[_0xd1c4('0x1d')](_0x3b1541);}return _0x595e4b[_0xd1c4('0x1e')]();};}function saveUpdates(_0x3297ee,_0x56a202){return function(_0x56ad8d){if(_0x56ad8d){return _0x56ad8d[_0xd1c4('0x1f')](_0x3297ee)[_0xd1c4('0x20')](function(_0x2207ed){return _0x2207ed;});}return null;};}function removeEntity(_0x458289,_0x13d61d){return function(_0x273cb2){if(_0x273cb2){return _0x273cb2[_0xd1c4('0x21')]()[_0xd1c4('0x20')](function(){var _0x449f4b=_0x273cb2[_0xd1c4('0x22')]({'plain':!![]});var _0x3062ee=_0xd1c4('0x23');return db[_0xd1c4('0x24')][_0xd1c4('0x21')]({'where':{'type':_0x3062ee,'resourceId':_0x449f4b['id']}})[_0xd1c4('0x20')](function(){return _0x273cb2;});})[_0xd1c4('0x20')](function(){_0x458289[_0xd1c4('0x16')](0xcc)[_0xd1c4('0x25')]();});}};}function handleEntityNotFound(_0xb7bf65,_0x2765b1){return function(_0xaa157c){if(!_0xaa157c){_0xb7bf65[_0xd1c4('0x26')](0x194);}return _0xaa157c;};}function handleError(_0x5b4260,_0x4817a7){_0x4817a7=_0x4817a7||0x1f4;return function(_0x3ad863){logger['error'](_0x3ad863['stack']);if(_0x3ad863[_0xd1c4('0x27')]){delete _0x3ad863[_0xd1c4('0x27')];}_0x5b4260[_0xd1c4('0x16')](_0x4817a7)[_0xd1c4('0x28')](_0x3ad863);};}exports['index']=function(_0x33cdf6,_0x50b5a4){var _0x203f90={},_0x20cd53={},_0x356a90={'count':0x0,'rows':[]};var _0x3807cd=db[_0xd1c4('0x29')][_0xd1c4('0x2a')];_0x20cd53[_0xd1c4('0x2b')]=_['keys'](_0x3807cd);_0x20cd53[_0xd1c4('0x2c')]=_['keys'](_0x33cdf6[_0xd1c4('0x2c')]);_0x20cd53[_0xd1c4('0x2d')]=_[_0xd1c4('0x2e')](_0x20cd53['model'],_0x20cd53['query']);_0x203f90['attributes']=_[_0xd1c4('0x2e')](_0x20cd53[_0xd1c4('0x2b')],qs[_0xd1c4('0x2f')](_0x33cdf6[_0xd1c4('0x2c')][_0xd1c4('0x2f')]));_0x203f90['attributes']=_0x203f90[_0xd1c4('0x30')][_0xd1c4('0x31')]?_0x203f90['attributes']:_0x20cd53[_0xd1c4('0x2b')];if(!_0x33cdf6[_0xd1c4('0x2c')][_0xd1c4('0x32')](_0xd1c4('0x33'))){_0x203f90['limit']=qs[_0xd1c4('0x19')](_0x33cdf6[_0xd1c4('0x2c')][_0xd1c4('0x19')]);_0x203f90['offset']=qs[_0xd1c4('0x18')](_0x33cdf6[_0xd1c4('0x2c')]['offset']);}_0x203f90[_0xd1c4('0x34')]=qs['sort'](_0x33cdf6[_0xd1c4('0x2c')][_0xd1c4('0x35')]);_0x203f90['where']=qs[_0xd1c4('0x2d')](_[_0xd1c4('0x36')](_0x33cdf6['query'],_0x20cd53[_0xd1c4('0x2d')]));if(_0x33cdf6['query']['filter']){_0x203f90[_0xd1c4('0x37')]=_['merge'](_0x203f90[_0xd1c4('0x37')],{'$or':_['map'](_0x3807cd,function(_0xf2178e){if(_0xf2178e[_0xd1c4('0x38')]['key']!=='VIRTUAL'){var _0x393752={};_0x393752[_0xf2178e[_0xd1c4('0x39')]]={'$like':'%'+_0x33cdf6[_0xd1c4('0x2c')][_0xd1c4('0x3a')]+'%'};return _0x393752;}})});}_0x203f90=_[_0xd1c4('0x3b')]({},_0x203f90,_0x33cdf6[_0xd1c4('0x3c')]);var _0x3ef74e={'where':_0x203f90[_0xd1c4('0x37')]};return db['VoiceMail'][_0xd1c4('0x17')](_0x3ef74e)[_0xd1c4('0x20')](function(_0x2a741b){_0x356a90[_0xd1c4('0x17')]=_0x2a741b;if(_0x33cdf6[_0xd1c4('0x2c')][_0xd1c4('0x3d')]){_0x203f90['include']=[{'all':!![]}];}return db[_0xd1c4('0x29')][_0xd1c4('0x3e')](_0x203f90);})[_0xd1c4('0x20')](function(_0x53ada7){_0x356a90['rows']=_0x53ada7;return _0x356a90;})[_0xd1c4('0x20')](respondWithFilteredResult(_0x50b5a4,_0x203f90))[_0xd1c4('0x3f')](handleError(_0x50b5a4,null));};exports[_0xd1c4('0x40')]=function(_0x45a93b,_0xe5606){var _0x1a4cc1={'raw':!![],'where':{'id':_0x45a93b['params']['id']}},_0x22dfba={};_0x22dfba[_0xd1c4('0x2b')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x22dfba[_0xd1c4('0x2c')]=_[_0xd1c4('0x41')](_0x45a93b[_0xd1c4('0x2c')]);_0x22dfba['filters']=_[_0xd1c4('0x2e')](_0x22dfba[_0xd1c4('0x2b')],_0x22dfba[_0xd1c4('0x2c')]);_0x1a4cc1['attributes']=_[_0xd1c4('0x2e')](_0x22dfba[_0xd1c4('0x2b')],qs['fields'](_0x45a93b[_0xd1c4('0x2c')][_0xd1c4('0x2f')]));_0x1a4cc1[_0xd1c4('0x30')]=_0x1a4cc1['attributes'][_0xd1c4('0x31')]?_0x1a4cc1[_0xd1c4('0x30')]:_0x22dfba[_0xd1c4('0x2b')];if(_0x45a93b[_0xd1c4('0x2c')][_0xd1c4('0x3d')]){_0x1a4cc1['include']=[{'all':!![]}];}_0x1a4cc1=_[_0xd1c4('0x3b')]({},_0x1a4cc1,_0x45a93b['options']);return db['VoiceMail']['find'](_0x1a4cc1)[_0xd1c4('0x20')](handleEntityNotFound(_0xe5606,null))[_0xd1c4('0x20')](respondWithResult(_0xe5606,null))[_0xd1c4('0x3f')](handleError(_0xe5606,null));};exports[_0xd1c4('0x42')]=function(_0x3bd557,_0x316bcd){return db[_0xd1c4('0x29')]['create'](_0x3bd557[_0xd1c4('0x43')],{})[_0xd1c4('0x20')](function(_0x244548){var _0x128334=_0x3bd557[_0xd1c4('0x44')][_0xd1c4('0x22')]({'plain':!![]});if(!_0x128334)throw new Error(_0xd1c4('0x45'));if(_0x128334[_0xd1c4('0x46')]===_0xd1c4('0x44')){var _0x2f8bed=_0x244548[_0xd1c4('0x22')]({'plain':!![]});var _0x2070c8=_0xd1c4('0x23');return db[_0xd1c4('0x47')]['find']({'where':{'name':_0x2070c8,'userProfileId':_0x128334['userProfileId']},'raw':!![]})[_0xd1c4('0x20')](function(_0x1b33da){if(_0x1b33da&&_0x1b33da[_0xd1c4('0x48')]===0x0){return db[_0xd1c4('0x24')][_0xd1c4('0x42')]({'name':_0x2f8bed['name'],'resourceId':_0x2f8bed['id'],'type':_0x1b33da[_0xd1c4('0x27')],'sectionId':_0x1b33da['id']},{})[_0xd1c4('0x20')](function(){return _0x244548;});}else{return _0x244548;}})[_0xd1c4('0x3f')](function(_0x39615e){logger[_0xd1c4('0x49')](_0xd1c4('0x4a'),_0x39615e);throw _0x39615e;});}return _0x244548;})['then'](respondWithResult(_0x316bcd,0xc9))[_0xd1c4('0x3f')](handleError(_0x316bcd,null));};exports[_0xd1c4('0x1f')]=function(_0x4091c6,_0x18a65a){if(_0x4091c6[_0xd1c4('0x43')]['id']){delete _0x4091c6[_0xd1c4('0x43')]['id'];}return db[_0xd1c4('0x29')][_0xd1c4('0x4b')]({'where':{'id':_0x4091c6['params']['id']}})[_0xd1c4('0x20')](handleEntityNotFound(_0x18a65a,null))[_0xd1c4('0x20')](saveUpdates(_0x4091c6[_0xd1c4('0x43')],null))[_0xd1c4('0x20')](respondWithResult(_0x18a65a,null))[_0xd1c4('0x3f')](handleError(_0x18a65a,null));};exports[_0xd1c4('0x21')]=function(_0x2769cf,_0x325ead){return db['VoiceMail']['find']({'where':{'id':_0x2769cf[_0xd1c4('0x4c')]['id']}})[_0xd1c4('0x20')](handleEntityNotFound(_0x325ead,null))[_0xd1c4('0x20')](removeEntity(_0x325ead,null))['catch'](handleError(_0x325ead,null));};exports[_0xd1c4('0x4d')]=function(_0x4662d5,_0x43363a,_0x282405){return db[_0xd1c4('0x29')][_0xd1c4('0x4e')]({'where':{'id':_0x4662d5[_0xd1c4('0x4c')]['id']}})[_0xd1c4('0x20')](handleEntityNotFound(_0x43363a,null))[_0xd1c4('0x20')](function(_0x4a0c60){var _0x1a5acf;var _0x4f7414={},_0x36ccd3={};_0x36ccd3[_0xd1c4('0x2b')]=_[_0xd1c4('0x41')](db[_0xd1c4('0x4f')][_0xd1c4('0x2a')]);_0x36ccd3[_0xd1c4('0x2c')]=_['keys'](_0x4662d5[_0xd1c4('0x2c')]);_0x36ccd3[_0xd1c4('0x2d')]=_[_0xd1c4('0x2e')](_0x36ccd3[_0xd1c4('0x2b')],_0x36ccd3['query']);_0x4f7414[_0xd1c4('0x30')]=_[_0xd1c4('0x2e')](_0x36ccd3[_0xd1c4('0x2b')],qs[_0xd1c4('0x2f')](_0x4662d5['query'][_0xd1c4('0x2f')]));_0x4f7414[_0xd1c4('0x30')]=_0x4f7414[_0xd1c4('0x30')][_0xd1c4('0x31')]?_0x4f7414['attributes']:_0x36ccd3['model'];if(!_0x4662d5[_0xd1c4('0x2c')][_0xd1c4('0x32')](_0xd1c4('0x33'))){_0x4f7414[_0xd1c4('0x19')]=qs[_0xd1c4('0x19')](_0x4662d5['query']['limit']);_0x4f7414['offset']=qs[_0xd1c4('0x18')](_0x4662d5['query'][_0xd1c4('0x18')]);}_0x4f7414['order']=qs[_0xd1c4('0x35')](_0x4662d5[_0xd1c4('0x2c')][_0xd1c4('0x35')]);_0x4f7414[_0xd1c4('0x37')]=qs['filters'](_['pick'](_0x4662d5[_0xd1c4('0x2c')],_0x36ccd3['filters']));if(_0x4662d5['query']['filter']){_0x4f7414[_0xd1c4('0x37')]=_[_0xd1c4('0x3b')](_0x4f7414[_0xd1c4('0x37')],{'$or':_[_0xd1c4('0x50')](_0x4f7414[_0xd1c4('0x30')],function(_0x3b16a3){var _0x37a967={};_0x37a967[_0x3b16a3]={'$like':'%'+_0x4662d5[_0xd1c4('0x2c')][_0xd1c4('0x3a')]+'%'};return _0x37a967;})});}_0x4f7414['where']=_[_0xd1c4('0x3b')](_0x4f7414['where'],{'mailboxuser':_0x4a0c60[_0xd1c4('0x51')]});_0x4f7414=_[_0xd1c4('0x3b')]({},_0x4f7414,_0x4662d5['options']);return db[_0xd1c4('0x4f')][_0xd1c4('0x52')](_0x4f7414)['then'](respondWithFilteredResult(_0x43363a,_0x4f7414));})['catch'](handleError(_0x43363a,null));}; \ No newline at end of file +var _0x200b=['index','VoiceMail','rawAttributes','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','key','options','includeAll','findAll','rows','catch','show','length','include','merge','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','update','body','params','getMessages','findOne','VoiceMailMessage','order','mailbox','findAndCountAll','html-pdf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','sendStatus','error','stack','name'];(function(_0xb8111f,_0x2b0a3b){var _0x233d1b=function(_0x416f63){while(--_0x416f63){_0xb8111f['push'](_0xb8111f['shift']());}};_0x233d1b(++_0x2b0a3b);}(_0x200b,0x7d));var _0xb200=function(_0x450a9f,_0x3d02c1){_0x450a9f=_0x450a9f-0x0;var _0x7c9ef4=_0x200b[_0x450a9f];return _0x7c9ef4;};'use strict';var pdf=require(_0xb200('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb200('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb200('0x2'));var moment=require(_0xb200('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb200('0x4'));var util=require(_0xb200('0x5'));var path=require(_0xb200('0x6'));var sox=require('sox');var csv=require(_0xb200('0x7'));var ejs=require(_0xb200('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb200('0x9'));var jsforce=require(_0xb200('0xa'));var deskjs=require(_0xb200('0xb'));var toCsv=require(_0xb200('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb200('0xc'));var qs=require(_0xb200('0xd'));var hardwareService=require(_0xb200('0xe'));var logger=require('../../config/logger')(_0xb200('0xf'));var utils=require('../../config/utils');var config=require(_0xb200('0x10'));var db=require(_0xb200('0x11'))['db'];function respondWithStatusCode(_0x57c2b4,_0x47f0c5){_0x47f0c5=_0x47f0c5||0xcc;return function(_0x2b4008){if(_0x2b4008){return _0x57c2b4['sendStatus'](_0x47f0c5);}return _0x57c2b4[_0xb200('0x12')](_0x47f0c5)[_0xb200('0x13')]();};}function respondWithResult(_0x4eedee,_0x5731f4){_0x5731f4=_0x5731f4||0xc8;return function(_0xf165a9){if(_0xf165a9){return _0x4eedee[_0xb200('0x12')](_0x5731f4)[_0xb200('0x14')](_0xf165a9);}};}function respondWithFilteredResult(_0x312a3c,_0x56b8ee){return function(_0x66cc44){if(_0x66cc44){var _0x3eedbe=_0x66cc44[_0xb200('0x15')],_0x36dced=_0x56b8ee[_0xb200('0x16')],_0x37f1a6=_0x56b8ee[_0xb200('0x16')]+_0x56b8ee[_0xb200('0x17')],_0x359dcb;if(_0x37f1a6>=_0x3eedbe){_0x37f1a6=_0x3eedbe;_0x359dcb=0xc8;}else{_0x359dcb=0xce;}_0x312a3c['status'](_0x359dcb);return _0x312a3c[_0xb200('0x18')](_0xb200('0x19'),_0x36dced+'-'+_0x37f1a6+'/'+_0x3eedbe)[_0xb200('0x14')](_0x66cc44);}return null;};}function patchUpdates(_0x596cbc){return function(_0x41c2fb){try{jsonpatch[_0xb200('0x1a')](_0x41c2fb,_0x596cbc,!![]);}catch(_0x3e68ed){return BPromise[_0xb200('0x1b')](_0x3e68ed);}return _0x41c2fb['save']();};}function saveUpdates(_0x92de50,_0x36b91e){return function(_0x2c167f){if(_0x2c167f){return _0x2c167f['update'](_0x92de50)[_0xb200('0x1c')](function(_0x41c350){return _0x41c350;});}return null;};}function removeEntity(_0x77fdba,_0x5014da){return function(_0x55e7ff){if(_0x55e7ff){return _0x55e7ff[_0xb200('0x1d')]()[_0xb200('0x1c')](function(){var _0x49c72b=_0x55e7ff[_0xb200('0x1e')]({'plain':!![]});var _0x2d70f3='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x2d70f3,'resourceId':_0x49c72b['id']}})['then'](function(){return _0x55e7ff;});})['then'](function(){_0x77fdba['status'](0xcc)[_0xb200('0x13')]();});}};}function handleEntityNotFound(_0x16a187,_0x2cae2f){return function(_0x3cfac9){if(!_0x3cfac9){_0x16a187[_0xb200('0x1f')](0x194);}return _0x3cfac9;};}function handleError(_0x55f9b8,_0x5eb65a){_0x5eb65a=_0x5eb65a||0x1f4;return function(_0x33bf2e){logger[_0xb200('0x20')](_0x33bf2e[_0xb200('0x21')]);if(_0x33bf2e[_0xb200('0x22')]){delete _0x33bf2e['name'];}_0x55f9b8[_0xb200('0x12')](_0x5eb65a)['send'](_0x33bf2e);};}exports[_0xb200('0x23')]=function(_0x290548,_0x402227){var _0x4a1328={},_0x3c9190={},_0x148a1b={'count':0x0,'rows':[]};var _0x31186b=db[_0xb200('0x24')][_0xb200('0x25')];_0x3c9190['model']=_[_0xb200('0x26')](_0x31186b);_0x3c9190[_0xb200('0x27')]=_[_0xb200('0x26')](_0x290548[_0xb200('0x27')]);_0x3c9190[_0xb200('0x28')]=_[_0xb200('0x29')](_0x3c9190[_0xb200('0x2a')],_0x3c9190['query']);_0x4a1328['attributes']=_[_0xb200('0x29')](_0x3c9190[_0xb200('0x2a')],qs['fields'](_0x290548[_0xb200('0x27')][_0xb200('0x2b')]));_0x4a1328[_0xb200('0x2c')]=_0x4a1328[_0xb200('0x2c')]['length']?_0x4a1328[_0xb200('0x2c')]:_0x3c9190[_0xb200('0x2a')];if(!_0x290548[_0xb200('0x27')][_0xb200('0x2d')](_0xb200('0x2e'))){_0x4a1328[_0xb200('0x17')]=qs[_0xb200('0x17')](_0x290548[_0xb200('0x27')][_0xb200('0x17')]);_0x4a1328[_0xb200('0x16')]=qs[_0xb200('0x16')](_0x290548[_0xb200('0x27')][_0xb200('0x16')]);}_0x4a1328['order']=qs[_0xb200('0x2f')](_0x290548[_0xb200('0x27')][_0xb200('0x2f')]);_0x4a1328[_0xb200('0x30')]=qs['filters'](_[_0xb200('0x31')](_0x290548[_0xb200('0x27')],_0x3c9190[_0xb200('0x28')]));if(_0x290548[_0xb200('0x27')][_0xb200('0x32')]){_0x4a1328[_0xb200('0x30')]=_['merge'](_0x4a1328[_0xb200('0x30')],{'$or':_[_0xb200('0x33')](_0x31186b,function(_0x535df0){if(_0x535df0[_0xb200('0x34')][_0xb200('0x35')]!=='VIRTUAL'){var _0x7918d3={};_0x7918d3[_0x535df0['field']]={'$like':'%'+_0x290548[_0xb200('0x27')][_0xb200('0x32')]+'%'};return _0x7918d3;}})});}_0x4a1328=_['merge']({},_0x4a1328,_0x290548[_0xb200('0x36')]);var _0x17a1dc={'where':_0x4a1328[_0xb200('0x30')]};return db[_0xb200('0x24')][_0xb200('0x15')](_0x17a1dc)[_0xb200('0x1c')](function(_0x3b4ced){_0x148a1b[_0xb200('0x15')]=_0x3b4ced;if(_0x290548['query'][_0xb200('0x37')]){_0x4a1328['include']=[{'all':!![]}];}return db['VoiceMail'][_0xb200('0x38')](_0x4a1328);})[_0xb200('0x1c')](function(_0x3685ba){_0x148a1b[_0xb200('0x39')]=_0x3685ba;return _0x148a1b;})[_0xb200('0x1c')](respondWithFilteredResult(_0x402227,_0x4a1328))[_0xb200('0x3a')](handleError(_0x402227,null));};exports[_0xb200('0x3b')]=function(_0x6d6067,_0x17d530){var _0x42301f={'raw':!![],'where':{'id':_0x6d6067['params']['id']}},_0x4d4032={};_0x4d4032[_0xb200('0x2a')]=_['keys'](db[_0xb200('0x24')][_0xb200('0x25')]);_0x4d4032[_0xb200('0x27')]=_[_0xb200('0x26')](_0x6d6067['query']);_0x4d4032['filters']=_['intersection'](_0x4d4032[_0xb200('0x2a')],_0x4d4032['query']);_0x42301f['attributes']=_[_0xb200('0x29')](_0x4d4032['model'],qs[_0xb200('0x2b')](_0x6d6067[_0xb200('0x27')][_0xb200('0x2b')]));_0x42301f[_0xb200('0x2c')]=_0x42301f[_0xb200('0x2c')][_0xb200('0x3c')]?_0x42301f[_0xb200('0x2c')]:_0x4d4032['model'];if(_0x6d6067[_0xb200('0x27')]['includeAll']){_0x42301f[_0xb200('0x3d')]=[{'all':!![]}];}_0x42301f=_[_0xb200('0x3e')]({},_0x42301f,_0x6d6067[_0xb200('0x36')]);return db[_0xb200('0x24')]['find'](_0x42301f)[_0xb200('0x1c')](handleEntityNotFound(_0x17d530,null))[_0xb200('0x1c')](respondWithResult(_0x17d530,null))[_0xb200('0x3a')](handleError(_0x17d530,null));};exports['create']=function(_0x4c98ad,_0x25fa53){return db[_0xb200('0x24')][_0xb200('0x3f')](_0x4c98ad['body'],{})[_0xb200('0x1c')](function(_0x27dead){var _0x4f21a9=_0x4c98ad[_0xb200('0x40')][_0xb200('0x1e')]({'plain':!![]});if(!_0x4f21a9)throw new Error(_0xb200('0x41'));if(_0x4f21a9[_0xb200('0x42')]===_0xb200('0x40')){var _0x39a28e=_0x27dead[_0xb200('0x1e')]({'plain':!![]});var _0x17cf70='Voicemails';return db[_0xb200('0x43')][_0xb200('0x44')]({'where':{'name':_0x17cf70,'userProfileId':_0x4f21a9[_0xb200('0x45')]},'raw':!![]})[_0xb200('0x1c')](function(_0x139e37){if(_0x139e37&&_0x139e37['autoAssociation']===0x0){return db[_0xb200('0x46')]['create']({'name':_0x39a28e[_0xb200('0x22')],'resourceId':_0x39a28e['id'],'type':_0x139e37['name'],'sectionId':_0x139e37['id']},{})[_0xb200('0x1c')](function(){return _0x27dead;});}else{return _0x27dead;}})[_0xb200('0x3a')](function(_0x39b031){logger[_0xb200('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39b031);throw _0x39b031;});}return _0x27dead;})[_0xb200('0x1c')](respondWithResult(_0x25fa53,0xc9))[_0xb200('0x3a')](handleError(_0x25fa53,null));};exports[_0xb200('0x47')]=function(_0x4a5ff1,_0x44cffd){if(_0x4a5ff1[_0xb200('0x48')]['id']){delete _0x4a5ff1[_0xb200('0x48')]['id'];}return db[_0xb200('0x24')]['find']({'where':{'id':_0x4a5ff1[_0xb200('0x49')]['id']}})[_0xb200('0x1c')](handleEntityNotFound(_0x44cffd,null))['then'](saveUpdates(_0x4a5ff1[_0xb200('0x48')],null))['then'](respondWithResult(_0x44cffd,null))[_0xb200('0x3a')](handleError(_0x44cffd,null));};exports[_0xb200('0x1d')]=function(_0x405c95,_0x46f9e0){return db[_0xb200('0x24')]['find']({'where':{'id':_0x405c95['params']['id']}})[_0xb200('0x1c')](handleEntityNotFound(_0x46f9e0,null))[_0xb200('0x1c')](removeEntity(_0x46f9e0,null))[_0xb200('0x3a')](handleError(_0x46f9e0,null));};exports[_0xb200('0x4a')]=function(_0x46e708,_0x15cc49,_0x46ef96){return db[_0xb200('0x24')][_0xb200('0x4b')]({'where':{'id':_0x46e708['params']['id']}})[_0xb200('0x1c')](handleEntityNotFound(_0x15cc49,null))[_0xb200('0x1c')](function(_0xd47e0d){var _0x55fee5;var _0x44c0e1={},_0x479e45={};_0x479e45[_0xb200('0x2a')]=_[_0xb200('0x26')](db[_0xb200('0x4c')][_0xb200('0x25')]);_0x479e45[_0xb200('0x27')]=_[_0xb200('0x26')](_0x46e708[_0xb200('0x27')]);_0x479e45[_0xb200('0x28')]=_[_0xb200('0x29')](_0x479e45[_0xb200('0x2a')],_0x479e45[_0xb200('0x27')]);_0x44c0e1[_0xb200('0x2c')]=_['intersection'](_0x479e45['model'],qs[_0xb200('0x2b')](_0x46e708[_0xb200('0x27')]['fields']));_0x44c0e1[_0xb200('0x2c')]=_0x44c0e1[_0xb200('0x2c')]['length']?_0x44c0e1['attributes']:_0x479e45[_0xb200('0x2a')];if(!_0x46e708[_0xb200('0x27')][_0xb200('0x2d')](_0xb200('0x2e'))){_0x44c0e1[_0xb200('0x17')]=qs[_0xb200('0x17')](_0x46e708[_0xb200('0x27')][_0xb200('0x17')]);_0x44c0e1['offset']=qs[_0xb200('0x16')](_0x46e708[_0xb200('0x27')][_0xb200('0x16')]);}_0x44c0e1[_0xb200('0x4d')]=qs['sort'](_0x46e708[_0xb200('0x27')][_0xb200('0x2f')]);_0x44c0e1[_0xb200('0x30')]=qs['filters'](_[_0xb200('0x31')](_0x46e708[_0xb200('0x27')],_0x479e45[_0xb200('0x28')]));if(_0x46e708[_0xb200('0x27')]['filter']){_0x44c0e1['where']=_[_0xb200('0x3e')](_0x44c0e1[_0xb200('0x30')],{'$or':_['map'](_0x44c0e1[_0xb200('0x2c')],function(_0x45ae05){var _0x1e7a05={};_0x1e7a05[_0x45ae05]={'$like':'%'+_0x46e708[_0xb200('0x27')]['filter']+'%'};return _0x1e7a05;})});}_0x44c0e1[_0xb200('0x30')]=_[_0xb200('0x3e')](_0x44c0e1['where'],{'mailboxuser':_0xd47e0d[_0xb200('0x4e')]});_0x44c0e1=_[_0xb200('0x3e')]({},_0x44c0e1,_0x46e708[_0xb200('0x36')]);return db[_0xb200('0x4c')][_0xb200('0x4f')](_0x44c0e1)['then'](respondWithFilteredResult(_0x15cc49,_0x44c0e1));})['catch'](handleError(_0x15cc49,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 01074b7..f379744 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 _0xf4b8=['rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','util','api','moment','request-promise','path'];(function(_0x319768,_0x550194){var _0x4da0a5=function(_0x1c715a){while(--_0x1c715a){_0x319768['push'](_0x319768['shift']());}};_0x4da0a5(++_0x550194);}(_0xf4b8,0x17a));var _0x8f4b=function(_0x3faf34,_0x128a6b){_0x3faf34=_0x3faf34-0x0;var _0x386bf9=_0xf4b8[_0x3faf34];return _0x386bf9;};'use strict';var _=require(_0x8f4b('0x0'));var util=require(_0x8f4b('0x1'));var logger=require('../../config/logger')(_0x8f4b('0x2'));var moment=require(_0x8f4b('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f4b('0x4'));var fs=require('fs');var path=require(_0x8f4b('0x5'));var rimraf=require(_0x8f4b('0x6'));var config=require(_0x8f4b('0x7'));var attributes=require(_0x8f4b('0x8'));module[_0x8f4b('0x9')]=function(_0x24b07b,_0x29da93){return _0x24b07b[_0x8f4b('0xa')](_0x8f4b('0xb'),attributes,{'tableName':_0x8f4b('0xc'),'paranoid':![],'indexes':[{'name':_0x8f4b('0xd'),'fields':[_0x8f4b('0xe'),_0x8f4b('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa629=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context'];(function(_0x537b35,_0x318af3){var _0x13c414=function(_0x4d1618){while(--_0x4d1618){_0x537b35['push'](_0x537b35['shift']());}};_0x13c414(++_0x318af3);}(_0xa629,0x1f0));var _0x9a62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa629[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x9a62('0x0'));var logger=require(_0x9a62('0x1'))(_0x9a62('0x2'));var moment=require(_0x9a62('0x3'));var BPromise=require(_0x9a62('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a62('0x5'));var rimraf=require(_0x9a62('0x6'));var config=require(_0x9a62('0x7'));var attributes=require(_0x9a62('0x8'));module[_0x9a62('0x9')]=function(_0x25c493,_0x3889fa){return _0x25c493[_0x9a62('0xa')](_0x9a62('0xb'),attributes,{'tableName':_0x9a62('0xc'),'paranoid':![],'indexes':[{'name':_0x9a62('0xd'),'fields':[_0x9a62('0xe'),_0x9a62('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 510b730..85ee682 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 _0xef1c=['code','message','result','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xcffae0,_0x1f70ca){var _0x24f329=function(_0x228238){while(--_0x228238){_0xcffae0['push'](_0xcffae0['shift']());}};_0x24f329(++_0x1f70ca);}(_0xef1c,0x120));var _0xcef1=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xef1c[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xcef1('0x0'));var util=require(_0xcef1('0x1'));var moment=require(_0xcef1('0x2'));var BPromise=require('bluebird');var rs=require(_0xcef1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcef1('0x4'))(_0xcef1('0x5'));var config=require(_0xcef1('0x6'));var jayson=require(_0xcef1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34cfb6,_0x2b3351,_0x53f08a){return new BPromise(function(_0x3b81b3,_0x2faa73){return client[_0xcef1('0x8')](_0x34cfb6,_0x53f08a)[_0xcef1('0x9')](function(_0x31adb0){logger[_0xcef1('0xa')](_0xcef1('0xb'),_0x2b3351,_0xcef1('0xc'));logger['debug'](_0xcef1('0xd'),_0x2b3351,_0xcef1('0xc'),JSON[_0xcef1('0xe')](_0x31adb0));if(_0x31adb0['error']){if(_0x31adb0[_0xcef1('0xf')][_0xcef1('0x10')]===0x1f4){logger[_0xcef1('0xf')](_0xcef1('0xb'),_0x2b3351,_0x31adb0[_0xcef1('0xf')][_0xcef1('0x11')]);return _0x2faa73(_0x31adb0[_0xcef1('0xf')]['message']);}logger[_0xcef1('0xf')](_0xcef1('0xb'),_0x2b3351,_0x31adb0[_0xcef1('0xf')][_0xcef1('0x11')]);return _0x3b81b3(_0x31adb0['error'][_0xcef1('0x11')]);}else{logger[_0xcef1('0xa')]('VoiceMail,\x20%s,\x20%s',_0x2b3351,_0xcef1('0xc'));_0x3b81b3(_0x31adb0[_0xcef1('0x12')]['message']);}})['catch'](function(_0xe25e18){logger[_0xcef1('0xf')]('VoiceMail,\x20%s,\x20%s',_0x2b3351,_0xe25e18);_0x2faa73(_0xe25e18);});});} \ No newline at end of file +var _0xe4b3=['client','http','then','info','debug','request\x20sent','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f1837,_0x4b304e){var _0x25ab57=function(_0x4dec8c){while(--_0x4dec8c){_0x1f1837['push'](_0x1f1837['shift']());}};_0x25ab57(++_0x4b304e);}(_0xe4b3,0x11c));var _0x3e4b=function(_0x5451bf,_0x1e4a55){_0x5451bf=_0x5451bf-0x0;var _0x46c705=_0xe4b3[_0x5451bf];return _0x46c705;};'use strict';var _=require(_0x3e4b('0x0'));var util=require(_0x3e4b('0x1'));var moment=require(_0x3e4b('0x2'));var BPromise=require(_0x3e4b('0x3'));var rs=require(_0x3e4b('0x4'));var fs=require('fs');var Redis=require(_0x3e4b('0x5'));var db=require(_0x3e4b('0x6'))['db'];var utils=require(_0x3e4b('0x7'));var logger=require(_0x3e4b('0x8'))(_0x3e4b('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3e4b('0xa')][_0x3e4b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x267b74,_0x7be0c3,_0x2e352a){return new BPromise(function(_0x1bbc45,_0x18a336){return client['request'](_0x267b74,_0x2e352a)[_0x3e4b('0xc')](function(_0x2875be){logger[_0x3e4b('0xd')]('VoiceMail,\x20%s,\x20%s',_0x7be0c3,'request\x20sent');logger[_0x3e4b('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x7be0c3,_0x3e4b('0xf'),JSON['stringify'](_0x2875be));if(_0x2875be['error']){if(_0x2875be[_0x3e4b('0x10')]['code']===0x1f4){logger[_0x3e4b('0x10')](_0x3e4b('0x11'),_0x7be0c3,_0x2875be['error'][_0x3e4b('0x12')]);return _0x18a336(_0x2875be[_0x3e4b('0x10')][_0x3e4b('0x12')]);}logger[_0x3e4b('0x10')]('VoiceMail,\x20%s,\x20%s',_0x7be0c3,_0x2875be[_0x3e4b('0x10')]['message']);return _0x1bbc45(_0x2875be[_0x3e4b('0x10')]['message']);}else{logger['info'](_0x3e4b('0x11'),_0x7be0c3,_0x3e4b('0xf'));_0x1bbc45(_0x2875be[_0x3e4b('0x13')]['message']);}})[_0x3e4b('0x14')](function(_0x5a4fce){logger[_0x3e4b('0x10')]('VoiceMail,\x20%s,\x20%s',_0x7be0c3,_0x5a4fce);_0x18a336(_0x5a4fce);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 6aa8cc0..e43ac1f 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 _0xba72=['download','post','create','update','delete','exports','multer','util','../../components/auth/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download'];(function(_0x2edbf1,_0x2495de){var _0x48167e=function(_0x13cfb3){while(--_0x13cfb3){_0x2edbf1['push'](_0x2edbf1['shift']());}};_0x48167e(++_0x2495de);}(_0xba72,0x1d6));var _0x2ba7=function(_0x2aa788,_0x498eb8){_0x2aa788=_0x2aa788-0x0;var _0x5be967=_0xba72[_0x2aa788];return _0x5be967;};'use strict';var multer=require(_0x2ba7('0x0'));var util=require(_0x2ba7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x2ba7('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2ba7('0x3'));router[_0x2ba7('0x4')]('/',auth['isAuthenticated'](),controller[_0x2ba7('0x5')]);router[_0x2ba7('0x4')](_0x2ba7('0x6'),auth[_0x2ba7('0x7')](),controller[_0x2ba7('0x8')]);router['get'](_0x2ba7('0x9'),auth[_0x2ba7('0x7')](),controller[_0x2ba7('0xa')]);router[_0x2ba7('0xb')]('/',auth['isAuthenticated'](),controller[_0x2ba7('0xc')]);router['put'](_0x2ba7('0x6'),auth[_0x2ba7('0x7')](),controller[_0x2ba7('0xd')]);router[_0x2ba7('0xe')]('/:id',auth[_0x2ba7('0x7')](),controller['destroy']);module[_0x2ba7('0xf')]=router; \ No newline at end of file +var _0xeb84=['post','create','put','update','delete','exports','multer','path','express','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download'];(function(_0x4d10d4,_0x524297){var _0x2eaa19=function(_0x3d7e50){while(--_0x3d7e50){_0x4d10d4['push'](_0x4d10d4['shift']());}};_0x2eaa19(++_0x524297);}(_0xeb84,0xba));var _0x4eb8=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0xeb84[_0x5ad771];return _0x5b5dce;};'use strict';var multer=require(_0x4eb8('0x0'));var util=require('util');var path=require(_0x4eb8('0x1'));var timeout=require('connect-timeout');var express=require(_0x4eb8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4eb8('0x3'));var config=require(_0x4eb8('0x4'));var controller=require(_0x4eb8('0x5'));router[_0x4eb8('0x6')]('/',auth[_0x4eb8('0x7')](),controller[_0x4eb8('0x8')]);router['get'](_0x4eb8('0x9'),auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xa')]);router[_0x4eb8('0x6')]('/:id/download',auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xb')]);router[_0x4eb8('0xc')]('/',auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xd')]);router[_0x4eb8('0xe')](_0x4eb8('0x9'),auth[_0x4eb8('0x7')](),controller[_0x4eb8('0xf')]);router[_0x4eb8('0x10')](_0x4eb8('0x9'),auth[_0x4eb8('0x7')](),controller['destroy']);module[_0x4eb8('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 907c837..75b9178 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 _0x6fe4=['exports','VIRTUAL','INTEGER','STRING','long','TIMESTAMP'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6fe4,0x144));var _0x46fe=function(_0xbdd83,_0x2c0752){_0xbdd83=_0xbdd83-0x0;var _0x5c76e9=_0x6fe4[_0xbdd83];return _0x5c76e9;};'use strict';var Sequelize=require('sequelize');module[_0x46fe('0x0')]={'name':{'type':Sequelize[_0x46fe('0x1')],'get':function(_0x68f2a5){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x46fe('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x46fe('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x46fe('0x3')],'defaultValue':''},'stamp':{'type':_0x46fe('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x71d5=['TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x51d078,_0x45554f){var _0x1d7695=function(_0x3bbf1d){while(--_0x3bbf1d){_0x51d078['push'](_0x51d078['shift']());}};_0x1d7695(++_0x45554f);}(_0x71d5,0x109));var _0x571d=function(_0x3bbb97,_0x539f0a){_0x3bbb97=_0x3bbb97-0x0;var _0xec491d=_0x71d5[_0x3bbb97];return _0xec491d;};'use strict';var Sequelize=require(_0x571d('0x0'));module[_0x571d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5bd40e){return this[_0x571d('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x571d('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x571d('0x5')](_0x571d('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x571d('0x4')],'defaultValue':''},'stamp':{'type':_0x571d('0x7'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b9d8846..1b629c2 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 _0xf109=['VoiceMailMessage','rawAttributes','differenceBy','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','map','type','key','VIRTUAL','field','options','findAll','rows','catch','show','includeAll','find','create','body','params','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','set','send','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0xf109,0xce));var _0x9f10=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0xf109[_0x5a9c0c];return _0x53c77d;};'use strict';var pdf=require(_0x9f10('0x0'));var emlformat=require(_0x9f10('0x1'));var rimraf=require(_0x9f10('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9f10('0x3'));var BPromise=require(_0x9f10('0x4'));var Mustache=require(_0x9f10('0x5'));var util=require(_0x9f10('0x6'));var path=require(_0x9f10('0x7'));var sox=require(_0x9f10('0x8'));var csv=require(_0x9f10('0x9'));var ejs=require(_0x9f10('0xa'));var fs=require('fs');var _=require(_0x9f10('0xb'));var squel=require(_0x9f10('0xc'));var crypto=require(_0x9f10('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9f10('0xe'));var toCsv=require(_0x9f10('0x9'));var querystring=require(_0x9f10('0xf'));var Papa=require(_0x9f10('0x10'));var Redis=require(_0x9f10('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9f10('0x12'));var hardwareService=require(_0x9f10('0x13'));var logger=require(_0x9f10('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9f10('0x15'));var db=require(_0x9f10('0x16'))['db'];function respondWithStatusCode(_0x407336,_0x56780e){_0x56780e=_0x56780e||0xcc;return function(_0x289164){if(_0x289164){return _0x407336[_0x9f10('0x17')](_0x56780e);}return _0x407336[_0x9f10('0x18')](_0x56780e)['end']();};}function respondWithResult(_0x9a3ae6,_0x309f27){_0x309f27=_0x309f27||0xc8;return function(_0x5be443){if(_0x5be443){return _0x9a3ae6[_0x9f10('0x18')](_0x309f27)[_0x9f10('0x19')](_0x5be443);}};}function respondWithFilteredResult(_0x507e1a,_0x59bcad){return function(_0x2b6c4c){if(_0x2b6c4c){var _0x177918=_0x2b6c4c[_0x9f10('0x1a')],_0x549217=_0x59bcad[_0x9f10('0x1b')],_0x11154b=_0x59bcad['offset']+_0x59bcad[_0x9f10('0x1c')],_0x5ae255;if(_0x11154b>=_0x177918){_0x11154b=_0x177918;_0x5ae255=0xc8;}else{_0x5ae255=0xce;}_0x507e1a[_0x9f10('0x18')](_0x5ae255);return _0x507e1a['set'](_0x9f10('0x1d'),_0x549217+'-'+_0x11154b+'/'+_0x177918)['json'](_0x2b6c4c);}return null;};}function patchUpdates(_0xe221d0){return function(_0x51ce03){try{jsonpatch[_0x9f10('0x1e')](_0x51ce03,_0xe221d0,!![]);}catch(_0x56fb44){return BPromise['reject'](_0x56fb44);}return _0x51ce03[_0x9f10('0x1f')]();};}function saveUpdates(_0x1a1e7e,_0x25f870){return function(_0x3a78be){if(_0x3a78be){return _0x3a78be[_0x9f10('0x20')](_0x1a1e7e)[_0x9f10('0x21')](function(_0x27843d){return _0x27843d;});}return null;};}function removeEntity(_0x4cdc00,_0x366044){return function(_0x58e6ba){if(_0x58e6ba){return _0x58e6ba[_0x9f10('0x22')]()[_0x9f10('0x21')](function(){_0x4cdc00[_0x9f10('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f31fb,_0x3dde2e){return function(_0x213567){if(!_0x213567){_0x2f31fb['sendStatus'](0x194);}return _0x213567;};}function handleError(_0x36821e,_0x37e9ac){_0x37e9ac=_0x37e9ac||0x1f4;return function(_0x44b99d){logger['error'](_0x44b99d[_0x9f10('0x23')]);if(_0x44b99d[_0x9f10('0x24')]){delete _0x44b99d[_0x9f10('0x24')];}_0x36821e[_0x9f10('0x18')](_0x37e9ac)['send'](_0x44b99d);};}exports['index']=function(_0x5c1800,_0x385a39){var _0x4a0407={},_0x314794={},_0x1de75a={'count':0x0,'rows':[]};var _0x45fffc=db[_0x9f10('0x25')][_0x9f10('0x26')];_0x314794['model']=_[_0x9f10('0x27')](_[_0x9f10('0x28')](_0x45fffc),[_0x9f10('0x24')]);_0x314794[_0x9f10('0x29')]=_[_0x9f10('0x28')](_0x5c1800[_0x9f10('0x29')]);_0x314794['filters']=_[_0x9f10('0x2a')](_0x314794[_0x9f10('0x2b')],_0x314794[_0x9f10('0x29')]);_0x4a0407[_0x9f10('0x2c')]=_['intersection'](_0x314794[_0x9f10('0x2b')],qs[_0x9f10('0x2d')](_0x5c1800[_0x9f10('0x29')]['fields']));_0x4a0407[_0x9f10('0x2c')]=_0x4a0407['attributes'][_0x9f10('0x2e')]?_0x4a0407[_0x9f10('0x2c')]:_0x314794[_0x9f10('0x2b')];if(!_0x5c1800['query'][_0x9f10('0x2f')](_0x9f10('0x30'))){_0x4a0407[_0x9f10('0x1c')]=qs[_0x9f10('0x1c')](_0x5c1800[_0x9f10('0x29')]['limit']);_0x4a0407[_0x9f10('0x1b')]=qs['offset'](_0x5c1800[_0x9f10('0x29')][_0x9f10('0x1b')]);}_0x4a0407[_0x9f10('0x31')]=qs[_0x9f10('0x32')](_0x5c1800[_0x9f10('0x29')][_0x9f10('0x32')]);_0x4a0407['where']=qs[_0x9f10('0x33')](_[_0x9f10('0x34')](_0x5c1800[_0x9f10('0x29')],_0x314794['filters']));if(_0x5c1800[_0x9f10('0x29')][_0x9f10('0x35')]){_0x4a0407['where']=_[_0x9f10('0x36')](_0x4a0407['where'],{'$or':_[_0x9f10('0x37')](_0x45fffc,function(_0x1b7a66){if(_0x1b7a66[_0x9f10('0x38')][_0x9f10('0x39')]!==_0x9f10('0x3a')){var _0x1ba4be={};_0x1ba4be[_0x1b7a66[_0x9f10('0x3b')]]={'$like':'%'+_0x5c1800[_0x9f10('0x29')]['filter']+'%'};return _0x1ba4be;}})});}_0x4a0407=_[_0x9f10('0x36')]({},_0x4a0407,_0x5c1800[_0x9f10('0x3c')]);var _0x2fa4bf={'where':_0x4a0407['where']};return db[_0x9f10('0x25')][_0x9f10('0x1a')](_0x2fa4bf)['then'](function(_0x30b04b){_0x1de75a[_0x9f10('0x1a')]=_0x30b04b;if(_0x5c1800[_0x9f10('0x29')]['includeAll']){_0x4a0407['include']=[{'all':!![]}];}return db[_0x9f10('0x25')][_0x9f10('0x3d')](_0x4a0407);})[_0x9f10('0x21')](function(_0x433e70){_0x1de75a[_0x9f10('0x3e')]=_0x433e70;return _0x1de75a;})[_0x9f10('0x21')](respondWithFilteredResult(_0x385a39,_0x4a0407))[_0x9f10('0x3f')](handleError(_0x385a39,null));};exports[_0x9f10('0x40')]=function(_0x7fe320,_0x149f8f){var _0x6e4610={'raw':!![],'where':{'id':_0x7fe320['params']['id']}},_0xdecdd5={};_0xdecdd5['model']=_['keys'](db[_0x9f10('0x25')]['rawAttributes']);_0xdecdd5[_0x9f10('0x29')]=_[_0x9f10('0x28')](_0x7fe320[_0x9f10('0x29')]);_0xdecdd5['filters']=_[_0x9f10('0x2a')](_0xdecdd5[_0x9f10('0x2b')],_0xdecdd5[_0x9f10('0x29')]);_0x6e4610[_0x9f10('0x2c')]=_[_0x9f10('0x2a')](_0xdecdd5['model'],qs['fields'](_0x7fe320['query'][_0x9f10('0x2d')]));_0x6e4610['attributes']=_0x6e4610[_0x9f10('0x2c')]['length']?_0x6e4610[_0x9f10('0x2c')]:_0xdecdd5[_0x9f10('0x2b')];if(_0x7fe320[_0x9f10('0x29')][_0x9f10('0x41')]){_0x6e4610['include']=[{'all':!![]}];}_0x6e4610=_[_0x9f10('0x36')]({},_0x6e4610,_0x7fe320[_0x9f10('0x3c')]);return db['VoiceMailMessage'][_0x9f10('0x42')](_0x6e4610)[_0x9f10('0x21')](handleEntityNotFound(_0x149f8f,null))[_0x9f10('0x21')](respondWithResult(_0x149f8f,null))[_0x9f10('0x3f')](handleError(_0x149f8f,null));};exports[_0x9f10('0x43')]=function(_0x3b3002,_0x4bedbe){return db[_0x9f10('0x25')][_0x9f10('0x43')](_0x3b3002[_0x9f10('0x44')],{})['then'](respondWithResult(_0x4bedbe,0xc9))[_0x9f10('0x3f')](handleError(_0x4bedbe,null));};exports[_0x9f10('0x20')]=function(_0x4c8076,_0x403ec6){if(_0x4c8076[_0x9f10('0x44')]['id']){delete _0x4c8076[_0x9f10('0x44')]['id'];}return db[_0x9f10('0x25')]['find']({'where':{'id':_0x4c8076[_0x9f10('0x45')]['id']}})[_0x9f10('0x21')](handleEntityNotFound(_0x403ec6,null))[_0x9f10('0x21')](saveUpdates(_0x4c8076[_0x9f10('0x44')],null))[_0x9f10('0x21')](respondWithResult(_0x403ec6,null))[_0x9f10('0x3f')](handleError(_0x403ec6,null));};exports['destroy']=function(_0x24ebc4,_0x3760d0){return db[_0x9f10('0x25')][_0x9f10('0x42')]({'where':{'id':_0x24ebc4[_0x9f10('0x45')]['id']}})[_0x9f10('0x21')](handleEntityNotFound(_0x3760d0,null))['then'](removeEntity(_0x3760d0,null))[_0x9f10('0x3f')](handleError(_0x3760d0,null));};exports[_0x9f10('0x46')]=function(_0x249319,_0x14c808,_0x39dae3){return db[_0x9f10('0x25')][_0x9f10('0x42')]({'where':{'id':_0x249319[_0x9f10('0x45')]['id']},'attributes':['id','recording',_0x9f10('0x47')]})['then'](handleEntityNotFound(_0x14c808,null))[_0x9f10('0x21')](function(_0x532808){if(_0x532808){if(!_0x532808[_0x9f10('0x48')]){throw new db[(_0x9f10('0x49'))][(_0x9f10('0x4a'))](_0x9f10('0x4b'));}var _0x10d6dc={'Content-Type':'audio/wav','Content-Disposition':_0x9f10('0x4c')};if(_0x532808[_0x9f10('0x47')]){_0x10d6dc[_0x9f10('0x4d')]=_0x9f10('0x4e')+_0x532808['msg_id']+'.wav\x22';}_0x14c808[_0x9f10('0x4f')](_0x10d6dc);return _0x14c808[_0x9f10('0x50')](new Buffer(_0x532808['recording']));}})['catch'](handleError(_0x14c808,null));}; \ No newline at end of file +var _0xc6d8=['sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','send','index','rawAttributes','model','differenceBy','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','map','type','key','VIRTUAL','field','filter','options','VoiceMailMessage','includeAll','include','rows','catch','show','params','create','body','find','msg_id','recording','ValidationError','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','html-pdf','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x5af9d9,_0x1f1101){var _0x3ef1d2=function(_0x285d2d){while(--_0x285d2d){_0x5af9d9['push'](_0x5af9d9['shift']());}};_0x3ef1d2(++_0x1f1101);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4e62ca,_0xe85442){_0x4e62ca=_0x4e62ca-0x0;var _0x16007a=_0xc6d8[_0x4e62ca];return _0x16007a;};'use strict';var pdf=require(_0x8c6d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8c6d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8c6d('0x2'));var rp=require('request-promise');var moment=require(_0x8c6d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8c6d('0x4'));var path=require(_0x8c6d('0x5'));var sox=require(_0x8c6d('0x6'));var csv=require(_0x8c6d('0x7'));var ejs=require(_0x8c6d('0x8'));var fs=require('fs');var _=require(_0x8c6d('0x9'));var squel=require(_0x8c6d('0xa'));var crypto=require('crypto');var jsforce=require(_0x8c6d('0xb'));var deskjs=require(_0x8c6d('0xc'));var toCsv=require(_0x8c6d('0x7'));var querystring=require('querystring');var Papa=require(_0x8c6d('0xd'));var Redis=require(_0x8c6d('0xe'));var authService=require(_0x8c6d('0xf'));var qs=require(_0x8c6d('0x10'));var hardwareService=require(_0x8c6d('0x11'));var logger=require(_0x8c6d('0x12'))(_0x8c6d('0x13'));var utils=require(_0x8c6d('0x14'));var config=require('../../config/environment');var db=require(_0x8c6d('0x15'))['db'];function respondWithStatusCode(_0x559d17,_0x4c0878){_0x4c0878=_0x4c0878||0xcc;return function(_0x22d0fb){if(_0x22d0fb){return _0x559d17[_0x8c6d('0x16')](_0x4c0878);}return _0x559d17[_0x8c6d('0x17')](_0x4c0878)[_0x8c6d('0x18')]();};}function respondWithResult(_0x30ecfa,_0xe294e7){_0xe294e7=_0xe294e7||0xc8;return function(_0x42d746){if(_0x42d746){return _0x30ecfa[_0x8c6d('0x17')](_0xe294e7)[_0x8c6d('0x19')](_0x42d746);}};}function respondWithFilteredResult(_0x31d943,_0x4fb956){return function(_0x16c6b5){if(_0x16c6b5){var _0x4b2bb1=_0x16c6b5[_0x8c6d('0x1a')],_0x16af06=_0x4fb956['offset'],_0x4dd4b6=_0x4fb956[_0x8c6d('0x1b')]+_0x4fb956[_0x8c6d('0x1c')],_0x150a16;if(_0x4dd4b6>=_0x4b2bb1){_0x4dd4b6=_0x4b2bb1;_0x150a16=0xc8;}else{_0x150a16=0xce;}_0x31d943['status'](_0x150a16);return _0x31d943[_0x8c6d('0x1d')]('Content-Range',_0x16af06+'-'+_0x4dd4b6+'/'+_0x4b2bb1)['json'](_0x16c6b5);}return null;};}function patchUpdates(_0x21b8ee){return function(_0x5c962e){try{jsonpatch[_0x8c6d('0x1e')](_0x5c962e,_0x21b8ee,!![]);}catch(_0x174a4f){return BPromise[_0x8c6d('0x1f')](_0x174a4f);}return _0x5c962e[_0x8c6d('0x20')]();};}function saveUpdates(_0x5ac817,_0x56854a){return function(_0x5512be){if(_0x5512be){return _0x5512be['update'](_0x5ac817)[_0x8c6d('0x21')](function(_0x507e0c){return _0x507e0c;});}return null;};}function removeEntity(_0xc3288,_0x4b6835){return function(_0x4c378b){if(_0x4c378b){return _0x4c378b[_0x8c6d('0x22')]()[_0x8c6d('0x21')](function(){_0xc3288['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x51bb08,_0x47d3a0){return function(_0x2a85b5){if(!_0x2a85b5){_0x51bb08[_0x8c6d('0x16')](0x194);}return _0x2a85b5;};}function handleError(_0x292ae4,_0x48f64a){_0x48f64a=_0x48f64a||0x1f4;return function(_0x41c904){logger['error'](_0x41c904[_0x8c6d('0x23')]);if(_0x41c904['name']){delete _0x41c904[_0x8c6d('0x24')];}_0x292ae4[_0x8c6d('0x17')](_0x48f64a)[_0x8c6d('0x25')](_0x41c904);};}exports[_0x8c6d('0x26')]=function(_0x1e6755,_0x3e3cd3){var _0x9c269d={},_0x41957d={},_0x3eab38={'count':0x0,'rows':[]};var _0x4c307c=db['VoiceMailMessage'][_0x8c6d('0x27')];_0x41957d[_0x8c6d('0x28')]=_[_0x8c6d('0x29')](_[_0x8c6d('0x2a')](_0x4c307c),[_0x8c6d('0x24')]);_0x41957d[_0x8c6d('0x2b')]=_[_0x8c6d('0x2a')](_0x1e6755[_0x8c6d('0x2b')]);_0x41957d[_0x8c6d('0x2c')]=_[_0x8c6d('0x2d')](_0x41957d[_0x8c6d('0x28')],_0x41957d[_0x8c6d('0x2b')]);_0x9c269d['attributes']=_[_0x8c6d('0x2d')](_0x41957d[_0x8c6d('0x28')],qs[_0x8c6d('0x2e')](_0x1e6755[_0x8c6d('0x2b')][_0x8c6d('0x2e')]));_0x9c269d[_0x8c6d('0x2f')]=_0x9c269d[_0x8c6d('0x2f')][_0x8c6d('0x30')]?_0x9c269d[_0x8c6d('0x2f')]:_0x41957d['model'];if(!_0x1e6755[_0x8c6d('0x2b')]['hasOwnProperty'](_0x8c6d('0x31'))){_0x9c269d[_0x8c6d('0x1c')]=qs[_0x8c6d('0x1c')](_0x1e6755[_0x8c6d('0x2b')][_0x8c6d('0x1c')]);_0x9c269d[_0x8c6d('0x1b')]=qs['offset'](_0x1e6755['query'][_0x8c6d('0x1b')]);}_0x9c269d[_0x8c6d('0x32')]=qs[_0x8c6d('0x33')](_0x1e6755[_0x8c6d('0x2b')]['sort']);_0x9c269d[_0x8c6d('0x34')]=qs[_0x8c6d('0x2c')](_[_0x8c6d('0x35')](_0x1e6755[_0x8c6d('0x2b')],_0x41957d[_0x8c6d('0x2c')]));if(_0x1e6755[_0x8c6d('0x2b')]['filter']){_0x9c269d[_0x8c6d('0x34')]=_[_0x8c6d('0x36')](_0x9c269d[_0x8c6d('0x34')],{'$or':_[_0x8c6d('0x37')](_0x4c307c,function(_0xff4b5b){if(_0xff4b5b[_0x8c6d('0x38')][_0x8c6d('0x39')]!==_0x8c6d('0x3a')){var _0x24200c={};_0x24200c[_0xff4b5b[_0x8c6d('0x3b')]]={'$like':'%'+_0x1e6755[_0x8c6d('0x2b')][_0x8c6d('0x3c')]+'%'};return _0x24200c;}})});}_0x9c269d=_['merge']({},_0x9c269d,_0x1e6755[_0x8c6d('0x3d')]);var _0x82b885={'where':_0x9c269d[_0x8c6d('0x34')]};return db[_0x8c6d('0x3e')][_0x8c6d('0x1a')](_0x82b885)['then'](function(_0x26027f){_0x3eab38[_0x8c6d('0x1a')]=_0x26027f;if(_0x1e6755['query'][_0x8c6d('0x3f')]){_0x9c269d[_0x8c6d('0x40')]=[{'all':!![]}];}return db[_0x8c6d('0x3e')]['findAll'](_0x9c269d);})[_0x8c6d('0x21')](function(_0xb7293d){_0x3eab38[_0x8c6d('0x41')]=_0xb7293d;return _0x3eab38;})[_0x8c6d('0x21')](respondWithFilteredResult(_0x3e3cd3,_0x9c269d))[_0x8c6d('0x42')](handleError(_0x3e3cd3,null));};exports[_0x8c6d('0x43')]=function(_0x305910,_0x2bbf60){var _0x925988={'raw':!![],'where':{'id':_0x305910[_0x8c6d('0x44')]['id']}},_0x2113ed={};_0x2113ed['model']=_['keys'](db['VoiceMailMessage'][_0x8c6d('0x27')]);_0x2113ed[_0x8c6d('0x2b')]=_[_0x8c6d('0x2a')](_0x305910[_0x8c6d('0x2b')]);_0x2113ed[_0x8c6d('0x2c')]=_['intersection'](_0x2113ed[_0x8c6d('0x28')],_0x2113ed[_0x8c6d('0x2b')]);_0x925988[_0x8c6d('0x2f')]=_['intersection'](_0x2113ed[_0x8c6d('0x28')],qs[_0x8c6d('0x2e')](_0x305910['query']['fields']));_0x925988['attributes']=_0x925988['attributes']['length']?_0x925988[_0x8c6d('0x2f')]:_0x2113ed[_0x8c6d('0x28')];if(_0x305910[_0x8c6d('0x2b')][_0x8c6d('0x3f')]){_0x925988[_0x8c6d('0x40')]=[{'all':!![]}];}_0x925988=_['merge']({},_0x925988,_0x305910['options']);return db['VoiceMailMessage']['find'](_0x925988)[_0x8c6d('0x21')](handleEntityNotFound(_0x2bbf60,null))['then'](respondWithResult(_0x2bbf60,null))[_0x8c6d('0x42')](handleError(_0x2bbf60,null));};exports[_0x8c6d('0x45')]=function(_0x38c127,_0x8a980b){return db[_0x8c6d('0x3e')][_0x8c6d('0x45')](_0x38c127['body'],{})[_0x8c6d('0x21')](respondWithResult(_0x8a980b,0xc9))[_0x8c6d('0x42')](handleError(_0x8a980b,null));};exports['update']=function(_0xe0693a,_0xc0547e){if(_0xe0693a['body']['id']){delete _0xe0693a[_0x8c6d('0x46')]['id'];}return db[_0x8c6d('0x3e')][_0x8c6d('0x47')]({'where':{'id':_0xe0693a[_0x8c6d('0x44')]['id']}})[_0x8c6d('0x21')](handleEntityNotFound(_0xc0547e,null))[_0x8c6d('0x21')](saveUpdates(_0xe0693a[_0x8c6d('0x46')],null))[_0x8c6d('0x21')](respondWithResult(_0xc0547e,null))[_0x8c6d('0x42')](handleError(_0xc0547e,null));};exports[_0x8c6d('0x22')]=function(_0x361956,_0x23792d){return db[_0x8c6d('0x3e')][_0x8c6d('0x47')]({'where':{'id':_0x361956[_0x8c6d('0x44')]['id']}})[_0x8c6d('0x21')](handleEntityNotFound(_0x23792d,null))['then'](removeEntity(_0x23792d,null))['catch'](handleError(_0x23792d,null));};exports['download']=function(_0x28da18,_0x1f3ea6,_0x4919b8){return db[_0x8c6d('0x3e')]['find']({'where':{'id':_0x28da18[_0x8c6d('0x44')]['id']},'attributes':['id','recording',_0x8c6d('0x48')]})[_0x8c6d('0x21')](handleEntityNotFound(_0x1f3ea6,null))[_0x8c6d('0x21')](function(_0x5e2dbb){if(_0x5e2dbb){if(!_0x5e2dbb[_0x8c6d('0x49')]){throw new db['Sequelize'][(_0x8c6d('0x4a'))]('VoiceMailMessage\x20not\x20found');}var _0xcbcc60={'Content-Type':_0x8c6d('0x4b'),'Content-Disposition':_0x8c6d('0x4c')};if(_0x5e2dbb[_0x8c6d('0x48')]){_0xcbcc60['Content-Disposition']=_0x8c6d('0x4d')+_0x5e2dbb[_0x8c6d('0x48')]+_0x8c6d('0x4e');}_0x1f3ea6[_0x8c6d('0x1d')](_0xcbcc60);return _0x1f3ea6[_0x8c6d('0x25')](new Buffer(_0x5e2dbb[_0x8c6d('0x49')]));}})[_0x8c6d('0x42')](handleError(_0x1f3ea6,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 648067b..f2d2fb1 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 _0x0d41=['define','VoiceMailMessage','dir','lodash','util','moment','bluebird','request-promise','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0d41,0x1a5));var _0x10d4=function(_0x5b5619,_0x48ac21){_0x5b5619=_0x5b5619-0x0;var _0x1d011e=_0x0d41[_0x5b5619];return _0x1d011e;};'use strict';var _=require(_0x10d4('0x0'));var util=require(_0x10d4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x10d4('0x2'));var BPromise=require(_0x10d4('0x3'));var rp=require(_0x10d4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x10d4('0x5'));var attributes=require(_0x10d4('0x6'));module[_0x10d4('0x7')]=function(_0x44c624,_0x21bee5){return _0x44c624[_0x10d4('0x8')](_0x10d4('0x9'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x10d4('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0x0657=['request-promise','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','moment','bluebird'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x0657,0x1aa));var _0x7065=function(_0x586aa3,_0x56cee8){_0x586aa3=_0x586aa3-0x0;var _0x1eeb9f=_0x0657[_0x586aa3];return _0x1eeb9f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7065('0x0'))(_0x7065('0x1'));var moment=require(_0x7065('0x2'));var BPromise=require(_0x7065('0x3'));var rp=require(_0x7065('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7065('0x5'));module[_0x7065('0x6')]=function(_0x310991,_0x4b7140){return _0x310991['define'](_0x7065('0x7'),attributes,{'tableName':_0x7065('0x8'),'paranoid':![],'indexes':[{'name':_0x7065('0x9'),'fields':[_0x7065('0x9')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 29d6e65..2423c4a 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 _0xea69=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceMailMessage,\x20%s,\x20%s','lodash','util','moment','bluebird'];(function(_0xdbe2de,_0x3bdc5a){var _0x2facd7=function(_0x50df58){while(--_0x50df58){_0xdbe2de['push'](_0xdbe2de['shift']());}};_0x2facd7(++_0x3bdc5a);}(_0xea69,0x1e0));var _0x9ea6=function(_0x1d2b1c,_0x45fd97){_0x1d2b1c=_0x1d2b1c-0x0;var _0x512eba=_0xea69[_0x1d2b1c];return _0x512eba;};'use strict';var _=require(_0x9ea6('0x0'));var util=require(_0x9ea6('0x1'));var moment=require(_0x9ea6('0x2'));var BPromise=require(_0x9ea6('0x3'));var rs=require(_0x9ea6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ea6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ea6('0x6'))(_0x9ea6('0x7'));var config=require(_0x9ea6('0x8'));var jayson=require(_0x9ea6('0x9'));var client=jayson[_0x9ea6('0xa')][_0x9ea6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x221474,_0x212281,_0x259c69){return new BPromise(function(_0xd97d77,_0x4872eb){return client[_0x9ea6('0xc')](_0x221474,_0x259c69)[_0x9ea6('0xd')](function(_0x319ca1){logger[_0x9ea6('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x212281,_0x9ea6('0xf'));logger[_0x9ea6('0x10')](_0x9ea6('0x11'),_0x212281,_0x9ea6('0xf'),JSON[_0x9ea6('0x12')](_0x319ca1));if(_0x319ca1[_0x9ea6('0x13')]){if(_0x319ca1[_0x9ea6('0x13')]['code']===0x1f4){logger[_0x9ea6('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x212281,_0x319ca1[_0x9ea6('0x13')][_0x9ea6('0x14')]);return _0x4872eb(_0x319ca1[_0x9ea6('0x13')]['message']);}logger[_0x9ea6('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x212281,_0x319ca1[_0x9ea6('0x13')]['message']);return _0xd97d77(_0x319ca1[_0x9ea6('0x13')][_0x9ea6('0x14')]);}else{logger[_0x9ea6('0xe')](_0x9ea6('0x15'),_0x212281,_0x9ea6('0xf'));_0xd97d77(_0x319ca1['result']['message']);}})['catch'](function(_0x351023){logger['error'](_0x9ea6('0x15'),_0x212281,_0x351023);_0x4872eb(_0x351023);});});} \ No newline at end of file +var _0xa888=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x34f896,_0x17a8e7){var _0x567415=function(_0x554c03){while(--_0x554c03){_0x34f896['push'](_0x34f896['shift']());}};_0x567415(++_0x17a8e7);}(_0xa888,0x193));var _0x8a88=function(_0x12dfcd,_0x5008f6){_0x12dfcd=_0x12dfcd-0x0;var _0x25e2c9=_0xa888[_0x12dfcd];return _0x25e2c9;};'use strict';var _=require(_0x8a88('0x0'));var util=require(_0x8a88('0x1'));var moment=require(_0x8a88('0x2'));var BPromise=require(_0x8a88('0x3'));var rs=require(_0x8a88('0x4'));var fs=require('fs');var Redis=require(_0x8a88('0x5'));var db=require(_0x8a88('0x6'))['db'];var utils=require(_0x8a88('0x7'));var logger=require(_0x8a88('0x8'))(_0x8a88('0x9'));var config=require(_0x8a88('0xa'));var jayson=require(_0x8a88('0xb'));var client=jayson['client'][_0x8a88('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e2b82,_0x58910b,_0x179285){return new BPromise(function(_0x5a7fab,_0x217085){return client[_0x8a88('0xd')](_0x4e2b82,_0x179285)[_0x8a88('0xe')](function(_0x30d107){logger['info'](_0x8a88('0xf'),_0x58910b,'request\x20sent');logger[_0x8a88('0x10')](_0x8a88('0x11'),_0x58910b,_0x8a88('0x12'),JSON[_0x8a88('0x13')](_0x30d107));if(_0x30d107['error']){if(_0x30d107[_0x8a88('0x14')][_0x8a88('0x15')]===0x1f4){logger[_0x8a88('0x14')](_0x8a88('0xf'),_0x58910b,_0x30d107['error'][_0x8a88('0x16')]);return _0x217085(_0x30d107[_0x8a88('0x14')][_0x8a88('0x16')]);}logger[_0x8a88('0x14')]('VoiceMailMessage,\x20%s,\x20%s',_0x58910b,_0x30d107[_0x8a88('0x14')][_0x8a88('0x16')]);return _0x5a7fab(_0x30d107['error']['message']);}else{logger[_0x8a88('0x17')](_0x8a88('0xf'),_0x58910b,_0x8a88('0x12'));_0x5a7fab(_0x30d107['result'][_0x8a88('0x16')]);}})['catch'](function(_0x5dacab){logger[_0x8a88('0x14')](_0x8a88('0xf'),_0x58910b,_0x5dacab);_0x217085(_0x5dacab);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 86b5ea2..79402e0 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 _0x524a=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getSounds','post','create','/:id/sounds','update','delete','exports','multer','util'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x524a,0xf5));var _0xa524=function(_0x1b0163,_0x493396){_0x1b0163=_0x1b0163-0x0;var _0xfb07d2=_0x524a[_0x1b0163];return _0xfb07d2;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var auth=require(_0xa524('0x5'));var interaction=require(_0xa524('0x6'));var config=require('../../config/environment');var controller=require('./voiceMusicOnHold.controller');router[_0xa524('0x7')]('/',auth[_0xa524('0x8')](),controller[_0xa524('0x9')]);router['get'](_0xa524('0xa'),auth['isAuthenticated'](),controller[_0xa524('0xb')]);router[_0xa524('0x7')]('/:id/sounds',auth[_0xa524('0x8')](),controller[_0xa524('0xc')]);router[_0xa524('0xd')]('/',auth[_0xa524('0x8')](),controller[_0xa524('0xe')]);router['post'](_0xa524('0xf'),auth[_0xa524('0x8')](),controller['addSound']);router['put'](_0xa524('0xa'),auth[_0xa524('0x8')](),controller[_0xa524('0x10')]);router['delete']('/:id',auth[_0xa524('0x8')](),controller['destroy']);router[_0xa524('0x11')]('/:id/sounds/:id2',auth[_0xa524('0x8')](),controller['removeSound']);module[_0xa524('0x12')]=router; \ No newline at end of file +var _0x593e=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout'];(function(_0xeb483e,_0x21a05a){var _0x483188=function(_0xdcedd6){while(--_0xdcedd6){_0xeb483e['push'](_0xeb483e['shift']());}};_0x483188(++_0x21a05a);}(_0x593e,0xcb));var _0xe593=function(_0xfda873,_0x5e4fff){_0xfda873=_0xfda873-0x0;var _0x488ee7=_0x593e[_0xfda873];return _0x488ee7;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var auth=require(_0xe593('0x6'));var interaction=require(_0xe593('0x7'));var config=require('../../config/environment');var controller=require(_0xe593('0x8'));router[_0xe593('0x9')]('/',auth[_0xe593('0xa')](),controller[_0xe593('0xb')]);router[_0xe593('0x9')](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0xd')]);router[_0xe593('0x9')](_0xe593('0xe'),auth['isAuthenticated'](),controller[_0xe593('0xf')]);router[_0xe593('0x10')]('/',auth[_0xe593('0xa')](),controller['create']);router['post'](_0xe593('0xe'),auth[_0xe593('0xa')](),controller[_0xe593('0x11')]);router['put'](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0x12')]);router[_0xe593('0x13')](_0xe593('0xc'),auth[_0xe593('0xa')](),controller[_0xe593('0x14')]);router[_0xe593('0x13')](_0xe593('0x15'),auth[_0xe593('0xa')](),controller['removeSound']);module[_0xe593('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 09df93e..c84f781 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 _0x9272=['STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','name','ENUM','custom','files','mp3nb','quietmp3','mp3'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9272,0xb8));var _0x2927=function(_0x5a9a84,_0x4310a1){_0x5a9a84=_0x5a9a84-0x0;var _0x189267=_0x9272[_0x5a9a84];return _0x189267;};'use strict';var Sequelize=require(_0x2927('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2927('0x1')},'mode':{'type':Sequelize[_0x2927('0x2')](_0x2927('0x3'),_0x2927('0x4'),_0x2927('0x5'),'quietmp3nb',_0x2927('0x6'),_0x2927('0x7')),'allowNull':!![],'defaultValue':_0x2927('0x4')},'directory':{'type':Sequelize[_0x2927('0x8')],'allowNull':!![]},'application':{'type':Sequelize[_0x2927('0x8')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x2927('0x8')],'allowNull':!![],'defaultValue':_0x2927('0x9')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x2927('0xa')},'defaultEntry':{'type':Sequelize[_0x2927('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff52=['quietmp3nb','quietmp3','mp3','STRING','BOOLEAN','sequelize','exports','name','ENUM','files','mp3nb'];(function(_0x2cb4a2,_0x2bf0a2){var _0x4e3e58=function(_0x1c5ea1){while(--_0x1c5ea1){_0x2cb4a2['push'](_0x2cb4a2['shift']());}};_0x4e3e58(++_0x2bf0a2);}(_0xff52,0x1a7));var _0x2ff5=function(_0x266da8,_0x47419a){_0x266da8=_0x266da8-0x0;var _0x5cdbe0=_0xff52[_0x266da8];return _0x5cdbe0;};'use strict';var Sequelize=require(_0x2ff5('0x0'));module[_0x2ff5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2ff5('0x2')},'mode':{'type':Sequelize[_0x2ff5('0x3')]('custom',_0x2ff5('0x4'),_0x2ff5('0x5'),_0x2ff5('0x6'),_0x2ff5('0x7'),_0x2ff5('0x8')),'allowNull':!![],'defaultValue':_0x2ff5('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x2ff5('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x2ff5('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x2ff5('0x9')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x2ff5('0xa')],'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 7de183f..d774177 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 _0x77c8=['sort','where','pick','filter','map','type','VIRTUAL','field','merge','count','includeAll','findAll','catch','show','params','length','include','options','find','body','create','sequelize','transaction','mode','directory','root','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','join','rmdirSync','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','Sequelize','removeSound','findOne','id2','unlinkSync','format','getSounds','hasOwnProperty','html-pdf','eml-format','zip-dir','fast-json-patch','moment','util','path','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','sendStatus','status','offset','limit','set','json','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','model','keys','filters','intersection','query','attributes','fields','nolimit','order'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x77c8,0x17c));var _0x877c=function(_0x44216d,_0x4938a7){_0x44216d=_0x44216d-0x0;var _0xeca523=_0x77c8[_0x44216d];return _0xeca523;};'use strict';var pdf=require(_0x877c('0x0'));var emlformat=require(_0x877c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x877c('0x2'));var jsonpatch=require(_0x877c('0x3'));var rp=require('request-promise');var moment=require(_0x877c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x877c('0x5'));var path=require(_0x877c('0x6'));var sox=require('sox');var csv=require(_0x877c('0x7'));var ejs=require(_0x877c('0x8'));var fs=require('fs');var _=require(_0x877c('0x9'));var squel=require(_0x877c('0xa'));var crypto=require(_0x877c('0xb'));var jsforce=require(_0x877c('0xc'));var deskjs=require(_0x877c('0xd'));var toCsv=require(_0x877c('0x7'));var querystring=require(_0x877c('0xe'));var Papa=require(_0x877c('0xf'));var Redis=require(_0x877c('0x10'));var authService=require(_0x877c('0x11'));var qs=require(_0x877c('0x12'));var hardwareService=require(_0x877c('0x13'));var logger=require('../../config/logger')(_0x877c('0x14'));var utils=require(_0x877c('0x15'));var config=require(_0x877c('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x389009,_0x35ab23){_0x35ab23=_0x35ab23||0xcc;return function(_0x495488){if(_0x495488){return _0x389009[_0x877c('0x17')](_0x35ab23);}return _0x389009[_0x877c('0x18')](_0x35ab23)['end']();};}function respondWithResult(_0x7e8072,_0x14be53){_0x14be53=_0x14be53||0xc8;return function(_0x2e7033){if(_0x2e7033){return _0x7e8072['status'](_0x14be53)['json'](_0x2e7033);}};}function respondWithFilteredResult(_0x30f401,_0x469777){return function(_0x1411bc){if(_0x1411bc){var _0xfca7f9=_0x1411bc['count'],_0xf04d15=_0x469777[_0x877c('0x19')],_0x5748ad=_0x469777[_0x877c('0x19')]+_0x469777[_0x877c('0x1a')],_0x182299;if(_0x5748ad>=_0xfca7f9){_0x5748ad=_0xfca7f9;_0x182299=0xc8;}else{_0x182299=0xce;}_0x30f401['status'](_0x182299);return _0x30f401[_0x877c('0x1b')]('Content-Range',_0xf04d15+'-'+_0x5748ad+'/'+_0xfca7f9)[_0x877c('0x1c')](_0x1411bc);}return null;};}function patchUpdates(_0x31c59a){return function(_0xa421ad){try{jsonpatch['apply'](_0xa421ad,_0x31c59a,!![]);}catch(_0x9b3fd8){return BPromise[_0x877c('0x1d')](_0x9b3fd8);}return _0xa421ad[_0x877c('0x1e')]();};}function saveUpdates(_0x3400ed,_0xacfe24){return function(_0x177248){if(_0x177248){return _0x177248[_0x877c('0x1f')](_0x3400ed)[_0x877c('0x20')](function(_0xcc1439){return _0xcc1439;});}return null;};}function removeEntity(_0x4f6ba3,_0x2b5803){return function(_0x1a3216){if(_0x1a3216){return _0x1a3216[_0x877c('0x21')]()[_0x877c('0x20')](function(){var _0x351058=_0x1a3216[_0x877c('0x22')]({'plain':!![]});var _0x29e616=_0x877c('0x23');return db[_0x877c('0x24')][_0x877c('0x21')]({'where':{'type':_0x29e616,'resourceId':_0x351058['id']}})['then'](function(){return _0x1a3216;});})[_0x877c('0x20')](function(){_0x4f6ba3[_0x877c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e59bd,_0x568afb){return function(_0x2c5b7c){if(!_0x2c5b7c){_0x2e59bd[_0x877c('0x17')](0x194);}return _0x2c5b7c;};}function handleError(_0x39b59e,_0x323384){_0x323384=_0x323384||0x1f4;return function(_0x31c8d3){logger[_0x877c('0x25')](_0x31c8d3[_0x877c('0x26')]);if(_0x31c8d3[_0x877c('0x27')]){delete _0x31c8d3[_0x877c('0x27')];}_0x39b59e['status'](_0x323384)[_0x877c('0x28')](_0x31c8d3);};}exports['index']=function(_0x3126d7,_0x36dbfe){var _0x2d7787={},_0x232b18={},_0x46e285={'count':0x0,'rows':[]};var _0x174e5b=db[_0x877c('0x29')][_0x877c('0x2a')];_0x232b18[_0x877c('0x2b')]=_[_0x877c('0x2c')](_0x174e5b);_0x232b18['query']=_[_0x877c('0x2c')](_0x3126d7['query']);_0x232b18[_0x877c('0x2d')]=_[_0x877c('0x2e')](_0x232b18[_0x877c('0x2b')],_0x232b18[_0x877c('0x2f')]);_0x2d7787[_0x877c('0x30')]=_[_0x877c('0x2e')](_0x232b18['model'],qs[_0x877c('0x31')](_0x3126d7['query'][_0x877c('0x31')]));_0x2d7787['attributes']=_0x2d7787['attributes']['length']?_0x2d7787[_0x877c('0x30')]:_0x232b18[_0x877c('0x2b')];if(!_0x3126d7['query']['hasOwnProperty'](_0x877c('0x32'))){_0x2d7787[_0x877c('0x1a')]=qs['limit'](_0x3126d7[_0x877c('0x2f')][_0x877c('0x1a')]);_0x2d7787[_0x877c('0x19')]=qs['offset'](_0x3126d7[_0x877c('0x2f')][_0x877c('0x19')]);}_0x2d7787[_0x877c('0x33')]=qs['sort'](_0x3126d7['query'][_0x877c('0x34')]);_0x2d7787[_0x877c('0x35')]=qs[_0x877c('0x2d')](_[_0x877c('0x36')](_0x3126d7['query'],_0x232b18['filters']));if(_0x3126d7[_0x877c('0x2f')][_0x877c('0x37')]){_0x2d7787[_0x877c('0x35')]=_['merge'](_0x2d7787['where'],{'$or':_[_0x877c('0x38')](_0x174e5b,function(_0x1328fe){if(_0x1328fe[_0x877c('0x39')]['key']!==_0x877c('0x3a')){var _0x3a0db9={};_0x3a0db9[_0x1328fe[_0x877c('0x3b')]]={'$like':'%'+_0x3126d7['query'][_0x877c('0x37')]+'%'};return _0x3a0db9;}})});}_0x2d7787=_[_0x877c('0x3c')]({},_0x2d7787,_0x3126d7['options']);var _0x2040ce={'where':_0x2d7787[_0x877c('0x35')]};return db['VoiceMusicOnHold'][_0x877c('0x3d')](_0x2040ce)[_0x877c('0x20')](function(_0x2a7f74){_0x46e285[_0x877c('0x3d')]=_0x2a7f74;if(_0x3126d7[_0x877c('0x2f')][_0x877c('0x3e')]){_0x2d7787['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x877c('0x3f')](_0x2d7787);})[_0x877c('0x20')](function(_0x1e5675){_0x46e285['rows']=_0x1e5675;return _0x46e285;})[_0x877c('0x20')](respondWithFilteredResult(_0x36dbfe,_0x2d7787))[_0x877c('0x40')](handleError(_0x36dbfe,null));};exports[_0x877c('0x41')]=function(_0x5ce79d,_0x521d5e){var _0x55c4a8={'raw':![],'where':{'id':_0x5ce79d[_0x877c('0x42')]['id']}},_0x3079bb={};_0x3079bb['model']=_[_0x877c('0x2c')](db['VoiceMusicOnHold'][_0x877c('0x2a')]);_0x3079bb['query']=_[_0x877c('0x2c')](_0x5ce79d[_0x877c('0x2f')]);_0x3079bb['filters']=_['intersection'](_0x3079bb[_0x877c('0x2b')],_0x3079bb[_0x877c('0x2f')]);_0x55c4a8['attributes']=_['intersection'](_0x3079bb[_0x877c('0x2b')],qs['fields'](_0x5ce79d[_0x877c('0x2f')][_0x877c('0x31')]));_0x55c4a8[_0x877c('0x30')]=_0x55c4a8[_0x877c('0x30')][_0x877c('0x43')]?_0x55c4a8['attributes']:_0x3079bb[_0x877c('0x2b')];if(_0x5ce79d[_0x877c('0x2f')][_0x877c('0x3e')]){_0x55c4a8[_0x877c('0x44')]=[{'all':!![]}];}_0x55c4a8=_['merge']({},_0x55c4a8,_0x5ce79d[_0x877c('0x45')]);return db['VoiceMusicOnHold'][_0x877c('0x46')](_0x55c4a8)[_0x877c('0x20')](handleEntityNotFound(_0x521d5e,null))[_0x877c('0x20')](respondWithResult(_0x521d5e,null))[_0x877c('0x40')](handleError(_0x521d5e,null));};exports[_0x877c('0x1f')]=function(_0xfae506,_0x58b4c9){if(_0xfae506[_0x877c('0x47')]['id']){delete _0xfae506['body']['id'];}return db[_0x877c('0x29')][_0x877c('0x46')]({'where':{'id':_0xfae506[_0x877c('0x42')]['id']}})['then'](handleEntityNotFound(_0x58b4c9,null))[_0x877c('0x20')](saveUpdates(_0xfae506[_0x877c('0x47')],null))[_0x877c('0x20')](respondWithResult(_0x58b4c9,null))[_0x877c('0x40')](handleError(_0x58b4c9,null));};exports[_0x877c('0x48')]=function(_0x4cfa80,_0xc69a44,_0x351997){return db[_0x877c('0x49')][_0x877c('0x4a')](function(_0x27db00){if(_0x4cfa80[_0x877c('0x47')][_0x877c('0x4b')]==='files'){_0x4cfa80[_0x877c('0x47')][_0x877c('0x4c')]=path['join'](config[_0x877c('0x4d')],_0x877c('0x4e'),_0x4cfa80[_0x877c('0x47')][_0x877c('0x27')]);}return db[_0x877c('0x29')][_0x877c('0x48')](_0x4cfa80[_0x877c('0x47')],{'transaction':_0x27db00})[_0x877c('0x20')](function(_0x36f625){if(_0x4cfa80[_0x877c('0x47')][_0x877c('0x4b')]==='files'){fs[_0x877c('0x4f')](_0x36f625[_0x877c('0x4c')],parseInt(_0x877c('0x50'),0x8));}var _0x2d6451=_0x4cfa80[_0x877c('0x51')]['get']({'plain':!![]});if(!_0x2d6451)throw new Error(_0x877c('0x52'));if(_0x2d6451[_0x877c('0x53')]===_0x877c('0x51')){var _0x3f40c3=_0x36f625['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x877c('0x23'),'userProfileId':_0x2d6451[_0x877c('0x54')]},'raw':!![]})[_0x877c('0x20')](function(_0x7cf825){if(_0x7cf825&&_0x7cf825[_0x877c('0x55')]===0x0){return db[_0x877c('0x24')][_0x877c('0x48')]({'name':_0x3f40c3[_0x877c('0x27')],'resourceId':_0x3f40c3['id'],'type':_0x7cf825[_0x877c('0x27')],'sectionId':_0x7cf825['id']},{})['then'](function(){return _0x36f625;});}else{return _0x36f625;}})[_0x877c('0x40')](function(_0x25a7d2){logger[_0x877c('0x25')](_0x877c('0x56'),_0x25a7d2);});}return _0x36f625;});})[_0x877c('0x20')](respondWithResult(_0xc69a44,0xc9))[_0x877c('0x40')](handleError(_0xc69a44,null));};exports['destroy']=function(_0x3f0b41,_0x295884,_0x29f2be){var _0x3e4652;return db[_0x877c('0x29')][_0x877c('0x46')]({'where':{'id':_0x3f0b41[_0x877c('0x42')]['id']}})['then'](function(_0x48d54b){if(_0x48d54b){return db['sequelize']['transaction'](function(_0x35ba94){return _0x48d54b[_0x877c('0x21')]({'transaction':_0x35ba94,'raw':!![]})['then'](function(_0x13febd){if(_0x13febd[_0x877c('0x4c')]){fs[_0x877c('0x57')](_0x13febd[_0x877c('0x4c')])[_0x877c('0x58')](function(_0x205b9e){fs['unlinkSync'](path[_0x877c('0x59')](_0x13febd[_0x877c('0x4c')],_0x205b9e));});fs[_0x877c('0x5a')](_0x13febd[_0x877c('0x4c')]);}return _0x13febd;});})[_0x877c('0x40')](function(_0x487537){throw new db['Sequelize'][(_0x877c('0x5b'))](_0x487537[_0x877c('0x5c')]);});}})[_0x877c('0x20')](handleEntityNotFound(_0x295884,null))[_0x877c('0x20')](removeEntity(_0x295884,null))[_0x877c('0x40')](handleError(_0x295884,null));};exports['addSound']=function(_0x4405aa,_0x512f59,_0x483e90){return db[_0x877c('0x49')][_0x877c('0x4a')](function(_0x17fd98){var _0x2fb280;return db[_0x877c('0x29')][_0x877c('0x46')]({'where':{'id':_0x4405aa['params']['id']}})[_0x877c('0x20')](function(_0x5dce1c){if(_0x5dce1c){_0x2fb280=_0x5dce1c;return _0x5dce1c[_0x877c('0x5d')](_0x4405aa['body']['id'],{'transaction':_0x17fd98});}})['then'](function(_0x40c2be){if(_0x40c2be){return db[_0x877c('0x5e')]['findOne']({'where':{'id':_0x4405aa['body']['id']},'attributes':['id',_0x877c('0x27'),_0x877c('0x5f'),_0x877c('0x60'),_0x877c('0x61')],'raw':!![]});}})[_0x877c('0x20')](function(_0x2ad80e){if(_0x2ad80e){var _0x529bf6=path[_0x877c('0x59')](config[_0x877c('0x4d')],_0x877c('0x62'),util['format'](_0x877c('0x63'),path['basename'](_0x2ad80e[_0x877c('0x5f')],path['extname'](_0x2ad80e[_0x877c('0x5f')])),_0x2ad80e[_0x877c('0x60')]));var _0x16d428=path['join'](config['root'],_0x877c('0x4e'),_0x2fb280[_0x877c('0x27')],util['format'](_0x877c('0x63'),_0x2ad80e[_0x877c('0x27')],_0x2ad80e['converted_format']));fs['symlinkSync'](_0x529bf6,_0x16d428);return _0x2ad80e;}})[_0x877c('0x40')](function(_0x38ea86){throw new db[(_0x877c('0x64'))][(_0x877c('0x5b'))](_0x38ea86['message']);});})['then'](handleEntityNotFound(_0x512f59,null))[_0x877c('0x20')](respondWithResult(_0x512f59,0xc9))['catch'](handleError(_0x512f59,null));};exports[_0x877c('0x65')]=function(_0x5837f8,_0xcd5c16,_0x1e3eb6){return db[_0x877c('0x49')]['transaction'](function(_0x3baa61){var _0xcacc2d;return db['VoiceMusicOnHold'][_0x877c('0x66')]({'where':{'id':_0x5837f8['params']['id']}})[_0x877c('0x20')](handleEntityNotFound(_0xcd5c16,null))[_0x877c('0x20')](function(_0x39c575){if(_0x39c575){_0xcacc2d=_0x39c575;return _0x39c575[_0x877c('0x65')](_0x5837f8[_0x877c('0x42')]['id2']);}})[_0x877c('0x20')](function(_0x3ec0e8){if(_0x3ec0e8){return db['Sound'][_0x877c('0x66')]({'where':{'id':_0x5837f8[_0x877c('0x42')][_0x877c('0x67')]},'attributes':['id',_0x877c('0x27'),'save_name',_0x877c('0x60'),'createdAt'],'raw':!![]});}})[_0x877c('0x20')](function(_0x54878b){if(_0x54878b){fs[_0x877c('0x68')](path[_0x877c('0x59')](_0xcacc2d[_0x877c('0x4c')],util[_0x877c('0x69')](_0x877c('0x63'),_0x54878b[_0x877c('0x27')],_0x54878b['converted_format'])));return _0x54878b;}})[_0x877c('0x40')](function(_0x42445b){throw new db[(_0x877c('0x64'))]['ValidationError'](_0x42445b[_0x877c('0x5c')]);});})['then'](handleEntityNotFound(_0xcd5c16,null))[_0x877c('0x20')](respondWithStatusCode(_0xcd5c16,0xcc))[_0x877c('0x40')](handleError(_0xcd5c16,null));};exports[_0x877c('0x6a')]=function(_0x330524,_0x2d7868,_0x373974){var _0x392c44={};var _0x1b6b79={};var _0x1aedb9;var _0x294e8c;return db['VoiceMusicOnHold'][_0x877c('0x66')]({'where':{'id':_0x330524['params']['id']}})[_0x877c('0x20')](handleEntityNotFound(_0x2d7868,null))[_0x877c('0x20')](function(_0x5947dd){if(_0x5947dd){_0x1aedb9=_0x5947dd;_0x1b6b79[_0x877c('0x2b')]=_[_0x877c('0x2c')](db[_0x877c('0x5e')][_0x877c('0x2a')]);_0x1b6b79[_0x877c('0x2f')]=_[_0x877c('0x2c')](_0x330524[_0x877c('0x2f')]);_0x1b6b79[_0x877c('0x2d')]=_[_0x877c('0x2e')](_0x1b6b79['model'],_0x1b6b79[_0x877c('0x2f')]);_0x392c44[_0x877c('0x30')]=_[_0x877c('0x2e')](_0x1b6b79[_0x877c('0x2b')],qs['fields'](_0x330524[_0x877c('0x2f')][_0x877c('0x31')]));_0x392c44['attributes']=_0x392c44['attributes'][_0x877c('0x43')]?_0x392c44['attributes']:_0x1b6b79[_0x877c('0x2b')];_0x392c44[_0x877c('0x33')]=qs[_0x877c('0x34')](_0x330524[_0x877c('0x2f')]['sort']);_0x392c44['where']=qs[_0x877c('0x2d')](_[_0x877c('0x36')](_0x330524['query'],_0x1b6b79['filters']));if(_0x330524['query'][_0x877c('0x37')]){_0x392c44['where']=_[_0x877c('0x3c')](_0x392c44['where'],{'$or':_[_0x877c('0x38')](_0x392c44[_0x877c('0x30')],function(_0x3e8381){var _0x3ec460={};_0x3ec460[_0x3e8381]={'$like':'%'+_0x330524[_0x877c('0x2f')][_0x877c('0x37')]+'%'};return _0x3ec460;})});}_0x392c44=_[_0x877c('0x3c')]({},_0x392c44,_0x330524[_0x877c('0x45')]);return _0x1aedb9[_0x877c('0x6a')](_0x392c44);}})['then'](function(_0x583832){if(_0x583832){_0x294e8c=_0x583832[_0x877c('0x43')];if(!_0x330524[_0x877c('0x2f')][_0x877c('0x6b')](_0x877c('0x32'))){_0x392c44[_0x877c('0x1a')]=qs['limit'](_0x330524[_0x877c('0x2f')]['limit']);_0x392c44[_0x877c('0x19')]=qs[_0x877c('0x19')](_0x330524[_0x877c('0x2f')][_0x877c('0x19')]);}return _0x1aedb9['getSounds'](_0x392c44);}})['then'](function(_0x2c7718){if(_0x2c7718){return _0x2c7718?{'count':_0x294e8c,'rows':_0x2c7718}:null;}})[_0x877c('0x20')](respondWithResult(_0x2d7868,null))[_0x877c('0x40')](handleError(_0x2d7868,null));}; \ No newline at end of file +var _0x5c87=['message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','extname','format','symlinkSync','Sequelize','removeSound','id2','pick','getSounds','nolimit','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','sox','lodash','squel','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','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','error','stack','name','send','index','VoiceMusicOnHold','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','body','sequelize','mode','files','join','root','server/files/moh','mkdirSync','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','readdirSync','forEach','rmdirSync','ValidationError'];(function(_0x1b1a41,_0x37fdba){var _0x2ef3b7=function(_0x4ee4e0){while(--_0x4ee4e0){_0x1b1a41['push'](_0x1b1a41['shift']());}};_0x2ef3b7(++_0x37fdba);}(_0x5c87,0x85));var _0x75c8=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x5c87[_0x42245d];return _0x4b211a;};'use strict';var pdf=require(_0x75c8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x75c8('0x1'));var zipdir=require(_0x75c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x75c8('0x3'));var BPromise=require(_0x75c8('0x4'));var Mustache=require('mustache');var util=require(_0x75c8('0x5'));var path=require(_0x75c8('0x6'));var sox=require(_0x75c8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x75c8('0x8'));var squel=require(_0x75c8('0x9'));var crypto=require(_0x75c8('0xa'));var jsforce=require(_0x75c8('0xb'));var deskjs=require(_0x75c8('0xc'));var toCsv=require(_0x75c8('0xd'));var querystring=require(_0x75c8('0xe'));var Papa=require(_0x75c8('0xf'));var Redis=require(_0x75c8('0x10'));var authService=require(_0x75c8('0x11'));var qs=require(_0x75c8('0x12'));var hardwareService=require(_0x75c8('0x13'));var logger=require(_0x75c8('0x14'))(_0x75c8('0x15'));var utils=require(_0x75c8('0x16'));var config=require(_0x75c8('0x17'));var db=require(_0x75c8('0x18'))['db'];function respondWithStatusCode(_0x8a5f5b,_0x291547){_0x291547=_0x291547||0xcc;return function(_0x15635d){if(_0x15635d){return _0x8a5f5b[_0x75c8('0x19')](_0x291547);}return _0x8a5f5b[_0x75c8('0x1a')](_0x291547)[_0x75c8('0x1b')]();};}function respondWithResult(_0x1c15bb,_0x3a1439){_0x3a1439=_0x3a1439||0xc8;return function(_0x15ce40){if(_0x15ce40){return _0x1c15bb[_0x75c8('0x1a')](_0x3a1439)[_0x75c8('0x1c')](_0x15ce40);}};}function respondWithFilteredResult(_0x9ffb28,_0x28c46e){return function(_0x955658){if(_0x955658){var _0x15b57d=_0x955658[_0x75c8('0x1d')],_0x58ba75=_0x28c46e['offset'],_0x3e1f23=_0x28c46e[_0x75c8('0x1e')]+_0x28c46e['limit'],_0x1099d4;if(_0x3e1f23>=_0x15b57d){_0x3e1f23=_0x15b57d;_0x1099d4=0xc8;}else{_0x1099d4=0xce;}_0x9ffb28['status'](_0x1099d4);return _0x9ffb28[_0x75c8('0x1f')](_0x75c8('0x20'),_0x58ba75+'-'+_0x3e1f23+'/'+_0x15b57d)[_0x75c8('0x1c')](_0x955658);}return null;};}function patchUpdates(_0x580daf){return function(_0x1aa4e0){try{jsonpatch[_0x75c8('0x21')](_0x1aa4e0,_0x580daf,!![]);}catch(_0x285b96){return BPromise[_0x75c8('0x22')](_0x285b96);}return _0x1aa4e0[_0x75c8('0x23')]();};}function saveUpdates(_0x48fa32,_0x32f170){return function(_0x3e8b58){if(_0x3e8b58){return _0x3e8b58[_0x75c8('0x24')](_0x48fa32)[_0x75c8('0x25')](function(_0x5c010e){return _0x5c010e;});}return null;};}function removeEntity(_0x51ccd0,_0x7bbae4){return function(_0x522a79){if(_0x522a79){return _0x522a79['destroy']()['then'](function(){var _0x2cabff=_0x522a79[_0x75c8('0x26')]({'plain':!![]});var _0x416e64=_0x75c8('0x27');return db[_0x75c8('0x28')][_0x75c8('0x29')]({'where':{'type':_0x416e64,'resourceId':_0x2cabff['id']}})[_0x75c8('0x25')](function(){return _0x522a79;});})[_0x75c8('0x25')](function(){_0x51ccd0[_0x75c8('0x1a')](0xcc)[_0x75c8('0x1b')]();});}};}function handleEntityNotFound(_0xd6cf59,_0x9fd700){return function(_0x3cfcae){if(!_0x3cfcae){_0xd6cf59[_0x75c8('0x19')](0x194);}return _0x3cfcae;};}function handleError(_0x222d33,_0x1511aa){_0x1511aa=_0x1511aa||0x1f4;return function(_0x7cfdbb){logger[_0x75c8('0x2a')](_0x7cfdbb[_0x75c8('0x2b')]);if(_0x7cfdbb[_0x75c8('0x2c')]){delete _0x7cfdbb[_0x75c8('0x2c')];}_0x222d33['status'](_0x1511aa)[_0x75c8('0x2d')](_0x7cfdbb);};}exports[_0x75c8('0x2e')]=function(_0x92db8a,_0xc92df5){var _0x2fe868={},_0x59ca1b={},_0x1efc87={'count':0x0,'rows':[]};var _0x115372=db[_0x75c8('0x2f')]['rawAttributes'];_0x59ca1b[_0x75c8('0x30')]=_[_0x75c8('0x31')](_0x115372);_0x59ca1b[_0x75c8('0x32')]=_[_0x75c8('0x31')](_0x92db8a[_0x75c8('0x32')]);_0x59ca1b[_0x75c8('0x33')]=_['intersection'](_0x59ca1b['model'],_0x59ca1b[_0x75c8('0x32')]);_0x2fe868[_0x75c8('0x34')]=_[_0x75c8('0x35')](_0x59ca1b[_0x75c8('0x30')],qs[_0x75c8('0x36')](_0x92db8a['query'][_0x75c8('0x36')]));_0x2fe868[_0x75c8('0x34')]=_0x2fe868['attributes'][_0x75c8('0x37')]?_0x2fe868[_0x75c8('0x34')]:_0x59ca1b['model'];if(!_0x92db8a[_0x75c8('0x32')][_0x75c8('0x38')]('nolimit')){_0x2fe868['limit']=qs['limit'](_0x92db8a[_0x75c8('0x32')][_0x75c8('0x39')]);_0x2fe868[_0x75c8('0x1e')]=qs['offset'](_0x92db8a[_0x75c8('0x32')][_0x75c8('0x1e')]);}_0x2fe868[_0x75c8('0x3a')]=qs[_0x75c8('0x3b')](_0x92db8a[_0x75c8('0x32')][_0x75c8('0x3b')]);_0x2fe868[_0x75c8('0x3c')]=qs[_0x75c8('0x33')](_['pick'](_0x92db8a[_0x75c8('0x32')],_0x59ca1b['filters']));if(_0x92db8a[_0x75c8('0x32')][_0x75c8('0x3d')]){_0x2fe868[_0x75c8('0x3c')]=_[_0x75c8('0x3e')](_0x2fe868[_0x75c8('0x3c')],{'$or':_[_0x75c8('0x3f')](_0x115372,function(_0x4d1e26){if(_0x4d1e26[_0x75c8('0x40')][_0x75c8('0x41')]!==_0x75c8('0x42')){var _0x2ccf08={};_0x2ccf08[_0x4d1e26[_0x75c8('0x43')]]={'$like':'%'+_0x92db8a['query'][_0x75c8('0x3d')]+'%'};return _0x2ccf08;}})});}_0x2fe868=_['merge']({},_0x2fe868,_0x92db8a[_0x75c8('0x44')]);var _0x523e09={'where':_0x2fe868[_0x75c8('0x3c')]};return db[_0x75c8('0x2f')]['count'](_0x523e09)[_0x75c8('0x25')](function(_0x130796){_0x1efc87[_0x75c8('0x1d')]=_0x130796;if(_0x92db8a[_0x75c8('0x32')][_0x75c8('0x45')]){_0x2fe868[_0x75c8('0x46')]=[{'all':!![]}];}return db[_0x75c8('0x2f')][_0x75c8('0x47')](_0x2fe868);})[_0x75c8('0x25')](function(_0x46cd36){_0x1efc87[_0x75c8('0x48')]=_0x46cd36;return _0x1efc87;})[_0x75c8('0x25')](respondWithFilteredResult(_0xc92df5,_0x2fe868))[_0x75c8('0x49')](handleError(_0xc92df5,null));};exports['show']=function(_0x50f7b1,_0x309ae){var _0x15e139={'raw':![],'where':{'id':_0x50f7b1[_0x75c8('0x4a')]['id']}},_0x5beda0={};_0x5beda0['model']=_['keys'](db['VoiceMusicOnHold'][_0x75c8('0x4b')]);_0x5beda0[_0x75c8('0x32')]=_[_0x75c8('0x31')](_0x50f7b1[_0x75c8('0x32')]);_0x5beda0['filters']=_[_0x75c8('0x35')](_0x5beda0['model'],_0x5beda0[_0x75c8('0x32')]);_0x15e139[_0x75c8('0x34')]=_[_0x75c8('0x35')](_0x5beda0[_0x75c8('0x30')],qs['fields'](_0x50f7b1['query'][_0x75c8('0x36')]));_0x15e139['attributes']=_0x15e139[_0x75c8('0x34')][_0x75c8('0x37')]?_0x15e139[_0x75c8('0x34')]:_0x5beda0['model'];if(_0x50f7b1[_0x75c8('0x32')][_0x75c8('0x45')]){_0x15e139['include']=[{'all':!![]}];}_0x15e139=_[_0x75c8('0x3e')]({},_0x15e139,_0x50f7b1['options']);return db[_0x75c8('0x2f')][_0x75c8('0x4c')](_0x15e139)['then'](handleEntityNotFound(_0x309ae,null))[_0x75c8('0x25')](respondWithResult(_0x309ae,null))[_0x75c8('0x49')](handleError(_0x309ae,null));};exports[_0x75c8('0x24')]=function(_0xd886a8,_0x686953){if(_0xd886a8[_0x75c8('0x4d')]['id']){delete _0xd886a8[_0x75c8('0x4d')]['id'];}return db[_0x75c8('0x2f')][_0x75c8('0x4c')]({'where':{'id':_0xd886a8[_0x75c8('0x4a')]['id']}})[_0x75c8('0x25')](handleEntityNotFound(_0x686953,null))[_0x75c8('0x25')](saveUpdates(_0xd886a8[_0x75c8('0x4d')],null))[_0x75c8('0x25')](respondWithResult(_0x686953,null))['catch'](handleError(_0x686953,null));};exports['create']=function(_0x4267e2,_0x2eee3f,_0x2e5e3d){return db[_0x75c8('0x4e')]['transaction'](function(_0x169e72){if(_0x4267e2[_0x75c8('0x4d')][_0x75c8('0x4f')]===_0x75c8('0x50')){_0x4267e2[_0x75c8('0x4d')]['directory']=path[_0x75c8('0x51')](config[_0x75c8('0x52')],_0x75c8('0x53'),_0x4267e2[_0x75c8('0x4d')][_0x75c8('0x2c')]);}return db[_0x75c8('0x2f')]['create'](_0x4267e2[_0x75c8('0x4d')],{'transaction':_0x169e72})[_0x75c8('0x25')](function(_0x29bb85){if(_0x4267e2[_0x75c8('0x4d')][_0x75c8('0x4f')]===_0x75c8('0x50')){fs[_0x75c8('0x54')](_0x29bb85[_0x75c8('0x55')],parseInt('0777',0x8));}var _0x2c1a34=_0x4267e2['user'][_0x75c8('0x26')]({'plain':!![]});if(!_0x2c1a34)throw new Error(_0x75c8('0x56'));if(_0x2c1a34[_0x75c8('0x57')]===_0x75c8('0x58')){var _0x4c2126=_0x29bb85[_0x75c8('0x26')]({'plain':!![]});return db[_0x75c8('0x59')][_0x75c8('0x4c')]({'where':{'name':_0x75c8('0x27'),'userProfileId':_0x2c1a34[_0x75c8('0x5a')]},'raw':!![]})[_0x75c8('0x25')](function(_0xb2d5b7){if(_0xb2d5b7&&_0xb2d5b7['autoAssociation']===0x0){return db[_0x75c8('0x28')]['create']({'name':_0x4c2126[_0x75c8('0x2c')],'resourceId':_0x4c2126['id'],'type':_0xb2d5b7[_0x75c8('0x2c')],'sectionId':_0xb2d5b7['id']},{})[_0x75c8('0x25')](function(){return _0x29bb85;});}else{return _0x29bb85;}})[_0x75c8('0x49')](function(_0x160169){logger[_0x75c8('0x2a')](_0x75c8('0x5b'),_0x160169);});}return _0x29bb85;});})[_0x75c8('0x25')](respondWithResult(_0x2eee3f,0xc9))[_0x75c8('0x49')](handleError(_0x2eee3f,null));};exports['destroy']=function(_0x78ec3d,_0x39b2fc,_0x4020b6){var _0x3abb0a;return db[_0x75c8('0x2f')]['find']({'where':{'id':_0x78ec3d[_0x75c8('0x4a')]['id']}})['then'](function(_0x2be9ff){if(_0x2be9ff){return db[_0x75c8('0x4e')][_0x75c8('0x5c')](function(_0xb3e4b1){return _0x2be9ff['destroy']({'transaction':_0xb3e4b1,'raw':!![]})[_0x75c8('0x25')](function(_0xdb60ff){if(_0xdb60ff['directory']){fs[_0x75c8('0x5d')](_0xdb60ff[_0x75c8('0x55')])[_0x75c8('0x5e')](function(_0x71be4){fs['unlinkSync'](path[_0x75c8('0x51')](_0xdb60ff[_0x75c8('0x55')],_0x71be4));});fs[_0x75c8('0x5f')](_0xdb60ff['directory']);}return _0xdb60ff;});})['catch'](function(_0x53327a){throw new db['Sequelize'][(_0x75c8('0x60'))](_0x53327a[_0x75c8('0x61')]);});}})[_0x75c8('0x25')](handleEntityNotFound(_0x39b2fc,null))['then'](removeEntity(_0x39b2fc,null))[_0x75c8('0x49')](handleError(_0x39b2fc,null));};exports[_0x75c8('0x62')]=function(_0x1098aa,_0xddf9f,_0x4b2df8){return db[_0x75c8('0x4e')][_0x75c8('0x5c')](function(_0x37836c){var _0x56ec02;return db[_0x75c8('0x2f')][_0x75c8('0x4c')]({'where':{'id':_0x1098aa['params']['id']}})[_0x75c8('0x25')](function(_0x2e35f4){if(_0x2e35f4){_0x56ec02=_0x2e35f4;return _0x2e35f4['addSound'](_0x1098aa[_0x75c8('0x4d')]['id'],{'transaction':_0x37836c});}})[_0x75c8('0x25')](function(_0x5d70b1){if(_0x5d70b1){return db[_0x75c8('0x63')][_0x75c8('0x64')]({'where':{'id':_0x1098aa[_0x75c8('0x4d')]['id']},'attributes':['id','name',_0x75c8('0x65'),_0x75c8('0x66'),_0x75c8('0x67')],'raw':!![]});}})[_0x75c8('0x25')](function(_0x581281){if(_0x581281){var _0x5999c4=path[_0x75c8('0x51')](config['root'],_0x75c8('0x68'),util['format'](_0x75c8('0x69'),path['basename'](_0x581281[_0x75c8('0x65')],path[_0x75c8('0x6a')](_0x581281[_0x75c8('0x65')])),_0x581281[_0x75c8('0x66')]));var _0x2cc3c1=path['join'](config['root'],_0x75c8('0x53'),_0x56ec02['name'],util[_0x75c8('0x6b')](_0x75c8('0x69'),_0x581281[_0x75c8('0x2c')],_0x581281[_0x75c8('0x66')]));fs[_0x75c8('0x6c')](_0x5999c4,_0x2cc3c1);return _0x581281;}})[_0x75c8('0x49')](function(_0x46b059){throw new db[(_0x75c8('0x6d'))]['ValidationError'](_0x46b059[_0x75c8('0x61')]);});})[_0x75c8('0x25')](handleEntityNotFound(_0xddf9f,null))[_0x75c8('0x25')](respondWithResult(_0xddf9f,0xc9))[_0x75c8('0x49')](handleError(_0xddf9f,null));};exports[_0x75c8('0x6e')]=function(_0x204fe5,_0x3696b8,_0xb583){return db[_0x75c8('0x4e')][_0x75c8('0x5c')](function(_0x194b26){var _0x110d28;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x204fe5[_0x75c8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3696b8,null))['then'](function(_0x56833c){if(_0x56833c){_0x110d28=_0x56833c;return _0x56833c['removeSound'](_0x204fe5[_0x75c8('0x4a')]['id2']);}})[_0x75c8('0x25')](function(_0x119774){if(_0x119774){return db[_0x75c8('0x63')][_0x75c8('0x64')]({'where':{'id':_0x204fe5[_0x75c8('0x4a')][_0x75c8('0x6f')]},'attributes':['id','name',_0x75c8('0x65'),'converted_format',_0x75c8('0x67')],'raw':!![]});}})['then'](function(_0x1456c8){if(_0x1456c8){fs['unlinkSync'](path[_0x75c8('0x51')](_0x110d28['directory'],util[_0x75c8('0x6b')](_0x75c8('0x69'),_0x1456c8[_0x75c8('0x2c')],_0x1456c8[_0x75c8('0x66')])));return _0x1456c8;}})['catch'](function(_0x107d9a){throw new db['Sequelize'][(_0x75c8('0x60'))](_0x107d9a[_0x75c8('0x61')]);});})['then'](handleEntityNotFound(_0x3696b8,null))[_0x75c8('0x25')](respondWithStatusCode(_0x3696b8,0xcc))['catch'](handleError(_0x3696b8,null));};exports['getSounds']=function(_0x1365bd,_0xe94579,_0x460172){var _0x391c8a={};var _0x232df3={};var _0x1e523;var _0x5f2e0f;return db[_0x75c8('0x2f')][_0x75c8('0x64')]({'where':{'id':_0x1365bd[_0x75c8('0x4a')]['id']}})[_0x75c8('0x25')](handleEntityNotFound(_0xe94579,null))['then'](function(_0x22e257){if(_0x22e257){_0x1e523=_0x22e257;_0x232df3[_0x75c8('0x30')]=_[_0x75c8('0x31')](db[_0x75c8('0x63')][_0x75c8('0x4b')]);_0x232df3[_0x75c8('0x32')]=_[_0x75c8('0x31')](_0x1365bd[_0x75c8('0x32')]);_0x232df3[_0x75c8('0x33')]=_[_0x75c8('0x35')](_0x232df3[_0x75c8('0x30')],_0x232df3[_0x75c8('0x32')]);_0x391c8a[_0x75c8('0x34')]=_[_0x75c8('0x35')](_0x232df3['model'],qs[_0x75c8('0x36')](_0x1365bd[_0x75c8('0x32')][_0x75c8('0x36')]));_0x391c8a['attributes']=_0x391c8a[_0x75c8('0x34')][_0x75c8('0x37')]?_0x391c8a['attributes']:_0x232df3[_0x75c8('0x30')];_0x391c8a[_0x75c8('0x3a')]=qs[_0x75c8('0x3b')](_0x1365bd[_0x75c8('0x32')][_0x75c8('0x3b')]);_0x391c8a[_0x75c8('0x3c')]=qs[_0x75c8('0x33')](_[_0x75c8('0x70')](_0x1365bd[_0x75c8('0x32')],_0x232df3[_0x75c8('0x33')]));if(_0x1365bd[_0x75c8('0x32')][_0x75c8('0x3d')]){_0x391c8a[_0x75c8('0x3c')]=_['merge'](_0x391c8a[_0x75c8('0x3c')],{'$or':_[_0x75c8('0x3f')](_0x391c8a[_0x75c8('0x34')],function(_0x2636c6){var _0x4d4426={};_0x4d4426[_0x2636c6]={'$like':'%'+_0x1365bd[_0x75c8('0x32')][_0x75c8('0x3d')]+'%'};return _0x4d4426;})});}_0x391c8a=_[_0x75c8('0x3e')]({},_0x391c8a,_0x1365bd[_0x75c8('0x44')]);return _0x1e523[_0x75c8('0x71')](_0x391c8a);}})[_0x75c8('0x25')](function(_0x242dd7){if(_0x242dd7){_0x5f2e0f=_0x242dd7[_0x75c8('0x37')];if(!_0x1365bd[_0x75c8('0x32')][_0x75c8('0x38')](_0x75c8('0x72'))){_0x391c8a[_0x75c8('0x39')]=qs[_0x75c8('0x39')](_0x1365bd[_0x75c8('0x32')][_0x75c8('0x39')]);_0x391c8a[_0x75c8('0x1e')]=qs[_0x75c8('0x1e')](_0x1365bd['query']['offset']);}return _0x1e523[_0x75c8('0x71')](_0x391c8a);}})[_0x75c8('0x25')](function(_0x4bd98f){if(_0x4bd98f){return _0x4bd98f?{'count':_0x5f2e0f,'rows':_0x4bd98f}:null;}})[_0x75c8('0x25')](respondWithResult(_0xe94579,null))[_0x75c8('0x49')](handleError(_0xe94579,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1ce1b20..0482df2 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 _0x16dc=['rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x44666f,_0x4607da){var _0x12f4b6=function(_0x252785){while(--_0x252785){_0x44666f['push'](_0x44666f['shift']());}};_0x12f4b6(++_0x4607da);}(_0x16dc,0x186));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc16d('0x0'));var util=require('util');var logger=require(_0xc16d('0x1'))(_0xc16d('0x2'));var moment=require(_0xc16d('0x3'));var BPromise=require(_0xc16d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc16d('0x5'));var rimraf=require(_0xc16d('0x6'));var config=require(_0xc16d('0x7'));var attributes=require(_0xc16d('0x8'));module[_0xc16d('0x9')]=function(_0x5ce6c8,_0x29640e){return _0x5ce6c8['define'](_0xc16d('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5e4=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','util','../../config/logger','api','bluebird','request-promise'];(function(_0x59c348,_0x140d8f){var _0x544bb5=function(_0x468a62){while(--_0x468a62){_0x59c348['push'](_0x59c348['shift']());}};_0x544bb5(++_0x140d8f);}(_0xd5e4,0x193));var _0x4d5e=function(_0x63faf6,_0x593906){_0x63faf6=_0x63faf6-0x0;var _0x8dcb9c=_0xd5e4[_0x63faf6];return _0x8dcb9c;};'use strict';var _=require('lodash');var util=require(_0x4d5e('0x0'));var logger=require(_0x4d5e('0x1'))(_0x4d5e('0x2'));var moment=require('moment');var BPromise=require(_0x4d5e('0x3'));var rp=require(_0x4d5e('0x4'));var fs=require('fs');var path=require(_0x4d5e('0x5'));var rimraf=require(_0x4d5e('0x6'));var config=require(_0x4d5e('0x7'));var attributes=require(_0x4d5e('0x8'));module[_0x4d5e('0x9')]=function(_0x373929,_0x623b20){return _0x373929[_0x4d5e('0xa')](_0x4d5e('0xb'),attributes,{'tableName':'voice_musiconhold','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 edaf53d..b52f699 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 _0x95d3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x36de2c,_0x5a32ef){var _0x1d0b63=function(_0x8746df){while(--_0x8746df){_0x36de2c['push'](_0x36de2c['shift']());}};_0x1d0b63(++_0x5a32ef);}(_0x95d3,0x126));var _0x395d=function(_0x27e7ec,_0x1b2315){_0x27e7ec=_0x27e7ec-0x0;var _0x2ec59f=_0x95d3[_0x27e7ec];return _0x2ec59f;};'use strict';var _=require(_0x395d('0x0'));var util=require('util');var moment=require(_0x395d('0x1'));var BPromise=require(_0x395d('0x2'));var rs=require(_0x395d('0x3'));var fs=require('fs');var Redis=require(_0x395d('0x4'));var db=require(_0x395d('0x5'))['db'];var utils=require(_0x395d('0x6'));var logger=require(_0x395d('0x7'))(_0x395d('0x8'));var config=require(_0x395d('0x9'));var jayson=require(_0x395d('0xa'));var client=jayson[_0x395d('0xb')][_0x395d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x136374,_0x33e1fd,_0x4ef7f0){return new BPromise(function(_0x3ef48b,_0x57a656){return client[_0x395d('0xd')](_0x136374,_0x4ef7f0)['then'](function(_0x22fa1d){logger[_0x395d('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x33e1fd,_0x395d('0xf'));logger['debug'](_0x395d('0x10'),_0x33e1fd,_0x395d('0xf'),JSON[_0x395d('0x11')](_0x22fa1d));if(_0x22fa1d['error']){if(_0x22fa1d[_0x395d('0x12')]['code']===0x1f4){logger['error'](_0x395d('0x13'),_0x33e1fd,_0x22fa1d[_0x395d('0x12')][_0x395d('0x14')]);return _0x57a656(_0x22fa1d[_0x395d('0x12')]['message']);}logger[_0x395d('0x12')](_0x395d('0x13'),_0x33e1fd,_0x22fa1d[_0x395d('0x12')][_0x395d('0x14')]);return _0x3ef48b(_0x22fa1d[_0x395d('0x12')]['message']);}else{logger[_0x395d('0xe')](_0x395d('0x13'),_0x33e1fd,_0x395d('0xf'));_0x3ef48b(_0x22fa1d[_0x395d('0x15')][_0x395d('0x14')]);}})[_0x395d('0x16')](function(_0x32c407){logger[_0x395d('0x12')](_0x395d('0x13'),_0x33e1fd,_0x32c407);_0x57a656(_0x32c407);});});} \ No newline at end of file +var _0x16a6=['message','catch','lodash','util','moment','ioredis','../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0x11ef0d,_0x48d609){var _0x1800ec=function(_0x275eb6){while(--_0x275eb6){_0x11ef0d['push'](_0x11ef0d['shift']());}};_0x1800ec(++_0x48d609);}(_0x16a6,0x6e));var _0x616a=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x16a6[_0xd63e3a];return _0x19c178;};'use strict';var _=require(_0x616a('0x0'));var util=require(_0x616a('0x1'));var moment=require(_0x616a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x616a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x616a('0x4'));var logger=require('../../config/logger')(_0x616a('0x5'));var config=require('../../config/environment');var jayson=require(_0x616a('0x6'));var client=jayson['client'][_0x616a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x7e7331,_0x4e7afc,_0x33b0e9){return new BPromise(function(_0x3317de,_0x39d29c){return client[_0x616a('0x8')](_0x7e7331,_0x33b0e9)['then'](function(_0x100237){logger[_0x616a('0x9')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4e7afc,_0x616a('0xa'));logger['debug'](_0x616a('0xb'),_0x4e7afc,'request\x20sent',JSON[_0x616a('0xc')](_0x100237));if(_0x100237[_0x616a('0xd')]){if(_0x100237['error'][_0x616a('0xe')]===0x1f4){logger[_0x616a('0xd')](_0x616a('0xf'),_0x4e7afc,_0x100237[_0x616a('0xd')]['message']);return _0x39d29c(_0x100237[_0x616a('0xd')][_0x616a('0x10')]);}logger[_0x616a('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4e7afc,_0x100237[_0x616a('0xd')]['message']);return _0x3317de(_0x100237[_0x616a('0xd')][_0x616a('0x10')]);}else{logger[_0x616a('0x9')](_0x616a('0xf'),_0x4e7afc,_0x616a('0xa'));_0x3317de(_0x100237['result'][_0x616a('0x10')]);}})[_0x616a('0x11')](function(_0x57571c){logger[_0x616a('0xd')](_0x616a('0xf'),_0x4e7afc,_0x57571c);_0x39d29c(_0x57571c);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index cdd85e5..859eac2 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 _0xe28e=['getAgents','post','create','addAgents','put','update','delete','destroy','/:id/users','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x179312,_0x248244){var _0x1301a5=function(_0x28ad9f){while(--_0x28ad9f){_0x179312['push'](_0x179312['shift']());}};_0x1301a5(++_0x248244);}(_0xe28e,0x1ba));var _0xee28=function(_0x10b64b,_0xd15226){_0x10b64b=_0x10b64b-0x0;var _0x1451a9=_0xe28e[_0x10b64b];return _0x1451a9;};'use strict';var multer=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var path=require(_0xee28('0x2'));var timeout=require(_0xee28('0x3'));var express=require(_0xee28('0x4'));var router=express[_0xee28('0x5')]();var auth=require(_0xee28('0x6'));var interaction=require(_0xee28('0x7'));var config=require(_0xee28('0x8'));var controller=require(_0xee28('0x9'));router[_0xee28('0xa')]('/',auth[_0xee28('0xb')](),controller[_0xee28('0xc')]);router['get'](_0xee28('0xd'),auth[_0xee28('0xb')](),controller[_0xee28('0xe')]);router[_0xee28('0xa')](_0xee28('0xf'),auth[_0xee28('0xb')](),controller[_0xee28('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xee28('0x11')]);router[_0xee28('0x12')]('/',auth['isAuthenticated'](),controller[_0xee28('0x13')]);router[_0xee28('0x12')]('/:id/users',auth[_0xee28('0xb')](),controller[_0xee28('0x14')]);router[_0xee28('0x15')](_0xee28('0xf'),auth[_0xee28('0xb')](),controller[_0xee28('0x16')]);router[_0xee28('0x17')]('/:id',auth[_0xee28('0xb')](),controller[_0xee28('0x18')]);router[_0xee28('0x17')](_0xee28('0x19'),auth[_0xee28('0xb')](),controller['removeAgents']);module[_0xee28('0x1a')]=router; \ No newline at end of file +var _0x064b=['show','/:id/users','getAgents','post','create','addAgents','put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','isAuthenticated','describe'];(function(_0x32873f,_0x9399b0){var _0x4cff00=function(_0x448889){while(--_0x448889){_0x32873f['push'](_0x32873f['shift']());}};_0x4cff00(++_0x9399b0);}(_0x064b,0xd9));var _0xb064=function(_0x55c124,_0x630c5d){_0x55c124=_0x55c124-0x0;var _0x4cdac6=_0x064b[_0x55c124];return _0x4cdac6;};'use strict';var multer=require(_0xb064('0x0'));var util=require(_0xb064('0x1'));var path=require(_0xb064('0x2'));var timeout=require(_0xb064('0x3'));var express=require('express');var router=express[_0xb064('0x4')]();var auth=require(_0xb064('0x5'));var interaction=require(_0xb064('0x6'));var config=require(_0xb064('0x7'));var controller=require(_0xb064('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb064('0x9')](_0xb064('0xa'),auth[_0xb064('0xb')](),controller[_0xb064('0xc')]);router['get']('/:id',auth[_0xb064('0xb')](),controller[_0xb064('0xd')]);router[_0xb064('0x9')](_0xb064('0xe'),auth[_0xb064('0xb')](),controller[_0xb064('0xf')]);router[_0xb064('0x10')]('/',auth[_0xb064('0xb')](),controller[_0xb064('0x11')]);router[_0xb064('0x10')](_0xb064('0xe'),auth[_0xb064('0xb')](),controller[_0xb064('0x12')]);router[_0xb064('0x13')](_0xb064('0x14'),auth['isAuthenticated'](),controller[_0xb064('0x15')]);router[_0xb064('0x16')](_0xb064('0x14'),auth[_0xb064('0xb')](),controller['destroy']);router[_0xb064('0x16')](_0xb064('0xe'),auth[_0xb064('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index f94db43..f81ea5b 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 _0x239f=['STRING','INTEGER','system-','name'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x239f,0x10a));var _0xf239=function(_0x18e987,_0x356287){_0x18e987=_0x18e987-0x0;var _0x589f52=_0x239f[_0x18e987];return _0x589f52;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x5e1be0){return _0xf239('0x0')+this['getDataValue'](_0xf239('0x1'))+'-';}},'description':{'type':Sequelize[_0xf239('0x2')]},'callerIdAll':{'type':Sequelize[_0xf239('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xf239('0x3')]}}; \ No newline at end of file +var _0x1b4f=['exports','STRING','name','VIRTUAL','system-','INTEGER','sequelize'];(function(_0x398b3d,_0x2f497e){var _0x20b1cf=function(_0x23a3ea){while(--_0x23a3ea){_0x398b3d['push'](_0x398b3d['shift']());}};_0x20b1cf(++_0x2f497e);}(_0x1b4f,0xd8));var _0xf1b4=function(_0x133173,_0x37cb55){_0x133173=_0x133173-0x0;var _0x2cf355=_0x1b4f[_0x133173];return _0x2cf355;};'use strict';var Sequelize=require(_0xf1b4('0x0'));module[_0xf1b4('0x1')]={'name':{'type':Sequelize[_0xf1b4('0x2')],'allowNull':![],'unique':_0xf1b4('0x3')},'prefix':{'type':Sequelize[_0xf1b4('0x4')],'get':function(_0x215e23){return _0xf1b4('0x5')+this['getDataValue'](_0xf1b4('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xf1b4('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xf1b4('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 492bd31..0e71128 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 _0xae24=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','name','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','body','VoiceExtension','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','html-pdf','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','status','json','count','limit','Content-Range','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','sendStatus','stack','send','index','VoicePrefix','rawAttributes','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','map','type','key','VIRTUAL','field','options','includeAll','include','catch','show','params','find','describe','create','sequelize','transaction','get','VoiceExtensionId'];(function(_0xf1603b,_0x257c11){var _0x298fab=function(_0x5a96fd){while(--_0x5a96fd){_0xf1603b['push'](_0xf1603b['shift']());}};_0x298fab(++_0x257c11);}(_0xae24,0x182));var _0x4ae2=function(_0x11e972,_0xb01c9a){_0x11e972=_0x11e972-0x0;var _0x5e24b6=_0xae24[_0x11e972];return _0x5e24b6;};'use strict';var pdf=require(_0x4ae2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4ae2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ae2('0x2'));var rp=require(_0x4ae2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ae2('0x4'));var util=require('util');var path=require(_0x4ae2('0x5'));var sox=require(_0x4ae2('0x6'));var csv=require(_0x4ae2('0x7'));var ejs=require(_0x4ae2('0x8'));var fs=require('fs');var _=require(_0x4ae2('0x9'));var squel=require(_0x4ae2('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ae2('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ae2('0xc'));var Redis=require(_0x4ae2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4ae2('0xe'));var hardwareService=require(_0x4ae2('0xf'));var logger=require(_0x4ae2('0x10'))(_0x4ae2('0x11'));var utils=require('../../config/utils');var config=require(_0x4ae2('0x12'));var db=require(_0x4ae2('0x13'))['db'];config[_0x4ae2('0x14')]=_['defaults'](config[_0x4ae2('0x14')],{'host':_0x4ae2('0x15'),'port':0x18eb});var socket=require(_0x4ae2('0x16'))(new Redis(config[_0x4ae2('0x14')]));require(_0x4ae2('0x17'))[_0x4ae2('0x18')](socket);function respondWithStatusCode(_0x145287,_0x3cabc9){_0x3cabc9=_0x3cabc9||0xcc;return function(_0xd527a0){if(_0xd527a0){return _0x145287['sendStatus'](_0x3cabc9);}return _0x145287['status'](_0x3cabc9)['end']();};}function respondWithResult(_0x2f3936,_0xf834a1){_0xf834a1=_0xf834a1||0xc8;return function(_0x5f447a){if(_0x5f447a){return _0x2f3936[_0x4ae2('0x19')](_0xf834a1)[_0x4ae2('0x1a')](_0x5f447a);}};}function respondWithFilteredResult(_0x1fde63,_0x1d5a78){return function(_0x428d24){if(_0x428d24){var _0x3b207c=_0x428d24[_0x4ae2('0x1b')],_0x3d4259=_0x1d5a78['offset'],_0xdc8798=_0x1d5a78['offset']+_0x1d5a78[_0x4ae2('0x1c')],_0x41b672;if(_0xdc8798>=_0x3b207c){_0xdc8798=_0x3b207c;_0x41b672=0xc8;}else{_0x41b672=0xce;}_0x1fde63[_0x4ae2('0x19')](_0x41b672);return _0x1fde63['set'](_0x4ae2('0x1d'),_0x3d4259+'-'+_0xdc8798+'/'+_0x3b207c)[_0x4ae2('0x1a')](_0x428d24);}return null;};}function patchUpdates(_0xccb3b){return function(_0x2ad222){try{jsonpatch[_0x4ae2('0x1e')](_0x2ad222,_0xccb3b,!![]);}catch(_0x497218){return BPromise[_0x4ae2('0x1f')](_0x497218);}return _0x2ad222['save']();};}function saveUpdates(_0x522165,_0x2ceec4){return function(_0x151b70){if(_0x151b70){return _0x151b70[_0x4ae2('0x20')](_0x522165)[_0x4ae2('0x21')](function(_0xca16bf){return _0xca16bf;});}return null;};}function removeEntity(_0x526768,_0x1005e0){return function(_0x4a0ddb){if(_0x4a0ddb){return _0x4a0ddb[_0x4ae2('0x22')]()[_0x4ae2('0x21')](function(){var _0x130239=_0x4a0ddb['get']({'plain':!![]});var _0x43f112=_0x4ae2('0x23');return db[_0x4ae2('0x24')][_0x4ae2('0x22')]({'where':{'type':_0x43f112,'resourceId':_0x130239['id']}})[_0x4ae2('0x21')](function(){return _0x4a0ddb;});})[_0x4ae2('0x21')](function(){_0x526768['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9508d7,_0x3030f8){return function(_0x3fa514){if(!_0x3fa514){_0x9508d7[_0x4ae2('0x25')](0x194);}return _0x3fa514;};}function handleError(_0x3a9b96,_0x20ef44){_0x20ef44=_0x20ef44||0x1f4;return function(_0x57a377){logger['error'](_0x57a377[_0x4ae2('0x26')]);if(_0x57a377['name']){delete _0x57a377['name'];}_0x3a9b96['status'](_0x20ef44)[_0x4ae2('0x27')](_0x57a377);};}exports[_0x4ae2('0x28')]=function(_0x55fafd,_0x883fd5){var _0x37e3e5={},_0x3d56ea={},_0x146bc2={'count':0x0,'rows':[]};var _0x14fdb3=db[_0x4ae2('0x29')][_0x4ae2('0x2a')];_0x3d56ea[_0x4ae2('0x2b')]=_[_0x4ae2('0x2c')](_0x14fdb3);_0x3d56ea[_0x4ae2('0x2d')]=_[_0x4ae2('0x2c')](_0x55fafd[_0x4ae2('0x2d')]);_0x3d56ea[_0x4ae2('0x2e')]=_[_0x4ae2('0x2f')](_0x3d56ea[_0x4ae2('0x2b')],_0x3d56ea[_0x4ae2('0x2d')]);_0x37e3e5[_0x4ae2('0x30')]=_['intersection'](_0x3d56ea[_0x4ae2('0x2b')],qs['fields'](_0x55fafd[_0x4ae2('0x2d')][_0x4ae2('0x31')]));_0x37e3e5['attributes']=_0x37e3e5[_0x4ae2('0x30')][_0x4ae2('0x32')]?_0x37e3e5[_0x4ae2('0x30')]:_0x3d56ea[_0x4ae2('0x2b')];if(!_0x55fafd['query'][_0x4ae2('0x33')](_0x4ae2('0x34'))){_0x37e3e5[_0x4ae2('0x1c')]=qs[_0x4ae2('0x1c')](_0x55fafd[_0x4ae2('0x2d')][_0x4ae2('0x1c')]);_0x37e3e5[_0x4ae2('0x35')]=qs[_0x4ae2('0x35')](_0x55fafd[_0x4ae2('0x2d')]['offset']);}_0x37e3e5[_0x4ae2('0x36')]=qs['sort'](_0x55fafd[_0x4ae2('0x2d')][_0x4ae2('0x37')]);_0x37e3e5[_0x4ae2('0x38')]=qs[_0x4ae2('0x2e')](_[_0x4ae2('0x39')](_0x55fafd[_0x4ae2('0x2d')],_0x3d56ea['filters']));if(_0x55fafd[_0x4ae2('0x2d')][_0x4ae2('0x3a')]){_0x37e3e5[_0x4ae2('0x38')]=_[_0x4ae2('0x3b')](_0x37e3e5['where'],{'$or':_[_0x4ae2('0x3c')](_0x14fdb3,function(_0x34a784){if(_0x34a784[_0x4ae2('0x3d')][_0x4ae2('0x3e')]!==_0x4ae2('0x3f')){var _0x261d8f={};_0x261d8f[_0x34a784[_0x4ae2('0x40')]]={'$like':'%'+_0x55fafd[_0x4ae2('0x2d')][_0x4ae2('0x3a')]+'%'};return _0x261d8f;}})});}_0x37e3e5=_[_0x4ae2('0x3b')]({},_0x37e3e5,_0x55fafd[_0x4ae2('0x41')]);var _0x57801a={'where':_0x37e3e5[_0x4ae2('0x38')]};return db[_0x4ae2('0x29')][_0x4ae2('0x1b')](_0x57801a)[_0x4ae2('0x21')](function(_0x5bade3){_0x146bc2['count']=_0x5bade3;if(_0x55fafd[_0x4ae2('0x2d')][_0x4ae2('0x42')]){_0x37e3e5[_0x4ae2('0x43')]=[{'all':!![]}];}return db[_0x4ae2('0x29')]['findAll'](_0x37e3e5);})[_0x4ae2('0x21')](function(_0x178898){_0x146bc2['rows']=_0x178898;return _0x146bc2;})[_0x4ae2('0x21')](respondWithFilteredResult(_0x883fd5,_0x37e3e5))[_0x4ae2('0x44')](handleError(_0x883fd5,null));};exports[_0x4ae2('0x45')]=function(_0x5a9126,_0x2f6431){var _0x29e12c={'raw':![],'where':{'id':_0x5a9126[_0x4ae2('0x46')]['id']}},_0x315d3b={};_0x315d3b[_0x4ae2('0x2b')]=_[_0x4ae2('0x2c')](db[_0x4ae2('0x29')][_0x4ae2('0x2a')]);_0x315d3b['query']=_[_0x4ae2('0x2c')](_0x5a9126[_0x4ae2('0x2d')]);_0x315d3b['filters']=_[_0x4ae2('0x2f')](_0x315d3b[_0x4ae2('0x2b')],_0x315d3b['query']);_0x29e12c[_0x4ae2('0x30')]=_[_0x4ae2('0x2f')](_0x315d3b['model'],qs[_0x4ae2('0x31')](_0x5a9126[_0x4ae2('0x2d')][_0x4ae2('0x31')]));_0x29e12c['attributes']=_0x29e12c['attributes'][_0x4ae2('0x32')]?_0x29e12c[_0x4ae2('0x30')]:_0x315d3b[_0x4ae2('0x2b')];if(_0x5a9126[_0x4ae2('0x2d')]['includeAll']){_0x29e12c[_0x4ae2('0x43')]=[{'all':!![]}];}_0x29e12c=_[_0x4ae2('0x3b')]({},_0x29e12c,_0x5a9126[_0x4ae2('0x41')]);return db['VoicePrefix'][_0x4ae2('0x47')](_0x29e12c)[_0x4ae2('0x21')](handleEntityNotFound(_0x2f6431,null))[_0x4ae2('0x21')](respondWithResult(_0x2f6431,null))['catch'](handleError(_0x2f6431,null));};exports[_0x4ae2('0x22')]=function(_0x24ec08,_0x2b596c){return db[_0x4ae2('0x29')][_0x4ae2('0x47')]({'where':{'id':_0x24ec08[_0x4ae2('0x46')]['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0x2b596c,null))[_0x4ae2('0x21')](removeEntity(_0x2b596c,null))[_0x4ae2('0x44')](handleError(_0x2b596c,null));};exports[_0x4ae2('0x48')]=function(_0x48afbb,_0x3db48e){return db[_0x4ae2('0x29')][_0x4ae2('0x48')]()[_0x4ae2('0x21')](respondWithResult(_0x3db48e,null))[_0x4ae2('0x44')](handleError(_0x3db48e,null));};exports[_0x4ae2('0x49')]=function(_0x11861a,_0x13cda3){var _0x4ffe8d;return db[_0x4ae2('0x4a')][_0x4ae2('0x4b')](function(_0x57c9f4){return db[_0x4ae2('0x29')][_0x4ae2('0x49')](_0x11861a['body'],{'transaction':_0x57c9f4})[_0x4ae2('0x21')](function(_0x4d6560){_0x4ffe8d=_0x4d6560[_0x4ae2('0x4c')]({'plain':!![]});return db['VoiceExtension'][_0x4ae2('0x47')]({'where':{'id':_0x4ffe8d[_0x4ae2('0x4d')]},'raw':!![]})[_0x4ae2('0x21')](function(_0x1a21ad){return createVoicePrefixExtensions(_0x4ffe8d,_0x1a21ad,_0x57c9f4);});});})[_0x4ae2('0x21')](function(){var _0x153673=_0x11861a[_0x4ae2('0x4e')][_0x4ae2('0x4c')]({'plain':!![]});if(!_0x153673)throw new Error(_0x4ae2('0x4f'));if(_0x153673['role']===_0x4ae2('0x4e')){var _0x4284b4=_0x4ffe8d;return db[_0x4ae2('0x50')][_0x4ae2('0x47')]({'where':{'name':'VoicePrefixes','userProfileId':_0x153673[_0x4ae2('0x51')]},'raw':!![]})[_0x4ae2('0x21')](function(_0xa8a90){if(_0xa8a90&&_0xa8a90['autoAssociation']===0x0){return db['UserProfileResource'][_0x4ae2('0x49')]({'name':_0x4284b4[_0x4ae2('0x52')],'resourceId':_0x4284b4['id'],'type':_0xa8a90[_0x4ae2('0x52')],'sectionId':_0xa8a90['id']},{})[_0x4ae2('0x21')](function(){return _0x4ffe8d;});}else{return _0x4ffe8d;}})[_0x4ae2('0x44')](function(_0x28d68e){logger[_0x4ae2('0x53')](_0x4ae2('0x54'),_0x28d68e);throw _0x28d68e;});}return _0x4ffe8d;})[_0x4ae2('0x21')](respondWithResult(_0x13cda3,null))['catch'](handleError(_0x13cda3,null));};function Extension(_0x28d5bd,_0x589feb,_0x11f028,_0x2e5899){this[_0x4ae2('0x55')]=_0x4ae2('0x56');this[_0x4ae2('0x57')]=_0x28d5bd;this[_0x4ae2('0x58')]=_0x11f028;this[_0x4ae2('0x3d')]=_0x4ae2('0x59');this['description']='Voice\x20Prefix\x20Extension';this[_0x4ae2('0x5a')]=_0x589feb;this[_0x4ae2('0x5b')]=_0x2e5899;}function createVoicePrefixExtensions(_0x44c634,_0x5e0a88,_0x5872ca){return new BPromise(function(_0x1f113f,_0x299b2f){var _0x2a0c47=new Extension(formatPrefixName(_0x44c634[_0x4ae2('0x5c')]),0x1,_0x4ae2('0x5d'),'Voice\x20Prefix');_0x2a0c47['VoicePrefixId']=_0x44c634['id'];return db['VoiceExtension'][_0x4ae2('0x49')](_0x2a0c47,{'transaction':_0x5872ca})['then'](function(_0x4e54d1){var _0x17f023=_0x4e54d1['get']({'plain':!![]});var _0x3efbaf=_['map'](addVoicePrefixExtensions(_0x44c634,_0x5e0a88),function(_0x4393fb){_0x4393fb['VoiceExtensionId']=_0x17f023['id'];_0x4393fb[_0x4ae2('0x5e')]=_0x44c634['id'];return _0x4393fb;});return db['VoiceExtension'][_0x4ae2('0x5f')](_0x3efbaf,{'transaction':_0x5872ca})[_0x4ae2('0x21')](function(_0x3f46f3){if(!_0x3f46f3){return _0x299b2f(_0x4ae2('0x60'));}else{return _0x1f113f(_0x3f46f3);}})[_0x4ae2('0x44')](function(_0x517494){return _0x299b2f(_0x517494);});});;});};function addVoicePrefixExtensions(_0x48f28f,_0x344963){var _0x256d2f=[];var _0x5103ef=formatPrefixName(_0x48f28f[_0x4ae2('0x5c')]);_0x256d2f[_0x4ae2('0x61')](new Extension(_0x5103ef,0x2,'Set',_0x4ae2('0x62')+_0x48f28f[_0x4ae2('0x52')]));if(_0x48f28f['callerIdAll']){_0x256d2f['push'](new Extension(_0x5103ef,0x3,_0x4ae2('0x63'),_0x4ae2('0x64')+_0x48f28f['callerIdAll']));}else{_0x256d2f[_0x4ae2('0x61')](new Extension(_0x5103ef,0x3,_0x4ae2('0x5d'),_0x4ae2('0x65')));}_0x256d2f[_0x4ae2('0x61')](new Extension(_0x5103ef,0x4,'goto',_0x344963[_0x4ae2('0x55')]+','+_0x4ae2('0x66')+(0x8+_0x48f28f['name'][_0x4ae2('0x32')])+'}'+','+0x1));return _0x256d2f;}function formatPrefixName(_0x231796){var _0x3412a1='_';for(var _0x525cc5=0x0;_0x525cc5<_0x231796['length'];_0x525cc5++){if(_0x231796[_0x4ae2('0x67')](_0x525cc5)=='-'){_0x3412a1+=_0x231796['charAt'](_0x525cc5);}else{_0x3412a1+='['+_0x231796[_0x4ae2('0x67')](_0x525cc5)+']';}}_0x3412a1+='.';return _0x3412a1;}exports['update']=function(_0x14d46f,_0x5c5b94,_0x2758c0){var _0x519763=_0x14d46f[_0x4ae2('0x68')];_0x519763['prefix']='system-'+_0x519763[_0x4ae2('0x52')]+'-';return db[_0x4ae2('0x4a')][_0x4ae2('0x4b')](function(_0xde3aac){return db[_0x4ae2('0x29')][_0x4ae2('0x20')](_0x519763,{'where':{'id':_0x519763['id']},'transaction':_0xde3aac})[_0x4ae2('0x21')](function(){return db[_0x4ae2('0x69')][_0x4ae2('0x22')]({'where':{'VoicePrefixId':_0x519763['id']},'transaction':_0xde3aac})[_0x4ae2('0x21')](function(){return db[_0x4ae2('0x69')][_0x4ae2('0x47')]({'where':{'id':_0x519763['VoiceExtensionId']},'raw':!![]})[_0x4ae2('0x21')](function(_0x25a3d8){return createVoicePrefixExtensions(_0x519763,_0x25a3d8,_0xde3aac);});});});})[_0x4ae2('0x21')](function(){return db[_0x4ae2('0x29')]['findById'](_0x519763['id']);})[_0x4ae2('0x21')](respondWithResult(_0x5c5b94,null))['catch'](handleError(_0x5c5b94,null));};exports[_0x4ae2('0x6a')]=function(_0x39ea1c,_0x190137,_0xde0853){return db[_0x4ae2('0x29')][_0x4ae2('0x47')]({'where':{'id':_0x39ea1c['params']['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0x190137,null))[_0x4ae2('0x21')](function(_0x3dbd1f){if(_0x3dbd1f){return _0x3dbd1f['addAgents'](_0x39ea1c[_0x4ae2('0x68')][_0x4ae2('0x6b')],_[_0x4ae2('0x6c')](_0x39ea1c['body'],[_0x4ae2('0x6b'),'id'])||{})[_0x4ae2('0x6d')](function(_0x209f6c){for(var _0x5ae901=0x0;_0x5ae901<_0x39ea1c[_0x4ae2('0x68')][_0x4ae2('0x6b')][_0x4ae2('0x32')];_0x5ae901+=0x1){socket[_0x4ae2('0x6e')]('userVoicePrefix:save',{'UserId':_0x39ea1c[_0x4ae2('0x68')][_0x4ae2('0x6b')][_0x5ae901],'VoicePrefixId':_0x39ea1c[_0x4ae2('0x46')]['id']});}return _0x209f6c;});}})[_0x4ae2('0x21')](respondWithResult(_0x190137,null))[_0x4ae2('0x44')](handleError(_0x190137,null));};exports[_0x4ae2('0x6f')]=function(_0x352050,_0x515836,_0x4e2990){return db[_0x4ae2('0x29')][_0x4ae2('0x47')]({'where':{'id':_0x352050[_0x4ae2('0x46')]['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0x515836,null))[_0x4ae2('0x21')](function(_0x319a36){if(_0x319a36){return _0x319a36['removeAgents'](_0x352050[_0x4ae2('0x2d')][_0x4ae2('0x6b')])[_0x4ae2('0x21')](function(){if(_[_0x4ae2('0x70')](_0x352050[_0x4ae2('0x2d')][_0x4ae2('0x6b')])){for(var _0x4ddd4d=0x0;_0x4ddd4d<_0x352050[_0x4ae2('0x2d')][_0x4ae2('0x6b')][_0x4ae2('0x32')];_0x4ddd4d+=0x1){socket[_0x4ae2('0x6e')](_0x4ae2('0x71'),{'UserId':Number(_0x352050[_0x4ae2('0x2d')]['ids'][_0x4ddd4d]),'VoicePrefixId':Number(_0x352050['params']['id'])});}}else{socket[_0x4ae2('0x6e')](_0x4ae2('0x71'),{'UserId':Number(_0x352050['query'][_0x4ae2('0x6b')]),'VoicePrefixId':Number(_0x352050[_0x4ae2('0x46')]['id'])});}});}})[_0x4ae2('0x21')](respondWithStatusCode(_0x515836,null))[_0x4ae2('0x44')](handleError(_0x515836,null));};exports[_0x4ae2('0x72')]=function(_0x3934ed,_0xc4748b,_0x51cbf9){var _0xde9c0b={};var _0x3e9160={};var _0x28d277;var _0x406d4a;return db[_0x4ae2('0x29')][_0x4ae2('0x73')]({'where':{'id':_0x3934ed['params']['id']}})[_0x4ae2('0x21')](handleEntityNotFound(_0xc4748b,null))[_0x4ae2('0x21')](function(_0x17f398){if(_0x17f398){_0x28d277=_0x17f398;_0x3e9160['model']=_[_0x4ae2('0x2c')](db['User'][_0x4ae2('0x2a')]);_0x3e9160[_0x4ae2('0x2d')]=_[_0x4ae2('0x2c')](_0x3934ed[_0x4ae2('0x2d')]);_0x3e9160[_0x4ae2('0x2e')]=_['intersection'](_0x3e9160[_0x4ae2('0x2b')],_0x3e9160[_0x4ae2('0x2d')]);_0xde9c0b[_0x4ae2('0x30')]=_[_0x4ae2('0x2f')](_0x3e9160['model'],qs[_0x4ae2('0x31')](_0x3934ed['query'][_0x4ae2('0x31')]));_0xde9c0b[_0x4ae2('0x30')]=_0xde9c0b['attributes'][_0x4ae2('0x32')]?_0xde9c0b[_0x4ae2('0x30')]:_0x3e9160[_0x4ae2('0x2b')];_0xde9c0b[_0x4ae2('0x36')]=qs[_0x4ae2('0x37')](_0x3934ed[_0x4ae2('0x2d')]['sort']);_0xde9c0b[_0x4ae2('0x38')]=qs['filters'](_[_0x4ae2('0x39')](_0x3934ed[_0x4ae2('0x2d')],_0x3e9160[_0x4ae2('0x2e')]));if(_0x3934ed[_0x4ae2('0x2d')][_0x4ae2('0x3a')]){_0xde9c0b[_0x4ae2('0x38')]=_['merge'](_0xde9c0b['where'],{'$or':_[_0x4ae2('0x3c')](_0xde9c0b[_0x4ae2('0x30')],function(_0x2dfe75){var _0x17ea48={};_0x17ea48[_0x2dfe75]={'$like':'%'+_0x3934ed[_0x4ae2('0x2d')][_0x4ae2('0x3a')]+'%'};return _0x17ea48;})});}_0xde9c0b=_[_0x4ae2('0x3b')]({},_0xde9c0b,_0x3934ed[_0x4ae2('0x41')]);return _0x28d277['getAgents'](_0xde9c0b);}})[_0x4ae2('0x21')](function(_0x27abac){if(_0x27abac){_0x406d4a=_0x27abac[_0x4ae2('0x32')];if(!_0x3934ed[_0x4ae2('0x2d')][_0x4ae2('0x33')](_0x4ae2('0x34'))){_0xde9c0b[_0x4ae2('0x1c')]=qs[_0x4ae2('0x1c')](_0x3934ed[_0x4ae2('0x2d')][_0x4ae2('0x1c')]);_0xde9c0b[_0x4ae2('0x35')]=qs[_0x4ae2('0x35')](_0x3934ed[_0x4ae2('0x2d')][_0x4ae2('0x35')]);}return _0x28d277[_0x4ae2('0x72')](_0xde9c0b);}})[_0x4ae2('0x21')](function(_0x31c1f7){if(_0x31c1f7){return _0x31c1f7?{'count':_0x406d4a,'rows':_0x31c1f7}:null;}})['then'](respondWithResult(_0xc4748b,null))[_0x4ae2('0x44')](handleError(_0xc4748b,null));}; \ No newline at end of file +var _0x7fbe=['findOne','User','options','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','json','count','offset','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','rawAttributes','keys','query','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','key','VIRTUAL','field','VoicePrefix','includeAll','include','findAll','params','catch','describe','sequelize','create','VoiceExtension','find','VoiceExtensionId','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','NoOp','Voice\x20Prefix','VoicePrefixId','map','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','addAgents','body','ids','omit','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents'];(function(_0x1e73fc,_0x533750){var _0xeceac4=function(_0x2c6dda){while(--_0x2c6dda){_0x1e73fc['push'](_0x1e73fc['shift']());}};_0xeceac4(++_0x533750);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x11eb54,_0x35c410){_0x11eb54=_0x11eb54-0x0;var _0x248fe0=_0x7fbe[_0x11eb54];return _0x248fe0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var hardwareService=require(_0xe7fb('0x13'));var logger=require(_0xe7fb('0x14'))(_0xe7fb('0x15'));var utils=require(_0xe7fb('0x16'));var config=require(_0xe7fb('0x17'));var db=require(_0xe7fb('0x18'))['db'];config[_0xe7fb('0x19')]=_[_0xe7fb('0x1a')](config[_0xe7fb('0x19')],{'host':_0xe7fb('0x1b'),'port':0x18eb});var socket=require(_0xe7fb('0x1c'))(new Redis(config[_0xe7fb('0x19')]));require(_0xe7fb('0x1d'))['register'](socket);function respondWithStatusCode(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xcc;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1e')](_0x2225e5);}return _0x278b75[_0xe7fb('0x1f')](_0x2225e5)['end']();};}function respondWithResult(_0xa76acf,_0x559129){_0x559129=_0x559129||0xc8;return function(_0x12fff6){if(_0x12fff6){return _0xa76acf[_0xe7fb('0x1f')](_0x559129)[_0xe7fb('0x20')](_0x12fff6);}};}function respondWithFilteredResult(_0x17e8a8,_0x562262){return function(_0x892b0f){if(_0x892b0f){var _0x5ebc87=_0x892b0f[_0xe7fb('0x21')],_0x293a47=_0x562262[_0xe7fb('0x22')],_0x546463=_0x562262[_0xe7fb('0x22')]+_0x562262['limit'],_0x1e77fd;if(_0x546463>=_0x5ebc87){_0x546463=_0x5ebc87;_0x1e77fd=0xc8;}else{_0x1e77fd=0xce;}_0x17e8a8[_0xe7fb('0x1f')](_0x1e77fd);return _0x17e8a8['set'](_0xe7fb('0x23'),_0x293a47+'-'+_0x546463+'/'+_0x5ebc87)['json'](_0x892b0f);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x24')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x25')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x26')](_0x4742bd)[_0xe7fb('0x27')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x28')]({'plain':!![]});var _0x2996ae='VoicePrefixes';return db[_0xe7fb('0x29')][_0xe7fb('0x2a')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x27')](function(){return _0x35e4db;});})[_0xe7fb('0x27')](function(){_0x5bea27[_0xe7fb('0x1f')](0xcc)[_0xe7fb('0x2b')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1e')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2c')](_0x4fd290[_0xe7fb('0x2d')]);if(_0x4fd290[_0xe7fb('0x2e')]){delete _0x4fd290[_0xe7fb('0x2e')];}_0x3bdee9[_0xe7fb('0x1f')](_0xead63)[_0xe7fb('0x2f')](_0x4fd290);};}exports[_0xe7fb('0x30')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=db['VoicePrefix'][_0xe7fb('0x31')];_0x1742f3['model']=_[_0xe7fb('0x32')](_0x547a04);_0x1742f3[_0xe7fb('0x33')]=_[_0xe7fb('0x32')](_0x3dd0be[_0xe7fb('0x33')]);_0x1742f3['filters']=_[_0xe7fb('0x34')](_0x1742f3[_0xe7fb('0x35')],_0x1742f3[_0xe7fb('0x33')]);_0x3d1fb5[_0xe7fb('0x36')]=_[_0xe7fb('0x34')](_0x1742f3['model'],qs[_0xe7fb('0x37')](_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x37')]));_0x3d1fb5[_0xe7fb('0x36')]=_0x3d1fb5[_0xe7fb('0x36')][_0xe7fb('0x38')]?_0x3d1fb5[_0xe7fb('0x36')]:_0x1742f3[_0xe7fb('0x35')];if(!_0x3dd0be[_0xe7fb('0x33')]['hasOwnProperty'](_0xe7fb('0x39'))){_0x3d1fb5[_0xe7fb('0x3a')]=qs[_0xe7fb('0x3a')](_0x3dd0be['query'][_0xe7fb('0x3a')]);_0x3d1fb5[_0xe7fb('0x22')]=qs[_0xe7fb('0x22')](_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x22')]);}_0x3d1fb5[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x3c')]);_0x3d1fb5[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x33')],_0x1742f3[_0xe7fb('0x3e')]));if(_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x3d1fb5[_0xe7fb('0x3d')]=_[_0xe7fb('0x41')](_0x3d1fb5[_0xe7fb('0x3d')],{'$or':_['map'](_0x547a04,function(_0x261ec5){if(_0x261ec5[_0xe7fb('0x42')][_0xe7fb('0x43')]!==_0xe7fb('0x44')){var _0x50d952={};_0x50d952[_0x261ec5[_0xe7fb('0x45')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x50d952;}})});}_0x3d1fb5=_[_0xe7fb('0x41')]({},_0x3d1fb5,_0x3dd0be['options']);var _0x2f976f={'where':_0x3d1fb5[_0xe7fb('0x3d')]};return db[_0xe7fb('0x46')][_0xe7fb('0x21')](_0x2f976f)[_0xe7fb('0x27')](function(_0xb729fc){_0x29d1ca['count']=_0xb729fc;if(_0x3dd0be[_0xe7fb('0x33')][_0xe7fb('0x47')]){_0x3d1fb5[_0xe7fb('0x48')]=[{'all':!![]}];}return db['VoicePrefix'][_0xe7fb('0x49')](_0x3d1fb5);})[_0xe7fb('0x27')](function(_0x5d42ac){_0x29d1ca['rows']=_0x5d42ac;return _0x29d1ca;})['then'](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports['show']=function(_0x900d67,_0x957ca3){var _0xed62e9={'raw':![],'where':{'id':_0x900d67[_0xe7fb('0x4a')]['id']}},_0x492f0f={};_0x492f0f['model']=_[_0xe7fb('0x32')](db[_0xe7fb('0x46')]['rawAttributes']);_0x492f0f[_0xe7fb('0x33')]=_[_0xe7fb('0x32')](_0x900d67[_0xe7fb('0x33')]);_0x492f0f[_0xe7fb('0x3e')]=_['intersection'](_0x492f0f[_0xe7fb('0x35')],_0x492f0f[_0xe7fb('0x33')]);_0xed62e9[_0xe7fb('0x36')]=_['intersection'](_0x492f0f[_0xe7fb('0x35')],qs[_0xe7fb('0x37')](_0x900d67[_0xe7fb('0x33')][_0xe7fb('0x37')]));_0xed62e9[_0xe7fb('0x36')]=_0xed62e9['attributes'][_0xe7fb('0x38')]?_0xed62e9['attributes']:_0x492f0f[_0xe7fb('0x35')];if(_0x900d67[_0xe7fb('0x33')][_0xe7fb('0x47')]){_0xed62e9[_0xe7fb('0x48')]=[{'all':!![]}];}_0xed62e9=_[_0xe7fb('0x41')]({},_0xed62e9,_0x900d67['options']);return db[_0xe7fb('0x46')]['find'](_0xed62e9)['then'](handleEntityNotFound(_0x957ca3,null))[_0xe7fb('0x27')](respondWithResult(_0x957ca3,null))[_0xe7fb('0x4b')](handleError(_0x957ca3,null));};exports[_0xe7fb('0x2a')]=function(_0x589555,_0x3d4b01){return db[_0xe7fb('0x46')]['find']({'where':{'id':_0x589555['params']['id']}})[_0xe7fb('0x27')](handleEntityNotFound(_0x3d4b01,null))[_0xe7fb('0x27')](removeEntity(_0x3d4b01,null))[_0xe7fb('0x4b')](handleError(_0x3d4b01,null));};exports[_0xe7fb('0x4c')]=function(_0x2dc09c,_0x1f0533){return db[_0xe7fb('0x46')][_0xe7fb('0x4c')]()['then'](respondWithResult(_0x1f0533,null))[_0xe7fb('0x4b')](handleError(_0x1f0533,null));};exports['create']=function(_0x1cb5d4,_0x102da9){var _0x5cedfb;return db[_0xe7fb('0x4d')]['transaction'](function(_0x239c56){return db['VoicePrefix'][_0xe7fb('0x4e')](_0x1cb5d4['body'],{'transaction':_0x239c56})[_0xe7fb('0x27')](function(_0x59158c){_0x5cedfb=_0x59158c[_0xe7fb('0x28')]({'plain':!![]});return db[_0xe7fb('0x4f')][_0xe7fb('0x50')]({'where':{'id':_0x5cedfb[_0xe7fb('0x51')]},'raw':!![]})[_0xe7fb('0x27')](function(_0x2f959d){return createVoicePrefixExtensions(_0x5cedfb,_0x2f959d,_0x239c56);});});})[_0xe7fb('0x27')](function(){var _0x582a4a=_0x1cb5d4['user'][_0xe7fb('0x28')]({'plain':!![]});if(!_0x582a4a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x582a4a['role']==='user'){var _0x50b8df=_0x5cedfb;return db['UserProfileSection'][_0xe7fb('0x50')]({'where':{'name':_0xe7fb('0x52'),'userProfileId':_0x582a4a[_0xe7fb('0x53')]},'raw':!![]})[_0xe7fb('0x27')](function(_0x59c92d){if(_0x59c92d&&_0x59c92d[_0xe7fb('0x54')]===0x0){return db[_0xe7fb('0x29')][_0xe7fb('0x4e')]({'name':_0x50b8df['name'],'resourceId':_0x50b8df['id'],'type':_0x59c92d['name'],'sectionId':_0x59c92d['id']},{})[_0xe7fb('0x27')](function(){return _0x5cedfb;});}else{return _0x5cedfb;}})[_0xe7fb('0x4b')](function(_0x300b8e){logger['error'](_0xe7fb('0x55'),_0x300b8e);throw _0x300b8e;});}return _0x5cedfb;})[_0xe7fb('0x27')](respondWithResult(_0x102da9,null))[_0xe7fb('0x4b')](handleError(_0x102da9,null));};function Extension(_0x2a7e4d,_0x548cd4,_0x4b35f9,_0x2f620d){this[_0xe7fb('0x56')]=_0xe7fb('0x57');this[_0xe7fb('0x58')]=_0x2a7e4d;this[_0xe7fb('0x59')]=_0x4b35f9;this['type']=_0xe7fb('0x5a');this[_0xe7fb('0x5b')]=_0xe7fb('0x5c');this['priority']=_0x548cd4;this['appdata']=_0x2f620d;}function createVoicePrefixExtensions(_0x425bee,_0x3b69f7,_0x14fe1b){return new BPromise(function(_0x1c4035,_0x40f546){var _0x3385e2=new Extension(formatPrefixName(_0x425bee['prefix']),0x1,_0xe7fb('0x5d'),_0xe7fb('0x5e'));_0x3385e2[_0xe7fb('0x5f')]=_0x425bee['id'];return db[_0xe7fb('0x4f')][_0xe7fb('0x4e')](_0x3385e2,{'transaction':_0x14fe1b})[_0xe7fb('0x27')](function(_0x554092){var _0x2e457c=_0x554092['get']({'plain':!![]});var _0x1eda1d=_[_0xe7fb('0x60')](addVoicePrefixExtensions(_0x425bee,_0x3b69f7),function(_0x116c7e){_0x116c7e[_0xe7fb('0x51')]=_0x2e457c['id'];_0x116c7e['VoicePrefixId']=_0x425bee['id'];return _0x116c7e;});return db['VoiceExtension'][_0xe7fb('0x61')](_0x1eda1d,{'transaction':_0x14fe1b})[_0xe7fb('0x27')](function(_0x25aeb2){if(!_0x25aeb2){return _0x40f546(_0xe7fb('0x62'));}else{return _0x1c4035(_0x25aeb2);}})[_0xe7fb('0x4b')](function(_0x50dc34){return _0x40f546(_0x50dc34);});});;});};function addVoicePrefixExtensions(_0x4096d4,_0x58d4ec){var _0x127b0e=[];var _0x51ff25=formatPrefixName(_0x4096d4['prefix']);_0x127b0e[_0xe7fb('0x63')](new Extension(_0x51ff25,0x2,_0xe7fb('0x64'),_0xe7fb('0x65')+_0x4096d4['name']));if(_0x4096d4[_0xe7fb('0x66')]){_0x127b0e[_0xe7fb('0x63')](new Extension(_0x51ff25,0x3,_0xe7fb('0x64'),_0xe7fb('0x67')+_0x4096d4[_0xe7fb('0x66')]));}else{_0x127b0e['push'](new Extension(_0x51ff25,0x3,_0xe7fb('0x5d'),_0xe7fb('0x68')));}_0x127b0e['push'](new Extension(_0x51ff25,0x4,_0xe7fb('0x69'),_0x58d4ec[_0xe7fb('0x56')]+','+'${EXTEN:'+(0x8+_0x4096d4[_0xe7fb('0x2e')]['length'])+'}'+','+0x1));return _0x127b0e;}function formatPrefixName(_0x2705ef){var _0x1dc9c1='_';for(var _0xa93f35=0x0;_0xa93f35<_0x2705ef['length'];_0xa93f35++){if(_0x2705ef[_0xe7fb('0x6a')](_0xa93f35)=='-'){_0x1dc9c1+=_0x2705ef[_0xe7fb('0x6a')](_0xa93f35);}else{_0x1dc9c1+='['+_0x2705ef[_0xe7fb('0x6a')](_0xa93f35)+']';}}_0x1dc9c1+='.';return _0x1dc9c1;}exports[_0xe7fb('0x26')]=function(_0x35487f,_0x15ff86,_0xcdc72e){var _0x187040=_0x35487f['body'];_0x187040['prefix']=_0xe7fb('0x6b')+_0x187040[_0xe7fb('0x2e')]+'-';return db[_0xe7fb('0x4d')]['transaction'](function(_0x519c5f){return db[_0xe7fb('0x46')][_0xe7fb('0x26')](_0x187040,{'where':{'id':_0x187040['id']},'transaction':_0x519c5f})[_0xe7fb('0x27')](function(){return db[_0xe7fb('0x4f')][_0xe7fb('0x2a')]({'where':{'VoicePrefixId':_0x187040['id']},'transaction':_0x519c5f})[_0xe7fb('0x27')](function(){return db[_0xe7fb('0x4f')][_0xe7fb('0x50')]({'where':{'id':_0x187040[_0xe7fb('0x51')]},'raw':!![]})[_0xe7fb('0x27')](function(_0x1ff5e7){return createVoicePrefixExtensions(_0x187040,_0x1ff5e7,_0x519c5f);});});});})[_0xe7fb('0x27')](function(){return db[_0xe7fb('0x46')]['findById'](_0x187040['id']);})['then'](respondWithResult(_0x15ff86,null))[_0xe7fb('0x4b')](handleError(_0x15ff86,null));};exports[_0xe7fb('0x6c')]=function(_0x178395,_0x16cd8f,_0x8dd368){return db['VoicePrefix'][_0xe7fb('0x50')]({'where':{'id':_0x178395[_0xe7fb('0x4a')]['id']}})[_0xe7fb('0x27')](handleEntityNotFound(_0x16cd8f,null))[_0xe7fb('0x27')](function(_0x16553c){if(_0x16553c){return _0x16553c[_0xe7fb('0x6c')](_0x178395[_0xe7fb('0x6d')][_0xe7fb('0x6e')],_[_0xe7fb('0x6f')](_0x178395['body'],[_0xe7fb('0x6e'),'id'])||{})['spread'](function(_0x279663){for(var _0x2f13f2=0x0;_0x2f13f2<_0x178395[_0xe7fb('0x6d')][_0xe7fb('0x6e')][_0xe7fb('0x38')];_0x2f13f2+=0x1){socket['emit'](_0xe7fb('0x70'),{'UserId':_0x178395[_0xe7fb('0x6d')][_0xe7fb('0x6e')][_0x2f13f2],'VoicePrefixId':_0x178395[_0xe7fb('0x4a')]['id']});}return _0x279663;});}})[_0xe7fb('0x27')](respondWithResult(_0x16cd8f,null))[_0xe7fb('0x4b')](handleError(_0x16cd8f,null));};exports[_0xe7fb('0x71')]=function(_0x17e640,_0x3d139f,_0x59731e){return db[_0xe7fb('0x46')][_0xe7fb('0x50')]({'where':{'id':_0x17e640[_0xe7fb('0x4a')]['id']}})[_0xe7fb('0x27')](handleEntityNotFound(_0x3d139f,null))['then'](function(_0x4b5f7e){if(_0x4b5f7e){return _0x4b5f7e['removeAgents'](_0x17e640[_0xe7fb('0x33')][_0xe7fb('0x6e')])[_0xe7fb('0x27')](function(){if(_[_0xe7fb('0x72')](_0x17e640['query'][_0xe7fb('0x6e')])){for(var _0x2d4c5e=0x0;_0x2d4c5e<_0x17e640[_0xe7fb('0x33')][_0xe7fb('0x6e')]['length'];_0x2d4c5e+=0x1){socket[_0xe7fb('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x17e640[_0xe7fb('0x33')][_0xe7fb('0x6e')][_0x2d4c5e]),'VoicePrefixId':Number(_0x17e640[_0xe7fb('0x4a')]['id'])});}}else{socket[_0xe7fb('0x73')](_0xe7fb('0x74'),{'UserId':Number(_0x17e640['query'][_0xe7fb('0x6e')]),'VoicePrefixId':Number(_0x17e640['params']['id'])});}});}})[_0xe7fb('0x27')](respondWithStatusCode(_0x3d139f,null))['catch'](handleError(_0x3d139f,null));};exports[_0xe7fb('0x75')]=function(_0x38f52c,_0x4c37cd,_0x2b6d69){var _0x31642f={};var _0xb19e94={};var _0x4181fd;var _0x58e344;return db[_0xe7fb('0x46')][_0xe7fb('0x76')]({'where':{'id':_0x38f52c[_0xe7fb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4c37cd,null))[_0xe7fb('0x27')](function(_0x4b2cc4){if(_0x4b2cc4){_0x4181fd=_0x4b2cc4;_0xb19e94['model']=_['keys'](db[_0xe7fb('0x77')][_0xe7fb('0x31')]);_0xb19e94['query']=_[_0xe7fb('0x32')](_0x38f52c[_0xe7fb('0x33')]);_0xb19e94[_0xe7fb('0x3e')]=_[_0xe7fb('0x34')](_0xb19e94[_0xe7fb('0x35')],_0xb19e94[_0xe7fb('0x33')]);_0x31642f[_0xe7fb('0x36')]=_[_0xe7fb('0x34')](_0xb19e94[_0xe7fb('0x35')],qs[_0xe7fb('0x37')](_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x37')]));_0x31642f[_0xe7fb('0x36')]=_0x31642f[_0xe7fb('0x36')][_0xe7fb('0x38')]?_0x31642f[_0xe7fb('0x36')]:_0xb19e94[_0xe7fb('0x35')];_0x31642f[_0xe7fb('0x3b')]=qs[_0xe7fb('0x3c')](_0x38f52c[_0xe7fb('0x33')]['sort']);_0x31642f[_0xe7fb('0x3d')]=qs[_0xe7fb('0x3e')](_[_0xe7fb('0x3f')](_0x38f52c[_0xe7fb('0x33')],_0xb19e94[_0xe7fb('0x3e')]));if(_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x40')]){_0x31642f['where']=_['merge'](_0x31642f[_0xe7fb('0x3d')],{'$or':_['map'](_0x31642f[_0xe7fb('0x36')],function(_0x496205){var _0x4abac2={};_0x4abac2[_0x496205]={'$like':'%'+_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x40')]+'%'};return _0x4abac2;})});}_0x31642f=_[_0xe7fb('0x41')]({},_0x31642f,_0x38f52c[_0xe7fb('0x78')]);return _0x4181fd[_0xe7fb('0x75')](_0x31642f);}})[_0xe7fb('0x27')](function(_0x5be801){if(_0x5be801){_0x58e344=_0x5be801[_0xe7fb('0x38')];if(!_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x79')](_0xe7fb('0x39'))){_0x31642f[_0xe7fb('0x3a')]=qs[_0xe7fb('0x3a')](_0x38f52c['query']['limit']);_0x31642f['offset']=qs[_0xe7fb('0x22')](_0x38f52c[_0xe7fb('0x33')][_0xe7fb('0x22')]);}return _0x4181fd['getAgents'](_0x31642f);}})[_0xe7fb('0x27')](function(_0x57ee3b){if(_0x57ee3b){return _0x57ee3b?{'count':_0x58e344,'rows':_0x57ee3b}:null;}})[_0xe7fb('0x27')](respondWithResult(_0x4c37cd,null))[_0xe7fb('0x4b')](handleError(_0x4c37cd,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index aa3076a..9c2dc6a 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 _0xe14d=['VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x2a2cdf,_0x3f2801){var _0x5e8e12=function(_0x3cc5ef){while(--_0x3cc5ef){_0x2a2cdf['push'](_0x2a2cdf['shift']());}};_0x5e8e12(++_0x3f2801);}(_0xe14d,0x1ee));var _0xde14=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xe14d[_0x4d07cc];return _0x42de3b;};'use strict';var EventEmitter=require(_0xde14('0x0'));var VoicePrefix=require(_0xde14('0x1'))['db'][_0xde14('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xde14('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xde14('0x4'),'afterDestroy':_0xde14('0x5')};function emitEvent(_0x4b20e2){return function(_0x1c3e94,_0x13c24e,_0x3280b9){VoicePrefixEvents[_0xde14('0x6')](_0x4b20e2+':'+_0x1c3e94['id'],_0x1c3e94);VoicePrefixEvents[_0xde14('0x6')](_0x4b20e2,_0x1c3e94);_0x3280b9(null);};}for(var e in events){if(events[_0xde14('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0x54ef=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','save','update'];(function(_0x4ed494,_0x273272){var _0x59d5c4=function(_0x40886d){while(--_0x40886d){_0x4ed494['push'](_0x4ed494['shift']());}};_0x59d5c4(++_0x273272);}(_0x54ef,0x112));var _0xf54e=function(_0x41bd3d,_0x13a475){_0x41bd3d=_0x41bd3d-0x0;var _0x4a7351=_0x54ef[_0x41bd3d];return _0x4a7351;};'use strict';var EventEmitter=require(_0xf54e('0x0'));var VoicePrefix=require(_0xf54e('0x1'))['db'][_0xf54e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf54e('0x3'),'afterUpdate':_0xf54e('0x4'),'afterDestroy':_0xf54e('0x5')};function emitEvent(_0x42b9b2){return function(_0x8b6bb6,_0x431e36,_0x12d43f){VoicePrefixEvents['emit'](_0x42b9b2+':'+_0x8b6bb6['id'],_0x8b6bb6);VoicePrefixEvents['emit'](_0x42b9b2,_0x8b6bb6);_0x12d43f(null);};}for(var e in events){if(events[_0xf54e('0x6')](e)){var event=events[e];VoicePrefix[_0xf54e('0x7')](e,emitEvent(event));}}module[_0xf54e('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 25de4d6..8858427 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 _0x65e6=['./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5cf81a,_0x3bf6f6){var _0x18afeb=function(_0x2b6491){while(--_0x2b6491){_0x5cf81a['push'](_0x5cf81a['shift']());}};_0x18afeb(++_0x3bf6f6);}(_0x65e6,0xc4));var _0x665e=function(_0x5a2b8f,_0x17d7e4){_0x5a2b8f=_0x5a2b8f-0x0;var _0x3a917f=_0x65e6[_0x5a2b8f];return _0x3a917f;};'use strict';var _=require(_0x665e('0x0'));var util=require(_0x665e('0x1'));var logger=require(_0x665e('0x2'))(_0x665e('0x3'));var moment=require(_0x665e('0x4'));var BPromise=require(_0x665e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x665e('0x6'));var rimraf=require('rimraf');var config=require(_0x665e('0x7'));var attributes=require(_0x665e('0x8'));module['exports']=function(_0x44e02f,_0x9b8b95){return _0x44e02f[_0x665e('0x9')](_0x665e('0xa'),attributes,{'tableName':_0x665e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58c6=['bluebird','request-promise','path','./voicePrefix.attributes','exports','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x46c30c,_0x1ac896){var _0x45c5c1=function(_0x21ad77){while(--_0x21ad77){_0x46c30c['push'](_0x46c30c['shift']());}};_0x45c5c1(++_0x1ac896);}(_0x58c6,0x1d2));var _0x658c=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x58c6[_0x49d41c];return _0xb64c5f;};'use strict';var _=require(_0x658c('0x0'));var util=require(_0x658c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x658c('0x2'));var rp=require(_0x658c('0x3'));var fs=require('fs');var path=require(_0x658c('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x658c('0x5'));module[_0x658c('0x6')]=function(_0x37d0ff,_0x2bb588){return _0x37d0ff['define'](_0x658c('0x7'),attributes,{'tableName':_0x658c('0x8'),'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 3e35b70..66db1fa 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 _0x6150=['client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','request\x20sent','debug','stringify','error','VoicePrefix,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0xf77fc1,_0x1b5f46){var _0xf8faa7=function(_0x23a364){while(--_0x23a364){_0xf77fc1['push'](_0xf77fc1['shift']());}};_0xf8faa7(++_0x1b5f46);}(_0x6150,0xcf));var _0x0615=function(_0x56fb66,_0x2101f3){_0x56fb66=_0x56fb66-0x0;var _0x1822f2=_0x6150[_0x56fb66];return _0x1822f2;};'use strict';var _=require('lodash');var util=require(_0x0615('0x0'));var moment=require(_0x0615('0x1'));var BPromise=require('bluebird');var rs=require(_0x0615('0x2'));var fs=require('fs');var Redis=require(_0x0615('0x3'));var db=require(_0x0615('0x4'))['db'];var utils=require(_0x0615('0x5'));var logger=require(_0x0615('0x6'))('rpc');var config=require(_0x0615('0x7'));var jayson=require(_0x0615('0x8'));var client=jayson[_0x0615('0x9')][_0x0615('0xa')]({'port':0x232a});config['redis']=_[_0x0615('0xb')](config[_0x0615('0xc')],{'host':_0x0615('0xd'),'port':0x18eb});var socket=require(_0x0615('0xe'))(new Redis(config[_0x0615('0xc')]));require(_0x0615('0xf'))['register'](socket);function respondWithRpcPromise(_0x1d0cc8,_0x5393f3,_0x50d4d5){return new BPromise(function(_0x2e9a9c,_0x205ee9){return client[_0x0615('0x10')](_0x1d0cc8,_0x50d4d5)[_0x0615('0x11')](function(_0x357587){logger[_0x0615('0x12')]('VoicePrefix,\x20%s,\x20%s',_0x5393f3,_0x0615('0x13'));logger[_0x0615('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5393f3,_0x0615('0x13'),JSON[_0x0615('0x15')](_0x357587));if(_0x357587[_0x0615('0x16')]){if(_0x357587[_0x0615('0x16')]['code']===0x1f4){logger[_0x0615('0x16')](_0x0615('0x17'),_0x5393f3,_0x357587[_0x0615('0x16')]['message']);return _0x205ee9(_0x357587[_0x0615('0x16')][_0x0615('0x18')]);}logger[_0x0615('0x16')]('VoicePrefix,\x20%s,\x20%s',_0x5393f3,_0x357587[_0x0615('0x16')][_0x0615('0x18')]);return _0x2e9a9c(_0x357587[_0x0615('0x16')][_0x0615('0x18')]);}else{logger['info'](_0x0615('0x17'),_0x5393f3,'request\x20sent');_0x2e9a9c(_0x357587[_0x0615('0x19')]['message']);}})[_0x0615('0x1a')](function(_0x5b747c){logger[_0x0615('0x16')](_0x0615('0x17'),_0x5393f3,_0x5b747c);_0x205ee9(_0x5b747c);});});} \ No newline at end of file +var _0x3f5f=['message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','debug','request\x20sent','stringify','error','VoicePrefix,\x20%s,\x20%s'];(function(_0x4f57e4,_0x18914d){var _0x4a584c=function(_0x312dcb){while(--_0x312dcb){_0x4f57e4['push'](_0x4f57e4['shift']());}};_0x4a584c(++_0x18914d);}(_0x3f5f,0xff));var _0xf3f5=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x3f5f[_0x47568e];return _0x33815b;};'use strict';var _=require(_0xf3f5('0x0'));var util=require('util');var moment=require(_0xf3f5('0x1'));var BPromise=require(_0xf3f5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3f5('0x3'));var db=require(_0xf3f5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf3f5('0x5'))('rpc');var config=require(_0xf3f5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xf3f5('0x7')]['http']({'port':0x232a});config['redis']=_[_0xf3f5('0x8')](config[_0xf3f5('0x9')],{'host':_0xf3f5('0xa'),'port':0x18eb});var socket=require(_0xf3f5('0xb'))(new Redis(config[_0xf3f5('0x9')]));require(_0xf3f5('0xc'))[_0xf3f5('0xd')](socket);function respondWithRpcPromise(_0x2636c8,_0x892e5a,_0x3c16eb){return new BPromise(function(_0x1c6c9e,_0x4b68d8){return client[_0xf3f5('0xe')](_0x2636c8,_0x3c16eb)['then'](function(_0x498235){logger[_0xf3f5('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x892e5a,'request\x20sent');logger[_0xf3f5('0x10')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x892e5a,_0xf3f5('0x11'),JSON[_0xf3f5('0x12')](_0x498235));if(_0x498235[_0xf3f5('0x13')]){if(_0x498235['error']['code']===0x1f4){logger[_0xf3f5('0x13')](_0xf3f5('0x14'),_0x892e5a,_0x498235[_0xf3f5('0x13')][_0xf3f5('0x15')]);return _0x4b68d8(_0x498235[_0xf3f5('0x13')][_0xf3f5('0x15')]);}logger[_0xf3f5('0x13')]('VoicePrefix,\x20%s,\x20%s',_0x892e5a,_0x498235['error'][_0xf3f5('0x15')]);return _0x1c6c9e(_0x498235['error'][_0xf3f5('0x15')]);}else{logger[_0xf3f5('0xf')](_0xf3f5('0x14'),_0x892e5a,_0xf3f5('0x11'));_0x1c6c9e(_0x498235['result'][_0xf3f5('0x15')]);}})[_0xf3f5('0x16')](function(_0x5ebb52){logger[_0xf3f5('0x13')](_0xf3f5('0x14'),_0x892e5a,_0x5ebb52);_0x4b68d8(_0x5ebb52);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 243c454..1404302 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 _0x9977=['register','length','save','remove','update','emit'];(function(_0x3c159b,_0xcec751){var _0x5b757c=function(_0x468447){while(--_0x468447){_0x3c159b['push'](_0x3c159b['shift']());}};_0x5b757c(++_0xcec751);}(_0x9977,0x1d6));var _0x7997=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0x9977[_0x4cd690];return _0x4a74a9;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x7997('0x0'),_0x7997('0x1'),_0x7997('0x2')];function createListener(_0x325e10,_0x2d0611){return function(_0x8176b9){_0x2d0611[_0x7997('0x3')](_0x325e10,_0x8176b9);};}function removeListener(_0xda91ea,_0x5d444e){return function(){VoicePrefixEvents['removeListener'](_0xda91ea,_0x5d444e);};}exports[_0x7997('0x4')]=function(_0x592fe9){for(var _0x5c9c55=0x0,_0x16d79f=events[_0x7997('0x5')];_0x5c9c55<_0x16d79f;_0x5c9c55++){var _0x3825f4=events[_0x5c9c55];var _0x3ade61=createListener('voicePrefix:'+_0x3825f4,_0x592fe9);VoicePrefixEvents['on'](_0x3825f4,_0x3ade61);}}; \ No newline at end of file +var _0x0642=['emit','removeListener','register','voicePrefix:','save','update'];(function(_0x14a3cf,_0xae014f){var _0x5bcffb=function(_0x45fdad){while(--_0x45fdad){_0x14a3cf['push'](_0x14a3cf['shift']());}};_0x5bcffb(++_0xae014f);}(_0x0642,0x9a));var _0x2064=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x0642[_0x1d5400];return _0x21d9fe;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x2064('0x0'),'remove',_0x2064('0x1')];function createListener(_0x42d6b6,_0x2c25e6){return function(_0x3dddd6){_0x2c25e6[_0x2064('0x2')](_0x42d6b6,_0x3dddd6);};}function removeListener(_0x170935,_0x3a703b){return function(){VoicePrefixEvents[_0x2064('0x3')](_0x170935,_0x3a703b);};}exports[_0x2064('0x4')]=function(_0x446e31){for(var _0x207947=0x0,_0x461cc9=events['length'];_0x207947<_0x461cc9;_0x207947++){var _0x5b859b=events[_0x207947];var _0x5f3141=createListener(_0x2064('0x5')+_0x5b859b,_0x446e31);VoicePrefixEvents['on'](_0x5b859b,_0x5f3141);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 8ec2c7a..6123cb8 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 _0x53aa=['getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members'];(function(_0x5ed3df,_0xc41cda){var _0x3dc154=function(_0x208d3b){while(--_0x208d3b){_0x5ed3df['push'](_0x5ed3df['shift']());}};_0x3dc154(++_0xc41cda);}(_0x53aa,0x6d));var _0xa53a=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x53aa[_0x1deb03];return _0x189fe7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa53a('0x0'));var timeout=require(_0xa53a('0x1'));var express=require('express');var router=express[_0xa53a('0x2')]();var auth=require(_0xa53a('0x3'));var interaction=require(_0xa53a('0x4'));var config=require(_0xa53a('0x5'));var controller=require(_0xa53a('0x6'));router[_0xa53a('0x7')]('/',auth[_0xa53a('0x8')](),controller[_0xa53a('0x9')]);router[_0xa53a('0x7')](_0xa53a('0xa'),auth['isAuthenticated'](),controller[_0xa53a('0xb')]);router['get'](_0xa53a('0xc'),auth['isAuthenticated'](),controller[_0xa53a('0xd')]);router['get'](_0xa53a('0xe'),auth[_0xa53a('0x8')](),controller[_0xa53a('0xf')]);router[_0xa53a('0x7')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0xa53a('0x10')]);router[_0xa53a('0x7')](_0xa53a('0x11'),auth['isAuthenticated'](),controller[_0xa53a('0x12')]);router[_0xa53a('0x7')](_0xa53a('0x13'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x14')]);router['get'](_0xa53a('0x15'),auth[_0xa53a('0x8')](),controller['getAgents']);router['get'](_0xa53a('0x16'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x17')]);router[_0xa53a('0x7')](_0xa53a('0x18'),auth['isAuthenticated'](),controller[_0xa53a('0x19')]);router[_0xa53a('0x7')](_0xa53a('0x1a'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x1b')]);router[_0xa53a('0x1c')]('/',auth['isAuthenticated'](),controller[_0xa53a('0x1d')]);router[_0xa53a('0x1c')](_0xa53a('0x1e'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x1f')]);router[_0xa53a('0x1c')](_0xa53a('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0xa53a('0x1c')]('/:id/users',auth[_0xa53a('0x8')](),controller[_0xa53a('0x20')]);router[_0xa53a('0x1c')]('/:id/lists',auth[_0xa53a('0x8')](),controller[_0xa53a('0x21')]);router[_0xa53a('0x1c')]('/:id/blacklists',auth[_0xa53a('0x8')](),controller[_0xa53a('0x22')]);router[_0xa53a('0x23')](_0xa53a('0xa'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x24')]);router[_0xa53a('0x25')]('/:id',auth[_0xa53a('0x8')](),controller[_0xa53a('0x26')]);router['delete'](_0xa53a('0x13'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x27')]);router[_0xa53a('0x25')](_0xa53a('0x15'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x28')]);router[_0xa53a('0x25')](_0xa53a('0x18'),auth[_0xa53a('0x8')](),controller[_0xa53a('0x29')]);router[_0xa53a('0x25')]('/:id/blacklists',auth[_0xa53a('0x8')](),controller[_0xa53a('0x2a')]);module[_0xa53a('0x2b')]=router; \ No newline at end of file +var _0x685b=['/:id/teams','addTeams','addAgents','addLists','addBlackLists','update','delete','removeTeams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone'];(function(_0x5b493b,_0x3ce256){var _0x101aab=function(_0x344aa5){while(--_0x344aa5){_0x5b493b['push'](_0x5b493b['shift']());}};_0x101aab(++_0x3ce256);}(_0x685b,0xbd));var _0xb685=function(_0x558615,_0x1eb496){_0x558615=_0x558615-0x0;var _0x1e032a=_0x685b[_0x558615];return _0x1e032a;};'use strict';var multer=require(_0xb685('0x0'));var util=require(_0xb685('0x1'));var path=require(_0xb685('0x2'));var timeout=require(_0xb685('0x3'));var express=require(_0xb685('0x4'));var router=express['Router']();var auth=require(_0xb685('0x5'));var interaction=require(_0xb685('0x6'));var config=require('../../config/environment');var controller=require('./voiceQueue.controller');router[_0xb685('0x7')]('/',auth[_0xb685('0x8')](),controller[_0xb685('0x9')]);router['get'](_0xb685('0xa'),auth[_0xb685('0x8')](),controller['show']);router['get']('/:id/hoppers',auth[_0xb685('0x8')](),controller['getHoppers']);router[_0xb685('0x7')]('/:id/hopper_histories',auth[_0xb685('0x8')](),controller[_0xb685('0xb')]);router[_0xb685('0x7')](_0xb685('0xc'),auth['isAuthenticated'](),controller[_0xb685('0xd')]);router[_0xb685('0x7')](_0xb685('0xe'),auth[_0xb685('0x8')](),controller['getHopperBlacks']);router['get']('/:id/teams',auth[_0xb685('0x8')](),controller['getTeams']);router[_0xb685('0x7')](_0xb685('0xf'),auth[_0xb685('0x8')](),controller[_0xb685('0x10')]);router[_0xb685('0x7')](_0xb685('0x11'),auth[_0xb685('0x8')](),controller[_0xb685('0x12')]);router['get'](_0xb685('0x13'),auth[_0xb685('0x8')](),controller[_0xb685('0x14')]);router['get'](_0xb685('0x15'),auth[_0xb685('0x8')](),controller[_0xb685('0x16')]);router[_0xb685('0x17')]('/',auth[_0xb685('0x8')](),controller[_0xb685('0x18')]);router[_0xb685('0x17')](_0xb685('0x19'),auth['isAuthenticated'](),controller[_0xb685('0x1a')]);router[_0xb685('0x17')](_0xb685('0x1b'),auth[_0xb685('0x8')](),controller[_0xb685('0x1c')]);router[_0xb685('0x17')]('/:id/users',auth[_0xb685('0x8')](),controller[_0xb685('0x1d')]);router['post']('/:id/lists',auth[_0xb685('0x8')](),controller[_0xb685('0x1e')]);router['post'](_0xb685('0x15'),auth['isAuthenticated'](),controller[_0xb685('0x1f')]);router['put'](_0xb685('0xa'),auth[_0xb685('0x8')](),controller[_0xb685('0x20')]);router['delete'](_0xb685('0xa'),auth[_0xb685('0x8')](),controller['destroy']);router[_0xb685('0x21')](_0xb685('0x1b'),auth[_0xb685('0x8')](),controller[_0xb685('0x22')]);router[_0xb685('0x21')](_0xb685('0xf'),auth[_0xb685('0x8')](),controller['removeAgents']);router[_0xb685('0x21')](_0xb685('0x13'),auth[_0xb685('0x8')](),controller['removeLists']);router[_0xb685('0x21')](_0xb685('0x15'),auth[_0xb685('0x8')](),controller['removeBlackLists']);module[_0xb685('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 996cddb..32ccdee 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 _0x65e4=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','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)'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x65e4,0x1cb));var _0x465e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x65e4[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x465e('0x0'));module[_0x465e('0x1')]={'name':{'type':Sequelize[_0x465e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x4'),_0x465e('0x5')),'allowNull':![],'defaultValue':_0x465e('0x4')},'musiconhold':{'type':Sequelize[_0x465e('0x2')],'defaultValue':_0x465e('0x6')},'announce':{'type':Sequelize[_0x465e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x465e('0x3')]('rr',_0x465e('0x7'),_0x465e('0x8'),_0x465e('0x9'),_0x465e('0xa'),_0x465e('0xb'),'linear',_0x465e('0xc'),_0x465e('0xd')),'allowNull':![],'defaultValue':_0x465e('0x7'),'set':function(_0xcd16cf){this[_0x465e('0xe')](_0x465e('0xf'),_0xcd16cf?_0xcd16cf:_0x465e('0xb'));},'get':function(){var _0x5ea15f=this[_0x465e('0x10')](_0x465e('0x11'));var _0x5c4e31=this[_0x465e('0x10')](_0x465e('0x12'));var _0xab10c0=this[_0x465e('0x10')](_0x465e('0xf'));if(_0x5ea15f===_0x465e('0x4')){return _0xab10c0;}if(_0x5c4e31===_0x465e('0x13')&&_0xab10c0===_0x465e('0xb')||_0x5c4e31==='booked'&&_0xab10c0===_0x465e('0x14')){return _0xab10c0;}if(_0x5c4e31===_0x465e('0x15')||_0x5c4e31===_0x465e('0x16')||_0x5c4e31===_0x465e('0x17')){return _0xab10c0;}return null;}},'servicelevel':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x465e('0x18')](0xb)},'timeout':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x465e('0x2')]},'weight':{'type':Sequelize[_0x465e('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':_0x465e('0x19')},'autopause':{'type':Sequelize[_0x465e('0x3')]('yes','no',_0x465e('0x1a')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x465e('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x465e('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x465e('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x465e('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x465e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x465e('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':_0x465e('0x19')},'announce_holdtime':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x465e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x465e('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x465e('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x465e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x465e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x465e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x465e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x465e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x465e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x465e('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x465e('0x1b')],'set':function(_0xb6a1dd){this[_0x465e('0xe')](_0x465e('0x1c'),_0xb6a1dd?_0xb6a1dd[_0x465e('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x465e('0x1c'))?this[_0x465e('0x10')](_0x465e('0x1c'))[_0x465e('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x465e('0x2')],'defaultValue':_0x465e('0x19'),'set':function(_0x526100){this['setDataValue'](_0x465e('0x1f'),_0x526100?_0x526100['join'](','):[]);},'get':function(){return this[_0x465e('0x10')]('joinempty')?this[_0x465e('0x10')](_0x465e('0x1f'))[_0x465e('0x1e')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x465e('0x2')],'defaultValue':'no','set':function(_0x53c328){this[_0x465e('0xe')](_0x465e('0x20'),_0x53c328?_0x53c328[_0x465e('0x1d')](','):[]);},'get':function(){return this[_0x465e('0x10')](_0x465e('0x20'))?this[_0x465e('0x10')](_0x465e('0x20'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x465e('0x2')]},'description':{'type':Sequelize[_0x465e('0x2')]},'acw':{'type':Sequelize[_0x465e('0x21')],'defaultValue':0x0,'set':function(_0x1fb5a0){this[_0x465e('0xe')](_0x465e('0x22'),_0x1fb5a0);if(_0x1fb5a0){if(this['getDataValue'](_0x465e('0x23'))<0x2){this['setDataValue']('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x465e('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x24'),_0x465e('0x15'),_0x465e('0x17'),_0x465e('0x16'),_0x465e('0x13')),'defaultValue':_0x465e('0x15'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x465e('0x18')](0x4)[_0x465e('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x465e('0x18')](0x4)[_0x465e('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x465e('0x26')](0x2)[_0x465e('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x465e('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor','dropRate'),'defaultValue':_0x465e('0x28'),'comment':_0x465e('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x465e('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x465e('0x18')](0x3)[_0x465e('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x465e('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x465e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x465e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x465e('0x18')](0x3)[_0x465e('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x465e('0x2b')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x465e('0x2c'),'comment':_0x465e('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x465e('0x18')](0x3)[_0x465e('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x465e('0x2e')},'dialQueueProject':{'type':Sequelize[_0x465e('0x2')],'comment':_0x465e('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x465e('0x18')](0x3)[_0x465e('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x465e('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x465e('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x465e('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x465e('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0x465e('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x465e('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x465e('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x465e('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x465e('0x18')](0x5)[_0x465e('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x465e('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x465e('0x35')},'dialTimezone':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x465e('0x2')],'defaultValue':_0x465e('0x36')},'dialPrefix':{'type':Sequelize[_0x465e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x465e('0x37'),_0x465e('0x38'),_0x465e('0x39')),'defaultValue':_0x465e('0x37')},'dialAMDActive':{'type':Sequelize[_0x465e('0x21')],'defaultValue':0x0,'comment':_0x465e('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x465e('0x18')](0x9)[_0x465e('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x465e('0x18')](0x9)[_0x465e('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x465e('0x18')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x465e('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x465e('0x18')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x465e('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x465e('0x18')](0x9)[_0x465e('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x465e('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x465e('0x18')](0x9)[_0x465e('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x465e('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x465e('0x18')](0x9)[_0x465e('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x465e('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x465e('0x18')](0x5)[_0x465e('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x465e('0x18')](0x9)[_0x465e('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x465e('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x465e('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x465e('0x21')],'defaultValue':0x0,'comment':_0x465e('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x465e('0x3')](_0x465e('0x42'),'ASC'),'defaultValue':_0x465e('0x42')},'dialQueueProject2':{'type':Sequelize[_0x465e('0x2')],'comment':_0x465e('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x465e('0x21')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x465e('0x43')},'dialCutDigit':{'type':Sequelize[_0x465e('0x18')](0x3)[_0x465e('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x465e('0x44')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x465e('0x18')],'allowNull':!![],'comment':_0x465e('0x45')},'mandatoryDisposition':{'type':Sequelize[_0x465e('0x21')],'defaultValue':![],'comment':_0x465e('0x46'),'set':function(_0x12da22){if(!_0x12da22)this[_0x465e('0xe')](_0x465e('0x47'),null);this[_0x465e('0xe')](_0x465e('0x48'),_0x12da22);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x465e('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x0b1f=['join','split','leavewhenempty','BOOLEAN','acw','wrapuptime','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','outbound','inbound','STRING','default','ringall','fewestcalls','rrmemory','wrandom','rrordered','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','predictive','power','INTEGER','yes','ENUM','once','TEXT','periodic_announce','joinempty'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x0b1f,0x101));var _0xf0b1=function(_0x29dc65,_0x52b92f){_0x29dc65=_0x29dc65-0x0;var _0x2a5025=_0x0b1f[_0x29dc65];return _0x2a5025;};'use strict';var Sequelize=require(_0xf0b1('0x0'));module[_0xf0b1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xf0b1('0x2')),'allowNull':![],'defaultValue':_0xf0b1('0x3')},'musiconhold':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':_0xf0b1('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xf0b1('0x6'),'leastrecent',_0xf0b1('0x7'),'random',_0xf0b1('0x8'),'linear',_0xf0b1('0x9'),_0xf0b1('0xa')),'allowNull':![],'defaultValue':'ringall','set':function(_0x300de5){this[_0xf0b1('0xb')](_0xf0b1('0xc'),_0x300de5?_0x300de5:_0xf0b1('0x8'));},'get':function(){var _0xa8a127=this[_0xf0b1('0xd')](_0xf0b1('0xe'));var _0x4dfb9f=this[_0xf0b1('0xd')]('dialMethod');var _0x3a9841=this[_0xf0b1('0xd')](_0xf0b1('0xc'));if(_0xa8a127===_0xf0b1('0x3')){return _0x3a9841;}if(_0x4dfb9f===_0xf0b1('0xf')&&_0x3a9841===_0xf0b1('0x8')||_0x4dfb9f===_0xf0b1('0xf')&&_0x3a9841===_0xf0b1('0x10')){return _0x3a9841;}if(_0x4dfb9f===_0xf0b1('0x11')||_0x4dfb9f===_0xf0b1('0x12')||_0x4dfb9f===_0xf0b1('0x13')){return _0x3a9841;}return null;}},'servicelevel':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf0b1('0x14')](0xb)},'timeout':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0xf0b1('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xf0b1('0x15'),'no'),'defaultValue':_0xf0b1('0x15')},'autopause':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xf0b1('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf0b1('0x16')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xf0b1('0x16')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf0b1('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf0b1('0x4')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf0b1('0x16')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xf0b1('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xf0b1('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf0b1('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf0b1('0x4')]},'queue_youarenext':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf0b1('0x4')]},'queue_quantity1':{'type':Sequelize[_0xf0b1('0x4')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xf0b1('0x4')]},'queue_less_than':{'type':Sequelize[_0xf0b1('0x4')]},'periodic_announce':{'type':Sequelize[_0xf0b1('0x18')],'set':function(_0x1f7269){this['setDataValue']('periodic_announce',_0x1f7269?_0x1f7269['join'](','):[]);},'get':function(){return this['getDataValue'](_0xf0b1('0x19'))?this[_0xf0b1('0xd')](_0xf0b1('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':_0xf0b1('0x15'),'set':function(_0x4cc310){this['setDataValue'](_0xf0b1('0x1a'),_0x4cc310?_0x4cc310[_0xf0b1('0x1b')](','):[]);},'get':function(){return this[_0xf0b1('0xd')]('joinempty')?this['getDataValue'](_0xf0b1('0x1a'))[_0xf0b1('0x1c')](','):[];}},'leavewhenempty':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':'no','set':function(_0x63146c){this[_0xf0b1('0xb')](_0xf0b1('0x1d'),_0x63146c?_0x63146c[_0xf0b1('0x1b')](','):[]);},'get':function(){return this[_0xf0b1('0xd')](_0xf0b1('0x1d'))?this[_0xf0b1('0xd')](_0xf0b1('0x1d'))[_0xf0b1('0x1c')](','):[];}},'reportholdtime':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf0b1('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf0b1('0x4')]},'description':{'type':Sequelize[_0xf0b1('0x4')]},'acw':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':0x0,'set':function(_0x170069){this[_0xf0b1('0xb')](_0xf0b1('0x1f'),_0x170069);if(_0x170069){if(this['getDataValue'](_0xf0b1('0x20'))<0x2){this[_0xf0b1('0xb')](_0xf0b1('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize['ENUM']('preview',_0xf0b1('0x11'),_0xf0b1('0x13'),_0xf0b1('0x12'),'booked'),'defaultValue':_0xf0b1('0x11'),'comment':_0xf0b1('0x21')},'dialLimitChannel':{'type':Sequelize[_0xf0b1('0x14')](0x4)[_0xf0b1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf0b1('0x23')},'dialLimitQueue':{'type':Sequelize[_0xf0b1('0x14')](0x4)[_0xf0b1('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf0b1('0x24')},'dialPowerLevel':{'type':Sequelize[_0xf0b1('0x25')](0x2)[_0xf0b1('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x26'),_0xf0b1('0x27')),'defaultValue':_0xf0b1('0x27'),'comment':_0xf0b1('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf0b1('0x25')](0x2)[_0xf0b1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf0b1('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0xf0b1('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf0b1('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf0b1('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf0b1('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf0b1('0x2b')},'dialQueueOptions':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':'tTxX','comment':_0xf0b1('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf0b1('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf0b1('0x14')](0x5)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf0b1('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf0b1('0x14')](0x5)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf0b1('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf0b1('0x14')](0x5)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf0b1('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf0b1('0x14')](0x3)[_0xf0b1('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf0b1('0x30')},'dialTimezone':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xf0b1('0x31')},'dialPrefix':{'type':Sequelize[_0xf0b1('0x4')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x32'),_0xf0b1('0x33'),_0xf0b1('0x34')),'defaultValue':_0xf0b1('0x32')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf0b1('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf0b1('0x36')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xf0b1('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf0b1('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf0b1('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf0b1('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xf0b1('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf0b1('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf0b1('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf0b1('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf0b1('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf0b1('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf0b1('0x14')](0x9)[_0xf0b1('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf0b1('0x3d')},'dialRecallMeTimeout':{'type':Sequelize[_0xf0b1('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':0x0,'comment':_0xf0b1('0x3e')},'dialOrderByScheduledAt':{'type':Sequelize[_0xf0b1('0x16')](_0xf0b1('0x3f'),_0xf0b1('0x40')),'defaultValue':_0xf0b1('0x3f')},'dialQueueProject2':{'type':Sequelize[_0xf0b1('0x4')],'comment':_0xf0b1('0x41')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf0b1('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf0b1('0x14')](0x3)[_0xf0b1('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf0b1('0x42')},'dialCutDigit':{'type':Sequelize[_0xf0b1('0x14')](0x3)[_0xf0b1('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf0b1('0x43')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf0b1('0x14')],'allowNull':!![],'comment':_0xf0b1('0x44')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf0b1('0x45'),'set':function(_0x3b6de4){if(!_0x3b6de4)this[_0xf0b1('0xb')](_0xf0b1('0x46'),null);this[_0xf0b1('0xb')]('mandatoryDisposition',_0x3b6de4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf0b1('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xf0b1('0x14')](0x3)['UNSIGNED'],'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 35fa5f9..c832d31 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 _0x0972=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','userProfileId','autoAssociation','getHoppers','findOne','nolimit','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','User','Agents','interface','flatMap','forEach','penalty','sequelize','transaction','UserVoiceQueue','findOrCreate','each','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','Team','ids','tq.TeamId','from','team_has_voice_queues','user_has_teams','clone','push','toString','every','all','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','online','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','VoiceQueues','QueueCampaigns','outbound','filter','map','value','includes','type','find','UserProfileResource','sendStatus','stack','name','send','index','VoiceQueue','rawAttributes','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','key','VIRTUAL','field','options','include','findAll','catch','show','params','includeAll'];(function(_0x344432,_0x5b990f){var _0x54f671=function(_0x5c6dc8){while(--_0x5c6dc8){_0x344432['push'](_0x344432['shift']());}};_0x54f671(++_0x5b990f);}(_0x0972,0x64));var _0x2097=function(_0xbd2dc5,_0x181bdd){_0xbd2dc5=_0xbd2dc5-0x0;var _0x40a997=_0x0972[_0xbd2dc5];return _0x40a997;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2097('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2097('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2097('0x2'));var moment=require(_0x2097('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2097('0x4'));var util=require(_0x2097('0x5'));var path=require(_0x2097('0x6'));var sox=require(_0x2097('0x7'));var csv=require(_0x2097('0x8'));var ejs=require(_0x2097('0x9'));var fs=require('fs');var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x8'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var hardwareService=require(_0x2097('0x12'));var logger=require(_0x2097('0x13'))(_0x2097('0x14'));var utils=require(_0x2097('0x15'));var config=require(_0x2097('0x16'));var db=require(_0x2097('0x17'))['db'];config[_0x2097('0x18')]=_[_0x2097('0x19')](config[_0x2097('0x18')],{'host':_0x2097('0x1a'),'port':0x18eb});var socket=require(_0x2097('0x1b'))(new Redis(config[_0x2097('0x18')]));require(_0x2097('0x1c'))[_0x2097('0x1d')](socket);function respondWithStatusCode(_0x1c9ef9,_0x2c3e41){_0x2c3e41=_0x2c3e41||0xcc;return function(_0x354387){if(_0x354387){return _0x1c9ef9['sendStatus'](_0x2c3e41);}return _0x1c9ef9[_0x2097('0x1e')](_0x2c3e41)[_0x2097('0x1f')]();};}function respondWithResult(_0x4d31bc,_0x4eec05){_0x4eec05=_0x4eec05||0xc8;return function(_0x4fc8c5){if(_0x4fc8c5){return _0x4d31bc[_0x2097('0x1e')](_0x4eec05)['json'](_0x4fc8c5);}};}function respondWithFilteredResult(_0x28c35c,_0xb12c94){return function(_0x43fec9){if(_0x43fec9){var _0x1347e4=_0x43fec9[_0x2097('0x20')],_0x44c584=_0xb12c94[_0x2097('0x21')],_0x53e2b4=_0xb12c94[_0x2097('0x21')]+_0xb12c94[_0x2097('0x22')],_0x324652;if(_0x53e2b4>=_0x1347e4){_0x53e2b4=_0x1347e4;_0x324652=0xc8;}else{_0x324652=0xce;}_0x28c35c[_0x2097('0x1e')](_0x324652);return _0x28c35c[_0x2097('0x23')](_0x2097('0x24'),_0x44c584+'-'+_0x53e2b4+'/'+_0x1347e4)['json'](_0x43fec9);}return null;};}function patchUpdates(_0x4d957e){return function(_0xf65dc6){try{jsonpatch['apply'](_0xf65dc6,_0x4d957e,!![]);}catch(_0x227c00){return BPromise[_0x2097('0x25')](_0x227c00);}return _0xf65dc6['save']();};}function saveUpdates(_0x442db7,_0x5b0582){return function(_0x2e17c8){if(_0x2e17c8){return _0x2e17c8[_0x2097('0x26')](_0x442db7)[_0x2097('0x27')](function(_0x20b93a){return _0x20b93a;});}return null;};}function removeEntity(_0x36b15e,_0x35047b){return function(_0x56390a){if(_0x56390a){return _0x56390a[_0x2097('0x28')]()['then'](function(){var _0x3f9279=_0x56390a[_0x2097('0x29')]({'plain':!![]});var _0x345875=[{'name':_0x2097('0x2a'),'value':'inbound','ignore':![]},{'name':_0x2097('0x2b'),'value':_0x2097('0x2c'),'ignore':![]}];var _0x56af3b=_(_0x345875)[_0x2097('0x2d')]('ignore')[_0x2097('0x2e')]('value')[_0x2097('0x2f')]();if(_[_0x2097('0x30')](_0x56af3b,_0x3f9279[_0x2097('0x31')])){return;}var _0x7eefb4=_[_0x2097('0x32')](_0x345875,[_0x2097('0x2f'),_0x3f9279[_0x2097('0x31')]])['name'];return db[_0x2097('0x33')][_0x2097('0x28')]({'where':{'type':_0x7eefb4,'resourceId':_0x3f9279['id']}})['then'](function(){return _0x56390a;});})[_0x2097('0x27')](function(){_0x36b15e[_0x2097('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d0916,_0x312c77){return function(_0x11b051){if(!_0x11b051){_0x4d0916[_0x2097('0x34')](0x194);}return _0x11b051;};}function handleError(_0x3589bb,_0x74ccdc){_0x74ccdc=_0x74ccdc||0x1f4;return function(_0x180654){logger['error'](_0x180654[_0x2097('0x35')]);if(_0x180654['name']){delete _0x180654[_0x2097('0x36')];}_0x3589bb[_0x2097('0x1e')](_0x74ccdc)[_0x2097('0x37')](_0x180654);};}exports[_0x2097('0x38')]=function(_0x44e398,_0x395d9f){var _0x9bc312={},_0x455cf7={},_0x2701bc={'count':0x0,'rows':[]};var _0x5c89ab=db[_0x2097('0x39')][_0x2097('0x3a')];_0x455cf7[_0x2097('0x3b')]=_['keys'](_0x5c89ab);_0x455cf7[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x44e398[_0x2097('0x3c')]);_0x455cf7[_0x2097('0x3e')]=_['intersection'](_0x455cf7['model'],_0x455cf7['query']);_0x9bc312[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x455cf7[_0x2097('0x3b')],qs[_0x2097('0x41')](_0x44e398[_0x2097('0x3c')][_0x2097('0x41')]));_0x9bc312['attributes']=_0x9bc312[_0x2097('0x3f')][_0x2097('0x42')]?_0x9bc312[_0x2097('0x3f')]:_0x455cf7[_0x2097('0x3b')];if(!_0x44e398[_0x2097('0x3c')][_0x2097('0x43')]('nolimit')){_0x9bc312[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x44e398[_0x2097('0x3c')]['limit']);_0x9bc312['offset']=qs[_0x2097('0x21')](_0x44e398[_0x2097('0x3c')][_0x2097('0x21')]);}_0x9bc312[_0x2097('0x44')]=qs[_0x2097('0x45')](_0x44e398[_0x2097('0x3c')][_0x2097('0x45')]);_0x9bc312[_0x2097('0x46')]=qs[_0x2097('0x3e')](_[_0x2097('0x47')](_0x44e398[_0x2097('0x3c')],_0x455cf7[_0x2097('0x3e')]));if(_0x44e398['query'][_0x2097('0x2d')]){_0x9bc312[_0x2097('0x46')]=_[_0x2097('0x48')](_0x9bc312['where'],{'$or':_[_0x2097('0x2e')](_0x5c89ab,function(_0x16eed0){if(_0x16eed0[_0x2097('0x31')][_0x2097('0x49')]!==_0x2097('0x4a')){var _0xd4d89e={};_0xd4d89e[_0x16eed0[_0x2097('0x4b')]]={'$like':'%'+_0x44e398[_0x2097('0x3c')]['filter']+'%'};return _0xd4d89e;}})});}_0x9bc312=_[_0x2097('0x48')]({},_0x9bc312,_0x44e398[_0x2097('0x4c')]);var _0x186ca5={'where':_0x9bc312[_0x2097('0x46')]};return db[_0x2097('0x39')][_0x2097('0x20')](_0x186ca5)[_0x2097('0x27')](function(_0x280ecd){_0x2701bc['count']=_0x280ecd;if(_0x44e398[_0x2097('0x3c')]['includeAll']){_0x9bc312[_0x2097('0x4d')]=[{'all':!![]}];}return db[_0x2097('0x39')][_0x2097('0x4e')](_0x9bc312);})[_0x2097('0x27')](function(_0x3ce9bf){_0x2701bc['rows']=_0x3ce9bf;return _0x2701bc;})[_0x2097('0x27')](respondWithFilteredResult(_0x395d9f,_0x9bc312))[_0x2097('0x4f')](handleError(_0x395d9f,null));};exports[_0x2097('0x50')]=function(_0x39e0a4,_0x1e04f8){var _0x58c7bd={'raw':![],'where':{'id':_0x39e0a4[_0x2097('0x51')]['id']}},_0x6b68c3={};_0x6b68c3[_0x2097('0x3b')]=_[_0x2097('0x3d')](db[_0x2097('0x39')][_0x2097('0x3a')]);_0x6b68c3[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x39e0a4['query']);_0x6b68c3[_0x2097('0x3e')]=_[_0x2097('0x40')](_0x6b68c3[_0x2097('0x3b')],_0x6b68c3[_0x2097('0x3c')]);_0x58c7bd['attributes']=_['intersection'](_0x6b68c3['model'],qs[_0x2097('0x41')](_0x39e0a4[_0x2097('0x3c')]['fields']));_0x58c7bd[_0x2097('0x3f')]=_0x58c7bd[_0x2097('0x3f')]['length']?_0x58c7bd['attributes']:_0x6b68c3[_0x2097('0x3b')];if(_0x39e0a4[_0x2097('0x3c')][_0x2097('0x52')]){_0x58c7bd['include']=[{'all':!![]}];}_0x58c7bd=_[_0x2097('0x48')]({},_0x58c7bd,_0x39e0a4[_0x2097('0x4c')]);return db['VoiceQueue'][_0x2097('0x32')](_0x58c7bd)[_0x2097('0x27')](handleEntityNotFound(_0x1e04f8,null))[_0x2097('0x27')](respondWithResult(_0x1e04f8,null))[_0x2097('0x4f')](handleError(_0x1e04f8,null));};exports[_0x2097('0x53')]=function(_0x56a4ad,_0x5127d9){return db[_0x2097('0x39')][_0x2097('0x53')](_0x56a4ad[_0x2097('0x54')],{})['then'](function(_0x5c1739){var _0x144719=_0x56a4ad[_0x2097('0x55')]['get']({'plain':!![]});if(!_0x144719)throw new Error(_0x2097('0x56'));if(_0x144719[_0x2097('0x57')]===_0x2097('0x55')){var _0x33490e=_0x5c1739[_0x2097('0x29')]({'plain':!![]});var _0x4a709a=[{'name':_0x2097('0x2a'),'value':_0x2097('0x58')},{'name':_0x2097('0x2b'),'value':'outbound'}];var _0x4a25e2=_[_0x2097('0x32')](_0x4a709a,['value',_0x33490e[_0x2097('0x31')]])['name'];return db[_0x2097('0x59')]['find']({'where':{'name':_0x4a25e2,'userProfileId':_0x144719['userProfileId']},'raw':!![]})['then'](function(_0x40cbe1){if(_0x40cbe1&&_0x40cbe1['autoAssociation']===0x0){return db['UserProfileResource'][_0x2097('0x53')]({'name':_0x33490e['name'],'resourceId':_0x33490e['id'],'type':_0x40cbe1[_0x2097('0x36')],'sectionId':_0x40cbe1['id']},{})[_0x2097('0x27')](function(){return _0x5c1739;});}else{return _0x5c1739;}})['catch'](function(_0x3e799f){logger[_0x2097('0x5a')](_0x2097('0x5b'),_0x3e799f);throw _0x3e799f;});}return _0x5c1739;})[_0x2097('0x27')](respondWithResult(_0x5127d9,0xc9))[_0x2097('0x4f')](handleError(_0x5127d9,null));};exports['clone']=function(_0x2117e3,_0x49e315){var _0xe2a2af={'raw':![],'where':{'id':_0x2117e3[_0x2097('0x51')]['id']}},_0x140e43={};_0x140e43['model']=_[_0x2097('0x3d')](db[_0x2097('0x39')][_0x2097('0x3a')]);_0xe2a2af[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x140e43['model'],qs['fields'](_0x2117e3[_0x2097('0x3c')][_0x2097('0x41')]));_0xe2a2af['attributes']=_0xe2a2af['attributes']['length']?_0xe2a2af['attributes']:_0x140e43[_0x2097('0x3b')];if(_0x2117e3['query'][_0x2097('0x52')]){_0xe2a2af[_0x2097('0x4d')]=[{'all':!![]}];}_0xe2a2af=_['merge']({},_0xe2a2af,_0x2117e3[_0x2097('0x4c')]);return db[_0x2097('0x39')][_0x2097('0x32')](_0xe2a2af)[_0x2097('0x27')](handleEntityNotFound(_0x49e315,null))[_0x2097('0x27')](function(_0x60332a){if(_0x60332a){var _0x15aa91=_0x60332a[_0x2097('0x29')]({'plain':!![]});_0x15aa91=qs[_0x2097('0x5c')](_0x15aa91,['id','createdAt',_0x2097('0x5d')]);_0x2117e3[_0x2097('0x54')]=_[_0x2097('0x5c')](_0x2117e3[_0x2097('0x54')],['id',_0x2097('0x5e'),_0x2097('0x5d')]);return db['VoiceQueue'][_0x2097('0x53')](_[_0x2097('0x48')](_0x15aa91,_0x2117e3[_0x2097('0x54')]),{'include':_0x2117e3[_0x2097('0x3c')][_0x2097('0x52')]?[{'all':!![]}]:undefined})['then'](function(_0x437b79){var _0x28dd95=_0x2117e3['user']['get']({'plain':!![]});if(!_0x28dd95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28dd95[_0x2097('0x57')]===_0x2097('0x55')){var _0x319d3b=_0x437b79[_0x2097('0x29')]({'plain':!![]});var _0x168703=[{'name':_0x2097('0x2a'),'value':_0x2097('0x58')},{'name':_0x2097('0x2b'),'value':_0x2097('0x2c')}];var _0x5453bc=_['find'](_0x168703,[_0x2097('0x2f'),_0x319d3b[_0x2097('0x31')]])[_0x2097('0x36')];return db[_0x2097('0x59')][_0x2097('0x32')]({'where':{'name':_0x5453bc,'userProfileId':_0x28dd95[_0x2097('0x5f')]},'raw':!![]})['then'](function(_0x4074ae){if(_0x4074ae&&_0x4074ae[_0x2097('0x60')]===0x0){return db[_0x2097('0x33')][_0x2097('0x53')]({'name':_0x319d3b['name'],'resourceId':_0x319d3b['id'],'type':_0x4074ae['name'],'sectionId':_0x4074ae['id']},{})[_0x2097('0x27')](function(){return _0x437b79;});}else{return _0x437b79;}})[_0x2097('0x4f')](function(_0x487f1f){logger[_0x2097('0x5a')](_0x2097('0x5b'),_0x487f1f);throw _0x487f1f;});}return _0x437b79;});}})[_0x2097('0x27')](respondWithResult(_0x49e315,0xc9))[_0x2097('0x4f')](handleError(_0x49e315,null));};exports[_0x2097('0x26')]=function(_0x3b5519,_0x10f891){if(_0x3b5519[_0x2097('0x54')]['id']){delete _0x3b5519['body']['id'];}return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x3b5519['params']['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x10f891,null))[_0x2097('0x27')](saveUpdates(_0x3b5519[_0x2097('0x54')],null))[_0x2097('0x27')](respondWithResult(_0x10f891,null))[_0x2097('0x4f')](handleError(_0x10f891,null));};exports[_0x2097('0x28')]=function(_0x4592c2,_0x22d1ce){return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x4592c2[_0x2097('0x51')]['id']}})['then'](handleEntityNotFound(_0x22d1ce,null))[_0x2097('0x27')](removeEntity(_0x22d1ce,null))[_0x2097('0x4f')](handleError(_0x22d1ce,null));};exports[_0x2097('0x61')]=function(_0x374d9a,_0x3c9e03,_0x4eb6f9){var _0x220132={'raw':![],'where':{}};var _0x2a950f={};var _0x251f67={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x2097('0x62')]({'where':{'id':_0x374d9a['params']['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x3c9e03,null))['then'](function(_0x1022d5){if(_0x1022d5){_0x2a950f['model']=_[_0x2097('0x3d')](db['CmHopper'][_0x2097('0x3a')]);_0x2a950f[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x374d9a[_0x2097('0x3c')]);_0x2a950f[_0x2097('0x3e')]=_['intersection'](_0x2a950f[_0x2097('0x3b')],_0x2a950f[_0x2097('0x3c')]);_0x220132[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x2a950f[_0x2097('0x3b')],qs[_0x2097('0x41')](_0x374d9a[_0x2097('0x3c')][_0x2097('0x41')]));_0x220132[_0x2097('0x3f')]=_0x220132[_0x2097('0x3f')][_0x2097('0x42')]?_0x220132[_0x2097('0x3f')]:_0x2a950f[_0x2097('0x3b')];if(!_0x374d9a[_0x2097('0x3c')][_0x2097('0x43')](_0x2097('0x63'))){_0x220132['limit']=qs[_0x2097('0x22')](_0x374d9a['query']['limit']);_0x220132[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x374d9a[_0x2097('0x3c')]['offset']);}_0x220132[_0x2097('0x44')]=qs[_0x2097('0x45')](_0x374d9a[_0x2097('0x3c')][_0x2097('0x45')]);_0x220132['where']=qs[_0x2097('0x3e')](_['pick'](_0x374d9a[_0x2097('0x3c')],_0x2a950f[_0x2097('0x3e')]));_0x220132[_0x2097('0x46')][_0x2097('0x64')]=_0x1022d5['id'];if(_0x374d9a['query'][_0x2097('0x2d')]){_0x220132[_0x2097('0x46')]=_[_0x2097('0x48')](_0x220132['where'],{'$or':_[_0x2097('0x2e')](_0x220132[_0x2097('0x3f')],function(_0x382302){var _0x50ea7d={};_0x50ea7d[_0x382302]={'$like':'%'+_0x374d9a[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x50ea7d;})});}_0x220132=_[_0x2097('0x48')]({},_0x220132,_0x374d9a[_0x2097('0x4c')]);return db[_0x2097('0x65')][_0x2097('0x20')]({'where':_0x220132['where']})['then'](function(_0xc7481d){_0x251f67[_0x2097('0x20')]=_0xc7481d;if(_0x374d9a[_0x2097('0x3c')][_0x2097('0x52')]){_0x220132[_0x2097('0x4d')]=[{'all':!![]}];}return db[_0x2097('0x65')]['findAll'](_0x220132);})[_0x2097('0x27')](function(_0x3570fb){_0x251f67[_0x2097('0x66')]=_0x3570fb;return _0x251f67;});}})[_0x2097('0x27')](respondWithFilteredResult(_0x3c9e03,_0x220132))[_0x2097('0x4f')](handleError(_0x3c9e03,null));};exports[_0x2097('0x67')]=function(_0x269338,_0x59def2,_0xa6cdb5){var _0x1cc8f9={'raw':!![],'where':{}};var _0x14e8b1={};var _0x46bac8={'count':0x0,'rows':[]};return db[_0x2097('0x39')][_0x2097('0x62')]({'where':{'id':_0x269338['params']['id']}})['then'](handleEntityNotFound(_0x59def2,null))[_0x2097('0x27')](function(_0x5063b5){if(_0x5063b5){_0x14e8b1['model']=_[_0x2097('0x3d')](db[_0x2097('0x68')][_0x2097('0x3a')]);_0x14e8b1[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x269338[_0x2097('0x3c')]);_0x14e8b1[_0x2097('0x3e')]=_[_0x2097('0x40')](_0x14e8b1['model'],_0x14e8b1[_0x2097('0x3c')]);_0x1cc8f9[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x14e8b1[_0x2097('0x3b')],qs[_0x2097('0x41')](_0x269338['query'][_0x2097('0x41')]));_0x1cc8f9[_0x2097('0x3f')]=_0x1cc8f9[_0x2097('0x3f')][_0x2097('0x42')]?_0x1cc8f9[_0x2097('0x3f')]:_0x14e8b1[_0x2097('0x3b')];if(!_0x269338['query'][_0x2097('0x43')](_0x2097('0x63'))){_0x1cc8f9['limit']=qs['limit'](_0x269338['query']['limit']);_0x1cc8f9[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x269338[_0x2097('0x3c')][_0x2097('0x21')]);}_0x1cc8f9[_0x2097('0x44')]=qs['sort'](_0x269338[_0x2097('0x3c')][_0x2097('0x45')]);_0x1cc8f9[_0x2097('0x46')]=qs[_0x2097('0x3e')](_[_0x2097('0x47')](_0x269338[_0x2097('0x3c')],_0x14e8b1['filters']));_0x1cc8f9[_0x2097('0x46')][_0x2097('0x64')]=_0x5063b5['id'];if(_0x269338['query'][_0x2097('0x2d')]){_0x1cc8f9[_0x2097('0x46')]=_[_0x2097('0x48')](_0x1cc8f9[_0x2097('0x46')],{'$or':_[_0x2097('0x2e')](_0x1cc8f9['attributes'],function(_0x3a7959){var _0x35570d={};_0x35570d[_0x3a7959]={'$like':'%'+_0x269338[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x35570d;})});}_0x1cc8f9=_[_0x2097('0x48')]({},_0x1cc8f9,_0x269338[_0x2097('0x4c')]);return db[_0x2097('0x68')][_0x2097('0x20')]({'where':_0x1cc8f9[_0x2097('0x46')]})[_0x2097('0x27')](function(_0x1baedb){_0x46bac8[_0x2097('0x20')]=_0x1baedb;if(_0x269338[_0x2097('0x3c')]['includeAll']){_0x1cc8f9['include']=[{'all':!![]}];}return db[_0x2097('0x68')]['findAll'](_0x1cc8f9);})['then'](function(_0x293ce2){_0x46bac8[_0x2097('0x66')]=_0x293ce2;return _0x46bac8;});}})[_0x2097('0x27')](respondWithFilteredResult(_0x59def2,_0x1cc8f9))[_0x2097('0x4f')](handleError(_0x59def2,null));};exports[_0x2097('0x69')]=function(_0x5737bf,_0x506a35,_0x33384b){var _0x59bf68={'raw':!![],'where':{}};var _0x2ac4a3={};var _0x581ee7={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x5737bf['params']['id']}})['then'](handleEntityNotFound(_0x506a35,null))[_0x2097('0x27')](function(_0x30017a){if(_0x30017a){_0x2ac4a3[_0x2097('0x3b')]=_[_0x2097('0x3d')](db[_0x2097('0x6a')][_0x2097('0x3a')]);_0x2ac4a3[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x5737bf[_0x2097('0x3c')]);_0x2ac4a3[_0x2097('0x3e')]=_[_0x2097('0x40')](_0x2ac4a3[_0x2097('0x3b')],_0x2ac4a3[_0x2097('0x3c')]);_0x59bf68[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x2ac4a3[_0x2097('0x3b')],qs[_0x2097('0x41')](_0x5737bf['query'][_0x2097('0x41')]));_0x59bf68[_0x2097('0x3f')]=_0x59bf68[_0x2097('0x3f')][_0x2097('0x42')]?_0x59bf68[_0x2097('0x3f')]:_0x2ac4a3[_0x2097('0x3b')];if(!_0x5737bf[_0x2097('0x3c')][_0x2097('0x43')](_0x2097('0x63'))){_0x59bf68[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x5737bf['query'][_0x2097('0x22')]);_0x59bf68[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x5737bf[_0x2097('0x3c')][_0x2097('0x21')]);}_0x59bf68[_0x2097('0x44')]=qs['sort'](_0x5737bf['query'][_0x2097('0x45')]);_0x59bf68[_0x2097('0x46')]=qs[_0x2097('0x3e')](_['pick'](_0x5737bf[_0x2097('0x3c')],_0x2ac4a3[_0x2097('0x3e')]));_0x59bf68[_0x2097('0x46')][_0x2097('0x64')]=_0x30017a['id'];if(_0x5737bf[_0x2097('0x3c')][_0x2097('0x2d')]){_0x59bf68[_0x2097('0x46')]=_[_0x2097('0x48')](_0x59bf68[_0x2097('0x46')],{'$or':_[_0x2097('0x2e')](_0x59bf68[_0x2097('0x3f')],function(_0x281699){var _0x119890={};_0x119890[_0x281699]={'$like':'%'+_0x5737bf[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x119890;})});}_0x59bf68=_[_0x2097('0x48')]({},_0x59bf68,_0x5737bf[_0x2097('0x4c')]);return db[_0x2097('0x6a')][_0x2097('0x20')]({'where':_0x59bf68[_0x2097('0x46')]})['then'](function(_0x2d211b){_0x581ee7[_0x2097('0x20')]=_0x2d211b;if(_0x5737bf[_0x2097('0x3c')][_0x2097('0x52')]){_0x59bf68[_0x2097('0x4d')]=[{'all':!![]}];}return db[_0x2097('0x6a')][_0x2097('0x4e')](_0x59bf68);})[_0x2097('0x27')](function(_0xecd4fc){_0x581ee7[_0x2097('0x66')]=_0xecd4fc;return _0x581ee7;});}})['then'](respondWithFilteredResult(_0x506a35,_0x59bf68))[_0x2097('0x4f')](handleError(_0x506a35,null));};exports[_0x2097('0x6b')]=function(_0x321f9b,_0x22a46d,_0x17c494){var _0x29b971={'raw':!![],'where':{}};var _0x205965={};var _0x107202={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x2097('0x62')]({'where':{'id':_0x321f9b[_0x2097('0x51')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x22a46d,null))[_0x2097('0x27')](function(_0x16f4b1){if(_0x16f4b1){_0x205965[_0x2097('0x3b')]=_[_0x2097('0x3d')](db['CmHopperBlack'][_0x2097('0x3a')]);_0x205965[_0x2097('0x3c')]=_['keys'](_0x321f9b[_0x2097('0x3c')]);_0x205965[_0x2097('0x3e')]=_['intersection'](_0x205965[_0x2097('0x3b')],_0x205965['query']);_0x29b971[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x205965['model'],qs['fields'](_0x321f9b[_0x2097('0x3c')][_0x2097('0x41')]));_0x29b971[_0x2097('0x3f')]=_0x29b971[_0x2097('0x3f')][_0x2097('0x42')]?_0x29b971[_0x2097('0x3f')]:_0x205965[_0x2097('0x3b')];if(!_0x321f9b[_0x2097('0x3c')][_0x2097('0x43')]('nolimit')){_0x29b971[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x321f9b['query']['limit']);_0x29b971[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x321f9b[_0x2097('0x3c')][_0x2097('0x21')]);}_0x29b971[_0x2097('0x44')]=qs[_0x2097('0x45')](_0x321f9b[_0x2097('0x3c')]['sort']);_0x29b971[_0x2097('0x46')]=qs[_0x2097('0x3e')](_[_0x2097('0x47')](_0x321f9b[_0x2097('0x3c')],_0x205965[_0x2097('0x3e')]));_0x29b971[_0x2097('0x46')][_0x2097('0x64')]=_0x16f4b1['id'];if(_0x321f9b[_0x2097('0x3c')][_0x2097('0x2d')]){_0x29b971[_0x2097('0x46')]=_[_0x2097('0x48')](_0x29b971['where'],{'$or':_[_0x2097('0x2e')](_0x29b971[_0x2097('0x3f')],function(_0x4844f3){var _0x245094={};_0x245094[_0x4844f3]={'$like':'%'+_0x321f9b[_0x2097('0x3c')]['filter']+'%'};return _0x245094;})});}_0x29b971=_[_0x2097('0x48')]({},_0x29b971,_0x321f9b[_0x2097('0x4c')]);return db['CmHopperBlack'][_0x2097('0x20')]({'where':_0x29b971[_0x2097('0x46')]})[_0x2097('0x27')](function(_0x2a53a2){_0x107202[_0x2097('0x20')]=_0x2a53a2;if(_0x321f9b[_0x2097('0x3c')][_0x2097('0x52')]){_0x29b971[_0x2097('0x4d')]=[{'all':!![]}];}return db[_0x2097('0x6c')][_0x2097('0x4e')](_0x29b971);})['then'](function(_0x4199aa){_0x107202[_0x2097('0x66')]=_0x4199aa;return _0x107202;});}})[_0x2097('0x27')](respondWithFilteredResult(_0x22a46d,_0x29b971))[_0x2097('0x4f')](handleError(_0x22a46d,null));};exports['getTeams']=function(_0x1b555e,_0x4bbf36,_0x212878){var _0x1ab515={};var _0x9bd20d={};var _0x3ba8a6;var _0x1c3eb4;return db[_0x2097('0x39')][_0x2097('0x62')]({'where':{'id':_0x1b555e[_0x2097('0x51')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x4bbf36,null))['then'](function(_0x22fa5d){if(_0x22fa5d){_0x3ba8a6=_0x22fa5d;_0x9bd20d['model']=_['keys'](db['Team']['rawAttributes']);_0x9bd20d[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x1b555e[_0x2097('0x3c')]);_0x9bd20d[_0x2097('0x3e')]=_['intersection'](_0x9bd20d[_0x2097('0x3b')],_0x9bd20d['query']);_0x1ab515[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x9bd20d[_0x2097('0x3b')],qs[_0x2097('0x41')](_0x1b555e['query'][_0x2097('0x41')]));_0x1ab515[_0x2097('0x3f')]=_0x1ab515[_0x2097('0x3f')][_0x2097('0x42')]?_0x1ab515[_0x2097('0x3f')]:_0x9bd20d[_0x2097('0x3b')];_0x1ab515['order']=qs['sort'](_0x1b555e['query']['sort']);_0x1ab515[_0x2097('0x46')]=qs[_0x2097('0x3e')](_[_0x2097('0x47')](_0x1b555e[_0x2097('0x3c')],_0x9bd20d[_0x2097('0x3e')]));if(_0x1b555e['query']['filter']){_0x1ab515[_0x2097('0x46')]=_['merge'](_0x1ab515[_0x2097('0x46')],{'$or':_[_0x2097('0x2e')](_0x1ab515[_0x2097('0x3f')],function(_0x5c9d0d){var _0x2ad23c={};_0x2ad23c[_0x5c9d0d]={'$like':'%'+_0x1b555e[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x2ad23c;})});}_0x1ab515=_[_0x2097('0x48')]({},_0x1ab515,_0x1b555e[_0x2097('0x4c')]);return _0x3ba8a6['getTeams'](_0x1ab515);}})[_0x2097('0x27')](function(_0x19c37e){if(_0x19c37e){_0x1c3eb4=_0x19c37e[_0x2097('0x42')];if(!_0x1b555e['query']['hasOwnProperty'](_0x2097('0x63'))){_0x1ab515[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x1b555e[_0x2097('0x3c')][_0x2097('0x22')]);_0x1ab515[_0x2097('0x21')]=qs['offset'](_0x1b555e[_0x2097('0x3c')][_0x2097('0x21')]);}return _0x3ba8a6[_0x2097('0x6d')](_0x1ab515);}})[_0x2097('0x27')](function(_0x77a55e){if(_0x77a55e){return _0x77a55e?{'count':_0x1c3eb4,'rows':_0x77a55e}:null;}})[_0x2097('0x27')](respondWithResult(_0x4bbf36,null))['catch'](handleError(_0x4bbf36,null));};exports[_0x2097('0x6e')]=function(_0x6356c1,_0x1f4810,_0x2465a4){var _0x1dbe5d=_0x6356c1[_0x2097('0x54')][_0x2097('0x6f')];return db['Team'][_0x2097('0x4e')]({'where':{'id':_['map'](_0x1dbe5d,'id')},'attributes':['id'],'include':[{'model':db[_0x2097('0x70')],'as':_0x2097('0x71'),'attributes':['id','name','online','voicePause',_0x2097('0x72')],'raw':!![]}]})[_0x2097('0x27')](function(_0xa50ad8){if(_0xa50ad8){var _0x55393c=_[_0x2097('0x73')](_0xa50ad8,function(_0x3d2c3d){var _0x49d4d9=_0x3d2c3d['get']({'plain':!![]});_0x49d4d9[_0x2097('0x71')][_0x2097('0x74')](function(_0x294351){_0x294351[_0x2097('0x75')]=_['find'](_0x1dbe5d,{'id':_0x49d4d9['id']})[_0x2097('0x75')];});return _0x49d4d9['Agents'];});return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x6356c1[_0x2097('0x51')]['id']}})['then'](function(_0x477486){return db[_0x2097('0x76')][_0x2097('0x77')](function(_0x274163){return _0x477486[_0x2097('0x6e')](_[_0x2097('0x2e')](_0x1dbe5d,'id'),{'transaction':_0x274163})[_0x2097('0x27')](function(){return BPromise['each'](_0x55393c,function(_0x1a0704){return db[_0x2097('0x78')][_0x2097('0x79')]({'where':{'UserId':_0x1a0704['id'],'VoiceQueueId':_0x6356c1[_0x2097('0x51')]['id']},'defaults':{'penalty':_0x1a0704[_0x2097('0x75')]},'transaction':_0x274163});});})['then'](function(){return BPromise[_0x2097('0x7a')](_[_0x2097('0x2d')](_0x55393c,{'online':!![]}),function(_0x1abb80){return db[_0x2097('0x7b')][_0x2097('0x7c')]({'membername':_0x1abb80[_0x2097('0x36')],'UserId':_0x1abb80['id'],'queue_name':_0x477486[_0x2097('0x36')],'VoiceQueueId':_0x477486['id'],'interface':_[_0x2097('0x7d')](_0x1abb80[_0x2097('0x72')])?util[_0x2097('0x7e')](_0x2097('0x7f'),_0x1abb80[_0x2097('0x36')]):_0x1abb80['interface'],'paused':_0x1abb80[_0x2097('0x80')]||![],'penalty':_0x1abb80[_0x2097('0x75')]},{'transaction':_0x274163});});})[_0x2097('0x27')](function(){_0x55393c[_0x2097('0x74')](function(_0x308409){socket[_0x2097('0x81')](_0x2097('0x82'),{'UserId':_0x308409['id'],'VoiceQueueId':_0x477486['id']});});});});});}})[_0x2097('0x27')](respondWithStatusCode(_0x1f4810,null))[_0x2097('0x4f')](handleError(_0x1f4810,null));};exports[_0x2097('0x83')]=function(_0x39cf0a,_0x612c1,_0x51e469){return db[_0x2097('0x84')]['findAll']({'where':{'id':_0x39cf0a[_0x2097('0x3c')][_0x2097('0x85')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2097('0x27')](handleEntityNotFound(_0x612c1,null))['then'](function(_0x191782){var _0x1de5cf=_[_0x2097('0x2e')](_0x191782,'id');var _0x367f0b=[];var _0x1ea9b8=[];var _0x4598e6=squel['select']();_0x4598e6[_0x2097('0x4b')](_0x2097('0x86'))[_0x2097('0x87')](_0x2097('0x88'),'tq')['join'](_0x2097('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x2097('0x46')]('VoiceQueueId\x20=\x20?',_0x39cf0a[_0x2097('0x51')]['id']);for(var _0xf03af0=0x0;_0xf03af0<_0x191782[_0x2097('0x42')];_0xf03af0+=0x1){let _0x5cec61=_0x191782[_0xf03af0];for(var _0x15697f=0x0;_0x15697f<_0x5cec61['Agents'][_0x2097('0x42')];_0x15697f+=0x1){let _0x33ff27=_0x5cec61['Agents'][_0x15697f];var _0x4251d9=_0x4598e6[_0x2097('0x8a')]();_0x4251d9['where']('ut.UserId\x20=\x20?',_0x33ff27['id']);_0x1ea9b8[_0x2097('0x8b')](db['sequelize']['query'](_0x4251d9[_0x2097('0x8c')](),{'type':db[_0x2097('0x76')]['QueryTypes']['SELECT']})['then'](function(_0x19fe2e){if(_0x19fe2e[_0x2097('0x42')]===0x1){return _0x33ff27['id'];}else{var _0x1dafdc=_[_0x2097('0x8d')](_[_0x2097('0x2e')](_0x19fe2e,'TeamId'),function(_0x4c751f){return _[_0x2097('0x30')](_0x1de5cf,_0x4c751f);});if(_0x1dafdc){return _0x33ff27['id'];}}}));}}return BPromise[_0x2097('0x8e')](_0x1ea9b8)['then'](function(_0x4665ca){_0x367f0b=_(_0x367f0b)['union'](_0x4665ca)[_0x2097('0x8f')]()[_0x2097('0x2f')]();return db[_0x2097('0x39')]['find']({'where':{'id':_0x39cf0a[_0x2097('0x51')]['id']}})['then'](function(_0x1f084a){return db[_0x2097('0x76')][_0x2097('0x77')](function(_0xf70ef9){return _0x1f084a['removeTeams'](_0x39cf0a[_0x2097('0x3c')][_0x2097('0x85')],{'transaction':_0xf70ef9})[_0x2097('0x27')](function(){if(!_[_0x2097('0x90')](_0x367f0b)){return _0x1f084a[_0x2097('0x91')](_0x367f0b,{'transaction':_0xf70ef9})['then'](function(){return db[_0x2097('0x7b')][_0x2097('0x28')]({'where':{'VoiceQueueId':_0x39cf0a[_0x2097('0x51')]['id'],'UserId':_0x367f0b},'transaction':_0xf70ef9});});}})[_0x2097('0x27')](function(){_0x367f0b[_0x2097('0x74')](function(_0x4b879a){socket[_0x2097('0x81')](_0x2097('0x92'),{'UserId':_0x4b879a,'VoiceQueueId':_0x1f084a['id']});});});});});});})['then'](respondWithStatusCode(_0x612c1,null))[_0x2097('0x4f')](handleError(_0x612c1,null));};exports['addAgents']=function(_0x47aca2,_0x4cc358,_0x5764fc){var _0x49521d,_0x20dab8;return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x47aca2['params']['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x4cc358,null))[_0x2097('0x27')](function(_0x2addde){if(_0x2addde){_0x20dab8=_0x2addde;return _0x2addde[_0x2097('0x93')](_0x47aca2['body'][_0x2097('0x85')],_[_0x2097('0x5c')](_0x47aca2[_0x2097('0x54')],['ids','id'])||{})[_0x2097('0x94')](function(_0x5c64c4){for(var _0x5e5a8a=0x0;_0x5e5a8a<_0x47aca2['body']['ids'][_0x2097('0x42')];_0x5e5a8a+=0x1){socket[_0x2097('0x81')]('userVoiceQueue:save',{'UserId':_0x47aca2[_0x2097('0x54')][_0x2097('0x85')][_0x5e5a8a],'VoiceQueueId':_0x47aca2['params']['id']});}return _0x5c64c4;});}})[_0x2097('0x27')](function(_0x261b70){_0x49521d=_0x261b70||[];if(_0x20dab8){return db[_0x2097('0x70')]['findAll']({'where':{'id':_0x47aca2[_0x2097('0x54')][_0x2097('0x85')]},'attributes':['id','name','online',_0x2097('0x80'),_0x2097('0x72')],'raw':!![]});}})[_0x2097('0x27')](function(_0x4d65f3){if(!_['isEmpty'](_0x4d65f3)){var _0x29202b=[];for(var _0x442f26=0x0;_0x442f26<_0x4d65f3[_0x2097('0x42')];_0x442f26++){if(_0x4d65f3[_0x442f26][_0x2097('0x95')]){_0x29202b[_0x2097('0x8b')](db[_0x2097('0x7b')][_0x2097('0x7c')]({'membername':_0x4d65f3[_0x442f26][_0x2097('0x36')],'UserId':_0x4d65f3[_0x442f26]['id'],'queue_name':_0x20dab8[_0x2097('0x36')],'VoiceQueueId':_0x20dab8['id'],'interface':_['isNil'](_0x4d65f3[_0x442f26][_0x2097('0x72')])?util[_0x2097('0x7e')](_0x2097('0x7f'),_0x4d65f3[_0x442f26][_0x2097('0x36')]):_0x4d65f3[_0x442f26][_0x2097('0x72')],'paused':_0x4d65f3[_0x442f26]['voicePause']||![],'penalty':_0x47aca2[_0x2097('0x54')][_0x2097('0x75')]||0x0}));}}return BPromise[_0x2097('0x8e')](_0x29202b);}})[_0x2097('0x27')](function(){return _0x49521d;})['then'](respondWithResult(_0x4cc358,null))['catch'](handleError(_0x4cc358,null));};exports[_0x2097('0x91')]=function(_0x3d9fac,_0x20aa02,_0x3a1805){return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x3d9fac['params']['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x20aa02,null))[_0x2097('0x27')](function(_0x43a37e){if(_0x43a37e){return _0x43a37e[_0x2097('0x91')](_0x3d9fac[_0x2097('0x3c')][_0x2097('0x85')])['then'](function(){if(_[_0x2097('0x96')](_0x3d9fac[_0x2097('0x3c')][_0x2097('0x85')])){for(var _0x217240=0x0;_0x217240<_0x3d9fac[_0x2097('0x3c')]['ids'][_0x2097('0x42')];_0x217240+=0x1){socket['emit'](_0x2097('0x92'),{'UserId':Number(_0x3d9fac[_0x2097('0x3c')][_0x2097('0x85')][_0x217240]),'VoiceQueueId':Number(_0x3d9fac[_0x2097('0x51')]['id'])});}}else{socket[_0x2097('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x3d9fac[_0x2097('0x3c')]['ids']),'VoiceQueueId':Number(_0x3d9fac[_0x2097('0x51')]['id'])});}});}})[_0x2097('0x27')](function(_0x2a483c){return db[_0x2097('0x7b')][_0x2097('0x28')]({'where':{'VoiceQueueId':_0x3d9fac[_0x2097('0x51')]['id'],'UserId':_0x3d9fac['query'][_0x2097('0x85')]}})['then'](function(){return _0x2a483c;});})[_0x2097('0x27')](respondWithStatusCode(_0x20aa02,null))[_0x2097('0x4f')](handleError(_0x20aa02,null));};exports[_0x2097('0x97')]=function(_0xf2b25b,_0x53f8a1,_0x47212d){var _0x1be707={};var _0x353482={};var _0x372d6a;var _0x1dc2a4;return db[_0x2097('0x39')][_0x2097('0x62')]({'where':{'id':_0xf2b25b[_0x2097('0x51')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x53f8a1,null))[_0x2097('0x27')](function(_0x254d91){if(_0x254d91){_0x372d6a=_0x254d91;_0x353482[_0x2097('0x3b')]=_[_0x2097('0x3d')](db[_0x2097('0x70')]['rawAttributes']);_0x353482[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0xf2b25b['query']);_0x353482[_0x2097('0x3e')]=_[_0x2097('0x40')](_0x353482[_0x2097('0x3b')],_0x353482[_0x2097('0x3c')]);_0x1be707['attributes']=_[_0x2097('0x40')](_0x353482[_0x2097('0x3b')],qs[_0x2097('0x41')](_0xf2b25b['query']['fields']));_0x1be707['attributes']=_0x1be707[_0x2097('0x3f')][_0x2097('0x42')]?_0x1be707[_0x2097('0x3f')]:_0x353482[_0x2097('0x3b')];_0x1be707[_0x2097('0x44')]=qs[_0x2097('0x45')](_0xf2b25b[_0x2097('0x3c')]['sort']);_0x1be707['where']=qs['filters'](_['pick'](_0xf2b25b[_0x2097('0x3c')],_0x353482[_0x2097('0x3e')]));if(_0xf2b25b[_0x2097('0x3c')][_0x2097('0x2d')]){_0x1be707[_0x2097('0x46')]=_['merge'](_0x1be707[_0x2097('0x46')],{'$or':_[_0x2097('0x2e')](_0x1be707['attributes'],function(_0x3b95de){var _0x5edb74={};_0x5edb74[_0x3b95de]={'$like':'%'+_0xf2b25b[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x5edb74;})});}_0x1be707=_[_0x2097('0x48')]({},_0x1be707,_0xf2b25b[_0x2097('0x4c')]);return _0x372d6a[_0x2097('0x97')](_0x1be707);}})[_0x2097('0x27')](function(_0x267122){if(_0x267122){_0x1dc2a4=_0x267122[_0x2097('0x42')];if(!_0xf2b25b[_0x2097('0x3c')][_0x2097('0x43')](_0x2097('0x63'))){_0x1be707[_0x2097('0x22')]=qs[_0x2097('0x22')](_0xf2b25b[_0x2097('0x3c')][_0x2097('0x22')]);_0x1be707['offset']=qs[_0x2097('0x21')](_0xf2b25b[_0x2097('0x3c')][_0x2097('0x21')]);}return _0x372d6a[_0x2097('0x97')](_0x1be707);}})[_0x2097('0x27')](function(_0xa8b798){if(_0xa8b798){return _0xa8b798?{'count':_0x1dc2a4,'rows':_0xa8b798}:null;}})['then'](respondWithResult(_0x53f8a1,null))[_0x2097('0x4f')](handleError(_0x53f8a1,null));};exports[_0x2097('0x98')]=function(_0x1c20a7,_0x280aa7,_0x40bacb){var _0x53405b={};var _0x577850={};var _0x5d9d12;var _0x46b39c;return db[_0x2097('0x39')][_0x2097('0x62')]({'where':{'id':_0x1c20a7['params']['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x280aa7,null))['then'](function(_0x37b8b2){if(_0x37b8b2){_0x5d9d12=_0x37b8b2;_0x577850[_0x2097('0x3b')]=_['keys'](db[_0x2097('0x7b')][_0x2097('0x3a')]);_0x577850[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x1c20a7[_0x2097('0x3c')]);_0x577850['filters']=_['intersection'](_0x577850[_0x2097('0x3b')],_0x577850[_0x2097('0x3c')]);_0x53405b[_0x2097('0x3f')]=_[_0x2097('0x40')](_0x577850[_0x2097('0x3b')],qs[_0x2097('0x41')](_0x1c20a7[_0x2097('0x3c')][_0x2097('0x41')]));_0x53405b[_0x2097('0x3f')]=_0x53405b[_0x2097('0x3f')]['length']?_0x53405b[_0x2097('0x3f')]:_0x577850[_0x2097('0x3b')];_0x53405b[_0x2097('0x44')]=qs['sort'](_0x1c20a7[_0x2097('0x3c')]['sort']);_0x53405b[_0x2097('0x46')]=qs[_0x2097('0x3e')](_['pick'](_0x1c20a7[_0x2097('0x3c')],_0x577850['filters']));if(_0x1c20a7[_0x2097('0x3c')][_0x2097('0x2d')]){_0x53405b[_0x2097('0x46')]=_['merge'](_0x53405b[_0x2097('0x46')],{'$or':_[_0x2097('0x2e')](_0x53405b['attributes'],function(_0x2886b1){var _0x30c46b={};_0x30c46b[_0x2886b1]={'$like':'%'+_0x1c20a7[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x30c46b;})});}_0x53405b=_['merge']({},_0x53405b,_0x1c20a7[_0x2097('0x4c')]);return _0x5d9d12[_0x2097('0x98')](_0x53405b);}})['then'](function(_0x3d3969){if(_0x3d3969){_0x46b39c=_0x3d3969['length'];if(!_0x1c20a7[_0x2097('0x3c')]['hasOwnProperty'](_0x2097('0x63'))){_0x53405b['limit']=qs[_0x2097('0x22')](_0x1c20a7[_0x2097('0x3c')][_0x2097('0x22')]);_0x53405b[_0x2097('0x21')]=qs['offset'](_0x1c20a7[_0x2097('0x3c')]['offset']);}return _0x5d9d12[_0x2097('0x98')](_0x53405b);}})[_0x2097('0x27')](function(_0x1f6074){return _0x1f6074?{'count':_0x46b39c,'rows':_0x1f6074}:null;})['then'](respondWithResult(_0x280aa7,null))[_0x2097('0x4f')](handleError(_0x280aa7,null));};exports[_0x2097('0x99')]=function(_0xd8c9a2,_0x197e8b,_0x259e15){var _0x4838d9={};var _0xef53ca={};var _0x2078ae;var _0x2c6750;return db[_0x2097('0x39')]['findOne']({'where':{'id':_0xd8c9a2[_0x2097('0x51')]['id']}})['then'](handleEntityNotFound(_0x197e8b,null))[_0x2097('0x27')](function(_0x1bf528){if(_0x1bf528){_0x2078ae=_0x1bf528;_0xef53ca[_0x2097('0x3b')]=_['keys'](db[_0x2097('0x9a')]['rawAttributes']);_0xef53ca[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0xd8c9a2[_0x2097('0x3c')]);_0xef53ca[_0x2097('0x3e')]=_[_0x2097('0x40')](_0xef53ca[_0x2097('0x3b')],_0xef53ca[_0x2097('0x3c')]);_0x4838d9[_0x2097('0x3f')]=_['intersection'](_0xef53ca['model'],qs[_0x2097('0x41')](_0xd8c9a2[_0x2097('0x3c')][_0x2097('0x41')]));_0x4838d9[_0x2097('0x3f')]=_0x4838d9[_0x2097('0x3f')][_0x2097('0x42')]?_0x4838d9[_0x2097('0x3f')]:_0xef53ca[_0x2097('0x3b')];_0x4838d9['order']=qs[_0x2097('0x45')](_0xd8c9a2['query']['sort']);_0x4838d9[_0x2097('0x46')]=qs['filters'](_[_0x2097('0x47')](_0xd8c9a2[_0x2097('0x3c')],_0xef53ca[_0x2097('0x3e')]));if(_0xd8c9a2[_0x2097('0x3c')]['filter']){_0x4838d9['where']=_[_0x2097('0x48')](_0x4838d9['where'],{'$or':_[_0x2097('0x2e')](_0x4838d9['attributes'],function(_0x5ddae2){var _0x220922={};_0x220922[_0x5ddae2]={'$like':'%'+_0xd8c9a2[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x220922;})});}_0x4838d9=_[_0x2097('0x48')]({},_0x4838d9,_0xd8c9a2[_0x2097('0x4c')]);return _0x2078ae[_0x2097('0x99')](_0x4838d9);}})['then'](function(_0x127717){if(_0x127717){_0x2c6750=_0x127717[_0x2097('0x42')];if(!_0xd8c9a2[_0x2097('0x3c')][_0x2097('0x43')](_0x2097('0x63'))){_0x4838d9['limit']=qs[_0x2097('0x22')](_0xd8c9a2[_0x2097('0x3c')][_0x2097('0x22')]);_0x4838d9[_0x2097('0x21')]=qs[_0x2097('0x21')](_0xd8c9a2['query'][_0x2097('0x21')]);}return _0x2078ae['getLists'](_0x4838d9);}})[_0x2097('0x27')](function(_0x5af11a){if(_0x5af11a){return _0x5af11a?{'count':_0x2c6750,'rows':_0x5af11a}:null;}})[_0x2097('0x27')](respondWithResult(_0x197e8b,null))['catch'](handleError(_0x197e8b,null));};exports[_0x2097('0x9b')]=function(_0x2aed37,_0x3e1c89,_0x6182db){var _0xe3990,_0x54cb13;return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x2aed37['params']['id']}})['then'](handleEntityNotFound(_0x3e1c89,null))[_0x2097('0x27')](function(_0x59a469){if(_0x59a469){_0x54cb13=_0x59a469;return _0x59a469[_0x2097('0x9b')](_0x2aed37[_0x2097('0x54')]['ids'],_['omit'](_0x2aed37[_0x2097('0x54')],[_0x2097('0x85'),'id'])||{});}return null;})[_0x2097('0x94')](function(_0x5d1601){var _0x33d623;_0xe3990=_0x5d1601||[];var _0x5c1d71=[];if(_0x5d1601){for(var _0x35ea8c=0x0;_0x35ea8c<_0x5d1601[_0x2097('0x42')];_0x35ea8c+=0x1){var _0x35db83=_0x5d1601[_0x35ea8c]['get']({'plain':!![]});_0x54cb13['dialCheckDuplicateType']=_0x2aed37[_0x2097('0x54')][_0x2097('0x9c')]?_0x2aed37[_0x2097('0x54')][_0x2097('0x9c')]:_0x54cb13['dialCheckDuplicateType'];switch(_0x54cb13[_0x2097('0x9c')]){case'always':_0x33d623=squel[_0x2097('0x9d')]()[_0x2097('0x9e')]('cm_hopper')[_0x2097('0x9f')]([_0x2097('0xa0'),_0x2097('0xa1'),_0x2097('0xa2'),_0x2097('0xa3'),_0x2097('0x64'),_0x2097('0x5e'),_0x2097('0x5d')],squel[_0x2097('0xa4')]()['field']('phone',_0x2097('0xa0'))[_0x2097('0x4b')](_0x2097('0xa5'),_0x2097('0xa1'))[_0x2097('0x4b')]('id','ContactId')[_0x2097('0x4b')](_0x35db83['CmListId'][_0x2097('0x8c')](),_0x2097('0xa3'))['field'](_0x2aed37[_0x2097('0x51')]['id'][_0x2097('0x8c')](),'VoiceQueueId')[_0x2097('0x4b')](_0x2097('0xa5'),'createdAt')['field'](_0x2097('0xa5'),_0x2097('0x5d'))['from']('cm_contacts')[_0x2097('0x46')](_0x2097('0xa6'))[_0x2097('0x46')](_0x2097('0xa7'),_0x35db83[_0x2097('0xa8')]['toString']())['where'](_0x2097('0xa9'))[_0x2097('0x46')](_0x2097('0xaa'),squel[_0x2097('0xa4')]()[_0x2097('0x4b')](_0x2097('0xab'))[_0x2097('0x87')](_0x2097('0xac'))[_0x2097('0x46')](_0x2097('0xad'),_0x2aed37[_0x2097('0x51')]['id'][_0x2097('0x8c')]()))[_0x2097('0x46')](_0x2097('0xaa'),squel[_0x2097('0xa4')]()[_0x2097('0x4b')](_0x2097('0xae'))[_0x2097('0x87')](_0x2097('0xaf'))[_0x2097('0x46')](_0x2097('0xad'),_0x2aed37['params']['id'][_0x2097('0x8c')]())))['toString']();break;case _0x2097('0xb0'):_0x33d623=squel[_0x2097('0x9d')]()['into'](_0x2097('0xaf'))['fromQuery']([_0x2097('0xa0'),_0x2097('0xa1'),_0x2097('0xa2'),'ListId',_0x2097('0x64'),_0x2097('0x5e'),'updatedAt'],squel[_0x2097('0xa4')]()['field'](_0x2097('0xa0'),_0x2097('0xa0'))[_0x2097('0x4b')]('NOW()',_0x2097('0xa1'))[_0x2097('0x4b')]('id','ContactId')[_0x2097('0x4b')](_0x35db83['CmListId'][_0x2097('0x8c')](),_0x2097('0xa3'))['field'](_0x2aed37[_0x2097('0x51')]['id']['toString'](),'VoiceQueueId')[_0x2097('0x4b')](_0x2097('0xa5'),_0x2097('0x5e'))[_0x2097('0x4b')](_0x2097('0xa5'),'updatedAt')[_0x2097('0x87')]('cm_contacts')[_0x2097('0x46')]('deletedAt\x20IS\x20NULL')[_0x2097('0x46')](_0x2097('0xa7'),_0x35db83['CmListId'][_0x2097('0x8c')]())['where'](_0x2097('0xa9'))[_0x2097('0x46')](_0x2097('0xaa'),squel['select']()[_0x2097('0x4b')](_0x2097('0xae'))[_0x2097('0x87')](_0x2097('0xaf'))[_0x2097('0x46')](_0x2097('0xad'),_0x2aed37['params']['id']['toString']())))[_0x2097('0x8c')]();break;default:_0x33d623=squel[_0x2097('0x9d')]()[_0x2097('0x9e')]('cm_hopper')[_0x2097('0x9f')]([_0x2097('0xa0'),_0x2097('0xa1'),_0x2097('0xa2'),_0x2097('0xa3'),_0x2097('0x64'),_0x2097('0x5e'),_0x2097('0x5d')],squel[_0x2097('0xa4')]()[_0x2097('0x4b')](_0x2097('0xa0'),'phone')[_0x2097('0x4b')]('NOW()','scheduledAt')[_0x2097('0x4b')]('id',_0x2097('0xa2'))[_0x2097('0x4b')](_0x35db83['CmListId'][_0x2097('0x8c')](),'ListId')[_0x2097('0x4b')](_0x2aed37['params']['id'][_0x2097('0x8c')](),_0x2097('0x64'))['field']('NOW()',_0x2097('0x5e'))[_0x2097('0x4b')](_0x2097('0xa5'),_0x2097('0x5d'))[_0x2097('0x87')](_0x2097('0xb1'))[_0x2097('0x46')](_0x2097('0xa6'))[_0x2097('0x46')](_0x2097('0xa7'),_0x35db83['CmListId'][_0x2097('0x8c')]())[_0x2097('0x46')](_0x2097('0xa9')))[_0x2097('0x8c')]();}_0x5c1d71[_0x2097('0x8b')](db[_0x2097('0x76')]['query'](_0x33d623));}return BPromise[_0x2097('0x8e')](_0x5c1d71);}})[_0x2097('0x27')](function(){return _0xe3990;})[_0x2097('0x27')](respondWithResult(_0x3e1c89,null))[_0x2097('0x4f')](handleError(_0x3e1c89,null));};exports[_0x2097('0xb2')]=function(_0x1b26d8,_0x672025,_0xec2bdd){return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x1b26d8['params']['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x672025,null))[_0x2097('0x27')](function(_0x19eec8){if(_0x19eec8){return _0x19eec8[_0x2097('0xb2')](_0x1b26d8[_0x2097('0x3c')]['ids']);}})[_0x2097('0x27')](function(_0x28734b){if(_0x28734b){return db[_0x2097('0x65')][_0x2097('0x28')]({'where':{'ListId':_0x1b26d8[_0x2097('0x3c')][_0x2097('0x85')],'VoiceQueueId':_0x1b26d8[_0x2097('0x51')]['id']}})[_0x2097('0x27')](function(){return _0x28734b;});}})[_0x2097('0x27')](respondWithStatusCode(_0x672025,null))['catch'](handleError(_0x672025,null));};exports[_0x2097('0xb3')]=function(_0x54414f,_0x581cdf,_0x313b45){var _0x588bce={};var _0x32caf1={};var _0x43f85d;var _0x505186;return db[_0x2097('0x39')][_0x2097('0x62')]({'where':{'id':_0x54414f[_0x2097('0x51')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x581cdf,null))[_0x2097('0x27')](function(_0x416c8a){if(_0x416c8a){_0x43f85d=_0x416c8a;_0x32caf1[_0x2097('0x3b')]=_[_0x2097('0x3d')](db[_0x2097('0x9a')][_0x2097('0x3a')]);_0x32caf1[_0x2097('0x3c')]=_[_0x2097('0x3d')](_0x54414f['query']);_0x32caf1[_0x2097('0x3e')]=_[_0x2097('0x40')](_0x32caf1[_0x2097('0x3b')],_0x32caf1['query']);_0x588bce['attributes']=_[_0x2097('0x40')](_0x32caf1[_0x2097('0x3b')],qs['fields'](_0x54414f[_0x2097('0x3c')][_0x2097('0x41')]));_0x588bce[_0x2097('0x3f')]=_0x588bce[_0x2097('0x3f')]['length']?_0x588bce[_0x2097('0x3f')]:_0x32caf1[_0x2097('0x3b')];_0x588bce[_0x2097('0x44')]=qs[_0x2097('0x45')](_0x54414f[_0x2097('0x3c')][_0x2097('0x45')]);_0x588bce[_0x2097('0x46')]=qs[_0x2097('0x3e')](_[_0x2097('0x47')](_0x54414f['query'],_0x32caf1[_0x2097('0x3e')]));if(_0x54414f[_0x2097('0x3c')][_0x2097('0x2d')]){_0x588bce[_0x2097('0x46')]=_[_0x2097('0x48')](_0x588bce[_0x2097('0x46')],{'$or':_['map'](_0x588bce[_0x2097('0x3f')],function(_0x14af0f){var _0x4e6c23={};_0x4e6c23[_0x14af0f]={'$like':'%'+_0x54414f[_0x2097('0x3c')][_0x2097('0x2d')]+'%'};return _0x4e6c23;})});}_0x588bce=_[_0x2097('0x48')]({},_0x588bce,_0x54414f[_0x2097('0x4c')]);return _0x43f85d[_0x2097('0xb3')](_0x588bce);}})[_0x2097('0x27')](function(_0x549bc5){if(_0x549bc5){_0x505186=_0x549bc5[_0x2097('0x42')];if(!_0x54414f['query']['hasOwnProperty']('nolimit')){_0x588bce[_0x2097('0x22')]=qs[_0x2097('0x22')](_0x54414f[_0x2097('0x3c')][_0x2097('0x22')]);_0x588bce[_0x2097('0x21')]=qs[_0x2097('0x21')](_0x54414f[_0x2097('0x3c')][_0x2097('0x21')]);}return _0x43f85d['getBlackLists'](_0x588bce);}})[_0x2097('0x27')](function(_0x14e587){if(_0x14e587){return _0x14e587?{'count':_0x505186,'rows':_0x14e587}:null;}})[_0x2097('0x27')](respondWithResult(_0x581cdf,null))[_0x2097('0x4f')](handleError(_0x581cdf,null));};exports['addBlackLists']=function(_0x50a746,_0x3c9145,_0x4b087c){var _0x424ee0,_0x55a4bc;return db[_0x2097('0x39')]['find']({'where':{'id':_0x50a746[_0x2097('0x51')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0x3c9145,null))[_0x2097('0x27')](function(_0x5ae102){if(_0x5ae102){_0x55a4bc=_0x5ae102;return _0x5ae102[_0x2097('0xb4')](_0x50a746[_0x2097('0x54')][_0x2097('0x85')],_[_0x2097('0x5c')](_0x50a746[_0x2097('0x54')],['ids','id'])||{});}return null;})[_0x2097('0x94')](function(_0x2729c2){var _0x24fde1;_0x424ee0=_0x2729c2||[];var _0x591ea3=[];if(_0x2729c2){for(var _0x5c5356=0x0;_0x5c5356<_0x2729c2[_0x2097('0x42')];_0x5c5356+=0x1){var _0x3a4834=_0x2729c2[_0x5c5356][_0x2097('0x29')]({'plain':!![]});_0x24fde1=squel[_0x2097('0x9d')]()[_0x2097('0x9e')](_0x2097('0xb5'))[_0x2097('0x9f')]([_0x2097('0xa0'),_0x2097('0xa2'),'ListId',_0x2097('0x64'),_0x2097('0x5e'),_0x2097('0x5d')],squel['select']()[_0x2097('0x4b')](_0x2097('0xa0'),_0x2097('0xa0'))[_0x2097('0x4b')]('id','ContactId')[_0x2097('0x4b')](_0x3a4834[_0x2097('0xa8')]['toString'](),_0x2097('0xa3'))['field'](_0x50a746[_0x2097('0x51')]['id'][_0x2097('0x8c')](),_0x2097('0x64'))[_0x2097('0x4b')](_0x2097('0xa5'),_0x2097('0x5e'))[_0x2097('0x4b')](_0x2097('0xa5'),_0x2097('0x5d'))[_0x2097('0x87')](_0x2097('0xb1'))['where']('deletedAt\x20IS\x20NULL')[_0x2097('0x46')]('ListId\x20=\x20?',_0x3a4834[_0x2097('0xa8')][_0x2097('0x8c')]())[_0x2097('0x46')](_0x2097('0xa9')))['toString']();_0x591ea3[_0x2097('0x8b')](db[_0x2097('0x76')][_0x2097('0x3c')](_0x24fde1));}return BPromise['all'](_0x591ea3);}})['then'](function(){return _0x424ee0;})[_0x2097('0x27')](respondWithResult(_0x3c9145,null))['catch'](handleError(_0x3c9145,null));};exports[_0x2097('0xb6')]=function(_0x49ff4d,_0xf02b18,_0x51097c){return db[_0x2097('0x39')][_0x2097('0x32')]({'where':{'id':_0x49ff4d[_0x2097('0x51')]['id']}})[_0x2097('0x27')](handleEntityNotFound(_0xf02b18,null))[_0x2097('0x27')](function(_0x46ba62){if(_0x46ba62){return _0x46ba62[_0x2097('0xb6')](_0x49ff4d[_0x2097('0x3c')][_0x2097('0x85')]);}})[_0x2097('0x27')](function(_0x2aa9dd){if(_0x2aa9dd){return db[_0x2097('0x6c')]['destroy']({'where':{'ListId':_0x49ff4d[_0x2097('0x3c')][_0x2097('0x85')],'VoiceQueueId':_0x49ff4d[_0x2097('0x51')]['id']}})[_0x2097('0x27')](function(){return _0x2aa9dd;});}})[_0x2097('0x27')](respondWithStatusCode(_0xf02b18,null))[_0x2097('0x4f')](handleError(_0xf02b18,null));}; \ No newline at end of file +var _0x4213=['sort','where','filters','pick','key','VIRTUAL','field','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','VoiceQueues','QueueCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','UserProfileSection','findOne','CmHopper','hasOwnProperty','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','voicePause','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','TeamId','all','compact','ids','isEmpty','removeAgents','destroy','userVoiceQueue:remove','addAgents','online','push','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ListId','createdAt','NOW()','ContactId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','fromQuery','removeLists','getBlackLists','addBlackLists','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','json','count','offset','limit','status','set','reject','save','update','then','get','inbound','outbound','filter','ignore','map','value','type','UserProfileResource','error','stack','name','send','index','VoiceQueue','model','keys','query','intersection','fields','attributes','length','nolimit','order'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4213,0x77));var _0x3421=function(_0xd51f13,_0x236119){_0xd51f13=_0xd51f13-0x0;var _0x4d7ad8=_0x4213[_0xd51f13];return _0x4d7ad8;};'use strict';var pdf=require(_0x3421('0x0'));var emlformat=require(_0x3421('0x1'));var rimraf=require(_0x3421('0x2'));var zipdir=require(_0x3421('0x3'));var jsonpatch=require(_0x3421('0x4'));var rp=require(_0x3421('0x5'));var moment=require(_0x3421('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x3421('0x7'));var util=require('util');var path=require(_0x3421('0x8'));var sox=require(_0x3421('0x9'));var csv=require(_0x3421('0xa'));var ejs=require(_0x3421('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3421('0xc'));var crypto=require(_0x3421('0xd'));var jsforce=require(_0x3421('0xe'));var deskjs=require(_0x3421('0xf'));var toCsv=require(_0x3421('0xa'));var querystring=require('querystring');var Papa=require(_0x3421('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3421('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3421('0x12'))(_0x3421('0x13'));var utils=require(_0x3421('0x14'));var config=require(_0x3421('0x15'));var db=require(_0x3421('0x16'))['db'];config[_0x3421('0x17')]=_[_0x3421('0x18')](config['redis'],{'host':_0x3421('0x19'),'port':0x18eb});var socket=require(_0x3421('0x1a'))(new Redis(config[_0x3421('0x17')]));require(_0x3421('0x1b'))[_0x3421('0x1c')](socket);function respondWithStatusCode(_0x3f4672,_0x25ffd4){_0x25ffd4=_0x25ffd4||0xcc;return function(_0x59ea4a){if(_0x59ea4a){return _0x3f4672[_0x3421('0x1d')](_0x25ffd4);}return _0x3f4672['status'](_0x25ffd4)[_0x3421('0x1e')]();};}function respondWithResult(_0x5257ad,_0x59ae45){_0x59ae45=_0x59ae45||0xc8;return function(_0x1e33ab){if(_0x1e33ab){return _0x5257ad['status'](_0x59ae45)[_0x3421('0x1f')](_0x1e33ab);}};}function respondWithFilteredResult(_0x23694b,_0x52af2d){return function(_0x3584d6){if(_0x3584d6){var _0x3dec08=_0x3584d6[_0x3421('0x20')],_0x130d3c=_0x52af2d[_0x3421('0x21')],_0x104cc5=_0x52af2d[_0x3421('0x21')]+_0x52af2d[_0x3421('0x22')],_0x18acc1;if(_0x104cc5>=_0x3dec08){_0x104cc5=_0x3dec08;_0x18acc1=0xc8;}else{_0x18acc1=0xce;}_0x23694b[_0x3421('0x23')](_0x18acc1);return _0x23694b[_0x3421('0x24')]('Content-Range',_0x130d3c+'-'+_0x104cc5+'/'+_0x3dec08)[_0x3421('0x1f')](_0x3584d6);}return null;};}function patchUpdates(_0x4b59a5){return function(_0x5820f6){try{jsonpatch['apply'](_0x5820f6,_0x4b59a5,!![]);}catch(_0x33155b){return BPromise[_0x3421('0x25')](_0x33155b);}return _0x5820f6[_0x3421('0x26')]();};}function saveUpdates(_0x256cc5,_0x132e8e){return function(_0x39bed4){if(_0x39bed4){return _0x39bed4[_0x3421('0x27')](_0x256cc5)[_0x3421('0x28')](function(_0xb9af5f){return _0xb9af5f;});}return null;};}function removeEntity(_0x34389e,_0x48fb3d){return function(_0x57a4af){if(_0x57a4af){return _0x57a4af['destroy']()[_0x3421('0x28')](function(){var _0x958899=_0x57a4af[_0x3421('0x29')]({'plain':!![]});var _0x5bc28a=[{'name':'VoiceQueues','value':_0x3421('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':_0x3421('0x2b'),'ignore':![]}];var _0x487944=_(_0x5bc28a)[_0x3421('0x2c')](_0x3421('0x2d'))[_0x3421('0x2e')](_0x3421('0x2f'))[_0x3421('0x2f')]();if(_['includes'](_0x487944,_0x958899[_0x3421('0x30')])){return;}var _0x52fd41=_['find'](_0x5bc28a,[_0x3421('0x2f'),_0x958899['type']])['name'];return db[_0x3421('0x31')]['destroy']({'where':{'type':_0x52fd41,'resourceId':_0x958899['id']}})[_0x3421('0x28')](function(){return _0x57a4af;});})['then'](function(){_0x34389e[_0x3421('0x23')](0xcc)[_0x3421('0x1e')]();});}};}function handleEntityNotFound(_0x48d828,_0x3f7c0b){return function(_0x3bc7c1){if(!_0x3bc7c1){_0x48d828[_0x3421('0x1d')](0x194);}return _0x3bc7c1;};}function handleError(_0x4a0ac7,_0x3a89b6){_0x3a89b6=_0x3a89b6||0x1f4;return function(_0x50d61b){logger[_0x3421('0x32')](_0x50d61b[_0x3421('0x33')]);if(_0x50d61b[_0x3421('0x34')]){delete _0x50d61b[_0x3421('0x34')];}_0x4a0ac7[_0x3421('0x23')](_0x3a89b6)[_0x3421('0x35')](_0x50d61b);};}exports[_0x3421('0x36')]=function(_0x37151d,_0x94559a){var _0x220f14={},_0x4e44b4={},_0x556557={'count':0x0,'rows':[]};var _0x1239d9=db[_0x3421('0x37')]['rawAttributes'];_0x4e44b4[_0x3421('0x38')]=_[_0x3421('0x39')](_0x1239d9);_0x4e44b4[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x37151d[_0x3421('0x3a')]);_0x4e44b4['filters']=_[_0x3421('0x3b')](_0x4e44b4[_0x3421('0x38')],_0x4e44b4[_0x3421('0x3a')]);_0x220f14['attributes']=_[_0x3421('0x3b')](_0x4e44b4['model'],qs[_0x3421('0x3c')](_0x37151d[_0x3421('0x3a')][_0x3421('0x3c')]));_0x220f14[_0x3421('0x3d')]=_0x220f14[_0x3421('0x3d')][_0x3421('0x3e')]?_0x220f14[_0x3421('0x3d')]:_0x4e44b4['model'];if(!_0x37151d['query']['hasOwnProperty'](_0x3421('0x3f'))){_0x220f14['limit']=qs['limit'](_0x37151d[_0x3421('0x3a')]['limit']);_0x220f14[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x37151d['query'][_0x3421('0x21')]);}_0x220f14[_0x3421('0x40')]=qs[_0x3421('0x41')](_0x37151d[_0x3421('0x3a')]['sort']);_0x220f14[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x37151d[_0x3421('0x3a')],_0x4e44b4[_0x3421('0x43')]));if(_0x37151d['query'][_0x3421('0x2c')]){_0x220f14[_0x3421('0x42')]=_['merge'](_0x220f14[_0x3421('0x42')],{'$or':_['map'](_0x1239d9,function(_0x4da2f5){if(_0x4da2f5['type'][_0x3421('0x45')]!==_0x3421('0x46')){var _0x41bdb7={};_0x41bdb7[_0x4da2f5[_0x3421('0x47')]]={'$like':'%'+_0x37151d[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x41bdb7;}})});}_0x220f14=_[_0x3421('0x48')]({},_0x220f14,_0x37151d[_0x3421('0x49')]);var _0x33198f={'where':_0x220f14[_0x3421('0x42')]};return db[_0x3421('0x37')][_0x3421('0x20')](_0x33198f)[_0x3421('0x28')](function(_0x3d016d){_0x556557['count']=_0x3d016d;if(_0x37151d[_0x3421('0x3a')][_0x3421('0x4a')]){_0x220f14[_0x3421('0x4b')]=[{'all':!![]}];}return db[_0x3421('0x37')]['findAll'](_0x220f14);})[_0x3421('0x28')](function(_0x4da769){_0x556557[_0x3421('0x4c')]=_0x4da769;return _0x556557;})[_0x3421('0x28')](respondWithFilteredResult(_0x94559a,_0x220f14))[_0x3421('0x4d')](handleError(_0x94559a,null));};exports[_0x3421('0x4e')]=function(_0x2f9a84,_0x60fb09){var _0x435ba7={'raw':![],'where':{'id':_0x2f9a84[_0x3421('0x4f')]['id']}},_0x305951={};_0x305951[_0x3421('0x38')]=_[_0x3421('0x39')](db[_0x3421('0x37')][_0x3421('0x50')]);_0x305951['query']=_[_0x3421('0x39')](_0x2f9a84['query']);_0x305951[_0x3421('0x43')]=_[_0x3421('0x3b')](_0x305951[_0x3421('0x38')],_0x305951[_0x3421('0x3a')]);_0x435ba7[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x305951[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x2f9a84[_0x3421('0x3a')][_0x3421('0x3c')]));_0x435ba7['attributes']=_0x435ba7[_0x3421('0x3d')][_0x3421('0x3e')]?_0x435ba7[_0x3421('0x3d')]:_0x305951['model'];if(_0x2f9a84['query'][_0x3421('0x4a')]){_0x435ba7[_0x3421('0x4b')]=[{'all':!![]}];}_0x435ba7=_[_0x3421('0x48')]({},_0x435ba7,_0x2f9a84['options']);return db[_0x3421('0x37')][_0x3421('0x51')](_0x435ba7)[_0x3421('0x28')](handleEntityNotFound(_0x60fb09,null))[_0x3421('0x28')](respondWithResult(_0x60fb09,null))['catch'](handleError(_0x60fb09,null));};exports[_0x3421('0x52')]=function(_0x1bcf74,_0x3f7ff3){return db['VoiceQueue']['create'](_0x1bcf74['body'],{})[_0x3421('0x28')](function(_0x1021f8){var _0x5a9ccf=_0x1bcf74['user'][_0x3421('0x29')]({'plain':!![]});if(!_0x5a9ccf)throw new Error(_0x3421('0x53'));if(_0x5a9ccf[_0x3421('0x54')]===_0x3421('0x55')){var _0x127835=_0x1021f8['get']({'plain':!![]});var _0x27d284=[{'name':_0x3421('0x56'),'value':_0x3421('0x2a')},{'name':_0x3421('0x57'),'value':'outbound'}];var _0x1d243f=_[_0x3421('0x51')](_0x27d284,[_0x3421('0x2f'),_0x127835['type']])[_0x3421('0x34')];return db['UserProfileSection']['find']({'where':{'name':_0x1d243f,'userProfileId':_0x5a9ccf[_0x3421('0x58')]},'raw':!![]})['then'](function(_0x4e33a0){if(_0x4e33a0&&_0x4e33a0[_0x3421('0x59')]===0x0){return db[_0x3421('0x31')]['create']({'name':_0x127835[_0x3421('0x34')],'resourceId':_0x127835['id'],'type':_0x4e33a0[_0x3421('0x34')],'sectionId':_0x4e33a0['id']},{})[_0x3421('0x28')](function(){return _0x1021f8;});}else{return _0x1021f8;}})[_0x3421('0x4d')](function(_0x1c73b9){logger[_0x3421('0x32')](_0x3421('0x5a'),_0x1c73b9);throw _0x1c73b9;});}return _0x1021f8;})[_0x3421('0x28')](respondWithResult(_0x3f7ff3,0xc9))[_0x3421('0x4d')](handleError(_0x3f7ff3,null));};exports['clone']=function(_0x1e4add,_0x23ddd5){var _0x5bef38={'raw':![],'where':{'id':_0x1e4add[_0x3421('0x4f')]['id']}},_0x3950fa={};_0x3950fa[_0x3421('0x38')]=_['keys'](db[_0x3421('0x37')][_0x3421('0x50')]);_0x5bef38[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x3950fa[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x1e4add[_0x3421('0x3a')][_0x3421('0x3c')]));_0x5bef38[_0x3421('0x3d')]=_0x5bef38[_0x3421('0x3d')][_0x3421('0x3e')]?_0x5bef38[_0x3421('0x3d')]:_0x3950fa[_0x3421('0x38')];if(_0x1e4add[_0x3421('0x3a')][_0x3421('0x4a')]){_0x5bef38['include']=[{'all':!![]}];}_0x5bef38=_[_0x3421('0x48')]({},_0x5bef38,_0x1e4add[_0x3421('0x49')]);return db[_0x3421('0x37')][_0x3421('0x51')](_0x5bef38)[_0x3421('0x28')](handleEntityNotFound(_0x23ddd5,null))[_0x3421('0x28')](function(_0x32c9a7){if(_0x32c9a7){var _0x374a6a=_0x32c9a7['get']({'plain':!![]});_0x374a6a=qs[_0x3421('0x5b')](_0x374a6a,['id','createdAt',_0x3421('0x5c')]);_0x1e4add[_0x3421('0x5d')]=_[_0x3421('0x5b')](_0x1e4add[_0x3421('0x5d')],['id','createdAt',_0x3421('0x5c')]);return db[_0x3421('0x37')][_0x3421('0x52')](_[_0x3421('0x48')](_0x374a6a,_0x1e4add[_0x3421('0x5d')]),{'include':_0x1e4add[_0x3421('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x3421('0x28')](function(_0x1d23f1){var _0x1e9971=_0x1e4add[_0x3421('0x55')][_0x3421('0x29')]({'plain':!![]});if(!_0x1e9971)throw new Error(_0x3421('0x53'));if(_0x1e9971[_0x3421('0x54')]===_0x3421('0x55')){var _0x4edb4e=_0x1d23f1[_0x3421('0x29')]({'plain':!![]});var _0x46717b=[{'name':_0x3421('0x56'),'value':_0x3421('0x2a')},{'name':_0x3421('0x57'),'value':'outbound'}];var _0x5763c1=_[_0x3421('0x51')](_0x46717b,[_0x3421('0x2f'),_0x4edb4e[_0x3421('0x30')]])['name'];return db[_0x3421('0x5e')]['find']({'where':{'name':_0x5763c1,'userProfileId':_0x1e9971[_0x3421('0x58')]},'raw':!![]})['then'](function(_0x4f23c5){if(_0x4f23c5&&_0x4f23c5['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4edb4e[_0x3421('0x34')],'resourceId':_0x4edb4e['id'],'type':_0x4f23c5[_0x3421('0x34')],'sectionId':_0x4f23c5['id']},{})[_0x3421('0x28')](function(){return _0x1d23f1;});}else{return _0x1d23f1;}})[_0x3421('0x4d')](function(_0xa05828){logger[_0x3421('0x32')](_0x3421('0x5a'),_0xa05828);throw _0xa05828;});}return _0x1d23f1;});}})[_0x3421('0x28')](respondWithResult(_0x23ddd5,0xc9))[_0x3421('0x4d')](handleError(_0x23ddd5,null));};exports[_0x3421('0x27')]=function(_0x5c7a78,_0x297184){if(_0x5c7a78['body']['id']){delete _0x5c7a78[_0x3421('0x5d')]['id'];}return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x5c7a78[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x297184,null))[_0x3421('0x28')](saveUpdates(_0x5c7a78[_0x3421('0x5d')],null))[_0x3421('0x28')](respondWithResult(_0x297184,null))[_0x3421('0x4d')](handleError(_0x297184,null));};exports['destroy']=function(_0x2fe3b7,_0x14516b){return db[_0x3421('0x37')]['find']({'where':{'id':_0x2fe3b7['params']['id']}})['then'](handleEntityNotFound(_0x14516b,null))['then'](removeEntity(_0x14516b,null))[_0x3421('0x4d')](handleError(_0x14516b,null));};exports['getHoppers']=function(_0x2b3837,_0x8aee05,_0x2a6a3b){var _0x10d3f9={'raw':![],'where':{}};var _0x47e504={};var _0x1e64c2={'count':0x0,'rows':[]};return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0x2b3837[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x8aee05,null))[_0x3421('0x28')](function(_0x5011ec){if(_0x5011ec){_0x47e504[_0x3421('0x38')]=_[_0x3421('0x39')](db[_0x3421('0x60')][_0x3421('0x50')]);_0x47e504[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x2b3837[_0x3421('0x3a')]);_0x47e504['filters']=_['intersection'](_0x47e504[_0x3421('0x38')],_0x47e504[_0x3421('0x3a')]);_0x10d3f9[_0x3421('0x3d')]=_['intersection'](_0x47e504[_0x3421('0x38')],qs['fields'](_0x2b3837[_0x3421('0x3a')]['fields']));_0x10d3f9[_0x3421('0x3d')]=_0x10d3f9[_0x3421('0x3d')][_0x3421('0x3e')]?_0x10d3f9[_0x3421('0x3d')]:_0x47e504[_0x3421('0x38')];if(!_0x2b3837[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x10d3f9[_0x3421('0x22')]=qs[_0x3421('0x22')](_0x2b3837[_0x3421('0x3a')][_0x3421('0x22')]);_0x10d3f9['offset']=qs[_0x3421('0x21')](_0x2b3837[_0x3421('0x3a')][_0x3421('0x21')]);}_0x10d3f9[_0x3421('0x40')]=qs[_0x3421('0x41')](_0x2b3837[_0x3421('0x3a')][_0x3421('0x41')]);_0x10d3f9[_0x3421('0x42')]=qs['filters'](_[_0x3421('0x44')](_0x2b3837['query'],_0x47e504['filters']));_0x10d3f9['where'][_0x3421('0x62')]=_0x5011ec['id'];if(_0x2b3837[_0x3421('0x3a')][_0x3421('0x2c')]){_0x10d3f9[_0x3421('0x42')]=_['merge'](_0x10d3f9[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x10d3f9[_0x3421('0x3d')],function(_0x1e2abf){var _0x22d82c={};_0x22d82c[_0x1e2abf]={'$like':'%'+_0x2b3837[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x22d82c;})});}_0x10d3f9=_[_0x3421('0x48')]({},_0x10d3f9,_0x2b3837[_0x3421('0x49')]);return db[_0x3421('0x60')][_0x3421('0x20')]({'where':_0x10d3f9[_0x3421('0x42')]})[_0x3421('0x28')](function(_0x170340){_0x1e64c2[_0x3421('0x20')]=_0x170340;if(_0x2b3837[_0x3421('0x3a')][_0x3421('0x4a')]){_0x10d3f9['include']=[{'all':!![]}];}return db['CmHopper'][_0x3421('0x63')](_0x10d3f9);})['then'](function(_0x16b93b){_0x1e64c2[_0x3421('0x4c')]=_0x16b93b;return _0x1e64c2;});}})['then'](respondWithFilteredResult(_0x8aee05,_0x10d3f9))[_0x3421('0x4d')](handleError(_0x8aee05,null));};exports[_0x3421('0x64')]=function(_0x3b9bbe,_0x87404,_0x718eb6){var _0x46042a={'raw':!![],'where':{}};var _0x31a08c={};var _0x9d0656={'count':0x0,'rows':[]};return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0x3b9bbe[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x87404,null))[_0x3421('0x28')](function(_0x4fcc52){if(_0x4fcc52){_0x31a08c[_0x3421('0x38')]=_['keys'](db[_0x3421('0x65')][_0x3421('0x50')]);_0x31a08c['query']=_[_0x3421('0x39')](_0x3b9bbe['query']);_0x31a08c['filters']=_[_0x3421('0x3b')](_0x31a08c[_0x3421('0x38')],_0x31a08c[_0x3421('0x3a')]);_0x46042a['attributes']=_[_0x3421('0x3b')](_0x31a08c[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x3b9bbe['query']['fields']));_0x46042a[_0x3421('0x3d')]=_0x46042a[_0x3421('0x3d')][_0x3421('0x3e')]?_0x46042a[_0x3421('0x3d')]:_0x31a08c['model'];if(!_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x46042a[_0x3421('0x22')]=qs[_0x3421('0x22')](_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x22')]);_0x46042a[_0x3421('0x21')]=qs['offset'](_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x21')]);}_0x46042a['order']=qs['sort'](_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x41')]);_0x46042a[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x3b9bbe['query'],_0x31a08c['filters']));_0x46042a[_0x3421('0x42')]['VoiceQueueId']=_0x4fcc52['id'];if(_0x3b9bbe['query'][_0x3421('0x2c')]){_0x46042a[_0x3421('0x42')]=_[_0x3421('0x48')](_0x46042a[_0x3421('0x42')],{'$or':_['map'](_0x46042a['attributes'],function(_0x335331){var _0x5a922d={};_0x5a922d[_0x335331]={'$like':'%'+_0x3b9bbe['query'][_0x3421('0x2c')]+'%'};return _0x5a922d;})});}_0x46042a=_[_0x3421('0x48')]({},_0x46042a,_0x3b9bbe[_0x3421('0x49')]);return db['CmHopperHistory']['count']({'where':_0x46042a['where']})[_0x3421('0x28')](function(_0x1fad28){_0x9d0656[_0x3421('0x20')]=_0x1fad28;if(_0x3b9bbe[_0x3421('0x3a')][_0x3421('0x4a')]){_0x46042a[_0x3421('0x4b')]=[{'all':!![]}];}return db[_0x3421('0x65')]['findAll'](_0x46042a);})[_0x3421('0x28')](function(_0x210490){_0x9d0656[_0x3421('0x4c')]=_0x210490;return _0x9d0656;});}})[_0x3421('0x28')](respondWithFilteredResult(_0x87404,_0x46042a))[_0x3421('0x4d')](handleError(_0x87404,null));};exports[_0x3421('0x66')]=function(_0x381a66,_0x298985,_0x276656){var _0x5f54b8={'raw':!![],'where':{}};var _0x524ea3={};var _0x171d32={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3421('0x5f')]({'where':{'id':_0x381a66['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x298985,null))[_0x3421('0x28')](function(_0x1decdf){if(_0x1decdf){_0x524ea3[_0x3421('0x38')]=_[_0x3421('0x39')](db['CmHopperFinal']['rawAttributes']);_0x524ea3[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x381a66[_0x3421('0x3a')]);_0x524ea3[_0x3421('0x43')]=_['intersection'](_0x524ea3[_0x3421('0x38')],_0x524ea3[_0x3421('0x3a')]);_0x5f54b8[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x524ea3[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x381a66[_0x3421('0x3a')]['fields']));_0x5f54b8[_0x3421('0x3d')]=_0x5f54b8[_0x3421('0x3d')]['length']?_0x5f54b8[_0x3421('0x3d')]:_0x524ea3[_0x3421('0x38')];if(!_0x381a66[_0x3421('0x3a')]['hasOwnProperty'](_0x3421('0x3f'))){_0x5f54b8[_0x3421('0x22')]=qs['limit'](_0x381a66[_0x3421('0x3a')][_0x3421('0x22')]);_0x5f54b8[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x381a66[_0x3421('0x3a')][_0x3421('0x21')]);}_0x5f54b8[_0x3421('0x40')]=qs[_0x3421('0x41')](_0x381a66['query'][_0x3421('0x41')]);_0x5f54b8['where']=qs['filters'](_[_0x3421('0x44')](_0x381a66[_0x3421('0x3a')],_0x524ea3[_0x3421('0x43')]));_0x5f54b8[_0x3421('0x42')]['VoiceQueueId']=_0x1decdf['id'];if(_0x381a66[_0x3421('0x3a')][_0x3421('0x2c')]){_0x5f54b8[_0x3421('0x42')]=_[_0x3421('0x48')](_0x5f54b8[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x5f54b8[_0x3421('0x3d')],function(_0x31814a){var _0x18c232={};_0x18c232[_0x31814a]={'$like':'%'+_0x381a66[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x18c232;})});}_0x5f54b8=_[_0x3421('0x48')]({},_0x5f54b8,_0x381a66[_0x3421('0x49')]);return db[_0x3421('0x67')][_0x3421('0x20')]({'where':_0x5f54b8[_0x3421('0x42')]})[_0x3421('0x28')](function(_0x34f980){_0x171d32[_0x3421('0x20')]=_0x34f980;if(_0x381a66[_0x3421('0x3a')][_0x3421('0x4a')]){_0x5f54b8['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x3421('0x63')](_0x5f54b8);})[_0x3421('0x28')](function(_0x1a7038){_0x171d32[_0x3421('0x4c')]=_0x1a7038;return _0x171d32;});}})['then'](respondWithFilteredResult(_0x298985,_0x5f54b8))[_0x3421('0x4d')](handleError(_0x298985,null));};exports[_0x3421('0x68')]=function(_0x594404,_0xadd73a,_0x2eb3f4){var _0x4ea7b2={'raw':!![],'where':{}};var _0x5cd2b7={};var _0x4693dd={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3421('0x5f')]({'where':{'id':_0x594404[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0xadd73a,null))[_0x3421('0x28')](function(_0x3c0134){if(_0x3c0134){_0x5cd2b7[_0x3421('0x38')]=_[_0x3421('0x39')](db['CmHopperBlack'][_0x3421('0x50')]);_0x5cd2b7['query']=_['keys'](_0x594404[_0x3421('0x3a')]);_0x5cd2b7[_0x3421('0x43')]=_['intersection'](_0x5cd2b7[_0x3421('0x38')],_0x5cd2b7['query']);_0x4ea7b2[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x5cd2b7[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x594404[_0x3421('0x3a')][_0x3421('0x3c')]));_0x4ea7b2[_0x3421('0x3d')]=_0x4ea7b2[_0x3421('0x3d')][_0x3421('0x3e')]?_0x4ea7b2[_0x3421('0x3d')]:_0x5cd2b7[_0x3421('0x38')];if(!_0x594404[_0x3421('0x3a')]['hasOwnProperty'](_0x3421('0x3f'))){_0x4ea7b2['limit']=qs['limit'](_0x594404[_0x3421('0x3a')][_0x3421('0x22')]);_0x4ea7b2[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x594404['query'][_0x3421('0x21')]);}_0x4ea7b2[_0x3421('0x40')]=qs['sort'](_0x594404[_0x3421('0x3a')]['sort']);_0x4ea7b2[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x594404['query'],_0x5cd2b7[_0x3421('0x43')]));_0x4ea7b2[_0x3421('0x42')][_0x3421('0x62')]=_0x3c0134['id'];if(_0x594404[_0x3421('0x3a')][_0x3421('0x2c')]){_0x4ea7b2[_0x3421('0x42')]=_[_0x3421('0x48')](_0x4ea7b2[_0x3421('0x42')],{'$or':_['map'](_0x4ea7b2[_0x3421('0x3d')],function(_0x37f415){var _0x3c96bd={};_0x3c96bd[_0x37f415]={'$like':'%'+_0x594404[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x3c96bd;})});}_0x4ea7b2=_[_0x3421('0x48')]({},_0x4ea7b2,_0x594404[_0x3421('0x49')]);return db['CmHopperBlack'][_0x3421('0x20')]({'where':_0x4ea7b2[_0x3421('0x42')]})['then'](function(_0x52b089){_0x4693dd['count']=_0x52b089;if(_0x594404[_0x3421('0x3a')][_0x3421('0x4a')]){_0x4ea7b2['include']=[{'all':!![]}];}return db[_0x3421('0x69')][_0x3421('0x63')](_0x4ea7b2);})[_0x3421('0x28')](function(_0x2b596b){_0x4693dd[_0x3421('0x4c')]=_0x2b596b;return _0x4693dd;});}})[_0x3421('0x28')](respondWithFilteredResult(_0xadd73a,_0x4ea7b2))[_0x3421('0x4d')](handleError(_0xadd73a,null));};exports['getTeams']=function(_0x224e26,_0x11a0b4,_0x3ce37c){var _0x1e2a67={};var _0x26379d={};var _0x21513f;var _0x5d7002;return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0x224e26['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x11a0b4,null))[_0x3421('0x28')](function(_0x25cc13){if(_0x25cc13){_0x21513f=_0x25cc13;_0x26379d[_0x3421('0x38')]=_[_0x3421('0x39')](db[_0x3421('0x6a')][_0x3421('0x50')]);_0x26379d[_0x3421('0x3a')]=_[_0x3421('0x39')](_0x224e26[_0x3421('0x3a')]);_0x26379d['filters']=_[_0x3421('0x3b')](_0x26379d[_0x3421('0x38')],_0x26379d['query']);_0x1e2a67[_0x3421('0x3d')]=_['intersection'](_0x26379d[_0x3421('0x38')],qs['fields'](_0x224e26['query'][_0x3421('0x3c')]));_0x1e2a67[_0x3421('0x3d')]=_0x1e2a67[_0x3421('0x3d')]['length']?_0x1e2a67[_0x3421('0x3d')]:_0x26379d[_0x3421('0x38')];_0x1e2a67[_0x3421('0x40')]=qs['sort'](_0x224e26[_0x3421('0x3a')][_0x3421('0x41')]);_0x1e2a67['where']=qs['filters'](_[_0x3421('0x44')](_0x224e26[_0x3421('0x3a')],_0x26379d[_0x3421('0x43')]));if(_0x224e26[_0x3421('0x3a')][_0x3421('0x2c')]){_0x1e2a67[_0x3421('0x42')]=_['merge'](_0x1e2a67['where'],{'$or':_['map'](_0x1e2a67[_0x3421('0x3d')],function(_0x1b638d){var _0x343110={};_0x343110[_0x1b638d]={'$like':'%'+_0x224e26[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x343110;})});}_0x1e2a67=_['merge']({},_0x1e2a67,_0x224e26[_0x3421('0x49')]);return _0x21513f[_0x3421('0x6b')](_0x1e2a67);}})[_0x3421('0x28')](function(_0x46c15e){if(_0x46c15e){_0x5d7002=_0x46c15e[_0x3421('0x3e')];if(!_0x224e26['query'][_0x3421('0x61')]('nolimit')){_0x1e2a67[_0x3421('0x22')]=qs['limit'](_0x224e26[_0x3421('0x3a')][_0x3421('0x22')]);_0x1e2a67[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x224e26[_0x3421('0x3a')][_0x3421('0x21')]);}return _0x21513f[_0x3421('0x6b')](_0x1e2a67);}})[_0x3421('0x28')](function(_0x4a05a6){if(_0x4a05a6){return _0x4a05a6?{'count':_0x5d7002,'rows':_0x4a05a6}:null;}})[_0x3421('0x28')](respondWithResult(_0x11a0b4,null))['catch'](handleError(_0x11a0b4,null));};exports[_0x3421('0x6c')]=function(_0x31ec58,_0xc5bafd,_0x40d067){var _0x45128a=_0x31ec58['body'][_0x3421('0x6d')];return db[_0x3421('0x6a')]['findAll']({'where':{'id':_['map'](_0x45128a,'id')},'attributes':['id'],'include':[{'model':db[_0x3421('0x6e')],'as':_0x3421('0x6f'),'attributes':['id','name','online',_0x3421('0x70'),'interface'],'raw':!![]}]})[_0x3421('0x28')](function(_0x22c132){if(_0x22c132){var _0x5486c5=_['flatMap'](_0x22c132,function(_0x11e6ae){var _0x183b7e=_0x11e6ae[_0x3421('0x29')]({'plain':!![]});_0x183b7e[_0x3421('0x6f')][_0x3421('0x71')](function(_0xf81bb2){_0xf81bb2[_0x3421('0x72')]=_[_0x3421('0x51')](_0x45128a,{'id':_0x183b7e['id']})['penalty'];});return _0x183b7e[_0x3421('0x6f')];});return db['VoiceQueue'][_0x3421('0x51')]({'where':{'id':_0x31ec58[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](function(_0x2a6cee){return db[_0x3421('0x73')][_0x3421('0x74')](function(_0x858e81){return _0x2a6cee[_0x3421('0x6c')](_[_0x3421('0x2e')](_0x45128a,'id'),{'transaction':_0x858e81})[_0x3421('0x28')](function(){return BPromise[_0x3421('0x75')](_0x5486c5,function(_0x32d757){return db[_0x3421('0x76')][_0x3421('0x77')]({'where':{'UserId':_0x32d757['id'],'VoiceQueueId':_0x31ec58['params']['id']},'defaults':{'penalty':_0x32d757[_0x3421('0x72')]},'transaction':_0x858e81});});})['then'](function(){return BPromise[_0x3421('0x75')](_['filter'](_0x5486c5,{'online':!![]}),function(_0x553f40){return db[_0x3421('0x78')][_0x3421('0x79')]({'membername':_0x553f40[_0x3421('0x34')],'UserId':_0x553f40['id'],'queue_name':_0x2a6cee['name'],'VoiceQueueId':_0x2a6cee['id'],'interface':_[_0x3421('0x7a')](_0x553f40[_0x3421('0x7b')])?util[_0x3421('0x7c')](_0x3421('0x7d'),_0x553f40[_0x3421('0x34')]):_0x553f40[_0x3421('0x7b')],'paused':_0x553f40[_0x3421('0x70')]||![],'penalty':_0x553f40['penalty']},{'transaction':_0x858e81});});})['then'](function(){_0x5486c5['forEach'](function(_0x145b46){socket[_0x3421('0x7e')](_0x3421('0x7f'),{'UserId':_0x145b46['id'],'VoiceQueueId':_0x2a6cee['id']});});});});});}})[_0x3421('0x28')](respondWithStatusCode(_0xc5bafd,null))[_0x3421('0x4d')](handleError(_0xc5bafd,null));};exports[_0x3421('0x80')]=function(_0x3779dd,_0x2096b3,_0x747105){return db[_0x3421('0x6a')][_0x3421('0x63')]({'where':{'id':_0x3779dd[_0x3421('0x3a')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3421('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2096b3,null))[_0x3421('0x28')](function(_0x353e96){var _0x4b1799=_[_0x3421('0x2e')](_0x353e96,'id');var _0x5a6f2f=[];var _0x550726=[];var _0x1e7cb3=squel[_0x3421('0x81')]();_0x1e7cb3[_0x3421('0x47')](_0x3421('0x82'))[_0x3421('0x83')](_0x3421('0x84'),'tq')[_0x3421('0x85')](_0x3421('0x86'),'ut',_0x3421('0x87'))[_0x3421('0x42')](_0x3421('0x88'),_0x3779dd[_0x3421('0x4f')]['id']);for(var _0x43bd50=0x0;_0x43bd50<_0x353e96['length'];_0x43bd50+=0x1){let _0x1cfb31=_0x353e96[_0x43bd50];for(var _0x4ee6bf=0x0;_0x4ee6bf<_0x1cfb31[_0x3421('0x6f')][_0x3421('0x3e')];_0x4ee6bf+=0x1){let _0x2321e1=_0x1cfb31[_0x3421('0x6f')][_0x4ee6bf];var _0x447164=_0x1e7cb3[_0x3421('0x89')]();_0x447164[_0x3421('0x42')]('ut.UserId\x20=\x20?',_0x2321e1['id']);_0x550726['push'](db[_0x3421('0x73')][_0x3421('0x3a')](_0x447164[_0x3421('0x8a')](),{'type':db['sequelize'][_0x3421('0x8b')][_0x3421('0x8c')]})['then'](function(_0x2b47b7){if(_0x2b47b7[_0x3421('0x3e')]===0x1){return _0x2321e1['id'];}else{var _0x3ccc23=_['every'](_[_0x3421('0x2e')](_0x2b47b7,_0x3421('0x8d')),function(_0x153b87){return _['includes'](_0x4b1799,_0x153b87);});if(_0x3ccc23){return _0x2321e1['id'];}}}));}}return BPromise[_0x3421('0x8e')](_0x550726)[_0x3421('0x28')](function(_0x11a5d9){_0x5a6f2f=_(_0x5a6f2f)['union'](_0x11a5d9)[_0x3421('0x8f')]()['value']();return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x3779dd[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](function(_0x5a00b9){return db[_0x3421('0x73')][_0x3421('0x74')](function(_0x514806){return _0x5a00b9[_0x3421('0x80')](_0x3779dd['query'][_0x3421('0x90')],{'transaction':_0x514806})[_0x3421('0x28')](function(){if(!_[_0x3421('0x91')](_0x5a6f2f)){return _0x5a00b9[_0x3421('0x92')](_0x5a6f2f,{'transaction':_0x514806})[_0x3421('0x28')](function(){return db['UserVoiceQueueRt'][_0x3421('0x93')]({'where':{'VoiceQueueId':_0x3779dd[_0x3421('0x4f')]['id'],'UserId':_0x5a6f2f},'transaction':_0x514806});});}})[_0x3421('0x28')](function(){_0x5a6f2f[_0x3421('0x71')](function(_0x211072){socket[_0x3421('0x7e')](_0x3421('0x94'),{'UserId':_0x211072,'VoiceQueueId':_0x5a00b9['id']});});});});});});})[_0x3421('0x28')](respondWithStatusCode(_0x2096b3,null))[_0x3421('0x4d')](handleError(_0x2096b3,null));};exports[_0x3421('0x95')]=function(_0x11f562,_0x1a5ed4,_0xac9646){var _0x33bca8,_0x406702;return db[_0x3421('0x37')]['find']({'where':{'id':_0x11f562[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x1a5ed4,null))[_0x3421('0x28')](function(_0x24e579){if(_0x24e579){_0x406702=_0x24e579;return _0x24e579['addAgents'](_0x11f562['body'][_0x3421('0x90')],_[_0x3421('0x5b')](_0x11f562[_0x3421('0x5d')],[_0x3421('0x90'),'id'])||{})['spread'](function(_0x181fd7){for(var _0x4772d8=0x0;_0x4772d8<_0x11f562['body'][_0x3421('0x90')][_0x3421('0x3e')];_0x4772d8+=0x1){socket[_0x3421('0x7e')](_0x3421('0x7f'),{'UserId':_0x11f562[_0x3421('0x5d')][_0x3421('0x90')][_0x4772d8],'VoiceQueueId':_0x11f562[_0x3421('0x4f')]['id']});}return _0x181fd7;});}})[_0x3421('0x28')](function(_0x44937a){_0x33bca8=_0x44937a||[];if(_0x406702){return db[_0x3421('0x6e')][_0x3421('0x63')]({'where':{'id':_0x11f562[_0x3421('0x5d')]['ids']},'attributes':['id',_0x3421('0x34'),_0x3421('0x96'),'voicePause',_0x3421('0x7b')],'raw':!![]});}})[_0x3421('0x28')](function(_0x3b51b0){if(!_[_0x3421('0x91')](_0x3b51b0)){var _0x961efd=[];for(var _0x35bd62=0x0;_0x35bd62<_0x3b51b0[_0x3421('0x3e')];_0x35bd62++){if(_0x3b51b0[_0x35bd62][_0x3421('0x96')]){_0x961efd[_0x3421('0x97')](db['UserVoiceQueueRt'][_0x3421('0x79')]({'membername':_0x3b51b0[_0x35bd62][_0x3421('0x34')],'UserId':_0x3b51b0[_0x35bd62]['id'],'queue_name':_0x406702[_0x3421('0x34')],'VoiceQueueId':_0x406702['id'],'interface':_[_0x3421('0x7a')](_0x3b51b0[_0x35bd62][_0x3421('0x7b')])?util[_0x3421('0x7c')](_0x3421('0x7d'),_0x3b51b0[_0x35bd62][_0x3421('0x34')]):_0x3b51b0[_0x35bd62][_0x3421('0x7b')],'paused':_0x3b51b0[_0x35bd62][_0x3421('0x70')]||![],'penalty':_0x11f562[_0x3421('0x5d')]['penalty']||0x0}));}}return BPromise['all'](_0x961efd);}})[_0x3421('0x28')](function(){return _0x33bca8;})[_0x3421('0x28')](respondWithResult(_0x1a5ed4,null))[_0x3421('0x4d')](handleError(_0x1a5ed4,null));};exports[_0x3421('0x92')]=function(_0x35daa1,_0x48416a,_0x9b98b8){return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x35daa1[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x48416a,null))['then'](function(_0x7091ba){if(_0x7091ba){return _0x7091ba[_0x3421('0x92')](_0x35daa1[_0x3421('0x3a')]['ids'])[_0x3421('0x28')](function(){if(_['isArray'](_0x35daa1[_0x3421('0x3a')][_0x3421('0x90')])){for(var _0x1f1230=0x0;_0x1f1230<_0x35daa1[_0x3421('0x3a')]['ids'][_0x3421('0x3e')];_0x1f1230+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x35daa1[_0x3421('0x3a')][_0x3421('0x90')][_0x1f1230]),'VoiceQueueId':Number(_0x35daa1[_0x3421('0x4f')]['id'])});}}else{socket['emit'](_0x3421('0x94'),{'UserId':Number(_0x35daa1[_0x3421('0x3a')][_0x3421('0x90')]),'VoiceQueueId':Number(_0x35daa1['params']['id'])});}});}})[_0x3421('0x28')](function(_0x45606b){return db[_0x3421('0x78')][_0x3421('0x93')]({'where':{'VoiceQueueId':_0x35daa1[_0x3421('0x4f')]['id'],'UserId':_0x35daa1[_0x3421('0x3a')]['ids']}})[_0x3421('0x28')](function(){return _0x45606b;});})[_0x3421('0x28')](respondWithStatusCode(_0x48416a,null))[_0x3421('0x4d')](handleError(_0x48416a,null));};exports[_0x3421('0x98')]=function(_0xe4e968,_0x2fbf37,_0xf2da27){var _0x54f2eb={};var _0x5cdd55={};var _0x101d62;var _0x723738;return db[_0x3421('0x37')]['findOne']({'where':{'id':_0xe4e968[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x2fbf37,null))[_0x3421('0x28')](function(_0x225990){if(_0x225990){_0x101d62=_0x225990;_0x5cdd55['model']=_[_0x3421('0x39')](db[_0x3421('0x6e')][_0x3421('0x50')]);_0x5cdd55[_0x3421('0x3a')]=_['keys'](_0xe4e968[_0x3421('0x3a')]);_0x5cdd55[_0x3421('0x43')]=_['intersection'](_0x5cdd55[_0x3421('0x38')],_0x5cdd55['query']);_0x54f2eb['attributes']=_[_0x3421('0x3b')](_0x5cdd55[_0x3421('0x38')],qs['fields'](_0xe4e968[_0x3421('0x3a')]['fields']));_0x54f2eb[_0x3421('0x3d')]=_0x54f2eb['attributes'][_0x3421('0x3e')]?_0x54f2eb['attributes']:_0x5cdd55[_0x3421('0x38')];_0x54f2eb[_0x3421('0x40')]=qs[_0x3421('0x41')](_0xe4e968[_0x3421('0x3a')][_0x3421('0x41')]);_0x54f2eb[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0xe4e968['query'],_0x5cdd55[_0x3421('0x43')]));if(_0xe4e968['query'][_0x3421('0x2c')]){_0x54f2eb[_0x3421('0x42')]=_[_0x3421('0x48')](_0x54f2eb[_0x3421('0x42')],{'$or':_['map'](_0x54f2eb[_0x3421('0x3d')],function(_0x4c1b9a){var _0x43c4aa={};_0x43c4aa[_0x4c1b9a]={'$like':'%'+_0xe4e968[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x43c4aa;})});}_0x54f2eb=_[_0x3421('0x48')]({},_0x54f2eb,_0xe4e968[_0x3421('0x49')]);return _0x101d62['getAgents'](_0x54f2eb);}})[_0x3421('0x28')](function(_0x3e6886){if(_0x3e6886){_0x723738=_0x3e6886[_0x3421('0x3e')];if(!_0xe4e968['query'][_0x3421('0x61')](_0x3421('0x3f'))){_0x54f2eb['limit']=qs[_0x3421('0x22')](_0xe4e968['query'][_0x3421('0x22')]);_0x54f2eb[_0x3421('0x21')]=qs[_0x3421('0x21')](_0xe4e968[_0x3421('0x3a')]['offset']);}return _0x101d62[_0x3421('0x98')](_0x54f2eb);}})['then'](function(_0xc098c7){if(_0xc098c7){return _0xc098c7?{'count':_0x723738,'rows':_0xc098c7}:null;}})[_0x3421('0x28')](respondWithResult(_0x2fbf37,null))[_0x3421('0x4d')](handleError(_0x2fbf37,null));};exports[_0x3421('0x99')]=function(_0xbc4725,_0xb40b25,_0x291a77){var _0x31b107={};var _0x1ed3f9={};var _0x85386a;var _0x4f3236;return db['VoiceQueue']['findOne']({'where':{'id':_0xbc4725[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0xb40b25,null))['then'](function(_0x4c4d9c){if(_0x4c4d9c){_0x85386a=_0x4c4d9c;_0x1ed3f9['model']=_[_0x3421('0x39')](db[_0x3421('0x78')][_0x3421('0x50')]);_0x1ed3f9['query']=_[_0x3421('0x39')](_0xbc4725['query']);_0x1ed3f9[_0x3421('0x43')]=_[_0x3421('0x3b')](_0x1ed3f9['model'],_0x1ed3f9['query']);_0x31b107[_0x3421('0x3d')]=_['intersection'](_0x1ed3f9[_0x3421('0x38')],qs[_0x3421('0x3c')](_0xbc4725[_0x3421('0x3a')][_0x3421('0x3c')]));_0x31b107[_0x3421('0x3d')]=_0x31b107['attributes']['length']?_0x31b107[_0x3421('0x3d')]:_0x1ed3f9['model'];_0x31b107['order']=qs[_0x3421('0x41')](_0xbc4725[_0x3421('0x3a')][_0x3421('0x41')]);_0x31b107[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0xbc4725[_0x3421('0x3a')],_0x1ed3f9[_0x3421('0x43')]));if(_0xbc4725['query'][_0x3421('0x2c')]){_0x31b107[_0x3421('0x42')]=_['merge'](_0x31b107[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x31b107[_0x3421('0x3d')],function(_0x2b819d){var _0x418906={};_0x418906[_0x2b819d]={'$like':'%'+_0xbc4725[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x418906;})});}_0x31b107=_[_0x3421('0x48')]({},_0x31b107,_0xbc4725['options']);return _0x85386a[_0x3421('0x99')](_0x31b107);}})[_0x3421('0x28')](function(_0x4701a0){if(_0x4701a0){_0x4f3236=_0x4701a0[_0x3421('0x3e')];if(!_0xbc4725[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x31b107[_0x3421('0x22')]=qs[_0x3421('0x22')](_0xbc4725[_0x3421('0x3a')]['limit']);_0x31b107[_0x3421('0x21')]=qs[_0x3421('0x21')](_0xbc4725['query']['offset']);}return _0x85386a[_0x3421('0x99')](_0x31b107);}})[_0x3421('0x28')](function(_0x3d2ff1){return _0x3d2ff1?{'count':_0x4f3236,'rows':_0x3d2ff1}:null;})[_0x3421('0x28')](respondWithResult(_0xb40b25,null))[_0x3421('0x4d')](handleError(_0xb40b25,null));};exports[_0x3421('0x9a')]=function(_0x439d82,_0x4ff438,_0x3a3d37){var _0x28e11e={};var _0x9997c0={};var _0x5a09e1;var _0x591f4a;return db['VoiceQueue'][_0x3421('0x5f')]({'where':{'id':_0x439d82[_0x3421('0x4f')]['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x4ff438,null))[_0x3421('0x28')](function(_0x45f97b){if(_0x45f97b){_0x5a09e1=_0x45f97b;_0x9997c0['model']=_[_0x3421('0x39')](db[_0x3421('0x9b')][_0x3421('0x50')]);_0x9997c0[_0x3421('0x3a')]=_['keys'](_0x439d82[_0x3421('0x3a')]);_0x9997c0[_0x3421('0x43')]=_['intersection'](_0x9997c0[_0x3421('0x38')],_0x9997c0[_0x3421('0x3a')]);_0x28e11e['attributes']=_[_0x3421('0x3b')](_0x9997c0[_0x3421('0x38')],qs[_0x3421('0x3c')](_0x439d82[_0x3421('0x3a')][_0x3421('0x3c')]));_0x28e11e['attributes']=_0x28e11e['attributes'][_0x3421('0x3e')]?_0x28e11e[_0x3421('0x3d')]:_0x9997c0[_0x3421('0x38')];_0x28e11e[_0x3421('0x40')]=qs['sort'](_0x439d82['query'][_0x3421('0x41')]);_0x28e11e[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0x439d82[_0x3421('0x3a')],_0x9997c0['filters']));if(_0x439d82[_0x3421('0x3a')][_0x3421('0x2c')]){_0x28e11e[_0x3421('0x42')]=_[_0x3421('0x48')](_0x28e11e[_0x3421('0x42')],{'$or':_[_0x3421('0x2e')](_0x28e11e[_0x3421('0x3d')],function(_0x4276e0){var _0x363b79={};_0x363b79[_0x4276e0]={'$like':'%'+_0x439d82[_0x3421('0x3a')][_0x3421('0x2c')]+'%'};return _0x363b79;})});}_0x28e11e=_['merge']({},_0x28e11e,_0x439d82[_0x3421('0x49')]);return _0x5a09e1['getLists'](_0x28e11e);}})[_0x3421('0x28')](function(_0x39f60c){if(_0x39f60c){_0x591f4a=_0x39f60c[_0x3421('0x3e')];if(!_0x439d82[_0x3421('0x3a')][_0x3421('0x61')]('nolimit')){_0x28e11e[_0x3421('0x22')]=qs[_0x3421('0x22')](_0x439d82[_0x3421('0x3a')]['limit']);_0x28e11e[_0x3421('0x21')]=qs[_0x3421('0x21')](_0x439d82[_0x3421('0x3a')][_0x3421('0x21')]);}return _0x5a09e1['getLists'](_0x28e11e);}})[_0x3421('0x28')](function(_0x5a8ac2){if(_0x5a8ac2){return _0x5a8ac2?{'count':_0x591f4a,'rows':_0x5a8ac2}:null;}})['then'](respondWithResult(_0x4ff438,null))['catch'](handleError(_0x4ff438,null));};exports[_0x3421('0x9c')]=function(_0x210bd1,_0x3b70c7,_0x90106c){var _0x29ab38,_0x21a250;return db['VoiceQueue'][_0x3421('0x51')]({'where':{'id':_0x210bd1['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x3b70c7,null))[_0x3421('0x28')](function(_0x34eb81){if(_0x34eb81){_0x21a250=_0x34eb81;return _0x34eb81[_0x3421('0x9c')](_0x210bd1[_0x3421('0x5d')][_0x3421('0x90')],_['omit'](_0x210bd1[_0x3421('0x5d')],['ids','id'])||{});}return null;})[_0x3421('0x9d')](function(_0x3e0a2a){var _0x15fc97;_0x29ab38=_0x3e0a2a||[];var _0x4859d1=[];if(_0x3e0a2a){for(var _0x704898=0x0;_0x704898<_0x3e0a2a[_0x3421('0x3e')];_0x704898+=0x1){var _0x74d856=_0x3e0a2a[_0x704898][_0x3421('0x29')]({'plain':!![]});_0x21a250[_0x3421('0x9e')]=_0x210bd1[_0x3421('0x5d')][_0x3421('0x9e')]?_0x210bd1[_0x3421('0x5d')]['dialCheckDuplicateType']:_0x21a250[_0x3421('0x9e')];switch(_0x21a250[_0x3421('0x9e')]){case _0x3421('0x9f'):_0x15fc97=squel['insert']()[_0x3421('0xa0')](_0x3421('0xa1'))['fromQuery']([_0x3421('0xa2'),_0x3421('0xa3'),'ContactId',_0x3421('0xa4'),_0x3421('0x62'),_0x3421('0xa5'),_0x3421('0x5c')],squel[_0x3421('0x81')]()[_0x3421('0x47')](_0x3421('0xa2'),_0x3421('0xa2'))[_0x3421('0x47')](_0x3421('0xa6'),'scheduledAt')[_0x3421('0x47')]('id',_0x3421('0xa7'))[_0x3421('0x47')](_0x74d856['CmListId']['toString'](),_0x3421('0xa4'))[_0x3421('0x47')](_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),'VoiceQueueId')[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa5'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0x5c'))[_0x3421('0x83')](_0x3421('0xa8'))[_0x3421('0x42')](_0x3421('0xa9'))['where'](_0x3421('0xaa'),_0x74d856[_0x3421('0xab')][_0x3421('0x8a')]())[_0x3421('0x42')](_0x3421('0xac'))[_0x3421('0x42')](_0x3421('0xad'),squel[_0x3421('0x81')]()['field'](_0x3421('0xae'))[_0x3421('0x83')](_0x3421('0xaf'))[_0x3421('0x42')](_0x3421('0x88'),_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')]()))[_0x3421('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3421('0x81')]()['field'](_0x3421('0xb0'))[_0x3421('0x83')]('cm_hopper')[_0x3421('0x42')](_0x3421('0x88'),_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')]())))[_0x3421('0x8a')]();break;case _0x3421('0xb1'):_0x15fc97=squel[_0x3421('0xb2')]()['into'](_0x3421('0xa1'))[_0x3421('0xb3')]([_0x3421('0xa2'),_0x3421('0xa3'),_0x3421('0xa7'),_0x3421('0xa4'),'VoiceQueueId',_0x3421('0xa5'),_0x3421('0x5c')],squel['select']()[_0x3421('0x47')](_0x3421('0xa2'),_0x3421('0xa2'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa3'))[_0x3421('0x47')]('id',_0x3421('0xa7'))[_0x3421('0x47')](_0x74d856[_0x3421('0xab')][_0x3421('0x8a')](),_0x3421('0xa4'))['field'](_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),_0x3421('0x62'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa5'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0x5c'))['from']('cm_contacts')[_0x3421('0x42')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x74d856[_0x3421('0xab')]['toString']())[_0x3421('0x42')](_0x3421('0xac'))[_0x3421('0x42')](_0x3421('0xad'),squel['select']()[_0x3421('0x47')](_0x3421('0xb0'))[_0x3421('0x83')](_0x3421('0xa1'))[_0x3421('0x42')]('VoiceQueueId\x20=\x20?',_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')]())))['toString']();break;default:_0x15fc97=squel[_0x3421('0xb2')]()[_0x3421('0xa0')](_0x3421('0xa1'))[_0x3421('0xb3')]([_0x3421('0xa2'),_0x3421('0xa3'),'ContactId',_0x3421('0xa4'),_0x3421('0x62'),_0x3421('0xa5'),_0x3421('0x5c')],squel[_0x3421('0x81')]()[_0x3421('0x47')](_0x3421('0xa2'),_0x3421('0xa2'))[_0x3421('0x47')](_0x3421('0xa6'),_0x3421('0xa3'))[_0x3421('0x47')]('id',_0x3421('0xa7'))[_0x3421('0x47')](_0x74d856[_0x3421('0xab')][_0x3421('0x8a')](),_0x3421('0xa4'))[_0x3421('0x47')](_0x210bd1[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),_0x3421('0x62'))[_0x3421('0x47')]('NOW()',_0x3421('0xa5'))[_0x3421('0x47')](_0x3421('0xa6'),'updatedAt')[_0x3421('0x83')](_0x3421('0xa8'))[_0x3421('0x42')](_0x3421('0xa9'))[_0x3421('0x42')](_0x3421('0xaa'),_0x74d856[_0x3421('0xab')]['toString']())[_0x3421('0x42')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x4859d1[_0x3421('0x97')](db['sequelize']['query'](_0x15fc97));}return BPromise[_0x3421('0x8e')](_0x4859d1);}})[_0x3421('0x28')](function(){return _0x29ab38;})['then'](respondWithResult(_0x3b70c7,null))[_0x3421('0x4d')](handleError(_0x3b70c7,null));};exports[_0x3421('0xb4')]=function(_0x568356,_0x5f4b12,_0x1e5c94){return db[_0x3421('0x37')]['find']({'where':{'id':_0x568356['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x5f4b12,null))[_0x3421('0x28')](function(_0x4dcb14){if(_0x4dcb14){return _0x4dcb14[_0x3421('0xb4')](_0x568356['query'][_0x3421('0x90')]);}})[_0x3421('0x28')](function(_0x55716e){if(_0x55716e){return db[_0x3421('0x60')][_0x3421('0x93')]({'where':{'ListId':_0x568356['query']['ids'],'VoiceQueueId':_0x568356[_0x3421('0x4f')]['id']}})['then'](function(){return _0x55716e;});}})['then'](respondWithStatusCode(_0x5f4b12,null))[_0x3421('0x4d')](handleError(_0x5f4b12,null));};exports[_0x3421('0xb5')]=function(_0xd0440c,_0x12d791,_0x160660){var _0x14de59={};var _0x17a098={};var _0xc6ab5a;var _0x36cea3;return db[_0x3421('0x37')][_0x3421('0x5f')]({'where':{'id':_0xd0440c['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x12d791,null))[_0x3421('0x28')](function(_0x15d027){if(_0x15d027){_0xc6ab5a=_0x15d027;_0x17a098[_0x3421('0x38')]=_[_0x3421('0x39')](db['CmList'][_0x3421('0x50')]);_0x17a098['query']=_[_0x3421('0x39')](_0xd0440c[_0x3421('0x3a')]);_0x17a098['filters']=_[_0x3421('0x3b')](_0x17a098[_0x3421('0x38')],_0x17a098[_0x3421('0x3a')]);_0x14de59[_0x3421('0x3d')]=_[_0x3421('0x3b')](_0x17a098['model'],qs[_0x3421('0x3c')](_0xd0440c[_0x3421('0x3a')][_0x3421('0x3c')]));_0x14de59['attributes']=_0x14de59[_0x3421('0x3d')]['length']?_0x14de59[_0x3421('0x3d')]:_0x17a098['model'];_0x14de59['order']=qs[_0x3421('0x41')](_0xd0440c['query'][_0x3421('0x41')]);_0x14de59[_0x3421('0x42')]=qs[_0x3421('0x43')](_[_0x3421('0x44')](_0xd0440c['query'],_0x17a098['filters']));if(_0xd0440c['query'][_0x3421('0x2c')]){_0x14de59[_0x3421('0x42')]=_[_0x3421('0x48')](_0x14de59['where'],{'$or':_[_0x3421('0x2e')](_0x14de59[_0x3421('0x3d')],function(_0xad550b){var _0x34dde2={};_0x34dde2[_0xad550b]={'$like':'%'+_0xd0440c['query']['filter']+'%'};return _0x34dde2;})});}_0x14de59=_[_0x3421('0x48')]({},_0x14de59,_0xd0440c['options']);return _0xc6ab5a[_0x3421('0xb5')](_0x14de59);}})['then'](function(_0x4c6cf2){if(_0x4c6cf2){_0x36cea3=_0x4c6cf2[_0x3421('0x3e')];if(!_0xd0440c[_0x3421('0x3a')][_0x3421('0x61')](_0x3421('0x3f'))){_0x14de59[_0x3421('0x22')]=qs['limit'](_0xd0440c[_0x3421('0x3a')]['limit']);_0x14de59['offset']=qs[_0x3421('0x21')](_0xd0440c[_0x3421('0x3a')][_0x3421('0x21')]);}return _0xc6ab5a[_0x3421('0xb5')](_0x14de59);}})[_0x3421('0x28')](function(_0x867fb7){if(_0x867fb7){return _0x867fb7?{'count':_0x36cea3,'rows':_0x867fb7}:null;}})[_0x3421('0x28')](respondWithResult(_0x12d791,null))['catch'](handleError(_0x12d791,null));};exports[_0x3421('0xb6')]=function(_0x408ff7,_0x407e33,_0x424180){var _0x476c1d,_0x20144b;return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x408ff7['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x407e33,null))['then'](function(_0x530df4){if(_0x530df4){_0x20144b=_0x530df4;return _0x530df4[_0x3421('0xb6')](_0x408ff7[_0x3421('0x5d')][_0x3421('0x90')],_[_0x3421('0x5b')](_0x408ff7['body'],['ids','id'])||{});}return null;})[_0x3421('0x9d')](function(_0x1ab60d){var _0x548600;_0x476c1d=_0x1ab60d||[];var _0x435c48=[];if(_0x1ab60d){for(var _0x166464=0x0;_0x166464<_0x1ab60d[_0x3421('0x3e')];_0x166464+=0x1){var _0x3e7313=_0x1ab60d[_0x166464][_0x3421('0x29')]({'plain':!![]});_0x548600=squel[_0x3421('0xb2')]()[_0x3421('0xa0')]('cm_hopper_black')['fromQuery']([_0x3421('0xa2'),_0x3421('0xa7'),'ListId',_0x3421('0x62'),'createdAt','updatedAt'],squel['select']()[_0x3421('0x47')]('phone','phone')['field']('id',_0x3421('0xa7'))['field'](_0x3e7313['CmListId'][_0x3421('0x8a')](),_0x3421('0xa4'))[_0x3421('0x47')](_0x408ff7[_0x3421('0x4f')]['id'][_0x3421('0x8a')](),_0x3421('0x62'))[_0x3421('0x47')](_0x3421('0xa6'),'createdAt')['field'](_0x3421('0xa6'),_0x3421('0x5c'))[_0x3421('0x83')](_0x3421('0xa8'))[_0x3421('0x42')](_0x3421('0xa9'))[_0x3421('0x42')](_0x3421('0xaa'),_0x3e7313[_0x3421('0xab')][_0x3421('0x8a')]())[_0x3421('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0x3421('0x8a')]();_0x435c48[_0x3421('0x97')](db[_0x3421('0x73')][_0x3421('0x3a')](_0x548600));}return BPromise[_0x3421('0x8e')](_0x435c48);}})[_0x3421('0x28')](function(){return _0x476c1d;})['then'](respondWithResult(_0x407e33,null))[_0x3421('0x4d')](handleError(_0x407e33,null));};exports[_0x3421('0xb7')]=function(_0x3406e4,_0x230890,_0x2c85f0){return db[_0x3421('0x37')][_0x3421('0x51')]({'where':{'id':_0x3406e4['params']['id']}})[_0x3421('0x28')](handleEntityNotFound(_0x230890,null))[_0x3421('0x28')](function(_0xdc6baa){if(_0xdc6baa){return _0xdc6baa[_0x3421('0xb7')](_0x3406e4[_0x3421('0x3a')][_0x3421('0x90')]);}})[_0x3421('0x28')](function(_0x5e4498){if(_0x5e4498){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x3406e4[_0x3421('0x3a')]['ids'],'VoiceQueueId':_0x3406e4['params']['id']}})[_0x3421('0x28')](function(){return _0x5e4498;});}})[_0x3421('0x28')](respondWithStatusCode(_0x230890,null))[_0x3421('0x4d')](handleError(_0x230890,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index eea529e..ecdaf19 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 _0x68ef=['exports','events','VoiceQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x3a0978,_0x405ece){var _0x4996b2=function(_0x362130){while(--_0x362130){_0x3a0978['push'](_0x3a0978['shift']());}};_0x4996b2(++_0x405ece);}(_0x68ef,0x196));var _0xf68e=function(_0x2ac203,_0x31a508){_0x2ac203=_0x2ac203-0x0;var _0x446705=_0x68ef[_0x2ac203];return _0x446705;};'use strict';var EventEmitter=require(_0xf68e('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xf68e('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf68e('0x2')](0x0);var events={'afterCreate':_0xf68e('0x3'),'afterUpdate':'update','afterDestroy':_0xf68e('0x4')};function emitEvent(_0x352711){return function(_0x44d760,_0x434b80,_0x10dda3){VoiceQueueEvents[_0xf68e('0x5')](_0x352711+':'+_0x44d760['id'],_0x44d760);VoiceQueueEvents[_0xf68e('0x5')](_0x352711,_0x44d760);_0x10dda3(null);};}for(var e in events){if(events[_0xf68e('0x6')](e)){var event=events[e];VoiceQueue[_0xf68e('0x7')](e,emitEvent(event));}}module[_0xf68e('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0xbaa9=['events','VoiceQueue','update','remove','emit','hook','exports'];(function(_0x283e73,_0x463465){var _0x218a15=function(_0x1ba107){while(--_0x1ba107){_0x283e73['push'](_0x283e73['shift']());}};_0x218a15(++_0x463465);}(_0xbaa9,0x188));var _0x9baa=function(_0x298da7,_0x4b6114){_0x298da7=_0x298da7-0x0;var _0x1cc5dc=_0xbaa9[_0x298da7];return _0x1cc5dc;};'use strict';var EventEmitter=require(_0x9baa('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x9baa('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9baa('0x2'),'afterDestroy':_0x9baa('0x3')};function emitEvent(_0x3b8019){return function(_0xcc6496,_0x1c16be,_0x10543a){VoiceQueueEvents['emit'](_0x3b8019+':'+_0xcc6496['id'],_0xcc6496);VoiceQueueEvents[_0x9baa('0x4')](_0x3b8019,_0xcc6496);_0x10543a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x9baa('0x5')](e,emitEvent(event));}}module[_0x9baa('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 7217be5..8a8efbc 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 _0x13f6=['request-promise','rimraf','../../config/environment','./voiceQueue.attributes','lodash','util','moment','bluebird'];(function(_0x17532d,_0x420e1a){var _0x327c4c=function(_0x633419){while(--_0x633419){_0x17532d['push'](_0x17532d['shift']());}};_0x327c4c(++_0x420e1a);}(_0x13f6,0x124));var _0x613f=function(_0x1c0e39,_0x31d188){_0x1c0e39=_0x1c0e39-0x0;var _0x3d0554=_0x13f6[_0x1c0e39];return _0x3d0554;};'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']('VoiceQueue',attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13f6=['request-promise','rimraf','../../config/environment','./voiceQueue.attributes','lodash','util','moment','bluebird'];(function(_0x743f56,_0x5335a1){var _0x51a115=function(_0x4f2ca7){while(--_0x4f2ca7){_0x743f56['push'](_0x743f56['shift']());}};_0x51a115(++_0x5335a1);}(_0x13f6,0x124));var _0x613f=function(_0x4c2ceb,_0x3788ce){_0x4c2ceb=_0x4c2ceb-0x0;var _0x227fd1=_0x13f6[_0x4c2ceb];return _0x227fd1;};'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']('VoiceQueue',attributes,{'tableName':'voice_queues','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 8050e57..34fd763 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 _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x3d9da4,_0x412d21){var _0x3e1f73=function(_0x26925d){while(--_0x26925d){_0x3d9da4['push'](_0x3d9da4['shift']());}};_0x3e1f73(++_0x412d21);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file +var _0xa9e0=['register','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowVoiceQueue','VoiceQueue','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter'];(function(_0x305e9c,_0x154e63){var _0x5c6454=function(_0x534247){while(--_0x534247){_0x305e9c['push'](_0x305e9c['shift']());}};_0x5c6454(++_0x154e63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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});config[_0x0a9e('0xa')]=_[_0x0a9e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0a9e('0xd')](socket);function respondWithRpcPromise(_0xf81284,_0x307b3e,_0x3ab53f){return new BPromise(function(_0xfeb75b,_0xbd1168){return client['request'](_0xf81284,_0x3ab53f)['then'](function(_0x527cdd){logger['info'](_0x0a9e('0xe'),_0x307b3e,_0x0a9e('0xf'));logger[_0x0a9e('0x10')](_0x0a9e('0x11'),_0x307b3e,_0x0a9e('0xf'),JSON[_0x0a9e('0x12')](_0x527cdd));if(_0x527cdd['error']){if(_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x14')]===0x1f4){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x527cdd[_0x0a9e('0x13')][_0x0a9e('0x15')]);return _0xbd1168(_0x527cdd['error'][_0x0a9e('0x15')]);}logger['error'](_0x0a9e('0xe'),_0x307b3e,_0x527cdd['error'][_0x0a9e('0x15')]);return _0xfeb75b(_0x527cdd[_0x0a9e('0x13')]['message']);}else{logger[_0x0a9e('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x307b3e,_0x0a9e('0xf'));_0xfeb75b(_0x527cdd[_0x0a9e('0x17')][_0x0a9e('0x15')]);}})[_0x0a9e('0x18')](function(_0x31b1ca){logger[_0x0a9e('0x13')](_0x0a9e('0xe'),_0x307b3e,_0x31b1ca);_0xbd1168(_0x31b1ca);});});}exports[_0x0a9e('0x19')]=function(_0x1314ae){var _0x112016=this;return new Promise(function(_0x1c696a,_0x105080){return db['VoiceQueue'][_0x0a9e('0x1a')]({'raw':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae['options'][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1314ae['options']?_0x1314ae['options'][_0x0a9e('0x1d')]||null:null,'attributes':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'limit':_0x1314ae['options']?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x1f')]||null:null,'include':_0x1314ae[_0x0a9e('0x1b')]?_0x1314ae[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x1314ae[_0x0a9e('0x1b')]['include'],function(_0x59181e){return{'model':db[_0x59181e[_0x0a9e('0x22')]],'as':_0x59181e['as'],'attributes':_0x59181e[_0x0a9e('0x1e')],'include':_0x59181e[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x59181e['include'],function(_0x384319){return{'model':db[_0x384319['model']],'as':_0x384319['as'],'attributes':_0x384319[_0x0a9e('0x1e')],'include':_0x384319['include']?_[_0x0a9e('0x21')](_0x384319[_0x0a9e('0x20')],function(_0x25fba9){return{'model':db[_0x25fba9[_0x0a9e('0x22')]],'as':_0x25fba9['as'],'attributes':_0x25fba9[_0x0a9e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x11c3b6){logger[_0x0a9e('0x16')]('GetVoiceQueue',_0x1314ae);logger[_0x0a9e('0x10')](_0x0a9e('0x19'),_0x1314ae,JSON[_0x0a9e('0x12')](_0x11c3b6));_0x1c696a(_0x11c3b6);})[_0x0a9e('0x18')](function(_0x5c877d){logger[_0x0a9e('0x13')](_0x0a9e('0x19'),_0x5c877d[_0x0a9e('0x15')],_0x1314ae);_0x105080(_0x112016[_0x0a9e('0x13')](0x1f4,_0x5c877d[_0x0a9e('0x15')]));});});};exports[_0x0a9e('0x24')]=function(_0x296f41){var _0x2e8759=this;return new Promise(function(_0x1dbde2,_0x540530){return db[_0x0a9e('0x25')]['find']({'raw':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1c')]===undefined?!![]:![]:!![],'where':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')]['where']||null:null,'attributes':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x1e')]||null:null,'include':_0x296f41[_0x0a9e('0x1b')]?_0x296f41[_0x0a9e('0x1b')][_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x296f41[_0x0a9e('0x1b')]['include'],function(_0x44295a){return{'model':db[_0x44295a['model']],'as':_0x44295a['as'],'attributes':_0x44295a[_0x0a9e('0x1e')],'include':_0x44295a[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x44295a[_0x0a9e('0x20')],function(_0x567193){return{'model':db[_0x567193[_0x0a9e('0x22')]],'as':_0x567193['as'],'attributes':_0x567193[_0x0a9e('0x1e')],'include':_0x567193[_0x0a9e('0x20')]?_[_0x0a9e('0x21')](_0x567193['include'],function(_0x54135e){return{'model':db[_0x54135e[_0x0a9e('0x22')]],'as':_0x54135e['as'],'attributes':_0x54135e['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x3d9717){logger[_0x0a9e('0x16')](_0x0a9e('0x24'),_0x296f41);logger['debug'](_0x0a9e('0x24'),_0x296f41,JSON[_0x0a9e('0x12')](_0x3d9717));_0x1dbde2(_0x3d9717);})[_0x0a9e('0x18')](function(_0x533942){logger[_0x0a9e('0x13')](_0x0a9e('0x24'),_0x533942[_0x0a9e('0x15')],_0x296f41);_0x540530(_0x2e8759['error'](0x1f4,_0x533942['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index ed3b0dc..bb4a09f 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 _0x596f=['./voiceQueue.events','remove','removeListener','register','length','voiceQueue:'];(function(_0x51ac59,_0xbfff50){var _0x186f59=function(_0x310bd6){while(--_0x310bd6){_0x51ac59['push'](_0x51ac59['shift']());}};_0x186f59(++_0xbfff50);}(_0x596f,0x162));var _0xf596=function(_0x549d16,_0x4d069a){_0x549d16=_0x549d16-0x0;var _0x344ccc=_0x596f[_0x549d16];return _0x344ccc;};'use strict';var VoiceQueueEvents=require(_0xf596('0x0'));var events=['save',_0xf596('0x1'),'update'];function createListener(_0x51a231,_0x31a465){return function(_0x21a71d){_0x31a465['emit'](_0x51a231,_0x21a71d);};}function removeListener(_0x418ce7,_0x37ef8b){return function(){VoiceQueueEvents[_0xf596('0x2')](_0x418ce7,_0x37ef8b);};}exports[_0xf596('0x3')]=function(_0x59445e){for(var _0x2eadc3=0x0,_0x3cfeaa=events[_0xf596('0x4')];_0x2eadc3<_0x3cfeaa;_0x2eadc3++){var _0x3b8449=events[_0x2eadc3];var _0x55718c=createListener(_0xf596('0x5')+_0x3b8449,_0x59445e);VoiceQueueEvents['on'](_0x3b8449,_0x55718c);}}; \ No newline at end of file +var _0xa7ae=['update','emit','removeListener','voiceQueue:','./voiceQueue.events','remove'];(function(_0x21bb01,_0x4988f2){var _0x4a8035=function(_0x1a91f9){while(--_0x1a91f9){_0x21bb01['push'](_0x21bb01['shift']());}};_0x4a8035(++_0x4988f2);}(_0xa7ae,0x1a8));var _0xea7a=function(_0x2bb240,_0x22cf2c){_0x2bb240=_0x2bb240-0x0;var _0x2de128=_0xa7ae[_0x2bb240];return _0x2de128;};'use strict';var VoiceQueueEvents=require(_0xea7a('0x0'));var events=['save',_0xea7a('0x1'),_0xea7a('0x2')];function createListener(_0x1f1694,_0x67ebba){return function(_0x54eb9b){_0x67ebba[_0xea7a('0x3')](_0x1f1694,_0x54eb9b);};}function removeListener(_0x5a411e,_0x55e901){return function(){VoiceQueueEvents[_0xea7a('0x4')](_0x5a411e,_0x55e901);};}exports['register']=function(_0x142b8b){for(var _0x2d27c1=0x0,_0x3595ca=events['length'];_0x2d27c1<_0x3595ca;_0x2d27c1++){var _0x33d628=events[_0x2d27c1];var _0x2166cd=createListener(_0xea7a('0x5')+_0x33d628,_0x142b8b);VoiceQueueEvents['on'](_0x33d628,_0x2166cd);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index f4dfd2b..1fd576e 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 _0x0a4d=['post','put','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','/:id','show'];(function(_0x365c10,_0x1caa33){var _0x4476f7=function(_0x5294fa){while(--_0x5294fa){_0x365c10['push'](_0x365c10['shift']());}};_0x4476f7(++_0x1caa33);}(_0x0a4d,0xc2));var _0xd0a4=function(_0x35008f,_0xc49406){_0x35008f=_0x35008f-0x0;var _0x46fe10=_0x0a4d[_0x35008f];return _0x46fe10;};'use strict';var multer=require(_0xd0a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd0a4('0x1'));var express=require(_0xd0a4('0x2'));var router=express[_0xd0a4('0x3')]();var auth=require(_0xd0a4('0x4'));var interaction=require(_0xd0a4('0x5'));var config=require(_0xd0a4('0x6'));var controller=require('./voiceQueueReport.controller');router[_0xd0a4('0x7')]('/',auth[_0xd0a4('0x8')](),controller[_0xd0a4('0x9')]);router[_0xd0a4('0x7')](_0xd0a4('0xa'),auth[_0xd0a4('0x8')](),controller[_0xd0a4('0xb')]);router[_0xd0a4('0x7')](_0xd0a4('0xc'),auth['isAuthenticated'](),controller[_0xd0a4('0xd')]);router[_0xd0a4('0x7')](_0xd0a4('0xe'),auth[_0xd0a4('0x8')](),controller[_0xd0a4('0xf')]);router[_0xd0a4('0x10')]('/',auth[_0xd0a4('0x8')](),controller['create']);router[_0xd0a4('0x11')](_0xd0a4('0xe'),auth['isAuthenticated'](),controller[_0xd0a4('0x12')]);router[_0xd0a4('0x13')]('/:id',auth[_0xd0a4('0x8')](),controller[_0xd0a4('0x14')]);module['exports']=router; \ No newline at end of file +var _0x305e=['Router','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/index','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x305e,0x88));var _0xe305=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x305e[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xe305('0x0'));var util=require(_0xe305('0x1'));var path=require(_0xe305('0x2'));var timeout=require(_0xe305('0x3'));var express=require('express');var router=express[_0xe305('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe305('0x5'));var config=require(_0xe305('0x6'));var controller=require(_0xe305('0x7'));router[_0xe305('0x8')]('/',auth[_0xe305('0x9')](),controller['index']);router[_0xe305('0x8')](_0xe305('0xa'),auth[_0xe305('0x9')](),controller[_0xe305('0xb')]);router[_0xe305('0x8')](_0xe305('0xc'),auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0xe305('0x8')](_0xe305('0xd'),auth[_0xe305('0x9')](),controller[_0xe305('0xe')]);router[_0xe305('0xf')]('/',auth[_0xe305('0x9')](),controller[_0xe305('0x10')]);router['put'](_0xe305('0xd'),auth[_0xe305('0x9')](),controller[_0xe305('0x11')]);router[_0xe305('0x12')](_0xe305('0xd'),auth[_0xe305('0x9')](),controller[_0xe305('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 20cf060..3e67044 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 _0x2418=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE'];(function(_0x4fc4ff,_0xce32e3){var _0x1e9495=function(_0x333509){while(--_0x333509){_0x4fc4ff['push'](_0x4fc4ff['shift']());}};_0x1e9495(++_0xce32e3);}(_0x2418,0xb6));var _0x8241=function(_0x357397,_0x4713f4){_0x357397=_0x357397-0x0;var _0x27eeff=_0x2418[_0x357397];return _0x27eeff;};'use strict';var Sequelize=require(_0x8241('0x0'));var moment=require(_0x8241('0x1'));module[_0x8241('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8241('0x3')]},'calleridnum':{'type':Sequelize[_0x8241('0x3')]},'calleridname':{'type':Sequelize[_0x8241('0x3')]},'queue':{'type':Sequelize[_0x8241('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x8241('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x8241('0x4')],'set':function(_0x55385e){var _0xa04a08=moment(_0x55385e);var _0x3fd941=moment(this[_0x8241('0x5')](_0x8241('0x6')))[_0x8241('0x7')](_0x8241('0x8'));var _0x10ddeb=_0xa04a08[_0x8241('0x9')](_0x3fd941,_0x8241('0xa'));this['setDataValue'](_0x8241('0xb'),_0x55385e);this[_0x8241('0xc')](_0x8241('0xd'),_0x10ddeb||null);}},'position':{'type':Sequelize[_0x8241('0xe')]},'count':{'type':Sequelize[_0x8241('0xe')]},'queuecallerabandon':{'type':Sequelize[_0x8241('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x8241('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8241('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8241('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x8241('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x8241('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8241('0x3')]},'connectedlinename':{'type':Sequelize[_0x8241('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8241('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8241('0x3')]},'holdtime':{'type':Sequelize[_0x8241('0xe')]},'mohtime':{'type':Sequelize[_0x8241('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8241('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8241('0x3')]},'transfer':{'type':Sequelize[_0x8241('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8241('0x3')],'comment':_0x8241('0x10')},'transferexten':{'type':Sequelize[_0x8241('0x3')]},'transferuniqueid':{'type':Sequelize[_0x8241('0x3')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3d34=['getDataValue','queuecallerjoinAt','format','diff','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE'];(function(_0x266aa2,_0x1fa8ea){var _0x4a1209=function(_0x19d755){while(--_0x19d755){_0x266aa2['push'](_0x266aa2['shift']());}};_0x4a1209(++_0x1fa8ea);}(_0x3d34,0xdb));var _0x43d3=function(_0x23bf66,_0x2f57be){_0x23bf66=_0x23bf66-0x0;var _0xbf7653=_0x3d34[_0x23bf66];return _0xbf7653;};'use strict';var Sequelize=require(_0x43d3('0x0'));var moment=require(_0x43d3('0x1'));module[_0x43d3('0x2')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x43d3('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x43d3('0x3')]},'queue':{'type':Sequelize[_0x43d3('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x43d3('0x4')],'set':function(_0x39eb45){var _0x13e735=moment(_0x39eb45);var _0x2a1399=moment(this[_0x43d3('0x5')](_0x43d3('0x6')))[_0x43d3('0x7')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2ef6cc=_0x13e735[_0x43d3('0x8')](_0x2a1399,'seconds');this[_0x43d3('0x9')]('queuecallerleaveAt',_0x39eb45);this[_0x43d3('0x9')](_0x43d3('0xa'),_0x2ef6cc||null);}},'position':{'type':Sequelize[_0x43d3('0xb')]},'count':{'type':Sequelize[_0x43d3('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x43d3('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x43d3('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x43d3('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x43d3('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x43d3('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x43d3('0x3')],'comment':_0x43d3('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x43d3('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x43d3('0x3')]},'context':{'type':Sequelize[_0x43d3('0x3')]},'exten':{'type':Sequelize[_0x43d3('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x43d3('0xb')]},'mohtime':{'type':Sequelize[_0x43d3('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x43d3('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x43d3('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x43d3('0x3')]},'transferuniqueid':{'type':Sequelize[_0x43d3('0x3')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x43d3('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 6023614..e11d217 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 _0xf4eb=['length','hasOwnProperty','order','sort','filter','where','merge','map','type','field','count','includeAll','findAll','rows','catch','params','include','options','find','create','body','update','describe','getVoiceQueuesReport','nolimit','pick','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','./voiceQueueReport.socket','register','end','status','json','offset','limit','Content-Range','apply','reject','save','then','destroy','error','name','send','VoiceQueueReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4eb,0xec));var _0xbf4e=function(_0x540012,_0x4126e4){_0x540012=_0x540012-0x0;var _0x4db50d=_0xf4eb[_0x540012];return _0x4db50d;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var hardwareService=require(_0xbf4e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xbf4e('0x10'));var config=require('../../config/environment');var db=require(_0xbf4e('0x11'))['db'];config[_0xbf4e('0x12')]=_['defaults'](config[_0xbf4e('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbf4e('0x12')]));require(_0xbf4e('0x13'))[_0xbf4e('0x14')](socket);function respondWithStatusCode(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xcc;return function(_0x61bd54){if(_0x61bd54){return _0x302841['sendStatus'](_0x3b74bd);}return _0x302841['status'](_0x3b74bd)[_0xbf4e('0x15')]();};}function respondWithResult(_0x1735ae,_0x28fc6b){_0x28fc6b=_0x28fc6b||0xc8;return function(_0x542909){if(_0x542909){return _0x1735ae[_0xbf4e('0x16')](_0x28fc6b)[_0xbf4e('0x17')](_0x542909);}};}function respondWithFilteredResult(_0x912fc0,_0x320e7d){return function(_0x5a631e){if(_0x5a631e){var _0x247322=_0x5a631e['count'],_0x577c27=_0x320e7d[_0xbf4e('0x18')],_0x5db03f=_0x320e7d[_0xbf4e('0x18')]+_0x320e7d[_0xbf4e('0x19')],_0x566ec3;if(_0x5db03f>=_0x247322){_0x5db03f=_0x247322;_0x566ec3=0xc8;}else{_0x566ec3=0xce;}_0x912fc0['status'](_0x566ec3);return _0x912fc0['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x5db03f+'/'+_0x247322)[_0xbf4e('0x17')](_0x5a631e);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1b')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1c')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1d')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1e')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x1f')]()[_0xbf4e('0x1e')](function(){_0x51648c[_0xbf4e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90635e,_0x36688a){return function(_0x3d6863){if(!_0x3d6863){_0x90635e['sendStatus'](0x194);}return _0x3d6863;};}function handleError(_0x2fb490,_0x5e08b1){_0x5e08b1=_0x5e08b1||0x1f4;return function(_0x5bcf71){logger[_0xbf4e('0x20')](_0x5bcf71['stack']);if(_0x5bcf71[_0xbf4e('0x21')]){delete _0x5bcf71[_0xbf4e('0x21')];}_0x2fb490[_0xbf4e('0x16')](_0x5e08b1)[_0xbf4e('0x22')](_0x5bcf71);};}exports['index']=function(_0x2d4686,_0x8e0ab5){var _0x43879d={},_0x4cd4a1={},_0x681c3b={'count':0x0,'rows':[]};var _0x590c85=db[_0xbf4e('0x23')][_0xbf4e('0x24')];_0x4cd4a1[_0xbf4e('0x25')]=_['keys'](_0x590c85);_0x4cd4a1[_0xbf4e('0x26')]=_[_0xbf4e('0x27')](_0x2d4686[_0xbf4e('0x26')]);_0x4cd4a1[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x4cd4a1[_0xbf4e('0x25')],_0x4cd4a1['query']);_0x43879d[_0xbf4e('0x2a')]=_[_0xbf4e('0x29')](_0x4cd4a1['model'],qs[_0xbf4e('0x2b')](_0x2d4686[_0xbf4e('0x26')]['fields']));_0x43879d[_0xbf4e('0x2a')]=_0x43879d['attributes'][_0xbf4e('0x2c')]?_0x43879d['attributes']:_0x4cd4a1[_0xbf4e('0x25')];if(!_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x2d')]('nolimit')){_0x43879d[_0xbf4e('0x19')]=qs[_0xbf4e('0x19')](_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x19')]);_0x43879d[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x2d4686['query'][_0xbf4e('0x18')]);}_0x43879d[_0xbf4e('0x2e')]=qs[_0xbf4e('0x2f')](_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x2f')]);_0x43879d['where']=qs['filters'](_['pick'](_0x2d4686['query'],_0x4cd4a1[_0xbf4e('0x28')]));if(_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x30')]){_0x43879d[_0xbf4e('0x31')]=_[_0xbf4e('0x32')](_0x43879d[_0xbf4e('0x31')],{'$or':_[_0xbf4e('0x33')](_0x590c85,function(_0x467b74){if(_0x467b74[_0xbf4e('0x34')]['key']!=='VIRTUAL'){var _0x303fd8={};_0x303fd8[_0x467b74[_0xbf4e('0x35')]]={'$like':'%'+_0x2d4686[_0xbf4e('0x26')]['filter']+'%'};return _0x303fd8;}})});}_0x43879d=_[_0xbf4e('0x32')]({},_0x43879d,_0x2d4686['options']);var _0x370d90={'where':_0x43879d[_0xbf4e('0x31')]};return db[_0xbf4e('0x23')][_0xbf4e('0x36')](_0x370d90)['then'](function(_0x31d8dc){_0x681c3b[_0xbf4e('0x36')]=_0x31d8dc;if(_0x2d4686[_0xbf4e('0x26')][_0xbf4e('0x37')]){_0x43879d['include']=[{'all':!![]}];}return db[_0xbf4e('0x23')][_0xbf4e('0x38')](_0x43879d);})[_0xbf4e('0x1e')](function(_0x29fe9d){_0x681c3b[_0xbf4e('0x39')]=_0x29fe9d;return _0x681c3b;})[_0xbf4e('0x1e')](respondWithFilteredResult(_0x8e0ab5,_0x43879d))[_0xbf4e('0x3a')](handleError(_0x8e0ab5,null));};exports['show']=function(_0x176166,_0x7b3a94){var _0x518400={'raw':![],'where':{'id':_0x176166[_0xbf4e('0x3b')]['id']}},_0x47d6f2={};_0x47d6f2[_0xbf4e('0x25')]=_['keys'](db['VoiceQueueReport'][_0xbf4e('0x24')]);_0x47d6f2[_0xbf4e('0x26')]=_[_0xbf4e('0x27')](_0x176166[_0xbf4e('0x26')]);_0x47d6f2[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x47d6f2['model'],_0x47d6f2[_0xbf4e('0x26')]);_0x518400[_0xbf4e('0x2a')]=_['intersection'](_0x47d6f2['model'],qs['fields'](_0x176166['query'][_0xbf4e('0x2b')]));_0x518400['attributes']=_0x518400[_0xbf4e('0x2a')][_0xbf4e('0x2c')]?_0x518400['attributes']:_0x47d6f2['model'];if(_0x176166[_0xbf4e('0x26')][_0xbf4e('0x37')]){_0x518400[_0xbf4e('0x3c')]=[{'all':!![]}];}_0x518400=_[_0xbf4e('0x32')]({},_0x518400,_0x176166[_0xbf4e('0x3d')]);return db['VoiceQueueReport'][_0xbf4e('0x3e')](_0x518400)[_0xbf4e('0x1e')](handleEntityNotFound(_0x7b3a94,null))[_0xbf4e('0x1e')](respondWithResult(_0x7b3a94,null))[_0xbf4e('0x3a')](handleError(_0x7b3a94,null));};exports[_0xbf4e('0x3f')]=function(_0x1bc421,_0x4060c7){return db[_0xbf4e('0x23')]['create'](_0x1bc421[_0xbf4e('0x40')],{})[_0xbf4e('0x1e')](respondWithResult(_0x4060c7,0xc9))[_0xbf4e('0x3a')](handleError(_0x4060c7,null));};exports[_0xbf4e('0x41')]=function(_0x9bc1fe,_0x1198e8){if(_0x9bc1fe[_0xbf4e('0x40')]['id']){delete _0x9bc1fe[_0xbf4e('0x40')]['id'];}return db[_0xbf4e('0x23')][_0xbf4e('0x3e')]({'where':{'id':_0x9bc1fe[_0xbf4e('0x3b')]['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x1198e8,null))[_0xbf4e('0x1e')](saveUpdates(_0x9bc1fe[_0xbf4e('0x40')],null))[_0xbf4e('0x1e')](respondWithResult(_0x1198e8,null))[_0xbf4e('0x3a')](handleError(_0x1198e8,null));};exports[_0xbf4e('0x1f')]=function(_0x5492bf,_0x22d8ef){return db[_0xbf4e('0x23')][_0xbf4e('0x3e')]({'where':{'id':_0x5492bf['params']['id']}})[_0xbf4e('0x1e')](handleEntityNotFound(_0x22d8ef,null))['then'](removeEntity(_0x22d8ef,null))['catch'](handleError(_0x22d8ef,null));};exports[_0xbf4e('0x42')]=function(_0x200393,_0x4d32b3){return db[_0xbf4e('0x23')][_0xbf4e('0x42')]()[_0xbf4e('0x1e')](respondWithResult(_0x4d32b3,null))[_0xbf4e('0x3a')](handleError(_0x4d32b3,null));};exports[_0xbf4e('0x43')]=function(_0x2ac2c8,_0x419969){var _0x1cdd8c={},_0x3cd61b={},_0xc058e1={'count':0x0,'rows':[]};_0x3cd61b[_0xbf4e('0x25')]=_['keys'](db['VoiceQueueReport'][_0xbf4e('0x24')]);_0x3cd61b[_0xbf4e('0x26')]=_[_0xbf4e('0x27')](_0x2ac2c8['query']);_0x3cd61b[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x3cd61b['model'],_0x3cd61b['query']);_0x1cdd8c[_0xbf4e('0x2a')]=_['intersection'](_0x3cd61b['model'],qs[_0xbf4e('0x2b')](_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x2b')]));_0x1cdd8c[_0xbf4e('0x2a')]=_0x1cdd8c[_0xbf4e('0x2a')]['length']?_0x1cdd8c[_0xbf4e('0x2a')]:_0x3cd61b['model'];if(!_0x2ac2c8[_0xbf4e('0x26')]['hasOwnProperty'](_0xbf4e('0x44'))){_0x1cdd8c['limit']=qs[_0xbf4e('0x19')](_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x19')]);_0x1cdd8c[_0xbf4e('0x18')]=qs[_0xbf4e('0x18')](_0x2ac2c8['query']['offset']);}_0x1cdd8c['order']=qs['sort'](_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x2f')]);_0x1cdd8c['where']=qs[_0xbf4e('0x28')](_[_0xbf4e('0x45')](_0x2ac2c8[_0xbf4e('0x26')],_0x3cd61b[_0xbf4e('0x28')]));if(_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x30')]){_0x1cdd8c[_0xbf4e('0x31')]=_['merge'](_0x1cdd8c[_0xbf4e('0x31')],{'$or':_[_0xbf4e('0x33')](_0x1cdd8c[_0xbf4e('0x2a')],function(_0x5e548a){var _0x56338e={};_0x56338e[_0x5e548a]={'$like':'%'+_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x30')]+'%'};return _0x56338e;})});}_0x1cdd8c=_[_0xbf4e('0x32')]({},_0x1cdd8c,_0x2ac2c8['options']);var _0x432967={'where':_0x1cdd8c[_0xbf4e('0x31')]};return db[_0xbf4e('0x23')][_0xbf4e('0x36')](_0x432967)[_0xbf4e('0x1e')](function(_0x5532df){_0xc058e1[_0xbf4e('0x36')]=_0x5532df;if(_0x2ac2c8[_0xbf4e('0x26')][_0xbf4e('0x37')]){_0x1cdd8c[_0xbf4e('0x3c')]=[{'all':!![]}];}return db[_0xbf4e('0x23')][_0xbf4e('0x38')](_0x1cdd8c);})['then'](function(_0x21cbd2){_0xc058e1['rows']=_0x21cbd2;return _0xc058e1;})[_0xbf4e('0x1e')](respondWithFilteredResult(_0x419969,_0x1cdd8c,_0xbf4e('0x43')))[_0xbf4e('0x3a')](handleError(_0x419969,null,_0xbf4e('0x43')));}; \ No newline at end of file +var _0x0713=['keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','field','options','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','length','create','body','find','params','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','model'];(function(_0x42a290,_0x5c038e){var _0x23367b=function(_0x52bea3){while(--_0x52bea3){_0x42a290['push'](_0x42a290['shift']());}};_0x23367b(++_0x5c038e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var hardwareService=require(_0x3071('0x14'));var logger=require(_0x3071('0x15'))('api');var utils=require(_0x3071('0x16'));var config=require(_0x3071('0x17'));var db=require(_0x3071('0x18'))['db'];config[_0x3071('0x19')]=_[_0x3071('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3071('0x1b'))(new Redis(config['redis']));require(_0x3071('0x1c'))[_0x3071('0x1d')](socket);function respondWithStatusCode(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xcc;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1e')](_0x104e73);}return _0x5d4883[_0x3071('0x1f')](_0x104e73)[_0x3071('0x20')]();};}function respondWithResult(_0x1f14e1,_0x1caa5d){_0x1caa5d=_0x1caa5d||0xc8;return function(_0x2a6a4b){if(_0x2a6a4b){return _0x1f14e1[_0x3071('0x1f')](_0x1caa5d)[_0x3071('0x21')](_0x2a6a4b);}};}function respondWithFilteredResult(_0x21aad3,_0x344ea6){return function(_0x5f3c22){if(_0x5f3c22){var _0x224996=_0x5f3c22[_0x3071('0x22')],_0x17dbda=_0x344ea6[_0x3071('0x23')],_0x1068d9=_0x344ea6[_0x3071('0x23')]+_0x344ea6[_0x3071('0x24')],_0x108a83;if(_0x1068d9>=_0x224996){_0x1068d9=_0x224996;_0x108a83=0xc8;}else{_0x108a83=0xce;}_0x21aad3['status'](_0x108a83);return _0x21aad3[_0x3071('0x25')](_0x3071('0x26'),_0x17dbda+'-'+_0x1068d9+'/'+_0x224996)[_0x3071('0x21')](_0x5f3c22);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x27')](_0x833074);}return _0xb8f4e3[_0x3071('0x28')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x29')](_0x457b57)[_0x3071('0x2a')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x2b')]()[_0x3071('0x2a')](function(){_0x481a51[_0x3071('0x1f')](0xcc)[_0x3071('0x20')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x2c')]);if(_0x177138[_0x3071('0x2d')]){delete _0x177138[_0x3071('0x2d')];}_0x2e5f93[_0x3071('0x1f')](_0x3f1e6e)[_0x3071('0x2e')](_0x177138);};}exports[_0x3071('0x2f')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={},_0x292205={},_0x254fc8={'count':0x0,'rows':[]};var _0x5aba96=db['VoiceQueueReport'][_0x3071('0x30')];_0x292205[_0x3071('0x31')]=_[_0x3071('0x32')](_0x5aba96);_0x292205[_0x3071('0x33')]=_[_0x3071('0x32')](_0x177b5f[_0x3071('0x33')]);_0x292205[_0x3071('0x34')]=_[_0x3071('0x35')](_0x292205['model'],_0x292205['query']);_0x32f1b4['attributes']=_[_0x3071('0x35')](_0x292205[_0x3071('0x31')],qs['fields'](_0x177b5f[_0x3071('0x33')][_0x3071('0x36')]));_0x32f1b4[_0x3071('0x37')]=_0x32f1b4[_0x3071('0x37')]['length']?_0x32f1b4[_0x3071('0x37')]:_0x292205[_0x3071('0x31')];if(!_0x177b5f[_0x3071('0x33')][_0x3071('0x38')](_0x3071('0x39'))){_0x32f1b4[_0x3071('0x24')]=qs[_0x3071('0x24')](_0x177b5f[_0x3071('0x33')]['limit']);_0x32f1b4[_0x3071('0x23')]=qs['offset'](_0x177b5f['query'][_0x3071('0x23')]);}_0x32f1b4[_0x3071('0x3a')]=qs['sort'](_0x177b5f[_0x3071('0x33')][_0x3071('0x3b')]);_0x32f1b4[_0x3071('0x3c')]=qs[_0x3071('0x34')](_[_0x3071('0x3d')](_0x177b5f[_0x3071('0x33')],_0x292205['filters']));if(_0x177b5f[_0x3071('0x33')][_0x3071('0x3e')]){_0x32f1b4['where']=_[_0x3071('0x3f')](_0x32f1b4['where'],{'$or':_[_0x3071('0x40')](_0x5aba96,function(_0x43133a){if(_0x43133a['type']['key']!==_0x3071('0x41')){var _0x185f63={};_0x185f63[_0x43133a[_0x3071('0x42')]]={'$like':'%'+_0x177b5f['query'][_0x3071('0x3e')]+'%'};return _0x185f63;}})});}_0x32f1b4=_['merge']({},_0x32f1b4,_0x177b5f[_0x3071('0x43')]);var _0x4b7928={'where':_0x32f1b4[_0x3071('0x3c')]};return db[_0x3071('0x44')][_0x3071('0x22')](_0x4b7928)[_0x3071('0x2a')](function(_0x30ab68){_0x254fc8['count']=_0x30ab68;if(_0x177b5f['query'][_0x3071('0x45')]){_0x32f1b4[_0x3071('0x46')]=[{'all':!![]}];}return db[_0x3071('0x44')][_0x3071('0x47')](_0x32f1b4);})['then'](function(_0x3cfc05){_0x254fc8[_0x3071('0x48')]=_0x3cfc05;return _0x254fc8;})[_0x3071('0x2a')](respondWithFilteredResult(_0x3921a1,_0x32f1b4))[_0x3071('0x49')](handleError(_0x3921a1,null));};exports[_0x3071('0x4a')]=function(_0xb9a4b8,_0x56a9d8){var _0x35a50d={'raw':![],'where':{'id':_0xb9a4b8['params']['id']}},_0x596113={};_0x596113['model']=_['keys'](db[_0x3071('0x44')][_0x3071('0x30')]);_0x596113[_0x3071('0x33')]=_[_0x3071('0x32')](_0xb9a4b8[_0x3071('0x33')]);_0x596113[_0x3071('0x34')]=_[_0x3071('0x35')](_0x596113[_0x3071('0x31')],_0x596113['query']);_0x35a50d[_0x3071('0x37')]=_[_0x3071('0x35')](_0x596113[_0x3071('0x31')],qs[_0x3071('0x36')](_0xb9a4b8[_0x3071('0x33')]['fields']));_0x35a50d['attributes']=_0x35a50d[_0x3071('0x37')][_0x3071('0x4b')]?_0x35a50d[_0x3071('0x37')]:_0x596113[_0x3071('0x31')];if(_0xb9a4b8[_0x3071('0x33')]['includeAll']){_0x35a50d[_0x3071('0x46')]=[{'all':!![]}];}_0x35a50d=_['merge']({},_0x35a50d,_0xb9a4b8[_0x3071('0x43')]);return db['VoiceQueueReport']['find'](_0x35a50d)[_0x3071('0x2a')](handleEntityNotFound(_0x56a9d8,null))['then'](respondWithResult(_0x56a9d8,null))[_0x3071('0x49')](handleError(_0x56a9d8,null));};exports['create']=function(_0x717c43,_0x1d75e5){return db[_0x3071('0x44')][_0x3071('0x4c')](_0x717c43['body'],{})[_0x3071('0x2a')](respondWithResult(_0x1d75e5,0xc9))['catch'](handleError(_0x1d75e5,null));};exports[_0x3071('0x29')]=function(_0x4b6bbb,_0x46924d){if(_0x4b6bbb[_0x3071('0x4d')]['id']){delete _0x4b6bbb['body']['id'];}return db[_0x3071('0x44')][_0x3071('0x4e')]({'where':{'id':_0x4b6bbb[_0x3071('0x4f')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x46924d,null))[_0x3071('0x2a')](saveUpdates(_0x4b6bbb[_0x3071('0x4d')],null))[_0x3071('0x2a')](respondWithResult(_0x46924d,null))['catch'](handleError(_0x46924d,null));};exports[_0x3071('0x2b')]=function(_0x486b7a,_0x443b0e){return db[_0x3071('0x44')]['find']({'where':{'id':_0x486b7a[_0x3071('0x4f')]['id']}})[_0x3071('0x2a')](handleEntityNotFound(_0x443b0e,null))[_0x3071('0x2a')](removeEntity(_0x443b0e,null))[_0x3071('0x49')](handleError(_0x443b0e,null));};exports[_0x3071('0x50')]=function(_0x26c8e4,_0x3ab6d4){return db[_0x3071('0x44')][_0x3071('0x50')]()[_0x3071('0x2a')](respondWithResult(_0x3ab6d4,null))[_0x3071('0x49')](handleError(_0x3ab6d4,null));};exports[_0x3071('0x51')]=function(_0x24977b,_0x114f1f){var _0x1656de={},_0x12be97={},_0x596cdd={'count':0x0,'rows':[]};_0x12be97['model']=_[_0x3071('0x32')](db['VoiceQueueReport'][_0x3071('0x30')]);_0x12be97[_0x3071('0x33')]=_[_0x3071('0x32')](_0x24977b['query']);_0x12be97[_0x3071('0x34')]=_[_0x3071('0x35')](_0x12be97['model'],_0x12be97['query']);_0x1656de[_0x3071('0x37')]=_[_0x3071('0x35')](_0x12be97[_0x3071('0x31')],qs[_0x3071('0x36')](_0x24977b['query'][_0x3071('0x36')]));_0x1656de[_0x3071('0x37')]=_0x1656de[_0x3071('0x37')][_0x3071('0x4b')]?_0x1656de[_0x3071('0x37')]:_0x12be97['model'];if(!_0x24977b[_0x3071('0x33')][_0x3071('0x38')](_0x3071('0x39'))){_0x1656de[_0x3071('0x24')]=qs[_0x3071('0x24')](_0x24977b[_0x3071('0x33')][_0x3071('0x24')]);_0x1656de['offset']=qs['offset'](_0x24977b[_0x3071('0x33')]['offset']);}_0x1656de[_0x3071('0x3a')]=qs[_0x3071('0x3b')](_0x24977b['query'][_0x3071('0x3b')]);_0x1656de[_0x3071('0x3c')]=qs['filters'](_[_0x3071('0x3d')](_0x24977b[_0x3071('0x33')],_0x12be97[_0x3071('0x34')]));if(_0x24977b[_0x3071('0x33')][_0x3071('0x3e')]){_0x1656de['where']=_[_0x3071('0x3f')](_0x1656de[_0x3071('0x3c')],{'$or':_[_0x3071('0x40')](_0x1656de['attributes'],function(_0x1b0f81){var _0x238fa9={};_0x238fa9[_0x1b0f81]={'$like':'%'+_0x24977b[_0x3071('0x33')][_0x3071('0x3e')]+'%'};return _0x238fa9;})});}_0x1656de=_[_0x3071('0x3f')]({},_0x1656de,_0x24977b[_0x3071('0x43')]);var _0xe93f28={'where':_0x1656de[_0x3071('0x3c')]};return db[_0x3071('0x44')]['count'](_0xe93f28)[_0x3071('0x2a')](function(_0x29a58e){_0x596cdd[_0x3071('0x22')]=_0x29a58e;if(_0x24977b[_0x3071('0x33')][_0x3071('0x45')]){_0x1656de[_0x3071('0x46')]=[{'all':!![]}];}return db[_0x3071('0x44')][_0x3071('0x47')](_0x1656de);})[_0x3071('0x2a')](function(_0x302680){_0x596cdd[_0x3071('0x48')]=_0x302680;return _0x596cdd;})['then'](respondWithFilteredResult(_0x114f1f,_0x1656de,_0x3071('0x51')))[_0x3071('0x49')](handleError(_0x114f1f,null,_0x3071('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 9fa665c..1382ea8 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 _0xa13c=['VoiceQueueReport','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xa13c,0x1ec));var _0xca13=function(_0x27c820,_0xb29af5){_0x27c820=_0x27c820-0x0;var _0x56a9ad=_0xa13c[_0x27c820];return _0x56a9ad;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0xca13('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xca13('0x1')](0x0);var events={'afterCreate':_0xca13('0x2'),'afterUpdate':'update','afterDestroy':_0xca13('0x3')};function emitEvent(_0x491529){return function(_0xa0d048,_0x989dc0,_0x207696){VoiceQueueReportEvents[_0xca13('0x4')](_0x491529+':'+_0xa0d048['id'],_0xa0d048);VoiceQueueReportEvents['emit'](_0x491529,_0xa0d048);_0x207696(null);};}for(var e in events){if(events[_0xca13('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x8e24=['hasOwnProperty','hook','exports','setMaxListeners','save','update','remove','emit'];(function(_0x3c458b,_0x2b0243){var _0x4711ee=function(_0x2bb47d){while(--_0x2bb47d){_0x3c458b['push'](_0x3c458b['shift']());}};_0x4711ee(++_0x2b0243);}(_0x8e24,0x133));var _0x48e2=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x8e24[_0x3c2166];return _0x30ccc3;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x48e2('0x0')](0x0);var events={'afterCreate':_0x48e2('0x1'),'afterUpdate':_0x48e2('0x2'),'afterDestroy':_0x48e2('0x3')};function emitEvent(_0x2adc9e){return function(_0x57a06f,_0x136e2d,_0x4e3cca){VoiceQueueReportEvents[_0x48e2('0x4')](_0x2adc9e+':'+_0x57a06f['id'],_0x57a06f);VoiceQueueReportEvents[_0x48e2('0x4')](_0x2adc9e,_0x57a06f);_0x4e3cca(null);};}for(var e in events){if(events[_0x48e2('0x5')](e)){var event=events[e];VoiceQueueReport[_0x48e2('0x6')](e,emitEvent(event));}}module[_0x48e2('0x7')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 6e8d38d..c7eae5b 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 _0x83b1=['bluebird','rimraf','../../config/environment','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment'];(function(_0x17b785,_0x854545){var _0x5189c7=function(_0x4d7f0){while(--_0x4d7f0){_0x17b785['push'](_0x17b785['shift']());}};_0x5189c7(++_0x854545);}(_0x83b1,0xa5));var _0x183b=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x83b1[_0x46aff0];return _0x9d78cf;};'use strict';var _=require(_0x183b('0x0'));var util=require('util');var logger=require(_0x183b('0x1'))(_0x183b('0x2'));var moment=require(_0x183b('0x3'));var BPromise=require(_0x183b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x183b('0x5'));var config=require(_0x183b('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x183b('0x7')]=function(_0x21a589,_0x2a8abf){return _0x21a589[_0x183b('0x8')](_0x183b('0x9'),attributes,{'tableName':_0x183b('0xa'),'paranoid':![],'indexes':[{'fields':[_0x183b('0xb')]},{'fields':[_0x183b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc198=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','calleridnum','util'];(function(_0x196dc2,_0x237677){var _0x3307c4=function(_0x1e0ca3){while(--_0x1e0ca3){_0x196dc2['push'](_0x196dc2['shift']());}};_0x3307c4(++_0x237677);}(_0xc198,0x125));var _0x8c19=function(_0x344f44,_0x47b1de){_0x344f44=_0x344f44-0x0;var _0xad5654=_0xc198[_0x344f44];return _0xad5654;};'use strict';var _=require('lodash');var util=require(_0x8c19('0x0'));var logger=require(_0x8c19('0x1'))('api');var moment=require(_0x8c19('0x2'));var BPromise=require(_0x8c19('0x3'));var rp=require(_0x8c19('0x4'));var fs=require('fs');var path=require(_0x8c19('0x5'));var rimraf=require(_0x8c19('0x6'));var config=require(_0x8c19('0x7'));var attributes=require(_0x8c19('0x8'));module[_0x8c19('0x9')]=function(_0x4d2f60,_0x2330a8){return _0x4d2f60[_0x8c19('0xa')](_0x8c19('0xb'),attributes,{'tableName':_0x8c19('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x8c19('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 1ca6a64..4e8d7ad 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 _0xb82e=['map','model','debug','CreateVoiceQueueReport','VoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include'];(function(_0x16a5ab,_0xbea294){var _0x5c9f93=function(_0x6faec7){while(--_0x6faec7){_0x16a5ab['push'](_0x16a5ab['shift']());}};_0x5c9f93(++_0xbea294);}(_0xb82e,0x180));var _0xeb82=function(_0x22d35d,_0x322bb3){_0x22d35d=_0x22d35d-0x0;var _0x469558=_0xb82e[_0x22d35d];return _0x469558;};'use strict';var _=require(_0xeb82('0x0'));var util=require(_0xeb82('0x1'));var moment=require(_0xeb82('0x2'));var BPromise=require(_0xeb82('0x3'));var rs=require(_0xeb82('0x4'));var fs=require('fs');var Redis=require(_0xeb82('0x5'));var db=require(_0xeb82('0x6'))['db'];var utils=require(_0xeb82('0x7'));var logger=require(_0xeb82('0x8'))(_0xeb82('0x9'));var config=require(_0xeb82('0xa'));var jayson=require(_0xeb82('0xb'));var client=jayson['client'][_0xeb82('0xc')]({'port':0x232a});config[_0xeb82('0xd')]=_[_0xeb82('0xe')](config[_0xeb82('0xd')],{'host':_0xeb82('0xf'),'port':0x18eb});var socket=require(_0xeb82('0x10'))(new Redis(config[_0xeb82('0xd')]));require(_0xeb82('0x11'))[_0xeb82('0x12')](socket);function respondWithRpcPromise(_0x8d340f,_0x584fa0,_0x3811d9){return new BPromise(function(_0x237fa7,_0x5d19fa){return client[_0xeb82('0x13')](_0x8d340f,_0x3811d9)[_0xeb82('0x14')](function(_0x1dcb78){logger[_0xeb82('0x15')](_0xeb82('0x16'),_0x584fa0,'request\x20sent');logger['debug'](_0xeb82('0x17'),_0x584fa0,_0xeb82('0x18'),JSON[_0xeb82('0x19')](_0x1dcb78));if(_0x1dcb78[_0xeb82('0x1a')]){if(_0x1dcb78[_0xeb82('0x1a')][_0xeb82('0x1b')]===0x1f4){logger[_0xeb82('0x1a')](_0xeb82('0x16'),_0x584fa0,_0x1dcb78['error'][_0xeb82('0x1c')]);return _0x5d19fa(_0x1dcb78[_0xeb82('0x1a')][_0xeb82('0x1c')]);}logger['error'](_0xeb82('0x16'),_0x584fa0,_0x1dcb78[_0xeb82('0x1a')][_0xeb82('0x1c')]);return _0x237fa7(_0x1dcb78[_0xeb82('0x1a')]['message']);}else{logger[_0xeb82('0x15')](_0xeb82('0x16'),_0x584fa0,_0xeb82('0x18'));_0x237fa7(_0x1dcb78[_0xeb82('0x1d')][_0xeb82('0x1c')]);}})[_0xeb82('0x1e')](function(_0x3a407c){logger[_0xeb82('0x1a')](_0xeb82('0x16'),_0x584fa0,_0x3a407c);_0x5d19fa(_0x3a407c);});});}exports[_0xeb82('0x1f')]=function(_0x527775){var _0x29b865=this;return new Promise(function(_0x546868,_0x4bd64a){return db['VoiceQueueReport'][_0xeb82('0x20')]({'raw':_0x527775[_0xeb82('0x21')]?_0x527775['options'][_0xeb82('0x22')]===undefined?!![]:![]:!![],'where':_0x527775[_0xeb82('0x21')]?_0x527775[_0xeb82('0x21')][_0xeb82('0x23')]||null:null,'attributes':_0x527775[_0xeb82('0x21')]?_0x527775['options'][_0xeb82('0x24')]||null:null,'limit':_0x527775['options']?_0x527775[_0xeb82('0x21')][_0xeb82('0x25')]||null:null,'include':_0x527775[_0xeb82('0x21')]?_0x527775[_0xeb82('0x21')][_0xeb82('0x26')]?_[_0xeb82('0x27')](_0x527775['options']['include'],function(_0x1d0b76){return{'model':db[_0x1d0b76[_0xeb82('0x28')]],'as':_0x1d0b76['as'],'attributes':_0x1d0b76[_0xeb82('0x24')],'include':_0x1d0b76['include']?_[_0xeb82('0x27')](_0x1d0b76[_0xeb82('0x26')],function(_0x15e2fe){return{'model':db[_0x15e2fe['model']],'as':_0x15e2fe['as'],'attributes':_0x15e2fe[_0xeb82('0x24')],'include':_0x15e2fe['include']?_[_0xeb82('0x27')](_0x15e2fe[_0xeb82('0x26')],function(_0x28899b){return{'model':db[_0x28899b[_0xeb82('0x28')]],'as':_0x28899b['as'],'attributes':_0x28899b['attributes']};}):[]};}):[]};}):[]:[]})[_0xeb82('0x14')](function(_0x194ebb){logger[_0xeb82('0x15')](_0xeb82('0x1f'),_0x527775);logger[_0xeb82('0x29')](_0xeb82('0x1f'),_0x527775,JSON[_0xeb82('0x19')](_0x194ebb));_0x546868(_0x194ebb);})['catch'](function(_0x1f000e){logger[_0xeb82('0x1a')](_0xeb82('0x1f'),_0x1f000e['message'],_0x527775);_0x4bd64a(_0x29b865[_0xeb82('0x1a')](0x1f4,_0x1f000e[_0xeb82('0x1c')]));});});};exports[_0xeb82('0x2a')]=function(_0x1e208f){var _0x88526=this;return new Promise(function(_0x4fb1f9,_0x28dce4){return db[_0xeb82('0x2b')][_0xeb82('0x2c')](_0x1e208f[_0xeb82('0x2d')],{'raw':_0x1e208f[_0xeb82('0x21')]?_0x1e208f[_0xeb82('0x21')]['raw']===undefined?!![]:![]:!![]})[_0xeb82('0x14')](function(_0x5a2770){logger[_0xeb82('0x15')](_0xeb82('0x2a'),_0x1e208f);logger[_0xeb82('0x29')](_0xeb82('0x2a'),_0x1e208f,JSON[_0xeb82('0x19')](_0x5a2770));_0x4fb1f9(_0x5a2770);})[_0xeb82('0x1e')](function(_0x330856){logger[_0xeb82('0x1a')](_0xeb82('0x2a'),_0x330856[_0xeb82('0x1c')],_0x1e208f);_0x28dce4(_0x88526[_0xeb82('0x1a')](0x1f4,_0x330856[_0xeb82('0x1c')]));});});};exports[_0xeb82('0x2e')]=function(_0x6dbaeb){var _0x2435ff=this;return new Promise(function(_0x8bb039,_0x380e05){return db['VoiceQueueReport']['update'](_0x6dbaeb[_0xeb82('0x2d')],{'raw':_0x6dbaeb[_0xeb82('0x21')]?_0x6dbaeb[_0xeb82('0x21')][_0xeb82('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6dbaeb[_0xeb82('0x21')]?_0x6dbaeb[_0xeb82('0x21')][_0xeb82('0x23')]||null:null,'attributes':_0x6dbaeb['options']?_0x6dbaeb[_0xeb82('0x21')][_0xeb82('0x24')]||null:null,'limit':_0x6dbaeb[_0xeb82('0x21')]?_0x6dbaeb[_0xeb82('0x21')][_0xeb82('0x25')]||null:null})[_0xeb82('0x14')](function(_0x1b6cf0){logger[_0xeb82('0x15')](_0xeb82('0x2e'),_0x6dbaeb);logger[_0xeb82('0x29')](_0xeb82('0x2e'),_0x6dbaeb,JSON[_0xeb82('0x19')](_0x1b6cf0));_0x8bb039(_0x1b6cf0);})[_0xeb82('0x1e')](function(_0x41c2e3){logger[_0xeb82('0x1a')]('UpdateVoiceQueueReport',_0x41c2e3[_0xeb82('0x1c')],_0x6dbaeb);_0x380e05(_0x2435ff[_0xeb82('0x1a')](0x1f4,_0x41c2e3[_0xeb82('0x1c')]));});});}; \ No newline at end of file +var _0x8596=['catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','then','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','defaults','localhost','redis','register','request','info','request\x20sent','debug','stringify','code','message','error','VoiceQueueReport,\x20%s,\x20%s','result'];(function(_0x3d70dc,_0x2e7008){var _0x5d6828=function(_0x136f2f){while(--_0x136f2f){_0x3d70dc['push'](_0x3d70dc['shift']());}};_0x5d6828(++_0x2e7008);}(_0x8596,0x86));var _0x6859=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8596[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6859('0x0'));var util=require(_0x6859('0x1'));var moment=require('moment');var BPromise=require(_0x6859('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6859('0x3'));var db=require(_0x6859('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6859('0x5'))('rpc');var config=require(_0x6859('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6859('0x7')]['http']({'port':0x232a});config['redis']=_[_0x6859('0x8')](config['redis'],{'host':_0x6859('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6859('0xa')]));require('./voiceQueueReport.socket')[_0x6859('0xb')](socket);function respondWithRpcPromise(_0x14f8c7,_0x19ed66,_0x3e4500){return new BPromise(function(_0x16810c,_0x14b647){return client[_0x6859('0xc')](_0x14f8c7,_0x3e4500)['then'](function(_0x10827a){logger[_0x6859('0xd')]('VoiceQueueReport,\x20%s,\x20%s',_0x19ed66,_0x6859('0xe'));logger[_0x6859('0xf')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x19ed66,_0x6859('0xe'),JSON[_0x6859('0x10')](_0x10827a));if(_0x10827a['error']){if(_0x10827a['error'][_0x6859('0x11')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x19ed66,_0x10827a['error'][_0x6859('0x12')]);return _0x14b647(_0x10827a[_0x6859('0x13')][_0x6859('0x12')]);}logger['error'](_0x6859('0x14'),_0x19ed66,_0x10827a[_0x6859('0x13')][_0x6859('0x12')]);return _0x16810c(_0x10827a[_0x6859('0x13')][_0x6859('0x12')]);}else{logger['info'](_0x6859('0x14'),_0x19ed66,_0x6859('0xe'));_0x16810c(_0x10827a[_0x6859('0x15')][_0x6859('0x12')]);}})[_0x6859('0x16')](function(_0xe7f75e){logger[_0x6859('0x13')](_0x6859('0x14'),_0x19ed66,_0xe7f75e);_0x14b647(_0xe7f75e);});});}exports[_0x6859('0x17')]=function(_0x2dff6d){var _0x1172b4=this;return new Promise(function(_0xdf9200,_0xb18ec1){return db[_0x6859('0x18')][_0x6859('0x19')]({'raw':_0x2dff6d[_0x6859('0x1a')]?_0x2dff6d[_0x6859('0x1a')][_0x6859('0x1b')]===undefined?!![]:![]:!![],'where':_0x2dff6d['options']?_0x2dff6d[_0x6859('0x1a')][_0x6859('0x1c')]||null:null,'attributes':_0x2dff6d['options']?_0x2dff6d[_0x6859('0x1a')][_0x6859('0x1d')]||null:null,'limit':_0x2dff6d[_0x6859('0x1a')]?_0x2dff6d['options']['limit']||null:null,'include':_0x2dff6d[_0x6859('0x1a')]?_0x2dff6d['options'][_0x6859('0x1e')]?_[_0x6859('0x1f')](_0x2dff6d['options'][_0x6859('0x1e')],function(_0x28ace1){return{'model':db[_0x28ace1[_0x6859('0x20')]],'as':_0x28ace1['as'],'attributes':_0x28ace1[_0x6859('0x1d')],'include':_0x28ace1[_0x6859('0x1e')]?_['map'](_0x28ace1[_0x6859('0x1e')],function(_0x3b2425){return{'model':db[_0x3b2425[_0x6859('0x20')]],'as':_0x3b2425['as'],'attributes':_0x3b2425['attributes'],'include':_0x3b2425[_0x6859('0x1e')]?_[_0x6859('0x1f')](_0x3b2425[_0x6859('0x1e')],function(_0x27bb46){return{'model':db[_0x27bb46['model']],'as':_0x27bb46['as'],'attributes':_0x27bb46[_0x6859('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6859('0x21')](function(_0x475ee2){logger[_0x6859('0xd')](_0x6859('0x17'),_0x2dff6d);logger['debug'](_0x6859('0x17'),_0x2dff6d,JSON[_0x6859('0x10')](_0x475ee2));_0xdf9200(_0x475ee2);})['catch'](function(_0x1ed99f){logger['error'](_0x6859('0x17'),_0x1ed99f[_0x6859('0x12')],_0x2dff6d);_0xb18ec1(_0x1172b4[_0x6859('0x13')](0x1f4,_0x1ed99f[_0x6859('0x12')]));});});};exports['CreateVoiceQueueReport']=function(_0x1c158c){var _0x418413=this;return new Promise(function(_0x211bf3,_0x1d1374){return db[_0x6859('0x18')][_0x6859('0x22')](_0x1c158c[_0x6859('0x23')],{'raw':_0x1c158c[_0x6859('0x1a')]?_0x1c158c[_0x6859('0x1a')][_0x6859('0x1b')]===undefined?!![]:![]:!![]})[_0x6859('0x21')](function(_0x2d9a67){logger['info'](_0x6859('0x24'),_0x1c158c);logger['debug'](_0x6859('0x24'),_0x1c158c,JSON[_0x6859('0x10')](_0x2d9a67));_0x211bf3(_0x2d9a67);})[_0x6859('0x16')](function(_0x1a4b0c){logger[_0x6859('0x13')]('CreateVoiceQueueReport',_0x1a4b0c['message'],_0x1c158c);_0x1d1374(_0x418413[_0x6859('0x13')](0x1f4,_0x1a4b0c['message']));});});};exports[_0x6859('0x25')]=function(_0x4484d1){var _0x251e79=this;return new Promise(function(_0x574c40,_0x339657){return db[_0x6859('0x18')][_0x6859('0x26')](_0x4484d1[_0x6859('0x23')],{'raw':_0x4484d1[_0x6859('0x1a')]?_0x4484d1['options'][_0x6859('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4484d1['options']?_0x4484d1['options']['where']||null:null,'attributes':_0x4484d1[_0x6859('0x1a')]?_0x4484d1[_0x6859('0x1a')][_0x6859('0x1d')]||null:null,'limit':_0x4484d1[_0x6859('0x1a')]?_0x4484d1[_0x6859('0x1a')]['limit']||null:null})[_0x6859('0x21')](function(_0x4dd9c3){logger[_0x6859('0xd')](_0x6859('0x25'),_0x4484d1);logger[_0x6859('0xf')]('UpdateVoiceQueueReport',_0x4484d1,JSON[_0x6859('0x10')](_0x4dd9c3));_0x574c40(_0x4dd9c3);})[_0x6859('0x16')](function(_0x4e2ab4){logger[_0x6859('0x13')](_0x6859('0x25'),_0x4e2ab4[_0x6859('0x12')],_0x4484d1);_0x339657(_0x251e79[_0x6859('0x13')](0x1f4,_0x4e2ab4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index cf9be2c..41d1f2a 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 _0xb1ad=['voiceQueueReport:','./voiceQueueReport.events','emit','removeListener','length'];(function(_0x4f0a6d,_0x12ef94){var _0x5d79e2=function(_0x13fd1f){while(--_0x13fd1f){_0x4f0a6d['push'](_0x4f0a6d['shift']());}};_0x5d79e2(++_0x12ef94);}(_0xb1ad,0xc4));var _0xdb1a=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xb1ad[_0x29b609];return _0x54c952;};'use strict';var VoiceQueueReportEvents=require(_0xdb1a('0x0'));var events=['save','remove','update'];function createListener(_0x2e4b7d,_0x1ed681){return function(_0x3a684a){_0x1ed681[_0xdb1a('0x1')](_0x2e4b7d,_0x3a684a);};}function removeListener(_0x149311,_0x4050ab){return function(){VoiceQueueReportEvents[_0xdb1a('0x2')](_0x149311,_0x4050ab);};}exports['register']=function(_0x449718){for(var _0xc4898a=0x0,_0x2cf5c2=events[_0xdb1a('0x3')];_0xc4898a<_0x2cf5c2;_0xc4898a++){var _0xed051d=events[_0xc4898a];var _0x500427=createListener(_0xdb1a('0x4')+_0xed051d,_0x449718);VoiceQueueReportEvents['on'](_0xed051d,_0x500427);}}; \ No newline at end of file +var _0xa7c8=['update','removeListener','register','length','./voiceQueueReport.events','remove'];(function(_0x11c01d,_0x2df2bf){var _0x531c48=function(_0x381064){while(--_0x381064){_0x11c01d['push'](_0x11c01d['shift']());}};_0x531c48(++_0x2df2bf);}(_0xa7c8,0x82));var _0x8a7c=function(_0x42eeaf,_0x24fbf1){_0x42eeaf=_0x42eeaf-0x0;var _0x4f73a0=_0xa7c8[_0x42eeaf];return _0x4f73a0;};'use strict';var VoiceQueueReportEvents=require(_0x8a7c('0x0'));var events=['save',_0x8a7c('0x1'),_0x8a7c('0x2')];function createListener(_0x2a6321,_0x563c48){return function(_0x43eebc){_0x563c48['emit'](_0x2a6321,_0x43eebc);};}function removeListener(_0xd11d72,_0x15003d){return function(){VoiceQueueReportEvents[_0x8a7c('0x3')](_0xd11d72,_0x15003d);};}exports[_0x8a7c('0x4')]=function(_0x566951){for(var _0xa29ec6=0x0,_0x5456f1=events[_0x8a7c('0x5')];_0xa29ec6<_0x5456f1;_0xa29ec6++){var _0x60a146=events[_0xa29ec6];var _0x2fa463=createListener('voiceQueueReport:'+_0x60a146,_0x566951);VoiceQueueReportEvents['on'](_0x60a146,_0x2fa463);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 8831a12..2520dfd 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 _0x7f94=['./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x530db1,_0x2b9531){var _0x31c1f2=function(_0x1c77b3){while(--_0x1c77b3){_0x530db1['push'](_0x530db1['shift']());}};_0x31c1f2(++_0x2b9531);}(_0x7f94,0x65));var _0x47f9=function(_0x45a618,_0x668eb1){_0x45a618=_0x45a618-0x0;var _0x39ae53=_0x7f94[_0x45a618];return _0x39ae53;};'use strict';var multer=require(_0x47f9('0x0'));var util=require('util');var path=require(_0x47f9('0x1'));var timeout=require(_0x47f9('0x2'));var express=require(_0x47f9('0x3'));var router=express[_0x47f9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x47f9('0x5'));var config=require(_0x47f9('0x6'));var controller=require(_0x47f9('0x7'));router[_0x47f9('0x8')]('/',auth[_0x47f9('0x9')](),controller[_0x47f9('0xa')]);router[_0x47f9('0x8')]('/:id',auth[_0x47f9('0x9')](),controller[_0x47f9('0xb')]);router[_0x47f9('0xc')]('/',auth[_0x47f9('0x9')](),controller[_0x47f9('0xd')]);router[_0x47f9('0xe')](_0x47f9('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x47f9('0x9')](),controller[_0x47f9('0x10')]);module[_0x47f9('0x11')]=router; \ No newline at end of file +var _0x307e=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','show','post','create','put','/:id','update','delete','destroy'];(function(_0x5abe0a,_0x3dcc84){var _0x5e5169=function(_0x278a90){while(--_0x278a90){_0x5abe0a['push'](_0x5abe0a['shift']());}};_0x5e5169(++_0x3dcc84);}(_0x307e,0xc9));var _0xe307=function(_0xad71da,_0x592494){_0xad71da=_0xad71da-0x0;var _0xe6056e=_0x307e[_0xad71da];return _0xe6056e;};'use strict';var multer=require(_0xe307('0x0'));var util=require(_0xe307('0x1'));var path=require(_0xe307('0x2'));var timeout=require(_0xe307('0x3'));var express=require(_0xe307('0x4'));var router=express['Router']();var auth=require(_0xe307('0x5'));var interaction=require(_0xe307('0x6'));var config=require('../../config/environment');var controller=require(_0xe307('0x7'));router['get']('/',auth[_0xe307('0x8')](),controller[_0xe307('0x9')]);router[_0xe307('0xa')]('/:id',auth[_0xe307('0x8')](),controller[_0xe307('0xb')]);router[_0xe307('0xc')]('/',auth[_0xe307('0x8')](),controller[_0xe307('0xd')]);router[_0xe307('0xe')](_0xe307('0xf'),auth[_0xe307('0x8')](),controller[_0xe307('0x10')]);router[_0xe307('0x11')](_0xe307('0xf'),auth[_0xe307('0x8')](),controller[_0xe307('0x12')]);module[_0xe307('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 6c490aa..9eacb09 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 _0xe5b3=['DATE','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING'];(function(_0x1526e1,_0x5ed5a5){var _0x249a1e=function(_0x4a7c12){while(--_0x4a7c12){_0x1526e1['push'](_0x1526e1['shift']());}};_0x249a1e(++_0x5ed5a5);}(_0xe5b3,0x133));var _0x3e5b=function(_0x396ad7,_0x5ec5d1){_0x396ad7=_0x396ad7-0x0;var _0x443fc9=_0xe5b3[_0x396ad7];return _0x443fc9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3e5b('0x0'));module[_0x3e5b('0x1')]={'time':{'type':Sequelize[_0x3e5b('0x2')]},'callid':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x3e5b('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x3e5b('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x3e5b('0x4'))}}; \ No newline at end of file +var _0x4b84=['sequelize','moment','STRING','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x4b84[_0x2265da];return _0x430c2b;};'use strict';var Sequelize=require(_0x44b8('0x0'));var moment=require(_0x44b8('0x1'));module['exports']={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x44b8('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x44b8('0x3')]('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 88a3ccd..1a36f64 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 _0x35a9=['fields','attributes','length','nolimit','order','where','merge','type','key','VIRTUAL','filter','options','includeAll','include','findAll','rows','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','VoiceQueuesLog','rawAttributes','keys','query','filters','intersection','model'];(function(_0x2226d4,_0x4ea17c){var _0x5dbf84=function(_0x1bfbe9){while(--_0x1bfbe9){_0x2226d4['push'](_0x2226d4['shift']());}};_0x5dbf84(++_0x4ea17c);}(_0x35a9,0x12d));var _0x935a=function(_0x2013ef,_0x426e55){_0x2013ef=_0x2013ef-0x0;var _0x3dec0b=_0x35a9[_0x2013ef];return _0x3dec0b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x935a('0x0'));var rimraf=require(_0x935a('0x1'));var zipdir=require(_0x935a('0x2'));var jsonpatch=require(_0x935a('0x3'));var rp=require(_0x935a('0x4'));var moment=require('moment');var BPromise=require(_0x935a('0x5'));var Mustache=require(_0x935a('0x6'));var util=require(_0x935a('0x7'));var path=require(_0x935a('0x8'));var sox=require('sox');var csv=require(_0x935a('0x9'));var ejs=require(_0x935a('0xa'));var fs=require('fs');var _=require(_0x935a('0xb'));var squel=require(_0x935a('0xc'));var crypto=require(_0x935a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x935a('0xe'));var toCsv=require(_0x935a('0x9'));var querystring=require(_0x935a('0xf'));var Papa=require('papaparse');var Redis=require(_0x935a('0x10'));var authService=require(_0x935a('0x11'));var qs=require(_0x935a('0x12'));var hardwareService=require(_0x935a('0x13'));var logger=require(_0x935a('0x14'))('api');var utils=require(_0x935a('0x15'));var config=require(_0x935a('0x16'));var db=require(_0x935a('0x17'))['db'];function respondWithStatusCode(_0x1ff306,_0x1a2bf9){_0x1a2bf9=_0x1a2bf9||0xcc;return function(_0x10dce1){if(_0x10dce1){return _0x1ff306[_0x935a('0x18')](_0x1a2bf9);}return _0x1ff306[_0x935a('0x19')](_0x1a2bf9)[_0x935a('0x1a')]();};}function respondWithResult(_0x58885e,_0x3edd0b){_0x3edd0b=_0x3edd0b||0xc8;return function(_0x4e2518){if(_0x4e2518){return _0x58885e[_0x935a('0x19')](_0x3edd0b)[_0x935a('0x1b')](_0x4e2518);}};}function respondWithFilteredResult(_0x5e6b0c,_0x4cc788){return function(_0x2456d4){if(_0x2456d4){var _0x3b4ada=_0x2456d4[_0x935a('0x1c')],_0x14ff95=_0x4cc788[_0x935a('0x1d')],_0x568c3a=_0x4cc788[_0x935a('0x1d')]+_0x4cc788[_0x935a('0x1e')],_0x437938;if(_0x568c3a>=_0x3b4ada){_0x568c3a=_0x3b4ada;_0x437938=0xc8;}else{_0x437938=0xce;}_0x5e6b0c[_0x935a('0x19')](_0x437938);return _0x5e6b0c[_0x935a('0x1f')](_0x935a('0x20'),_0x14ff95+'-'+_0x568c3a+'/'+_0x3b4ada)[_0x935a('0x1b')](_0x2456d4);}return null;};}function patchUpdates(_0x13a9d4){return function(_0x1d1c97){try{jsonpatch[_0x935a('0x21')](_0x1d1c97,_0x13a9d4,!![]);}catch(_0x22a335){return BPromise[_0x935a('0x22')](_0x22a335);}return _0x1d1c97[_0x935a('0x23')]();};}function saveUpdates(_0x1b4a96,_0x5d1578){return function(_0x9da167){if(_0x9da167){return _0x9da167['update'](_0x1b4a96)[_0x935a('0x24')](function(_0x5aba11){return _0x5aba11;});}return null;};}function removeEntity(_0x69a600,_0x2de364){return function(_0x5c68f6){if(_0x5c68f6){return _0x5c68f6[_0x935a('0x25')]()[_0x935a('0x24')](function(){_0x69a600[_0x935a('0x19')](0xcc)[_0x935a('0x1a')]();});}};}function handleEntityNotFound(_0x57d0ea,_0x12925d){return function(_0x32a219){if(!_0x32a219){_0x57d0ea[_0x935a('0x18')](0x194);}return _0x32a219;};}function handleError(_0x6ddeff,_0x2fd2cc){_0x2fd2cc=_0x2fd2cc||0x1f4;return function(_0x25833b){logger[_0x935a('0x26')](_0x25833b[_0x935a('0x27')]);if(_0x25833b[_0x935a('0x28')]){delete _0x25833b[_0x935a('0x28')];}_0x6ddeff[_0x935a('0x19')](_0x2fd2cc)['send'](_0x25833b);};}exports[_0x935a('0x29')]=function(_0x38765a,_0x4b5215){var _0x11cb31={},_0x4dc477={},_0x3dd2f6={'count':0x0,'rows':[]};var _0x2157ea=db[_0x935a('0x2a')][_0x935a('0x2b')];_0x4dc477['model']=_[_0x935a('0x2c')](_0x2157ea);_0x4dc477['query']=_['keys'](_0x38765a[_0x935a('0x2d')]);_0x4dc477[_0x935a('0x2e')]=_[_0x935a('0x2f')](_0x4dc477['model'],_0x4dc477[_0x935a('0x2d')]);_0x11cb31['attributes']=_[_0x935a('0x2f')](_0x4dc477[_0x935a('0x30')],qs[_0x935a('0x31')](_0x38765a['query']['fields']));_0x11cb31[_0x935a('0x32')]=_0x11cb31[_0x935a('0x32')][_0x935a('0x33')]?_0x11cb31[_0x935a('0x32')]:_0x4dc477[_0x935a('0x30')];if(!_0x38765a[_0x935a('0x2d')]['hasOwnProperty'](_0x935a('0x34'))){_0x11cb31[_0x935a('0x1e')]=qs[_0x935a('0x1e')](_0x38765a[_0x935a('0x2d')][_0x935a('0x1e')]);_0x11cb31[_0x935a('0x1d')]=qs[_0x935a('0x1d')](_0x38765a[_0x935a('0x2d')]['offset']);}_0x11cb31[_0x935a('0x35')]=qs['sort'](_0x38765a[_0x935a('0x2d')]['sort']);_0x11cb31[_0x935a('0x36')]=qs['filters'](_['pick'](_0x38765a[_0x935a('0x2d')],_0x4dc477[_0x935a('0x2e')]));if(_0x38765a[_0x935a('0x2d')]['filter']){_0x11cb31[_0x935a('0x36')]=_[_0x935a('0x37')](_0x11cb31[_0x935a('0x36')],{'$or':_['map'](_0x2157ea,function(_0xb0dbb2){if(_0xb0dbb2[_0x935a('0x38')][_0x935a('0x39')]!==_0x935a('0x3a')){var _0x53e851={};_0x53e851[_0xb0dbb2['field']]={'$like':'%'+_0x38765a[_0x935a('0x2d')][_0x935a('0x3b')]+'%'};return _0x53e851;}})});}_0x11cb31=_[_0x935a('0x37')]({},_0x11cb31,_0x38765a[_0x935a('0x3c')]);var _0x4dbf76={'where':_0x11cb31['where']};return db[_0x935a('0x2a')][_0x935a('0x1c')](_0x4dbf76)[_0x935a('0x24')](function(_0xe0c149){_0x3dd2f6['count']=_0xe0c149;if(_0x38765a[_0x935a('0x2d')][_0x935a('0x3d')]){_0x11cb31[_0x935a('0x3e')]=[{'all':!![]}];}return db[_0x935a('0x2a')][_0x935a('0x3f')](_0x11cb31);})[_0x935a('0x24')](function(_0x1e8659){_0x3dd2f6[_0x935a('0x40')]=_0x1e8659;return _0x3dd2f6;})[_0x935a('0x24')](respondWithFilteredResult(_0x4b5215,_0x11cb31))['catch'](handleError(_0x4b5215,null));};exports['show']=function(_0x4f09a4,_0x111e8c){var _0x348762={'raw':!![],'where':{'id':_0x4f09a4['params']['id']}},_0x574f67={};_0x574f67[_0x935a('0x30')]=_[_0x935a('0x2c')](db[_0x935a('0x2a')][_0x935a('0x2b')]);_0x574f67[_0x935a('0x2d')]=_[_0x935a('0x2c')](_0x4f09a4[_0x935a('0x2d')]);_0x574f67[_0x935a('0x2e')]=_[_0x935a('0x2f')](_0x574f67[_0x935a('0x30')],_0x574f67[_0x935a('0x2d')]);_0x348762[_0x935a('0x32')]=_[_0x935a('0x2f')](_0x574f67[_0x935a('0x30')],qs[_0x935a('0x31')](_0x4f09a4[_0x935a('0x2d')]['fields']));_0x348762['attributes']=_0x348762[_0x935a('0x32')][_0x935a('0x33')]?_0x348762[_0x935a('0x32')]:_0x574f67[_0x935a('0x30')];if(_0x4f09a4[_0x935a('0x2d')][_0x935a('0x3d')]){_0x348762['include']=[{'all':!![]}];}_0x348762=_[_0x935a('0x37')]({},_0x348762,_0x4f09a4[_0x935a('0x3c')]);return db[_0x935a('0x2a')][_0x935a('0x41')](_0x348762)['then'](handleEntityNotFound(_0x111e8c,null))[_0x935a('0x24')](respondWithResult(_0x111e8c,null))[_0x935a('0x42')](handleError(_0x111e8c,null));};exports[_0x935a('0x43')]=function(_0x1682b6,_0x406716){return db['VoiceQueuesLog']['create'](_0x1682b6[_0x935a('0x44')],{})['then'](respondWithResult(_0x406716,0xc9))['catch'](handleError(_0x406716,null));};exports[_0x935a('0x45')]=function(_0x558ac6,_0x2e3144){if(_0x558ac6['body']['id']){delete _0x558ac6[_0x935a('0x44')]['id'];}return db[_0x935a('0x2a')]['find']({'where':{'id':_0x558ac6['params']['id']}})['then'](handleEntityNotFound(_0x2e3144,null))[_0x935a('0x24')](saveUpdates(_0x558ac6['body'],null))['then'](respondWithResult(_0x2e3144,null))['catch'](handleError(_0x2e3144,null));};exports[_0x935a('0x25')]=function(_0x3920af,_0x5b0749){return db[_0x935a('0x2a')][_0x935a('0x41')]({'where':{'id':_0x3920af['params']['id']}})[_0x935a('0x24')](handleEntityNotFound(_0x5b0749,null))['then'](removeEntity(_0x5b0749,null))['catch'](handleError(_0x5b0749,null));}; \ No newline at end of file +var _0x19af=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','Content-Range','reject','update','then','end','error','name','send','VoiceQueuesLog','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','key','field','includeAll','include','catch','show','params','rawAttributes','merge','find','create','body','destroy','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js'];(function(_0x24897a,_0x2c9aa0){var _0x3fb7b0=function(_0x1699ce){while(--_0x1699ce){_0x24897a['push'](_0x24897a['shift']());}};_0x3fb7b0(++_0x2c9aa0);}(_0x19af,0xf3));var _0xf19a=function(_0x1d5759,_0x417e09){_0x1d5759=_0x1d5759-0x0;var _0x51ddcd=_0x19af[_0x1d5759];return _0x51ddcd;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf19a('0x0'));var zipdir=require(_0xf19a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf19a('0x2'));var moment=require('moment');var BPromise=require(_0xf19a('0x3'));var Mustache=require('mustache');var util=require(_0xf19a('0x4'));var path=require(_0xf19a('0x5'));var sox=require(_0xf19a('0x6'));var csv=require(_0xf19a('0x7'));var ejs=require(_0xf19a('0x8'));var fs=require('fs');var _=require(_0xf19a('0x9'));var squel=require('squel');var crypto=require(_0xf19a('0xa'));var jsforce=require(_0xf19a('0xb'));var deskjs=require(_0xf19a('0xc'));var toCsv=require(_0xf19a('0x7'));var querystring=require(_0xf19a('0xd'));var Papa=require(_0xf19a('0xe'));var Redis=require(_0xf19a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf19a('0x10'));var hardwareService=require(_0xf19a('0x11'));var logger=require('../../config/logger')(_0xf19a('0x12'));var utils=require(_0xf19a('0x13'));var config=require(_0xf19a('0x14'));var db=require(_0xf19a('0x15'))['db'];function respondWithStatusCode(_0x498d2d,_0x50e987){_0x50e987=_0x50e987||0xcc;return function(_0x151145){if(_0x151145){return _0x498d2d['sendStatus'](_0x50e987);}return _0x498d2d[_0xf19a('0x16')](_0x50e987)['end']();};}function respondWithResult(_0x5415bc,_0x43be34){_0x43be34=_0x43be34||0xc8;return function(_0x35b8e0){if(_0x35b8e0){return _0x5415bc['status'](_0x43be34)['json'](_0x35b8e0);}};}function respondWithFilteredResult(_0x89f8a6,_0x1b4030){return function(_0xd1badc){if(_0xd1badc){var _0x4366cd=_0xd1badc[_0xf19a('0x17')],_0x12a3d0=_0x1b4030[_0xf19a('0x18')],_0x5454ca=_0x1b4030[_0xf19a('0x18')]+_0x1b4030[_0xf19a('0x19')],_0x29b2bd;if(_0x5454ca>=_0x4366cd){_0x5454ca=_0x4366cd;_0x29b2bd=0xc8;}else{_0x29b2bd=0xce;}_0x89f8a6[_0xf19a('0x16')](_0x29b2bd);return _0x89f8a6['set'](_0xf19a('0x1a'),_0x12a3d0+'-'+_0x5454ca+'/'+_0x4366cd)['json'](_0xd1badc);}return null;};}function patchUpdates(_0x2a9ec){return function(_0xdc44a7){try{jsonpatch['apply'](_0xdc44a7,_0x2a9ec,!![]);}catch(_0x5987d2){return BPromise[_0xf19a('0x1b')](_0x5987d2);}return _0xdc44a7['save']();};}function saveUpdates(_0x3b3ac4,_0x2f4045){return function(_0x7818d){if(_0x7818d){return _0x7818d[_0xf19a('0x1c')](_0x3b3ac4)[_0xf19a('0x1d')](function(_0x37dc06){return _0x37dc06;});}return null;};}function removeEntity(_0x14e0e6,_0x38c2c9){return function(_0x1b5869){if(_0x1b5869){return _0x1b5869['destroy']()['then'](function(){_0x14e0e6['status'](0xcc)[_0xf19a('0x1e')]();});}};}function handleEntityNotFound(_0x45682e,_0xd51f13){return function(_0x3f62c4){if(!_0x3f62c4){_0x45682e['sendStatus'](0x194);}return _0x3f62c4;};}function handleError(_0x336803,_0x2f6045){_0x2f6045=_0x2f6045||0x1f4;return function(_0x254ee5){logger[_0xf19a('0x1f')](_0x254ee5['stack']);if(_0x254ee5[_0xf19a('0x20')]){delete _0x254ee5[_0xf19a('0x20')];}_0x336803[_0xf19a('0x16')](_0x2f6045)[_0xf19a('0x21')](_0x254ee5);};}exports['index']=function(_0x1bbfc0,_0x5d2488){var _0x490d9a={},_0x13e591={},_0x1e70fc={'count':0x0,'rows':[]};var _0x597cd5=db[_0xf19a('0x22')]['rawAttributes'];_0x13e591['model']=_['keys'](_0x597cd5);_0x13e591['query']=_[_0xf19a('0x23')](_0x1bbfc0[_0xf19a('0x24')]);_0x13e591[_0xf19a('0x25')]=_[_0xf19a('0x26')](_0x13e591[_0xf19a('0x27')],_0x13e591[_0xf19a('0x24')]);_0x490d9a[_0xf19a('0x28')]=_[_0xf19a('0x26')](_0x13e591['model'],qs['fields'](_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x29')]));_0x490d9a['attributes']=_0x490d9a[_0xf19a('0x28')][_0xf19a('0x2a')]?_0x490d9a[_0xf19a('0x28')]:_0x13e591[_0xf19a('0x27')];if(!_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x2b')](_0xf19a('0x2c'))){_0x490d9a[_0xf19a('0x19')]=qs[_0xf19a('0x19')](_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x19')]);_0x490d9a['offset']=qs[_0xf19a('0x18')](_0x1bbfc0[_0xf19a('0x24')]['offset']);}_0x490d9a[_0xf19a('0x2d')]=qs[_0xf19a('0x2e')](_0x1bbfc0['query']['sort']);_0x490d9a[_0xf19a('0x2f')]=qs['filters'](_[_0xf19a('0x30')](_0x1bbfc0['query'],_0x13e591[_0xf19a('0x25')]));if(_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x31')]){_0x490d9a[_0xf19a('0x2f')]=_['merge'](_0x490d9a[_0xf19a('0x2f')],{'$or':_[_0xf19a('0x32')](_0x597cd5,function(_0x583bdc){if(_0x583bdc['type'][_0xf19a('0x33')]!=='VIRTUAL'){var _0x2fc8b3={};_0x2fc8b3[_0x583bdc[_0xf19a('0x34')]]={'$like':'%'+_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x31')]+'%'};return _0x2fc8b3;}})});}_0x490d9a=_['merge']({},_0x490d9a,_0x1bbfc0['options']);var _0x576f7f={'where':_0x490d9a['where']};return db['VoiceQueuesLog'][_0xf19a('0x17')](_0x576f7f)[_0xf19a('0x1d')](function(_0x2a6c81){_0x1e70fc[_0xf19a('0x17')]=_0x2a6c81;if(_0x1bbfc0[_0xf19a('0x24')][_0xf19a('0x35')]){_0x490d9a[_0xf19a('0x36')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x490d9a);})[_0xf19a('0x1d')](function(_0xbdf538){_0x1e70fc['rows']=_0xbdf538;return _0x1e70fc;})['then'](respondWithFilteredResult(_0x5d2488,_0x490d9a))[_0xf19a('0x37')](handleError(_0x5d2488,null));};exports[_0xf19a('0x38')]=function(_0x36d31a,_0x5d9897){var _0x26915f={'raw':!![],'where':{'id':_0x36d31a[_0xf19a('0x39')]['id']}},_0x19f921={};_0x19f921[_0xf19a('0x27')]=_['keys'](db[_0xf19a('0x22')][_0xf19a('0x3a')]);_0x19f921['query']=_[_0xf19a('0x23')](_0x36d31a[_0xf19a('0x24')]);_0x19f921['filters']=_[_0xf19a('0x26')](_0x19f921['model'],_0x19f921[_0xf19a('0x24')]);_0x26915f[_0xf19a('0x28')]=_['intersection'](_0x19f921[_0xf19a('0x27')],qs[_0xf19a('0x29')](_0x36d31a[_0xf19a('0x24')][_0xf19a('0x29')]));_0x26915f['attributes']=_0x26915f[_0xf19a('0x28')]['length']?_0x26915f[_0xf19a('0x28')]:_0x19f921[_0xf19a('0x27')];if(_0x36d31a[_0xf19a('0x24')][_0xf19a('0x35')]){_0x26915f[_0xf19a('0x36')]=[{'all':!![]}];}_0x26915f=_[_0xf19a('0x3b')]({},_0x26915f,_0x36d31a['options']);return db[_0xf19a('0x22')][_0xf19a('0x3c')](_0x26915f)[_0xf19a('0x1d')](handleEntityNotFound(_0x5d9897,null))['then'](respondWithResult(_0x5d9897,null))[_0xf19a('0x37')](handleError(_0x5d9897,null));};exports['create']=function(_0x5c34a6,_0x344647){return db[_0xf19a('0x22')][_0xf19a('0x3d')](_0x5c34a6['body'],{})[_0xf19a('0x1d')](respondWithResult(_0x344647,0xc9))[_0xf19a('0x37')](handleError(_0x344647,null));};exports[_0xf19a('0x1c')]=function(_0x47151d,_0x3ad02f){if(_0x47151d['body']['id']){delete _0x47151d[_0xf19a('0x3e')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x47151d[_0xf19a('0x39')]['id']}})[_0xf19a('0x1d')](handleEntityNotFound(_0x3ad02f,null))[_0xf19a('0x1d')](saveUpdates(_0x47151d[_0xf19a('0x3e')],null))['then'](respondWithResult(_0x3ad02f,null))[_0xf19a('0x37')](handleError(_0x3ad02f,null));};exports[_0xf19a('0x3f')]=function(_0x442f3d,_0x321dca){return db[_0xf19a('0x22')][_0xf19a('0x3c')]({'where':{'id':_0x442f3d['params']['id']}})[_0xf19a('0x1d')](handleEntityNotFound(_0x321dca,null))['then'](removeEntity(_0x321dca,null))[_0xf19a('0x37')](handleError(_0x321dca,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 94766a0..fc4e876 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 _0xe05f=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x19bdab,_0x11ee18){var _0x1e5be1=function(_0x5bdc6e){while(--_0x5bdc6e){_0x19bdab['push'](_0x19bdab['shift']());}};_0x1e5be1(++_0x11ee18);}(_0xe05f,0x116));var _0xfe05=function(_0x5c41a0,_0x3c97af){_0x5c41a0=_0x5c41a0-0x0;var _0x10d4e6=_0xe05f[_0x5c41a0];return _0x10d4e6;};'use strict';var _=require('lodash');var util=require(_0xfe05('0x0'));var logger=require(_0xfe05('0x1'))(_0xfe05('0x2'));var moment=require(_0xfe05('0x3'));var BPromise=require(_0xfe05('0x4'));var rp=require(_0xfe05('0x5'));var fs=require('fs');var path=require(_0xfe05('0x6'));var rimraf=require(_0xfe05('0x7'));var config=require(_0xfe05('0x8'));var attributes=require(_0xfe05('0x9'));module[_0xfe05('0xa')]=function(_0x5c09ca,_0x260430){return _0x5c09ca[_0xfe05('0xb')](_0xfe05('0xc'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xfe05('0xd'),'fields':['event',_0xfe05('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0x3dfa=['path','../../config/environment','define','VoiceQueuesLog','voice_queues_log','dtm','util','moment','bluebird'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x3dfa,0x19b));var _0xa3df=function(_0x273be5,_0x4fe892){_0x273be5=_0x273be5-0x0;var _0x29a5be=_0x3dfa[_0x273be5];return _0x29a5be;};'use strict';var _=require('lodash');var util=require(_0xa3df('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa3df('0x1'));var BPromise=require(_0xa3df('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3df('0x3'));var rimraf=require('rimraf');var config=require(_0xa3df('0x4'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x1b104f,_0x467845){return _0x1b104f[_0xa3df('0x5')](_0xa3df('0x6'),attributes,{'tableName':_0xa3df('0x7'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0xa3df('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index cd31df6..381a2ac 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 _0xf54e=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0xf54e,0xec));var _0xef54=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0xf54e[_0x146484];return _0x4c7aa3;};'use strict';var _=require(_0xef54('0x0'));var util=require(_0xef54('0x1'));var moment=require(_0xef54('0x2'));var BPromise=require(_0xef54('0x3'));var rs=require(_0xef54('0x4'));var fs=require('fs');var Redis=require(_0xef54('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xef54('0x6'));var logger=require(_0xef54('0x7'))(_0xef54('0x8'));var config=require('../../config/environment');var jayson=require(_0xef54('0x9'));var client=jayson[_0xef54('0xa')][_0xef54('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b6ff2,_0x1592b9,_0x5cf717){return new BPromise(function(_0x5eb729,_0x3fe6c9){return client[_0xef54('0xc')](_0x4b6ff2,_0x5cf717)['then'](function(_0x49b837){logger[_0xef54('0xd')](_0xef54('0xe'),_0x1592b9,_0xef54('0xf'));logger[_0xef54('0x10')](_0xef54('0x11'),_0x1592b9,_0xef54('0xf'),JSON[_0xef54('0x12')](_0x49b837));if(_0x49b837[_0xef54('0x13')]){if(_0x49b837[_0xef54('0x13')]['code']===0x1f4){logger['error'](_0xef54('0xe'),_0x1592b9,_0x49b837[_0xef54('0x13')][_0xef54('0x14')]);return _0x3fe6c9(_0x49b837[_0xef54('0x13')][_0xef54('0x14')]);}logger['error'](_0xef54('0xe'),_0x1592b9,_0x49b837[_0xef54('0x13')][_0xef54('0x14')]);return _0x5eb729(_0x49b837[_0xef54('0x13')][_0xef54('0x14')]);}else{logger[_0xef54('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1592b9,_0xef54('0xf'));_0x5eb729(_0x49b837[_0xef54('0x15')][_0xef54('0x14')]);}})['catch'](function(_0x221504){logger[_0xef54('0x13')](_0xef54('0xe'),_0x1592b9,_0x221504);_0x3fe6c9(_0x221504);});});} \ No newline at end of file +var _0xa849=['http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x21783f,_0x21fd7c){var _0xd87dba=function(_0x4824d5){while(--_0x4824d5){_0x21783f['push'](_0x21783f['shift']());}};_0xd87dba(++_0x21fd7c);}(_0xa849,0x175));var _0x9a84=function(_0x457d00,_0x4cc70c){_0x457d00=_0x457d00-0x0;var _0x5a87f6=_0xa849[_0x457d00];return _0x5a87f6;};'use strict';var _=require(_0x9a84('0x0'));var util=require(_0x9a84('0x1'));var moment=require(_0x9a84('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a84('0x3'));var fs=require('fs');var Redis=require(_0x9a84('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a84('0x5'));var logger=require(_0x9a84('0x6'))(_0x9a84('0x7'));var config=require(_0x9a84('0x8'));var jayson=require(_0x9a84('0x9'));var client=jayson[_0x9a84('0xa')][_0x9a84('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f5685,_0x4db29a,_0x305fdb){return new BPromise(function(_0x9e4193,_0xce5400){return client[_0x9a84('0xc')](_0x2f5685,_0x305fdb)[_0x9a84('0xd')](function(_0x23794c){logger['info'](_0x9a84('0xe'),_0x4db29a,_0x9a84('0xf'));logger[_0x9a84('0x10')](_0x9a84('0x11'),_0x4db29a,'request\x20sent',JSON[_0x9a84('0x12')](_0x23794c));if(_0x23794c['error']){if(_0x23794c[_0x9a84('0x13')][_0x9a84('0x14')]===0x1f4){logger[_0x9a84('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4db29a,_0x23794c[_0x9a84('0x13')][_0x9a84('0x15')]);return _0xce5400(_0x23794c[_0x9a84('0x13')]['message']);}logger[_0x9a84('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4db29a,_0x23794c[_0x9a84('0x13')][_0x9a84('0x15')]);return _0x9e4193(_0x23794c[_0x9a84('0x13')][_0x9a84('0x15')]);}else{logger['info'](_0x9a84('0xe'),_0x4db29a,_0x9a84('0xf'));_0x9e4193(_0x23794c[_0x9a84('0x16')]['message']);}})[_0x9a84('0x17')](function(_0x2dca64){logger[_0x9a84('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4db29a,_0x2dca64);_0xce5400(_0x2dca64);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 642667e..2798315 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 _0xb6b1=['path','express','Router','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','/:id/downloads','downloads','post','create','update','exports','multer'];(function(_0x1abafe,_0x572047){var _0x4fae5a=function(_0x3a5923){while(--_0x3a5923){_0x1abafe['push'](_0x1abafe['shift']());}};_0x4fae5a(++_0x572047);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xb6b1[_0x5d9867];return _0x7d2118;};'use strict';var multer=require(_0x1b6b('0x0'));var util=require('util');var path=require(_0x1b6b('0x1'));var timeout=require('connect-timeout');var express=require(_0x1b6b('0x2'));var router=express[_0x1b6b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x1b6b('0x4'));var config=require('../../config/environment');var controller=require(_0x1b6b('0x5'));router[_0x1b6b('0x6')]('/',auth[_0x1b6b('0x7')](),controller[_0x1b6b('0x8')]);router['get'](_0x1b6b('0x9'),auth['isAuthenticated'](),controller[_0x1b6b('0xa')]);router['get'](_0x1b6b('0xb'),auth[_0x1b6b('0x7')](),controller[_0x1b6b('0xc')]);router[_0x1b6b('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x1b6b('0xd')]);router[_0x1b6b('0x6')](_0x1b6b('0xe'),controller[_0x1b6b('0xf')]);router[_0x1b6b('0x10')]('/',auth[_0x1b6b('0x7')](),controller[_0x1b6b('0x11')]);router['put'](_0x1b6b('0xb'),auth[_0x1b6b('0x7')](),controller[_0x1b6b('0x12')]);router['delete'](_0x1b6b('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x1b6b('0x13')]=router; \ No newline at end of file +var _0x867f=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','update','exports','multer'];(function(_0x1537a5,_0xbcbd4b){var _0x3f4aa2=function(_0x31ee61){while(--_0x31ee61){_0x1537a5['push'](_0x1537a5['shift']());}};_0x3f4aa2(++_0xbcbd4b);}(_0x867f,0xe6));var _0xf867=function(_0x3c6125,_0x3b2a9c){_0x3c6125=_0x3c6125-0x0;var _0x2f47b8=_0x867f[_0x3c6125];return _0x2f47b8;};'use strict';var multer=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var path=require(_0xf867('0x2'));var timeout=require(_0xf867('0x3'));var express=require(_0xf867('0x4'));var router=express[_0xf867('0x5')]();var auth=require(_0xf867('0x6'));var interaction=require(_0xf867('0x7'));var config=require(_0xf867('0x8'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0xf867('0x9')](),controller[_0xf867('0xa')]);router[_0xf867('0xb')](_0xf867('0xc'),auth[_0xf867('0x9')](),controller['describe']);router['get'](_0xf867('0xd'),auth['isAuthenticated'](),controller[_0xf867('0xe')]);router[_0xf867('0xb')](_0xf867('0xf'),auth[_0xf867('0x9')](),controller[_0xf867('0x10')]);router[_0xf867('0xb')](_0xf867('0x11'),controller[_0xf867('0x12')]);router['post']('/',auth[_0xf867('0x9')](),controller['create']);router['put'](_0xf867('0xd'),auth[_0xf867('0x9')](),controller[_0xf867('0x13')]);router['delete']('/:id',auth[_0xf867('0x9')](),controller['destroy']);module[_0xf867('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 73f913f..6ecebf4 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 _0x8424=['toString','sequelize','exports','VIRTUAL','getDataValue','value','extname','STRING','membername','split','INTEGER','DATE','format'];(function(_0x2849c8,_0xfc6011){var _0x4cbd52=function(_0x1fb49b){while(--_0x1fb49b){_0x2849c8['push'](_0x2849c8['shift']());}};_0x4cbd52(++_0xfc6011);}(_0x8424,0xeb));var _0x4842=function(_0x2d677d,_0x21bbf1){_0x2d677d=_0x2d677d-0x0;var _0x28a939=_0x8424[_0x2d677d];return _0x28a939;};'use strict';var Sequelize=require(_0x4842('0x0'));var moment=require('moment');var path=require('path');module[_0x4842('0x1')]={'format':{'type':Sequelize[_0x4842('0x2')],'get':function(){return this[_0x4842('0x3')](_0x4842('0x4'))?path[_0x4842('0x5')](this['getDataValue'](_0x4842('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0x4842('0x6')]},'channel':{'type':Sequelize[_0x4842('0x6')],'set':function(_0x55ab6d){if(_0x55ab6d){this['setDataValue']('channel',_0x55ab6d);this['setDataValue'](_0x4842('0x7'),_0x55ab6d[_0x4842('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x4842('0x6')]},'calleridnum':{'type':Sequelize[_0x4842('0x6')]},'calleridname':{'type':Sequelize[_0x4842('0x6')]},'connectedlinenum':{'type':Sequelize[_0x4842('0x6')]},'connectedlinename':{'type':Sequelize[_0x4842('0x6')]},'accountcode':{'type':Sequelize[_0x4842('0x6')]},'context':{'type':Sequelize[_0x4842('0x6')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x4842('0x6')]},'type':{'type':Sequelize[_0x4842('0x6')]},'rating':{'type':Sequelize[_0x4842('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x4842('0x6')]},'createdAt':{'type':Sequelize[_0x4842('0xa')],'get':function(){return moment(this[_0x4842('0x3')]('createdAt'))[_0x4842('0xb')]('MM-DD-YYYY\x20HH:mm')[_0x4842('0xc')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4842('0x3')]('updatedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0x4842('0xc')]();}}}; \ No newline at end of file +var _0xd3ba=['format','MM-DD-YYYY\x20HH:mm','toString','sequelize','path','exports','VIRTUAL','getDataValue','value','extname','STRING','channel','split','DATE','createdAt'];(function(_0x5b7fae,_0x1e0c52){var _0x29d85d=function(_0x4731ff){while(--_0x4731ff){_0x5b7fae['push'](_0x5b7fae['shift']());}};_0x29d85d(++_0x1e0c52);}(_0xd3ba,0x1d4));var _0xad3b=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd3ba[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xad3b('0x0'));var moment=require('moment');var path=require(_0xad3b('0x1'));module[_0xad3b('0x2')]={'format':{'type':Sequelize[_0xad3b('0x3')],'get':function(){return this[_0xad3b('0x4')](_0xad3b('0x5'))?path[_0xad3b('0x6')](this['getDataValue'](_0xad3b('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0xad3b('0x7')]},'channel':{'type':Sequelize['STRING'],'set':function(_0x4b8632){if(_0x4b8632){this['setDataValue'](_0xad3b('0x8'),_0x4b8632);this['setDataValue']('membername',_0x4b8632[_0xad3b('0x9')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xad3b('0x7')]},'calleridnum':{'type':Sequelize[_0xad3b('0x7')]},'calleridname':{'type':Sequelize[_0xad3b('0x7')]},'connectedlinenum':{'type':Sequelize[_0xad3b('0x7')]},'connectedlinename':{'type':Sequelize[_0xad3b('0x7')]},'accountcode':{'type':Sequelize[_0xad3b('0x7')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xad3b('0x7')]},'value':{'type':Sequelize[_0xad3b('0x7')]},'type':{'type':Sequelize[_0xad3b('0x7')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xad3b('0x7')]},'createdAt':{'type':Sequelize[_0xad3b('0xa')],'get':function(){return moment(this[_0xad3b('0x4')](_0xad3b('0xb')))[_0xad3b('0xc')](_0xad3b('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0xad3b('0xa')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xad3b('0xc')](_0xad3b('0xd'))[_0xad3b('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 2234d19..79de3cb 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 _0x81bd=['update','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','VoiceRecording\x20not\x20found','extname','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','keys','format','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','options','VoiceRecording','includeAll','include','findAll','rows','catch','params','length','merge','find','create','body'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x81bd,0x7c));var _0xd81b=function(_0x20abea,_0x48795e){_0x20abea=_0x20abea-0x0;var _0x1382f7=_0x81bd[_0x20abea];return _0x1382f7;};'use strict';var pdf=require(_0xd81b('0x0'));var emlformat=require(_0xd81b('0x1'));var rimraf=require(_0xd81b('0x2'));var zipdir=require(_0xd81b('0x3'));var jsonpatch=require(_0xd81b('0x4'));var rp=require(_0xd81b('0x5'));var moment=require(_0xd81b('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd81b('0x7'));var util=require(_0xd81b('0x8'));var path=require(_0xd81b('0x9'));var sox=require('sox');var csv=require(_0xd81b('0xa'));var ejs=require(_0xd81b('0xb'));var fs=require('fs');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('0xa'));var querystring=require(_0xd81b('0xe'));var Papa=require(_0xd81b('0xf'));var Redis=require(_0xd81b('0x10'));var authService=require(_0xd81b('0x11'));var qs=require(_0xd81b('0x12'));var hardwareService=require(_0xd81b('0x13'));var logger=require(_0xd81b('0x14'))(_0xd81b('0x15'));var utils=require(_0xd81b('0x16'));var config=require(_0xd81b('0x17'));var db=require(_0xd81b('0x18'))['db'];function respondWithStatusCode(_0x1afb8f,_0x560530){_0x560530=_0x560530||0xcc;return function(_0x21dfff){if(_0x21dfff){return _0x1afb8f['sendStatus'](_0x560530);}return _0x1afb8f[_0xd81b('0x19')](_0x560530)[_0xd81b('0x1a')]();};}function respondWithResult(_0x5f0b6b,_0x35a053){_0x35a053=_0x35a053||0xc8;return function(_0x47dd04){if(_0x47dd04){return _0x5f0b6b[_0xd81b('0x19')](_0x35a053)[_0xd81b('0x1b')](_0x47dd04);}};}function respondWithFilteredResult(_0x6c6041,_0x35cfc1){return function(_0x128162){if(_0x128162){var _0x552215=_0x128162[_0xd81b('0x1c')],_0x1c620d=_0x35cfc1[_0xd81b('0x1d')],_0x27b7a0=_0x35cfc1[_0xd81b('0x1d')]+_0x35cfc1[_0xd81b('0x1e')],_0x5c2863;if(_0x27b7a0>=_0x552215){_0x27b7a0=_0x552215;_0x5c2863=0xc8;}else{_0x5c2863=0xce;}_0x6c6041[_0xd81b('0x19')](_0x5c2863);return _0x6c6041[_0xd81b('0x1f')](_0xd81b('0x20'),_0x1c620d+'-'+_0x27b7a0+'/'+_0x552215)[_0xd81b('0x1b')](_0x128162);}return null;};}function patchUpdates(_0x1c34c5){return function(_0x285164){try{jsonpatch[_0xd81b('0x21')](_0x285164,_0x1c34c5,!![]);}catch(_0x453952){return BPromise[_0xd81b('0x22')](_0x453952);}return _0x285164[_0xd81b('0x23')]();};}function saveUpdates(_0x156894,_0x4f8c0b){return function(_0x5f101a){if(_0x5f101a){return _0x5f101a['update'](_0x156894)[_0xd81b('0x24')](function(_0x1b7876){return _0x1b7876;});}return null;};}function removeEntity(_0x34afe6,_0x543fbc){return function(_0x19ed0e){if(_0x19ed0e){return _0x19ed0e[_0xd81b('0x25')]()['then'](function(){_0x34afe6[_0xd81b('0x19')](0xcc)[_0xd81b('0x1a')]();});}};}function handleEntityNotFound(_0x1670cd,_0x1ad65c){return function(_0x279176){if(!_0x279176){_0x1670cd[_0xd81b('0x26')](0x194);}return _0x279176;};}function handleError(_0x255011,_0x5ecba9){_0x5ecba9=_0x5ecba9||0x1f4;return function(_0x341aec){logger[_0xd81b('0x27')](_0x341aec[_0xd81b('0x28')]);if(_0x341aec[_0xd81b('0x29')]){delete _0x341aec['name'];}_0x255011[_0xd81b('0x19')](_0x5ecba9)[_0xd81b('0x2a')](_0x341aec);};}exports[_0xd81b('0x2b')]=function(_0x31b9fd,_0x3266c2){var _0x2d0d02={},_0x3e28dd={},_0x73dc09={'count':0x0,'rows':[]};var _0x10a561=db['VoiceRecording'][_0xd81b('0x2c')];_0x3e28dd['model']=_['differenceBy'](_[_0xd81b('0x2d')](_0x10a561),[_0xd81b('0x2e')]);_0x3e28dd['query']=_['keys'](_0x31b9fd[_0xd81b('0x2f')]);_0x3e28dd[_0xd81b('0x30')]=_[_0xd81b('0x31')](_0x3e28dd[_0xd81b('0x32')],_0x3e28dd[_0xd81b('0x2f')]);_0x2d0d02[_0xd81b('0x33')]=_['intersection'](_0x3e28dd[_0xd81b('0x32')],qs[_0xd81b('0x34')](_0x31b9fd['query']['fields']));_0x2d0d02[_0xd81b('0x33')]=_0x2d0d02[_0xd81b('0x33')]['length']?_0x2d0d02['attributes']:_0x3e28dd['model'];if(!_0x31b9fd[_0xd81b('0x2f')][_0xd81b('0x35')](_0xd81b('0x36'))){_0x2d0d02[_0xd81b('0x1e')]=qs[_0xd81b('0x1e')](_0x31b9fd[_0xd81b('0x2f')][_0xd81b('0x1e')]);_0x2d0d02['offset']=qs[_0xd81b('0x1d')](_0x31b9fd['query'][_0xd81b('0x1d')]);}_0x2d0d02[_0xd81b('0x37')]=qs[_0xd81b('0x38')](_0x31b9fd[_0xd81b('0x2f')][_0xd81b('0x38')]);_0x2d0d02[_0xd81b('0x39')]=qs[_0xd81b('0x30')](_[_0xd81b('0x3a')](_0x31b9fd[_0xd81b('0x2f')],_0x3e28dd[_0xd81b('0x30')]));if(_0x31b9fd[_0xd81b('0x2f')][_0xd81b('0x3b')]){_0x2d0d02[_0xd81b('0x39')]=_['merge'](_0x2d0d02['where'],{'$or':_[_0xd81b('0x3c')](_0x10a561,function(_0x46119e){if(_0x46119e[_0xd81b('0x3d')]['key']!==_0xd81b('0x3e')){var _0x37ba34={};_0x37ba34[_0x46119e['field']]={'$like':'%'+_0x31b9fd[_0xd81b('0x2f')][_0xd81b('0x3b')]+'%'};return _0x37ba34;}})});}_0x2d0d02=_['merge']({},_0x2d0d02,_0x31b9fd[_0xd81b('0x3f')]);var _0x5a48e8={'where':_0x2d0d02[_0xd81b('0x39')]};return db[_0xd81b('0x40')][_0xd81b('0x1c')](_0x5a48e8)[_0xd81b('0x24')](function(_0x573da5){_0x73dc09[_0xd81b('0x1c')]=_0x573da5;if(_0x31b9fd[_0xd81b('0x2f')][_0xd81b('0x41')]){_0x2d0d02[_0xd81b('0x42')]=[{'all':!![]}];}return db[_0xd81b('0x40')][_0xd81b('0x43')](_0x2d0d02);})[_0xd81b('0x24')](function(_0x532ada){_0x73dc09[_0xd81b('0x44')]=_0x532ada;return _0x73dc09;})[_0xd81b('0x24')](respondWithFilteredResult(_0x3266c2,_0x2d0d02))[_0xd81b('0x45')](handleError(_0x3266c2,null));};exports['show']=function(_0x3bea7d,_0x3a05f4){var _0x3e849a={'raw':![],'where':{'id':_0x3bea7d[_0xd81b('0x46')]['id']}},_0x1cd745={};_0x1cd745['model']=_[_0xd81b('0x2d')](db[_0xd81b('0x40')][_0xd81b('0x2c')]);_0x1cd745[_0xd81b('0x2f')]=_[_0xd81b('0x2d')](_0x3bea7d[_0xd81b('0x2f')]);_0x1cd745[_0xd81b('0x30')]=_[_0xd81b('0x31')](_0x1cd745[_0xd81b('0x32')],_0x1cd745[_0xd81b('0x2f')]);_0x3e849a[_0xd81b('0x33')]=_['intersection'](_0x1cd745[_0xd81b('0x32')],qs[_0xd81b('0x34')](_0x3bea7d[_0xd81b('0x2f')][_0xd81b('0x34')]));_0x3e849a[_0xd81b('0x33')]=_0x3e849a[_0xd81b('0x33')][_0xd81b('0x47')]?_0x3e849a[_0xd81b('0x33')]:_0x1cd745['model'];if(_0x3bea7d['query'][_0xd81b('0x41')]){_0x3e849a[_0xd81b('0x42')]=[{'all':!![]}];}_0x3e849a=_[_0xd81b('0x48')]({},_0x3e849a,_0x3bea7d[_0xd81b('0x3f')]);return db[_0xd81b('0x40')][_0xd81b('0x49')](_0x3e849a)[_0xd81b('0x24')](handleEntityNotFound(_0x3a05f4,null))[_0xd81b('0x24')](respondWithResult(_0x3a05f4,null))[_0xd81b('0x45')](handleError(_0x3a05f4,null));};exports[_0xd81b('0x4a')]=function(_0x41e2e6,_0x38e436){return db['VoiceRecording'][_0xd81b('0x4a')](_0x41e2e6[_0xd81b('0x4b')],{})[_0xd81b('0x24')](respondWithResult(_0x38e436,0xc9))[_0xd81b('0x45')](handleError(_0x38e436,null));};exports[_0xd81b('0x4c')]=function(_0x410ef3,_0xa176d3){if(_0x410ef3[_0xd81b('0x4b')]['id']){delete _0x410ef3[_0xd81b('0x4b')]['id'];}return db['VoiceRecording'][_0xd81b('0x49')]({'where':{'id':_0x410ef3[_0xd81b('0x46')]['id']}})[_0xd81b('0x24')](handleEntityNotFound(_0xa176d3,null))[_0xd81b('0x24')](saveUpdates(_0x410ef3['body'],null))[_0xd81b('0x24')](respondWithResult(_0xa176d3,null))[_0xd81b('0x45')](handleError(_0xa176d3,null));};exports[_0xd81b('0x25')]=function(_0xe874b6,_0x2699e6){return db[_0xd81b('0x40')][_0xd81b('0x49')]({'where':{'id':_0xe874b6[_0xd81b('0x46')]['id']}})[_0xd81b('0x24')](handleEntityNotFound(_0x2699e6,null))['then'](removeEntity(_0x2699e6,null))['catch'](handleError(_0x2699e6,null));};exports[_0xd81b('0x4d')]=function(_0x2872d3,_0x9ad62){return db[_0xd81b('0x40')][_0xd81b('0x4d')]()[_0xd81b('0x24')](respondWithResult(_0x9ad62,null))[_0xd81b('0x45')](handleError(_0x9ad62,null));};exports[_0xd81b('0x4e')]=function(_0x4e039e,_0x2db83b,_0x34706d){var _0x1b523c=require(_0xd81b('0x4f'));var _0x4651d3=![];var _0x59b13b={};if(_0x4e039e[_0xd81b('0x2f')][_0xd81b('0x3d')]&&_0x4e039e['query'][_0xd81b('0x3d')]===_0xd81b('0x50')){_0x59b13b[_0xd81b('0x50')]=_0x4e039e[_0xd81b('0x46')]['id'];}else{_0x59b13b['id']=_0x4e039e[_0xd81b('0x46')]['id'];}return db[_0xd81b('0x40')][_0xd81b('0x49')]({'where':_0x59b13b,'attributes':['id',_0xd81b('0x51')],'raw':!![]})[_0xd81b('0x24')](handleEntityNotFound(_0x2db83b,null))[_0xd81b('0x24')](function(_0x2fa737){if(_0x2fa737){var _0x51b4a9=_0x2fa737[_0xd81b('0x51')];var _0x56ee22=util[_0xd81b('0x2e')](_0xd81b('0x52'),_0x51b4a9);if(fs[_0xd81b('0x53')](_0x56ee22)){_0x4651d3=!![];return _0x1b523c[_0xd81b('0x54')](_0x56ee22,_0x51b4a9,config[_0xd81b('0x55')][_0xd81b('0x56')])['then'](function(){return _0x2fa737;});}return _0x2fa737;}})[_0xd81b('0x24')](function(_0xe0c9c6){if(_0xe0c9c6){var _0x51f5a1=_0xe0c9c6['value'];if(!fs[_0xd81b('0x53')](_0x51f5a1)){throw new db['Sequelize'][(_0xd81b('0x57'))]('VoiceRecording\x20not\x20found');}if(_0xe0c9c6[_0xd81b('0x58')]){return _0x2db83b[_0xd81b('0x4e')](_0x51f5a1,_0xe0c9c6[_0xd81b('0x58')]+path['extname'](_0x51f5a1),function(){if(_0x4651d3){fs[_0xd81b('0x59')](_0x51f5a1);}});}else{return _0x2db83b[_0xd81b('0x4e')](_0x51f5a1,function(_0x5b7b64){if(_0x4651d3){fs[_0xd81b('0x59')](_0x51f5a1);}});}}})[_0xd81b('0x45')](function(_0x5951ec){if(_0x5951ec[_0xd81b('0x5a')]==='VoiceRecording\x20not\x20found'){_0x2db83b[_0xd81b('0x19')](0x194)[_0xd81b('0x2a')](_0xd81b('0x5b'));}else{return handleError(_0x2db83b,null);}});};exports[_0xd81b('0x5c')]=function(_0x4add79,_0x32eab4,_0x2f2afe){var _0x24dfce=require(_0xd81b('0x4f'));var _0x209102=![];var _0x5c4533={'$and':[db[_0xd81b('0x5d')][_0xd81b('0x39')](db[_0xd81b('0x5d')]['fn'](_0xd81b('0x5e'),db[_0xd81b('0x5d')][_0xd81b('0x5f')](_0xd81b('0x50'))),_0x4add79['query']['token'])]};if(_0x4add79['query'][_0xd81b('0x3d')]&&_0x4add79[_0xd81b('0x2f')][_0xd81b('0x3d')]===_0xd81b('0x50')){_0x5c4533[_0xd81b('0x60')][_0xd81b('0x61')]({'uniqueid':_0x4add79[_0xd81b('0x46')]['id']});}else{_0x5c4533['$and'][_0xd81b('0x61')]({'id':_0x4add79[_0xd81b('0x46')]['id']});}return db[_0xd81b('0x40')][_0xd81b('0x49')]({'where':_0x5c4533,'attributes':['id',_0xd81b('0x51')],'raw':!![]})[_0xd81b('0x24')](handleEntityNotFound(_0x32eab4,null))[_0xd81b('0x24')](function(_0x4ed17d){if(_0x4ed17d){var _0x14b187=util[_0xd81b('0x2e')](_0xd81b('0x52'),_0x4ed17d[_0xd81b('0x51')]);if(fs[_0xd81b('0x53')](_0x14b187)){_0x209102=!![];return _0x24dfce[_0xd81b('0x54')](_0x14b187,_0x4ed17d[_0xd81b('0x51')],config[_0xd81b('0x55')][_0xd81b('0x56')])[_0xd81b('0x24')](function(){return _0x4ed17d;});}return _0x4ed17d;}})[_0xd81b('0x24')](function(_0x43d40d){if(_0x43d40d){if(!fs['existsSync'](_0x43d40d[_0xd81b('0x51')])){throw new db['Sequelize'][(_0xd81b('0x57'))](_0xd81b('0x62'));}if(_0x43d40d[_0xd81b('0x58')]){return _0x32eab4[_0xd81b('0x4e')](_0x43d40d[_0xd81b('0x51')],_0x43d40d[_0xd81b('0x58')]+path[_0xd81b('0x63')](_0x43d40d[_0xd81b('0x51')]),function(){if(_0x209102){fs[_0xd81b('0x59')](_0x43d40d[_0xd81b('0x51')]);}});}else{return _0x32eab4['download'](_0x43d40d[_0xd81b('0x51')],function(_0x344c32){if(_0x209102){fs[_0xd81b('0x59')](_0x43d40d[_0xd81b('0x51')]);}});}}})[_0xd81b('0x45')](handleError(_0x32eab4,null));}; \ No newline at end of file +var _0x008c=['findAll','rows','show','params','merge','find','catch','create','update','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','extname','unlink','Not\x20found','sequelize','col','token','$and','push','ValidationError','filename','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','apply','destroy','then','end','error','send','index','VoiceRecording','rawAttributes','model','keys','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','map','type','key','field','includeAll','include'];(function(_0x469e92,_0x3520b2){var _0x5c2d1c=function(_0x3082cc){while(--_0x3082cc){_0x469e92['push'](_0x469e92['shift']());}};_0x5c2d1c(++_0x3520b2);}(_0x008c,0x188));var _0xc008=function(_0x4ec3ab,_0x50a5de){_0x4ec3ab=_0x4ec3ab-0x0;var _0x229613=_0x008c[_0x4ec3ab];return _0x229613;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');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 hardwareService=require('../../config/license/hardware');var logger=require(_0xc008('0x12'))(_0xc008('0x13'));var utils=require('../../config/utils');var config=require(_0xc008('0x14'));var db=require(_0xc008('0x15'))['db'];function respondWithStatusCode(_0x2ea200,_0x2a5b4e){_0x2a5b4e=_0x2a5b4e||0xcc;return function(_0x9ffa93){if(_0x9ffa93){return _0x2ea200[_0xc008('0x16')](_0x2a5b4e);}return _0x2ea200[_0xc008('0x17')](_0x2a5b4e)['end']();};}function respondWithResult(_0x560e28,_0x33f44c){_0x33f44c=_0x33f44c||0xc8;return function(_0x50c1ab){if(_0x50c1ab){return _0x560e28[_0xc008('0x17')](_0x33f44c)[_0xc008('0x18')](_0x50c1ab);}};}function respondWithFilteredResult(_0x2073ef,_0x339ffc){return function(_0x3f0ecf){if(_0x3f0ecf){var _0x5ee00b=_0x3f0ecf[_0xc008('0x19')],_0x5e894e=_0x339ffc[_0xc008('0x1a')],_0x4bd0f4=_0x339ffc[_0xc008('0x1a')]+_0x339ffc['limit'],_0x11ef38;if(_0x4bd0f4>=_0x5ee00b){_0x4bd0f4=_0x5ee00b;_0x11ef38=0xc8;}else{_0x11ef38=0xce;}_0x2073ef['status'](_0x11ef38);return _0x2073ef['set']('Content-Range',_0x5e894e+'-'+_0x4bd0f4+'/'+_0x5ee00b)[_0xc008('0x18')](_0x3f0ecf);}return null;};}function patchUpdates(_0x462af5){return function(_0x501137){try{jsonpatch[_0xc008('0x1b')](_0x501137,_0x462af5,!![]);}catch(_0x5906e6){return BPromise['reject'](_0x5906e6);}return _0x501137['save']();};}function saveUpdates(_0x50261c,_0x5754a0){return function(_0x4b9726){if(_0x4b9726){return _0x4b9726['update'](_0x50261c)['then'](function(_0x4a582d){return _0x4a582d;});}return null;};}function removeEntity(_0x5a58bd,_0x13a263){return function(_0x4777a6){if(_0x4777a6){return _0x4777a6[_0xc008('0x1c')]()[_0xc008('0x1d')](function(){_0x5a58bd[_0xc008('0x17')](0xcc)[_0xc008('0x1e')]();});}};}function handleEntityNotFound(_0x4f43e2,_0x459fd9){return function(_0x5c85f2){if(!_0x5c85f2){_0x4f43e2['sendStatus'](0x194);}return _0x5c85f2;};}function handleError(_0x218599,_0x36f358){_0x36f358=_0x36f358||0x1f4;return function(_0x2e3cfb){logger[_0xc008('0x1f')](_0x2e3cfb['stack']);if(_0x2e3cfb['name']){delete _0x2e3cfb['name'];}_0x218599[_0xc008('0x17')](_0x36f358)[_0xc008('0x20')](_0x2e3cfb);};}exports[_0xc008('0x21')]=function(_0x2e31c2,_0x5bebd9){var _0x5e2aca={},_0x4fce9c={},_0x4adbab={'count':0x0,'rows':[]};var _0x4caaf4=db[_0xc008('0x22')][_0xc008('0x23')];_0x4fce9c[_0xc008('0x24')]=_['differenceBy'](_[_0xc008('0x25')](_0x4caaf4),[_0xc008('0x26')]);_0x4fce9c[_0xc008('0x27')]=_[_0xc008('0x25')](_0x2e31c2['query']);_0x4fce9c[_0xc008('0x28')]=_[_0xc008('0x29')](_0x4fce9c['model'],_0x4fce9c['query']);_0x5e2aca['attributes']=_[_0xc008('0x29')](_0x4fce9c[_0xc008('0x24')],qs[_0xc008('0x2a')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x2a')]));_0x5e2aca[_0xc008('0x2b')]=_0x5e2aca[_0xc008('0x2b')][_0xc008('0x2c')]?_0x5e2aca[_0xc008('0x2b')]:_0x4fce9c[_0xc008('0x24')];if(!_0x2e31c2[_0xc008('0x27')][_0xc008('0x2d')]('nolimit')){_0x5e2aca[_0xc008('0x2e')]=qs[_0xc008('0x2e')](_0x2e31c2['query'][_0xc008('0x2e')]);_0x5e2aca[_0xc008('0x1a')]=qs[_0xc008('0x1a')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x1a')]);}_0x5e2aca[_0xc008('0x2f')]=qs[_0xc008('0x30')](_0x2e31c2[_0xc008('0x27')][_0xc008('0x30')]);_0x5e2aca['where']=qs[_0xc008('0x28')](_[_0xc008('0x31')](_0x2e31c2[_0xc008('0x27')],_0x4fce9c[_0xc008('0x28')]));if(_0x2e31c2[_0xc008('0x27')][_0xc008('0x32')]){_0x5e2aca[_0xc008('0x33')]=_['merge'](_0x5e2aca[_0xc008('0x33')],{'$or':_[_0xc008('0x34')](_0x4caaf4,function(_0x50e1d4){if(_0x50e1d4[_0xc008('0x35')][_0xc008('0x36')]!=='VIRTUAL'){var _0x263473={};_0x263473[_0x50e1d4[_0xc008('0x37')]]={'$like':'%'+_0x2e31c2[_0xc008('0x27')]['filter']+'%'};return _0x263473;}})});}_0x5e2aca=_['merge']({},_0x5e2aca,_0x2e31c2['options']);var _0x234f2a={'where':_0x5e2aca['where']};return db[_0xc008('0x22')][_0xc008('0x19')](_0x234f2a)[_0xc008('0x1d')](function(_0x440459){_0x4adbab[_0xc008('0x19')]=_0x440459;if(_0x2e31c2[_0xc008('0x27')][_0xc008('0x38')]){_0x5e2aca[_0xc008('0x39')]=[{'all':!![]}];}return db[_0xc008('0x22')][_0xc008('0x3a')](_0x5e2aca);})[_0xc008('0x1d')](function(_0xdfca2e){_0x4adbab[_0xc008('0x3b')]=_0xdfca2e;return _0x4adbab;})[_0xc008('0x1d')](respondWithFilteredResult(_0x5bebd9,_0x5e2aca))['catch'](handleError(_0x5bebd9,null));};exports[_0xc008('0x3c')]=function(_0x23c4db,_0x30b7df){var _0x2e98e5={'raw':![],'where':{'id':_0x23c4db[_0xc008('0x3d')]['id']}},_0x49a16d={};_0x49a16d[_0xc008('0x24')]=_[_0xc008('0x25')](db[_0xc008('0x22')][_0xc008('0x23')]);_0x49a16d['query']=_[_0xc008('0x25')](_0x23c4db[_0xc008('0x27')]);_0x49a16d[_0xc008('0x28')]=_[_0xc008('0x29')](_0x49a16d[_0xc008('0x24')],_0x49a16d['query']);_0x2e98e5[_0xc008('0x2b')]=_[_0xc008('0x29')](_0x49a16d[_0xc008('0x24')],qs[_0xc008('0x2a')](_0x23c4db['query'][_0xc008('0x2a')]));_0x2e98e5[_0xc008('0x2b')]=_0x2e98e5[_0xc008('0x2b')]['length']?_0x2e98e5[_0xc008('0x2b')]:_0x49a16d['model'];if(_0x23c4db[_0xc008('0x27')]['includeAll']){_0x2e98e5[_0xc008('0x39')]=[{'all':!![]}];}_0x2e98e5=_[_0xc008('0x3e')]({},_0x2e98e5,_0x23c4db['options']);return db[_0xc008('0x22')][_0xc008('0x3f')](_0x2e98e5)[_0xc008('0x1d')](handleEntityNotFound(_0x30b7df,null))['then'](respondWithResult(_0x30b7df,null))[_0xc008('0x40')](handleError(_0x30b7df,null));};exports[_0xc008('0x41')]=function(_0x200469,_0x44fc5d){return db[_0xc008('0x22')][_0xc008('0x41')](_0x200469['body'],{})['then'](respondWithResult(_0x44fc5d,0xc9))['catch'](handleError(_0x44fc5d,null));};exports[_0xc008('0x42')]=function(_0x36417a,_0x103a83){if(_0x36417a[_0xc008('0x43')]['id']){delete _0x36417a[_0xc008('0x43')]['id'];}return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':{'id':_0x36417a[_0xc008('0x3d')]['id']}})['then'](handleEntityNotFound(_0x103a83,null))['then'](saveUpdates(_0x36417a['body'],null))[_0xc008('0x1d')](respondWithResult(_0x103a83,null))[_0xc008('0x40')](handleError(_0x103a83,null));};exports[_0xc008('0x1c')]=function(_0x511383,_0x28bc33){return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':{'id':_0x511383[_0xc008('0x3d')]['id']}})[_0xc008('0x1d')](handleEntityNotFound(_0x28bc33,null))[_0xc008('0x1d')](removeEntity(_0x28bc33,null))[_0xc008('0x40')](handleError(_0x28bc33,null));};exports[_0xc008('0x44')]=function(_0x3fd7d9,_0x3965b7){return db['VoiceRecording']['describe']()[_0xc008('0x1d')](respondWithResult(_0x3965b7,null))['catch'](handleError(_0x3965b7,null));};exports[_0xc008('0x45')]=function(_0x36e6f8,_0x201e52,_0x5598fa){var _0x144ab2=require(_0xc008('0x46'));var _0xee64=![];var _0x8b9775={};if(_0x36e6f8[_0xc008('0x27')]['type']&&_0x36e6f8[_0xc008('0x27')][_0xc008('0x35')]==='uniqueid'){_0x8b9775[_0xc008('0x47')]=_0x36e6f8[_0xc008('0x3d')]['id'];}else{_0x8b9775['id']=_0x36e6f8['params']['id'];}return db['VoiceRecording'][_0xc008('0x3f')]({'where':_0x8b9775,'attributes':['id',_0xc008('0x48')],'raw':!![]})[_0xc008('0x1d')](handleEntityNotFound(_0x201e52,null))[_0xc008('0x1d')](function(_0x14b6a0){if(_0x14b6a0){var _0x588b60=_0x14b6a0['value'];var _0x34b72a=util['format'](_0xc008('0x49'),_0x588b60);if(fs[_0xc008('0x4a')](_0x34b72a)){_0xee64=!![];return _0x144ab2[_0xc008('0x4b')](_0x34b72a,_0x588b60,config[_0xc008('0x4c')][_0xc008('0x4d')])[_0xc008('0x1d')](function(){return _0x14b6a0;});}return _0x14b6a0;}})['then'](function(_0x2ea742){if(_0x2ea742){var _0xbd7422=_0x2ea742[_0xc008('0x48')];if(!fs[_0xc008('0x4a')](_0xbd7422)){throw new db[(_0xc008('0x4e'))]['ValidationError'](_0xc008('0x4f'));}if(_0x2ea742['filename']){return _0x201e52['download'](_0xbd7422,_0x2ea742['filename']+path[_0xc008('0x50')](_0xbd7422),function(){if(_0xee64){fs[_0xc008('0x51')](_0xbd7422);}});}else{return _0x201e52[_0xc008('0x45')](_0xbd7422,function(_0x5f58d7){if(_0xee64){fs[_0xc008('0x51')](_0xbd7422);}});}}})[_0xc008('0x40')](function(_0x3dda82){if(_0x3dda82['message']===_0xc008('0x4f')){_0x201e52[_0xc008('0x17')](0x194)[_0xc008('0x20')](_0xc008('0x52'));}else{return handleError(_0x201e52,null);}});};exports['downloads']=function(_0x4022dd,_0x4eaa6d,_0x23ef33){var _0x422e1f=require(_0xc008('0x46'));var _0x943c91=![];var _0x192c87={'$and':[db[_0xc008('0x53')]['where'](db[_0xc008('0x53')]['fn']('MD5',db['sequelize'][_0xc008('0x54')](_0xc008('0x47'))),_0x4022dd['query'][_0xc008('0x55')])]};if(_0x4022dd[_0xc008('0x27')][_0xc008('0x35')]&&_0x4022dd[_0xc008('0x27')][_0xc008('0x35')]===_0xc008('0x47')){_0x192c87[_0xc008('0x56')]['push']({'uniqueid':_0x4022dd[_0xc008('0x3d')]['id']});}else{_0x192c87[_0xc008('0x56')][_0xc008('0x57')]({'id':_0x4022dd[_0xc008('0x3d')]['id']});}return db[_0xc008('0x22')][_0xc008('0x3f')]({'where':_0x192c87,'attributes':['id',_0xc008('0x48')],'raw':!![]})[_0xc008('0x1d')](handleEntityNotFound(_0x4eaa6d,null))[_0xc008('0x1d')](function(_0x37d193){if(_0x37d193){var _0x1bef66=util[_0xc008('0x26')](_0xc008('0x49'),_0x37d193[_0xc008('0x48')]);if(fs['existsSync'](_0x1bef66)){_0x943c91=!![];return _0x422e1f[_0xc008('0x4b')](_0x1bef66,_0x37d193[_0xc008('0x48')],config[_0xc008('0x4c')]['recording'])[_0xc008('0x1d')](function(){return _0x37d193;});}return _0x37d193;}})[_0xc008('0x1d')](function(_0x5e76d8){if(_0x5e76d8){if(!fs['existsSync'](_0x5e76d8[_0xc008('0x48')])){throw new db[(_0xc008('0x4e'))][(_0xc008('0x58'))](_0xc008('0x4f'));}if(_0x5e76d8[_0xc008('0x59')]){return _0x4eaa6d[_0xc008('0x45')](_0x5e76d8[_0xc008('0x48')],_0x5e76d8[_0xc008('0x59')]+path[_0xc008('0x50')](_0x5e76d8[_0xc008('0x48')]),function(){if(_0x943c91){fs[_0xc008('0x51')](_0x5e76d8['value']);}});}else{return _0x4eaa6d[_0xc008('0x45')](_0x5e76d8[_0xc008('0x48')],function(_0xfdb5e3){if(_0x943c91){fs[_0xc008('0x51')](_0x5e76d8['value']);}});}}})[_0xc008('0x40')](handleError(_0x4eaa6d,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index b0f27b0..a1ac027 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 _0xec83=['moment','bluebird','request-promise','path','./voiceRecording.attributes','exports','define','uniqueid','util','api'];(function(_0x59d546,_0x107f05){var _0x41fbdb=function(_0x413e68){while(--_0x413e68){_0x59d546['push'](_0x59d546['shift']());}};_0x41fbdb(++_0x107f05);}(_0xec83,0x184));var _0x3ec8=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0xec83[_0x486f4a];return _0x135d99;};'use strict';var _=require('lodash');var util=require(_0x3ec8('0x0'));var logger=require('../../config/logger')(_0x3ec8('0x1'));var moment=require(_0x3ec8('0x2'));var BPromise=require(_0x3ec8('0x3'));var rp=require(_0x3ec8('0x4'));var fs=require('fs');var path=require(_0x3ec8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3ec8('0x6'));module[_0x3ec8('0x7')]=function(_0x2f98e4,_0x532cc3){return _0x2f98e4[_0x3ec8('0x8')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3ec8('0x9'),'fields':[_0x3ec8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x427f=['exports','define','VoiceRecording','uniqueid','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceRecording.attributes'];(function(_0x131e3f,_0x42e89e){var _0x19912d=function(_0x32e947){while(--_0x32e947){_0x131e3f['push'](_0x131e3f['shift']());}};_0x19912d(++_0x42e89e);}(_0x427f,0x122));var _0xf427=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x427f[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf427('0x0'))('api');var moment=require(_0xf427('0x1'));var BPromise=require(_0xf427('0x2'));var rp=require(_0xf427('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf427('0x4'));var config=require(_0xf427('0x5'));var attributes=require(_0xf427('0x6'));module[_0xf427('0x7')]=function(_0x126107,_0x461d3a){return _0x126107[_0xf427('0x8')](_0xf427('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0xf427('0xa'),'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 d0f56a7..8e1d802 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 _0xe2df=['stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','format','%s.cypher','value','recording','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2df,0xec));var _0xfe2d=function(_0x281860,_0x1cd372){_0x281860=_0x281860-0x0;var _0x3cb96d=_0xe2df[_0x281860];return _0x3cb96d;};'use strict';var _=require(_0xfe2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfe2d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfe2d('0x3'));var logger=require(_0xfe2d('0x4'))('rpc');var config=require(_0xfe2d('0x5'));var jayson=require(_0xfe2d('0x6'));var client=jayson[_0xfe2d('0x7')][_0xfe2d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e76ab,_0x6e179a,_0x2af59f){return new BPromise(function(_0x46ba61,_0x3f69fe){return client[_0xfe2d('0x9')](_0x3e76ab,_0x2af59f)[_0xfe2d('0xa')](function(_0x2e59f4){logger[_0xfe2d('0xb')](_0xfe2d('0xc'),_0x6e179a,_0xfe2d('0xd'));logger[_0xfe2d('0xe')](_0xfe2d('0xf'),_0x6e179a,_0xfe2d('0xd'),JSON[_0xfe2d('0x10')](_0x2e59f4));if(_0x2e59f4[_0xfe2d('0x11')]){if(_0x2e59f4[_0xfe2d('0x11')][_0xfe2d('0x12')]===0x1f4){logger[_0xfe2d('0x11')](_0xfe2d('0xc'),_0x6e179a,_0x2e59f4['error'][_0xfe2d('0x13')]);return _0x3f69fe(_0x2e59f4[_0xfe2d('0x11')][_0xfe2d('0x13')]);}logger[_0xfe2d('0x11')](_0xfe2d('0xc'),_0x6e179a,_0x2e59f4['error'][_0xfe2d('0x13')]);return _0x46ba61(_0x2e59f4[_0xfe2d('0x11')][_0xfe2d('0x13')]);}else{logger['info']('VoiceRecording,\x20%s,\x20%s',_0x6e179a,'request\x20sent');_0x46ba61(_0x2e59f4[_0xfe2d('0x14')]['message']);}})[_0xfe2d('0x15')](function(_0x44d93c){logger[_0xfe2d('0x11')]('VoiceRecording,\x20%s,\x20%s',_0x6e179a,_0x44d93c);_0x3f69fe(_0x44d93c);});});}exports[_0xfe2d('0x16')]=function(_0x136d6d){var _0x5f2923=this;return new Promise(function(_0x253bdf,_0x32e3df){return db[_0xfe2d('0x17')][_0xfe2d('0x18')](_0x136d6d[_0xfe2d('0x19')],{'raw':_0x136d6d[_0xfe2d('0x1a')]?_0x136d6d['options'][_0xfe2d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x136d6d['options']?_0x136d6d[_0xfe2d('0x1a')][_0xfe2d('0x1c')]||null:null,'attributes':_0x136d6d[_0xfe2d('0x1a')]?_0x136d6d[_0xfe2d('0x1a')][_0xfe2d('0x1d')]||null:null,'limit':_0x136d6d[_0xfe2d('0x1a')]?_0x136d6d[_0xfe2d('0x1a')]['limit']||null:null})[_0xfe2d('0xa')](function(_0x4b2cf7){logger[_0xfe2d('0xb')]('UpdateVoiceRecording',_0x136d6d);logger[_0xfe2d('0xe')]('UpdateVoiceRecording',_0x136d6d,JSON[_0xfe2d('0x10')](_0x4b2cf7));_0x253bdf(_0x4b2cf7);})[_0xfe2d('0x15')](function(_0x880071){logger[_0xfe2d('0x11')](_0xfe2d('0x16'),_0x880071['message'],_0x136d6d);_0x32e3df(_0x5f2923['error'](0x1f4,_0x880071[_0xfe2d('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x5720d6){var _0x5d42e0=this;return new Promise(function(_0x1078b4,_0x503c2f){var _0xf62ebd=require(_0xfe2d('0x1e'));var _0x212aa0;return db[_0xfe2d('0x1f')][_0xfe2d('0x20')]({'attributes':['id',_0xfe2d('0x21')],'where':{'id':0x1},'raw':!![]})[_0xfe2d('0xa')](function(_0x33d4cc){_0x212aa0=_0x33d4cc;return db[_0xfe2d('0x17')][_0xfe2d('0x22')](_0x5720d6['body']);})[_0xfe2d('0xa')](function(_0x45e65c){if(_0x212aa0[_0xfe2d('0x21')]&&fs[_0xfe2d('0x23')](_0x45e65c['value'])){var _0xfe6682=util[_0xfe2d('0x24')](_0xfe2d('0x25'),_0x45e65c[_0xfe2d('0x26')]);return _0xf62ebd['encryptFile'](_0x45e65c['value'],_0xfe6682,config['secrets'][_0xfe2d('0x27')])[_0xfe2d('0xa')](function(){fs['unlink'](_0x45e65c['value']);logger[_0xfe2d('0xb')](_0xfe2d('0x28'));return _0x45e65c;});}return _0x45e65c;})[_0xfe2d('0xa')](function(_0x396d39){logger[_0xfe2d('0xb')](_0xfe2d('0x29'),_0x5720d6);logger[_0xfe2d('0xe')]('CreateVoiceRecording',_0x5720d6,JSON[_0xfe2d('0x10')](_0x396d39));_0x1078b4(_0x396d39);})['catch'](function(_0x29eb77){logger[_0xfe2d('0x11')]('CreateVoiceRecording',_0x29eb77[_0xfe2d('0x13')],_0x5720d6);_0x503c2f(_0x5d42e0[_0xfe2d('0x11')](0x1f4,_0x29eb77[_0xfe2d('0x13')]));});});}; \ No newline at end of file +var _0x5f9d=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','limit','Setting','findOne','VoiceRecording','create','callRecordingEncryption','existsSync','value','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','util'];(function(_0x4e7987,_0x2b665b){var _0x153cbe=function(_0x579a4d){while(--_0x579a4d){_0x4e7987['push'](_0x4e7987['shift']());}};_0x153cbe(++_0x2b665b);}(_0x5f9d,0x1df));var _0xd5f9=function(_0x1c583,_0x2b75d5){_0x1c583=_0x1c583-0x0;var _0x2cc901=_0x5f9d[_0x1c583];return _0x2cc901;};'use strict';var _=require('lodash');var util=require(_0xd5f9('0x0'));var moment=require(_0xd5f9('0x1'));var BPromise=require(_0xd5f9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5f9('0x3'))['db'];var utils=require(_0xd5f9('0x4'));var logger=require(_0xd5f9('0x5'))('rpc');var config=require(_0xd5f9('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd5f9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3f11c3,_0x11ea28,_0x3a6309){return new BPromise(function(_0x13eba9,_0x37c127){return client['request'](_0x3f11c3,_0x3a6309)[_0xd5f9('0x8')](function(_0x31d262){logger[_0xd5f9('0x9')](_0xd5f9('0xa'),_0x11ea28,_0xd5f9('0xb'));logger[_0xd5f9('0xc')](_0xd5f9('0xd'),_0x11ea28,_0xd5f9('0xb'),JSON[_0xd5f9('0xe')](_0x31d262));if(_0x31d262[_0xd5f9('0xf')]){if(_0x31d262[_0xd5f9('0xf')][_0xd5f9('0x10')]===0x1f4){logger[_0xd5f9('0xf')](_0xd5f9('0xa'),_0x11ea28,_0x31d262[_0xd5f9('0xf')][_0xd5f9('0x11')]);return _0x37c127(_0x31d262[_0xd5f9('0xf')]['message']);}logger[_0xd5f9('0xf')](_0xd5f9('0xa'),_0x11ea28,_0x31d262['error'][_0xd5f9('0x11')]);return _0x13eba9(_0x31d262[_0xd5f9('0xf')][_0xd5f9('0x11')]);}else{logger[_0xd5f9('0x9')](_0xd5f9('0xa'),_0x11ea28,_0xd5f9('0xb'));_0x13eba9(_0x31d262['result'][_0xd5f9('0x11')]);}})[_0xd5f9('0x12')](function(_0x411db6){logger[_0xd5f9('0xf')](_0xd5f9('0xa'),_0x11ea28,_0x411db6);_0x37c127(_0x411db6);});});}exports[_0xd5f9('0x13')]=function(_0x530428){var _0x5cc791=this;return new Promise(function(_0x50f061,_0x517b9b){return db['VoiceRecording'][_0xd5f9('0x14')](_0x530428[_0xd5f9('0x15')],{'raw':_0x530428['options']?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x530428[_0xd5f9('0x16')]?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x18')]||null:null,'attributes':_0x530428['options']?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x19')]||null:null,'limit':_0x530428[_0xd5f9('0x16')]?_0x530428[_0xd5f9('0x16')][_0xd5f9('0x1a')]||null:null})[_0xd5f9('0x8')](function(_0xc6e845){logger['info'](_0xd5f9('0x13'),_0x530428);logger[_0xd5f9('0xc')](_0xd5f9('0x13'),_0x530428,JSON['stringify'](_0xc6e845));_0x50f061(_0xc6e845);})[_0xd5f9('0x12')](function(_0x1b152f){logger[_0xd5f9('0xf')](_0xd5f9('0x13'),_0x1b152f[_0xd5f9('0x11')],_0x530428);_0x517b9b(_0x5cc791[_0xd5f9('0xf')](0x1f4,_0x1b152f[_0xd5f9('0x11')]));});});};exports['CreateVoiceRecording']=function(_0x2fc338){var _0x2ea21b=this;return new Promise(function(_0x4c3cd9,_0x13d991){var _0x5d41ec=require('../../components/encryptor');var _0x118dd5;return db[_0xd5f9('0x1b')][_0xd5f9('0x1c')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0xe11413){_0x118dd5=_0xe11413;return db[_0xd5f9('0x1d')][_0xd5f9('0x1e')](_0x2fc338['body']);})[_0xd5f9('0x8')](function(_0x2fb7f6){if(_0x118dd5[_0xd5f9('0x1f')]&&fs[_0xd5f9('0x20')](_0x2fb7f6[_0xd5f9('0x21')])){var _0x39baa8=util['format'](_0xd5f9('0x22'),_0x2fb7f6[_0xd5f9('0x21')]);return _0x5d41ec['encryptFile'](_0x2fb7f6[_0xd5f9('0x21')],_0x39baa8,config[_0xd5f9('0x23')][_0xd5f9('0x24')])[_0xd5f9('0x8')](function(){fs[_0xd5f9('0x25')](_0x2fb7f6[_0xd5f9('0x21')]);logger['info'](_0xd5f9('0x26'));return _0x2fb7f6;});}return _0x2fb7f6;})[_0xd5f9('0x8')](function(_0x6db563){logger[_0xd5f9('0x9')](_0xd5f9('0x27'),_0x2fc338);logger['debug'](_0xd5f9('0x27'),_0x2fc338,JSON[_0xd5f9('0xe')](_0x6db563));_0x4c3cd9(_0x6db563);})[_0xd5f9('0x12')](function(_0x28c596){logger['error']('CreateVoiceRecording',_0x28c596[_0xd5f9('0x11')],_0x2fc338);_0x13d991(_0x2ea21b[_0xd5f9('0xf')](0x1f4,_0x28c596['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 395737f..9bc9b0c 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 _0x9906=['get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','isAuthenticated','index'];(function(_0x36328f,_0x47b04d){var _0x5543f5=function(_0x4fca6b){while(--_0x4fca6b){_0x36328f['push'](_0x36328f['shift']());}};_0x5543f5(++_0x47b04d);}(_0x9906,0x1b9));var _0x6990=function(_0x53c7db,_0x293366){_0x53c7db=_0x53c7db-0x0;var _0x47734a=_0x9906[_0x53c7db];return _0x47734a;};'use strict';var multer=require(_0x6990('0x0'));var util=require(_0x6990('0x1'));var path=require(_0x6990('0x2'));var timeout=require('connect-timeout');var express=require(_0x6990('0x3'));var router=express['Router']();var auth=require(_0x6990('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6990('0x5'));var controller=require(_0x6990('0x6'));router['get']('/',auth[_0x6990('0x7')](),controller[_0x6990('0x8')]);router[_0x6990('0x9')](_0x6990('0xa'),auth[_0x6990('0x7')](),controller['show']);router[_0x6990('0xb')]('/',auth[_0x6990('0x7')](),controller[_0x6990('0xc')]);router[_0x6990('0xd')](_0x6990('0xa'),auth[_0x6990('0x7')](),controller[_0x6990('0xe')]);router[_0x6990('0xf')](_0x6990('0xa'),auth['isAuthenticated'](),controller[_0x6990('0x10')]);module[_0x6990('0x11')]=router; \ No newline at end of file +var _0x6579=['../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x121976,_0x1f5e72){var _0x5e3b46=function(_0x1b68b8){while(--_0x1b68b8){_0x121976['push'](_0x121976['shift']());}};_0x5e3b46(++_0x1f5e72);}(_0x6579,0x126));var _0x9657=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6579[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9657('0x0'));var util=require(_0x9657('0x1'));var path=require(_0x9657('0x2'));var timeout=require(_0x9657('0x3'));var express=require(_0x9657('0x4'));var router=express['Router']();var auth=require(_0x9657('0x5'));var interaction=require(_0x9657('0x6'));var config=require(_0x9657('0x7'));var controller=require(_0x9657('0x8'));router[_0x9657('0x9')]('/',auth['isAuthenticated'](),controller[_0x9657('0xa')]);router[_0x9657('0x9')]('/:id',auth[_0x9657('0xb')](),controller[_0x9657('0xc')]);router[_0x9657('0xd')]('/',auth['isAuthenticated'](),controller[_0x9657('0xe')]);router[_0x9657('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9657('0x10')]);router[_0x9657('0x11')](_0x9657('0x12'),auth[_0x9657('0xb')](),controller['destroy']);module[_0x9657('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 229f1f6..0271b2a 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 _0x2c33=['Yes','sequelize','moment','ENUM','attended','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2c33,0x103));var _0x32c3=function(_0x51665f,_0x461422){_0x51665f=_0x51665f-0x0;var _0x1f393f=_0x2c33[_0x51665f];return _0x1f393f;};'use strict';var Sequelize=require(_0x32c3('0x0'));var moment=require(_0x32c3('0x1'));module['exports']={'type':{'type':Sequelize[_0x32c3('0x2')]('blind',_0x32c3('0x3'))},'result':{'type':Sequelize[_0x32c3('0x4')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x32c3('0x4')]},'transferercalleridname':{'type':Sequelize[_0x32c3('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x32c3('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x32c3('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x32c3('0x4')]},'transfererexten':{'type':Sequelize[_0x32c3('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x32c3('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x32c3('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x32c3('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x32c3('0x4')]},'transfereecontext':{'type':Sequelize[_0x32c3('0x4')]},'transfereeexten':{'type':Sequelize[_0x32c3('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x32c3('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x32c3('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x32c3('0x4')]}}; \ No newline at end of file +var _0x1ad1=['sequelize','moment','ENUM','blind','attended','STRING','Yes'];(function(_0x3ec7d8,_0x3006b4){var _0x2b1a23=function(_0xe7d9f){while(--_0xe7d9f){_0x3ec7d8['push'](_0x3ec7d8['shift']());}};_0x2b1a23(++_0x3006b4);}(_0x1ad1,0x1ea));var _0x11ad=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1ad1[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x11ad('0x0'));var moment=require(_0x11ad('0x1'));module['exports']={'type':{'type':Sequelize[_0x11ad('0x2')](_0x11ad('0x3'),_0x11ad('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize[_0x11ad('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x11ad('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x11ad('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x11ad('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x11ad('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x11ad('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x11ad('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x11ad('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x11ad('0x5')]},'transfereecontext':{'type':Sequelize[_0x11ad('0x5')]},'transfereeexten':{'type':Sequelize[_0x11ad('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x11ad('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x11ad('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x11ad('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 6b9dbf8..5e2de0b 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 _0x2217=['moment','bluebird','mustache','path','to-csv','ejs','crypto','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','key','VIRTUAL','field','options','VoiceTransferReport','count','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','html-pdf','rimraf','fast-json-patch'];(function(_0x19952b,_0x5038c6){var _0x5c27ee=function(_0x4b061a){while(--_0x4b061a){_0x19952b['push'](_0x19952b['shift']());}};_0x5c27ee(++_0x5038c6);}(_0x2217,0x111));var _0x7221=function(_0x5a70e7,_0x4b985a){_0x5a70e7=_0x5a70e7-0x0;var _0x40073d=_0x2217[_0x5a70e7];return _0x40073d;};'use strict';var pdf=require(_0x7221('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7221('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7221('0x2'));var rp=require('request-promise');var moment=require(_0x7221('0x3'));var BPromise=require(_0x7221('0x4'));var Mustache=require(_0x7221('0x5'));var util=require('util');var path=require(_0x7221('0x6'));var sox=require('sox');var csv=require(_0x7221('0x7'));var ejs=require(_0x7221('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7221('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7221('0x7'));var querystring=require(_0x7221('0xa'));var Papa=require('papaparse');var Redis=require(_0x7221('0xb'));var authService=require(_0x7221('0xc'));var qs=require('../../components/parsers/qs');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7221('0xd'))(_0x7221('0xe'));var utils=require('../../config/utils');var config=require(_0x7221('0xf'));var db=require(_0x7221('0x10'))['db'];function respondWithStatusCode(_0x1aff53,_0x873a9a){_0x873a9a=_0x873a9a||0xcc;return function(_0x5168bb){if(_0x5168bb){return _0x1aff53[_0x7221('0x11')](_0x873a9a);}return _0x1aff53[_0x7221('0x12')](_0x873a9a)['end']();};}function respondWithResult(_0x56f19d,_0x3ed054){_0x3ed054=_0x3ed054||0xc8;return function(_0x4f4c2a){if(_0x4f4c2a){return _0x56f19d['status'](_0x3ed054)[_0x7221('0x13')](_0x4f4c2a);}};}function respondWithFilteredResult(_0x24cb10,_0x22809d){return function(_0x44f38d){if(_0x44f38d){var _0x1dbfc3=_0x44f38d['count'],_0x3fd22b=_0x22809d[_0x7221('0x14')],_0x40c650=_0x22809d['offset']+_0x22809d[_0x7221('0x15')],_0x1fc617;if(_0x40c650>=_0x1dbfc3){_0x40c650=_0x1dbfc3;_0x1fc617=0xc8;}else{_0x1fc617=0xce;}_0x24cb10['status'](_0x1fc617);return _0x24cb10[_0x7221('0x16')](_0x7221('0x17'),_0x3fd22b+'-'+_0x40c650+'/'+_0x1dbfc3)[_0x7221('0x13')](_0x44f38d);}return null;};}function patchUpdates(_0x22f1ad){return function(_0x5f3c85){try{jsonpatch[_0x7221('0x18')](_0x5f3c85,_0x22f1ad,!![]);}catch(_0x1124f3){return BPromise[_0x7221('0x19')](_0x1124f3);}return _0x5f3c85[_0x7221('0x1a')]();};}function saveUpdates(_0x44f748,_0x625503){return function(_0x483518){if(_0x483518){return _0x483518[_0x7221('0x1b')](_0x44f748)[_0x7221('0x1c')](function(_0x5bf6ed){return _0x5bf6ed;});}return null;};}function removeEntity(_0x198763,_0x13f6fd){return function(_0xa19de2){if(_0xa19de2){return _0xa19de2[_0x7221('0x1d')]()['then'](function(){_0x198763[_0x7221('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b1c1f,_0x10df07){return function(_0x4a5383){if(!_0x4a5383){_0x3b1c1f['sendStatus'](0x194);}return _0x4a5383;};}function handleError(_0x34ca4b,_0x4e763c){_0x4e763c=_0x4e763c||0x1f4;return function(_0xe6a65a){logger[_0x7221('0x1e')](_0xe6a65a[_0x7221('0x1f')]);if(_0xe6a65a['name']){delete _0xe6a65a['name'];}_0x34ca4b[_0x7221('0x12')](_0x4e763c)[_0x7221('0x20')](_0xe6a65a);};}exports[_0x7221('0x21')]=function(_0x322585,_0x17b640){var _0x32573b={},_0x58870c={},_0x286fcb={'count':0x0,'rows':[]};var _0x109afd=db['VoiceTransferReport'][_0x7221('0x22')];_0x58870c['model']=_['keys'](_0x109afd);_0x58870c['query']=_[_0x7221('0x23')](_0x322585[_0x7221('0x24')]);_0x58870c[_0x7221('0x25')]=_[_0x7221('0x26')](_0x58870c[_0x7221('0x27')],_0x58870c[_0x7221('0x24')]);_0x32573b[_0x7221('0x28')]=_['intersection'](_0x58870c[_0x7221('0x27')],qs[_0x7221('0x29')](_0x322585[_0x7221('0x24')][_0x7221('0x29')]));_0x32573b['attributes']=_0x32573b['attributes']['length']?_0x32573b[_0x7221('0x28')]:_0x58870c[_0x7221('0x27')];if(!_0x322585[_0x7221('0x24')][_0x7221('0x2a')](_0x7221('0x2b'))){_0x32573b['limit']=qs[_0x7221('0x15')](_0x322585[_0x7221('0x24')][_0x7221('0x15')]);_0x32573b[_0x7221('0x14')]=qs['offset'](_0x322585[_0x7221('0x24')][_0x7221('0x14')]);}_0x32573b[_0x7221('0x2c')]=qs[_0x7221('0x2d')](_0x322585[_0x7221('0x24')]['sort']);_0x32573b['where']=qs[_0x7221('0x25')](_[_0x7221('0x2e')](_0x322585[_0x7221('0x24')],_0x58870c[_0x7221('0x25')]));if(_0x322585[_0x7221('0x24')][_0x7221('0x2f')]){_0x32573b['where']=_[_0x7221('0x30')](_0x32573b[_0x7221('0x31')],{'$or':_[_0x7221('0x32')](_0x109afd,function(_0x24728e){if(_0x24728e[_0x7221('0x33')][_0x7221('0x34')]!==_0x7221('0x35')){var _0x572267={};_0x572267[_0x24728e[_0x7221('0x36')]]={'$like':'%'+_0x322585[_0x7221('0x24')]['filter']+'%'};return _0x572267;}})});}_0x32573b=_[_0x7221('0x30')]({},_0x32573b,_0x322585[_0x7221('0x37')]);var _0x3e0a9e={'where':_0x32573b['where']};return db[_0x7221('0x38')][_0x7221('0x39')](_0x3e0a9e)['then'](function(_0x47a9bb){_0x286fcb[_0x7221('0x39')]=_0x47a9bb;if(_0x322585['query'][_0x7221('0x3a')]){_0x32573b[_0x7221('0x3b')]=[{'all':!![]}];}return db[_0x7221('0x38')][_0x7221('0x3c')](_0x32573b);})['then'](function(_0x4a87cf){_0x286fcb[_0x7221('0x3d')]=_0x4a87cf;return _0x286fcb;})[_0x7221('0x1c')](respondWithFilteredResult(_0x17b640,_0x32573b))['catch'](handleError(_0x17b640,null));};exports[_0x7221('0x3e')]=function(_0x5458c5,_0x459c97){var _0xfb0509={'raw':!![],'where':{'id':_0x5458c5[_0x7221('0x3f')]['id']}},_0x25a016={};_0x25a016[_0x7221('0x27')]=_['keys'](db[_0x7221('0x38')][_0x7221('0x22')]);_0x25a016[_0x7221('0x24')]=_[_0x7221('0x23')](_0x5458c5[_0x7221('0x24')]);_0x25a016[_0x7221('0x25')]=_['intersection'](_0x25a016[_0x7221('0x27')],_0x25a016[_0x7221('0x24')]);_0xfb0509[_0x7221('0x28')]=_['intersection'](_0x25a016['model'],qs['fields'](_0x5458c5[_0x7221('0x24')][_0x7221('0x29')]));_0xfb0509['attributes']=_0xfb0509['attributes'][_0x7221('0x40')]?_0xfb0509[_0x7221('0x28')]:_0x25a016[_0x7221('0x27')];if(_0x5458c5[_0x7221('0x24')][_0x7221('0x3a')]){_0xfb0509[_0x7221('0x3b')]=[{'all':!![]}];}_0xfb0509=_[_0x7221('0x30')]({},_0xfb0509,_0x5458c5['options']);return db[_0x7221('0x38')][_0x7221('0x41')](_0xfb0509)[_0x7221('0x1c')](handleEntityNotFound(_0x459c97,null))[_0x7221('0x1c')](respondWithResult(_0x459c97,null))[_0x7221('0x42')](handleError(_0x459c97,null));};exports[_0x7221('0x43')]=function(_0x166403,_0x93211a){return db[_0x7221('0x38')][_0x7221('0x43')](_0x166403[_0x7221('0x44')],{})[_0x7221('0x1c')](respondWithResult(_0x93211a,0xc9))['catch'](handleError(_0x93211a,null));};exports[_0x7221('0x1b')]=function(_0x5840ab,_0x370d76){if(_0x5840ab[_0x7221('0x44')]['id']){delete _0x5840ab[_0x7221('0x44')]['id'];}return db[_0x7221('0x38')][_0x7221('0x41')]({'where':{'id':_0x5840ab[_0x7221('0x3f')]['id']}})[_0x7221('0x1c')](handleEntityNotFound(_0x370d76,null))[_0x7221('0x1c')](saveUpdates(_0x5840ab[_0x7221('0x44')],null))[_0x7221('0x1c')](respondWithResult(_0x370d76,null))[_0x7221('0x42')](handleError(_0x370d76,null));};exports[_0x7221('0x1d')]=function(_0xd6cb2d,_0x4b07d7){return db[_0x7221('0x38')][_0x7221('0x41')]({'where':{'id':_0xd6cb2d[_0x7221('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4b07d7,null))[_0x7221('0x1c')](removeEntity(_0x4b07d7,null))[_0x7221('0x42')](handleError(_0x4b07d7,null));}; \ No newline at end of file +var _0xe937=['rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','key','VIRTUAL','field','options','includeAll','include','rows','catch','params','merge','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','VoiceTransferReport'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xe937,0x6b));var _0x7e93=function(_0x4d41d3,_0x38df41){_0x4d41d3=_0x4d41d3-0x0;var _0x3e8307=_0xe937[_0x4d41d3];return _0x3e8307;};'use strict';var pdf=require(_0x7e93('0x0'));var emlformat=require(_0x7e93('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7e93('0x2'));var jsonpatch=require(_0x7e93('0x3'));var rp=require('request-promise');var moment=require(_0x7e93('0x4'));var BPromise=require(_0x7e93('0x5'));var Mustache=require(_0x7e93('0x6'));var util=require(_0x7e93('0x7'));var path=require(_0x7e93('0x8'));var sox=require(_0x7e93('0x9'));var csv=require(_0x7e93('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7e93('0xb'));var squel=require(_0x7e93('0xc'));var crypto=require(_0x7e93('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7e93('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7e93('0xf'));var Papa=require(_0x7e93('0x10'));var Redis=require(_0x7e93('0x11'));var authService=require(_0x7e93('0x12'));var qs=require(_0x7e93('0x13'));var hardwareService=require(_0x7e93('0x14'));var logger=require(_0x7e93('0x15'))(_0x7e93('0x16'));var utils=require(_0x7e93('0x17'));var config=require(_0x7e93('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x499f0e,_0x21a542){_0x21a542=_0x21a542||0xcc;return function(_0x3cf79d){if(_0x3cf79d){return _0x499f0e[_0x7e93('0x19')](_0x21a542);}return _0x499f0e[_0x7e93('0x1a')](_0x21a542)['end']();};}function respondWithResult(_0x5d5276,_0x5ce4d2){_0x5ce4d2=_0x5ce4d2||0xc8;return function(_0x5a2a71){if(_0x5a2a71){return _0x5d5276[_0x7e93('0x1a')](_0x5ce4d2)[_0x7e93('0x1b')](_0x5a2a71);}};}function respondWithFilteredResult(_0x420e35,_0xadaca2){return function(_0x188e21){if(_0x188e21){var _0x4b07ec=_0x188e21[_0x7e93('0x1c')],_0x4e0f19=_0xadaca2[_0x7e93('0x1d')],_0x172242=_0xadaca2[_0x7e93('0x1d')]+_0xadaca2['limit'],_0x43baa5;if(_0x172242>=_0x4b07ec){_0x172242=_0x4b07ec;_0x43baa5=0xc8;}else{_0x43baa5=0xce;}_0x420e35[_0x7e93('0x1a')](_0x43baa5);return _0x420e35[_0x7e93('0x1e')](_0x7e93('0x1f'),_0x4e0f19+'-'+_0x172242+'/'+_0x4b07ec)[_0x7e93('0x1b')](_0x188e21);}return null;};}function patchUpdates(_0x13ca38){return function(_0x3dd42f){try{jsonpatch[_0x7e93('0x20')](_0x3dd42f,_0x13ca38,!![]);}catch(_0x32cd29){return BPromise[_0x7e93('0x21')](_0x32cd29);}return _0x3dd42f[_0x7e93('0x22')]();};}function saveUpdates(_0x12bbed,_0x182f3f){return function(_0x2165ef){if(_0x2165ef){return _0x2165ef[_0x7e93('0x23')](_0x12bbed)[_0x7e93('0x24')](function(_0x819ab9){return _0x819ab9;});}return null;};}function removeEntity(_0x379227,_0x4f8aab){return function(_0x4de593){if(_0x4de593){return _0x4de593[_0x7e93('0x25')]()[_0x7e93('0x24')](function(){_0x379227['status'](0xcc)[_0x7e93('0x26')]();});}};}function handleEntityNotFound(_0x3f6163,_0x1b8f2f){return function(_0x373f3c){if(!_0x373f3c){_0x3f6163[_0x7e93('0x19')](0x194);}return _0x373f3c;};}function handleError(_0x11466f,_0x50bf23){_0x50bf23=_0x50bf23||0x1f4;return function(_0x4b7213){logger[_0x7e93('0x27')](_0x4b7213[_0x7e93('0x28')]);if(_0x4b7213['name']){delete _0x4b7213[_0x7e93('0x29')];}_0x11466f[_0x7e93('0x1a')](_0x50bf23)[_0x7e93('0x2a')](_0x4b7213);};}exports[_0x7e93('0x2b')]=function(_0x33f405,_0xc5ea98){var _0x557bf0={},_0x3d2c53={},_0x2acdaa={'count':0x0,'rows':[]};var _0x48f6ed=db[_0x7e93('0x2c')][_0x7e93('0x2d')];_0x3d2c53[_0x7e93('0x2e')]=_['keys'](_0x48f6ed);_0x3d2c53[_0x7e93('0x2f')]=_[_0x7e93('0x30')](_0x33f405[_0x7e93('0x2f')]);_0x3d2c53[_0x7e93('0x31')]=_[_0x7e93('0x32')](_0x3d2c53['model'],_0x3d2c53[_0x7e93('0x2f')]);_0x557bf0['attributes']=_[_0x7e93('0x32')](_0x3d2c53[_0x7e93('0x2e')],qs[_0x7e93('0x33')](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x33')]));_0x557bf0[_0x7e93('0x34')]=_0x557bf0[_0x7e93('0x34')][_0x7e93('0x35')]?_0x557bf0[_0x7e93('0x34')]:_0x3d2c53[_0x7e93('0x2e')];if(!_0x33f405['query'][_0x7e93('0x36')](_0x7e93('0x37'))){_0x557bf0[_0x7e93('0x38')]=qs[_0x7e93('0x38')](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x38')]);_0x557bf0[_0x7e93('0x1d')]=qs[_0x7e93('0x1d')](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x1d')]);}_0x557bf0[_0x7e93('0x39')]=qs['sort'](_0x33f405[_0x7e93('0x2f')][_0x7e93('0x3a')]);_0x557bf0[_0x7e93('0x3b')]=qs[_0x7e93('0x31')](_[_0x7e93('0x3c')](_0x33f405['query'],_0x3d2c53[_0x7e93('0x31')]));if(_0x33f405['query'][_0x7e93('0x3d')]){_0x557bf0['where']=_['merge'](_0x557bf0[_0x7e93('0x3b')],{'$or':_['map'](_0x48f6ed,function(_0x5736df){if(_0x5736df[_0x7e93('0x3e')][_0x7e93('0x3f')]!==_0x7e93('0x40')){var _0x930c94={};_0x930c94[_0x5736df[_0x7e93('0x41')]]={'$like':'%'+_0x33f405['query'][_0x7e93('0x3d')]+'%'};return _0x930c94;}})});}_0x557bf0=_['merge']({},_0x557bf0,_0x33f405[_0x7e93('0x42')]);var _0x3ded48={'where':_0x557bf0[_0x7e93('0x3b')]};return db[_0x7e93('0x2c')][_0x7e93('0x1c')](_0x3ded48)[_0x7e93('0x24')](function(_0x518ab3){_0x2acdaa[_0x7e93('0x1c')]=_0x518ab3;if(_0x33f405['query'][_0x7e93('0x43')]){_0x557bf0[_0x7e93('0x44')]=[{'all':!![]}];}return db[_0x7e93('0x2c')]['findAll'](_0x557bf0);})[_0x7e93('0x24')](function(_0x5f1766){_0x2acdaa[_0x7e93('0x45')]=_0x5f1766;return _0x2acdaa;})[_0x7e93('0x24')](respondWithFilteredResult(_0xc5ea98,_0x557bf0))[_0x7e93('0x46')](handleError(_0xc5ea98,null));};exports['show']=function(_0x17ac7f,_0x23ad78){var _0x53fae9={'raw':!![],'where':{'id':_0x17ac7f[_0x7e93('0x47')]['id']}},_0x22c71a={};_0x22c71a[_0x7e93('0x2e')]=_['keys'](db[_0x7e93('0x2c')][_0x7e93('0x2d')]);_0x22c71a[_0x7e93('0x2f')]=_[_0x7e93('0x30')](_0x17ac7f[_0x7e93('0x2f')]);_0x22c71a['filters']=_['intersection'](_0x22c71a[_0x7e93('0x2e')],_0x22c71a[_0x7e93('0x2f')]);_0x53fae9['attributes']=_[_0x7e93('0x32')](_0x22c71a[_0x7e93('0x2e')],qs[_0x7e93('0x33')](_0x17ac7f['query']['fields']));_0x53fae9[_0x7e93('0x34')]=_0x53fae9[_0x7e93('0x34')][_0x7e93('0x35')]?_0x53fae9[_0x7e93('0x34')]:_0x22c71a[_0x7e93('0x2e')];if(_0x17ac7f[_0x7e93('0x2f')][_0x7e93('0x43')]){_0x53fae9[_0x7e93('0x44')]=[{'all':!![]}];}_0x53fae9=_[_0x7e93('0x48')]({},_0x53fae9,_0x17ac7f['options']);return db['VoiceTransferReport'][_0x7e93('0x49')](_0x53fae9)[_0x7e93('0x24')](handleEntityNotFound(_0x23ad78,null))[_0x7e93('0x24')](respondWithResult(_0x23ad78,null))[_0x7e93('0x46')](handleError(_0x23ad78,null));};exports[_0x7e93('0x4a')]=function(_0x597b2e,_0x233801){return db['VoiceTransferReport'][_0x7e93('0x4a')](_0x597b2e[_0x7e93('0x4b')],{})[_0x7e93('0x24')](respondWithResult(_0x233801,0xc9))[_0x7e93('0x46')](handleError(_0x233801,null));};exports['update']=function(_0x4917a8,_0x152bf9){if(_0x4917a8['body']['id']){delete _0x4917a8[_0x7e93('0x4b')]['id'];}return db[_0x7e93('0x2c')][_0x7e93('0x49')]({'where':{'id':_0x4917a8['params']['id']}})[_0x7e93('0x24')](handleEntityNotFound(_0x152bf9,null))[_0x7e93('0x24')](saveUpdates(_0x4917a8['body'],null))[_0x7e93('0x24')](respondWithResult(_0x152bf9,null))[_0x7e93('0x46')](handleError(_0x152bf9,null));};exports[_0x7e93('0x25')]=function(_0x4e82b6,_0x5c0345){return db[_0x7e93('0x2c')][_0x7e93('0x49')]({'where':{'id':_0x4e82b6['params']['id']}})['then'](handleEntityNotFound(_0x5c0345,null))[_0x7e93('0x24')](removeEntity(_0x5c0345,null))[_0x7e93('0x46')](handleError(_0x5c0345,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6a3033d..9dc6e27 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 _0xb364=['define','report_call_transfer','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0xb364,0x7a));var _0x4b36=function(_0x2030cd,_0x53a921){_0x2030cd=_0x2030cd-0x0;var _0x5909dc=_0xb364[_0x2030cd];return _0x5909dc;};'use strict';var _=require('lodash');var util=require(_0x4b36('0x0'));var logger=require(_0x4b36('0x1'))(_0x4b36('0x2'));var moment=require(_0x4b36('0x3'));var BPromise=require(_0x4b36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b36('0x5'));var rimraf=require('rimraf');var config=require(_0x4b36('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0x4b36('0x7')]=function(_0x3cfa16,_0x2ef3ef){return _0x3cfa16[_0x4b36('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x4b36('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x06ba=['../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x36e9ff,_0x270255){var _0x5a46f6=function(_0x38a9cd){while(--_0x38a9cd){_0x36e9ff['push'](_0x36e9ff['shift']());}};_0x5a46f6(++_0x270255);}(_0x06ba,0xa2));var _0xa06b=function(_0xcd6be6,_0x1eb5fa){_0xcd6be6=_0xcd6be6-0x0;var _0x4c5e59=_0x06ba[_0xcd6be6];return _0x4c5e59;};'use strict';var _=require(_0xa06b('0x0'));var util=require('util');var logger=require(_0xa06b('0x1'))(_0xa06b('0x2'));var moment=require(_0xa06b('0x3'));var BPromise=require(_0xa06b('0x4'));var rp=require(_0xa06b('0x5'));var fs=require('fs');var path=require(_0xa06b('0x6'));var rimraf=require('rimraf');var config=require(_0xa06b('0x7'));var attributes=require(_0xa06b('0x8'));module[_0xa06b('0x9')]=function(_0x119810,_0x12ca4c){return _0x119810[_0xa06b('0xa')](_0xa06b('0xb'),attributes,{'tableName':_0xa06b('0xc'),'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 9c771a1..4d8c1a5 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 _0x601d=['CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x4e938e,_0x37dba9){var _0x47aacf=function(_0x214269){while(--_0x214269){_0x4e938e['push'](_0x4e938e['shift']());}};_0x47aacf(++_0x37dba9);}(_0x601d,0x1c6));var _0xd601=function(_0x1c65c4,_0xb75ae5){_0x1c65c4=_0x1c65c4-0x0;var _0x13d218=_0x601d[_0x1c65c4];return _0x13d218;};'use strict';var _=require(_0xd601('0x0'));var util=require(_0xd601('0x1'));var moment=require(_0xd601('0x2'));var BPromise=require(_0xd601('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd601('0x4'));var db=require(_0xd601('0x5'))['db'];var utils=require(_0xd601('0x6'));var logger=require(_0xd601('0x7'))(_0xd601('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd601('0x9')][_0xd601('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2283d4,_0x26bdb8,_0x37186e){return new BPromise(function(_0x1f8791,_0x5e8a20){return client['request'](_0x2283d4,_0x37186e)[_0xd601('0xb')](function(_0x1ee6a7){logger[_0xd601('0xc')](_0xd601('0xd'),_0x26bdb8,_0xd601('0xe'));logger[_0xd601('0xf')](_0xd601('0x10'),_0x26bdb8,_0xd601('0xe'),JSON[_0xd601('0x11')](_0x1ee6a7));if(_0x1ee6a7[_0xd601('0x12')]){if(_0x1ee6a7[_0xd601('0x12')]['code']===0x1f4){logger[_0xd601('0x12')](_0xd601('0xd'),_0x26bdb8,_0x1ee6a7[_0xd601('0x12')]['message']);return _0x5e8a20(_0x1ee6a7[_0xd601('0x12')][_0xd601('0x13')]);}logger[_0xd601('0x12')](_0xd601('0xd'),_0x26bdb8,_0x1ee6a7[_0xd601('0x12')][_0xd601('0x13')]);return _0x1f8791(_0x1ee6a7[_0xd601('0x12')][_0xd601('0x13')]);}else{logger[_0xd601('0xc')](_0xd601('0xd'),_0x26bdb8,'request\x20sent');_0x1f8791(_0x1ee6a7[_0xd601('0x14')][_0xd601('0x13')]);}})[_0xd601('0x15')](function(_0x31cba6){logger[_0xd601('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x26bdb8,_0x31cba6);_0x5e8a20(_0x31cba6);});});}exports[_0xd601('0x16')]=function(_0x3fc7ac){var _0x11e0f2=this;return new Promise(function(_0x29cedb,_0x5353ab){return db[_0xd601('0x17')][_0xd601('0x18')](_0x3fc7ac[_0xd601('0x19')],{'raw':_0x3fc7ac[_0xd601('0x1a')]?_0x3fc7ac['options'][_0xd601('0x1b')]===undefined?!![]:![]:!![]})[_0xd601('0xb')](function(_0x19ed40){logger[_0xd601('0xc')](_0xd601('0x16'),_0x3fc7ac);logger['debug'](_0xd601('0x16'),_0x3fc7ac,JSON['stringify'](_0x19ed40));_0x29cedb(_0x19ed40);})[_0xd601('0x15')](function(_0x131643){logger[_0xd601('0x12')]('CreateVoiceTransferReport',_0x131643[_0xd601('0x13')],_0x3fc7ac);_0x5353ab(_0x11e0f2[_0xd601('0x12')](0x1f4,_0x131643[_0xd601('0x13')]));});});}; \ No newline at end of file +var _0xbf43=['body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf43,0x84));var _0x3bf4=function(_0x1d2dd8,_0x2b874c){_0x1d2dd8=_0x1d2dd8-0x0;var _0x49a344=_0xbf43[_0x1d2dd8];return _0x49a344;};'use strict';var _=require(_0x3bf4('0x0'));var util=require(_0x3bf4('0x1'));var moment=require('moment');var BPromise=require(_0x3bf4('0x2'));var rs=require(_0x3bf4('0x3'));var fs=require('fs');var Redis=require(_0x3bf4('0x4'));var db=require(_0x3bf4('0x5'))['db'];var utils=require(_0x3bf4('0x6'));var logger=require(_0x3bf4('0x7'))(_0x3bf4('0x8'));var config=require(_0x3bf4('0x9'));var jayson=require(_0x3bf4('0xa'));var client=jayson[_0x3bf4('0xb')][_0x3bf4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x46991a,_0x6cde37,_0x4519d5){return new BPromise(function(_0x4c9406,_0x19b51e){return client[_0x3bf4('0xd')](_0x46991a,_0x4519d5)[_0x3bf4('0xe')](function(_0xd2cee8){logger[_0x3bf4('0xf')](_0x3bf4('0x10'),_0x6cde37,_0x3bf4('0x11'));logger['debug'](_0x3bf4('0x12'),_0x6cde37,_0x3bf4('0x11'),JSON[_0x3bf4('0x13')](_0xd2cee8));if(_0xd2cee8[_0x3bf4('0x14')]){if(_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x15')]===0x1f4){logger[_0x3bf4('0x14')](_0x3bf4('0x10'),_0x6cde37,_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x16')]);return _0x19b51e(_0xd2cee8['error']['message']);}logger['error'](_0x3bf4('0x10'),_0x6cde37,_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x16')]);return _0x4c9406(_0xd2cee8[_0x3bf4('0x14')][_0x3bf4('0x16')]);}else{logger[_0x3bf4('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x6cde37,'request\x20sent');_0x4c9406(_0xd2cee8[_0x3bf4('0x17')][_0x3bf4('0x16')]);}})[_0x3bf4('0x18')](function(_0x54a3b7){logger['error'](_0x3bf4('0x10'),_0x6cde37,_0x54a3b7);_0x19b51e(_0x54a3b7);});});}exports[_0x3bf4('0x19')]=function(_0x145d47){var _0x1fdc29=this;return new Promise(function(_0x224a74,_0x3caa13){return db[_0x3bf4('0x1a')][_0x3bf4('0x1b')](_0x145d47[_0x3bf4('0x1c')],{'raw':_0x145d47[_0x3bf4('0x1d')]?_0x145d47[_0x3bf4('0x1d')][_0x3bf4('0x1e')]===undefined?!![]:![]:!![]})[_0x3bf4('0xe')](function(_0x1755ff){logger['info'](_0x3bf4('0x19'),_0x145d47);logger[_0x3bf4('0x1f')](_0x3bf4('0x19'),_0x145d47,JSON['stringify'](_0x1755ff));_0x224a74(_0x1755ff);})[_0x3bf4('0x18')](function(_0x1a1981){logger['error'](_0x3bf4('0x19'),_0x1a1981[_0x3bf4('0x16')],_0x145d47);_0x3caa13(_0x1fdc29[_0x3bf4('0x14')](0x1f4,_0x1a1981['message']));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 63f9b1c..9d360ef 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf078=['name','join','Offline\x20apps:','filter','status','None','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','map'];(function(_0x31ecda,_0x44f398){var _0x1c874d=function(_0xedc48b){while(--_0xedc48b){_0x31ecda['push'](_0x31ecda['shift']());}};_0x1c874d(++_0x44f398);}(_0xf078,0x185));var _0x8f07=function(_0x5f322e,_0x4fb47f){_0x5f322e=_0x5f322e-0x0;var _0x184587=_0xf078[_0x5f322e];return _0x184587;};'use strict';var _=require(_0x8f07('0x0'));var mysqldb=require(_0x8f07('0x1'));var rpc=require(_0x8f07('0x2'));var config=require(_0x8f07('0x3'));var logger=require(_0x8f07('0x4'))(_0x8f07('0x5'));var pm2=require('./config/pm2');var pm2Config=require(_0x8f07('0x6'));var schedule=require(_0x8f07('0x7'));var chat=require(_0x8f07('0x8'));function main(){return mysqldb['db'][_0x8f07('0x9')][_0x8f07('0xa')]()[_0x8f07('0xb')](function(){return rpc[_0x8f07('0xc')]();})['then'](function(_0x3d7248){logger[_0x8f07('0xd')](_0x3d7248);return chat['start']();})[_0x8f07('0xb')](function(){return schedule[_0x8f07('0xe')]();})[_0x8f07('0xb')](function(_0x3c8674){logger[_0x8f07('0xd')](_0x3c8674);return pm2[_0x8f07('0xe')](pm2Config);})[_0x8f07('0xb')](function(_0x2f71c1){logger[_0x8f07('0xd')](_0x8f07('0xf'),_[_0x8f07('0x10')](_['filter'](_0x2f71c1,{'status':'online'}),_0x8f07('0x11'))[_0x8f07('0x12')]());logger['info'](_0x8f07('0x13'),_[_0x8f07('0x10')](_[_0x8f07('0x14')](_0x2f71c1,function(_0xc3a4de){return _0xc3a4de[_0x8f07('0x15')]!=='online';}),_0x8f07('0x11'))[_0x8f07('0x12')]()||_0x8f07('0x16'));config[_0x8f07('0x17')]&&require(_0x8f07('0x18'))[_0x8f07('0x19')]();require('./config/license')['default']();})[_0x8f07('0x1a')](function(_0x3861be){logger[_0x8f07('0x1b')](_0x8f07('0x1c'),_0x3861be);process['exit'](0x1);});}main(); \ No newline at end of file +var _0x4b8d=['./config/pm2/config','sync','then','listen','info','start','Online\x20apps:','map','filter','online','join','Offline\x20apps:','name','None','seedDB','./config/seedDB','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2'];(function(_0x24c955,_0x5d01e1){var _0xc60b68=function(_0x49e623){while(--_0x49e623){_0x24c955['push'](_0x24c955['shift']());}};_0xc60b68(++_0x5d01e1);}(_0x4b8d,0x77));var _0xd4b8=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x4b8d[_0x38987f];return _0x4cb697;};'use strict';var _=require(_0xd4b8('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xd4b8('0x1'));var config=require(_0xd4b8('0x2'));var logger=require(_0xd4b8('0x3'))(_0xd4b8('0x4'));var pm2=require(_0xd4b8('0x5'));var pm2Config=require(_0xd4b8('0x6'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');function main(){return mysqldb['db']['sequelize'][_0xd4b8('0x7')]()[_0xd4b8('0x8')](function(){return rpc[_0xd4b8('0x9')]();})[_0xd4b8('0x8')](function(_0x474834){logger[_0xd4b8('0xa')](_0x474834);return chat[_0xd4b8('0xb')]();})['then'](function(){return schedule[_0xd4b8('0xb')]();})['then'](function(_0x54088a){logger[_0xd4b8('0xa')](_0x54088a);return pm2[_0xd4b8('0xb')](pm2Config);})[_0xd4b8('0x8')](function(_0x4cb19f){logger[_0xd4b8('0xa')](_0xd4b8('0xc'),_[_0xd4b8('0xd')](_[_0xd4b8('0xe')](_0x4cb19f,{'status':_0xd4b8('0xf')}),'name')[_0xd4b8('0x10')]());logger[_0xd4b8('0xa')](_0xd4b8('0x11'),_[_0xd4b8('0xd')](_['filter'](_0x4cb19f,function(_0x23d275){return _0x23d275['status']!==_0xd4b8('0xf');}),_0xd4b8('0x12'))[_0xd4b8('0x10')]()||_0xd4b8('0x13'));config[_0xd4b8('0x14')]&&require(_0xd4b8('0x15'))['default']();require('./config/license')['default']();})[_0xd4b8('0x16')](function(_0x3ddcd3){logger[_0xd4b8('0x17')](_0xd4b8('0x18'),_0x3ddcd3);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index f315050..6cba0c4 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 _0x3a37=['isEqual','apiKeyNonce','nonce','log','Unrecognized\x20API\x20access\x20key','User\x20object\x20not\x20found.','../../config/license/util','getLicense','canUpdate','sign','signToken','Required\x20role\x20needs\x20to\x20be\x20set','userRoles','indexOf','Forbidden','setTokenCookie','cookie','motion.user','pick','redirect','/dashboards/general','retrieveApiKey','apiKeyIat','generateApiKey','randomBytes','toString','hex','regenerateApiKey','verify','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','basic-auth','ipaddr.js','secrets','session','role','fullname','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','ChatInteraction','findOne','params','disposition','then','closed','json','unmanaged','Unmanaged.','Forbidden.','catch','use','headers','authorization','Basic','User','find','name','authenticate','pass','status','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid'];(function(_0x488304,_0x5b5b0e){var _0x51f958=function(_0xdc55ce){while(--_0xdc55ce){_0x488304['push'](_0x488304['shift']());}};_0x51f958(++_0x5b5b0e);}(_0x3a37,0xcb));var _0x73a3=function(_0x4990d5,_0xe2c486){_0x4990d5=_0x4990d5-0x0;var _0x275e25=_0x3a37[_0x4990d5];return _0x275e25;};'use strict';var db=require(_0x73a3('0x0'))['db'];var config=require(_0x73a3('0x1'));var hardwareConf=require(_0x73a3('0x2'));var _=require(_0x73a3('0x3'));var jwt=require(_0x73a3('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x73a3('0x5'));var crypto=require('crypto');var ipaddr=require(_0x73a3('0x6'));var validateJwt=expressJwt({'secret':config[_0x73a3('0x7')][_0x73a3('0x8')]});var userAttributes=['id',_0x73a3('0x9'),_0x73a3('0xa'),'name',_0x73a3('0xb'),_0x73a3('0xc'),_0x73a3('0xd'),_0x73a3('0xe'),'voicePause',_0x73a3('0xf'),_0x73a3('0x10'),_0x73a3('0x11'),_0x73a3('0x12'),_0x73a3('0x13'),_0x73a3('0x14'),_0x73a3('0x15'),_0x73a3('0x16'),_0x73a3('0x17'),_0x73a3('0x18'),_0x73a3('0x19')];exports[_0x73a3('0x1a')]=function(){return isAuthenticated(!![])['use'](function(_0x492aca,_0x2bb8fe,_0x16cf65){if(_0x492aca['user']){_0x16cf65();}else{return db[_0x73a3('0x1b')][_0x73a3('0x1c')]({'where':{'id':_0x492aca[_0x73a3('0x1d')]['id']},'attributes':['id','closed',_0x73a3('0x1e')],'raw':!![]})[_0x73a3('0x1f')](function(_0x3be0e7){if(_0x3be0e7&&_0x3be0e7[_0x73a3('0x20')]){return _0x2bb8fe['status'](_0x3be0e7[_0x73a3('0x1e')]==='unmanaged'?0x195:0x193)[_0x73a3('0x21')]({'message':_0x3be0e7[_0x73a3('0x1e')]===_0x73a3('0x22')?_0x73a3('0x23'):_0x73a3('0x24')});}else{_0x16cf65();}})[_0x73a3('0x25')](function(_0x54bd83){_0x16cf65(_0x54bd83);});}});};function isAuthenticated(_0x38c4be){return compose()[_0x73a3('0x26')](function(_0x14fa92,_0x183e47,_0xde2b42){if(_0x14fa92[_0x73a3('0x27')][_0x73a3('0x28')]){if(_['startsWith'](_0x14fa92[_0x73a3('0x27')][_0x73a3('0x28')],_0x73a3('0x29'))){var _0x18a6ff=basicAuth(_0x14fa92);db[_0x73a3('0x2a')][_0x73a3('0x2b')]({'where':{'name':_0x18a6ff[_0x73a3('0x2c')]}})[_0x73a3('0x1f')](function(_0x56733d){if(!_0x56733d||!_0x56733d[_0x73a3('0x2d')](_0x18a6ff[_0x73a3('0x2e')])){return _0x183e47[_0x73a3('0x2f')](0x191)['json']({'message':_0x73a3('0x30')});}_0x14fa92[_0x73a3('0x31')]={'id':_0x56733d['id']};_0xde2b42();})[_0x73a3('0x25')](function(_0x523ef7){_0xde2b42(_0x523ef7);});}else if(_['startsWith'](_0x14fa92[_0x73a3('0x27')][_0x73a3('0x28')],_0x73a3('0x32'))){validateJwt(_0x14fa92,_0x183e47,_0xde2b42);}else{if(_0x38c4be){_0xde2b42();}else{return _0x183e47['status'](0x193)[_0x73a3('0x21')]({'message':_0x73a3('0x33')});}}}else if(_0x14fa92[_0x73a3('0x34')][_0x73a3('0x35')]){try{var _0x123f18=jwt['verify'](_0x14fa92[_0x73a3('0x34')][_0x73a3('0x35')],config[_0x73a3('0x7')][_0x73a3('0x8')],{'audience':hardwareConf[_0x73a3('0x36')](),'issuer':hardwareConf[_0x73a3('0x36')]()});db[_0x73a3('0x2a')][_0x73a3('0x2b')]({'where':{'id':_0x123f18['sub']}})[_0x73a3('0x1f')](function(_0x55cff6){if(!_0x55cff6||!_[_0x73a3('0x37')](_0x55cff6[_0x73a3('0x38')],_0x123f18[_0x73a3('0x39')])){return _0x183e47['status'](0x193)['json']({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}_0x14fa92['user']={'id':_0x55cff6['id']};_0xde2b42();})[_0x73a3('0x25')](function(_0x38e3d3){_0xde2b42(_0x38e3d3);});}catch(_0x47d76e){console[_0x73a3('0x3a')](_0x47d76e);return _0x183e47[_0x73a3('0x2f')](0x193)[_0x73a3('0x21')]({'message':_0x73a3('0x3b')});}}else if(_0x38c4be){_0xde2b42();}else{return _0x183e47[_0x73a3('0x2f')](0x193)[_0x73a3('0x21')]({'message':_0x73a3('0x33')});}})[_0x73a3('0x26')](function(_0x174372,_0x37d9b3,_0xabf129){if(_0x174372[_0x73a3('0x31')]){db[_0x73a3('0x2a')][_0x73a3('0x2b')]({'where':{'id':_0x174372['user']['id']},'attributes':userAttributes})[_0x73a3('0x1f')](function(_0x17acdd){if(!_0x17acdd){return _0x37d9b3[_0x73a3('0x2f')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x174372[_0x73a3('0x31')]=_0x17acdd;_0xabf129();})[_0x73a3('0x25')](function(_0x4bea43){_0xabf129(_0x4bea43);});}else if(_0x38c4be){_0xabf129();}else{return _0x37d9b3[_0x73a3('0x2f')](0x194)[_0x73a3('0x21')]({'message':_0x73a3('0x3c')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x1112d8,_0x3b5015,_0x405972){return require(_0x73a3('0x3d'))[_0x73a3('0x3e')]()[_0x73a3('0x1f')](function(_0x11a63c){if(_0x11a63c['update']){_0x405972();}else{return _0x3b5015[_0x73a3('0x2f')](0x193)[_0x73a3('0x21')]({'message':'Forbidden'});}})['catch'](function(_0x25e433){_0x405972(_0x25e433);});});}exports[_0x73a3('0x3f')]=canUpdate;function signToken(_0x58c972,_0x3f5b9e){return jwt[_0x73a3('0x40')]({'id':_0x58c972,'role':_0x3f5b9e},config[_0x73a3('0x7')][_0x73a3('0x8')],{'expiresIn':0x15180});}exports[_0x73a3('0x41')]=signToken;exports['hasRole']=function(_0x815057){if(!_0x815057){throw new Error(_0x73a3('0x42'));}return compose()[_0x73a3('0x26')](isAuthenticated())[_0x73a3('0x26')](function meetsRequirements(_0x113f3c,_0x1f826e,_0x2bf896){if(config[_0x73a3('0x43')][_0x73a3('0x44')](_0x113f3c[_0x73a3('0x31')][_0x73a3('0x9')])>=config['userRoles'][_0x73a3('0x44')](_0x815057)){return _0x2bf896();}else{return _0x1f826e['status'](0x193)[_0x73a3('0x21')]({'message':_0x73a3('0x45')});}});};exports[_0x73a3('0x46')]=function(_0x3c9007,_0x2a7729){if(!_0x3c9007[_0x73a3('0x31')]){return _0x2a7729[_0x73a3('0x2f')](0x194)[_0x73a3('0x21')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4d5f1f=signToken(_0x3c9007[_0x73a3('0x31')]['id'],_0x3c9007[_0x73a3('0x31')][_0x73a3('0x9')]);_0x2a7729['cookie']('motion.token',_0x4d5f1f);_0x2a7729[_0x73a3('0x47')](_0x73a3('0x48'),JSON['stringify'](_[_0x73a3('0x49')](_0x3c9007[_0x73a3('0x31')],userAttributes)));_0x2a7729[_0x73a3('0x4a')](_0x73a3('0x4b'));};exports[_0x73a3('0x4c')]=function(_0x34c648){if(_['isNil'](_0x34c648[_0x73a3('0x38')])||_['isNil'](_0x34c648[_0x73a3('0x4d')]))return null;else return createJwt(_0x34c648);};exports[_0x73a3('0x4e')]=function(_0x5bd8ba){_0x5bd8ba[_0x73a3('0x38')]=crypto[_0x73a3('0x4f')](0x10)[_0x73a3('0x50')](_0x73a3('0x51'));_0x5bd8ba[_0x73a3('0x4d')]=Math['floor'](Date['now']()/0x3e8)[_0x73a3('0x50')]();return createJwt(_0x5bd8ba);};exports[_0x73a3('0x52')]=function(_0x494cad,_0x2cd16b){if(_0x494cad[_0x73a3('0x34')][_0x73a3('0x35')]){jwt[_0x73a3('0x53')](_0x494cad[_0x73a3('0x34')]['apikey'],config['secrets'][_0x73a3('0x8')],{'nonce':_0x2cd16b[_0x73a3('0x38')],'iat':_0x2cd16b[_0x73a3('0x4d')],'audience':hardwareConf[_0x73a3('0x36')](),'issuer':hardwareConf[_0x73a3('0x36')]()});return generateApiKey(_0x2cd16b);}else{throw{'message':_0x73a3('0x54')};}};function createJwt(_0x4ac607){return jwt[_0x73a3('0x40')]({'iat':_0x4ac607['apiKeyIat'],'nonce':_0x4ac607[_0x73a3('0x38')]},config[_0x73a3('0x7')][_0x73a3('0x8')],{'algorithm':_0x73a3('0x55'),'subject':_0x4ac607['id'][_0x73a3('0x50')](),'issuer':hardwareConf[_0x73a3('0x36')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file +var _0xbfdb=['/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','randomBytes','toString','hex','now','regenerateApiKey','verify','sign','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','secrets','session','role','fullname','name','internal','email','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','phoneBarRemoteControlPort','phoneBarRemoteControl','interface','userProfileId','isChatInteractionAuthorized','user','ChatInteraction','findOne','closed','then','status','unmanaged','json','disposition','Unmanaged.','Forbidden.','catch','use','authorization','startsWith','headers','Basic','User','find','authenticate','pass','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','query','getUuid','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unrecognized\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','../../config/license/util','getLicense','update','canUpdate','signToken','hasRole','Required\x20role\x20needs\x20to\x20be\x20set','indexOf','userRoles','Forbidden','setTokenCookie','motion.token','cookie','motion.user','redirect'];(function(_0x6f60cf,_0x365101){var _0x585644=function(_0x49112c){while(--_0x49112c){_0x6f60cf['push'](_0x6f60cf['shift']());}};_0x585644(++_0x365101);}(_0xbfdb,0x174));var _0xbbfd=function(_0x5ee00d,_0x46bf3b){_0x5ee00d=_0x5ee00d-0x0;var _0x314c74=_0xbfdb[_0x5ee00d];return _0x314c74;};'use strict';var db=require(_0xbbfd('0x0'))['db'];var config=require(_0xbbfd('0x1'));var hardwareConf=require(_0xbbfd('0x2'));var _=require(_0xbbfd('0x3'));var jwt=require(_0xbbfd('0x4'));var expressJwt=require(_0xbbfd('0x5'));var compose=require(_0xbbfd('0x6'));var basicAuth=require(_0xbbfd('0x7'));var crypto=require(_0xbbfd('0x8'));var ipaddr=require('ipaddr.js');var validateJwt=expressJwt({'secret':config[_0xbbfd('0x9')][_0xbbfd('0xa')]});var userAttributes=['id',_0xbbfd('0xb'),_0xbbfd('0xc'),_0xbbfd('0xd'),_0xbbfd('0xe'),_0xbbfd('0xf'),'userpic',_0xbbfd('0x10'),'voicePause',_0xbbfd('0x11'),_0xbbfd('0x12'),_0xbbfd('0x13'),_0xbbfd('0x14'),_0xbbfd('0x15'),_0xbbfd('0x16'),'showWebBar',_0xbbfd('0x17'),_0xbbfd('0x18'),_0xbbfd('0x19'),_0xbbfd('0x1a')];exports[_0xbbfd('0x1b')]=function(){return isAuthenticated(!![])['use'](function(_0xb00406,_0x3ef1b6,_0xee4219){if(_0xb00406[_0xbbfd('0x1c')]){_0xee4219();}else{return db[_0xbbfd('0x1d')][_0xbbfd('0x1e')]({'where':{'id':_0xb00406['params']['id']},'attributes':['id',_0xbbfd('0x1f'),'disposition'],'raw':!![]})[_0xbbfd('0x20')](function(_0x2faae5){if(_0x2faae5&&_0x2faae5[_0xbbfd('0x1f')]){return _0x3ef1b6[_0xbbfd('0x21')](_0x2faae5['disposition']===_0xbbfd('0x22')?0x195:0x193)[_0xbbfd('0x23')]({'message':_0x2faae5[_0xbbfd('0x24')]==='unmanaged'?_0xbbfd('0x25'):_0xbbfd('0x26')});}else{_0xee4219();}})[_0xbbfd('0x27')](function(_0x3aa19d){_0xee4219(_0x3aa19d);});}});};function isAuthenticated(_0x47af7d){return compose()[_0xbbfd('0x28')](function(_0x1fd32a,_0x48565e,_0x32371e){if(_0x1fd32a['headers'][_0xbbfd('0x29')]){if(_[_0xbbfd('0x2a')](_0x1fd32a[_0xbbfd('0x2b')][_0xbbfd('0x29')],_0xbbfd('0x2c'))){var _0x1bfba1=basicAuth(_0x1fd32a);db[_0xbbfd('0x2d')][_0xbbfd('0x2e')]({'where':{'name':_0x1bfba1[_0xbbfd('0xd')]}})[_0xbbfd('0x20')](function(_0x3e8dcb){if(!_0x3e8dcb||!_0x3e8dcb[_0xbbfd('0x2f')](_0x1bfba1[_0xbbfd('0x30')])){return _0x48565e[_0xbbfd('0x21')](0x191)[_0xbbfd('0x23')]({'message':_0xbbfd('0x31')});}_0x1fd32a[_0xbbfd('0x1c')]={'id':_0x3e8dcb['id']};_0x32371e();})[_0xbbfd('0x27')](function(_0x6cec6){_0x32371e(_0x6cec6);});}else if(_[_0xbbfd('0x2a')](_0x1fd32a['headers'][_0xbbfd('0x29')],_0xbbfd('0x32'))){validateJwt(_0x1fd32a,_0x48565e,_0x32371e);}else{if(_0x47af7d){_0x32371e();}else{return _0x48565e[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x33')});}}}else if(_0x1fd32a['query'][_0xbbfd('0x34')]){try{var _0x44c0b4=jwt['verify'](_0x1fd32a[_0xbbfd('0x35')]['apikey'],config[_0xbbfd('0x9')][_0xbbfd('0xa')],{'audience':hardwareConf[_0xbbfd('0x36')](),'issuer':hardwareConf['getUuid']()});db[_0xbbfd('0x2d')][_0xbbfd('0x2e')]({'where':{'id':_0x44c0b4[_0xbbfd('0x37')]}})[_0xbbfd('0x20')](function(_0x3963a6){if(!_0x3963a6||!_[_0xbbfd('0x38')](_0x3963a6[_0xbbfd('0x39')],_0x44c0b4[_0xbbfd('0x3a')])){return _0x48565e[_0xbbfd('0x21')](0x193)['json']({'message':_0xbbfd('0x3b')});}_0x1fd32a['user']={'id':_0x3963a6['id']};_0x32371e();})[_0xbbfd('0x27')](function(_0x3f696a){_0x32371e(_0x3f696a);});}catch(_0x3a2082){console['log'](_0x3a2082);return _0x48565e[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x3c')});}}else if(_0x47af7d){_0x32371e();}else{return _0x48565e[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x33')});}})[_0xbbfd('0x28')](function(_0x40310c,_0x39ed10,_0x598ea4){if(_0x40310c[_0xbbfd('0x1c')]){db[_0xbbfd('0x2d')][_0xbbfd('0x2e')]({'where':{'id':_0x40310c['user']['id']},'attributes':userAttributes})[_0xbbfd('0x20')](function(_0x2d8de4){if(!_0x2d8de4){return _0x39ed10[_0xbbfd('0x21')](0x194)[_0xbbfd('0x23')]({'message':_0xbbfd('0x3d')});}_0x40310c['user']=_0x2d8de4;_0x598ea4();})[_0xbbfd('0x27')](function(_0x4222da){_0x598ea4(_0x4222da);});}else if(_0x47af7d){_0x598ea4();}else{return _0x39ed10[_0xbbfd('0x21')](0x194)[_0xbbfd('0x23')]({'message':_0xbbfd('0x3e')});}});}exports['isAuthenticated']=isAuthenticated;function canUpdate(){return compose()['use'](function(_0x63535b,_0x3037ef,_0xecf4d0){return require(_0xbbfd('0x3f'))[_0xbbfd('0x40')]()['then'](function(_0x1a5a09){if(_0x1a5a09[_0xbbfd('0x41')]){_0xecf4d0();}else{return _0x3037ef[_0xbbfd('0x21')](0x193)['json']({'message':'Forbidden'});}})[_0xbbfd('0x27')](function(_0x333792){_0xecf4d0(_0x333792);});});}exports[_0xbbfd('0x42')]=canUpdate;function signToken(_0x5499c3,_0x2b525c){return jwt['sign']({'id':_0x5499c3,'role':_0x2b525c},config[_0xbbfd('0x9')]['session'],{'expiresIn':0x15180});}exports[_0xbbfd('0x43')]=signToken;exports[_0xbbfd('0x44')]=function(_0xb042a5){if(!_0xb042a5){throw new Error(_0xbbfd('0x45'));}return compose()[_0xbbfd('0x28')](isAuthenticated())[_0xbbfd('0x28')](function meetsRequirements(_0x595620,_0x3252a7,_0x5418e3){if(config['userRoles'][_0xbbfd('0x46')](_0x595620[_0xbbfd('0x1c')]['role'])>=config[_0xbbfd('0x47')][_0xbbfd('0x46')](_0xb042a5)){return _0x5418e3();}else{return _0x3252a7[_0xbbfd('0x21')](0x193)[_0xbbfd('0x23')]({'message':_0xbbfd('0x48')});}});};exports[_0xbbfd('0x49')]=function(_0xc18803,_0x16d3ce){if(!_0xc18803[_0xbbfd('0x1c')]){return _0x16d3ce[_0xbbfd('0x21')](0x194)[_0xbbfd('0x23')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0xd4e78c=signToken(_0xc18803[_0xbbfd('0x1c')]['id'],_0xc18803['user'][_0xbbfd('0xb')]);_0x16d3ce['cookie'](_0xbbfd('0x4a'),_0xd4e78c);_0x16d3ce[_0xbbfd('0x4b')](_0xbbfd('0x4c'),JSON['stringify'](_['pick'](_0xc18803[_0xbbfd('0x1c')],userAttributes)));_0x16d3ce[_0xbbfd('0x4d')](_0xbbfd('0x4e'));};exports[_0xbbfd('0x4f')]=function(_0x10adf8){if(_[_0xbbfd('0x50')](_0x10adf8['apiKeyNonce'])||_[_0xbbfd('0x50')](_0x10adf8[_0xbbfd('0x51')]))return null;else return createJwt(_0x10adf8);};exports[_0xbbfd('0x52')]=function(_0x405a2a){_0x405a2a[_0xbbfd('0x39')]=crypto[_0xbbfd('0x53')](0x10)[_0xbbfd('0x54')](_0xbbfd('0x55'));_0x405a2a[_0xbbfd('0x51')]=Math['floor'](Date[_0xbbfd('0x56')]()/0x3e8)[_0xbbfd('0x54')]();return createJwt(_0x405a2a);};exports[_0xbbfd('0x57')]=function(_0x508500,_0x5f1973){if(_0x508500[_0xbbfd('0x35')][_0xbbfd('0x34')]){jwt[_0xbbfd('0x58')](_0x508500[_0xbbfd('0x35')]['apikey'],config[_0xbbfd('0x9')]['session'],{'nonce':_0x5f1973[_0xbbfd('0x39')],'iat':_0x5f1973[_0xbbfd('0x51')],'audience':hardwareConf[_0xbbfd('0x36')](),'issuer':hardwareConf[_0xbbfd('0x36')]()});return generateApiKey(_0x5f1973);}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function createJwt(_0x56dac5){return jwt[_0xbbfd('0x59')]({'iat':_0x56dac5[_0xbbfd('0x51')],'nonce':_0x56dac5[_0xbbfd('0x39')]},config[_0xbbfd('0x9')]['session'],{'algorithm':'HS512','subject':_0x56dac5['id'][_0xbbfd('0x54')](),'issuer':hardwareConf[_0xbbfd('0x36')](),'audience':hardwareConf['getUuid']()});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index edf83ea..d4ef0d5 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 _0x94fe=['data','unlink','crypto','bluebird','aes192','hasOwnProperty','createReadStream','createWriteStream','createCipher','algorithm','update','binary','end','write','close','decryptFile'];(function(_0x278df4,_0x58897a){var _0x2483e7=function(_0x1b2d1d){while(--_0x1b2d1d){_0x278df4['push'](_0x278df4['shift']());}};_0x2483e7(++_0x58897a);}(_0x94fe,0x1e2));var _0xe94f=function(_0x2117b0,_0x4b92a0){_0x2117b0=_0x2117b0-0x0;var _0x4f1bf6=_0x94fe[_0x2117b0];return _0x4f1bf6;};'use strict';var crypto=require(_0xe94f('0x0'));var fs=require('fs');var BPromise=require(_0xe94f('0x1'));var defaultOptions={'algorithm':_0xe94f('0x2')};function combineOptions(_0x4f7d6a){var _0x32686e={};for(var _0x184bd9 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x184bd9)){_0x32686e[_0x184bd9]=defaultOptions[_0x184bd9];}}if(_0x4f7d6a){for(var _0x32643c in _0x4f7d6a){if(_0x4f7d6a[_0xe94f('0x3')](_0x32643c)){_0x32686e[_0x32643c]=_0x4f7d6a[_0x32643c];}}}return _0x32686e;}exports['encryptFile']=function(_0x5da0b0,_0x3c3a5d,_0x1d64b8,_0x54b8d0){return new BPromise(function(_0x3349fe,_0x5d39d9){_0x54b8d0=combineOptions(_0x54b8d0);var _0x3d3822=new Buffer(_0x1d64b8);var _0x4a9048=fs[_0xe94f('0x4')](_0x5da0b0);var _0x524b1c=fs[_0xe94f('0x5')](_0x3c3a5d);var _0x1a7a4d=crypto[_0xe94f('0x6')](_0x54b8d0[_0xe94f('0x7')],_0x3d3822);_0x4a9048['on']('data',function(_0x327423){var _0x549544=new Buffer(_0x1a7a4d[_0xe94f('0x8')](_0x327423),_0xe94f('0x9'));_0x524b1c['write'](_0x549544);});_0x4a9048['on'](_0xe94f('0xa'),function(){try{var _0x243d79=new Buffer(_0x1a7a4d['final'](_0xe94f('0x9')),'binary');_0x524b1c[_0xe94f('0xb')](_0x243d79);_0x524b1c[_0xe94f('0xa')]();_0x524b1c['on'](_0xe94f('0xc'),function(){return _0x3349fe(_0x3c3a5d);});}catch(_0x431b09){fs['unlink'](_0x3c3a5d);return _0x5d39d9(_0x431b09);}});});};exports[_0xe94f('0xd')]=function(_0x323aff,_0x157011,_0x3c2258,_0x1fdca8){return new BPromise(function(_0x233fe3,_0x250098){_0x1fdca8=combineOptions(_0x1fdca8);var _0x4cb670=new Buffer(_0x3c2258);var _0x592e2b=fs[_0xe94f('0x4')](_0x323aff);var _0x20fd53=fs['createWriteStream'](_0x157011);var _0x5bc47=crypto['createDecipher'](_0x1fdca8['algorithm'],_0x4cb670);_0x592e2b['on'](_0xe94f('0xe'),function(_0xd82422){var _0xc20a12=new Buffer(_0x5bc47['update'](_0xd82422),_0xe94f('0x9'));_0x20fd53[_0xe94f('0xb')](_0xc20a12);});_0x592e2b['on'](_0xe94f('0xa'),function(){try{var _0x17b75d=new Buffer(_0x5bc47['final']('binary'),_0xe94f('0x9'));_0x20fd53['write'](_0x17b75d);_0x20fd53[_0xe94f('0xa')]();_0x20fd53['on'](_0xe94f('0xc'),function(){return _0x233fe3(_0x157011);});}catch(_0x1bdf88){fs[_0xe94f('0xf')](_0x157011);return _0x250098(_0x1bdf88);}});});}; \ No newline at end of file +var _0x4d24=['binary','end','final','write','close','unlink','decryptFile','algorithm','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update'];(function(_0x32e61e,_0x297c14){var _0x357194=function(_0x207e37){while(--_0x207e37){_0x32e61e['push'](_0x32e61e['shift']());}};_0x357194(++_0x297c14);}(_0x4d24,0x6e));var _0x44d2=function(_0x5e9383,_0x268888){_0x5e9383=_0x5e9383-0x0;var _0x4e830a=_0x4d24[_0x5e9383];return _0x4e830a;};'use strict';var crypto=require(_0x44d2('0x0'));var fs=require('fs');var BPromise=require(_0x44d2('0x1'));var defaultOptions={'algorithm':_0x44d2('0x2')};function combineOptions(_0x304301){var _0x1b15f8={};for(var _0x1b5e2b in defaultOptions){if(defaultOptions[_0x44d2('0x3')](_0x1b5e2b)){_0x1b15f8[_0x1b5e2b]=defaultOptions[_0x1b5e2b];}}if(_0x304301){for(var _0x3014ff in _0x304301){if(_0x304301[_0x44d2('0x3')](_0x3014ff)){_0x1b15f8[_0x3014ff]=_0x304301[_0x3014ff];}}}return _0x1b15f8;}exports[_0x44d2('0x4')]=function(_0x3f5d9a,_0x322f89,_0x282295,_0x33d789){return new BPromise(function(_0x26bffe,_0x5eff1d){_0x33d789=combineOptions(_0x33d789);var _0x147b48=new Buffer(_0x282295);var _0x131bda=fs['createReadStream'](_0x3f5d9a);var _0x2ac229=fs[_0x44d2('0x5')](_0x322f89);var _0x121e3d=crypto[_0x44d2('0x6')](_0x33d789['algorithm'],_0x147b48);_0x131bda['on'](_0x44d2('0x7'),function(_0x3bbbe6){var _0xd7fb0b=new Buffer(_0x121e3d[_0x44d2('0x8')](_0x3bbbe6),_0x44d2('0x9'));_0x2ac229['write'](_0xd7fb0b);});_0x131bda['on'](_0x44d2('0xa'),function(){try{var _0x3d0dd5=new Buffer(_0x121e3d[_0x44d2('0xb')](_0x44d2('0x9')),_0x44d2('0x9'));_0x2ac229[_0x44d2('0xc')](_0x3d0dd5);_0x2ac229[_0x44d2('0xa')]();_0x2ac229['on'](_0x44d2('0xd'),function(){return _0x26bffe(_0x322f89);});}catch(_0xdd60ec){fs[_0x44d2('0xe')](_0x322f89);return _0x5eff1d(_0xdd60ec);}});});};exports[_0x44d2('0xf')]=function(_0x32f43a,_0x95e834,_0x3cde7a,_0x1bb2d7){return new BPromise(function(_0x4b7abb,_0x5c4543){_0x1bb2d7=combineOptions(_0x1bb2d7);var _0xe9084=new Buffer(_0x3cde7a);var _0x1a4996=fs['createReadStream'](_0x32f43a);var _0x4cde81=fs[_0x44d2('0x5')](_0x95e834);var _0x11bdb5=crypto['createDecipher'](_0x1bb2d7[_0x44d2('0x10')],_0xe9084);_0x1a4996['on']('data',function(_0x28470b){var _0x34e116=new Buffer(_0x11bdb5[_0x44d2('0x8')](_0x28470b),_0x44d2('0x9'));_0x4cde81[_0x44d2('0xc')](_0x34e116);});_0x1a4996['on'](_0x44d2('0xa'),function(){try{var _0x321686=new Buffer(_0x11bdb5[_0x44d2('0xb')](_0x44d2('0x9')),_0x44d2('0x9'));_0x4cde81[_0x44d2('0xc')](_0x321686);_0x4cde81['end']();_0x4cde81['on'](_0x44d2('0xd'),function(){return _0x4b7abb(_0x95e834);});}catch(_0x26c6e8){fs['unlink'](_0x95e834);return _0x5c4543(_0x26c6e8);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 7977ffb..038583d 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 _0x573f=['info','format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','length','push','dirname','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename'];(function(_0xd3d66d,_0x2793e5){var _0x2c839a=function(_0x356836){while(--_0x356836){_0xd3d66d['push'](_0xd3d66d['shift']());}};_0x2c839a(++_0x2793e5);}(_0x573f,0x143));var _0xf573=function(_0x13930b,_0x120160){_0x13930b=_0x13930b-0x0;var _0x41b76b=_0x573f[_0x13930b];return _0x41b76b;};'use strict';var util=require(_0xf573('0x0'));var path=require(_0xf573('0x1'));var _=require(_0xf573('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xf573('0x3'));var zipdir=require(_0xf573('0x4'));var rimraf=require(_0xf573('0x5'));var db=require(_0xf573('0x6'))['db'];var dbH=require(_0xf573('0x6'))['dbH'];var logger=require(_0xf573('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xf573('0x8')][0x2]);var QUERY=process[_0xf573('0x8')][0x3];var PATH=process[_0xf573('0x8')][0x4];function analyticExtractedReport(_0x43b459,_0x57e9d6){var _0x429ac6={'status':_0x43b459};var _0x305cc0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57e9d6){_0x429ac6[_0xf573('0x9')]=_0x57e9d6;}return db['AnalyticExtractedReport']['update'](_0x429ac6,_0x305cc0);}function main(){var _0x410a41=0x1388;var _0x1a9d67;logger[_0xf573('0xa')](util[_0xf573('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf573('0xc')));return db[_0xf573('0xd')][_0xf573('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf573('0xf'),_0xf573('0x10')]})[_0xf573('0x11')](function(_0x558f5d){if(_0x558f5d){_0x1a9d67=_0x558f5d;_0x410a41=_0x1a9d67[_0xf573('0x10')]||0x1388;}})[_0xf573('0x11')](function(){return dbH[_0xf573('0x12')][_0xf573('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xf573('0x12')][_0xf573('0x14')][_0xf573('0x15')]});})[_0xf573('0x11')](function(_0x4f5616){if(!_0x4f5616[0x0][_0xf573('0x16')]){return analyticExtractedReport('Empty');}var _0x4fab80=[];var _0x4ed5a6=0x0;var _0x281b5e=!![];if(_0x4f5616&&_0x4f5616[_0xf573('0x17')]){var _0x471276=_0x4f5616[0x0]['num']%(_0x4ed5a6+_0x410a41);if(_0x1a9d67[_0xf573('0xf')]){for(;_0x281b5e;_0x4ed5a6+=_0x410a41,_0x471276=_0x4f5616[0x0][_0xf573('0x16')]%(_0x4ed5a6+_0x410a41)){if(_0x471276==0x0||_0x471276==_0x4f5616[0x0][_0xf573('0x16')]){_0x281b5e=![];}_0x4fab80['push'](dbH[_0xf573('0x12')]['query'](util[_0xf573('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x410a41,_0x4ed5a6),{'type':dbH[_0xf573('0x12')]['QueryTypes'][_0xf573('0x15')]}));}}else{_0x4fab80[_0xf573('0x18')](dbH[_0xf573('0x12')]['query'](QUERY,{'type':dbH[_0xf573('0x12')][_0xf573('0x14')]['SELECT']}));}}var _0x591562=path[_0xf573('0x19')](PATH);var _0x198f9f=path['basename'](PATH,_0xf573('0x1a'));var _0x15fd9b=_0x1a9d67[_0xf573('0xf')]&&_0x4fab80['length']>0x1;var _0x112bbc=[];if(!fs[_0xf573('0x1b')](path['join'](_0x591562,_0x198f9f))&&_0x15fd9b){fs[_0xf573('0x1c')](path[_0xf573('0x1d')](_0x591562,_0x198f9f));}return BPromise[_0xf573('0x1e')](_0x4fab80,function(_0x546941){_0x112bbc[_0xf573('0x18')](_0x546941);})[_0xf573('0x11')](function(){for(var _0x18a9bc=0x0;_0x18a9bc<_0x112bbc[_0xf573('0x17')];_0x18a9bc+=0x1){var _0x56b0a0;var _0x1e315a=_0x112bbc[_0x18a9bc];if(_0x15fd9b){_0x56b0a0=path[_0xf573('0x1d')](_0x591562,_0x198f9f,util['format'](_0xf573('0x1f'),_0x198f9f,_0x18a9bc,_0xf573('0x20')));}else{_0x56b0a0=path[_0xf573('0x1d')](_0x591562,util[_0xf573('0xb')](_0xf573('0x21'),_0x198f9f,_0xf573('0x20')));}fs['writeFileSync'](_0x56b0a0,csv(_0x1e315a));}})[_0xf573('0x11')](function(){if(_0x15fd9b){zipdir(path[_0xf573('0x1d')](_0x591562,_0x198f9f),{'saveTo':path[_0xf573('0x1d')](_0x591562,util[_0xf573('0xb')]('%s.%s',_0x198f9f,_0xf573('0x22')))},function(_0x1bbe96,_0x3b49ad){});rimraf(path[_0xf573('0x1d')](_0x591562,_0x198f9f),function(){});}})[_0xf573('0x11')](function(){logger[_0xf573('0xa')](util[_0xf573('0xb')](_0xf573('0x23'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x15fd9b?util[_0xf573('0xb')](_0xf573('0x21'),_0x198f9f,_0x15fd9b?_0xf573('0x22'):_0xf573('0x20')):null);});})[_0xf573('0x24')](function(_0x441ebb){logger[_0xf573('0xa')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf573('0xc')),util['inspect'](_0x441ebb,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x9095=['.csv','length','existsSync','join','mkdirSync','push','%s%d.%s','csv','%s.%s','writeFileSync','zip','Completed','catch','inspect','Failed','util','lodash','to-csv','rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x40746b,_0x46ebf8){var _0x27eea6=function(_0x4ee7ea){while(--_0x4ee7ea){_0x40746b['push'](_0x40746b['shift']());}};_0x27eea6(++_0x46ebf8);}(_0x9095,0xdc));var _0x5909=function(_0x5235a6,_0x680b76){_0x5235a6=_0x5235a6-0x0;var _0x1cf37e=_0x9095[_0x5235a6];return _0x1cf37e;};'use strict';var util=require(_0x5909('0x0'));var path=require('path');var _=require(_0x5909('0x1'));var csv=require(_0x5909('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0x5909('0x3'));var db=require(_0x5909('0x4'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0x5909('0x5'));var EXTRACTED_REPORT_ID=Number(process[_0x5909('0x6')][0x2]);var QUERY=process[_0x5909('0x6')][0x3];var PATH=process[_0x5909('0x6')][0x4];function analyticExtractedReport(_0x9ac0ae,_0x422c4d){var _0x4ec313={'status':_0x9ac0ae};var _0x3f7bfe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x422c4d){_0x4ec313['savename']=_0x422c4d;}return db[_0x5909('0x7')]['update'](_0x4ec313,_0x3f7bfe);}function main(){var _0x449c08=0x1388;var _0x4ac1ca;logger[_0x5909('0x8')](util[_0x5909('0x9')](_0x5909('0xa'),EXTRACTED_REPORT_ID,_0x5909('0xb')));return db[_0x5909('0xc')][_0x5909('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5909('0xe'),_0x5909('0xf')]})[_0x5909('0x10')](function(_0x2d51d0){if(_0x2d51d0){_0x4ac1ca=_0x2d51d0;_0x449c08=_0x4ac1ca[_0x5909('0xf')]||0x1388;}})[_0x5909('0x10')](function(){return dbH['sequelize']['query'](util[_0x5909('0x9')](_0x5909('0x11'),QUERY),{'type':dbH[_0x5909('0x12')][_0x5909('0x13')][_0x5909('0x14')]});})[_0x5909('0x10')](function(_0x17b463){if(!_0x17b463[0x0][_0x5909('0x15')]){return analyticExtractedReport('Empty');}var _0x303930=[];var _0x26db51=0x0;var _0x1b69b2=!![];if(_0x17b463&&_0x17b463['length']){var _0x277d2f=_0x17b463[0x0][_0x5909('0x15')]%(_0x26db51+_0x449c08);if(_0x4ac1ca[_0x5909('0xe')]){for(;_0x1b69b2;_0x26db51+=_0x449c08,_0x277d2f=_0x17b463[0x0][_0x5909('0x15')]%(_0x26db51+_0x449c08)){if(_0x277d2f==0x0||_0x277d2f==_0x17b463[0x0][_0x5909('0x15')]){_0x1b69b2=![];}_0x303930['push'](dbH[_0x5909('0x12')][_0x5909('0x16')](util[_0x5909('0x9')](_0x5909('0x17'),QUERY,_0x449c08,_0x26db51),{'type':dbH[_0x5909('0x12')]['QueryTypes']['SELECT']}));}}else{_0x303930['push'](dbH['sequelize'][_0x5909('0x16')](QUERY,{'type':dbH[_0x5909('0x12')]['QueryTypes'][_0x5909('0x14')]}));}}var _0x1f6411=path[_0x5909('0x18')](PATH);var _0x24cdff=path[_0x5909('0x19')](PATH,_0x5909('0x1a'));var _0x4897ae=_0x4ac1ca[_0x5909('0xe')]&&_0x303930[_0x5909('0x1b')]>0x1;var _0x43ff31=[];if(!fs[_0x5909('0x1c')](path[_0x5909('0x1d')](_0x1f6411,_0x24cdff))&&_0x4897ae){fs[_0x5909('0x1e')](path[_0x5909('0x1d')](_0x1f6411,_0x24cdff));}return BPromise['each'](_0x303930,function(_0x469234){_0x43ff31[_0x5909('0x1f')](_0x469234);})[_0x5909('0x10')](function(){for(var _0x2a9816=0x0;_0x2a9816<_0x43ff31[_0x5909('0x1b')];_0x2a9816+=0x1){var _0x1482f0;var _0x2a2b69=_0x43ff31[_0x2a9816];if(_0x4897ae){_0x1482f0=path[_0x5909('0x1d')](_0x1f6411,_0x24cdff,util['format'](_0x5909('0x20'),_0x24cdff,_0x2a9816,_0x5909('0x21')));}else{_0x1482f0=path[_0x5909('0x1d')](_0x1f6411,util[_0x5909('0x9')](_0x5909('0x22'),_0x24cdff,_0x5909('0x21')));}fs[_0x5909('0x23')](_0x1482f0,csv(_0x2a2b69));}})[_0x5909('0x10')](function(){if(_0x4897ae){zipdir(path[_0x5909('0x1d')](_0x1f6411,_0x24cdff),{'saveTo':path[_0x5909('0x1d')](_0x1f6411,util[_0x5909('0x9')](_0x5909('0x22'),_0x24cdff,_0x5909('0x24')))},function(_0x49f946,_0x37375d){});rimraf(path['join'](_0x1f6411,_0x24cdff),function(){});}})['then'](function(){logger[_0x5909('0x8')](util[_0x5909('0x9')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x5909('0xb')));return analyticExtractedReport(_0x5909('0x25'),_0x4897ae?util['format']('%s.%s',_0x24cdff,_0x4897ae?_0x5909('0x24'):'csv'):null);});})[_0x5909('0x26')](function(_0x497053){logger[_0x5909('0x8')](util[_0x5909('0x9')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x5909('0xb')),util[_0x5909('0x27')](_0x497053,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x5909('0x28'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index ba4c7a3..b811018 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 _0xa1d1=['landscape','header','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','createWriteStream','finish','log','err','end','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','util','path','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','Empty','dirname','Setting','find','splitSizePdf','then','length','num','push','sequelize','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','split','existsSync','join','mkdirSync','each','name','startDate','endDate'];(function(_0x1a8cda,_0x31d5d3){var _0x1bd298=function(_0x3f33c0){while(--_0x3f33c0){_0x1a8cda['push'](_0x1a8cda['shift']());}};_0x1bd298(++_0x31d5d3);}(_0xa1d1,0x170));var _0x1a1d=function(_0x35f659,_0x27b1f6){_0x35f659=_0x35f659-0x0;var _0x2d61c9=_0xa1d1[_0x35f659];return _0x2d61c9;};'use strict';var _=require(_0x1a1d('0x0'));var fs=require('fs');var BPromise=require(_0x1a1d('0x1'));var util=require(_0x1a1d('0x2'));var path=require(_0x1a1d('0x3'));var moment=require('moment');var PdfPrinter=require(_0x1a1d('0x4'));var zipdir=require(_0x1a1d('0x5'));var rimraf=require(_0x1a1d('0x6'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1a1d('0x7'))['dbH'];var logger=require(_0x1a1d('0x8'))(_0x1a1d('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x1a1d('0xa')][0x2]);var QUERY=process[_0x1a1d('0xa')][0x3];var PATH=process[_0x1a1d('0xa')][0x4];var NAME=process[_0x1a1d('0xa')][0x5];var FORMAT=_0x1a1d('0xb');var _extractedReport;function analyticExtractedReport(_0x207097,_0x3f61ed){var _0x5828d7={'status':_0x207097};var _0xe9cab5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f61ed){_0x5828d7[_0x1a1d('0xc')]=_0x3f61ed;}return db[_0x1a1d('0xd')][_0x1a1d('0xe')](_0x5828d7,_0xe9cab5);}function getHeader(_0x44d2f6){var _0xd6cc33=[];for(var _0x35e360 in _0x44d2f6){if(_0x44d2f6[_0x1a1d('0xf')](_0x35e360)){_0xd6cc33['push']({'text':_0x35e360,'style':_0x1a1d('0x10')});}}return _0xd6cc33;}function extractReport(_0x2bc139){var _0x57d36b=0x1388;var _0xc0b3c2;if(!_0x2bc139[0x0]['num']){return analyticExtractedReport(_0x1a1d('0x11'));}var _0x216ac5=[];var _0x549489=0x0;var _0x325089=!![];var _0x1ac9cf=path[_0x1a1d('0x12')](PATH);var _0x32e61d=path['basename'](PATH,'.pdf');var _0x74dea5=![];var _0xaf4288=[];return db[_0x1a1d('0x13')][_0x1a1d('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1a1d('0x15')]})[_0x1a1d('0x16')](function(_0x458bd4){if(_0x458bd4){_0xc0b3c2=_0x458bd4;_0x57d36b=_0xc0b3c2[_0x1a1d('0x15')]||0x3e8;}})[_0x1a1d('0x16')](function(){if(_0x2bc139&&_0x2bc139[_0x1a1d('0x17')]){var _0x453d8e=_0x2bc139[0x0][_0x1a1d('0x18')]%(_0x549489+_0x57d36b);if(_0xc0b3c2['split']){for(;_0x325089;_0x549489+=_0x57d36b,_0x453d8e=_0x2bc139[0x0]['num']%(_0x549489+_0x57d36b)){if(_0x453d8e==0x0||_0x453d8e==_0x2bc139[0x0]['num']){_0x325089=![];}_0x216ac5[_0x1a1d('0x19')](dbH[_0x1a1d('0x1a')][_0x1a1d('0x1b')](util[_0x1a1d('0x1c')](_0x1a1d('0x1d'),QUERY,_0x57d36b,_0x549489),{'type':dbH[_0x1a1d('0x1a')][_0x1a1d('0x1e')]['SELECT']}));}}else{_0x216ac5[_0x1a1d('0x19')](dbH[_0x1a1d('0x1a')][_0x1a1d('0x1b')](QUERY,{'type':dbH['sequelize'][_0x1a1d('0x1e')][_0x1a1d('0x1f')]}));}}_0x74dea5=_0xc0b3c2[_0x1a1d('0x20')]&&_0x216ac5['length']>0x1;if(!fs[_0x1a1d('0x21')](path[_0x1a1d('0x22')](_0x1ac9cf,_0x32e61d))&&_0x74dea5){fs[_0x1a1d('0x23')](path[_0x1a1d('0x22')](_0x1ac9cf,_0x32e61d));}return BPromise[_0x1a1d('0x24')](_0x216ac5,function(_0x16911c){_0xaf4288[_0x1a1d('0x19')](_0x16911c);});})[_0x1a1d('0x16')](function(){return BPromise[_0x1a1d('0x24')](_0x216ac5,function(_0x9ac19e,_0x9bc10d){var _0x44c753;var _0x2b539f=util[_0x1a1d('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0x1a1d('0x25')],moment(_extractedReport[_0x1a1d('0x26')])['format'](FORMAT),moment(_extractedReport[_0x1a1d('0x27')])['format'](FORMAT));var _0x4a5ba7={'pageSize':'A4','pageOrientation':_0x1a1d('0x28'),'content':[{'text':_0x2b539f,'style':_0x1a1d('0x29')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x4a8f85={'headerRows':0x1,'body':[]};_0x4a8f85[_0x1a1d('0x2a')][_0x1a1d('0x19')](getHeader(_0x9ac19e[0x0]));var _0x446c37;for(var _0x2757b1=0x0;_0x2757b1<_0x9ac19e[_0x1a1d('0x17')];_0x2757b1+=0x1){_0x446c37=[];for(var _0x1028ab in _0x9ac19e[_0x2757b1]){if(_0x9ac19e[_0x2757b1][_0x1a1d('0xf')](_0x1028ab)){_0x446c37[_0x1a1d('0x19')](_0x9ac19e[_0x2757b1][_0x1028ab]?_[_0x1a1d('0x2b')](_0x9ac19e[_0x2757b1][_0x1028ab]):'');}}_0x4a8f85[_0x1a1d('0x2a')][_0x1a1d('0x19')](_0x446c37);}_0x4a5ba7[_0x1a1d('0x2c')][_0x1a1d('0x19')]({'table':_0x4a8f85});return new BPromise(function(_0xbd6779,_0x1cbcdd){var _0x1b6ee8=new PdfPrinter({'Roboto':{'normal':__dirname+_0x1a1d('0x2d'),'bold':__dirname+_0x1a1d('0x2e'),'italics':__dirname+'/fonts/Roboto-Italic.ttf','bolditalics':__dirname+_0x1a1d('0x2f')}});var _0x519aa3=_0x1b6ee8[_0x1a1d('0x30')](_0x4a5ba7);if(_0x74dea5){_0x44c753=path[_0x1a1d('0x22')](_0x1ac9cf,_0x32e61d,util[_0x1a1d('0x1c')](_0x1a1d('0x31'),_0x32e61d,_0x9bc10d,'pdf'));}else{_0x44c753=path[_0x1a1d('0x22')](_0x1ac9cf,util[_0x1a1d('0x1c')]('%s.%s',_0x32e61d,_0x1a1d('0x32')));}var _0x141c01=_0x519aa3['pipe'](fs[_0x1a1d('0x33')](_0x44c753));_0x141c01['on'](_0x1a1d('0x34'),function(){_0xbd6779();});_0x141c01['on']('error',function(_0x54e966){console[_0x1a1d('0x35')](_0x1a1d('0x36'),_0x54e966);_0x1cbcdd(_0x54e966);});_0x519aa3[_0x1a1d('0x37')]();});});})[_0x1a1d('0x16')](function(){if(_0x74dea5){return new BPromise(function(_0x20ecef,_0x2dbb81){zipdir(path[_0x1a1d('0x22')](_0x1ac9cf,_0x32e61d),{'saveTo':path[_0x1a1d('0x22')](_0x1ac9cf,util['format'](_0x1a1d('0x38'),_0x32e61d,_0x1a1d('0x39')))},function(_0x1abde0){if(_0x1abde0){_0x2dbb81(_0x1abde0);}else{_0x20ecef();}});});}})[_0x1a1d('0x16')](function(){if(_0x74dea5){rimraf(path[_0x1a1d('0x22')](_0x1ac9cf,_0x32e61d),function(){});}})[_0x1a1d('0x16')](function(){logger['info'](util[_0x1a1d('0x1c')](_0x1a1d('0x3a'),EXTRACTED_REPORT_ID,_0x1a1d('0x3b')));return analyticExtractedReport(_0x1a1d('0x3c'),_0x74dea5?util[_0x1a1d('0x1c')]('%s.%s',_0x32e61d,_0x74dea5?'zip':'pdf'):null);});}function main(){logger[_0x1a1d('0x3d')](util['format'](_0x1a1d('0x3e'),EXTRACTED_REPORT_ID,_0x1a1d('0x3f')));return db[_0x1a1d('0xd')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1a1d('0x16')](function(_0xa61cf1){_extractedReport=_0xa61cf1;return dbH['sequelize'][_0x1a1d('0x1b')](util[_0x1a1d('0x1c')](_0x1a1d('0x40'),QUERY),{'type':dbH['sequelize'][_0x1a1d('0x1e')][_0x1a1d('0x1f')]});})[_0x1a1d('0x16')](extractReport)['catch'](function(_0x42491e){logger['info'](util[_0x1a1d('0x1c')](_0x1a1d('0x41'),EXTRACTED_REPORT_ID,_0x1a1d('0x3f')),util[_0x1a1d('0x42')](_0x42491e,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1a1d('0x43'));});}main(); \ No newline at end of file +var _0x736d=['black','body','toString','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','pdf','pipe','createWriteStream','finish','error','log','err','end','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','hasOwnProperty','push','tableHeader','num','Empty','dirname','Setting','find','split','splitSizePdf','then','length','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','landscape','header'];(function(_0x45a47d,_0x32f7ab){var _0xe96f10=function(_0x27e27e){while(--_0x27e27e){_0x45a47d['push'](_0x45a47d['shift']());}};_0xe96f10(++_0x32f7ab);}(_0x736d,0x174));var _0xd736=function(_0x3b0675,_0x17502a){_0x3b0675=_0x3b0675-0x0;var _0x11b775=_0x736d[_0x3b0675];return _0x11b775;};'use strict';var _=require(_0xd736('0x0'));var fs=require('fs');var BPromise=require(_0xd736('0x1'));var util=require(_0xd736('0x2'));var path=require(_0xd736('0x3'));var moment=require(_0xd736('0x4'));var PdfPrinter=require(_0xd736('0x5'));var zipdir=require(_0xd736('0x6'));var rimraf=require(_0xd736('0x7'));var db=require(_0xd736('0x8'))['db'];var dbH=require(_0xd736('0x8'))[_0xd736('0x9')];var logger=require(_0xd736('0xa'))(_0xd736('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xd736('0xc')][0x2]);var QUERY=process[_0xd736('0xc')][0x3];var PATH=process[_0xd736('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xd736('0xd');var _extractedReport;function analyticExtractedReport(_0xe62499,_0x3d0c5d){var _0xcfa227={'status':_0xe62499};var _0x1af333={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3d0c5d){_0xcfa227[_0xd736('0xe')]=_0x3d0c5d;}return db['AnalyticExtractedReport'][_0xd736('0xf')](_0xcfa227,_0x1af333);}function getHeader(_0x485cd4){var _0x48a69d=[];for(var _0x519d5f in _0x485cd4){if(_0x485cd4[_0xd736('0x10')](_0x519d5f)){_0x48a69d[_0xd736('0x11')]({'text':_0x519d5f,'style':_0xd736('0x12')});}}return _0x48a69d;}function extractReport(_0x3dc91f){var _0x86d8b5=0x1388;var _0x182a10;if(!_0x3dc91f[0x0][_0xd736('0x13')]){return analyticExtractedReport(_0xd736('0x14'));}var _0x35f9b5=[];var _0x13bb3a=0x0;var _0x391037=!![];var _0xfaac7d=path[_0xd736('0x15')](PATH);var _0x18a08d=path['basename'](PATH,'.pdf');var _0x30e88d=![];var _0x45d4a0=[];return db[_0xd736('0x16')][_0xd736('0x17')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd736('0x18'),'splitSizePdf']})['then'](function(_0x374dc8){if(_0x374dc8){_0x182a10=_0x374dc8;_0x86d8b5=_0x182a10[_0xd736('0x19')]||0x3e8;}})[_0xd736('0x1a')](function(){if(_0x3dc91f&&_0x3dc91f[_0xd736('0x1b')]){var _0x176604=_0x3dc91f[0x0][_0xd736('0x13')]%(_0x13bb3a+_0x86d8b5);if(_0x182a10[_0xd736('0x18')]){for(;_0x391037;_0x13bb3a+=_0x86d8b5,_0x176604=_0x3dc91f[0x0][_0xd736('0x13')]%(_0x13bb3a+_0x86d8b5)){if(_0x176604==0x0||_0x176604==_0x3dc91f[0x0][_0xd736('0x13')]){_0x391037=![];}_0x35f9b5[_0xd736('0x11')](dbH[_0xd736('0x1c')][_0xd736('0x1d')](util['format'](_0xd736('0x1e'),QUERY,_0x86d8b5,_0x13bb3a),{'type':dbH[_0xd736('0x1c')]['QueryTypes']['SELECT']}));}}else{_0x35f9b5['push'](dbH[_0xd736('0x1c')]['query'](QUERY,{'type':dbH[_0xd736('0x1c')][_0xd736('0x1f')]['SELECT']}));}}_0x30e88d=_0x182a10[_0xd736('0x18')]&&_0x35f9b5[_0xd736('0x1b')]>0x1;if(!fs[_0xd736('0x20')](path[_0xd736('0x21')](_0xfaac7d,_0x18a08d))&&_0x30e88d){fs[_0xd736('0x22')](path[_0xd736('0x21')](_0xfaac7d,_0x18a08d));}return BPromise[_0xd736('0x23')](_0x35f9b5,function(_0x4ec9d9){_0x45d4a0['push'](_0x4ec9d9);});})[_0xd736('0x1a')](function(){return BPromise[_0xd736('0x23')](_0x35f9b5,function(_0x52233d,_0xd12f27){var _0x286d23;var _0x354397=util['format'](_0xd736('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xd736('0x25')])[_0xd736('0x26')](FORMAT),moment(_extractedReport[_0xd736('0x27')])[_0xd736('0x26')](FORMAT));var _0x12178a={'pageSize':'A4','pageOrientation':_0xd736('0x28'),'content':[{'text':_0x354397,'style':_0xd736('0x29')}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd736('0x2a')}}};var _0x1d3a96={'headerRows':0x1,'body':[]};_0x1d3a96[_0xd736('0x2b')][_0xd736('0x11')](getHeader(_0x52233d[0x0]));var _0x1d6053;for(var _0x5333d2=0x0;_0x5333d2<_0x52233d[_0xd736('0x1b')];_0x5333d2+=0x1){_0x1d6053=[];for(var _0x74d93a in _0x52233d[_0x5333d2]){if(_0x52233d[_0x5333d2][_0xd736('0x10')](_0x74d93a)){_0x1d6053[_0xd736('0x11')](_0x52233d[_0x5333d2][_0x74d93a]?_[_0xd736('0x2c')](_0x52233d[_0x5333d2][_0x74d93a]):'');}}_0x1d3a96[_0xd736('0x2b')][_0xd736('0x11')](_0x1d6053);}_0x12178a[_0xd736('0x2d')][_0xd736('0x11')]({'table':_0x1d3a96});return new BPromise(function(_0x158b10,_0x31c548){var _0x109c88=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xd736('0x2e'),'italics':__dirname+_0xd736('0x2f'),'bolditalics':__dirname+_0xd736('0x30')}});var _0x314fa5=_0x109c88['createPdfKitDocument'](_0x12178a);if(_0x30e88d){_0x286d23=path[_0xd736('0x21')](_0xfaac7d,_0x18a08d,util['format']('%s%d.%s',_0x18a08d,_0xd12f27,_0xd736('0x31')));}else{_0x286d23=path[_0xd736('0x21')](_0xfaac7d,util[_0xd736('0x26')]('%s.%s',_0x18a08d,_0xd736('0x31')));}var _0x34f057=_0x314fa5[_0xd736('0x32')](fs[_0xd736('0x33')](_0x286d23));_0x34f057['on'](_0xd736('0x34'),function(){_0x158b10();});_0x34f057['on'](_0xd736('0x35'),function(_0x2b009f){console[_0xd736('0x36')](_0xd736('0x37'),_0x2b009f);_0x31c548(_0x2b009f);});_0x314fa5[_0xd736('0x38')]();});});})[_0xd736('0x1a')](function(){if(_0x30e88d){return new BPromise(function(_0x2ad726,_0x1623ec){zipdir(path[_0xd736('0x21')](_0xfaac7d,_0x18a08d),{'saveTo':path[_0xd736('0x21')](_0xfaac7d,util[_0xd736('0x26')](_0xd736('0x39'),_0x18a08d,_0xd736('0x3a')))},function(_0xe612d8){if(_0xe612d8){_0x1623ec(_0xe612d8);}else{_0x2ad726();}});});}})[_0xd736('0x1a')](function(){if(_0x30e88d){rimraf(path[_0xd736('0x21')](_0xfaac7d,_0x18a08d),function(){});}})[_0xd736('0x1a')](function(){logger[_0xd736('0x3b')](util[_0xd736('0x26')](_0xd736('0x3c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xd736('0x3d'),_0x30e88d?util[_0xd736('0x26')]('%s.%s',_0x18a08d,_0x30e88d?_0xd736('0x3a'):_0xd736('0x31')):null);});}function main(){logger[_0xd736('0x3b')](util[_0xd736('0x26')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xd736('0x3e')));return db[_0xd736('0x3f')][_0xd736('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd736('0x1a')](function(_0x2682e5){_extractedReport=_0x2682e5;return dbH[_0xd736('0x1c')][_0xd736('0x1d')](util[_0xd736('0x26')](_0xd736('0x41'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0xd736('0x1a')](extractReport)['catch'](function(_0xb1cbde){logger[_0xd736('0x3b')](util[_0xd736('0x26')](_0xd736('0x42'),EXTRACTED_REPORT_ID,_0xd736('0x3e')),util[_0xd736('0x43')](_0xb1cbde,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xd736('0x44'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 750f495..ba1c9b9 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 _0x8a5c=['xlsx','writeFileSync','binary','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','SELECT','num','Empty','length','push','QueryTypes','query','dirname','.xlsx','join','mkdirSync','each','%s%d.%s'];(function(_0x47febb,_0x5b35c0){var _0x4599db=function(_0x4fd759){while(--_0x4fd759){_0x47febb['push'](_0x47febb['shift']());}};_0x4599db(++_0x5b35c0);}(_0x8a5c,0x112));var _0xc8a5=function(_0x4bdc86,_0x433876){_0x4bdc86=_0x4bdc86-0x0;var _0x3a29ac=_0x8a5c[_0x4bdc86];return _0x3a29ac;};'use strict';var util=require('util');var path=require(_0xc8a5('0x0'));var _=require(_0xc8a5('0x1'));var fs=require('fs');var json2xls=require(_0xc8a5('0x2'));var BPromise=require(_0xc8a5('0x3'));var zipdir=require(_0xc8a5('0x4'));var rimraf=require('rimraf');var db=require(_0xc8a5('0x5'))['db'];var dbH=require(_0xc8a5('0x5'))['dbH'];var logger=require(_0xc8a5('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc8a5('0x7')][0x2]);var QUERY=process[_0xc8a5('0x7')][0x3];var PATH=process[_0xc8a5('0x7')][0x4];function analyticExtractedReport(_0x3992ad,_0x276c15){var _0x3a03af={'status':_0x3992ad};var _0x1de487={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x276c15){_0x3a03af[_0xc8a5('0x8')]=_0x276c15;}return db[_0xc8a5('0x9')][_0xc8a5('0xa')](_0x3a03af,_0x1de487);}function main(){var _0x1b6dbc=0x1388;var _0x1a5d79;logger[_0xc8a5('0xb')](util[_0xc8a5('0xc')](_0xc8a5('0xd'),EXTRACTED_REPORT_ID,_0xc8a5('0xe')));return db[_0xc8a5('0xf')][_0xc8a5('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc8a5('0x11'),_0xc8a5('0x12')]})['then'](function(_0xed43c2){if(_0xed43c2){_0x1a5d79=_0xed43c2;_0x1b6dbc=_0x1a5d79['splitSizeXlsx']||0x1388;}})[_0xc8a5('0x13')](function(){return dbH[_0xc8a5('0x14')]['query'](util[_0xc8a5('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xc8a5('0x15')]});})['then'](function(_0x29fdb3){if(!_0x29fdb3[0x0][_0xc8a5('0x16')]){return analyticExtractedReport(_0xc8a5('0x17'));}var _0x2de1af=[];var _0x418fc3=0x0;var _0x21cb27=!![];if(_0x1a5d79[_0xc8a5('0x11')]){if(_0x29fdb3&&_0x29fdb3[_0xc8a5('0x18')]){var _0x15e97b=_0x29fdb3[0x0][_0xc8a5('0x16')]%(_0x418fc3+_0x1b6dbc);for(;_0x21cb27;_0x418fc3+=_0x1b6dbc,_0x15e97b=_0x29fdb3[0x0][_0xc8a5('0x16')]%(_0x418fc3+_0x1b6dbc)){if(_0x15e97b==0x0||_0x15e97b==_0x29fdb3[0x0][_0xc8a5('0x16')]){_0x21cb27=![];}_0x2de1af[_0xc8a5('0x19')](dbH[_0xc8a5('0x14')]['query'](util[_0xc8a5('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1b6dbc,_0x418fc3),{'type':dbH['sequelize'][_0xc8a5('0x1a')][_0xc8a5('0x15')]}));}}}else{_0x2de1af[_0xc8a5('0x19')](dbH[_0xc8a5('0x14')][_0xc8a5('0x1b')](QUERY,{'type':dbH[_0xc8a5('0x14')][_0xc8a5('0x1a')][_0xc8a5('0x15')]}));}var _0x1a72e1=path[_0xc8a5('0x1c')](PATH);var _0x4761c3=path['basename'](PATH,_0xc8a5('0x1d'));var _0x24b21c=_0x1a5d79[_0xc8a5('0x11')]&&_0x2de1af[_0xc8a5('0x18')]>0x1;var _0x417f7f=[];if(!fs['existsSync'](path[_0xc8a5('0x1e')](_0x1a72e1,_0x4761c3))&&_0x24b21c){fs[_0xc8a5('0x1f')](path[_0xc8a5('0x1e')](_0x1a72e1,_0x4761c3));}return BPromise[_0xc8a5('0x20')](_0x2de1af,function(_0x57cbcf){_0x417f7f[_0xc8a5('0x19')](_0x57cbcf);})[_0xc8a5('0x13')](function(){for(var _0x236b45=0x0;_0x236b45<_0x417f7f[_0xc8a5('0x18')];_0x236b45+=0x1){var _0x70aca5;var _0x1922fd=_0x417f7f[_0x236b45];if(_0x24b21c){_0x70aca5=path[_0xc8a5('0x1e')](_0x1a72e1,_0x4761c3,util[_0xc8a5('0xc')](_0xc8a5('0x21'),_0x4761c3,_0x236b45,_0xc8a5('0x22')));}else{_0x70aca5=path['join'](_0x1a72e1,util['format']('%s.%s',_0x4761c3,_0xc8a5('0x22')));}fs[_0xc8a5('0x23')](_0x70aca5,json2xls(_0x1922fd),_0xc8a5('0x24'));}})[_0xc8a5('0x13')](function(){if(_0x24b21c){zipdir(path['join'](_0x1a72e1,_0x4761c3),{'saveTo':path[_0xc8a5('0x1e')](_0x1a72e1,util[_0xc8a5('0xc')](_0xc8a5('0x25'),_0x4761c3,'zip'))},function(_0x55be1d,_0x2e6f60){});rimraf(path[_0xc8a5('0x1e')](_0x1a72e1,_0x4761c3),function(){});}})[_0xc8a5('0x13')](function(){logger['info'](util[_0xc8a5('0xc')](_0xc8a5('0x26'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xc8a5('0x27'),_0x24b21c?util[_0xc8a5('0xc')]('%s.%s',_0x4761c3,_0x24b21c?_0xc8a5('0x28'):_0xc8a5('0x22')):null);});})[_0xc8a5('0x29')](function(_0x30a0d1){logger[_0xc8a5('0xb')](util[_0xc8a5('0xc')](_0xc8a5('0x2a'),EXTRACTED_REPORT_ID,_0xc8a5('0xe')),util['inspect'](_0x30a0d1,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xc8a5('0x2b'));});}main(); \ No newline at end of file +var _0xfc4f=['analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','path','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0xfc4f,0x1d2));var _0xffc4=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xfc4f[_0x3947c9];return _0x2e7871;};'use strict';var util=require('util');var path=require(_0xffc4('0x0'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xffc4('0x1'));var BPromise=require(_0xffc4('0x2'));var zipdir=require(_0xffc4('0x3'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xffc4('0x4'))[_0xffc4('0x5')];var logger=require(_0xffc4('0x6'))(_0xffc4('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xffc4('0x8')][0x2]);var QUERY=process[_0xffc4('0x8')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x2c4bff,_0x2979cc){var _0xe69bac={'status':_0x2c4bff};var _0x1948ac={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2979cc){_0xe69bac[_0xffc4('0x9')]=_0x2979cc;}return db[_0xffc4('0xa')]['update'](_0xe69bac,_0x1948ac);}function main(){var _0x182241=0x1388;var _0x327284;logger['info'](util[_0xffc4('0xb')](_0xffc4('0xc'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xffc4('0xd')][_0xffc4('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xffc4('0xf'),_0xffc4('0x10')]})[_0xffc4('0x11')](function(_0xf39e2d){if(_0xf39e2d){_0x327284=_0xf39e2d;_0x182241=_0x327284[_0xffc4('0x10')]||0x1388;}})['then'](function(){return dbH[_0xffc4('0x12')][_0xffc4('0x13')](util[_0xffc4('0xb')](_0xffc4('0x14'),QUERY),{'type':dbH[_0xffc4('0x12')][_0xffc4('0x15')][_0xffc4('0x16')]});})[_0xffc4('0x11')](function(_0x139600){if(!_0x139600[0x0]['num']){return analyticExtractedReport(_0xffc4('0x17'));}var _0x3f3ab6=[];var _0x134eb6=0x0;var _0x26ca79=!![];if(_0x327284[_0xffc4('0xf')]){if(_0x139600&&_0x139600[_0xffc4('0x18')]){var _0x375af9=_0x139600[0x0][_0xffc4('0x19')]%(_0x134eb6+_0x182241);for(;_0x26ca79;_0x134eb6+=_0x182241,_0x375af9=_0x139600[0x0][_0xffc4('0x19')]%(_0x134eb6+_0x182241)){if(_0x375af9==0x0||_0x375af9==_0x139600[0x0][_0xffc4('0x19')]){_0x26ca79=![];}_0x3f3ab6['push'](dbH[_0xffc4('0x12')][_0xffc4('0x13')](util[_0xffc4('0xb')](_0xffc4('0x1a'),QUERY,_0x182241,_0x134eb6),{'type':dbH[_0xffc4('0x12')][_0xffc4('0x15')][_0xffc4('0x16')]}));}}}else{_0x3f3ab6['push'](dbH['sequelize'][_0xffc4('0x13')](QUERY,{'type':dbH[_0xffc4('0x12')][_0xffc4('0x15')][_0xffc4('0x16')]}));}var _0x53c82a=path[_0xffc4('0x1b')](PATH);var _0x4a75bf=path['basename'](PATH,_0xffc4('0x1c'));var _0x15f909=_0x327284[_0xffc4('0xf')]&&_0x3f3ab6[_0xffc4('0x18')]>0x1;var _0x34e1a0=[];if(!fs[_0xffc4('0x1d')](path['join'](_0x53c82a,_0x4a75bf))&&_0x15f909){fs[_0xffc4('0x1e')](path[_0xffc4('0x1f')](_0x53c82a,_0x4a75bf));}return BPromise[_0xffc4('0x20')](_0x3f3ab6,function(_0x10d8dc){_0x34e1a0['push'](_0x10d8dc);})[_0xffc4('0x11')](function(){for(var _0x36cc4d=0x0;_0x36cc4d<_0x34e1a0['length'];_0x36cc4d+=0x1){var _0x38387e;var _0x9113df=_0x34e1a0[_0x36cc4d];if(_0x15f909){_0x38387e=path[_0xffc4('0x1f')](_0x53c82a,_0x4a75bf,util[_0xffc4('0xb')](_0xffc4('0x21'),_0x4a75bf,_0x36cc4d,_0xffc4('0x22')));}else{_0x38387e=path[_0xffc4('0x1f')](_0x53c82a,util['format'](_0xffc4('0x23'),_0x4a75bf,'xlsx'));}fs[_0xffc4('0x24')](_0x38387e,json2xls(_0x9113df),_0xffc4('0x25'));}})[_0xffc4('0x11')](function(){if(_0x15f909){zipdir(path[_0xffc4('0x1f')](_0x53c82a,_0x4a75bf),{'saveTo':path[_0xffc4('0x1f')](_0x53c82a,util[_0xffc4('0xb')](_0xffc4('0x23'),_0x4a75bf,'zip'))},function(_0x54d9a0,_0x2bd0ad){});rimraf(path['join'](_0x53c82a,_0x4a75bf),function(){});}})[_0xffc4('0x11')](function(){logger[_0xffc4('0x26')](util[_0xffc4('0xb')](_0xffc4('0x27'),EXTRACTED_REPORT_ID,_0xffc4('0x28')));return analyticExtractedReport(_0xffc4('0x29'),_0x15f909?util[_0xffc4('0xb')](_0xffc4('0x23'),_0x4a75bf,_0x15f909?'zip':'xlsx'):null);});})['catch'](function(_0x2eb1a5){logger[_0xffc4('0x26')](util['format'](_0xffc4('0x2a'),EXTRACTED_REPORT_ID,_0xffc4('0x28')),util['inspect'](_0x2eb1a5,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index b373b8c..67a34b2 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 _0x91d0=['CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','indexOf','app','toLowerCase','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','concat','Hangup','destroy','bulkCreate','catch','error','rewrite','util','Interval','findAll','then','intervals','models','IntervalId','VoiceExtension','exten','filter','groupBy','queue','hasOwnProperty','priority','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','VoiceExtensionId','outbound','${EXTEN:','cutdigits','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','map','tag'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x91d0,0xe4));var _0x091d=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x91d0[_0x11c573];return _0x6b72de;};'use strict';var _=require('lodash');var util=require(_0x091d('0x0'));function rewrite(_0x345ae5,_0x54541f){var _0x3a2075=this;return _0x345ae5['models'][_0x091d('0x1')][_0x091d('0x2')]({'raw':!![]})[_0x091d('0x3')](function(_0x1ff425){_0x3a2075[_0x091d('0x4')]=_0x1ff425;return _0x345ae5[_0x091d('0x5')]['VoiceExtension'][_0x091d('0x2')]({'where':{'IntervalId':_0x54541f[_0x091d('0x6')]},'raw':!![]});})['then'](function(_0x5d415f){return _0x345ae5[_0x091d('0x5')][_0x091d('0x7')]['findAll']({'where':{'exten':{'$in':_['uniq'](_['map'](_0x5d415f,_0x091d('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x091d('0x3')](function(_0x32126a){var _0x6c200f=_[_0x091d('0x9')](_0x32126a,{'priority':'1'});var _0x4dd906=_[_0x091d('0x9')](_0x32126a,{'isApp':0x1});var _0x580368=_[_0x091d('0xa')](_0x4dd906,_0x091d('0x8'));var _0x3670f9=[_0x091d('0xb'),'playback'];var _0x5f3c47=[];var _0x14c17f=[];for(var _0x23a153 in _0x580368){if(_0x580368[_0x091d('0xc')](_0x23a153)){_0x3a2075[_0x091d('0xd')]=0x2;_0x3a2075[_0x091d('0xe')]=[];_0x3a2075[_0x091d('0xf')]=_[_0x091d('0x10')](_0x6c200f,{'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')]});_0x3a2075['extensions'][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':util[_0x091d('0x14')](_0x091d('0x15'),_0x580368[_0x23a153][0x0]['type']),'context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0]['exten'],'priority':_0x3a2075[_0x091d('0xd')]++,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});if(_0x580368[_0x23a153][0x0]['type']===_0x091d('0x18')){if(_0x3a2075['extension']){_0x3a2075['extensions'][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':'CDR(destination)='+(_0x3a2075[_0x091d('0xf')]['cutdigits']?_0x091d('0x19')+_0x3a2075[_0x091d('0xf')][_0x091d('0x1a')]+'}':'${EXTEN}'),'context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'priority':_0x3a2075[_0x091d('0xd')]++,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});}_0x3a2075[_0x091d('0xe')][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':_0x091d('0x1b')+_0x580368[_0x23a153][0x0][_0x091d('0x17')],'context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'priority':_0x3a2075[_0x091d('0xd')]++,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});var _0x546357=_0x3a2075['priority']++;_0x3a2075[_0x091d('0xe')][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':'ExecIf','appdata':_0x091d('0x1c')+(_0x546357+0x2)+_0x091d('0x1d')+(_0x546357+0x1)+')','context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'priority':_0x546357,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});if(_0x3a2075[_0x091d('0xf')]){_0x3a2075[_0x091d('0xe')][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0]['type'],'app':_0x091d('0x13'),'appdata':_0x3a2075[_0x091d('0xf')][_0x091d('0x1a')]?_0x091d('0x1e')+_0x3a2075[_0x091d('0xf')]['cutdigits']+'}':_0x091d('0x1f'),'context':_0x580368[_0x23a153][0x0]['context'],'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'priority':_0x3a2075[_0x091d('0xd')]++,'VoiceExtensionId':_0x580368[_0x23a153][0x0]['VoiceExtensionId']});}_0x3a2075['extensions'][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0]['type'],'app':'Set','appdata':_0x091d('0x20')+_0x580368[_0x23a153][0x0][_0x091d('0x17')],'context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'priority':_0x3a2075['priority']++,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});if(_0x3a2075[_0x091d('0xf')]&&_0x3a2075[_0x091d('0xf')]['hasOwnProperty'](_0x091d('0x21'))&&_0x3a2075[_0x091d('0xf')][_0x091d('0x21')]!==_0x091d('0x22')){_0x3a2075[_0x091d('0xe')][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':'Set','appdata':_0x091d('0x23'),'context':_0x580368[_0x23a153][0x0]['context'],'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'priority':_0x3a2075[_0x091d('0xd')]++,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});_0x3a2075[_0x091d('0xe')]['push']({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':'Set','appdata':_0x091d('0x24')+_0x3a2075[_0x091d('0xf')][_0x091d('0x21')]||_0x091d('0x25'),'context':_0x580368[_0x23a153][0x0]['context'],'exten':_0x580368[_0x23a153][0x0]['exten'],'priority':_0x3a2075[_0x091d('0xd')]++,'VoiceExtensionId':_0x580368[_0x23a153][0x0]['VoiceExtensionId']});}}_0x3a2075[_0x091d('0xe')][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0]['type'],'app':'Set','appdata':_0x091d('0x26'),'context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'priority':_0x3a2075[_0x091d('0xd')]++,'VoiceExtensionId':_0x580368[_0x23a153][0x0]['VoiceExtensionId']});_0x3a2075[_0x091d('0xe')][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':_0x091d('0x27'),'context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0]['exten'],'priority':_0x3a2075['priority']++,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});_0x3a2075[_0x091d('0xe')]['push']({'type':_0x580368[_0x23a153][0x0][_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':_0x091d('0x28'),'context':_0x580368[_0x23a153][0x0][_0x091d('0x16')],'exten':_0x580368[_0x23a153][0x0]['exten'],'priority':_0x3a2075['priority']++,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});for(var _0x567b22=0x0,_0x5b4058=0x0;_0x567b22<_0x580368[_0x23a153][_0x091d('0x29')];_0x567b22+=0x1,_0x5b4058=0x0){var _0x49ca49=_0x580368[_0x23a153][_0x567b22];if(_0x49ca49['type']){_0x49ca49['type']=_0x49ca49[_0x091d('0x12')]['toLowerCase']();}var _0x2757bb=[];var _0x1fcb95=[];delete _0x49ca49['id'];delete _0x49ca49[_0x091d('0x2a')];delete _0x49ca49[_0x091d('0x2b')];var _0x2f4764=_0x49ca49[_0x091d('0x2c')]!==_0x091d('0x2d')?[_0x49ca49['interval']]:_0x49ca49[_0x091d('0x6')]?_[_0x091d('0x2e')](_[_0x091d('0x9')](_0x3a2075[_0x091d('0x4')],{'IntervalId':_0x49ca49[_0x091d('0x6')]}),'interval'):[];if(_0x49ca49[_0x091d('0xc')](_0x091d('0x2f'))){if(_0x49ca49[_0x091d('0x2f')]&&_0x49ca49[_0x091d('0x2f')]!=='--'){_0x2757bb[_0x091d('0x11')]({'type':_0x49ca49[_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':_0x091d('0x30')+_0x49ca49[_0x091d('0x2f')],'context':_0x49ca49[_0x091d('0x16')],'exten':_0x49ca49[_0x091d('0x8')],'priority':_0x2f4764[_0x091d('0x29')]+_0x3a2075[_0x091d('0xd')]+_0x5b4058++,'VoiceExtensionId':_0x49ca49[_0x091d('0x17')]});}}if(_0x49ca49['type']===_0x091d('0x18')&&_0x49ca49[_0x091d('0xc')]('callerID')){if(_0x49ca49['callerID']){_0x2757bb[_0x091d('0x11')]({'type':_0x49ca49[_0x091d('0x12')],'app':_0x091d('0x31'),'appdata':_0x091d('0x32')+_0x49ca49[_0x091d('0x33')]+')','context':_0x49ca49[_0x091d('0x16')],'exten':_0x49ca49[_0x091d('0x8')],'priority':_0x2f4764[_0x091d('0x29')]+_0x3a2075[_0x091d('0xd')]+_0x5b4058++,'VoiceExtensionId':_0x49ca49[_0x091d('0x17')]});}else{_0x2757bb[_0x091d('0x11')]({'type':_0x49ca49[_0x091d('0x12')],'app':_0x091d('0x31'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x49ca49['context'],'exten':_0x49ca49['exten'],'priority':_0x2f4764[_0x091d('0x29')]+_0x3a2075[_0x091d('0xd')]+_0x5b4058++,'VoiceExtensionId':_0x49ca49[_0x091d('0x17')]});}}if(_0x49ca49[_0x091d('0xc')]('answer')){if(_0x3670f9[_0x091d('0x34')](_0x49ca49[_0x091d('0x35')][_0x091d('0x36')]())>=0x0&&_0x49ca49['appType']!==_0x091d('0x37')){if(_0x49ca49['answer']){_0x2757bb[_0x091d('0x11')]({'type':_0x49ca49['type'],'app':_0x091d('0x31'),'appdata':_0x091d('0x38'),'context':_0x49ca49[_0x091d('0x16')],'exten':_0x49ca49['exten'],'priority':_0x2f4764[_0x091d('0x29')]+_0x3a2075[_0x091d('0xd')]+_0x5b4058++,'VoiceExtensionId':_0x49ca49[_0x091d('0x17')]});_0x2757bb[_0x091d('0x11')]({'type':_0x49ca49[_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':_0x091d('0x39'),'context':_0x49ca49[_0x091d('0x16')],'exten':_0x49ca49[_0x091d('0x8')],'priority':_0x2f4764[_0x091d('0x29')]+_0x3a2075[_0x091d('0xd')]+_0x5b4058++,'VoiceExtensionId':_0x49ca49['VoiceExtensionId']});}else{_0x2757bb[_0x091d('0x11')]({'type':_0x49ca49[_0x091d('0x12')],'app':'ExecIf','appdata':_0x091d('0x3a'),'context':_0x49ca49[_0x091d('0x16')],'exten':_0x49ca49[_0x091d('0x8')],'priority':_0x2f4764[_0x091d('0x29')]+_0x3a2075['priority']+_0x5b4058++,'VoiceExtensionId':_0x49ca49['VoiceExtensionId']});_0x2757bb[_0x091d('0x11')]({'type':_0x49ca49[_0x091d('0x12')],'app':_0x091d('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x49ca49['context'],'exten':_0x49ca49[_0x091d('0x8')],'priority':_0x2f4764[_0x091d('0x29')]+_0x3a2075[_0x091d('0xd')]+_0x5b4058++,'VoiceExtensionId':_0x49ca49['VoiceExtensionId']});}}}for(var _0x39c48f=0x0;_0x39c48f<_0x2f4764[_0x091d('0x29')];_0x39c48f+=0x1){var _0x33e881=_0x3a2075[_0x091d('0xd')]+_0x2f4764[_0x091d('0x29')];var _0x116a6a=_0x39c48f===_0x2f4764[_0x091d('0x29')]-0x1?_0x3a2075[_0x091d('0xd')]+_0x2757bb[_0x091d('0x29')]+_0x1fcb95[_0x091d('0x29')]+0x2:_0x3a2075[_0x091d('0xd')]+_0x39c48f+0x1;_0x2757bb[_0x091d('0x3b')](_0x39c48f,0x0,{'type':_0x49ca49['type'],'app':_0x091d('0x3c'),'appdata':_0x2f4764[_0x39c48f]+'?'+_0x49ca49[_0x091d('0x16')]+_0x091d('0x3d')+_0x33e881+':'+_0x49ca49[_0x091d('0x16')]+_0x091d('0x3d')+_0x116a6a,'exten':_0x49ca49['exten'],'context':_0x49ca49[_0x091d('0x16')],'priority':_0x3a2075[_0x091d('0xd')]+_0x39c48f,'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});}_0x49ca49[_0x091d('0xd')]=_0x2757bb['length']?_['last'](_0x2757bb)[_0x091d('0xd')]+0x1:_0x3a2075[_0x091d('0xd')];_0x3a2075[_0x091d('0xd')]=(_0x1fcb95[_0x091d('0x29')]?_['last'](_0x1fcb95)['priority']:_0x49ca49[_0x091d('0xd')])+0x1;_0x3a2075[_0x091d('0xe')]=_[_0x091d('0x3e')](_0x3a2075[_0x091d('0xe')],_0x2757bb,[_0x49ca49],_0x1fcb95);}_0x3a2075['extensions'][_0x091d('0x11')]({'type':_0x580368[_0x23a153][0x0]['type'],'app':_0x091d('0x3f'),'exten':_0x580368[_0x23a153][0x0][_0x091d('0x8')],'context':_0x580368[_0x23a153][0x0]['context'],'priority':_0x3a2075['priority'],'VoiceExtensionId':_0x580368[_0x23a153][0x0][_0x091d('0x17')]});_0x5f3c47[_0x091d('0x11')](_0x580368[_0x23a153][0x0][_0x091d('0x17')]);_0x14c17f=_[_0x091d('0x3e')](_0x14c17f,_0x3a2075[_0x091d('0xe')]);}}return _0x345ae5['transaction'](function(_0xf391f5){return _0x345ae5[_0x091d('0x5')][_0x091d('0x7')][_0x091d('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x5f3c47}},'transaction':_0xf391f5})['then'](function(_0x340d1a){return _0x345ae5['models'][_0x091d('0x7')][_0x091d('0x41')](_['sortBy'](_0x14c17f,_0x091d('0xd')),{'transaction':_0xf391f5});});});})[_0x091d('0x42')](function(_0x45118e){console[_0x091d('0x43')](_0x45118e);});}exports[_0x091d('0x44')]=rewrite; \ No newline at end of file +var _0x586d=['none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','updatedAt','interval','*,*,*,*','map','tag','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','push','Set','format','type','context','VoiceExtensionId','CDR(destination)=','cutdigits','${EXTEN}','priority','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat'];(function(_0xcf2382,_0x1da16e){var _0x1ade36=function(_0x2124a2){while(--_0x2124a2){_0xcf2382['push'](_0xcf2382['shift']());}};_0x1ade36(++_0x1da16e);}(_0x586d,0xaf));var _0xd586=function(_0x5e0109,_0x1cf94d){_0x5e0109=_0x5e0109-0x0;var _0x10961c=_0x586d[_0x5e0109];return _0x10961c;};'use strict';var _=require(_0xd586('0x0'));var util=require(_0xd586('0x1'));function rewrite(_0x5d4c61,_0x49f322){var _0x372a78=this;return _0x5d4c61[_0xd586('0x2')]['Interval'][_0xd586('0x3')]({'raw':!![]})[_0xd586('0x4')](function(_0x3c8677){_0x372a78[_0xd586('0x5')]=_0x3c8677;return _0x5d4c61['models'][_0xd586('0x6')]['findAll']({'where':{'IntervalId':_0x49f322[_0xd586('0x7')]},'raw':!![]});})[_0xd586('0x4')](function(_0x2ad9c3){return _0x5d4c61['models'][_0xd586('0x6')]['findAll']({'where':{'exten':{'$in':_[_0xd586('0x8')](_['map'](_0x2ad9c3,_0xd586('0x9')))}},'order':[{'raw':_0xd586('0xa')}],'raw':!![]});})[_0xd586('0x4')](function(_0x2924ea){var _0x3403ac=_[_0xd586('0xb')](_0x2924ea,{'priority':'1'});var _0x4ae3e0=_['filter'](_0x2924ea,{'isApp':0x1});var _0x336859=_[_0xd586('0xc')](_0x4ae3e0,_0xd586('0x9'));var _0x42ea4c=[_0xd586('0xd'),_0xd586('0xe')];var _0x364a36=[];var _0x14dd3a=[];for(var _0x39eddc in _0x336859){if(_0x336859[_0xd586('0xf')](_0x39eddc)){_0x372a78['priority']=0x2;_0x372a78[_0xd586('0x10')]=[];_0x372a78[_0xd586('0x11')]=_[_0xd586('0x12')](_0x3403ac,{'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')]});_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0]['type'],'app':_0xd586('0x14'),'appdata':util[_0xd586('0x15')]('CDR(type)=%s',_0x336859[_0x39eddc][0x0][_0xd586('0x16')]),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});if(_0x336859[_0x39eddc][0x0]['type']==='outbound'){if(_0x372a78[_0xd586('0x11')]){_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0]['type'],'app':_0xd586('0x14'),'appdata':_0xd586('0x19')+(_0x372a78[_0xd586('0x11')][_0xd586('0x1a')]?'${EXTEN:'+_0x372a78['extension'][_0xd586('0x1a')]+'}':_0xd586('0x1b')),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});}_0x372a78['extensions'][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0]['type'],'app':_0xd586('0x14'),'appdata':'CDR(routeid)='+_0x336859[_0x39eddc][0x0][_0xd586('0x18')],'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});var _0x544745=_0x372a78[_0xd586('0x1c')]++;_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'ExecIf','appdata':_0xd586('0x1d')+(_0x544745+0x2)+_0xd586('0x1e')+(_0x544745+0x1)+')','context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x544745,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});if(_0x372a78['extension']){_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':_0x372a78['extension']['cutdigits']?_0xd586('0x1f')+_0x372a78[_0xd586('0x11')][_0xd586('0x1a')]+'}':_0xd586('0x20'),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0]['VoiceExtensionId']});}_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0]['type'],'app':'Set','appdata':_0xd586('0x21')+_0x336859[_0x39eddc][0x0]['VoiceExtensionId'],'context':_0x336859[_0x39eddc][0x0]['context'],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0]['VoiceExtensionId']});if(_0x372a78[_0xd586('0x11')]&&_0x372a78[_0xd586('0x11')]['hasOwnProperty'](_0xd586('0x22'))&&_0x372a78['extension'][_0xd586('0x22')]!==_0xd586('0x23')){_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':_0xd586('0x24'),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':_0xd586('0x25')+_0x372a78[_0xd586('0x11')]['recordingFormat']||'wav','context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});}}_0x372a78[_0xd586('0x10')][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':_0xd586('0x26'),'context':_0x336859[_0x39eddc][0x0]['context'],'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'priority':_0x372a78['priority']++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x372a78['extensions'][_0xd586('0x13')]({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':_0xd586('0x27'),'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'exten':_0x336859[_0x39eddc][0x0]['exten'],'priority':_0x372a78[_0xd586('0x1c')]++,'VoiceExtensionId':_0x336859[_0x39eddc][0x0]['VoiceExtensionId']});for(var _0x1d13bb=0x0,_0x41f3df=0x0;_0x1d13bb<_0x336859[_0x39eddc][_0xd586('0x28')];_0x1d13bb+=0x1,_0x41f3df=0x0){var _0x277cda=_0x336859[_0x39eddc][_0x1d13bb];if(_0x277cda['type']){_0x277cda[_0xd586('0x16')]=_0x277cda[_0xd586('0x16')]['toLowerCase']();}var _0x3c1cdc=[];var _0x4cf832=[];delete _0x277cda['id'];delete _0x277cda['createdAt'];delete _0x277cda[_0xd586('0x29')];var _0x41ee41=_0x277cda[_0xd586('0x2a')]!==_0xd586('0x2b')?[_0x277cda[_0xd586('0x2a')]]:_0x277cda[_0xd586('0x7')]?_[_0xd586('0x2c')](_['filter'](_0x372a78[_0xd586('0x5')],{'IntervalId':_0x277cda[_0xd586('0x7')]}),_0xd586('0x2a')):[];if(_0x277cda[_0xd586('0xf')](_0xd586('0x2d'))){if(_0x277cda['tag']&&_0x277cda[_0xd586('0x2d')]!=='--'){_0x3c1cdc['push']({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':'CDR(tag)='+_0x277cda[_0xd586('0x2d')],'context':_0x277cda['context'],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41[_0xd586('0x28')]+_0x372a78['priority']+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}}if(_0x277cda[_0xd586('0x16')]===_0xd586('0x2e')&&_0x277cda[_0xd586('0xf')](_0xd586('0x2f'))){if(_0x277cda[_0xd586('0x2f')]){_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':_0xd586('0x31')+_0x277cda[_0xd586('0x2f')]+')','context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41[_0xd586('0x28')]+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}else{_0x3c1cdc['push']({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda['exten'],'priority':_0x41ee41['length']+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}}if(_0x277cda[_0xd586('0xf')](_0xd586('0x32'))){if(_0x42ea4c[_0xd586('0x33')](_0x277cda[_0xd586('0x34')]['toLowerCase']())>=0x0&&_0x277cda['appType']!==_0xd586('0x35')){if(_0x277cda[_0xd586('0x32')]){_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x277cda['context'],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41['length']+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda['type'],'app':'Set','appdata':_0xd586('0x36'),'context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41['length']+_0x372a78['priority']+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}else{_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x30'),'appdata':_0xd586('0x37'),'context':_0x277cda['context'],'exten':_0x277cda['exten'],'priority':_0x41ee41['length']+_0x372a78['priority']+_0x41f3df++,'VoiceExtensionId':_0x277cda['VoiceExtensionId']});_0x3c1cdc[_0xd586('0x13')]({'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x14'),'appdata':_0xd586('0x38'),'context':_0x277cda[_0xd586('0x17')],'exten':_0x277cda[_0xd586('0x9')],'priority':_0x41ee41[_0xd586('0x28')]+_0x372a78[_0xd586('0x1c')]+_0x41f3df++,'VoiceExtensionId':_0x277cda[_0xd586('0x18')]});}}}for(var _0x495aeb=0x0;_0x495aeb<_0x41ee41[_0xd586('0x28')];_0x495aeb+=0x1){var _0x520628=_0x372a78[_0xd586('0x1c')]+_0x41ee41[_0xd586('0x28')];var _0x459061=_0x495aeb===_0x41ee41[_0xd586('0x28')]-0x1?_0x372a78[_0xd586('0x1c')]+_0x3c1cdc['length']+_0x4cf832[_0xd586('0x28')]+0x2:_0x372a78[_0xd586('0x1c')]+_0x495aeb+0x1;_0x3c1cdc[_0xd586('0x39')](_0x495aeb,0x0,{'type':_0x277cda[_0xd586('0x16')],'app':_0xd586('0x3a'),'appdata':_0x41ee41[_0x495aeb]+'?'+_0x277cda['context']+_0xd586('0x3b')+_0x520628+':'+_0x277cda['context']+',${EXTEN},'+_0x459061,'exten':_0x277cda['exten'],'context':_0x277cda[_0xd586('0x17')],'priority':_0x372a78[_0xd586('0x1c')]+_0x495aeb,'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});}_0x277cda[_0xd586('0x1c')]=_0x3c1cdc[_0xd586('0x28')]?_[_0xd586('0x3c')](_0x3c1cdc)[_0xd586('0x1c')]+0x1:_0x372a78[_0xd586('0x1c')];_0x372a78[_0xd586('0x1c')]=(_0x4cf832['length']?_[_0xd586('0x3c')](_0x4cf832)[_0xd586('0x1c')]:_0x277cda['priority'])+0x1;_0x372a78[_0xd586('0x10')]=_[_0xd586('0x3d')](_0x372a78[_0xd586('0x10')],_0x3c1cdc,[_0x277cda],_0x4cf832);}_0x372a78[_0xd586('0x10')]['push']({'type':_0x336859[_0x39eddc][0x0][_0xd586('0x16')],'app':_0xd586('0x3e'),'exten':_0x336859[_0x39eddc][0x0][_0xd586('0x9')],'context':_0x336859[_0x39eddc][0x0][_0xd586('0x17')],'priority':_0x372a78['priority'],'VoiceExtensionId':_0x336859[_0x39eddc][0x0][_0xd586('0x18')]});_0x364a36['push'](_0x336859[_0x39eddc][0x0]['VoiceExtensionId']);_0x14dd3a=_['concat'](_0x14dd3a,_0x372a78[_0xd586('0x10')]);}}return _0x5d4c61[_0xd586('0x3f')](function(_0x1b2358){return _0x5d4c61[_0xd586('0x2')][_0xd586('0x6')][_0xd586('0x40')]({'where':{'VoiceExtensionId':{'$in':_0x364a36}},'transaction':_0x1b2358})[_0xd586('0x4')](function(_0x25d4e7){return _0x5d4c61[_0xd586('0x2')][_0xd586('0x6')][_0xd586('0x41')](_[_0xd586('0x42')](_0x14dd3a,_0xd586('0x1c')),{'transaction':_0x1b2358});});});})[_0xd586('0x43')](function(_0x4dfbe2){console[_0xd586('0x44')](_0x4dfbe2);});}exports[_0xd586('0x45')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 33b4fb0..a7b7303 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 _0xf644=['stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','toString','NOW()','createdAt','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','into','id\x20IN\x20?','str','calleridnum','cm_hopper_final','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','query','all','VoiceQueue','Campaign','CampaignId','BlackLists','finally','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','split','createReadStream','parse','duplicate','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','ioredis','../../../config/environment','api','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','errors','length','map','message','hasOwnProperty','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','find','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20'];(function(_0x1a2682,_0x133191){var _0x3221d9=function(_0x47e0c5){while(--_0x47e0c5){_0x1a2682['push'](_0x1a2682['shift']());}};_0x3221d9(++_0x133191);}(_0xf644,0x11a));var _0x4f64=function(_0x5aec83,_0x2f53fd){_0x5aec83=_0x5aec83-0x0;var _0x2222b7=_0xf644[_0x5aec83];return _0x2222b7;};'use strict';var BPromise=require(_0x4f64('0x0'));var util=require(_0x4f64('0x1'));var _=require(_0x4f64('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x4f64('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x4f64('0x4'));var logger=require('../../../config/logger')(_0x4f64('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x4f64('0x6'),'port':0x18eb});var socket=require(_0x4f64('0x7'))(new Redis(config[_0x4f64('0x8')]));require(_0x4f64('0x9'))[_0x4f64('0xa')](socket);try{if(!process[_0x4f64('0xb')][0x2]||process[_0x4f64('0xb')][0x2]===_0x4f64('0xc')||process[_0x4f64('0xb')][0x2]==='null'){throw new Error(_0x4f64('0xd'));}var FILEPATH=process[_0x4f64('0xb')][0x2];if(!process[_0x4f64('0xb')][0x3]||process[_0x4f64('0xb')][0x3]===_0x4f64('0xc')||process[_0x4f64('0xb')][0x3]===_0x4f64('0xe')||!process['argv'][0x4]||process['argv'][0x4]===_0x4f64('0xc')||process['argv'][0x4]==='null'){throw new Error(_0x4f64('0xf'));}var FIELDS=_[_0x4f64('0x10')](process[_0x4f64('0xb')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x4f64('0xb')][0x5]||process[_0x4f64('0xb')][0x5]===_0x4f64('0xc')||process[_0x4f64('0xb')][0x5]===_0x4f64('0xe')){throw new Error(_0x4f64('0x11'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x4f64('0xb')][0x6]&&process[_0x4f64('0xb')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x4f64('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x4f64('0xb')][0x7]&&process[_0x4f64('0xb')][0x7]!==_0x4f64('0xc')&&process[_0x4f64('0xb')][0x7]!==_0x4f64('0xe')?process['argv'][0x7]:null;if(!process[_0x4f64('0xb')][0x8]||process[_0x4f64('0xb')][0x8]===_0x4f64('0xc')||process['argv'][0x8]===_0x4f64('0xe')){throw new Error(_0x4f64('0x12'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0xc56d19){logger[_0x4f64('0x13')](_0xc56d19);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(_0x1b96c7,_0x21cb4f,_0x2bbfb6,_0xd437c3){var _0x4d2e04={'message':_0x21cb4f};_0x4d2e04[_0x1b96c7]=!![];if(_0x2bbfb6){_0x4d2e04[_0x4f64('0x14')]=_0x2bbfb6;}if(_0xd437c3){_0x4d2e04[_0x4f64('0x15')]=_0xd437c3;}return _0x4d2e04;}function isEmail(_0x3a27ff){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))*$/[_0x4f64('0x16')](_0x3a27ff);}function checkRow(_0x1bc6a0,_0x22a34c,_0x2de85e){return new BPromise(function(_0x59b747,_0x30752d){if(_[_0x4f64('0x17')](_0x1bc6a0)){return _0x30752d(handleCheckRowError(_0x4f64('0x13'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x2de85e));}if(_0x1bc6a0[_0x4f64('0x18')]&&_0x1bc6a0[_0x4f64('0x18')][_0x4f64('0x19')]){var _0x4bd260=_[_0x4f64('0x1a')](_0x1bc6a0[_0x4f64('0x18')],_0x4f64('0x1b'))['join'](';');return _0x30752d(handleCheckRowError('error',_0x4bd260,null,_0x2de85e));}var _0x14d4c8={};for(var _0x525ae1 in FIELDS){if(FIELDS[_0x4f64('0x1c')](_0x525ae1)&&FIELDS[_0x525ae1]){_0x14d4c8[_0x525ae1]=_0x1bc6a0['data'][0x0][FIELDS[_0x525ae1]]||_0x1bc6a0[_0x4f64('0x1d')][0x0]['\ufeff'+FIELDS[_0x525ae1]];}}if(!_0x14d4c8[_0x4f64('0x1e')]){return _0x30752d(handleCheckRowError(_0x4f64('0x13'),_0x4f64('0x1f'),null,_0x2de85e));}if(!_0x14d4c8[_0x4f64('0x20')]){return _0x30752d(handleCheckRowError(_0x4f64('0x13'),_0x4f64('0x21'),null,_0x2de85e));}if(_0x14d4c8[_0x4f64('0x22')]){var _0x4d64cf=moment(_0x14d4c8[_0x4f64('0x22')],_0x4f64('0x23'));if(!_0x4d64cf[_0x4f64('0x24')]()){return _0x30752d(handleCheckRowError(_0x4f64('0x13'),_0x4f64('0x25'),null,_0x2de85e));}}if(_0x14d4c8['email']){if(!isEmail(_0x14d4c8[_0x4f64('0x26')])){return _0x30752d(handleCheckRowError(_0x4f64('0x13'),_0x4f64('0x27'),null,_0x2de85e));}}_0x14d4c8[_0x4f64('0x28')]=LISTID;_0x14d4c8[_0x4f64('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4f64('0x19')]&&_0x22a34c){var _0x851b7e={};for(var _0x319a7f=0x0,_0x2e7938=DUPLICATES[_0x4f64('0x19')];_0x319a7f<_0x2e7938;_0x319a7f+=0x1){_0x851b7e[DUPLICATES[_0x319a7f]]=_0x14d4c8[DUPLICATES[_0x319a7f]];}var _0x319836=_[_0x4f64('0x2a')](_0x22a34c,_0x851b7e);if(_0x319836){return _0x30752d(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x319836,_0x2de85e));}}return db[_0x4f64('0x2b')][_0x4f64('0x2c')](_0x14d4c8,{'raw':!![],'hooks':![],'fields':_[_0x4f64('0x2d')](_0x14d4c8)})[_0x4f64('0x2e')](function(_0x323cdf){if(DUPLICATES&&DUPLICATES[_0x4f64('0x19')]&&_0x22a34c){_0x22a34c[_0x4f64('0x2f')](_[_0x4f64('0x30')](_0x14d4c8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x323cdf['id'];return _0x59b747();})[_0x4f64('0x31')](function(_0x41714f){return _0x30752d(handleCheckRowError(_0x4f64('0x13'),_0x4f64('0x32')+(_0x41714f[_0x4f64('0x1b')]||JSON[_0x4f64('0x33')](_0x41714f)),null,_0x2de85e));});});}function checkHopper(){function _0x488b81(){return function(_0x55bb05){logger['error'](_0x4f64('0x34'),_0x4f64('0x35'),util[_0x4f64('0x36')](_0x55bb05,{'showHidden':![],'depth':null}));};}var _0x4c6730=function(_0x4cc965,_0x3f18f1){var _0x49488c=squel[_0x4f64('0x37')]()['into'](_0x4f64('0x38'))[_0x4f64('0x39')]([_0x4f64('0x20'),_0x4f64('0x3a'),_0x4f64('0x3b'),_0x4f64('0x28'),_0x3f18f1,'createdAt',_0x4f64('0x3c')],squel[_0x4f64('0x3d')]()[_0x4f64('0x3e')](_0x4f64('0x20'),_0x4f64('0x20'))[_0x4f64('0x3e')]('NOW()',_0x4f64('0x3a'))[_0x4f64('0x3e')]('id',_0x4f64('0x3b'))['field'](LISTID[_0x4f64('0x3f')](),_0x4f64('0x28'))[_0x4f64('0x3e')](_0x4cc965['id'][_0x4f64('0x3f')](),_0x3f18f1)[_0x4f64('0x3e')](_0x4f64('0x40'),_0x4f64('0x41'))[_0x4f64('0x3e')](_0x4f64('0x40'),_0x4f64('0x3c'))['from'](_0x4f64('0x42'))[_0x4f64('0x43')](_0x4f64('0x44'))[_0x4f64('0x43')](_0x4f64('0x45'),LISTID['toString']())['where'](_0x4f64('0x46'))[_0x4f64('0x43')](_0x4f64('0x47'),squel['select']()[_0x4f64('0x3e')]('phone')[_0x4f64('0x48')](_0x4f64('0x38'))[_0x4f64('0x43')](_0x3f18f1+_0x4f64('0x49'),_0x4cc965['id']['toString']())))[_0x4f64('0x3f')]();return _0x49488c;};var _0x5ccf37=function(_0x247156,_0x4511b5){var _0x2145aa=squel[_0x4f64('0x37')]()[_0x4f64('0x4a')](_0x4f64('0x38'))[_0x4f64('0x39')]([_0x4f64('0x20'),_0x4f64('0x3a'),_0x4f64('0x3b'),_0x4f64('0x28'),_0x4511b5,'createdAt',_0x4f64('0x3c')],squel[_0x4f64('0x3d')]()['field'](_0x4f64('0x20'),_0x4f64('0x20'))[_0x4f64('0x3e')](_0x4f64('0x40'),_0x4f64('0x3a'))[_0x4f64('0x3e')]('id',_0x4f64('0x3b'))[_0x4f64('0x3e')](LISTID['toString'](),'ListId')[_0x4f64('0x3e')](_0x247156['id'][_0x4f64('0x3f')](),_0x4511b5)['field'](_0x4f64('0x40'),_0x4f64('0x41'))['field'](_0x4f64('0x40'),_0x4f64('0x3c'))['from']('cm_contacts')[_0x4f64('0x43')](_0x4f64('0x44'))[_0x4f64('0x43')]('ListId\x20=\x20?',LISTID[_0x4f64('0x3f')]())[_0x4f64('0x43')](_0x4f64('0x4b'),squel[_0x4f64('0x4c')](hopperContacts))['where'](_0x4f64('0x46'))[_0x4f64('0x43')](_0x4f64('0x47'),squel[_0x4f64('0x3d')]()['field'](_0x4f64('0x4d'))[_0x4f64('0x48')](_0x4f64('0x4e'))['where'](_0x4511b5+_0x4f64('0x49'),_0x247156['id'][_0x4f64('0x3f')]()))[_0x4f64('0x43')](_0x4f64('0x47'),squel[_0x4f64('0x3d')]()['field'](_0x4f64('0x20'))['from'](_0x4f64('0x38'))['where'](_0x4511b5+'\x20=\x20?',_0x247156['id'][_0x4f64('0x3f')]())))[_0x4f64('0x3f')]();return _0x2145aa;};function _0x44ffc6(_0x50c73f,_0x26e624){var _0x120e22=squel['insert']()[_0x4f64('0x4a')](_0x4f64('0x38'))[_0x4f64('0x39')]([_0x4f64('0x20'),_0x4f64('0x3a'),_0x4f64('0x3b'),_0x4f64('0x28'),_0x26e624,_0x4f64('0x41'),_0x4f64('0x3c')],squel[_0x4f64('0x3d')]()[_0x4f64('0x3e')](_0x4f64('0x20'),_0x4f64('0x20'))['field'](_0x4f64('0x40'),'scheduledAt')['field']('id',_0x4f64('0x3b'))['field'](LISTID[_0x4f64('0x3f')](),_0x4f64('0x28'))[_0x4f64('0x3e')](_0x50c73f['id']['toString'](),_0x26e624)[_0x4f64('0x3e')](_0x4f64('0x40'),'createdAt')[_0x4f64('0x3e')](_0x4f64('0x40'),_0x4f64('0x3c'))[_0x4f64('0x48')](_0x4f64('0x42'))[_0x4f64('0x43')](_0x4f64('0x44'))[_0x4f64('0x43')](_0x4f64('0x45'),LISTID[_0x4f64('0x3f')]())[_0x4f64('0x43')](_0x4f64('0x4b'),squel[_0x4f64('0x4c')](hopperContacts))['where'](_0x4f64('0x46')))[_0x4f64('0x3f')]();return _0x120e22;}function _0x1ae392(_0x33bdf7,_0x12845c){var _0x4268f1=squel['insert']()[_0x4f64('0x4a')]('cm_hopper_black')[_0x4f64('0x39')]([_0x4f64('0x20'),_0x4f64('0x3b'),_0x4f64('0x28'),_0x12845c,_0x4f64('0x41'),_0x4f64('0x3c')],squel[_0x4f64('0x3d')]()[_0x4f64('0x3e')](_0x4f64('0x20'),_0x4f64('0x20'))[_0x4f64('0x3e')]('id',_0x4f64('0x3b'))[_0x4f64('0x3e')](LISTID[_0x4f64('0x3f')](),'ListId')[_0x4f64('0x3e')](_0x33bdf7['id']['toString'](),_0x12845c)['field'](_0x4f64('0x40'),_0x4f64('0x41'))[_0x4f64('0x3e')]('NOW()','updatedAt')[_0x4f64('0x48')](_0x4f64('0x42'))[_0x4f64('0x43')](_0x4f64('0x44'))[_0x4f64('0x43')]('ListId\x20=\x20?',LISTID[_0x4f64('0x3f')]())[_0x4f64('0x43')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x4f64('0x43')](_0x4f64('0x46')))[_0x4f64('0x3f')]();return _0x4268f1;}return db['VoiceQueue'][_0x4f64('0x4f')]({'where':{'type':_0x4f64('0x50')},'attributes':['id',_0x4f64('0x51')],'include':[{'model':db[_0x4f64('0x52')],'as':_0x4f64('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x27067d){var _0x2e3d99=[];if(_0x27067d){var _0x34474c;for(var _0x3f2279=0x0,_0x144a0c;_0x3f2279<_0x27067d[_0x4f64('0x19')];_0x3f2279+=0x1){_0x144a0c=_0x27067d[_0x3f2279][_0x4f64('0x54')]({'plain':!![]});switch(_0x144a0c['dialCheckDuplicateType']){case _0x4f64('0x55'):_0x2e3d99[_0x4f64('0x2f')](db[_0x4f64('0x56')]['query'](_0x5ccf37(_0x144a0c,_0x4f64('0x57')))[_0x4f64('0x2e')](function(){})[_0x4f64('0x31')](_0x488b81()));break;case _0x4f64('0x58'):_0x2e3d99[_0x4f64('0x2f')](db[_0x4f64('0x56')][_0x4f64('0x59')](_0x4c6730(_0x144a0c,_0x4f64('0x57')))[_0x4f64('0x2e')](function(){})[_0x4f64('0x31')](_0x488b81()));break;default:_0x2e3d99['push'](db[_0x4f64('0x56')]['query'](_0x44ffc6(_0x144a0c,_0x4f64('0x57')))[_0x4f64('0x2e')](function(){})[_0x4f64('0x31')](_0x488b81()));}}}return _0x2e3d99;})[_0x4f64('0x5a')]()[_0x4f64('0x2e')](function(){return db[_0x4f64('0x5b')][_0x4f64('0x4f')]({'where':{'type':_0x4f64('0x50')},'attributes':['id'],'include':[{'model':db[_0x4f64('0x52')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x4f64('0x2e')](function(_0x23c606){var _0x5d5b50=[];if(_0x23c606){var _0x57d323;for(var _0x337025=0x0,_0x1f4559;_0x337025<_0x23c606[_0x4f64('0x19')];_0x337025+=0x1){_0x1f4559=_0x23c606[_0x337025][_0x4f64('0x54')]({'plain':!![]});_0x5d5b50[_0x4f64('0x2f')](db[_0x4f64('0x56')]['query'](_0x1ae392(_0x1f4559,_0x4f64('0x57')))['then'](function(){})[_0x4f64('0x31')](_0x488b81()));}}return _0x5d5b50;})[_0x4f64('0x5a')]();})[_0x4f64('0x2e')](function(){return db[_0x4f64('0x5c')][_0x4f64('0x4f')]({'attributes':['id',_0x4f64('0x51')],'include':[{'model':db[_0x4f64('0x52')],'as':'Lists','where':{'id':LISTID}}]})[_0x4f64('0x2e')](function(_0x393d5b){var _0x2ce05d=[];if(_0x393d5b){for(var _0x320670=0x0,_0x3d87fb;_0x320670<_0x393d5b['length'];_0x320670+=0x1){_0x3d87fb=_0x393d5b[_0x320670]['get']({'plain':!![]});switch(_0x3d87fb[_0x4f64('0x51')]){case _0x4f64('0x55'):_0x2ce05d[_0x4f64('0x2f')](db['sequelize'][_0x4f64('0x59')](_0x5ccf37(_0x3d87fb,_0x4f64('0x5d')))[_0x4f64('0x2e')](function(){})[_0x4f64('0x31')](_0x488b81()));break;case _0x4f64('0x58'):_0x2ce05d[_0x4f64('0x2f')](db[_0x4f64('0x56')][_0x4f64('0x59')](_0x4c6730(_0x3d87fb,_0x4f64('0x5d')))[_0x4f64('0x2e')](function(){})['catch'](_0x488b81()));break;default:_0x2ce05d['push'](db[_0x4f64('0x56')][_0x4f64('0x59')](_0x44ffc6(_0x3d87fb,_0x4f64('0x5d')))[_0x4f64('0x2e')](function(){})['catch'](_0x488b81()));}}}return _0x2ce05d;})['all']();})['then'](function(){return db[_0x4f64('0x5c')][_0x4f64('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x4f64('0x52')],'as':_0x4f64('0x5e'),'where':{'id':LISTID}}]})[_0x4f64('0x2e')](function(_0x2a256d){var _0x48af09=[];if(_0x2a256d){for(var _0x2cfe95=0x0,_0x105857;_0x2cfe95<_0x2a256d[_0x4f64('0x19')];_0x2cfe95+=0x1){_0x105857=_0x2a256d[_0x2cfe95][_0x4f64('0x54')]({'plain':!![]});_0x48af09[_0x4f64('0x2f')](db[_0x4f64('0x56')]['query'](_0x1ae392(_0x105857,_0x4f64('0x5d')))[_0x4f64('0x2e')](function(){})[_0x4f64('0x31')](_0x488b81()));}}return _0x48af09;})[_0x4f64('0x5a')]();})[_0x4f64('0x31')](function(_0x16373c){logger['error']('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x16373c['message']);});}var processPromises=function(_0x1fee28){return BPromise[_0x4f64('0x5a')](promises)['then'](function(_0x4f8926){})[_0x4f64('0x31')](function(_0x37978c){logger[_0x4f64('0x13')]('Error\x20processing\x20rows\x20block:',JSON[_0x4f64('0x33')](_0x37978c));})[_0x4f64('0x5f')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1fee28){return _0x1fee28['resume']();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x4f64('0x60')](_0x4f64('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x8133e5){logger['error'](_0x4f64('0x62'),JSON['stringify'](_0x8133e5));}finally{process[_0x4f64('0x63')](0x0);}});};process['on'](_0x4f64('0x64'),function(){logger[_0x4f64('0x65')](_0x4f64('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0x4f64('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4f64('0x67')](',');return db[_0x4f64('0x2b')][_0x4f64('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x18c27c){var _0x55a9e2=fs[_0x4f64('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4f64('0x69')](_0x55a9e2,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4f42b9,_0x1028fc){total+=0x1;var _0x13d826=total;promises['push'](checkRow(_0x4f42b9,_0x18c27c,_0x13d826)[_0x4f64('0x2e')](function(){success+=0x1;})[_0x4f64('0x31')](function(_0x1531b3){if(_0x1531b3[_0x4f64('0x13')]){errors+=0x1;delete _0x1531b3[_0x4f64('0x13')];}else if(_0x1531b3['duplicate']){duplicates+=0x1;delete _0x1531b3[_0x4f64('0x6a')];}rows[_0x4f64('0x2f')](_0x1531b3);}));if(total%0xc8===0x0){_0x1028fc[_0x4f64('0x6b')]();return processPromises(_0x1028fc);}},'complete':function(){return processPromises()['then'](function(){logger['info'](_0x4f64('0x6c'));endCsv();});},'error':function(_0x4af386,_0x135f67){logger[_0x4f64('0x65')](_0x4f64('0x6d'),JSON['stringify'](_0x4af386));endCsv();}});})['catch'](function(_0x37ddf7){logger['error'](_0x4f64('0x6e'),JSON[_0x4f64('0x33')](_0x37ddf7));});}main(); \ No newline at end of file +var _0x7001=['lodash','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','Missing\x20ListId\x20parameter!','contact','test','isNil','error','errors','length','message','data','firstName','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!','duplicate','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','ListId','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','insert','ListId\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','query','VoiceQueueId','onlyIfOpen','catch','sequelize','all','get','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','stringify','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','split','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird'];(function(_0x10b48a,_0x1a0a3f){var _0x2c4533=function(_0x5e4be6){while(--_0x5e4be6){_0x10b48a['push'](_0x10b48a['shift']());}};_0x2c4533(++_0x1a0a3f);}(_0x7001,0x1a3));var _0x1700=function(_0x20b71e,_0x22eb05){_0x20b71e=_0x20b71e-0x0;var _0x5dee1e=_0x7001[_0x20b71e];return _0x5dee1e;};'use strict';var BPromise=require(_0x1700('0x0'));var util=require('util');var _=require(_0x1700('0x1'));var fs=require('fs');var squel=require(_0x1700('0x2'));var Papa=require('papaparse');var Redis=require(_0x1700('0x3'));var db=require(_0x1700('0x4'))['db'];var config=require(_0x1700('0x5'));var logger=require(_0x1700('0x6'))(_0x1700('0x7'));config['redis']=_[_0x1700('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1700('0x9'))(new Redis(config['redis']));require(_0x1700('0xa'))[_0x1700('0xb')](socket);try{if(!process[_0x1700('0xc')][0x2]||process[_0x1700('0xc')][0x2]===_0x1700('0xd')||process['argv'][0x2]===_0x1700('0xe')){throw new Error(_0x1700('0xf'));}var FILEPATH=process[_0x1700('0xc')][0x2];if(!process['argv'][0x3]||process[_0x1700('0xc')][0x3]===_0x1700('0xd')||process[_0x1700('0xc')][0x3]===_0x1700('0xe')||!process[_0x1700('0xc')][0x4]||process[_0x1700('0xc')][0x4]===_0x1700('0xd')||process[_0x1700('0xc')][0x4]===_0x1700('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1700('0x10')](process[_0x1700('0xc')][0x3]['split'](','),process[_0x1700('0xc')][0x4]['split'](','));if(!process['argv'][0x5]||process[_0x1700('0xc')][0x5]===_0x1700('0xd')||process[_0x1700('0xc')][0x5]===_0x1700('0xe')){throw new Error(_0x1700('0x11'));}var LISTID=process[_0x1700('0xc')][0x5];var COMPANYID=process[_0x1700('0xc')][0x6]&&process[_0x1700('0xc')][0x6]!==_0x1700('0xd')&&process['argv'][0x6]!==_0x1700('0xe')?process[_0x1700('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x1700('0xc')][0x7]!==_0x1700('0xd')&&process['argv'][0x7]!=='null'?process[_0x1700('0xc')][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x1700('0xd')||process[_0x1700('0xc')][0x8]===_0x1700('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1700('0xc')][0x8];}catch(_0x38f03c){logger['error'](_0x38f03c);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(_0x1dfe01,_0x296643,_0x4e86a1,_0x1155c7){var _0x2ca38b={'message':_0x296643};_0x2ca38b[_0x1dfe01]=!![];if(_0x4e86a1){_0x2ca38b[_0x1700('0x12')]=_0x4e86a1;}if(_0x1155c7){_0x2ca38b['index']=_0x1155c7;}return _0x2ca38b;}function isEmail(_0xe9afde){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))*$/[_0x1700('0x13')](_0xe9afde);}function checkRow(_0x47c09a,_0x46e9b5,_0x325a7d){return new BPromise(function(_0x488956,_0x1b5014){if(_[_0x1700('0x14')](_0x47c09a)){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x325a7d));}if(_0x47c09a[_0x1700('0x16')]&&_0x47c09a[_0x1700('0x16')][_0x1700('0x17')]){var _0x184891=_['map'](_0x47c09a[_0x1700('0x16')],_0x1700('0x18'))['join'](';');return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x184891,null,_0x325a7d));}var _0x2efc4f={};for(var _0x179e17 in FIELDS){if(FIELDS['hasOwnProperty'](_0x179e17)&&FIELDS[_0x179e17]){_0x2efc4f[_0x179e17]=_0x47c09a[_0x1700('0x19')][0x0][FIELDS[_0x179e17]]||_0x47c09a[_0x1700('0x19')][0x0]['\ufeff'+FIELDS[_0x179e17]];}}if(!_0x2efc4f[_0x1700('0x1a')]){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),'firstName\x20not\x20specified!',null,_0x325a7d));}if(!_0x2efc4f[_0x1700('0x1b')]){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x1c'),null,_0x325a7d));}if(_0x2efc4f[_0x1700('0x1d')]){var _0xb0929f=moment(_0x2efc4f['birthDate'],_0x1700('0x1e'));if(!_0xb0929f[_0x1700('0x1f')]()){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x20'),null,_0x325a7d));}}if(_0x2efc4f[_0x1700('0x21')]){if(!isEmail(_0x2efc4f[_0x1700('0x21')])){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x22'),null,_0x325a7d));}}_0x2efc4f['ListId']=LISTID;_0x2efc4f['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x46e9b5){var _0x42fbd6={};for(var _0x6d6ef9=0x0,_0x1098d9=DUPLICATES[_0x1700('0x17')];_0x6d6ef9<_0x1098d9;_0x6d6ef9+=0x1){_0x42fbd6[DUPLICATES[_0x6d6ef9]]=_0x2efc4f[DUPLICATES[_0x6d6ef9]];}var _0x445ce1=_['find'](_0x46e9b5,_0x42fbd6);if(_0x445ce1){return _0x1b5014(handleCheckRowError(_0x1700('0x23'),'Duplicate\x20Contact',_0x445ce1,_0x325a7d));}}return db[_0x1700('0x24')][_0x1700('0x25')](_0x2efc4f,{'raw':!![],'hooks':![],'fields':_[_0x1700('0x26')](_0x2efc4f)})[_0x1700('0x27')](function(_0x33fffb){if(DUPLICATES&&DUPLICATES['length']&&_0x46e9b5){_0x46e9b5[_0x1700('0x28')](_[_0x1700('0x29')](_0x2efc4f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x33fffb['id'];return _0x488956();})['catch'](function(_0x5c7dbc){return _0x1b5014(handleCheckRowError(_0x1700('0x15'),_0x1700('0x2a')+(_0x5c7dbc['message']||JSON['stringify'](_0x5c7dbc)),null,_0x325a7d));});});}function checkHopper(){function _0x52685a(){return function(_0x4683ca){logger[_0x1700('0x15')](_0x1700('0x2b'),_0x1700('0x2c'),util['inspect'](_0x4683ca,{'showHidden':![],'depth':null}));};}var _0x3a823b=function(_0x2f0073,_0x288e24){var _0x4d586f=squel['insert']()[_0x1700('0x2d')](_0x1700('0x2e'))[_0x1700('0x2f')]([_0x1700('0x1b'),_0x1700('0x30'),_0x1700('0x31'),'ListId',_0x288e24,_0x1700('0x32'),'updatedAt'],squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'),_0x1700('0x1b'))[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x30'))[_0x1700('0x34')]('id','ContactId')[_0x1700('0x34')](LISTID[_0x1700('0x36')](),_0x1700('0x37'))[_0x1700('0x34')](_0x2f0073['id'][_0x1700('0x36')](),_0x288e24)[_0x1700('0x34')]('NOW()',_0x1700('0x32'))[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x38'))[_0x1700('0x39')](_0x1700('0x3a'))[_0x1700('0x3b')](_0x1700('0x3c'))['where']('ListId\x20=\x20?',LISTID[_0x1700('0x36')]())[_0x1700('0x3b')](_0x1700('0x3d'))[_0x1700('0x3b')](_0x1700('0x3e'),squel['select']()['field'](_0x1700('0x1b'))['from'](_0x1700('0x2e'))['where'](_0x288e24+_0x1700('0x3f'),_0x2f0073['id'][_0x1700('0x36')]())))[_0x1700('0x36')]();return _0x4d586f;};var _0x5df904=function(_0x5166bc,_0x4cecda){var _0x196530=squel['insert']()[_0x1700('0x2d')](_0x1700('0x2e'))[_0x1700('0x2f')]([_0x1700('0x1b'),_0x1700('0x30'),'ContactId',_0x1700('0x37'),_0x4cecda,'createdAt','updatedAt'],squel[_0x1700('0x33')]()['field']('phone',_0x1700('0x1b'))[_0x1700('0x34')]('NOW()',_0x1700('0x30'))[_0x1700('0x34')]('id',_0x1700('0x31'))[_0x1700('0x34')](LISTID[_0x1700('0x36')](),_0x1700('0x37'))[_0x1700('0x34')](_0x5166bc['id']['toString'](),_0x4cecda)[_0x1700('0x34')]('NOW()',_0x1700('0x32'))[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x38'))['from'](_0x1700('0x3a'))['where'](_0x1700('0x3c'))['where']('ListId\x20=\x20?',LISTID[_0x1700('0x36')]())['where'](_0x1700('0x40'),squel[_0x1700('0x41')](hopperContacts))['where'](_0x1700('0x3d'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x1700('0x34')](_0x1700('0x42'))[_0x1700('0x39')](_0x1700('0x43'))[_0x1700('0x3b')](_0x4cecda+'\x20=\x20?',_0x5166bc['id'][_0x1700('0x36')]()))[_0x1700('0x3b')](_0x1700('0x3e'),squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'))[_0x1700('0x39')]('cm_hopper')[_0x1700('0x3b')](_0x4cecda+_0x1700('0x3f'),_0x5166bc['id'][_0x1700('0x36')]())))[_0x1700('0x36')]();return _0x196530;};function _0x110189(_0x241cab,_0x12e6a9){var _0x2b2a30=squel[_0x1700('0x44')]()[_0x1700('0x2d')]('cm_hopper')[_0x1700('0x2f')](['phone','scheduledAt','ContactId','ListId',_0x12e6a9,'createdAt',_0x1700('0x38')],squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'),'phone')['field'](_0x1700('0x35'),_0x1700('0x30'))[_0x1700('0x34')]('id',_0x1700('0x31'))[_0x1700('0x34')](LISTID[_0x1700('0x36')](),_0x1700('0x37'))[_0x1700('0x34')](_0x241cab['id']['toString'](),_0x12e6a9)[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x32'))['field']('NOW()',_0x1700('0x38'))[_0x1700('0x39')](_0x1700('0x3a'))[_0x1700('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0x1700('0x45'),LISTID[_0x1700('0x36')]())['where'](_0x1700('0x40'),squel['str'](hopperContacts))[_0x1700('0x3b')](_0x1700('0x3d')))[_0x1700('0x36')]();return _0x2b2a30;}function _0x2491a9(_0x31da15,_0x4129ed){var _0xaec396=squel[_0x1700('0x44')]()[_0x1700('0x2d')](_0x1700('0x46'))[_0x1700('0x2f')]([_0x1700('0x1b'),'ContactId','ListId',_0x4129ed,_0x1700('0x32'),_0x1700('0x38')],squel[_0x1700('0x33')]()[_0x1700('0x34')](_0x1700('0x1b'),'phone')['field']('id',_0x1700('0x31'))[_0x1700('0x34')](LISTID[_0x1700('0x36')](),'ListId')['field'](_0x31da15['id'][_0x1700('0x36')](),_0x4129ed)[_0x1700('0x34')](_0x1700('0x35'),_0x1700('0x32'))[_0x1700('0x34')](_0x1700('0x35'),'updatedAt')[_0x1700('0x39')]('cm_contacts')[_0x1700('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0x1700('0x45'),LISTID[_0x1700('0x36')]())[_0x1700('0x3b')](_0x1700('0x40'),squel[_0x1700('0x41')](hopperContacts))[_0x1700('0x3b')](_0x1700('0x3d')))[_0x1700('0x36')]();return _0xaec396;}return db[_0x1700('0x47')][_0x1700('0x48')]({'where':{'type':_0x1700('0x49')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x1700('0x4a')],'as':_0x1700('0x4b'),'where':{'id':LISTID}}]})[_0x1700('0x27')](function(_0x136e18){var _0x4b0e1a=[];if(_0x136e18){var _0x39dde4;for(var _0x3c4df4=0x0,_0x29f46f;_0x3c4df4<_0x136e18[_0x1700('0x17')];_0x3c4df4+=0x1){_0x29f46f=_0x136e18[_0x3c4df4]['get']({'plain':!![]});switch(_0x29f46f[_0x1700('0x4c')]){case _0x1700('0x4d'):_0x4b0e1a[_0x1700('0x28')](db['sequelize'][_0x1700('0x4e')](_0x5df904(_0x29f46f,_0x1700('0x4f')))[_0x1700('0x27')](function(){})['catch'](_0x52685a()));break;case _0x1700('0x50'):_0x4b0e1a[_0x1700('0x28')](db['sequelize']['query'](_0x3a823b(_0x29f46f,_0x1700('0x4f')))[_0x1700('0x27')](function(){})[_0x1700('0x51')](_0x52685a()));break;default:_0x4b0e1a[_0x1700('0x28')](db[_0x1700('0x52')][_0x1700('0x4e')](_0x110189(_0x29f46f,_0x1700('0x4f')))[_0x1700('0x27')](function(){})['catch'](_0x52685a()));}}}return _0x4b0e1a;})[_0x1700('0x53')]()['then'](function(){return db['VoiceQueue'][_0x1700('0x48')]({'where':{'type':_0x1700('0x49')},'attributes':['id'],'include':[{'model':db[_0x1700('0x4a')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x1700('0x27')](function(_0x3056aa){var _0x265e4b=[];if(_0x3056aa){var _0x24cddf;for(var _0x557a14=0x0,_0x4ecee8;_0x557a14<_0x3056aa[_0x1700('0x17')];_0x557a14+=0x1){_0x4ecee8=_0x3056aa[_0x557a14][_0x1700('0x54')]({'plain':!![]});_0x265e4b[_0x1700('0x28')](db['sequelize'][_0x1700('0x4e')](_0x2491a9(_0x4ecee8,_0x1700('0x4f')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));}}return _0x265e4b;})[_0x1700('0x53')]();})[_0x1700('0x27')](function(){return db[_0x1700('0x55')][_0x1700('0x48')]({'attributes':['id',_0x1700('0x4c')],'include':[{'model':db[_0x1700('0x4a')],'as':_0x1700('0x4b'),'where':{'id':LISTID}}]})[_0x1700('0x27')](function(_0x2c9af2){var _0x5fa545=[];if(_0x2c9af2){for(var _0x29dc49=0x0,_0x568ac8;_0x29dc49<_0x2c9af2[_0x1700('0x17')];_0x29dc49+=0x1){_0x568ac8=_0x2c9af2[_0x29dc49]['get']({'plain':!![]});switch(_0x568ac8[_0x1700('0x4c')]){case _0x1700('0x4d'):_0x5fa545[_0x1700('0x28')](db['sequelize']['query'](_0x5df904(_0x568ac8,_0x1700('0x56')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));break;case _0x1700('0x50'):_0x5fa545['push'](db[_0x1700('0x52')][_0x1700('0x4e')](_0x3a823b(_0x568ac8,_0x1700('0x56')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));break;default:_0x5fa545[_0x1700('0x28')](db[_0x1700('0x52')][_0x1700('0x4e')](_0x110189(_0x568ac8,_0x1700('0x56')))[_0x1700('0x27')](function(){})[_0x1700('0x51')](_0x52685a()));}}}return _0x5fa545;})[_0x1700('0x53')]();})[_0x1700('0x27')](function(){return db[_0x1700('0x55')][_0x1700('0x48')]({'attributes':['id'],'include':[{'model':db[_0x1700('0x4a')],'as':_0x1700('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x4c15f2){var _0x5c69d7=[];if(_0x4c15f2){for(var _0x2e2c81=0x0,_0x5a28a4;_0x2e2c81<_0x4c15f2[_0x1700('0x17')];_0x2e2c81+=0x1){_0x5a28a4=_0x4c15f2[_0x2e2c81][_0x1700('0x54')]({'plain':!![]});_0x5c69d7[_0x1700('0x28')](db[_0x1700('0x52')]['query'](_0x2491a9(_0x5a28a4,_0x1700('0x56')))['then'](function(){})[_0x1700('0x51')](_0x52685a()));}}return _0x5c69d7;})[_0x1700('0x53')]();})[_0x1700('0x51')](function(_0x4ca03a){logger[_0x1700('0x15')](_0x1700('0x58'),'generalCheckHopper',_0x4ca03a[_0x1700('0x18')]);});}var processPromises=function(_0x3a2928){return BPromise[_0x1700('0x53')](promises)[_0x1700('0x27')](function(_0x4a9f36){})[_0x1700('0x51')](function(_0x1f6495){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x1700('0x59')](_0x1f6495));})['finally'](function(){socket[_0x1700('0x5a')](_0x1700('0x5b')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3a2928){return _0x3a2928[_0x1700('0x5c')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x1700('0x27')](function(){if(hopperContacts){return checkHopper();}})[_0x1700('0x27')](function(){socket[_0x1700('0x5a')](_0x1700('0x5b')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1700('0x5d')](FILEPATH);}catch(_0x5484cb){logger[_0x1700('0x15')](_0x1700('0x5e'),JSON[_0x1700('0x59')](_0x5484cb));}finally{process[_0x1700('0x5f')](0x0);}});};process['on'](_0x1700('0x60'),function(){logger[_0x1700('0x61')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x1700('0x62')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1700('0x63')](',');return db[_0x1700('0x24')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1700('0x27')](function(_0x36a82b){var _0x2977f1=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x1700('0x64')](_0x2977f1,{'header':!![],'skipEmptyLines':!![],'step':function(_0x3da393,_0x24220e){total+=0x1;var _0x57c430=total;promises['push'](checkRow(_0x3da393,_0x36a82b,_0x57c430)[_0x1700('0x27')](function(){success+=0x1;})[_0x1700('0x51')](function(_0x13a673){if(_0x13a673[_0x1700('0x15')]){errors+=0x1;delete _0x13a673['error'];}else if(_0x13a673[_0x1700('0x23')]){duplicates+=0x1;delete _0x13a673[_0x1700('0x23')];}rows[_0x1700('0x28')](_0x13a673);}));if(total%0xc8===0x0){_0x24220e[_0x1700('0x65')]();return processPromises(_0x24220e);}},'complete':function(){return processPromises()[_0x1700('0x27')](function(){logger['info'](_0x1700('0x66'));endCsv();});},'error':function(_0x479312,_0x1741aa){logger[_0x1700('0x61')](_0x1700('0x67'),JSON[_0x1700('0x59')](_0x479312));endCsv();}});})[_0x1700('0x51')](function(_0x161bb4){logger[_0x1700('0x15')](_0x1700('0x68'),JSON[_0x1700('0x59')](_0x161bb4));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 6f2a409..8a03b9b 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 _0x7afd=['cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','insert','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','errors','push','code','sequelize','query','spread','catch','main','send','start','binding','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isNaN','UserId','isNumber','includes','email','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','contact:import:','Abort\x20parser','abort','SystemError','error','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','test','select','field','phone','from','join','\x20=\x20','where','cm_contacts.phone','cm_contacts.scheduledat'];(function(_0x46e3e6,_0x361f4a){var _0x567574=function(_0x54a1e5){while(--_0x54a1e5){_0x46e3e6['push'](_0x46e3e6['shift']());}};_0x567574(++_0x361f4a);}(_0x7afd,0x106));var _0xd7af=function(_0x168b7d,_0x5a906f){_0x168b7d=_0x168b7d-0x0;var _0x388531=_0x7afd[_0x168b7d];return _0x388531;};'use strict';var fs=require('fs');var path=require(_0xd7af('0x0'));var _=require(_0xd7af('0x1'));var Papa=require(_0xd7af('0x2'));var util=require(_0xd7af('0x3'));var BPromise=require(_0xd7af('0x4'));var moment=require(_0xd7af('0x5'));var squel=require(_0xd7af('0x6'));var Redis=require('ioredis');var db=require(_0xd7af('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0xd7af('0x8'))(_0xd7af('0x9'));config['redis']=_[_0xd7af('0xa')](config[_0xd7af('0xb')],{'host':_0xd7af('0xc'),'port':0x18eb});var socket=require(_0xd7af('0xd'))(new Redis(config[_0xd7af('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x1a84a9){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))*$/[_0xd7af('0xe')](_0x1a84a9);}function selectNotIn(_0x471e7b,_0x42e931,_0x1646dc,_0x56824c,_0x2d5251){return squel[_0xd7af('0xf')]()[_0xd7af('0x10')](_0xd7af('0x11'))[_0xd7af('0x12')](_0x56824c)[_0xd7af('0x13')](_0x42e931,null,_0x42e931+'.id\x20=\x20'+_0x56824c+'.'+_0x1646dc)['where'](_0x56824c+'.'+_0x1646dc+_0xd7af('0x14')+_0x471e7b+'.'+_0x1646dc)[_0xd7af('0x15')](_0x42e931+'.dialCheckDuplicateType\x20IN\x20('+_0x2d5251[_0xd7af('0x13')]()+')');}function insertCmHopper(_0x381c2a,_0x3e2ffe,_0x75fd07,_0xdf3ca3,_0x3116cc){var _0x48f895=[_0xd7af('0x16'),_0xd7af('0x17'),_0xd7af('0x18'),_0xd7af('0x19'),_0x3e2ffe+'.'+_0xdf3ca3,_0xd7af('0x1a'),'cm_contacts.updatedAt',_0xd7af('0x1b'),_0xd7af('0x1c'),'\x22'+_0x3116cc+'\x22'];return squel['insert']()[_0xd7af('0x1d')](_0xd7af('0x1e'))[_0xd7af('0x1f')]([_0xd7af('0x11'),_0xd7af('0x20'),_0xd7af('0x21'),_0xd7af('0x22'),_0xdf3ca3,_0xd7af('0x23'),_0xd7af('0x24'),_0xd7af('0x25'),'UserId',_0xd7af('0x26')],squel[_0xd7af('0xf')]()[_0xd7af('0x27')](_0x48f895)[_0xd7af('0x12')](_0x3e2ffe)[_0xd7af('0x13')](_0xd7af('0x28'),null,_0xd7af('0x29')+_0x3e2ffe+_0xd7af('0x2a'))['join'](_0x75fd07,null,_0x75fd07+_0xd7af('0x2b')+_0x3e2ffe+'.'+_0xdf3ca3)[_0xd7af('0x15')](_0x3e2ffe+'.CmListId\x20=\x20?',_0x381c2a)['where'](_0xd7af('0x2c'),NOW)[_0xd7af('0x15')](_0xd7af('0x2d'),selectNotIn(_0x3e2ffe,_0x75fd07,_0xdf3ca3,_0xd7af('0x1e'),[_0xd7af('0x2e'),_0xd7af('0x2f')]))['where'](_0xd7af('0x2d'),selectNotIn(_0x3e2ffe,_0x75fd07,_0xdf3ca3,'cm_hopper',[_0xd7af('0x2e')])))[_0xd7af('0x30')]();}function insertCmHopperBlack(_0x1985d4,_0x4cdef4,_0x21fe69,_0xb20562){var _0x3aebec=[_0xd7af('0x16'),_0xd7af('0x18'),_0xd7af('0x19'),_0x4cdef4+'.'+_0xb20562,_0xd7af('0x1a'),_0xd7af('0x31')];return squel[_0xd7af('0x32')]()[_0xd7af('0x1d')](_0xd7af('0x33'))[_0xd7af('0x1f')]([_0xd7af('0x11'),_0xd7af('0x21'),'ListId',_0xb20562,_0xd7af('0x23'),_0xd7af('0x24')],squel['select']()[_0xd7af('0x27')](_0x3aebec)[_0xd7af('0x12')](_0x4cdef4)['join'](_0xd7af('0x28'),null,_0xd7af('0x29')+_0x4cdef4+_0xd7af('0x2a'))[_0xd7af('0x13')](_0x21fe69,null,_0x21fe69+'.id\x20=\x20'+_0x4cdef4+'.'+_0xb20562)[_0xd7af('0x15')](_0x4cdef4+'.CmListId\x20=\x20?',_0x1985d4)[_0xd7af('0x15')](_0xd7af('0x2c'),NOW)['where'](_0xd7af('0x2d'),squel[_0xd7af('0xf')]()[_0xd7af('0x10')]('phone')[_0xd7af('0x12')](_0xd7af('0x33'))['where'](_0xd7af('0x34'),_0x1985d4)[_0xd7af('0x15')](_0xb20562+_0xd7af('0x35'),_0x4cdef4+'.'+_0xb20562)))['toString']();}function insertCmContact(_0x31e246,_0x1e606b,_0x16a55a,_0x51a991){var _0x598454=_[_0xd7af('0x36')](_[_0xd7af('0x37')](_0x51a991),[_0xd7af('0x22'),_0xd7af('0x38'),'createdAt',_0xd7af('0x24')]);return squel[_0xd7af('0x32')]()[_0xd7af('0x1d')]('cm_contacts')[_0xd7af('0x1f')](_0x598454,squel[_0xd7af('0xf')]()[_0xd7af('0x27')](_0x598454)['from'](_0x1e606b)['where']('('+_0x16a55a[_0xd7af('0x13')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0xd7af('0x27')](_0x16a55a)[_0xd7af('0x12')](_0xd7af('0x28'))[_0xd7af('0x15')]('ListId\x20=\x20?',_0x31e246))[_0xd7af('0x15')](_0xd7af('0x39'),squel['select']()['field'](_0xd7af('0x3a'),_0xd7af('0x3b'))[_0xd7af('0x12')](_0x1e606b)[_0xd7af('0x3c')](_0x16a55a[_0xd7af('0x13')](','))))[_0xd7af('0x30')]();}function handleStop(){logger[_0xd7af('0x3d')](_0xd7af('0x3e'));stopped=!![];}function handleUncaughtException(_0x296ac3){logger['error'](_0x296ac3[_0xd7af('0x3f')]);process['exit'](0x1);}function handleError(_0x217c42,_0x1225aa){stats[_0xd7af('0x40')][_0xd7af('0x41')]({'name':_0x1225aa[_0xd7af('0x42')],'message':_0x1225aa[_0xd7af('0x3f')],'row':_0x217c42});}function handleQuery(_0x85e139){logger[_0xd7af('0x3d')](_0x85e139);return db[_0xd7af('0x43')][_0xd7af('0x44')](_0x85e139)[_0xd7af('0x45')](function(_0x41342a){results[_0xd7af('0x41')](_0x41342a);})[_0xd7af('0x46')](function(_0x3c4058){logger['error'](_0x3c4058[_0xd7af('0x3f')]);});}function main(_0x1d3780,_0x3c346c,_0x101404,_0x927c27){logger[_0xd7af('0x3d')](_0xd7af('0x47'),_0x1d3780,JSON['stringify'](_0x3c346c));process[_0xd7af('0x48')](_0xd7af('0x49'));var _0x779efe=_0x3c346c[_0xd7af('0x4a')];var _0x14133c=_0x3c346c['socket_timestamp'];var _0x5e3ccf=path[_0xd7af('0x13')](config[_0xd7af('0x4b')],_0xd7af('0x4c'),_0x14133c+_0xd7af('0x4d'));var _0x54cd1f=_['keys'](_0x779efe)['join']();logger[_0xd7af('0x3d')](_0xd7af('0x4e'),_0x54cd1f);fs[_0xd7af('0x4f')](_0x5e3ccf,_0x54cd1f+'\x0a');Papa[_0xd7af('0x50')](fs[_0xd7af('0x51')](_0x1d3780),{'header':!![],'skipEmptyLines':!![],'step':function(_0x7f4ad9,_0xb4ec12){try{for(var _0x4566d2=0x0,_0x3ee3fc=[];_0x4566d2<_0x7f4ad9[_0xd7af('0x52')][_0xd7af('0x53')];_0x4566d2++){stats[_0xd7af('0x54')]+=0x1;if(_0x7f4ad9[_0xd7af('0x40')][_0x4566d2]){handleError(_0x7f4ad9[_0xd7af('0x52')][_0x4566d2],_0x7f4ad9[_0xd7af('0x40')][_0x4566d2]);}else{var _0x4886be=[];for(var _0x2c55fa in _0x779efe){if(_0x779efe[_0xd7af('0x55')](_0x2c55fa)){if(_0x7f4ad9['data'][_0x4566d2][_0x779efe[_0x2c55fa]]){var _0x5d28c0=_[_0xd7af('0x56')](_0x7f4ad9['data'][_0x4566d2][_0x779efe[_0x2c55fa]][_0xd7af('0x57')](/"/g,'\x27'));switch(_0x2c55fa){case _0xd7af('0x20'):var _0x4a9f55=moment(_0x5d28c0,_0xd7af('0x58'),!![]);if(_0x4a9f55['isValid']()){_0x3ee3fc[_0xd7af('0x41')]('\x22'+_0x5d28c0+'\x22');}else{_0x4886be[_0xd7af('0x41')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x540368=parseInt(_0x5d28c0);_0x5d28c0=_[_0xd7af('0x59')](_0x540368)||_0x540368<0x0||_0x540368>0x4?_0x927c27?0x3:0x2:_0x540368;_0x3ee3fc['push']('\x22'+_0x5d28c0+'\x22');break;case _0xd7af('0x5a'):var _0xd59fce=parseInt(_0x5d28c0);if(_[_0xd7af('0x5b')](_0xd59fce)&&_[_0xd7af('0x5c')](_0x101404,_0xd59fce)){_0x3ee3fc[_0xd7af('0x41')]('\x22'+_0xd59fce+'\x22');}else{_0x4886be[_0xd7af('0x41')]('agent\x20not\x20exists');}break;case _0xd7af('0x5d'):if(isEmail(_0x5d28c0)){_0x3ee3fc[_0xd7af('0x41')]('\x22'+_0x5d28c0+'\x22');}else{_0x4886be['push']('email\x20wrong\x20format');}break;case _0xd7af('0x5e'):var _0xedc0b7=moment(_0x5d28c0,_0xd7af('0x5f'),!![]);if(_0xedc0b7[_0xd7af('0x60')]()){_0x3ee3fc[_0xd7af('0x41')]('\x22'+_0x5d28c0+'\x22');}else{_0x4886be[_0xd7af('0x41')](_0xd7af('0x61'));}break;default:_0x3ee3fc[_0xd7af('0x41')]('\x22'+_0x5d28c0+'\x22');}}else{switch(_0x2c55fa){case _0xd7af('0x62'):case _0xd7af('0x11'):_0x4886be[_0xd7af('0x41')](_0x2c55fa+_0xd7af('0x63'));break;default:_0x3ee3fc[_0xd7af('0x41')]('\x22\x22');}}}}if(_0x4886be[_0xd7af('0x53')]){handleError(_0x7f4ad9['data'][_0x4566d2],{'code':_0xd7af('0x64'),'message':_0x4886be[_0xd7af('0x13')]()});}else{fs[_0xd7af('0x65')](_0x5e3ccf,_0x3ee3fc[_0xd7af('0x13')]()+'\x0a');}_0x3ee3fc=[];}if(!(stats[_0xd7af('0x54')]%0xc8)){socket['emit'](_0xd7af('0x66')+_0x14133c,stats);stats[_0xd7af('0x40')]=[];}}if(stopped){logger[_0xd7af('0x3d')](_0xd7af('0x67'));_0xb4ec12[_0xd7af('0x68')]();}}catch(_0x5a4320){handleError(_0x7f4ad9[_0xd7af('0x52')][_0x4566d2],{'code':_0xd7af('0x69'),'message':_0x5a4320[_0xd7af('0x3f')]});logger[_0xd7af('0x6a')](_0xd7af('0x6b'),_0x5a4320[_0xd7af('0x3f')]);}},'complete':function(){try{var _0x1c0993=[];var _0x44c382=_0xd7af('0x28');if(_0x3c346c[_0xd7af('0x6c')]&&_0x3c346c['duplicates']['length']){_0x44c382=_0xd7af('0x6d')+_0x14133c;_0x1c0993[_0xd7af('0x41')]('CREATE\x20TABLE\x20'+_0x44c382+_0xd7af('0x6e'));}var _0x270d53=util[_0xd7af('0x6f')](_0xd7af('0x70'),_0x5e3ccf,_0x44c382,_0x54cd1f,_0x3c346c[_0xd7af('0x22')],_0x3c346c[_0xd7af('0x38')]||null,NOW,NOW);if(_[_0xd7af('0x71')](_0x779efe[_0xd7af('0x20')])){_0x270d53+=_0xd7af('0x72');}_0x1c0993[_0xd7af('0x41')](_0x270d53);if(_0x3c346c[_0xd7af('0x6c')]&&_0x3c346c[_0xd7af('0x6c')]['length']){_0x1c0993[_0xd7af('0x41')](insertCmContact(_0x3c346c[_0xd7af('0x22')],_0x44c382,_0x3c346c[_0xd7af('0x6c')],_0x779efe));_0x1c0993[_0xd7af('0x41')](_0xd7af('0x73')+_0x44c382+';');}_0x1c0993['push'](insertCmHopper(_0x3c346c['ListId'],_0xd7af('0x74'),_0xd7af('0x75'),'VoiceQueueId',_0x927c27));_0x1c0993[_0xd7af('0x41')](insertCmHopperBlack(_0x3c346c[_0xd7af('0x22')],_0xd7af('0x76'),'voice_queues',_0xd7af('0x77')));_0x1c0993[_0xd7af('0x41')](insertCmHopper(_0x3c346c['ListId'],'campaigns_has_cm_lists',_0xd7af('0x78'),_0xd7af('0x79'),_0x927c27));_0x1c0993[_0xd7af('0x41')](insertCmHopperBlack(_0x3c346c[_0xd7af('0x22')],_0xd7af('0x7a'),_0xd7af('0x78'),_0xd7af('0x79')));BPromise[_0xd7af('0x7b')](_0x1c0993,handleQuery)[_0xd7af('0x7c')](function(_0x1d736a){stats[_0xd7af('0x7d')]=!![];stats[_0xd7af('0x7e')]=_0x3c346c[_0xd7af('0x6c')]&&_0x3c346c[_0xd7af('0x6c')][_0xd7af('0x53')]?results[0x2][_0xd7af('0x7e')]:results[0x0][_0xd7af('0x7e')];socket[_0xd7af('0x7f')](_0xd7af('0x66')+_0x14133c,stats);fs[_0xd7af('0x80')](_0x1d3780);fs[_0xd7af('0x80')](_0x5e3ccf);process['exit'](0x0);})[_0xd7af('0x46')](function(_0x22c6c7){logger[_0xd7af('0x6a')](_0x22c6c7[_0xd7af('0x3f')]);process[_0xd7af('0x81')](0x1);});}catch(_0x20dae4){logger[_0xd7af('0x6a')](_0xd7af('0x82'),_0x20dae4[_0xd7af('0x3f')]);process['exit'](0x1);}},'error':function(_0x2206da,_0x253d22,_0x41902d,_0x45335d){throw new Error(_0x45335d);}});}function validate(){if(process[_0xd7af('0x83')]&&process[_0xd7af('0x83')][_0xd7af('0x53')]<0x4){throw new Error(_0xd7af('0x84'));}var _0x42b12d=path[_0xd7af('0x13')](config[_0xd7af('0x4b')],'server/files/tmp',process[_0xd7af('0x83')][0x2]);if(!fs[_0xd7af('0x85')](_0x42b12d)){throw new Error(_0xd7af('0x86'));}var _0x533595={};try{_0x533595=JSON[_0xd7af('0x50')](process[_0xd7af('0x83')][0x3]);if(!_0x533595[_0xd7af('0x4a')]){throw new Error(_0xd7af('0x87'));}if(!_0x533595[_0xd7af('0x4a')][_0xd7af('0x11')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x533595['binding'][_0xd7af('0x62')]){throw new Error(_0xd7af('0x88'));}var _0x13db1c=0x0;if(_0x533595[_0xd7af('0x4a')][_0xd7af('0x5a')]){_0x13db1c=0x1;}if(!_0x533595['ListId']){throw new Error(_0xd7af('0x89'));}}catch(_0x5d4abd){throw new Error(_0xd7af('0x8a'));}var _0x2da6c2=[];try{_0x2da6c2=_[_0xd7af('0x8b')](JSON[_0xd7af('0x50')](process[_0xd7af('0x83')][0x4]),'id');}catch(_0x5e019a){logger[_0xd7af('0x3d')](_0xd7af('0x8c'));}main(_0x42b12d,_0x533595,_0x2da6c2,_0x13db1c);}validate();process['on'](_0xd7af('0x8d'),handleStop);process['on'](_0xd7af('0x8e'),handleUncaughtException); \ No newline at end of file +var _0x334c=['message','sequelize','query','spread','main','stringify','send','start','socket_timestamp','.csv','writeFileSync','parse','createReadStream','data','length','trim','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','CampaignId','affectedRows','contact:import:','unlink','catch','complete','argv','arguments\x20\x20\x20','root','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','moment','squel','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority','UserId','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.ListId','cm_hopper_black','ListId','fields','field','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','push','code'];(function(_0xf21a7f,_0x104756){var _0x3b4f6a=function(_0x19bff7){while(--_0x19bff7){_0xf21a7f['push'](_0xf21a7f['shift']());}};_0x3b4f6a(++_0x104756);}(_0x334c,0x148));var _0xc334=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x334c[_0x313df3];return _0x241d59;};'use strict';var fs=require('fs');var path=require(_0xc334('0x0'));var _=require(_0xc334('0x1'));var Papa=require(_0xc334('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0xc334('0x3'));var squel=require(_0xc334('0x4'));var Redis=require(_0xc334('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xc334('0x6'));var logger=require('../../../config/logger')('import');config['redis']=_[_0xc334('0x7')](config[_0xc334('0x8')],{'host':_0xc334('0x9'),'port':0x18eb});var socket=require(_0xc334('0xa'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xc334('0xb')](_0xc334('0xc'));function isEmail(_0x33fc60){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))*$/[_0xc334('0xd')](_0x33fc60);}function selectNotIn(_0x1ec277,_0x3eb343,_0x55ef59,_0x1d3fec,_0x3144d2){return squel[_0xc334('0xe')]()['field'](_0xc334('0xf'))['from'](_0x1d3fec)[_0xc334('0x10')](_0x3eb343,null,_0x3eb343+_0xc334('0x11')+_0x1d3fec+'.'+_0x55ef59)[_0xc334('0x12')](_0x1d3fec+'.'+_0x55ef59+_0xc334('0x13')+_0x1ec277+'.'+_0x55ef59)[_0xc334('0x12')](_0x3eb343+_0xc334('0x14')+_0x3144d2[_0xc334('0x10')]()+')');}function insertCmHopper(_0x516e39,_0x4ceae1,_0x3d0cb6,_0x5e7f98,_0xc0c418){var _0x53c6ed=['cm_contacts.phone',_0xc334('0x15'),_0xc334('0x16'),'cm_contacts.ListId',_0x4ceae1+'.'+_0x5e7f98,_0xc334('0x17'),_0xc334('0x18'),_0xc334('0x19'),_0xc334('0x1a'),'\x22'+_0xc0c418+'\x22'];return squel[_0xc334('0x1b')]()[_0xc334('0x1c')](_0xc334('0x1d'))[_0xc334('0x1e')]([_0xc334('0xf'),_0xc334('0x1f'),_0xc334('0x20'),'ListId',_0x5e7f98,_0xc334('0x21'),_0xc334('0x22'),_0xc334('0x23'),_0xc334('0x24'),'recallme'],squel[_0xc334('0xe')]()['fields'](_0x53c6ed)[_0xc334('0x25')](_0x4ceae1)[_0xc334('0x10')](_0xc334('0x26'),null,_0xc334('0x27')+_0x4ceae1+_0xc334('0x28'))['join'](_0x3d0cb6,null,_0x3d0cb6+'.id\x20=\x20'+_0x4ceae1+'.'+_0x5e7f98)[_0xc334('0x12')](_0x4ceae1+_0xc334('0x29'),_0x516e39)[_0xc334('0x12')](_0xc334('0x2a'),NOW)[_0xc334('0x12')](_0xc334('0x2b'),selectNotIn(_0x4ceae1,_0x3d0cb6,_0x5e7f98,_0xc334('0x1d'),[_0xc334('0x2c'),'\x22onlyIfOpen\x22']))[_0xc334('0x12')](_0xc334('0x2b'),selectNotIn(_0x4ceae1,_0x3d0cb6,_0x5e7f98,_0xc334('0x1d'),[_0xc334('0x2c')])))['toString']();}function insertCmHopperBlack(_0x128ef0,_0x44bde9,_0x5d0046,_0xa6ea46){var _0x398eca=['cm_contacts.phone',_0xc334('0x16'),_0xc334('0x2d'),_0x44bde9+'.'+_0xa6ea46,_0xc334('0x17'),'cm_contacts.updatedAt'];return squel['insert']()[_0xc334('0x1c')](_0xc334('0x2e'))[_0xc334('0x1e')]([_0xc334('0xf'),_0xc334('0x20'),_0xc334('0x2f'),_0xa6ea46,_0xc334('0x21'),_0xc334('0x22')],squel[_0xc334('0xe')]()[_0xc334('0x30')](_0x398eca)[_0xc334('0x25')](_0x44bde9)[_0xc334('0x10')](_0xc334('0x26'),null,_0xc334('0x27')+_0x44bde9+_0xc334('0x28'))[_0xc334('0x10')](_0x5d0046,null,_0x5d0046+_0xc334('0x11')+_0x44bde9+'.'+_0xa6ea46)[_0xc334('0x12')](_0x44bde9+_0xc334('0x29'),_0x128ef0)[_0xc334('0x12')](_0xc334('0x2a'),NOW)[_0xc334('0x12')](_0xc334('0x2b'),squel[_0xc334('0xe')]()[_0xc334('0x31')](_0xc334('0xf'))[_0xc334('0x25')](_0xc334('0x2e'))['where'](_0xc334('0x32'),_0x128ef0)[_0xc334('0x12')](_0xa6ea46+_0xc334('0x33'),_0x44bde9+'.'+_0xa6ea46)))[_0xc334('0x34')]();}function insertCmContact(_0x2a70af,_0x4ad9fc,_0x9540ab,_0x54510c){var _0x313af0=_[_0xc334('0x35')](_[_0xc334('0x36')](_0x54510c),[_0xc334('0x2f'),_0xc334('0x37'),_0xc334('0x21'),_0xc334('0x22')]);return squel['insert']()[_0xc334('0x1c')]('cm_contacts')[_0xc334('0x1e')](_0x313af0,squel[_0xc334('0xe')]()[_0xc334('0x30')](_0x313af0)[_0xc334('0x25')](_0x4ad9fc)[_0xc334('0x12')]('('+_0x9540ab['join'](',')+_0xc334('0x38'),squel[_0xc334('0xe')]()[_0xc334('0x30')](_0x9540ab)['from'](_0xc334('0x26'))[_0xc334('0x12')](_0xc334('0x32'),_0x2a70af))['where'](_0xc334('0x39'),squel[_0xc334('0xe')]()[_0xc334('0x31')](_0xc334('0x3a'),_0xc334('0x3b'))[_0xc334('0x25')](_0x4ad9fc)[_0xc334('0x3c')](_0x9540ab['join'](','))))[_0xc334('0x34')]();}function handleStop(){logger[_0xc334('0x3d')](_0xc334('0x3e'));stopped=!![];}function handleUncaughtException(_0x5cb59c){logger[_0xc334('0x3f')](_0x5cb59c['message']);process[_0xc334('0x40')](0x1);}function handleError(_0x141aa2,_0x3ae5f3){stats[_0xc334('0x41')][_0xc334('0x42')]({'name':_0x3ae5f3[_0xc334('0x43')],'message':_0x3ae5f3[_0xc334('0x44')],'row':_0x141aa2});}function handleQuery(_0x30d344){logger[_0xc334('0x3d')](_0x30d344);return db[_0xc334('0x45')][_0xc334('0x46')](_0x30d344)[_0xc334('0x47')](function(_0x4779be){results[_0xc334('0x42')](_0x4779be);})['catch'](function(_0x103a0f){logger['error'](_0x103a0f[_0xc334('0x44')]);});}function main(_0x14d816,_0x251c12,_0x3cd932,_0x44a8d2){logger[_0xc334('0x3d')](_0xc334('0x48'),_0x14d816,JSON[_0xc334('0x49')](_0x251c12));process[_0xc334('0x4a')](_0xc334('0x4b'));var _0xc3db43=_0x251c12['binding'];var _0x57f30a=_0x251c12[_0xc334('0x4c')];var _0xb647ee=path[_0xc334('0x10')](config['root'],'server/files/tmp',_0x57f30a+_0xc334('0x4d'));var _0x356320=_[_0xc334('0x36')](_0xc3db43)[_0xc334('0x10')]();logger[_0xc334('0x3d')]('header',_0x356320);fs[_0xc334('0x4e')](_0xb647ee,_0x356320+'\x0a');Papa[_0xc334('0x4f')](fs[_0xc334('0x50')](_0x14d816),{'header':!![],'skipEmptyLines':!![],'step':function(_0xd5edb7,_0x532181){try{for(var _0xd30c91=0x0,_0xa59cad=[];_0xd30c91<_0xd5edb7[_0xc334('0x51')][_0xc334('0x52')];_0xd30c91++){stats['rows']+=0x1;if(_0xd5edb7[_0xc334('0x41')][_0xd30c91]){handleError(_0xd5edb7[_0xc334('0x51')][_0xd30c91],_0xd5edb7[_0xc334('0x41')][_0xd30c91]);}else{var _0x1646d1=[];for(var _0x574ed6 in _0xc3db43){if(_0xc3db43['hasOwnProperty'](_0x574ed6)){if(_0xd5edb7['data'][_0xd30c91][_0xc3db43[_0x574ed6]]){var _0x4e247c=_[_0xc334('0x53')](_0xd5edb7[_0xc334('0x51')][_0xd30c91][_0xc3db43[_0x574ed6]]['replace'](/"/g,'\x27'));switch(_0x574ed6){case _0xc334('0x1f'):var _0xe5379=moment(_0x4e247c,_0xc334('0xc'),!![]);if(_0xe5379['isValid']()){_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');}else{_0x1646d1[_0xc334('0x42')](_0xc334('0x54'));}break;case'priority':var _0xcab0ac=parseInt(_0x4e247c);_0x4e247c=_[_0xc334('0x55')](_0xcab0ac)||_0xcab0ac<0x0||_0xcab0ac>0x4?_0x44a8d2?0x3:0x2:_0xcab0ac;_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');break;case'UserId':var _0x16e2af=parseInt(_0x4e247c);if(_[_0xc334('0x56')](_0x16e2af)&&_['includes'](_0x3cd932,_0x16e2af)){_0xa59cad['push']('\x22'+_0x16e2af+'\x22');}else{_0x1646d1[_0xc334('0x42')](_0xc334('0x57'));}break;case _0xc334('0x58'):if(isEmail(_0x4e247c)){_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');}else{_0x1646d1[_0xc334('0x42')](_0xc334('0x59'));}break;case _0xc334('0x5a'):var _0x5e64dd=moment(_0x4e247c,'YYYY-MM-DD',!![]);if(_0x5e64dd['isValid']()){_0xa59cad[_0xc334('0x42')]('\x22'+_0x4e247c+'\x22');}else{_0x1646d1[_0xc334('0x42')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0xa59cad['push']('\x22'+_0x4e247c+'\x22');}}else{switch(_0x574ed6){case _0xc334('0x5b'):case'phone':_0x1646d1[_0xc334('0x42')](_0x574ed6+_0xc334('0x5c'));break;default:_0xa59cad['push']('\x22\x22');}}}}if(_0x1646d1[_0xc334('0x52')]){handleError(_0xd5edb7[_0xc334('0x51')][_0xd30c91],{'code':_0xc334('0x5d'),'message':_0x1646d1[_0xc334('0x10')]()});}else{fs[_0xc334('0x5e')](_0xb647ee,_0xa59cad[_0xc334('0x10')]()+'\x0a');}_0xa59cad=[];}if(!(stats[_0xc334('0x5f')]%0xc8)){socket[_0xc334('0x60')]('contact:import:'+_0x57f30a,stats);stats[_0xc334('0x41')]=[];}}if(stopped){logger[_0xc334('0x3d')]('Abort\x20parser');_0x532181[_0xc334('0x61')]();}}catch(_0x128972){handleError(_0xd5edb7['data'][_0xd30c91],{'code':_0xc334('0x62'),'message':_0x128972[_0xc334('0x44')]});logger[_0xc334('0x3f')](_0xc334('0x63'),_0x128972[_0xc334('0x44')]);}},'complete':function(){try{var _0x5374c8=[];var _0x3ebb86=_0xc334('0x26');if(_0x251c12[_0xc334('0x64')]&&_0x251c12[_0xc334('0x64')][_0xc334('0x52')]){_0x3ebb86=_0xc334('0x65')+_0x57f30a;_0x5374c8[_0xc334('0x42')](_0xc334('0x66')+_0x3ebb86+_0xc334('0x67'));}var _0x26c119=util[_0xc334('0xb')](_0xc334('0x68'),_0xb647ee,_0x3ebb86,_0x356320,_0x251c12[_0xc334('0x2f')],_0x251c12[_0xc334('0x37')]||null,NOW,NOW);if(_[_0xc334('0x69')](_0xc3db43[_0xc334('0x1f')])){_0x26c119+=_0xc334('0x6a');}_0x5374c8[_0xc334('0x42')](_0x26c119);if(_0x251c12['duplicates']&&_0x251c12[_0xc334('0x64')]['length']){_0x5374c8['push'](insertCmContact(_0x251c12[_0xc334('0x2f')],_0x3ebb86,_0x251c12[_0xc334('0x64')],_0xc3db43));_0x5374c8['push']('DROP\x20TABLE\x20'+_0x3ebb86+';');}_0x5374c8[_0xc334('0x42')](insertCmHopper(_0x251c12[_0xc334('0x2f')],_0xc334('0x6b'),_0xc334('0x6c'),_0xc334('0x6d'),_0x44a8d2));_0x5374c8[_0xc334('0x42')](insertCmHopperBlack(_0x251c12['ListId'],_0xc334('0x6e'),_0xc334('0x6c'),_0xc334('0x6d')));_0x5374c8[_0xc334('0x42')](insertCmHopper(_0x251c12[_0xc334('0x2f')],'campaigns_has_cm_lists',_0xc334('0x6f'),'CampaignId',_0x44a8d2));_0x5374c8[_0xc334('0x42')](insertCmHopperBlack(_0x251c12[_0xc334('0x2f')],_0xc334('0x70'),'campaigns',_0xc334('0x71')));BPromise['each'](_0x5374c8,handleQuery)['then'](function(_0x2adaac){stats['finish']=!![];stats[_0xc334('0x72')]=_0x251c12[_0xc334('0x64')]&&_0x251c12['duplicates']['length']?results[0x2][_0xc334('0x72')]:results[0x0]['affectedRows'];socket['emit'](_0xc334('0x73')+_0x57f30a,stats);fs[_0xc334('0x74')](_0x14d816);fs[_0xc334('0x74')](_0xb647ee);process[_0xc334('0x40')](0x0);})[_0xc334('0x75')](function(_0x5586d3){logger[_0xc334('0x3f')](_0x5586d3[_0xc334('0x44')]);process['exit'](0x1);});}catch(_0x3a4e1e){logger[_0xc334('0x3f')](_0xc334('0x76'),_0x3a4e1e[_0xc334('0x44')]);process[_0xc334('0x40')](0x1);}},'error':function(_0x59478e,_0x2906f3,_0x183abc,_0x53bfd2){throw new Error(_0x53bfd2);}});}function validate(){if(process[_0xc334('0x77')]&&process[_0xc334('0x77')]['length']<0x4){throw new Error(_0xc334('0x78'));}var _0x54e4ec=path[_0xc334('0x10')](config[_0xc334('0x79')],_0xc334('0x7a'),process[_0xc334('0x77')][0x2]);if(!fs[_0xc334('0x7b')](_0x54e4ec)){throw new Error(_0xc334('0x7c'));}var _0x5e49bc={};try{_0x5e49bc=JSON[_0xc334('0x4f')](process['argv'][0x3]);if(!_0x5e49bc['binding']){throw new Error(_0xc334('0x7d'));}if(!_0x5e49bc[_0xc334('0x7e')][_0xc334('0xf')]){throw new Error(_0xc334('0x7f'));}if(!_0x5e49bc[_0xc334('0x7e')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x4554c0=0x0;if(_0x5e49bc['binding'][_0xc334('0x24')]){_0x4554c0=0x1;}if(!_0x5e49bc[_0xc334('0x2f')]){throw new Error(_0xc334('0x80'));}}catch(_0x4e1c58){throw new Error('body\x20id\x20mandatory');}var _0x565455=[];try{_0x565455=_[_0xc334('0x81')](JSON[_0xc334('0x4f')](process[_0xc334('0x77')][0x4]),'id');}catch(_0x458e30){logger['info']('No\x20agent\x20available');}main(_0x54e4ec,_0x5e49bc,_0x565455,_0x4554c0);}validate();process['on'](_0xc334('0x82'),handleStop);process['on'](_0xc334('0x83'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 6826099..3045a5a 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 _0x5f66=['***\x20Time\x20Info\x20***','Agent\x20Ring','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','variable','queue','calleridnum','outbound','push','Outbound\x20Call','getDescriptions','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','Agent\x20Number','destcalleridnum'];(function(_0x2f0d03,_0x3dd63e){var _0x15e0ef=function(_0x171f66){while(--_0x171f66){_0x2f0d03['push'](_0x2f0d03['shift']());}};_0x15e0ef(++_0x3dd63e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';exports['getSubjects']=function(_0x61c60c,_0x4a3887){var _0x2d5fd9=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1'),'variableName':null}];switch(_0x61c60c[_0x65f6('0x2')]()){case _0x65f6('0x3'):switch(_0x4a3887['toLowerCase']()){case _0x65f6('0x4'):_0x2d5fd9['push']({'type':_0x65f6('0x5'),'content':'','variableName':_0x65f6('0x6')});_0x2d5fd9['push']({'type':'variable','content':'','variableName':_0x65f6('0x7')});break;case _0x65f6('0x8'):_0x2d5fd9[_0x65f6('0x9')]({'type':_0x65f6('0x0'),'content':_0x65f6('0xa'),'variableName':null});_0x2d5fd9[_0x65f6('0x9')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x2d5fd9;};exports[_0x65f6('0xb')]=function(_0x2f6d5b,_0x264647){var _0x25c416=[];switch(_0x2f6d5b['toLowerCase']()){case _0x65f6('0x3'):switch(_0x264647['toLowerCase']()){case'inbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Caller\x20Number','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x7')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xd'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0xe')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0xf'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x10')},{'type':'keyValue','content':'','key':_0x65f6('0x11'),'keyType':'variable','variableName':'queue'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x12'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x15')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':'destcalleridname'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x16'),'keyType':'variable','variableName':_0x65f6('0x17')},{'type':_0x65f6('0x0'),'content':_0x65f6('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x19'),'keyType':_0x65f6('0x5'),'variableName':'agentcalledAt'},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Connect','keyType':'variable','variableName':_0x65f6('0x1a')},{'type':_0x65f6('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0x65f6('0x5'),'variableName':_0x65f6('0x1b')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1c'),'keyType':'variable','variableName':_0x65f6('0x1d')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x1e'),'keyType':'variable','variableName':'talktime'}];break;case'outbound':_0x25c416=[{'type':_0x65f6('0x0'),'content':_0x65f6('0x1f'),'variableName':null},{'type':'keyValue','content':'','key':_0x65f6('0x20'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x21'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x13')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x14'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x22')},{'type':_0x65f6('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0x65f6('0x23'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'answertime'},{'type':'keyValue','content':'','key':_0x65f6('0x24'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':_0x65f6('0x25')},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x26'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'duration'},{'type':_0x65f6('0xc'),'content':'','key':_0x65f6('0x27'),'keyType':_0x65f6('0x5'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x25c416;}; \ No newline at end of file +var _0xadb5=['uniqueid','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','agentcalledAt','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','toLowerCase','inbound','variable','queue','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','keyValue','calleridname','Queue','UniqueId'];(function(_0x2c7623,_0x33f839){var _0x244dbf=function(_0x302a6a){while(--_0x302a6a){_0x2c7623['push'](_0x2c7623['shift']());}};_0x244dbf(++_0x33f839);}(_0xadb5,0xad));var _0x5adb=function(_0x551d99,_0xc035a7){_0x551d99=_0x551d99-0x0;var _0x17ffaf=_0xadb5[_0x551d99];return _0x17ffaf;};'use strict';exports['getSubjects']=function(_0x2e4c9a,_0x49fc17){var _0x3d6340=[{'type':_0x5adb('0x0'),'content':_0x5adb('0x1'),'variableName':null}];switch(_0x2e4c9a['toLowerCase']()){case _0x5adb('0x2'):switch(_0x49fc17[_0x5adb('0x3')]()){case _0x5adb('0x4'):_0x3d6340['push']({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x6')});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0x8')});break;case _0x5adb('0x9'):_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x0'),'content':_0x5adb('0xa'),'variableName':null});_0x3d6340[_0x5adb('0x7')]({'type':_0x5adb('0x5'),'content':'','variableName':_0x5adb('0xb')});break;}}return _0x3d6340;};exports[_0x5adb('0xc')]=function(_0x275428,_0x563d86){var _0x4c268d=[];switch(_0x275428[_0x5adb('0x3')]()){case _0x5adb('0x2'):switch(_0x563d86[_0x5adb('0x3')]()){case'inbound':_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Number','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x8')},{'type':_0x5adb('0xd'),'content':'','key':'Caller\x20Name','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xe')},{'type':_0x5adb('0xd'),'content':'','key':'Call\x20To','keyType':_0x5adb('0x5'),'variableName':'destexten'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0xf'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x6')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':'Date','keyType':_0x5adb('0x5'),'variableName':'agentcalledAt'},{'type':_0x5adb('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Name','keyType':'variable','variableName':_0x5adb('0x12')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x13'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0xb')},{'type':'string','content':_0x5adb('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Ring','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x15')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x16'),'keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x17')},{'type':_0x5adb('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0x5adb('0x5'),'variableName':_0x5adb('0x18')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x19'),'keyType':_0x5adb('0x5'),'variableName':'holdtime'},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1a'),'keyType':'variable','variableName':_0x5adb('0x1b')}];break;case _0x5adb('0x9'):_0x4c268d=[{'type':_0x5adb('0x0'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1c'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0xb')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1d'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x5adb('0x10'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x11')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x1e'),'keyType':'variable','keyContent':'','variableName':_0x5adb('0x1f')},{'type':_0x5adb('0x0'),'content':_0x5adb('0x14')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x20'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x21')},{'type':_0x5adb('0xd'),'content':'','key':_0x5adb('0x22'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':'endtime'},{'type':_0x5adb('0xd'),'content':'','key':'Duration','keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x23')},{'type':'keyValue','content':'','key':_0x5adb('0x24'),'keyType':_0x5adb('0x5'),'keyContent':'','variableName':_0x5adb('0x25')}];break;}}return _0x4c268d;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 5ee5453..a97e0b9 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 _0xbb74=['omit','phone','fax','lodash','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','stringify','Interaction','findOne','then','info','error','user','query','clone','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb74,0x116));var _0x4bb7=function(_0x427845,_0x22390){_0x427845=_0x427845-0x0;var _0x4999f5=_0xbb74[_0x427845];return _0x4999f5;};'use strict';var _=require(_0x4bb7('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x4bb7('0x1'))(_0x4bb7('0x2')),'mail':require(_0x4bb7('0x1'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x4bb7('0x1'))(_0x4bb7('0x3')),'chat':require(_0x4bb7('0x1'))(_0x4bb7('0x4'))};function getInteractionId(_0x5ae44e,_0x3661ed,_0x1877ab){if(_0x5ae44e&&_0x5ae44e[_[_0x4bb7('0x5')](_0x1877ab)+_0x4bb7('0x6')]){return _0x5ae44e[_['upperFirst'](_0x1877ab)+_0x4bb7('0x6')];}else if(_0x5ae44e&&_0x5ae44e['id']){return _0x5ae44e['id'];}else if(_0x3661ed&&_0x3661ed['id']){return _0x3661ed['id'];}else{return _0x4bb7('0x7');}}function log(_0x104308,_0xeca3a9,_0x387c99,_0x1fa063,_0x25b55f,_0x140f47){loggers[_0x25b55f[_0x4bb7('0x8')]()][_0x104308](_0x4bb7('0x9'),_0x140f47[_0x4bb7('0xa')](),_0xeca3a9?_0xeca3a9['id']:null,_0xeca3a9?_0xeca3a9[_0x4bb7('0xb')]:null,_0xeca3a9?_0xeca3a9['role']:null,getInteractionId(_0x387c99,_0x1fa063,_0x25b55f),_0x387c99?JSON[_0x4bb7('0xc')](_0x387c99):'null');}function updateUser(_0x2b1d4b,_0x4c88b4,_0x472fb2,_0x181d1e,_0x5ad082){db[_['upperFirst'](_0x181d1e)+_0x4bb7('0xd')][_0x4bb7('0xe')]({'where':{'id':getInteractionId(_0x4c88b4,_0x472fb2,_0x181d1e)}})[_0x4bb7('0xf')](function(_0x2309e4){if(_0x2309e4){return _0x2309e4['update']({'UserId':_0x2b1d4b?_0x2b1d4b['id']:null});}})[_0x4bb7('0xf')](function(_0x8ed01c){if(_0x8ed01c){log(_0x4bb7('0x10'),_0x2b1d4b,_0x4c88b4,_0x472fb2,_0x181d1e,_0x5ad082);}})['catch'](function(){log(_0x4bb7('0x11'),_0x2b1d4b,_0x4c88b4,_0x472fb2,_0x181d1e,_0x5ad082);});}exports['tracked']=function(_0x4aad51,_0x5a61b5){return function(_0x26f0b0,_0x5bee52,_0x4afec2){var _0x120c3e=_0x26f0b0[_0x4bb7('0x12')];var _0x27cf7a={};var _0x490340=_0x26f0b0[_0x4bb7('0x13')];if(_0x27cf7a){_0x27cf7a=_[_0x4bb7('0x14')](_0x26f0b0[_0x4bb7('0x15')]);_0x27cf7a=_[_0x4bb7('0x16')](_0x27cf7a,[_0x4bb7('0x15'),'html',_0x4bb7('0x17'),_0x4bb7('0x18'),'mobile']);}updateUser(_0x120c3e,_0x27cf7a,_0x490340,_0x4aad51,_0x5a61b5);_0x4afec2(null);};}; \ No newline at end of file +var _0x5732=['../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','Interaction','findOne','then','update','info','catch','error','query','body','omit','html','phone','fax','mobile','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5732,0xfb));var _0x2573=function(_0x524e09,_0x15f77c){_0x524e09=_0x524e09-0x0;var _0x5edcf6=_0x5732[_0x524e09];return _0x5edcf6;};'use strict';var _=require(_0x2573('0x0'));var db=require(_0x2573('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')('openchannel-interactions'),'mail':require(_0x2573('0x2'))(_0x2573('0x3')),'fax':require('../../config/logger')(_0x2573('0x4')),'sms':require(_0x2573('0x2'))(_0x2573('0x5')),'chat':require(_0x2573('0x2'))(_0x2573('0x6'))};function getInteractionId(_0x2064cc,_0xcafe30,_0x10ede1){if(_0x2064cc&&_0x2064cc[_[_0x2573('0x7')](_0x10ede1)+_0x2573('0x8')]){return _0x2064cc[_['upperFirst'](_0x10ede1)+_0x2573('0x8')];}else if(_0x2064cc&&_0x2064cc['id']){return _0x2064cc['id'];}else if(_0xcafe30&&_0xcafe30['id']){return _0xcafe30['id'];}else{return _0x2573('0x9');}}function log(_0x3b9025,_0xad7385,_0x13604e,_0xe1bac,_0x4537bc,_0x40fbff){loggers[_0x4537bc[_0x2573('0xa')]()][_0x3b9025](_0x2573('0xb'),_0x40fbff['toUpperCase'](),_0xad7385?_0xad7385['id']:null,_0xad7385?_0xad7385[_0x2573('0xc')]:null,_0xad7385?_0xad7385[_0x2573('0xd')]:null,getInteractionId(_0x13604e,_0xe1bac,_0x4537bc),_0x13604e?JSON['stringify'](_0x13604e):'null');}function updateUser(_0x2c7b72,_0x4ed55f,_0x22f7fd,_0x20e0ec,_0x505766){db[_[_0x2573('0x7')](_0x20e0ec)+_0x2573('0xe')][_0x2573('0xf')]({'where':{'id':getInteractionId(_0x4ed55f,_0x22f7fd,_0x20e0ec)}})[_0x2573('0x10')](function(_0x5bc53b){if(_0x5bc53b){return _0x5bc53b[_0x2573('0x11')]({'UserId':_0x2c7b72?_0x2c7b72['id']:null});}})[_0x2573('0x10')](function(_0x483671){if(_0x483671){log(_0x2573('0x12'),_0x2c7b72,_0x4ed55f,_0x22f7fd,_0x20e0ec,_0x505766);}})[_0x2573('0x13')](function(){log(_0x2573('0x14'),_0x2c7b72,_0x4ed55f,_0x22f7fd,_0x20e0ec,_0x505766);});}exports['tracked']=function(_0x2f70fc,_0x3f1e5b){return function(_0x20c0f7,_0x43a554,_0x590ab6){var _0x4594f6=_0x20c0f7['user'];var _0x2c572a={};var _0x1df74d=_0x20c0f7[_0x2573('0x15')];if(_0x2c572a){_0x2c572a=_['clone'](_0x20c0f7[_0x2573('0x16')]);_0x2c572a=_[_0x2573('0x17')](_0x2c572a,[_0x2573('0x16'),_0x2573('0x18'),_0x2573('0x19'),_0x2573('0x1a'),_0x2573('0x1b')]);}updateUser(_0x4594f6,_0x2c572a,_0x1df74d,_0x2f70fc,_0x3f1e5b);_0x590ab6(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 111b0bb..0fed94e 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 _0x9f0e=['use','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','hasOwnProperty'];(function(_0x5407ec,_0x544d77){var _0x3a21e6=function(_0x5ae615){while(--_0x5ae615){_0x5407ec['push'](_0x5407ec['shift']());}};_0x3a21e6(++_0x544d77);}(_0x9f0e,0x8d));var _0xe9f0=function(_0x41adf0,_0x26ed7a){_0x41adf0=_0x41adf0-0x0;var _0x3460ff=_0x9f0e[_0x41adf0];return _0x3460ff;};'use strict';var crypto=require(_0xe9f0('0x0'));var util=require('util');var compose=require(_0xe9f0('0x1'));var db=require(_0xe9f0('0x2'))['db'];var config=require(_0xe9f0('0x3'));function getValueFromLicense(_0x4ea0a5,_0x41fa89){if(_0x4ea0a5&&_0x41fa89){if(_0x41fa89[_0xe9f0('0x4')]&&_0x41fa89[_0xe9f0('0x5')]){var _0x49583d=_0x41fa89['data1'];var _0x7c11d8=_0x41fa89[_0xe9f0('0x5')];var _0x4aac80=_0x49583d[_0xe9f0('0x6')]('-')[0x4];var _0x3829ef=_0x49583d[_0xe9f0('0x6')]('-')[0x0];var _0x404707=crypto[_0xe9f0('0x7')](_0xe9f0('0x8'),util[_0xe9f0('0x9')](_0xe9f0('0xa'),_0x4aac80,_0x49583d,_0x3829ef));var _0x12beaa=_0x404707[_0xe9f0('0xb')](_0x7c11d8,'base64',_0xe9f0('0xc'));_0x12beaa+=_0x404707[_0xe9f0('0xd')](_0xe9f0('0xc'));var _0x182005=JSON['parse'](_0x12beaa);return _0x182005[_0xe9f0('0xe')](_0x4ea0a5)?_0x182005[_0x4ea0a5]:null;}}return null;}function isLimit(_0xae266f,_0x4f7c5a,_0x473b6d,_0x3ffe20){var _0x12ed0e=_0x4f7c5a;return compose()[_0xe9f0('0xf')](function(_0x30b2fc,_0x2daf10,_0x171520){return db[_0xe9f0('0x10')][_0xe9f0('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xe9f0('0x12')](function(_0x2f11fb){var _0x268be8=getValueFromLicense(_0xae266f,_0x2f11fb);return _0x268be8?_0x268be8:_0x12ed0e;})[_0xe9f0('0x12')](function(_0x470dd6){_0x12ed0e=_0x470dd6;return _0x473b6d[_0xe9f0('0x13')](_0x3ffe20);})[_0xe9f0('0x12')](function(_0x227cd5){if(_0x227cd5>=_0x12ed0e){return _0x2daf10[_0xe9f0('0x14')](0x193)['json']({'message':util[_0xe9f0('0x9')](_0xe9f0('0x15'),_0xae266f)});}_0x171520();})[_0xe9f0('0x16')](function(_0x42a61){_0x171520(_0x42a61);});});}function isUserLimit(){return isLimit(_0xe9f0('0x17'),0x1,db[_0xe9f0('0x18')],{'where':{'$or':[{'role':_0xe9f0('0x19')},{'role':'user'}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x2935=['user','isUserLimit','crypto','../../mysqldb','../../config/environment','license','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','use','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x15c19a,_0xd4667b){var _0x3290d9=function(_0x1c533d){while(--_0x1c533d){_0x15c19a['push'](_0x15c19a['shift']());}};_0x3290d9(++_0xd4667b);}(_0x2935,0xda));var _0x5293=function(_0x43c13c,_0x4f2ad5){_0x43c13c=_0x43c13c-0x0;var _0x5ecb8e=_0x2935[_0x43c13c];return _0x5ecb8e;};'use strict';var crypto=require(_0x5293('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x5293('0x1'))['db'];var config=require(_0x5293('0x2'));function getValueFromLicense(_0x1b55e1,_0x2bc31e){if(_0x1b55e1&&_0x2bc31e){if(_0x2bc31e['data1']&&_0x2bc31e[_0x5293('0x3')]){var _0x5875fa=_0x2bc31e['data1'];var _0x556479=_0x2bc31e[_0x5293('0x3')];var _0x5ef467=_0x5875fa[_0x5293('0x4')]('-')[0x4];var _0x2ab046=_0x5875fa[_0x5293('0x4')]('-')[0x0];var _0x4a8346=crypto['createDecipher'](_0x5293('0x5'),util[_0x5293('0x6')](_0x5293('0x7'),_0x5ef467,_0x5875fa,_0x2ab046));var _0x5b1fbf=_0x4a8346[_0x5293('0x8')](_0x556479,_0x5293('0x9'),_0x5293('0xa'));_0x5b1fbf+=_0x4a8346[_0x5293('0xb')](_0x5293('0xa'));var _0x87947=JSON[_0x5293('0xc')](_0x5b1fbf);return _0x87947['hasOwnProperty'](_0x1b55e1)?_0x87947[_0x1b55e1]:null;}}return null;}function isLimit(_0xb0d1c8,_0x344afc,_0x5594bb,_0x506d01){var _0x5c5f67=_0x344afc;return compose()[_0x5293('0xd')](function(_0x5f1f5c,_0x4b8cc8,_0x55ce52){return db['License'][_0x5293('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x5293('0xf')](function(_0x5b07be){var _0x29d721=getValueFromLicense(_0xb0d1c8,_0x5b07be);return _0x29d721?_0x29d721:_0x5c5f67;})['then'](function(_0x1a55db){_0x5c5f67=_0x1a55db;return _0x5594bb['count'](_0x506d01);})[_0x5293('0xf')](function(_0x521279){if(_0x521279>=_0x5c5f67){return _0x4b8cc8[_0x5293('0x10')](0x193)[_0x5293('0x11')]({'message':util[_0x5293('0x6')](_0x5293('0x12'),_0xb0d1c8)});}_0x55ce52();})[_0x5293('0x13')](function(_0x337bb1){_0x55ce52(_0x337bb1);});});}function isUserLimit(){return isLimit(_0x5293('0x14'),0x1,db[_0x5293('0x15')],{'where':{'$or':[{'role':'admin'},{'role':_0x5293('0x16')}]}});}exports[_0x5293('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 126cb75..0dc2889 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 _0x4eed=['parse','split','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','substr','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','moment','sequelize','fields','filters','isEmpty','forOwn','isArray'];(function(_0x4bde34,_0xaa7b76){var _0x57ef23=function(_0x371c99){while(--_0x371c99){_0x4bde34['push'](_0x4bde34['shift']());}};_0x57ef23(++_0xaa7b76);}(_0x4eed,0xe1));var _0xd4ee=function(_0x4a695e,_0x23130c){_0x4a695e=_0x4a695e-0x0;var _0x28208c=_0x4eed[_0x4a695e];return _0x28208c;};'use strict';var _=require('lodash');var moment=require(_0xd4ee('0x0'));var sequelize=require(_0xd4ee('0x1'));var LIMIT_VALUE=0xfa;exports[_0xd4ee('0x2')]=function(_0x544172){var _0x36f3a7=null;if(_0x544172){_0x36f3a7=_0x544172['split'](',');}return _0x36f3a7;};exports[_0xd4ee('0x3')]=function(_0x17595e){var _0x3da3de={};if(!_[_0xd4ee('0x4')](_0x17595e)){_0x3da3de={};_[_0xd4ee('0x5')](_0x17595e,function(_0x215a42,_0x4b442c){try{_0x3da3de[_0x4b442c]=_[_0xd4ee('0x6')](_0x215a42)?_0x215a42:JSON[_0xd4ee('0x7')](_0x215a42);}catch(_0x496c53){_0x3da3de[_0x4b442c]=_0x215a42[_0xd4ee('0x8')](',');}});}return _0x3da3de;};exports[_0xd4ee('0x9')]=function(_0x8b24aa){_0x8b24aa=parseInt(_0x8b24aa,0xa);if(!_0x8b24aa||_0x8b24aa<0x0){_0x8b24aa=LIMIT_VALUE;}return _0x8b24aa;};exports[_0xd4ee('0xa')]=function(_0x38f6cf){_0x38f6cf=parseInt(_0x38f6cf,0xa);if(!_0x38f6cf||_0x38f6cf<0x0){_0x38f6cf=0x0;}return _0x38f6cf;};exports[_0xd4ee('0xb')]=function(_0x319d69){var _0x5ec111,_0x3bb06c=null;if(_0x319d69){_0x5ec111=_0x319d69[_0xd4ee('0x8')](',');_0x3bb06c=_[_0xd4ee('0xc')](_0x5ec111,function(_0x14003b){if(_0x14003b[_0xd4ee('0xd')]('-')===0x0){return[_0x14003b===_0xd4ee('0xe')?sequelize[_0xd4ee('0xf')](sequelize[_0xd4ee('0x10')](_0xd4ee('0xe')),_0xd4ee('0x11')):_0x14003b[_0xd4ee('0x12')](0x1),'DESC'];}else{return[_0x14003b===_0xd4ee('0xe')?sequelize[_0xd4ee('0xf')](sequelize[_0xd4ee('0x10')](_0xd4ee('0xe')),_0xd4ee('0x11')):_0x14003b,'ASC'];}});}return _0x3bb06c;};exports[_0xd4ee('0x13')]=function(_0x4353ea,_0x693aef){if(_[_0xd4ee('0x4')](_0x4353ea)){return _0x4353ea;}if(_[_0xd4ee('0x6')](_0x4353ea)){for(var _0x41d62c=0x0;_0x41d62c<_0x4353ea[_0xd4ee('0x14')];_0x41d62c+=0x1){_0x4353ea[_0x41d62c]=this[_0xd4ee('0x13')](_0x4353ea[_0x41d62c],_0x693aef);}return _0x4353ea;}if(!_[_0xd4ee('0x15')](_0x4353ea)){return _0x4353ea;}if(_[_0xd4ee('0x16')](_0x693aef)){_0x693aef=[_0x693aef];}if(!_[_0xd4ee('0x6')](_0x693aef)){return _0x4353ea;}for(var _0x2329f2=0x0;_0x2329f2<_0x693aef[_0xd4ee('0x14')];_0x2329f2+=0x1){_[_0xd4ee('0x17')](_0x4353ea,_0x693aef[_0x2329f2]);}for(var _0x558756 in _0x4353ea){if(_0x4353ea[_0xd4ee('0x18')](_0x558756)){_0x4353ea[_0x558756]=this[_0xd4ee('0x13')](_0x4353ea[_0x558756],_0x693aef);}}return _0x4353ea;};exports[_0xd4ee('0x19')]=function(_0x25a360){return _0x25a360[_0xd4ee('0x1a')](RegExp(_0xd4ee('0x1b')))?!![]:![];};exports[_0xd4ee('0x1c')]=function(_0x2b49e9){return _0x2b49e9['match'](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file +var _0xef4e=['unset','hasOwnProperty','isNumeric','match','isEmail','lodash','moment','sequelize','fields','split','filters','isEmpty','forOwn','isArray','parse','limit','sort','map','indexOf','cast','col','priority','unsigned','substr','ASC','length','omit','isString'];(function(_0x7e6de,_0x4c3bcb){var _0x32d727=function(_0x4ddd32){while(--_0x4ddd32){_0x7e6de['push'](_0x7e6de['shift']());}};_0x32d727(++_0x4c3bcb);}(_0xef4e,0x171));var _0xeef4=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xef4e[_0x4551f6];return _0x581dc2;};'use strict';var _=require(_0xeef4('0x0'));var moment=require(_0xeef4('0x1'));var sequelize=require(_0xeef4('0x2'));var LIMIT_VALUE=0xfa;exports[_0xeef4('0x3')]=function(_0x597f1f){var _0x422745=null;if(_0x597f1f){_0x422745=_0x597f1f[_0xeef4('0x4')](',');}return _0x422745;};exports[_0xeef4('0x5')]=function(_0x214667){var _0x3097bd={};if(!_[_0xeef4('0x6')](_0x214667)){_0x3097bd={};_[_0xeef4('0x7')](_0x214667,function(_0x310fc3,_0x301139){try{_0x3097bd[_0x301139]=_[_0xeef4('0x8')](_0x310fc3)?_0x310fc3:JSON[_0xeef4('0x9')](_0x310fc3);}catch(_0x17123b){_0x3097bd[_0x301139]=_0x310fc3[_0xeef4('0x4')](',');}});}return _0x3097bd;};exports[_0xeef4('0xa')]=function(_0x33aab4){_0x33aab4=parseInt(_0x33aab4,0xa);if(!_0x33aab4||_0x33aab4<0x0){_0x33aab4=LIMIT_VALUE;}return _0x33aab4;};exports['offset']=function(_0x4e6f61){_0x4e6f61=parseInt(_0x4e6f61,0xa);if(!_0x4e6f61||_0x4e6f61<0x0){_0x4e6f61=0x0;}return _0x4e6f61;};exports[_0xeef4('0xb')]=function(_0x5c702c){var _0x3eff3d,_0x4e4986=null;if(_0x5c702c){_0x3eff3d=_0x5c702c[_0xeef4('0x4')](',');_0x4e4986=_[_0xeef4('0xc')](_0x3eff3d,function(_0x3bf5f6){if(_0x3bf5f6[_0xeef4('0xd')]('-')===0x0){return[_0x3bf5f6==='priority'?sequelize[_0xeef4('0xe')](sequelize[_0xeef4('0xf')](_0xeef4('0x10')),_0xeef4('0x11')):_0x3bf5f6[_0xeef4('0x12')](0x1),'DESC'];}else{return[_0x3bf5f6===_0xeef4('0x10')?sequelize[_0xeef4('0xe')](sequelize[_0xeef4('0xf')](_0xeef4('0x10')),_0xeef4('0x11')):_0x3bf5f6,_0xeef4('0x13')];}});}return _0x4e4986;};exports['omit']=function(_0x37df25,_0x55985a){if(_[_0xeef4('0x6')](_0x37df25)){return _0x37df25;}if(_[_0xeef4('0x8')](_0x37df25)){for(var _0x4f56bb=0x0;_0x4f56bb<_0x37df25[_0xeef4('0x14')];_0x4f56bb+=0x1){_0x37df25[_0x4f56bb]=this[_0xeef4('0x15')](_0x37df25[_0x4f56bb],_0x55985a);}return _0x37df25;}if(!_['isObject'](_0x37df25)){return _0x37df25;}if(_[_0xeef4('0x16')](_0x55985a)){_0x55985a=[_0x55985a];}if(!_[_0xeef4('0x8')](_0x55985a)){return _0x37df25;}for(var _0x37ef26=0x0;_0x37ef26<_0x55985a[_0xeef4('0x14')];_0x37ef26+=0x1){_[_0xeef4('0x17')](_0x37df25,_0x55985a[_0x37ef26]);}for(var _0x2c3052 in _0x37df25){if(_0x37df25[_0xeef4('0x18')](_0x2c3052)){_0x37df25[_0x2c3052]=this[_0xeef4('0x15')](_0x37df25[_0x2c3052],_0x55985a);}}return _0x37df25;};exports[_0xeef4('0x19')]=function(_0x27ef06){return _0x27ef06[_0xeef4('0x1a')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0xeef4('0x1b')]=function(_0x4115ee){return _0x4115ee[_0xeef4('0x1a')](/^\S+@\S+$/)?!![]:![];}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index f0ab039..14b9b29 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['toISOString','engine','html','view\x20engine','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','cookie-parser','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','use','join','root','public','favicon.ico','set','appPath','client'];(function(_0x273252,_0x24ba17){var _0x47d3ce=function(_0x54c538){while(--_0x54c538){_0x273252['push'](_0x273252['shift']());}};_0x47d3ce(++_0x24ba17);}(_0xe706,0xa3));var _0x6e70=function(_0x118986,_0x2ea044){_0x118986=_0x118986-0x0;var _0x25c9e6=_0xe706[_0x118986];return _0x25c9e6;};'use strict';var express=require(_0x6e70('0x0'));var favicon=require(_0x6e70('0x1'));var bodyParser=require(_0x6e70('0x2'));var methodOverride=require('method-override');var cookieParser=require(_0x6e70('0x3'));var errorHandler=require(_0x6e70('0x4'));var path=require(_0x6e70('0x5'));var passport=require(_0x6e70('0x6'));var cors=require(_0x6e70('0x7'));var moment=require(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var db=require(_0x6e70('0xa'))['db'];exports[_0x6e70('0xb')]=function(_0x4381d1){var _0x36357b=_0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'));if(_0x36357b===_0x6e70('0xe')){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x12')));}if(_0x36357b==='development'||_0x36357b==='test'){_0x4381d1[_0x6e70('0xf')](favicon(path[_0x6e70('0x10')](config[_0x6e70('0x11')],_0x6e70('0x16'),_0x6e70('0x13'))));_0x4381d1[_0x6e70('0x14')](_0x6e70('0x15'),path[_0x6e70('0x10')](config['root'],'client'));_0x4381d1['use'](errorHandler());}_0x4381d1[_0x6e70('0x14')]('json\x20replacer',function(_0x53aed0,_0x304716){if(this[_0x53aed0]instanceof Date){_0x304716=this[_0x53aed0][_0x6e70('0x17')]()['split']('.')[0x0]+'Z';}return _0x304716;});_0x4381d1[_0x6e70('0xf')](express['static'](_0x4381d1[_0x6e70('0xc')](_0x6e70('0x15'))));_0x4381d1['set']('views',config[_0x6e70('0x11')]+'/server/views');_0x4381d1[_0x6e70('0x18')](_0x6e70('0x19'),require('ejs')['renderFile']);_0x4381d1[_0x6e70('0x14')](_0x6e70('0x1a'),_0x6e70('0x19'));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1b')]({'limit':_0x6e70('0x1c'),'extended':!![]}));_0x4381d1[_0x6e70('0xf')](bodyParser[_0x6e70('0x1d')]({'limit':_0x6e70('0x1c')}));_0x4381d1[_0x6e70('0xf')](cors());_0x4381d1['use'](methodOverride());_0x4381d1[_0x6e70('0xf')](cookieParser());_0x4381d1[_0x6e70('0xf')](passport[_0x6e70('0x1e')]());}; \ No newline at end of file +var _0x0713=['use','join','root','favicon.ico','set','appPath','development','test','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require(_0x3071('0x0'));var methodOverride=require(_0x3071('0x1'));var cookieParser=require(_0x3071('0x2'));var errorHandler=require(_0x3071('0x3'));var path=require(_0x3071('0x4'));var passport=require('passport');var cors=require(_0x3071('0x5'));var moment=require(_0x3071('0x6'));var config=require(_0x3071('0x7'));var db=require(_0x3071('0x8'))['db'];exports[_0x3071('0x9')]=function(_0x41cf76){var _0x1d3dd6=_0x41cf76[_0x3071('0xa')](_0x3071('0xb'));if(_0x1d3dd6===_0x3071('0xc')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'public',_0x3071('0x10'))));_0x41cf76[_0x3071('0x11')](_0x3071('0x12'),path[_0x3071('0xe')](config[_0x3071('0xf')],'public'));}if(_0x1d3dd6===_0x3071('0x13')||_0x1d3dd6===_0x3071('0x14')){_0x41cf76[_0x3071('0xd')](favicon(path[_0x3071('0xe')](config[_0x3071('0xf')],'client','favicon.ico')));_0x41cf76[_0x3071('0x11')]('appPath',path[_0x3071('0xe')](config[_0x3071('0xf')],'client'));_0x41cf76[_0x3071('0xd')](errorHandler());}_0x41cf76['set'](_0x3071('0x15'),function(_0x45c93b,_0x1271d0){if(this[_0x45c93b]instanceof Date){_0x1271d0=this[_0x45c93b][_0x3071('0x16')]()[_0x3071('0x17')]('.')[0x0]+'Z';}return _0x1271d0;});_0x41cf76[_0x3071('0xd')](express[_0x3071('0x18')](_0x41cf76[_0x3071('0xa')](_0x3071('0x12'))));_0x41cf76[_0x3071('0x11')]('views',config[_0x3071('0xf')]+_0x3071('0x19'));_0x41cf76[_0x3071('0x1a')](_0x3071('0x1b'),require(_0x3071('0x1c'))[_0x3071('0x1d')]);_0x41cf76[_0x3071('0x11')](_0x3071('0x1e'),'html');_0x41cf76[_0x3071('0xd')](bodyParser[_0x3071('0x1f')]({'limit':_0x3071('0x20'),'extended':!![]}));_0x41cf76['use'](bodyParser[_0x3071('0x21')]({'limit':'50mb'}));_0x41cf76[_0x3071('0xd')](cors());_0x41cf76[_0x3071('0xd')](methodOverride());_0x41cf76[_0x3071('0xd')](cookieParser());_0x41cf76[_0x3071('0xd')](passport[_0x3071('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 25cb6a5..718676c 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 _0x1f4f=['join','createHash','md5','digest','hex','platform','win32','utf8','replace','hostname','macAddress','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','keys','length','filter','family','IPv4','concat','mac','00:00:00:00:00:00','address','127.0.0.1','orderBy'];(function(_0xa70b8c,_0x190048){var _0x1c6338=function(_0x16b096){while(--_0x16b096){_0xa70b8c['push'](_0xa70b8c['shift']());}};_0x1c6338(++_0x190048);}(_0x1f4f,0x6b));var _0xf1f4=function(_0x151faa,_0x4689d9){_0x151faa=_0x151faa-0x0;var _0x28aa8a=_0x1f4f[_0x151faa];return _0x28aa8a;};'use strict';var _=require(_0xf1f4('0x0'));var os=require('os');var crypto=require(_0xf1f4('0x1'));var machine=require(_0xf1f4('0x2'));var exec=require(_0xf1f4('0x3'))[_0xf1f4('0x4')];function getInterfaces(){var _0x5833a9=[];var _0x2ebb89=os[_0xf1f4('0x5')]();var _0x3522c0=_['orderBy'](_[_0xf1f4('0x6')](_0x2ebb89));for(var _0x17aaae=0x0;_0x17aaae<_0x3522c0[_0xf1f4('0x7')];_0x17aaae++){var _0x1b8fd8=_0x2ebb89[_0x3522c0[_0x17aaae]][_0xf1f4('0x8')](function(_0x21b21d){return _0x21b21d[_0xf1f4('0x9')]===_0xf1f4('0xa')&&_0x21b21d['internal']===![];});_0x5833a9=_0x5833a9[_0xf1f4('0xb')](_0x1b8fd8);}return _0x5833a9;}function getFirstInterface(){var _0x121e8a=_['head'](getInterfaces());return{'macAddress':_0x121e8a&&_0x121e8a[_0xf1f4('0xc')]?_0x121e8a[_0xf1f4('0xc')]:_0xf1f4('0xd'),'ipAddress':_0x121e8a&&_0x121e8a['address']?_0x121e8a[_0xf1f4('0xe')]:_0xf1f4('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xe7c98c=_[_0xf1f4('0x10')](os['cpus']()['map'](function(_0x9423f4){return _0x9423f4['model'];}))[_0xf1f4('0x11')](':');return crypto[_0xf1f4('0x12')](_0xf1f4('0x13'))['update'](_0xe7c98c)[_0xf1f4('0x14')](_0xf1f4('0x15'));}exports['getUuid']=function(){switch(os[_0xf1f4('0x16')]()){case _0xf1f4('0x17'):return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xf1f4('0x18')})[_0xf1f4('0x19')]('\x0d\x0a','');default:var _0x5e93a0=getFirstInterface();var _0x28842e=getCPUhash();var _0x220957=_0x28842e+'|'+os[_0xf1f4('0x1a')]()+'|'+_0x5e93a0[_0xf1f4('0x1b')]+'|'+_0x5e93a0[_0xf1f4('0x1c')];var _0x3deaee=crypto[_0xf1f4('0x12')](_0xf1f4('0x13'))[_0xf1f4('0x1d')](_0x220957)[_0xf1f4('0x14')]('hex');return _0x3deaee[_0xf1f4('0x1e')](0x0,0x8)+'-'+_0x3deaee[_0xf1f4('0x1e')](0x8,0xc)+'-'+_0x3deaee['substring'](0xc,0x10)+'-'+_0x3deaee['substring'](0x10,0x14)+'-'+_0x3deaee[_0xf1f4('0x1e')](0x14);}}; \ No newline at end of file +var _0x7ec6=['networkInterfaces','orderBy','keys','length','family','internal','head','mac','address','127.0.0.1','getFirstInterface','map','model','createHash','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','md5','substring','lodash','bimedia-machine-uuid','child_process','execSync'];(function(_0x44c3ca,_0xe00dfb){var _0x5ed281=function(_0x158b18){while(--_0x158b18){_0x44c3ca['push'](_0x44c3ca['shift']());}};_0x5ed281(++_0xe00dfb);}(_0x7ec6,0x132));var _0x67ec=function(_0x41db07,_0x57027e){_0x41db07=_0x41db07-0x0;var _0x4949c4=_0x7ec6[_0x41db07];return _0x4949c4;};'use strict';var _=require(_0x67ec('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x67ec('0x1'));var exec=require(_0x67ec('0x2'))[_0x67ec('0x3')];function getInterfaces(){var _0x3946ef=[];var _0x4e7b05=os[_0x67ec('0x4')]();var _0x292737=_[_0x67ec('0x5')](_[_0x67ec('0x6')](_0x4e7b05));for(var _0x4bb2b0=0x0;_0x4bb2b0<_0x292737[_0x67ec('0x7')];_0x4bb2b0++){var _0x32f2dc=_0x4e7b05[_0x292737[_0x4bb2b0]]['filter'](function(_0x5f261e){return _0x5f261e[_0x67ec('0x8')]==='IPv4'&&_0x5f261e[_0x67ec('0x9')]===![];});_0x3946ef=_0x3946ef['concat'](_0x32f2dc);}return _0x3946ef;}function getFirstInterface(){var _0x2d7fa8=_[_0x67ec('0xa')](getInterfaces());return{'macAddress':_0x2d7fa8&&_0x2d7fa8['mac']?_0x2d7fa8[_0x67ec('0xb')]:'00:00:00:00:00:00','ipAddress':_0x2d7fa8&&_0x2d7fa8[_0x67ec('0xc')]?_0x2d7fa8[_0x67ec('0xc')]:_0x67ec('0xd')};}exports[_0x67ec('0xe')]=getFirstInterface;function getCPUhash(){var _0x1ae4d2=_[_0x67ec('0x5')](os['cpus']()[_0x67ec('0xf')](function(_0x491a7d){return _0x491a7d[_0x67ec('0x10')];}))['join'](':');return crypto[_0x67ec('0x11')]('md5')[_0x67ec('0x12')](_0x1ae4d2)[_0x67ec('0x13')](_0x67ec('0x14'));}exports[_0x67ec('0x15')]=function(){switch(os[_0x67ec('0x16')]()){case _0x67ec('0x17'):return exec(_0x67ec('0x18'),{'encoding':_0x67ec('0x19')})[_0x67ec('0x1a')]('\x0d\x0a','');default:var _0x417f64=getFirstInterface();var _0x4006e6=getCPUhash();var _0x15efc5=_0x4006e6+'|'+os[_0x67ec('0x1b')]()+'|'+_0x417f64[_0x67ec('0x1c')]+'|'+_0x417f64['ipAddress'];var _0x3d7543=crypto[_0x67ec('0x11')](_0x67ec('0x1d'))[_0x67ec('0x12')](_0x15efc5)[_0x67ec('0x13')](_0x67ec('0x14'));return _0x3d7543[_0x67ec('0x1e')](0x0,0x8)+'-'+_0x3d7543[_0x67ec('0x1e')](0x8,0xc)+'-'+_0x3d7543[_0x67ec('0x1e')](0xc,0x10)+'-'+_0x3d7543[_0x67ec('0x1e')](0x10,0x14)+'-'+_0x3d7543[_0x67ec('0x1e')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 69c6294..0d88743 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 _0x865a=['../environment','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','then','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','createDecipher','||FIELD||VALUE||\x0a','User','findOne','admin','email','|reason|','|uuid|','|name|','getFirstInterface','ipAddress','MOTLICENSE','Alert','fullname','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','catch','error','message','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','pkginfo','version'];(function(_0x3382f4,_0x32b70b){var _0x3a3368=function(_0x1bdc71){while(--_0x1bdc71){_0x3382f4['push'](_0x3382f4['shift']());}};_0x3a3368(++_0x32b70b);}(_0x865a,0x1db));var _0xa865=function(_0x1596ee,_0x55180a){_0x1596ee=_0x1596ee-0x0;var _0x3477d7=_0x865a[_0x1596ee];return _0x3477d7;};'use strict';var util=require(_0xa865('0x0'));var crypto=require('crypto');var moment=require(_0xa865('0x1'));var rp=require(_0xa865('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xa865('0x3'))(module,_0xa865('0x4'));var db=require('../../mysqldb')['db'];var config=require(_0xa865('0x5'));var hardware=require(_0xa865('0x6'));var logger=require(_0xa865('0x7'))(_0xa865('0x8'));var jira=require(_0xa865('0x9'));var HOST=_0xa865('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x3cb949){return new BPromise(function(_0x582134,_0x2569ce){var _0x3c099d=util[_0xa865('0xb')](_0xa865('0xc'),HOST,_0x3cb949,module['exports'][_0xa865('0x4')]);if(oldToken){_0x3c099d=util[_0xa865('0xb')](_0xa865('0xd'),HOST,_0x3cb949,module[_0xa865('0xe')][_0xa865('0x4')],oldToken);}var _0x47f5d4={'uri':_0x3c099d,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x47f5d4)[_0xa865('0xf')](function(_0x9e3d76){_0x582134(_0x9e3d76);})['catch'](function(_0x4721db){_0x2569ce(_0x4721db);});});}function encryptDate(_0x738566){var _0xfeed59=crypto[_0xa865('0x10')](_0xa865('0x11'),config[_0xa865('0x12')][_0xa865('0x13')]);var _0x171e2e=_0xfeed59[_0xa865('0x14')](_0x738566,_0xa865('0x15'),_0xa865('0x16'));_0x171e2e+=_0xfeed59[_0xa865('0x17')](_0xa865('0x16'));return _0x171e2e;}function decryptDate(_0x5af16b){var _0x417fe4=crypto[_0xa865('0x18')](_0xa865('0x11'),config[_0xa865('0x12')][_0xa865('0x13')]);var _0x559508=_0x417fe4[_0xa865('0x14')](_0x5af16b,'base64',_0xa865('0x15'));_0x559508+=_0x417fe4[_0xa865('0x17')](_0xa865('0x15'));return _0x559508;}function sendJiraAlert(_0x44ce2b,_0x24f511,_0x192157){var _0x54cb9c=_0xa865('0x19');return db[_0xa865('0x1a')][_0xa865('0x1b')]({'where':{'role':_0xa865('0x1c')},'attributes':['fullname',_0xa865('0x1d')],'raw':!![]})[_0xa865('0xf')](function(_0x357925){ADMIN=_0x357925;_0x54cb9c+=_0xa865('0x1e')+_0x192157+'|\x0a';_0x54cb9c+=_0xa865('0x1f')+_0x44ce2b+'|\x0a';_0x54cb9c+='|machineUuid|'+_0x24f511+'|\x0a';_0x54cb9c+=_0xa865('0x20')+ADMIN['fullname']+'|\x0a';_0x54cb9c+='|email|'+ADMIN[_0xa865('0x1d')]+'|\x0a';return _0x54cb9c;})[_0xa865('0xf')](function(_0x3607a1){var _0x362416=hardware[_0xa865('0x21')]()[_0xa865('0x22')];return jira['openIssue']({'key':_0xa865('0x23'),'summary':'Motion\x20License\x20Alert','description':_0x3607a1,'issuetype':_0xa865('0x24'),'oldToken':_0x44ce2b,'newToken':_0x24f511,'email':ADMIN[_0xa865('0x1d')],'name':ADMIN[_0xa865('0x25')],'reason':GRAY_PERIOD_REASON,'ip':_0x362416});});}function manageLicense(_0x344fc3,_0xe5f2d0){var _0x9b328e=_0xe5f2d0['get']({'plain':!![]});httpRequest(_0x344fc3)[_0xa865('0xf')](function(_0x3ea7ce){if(oldToken){oldToken=undefined;}if(_0x3ea7ce['active']){if(!_0x9b328e['license']&&_0x9b328e[_0xa865('0x8')]!=_0x3ea7ce[_0xa865('0x8')]||_0x9b328e['license']&&_0x9b328e[_0xa865('0x26')]){logger[_0xa865('0x27')](_0xa865('0x28'));}if(_0x9b328e['license']&&!_0x9b328e['data2']&&_0x9b328e[_0xa865('0x8')]!=_0x3ea7ce['license']){logger['info'](_0xa865('0x29'));}if(_0x9b328e['license']&&!_0x9b328e[_0xa865('0x26')]&&_0x9b328e['license']==_0x3ea7ce[_0xa865('0x8')]){return _0xe5f2d0;}return _0xe5f2d0[_0xa865('0x14')]({'data1':_0x344fc3,'data2':null,'license':_0x3ea7ce[_0xa865('0x8')]});}else{if(_0x3ea7ce[_0xa865('0x8')]||_0x9b328e[_0xa865('0x8')]){if(!_0x9b328e[_0xa865('0x26')]){if(_0x9b328e['data1']==_0x344fc3){GRAY_PERIOD_REASON=_0xa865('0x2a');logger[_0xa865('0x27')](_0xa865('0x2b'));}else{GRAY_PERIOD_REASON=_0xa865('0x2c');oldToken=_0x9b328e[_0xa865('0x2d')];logger['info'](_0xa865('0x2e'),_0x9b328e[_0xa865('0x2d')],_0x344fc3);}sendJiraAlert(_0x9b328e['data1'],_0x3ea7ce['uuid'],GRAY_PERIOD_REASON);logger[_0xa865('0x27')](_0xa865('0x2f'),GRAY_PERIOD_REASON[_0xa865('0x30')](),moment()['format'](_0xa865('0x31')));return _0xe5f2d0[_0xa865('0x14')]({'data2':encryptDate(moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xa865('0x32')](decryptDate(_0x9b328e[_0xa865('0x26')]),'days')>DAYS){logger[_0xa865('0x27')](_0xa865('0x33'),moment()[_0xa865('0xb')](_0xa865('0x31')));return _0xe5f2d0[_0xa865('0x14')]({'data1':_0x344fc3,'data2':null,'license':null});}}}else{if(_0x9b328e[_0xa865('0x2d')]!=_0x344fc3){logger[_0xa865('0x27')](_0xa865('0x2e'),_0x9b328e[_0xa865('0x2d')],_0x344fc3);return _0xe5f2d0[_0xa865('0x14')]({'data1':_0x344fc3,'data2':null,'license':null});}}}return _0xe5f2d0;})[_0xa865('0xf')](function(_0x4cdc87){_0xe5f2d0=_0x4cdc87;})[_0xa865('0x34')](function(_0x3c0ef9){logger[_0xa865('0x35')](_0x3c0ef9[_0xa865('0x36')]);})[_0xa865('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0xa865('0x38')](),_0xe5f2d0);},TIME);});}function defaultLicense(){var _0x2450ba=hardware[_0xa865('0x38')]();if(_0x2450ba){return db['License'][_0xa865('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x2450ba}})[_0xa865('0x3a')](function(_0x1d45db,_0x452614){logger[_0xa865('0x27')](_0xa865('0x3b'),_0x2450ba);manageLicense(_0x2450ba,_0x1d45db);})[_0xa865('0x34')](function(_0x2528fb){logger[_0xa865('0x35')](_0x2528fb[_0xa865('0x36')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0xa1e1=['ipAddress','openIssue','Motion\x20License\x20Alert','Alert','get','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','diff','days','error','message','getUuid','spread','default','crypto','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','./hardware','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','session','update','utf8','base64','final','createDecipher','secrets','||FIELD||VALUE||\x0a','User','admin','fullname','email','|reason|','|uuid|','|name|','|email|','getFirstInterface'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xa1e1,0x180));var _0x1a1e=function(_0x1325cf,_0x1ad5c8){_0x1325cf=_0x1325cf-0x0;var _0xee4d0=_0xa1e1[_0x1325cf];return _0xee4d0;};'use strict';var util=require('util');var crypto=require(_0x1a1e('0x0'));var moment=require(_0x1a1e('0x1'));var rp=require(_0x1a1e('0x2'));var BPromise=require(_0x1a1e('0x3'));var pkginfo=require(_0x1a1e('0x4'))(module,_0x1a1e('0x5'));var db=require(_0x1a1e('0x6'))['db'];var config=require('../environment');var hardware=require(_0x1a1e('0x7'));var logger=require('../logger')(_0x1a1e('0x8'));var jira=require(_0x1a1e('0x9'));var HOST=_0x1a1e('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xa607b5){return new BPromise(function(_0x52be4e,_0x20388d){var _0x55775d=util[_0x1a1e('0xb')](_0x1a1e('0xc'),HOST,_0xa607b5,module[_0x1a1e('0xd')][_0x1a1e('0x5')]);if(oldToken){_0x55775d=util['format'](_0x1a1e('0xe'),HOST,_0xa607b5,module['exports'][_0x1a1e('0x5')],oldToken);}var _0x3004c0={'uri':_0x55775d,'method':_0x1a1e('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x3004c0)[_0x1a1e('0x10')](function(_0x475f13){_0x52be4e(_0x475f13);})[_0x1a1e('0x11')](function(_0x47b6e2){_0x20388d(_0x47b6e2);});});}function encryptDate(_0x539d7d){var _0x2ca4e5=crypto[_0x1a1e('0x12')]('aes-256-ctr',config['secrets'][_0x1a1e('0x13')]);var _0x5c6576=_0x2ca4e5[_0x1a1e('0x14')](_0x539d7d,_0x1a1e('0x15'),_0x1a1e('0x16'));_0x5c6576+=_0x2ca4e5[_0x1a1e('0x17')]('base64');return _0x5c6576;}function decryptDate(_0x140756){var _0xa16d53=crypto[_0x1a1e('0x18')]('aes-256-ctr',config[_0x1a1e('0x19')][_0x1a1e('0x13')]);var _0x463199=_0xa16d53[_0x1a1e('0x14')](_0x140756,_0x1a1e('0x16'),_0x1a1e('0x15'));_0x463199+=_0xa16d53['final'](_0x1a1e('0x15'));return _0x463199;}function sendJiraAlert(_0x543e5a,_0x2f2728,_0x282118){var _0x1cb048=_0x1a1e('0x1a');return db[_0x1a1e('0x1b')]['findOne']({'where':{'role':_0x1a1e('0x1c')},'attributes':[_0x1a1e('0x1d'),_0x1a1e('0x1e')],'raw':!![]})[_0x1a1e('0x10')](function(_0x5cf90f){ADMIN=_0x5cf90f;_0x1cb048+=_0x1a1e('0x1f')+_0x282118+'|\x0a';_0x1cb048+=_0x1a1e('0x20')+_0x543e5a+'|\x0a';_0x1cb048+='|machineUuid|'+_0x2f2728+'|\x0a';_0x1cb048+=_0x1a1e('0x21')+ADMIN[_0x1a1e('0x1d')]+'|\x0a';_0x1cb048+=_0x1a1e('0x22')+ADMIN[_0x1a1e('0x1e')]+'|\x0a';return _0x1cb048;})[_0x1a1e('0x10')](function(_0x1919ac){var _0x5ded94=hardware[_0x1a1e('0x23')]()[_0x1a1e('0x24')];return jira[_0x1a1e('0x25')]({'key':'MOTLICENSE','summary':_0x1a1e('0x26'),'description':_0x1919ac,'issuetype':_0x1a1e('0x27'),'oldToken':_0x543e5a,'newToken':_0x2f2728,'email':ADMIN[_0x1a1e('0x1e')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x5ded94});});}function manageLicense(_0x469bf7,_0x22abff){var _0x2a4c8d=_0x22abff[_0x1a1e('0x28')]({'plain':!![]});httpRequest(_0x469bf7)[_0x1a1e('0x10')](function(_0x17121d){if(oldToken){oldToken=undefined;}if(_0x17121d[_0x1a1e('0x29')]){if(!_0x2a4c8d[_0x1a1e('0x8')]&&_0x2a4c8d[_0x1a1e('0x8')]!=_0x17121d[_0x1a1e('0x8')]||_0x2a4c8d['license']&&_0x2a4c8d['data2']){logger[_0x1a1e('0x2a')](_0x1a1e('0x2b'));}if(_0x2a4c8d[_0x1a1e('0x8')]&&!_0x2a4c8d[_0x1a1e('0x2c')]&&_0x2a4c8d['license']!=_0x17121d['license']){logger[_0x1a1e('0x2a')](_0x1a1e('0x2d'));}if(_0x2a4c8d[_0x1a1e('0x8')]&&!_0x2a4c8d[_0x1a1e('0x2c')]&&_0x2a4c8d[_0x1a1e('0x8')]==_0x17121d[_0x1a1e('0x8')]){return _0x22abff;}return _0x22abff[_0x1a1e('0x14')]({'data1':_0x469bf7,'data2':null,'license':_0x17121d['license']});}else{if(_0x17121d[_0x1a1e('0x8')]||_0x2a4c8d[_0x1a1e('0x8')]){if(!_0x2a4c8d[_0x1a1e('0x2c')]){if(_0x2a4c8d[_0x1a1e('0x2e')]==_0x469bf7){GRAY_PERIOD_REASON='Disabled';logger['info'](_0x1a1e('0x2f'));}else{GRAY_PERIOD_REASON=_0x1a1e('0x30');oldToken=_0x2a4c8d[_0x1a1e('0x2e')];logger[_0x1a1e('0x2a')](_0x1a1e('0x31'),_0x2a4c8d[_0x1a1e('0x2e')],_0x469bf7);}sendJiraAlert(_0x2a4c8d['data1'],_0x17121d[_0x1a1e('0x32')],GRAY_PERIOD_REASON);logger[_0x1a1e('0x2a')](_0x1a1e('0x33'),GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x1a1e('0xb')](_0x1a1e('0x34')));return _0x22abff['update']({'data2':encryptDate(moment()[_0x1a1e('0xb')](_0x1a1e('0x34')))});}else{if(moment()[_0x1a1e('0x35')](decryptDate(_0x2a4c8d['data2']),_0x1a1e('0x36'))>DAYS){logger[_0x1a1e('0x2a')]('DEMO\x20START\x20AT\x20%s',moment()[_0x1a1e('0xb')]('YYYY-MM-DD\x20HH:mm'));return _0x22abff[_0x1a1e('0x14')]({'data1':_0x469bf7,'data2':null,'license':null});}}}else{if(_0x2a4c8d['data1']!=_0x469bf7){logger[_0x1a1e('0x2a')](_0x1a1e('0x31'),_0x2a4c8d[_0x1a1e('0x2e')],_0x469bf7);return _0x22abff[_0x1a1e('0x14')]({'data1':_0x469bf7,'data2':null,'license':null});}}}return _0x22abff;})[_0x1a1e('0x10')](function(_0x18a998){_0x22abff=_0x18a998;})[_0x1a1e('0x11')](function(_0x5a0343){logger[_0x1a1e('0x37')](_0x5a0343[_0x1a1e('0x38')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x1a1e('0x39')](),_0x22abff);},TIME);});}function defaultLicense(){var _0x278b61=hardware[_0x1a1e('0x39')]();if(_0x278b61){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x278b61}})[_0x1a1e('0x3a')](function(_0x25d20b,_0x4089d5){logger[_0x1a1e('0x2a')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x278b61);manageLicense(_0x278b61,_0x25d20b);})[_0x1a1e('0x11')](function(_0x427be6){logger[_0x1a1e('0x37')](_0x427be6[_0x1a1e('0x38')]);});}}exports[_0x1a1e('0x3b')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index dcd0c5a..d3f4ac0 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 _0x652e=['parse','demo','getUuid','secrets','gray','add','days','grayReason','uuid','machineUuid','changed','disabled','Breaking\x20license','message','2027-01-01T00:00:00.000Z','Demo\x20license','License','find','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','utf8','final'];(function(_0x3eaf01,_0x4c3133){var _0x1e299f=function(_0x44d584){while(--_0x44d584){_0x3eaf01['push'](_0x3eaf01['shift']());}};_0x1e299f(++_0x4c3133);}(_0x652e,0x19b));var _0xe652=function(_0x3a2e15,_0x2c22da){_0x3a2e15=_0x3a2e15-0x0;var _0x5a18ac=_0x652e[_0x3a2e15];return _0x5a18ac;};'use strict';var crypto=require(_0xe652('0x0'));var util=require(_0xe652('0x1'));var _=require(_0xe652('0x2'));var moment=require(_0xe652('0x3'));var hardware=require(_0xe652('0x4'));var config=require('../environment');var db=require(_0xe652('0x5'))['db'];function checkLicense(_0x5dc257,_0x52f018){if(_0x5dc257){try{var _0x6c21c5=_0x52f018||_0x5dc257[_0xe652('0x6')];if(_[_0xe652('0x7')](_0x6c21c5)){throw new Error(_0xe652('0x8'));}var _0x1ed1cf=_0x5dc257[_0xe652('0x9')];var _0x2dfc30=_0x5dc257[_0xe652('0xa')];var _0x32ffbd=_0x1ed1cf['split']('-')[0x4];var _0x24b372=_0x1ed1cf[_0xe652('0xb')]('-')[0x0];var _0x1cbf0a=crypto[_0xe652('0xc')](_0xe652('0xd'),util['format'](_0xe652('0xe'),_0x32ffbd,_0x1ed1cf,_0x24b372));var _0x5e8b3a=_0x1cbf0a['update'](_0x6c21c5,_0xe652('0xf'),_0xe652('0x10'));_0x5e8b3a+=_0x1cbf0a[_0xe652('0x11')]('utf8');var _0x540a34=JSON[_0xe652('0x12')](_0x5e8b3a);_0x540a34[_0xe652('0x13')]=![];_0x540a34['uuid']=_0x1ed1cf;_0x540a34['machineUuid']=hardware[_0xe652('0x14')]();if(_0x2dfc30){var _0x219440=crypto['createDecipher'](_0xe652('0xd'),config[_0xe652('0x15')]['session']);var _0x4fdfcd=_0x219440['update'](_0x2dfc30,_0xe652('0xf'),'utf8');_0x4fdfcd+=_0x219440['final'](_0xe652('0x10'));_0x540a34[_0xe652('0x16')]=_0x4fdfcd;_0x540a34['deadline']=moment(_0x4fdfcd)[_0xe652('0x17')](0x7,_0xe652('0x18'))['format']();_0x540a34[_0xe652('0x19')]=_0x540a34[_0xe652('0x1a')]!=_0x540a34[_0xe652('0x1b')]?_0xe652('0x1c'):_0xe652('0x1d');}return _0x540a34;}catch(_0x381c05){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe652('0x1e'),'uuid':_0x5dc257[_0xe652('0x9')],'machineUuid':hardware['getUuid'](),'message':_0x381c05[_0xe652('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe652('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe652('0x21'),'uuid':_0x5dc257['data1'],'machineUuid':hardware[_0xe652('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x57b542){return db[_0xe652('0x22')][_0xe652('0x23')](_[_0xe652('0x24')](_0x57b542,{'raw':!![],'where':{'id':0x1}}))[_0xe652('0x25')](function(_0x309cf7){return checkLicense(_0x309cf7,null);});};exports[_0xe652('0x26')]=checkLicense; \ No newline at end of file +var _0x4ca1=['secrets','session','gray','deadline','days','grayReason','uuid','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','message','Demo\x20license','find','defaults','then','checkLicense','crypto','util','moment','../../mysqldb','license','isEmpty','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','demo','getUuid'];(function(_0x45dd9d,_0x47e39d){var _0x3835ba=function(_0xbaf440){while(--_0xbaf440){_0x45dd9d['push'](_0x45dd9d['shift']());}};_0x3835ba(++_0x47e39d);}(_0x4ca1,0xca));var _0x14ca=function(_0x45fbc7,_0x2cf50d){_0x45fbc7=_0x45fbc7-0x0;var _0x392cfd=_0x4ca1[_0x45fbc7];return _0x392cfd;};'use strict';var crypto=require(_0x14ca('0x0'));var util=require(_0x14ca('0x1'));var _=require('lodash');var moment=require(_0x14ca('0x2'));var hardware=require('./hardware');var config=require('../environment');var db=require(_0x14ca('0x3'))['db'];function checkLicense(_0x2e603c,_0x5f2188){if(_0x2e603c){try{var _0x50e673=_0x5f2188||_0x2e603c[_0x14ca('0x4')];if(_[_0x14ca('0x5')](_0x50e673)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x552428=_0x2e603c[_0x14ca('0x6')];var _0x39add5=_0x2e603c[_0x14ca('0x7')];var _0x5132f8=_0x552428[_0x14ca('0x8')]('-')[0x4];var _0x361575=_0x552428[_0x14ca('0x8')]('-')[0x0];var _0x425c2a=crypto[_0x14ca('0x9')](_0x14ca('0xa'),util[_0x14ca('0xb')](_0x14ca('0xc'),_0x5132f8,_0x552428,_0x361575));var _0x1227fc=_0x425c2a[_0x14ca('0xd')](_0x50e673,_0x14ca('0xe'),_0x14ca('0xf'));_0x1227fc+=_0x425c2a[_0x14ca('0x10')](_0x14ca('0xf'));var _0x2f0f82=JSON[_0x14ca('0x11')](_0x1227fc);_0x2f0f82[_0x14ca('0x12')]=![];_0x2f0f82['uuid']=_0x552428;_0x2f0f82['machineUuid']=hardware[_0x14ca('0x13')]();if(_0x39add5){var _0x10d03e=crypto[_0x14ca('0x9')](_0x14ca('0xa'),config[_0x14ca('0x14')][_0x14ca('0x15')]);var _0x373db8=_0x10d03e['update'](_0x39add5,_0x14ca('0xe'),_0x14ca('0xf'));_0x373db8+=_0x10d03e[_0x14ca('0x10')](_0x14ca('0xf'));_0x2f0f82[_0x14ca('0x16')]=_0x373db8;_0x2f0f82[_0x14ca('0x17')]=moment(_0x373db8)['add'](0x7,_0x14ca('0x18'))[_0x14ca('0xb')]();_0x2f0f82[_0x14ca('0x19')]=_0x2f0f82[_0x14ca('0x1a')]!=_0x2f0f82[_0x14ca('0x1b')]?_0x14ca('0x1c'):_0x14ca('0x1d');}return _0x2f0f82;}catch(_0x3acb87){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x14ca('0x1e'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x2e603c[_0x14ca('0x6')],'machineUuid':hardware[_0x14ca('0x13')](),'message':_0x3acb87[_0x14ca('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x14ca('0x20'),'uuid':_0x2e603c[_0x14ca('0x6')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x28a4fb){return db['License'][_0x14ca('0x21')](_[_0x14ca('0x22')](_0x28a4fb,{'raw':!![],'where':{'id':0x1}}))[_0x14ca('0x23')](function(_0x41649a){return checkLicense(_0x41649a,null);});};exports[_0x14ca('0x24')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 47a38f0..adf5c73 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 _0x938c=['http://localhost:9000','app-id','exports'];(function(_0x3ad43f,_0xa73120){var _0x2f2e26=function(_0x57f8e3){while(--_0x57f8e3){_0x3ad43f['push'](_0x3ad43f['shift']());}};_0x2f2e26(++_0xa73120);}(_0x938c,0x11f));var _0xc938=function(_0x327a24,_0x5f5d0d){_0x327a24=_0x327a24-0x0;var _0x4385b0=_0x938c[_0x327a24];return _0x4385b0;};'use strict';module[_0xc938('0x0')]={'DOMAIN':_0xc938('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xc938('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x49ac=['http://localhost:9000','myappanuglar-secret','app-id','secret','exports'];(function(_0x5747e9,_0x1da002){var _0x381bf2=function(_0x4cf3d8){while(--_0x4cf3d8){_0x5747e9['push'](_0x5747e9['shift']());}};_0x381bf2(++_0x1da002);}(_0x49ac,0x19e));var _0xc49a=function(_0x207a02,_0x278c56){_0x207a02=_0x207a02-0x0;var _0xd995c3=_0x49ac[_0x207a02];return _0xd995c3;};'use strict';module[_0xc49a('0x0')]={'DOMAIN':_0xc49a('0x1'),'SESSION_SECRET':_0xc49a('0x2'),'GOOGLE_ID':_0xc49a('0x3'),'GOOGLE_SECRET':_0xc49a('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index cc225d4..a5c3605 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc678=['log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','%s-%s','error','transports','info','Console','path','INFO','join','/var'];(function(_0x174d5e,_0x18a9b2){var _0x55f4df=function(_0x525501){while(--_0x525501){_0x174d5e['push'](_0x174d5e['shift']());}};_0x55f4df(++_0x18a9b2);}(_0xc678,0x13c));var _0x8c67=function(_0x35d6c6,_0x3ae8ae){_0x35d6c6=_0x35d6c6-0x0;var _0x50700b=_0xc678[_0x35d6c6];return _0x50700b;};'use strict';var moment=require('moment');var winston=require('winston');var util=require('util');var path=require(_0x8c67('0x0'));var debugLevel=_0x8c67('0x1');function filename(_0x2878b8,_0x34ca15){return path[_0x8c67('0x2')](_0x8c67('0x3'),_0x8c67('0x4'),_0x8c67('0x5'),util[_0x8c67('0x6')](_0x8c67('0x7'),_0x2878b8,_0x34ca15));}function formatter(_0x470fb5,_0x1c03ca){return util[_0x8c67('0x6')](_0x8c67('0x8'),moment()['format'](_0x8c67('0x9')),_0x1c03ca[_0x8c67('0xa')]['toUpperCase'](),_0x470fb5,_0x1c03ca['message']);}module['exports']=function(_0x2b315d){return new winston['Logger']({'transports':[new winston['transports']['File']({'name':util[_0x8c67('0x6')](_0x8c67('0xb'),_0x2b315d,'error'),'filename':filename(_0x2b315d,'error'),'level':_0x8c67('0xc'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x153c4f){return formatter(_0x2b315d,_0x153c4f);}}),new winston[(_0x8c67('0xd'))]['File']({'name':util[_0x8c67('0x6')](_0x8c67('0xb'),_0x2b315d,_0x8c67('0xe')),'filename':filename(_0x2b315d,_0x8c67('0xe')),'level':_0x8c67('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x901e3f){return formatter(_0x2b315d,_0x901e3f);}}),new winston[(_0x8c67('0xd'))][(_0x8c67('0xf'))]({'level':process['env']['debugLevel']||debugLevel,'json':![],'formatter':function(_0x3bfcdb){return formatter(_0x2b315d,_0x3bfcdb);}})]});}; \ No newline at end of file +var _0x35ea=['error','%s-%s','info','env','debugLevel','moment','winston','INFO','join','/var','log','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','message','exports','Logger','transports','File'];(function(_0x2a0607,_0x5137f2){var _0xc365e1=function(_0x1c7a84){while(--_0x1c7a84){_0x2a0607['push'](_0x2a0607['shift']());}};_0xc365e1(++_0x5137f2);}(_0x35ea,0x64));var _0xa35e=function(_0x35d294,_0x3a9b4){_0x35d294=_0x35d294-0x0;var _0xb9ae9a=_0x35ea[_0x35d294];return _0xb9ae9a;};'use strict';var moment=require(_0xa35e('0x0'));var winston=require(_0xa35e('0x1'));var util=require('util');var path=require('path');var debugLevel=_0xa35e('0x2');function filename(_0x2d77e5,_0x204833){return path[_0xa35e('0x3')](_0xa35e('0x4'),_0xa35e('0x5'),'xcally',util[_0xa35e('0x6')](_0xa35e('0x7'),_0x2d77e5,_0x204833));}function formatter(_0x404918,_0x539368){return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xa35e('0x6')](_0xa35e('0x8')),_0x539368['level']['toUpperCase'](),_0x404918,_0x539368[_0xa35e('0x9')]);}module[_0xa35e('0xa')]=function(_0x4f9bb1){return new winston[(_0xa35e('0xb'))]({'transports':[new winston[(_0xa35e('0xc'))][(_0xa35e('0xd'))]({'name':util[_0xa35e('0x6')]('%s-%s',_0x4f9bb1,_0xa35e('0xe')),'filename':filename(_0x4f9bb1,_0xa35e('0xe')),'level':_0xa35e('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4c2e94){return formatter(_0x4f9bb1,_0x4c2e94);}}),new winston[(_0xa35e('0xc'))]['File']({'name':util['format'](_0xa35e('0xf'),_0x4f9bb1,_0xa35e('0x10')),'filename':filename(_0x4f9bb1,_0xa35e('0x10')),'level':_0xa35e('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x44bf11){return formatter(_0x4f9bb1,_0x44bf11);}}),new winston[(_0xa35e('0xc'))]['Console']({'level':process[_0xa35e('0x11')][_0xa35e('0x12')]||debugLevel,'json':![],'formatter':function(_0x4e4ec9){return formatter(_0x4f9bb1,_0x4e4ec9);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index cbd90cb..e87c44e 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 _0xe2f2=['ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x518bec,_0x3ab059){var _0x19e00d=function(_0x241bfe){while(--_0x241bfe){_0x518bec['push'](_0x518bec['shift']());}};_0x19e00d(++_0x3ab059);}(_0xe2f2,0x6c));var _0x2e2f=function(_0x5679ed,_0x23a9bb){_0x5679ed=_0x5679ed-0x0;var _0x23f406=_0xe2f2[_0x5679ed];return _0x23f406;};'use strict';var path=require(_0x2e2f('0x0'));var os=require('os');var config={'apps':[{'name':_0x2e2f('0x1'),'script':path[_0x2e2f('0x2')](__dirname,_0x2e2f('0x3'))},{'name':_0x2e2f('0x4'),'script':path[_0x2e2f('0x2')](__dirname,_0x2e2f('0x5'))},{'name':_0x2e2f('0x6'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x2e2f('0x7'),'script':path[_0x2e2f('0x2')](__dirname,_0x2e2f('0x8'))},{'name':_0x2e2f('0x9'),'script':path[_0x2e2f('0x2')](__dirname,_0x2e2f('0xa'))},{'name':_0x2e2f('0xb'),'script':path['join'](__dirname,_0x2e2f('0xc'))}]};module[_0x2e2f('0xd')]=config; \ No newline at end of file +var _0x7e62=['../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','express','join','../../services/express/index.js','../../services/ami/index.js','agi'];(function(_0x2ecc09,_0x39f700){var _0x384ff7=function(_0x39c9a2){while(--_0x39c9a2){_0x2ecc09['push'](_0x2ecc09['shift']());}};_0x384ff7(++_0x39f700);}(_0x7e62,0x69));var _0x27e6=function(_0x2b31c1,_0x3c88e4){_0x2b31c1=_0x2b31c1-0x0;var _0x3e4824=_0x7e62[_0x2b31c1];return _0x3e4824;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x27e6('0x0'),'script':path[_0x27e6('0x1')](__dirname,_0x27e6('0x2'))},{'name':'ami','script':path[_0x27e6('0x1')](__dirname,_0x27e6('0x3'))},{'name':_0x27e6('0x4'),'script':path[_0x27e6('0x1')](__dirname,_0x27e6('0x5'))},{'name':_0x27e6('0x6'),'script':path['join'](__dirname,_0x27e6('0x7'))},{'name':'routing','script':path['join'](__dirname,_0x27e6('0x8'))},{'name':_0x27e6('0x9'),'script':path['join'](__dirname,_0x27e6('0xa'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index ec4b76d..312f13e 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 _0x55ca=['stop','restart','list','describe','delete','dump','pm2','bluebird','connect','start','then','disconnect'];(function(_0x184150,_0x597759){var _0x30ac5b=function(_0x564c38){while(--_0x564c38){_0x184150['push'](_0x184150['shift']());}};_0x30ac5b(++_0x597759);}(_0x55ca,0x126));var _0xa55c=function(_0x43762c,_0x48ff0f){_0x43762c=_0x43762c-0x0;var _0x4a85e0=_0x55ca[_0x43762c];return _0x4a85e0;};'use strict';var pm2=require(_0xa55c('0x0'));var BPromise=require(_0xa55c('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x5edc58,_0x49875a){return pm2[_0xa55c('0x2')](function(_0x267ea0){if(_0x267ea0){return _0x49875a(_0x267ea0);}return _0x5edc58('connected');});});};exports[_0xa55c('0x3')]=function(_0x2db02a){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x204951,_0x3c97c8){return pm2[_0xa55c('0x3')](_0x2db02a,function(_0x36b623,_0x4d0624){if(_0x36b623){return _0x3c97c8(_0x36b623);}pm2[_0xa55c('0x5')]();return _0x204951(_0x4d0624);});});});};exports[_0xa55c('0x6')]=function(_0x57e069){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x290d28,_0x52a3bc){return pm2['stop'](_0x57e069,function(_0x473d0e,_0x20c76a){if(_0x473d0e){return _0x52a3bc(_0x473d0e);}pm2[_0xa55c('0x5')]();return _0x290d28(_0x20c76a);});});});};exports[_0xa55c('0x7')]=function(_0x31646d){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x508342,_0x70c2de){return pm2[_0xa55c('0x7')](_0x31646d,function(_0x15eec8,_0x5d47ff){if(_0x15eec8){return _0x70c2de(_0x15eec8);}pm2['disconnect']();return _0x508342(_0x5d47ff);});});});};exports[_0xa55c('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5a3672,_0x59ea8d){return pm2[_0xa55c('0x8')](function(_0x3930e4,_0x462cd6){if(_0x3930e4){return _0x59ea8d(_0x3930e4);}pm2[_0xa55c('0x5')]();return _0x5a3672(_0x462cd6);});});});};exports[_0xa55c('0x9')]=function(_0x247e77){return connect()['then'](function(){return new BPromise(function(_0x3ccf65,_0x3dcf4f){return pm2[_0xa55c('0x9')](_0x247e77,function(_0x31e10d,_0x1c4cfd){if(_0x31e10d){return _0x3dcf4f(_0x31e10d);}pm2[_0xa55c('0x5')]();return _0x3ccf65(_0x1c4cfd);});});});};exports[_0xa55c('0xa')]=function(_0x2d09d8){return connect()[_0xa55c('0x4')](function(){return new BPromise(function(_0x4cee3c,_0x3d4c9e){return pm2[_0xa55c('0xa')](_0x2d09d8,function(_0x461284,_0x358b61){if(_0x461284){return _0x3d4c9e(_0x461284);}pm2[_0xa55c('0x5')]();return _0x4cee3c(_0x358b61);});});});};exports[_0xa55c('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5f5158,_0xd643cc){return pm2[_0xa55c('0xb')](function(_0xade4c4){if(_0xade4c4){return _0xd643cc(_0xade4c4);}return _0x5f5158('saved');});});});}; \ No newline at end of file +var _0x9957=['stop','disconnect','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var pm2=require(_0x7995('0x0'));var BPromise=require(_0x7995('0x1'));var config=require(_0x7995('0x2'));function connect(){return new BPromise(function(_0x10a05d,_0x5b96eb){return pm2[_0x7995('0x3')](function(_0x3c58eb){if(_0x3c58eb){return _0x5b96eb(_0x3c58eb);}return _0x10a05d(_0x7995('0x4'));});});};exports[_0x7995('0x5')]=function(_0x576d89){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1a36d8,_0x137b6b){return pm2[_0x7995('0x5')](_0x576d89,function(_0xbda126,_0x326741){if(_0xbda126){return _0x137b6b(_0xbda126);}pm2['disconnect']();return _0x1a36d8(_0x326741);});});});};exports[_0x7995('0x7')]=function(_0x1cad37){return connect()['then'](function(){return new BPromise(function(_0xa2e5f0,_0x3116fb){return pm2[_0x7995('0x7')](_0x1cad37,function(_0x35b5fe,_0x3c1d19){if(_0x35b5fe){return _0x3116fb(_0x35b5fe);}pm2[_0x7995('0x8')]();return _0xa2e5f0(_0x3c1d19);});});});};exports[_0x7995('0x9')]=function(_0x524f7b){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x41c652,_0x581f22){return pm2[_0x7995('0x9')](_0x524f7b,function(_0x2cb37a,_0x19a27e){if(_0x2cb37a){return _0x581f22(_0x2cb37a);}pm2[_0x7995('0x8')]();return _0x41c652(_0x19a27e);});});});};exports[_0x7995('0xa')]=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2bbe7a,_0x4cc004){return pm2['list'](function(_0x2b4e94,_0x2233dd){if(_0x2b4e94){return _0x4cc004(_0x2b4e94);}pm2[_0x7995('0x8')]();return _0x2bbe7a(_0x2233dd);});});});};exports[_0x7995('0xb')]=function(_0x3f1d3e){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x2202ce,_0x41cbf0){return pm2['describe'](_0x3f1d3e,function(_0x2eeacc,_0x565d97){if(_0x2eeacc){return _0x41cbf0(_0x2eeacc);}pm2[_0x7995('0x8')]();return _0x2202ce(_0x565d97);});});});};exports[_0x7995('0xc')]=function(_0x43d4b8){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x1e1415,_0x37a7d4){return pm2['delete'](_0x43d4b8,function(_0x54c9ae,_0x2536c8){if(_0x54c9ae){return _0x37a7d4(_0x54c9ae);}pm2['disconnect']();return _0x1e1415(_0x2536c8);});});});};exports['dump']=function(){return connect()[_0x7995('0x6')](function(){return new BPromise(function(_0x3d463e,_0x4cbe10){return pm2[_0x7995('0xd')](function(_0x51f276){if(_0x51f276){return _0x4cbe10(_0x51f276);}return _0x3d463e('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7caa7ba..c1bd5cd 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 _0xfb00=['error','start','lodash','ioredis','../../mysqldb','../../config/environment','redis','defaults','socket.io-emitter','Setting','chatTimeout','ChatInteraction','lastMsgAt','subtract','then','update','YYYY-MM-DD\x20HH:mm:ss','map','length','chatInteraction:update','catch'];(function(_0x39cf70,_0x3ec55b){var _0x580424=function(_0x580a4e){while(--_0x580a4e){_0x39cf70['push'](_0x39cf70['shift']());}};_0x580424(++_0x3ec55b);}(_0xfb00,0x167));var _0x0fb0=function(_0x51521a,_0x1d4cab){_0x51521a=_0x51521a-0x0;var _0x4cd4ef=_0xfb00[_0x51521a];return _0x4cd4ef;};'use strict';var _=require(_0x0fb0('0x0'));var moment=require('moment');var Redis=require(_0x0fb0('0x1'));var db=require(_0x0fb0('0x2'))['db'];var config=require(_0x0fb0('0x3'));config[_0x0fb0('0x4')]=_[_0x0fb0('0x5')](config[_0x0fb0('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x0fb0('0x6'))(new Redis(config[_0x0fb0('0x4')]));function closeInteractions(){var _0x54906a=0x0;var _0x36b595=[];return db[_0x0fb0('0x7')]['find']({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x4ebadb){_0x54906a=_0x4ebadb[_0x0fb0('0x8')];if(_0x54906a){return db[_0x0fb0('0x9')]['findAll']({'raw':!![],'attributes':['id',_0x0fb0('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x0fb0('0xb')](_0x4ebadb['chatTimeout'],'minutes')}}});}else{return[];}})[_0x0fb0('0xc')](function(_0x32bcc0){_0x36b595=_0x32bcc0;if(_0x54906a){return db[_0x0fb0('0x9')][_0x0fb0('0xd')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x0fb0('0xe'))},{'where':{'id':_[_0x0fb0('0xf')](_0x36b595||[],'id')}});}})[_0x0fb0('0xc')](function(_0x1dc6ca){for(var _0x3a90a0=0x0;_0x3a90a0<_0x36b595[_0x0fb0('0x10')];_0x3a90a0++){io['emit'](_0x0fb0('0x11'),{'id':_0x36b595[_0x3a90a0]['id'],'closed':!![]});}})[_0x0fb0('0x12')](function(_0x152bd8){console[_0x0fb0('0x13')](_0x152bd8);});}exports[_0x0fb0('0x14')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x31af=['redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','chatInteraction:update','catch','error','start','lodash','../../mysqldb','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x31af,0x7f));var _0xf31a=function(_0x6b9481,_0x5061ec){_0x6b9481=_0x6b9481-0x0;var _0x5e161f=_0x31af[_0x6b9481];return _0x5e161f;};'use strict';var _=require(_0xf31a('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require(_0xf31a('0x1'))['db'];var config=require(_0xf31a('0x2'));config[_0xf31a('0x3')]=_['defaults'](config[_0xf31a('0x3')],{'host':_0xf31a('0x4'),'port':0x18eb});var io=require(_0xf31a('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x17530b=0x0;var _0x5b56de=[];return db[_0xf31a('0x6')][_0xf31a('0x7')]({'raw':!![],'attributes':['id',_0xf31a('0x8')],'where':{'id':0x1}})[_0xf31a('0x9')](function(_0x5c5e4d){_0x17530b=_0x5c5e4d[_0xf31a('0x8')];if(_0x17530b){return db[_0xf31a('0xa')][_0xf31a('0xb')]({'raw':!![],'attributes':['id',_0xf31a('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xf31a('0xd')](_0x5c5e4d['chatTimeout'],'minutes')}}});}else{return[];}})[_0xf31a('0x9')](function(_0x31347b){_0x5b56de=_0x31347b;if(_0x17530b){return db['ChatInteraction'][_0xf31a('0xe')]({'closeReason':_0xf31a('0xf'),'disposition':_0xf31a('0x10'),'closed':!![],'closedAt':moment()[_0xf31a('0x11')](_0xf31a('0x12'))},{'where':{'id':_[_0xf31a('0x13')](_0x5b56de||[],'id')}});}})[_0xf31a('0x9')](function(_0x3061aa){for(var _0x26808c=0x0;_0x26808c<_0x5b56de[_0xf31a('0x14')];_0x26808c++){io[_0xf31a('0x15')](_0xf31a('0x16'),{'id':_0x5b56de[_0x26808c]['id'],'closed':!![]});}})[_0xf31a('0x17')](function(_0x2b497e){console[_0xf31a('0x18')](_0x2b497e);});}exports[_0xf31a('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 2edc900..e9129f9 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 _0x0018=['Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','secure','authentication','user','pass','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','%s.%s','extname','join','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','toString','difference','intersection','length','exists','stop','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','update\x20cron','deleteJob','run','path','lodash','cron-job-manager','jayson/promise','bluebird','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info'];(function(_0xf18c45,_0x47f8b8){var _0x132831=function(_0x2f5963){while(--_0x2f5963){_0xf18c45['push'](_0xf18c45['shift']());}};_0x132831(++_0x47f8b8);}(_0x0018,0xa6));var _0x8001=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0018[_0x17d9e3];return _0x14192d;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x8001('0x0'));var _=require(_0x8001('0x1'));var moment=require('moment');var CronJobManager=require(_0x8001('0x2'));var jayson=require(_0x8001('0x3'));var BPromise=require(_0x8001('0x4'));var logger=require('../logger')('schedule');var db=require(_0x8001('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x8001('0x6'));var client=jayson[_0x8001('0x7')][_0x8001('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2ddbf5,_0x2af1c0){return function(){logger[_0x8001('0x9')](_0x8001('0xa'),_0x2ddbf5[_0x8001('0xb')]);var _0x1bdeee=!![];var _0x4bb468={'tls':{'rejectUnauthorized':![]}};if(_0x2ddbf5[_0x8001('0xc')]['Smtp'][_0x8001('0xd')]){_0x4bb468[_0x8001('0xd')]=_0x2ddbf5[_0x8001('0xc')]['Smtp'][_0x8001('0xd')];}else{_0x4bb468[_0x8001('0xe')]=_0x2ddbf5[_0x8001('0xc')]['Smtp'][_0x8001('0xe')];_0x4bb468['port']=_0x2ddbf5['MailAccount'][_0x8001('0xf')]['port'];_0x4bb468['secure']=_0x2ddbf5[_0x8001('0xc')][_0x8001('0xf')][_0x8001('0x10')];}if(_0x2ddbf5[_0x8001('0xc')]['Smtp'][_0x8001('0x11')]){_0x4bb468['auth']={'user':_0x2ddbf5[_0x8001('0xc')][_0x8001('0xf')][_0x8001('0x12')],'pass':_0x2ddbf5[_0x8001('0xc')][_0x8001('0xf')][_0x8001('0x13')]};}var _0x1f1b4d={'account':_0x4bb468,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2ddbf5[_0x8001('0xc')][_0x8001('0x14')],_0x2ddbf5[_0x8001('0xc')]['email']||_0x2ddbf5[_0x8001('0xc')][_0x8001('0xf')][_0x8001('0x12')]),'to':_0x2ddbf5[_0x8001('0xb')],'cc':_0x2ddbf5['cc'],'bcc':_0x2ddbf5[_0x8001('0x15')],'subject':util[_0x8001('0x16')](_0x8001('0x17'),_0x2af1c0['name'],_0x2ddbf5['subtractNumber'],_0x2ddbf5[_0x8001('0x18')])}};var _0x54173a=path['join'](__dirname,_0x8001('0x19'));var _0x396e51=_0x2af1c0['savename'];var _0x26c795=util[_0x8001('0x16')](_0x8001('0x1a'),path['basename'](_0x2af1c0['savename'],path[_0x8001('0x1b')](_0x2af1c0['savename'])),'zip');var _0x490c55=path['join'](_0x54173a,_0x396e51);var _0x5b96dc=path[_0x8001('0x1c')](_0x54173a,_0x26c795);if(fs[_0x8001('0x1d')](_0x490c55)){_0x2af1c0['status']=_0x8001('0x1e');_0x1f1b4d[_0x8001('0x1f')][_0x8001('0x20')]=[{'filename':_0x396e51,'path':_0x490c55}];_0x1f1b4d['message'][_0x8001('0x21')]=util[_0x8001('0x16')](_0x8001('0x22'),JSON[_0x8001('0x23')](_0x2af1c0,null,0x2));}else if(fs['existsSync'](_0x5b96dc)){_0x2af1c0['status']=_0x8001('0x1e');_0x1f1b4d[_0x8001('0x1f')]['attachments']=[{'filename':_0x26c795,'path':_0x5b96dc}];}else{_0x1f1b4d[_0x8001('0x1f')][_0x8001('0x21')]=_0x8001('0x24');if(!_0x2ddbf5[_0x8001('0x25')]){_0x1bdeee=![];logger[_0x8001('0x9')](_0x8001('0x26'));}}if(_0x1bdeee){return client[_0x8001('0x27')](_0x8001('0x28'),_0x1f1b4d)[_0x8001('0x29')](function(_0xe00472){if(_0xe00472[_0x8001('0x2a')]){return logger[_0x8001('0x2a')](_0x8001('0x2b'),JSON[_0x8001('0x23')](_0xe00472));}return logger[_0x8001('0x9')](_0x8001('0x2c'));})['catch'](function(_0x489ae9){return logger[_0x8001('0x2a')](_0x8001('0x2b'),JSON['stringify'](_0x489ae9));});}};}function handleError(){return function(_0x68baa2){return logger['error'](JSON['stringify'](_0x68baa2));};}function handleResult(_0x54c7a1){return function(_0x12c359){logger[_0x8001('0x9')](_0x8001('0x2d'),JSON['stringify'](_0x12c359));if(_0x54c7a1[_0x8001('0xc')]&&_0x54c7a1[_0x8001('0xc')]['Smtp']&&!_[_0x8001('0x2e')](_0x54c7a1['email'])){setTimeout(handleSendEmail(_0x54c7a1,_0x12c359),0x3c*0x3e8);}};}function handleJob(_0x5980d3){return function(){try{if(_[_0x8001('0x2e')](_0x5980d3[_0x8001('0x2f')])){return logger[_0x8001('0x9')](_0x8001('0x30'));}if(_[_0x8001('0x2e')](_0x5980d3[_0x8001('0x18')])){return logger[_0x8001('0x9')](_0x8001('0x31'));}var _0x1374cc={'startDate':moment()[_0x8001('0x32')](_0x5980d3[_0x8001('0x2f')],_0x5980d3['subtractUnit'])[_0x8001('0x16')](_0x8001('0x33')),'endDate':moment()[_0x8001('0x16')](_0x8001('0x33')),'type':_0x8001('0x34'),'output':_0x5980d3['output'],'name':_0x5980d3['name']};if(!_[_0x8001('0x2e')](_0x5980d3[_0x8001('0x35')])){logger[_0x8001('0x9')](_0x8001('0x36'),_0x5980d3[_0x8001('0x35')]);return analyticDefaultReportController[_0x8001('0x37')]({'id':_0x5980d3[_0x8001('0x35')]},_0x1374cc)[_0x8001('0x29')](handleResult(_0x5980d3))[_0x8001('0x38')](handleError());}if(!_[_0x8001('0x2e')](_0x5980d3[_0x8001('0x39')])){logger[_0x8001('0x9')]('exec\x20custom\x20report\x20id:%s',_0x5980d3['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x5980d3[_0x8001('0x39')]},_0x1374cc)[_0x8001('0x29')](handleResult(_0x5980d3))[_0x8001('0x38')](handleError());}}catch(_0x273aa2){logger[_0x8001('0x2a')](JSON['stringify'](_0x273aa2));}return logger[_0x8001('0x9')](_0x8001('0x3a'));};}function getJobs(_0x12419f){var _0x14771e={};if(_0x12419f){_0x14771e['id']=_0x12419f;}return db[_0x8001('0x3b')][_0x8001('0x3c')]({'where':_0x14771e,'include':[{'model':db['MailAccount'],'attributes':['id',_0x8001('0x14'),_0x8001('0xb')],'include':[{'model':db[_0x8001('0x3d')],'as':_0x8001('0xf')}]}]})[_0x8001('0x29')](function(_0x35c101){var _0x56df80=_['keys'](manager[_0x8001('0x3e')]);var _0x59a9b5=_[_0x8001('0x3f')](_0x35c101,function(_0xa0ad07){return _0xa0ad07['id'][_0x8001('0x40')]();});var _0x5912b6=_['keyBy'](_0x35c101,function(_0x3e9fb8){return _0x3e9fb8['id'][_0x8001('0x40')]();});var _0x234b45=_0x12419f?_0x59a9b5:_[_0x8001('0x41')](_0x59a9b5,_0x56df80);var _0x815c82=_[_0x8001('0x42')](_0x59a9b5,_0x56df80);var _0x120cdc=_['difference'](_0x56df80,_0x59a9b5);var _0x578922;var _0x579570;for(_0x578922=0x0;_0x578922<_0x120cdc[_0x8001('0x43')]&&!_0x12419f;_0x578922+=0x1){_0x579570=_0x120cdc[_0x578922][_0x8001('0x40')]();if(manager[_0x8001('0x44')](_0x579570)){manager[_0x8001('0x45')](_0x579570);manager['deleteJob'](_0x579570);logger[_0x8001('0x9')](_0x8001('0x46'),_0x579570);}}logger['info']('toRun',JSON[_0x8001('0x23')](_0x234b45));for(_0x578922=0x0;_0x578922<_0x234b45[_0x8001('0x43')];_0x578922+=0x1){_0x579570=_0x234b45[_0x578922][_0x8001('0x40')]();logger['info'](_0x8001('0x47'),_0x579570);if(_0x12419f){logger[_0x8001('0x9')](_0x8001('0x48'),_0x12419f);logger[_0x8001('0x9')](JSON[_0x8001('0x23')](_0x5912b6[_0x579570]));BPromise[_0x8001('0x49')]()[_0x8001('0x29')](handleJob(_0x5912b6[_0x579570]));logger[_0x8001('0x9')](_0x8001('0x4a'),_0x5912b6[_0x579570][_0x8001('0x14')],_0x5912b6[_0x579570][_0x8001('0x4b')]);}else if(_0x5912b6[_0x579570][_0x8001('0x4b')]&&_0x5912b6[_0x579570][_0x8001('0x4c')]&&moment()[_0x8001('0x4d')](_0x5912b6[_0x579570][_0x8001('0x4e')],_0x5912b6[_0x579570][_0x8001('0x4f')])){manager[_0x8001('0x50')](_0x579570,_0x5912b6[_0x579570]['cron'],handleJob(_0x5912b6[_0x579570]));manager[_0x8001('0x51')](_0x579570);logger['info'](_0x8001('0x52'),_0x5912b6[_0x579570]['name'],_0x5912b6[_0x579570]['cron']);}else if(manager['exists'](_0x579570)){manager[_0x8001('0x45')](_0x579570);manager['deleteJob'](_0x579570);logger[_0x8001('0x9')](_0x8001('0x53'),_0x5912b6[_0x579570][_0x8001('0x14')],_0x5912b6[_0x579570][_0x8001('0x4b')]);}}for(_0x578922=0x0,_0x579570;_0x578922<_0x815c82[_0x8001('0x43')]&&!_0x12419f;_0x578922+=0x1){_0x579570=_0x815c82[_0x578922][_0x8001('0x40')]();if(manager[_0x8001('0x44')](_0x579570)){if(_0x5912b6[_0x579570]['cron']&&_0x5912b6[_0x579570]['active']&&moment()['isBetween'](_0x5912b6[_0x579570][_0x8001('0x4e')],_0x5912b6[_0x579570][_0x8001('0x4f')])){manager[_0x8001('0x54')](_0x579570,_0x5912b6[_0x579570][_0x8001('0x4b')],handleJob(_0x5912b6[_0x579570]));logger[_0x8001('0x9')](_0x8001('0x55'),_0x5912b6[_0x579570][_0x8001('0x14')],_0x5912b6[_0x579570][_0x8001('0x4b')]);}else{manager[_0x8001('0x45')](_0x579570);manager[_0x8001('0x56')](_0x579570);logger[_0x8001('0x9')]('stop\x20cron',_0x5912b6[_0x579570][_0x8001('0x14')],_0x5912b6[_0x579570][_0x8001('0x4b')]);}}}})[_0x8001('0x38')](function(_0x2db93f){logger['error'](JSON[_0x8001('0x23')](_0x2db93f));});}exports[_0x8001('0x57')]=function(_0x5a0c45){return getJobs(_0x5a0c45);};exports[_0x8001('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x5607=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','intersection','difference','length','exists','stop','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','update','update\x20cron','run','path','lodash','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','email','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x5607,0x8f));var _0x7560=function(_0x4a648,_0x271276){_0x4a648=_0x4a648-0x0;var _0x2aafa6=_0x5607[_0x4a648];return _0x2aafa6;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x7560('0x0'));var _=require(_0x7560('0x1'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require(_0x7560('0x2'));var BPromise=require('bluebird');var logger=require(_0x7560('0x3'))(_0x7560('0x4'));var db=require(_0x7560('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x7560('0x6'));var client=jayson[_0x7560('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5d7aa7,_0x3625bc){return function(){logger['info'](_0x7560('0x8'),_0x5d7aa7['email']);var _0x38bc22=!![];var _0x20de26={'tls':{'rejectUnauthorized':![]}};if(_0x5d7aa7[_0x7560('0x9')][_0x7560('0xa')]['service']){_0x20de26[_0x7560('0xb')]=_0x5d7aa7[_0x7560('0x9')]['Smtp'][_0x7560('0xb')];}else{_0x20de26[_0x7560('0xc')]=_0x5d7aa7[_0x7560('0x9')][_0x7560('0xa')]['host'];_0x20de26[_0x7560('0xd')]=_0x5d7aa7[_0x7560('0x9')][_0x7560('0xa')][_0x7560('0xd')];_0x20de26[_0x7560('0xe')]=_0x5d7aa7['MailAccount'][_0x7560('0xa')]['secure'];}if(_0x5d7aa7['MailAccount'][_0x7560('0xa')][_0x7560('0xf')]){_0x20de26[_0x7560('0x10')]={'user':_0x5d7aa7[_0x7560('0x9')]['Smtp'][_0x7560('0x11')],'pass':_0x5d7aa7['MailAccount']['Smtp'][_0x7560('0x12')]};}var _0x314b63={'account':_0x20de26,'message':{'from':util[_0x7560('0x13')](_0x7560('0x14'),_0x5d7aa7[_0x7560('0x9')][_0x7560('0x15')],_0x5d7aa7[_0x7560('0x9')][_0x7560('0x16')]||_0x5d7aa7[_0x7560('0x9')]['Smtp']['user']),'to':_0x5d7aa7[_0x7560('0x16')],'cc':_0x5d7aa7['cc'],'bcc':_0x5d7aa7[_0x7560('0x17')],'subject':util[_0x7560('0x13')](_0x7560('0x18'),_0x3625bc[_0x7560('0x15')],_0x5d7aa7[_0x7560('0x19')],_0x5d7aa7[_0x7560('0x1a')])}};var _0x482d5e=path[_0x7560('0x1b')](__dirname,_0x7560('0x1c'));var _0x320df1=_0x3625bc[_0x7560('0x1d')];var _0x3a290b=util['format'](_0x7560('0x1e'),path['basename'](_0x3625bc[_0x7560('0x1d')],path[_0x7560('0x1f')](_0x3625bc[_0x7560('0x1d')])),_0x7560('0x20'));var _0x3b74eb=path['join'](_0x482d5e,_0x320df1);var _0x4427f1=path[_0x7560('0x1b')](_0x482d5e,_0x3a290b);if(fs[_0x7560('0x21')](_0x3b74eb)){_0x3625bc[_0x7560('0x22')]='Sent';_0x314b63[_0x7560('0x23')][_0x7560('0x24')]=[{'filename':_0x320df1,'path':_0x3b74eb}];_0x314b63['message'][_0x7560('0x25')]=util[_0x7560('0x13')](_0x7560('0x26'),JSON['stringify'](_0x3625bc,null,0x2));}else if(fs[_0x7560('0x21')](_0x4427f1)){_0x3625bc[_0x7560('0x22')]='Sent';_0x314b63['message'][_0x7560('0x24')]=[{'filename':_0x3a290b,'path':_0x4427f1}];}else{_0x314b63['message'][_0x7560('0x25')]=_0x7560('0x27');if(!_0x5d7aa7[_0x7560('0x28')]){_0x38bc22=![];logger[_0x7560('0x29')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x38bc22){return client[_0x7560('0x2a')](_0x7560('0x2b'),_0x314b63)[_0x7560('0x2c')](function(_0x4d8a78){if(_0x4d8a78[_0x7560('0x2d')]){return logger[_0x7560('0x2d')](_0x7560('0x2e'),JSON[_0x7560('0x2f')](_0x4d8a78));}return logger['info']('email\x20sent');})[_0x7560('0x30')](function(_0x3234aa){return logger['error'](_0x7560('0x2e'),JSON[_0x7560('0x2f')](_0x3234aa));});}};}function handleError(){return function(_0x58bbff){return logger[_0x7560('0x2d')](JSON[_0x7560('0x2f')](_0x58bbff));};}function handleResult(_0x340286){return function(_0x219e63){logger[_0x7560('0x29')](_0x7560('0x31'),JSON['stringify'](_0x219e63));if(_0x340286[_0x7560('0x9')]&&_0x340286[_0x7560('0x9')][_0x7560('0xa')]&&!_['isNil'](_0x340286[_0x7560('0x16')])){setTimeout(handleSendEmail(_0x340286,_0x219e63),0x3c*0x3e8);}};}function handleJob(_0x23444f){return function(){try{if(_[_0x7560('0x32')](_0x23444f['subtractNumber'])){return logger[_0x7560('0x29')](_0x7560('0x33'));}if(_[_0x7560('0x32')](_0x23444f['subtractUnit'])){return logger['info'](_0x7560('0x34'));}var _0x2de3ca={'startDate':moment()[_0x7560('0x35')](_0x23444f[_0x7560('0x19')],_0x23444f[_0x7560('0x1a')])[_0x7560('0x13')](_0x7560('0x36')),'endDate':moment()[_0x7560('0x13')](_0x7560('0x36')),'type':'scheduled','output':_0x23444f[_0x7560('0x37')],'name':_0x23444f[_0x7560('0x15')]};if(!_['isNil'](_0x23444f[_0x7560('0x38')])){logger[_0x7560('0x29')](_0x7560('0x39'),_0x23444f[_0x7560('0x38')]);return analyticDefaultReportController[_0x7560('0x3a')]({'id':_0x23444f[_0x7560('0x38')]},_0x2de3ca)[_0x7560('0x2c')](handleResult(_0x23444f))[_0x7560('0x30')](handleError());}if(!_[_0x7560('0x32')](_0x23444f[_0x7560('0x3b')])){logger[_0x7560('0x29')](_0x7560('0x3c'),_0x23444f[_0x7560('0x3b')]);return analyticCustomReportController[_0x7560('0x3a')]({'id':_0x23444f[_0x7560('0x3b')]},_0x2de3ca)[_0x7560('0x2c')](handleResult(_0x23444f))[_0x7560('0x30')](handleError());}}catch(_0x33c6f6){logger[_0x7560('0x2d')](JSON[_0x7560('0x2f')](_0x33c6f6));}return logger[_0x7560('0x29')](_0x7560('0x3d'));};}function getJobs(_0x5d3913){var _0x2a572b={};if(_0x5d3913){_0x2a572b['id']=_0x5d3913;}return db[_0x7560('0x3e')][_0x7560('0x3f')]({'where':_0x2a572b,'include':[{'model':db[_0x7560('0x9')],'attributes':['id',_0x7560('0x15'),_0x7560('0x16')],'include':[{'model':db[_0x7560('0x40')],'as':_0x7560('0xa')}]}]})['then'](function(_0x140239){var _0x2d42c6=_[_0x7560('0x41')](manager[_0x7560('0x42')]);var _0x32ece1=_[_0x7560('0x43')](_0x140239,function(_0x3dd05b){return _0x3dd05b['id'][_0x7560('0x44')]();});var _0x49d614=_['keyBy'](_0x140239,function(_0x5d605b){return _0x5d605b['id'][_0x7560('0x44')]();});var _0x29b97f=_0x5d3913?_0x32ece1:_['difference'](_0x32ece1,_0x2d42c6);var _0xd4ece2=_[_0x7560('0x45')](_0x32ece1,_0x2d42c6);var _0x2f41e4=_[_0x7560('0x46')](_0x2d42c6,_0x32ece1);var _0x1166b1;var _0x5334a4;for(_0x1166b1=0x0;_0x1166b1<_0x2f41e4[_0x7560('0x47')]&&!_0x5d3913;_0x1166b1+=0x1){_0x5334a4=_0x2f41e4[_0x1166b1]['toString']();if(manager[_0x7560('0x48')](_0x5334a4)){manager[_0x7560('0x49')](_0x5334a4);manager['deleteJob'](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x4a'),_0x5334a4);}}logger['info']('toRun',JSON['stringify'](_0x29b97f));for(_0x1166b1=0x0;_0x1166b1<_0x29b97f[_0x7560('0x47')];_0x1166b1+=0x1){_0x5334a4=_0x29b97f[_0x1166b1][_0x7560('0x44')]();logger[_0x7560('0x29')]('index',_0x5334a4);if(_0x5d3913){logger[_0x7560('0x29')](_0x7560('0x4b'),_0x5d3913);logger[_0x7560('0x29')](JSON['stringify'](_0x49d614[_0x5334a4]));BPromise[_0x7560('0x4c')]()['then'](handleJob(_0x49d614[_0x5334a4]));logger[_0x7560('0x29')](_0x7560('0x4d'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4][_0x7560('0x4e')]);}else if(_0x49d614[_0x5334a4]['cron']&&_0x49d614[_0x5334a4][_0x7560('0x4f')]&&moment()[_0x7560('0x50')](_0x49d614[_0x5334a4][_0x7560('0x51')],_0x49d614[_0x5334a4][_0x7560('0x52')])){manager[_0x7560('0x53')](_0x5334a4,_0x49d614[_0x5334a4][_0x7560('0x4e')],handleJob(_0x49d614[_0x5334a4]));manager[_0x7560('0x54')](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x55'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4][_0x7560('0x4e')]);}else if(manager[_0x7560('0x48')](_0x5334a4)){manager[_0x7560('0x49')](_0x5334a4);manager[_0x7560('0x56')](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x57'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4]['cron']);}}for(_0x1166b1=0x0,_0x5334a4;_0x1166b1<_0xd4ece2[_0x7560('0x47')]&&!_0x5d3913;_0x1166b1+=0x1){_0x5334a4=_0xd4ece2[_0x1166b1]['toString']();if(manager[_0x7560('0x48')](_0x5334a4)){if(_0x49d614[_0x5334a4][_0x7560('0x4e')]&&_0x49d614[_0x5334a4][_0x7560('0x4f')]&&moment()[_0x7560('0x50')](_0x49d614[_0x5334a4]['startAt'],_0x49d614[_0x5334a4][_0x7560('0x52')])){manager[_0x7560('0x58')](_0x5334a4,_0x49d614[_0x5334a4][_0x7560('0x4e')],handleJob(_0x49d614[_0x5334a4]));logger[_0x7560('0x29')](_0x7560('0x59'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4]['cron']);}else{manager[_0x7560('0x49')](_0x5334a4);manager['deleteJob'](_0x5334a4);logger[_0x7560('0x29')](_0x7560('0x57'),_0x49d614[_0x5334a4][_0x7560('0x15')],_0x49d614[_0x5334a4]['cron']);}}}})[_0x7560('0x30')](function(_0x441a13){logger[_0x7560('0x2d')](JSON[_0x7560('0x2f')](_0x441a13));});}exports[_0x7560('0x5a')]=function(_0x57b913){return getJobs(_0x57b913);};exports[_0x7560('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 0672092..337bbc9 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8edb=['CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1'];(function(_0x415e55,_0x39b566){var _0x2d23d7=function(_0x2a312c){while(--_0x2a312c){_0x415e55['push'](_0x415e55['shift']());}};_0x2d23d7(++_0x39b566);}(_0x8edb,0x16e));var _0xb8ed=function(_0x2a26d4,_0xe39dc9){_0x2a26d4=_0x2a26d4-0x0;var _0x5404b5=_0x8edb[_0x2a26d4];return _0x5404b5;};'use strict';var util=require(_0xb8ed('0x0'));var db=require(_0xb8ed('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb8ed('0x2')]({'id':i,'firstName':_0xb8ed('0x3')+i,'lastName':_0xb8ed('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xb8ed('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xb8ed('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb8ed('0x6')](),'updatedAt':Date[_0xb8ed('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xb8ed('0x2')]({'id':i,'firstName':_0xb8ed('0x3')+i,'lastName':_0xb8ed('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xb8ed('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb8ed('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb8ed('0x6')](),'updatedAt':Date[_0xb8ed('0x6')]()});}db[_0xb8ed('0x7')][_0xb8ed('0x8')]({'where':{}})[_0xb8ed('0x9')](function(){return db['CmContact'][_0xb8ed('0xa')](contacts);})[_0xb8ed('0x9')](function(){console[_0xb8ed('0xb')](_0xb8ed('0xc'),_0xb8ed('0xd'));return db[_0xb8ed('0xe')][_0xb8ed('0x8')]({'where':{}});})[_0xb8ed('0x9')](function(){return db[_0xb8ed('0xe')]['bulkCreate'](hopper);})[_0xb8ed('0x9')](function(){console[_0xb8ed('0xb')](_0xb8ed('0xc'),_0xb8ed('0xf'));return db[_0xb8ed('0x7')][_0xb8ed('0xa')](contacts2);})[_0xb8ed('0x9')](function(){console['log'](_0xb8ed('0xc'),_0xb8ed('0x10'));return db[_0xb8ed('0xe')][_0xb8ed('0xa')](hopper2);})[_0xb8ed('0x9')](function(){console[_0xb8ed('0xb')]('finished\x20populating',_0xb8ed('0x11'));})[_0xb8ed('0x12')](function(_0xd2ac57){console[_0xb8ed('0xb')](_0xd2ac57);}); \ No newline at end of file +var _0x2c49=['Innocenzo','@xcally.com','now','innocenzo.biondo','push','CmContact','destroy','then','bulkCreate','log','contacts1','hopper1','finished\x20populating','contacts2','CmHopper','catch','util','../mysqldb'];(function(_0xff7c05,_0x2456ca){var _0x1c1ab9=function(_0x187d56){while(--_0x187d56){_0xff7c05['push'](_0xff7c05['shift']());}};_0x1c1ab9(++_0x2456ca);}(_0x2c49,0x142));var _0x92c4=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x2c49[_0x1ca9e9];return _0x309f3c;};'use strict';var util=require(_0x92c4('0x0'));var db=require(_0x92c4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x92c4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x92c4('0x3')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x92c4('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x92c4('0x4')](),'updatedAt':Date[_0x92c4('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x92c4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x92c4('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x92c4('0x6')]({'id':i,'active':![],'scheduledat':Date[_0x92c4('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x92c4('0x4')](),'updatedAt':Date[_0x92c4('0x4')]()});}db[_0x92c4('0x7')][_0x92c4('0x8')]({'where':{}})[_0x92c4('0x9')](function(){return db[_0x92c4('0x7')][_0x92c4('0xa')](contacts);})['then'](function(){console[_0x92c4('0xb')]('finished\x20populating',_0x92c4('0xc'));return db['CmHopper'][_0x92c4('0x8')]({'where':{}});})[_0x92c4('0x9')](function(){return db['CmHopper'][_0x92c4('0xa')](hopper);})[_0x92c4('0x9')](function(){console[_0x92c4('0xb')]('finished\x20populating',_0x92c4('0xd'));return db[_0x92c4('0x7')][_0x92c4('0xa')](contacts2);})[_0x92c4('0x9')](function(){console[_0x92c4('0xb')](_0x92c4('0xe'),_0x92c4('0xf'));return db[_0x92c4('0x10')][_0x92c4('0xa')](hopper2);})[_0x92c4('0x9')](function(){console[_0x92c4('0xb')](_0x92c4('0xe'),'hopper2');})[_0x92c4('0x11')](function(_0x4aab0c){console[_0x92c4('0xb')](_0x4aab0c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index ce081d1..07805ca 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6ec=['udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','../mysqldb','push','format','agent','%s%s','password','friend'];(function(_0x4f9d7c,_0x38f5c5){var _0x2f6561=function(_0x7ac68){while(--_0x7ac68){_0x4f9d7c['push'](_0x4f9d7c['shift']());}};_0x2f6561(++_0x38f5c5);}(_0xb6ec,0xca));var _0xcb6e=function(_0x576cde,_0x6900e6){_0x576cde=_0x576cde-0x0;var _0xfbe330=_0xb6ec[_0x576cde];return _0xfbe330;};'use strict';var util=require(_0xcb6e('0x0'));var db=require(_0xcb6e('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xcb6e('0x2')]({'name':util[_0xcb6e('0x3')]('%s%s',_0xcb6e('0x4'),i),'fullname':util['format'](_0xcb6e('0x5'),'agent',i),'email':util[_0xcb6e('0x3')]('%s%s@xcally.com',_0xcb6e('0x4'),i),'role':'agent','password':_0xcb6e('0x6'),'internal':0xfa0+i,'type':_0xcb6e('0x7'),'transport':[_0xcb6e('0x8'),'ws',_0xcb6e('0x9')],'disallow':[_0xcb6e('0xa')],'allow':['ulaw'],'defaultuser':util[_0xcb6e('0x3')](_0xcb6e('0x5'),_0xcb6e('0x4'),i),'encryption':_0xcb6e('0xb'),'avpf':_0xcb6e('0xb'),'force_avp':_0xcb6e('0xb'),'icesupport':_0xcb6e('0xb'),'dtlsenable':_0xcb6e('0xb'),'dtlsverify':'no','dtlscertfile':_0xcb6e('0xc'),'dtlsprivatekey':_0xcb6e('0xd'),'dtlssetup':_0xcb6e('0xe'),'callerid':util[_0xcb6e('0x3')](_0xcb6e('0xf'),util['format'](_0xcb6e('0x5'),_0xcb6e('0x4'),i),0xfa0+i)});}db[_0xcb6e('0x10')][_0xcb6e('0x11')](users)['then'](function(){console[_0xcb6e('0x12')](_0xcb6e('0x13'));})[_0xcb6e('0x14')](function(_0x1371fe){console['log'](_0x1371fe);}); \ No newline at end of file +var _0x9ade=['format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','push'];(function(_0x19b0e2,_0x2670a6){var _0x3c9f7e=function(_0x55c440){while(--_0x55c440){_0x19b0e2['push'](_0x19b0e2['shift']());}};_0x3c9f7e(++_0x2670a6);}(_0x9ade,0x19c));var _0xe9ad=function(_0x4b88f8,_0x20ae18){_0x4b88f8=_0x4b88f8-0x0;var _0x15ecc5=_0x9ade[_0x4b88f8];return _0x15ecc5;};'use strict';var util=require(_0xe9ad('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe9ad('0x1')]({'name':util['format']('%s%s','agent',i),'fullname':util[_0xe9ad('0x2')](_0xe9ad('0x3'),_0xe9ad('0x4'),i),'email':util[_0xe9ad('0x2')](_0xe9ad('0x5'),'agent',i),'role':_0xe9ad('0x4'),'password':_0xe9ad('0x6'),'internal':0xfa0+i,'type':_0xe9ad('0x7'),'transport':[_0xe9ad('0x8'),'ws',_0xe9ad('0x9')],'disallow':[_0xe9ad('0xa')],'allow':[_0xe9ad('0xb')],'defaultuser':util[_0xe9ad('0x2')]('%s%s','agent',i),'encryption':'yes','avpf':'yes','force_avp':_0xe9ad('0xc'),'icesupport':_0xe9ad('0xc'),'dtlsenable':_0xe9ad('0xc'),'dtlsverify':'no','dtlscertfile':_0xe9ad('0xd'),'dtlsprivatekey':_0xe9ad('0xe'),'dtlssetup':_0xe9ad('0xf'),'callerid':util[_0xe9ad('0x2')](_0xe9ad('0x10'),util['format']('%s%s',_0xe9ad('0x4'),i),0xfa0+i)});}db[_0xe9ad('0x11')][_0xe9ad('0x12')](users)[_0xe9ad('0x13')](function(){console[_0xe9ad('0x14')](_0xe9ad('0x15'));})[_0xe9ad('0x16')](function(_0x27eb2f){console[_0xe9ad('0x14')](_0x27eb2f);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 99459b8..31368e6 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8869=['autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','Campaign','where','type','format','%s:queue:%s','length','user:%s','query','find','userProfileId','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','Trunk','user','VoiceQueues','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','sms','mail','openchannel','telephone:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','catch','log','default','connection','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','bluebird','../mysqldb','./environment','name','Agents','User','role','telephone','agent','ivr','UserProfileSection','findOne','then'];(function(_0x59d9df,_0xad6571){var _0x4ac4a5=function(_0x2ef1bc){while(--_0x2ef1bc){_0x59d9df['push'](_0x59d9df['shift']());}};_0x4ac4a5(++_0xad6571);}(_0x8869,0xa9));var _0x9886=function(_0x38e6d9,_0x1895f1){_0x38e6d9=_0x38e6d9-0x0;var _0x421e0b=_0x8869[_0x38e6d9];return _0x421e0b;};'use strict';var _=require('lodash');var util=require('util');var BPromise=require(_0x9886('0x0'));var db=require(_0x9886('0x1'))['db'];var config=require(_0x9886('0x2'));var queryQueues={'attributes':['id',_0x9886('0x3')],'include':[{'as':_0x9886('0x4'),'model':db[_0x9886('0x5')],'attributes':['id',_0x9886('0x3'),_0x9886('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x9886('0x3')],'where':{'role':_0x9886('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x9886('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x9886('0x3')],'where':{'role':_0x9886('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x9886('0x3'),'type'],'where':{'type':_0x9886('0x9')}};function getAssociatedResources(_0x35415c,_0x3497a8,_0x4a887b){return db[_0x9886('0xa')][_0x9886('0xb')]({'where':{'name':_0x35415c,'userProfileId':_0x3497a8},'raw':!![]})[_0x9886('0xc')](function(_0xc9628b){if(_0xc9628b){if(_0xc9628b[_0x9886('0xd')]){switch(_0x35415c){case'VoiceQueues':case _0x9886('0xe'):case _0x9886('0xf'):case _0x9886('0x10'):case _0x9886('0x11'):case _0x9886('0x12'):return db[_0x4a887b]['findAll'](queryQueues);case _0x9886('0x13'):return db[_0x4a887b][_0x9886('0x14')](queryTelephones);case _0x9886('0x15'):return db[_0x4a887b]['findAll'](queryTrunks);case _0x9886('0x16'):return db[_0x4a887b][_0x9886('0x14')](queryCampaigns);}}else{return db[_0x9886('0x17')]['findAll']({'attributes':[_0x9886('0x18')],'where':{'sectionId':_0xc9628b['id']},'raw':!![]})[_0x9886('0xc')](function(_0xc1a628){if(_0xc1a628){var _0x5a4534={'where':{'id':_[_0x9886('0x19')](_0xc1a628,_0x9886('0x18'))},'raw':!![]};switch(_0x4a887b){case _0x9886('0x5'):_0x5a4534['where'][_0x9886('0x6')]=_0x9886('0x7');break;case _0x9886('0x1a'):_0x5a4534[_0x9886('0x1b')][_0x9886('0x1c')]='ivr';break;}return db[_0x4a887b][_0x9886('0x14')](_0x5a4534);}else{return[];}});}}else{return[];}})['then'](function(_0x3117e3){return _0x3117e3;});}function joinOrLeaveQueues(_0x953418,_0x3ba576,_0x442802,_0x4eac33){_0x953418[_0x3ba576](util[_0x9886('0x1d')](_0x9886('0x1e'),_0x442802,_0x4eac33[_0x9886('0x3')]));if(_0x4eac33[_0x9886('0x4')]){for(var _0x74a90f=0x0;_0x74a90f<_0x4eac33[_0x9886('0x4')][_0x9886('0x1f')];_0x74a90f+=0x1){_0x953418[_0x3ba576](util[_0x9886('0x1d')](_0x9886('0x20'),_0x4eac33['Agents'][_0x74a90f]['name']));}}}function joinOrLeave(_0x3875f1,_0x38b850,_0x38e0cd){var _0x1801f3;if(_0x3875f1['handshake'][_0x9886('0x21')]['id']){db['User'][_0x9886('0x22')]({'attributes':['id','name','role',_0x9886('0x23')],'where':{'id':_0x3875f1['handshake'][_0x9886('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x9886('0x24')],'as':_0x9886('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x9886('0x26')],'as':_0x9886('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x9886('0x28')],'as':_0x9886('0x29'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x9886('0x2a'),'attributes':['id'],'raw':!![]}]})[_0x9886('0xc')](function(_0x2dcf22){if(_0x2dcf22){_0x1801f3=_0x2dcf22;_0x3875f1[_0x38b850](util[_0x9886('0x1d')](_0x9886('0x20'),_0x2dcf22[_0x9886('0x3')]));var _0x2c6096=[];switch(_0x2dcf22[_0x9886('0x6')]){case _0x9886('0x2b'):_0x3875f1[_0x38b850](_0x9886('0x2c'));_0x3875f1[_0x38b850](_0x9886('0x2d'));if(queryQueues[_0x9886('0x2e')](_0x9886('0x2f'))){delete queryQueues[_0x9886('0x2f')];}_0x2c6096[_0x9886('0x30')](db[_0x9886('0x31')][_0x9886('0x14')](queryQueues));_0x2c6096['push'](db[_0x9886('0x32')][_0x9886('0x14')](queryQueues));_0x2c6096['push'](db[_0x9886('0x33')][_0x9886('0x14')](queryQueues));_0x2c6096[_0x9886('0x30')](db[_0x9886('0x34')]['findAll'](queryQueues));_0x2c6096[_0x9886('0x30')](db['MailQueue'][_0x9886('0x14')](queryQueues));_0x2c6096['push'](db[_0x9886('0x35')][_0x9886('0x14')](queryQueues));_0x2c6096[_0x9886('0x30')](db[_0x9886('0x5')][_0x9886('0x14')](queryTelephones));_0x2c6096[_0x9886('0x30')](db[_0x9886('0x36')]['findAll'](queryTrunks));_0x2c6096[_0x9886('0x30')](db[_0x9886('0x1a')][_0x9886('0x14')](queryCampaigns));_0x2c6096[_0x9886('0x30')](db[_0x9886('0x5')][_0x9886('0x14')](queryAgents));break;case _0x9886('0x37'):_0x3875f1[_0x38b850]('voice:inbound');_0x3875f1[_0x38b850](_0x9886('0x2d'));_0x2c6096[_0x9886('0x30')](getAssociatedResources(_0x9886('0x38'),_0x2dcf22[_0x9886('0x23')],_0x9886('0x31')));_0x2c6096[_0x9886('0x30')](getAssociatedResources(_0x9886('0xe'),_0x2dcf22[_0x9886('0x23')],'ChatQueue'));_0x2c6096['push'](getAssociatedResources('FaxQueues',_0x2dcf22['userProfileId'],_0x9886('0x33')));_0x2c6096[_0x9886('0x30')](getAssociatedResources(_0x9886('0x10'),_0x2dcf22['userProfileId'],_0x9886('0x34')));_0x2c6096[_0x9886('0x30')](getAssociatedResources(_0x9886('0x11'),_0x2dcf22[_0x9886('0x23')],'MailQueue'));_0x2c6096[_0x9886('0x30')](getAssociatedResources('OpenchannelQueues',_0x2dcf22[_0x9886('0x23')],_0x9886('0x35')));_0x2c6096[_0x9886('0x30')](getAssociatedResources(_0x9886('0x13'),_0x2dcf22[_0x9886('0x23')],_0x9886('0x5')));_0x2c6096[_0x9886('0x30')](getAssociatedResources(_0x9886('0x15'),_0x2dcf22['userProfileId'],'Trunk'));_0x2c6096[_0x9886('0x30')](getAssociatedResources(_0x9886('0x16'),_0x2dcf22[_0x9886('0x23')],_0x9886('0x1a')));_0x2c6096[_0x9886('0x30')](db[_0x9886('0x5')]['findAll'](queryAgents));break;case _0x9886('0x8'):_0x3875f1[_0x38b850](_0x9886('0x2c'));_0x3875f1[_0x38b850](_0x9886('0x2d'));_0x2c6096['push'](_0x2dcf22[_0x9886('0x39')]({'attributes':['id',_0x9886('0x3')]}));_0x2c6096[_0x9886('0x30')](_0x2dcf22[_0x9886('0x3a')]({'attributes':['id',_0x9886('0x3')]}));_0x2c6096[_0x9886('0x30')](_0x2dcf22[_0x9886('0x3b')]({'attributes':['id','name']}));_0x2c6096[_0x9886('0x30')](_0x2dcf22['getSmsQueues']({'attributes':['id','name']}));_0x2c6096[_0x9886('0x30')](_0x2dcf22[_0x9886('0x3c')]({'attributes':['id',_0x9886('0x3')]}));_0x2c6096['push'](_0x2dcf22[_0x9886('0x3d')]({'attributes':['id','name']}));break;}return BPromise[_0x9886('0x3e')](_0x2c6096);}})[_0x9886('0xc')](function(_0x391cc1){if(_0x391cc1&&_0x391cc1[_0x9886('0x1f')]){for(var _0x109e59=0x0;_0x109e59<_0x391cc1[_0x9886('0x1f')];_0x109e59+=0x1){for(var _0x6b248b=0x0;_0x6b248b<_0x391cc1[_0x109e59][_0x9886('0x1f')];_0x6b248b+=0x1){switch(_0x109e59){case 0x0:joinOrLeaveQueues(_0x3875f1,_0x38b850,'voice',_0x391cc1[_0x109e59][_0x6b248b]);break;case 0x1:joinOrLeaveQueues(_0x3875f1,_0x38b850,_0x9886('0x3f'),_0x391cc1[_0x109e59][_0x6b248b]);break;case 0x2:joinOrLeaveQueues(_0x3875f1,_0x38b850,_0x9886('0x40'),_0x391cc1[_0x109e59][_0x6b248b]);break;case 0x3:joinOrLeaveQueues(_0x3875f1,_0x38b850,_0x9886('0x41'),_0x391cc1[_0x109e59][_0x6b248b]);break;case 0x4:joinOrLeaveQueues(_0x3875f1,_0x38b850,_0x9886('0x42'),_0x391cc1[_0x109e59][_0x6b248b]);break;case 0x5:joinOrLeaveQueues(_0x3875f1,_0x38b850,_0x9886('0x43'),_0x391cc1[_0x109e59][_0x6b248b]);break;case 0x6:_0x3875f1[_0x38b850](util[_0x9886('0x1d')](_0x9886('0x44'),_0x391cc1[_0x109e59][_0x6b248b][_0x9886('0x3')]));break;case 0x7:_0x3875f1[_0x38b850](util[_0x9886('0x1d')]('trunk:%s',_0x391cc1[_0x109e59][_0x6b248b]['name']));break;case 0x8:_0x3875f1[_0x38b850](util[_0x9886('0x1d')]('campaign:%s:%s',_0x391cc1[_0x109e59][_0x6b248b][_0x9886('0x1c')],_0x391cc1[_0x109e59][_0x6b248b][_0x9886('0x3')]));break;case 0x9:_0x3875f1[_0x38b850](util['format'](_0x9886('0x20'),_0x391cc1[_0x109e59][_0x6b248b]['name']));break;}}}}})[_0x9886('0xc')](function(){if(_0x38b850===_0x9886('0x45')){var _0x390faa=_[_0x9886('0x19')](_0x1801f3['ChatInteractions'],'id');return _0x1801f3['removeChatInteractions'](_0x390faa)[_0x9886('0xc')](function(){for(var _0xbf0ab6=0x0;_0xbf0ab6<_0x390faa[_0x9886('0x1f')];_0xbf0ab6+=0x1){_0x38e0cd[_0x9886('0x46')](_0x9886('0x47'),{'ChatInteractionId':Number(_0x390faa[_0xbf0ab6]),'UserId':Number(_0x1801f3['id'])});}});}})['then'](function(){if(_0x38b850==='leave'){var _0xc49564=_[_0x9886('0x19')](_0x1801f3[_0x9886('0x25')],'id');return _0x1801f3[_0x9886('0x48')](_0xc49564)[_0x9886('0xc')](function(){for(var _0x272ca4=0x0;_0x272ca4<_0xc49564[_0x9886('0x1f')];_0x272ca4+=0x1){_0x38e0cd['emit'](_0x9886('0x49'),{'MailInteractionId':Number(_0xc49564[_0x272ca4]),'UserId':Number(_0x1801f3['id'])});}});}})['then'](function(){if(_0x38b850===_0x9886('0x45')){var _0x46efa7=_[_0x9886('0x19')](_0x1801f3[_0x9886('0x27')],'id');return _0x1801f3['removeFaxInteractions'](_0x46efa7)['then'](function(){for(var _0x4b3770=0x0;_0x4b3770<_0x46efa7[_0x9886('0x1f')];_0x4b3770+=0x1){_0x38e0cd[_0x9886('0x46')](_0x9886('0x4a'),{'FaxInteractionId':Number(_0x46efa7[_0x4b3770]),'UserId':Number(_0x1801f3['id'])});}});}})[_0x9886('0xc')](function(){if(_0x38b850==='leave'){var _0x310e4a=_[_0x9886('0x19')](_0x1801f3[_0x9886('0x29')],'id');return _0x1801f3[_0x9886('0x4b')](_0x310e4a)['then'](function(){for(var _0x2f7ee1=0x0;_0x2f7ee1<_0x310e4a[_0x9886('0x1f')];_0x2f7ee1+=0x1){_0x38e0cd[_0x9886('0x46')](_0x9886('0x4c'),{'SmsInteractionId':Number(_0x310e4a[_0x2f7ee1]),'UserId':Number(_0x1801f3['id'])});}});}})[_0x9886('0xc')](function(){if(_0x38b850===_0x9886('0x45')){var _0xab5e77=_[_0x9886('0x19')](_0x1801f3[_0x9886('0x2a')],'id');return _0x1801f3['removeOpenchannelInteractions'](_0xab5e77)['then'](function(){for(var _0xdc8180=0x0;_0xdc8180<_0xab5e77[_0x9886('0x1f')];_0xdc8180+=0x1){_0x38e0cd[_0x9886('0x46')](_0x9886('0x4d'),{'OpenchannelInteractionId':Number(_0xab5e77[_0xdc8180]),'UserId':Number(_0x1801f3['id'])});}});}})[_0x9886('0x4e')](function(_0x734206){_0x3875f1[_0x9886('0x4f')](_0x734206);});}}function onDisconnect(_0x4fc706,_0x58ac52){joinOrLeave(_0x4fc706,_0x9886('0x45'),_0x58ac52);}function onConnect(_0x5061eb){joinOrLeave(_0x5061eb,'join');}exports[_0x9886('0x50')]=function(_0xa4243e){_0xa4243e['on'](_0x9886('0x51'),function(_0x445d53){_0x445d53['setMaxListeners'](0x0);_0x445d53[_0x9886('0x52')]=_0x445d53[_0x9886('0x53')][_0x9886('0x51')][_0x9886('0x54')]+':'+_0x445d53['request']['connection'][_0x9886('0x55')];_0x445d53['connectedAt']=new Date();_0x445d53[_0x9886('0x4f')]=function(_0x3e0ffd){console[_0x9886('0x4f')](_0x9886('0x56')+_0x445d53[_0x9886('0x57')]['name']+'['+_0x445d53[_0x9886('0x52')]+']',_0x3e0ffd);};_0x445d53['on'](_0x9886('0x58'),function(){onDisconnect(_0x445d53,_0xa4243e);_0x445d53['log'](_0x9886('0x59'));});onConnect(_0x445d53);_0x445d53[_0x9886('0x4f')](_0x9886('0x5a'));});}; \ No newline at end of file +var _0x7d02=['UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','user:%s','handshake','query','userProfileId','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteractions','voice:inbound','voice:outbound','include','VoiceQueue','push','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','length','voice','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','ChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','nsp','address','disconnect','util','bluebird','../mysqldb','./environment','User','name','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','findAll','Telephones','Trunks','IvrCampaigns'];(function(_0x3b9088,_0x2d7ad3){var _0x42201b=function(_0x3dd7e8){while(--_0x3dd7e8){_0x3b9088['push'](_0x3b9088['shift']());}};_0x42201b(++_0x2d7ad3);}(_0x7d02,0x193));var _0x27d0=function(_0x4777e9,_0x3a944f){_0x4777e9=_0x4777e9-0x0;var _0x411e09=_0x7d02[_0x4777e9];return _0x411e09;};'use strict';var _=require('lodash');var util=require(_0x27d0('0x0'));var BPromise=require(_0x27d0('0x1'));var db=require(_0x27d0('0x2'))['db'];var config=require(_0x27d0('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':'Agents','model':db[_0x27d0('0x4')],'attributes':['id',_0x27d0('0x5'),_0x27d0('0x6')],'raw':!![],'where':{'role':_0x27d0('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x27d0('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x27d0('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x27d0('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x27d0('0x5'),_0x27d0('0x8')],'where':{'type':_0x27d0('0x9')}};function getAssociatedResources(_0x1c440d,_0x561e10,_0x4921da){return db[_0x27d0('0xa')][_0x27d0('0xb')]({'where':{'name':_0x1c440d,'userProfileId':_0x561e10},'raw':!![]})[_0x27d0('0xc')](function(_0x4d8df8){if(_0x4d8df8){if(_0x4d8df8[_0x27d0('0xd')]){switch(_0x1c440d){case _0x27d0('0xe'):case _0x27d0('0xf'):case _0x27d0('0x10'):case _0x27d0('0x11'):case'MailQueues':case'OpenchannelQueues':return db[_0x4921da][_0x27d0('0x12')](queryQueues);case _0x27d0('0x13'):return db[_0x4921da]['findAll'](queryTelephones);case _0x27d0('0x14'):return db[_0x4921da][_0x27d0('0x12')](queryTrunks);case _0x27d0('0x15'):return db[_0x4921da][_0x27d0('0x12')](queryCampaigns);}}else{return db[_0x27d0('0x16')][_0x27d0('0x12')]({'attributes':[_0x27d0('0x17')],'where':{'sectionId':_0x4d8df8['id']},'raw':!![]})['then'](function(_0x1413b2){if(_0x1413b2){var _0x452a2d={'where':{'id':_[_0x27d0('0x18')](_0x1413b2,'resourceId')},'raw':!![]};switch(_0x4921da){case _0x27d0('0x4'):_0x452a2d[_0x27d0('0x19')]['role']='telephone';break;case _0x27d0('0x1a'):_0x452a2d[_0x27d0('0x19')]['type']=_0x27d0('0x9');break;}return db[_0x4921da][_0x27d0('0x12')](_0x452a2d);}else{return[];}});}}else{return[];}})['then'](function(_0x49585){return _0x49585;});}function joinOrLeaveQueues(_0x2ee937,_0x55cd40,_0x322056,_0x380bdc){_0x2ee937[_0x55cd40](util[_0x27d0('0x1b')](_0x27d0('0x1c'),_0x322056,_0x380bdc['name']));if(_0x380bdc['Agents']){for(var _0x135feb=0x0;_0x135feb<_0x380bdc[_0x27d0('0x1d')]['length'];_0x135feb+=0x1){_0x2ee937[_0x55cd40](util[_0x27d0('0x1b')](_0x27d0('0x1e'),_0x380bdc[_0x27d0('0x1d')][_0x135feb]['name']));}}}function joinOrLeave(_0x442d76,_0x435fd5,_0x2b9d8a){var _0x3c1996;if(_0x442d76[_0x27d0('0x1f')][_0x27d0('0x20')]['id']){db[_0x27d0('0x4')]['find']({'attributes':['id',_0x27d0('0x5'),_0x27d0('0x6'),_0x27d0('0x21')],'where':{'id':_0x442d76[_0x27d0('0x1f')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x27d0('0x22')],'as':_0x27d0('0x23'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x27d0('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x27d0('0x25'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x27d0('0x26'),'attributes':['id'],'raw':!![]}]})[_0x27d0('0xc')](function(_0x3d1d03){if(_0x3d1d03){_0x3c1996=_0x3d1d03;_0x442d76[_0x435fd5](util['format'](_0x27d0('0x1e'),_0x3d1d03[_0x27d0('0x5')]));var _0x31baba=[];switch(_0x3d1d03[_0x27d0('0x6')]){case'admin':_0x442d76[_0x435fd5](_0x27d0('0x27'));_0x442d76[_0x435fd5](_0x27d0('0x28'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x27d0('0x29')];}_0x31baba['push'](db[_0x27d0('0x2a')]['findAll'](queryQueues));_0x31baba[_0x27d0('0x2b')](db['ChatQueue'][_0x27d0('0x12')](queryQueues));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x2c')][_0x27d0('0x12')](queryQueues));_0x31baba[_0x27d0('0x2b')](db['SmsQueue']['findAll'](queryQueues));_0x31baba['push'](db[_0x27d0('0x2d')][_0x27d0('0x12')](queryQueues));_0x31baba['push'](db[_0x27d0('0x2e')][_0x27d0('0x12')](queryQueues));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x4')][_0x27d0('0x12')](queryTelephones));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x2f')][_0x27d0('0x12')](queryTrunks));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x1a')][_0x27d0('0x12')](queryCampaigns));_0x31baba[_0x27d0('0x2b')](db['User']['findAll'](queryAgents));break;case _0x27d0('0x30'):_0x442d76[_0x435fd5](_0x27d0('0x27'));_0x442d76[_0x435fd5](_0x27d0('0x28'));_0x31baba['push'](getAssociatedResources('VoiceQueues',_0x3d1d03[_0x27d0('0x21')],_0x27d0('0x2a')));_0x31baba['push'](getAssociatedResources('ChatQueues',_0x3d1d03['userProfileId'],'ChatQueue'));_0x31baba[_0x27d0('0x2b')](getAssociatedResources('FaxQueues',_0x3d1d03[_0x27d0('0x21')],'FaxQueue'));_0x31baba[_0x27d0('0x2b')](getAssociatedResources(_0x27d0('0x11'),_0x3d1d03['userProfileId'],'SmsQueue'));_0x31baba['push'](getAssociatedResources('MailQueues',_0x3d1d03[_0x27d0('0x21')],'MailQueue'));_0x31baba[_0x27d0('0x2b')](getAssociatedResources('OpenchannelQueues',_0x3d1d03['userProfileId'],'OpenchannelQueue'));_0x31baba['push'](getAssociatedResources(_0x27d0('0x13'),_0x3d1d03['userProfileId'],_0x27d0('0x4')));_0x31baba['push'](getAssociatedResources(_0x27d0('0x14'),_0x3d1d03['userProfileId'],_0x27d0('0x2f')));_0x31baba['push'](getAssociatedResources(_0x27d0('0x15'),_0x3d1d03[_0x27d0('0x21')],_0x27d0('0x1a')));_0x31baba[_0x27d0('0x2b')](db[_0x27d0('0x4')]['findAll'](queryAgents));break;case'agent':_0x442d76[_0x435fd5]('voice:inbound');_0x442d76[_0x435fd5](_0x27d0('0x28'));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x31')]({'attributes':['id',_0x27d0('0x5')]}));_0x31baba['push'](_0x3d1d03[_0x27d0('0x32')]({'attributes':['id','name']}));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x33')]({'attributes':['id',_0x27d0('0x5')]}));_0x31baba['push'](_0x3d1d03[_0x27d0('0x34')]({'attributes':['id','name']}));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x35')]({'attributes':['id',_0x27d0('0x5')]}));_0x31baba[_0x27d0('0x2b')](_0x3d1d03[_0x27d0('0x36')]({'attributes':['id',_0x27d0('0x5')]}));break;}return BPromise['all'](_0x31baba);}})[_0x27d0('0xc')](function(_0xb30d91){if(_0xb30d91&&_0xb30d91[_0x27d0('0x37')]){for(var _0x4f7b79=0x0;_0x4f7b79<_0xb30d91['length'];_0x4f7b79+=0x1){for(var _0x43df53=0x0;_0x43df53<_0xb30d91[_0x4f7b79][_0x27d0('0x37')];_0x43df53+=0x1){switch(_0x4f7b79){case 0x0:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x38'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x1:joinOrLeaveQueues(_0x442d76,_0x435fd5,'chat',_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x2:joinOrLeaveQueues(_0x442d76,_0x435fd5,'fax',_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x3:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x39'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x4:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x3a'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x5:joinOrLeaveQueues(_0x442d76,_0x435fd5,_0x27d0('0x3b'),_0xb30d91[_0x4f7b79][_0x43df53]);break;case 0x6:_0x442d76[_0x435fd5](util['format']('telephone:%s',_0xb30d91[_0x4f7b79][_0x43df53]['name']));break;case 0x7:_0x442d76[_0x435fd5](util[_0x27d0('0x1b')](_0x27d0('0x3c'),_0xb30d91[_0x4f7b79][_0x43df53][_0x27d0('0x5')]));break;case 0x8:_0x442d76[_0x435fd5](util[_0x27d0('0x1b')](_0x27d0('0x3d'),_0xb30d91[_0x4f7b79][_0x43df53]['type'],_0xb30d91[_0x4f7b79][_0x43df53][_0x27d0('0x5')]));break;case 0x9:_0x442d76[_0x435fd5](util[_0x27d0('0x1b')](_0x27d0('0x1e'),_0xb30d91[_0x4f7b79][_0x43df53]['name']));break;}}}}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0x5d23a0=_[_0x27d0('0x18')](_0x3c1996[_0x27d0('0x3f')],'id');return _0x3c1996['removeChatInteractions'](_0x5d23a0)[_0x27d0('0xc')](function(){for(var _0x50fff0=0x0;_0x50fff0<_0x5d23a0[_0x27d0('0x37')];_0x50fff0+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x41'),{'ChatInteractionId':Number(_0x5d23a0[_0x50fff0]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0xd48845=_['map'](_0x3c1996['MailInteractions'],'id');return _0x3c1996[_0x27d0('0x42')](_0xd48845)[_0x27d0('0xc')](function(){for(var _0x34c28=0x0;_0x34c28<_0xd48845['length'];_0x34c28+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x43'),{'MailInteractionId':Number(_0xd48845[_0x34c28]),'UserId':Number(_0x3c1996['id'])});}});}})['then'](function(){if(_0x435fd5==='leave'){var _0xf369c6=_[_0x27d0('0x18')](_0x3c1996[_0x27d0('0x24')],'id');return _0x3c1996['removeFaxInteractions'](_0xf369c6)[_0x27d0('0xc')](function(){for(var _0x4aa9eb=0x0;_0x4aa9eb<_0xf369c6['length'];_0x4aa9eb+=0x1){_0x2b9d8a['emit'](_0x27d0('0x44'),{'FaxInteractionId':Number(_0xf369c6[_0x4aa9eb]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0x495d84=_['map'](_0x3c1996[_0x27d0('0x25')],'id');return _0x3c1996[_0x27d0('0x45')](_0x495d84)[_0x27d0('0xc')](function(){for(var _0x4e8ad1=0x0;_0x4e8ad1<_0x495d84[_0x27d0('0x37')];_0x4e8ad1+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x46'),{'SmsInteractionId':Number(_0x495d84[_0x4e8ad1]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0xc')](function(){if(_0x435fd5===_0x27d0('0x3e')){var _0x5ecd5f=_[_0x27d0('0x18')](_0x3c1996['OpenchannelInteractions'],'id');return _0x3c1996[_0x27d0('0x47')](_0x5ecd5f)[_0x27d0('0xc')](function(){for(var _0x1cea5b=0x0;_0x1cea5b<_0x5ecd5f['length'];_0x1cea5b+=0x1){_0x2b9d8a[_0x27d0('0x40')](_0x27d0('0x48'),{'OpenchannelInteractionId':Number(_0x5ecd5f[_0x1cea5b]),'UserId':Number(_0x3c1996['id'])});}});}})[_0x27d0('0x49')](function(_0x39302c){_0x442d76[_0x27d0('0x4a')](_0x39302c);});}}function onDisconnect(_0x2417f7,_0x49935f){joinOrLeave(_0x2417f7,'leave',_0x49935f);}function onConnect(_0x4e576e){joinOrLeave(_0x4e576e,_0x27d0('0x4b'));}exports[_0x27d0('0x4c')]=function(_0x7bd322){_0x7bd322['on'](_0x27d0('0x4d'),function(_0x470211){_0x470211[_0x27d0('0x4e')](0x0);_0x470211['address']=_0x470211[_0x27d0('0x4f')][_0x27d0('0x4d')][_0x27d0('0x50')]+':'+_0x470211[_0x27d0('0x4f')]['connection'][_0x27d0('0x51')];_0x470211['connectedAt']=new Date();_0x470211['log']=function(_0x3063d6){console[_0x27d0('0x4a')]('SocketIO\x20'+_0x470211[_0x27d0('0x52')][_0x27d0('0x5')]+'['+_0x470211[_0x27d0('0x53')]+']',_0x3063d6);};_0x470211['on'](_0x27d0('0x54'),function(){onDisconnect(_0x470211,_0x7bd322);_0x470211[_0x27d0('0x4a')]('DISCONNECTED');});onConnect(_0x470211);_0x470211[_0x27d0('0x4a')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a1741eb..2419a21 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 _0xd19f=['Mail','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','Trigger,\x20%s','error','catch','event','direction','UserId','User','find','name','format','channel','incomingmessage','outgoingmessage','get','opened','closed','SIP/%s','default','length','hasOwnProperty','model','hook','toLowerCase','condition','util','jayson/promise','../logger','triggers','client','http','Chat','afterCreate','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','newinteraction','Sms','SmsMessage','Fax','FaxInteraction','FaxMessage'];(function(_0x84ce83,_0x98461d){var _0x4490be=function(_0x3a9a69){while(--_0x3a9a69){_0x84ce83['push'](_0x84ce83['shift']());}};_0x4490be(++_0x98461d);}(_0xd19f,0x82));var _0xfd19=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xd19f[_0x2bfe52];return _0x1cf649;};'use strict';var util=require(_0xfd19('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xfd19('0x1'));var logger=require(_0xfd19('0x2'))(_0xfd19('0x3'));var client=jayson[_0xfd19('0x4')][_0xfd19('0x5')]({'port':0x232a});var triggers=[{'channel':_0xfd19('0x6'),'model':'ChatInteraction','event':_0xfd19('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0xfd19('0x8'),'event':_0xfd19('0x9'),'condition':_0xfd19('0xa'),'callback':afterUpdate},{'channel':'Chat','model':_0xfd19('0xb'),'event':_0xfd19('0x7'),'condition':_0xfd19('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xfd19('0xd'),'event':_0xfd19('0x7'),'condition':_0xfd19('0xe'),'callback':afterCreate},{'channel':_0xfd19('0xf'),'model':_0xfd19('0xd'),'event':_0xfd19('0x9'),'condition':_0xfd19('0xa'),'callback':afterUpdate},{'channel':_0xfd19('0xf'),'model':_0xfd19('0x10'),'event':'afterCreate','condition':_0xfd19('0xc'),'callback':afterCreateMessage},{'channel':_0xfd19('0x11'),'model':_0xfd19('0x12'),'event':_0xfd19('0x7'),'condition':_0xfd19('0xe'),'callback':afterCreate},{'channel':_0xfd19('0x11'),'model':_0xfd19('0x12'),'event':_0xfd19('0x9'),'condition':_0xfd19('0xa'),'callback':afterUpdate},{'channel':_0xfd19('0x11'),'model':_0xfd19('0x13'),'event':_0xfd19('0x7'),'condition':_0xfd19('0xc'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0xfd19('0x7'),'condition':_0xfd19('0xe'),'callback':afterCreate},{'channel':'Mail','model':'MailInteraction','event':_0xfd19('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xfd19('0x14'),'model':'MailMessage','event':_0xfd19('0x7'),'condition':_0xfd19('0xc'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0xfd19('0x15'),'event':_0xfd19('0x7'),'condition':_0xfd19('0xe'),'callback':afterCreate},{'channel':_0xfd19('0x16'),'model':_0xfd19('0x15'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xfd19('0x16'),'model':_0xfd19('0x17'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x43ea56){return client['request'](_0xfd19('0x18'),_0x43ea56)[_0xfd19('0x19')](function(_0x5422c1){logger['info'](_0xfd19('0x1a'),'EventManager',_0x5422c1);if(_0x5422c1[_0xfd19('0x1b')]){if(_0x5422c1[_0xfd19('0x1b')]['code']===0x1f4){logger[_0xfd19('0x1b')](_0xfd19('0x1a'),'EventManager',_0x5422c1[_0xfd19('0x1b')]);}}})[_0xfd19('0x1c')](function(_0x19660){logger[_0xfd19('0x1b')](_0xfd19('0x1a'),_0xfd19('0x18'),_0x19660);});}function afterCreateMessage(_0xafa7be,_0x3d494c){return function(_0x3a4b7c,_0x192fa3){_0x3a4b7c=_0x3a4b7c['get']({'plain':!![]});_0x3a4b7c['channel']=_0xafa7be;_0x3a4b7c[_0xfd19('0x1d')]=_0x3a4b7c[_0xfd19('0x1e')];if(_0x3a4b7c[_0xfd19('0x1f')]){return db[_0xfd19('0x20')][_0xfd19('0x21')]({'where':{'id':_0x3a4b7c['UserId']},'attributes':['id',_0xfd19('0x22')],'raw':!![]})['then'](function(_0x2ad3ab){_0x3a4b7c['interface']=util[_0xfd19('0x23')]('SIP/%s',_0x2ad3ab[_0xfd19('0x22')]);_0x3a4b7c[_0xfd19('0x24')]=_0xafa7be;return request({'event':_0xfd19('0x25'),'message':_0x3a4b7c});})['catch'](function(_0x12aa29){console[_0xfd19('0x1b')](_0x12aa29);});}else{return request({'event':_0xfd19('0x26'),'message':_0x3a4b7c});}};}function afterCreate(_0xf78851,_0x2de677){return function(_0x2ed478,_0x126dc9){_0x2ed478=_0x2ed478[_0xfd19('0x27')]({'plain':!![]});_0x2ed478[_0xfd19('0x24')]=_0xf78851;_0x2ed478['event']=_0xfd19('0x28');return request({'event':_0x2de677,'message':_0x2ed478});};}function afterUpdate(_0x56b518,_0x1402cf){return function(_0x11ea94,_0x31fff4){if(_0x11ea94['changed'](_0xfd19('0x29'))&&_0x11ea94['closed']){_0x11ea94=_0x11ea94[_0xfd19('0x27')]({'plain':!![]});_0x11ea94['channel']=_0x56b518;_0x11ea94[_0xfd19('0x1d')]=_0xfd19('0x29');if(_0x11ea94['UserId']){return db[_0xfd19('0x20')][_0xfd19('0x21')]({'where':{'id':_0x11ea94[_0xfd19('0x1f')]},'attributes':['id',_0xfd19('0x22')],'raw':!![]})['then'](function(_0x277935){_0x11ea94['interface']=util[_0xfd19('0x23')](_0xfd19('0x2a'),_0x277935[_0xfd19('0x22')]);return request({'event':_0x1402cf,'message':_0x11ea94});})[_0xfd19('0x1c')](function(_0xbe93f2){console[_0xfd19('0x1b')](_0xbe93f2);});}else{return request({'event':_0x1402cf,'message':_0x11ea94});}}};}exports[_0xfd19('0x2b')]=function(){for(var _0x1a64d1=0x0;_0x1a64d10x3){var _0x3a3033=/\((.+)\)/;var _0x404e8c=_0x1862de['rx']['match'](_0x3a3033);if(_0x404e8c){_0x4903de=_0x404e8c[0x1];}else{_0x4903de=null;}}else{_0x4903de=null;}_0x1862de['cb'](null,{'code':_0x655658,'result':_0x4cb803,'extra':_0x4903de});}});_0x4950d5['on'](_0x6215('0x15'),function(_0x223944){_0x1951eb[_0x6215('0xa')](_0x6215('0x15'),new AGIError(_0x6215('0x16'),_0x223944[_0x6215('0x17')]));});_0x4950d5['on'](_0x6215('0x18'),function(){_0x1951eb[_0x6215('0xa')](_0x6215('0x18'),new AGIError(_0x6215('0x19')));});_0x4950d5['on'](_0x6215('0x1a'),function(){_0x1951eb['emit'](_0x6215('0x1a'),new AGIError(_0x6215('0x1b')));_0x4950d5['destroy']();});_0x4950d5['pipe'](_0x169e2f);this['command']=function(_0xa5c0b3,_0x15e14e){var _0xa5c0b3=_0xa5c0b3||'',_0x15e14e=typeof _0x15e14e=='function'?_0x15e14e:new Function();_0x1862de={'tx':_0xa5c0b3,'rx':'','cb':_0x15e14e};_0x4950d5[_0x6215('0x1c')](_0xa5c0b3+'\x0a');},this[_0x6215('0x18')]=function(){_0x4950d5[_0x6215('0x1d')]();};}util[_0x6215('0x1e')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x6215('0x1f')]=function(_0x1ead8c){return this['command']['sync'](this,_0x1ead8c);};AGIChannel[_0x6215('0x20')][_0x6215('0x21')]=function(){return this['sendRequest'](_0x6215('0x22'));};AGIChannel[_0x6215('0x20')][_0x6215('0x23')]=function(_0x190610,_0x1b6f2a,_0x35146c){_0x190610=_0x190610===undefined?'beep':_0x190610;_0x1b6f2a=_0x1b6f2a===undefined?'5':_0x1b6f2a;_0x35146c=_0x35146c===undefined?'1':_0x35146c;return this[_0x6215('0x1f')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x190610,_0x1b6f2a*0x3e8,_0x35146c));};AGIChannel['prototype']['noop']=function(_0x2a13e7){_0x2a13e7=_0x2a13e7||_0x6215('0x24');return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x26'),_0x2a13e7));};AGIChannel[_0x6215('0x20')][_0x6215('0x27')]=function(_0x3a673d,_0x5246c2){if(_[_0x6215('0x28')](_0x5246c2)){return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x29'),_0x3a673d,_0x5246c2[_0x6215('0x2a')](',')));}return this['sendRequest'](util[_0x6215('0x25')](_0x6215('0x29'),_0x3a673d,_0x5246c2));};AGIChannel[_0x6215('0x20')][_0x6215('0x2b')]=function(_0x149bc2){return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x2c'),_0x149bc2));};AGIChannel[_0x6215('0x20')][_0x6215('0x2d')]=function(_0x2cae06){return this[_0x6215('0x1f')](util['format']('SET\x20EXTENSION\x20%s',_0x2cae06));};AGIChannel[_0x6215('0x20')][_0x6215('0x2e')]=function(_0x57cdf1){return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x2f'),_0x57cdf1));};AGIChannel[_0x6215('0x20')][_0x6215('0xc')]=function(){return this['sendRequest'](_0x6215('0x30'));};AGIChannel['prototype'][_0x6215('0x31')]=function(_0x25aab2,_0x192b1b){return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x32'),_0x25aab2,_0x192b1b?_0x192b1b[_0x6215('0x33')]()[_0x6215('0x34')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6215('0x20')][_0x6215('0x35')]=function(_0x306e27,_0x163764){return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x36'),_0x306e27,_0x163764));};AGIChannel[_0x6215('0x20')][_0x6215('0x37')]=function(_0x1ffb6d,_0x538939){return this['sendRequest'](util[_0x6215('0x25')](_0x6215('0x38'),_0x1ffb6d,_0x538939));};AGIChannel[_0x6215('0x20')][_0x6215('0x39')]=function(_0x37b17a,_0x37dcdd){return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x3a'),_0x37b17a,_0x37dcdd));};AGIChannel[_0x6215('0x20')][_0x6215('0x3b')]=function(_0x3b2173,_0x35198a,_0x5881a3){_0x35198a=_0x35198a||this['extension'];_0x5881a3=_0x5881a3||0x1;this['setContext'](_0x3b2173);this[_0x6215('0x2d')](_0x35198a);this['setPriority'](_0x5881a3);return this[_0x6215('0x3c')](util[_0x6215('0x25')](_0x6215('0x3d'),_0x3b2173,_0x35198a,_0x5881a3));};AGIChannel[_0x6215('0x20')][_0x6215('0x3e')]=function(_0xca856c){return this[_0x6215('0x1f')](util['format'](_0x6215('0x3f'),_0xca856c));};AGIChannel['prototype'][_0x6215('0x40')]=function(_0x1bab66,_0x1e81df,_0x87ac3f,_0x307fe6,_0x40f020,_0x285f2b){_0x1e81df=_0x1e81df||'wav';_0x87ac3f=_0x87ac3f||'';_0x307fe6=_0x307fe6===undefined?-0x1:_0x307fe6==='-1'?-0x1:_0x307fe6*0x3e8;_0x40f020=_0x40f020===undefined?'':'s='+_0x40f020;_0x285f2b=_0x285f2b?_0x6215('0x41'):'';return this[_0x6215('0x1f')](util[_0x6215('0x25')](_0x6215('0x42'),_0x1bab66,_0x1e81df,_0x87ac3f,_0x307fe6,_0x285f2b,_0x40f020));};AGIChannel[_0x6215('0x20')][_0x6215('0x43')]=function(_0x22f9fc,_0x2d4e0e){_0x2d4e0e=_0x2d4e0e||'';return this[_0x6215('0x1f')](util['format'](_0x6215('0x44'),_0x22f9fc,_0x2d4e0e));};AGIChannel[_0x6215('0x20')][_0x6215('0x45')]=function(_0x550954){return this[_0x6215('0x27')](_0x6215('0x46'),_0x550954);};AGIChannel[_0x6215('0x20')]['wait']=function(_0xc9975b){return this[_0x6215('0x27')](_0x6215('0x47'),_0xc9975b);};AGIChannel[_0x6215('0x20')][_0x6215('0x15')]=function(_0x3b155d,_0x229026){this[_0x6215('0x3c')](util[_0x6215('0x25')](_0x6215('0x48'),_0x3b155d['id'],_0x3b155d[_0x6215('0x49')],_0x229026));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x6215('0x4a')]=AGIChannel; \ No newline at end of file +var _0x666f=['timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','answer','ANSWER','getData','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','isArray','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','noop','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','EventEmitter','./reply','./error','utf8','setEncoding','headers','line','toLowerCase','hangup','emit','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close'];(function(_0x17c283,_0x587fcc){var _0x4e0800=function(_0x537bc3){while(--_0x537bc3){_0x17c283['push'](_0x17c283['shift']());}};_0x4e0800(++_0x587fcc);}(_0x666f,0x110));var _0xf666=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x666f[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0xf666('0x0'));var _=require(_0xf666('0x1'));var EventEmitter=require('events')[_0xf666('0x2')];var AGIReply=require(_0xf666('0x3'));var AGIError=require(_0xf666('0x4'));function AGIChannel(_0x4e77c8){var _0x388043=this,_0x51335b=new AGIReply(),_0x10e0b2=![],_0x1b5168={};EventEmitter['call'](_0x388043);_0x4e77c8['setEncoding'](_0xf666('0x5'));_0x4e77c8['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x51335b[_0xf666('0x6')](_0xf666('0x5'));_0x51335b['on'](_0xf666('0x7'),function(_0x46e1b1){for(var _0x415226 in _0x46e1b1){_0x388043[_0x415226]=_0x46e1b1[_0x415226];}_0x388043['emit']('ready');});_0x51335b['on'](_0xf666('0x8'),function(_0x58d908){if(_0x58d908[_0xf666('0x9')]()==_0xf666('0xa')){_0x388043[_0xf666('0xb')](_0xf666('0xa'));return;}if(_0x58d908[_0xf666('0xc')](0x0,0xb)=='520-Invalid'){_0x10e0b2=!![];}if(_0x10e0b2){_0x1b5168['rx']+=_0x58d908+'\x0a';if(_0x58d908[_0xf666('0xd')](_0xf666('0xe'))!=-0x1){_0x10e0b2=![];}}else{_0x1b5168['rx']=_0x58d908;}if(_0x10e0b2){return;}if(typeof _0x1b5168['cb']==_0xf666('0xf')){var _0x44004c=_0x1b5168['rx'][_0xf666('0xc')](0x0,0x3),_0x425a58=null,_0x90f203=null;_0x44004c=parseInt(_0x44004c);if(isNaN(_0x44004c)){_0x1b5168['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf666('0x10')});return;}if(_0x44004c!=0xc8){_0x1b5168['cb'](null,{'code':_0x44004c,'result':-0x1,'extra':'KO'});return;}_0x425a58=_0x1b5168['rx'][_0xf666('0xc')](0x4)[_0xf666('0x11')](_0xf666('0x12'),'');if(_0x425a58['indexOf']('\x20')!=-0x1){_0x425a58=_0x425a58['substr'](0x0,_0x425a58[_0xf666('0x13')]('\x20'));}if(_[_0xf666('0x14')](_0x425a58,'-1')){_0x425a58=parseInt(_0x425a58);}_0x90f203=_0x1b5168['rx'][_0xf666('0x15')]('\x20');if(_0x90f203[_0xf666('0x16')]==0x3){_0x90f203=_0x90f203[0x2]['substring'](0x1,_0x90f203[0x2]['length']-0x1);}else if(_0x90f203['length']>0x3){var _0x469c10=/\((.+)\)/;var _0x227801=_0x1b5168['rx'][_0xf666('0x17')](_0x469c10);if(_0x227801){_0x90f203=_0x227801[0x1];}else{_0x90f203=null;}}else{_0x90f203=null;}_0x1b5168['cb'](null,{'code':_0x44004c,'result':_0x425a58,'extra':_0x90f203});}});_0x4e77c8['on']('error',function(_0x99c68c){_0x388043[_0xf666('0xb')](_0xf666('0x18'),new AGIError(_0xf666('0x19'),_0x99c68c[_0xf666('0x1a')]));});_0x4e77c8['on'](_0xf666('0x1b'),function(){_0x388043[_0xf666('0xb')]('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4e77c8['on'](_0xf666('0x1c'),function(){_0x388043[_0xf666('0xb')](_0xf666('0x1c'),new AGIError(_0xf666('0x1d')));_0x4e77c8[_0xf666('0x1e')]();});_0x4e77c8[_0xf666('0x1f')](_0x51335b);this[_0xf666('0x20')]=function(_0x440c2d,_0x458997){var _0x440c2d=_0x440c2d||'',_0x458997=typeof _0x458997==_0xf666('0xf')?_0x458997:new Function();_0x1b5168={'tx':_0x440c2d,'rx':'','cb':_0x458997};_0x4e77c8[_0xf666('0x21')](_0x440c2d+'\x0a');},this[_0xf666('0x1b')]=function(){_0x4e77c8[_0xf666('0x1e')]();};}util[_0xf666('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xf666('0x23')][_0xf666('0x24')]=function(_0x16813c){return this[_0xf666('0x20')]['sync'](this,_0x16813c);};AGIChannel[_0xf666('0x23')][_0xf666('0x25')]=function(){return this[_0xf666('0x24')](_0xf666('0x26'));};AGIChannel[_0xf666('0x23')][_0xf666('0x27')]=function(_0x2fc656,_0x1f5cca,_0x522618){_0x2fc656=_0x2fc656===undefined?'beep':_0x2fc656;_0x1f5cca=_0x1f5cca===undefined?'5':_0x1f5cca;_0x522618=_0x522618===undefined?'1':_0x522618;return this[_0xf666('0x24')](util[_0xf666('0x28')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2fc656,_0x1f5cca*0x3e8,_0x522618));};AGIChannel[_0xf666('0x23')]['noop']=function(_0x1a05b9){_0x1a05b9=_0x1a05b9||_0xf666('0x29');return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x2a'),_0x1a05b9));};AGIChannel[_0xf666('0x23')]['exec']=function(_0x53b02c,_0x38a125){if(_[_0xf666('0x2b')](_0x38a125)){return this[_0xf666('0x24')](util[_0xf666('0x28')]('EXEC\x20%s\x20%s',_0x53b02c,_0x38a125[_0xf666('0x2c')](',')));}return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x2d'),_0x53b02c,_0x38a125));};AGIChannel[_0xf666('0x23')][_0xf666('0x2e')]=function(_0x1e3a6f){return this[_0xf666('0x24')](util['format']('SET\x20CONTEXT\x20%s',_0x1e3a6f));};AGIChannel[_0xf666('0x23')][_0xf666('0x2f')]=function(_0x16e323){return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x30'),_0x16e323));};AGIChannel[_0xf666('0x23')][_0xf666('0x31')]=function(_0xa8f5b){return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x32'),_0xa8f5b));};AGIChannel['prototype'][_0xf666('0xa')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0xf666('0x23')][_0xf666('0x33')]=function(_0x5b64d2,_0x15f703){return this[_0xf666('0x24')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x5b64d2,_0x15f703?_0x15f703[_0xf666('0x34')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xf666('0x35')]=function(_0x13ff99,_0x5416c1){return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x36'),_0x13ff99,_0x5416c1));};AGIChannel[_0xf666('0x23')][_0xf666('0x37')]=function(_0x2cf9c8,_0x4c142a){return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x38'),_0x2cf9c8,_0x4c142a));};AGIChannel[_0xf666('0x23')]['sayPhonetic']=function(_0x2a40b9,_0x53cfc8){return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x39'),_0x2a40b9,_0x53cfc8));};AGIChannel['prototype'][_0xf666('0x3a')]=function(_0xc7190d,_0x5858a6,_0x3d0e34){_0x5858a6=_0x5858a6||this[_0xf666('0x3b')];_0x3d0e34=_0x3d0e34||0x1;this['setContext'](_0xc7190d);this[_0xf666('0x2f')](_0x5858a6);this[_0xf666('0x31')](_0x3d0e34);return this[_0xf666('0x3c')](util[_0xf666('0x28')]('GOTO\x20%s\x20%s\x20%s',_0xc7190d,_0x5858a6,_0x3d0e34));};AGIChannel['prototype']['getVariable']=function(_0x449801){return this['sendRequest'](util[_0xf666('0x28')](_0xf666('0x3d'),_0x449801));};AGIChannel['prototype']['recordFile']=function(_0x325060,_0x5475b9,_0x2979b3,_0x3b7465,_0x1984ab,_0x286140){_0x5475b9=_0x5475b9||_0xf666('0x3e');_0x2979b3=_0x2979b3||'';_0x3b7465=_0x3b7465===undefined?-0x1:_0x3b7465==='-1'?-0x1:_0x3b7465*0x3e8;_0x1984ab=_0x1984ab===undefined?'':'s='+_0x1984ab;_0x286140=_0x286140?_0xf666('0x3f'):'';return this[_0xf666('0x24')](util['format'](_0xf666('0x40'),_0x325060,_0x5475b9,_0x2979b3,_0x3b7465,_0x286140,_0x1984ab));};AGIChannel[_0xf666('0x23')][_0xf666('0x41')]=function(_0x3618a6,_0x3121fe){_0x3121fe=_0x3121fe||'';return this[_0xf666('0x24')](util[_0xf666('0x28')](_0xf666('0x42'),_0x3618a6,_0x3121fe));};AGIChannel[_0xf666('0x23')][_0xf666('0x43')]=function(_0x45420b){return this[_0xf666('0x44')](_0xf666('0x45'),_0x45420b);};AGIChannel[_0xf666('0x23')][_0xf666('0x46')]=function(_0x1819b0){return this[_0xf666('0x44')](_0xf666('0x47'),_0x1819b0);};AGIChannel[_0xf666('0x23')][_0xf666('0x18')]=function(_0x4db29d,_0x5920d2){this[_0xf666('0x3c')](util['format'](_0xf666('0x48'),_0x4db29d['id'],_0x4db29d[_0xf666('0x49')],_0x5920d2));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf666('0x4a')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 4697035..5582ad2 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 _0x6a0b=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports','util'];(function(_0x5139e8,_0x5a6829){var _0x19517a=function(_0x22ad3c){while(--_0x22ad3c){_0x5139e8['push'](_0x5139e8['shift']());}};_0x19517a(++_0x5a6829);}(_0x6a0b,0x77));var _0xb6a0=function(_0x2339d5,_0x384e55){_0x2339d5=_0x2339d5-0x0;var _0x453059=_0x6a0b[_0x2339d5];return _0x453059;};'use strict';var util=require(_0xb6a0('0x0'));var error={'E_AGI_UNDEFINED':_0xb6a0('0x1'),'E_AGI_ARGUMENT_PORT':_0xb6a0('0x2'),'E_AGI_SERVER_ERROR':_0xb6a0('0x3'),'E_AGI_SERVER_CLOSE':_0xb6a0('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xb6a0('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xb6a0('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xb6a0('0x7'),'E_AGI_IVR_ENTRY':_0xb6a0('0x8')};function AGIError(_0x72ca8f){var _0x72ca8f=_0x72ca8f||null,_0x19922a=_0x19922a||[],_0x438b97=0x1,_0x1df28a='';if(!error[_0x72ca8f]){_0x72ca8f='E_AGI_UNDEFINED';}_0x19922a[_0xb6a0('0x9')](error[_0x72ca8f]);while(arguments[_0x438b97]){_0x19922a[_0xb6a0('0x9')](arguments[_0x438b97]);_0x438b97++;}_0x1df28a=util[_0xb6a0('0xa')][_0xb6a0('0xb')](util,_0x19922a);this[_0xb6a0('0xc')]=_0x1df28a;this[_0xb6a0('0xd')]=_0x72ca8f;}module[_0xb6a0('0xe')]=AGIError; \ No newline at end of file +var _0xcc4e=['Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.'];(function(_0x2db6e3,_0x38cbae){var _0x267caf=function(_0x367275){while(--_0x367275){_0x2db6e3['push'](_0x2db6e3['shift']());}};_0x267caf(++_0x38cbae);}(_0xcc4e,0x64));var _0xecc4=function(_0x1a90fc,_0x1f232f){_0x1a90fc=_0x1a90fc-0x0;var _0x48c470=_0xcc4e[_0x1a90fc];return _0x48c470;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xecc4('0x0'),'E_AGI_ARGUMENT_PORT':_0xecc4('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xecc4('0x2'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xecc4('0x3'),'E_AGI_SOCKET_ERROR':_0xecc4('0x4'),'E_AGI_SOCKET_CLOSE':_0xecc4('0x5'),'E_AGI_SOCKET_TIMEOUT':_0xecc4('0x6'),'E_AGI_COMMAND_EMPTY':_0xecc4('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xecc4('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x44437a){var _0x44437a=_0x44437a||null,_0x1a0d9f=_0x1a0d9f||[],_0xc7f965=0x1,_0x545693='';if(!error[_0x44437a]){_0x44437a=_0xecc4('0x9');}_0x1a0d9f['push'](error[_0x44437a]);while(arguments[_0xc7f965]){_0x1a0d9f[_0xecc4('0xa')](arguments[_0xc7f965]);_0xc7f965++;}_0x545693=util[_0xecc4('0xb')][_0xecc4('0xc')](util,_0x1a0d9f);this['message']=_0x545693;this[_0xecc4('0xd')]=_0x44437a;}module[_0xecc4('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 49d1e64..84a3695 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 _0x8603=['split','agicommand','vswitch','target','default','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition'];(function(_0x121da4,_0x2d715a){var _0x381cb4=function(_0x23627d){while(--_0x23627d){_0x121da4['push'](_0x121da4['shift']());}};_0x381cb4(++_0x2d715a);}(_0x8603,0x190));var _0x3860=function(_0x30ae4b,_0x552f2e){_0x30ae4b=_0x30ae4b-0x0;var _0x53e6a3=_0x8603[_0x30ae4b];return _0x53e6a3;};'use strict';var _=require('lodash');var logger=require(_0x3860('0x0'))(_0x3860('0x1'));var verticesWithRetry=[_0x3860('0x2'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x3860('0x3')]={};this[_0x3860('0x4')]={};this[_0x3860('0x5')]=0x0;};Graph['prototype'][_0x3860('0x6')]=function(_0x56f8c5){this[_0x3860('0x3')][_0x56f8c5['id']]=_0x56f8c5;this[_0x3860('0x4')][_0x56f8c5['id']]=[];};Graph[_0x3860('0x7')][_0x3860('0x8')]=function(_0x472bf2,_0x4aba10,_0x5c7350){this['edges'][_0x472bf2][_0x3860('0x9')]({'target':_0x4aba10,'condition':_0x5c7350});this[_0x3860('0x5')]+=0x1;};Graph['prototype'][_0x3860('0xa')]=function(){return _[_0x3860('0xa')](this['vertices']);};Graph[_0x3860('0x7')][_0x3860('0xb')]=function(){return this['numberOfEdges'];};Graph[_0x3860('0x7')][_0x3860('0xc')]=function(_0x4c6a45){return this[_0x3860('0x3')][_0x4c6a45];};Graph[_0x3860('0x7')][_0x3860('0xd')]=function(_0x1ea619,_0x3f3630){if(!this[_0x3860('0x3')][_0x1ea619]){return logger[_0x3860('0xe')](_0x3860('0xf'));}var _0x465d8d=_0x3f3630(this[_0x3860('0x3')][_0x1ea619]);if(!_0x465d8d){return logger['info'](_0x3860('0x10'));}if(this[_0x3860('0x4')][_0x1ea619][_0x3860('0x11')]===0x0){return logger[_0x3860('0xe')](_0x3860('0x12'));}for(var _0xfa0c9a=0x0,_0x2d8a3a=[],_0x378305=![];_0xfa0c9a\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','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]','./server','listening','xml2json','syncho','../../config/environment','../../config/logger','agi','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[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','uniqueid','evtHangup','toJson','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','debug','variables','stringify','close','timeout','hangup','production','start','root','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','context','extension','priority','response','result','isUndefined'];(function(_0x5c25d4,_0x538e58){var _0x504711=function(_0x1fa123){while(--_0x1fa123){_0x5c25d4['push'](_0x5c25d4['shift']());}};_0x504711(++_0x538e58);}(_0xec16,0x120));var _0x6ec1=function(_0x315b6c,_0x2ac37f){_0x315b6c=_0x315b6c-0x0;var _0x94dc8=_0xec16[_0x315b6c];return _0x94dc8;};'use strict';var parser=require(_0x6ec1('0x0'));var _=require('lodash');var syncho=require(_0x6ec1('0x1'));var util=require('util');var moment=require('moment');var config=require(_0x6ec1('0x2'));var logger=require(_0x6ec1('0x3'))(_0x6ec1('0x4'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0x6ec1('0x5'));var Vertices=require(_0x6ec1('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x6ec1('0x4')]=_[_0x6ec1('0x7')](config['agi'],{'ip':_0x6ec1('0x8'),'port':0x11dd});function connectionHandler(_0x5c7449){process[_0x6ec1('0x9')](function(){syncho(function(){try{setChannelVariables(_0x5c7449);agiHandler(_0x5c7449);}catch(_0x17274a){logger[_0x6ec1('0xa')](_0x17274a[_0x6ec1('0xb')]);}});});}function listeningHandler(){console['log'](_0x6ec1('0xc'),config[_0x6ec1('0x4')]['port']);logger[_0x6ec1('0xd')](util[_0x6ec1('0xe')](_0x6ec1('0xf'),config['agi']['ip'],config[_0x6ec1('0x4')][_0x6ec1('0x10')]));}function errorHandler(_0x54f602){if(_0x54f602&&_0x54f602[_0x6ec1('0x11')]&&_0x54f602[_0x6ec1('0x12')]){logger[_0x6ec1('0xa')](util[_0x6ec1('0xe')](_0x6ec1('0x13'),_0x54f602[_0x6ec1('0x11')],_0x54f602[_0x6ec1('0x12')]));}else{logger[_0x6ec1('0xa')](util[_0x6ec1('0xe')](_0x6ec1('0x14'),_0x54f602[_0x6ec1('0xb')]));}}function closeHandler(){logger[_0x6ec1('0xd')](util['format'](_0x6ec1('0x15'),this[_0x6ec1('0x16')],this[_0x6ec1('0x17')],this[_0x6ec1('0x18')],this[_0x6ec1('0x19')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2d8654){logger[_0x6ec1('0xa')](_0x2d8654['stack']);}}function timeoutHandler(){logger[_0x6ec1('0xd')](util[_0x6ec1('0xe')](_0x6ec1('0x1a'),this[_0x6ec1('0x16')],this[_0x6ec1('0x17')],this[_0x6ec1('0x18')],this[_0x6ec1('0x19')],this['uniqueid']));}function hangupHandler(){logger[_0x6ec1('0xd')](util['format'](_0x6ec1('0x1b'),this[_0x6ec1('0x16')],this[_0x6ec1('0x17')],this[_0x6ec1('0x18')],this[_0x6ec1('0x19')],this[_0x6ec1('0x1c')]));this[_0x6ec1('0x1d')]=!![];}function getRoot(_0x540926){return parser[_0x6ec1('0x1e')](_0x540926,{'object':!![]})[_0x6ec1('0x1f')]['root'];}function addVertex(_0x1d7f2f,_0x538eef,_0x596aa6){_0x538eef[_0x6ec1('0x20')]=_0x596aa6;if(_0x538eef[_0x6ec1('0x21')](_0x6ec1('0x22'))){_0x538eef[_0x6ec1('0x23')]=parseInt(_0x538eef[_0x6ec1('0x22')],0xa);}_0x1d7f2f[_0x6ec1('0x24')](_[_0x6ec1('0x25')](_0x538eef,_0x6ec1('0x26')));}function initGraph(_0x15b57c,_0x1f37ff){var _0x4a6d9c=new Graph();for(var _0x4d6ed9 in _0x15b57c){if(_0x15b57c[_0x6ec1('0x21')](_0x4d6ed9)){if(_[_0x6ec1('0x27')](_0x15b57c[_0x4d6ed9])){for(var _0x6be085=0x0;_0x6be085<_0x15b57c[_0x4d6ed9][_0x6ec1('0x28')];_0x6be085+=0x1){addVertex(_0x4a6d9c,_0x15b57c[_0x4d6ed9][_0x6be085],_0x4d6ed9);}}else{addVertex(_0x4a6d9c,_0x15b57c[_0x4d6ed9],_0x4d6ed9);}}}for(var _0x88cc42=0x0;_0x88cc42<_0x1f37ff[_0x6ec1('0x28')];_0x88cc42+=0x1){if(_0x1f37ff[_0x88cc42][_0x6ec1('0x29')]&&_0x1f37ff[_0x88cc42][_0x6ec1('0x2a')]){_0x4a6d9c[_0x6ec1('0x2b')](_0x1f37ff[_0x88cc42][_0x6ec1('0x29')],_0x1f37ff[_0x88cc42][_0x6ec1('0x2a')],_0x1f37ff[_0x88cc42][_0x6ec1('0x2c')]);}}return _0x4a6d9c;}function getSquareProject(_0x58e8da,_0x562aae){rpc[_0x6ec1('0x2d')](_0x58e8da)[_0x6ec1('0x2e')](function(_0xb35347){_0x562aae(null,_0xb35347);})[_0x6ec1('0x2f')](function(_0x3425cf){_0x562aae(null,_0x3425cf);});}function createSquareReport(_0x5864d9,_0x2e88ab){rpc[_0x6ec1('0x30')](_0x5864d9)[_0x6ec1('0x2e')](function(_0x37d392){if(_0x2e88ab){_0x2e88ab(null,_0x37d392);}})[_0x6ec1('0x2f')](function(_0x190dc5){if(_0x2e88ab){_0x2e88ab(null,_0x190dc5);}});}function setChannelVariables(_0x374236){for(var _0x283325 in _0x374236){if(_0x374236['hasOwnProperty'](_0x283325)){if(_0x283325[_0x6ec1('0x31')](_0x6ec1('0x32'))===0x0){_0x374236[_0x283325[_0x6ec1('0x33')](0x4)]=_0x374236[_0x283325];delete _0x374236[_0x283325];}}}}function getLogFromObject(_0x58a7f1){return util['inspect'](_0x58a7f1,{'showHidden':![],'depth':null});}function agiHandler(_0x405f8c){var _0x1fb7fa,_0x58107d,_0x5b8a89,_0x5074ef,_0x365618;logger[_0x6ec1('0x34')](_0x6ec1('0x35'),JSON[_0x6ec1('0x36')](_0x405f8c,null,0x2));logger[_0x6ec1('0xd')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x405f8c[_0x6ec1('0x16')],_0x405f8c['calleridname'],_0x405f8c[_0x6ec1('0x18')],_0x405f8c['dnid'],_0x405f8c[_0x6ec1('0x1c')]));_0x405f8c['on'](_0x6ec1('0xa'),errorHandler);_0x405f8c['on'](_0x6ec1('0x37'),closeHandler);_0x405f8c['on'](_0x6ec1('0x38'),timeoutHandler);_0x405f8c['evtHangup']=![];_0x405f8c['on'](_0x6ec1('0x39'),hangupHandler);var _0x53587f=getSquareProject['sync'](null,_0x405f8c[_0x6ec1('0x16')]);if(_0x53587f){if(_0x53587f[_0x6ec1('0x3a')]){_0x1fb7fa=getRoot(_0x53587f[_0x6ec1('0x3a')]);if(_0x1fb7fa&&_0x1fb7fa[_0x6ec1('0x3b')]){logger[_0x6ec1('0x34')](_0x6ec1('0x3c'),JSON[_0x6ec1('0x36')](_0x1fb7fa,null,0x2));_0x405f8c[_0x6ec1('0x3d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x58107d=initGraph(_[_0x6ec1('0x25')](_0x1fb7fa,_0x6ec1('0x26')),_0x1fb7fa[_0x6ec1('0x26')]);_0x5b8a89=new Vertices(_0x405f8c,rpc,mailRpc);logger['info'](util[_0x6ec1('0xe')](_0x6ec1('0x3e'),_0x405f8c[_0x6ec1('0x16')],_0x405f8c['calleridname'],_0x405f8c[_0x6ec1('0x18')],_0x405f8c[_0x6ec1('0x19')],_0x405f8c['uniqueid']));_0x58107d[_0x6ec1('0x3f')](_0x1fb7fa['start']['id'],function(_0xd8bda8){try{_0xd8bda8=_0x5b8a89[_0x6ec1('0x40')](_0xd8bda8);logger[_0x6ec1('0x34')](_0x6ec1('0x41'),JSON['stringify'](_0xd8bda8,null,0x2));if(_0xd8bda8[_0x6ec1('0x20')]==='gotoc'){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x405f8c[_0x6ec1('0x42')]=_0xd8bda8[_0x6ec1('0x42')]||_0x405f8c[_0x6ec1('0x42')];_0x405f8c[_0x6ec1('0x43')]=_0xd8bda8[_0x6ec1('0x43')];_0x405f8c['priority']=_0xd8bda8['priority']?_0xd8bda8[_0x6ec1('0x44')]-0x1:0x1;return null;}else if(_0xd8bda8&&_0x5b8a89[_0xd8bda8[_0x6ec1('0x20')]]){_0x365618=_0x5b8a89[_0xd8bda8[_0x6ec1('0x20')]](_0xd8bda8);logger['info'](_0x6ec1('0x45'),JSON[_0x6ec1('0x36')](_0x365618,null,0x2));if(_0x365618&&_0x365618['code']===AGI_CODE_SUCCESS&&_0x365618[_0x6ec1('0x46')]!==AGI_RESULT_ERROR&&!_0x405f8c['evtHangup']){logger[_0x6ec1('0x34')](_0x6ec1('0x45'),getLogFromObject(_0x365618));return _[_0x6ec1('0x47')](_0x365618[_0x6ec1('0x46')])?null:_0x365618[_0x6ec1('0x46')][_0x6ec1('0x48')]();}else{logger['error']('response',getLogFromObject(_0x365618));return null;}}else{logger[_0x6ec1('0xa')]('agicommand\x20not\x20found');return null;}}catch(_0x4e32ce){logger[_0x6ec1('0xa')](_0x4e32ce[_0x6ec1('0xb')]);return null;}});if(_0x1fb7fa[_0x6ec1('0x49')]){logger[_0x6ec1('0xd')](util[_0x6ec1('0xe')](_0x6ec1('0x4a'),_0x405f8c[_0x6ec1('0x16')],_0x405f8c[_0x6ec1('0x17')],_0x405f8c[_0x6ec1('0x18')],_0x405f8c[_0x6ec1('0x19')],_0x405f8c[_0x6ec1('0x1c')]));_0x58107d[_0x6ec1('0x3f')](_0x1fb7fa[_0x6ec1('0x49')]['id'],function(_0x46498b){try{_0x46498b=_0x5b8a89[_0x6ec1('0x40')](_0x46498b);logger['debug']('vertex',JSON[_0x6ec1('0x36')](_0x46498b,null,0x2));if(_0x46498b&&_0x5b8a89[_0x46498b[_0x6ec1('0x20')]]){_0x365618=_0x5b8a89[_0x46498b[_0x6ec1('0x20')]](_0x46498b);if(_0x365618){logger[_0x6ec1('0x34')]('response',getLogFromObject(_0x365618));return _[_0x6ec1('0x47')](_0x365618[_0x6ec1('0x46')])?null:_0x365618['result'][_0x6ec1('0x48')]();}else{logger[_0x6ec1('0xa')](_0x6ec1('0x45'),getLogFromObject(_0x365618));return null;}}else{logger['error'](_0x6ec1('0x4b'));return null;}}catch(_0x6f6206){logger['error'](_0x6f6206[_0x6ec1('0xb')]);return null;}});}logger[_0x6ec1('0xd')](util[_0x6ec1('0xe')](_0x6ec1('0x4c'),_0x405f8c['arg_1'],_0x405f8c[_0x6ec1('0x17')],_0x405f8c[_0x6ec1('0x18')],_0x405f8c['dnid'],_0x405f8c[_0x6ec1('0x1c')]));logger[_0x6ec1('0xd')](util[_0x6ec1('0xe')](_0x6ec1('0x4d'),_0x405f8c[_0x6ec1('0x42')],_0x405f8c['extension'],parseInt(_0x405f8c['priority'],0xa)+0x1));_0x405f8c[_0x6ec1('0x4e')](_0x405f8c[_0x6ec1('0x42')],_0x405f8c[_0x6ec1('0x43')],parseInt(_0x405f8c[_0x6ec1('0x44')],0xa)+0x1);_0x405f8c['close']();}}else{logger[_0x6ec1('0xa')](util[_0x6ec1('0xe')](_0x6ec1('0x4f'),_0x405f8c[_0x6ec1('0x16')]));_0x405f8c['continueAt'](_0x405f8c[_0x6ec1('0x42')],_0x405f8c['extension'],parseInt(_0x405f8c['priority'],0xa)+0x1);_0x405f8c[_0x6ec1('0x37')]();}}else{logger[_0x6ec1('0xa')](util[_0x6ec1('0xe')](_0x6ec1('0x50'),_0x405f8c[_0x6ec1('0x16')]));_0x405f8c[_0x6ec1('0x4e')](_0x405f8c['context'],_0x405f8c['extension'],parseInt(_0x405f8c[_0x6ec1('0x44')],0xa)+0x1);_0x405f8c['close']();}}function main(){var _0x28b372;return utilLicense[_0x6ec1('0x51')]()[_0x6ec1('0x2e')](function(_0x54ca74){if(_0x54ca74){if(_0x54ca74[_0x6ec1('0x52')]){if(_0x54ca74[_0x6ec1('0x53')]&&_0x54ca74[_0x6ec1('0x53')]>0x0){logger['info'](util[_0x6ec1('0xe')](_0x6ec1('0x54'),_0x54ca74[_0x6ec1('0x53')]));_0x28b372=_0x54ca74[_0x6ec1('0x53')];}else{logger[_0x6ec1('0xd')](_0x6ec1('0x55'));}}else{logger[_0x6ec1('0xd')](_0x6ec1('0x56'));_0x28b372=-0x1;}}})[_0x6ec1('0x2f')](function(_0x4af1cb){logger[_0x6ec1('0xa')](_0x6ec1('0x57'),_0x4af1cb[_0x6ec1('0xb')]);})['finally'](function(){var _0x3b6b0a=require(_0x6ec1('0x58'))(config['agi'][_0x6ec1('0x10')],config[_0x6ec1('0x4')]['ip'],_0x28b372);_0x3b6b0a['on'](_0x6ec1('0xa'),errorHandler);_0x3b6b0a['on'](_0x6ec1('0x59'),listeningHandler);_0x3b6b0a['on']('connection',connectionHandler);_0x3b6b0a['on'](_0x6ec1('0x37'),closeHandler);});}main(); \ No newline at end of file +var _0x6947=['stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','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','dnid','evtHangup','toJson','mxGraphModel','root','hasOwnProperty','maxRetry','retry','addVertex','omit','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','inspect','debug','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','hangup','sync','production','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','vertex','gotoc','context','extension','priority','agicommand','response','code','isUndefined','result','agicommand\x20not\x20found','finally','toString','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','syncho','moment','../../config/environment','../../config/logger','./rpc','./graph','agi','127.0.0.1','nextTick','error'];(function(_0x165e43,_0xfcc9cb){var _0x4165e0=function(_0x2ae812){while(--_0x2ae812){_0x165e43['push'](_0x165e43['shift']());}};_0x4165e0(++_0xfcc9cb);}(_0x6947,0xa8));var _0x7694=function(_0x1b8d19,_0x44a4c3){_0x1b8d19=_0x1b8d19-0x0;var _0x45a0ff=_0x6947[_0x1b8d19];return _0x45a0ff;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x7694('0x0'));var util=require('util');var moment=require(_0x7694('0x1'));var config=require(_0x7694('0x2'));var logger=require(_0x7694('0x3'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x7694('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x7694('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0x7694('0x6')],{'ip':_0x7694('0x7'),'port':0x11dd});function connectionHandler(_0x264ea2){process[_0x7694('0x8')](function(){syncho(function(){try{setChannelVariables(_0x264ea2);agiHandler(_0x264ea2);}catch(_0x4b32d0){logger[_0x7694('0x9')](_0x4b32d0[_0x7694('0xa')]);}});});}function listeningHandler(){console[_0x7694('0xb')](_0x7694('0xc'),config['agi'][_0x7694('0xd')]);logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x10'),config[_0x7694('0x6')]['ip'],config[_0x7694('0x6')][_0x7694('0xd')]));}function errorHandler(_0x1f529b){if(_0x1f529b&&_0x1f529b[_0x7694('0x11')]&&_0x1f529b[_0x7694('0x12')]){logger[_0x7694('0x9')](util[_0x7694('0xf')](_0x7694('0x13'),_0x1f529b[_0x7694('0x11')],_0x1f529b['message']));}else{logger[_0x7694('0x9')](util[_0x7694('0xf')](_0x7694('0x14'),_0x1f529b['stack']));}}function closeHandler(){logger[_0x7694('0xe')](util['format'](_0x7694('0x15'),this[_0x7694('0x16')],this[_0x7694('0x17')],this[_0x7694('0x18')],this['dnid'],this[_0x7694('0x19')]));try{createSquareReport(this);}catch(_0x44341c){logger[_0x7694('0x9')](_0x44341c[_0x7694('0xa')]);}}function timeoutHandler(){logger[_0x7694('0xe')](util['format'](_0x7694('0x1a'),this[_0x7694('0x16')],this[_0x7694('0x17')],this[_0x7694('0x18')],this['dnid'],this[_0x7694('0x19')]));}function hangupHandler(){logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x1b'),this[_0x7694('0x16')],this[_0x7694('0x17')],this['callerid'],this[_0x7694('0x1c')],this['uniqueid']));this[_0x7694('0x1d')]=!![];}function getRoot(_0xec45b2){return parser[_0x7694('0x1e')](_0xec45b2,{'object':!![]})[_0x7694('0x1f')][_0x7694('0x20')];}function addVertex(_0x2f9633,_0x8dfac6,_0x37e643){_0x8dfac6['agicommand']=_0x37e643;if(_0x8dfac6[_0x7694('0x21')]('retry')){_0x8dfac6[_0x7694('0x22')]=parseInt(_0x8dfac6[_0x7694('0x23')],0xa);}_0x2f9633[_0x7694('0x24')](_[_0x7694('0x25')](_0x8dfac6,'mxCell'));}function initGraph(_0x340458,_0x111230){var _0x263f37=new Graph();for(var _0x35742b in _0x340458){if(_0x340458[_0x7694('0x21')](_0x35742b)){if(_['isArray'](_0x340458[_0x35742b])){for(var _0xb0148c=0x0;_0xb0148c<_0x340458[_0x35742b][_0x7694('0x26')];_0xb0148c+=0x1){addVertex(_0x263f37,_0x340458[_0x35742b][_0xb0148c],_0x35742b);}}else{addVertex(_0x263f37,_0x340458[_0x35742b],_0x35742b);}}}for(var _0x253ba4=0x0;_0x253ba4<_0x111230['length'];_0x253ba4+=0x1){if(_0x111230[_0x253ba4][_0x7694('0x27')]&&_0x111230[_0x253ba4][_0x7694('0x28')]){_0x263f37[_0x7694('0x29')](_0x111230[_0x253ba4][_0x7694('0x27')],_0x111230[_0x253ba4]['target'],_0x111230[_0x253ba4][_0x7694('0x2a')]);}}return _0x263f37;}function getSquareProject(_0x520e93,_0x16ba9a){rpc[_0x7694('0x2b')](_0x520e93)[_0x7694('0x2c')](function(_0x200855){_0x16ba9a(null,_0x200855);})[_0x7694('0x2d')](function(_0x1bd2ff){_0x16ba9a(null,_0x1bd2ff);});}function createSquareReport(_0x5b6cc5,_0x1f8027){rpc[_0x7694('0x2e')](_0x5b6cc5)[_0x7694('0x2c')](function(_0x478cac){if(_0x1f8027){_0x1f8027(null,_0x478cac);}})[_0x7694('0x2d')](function(_0x15d34a){if(_0x1f8027){_0x1f8027(null,_0x15d34a);}});}function setChannelVariables(_0x42c0a2){for(var _0x5d03bd in _0x42c0a2){if(_0x42c0a2[_0x7694('0x21')](_0x5d03bd)){if(_0x5d03bd[_0x7694('0x2f')](_0x7694('0x30'))===0x0){_0x42c0a2[_0x5d03bd['substring'](0x4)]=_0x42c0a2[_0x5d03bd];delete _0x42c0a2[_0x5d03bd];}}}}function getLogFromObject(_0x569813){return util[_0x7694('0x31')](_0x569813,{'showHidden':![],'depth':null});}function agiHandler(_0x198a3c){var _0x24c7b7,_0x114976,_0xb5a484,_0x5b8312,_0x1f866c;logger[_0x7694('0x32')]('variables',JSON['stringify'](_0x198a3c,null,0x2));logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x33'),_0x198a3c[_0x7694('0x16')],_0x198a3c['calleridname'],_0x198a3c['callerid'],_0x198a3c[_0x7694('0x1c')],_0x198a3c[_0x7694('0x19')]));_0x198a3c['on']('error',errorHandler);_0x198a3c['on']('close',closeHandler);_0x198a3c['on'](_0x7694('0x34'),timeoutHandler);_0x198a3c[_0x7694('0x1d')]=![];_0x198a3c['on'](_0x7694('0x35'),hangupHandler);var _0x3da1cc=getSquareProject[_0x7694('0x36')](null,_0x198a3c[_0x7694('0x16')]);if(_0x3da1cc){if(_0x3da1cc[_0x7694('0x37')]){_0x24c7b7=getRoot(_0x3da1cc['production']);if(_0x24c7b7&&_0x24c7b7['start']){logger[_0x7694('0x32')]('root',JSON[_0x7694('0x38')](_0x24c7b7,null,0x2));_0x198a3c[_0x7694('0x39')]=moment()[_0x7694('0xf')](_0x7694('0x3a'));_0x114976=initGraph(_['omit'](_0x24c7b7,_0x7694('0x3b')),_0x24c7b7[_0x7694('0x3b')]);_0xb5a484=new Vertices(_0x198a3c,rpc,mailRpc);logger[_0x7694('0xe')](util[_0x7694('0xf')](_0x7694('0x3c'),_0x198a3c[_0x7694('0x16')],_0x198a3c[_0x7694('0x17')],_0x198a3c[_0x7694('0x18')],_0x198a3c['dnid'],_0x198a3c[_0x7694('0x19')]));_0x114976[_0x7694('0x3d')](_0x24c7b7[_0x7694('0x3e')]['id'],function(_0x1ffd03){try{_0x1ffd03=_0xb5a484[_0x7694('0x3f')](_0x1ffd03);logger['debug'](_0x7694('0x40'),JSON[_0x7694('0x38')](_0x1ffd03,null,0x2));if(_0x1ffd03['agicommand']===_0x7694('0x41')){logger[_0x7694('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x198a3c[_0x7694('0x42')]=_0x1ffd03[_0x7694('0x42')]||_0x198a3c[_0x7694('0x42')];_0x198a3c[_0x7694('0x43')]=_0x1ffd03['extension'];_0x198a3c[_0x7694('0x44')]=_0x1ffd03[_0x7694('0x44')]?_0x1ffd03[_0x7694('0x44')]-0x1:0x1;return null;}else if(_0x1ffd03&&_0xb5a484[_0x1ffd03[_0x7694('0x45')]]){_0x1f866c=_0xb5a484[_0x1ffd03[_0x7694('0x45')]](_0x1ffd03);logger[_0x7694('0xe')](_0x7694('0x46'),JSON[_0x7694('0x38')](_0x1f866c,null,0x2));if(_0x1f866c&&_0x1f866c[_0x7694('0x47')]===AGI_CODE_SUCCESS&&_0x1f866c['result']!==AGI_RESULT_ERROR&&!_0x198a3c[_0x7694('0x1d')]){logger[_0x7694('0x32')](_0x7694('0x46'),getLogFromObject(_0x1f866c));return _[_0x7694('0x48')](_0x1f866c['result'])?null:_0x1f866c[_0x7694('0x49')]['toString']();}else{logger[_0x7694('0x9')](_0x7694('0x46'),getLogFromObject(_0x1f866c));return null;}}else{logger['error'](_0x7694('0x4a'));return null;}}catch(_0x2a394b){logger[_0x7694('0x9')](_0x2a394b[_0x7694('0xa')]);return null;}});if(_0x24c7b7['finally']){logger['info'](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x198a3c[_0x7694('0x16')],_0x198a3c['calleridname'],_0x198a3c[_0x7694('0x18')],_0x198a3c[_0x7694('0x1c')],_0x198a3c[_0x7694('0x19')]));_0x114976[_0x7694('0x3d')](_0x24c7b7[_0x7694('0x4b')]['id'],function(_0x33bcf7){try{_0x33bcf7=_0xb5a484[_0x7694('0x3f')](_0x33bcf7);logger[_0x7694('0x32')](_0x7694('0x40'),JSON[_0x7694('0x38')](_0x33bcf7,null,0x2));if(_0x33bcf7&&_0xb5a484[_0x33bcf7[_0x7694('0x45')]]){_0x1f866c=_0xb5a484[_0x33bcf7[_0x7694('0x45')]](_0x33bcf7);if(_0x1f866c){logger[_0x7694('0x32')](_0x7694('0x46'),getLogFromObject(_0x1f866c));return _['isUndefined'](_0x1f866c[_0x7694('0x49')])?null:_0x1f866c[_0x7694('0x49')][_0x7694('0x4c')]();}else{logger['error'](_0x7694('0x46'),getLogFromObject(_0x1f866c));return null;}}else{logger[_0x7694('0x9')](_0x7694('0x4a'));return null;}}catch(_0x28964b){logger[_0x7694('0x9')](_0x28964b[_0x7694('0xa')]);return null;}});}logger['info'](util[_0x7694('0xf')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x198a3c[_0x7694('0x16')],_0x198a3c[_0x7694('0x17')],_0x198a3c[_0x7694('0x18')],_0x198a3c[_0x7694('0x1c')],_0x198a3c['uniqueid']));logger['info'](util[_0x7694('0xf')](_0x7694('0x4d'),_0x198a3c[_0x7694('0x42')],_0x198a3c['extension'],parseInt(_0x198a3c[_0x7694('0x44')],0xa)+0x1));_0x198a3c[_0x7694('0x4e')](_0x198a3c['context'],_0x198a3c[_0x7694('0x43')],parseInt(_0x198a3c[_0x7694('0x44')],0xa)+0x1);_0x198a3c[_0x7694('0x4f')]();}}else{logger['error'](util[_0x7694('0xf')](_0x7694('0x50'),_0x198a3c[_0x7694('0x16')]));_0x198a3c[_0x7694('0x4e')](_0x198a3c[_0x7694('0x42')],_0x198a3c[_0x7694('0x43')],parseInt(_0x198a3c['priority'],0xa)+0x1);_0x198a3c['close']();}}else{logger[_0x7694('0x9')](util['format']('Project\x20%s\x20not\x20found',_0x198a3c[_0x7694('0x16')]));_0x198a3c[_0x7694('0x4e')](_0x198a3c[_0x7694('0x42')],_0x198a3c[_0x7694('0x43')],parseInt(_0x198a3c[_0x7694('0x44')],0xa)+0x1);_0x198a3c[_0x7694('0x4f')]();}}function main(){var _0x4234fa;return utilLicense[_0x7694('0x51')]()[_0x7694('0x2c')](function(_0x3ac27c){if(_0x3ac27c){if(_0x3ac27c[_0x7694('0x52')]){if(_0x3ac27c['callysquare']&&_0x3ac27c[_0x7694('0x53')]>0x0){logger[_0x7694('0xe')](util['format'](_0x7694('0x54'),_0x3ac27c[_0x7694('0x53')]));_0x4234fa=_0x3ac27c[_0x7694('0x53')];}else{logger['info'](_0x7694('0x55'));}}else{logger[_0x7694('0xe')](_0x7694('0x56'));_0x4234fa=-0x1;}}})[_0x7694('0x2d')](function(_0x4014b9){logger[_0x7694('0x9')](_0x7694('0x57'),_0x4014b9['stack']);})['finally'](function(){var _0x20b396=require('./server')(config['agi'][_0x7694('0xd')],config[_0x7694('0x6')]['ip'],_0x4234fa);_0x20b396['on'](_0x7694('0x9'),errorHandler);_0x20b396['on'](_0x7694('0x58'),listeningHandler);_0x20b396['on']('connection',connectionHandler);_0x20b396['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 6272f91..e25225b 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 _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x36b5ba,_0x546c6e){var _0x2d0c74=function(_0x18b265){while(--_0x18b265){_0x36b5ba['push'](_0x36b5ba['shift']());}};_0x2d0c74(++_0x546c6e);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x559cd0,_0x38c74a){var _0x13b20e=function(_0x3e4d2c){while(--_0x3e4d2c){_0x559cd0['push'](_0x559cd0['shift']());}};_0x13b20e(++_0x38c74a);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b8275ed..b6cf06a 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 _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x8ee4e8,_0x192cf2){var _0x4b1ec4=function(_0xc3cfa5){while(--_0xc3cfa5){_0x8ee4e8['push'](_0x8ee4e8['shift']());}};_0x4b1ec4(++_0x192cf2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x48b016,_0x71ffab){_0x48b016=_0x48b016-0x0;var _0xd384f4=_0x5f2f[_0x48b016];return _0xd384f4;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x543f9f,_0x563bf5){var _0x23e5d3=function(_0x5cd0e0){while(--_0x5cd0e0){_0x543f9f['push'](_0x543f9f['shift']());}};_0x23e5d3(++_0x563bf5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x430678,_0x50ccc2){_0x430678=_0x430678-0x0;var _0xca6e8b=_0x5f2f[_0x430678];return _0xca6e8b;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index ca6da86..4f2dbad 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 _0xf12a=['getUserById','ShowUser','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','agentLogout','bluebird','moment','lodash','util','jayson/promise','client','http','request','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','Smtp','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf12a,0x8e));var _0xaf12=function(_0x3ce3bc,_0x3530af){_0x3ce3bc=_0x3ce3bc-0x0;var _0x31100b=_0xf12a[_0x3ce3bc];return _0x31100b;};'use strict';var BPromise=require(_0xaf12('0x0'));var moment=require(_0xaf12('0x1'));var _=require(_0xaf12('0x2'));var util=require(_0xaf12('0x3'));var jayson=require(_0xaf12('0x4'));var client=jayson[_0xaf12('0x5')][_0xaf12('0x6')]({'port':0x2329});function request(_0x4a3a62,_0x5b7b5b){return new BPromise(function(_0x1b1d82,_0x57c2a5){return client[_0xaf12('0x7')](_0x4a3a62,_0x5b7b5b)['then'](function(_0x17c0c8){if(_0x17c0c8['error']){return _0x57c2a5(_0x17c0c8[_0xaf12('0x8')][_0xaf12('0x9')]);}else{return _0x1b1d82(_0x17c0c8[_0xaf12('0xa')]);}})[_0xaf12('0xb')](function(_0x16e152){return _0x57c2a5(_0x16e152);});});}exports[_0xaf12('0xc')]=function(_0x3d733d){return request(_0xaf12('0xd'),{'options':{'raw':![],'where':{'name':_0x3d733d},'attributes':['production']}});};exports[_0xaf12('0xe')]=function(_0x5b69e2){return request(_0xaf12('0xf'),{'options':{'raw':![],'where':{'id':_0x5b69e2},'include':[{'model':'MailServerOut','as':_0xaf12('0x10')}],'attributes':['id','name','email']}});};exports[_0xaf12('0x11')]=function(_0x2b2676){return request(_0xaf12('0xd'),{'options':{'where':{'id':_0x2b2676},'attributes':[_0xaf12('0x12')]}});};exports[_0xaf12('0x13')]=function(_0x363996){return request(_0xaf12('0x14'),{'options':{'where':{'id':_0x363996},'attributes':[_0xaf12('0x12')]}});};exports[_0xaf12('0x15')]=function(_0x3f1476){return request(_0xaf12('0x16'),{'options':{'where':{'id':_0x3f1476},'attributes':[_0xaf12('0x12')]}});};exports[_0xaf12('0x17')]=function(_0x464dba){return request(_0xaf12('0x18'),{'options':{'where':{'id':_0x464dba},'attributes':[_0xaf12('0x19')]}});};exports[_0xaf12('0x1a')]=function(_0x5107e7){return request(_0xaf12('0x1b'),{'options':{'where':{'id':_0x5107e7},'attributes':[_0xaf12('0x12')]}});};exports['getTrunkById']=function(_0x4bc03e){return request('ShowTrunk',{'options':{'where':{'id':_0x4bc03e},'attributes':[_0xaf12('0x12')]}});};exports['getSoundById']=function(_0x3530a8){return request('ShowSound',{'options':{'where':{'id':_0x3530a8},'attributes':[_0xaf12('0x1c')]}});};exports[_0xaf12('0x1d')]=function(_0x3752a6){return request(_0xaf12('0x1e'),{'options':{'raw':![],'where':{'id':_0x3752a6},'include':[{'model':'Interval','as':_0xaf12('0x1f')}]}});};exports[_0xaf12('0x20')]=function(_0x3e81ce){return request(_0xaf12('0x21'),{'options':{'where':{'id':_0x3e81ce},'attributes':['id',_0xaf12('0x12')]}});};exports[_0xaf12('0x22')]=function(_0x656675){return request(_0xaf12('0x23'),{'body':_0x656675});};exports[_0xaf12('0x24')]=function(_0x41f9f7){return request(_0xaf12('0x25'),{'body':_0x41f9f7});};exports[_0xaf12('0x26')]=function(_0x2d68d7){return request('CreateSquareReport',{'body':_[_0xaf12('0x27')](_0x2d68d7,{'project_name':_0x2d68d7['arg_1'],'prev_project_name':_0x2d68d7['arg_2']||'','is_subproject':_0x2d68d7[_0xaf12('0x28')]?!![]:![],'leaveAt':moment()[_0xaf12('0x29')](_0xaf12('0x2a'))})});};exports['createSquareRecording']=function(_0x21fb29){return request(_0xaf12('0x2b'),{'body':_0x21fb29});};exports['createSquareMessage']=function(_0x439409){return request(_0xaf12('0x2c'),{'body':_0x439409});};exports[_0xaf12('0x2d')]=function(_0x2ed53d){return request(_0xaf12('0x2e'),{'options':{'raw':![],'where':{'phone':_0x2ed53d[_0xaf12('0x2f')],'ListId':_0x2ed53d[_0xaf12('0x30')]}}})[_0xaf12('0x31')](function(_0x34fb64){if(_0x34fb64){return _0x34fb64;}return request('CreateCmContact',{'body':_0x2ed53d});});};exports[_0xaf12('0x32')]=function(_0x59328c){return request(_0xaf12('0x33'),{'options':{'where':{'id':_0x59328c},'attributes':[_0xaf12('0x12')]}});};exports[_0xaf12('0x34')]=function(_0x58a32f,_0x4f0a8b){return request('LoginUser',{'body':{'interface':_0x4f0a8b},'options':{'where':_0x58a32f}});};exports['agentPause']=function(_0x5484c8,_0x53401b,_0x64625){return request(_0xaf12('0x35'),{'body':{'type':_0x53401b,'uniqueid':_0x64625},'options':{'where':_0x5484c8}});};exports[_0xaf12('0x36')]=function(_0x4092d5){return request('UnpauseUser',{'body':{},'options':{'where':_0x4092d5}});};exports[_0xaf12('0x37')]=function(_0x1cbf28){return request('LogoutUser',{'body':{},'options':{'where':_0x1cbf28}});}; \ No newline at end of file +var _0x438c=['production','Smtp','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','createSquareMessage','phone','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','lodash','jayson/promise','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject'];(function(_0x338c8c,_0x19df14){var _0x371a9a=function(_0x4da3fe){while(--_0x4da3fe){_0x338c8c['push'](_0x338c8c['shift']());}};_0x371a9a(++_0x19df14);}(_0x438c,0x1e9));var _0xc438=function(_0x973bf2,_0x4aa2bf){_0x973bf2=_0x973bf2-0x0;var _0x1c2bb8=_0x438c[_0x973bf2];return _0x1c2bb8;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xc438('0x0'));var util=require('util');var jayson=require(_0xc438('0x1'));var client=jayson[_0xc438('0x2')][_0xc438('0x3')]({'port':0x2329});function request(_0x1720fb,_0x3d7323){return new BPromise(function(_0x190e3e,_0x3be04a){return client[_0xc438('0x4')](_0x1720fb,_0x3d7323)[_0xc438('0x5')](function(_0x59ddc1){if(_0x59ddc1[_0xc438('0x6')]){return _0x3be04a(_0x59ddc1[_0xc438('0x6')][_0xc438('0x7')]);}else{return _0x190e3e(_0x59ddc1[_0xc438('0x8')]);}})['catch'](function(_0x12c7a4){return _0x3be04a(_0x12c7a4);});});}exports[_0xc438('0x9')]=function(_0x29e2c3){return request(_0xc438('0xa'),{'options':{'raw':![],'where':{'name':_0x29e2c3},'attributes':[_0xc438('0xb')]}});};exports['getMailAccountById']=function(_0xccb9d3){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0xccb9d3},'include':[{'model':'MailServerOut','as':_0xc438('0xc')}],'attributes':['id','name','email']}});};exports[_0xc438('0xd')]=function(_0x113bc9){return request(_0xc438('0xa'),{'options':{'where':{'id':_0x113bc9},'attributes':[_0xc438('0xe')]}});};exports[_0xc438('0xf')]=function(_0x5b6b79){return request(_0xc438('0x10'),{'options':{'where':{'id':_0x5b6b79},'attributes':[_0xc438('0xe')]}});};exports['getVariableById']=function(_0x3eb473){return request('ShowVariable',{'options':{'where':{'id':_0x3eb473},'attributes':['name']}});};exports[_0xc438('0x11')]=function(_0x436837){return request(_0xc438('0x12'),{'options':{'where':{'id':_0x436837},'attributes':[_0xc438('0x13')]}});};exports['getUserById']=function(_0x58a14b){return request('ShowUser',{'options':{'where':{'id':_0x58a14b},'attributes':[_0xc438('0xe')]}});};exports[_0xc438('0x14')]=function(_0x43b24b){return request(_0xc438('0x15'),{'options':{'where':{'id':_0x43b24b},'attributes':['name']}});};exports[_0xc438('0x16')]=function(_0x3b7230){return request(_0xc438('0x17'),{'options':{'where':{'id':_0x3b7230},'attributes':[_0xc438('0x18')]}});};exports['getIntervalById']=function(_0x5aeac9){return request(_0xc438('0x19'),{'options':{'raw':![],'where':{'id':_0x5aeac9},'include':[{'model':'Interval','as':_0xc438('0x1a')}]}});};exports[_0xc438('0x1b')]=function(_0x191f51){return request('ShowSmsAccount',{'options':{'where':{'id':_0x191f51},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x33c991){return request(_0xc438('0x1c'),{'body':_0x33c991});};exports[_0xc438('0x1d')]=function(_0x47b7cd){return request(_0xc438('0x1e'),{'body':_0x47b7cd});};exports[_0xc438('0x1f')]=function(_0x1da8fb){return request(_0xc438('0x20'),{'body':_[_0xc438('0x21')](_0x1da8fb,{'project_name':_0x1da8fb[_0xc438('0x22')],'prev_project_name':_0x1da8fb[_0xc438('0x23')]||'','is_subproject':_0x1da8fb[_0xc438('0x23')]?!![]:![],'leaveAt':moment()[_0xc438('0x24')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xc438('0x25')]=function(_0x2d3c05){return request('CreateSquareRecording',{'body':_0x2d3c05});};exports[_0xc438('0x26')]=function(_0x81a9e6){return request('CreateSquareMessage',{'body':_0x81a9e6});};exports['createCmContact']=function(_0x46e958){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x46e958[_0xc438('0x27')],'ListId':_0x46e958['ListId']}}})[_0xc438('0x5')](function(_0x427f0a){if(_0x427f0a){return _0x427f0a;}return request(_0xc438('0x28'),{'body':_0x46e958});});};exports[_0xc438('0x29')]=function(_0x3bee38){return request(_0xc438('0x2a'),{'options':{'where':{'id':_0x3bee38},'attributes':[_0xc438('0xe')]}});};exports[_0xc438('0x2b')]=function(_0x399eb6,_0x4a0178){return request(_0xc438('0x2c'),{'body':{'interface':_0x4a0178},'options':{'where':_0x399eb6}});};exports[_0xc438('0x2d')]=function(_0x26af5e,_0x55eb9d,_0x55fa6f){return request(_0xc438('0x2e'),{'body':{'type':_0x55eb9d,'uniqueid':_0x55fa6f},'options':{'where':_0x26af5e}});};exports[_0xc438('0x2f')]=function(_0x1db0d4){return request(_0xc438('0x30'),{'body':{},'options':{'where':_0x1db0d4}});};exports[_0xc438('0x31')]=function(_0x4e30a1){return request('LogoutUser',{'body':{},'options':{'where':_0x4e30a1}});}; \ 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 8507f73..13d7402 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 _0x9bf5=['./lex','exports','./polly'];(function(_0x1e1c1e,_0x63d716){var _0x3e0911=function(_0x1a08b3){while(--_0x1a08b3){_0x1e1c1e['push'](_0x1e1c1e['shift']());}};_0x3e0911(++_0x63d716);}(_0x9bf5,0x1b8));var _0x59bf=function(_0x198e7b,_0x157e90){_0x198e7b=_0x198e7b-0x0;var _0x349701=_0x9bf5[_0x198e7b];return _0x349701;};var polly=require(_0x59bf('0x0'));var lex=require(_0x59bf('0x1'));module[_0x59bf('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xd986=['./polly'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xd986,0x79));var _0x6d98=function(_0x3c3be0,_0xa95b94){_0x3c3be0=_0x3c3be0-0x0;var _0x96bb90=_0xd986[_0x3c3be0];return _0x96bb90;};var polly=require(_0x6d98('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 1216a24..ecba4ba 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 _0x1bca=['exports'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x1bca,0xb6));var _0xa1bc=function(_0x3b08c0,_0x54e8e0){_0x3b08c0=_0x3b08c0-0x0;var _0x4c3e43=_0x1bca[_0x3b08c0];return _0x4c3e43;};'use strict';var lex=require('./lib/api');module[_0xa1bc('0x0')]=function(_0x4a2571,_0x4a59d3,_0x84fe95,_0x4feb3b,_0x1865b2,_0x1fa3d2){return lex(_0x4a2571,_0x4a59d3,_0x84fe95,_0x4feb3b,_0x1865b2,_0x1fa3d2);}; \ No newline at end of file +var _0x5c37=['./lib/api','exports'];(function(_0x507458,_0x1096bf){var _0x5f43ad=function(_0x36cfb1){while(--_0x36cfb1){_0x507458['push'](_0x507458['shift']());}};_0x5f43ad(++_0x1096bf);}(_0x5c37,0x11e));var _0x75c3=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x5c37[_0x28a5ad];return _0x176b8a;};'use strict';var lex=require(_0x75c3('0x0'));module[_0x75c3('0x1')]=function(_0x302a73,_0x43cf5a,_0x2a3a11,_0x79e9a5,_0x524eee,_0x1f0ee1){return lex(_0x302a73,_0x43cf5a,_0x2a3a11,_0x79e9a5,_0x524eee,_0x1f0ee1);}; \ 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 c3d0d88..2c1c985 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 _0xdc0c=['exports','$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty'];(function(_0x38a372,_0x1d5d9d){var _0x41a0ea=function(_0x40e811){while(--_0x40e811){_0x38a372['push'](_0x38a372['shift']());}};_0x41a0ea(++_0x1d5d9d);}(_0xdc0c,0xf0));var _0xcdc0=function(_0x3285aa,_0x1c6ddd){_0x3285aa=_0x3285aa-0x0;var _0x2e0fc3=_0xdc0c[_0x3285aa];return _0x2e0fc3;};'use strict';var BPromise=require(_0xcdc0('0x0'));var AWS=require(_0xcdc0('0x1'));function lexResult(_0x349c0f,_0xd80d61){return new BPromise(function(_0x33b27d,_0x18d3b7){_0x349c0f[_0xcdc0('0x2')](_0xd80d61,function(_0x543eae,_0x272de5){if(_0x543eae){_0x18d3b7(_0x543eae);}if(_0x272de5[_0xcdc0('0x3')]){for(const _0x198f6c in _0x272de5['slots']){if(_0x272de5[_0xcdc0('0x3')][_0xcdc0('0x4')](_0x198f6c)){var _0x23be2f=_0x272de5['slots'][_0x198f6c];_0x272de5['slot_'+_0x198f6c]=_0x23be2f;}}}_0x33b27d(_0x272de5);});});}module[_0xcdc0('0x5')]=function(_0x398b1d,_0x52e0c4,_0x1c5203,_0x44250c,_0x1298fd,_0xff723c){var _0x232121=new AWS['LexRuntime']({'accessKeyId':_0x52e0c4,'secretAccessKey':_0x1c5203,'region':_0x44250c});var _0xf4d55f={'botAlias':_0xcdc0('0x6'),'botName':_0xff723c,'inputText':_0x1298fd,'userId':_0x398b1d};return lexResult(_0x232121,_0xf4d55f);}; \ No newline at end of file +var _0x917d=['postText','slots','hasOwnProperty','slot_','exports','LexRuntime','$LATEST','bluebird'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x917d,0x17f));var _0xd917=function(_0x30e303,_0x38b41d){_0x30e303=_0x30e303-0x0;var _0x9997fc=_0x917d[_0x30e303];return _0x9997fc;};'use strict';var BPromise=require(_0xd917('0x0'));var AWS=require('aws-sdk');function lexResult(_0x32daa7,_0x5ce260){return new BPromise(function(_0x3b32eb,_0x49b221){_0x32daa7[_0xd917('0x1')](_0x5ce260,function(_0x16e78b,_0x2f94ee){if(_0x16e78b){_0x49b221(_0x16e78b);}if(_0x2f94ee[_0xd917('0x2')]){for(const _0x3b6532 in _0x2f94ee[_0xd917('0x2')]){if(_0x2f94ee[_0xd917('0x2')][_0xd917('0x3')](_0x3b6532)){var _0x21db5c=_0x2f94ee[_0xd917('0x2')][_0x3b6532];_0x2f94ee[_0xd917('0x4')+_0x3b6532]=_0x21db5c;}}}_0x3b32eb(_0x2f94ee);});});}module[_0xd917('0x5')]=function(_0x48d521,_0x4a7ee4,_0x19ce55,_0x3b2aae,_0x11d71b,_0x5920f0){var _0x1d3ae6=new AWS[(_0xd917('0x6'))]({'accessKeyId':_0x4a7ee4,'secretAccessKey':_0x19ce55,'region':_0x3b2aae});var _0x57fae8={'botAlias':_0xd917('0x7'),'botName':_0x5920f0,'inputText':_0x11d71b,'userId':_0x48d521};return lexResult(_0x1d3ae6,_0x57fae8);}; \ 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 4e950a9..1ed77c7 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 _0x9012=['exports'];(function(_0x29be29,_0x5667e9){var _0x59e389=function(_0x42426f){while(--_0x42426f){_0x29be29['push'](_0x29be29['shift']());}};_0x59e389(++_0x5667e9);}(_0x9012,0x11a));var _0x2901=function(_0x2605dc,_0x50cf7e){_0x2605dc=_0x2605dc-0x0;var _0x4568c9=_0x9012[_0x2605dc];return _0x4568c9;};'use strict';var polly=require('./lib/api');module[_0x2901('0x0')]=function(_0x3238d4,_0x4d1b4b,_0x10c254,_0x270c13,_0x2e00e4,_0x513d8d,_0x3ffd9e){return polly(_0x3238d4,_0x4d1b4b,_0x10c254,_0x270c13,_0x2e00e4,_0x513d8d,_0x3ffd9e);}; \ No newline at end of file +var _0xcc49=['exports','./lib/api'];(function(_0xe2587d,_0x18eb7c){var _0x2a922b=function(_0x1b1904){while(--_0x1b1904){_0xe2587d['push'](_0xe2587d['shift']());}};_0x2a922b(++_0x18eb7c);}(_0xcc49,0x83));var _0x9cc4=function(_0x37e343,_0x5dbfea){_0x37e343=_0x37e343-0x0;var _0xf688dc=_0xcc49[_0x37e343];return _0xf688dc;};'use strict';var polly=require(_0x9cc4('0x0'));module[_0x9cc4('0x1')]=function(_0x3d79ae,_0x3c0c4e,_0x18b725,_0x41b973,_0x5cd621,_0x3ad015,_0xc92c4b){return polly(_0x3d79ae,_0x3c0c4e,_0x18b725,_0x41b973,_0x5cd621,_0x3ad015,_0xc92c4b);}; \ 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 7710c5e..ab36192 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 _0x175f=['randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird'];(function(_0x3907a6,_0x49a776){var _0x1f7412=function(_0x456eb7){while(--_0x456eb7){_0x3907a6['push'](_0x3907a6['shift']());}};_0x1f7412(++_0x49a776);}(_0x175f,0xee));var _0xf175=function(_0x2e7da7,_0x5a04b7){_0x2e7da7=_0x2e7da7-0x0;var _0x1b5c8a=_0x175f[_0x2e7da7];return _0x1b5c8a;};'use strict';var fs=require('fs');var path=require(_0xf175('0x0'));var BPromise=require(_0xf175('0x1'));var rs=require(_0xf175('0x2'));var AWS=require(_0xf175('0x3'));function pollyResult(_0x11cac2,_0x539b43,_0x32b89b){return new BPromise(function(_0x5a0f02,_0x1f5105){_0x11cac2[_0xf175('0x4')](_0x539b43,function(_0x1353bd,_0x492f91){if(_0x1353bd){_0x1f5105(_0x1353bd);}else if(_0x492f91){if(_0x492f91['AudioStream']instanceof Buffer){fs[_0xf175('0x5')](_0x32b89b,_0x492f91[_0xf175('0x6')],function(_0x3ba09e){if(_0x3ba09e){_0x1f5105(_0x3ba09e);}else{_0x5a0f02();}});}else{_0x1f5105(new Error(_0xf175('0x7')));}}else{_0x1f5105(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xf175('0x8')]=function(_0x767aa3,_0x4a6d2f,_0x5cbbfe,_0x4c6026,_0x106c46,_0x4cf16a,_0x1bf9a3){var _0x269ecf=new AWS[(_0xf175('0x9'))]({'accessKeyId':_0x767aa3,'secretAccessKey':_0x4a6d2f,'region':_0x5cbbfe});var _0x330016={'Text':_0x106c46,'TextType':_0x4cf16a||_0xf175('0xa'),'OutputFormat':_0xf175('0xb'),'VoiceId':_0x4c6026};return pollyResult(_0x269ecf,_0x330016,_0x1bf9a3);}; \ No newline at end of file +var _0x3714=['path','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3'];(function(_0x1e9e10,_0x1b254a){var _0x5ef3f4=function(_0x45912e){while(--_0x45912e){_0x1e9e10['push'](_0x1e9e10['shift']());}};_0x5ef3f4(++_0x1b254a);}(_0x3714,0x160));var _0x4371=function(_0x35c28c,_0x513e24){_0x35c28c=_0x35c28c-0x0;var _0x34ab7b=_0x3714[_0x35c28c];return _0x34ab7b;};'use strict';var fs=require('fs');var path=require(_0x4371('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0xa9a054,_0x59cbc6,_0x110d3c){return new BPromise(function(_0x3e444e,_0x5ae732){_0xa9a054[_0x4371('0x1')](_0x59cbc6,function(_0x3a12e1,_0x3f2622){if(_0x3a12e1){_0x5ae732(_0x3a12e1);}else if(_0x3f2622){if(_0x3f2622[_0x4371('0x2')]instanceof Buffer){fs[_0x4371('0x3')](_0x110d3c,_0x3f2622[_0x4371('0x2')],function(_0x815e4b){if(_0x815e4b){_0x5ae732(_0x815e4b);}else{_0x3e444e();}});}else{_0x5ae732(new Error(_0x4371('0x4')));}}else{_0x5ae732(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x4371('0x5')]=function(_0x282099,_0x39621a,_0xad2fa2,_0x339d14,_0x512ce7,_0x28cfc0,_0x2103de){var _0x2626d5=new AWS[(_0x4371('0x6'))]({'accessKeyId':_0x282099,'secretAccessKey':_0x39621a,'region':_0xad2fa2});var _0x1208cb={'Text':_0x512ce7,'TextType':_0x28cfc0||'text','OutputFormat':_0x4371('0x7'),'VoiceId':_0x339d14};return pollyResult(_0x2626d5,_0x1208cb,_0x2103de);}; \ 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 db18404..859f4c1 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 _0x40af=['exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x40af,0x8d));var _0xf40a=function(_0x12ac60,_0x5008b8){_0x12ac60=_0x12ac60-0x0;var _0x31652d=_0x40af[_0x12ac60];return _0x31652d;};'use strict';var asr=require('./lib/api');module[_0xf40a('0x0')]=function(_0x359897,_0x118769,_0x382c82,_0x2484ac){return asr(_0x359897,_0x118769,_0x382c82);}; \ No newline at end of file +var _0x15b8=['exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x15b8,0xcd));var _0x815b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x15b8[_0x5f1391];return _0x50ebe3;};'use strict';var asr=require('./lib/api');module[_0x815b('0x0')]=function(_0x440706,_0x2bb0ae,_0x47829c,_0x13a73e){return asr(_0x440706,_0x2bb0ae,_0x47829c);}; \ 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 f695574..dba20dc 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 _0x3233=['string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports'];(function(_0x4f90af,_0x14b70c){var _0x5e62c0=function(_0x4aa5b6){while(--_0x4aa5b6){_0x4f90af['push'](_0x4f90af['shift']());}};_0x5e62c0(++_0x14b70c);}(_0x3233,0x1e7));var _0x3323=function(_0x287dd4,_0x44c892){_0x287dd4=_0x287dd4-0x0;var _0x575b21=_0x3233[_0x287dd4];return _0x575b21;};'use strict';var url=require('url');var BPromise=require(_0x3323('0x0'));var fs=require('fs');var host=_0x3323('0x1');module[_0x3323('0x2')]=function(_0x2d70c6,_0x54452b,_0x5234db){return new BPromise(function(_0x3705aa,_0x5dfcab){var _0x4e39cd;if(typeof _0x2d70c6!==_0x3323('0x3')||_0x2d70c6[_0x3323('0x4')]===0x0){return _0x5dfcab(_0x3323('0x5'));}if(typeof _0x54452b!==_0x3323('0x3')||_0x54452b[_0x3323('0x4')]===0x0){return _0x5dfcab(_0x3323('0x6'));}if(typeof _0x5234db!=='undefined'&&(typeof _0x5234db!==_0x3323('0x3')||_0x5234db['length']===0x0)){return _0x5dfcab(_0x3323('0x7'));}try{_0x4e39cd=fs[_0x3323('0x8')](_0x2d70c6)[_0x3323('0x9')](_0x3323('0xa'));}catch(_0x2414f5){return _0x5dfcab(_0x2414f5);}return _0x3705aa({'method':'POST','uri':host+_0x3323('0xb')+_0x54452b,'body':{'config':{'encoding':_0x3323('0xc'),'sampleRateHertz':_0x3323('0xd'),'languageCode':_0x5234db},'audio':{'content':_0x4e39cd}},'json':!![]});});}; \ No newline at end of file +var _0xd7c4=['base64','POST','LINEAR16','url','bluebird','exports','string','key\x20should\x20be\x20a\x20string','undefined','length','lang\x20should\x20be\x20a\x20string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7c4,0x116));var _0x4d7c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd7c4[_0x14add3];return _0x4a174f;};'use strict';var url=require(_0x4d7c('0x0'));var BPromise=require(_0x4d7c('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x4d7c('0x2')]=function(_0x22aa80,_0x17b833,_0x163823){return new BPromise(function(_0x394ec9,_0x318690){var _0x5ea0b1;if(typeof _0x22aa80!==_0x4d7c('0x3')||_0x22aa80['length']===0x0){return _0x318690('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x17b833!==_0x4d7c('0x3')||_0x17b833['length']===0x0){return _0x318690(_0x4d7c('0x4'));}if(typeof _0x163823!==_0x4d7c('0x5')&&(typeof _0x163823!==_0x4d7c('0x3')||_0x163823[_0x4d7c('0x6')]===0x0)){return _0x318690(_0x4d7c('0x7'));}try{_0x5ea0b1=fs['readFileSync'](_0x22aa80)['toString'](_0x4d7c('0x8'));}catch(_0x5e11b6){return _0x318690(_0x5e11b6);}return _0x394ec9({'method':_0x4d7c('0x9'),'uri':host+'/v1/speech:recognize?key='+_0x17b833,'body':{'config':{'encoding':_0x4d7c('0xa'),'sampleRateHertz':'8000','languageCode':_0x163823},'audio':{'content':_0x5ea0b1}},'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 c5321d1..7cce56f 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 _0x3e74=['./asr'];(function(_0x5649eb,_0x4607ea){var _0x36e0aa=function(_0x271e37){while(--_0x271e37){_0x5649eb['push'](_0x5649eb['shift']());}};_0x36e0aa(++_0x4607ea);}(_0x3e74,0x175));var _0x43e7=function(_0x2c409d,_0x25fee2){_0x2c409d=_0x2c409d-0x0;var _0x50f56c=_0x3e74[_0x2c409d];return _0x50f56c;};var asr=require(_0x43e7('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xedd9=['exports'];(function(_0x317a82,_0x124141){var _0x5a6b0a=function(_0x3a07dc){while(--_0x3a07dc){_0x317a82['push'](_0x317a82['shift']());}};_0x5a6b0a(++_0x124141);}(_0xedd9,0xfc));var _0x9edd=function(_0x1a24c1,_0x3ed2ce){_0x1a24c1=_0x1a24c1-0x0;var _0xb355f3=_0xedd9[_0x1a24c1];return _0xb355f3;};var asr=require('./asr');module[_0x9edd('0x0')]={'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 44e999f..59803ec 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 _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x173e61,_0x4f2f70){var _0x465ba2=function(_0x17c510){while(--_0x17c510){_0x173e61['push'](_0x173e61['shift']());}};_0x465ba2(++_0x4f2f70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=function(){return __dirname;}; \ No newline at end of file +var _0xa9e0=['text','channelData','CustomAction','AudioFromTts','Data','dirName','path','http','https','bluebird','sox','request-promise','util','querystring','moment','apiai-promise','md5','./google','./sestek','https://api.ispeech.org/api/rest','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','error','unlink','download\x20error','pipe','end','protocol','https:','data','transcode','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','googleTTS','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','code','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','freeform=3','parse','sestekNDA','nda'];(function(_0x86e9b8,_0x26b710){var _0x129fb4=function(_0x324d29){while(--_0x324d29){_0x86e9b8['push'](_0x86e9b8['shift']());}};_0x129fb4(++_0x26b710);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var fs=require('fs');var path=require(_0x0a9e('0x0'));var http=require(_0x0a9e('0x1'));var https=require(_0x0a9e('0x2'));var urlParse=require('url')['parse'];var BPromise=require(_0x0a9e('0x3'));var rs=require('randomstring');var sox=require(_0x0a9e('0x4'));var rp=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var querystring=require(_0x0a9e('0x7'));var moment=require(_0x0a9e('0x8'));var tts=require('google-tts-api');var apiai=require(_0x0a9e('0x9'));var md5=require(_0x0a9e('0xa'));var google=require(_0x0a9e('0xb'));var aws=require('./aws');var tilde=require('./tilde');var sestek=require(_0x0a9e('0xc'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x0a9e('0xd');function downloadFile(_0xf81284,_0x307b3e){return new BPromise(function(_0x3ab53f,_0xfeb75b){var _0xbd1168=urlParse(_0xf81284);var _0x4a4c56=_0xbd1168['protocol']==='https:'?https:http;var _0x4cfe67={'host':_0xbd1168[_0x0a9e('0xe')],'path':_0xbd1168[_0x0a9e('0x0')],'headers':{'user-agent':_0x0a9e('0xf')}};_0x4a4c56[_0x0a9e('0x10')](_0x4cfe67,function(_0x32d742){if(_0x32d742[_0x0a9e('0x11')]!==0xc8){logger['error'](_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742[_0x0a9e('0x11')]+'\x20('+_0x32d742[_0x0a9e('0x14')]+')');_0xfeb75b(new Error(_0x0a9e('0x12')+_0xf81284+_0x0a9e('0x13')+_0x32d742['statusCode']+'\x20('+_0x32d742[_0x0a9e('0x14')]+')'));return;}var _0x5d0880=fs[_0x0a9e('0x15')](_0x307b3e);_0x5d0880['on']('finish',function(){logger[_0x0a9e('0x16')](_0x0a9e('0x17'));_0x5d0880['close'](_0x3ab53f);});_0x5d0880['on'](_0x0a9e('0x18'),function(_0x5a0a06){fs[_0x0a9e('0x19')](_0x307b3e);logger[_0x0a9e('0x18')](_0x0a9e('0x1a'),_0x5a0a06);_0xfeb75b(_0x5a0a06);});_0x32d742[_0x0a9e('0x1b')](_0x5d0880);})['on'](_0x0a9e('0x18'),function(_0x2eb11f){logger[_0x0a9e('0x18')](_0x2eb11f);_0xfeb75b(_0x2eb11f);})[_0x0a9e('0x1c')]();});}function uploadFile(_0x1314ae){return new BPromise(function(_0x112016,_0x1c696a){var _0x105080=urlParse(_0x1314ae);var _0x4bb1e3=_0x105080[_0x0a9e('0x1d')]===_0x0a9e('0x1e')?https:http;var _0x53682f={'host':_0x105080[_0x0a9e('0xe')],'path':_0x105080['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4bb1e3[_0x0a9e('0x10')](_0x53682f,function(_0x432e56){if(_0x432e56[_0x0a9e('0x11')]!==0xc8){_0x1c696a(new Error(_0x0a9e('0x12')+_0x1314ae+'\x20failed,\x20status\x20code\x20=\x20'+_0x432e56[_0x0a9e('0x11')]+'\x20('+_0x432e56[_0x0a9e('0x14')]+')'));return;}var _0x3b45bc='';_0x432e56['on'](_0x0a9e('0x1f'),function(_0x370d86){_0x3b45bc+=_0x370d86;});_0x432e56['on'](_0x0a9e('0x1c'),function(){_0x112016(_0x3b45bc);});})['on'](_0x0a9e('0x18'),function(_0x5ea472){_0x1c696a(_0x5ea472);})['end']();});}function convertFile(_0x197ec0,_0x3a8e58){return new BPromise(function(_0x40c424,_0x33161b){var _0x526cf3=sox[_0x0a9e('0x20')](_0x197ec0,_0x3a8e58,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x526cf3['on'](_0x0a9e('0x18'),function(_0x5bfb33){logger[_0x0a9e('0x18')](_0x0a9e('0x21'),_0x5bfb33);_0x33161b(_0x5bfb33);});_0x526cf3['on'](_0x0a9e('0x1c'),function(){logger[_0x0a9e('0x16')](_0x0a9e('0x22'));_0x40c424();});_0x526cf3[_0x0a9e('0x23')]();});}function base64Decode(_0x11c3b6,_0x14de77){var _0x5a101a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));fs['writeFileSync'](_0x5a101a,_0x11c3b6,_0x0a9e('0x28'));return convertFile(_0x5a101a,_0x14de77)[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x5a101a);fs[_0x0a9e('0x2a')](_0x14de77,_0x0a9e('0x2b'));}catch(_0x563b45){logger[_0x0a9e('0x18')](_0x563b45);}return _0x14de77[_0x0a9e('0x2c')]('.')[0x0];});}function base64Encode(_0x1dbde2){var _0x540530=fs[_0x0a9e('0x2d')](_0x1dbde2);return new Buffer(_0x540530)['toString'](_0x0a9e('0x28'));}exports[_0x0a9e('0x2e')]=function(_0x1122db,_0x33bdb7){var _0x25ce3a,_0x5180f1;return tts(_0x1122db,_0x33bdb7||'en',0x1)[_0x0a9e('0x29')](function(_0x46f0a5){logger[_0x0a9e('0x16')](_0x46f0a5);_0x25ce3a=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));return downloadFile(_0x46f0a5,_0x25ce3a);})[_0x0a9e('0x29')](function(){_0x5180f1=path['resolve'](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27'));return convertFile(_0x25ce3a,_0x5180f1);})[_0x0a9e('0x29')](function(){try{fs[_0x0a9e('0x19')](_0x25ce3a);fs[_0x0a9e('0x2a')](_0x5180f1,'777');}catch(_0x191e91){logger[_0x0a9e('0x18')](_0x191e91);}logger[_0x0a9e('0x16')](_0x0a9e('0x30'),_0x5180f1['split']('.')[0x0]);return _0x5180f1['split']('.')[0x0];});};exports[_0x0a9e('0x31')]=function(_0x5640eb,_0x24936a,_0x3d9717){return google[_0x0a9e('0x32')](_0x5640eb,_0x24936a,_0x3d9717)[_0x0a9e('0x29')](function(_0x4f41ae){logger[_0x0a9e('0x16')](_0x4f41ae[_0x0a9e('0x33')]);return rp(_0x4f41ae);})[_0x0a9e('0x29')](function(_0x533942){var _0x1dbf74='';var _0x1a180b=0x0;try{fs[_0x0a9e('0x19')](_0x5640eb);}catch(_0x4c1c0e){logger['error'](_0x4c1c0e);}if(_0x533942&&_0x533942[_0x0a9e('0x34')]){_0x1dbf74=_0x533942[_0x0a9e('0x34')]['map'](function(_0x2b814e){return _0x2b814e&&_0x2b814e[_0x0a9e('0x35')][0x0]&&_0x2b814e[_0x0a9e('0x35')][0x0][_0x0a9e('0x36')]?_0x2b814e['alternatives'][0x0]['transcript']:'';})[_0x0a9e('0x37')]('\x0a');_0x1a180b=_0x533942[_0x0a9e('0x34')]['map'](function(_0x183991){return _0x183991&&_0x183991[_0x0a9e('0x35')][0x0]&&_0x183991[_0x0a9e('0x35')][0x0]['confidence']?_0x183991[_0x0a9e('0x35')][0x0][_0x0a9e('0x38')]:0x0;})[_0x0a9e('0x37')]('\x0a');}logger[_0x0a9e('0x16')](_0x0a9e('0x39'),_0x1dbf74);logger[_0x0a9e('0x16')](_0x0a9e('0x3a'),_0x1a180b);return{'transcript':_0x1dbf74,'confidence':_0x1a180b};})[_0x0a9e('0x3b')](function(_0x23b089){logger[_0x0a9e('0x18')](_0x0a9e('0x3c'),_0x23b089[_0x0a9e('0x11')],_0x23b089[_0x0a9e('0x3d')],_0x23b089[_0x0a9e('0x3e')]);});};exports[_0x0a9e('0x3f')]=function(_0x4d04c8,_0x52628e,_0x473fdc,_0xb3795a){var _0x405c8f=apiai(_0x52628e,{'language':_0xb3795a||'en'});return _0x405c8f[_0x0a9e('0x40')](_0x473fdc,{'sessionId':md5(_0x4d04c8)})[_0x0a9e('0x29')](function(_0xc9a702){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0xc9a702));return{'source':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x43')],'resolvedQuery':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x44')],'action':_0xc9a702['result'][_0x0a9e('0x45')],'actionIncomplete':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x46')],'speech':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x47')][_0x0a9e('0x48')],'score':_0xc9a702[_0x0a9e('0x42')][_0x0a9e('0x49')],'statusCode':_0xc9a702['status'][_0x0a9e('0x4a')],'endConversation':_0xc9a702['result'][_0x0a9e('0x4b')][_0x0a9e('0x4c')]||![],'isFallbackIntent':_0xc9a702[_0x0a9e('0x42')]['metadata'][_0x0a9e('0x4d')]};});};exports[_0x0a9e('0x4e')]=function(_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73){return tilde[_0x0a9e('0x32')](_0x4774f4,_0x34aa5a,_0x45c845,_0x37be73)['then'](function(_0x13f44d){try{fs[_0x0a9e('0x19')](_0x4774f4);}catch(_0x1b5e80){logger[_0x0a9e('0x18')](_0x1b5e80);}logger[_0x0a9e('0x16')](_0x0a9e('0x4f'),_0x13f44d[_0x0a9e('0x36')]);logger[_0x0a9e('0x16')](_0x0a9e('0x50'),_0x13f44d['confidence']);return _0x13f44d;});};exports[_0x0a9e('0x51')]=function(_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3){var _0x37edaa=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x375c18;return aws['polly'](_0x3fe430,_0x4f7240,_0x4ae14b,_0x5ddf84,_0x1adfee,_0x4317e3,_0x37edaa)['then'](function(){_0x375c18=path['resolve'](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x37edaa,_0x375c18);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x37edaa);fs[_0x0a9e('0x2a')](_0x375c18,'777');}catch(_0x5a88da){logger[_0x0a9e('0x18')](_0x5a88da);}return _0x375c18['split']('.')[0x0];});};exports[_0x0a9e('0x52')]=function(_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return aws[_0x0a9e('0x53')](_0x4c3845,_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da)['then'](function(_0x50f687){logger[_0x0a9e('0x16')](JSON[_0x0a9e('0x41')](_0x50f687));return _0x50f687;});};exports['ispeechTTS']=function(_0x145931,_0x5ce9ac,_0x211ef9,_0x523cd2){var _0xe22ccc=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x145931,encodeURIComponent(_0x5ce9ac),_0x211ef9,_0x523cd2);var _0x5df0ad=path[_0x0a9e('0x24')](__dirname,'tmp',rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x2f'));var _0x3cfd00;return downloadFile(_0xe22ccc,_0x5df0ad)[_0x0a9e('0x29')](function(){_0x3cfd00=path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs[_0x0a9e('0x26')](0x4)+_0x0a9e('0x27'));return convertFile(_0x5df0ad,_0x3cfd00);})['then'](function(){try{fs[_0x0a9e('0x19')](_0x5df0ad);fs[_0x0a9e('0x2a')](_0x3cfd00,_0x0a9e('0x2b'));}catch(_0x30c491){logger[_0x0a9e('0x18')](_0x30c491);}return _0x3cfd00[_0x0a9e('0x2c')]('.')[0x0];});};exports['ispeechASR']=function(_0x956fbe,_0x26bc80,_0x5239ef,_0x3649cc){var _0x5cc8fb=util[_0x0a9e('0x54')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x26bc80,_0x5239ef,base64Encode(_0x956fbe),_0x3649cc?util['format']('model=%s',encodeURIComponent(_0x3649cc)):_0x0a9e('0x55'));return uploadFile(_0x5cc8fb)['then'](function(_0x2244d6){return querystring[_0x0a9e('0x56')](_0x2244d6);});};exports[_0x0a9e('0x57')]=function(_0x7be420,_0x1cca9f){return sestek[_0x0a9e('0x58')](_0x7be420,_0x1cca9f)['then'](function(_0x1627a7){logger['info'](JSON[_0x0a9e('0x41')](_0x1627a7));var _0x1f07cb={'speech':_0x1627a7[_0x0a9e('0x59')],'action':_0x1627a7['channelData']?_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5b')]:undefined,'actiondata':_0x1627a7[_0x0a9e('0x5a')]?_0x1627a7[_0x0a9e('0x5a')]['CustomActionData']:undefined};if(_0x1627a7[_0x0a9e('0x5a')]&&_0x1627a7[_0x0a9e('0x5a')]['AudioFromTts']){return base64Decode(_0x1627a7[_0x0a9e('0x5a')][_0x0a9e('0x5c')][_0x0a9e('0x5d')],path[_0x0a9e('0x24')](__dirname,_0x0a9e('0x25'),rs['generate'](0x4)+_0x0a9e('0x27')))[_0x0a9e('0x29')](function(_0x281c7d){_0x1f07cb['audiofile']=_0x281c7d;return _0x1f07cb;});}return _0x1f07cb;});};exports[_0x0a9e('0x5e')]=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 8a21a74..789214e 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 _0xd9c1=['exports','./nda'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd9c1,0x8d));var _0x1d9c=function(_0x1f5d08,_0x4eac44){_0x1f5d08=_0x1f5d08-0x0;var _0x4f99ac=_0xd9c1[_0x1f5d08];return _0x4f99ac;};var nda=require(_0x1d9c('0x0'));module[_0x1d9c('0x1')]={'nda':nda}; \ No newline at end of file +var _0xfbaf=['exports','./nda'];(function(_0x15ed84,_0x589521){var _0x426d2b=function(_0x5d294a){while(--_0x5d294a){_0x15ed84['push'](_0x15ed84['shift']());}};_0x426d2b(++_0x589521);}(_0xfbaf,0xcb));var _0xffba=function(_0x3412a9,_0x1ff7fe){_0x3412a9=_0x3412a9-0x0;var _0x2633fa=_0xfbaf[_0x3412a9];return _0x2633fa;};var nda=require(_0xffba('0x0'));module[_0xffba('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 cfc0861..9b465b4 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 _0x6020=['Nda','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','channelData','ProjectName','project','ndagenerate_audio','body','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','../../../../../config/logger','agi','POST','ndauth_url','/token','password','username','then','ndaactivity_type','message'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x6020,0xaa));var _0x0602=function(_0x17eba5,_0x434f32){_0x17eba5=_0x17eba5-0x0;var _0x1aa6f1=_0x6020[_0x17eba5];return _0x1aa6f1;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0x0602('0x0'))(_0x0602('0x1'));module['exports']=function(_0x20470e,_0x3a8052){var _0x1ccc33={'method':_0x0602('0x2'),'uri':url['resolve'](_0x3a8052[_0x0602('0x3')],_0x0602('0x4')),'form':{'grant_type':_0x0602('0x5'),'username':_0x3a8052[_0x0602('0x6')],'password':_0x3a8052['password']},'json':!![]};return rp(_0x1ccc33)[_0x0602('0x7')](function(_0x18c39f){var _0x46c237={'method':_0x0602('0x2'),'uri':url['resolve'](_0x3a8052['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3a8052[_0x0602('0x8')]||_0x0602('0x9'),'channelId':_0x0602('0xa'),'conversation':{'id':_0x20470e[_0x0602('0xb')]},'from':{'id':_0x20470e[_0x0602('0xc')],'name':_0x20470e[_0x0602('0xd')]},'recipient':{'id':_0x20470e[_0x0602('0xe')],'name':_0x20470e['extension']},'text':_0x3a8052[_0x0602('0xf')],'channelData':{}},'headers':{'Authorization':_0x0602('0x10')+_0x18c39f['access_token']},'json':!![]};if(_0x3a8052['project']){_0x46c237['body'][_0x0602('0x11')][_0x0602('0x12')]=_0x3a8052[_0x0602('0x13')];}if(_0x3a8052[_0x0602('0x14')]=='1'){_0x46c237[_0x0602('0x15')][_0x0602('0x11')][_0x0602('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x0602('0x17')};}if(_0x3a8052['custom_action']){_0x46c237[_0x0602('0x15')]['channelData'][_0x0602('0x18')]=_0x3a8052[_0x0602('0x19')];if(_0x3a8052[_0x0602('0x1a')]){_0x46c237['body'][_0x0602('0x11')][_0x0602('0x1b')]=_0x3a8052[_0x0602('0x1a')];}}logger[_0x0602('0x1c')](JSON[_0x0602('0x1d')](_0x46c237));return rp(_0x46c237);});}; \ No newline at end of file +var _0x0155=['calleridname','extension','text','access_token','project','ProjectName','ndagenerate_audio','channelData','audio/wav','custom_action','body','CustomAction','custom_action_data','info','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','password','username','then','POST','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid'];(function(_0x5cc3ba,_0x1eac8f){var _0x1c541f=function(_0x4f35e1){while(--_0x4f35e1){_0x5cc3ba['push'](_0x5cc3ba['shift']());}};_0x1c541f(++_0x1eac8f);}(_0x0155,0x182));var _0x5015=function(_0x22e455,_0x1ec884){_0x22e455=_0x22e455-0x0;var _0x139ff6=_0x0155[_0x22e455];return _0x139ff6;};'use strict';var rp=require('request-promise');var url=require(_0x5015('0x0'));var logger=require(_0x5015('0x1'))(_0x5015('0x2'));module[_0x5015('0x3')]=function(_0x4a5c40,_0x31baae){var _0x4e279f={'method':'POST','uri':url[_0x5015('0x4')](_0x31baae[_0x5015('0x5')],'/token'),'form':{'grant_type':_0x5015('0x6'),'username':_0x31baae[_0x5015('0x7')],'password':_0x31baae['password']},'json':!![]};return rp(_0x4e279f)[_0x5015('0x8')](function(_0x573261){var _0x1acba6={'method':_0x5015('0x9'),'uri':url['resolve'](_0x31baae[_0x5015('0xa')],_0x5015('0xb')),'body':{'type':_0x31baae[_0x5015('0xc')]||_0x5015('0xd'),'channelId':_0x5015('0xe'),'conversation':{'id':_0x4a5c40[_0x5015('0xf')]},'from':{'id':_0x4a5c40[_0x5015('0x10')],'name':_0x4a5c40[_0x5015('0x11')]},'recipient':{'id':_0x4a5c40['dnid'],'name':_0x4a5c40[_0x5015('0x12')]},'text':_0x31baae[_0x5015('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x573261[_0x5015('0x14')]},'json':!![]};if(_0x31baae[_0x5015('0x15')]){_0x1acba6['body']['channelData'][_0x5015('0x16')]=_0x31baae[_0x5015('0x15')];}if(_0x31baae[_0x5015('0x17')]=='1'){_0x1acba6['body'][_0x5015('0x18')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x5015('0x19')};}if(_0x31baae[_0x5015('0x1a')]){_0x1acba6[_0x5015('0x1b')][_0x5015('0x18')][_0x5015('0x1c')]=_0x31baae[_0x5015('0x1a')];if(_0x31baae[_0x5015('0x1d')]){_0x1acba6[_0x5015('0x1b')][_0x5015('0x18')]['CustomActionData']=_0x31baae[_0x5015('0x1d')];}}logger[_0x5015('0x1e')](JSON['stringify'](_0x1acba6));return rp(_0x1acba6);});}; \ 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 1cba805..2377c81 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 _0x502a=['exports','./lib/api'];(function(_0x3e227b,_0x3e1b5c){var _0x1c0226=function(_0x5dd9e6){while(--_0x5dd9e6){_0x3e227b['push'](_0x3e227b['shift']());}};_0x1c0226(++_0x3e1b5c);}(_0x502a,0x18b));var _0xa502=function(_0x4dd5f9,_0x5e89d4){_0x4dd5f9=_0x4dd5f9-0x0;var _0x1b0d95=_0x502a[_0x4dd5f9];return _0x1b0d95;};'use strict';var asr=require(_0xa502('0x0'));module[_0xa502('0x1')]=function(_0x1e33ef,_0x21a6d6,_0x56873d,_0x3685b6){return asr(_0x1e33ef,_0x21a6d6,_0x56873d,_0x3685b6);}; \ No newline at end of file +var _0xd9cf=['./lib/api'];(function(_0x3753bd,_0x5dc267){var _0x157872=function(_0x20fccd){while(--_0x20fccd){_0x3753bd['push'](_0x3753bd['shift']());}};_0x157872(++_0x5dc267);}(_0xd9cf,0xf8));var _0xfd9c=function(_0x11bb2e,_0x5b27ee){_0x11bb2e=_0x11bb2e-0x0;var _0x2bf0f4=_0xd9cf[_0x11bb2e];return _0x2bf0f4;};'use strict';var asr=require(_0xfd9c('0x0'));module['exports']=function(_0x3f4859,_0x541bad,_0x46d85e,_0x5e42f8){return asr(_0x3f4859,_0x541bad,_0x46d85e,_0x5e42f8);}; \ 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 69f1704..b6f8aa3 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 _0x2147=['exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','update','digest','hex','info','send','stringify','createReadStream','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','agi'];(function(_0x20d140,_0x175c2f){var _0x5516a9=function(_0x2d3bf5){while(--_0x2d3bf5){_0x20d140['push'](_0x20d140['shift']());}};_0x5516a9(++_0x175c2f);}(_0x2147,0x7a));var _0x7214=function(_0x4ba024,_0x69bd9a){_0x4ba024=_0x4ba024-0x0;var _0x45ebe3=_0x2147[_0x4ba024];return _0x45ebe3;};'use strict';var BPromise=require(_0x7214('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7214('0x1'));var crypto=require(_0x7214('0x2'));var logger=require('../../../../../../config/logger')(_0x7214('0x3'));module[_0x7214('0x4')]=function(_0x535ec0,_0x4a7d5b,_0x4b0a3c,_0x2fe3dc){return new BPromise(function(_0x551334,_0xd55d84){logger['info'](_0x7214('0x5'),_0x2fe3dc||_0x7214('0x6'));var _0xc539c1=new WebSocket(_0x2fe3dc||_0x7214('0x6'),{'perMessageDeflate':![]});var _0x1bd4ee='';var _0x532fe3='0';var _0xd72688='1';var _0x3c3210='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4a0ac1(_0xf61f37){var _0x149897=crypto[_0x7214('0x7')]('sha1');_0x149897[_0x7214('0x8')](_0xf61f37);return _0x149897[_0x7214('0x9')](_0x7214('0xa'));}function _0x369a56(){try{logger[_0x7214('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x2611e3=moment()['unix']();var _0x12e9f9=_0x4a0ac1(_0x2611e3+_0x4a7d5b+_0x4b0a3c);_0xc539c1[_0x7214('0xc')](JSON[_0x7214('0xd')]({'appID':_0x4a7d5b,'timestamp':_0x2611e3,'appKey':_0x12e9f9}));var _0x13160b=fs[_0x7214('0xe')](_0x535ec0);_0x13160b['on'](_0x7214('0xf'),function(_0x263da9){_0xc539c1[_0x7214('0xc')](_0x263da9);});_0x13160b['on'](_0x7214('0x10'),function(){_0xc539c1['send'](_0x7214('0x11'));});}catch(_0x4a87f4){logger['error'](_0x7214('0x12'),JSON[_0x7214('0xd')](_0x4a87f4));_0xc539c1[_0x7214('0x13')]();}}function _0x2da1d4(_0x54708c){try{if(_0x54708c){var _0x452276=JSON[_0x7214('0x14')](_0x54708c);switch(_0x452276[_0x7214('0x15')]){case 0x0:if(_0x452276[_0x7214('0x16')]){if(_0x452276['result'][_0x7214('0x17')]){logger[_0x7214('0xb')](_0x7214('0x18'),JSON[_0x7214('0xd')](_0x452276[_0x7214('0x16')][_0x7214('0x19')]));_0x1bd4ee=_0x452276[_0x7214('0x16')]['hypotheses'][0x0][_0x7214('0x1a')];_0x532fe3=_0x452276['result'][_0x7214('0x19')][0x0][_0x7214('0x1b')];_0xd72688='0';_0x3c3210=_0x7214('0x1c');_0xc539c1[_0x7214('0x13')]();}}break;case 0x1:logger[_0x7214('0xb')](_0x7214('0x1d'));_0xd72688='1';_0x3c3210=_0x7214('0x1d');break;case 0x2:logger[_0x7214('0xb')](_0x7214('0x1e'));_0xd72688='2';_0x3c3210='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x7214('0x1f'));_0xd72688='9';_0x3c3210=_0x7214('0x1f');break;case 0xa:logger[_0x7214('0xb')]('Authentication\x20failed.');_0xd72688='10';_0x3c3210=_0x7214('0x20');break;case 0xb:logger['info'](_0x7214('0x21'));_0xd72688='11';_0x3c3210='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1e1ea9){logger[_0x7214('0x22')](_0x7214('0x23'),JSON[_0x7214('0xd')](_0x1e1ea9));_0xc539c1['terminate']();}}function _0x2af241(){logger[_0x7214('0xb')](_0x7214('0x24'));_0x551334({'transcript':_0x1bd4ee,'confidence':_0x532fe3,'status':_0xd72688,'status_message':_0x3c3210});}function _0x31746b(_0x101c17){logger['error'](_0x7214('0x25'));if(!_[_0x7214('0x26')](_0x101c17)){logger[_0x7214('0x22')](_[_0x7214('0x27')](_0x101c17)?JSON[_0x7214('0xd')](_0x101c17):_0x101c17);}}_0xc539c1['on'](_0x7214('0x28'),_0x369a56);_0xc539c1['on'](_0x7214('0x29'),_0x2da1d4);_0xc539c1['on'](_0x7214('0x10'),_0x2af241);_0xc539c1['on']('error',_0x31746b);});}; \ No newline at end of file +var _0x756f=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','../../../../../../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','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x435fa1,_0x58550a){var _0x845f9f=function(_0x89867e){while(--_0x89867e){_0x435fa1['push'](_0x435fa1['shift']());}};_0x845f9f(++_0x58550a);}(_0x756f,0x88));var _0xf756=function(_0x5674e9,_0x431b61){_0x5674e9=_0x5674e9-0x0;var _0x137491=_0x756f[_0x5674e9];return _0x137491;};'use strict';var BPromise=require(_0xf756('0x0'));var _=require(_0xf756('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xf756('0x2'))(_0xf756('0x3'));module[_0xf756('0x4')]=function(_0x11686f,_0x2e2479,_0x13ebf2,_0x40acad){return new BPromise(function(_0x270311,_0x2fc9ff){logger[_0xf756('0x5')](_0xf756('0x6'),_0x40acad||_0xf756('0x7'));var _0x256813=new WebSocket(_0x40acad||_0xf756('0x7'),{'perMessageDeflate':![]});var _0x1b6c05='';var _0x598864='0';var _0xfff1fd='1';var _0x4300fa=_0xf756('0x8');function _0x5e503c(_0x3d7ab9){var _0x26acfd=crypto[_0xf756('0x9')](_0xf756('0xa'));_0x26acfd[_0xf756('0xb')](_0x3d7ab9);return _0x26acfd[_0xf756('0xc')](_0xf756('0xd'));}function _0x1cf2dc(){try{logger['info'](_0xf756('0xe'));var _0x1906d2=moment()[_0xf756('0xf')]();var _0x2545c2=_0x5e503c(_0x1906d2+_0x2e2479+_0x13ebf2);_0x256813[_0xf756('0x10')](JSON[_0xf756('0x11')]({'appID':_0x2e2479,'timestamp':_0x1906d2,'appKey':_0x2545c2}));var _0x44f14e=fs[_0xf756('0x12')](_0x11686f);_0x44f14e['on'](_0xf756('0x13'),function(_0x1f83b2){_0x256813[_0xf756('0x10')](_0x1f83b2);});_0x44f14e['on'](_0xf756('0x14'),function(){_0x256813[_0xf756('0x10')](_0xf756('0x15'));});}catch(_0x33d5c5){logger[_0xf756('0x16')](_0xf756('0x17'),JSON[_0xf756('0x11')](_0x33d5c5));_0x256813['terminate']();}}function _0x52b26b(_0x59f3ae){try{if(_0x59f3ae){var _0xf91540=JSON[_0xf756('0x18')](_0x59f3ae);switch(_0xf91540[_0xf756('0x19')]){case 0x0:if(_0xf91540[_0xf756('0x1a')]){if(_0xf91540[_0xf756('0x1a')][_0xf756('0x1b')]){logger['info'](_0xf756('0x1c'),JSON[_0xf756('0x11')](_0xf91540[_0xf756('0x1a')][_0xf756('0x1d')]));_0x1b6c05=_0xf91540[_0xf756('0x1a')][_0xf756('0x1d')][0x0][_0xf756('0x1e')];_0x598864=_0xf91540['result'][_0xf756('0x1d')][0x0][_0xf756('0x1f')];_0xfff1fd='0';_0x4300fa=_0xf756('0x20');_0x256813['terminate']();}}break;case 0x1:logger[_0xf756('0x5')](_0xf756('0x8'));_0xfff1fd='1';_0x4300fa=_0xf756('0x8');break;case 0x2:logger[_0xf756('0x5')](_0xf756('0x21'));_0xfff1fd='2';_0x4300fa=_0xf756('0x21');break;case 0x9:logger[_0xf756('0x5')](_0xf756('0x22'));_0xfff1fd='9';_0x4300fa=_0xf756('0x22');break;case 0xa:logger[_0xf756('0x5')](_0xf756('0x23'));_0xfff1fd='10';_0x4300fa=_0xf756('0x23');break;case 0xb:logger[_0xf756('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0xfff1fd='11';_0x4300fa=_0xf756('0x24');}}}catch(_0x28be9f){logger['error'](_0xf756('0x25'),JSON[_0xf756('0x11')](_0x28be9f));_0x256813['terminate']();}}function _0x15e34c(){logger[_0xf756('0x5')](_0xf756('0x26'));_0x270311({'transcript':_0x1b6c05,'confidence':_0x598864,'status':_0xfff1fd,'status_message':_0x4300fa});}function _0xf0d7d9(_0x28e8de){logger[_0xf756('0x16')](_0xf756('0x27'));if(!_[_0xf756('0x28')](_0x28e8de)){logger['error'](_[_0xf756('0x29')](_0x28e8de)?JSON['stringify'](_0x28e8de):_0x28e8de);}}_0x256813['on'](_0xf756('0x2a'),_0x1cf2dc);_0x256813['on']('message',_0x52b26b);_0x256813['on'](_0xf756('0x14'),_0x15e34c);_0x256813['on'](_0xf756('0x16'),_0xf0d7d9);});}; \ 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 107a9b1..13b076d 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 _0x34e8=['./asr','exports'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0x34e8,0x12c));var _0x834e=function(_0x342758,_0x211ff5){_0x342758=_0x342758-0x0;var _0x112b76=_0x34e8[_0x342758];return _0x112b76;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file +var _0x34e8=['./asr','exports'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x34e8,0x12c));var _0x834e=function(_0x12ae53,_0x1a9bc1){_0x12ae53=_0x12ae53-0x0;var _0x169b0e=_0x34e8[_0x12ae53];return _0x169b0e;};var asr=require(_0x834e('0x0'));module[_0x834e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4e09fbe..e0aa519 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 _0x2b32=['E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b32,0x97));var _0x22b3=function(_0x2d5678,_0xdfb48f){_0x2d5678=_0x2d5678-0x0;var _0x4ad11a=_0x2b32[_0x2d5678];return _0x4ad11a;};'use strict';var util=require(_0x22b3('0x0'));var net=require(_0x22b3('0x1'));var EventEmitter=require(_0x22b3('0x2'))[_0x22b3('0x3')];var AGIError=require(_0x22b3('0x4'));var AGIChannel=require(_0x22b3('0x5'));var AGIServer=function(_0x2e0bb1,_0xe4a6ad,_0x54bb56){var _0x2c45a9=this,_0x2e0bb1=_0x2e0bb1||0x11dd,_0xe4a6ad=_0xe4a6ad||_0x22b3('0x6'),_0x5e16ed=null,_0x221714=0x0;EventEmitter['call'](_0x2c45a9);function _0x1a622f(){if(!_0x2e0bb1){_0x2c45a9[_0x22b3('0x7')](_0x22b3('0x8'),new AGIError(_0x22b3('0x9')));return![];}_0x5e16ed=net[_0x22b3('0xa')]();_0x5e16ed[_0x22b3('0xb')](_0x2e0bb1,_0xe4a6ad);_0x5e16ed['on'](_0x22b3('0xc'),function(){_0x2c45a9['emit'](_0x22b3('0xc'));});_0x5e16ed['on'](_0x22b3('0xd'),function(_0x2d5433){_0x5e16ed[_0x22b3('0xe')](function(_0x2d21f4,_0x5581eb){if(_0x2d21f4){_0x2c45a9['emit'](_0x22b3('0x8'),new AGIError(_0x22b3('0xf'),_0x2d21f4));}else if(_0x54bb56&&_0x54bb56<0x0){_0x2c45a9[_0x22b3('0x7')](_0x22b3('0x8'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x2d5433[_0x22b3('0x10')]();}else if(_0x54bb56&&_0x54bb56>0x0&&_0x54bb56<_0x5581eb){_0x221714+=0x1;_0x2c45a9[_0x22b3('0x7')](_0x22b3('0x8'),new AGIError(_0x22b3('0x11'),_0x221714));_0x2d5433[_0x22b3('0x10')]();}else{var _0x228046=new AGIChannel(_0x2d5433);_0x228046['on'](_0x22b3('0x12'),function(){_0x2c45a9[_0x22b3('0x7')](_0x22b3('0xd'),_0x228046);});}});});_0x5e16ed['on']('error',function(_0x1ffd89){_0x2c45a9[_0x22b3('0x7')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x1ffd89['code']));});_0x5e16ed['on']('close',function(){_0x2c45a9[_0x22b3('0x7')](_0x22b3('0x13'),new AGIError(_0x22b3('0x14')));});}process[_0x22b3('0x15')](function(){_0x1a622f();});};util[_0x22b3('0x16')](AGIServer,EventEmitter);module[_0x22b3('0x17')]=function(_0x105cb4,_0x1469eb,_0x1be5aa){return new AGIServer(_0x105cb4,_0x1469eb,_0x1be5aa);}; \ No newline at end of file +var _0x7cc4=['code','close','nextTick','exports','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','error','destroy','ready','E_AGI_SERVER_ERROR'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cc4,0x1a8));var _0x47cc=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0x7cc4[_0xaf25ae];return _0x49732d;};'use strict';var util=require('util');var net=require(_0x47cc('0x0'));var EventEmitter=require(_0x47cc('0x1'))[_0x47cc('0x2')];var AGIError=require(_0x47cc('0x3'));var AGIChannel=require(_0x47cc('0x4'));var AGIServer=function(_0x138e40,_0x167543,_0x515da9){var _0x364ac6=this,_0x138e40=_0x138e40||0x11dd,_0x167543=_0x167543||_0x47cc('0x5'),_0x347672=null,_0x4aab27=0x0;EventEmitter[_0x47cc('0x6')](_0x364ac6);function _0x21f13e(){if(!_0x138e40){_0x364ac6[_0x47cc('0x7')]('error',new AGIError(_0x47cc('0x8')));return![];}_0x347672=net[_0x47cc('0x9')]();_0x347672['listen'](_0x138e40,_0x167543);_0x347672['on'](_0x47cc('0xa'),function(){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xa'));});_0x347672['on'](_0x47cc('0xb'),function(_0x221818){_0x347672[_0x47cc('0xc')](function(_0x933cea,_0x2ea168){if(_0x933cea){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xd'),new AGIError('E_AGI_SERVER_ERROR',_0x933cea));}else if(_0x515da9&&_0x515da9<0x0){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xd'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x221818['destroy']();}else if(_0x515da9&&_0x515da9>0x0&&_0x515da9<_0x2ea168){_0x4aab27+=0x1;_0x364ac6['emit'](_0x47cc('0xd'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4aab27));_0x221818[_0x47cc('0xe')]();}else{var _0x4d2229=new AGIChannel(_0x221818);_0x4d2229['on'](_0x47cc('0xf'),function(){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xb'),_0x4d2229);});}});});_0x347672['on']('error',function(_0x672603){_0x364ac6[_0x47cc('0x7')](_0x47cc('0xd'),new AGIError(_0x47cc('0x10'),_0x672603[_0x47cc('0x11')]));});_0x347672['on'](_0x47cc('0x12'),function(){_0x364ac6[_0x47cc('0x7')](_0x47cc('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x47cc('0x13')](function(){_0x21f13e();});};util['inherits'](AGIServer,EventEmitter);module[_0x47cc('0x14')]=function(_0x56880a,_0x3f37ac,_0x1d81da){return new AGIServer(_0x56880a,_0x3f37ac,_0x1d81da);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index e4f3e27..e0c413e 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 _0x573a=['split','length','toString','getAndSetVariable','result','extra','setVariable','maxRetry','retry','info','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','label','no\x20list\x20selected','delay','add','sync','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','options','noop','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','SIP/%s','opts','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','getdigits','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','test','stringify','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','aws_bot_name','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','beep','intKey','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','condition','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','findBy','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','no\x20operation\x20configured','math\x20%s','operation','isArray','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','url','macro','gosub','recordingFormat','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','saynumber','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','bcc','subject','service','host','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','success','voicemail','mailbox','VOICEMAIL','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','agi','./scripts','/var/opt/motion2/server/files','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','dsn','getUserById','getTrunkById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','open','error','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','ispeech_asr_language','en-US','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','aws_lex_region','googleASR','tildeASR','appid','appsecret','uri','includes','agicommand','clone','hasOwnProperty','isString','replaceAllVariables'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x573a,0x124));var _0xa573=function(_0x4c184d,_0x4278ab){_0x4c184d=_0x4c184d-0x0;var _0x23d997=_0x573a[_0x4c184d];return _0x23d997;};'use strict';var fs=require('fs');var path=require(_0xa573('0x0'));var util=require(_0xa573('0x1'));var _=require('lodash');var sh=require(_0xa573('0x2'));var odbc=require(_0xa573('0x3'))();var rs=require(_0xa573('0x4'));var moment=require(_0xa573('0x5'));var Mustache=require(_0xa573('0x6'));var logger=require('../../config/logger')(_0xa573('0x7'));var config=require('../../config/environment');var scripts=require(_0xa573('0x8'));var FILES_PATH=_0xa573('0x9');var verticesWithRetry=['menu','getdigits',_0xa573('0xa')];var AGIVertices=function(_0x1c7332,_0x2529f1,_0x14a0b5){this[_0xa573('0xb')]=_0x1c7332;this[_0xa573('0xc')]=_0x2529f1;this[_0xa573('0xd')]=_0x14a0b5;};AGIVertices[_0xa573('0xe')][_0xa573('0xf')]=function(_0x1a8fe0,_0x575b2f){this[_0xa573('0xc')][_0xa573('0x10')](_0x1a8fe0)['then'](function(_0x20d4b9){_0x575b2f(null,_0x20d4b9?_0x20d4b9[_0xa573('0x11')]:![]);})[_0xa573('0x12')](function(_0x429bb9){_0x575b2f(_0x429bb9);});};AGIVertices[_0xa573('0xe')][_0xa573('0x13')]=function(_0x2dda47,_0x43231c){this[_0xa573('0xc')][_0xa573('0x14')](_0x2dda47)['then'](function(_0x1b5253){_0x43231c(null,_0x1b5253?_0x1b5253[_0xa573('0x11')]:![]);})[_0xa573('0x12')](function(_0xe4691d){_0x43231c(_0xe4691d);});};AGIVertices[_0xa573('0xe')][_0xa573('0x15')]=function(_0x19fc97,_0x23da4b){this[_0xa573('0xc')][_0xa573('0x16')](_0x19fc97)[_0xa573('0x17')](function(_0x21f4ef){_0x23da4b(null,_0x21f4ef?_0x21f4ef[_0xa573('0x11')]:![]);})[_0xa573('0x12')](function(_0x305c47){_0x23da4b(_0x305c47);});};AGIVertices[_0xa573('0xe')][_0xa573('0x18')]=function(_0x224a7d,_0x51154a){this[_0xa573('0xc')][_0xa573('0x19')](_0x224a7d)[_0xa573('0x17')](function(_0x25618e){_0x51154a(null,_0x25618e?_0x25618e[_0xa573('0x1a')]:![]);})[_0xa573('0x12')](function(_0x2f4944){_0x51154a(_0x2f4944);});};AGIVertices['prototype']['getUser']=function(_0x535e33,_0x2bba3b){this[_0xa573('0xc')][_0xa573('0x1b')](_0x535e33)[_0xa573('0x17')](function(_0x333fd8){_0x2bba3b(null,_0x333fd8?_0x333fd8[_0xa573('0x11')]:![]);})['catch'](function(_0x568baa){_0x2bba3b(_0x568baa);});};AGIVertices[_0xa573('0xe')]['getTrunk']=function(_0x424270,_0x2e28c1){this[_0xa573('0xc')][_0xa573('0x1c')](_0x424270)[_0xa573('0x17')](function(_0x533747){_0x2e28c1(null,_0x533747?_0x533747['name']:![]);})['catch'](function(_0x16f9cb){_0x2e28c1(_0x16f9cb);});};AGIVertices['prototype']['getSound']=function(_0x12d0b1,_0x373a16){var _0x431a04=this;this[_0xa573('0xc')]['getSoundById'](_0x12d0b1)['then'](function(_0x3654c8){_0x373a16(null,_0x3654c8?_0x431a04['getSoundPath'](_0x3654c8[_0xa573('0x1d')]):![]);})[_0xa573('0x12')](function(_0x18148f){_0x373a16(_0x18148f);});};AGIVertices[_0xa573('0xe')][_0xa573('0x1e')]=function(_0x47fcd6,_0x321895){this[_0xa573('0xc')][_0xa573('0x1f')](_0x47fcd6)[_0xa573('0x17')](function(_0x154365){_0x321895(null,_0x154365?_0x154365:![]);})[_0xa573('0x12')](function(_0x396e6c){_0x321895(_0x396e6c);});};AGIVertices[_0xa573('0xe')]['sendMailMessage']=function(_0x36eba5,_0x54a470,_0x210b50){this[_0xa573('0xd')][_0xa573('0x20')](_0x36eba5,_0x54a470)[_0xa573('0x17')](function(){_0x210b50(null);})['catch'](function(_0x40fb37){_0x210b50(_0x40fb37);});};AGIVertices['prototype'][_0xa573('0x21')]=function(_0x506c38,_0xde4b18){this[_0xa573('0xc')][_0xa573('0x22')](_0x506c38)[_0xa573('0x17')](function(_0x37cf00){if(_0x37cf00){if(_0x37cf00[_0xa573('0x23')]){_0xde4b18(null,[_0x37cf00[_0xa573('0x24')]]);}else{_0xde4b18(null,_[_0xa573('0x25')](_0x37cf00[_0xa573('0x26')],_0xa573('0x24')));}}else{_0xde4b18(null,![]);}})['catch'](function(_0xbd7792){_0xde4b18(_0xbd7792);});};AGIVertices[_0xa573('0xe')][_0xa573('0x27')]=function(_0x515c8f){return util[_0xa573('0x28')]('%s/sounds/converted/%s',FILES_PATH,_0x515c8f);};AGIVertices[_0xa573('0xe')]['getQueryOdbc']=function(_0x590d7f,_0xcd9681,_0x2fc42c){odbc[_0xa573('0x29')](_0x590d7f,function(_0x3e4c31){if(_0x3e4c31){logger[_0xa573('0x2a')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x3e4c31);_0x2fc42c(_0x3e4c31);}else{logger['info'](_0xa573('0x2b'));odbc[_0xa573('0x2c')](_0xcd9681,function(_0x22230c,_0x3b9e29){if(_0x22230c){logger['info'](_0xa573('0x2d'),_0xcd9681);_0x2fc42c(_0x22230c);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0xcd9681);odbc['close'](function(_0x2517d7){if(_0x2517d7){logger['error'](_0xa573('0x2e'),_0x2517d7);}_0x2fc42c(null,_0x3b9e29);});}});}});};AGIVertices[_0xa573('0xe')][_0xa573('0x2f')]=function(_0x247b80,_0x4101f8){this[_0xa573('0xc')][_0xa573('0x30')](_0x247b80)[_0xa573('0x17')](function(_0x18254f){_0x4101f8(null,_0x18254f?_0x18254f:![]);})[_0xa573('0x12')](function(_0x27bece){_0x4101f8(_0x27bece);});};AGIVertices[_0xa573('0xe')]['createSmsMessage']=function(_0x33c1e7,_0x193b5b){this[_0xa573('0xc')][_0xa573('0x31')](_0x33c1e7)[_0xa573('0x17')](function(_0x118efd){_0x193b5b(null,_0x118efd);})[_0xa573('0x12')](function(_0x43e05c){_0x193b5b(_0x43e05c);});};AGIVertices[_0xa573('0xe')][_0xa573('0x32')]=function(_0x287204,_0x665dc2,_0x39d2f8){this[_0xa573('0xc')][_0xa573('0x32')]({'uniqueid':this['channel'][_0xa573('0x33')],'node':_0x287204['label'],'application':_0x287204['agicommand'],'data':_0x665dc2||null,'project_name':this[_0xa573('0xb')]['arg_1'],'callerid':this[_0xa573('0xb')][_0xa573('0x34')]})[_0xa573('0x17')](function(_0x123337){if(_0x39d2f8){_0x39d2f8(null,_0x123337);}})[_0xa573('0x12')](function(_0x41c0be){if(_0x39d2f8){_0x39d2f8(_0x41c0be);}});};AGIVertices[_0xa573('0xe')]['createSquareRecording']=function(_0x24240c,_0x3d9fea,_0x519d0a,_0x3cae67){this[_0xa573('0xc')][_0xa573('0x35')]({'uniqueid':this[_0xa573('0xb')][_0xa573('0x33')],'callerid':this[_0xa573('0xb')]['callerid'],'calleridname':this[_0xa573('0xb')][_0xa573('0x36')],'context':this[_0xa573('0xb')][_0xa573('0x37')],'extension':this['channel'][_0xa573('0x38')],'priority':this[_0xa573('0xb')][_0xa573('0x39')],'accountcode':this[_0xa573('0xb')][_0xa573('0x3a')],'dnid':this[_0xa573('0xb')]['dnid'],'projectName':this['channel'][_0xa573('0x3b')],'saveName':_0x3d9fea,'filename':_0x24240c[_0xa573('0x3c')]||_0x3d9fea,'savePath':_0x519d0a})[_0xa573('0x17')](function(_0x25f256){_0x3cae67(null,_0x25f256);})[_0xa573('0x12')](function(_0x53f64d){_0x3cae67(_0x53f64d);});};AGIVertices[_0xa573('0xe')][_0xa573('0x3d')]=function(_0x4d4b76,_0x23d32b,_0x2eaf14){this[_0xa573('0xc')][_0xa573('0x3d')]({'uniqueid':this[_0xa573('0xb')][_0xa573('0x33')],'body':_0x4d4b76,'direction':_0x23d32b})[_0xa573('0x17')](function(_0x115469){if(_0x2eaf14){_0x2eaf14(null,_0x115469);}})[_0xa573('0x12')](function(_0x5216ef){if(_0x2eaf14){_0x2eaf14(_0x5216ef);}});};AGIVertices[_0xa573('0xe')][_0xa573('0x3e')]=function(_0x56d5f6,_0x5b7c){this[_0xa573('0xc')][_0xa573('0x3e')]({'firstName':_[_0xa573('0x3f')](_0x56d5f6[_0xa573('0x11')])||_[_0xa573('0x40')](_0x56d5f6[_0xa573('0x11')])?_0xa573('0x41')+Math[_0xa573('0x42')]():_0x56d5f6[_0xa573('0x11')],'lastName':_[_0xa573('0x3f')](_0x56d5f6[_0xa573('0x43')])||_[_0xa573('0x40')](_0x56d5f6[_0xa573('0x43')])?null:_0x56d5f6['lastName'],'phone':_0x56d5f6[_0xa573('0x44')],'ListId':_0x56d5f6[_0xa573('0x45')],'scheduledAt':_0x56d5f6[_0xa573('0x46')],'callbackUniqueid':this['channel'][_0xa573('0x33')],'tags':_0xa573('0x47'),'description':'Callback\x20scheduled\x20at\x20'+_0x56d5f6[_0xa573('0x46')]['toString'](),'priority':_0x56d5f6[_0xa573('0x48')]})[_0xa573('0x17')](function(_0x50d1b8){_0x5b7c(null,_0x50d1b8);})[_0xa573('0x12')](function(_0x1c160d){_0x5b7c(_0x1c160d);});};AGIVertices['prototype'][_0xa573('0x49')]=function(_0x418332,_0x46a9d7){this[_0xa573('0xc')][_0xa573('0x4a')](_0x418332)[_0xa573('0x17')](function(_0x2700dd){_0x46a9d7(null,_0x2700dd?_0x2700dd[_0xa573('0x11')]:![]);})[_0xa573('0x12')](function(_0x36267e){_0x46a9d7(_0x36267e);});};AGIVertices['prototype'][_0xa573('0x4b')]=function(_0x4239d9,_0x107324,_0x520949){var _0x44038d={'role':_0xa573('0x4c')};_0x44038d[_0x4239d9]=this[_0xa573('0xb')][_0xa573('0x34')];this['rpc'][_0xa573('0x4b')](_0x44038d,_0x107324,this['channel'][_0xa573('0x33')])[_0xa573('0x17')](function(_0x3e0779){_0x520949(null,_[_0xa573('0x40')](_0x3e0779)?![]:!![]);})[_0xa573('0x12')](function(_0x13ae94){logger[_0xa573('0x2a')](_0x13ae94);_0x520949(null,![]);});};AGIVertices[_0xa573('0xe')][_0xa573('0x4d')]=function(_0x2f3828,_0x35ebe2){var _0x394e57={'role':_0xa573('0x4c')};_0x394e57[_0x2f3828]=this['channel']['callerid'];this['rpc'][_0xa573('0x4d')](_0x394e57)[_0xa573('0x17')](function(_0x53355c){_0x35ebe2(null,_[_0xa573('0x40')](_0x53355c)?![]:!![]);})[_0xa573('0x12')](function(_0x3f822d){logger['error'](_0x3f822d);_0x35ebe2(null,![]);});};AGIVertices['prototype'][_0xa573('0x4e')]=function(_0xbf9240,_0x5c32ee){var _0x184394={'role':_0xa573('0x4c')};_0x184394[_0xbf9240]=this[_0xa573('0xb')]['callerid'];this[_0xa573('0xc')]['agentLogout'](_0x184394)[_0xa573('0x17')](function(_0x17bca8){_0x5c32ee(null,_[_0xa573('0x40')](_0x17bca8)?![]:!![]);})[_0xa573('0x12')](function(_0x222c72){logger[_0xa573('0x2a')](_0x222c72);_0x5c32ee(null,![]);});};AGIVertices[_0xa573('0xe')][_0xa573('0x4f')]=function(_0x41b475,_0x2f6b8e){var _0x54b199={'role':_0xa573('0x4c')};_0x54b199[_0x41b475]=this[_0xa573('0xb')][_0xa573('0x34')];var _0x89c50d=_0x41b475!=_0xa573('0x50')?util[_0xa573('0x28')]('%s/%s@from-sip/n',_0xa573('0x51'),this[_0xa573('0xb')][_0xa573('0x34')]):undefined;this['rpc'][_0xa573('0x4f')](_0x54b199,_0x89c50d)[_0xa573('0x17')](function(_0x2ae8b){_0x2f6b8e(null,_[_0xa573('0x40')](_0x2ae8b)?![]:!![]);})[_0xa573('0x12')](function(_0x2c11f7){logger[_0xa573('0x2a')](_0x2c11f7);_0x2f6b8e(null,![]);});};AGIVertices[_0xa573('0xe')][_0xa573('0x52')]=function(_0x31d999,_0x2c3f83){sh[_0xa573('0x53')](_[_0xa573('0x54')](_0x31d999),function(_0x1e4d81,_0x4ae246){var _0x464604=_0x4ae246[_0xa573('0x55')](/(\r\n|\n|\r)/gm,'');_0x2c3f83(null,_0x464604);});};AGIVertices[_0xa573('0xe')]['googleTTS']=function(_0x3d71ca,_0x359a32){scripts[_0xa573('0x56')](_0x3d71ca[_0xa573('0x57')],_0x3d71ca[_0xa573('0x58')]||'en',0x1)[_0xa573('0x17')](function(_0x3188b3){_0x359a32(null,_0x3188b3);})[_0xa573('0x12')](function(_0x2d41db){_0x359a32(_0x2d41db);});};AGIVertices[_0xa573('0xe')][_0xa573('0x59')]=function(_0x4a8625,_0xa93fc5){scripts[_0xa573('0x59')](this[_0xa573('0xb')][_0xa573('0x33')],_0x4a8625['key'],_0x4a8625[_0xa573('0x57')],_0x4a8625['dialogflow_language']||'en')[_0xa573('0x17')](function(_0x4c1d0e){_0xa93fc5(null,_0x4c1d0e);})[_0xa573('0x12')](function(_0xbfeaa){_0xa93fc5(_0xbfeaa);});};AGIVertices[_0xa573('0xe')]['sestekNDA']=function(_0x28ae94,_0x436821){scripts[_0xa573('0x5a')](this[_0xa573('0xb')],_0x28ae94)[_0xa573('0x17')](function(_0x26733b){_0x436821(null,_0x26733b);})[_0xa573('0x12')](function(_0x47e8cb){_0x436821(_0x47e8cb);});};AGIVertices[_0xa573('0xe')]['ispeechTTS']=function(_0x9caa73,_0x274fca){scripts[_0xa573('0x5b')](_0x9caa73['key'],_0x9caa73['text'],_0x9caa73[_0xa573('0x5c')]||'en-US',_0x9caa73['speed'])['then'](function(_0x1bdd6c){_0x274fca(null,_0x1bdd6c);})[_0xa573('0x12')](function(_0x147e57){_0x274fca(_0x147e57);});};AGIVertices[_0xa573('0xe')][_0xa573('0x5d')]=function(_0x2adc84,_0xa85f7b,_0x34cc4c){scripts[_0xa573('0x5d')](_0xa85f7b,_0x2adc84[_0xa573('0x5e')],_0x2adc84[_0xa573('0x5f')]||_0xa573('0x60'),this[_0xa573('0x61')](_0x2adc84[_0xa573('0x62')])?_0x2adc84[_0xa573('0x62')]:undefined)[_0xa573('0x17')](function(_0x3b7f89){_0x34cc4c(null,_0x3b7f89);})['catch'](function(_0x2eb741){_0x34cc4c(_0x2eb741);});};AGIVertices['prototype']['awsPolly']=function(_0x4223ad,_0x37d62f){scripts[_0xa573('0x63')](_0x4223ad[_0xa573('0x64')],_0x4223ad[_0xa573('0x65')],_0x4223ad[_0xa573('0x66')],_0x4223ad[_0xa573('0x67')]||_0xa573('0x68'),_0x4223ad['text'],_0x4223ad['aws_text_type']||_0xa573('0x57'))[_0xa573('0x17')](function(_0x24be1c){_0x37d62f(null,_0x24be1c);})['catch'](function(_0x7208d8){_0x37d62f(_0x7208d8);});};AGIVertices[_0xa573('0xe')][_0xa573('0x69')]=function(_0x23272d,_0x2508f6){scripts[_0xa573('0x69')](this[_0xa573('0xb')][_0xa573('0x33')],_0x23272d['aws_access_key_id'],_0x23272d['aws_secret_access_key'],_0x23272d[_0xa573('0x6a')],_0x23272d[_0xa573('0x57')],_0x23272d['aws_bot_name'])[_0xa573('0x17')](function(_0x573868){_0x2508f6(null,_0x573868);})[_0xa573('0x12')](function(_0x1e2652){_0x2508f6(_0x1e2652);});};AGIVertices[_0xa573('0xe')]['googleASR']=function(_0x31d562,_0x4e02d1,_0x32ea2d){scripts[_0xa573('0x6b')](_0x4e02d1,_0x31d562[_0xa573('0x5e')],_0x31d562['google_asr_language']||_0xa573('0x60'))['then'](function(_0x49e90b){_0x32ea2d(null,_0x49e90b);})[_0xa573('0x12')](function(_0x2514d3){_0x32ea2d(_0x2514d3);});};AGIVertices[_0xa573('0xe')][_0xa573('0x6c')]=function(_0x3adcc1,_0x3e2694,_0x3a51c2){scripts[_0xa573('0x6c')](_0x3e2694,_0x3adcc1[_0xa573('0x6d')],_0x3adcc1[_0xa573('0x6e')],_0x3adcc1[_0xa573('0x6f')])[_0xa573('0x17')](function(_0x1e4abf){_0x3a51c2(null,_0x1e4abf);})['catch'](function(_0x49c88f){_0x3a51c2(_0x49c88f);});};AGIVertices[_0xa573('0xe')]['clear']=function(_0x5f3ac3){var _0x355576=_[_0xa573('0x70')](verticesWithRetry,_0x5f3ac3[_0xa573('0x71')])?_0x5f3ac3:_[_0xa573('0x72')](_0x5f3ac3);for(var _0x4b112a in _0x355576){if(_0x355576[_0xa573('0x73')](_0x4b112a)){if(_0x355576[_0x4b112a]&&_[_0xa573('0x74')](_0x355576[_0x4b112a])){_0x355576[_0x4b112a]=this[_0xa573('0x75')](_0x355576[_0x4b112a]);}}}return _0x355576;};AGIVertices[_0xa573('0xe')][_0xa573('0x75')]=function(_0x370da1){var _0x62ee05=_0x370da1[_0xa573('0x76')]('{');for(var _0x1b8f23=0x1;_0x1b8f23<_0x62ee05['length'];_0x1b8f23+=0x1){var _0x780be1=_0x62ee05[_0x1b8f23]['split']('}');if(_0x780be1[_0xa573('0x77')]>0x1){_0x370da1=_0x370da1['replaceAll']('{'+_0x780be1[0x0]+'}',this['channel']['getVariable'](_0x780be1[0x0])['extra']||_0x780be1[0x0]);}}if(_0x62ee05['length']===0x1){return _0x370da1[_0xa573('0x78')]();}return this[_0xa573('0x75')](_0x370da1);};AGIVertices[_0xa573('0xe')][_0xa573('0x79')]=function(_0x7619f7,_0x581565){var _0x73f3dc=this['channel']['getVariable'](_0x7619f7);if(_0x73f3dc[_0xa573('0x7a')]===-0x1){return _0x73f3dc;}logger['info'](util[_0xa573('0x28')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x581565,_0x73f3dc[_0xa573('0x7b')]));return this['channel'][_0xa573('0x7c')](_0x581565,_0x73f3dc[_0xa573('0x7b')]);};AGIVertices[_0xa573('0xe')]['isConfigured']=function(_0x24eb97){return _0x24eb97&&_0x24eb97!=='0'&&_0x24eb97!=='-1'&&_0x24eb97!=='';};AGIVertices[_0xa573('0xe')][_0xa573('0x7d')]=function(_0x46650c){this[_0xa573('0x32')]['sync'](this,_0x46650c,'-');_0x46650c[_0xa573('0x7e')]=_0x46650c['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xa573('0xe')]['agi']=function(_0x1043cd){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x1043cd['label']));return this['channel'][_0xa573('0x7')]([_0x1043cd[_0xa573('0x80')],_0x1043cd['args']]);};AGIVertices['prototype']['answer']=function(_0x1300ad){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x81'),_0x1300ad['label']));if(this[_0xa573('0x61')](_0x1300ad[_0xa573('0x82')])){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1300ad['timeout']));var _0x33e0f5=this[_0xa573('0xb')][_0xa573('0x83')](_0x1300ad['timeout']);if(_0x33e0f5['result']===-0x1){return _0x33e0f5;}}return this[_0xa573('0xb')][_0xa573('0x84')]();};AGIVertices[_0xa573('0xe')][_0xa573('0x47')]=function(_0x211ee6){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x85'),_0x211ee6[_0xa573('0x86')]));if(!this['isConfigured'](_0x211ee6[_0xa573('0x45')])){return this[_0xa573('0xb')]['error'](_0x211ee6,_0xa573('0x87'));}_0x211ee6[_0xa573('0x46')]=moment();if(this[_0xa573('0x61')](_0x211ee6[_0xa573('0x88')])){_0x211ee6[_0xa573('0x46')]=moment()[_0xa573('0x89')](_0x211ee6[_0xa573('0x88')],'minutes');}if(!this['isConfigured'](_0x211ee6['callback_priority'])){_0x211ee6[_0xa573('0x48')]=0x2;}this[_0xa573('0x3e')][_0xa573('0x8a')](this,_0x211ee6);return this['channel']['noop'](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x211ee6[_0xa573('0x44')],_0x211ee6[_0xa573('0x45')],_0x211ee6['scheduledAt']));};AGIVertices[_0xa573('0xe')][_0xa573('0x8b')]=function(_0x44d9d7){logger['info'](util[_0xa573('0x28')](_0xa573('0x8c'),_0x44d9d7[_0xa573('0x86')]));var _0xdf37ae=this['channel'][_0xa573('0x53')](_0x44d9d7[_0xa573('0x8d')],_0x44d9d7[_0xa573('0x8e')]);if(_0xdf37ae[_0xa573('0x7a')]===-0x1){return _0xdf37ae;}return this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x90'),_0x44d9d7[_0xa573('0x8d')],_0x44d9d7[_0xa573('0x8e')]));};AGIVertices[_0xa573('0xe')][_0xa573('0x91')]=function(_0x40f0fe){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x92'),_0x40f0fe[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x40f0fe[_0xa573('0x57')])){return this[_0xa573('0xb')][_0xa573('0x8f')]('no\x20text\x20configured');}var _0x5a0af0='\x22'+_0x40f0fe[_0xa573('0x57')]+'\x22';if(this[_0xa573('0x61')](_0x40f0fe[_0xa573('0x8e')])){_0x5a0af0+=','+_0x40f0fe['options'];}var _0x1755e4=this[_0xa573('0xb')][_0xa573('0x53')](_0xa573('0x93'),_0x5a0af0);if(_0x1755e4[_0xa573('0x7a')]===-0x1){return _0x1755e4;}return this['channel']['noop'](util[_0xa573('0x28')]('Executed\x20command\x20MRCPSynth\x20%s',_0x5a0af0));};AGIVertices[_0xa573('0xe')][_0xa573('0x94')]=function(_0x554e7c){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x95'),_0x554e7c[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x554e7c[_0xa573('0x57')])){return this['channel']['noop'](_0xa573('0x96'));}var _0x1ea104='\x22'+_0x554e7c[_0xa573('0x57')]+'\x22';if(this[_0xa573('0x61')](_0x554e7c['options'])){_0x1ea104+=','+_0x554e7c[_0xa573('0x8e')];}var _0x179d89=this['channel'][_0xa573('0x53')](_0xa573('0x93'),_0x1ea104);if(_0x179d89[_0xa573('0x7a')]===-0x1){return _0x179d89;}return this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x97'),_0x1ea104));};AGIVertices[_0xa573('0xe')][_0xa573('0x98')]=function(_0x5c3c57){logger[_0xa573('0x7f')](util['format'](_0xa573('0x99'),_0x5c3c57[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x5c3c57[_0xa573('0x9a')])){return this[_0xa573('0xb')][_0xa573('0x8f')]('no\x20grammar\x20configured');}var _0x362003=_0x5c3c57['grammar'];if(this['isConfigured'](_0x5c3c57[_0xa573('0x8e')])){_0x362003+=','+_0x5c3c57[_0xa573('0x8e')];}var _0x1bc843=this['channel'][_0xa573('0x53')]('MRCPRecog',_0x362003);if(_0x1bc843[_0xa573('0x7a')]===-0x1){return _0x1bc843;}var _0x2fa39e=this[_0xa573('0x79')](_0xa573('0x9b'),_0xa573('0x9c'));if(_0x2fa39e['result']===-0x1){return _0x2fa39e;}var _0x2c41e3=this[_0xa573('0x79')](_0xa573('0x9d'),_0xa573('0x9e'));if(_0x2c41e3[_0xa573('0x7a')]===-0x1){return _0x2c41e3;}var _0x14fad9=this[_0xa573('0x79')](_0xa573('0x9f'),'LUMENVOX_ASR_INSTANCE');if(_0x14fad9[_0xa573('0x7a')]===-0x1){return _0x14fad9;}return this['channel'][_0xa573('0x8f')](util[_0xa573('0x28')]('Executed\x20command\x20MRCPRecog\x20%s',_0x362003));};AGIVertices['prototype'][_0xa573('0xa0')]=function(_0x20a8cd){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0xa1'),_0x20a8cd[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x20a8cd[_0xa573('0x9a')])){return this[_0xa573('0xb')]['noop']('no\x20grammar\x20configured');}var _0x39eda5=_0x20a8cd['grammar'];if(this[_0xa573('0x61')](_0x20a8cd['options'])){_0x39eda5+=','+_0x20a8cd[_0xa573('0x8e')];}var _0x4172e6=this[_0xa573('0xb')][_0xa573('0x53')](_0xa573('0xa2'),_0x39eda5);if(_0x4172e6[_0xa573('0x7a')]===-0x1){return _0x4172e6;}var _0x553591=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xa573('0xa3'));if(_0x553591[_0xa573('0x7a')]===-0x1){return _0x553591;}var _0x5486a0=this[_0xa573('0x79')]('RECOG_INPUT()',_0xa573('0xa4'));if(_0x5486a0['result']===-0x1){return _0x5486a0;}var _0x94520e=this[_0xa573('0x79')]('RECOG_INSTANCE()',_0xa573('0xa5'));if(_0x94520e[_0xa573('0x7a')]===-0x1){return _0x94520e;}return this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0xa6'),_0x39eda5));};AGIVertices[_0xa573('0xe')][_0xa573('0xa7')]=function(_0x1c89ba){logger['info'](util[_0xa573('0x28')](_0xa573('0xa8'),_0x1c89ba[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x1c89ba[_0xa573('0xa9')])){return this['channel'][_0xa573('0x2a')](_0x1c89ba,_0xa573('0xaa'));}var _0x1063c1=this['getSquareOdbc'][_0xa573('0x8a')](this,_0x1c89ba[_0xa573('0xa9')]);if(!_0x1063c1){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x1c89ba,_0xa573('0xab'));}if(!this[_0xa573('0x61')](_0x1c89ba[_0xa573('0x2c')])){return this[_0xa573('0xb')]['error'](_0x1c89ba,_0xa573('0xac'));}var _0x56064c=_0x1c89ba[_0xa573('0x2c')][_0xa573('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0xa573('0xb')]['noop'](util['format'](_0xa573('0xad'),_0x56064c));var _0x3a301b=this[_0xa573('0xae')]['sync'](this,_0x1063c1,_0x56064c);this[_0xa573('0x32')][_0xa573('0x8a')](this,_0x1c89ba,_0x56064c);if(!this[_0xa573('0x61')](_0x1c89ba[_0xa573('0xaf')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xb0'));}var _0x413fb2=this[_0xa573('0xf')][_0xa573('0x8a')](this,_0x1c89ba[_0xa573('0xaf')]);if(!_0x413fb2){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x1c89ba,_0xa573('0xb1'));}var _0x53e338=this;_0x3a301b[_0xa573('0xb2')](function(_0x5b68fc,_0x49e173){Object[_0xa573('0xb3')](_0x5b68fc)['forEach'](function(_0x19a049){_0x53e338[_0xa573('0xb')][_0xa573('0x7c')](util['format'](_0xa573('0xb4'),_0x413fb2,_0x49e173,_0x19a049),_0x5b68fc[_0x19a049]);});});this[_0xa573('0xb')]['setVariable'](util[_0xa573('0x28')]('%s_ROWS_COUNT',_0x413fb2),_0x3a301b['length']);return this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0xb5'),_0x413fb2));};AGIVertices[_0xa573('0xe')][_0xa573('0xb6')]=function(_0x2a6a3b){logger[_0xa573('0xb7')](util[_0xa573('0x28')](_0xa573('0xb8'),_0x2a6a3b[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x2a6a3b[_0xa573('0xb9')])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x2a6a3b,_0xa573('0xba'));}var _0x284112=this[_0xa573('0xbb')][_0xa573('0x8a')](this,_0x2a6a3b[_0xa573('0xb9')]);if(!_0x284112){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x2a6a3b,_0xa573('0xbc'));}var _0x447f5d=this[_0xa573('0xb')][_0xa573('0x53')]('DIAL',[util[_0xa573('0x28')](_0xa573('0xbd'),_0x284112),_0x2a6a3b[_0xa573('0x82')],_0x2a6a3b[_0xa573('0xbe')],_0x2a6a3b['url']]);if(_0x447f5d['result']===-0x1){return _0x447f5d;}return this[_0xa573('0xb')][_0xa573('0x8f')](util['format']('Executed\x20command\x20%s',_0xa573('0xbf')));};AGIVertices[_0xa573('0xe')][_0xa573('0xc0')]=function(_0x313843){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0xc1'),_0x313843['label']));if(!this['isConfigured'](_0x313843[_0xa573('0x5e')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xc2'));}if(!this['isConfigured'](_0x313843[_0xa573('0x57')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0x96'));}this[_0xa573('0xb')]['bot']=!![];this['createSquareDetailsReport'](_0x313843);this[_0xa573('0x3d')](_0x313843['text'],'in');this[_0xa573('0xb')]['noop'](util['format'](_0xa573('0xc3'),_0x313843[_0xa573('0x57')]));var _0x14375e=this[_0xa573('0x59')][_0xa573('0x8a')](this,_0x313843);if(_0x14375e){for(var _0x15d7d0 in _0x14375e){if(_0x14375e[_0xa573('0x73')](_0x15d7d0)){this[_0xa573('0xb')][_0xa573('0x7c')](util[_0xa573('0x28')](_0xa573('0xc4'),_0x15d7d0[_0xa573('0xc5')]()),_0x14375e[_0x15d7d0]);}}this[_0xa573('0x3d')](_0x14375e[_0xa573('0xc6')],_0xa573('0xc7'));return this[_0xa573('0xb')]['noop'](util[_0xa573('0x28')](_0xa573('0xc8'),_0x14375e['speech']));}return this[_0xa573('0xb')]['error'](_0x313843,_0xa573('0xc9'));};AGIVertices[_0xa573('0xe')]['sesteknda']=function(_0x5efbb5){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5efbb5['label']));if(!this[_0xa573('0x61')](_0x5efbb5[_0xa573('0xca')])){return this['channel'][_0xa573('0x8f')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xa573('0x61')](_0x5efbb5[_0xa573('0xcb')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xcc'));}if(!this[_0xa573('0x61')](_0x5efbb5[_0xa573('0xcd')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xce'));}if(!this[_0xa573('0x61')](_0x5efbb5[_0xa573('0xcf')])){return this[_0xa573('0xb')]['noop']('no\x20text\x20configured');}this[_0xa573('0xb')]['bot']=!![];this[_0xa573('0x32')](_0x5efbb5);this['createSquareMessage'](_0x5efbb5['text'],'in');this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0xd0'),_0x5efbb5[_0xa573('0x57')]));var _0x2d42e2=this['sestekNDA']['sync'](this,_0x5efbb5);if(_0x2d42e2){for(var _0x2fb224 in _0x2d42e2){if(_0x2d42e2['hasOwnProperty'](_0x2fb224)){this[_0xa573('0xb')]['setVariable'](util['format'](_0xa573('0xd1'),_0x2fb224['toUpperCase']()),_0x2d42e2[_0x2fb224]);}}this[_0xa573('0x3d')](_0x2d42e2['speech'],'out');if(_0x2d42e2['audiofile']){this[_0xa573('0xb')]['noop'](util[_0xa573('0x28')](_0xa573('0xd2'),_0x2d42e2['audiofile']));var _0x5d9347=this[_0xa573('0xb')][_0xa573('0xd3')](_0x2d42e2[_0xa573('0xd4')]);try{fs[_0xa573('0xd5')](_0x2d42e2[_0xa573('0xd4')]+_0xa573('0xd6'));}catch(_0x147eae){logger[_0xa573('0x2a')](_0x147eae);}return _0x5d9347;}else{return this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0xd7'),_0x2d42e2[_0xa573('0xc6')]));}}return this['channel'][_0xa573('0x2a')](_0x5efbb5,_0xa573('0xd8'));};AGIVertices[_0xa573('0xe')][_0xa573('0xd9')]=function(_0x4caaa6){logger['info'](util[_0xa573('0x28')](_0xa573('0xda'),_0x4caaa6['label']));return this[_0xa573('0xb')]['noop'](_0xa573('0xd9'));};AGIVertices[_0xa573('0xe')][_0xa573('0xdb')]=function(_0xec3f2){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xec3f2[_0xa573('0x86')]));var _0x1631ea='';if(_0xec3f2[_0xa573('0xdc')]){if(!this[_0xa573('0x61')](_0xec3f2[_0xa573('0xdc')])){return this[_0xa573('0xb')]['error'](_0xec3f2,_0xa573('0xdd'));}else{var _0x5943a8=parseInt(_0xec3f2[_0xa573('0xdc')],0xa);if(isNaN(_0x5943a8)){_0x1631ea=_0xec3f2[_0xa573('0xdc')];}else{_0x1631ea=this['getTrunk'][_0xa573('0x8a')](this,_0xec3f2[_0xa573('0xdc')]);if(!_0x1631ea){return this['channel'][_0xa573('0x2a')](_0xec3f2,'no\x20trunk\x20found');}}}}else if(_0xec3f2[_0xa573('0xde')]){_0x1631ea=_0xec3f2[_0xa573('0xde')];}else{return this[_0xa573('0xb')][_0xa573('0x2a')](_0xec3f2,_0xa573('0xdd'));}var _0x5143ea=this[_0xa573('0xb')]['exec'](_0xa573('0xbf'),[util[_0xa573('0x28')](_0xa573('0xdf'),_0x1631ea,_0xec3f2['phone']),_0xec3f2[_0xa573('0x82')],_0xec3f2['opts'],_0xec3f2['url']]);if(_0x5143ea['result']===-0x1){return _0x5143ea;}return this[_0xa573('0xb')]['noop'](util[_0xa573('0x28')]('Executed\x20command\x20%s',_0xa573('0xbf')));};AGIVertices['prototype']['finally']=function(_0x4d3f86){logger['info'](util['format'](_0xa573('0xe0'),_0x4d3f86['label']));return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xe1'));};AGIVertices[_0xa573('0xe')][_0xa573('0xe2')]=function(_0x479e44){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x479e44[_0xa573('0x86')]));if(_0x479e44[_0xa573('0x7e')]===0x0){return this[_0xa573('0x7d')](_0x479e44);}_0x479e44['retry']-=0x1;if(!this[_0xa573('0x61')](_0x479e44['file_id'])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x479e44,_0xa573('0xe3'));}var _0x43d50e=this[_0xa573('0xe4')][_0xa573('0x8a')](this,_0x479e44[_0xa573('0xe5')]);if(!_0x43d50e){return this['channel']['error'](_0x479e44,_0xa573('0xe6'));}if(!this[_0xa573('0x61')](_0x479e44[_0xa573('0xaf')])){return this[_0xa573('0xb')][_0xa573('0x2a')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x187d66=this['channel'][_0xa573('0xe7')](_0x43d50e,_0x479e44[_0xa573('0xe8')],_0x479e44['maxdigit']);var _0x5885cd=_0x187d66[_0xa573('0x7a')]?_0x187d66[_0xa573('0x7a')][_0xa573('0x78')]():'';logger[_0xa573('0x7f')](_0xa573('0xe9'),JSON[_0xa573('0xea')](_0x187d66));if(_0x187d66[_0xa573('0x7a')]===-0x1){this[_0xa573('0x32')]['sync'](this,_0x479e44,_0x5885cd);return _0x187d66;}else if(_0x187d66[_0xa573('0x7b')]===_0xa573('0x82')){_0x187d66[_0xa573('0x7a')]=_0x5885cd[_0xa573('0x77')]>=parseInt(_0x479e44['mindigit'])?'x':'i';}else{_0x187d66[_0xa573('0x7a')]=_0x5885cd[_0xa573('0x77')]>=parseInt(_0x479e44[_0xa573('0xeb')])&&_0x5885cd[_0xa573('0x77')]<=parseInt(_0x479e44[_0xa573('0xec')])?'x':'i';}var _0x146ba5=this[_0xa573('0xf')][_0xa573('0x8a')](this,_0x479e44['variable_id']);if(!_0x146ba5){return this[_0xa573('0xb')]['error'](_0x479e44,_0xa573('0xb1'));}this[_0xa573('0xb')][_0xa573('0x7c')](_0x146ba5,_0x5885cd);if(this[_0xa573('0x61')](_0x479e44[_0xa573('0xed')])){var _0x137b5e=parseInt(_0x479e44[_0xa573('0xed')],0xa);var _0x5401a5=rs[_0xa573('0xee')]({'charset':'*','length':_0x137b5e});var _0x22cef9=_0x5885cd[_0xa573('0x77')];if(_0x22cef9>0x0){if(_0x22cef9>_0x137b5e){this[_0xa573('0x32')][_0xa573('0x8a')](this,_0x479e44,_0x479e44[_0xa573('0xef')]===_0xa573('0xf0')?_0x5401a5+_0x5885cd[_0xa573('0xf1')](_0x137b5e):_0x5885cd[_0xa573('0xf1')](0x0,_0x22cef9-_0x137b5e)+_0x5401a5);}else{this[_0xa573('0x32')]['sync'](this,_0x479e44,rs[_0xa573('0xee')]({'charset':'*','length':_0x22cef9}));}}else{this[_0xa573('0x32')][_0xa573('0x8a')](this,_0x479e44,'');}}else{this[_0xa573('0x32')]['sync'](this,_0x479e44,_0x5885cd);}return _0x187d66;};AGIVertices[_0xa573('0xe')][_0xa573('0xa')]=function(_0x40ae81){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0xf2'),_0x40ae81[_0xa573('0x86')]));return this['getdigits'](_0x40ae81);};AGIVertices[_0xa573('0xe')][_0xa573('0xf3')]=function(_0x346b77){logger['info'](util[_0xa573('0x28')](_0xa573('0xf4'),_0x346b77[_0xa573('0x86')]));this[_0xa573('0x32')][_0xa573('0x8a')](this,_0x346b77,_0x346b77[_0xa573('0xf5')]);return this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')]('GOAL\x20%s',_0x346b77[_0xa573('0xf5')]));};AGIVertices[_0xa573('0xe')]['awspolly']=function(_0x2b0c3f){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0xf6'),_0x2b0c3f[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x2b0c3f[_0xa573('0x64')])||!this[_0xa573('0x61')](_0x2b0c3f[_0xa573('0x65')])){return this['channel'][_0xa573('0x8f')](_0xa573('0xf7'));}if(!this[_0xa573('0x61')](_0x2b0c3f['text'])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0x96'));}this[_0xa573('0xb')]['noop'](util['format']('Trying\x20aws\x20Polly\x20%s',_0x2b0c3f[_0xa573('0x57')]));var _0x36b3b9=this[_0xa573('0x63')][_0xa573('0x8a')](this,_0x2b0c3f);if(_0x36b3b9){this[_0xa573('0xb')]['noop'](util[_0xa573('0x28')](_0xa573('0xf8'),_0x36b3b9));var _0x15b557=this['channel'][_0xa573('0xd3')](_0x36b3b9);try{fs[_0xa573('0xd5')](_0x36b3b9+_0xa573('0xd6'));}catch(_0x424fa1){logger[_0xa573('0x2a')](_0x424fa1);}return _0x15b557;}return this[_0xa573('0xb')]['error'](_0x2b0c3f,_0xa573('0xf9'));};AGIVertices[_0xa573('0xe')][_0xa573('0xfa')]=function(_0x5f15da){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x5f15da[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x5f15da[_0xa573('0x64')])||!this[_0xa573('0x61')](_0x5f15da[_0xa573('0x65')])){return this[_0xa573('0xb')]['noop'](_0xa573('0xf7'));}if(!this['isConfigured'](_0x5f15da[_0xa573('0xfb')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xfc'));}if(!this[_0xa573('0x61')](_0x5f15da[_0xa573('0x57')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0xa573('0xb')][_0xa573('0xfd')]=!![];this[_0xa573('0x32')](_0x5f15da);this[_0xa573('0x3d')](_0x5f15da[_0xa573('0x57')],'in');this['channel'][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0xfe'),_0x5f15da[_0xa573('0x57')]));var _0x4871e7=this[_0xa573('0x69')][_0xa573('0x8a')](this,_0x5f15da);if(_0x4871e7){for(var _0x28926f in _0x4871e7){if(_0x4871e7[_0xa573('0x73')](_0x28926f)&&_[_0xa573('0x74')](_0x4871e7[_0x28926f])){this[_0xa573('0xb')][_0xa573('0x7c')](util[_0xa573('0x28')](_0xa573('0xff'),_0x28926f[_0xa573('0xc5')]()),_0x4871e7[_0x28926f]);}}if(_[_0xa573('0x40')](_0x4871e7[_0xa573('0x100')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0x101'));}else{this[_0xa573('0x3d')](_0x4871e7['message'],_0xa573('0xc7'));return this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x102'),_0x4871e7['message']));}}return this[_0xa573('0xb')][_0xa573('0x2a')](_0x5f15da,_0xa573('0x103'));};AGIVertices[_0xa573('0xe')]['googleasr']=function(_0x420327){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x104'),_0x420327[_0xa573('0x86')],_0x420327['timeout']));if(!this['isConfigured'](_0x420327[_0xa573('0x5e')])){return this[_0xa573('0xb')][_0xa573('0x8f')]('no\x20key\x20configured');}var _0x4ef76d=_0xa573('0x105');var _0x4c2ee0=util['format'](_0xa573('0x106'),FILES_PATH,rs[_0xa573('0xee')](0x4));var _0x479ee5=util[_0xa573('0x28')](_0xa573('0x107'),_0x4c2ee0,_0x4ef76d);var _0x3d8414=!![];if(_0x420327['beep']===_0xa573('0x108')){_0x3d8414=![];}var _0xe98f51=this['channel'][_0xa573('0x109')](_0x4c2ee0,_0x4ef76d,_0x420327['intKey'],_0x420327['timeout'],undefined,_0x3d8414);if(_0xe98f51['result']!==-0x1){this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x10a'),_0x479ee5));var _0x11ea72=this[_0xa573('0x6b')][_0xa573('0x8a')](this,_0x420327,_0x479ee5);if(_0x11ea72){for(var _0x4be25c in _0x11ea72){if(_0x11ea72[_0xa573('0x73')](_0x4be25c)){this[_0xa573('0xb')][_0xa573('0x7c')](util['format']('GOOGLE_ASR_%s',_0x4be25c[_0xa573('0xc5')]()),_0x11ea72[_0x4be25c]);}}return this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x10b'),JSON[_0xa573('0xea')](_0x11ea72)));}}return _0xe98f51;};AGIVertices[_0xa573('0xe')]['tildeasr']=function(_0xaae61d){logger['info'](util[_0xa573('0x28')](_0xa573('0x10c'),_0xaae61d['label']));if(!this[_0xa573('0x61')](_0xaae61d['appid'])){return this['channel'][_0xa573('0x8f')](_0xa573('0x10d'));}if(!this[_0xa573('0x61')](_0xaae61d[_0xa573('0x6e')])){return this['channel'][_0xa573('0x8f')]('no\x20appsecret\x20configured');}var _0x3643d8='wav';var _0x18cfc7=util[_0xa573('0x28')](_0xa573('0x106'),FILES_PATH,rs[_0xa573('0xee')](0x4));var _0x2f7aa9=util[_0xa573('0x28')](_0xa573('0x107'),_0x18cfc7,_0x3643d8);var _0x461f6d=!![];if(_0xaae61d[_0xa573('0x10e')]===_0xa573('0x108')){_0x461f6d=![];}var _0x4a976a=this[_0xa573('0xb')]['recordFile'](_0x18cfc7,_0x3643d8,_0xaae61d[_0xa573('0x10f')],_0xaae61d[_0xa573('0x82')],undefined,_0x461f6d);if(_0x4a976a[_0xa573('0x7a')]!==-0x1){this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x110'),_0x2f7aa9));var _0x17c582=this[_0xa573('0x6c')][_0xa573('0x8a')](this,_0xaae61d,_0x2f7aa9);if(_0x17c582){for(var _0x4858fe in _0x17c582){if(_0x17c582[_0xa573('0x73')](_0x4858fe)){this[_0xa573('0xb')][_0xa573('0x7c')](util[_0xa573('0x28')]('TILDE_ASR_%s',_0x4858fe[_0xa573('0xc5')]()),_0x17c582[_0x4858fe]);}}return this['channel']['noop'](util[_0xa573('0x28')](_0xa573('0x111'),JSON[_0xa573('0xea')](_0x17c582)));}}return _0x4a976a;};AGIVertices[_0xa573('0xe')][_0xa573('0x112')]=function(_0x7cdc6c){logger['info'](util[_0xa573('0x28')](_0xa573('0x113'),_0x7cdc6c[_0xa573('0x86')]));return this['channel'][_0xa573('0x114')](_0x7cdc6c[_0xa573('0x37')],_0x7cdc6c[_0xa573('0x38')],_0x7cdc6c[_0xa573('0x39')]);};AGIVertices[_0xa573('0xe')]['gotoif']=function(_0x2a10fa){logger[_0xa573('0x7f')](util['format'](_0xa573('0x115'),_0x2a10fa[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x2a10fa['condition'])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x2a10fa,_0xa573('0x116'));}try{var _0x209044=eval(_0x2a10fa['condition'])?_0xa573('0x117'):'false';this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x118'),_0x2a10fa[_0xa573('0x119')],_0x209044));return{'code':0xc8,'result':_0x209044};}catch(_0x187bca){return{'code':0xc8,'result':_0xa573('0x11a')};}};AGIVertices[_0xa573('0xe')]['gotoiftime']=function(_0x2e817a){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x11b'),_0x2e817a['label']));if(!this[_0xa573('0x61')](_0x2e817a[_0xa573('0x11c')])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x2e817a,_0xa573('0x11d'));}var _0x48da4e=this[_0xa573('0x21')][_0xa573('0x8a')](this,_0x2e817a[_0xa573('0x11c')]);if(!_0x48da4e){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x2e817a,'no\x20intervals\x20found');}for(var _0x561f1e=0x0;_0x561f1e<_0x48da4e[_0xa573('0x77')];_0x561f1e+=0x1){var _0x4c66e4=this['channel'][_0xa573('0xf')](util[_0xa573('0x28')](_0xa573('0x11e'),_0x48da4e[_0x561f1e]));if(_0x4c66e4[_0xa573('0x7a')]===-0x1){return _0x4c66e4;}logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x11f'),_0x48da4e[_0x561f1e],_0x4c66e4[_0xa573('0x7b')]));if(_0x4c66e4[_0xa573('0x7b')]===_0xa573('0x117')){logger[_0xa573('0x7f')](util['format'](_0xa573('0x11f'),_0x48da4e[_0x561f1e],'true'));this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x11f'),_0x48da4e[_0x561f1e],_0xa573('0x117')));return{'code':0xc8,'result':_0xa573('0x117')};}else{logger[_0xa573('0x7f')](util[_0xa573('0x28')]('IFTIME\x20%s\x20%s',_0x48da4e[_0x561f1e],_0xa573('0x11a')));this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x11f'),_0x48da4e[_0x561f1e],_0xa573('0x11a')));}}return{'code':0xc8,'result':_0xa573('0x11a')};};AGIVertices[_0xa573('0xe')]['hangup']=function(_0x466bbd){logger['info'](util[_0xa573('0x28')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x466bbd[_0xa573('0x86')]));return this['channel']['hangup']();};AGIVertices[_0xa573('0xe')][_0xa573('0x120')]=function(_0x3c5406){logger['info'](util['format'](_0xa573('0x121'),_0x3c5406[_0xa573('0x86')]));if(!this['isConfigured'](_0x3c5406['key'])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xc2'));}var _0x160803=_0xa573('0x105');var _0x3e7d5c=util[_0xa573('0x28')](_0xa573('0x106'),FILES_PATH,rs[_0xa573('0xee')](0x4));var _0x43b0bc=util[_0xa573('0x28')](_0xa573('0x107'),_0x3e7d5c,_0x160803);var _0x46dd44=!![];if(_0x3c5406['beep']===_0xa573('0x108')){_0x46dd44=![];}var _0x7a519f=this['channel'][_0xa573('0x109')](_0x3e7d5c,_0x160803,_0x3c5406['intKey'],_0x3c5406[_0xa573('0x82')],undefined,_0x46dd44);if(_0x7a519f[_0xa573('0x7a')]!==-0x1){this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x122'),_0x43b0bc));var _0x36194f=this[_0xa573('0x5d')][_0xa573('0x8a')](this,_0x3c5406,_0x43b0bc);if(_0x36194f){for(var _0x22b33d in _0x36194f){if(_0x36194f[_0xa573('0x73')](_0x22b33d)){this[_0xa573('0xb')][_0xa573('0x7c')](util[_0xa573('0x28')](_0xa573('0x123'),_0x22b33d[_0xa573('0xc5')]()),_0x36194f[_0x22b33d]);}}return this['channel'][_0xa573('0x8f')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0xa573('0xea')](_0x36194f)));}}return _0x7a519f;};AGIVertices[_0xa573('0xe')][_0xa573('0x124')]=function(_0xd7c317){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0xd7c317[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0xd7c317[_0xa573('0x5e')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xc2'));}if(!this[_0xa573('0x61')](_0xd7c317['text'])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0x96'));}this['channel'][_0xa573('0x8f')](util['format'](_0xa573('0x125'),_0xd7c317[_0xa573('0x57')]));var _0x354325=this[_0xa573('0x5b')][_0xa573('0x8a')](this,_0xd7c317);if(_0x354325){this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x122'),_0x354325));var _0x315090=this['channel'][_0xa573('0xd3')](_0x354325,_0xd7c317['intKey']);try{fs[_0xa573('0xd5')](_0x354325+_0xa573('0xd6'));}catch(_0x540d5b){logger[_0xa573('0x2a')](_0x540d5b);}return _0x315090;}return this[_0xa573('0xb')]['error'](_0xd7c317,_0xa573('0x126'));};AGIVertices['prototype'][_0xa573('0x127')]=function(_0x10224d){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x128'),_0x10224d['label']));if(!this[_0xa573('0x61')](_0x10224d['findBy'])){return this[_0xa573('0xb')]['error'](_0x10224d,_0xa573('0x129'));}logger['info'](util[_0xa573('0x28')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x10224d['findBy']));var _0x3ead11=this[_0xa573('0x4f')][_0xa573('0x8a')](this,_0x10224d['findBy']);if(_0x3ead11){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x12a'),this[_0xa573('0xb')]['callerid'],_0x10224d['findBy']));this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa573('0xb')]['callerid'],_0x10224d[_0xa573('0x12b')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa573('0x7f')](util[_0xa573('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa573('0xb')][_0xa573('0x34')],_0x10224d[_0xa573('0x12b')]));this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x12c'),this[_0xa573('0xb')][_0xa573('0x34')],_0x10224d['findBy']));return{'code':0xc8,'result':_0xa573('0x12d')};}};AGIVertices[_0xa573('0xe')][_0xa573('0x12e')]=function(_0x19fd6c){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x12f'),_0x19fd6c[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x19fd6c[_0xa573('0x12b')])){return this['channel']['error'](_0x19fd6c,_0xa573('0x129'));}logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x130'),this[_0xa573('0xb')][_0xa573('0x34')],_0x19fd6c['findBy']));var _0x404906=this[_0xa573('0x4e')][_0xa573('0x8a')](this,_0x19fd6c[_0xa573('0x12b')]);if(_0x404906){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x12a'),this[_0xa573('0xb')][_0xa573('0x34')],_0x19fd6c[_0xa573('0x12b')]));this[_0xa573('0xb')]['noop'](util[_0xa573('0x28')](_0xa573('0x12a'),this[_0xa573('0xb')][_0xa573('0x34')],_0x19fd6c[_0xa573('0x12b')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xa573('0x28')](_0xa573('0x12c'),this['channel'][_0xa573('0x34')],_0x19fd6c[_0xa573('0x12b')]));this['channel']['noop'](util[_0xa573('0x28')](_0xa573('0x12c'),this['channel'][_0xa573('0x34')],_0x19fd6c['findBy']));return{'code':0xc8,'result':_0xa573('0x12d')};}};AGIVertices[_0xa573('0xe')][_0xa573('0x131')]=function(_0x5cd0ea){logger[_0xa573('0x7f')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5cd0ea[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x5cd0ea['operation'])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x5cd0ea,_0xa573('0x132'));}this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x133'),_0x5cd0ea['operation']));var _0xb0afa3=eval(_0x5cd0ea[_0xa573('0x134')]);if(!this[_0xa573('0x61')](_0x5cd0ea[_0xa573('0xaf')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0xb0'));}var _0x468bab=this['getVariable'][_0xa573('0x8a')](this,_0x5cd0ea[_0xa573('0xaf')]);if(!_0x468bab){return this['channel'][_0xa573('0x2a')](_0x5cd0ea,_0xa573('0xb1'));}if(_[_0xa573('0x135')](_0xb0afa3)){var _0x5d171d=this;_0xb0afa3['forEach'](function(_0x397b37,_0x1fde3e){_0x5d171d[_0xa573('0xb')][_0xa573('0x7c')](util[_0xa573('0x28')](_0xa573('0x136'),_0x468bab,_0x1fde3e),_0x397b37);});return this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x137'),_0x468bab));}else{return this['channel'][_0xa573('0x7c')](_0x468bab,_0xb0afa3);}};AGIVertices['prototype'][_0xa573('0x138')]=function(_0x574599){logger['info'](util[_0xa573('0x28')](_0xa573('0x139'),_0x574599[_0xa573('0x86')]));if(_0x574599[_0xa573('0x7e')]===0x0){return this[_0xa573('0x7d')](_0x574599);}_0x574599['retry']-=0x1;if(!this[_0xa573('0x61')](_0x574599['file_id'])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x574599,_0xa573('0xe3'));}var _0x35a109=this[_0xa573('0xe4')]['sync'](this,_0x574599['file_id']);if(!_0x35a109){return this['channel'][_0xa573('0x2a')](_0x574599,'no\x20file\x20audio\x20found');}var _0x59f497=this[_0xa573('0xb')][_0xa573('0xe7')](_0x35a109,_0x574599[_0xa573('0xe8')],_0x574599[_0xa573('0x13a')]);var _0xa0acec=_0x59f497['result'];if(_0x59f497[_0xa573('0x7a')]===-0x1){this['createSquareDetailsReport'][_0xa573('0x8a')](this,_0x574599,'-1');return _0x59f497;}else if(_0x59f497[_0xa573('0x7b')]==='timeout'){_0x59f497[_0xa573('0x7a')]=_0x59f497[_0xa573('0x7a')]['length']>0x0?_0x59f497[_0xa573('0x7a')]:'t';}else if(_[_0xa573('0x3f')](_0x59f497[_0xa573('0x7a')])){_0x59f497[_0xa573('0x7a')]='#';_0xa0acec='#';}if(!this[_0xa573('0x61')](_0x574599[_0xa573('0xaf')])){this['channel'][_0xa573('0x8f')](_0xa573('0xb0'));}else{var _0x3032b5=this['getVariable']['sync'](this,_0x574599[_0xa573('0xaf')]);if(!_0x3032b5){return this['channel'][_0xa573('0x2a')](_0x574599,_0xa573('0xb1'));}this['channel'][_0xa573('0x7c')](_0x3032b5,_0xa0acec);}this['createSquareDetailsReport'][_0xa573('0x8a')](this,_0x574599,_0xa0acec);return _0x59f497;};AGIVertices['prototype'][_0xa573('0x8f')]=function(_0x44540f){logger['info'](util[_0xa573('0x28')](_0xa573('0x13b'),_0x44540f[_0xa573('0x86')]));return this[_0xa573('0xb')]['noop'](_0x44540f[_0xa573('0x13c')]||_0x44540f[_0xa573('0x86')]);};AGIVertices[_0xa573('0xe')][_0xa573('0x13d')]=function(_0x356928){logger[_0xa573('0x7f')](util['format'](_0xa573('0x13e'),_0x356928['label']));if(!this['isConfigured'](_0x356928[_0xa573('0x12b')])){return this[_0xa573('0xb')]['error'](_0x356928,_0xa573('0x129'));}logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x130'),this[_0xa573('0xb')][_0xa573('0x34')],_0x356928['findBy']));var _0x1001e4=this['getPause'][_0xa573('0x8a')](this,_0x356928[_0xa573('0x13f')]);var _0x757525=this[_0xa573('0x4b')][_0xa573('0x8a')](this,_0x356928['findBy'],_0x1001e4);if(_0x757525){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x12a'),this[_0xa573('0xb')][_0xa573('0x34')],_0x356928[_0xa573('0x12b')]));this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x12a'),this[_0xa573('0xb')][_0xa573('0x34')],_0x356928[_0xa573('0x12b')]));return{'code':0xc8,'result':'success'};}else{logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x12c'),this[_0xa573('0xb')][_0xa573('0x34')],_0x356928[_0xa573('0x12b')]));this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xa573('0xb')][_0xa573('0x34')],_0x356928[_0xa573('0x12b')]));return{'code':0xc8,'result':_0xa573('0x12d')};}};AGIVertices[_0xa573('0xe')][_0xa573('0x140')]=function(_0x59390c){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x141'),_0x59390c[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x59390c[_0xa573('0xe5')])){return this['channel']['error'](_0x59390c,_0xa573('0xe3'));}var _0xca3fae=this[_0xa573('0xe4')]['sync'](this,_0x59390c[_0xa573('0xe5')]);if(!_0xca3fae){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x59390c,_0xa573('0xe6'));}var _0x3c954f=this[_0xa573('0xb')]['exec']('PLAYBACK',[_0xca3fae,_0x59390c[_0xa573('0xbe')]]);if(_0x3c954f[_0xa573('0x7a')]===-0x1){return _0x3c954f;}return this['channel'][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x90'),_0xa573('0x142'),_0xca3fae));};AGIVertices[_0xa573('0xe')][_0xa573('0x143')]=function(_0x3ecabc){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3ecabc['label']));if(!this[_0xa573('0x61')](_0x3ecabc[_0xa573('0x144')])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x3ecabc,_0xa573('0x145'));}var _0x48cc1d='';var _0x2b8c27=parseInt(_0x3ecabc[_0xa573('0x144')],0xa);if(isNaN(_0x2b8c27)){_0x48cc1d=_0x3ecabc[_0xa573('0x144')];}else{_0x48cc1d=this['getVoiceQueue'][_0xa573('0x8a')](this,_0x3ecabc[_0xa573('0x144')]);if(!_0x48cc1d){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x3ecabc,_0xa573('0x146'));}}var _0x3af06d='';if(this[_0xa573('0x61')](_0x3ecabc[_0xa573('0xe5')])){var _0x63458d=this['getSound'][_0xa573('0x8a')](this,_0x3ecabc[_0xa573('0xe5')]);if(_0x63458d){_0x3af06d=_0x63458d;}}this['createSquareDetailsReport'][_0xa573('0x8a')](this,_0x3ecabc,_0x48cc1d);if(_0x3ecabc[_0xa573('0xbe')][_0xa573('0x147')]('x')<0x0){_0x3ecabc[_0xa573('0xbe')]+='x';}if(_0x3ecabc['opts'][_0xa573('0x147')]('X')<0x0){_0x3ecabc[_0xa573('0xbe')]+='X';}this[_0xa573('0xb')]['setVariable']('XMCS-QUEUE',_0x48cc1d?_0x48cc1d[_0xa573('0x148')]():'');var _0x41066d=this['channel'][_0xa573('0x53')](_0xa573('0x149'),[_0x48cc1d,_0x3ecabc[_0xa573('0xbe')],_0x3ecabc[_0xa573('0x14a')],_0x3af06d,_0x3ecabc['timeout'],_0x3ecabc['agi'],_0x3ecabc[_0xa573('0x14b')],_0x3ecabc[_0xa573('0x14c')],'',_0x3ecabc['position']]);if(_0x41066d[_0xa573('0x7a')]===-0x1){return _0x41066d;}return this['channel'][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x90'),_0xa573('0x149'),_0x48cc1d));};AGIVertices['prototype']['record']=function(_0x287837){logger[_0xa573('0x7f')](util[_0xa573('0x28')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x287837[_0xa573('0x86')]));var _0x31e7b8=_0x287837[_0xa573('0x14d')]||_0xa573('0x105');var _0x222c35=util[_0xa573('0x28')](_0xa573('0x14e'),this[_0xa573('0xb')]['uniqueid'],rs[_0xa573('0xee')](0x5));var _0x3a5220=util[_0xa573('0x28')]('%s/recordings/%s.%s',FILES_PATH,_0x222c35,_0x31e7b8);var _0x32fe4e=util['format'](_0xa573('0x106'),FILES_PATH,_0x222c35);this[_0xa573('0x35')]['sync'](this,_0x287837,_0x222c35,_0x3a5220);this['channel']['setVariable'](_0xa573('0x14f'),_0x222c35);logger[_0xa573('0x7f')](_0xa573('0x150'),_0x32fe4e,_0x31e7b8,_0x287837[_0xa573('0x151')],_0x287837[_0xa573('0x82')]);return this[_0xa573('0xb')][_0xa573('0x109')](_0x32fe4e,_0x31e7b8,_0x287837['escape_digits'],_0x287837[_0xa573('0x82')],undefined,!![]);};AGIVertices[_0xa573('0xe')][_0xa573('0x152')]=function(_0x3ea335){logger['info'](util['format'](_0xa573('0x153'),_0x3ea335[_0xa573('0x86')]));return this[_0xa573('0xb')]['sayDigits'](_0x3ea335['digits']['replace'](/\s+/g,''),_0x3ea335[_0xa573('0x151')]);};AGIVertices[_0xa573('0xe')][_0xa573('0x154')]=function(_0x22000a){logger['info'](util[_0xa573('0x28')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x22000a[_0xa573('0x86')]));return this[_0xa573('0xb')][_0xa573('0x155')](_0x22000a[_0xa573('0x156')][_0xa573('0x55')](/\s+/g,''),_0x22000a[_0xa573('0x151')]);};AGIVertices[_0xa573('0xe')]['sayphonetic']=function(_0x980cc2){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x157'),_0x980cc2[_0xa573('0x86')]));return this['channel']['sayPhonetic'](_0x980cc2[_0xa573('0x57')],_0x980cc2['escape_digits']);};AGIVertices[_0xa573('0xe')][_0xa573('0x158')]=function(_0x52bbed){logger['info'](util[_0xa573('0x28')](_0xa573('0x159'),_0x52bbed[_0xa573('0x86')]));if(!this['isConfigured'](_0x52bbed[_0xa573('0x15a')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0x15b'));}var _0x1d5115=this[_0xa573('0x1e')][_0xa573('0x8a')](this,_0x52bbed[_0xa573('0x15a')]);if(!_0x1d5115||!_0x1d5115[_0xa573('0x15c')]){return this['channel']['error'](_0x52bbed,'no\x20mail\x20account\x20found');}var _0x2ba477={'from':util[_0xa573('0x28')](_0xa573('0x15d'),_0x1d5115[_0xa573('0x11')],_0x1d5115['email']||_0x1d5115[_0xa573('0x15c')]['user']),'to':_0x52bbed['to']||'','cc':_0x52bbed['cc']||'','bcc':_0x52bbed[_0xa573('0x15e')]||'','subject':_0x52bbed[_0xa573('0x15f')],'html':_0x52bbed[_0xa573('0x57')],'text':_0x52bbed[_0xa573('0x57')]};var _0x159188={'tls':{'rejectUnauthorized':![]}};if(_0x1d5115[_0xa573('0x15c')][_0xa573('0x160')]){_0x159188['service']=_0x1d5115[_0xa573('0x15c')][_0xa573('0x160')];}else{_0x159188[_0xa573('0x161')]=_0x1d5115['Smtp'][_0xa573('0x161')];_0x159188[_0xa573('0x162')]=_0x1d5115[_0xa573('0x15c')][_0xa573('0x162')];_0x159188[_0xa573('0x163')]=_0x1d5115[_0xa573('0x15c')]['secure'];}if(_0x1d5115[_0xa573('0x15c')][_0xa573('0x164')]){_0x159188[_0xa573('0x165')]={'user':_0x1d5115[_0xa573('0x15c')][_0xa573('0x166')],'pass':_0x1d5115[_0xa573('0x15c')][_0xa573('0x167')]};}if(this[_0xa573('0x61')](_0x52bbed[_0xa573('0x168')])){}logger[_0xa573('0xb7')](_0xa573('0x169'),JSON[_0xa573('0xea')](_0x2ba477));this['createSquareDetailsReport']['sync'](this,_0x52bbed,_0x52bbed[_0xa573('0x15a')]);this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x16a'),_0x1d5115[_0xa573('0x11')]));this['sendMailMessage'][_0xa573('0x8a')](this,_0x159188,_0x2ba477);return this['channel'][_0xa573('0x8f')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xa573('0xe')][_0xa573('0x16b')]=function(_0x23d252){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x16c'),_0x23d252[_0xa573('0x86')]));return this['channel'][_0xa573('0x8f')](_0xa573('0x16d'));};AGIVertices[_0xa573('0xe')][_0xa573('0x16e')]=function(_0x2297e1){logger[_0xa573('0x7f')](util['format'](_0xa573('0x16f'),_0x2297e1[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x2297e1[_0xa573('0x170')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0x171'));}var _0x3db4a8=this[_0xa573('0x2f')][_0xa573('0x8a')](this,_0x2297e1[_0xa573('0x170')]);if(!_0x3db4a8){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x2297e1,'no\x20sms\x20account\x20found');}var _0xd8be80={'body':_0x2297e1[_0xa573('0x172')],'phone':_0x2297e1['to']||'','SmsAccountId':_0x3db4a8['id']};logger['debug']('sendSMS\x20message',JSON[_0xa573('0xea')](_0xd8be80));this[_0xa573('0x32')][_0xa573('0x8a')](this,_0x2297e1,_0x2297e1['sms_account_id']);this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x173'),_0x3db4a8[_0xa573('0x11')]));this[_0xa573('0x31')][_0xa573('0x8a')](this,_0xd8be80);return this['channel'][_0xa573('0x8f')](_0xa573('0x174'));};AGIVertices[_0xa573('0xe')][_0xa573('0x175')]=function(_0x30686d){logger[_0xa573('0x7f')](util['format'](_0xa573('0x176'),_0x30686d[_0xa573('0x86')]));if(!this['isConfigured'](_0x30686d[_0xa573('0xaf')])){return this[_0xa573('0xb')]['error'](_0x30686d,_0xa573('0x177'));}var _0x674e4f=this[_0xa573('0xf')][_0xa573('0x8a')](this,_0x30686d[_0xa573('0xaf')]);if(!_0x674e4f){return this['channel']['error'](_0x30686d,_0xa573('0xb1'));}return this[_0xa573('0xb')][_0xa573('0x7c')](_0x674e4f,_0x30686d[_0xa573('0x178')]);};AGIVertices['prototype'][_0xa573('0x179')]=function(_0x5754fd){logger[_0xa573('0x7f')](util['format']('Enter\x20in\x20START\x20(%s)\x20block',_0x5754fd[_0xa573('0x86')]));this['channel']['noop'](_0xa573('0x17a'));if(_0x5754fd['answer']===_0xa573('0x17b')){this['channel'][_0xa573('0x8f')](_0xa573('0x17c'));return this[_0xa573('0xb')]['answer']();}return this[_0xa573('0xb')][_0xa573('0x8f')]('Skipped\x20Answer');};AGIVertices['prototype'][_0xa573('0x17d')]=function(_0x54e6e4){logger['info'](util[_0xa573('0x28')](_0xa573('0x17e'),_0x54e6e4[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x54e6e4[_0xa573('0x17f')])){return this['channel']['error'](_0x54e6e4,_0xa573('0x180'));}var _0x845d0b=this[_0xa573('0x15')][_0xa573('0x8a')](this,_0x54e6e4[_0xa573('0x17f')]);if(!this['isConfigured'](_0x845d0b)){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x54e6e4,util[_0xa573('0x28')](_0xa573('0x181'),_0x54e6e4[_0xa573('0x17f')]));}if(_0x845d0b===this['channel'][_0xa573('0x3b')]){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x54e6e4,_0xa573('0x182'));}this['createSquareDetailsReport'][_0xa573('0x8a')](this,_0x54e6e4,_0x845d0b);var _0x1317d9=this[_0xa573('0xb')][_0xa573('0x53')](_0xa573('0x183'),util[_0xa573('0x28')](_0xa573('0x184'),config['agi'][_0xa573('0x161')]||_0xa573('0x185'),_0x845d0b,this[_0xa573('0xb')][_0xa573('0x3b')]));if(_0x1317d9['result']===-0x1){return _0x1317d9;}return this[_0xa573('0xb')]['noop'](util[_0xa573('0x28')]('Executed\x20command\x20%s\x20%s',_0xa573('0x183'),_0x845d0b));};AGIVertices[_0xa573('0xe')][_0xa573('0x186')]=function(_0x1f2356){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x187'),_0x1f2356[_0xa573('0x86')]));var _0x4bad4f=this[_0xa573('0x52')]['sync'](this,_0x1f2356['command']);this['createSquareDetailsReport']['sync'](this,_0x1f2356,_0x1f2356[_0xa573('0x80')]);if(this[_0xa573('0x61')](_0x1f2356[_0xa573('0xaf')])){var _0x1606ba=this[_0xa573('0xf')][_0xa573('0x8a')](this,_0x1f2356[_0xa573('0xaf')]);if(_0x1606ba){this['channel'][_0xa573('0x7c')](_0x1606ba,_0x4bad4f);return this[_0xa573('0xb')][_0xa573('0x8f')](util['format'](_0xa573('0x188'),_0x1f2356[_0xa573('0x80')],_0x1606ba));}}return this[_0xa573('0xb')]['noop'](util[_0xa573('0x28')](_0xa573('0x189'),_0x1f2356[_0xa573('0x80')]));};AGIVertices['prototype'][_0xa573('0x18a')]=function(_0x2a4d53){logger[_0xa573('0x7f')](util['format'](_0xa573('0x18b'),_0x2a4d53[_0xa573('0x86')]));if(!this['isConfigured'](_0x2a4d53[_0xa573('0x57')])){return this[_0xa573('0xb')][_0xa573('0x8f')](_0xa573('0x96'));}this['channel'][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x18c'),_0x2a4d53[_0xa573('0x57')]));var _0x5b653e=this[_0xa573('0x56')]['sync'](this,_0x2a4d53);if(_0x5b653e){this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x18d'),_0x5b653e));var _0x56be8f=this[_0xa573('0xb')][_0xa573('0xd3')](_0x5b653e);try{fs[_0xa573('0xd5')](_0x5b653e+_0xa573('0xd6'));}catch(_0x337afd){logger['error'](_0x337afd);}return _0x56be8f;}return this[_0xa573('0xb')]['error'](_0x2a4d53,_0xa573('0x18e'));};AGIVertices[_0xa573('0xe')][_0xa573('0x18f')]=function(_0x19cb6d){logger[_0xa573('0x7f')](util['format'](_0xa573('0x190'),_0x19cb6d[_0xa573('0x86')]));if(!this[_0xa573('0x61')](_0x19cb6d['findBy'])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x19cb6d,_0xa573('0x129'));}logger[_0xa573('0x7f')](util['format'](_0xa573('0x130'),this['channel'][_0xa573('0x34')],_0x19cb6d[_0xa573('0x12b')]));var _0x2eedef=this['agentUnpause'][_0xa573('0x8a')](this,_0x19cb6d['findBy']);if(_0x2eedef){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x12a'),this[_0xa573('0xb')][_0xa573('0x34')],_0x19cb6d[_0xa573('0x12b')]));this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x12a'),this['channel'][_0xa573('0x34')],_0x19cb6d['findBy']));return{'code':0xc8,'result':_0xa573('0x191')};}else{logger[_0xa573('0x7f')](util[_0xa573('0x28')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xa573('0xb')][_0xa573('0x34')],_0x19cb6d[_0xa573('0x12b')]));this[_0xa573('0xb')][_0xa573('0x8f')](util[_0xa573('0x28')](_0xa573('0x12c'),this['channel'][_0xa573('0x34')],_0x19cb6d[_0xa573('0x12b')]));return{'code':0xc8,'result':_0xa573('0x12d')};}};AGIVertices['prototype'][_0xa573('0x192')]=function(_0x49ba27){logger['info'](util[_0xa573('0x28')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x49ba27[_0xa573('0x86')]));var _0x385188=this[_0xa573('0xb')][_0xa573('0x53')]('VOICEMAIL',[_0x49ba27[_0xa573('0x193')],_0x49ba27['options']]);if(_0x385188[_0xa573('0x7a')]===-0x1){return _0x385188;}return this[_0xa573('0xb')]['noop'](util['format'](_0xa573('0x90'),_0xa573('0x194'),_0x49ba27['mailbox']));};AGIVertices[_0xa573('0xe')][_0xa573('0x195')]=function(_0x11c3fd){logger[_0xa573('0x7f')](util[_0xa573('0x28')](_0xa573('0x196'),_0x11c3fd[_0xa573('0x86')]));if(!this['isConfigured'](_0x11c3fd[_0xa573('0xaf')])){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x11c3fd,_0xa573('0x177'));}var _0x29b7ae=this[_0xa573('0xf')]['sync'](this,_0x11c3fd[_0xa573('0xaf')]);if(!_0x29b7ae){return this[_0xa573('0xb')][_0xa573('0x2a')](_0x11c3fd,_0xa573('0xb1'));}var _0x51207f=this[_0xa573('0xb')]['getVariable'](_0x29b7ae);return{'code':0xc8,'result':_0x51207f[_0xa573('0x7b')]?_0x51207f[_0xa573('0x7b')]:'-'};};String['prototype'][_0xa573('0x197')]=function(_0x336f30,_0x3d5b36){return this['split'](_0x336f30)[_0xa573('0x198')](_0x3d5b36);};module[_0xa573('0x199')]=AGIVertices; \ No newline at end of file +var _0x0dd6=['no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','no\x20text\x20configured','bot','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','response','maxdigit','test','stringify','mindigit','hiddendigitsnum','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','%s.%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','getIntervals','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','.wav','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','agentLogin','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','recordingFormat','%s_%s','escape_digits','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','email','Smtp','bcc','subject','service','host','port','secure','authentication','pass','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','interval','Intervals','getSoundPath','format','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleTTS','text','google_tts_language','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clone','hasOwnProperty','isString','replaceAllVariables','length','split','replaceAll','extra','maxRetry','sync','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','timeout','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','options','sestektts','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','getAndSetVariable','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','MRCPRecog','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','setVariable','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','SIP/%s','opts','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x0dd6,0xca));var _0x60dd=function(_0x1742df,_0x4b17a7){_0x1742df=_0x1742df-0x0;var _0x39c917=_0x0dd6[_0x1742df];return _0x39c917;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x60dd('0x0'));var sh=require(_0x60dd('0x1'));var odbc=require(_0x60dd('0x2'))();var rs=require(_0x60dd('0x3'));var moment=require(_0x60dd('0x4'));var Mustache=require(_0x60dd('0x5'));var logger=require(_0x60dd('0x6'))(_0x60dd('0x7'));var config=require(_0x60dd('0x8'));var scripts=require('./scripts');var FILES_PATH=_0x60dd('0x9');var verticesWithRetry=['menu',_0x60dd('0xa'),'getsecretdigits'];var AGIVertices=function(_0x30543f,_0x407a6c,_0x371079){this[_0x60dd('0xb')]=_0x30543f;this[_0x60dd('0xc')]=_0x407a6c;this[_0x60dd('0xd')]=_0x371079;};AGIVertices[_0x60dd('0xe')][_0x60dd('0xf')]=function(_0x57eccd,_0x194991){this[_0x60dd('0xc')][_0x60dd('0x10')](_0x57eccd)[_0x60dd('0x11')](function(_0x26cc4a){_0x194991(null,_0x26cc4a?_0x26cc4a[_0x60dd('0x12')]:![]);})['catch'](function(_0x42cd27){_0x194991(_0x42cd27);});};AGIVertices[_0x60dd('0xe')]['getVoiceQueue']=function(_0xa8ecbf,_0x2925a0){this['rpc'][_0x60dd('0x13')](_0xa8ecbf)[_0x60dd('0x11')](function(_0x4ac100){_0x2925a0(null,_0x4ac100?_0x4ac100[_0x60dd('0x12')]:![]);})[_0x60dd('0x14')](function(_0x1d41fb){_0x2925a0(_0x1d41fb);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x15')]=function(_0x5576b1,_0x1822e9){this[_0x60dd('0xc')][_0x60dd('0x16')](_0x5576b1)[_0x60dd('0x11')](function(_0x5a236f){_0x1822e9(null,_0x5a236f?_0x5a236f['name']:![]);})[_0x60dd('0x14')](function(_0x291845){_0x1822e9(_0x291845);});};AGIVertices[_0x60dd('0xe')]['getSquareOdbc']=function(_0x1a7b67,_0x417ba8){this['rpc'][_0x60dd('0x17')](_0x1a7b67)[_0x60dd('0x11')](function(_0x22c520){_0x417ba8(null,_0x22c520?_0x22c520[_0x60dd('0x18')]:![]);})[_0x60dd('0x14')](function(_0x31f49e){_0x417ba8(_0x31f49e);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x19')]=function(_0x42e2c6,_0xb8118c){this['rpc'][_0x60dd('0x1a')](_0x42e2c6)[_0x60dd('0x11')](function(_0x41933a){_0xb8118c(null,_0x41933a?_0x41933a[_0x60dd('0x12')]:![]);})[_0x60dd('0x14')](function(_0x5cee8e){_0xb8118c(_0x5cee8e);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x1b')]=function(_0xd99117,_0x13356b){this[_0x60dd('0xc')][_0x60dd('0x1c')](_0xd99117)[_0x60dd('0x11')](function(_0x521284){_0x13356b(null,_0x521284?_0x521284[_0x60dd('0x12')]:![]);})[_0x60dd('0x14')](function(_0x326c50){_0x13356b(_0x326c50);});};AGIVertices['prototype'][_0x60dd('0x1d')]=function(_0x41a4cd,_0x22dbcc){var _0xad92b8=this;this[_0x60dd('0xc')][_0x60dd('0x1e')](_0x41a4cd)[_0x60dd('0x11')](function(_0x2ce1b9){_0x22dbcc(null,_0x2ce1b9?_0xad92b8['getSoundPath'](_0x2ce1b9[_0x60dd('0x1f')]):![]);})[_0x60dd('0x14')](function(_0x3cc6d5){_0x22dbcc(_0x3cc6d5);});};AGIVertices['prototype'][_0x60dd('0x20')]=function(_0x2c691a,_0x5a4b46){this['rpc'][_0x60dd('0x21')](_0x2c691a)[_0x60dd('0x11')](function(_0x23bc5d){_0x5a4b46(null,_0x23bc5d?_0x23bc5d:![]);})[_0x60dd('0x14')](function(_0x22a49e){_0x5a4b46(_0x22a49e);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x22')]=function(_0x45c2bc,_0x514325,_0x52e3d0){this['mailRpc']['sendMailMessage'](_0x45c2bc,_0x514325)[_0x60dd('0x11')](function(){_0x52e3d0(null);})[_0x60dd('0x14')](function(_0x11c518){_0x52e3d0(_0x11c518);});};AGIVertices[_0x60dd('0xe')]['getIntervals']=function(_0x196335,_0x1e588d){this['rpc']['getIntervalById'](_0x196335)[_0x60dd('0x11')](function(_0x4c0d31){if(_0x4c0d31){if(_0x4c0d31['IntervalId']){_0x1e588d(null,[_0x4c0d31[_0x60dd('0x23')]]);}else{_0x1e588d(null,_['map'](_0x4c0d31[_0x60dd('0x24')],_0x60dd('0x23')));}}else{_0x1e588d(null,![]);}})[_0x60dd('0x14')](function(_0x462242){_0x1e588d(_0x462242);});};AGIVertices['prototype'][_0x60dd('0x25')]=function(_0x5004ea){return util[_0x60dd('0x26')](_0x60dd('0x27'),FILES_PATH,_0x5004ea);};AGIVertices[_0x60dd('0xe')]['getQueryOdbc']=function(_0x572b54,_0x3e9920,_0x21d4b7){odbc['open'](_0x572b54,function(_0x3142ab){if(_0x3142ab){logger[_0x60dd('0x28')](_0x60dd('0x29'),_0x3142ab);_0x21d4b7(_0x3142ab);}else{logger[_0x60dd('0x2a')](_0x60dd('0x2b'));odbc[_0x60dd('0x2c')](_0x3e9920,function(_0x401276,_0x5efc44){if(_0x401276){logger['info'](_0x60dd('0x2d'),_0x3e9920);_0x21d4b7(_0x401276);}else{logger['info'](_0x60dd('0x2e'),_0x3e9920);odbc[_0x60dd('0x2f')](function(_0x4d653e){if(_0x4d653e){logger['error'](_0x60dd('0x30'),_0x4d653e);}_0x21d4b7(null,_0x5efc44);});}});}});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x31')]=function(_0xd209e6,_0x3e6b5c){this[_0x60dd('0xc')][_0x60dd('0x32')](_0xd209e6)[_0x60dd('0x11')](function(_0x43795d){_0x3e6b5c(null,_0x43795d?_0x43795d:![]);})[_0x60dd('0x14')](function(_0xc0f02d){_0x3e6b5c(_0xc0f02d);});};AGIVertices['prototype']['createSmsMessage']=function(_0x23cf0c,_0x22a69b){this[_0x60dd('0xc')][_0x60dd('0x33')](_0x23cf0c)[_0x60dd('0x11')](function(_0x35de0d){_0x22a69b(null,_0x35de0d);})[_0x60dd('0x14')](function(_0x41feb0){_0x22a69b(_0x41feb0);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x34')]=function(_0x3b230a,_0x5428dc,_0x258b28){this[_0x60dd('0xc')][_0x60dd('0x34')]({'uniqueid':this[_0x60dd('0xb')]['uniqueid'],'node':_0x3b230a[_0x60dd('0x35')],'application':_0x3b230a[_0x60dd('0x36')],'data':_0x5428dc||null,'project_name':this[_0x60dd('0xb')][_0x60dd('0x37')],'callerid':this[_0x60dd('0xb')][_0x60dd('0x38')]})[_0x60dd('0x11')](function(_0x297ae0){if(_0x258b28){_0x258b28(null,_0x297ae0);}})[_0x60dd('0x14')](function(_0x32052e){if(_0x258b28){_0x258b28(_0x32052e);}});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x39')]=function(_0xa9e153,_0x35ff9a,_0x3b1732,_0x1d808b){this[_0x60dd('0xc')][_0x60dd('0x39')]({'uniqueid':this[_0x60dd('0xb')][_0x60dd('0x3a')],'callerid':this[_0x60dd('0xb')][_0x60dd('0x38')],'calleridname':this[_0x60dd('0xb')][_0x60dd('0x3b')],'context':this[_0x60dd('0xb')][_0x60dd('0x3c')],'extension':this[_0x60dd('0xb')][_0x60dd('0x3d')],'priority':this[_0x60dd('0xb')][_0x60dd('0x3e')],'accountcode':this[_0x60dd('0xb')]['accountcode'],'dnid':this[_0x60dd('0xb')]['dnid'],'projectName':this[_0x60dd('0xb')][_0x60dd('0x37')],'saveName':_0x35ff9a,'filename':_0xa9e153['file']||_0x35ff9a,'savePath':_0x3b1732})[_0x60dd('0x11')](function(_0x46e4ce){_0x1d808b(null,_0x46e4ce);})[_0x60dd('0x14')](function(_0x11c1de){_0x1d808b(_0x11c1de);});};AGIVertices['prototype'][_0x60dd('0x3f')]=function(_0x2556e3,_0x54a122,_0x11b62e){this[_0x60dd('0xc')][_0x60dd('0x3f')]({'uniqueid':this[_0x60dd('0xb')]['uniqueid'],'body':_0x2556e3,'direction':_0x54a122})[_0x60dd('0x11')](function(_0x5d4e01){if(_0x11b62e){_0x11b62e(null,_0x5d4e01);}})[_0x60dd('0x14')](function(_0x50a5e6){if(_0x11b62e){_0x11b62e(_0x50a5e6);}});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x40')]=function(_0x142855,_0x3add9a){this['rpc']['createCmContact']({'firstName':_[_0x60dd('0x41')](_0x142855[_0x60dd('0x12')])||_[_0x60dd('0x42')](_0x142855[_0x60dd('0x12')])?_0x60dd('0x43')+Math['random']():_0x142855[_0x60dd('0x12')],'lastName':_[_0x60dd('0x41')](_0x142855['lastName'])||_[_0x60dd('0x42')](_0x142855['lastName'])?null:_0x142855[_0x60dd('0x44')],'phone':_0x142855[_0x60dd('0x45')],'ListId':_0x142855[_0x60dd('0x46')],'scheduledAt':_0x142855[_0x60dd('0x47')],'callbackUniqueid':this[_0x60dd('0xb')][_0x60dd('0x3a')],'tags':'callback','description':_0x60dd('0x48')+_0x142855[_0x60dd('0x47')][_0x60dd('0x49')](),'priority':_0x142855['callback_priority']})[_0x60dd('0x11')](function(_0x3e3c0e){_0x3add9a(null,_0x3e3c0e);})['catch'](function(_0x4b6449){_0x3add9a(_0x4b6449);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4a')]=function(_0x5aceb4,_0x366c51){this[_0x60dd('0xc')][_0x60dd('0x4b')](_0x5aceb4)[_0x60dd('0x11')](function(_0x5b40af){_0x366c51(null,_0x5b40af?_0x5b40af[_0x60dd('0x12')]:![]);})['catch'](function(_0x41e98c){_0x366c51(_0x41e98c);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4c')]=function(_0x1fc454,_0x3e80ea,_0x43c1a8){var _0x30cc32={'role':_0x60dd('0x4d')};_0x30cc32[_0x1fc454]=this[_0x60dd('0xb')][_0x60dd('0x38')];this[_0x60dd('0xc')][_0x60dd('0x4c')](_0x30cc32,_0x3e80ea,this['channel'][_0x60dd('0x3a')])[_0x60dd('0x11')](function(_0x131dfc){_0x43c1a8(null,_[_0x60dd('0x42')](_0x131dfc)?![]:!![]);})['catch'](function(_0x4bdf94){logger['error'](_0x4bdf94);_0x43c1a8(null,![]);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4e')]=function(_0x2ad1b8,_0x1861a0){var _0x2608d8={'role':_0x60dd('0x4d')};_0x2608d8[_0x2ad1b8]=this[_0x60dd('0xb')][_0x60dd('0x38')];this[_0x60dd('0xc')]['agentUnpause'](_0x2608d8)[_0x60dd('0x11')](function(_0x2d0fb5){_0x1861a0(null,_[_0x60dd('0x42')](_0x2d0fb5)?![]:!![]);})[_0x60dd('0x14')](function(_0x385376){logger['error'](_0x385376);_0x1861a0(null,![]);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x4f')]=function(_0x23bddb,_0x3011fd){var _0x2d965e={'role':'agent'};_0x2d965e[_0x23bddb]=this[_0x60dd('0xb')]['callerid'];this[_0x60dd('0xc')][_0x60dd('0x4f')](_0x2d965e)['then'](function(_0x4aac4b){_0x3011fd(null,_[_0x60dd('0x42')](_0x4aac4b)?![]:!![]);})['catch'](function(_0x3358c9){logger[_0x60dd('0x28')](_0x3358c9);_0x3011fd(null,![]);});};AGIVertices[_0x60dd('0xe')]['agentLogin']=function(_0x5272a9,_0x52bb8f){var _0x343324={'role':_0x60dd('0x4d')};_0x343324[_0x5272a9]=this[_0x60dd('0xb')][_0x60dd('0x38')];var _0x4dd17b=_0x5272a9!='internal'?util[_0x60dd('0x26')](_0x60dd('0x50'),'LOCAL',this['channel']['callerid']):undefined;this[_0x60dd('0xc')]['agentLogin'](_0x343324,_0x4dd17b)[_0x60dd('0x11')](function(_0x1f920b){_0x52bb8f(null,_[_0x60dd('0x42')](_0x1f920b)?![]:!![]);})[_0x60dd('0x14')](function(_0x3f4cb0){logger[_0x60dd('0x28')](_0x3f4cb0);_0x52bb8f(null,![]);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x51')]=function(_0x52141a,_0x1cfc09){sh[_0x60dd('0x52')](_[_0x60dd('0x53')](_0x52141a),function(_0x6bf4c6,_0x13bc7d){var _0xc14180=_0x13bc7d[_0x60dd('0x54')](/(\r\n|\n|\r)/gm,'');_0x1cfc09(null,_0xc14180);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x55')]=function(_0x15a1a6,_0x935915){scripts[_0x60dd('0x55')](_0x15a1a6[_0x60dd('0x56')],_0x15a1a6[_0x60dd('0x57')]||'en',0x1)[_0x60dd('0x11')](function(_0x5b8388){_0x935915(null,_0x5b8388);})[_0x60dd('0x14')](function(_0x5035ef){_0x935915(_0x5035ef);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x58')]=function(_0x3b4c82,_0x5d34ca){scripts[_0x60dd('0x58')](this['channel'][_0x60dd('0x3a')],_0x3b4c82[_0x60dd('0x59')],_0x3b4c82['text'],_0x3b4c82[_0x60dd('0x5a')]||'en')[_0x60dd('0x11')](function(_0x477d9f){_0x5d34ca(null,_0x477d9f);})[_0x60dd('0x14')](function(_0x18a2da){_0x5d34ca(_0x18a2da);});};AGIVertices['prototype'][_0x60dd('0x5b')]=function(_0x5874fb,_0x550608){scripts[_0x60dd('0x5b')](this['channel'],_0x5874fb)[_0x60dd('0x11')](function(_0xd8542b){_0x550608(null,_0xd8542b);})['catch'](function(_0x19dffb){_0x550608(_0x19dffb);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x5c')]=function(_0xdffc6f,_0x1fa9d1){scripts[_0x60dd('0x5c')](_0xdffc6f['key'],_0xdffc6f[_0x60dd('0x56')],_0xdffc6f['ispeech_tts_language']||_0x60dd('0x5d'),_0xdffc6f[_0x60dd('0x5e')])['then'](function(_0x5dc258){_0x1fa9d1(null,_0x5dc258);})[_0x60dd('0x14')](function(_0x371432){_0x1fa9d1(_0x371432);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x5f')]=function(_0x7484f0,_0xfe90e5,_0x5a05c2){scripts['ispeechASR'](_0xfe90e5,_0x7484f0[_0x60dd('0x59')],_0x7484f0[_0x60dd('0x60')]||_0x60dd('0x5d'),this[_0x60dd('0x61')](_0x7484f0[_0x60dd('0x62')])?_0x7484f0[_0x60dd('0x62')]:undefined)[_0x60dd('0x11')](function(_0x4ca88b){_0x5a05c2(null,_0x4ca88b);})['catch'](function(_0x2f8f1d){_0x5a05c2(_0x2f8f1d);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x63')]=function(_0x26e9e6,_0x41e131){scripts['awsPolly'](_0x26e9e6['aws_access_key_id'],_0x26e9e6[_0x60dd('0x64')],_0x26e9e6['aws_polly_region'],_0x26e9e6[_0x60dd('0x65')]||'Amy',_0x26e9e6[_0x60dd('0x56')],_0x26e9e6[_0x60dd('0x66')]||_0x60dd('0x56'))[_0x60dd('0x11')](function(_0x3a72b4){_0x41e131(null,_0x3a72b4);})[_0x60dd('0x14')](function(_0x2abfbc){_0x41e131(_0x2abfbc);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x67')]=function(_0x1bc37c,_0x31ff35){scripts[_0x60dd('0x67')](this[_0x60dd('0xb')][_0x60dd('0x3a')],_0x1bc37c[_0x60dd('0x68')],_0x1bc37c[_0x60dd('0x64')],_0x1bc37c['aws_lex_region'],_0x1bc37c['text'],_0x1bc37c['aws_bot_name'])[_0x60dd('0x11')](function(_0x2aa7d0){_0x31ff35(null,_0x2aa7d0);})[_0x60dd('0x14')](function(_0x418d76){_0x31ff35(_0x418d76);});};AGIVertices[_0x60dd('0xe')][_0x60dd('0x69')]=function(_0x418e1c,_0x8ec75b,_0x5ba57){scripts[_0x60dd('0x69')](_0x8ec75b,_0x418e1c[_0x60dd('0x59')],_0x418e1c[_0x60dd('0x6a')]||'en-US')[_0x60dd('0x11')](function(_0x3680b0){_0x5ba57(null,_0x3680b0);})[_0x60dd('0x14')](function(_0x2fbfa4){_0x5ba57(_0x2fbfa4);});};AGIVertices[_0x60dd('0xe')]['tildeASR']=function(_0x468f00,_0x4bb4e5,_0x50c4a5){scripts[_0x60dd('0x6b')](_0x4bb4e5,_0x468f00[_0x60dd('0x6c')],_0x468f00[_0x60dd('0x6d')],_0x468f00[_0x60dd('0x6e')])[_0x60dd('0x11')](function(_0x85c612){_0x50c4a5(null,_0x85c612);})[_0x60dd('0x14')](function(_0x2537dc){_0x50c4a5(_0x2537dc);});};AGIVertices[_0x60dd('0xe')]['clear']=function(_0x1b899d){var _0x4ae2ab=_['includes'](verticesWithRetry,_0x1b899d['agicommand'])?_0x1b899d:_[_0x60dd('0x6f')](_0x1b899d);for(var _0x2e3ef9 in _0x4ae2ab){if(_0x4ae2ab[_0x60dd('0x70')](_0x2e3ef9)){if(_0x4ae2ab[_0x2e3ef9]&&_[_0x60dd('0x71')](_0x4ae2ab[_0x2e3ef9])){_0x4ae2ab[_0x2e3ef9]=this[_0x60dd('0x72')](_0x4ae2ab[_0x2e3ef9]);}}}return _0x4ae2ab;};AGIVertices[_0x60dd('0xe')]['replaceAllVariables']=function(_0x1689ac){var _0x5aa068=_0x1689ac['split']('{');for(var _0x517d12=0x1;_0x517d12<_0x5aa068[_0x60dd('0x73')];_0x517d12+=0x1){var _0x38ff45=_0x5aa068[_0x517d12][_0x60dd('0x74')]('}');if(_0x38ff45['length']>0x1){_0x1689ac=_0x1689ac[_0x60dd('0x75')]('{'+_0x38ff45[0x0]+'}',this['channel'][_0x60dd('0xf')](_0x38ff45[0x0])[_0x60dd('0x76')]||_0x38ff45[0x0]);}}if(_0x5aa068[_0x60dd('0x73')]===0x1){return _0x1689ac[_0x60dd('0x49')]();}return this[_0x60dd('0x72')](_0x1689ac);};AGIVertices[_0x60dd('0xe')]['getAndSetVariable']=function(_0x362898,_0xa008f){var _0x10089c=this[_0x60dd('0xb')]['getVariable'](_0x362898);if(_0x10089c['result']===-0x1){return _0x10089c;}logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xa008f,_0x10089c['extra']));return this[_0x60dd('0xb')]['setVariable'](_0xa008f,_0x10089c[_0x60dd('0x76')]);};AGIVertices[_0x60dd('0xe')]['isConfigured']=function(_0x12886e){return _0x12886e&&_0x12886e!=='0'&&_0x12886e!=='-1'&&_0x12886e!=='';};AGIVertices['prototype'][_0x60dd('0x77')]=function(_0x3c5dc1){this['createSquareDetailsReport'][_0x60dd('0x78')](this,_0x3c5dc1,'-');_0x3c5dc1[_0x60dd('0x79')]=_0x3c5dc1[_0x60dd('0x77')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x60dd('0x7')]=function(_0x99e31e){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x7a'),_0x99e31e['label']));return this['channel']['agi']([_0x99e31e[_0x60dd('0x7b')],_0x99e31e['args']]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x7c')]=function(_0x59ec60){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x7d'),_0x59ec60['label']));if(this[_0x60dd('0x61')](_0x59ec60[_0x60dd('0x7e')])){logger['info'](util['format'](_0x60dd('0x7f'),_0x59ec60[_0x60dd('0x7e')]));var _0x3910c8=this[_0x60dd('0xb')][_0x60dd('0x80')](_0x59ec60['timeout']);if(_0x3910c8[_0x60dd('0x81')]===-0x1){return _0x3910c8;}}return this['channel'][_0x60dd('0x7c')]();};AGIVertices['prototype'][_0x60dd('0x82')]=function(_0xd06303){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x83'),_0xd06303[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0xd06303[_0x60dd('0x46')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0xd06303,_0x60dd('0x84'));}_0xd06303['scheduledAt']=moment();if(this[_0x60dd('0x61')](_0xd06303[_0x60dd('0x85')])){_0xd06303['scheduledAt']=moment()['add'](_0xd06303[_0x60dd('0x85')],_0x60dd('0x86'));}if(!this['isConfigured'](_0xd06303[_0x60dd('0x87')])){_0xd06303[_0x60dd('0x87')]=0x2;}this[_0x60dd('0x40')][_0x60dd('0x78')](this,_0xd06303);return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x89'),_0xd06303['phone'],_0xd06303[_0x60dd('0x46')],_0xd06303[_0x60dd('0x47')]));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x8a')]=function(_0x1b5bff){logger['info'](util[_0x60dd('0x26')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x1b5bff[_0x60dd('0x35')]));var _0x23faf2=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x1b5bff[_0x60dd('0x8b')],_0x1b5bff['options']);if(_0x23faf2[_0x60dd('0x81')]===-0x1){return _0x23faf2;}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0x8c'),_0x1b5bff[_0x60dd('0x8b')],_0x1b5bff['options']));};AGIVertices['prototype'][_0x60dd('0x8d')]=function(_0x2de6fa){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x8e'),_0x2de6fa[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x2de6fa[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')]('no\x20text\x20configured');}var _0x4db3da='\x22'+_0x2de6fa[_0x60dd('0x56')]+'\x22';if(this[_0x60dd('0x61')](_0x2de6fa[_0x60dd('0x8f')])){_0x4db3da+=','+_0x2de6fa['options'];}var _0x41bb29=this[_0x60dd('0xb')][_0x60dd('0x52')]('MRCPSynth',_0x4db3da);if(_0x41bb29[_0x60dd('0x81')]===-0x1){return _0x41bb29;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x4db3da));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x90')]=function(_0x5907a5){logger['info'](util[_0x60dd('0x26')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5907a5[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x5907a5[_0x60dd('0x56')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x1a9c7d='\x22'+_0x5907a5[_0x60dd('0x56')]+'\x22';if(this[_0x60dd('0x61')](_0x5907a5[_0x60dd('0x8f')])){_0x1a9c7d+=','+_0x5907a5[_0x60dd('0x8f')];}var _0x1310af=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x91'),_0x1a9c7d);if(_0x1310af[_0x60dd('0x81')]===-0x1){return _0x1310af;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x92'),_0x1a9c7d));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x93')]=function(_0x4d0d29){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x94'),_0x4d0d29[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x4d0d29[_0x60dd('0x95')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x96'));}var _0x28906b=_0x4d0d29[_0x60dd('0x95')];if(this[_0x60dd('0x61')](_0x4d0d29['options'])){_0x28906b+=','+_0x4d0d29['options'];}var _0x74a704=this[_0x60dd('0xb')][_0x60dd('0x52')]('MRCPRecog',_0x28906b);if(_0x74a704[_0x60dd('0x81')]===-0x1){return _0x74a704;}var _0x37dcc9=this[_0x60dd('0x97')](_0x60dd('0x98'),_0x60dd('0x99'));if(_0x37dcc9[_0x60dd('0x81')]===-0x1){return _0x37dcc9;}var _0x16e004=this[_0x60dd('0x97')]('RECOG_INPUT()',_0x60dd('0x9a'));if(_0x16e004[_0x60dd('0x81')]===-0x1){return _0x16e004;}var _0x452fe3=this['getAndSetVariable'](_0x60dd('0x9b'),'LUMENVOX_ASR_INSTANCE');if(_0x452fe3['result']===-0x1){return _0x452fe3;}return this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x9c'),_0x28906b));};AGIVertices[_0x60dd('0xe')]['sestekasr']=function(_0x5918b2){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5918b2[_0x60dd('0x35')]));if(!this['isConfigured'](_0x5918b2[_0x60dd('0x95')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x96'));}var _0x312d97=_0x5918b2[_0x60dd('0x95')];if(this['isConfigured'](_0x5918b2[_0x60dd('0x8f')])){_0x312d97+=','+_0x5918b2[_0x60dd('0x8f')];}var _0x118e41=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x9d'),_0x312d97);if(_0x118e41['result']===-0x1){return _0x118e41;}var _0x9f6edd=this[_0x60dd('0x97')]('RECOG_CONFIDENCE()',_0x60dd('0x9e'));if(_0x9f6edd[_0x60dd('0x81')]===-0x1){return _0x9f6edd;}var _0x2c37e7=this['getAndSetVariable']('RECOG_INPUT()',_0x60dd('0x9f'));if(_0x2c37e7[_0x60dd('0x81')]===-0x1){return _0x2c37e7;}var _0x25df87=this[_0x60dd('0x97')](_0x60dd('0x9b'),_0x60dd('0xa0'));if(_0x25df87['result']===-0x1){return _0x25df87;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x9c'),_0x312d97));};AGIVertices[_0x60dd('0xe')]['database']=function(_0x19a82c){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xa1'),_0x19a82c[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x19a82c[_0x60dd('0xa2')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xa3'));}var _0x298961=this[_0x60dd('0xa4')]['sync'](this,_0x19a82c[_0x60dd('0xa2')]);if(!_0x298961){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xa5'));}if(!this[_0x60dd('0x61')](_0x19a82c[_0x60dd('0x2c')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xa6'));}var _0x412690=_0x19a82c[_0x60dd('0x2c')][_0x60dd('0x54')](/(\r\n|\n|\r)/gm,'\x20');this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xa7'),_0x412690));var _0x567ace=this[_0x60dd('0xa8')][_0x60dd('0x78')](this,_0x298961,_0x412690);this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x19a82c,_0x412690);if(!this[_0x60dd('0x61')](_0x19a82c[_0x60dd('0xa9')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xaa'));}var _0x8e0716=this[_0x60dd('0xf')][_0x60dd('0x78')](this,_0x19a82c[_0x60dd('0xa9')]);if(!_0x8e0716){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x19a82c,_0x60dd('0xab'));}var _0xd21642=this;_0x567ace[_0x60dd('0xac')](function(_0x4e7ad8,_0x3c2d47){Object[_0x60dd('0xad')](_0x4e7ad8)[_0x60dd('0xac')](function(_0x34be91){_0xd21642[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')]('%s[%s][%s]',_0x8e0716,_0x3c2d47,_0x34be91),_0x4e7ad8[_0x34be91]);});});this[_0x60dd('0xb')]['setVariable'](util[_0x60dd('0x26')]('%s_ROWS_COUNT',_0x8e0716),_0x567ace[_0x60dd('0x73')]);return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xaf'),_0x8e0716));};AGIVertices['prototype'][_0x60dd('0xb0')]=function(_0x2dd22d){logger[_0x60dd('0xb1')](util[_0x60dd('0x26')](_0x60dd('0xb2'),_0x2dd22d[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x2dd22d['sip_id'])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2dd22d,'no\x20user\x20selected');}var _0x258df5=this[_0x60dd('0x19')]['sync'](this,_0x2dd22d[_0x60dd('0xb3')]);if(!_0x258df5){return this['channel'][_0x60dd('0x28')](_0x2dd22d,_0x60dd('0xb4'));}var _0x47d325=this['channel']['exec']('DIAL',[util[_0x60dd('0x26')](_0x60dd('0xb5'),_0x258df5),_0x2dd22d[_0x60dd('0x7e')],_0x2dd22d[_0x60dd('0xb6')],_0x2dd22d[_0x60dd('0xb7')]]);if(_0x47d325[_0x60dd('0x81')]===-0x1){return _0x47d325;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0xb8')]=function(_0x5784d4){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xb9'),_0x5784d4[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x5784d4[_0x60dd('0x59')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xba'));}if(!this['isConfigured'](_0x5784d4[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')]('no\x20text\x20configured');}this[_0x60dd('0xb')]['bot']=!![];this[_0x60dd('0x34')](_0x5784d4);this['createSquareMessage'](_0x5784d4[_0x60dd('0x56')],'in');this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0xbb'),_0x5784d4['text']));var _0x5320da=this['googleDialogflow'][_0x60dd('0x78')](this,_0x5784d4);if(_0x5320da){for(var _0x59c8ed in _0x5320da){if(_0x5320da[_0x60dd('0x70')](_0x59c8ed)){this[_0x60dd('0xb')]['setVariable'](util[_0x60dd('0x26')](_0x60dd('0xbc'),_0x59c8ed[_0x60dd('0xbd')]()),_0x5320da[_0x59c8ed]);}}this[_0x60dd('0x3f')](_0x5320da[_0x60dd('0xbe')],_0x60dd('0xbf'));return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xc0'),_0x5320da[_0x60dd('0xbe')]));}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x5784d4,_0x60dd('0xc1'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0xc2')]=function(_0x548618){logger['info'](util[_0x60dd('0x26')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x548618[_0x60dd('0x35')]));if(!this['isConfigured'](_0x548618['ndauth_url'])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xc3'));}if(!this[_0x60dd('0x61')](_0x548618['username'])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xc4'));}if(!this['isConfigured'](_0x548618['password'])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc5'));}if(!this[_0x60dd('0x61')](_0x548618[_0x60dd('0xc6')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0xc8')]=!![];this[_0x60dd('0x34')](_0x548618);this['createSquareMessage'](_0x548618[_0x60dd('0x56')],'in');this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')]('Trying\x20SestekNDA:\x20%s',_0x548618[_0x60dd('0x56')]));var _0x282b3f=this[_0x60dd('0x5b')][_0x60dd('0x78')](this,_0x548618);if(_0x282b3f){for(var _0x2709be in _0x282b3f){if(_0x282b3f['hasOwnProperty'](_0x2709be)){this[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0xc9'),_0x2709be[_0x60dd('0xbd')]()),_0x282b3f[_0x2709be]);}}this['createSquareMessage'](_0x282b3f[_0x60dd('0xbe')],_0x60dd('0xbf'));if(_0x282b3f['audiofile']){this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x282b3f[_0x60dd('0xca')]));var _0x6306c2=this[_0x60dd('0xb')]['streamFile'](_0x282b3f[_0x60dd('0xca')]);try{fs[_0x60dd('0xcb')](_0x282b3f[_0x60dd('0xca')]+'.wav');}catch(_0x1750a9){logger['error'](_0x1750a9);}return _0x6306c2;}else{return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')]('SestekNDA\x20Result\x20%s',_0x282b3f[_0x60dd('0xbe')]));}}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x548618,_0x60dd('0xcc'));};AGIVertices[_0x60dd('0xe')]['end']=function(_0xf06702){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xcd'),_0xf06702[_0x60dd('0x35')]));return this[_0x60dd('0xb')]['noop'](_0x60dd('0xce'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0xcf')]=function(_0x2ea1d7){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xd0'),_0x2ea1d7[_0x60dd('0x35')]));var _0x5228ef='';if(_0x2ea1d7[_0x60dd('0xd1')]){if(!this[_0x60dd('0x61')](_0x2ea1d7[_0x60dd('0xd1')])){return this['channel'][_0x60dd('0x28')](_0x2ea1d7,_0x60dd('0xd2'));}else{var _0x31a849=parseInt(_0x2ea1d7[_0x60dd('0xd1')],0xa);if(isNaN(_0x31a849)){_0x5228ef=_0x2ea1d7[_0x60dd('0xd1')];}else{_0x5228ef=this['getTrunk'][_0x60dd('0x78')](this,_0x2ea1d7[_0x60dd('0xd1')]);if(!_0x5228ef){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2ea1d7,'no\x20trunk\x20found');}}}}else if(_0x2ea1d7[_0x60dd('0xd3')]){_0x5228ef=_0x2ea1d7[_0x60dd('0xd3')];}else{return this['channel'][_0x60dd('0x28')](_0x2ea1d7,_0x60dd('0xd2'));}var _0x22ddbd=this['channel'][_0x60dd('0x52')]('DIAL',[util['format'](_0x60dd('0xd4'),_0x5228ef,_0x2ea1d7['phone']),_0x2ea1d7[_0x60dd('0x7e')],_0x2ea1d7[_0x60dd('0xb6')],_0x2ea1d7[_0x60dd('0xb7')]]);if(_0x22ddbd[_0x60dd('0x81')]===-0x1){return _0x22ddbd;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xd5'),'DIAL'));};AGIVertices[_0x60dd('0xe')]['finally']=function(_0x481788){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xd6'),_0x481788[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x88')]('finally');};AGIVertices[_0x60dd('0xe')][_0x60dd('0xa')]=function(_0x34d2ce){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xd7'),_0x34d2ce[_0x60dd('0x35')]));if(_0x34d2ce[_0x60dd('0x79')]===0x0){return this[_0x60dd('0x77')](_0x34d2ce);}_0x34d2ce[_0x60dd('0x79')]-=0x1;if(!this[_0x60dd('0x61')](_0x34d2ce[_0x60dd('0xd8')])){return this['channel'][_0x60dd('0x28')](_0x34d2ce,_0x60dd('0xd9'));}var _0x5b14f3=this['getSound']['sync'](this,_0x34d2ce[_0x60dd('0xd8')]);if(!_0x5b14f3){return this['channel']['error'](_0x34d2ce,'no\x20file\x20audio\x20found');}if(!this[_0x60dd('0x61')](_0x34d2ce[_0x60dd('0xa9')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x60dd('0xaa'));}var _0x5d5792=this[_0x60dd('0xb')]['getData'](_0x5b14f3,_0x34d2ce[_0x60dd('0xda')],_0x34d2ce[_0x60dd('0xdb')]);var _0x4d3836=_0x5d5792['result']?_0x5d5792['result'][_0x60dd('0x49')]():'';logger[_0x60dd('0x2a')](_0x60dd('0xdc'),JSON[_0x60dd('0xdd')](_0x5d5792));if(_0x5d5792[_0x60dd('0x81')]===-0x1){this[_0x60dd('0x34')]['sync'](this,_0x34d2ce,_0x4d3836);return _0x5d5792;}else if(_0x5d5792['extra']===_0x60dd('0x7e')){_0x5d5792['result']=_0x4d3836[_0x60dd('0x73')]>=parseInt(_0x34d2ce['mindigit'])?'x':'i';}else{_0x5d5792[_0x60dd('0x81')]=_0x4d3836[_0x60dd('0x73')]>=parseInt(_0x34d2ce[_0x60dd('0xde')])&&_0x4d3836[_0x60dd('0x73')]<=parseInt(_0x34d2ce[_0x60dd('0xdb')])?'x':'i';}var _0x916900=this[_0x60dd('0xf')]['sync'](this,_0x34d2ce[_0x60dd('0xa9')]);if(!_0x916900){return this[_0x60dd('0xb')]['error'](_0x34d2ce,_0x60dd('0xab'));}this[_0x60dd('0xb')][_0x60dd('0xae')](_0x916900,_0x4d3836);if(this[_0x60dd('0x61')](_0x34d2ce[_0x60dd('0xdf')])){var _0x820f41=parseInt(_0x34d2ce['hiddendigitsnum'],0xa);var _0x2af049=rs['generate']({'charset':'*','length':_0x820f41});var _0x17fbaa=_0x4d3836[_0x60dd('0x73')];if(_0x17fbaa>0x0){if(_0x17fbaa>_0x820f41){this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x34d2ce,_0x34d2ce['hiddendigitspos']===_0x60dd('0xe0')?_0x2af049+_0x4d3836[_0x60dd('0xe1')](_0x820f41):_0x4d3836[_0x60dd('0xe1')](0x0,_0x17fbaa-_0x820f41)+_0x2af049);}else{this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x34d2ce,rs[_0x60dd('0xe2')]({'charset':'*','length':_0x17fbaa}));}}else{this[_0x60dd('0x34')]['sync'](this,_0x34d2ce,'');}}else{this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x34d2ce,_0x4d3836);}return _0x5d5792;};AGIVertices[_0x60dd('0xe')][_0x60dd('0xe3')]=function(_0x438296){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xe4'),_0x438296[_0x60dd('0x35')]));return this[_0x60dd('0xa')](_0x438296);};AGIVertices[_0x60dd('0xe')][_0x60dd('0xe5')]=function(_0x54f519){logger['info'](util['format'](_0x60dd('0xe6'),_0x54f519[_0x60dd('0x35')]));this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x54f519,_0x54f519['goalname']);return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xe7'),_0x54f519['goalname']));};AGIVertices[_0x60dd('0xe')]['awspolly']=function(_0x35b5a1){logger['info'](util[_0x60dd('0x26')](_0x60dd('0xe8'),_0x35b5a1['label']));if(!this['isConfigured'](_0x35b5a1['aws_access_key_id'])||!this['isConfigured'](_0x35b5a1[_0x60dd('0x64')])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xe9'));}if(!this['isConfigured'](_0x35b5a1[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc7'));}this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xea'),_0x35b5a1[_0x60dd('0x56')]));var _0x1c6927=this[_0x60dd('0x63')][_0x60dd('0x78')](this,_0x35b5a1);if(_0x1c6927){this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0xeb'),_0x1c6927));var _0x492cc0=this[_0x60dd('0xb')][_0x60dd('0xec')](_0x1c6927);try{fs['unlink'](_0x1c6927+'.wav');}catch(_0x351a8e){logger[_0x60dd('0x28')](_0x351a8e);}return _0x492cc0;}return this['channel'][_0x60dd('0x28')](_0x35b5a1,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x48d4f9){logger['info'](util['format'](_0x60dd('0xed'),_0x48d4f9[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x48d4f9[_0x60dd('0x68')])||!this[_0x60dd('0x61')](_0x48d4f9[_0x60dd('0x64')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xe9'));}if(!this[_0x60dd('0x61')](_0x48d4f9[_0x60dd('0xee')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xef'));}if(!this['isConfigured'](_0x48d4f9['text'])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0xc8')]=!![];this[_0x60dd('0x34')](_0x48d4f9);this[_0x60dd('0x3f')](_0x48d4f9['text'],'in');this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0xf0'),_0x48d4f9[_0x60dd('0x56')]));var _0x54b35a=this[_0x60dd('0x67')][_0x60dd('0x78')](this,_0x48d4f9);if(_0x54b35a){for(var _0x3ea315 in _0x54b35a){if(_0x54b35a[_0x60dd('0x70')](_0x3ea315)&&_['isString'](_0x54b35a[_0x3ea315])){this[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0xf1'),_0x3ea315[_0x60dd('0xbd')]()),_0x54b35a[_0x3ea315]);}}if(_[_0x60dd('0x42')](_0x54b35a[_0x60dd('0xf2')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xf3'));}else{this[_0x60dd('0x3f')](_0x54b35a['message'],_0x60dd('0xbf'));return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0xf4'),_0x54b35a[_0x60dd('0xf2')]));}}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x48d4f9,_0x60dd('0xf5'));};AGIVertices[_0x60dd('0xe')]['googleasr']=function(_0x540f66){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0xf6'),_0x540f66[_0x60dd('0x35')],_0x540f66['timeout']));if(!this['isConfigured'](_0x540f66['key'])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xba'));}var _0x33a7c9=_0x60dd('0xf7');var _0x54fae2=util['format'](_0x60dd('0xf8'),FILES_PATH,rs[_0x60dd('0xe2')](0x4));var _0x35a321=util[_0x60dd('0x26')](_0x60dd('0xf9'),_0x54fae2,_0x33a7c9);var _0x195c4b=!![];if(_0x540f66['beep']===_0x60dd('0xfa')){_0x195c4b=![];}var _0x16bb5a=this[_0x60dd('0xb')]['recordFile'](_0x54fae2,_0x33a7c9,_0x540f66[_0x60dd('0xfb')],_0x540f66[_0x60dd('0x7e')],undefined,_0x195c4b);if(_0x16bb5a[_0x60dd('0x81')]!==-0x1){this['channel']['noop'](util[_0x60dd('0x26')](_0x60dd('0xfc'),_0x35a321));var _0x4ff98e=this['googleASR']['sync'](this,_0x540f66,_0x35a321);if(_0x4ff98e){for(var _0x2894ed in _0x4ff98e){if(_0x4ff98e[_0x60dd('0x70')](_0x2894ed)){this[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0xfd'),_0x2894ed['toUpperCase']()),_0x4ff98e[_0x2894ed]);}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0xfe'),JSON[_0x60dd('0xdd')](_0x4ff98e)));}}return _0x16bb5a;};AGIVertices[_0x60dd('0xe')][_0x60dd('0xff')]=function(_0x18f003){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x100'),_0x18f003[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x18f003[_0x60dd('0x6c')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x101'));}if(!this['isConfigured'](_0x18f003[_0x60dd('0x6d')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0x102'));}var _0x237d0b=_0x60dd('0xf7');var _0x1c2dc9=util[_0x60dd('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0x60dd('0xe2')](0x4));var _0x6bf505=util[_0x60dd('0x26')](_0x60dd('0xf9'),_0x1c2dc9,_0x237d0b);var _0x46d9af=!![];if(_0x18f003[_0x60dd('0x103')]===_0x60dd('0xfa')){_0x46d9af=![];}var _0x21b6da=this[_0x60dd('0xb')][_0x60dd('0x104')](_0x1c2dc9,_0x237d0b,_0x18f003[_0x60dd('0xfb')],_0x18f003['timeout'],undefined,_0x46d9af);if(_0x21b6da['result']!==-0x1){this['channel']['noop'](util['format'](_0x60dd('0x105'),_0x6bf505));var _0x2948f6=this[_0x60dd('0x6b')]['sync'](this,_0x18f003,_0x6bf505);if(_0x2948f6){for(var _0x402337 in _0x2948f6){if(_0x2948f6[_0x60dd('0x70')](_0x402337)){this['channel'][_0x60dd('0xae')](util[_0x60dd('0x26')](_0x60dd('0x106'),_0x402337[_0x60dd('0xbd')]()),_0x2948f6[_0x402337]);}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0x107'),JSON[_0x60dd('0xdd')](_0x2948f6)));}}return _0x21b6da;};AGIVertices[_0x60dd('0xe')][_0x60dd('0x108')]=function(_0x182b31){logger['info'](util['format'](_0x60dd('0x109'),_0x182b31[_0x60dd('0x35')]));return this[_0x60dd('0xb')]['continueAt'](_0x182b31['context'],_0x182b31[_0x60dd('0x3d')],_0x182b31['priority']);};AGIVertices[_0x60dd('0xe')]['gotoif']=function(_0x154350){logger[_0x60dd('0x2a')](util['format']('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x154350['label']));if(!this['isConfigured'](_0x154350[_0x60dd('0x10a')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x154350,_0x60dd('0x10b'));}try{var _0xd2152e=eval(_0x154350['condition'])?_0x60dd('0x10c'):_0x60dd('0x10d');this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x10e'),_0x154350[_0x60dd('0x10a')],_0xd2152e));return{'code':0xc8,'result':_0xd2152e};}catch(_0x4225dc){return{'code':0xc8,'result':_0x60dd('0x10d')};}};AGIVertices[_0x60dd('0xe')]['gotoiftime']=function(_0x7ef20d){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x10f'),_0x7ef20d[_0x60dd('0x35')]));if(!this['isConfigured'](_0x7ef20d['interval_id'])){return this[_0x60dd('0xb')]['error'](_0x7ef20d,_0x60dd('0x110'));}var _0x4bf13d=this[_0x60dd('0x111')][_0x60dd('0x78')](this,_0x7ef20d[_0x60dd('0x112')]);if(!_0x4bf13d){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x7ef20d,_0x60dd('0x113'));}for(var _0x19f10d=0x0;_0x19f10d<_0x4bf13d['length'];_0x19f10d+=0x1){var _0x46307b=this['channel']['getVariable'](util[_0x60dd('0x26')](_0x60dd('0x114'),_0x4bf13d[_0x19f10d]));if(_0x46307b[_0x60dd('0x81')]===-0x1){return _0x46307b;}logger[_0x60dd('0x2a')](util['format'](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],_0x46307b[_0x60dd('0x76')]));if(_0x46307b[_0x60dd('0x76')]===_0x60dd('0x10c')){logger[_0x60dd('0x2a')](util['format']('IFTIME\x20%s\x20%s',_0x4bf13d[_0x19f10d],_0x60dd('0x10c')));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],'true'));return{'code':0xc8,'result':_0x60dd('0x10c')};}else{logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],_0x60dd('0x10d')));this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x115'),_0x4bf13d[_0x19f10d],'false'));}}return{'code':0xc8,'result':_0x60dd('0x10d')};};AGIVertices[_0x60dd('0xe')][_0x60dd('0x116')]=function(_0x255c8e){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x117'),_0x255c8e[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x116')]();};AGIVertices[_0x60dd('0xe')][_0x60dd('0x118')]=function(_0x21d93d){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x119'),_0x21d93d[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x21d93d[_0x60dd('0x59')])){return this[_0x60dd('0xb')]['noop'](_0x60dd('0xba'));}var _0x7aee8a=_0x60dd('0xf7');var _0x3cb38e=util['format'](_0x60dd('0xf8'),FILES_PATH,rs[_0x60dd('0xe2')](0x4));var _0x123455=util[_0x60dd('0x26')](_0x60dd('0xf9'),_0x3cb38e,_0x7aee8a);var _0x978d0f=!![];if(_0x21d93d[_0x60dd('0x103')]===_0x60dd('0xfa')){_0x978d0f=![];}var _0x388865=this['channel'][_0x60dd('0x104')](_0x3cb38e,_0x7aee8a,_0x21d93d[_0x60dd('0xfb')],_0x21d93d[_0x60dd('0x7e')],undefined,_0x978d0f);if(_0x388865['result']!==-0x1){this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x11a'),_0x123455));var _0x4cfe21=this[_0x60dd('0x5f')][_0x60dd('0x78')](this,_0x21d93d,_0x123455);if(_0x4cfe21){for(var _0x5de786 in _0x4cfe21){if(_0x4cfe21[_0x60dd('0x70')](_0x5de786)){this['channel']['setVariable'](util[_0x60dd('0x26')](_0x60dd('0x11b'),_0x5de786[_0x60dd('0xbd')]()),_0x4cfe21[_0x5de786]);}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')](_0x60dd('0x11c'),JSON['stringify'](_0x4cfe21)));}}return _0x388865;};AGIVertices[_0x60dd('0xe')][_0x60dd('0x11d')]=function(_0x4f95ce){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x4f95ce[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x4f95ce[_0x60dd('0x59')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xba'));}if(!this[_0x60dd('0x61')](_0x4f95ce[_0x60dd('0x56')])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x11e'),_0x4f95ce[_0x60dd('0x56')]));var _0xfe191b=this[_0x60dd('0x5c')]['sync'](this,_0x4f95ce);if(_0xfe191b){this['channel'][_0x60dd('0x88')](util['format'](_0x60dd('0x11a'),_0xfe191b));var _0x316ae9=this[_0x60dd('0xb')][_0x60dd('0xec')](_0xfe191b,_0x4f95ce[_0x60dd('0xfb')]);try{fs[_0x60dd('0xcb')](_0xfe191b+_0x60dd('0x11f'));}catch(_0x556109){logger[_0x60dd('0x28')](_0x556109);}return _0x316ae9;}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x4f95ce,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x60dd('0xe')]['login']=function(_0x45a3d4){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x120'),_0x45a3d4[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x45a3d4[_0x60dd('0x121')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x45a3d4,_0x60dd('0x122'));}logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x123'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x45a3d4[_0x60dd('0x121')]));var _0x896f5=this[_0x60dd('0x124')][_0x60dd('0x78')](this,_0x45a3d4[_0x60dd('0x121')]);if(_0x896f5){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x60dd('0xb')]['callerid'],_0x45a3d4[_0x60dd('0x121')]));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x125'),this['channel']['callerid'],_0x45a3d4[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x126')};}else{logger['info'](util[_0x60dd('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x60dd('0xb')][_0x60dd('0x38')],_0x45a3d4[_0x60dd('0x121')]));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x45a3d4['findBy']));return{'code':0xc8,'result':_0x60dd('0x128')};}};AGIVertices[_0x60dd('0xe')][_0x60dd('0x129')]=function(_0x320748){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x12a'),_0x320748['label']));if(!this[_0x60dd('0x61')](_0x320748[_0x60dd('0x121')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x320748,_0x60dd('0x122'));}logger['info'](util['format'](_0x60dd('0x123'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x320748[_0x60dd('0x121')]));var _0x523c59=this[_0x60dd('0x4f')]['sync'](this,_0x320748[_0x60dd('0x121')]);if(_0x523c59){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')]['callerid'],_0x320748['findBy']));this['channel']['noop'](util[_0x60dd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x60dd('0xb')][_0x60dd('0x38')],_0x320748[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x126')};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x60dd('0xb')][_0x60dd('0x38')],_0x320748['findBy']));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')]['callerid'],_0x320748[_0x60dd('0x121')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x60dd('0x12b')]=function(_0xb6f46c){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x12c'),_0xb6f46c[_0x60dd('0x35')]));if(!this['isConfigured'](_0xb6f46c[_0x60dd('0x12d')])){return this['channel'][_0x60dd('0x28')](_0xb6f46c,'no\x20operation\x20configured');}this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x12e'),_0xb6f46c[_0x60dd('0x12d')]));var _0x81a948=eval(_0xb6f46c[_0x60dd('0x12d')]);if(!this[_0x60dd('0x61')](_0xb6f46c['variable_id'])){return this[_0x60dd('0xb')][_0x60dd('0x88')](_0x60dd('0xaa'));}var _0x25bf67=this[_0x60dd('0xf')]['sync'](this,_0xb6f46c[_0x60dd('0xa9')]);if(!_0x25bf67){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0xb6f46c,_0x60dd('0xab'));}if(_[_0x60dd('0x12f')](_0x81a948)){var _0x49e61d=this;_0x81a948[_0x60dd('0xac')](function(_0x43366d,_0x2dbe11){_0x49e61d[_0x60dd('0xb')][_0x60dd('0xae')](util[_0x60dd('0x26')]('%s[%s]',_0x25bf67,_0x2dbe11),_0x43366d);});return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x130'),_0x25bf67));}else{return this['channel'][_0x60dd('0xae')](_0x25bf67,_0x81a948);}};AGIVertices['prototype'][_0x60dd('0x131')]=function(_0x3e00b5){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x132'),_0x3e00b5[_0x60dd('0x35')]));if(_0x3e00b5[_0x60dd('0x79')]===0x0){return this['maxRetry'](_0x3e00b5);}_0x3e00b5[_0x60dd('0x79')]-=0x1;if(!this[_0x60dd('0x61')](_0x3e00b5['file_id'])){return this[_0x60dd('0xb')]['error'](_0x3e00b5,_0x60dd('0xd9'));}var _0x342b47=this[_0x60dd('0x1d')][_0x60dd('0x78')](this,_0x3e00b5[_0x60dd('0xd8')]);if(!_0x342b47){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x3e00b5,'no\x20file\x20audio\x20found');}var _0x44fd56=this[_0x60dd('0xb')]['getData'](_0x342b47,_0x3e00b5[_0x60dd('0xda')],_0x3e00b5[_0x60dd('0x133')]);var _0x5dee88=_0x44fd56['result'];if(_0x44fd56[_0x60dd('0x81')]===-0x1){this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x3e00b5,'-1');return _0x44fd56;}else if(_0x44fd56[_0x60dd('0x76')]===_0x60dd('0x7e')){_0x44fd56[_0x60dd('0x81')]=_0x44fd56['result']['length']>0x0?_0x44fd56['result']:'t';}else if(_[_0x60dd('0x41')](_0x44fd56[_0x60dd('0x81')])){_0x44fd56[_0x60dd('0x81')]='#';_0x5dee88='#';}if(!this[_0x60dd('0x61')](_0x3e00b5[_0x60dd('0xa9')])){this['channel'][_0x60dd('0x88')](_0x60dd('0xaa'));}else{var _0x305c64=this[_0x60dd('0xf')][_0x60dd('0x78')](this,_0x3e00b5[_0x60dd('0xa9')]);if(!_0x305c64){return this['channel'][_0x60dd('0x28')](_0x3e00b5,_0x60dd('0xab'));}this[_0x60dd('0xb')][_0x60dd('0xae')](_0x305c64,_0x5dee88);}this['createSquareDetailsReport']['sync'](this,_0x3e00b5,_0x5dee88);return _0x44fd56;};AGIVertices[_0x60dd('0xe')][_0x60dd('0x88')]=function(_0x15e8f6){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x15e8f6[_0x60dd('0x35')]));return this['channel']['noop'](_0x15e8f6['output']||_0x15e8f6['label']);};AGIVertices['prototype'][_0x60dd('0x134')]=function(_0x3e0bc9){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x135'),_0x3e0bc9[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x3e0bc9['findBy'])){return this[_0x60dd('0xb')]['error'](_0x3e0bc9,_0x60dd('0x122'));}logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x123'),this[_0x60dd('0xb')]['callerid'],_0x3e0bc9[_0x60dd('0x121')]));var _0x415b74=this[_0x60dd('0x4a')]['sync'](this,_0x3e0bc9['pause_id']);var _0x4bdb61=this['agentPause'][_0x60dd('0x78')](this,_0x3e0bc9['findBy'],_0x415b74);if(_0x4bdb61){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x3e0bc9[_0x60dd('0x121')]));this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')]['callerid'],_0x3e0bc9['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x60dd('0xb')]['callerid'],_0x3e0bc9[_0x60dd('0x121')]));this['channel']['noop'](util[_0x60dd('0x26')](_0x60dd('0x125'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x3e0bc9[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x128')};}};AGIVertices[_0x60dd('0xe')][_0x60dd('0x136')]=function(_0x2141d0){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x137'),_0x2141d0['label']));if(!this[_0x60dd('0x61')](_0x2141d0[_0x60dd('0xd8')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2141d0,'no\x20file\x20audio\x20selected');}var _0x3eca34=this['getSound']['sync'](this,_0x2141d0['file_id']);if(!_0x3eca34){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x2141d0,_0x60dd('0x138'));}var _0x2c7fc4=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x139'),[_0x3eca34,_0x2141d0['opts']]);if(_0x2c7fc4[_0x60dd('0x81')]===-0x1){return _0x2c7fc4;}return this[_0x60dd('0xb')]['noop'](util['format'](_0x60dd('0x8c'),'PLAYBACK',_0x3eca34));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x13a')]=function(_0xc3c0f1){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x13b'),_0xc3c0f1[_0x60dd('0x35')]));if(!this['isConfigured'](_0xc3c0f1[_0x60dd('0x13c')])){return this['channel']['error'](_0xc3c0f1,'no\x20queue\x20selected');}var _0x573412='';var _0x2ffbd5=parseInt(_0xc3c0f1[_0x60dd('0x13c')],0xa);if(isNaN(_0x2ffbd5)){_0x573412=_0xc3c0f1[_0x60dd('0x13c')];}else{_0x573412=this['getVoiceQueue'][_0x60dd('0x78')](this,_0xc3c0f1[_0x60dd('0x13c')]);if(!_0x573412){return this[_0x60dd('0xb')]['error'](_0xc3c0f1,'no\x20queue\x20found');}}var _0x258e81='';if(this['isConfigured'](_0xc3c0f1['file_id'])){var _0x49cf44=this['getSound'][_0x60dd('0x78')](this,_0xc3c0f1[_0x60dd('0xd8')]);if(_0x49cf44){_0x258e81=_0x49cf44;}}this[_0x60dd('0x34')]['sync'](this,_0xc3c0f1,_0x573412);if(_0xc3c0f1[_0x60dd('0xb6')]['indexOf']('x')<0x0){_0xc3c0f1[_0x60dd('0xb6')]+='x';}if(_0xc3c0f1['opts'][_0x60dd('0x13d')]('X')<0x0){_0xc3c0f1['opts']+='X';}this['channel'][_0x60dd('0xae')](_0x60dd('0x13e'),_0x573412?_0x573412[_0x60dd('0x13f')]():'');var _0x39fe78=this[_0x60dd('0xb')][_0x60dd('0x52')](_0x60dd('0x140'),[_0x573412,_0xc3c0f1[_0x60dd('0xb6')],_0xc3c0f1['url'],_0x258e81,_0xc3c0f1['timeout'],_0xc3c0f1[_0x60dd('0x7')],_0xc3c0f1[_0x60dd('0x141')],_0xc3c0f1[_0x60dd('0x142')],'',_0xc3c0f1['position']]);if(_0x39fe78['result']===-0x1){return _0x39fe78;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x8c'),_0x60dd('0x140'),_0x573412));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x143')]=function(_0x5abf54){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x5abf54[_0x60dd('0x35')]));var _0xc8f6c3=_0x5abf54[_0x60dd('0x144')]||_0x60dd('0xf7');var _0x3118a8=util['format'](_0x60dd('0x145'),this['channel'][_0x60dd('0x3a')],rs[_0x60dd('0xe2')](0x5));var _0x479659=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x3118a8,_0xc8f6c3);var _0x541e26=util[_0x60dd('0x26')](_0x60dd('0xf8'),FILES_PATH,_0x3118a8);this[_0x60dd('0x39')][_0x60dd('0x78')](this,_0x5abf54,_0x3118a8,_0x479659);this[_0x60dd('0xb')][_0x60dd('0xae')]('RECORDING_SAVENAME',_0x3118a8);logger[_0x60dd('0x2a')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x541e26,_0xc8f6c3,_0x5abf54[_0x60dd('0x146')],_0x5abf54[_0x60dd('0x7e')]);return this[_0x60dd('0xb')][_0x60dd('0x104')](_0x541e26,_0xc8f6c3,_0x5abf54[_0x60dd('0x146')],_0x5abf54[_0x60dd('0x7e')],undefined,!![]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x147')]=function(_0x577eb2){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x148'),_0x577eb2[_0x60dd('0x35')]));return this['channel'][_0x60dd('0x149')](_0x577eb2[_0x60dd('0x14a')][_0x60dd('0x54')](/\s+/g,''),_0x577eb2[_0x60dd('0x146')]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x14b')]=function(_0x3c6dfe){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x14c'),_0x3c6dfe[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x14d')](_0x3c6dfe[_0x60dd('0x14e')][_0x60dd('0x54')](/\s+/g,''),_0x3c6dfe[_0x60dd('0x146')]);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x14f')]=function(_0x5a206a){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x5a206a[_0x60dd('0x35')]));return this[_0x60dd('0xb')][_0x60dd('0x150')](_0x5a206a[_0x60dd('0x56')],_0x5a206a['escape_digits']);};AGIVertices['prototype'][_0x60dd('0x151')]=function(_0xadce6b){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x152'),_0xadce6b[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0xadce6b[_0x60dd('0x153')])){return this[_0x60dd('0xb')][_0x60dd('0x88')]('no\x20mail\x20account\x20configured');}var _0x53b5bd=this['getMailAccount'][_0x60dd('0x78')](this,_0xadce6b[_0x60dd('0x153')]);if(!_0x53b5bd||!_0x53b5bd['Smtp']){return this[_0x60dd('0xb')]['error'](_0xadce6b,_0x60dd('0x154'));}var _0xb62f2={'from':util[_0x60dd('0x26')]('\x22%s\x22\x20<%s>',_0x53b5bd[_0x60dd('0x12')],_0x53b5bd[_0x60dd('0x155')]||_0x53b5bd[_0x60dd('0x156')]['user']),'to':_0xadce6b['to']||'','cc':_0xadce6b['cc']||'','bcc':_0xadce6b[_0x60dd('0x157')]||'','subject':_0xadce6b[_0x60dd('0x158')],'html':_0xadce6b[_0x60dd('0x56')],'text':_0xadce6b['text']};var _0x4eed3a={'tls':{'rejectUnauthorized':![]}};if(_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x159')]){_0x4eed3a[_0x60dd('0x159')]=_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x159')];}else{_0x4eed3a[_0x60dd('0x15a')]=_0x53b5bd['Smtp'][_0x60dd('0x15a')];_0x4eed3a[_0x60dd('0x15b')]=_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x15b')];_0x4eed3a[_0x60dd('0x15c')]=_0x53b5bd['Smtp'][_0x60dd('0x15c')];}if(_0x53b5bd['Smtp'][_0x60dd('0x15d')]){_0x4eed3a['auth']={'user':_0x53b5bd[_0x60dd('0x156')]['user'],'pass':_0x53b5bd[_0x60dd('0x156')][_0x60dd('0x15e')]};}if(this[_0x60dd('0x61')](_0xadce6b['template_id'])){}logger[_0x60dd('0xb1')]('sendMail\x20message',JSON[_0x60dd('0xdd')](_0xb62f2));this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0xadce6b,_0xadce6b[_0x60dd('0x153')]);this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x15f'),_0x53b5bd[_0x60dd('0x12')]));this[_0x60dd('0x22')][_0x60dd('0x78')](this,_0x4eed3a,_0xb62f2);return this[_0x60dd('0xb')]['noop'](_0x60dd('0x160'));};AGIVertices['prototype'][_0x60dd('0x161')]=function(_0x5bdae0){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x162'),_0x5bdae0[_0x60dd('0x35')]));return this[_0x60dd('0xb')]['noop'](_0x60dd('0x163'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x164')]=function(_0x16cce7){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x165'),_0x16cce7[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x16cce7[_0x60dd('0x166')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0x167'));}var _0x224deb=this[_0x60dd('0x31')][_0x60dd('0x78')](this,_0x16cce7[_0x60dd('0x166')]);if(!_0x224deb){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x16cce7,'no\x20sms\x20account\x20found');}var _0xc69546={'body':_0x16cce7[_0x60dd('0x168')],'phone':_0x16cce7['to']||'','SmsAccountId':_0x224deb['id']};logger[_0x60dd('0xb1')]('sendSMS\x20message',JSON[_0x60dd('0xdd')](_0xc69546));this[_0x60dd('0x34')]['sync'](this,_0x16cce7,_0x16cce7[_0x60dd('0x166')]);this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x169'),_0x224deb[_0x60dd('0x12')]));this[_0x60dd('0x33')]['sync'](this,_0xc69546);return this[_0x60dd('0xb')]['noop'](_0x60dd('0x16a'));};AGIVertices['prototype']['set']=function(_0x3c6579){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x16b'),_0x3c6579[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x3c6579[_0x60dd('0xa9')])){return this['channel']['error'](_0x3c6579,_0x60dd('0x16c'));}var _0x40cf43=this['getVariable'][_0x60dd('0x78')](this,_0x3c6579[_0x60dd('0xa9')]);if(!_0x40cf43){return this['channel']['error'](_0x3c6579,_0x60dd('0xab'));}return this[_0x60dd('0xb')][_0x60dd('0xae')](_0x40cf43,_0x3c6579['variable_value']);};AGIVertices[_0x60dd('0xe')][_0x60dd('0x16d')]=function(_0xba4977){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20START\x20(%s)\x20block',_0xba4977[_0x60dd('0x35')]));this['channel']['noop'](_0x60dd('0x16e'));if(_0xba4977[_0x60dd('0x7c')]==='yes'){this[_0x60dd('0xb')][_0x60dd('0x88')]('Answer');return this[_0x60dd('0xb')][_0x60dd('0x7c')]();}return this['channel'][_0x60dd('0x88')](_0x60dd('0x16f'));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x170')]=function(_0x1c53b8){logger[_0x60dd('0x2a')](util['format'](_0x60dd('0x171'),_0x1c53b8[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x1c53b8['project_id'])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x1c53b8,_0x60dd('0x172'));}var _0x25f245=this[_0x60dd('0x15')][_0x60dd('0x78')](this,_0x1c53b8[_0x60dd('0x173')]);if(!this[_0x60dd('0x61')](_0x25f245)){return this[_0x60dd('0xb')]['error'](_0x1c53b8,util['format'](_0x60dd('0x174'),_0x1c53b8[_0x60dd('0x173')]));}if(_0x25f245===this['channel'][_0x60dd('0x37')]){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x1c53b8,_0x60dd('0x175'));}this[_0x60dd('0x34')][_0x60dd('0x78')](this,_0x1c53b8,_0x25f245);var _0x31595f=this[_0x60dd('0xb')]['exec'](_0x60dd('0x176'),util[_0x60dd('0x26')](_0x60dd('0x177'),config[_0x60dd('0x7')][_0x60dd('0x15a')]||'127.0.0.1',_0x25f245,this[_0x60dd('0xb')][_0x60dd('0x37')]));if(_0x31595f[_0x60dd('0x81')]===-0x1){return _0x31595f;}return this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x8c'),_0x60dd('0x176'),_0x25f245));};AGIVertices['prototype'][_0x60dd('0x178')]=function(_0x47db33){logger['info'](util[_0x60dd('0x26')](_0x60dd('0x179'),_0x47db33[_0x60dd('0x35')]));var _0x3b042a=this[_0x60dd('0x51')][_0x60dd('0x78')](this,_0x47db33[_0x60dd('0x7b')]);this[_0x60dd('0x34')]['sync'](this,_0x47db33,_0x47db33[_0x60dd('0x7b')]);if(this[_0x60dd('0x61')](_0x47db33[_0x60dd('0xa9')])){var _0x492269=this[_0x60dd('0xf')][_0x60dd('0x78')](this,_0x47db33[_0x60dd('0xa9')]);if(_0x492269){this[_0x60dd('0xb')][_0x60dd('0xae')](_0x492269,_0x3b042a);return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x17a'),_0x47db33[_0x60dd('0x7b')],_0x492269));}}return this[_0x60dd('0xb')]['noop'](util[_0x60dd('0x26')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x47db33['command']));};AGIVertices[_0x60dd('0xe')][_0x60dd('0x17b')]=function(_0x5310de){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x17c'),_0x5310de[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x5310de[_0x60dd('0x56')])){return this['channel'][_0x60dd('0x88')](_0x60dd('0xc7'));}this[_0x60dd('0xb')][_0x60dd('0x88')](util['format'](_0x60dd('0x17d'),_0x5310de['text']));var _0x2aad0c=this['googleTTS'][_0x60dd('0x78')](this,_0x5310de);if(_0x2aad0c){this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x17e'),_0x2aad0c));var _0x165da4=this[_0x60dd('0xb')]['streamFile'](_0x2aad0c);try{fs[_0x60dd('0xcb')](_0x2aad0c+_0x60dd('0x11f'));}catch(_0x4acfd4){logger[_0x60dd('0x28')](_0x4acfd4);}return _0x165da4;}return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x5310de,_0x60dd('0x17f'));};AGIVertices[_0x60dd('0xe')]['unpause']=function(_0x568f15){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x568f15[_0x60dd('0x35')]));if(!this['isConfigured'](_0x568f15[_0x60dd('0x121')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x568f15,_0x60dd('0x122'));}logger['info'](util[_0x60dd('0x26')](_0x60dd('0x123'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));var _0x3b47e5=this['agentUnpause']['sync'](this,_0x568f15[_0x60dd('0x121')]);if(_0x3b47e5){logger[_0x60dd('0x2a')](util['format'](_0x60dd('0x125'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));this['channel'][_0x60dd('0x88')](util[_0x60dd('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));return{'code':0xc8,'result':_0x60dd('0x126')};}else{logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));this[_0x60dd('0xb')][_0x60dd('0x88')](util[_0x60dd('0x26')](_0x60dd('0x127'),this[_0x60dd('0xb')][_0x60dd('0x38')],_0x568f15[_0x60dd('0x121')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x46fe3b){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x180'),_0x46fe3b[_0x60dd('0x35')]));var _0x1366b9=this['channel'][_0x60dd('0x52')]('VOICEMAIL',[_0x46fe3b[_0x60dd('0x181')],_0x46fe3b['options']]);if(_0x1366b9[_0x60dd('0x81')]===-0x1){return _0x1366b9;}return this[_0x60dd('0xb')][_0x60dd('0x88')](util['format']('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x46fe3b[_0x60dd('0x181')]));};AGIVertices[_0x60dd('0xe')]['vswitch']=function(_0x51ca53){logger[_0x60dd('0x2a')](util[_0x60dd('0x26')](_0x60dd('0x182'),_0x51ca53[_0x60dd('0x35')]));if(!this[_0x60dd('0x61')](_0x51ca53[_0x60dd('0xa9')])){return this[_0x60dd('0xb')][_0x60dd('0x28')](_0x51ca53,_0x60dd('0x16c'));}var _0x4a26ba=this['getVariable']['sync'](this,_0x51ca53[_0x60dd('0xa9')]);if(!_0x4a26ba){return this[_0x60dd('0xb')]['error'](_0x51ca53,_0x60dd('0xab'));}var _0x4b1875=this[_0x60dd('0xb')][_0x60dd('0xf')](_0x4a26ba);return{'code':0xc8,'result':_0x4b1875[_0x60dd('0x76')]?_0x4b1875[_0x60dd('0x76')]:'-'};};String['prototype'][_0x60dd('0x75')]=function(_0x13eb4b,_0xc697ae){return this[_0x60dd('0x74')](_0x13eb4b)[_0x60dd('0x183')](_0xc697ae);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 95d34eb..397cf30 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 _0x4bc3=['syncHangup','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','channels','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','info','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','acwTimeout','finally','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]'];(function(_0x452bbf,_0x1fdeb4){var _0x296310=function(_0x23e0b4){while(--_0x23e0b4){_0x452bbf['push'](_0x452bbf['shift']());}};_0x296310(++_0x1fdeb4);}(_0x4bc3,0x16e));var _0x34bc=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x4bc3[_0x2adbeb];return _0x5e18a6;};'use strict';var util=require(_0x34bc('0x0'));var _=require(_0x34bc('0x1'));var moment=require('moment');var ami=require(_0x34bc('0x2'));var logger=require(_0x34bc('0x3'))('acw');var RpcUser=require(_0x34bc('0x4'));var RpcVoiceAgentReport=require(_0x34bc('0x5'));function Acw(_0x3ce1c3){this[_0x34bc('0x6')]=_0x3ce1c3[_0x34bc('0x6')];this[_0x34bc('0x7')]=_0x3ce1c3[_0x34bc('0x7')];this['timers']=_0x3ce1c3[_0x34bc('0x8')];this['channels']={};ami['on']('agentconnect',this[_0x34bc('0x9')][_0x34bc('0xa')](this));ami['on'](_0x34bc('0xb'),this[_0x34bc('0xc')][_0x34bc('0xa')](this));ami['on'](_0x34bc('0xd'),this['syncHangup']['bind'](this));ami['on'](_0x34bc('0xe'),this[_0x34bc('0xf')][_0x34bc('0xa')](this));ami['on']('attendedtransfer',this[_0x34bc('0x10')]['bind'](this));ami['on'](_0x34bc('0x11'),this[_0x34bc('0x12')][_0x34bc('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0x34bc('0x13')]['bind'](this));}function getDiff(_0x12cf72){var _0x43ff68=moment()[_0x34bc('0x14')](0x0);var _0x5a22a3=moment(_0x12cf72)['milliseconds'](0x0);return _0x43ff68[_0x34bc('0x15')](_0x5a22a3,'seconds');}Acw[_0x34bc('0x16')][_0x34bc('0x17')]=function(_0x1da8eb){try{var _0x25da29=this;var _0x2db2dd=this[_0x34bc('0x18')][_0x1da8eb]['interface'];var _0x4fa0ab=this['channels'][_0x1da8eb][_0x34bc('0x19')];var _0x3eaedf=this[_0x34bc('0x6')][_0x4fa0ab];var _0x239e6c=![];var _0x567eee=_0x34bc('0x1a');if(_0x3eaedf[_0x34bc('0x1b')]){if(_0x3eaedf['mandatoryDispositionPause'][_0x34bc('0x1c')]){_0x239e6c=!![];_0x567eee=_0x3eaedf[_0x34bc('0x1d')]['name'];}}ami[_0x34bc('0x1e')]({'action':_0x34bc('0x1f'),'interface':_0x2db2dd,'paused':!![],'reason':_0x567eee})[_0x34bc('0x20')](function(_0x120bd3){if(_0x25da29[_0x34bc('0x7')][_0x2db2dd]){return RpcUser[_0x34bc('0x21')](_0x25da29['agents'][_0x2db2dd]['id'])[_0x34bc('0x20')](function(_0x3c9939){if(_0x3c9939&&!_0x3c9939[_0x34bc('0x22')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x1da8eb,_0x2db2dd,_0x4fa0ab);var _0x358d51=_0x25da29[_0x34bc('0x18')][_0x1da8eb][_0x34bc('0x23')]&&_0x25da29[_0x34bc('0x18')][_0x1da8eb][_0x34bc('0x24')]?_0x25da29[_0x34bc('0x18')][_0x1da8eb][_0x34bc('0x24')]:_0x1da8eb;return RpcUser[_0x34bc('0x25')](_0x25da29[_0x34bc('0x7')][_0x2db2dd],_0x567eee,_0x358d51)[_0x34bc('0x20')](function(_0x2de017){if(!_0x239e6c){_0x25da29[_0x34bc('0x8')][_0x2db2dd]={};logger['info'](_0x34bc('0x26'),_0x1da8eb,_0x25da29['voiceQueues'][_0x4fa0ab]['acwTimeout'],_0x2db2dd,_0x4fa0ab);_0x25da29[_0x34bc('0x8')][_0x2db2dd]['timer']=setTimeout(_0x25da29[_0x34bc('0x27')][_0x34bc('0xa')](_0x25da29,_0x2db2dd),_0x25da29[_0x34bc('0x6')][_0x4fa0ab]['acwTimeout']*0x3e8);_0x25da29[_0x34bc('0x8')][_0x2db2dd][_0x34bc('0x28')]=moment()[_0x34bc('0x29')](_0x34bc('0x2a'));_0x25da29[_0x34bc('0x8')][_0x2db2dd][_0x34bc('0x2b')]=_0x1da8eb;_0x25da29['timers'][_0x2db2dd][_0x34bc('0x19')]=_0x4fa0ab;_0x25da29[_0x34bc('0x8')][_0x2db2dd][_0x34bc('0x2c')]=function(){var _0x407831=getDiff(_0x25da29[_0x34bc('0x8')][_0x2db2dd][_0x34bc('0x28')]);clearTimeout(_0x25da29['timers'][_0x2db2dd][_0x34bc('0x2d')]);_0x25da29['timers'][_0x2db2dd]['timer']=![];RpcVoiceAgentReport[_0x34bc('0x2e')]({'acwtime':_0x407831},_0x25da29['timers'][_0x2db2dd][_0x34bc('0x2b')],_0x2db2dd)[_0x34bc('0x20')](function(_0xb446f4){logger[_0x34bc('0x2f')](_0x34bc('0x30'),_0x1da8eb,_0x407831,_0xb446f4);})[_0x34bc('0x31')](function(_0x2f0ce5){logger['error'](_0x34bc('0x32'),_0x1da8eb,_0x2f0ce5);});delete _0x25da29[_0x34bc('0x8')][_0x2db2dd];};}});}else{logger[_0x34bc('0x2f')](_0x34bc('0x33'),_0x1da8eb,_0x2db2dd,_0x4fa0ab);}});}})[_0x34bc('0x31')](function(_0x5c7e56){logger[_0x34bc('0x34')](_0x34bc('0x26'),_0x1da8eb,_0x25da29[_0x34bc('0x6')][_0x4fa0ab][_0x34bc('0x35')],_0x2db2dd,_0x4fa0ab);})[_0x34bc('0x36')](function(){delete _0x25da29['channels'][_0x1da8eb];});}catch(_0x4ad3c7){logger[_0x34bc('0x34')](_0x34bc('0x37'),_0x4ad3c7[_0x34bc('0x38')]);}};Acw[_0x34bc('0x16')]['stopAcw']=function(_0x3a523c){try{var _0x4477bd=this;if(_0x4477bd[_0x34bc('0x8')][_0x3a523c]){_0x4477bd['timers'][_0x3a523c][_0x34bc('0x2d')]=![];var _0x42d1eb=_0x4477bd[_0x34bc('0x8')][_0x3a523c][_0x34bc('0x2b')];var _0x53a43a=_0x4477bd[_0x34bc('0x8')][_0x3a523c][_0x34bc('0x19')];var _0x25f612=_0x4477bd['voiceQueues'][_0x53a43a][_0x34bc('0x35')];logger[_0x34bc('0x2f')](_0x34bc('0x39'),_0x3a523c);RpcUser[_0x34bc('0x3a')](this[_0x34bc('0x7')][_0x3a523c]);RpcVoiceAgentReport['update']({'acwtime':_0x25f612,'agentacw':!![]},_0x42d1eb,_0x3a523c)[_0x34bc('0x20')](function(_0x281e81){logger[_0x34bc('0x2f')](_0x34bc('0x30'),_0x42d1eb,_0x25f612,_0x281e81);})[_0x34bc('0x31')](function(_0x4bf331){logger[_0x34bc('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x42d1eb,_0x4bf331);});}else{logger[_0x34bc('0x34')](_0x34bc('0x3b'),_0x3a523c);if(_0x4477bd[_0x34bc('0x8')]){logger[_0x34bc('0x2f')]('[ACW][TIMERS]',JSON[_0x34bc('0x3c')](_0x4477bd[_0x34bc('0x8')]));}}}catch(_0x5671fa){logger[_0x34bc('0x34')](_0x34bc('0x3d'),_0x5671fa[_0x34bc('0x38')]);}};Acw['prototype'][_0x34bc('0x9')]=function(_0xbf2127){try{if(this[_0x34bc('0x6')][_0xbf2127[_0x34bc('0x19')]]&&(this[_0x34bc('0x6')][_0xbf2127[_0x34bc('0x19')]][_0x34bc('0x3e')]||this[_0x34bc('0x6')][_0xbf2127[_0x34bc('0x19')]][_0x34bc('0x1b')])){if(this[_0x34bc('0x7')][_0xbf2127['interface']]){this['channels'][_0xbf2127[_0x34bc('0x2b')]]={'queue':_0xbf2127[_0x34bc('0x19')],'interface':_0xbf2127[_0x34bc('0x3f')],'destlinkedid':_0xbf2127[_0x34bc('0x24')]};}}}catch(_0x7d6195){logger[_0x34bc('0x34')]('[ACW][syncAgentConnect]\x20%s',_0x7d6195[_0x34bc('0x38')]);}};Acw['prototype'][_0x34bc('0x13')]=function(_0x2a21b4){try{if(this[_0x34bc('0x6')][_0x2a21b4['queue']]&&(this[_0x34bc('0x6')][_0x2a21b4[_0x34bc('0x19')]][_0x34bc('0x3e')]||this[_0x34bc('0x6')][_0x2a21b4[_0x34bc('0x19')]][_0x34bc('0x1b')])){if(this[_0x34bc('0x7')][_0x2a21b4[_0x34bc('0x3f')]]){this[_0x34bc('0x18')][_0x2a21b4[_0x34bc('0x2b')]]={'queue':_0x2a21b4[_0x34bc('0x19')],'interface':_0x2a21b4[_0x34bc('0x3f')]};}}}catch(_0x48296c){logger['error'](_0x34bc('0x40'),_0x48296c[_0x34bc('0x38')]);}};Acw[_0x34bc('0x16')]['syncHangupRequest']=function(_0x4aafd4){try{if(this[_0x34bc('0x18')][_0x4aafd4[_0x34bc('0x2b')]]&&_[_0x34bc('0x41')](this['channels'][_0x4aafd4[_0x34bc('0x2b')]][_0x34bc('0x23')])){logger['info'](_0x34bc('0x42'),_0x4aafd4['uniqueid']);this[_0x34bc('0x17')](_0x4aafd4['uniqueid']);}else if(this[_0x34bc('0x18')][_0x4aafd4[_0x34bc('0x43')]]&&_[_0x34bc('0x41')](this[_0x34bc('0x18')][_0x4aafd4['linkedid']][_0x34bc('0x23')])){logger[_0x34bc('0x2f')](_0x34bc('0x44'),_0x4aafd4[_0x34bc('0x43')]);this[_0x34bc('0x17')](_0x4aafd4[_0x34bc('0x43')]);}}catch(_0x18eadd){logger[_0x34bc('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x18eadd['message']);}};Acw['prototype'][_0x34bc('0x45')]=function(_0x1ed088){try{if(this['channels'][_0x1ed088[_0x34bc('0x2b')]]&&this[_0x34bc('0x18')][_0x1ed088[_0x34bc('0x2b')]][_0x34bc('0x23')]){logger[_0x34bc('0x2f')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x1ed088['uniqueid']);this['startAcw'](_0x1ed088[_0x34bc('0x2b')]);}else if(this[_0x34bc('0x18')][_0x1ed088[_0x34bc('0x43')]]&&this[_0x34bc('0x18')][_0x1ed088[_0x34bc('0x43')]]['attended']){logger[_0x34bc('0x2f')](_0x34bc('0x46'),_0x1ed088[_0x34bc('0x43')]);this[_0x34bc('0x17')](_0x1ed088['linkedid']);}}catch(_0x1a2cf2){logger[_0x34bc('0x34')](_0x34bc('0x47'),_0x1a2cf2[_0x34bc('0x38')]);}};Acw[_0x34bc('0x16')][_0x34bc('0x10')]=function(_0x21de42){try{if(!_[_0x34bc('0x48')](this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x49')]])){this[_0x34bc('0x17')](_0x21de42[_0x34bc('0x49')]);if(this[_0x34bc('0x18')][_0x21de42['secondtransfereruniqueid']]){this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4a')]][_0x34bc('0x23')]=!![];this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4b')]]=this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4a')]];delete this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4a')]];}}else if(!_[_0x34bc('0x48')](this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4b')]])){this[_0x34bc('0x17')](_0x21de42[_0x34bc('0x4b')]);if(this['channels'][_0x21de42[_0x34bc('0x4c')]]){this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4c')]][_0x34bc('0x23')]=!![];this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x49')]]=this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4c')]];delete this[_0x34bc('0x18')][_0x21de42[_0x34bc('0x4c')]];}}}catch(_0x5ba13a){logger[_0x34bc('0x34')](_0x34bc('0x4d'),_0x5ba13a[_0x34bc('0x38')]);}};Acw['prototype'][_0x34bc('0x12')]=function(_0x295420){try{if(this[_0x34bc('0x18')][_0x295420[_0x34bc('0x4e')]]){logger['info'](_0x34bc('0x4f'),JSON[_0x34bc('0x3c')](_0x295420[_0x34bc('0x4e')]));this[_0x34bc('0x17')](_0x295420[_0x34bc('0x4e')]);}else if(this[_0x34bc('0x18')][_0x295420[_0x34bc('0x50')]]){logger[_0x34bc('0x2f')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x295420[_0x34bc('0x50')]));this[_0x34bc('0x17')](_0x295420[_0x34bc('0x50')]);}}catch(_0x1aad17){logger[_0x34bc('0x34')](_0x34bc('0x51'),_0x1aad17[_0x34bc('0x38')]);}};Acw[_0x34bc('0x16')][_0x34bc('0xf')]=function(_0x3b1eb9){try{if(this[_0x34bc('0x6')][_0x3b1eb9[_0x34bc('0x19')]]&&this[_0x34bc('0x6')][_0x3b1eb9[_0x34bc('0x19')]]['autopause']===_0x34bc('0x52')){if(this[_0x34bc('0x7')][_0x3b1eb9[_0x34bc('0x3f')]]){logger['info'](_0x34bc('0x53'),_0x3b1eb9[_0x34bc('0x2b')],_0x3b1eb9[_0x34bc('0x3f')],_0x3b1eb9[_0x34bc('0x19')]);return RpcUser['savePause'](this[_0x34bc('0x7')][_0x3b1eb9[_0x34bc('0x3f')]],_0x34bc('0x54'),_0x3b1eb9[_0x34bc('0x2b')]);}}}catch(_0x422537){logger['error'](_0x34bc('0x55'),_0x422537[_0x34bc('0x38')]);}};module[_0x34bc('0x56')]=Acw; \ No newline at end of file +var _0xf2ca=['[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','bind','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','channels','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','lastPauseAt','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','uniqueid','[TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','message','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid'];(function(_0x36888d,_0x22988e){var _0x14f524=function(_0x5cdbfe){while(--_0x5cdbfe){_0x36888d['push'](_0x36888d['shift']());}};_0x14f524(++_0x22988e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0xf2ca[_0xf8886b];return _0x321bd5;};'use strict';var util=require(_0xaf2c('0x0'));var _=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var ami=require('../ami');var logger=require(_0xaf2c('0x3'))(_0xaf2c('0x4'));var RpcUser=require(_0xaf2c('0x5'));var RpcVoiceAgentReport=require(_0xaf2c('0x6'));function Acw(_0x3a724c){this[_0xaf2c('0x7')]=_0x3a724c['voiceQueues'];this[_0xaf2c('0x8')]=_0x3a724c[_0xaf2c('0x8')];this[_0xaf2c('0x9')]=_0x3a724c[_0xaf2c('0x9')];this['channels']={};ami['on'](_0xaf2c('0xa'),this[_0xaf2c('0xb')]['bind'](this));ami['on'](_0xaf2c('0xc'),this['syncHangupRequest'][_0xaf2c('0xd')](this));ami['on']('hangup',this[_0xaf2c('0xe')][_0xaf2c('0xd')](this));ami['on'](_0xaf2c('0xf'),this[_0xaf2c('0x10')]['bind'](this));ami['on']('attendedtransfer',this[_0xaf2c('0x11')][_0xaf2c('0xd')](this));ami['on'](_0xaf2c('0x12'),this[_0xaf2c('0x13')][_0xaf2c('0xd')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xaf2c('0xd')](this));}function getDiff(_0x8eaf9b){var _0x935959=moment()[_0xaf2c('0x14')](0x0);var _0x293ca6=moment(_0x8eaf9b)[_0xaf2c('0x14')](0x0);return _0x935959[_0xaf2c('0x15')](_0x293ca6,_0xaf2c('0x16'));}Acw[_0xaf2c('0x17')][_0xaf2c('0x18')]=function(_0x6ac8e){try{var _0x2b4d13=this;var _0x26bf7b=this[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x1a')];var _0x54c34a=this[_0xaf2c('0x19')][_0x6ac8e]['queue'];var _0x278a28=this[_0xaf2c('0x7')][_0x54c34a];var _0x1d544a=![];var _0x578492=_0xaf2c('0x1b');if(_0x278a28[_0xaf2c('0x1c')]){if(_0x278a28[_0xaf2c('0x1d')][_0xaf2c('0x1e')]){_0x1d544a=!![];_0x578492=_0x278a28[_0xaf2c('0x1d')][_0xaf2c('0x1e')];}}ami['Action']({'action':_0xaf2c('0x1f'),'interface':_0x26bf7b,'paused':!![],'reason':_0x578492})[_0xaf2c('0x20')](function(_0x8ffe13){if(_0x2b4d13[_0xaf2c('0x8')][_0x26bf7b]){return RpcUser[_0xaf2c('0x21')](_0x2b4d13['agents'][_0x26bf7b]['id'])[_0xaf2c('0x20')](function(_0xbf6f62){if(_0xbf6f62&&!_0xbf6f62[_0xaf2c('0x22')]){logger['info']('[%s][START][AGENT:%s][QUEUE:%s]',_0x6ac8e,_0x26bf7b,_0x54c34a);var _0x29cbdf=_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x23')]&&_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e]['destlinkedid']?_0x2b4d13[_0xaf2c('0x19')][_0x6ac8e][_0xaf2c('0x24')]:_0x6ac8e;return RpcUser[_0xaf2c('0x25')](_0x2b4d13[_0xaf2c('0x8')][_0x26bf7b],_0x578492,_0x29cbdf)[_0xaf2c('0x20')](function(_0xff396f){if(!_0x1d544a){_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]={};logger['info'](_0xaf2c('0x26'),_0x6ac8e,_0x2b4d13[_0xaf2c('0x7')][_0x54c34a][_0xaf2c('0x27')],_0x26bf7b,_0x54c34a);_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['timer']=setTimeout(_0x2b4d13[_0xaf2c('0x28')]['bind'](_0x2b4d13,_0x26bf7b),_0x2b4d13[_0xaf2c('0x7')][_0x54c34a][_0xaf2c('0x27')]*0x3e8);_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['lastPauseAt']=moment()[_0xaf2c('0x29')](_0xaf2c('0x2a'));_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['uniqueid']=_0x6ac8e;_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2b')]=_0x54c34a;_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2c')]=function(){var _0x59d858=getDiff(_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b][_0xaf2c('0x2d')]);clearTimeout(_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['timer']);_0x2b4d13['timers'][_0x26bf7b][_0xaf2c('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x59d858},_0x2b4d13[_0xaf2c('0x9')][_0x26bf7b]['uniqueid'],_0x26bf7b)[_0xaf2c('0x20')](function(_0x1e4de2){logger['info'](_0xaf2c('0x2f'),_0x6ac8e,_0x59d858,_0x1e4de2);})[_0xaf2c('0x30')](function(_0x54db57){logger[_0xaf2c('0x31')](_0xaf2c('0x32'),_0x6ac8e,_0x54db57);});delete _0x2b4d13[_0xaf2c('0x9')][_0x26bf7b];};}});}else{logger[_0xaf2c('0x33')](_0xaf2c('0x34'),_0x6ac8e,_0x26bf7b,_0x54c34a);}});}})[_0xaf2c('0x30')](function(_0x5b1a7c){logger[_0xaf2c('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x6ac8e,_0x2b4d13[_0xaf2c('0x7')][_0x54c34a]['acwTimeout'],_0x26bf7b,_0x54c34a);})[_0xaf2c('0x35')](function(){delete _0x2b4d13['channels'][_0x6ac8e];});}catch(_0x2f3d16){logger['error'](_0xaf2c('0x36'),_0x2f3d16['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x28')]=function(_0x1a6929){try{var _0x14ec58=this;if(_0x14ec58[_0xaf2c('0x9')][_0x1a6929]){_0x14ec58['timers'][_0x1a6929]['timer']=![];var _0x6f428d=_0x14ec58[_0xaf2c('0x9')][_0x1a6929][_0xaf2c('0x37')];var _0xa44813=_0x14ec58[_0xaf2c('0x9')][_0x1a6929][_0xaf2c('0x2b')];var _0x573db3=_0x14ec58[_0xaf2c('0x7')][_0xa44813][_0xaf2c('0x27')];logger['info'](_0xaf2c('0x38'),_0x1a6929);RpcUser[_0xaf2c('0x39')](this[_0xaf2c('0x8')][_0x1a6929]);RpcVoiceAgentReport[_0xaf2c('0x3a')]({'acwtime':_0x573db3,'agentacw':!![]},_0x6f428d,_0x1a6929)[_0xaf2c('0x20')](function(_0x1e8eaf){logger[_0xaf2c('0x33')](_0xaf2c('0x2f'),_0x6f428d,_0x573db3,_0x1e8eaf);})[_0xaf2c('0x30')](function(_0x106eb9){logger[_0xaf2c('0x31')](_0xaf2c('0x32'),_0x6f428d,_0x106eb9);});}else{logger[_0xaf2c('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x1a6929);if(_0x14ec58['timers']){logger['info'](_0xaf2c('0x3b'),JSON[_0xaf2c('0x3c')](_0x14ec58[_0xaf2c('0x9')]));}}}catch(_0x381502){logger[_0xaf2c('0x31')](_0xaf2c('0x3d'),_0x381502['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0xb')]=function(_0xc59393){try{if(this['voiceQueues'][_0xc59393['queue']]&&(this[_0xaf2c('0x7')][_0xc59393['queue']][_0xaf2c('0x4')]||this[_0xaf2c('0x7')][_0xc59393[_0xaf2c('0x2b')]][_0xaf2c('0x1c')])){if(this['agents'][_0xc59393[_0xaf2c('0x1a')]]){this['channels'][_0xc59393[_0xaf2c('0x37')]]={'queue':_0xc59393[_0xaf2c('0x2b')],'interface':_0xc59393['interface'],'destlinkedid':_0xc59393[_0xaf2c('0x24')]};}}}catch(_0x4a2317){logger[_0xaf2c('0x31')](_0xaf2c('0x3e'),_0x4a2317[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x40')]=function(_0x98d9f3){try{if(this[_0xaf2c('0x7')][_0x98d9f3[_0xaf2c('0x2b')]]&&(this[_0xaf2c('0x7')][_0x98d9f3['queue']]['acw']||this[_0xaf2c('0x7')][_0x98d9f3['queue']]['mandatoryDisposition'])){if(this['agents'][_0x98d9f3[_0xaf2c('0x1a')]]){this[_0xaf2c('0x19')][_0x98d9f3[_0xaf2c('0x37')]]={'queue':_0x98d9f3[_0xaf2c('0x2b')],'interface':_0x98d9f3['interface']};}}}catch(_0x219ea3){logger['error'](_0xaf2c('0x41'),_0x219ea3['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x42')]=function(_0x2d01b7){try{if(this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x37')]]&&_['isUndefined'](this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x37')]]['attended'])){logger['info'](_0xaf2c('0x43'),_0x2d01b7['uniqueid']);this[_0xaf2c('0x18')](_0x2d01b7[_0xaf2c('0x37')]);}else if(this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x44')]]&&_[_0xaf2c('0x45')](this[_0xaf2c('0x19')][_0x2d01b7[_0xaf2c('0x44')]][_0xaf2c('0x23')])){logger[_0xaf2c('0x33')](_0xaf2c('0x46'),_0x2d01b7[_0xaf2c('0x44')]);this['startAcw'](_0x2d01b7[_0xaf2c('0x44')]);}}catch(_0x57547e){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x57547e['message']);}};Acw[_0xaf2c('0x17')][_0xaf2c('0xe')]=function(_0x551061){try{if(this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x37')]]&&this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x37')]][_0xaf2c('0x23')]){logger[_0xaf2c('0x33')](_0xaf2c('0x47'),_0x551061['uniqueid']);this[_0xaf2c('0x18')](_0x551061[_0xaf2c('0x37')]);}else if(this['channels'][_0x551061[_0xaf2c('0x44')]]&&this[_0xaf2c('0x19')][_0x551061[_0xaf2c('0x44')]][_0xaf2c('0x23')]){logger[_0xaf2c('0x33')](_0xaf2c('0x48'),_0x551061[_0xaf2c('0x44')]);this[_0xaf2c('0x18')](_0x551061[_0xaf2c('0x44')]);}}catch(_0x300254){logger[_0xaf2c('0x31')](_0xaf2c('0x49'),_0x300254[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x11')]=function(_0x2d6677){try{if(!_[_0xaf2c('0x4a')](this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4b')]])){this[_0xaf2c('0x18')](_0x2d6677['transfereeuniqueid']);if(this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]]){this[_0xaf2c('0x19')][_0x2d6677['secondtransfereruniqueid']][_0xaf2c('0x23')]=!![];this['channels'][_0x2d6677[_0xaf2c('0x4d')]]=this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]];delete this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4c')]];}}else if(!_[_0xaf2c('0x4a')](this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4d')]])){this[_0xaf2c('0x18')](_0x2d6677['transfertargetuniqueid']);if(this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]]){this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]][_0xaf2c('0x23')]=!![];this['channels'][_0x2d6677[_0xaf2c('0x4b')]]=this[_0xaf2c('0x19')][_0x2d6677['origtransfereruniqueid']];delete this[_0xaf2c('0x19')][_0x2d6677[_0xaf2c('0x4e')]];}}}catch(_0x4b7070){logger['error'](_0xaf2c('0x4f'),_0x4b7070[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')][_0xaf2c('0x13')]=function(_0x4cc55a){try{if(this[_0xaf2c('0x19')][_0x4cc55a[_0xaf2c('0x50')]]){logger['info'](_0xaf2c('0x51'),JSON['stringify'](_0x4cc55a[_0xaf2c('0x50')]));this[_0xaf2c('0x18')](_0x4cc55a[_0xaf2c('0x50')]);}else if(this[_0xaf2c('0x19')][_0x4cc55a[_0xaf2c('0x52')]]){logger[_0xaf2c('0x33')](_0xaf2c('0x53'),JSON[_0xaf2c('0x3c')](_0x4cc55a[_0xaf2c('0x52')]));this[_0xaf2c('0x18')](_0x4cc55a['transfererlinkedid']);}}catch(_0x79d962){logger[_0xaf2c('0x31')](_0xaf2c('0x54'),_0x79d962[_0xaf2c('0x3f')]);}};Acw[_0xaf2c('0x17')]['syncAgentRingNoAnswer']=function(_0xbfb776){try{if(this[_0xaf2c('0x7')][_0xbfb776[_0xaf2c('0x2b')]]&&this[_0xaf2c('0x7')][_0xbfb776[_0xaf2c('0x2b')]]['autopause']==='all'){if(this[_0xaf2c('0x8')][_0xbfb776[_0xaf2c('0x1a')]]){logger['info'](_0xaf2c('0x55'),_0xbfb776[_0xaf2c('0x37')],_0xbfb776[_0xaf2c('0x1a')],_0xbfb776['queue']);return RpcUser[_0xaf2c('0x25')](this[_0xaf2c('0x8')][_0xbfb776[_0xaf2c('0x1a')]],_0xaf2c('0x56'),_0xbfb776['uniqueid']);}}}catch(_0x32d552){logger[_0xaf2c('0x31')](_0xaf2c('0x57'),_0x32d552[_0xaf2c('0x3f')]);}};module[_0xaf2c('0x58')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 5479d3c..081fe3b 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 _0xa1e9=['actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionQueueSummary','log','asterisk-manager','lodash','../../config/logger','asterisk','port','username','keepConnected','Action','promisify','action','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'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa1e9,0x109));var _0x9a1e=function(_0x414fd2,_0x465216){_0x414fd2=_0x414fd2-0x0;var _0x1bb94f=_0xa1e9[_0x414fd2];return _0x1bb94f;};'use strict';var Manager=require(_0x9a1e('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require('util');var _=require(_0x9a1e('0x1'));var logger=require(_0x9a1e('0x2'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x9a1e('0x3')][_0x9a1e('0x4')],config[_0x9a1e('0x3')]['ip'],config[_0x9a1e('0x3')][_0x9a1e('0x5')],config[_0x9a1e('0x3')]['password'],!![]);ami[_0x9a1e('0x6')]();ami[_0x9a1e('0x7')]=BPromise[_0x9a1e('0x8')](ami[_0x9a1e('0x9')]);function error(_0x67d6c2){logger[_0x9a1e('0xa')](util[_0x9a1e('0xb')](_0x9a1e('0xc'),config[_0x9a1e('0x3')][_0x9a1e('0x5')],config[_0x9a1e('0x3')]['ip'],config[_0x9a1e('0x3')][_0x9a1e('0x4')],util[_0x9a1e('0xd')](_0x67d6c2,![],null)));}function close(){logger[_0x9a1e('0xa')](util[_0x9a1e('0xb')](_0x9a1e('0xe'),config[_0x9a1e('0x3')][_0x9a1e('0x5')],config[_0x9a1e('0x3')]['ip'],config[_0x9a1e('0x3')]['port']));}ami[_0x9a1e('0xf')]=function(){return function(){return ami[_0x9a1e('0x7')]({'action':_0x9a1e('0x10')});};};ami[_0x9a1e('0x11')]=function(){return function(){return ami['Action']({'action':_0x9a1e('0x12')});};};ami[_0x9a1e('0x13')]=function(){return function(){return ami[_0x9a1e('0x7')]({'action':_0x9a1e('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x9a1e('0x7')]({'action':_0x9a1e('0x15')});};};ami[_0x9a1e('0x16')]=function(){return function(){return ami[_0x9a1e('0x7')]({'action':_0x9a1e('0x17')});};};function connect(_0x5445df){logger['info'](util[_0x9a1e('0xb')](_0x9a1e('0x18'),config['asterisk'][_0x9a1e('0x5')],config[_0x9a1e('0x3')]['ip'],config[_0x9a1e('0x3')][_0x9a1e('0x4')]));ami[_0x9a1e('0x19')](_0x9a1e('0xa'),error);ami[_0x9a1e('0x19')](_0x9a1e('0x1a'),close);}ami['on'](_0x9a1e('0x1b'),connect);ami['on']('shutdown',function(_0x34d6e6){logger[_0x9a1e('0x1c')](util[_0x9a1e('0xb')](_0x9a1e('0x1d'),config[_0x9a1e('0x3')]['username'],config[_0x9a1e('0x3')]['ip'],config[_0x9a1e('0x3')][_0x9a1e('0x4')],util[_0x9a1e('0xd')](_0x34d6e6,![],null)));});ami['on'](_0x9a1e('0x1e'),function(_0x4d6a3){logger[_0x9a1e('0x1c')](util[_0x9a1e('0xb')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x9a1e('0x3')][_0x9a1e('0x5')],config[_0x9a1e('0x3')]['ip'],config[_0x9a1e('0x3')][_0x9a1e('0x4')]));return BPromise[_0x9a1e('0x1f')]()[_0x9a1e('0x20')](ami[_0x9a1e('0xf')]())[_0x9a1e('0x20')](ami[_0x9a1e('0x11')]())[_0x9a1e('0x20')](ami['actionSipPeerStatus']())[_0x9a1e('0x20')](ami[_0x9a1e('0x21')]())[_0x9a1e('0x20')](ami[_0x9a1e('0x16')]())['catch'](function(_0xb102f3){console[_0x9a1e('0x22')](_0xb102f3);});});ami[_0x9a1e('0x19')](_0x9a1e('0xa'),error);ami[_0x9a1e('0x19')](_0x9a1e('0x1a'),close);module['exports']=ami; \ No newline at end of file +var _0x65f6=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','once','close','connect','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','catch','log','exports','asterisk-manager','util','lodash','ami','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','error','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','actionSipPeerStatus'];(function(_0xb04564,_0x2e20b7){var _0x529be=function(_0x240266){while(--_0x240266){_0xb04564['push'](_0xb04564['shift']());}};_0x529be(++_0x2e20b7);}(_0x65f6,0x139));var _0x665f=function(_0x19d3f2,_0x20bd43){_0x19d3f2=_0x19d3f2-0x0;var _0x17bfca=_0x65f6[_0x19d3f2];return _0x17bfca;};'use strict';var Manager=require(_0x665f('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require(_0x665f('0x1'));var _=require(_0x665f('0x2'));var logger=require('../../config/logger')(_0x665f('0x3'));var config=require(_0x665f('0x4'));var ami=new Manager(config[_0x665f('0x5')][_0x665f('0x6')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x7')],config['asterisk']['password'],!![]);ami[_0x665f('0x8')]();ami[_0x665f('0x9')]=BPromise[_0x665f('0xa')](ami['action']);function error(_0x1e7090){logger[_0x665f('0xb')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x665f('0x5')][_0x665f('0x7')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x6')],util[_0x665f('0xc')](_0x1e7090,![],null)));}function close(){logger[_0x665f('0xb')](util[_0x665f('0xd')](_0x665f('0xe'),config[_0x665f('0x5')][_0x665f('0x7')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x6')]));}ami[_0x665f('0xf')]=function(){return function(){return ami[_0x665f('0x9')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x665f('0x9')]({'action':'devicestatelist'});};};ami[_0x665f('0x10')]=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0x665f('0x11')]=function(){return function(){return ami[_0x665f('0x9')]({'action':_0x665f('0x12')});};};ami[_0x665f('0x13')]=function(){return function(){return ami[_0x665f('0x9')]({'action':_0x665f('0x14')});};};function connect(_0x3c079a){logger['info'](util[_0x665f('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x665f('0x5')][_0x665f('0x7')],config['asterisk']['ip'],config[_0x665f('0x5')]['port']));ami[_0x665f('0x15')](_0x665f('0xb'),error);ami['once'](_0x665f('0x16'),close);}ami['on'](_0x665f('0x17'),connect);ami['on']('shutdown',function(_0x12586f){logger['info'](util[_0x665f('0xd')](_0x665f('0x18'),config[_0x665f('0x5')][_0x665f('0x7')],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')]['port'],util[_0x665f('0xc')](_0x12586f,![],null)));});ami['on'](_0x665f('0x19'),function(_0x11c17b){logger['info'](util[_0x665f('0xd')](_0x665f('0x1a'),config[_0x665f('0x5')]['username'],config[_0x665f('0x5')]['ip'],config[_0x665f('0x5')][_0x665f('0x6')]));return BPromise[_0x665f('0x1b')]()[_0x665f('0x1c')](ami[_0x665f('0xf')]())[_0x665f('0x1c')](ami[_0x665f('0x1d')]())[_0x665f('0x1c')](ami[_0x665f('0x10')]())[_0x665f('0x1c')](ami[_0x665f('0x11')]())[_0x665f('0x1c')](ami[_0x665f('0x13')]())[_0x665f('0x1e')](function(_0x473a3f){console[_0x665f('0x1f')](_0x473a3f);});});ami['once'](_0x665f('0xb'),error);ami[_0x665f('0x15')](_0x665f('0x16'),close);module[_0x665f('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 3884077..7f7e1eb 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 _0xed9b=['rpc','memberReport','error','message','result','catch','exports','jayson/promise','../../config/logger','Request','request','debug'];(function(_0x216b50,_0x4d2cd3){var _0x158590=function(_0x27cd6c){while(--_0x27cd6c){_0x216b50['push'](_0x216b50['shift']());}};_0x158590(++_0x4d2cd3);}(_0xed9b,0x1e7));var _0xbed9=function(_0x7dbd65,_0x18da49){_0x7dbd65=_0x7dbd65-0x0;var _0x33d551=_0xed9b[_0x7dbd65];return _0x33d551;};'use strict';var jayson=require(_0xbed9('0x0'));var BPromise=require('bluebird');var logger=require(_0xbed9('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xbed9('0x2')]=function(_0x3cca13,_0x3a7103){return new BPromise(function(_0x4aa77b,_0x2fad9f){return client[_0xbed9('0x3')](_0x3cca13,_0x3a7103)['then'](function(_0x4fe24e){logger[_0xbed9('0x4')](_0xbed9('0x5'),_0xbed9('0x6'),_0x3cca13,_0x3a7103,_0x4fe24e);if(_0x4fe24e[_0xbed9('0x7')]){logger[_0xbed9('0x7')]('rpc',_0xbed9('0x6'),_0x3cca13,_0x4fe24e[_0xbed9('0x7')][_0xbed9('0x8')],_0x3a7103);return _0x2fad9f(_0x4fe24e[_0xbed9('0x7')]['message']);}else{return _0x4aa77b(_0x4fe24e[_0xbed9('0x9')]);}})[_0xbed9('0xa')](function(_0x2e5134){logger[_0xbed9('0x7')](_0xbed9('0x5'),_0xbed9('0x6'),_0x3cca13,_0x2e5134,_0x3a7103);return _0x2fad9f(_0x2e5134);});});};module[_0xbed9('0xb')]=client; \ No newline at end of file +var _0xd705=['exports','jayson/promise','bluebird','client','http','request','then','debug','error','rpc','memberReport','message'];(function(_0x1a1692,_0x737fbf){var _0x4703db=function(_0x3e37ee){while(--_0x3e37ee){_0x1a1692['push'](_0x1a1692['shift']());}};_0x4703db(++_0x737fbf);}(_0xd705,0x145));var _0x5d70=function(_0x281b60,_0x3e312d){_0x281b60=_0x281b60-0x0;var _0x24c49c=_0xd705[_0x281b60];return _0x24c49c;};'use strict';var jayson=require(_0x5d70('0x0'));var BPromise=require(_0x5d70('0x1'));var logger=require('../../config/logger')('ami');var client=jayson[_0x5d70('0x2')][_0x5d70('0x3')]({'port':0x2329});client['Request']=function(_0x476568,_0x5df7c5){return new BPromise(function(_0x47d6ab,_0x5dcfb7){return client[_0x5d70('0x4')](_0x476568,_0x5df7c5)[_0x5d70('0x5')](function(_0x4fca06){logger[_0x5d70('0x6')]('rpc','memberReport',_0x476568,_0x5df7c5,_0x4fca06);if(_0x4fca06[_0x5d70('0x7')]){logger['error'](_0x5d70('0x8'),_0x5d70('0x9'),_0x476568,_0x4fca06[_0x5d70('0x7')][_0x5d70('0xa')],_0x5df7c5);return _0x5dcfb7(_0x4fca06[_0x5d70('0x7')]['message']);}else{return _0x47d6ab(_0x4fca06['result']);}})['catch'](function(_0x29f475){logger[_0x5d70('0x7')](_0x5d70('0x8'),_0x5d70('0x9'),_0x476568,_0x29f475,_0x5df7c5);return _0x5dcfb7(_0x29f475);});});};module[_0x5d70('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 4a09eb5..94cd14e 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 _0x6873=['ListId','UserId','CampaignId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','moment','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId'];(function(_0x12c838,_0x4f59b7){var _0x43dab0=function(_0x34c7f8){while(--_0x34c7f8){_0x12c838['push'](_0x12c838['shift']());}};_0x43dab0(++_0x4f59b7);}(_0x6873,0xac));var _0x3687=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0x6873[_0x2abaae];return _0x5b5745;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x3687('0x0'));function checkNameSurname(_0x15bdd3,_0x372ae1,_0x377799){var _0x3be8a1='';if(!_['isNil'](_0x372ae1)&&_0x3687('0x1')===typeof _0x372ae1){_0x3be8a1+=_0x372ae1;}if(!_['isNil'](_0x377799)&&_0x3687('0x1')===typeof _0x377799){_0x3be8a1+='\x20'+_0x377799;}if(_0x3be8a1!==''){return _0x3be8a1;}return _0x15bdd3;}function Action(_0x2a4f40,_0x4ecd9e,_0x3ff2e3){this[_0x3687('0x2')]=_0x2a4f40;this[_0x3687('0x3')]=_0x3ff2e3||undefined;this[_0x3687('0x4')]=checkNameSurname(_0x4ecd9e[_0x3687('0x5')][_0x3687('0x6')],_0x4ecd9e[_0x3687('0x5')][_0x3687('0x7')],_0x4ecd9e[_0x3687('0x5')]['lastName']);this[_0x3687('0x8')]=_0x4ecd9e[_0x3687('0x5')]['phone'];this[_0x3687('0x9')]=_0x2a4f40[_0x3687('0x4')];this[_0x3687('0xa')]=_0x4ecd9e[_0x3687('0xa')]||![];this[_0x3687('0xb')]=_0x2a4f40['type'];this[_0x3687('0xc')]=_0x2a4f40[_0x3687('0xc')]||0x3;this['scheduledat']=_0x4ecd9e[_0x3687('0xd')];this[_0x3687('0xe')]=_0x4ecd9e[_0x3687('0xe')];this[_0x3687('0xf')]=_0x4ecd9e[_0x3687('0xf')];this[_0x3687('0x10')]=_0x4ecd9e[_0x3687('0x10')];this[_0x3687('0x11')]=_0x4ecd9e[_0x3687('0x11')];this['ListId']=_0x4ecd9e[_0x3687('0x12')];this[_0x3687('0x13')]=_0x4ecd9e[_0x3687('0x13')];this['VoiceQueueId']=_0x4ecd9e['VoiceQueueId'];this[_0x3687('0x14')]=_0x4ecd9e[_0x3687('0x14')];this[_0x3687('0x15')]=_0x4ecd9e['id'];this[_0x3687('0x16')]=_0x4ecd9e[_0x3687('0x5')][_0x3687('0x7')]||'';this['starttime']=moment()[_0x3687('0x17')](_0x3687('0x18'));this[_0x3687('0x19')]=_0x4ecd9e[_0x3687('0x19')];this['callbackuniqueid']=_0x4ecd9e[_0x3687('0x1a')];this['callbackat']=_0x4ecd9e[_0x3687('0x1b')];this[_0x3687('0x1c')]=_0x4ecd9e[_0x3687('0x1c')];this[_0x3687('0x1d')]='';this[_0x3687('0x1e')]='';}Action[_0x3687('0x1f')][_0x3687('0x20')]=function(){return util[_0x3687('0x17')](_0x3687('0x21'),this[_0x3687('0x4')],this[_0x3687('0x2')][_0x3687('0x22')]>0x0?this[_0x3687('0x8')][_0x3687('0x23')](this['voiceQueue']['dialCutDigit']):this['number']);};Action[_0x3687('0x1f')][_0x3687('0x24')]=function(){return this[_0x3687('0x9')];};module[_0x3687('0x25')]=Action; \ No newline at end of file +var _0x1d7e=['getQueue','exports','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring'];(function(_0x11a3bb,_0x5c5466){var _0x3c3e36=function(_0x59f16f){while(--_0x59f16f){_0x11a3bb['push'](_0x11a3bb['shift']());}};_0x3c3e36(++_0x5c5466);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x1d7e[_0x9df060];return _0x338dfe;};'use strict';var util=require('util');var _=require(_0xe1d7('0x0'));var moment=require(_0xe1d7('0x1'));function checkNameSurname(_0x41bac0,_0x47c24f,_0x141274){var _0x4c39bd='';if(!_[_0xe1d7('0x2')](_0x47c24f)&&_0xe1d7('0x3')===typeof _0x47c24f){_0x4c39bd+=_0x47c24f;}if(!_[_0xe1d7('0x2')](_0x141274)&&_0xe1d7('0x3')===typeof _0x141274){_0x4c39bd+='\x20'+_0x141274;}if(_0x4c39bd!==''){return _0x4c39bd;}return _0x41bac0;}function Action(_0x1c8ace,_0x4058fe,_0x252026){this[_0xe1d7('0x4')]=_0x1c8ace;this[_0xe1d7('0x5')]=_0x252026||undefined;this[_0xe1d7('0x6')]=checkNameSurname(_0x4058fe[_0xe1d7('0x7')]['phone'],_0x4058fe[_0xe1d7('0x7')][_0xe1d7('0x8')],_0x4058fe['Contact'][_0xe1d7('0x9')]);this['number']=_0x4058fe[_0xe1d7('0x7')]['phone'];this[_0xe1d7('0xa')]=_0x1c8ace['name'];this['active']=_0x4058fe[_0xe1d7('0xb')]||![];this[_0xe1d7('0xc')]=_0x1c8ace[_0xe1d7('0xc')];this[_0xe1d7('0xd')]=_0x1c8ace[_0xe1d7('0xd')]||0x3;this[_0xe1d7('0xe')]=_0x4058fe[_0xe1d7('0xe')];this[_0xe1d7('0xf')]=_0x4058fe['countbusyretry'];this[_0xe1d7('0x10')]=_0x4058fe[_0xe1d7('0x10')];this[_0xe1d7('0x11')]=_0x4058fe[_0xe1d7('0x11')];this[_0xe1d7('0x12')]=_0x4058fe[_0xe1d7('0x12')];this[_0xe1d7('0x13')]=_0x4058fe['ListId'];this[_0xe1d7('0x14')]=_0x4058fe[_0xe1d7('0x14')];this[_0xe1d7('0x15')]=_0x4058fe['VoiceQueueId'];this[_0xe1d7('0x16')]=_0x4058fe[_0xe1d7('0x16')];this[_0xe1d7('0x17')]=_0x4058fe['id'];this[_0xe1d7('0x18')]=_0x4058fe[_0xe1d7('0x7')][_0xe1d7('0x8')]||'';this[_0xe1d7('0x19')]=moment()[_0xe1d7('0x1a')](_0xe1d7('0x1b'));this[_0xe1d7('0x1c')]=_0x4058fe[_0xe1d7('0x1c')];this[_0xe1d7('0x1d')]=_0x4058fe['callbackuniqueid'];this[_0xe1d7('0x1e')]=_0x4058fe[_0xe1d7('0x1e')];this[_0xe1d7('0x1f')]=_0x4058fe[_0xe1d7('0x1f')];this[_0xe1d7('0x20')]='';this['originatecalleridname']='';}Action[_0xe1d7('0x21')][_0xe1d7('0x22')]=function(){return util[_0xe1d7('0x1a')](_0xe1d7('0x23'),this[_0xe1d7('0x6')],this['voiceQueue'][_0xe1d7('0x24')]>0x0?this[_0xe1d7('0x25')][_0xe1d7('0x26')](this[_0xe1d7('0x4')][_0xe1d7('0x24')]):this[_0xe1d7('0x25')]);};Action[_0xe1d7('0x21')][_0xe1d7('0x27')]=function(){return this[_0xe1d7('0xa')];};module[_0xe1d7('0x28')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 05a943d..39ae3de 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 _0x8377=['name','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname'];(function(_0x10c562,_0x327852){var _0x421c11=function(_0xd44c50){while(--_0xd44c50){_0x10c562['push'](_0x10c562['shift']());}};_0x421c11(++_0x327852);}(_0x8377,0xb4));var _0x7837=function(_0x275ae6,_0x51d1cb){_0x275ae6=_0x275ae6-0x0;var _0x4e6bd3=_0x8377[_0x275ae6];return _0x4e6bd3;};'use strict';var util=require(_0x7837('0x0'));var _=require(_0x7837('0x1'));var moment=require('moment');function getSeconds(_0x167954,_0x2827f0){var _0x5c5ea8=moment(_0x167954)[_0x7837('0x2')](0x0);var _0x4df17b=moment(_0x2827f0)[_0x7837('0x2')](0x0);return _0x5c5ea8['diff'](_0x4df17b,'seconds');}function AgentComplete(_0x82f85c,_0x335ddb){this[_0x7837('0x3')]=0x4;this[_0x7837('0x4')]=_0x7837('0x5');this[_0x7837('0x6')]=_0x82f85c[_0x7837('0x6')];this['type']=_0x82f85c[_0x7837('0x7')];this['campaigntype']=_0x82f85c[_0x7837('0x7')]===_0x7837('0x8')?'queue':_0x82f85c[_0x7837('0x7')];this['countbusyretry']=_0x82f85c[_0x7837('0x9')];this[_0x7837('0xa')]=_0x82f85c[_0x7837('0xa')];this[_0x7837('0xb')]=_0x82f85c['countnoanswerretry'];this[_0x7837('0xc')]=_0x82f85c[_0x7837('0x9')]+_0x82f85c[_0x7837('0xa')]+_0x82f85c[_0x7837('0xb')];this[_0x7837('0xd')]=_0x335ddb[_0x7837('0xd')];this[_0x7837('0xe')]=_0x82f85c[_0x7837('0xf')];this['calleridnum']=_0x82f85c['number'];this[_0x7837('0x10')]=_0x82f85c['starttime'];this[_0x7837('0x11')]=_0x82f85c[_0x7837('0x11')];this[_0x7837('0x12')]=_0x82f85c[_0x7837('0x12')];this[_0x7837('0x13')]=moment()['format'](_0x7837('0x14'));this[_0x7837('0x15')]=getSeconds(_0x82f85c[_0x7837('0x11')],_0x82f85c['starttime']);this[_0x7837('0x16')]=getSeconds(_0x82f85c[_0x7837('0x12')],_0x82f85c[_0x7837('0x11')]);this[_0x7837('0x17')]=getSeconds(this['endtime'],_0x82f85c[_0x7837('0x12')]);this[_0x7837('0x18')]=_0x335ddb['queue'];this[_0x7837('0x19')]=_0x335ddb[_0x7837('0x19')];this[_0x7837('0x1a')]=_0x335ddb[_0x7837('0x1a')];this['callback']=_0x82f85c[_0x7837('0x1b')];this[_0x7837('0x1c')]=_0x82f85c[_0x7837('0x1c')];this[_0x7837('0x1d')]=_0x82f85c['callbackat'];this['recallme']=_0x82f85c[_0x7837('0x1e')];this[_0x7837('0x1f')]=_0x82f85c[_0x7837('0x1f')];this[_0x7837('0x20')]=_0x82f85c[_0x7837('0x20')];this[_0x7837('0x21')]=_0x82f85c[_0x7837('0x21')];this['VoiceQueueId']=_0x82f85c[_0x7837('0x22')];this[_0x7837('0x23')]=_0x82f85c['CampaignId'];this[_0x7837('0x24')]=_0x82f85c[_0x7837('0x24')]||'';this[_0x7837('0x25')]=_0x82f85c[_0x7837('0x25')]||'';}module[_0x7837('0x26')]=AgentComplete; \ No newline at end of file +var _0x94b2=['outbound','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','queue','membername','reason','callback','callbackuniqueid','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x94b2,0x1e4));var _0x294b=function(_0x170ec6,_0x2ade62){_0x170ec6=_0x170ec6-0x0;var _0x47c7e2=_0x94b2[_0x170ec6];return _0x47c7e2;};'use strict';var util=require(_0x294b('0x0'));var _=require(_0x294b('0x1'));var moment=require('moment');function getSeconds(_0x1c6721,_0xc5edaf){var _0x4bb1e0=moment(_0x1c6721)[_0x294b('0x2')](0x0);var _0xce5476=moment(_0xc5edaf)['milliseconds'](0x0);return _0x4bb1e0[_0x294b('0x3')](_0xce5476,_0x294b('0x4'));}function AgentComplete(_0x87e565,_0x5661d5){this[_0x294b('0x5')]=0x4;this[_0x294b('0x6')]=_0x294b('0x7');this[_0x294b('0x8')]=_0x87e565[_0x294b('0x8')];this[_0x294b('0x9')]=_0x87e565['type'];this['campaigntype']=_0x87e565[_0x294b('0x9')]===_0x294b('0xa')?'queue':_0x87e565['type'];this[_0x294b('0xb')]=_0x87e565[_0x294b('0xb')];this['countcongestionretry']=_0x87e565[_0x294b('0xc')];this['countnoanswerretry']=_0x87e565[_0x294b('0xd')];this['countglobal']=_0x87e565[_0x294b('0xb')]+_0x87e565[_0x294b('0xc')]+_0x87e565[_0x294b('0xd')];this['uniqueid']=_0x5661d5[_0x294b('0xe')];this[_0x294b('0xf')]=_0x87e565[_0x294b('0x10')];this['calleridnum']=_0x87e565[_0x294b('0x11')];this[_0x294b('0x12')]=_0x87e565[_0x294b('0x12')];this[_0x294b('0x13')]=_0x87e565[_0x294b('0x13')];this['answertime']=_0x87e565[_0x294b('0x14')];this[_0x294b('0x15')]=moment()[_0x294b('0x16')](_0x294b('0x17'));this['ringtime']=getSeconds(_0x87e565[_0x294b('0x13')],_0x87e565[_0x294b('0x12')]);this[_0x294b('0x18')]=getSeconds(_0x87e565[_0x294b('0x14')],_0x87e565[_0x294b('0x13')]);this['talktime']=getSeconds(this[_0x294b('0x15')],_0x87e565[_0x294b('0x14')]);this['queue']=_0x5661d5[_0x294b('0x19')];this[_0x294b('0x1a')]=_0x5661d5[_0x294b('0x1a')];this[_0x294b('0x1b')]=_0x5661d5[_0x294b('0x1b')];this['callback']=_0x87e565[_0x294b('0x1c')];this[_0x294b('0x1d')]=_0x87e565[_0x294b('0x1d')];this['callbackat']=_0x87e565['callbackat'];this['recallme']=_0x87e565[_0x294b('0x1e')];this['ContactId']=_0x87e565['ContactId'];this['ListId']=_0x87e565[_0x294b('0x1f')];this[_0x294b('0x20')]=_0x87e565[_0x294b('0x20')];this[_0x294b('0x21')]=_0x87e565[_0x294b('0x21')];this[_0x294b('0x22')]=_0x87e565['CampaignId'];this[_0x294b('0x23')]=_0x87e565[_0x294b('0x23')]||'';this['originatecalleridname']=_0x87e565[_0x294b('0x24')]||'';}module[_0x294b('0x25')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index a9aaa70..475e356 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 _0x4975=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x4975,0x86));var _0x5497=function(_0x1e150a,_0x412505){_0x1e150a=_0x1e150a-0x0;var _0x26eb18=_0x4975[_0x1e150a];return _0x26eb18;};'use strict';var util=require(_0x5497('0x0'));var _=require('lodash');var moment=require(_0x5497('0x1'));function getSeconds(_0x3f9e37,_0xfc7927){var _0x349f5f=moment(_0x3f9e37)[_0x5497('0x2')](0x0);var _0x235986=moment(_0xfc7927)[_0x5497('0x2')](0x0);return _0x349f5f[_0x5497('0x3')](_0x235986,_0x5497('0x4'));}function Final(_0x5d5272){this['uniqueid']=_0x5d5272[_0x5497('0x5')];this['scheduledat']=_0x5d5272[_0x5497('0x6')];this[_0x5497('0x7')]=_0x5d5272[_0x5497('0x7')];this['campaigntype']=_0x5d5272[_0x5497('0x7')]==='outbound'?_0x5497('0x8'):_0x5d5272[_0x5497('0x7')];this[_0x5497('0x9')]=_0x5d5272[_0x5497('0x9')];this[_0x5497('0xa')]=_0x5d5272[_0x5497('0xa')];this[_0x5497('0xb')]=_0x5d5272[_0x5497('0xb')];this['countglobal']=_0x5d5272['countbusyretry']+_0x5d5272['countcongestionretry']+_0x5d5272[_0x5497('0xb')];this[_0x5497('0x8')]=_0x5d5272[_0x5497('0x8')];this[_0x5497('0xc')]=_0x5d5272[_0x5497('0xc')];this[_0x5497('0xd')]=_0x5d5272[_0x5497('0xd')];this[_0x5497('0xe')]=_0x5d5272[_0x5497('0xe')];this[_0x5497('0xf')]=_0x5d5272['responsetime'];this[_0x5497('0x10')]=_0x5d5272['responsetime'];this[_0x5497('0x11')]=_0x5d5272[_0x5497('0x11')]||0x0;this[_0x5497('0x12')]=_0x5d5272[_0x5497('0x12')]||0x0;this[_0x5497('0x13')]=_0x5d5272[_0x5497('0x13')]||0x0;this[_0x5497('0x14')]=_0x5d5272['callback'];this['callbackuniqueid']=_0x5d5272[_0x5497('0x15')];this[_0x5497('0x16')]=_0x5d5272[_0x5497('0x16')];this['recallme']=_0x5d5272[_0x5497('0x17')];this[_0x5497('0x18')]=_0x5d5272[_0x5497('0x18')];this[_0x5497('0x19')]=_0x5d5272[_0x5497('0x19')];this[_0x5497('0x1a')]=_0x5d5272[_0x5497('0x1a')];this[_0x5497('0x1b')]=_0x5d5272[_0x5497('0x1b')];this[_0x5497('0x1c')]=_0x5d5272[_0x5497('0x1c')];this['originatecalleridnum']=_0x5d5272[_0x5497('0x1d')]||'';this['originatecalleridname']=_0x5d5272[_0x5497('0x1e')]||'';}module[_0x5497('0x1f')]=Final; \ No newline at end of file +var _0x6a0b=['countnoanswerretry','countglobal','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x1caebb,_0x264a79){_0x1caebb=_0x1caebb-0x0;var _0x38c588=_0x6a0b[_0x1caebb];return _0x38c588;};'use strict';var util=require(_0xb6a0('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x138eef,_0x16eb4e){var _0x5762d5=moment(_0x138eef)[_0xb6a0('0x1')](0x0);var _0x3e5b73=moment(_0x16eb4e)[_0xb6a0('0x1')](0x0);return _0x5762d5[_0xb6a0('0x2')](_0x3e5b73,_0xb6a0('0x3'));}function Final(_0x4f77a1){this[_0xb6a0('0x4')]=_0x4f77a1[_0xb6a0('0x4')];this[_0xb6a0('0x5')]=_0x4f77a1[_0xb6a0('0x5')];this[_0xb6a0('0x6')]=_0x4f77a1[_0xb6a0('0x6')];this[_0xb6a0('0x7')]=_0x4f77a1[_0xb6a0('0x6')]===_0xb6a0('0x8')?'queue':_0x4f77a1['type'];this['countbusyretry']=_0x4f77a1['countbusyretry'];this['countcongestionretry']=_0x4f77a1[_0xb6a0('0x9')];this['countnoanswerretry']=_0x4f77a1[_0xb6a0('0xa')];this[_0xb6a0('0xb')]=_0x4f77a1['countbusyretry']+_0x4f77a1[_0xb6a0('0x9')]+_0x4f77a1[_0xb6a0('0xa')];this[_0xb6a0('0xc')]=_0x4f77a1[_0xb6a0('0xc')];this[_0xb6a0('0xd')]=_0x4f77a1[_0xb6a0('0xd')];this[_0xb6a0('0xe')]=_0x4f77a1[_0xb6a0('0xe')];this[_0xb6a0('0xf')]=_0x4f77a1[_0xb6a0('0xf')];this['responsetime']=_0x4f77a1[_0xb6a0('0x10')];this[_0xb6a0('0x11')]=_0x4f77a1[_0xb6a0('0x10')];this[_0xb6a0('0x12')]=_0x4f77a1[_0xb6a0('0x12')]||0x0;this[_0xb6a0('0x13')]=_0x4f77a1[_0xb6a0('0x13')]||0x0;this[_0xb6a0('0x14')]=_0x4f77a1[_0xb6a0('0x14')]||0x0;this['callback']=_0x4f77a1[_0xb6a0('0x15')];this[_0xb6a0('0x16')]=_0x4f77a1[_0xb6a0('0x16')];this['callbackat']=_0x4f77a1[_0xb6a0('0x17')];this[_0xb6a0('0x18')]=_0x4f77a1[_0xb6a0('0x18')];this[_0xb6a0('0x19')]=_0x4f77a1[_0xb6a0('0x19')];this['ListId']=_0x4f77a1['ListId'];this[_0xb6a0('0x1a')]=_0x4f77a1[_0xb6a0('0x1a')];this['VoiceQueueId']=_0x4f77a1[_0xb6a0('0x1b')];this['CampaignId']=_0x4f77a1[_0xb6a0('0x1c')];this[_0xb6a0('0x1d')]=_0x4f77a1[_0xb6a0('0x1d')]||'';this['originatecalleridname']=_0x4f77a1[_0xb6a0('0x1e')]||'';}module[_0xb6a0('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 9998ff6..7bfabe2 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 _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x1eb82d,_0x1e23cb){var _0x2c9502=function(_0x4a3500){while(--_0x4a3500){_0x1eb82d['push'](_0x1eb82d['shift']());}};_0x2c9502(++_0x1e23cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x5156df,_0x13e151){var _0x54b529=function(_0xd3b93a){while(--_0xd3b93a){_0x5156df['push'](_0x5156df['shift']());}};_0x54b529(++_0x13e151);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 8d857a8..1e66fb8 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 _0x0cda=['endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','uniqueid','outbound','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','queue','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x3e191e,_0x537914){var _0x159f06=function(_0x4c4c9d){while(--_0x4c4c9d){_0x3e191e['push'](_0x3e191e['shift']());}};_0x159f06(++_0x537914);}(_0x0cda,0x142));var _0xa0cd=function(_0xb5512f,_0x13d301){_0xb5512f=_0xb5512f-0x0;var _0x404f73=_0x0cda[_0xb5512f];return _0x404f73;};'use strict';var util=require(_0xa0cd('0x0'));var _=require(_0xa0cd('0x1'));var moment=require('moment');function getSeconds(_0x5b1a28,_0x309e4e){var _0x364f7d=moment(_0x5b1a28)[_0xa0cd('0x2')](0x0);var _0x3f8bc7=moment(_0x309e4e)['milliseconds'](0x0);return _0x364f7d[_0xa0cd('0x3')](_0x3f8bc7,'seconds');}function History(_0x1221cd){this[_0xa0cd('0x4')]=_0x1221cd[_0xa0cd('0x4')];this['scheduledat']=_0x1221cd['scheduledat']||undefined;this['type']=_0x1221cd['type'];this['campaigntype']=_0x1221cd['type']===_0xa0cd('0x5')?'queue':_0x1221cd[_0xa0cd('0x6')];this[_0xa0cd('0x7')]=_0x1221cd[_0xa0cd('0x7')];this['countcongestionretry']=_0x1221cd[_0xa0cd('0x8')];this['countnoanswerretry']=_0x1221cd[_0xa0cd('0x9')];this[_0xa0cd('0xa')]=_0x1221cd['countbusyretry']+_0x1221cd[_0xa0cd('0x8')]+_0x1221cd['countnoanswerretry'];this[_0xa0cd('0xb')]=_0x1221cd['queue'];this[_0xa0cd('0xc')]=_0x1221cd[_0xa0cd('0xd')];this[_0xa0cd('0xe')]=_0x1221cd[_0xa0cd('0xf')];this[_0xa0cd('0x10')]=_0x1221cd[_0xa0cd('0x10')];this[_0xa0cd('0x11')]=_0x1221cd[_0xa0cd('0x11')];this[_0xa0cd('0x12')]=_0x1221cd[_0xa0cd('0x11')];this[_0xa0cd('0x13')]=getSeconds(_0x1221cd[_0xa0cd('0x11')],_0x1221cd[_0xa0cd('0x10')]);this[_0xa0cd('0x14')]=0x0;this[_0xa0cd('0x15')]=0x0;this[_0xa0cd('0x16')]=_0x1221cd[_0xa0cd('0x16')];this[_0xa0cd('0x17')]=_0x1221cd[_0xa0cd('0x17')];this[_0xa0cd('0x18')]=_0x1221cd[_0xa0cd('0x18')];this[_0xa0cd('0x19')]=_0x1221cd['recallme'];this[_0xa0cd('0x1a')]=_0x1221cd[_0xa0cd('0x1a')];this[_0xa0cd('0x1b')]=_0x1221cd[_0xa0cd('0x1b')];this[_0xa0cd('0x1c')]=_0x1221cd[_0xa0cd('0x1c')];this['VoiceQueueId']=_0x1221cd[_0xa0cd('0x1d')];this['CampaignId']=_0x1221cd[_0xa0cd('0x1e')];this[_0xa0cd('0x1f')]=_0x1221cd[_0xa0cd('0x1f')]||'';this[_0xa0cd('0x20')]=_0x1221cd['originatecalleridname']||'';}module[_0xa0cd('0x21')]=History; \ No newline at end of file +var _0x1794=['name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname'];(function(_0x5aaa11,_0x467d95){var _0x4c9328=function(_0x320736){while(--_0x320736){_0x5aaa11['push'](_0x5aaa11['shift']());}};_0x4c9328(++_0x467d95);}(_0x1794,0x110));var _0x4179=function(_0x2d17a5,_0x2bbbd7){_0x2d17a5=_0x2d17a5-0x0;var _0x5118b6=_0x1794[_0x2d17a5];return _0x5118b6;};'use strict';var util=require(_0x4179('0x0'));var _=require(_0x4179('0x1'));var moment=require(_0x4179('0x2'));function getSeconds(_0x36aa6c,_0x531ea7){var _0x254b2f=moment(_0x36aa6c)[_0x4179('0x3')](0x0);var _0x4d258f=moment(_0x531ea7)[_0x4179('0x3')](0x0);return _0x254b2f[_0x4179('0x4')](_0x4d258f,_0x4179('0x5'));}function History(_0x459ceb){this['uniqueid']=_0x459ceb[_0x4179('0x6')];this[_0x4179('0x7')]=_0x459ceb[_0x4179('0x7')]||undefined;this[_0x4179('0x8')]=_0x459ceb[_0x4179('0x8')];this['campaigntype']=_0x459ceb[_0x4179('0x8')]===_0x4179('0x9')?_0x4179('0xa'):_0x459ceb[_0x4179('0x8')];this[_0x4179('0xb')]=_0x459ceb[_0x4179('0xb')];this[_0x4179('0xc')]=_0x459ceb[_0x4179('0xc')];this[_0x4179('0xd')]=_0x459ceb[_0x4179('0xd')];this[_0x4179('0xe')]=_0x459ceb[_0x4179('0xb')]+_0x459ceb[_0x4179('0xc')]+_0x459ceb['countnoanswerretry'];this[_0x4179('0xa')]=_0x459ceb[_0x4179('0xa')];this[_0x4179('0xf')]=_0x459ceb[_0x4179('0x10')];this['calleridnum']=_0x459ceb[_0x4179('0x11')];this[_0x4179('0x12')]=_0x459ceb[_0x4179('0x12')];this[_0x4179('0x13')]=_0x459ceb[_0x4179('0x13')];this[_0x4179('0x14')]=_0x459ceb[_0x4179('0x13')];this[_0x4179('0x15')]=getSeconds(_0x459ceb['responsetime'],_0x459ceb[_0x4179('0x12')]);this[_0x4179('0x16')]=0x0;this[_0x4179('0x17')]=0x0;this[_0x4179('0x18')]=_0x459ceb[_0x4179('0x18')];this[_0x4179('0x19')]=_0x459ceb[_0x4179('0x19')];this[_0x4179('0x1a')]=_0x459ceb[_0x4179('0x1a')];this[_0x4179('0x1b')]=_0x459ceb['recallme'];this[_0x4179('0x1c')]=_0x459ceb[_0x4179('0x1c')];this[_0x4179('0x1d')]=_0x459ceb[_0x4179('0x1d')];this[_0x4179('0x1e')]=_0x459ceb['UserId'];this[_0x4179('0x1f')]=_0x459ceb[_0x4179('0x1f')];this['CampaignId']=_0x459ceb[_0x4179('0x20')];this[_0x4179('0x21')]=_0x459ceb[_0x4179('0x21')]||'';this[_0x4179('0x22')]=_0x459ceb[_0x4179('0x22')]||'';}module[_0x4179('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index eb875ed..8d23d84 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 _0x40e2=['dialBusyMaxRetry','reason\x205\x20busy','Congestion','countglobal','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','predictiveIntervalAvailable','predictiveIntervalMinThreshold','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','started\x20in\x20predictive\x20at','recalculate\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','[countReScheduled]\x20','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','redis','localhost','socket.io-emitter','../rpc/cmHopperBlack','./history','./agentComplete','env','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','Error','stringify','milliseconds','diff','seconds','emit','type','strategy','pTalking','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalPauses','originated','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','format','ivr','campaign:ivr:%s','campaign:save','isEmpty','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\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','predictiveIntervalAvgTalktime','isUndefined','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','\x22%s\x22\x20<%s>','error','inspect','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','endtime','starttime','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','isNil','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','catch','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','uniqueid','outboundAnswerCallsDay','statedesc','Machine','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','amd','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','dialQueueProject','cause-txt','Unknow','reason','agent','agiafterat','dialQueueProject2','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','YYYY-MM-DD\x20HH:mm:ss','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','Abandoned','dropreason','CALLEREXIT','actionid','locked','stateinterface','queueBooked','push','pick','paused','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','finally','ContactId','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','content','indexOf','true','command','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','handlePower','power','booked','Queue','method\x20not\x20recognized','launchHandleIvr','loggedIn','checkIfTime','checkDialMethod','[syncQueueSummary]','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','callerid','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','Action','SIP/%s/%s%s','trim','dialCutDigit','substring','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','minutes','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','[syncAgentComplete][createHistory][5]'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x40e2,0x64));var _0x240e=function(_0x25832f,_0x522e68){_0x25832f=_0x25832f-0x0;var _0x3805d6=_0x40e2[_0x25832f];return _0x3805d6;};'use strict';var util=require('util');var _=require(_0x240e('0x0'));var BPromise=require(_0x240e('0x1'));var uuid=require(_0x240e('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x240e('0x3'));var Redis=require(_0x240e('0x4'));var config=require(_0x240e('0x5'));var logger=require(_0x240e('0x6'))(_0x240e('0x7'));var loggerBooked=require(_0x240e('0x6'))('booked');var loggerPredictive=require(_0x240e('0x6'))(_0x240e('0x8'));var loggerPredictiveCalls=require(_0x240e('0x6'))(_0x240e('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x240e('0xa'));var ami=require(_0x240e('0xb'));config['redis']=_[_0x240e('0xc')](config[_0x240e('0xd')],{'host':_0x240e('0xe'),'port':0x18eb});var io=require(_0x240e('0xf'))(new Redis(config[_0x240e('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x240e('0x10'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x240e('0x11'));var Final=require('./final');var AgentComplete=require(_0x240e('0x12'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0x240e('0x13')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0x240e('0x14'),'roundrobin':_0x240e('0x15')};var Sequence=function(){};Sequence[_0x240e('0x16')][_0x240e('0x17')]=function(_0x2e145a){this[_0x240e('0x18')]=this[_0x240e('0x18')]?this[_0x240e('0x18')]['finally'](_0x2e145a):_0x2e145a();};function Dialer(_0xebd0ef,_0x1f91a3){this[_0x240e('0x19')]=new Sequence();this[_0x240e('0x1a')]=_0x1f91a3;this[_0x240e('0x1b')]=_0xebd0ef['voiceQueues'];this[_0x240e('0x1c')]=_0xebd0ef[_0x240e('0x1c')];this[_0x240e('0x1d')]=_0xebd0ef[_0x240e('0x1d')];this['trunks']=_0xebd0ef[_0x240e('0x1e')];this['maxNumberOriginate']=config[_0x240e('0x1f')]||0x2;this[_0x240e('0x20')]={};this[_0x240e('0x21')]={};this[_0x240e('0x22')]={};this[_0x240e('0x23')]={};this['optionPredictive']={};this[_0x240e('0x24')]={};this[_0x240e('0x25')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x240e('0x26')]={};ami['on'](_0x240e('0x27'),this[_0x240e('0x28')]['bind'](this));ami['on'](_0x240e('0x29'),this['syncQueueCallerAbandon'][_0x240e('0x2a')](this));ami['on']('originateresponse',this[_0x240e('0x2b')][_0x240e('0x2a')](this));ami['on']('agentcomplete',this[_0x240e('0x2c')]['bind'](this));ami['on'](_0x240e('0x2d'),this[_0x240e('0xa')]['bind'](this));ami['on'](_0x240e('0x2e'),this[_0x240e('0x2f')][_0x240e('0x2a')](this));ami['on'](_0x240e('0x30'),this[_0x240e('0x31')]['bind'](this));ami['on'](_0x240e('0x32'),this['syncVarSet'][_0x240e('0x2a')](this));ami['on']('queuemember',this[_0x240e('0x33')][_0x240e('0x2a')](this));ami['on'](_0x240e('0x34'),this[_0x240e('0x35')]['bind'](this));this[_0x240e('0x36')]();this['loopClearZombieChannels']();}function isNotNull(_0x3af460){return _0x3af460!==null&&!_['isUndefined'](_0x3af460);}function checkIsLoggedIn(_0x5c4899,_0x9804d7){return function(){if(_0x9804d7<=0x0){_0x5c4899['message']=_0x240e('0x37');throw _0x5c4899[_0x240e('0x38')]+_0x240e('0x39');}};}function isActive(_0x41725d){return _0x41725d;}function checkIsActive(_0x106812,_0x5309b9){return function(){if(!isActive(_0x5309b9)){_0x106812[_0x240e('0x3a')]=_0x240e('0x3b');throw _0x106812['name']+_0x240e('0x3c');}};}function checkInterval(_0x13a7e4){return function(){if(!isNotNull(_0x13a7e4[_0x240e('0x3d')])){_0x13a7e4[_0x240e('0x3a')]=_0x240e('0x3e');throw _0x13a7e4[_0x240e('0x38')]+_0x240e('0x3f');}if(!isNotNull(_0x13a7e4[_0x240e('0x3d')]['Intervals'])){_0x13a7e4[_0x240e('0x3a')]=_0x240e('0x3e');throw _0x13a7e4[_0x240e('0x38')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x13a7e4[_0x240e('0x3d')][_0x240e('0x40')]))){_0x13a7e4[_0x240e('0x3a')]=_0x240e('0x3e');throw _0x13a7e4[_0x240e('0x38')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0xe2da2a,_0x24e091,_0x51d85b){return{'action':_0xe2da2a,'response':_0x24e091,'message':_0x51d85b,'stack':_0x51d85b};}function myreject(_0x51d9a4){return function(_0x55079d){return _0x51d9a4(msgResponse('[ifTime][Action]',_0x240e('0x41'),JSON[_0x240e('0x42')](_0x55079d)));};}function getSeconds(_0x5d2950,_0x8ae6fd){var _0x5719e6=moment(_0x5d2950)[_0x240e('0x43')](0x0);var _0x4e432c=moment(_0x8ae6fd)[_0x240e('0x43')](0x0);return _0x5719e6[_0x240e('0x44')](_0x4e432c,_0x240e('0x45'));}function emit(_0x321422,_0x5287e2,_0x31ee89){io['to'](_0x321422)[_0x240e('0x46')](_0x5287e2,_0x31ee89);}function emitVoiceQueueSummary(_0x16f34f){if(_0x16f34f[_0x240e('0x47')]==='outbound'){var _0x4e5276={'id':_0x16f34f['id'],'name':_0x16f34f['name'],'strategy':_0x16f34f[_0x240e('0x48')],'answered':_0x16f34f['answered'],'available':_0x16f34f['available'],'loggedIn':_0x16f34f['loggedIn'],'pTalking':_0x16f34f[_0x240e('0x49')],'sumBillable':_0x16f34f['sumBillable'],'sumDuration':_0x16f34f[_0x240e('0x4a')],'sumHoldTime':_0x16f34f[_0x240e('0x4b')]||0x0,'talking':_0x16f34f[_0x240e('0x4c')],'total':_0x16f34f['total'],'type':_0x16f34f[_0x240e('0x47')],'unmanaged':_0x16f34f[_0x240e('0x4d')],'abandoned':_0x16f34f[_0x240e('0x4e')],'waiting':_0x16f34f[_0x240e('0x4f')],'loggedInDb':_0x16f34f[_0x240e('0x50')],'dialActive':_0x16f34f[_0x240e('0x51')],'dialMethod':_0x16f34f[_0x240e('0x52')],'dialOriginateCallerIdName':_0x16f34f[_0x240e('0x53')],'dialOriginateCallerIdNumber':_0x16f34f[_0x240e('0x54')],'dialOriginateTimeout':_0x16f34f[_0x240e('0x55')],'dialPrefix':_0x16f34f[_0x240e('0x56')],'outboundAnswerAgiCallsDay':_0x16f34f[_0x240e('0x57')],'outboundAnswerCallsDay':_0x16f34f['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x16f34f[_0x240e('0x58')],'outboundBusyCallsDay':_0x16f34f[_0x240e('0x59')],'outboundCongestionCallsDay':_0x16f34f[_0x240e('0x5a')],'outboundDropCallsDayACS':_0x16f34f[_0x240e('0x5b')],'outboundDropCallsDayCallersExit':_0x16f34f[_0x240e('0x5c')],'outboundDropCallsDayTimeout':_0x16f34f['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x16f34f[_0x240e('0x5d')],'outboundNoSuchCallsDay':_0x16f34f[_0x240e('0x5e')],'outboundOriginateFailureCallsDay':_0x16f34f[_0x240e('0x5f')],'outboundReCallsDay':_0x16f34f[_0x240e('0x60')],'outboundRejectCallsDay':_0x16f34f[_0x240e('0x61')],'outboundUnknownCallsDay':_0x16f34f[_0x240e('0x62')],'predictiveIntervalAnsweredCalls':_0x16f34f['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x16f34f[_0x240e('0x63')],'predictiveIntervalAvgTalktime':_0x16f34f['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x16f34f[_0x240e('0x64')],'predictiveIntervalDroppedCallsTimeout':_0x16f34f['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x16f34f[_0x240e('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x16f34f['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x16f34f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x16f34f['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x16f34f[_0x240e('0x66')],'predictiveIntervalAvailable':_0x16f34f['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x16f34f['predictiveIntervalTotalCalls'],'message':_0x16f34f[_0x240e('0x3a')],'originated':_0x16f34f[_0x240e('0x67')],'erlangCalls':_0x16f34f['erlangCalls'],'erlangCallToSecond':_0x16f34f[_0x240e('0x68')],'erlangAbandonmentRate':_0x16f34f[_0x240e('0x69')],'erlangBusyFactor':_0x16f34f['erlangBusyFactor'],'startPredictive':_0x16f34f[_0x240e('0x24')],'startProgressive':_0x16f34f[_0x240e('0x25')]};if(_0x16f34f[_0x240e('0x6a')]){_0x4e5276[_0x240e('0x6a')]={'id':_0x16f34f[_0x240e('0x6a')]['id'],'name':_0x16f34f[_0x240e('0x6a')][_0x240e('0x38')],'active':_0x16f34f[_0x240e('0x6a')][_0x240e('0x6b')],'callerid':_0x16f34f[_0x240e('0x6a')]['callerid']};}if(_0x16f34f[_0x240e('0x3d')]){_0x4e5276[_0x240e('0x3d')]={'id':_0x16f34f[_0x240e('0x3d')]['id'],'name':_0x16f34f['Interval'][_0x240e('0x38')]};}var _0x37e9b3=md5(JSON[_0x240e('0x42')](_0x4e5276));if(_0x16f34f['md5']!==_0x37e9b3){_0x16f34f['md5']=_0x37e9b3;emit(util[_0x240e('0x6c')]('voice:queue:%s',_0x4e5276[_0x240e('0x38')]),'voice_queue:save',_0x4e5276);}}}function emitCampaignSummary(_0x5397b1){if(_0x5397b1[_0x240e('0x47')]===_0x240e('0x6d')){emit(util[_0x240e('0x6c')](_0x240e('0x6e'),_0x5397b1[_0x240e('0x38')]),_0x240e('0x6f'),_0x5397b1);}}function checkGetDataPredictive(_0x329511){if(isNotNull(_0x329511)){if(!_[_0x240e('0x70')](_0x329511)){loggerPredictive['info'](_0x240e('0x71'));loggerPredictive[_0x240e('0x72')](_0x240e('0x73'),_0x329511[_0x240e('0x74')]);loggerPredictive[_0x240e('0x72')](_0x240e('0x75'),_0x329511[_0x240e('0x76')]);loggerPredictive[_0x240e('0x72')](_0x240e('0x77'),_0x329511['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x240e('0x72')](_0x240e('0x78'),_0x329511[_0x240e('0x64')]);loggerPredictive[_0x240e('0x72')](_0x240e('0x79'),_0x329511[_0x240e('0x63')]);loggerPredictive[_0x240e('0x72')](_0x240e('0x7a'),_0x329511[_0x240e('0x7b')]);loggerPredictive[_0x240e('0x72')]('---------------------------');if(_0x329511[_0x240e('0x74')]>0x0){if(!_[_0x240e('0x7c')](_0x329511['predictiveIntervalAvgTalktime'])&&_0x329511['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x240e('0x72')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x240e('0x7c')](_0x329511[_0x240e('0x63')])&&_0x329511[_0x240e('0x63')]>0x0){return!![];}else{loggerPredictive['info'](_0x240e('0x7d'));}}else{loggerPredictive[_0x240e('0x72')](_0x240e('0x7e'));}}else{loggerPredictive[_0x240e('0x72')](_0x240e('0x7f'));}}else{loggerPredictive['info'](_0x240e('0x7f'));}return![];}function mergeDataErlangB(_0x5dcbbc){return function(_0x484af7){loggerPredictive[_0x240e('0x72')](_0x240e('0x80'));loggerPredictive[_0x240e('0x72')](_0x240e('0x81'),_0x484af7[_0x240e('0x82')]);loggerPredictive['info'](_0x240e('0x83'),_0x484af7[_0x240e('0x68')]);loggerPredictive[_0x240e('0x72')](_0x240e('0x84'),_0x484af7['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x484af7[_0x240e('0x85')]);loggerPredictive[_0x240e('0x72')](_0x240e('0x84'),_0x484af7[_0x240e('0x69')]);loggerPredictive[_0x240e('0x72')](_0x240e('0x86'));_[_0x240e('0x87')](_0x5dcbbc,_0x484af7);};}function getDiff(_0x354464){var _0x547928=moment()[_0x240e('0x43')](0x0);var _0x3dedb6=moment(_0x354464)['milliseconds'](0x0);return _0x547928['diff'](_0x3dedb6,_0x240e('0x45'));}function ifInterval(_0x5ec95b,_0x1363d4){if(_[_0x240e('0x7c')](_0x1363d4)){return![];}if(getDiff(_0x1363d4)<_0x5ec95b*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x2a9838){if(isNotNull(_0x2a9838)){if(!_[_0x240e('0x7c')](_0x2a9838['startProgressive'])){_0x2a9838[_0x240e('0x25')]=undefined;loggerPredictive[_0x240e('0x72')](_0x2a9838[_0x240e('0x38')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x240e('0x7c')](_0x2a9838[_0x240e('0x24')])){_0x2a9838['startPredictive']=undefined;loggerPredictive['info'](_0x2a9838[_0x240e('0x38')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x240e('0x7c')](_0x2a9838[_0x240e('0x88')])){clearInterval(_0x2a9838[_0x240e('0x88')]);_0x2a9838[_0x240e('0x88')]=undefined;loggerPredictive['info'](_0x2a9838[_0x240e('0x38')],_0x240e('0x89'));}}}function erlangb(_0x57066d,_0x452f1d){if(_0x452f1d===0x0){return 0x0;}var _0x31205d=0x1;for(var _0x27358b=0x1;_0x27358b<=_0x452f1d;_0x27358b+=0x1){_0x31205d=0x1+_0x31205d*_0x27358b/_0x57066d;}return 0x1/_0x31205d;}function isVoiceQueueOutbound(_0x521270){return _0x521270===_0x240e('0x8a');}function isNotPreview(_0x87bd6f){return _0x87bd6f!=='preview';}function isCampaignIvr(_0xe05bd){return _0xe05bd==='ivr';}function getCallerId(_0x132643,_0x2cd7de,_0x2e5c21){if(!_['isUndefined'](_0x2e5c21)&&_0x240e('0x8b')===typeof _0x2e5c21&&!_['isEmpty'](_0x2e5c21)){if(!_[_0x240e('0x7c')](_0x2cd7de)&&_0x240e('0x8b')===typeof _0x2cd7de&&!_[_0x240e('0x70')](_0x2cd7de)){return util[_0x240e('0x6c')](_0x240e('0x8c'),_0x2cd7de,_0x2e5c21);}return util['format'](_0x240e('0x8c'),_0x2e5c21,_0x2e5c21);}if(!_[_0x240e('0x7c')](_0x132643)&&_0x240e('0x8b')===typeof _0x132643&&!_['isEmpty'](_0x132643)){return _0x132643;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x33d54e,_0x14650f){return function(_0x3a613c){freeVariablesPredictive(_0x14650f);emitVoiceQueueSummary(_0x14650f);emitCampaignSummary(_0x14650f);loggerSyncQueueSummary[_0x240e('0x8d')](_0x33d54e,util[_0x240e('0x8e')](_0x3a613c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x352bd8,_0x343a20){return function(_0x318b19){loggerPredictive['error'](_0x343a20[_0x240e('0x38')],_0x352bd8);loggerPredictive['error'](_0x318b19['stack']);freeVariablesPredictive(_0x343a20);};}function loggerCatch(_0x3eedbe){return function(_0x326a1d){logger['error'](_0x3eedbe,util[_0x240e('0x8e')](_0x326a1d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3ffc18){return _0x3ffc18&&!_[_0x240e('0x7c')](_0x3ffc18)&&_0x3ffc18['length']>0x0;}function decremetOriginate(_0x107ef5){if(!_['isUndefined'](_0x107ef5)&&_0x107ef5!==null){if(_0x107ef5[_0x240e('0x8f')](_0x240e('0x67'))){if(_0x107ef5[_0x240e('0x67')]>0x0){_0x107ef5['originated']-=0x1;}else{logger[_0x240e('0x8d')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x240e('0x8d')](_0x240e('0x90'));}}function checkContactLowerLimitOriginate(_0x539d05,_0x2bde23,_0x42d981){if(_0x2bde23>_0x42d981){for(var _0x1609cd=0x0;_0x1609cd<_0x2bde23-_0x42d981;_0x1609cd+=0x1){decremetOriginate(_0x539d05);}}}function loggerGetContactDialer(_0x4b34fc,_0x52509d,_0x3581a5){return function(_0x2ee410){checkContactLowerLimitOriginate(_0x52509d,_0x3581a5,0x0);logger['error'](_0x4b34fc,util[_0x240e('0x8e')](_0x2ee410,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x51a210){return function(_0x13dfe5){if(isNotNull(_0x13dfe5)&&isNotNull(_0x13dfe5[0x0])){if(_0x13dfe5[0x0]['contactsRescheduled']>0x0){_0x51a210[_0x240e('0x3a')]='RESCHEDULED_CONTACTS';logger[_0x240e('0x72')](_0x240e('0x91')+_0x51a210[_0x240e('0x38')],_0x13dfe5[0x0]['contactsRescheduled'],_0x240e('0x92'));}else{_0x51a210[_0x240e('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x240e('0x72')](_0x240e('0x93')+_0x51a210[_0x240e('0x38')]);}}};}function notSendMessagesQueue(_0x32f0e2){if(_0x32f0e2['sendMessageOneNotActive']){freeVariablesPredictive(_0x32f0e2);if(_0x32f0e2[_0x240e('0x67')]===0x0&&_0x32f0e2['talking']===0x0&&_0x32f0e2[_0x240e('0x4f')]===0x0&&(_0x32f0e2[_0x240e('0x49')]||0x0)===0x0){_0x32f0e2[_0x240e('0x94')]=![];_0x32f0e2[_0x240e('0x95')]=0x0;_0x32f0e2[_0x240e('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x240e('0x96'),_0x32f0e2[_0x240e('0x38')],'is\x20not\x20active');}else{_0x32f0e2[_0x240e('0x3a')]=_0x240e('0x97');loggerSyncQueueSummary[_0x240e('0x8d')](_0x240e('0x96'),_0x32f0e2[_0x240e('0x38')],_0x240e('0x98'));}emitVoiceQueueSummary(_0x32f0e2);}}function notSendMessagesCampaign(_0x2b9ff8){if(_0x2b9ff8[_0x240e('0x94')]){if(_0x2b9ff8[_0x240e('0x67')]===0x0){_0x2b9ff8[_0x240e('0x94')]=![];_0x2b9ff8[_0x240e('0x3a')]=_0x240e('0x3b');loggerSyncQueueSummary['error'](_0x240e('0x99'),_0x2b9ff8[_0x240e('0x38')],_0x240e('0x9a'));}else{_0x2b9ff8[_0x240e('0x3a')]=_0x240e('0x97');loggerSyncQueueSummary[_0x240e('0x8d')](_0x240e('0x99'),_0x2b9ff8[_0x240e('0x38')],_0x240e('0x98'));}emitCampaignSummary(_0x2b9ff8);}}function createObjHistory(_0x4d5916,_0x692b63,_0x32c118,_0x19f278,_0xf7320e){_0x4d5916['message']=_0x32c118;var _0x12eb3d=new Action(_0x4d5916,_0x692b63);var _0x1d7807=new History(_0x12eb3d);_0x1d7807[_0x240e('0x9b')]=_0x19f278;_0x1d7807['statedesc']=_0xf7320e;_0x1d7807[_0x240e('0x9c')]=_0x12eb3d[_0x240e('0x9d')];return _0x1d7807;}Dialer['prototype'][_0x240e('0x9e')]=function(){var _0x529dc8=this;setInterval(function(){_0x529dc8[_0x240e('0x9f')](_0x529dc8[_0x240e('0x23')],_0x240e('0xa0'));_0x529dc8[_0x240e('0x9f')](_0x529dc8['actions'],_0x240e('0xa1'));},0x32c8);};Dialer[_0x240e('0x16')]['clearZombieChannels']=function(_0x3cc57a,_0x44e6d0){var _0x1e77d9=this;for(var _0x34735d in _0x3cc57a){if(_0x3cc57a[_0x240e('0x8f')](_0x34735d)){this[_0x240e('0x19')][_0x240e('0x17')](function(){if(!_[_0x240e('0xa2')](_0x3cc57a[_0x34735d])){return ami['Action']({'action':_0x240e('0xa3'),'channel':_0x3cc57a[_0x34735d][_0x240e('0xa4')]})['catch'](function(_0x52f11a){if(_0x52f11a[_0x240e('0x3a')]===_0x240e('0xa5')){setTimeout(function(){if(_0x3cc57a[_0x34735d]&&_0x3cc57a[_0x34735d][_0x240e('0x47')]!=='ivr'){_0x1e77d9[_0x240e('0xa6')](_0x1e77d9['voiceQueues'][_0x3cc57a[_0x34735d][_0x240e('0xa7')]]);logger[_0x240e('0x8d')](_0x240e('0xa8'),_0x44e6d0,_0x34735d,_0x3cc57a[_0x34735d]['queue']);delete _0x3cc57a[_0x34735d];}if(_0x3cc57a[_0x34735d]&&_0x3cc57a[_0x34735d][_0x240e('0x47')]===_0x240e('0x6d')){_0x1e77d9['updateOriginated'](_0x1e77d9['campaigns'][_0x3cc57a[_0x34735d][_0x240e('0xa7')]]);logger[_0x240e('0x8d')](_0x240e('0xa9'),_0x44e6d0,_0x34735d,_0x3cc57a[_0x34735d][_0x240e('0xa7')]);delete _0x3cc57a[_0x34735d];}},0x2328);}});}});}}};Dialer[_0x240e('0x16')][_0x240e('0xaa')]=function(_0x13e247){return BPromise[_0x240e('0xab')]()['then'](cmHopper[_0x240e('0xaa')](_0x13e247))[_0x240e('0xac')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x240e('0x16')][_0x240e('0xad')]=function(_0x1b7649){return BPromise[_0x240e('0xab')]()[_0x240e('0xae')](cmHopperBlack[_0x240e('0xad')](_0x1b7649))[_0x240e('0xac')](loggerCatch(_0x240e('0xaf')));};Dialer[_0x240e('0x16')][_0x240e('0xb0')]=function(_0x4c30cf){return BPromise[_0x240e('0xab')]()[_0x240e('0xae')](cmHopperBlack[_0x240e('0xb0')](_0x4c30cf))[_0x240e('0xac')](loggerCatch(_0x240e('0xb1')));};Dialer[_0x240e('0x16')][_0x240e('0xb2')]=function(_0x82a5da){return BPromise[_0x240e('0xab')]()[_0x240e('0xae')](cmHopperHistory[_0x240e('0xb3')](_0x82a5da))[_0x240e('0xac')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x240e('0x16')][_0x240e('0xb4')]=function(_0x1d94b8){return BPromise[_0x240e('0xab')]()[_0x240e('0xae')](cmHopper[_0x240e('0xb4')](_0x1d94b8))[_0x240e('0xac')](loggerCatch(_0x240e('0xb5')));};Dialer[_0x240e('0x16')][_0x240e('0xb6')]=function(_0x53884c,_0x1a4fb6,_0x27862b,_0x4e8e50){return BPromise[_0x240e('0xab')]()[_0x240e('0xae')](cmHopper[_0x240e('0xb6')](_0x53884c,_0x1a4fb6,_0x27862b,_0x4e8e50))[_0x240e('0xac')](loggerCatch(_0x240e('0xb7')));};Dialer[_0x240e('0x16')][_0x240e('0xb8')]=function(_0x2c2fa0,_0x156566,_0x4bf474){return BPromise['resolve']()[_0x240e('0xae')](cmHopper[_0x240e('0xb8')](_0x2c2fa0,_0x156566,_0x4bf474))[_0x240e('0xac')](loggerCatch(_0x240e('0xb7')));};Dialer[_0x240e('0x16')][_0x240e('0xb9')]=function(_0x41d482){return BPromise['resolve']()[_0x240e('0xae')](voiceQueueRt['getVoiceQueueRtPauses'](_0x41d482))['catch'](loggerCatch(_0x240e('0xba')));};Dialer['prototype'][_0x240e('0xbb')]=function(_0x126f9d){return BPromise[_0x240e('0xab')]()[_0x240e('0xae')](cmHopper[_0x240e('0xbb')](_0x126f9d))[_0x240e('0xac')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer['prototype'][_0x240e('0xbc')]=function(_0x4c2344){return BPromise[_0x240e('0xab')]()[_0x240e('0xae')](cmHopperHistory[_0x240e('0xbc')](_0x4c2344))[_0x240e('0xac')](loggerCatch(_0x240e('0xbd')));};Dialer[_0x240e('0x16')][_0x240e('0xa6')]=function(_0x45eb54){if(!_[_0x240e('0x7c')](_0x45eb54)&&_0x45eb54!==null){if(_0x45eb54['hasOwnProperty']('originated')){if(_0x45eb54[_0x240e('0x67')]>0x0){_0x45eb54[_0x240e('0x67')]-=0x1;}else{logger[_0x240e('0x8d')](_0x240e('0xbe'));}}}else{logger[_0x240e('0x8d')](_0x240e('0xbf'));}};Dialer[_0x240e('0x16')][_0x240e('0xc0')]=function(_0x19fdbd,_0x14ca4f){var _0x165626=this;return function(_0x42204f){_0x165626[_0x240e('0xa6')](_0x14ca4f);logger[_0x240e('0x8d')](_0x19fdbd,util[_0x240e('0x8e')](_0x42204f,{'showHidden':![],'depth':null}));};};Dialer[_0x240e('0x16')][_0x240e('0xc1')]=function(_0x55ec5b,_0x4dc8f7,_0x4d984c){var _0x101502={'state':0x19,'statedesc':_0x240e('0xc2')};this[_0x240e('0xa6')](_0x4dc8f7);this[_0x240e('0xc3')](_[_0x240e('0x87')](_0x101502,_['pick'](_0x4d984c,['ContactId',_0x240e('0xc4'),_0x240e('0xc5'),_0x240e('0xc6'),_0x240e('0xc7')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x240e('0x8d')](_0x55ec5b);};Dialer[_0x240e('0x16')][_0x240e('0xc8')]=function(_0x122cff){return _0x122cff===_0x240e('0xc9');};Dialer['prototype'][_0x240e('0xca')]=function(_0x3d6bad){return!_[_0x240e('0x7c')](_0x3d6bad)&&_0x3d6bad&&!_[_0x240e('0x7c')](_0x3d6bad[_0x240e('0x38')])&&!_['isUndefined'](_0x3d6bad[_0x240e('0x6b')])&&_0x3d6bad[_0x240e('0x6b')]&&(this[_0x240e('0x1e')][util[_0x240e('0x6c')](_0x240e('0xcb'),_0x3d6bad['name'])][_0x240e('0xa3')]===_0x240e('0xcc')||this[_0x240e('0x1e')][util['format'](_0x240e('0xcb'),_0x3d6bad['name'])]['status']===_0x240e('0xcd'));};Dialer['prototype'][_0x240e('0xc3')]=function(_0x58bbf7,_0x3d5a86,_0x34b8ac){this[_0x240e('0xbc')](_0x58bbf7)[_0x240e('0xac')](loggerCatch(_0x3d5a86));this[_0x240e('0xbb')](_0x58bbf7)[_0x240e('0xac')](loggerCatch(_0x34b8ac));};Dialer['prototype']['syncVarSet']=function(_0x47023f){var _0x4adb04=this['uniqueId'][_0x47023f['uniqueid']];var _0x40d85b;if(!_[_0x240e('0xa2')](_0x47023f)&&!_[_0x240e('0xa2')](_0x47023f[_0x240e('0xce')])&&!_['isNil'](_0x47023f[_0x240e('0xce')][_0x240e('0xcf')])&&_0x47023f[_0x240e('0xd0')]===_0x240e('0xd1')&&_0x4adb04){if(_0x4adb04['type']!=='ivr'&&this[_0x240e('0x1b')][_0x4adb04[_0x240e('0xa7')]][_0x240e('0xd2')]&&_0x47023f[_0x240e('0xd3')]===_0x240e('0xd4')){delete this['uniqueId'][_0x47023f['uniqueid']];this['updateOriginated'](this[_0x240e('0x1b')][_0x4adb04[_0x240e('0xa7')]]);this['voiceQueues'][_0x4adb04['queue']]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x4adb04[_0x240e('0xa7')]]['outboundAnswerAgiCallsDay']+=0x1;_0x40d85b=new Hangup(_0x4adb04,_0x47023f);_0x40d85b[_0x240e('0x9b')]=0x12;_0x40d85b['statedesc']=_0x240e('0xd5');_0x40d85b[_0x240e('0xd6')]=_0x240e('0xd7');this[_0x240e('0xc3')](_0x40d85b,_0x240e('0xd8'),_0x240e('0xd9'));}if(_0x4adb04[_0x240e('0x47')]!==_0x240e('0x6d')&&this['voiceQueues'][_0x4adb04['queue']][_0x240e('0xd2')]&&_0x47023f[_0x240e('0xd3')]==='MACHINE'){delete this[_0x240e('0x23')][_0x47023f[_0x240e('0xda')]];this['updateOriginated'](this[_0x240e('0x1b')][_0x4adb04['queue']]);this[_0x240e('0x1b')][_0x4adb04[_0x240e('0xa7')]][_0x240e('0xdb')]+=0x1;this[_0x240e('0x1b')][_0x4adb04[_0x240e('0xa7')]][_0x240e('0x57')]+=0x1;_0x40d85b=new Hangup(_0x4adb04,_0x47023f);_0x40d85b[_0x240e('0x9b')]=0x13;_0x40d85b[_0x240e('0xdc')]=_0x240e('0xdd');_0x40d85b[_0x240e('0xd6')]=_0x240e('0xd7');_0x40d85b['amd']=!![];this['saveInDb'](_0x40d85b,'[syncMachine][createHistory]','[syncMachine]');}if(_0x4adb04['type']===_0x240e('0x6d')&&this['campaigns'][_0x4adb04[_0x240e('0xa7')]][_0x240e('0xd2')]&&_0x47023f['value']===_0x240e('0xd4')){delete this['uniqueId'][_0x47023f[_0x240e('0xda')]];this[_0x240e('0xa6')](this['campaigns'][_0x4adb04['queue']]);_0x40d85b=new Hangup(_0x4adb04,_0x47023f);_0x40d85b['state']=0x12;_0x40d85b[_0x240e('0xdc')]=_0x240e('0xd5');_0x40d85b[_0x240e('0xd6')]=_0x240e('0xd7');this[_0x240e('0xc3')](_0x40d85b,_0x240e('0xde'),_0x240e('0xdf'));}if(_0x4adb04[_0x240e('0x47')]===_0x240e('0x6d')&&this[_0x240e('0x1c')][_0x4adb04[_0x240e('0xa7')]][_0x240e('0xd2')]&&_0x47023f['value']===_0x240e('0xe0')){delete this[_0x240e('0x23')][_0x47023f[_0x240e('0xda')]];this[_0x240e('0xa6')](this[_0x240e('0x1c')][_0x4adb04[_0x240e('0xa7')]]);_0x40d85b=new Hangup(_0x4adb04,_0x47023f);_0x40d85b['state']=0x13;_0x40d85b[_0x240e('0xdc')]=_0x240e('0xdd');_0x40d85b[_0x240e('0xd6')]=_0x240e('0xd7');_0x40d85b[_0x240e('0xe1')]=!![];this['saveInDb'](_0x40d85b,'[syncMachineIvr][createHistory]',_0x240e('0xe2'));}}};Dialer[_0x240e('0x16')][_0x240e('0x2f')]=function(_0x5c0f3f){var _0x4b94fa=this[_0x240e('0x23')][_0x5c0f3f[_0x240e('0xda')]];var _0x30b2df=this;var _0x2144b8;if(_0x4b94fa&&_0x4b94fa[_0x240e('0x47')]==='ivr'){delete this[_0x240e('0x23')][_0x5c0f3f['uniqueid']];this['updateOriginated'](this[_0x240e('0x1c')][_0x4b94fa[_0x240e('0xa7')]]);this['campaigns'][_0x4b94fa[_0x240e('0xa7')]][_0x240e('0xe3')]+=0x1;_0x2144b8=new Hangup(_0x4b94fa,_0x5c0f3f);this[_0x240e('0xbc')](_0x2144b8)[_0x240e('0xac')](loggerCatch(_0x240e('0xe4')));this[_0x240e('0xbb')](_0x2144b8)['catch'](loggerCatch(_0x240e('0xe5')));}if(_0x4b94fa&&_0x4b94fa[_0x240e('0x47')]!==_0x240e('0x6d')&&isNotNull(this[_0x240e('0x1b')][_0x4b94fa[_0x240e('0xa7')]]['dialQueueProject'])){delete this[_0x240e('0x23')][_0x5c0f3f['uniqueid']];this['updateOriginated'](this[_0x240e('0x1b')][_0x4b94fa['queue']]);this[_0x240e('0x1b')][_0x4b94fa[_0x240e('0xa7')]][_0x240e('0xdb')]+=0x1;this[_0x240e('0x1b')][_0x4b94fa[_0x240e('0xa7')]][_0x240e('0x57')]+=0x1;_0x2144b8=new Hangup(_0x4b94fa,_0x5c0f3f);_0x2144b8[_0x240e('0x9b')]=0x10;_0x2144b8['statedesc']=_0x240e('0xe6');_0x2144b8[_0x240e('0xd6')]='AGI';this[_0x240e('0xbc')](_0x2144b8)[_0x240e('0xac')](loggerCatch(_0x240e('0xe4')));this['moveContactManagedDialer'](_0x2144b8)[_0x240e('0xac')](loggerCatch(_0x240e('0xe5')));}if(_0x4b94fa&&_0x4b94fa[_0x240e('0x47')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x4b94fa[_0x240e('0xa7')]][_0x240e('0xe7')])){delete this[_0x240e('0x23')][_0x5c0f3f[_0x240e('0xda')]];this['updateOriginated'](this[_0x240e('0x1b')][_0x4b94fa['queue']]);this[_0x240e('0x1b')][_0x4b94fa[_0x240e('0xa7')]][_0x240e('0x62')]+=0x1;_0x2144b8=new Hangup(_0x4b94fa,_0x5c0f3f);_0x2144b8['state']=0xc;_0x2144b8['statedesc']=_0x5c0f3f[_0x240e('0xe8')];_0x2144b8[_0x240e('0xd6')]=_0x240e('0xe9');this[_0x240e('0xbc')](_0x2144b8)['catch'](loggerCatch(_0x240e('0xe4')));this['moveContactManagedDialer'](_0x2144b8)[_0x240e('0xac')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x240e('0x16')][_0x240e('0x2c')]=function(_0x37fd42){var _0x2ce36f=this[_0x240e('0x23')][_0x37fd42[_0x240e('0xda')]];var _0x51855c=this;if(this[_0x240e('0x1b')][_0x37fd42[_0x240e('0xa7')]]){if(_0x2ce36f&&_0x2ce36f['type']!==_0x240e('0x6d')){delete this[_0x240e('0x23')][_0x37fd42[_0x240e('0xda')]];this['voiceQueues'][_0x37fd42[_0x240e('0xa7')]][_0x240e('0xdb')]+=0x1;var _0x272f27=new AgentComplete(_0x2ce36f,_0x37fd42);if(_0x37fd42[_0x240e('0xea')]===_0x240e('0xeb')){_0x272f27[_0x240e('0xec')]=this['voiceQueues'][_0x37fd42[_0x240e('0xa7')]][_0x240e('0xed')]&&this['voiceQueues'][_0x37fd42[_0x240e('0xa7')]]['dialAgiAfterHangupAgent']?moment()[_0x240e('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x240e('0xbc')](_0x272f27)[_0x240e('0xac')](loggerCatch(_0x240e('0xee')));this[_0x240e('0xbb')](_0x272f27)[_0x240e('0xac')](loggerCatch(_0x240e('0xef')));}}};Dialer[_0x240e('0x16')]['syncAgentConnect']=function(_0xf4af67){if(this['voiceQueues'][_0xf4af67['queue']]){if(this[_0x240e('0x23')][_0xf4af67[_0x240e('0xda')]]&&this[_0x240e('0x23')][_0xf4af67[_0x240e('0xda')]][_0x240e('0x47')]!==_0x240e('0x6d')){this[_0x240e('0xa6')](this[_0x240e('0x1b')][_0xf4af67['queue']]);this[_0x240e('0x23')][_0xf4af67[_0x240e('0xda')]][_0x240e('0xf0')]=moment()[_0x240e('0x6c')](_0x240e('0xf1'));}}};Dialer[_0x240e('0x16')]['queueCallerAbandonCreateState']=function(_0x35f2d7){this[_0x240e('0xbc')](_0x35f2d7)[_0x240e('0xac')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x240e('0xbb')](_0x35f2d7)[_0x240e('0xac')](loggerCatch(_0x240e('0xf2')));};Dialer[_0x240e('0x16')][_0x240e('0xf3')]=function(_0x47bdaa){var _0x2e644a=this[_0x240e('0x23')][_0x47bdaa[_0x240e('0xda')]];var _0x2c4963=this;if(this[_0x240e('0x1b')][_0x47bdaa[_0x240e('0xa7')]]){if(_0x2e644a&&_0x2e644a[_0x240e('0x47')]!==_0x240e('0x6d')){delete this['uniqueId'][_0x47bdaa[_0x240e('0xda')]];this[_0x240e('0xa6')](this[_0x240e('0x1b')][_0x47bdaa[_0x240e('0xa7')]]);_0x2e644a[_0x240e('0xf4')]=moment()[_0x240e('0x6c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x9232be=new QueueCallerAbandon(_0x2e644a,_0x47bdaa);if(getSeconds(_0x2e644a[_0x240e('0xf4')],_0x2e644a[_0x240e('0xf5')])>=_0x2e644a['dialQueueTimeout']){this['voiceQueues'][_0x47bdaa[_0x240e('0xa7')]][_0x240e('0xf6')]+=0x1;this[_0x240e('0x1b')][_0x47bdaa[_0x240e('0xa7')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x240e('0x1b')][_0x47bdaa[_0x240e('0xa7')]][_0x240e('0xf7')]+=0x1;_0x9232be['state']=0xa;_0x9232be[_0x240e('0xdc')]=_0x240e('0xf8');_0x9232be['dropreason']=_0x240e('0xf9');_0x9232be[_0x240e('0xec')]=this[_0x240e('0x1b')][_0x47bdaa[_0x240e('0xa7')]][_0x240e('0xed')]?moment()[_0x240e('0x6c')](_0x240e('0xf1')):undefined;this['queueCallerAbandonCreateState'](_0x9232be);}else{this[_0x240e('0x1b')][_0x47bdaa[_0x240e('0xa7')]][_0x240e('0x64')]+=0x1;this['voiceQueues'][_0x47bdaa[_0x240e('0xa7')]]['outboundDropCallsDayCallersExit']+=0x1;_0x9232be[_0x240e('0x9b')]=0xb;_0x9232be[_0x240e('0xdc')]=_0x240e('0xfa');_0x9232be[_0x240e('0xfb')]=_0x240e('0xfc');this['queueCallerAbandonCreateState'](_0x9232be);}}}};Dialer['prototype']['syncNewExten']=function(_0xc1c836){if(this['actions'][_0xc1c836[_0x240e('0xda')]]){this['actions'][_0xc1c836[_0x240e('0xda')]][_0x240e('0xa4')]=_0xc1c836[_0x240e('0xa4')];}if(this[_0x240e('0x23')][_0xc1c836['uniqueid']]){this[_0x240e('0x23')][_0xc1c836[_0x240e('0xda')]][_0x240e('0xa4')]=_0xc1c836[_0x240e('0xa4')];}};Dialer[_0x240e('0x16')][_0x240e('0x33')]=function(_0x381e8e){if(strategy[this[_0x240e('0x1b')][this['actions'][_0x381e8e[_0x240e('0xfd')]][_0x240e('0xa7')]][_0x240e('0x48')]]==='roundrobin'){if(this[_0x240e('0x21')][_0x381e8e[_0x240e('0xfd')]]&&_[_0x240e('0xa2')](this[_0x240e('0x21')][_0x381e8e[_0x240e('0xfd')]][_0x240e('0xfe')])&&_0x381e8e['status']==='1'&&_0x381e8e['paused']==='0'){if(this[_0x240e('0x1d')][_0x381e8e[_0x240e('0xff')]]){if(!this[_0x240e('0x1d')][_0x381e8e[_0x240e('0xff')]][_0x240e('0xfe')]){this['agents'][_0x381e8e['stateinterface']]['locked']=!![];this[_0x240e('0x21')][_0x381e8e[_0x240e('0xfd')]][_0x240e('0xfe')]=!![];this[_0x240e('0x21')][_0x381e8e[_0x240e('0xfd')]]['stateinterface']=_0x381e8e[_0x240e('0xff')];}}}}else if((strategy[this['voiceQueues'][this[_0x240e('0x21')][_0x381e8e['actionid']]['queue']][_0x240e('0x48')]]||_0x240e('0x14'))==='rrmemory'){if(this['actions'][_0x381e8e[_0x240e('0xfd')]]){if(this[_0x240e('0x1d')][_0x381e8e[_0x240e('0xff')]]){this['actions'][_0x381e8e['actionid']][_0x240e('0xff')]=_0x381e8e[_0x240e('0xff')];if(_[_0x240e('0xa2')](this[_0x240e('0x100')][this[_0x240e('0x21')][_0x381e8e[_0x240e('0xfd')]][_0x240e('0xa7')]])){this[_0x240e('0x100')][this[_0x240e('0x21')][_0x381e8e[_0x240e('0xfd')]]['queue']]=[];}this[_0x240e('0x100')][this[_0x240e('0x21')][_0x381e8e['actionid']][_0x240e('0xa7')]][_0x240e('0x101')](_[_0x240e('0x87')](_[_0x240e('0x102')](this[_0x240e('0x21')][_0x381e8e[_0x240e('0xfd')]],['idHopper',_0x240e('0xff')]),{'status':_0x381e8e[_0x240e('0xa3')],'paused':_0x381e8e[_0x240e('0x103')]}));}}}};function unlockQueueStatus(_0x5d8562,_0xaec931){setTimeout(function(){if(_['isUndefined'](_0x5d8562['queueStatusComplete'])){loggerBooked[_0x240e('0x8d')](_0x240e('0x104'),_0xaec931);}_0x5d8562[_0x240e('0x105')]=!![];loggerBooked[_0x240e('0x72')](_0x240e('0x106'),_0xaec931,JSON[_0x240e('0x42')](_[_0x240e('0x102')](_0x5d8562,[_0x240e('0x38'),_0x240e('0x105')])));},0x1f3);}Dialer[_0x240e('0x16')]['syncQueueStatusComplete']=function(_0xaec306){var _0x2f69e8=this;var _0x3a7e03=_0x2f69e8[_0x240e('0x1b')][_0x2f69e8[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]];if(strategy[this['voiceQueues'][this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]][_0x240e('0x48')]]===_0x240e('0x15')){if(this['actions'][_0xaec306[_0x240e('0xfd')]]&&this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]]['stateinterface']){this[_0x240e('0x1a')]['run'](this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]]['idHopper'],this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xff')])[_0x240e('0xac')](function(_0x281ce5){logger[_0x240e('0x8d')](_0x240e('0x107'),util['inspect'](_0x281ce5,{'showHidden':![],'depth':null}));})[_0x240e('0x108')](function(){_0x2f69e8[_0x240e('0xa6')](_0x2f69e8[_0x240e('0x1b')][_0x2f69e8[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]]);_0x2f69e8[_0x240e('0x1d')][_0x2f69e8[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xff')]][_0x240e('0xfe')]=![];delete _0x2f69e8['actions'][_0xaec306[_0x240e('0xfd')]];unlockQueueStatus(_0x3a7e03);});}else{this[_0x240e('0xa6')](this[_0x240e('0x1b')][this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0x109')],'ListId':this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]]['ListId'],'VoiceQueueId':this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xc6')]||undefined,'CampaignId':this['actions'][_0xaec306['actionid']][_0x240e('0xc7')]||undefined})[_0x240e('0xac')](loggerCatch(_0x240e('0x10a')));delete this['actions'][_0xaec306[_0x240e('0xfd')]];unlockQueueStatus(_0x3a7e03);}}else if((strategy[this[_0x240e('0x1b')][this[_0x240e('0x21')][_0xaec306['actionid']]['queue']]['strategy']]||'rrmemory')===_0x240e('0x14')){var _0xb3ebcb;if(this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]]&&!_[_0x240e('0x70')](this[_0x240e('0x100')][this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]])){if(this[_0x240e('0x26')][_0x2f69e8[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]]){this[_0x240e('0x26')][_0x2f69e8[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]]['queue']]=this[_0x240e('0x26')][this[_0x240e('0x21')][_0xaec306['actionid']][_0x240e('0xa7')]]?this[_0x240e('0x26')][this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]]['queue']]:this['queueBooked'][this['actions'][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]]?this['queueBooked'][this[_0x240e('0x21')][_0xaec306['actionid']]['queue']][_0x240e('0x10b')]||0x0:0x0;}this[_0x240e('0x100')][this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]][_0x240e('0x10b')]=this['queueBookedRR'][this[_0x240e('0x21')][_0xaec306[_0x240e('0xfd')]][_0x240e('0xa7')]];for(var _0x15aa71=0x0;_0x15aa71=0x0?!![]:![];})[_0x240e('0xac')](myreject(_0x4fc5c2)));}}else{_0x470ab9['push'](ami['Action']({'action':_0x240e('0x12b'),'command':util['format'](_0x240e('0x126'),_0x1da421,!_[_0x240e('0x7c')](config['timezones'][_0x276a78])?_0x276a78:'')})[_0x240e('0xae')](function(_0x402956){return _0x402956[_0x240e('0x128')][_0x240e('0x129')]('true')>=0x0?!![]:![];})['catch'](myreject(_0x4fc5c2)));}BPromise[_0x240e('0x12c')](_0x470ab9)[_0x240e('0xae')](function(_0x572ed7){var _0x23ca9d=_[_0x240e('0x12d')](_0x572ed7);if(_0x23ca9d){return _0x4eff10(_0x23ca9d);}else{_0x5207cb[_0x240e('0x3a')]=_0x456237?'GLOBAL_INTERVAL_IS_OVERTIME':_0x240e('0x12e');return _0x4fc5c2(msgResponse(_0x240e('0x12f'),'Failure',_0x240e('0x130')+_0x456237+'\x20'+_0x5c09ce+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x1da421,{'showHidden':![],'depth':null})+_0x240e('0x131')+_0x276a78));}})[_0x240e('0xac')](function(_0x16f309){return _0x4fc5c2(msgResponse(_0x240e('0x11c'),'Failure',JSON['stringify'](_0x16f309)));});});};Dialer[_0x240e('0x16')]['checkDialMethod']=function(_0x290e0f){var _0x342be2=this;return function(){switch(_0x290e0f[_0x240e('0x52')]){case'progressive':freeVariablesPredictive(_0x290e0f);_0x342be2[_0x240e('0x132')](_0x290e0f,0x1);break;case _0x240e('0x133'):freeVariablesPredictive(_0x290e0f);_0x342be2['handlePower'](_0x290e0f,_0x290e0f['dialPowerLevel']);break;case _0x240e('0x8'):_0x342be2[_0x240e('0x8')](_0x290e0f);break;case _0x240e('0x134'):freeVariablesPredictive(_0x290e0f);_0x342be2[_0x240e('0x132')](_0x290e0f,0x1);break;default:freeVariablesPredictive(_0x290e0f);logger[_0x240e('0x8d')](_0x240e('0x135'),_0x290e0f['name'],_0x240e('0x136'));}};};Dialer['prototype'][_0x240e('0x137')]=function(_0x148c8f){var _0x4e796b=this;return function(){_0x4e796b['handleIvr'](_0x148c8f);};};Dialer[_0x240e('0x16')][_0x240e('0xa')]=function(_0x21291e){var _0x23b49d=this;if(isNotPreview(_0x21291e[_0x240e('0x52')])){if(isVoiceQueueOutbound(_0x21291e[_0x240e('0x47')])&&isActive(_0x21291e['dialActive'])){_0x21291e[_0x240e('0x94')]=!![];BPromise[_0x240e('0xab')]()[_0x240e('0xae')](checkIsLoggedIn(_0x21291e,_0x21291e[_0x240e('0x138')]))[_0x240e('0xae')](checkIsActive(_0x21291e,_0x21291e[_0x240e('0x51')]))[_0x240e('0xae')](checkInterval(_0x21291e))[_0x240e('0xae')](_0x23b49d[_0x240e('0x118')](_0x21291e))[_0x240e('0xae')](_0x23b49d[_0x240e('0x139')](_0x21291e['dialGlobalInterval'],_0x21291e['dialTimezone'],_0x21291e[_0x240e('0x38')],_0x21291e))[_0x240e('0xae')](_0x23b49d[_0x240e('0x11d')](_0x21291e[_0x240e('0x3d')],_0x21291e['dialTimezone'],_0x21291e['name'],_0x21291e))[_0x240e('0xae')](_0x23b49d[_0x240e('0x13a')](_0x21291e))[_0x240e('0xac')](loggerCatchQueueSummary(_0x240e('0x13b'),_0x21291e));}else{notSendMessagesQueue(_0x21291e);}}else{freeVariablesPredictive(_0x21291e);}};Dialer[_0x240e('0x16')][_0x240e('0x117')]=function(){var _0x18aa9a=this;var _0x383fdb;for(var _0x2612b4 in this[_0x240e('0x1c')]){if(this[_0x240e('0x1c')][_0x240e('0x8f')](_0x2612b4)){_0x383fdb=this[_0x240e('0x1c')][_0x2612b4];if(isCampaignIvr(_0x383fdb[_0x240e('0x47')])&&isActive(_0x383fdb[_0x240e('0x6b')])){_0x383fdb[_0x240e('0x94')]=!![];BPromise[_0x240e('0xab')]()[_0x240e('0xae')](checkIsActive(_0x383fdb,_0x383fdb[_0x240e('0x6b')]))[_0x240e('0xae')](checkInterval(_0x383fdb))['then'](_0x18aa9a['checkIsTrunkReachable'](_0x383fdb))[_0x240e('0xae')](_0x18aa9a[_0x240e('0x139')](_0x383fdb['dialGlobalInterval'],_0x383fdb[_0x240e('0x13c')],_0x383fdb[_0x240e('0x38')],_0x383fdb))['then'](_0x18aa9a[_0x240e('0x11d')](_0x383fdb['Interval'],_0x383fdb['dialTimezone'],_0x383fdb[_0x240e('0x38')],_0x383fdb))[_0x240e('0xae')](_0x18aa9a[_0x240e('0x137')](_0x383fdb))[_0x240e('0xac')](loggerCatchQueueSummary(_0x240e('0x13d'),_0x383fdb));}else{notSendMessagesCampaign(_0x383fdb);}}}};function getCallerIdRandom(_0x7dec4f,_0x2defcc){var _0x144abc,_0x35c2b1,_0x44712b;if(_0x2defcc<=0x0){_0x2defcc=0x1;}_0x144abc=new RegExp(_0x240e('0x13e')+_0x2defcc+'}$');_0x35c2b1=Math[_0x240e('0x13f')](0xa,_0x2defcc-0x1);_0x44712b=Math[_0x240e('0x13f')](0xa,_0x2defcc)-0x1;return util[_0x240e('0x6c')]('%s',_[_0x240e('0x140')](_0x7dec4f,_0x144abc,_[_0x240e('0x141')](_0x35c2b1,_0x44712b)));}function extractCalleridName(_0x5f4d49){var _0x454656=_0x5f4d49['match'](/"(.*?)"/);return _0x454656?_0x454656[0x1]:_0x5f4d49;}function extractCalleridNumber(_0x36d2e2){var _0x1f7e27=_0x36d2e2['match'](/<(.*?)>/);return _0x1f7e27?_0x1f7e27[0x1]:_0x36d2e2;}Dialer[_0x240e('0x16')]['actionOriginate']=function(_0x4b7826,_0x41cd8d){var _0x266381=this;var _0x597ca1=uuid['v4']();this[_0x240e('0x21')][_0x597ca1]=new Action(_0x4b7826,_0x41cd8d,_0x597ca1);return new BPromise(function(_0x4b056b,_0xcd3629){if(_[_0x240e('0x7c')](_0x4b7826)&&_0x240e('0x142')!==typeof _0x4b7826){return _0xcd3629(msgResponse(_0x240e('0x143'),_0x240e('0x11e'),_0x240e('0x144')));}if(_['isUndefined'](_0x41cd8d[_0x240e('0x145')][_0x240e('0x146')])||_0x41cd8d['Contact']['phone']===null){return _0xcd3629(msgResponse(_0x240e('0x143'),'Failure',_0x240e('0x147')));}var _0x276ee0={'XMD-CALLERID':_0x266381[_0x240e('0x21')][_0x597ca1][_0x240e('0x148')](),'XMD-AGI':_0x4b7826[_0x240e('0xe7')]?util['format'](_0x240e('0x149'),ipAgi,_0x4b7826[_0x240e('0xe7')]):_0x240e('0x14a'),'XMD-AGIAFTER':_0x4b7826[_0x240e('0xed')]?util[_0x240e('0x6c')](_0x240e('0x149'),ipAgi,_0x4b7826['dialQueueProject2']):_0x240e('0x14a'),'XMD-QUEUE':_0x4b7826[_0x240e('0x47')]===_0x240e('0x8a')?util['format']('\x22%s,%s%s,,,%s\x22',_0x4b7826[_0x240e('0x38')],_0x4b7826[_0x240e('0x14b')]||'',_0x4b7826['dialAgiAfterHangupAgent']?'c':'',_0x4b7826[_0x240e('0x14c')]||0x3):_0x240e('0x14a'),'XMD-CONTACTID':_0x41cd8d['ContactId'],'XMD-CDRTYPE':_0x240e('0x7'),'CALLERID(all)':_0x266381[_0x240e('0x21')][_0x597ca1][_0x240e('0x148')](),'XMD-AMD':_0x4b7826[_0x240e('0xd2')]?_0x240e('0x14d'):_0x240e('0x14a'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x4b7826['dialAMDActive']){_0x276ee0[_0x240e('0x14e')]=_0x4b7826[_0x240e('0x14f')]||0x9c4;_0x276ee0[_0x240e('0x150')]=_0x4b7826[_0x240e('0x151')]||0x5dc;_0x276ee0[_0x240e('0x152')]=_0x4b7826[_0x240e('0x153')]||0x320;_0x276ee0[_0x240e('0x154')]=_0x4b7826[_0x240e('0x155')]||0x1388;_0x276ee0['XMD-AMDMINWORDLENGTH']=_0x4b7826[_0x240e('0x156')]||0x64;_0x276ee0[_0x240e('0x157')]=_0x4b7826[_0x240e('0x158')]||0x32;_0x276ee0['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4b7826['dialAMDMaximumNumberOfWords']||0x3;_0x276ee0[_0x240e('0x159')]=_0x4b7826[_0x240e('0x15a')]||0x100;_0x276ee0[_0x240e('0x15b')]=_0x4b7826[_0x240e('0x15c')]||0x1388;}if(_0x4b7826[_0x240e('0x47')]==='outbound'){_0x276ee0[_0x240e('0x15d')]=_0x41cd8d[_0x240e('0xc6')];}else{_0x276ee0[_0x240e('0x15e')]=_0x41cd8d[_0x240e('0xc7')];}for(var _0x9eab2 in _0x41cd8d[_0x240e('0x145')]){if(_0x41cd8d[_0x240e('0x145')]['hasOwnProperty'](_0x9eab2)){if(isNotNull(_0x41cd8d[_0x240e('0x145')][_0x9eab2])&&_0x9eab2!=='id'&&_0x9eab2!==_0x240e('0x15f')&&_0x9eab2!==_0x240e('0x160')&&_0x9eab2!==_0x240e('0x161')){_0x276ee0[util['format'](_0x240e('0x162'),'XMD-',_['toUpper'](_0x9eab2))]=_0x41cd8d['Contact'][_0x9eab2];}}}var _0x1419c5=_0x266381[_0x240e('0xca')](_0x4b7826[_0x240e('0x6a')])?getCallerId(_0x4b7826['Trunk']['callerid'],_0x4b7826[_0x240e('0x53')],_0x4b7826['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4b7826[_0x240e('0x54')],_0x4b7826[_0x240e('0x163')]):_0x4b7826[_0x240e('0x54')]):getCallerId(_[_0x240e('0xa2')](_0x4b7826[_0x240e('0x119')])?_0x4b7826[_0x240e('0x6a')][_0x240e('0x164')]:_0x4b7826[_0x240e('0x119')][_0x240e('0x164')],_0x4b7826[_0x240e('0x53')],_0x4b7826['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4b7826['dialOriginateCallerIdNumber'],_0x4b7826[_0x240e('0x163')]):_0x4b7826[_0x240e('0x54')]);if(_0x1419c5){_0x276ee0['XMD-ORIGINATECALLERIDNAME']=_0x266381[_0x240e('0x21')][_0x597ca1][_0x240e('0x165')]=extractCalleridName(_0x1419c5);_0x276ee0[_0x240e('0x166')]=_0x266381['actions'][_0x597ca1][_0x240e('0x167')]=extractCalleridNumber(_0x1419c5);}return ami[_0x240e('0x168')]({'actionid':_0x597ca1,'action':_0x240e('0x143'),'channel':_0x266381['isTrunkReachable'](_0x4b7826[_0x240e('0x6a')])?util[_0x240e('0x6c')](_0x240e('0x169'),_0x4b7826[_0x240e('0x6a')][_0x240e('0x38')],isNotNull(_0x4b7826[_0x240e('0x56')])?_0x4b7826[_0x240e('0x56')][_0x240e('0x16a')]()||'':'',_0x4b7826[_0x240e('0x16b')]>0x0?_0x41cd8d[_0x240e('0x145')][_0x240e('0x146')][_0x240e('0x16c')](_0x4b7826[_0x240e('0x16b')]):_0x41cd8d['Contact'][_0x240e('0x146')]):util[_0x240e('0x6c')]('SIP/%s/%s%s',_['isNil'](_0x4b7826[_0x240e('0x119')])?_0x4b7826[_0x240e('0x6a')][_0x240e('0x38')]:_0x4b7826[_0x240e('0x119')][_0x240e('0x38')],isNotNull(_0x4b7826[_0x240e('0x56')])?_0x4b7826[_0x240e('0x56')]['trim']()||'':'',_0x4b7826[_0x240e('0x16b')]>0x0?_0x41cd8d[_0x240e('0x145')][_0x240e('0x146')]['substring'](_0x4b7826[_0x240e('0x16b')]):_0x41cd8d[_0x240e('0x145')]['phone']),'callerid':_0x1419c5,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x276ee0,'timeout':(_0x4b7826[_0x240e('0x55')]||0x1e)*0x3e8,'async':!![],'channelid':_0x597ca1})[_0x240e('0xae')](function(_0x4be2b3){return _0x4b056b(_0x4be2b3);})[_0x240e('0xac')](function(_0x3c35f3){_0x4b7826[_0x240e('0x5f')]+=0x1;var _0x4ef10f=new History(_0x266381[_0x240e('0x21')][_0x597ca1]);logger[_0x240e('0x8d')](util[_0x240e('0x6c')](_0x240e('0x16d'),JSON['stringify'](_0x3c35f3)));_0x4ef10f[_0x240e('0x9b')]=0xe;_0x4ef10f[_0x240e('0xdc')]='OriginateError';_0x4ef10f[_0x240e('0x9d')]=moment()[_0x240e('0x6c')](_0x240e('0xf1'));_0x4ef10f['endtime']=_0x4ef10f[_0x240e('0x9d')];_0x266381[_0x240e('0xbc')](_0x4ef10f)[_0x240e('0xac')](loggerCatch(_0x240e('0x16e')));_0x266381[_0x240e('0xbb')](_0x4ef10f)[_0x240e('0xac')](loggerCatch(_0x240e('0x16e')))[_0x240e('0x108')](function(){delete _0x266381[_0x240e('0x21')][_0x597ca1];return _0xcd3629(msgResponse(_0x240e('0x143'),_0x240e('0x41'),_0x240e('0x16f')));});});});};Dialer[_0x240e('0x16')][_0x240e('0x2b')]=function(_0x38e3a1){var _0x174d59=this[_0x240e('0x21')][_0x38e3a1['actionid']];var _0x226c04=this;if(_0x174d59){delete this[_0x240e('0x21')][_0x38e3a1['actionid']];_0x174d59[_0x240e('0xf5')]=moment()[_0x240e('0x6c')](_0x240e('0xf1'));var _0x315ab6=_0x174d59[_0x240e('0x47')]===_0x240e('0x6d')?this['campaigns'][_0x174d59[_0x240e('0xa7')]]:this[_0x240e('0x1b')][_0x174d59[_0x240e('0x170')]()];if(!this['isSuccess'](_0x38e3a1[_0x240e('0x171')])){this[_0x240e('0xa6')](_0x315ab6);return this[_0x240e('0x172')](_0x174d59,_0x315ab6,_0x38e3a1)['then'](function(_0x12741f){})['catch'](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0x240e('0x23')][_0x38e3a1['uniqueid']]=_0x174d59;}}};Dialer['prototype'][_0x240e('0x173')]=function(_0x1f381b,_0x1bf820,_0x298fe0){var _0x4f82c5=new History(_0x1bf820);if(_0x4f82c5[_0x240e('0x174')]+_0x4f82c5[_0x240e('0x175')]+_0x4f82c5[_0x240e('0x176')]>=_0x298fe0['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x1f381b){case 0x3:if(_0x4f82c5[_0x240e('0x176')]>=_0x298fe0[_0x240e('0x177')]-0x1){return!![];}else{this[_0x240e('0xb4')]({'active':![],'countnoanswerretry':_0x4f82c5[_0x240e('0x176')]+=0x1,'scheduledat':moment()[_0x240e('0x178')](_0x298fe0[_0x240e('0x179')],'minutes')[_0x240e('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f82c5[_0x240e('0x109')],'ListId':_0x4f82c5['ListId'],'VoiceQueueId':_0x4f82c5[_0x240e('0xc6')]||undefined,'CampaignId':_0x4f82c5[_0x240e('0xc7')]||undefined})[_0x240e('0xac')](loggerCatch(_0x240e('0x17a')));}break;case 0x5:if(_0x4f82c5[_0x240e('0x174')]>=_0x298fe0['dialBusyMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x4f82c5[_0x240e('0x174')]+=0x1,'scheduledat':moment()[_0x240e('0x178')](_0x298fe0['dialBusyRetryFrequency'],_0x240e('0x17b'))[_0x240e('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f82c5['ContactId'],'ListId':_0x4f82c5[_0x240e('0xc4')],'VoiceQueueId':_0x4f82c5[_0x240e('0xc6')]||undefined,'CampaignId':_0x4f82c5[_0x240e('0xc7')]||undefined})[_0x240e('0xac')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x4f82c5[_0x240e('0x175')]>=_0x298fe0[_0x240e('0x17c')]-0x1){return!![];}else{this[_0x240e('0xb4')]({'active':![],'countcongestionretry':_0x4f82c5['countcongestionretry']+=0x1,'scheduledat':moment()[_0x240e('0x178')](_0x298fe0['dialCongestionRetryFrequency'],_0x240e('0x17b'))[_0x240e('0x6c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f82c5[_0x240e('0x109')],'ListId':_0x4f82c5[_0x240e('0xc4')],'VoiceQueueId':_0x4f82c5[_0x240e('0xc6')]||undefined,'CampaignId':_0x4f82c5[_0x240e('0xc7')]||undefined})[_0x240e('0xac')](loggerCatch(_0x240e('0x17d')));}break;default:return!![];}};Dialer['prototype']['callProgressDetecting']=function(_0x409cb4,_0x2151c2,_0x798ba9){var _0x2fce27=this;var _0x5c6a4d=new History(_0x409cb4);return new BPromise(function(_0x1807a8,_0x474680){if(_[_0x240e('0x7c')](_0x2151c2)&&'object'!==typeof _0x2151c2){return _0x474680(msgResponse(_0x240e('0x17e'),_0x240e('0x11e'),_0x240e('0x17f')));}if(_[_0x240e('0x7c')](_0x798ba9)&&_0x240e('0x142')!==typeof _0x798ba9){return _0x474680(msgResponse(_0x240e('0x17e'),'Failure','evt\x20is\x20undefine'));}switch(_0x798ba9[_0x240e('0xea')]){case'0':_0x2151c2['outboundNoSuchCallsDay']+=0x1;_0x5c6a4d[_0x240e('0x9b')]=0x0;_0x5c6a4d[_0x240e('0xdc')]=_0x240e('0x180');_0x2fce27[_0x240e('0xbc')](_0x5c6a4d)[_0x240e('0xac')](loggerCatch(_0x240e('0x181')));if(_0x2fce27[_0x240e('0x173')](0x0,_0x409cb4,_0x2151c2)){if(_0x5c6a4d[_0x240e('0x174')]+_0x5c6a4d[_0x240e('0x175')]+_0x5c6a4d['countnoanswerretry']>=_0x2151c2[_0x240e('0x182')]){_0x2fce27[_0x240e('0x183')](_0x5c6a4d,_0x1807a8,_0x474680,_0x240e('0x184'));}else{_0x2fce27[_0x240e('0x185')](_0x5c6a4d,_0x1807a8,_0x474680,_0x240e('0x184'));}}break;case'3':_0x2151c2[_0x240e('0x5d')]+=0x1;_0x5c6a4d[_0x240e('0x9b')]=0x3;_0x5c6a4d['statedesc']=_0x240e('0x186');_0x5c6a4d[_0x240e('0x176')]+=0x1;_0x5c6a4d['countglobal']+=0x1;_0x2fce27[_0x240e('0xbc')](_0x5c6a4d)['catch'](loggerCatch(_0x240e('0x187')));if(_0x2fce27[_0x240e('0x173')](0x3,_0x409cb4,_0x2151c2)){if(_0x5c6a4d[_0x240e('0x176')]>=_0x2151c2['dialNoAnswerMaxRetry']){_0x2fce27[_0x240e('0x185')](_0x5c6a4d,_0x1807a8,_0x474680,_0x240e('0x188'));}else{_0x2fce27['stateGlobal'](_0x5c6a4d,_0x1807a8,_0x474680,_0x240e('0x188'));}}break;case'5':_0x2151c2[_0x240e('0x59')]+=0x1;_0x5c6a4d[_0x240e('0x9b')]=0x5;_0x5c6a4d['statedesc']=_0x240e('0x189');_0x5c6a4d[_0x240e('0x174')]+=0x1;_0x5c6a4d['countglobal']+=0x1;_0x2fce27['createHistory'](_0x5c6a4d)[_0x240e('0xac')](loggerCatch(_0x240e('0x18a')));if(_0x2fce27[_0x240e('0x173')](0x5,_0x409cb4,_0x2151c2)){if(_0x5c6a4d[_0x240e('0x174')]>=_0x2151c2[_0x240e('0x18b')]){_0x2fce27[_0x240e('0x185')](_0x5c6a4d,_0x1807a8,_0x474680,_0x240e('0x18c'));}else{_0x2fce27[_0x240e('0x183')](_0x5c6a4d,_0x1807a8,_0x474680,'reason\x205\x20busy');}}break;case'8':_0x2151c2['outboundCongestionCallsDay']+=0x1;_0x5c6a4d[_0x240e('0x9b')]=0x8;_0x5c6a4d[_0x240e('0xdc')]=_0x240e('0x18d');_0x5c6a4d['countcongestionretry']+=0x1;_0x5c6a4d[_0x240e('0x18e')]+=0x1;_0x2fce27['createHistory'](_0x5c6a4d)[_0x240e('0xac')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x2fce27[_0x240e('0x173')](0x8,_0x409cb4,_0x2151c2)){if(_0x5c6a4d[_0x240e('0x175')]>=_0x2151c2['dialCongestionMaxRetry']){_0x2fce27[_0x240e('0x185')](_0x5c6a4d,_0x1807a8,_0x474680,_0x240e('0x18f'));}else{_0x2fce27[_0x240e('0x183')](_0x5c6a4d,_0x1807a8,_0x474680,'reason\x208\x20congestion');}}break;default:_0x2151c2[_0x240e('0x62')]+=0x1;_0x5c6a4d['state']=0xc;_0x5c6a4d[_0x240e('0xdc')]=_0x798ba9[_0x240e('0xea')];_0x2fce27['createHistory'](_0x5c6a4d)['catch'](loggerCatch(_0x240e('0x190')));if(_0x2fce27[_0x240e('0x173')](_0x798ba9[_0x240e('0xea')],_0x409cb4,_0x2151c2)){if(_0x5c6a4d[_0x240e('0x174')]+_0x5c6a4d[_0x240e('0x175')]+_0x5c6a4d[_0x240e('0x176')]>=_0x2151c2['dialGlobalMaxRetry']){_0x2fce27[_0x240e('0x183')](_0x5c6a4d,_0x1807a8,_0x474680,_0x798ba9[_0x240e('0xea')]);}else{_0x2fce27[_0x240e('0x185')](_0x5c6a4d,_0x1807a8,_0x474680,_0x798ba9[_0x240e('0xea')]);}}}});};Dialer[_0x240e('0x16')][_0x240e('0x183')]=function(_0x57f468,_0x1f2163,_0x3d9b9e,_0x51b35f){var _0x5588ad=new Final(_0x57f468);_0x5588ad['state']=0xf;_0x5588ad[_0x240e('0xdc')]=_0x240e('0x191');this[_0x240e('0x185')](_0x5588ad,_0x1f2163,_0x3d9b9e,_0x51b35f);};Dialer['prototype']['createStateFinal']=function(_0x2df998,_0x2cbb40,_0x54b2c2,_0x1474de){this['moveContactManagedDialer'](_0x2df998)[_0x240e('0xae')](function(_0x397738){return _0x2cbb40(msgResponse(_0x240e('0x17e'),_0x240e('0xc9'),_0x1474de));})[_0x240e('0xac')](function(_0x1cf400){return _0x54b2c2(msgResponse(_0x240e('0x192'),_0x240e('0x11e'),_0x240e('0x193')));});};Dialer[_0x240e('0x16')]['predictive']=function(_0x5bcba6){var _0x5dc673=this;var _0x1b9024=_0x5bcba6['dialPredictiveOptimizationPercentage']/0x64;var _0x534524=_0x5bcba6['outboundDropCallsDayTimeout']/(_0x5bcba6[_0x240e('0x194')]+_0x5bcba6[_0x240e('0xdb')]);var _0x3bf4c0=Math['round'](_0x5bcba6[_0x240e('0x195')]*(_0x5bcba6['predictiveIntervalMaxThreshold']/0x64));var _0x3b36ce=Math['round'](_0x5bcba6[_0x240e('0x195')]*(_0x5bcba6[_0x240e('0x196')]/0x64));var _0x2d743e=_0x5bcba6[_0x240e('0x95')]+_0x5bcba6[_0x240e('0x4c')];var _0x22cd3d=Math['floor'](_0x5bcba6[_0x240e('0x82')]*_0x5bcba6['erlangAbandonmentRate']*_0x5bcba6[_0x240e('0x197')]*_0x5bcba6[_0x240e('0x198')]);if(_[_0x240e('0x7c')](_0x5bcba6['startProgressive'])){if(!_['isUndefined'](_0x5bcba6[_0x240e('0x24')])){_0x5bcba6[_0x240e('0x24')]=undefined;loggerPredictive[_0x240e('0x8d')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x5bcba6['handlePredictive'])){loggerPredictive[_0x240e('0x8d')](_0x240e('0x199'),_0x240e('0x19a'));clearInterval(_0x5bcba6['handlePredictive']);_0x5bcba6[_0x240e('0x88')]=undefined;}_0x5bcba6[_0x240e('0x25')]=moment()[_0x240e('0x6c')](_0x240e('0xf1'));loggerPredictive['info'](_0x5bcba6[_0x240e('0x38')],_0x240e('0x19b'),_0x5bcba6[_0x240e('0x25')]);this[_0x240e('0x132')](_0x5bcba6,0x1);}else if(ifInterval(_0x5bcba6['dialPredictiveInterval'],_0x5bcba6[_0x240e('0x25')])){this[_0x240e('0x132')](_0x5bcba6,0x1);loggerPredictiveCalls[_0x240e('0x72')](_0x240e('0x19c'),_0x5bcba6[_0x240e('0x25')],_0x5bcba6['name']);_0x5bcba6['erlangCalls']=0x0;_0x5bcba6['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x1b9024<_0x534524&&_0x5bcba6[_0x240e('0x19d')]==='dropRate'){freeVariablesPredictive(_0x5bcba6);loggerPredictive[_0x240e('0x72')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x240e('0x19e'),_0x534524,_0x240e('0x25'),_0x5bcba6[_0x240e('0x38')]);}else if(_0x22cd3d<_0x5bcba6[_0x240e('0xf7')]&&_0x5bcba6[_0x240e('0x19d')]===_0x240e('0x19f')){freeVariablesPredictive(_0x5bcba6);loggerPredictive[_0x240e('0x72')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x240e('0x1a0'),_0x22cd3d,_0x240e('0x1a1'),_0x5bcba6['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x5bcba6[_0x240e('0x38')]);}else if(!ifInterval(_0x5bcba6[_0x240e('0x1a2')],_0x5bcba6[_0x240e('0x25')])&&_[_0x240e('0x7c')](_0x5bcba6[_0x240e('0x24')])&&!_[_0x240e('0x7c')](_0x5bcba6[_0x240e('0x25')])){_0x5bcba6['startPredictive']=moment()['format'](_0x240e('0xf1'));loggerPredictive[_0x240e('0x72')](_0x5bcba6[_0x240e('0x38')],_0x240e('0x1a3'),_0x5bcba6[_0x240e('0x24')]);this[_0x240e('0xb2')](_0x5bcba6[_0x240e('0x1a2')])['then'](this['getDataPredictive'](_0x5bcba6))[_0x240e('0xae')](mergeDataErlangB(_0x5bcba6))[_0x240e('0xae')](this['startMethodPredictive'](_0x5bcba6))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5bcba6));}else if(!ifInterval(_0x5bcba6[_0x240e('0x1a2')],_0x5bcba6[_0x240e('0x24')])){_0x5bcba6[_0x240e('0xf7')]=0x0;_0x5bcba6['startPredictive']=moment()[_0x240e('0x6c')](_0x240e('0xf1'));loggerPredictive[_0x240e('0x72')](_0x5bcba6[_0x240e('0x38')],_0x240e('0x1a4'),_0x5bcba6[_0x240e('0x24')]);clearInterval(_0x5bcba6['handlePredictive']);_0x5bcba6[_0x240e('0x88')]=undefined;this[_0x240e('0xb2')](_0x5bcba6[_0x240e('0x1a2')])[_0x240e('0xae')](this[_0x240e('0x1a5')](_0x5bcba6))[_0x240e('0xae')](mergeDataErlangB(_0x5bcba6))['then'](this[_0x240e('0x1a6')](_0x5bcba6))[_0x240e('0xac')](loggerCatchPredictive(_0x240e('0x1a7'),_0x5bcba6));}else if(_0x5bcba6[_0x240e('0x195')]&&_0x2d743e<_0x5bcba6[_0x240e('0x195')]-_0x3b36ce){freeVariablesPredictive(_0x5bcba6);loggerPredictive[_0x240e('0x72')](_0x5bcba6['name'],_0x240e('0x1a8'),_0x2d743e,_0x240e('0x1a9'),_0x5bcba6[_0x240e('0x195')],'-',_0x3b36ce,'=',_0x5bcba6[_0x240e('0x195')]-_0x3b36ce,')');}else if(_0x5bcba6[_0x240e('0x195')]&&_0x2d743e>_0x5bcba6[_0x240e('0x195')]+_0x3bf4c0){freeVariablesPredictive(_0x5bcba6);loggerPredictive[_0x240e('0x72')](_0x5bcba6[_0x240e('0x38')],_0x240e('0x1a8'),_0x2d743e,')\x20are\x20more\x20than\x20threshold\x20(',_0x5bcba6[_0x240e('0x195')],'+',_0x3bf4c0,'=',_0x5bcba6[_0x240e('0x195')]+_0x3bf4c0,')');}};Dialer['prototype']['getDataPredictive']=function(_0x3c9845){var _0x4990ca=this;return function(_0x21a3cf){return new BPromise(function(_0x4c418d,_0x5e5a0a){_[_0x240e('0x87')](_0x3c9845,_0x21a3cf[0x0]);if(checkGetDataPredictive(_0x21a3cf[0x0])){var _0x5f31dc=_0x3c9845[_0x240e('0x195')]=_0x3c9845[_0x240e('0x4c')]+_0x3c9845['available'];var _0x2ccd24=_0x3c9845['dialPredictiveInterval']*0x3c;var _0x316d01=_0x21a3cf[0x0][_0x240e('0x7b')]+_0x21a3cf[0x0][_0x240e('0x63')];var _0x1ab66d=(_0x21a3cf[0x0][_0x240e('0x76')]+_0x21a3cf[0x0][_0x240e('0xf6')]+_0x21a3cf[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x21a3cf[0x0][_0x240e('0x74')];_0x3c9845['predictiveIntervalHitRate']=_0x1ab66d>0x0?_0x1ab66d:0x1;switch(_0x3c9845[_0x240e('0x19d')]){case _0x240e('0x19f'):var _0x4174b6=_0x3c9845[_0x240e('0x1aa')]/0x64;return _0x4990ca[_0x240e('0x1ab')](_0x5f31dc,_0x2ccd24,_0x316d01,_0x1ab66d,_0x4174b6)[_0x240e('0xae')](function(_0x423c4e){return _0x4c418d(_0x423c4e);});case _0x240e('0x1ac'):var _0x436a4d=_0x3c9845[_0x240e('0x1aa')]/0x64;return _0x4990ca['busyFactor'](_0x5f31dc,_0x2ccd24,_0x316d01,_0x1ab66d,_0x436a4d)[_0x240e('0xae')](function(_0x1db950){return _0x4c418d(_0x1db950);});default:return _0x5e5a0a(msgResponse(_0x240e('0x1ad'),_0x240e('0x11e'),_0x240e('0x1ae')));}}else{return _0x5e5a0a(msgResponse('[getDataPredictive]',_0x240e('0x11e'),_0x240e('0x1af')));}});};};Dialer[_0x240e('0x16')]['getDataPredictiveOld']=function(_0xe98917){var _0x38981a=this;return function(_0x21be0f){return new BPromise(function(_0x575ae7,_0x4f0ec6){_[_0x240e('0x87')](_0xe98917,_0x21be0f[0x0]);if(checkGetDataPredictive(_0x21be0f[0x0])){loggerPredictive[_0x240e('0x72')](JSON[_0x240e('0x42')](_0x21be0f[0x0]));if(_0xe98917[_0x240e('0x19d')]===_0x240e('0x19f')){return _0x38981a[_0x240e('0xb9')](_0xe98917['id'])[_0x240e('0xae')](function(_0x2b0fb5){var _0x16e2ec=_0xe98917[_0x240e('0x138')]-_0x2b0fb5[0x0][_0x240e('0x1b0')];var _0x1c07ac=_0xe98917[_0x240e('0x1a2')]*0x3c;var _0x49309f=_0x21be0f[0x0][_0x240e('0x7b')]+_0x21be0f[0x0][_0x240e('0x63')];var _0x1dd873=(_0x21be0f[0x0][_0x240e('0x76')]+_0x21be0f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x21be0f[0x0][_0x240e('0x64')])/_0x21be0f[0x0]['predictiveIntervalTotalCalls'];var _0x215180=_0xe98917['dialPredictiveOptimizationPercentage']/0x64;_0xe98917[_0x240e('0x66')]=_0x2b0fb5[0x0][_0x240e('0x1b0')]||0x0;_0xe98917[_0x240e('0x197')]=_0x1dd873>0x0?_0x1dd873:0x1;return _0x38981a['abandonmentRate'](_0x16e2ec,_0x1c07ac,_0x49309f,_0x1dd873,_0x215180);})[_0x240e('0xae')](function(_0x46db38){return _0x575ae7(_0x46db38);})[_0x240e('0xac')](function(_0x45d6ad){return _0x4f0ec6(msgResponse(_0x240e('0x1b1'),_0x240e('0x11e'),JSON['stringify'](_0x45d6ad)));});}if(_0xe98917[_0x240e('0x19d')]==='agentBusyFactor'){return _0x38981a[_0x240e('0xb9')](_0xe98917['id'])[_0x240e('0xae')](function(_0x3f8ea8){var _0x361057=_0xe98917[_0x240e('0x138')]-_0x3f8ea8[0x0][_0x240e('0x1b0')];var _0x3a9024=_0xe98917[_0x240e('0x1a2')]*0x3c;var _0x4d1ac2=_0x21be0f[0x0]['predictiveIntervalAvgTalktime']+_0x21be0f[0x0][_0x240e('0x63')];var _0x56591c=(_0x21be0f[0x0]['predictiveIntervalAnsweredCalls']+_0x21be0f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x21be0f[0x0][_0x240e('0x64')])/_0x21be0f[0x0][_0x240e('0x74')];var _0x5538b8=_0xe98917[_0x240e('0x1aa')]/0x64;_0xe98917[_0x240e('0x66')]=_0x3f8ea8[0x0][_0x240e('0x1b0')]||0x0;_0xe98917[_0x240e('0x197')]=_0x56591c>0x0?_0x56591c:0x1;return _0x38981a[_0x240e('0x1b2')](_0x361057,_0x3a9024,_0x4d1ac2,_0x56591c,_0x5538b8);})['then'](function(_0x35b2c8){return _0x575ae7(_0x35b2c8);})['catch'](function(_0x1ccde0){return _0x4f0ec6(msgResponse(_0x240e('0x1b1'),_0x240e('0x11e'),JSON[_0x240e('0x42')](_0x1ccde0)));});}}else{return _0x4f0ec6(msgResponse('[getDataPredictive]','Failure',_0x240e('0x1af')));}});};};Dialer[_0x240e('0x16')][_0x240e('0x1a6')]=function(_0xeb55c1){var _0x1796cc=this;return function(){var _0x50a77e=0x0;var _0x43d770=Math['floor'](_0xeb55c1['erlangCallToSecond']*0x3e8);if(_0x43d770>0x0){_0x43d770=_0x43d770<0x64?0x64:_0x43d770;loggerPredictive[_0x240e('0x72')](_0xeb55c1[_0x240e('0x38')],_0x240e('0x1b3'),_0x43d770,_0x240e('0x43'));_0xeb55c1['handlePredictive']=setInterval(function(){_0x1796cc[_0x240e('0x88')](_0xeb55c1);loggerPredictiveCalls[_0x240e('0x72')](_0x240e('0x1b4'),_0x50a77e+=0x1);},_0x43d770);}else{loggerPredictive[_0x240e('0x72')](_0xeb55c1['name'],_0x240e('0x1b5'));}};};Dialer[_0x240e('0x16')][_0x240e('0x1b6')]=function(_0x50ea7e,_0x2dacb2){var _0x4e4ecb=this;return function(_0x3d31eb){if(_['isEmpty'](_0x3d31eb)){if(_[_0x240e('0xa2')](_0x2dacb2[_0x240e('0xc5')])||!_0x2dacb2[_0x240e('0x1b7')]){if(_0x50ea7e[_0x240e('0x52')]==='booked'){_0x50ea7e[_0x240e('0x105')]=_[_0x240e('0x7c')](_0x50ea7e[_0x240e('0x105')])?!![]:_0x50ea7e[_0x240e('0x105')];var _0x3dfef6=uuid['v4']();_0x4e4ecb[_0x240e('0x21')][_0x3dfef6]=new Action(_0x50ea7e,_0x2dacb2,_0x3dfef6);loggerBooked[_0x240e('0x72')](_0x240e('0x1b8'),_0x3dfef6,_0x240e('0x1b9'),JSON[_0x240e('0x42')](_0x50ea7e[_0x240e('0x105')]),_0x240e('0x1ba'),_0x50ea7e['name']);if(_0x50ea7e[_0x240e('0x105')]){_0x50ea7e[_0x240e('0x105')]=![];_0x4e4ecb[_0x240e('0x100')][_0x4e4ecb[_0x240e('0x21')][_0x3dfef6][_0x240e('0xa7')]]=[];ami[_0x240e('0x168')]({'actionid':_0x3dfef6,'action':_0x240e('0x1bb'),'queue':_0x50ea7e[_0x240e('0x38')]})['catch'](function(_0x100e88){_0x4e4ecb[_0x240e('0xa6')](_0x50ea7e);_0x4e4ecb[_0x240e('0xb4')]({'active':![],'ContactId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6]['ContactId'],'ListId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6][_0x240e('0xc4')],'VoiceQueueId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6][_0x240e('0xc6')]||undefined,'CampaignId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6][_0x240e('0xc7')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4e4ecb[_0x240e('0x21')][_0x3dfef6];});}else{loggerBooked['info'](_0x240e('0x1bc'),JSON[_0x240e('0x42')](_0x50ea7e[_0x240e('0x105')]),'Queue:\x20',_0x50ea7e['name']);_0x4e4ecb[_0x240e('0xa6')](_0x50ea7e);_0x4e4ecb['rescheduleContact']({'active':![],'ContactId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6][_0x240e('0x109')],'ListId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6][_0x240e('0xc4')],'VoiceQueueId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6][_0x240e('0xc6')]||undefined,'CampaignId':_0x4e4ecb[_0x240e('0x21')][_0x3dfef6]['CampaignId']||undefined})[_0x240e('0xac')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x4e4ecb['actions'][_0x3dfef6];}}else{return _0x4e4ecb[_0x240e('0x1bd')](_0x50ea7e,_0x2dacb2);}}else{if(getDiff(_0x2dacb2[_0x240e('0x1be')])<_0x50ea7e[_0x240e('0x1bf')]*0x3c){_0x4e4ecb[_0x240e('0x1a')][_0x240e('0x112')](_0x2dacb2['id'])[_0x240e('0x108')](function(){_0x4e4ecb[_0x240e('0xa6')](_0x50ea7e);});}else{_0x50ea7e[_0x240e('0x60')]+=0x1;_0x4e4ecb[_0x240e('0xa6')](_0x50ea7e);if(_0x50ea7e[_0x240e('0x1c0')]){_0x4e4ecb[_0x240e('0xb4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2dacb2[_0x240e('0x109')],'ListId':_0x2dacb2['ListId'],'VoiceQueueId':_0x2dacb2[_0x240e('0xc6')]||undefined,'CampaignId':_0x2dacb2[_0x240e('0xc7')]||undefined})[_0x240e('0xac')](loggerCatch(_0x240e('0x1c1')));_0x4e4ecb['createHistory'](createObjHistory(_0x50ea7e,_0x2dacb2,_0x240e('0x1c2'),0x17,'RecallInQueue'))[_0x240e('0xac')](loggerCatch(_0x240e('0x1c3')));}else{_0x4e4ecb['saveInDb'](createObjHistory(_0x50ea7e,_0x2dacb2,_0x240e('0x1c4'),0x16,_0x240e('0x1c5')),_0x240e('0x1c6'),_0x240e('0x1c7'));}}}}else{_0x50ea7e[_0x240e('0x58')]+=0x1;_0x4e4ecb[_0x240e('0xc3')](createObjHistory(_0x50ea7e,_0x2dacb2,_0x240e('0x1c8'),0xd,_0x240e('0x1c9')),_0x240e('0x1ca'),_0x240e('0x1cb'));throw _0x240e('0x1cc');}};};Dialer[_0x240e('0x16')][_0x240e('0x1cd')]=function(_0x423915){var _0x31f5b5=this;var _0x193e67=[];var _0x15dca8=_0x423915[_0x240e('0x1ce')]-_0x423915[_0x240e('0x67')]-_0x423915[_0x240e('0x1cf')];emitCampaignSummary(_0x423915);if(_0x15dca8>0x0){if(_0x15dca8>this[_0x240e('0x1f')]){_0x15dca8=this[_0x240e('0x1f')];}_0x423915['temp']+=_0x15dca8;this[_0x240e('0xb8')](_0x423915['id'],_0x15dca8,_0x423915[_0x240e('0x1d0')])[_0x240e('0xae')](function(_0x55f0c0){_0x423915[_0x240e('0x1cf')]-=_0x15dca8;_0x423915[_0x240e('0x1cf')]=_0x423915[_0x240e('0x1cf')]>0x0?_0x423915[_0x240e('0x1cf')]:0x0;if(!checkContactEmpty(_0x55f0c0)){_0x423915['message']=_0x240e('0x1d1');logger[_0x240e('0x72')](_0x240e('0x1d2')+_0x423915[_0x240e('0x38')]);}else{_0x423915['originated']+=_0x55f0c0[_0x240e('0x10c')];_0x423915[_0x240e('0x3a')]=_0x240e('0x1d3');for(var _0x12a376=0x0;_0x12a376<_0x55f0c0[_0x240e('0x10c')];_0x12a376+=0x1){_0x423915[_0x240e('0x1d4')]+=0x1;if(_[_0x240e('0xa2')](_0x55f0c0[_0x12a376])||_[_0x240e('0xa2')](_0x55f0c0[_0x12a376]['Contact'])||_[_0x240e('0xa2')](_0x55f0c0[_0x12a376][_0x240e('0x145')][_0x240e('0x146')])){_0x31f5b5['emptyContact'](_0x240e('0x1d5'),_0x423915,_0x55f0c0[_0x12a376]);}else{_0x31f5b5[_0x240e('0xb0')](_['pick'](_0x55f0c0[_0x12a376],['CampaignId','Contact.phone']))[_0x240e('0xae')](_0x31f5b5['checkContactBlack'](_0x423915,_0x55f0c0[_0x12a376]))[_0x240e('0xac')](_0x31f5b5[_0x240e('0xc0')](_0x240e('0x1d6'),_0x423915));}}}})[_0x240e('0xac')](loggerGetContactDialer(_0x240e('0x1d7'),_0x423915,_0x15dca8));}};Dialer['prototype'][_0x240e('0x132')]=function(_0x2b0645,_0x568ac1){var _0x581c2f=this;var _0x1c1650=[];var _0x1b2b0c=_0x568ac1>=0x1?_0x568ac1:0x1;var _0xa15785=[];if(_0x2b0645[_0x240e('0x52')]===_0x240e('0x134')){_0x1b2b0c=0x1;}var _0x1ab69d=Math[_0x240e('0x1d8')](_0x2b0645[_0x240e('0x95')]*_0x1b2b0c)-_0x2b0645[_0x240e('0x67')]-_0x2b0645[_0x240e('0x1cf')];emitVoiceQueueSummary(_0x2b0645);if(_0x2b0645['dialLimitQueue']>0x0){var _0xae0c05=_0x2b0645[_0x240e('0x1d9')]-_0x2b0645[_0x240e('0x67')]-_0x2b0645[_0x240e('0x4c')]-_0x2b0645[_0x240e('0x1cf')]-_0x2b0645[_0x240e('0x49')];if(_0x1ab69d>_0xae0c05){_0x1ab69d=_0xae0c05;}}if(_0x1ab69d>0x0){if(_0x2b0645[_0x240e('0x52')]===_0x240e('0x134')){_0x1ab69d=0x1;}if(_0x1ab69d>this[_0x240e('0x1f')]){_0x1ab69d=this['maxNumberOriginate'];}_0x2b0645[_0x240e('0x1cf')]+=_0x1ab69d;for(var _0x597540 in this['agents']){if(this[_0x240e('0x1d')][_0x240e('0x8f')](_0x597540)){if(this[_0x240e('0x1d')][_0x597540][_0x240e('0x9b')]===_0x240e('0x1da')&&this[_0x240e('0x1d')][_0x597540][_0x240e('0xa3')]===_0x240e('0xcc')){_0x1c1650[_0x240e('0x101')](this[_0x240e('0x1d')][_0x597540]['id']);}}}this[_0x240e('0xb6')](_0x2b0645['id'],_0x1c1650,_0x1ab69d,_0x2b0645['dialOrderByScheduledAt'])[_0x240e('0xae')](function(_0x4e2cc2){_0x2b0645[_0x240e('0x1cf')]-=_0x1ab69d;_0x2b0645[_0x240e('0x1cf')]=_0x2b0645[_0x240e('0x1cf')]>0x0?_0x2b0645[_0x240e('0x1cf')]:0x0;if(!checkContactEmpty(_0x4e2cc2)){_0x581c2f[_0x240e('0xaa')](_0x2b0645)['then'](sendMessageReschedule(_0x2b0645))[_0x240e('0xac')](loggerCatch(_0x240e('0x1db')));}else{_0x2b0645['originated']+=_0x4e2cc2[_0x240e('0x10c')];_0x2b0645[_0x240e('0x3a')]=_0x2b0645['dialMethod']===_0x240e('0x134')?_0x240e('0x14d'):_0x240e('0x1d3');for(var _0x4be650=0x0;_0x4be650<_0x4e2cc2[_0x240e('0x10c')];_0x4be650+=0x1){if(_[_0x240e('0xa2')](_0x4e2cc2[_0x4be650])||_[_0x240e('0xa2')](_0x4e2cc2[_0x4be650][_0x240e('0x145')])||_[_0x240e('0xa2')](_0x4e2cc2[_0x4be650][_0x240e('0x145')][_0x240e('0x146')])){_0x581c2f[_0x240e('0xc1')]('[actionOriginate]\x20',_0x2b0645,_0x4e2cc2[_0x4be650]);}else{_0x581c2f[_0x240e('0xad')](_[_0x240e('0x102')](_0x4e2cc2[_0x4be650],[_0x240e('0xc6'),_0x240e('0x1dc')]))[_0x240e('0xae')](_0x581c2f['checkContactBlack'](_0x2b0645,_0x4e2cc2[_0x4be650]))[_0x240e('0xac')](_0x581c2f[_0x240e('0xc0')](_0x240e('0x1d5'),_0x2b0645));}}}})[_0x240e('0xac')](loggerGetContactDialer(_0x240e('0x1dd'),_0x2b0645,_0x1ab69d));}};Dialer[_0x240e('0x16')][_0x240e('0x88')]=function(_0x568f97){var _0x3ca892=this;if(_0x568f97[_0x240e('0x1d9')]>0x0){var _0xbfdb8f=_0x568f97[_0x240e('0x1d9')]-_0x568f97[_0x240e('0x67')]-_0x568f97[_0x240e('0x4c')];if(_0xbfdb8f>0x0){this[_0x240e('0x1de')](_0x568f97);}else{loggerPredictiveCalls[_0x240e('0x72')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x568f97);}};Dialer['prototype'][_0x240e('0x1de')]=function(_0x1182f6){var _0x5eceb9=this;var _0x6c7ada=[];_0x1182f6['originated']+=0x1;for(var _0x533064 in this[_0x240e('0x1d')]){if(this[_0x240e('0x1d')][_0x240e('0x8f')](_0x533064)){if(this[_0x240e('0x1d')][_0x533064][_0x240e('0x9b')]===_0x240e('0x1da')&&this[_0x240e('0x1d')][_0x533064][_0x240e('0xa3')]===_0x240e('0xcc')){_0x6c7ada[_0x240e('0x101')](this['agents'][_0x533064]['id']);}}}this[_0x240e('0xb6')](_0x1182f6['id'],_0x6c7ada,0x1,_0x1182f6[_0x240e('0x1d0')])[_0x240e('0xae')](function(_0x3f7916){if(!checkContactEmpty(_0x3f7916)){checkContactLowerLimitOriginate(_0x1182f6,0x1,0x0);_0x5eceb9[_0x240e('0xaa')](_0x1182f6)[_0x240e('0xae')](sendMessageReschedule(_0x1182f6))[_0x240e('0xac')](loggerCatch('[countReScheduled]\x20'));}else{_0x1182f6[_0x240e('0x3a')]=_0x240e('0x1d3');if(_[_0x240e('0xa2')](_0x3f7916[0x0])||_[_0x240e('0xa2')](_0x3f7916[0x0]['Contact'])||_[_0x240e('0xa2')](_0x3f7916[0x0][_0x240e('0x145')][_0x240e('0x146')])){_0x5eceb9[_0x240e('0xc1')]('[actionOriginate]\x20',_0x1182f6,_0x3f7916[0x0]);}else{_0x5eceb9['checkIsBlackList'](_[_0x240e('0x102')](_0x3f7916[0x0],[_0x240e('0xc6'),_0x240e('0x1dc')]))[_0x240e('0xae')](_0x5eceb9[_0x240e('0x1b6')](_0x1182f6,_0x3f7916[0x0]))['catch'](_0x5eceb9[_0x240e('0xc0')](_0x240e('0x1df'),_0x1182f6));}}})['catch'](loggerGetContactDialer(_0x240e('0x1e0'),_0x1182f6,0x1));emitVoiceQueueSummary(_0x1182f6);};Dialer[_0x240e('0x16')][_0x240e('0x1ab')]=function(_0xf6c49a,_0x5d35e8,_0x380b76,_0x1a84a0,_0x5be89e,_0x487ecd){loggerPredictive[_0x240e('0x72')](_0x240e('0x1e1'));loggerPredictive[_0x240e('0x72')](_0x240e('0x1e2'),_0xf6c49a);loggerPredictive[_0x240e('0x72')](_0x240e('0x1e3'),_0x5d35e8);loggerPredictive[_0x240e('0x72')](_0x240e('0x1e4'),_0x380b76);loggerPredictive[_0x240e('0x72')](_0x240e('0x1e5'),_0x1a84a0);loggerPredictive[_0x240e('0x72')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5be89e);loggerPredictive[_0x240e('0x72')](_0x240e('0x86'));return new BPromise(function(_0x1e0173,_0x5f09c1){if(_0xf6c49a<=0x0||isNaN(_0xf6c49a)){return _0x5f09c1(msgResponse('[abandonmentRate]','Error',_0x240e('0x1e6')+_0xf6c49a));}if(_0x380b76<=0x0||isNaN(_0x380b76)){return _0x5f09c1(msgResponse(_0x240e('0x1e7'),_0x240e('0x41'),_0x240e('0x1e8')+_0x380b76));}if(_0x1a84a0<=0x0||isNaN(_0x1a84a0)){return _0x5f09c1(msgResponse(_0x240e('0x1e7'),_0x240e('0x41'),'p\x20=\x20'+_0x1a84a0));}if(_0x5d35e8<=0x0||isNaN(_0x5d35e8)){return _0x5f09c1(msgResponse('[abandonmentRate]',_0x240e('0x41'),'interval\x20=\x20'+_0x5d35e8));}if(_0x5be89e<=0x0||isNaN(_0x5be89e)){return _0x5f09c1(msgResponse(_0x240e('0x1e7'),_0x240e('0x41'),_0x240e('0x1e9')+_0x5be89e));}_0x487ecd=_0x487ecd||0x0;var _0x7da2de=0x1/_0x380b76;var _0x12551e=0x0;var _0x2322c9=0x0;var _0x25989b=0x0;var _0x36e805=0x0;for(var _0x5e23d1=0x0;_0x25989b<_0x5be89e;_0x5e23d1+=0x1){_0x2322c9=_0x5e23d1/_0x5d35e8;_0x12551e=(_0x1a84a0*_0x2322c9+_0x487ecd)/_0x7da2de;_0x25989b=erlangb(_0x12551e,_0xf6c49a);_0x36e805=_0x12551e/_0xf6c49a*(0x1-erlangb(_0x12551e,_0xf6c49a));}return _0x1e0173({'erlangCalls':_0x5e23d1,'erlangCallToSecond':_0x5d35e8/_0x5e23d1,'erlangAbandonmentRate':_0x25989b,'erlangBusyFactor':_0x36e805});});};Dialer['prototype'][_0x240e('0x1b2')]=function(_0x84d167,_0x319b50,_0x2863da,_0x1b7fe0,_0x5d7dab,_0x1c1409){loggerPredictive['info'](_0x240e('0x1ea'));loggerPredictive[_0x240e('0x72')](_0x240e('0x1e2'),_0x84d167);loggerPredictive[_0x240e('0x72')](_0x240e('0x1e3'),_0x319b50);loggerPredictive[_0x240e('0x72')](_0x240e('0x1e4'),_0x2863da);loggerPredictive['info'](_0x240e('0x1e5'),_0x1b7fe0);loggerPredictive[_0x240e('0x72')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d7dab);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x556add,_0x1960ce){if(_0x84d167<=0x0||isNaN(_0x84d167)){return _0x1960ce(msgResponse('[busyFactor]',_0x240e('0x41'),_0x240e('0x1e6')+_0x84d167));}if(_0x2863da<=0x0||isNaN(_0x2863da)){return _0x1960ce(msgResponse(_0x240e('0x1eb'),_0x240e('0x41'),'Ts\x20=\x20'+_0x2863da));}if(_0x1b7fe0<=0x0||isNaN(_0x1b7fe0)){return _0x1960ce(msgResponse('[busyFactor]',_0x240e('0x41'),_0x240e('0x1ec')+_0x1b7fe0));}if(_0x319b50<=0x0||isNaN(_0x319b50)){return _0x1960ce(msgResponse(_0x240e('0x1eb'),_0x240e('0x41'),'interval\x20=\x20'+_0x319b50));}if(_0x5d7dab<=0x0||isNaN(_0x5d7dab)){return _0x1960ce(msgResponse(_0x240e('0x1eb'),'Error',_0x240e('0x1ed')+_0x5d7dab));}_0x1c1409=_0x1c1409||0x0;var _0x44afe2=0x1/_0x2863da;var _0xbdab3d=0x0;var _0x41ef0e=0x0;var _0x3bba16=0x0;var _0x2f72f4=0x0;for(var _0x494a7d=0x0;_0x2f72f4<_0x5d7dab;_0x494a7d+=0x1){_0x41ef0e=_0x494a7d/_0x319b50;_0xbdab3d=(_0x1b7fe0*_0x41ef0e+_0x1c1409)/_0x44afe2;_0x3bba16=erlangb(_0xbdab3d,_0x84d167);_0x2f72f4=_0xbdab3d/_0x84d167*(0x1-erlangb(_0xbdab3d,_0x84d167));}return _0x556add({'erlangCalls':_0x494a7d,'erlangCallToSecond':_0x319b50/_0x494a7d,'erlangAbandonmentRate':_0x3bba16,'erlangBusyFactor':_0x2f72f4});});};module[_0x240e('0x1ee')]=Dialer; \ No newline at end of file +var _0xdf70=['[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','agiafterat','queueCallerAbandonCreateState','predictiveIntervalDroppedCallsCallersExit','Abandoned','dropreason','CALLEREXIT','roundrobin','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','ListId','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock2]','[booked][unlock3]','loopCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','\x5cw{0,','pow','match','object','originate','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','%s%s','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','substring','OriginateError','[originate][error]','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialNoAnswerMaxRetry','add','minutes','[rescheduleContact][NoAnswer]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','[syncAgentComplete][createHistory][0]','dialGlobalMaxRetry','stateGlobal','createStateFinal','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','[syncAgentComplete][createHistory][8]','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','Max\x20Drop\x20','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','check\x20failure','erlangCallToSecond','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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]','interval\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','predictive','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./history','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangBusyFactor','Trunk','active','callerid','format','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\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','seconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','pick','ContactId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','reachable','SIP/%s','unmonitored','saveInDb','moveContactManagedDialer','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','state','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]'];(function(_0x3d3cb3,_0x28c7f0){var _0x2393c1=function(_0x53d716){while(--_0x53d716){_0x3d3cb3['push'](_0x3d3cb3['shift']());}};_0x2393c1(++_0x28c7f0);}(_0xdf70,0xfc));var _0x0df7=function(_0x455a6e,_0x46a422){_0x455a6e=_0x455a6e-0x0;var _0x398121=_0xdf70[_0x455a6e];return _0x398121;};'use strict';var util=require(_0x0df7('0x0'));var _=require(_0x0df7('0x1'));var BPromise=require(_0x0df7('0x2'));var uuid=require('uuid');var moment=require(_0x0df7('0x3'));var rr=require('rr');var md5=require(_0x0df7('0x4'));var Redis=require(_0x0df7('0x5'));var config=require(_0x0df7('0x6'));var logger=require(_0x0df7('0x7'))(_0x0df7('0x8'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x0df7('0x7'))(_0x0df7('0x9'));var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x0df7('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0x0df7('0xa')]=_['defaults'](config[_0x0df7('0xa')],{'host':_0x0df7('0xb'),'port':0x18eb});var io=require(_0x0df7('0xc'))(new Redis(config['redis']));var cmHopper=require(_0x0df7('0xd'));var cmHopperFinal=require(_0x0df7('0xe'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x0df7('0xf'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x0df7('0x10'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x0df7('0x11'));var Hangup=require(_0x0df7('0x12'));var ipAgi=process[_0x0df7('0x13')][_0x0df7('0x14')]||_0x0df7('0x15');var strategy={'rrmemory':_0x0df7('0x16'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x0df7('0x17')][_0x0df7('0x18')]=function(_0x493bc7){this[_0x0df7('0x19')]=this[_0x0df7('0x19')]?this[_0x0df7('0x19')][_0x0df7('0x1a')](_0x493bc7):_0x493bc7();};function Dialer(_0xa66206,_0x20f039){this[_0x0df7('0x1b')]=new Sequence();this['preview']=_0x20f039;this[_0x0df7('0x1c')]=_0xa66206[_0x0df7('0x1c')];this['campaigns']=_0xa66206[_0x0df7('0x1d')];this[_0x0df7('0x1e')]=_0xa66206['agents'];this[_0x0df7('0x1f')]=_0xa66206[_0x0df7('0x1f')];this[_0x0df7('0x20')]=config[_0x0df7('0x20')]||0x2;this[_0x0df7('0x21')]={};this[_0x0df7('0x22')]={};this[_0x0df7('0x23')]={};this[_0x0df7('0x24')]={};this['optionPredictive']={};this[_0x0df7('0x25')]={};this[_0x0df7('0x26')]={};this[_0x0df7('0x27')]={};this[_0x0df7('0x28')]={};this[_0x0df7('0x29')]={};ami['on'](_0x0df7('0x2a'),this[_0x0df7('0x2b')][_0x0df7('0x2c')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x2d'),this[_0x0df7('0x2e')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x2f'),this[_0x0df7('0x30')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x31'),this[_0x0df7('0x32')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x33'),this[_0x0df7('0x34')]['bind'](this));ami['on'](_0x0df7('0x35'),this[_0x0df7('0x36')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x37'),this[_0x0df7('0x38')][_0x0df7('0x2c')](this));ami['on'](_0x0df7('0x39'),this[_0x0df7('0x3a')]['bind'](this));ami['on'](_0x0df7('0x3b'),this[_0x0df7('0x3c')][_0x0df7('0x2c')](this));this['loopCampaigns']();this[_0x0df7('0x3d')]();}function isNotNull(_0x1fff2b){return _0x1fff2b!==null&&!_[_0x0df7('0x3e')](_0x1fff2b);}function checkIsLoggedIn(_0x3f8a64,_0x2ab4d9){return function(){if(_0x2ab4d9<=0x0){_0x3f8a64[_0x0df7('0x3f')]='AGENTS_NOT_LOGGED';throw _0x3f8a64[_0x0df7('0x40')]+_0x0df7('0x41');}};}function isActive(_0x4cee7c){return _0x4cee7c;}function checkIsActive(_0x4a0221,_0x476e59){return function(){if(!isActive(_0x476e59)){_0x4a0221[_0x0df7('0x3f')]=_0x0df7('0x42');throw _0x4a0221[_0x0df7('0x40')]+_0x0df7('0x43');}};}function checkInterval(_0x1ea0eb){return function(){if(!isNotNull(_0x1ea0eb[_0x0df7('0x44')])){_0x1ea0eb['message']=_0x0df7('0x45');throw _0x1ea0eb[_0x0df7('0x40')]+_0x0df7('0x46');}if(!isNotNull(_0x1ea0eb[_0x0df7('0x44')][_0x0df7('0x47')])){_0x1ea0eb[_0x0df7('0x3f')]=_0x0df7('0x45');throw _0x1ea0eb[_0x0df7('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x0df7('0x48')](_0x1ea0eb[_0x0df7('0x44')]['Intervals']))){_0x1ea0eb[_0x0df7('0x3f')]=_0x0df7('0x45');throw _0x1ea0eb[_0x0df7('0x40')]+_0x0df7('0x46');}};}function msgResponse(_0x3f0633,_0x1b5da7,_0x5ac2e4){return{'action':_0x3f0633,'response':_0x1b5da7,'message':_0x5ac2e4,'stack':_0x5ac2e4};}function myreject(_0x51d0a3){return function(_0x2c5458){return _0x51d0a3(msgResponse(_0x0df7('0x49'),_0x0df7('0x4a'),JSON[_0x0df7('0x4b')](_0x2c5458)));};}function getSeconds(_0x2b7da0,_0x285d6b){var _0x23ed8e=moment(_0x2b7da0)[_0x0df7('0x4c')](0x0);var _0x2eb747=moment(_0x285d6b)[_0x0df7('0x4c')](0x0);return _0x23ed8e[_0x0df7('0x4d')](_0x2eb747,'seconds');}function emit(_0x2c4737,_0x2520d8,_0x3ab167){io['to'](_0x2c4737)[_0x0df7('0x4e')](_0x2520d8,_0x3ab167);}function emitVoiceQueueSummary(_0x3cb05a){if(_0x3cb05a[_0x0df7('0x4f')]===_0x0df7('0x50')){var _0x1d5121={'id':_0x3cb05a['id'],'name':_0x3cb05a[_0x0df7('0x40')],'strategy':_0x3cb05a[_0x0df7('0x51')],'answered':_0x3cb05a[_0x0df7('0x52')],'available':_0x3cb05a[_0x0df7('0x53')],'loggedIn':_0x3cb05a[_0x0df7('0x54')],'pTalking':_0x3cb05a[_0x0df7('0x55')],'sumBillable':_0x3cb05a[_0x0df7('0x56')],'sumDuration':_0x3cb05a[_0x0df7('0x57')],'sumHoldTime':_0x3cb05a[_0x0df7('0x58')]||0x0,'talking':_0x3cb05a['talking'],'total':_0x3cb05a[_0x0df7('0x59')],'type':_0x3cb05a[_0x0df7('0x4f')],'unmanaged':_0x3cb05a['unmanaged'],'abandoned':_0x3cb05a[_0x0df7('0x5a')],'waiting':_0x3cb05a[_0x0df7('0x5b')],'loggedInDb':_0x3cb05a[_0x0df7('0x5c')],'dialActive':_0x3cb05a[_0x0df7('0x5d')],'dialMethod':_0x3cb05a[_0x0df7('0x5e')],'dialOriginateCallerIdName':_0x3cb05a[_0x0df7('0x5f')],'dialOriginateCallerIdNumber':_0x3cb05a[_0x0df7('0x60')],'dialOriginateTimeout':_0x3cb05a[_0x0df7('0x61')],'dialPrefix':_0x3cb05a['dialPrefix'],'outboundAnswerAgiCallsDay':_0x3cb05a[_0x0df7('0x62')],'outboundAnswerCallsDay':_0x3cb05a[_0x0df7('0x63')],'outboundBlacklistCallsDay':_0x3cb05a['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x3cb05a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x3cb05a['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3cb05a['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x3cb05a[_0x0df7('0x64')],'outboundDropCallsDayTimeout':_0x3cb05a['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x3cb05a[_0x0df7('0x65')],'outboundNoSuchCallsDay':_0x3cb05a['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x3cb05a[_0x0df7('0x66')],'outboundReCallsDay':_0x3cb05a[_0x0df7('0x67')],'outboundRejectCallsDay':_0x3cb05a['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x3cb05a[_0x0df7('0x68')],'predictiveIntervalAnsweredCalls':_0x3cb05a[_0x0df7('0x69')],'predictiveIntervalAvgHoldtime':_0x3cb05a['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x3cb05a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3cb05a['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x3cb05a[_0x0df7('0x6a')],'predictiveIntervalErlangCalls':_0x3cb05a[_0x0df7('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x3cb05a[_0x0df7('0x6c')],'predictiveIntervalHitRate':_0x3cb05a[_0x0df7('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x3cb05a['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x3cb05a[_0x0df7('0x6e')],'predictiveIntervalAvailable':_0x3cb05a[_0x0df7('0x6f')],'predictiveIntervalTotalCalls':_0x3cb05a[_0x0df7('0x70')],'message':_0x3cb05a['message'],'originated':_0x3cb05a[_0x0df7('0x71')],'erlangCalls':_0x3cb05a['erlangCalls'],'erlangCallToSecond':_0x3cb05a['erlangCallToSecond'],'erlangAbandonmentRate':_0x3cb05a['erlangAbandonmentRate'],'erlangBusyFactor':_0x3cb05a[_0x0df7('0x72')],'startPredictive':_0x3cb05a[_0x0df7('0x25')],'startProgressive':_0x3cb05a['startProgressive']};if(_0x3cb05a['Trunk']){_0x1d5121['Trunk']={'id':_0x3cb05a[_0x0df7('0x73')]['id'],'name':_0x3cb05a[_0x0df7('0x73')][_0x0df7('0x40')],'active':_0x3cb05a[_0x0df7('0x73')][_0x0df7('0x74')],'callerid':_0x3cb05a[_0x0df7('0x73')][_0x0df7('0x75')]};}if(_0x3cb05a[_0x0df7('0x44')]){_0x1d5121[_0x0df7('0x44')]={'id':_0x3cb05a['Interval']['id'],'name':_0x3cb05a['Interval'][_0x0df7('0x40')]};}var _0x56bb48=md5(JSON[_0x0df7('0x4b')](_0x1d5121));if(_0x3cb05a['md5']!==_0x56bb48){_0x3cb05a[_0x0df7('0x4')]=_0x56bb48;emit(util[_0x0df7('0x76')]('voice:queue:%s',_0x1d5121[_0x0df7('0x40')]),'voice_queue:save',_0x1d5121);}}}function emitCampaignSummary(_0xa6a2b6){if(_0xa6a2b6['type']==='ivr'){emit(util[_0x0df7('0x76')]('campaign:ivr:%s',_0xa6a2b6[_0x0df7('0x40')]),'campaign:save',_0xa6a2b6);}}function checkGetDataPredictive(_0x19eca4){if(isNotNull(_0x19eca4)){if(!_[_0x0df7('0x48')](_0x19eca4)){loggerPredictive[_0x0df7('0x77')](_0x0df7('0x78'));loggerPredictive['info'](_0x0df7('0x79'),_0x19eca4['predictiveIntervalTotalCalls']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x7a'),_0x19eca4[_0x0df7('0x69')]);loggerPredictive[_0x0df7('0x77')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x19eca4[_0x0df7('0x6a')]);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x7b'),_0x19eca4['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x7c'),_0x19eca4[_0x0df7('0x7d')]);loggerPredictive['info'](_0x0df7('0x7e'),_0x19eca4[_0x0df7('0x7f')]);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x80'));if(_0x19eca4[_0x0df7('0x70')]>0x0){if(!_[_0x0df7('0x3e')](_0x19eca4[_0x0df7('0x7f')])&&_0x19eca4['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x0df7('0x77')](_0x0df7('0x81'));}if(!_[_0x0df7('0x3e')](_0x19eca4[_0x0df7('0x7d')])&&_0x19eca4[_0x0df7('0x7d')]>0x0){return!![];}else{loggerPredictive[_0x0df7('0x77')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x0df7('0x77')](_0x0df7('0x82'));}}else{loggerPredictive[_0x0df7('0x77')]('History\x20information\x20are\x20empty');}}else{loggerPredictive[_0x0df7('0x77')](_0x0df7('0x83'));}return![];}function mergeDataErlangB(_0xc2e0a9){return function(_0x327588){loggerPredictive['info'](_0x0df7('0x84'));loggerPredictive[_0x0df7('0x77')](_0x0df7('0x85'),_0x327588['erlangCalls']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x86'),_0x327588['erlangCallToSecond']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x87'),_0x327588['erlangAbandonmentRate']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x88'),_0x327588['erlangBusyFactor']);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x87'),_0x327588[_0x0df7('0x89')]);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x80'));_[_0x0df7('0x8a')](_0xc2e0a9,_0x327588);};}function getDiff(_0x3e91ca){var _0x2a74f3=moment()[_0x0df7('0x4c')](0x0);var _0x28fa99=moment(_0x3e91ca)['milliseconds'](0x0);return _0x2a74f3['diff'](_0x28fa99,_0x0df7('0x8b'));}function ifInterval(_0x498839,_0x4ab852){if(_[_0x0df7('0x3e')](_0x4ab852)){return![];}if(getDiff(_0x4ab852)<_0x498839*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x5d7415){if(isNotNull(_0x5d7415)){if(!_[_0x0df7('0x3e')](_0x5d7415[_0x0df7('0x26')])){_0x5d7415[_0x0df7('0x26')]=undefined;loggerPredictive[_0x0df7('0x77')](_0x5d7415[_0x0df7('0x40')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x0df7('0x3e')](_0x5d7415[_0x0df7('0x25')])){_0x5d7415[_0x0df7('0x25')]=undefined;loggerPredictive['info'](_0x5d7415[_0x0df7('0x40')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x0df7('0x3e')](_0x5d7415['handlePredictive'])){clearInterval(_0x5d7415[_0x0df7('0x8c')]);_0x5d7415[_0x0df7('0x8c')]=undefined;loggerPredictive[_0x0df7('0x77')](_0x5d7415[_0x0df7('0x40')],_0x0df7('0x8d'));}}}function erlangb(_0x48d36a,_0x10dd68){if(_0x10dd68===0x0){return 0x0;}var _0x27a1ec=0x1;for(var _0x528acf=0x1;_0x528acf<=_0x10dd68;_0x528acf+=0x1){_0x27a1ec=0x1+_0x27a1ec*_0x528acf/_0x48d36a;}return 0x1/_0x27a1ec;}function isVoiceQueueOutbound(_0x304050){return _0x304050==='outbound';}function isNotPreview(_0x1b4d12){return _0x1b4d12!==_0x0df7('0x8e');}function isCampaignIvr(_0x774c09){return _0x774c09===_0x0df7('0x8f');}function getCallerId(_0xbf8719,_0x56309f,_0x1b1327){if(!_[_0x0df7('0x3e')](_0x1b1327)&&_0x0df7('0x90')===typeof _0x1b1327&&!_[_0x0df7('0x48')](_0x1b1327)){if(!_['isUndefined'](_0x56309f)&&_0x0df7('0x90')===typeof _0x56309f&&!_['isEmpty'](_0x56309f)){return util[_0x0df7('0x76')](_0x0df7('0x91'),_0x56309f,_0x1b1327);}return util['format'](_0x0df7('0x91'),_0x1b1327,_0x1b1327);}if(!_[_0x0df7('0x3e')](_0xbf8719)&&_0x0df7('0x90')===typeof _0xbf8719&&!_[_0x0df7('0x48')](_0xbf8719)){return _0xbf8719;}return _0x0df7('0x92');}function loggerCatchQueueSummary(_0x503065,_0x2caf0d){return function(_0x29b4ae){freeVariablesPredictive(_0x2caf0d);emitVoiceQueueSummary(_0x2caf0d);emitCampaignSummary(_0x2caf0d);loggerSyncQueueSummary[_0x0df7('0x93')](_0x503065,util[_0x0df7('0x94')](_0x29b4ae,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x24f890,_0x1786a6){return function(_0x2f06bc){loggerPredictive[_0x0df7('0x93')](_0x1786a6[_0x0df7('0x40')],_0x24f890);loggerPredictive['error'](_0x2f06bc[_0x0df7('0x95')]);freeVariablesPredictive(_0x1786a6);};}function loggerCatch(_0x4405e4){return function(_0x4f394d){logger['error'](_0x4405e4,util['inspect'](_0x4f394d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x3f19e3){return _0x3f19e3&&!_[_0x0df7('0x3e')](_0x3f19e3)&&_0x3f19e3[_0x0df7('0x96')]>0x0;}function decremetOriginate(_0x32106d){if(!_[_0x0df7('0x3e')](_0x32106d)&&_0x32106d!==null){if(_0x32106d[_0x0df7('0x97')](_0x0df7('0x71'))){if(_0x32106d[_0x0df7('0x71')]>0x0){_0x32106d[_0x0df7('0x71')]-=0x1;}else{logger[_0x0df7('0x93')](_0x0df7('0x98'));}}}else{logger[_0x0df7('0x93')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x42a48a,_0x54a047,_0x5515dd){if(_0x54a047>_0x5515dd){for(var _0x35bfca=0x0;_0x35bfca<_0x54a047-_0x5515dd;_0x35bfca+=0x1){decremetOriginate(_0x42a48a);}}}function loggerGetContactDialer(_0x3ddc54,_0x3578f9,_0x285723){return function(_0x334a8b){checkContactLowerLimitOriginate(_0x3578f9,_0x285723,0x0);logger[_0x0df7('0x93')](_0x3ddc54,util['inspect'](_0x334a8b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2e13b3){return function(_0x527c23){if(isNotNull(_0x527c23)&&isNotNull(_0x527c23[0x0])){if(_0x527c23[0x0][_0x0df7('0x99')]>0x0){_0x2e13b3[_0x0df7('0x3f')]='RESCHEDULED_CONTACTS';logger[_0x0df7('0x77')](_0x0df7('0x9a')+_0x2e13b3['name'],_0x527c23[0x0][_0x0df7('0x99')],_0x0df7('0x9b'));}else{_0x2e13b3[_0x0df7('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x0df7('0x9c')+_0x2e13b3[_0x0df7('0x40')]);}}};}function notSendMessagesQueue(_0x1f7560){if(_0x1f7560[_0x0df7('0x9d')]){freeVariablesPredictive(_0x1f7560);if(_0x1f7560[_0x0df7('0x71')]===0x0&&_0x1f7560[_0x0df7('0x9e')]===0x0&&_0x1f7560[_0x0df7('0x5b')]===0x0&&(_0x1f7560[_0x0df7('0x55')]||0x0)===0x0){_0x1f7560[_0x0df7('0x9d')]=![];_0x1f7560[_0x0df7('0x53')]=0x0;_0x1f7560[_0x0df7('0x3f')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1f7560[_0x0df7('0x40')],_0x0df7('0x9f'));}else{_0x1f7560['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x0df7('0x93')](_0x0df7('0xa0'),_0x1f7560['name'],_0x0df7('0xa1'));}emitVoiceQueueSummary(_0x1f7560);}}function notSendMessagesCampaign(_0x364df6){if(_0x364df6['sendMessageOneNotActive']){if(_0x364df6[_0x0df7('0x71')]===0x0){_0x364df6[_0x0df7('0x9d')]=![];_0x364df6['message']=_0x0df7('0x42');loggerSyncQueueSummary[_0x0df7('0x93')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x364df6[_0x0df7('0x40')],_0x0df7('0x9f'));}else{_0x364df6['message']=_0x0df7('0xa2');loggerSyncQueueSummary[_0x0df7('0x93')](_0x0df7('0xa3'),_0x364df6[_0x0df7('0x40')],'is\x20disactive');}emitCampaignSummary(_0x364df6);}}function createObjHistory(_0x5a317e,_0x38ba21,_0x576013,_0x590686,_0x3bcd96){_0x5a317e[_0x0df7('0x3f')]=_0x576013;var _0x458af7=new Action(_0x5a317e,_0x38ba21);var _0x4bd7f9=new History(_0x458af7);_0x4bd7f9['state']=_0x590686;_0x4bd7f9[_0x0df7('0xa4')]=_0x3bcd96;_0x4bd7f9[_0x0df7('0xa5')]=_0x458af7[_0x0df7('0xa6')];return _0x4bd7f9;}Dialer[_0x0df7('0x17')][_0x0df7('0x3d')]=function(){var _0xd628bb=this;setInterval(function(){_0xd628bb[_0x0df7('0xa7')](_0xd628bb[_0x0df7('0x24')],_0x0df7('0xa8'));_0xd628bb[_0x0df7('0xa7')](_0xd628bb[_0x0df7('0x22')],'[actions]');},0x32c8);};Dialer[_0x0df7('0x17')][_0x0df7('0xa7')]=function(_0x266909,_0x4cb395){var _0x236416=this;for(var _0x854aed in _0x266909){if(_0x266909['hasOwnProperty'](_0x854aed)){this[_0x0df7('0x1b')]['enqueue'](function(){if(!_[_0x0df7('0xa9')](_0x266909[_0x854aed])){return ami[_0x0df7('0xaa')]({'action':_0x0df7('0xab'),'channel':_0x266909[_0x854aed][_0x0df7('0xac')]})[_0x0df7('0xad')](function(_0x1495b5){if(_0x1495b5[_0x0df7('0x3f')]===_0x0df7('0xae')){setTimeout(function(){if(_0x266909[_0x854aed]&&_0x266909[_0x854aed][_0x0df7('0x4f')]!=='ivr'){_0x236416[_0x0df7('0xaf')](_0x236416['voiceQueues'][_0x266909[_0x854aed]['queue']]);logger[_0x0df7('0x93')](_0x0df7('0xb0'),_0x4cb395,_0x854aed,_0x266909[_0x854aed][_0x0df7('0xb1')]);delete _0x266909[_0x854aed];}if(_0x266909[_0x854aed]&&_0x266909[_0x854aed][_0x0df7('0x4f')]===_0x0df7('0x8f')){_0x236416[_0x0df7('0xaf')](_0x236416[_0x0df7('0x1d')][_0x266909[_0x854aed][_0x0df7('0xb1')]]);logger['error'](_0x0df7('0xb2'),_0x4cb395,_0x854aed,_0x266909[_0x854aed][_0x0df7('0xb1')]);delete _0x266909[_0x854aed];}},0x2328);}});}});}}};Dialer['prototype'][_0x0df7('0xb3')]=function(_0x2fb804){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopper[_0x0df7('0xb3')](_0x2fb804))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xb6')));};Dialer['prototype'][_0x0df7('0xb7')]=function(_0x4f2cb7){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopperBlack[_0x0df7('0xb7')](_0x4f2cb7))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xb8')));};Dialer[_0x0df7('0x17')][_0x0df7('0xb9')]=function(_0x3440f7){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopperBlack[_0x0df7('0xb9')](_0x3440f7))[_0x0df7('0xad')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x0df7('0x17')]['averageHandleTime']=function(_0x4af1d7){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopperHistory[_0x0df7('0xba')](_0x4af1d7))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xbb')));};Dialer[_0x0df7('0x17')][_0x0df7('0xbc')]=function(_0x319e0c){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopper['rescheduleContact'](_0x319e0c))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xbd')));};Dialer[_0x0df7('0x17')][_0x0df7('0xbe')]=function(_0x59ee0d,_0x4e083b,_0x4fa11a,_0x30235e){return BPromise['resolve']()[_0x0df7('0xb5')](cmHopper[_0x0df7('0xbe')](_0x59ee0d,_0x4e083b,_0x4fa11a,_0x30235e))['catch'](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x0df7('0x17')]['getContactDialerIvr']=function(_0x5e873a,_0x2dfd67,_0x2c6279){return BPromise['resolve']()['then'](cmHopper['getContactDialerIvr'](_0x5e873a,_0x2dfd67,_0x2c6279))[_0x0df7('0xad')](loggerCatch('[getContactDialer]\x20'));};Dialer['prototype'][_0x0df7('0xbf')]=function(_0x40bdb8){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](voiceQueueRt[_0x0df7('0xbf')](_0x40bdb8))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xc0')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x1e83d9){return BPromise[_0x0df7('0xb4')]()[_0x0df7('0xb5')](cmHopper['moveContactManagedDialer'](_0x1e83d9))[_0x0df7('0xad')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x0df7('0x17')][_0x0df7('0xc1')]=function(_0x325b85){return BPromise['resolve']()['then'](cmHopperHistory[_0x0df7('0xc1')](_0x325b85))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xc2')));};Dialer[_0x0df7('0x17')]['updateOriginated']=function(_0x229aa7){if(!_[_0x0df7('0x3e')](_0x229aa7)&&_0x229aa7!==null){if(_0x229aa7[_0x0df7('0x97')](_0x0df7('0x71'))){if(_0x229aa7['originated']>0x0){_0x229aa7[_0x0df7('0x71')]-=0x1;}else{logger[_0x0df7('0x93')](_0x0df7('0xc3'));}}}else{logger[_0x0df7('0x93')](_0x0df7('0xc4'));}};Dialer[_0x0df7('0x17')][_0x0df7('0xc5')]=function(_0x26ba73,_0x594407){var _0x238d46=this;return function(_0x9184a4){_0x238d46[_0x0df7('0xaf')](_0x594407);logger[_0x0df7('0x93')](_0x26ba73,util['inspect'](_0x9184a4,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x3e031a,_0x42dca1,_0x31f060){var _0x5910cb={'state':0x19,'statedesc':'notFound'};this[_0x0df7('0xaf')](_0x42dca1);this['saveInDb'](_['merge'](_0x5910cb,_[_0x0df7('0xc6')](_0x31f060,[_0x0df7('0xc7'),'ListId','UserId','VoiceQueueId',_0x0df7('0xc8')])),_0x0df7('0xc9'),'[emptyContact]');logger[_0x0df7('0x93')](_0x3e031a);};Dialer['prototype'][_0x0df7('0xca')]=function(_0xf1e997){return _0xf1e997===_0x0df7('0xcb');};Dialer[_0x0df7('0x17')][_0x0df7('0xcc')]=function(_0x6f6485){return!_['isUndefined'](_0x6f6485)&&_0x6f6485&&!_[_0x0df7('0x3e')](_0x6f6485[_0x0df7('0x40')])&&!_['isUndefined'](_0x6f6485[_0x0df7('0x74')])&&_0x6f6485[_0x0df7('0x74')]&&(this[_0x0df7('0x1f')][util[_0x0df7('0x76')]('SIP/%s',_0x6f6485[_0x0df7('0x40')])][_0x0df7('0xab')]===_0x0df7('0xcd')||this['trunks'][util[_0x0df7('0x76')](_0x0df7('0xce'),_0x6f6485[_0x0df7('0x40')])][_0x0df7('0xab')]===_0x0df7('0xcf'));};Dialer[_0x0df7('0x17')][_0x0df7('0xd0')]=function(_0x1ee1f1,_0x143c84,_0x392d76){this[_0x0df7('0xc1')](_0x1ee1f1)[_0x0df7('0xad')](loggerCatch(_0x143c84));this[_0x0df7('0xd1')](_0x1ee1f1)[_0x0df7('0xad')](loggerCatch(_0x392d76));};Dialer[_0x0df7('0x17')]['syncVarSet']=function(_0x1a7441){var _0x133e13=this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];var _0x28c6db;if(!_[_0x0df7('0xa9')](_0x1a7441)&&!_[_0x0df7('0xa9')](_0x1a7441[_0x0df7('0xd3')])&&!_[_0x0df7('0xa9')](_0x1a7441[_0x0df7('0xd3')][_0x0df7('0xd4')])&&_0x1a7441[_0x0df7('0xd5')]===_0x0df7('0xd6')&&_0x133e13){if(_0x133e13[_0x0df7('0x4f')]!=='ivr'&&this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0xd7')]&&_0x1a7441['value']===_0x0df7('0xd8')){delete this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x133e13['queue']]);this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]]['outboundAnswerCallsDay']+=0x1;this[_0x0df7('0x1c')][_0x133e13['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db[_0x0df7('0xd9')]=0x12;_0x28c6db[_0x0df7('0xa4')]=_0x0df7('0xda');_0x28c6db[_0x0df7('0xdb')]=_0x0df7('0xdc');this['saveInDb'](_0x28c6db,_0x0df7('0xdd'),_0x0df7('0xde'));}if(_0x133e13[_0x0df7('0x4f')]!==_0x0df7('0x8f')&&this[_0x0df7('0x1c')][_0x133e13['queue']][_0x0df7('0xd7')]&&_0x1a7441[_0x0df7('0xdf')]===_0x0df7('0xe0')){delete this['uniqueId'][_0x1a7441[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]]);this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0x63')]+=0x1;this[_0x0df7('0x1c')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0x62')]+=0x1;_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db[_0x0df7('0xd9')]=0x13;_0x28c6db[_0x0df7('0xa4')]=_0x0df7('0xe1');_0x28c6db[_0x0df7('0xdb')]=_0x0df7('0xdc');_0x28c6db[_0x0df7('0xe2')]=!![];this['saveInDb'](_0x28c6db,_0x0df7('0xe3'),_0x0df7('0xe4'));}if(_0x133e13[_0x0df7('0x4f')]===_0x0df7('0x8f')&&this[_0x0df7('0x1d')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0xd7')]&&_0x1a7441[_0x0df7('0xdf')]===_0x0df7('0xd8')){delete this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1d')][_0x133e13[_0x0df7('0xb1')]]);_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db['state']=0x12;_0x28c6db['statedesc']=_0x0df7('0xda');_0x28c6db[_0x0df7('0xdb')]='AMD';this['saveInDb'](_0x28c6db,_0x0df7('0xe5'),_0x0df7('0xe6'));}if(_0x133e13[_0x0df7('0x4f')]===_0x0df7('0x8f')&&this[_0x0df7('0x1d')][_0x133e13[_0x0df7('0xb1')]][_0x0df7('0xd7')]&&_0x1a7441[_0x0df7('0xdf')]==='MACHINE'){delete this[_0x0df7('0x24')][_0x1a7441[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1d')][_0x133e13['queue']]);_0x28c6db=new Hangup(_0x133e13,_0x1a7441);_0x28c6db[_0x0df7('0xd9')]=0x13;_0x28c6db[_0x0df7('0xa4')]=_0x0df7('0xe1');_0x28c6db[_0x0df7('0xdb')]=_0x0df7('0xdc');_0x28c6db['amd']=!![];this[_0x0df7('0xd0')](_0x28c6db,_0x0df7('0xe7'),_0x0df7('0xe8'));}}};Dialer[_0x0df7('0x17')][_0x0df7('0x34')]=function(_0x4780de){var _0x1da651=this['uniqueId'][_0x4780de[_0x0df7('0xd2')]];var _0x5967ab=this;var _0x4f9b3e;if(_0x1da651&&_0x1da651[_0x0df7('0x4f')]===_0x0df7('0x8f')){delete this['uniqueId'][_0x4780de[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1d')][_0x1da651[_0x0df7('0xb1')]]);this[_0x0df7('0x1d')][_0x1da651['queue']][_0x0df7('0xe9')]+=0x1;_0x4f9b3e=new Hangup(_0x1da651,_0x4780de);this[_0x0df7('0xc1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xea')));this[_0x0df7('0xd1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xeb')));}if(_0x1da651&&_0x1da651[_0x0df7('0x4f')]!=='ivr'&&isNotNull(this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0xec')])){delete this[_0x0df7('0x24')][_0x4780de[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]]);this[_0x0df7('0x1c')][_0x1da651['queue']][_0x0df7('0x63')]+=0x1;this['voiceQueues'][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0x62')]+=0x1;_0x4f9b3e=new Hangup(_0x1da651,_0x4780de);_0x4f9b3e[_0x0df7('0xd9')]=0x10;_0x4f9b3e[_0x0df7('0xa4')]=_0x0df7('0xed');_0x4f9b3e[_0x0df7('0xdb')]='AGI';this['createHistory'](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x0df7('0xd1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xeb')));}if(_0x1da651&&_0x1da651[_0x0df7('0x4f')]!==_0x0df7('0x8f')&&!isNotNull(this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0xec')])){delete this[_0x0df7('0x24')][_0x4780de[_0x0df7('0xd2')]];this['updateOriginated'](this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]]);this[_0x0df7('0x1c')][_0x1da651[_0x0df7('0xb1')]][_0x0df7('0x68')]+=0x1;_0x4f9b3e=new Hangup(_0x1da651,_0x4780de);_0x4f9b3e[_0x0df7('0xd9')]=0xc;_0x4f9b3e['statedesc']=_0x4780de['cause-txt'];_0x4f9b3e[_0x0df7('0xdb')]=_0x0df7('0xee');this[_0x0df7('0xc1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xea')));this[_0x0df7('0xd1')](_0x4f9b3e)[_0x0df7('0xad')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x0df7('0x30')]=function(_0xb87fc6){var _0xd0816e=this['uniqueId'][_0xb87fc6[_0x0df7('0xd2')]];var _0x5319d2=this;if(this['voiceQueues'][_0xb87fc6[_0x0df7('0xb1')]]){if(_0xd0816e&&_0xd0816e['type']!==_0x0df7('0x8f')){delete this[_0x0df7('0x24')][_0xb87fc6[_0x0df7('0xd2')]];this['voiceQueues'][_0xb87fc6[_0x0df7('0xb1')]]['outboundAnswerCallsDay']+=0x1;var _0x53a49d=new AgentComplete(_0xd0816e,_0xb87fc6);if(_0xb87fc6[_0x0df7('0xef')]===_0x0df7('0xf0')){_0x53a49d['agiafterat']=this[_0x0df7('0x1c')][_0xb87fc6[_0x0df7('0xb1')]][_0x0df7('0xf1')]&&this['voiceQueues'][_0xb87fc6[_0x0df7('0xb1')]][_0x0df7('0xf2')]?moment()['format'](_0x0df7('0xf3')):undefined;}this[_0x0df7('0xc1')](_0x53a49d)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x0df7('0xd1')](_0x53a49d)[_0x0df7('0xad')](loggerCatch(_0x0df7('0xf4')));}}};Dialer[_0x0df7('0x17')]['syncAgentConnect']=function(_0x30cc00){if(this[_0x0df7('0x1c')][_0x30cc00['queue']]){if(this['uniqueId'][_0x30cc00[_0x0df7('0xd2')]]&&this[_0x0df7('0x24')][_0x30cc00[_0x0df7('0xd2')]][_0x0df7('0x4f')]!==_0x0df7('0x8f')){this['updateOriginated'](this[_0x0df7('0x1c')][_0x30cc00[_0x0df7('0xb1')]]);this[_0x0df7('0x24')][_0x30cc00['uniqueid']][_0x0df7('0xf5')]=moment()[_0x0df7('0x76')](_0x0df7('0xf3'));}}};Dialer[_0x0df7('0x17')]['queueCallerAbandonCreateState']=function(_0x14234a){this[_0x0df7('0xc1')](_0x14234a)[_0x0df7('0xad')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x0df7('0xd1')](_0x14234a)['catch'](loggerCatch(_0x0df7('0xf6')));};Dialer[_0x0df7('0x17')][_0x0df7('0xf7')]=function(_0x1f512e){var _0x390025=this[_0x0df7('0x24')][_0x1f512e[_0x0df7('0xd2')]];var _0x1b8b88=this;if(this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]]){if(_0x390025&&_0x390025['type']!=='ivr'){delete this[_0x0df7('0x24')][_0x1f512e[_0x0df7('0xd2')]];this[_0x0df7('0xaf')](this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]]);_0x390025[_0x0df7('0xf8')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5997aa=new QueueCallerAbandon(_0x390025,_0x1f512e);if(getSeconds(_0x390025[_0x0df7('0xf8')],_0x390025[_0x0df7('0xf9')])>=_0x390025[_0x0df7('0xfa')]){this[_0x0df7('0x1c')][_0x1f512e['queue']][_0x0df7('0x6a')]+=0x1;this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]]['outboundDropCallsDayTimeout']+=0x1;this['voiceQueues'][_0x1f512e[_0x0df7('0xb1')]][_0x0df7('0x6c')]+=0x1;_0x5997aa['state']=0xa;_0x5997aa[_0x0df7('0xa4')]=_0x0df7('0xfb');_0x5997aa['dropreason']=_0x0df7('0xfc');_0x5997aa[_0x0df7('0xfd')]=this['voiceQueues'][_0x1f512e['queue']][_0x0df7('0xf1')]?moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this[_0x0df7('0xfe')](_0x5997aa);}else{this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]][_0x0df7('0xff')]+=0x1;this[_0x0df7('0x1c')][_0x1f512e[_0x0df7('0xb1')]][_0x0df7('0x64')]+=0x1;_0x5997aa['state']=0xb;_0x5997aa[_0x0df7('0xa4')]=_0x0df7('0x100');_0x5997aa[_0x0df7('0x101')]=_0x0df7('0x102');this[_0x0df7('0xfe')](_0x5997aa);}}}};Dialer[_0x0df7('0x17')][_0x0df7('0x36')]=function(_0x1ad20e){if(this['actions'][_0x1ad20e['uniqueid']]){this[_0x0df7('0x22')][_0x1ad20e[_0x0df7('0xd2')]]['channel']=_0x1ad20e[_0x0df7('0xac')];}if(this['uniqueId'][_0x1ad20e[_0x0df7('0xd2')]]){this[_0x0df7('0x24')][_0x1ad20e['uniqueid']]['channel']=_0x1ad20e[_0x0df7('0xac')];}};Dialer['prototype']['syncQueueMember']=function(_0x490f63){if(strategy[this[_0x0df7('0x1c')][this[_0x0df7('0x22')][_0x490f63['actionid']][_0x0df7('0xb1')]][_0x0df7('0x51')]]===_0x0df7('0x103')){if(this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]]&&_['isNil'](this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0x105')])&&_0x490f63[_0x0df7('0xab')]==='1'&&_0x490f63[_0x0df7('0x106')]==='0'){if(this[_0x0df7('0x1e')][_0x490f63['stateinterface']]){if(!this[_0x0df7('0x1e')][_0x490f63[_0x0df7('0x107')]][_0x0df7('0x105')]){this[_0x0df7('0x1e')][_0x490f63[_0x0df7('0x107')]]['locked']=!![];this['actions'][_0x490f63[_0x0df7('0x104')]][_0x0df7('0x105')]=!![];this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0x107')]=_0x490f63[_0x0df7('0x107')];}}}}else if((strategy[this[_0x0df7('0x1c')][this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0xb1')]][_0x0df7('0x51')]]||_0x0df7('0x16'))===_0x0df7('0x16')){if(this[_0x0df7('0x22')][_0x490f63['actionid']]){if(this[_0x0df7('0x1e')][_0x490f63[_0x0df7('0x107')]]){this['actions'][_0x490f63['actionid']][_0x0df7('0x107')]=_0x490f63[_0x0df7('0x107')];if(_[_0x0df7('0xa9')](this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]]['queue']])){this['queueBooked'][this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]][_0x0df7('0xb1')]]=[];}this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x490f63['actionid']][_0x0df7('0xb1')]][_0x0df7('0x108')](_['merge'](_['pick'](this[_0x0df7('0x22')][_0x490f63[_0x0df7('0x104')]],[_0x0df7('0x109'),'stateinterface']),{'status':_0x490f63[_0x0df7('0xab')],'paused':_0x490f63[_0x0df7('0x106')]}));}}}};function unlockQueueStatus(_0x15d976,_0x1f656d){setTimeout(function(){if(_['isUndefined'](_0x15d976[_0x0df7('0x10a')])){loggerBooked[_0x0df7('0x93')](_0x0df7('0x10b'),_0x1f656d);}_0x15d976[_0x0df7('0x10a')]=!![];loggerBooked[_0x0df7('0x77')](_0x0df7('0x10c'),_0x1f656d,JSON[_0x0df7('0x4b')](_[_0x0df7('0xc6')](_0x15d976,[_0x0df7('0x40'),_0x0df7('0x10a')])));},0x1f3);}Dialer[_0x0df7('0x17')][_0x0df7('0x3c')]=function(_0x261265){var _0x34c458=this;var _0x44a413=_0x34c458[_0x0df7('0x1c')][_0x34c458['actions'][_0x261265['actionid']][_0x0df7('0xb1')]];if(strategy[this['voiceQueues'][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]][_0x0df7('0x51')]]===_0x0df7('0x103')){if(this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]]&&this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x107')]){this['preview']['run'](this['actions'][_0x261265[_0x0df7('0x104')]][_0x0df7('0x109')],this['actions'][_0x261265['actionid']][_0x0df7('0x107')])[_0x0df7('0xad')](function(_0xdb1161){logger[_0x0df7('0x93')](_0x0df7('0x10d'),util['inspect'](_0xdb1161,{'showHidden':![],'depth':null}));})[_0x0df7('0x1a')](function(){_0x34c458[_0x0df7('0xaf')](_0x34c458[_0x0df7('0x1c')][_0x34c458[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]]);_0x34c458['agents'][_0x34c458[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x107')]]['locked']=![];delete _0x34c458[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]];unlockQueueStatus(_0x44a413);});}else{this[_0x0df7('0xaf')](this[_0x0df7('0x1c')][this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]]['queue']]);this[_0x0df7('0xbc')]({'active':![],'ContactId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xc7')],'ListId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x10e')],'VoiceQueueId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0x10f')]||undefined,'CampaignId':this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]]['CampaignId']||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x110')));delete this['actions'][_0x261265[_0x0df7('0x104')]];unlockQueueStatus(_0x44a413);}}else if((strategy[this['voiceQueues'][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]][_0x0df7('0x51')]]||_0x0df7('0x16'))===_0x0df7('0x16')){var _0x3d2b39;if(this['actions'][_0x261265[_0x0df7('0x104')]]&&!_[_0x0df7('0x48')](this[_0x0df7('0x28')][this['actions'][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]])){if(this[_0x0df7('0x29')][_0x34c458[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]]){this[_0x0df7('0x29')][_0x34c458[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]]=this[_0x0df7('0x29')][this['actions'][_0x261265[_0x0df7('0x104')]]['queue']]?this['queueBookedRR'][this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]]:this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]]?this[_0x0df7('0x28')][this[_0x0df7('0x22')][_0x261265['actionid']][_0x0df7('0xb1')]][_0x0df7('0x111')]||0x0:0x0;}this[_0x0df7('0x28')][this['actions'][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]]['_rr']=this[_0x0df7('0x29')][this[_0x0df7('0x22')][_0x261265[_0x0df7('0x104')]][_0x0df7('0xb1')]];for(var _0x788416=0x0;_0x788416=0x0?!![]:![];})['catch'](myreject(_0x450e4a)));}}else{_0x4fc150[_0x0df7('0x108')](ami[_0x0df7('0xaa')]({'action':_0x0df7('0x125'),'command':util[_0x0df7('0x76')]('iftime\x20%s,%s',_0x43a38f,!_['isUndefined'](config[_0x0df7('0x123')][_0x381f0e])?_0x381f0e:'')})[_0x0df7('0xb5')](function(_0xa2b997){return _0xa2b997['content'][_0x0df7('0x129')](_0x0df7('0x12a'))>=0x0?!![]:![];})[_0x0df7('0xad')](myreject(_0x450e4a)));}BPromise['all'](_0x4fc150)['then'](function(_0x18491e){var _0x4ec63b=_[_0x0df7('0x12b')](_0x18491e);if(_0x4ec63b){return _0x1d9382(_0x4ec63b);}else{_0x243101[_0x0df7('0x3f')]=_0x1751c8?_0x0df7('0x12c'):'INTERVAL_IS_OVERTIME';return _0x450e4a(msgResponse(_0x0df7('0x12d'),_0x0df7('0x120'),_0x0df7('0x12e')+_0x1751c8+'\x20'+_0x16af3a+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x43a38f,{'showHidden':![],'depth':null})+_0x0df7('0x12f')+_0x381f0e));}})[_0x0df7('0xad')](function(_0x186638){return _0x450e4a(msgResponse(_0x0df7('0x11e'),_0x0df7('0x120'),JSON[_0x0df7('0x4b')](_0x186638)));});});};Dialer[_0x0df7('0x17')]['checkDialMethod']=function(_0x594ee6){var _0x590c0e=this;return function(){switch(_0x594ee6[_0x0df7('0x5e')]){case'progressive':freeVariablesPredictive(_0x594ee6);_0x590c0e[_0x0df7('0x130')](_0x594ee6,0x1);break;case _0x0df7('0x131'):freeVariablesPredictive(_0x594ee6);_0x590c0e[_0x0df7('0x130')](_0x594ee6,_0x594ee6[_0x0df7('0x132')]);break;case _0x0df7('0x9'):_0x590c0e[_0x0df7('0x9')](_0x594ee6);break;case _0x0df7('0x133'):freeVariablesPredictive(_0x594ee6);_0x590c0e['handlePower'](_0x594ee6,0x1);break;default:freeVariablesPredictive(_0x594ee6);logger[_0x0df7('0x93')](_0x0df7('0x134'),_0x594ee6['name'],_0x0df7('0x135'));}};};Dialer[_0x0df7('0x17')][_0x0df7('0x136')]=function(_0x53c4c0){var _0x1b9bc0=this;return function(){_0x1b9bc0[_0x0df7('0x137')](_0x53c4c0);};};Dialer[_0x0df7('0x17')]['syncQueueSummary']=function(_0x54fd10){var _0x348783=this;if(isNotPreview(_0x54fd10[_0x0df7('0x5e')])){if(isVoiceQueueOutbound(_0x54fd10[_0x0df7('0x4f')])&&isActive(_0x54fd10['dialActive'])){_0x54fd10[_0x0df7('0x9d')]=!![];BPromise['resolve']()[_0x0df7('0xb5')](checkIsLoggedIn(_0x54fd10,_0x54fd10[_0x0df7('0x54')]))['then'](checkIsActive(_0x54fd10,_0x54fd10[_0x0df7('0x5d')]))[_0x0df7('0xb5')](checkInterval(_0x54fd10))[_0x0df7('0xb5')](_0x348783['checkIsTrunkReachable'](_0x54fd10))['then'](_0x348783[_0x0df7('0x11d')](_0x54fd10[_0x0df7('0x138')],_0x54fd10[_0x0df7('0x139')],_0x54fd10['name'],_0x54fd10))['then'](_0x348783['checkIfTimeIntervals'](_0x54fd10[_0x0df7('0x44')],_0x54fd10[_0x0df7('0x139')],_0x54fd10[_0x0df7('0x40')],_0x54fd10))['then'](_0x348783['checkDialMethod'](_0x54fd10))['catch'](loggerCatchQueueSummary(_0x0df7('0x13a'),_0x54fd10));}else{notSendMessagesQueue(_0x54fd10);}}else{freeVariablesPredictive(_0x54fd10);}};Dialer['prototype'][_0x0df7('0x13b')]=function(){var _0x259515=this;var _0x573b34;for(var _0x4627cb in this[_0x0df7('0x1d')]){if(this[_0x0df7('0x1d')][_0x0df7('0x97')](_0x4627cb)){_0x573b34=this['campaigns'][_0x4627cb];if(isCampaignIvr(_0x573b34[_0x0df7('0x4f')])&&isActive(_0x573b34[_0x0df7('0x74')])){_0x573b34[_0x0df7('0x9d')]=!![];BPromise['resolve']()['then'](checkIsActive(_0x573b34,_0x573b34[_0x0df7('0x74')]))['then'](checkInterval(_0x573b34))[_0x0df7('0xb5')](_0x259515[_0x0df7('0x119')](_0x573b34))[_0x0df7('0xb5')](_0x259515[_0x0df7('0x11d')](_0x573b34['dialGlobalInterval'],_0x573b34[_0x0df7('0x139')],_0x573b34[_0x0df7('0x40')],_0x573b34))[_0x0df7('0xb5')](_0x259515['checkIfTimeIntervals'](_0x573b34[_0x0df7('0x44')],_0x573b34['dialTimezone'],_0x573b34['name'],_0x573b34))[_0x0df7('0xb5')](_0x259515[_0x0df7('0x136')](_0x573b34))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x573b34));}else{notSendMessagesCampaign(_0x573b34);}}}};function getCallerIdRandom(_0xbafec8,_0x5145fd){var _0x4a8d85,_0x1ffa00,_0x156f11;if(_0x5145fd<=0x0){_0x5145fd=0x1;}_0x4a8d85=new RegExp(_0x0df7('0x13c')+_0x5145fd+'}$');_0x1ffa00=Math[_0x0df7('0x13d')](0xa,_0x5145fd-0x1);_0x156f11=Math[_0x0df7('0x13d')](0xa,_0x5145fd)-0x1;return util[_0x0df7('0x76')]('%s',_['replace'](_0xbafec8,_0x4a8d85,_['random'](_0x1ffa00,_0x156f11)));}function extractCalleridName(_0x2ee095){var _0x20e761=_0x2ee095['match'](/"(.*?)"/);return _0x20e761?_0x20e761[0x1]:_0x2ee095;}function extractCalleridNumber(_0x4bb3a6){var _0x71a0ea=_0x4bb3a6[_0x0df7('0x13e')](/<(.*?)>/);return _0x71a0ea?_0x71a0ea[0x1]:_0x4bb3a6;}Dialer['prototype']['actionOriginate']=function(_0x1e79c8,_0x2ee7c9){var _0x8da59f=this;var _0x5656e0=uuid['v4']();this[_0x0df7('0x22')][_0x5656e0]=new Action(_0x1e79c8,_0x2ee7c9,_0x5656e0);return new BPromise(function(_0x2ed564,_0x341dbd){if(_[_0x0df7('0x3e')](_0x1e79c8)&&_0x0df7('0x13f')!==typeof _0x1e79c8){return _0x341dbd(msgResponse(_0x0df7('0x140'),_0x0df7('0x120'),'voiceQueue\x20is\x20undefine'));}if(_[_0x0df7('0x3e')](_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')])||_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]===null){return _0x341dbd(msgResponse(_0x0df7('0x140'),'Failure',_0x0df7('0x143')));}var _0xdd3a49={'XMD-CALLERID':_0x8da59f['actions'][_0x5656e0]['getCaller'](),'XMD-AGI':_0x1e79c8[_0x0df7('0xec')]?util['format'](_0x0df7('0x144'),ipAgi,_0x1e79c8['dialQueueProject']):_0x0df7('0x145'),'XMD-AGIAFTER':_0x1e79c8[_0x0df7('0xf1')]?util[_0x0df7('0x76')](_0x0df7('0x144'),ipAgi,_0x1e79c8[_0x0df7('0xf1')]):_0x0df7('0x145'),'XMD-QUEUE':_0x1e79c8[_0x0df7('0x4f')]===_0x0df7('0x50')?util['format'](_0x0df7('0x146'),_0x1e79c8[_0x0df7('0x40')],_0x1e79c8[_0x0df7('0x147')]||'',_0x1e79c8[_0x0df7('0xf2')]?'c':'',_0x1e79c8[_0x0df7('0xfa')]||0x3):'NONE','XMD-CONTACTID':_0x2ee7c9[_0x0df7('0xc7')],'XMD-CDRTYPE':_0x0df7('0x8'),'CALLERID(all)':_0x8da59f['actions'][_0x5656e0][_0x0df7('0x148')](),'XMD-AMD':_0x1e79c8[_0x0df7('0xd7')]?_0x0df7('0x149'):_0x0df7('0x145'),'XMD-DESTINATION':_0x0df7('0xd6')};if(_0x1e79c8[_0x0df7('0xd7')]){_0xdd3a49[_0x0df7('0x14a')]=_0x1e79c8['dialAMDInitialSilence']||0x9c4;_0xdd3a49[_0x0df7('0x14b')]=_0x1e79c8['dialAMDGreeting']||0x5dc;_0xdd3a49[_0x0df7('0x14c')]=_0x1e79c8[_0x0df7('0x14d')]||0x320;_0xdd3a49['XMD-AMDTOTALANALYSISTIME']=_0x1e79c8[_0x0df7('0x14e')]||0x1388;_0xdd3a49[_0x0df7('0x14f')]=_0x1e79c8['dialAMDMinWordLength']||0x64;_0xdd3a49[_0x0df7('0x150')]=_0x1e79c8['dialAMDBetweenWordsSilence']||0x32;_0xdd3a49[_0x0df7('0x151')]=_0x1e79c8[_0x0df7('0x152')]||0x3;_0xdd3a49[_0x0df7('0x153')]=_0x1e79c8[_0x0df7('0x154')]||0x100;_0xdd3a49[_0x0df7('0x155')]=_0x1e79c8[_0x0df7('0x156')]||0x1388;}if(_0x1e79c8[_0x0df7('0x4f')]===_0x0df7('0x50')){_0xdd3a49['XMD-VOICEQUEUEID']=_0x2ee7c9[_0x0df7('0x10f')];}else{_0xdd3a49[_0x0df7('0x157')]=_0x2ee7c9['CampaignId'];}for(var _0x17fe44 in _0x2ee7c9[_0x0df7('0x141')]){if(_0x2ee7c9[_0x0df7('0x141')]['hasOwnProperty'](_0x17fe44)){if(isNotNull(_0x2ee7c9['Contact'][_0x17fe44])&&_0x17fe44!=='id'&&_0x17fe44!==_0x0df7('0x158')&&_0x17fe44!==_0x0df7('0x159')&&_0x17fe44!=='updatedAt'){_0xdd3a49[util[_0x0df7('0x76')](_0x0df7('0x15a'),'XMD-',_['toUpper'](_0x17fe44))]=_0x2ee7c9[_0x0df7('0x141')][_0x17fe44];}}}var _0x2775de=_0x8da59f[_0x0df7('0xcc')](_0x1e79c8[_0x0df7('0x73')])?getCallerId(_0x1e79c8[_0x0df7('0x73')][_0x0df7('0x75')],_0x1e79c8['dialOriginateCallerIdName'],_0x1e79c8[_0x0df7('0x15b')]>0x0?getCallerIdRandom(_0x1e79c8[_0x0df7('0x60')],_0x1e79c8[_0x0df7('0x15b')]):_0x1e79c8[_0x0df7('0x60')]):getCallerId(_[_0x0df7('0xa9')](_0x1e79c8[_0x0df7('0x11a')])?_0x1e79c8[_0x0df7('0x73')]['callerid']:_0x1e79c8[_0x0df7('0x11a')]['callerid'],_0x1e79c8[_0x0df7('0x5f')],_0x1e79c8[_0x0df7('0x15b')]>0x0?getCallerIdRandom(_0x1e79c8[_0x0df7('0x60')],_0x1e79c8[_0x0df7('0x15b')]):_0x1e79c8[_0x0df7('0x60')]);if(_0x2775de){_0xdd3a49[_0x0df7('0x15c')]=_0x8da59f[_0x0df7('0x22')][_0x5656e0][_0x0df7('0x15d')]=extractCalleridName(_0x2775de);_0xdd3a49[_0x0df7('0x15e')]=_0x8da59f[_0x0df7('0x22')][_0x5656e0][_0x0df7('0x15f')]=extractCalleridNumber(_0x2775de);}return ami['Action']({'actionid':_0x5656e0,'action':'originate','channel':_0x8da59f['isTrunkReachable'](_0x1e79c8['Trunk'])?util['format']('SIP/%s/%s%s',_0x1e79c8[_0x0df7('0x73')][_0x0df7('0x40')],isNotNull(_0x1e79c8[_0x0df7('0x160')])?_0x1e79c8[_0x0df7('0x160')][_0x0df7('0x161')]()||'':'',_0x1e79c8[_0x0df7('0x162')]>0x0?_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]['substring'](_0x1e79c8[_0x0df7('0x162')]):_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]):util[_0x0df7('0x76')](_0x0df7('0x163'),_[_0x0df7('0xa9')](_0x1e79c8[_0x0df7('0x11a')])?_0x1e79c8[_0x0df7('0x73')]['name']:_0x1e79c8['TrunkBackup'][_0x0df7('0x40')],isNotNull(_0x1e79c8[_0x0df7('0x160')])?_0x1e79c8[_0x0df7('0x160')][_0x0df7('0x161')]()||'':'',_0x1e79c8[_0x0df7('0x162')]>0x0?_0x2ee7c9[_0x0df7('0x141')]['phone'][_0x0df7('0x164')](_0x1e79c8[_0x0df7('0x162')]):_0x2ee7c9[_0x0df7('0x141')][_0x0df7('0x142')]),'callerid':_0x2775de,'Exten':_0x0df7('0xd6'),'Context':'from-sip','Priority':'1','variable':_0xdd3a49,'timeout':(_0x1e79c8[_0x0df7('0x61')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5656e0})[_0x0df7('0xb5')](function(_0x46a480){return _0x2ed564(_0x46a480);})[_0x0df7('0xad')](function(_0xba96ea){_0x1e79c8[_0x0df7('0x66')]+=0x1;var _0x1ab4e2=new History(_0x8da59f[_0x0df7('0x22')][_0x5656e0]);logger[_0x0df7('0x93')](util[_0x0df7('0x76')]('[originateError]:\x20%s',JSON['stringify'](_0xba96ea)));_0x1ab4e2[_0x0df7('0xd9')]=0xe;_0x1ab4e2[_0x0df7('0xa4')]=_0x0df7('0x165');_0x1ab4e2[_0x0df7('0xa6')]=moment()[_0x0df7('0x76')](_0x0df7('0xf3'));_0x1ab4e2[_0x0df7('0xa5')]=_0x1ab4e2[_0x0df7('0xa6')];_0x8da59f[_0x0df7('0xc1')](_0x1ab4e2)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x166')));_0x8da59f[_0x0df7('0xd1')](_0x1ab4e2)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x166')))[_0x0df7('0x1a')](function(){delete _0x8da59f['actions'][_0x5656e0];return _0x341dbd(msgResponse(_0x0df7('0x140'),_0x0df7('0x4a'),'originate\x20action\x20Error'));});});});};Dialer[_0x0df7('0x17')][_0x0df7('0x2e')]=function(_0x506b2d){var _0x303475=this[_0x0df7('0x22')][_0x506b2d[_0x0df7('0x104')]];var _0x2f6259=this;if(_0x303475){delete this[_0x0df7('0x22')][_0x506b2d[_0x0df7('0x104')]];_0x303475[_0x0df7('0xf9')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');var _0x44ab97=_0x303475['type']===_0x0df7('0x8f')?this[_0x0df7('0x1d')][_0x303475[_0x0df7('0xb1')]]:this[_0x0df7('0x1c')][_0x303475['getQueue']()];if(!this[_0x0df7('0xca')](_0x506b2d[_0x0df7('0x167')])){this[_0x0df7('0xaf')](_0x44ab97);return this[_0x0df7('0x168')](_0x303475,_0x44ab97,_0x506b2d)['then'](function(_0x334e79){})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x169')));}else{this[_0x0df7('0x24')][_0x506b2d[_0x0df7('0xd2')]]=_0x303475;}}};Dialer[_0x0df7('0x17')][_0x0df7('0x16a')]=function(_0x555266,_0xe7abcb,_0x5a281){var _0x3fb8f8=new History(_0xe7abcb);if(_0x3fb8f8['countbusyretry']+_0x3fb8f8[_0x0df7('0x16b')]+_0x3fb8f8[_0x0df7('0x16c')]>=_0x5a281['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x555266){case 0x3:if(_0x3fb8f8[_0x0df7('0x16c')]>=_0x5a281[_0x0df7('0x16d')]-0x1){return!![];}else{this[_0x0df7('0xbc')]({'active':![],'countnoanswerretry':_0x3fb8f8[_0x0df7('0x16c')]+=0x1,'scheduledat':moment()[_0x0df7('0x16e')](_0x5a281['dialNoAnswerRetryFrequency'],_0x0df7('0x16f'))[_0x0df7('0x76')](_0x0df7('0xf3')),'ContactId':_0x3fb8f8[_0x0df7('0xc7')],'ListId':_0x3fb8f8['ListId'],'VoiceQueueId':_0x3fb8f8[_0x0df7('0x10f')]||undefined,'CampaignId':_0x3fb8f8[_0x0df7('0xc8')]||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x170')));}break;case 0x5:if(_0x3fb8f8[_0x0df7('0x171')]>=_0x5a281[_0x0df7('0x172')]-0x1){return!![];}else{this[_0x0df7('0xbc')]({'active':![],'countbusyretry':_0x3fb8f8[_0x0df7('0x171')]+=0x1,'scheduledat':moment()[_0x0df7('0x16e')](_0x5a281[_0x0df7('0x173')],_0x0df7('0x16f'))[_0x0df7('0x76')](_0x0df7('0xf3')),'ContactId':_0x3fb8f8[_0x0df7('0xc7')],'ListId':_0x3fb8f8[_0x0df7('0x10e')],'VoiceQueueId':_0x3fb8f8[_0x0df7('0x10f')]||undefined,'CampaignId':_0x3fb8f8[_0x0df7('0xc8')]||undefined})['catch'](loggerCatch(_0x0df7('0x174')));}break;case 0x8:if(_0x3fb8f8[_0x0df7('0x16b')]>=_0x5a281[_0x0df7('0x175')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0x3fb8f8['countcongestionretry']+=0x1,'scheduledat':moment()[_0x0df7('0x16e')](_0x5a281['dialCongestionRetryFrequency'],_0x0df7('0x16f'))[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3fb8f8[_0x0df7('0xc7')],'ListId':_0x3fb8f8['ListId'],'VoiceQueueId':_0x3fb8f8[_0x0df7('0x10f')]||undefined,'CampaignId':_0x3fb8f8['CampaignId']||undefined})[_0x0df7('0xad')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x0df7('0x17')][_0x0df7('0x168')]=function(_0x207d78,_0x5dfbd5,_0x494905){var _0x3a5d8c=this;var _0x541267=new History(_0x207d78);return new BPromise(function(_0x8ecc9b,_0x47fa67){if(_[_0x0df7('0x3e')](_0x5dfbd5)&&'object'!==typeof _0x5dfbd5){return _0x47fa67(msgResponse(_0x0df7('0x176'),_0x0df7('0x120'),_0x0df7('0x177')));}if(_[_0x0df7('0x3e')](_0x494905)&&_0x0df7('0x13f')!==typeof _0x494905){return _0x47fa67(msgResponse(_0x0df7('0x176'),_0x0df7('0x120'),_0x0df7('0x178')));}switch(_0x494905[_0x0df7('0xef')]){case'0':_0x5dfbd5[_0x0df7('0x179')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x0;_0x541267[_0x0df7('0xa4')]='NoSuchNumber';_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x17a')));if(_0x3a5d8c['checkRetriveMax'](0x0,_0x207d78,_0x5dfbd5)){if(_0x541267['countbusyretry']+_0x541267[_0x0df7('0x16b')]+_0x541267[_0x0df7('0x16c')]>=_0x5dfbd5[_0x0df7('0x17b')]){_0x3a5d8c[_0x0df7('0x17c')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x200\x20no\x20such\x20number....');}else{_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x5dfbd5[_0x0df7('0x65')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x3;_0x541267[_0x0df7('0xa4')]=_0x0df7('0x17e');_0x541267[_0x0df7('0x16c')]+=0x1;_0x541267[_0x0df7('0x17f')]+=0x1;_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x180')));if(_0x3a5d8c[_0x0df7('0x16a')](0x3,_0x207d78,_0x5dfbd5)){if(_0x541267['countnoanswerretry']>=_0x5dfbd5[_0x0df7('0x16d')]){_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,_0x0df7('0x181'));}else{_0x3a5d8c['stateGlobal'](_0x541267,_0x8ecc9b,_0x47fa67,_0x0df7('0x181'));}}break;case'5':_0x5dfbd5[_0x0df7('0x182')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x5;_0x541267[_0x0df7('0xa4')]=_0x0df7('0x183');_0x541267[_0x0df7('0x171')]+=0x1;_0x541267[_0x0df7('0x17f')]+=0x1;_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x184')));if(_0x3a5d8c[_0x0df7('0x16a')](0x5,_0x207d78,_0x5dfbd5)){if(_0x541267['countbusyretry']>=_0x5dfbd5[_0x0df7('0x172')]){_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x205\x20busy');}else{_0x3a5d8c[_0x0df7('0x17c')](_0x541267,_0x8ecc9b,_0x47fa67,_0x0df7('0x185'));}}break;case'8':_0x5dfbd5[_0x0df7('0x186')]+=0x1;_0x541267[_0x0df7('0xd9')]=0x8;_0x541267[_0x0df7('0xa4')]='Congestion';_0x541267[_0x0df7('0x16b')]+=0x1;_0x541267['countglobal']+=0x1;_0x3a5d8c['createHistory'](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x187')));if(_0x3a5d8c[_0x0df7('0x16a')](0x8,_0x207d78,_0x5dfbd5)){if(_0x541267[_0x0df7('0x16b')]>=_0x5dfbd5[_0x0df7('0x175')]){_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x208\x20congestion');}else{_0x3a5d8c[_0x0df7('0x17c')](_0x541267,_0x8ecc9b,_0x47fa67,'reason\x208\x20congestion');}}break;default:_0x5dfbd5[_0x0df7('0x68')]+=0x1;_0x541267[_0x0df7('0xd9')]=0xc;_0x541267[_0x0df7('0xa4')]=_0x494905[_0x0df7('0xef')];_0x3a5d8c[_0x0df7('0xc1')](_0x541267)[_0x0df7('0xad')](loggerCatch(_0x0df7('0x188')));if(_0x3a5d8c['checkRetriveMax'](_0x494905[_0x0df7('0xef')],_0x207d78,_0x5dfbd5)){if(_0x541267['countbusyretry']+_0x541267[_0x0df7('0x16b')]+_0x541267['countnoanswerretry']>=_0x5dfbd5[_0x0df7('0x17b')]){_0x3a5d8c['stateGlobal'](_0x541267,_0x8ecc9b,_0x47fa67,_0x494905[_0x0df7('0xef')]);}else{_0x3a5d8c[_0x0df7('0x17d')](_0x541267,_0x8ecc9b,_0x47fa67,_0x494905[_0x0df7('0xef')]);}}}});};Dialer[_0x0df7('0x17')][_0x0df7('0x17c')]=function(_0x396948,_0x52373d,_0x1c2b18,_0x191578){var _0x13439e=new Final(_0x396948);_0x13439e[_0x0df7('0xd9')]=0xf;_0x13439e[_0x0df7('0xa4')]=_0x0df7('0x189');this[_0x0df7('0x17d')](_0x13439e,_0x52373d,_0x1c2b18,_0x191578);};Dialer['prototype'][_0x0df7('0x17d')]=function(_0x3deb77,_0x22b935,_0x44bd1d,_0x4a818d){this['moveContactManagedDialer'](_0x3deb77)[_0x0df7('0xb5')](function(_0x431b0a){return _0x22b935(msgResponse(_0x0df7('0x176'),_0x0df7('0xcb'),_0x4a818d));})[_0x0df7('0xad')](function(_0xffc51c){return _0x44bd1d(msgResponse(_0x0df7('0x18a'),_0x0df7('0x120'),_0x0df7('0x18b')));});};Dialer[_0x0df7('0x17')][_0x0df7('0x9')]=function(_0x3fcea7){var _0x11b6a3=this;var _0x2367e5=_0x3fcea7[_0x0df7('0x18c')]/0x64;var _0x39f3e0=_0x3fcea7[_0x0df7('0x18d')]/(_0x3fcea7[_0x0df7('0x18d')]+_0x3fcea7[_0x0df7('0x63')]);var _0x381347=Math[_0x0df7('0x18e')](_0x3fcea7[_0x0df7('0x6f')]*(_0x3fcea7[_0x0df7('0x18f')]/0x64));var _0x4cd5c0=Math['round'](_0x3fcea7[_0x0df7('0x6f')]*(_0x3fcea7[_0x0df7('0x190')]/0x64));var _0x587f24=_0x3fcea7[_0x0df7('0x53')]+_0x3fcea7['talking'];var _0x2d45bf=Math[_0x0df7('0x191')](_0x3fcea7[_0x0df7('0x192')]*_0x3fcea7[_0x0df7('0x89')]*_0x3fcea7['predictiveIntervalHitRate']*_0x3fcea7['predictiveIntervalMultiplicativeFactor']);if(_[_0x0df7('0x3e')](_0x3fcea7['startProgressive'])){if(!_[_0x0df7('0x3e')](_0x3fcea7[_0x0df7('0x25')])){_0x3fcea7[_0x0df7('0x25')]=undefined;loggerPredictive[_0x0df7('0x93')](_0x0df7('0x193'),_0x0df7('0x194'));}if(!_['isUndefined'](_0x3fcea7[_0x0df7('0x8c')])){loggerPredictive['error'](_0x0df7('0x193'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x3fcea7[_0x0df7('0x8c')]);_0x3fcea7[_0x0df7('0x8c')]=undefined;}_0x3fcea7[_0x0df7('0x26')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0df7('0x77')](_0x3fcea7[_0x0df7('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x3fcea7[_0x0df7('0x26')]);this[_0x0df7('0x130')](_0x3fcea7,0x1);}else if(ifInterval(_0x3fcea7[_0x0df7('0x195')],_0x3fcea7['startProgressive'])){this[_0x0df7('0x130')](_0x3fcea7,0x1);loggerPredictiveCalls['info'](_0x0df7('0x196'),_0x3fcea7[_0x0df7('0x26')],_0x3fcea7[_0x0df7('0x40')]);_0x3fcea7[_0x0df7('0x192')]=0x0;_0x3fcea7[_0x0df7('0x6c')]=0x0;}else if(_0x2367e5<_0x39f3e0&&_0x3fcea7['dialPredictiveOptimization']===_0x0df7('0x197')){freeVariablesPredictive(_0x3fcea7);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x198'),_0x0df7('0x199'),_0x39f3e0,_0x0df7('0x26'),_0x3fcea7['name']);}else if(_0x2d45bf<_0x3fcea7[_0x0df7('0x6c')]&&_0x3fcea7[_0x0df7('0x19a')]===_0x0df7('0x197')){freeVariablesPredictive(_0x3fcea7);loggerPredictive[_0x0df7('0x77')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x0df7('0x19b'),_0x2d45bf,'Drop\x20in\x20this\x20interval',_0x3fcea7['predictiveIntervalErlangCallsDroppedCalls'],'startProgressive',_0x3fcea7[_0x0df7('0x40')]);}else if(!ifInterval(_0x3fcea7['dialPredictiveInterval'],_0x3fcea7[_0x0df7('0x26')])&&_[_0x0df7('0x3e')](_0x3fcea7[_0x0df7('0x25')])&&!_['isUndefined'](_0x3fcea7[_0x0df7('0x26')])){_0x3fcea7[_0x0df7('0x25')]=moment()[_0x0df7('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x0df7('0x77')](_0x3fcea7[_0x0df7('0x40')],'started\x20in\x20predictive\x20at',_0x3fcea7[_0x0df7('0x25')]);this[_0x0df7('0x19c')](_0x3fcea7[_0x0df7('0x195')])[_0x0df7('0xb5')](this[_0x0df7('0x19d')](_0x3fcea7))[_0x0df7('0xb5')](mergeDataErlangB(_0x3fcea7))['then'](this[_0x0df7('0x19e')](_0x3fcea7))[_0x0df7('0xad')](loggerCatchPredictive(_0x0df7('0x19f'),_0x3fcea7));}else if(!ifInterval(_0x3fcea7[_0x0df7('0x195')],_0x3fcea7['startPredictive'])){_0x3fcea7[_0x0df7('0x6c')]=0x0;_0x3fcea7[_0x0df7('0x25')]=moment()[_0x0df7('0x76')](_0x0df7('0xf3'));loggerPredictive[_0x0df7('0x77')](_0x3fcea7[_0x0df7('0x40')],'recalculate\x20predictive\x20at',_0x3fcea7[_0x0df7('0x25')]);clearInterval(_0x3fcea7[_0x0df7('0x8c')]);_0x3fcea7[_0x0df7('0x8c')]=undefined;this['averageHandleTime'](_0x3fcea7['dialPredictiveInterval'])[_0x0df7('0xb5')](this['getDataPredictive'](_0x3fcea7))['then'](mergeDataErlangB(_0x3fcea7))['then'](this[_0x0df7('0x19e')](_0x3fcea7))[_0x0df7('0xad')](loggerCatchPredictive(_0x0df7('0x1a0'),_0x3fcea7));}else if(_0x3fcea7[_0x0df7('0x6f')]&&_0x587f24<_0x3fcea7[_0x0df7('0x6f')]-_0x4cd5c0){freeVariablesPredictive(_0x3fcea7);loggerPredictive[_0x0df7('0x77')](_0x3fcea7['name'],_0x0df7('0x1a1'),_0x587f24,_0x0df7('0x1a2'),_0x3fcea7[_0x0df7('0x6f')],'-',_0x4cd5c0,'=',_0x3fcea7[_0x0df7('0x6f')]-_0x4cd5c0,')');}else if(_0x3fcea7[_0x0df7('0x6f')]&&_0x587f24>_0x3fcea7[_0x0df7('0x6f')]+_0x381347){freeVariablesPredictive(_0x3fcea7);loggerPredictive['info'](_0x3fcea7[_0x0df7('0x40')],_0x0df7('0x1a1'),_0x587f24,_0x0df7('0x1a3'),_0x3fcea7['predictiveIntervalAvailable'],'+',_0x381347,'=',_0x3fcea7[_0x0df7('0x6f')]+_0x381347,')');}};Dialer[_0x0df7('0x17')][_0x0df7('0x19d')]=function(_0x3c0184){var _0x11ee53=this;return function(_0x520e10){return new BPromise(function(_0x2e1347,_0x3cb203){_[_0x0df7('0x8a')](_0x3c0184,_0x520e10[0x0]);if(checkGetDataPredictive(_0x520e10[0x0])){var _0x300b16=_0x3c0184[_0x0df7('0x6f')]=_0x3c0184[_0x0df7('0x9e')]+_0x3c0184['available'];var _0x40194e=_0x3c0184[_0x0df7('0x195')]*0x3c;var _0x90fa9=_0x520e10[0x0]['predictiveIntervalAvgTalktime']+_0x520e10[0x0]['predictiveIntervalAvgHoldtime'];var _0x2d1373=(_0x520e10[0x0]['predictiveIntervalAnsweredCalls']+_0x520e10[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x520e10[0x0][_0x0df7('0xff')])/_0x520e10[0x0][_0x0df7('0x70')];_0x3c0184[_0x0df7('0x6d')]=_0x2d1373>0x0?_0x2d1373:0x1;switch(_0x3c0184[_0x0df7('0x19a')]){case _0x0df7('0x197'):var _0x55f19c=_0x3c0184[_0x0df7('0x18c')]/0x64;return _0x11ee53[_0x0df7('0x1a4')](_0x300b16,_0x40194e,_0x90fa9,_0x2d1373,_0x55f19c)['then'](function(_0x415c41){return _0x2e1347(_0x415c41);});case _0x0df7('0x1a5'):var _0x21087d=_0x3c0184['dialPredictiveOptimizationPercentage']/0x64;return _0x11ee53['busyFactor'](_0x300b16,_0x40194e,_0x90fa9,_0x2d1373,_0x21087d)[_0x0df7('0xb5')](function(_0x2bc6ea){return _0x2e1347(_0x2bc6ea);});default:return _0x3cb203(msgResponse(_0x0df7('0x1a6'),'Failure',_0x0df7('0x1a7')));}}else{return _0x3cb203(msgResponse(_0x0df7('0x1a6'),_0x0df7('0x120'),'check\x20failure'));}});};};Dialer[_0x0df7('0x17')]['getDataPredictiveOld']=function(_0x5c2438){var _0xb01591=this;return function(_0x1fff7d){return new BPromise(function(_0x4afc71,_0x4dfe1e){_[_0x0df7('0x8a')](_0x5c2438,_0x1fff7d[0x0]);if(checkGetDataPredictive(_0x1fff7d[0x0])){loggerPredictive[_0x0df7('0x77')](JSON['stringify'](_0x1fff7d[0x0]));if(_0x5c2438[_0x0df7('0x19a')]===_0x0df7('0x197')){return _0xb01591['getVoiceQueueRtPauses'](_0x5c2438['id'])[_0x0df7('0xb5')](function(_0x1ce6ff){var _0x10f887=_0x5c2438['loggedIn']-_0x1ce6ff[0x0][_0x0df7('0x1a8')];var _0x378149=_0x5c2438[_0x0df7('0x195')]*0x3c;var _0x116cc0=_0x1fff7d[0x0][_0x0df7('0x7f')]+_0x1fff7d[0x0][_0x0df7('0x7d')];var _0x5c7264=(_0x1fff7d[0x0][_0x0df7('0x69')]+_0x1fff7d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1fff7d[0x0][_0x0df7('0xff')])/_0x1fff7d[0x0][_0x0df7('0x70')];var _0x2e5dba=_0x5c2438['dialPredictiveOptimizationPercentage']/0x64;_0x5c2438[_0x0df7('0x6e')]=_0x1ce6ff[0x0][_0x0df7('0x1a8')]||0x0;_0x5c2438[_0x0df7('0x6d')]=_0x5c7264>0x0?_0x5c7264:0x1;return _0xb01591[_0x0df7('0x1a4')](_0x10f887,_0x378149,_0x116cc0,_0x5c7264,_0x2e5dba);})[_0x0df7('0xb5')](function(_0x2656a2){return _0x4afc71(_0x2656a2);})[_0x0df7('0xad')](function(_0x2f9003){return _0x4dfe1e(msgResponse('[CatchErlangB]',_0x0df7('0x120'),JSON[_0x0df7('0x4b')](_0x2f9003)));});}if(_0x5c2438[_0x0df7('0x19a')]==='agentBusyFactor'){return _0xb01591[_0x0df7('0xbf')](_0x5c2438['id'])['then'](function(_0x536639){var _0x164a63=_0x5c2438[_0x0df7('0x54')]-_0x536639[0x0][_0x0df7('0x1a8')];var _0x4245b6=_0x5c2438['dialPredictiveInterval']*0x3c;var _0x3e4ca3=_0x1fff7d[0x0][_0x0df7('0x7f')]+_0x1fff7d[0x0][_0x0df7('0x7d')];var _0x26e36b=(_0x1fff7d[0x0][_0x0df7('0x69')]+_0x1fff7d[0x0][_0x0df7('0x6a')]+_0x1fff7d[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x1fff7d[0x0][_0x0df7('0x70')];var _0x58c562=_0x5c2438[_0x0df7('0x18c')]/0x64;_0x5c2438[_0x0df7('0x6e')]=_0x536639[0x0][_0x0df7('0x1a8')]||0x0;_0x5c2438[_0x0df7('0x6d')]=_0x26e36b>0x0?_0x26e36b:0x1;return _0xb01591['busyFactor'](_0x164a63,_0x4245b6,_0x3e4ca3,_0x26e36b,_0x58c562);})['then'](function(_0x3b5401){return _0x4afc71(_0x3b5401);})[_0x0df7('0xad')](function(_0xb789fc){return _0x4dfe1e(msgResponse('[CatchErlangB]',_0x0df7('0x120'),JSON['stringify'](_0xb789fc)));});}}else{return _0x4dfe1e(msgResponse(_0x0df7('0x1a6'),_0x0df7('0x120'),_0x0df7('0x1a9')));}});};};Dialer['prototype'][_0x0df7('0x19e')]=function(_0x2054ed){var _0x52d643=this;return function(){var _0x2938a3=0x0;var _0x362503=Math[_0x0df7('0x191')](_0x2054ed[_0x0df7('0x1aa')]*0x3e8);if(_0x362503>0x0){_0x362503=_0x362503<0x64?0x64:_0x362503;loggerPredictive['info'](_0x2054ed[_0x0df7('0x40')],'one\x20call\x20every:',_0x362503,_0x0df7('0x4c'));_0x2054ed[_0x0df7('0x8c')]=setInterval(function(){_0x52d643[_0x0df7('0x8c')](_0x2054ed);loggerPredictiveCalls[_0x0df7('0x77')](_0x0df7('0x1ab'),_0x2938a3+=0x1);},_0x362503);}else{loggerPredictive[_0x0df7('0x77')](_0x2054ed[_0x0df7('0x40')],_0x0df7('0x1ac'));}};};Dialer[_0x0df7('0x17')][_0x0df7('0x1ad')]=function(_0xc37e3,_0x3160a4){var _0x15a380=this;return function(_0x8100f1){if(_[_0x0df7('0x48')](_0x8100f1)){if(_[_0x0df7('0xa9')](_0x3160a4[_0x0df7('0x1ae')])||!_0x3160a4[_0x0df7('0x1af')]){if(_0xc37e3[_0x0df7('0x5e')]===_0x0df7('0x133')){_0xc37e3[_0x0df7('0x10a')]=_[_0x0df7('0x3e')](_0xc37e3[_0x0df7('0x10a')])?!![]:_0xc37e3['queueStatusComplete'];var _0xb171b0=uuid['v4']();_0x15a380[_0x0df7('0x22')][_0xb171b0]=new Action(_0xc37e3,_0x3160a4,_0xb171b0);loggerBooked[_0x0df7('0x77')](_0x0df7('0x1b0'),_0xb171b0,_0x0df7('0x1b1'),JSON[_0x0df7('0x4b')](_0xc37e3[_0x0df7('0x10a')]),_0x0df7('0x1b2'),_0xc37e3['name']);if(_0xc37e3['queueStatusComplete']){_0xc37e3['queueStatusComplete']=![];_0x15a380[_0x0df7('0x28')][_0x15a380[_0x0df7('0x22')][_0xb171b0]['queue']]=[];ami[_0x0df7('0xaa')]({'actionid':_0xb171b0,'action':'queuestatus','queue':_0xc37e3[_0x0df7('0x40')]})['catch'](function(_0x4144b9){_0x15a380[_0x0df7('0xaf')](_0xc37e3);_0x15a380[_0x0df7('0xbc')]({'active':![],'ContactId':_0x15a380[_0x0df7('0x22')][_0xb171b0]['ContactId'],'ListId':_0x15a380['actions'][_0xb171b0]['ListId'],'VoiceQueueId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0x10f')]||undefined,'CampaignId':_0x15a380['actions'][_0xb171b0]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x15a380['actions'][_0xb171b0];});}else{loggerBooked['info'](_0x0df7('0x1b3'),JSON[_0x0df7('0x4b')](_0xc37e3['queueStatusComplete']),'Queue:\x20',_0xc37e3[_0x0df7('0x40')]);_0x15a380[_0x0df7('0xaf')](_0xc37e3);_0x15a380[_0x0df7('0xbc')]({'active':![],'ContactId':_0x15a380['actions'][_0xb171b0][_0x0df7('0xc7')],'ListId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0x10e')],'VoiceQueueId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0x10f')]||undefined,'CampaignId':_0x15a380[_0x0df7('0x22')][_0xb171b0][_0x0df7('0xc8')]||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x1b4')));delete _0x15a380[_0x0df7('0x22')][_0xb171b0];}}else{return _0x15a380[_0x0df7('0x1b5')](_0xc37e3,_0x3160a4);}}else{if(getDiff(_0x3160a4[_0x0df7('0x1b6')])<_0xc37e3['dialRecallMeTimeout']*0x3c){_0x15a380[_0x0df7('0x8e')]['run'](_0x3160a4['id'])[_0x0df7('0x1a')](function(){_0x15a380['updateOriginated'](_0xc37e3);});}else{_0xc37e3['outboundReCallsDay']+=0x1;_0x15a380['updateOriginated'](_0xc37e3);if(_0xc37e3[_0x0df7('0x1b7')]){_0x15a380[_0x0df7('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3160a4[_0x0df7('0xc7')],'ListId':_0x3160a4[_0x0df7('0x10e')],'VoiceQueueId':_0x3160a4['VoiceQueueId']||undefined,'CampaignId':_0x3160a4[_0x0df7('0xc8')]||undefined})[_0x0df7('0xad')](loggerCatch(_0x0df7('0x1b8')));_0x15a380[_0x0df7('0xc1')](createObjHistory(_0xc37e3,_0x3160a4,_0x0df7('0x1b9'),0x17,_0x0df7('0x1ba')))[_0x0df7('0xad')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x15a380[_0x0df7('0xd0')](createObjHistory(_0xc37e3,_0x3160a4,_0x0df7('0x1bb'),0x16,_0x0df7('0x1bc')),_0x0df7('0x1bd'),_0x0df7('0x1be'));}}}}else{_0xc37e3[_0x0df7('0x1bf')]+=0x1;_0x15a380['saveInDb'](createObjHistory(_0xc37e3,_0x3160a4,_0x0df7('0x1c0'),0xd,_0x0df7('0x1c1')),_0x0df7('0x1c2'),_0x0df7('0x1c3'));throw'inBlackList';}};};Dialer[_0x0df7('0x17')][_0x0df7('0x137')]=function(_0x3f7682){var _0x22648f=this;var _0xebfa5=[];var _0xff7d8e=_0x3f7682[_0x0df7('0x1c4')]-_0x3f7682['originated']-_0x3f7682['temp'];emitCampaignSummary(_0x3f7682);if(_0xff7d8e>0x0){if(_0xff7d8e>this[_0x0df7('0x20')]){_0xff7d8e=this['maxNumberOriginate'];}_0x3f7682[_0x0df7('0x1c5')]+=_0xff7d8e;this[_0x0df7('0x1c6')](_0x3f7682['id'],_0xff7d8e,_0x3f7682[_0x0df7('0x1c7')])[_0x0df7('0xb5')](function(_0x75ebd6){_0x3f7682[_0x0df7('0x1c5')]-=_0xff7d8e;_0x3f7682[_0x0df7('0x1c5')]=_0x3f7682[_0x0df7('0x1c5')]>0x0?_0x3f7682['temp']:0x0;if(!checkContactEmpty(_0x75ebd6)){_0x3f7682[_0x0df7('0x3f')]=_0x0df7('0x1c8');logger[_0x0df7('0x77')](_0x0df7('0x1c9')+_0x3f7682[_0x0df7('0x40')]);}else{_0x3f7682[_0x0df7('0x71')]+=_0x75ebd6[_0x0df7('0x96')];_0x3f7682[_0x0df7('0x3f')]='RUNNING';for(var _0x5cd21c=0x0;_0x5cd21c<_0x75ebd6[_0x0df7('0x96')];_0x5cd21c+=0x1){_0x3f7682[_0x0df7('0x1ca')]+=0x1;if(_[_0x0df7('0xa9')](_0x75ebd6[_0x5cd21c])||_[_0x0df7('0xa9')](_0x75ebd6[_0x5cd21c]['Contact'])||_[_0x0df7('0xa9')](_0x75ebd6[_0x5cd21c][_0x0df7('0x141')][_0x0df7('0x142')])){_0x22648f[_0x0df7('0x1cb')](_0x0df7('0x1cc'),_0x3f7682,_0x75ebd6[_0x5cd21c]);}else{_0x22648f[_0x0df7('0xb9')](_[_0x0df7('0xc6')](_0x75ebd6[_0x5cd21c],[_0x0df7('0xc8'),_0x0df7('0x1cd')]))[_0x0df7('0xb5')](_0x22648f[_0x0df7('0x1ad')](_0x3f7682,_0x75ebd6[_0x5cd21c]))['catch'](_0x22648f[_0x0df7('0xc5')]('[actionOriginateIvr]\x20',_0x3f7682));}}}})[_0x0df7('0xad')](loggerGetContactDialer(_0x0df7('0x1ce'),_0x3f7682,_0xff7d8e));}};Dialer['prototype'][_0x0df7('0x130')]=function(_0x5bcf44,_0xd95d5f){var _0x27bec9=this;var _0x11a54e=[];var _0x46123f=_0xd95d5f>=0x1?_0xd95d5f:0x1;var _0x479d5e=[];if(_0x5bcf44[_0x0df7('0x5e')]===_0x0df7('0x133')){_0x46123f=0x1;}var _0x4185ec=Math[_0x0df7('0x191')](_0x5bcf44['available']*_0x46123f)-_0x5bcf44[_0x0df7('0x71')]-_0x5bcf44[_0x0df7('0x1c5')];emitVoiceQueueSummary(_0x5bcf44);if(_0x5bcf44['dialLimitQueue']>0x0){var _0x263d2e=_0x5bcf44['dialLimitQueue']-_0x5bcf44[_0x0df7('0x71')]-_0x5bcf44[_0x0df7('0x9e')]-_0x5bcf44[_0x0df7('0x1c5')]-_0x5bcf44[_0x0df7('0x55')];if(_0x4185ec>_0x263d2e){_0x4185ec=_0x263d2e;}}if(_0x4185ec>0x0){if(_0x5bcf44[_0x0df7('0x5e')]===_0x0df7('0x133')){_0x4185ec=0x1;}if(_0x4185ec>this[_0x0df7('0x20')]){_0x4185ec=this['maxNumberOriginate'];}_0x5bcf44['temp']+=_0x4185ec;for(var _0x4fe560 in this[_0x0df7('0x1e')]){if(this['agents'][_0x0df7('0x97')](_0x4fe560)){if(this['agents'][_0x4fe560][_0x0df7('0xd9')]==='not_inuse'&&this[_0x0df7('0x1e')][_0x4fe560][_0x0df7('0xab')]==='reachable'){_0x11a54e[_0x0df7('0x108')](this[_0x0df7('0x1e')][_0x4fe560]['id']);}}}this[_0x0df7('0xbe')](_0x5bcf44['id'],_0x11a54e,_0x4185ec,_0x5bcf44[_0x0df7('0x1c7')])[_0x0df7('0xb5')](function(_0x446844){_0x5bcf44[_0x0df7('0x1c5')]-=_0x4185ec;_0x5bcf44[_0x0df7('0x1c5')]=_0x5bcf44[_0x0df7('0x1c5')]>0x0?_0x5bcf44[_0x0df7('0x1c5')]:0x0;if(!checkContactEmpty(_0x446844)){_0x27bec9[_0x0df7('0xb3')](_0x5bcf44)[_0x0df7('0xb5')](sendMessageReschedule(_0x5bcf44))[_0x0df7('0xad')](loggerCatch(_0x0df7('0xb6')));}else{_0x5bcf44[_0x0df7('0x71')]+=_0x446844[_0x0df7('0x96')];_0x5bcf44[_0x0df7('0x3f')]=_0x5bcf44[_0x0df7('0x5e')]===_0x0df7('0x133')?_0x0df7('0x149'):'RUNNING';for(var _0x2641b5=0x0;_0x2641b5<_0x446844[_0x0df7('0x96')];_0x2641b5+=0x1){if(_[_0x0df7('0xa9')](_0x446844[_0x2641b5])||_[_0x0df7('0xa9')](_0x446844[_0x2641b5][_0x0df7('0x141')])||_['isNil'](_0x446844[_0x2641b5][_0x0df7('0x141')][_0x0df7('0x142')])){_0x27bec9['emptyContact']('[actionOriginate]\x20',_0x5bcf44,_0x446844[_0x2641b5]);}else{_0x27bec9[_0x0df7('0xb7')](_['pick'](_0x446844[_0x2641b5],[_0x0df7('0x10f'),_0x0df7('0x1cd')]))[_0x0df7('0xb5')](_0x27bec9[_0x0df7('0x1ad')](_0x5bcf44,_0x446844[_0x2641b5]))[_0x0df7('0xad')](_0x27bec9['loggerHandler'](_0x0df7('0x1cc'),_0x5bcf44));}}}})['catch'](loggerGetContactDialer(_0x0df7('0x1cf'),_0x5bcf44,_0x4185ec));}};Dialer['prototype']['handlePredictive']=function(_0x51aa31){var _0x29aa51=this;if(_0x51aa31[_0x0df7('0x1d0')]>0x0){var _0x4a2e52=_0x51aa31[_0x0df7('0x1d0')]-_0x51aa31['originated']-_0x51aa31[_0x0df7('0x9e')];if(_0x4a2e52>0x0){this[_0x0df7('0x1d1')](_0x51aa31);}else{loggerPredictiveCalls[_0x0df7('0x77')](_0x0df7('0x1d2'));}}else{this[_0x0df7('0x1d1')](_0x51aa31);}};Dialer[_0x0df7('0x17')][_0x0df7('0x1d1')]=function(_0x28df5d){var _0x44af5a=this;var _0x3332fd=[];_0x28df5d[_0x0df7('0x71')]+=0x1;for(var _0x208948 in this[_0x0df7('0x1e')]){if(this['agents'][_0x0df7('0x97')](_0x208948)){if(this[_0x0df7('0x1e')][_0x208948][_0x0df7('0xd9')]===_0x0df7('0x1d3')&&this[_0x0df7('0x1e')][_0x208948]['status']==='reachable'){_0x3332fd['push'](this[_0x0df7('0x1e')][_0x208948]['id']);}}}this[_0x0df7('0xbe')](_0x28df5d['id'],_0x3332fd,0x1,_0x28df5d[_0x0df7('0x1c7')])[_0x0df7('0xb5')](function(_0x5e35d2){if(!checkContactEmpty(_0x5e35d2)){checkContactLowerLimitOriginate(_0x28df5d,0x1,0x0);_0x44af5a[_0x0df7('0xb3')](_0x28df5d)['then'](sendMessageReschedule(_0x28df5d))[_0x0df7('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x28df5d[_0x0df7('0x3f')]='RUNNING';if(_['isNil'](_0x5e35d2[0x0])||_['isNil'](_0x5e35d2[0x0][_0x0df7('0x141')])||_[_0x0df7('0xa9')](_0x5e35d2[0x0][_0x0df7('0x141')]['phone'])){_0x44af5a[_0x0df7('0x1cb')](_0x0df7('0x1cc'),_0x28df5d,_0x5e35d2[0x0]);}else{_0x44af5a['checkIsBlackList'](_['pick'](_0x5e35d2[0x0],[_0x0df7('0x10f'),_0x0df7('0x1cd')]))['then'](_0x44af5a[_0x0df7('0x1ad')](_0x28df5d,_0x5e35d2[0x0]))[_0x0df7('0xad')](_0x44af5a['loggerHandler'](_0x0df7('0x1d4'),_0x28df5d));}}})[_0x0df7('0xad')](loggerGetContactDialer(_0x0df7('0x1d5'),_0x28df5d,0x1));emitVoiceQueueSummary(_0x28df5d);};Dialer[_0x0df7('0x17')][_0x0df7('0x1a4')]=function(_0x495c25,_0x32c050,_0x5c5124,_0x9aacbe,_0x1ac547,_0x5eb696){loggerPredictive['info'](_0x0df7('0x1d6'));loggerPredictive[_0x0df7('0x77')]('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',_0x495c25);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1d7'),_0x32c050);loggerPredictive[_0x0df7('0x77')]('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',_0x5c5124);loggerPredictive['info']('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',_0x9aacbe);loggerPredictive[_0x0df7('0x77')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ac547);loggerPredictive[_0x0df7('0x77')]('---------------------------');return new BPromise(function(_0x1b5b0a,_0x79a15f){if(_0x495c25<=0x0||isNaN(_0x495c25)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),_0x0df7('0x4a'),_0x0df7('0x1d9')+_0x495c25));}if(_0x5c5124<=0x0||isNaN(_0x5c5124)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),'Error','Ts\x20=\x20'+_0x5c5124));}if(_0x9aacbe<=0x0||isNaN(_0x9aacbe)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),_0x0df7('0x4a'),_0x0df7('0x1da')+_0x9aacbe));}if(_0x32c050<=0x0||isNaN(_0x32c050)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),'Error','interval\x20=\x20'+_0x32c050));}if(_0x1ac547<=0x0||isNaN(_0x1ac547)){return _0x79a15f(msgResponse(_0x0df7('0x1d8'),_0x0df7('0x4a'),'Amax\x20=\x20'+_0x1ac547));}_0x5eb696=_0x5eb696||0x0;var _0x30d66e=0x1/_0x5c5124;var _0x3e466d=0x0;var _0x4ee2a5=0x0;var _0x66e989=0x0;var _0xf999d4=0x0;for(var _0x2b0468=0x0;_0x66e989<_0x1ac547;_0x2b0468+=0x1){_0x4ee2a5=_0x2b0468/_0x32c050;_0x3e466d=(_0x9aacbe*_0x4ee2a5+_0x5eb696)/_0x30d66e;_0x66e989=erlangb(_0x3e466d,_0x495c25);_0xf999d4=_0x3e466d/_0x495c25*(0x1-erlangb(_0x3e466d,_0x495c25));}return _0x1b5b0a({'erlangCalls':_0x2b0468,'erlangCallToSecond':_0x32c050/_0x2b0468,'erlangAbandonmentRate':_0x66e989,'erlangBusyFactor':_0xf999d4});});};Dialer['prototype'][_0x0df7('0x1db')]=function(_0x528a11,_0x389e23,_0x6b77da,_0x501e1e,_0x8f3f73,_0x2a289f){loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1dc'));loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1dd'),_0x528a11);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1d7'),_0x389e23);loggerPredictive[_0x0df7('0x77')]('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',_0x6b77da);loggerPredictive[_0x0df7('0x77')](_0x0df7('0x1de'),_0x501e1e);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x8f3f73);loggerPredictive[_0x0df7('0x77')]('---------------------------');return new BPromise(function(_0x4bf011,_0xaf512a){if(_0x528a11<=0x0||isNaN(_0x528a11)){return _0xaf512a(msgResponse(_0x0df7('0x1df'),'Error',_0x0df7('0x1d9')+_0x528a11));}if(_0x6b77da<=0x0||isNaN(_0x6b77da)){return _0xaf512a(msgResponse('[busyFactor]',_0x0df7('0x4a'),'Ts\x20=\x20'+_0x6b77da));}if(_0x501e1e<=0x0||isNaN(_0x501e1e)){return _0xaf512a(msgResponse('[busyFactor]',_0x0df7('0x4a'),_0x0df7('0x1da')+_0x501e1e));}if(_0x389e23<=0x0||isNaN(_0x389e23)){return _0xaf512a(msgResponse(_0x0df7('0x1df'),_0x0df7('0x4a'),_0x0df7('0x1e0')+_0x389e23));}if(_0x8f3f73<=0x0||isNaN(_0x8f3f73)){return _0xaf512a(msgResponse(_0x0df7('0x1df'),'Error',_0x0df7('0x1e1')+_0x8f3f73));}_0x2a289f=_0x2a289f||0x0;var _0x2d7333=0x1/_0x6b77da;var _0x2d2449=0x0;var _0x3bb0a5=0x0;var _0x20dfe3=0x0;var _0x5d098c=0x0;for(var _0x4943a7=0x0;_0x5d098c<_0x8f3f73;_0x4943a7+=0x1){_0x3bb0a5=_0x4943a7/_0x389e23;_0x2d2449=(_0x501e1e*_0x3bb0a5+_0x2a289f)/_0x2d7333;_0x20dfe3=erlangb(_0x2d2449,_0x528a11);_0x5d098c=_0x2d2449/_0x528a11*(0x1-erlangb(_0x2d2449,_0x528a11));}return _0x4bf011({'erlangCalls':_0x4943a7,'erlangCallToSecond':_0x389e23/_0x4943a7,'erlangAbandonmentRate':_0x20dfe3,'erlangBusyFactor':_0x5d098c});});};module[_0x0df7('0x1e2')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index e024083..67fcb2f 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 _0xcd17=['scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','responsetime','droptime','endtime','holdtime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff'];(function(_0xa25342,_0x24522b){var _0x52be43=function(_0x1ea0e9){while(--_0x1ea0e9){_0xa25342['push'](_0xa25342['shift']());}};_0x52be43(++_0x24522b);}(_0xcd17,0x103));var _0x7cd1=function(_0x35aaee,_0x54fe86){_0x35aaee=_0x35aaee-0x0;var _0x5cf6a4=_0xcd17[_0x35aaee];return _0x5cf6a4;};'use strict';var util=require(_0x7cd1('0x0'));var _=require(_0x7cd1('0x1'));var moment=require(_0x7cd1('0x2'));function getSeconds(_0x4c6265,_0x41dd18){var _0x1d5d47=moment(_0x4c6265)[_0x7cd1('0x3')](0x0);var _0x206058=moment(_0x41dd18)['milliseconds'](0x0);return _0x1d5d47[_0x7cd1('0x4')](_0x206058,'seconds');}function QueueCallerAbandon(_0x361d5a,_0x3311d6){this[_0x7cd1('0x5')]=_0x361d5a['scheduledat'];this['type']=_0x361d5a[_0x7cd1('0x6')];this[_0x7cd1('0x7')]=_0x361d5a[_0x7cd1('0x6')]===_0x7cd1('0x8')?'queue':_0x361d5a[_0x7cd1('0x6')];this[_0x7cd1('0x9')]=_0x361d5a[_0x7cd1('0x9')];this['countcongestionretry']=_0x361d5a[_0x7cd1('0xa')];this[_0x7cd1('0xb')]=_0x361d5a[_0x7cd1('0xb')];this[_0x7cd1('0xc')]=_0x361d5a[_0x7cd1('0x9')]+_0x361d5a[_0x7cd1('0xa')]+_0x361d5a[_0x7cd1('0xb')];this[_0x7cd1('0xd')]=_0x3311d6[_0x7cd1('0xd')];this[_0x7cd1('0xe')]=_0x361d5a[_0x7cd1('0xf')];this[_0x7cd1('0x10')]=_0x361d5a[_0x7cd1('0x11')];this['starttime']=_0x361d5a['starttime'];this[_0x7cd1('0x12')]=_0x361d5a['responsetime'];this[_0x7cd1('0x13')]=_0x361d5a['droptime'];this[_0x7cd1('0x14')]=this[_0x7cd1('0x13')];this['ringtime']=getSeconds(_0x361d5a[_0x7cd1('0x12')],_0x361d5a['starttime']);this[_0x7cd1('0x15')]=getSeconds(this['droptime'],_0x361d5a['responsetime']);this['talktime']=0x0;this[_0x7cd1('0x16')]=_0x3311d6[_0x7cd1('0x16')];this['membername']=_0x3311d6['connectedlinename'];this[_0x7cd1('0x17')]=_0x3311d6[_0x7cd1('0x17')];this[_0x7cd1('0x18')]=_0x361d5a[_0x7cd1('0x18')];this[_0x7cd1('0x19')]=_0x361d5a['callbackuniqueid'];this[_0x7cd1('0x1a')]=_0x361d5a['callbackat'];this['recallme']=_0x361d5a[_0x7cd1('0x1b')];this['ContactId']=_0x361d5a['ContactId'];this[_0x7cd1('0x1c')]=_0x361d5a[_0x7cd1('0x1c')];this[_0x7cd1('0x1d')]=_0x361d5a[_0x7cd1('0x1d')];this['VoiceQueueId']=_0x361d5a['VoiceQueueId'];this[_0x7cd1('0x1e')]=_0x361d5a[_0x7cd1('0x1e')];this[_0x7cd1('0x1f')]=_0x361d5a[_0x7cd1('0x1f')]||'';this[_0x7cd1('0x20')]=_0x361d5a[_0x7cd1('0x20')]||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x8827=['campaigntype','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','scheduledat'];(function(_0x75e338,_0x5dbfe9){var _0x367cb2=function(_0xb116d3){while(--_0xb116d3){_0x75e338['push'](_0x75e338['shift']());}};_0x367cb2(++_0x5dbfe9);}(_0x8827,0x1e4));var _0x7882=function(_0x299402,_0x33278d){_0x299402=_0x299402-0x0;var _0x1bddfc=_0x8827[_0x299402];return _0x1bddfc;};'use strict';var util=require(_0x7882('0x0'));var _=require(_0x7882('0x1'));var moment=require('moment');function getSeconds(_0xaae6e9,_0x27c3d2){var _0x3b8ce6=moment(_0xaae6e9)[_0x7882('0x2')](0x0);var _0x2b474e=moment(_0x27c3d2)[_0x7882('0x2')](0x0);return _0x3b8ce6[_0x7882('0x3')](_0x2b474e,_0x7882('0x4'));}function QueueCallerAbandon(_0xf65a3d,_0x34e5bf){this['scheduledat']=_0xf65a3d[_0x7882('0x5')];this['type']=_0xf65a3d['type'];this[_0x7882('0x6')]=_0xf65a3d['type']==='outbound'?_0x7882('0x7'):_0xf65a3d[_0x7882('0x8')];this['countbusyretry']=_0xf65a3d[_0x7882('0x9')];this['countcongestionretry']=_0xf65a3d[_0x7882('0xa')];this[_0x7882('0xb')]=_0xf65a3d[_0x7882('0xb')];this['countglobal']=_0xf65a3d[_0x7882('0x9')]+_0xf65a3d[_0x7882('0xa')]+_0xf65a3d[_0x7882('0xb')];this['uniqueid']=_0x34e5bf[_0x7882('0xc')];this[_0x7882('0xd')]=_0xf65a3d[_0x7882('0xe')];this[_0x7882('0xf')]=_0xf65a3d[_0x7882('0x10')];this[_0x7882('0x11')]=_0xf65a3d[_0x7882('0x11')];this[_0x7882('0x12')]=_0xf65a3d[_0x7882('0x12')];this[_0x7882('0x13')]=_0xf65a3d[_0x7882('0x13')];this[_0x7882('0x14')]=this[_0x7882('0x13')];this['ringtime']=getSeconds(_0xf65a3d['responsetime'],_0xf65a3d[_0x7882('0x11')]);this['holdtime']=getSeconds(this['droptime'],_0xf65a3d['responsetime']);this['talktime']=0x0;this['queue']=_0x34e5bf[_0x7882('0x7')];this[_0x7882('0x15')]=_0x34e5bf[_0x7882('0x16')];this[_0x7882('0x17')]=_0x34e5bf[_0x7882('0x17')];this['callback']=_0xf65a3d['callback'];this[_0x7882('0x18')]=_0xf65a3d[_0x7882('0x18')];this[_0x7882('0x19')]=_0xf65a3d[_0x7882('0x19')];this[_0x7882('0x1a')]=_0xf65a3d['recallme'];this[_0x7882('0x1b')]=_0xf65a3d[_0x7882('0x1b')];this[_0x7882('0x1c')]=_0xf65a3d[_0x7882('0x1c')];this[_0x7882('0x1d')]=_0xf65a3d['UserId'];this[_0x7882('0x1e')]=_0xf65a3d[_0x7882('0x1e')];this['CampaignId']=_0xf65a3d[_0x7882('0x1f')];this[_0x7882('0x20')]=_0xf65a3d['originatecalleridnum']||'';this[_0x7882('0x21')]=_0xf65a3d[_0x7882('0x21')]||'';}module[_0x7882('0x22')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index b3d6894..d4eb27a 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 _0x0b6c=['path','AttachmentId','exports','util','lodash','moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','fax','localstationid','headerinfo'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0b6c,0x1b6));var _0xc0b6=function(_0x1d35e6,_0x215fe4){_0x1d35e6=_0x1d35e6-0x0;var _0x3a245e=_0x0b6c[_0x1d35e6];return _0x3a245e;};'use strict';var util=require(_0xc0b6('0x0'));var _=require(_0xc0b6('0x1'));var moment=require(_0xc0b6('0x2'));function Action(_0x9da021,_0x2f5814,_0x1d732c){this[_0xc0b6('0x3')]=_0x9da021||undefined;this[_0xc0b6('0x4')]=util[_0xc0b6('0x5')](_0xc0b6('0x6'),_0x2f5814[_0xc0b6('0x7')],_0x2f5814[_0xc0b6('0x8')]['name'],_0x1d732c[_0xc0b6('0x9')]);this[_0xc0b6('0xa')]=_0x2f5814[_0xc0b6('0xa')];this['headerinfo']=_0x2f5814[_0xc0b6('0xb')];this[_0xc0b6('0xc')]=_0x1d732c['path'];this[_0xc0b6('0xd')]=_0x1d732c[_0xc0b6('0xd')];}module[_0xc0b6('0xe')]=Action; \ No newline at end of file +var _0xf648=['name','localstationid','headerinfo','path','exports','util','lodash','uniqueid','channel','format','tech'];(function(_0x5de29b,_0x13e9ad){var _0x5f5156=function(_0x1b95ee){while(--_0x1b95ee){_0x5de29b['push'](_0x5de29b['shift']());}};_0x5f5156(++_0x13e9ad);}(_0xf648,0x1d3));var _0x8f64=function(_0x27da75,_0x26202b){_0x27da75=_0x27da75-0x0;var _0x44cf68=_0xf648[_0x27da75];return _0x44cf68;};'use strict';var util=require(_0x8f64('0x0'));var _=require(_0x8f64('0x1'));var moment=require('moment');function Action(_0x55829a,_0x3770a2,_0x350007){this[_0x8f64('0x2')]=_0x55829a||undefined;this[_0x8f64('0x3')]=util[_0x8f64('0x4')]('%s/%s/%s',_0x3770a2[_0x8f64('0x5')],_0x3770a2['Trunk'][_0x8f64('0x6')],_0x350007['fax']);this['localstationid']=_0x3770a2[_0x8f64('0x7')];this[_0x8f64('0x8')]=_0x3770a2[_0x8f64('0x8')];this[_0x8f64('0x9')]=_0x350007[_0x8f64('0x9')];this['AttachmentId']=_0x350007['AttachmentId'];}module[_0x8f64('0xa')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index dc2e9d4..ff58f8e 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 _0x702c=['info','\x20syncNewchannel\x20','prototype','variable','channelstate','channelstatedesc','syncNewExten','value','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','transferrate','calleridnum','create','parse','.pdf','then','notify','catch','\x20notify\x20','stringify','error','\x20receiveFax\x20','merge','pick','update','AttachmentId','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','FaxAccountId','[Fax][execOriginate][success]','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncFaxStatus','receivefax','hangup','originateresponse','syncOriginateResponse','syncNewchannel','context','from-voip-provider','hasOwnProperty','localstationid','channels','uniqueid','channel','name'];(function(_0x53fcf1,_0x23c761){var _0x3d61c9=function(_0x2c006b){while(--_0x2c006b){_0x53fcf1['push'](_0x53fcf1['shift']());}};_0x3d61c9(++_0x23c761);}(_0x702c,0xc5));var _0xc702=function(_0x525371,_0x79b103){_0x525371=_0x525371-0x0;var _0x54d086=_0x702c[_0x525371];return _0x54d086;};'use strict';var util=require(_0xc702('0x0'));var _=require(_0xc702('0x1'));var BPromise=require(_0xc702('0x2'));var uuid=require(_0xc702('0x3'));var moment=require(_0xc702('0x4'));var path=require(_0xc702('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xc702('0x6'));var logger=require(_0xc702('0x7'))(_0xc702('0x8'));var ami=require(_0xc702('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xc702('0xa'));var ut=require(_0xc702('0xb'));var Action=require(_0xc702('0xc'));var faxAccount=require(_0xc702('0xd'));var attachment=require(_0xc702('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x16a924){this['channels']={};this['faxAccounts']=_0x16a924[_0xc702('0xf')];this[_0xc702('0x10')]=_0x16a924[_0xc702('0x10')];this[_0xc702('0x11')]={};ami['on'](_0xc702('0x12'),this['syncNewchannel'][_0xc702('0x13')](this));ami['on'](_0xc702('0x14'),this[_0xc702('0x15')][_0xc702('0x13')](this));ami['on'](_0xc702('0x16'),this[_0xc702('0x17')][_0xc702('0x13')](this));ami['on'](_0xc702('0x18'),this['syncNewExten']['bind'](this));ami['on']('faxstatus',this[_0xc702('0x19')][_0xc702('0x13')](this));ami['on'](_0xc702('0x1a'),this['syncReceiveFax'][_0xc702('0x13')](this));ami['on'](_0xc702('0x1b'),this['syncHangup'][_0xc702('0x13')](this));ami['on'](_0xc702('0x1c'),this[_0xc702('0x1d')][_0xc702('0x13')](this));}Fax['prototype'][_0xc702('0x1e')]=function(_0x25ceb3){if(_0x25ceb3[_0xc702('0x1f')]===_0xc702('0x20')){for(var _0x23658e in this['faxAccounts']){if(this[_0xc702('0xf')][_0xc702('0x21')](_0x23658e)){if(_0x25ceb3['exten']===this[_0xc702('0xf')][_0x23658e][_0xc702('0x22')]){this[_0xc702('0x23')][_0x25ceb3[_0xc702('0x24')]]={};this[_0xc702('0x23')][_0x25ceb3[_0xc702('0x24')]][_0xc702('0x25')]=_0x25ceb3['channel'];this[_0xc702('0x23')][_0x25ceb3[_0xc702('0x24')]]['id']=this[_0xc702('0xf')][_0x23658e]['id'];this['channels'][_0x25ceb3['uniqueid']][_0xc702('0x26')]=this[_0xc702('0xf')][_0x23658e][_0xc702('0x26')];logger[_0xc702('0x27')](_0x25ceb3[_0xc702('0x24')],_0xc702('0x28'));}}}}if(this[_0xc702('0x11')][_0x25ceb3[_0xc702('0x24')]]){this[_0xc702('0x23')][_0x25ceb3[_0xc702('0x24')]]={};this[_0xc702('0x23')][_0x25ceb3['uniqueid']][_0xc702('0x25')]=_0x25ceb3['channel'];logger[_0xc702('0x27')](_0x25ceb3[_0xc702('0x24')],_0xc702('0x28'));}};Fax[_0xc702('0x29')][_0xc702('0x15')]=function(_0x225e4f){if(this[_0xc702('0x23')][_0x225e4f[_0xc702('0x24')]]){for(var _0x5ce5ec in _0x225e4f[_0xc702('0x2a')]){if(_0x225e4f[_0xc702('0x2a')][_0xc702('0x21')](_0x5ce5ec)){this[_0xc702('0x23')][_0x225e4f[_0xc702('0x24')]][_0x5ce5ec]=_0x225e4f['value'];}}}};Fax[_0xc702('0x29')][_0xc702('0x17')]=function(_0x2c6712){if(this[_0xc702('0x23')][_0x2c6712['uniqueid']]){this[_0xc702('0x23')][_0x2c6712[_0xc702('0x24')]][_0xc702('0x2b')]=_0x2c6712[_0xc702('0x2b')];this['channels'][_0x2c6712[_0xc702('0x24')]][_0xc702('0x2c')]=_0x2c6712[_0xc702('0x2c')];}};Fax[_0xc702('0x29')][_0xc702('0x2d')]=function(_0x5092b4){if(this[_0xc702('0x23')][_0x5092b4[_0xc702('0x24')]]){for(var _0x1697c9 in _0x5092b4[_0xc702('0x2a')]){if(_0x5092b4[_0xc702('0x2a')][_0xc702('0x21')](_0x1697c9)){this[_0xc702('0x23')][_0x5092b4[_0xc702('0x24')]][_0x1697c9]=_0x5092b4[_0xc702('0x2e')];}}}};Fax[_0xc702('0x29')][_0xc702('0x19')]=function(_0x2a073c){if(this['channels'][_0x2a073c[_0xc702('0x24')]]){this['channels'][_0x2a073c['uniqueid']][_0xc702('0x2f')]=_0x2a073c['operation'];this[_0xc702('0x23')][_0x2a073c[_0xc702('0x24')]][_0xc702('0x30')]=_0x2a073c['status'];this[_0xc702('0x23')][_0x2a073c[_0xc702('0x24')]]['localstationid']=_0x2a073c[_0xc702('0x22')];this[_0xc702('0x23')][_0x2a073c[_0xc702('0x24')]][_0xc702('0x31')]=_0x2a073c['filename'];logger[_0xc702('0x27')](_0x2a073c[_0xc702('0x24')],_0xc702('0x32'));}};Fax[_0xc702('0x29')][_0xc702('0x33')]=function(_0x4d89f1){var _0x540647=this;if(this[_0xc702('0x23')][_0x4d89f1[_0xc702('0x24')]]){var _0x20b6fd=this[_0xc702('0x23')][_0x4d89f1[_0xc702('0x24')]]['id'];this[_0xc702('0x23')][_0x4d89f1[_0xc702('0x24')]][_0xc702('0x34')]=_0x4d89f1[_0xc702('0x34')];this[_0xc702('0x23')][_0x4d89f1[_0xc702('0x24')]][_0xc702('0x35')]=_0x4d89f1['pagestransferred'];this['channels'][_0x4d89f1[_0xc702('0x24')]][_0xc702('0x22')]=_0x4d89f1[_0xc702('0x22')];this['channels'][_0x4d89f1[_0xc702('0x24')]]['resolution']=_0x4d89f1['resolution'];this[_0xc702('0x23')][_0x4d89f1[_0xc702('0x24')]][_0xc702('0x36')]=_0x4d89f1[_0xc702('0x36')];this[_0xc702('0x23')][_0x4d89f1['uniqueid']][_0xc702('0x31')]=_0x4d89f1[_0xc702('0x31')];this[_0xc702('0x23')][_0x4d89f1['uniqueid']][_0xc702('0x37')]=_0x4d89f1[_0xc702('0x37')];if(this['channels'][_0x4d89f1[_0xc702('0x24')]][_0xc702('0x35')]>0x0){tiff2pdf(_0x4d89f1[_0xc702('0x31')],'/var/opt/motion2/server/files/attachments/',function(_0x3ef05f){logger[_0xc702('0x27')](_0x4d89f1[_0xc702('0x24')],'\x20result\x20conversion\x20file\x20',_0x3ef05f['message']);attachment[_0xc702('0x38')]({'name':path['parse'](_0x4d89f1[_0xc702('0x31')])['name'],'basename':path[_0xc702('0x39')](_0x4d89f1[_0xc702('0x31')])['name']+_0xc702('0x3a'),'type':'application/pdf'})[_0xc702('0x3b')](function(_0x4a850b){faxAccount[_0xc702('0x3c')](_0x20b6fd,{'from':_0x4d89f1[_0xc702('0x37')],'mapKey':_0xc702('0x8'),'body':path[_0xc702('0x39')](_0x4d89f1[_0xc702('0x31')])[_0xc702('0x26')]+_0xc702('0x3a'),'AttachmentId':_0x4a850b['id']})[_0xc702('0x3d')](function(_0x248957){logger['error'](_0x4d89f1[_0xc702('0x24')],_0xc702('0x3e'),JSON[_0xc702('0x3f')](_0x248957));});})[_0xc702('0x3d')](function(_0x3e3e3d){logger[_0xc702('0x40')](_0x4d89f1[_0xc702('0x24')],_0xc702('0x41'),JSON[_0xc702('0x3f')](_0x3e3e3d));});});}logger[_0xc702('0x27')](_0x4d89f1[_0xc702('0x24')],_0xc702('0x41'));}};Fax[_0xc702('0x29')][_0xc702('0x1d')]=function(_0x442882){if(this[_0xc702('0x11')][_0x442882[_0xc702('0x24')]]){_[_0xc702('0x42')](this[_0xc702('0x23')][_0x442882[_0xc702('0x24')]],_[_0xc702('0x43')](_0x442882,['response','reason']));}};function updateStatus(_0x443dc8){if(_0x443dc8['AttachmentId']){faxMessage[_0xc702('0x44')](_0x443dc8[_0xc702('0x45')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xc702('0x3b')](function(_0x20b3bf){ut['logger']('[Fax][Message][Error][Updated]',_0x20b3bf);})[_0xc702('0x3d')](function(_0x43c2b6){ut[_0xc702('0x46')]('[Fax][Message][Error][NoUpdate1]',_0x43c2b6);});}else{ut[_0xc702('0x46')](_0xc702('0x47'));}}Fax['prototype'][_0xc702('0x48')]=function(_0x24cefa,_0x363db9,_0x38468d){var _0x22a1be=this;var _0x2bcb18={};if(_0x363db9){_0x2bcb18={'read':_0x363db9};}else{_0x2bcb18={'failMessage':_0x38468d};}if(this[_0xc702('0x11')][_0x24cefa][_0xc702('0x45')]){faxMessage['update'](this[_0xc702('0x11')][_0x24cefa][_0xc702('0x45')],_0x2bcb18)[_0xc702('0x3b')](function(_0x5e10a7){ut[_0xc702('0x46')](_0xc702('0x49'),_0x5e10a7);})[_0xc702('0x3d')](function(_0x4db723){ut[_0xc702('0x46')](_0xc702('0x4a'),_0x4db723);})[_0xc702('0x4b')](function(){delete _0x22a1be[_0xc702('0x23')][_0x24cefa];delete _0x22a1be[_0xc702('0x11')][_0x24cefa];});}else{ut[_0xc702('0x46')](_0xc702('0x4c'));delete this[_0xc702('0x23')][_0x24cefa];delete this[_0xc702('0x11')][_0x24cefa];}};Fax[_0xc702('0x29')][_0xc702('0x4d')]=function(_0xbbff46){var _0x5681fa=this;if(this[_0xc702('0x23')][_0xbbff46['uniqueid']]){if(this['actions'][_0xbbff46[_0xc702('0x24')]]){this[_0xc702('0x23')][_0xbbff46['uniqueid']]['id']=this[_0xc702('0x11')][_0xbbff46['uniqueid']]['id'];this['channels'][_0xbbff46[_0xc702('0x24')]][_0xc702('0x26')]=this['actions'][_0xbbff46[_0xc702('0x24')]]['name'];}logger[_0xc702('0x27')](_0xbbff46[_0xc702('0x24')],this[_0xc702('0x11')][_0xbbff46[_0xc702('0x24')]]?_0xc702('0x4e'):_0xc702('0x4f'),JSON[_0xc702('0x3f')](this[_0xc702('0x23')][_0xbbff46[_0xc702('0x24')]]));if(this[_0xc702('0x11')][_0xbbff46[_0xc702('0x24')]]){if(this['channels'][_0xbbff46[_0xc702('0x24')]][_0xc702('0x50')]>0x0&&this[_0xc702('0x23')][_0xbbff46['uniqueid']][_0xc702('0x51')]===_0xc702('0x52')){this['updateStatus'](_0xbbff46['uniqueid'],!![]);}else{this['updateStatus'](_0xbbff46[_0xc702('0x24')],![],this['channels'][_0xbbff46[_0xc702('0x24')]][_0xc702('0x53')]?_0xc702('0x54')+this[_0xc702('0x23')][_0xbbff46[_0xc702('0x24')]][_0xc702('0x53')]:_0xc702('0x55'));}}}};Fax[_0xc702('0x29')][_0xc702('0x56')]=function(_0x2e4bea){var _0x2aa44f=this;return new BPromise(function(_0x2d6a98,_0x521c27){_0x2aa44f['execOriginate'](_0x2e4bea,_0x2aa44f[_0xc702('0xf')][_0x2e4bea[_0xc702('0x57')]])[_0xc702('0x3b')](function(_0x28be70){ut['logger'](_0xc702('0x58'),_0x28be70);_0x2d6a98(ut[_0xc702('0x59')]('Fax\x20received'));})[_0xc702('0x3d')](function(_0x249cd1){ut[_0xc702('0x46')](_0xc702('0x5a'),_0x249cd1);updateStatus(_0x2e4bea);_0x521c27(ut['message'](_0xc702('0x5b')));});});};Fax[_0xc702('0x29')][_0xc702('0x5c')]=function(_0x521bac){var _0x1e7f5d=this;return new BPromise(function(_0x1727b2,_0x13d369){var _0xfe7312=_0x1e7f5d[_0xc702('0x5d')](_0x1e7f5d[_0xc702('0xf')][_0x521bac['FaxAccountId']]['Trunk'],_0x521bac);if(_0xfe7312[_0xc702('0x5e')]){_0x1727b2(ut['message'](_0xc702('0x5f')));}else{_0x13d369(ut[_0xc702('0x59')](_0xfe7312['message']));}});};function originate(_0x3ac0e2,_0x4ed280,_0x239557){return new BPromise(function(_0x4970e7,_0x35f7bd){if(_0x239557){var _0x1524b4=util[_0xc702('0x60')](_0xc702('0x61'),path[_0xc702('0x39')](_0x3ac0e2[_0xc702('0x5')])[_0xc702('0x26')],_0x3ac0e2['path']);gs['execute'](_0x1524b4)[_0xc702('0x3b')](function(){_0x3ac0e2[_0xc702('0x5')]=util[_0xc702('0x60')](_0xc702('0x62'),path[_0xc702('0x39')](_0x3ac0e2[_0xc702('0x5')])[_0xc702('0x63')],path[_0xc702('0x39')](_0x3ac0e2[_0xc702('0x5')])[_0xc702('0x26')]);_0x4ed280[_0xc702('0x64')]=_0x3ac0e2[_0xc702('0x5')];ut[_0xc702('0x46')]('Convert\x20pdf\x20to\x20tif','');ami[_0xc702('0x65')](ut[_0xc702('0x66')](_0x3ac0e2,_0x4ed280))[_0xc702('0x3b')](function(_0x2b51d6){_0x4970e7(_0x2b51d6);})[_0xc702('0x3d')](function(_0x555e16){_0x35f7bd(_0x555e16);});})[_0xc702('0x3d')](function(_0x4f684a){_0x35f7bd(_0x4f684a);});}else{ami['Action'](ut[_0xc702('0x66')](_0x3ac0e2,_0x4ed280))[_0xc702('0x3b')](function(_0x4f0220){_0x4970e7(_0x4f0220);})[_0xc702('0x3d')](function(_0x405f80){_0x35f7bd(_0x405f80);});}});}Fax[_0xc702('0x29')][_0xc702('0x67')]=function(_0x26c290,_0x5a24da){var _0x2c553c=this;return new BPromise(function(_0x479ad0,_0x47f17c){var _0x23feb0=uuid['v4']();var _0x4f134a=ut[_0xc702('0x68')](_0x26c290,_0x5a24da);_0x2c553c['actions'][_0x23feb0]=new Action(_0x23feb0,_0x5a24da,_0x26c290);var _0x25332b=_0x2c553c[_0xc702('0x11')][_0x23feb0];if(path[_0xc702('0x39')](_0x26c290[_0xc702('0x5')])[_0xc702('0x69')]===_0xc702('0x3a')){originate(_0x25332b,_0x4f134a,!![])[_0xc702('0x3b')](function(_0x298508){_0x479ad0(_0x298508);})[_0xc702('0x3d')](function(_0x5dbd88){_0x47f17c(_0x5dbd88);});}else{originate(_0x25332b,_0x4f134a,![])[_0xc702('0x3b')](function(_0x3de132){_0x479ad0(_0x3de132);})['catch'](function(_0x522eae){_0x47f17c(_0x522eae);});}});};Fax[_0xc702('0x29')][_0xc702('0x6a')]=function(_0x393da2){return!_['isNil'](_0x393da2)&&!_[_0xc702('0x6b')](_0x393da2[_0xc702('0x26')])&&!_[_0xc702('0x6b')](_0x393da2['active'])&&_0x393da2[_0xc702('0x6c')]&&!_[_0xc702('0x6b')](this[_0xc702('0x10')][util[_0xc702('0x60')](_0xc702('0x6d'),_0x393da2[_0xc702('0x26')])])&&!_[_0xc702('0x6b')](this[_0xc702('0x10')][util[_0xc702('0x60')]('SIP/%s',_0x393da2[_0xc702('0x26')])][_0xc702('0x30')])&&(this[_0xc702('0x10')][util[_0xc702('0x60')](_0xc702('0x6d'),_0x393da2[_0xc702('0x26')])][_0xc702('0x30')]===_0xc702('0x6e')||this[_0xc702('0x10')][util['format'](_0xc702('0x6d'),_0x393da2['name'])][_0xc702('0x30')]===_0xc702('0x6f'));};Fax[_0xc702('0x29')]['checkTrunk']=function(_0x19598e,_0x4ada3e){if(!this[_0xc702('0x6a')](_0x19598e)){ut['logger'](_0xc702('0x70'),_['isNil'](_0x19598e)?'':_0x19598e[_0xc702('0x26')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xc702('0x6b')](_0x4ada3e[_0xc702('0x8')])){ut['logger'](_0xc702('0x71'),JSON[_0xc702('0x3f')](_0x4ada3e));return{'isValid':![],'message':_0xc702('0x72')};}if(_[_0xc702('0x6b')](_0x4ada3e['path'])){ut[_0xc702('0x46')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0xc702('0x3f')](_0x4ada3e));return{'isValid':![],'message':_0xc702('0x73')};}return{'isValid':!![],'message':_0xc702('0x74')};};module[_0xc702('0x75')]=Fax; \ No newline at end of file +var _0x06ea=['./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewExten','faxstatus','hangup','originateresponse','prototype','context','from-voip-provider','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','hasOwnProperty','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','send','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','execOriginate','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./channel'];(function(_0x356abb,_0x4bf1d9){var _0x4c37b7=function(_0x695003){while(--_0x695003){_0x356abb['push'](_0x356abb['shift']());}};_0x4c37b7(++_0x4bf1d9);}(_0x06ea,0x6c));var _0xa06e=function(_0x304320,_0x232a69){_0x304320=_0x304320-0x0;var _0xe607da=_0x06ea[_0x304320];return _0xe607da;};'use strict';var util=require(_0xa06e('0x0'));var _=require(_0xa06e('0x1'));var BPromise=require(_0xa06e('0x2'));var uuid=require(_0xa06e('0x3'));var moment=require(_0xa06e('0x4'));var path=require(_0xa06e('0x5'));var tiff2pdf=require(_0xa06e('0x6'));var gs=require('./util/gs');var logger=require(_0xa06e('0x7'))(_0xa06e('0x8'));var ami=require(_0xa06e('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0xa06e('0xa'));var ut=require(_0xa06e('0xb'));var Action=require(_0xa06e('0xc'));var faxAccount=require(_0xa06e('0xd'));var attachment=require(_0xa06e('0xe'));var faxMessage=require(_0xa06e('0xf'));function Fax(_0x49038c){this['channels']={};this[_0xa06e('0x10')]=_0x49038c[_0xa06e('0x10')];this[_0xa06e('0x11')]=_0x49038c[_0xa06e('0x11')];this[_0xa06e('0x12')]={};ami['on'](_0xa06e('0x13'),this[_0xa06e('0x14')][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x16'),this[_0xa06e('0x17')][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x18'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0xa06e('0x19')][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x1a'),this['syncFaxStatus'][_0xa06e('0x15')](this));ami['on']('receivefax',this['syncReceiveFax'][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x1b'),this['syncHangup'][_0xa06e('0x15')](this));ami['on'](_0xa06e('0x1c'),this['syncOriginateResponse'][_0xa06e('0x15')](this));}Fax[_0xa06e('0x1d')][_0xa06e('0x14')]=function(_0x5602f3){if(_0x5602f3[_0xa06e('0x1e')]===_0xa06e('0x1f')){for(var _0x390a96 in this[_0xa06e('0x10')]){if(this['faxAccounts']['hasOwnProperty'](_0x390a96)){if(_0x5602f3[_0xa06e('0x20')]===this['faxAccounts'][_0x390a96][_0xa06e('0x21')]){this[_0xa06e('0x22')][_0x5602f3[_0xa06e('0x23')]]={};this[_0xa06e('0x22')][_0x5602f3['uniqueid']]['channel']=_0x5602f3[_0xa06e('0x24')];this[_0xa06e('0x22')][_0x5602f3['uniqueid']]['id']=this[_0xa06e('0x10')][_0x390a96]['id'];this[_0xa06e('0x22')][_0x5602f3[_0xa06e('0x23')]][_0xa06e('0x25')]=this[_0xa06e('0x10')][_0x390a96]['name'];logger['info'](_0x5602f3[_0xa06e('0x23')],'\x20syncNewchannel\x20');}}}}if(this[_0xa06e('0x12')][_0x5602f3[_0xa06e('0x23')]]){this[_0xa06e('0x22')][_0x5602f3[_0xa06e('0x23')]]={};this['channels'][_0x5602f3['uniqueid']][_0xa06e('0x24')]=_0x5602f3[_0xa06e('0x24')];logger[_0xa06e('0x26')](_0x5602f3[_0xa06e('0x23')],_0xa06e('0x27'));}};Fax['prototype']['syncVarSet']=function(_0x1c1ea8){if(this['channels'][_0x1c1ea8[_0xa06e('0x23')]]){for(var _0x4560f3 in _0x1c1ea8['variable']){if(_0x1c1ea8[_0xa06e('0x28')]['hasOwnProperty'](_0x4560f3)){this[_0xa06e('0x22')][_0x1c1ea8[_0xa06e('0x23')]][_0x4560f3]=_0x1c1ea8[_0xa06e('0x29')];}}}};Fax['prototype'][_0xa06e('0x2a')]=function(_0x10fbc9){if(this['channels'][_0x10fbc9[_0xa06e('0x23')]]){this[_0xa06e('0x22')][_0x10fbc9['uniqueid']][_0xa06e('0x2b')]=_0x10fbc9['channelstate'];this['channels'][_0x10fbc9[_0xa06e('0x23')]][_0xa06e('0x2c')]=_0x10fbc9['channelstatedesc'];}};Fax[_0xa06e('0x1d')][_0xa06e('0x19')]=function(_0x4c9137){if(this[_0xa06e('0x22')][_0x4c9137[_0xa06e('0x23')]]){for(var _0x5bee8d in _0x4c9137[_0xa06e('0x28')]){if(_0x4c9137[_0xa06e('0x28')][_0xa06e('0x2d')](_0x5bee8d)){this[_0xa06e('0x22')][_0x4c9137['uniqueid']][_0x5bee8d]=_0x4c9137[_0xa06e('0x29')];}}}};Fax['prototype'][_0xa06e('0x2e')]=function(_0x42aea3){if(this['channels'][_0x42aea3[_0xa06e('0x23')]]){this[_0xa06e('0x22')][_0x42aea3[_0xa06e('0x23')]][_0xa06e('0x2f')]=_0x42aea3[_0xa06e('0x2f')];this['channels'][_0x42aea3['uniqueid']][_0xa06e('0x30')]=_0x42aea3['status'];this['channels'][_0x42aea3[_0xa06e('0x23')]]['localstationid']=_0x42aea3[_0xa06e('0x21')];this['channels'][_0x42aea3[_0xa06e('0x23')]][_0xa06e('0x31')]=_0x42aea3[_0xa06e('0x31')];logger[_0xa06e('0x26')](_0x42aea3[_0xa06e('0x23')],_0xa06e('0x32'));}};Fax[_0xa06e('0x1d')]['syncReceiveFax']=function(_0x433818){var _0x136f51=this;if(this['channels'][_0x433818[_0xa06e('0x23')]]){var _0x525480=this[_0xa06e('0x22')][_0x433818['uniqueid']]['id'];this[_0xa06e('0x22')][_0x433818['uniqueid']][_0xa06e('0x33')]=_0x433818[_0xa06e('0x33')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x34')]=_0x433818[_0xa06e('0x34')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x21')]=_0x433818[_0xa06e('0x21')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x35')]=_0x433818['resolution'];this['channels'][_0x433818['uniqueid']][_0xa06e('0x36')]=_0x433818[_0xa06e('0x36')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x31')]=_0x433818[_0xa06e('0x31')];this[_0xa06e('0x22')][_0x433818[_0xa06e('0x23')]][_0xa06e('0x37')]=_0x433818[_0xa06e('0x37')];if(this['channels'][_0x433818[_0xa06e('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x433818[_0xa06e('0x31')],_0xa06e('0x38'),function(_0x2c8702){logger[_0xa06e('0x26')](_0x433818[_0xa06e('0x23')],_0xa06e('0x39'),_0x2c8702[_0xa06e('0x3a')]);attachment[_0xa06e('0x3b')]({'name':path[_0xa06e('0x3c')](_0x433818['filename'])[_0xa06e('0x25')],'basename':path[_0xa06e('0x3c')](_0x433818['filename'])[_0xa06e('0x25')]+_0xa06e('0x3d'),'type':'application/pdf'})[_0xa06e('0x3e')](function(_0x479832){faxAccount['notify'](_0x525480,{'from':_0x433818[_0xa06e('0x37')],'mapKey':_0xa06e('0x8'),'body':path[_0xa06e('0x3c')](_0x433818['filename'])[_0xa06e('0x25')]+_0xa06e('0x3d'),'AttachmentId':_0x479832['id']})[_0xa06e('0x3f')](function(_0x280c41){logger[_0xa06e('0x40')](_0x433818[_0xa06e('0x23')],_0xa06e('0x41'),JSON[_0xa06e('0x42')](_0x280c41));});})[_0xa06e('0x3f')](function(_0x595c92){logger[_0xa06e('0x40')](_0x433818[_0xa06e('0x23')],_0xa06e('0x43'),JSON[_0xa06e('0x42')](_0x595c92));});});}logger['info'](_0x433818[_0xa06e('0x23')],_0xa06e('0x43'));}};Fax[_0xa06e('0x1d')]['syncOriginateResponse']=function(_0x21304d){if(this[_0xa06e('0x12')][_0x21304d['uniqueid']]){_[_0xa06e('0x44')](this[_0xa06e('0x22')][_0x21304d[_0xa06e('0x23')]],_[_0xa06e('0x45')](_0x21304d,[_0xa06e('0x46'),_0xa06e('0x47')]));}};function updateStatus(_0x111837){if(_0x111837['AttachmentId']){faxMessage['update'](_0x111837[_0xa06e('0x48')],{'failMessage':'SENDING\x20FAILED\x20'})[_0xa06e('0x3e')](function(_0x5d033f){ut['logger'](_0xa06e('0x49'),_0x5d033f);})[_0xa06e('0x3f')](function(_0x830593){ut[_0xa06e('0x4a')](_0xa06e('0x4b'),_0x830593);});}else{ut[_0xa06e('0x4a')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0xa06e('0x1d')][_0xa06e('0x4c')]=function(_0x3a153f,_0x1c4b0b,_0x4510a7){var _0x483c1a=this;var _0x594f3e={};if(_0x1c4b0b){_0x594f3e={'read':_0x1c4b0b};}else{_0x594f3e={'failMessage':_0x4510a7};}if(this[_0xa06e('0x12')][_0x3a153f][_0xa06e('0x48')]){faxMessage[_0xa06e('0x4d')](this[_0xa06e('0x12')][_0x3a153f]['AttachmentId'],_0x594f3e)['then'](function(_0x282b67){ut['logger'](_0xa06e('0x4e'),_0x282b67);})[_0xa06e('0x3f')](function(_0xa974aa){ut[_0xa06e('0x4a')](_0xa06e('0x4f'),_0xa974aa);})[_0xa06e('0x50')](function(){delete _0x483c1a[_0xa06e('0x22')][_0x3a153f];delete _0x483c1a[_0xa06e('0x12')][_0x3a153f];});}else{ut[_0xa06e('0x4a')](_0xa06e('0x51'));delete this['channels'][_0x3a153f];delete this[_0xa06e('0x12')][_0x3a153f];}};Fax['prototype'][_0xa06e('0x52')]=function(_0x3ea519){var _0x45b0c7=this;if(this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]]){if(this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]]){this['channels'][_0x3ea519[_0xa06e('0x23')]]['id']=this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]]['id'];this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]][_0xa06e('0x25')]=this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]][_0xa06e('0x25')];}logger[_0xa06e('0x26')](_0x3ea519[_0xa06e('0x23')],this[_0xa06e('0x12')][_0x3ea519[_0xa06e('0x23')]]?_0xa06e('0x53'):'\x20hangup\x20faxRiceive\x20',JSON['stringify'](this['channels'][_0x3ea519[_0xa06e('0x23')]]));if(this['actions'][_0x3ea519[_0xa06e('0x23')]]){if(this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]][_0xa06e('0x54')]>0x0&&this[_0xa06e('0x22')][_0x3ea519[_0xa06e('0x23')]]['faxstatus']===_0xa06e('0x55')){this[_0xa06e('0x4c')](_0x3ea519[_0xa06e('0x23')],!![]);}else{this[_0xa06e('0x4c')](_0x3ea519[_0xa06e('0x23')],![],this[_0xa06e('0x22')][_0x3ea519['uniqueid']]['faxstatusstring']?_0xa06e('0x56')+this[_0xa06e('0x22')][_0x3ea519['uniqueid']][_0xa06e('0x57')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0xa06e('0x58')]=function(_0x410a39){var _0x128b4e=this;return new BPromise(function(_0x33c68b,_0x2fbe65){_0x128b4e['execOriginate'](_0x410a39,_0x128b4e['faxAccounts'][_0x410a39[_0xa06e('0x59')]])[_0xa06e('0x3e')](function(_0x1cf62d){ut[_0xa06e('0x4a')](_0xa06e('0x5a'),_0x1cf62d);_0x33c68b(ut['message'](_0xa06e('0x5b')));})[_0xa06e('0x3f')](function(_0x373842){ut[_0xa06e('0x4a')](_0xa06e('0x5c'),_0x373842);updateStatus(_0x410a39);_0x2fbe65(ut[_0xa06e('0x3a')]('Fax\x20failed'));});});};Fax[_0xa06e('0x1d')][_0xa06e('0x5d')]=function(_0x1852b9){var _0x3f400b=this;return new BPromise(function(_0xde19aa,_0xc962a1){var _0x214dfd=_0x3f400b[_0xa06e('0x5e')](_0x3f400b[_0xa06e('0x10')][_0x1852b9[_0xa06e('0x59')]]['Trunk'],_0x1852b9);if(_0x214dfd[_0xa06e('0x5f')]){_0xde19aa(ut[_0xa06e('0x3a')](_0xa06e('0x60')));}else{_0xc962a1(ut[_0xa06e('0x3a')](_0x214dfd['message']));}});};function originate(_0x2b689b,_0x34e561,_0x5f2df9){return new BPromise(function(_0x4cee44,_0x11cd9e){if(_0x5f2df9){var _0x59dead=util['format'](_0xa06e('0x61'),path[_0xa06e('0x3c')](_0x2b689b[_0xa06e('0x5')])[_0xa06e('0x25')],_0x2b689b[_0xa06e('0x5')]);gs[_0xa06e('0x62')](_0x59dead)[_0xa06e('0x3e')](function(){_0x2b689b[_0xa06e('0x5')]=util[_0xa06e('0x63')](_0xa06e('0x64'),path['parse'](_0x2b689b[_0xa06e('0x5')])[_0xa06e('0x65')],path[_0xa06e('0x3c')](_0x2b689b[_0xa06e('0x5')])['name']);_0x34e561[_0xa06e('0x66')]=_0x2b689b[_0xa06e('0x5')];ut[_0xa06e('0x4a')](_0xa06e('0x67'),'');ami['Action'](ut[_0xa06e('0x68')](_0x2b689b,_0x34e561))[_0xa06e('0x3e')](function(_0x176667){_0x4cee44(_0x176667);})[_0xa06e('0x3f')](function(_0x3b78f6){_0x11cd9e(_0x3b78f6);});})['catch'](function(_0x5600a0){_0x11cd9e(_0x5600a0);});}else{ami[_0xa06e('0x69')](ut['variablesAction'](_0x2b689b,_0x34e561))[_0xa06e('0x3e')](function(_0x44f1e7){_0x4cee44(_0x44f1e7);})[_0xa06e('0x3f')](function(_0x20feab){_0x11cd9e(_0x20feab);});}});}Fax[_0xa06e('0x1d')][_0xa06e('0x6a')]=function(_0x417d81,_0xab0e0d){var _0xc46be=this;return new BPromise(function(_0x5577b5,_0x291ce7){var _0x12efb0=uuid['v4']();var _0x5bdbe4=ut['addVariables'](_0x417d81,_0xab0e0d);_0xc46be[_0xa06e('0x12')][_0x12efb0]=new Action(_0x12efb0,_0xab0e0d,_0x417d81);var _0x38b4b2=_0xc46be[_0xa06e('0x12')][_0x12efb0];if(path[_0xa06e('0x3c')](_0x417d81[_0xa06e('0x5')])[_0xa06e('0x6b')]===_0xa06e('0x3d')){originate(_0x38b4b2,_0x5bdbe4,!![])[_0xa06e('0x3e')](function(_0x525eb0){_0x5577b5(_0x525eb0);})[_0xa06e('0x3f')](function(_0x2644aa){_0x291ce7(_0x2644aa);});}else{originate(_0x38b4b2,_0x5bdbe4,![])[_0xa06e('0x3e')](function(_0x1cd709){_0x5577b5(_0x1cd709);})[_0xa06e('0x3f')](function(_0x28ec7a){_0x291ce7(_0x28ec7a);});}});};Fax[_0xa06e('0x1d')][_0xa06e('0x6c')]=function(_0x3a383f){return!_[_0xa06e('0x6d')](_0x3a383f)&&!_[_0xa06e('0x6d')](_0x3a383f['name'])&&!_['isNil'](_0x3a383f[_0xa06e('0x6e')])&&_0x3a383f[_0xa06e('0x6e')]&&!_[_0xa06e('0x6d')](this[_0xa06e('0x11')][util[_0xa06e('0x63')]('SIP/%s',_0x3a383f[_0xa06e('0x25')])])&&!_[_0xa06e('0x6d')](this['trunks'][util[_0xa06e('0x63')]('SIP/%s',_0x3a383f[_0xa06e('0x25')])]['status'])&&(this[_0xa06e('0x11')][util[_0xa06e('0x63')](_0xa06e('0x6f'),_0x3a383f[_0xa06e('0x25')])][_0xa06e('0x30')]===_0xa06e('0x70')||this[_0xa06e('0x11')][util[_0xa06e('0x63')](_0xa06e('0x6f'),_0x3a383f[_0xa06e('0x25')])][_0xa06e('0x30')]===_0xa06e('0x71'));};Fax[_0xa06e('0x1d')][_0xa06e('0x5e')]=function(_0x2f421c,_0xa12002){if(!this['isTrunkReachable'](_0x2f421c)){ut[_0xa06e('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xa06e('0x6d')](_0x2f421c)?'':_0x2f421c[_0xa06e('0x25')]+_0xa06e('0x72'));return{'isValid':![],'message':_0xa06e('0x73')};}if(_[_0xa06e('0x6d')](_0xa12002[_0xa06e('0x8')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xa06e('0x42')](_0xa12002));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xa06e('0x6d')](_0xa12002[_0xa06e('0x5')])){ut[_0xa06e('0x4a')](_0xa06e('0x74'),JSON[_0xa06e('0x42')](_0xa12002));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xa06e('0x75')};};module[_0xa06e('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 3e9663b..eada4f2 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 _0xdded=['util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','notify','resolve','then','[Notify]\x20'];(function(_0x4c59dc,_0x2d40b7){var _0x1f16ef=function(_0x138056){while(--_0x138056){_0x4c59dc['push'](_0x4c59dc['shift']());}};_0x1f16ef(++_0x2d40b7);}(_0xdded,0x14a));var _0xddde=function(_0x52998b,_0x5445a1){_0x52998b=_0x52998b-0x0;var _0x2843b6=_0xdded[_0x52998b];return _0x2843b6;};'use strict';var util=require(_0xddde('0x0'));var BPromise=require(_0xddde('0x1'));var logger=require(_0xddde('0x2'))(_0xddde('0x3'));var _=require(_0xddde('0x4'));var faxAccount=require(_0xddde('0x5'));function loggerCatch(_0x28cef5){return function(_0x330751){logger[_0xddde('0x6')](_0x28cef5,util['inspect'](_0x330751,{'showHidden':![],'depth':null}));};}exports[_0xddde('0x7')]=function(_0x4fee6f,_0x5c8fbc){return BPromise[_0xddde('0x8')]()[_0xddde('0x9')](faxAccount[_0xddde('0x7')](_0x4fee6f,_0x5c8fbc))['catch'](loggerCatch(_0xddde('0xa')));}; \ No newline at end of file +var _0xf939=['util','../../../config/logger','preview','lodash','error','inspect','notify','resolve','then','catch','[Notify]\x20'];(function(_0x2e806e,_0x5ed4c1){var _0x212123=function(_0x3e17bf){while(--_0x3e17bf){_0x2e806e['push'](_0x2e806e['shift']());}};_0x212123(++_0x5ed4c1);}(_0xf939,0x1b8));var _0x9f93=function(_0xefb683,_0x13c7c4){_0xefb683=_0xefb683-0x0;var _0x9eb59b=_0xf939[_0xefb683];return _0x9eb59b;};'use strict';var util=require(_0x9f93('0x0'));var BPromise=require('bluebird');var logger=require(_0x9f93('0x1'))(_0x9f93('0x2'));var _=require(_0x9f93('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x54a669){return function(_0x343cb9){logger[_0x9f93('0x4')](_0x54a669,util[_0x9f93('0x5')](_0x343cb9,{'showHidden':![],'depth':null}));};}exports[_0x9f93('0x6')]=function(_0x321e04,_0x4bac30){return BPromise[_0x9f93('0x7')]()[_0x9f93('0x8')](faxAccount['notify'](_0x321e04,_0x4bac30))[_0x9f93('0x9')](loggerCatch(_0x9f93('0xa')));}; \ 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 e2333ed..ad970fe 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 _0xd5f0=['exec','execute','Exec\x20gs','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x545bca,_0x39df57){var _0x3f581f=function(_0xb0f717){while(--_0xb0f717){_0x545bca['push'](_0x545bca['shift']());}};_0x3f581f(++_0x39df57);}(_0xd5f0,0x74));var _0x0d5f=function(_0x3972a7,_0x4ef8ec){_0x3972a7=_0x3972a7-0x0;var _0xdc57b0=_0xd5f0[_0x3972a7];return _0xdc57b0;};'use strict';var util=require(_0x0d5f('0x0'));var logger=require(_0x0d5f('0x1'))(_0x0d5f('0x2'));var BPromise=require(_0x0d5f('0x3'));var exec=require(_0x0d5f('0x4'))[_0x0d5f('0x5')];exports[_0x0d5f('0x6')]=function(_0x57b80f){return new BPromise(function(_0x354d30,_0x3891a0){exec(_0x57b80f,function(_0x1e105d,_0x1a1097,_0x7e12ce){logger['info'](_0x0d5f('0x7'),_0x1a1097);if(_0x1e105d){logger[_0x0d5f('0x8')](_0x0d5f('0x7'),_0x0d5f('0x9'),util[_0x0d5f('0xa')](_0x1e105d,{'showHidden':![],'depth':null}),_0x1a1097,_0x7e12ce);_0x3891a0(_0x1e105d);}_0x354d30(_0x1a1097);});});}; \ No newline at end of file +var _0xb5d5=['Exec\x20gs','inspect','util','bluebird','child_process','exec','execute','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb5d5,0x11a));var _0x5b5d=function(_0x5b3cb2,_0x4aeaa8){_0x5b3cb2=_0x5b3cb2-0x0;var _0x553305=_0xb5d5[_0x5b3cb2];return _0x553305;};'use strict';var util=require(_0x5b5d('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x5b5d('0x1'));var exec=require(_0x5b5d('0x2'))[_0x5b5d('0x3')];exports[_0x5b5d('0x4')]=function(_0x61bbff){return new BPromise(function(_0x21a017,_0x43e179){exec(_0x61bbff,function(_0x37ac3e,_0x8563b4,_0xcf2a5d){logger[_0x5b5d('0x5')](_0x5b5d('0x6'),_0x8563b4);if(_0x37ac3e){logger[_0x5b5d('0x5')](_0x5b5d('0x6'),'\x20Error\x20:',util[_0x5b5d('0x7')](_0x37ac3e,{'showHidden':![],'depth':null}),_0x8563b4,_0xcf2a5d);_0x43e179(_0x37ac3e);}_0x21a017(_0x8563b4);});});}; \ 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 35b82d4..a4c4db1 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 _0x5d5d=['\x22%s\x22','modem','gateway','t38timeout','path','uniqueid','localstationid','util','lodash','moment','fax','message','info','inspect','ecm','headerinfo','minrate','maxrate','format'];(function(_0x56db28,_0x95952b){var _0x255efc=function(_0x11c095){while(--_0x11c095){_0x56db28['push'](_0x56db28['shift']());}};_0x255efc(++_0x95952b);}(_0x5d5d,0x66));var _0xd5d5=function(_0x3627f8,_0x5f4c86){_0x3627f8=_0x3627f8-0x0;var _0x604f48=_0x5d5d[_0x3627f8];return _0x604f48;};'use strict';var util=require(_0xd5d5('0x0'));var _=require(_0xd5d5('0x1'));var moment=require(_0xd5d5('0x2'));var logger=require('../../../../config/logger')(_0xd5d5('0x3'));exports[_0xd5d5('0x4')]=function(_0x24cc4b){return{'message':_0x24cc4b};};exports['logger']=function(_0x1e463a,_0x4f37db){logger[_0xd5d5('0x5')](_0x1e463a,util[_0xd5d5('0x6')](_0x4f37db,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x547ee3,_0x1aa8d2){var _0x316cce={'XMF-ECM':_0x1aa8d2[_0xd5d5('0x7')],'XMF-HEADERINFO':_0x1aa8d2[_0xd5d5('0x8')],'XMF-MINRATE':_0x1aa8d2[_0xd5d5('0x9')],'XMF-MAXRATE':_0x1aa8d2[_0xd5d5('0xa')],'XMF-MODEM':util[_0xd5d5('0xb')](_0xd5d5('0xc'),_0x1aa8d2[_0xd5d5('0xd')]),'XMF-GATEWAY':_0x1aa8d2[_0xd5d5('0xe')],'XMF-FAXDETECT':_0x1aa8d2['faxdetect'],'XMF-T38TIMEOUT':_0x1aa8d2[_0xd5d5('0xf')],'XMF-LOCALSTATIONID':_0x1aa8d2['localstationid'],'XMF-PATH':_0x547ee3[_0xd5d5('0x10')]};return _0x316cce;};exports['variablesAction']=function(_0x1e4053,_0x2139df){return{'actionid':_0x1e4053[_0xd5d5('0x11')],'action':'originate','channel':_0x1e4053['channel'],'Exten':'xcally-motion-fax','Context':'from-sip','Priority':'1','callerid':util[_0xd5d5('0xb')]('\x22%s\x22\x20<%s>',_0x1e4053['headerinfo']?_0x1e4053['headerinfo']:'',_0x1e4053[_0xd5d5('0x12')]),'variable':_0x2139df,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1e4053['uniqueid']};}; \ No newline at end of file +var _0x0315=['channel','from-sip','\x22%s\x22\x20<%s>','localstationid','lodash','../../../../config/logger','fax','message','logger','addVariables','ecm','headerinfo','minrate','format','modem','faxdetect','t38timeout','path','variablesAction','uniqueid','originate'];(function(_0x28ff21,_0x210624){var _0x610251=function(_0x225045){while(--_0x225045){_0x28ff21['push'](_0x28ff21['shift']());}};_0x610251(++_0x210624);}(_0x0315,0xeb));var _0x5031=function(_0x21b99d,_0x46fbc9){_0x21b99d=_0x21b99d-0x0;var _0x31335a=_0x0315[_0x21b99d];return _0x31335a;};'use strict';var util=require('util');var _=require(_0x5031('0x0'));var moment=require('moment');var logger=require(_0x5031('0x1'))(_0x5031('0x2'));exports[_0x5031('0x3')]=function(_0x2e1365){return{'message':_0x2e1365};};exports[_0x5031('0x4')]=function(_0x9a8bb3,_0x200786){logger['info'](_0x9a8bb3,util['inspect'](_0x200786,{'showHidden':![],'depth':null}));};exports[_0x5031('0x5')]=function(_0x43dda6,_0x580aef){var _0x4dbb20={'XMF-ECM':_0x580aef[_0x5031('0x6')],'XMF-HEADERINFO':_0x580aef[_0x5031('0x7')],'XMF-MINRATE':_0x580aef[_0x5031('0x8')],'XMF-MAXRATE':_0x580aef['maxrate'],'XMF-MODEM':util[_0x5031('0x9')]('\x22%s\x22',_0x580aef[_0x5031('0xa')]),'XMF-GATEWAY':_0x580aef['gateway'],'XMF-FAXDETECT':_0x580aef[_0x5031('0xb')],'XMF-T38TIMEOUT':_0x580aef[_0x5031('0xc')],'XMF-LOCALSTATIONID':_0x580aef['localstationid'],'XMF-PATH':_0x43dda6[_0x5031('0xd')]};return _0x4dbb20;};exports[_0x5031('0xe')]=function(_0x1b4d48,_0x5c4671){return{'actionid':_0x1b4d48[_0x5031('0xf')],'action':_0x5031('0x10'),'channel':_0x1b4d48[_0x5031('0x11')],'Exten':'xcally-motion-fax','Context':_0x5031('0x12'),'Priority':'1','callerid':util[_0x5031('0x9')](_0x5031('0x13'),_0x1b4d48[_0x5031('0x7')]?_0x1b4d48['headerinfo']:'',_0x1b4d48[_0x5031('0x14')]),'variable':_0x5c4671,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1b4d48[_0x5031('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 5cef366..eb8f1db 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 _0x7d23=['getCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','log','listen','sync','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./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/servicenow','get','hour','resolve','then','initAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory'];(function(_0x3303cd,_0x1c112b){var _0x499623=function(_0x4b0ac6){while(--_0x4b0ac6){_0x3303cd['push'](_0x3303cd['shift']());}};_0x499623(++_0x1c112b);}(_0x7d23,0x1b8));var _0x37d2=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x7d23[_0x4ae6ef];return _0x3cbb4e;};'use strict';var BPromise=require(_0x37d2('0x0'));var util=require(_0x37d2('0x1'));var moment=require(_0x37d2('0x2'));var server=require(_0x37d2('0x3'));var Realtime=require(_0x37d2('0x4'));var Report=require(_0x37d2('0x5'));var Acw=require(_0x37d2('0x6'));var Trigger=require(_0x37d2('0x7'));var Dialer=require('./dialer');var Preview=require(_0x37d2('0x8'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x37d2('0x9'));var trigger=require('./rpc/trigger');var template=require(_0x37d2('0xa'));var cmHopperHistory=require(_0x37d2('0xb'));var campaign=require(_0x37d2('0xc'));var voiceExtension=require(_0x37d2('0xd'));var faxAccount=require(_0x37d2('0xe'));var zendesk=require(_0x37d2('0xf'));var salesforce=require(_0x37d2('0x10'));var sugarcrm=require(_0x37d2('0x11'));var freshdesk=require(_0x37d2('0x12'));var desk=require(_0x37d2('0x13'));var zoho=require(_0x37d2('0x14'));var vtiger=require(_0x37d2('0x15'));var servicenow=require(_0x37d2('0x16'));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()[_0x37d2('0x17')](_0x37d2('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x37d2('0x17')](_0x37d2('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x37d2('0x19')]()[_0x37d2('0x1a')](user['getAgents']())[_0x37d2('0x1a')](realtime[_0x37d2('0x1b')]())[_0x37d2('0x1a')](user[_0x37d2('0x1c')]())['then'](realtime['initTelephones']())[_0x37d2('0x1a')](trunk[_0x37d2('0x1d')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x1e')]())[_0x37d2('0x1a')](voiceQueue[_0x37d2('0x1f')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x20')]())['then'](trigger['getTriggers']())[_0x37d2('0x1a')](realtime[_0x37d2('0x21')]())[_0x37d2('0x1a')](template[_0x37d2('0x22')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x23')]())[_0x37d2('0x1a')](zendesk[_0x37d2('0x24')]())['then'](realtime[_0x37d2('0x25')]())['then'](salesforce[_0x37d2('0x26')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x27')]())[_0x37d2('0x1a')](sugarcrm['getSugarcrmAccounts']())[_0x37d2('0x1a')](realtime['initSugarcrmAccounts']())[_0x37d2('0x1a')](freshdesk[_0x37d2('0x28')]())[_0x37d2('0x1a')](realtime['initFreshdeskAccounts']())[_0x37d2('0x1a')](desk[_0x37d2('0x29')]())['then'](realtime[_0x37d2('0x2a')]())[_0x37d2('0x1a')](zoho[_0x37d2('0x2b')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x2c')]())[_0x37d2('0x1a')](vtiger[_0x37d2('0x2d')]())[_0x37d2('0x1a')](realtime['initVtigerAccounts']())['then'](servicenow['getServicenowAccounts']())[_0x37d2('0x1a')](realtime['initServicenowAccounts']())['then'](dynamics365['getDynamics365Accounts']())[_0x37d2('0x1a')](realtime[_0x37d2('0x2e')]())['then'](campaign[_0x37d2('0x2f')]())['then'](realtime[_0x37d2('0x30')]())['then'](voiceExtension[_0x37d2('0x31')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x32')]())[_0x37d2('0x1a')](faxAccount[_0x37d2('0x33')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x34')]())[_0x37d2('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x37d2('0x1a')](voiceQueueReport[_0x37d2('0x35')]())[_0x37d2('0x1a')](realtime[_0x37d2('0x36')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x37d2('0x1a')](realtime[_0x37d2('0x37')]())[_0x37d2('0x1a')](cmHopperHistory[_0x37d2('0x38')]())[_0x37d2('0x1a')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport[_0x37d2('0x39')]())['then'](realtime[_0x37d2('0x3a')]())[_0x37d2('0x1a')](function(_0x4621dc){})['catch'](function(_0x26b4f9){console[_0x37d2('0x3b')](_0x26b4f9);});}function main(){return server[_0x37d2('0x3c')](realtime,preview,fax)[_0x37d2('0x1a')](function(_0xda32ff){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report[_0x37d2('0x3d')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4d8ffc){console['log'](_0x4d8ffc);});}main(); \ No newline at end of file +var _0xf5c0=['getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','sync','log','bluebird','util','moment','./server','./realtime','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','initAgents','then','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initDeskAccounts','initZohoAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions'];(function(_0x475641,_0x9cdf2f){var _0x54f4f0=function(_0x2be35a){while(--_0x2be35a){_0x475641['push'](_0x475641['shift']());}};_0x54f4f0(++_0x9cdf2f);}(_0xf5c0,0x172));var _0x0f5c=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0xf5c0[_0x3213b7];return _0xb960bf;};'use strict';var BPromise=require(_0x0f5c('0x0'));var util=require(_0x0f5c('0x1'));var moment=require(_0x0f5c('0x2'));var server=require(_0x0f5c('0x3'));var Realtime=require(_0x0f5c('0x4'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x0f5c('0x5'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x0f5c('0x6'));var user=require(_0x0f5c('0x7'));var voiceQueue=require(_0x0f5c('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x0f5c('0x9'));var trunk=require(_0x0f5c('0xa'));var trigger=require(_0x0f5c('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x0f5c('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x0f5c('0xd'));var faxAccount=require(_0x0f5c('0xe'));var zendesk=require(_0x0f5c('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x0f5c('0x10'));var zoho=require(_0x0f5c('0x11'));var vtiger=require(_0x0f5c('0x12'));var servicenow=require(_0x0f5c('0x13'));var dynamics365=require(_0x0f5c('0x14'));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()[_0x0f5c('0x15')](_0x0f5c('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x0f5c('0x15')](_0x0f5c('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x0f5c('0x17')]()['then'](user['getAgents']())['then'](realtime[_0x0f5c('0x18')]())[_0x0f5c('0x19')](user[_0x0f5c('0x1a')]())[_0x0f5c('0x19')](realtime['initTelephones']())[_0x0f5c('0x19')](trunk['getTrunks']())[_0x0f5c('0x19')](realtime[_0x0f5c('0x1b')]())['then'](voiceQueue[_0x0f5c('0x1c')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x1d')]())[_0x0f5c('0x19')](trigger[_0x0f5c('0x1e')]())['then'](realtime[_0x0f5c('0x1f')]())[_0x0f5c('0x19')](template[_0x0f5c('0x20')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x21')]())['then'](zendesk[_0x0f5c('0x22')]())['then'](realtime[_0x0f5c('0x23')]())[_0x0f5c('0x19')](salesforce[_0x0f5c('0x24')]())[_0x0f5c('0x19')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x0f5c('0x25')]())['then'](realtime[_0x0f5c('0x26')]())[_0x0f5c('0x19')](freshdesk[_0x0f5c('0x27')]())[_0x0f5c('0x19')](realtime['initFreshdeskAccounts']())[_0x0f5c('0x19')](desk['getDeskAccounts']())['then'](realtime[_0x0f5c('0x28')]())[_0x0f5c('0x19')](zoho['getZohoAccounts']())[_0x0f5c('0x19')](realtime[_0x0f5c('0x29')]())[_0x0f5c('0x19')](vtiger['getVtigerAccounts']())['then'](realtime[_0x0f5c('0x2a')]())[_0x0f5c('0x19')](servicenow[_0x0f5c('0x2b')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x2c')]())[_0x0f5c('0x19')](dynamics365[_0x0f5c('0x2d')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x2e')]())[_0x0f5c('0x19')](campaign[_0x0f5c('0x2f')]())[_0x0f5c('0x19')](realtime['initCampaigns']())['then'](voiceExtension[_0x0f5c('0x30')]())[_0x0f5c('0x19')](realtime[_0x0f5c('0x31')]())[_0x0f5c('0x19')](faxAccount[_0x0f5c('0x32')]())['then'](realtime[_0x0f5c('0x33')]())[_0x0f5c('0x19')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x0f5c('0x19')](voiceQueueReport[_0x0f5c('0x34')]())['then'](realtime[_0x0f5c('0x35')]())['then'](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x0f5c('0x19')](realtime[_0x0f5c('0x36')]())[_0x0f5c('0x19')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x0f5c('0x37')]())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x0f5c('0x38')]())['then'](function(_0x2128a8){})[_0x0f5c('0x39')](function(_0x424b86){console['log'](_0x424b86);});}function main(){return server['listen'](realtime,preview,fax)[_0x0f5c('0x19')](function(_0x458f74){return initRealtime();})['then'](function(){return initParams();})[_0x0f5c('0x19')](function(){report[_0x0f5c('0x3a')]();setInterval(initRealtime,0x1388);})[_0x0f5c('0x39')](function(_0x42b3b6){console[_0x0f5c('0x3b')](_0x42b3b6);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 6721410..46a7951 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 _0x87ee=['lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','name','email','accountcode','state','unknown','stateTime','address','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','format','fullname','status','voiceStatusCallerIdNumber','stringify','emit','user:save','exports'];(function(_0x14ed5d,_0x329e47){var _0x1cadcb=function(_0x1c943f){while(--_0x1c943f){_0x14ed5d['push'](_0x14ed5d['shift']());}};_0x1cadcb(++_0x329e47);}(_0x87ee,0x10a));var _0xe87e=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x87ee[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xe87e('0x0'));var util=require(_0xe87e('0x1'));var moment=require(_0xe87e('0x2'));var md5=require(_0xe87e('0x3'));var Redis=require(_0xe87e('0x4'));var config=require(_0xe87e('0x5'));config[_0xe87e('0x6')]=_['defaults'](config[_0xe87e('0x6')],{'host':_0xe87e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x5deacf){this['id']=_0x5deacf['id']||0x0;this['name']=_0x5deacf[_0xe87e('0x8')]||'';this[_0xe87e('0x9')]=_0x5deacf[_0xe87e('0x9')]||'';this['accountcode']=_0x5deacf[_0xe87e('0xa')]||'';this['fullname']=_0x5deacf['fullname']||'';this[_0xe87e('0xb')]=_0xe87e('0xc');this[_0xe87e('0xd')]=0x0;this['status']=_0xe87e('0xc');this[_0xe87e('0xe')]='';this['phone']='';this['mobile']='';this[_0xe87e('0xf')]='';this[_0xe87e('0x10')]=_0x5deacf[_0xe87e('0x10')]||![];this[_0xe87e('0x11')]=_0xe87e('0xc');this[_0xe87e('0x12')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0xe87e('0x13')]='';this[_0xe87e('0x14')]=![];this[_0xe87e('0x15')]=![];this['md5']='';}Agent[_0xe87e('0x16')][_0xe87e('0x17')]=function(_0x15d35c){var _0x166c79;if(_0x15d35c&&_0x15d35c[_0xe87e('0xb')]){_0x166c79=_0x15d35c[_0xe87e('0xb')][_0xe87e('0x18')]();switch(_0x166c79){case _0xe87e('0x19'):_0x166c79='idle';break;case _0xe87e('0x1a'):_0x166c79=_0xe87e('0x1b');break;}}if(_0x166c79&&this[_0xe87e('0x11')]!==_0x166c79||_0x15d35c[_0xe87e('0x1c')]){this['voiceStatusTime']=_[_0xe87e('0x1d')](moment()[_0xe87e('0x1e')]('x'));}if(_0x166c79){this[_0xe87e('0x11')]=_0x166c79;}var _0x432ce2={'id':this['id'],'name':this[_0xe87e('0x8')],'email':this[_0xe87e('0x9')],'accountcode':this[_0xe87e('0xa')],'fullname':this[_0xe87e('0x1f')],'state':this[_0xe87e('0xb')],'stateTime':this['stateTime'],'status':this[_0xe87e('0x20')],'address':this[_0xe87e('0xe')],'online':this[_0xe87e('0x10')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xe87e('0x21')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0xe87e('0xf')],'onhold':this[_0xe87e('0x14')]};var _0x117ff3=md5(JSON[_0xe87e('0x22')](_0x432ce2));if(this[_0xe87e('0x3')]!==_0x117ff3){this[_0xe87e('0x3')]=_0x117ff3;io['to'](util[_0xe87e('0x1e')]('user:%s',_0x432ce2[_0xe87e('0x8')]))[_0xe87e('0x23')](_0xe87e('0x24'),_0x432ce2);}};module[_0xe87e('0x25')]=Agent; \ No newline at end of file +var _0x4008=['voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','updateStatusRealtime','toLowerCase','idle','inuse','statePause','toNumber','email','status','stringify','format','user:%s','emit','user:save','exports','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','accountcode','fullname','state','stateTime','unknown','address','phone','interface','online'];(function(_0x1ec00a,_0x2b9207){var _0x3fe47a=function(_0x1e6f56){while(--_0x1e6f56){_0x1ec00a['push'](_0x1ec00a['shift']());}};_0x3fe47a(++_0x2b9207);}(_0x4008,0x126));var _0x8400=function(_0x5c277d,_0x180ea3){_0x5c277d=_0x5c277d-0x0;var _0x5720b2=_0x4008[_0x5c277d];return _0x5720b2;};'use strict';var _=require(_0x8400('0x0'));var util=require(_0x8400('0x1'));var moment=require(_0x8400('0x2'));var md5=require('md5');var Redis=require(_0x8400('0x3'));var config=require(_0x8400('0x4'));config[_0x8400('0x5')]=_[_0x8400('0x6')](config[_0x8400('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8400('0x7'))(new Redis(config['redis']));function Agent(_0x18226d){this['id']=_0x18226d['id']||0x0;this['name']=_0x18226d[_0x8400('0x8')]||'';this['email']=_0x18226d['email']||'';this[_0x8400('0x9')]=_0x18226d[_0x8400('0x9')]||'';this[_0x8400('0xa')]=_0x18226d[_0x8400('0xa')]||'';this[_0x8400('0xb')]='unknown';this[_0x8400('0xc')]=0x0;this['status']=_0x8400('0xd');this[_0x8400('0xe')]='';this[_0x8400('0xf')]='';this['mobile']='';this[_0x8400('0x10')]='';this[_0x8400('0x11')]=_0x18226d[_0x8400('0x11')]||![];this[_0x8400('0x12')]=_0x8400('0xd');this[_0x8400('0x13')]=0x0;this[_0x8400('0x14')]='';this[_0x8400('0x15')]='';this[_0x8400('0x16')]=![];this[_0x8400('0x17')]=![];this[_0x8400('0x18')]='';}Agent['prototype'][_0x8400('0x19')]=function(_0x4f554a){var _0x108e20;if(_0x4f554a&&_0x4f554a[_0x8400('0xb')]){_0x108e20=_0x4f554a[_0x8400('0xb')][_0x8400('0x1a')]();switch(_0x108e20){case'not_inuse':_0x108e20=_0x8400('0x1b');break;case _0x8400('0x1c'):_0x108e20='talking';break;}}if(_0x108e20&&this[_0x8400('0x12')]!==_0x108e20||_0x4f554a[_0x8400('0x1d')]){this[_0x8400('0x13')]=_[_0x8400('0x1e')](moment()['format']('x'));}if(_0x108e20){this[_0x8400('0x12')]=_0x108e20;}var _0x5756e4={'id':this['id'],'name':this[_0x8400('0x8')],'email':this[_0x8400('0x1f')],'accountcode':this[_0x8400('0x9')],'fullname':this[_0x8400('0xa')],'state':this[_0x8400('0xb')],'stateTime':this['stateTime'],'status':this[_0x8400('0x20')],'address':this[_0x8400('0xe')],'online':this[_0x8400('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x8400('0x13')],'voiceStatusCallerIdNumber':this[_0x8400('0x14')],'voiceStatusQueue':this[_0x8400('0x15')],'interface':this[_0x8400('0x10')],'onhold':this[_0x8400('0x16')]};var _0x21cf0d=md5(JSON[_0x8400('0x21')](_0x5756e4));if(this[_0x8400('0x18')]!==_0x21cf0d){this[_0x8400('0x18')]=_0x21cf0d;io['to'](util[_0x8400('0x22')](_0x8400('0x23'),_0x5756e4['name']))[_0x8400('0x24')](_0x8400('0x25'),_0x5756e4);}};module[_0x8400('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index ab614ae..716a862 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 _0xad8a=['SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval'];(function(_0x43071b,_0x1ce820){var _0x5553ff=function(_0x1727b4){while(--_0x1727b4){_0x43071b['push'](_0x43071b['shift']());}};_0x5553ff(++_0x1ce820);}(_0xad8a,0xb0));var _0xaad8=function(_0x456e3c,_0x3a1787){_0x456e3c=_0x456e3c-0x0;var _0x3ec47a=_0xad8a[_0x456e3c];return _0x3ec47a;};'use strict';function Campaign(_0x4c65ae){this['id']=_0x4c65ae['id']||0x0;this[_0xaad8('0x0')]=_0x4c65ae[_0xaad8('0x0')]||'';this[_0xaad8('0x1')]=_0x4c65ae[_0xaad8('0x1')]||'campaign';this[_0xaad8('0x2')]=0x0;this[_0xaad8('0x3')]=0x0;this[_0xaad8('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xaad8('0x5')]='';this[_0xaad8('0x6')]=!![];this[_0xaad8('0x7')]=_0x4c65ae[_0xaad8('0x7')];this[_0xaad8('0x8')]=_0x4c65ae[_0xaad8('0x8')];this[_0xaad8('0x9')]=_0x4c65ae[_0xaad8('0x9')]||null;this[_0xaad8('0xa')]=_0x4c65ae[_0xaad8('0xa')]?_0x4c65ae['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x4c65ae[_0xaad8('0xb')];this[_0xaad8('0xc')]=_0x4c65ae[_0xaad8('0xc')];this[_0xaad8('0xd')]=_0x4c65ae[_0xaad8('0xd')]||0x1e;this[_0xaad8('0xe')]=_0x4c65ae[_0xaad8('0xe')];this[_0xaad8('0xf')]=_0x4c65ae[_0xaad8('0xf')];this['dialBusyMaxRetry']=_0x4c65ae[_0xaad8('0x10')];this[_0xaad8('0x11')]=_0x4c65ae[_0xaad8('0x11')];this[_0xaad8('0x12')]=_0x4c65ae[_0xaad8('0x12')];this[_0xaad8('0x13')]=_0x4c65ae[_0xaad8('0x13')];this[_0xaad8('0x14')]=_0x4c65ae[_0xaad8('0x14')];this[_0xaad8('0x15')]=_0x4c65ae[_0xaad8('0x15')]||_0xaad8('0x16');this[_0xaad8('0x17')]=_0x4c65ae['dialPrefix']||undefined;this[_0xaad8('0x18')]=_0x4c65ae[_0xaad8('0x18')]||undefined;this['dialCutDigit']=_0x4c65ae[_0xaad8('0x19')]||undefined;this[_0xaad8('0x1a')]=_0x4c65ae[_0xaad8('0x1a')]?_0x4c65ae[_0xaad8('0x1a')]:undefined;this[_0xaad8('0x1b')]=_0x4c65ae[_0xaad8('0x1b')]?_0x4c65ae['Trunk']:undefined;this[_0xaad8('0x1c')]=_0x4c65ae[_0xaad8('0x1c')]?_0x4c65ae['Interval']:undefined;this[_0xaad8('0x1d')]=_0x4c65ae['SquareProject']?_0x4c65ae[_0xaad8('0x1d')]:undefined;this[_0xaad8('0x1e')]=_0x4c65ae[_0xaad8('0x1d')]?_0x4c65ae[_0xaad8('0x1d')]['name']:undefined;this[_0xaad8('0x1f')]=_0x4c65ae[_0xaad8('0x1f')]||![];this['dialAMDInitialSilence']=_0x4c65ae[_0xaad8('0x20')];this[_0xaad8('0x21')]=_0x4c65ae[_0xaad8('0x21')];this['dialAMDAfterGreetingSilence']=_0x4c65ae['dialAMDAfterGreetingSilence'];this[_0xaad8('0x22')]=_0x4c65ae[_0xaad8('0x22')];this[_0xaad8('0x23')]=_0x4c65ae[_0xaad8('0x23')];this[_0xaad8('0x24')]=_0x4c65ae[_0xaad8('0x24')];this[_0xaad8('0x25')]=_0x4c65ae[_0xaad8('0x25')];this[_0xaad8('0x26')]=_0x4c65ae[_0xaad8('0x26')];this[_0xaad8('0x27')]=_0x4c65ae[_0xaad8('0x27')];}module[_0xaad8('0x28')]=Campaign; \ No newline at end of file +var _0x073e=['dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x3318c3,_0x35066){var _0x15c002=function(_0xd82271){while(--_0xd82271){_0x3318c3['push'](_0x3318c3['shift']());}};_0x15c002(++_0x35066);}(_0x073e,0x181));var _0xe073=function(_0x684f90,_0x487c04){_0x684f90=_0x684f90-0x0;var _0x3b8070=_0x073e[_0x684f90];return _0x3b8070;};'use strict';function Campaign(_0xf70489){this['id']=_0xf70489['id']||0x0;this[_0xe073('0x0')]=_0xf70489[_0xe073('0x0')]||'';this[_0xe073('0x1')]=_0xf70489['type']||'campaign';this['originated']=0x0;this[_0xe073('0x2')]=0x0;this[_0xe073('0x3')]=0x0;this[_0xe073('0x4')]=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0xf70489[_0xe073('0x5')];this[_0xe073('0x6')]=_0xf70489[_0xe073('0x6')];this[_0xe073('0x7')]=_0xf70489[_0xe073('0x7')]||null;this[_0xe073('0x8')]=_0xf70489['dialGlobalInterval']?_0xf70489[_0xe073('0x8')]:null;this[_0xe073('0x9')]=_0xf70489[_0xe073('0x9')];this[_0xe073('0xa')]=_0xf70489['dialOriginateCallerIdNumber'];this[_0xe073('0xb')]=_0xf70489[_0xe073('0xb')]||0x1e;this[_0xe073('0xc')]=_0xf70489[_0xe073('0xc')];this[_0xe073('0xd')]=_0xf70489[_0xe073('0xd')];this['dialBusyMaxRetry']=_0xf70489[_0xe073('0xe')];this['dialBusyRetryFrequency']=_0xf70489[_0xe073('0xf')];this['dialNoAnswerMaxRetry']=_0xf70489[_0xe073('0x10')];this['dialNoAnswerRetryFrequency']=_0xf70489[_0xe073('0x11')];this[_0xe073('0x12')]=_0xf70489[_0xe073('0x12')];this[_0xe073('0x13')]=_0xf70489[_0xe073('0x13')]||_0xe073('0x14');this[_0xe073('0x15')]=_0xf70489[_0xe073('0x15')]||undefined;this[_0xe073('0x16')]=_0xf70489[_0xe073('0x16')]||undefined;this[_0xe073('0x17')]=_0xf70489['dialCutDigit']||undefined;this['TrunkBackup']=_0xf70489['TrunkBackup']?_0xf70489[_0xe073('0x18')]:undefined;this[_0xe073('0x19')]=_0xf70489[_0xe073('0x19')]?_0xf70489[_0xe073('0x19')]:undefined;this['Interval']=_0xf70489[_0xe073('0x1a')]?_0xf70489[_0xe073('0x1a')]:undefined;this[_0xe073('0x1b')]=_0xf70489['SquareProject']?_0xf70489[_0xe073('0x1b')]:undefined;this[_0xe073('0x1c')]=_0xf70489[_0xe073('0x1b')]?_0xf70489[_0xe073('0x1b')][_0xe073('0x0')]:undefined;this[_0xe073('0x1d')]=_0xf70489[_0xe073('0x1d')]||![];this[_0xe073('0x1e')]=_0xf70489[_0xe073('0x1e')];this[_0xe073('0x1f')]=_0xf70489['dialAMDGreeting'];this[_0xe073('0x20')]=_0xf70489[_0xe073('0x20')];this[_0xe073('0x21')]=_0xf70489[_0xe073('0x21')];this[_0xe073('0x22')]=_0xf70489[_0xe073('0x22')];this['dialAMDBetweenWordsSilence']=_0xf70489['dialAMDBetweenWordsSilence'];this[_0xe073('0x23')]=_0xf70489['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0xf70489['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0xf70489['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index abba675..795742d 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 _0xd0da=['endtime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','exten'];(function(_0x4c041d,_0x3541cb){var _0x163f43=function(_0x5dff2b){while(--_0x5dff2b){_0x4c041d['push'](_0x4c041d['shift']());}};_0x163f43(++_0x3541cb);}(_0xd0da,0x1b1));var _0xad0d=function(_0x34e4a0,_0x1fd446){_0x34e4a0=_0x34e4a0-0x0;var _0x3ead3e=_0xd0da[_0x34e4a0];return _0x3ead3e;};'use strict';function Channel(){this[_0xad0d('0x0')]=null;this[_0xad0d('0x1')]='';this[_0xad0d('0x2')]='';this[_0xad0d('0x3')]=0x0;this[_0xad0d('0x4')]='';this['connectedlinenum']=undefined;this[_0xad0d('0x5')]=undefined;this[_0xad0d('0x6')]=0x0;this[_0xad0d('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xad0d('0x8')]=0x0;this['answered']=![];this['answertime']=null;this[_0xad0d('0x9')]=null;this[_0xad0d('0xa')]=![];this[_0xad0d('0xb')]=![];this[_0xad0d('0xc')]='';this['lastdata']='';this[_0xad0d('0xd')]=0x0;this[_0xad0d('0xe')]=0x0;this[_0xad0d('0xf')]=0x0;this[_0xad0d('0x10')]=null;this[_0xad0d('0x11')]=null;this[_0xad0d('0x12')]=null;this[_0xad0d('0x13')]=![];this[_0xad0d('0x14')]=null;this[_0xad0d('0x15')]=null;this[_0xad0d('0x16')]=[];this[_0xad0d('0x17')]=undefined;this[_0xad0d('0x18')]=undefined;this[_0xad0d('0x19')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xf963=['unmanaged','abandoned','lastdata','duration','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','exports','starttime','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','answered','endtime'];(function(_0x229d24,_0x40c4b9){var _0x4eec76=function(_0x403f9b){while(--_0x403f9b){_0x229d24['push'](_0x229d24['shift']());}};_0x4eec76(++_0x40c4b9);}(_0xf963,0x11d));var _0x3f96=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xf963[_0x1035c1];return _0x308d67;};'use strict';function Channel(){this[_0x3f96('0x0')]=null;this['channel']='';this['destinationchannel']='';this[_0x3f96('0x1')]=0x0;this[_0x3f96('0x2')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x3f96('0x3')]=0x0;this[_0x3f96('0x4')]='';this[_0x3f96('0x5')]=0x0;this[_0x3f96('0x6')]=0x0;this['exten']=0x0;this[_0x3f96('0x7')]=![];this['answertime']=null;this[_0x3f96('0x8')]=null;this[_0x3f96('0x9')]=![];this[_0x3f96('0xa')]=![];this['lastapplication']='';this[_0x3f96('0xb')]='';this[_0x3f96('0xc')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this['type']=null;this['tag']=null;this[_0x3f96('0xd')]=null;this[_0x3f96('0xe')]=![];this[_0x3f96('0xf')]=null;this[_0x3f96('0x10')]=null;this[_0x3f96('0x11')]=[];this['transfercalleridnum']=undefined;this[_0x3f96('0x12')]=undefined;this[_0x3f96('0x13')]=0x0;}module[_0x3f96('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 b66b5f7..e01dfb9 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 _0xa04f=['name','username','remoteUri','authType','password','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0xa04f,0x9a));var _0xfa04=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa04f[_0x5f09c5];return _0x426ad9;};'use strict';function DeskAccount(_0x176667){this['id']=_0x176667['id']||0x0;this['name']=_0x176667[_0xfa04('0x0')]||'';this[_0xfa04('0x1')]=_0x176667[_0xfa04('0x1')]||'';this[_0xfa04('0x2')]=_0x176667['remoteUri']||'';this[_0xfa04('0x3')]=_0x176667[_0xfa04('0x3')]||'';this['password']=_0x176667[_0xfa04('0x4')]||'';this['consumerKey']=_0x176667['consumerKey']||'';this[_0xfa04('0x5')]=_0x176667[_0xfa04('0x5')]||'';this[_0xfa04('0x6')]=_0x176667['token']||'';this[_0xfa04('0x7')]=_0x176667['tokenSecret']||'';this[_0xfa04('0x8')]=_0x176667[_0xfa04('0x8')]||'';this[_0xfa04('0x9')]=_0x176667[_0xfa04('0x9')]||'';this['Configurations']=_0x176667[_0xfa04('0xa')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x4fa7=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x1abb94,_0xeb6704){var _0x37ed56=function(_0x26e6aa){while(--_0x26e6aa){_0x1abb94['push'](_0x1abb94['shift']());}};_0x37ed56(++_0xeb6704);}(_0x4fa7,0x127));var _0x74fa=function(_0x2d9e27,_0x5965b2){_0x2d9e27=_0x2d9e27-0x0;var _0xd35381=_0x4fa7[_0x2d9e27];return _0xd35381;};'use strict';function DeskAccount(_0xa5f114){this['id']=_0xa5f114['id']||0x0;this[_0x74fa('0x0')]=_0xa5f114[_0x74fa('0x0')]||'';this[_0x74fa('0x1')]=_0xa5f114[_0x74fa('0x1')]||'';this[_0x74fa('0x2')]=_0xa5f114[_0x74fa('0x2')]||'';this[_0x74fa('0x3')]=_0xa5f114[_0x74fa('0x3')]||'';this[_0x74fa('0x4')]=_0xa5f114[_0x74fa('0x4')]||'';this[_0x74fa('0x5')]=_0xa5f114[_0x74fa('0x5')]||'';this[_0x74fa('0x6')]=_0xa5f114[_0x74fa('0x6')]||'';this[_0x74fa('0x7')]=_0xa5f114['token']||'';this[_0x74fa('0x8')]=_0xa5f114[_0x74fa('0x8')]||'';this[_0x74fa('0x9')]=_0xa5f114[_0x74fa('0x9')]||'';this[_0x74fa('0xa')]=_0xa5f114[_0x74fa('0xa')]||'';this['Configurations']=_0xa5f114[_0x74fa('0xb')]||{};}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 e21ff06..29e4d79 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 _0xf382=['serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x58be09,_0x1573fb){var _0x5298a8=function(_0x4d2a0a){while(--_0x4d2a0a){_0x58be09['push'](_0x58be09['shift']());}};_0x5298a8(++_0x1573fb);}(_0xf382,0x111));var _0x2f38=function(_0x20f495,_0x50928f){_0x20f495=_0x20f495-0x0;var _0x50e3b1=_0xf382[_0x20f495];return _0x50e3b1;};'use strict';function Dynamics365Account(_0xaf907c){this['id']=_0xaf907c['id']||0x0;this[_0x2f38('0x0')]=_0xaf907c[_0x2f38('0x0')]||'';this[_0x2f38('0x1')]=_0xaf907c[_0x2f38('0x1')]||'';this[_0x2f38('0x2')]=_0xaf907c['password']||'';this['remoteUri']=_0xaf907c[_0x2f38('0x3')]||'';this[_0x2f38('0x4')]=_0xaf907c['tenantId']||'';this[_0x2f38('0x5')]=_0xaf907c['clientId']||'';this['clientSecret']=_0xaf907c[_0x2f38('0x6')]||{};this[_0x2f38('0x7')]=_0xaf907c[_0x2f38('0x7')]||'';this[_0x2f38('0x8')]=_0xaf907c[_0x2f38('0x8')]||{};}module[_0x2f38('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xd3d2=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x3e6b83,_0x224b71){var _0x599977=function(_0x51b428){while(--_0x51b428){_0x3e6b83['push'](_0x3e6b83['shift']());}};_0x599977(++_0x224b71);}(_0xd3d2,0x83));var _0x2d3d=function(_0x55b6e0,_0x523344){_0x55b6e0=_0x55b6e0-0x0;var _0x12cfa1=_0xd3d2[_0x55b6e0];return _0x12cfa1;};'use strict';function Dynamics365Account(_0x2e98a3){this['id']=_0x2e98a3['id']||0x0;this[_0x2d3d('0x0')]=_0x2e98a3[_0x2d3d('0x0')]||'';this['username']=_0x2e98a3[_0x2d3d('0x1')]||'';this['password']=_0x2e98a3[_0x2d3d('0x2')]||'';this[_0x2d3d('0x3')]=_0x2e98a3[_0x2d3d('0x3')]||'';this[_0x2d3d('0x4')]=_0x2e98a3[_0x2d3d('0x4')]||'';this['clientId']=_0x2e98a3[_0x2d3d('0x5')]||'';this[_0x2d3d('0x6')]=_0x2e98a3[_0x2d3d('0x6')]||{};this[_0x2d3d('0x7')]=_0x2e98a3['serverUrl']||'';this[_0x2d3d('0x8')]=_0x2e98a3[_0x2d3d('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 4380276..272dda4 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 _0x7072=['tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','t38timeout'];(function(_0x3434d7,_0x4d4eb0){var _0x51eebd=function(_0x37161c){while(--_0x37161c){_0x3434d7['push'](_0x3434d7['shift']());}};_0x51eebd(++_0x4d4eb0);}(_0x7072,0x138));var _0x2707=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x7072[_0x36c5b0];return _0xf19333;};'use strict';function FaxAccount(_0xbb6795){this['id']=_0xbb6795['id']||0x0;this[_0x2707('0x0')]=_0xbb6795[_0x2707('0x0')]||'';this[_0x2707('0x1')]=_0xbb6795[_0x2707('0x1')];this[_0x2707('0x2')]=_0xbb6795['ecm'];this['headerinfo']=_0xbb6795[_0x2707('0x3')];this['localstationid']=_0xbb6795[_0x2707('0x4')];this[_0x2707('0x5')]=_0xbb6795[_0x2707('0x5')]||0x960;this[_0x2707('0x6')]=_0xbb6795[_0x2707('0x6')]||0x3840;this[_0x2707('0x7')]=_0xbb6795[_0x2707('0x7')]||_0x2707('0x8');this[_0x2707('0x9')]=_0xbb6795[_0x2707('0x9')]||'no';this['faxdetect']=_0xbb6795['faxdetect']||'no';this[_0x2707('0xa')]=_0xbb6795[_0x2707('0xa')]||0x1388;this[_0x2707('0xb')]=_0xbb6795[_0x2707('0xb')]||_0x2707('0xc');this[_0x2707('0xd')]=_0xbb6795[_0x2707('0xd')]?_0xbb6795[_0x2707('0xd')]:undefined;this[_0x2707('0xe')]=_0xbb6795[_0x2707('0xe')];this[_0x2707('0xf')]=_0xbb6795[_0x2707('0xf')];}module[_0x2707('0x10')]=FaxAccount; \ No newline at end of file +var _0xd87e=['description','ecm','headerinfo','localstationid','minrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name'];(function(_0x17c216,_0x1eed2a){var _0x2b2b39=function(_0x26a65a){while(--_0x26a65a){_0x17c216['push'](_0x17c216['shift']());}};_0x2b2b39(++_0x1eed2a);}(_0xd87e,0x1bf));var _0xed87=function(_0x2c826b,_0xadaf9e){_0x2c826b=_0x2c826b-0x0;var _0x22603f=_0xd87e[_0x2c826b];return _0x22603f;};'use strict';function FaxAccount(_0x3cd682){this['id']=_0x3cd682['id']||0x0;this[_0xed87('0x0')]=_0x3cd682['name']||'';this[_0xed87('0x1')]=_0x3cd682[_0xed87('0x1')];this[_0xed87('0x2')]=_0x3cd682['ecm'];this[_0xed87('0x3')]=_0x3cd682['headerinfo'];this[_0xed87('0x4')]=_0x3cd682[_0xed87('0x4')];this['minrate']=_0x3cd682[_0xed87('0x5')]||0x960;this['maxrate']=_0x3cd682['maxrate']||0x3840;this[_0xed87('0x6')]=_0x3cd682[_0xed87('0x6')]||_0xed87('0x7');this[_0xed87('0x8')]=_0x3cd682['gateway']||'no';this[_0xed87('0x9')]=_0x3cd682[_0xed87('0x9')]||'no';this[_0xed87('0xa')]=_0x3cd682[_0xed87('0xa')]||0x1388;this[_0xed87('0xb')]=_0x3cd682[_0xed87('0xb')]||_0xed87('0xc');this['Trunk']=_0x3cd682[_0xed87('0xd')]?_0x3cd682[_0xed87('0xd')]:undefined;this['ListId']=_0x3cd682[_0xed87('0xe')];this[_0xed87('0xf')]=_0x3cd682['key'];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index fb0d718..d38c51f 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 _0xd33d=['apiKey','token','remoteUri','Configurations','exports','name','username'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd33d,0x1e8));var _0xdd33=function(_0x299ad3,_0xa2d1d9){_0x299ad3=_0x299ad3-0x0;var _0x48dc6b=_0xd33d[_0x299ad3];return _0x48dc6b;};'use strict';function FreshdeskAccount(_0x1a0a9c){this['id']=_0x1a0a9c['id']||0x0;this['name']=_0x1a0a9c[_0xdd33('0x0')]||'';this[_0xdd33('0x1')]=_0x1a0a9c['username']||'';this[_0xdd33('0x2')]=_0x1a0a9c[_0xdd33('0x3')]||'';this[_0xdd33('0x4')]=_0x1a0a9c[_0xdd33('0x4')]||'';this['serverUrl']=_0x1a0a9c['serverUrl']||'';this[_0xdd33('0x5')]=_0x1a0a9c[_0xdd33('0x5')]||{};}module[_0xdd33('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0x436c=['username','apiKey','token','remoteUri','serverUrl','exports','name'];(function(_0x37ff49,_0x50bd30){var _0x3dbb50=function(_0x53e457){while(--_0x53e457){_0x37ff49['push'](_0x37ff49['shift']());}};_0x3dbb50(++_0x50bd30);}(_0x436c,0x125));var _0xc436=function(_0x3e1ffe,_0x10ff9e){_0x3e1ffe=_0x3e1ffe-0x0;var _0x384ac6=_0x436c[_0x3e1ffe];return _0x384ac6;};'use strict';function FreshdeskAccount(_0x580b75){this['id']=_0x580b75['id']||0x0;this[_0xc436('0x0')]=_0x580b75['name']||'';this[_0xc436('0x1')]=_0x580b75[_0xc436('0x1')]||'';this[_0xc436('0x2')]=_0x580b75[_0xc436('0x3')]||'';this[_0xc436('0x4')]=_0x580b75[_0xc436('0x4')]||'';this[_0xc436('0x5')]=_0x580b75[_0xc436('0x5')]||'';this['Configurations']=_0x580b75['Configurations']||{};}module[_0xc436('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 4b81cff..3a1f39f 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 _0x8525=['exports','inbound','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime'];(function(_0x3a37e3,_0x1f21a2){var _0x2eb728=function(_0x68df01){while(--_0x68df01){_0x3a37e3['push'](_0x3a37e3['shift']());}};_0x2eb728(++_0x1f21a2);}(_0x8525,0xc7));var _0x5852=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x8525[_0x27af45];return _0x18df21;};'use strict';function QueueReport(){this['type']=_0x5852('0x0');this['uniqueid']='';this['calleridnum']='';this[_0x5852('0x1')]='';this[_0x5852('0x2')]='';this[_0x5852('0x3')]=null;this['queuecallerleaveAt']=null;this[_0x5852('0x4')]=0x1;this[_0x5852('0x5')]=0x1;this['queuecallerabandon']=![];this[_0x5852('0x6')]=null;this[_0x5852('0x7')]=![];this[_0x5852('0x8')]=null;this[_0x5852('0x9')]=![];this[_0x5852('0xa')]=null;this[_0x5852('0xb')]=0x1;this[_0x5852('0xc')]='';this['connectedlinenum']='';this[_0x5852('0xd')]='';this['accountcode']='';this[_0x5852('0xe')]='';this[_0x5852('0xf')]='';this[_0x5852('0x10')]='';this[_0x5852('0x11')]=0x0;this[_0x5852('0x12')]=![];this[_0x5852('0x13')]='';this[_0x5852('0x14')]=0x0;this['variables']={};}module[_0x5852('0x15')]=QueueReport; \ No newline at end of file +var _0x54b5=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinename','accountcode','exten','priority','assigned','lastAssignedTo','exports','type','inbound','uniqueid','calleridname','queuecallerleaveAt','position','count'];(function(_0x2d8395,_0x4fe595){var _0x3eb0c9=function(_0xd62e7c){while(--_0xd62e7c){_0x2d8395['push'](_0x2d8395['shift']());}};_0x3eb0c9(++_0x4fe595);}(_0x54b5,0xad));var _0x554b=function(_0x2a682e,_0x514db8){_0x2a682e=_0x2a682e-0x0;var _0x4763f9=_0x54b5[_0x2a682e];return _0x4763f9;};'use strict';function QueueReport(){this[_0x554b('0x0')]=_0x554b('0x1');this[_0x554b('0x2')]='';this['calleridnum']='';this[_0x554b('0x3')]='';this['queue']='';this['queuecallerjoinAt']=null;this[_0x554b('0x4')]=null;this[_0x554b('0x5')]=0x1;this[_0x554b('0x6')]=0x1;this[_0x554b('0x7')]=![];this[_0x554b('0x8')]=null;this[_0x554b('0x9')]=![];this[_0x554b('0xa')]=null;this[_0x554b('0xb')]=![];this[_0x554b('0xc')]=null;this['originalposition']=0x1;this['channel']='';this['connectedlinenum']='';this[_0x554b('0xd')]='';this[_0x554b('0xe')]='';this['context']='';this[_0x554b('0xf')]='';this[_0x554b('0x10')]='';this['holdtime']=0x0;this[_0x554b('0x11')]=![];this[_0x554b('0x12')]='';this['mohtime']=0x0;this['variables']={};}module[_0x554b('0x13')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 4832ee4..dbc1a1a 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 _0x5fb5=['securityToken','type','integrationTab','serverUrl','exports','name','username','remoteUri','clientId','clientSecret'];(function(_0x12c262,_0x25f1b5){var _0x34577f=function(_0x5bc218){while(--_0x5bc218){_0x12c262['push'](_0x12c262['shift']());}};_0x34577f(++_0x25f1b5);}(_0x5fb5,0x73));var _0x55fb=function(_0x1e5068,_0x31e9c4){_0x1e5068=_0x1e5068-0x0;var _0x2230b6=_0x5fb5[_0x1e5068];return _0x2230b6;};'use strict';function SalesforceAccount(_0x498275){this['id']=_0x498275['id']||0x0;this[_0x55fb('0x0')]=_0x498275[_0x55fb('0x0')]||'';this['username']=_0x498275[_0x55fb('0x1')]||'';this[_0x55fb('0x2')]=_0x498275[_0x55fb('0x2')]||'';this['password']=_0x498275['password']||'';this[_0x55fb('0x3')]=_0x498275[_0x55fb('0x3')]||'';this[_0x55fb('0x4')]=_0x498275[_0x55fb('0x4')]||'';this[_0x55fb('0x5')]=_0x498275['securityToken']||'';this[_0x55fb('0x6')]=_0x498275[_0x55fb('0x6')]||_0x55fb('0x7');this['serverUrl']=_0x498275[_0x55fb('0x8')]||'';this['Configurations']=_0x498275['Configurations']||{};}module[_0x55fb('0x9')]=SalesforceAccount; \ No newline at end of file +var _0x25b9=['serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','securityToken','type'];(function(_0x497180,_0x326a76){var _0xea6880=function(_0x496305){while(--_0x496305){_0x497180['push'](_0x497180['shift']());}};_0xea6880(++_0x326a76);}(_0x25b9,0x1a7));var _0x925b=function(_0x1d01bf,_0x579fc6){_0x1d01bf=_0x1d01bf-0x0;var _0x50f165=_0x25b9[_0x1d01bf];return _0x50f165;};'use strict';function SalesforceAccount(_0x1ad77a){this['id']=_0x1ad77a['id']||0x0;this[_0x925b('0x0')]=_0x1ad77a[_0x925b('0x0')]||'';this['username']=_0x1ad77a[_0x925b('0x1')]||'';this[_0x925b('0x2')]=_0x1ad77a['remoteUri']||'';this[_0x925b('0x3')]=_0x1ad77a[_0x925b('0x3')]||'';this[_0x925b('0x4')]=_0x1ad77a[_0x925b('0x4')]||'';this['clientSecret']=_0x1ad77a['clientSecret']||'';this[_0x925b('0x5')]=_0x1ad77a[_0x925b('0x5')]||'';this[_0x925b('0x6')]=_0x1ad77a[_0x925b('0x6')]||'integrationTab';this[_0x925b('0x7')]=_0x1ad77a[_0x925b('0x7')]||'';this[_0x925b('0x8')]=_0x1ad77a[_0x925b('0x8')]||{};}module[_0x925b('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 90ddaa6..9ef4922 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 _0x7a4e=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a4e,0x195));var _0xe7a4=function(_0x21a848,_0x5ce41a){_0x21a848=_0x21a848-0x0;var _0x5aaf99=_0x7a4e[_0x21a848];return _0x5aaf99;};'use strict';function ServicenowAccount(_0x329be4){this['id']=_0x329be4['id']||0x0;this['name']=_0x329be4[_0xe7a4('0x0')]||'';this['username']=_0x329be4[_0xe7a4('0x1')]||'';this[_0xe7a4('0x2')]=_0x329be4['password']||'';this[_0xe7a4('0x3')]=_0x329be4[_0xe7a4('0x3')]||'';this[_0xe7a4('0x4')]=_0x329be4[_0xe7a4('0x4')]||'';this[_0xe7a4('0x5')]=_0x329be4['Configurations']||{};}module[_0xe7a4('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xf459=['username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0xf459,0x174));var _0x9f45=function(_0x296144,_0x26bbbf){_0x296144=_0x296144-0x0;var _0x5329b1=_0xf459[_0x296144];return _0x5329b1;};'use strict';function ServicenowAccount(_0x134836){this['id']=_0x134836['id']||0x0;this['name']=_0x134836['name']||'';this[_0x9f45('0x0')]=_0x134836[_0x9f45('0x0')]||'';this[_0x9f45('0x1')]=_0x134836['password']||'';this[_0x9f45('0x2')]=_0x134836[_0x9f45('0x2')]||'';this[_0x9f45('0x3')]=_0x134836['serverUrl']||'';this[_0x9f45('0x4')]=_0x134836['Configurations']||{};}module[_0x9f45('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index b1df819..50c87ea 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 _0x1566=['username','remoteUri','serverUrl','Configurations','name'];(function(_0x551384,_0x4ee3bf){var _0x2bd70e=function(_0x59390a){while(--_0x59390a){_0x551384['push'](_0x551384['shift']());}};_0x2bd70e(++_0x4ee3bf);}(_0x1566,0x13a));var _0x6156=function(_0x34e29e,_0x3d6df5){_0x34e29e=_0x34e29e-0x0;var _0x4d0088=_0x1566[_0x34e29e];return _0x4d0088;};'use strict';function SugarcrmAccount(_0x565de8){this['id']=_0x565de8['id']||0x0;this[_0x6156('0x0')]=_0x565de8['name']||'';this[_0x6156('0x1')]=_0x565de8['username']||'';this['password']=_0x565de8['password']||'';this[_0x6156('0x2')]=_0x565de8[_0x6156('0x2')]||'';this[_0x6156('0x3')]=_0x565de8[_0x6156('0x3')]||'';this[_0x6156('0x4')]=_0x565de8[_0x6156('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x864c=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1388c4,_0x5c2b82){var _0x4c9232=function(_0x47acb9){while(--_0x47acb9){_0x1388c4['push'](_0x1388c4['shift']());}};_0x4c9232(++_0x5c2b82);}(_0x864c,0x1ec));var _0xc864=function(_0x457fcf,_0x1eab67){_0x457fcf=_0x457fcf-0x0;var _0x20f875=_0x864c[_0x457fcf];return _0x20f875;};'use strict';function SugarcrmAccount(_0xccc633){this['id']=_0xccc633['id']||0x0;this[_0xc864('0x0')]=_0xccc633[_0xc864('0x0')]||'';this[_0xc864('0x1')]=_0xccc633['username']||'';this[_0xc864('0x2')]=_0xccc633[_0xc864('0x2')]||'';this[_0xc864('0x3')]=_0xccc633[_0xc864('0x3')]||'';this[_0xc864('0x4')]=_0xccc633[_0xc864('0x4')]||'';this[_0xc864('0x5')]=_0xccc633[_0xc864('0x5')]||{};}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 ad7b01c..b1e3d54 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 _0x615f=['unknown','status','address','name','accountcode','state'];(function(_0x33ceeb,_0x58b863){var _0x5b6556=function(_0x23a6b1){while(--_0x23a6b1){_0x33ceeb['push'](_0x33ceeb['shift']());}};_0x5b6556(++_0x58b863);}(_0x615f,0x177));var _0xf615=function(_0x110ec3,_0x54df75){_0x110ec3=_0x110ec3-0x0;var _0x2d46bc=_0x615f[_0x110ec3];return _0x2d46bc;};'use strict';function Telephone(_0x27542f){this['id']=_0x27542f['id']||0x0;this['name']=_0x27542f[_0xf615('0x0')]||'';this[_0xf615('0x1')]=_0x27542f[_0xf615('0x1')]||'';this[_0xf615('0x2')]=_0xf615('0x3');this['stateTime']=0x0;this[_0xf615('0x4')]='unknown';this[_0xf615('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x52bf=['address','exports','name','accountcode','state','stateTime','status','unknown'];(function(_0x20a7d0,_0x371f39){var _0x31bc45=function(_0x52df8d){while(--_0x52df8d){_0x20a7d0['push'](_0x20a7d0['shift']());}};_0x31bc45(++_0x371f39);}(_0x52bf,0x13a));var _0xf52b=function(_0x29295f,_0x98967){_0x29295f=_0x29295f-0x0;var _0x2f49bf=_0x52bf[_0x29295f];return _0x2f49bf;};'use strict';function Telephone(_0x443dd0){this['id']=_0x443dd0['id']||0x0;this[_0xf52b('0x0')]=_0x443dd0['name']||'';this[_0xf52b('0x1')]=_0x443dd0[_0xf52b('0x1')]||'';this[_0xf52b('0x2')]='unknown';this[_0xf52b('0x3')]=0x0;this[_0xf52b('0x4')]=_0xf52b('0x5');this[_0xf52b('0x6')]='';}module[_0xf52b('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 81c476a..7d2b15b 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 _0x16d2=['name','html','exports'];(function(_0xd6bf43,_0x3bb332){var _0x44b07e=function(_0x36d231){while(--_0x36d231){_0xd6bf43['push'](_0xd6bf43['shift']());}};_0x44b07e(++_0x3bb332);}(_0x16d2,0x123));var _0x216d=function(_0x50e703,_0x127370){_0x50e703=_0x50e703-0x0;var _0xf1840c=_0x16d2[_0x50e703];return _0xf1840c;};'use strict';function template(_0x585a59){this['id']=_0x585a59['id']||0x0;this[_0x216d('0x0')]=_0x585a59[_0x216d('0x0')]||'';this[_0x216d('0x1')]=_0x585a59[_0x216d('0x1')]||'';}module[_0x216d('0x2')]=template; \ No newline at end of file +var _0x99e9=['name','html'];(function(_0x13dbb3,_0x175749){var _0x491133=function(_0x4b609d){while(--_0x4b609d){_0x13dbb3['push'](_0x13dbb3['shift']());}};_0x491133(++_0x175749);}(_0x99e9,0xb4));var _0x999e=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x99e9[_0x30bd4d];return _0x306915;};'use strict';function template(_0x11956a){this['id']=_0x11956a['id']||0x0;this[_0x999e('0x0')]=_0x11956a[_0x999e('0x0')]||'';this[_0x999e('0x1')]=_0x11956a[_0x999e('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e592faa..ae2f78f 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 _0x6fdb=['channel','voice','status','AllConditions','AnyConditions','Actions','exports'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x6fdb,0x18f));var _0xb6fd=function(_0x1a5eb0,_0x1f8fbb){_0x1a5eb0=_0x1a5eb0-0x0;var _0x30f9ba=_0x6fdb[_0x1a5eb0];return _0x30f9ba;};'use strict';function Trigger(_0x492889){this['id']=_0x492889['id']||0x0;this['name']=_0x492889['name']||'';this[_0xb6fd('0x0')]=_0x492889[_0xb6fd('0x0')]||_0xb6fd('0x1');this[_0xb6fd('0x2')]=_0x492889[_0xb6fd('0x2')]||![];this[_0xb6fd('0x3')]=_0x492889[_0xb6fd('0x3')]||[];this[_0xb6fd('0x4')]=_0x492889['AnyConditions']||[];this[_0xb6fd('0x5')]=_0x492889['Actions']||[];}module[_0xb6fd('0x6')]=Trigger; \ No newline at end of file +var _0x31c2=['voice','status','AllConditions','AnyConditions','exports','name','channel'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x31c2,0x1ef));var _0x231c=function(_0x5bef28,_0x291a58){_0x5bef28=_0x5bef28-0x0;var _0xf5359=_0x31c2[_0x5bef28];return _0xf5359;};'use strict';function Trigger(_0x34d7d0){this['id']=_0x34d7d0['id']||0x0;this['name']=_0x34d7d0[_0x231c('0x0')]||'';this['channel']=_0x34d7d0[_0x231c('0x1')]||_0x231c('0x2');this[_0x231c('0x3')]=_0x34d7d0[_0x231c('0x3')]||![];this[_0x231c('0x4')]=_0x34d7d0['AllConditions']||[];this[_0x231c('0x5')]=_0x34d7d0[_0x231c('0x5')]||[];this['Actions']=_0x34d7d0['Actions']||[];}module[_0x231c('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 3b28932..3ad110c 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 _0x9cc4=['status','unknown','registry','indexOf','split','host','port','domainport','stateRegistry','registrationtime','address','exports','active','name','state','stateTime'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x9cc4,0x19c));var _0x49cc=function(_0x50bc44,_0x1aa118){_0x50bc44=_0x50bc44-0x0;var _0x15c743=_0x9cc4[_0x50bc44];return _0x15c743;};'use strict';function Trunk(_0x79842a){this['id']=_0x79842a['id']||0x0;this['active']=_0x79842a[_0x49cc('0x0')]||![];this['name']=_0x79842a[_0x49cc('0x1')]||'';this[_0x49cc('0x2')]='unknown';this[_0x49cc('0x3')]=0x0;this[_0x49cc('0x4')]=_0x49cc('0x5');this[_0x49cc('0x6')]=_0x79842a['registry']&&_0x79842a[_0x49cc('0x6')][_0x49cc('0x7')](':')?_0x79842a[_0x49cc('0x6')][_0x49cc('0x8')](':')[0x0]:'';this[_0x49cc('0x9')]='';this[_0x49cc('0xa')]='';this['domain']='';this[_0x49cc('0xb')]='';this['refresh']='';this[_0x49cc('0xc')]='unknown';this[_0x49cc('0xd')]='';this[_0x49cc('0xe')]='';}module[_0x49cc('0xf')]=Trunk; \ No newline at end of file +var _0x9198=['refresh','stateRegistry','address','active','name','stateTime','status','registry','indexOf','split','host','domain','domainport'];(function(_0x553780,_0xbe5e09){var _0xe454f8=function(_0x5b7045){while(--_0x5b7045){_0x553780['push'](_0x553780['shift']());}};_0xe454f8(++_0xbe5e09);}(_0x9198,0xb9));var _0x8919=function(_0x48952a,_0x3671d5){_0x48952a=_0x48952a-0x0;var _0x2615ab=_0x9198[_0x48952a];return _0x2615ab;};'use strict';function Trunk(_0x1228c8){this['id']=_0x1228c8['id']||0x0;this[_0x8919('0x0')]=_0x1228c8['active']||![];this['name']=_0x1228c8[_0x8919('0x1')]||'';this['state']='unknown';this[_0x8919('0x2')]=0x0;this[_0x8919('0x3')]='unknown';this[_0x8919('0x4')]=_0x1228c8[_0x8919('0x4')]&&_0x1228c8[_0x8919('0x4')][_0x8919('0x5')](':')?_0x1228c8['registry'][_0x8919('0x6')](':')[0x0]:'';this[_0x8919('0x7')]='';this['port']='';this[_0x8919('0x8')]='';this[_0x8919('0x9')]='';this[_0x8919('0xa')]='';this[_0x8919('0xb')]='unknown';this['registrationtime']='';this[_0x8919('0xc')]='';}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 dd08ab3..0db9873 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 _0x0c31=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x5f0531,_0xec8b75){var _0x560bec=function(_0x159cb0){while(--_0x159cb0){_0x5f0531['push'](_0x5f0531['shift']());}};_0x560bec(++_0xec8b75);}(_0x0c31,0x155));var _0x10c3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0c31[_0x4a9fb1];return _0x348672;};'use strict';function voiceExtension(_0x58f56b){this['id']=_0x58f56b['id']||0x0;this[_0x10c3('0x0')]=_0x58f56b[_0x10c3('0x0')]||'';this[_0x10c3('0x1')]=_0x58f56b['recordingFormat']||_0x10c3('0x2');this[_0x10c3('0x3')]=_0x58f56b['mandatoryDisposition']||![];}module[_0x10c3('0x4')]=voiceExtension; \ No newline at end of file +var _0xfb4a=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfb4a,0x70));var _0xafb4=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xfb4a[_0x184759];return _0xf26d5f;};'use strict';function voiceExtension(_0x242226){this['id']=_0x242226['id']||0x0;this[_0xafb4('0x0')]=_0x242226[_0xafb4('0x0')]||'';this[_0xafb4('0x1')]=_0x242226[_0xafb4('0x1')]||_0xafb4('0x2');this[_0xafb4('0x3')]=_0x242226[_0xafb4('0x3')]||![];}module[_0xafb4('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index e8a44e4..6d52f18 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 _0xae4c=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xae4c,0x9a));var _0xcae4=function(_0x15eb63,_0xd3f629){_0x15eb63=_0x15eb63-0x0;var _0x19fc81=_0xae4c[_0x15eb63];return _0x19fc81;};'use strict';var statusDesc=['unknown',_0xcae4('0x0'),_0xcae4('0x1'),_0xcae4('0x2'),_0xcae4('0x3'),_0xcae4('0x4'),_0xcae4('0x5'),_0xcae4('0x6'),_0xcae4('0x7')];var monitorFormat={'wav':_0xcae4('0x8'),'wav49':'wav49','gsm':_0xcae4('0x9')};var strategy={'rrmemory':_0xcae4('0xa'),'roundrobin':'roundrobin'};function VoiceQueue(_0x25833b){this['id']=_0x25833b['id']||0x0;this[_0xcae4('0xb')]=_0x25833b[_0xcae4('0xb')]||'';this[_0xcae4('0xc')]=_0x25833b['monitor_format']||'';this[_0xcae4('0xd')]=_0x25833b[_0xcae4('0xd')]||_0xcae4('0xe');this[_0xcae4('0xf')]=0x0;this['talking']=0x0;this[_0xcae4('0x10')]=0x0;this[_0xcae4('0x11')]=0x0;this[_0xcae4('0x12')]=0x0;this[_0xcae4('0x13')]=0x0;this[_0xcae4('0x14')]=0x0;this[_0xcae4('0x15')]=0x0;this['abandoned']=0x0;this[_0xcae4('0x16')]=0x0;this['available']=0x0;this[_0xcae4('0x17')]=_0x25833b[_0xcae4('0x17')]||![];this[_0xcae4('0x18')]=_0x25833b['acwTimeout']||0xa;this[_0xcae4('0x19')]=_0x25833b[_0xcae4('0x19')]||'no';this[_0xcae4('0x1a')]=!![];this['message']='';this[_0xcae4('0x1b')]=0x0;this['temp']=0x0;this[_0xcae4('0x1c')]=_0x25833b[_0xcae4('0x1c')]||null;this[_0xcae4('0x1d')]=_0x25833b['dialGlobalInterval']?_0x25833b[_0xcae4('0x1d')]:null;this[_0xcae4('0x1e')]=_0x25833b[_0xcae4('0x1e')];this[_0xcae4('0x1f')]=_0x25833b[_0xcae4('0x1f')]||_0xcae4('0x20');this[_0xcae4('0x21')]=_0x25833b['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x25833b[_0xcae4('0x22')]||0x0;this['dialPowerLevel']=_0x25833b[_0xcae4('0x23')]||0x1;this[_0xcae4('0x24')]=_0x25833b['dialPredictiveOptimization']||'dropRate';this[_0xcae4('0x25')]=_0x25833b['dialPredictiveOptimizationPercentage']||0.03;this[_0xcae4('0x26')]=_0x25833b['dialPredictiveInterval']||0x258;this[_0xcae4('0x27')]=_0x25833b[_0xcae4('0x27')]||_0xcae4('0x28');this[_0xcae4('0x29')]=_0x25833b[_0xcae4('0x29')]||_0xcae4('0x28');this[_0xcae4('0x2a')]=_0x25833b['dialOriginateTimeout']||0x1e;this[_0xcae4('0x2b')]=_0x25833b[_0xcae4('0x2b')]||_0xcae4('0x2c');this[_0xcae4('0x2d')]=_0x25833b['dialQueueTimeout']||0x3;this[_0xcae4('0x2e')]=_0x25833b[_0xcae4('0x2e')]||undefined;this[_0xcae4('0x2f')]=_0x25833b['dialCongestionMaxRetry']||0x3;this[_0xcae4('0x30')]=_0x25833b[_0xcae4('0x30')]||0x96;this['dialBusyMaxRetry']=_0x25833b[_0xcae4('0x31')]||0x3;this['dialBusyRetryFrequency']=_0x25833b[_0xcae4('0x32')]||0x96;this['dialNoAnswerMaxRetry']=_0x25833b[_0xcae4('0x33')]||0x3;this[_0xcae4('0x34')]=_0x25833b['dialNoAnswerRetryFrequency']||0x96;this['dialGlobalMaxRetry']=_0x25833b[_0xcae4('0x35')]||0x4;this[_0xcae4('0x36')]=_0x25833b[_0xcae4('0x36')]?_0x25833b[_0xcae4('0x36')]:undefined;this[_0xcae4('0x37')]=_0x25833b[_0xcae4('0x37')]?_0x25833b[_0xcae4('0x37')]:undefined;this[_0xcae4('0x38')]=_0x25833b[_0xcae4('0x38')]||undefined;this[_0xcae4('0x39')]=_0x25833b[_0xcae4('0x39')]?_0x25833b[_0xcae4('0x39')]:undefined;this[_0xcae4('0x3a')]=_0x25833b[_0xcae4('0x3a')]||_0xcae4('0x3b');this[_0xcae4('0x3c')]=_0x25833b['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xcae4('0x3d')]=_0x25833b['dialCutDigit']||undefined;this[_0xcae4('0x3e')]=strategy[_0x25833b[_0xcae4('0x3e')]]||'rrmemory';this[_0xcae4('0x3f')]=!![];this[_0xcae4('0x40')]=_0x25833b[_0xcae4('0x40')]||![];this[_0xcae4('0x41')]=_0x25833b[_0xcae4('0x41')];this[_0xcae4('0x42')]=_0x25833b[_0xcae4('0x42')];this[_0xcae4('0x43')]=_0x25833b[_0xcae4('0x43')];this['dialAMDTotalAnalysisTime']=_0x25833b[_0xcae4('0x44')];this[_0xcae4('0x45')]=_0x25833b[_0xcae4('0x45')];this[_0xcae4('0x46')]=_0x25833b[_0xcae4('0x46')];this[_0xcae4('0x47')]=_0x25833b[_0xcae4('0x47')];this[_0xcae4('0x48')]=_0x25833b[_0xcae4('0x48')];this[_0xcae4('0x49')]=_0x25833b['dialAMDMaximumWordLength'];this[_0xcae4('0x4a')]=0x0;this[_0xcae4('0x4b')]=0x0;this['timeout']=_0x25833b[_0xcae4('0x4c')];this[_0xcae4('0x4d')]=0x0;this[_0xcae4('0x4e')]=0x0;this[_0xcae4('0x4f')]=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xcae4('0x50')]=0x0;this[_0xcae4('0x51')]=0x0;this[_0xcae4('0x52')]=0x0;this[_0xcae4('0x53')]=0x0;this[_0xcae4('0x54')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xcae4('0x55')]=0x0;this[_0xcae4('0x56')]=0x0;this['startProgressive']=undefined;this[_0xcae4('0x57')]=undefined;this[_0xcae4('0x58')]=undefined;this[_0xcae4('0x59')]=1.05;this[_0xcae4('0x5a')]=0x0;this[_0xcae4('0x5b')]=0x0;this[_0xcae4('0x5c')]=0x0;this[_0xcae4('0x5d')]=0x0;this[_0xcae4('0x5e')]=0x0;this[_0xcae4('0x5f')]=0x0;this[_0xcae4('0x60')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x25833b[_0xcae4('0x61')]||0x14;this[_0xcae4('0x62')]=_0x25833b[_0xcae4('0x61')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xcae4('0x63')]=0x0;this[_0xcae4('0x64')]=0x1;this[_0xcae4('0x65')]=0x0;this[_0xcae4('0x66')]=0x0;this[_0xcae4('0x67')]=0x0;this[_0xcae4('0x68')]=0x0;this['dialRecallMeTimeout']=_0x25833b['dialRecallMeTimeout']||0x1e;this[_0xcae4('0x69')]=_0x25833b['dialRecallInQueue']||![];this['dialQueueProject2']=_0x25833b[_0xcae4('0x6a')]||undefined;this[_0xcae4('0x6b')]=_0x25833b[_0xcae4('0x6b')]||![];this[_0xcae4('0x6c')]=_0x25833b[_0xcae4('0x6c')]||![];this[_0xcae4('0xc')]=monitorFormat[_0x25833b[_0xcae4('0xc')]]?monitorFormat[_0x25833b[_0xcae4('0xc')]]:undefined;this[_0xcae4('0x6d')]=_0x25833b['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x25833b[_0xcae4('0x6e')]?_0x25833b[_0xcae4('0x6e')]:undefined;}module[_0xcae4('0x6f')]=VoiceQueue; \ No newline at end of file +var _0x9c86=['queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory'];(function(_0x5923be,_0x3023ae){var _0x303700=function(_0x13d05c){while(--_0x13d05c){_0x5923be['push'](_0x5923be['shift']());}};_0x303700(++_0x3023ae);}(_0x9c86,0x10d));var _0x69c8=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9c86[_0x618414];return _0x21c19a;};'use strict';var statusDesc=[_0x69c8('0x0'),'not_inuse','inuse',_0x69c8('0x1'),'invalid',_0x69c8('0x2'),_0x69c8('0x3'),_0x69c8('0x4'),_0x69c8('0x5')];var monitorFormat={'wav':_0x69c8('0x6'),'wav49':_0x69c8('0x7'),'gsm':_0x69c8('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x69c8('0x9')};function VoiceQueue(_0x1b2df3){this['id']=_0x1b2df3['id']||0x0;this['name']=_0x1b2df3[_0x69c8('0xa')]||'';this[_0x69c8('0xb')]=_0x1b2df3[_0x69c8('0xb')]||'';this['type']=_0x1b2df3[_0x69c8('0xc')]||_0x69c8('0xd');this[_0x69c8('0xe')]=0x0;this[_0x69c8('0xf')]=0x0;this[_0x69c8('0x10')]=0x0;this['answered']=0x0;this[_0x69c8('0x11')]=0x0;this[_0x69c8('0x12')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x69c8('0x13')]=0x0;this[_0x69c8('0x14')]=0x0;this['available']=0x0;this[_0x69c8('0x15')]=_0x1b2df3[_0x69c8('0x15')]||![];this[_0x69c8('0x16')]=_0x1b2df3[_0x69c8('0x16')]||0xa;this[_0x69c8('0x17')]=_0x1b2df3[_0x69c8('0x17')]||'no';this[_0x69c8('0x18')]=!![];this[_0x69c8('0x19')]='';this['originated']=0x0;this['temp']=0x0;this[_0x69c8('0x1a')]=_0x1b2df3[_0x69c8('0x1a')]||null;this['dialGlobalInterval']=_0x1b2df3[_0x69c8('0x1b')]?_0x1b2df3[_0x69c8('0x1b')]:null;this[_0x69c8('0x1c')]=_0x1b2df3['dialActive'];this[_0x69c8('0x1d')]=_0x1b2df3['dialMethod']||_0x69c8('0x1e');this[_0x69c8('0x1f')]=_0x1b2df3[_0x69c8('0x1f')]||0x0;this[_0x69c8('0x20')]=_0x1b2df3[_0x69c8('0x20')]||0x0;this[_0x69c8('0x21')]=_0x1b2df3[_0x69c8('0x21')]||0x1;this[_0x69c8('0x22')]=_0x1b2df3[_0x69c8('0x22')]||_0x69c8('0x23');this[_0x69c8('0x24')]=_0x1b2df3['dialPredictiveOptimizationPercentage']||0.03;this[_0x69c8('0x25')]=_0x1b2df3[_0x69c8('0x25')]||0x258;this[_0x69c8('0x26')]=_0x1b2df3[_0x69c8('0x26')]||_0x69c8('0x27');this[_0x69c8('0x28')]=_0x1b2df3[_0x69c8('0x28')]||_0x69c8('0x27');this[_0x69c8('0x29')]=_0x1b2df3[_0x69c8('0x29')]||0x1e;this[_0x69c8('0x2a')]=_0x1b2df3[_0x69c8('0x2a')]||'tTxX';this[_0x69c8('0x2b')]=_0x1b2df3['dialQueueTimeout']||0x3;this[_0x69c8('0x2c')]=_0x1b2df3[_0x69c8('0x2c')]||undefined;this[_0x69c8('0x2d')]=_0x1b2df3['dialCongestionMaxRetry']||0x3;this[_0x69c8('0x2e')]=_0x1b2df3[_0x69c8('0x2e')]||0x96;this[_0x69c8('0x2f')]=_0x1b2df3[_0x69c8('0x2f')]||0x3;this[_0x69c8('0x30')]=_0x1b2df3[_0x69c8('0x30')]||0x96;this[_0x69c8('0x31')]=_0x1b2df3[_0x69c8('0x31')]||0x3;this[_0x69c8('0x32')]=_0x1b2df3['dialNoAnswerRetryFrequency']||0x96;this[_0x69c8('0x33')]=_0x1b2df3[_0x69c8('0x33')]||0x4;this[_0x69c8('0x34')]=_0x1b2df3[_0x69c8('0x34')]?_0x1b2df3[_0x69c8('0x34')]:undefined;this['TrunkBackup']=_0x1b2df3[_0x69c8('0x35')]?_0x1b2df3[_0x69c8('0x35')]:undefined;this['dialPrefix']=_0x1b2df3['dialPrefix']||undefined;this[_0x69c8('0x36')]=_0x1b2df3[_0x69c8('0x36')]?_0x1b2df3[_0x69c8('0x36')]:undefined;this[_0x69c8('0x37')]=_0x1b2df3[_0x69c8('0x37')]||_0x69c8('0x38');this[_0x69c8('0x39')]=_0x1b2df3[_0x69c8('0x39')]||undefined;this['dialCutDigit']=_0x1b2df3[_0x69c8('0x3a')]||undefined;this[_0x69c8('0x3b')]=strategy[_0x1b2df3[_0x69c8('0x3b')]]||_0x69c8('0x3c');this[_0x69c8('0x3d')]=!![];this[_0x69c8('0x3e')]=_0x1b2df3['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x1b2df3[_0x69c8('0x3f')];this['dialAMDGreeting']=_0x1b2df3[_0x69c8('0x40')];this[_0x69c8('0x41')]=_0x1b2df3[_0x69c8('0x41')];this[_0x69c8('0x42')]=_0x1b2df3[_0x69c8('0x42')];this[_0x69c8('0x43')]=_0x1b2df3[_0x69c8('0x43')];this[_0x69c8('0x44')]=_0x1b2df3['dialAMDBetweenWordsSilence'];this[_0x69c8('0x45')]=_0x1b2df3[_0x69c8('0x45')];this[_0x69c8('0x46')]=_0x1b2df3[_0x69c8('0x46')];this['dialAMDMaximumWordLength']=_0x1b2df3[_0x69c8('0x47')];this[_0x69c8('0x48')]=0x0;this[_0x69c8('0x49')]=0x0;this[_0x69c8('0x4a')]=_0x1b2df3['timeout'];this[_0x69c8('0x4b')]=0x0;this[_0x69c8('0x4c')]=0x0;this[_0x69c8('0x4d')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x69c8('0x4e')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x69c8('0x4f')]=0x0;this[_0x69c8('0x50')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x69c8('0x51')]=0x0;this[_0x69c8('0x52')]=0x0;this[_0x69c8('0x53')]=0x0;this[_0x69c8('0x54')]=0x0;this[_0x69c8('0x55')]=undefined;this[_0x69c8('0x56')]=undefined;this[_0x69c8('0x57')]=undefined;this[_0x69c8('0x58')]=1.05;this[_0x69c8('0x59')]=0x0;this[_0x69c8('0x5a')]=0x0;this[_0x69c8('0x5b')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x69c8('0x5c')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x69c8('0x5d')]=0x0;this[_0x69c8('0x5e')]=_0x1b2df3[_0x69c8('0x5f')]||0x14;this['predictiveIntervalMinThreshold']=_0x1b2df3[_0x69c8('0x5f')]||0xa;this[_0x69c8('0x60')]=0x0;this[_0x69c8('0x61')]=0x0;this[_0x69c8('0x62')]=0x1;this[_0x69c8('0x63')]=0x0;this[_0x69c8('0x64')]=0x0;this[_0x69c8('0x65')]=0x0;this[_0x69c8('0x66')]=0x0;this[_0x69c8('0x67')]=_0x1b2df3[_0x69c8('0x67')]||0x1e;this['dialRecallInQueue']=_0x1b2df3[_0x69c8('0x68')]||![];this['dialQueueProject2']=_0x1b2df3[_0x69c8('0x69')]||undefined;this['dialAgiAfterHangupClient']=_0x1b2df3[_0x69c8('0x6a')]||![];this[_0x69c8('0x6b')]=_0x1b2df3[_0x69c8('0x6b')]||![];this[_0x69c8('0xb')]=monitorFormat[_0x1b2df3['monitor_format']]?monitorFormat[_0x1b2df3[_0x69c8('0xb')]]:undefined;this[_0x69c8('0x6c')]=_0x1b2df3[_0x69c8('0x6c')]||![];this[_0x69c8('0x6d')]=_0x1b2df3[_0x69c8('0x6d')]?_0x1b2df3['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 88be753..75f6ebe 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 _0xcb8a=['serverUrl','Configurations','exports','username','accessKey','remoteUri'];(function(_0x47bc58,_0x1e1998){var _0x4a0860=function(_0x2a5b23){while(--_0x2a5b23){_0x47bc58['push'](_0x47bc58['shift']());}};_0x4a0860(++_0x1e1998);}(_0xcb8a,0xe1));var _0xacb8=function(_0x1bd71e,_0x31dc16){_0x1bd71e=_0x1bd71e-0x0;var _0x473436=_0xcb8a[_0x1bd71e];return _0x473436;};'use strict';function VtigerAccount(_0x1be9ac){this['id']=_0x1be9ac['id']||0x0;this['name']=_0x1be9ac['name']||'';this[_0xacb8('0x0')]=_0x1be9ac['username']||'';this[_0xacb8('0x1')]=_0x1be9ac['accessKey']||'';this[_0xacb8('0x2')]=_0x1be9ac[_0xacb8('0x2')]||'';this['serverUrl']=_0x1be9ac[_0xacb8('0x3')]||'';this[_0xacb8('0x4')]=_0x1be9ac[_0xacb8('0x4')]||{};}module[_0xacb8('0x5')]=VtigerAccount; \ No newline at end of file +var _0x0052=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x2c45b2,_0x51ad13){var _0x4cfeec=function(_0x6e6c0f){while(--_0x6e6c0f){_0x2c45b2['push'](_0x2c45b2['shift']());}};_0x4cfeec(++_0x51ad13);}(_0x0052,0xa7));var _0x2005=function(_0xedf3c6,_0x1f09cd){_0xedf3c6=_0xedf3c6-0x0;var _0x29bb5f=_0x0052[_0xedf3c6];return _0x29bb5f;};'use strict';function VtigerAccount(_0x4daf7b){this['id']=_0x4daf7b['id']||0x0;this[_0x2005('0x0')]=_0x4daf7b[_0x2005('0x0')]||'';this[_0x2005('0x1')]=_0x4daf7b[_0x2005('0x1')]||'';this[_0x2005('0x2')]=_0x4daf7b[_0x2005('0x2')]||'';this['remoteUri']=_0x4daf7b[_0x2005('0x3')]||'';this[_0x2005('0x4')]=_0x4daf7b['serverUrl']||'';this[_0x2005('0x5')]=_0x4daf7b[_0x2005('0x5')]||{};}module[_0x2005('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 0eb00f1..76a8bf6 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 _0x7027=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x7027,0x99));var _0x7702=function(_0x6335e5,_0x1f2c73){_0x6335e5=_0x6335e5-0x0;var _0x51d2d7=_0x7027[_0x6335e5];return _0x51d2d7;};'use strict';function ZendeskAccount(_0x5e232b){this['id']=_0x5e232b['id']||0x0;this[_0x7702('0x0')]=_0x5e232b[_0x7702('0x0')]||'';this['username']=_0x5e232b[_0x7702('0x1')]||'';this['password']=_0x5e232b[_0x7702('0x2')]||'';this[_0x7702('0x3')]=_0x5e232b[_0x7702('0x3')]||'';this[_0x7702('0x4')]=_0x5e232b[_0x7702('0x4')]||'';this[_0x7702('0x5')]=_0x5e232b[_0x7702('0x5')]||'';this[_0x7702('0x6')]=_0x5e232b[_0x7702('0x6')]||_0x7702('0x7');this[_0x7702('0x8')]=_0x5e232b[_0x7702('0x8')]||'';this[_0x7702('0x9')]=_0x5e232b[_0x7702('0x9')]||{};}module[_0x7702('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x33ed=['token','remoteUri','authType','type','serverUrl','Configurations','exports','name','username','password'];(function(_0x65c597,_0x39e7e0){var _0x1ec368=function(_0x42efb8){while(--_0x42efb8){_0x65c597['push'](_0x65c597['shift']());}};_0x1ec368(++_0x39e7e0);}(_0x33ed,0xa7));var _0xd33e=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0x33ed[_0x1e500e];return _0x10dc5e;};'use strict';function ZendeskAccount(_0x3a5d5d){this['id']=_0x3a5d5d['id']||0x0;this[_0xd33e('0x0')]=_0x3a5d5d[_0xd33e('0x0')]||'';this[_0xd33e('0x1')]=_0x3a5d5d[_0xd33e('0x1')]||'';this[_0xd33e('0x2')]=_0x3a5d5d[_0xd33e('0x2')]||'';this['token']=_0x3a5d5d[_0xd33e('0x3')]||'';this[_0xd33e('0x4')]=_0x3a5d5d[_0xd33e('0x4')]||'';this[_0xd33e('0x5')]=_0x3a5d5d[_0xd33e('0x5')]||'';this[_0xd33e('0x6')]=_0x3a5d5d[_0xd33e('0x6')]||'integrationTab';this[_0xd33e('0x7')]=_0x3a5d5d[_0xd33e('0x7')]||'';this[_0xd33e('0x8')]=_0x3a5d5d[_0xd33e('0x8')]||{};}module[_0xd33e('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index a179caa..a7b3cd1 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 _0x9536=['authToken','host','Configurations','serverUrl','exports','name'];(function(_0x3d1a66,_0x3a24eb){var _0x6cb2ac=function(_0xb3d0cf){while(--_0xb3d0cf){_0x3d1a66['push'](_0x3d1a66['shift']());}};_0x6cb2ac(++_0x3a24eb);}(_0x9536,0x179));var _0x6953=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0x9536[_0x3ff685];return _0x2046c9;};'use strict';function ZohoAccount(_0x57c4b8){this['id']=_0x57c4b8['id']||0x0;this[_0x6953('0x0')]=_0x57c4b8[_0x6953('0x0')]||'';this[_0x6953('0x1')]=_0x57c4b8['authToken']||'';this[_0x6953('0x2')]=_0x57c4b8['host']||'';this[_0x6953('0x3')]=_0x57c4b8[_0x6953('0x3')]||{};this[_0x6953('0x4')]=_0x57c4b8[_0x6953('0x4')]||'';}module[_0x6953('0x5')]=ZohoAccount; \ No newline at end of file +var _0x1967=['serverUrl','name','authToken','host','Configurations'];(function(_0x5b5dd4,_0x225cca){var _0x5b0b1b=function(_0x77bbcb){while(--_0x77bbcb){_0x5b5dd4['push'](_0x5b5dd4['shift']());}};_0x5b0b1b(++_0x225cca);}(_0x1967,0x173));var _0x7196=function(_0x5a270c,_0x20713b){_0x5a270c=_0x5a270c-0x0;var _0x3c5ada=_0x1967[_0x5a270c];return _0x3c5ada;};'use strict';function ZohoAccount(_0x193fee){this['id']=_0x193fee['id']||0x0;this[_0x7196('0x0')]=_0x193fee[_0x7196('0x0')]||'';this[_0x7196('0x1')]=_0x193fee[_0x7196('0x1')]||'';this[_0x7196('0x2')]=_0x193fee[_0x7196('0x2')]||'';this[_0x7196('0x3')]=_0x193fee[_0x7196('0x3')]||{};this[_0x7196('0x4')]=_0x193fee[_0x7196('0x4')]||'';}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 3d42e6a..69cdac4 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 _0x60d9=['originatecalleridname','getCaller','format','\x22%s\x22\x20<%s>','calleridname','number','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','Contact','phone','firstName','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x60d9,0xa6));var _0x960d=function(_0x5b5659,_0x232015){_0x5b5659=_0x5b5659-0x0;var _0x5727e9=_0x60d9[_0x5b5659];return _0x5727e9;};'use strict';var util=require(_0x960d('0x0'));var _=require(_0x960d('0x1'));var moment=require(_0x960d('0x2'));function checkNameSurname(_0x49002a,_0x4b12c5,_0xda192){var _0x4746e5='';if(!_[_0x960d('0x3')](_0x4b12c5)&&'string'===typeof _0x4b12c5){_0x4746e5+=_0x4b12c5;}if(!_[_0x960d('0x3')](_0xda192)&&_0x960d('0x4')===typeof _0xda192){_0x4746e5+='\x20'+_0xda192;}if(_0x4746e5!==''){return _0x4746e5;}return _0x49002a;}function Action(_0x144871,_0xda3bad,_0x5b1b8d,_0x5f6729,_0x27916c){this[_0x960d('0x5')]=_0x5b1b8d||undefined;this[_0x960d('0x6')]=_0x144871['id'];this[_0x960d('0x7')]=_0xda3bad[_0x960d('0x8')];this[_0x960d('0x9')]=_0xda3bad[_0x960d('0x9')];this[_0x960d('0xa')]=_0x960d('0x7');this[_0x960d('0xb')]=![];this[_0x960d('0xc')]=_[_0x960d('0x3')](_0x144871[_0x960d('0xd')])?undefined:_0x144871[_0x960d('0xd')][_0x960d('0x8')];this[_0x960d('0xe')]=this[_0x960d('0xc')]?util['format'](_0x960d('0xf'),this[_0x960d('0xc')]):_0x5f6729||undefined;this['calleridname']=checkNameSurname(_0x144871[_0x960d('0x10')][_0x960d('0x11')],_0x144871[_0x960d('0x10')][_0x960d('0x12')],_0x144871[_0x960d('0x10')][_0x960d('0x13')]);this[_0x960d('0x14')]=_0x144871[_0x960d('0x14')]||![];this[_0x960d('0x15')]=_0x144871[_0x960d('0x10')][_0x960d('0x11')];this['scheduledat']=_0x144871['scheduledat'];this[_0x960d('0x16')]=_0x144871[_0x960d('0x16')]||0x0;this[_0x960d('0x17')]=_0x144871[_0x960d('0x17')]||0x0;this[_0x960d('0x18')]=_0x144871[_0x960d('0x18')]||0x0;this[_0x960d('0x19')]=(_0x144871[_0x960d('0x16')]||0x0)+(_0x144871[_0x960d('0x17')]||0x0)+(_0x144871[_0x960d('0x18')]||0x0);this[_0x960d('0x1a')]=_0x144871[_0x960d('0x1a')];this[_0x960d('0x1b')]=_0x144871[_0x960d('0x1b')];this['callbackat']=_0x144871['callbackat'];this[_0x960d('0x1c')]=_0x144871[_0x960d('0x1c')];this['ContactId']=_0x144871[_0x960d('0x1d')];this[_0x960d('0x1e')]=_0x144871['ListId'];this[_0x960d('0x1f')]=_['isNil'](_0x144871[_0x960d('0xd')])?_0x144871[_0x960d('0x1f')]:_0x144871[_0x960d('0xd')]['id'];this[_0x960d('0x20')]=_0x144871[_0x960d('0x20')];this[_0x960d('0x21')]='';this[_0x960d('0x22')]='';}Action['prototype'][_0x960d('0x23')]=function(){return util[_0x960d('0x24')](_0x960d('0x25'),this[_0x960d('0x26')],this[_0x960d('0x27')]);};module['exports']=Action; \ No newline at end of file +var _0x0de2=['dialAnswer','membername','Agent','name','channelAgent','SIP/%s','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','isNil','type'];(function(_0x2b6235,_0xadfbcf){var _0x4cee7f=function(_0x358fff){while(--_0x358fff){_0x2b6235['push'](_0x2b6235['shift']());}};_0x4cee7f(++_0xadfbcf);}(_0x0de2,0x171));var _0x20de=function(_0x264f48,_0x2c82d8){_0x264f48=_0x264f48-0x0;var _0xb99167=_0x0de2[_0x264f48];return _0xb99167;};'use strict';var util=require(_0x20de('0x0'));var _=require(_0x20de('0x1'));var moment=require('moment');function checkNameSurname(_0x25d3f4,_0x4b5d02,_0x423c2b){var _0x4f5062='';if(!_['isNil'](_0x4b5d02)&&_0x20de('0x2')===typeof _0x4b5d02){_0x4f5062+=_0x4b5d02;}if(!_[_0x20de('0x3')](_0x423c2b)&&_0x20de('0x2')===typeof _0x423c2b){_0x4f5062+='\x20'+_0x423c2b;}if(_0x4f5062!==''){return _0x4f5062;}return _0x25d3f4;}function Action(_0x20487d,_0x389a24,_0x44b4b8,_0x5322ac,_0x31a594){this['uniqueid']=_0x44b4b8||undefined;this['idContact']=_0x20487d['id'];this['queue']=_0x389a24['name'];this[_0x20de('0x4')]=_0x389a24[_0x20de('0x4')];this['campaigntype']='queue';this[_0x20de('0x5')]=![];this[_0x20de('0x6')]=_['isNil'](_0x20487d[_0x20de('0x7')])?undefined:_0x20487d[_0x20de('0x7')][_0x20de('0x8')];this[_0x20de('0x9')]=this[_0x20de('0x6')]?util['format'](_0x20de('0xa'),this[_0x20de('0x6')]):_0x5322ac||undefined;this['calleridname']=checkNameSurname(_0x20487d['Contact']['phone'],_0x20487d['Contact'][_0x20de('0xb')],_0x20487d[_0x20de('0xc')][_0x20de('0xd')]);this[_0x20de('0xe')]=_0x20487d[_0x20de('0xe')]||![];this[_0x20de('0xf')]=_0x20487d[_0x20de('0xc')]['phone'];this[_0x20de('0x10')]=_0x20487d[_0x20de('0x10')];this[_0x20de('0x11')]=_0x20487d[_0x20de('0x11')]||0x0;this[_0x20de('0x12')]=_0x20487d[_0x20de('0x12')]||0x0;this['countnoanswerretry']=_0x20487d[_0x20de('0x13')]||0x0;this[_0x20de('0x14')]=(_0x20487d['countbusyretry']||0x0)+(_0x20487d[_0x20de('0x12')]||0x0)+(_0x20487d[_0x20de('0x13')]||0x0);this[_0x20de('0x15')]=_0x20487d[_0x20de('0x15')];this['callbackuniqueid']=_0x20487d[_0x20de('0x16')];this[_0x20de('0x17')]=_0x20487d[_0x20de('0x17')];this[_0x20de('0x18')]=_0x20487d['recallme'];this[_0x20de('0x19')]=_0x20487d[_0x20de('0x19')];this['ListId']=_0x20487d[_0x20de('0x1a')];this[_0x20de('0x1b')]=_[_0x20de('0x3')](_0x20487d['Agent'])?_0x20487d[_0x20de('0x1b')]:_0x20487d['Agent']['id'];this[_0x20de('0x1c')]=_0x20487d[_0x20de('0x1c')];this['originatecalleridnum']='';this[_0x20de('0x1d')]='';}Action['prototype'][_0x20de('0x1e')]=function(){return util['format'](_0x20de('0x1f'),this['calleridname'],this[_0x20de('0x20')]);};module[_0x20de('0x21')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 7427154..7e76f81 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 _0xfbff=['object','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','catch','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','trunks','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','validateContact','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','variables','keys','variable','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','defaults','redis','localhost','tail','finally','campaignsPreview','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','\x20is\x20disactive','prototype','loopCampaigns','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','sequence','enqueue','isNil','info','[clearZombieChannels][talking]','actions','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','Action','status','channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','emit','custom:agentcomplete','outboundAnswerCallsDay','[16]','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','[callProgressDetectingCustomer][logBusy]','cloneAction','dialBusyMaxRetry','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','countnoanswerretry','NoAnswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','rescheduleContact','dialNoAnswerRetryFrequency','activeContact','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','[syncHangupRequest][logAgentReject]','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined'];(function(_0x3bef7b,_0x382fa8){var _0x1743a9=function(_0xcc2e80){while(--_0xcc2e80){_0x3bef7b['push'](_0x3bef7b['shift']());}};_0x1743a9(++_0x382fa8);}(_0xfbff,0x18e));var _0xffbf=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xfbff[_0x1caf6a];return _0x1bf493;};'use strict';var util=require(_0xffbf('0x0'));var _=require(_0xffbf('0x1'));var BPromise=require(_0xffbf('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0xffbf('0x3'));var Redis=require(_0xffbf('0x4'));var config=require(_0xffbf('0x5'));var logger=require(_0xffbf('0x6'))(_0xffbf('0x7'));var loggerAction=require('../../../config/logger')(_0xffbf('0x8'));var ami=require('../ami');var rpcDb=require(_0xffbf('0x9'));var Action=require(_0xffbf('0xa'));var ut=require(_0xffbf('0xb'));config['redis']=_[_0xffbf('0xc')](config[_0xffbf('0xd')],{'host':_0xffbf('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xffbf('0xd')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x28b43a){this['tail']=this[_0xffbf('0xf')]?this[_0xffbf('0xf')][_0xffbf('0x10')](_0x28b43a):_0x28b43a();};function Preview(_0x56eb20){this['sequence']=new Sequence();this[_0xffbf('0x11')]=_0x56eb20['voiceQueues'];this['trunks']=_0x56eb20['trunks'];this['actions']={};this[_0xffbf('0x12')]=_0x56eb20[_0xffbf('0x12')];this[_0xffbf('0x13')]=0x0;ami['on'](_0xffbf('0x14'),this[_0xffbf('0x15')][_0xffbf('0x16')](this));ami['on']('hangup',this['syncHangup'][_0xffbf('0x16')](this));ami['on'](_0xffbf('0x17'),this[_0xffbf('0x18')][_0xffbf('0x16')](this));ami['on']('dialend',this[_0xffbf('0x19')][_0xffbf('0x16')](this));ami['on']('newexten',this[_0xffbf('0x1a')][_0xffbf('0x16')](this));ami['on'](_0xffbf('0x1b'),this[_0xffbf('0x1c')][_0xffbf('0x16')](this));ami['on'](_0xffbf('0x1d'),this[_0xffbf('0x1e')][_0xffbf('0x16')](this));ami['on'](_0xffbf('0x1f'),this[_0xffbf('0x20')]['bind'](this));this['loopCampaigns'](this[_0xffbf('0x11')]);}function emit(_0x314252,_0x439744,_0x4fa355){io['to'](_0x314252)['emit'](_0x439744,_0x4fa355);}function emitCampaignPreview(_0x13f16b){if(_0x13f16b[_0xffbf('0x21')]===_0xffbf('0x22')){var _0x43978d={'id':_0x13f16b['id'],'name':_0x13f16b[_0xffbf('0x23')],'strategy':_0x13f16b[_0xffbf('0x24')],'answered':_0x13f16b[_0xffbf('0x25')],'available':_0x13f16b[_0xffbf('0x26')],'loggedIn':_0x13f16b[_0xffbf('0x27')],'pTalking':_0x13f16b[_0xffbf('0x28')],'sumBillable':_0x13f16b[_0xffbf('0x29')],'sumDuration':_0x13f16b['sumDuration'],'sumHoldTime':_0x13f16b['sumHoldTime']||0x0,'talking':_0x13f16b[_0xffbf('0x2a')],'total':_0x13f16b[_0xffbf('0x2b')],'type':_0x13f16b[_0xffbf('0x21')],'unmanaged':_0x13f16b[_0xffbf('0x2c')],'abandoned':_0x13f16b[_0xffbf('0x2d')],'waiting':_0x13f16b[_0xffbf('0x2e')],'loggedInDb':_0x13f16b[_0xffbf('0x2f')],'dialActive':_0x13f16b[_0xffbf('0x30')],'dialMethod':_0x13f16b[_0xffbf('0x31')],'dialOriginateCallerIdName':_0x13f16b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x13f16b[_0xffbf('0x32')],'dialOriginateTimeout':_0x13f16b['dialOriginateTimeout'],'dialPrefix':_0x13f16b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x13f16b[_0xffbf('0x33')],'outboundAnswerCallsDay':_0x13f16b['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x13f16b[_0xffbf('0x34')],'outboundBusyCallsDay':_0x13f16b[_0xffbf('0x35')],'outboundCongestionCallsDay':_0x13f16b['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x13f16b['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x13f16b[_0xffbf('0x36')],'outboundDropCallsDayTimeout':_0x13f16b[_0xffbf('0x37')],'outboundNoAnswerCallsDay':_0x13f16b[_0xffbf('0x38')],'outboundNoSuchCallsDay':_0x13f16b[_0xffbf('0x39')],'outboundOriginateFailureCallsDay':_0x13f16b[_0xffbf('0x3a')],'outboundReCallsDay':_0x13f16b['outboundReCallsDay'],'outboundRejectCallsDay':_0x13f16b[_0xffbf('0x3b')],'outboundUnknownCallsDay':_0x13f16b[_0xffbf('0x3c')],'predictiveIntervalAnsweredCalls':_0x13f16b['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x13f16b[_0xffbf('0x3d')],'predictiveIntervalAvgTalktime':_0x13f16b[_0xffbf('0x3e')],'predictiveIntervalDroppedCallsCallersExit':_0x13f16b['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x13f16b['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x13f16b[_0xffbf('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0x13f16b['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x13f16b[_0xffbf('0x40')],'predictiveIntervalMultiplicativeFactor':_0x13f16b[_0xffbf('0x41')],'predictiveIntervalPauses':_0x13f16b[_0xffbf('0x42')],'predictiveIntervalAvailable':_0x13f16b[_0xffbf('0x43')],'predictiveIntervalTotalCalls':_0x13f16b[_0xffbf('0x44')],'message':_0x13f16b['message'],'originated':_0x13f16b[_0xffbf('0x45')],'erlangCalls':_0x13f16b[_0xffbf('0x46')],'erlangCallToSecond':_0x13f16b[_0xffbf('0x47')],'erlangAbandonmentRate':_0x13f16b[_0xffbf('0x48')],'erlangBusyFactor':_0x13f16b['erlangBusyFactor'],'startPredictive':_0x13f16b[_0xffbf('0x49')],'startProgressive':_0x13f16b[_0xffbf('0x4a')]};if(_0x13f16b[_0xffbf('0x4b')]){_0x43978d[_0xffbf('0x4b')]={'id':_0x13f16b[_0xffbf('0x4b')]['id'],'name':_0x13f16b[_0xffbf('0x4b')]['name'],'active':_0x13f16b[_0xffbf('0x4b')][_0xffbf('0x4c')],'callerid':_0x13f16b[_0xffbf('0x4b')][_0xffbf('0x4d')]};}if(_0x13f16b[_0xffbf('0x4e')]){_0x43978d[_0xffbf('0x4e')]={'id':_0x13f16b['Interval']['id'],'name':_0x13f16b[_0xffbf('0x4e')][_0xffbf('0x23')]};}var _0x3bb193=md5(JSON[_0xffbf('0x4f')](_0x43978d));if(_0x13f16b[_0xffbf('0x3')]!==_0x3bb193){_0x13f16b[_0xffbf('0x3')]=_0x3bb193;emit(util[_0xffbf('0x50')](_0xffbf('0x51'),_0x43978d[_0xffbf('0x23')]),'voice_queue:save',_0x43978d);}}}function emitVoiceQueueChannelRemove(_0x4eedae){emit(util['format']('voice:queue:%s',_0x4eedae[_0xffbf('0x23')]),_0xffbf('0x52'),_0x4eedae);}function notSendMessagesQueue(_0x52d450){if(_0x52d450[_0xffbf('0x53')]){if(_0x52d450[_0xffbf('0x45')]===0x0&&_0x52d450[_0xffbf('0x28')]===0x0){_0x52d450[_0xffbf('0x53')]=![];_0x52d450[_0xffbf('0x26')]=0x0;_0x52d450[_0xffbf('0x54')]=0x0;_0x52d450[_0xffbf('0x55')]=_0xffbf('0x56');ut['logger'](_0xffbf('0x57'),_0x52d450[_0xffbf('0x23')]+'\x20is\x20not\x20active');}else{_0x52d450['message']=_0xffbf('0x58');ut[_0xffbf('0x59')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x52d450[_0xffbf('0x23')]+_0xffbf('0x5a'));}emitCampaignPreview(_0x52d450);}}Preview[_0xffbf('0x5b')][_0xffbf('0x5c')]=function(){var _0x5c855b=this;setInterval(function(){_0x5c855b[_0xffbf('0x5d')]();},0x7cf);};Preview[_0xffbf('0x5b')][_0xffbf('0x5d')]=function(){var _0x4034c0=this[_0xffbf('0x11')];this[_0xffbf('0x13')]+=0x1;for(var _0x3544a3 in _0x4034c0){if(_0x4034c0[_0xffbf('0x5e')](_0x3544a3)&&(_0x4034c0[_0x3544a3]['dialMethod']===_0xffbf('0x7')||_0x4034c0[_0x3544a3][_0xffbf('0x31')]==='booked')&&_0x4034c0[_0x3544a3][_0xffbf('0x21')]==='outbound'){if(this[_0xffbf('0x13')]>0x7){this[_0xffbf('0x13')]=0x0;this[_0xffbf('0x5f')]();}}if(_0x4034c0['hasOwnProperty'](_0x3544a3)&&_0x4034c0[_0x3544a3][_0xffbf('0x31')]===_0xffbf('0x7')&&_0x4034c0[_0x3544a3][_0xffbf('0x21')]===_0xffbf('0x22')){if(_0x4034c0[_0x3544a3][_0xffbf('0x30')]){this[_0xffbf('0x60')](_0x4034c0[_0x3544a3]);this['recallMe'](_0x4034c0[_0x3544a3]);}else{notSendMessagesQueue(_0x4034c0[_0x3544a3]);}}}};Preview[_0xffbf('0x5b')]['clearZombieChannel']=function(_0x46e56f){var _0x547ab3=this;this[_0xffbf('0x61')][_0xffbf('0x62')](function(){if(!_[_0xffbf('0x63')](_0x547ab3['actions'][_0x46e56f])){loggerAction[_0xffbf('0x64')](_0xffbf('0x65'),_0x46e56f,'Queue',_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x67')],_0xffbf('0x68'),JSON[_0xffbf('0x4f')](_0x547ab3[_0xffbf('0x11')][_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x67')]][_0xffbf('0x45')]),_0xffbf('0x69'),JSON[_0xffbf('0x4f')](_0x547ab3[_0xffbf('0x11')][_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x67')]][_0xffbf('0x28')]),JSON[_0xffbf('0x4f')](_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x6a')]),JSON[_0xffbf('0x4f')](_[_0xffbf('0x6b')](_0x547ab3[_0xffbf('0x66')][_0x46e56f],['contactId',_0xffbf('0x6c'),_0xffbf('0x6d'),'ListId'])));return ami[_0xffbf('0x6e')]({'action':_0xffbf('0x6f'),'channel':_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x70')]})['catch'](function(_0x242bcd){if(_0x242bcd[_0xffbf('0x55')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x547ab3[_0xffbf('0x66')][_0x46e56f]){ut[_0xffbf('0x71')](_0x547ab3['campaignsPreview'][_0x547ab3[_0xffbf('0x66')][_0x46e56f]['queue']],_0xffbf('0x72'));if(_0x547ab3['actions'][_0x46e56f][_0xffbf('0x6a')]===!![]){ut['decrementTalkink'](_0x547ab3[_0xffbf('0x11')][_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x67')]],_0xffbf('0x72'));ut[_0xffbf('0x73')]('[Dialer][checkChannel][pTalking][Preview]'+_0x46e56f,_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x67')]);}ut[_0xffbf('0x73')](_0xffbf('0x74')+_0x46e56f,_0x547ab3[_0xffbf('0x66')][_0x46e56f][_0xffbf('0x67')]);delete _0x547ab3[_0xffbf('0x66')][_0x46e56f];}},0x2328);}});}});};Preview[_0xffbf('0x5b')][_0xffbf('0x5f')]=function(){var _0x1584d8=this;loggerAction[_0xffbf('0x64')]('[action]',_[_0xffbf('0x75')](this[_0xffbf('0x66')]));for(var _0x5cd6e9 in this['actions']){if(_0x1584d8[_0xffbf('0x66')][_0xffbf('0x5e')](_0x5cd6e9)){_0x1584d8['clearZombieChannel'](_0x5cd6e9);}}};Preview[_0xffbf('0x5b')]['recallMe']=function(_0x51d975){var _0x1f4edf=this;rpcDb[_0xffbf('0x76')](_0x51d975['id'],ut[_0xffbf('0x77')](this['agents']))[_0xffbf('0x78')](function(_0x5b4eb3){if(!_[_0xffbf('0x63')](_0x5b4eb3)){for(var _0x4d74ac=0x0;_0x4d74ac<_0x5b4eb3['length'];_0x4d74ac+=0x1){if(ut[_0xffbf('0x79')](_0x5b4eb3[_0x4d74ac][_0xffbf('0x7a')])<_0x51d975[_0xffbf('0x7b')]*0x3c){_0x1f4edf[_0xffbf('0x7c')](_0x5b4eb3[_0x4d74ac]['id'])[_0xffbf('0x78')](ut[_0xffbf('0x7d')](_0xffbf('0x7e')))['catch'](ut[_0xffbf('0x7d')](_0xffbf('0x7e')));}else{var _0x4a1efd=new Action(_0x5b4eb3[_0x4d74ac],_0x51d975);_0x4a1efd[_0xffbf('0x7f')]=moment()[_0xffbf('0x50')](_0xffbf('0x80'));_0x51d975['outboundReCallsDay']+=0x1;ut[_0xffbf('0x81')](_0x4a1efd,0x17,_0xffbf('0x82'));if(_0x51d975['dialRecallInQueue']){rpcDb['rescheduleContactInQueue'](ut[_0xffbf('0x83')](_0x5b4eb3[_0x4d74ac]));rpcDb[_0xffbf('0x84')](_0x4a1efd,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xffbf('0x81')](_0x4a1efd,0x16,_0xffbf('0x85'));rpcDb[_0xffbf('0x84')](_0x4a1efd,_0xffbf('0x86'));rpcDb[_0xffbf('0x87')](_0x4a1efd,_0xffbf('0x86'));}}}}})['catch'](ut[_0xffbf('0x7d')](_0xffbf('0x88')));};Preview[_0xffbf('0x5b')][_0xffbf('0x60')]=function(_0x2ca14c){_0x2ca14c[_0xffbf('0x53')]=!![];if(ut[_0xffbf('0x89')](_0x2ca14c['loggedIn'])){_0x2ca14c[_0xffbf('0x55')]=_0xffbf('0x8a');}else if(!ut[_0xffbf('0x8b')](_0x2ca14c[_0xffbf('0x30')])){_0x2ca14c[_0xffbf('0x55')]='NOT_ACTIVE';}else if(!this[_0xffbf('0x8c')](_0x2ca14c[_0xffbf('0x4b')])){if(!this['isTrunkReachable'](_0x2ca14c['TrunkBackup'])){_0x2ca14c[_0xffbf('0x55')]=_0xffbf('0x8d');}else{_0x2ca14c[_0xffbf('0x55')]=_0xffbf('0x8e');}}else{_0x2ca14c['message']='ACTIVE';}emitCampaignPreview(_0x2ca14c);};Preview[_0xffbf('0x5b')][_0xffbf('0x8f')]=function(_0x18498a,_0x256e27,_0x4bf697){var _0x11874f=this;var _0x18357c=this[_0xffbf('0x66')][_0x256e27];var _0x32117f=this[_0xffbf('0x11')][_0x18357c[_0xffbf('0x67')]];var _0x2e009f;if(_0x32117f){switch(_0x4bf697){case'1':_0x32117f[_0xffbf('0x39')]+=0x1;_0x18357c[_0xffbf('0x90')]=ut[_0xffbf('0x91')](_0x18357c);ut[_0xffbf('0x81')](_0x18357c,0x0,_0xffbf('0x92'));rpcDb[_0xffbf('0x84')](_0x18357c,_0xffbf('0x93'));if(ut['totalGlobal'](_0x18357c)>=_0x32117f[_0xffbf('0x94')]){_0x2e009f=ut['cloneAction'](_0x18357c,0xf,_0xffbf('0x95'));rpcDb[_0xffbf('0x87')](_0x2e009f,_0xffbf('0x96'));}else{rpcDb['createCustomerFinal'](_0x18357c,_0xffbf('0x96'));}delete this[_0xffbf('0x66')][_0x18498a[_0xffbf('0x97')]];break;case _0xffbf('0x98'):var _0x4106fa=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x18357c[_0xffbf('0x99')]=_0x4106fa;_0x18357c[_0xffbf('0x9a')]=_0x4106fa;_0x18357c['dialAnswer']=!![];_0x32117f[_0xffbf('0x28')]+=0x1;logger[_0xffbf('0x64')](_0xffbf('0x9b'),_0x18357c[_0xffbf('0x9c')],_0xffbf('0x9d'),_0x32117f[_0xffbf('0x23')],_0xffbf('0x69'),_0x32117f[_0xffbf('0x28')]);ami['emit'](_0xffbf('0x9e'),ut[_0xffbf('0x9f')](_0x18357c,'connect'));if(_0x32117f[_0xffbf('0xa0')]){ami['emit'](_0xffbf('0xa1'),ut['buildAcw'](_0x18357c));}break;case'16':ami[_0xffbf('0xa2')](_0xffbf('0xa3'),ut[_0xffbf('0x9f')](_0x18357c,'complete'));emitVoiceQueueChannelRemove(ut[_0xffbf('0x9f')](_0x18357c,'complete'));_0x32117f[_0xffbf('0xa4')]+=0x1;_0x32117f['total']+=0x1;_0x32117f[_0xffbf('0x25')]+=0x1;ut['decrementTalkink'](_0x32117f,_0xffbf('0xa5'));_0x18357c[_0xffbf('0x90')]=ut['totalGlobal'](_0x18357c);ut[_0xffbf('0x81')](_0x18357c,0x4,'Answer');rpcDb[_0xffbf('0x84')](_0x18357c,_0xffbf('0xa6'));rpcDb['createCustomerFinal'](_0x18357c,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xffbf('0xa7')](_0x18357c);_0x32117f['sumDuration']+=_0x18357c[_0xffbf('0xa8')];_0x32117f[_0xffbf('0x29')]+=_0x18357c['talktime'];logger[_0xffbf('0x64')](_0xffbf('0xa9'),_0x18357c['uniqueid'],'\x20Queue',_0x32117f[_0xffbf('0x23')],_0xffbf('0x69'),_0x32117f[_0xffbf('0x28')]);delete this[_0xffbf('0x66')][_0x18498a[_0xffbf('0x97')]];break;case _0xffbf('0xaa'):_0x32117f[_0xffbf('0x35')]+=0x1;_0x18357c[_0xffbf('0xab')]+=0x1;_0x18357c[_0xffbf('0x90')]=ut['totalGlobal'](_0x18357c);ut[_0xffbf('0x81')](_0x18357c,0x5,'Busy');rpcDb['createCustomerHistory'](_0x18357c,_0xffbf('0xac'));if(ut['totalGlobal'](_0x18357c)>=_0x32117f[_0xffbf('0x94')]){_0x2e009f=ut[_0xffbf('0xad')](_0x18357c,0xf,_0xffbf('0x95'));rpcDb[_0xffbf('0x87')](_0x2e009f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x18357c[_0xffbf('0xab')]>=_0x32117f[_0xffbf('0xae')]){rpcDb['createCustomerFinal'](_0x18357c,_0xffbf('0xac'));}else{rpcDb['rescheduleContact'](ut[_0xffbf('0xaf')](_0x18357c,_0xffbf('0xab'),_0x32117f[_0xffbf('0xb0')]),_0x18357c[_0xffbf('0xb1')],_0x18357c['activeContact']);}}break;case _0xffbf('0xb2'):_0x32117f[_0xffbf('0x38')]+=0x1;_0x18357c[_0xffbf('0xb3')]+=0x1;_0x18357c[_0xffbf('0x90')]=ut[_0xffbf('0x91')](_0x18357c);ut['logCustomer'](_0x18357c,0x3,_0xffbf('0xb4'));rpcDb[_0xffbf('0x84')](_0x18357c,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0xffbf('0x91')](_0x18357c)>=_0x32117f[_0xffbf('0x94')]){_0x2e009f=ut[_0xffbf('0xad')](_0x18357c,0xf,_0xffbf('0x95'));rpcDb[_0xffbf('0x87')](_0x2e009f,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x18357c[_0xffbf('0xb3')]>=_0x32117f[_0xffbf('0xb5')]){rpcDb[_0xffbf('0x87')](_0x18357c,_0xffbf('0xb6'));}else{rpcDb[_0xffbf('0xb7')](ut[_0xffbf('0xaf')](_0x18357c,_0xffbf('0xb3'),_0x32117f[_0xffbf('0xb8')]),_0x18357c['unlockAgent'],_0x18357c[_0xffbf('0xb9')]);}}break;case _0xffbf('0xba'):_0x32117f['outboundCongestionCallsDay']+=0x1;_0x18357c[_0xffbf('0xbb')]+=0x1;_0x18357c[_0xffbf('0x90')]=ut['totalGlobal'](_0x18357c);ut[_0xffbf('0x81')](_0x18357c,0x8,'Congestion');rpcDb['createCustomerHistory'](_0x18357c,'[callProgressDetectingCustomer][logCongestion]');if(ut['totalGlobal'](_0x18357c)>=_0x32117f[_0xffbf('0x94')]){_0x2e009f=ut['cloneAction'](_0x18357c,0xf,_0xffbf('0x95'));rpcDb[_0xffbf('0x87')](_0x2e009f,_0xffbf('0xbc'));}else{if(_0x18357c[_0xffbf('0xbb')]>=_0x32117f[_0xffbf('0xbd')]){rpcDb[_0xffbf('0x87')](_0x18357c,_0xffbf('0xbe'));}else{rpcDb[_0xffbf('0xb7')](ut[_0xffbf('0xaf')](_0x18357c,'countcongestionretry',_0x32117f[_0xffbf('0xb0')]),_0x18357c['unlockAgent'],_0x18357c['activeContact']);}}break;case'CANCEL':_0x32117f[_0xffbf('0x3b')]+=0x1;_0x18357c['countglobal']=ut[_0xffbf('0x91')](_0x18357c);ut[_0xffbf('0x81')](_0x18357c,0x14,'AgentReject');rpcDb['createCustomerHistory'](_0x18357c,_0xffbf('0xbf'));if(_0x18357c[_0xffbf('0xb1')]){rpcDb[_0xffbf('0xc0')](_0x18357c[_0xffbf('0xc1')]);}if(_0x18357c[_0xffbf('0xb9')]){rpcDb[_0xffbf('0xc2')](_0x18357c[_0xffbf('0xc1')]);}break;default:if(_0x18357c[_0xffbf('0x6a')]){ut['decrementTalkink'](_0x32117f,_0xffbf('0xc3'));ut[_0xffbf('0x73')](_0xffbf('0xc4')+_0x32117f[_0xffbf('0x23')],_0x18498a);}_0x32117f[_0xffbf('0x3c')]+=0x1;_0x18357c[_0xffbf('0x90')]=ut[_0xffbf('0x91')](_0x18357c);ut['logCustomer'](_0x18357c,0xc,_0x18498a[_0xffbf('0xc5')]||_0x18498a[_0xffbf('0xc6')]);rpcDb['createCustomerHistory'](_0x18357c,_0xffbf('0xc7'));if(ut[_0xffbf('0x91')](_0x18357c)>=_0x32117f['dialGlobalMaxRetry']){_0x2e009f=ut['cloneAction'](_0x18357c,0xf,'Global');rpcDb[_0xffbf('0x87')](_0x2e009f,_0xffbf('0xc8'));}else{rpcDb[_0xffbf('0x87')](_0x18357c,_0xffbf('0xc8'));}delete this['actions'][_0x18498a[_0xffbf('0x97')]];}if(!(_0x18357c[_0xffbf('0x6a')]&&_0x4bf697==='16')){ut[_0xffbf('0x71')](_0x32117f,_0xffbf('0xc9'));logger['info'](_0xffbf('0xca'),_0x18357c[_0xffbf('0x9c')],_0xffbf('0x9d'),_0x32117f['name'],'originated:\x20',_0x32117f['originated']);}if(_0x4bf697!==_0xffbf('0x98')){delete this[_0xffbf('0x66')][_0x18498a[_0xffbf('0x97')]];delete this['actions'][_0x18498a[_0xffbf('0xcb')]];}}};Preview['prototype'][_0xffbf('0xcc')]=function(_0x1e76f5,_0x3780aa,_0x3fabfa){if(_['isUndefined'](_0x3780aa)&&'object'!==typeof _0x3780aa){return;}if(_[_0xffbf('0xcd')](_0x3fabfa)&&_0xffbf('0xce')!==typeof _0x3fabfa){return;}switch(_0x3fabfa[_0xffbf('0xcf')]){case'0':ut['logAgent'](_0x1e76f5,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x1e76f5,_0xffbf('0xd0'));break;case'3':ut[_0xffbf('0xd1')](_0x1e76f5,0x3,_0xffbf('0xb4'));rpcDb[_0xffbf('0xd2')](_0x1e76f5,_0xffbf('0xd3'));break;case'5':ut[_0xffbf('0xd1')](_0x1e76f5,0x5,_0xffbf('0xd4'));rpcDb['createAgentHistory'](_0x1e76f5,_0xffbf('0xd5'));break;case'8':ut[_0xffbf('0xd1')](_0x1e76f5,0x8,_0xffbf('0xd6'));rpcDb[_0xffbf('0xd2')](_0x1e76f5,_0xffbf('0xd7'));break;case'22':ut[_0xffbf('0xd1')](_0x1e76f5,0x16,_0xffbf('0xd8'));rpcDb[_0xffbf('0xd2')](_0x1e76f5,_0xffbf('0xd9'));break;default:ut['logAgent'](_0x1e76f5,0xc,_0x3fabfa[_0xffbf('0xcf')]);rpcDb[_0xffbf('0xd2')](_0x1e76f5,_0xffbf('0xd7'));}ut[_0xffbf('0x71')](_0x3780aa,_0xffbf('0xda'));logger[_0xffbf('0x64')](_0xffbf('0xdb'),_0x1e76f5['uniqueid'],_0xffbf('0x9d'),_0x3780aa[_0xffbf('0x23')],_0xffbf('0x68'),_0x3780aa['originated']);delete this[_0xffbf('0x66')][_0x1e76f5[_0xffbf('0x9c')]];};Preview[_0xffbf('0x5b')]['checkInBlack']=function(_0x2e708e,_0x3e015c,_0x11ff91,_0x41c10d,_0x4a3a36){var _0x33bb52=this;return new BPromise(function(_0xab0d4f,_0x4c9032){if(_[_0xffbf('0x63')](_0x3e015c)||_[_0xffbf('0x63')](_0x3e015c['Contact'])||_[_0xffbf('0x63')](_0x3e015c[_0xffbf('0xdc')][_0xffbf('0xdd')])||_[_0xffbf('0x63')](_0x3e015c[_0xffbf('0x6d')])){_0x4c9032(ut[_0xffbf('0x55')](_0xffbf('0xde'),_0x41c10d,_0x4a3a36));return;}var _0x2a87a7=uuid['v4']();var _0x1eb17d=_0x33bb52[_0xffbf('0x11')][_0x3e015c[_0xffbf('0xdf')]['name']];var _0x2884e1=_0x11ff91?_0x33bb52[_0xffbf('0x12')][_0x11ff91]['id']:undefined;_0x33bb52[_0xffbf('0x66')][_0x2a87a7]=new Action(_0x3e015c,_0x1eb17d,_0x2a87a7,_0x11ff91,_0x2884e1);var _0xfdcb93=_0x33bb52[_0xffbf('0x66')][_0x2a87a7];_0xfdcb93[_0xffbf('0xb1')]=_0x41c10d;_0xfdcb93[_0xffbf('0xb9')]=_0x4a3a36;_0xfdcb93[_0xffbf('0xe0')]=_0x11ff91;if(_[_0xffbf('0xe1')](_0x2e708e)){_0x33bb52['execCall'](_0xfdcb93,_0x1eb17d,_0x3e015c,_0x11ff91)[_0xffbf('0x78')](function(_0x5dd6f2){logger['info'](_0xffbf('0xe2'),_0xffbf('0xe3')+_0xfdcb93[_0xffbf('0x67')]+_0xffbf('0xe4')+_0xfdcb93['idContact'],JSON[_0xffbf('0x4f')](_0x5dd6f2));ami['emit'](_0xffbf('0xe5'),ut[_0xffbf('0x9f')](_0xfdcb93,'called'));_0xab0d4f(ut[_0xffbf('0x55')]('Calling'));})[_0xffbf('0xe6')](function(_0x4c5abd){ut[_0xffbf('0x59')]('[Preview][execCall][failure]',_0x4c5abd);_0x4c9032(ut[_0xffbf('0x55')](_0xffbf('0xe7'),_0x41c10d,_0x4a3a36));});}else{_0x1eb17d[_0xffbf('0x34')]+=0x1;ut[_0xffbf('0xe8')](_0xfdcb93);rpcDb[_0xffbf('0xe9')](_0xfdcb93,_0xffbf('0xea'));delete _0x33bb52[_0xffbf('0x66')][_0x2a87a7];_0x4c9032(ut['message'](_0xffbf('0xeb'),_0x41c10d,_0x4a3a36));}});};Preview[_0xffbf('0x5b')][_0xffbf('0x8c')]=function(_0x345d01){return!_['isNil'](_0x345d01)&&!_[_0xffbf('0x63')](_0x345d01[_0xffbf('0x23')])&&!_[_0xffbf('0x63')](_0x345d01[_0xffbf('0x4c')])&&_0x345d01[_0xffbf('0x4c')]&&!_['isNil'](this[_0xffbf('0xec')][util[_0xffbf('0x50')]('SIP/%s',_0x345d01[_0xffbf('0x23')])])&&!_['isNil'](this[_0xffbf('0xec')][util[_0xffbf('0x50')](_0xffbf('0xed'),_0x345d01['name'])][_0xffbf('0x6f')])&&(this[_0xffbf('0xec')][util[_0xffbf('0x50')](_0xffbf('0xed'),_0x345d01[_0xffbf('0x23')])]['status']===_0xffbf('0xee')||this[_0xffbf('0xec')][util[_0xffbf('0x50')](_0xffbf('0xed'),_0x345d01[_0xffbf('0x23')])][_0xffbf('0x6f')]===_0xffbf('0xef'));};Preview[_0xffbf('0x5b')][_0xffbf('0x7c')]=function(_0x5ac2bc,_0x386bbe){var _0x568a3b=this;return new BPromise(function(_0x4b6c1e,_0x1bd9c9){_0x568a3b[_0xffbf('0xf0')](_0x5ac2bc,_0x386bbe)['then'](function(_0x1650de){_0x4b6c1e(_[_0xffbf('0x6b')](_0x1650de,['message']));})[_0xffbf('0xe6')](function(_0x434e14){if(_0x434e14[_0xffbf('0xf1')]){rpcDb[_0xffbf('0xc0')](_0x5ac2bc);}if(_0x434e14[_0xffbf('0x4c')]){rpcDb[_0xffbf('0xc2')](_0x5ac2bc);}_0x1bd9c9(_[_0xffbf('0x6b')](_0x434e14,['message']));});});};Preview[_0xffbf('0x5b')][_0xffbf('0xf0')]=function(_0x1a568,_0x2902df){var _0xbc69df=this;return new BPromise(function(_0x78421e,_0x7f5a6c){var _0xe4a519,_0x5b0ed8;rpcDb[_0xffbf('0xf2')](_0x1a568)[_0xffbf('0x78')](function(_0x5dd68f){if(!_[_0xffbf('0x63')](_0x5dd68f[0x0])){_0x5b0ed8=_0x5dd68f[0x0]['recallme']?![]:!![];_0xe4a519=_0x5dd68f[0x0]['recallme']?!![]:![];_0xe4a519=_0x2902df?!![]:_0xe4a519;}var _0x2973f5=_0xbc69df[_0xffbf('0xf3')](_0x5dd68f);if(_0x2973f5['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x5dd68f[0x0],[_0xffbf('0x6d'),_0xffbf('0xf4')]))[_0xffbf('0x78')](function(_0x123664){_0xbc69df[_0xffbf('0xf5')](_0x123664,_0x5dd68f[0x0],_0x2902df,_0x5b0ed8,_0xe4a519)[_0xffbf('0x78')](function(_0x5566c3){_0x78421e(_0x5566c3);})['catch'](function(_0x491026){_0x7f5a6c(_0x491026);});})['catch'](function(_0x4eb223){ut[_0xffbf('0x59')](_0xffbf('0xf6'),_0x4eb223);_0x7f5a6c(ut[_0xffbf('0x55')](_0xffbf('0xf7'),_0x5b0ed8,_0xe4a519));});}else{_0x7f5a6c(ut[_0xffbf('0x55')](_0x2973f5[_0xffbf('0x55')],_0x5b0ed8,_0xe4a519));}})['catch'](function(_0x52c771){ut['logger'](_0xffbf('0xf8'),_0x52c771);_0x7f5a6c(ut[_0xffbf('0x55')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xffbf('0x5b')][_0xffbf('0xf3')]=function(_0x26c4bb){if(_['isNil'](_0x26c4bb)||_['isEmpty'](_0x26c4bb)||!_['isNil'](_0x26c4bb[0x0][_0xffbf('0xf9')])&&_[_0xffbf('0x63')](_0x26c4bb[0x0][_0xffbf('0xf9')][_0xffbf('0x23')])){ut['logger'](_0xffbf('0xfa'),_0x26c4bb);return{'isValid':![],'message':_0xffbf('0xfb')};}var _0x2a6382=this[_0xffbf('0x11')][_0x26c4bb[0x0][_0xffbf('0xdf')][_0xffbf('0x23')]];_0x2a6382[_0xffbf('0x55')]='ACTIVE';if(_['isNil'](_0x2a6382)){ut[_0xffbf('0x59')](_0xffbf('0xfc'),_0x2a6382);return{'isValid':![],'message':_0xffbf('0xfd')};}if(!this[_0xffbf('0x8c')](_0x2a6382['Trunk'])){ut[_0xffbf('0x59')](_0xffbf('0xfe'),_0xffbf('0xff')+_0x2a6382['name']+_0xffbf('0x100'));if(!this[_0xffbf('0x8c')](_0x2a6382[_0xffbf('0x101')])){ut[_0xffbf('0x59')](_0xffbf('0xfe'),_0x2a6382[_0xffbf('0x23')]+_0xffbf('0x102'));return{'isValid':![],'message':_0xffbf('0x103')};}}if(!ut[_0xffbf('0x8b')](_0x2a6382[_0xffbf('0x30')])){ut[_0xffbf('0x59')]('[Preview][validateContact][Campaign\x20Active]',_0x2a6382[_0xffbf('0x23')]+_0xffbf('0x104'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x2a6382[_0xffbf('0x23')]+_0xffbf('0x104')};}return{'isValid':!![],'message':_0xffbf('0x105')};};Preview['prototype']['execCall']=function(_0xb7da53,_0x13e718,_0x3e7f20,_0x3de007){var _0x1bb33f=this;return new BPromise(function(_0x1526a2,_0x1d588d){var _0x10eea2=_0xb7da53[_0xffbf('0x9c')];var _0x20a9f5=_0x1bb33f[_0xffbf('0x8c')](_0x13e718[_0xffbf('0x4b')])?util['format'](_0xffbf('0x106'),_0x13e718[_0xffbf('0x4b')][_0xffbf('0x23')],_[_0xffbf('0x63')](_0x13e718['dialPrefix'])?'':_0x13e718[_0xffbf('0x107')][_0xffbf('0x108')]()||'',_0x13e718[_0xffbf('0x109')]>0x0?_0x3e7f20[_0xffbf('0xdc')][_0xffbf('0xdd')][_0xffbf('0x10a')](_0x13e718[_0xffbf('0x109')]):_0x3e7f20[_0xffbf('0xdc')][_0xffbf('0xdd')]):util[_0xffbf('0x50')](_0xffbf('0x106'),_['isNil'](_0x13e718[_0xffbf('0x101')])?_0x13e718[_0xffbf('0x4b')]['name']:_0x13e718[_0xffbf('0x101')][_0xffbf('0x23')],_[_0xffbf('0x63')](_0x13e718['dialPrefix'])?'':_0x13e718[_0xffbf('0x107')][_0xffbf('0x108')]()||'',_0x13e718['dialCutDigit']>0x0?_0x3e7f20[_0xffbf('0xdc')]['phone']['substring'](_0x13e718[_0xffbf('0x109')]):_0x3e7f20['Contact'][_0xffbf('0xdd')]);var _0x336214=_0x1bb33f[_0xffbf('0x8c')](_0x13e718['Trunk'])?ut[_0xffbf('0x10b')](_0x13e718[_0xffbf('0x4b')][_0xffbf('0x4d')],_0x13e718[_0xffbf('0x10c')],_0x13e718[_0xffbf('0x10d')]>0x0?ut[_0xffbf('0x10e')](_0x13e718[_0xffbf('0x32')],_0x13e718[_0xffbf('0x10d')]):_0x13e718[_0xffbf('0x32')]):ut[_0xffbf('0x10b')](_['isNil'](_0x13e718[_0xffbf('0x101')])?_0x13e718['Trunk']['callerid']:_0x13e718[_0xffbf('0x101')][_0xffbf('0x4d')],_0x13e718[_0xffbf('0x10c')],_0x13e718[_0xffbf('0x10d')]>0x0?ut[_0xffbf('0x10e')](_0x13e718[_0xffbf('0x32')],_0x13e718[_0xffbf('0x10d')]):_0x13e718[_0xffbf('0x32')]);if(_0x336214){_0xb7da53[_0xffbf('0x10f')]=ut[_0xffbf('0x110')](_0x336214);_0xb7da53[_0xffbf('0x111')]=ut['extractCalleridNumber'](_0x336214);}var _0x240c14=ut[_0xffbf('0x112')](_0x13e718,_0x3e7f20,_0x20a9f5,_0x336214,_0x10eea2,_0xb7da53);_[_0xffbf('0x113')](_0xb7da53,ut['toLowerVariables'](_0x240c14));_0xb7da53[_0xffbf('0x7f')]=moment()[_0xffbf('0x50')](_0xffbf('0x80'));ami[_0xffbf('0x6e')](ut['variablesAction'](_0xb7da53,_0x13e718,_0x240c14,_0xb7da53['activeContact'],_0x3de007))[_0xffbf('0x78')](function(_0x50af38){_0x13e718[_0xffbf('0x45')]+=0x1;logger['info'](_0xffbf('0x114'),_0x10eea2,_0xffbf('0x9d'),_0x13e718['name'],'originated:\x20',_0x13e718['originated']);_0x1526a2(_0x50af38);})[_0xffbf('0xe6')](function(_0x423f0f){ut[_0xffbf('0xd1')](_0xb7da53,0xe,_0xffbf('0x115'));rpcDb[_0xffbf('0xd2')](_0xb7da53,_0xffbf('0x116'));_0x1d588d(_0x423f0f);});});};Preview[_0xffbf('0x5b')][_0xffbf('0x1a')]=function(_0x4df0dd){if(this[_0xffbf('0x66')][_0x4df0dd[_0xffbf('0x97')]]){this[_0xffbf('0x66')][_0x4df0dd[_0xffbf('0x97')]][_0xffbf('0x70')]=_0x4df0dd[_0xffbf('0x70')];}};Preview[_0xffbf('0x5b')][_0xffbf('0x15')]=function(_0x5eb497){var _0x349dbe=this;var _0x137983=this['actions'][_0x5eb497['actionid']];if(_0x137983){if(_0x137983[_0xffbf('0xe0')]&&this[_0xffbf('0x12')][_0x137983[_0xffbf('0xe0')]]){ut[_0xffbf('0x117')](_0x137983,this[_0xffbf('0x12')][_0x137983['lookAgent']]['name'],this[_0xffbf('0x12')][_0x137983[_0xffbf('0xe0')]]['id']);}var _0x23cc78=_[_0xffbf('0x118')](_0x137983);_0x23cc78['responsetime']=moment()[_0xffbf('0x50')](_0xffbf('0x80'));var _0x3f9b7=_0x349dbe['campaignsPreview'][_0x137983[_0xffbf('0x67')]];if(ut[_0xffbf('0x119')](_0x5eb497[_0xffbf('0x11a')])){if(_0x137983[_0xffbf('0xb1')]){rpcDb[_0xffbf('0xc0')](_0x137983['idContact']);}if(_0x137983[_0xffbf('0xb9')]){rpcDb[_0xffbf('0xc2')](_0x137983[_0xffbf('0xc1')]);}ami['emit'](_0xffbf('0x11b'),ut['buildObj'](_0x137983,_0xffbf('0x11c')));this[_0xffbf('0xcc')](_0x23cc78,_0x3f9b7,_0x5eb497);}else{_0x137983[_0xffbf('0x7f')]=moment()[_0xffbf('0x50')](_0xffbf('0x80'));ut['logAgent'](_0x23cc78,0x4,_0xffbf('0x11d'));rpcDb[_0xffbf('0xd2')](_0x23cc78,_0xffbf('0x11e'));}}};Preview[_0xffbf('0x5b')][_0xffbf('0x11f')]=function(_0x1f902e){var _0x3249c4=this;var _0x1c7695=this['actions'][_0x1f902e[_0xffbf('0x97')]];var _0x589021;if(_0x1c7695){_0x589021=this[_0xffbf('0x11')][_0x1c7695[_0xffbf('0x67')]];logger[_0xffbf('0x64')]('[syncHangup][talking]',_0x1f902e[_0xffbf('0x97')],_0xffbf('0x9d'),_0x589021['name'],_0xffbf('0x69'),_0x589021[_0xffbf('0x28')]);}if(this[_0xffbf('0x66')][_0x1f902e['linkedid']]&&_0x1f902e[_0xffbf('0x97')]!==_0x1f902e[_0xffbf('0x9c')]){if(_0x1f902e[_0xffbf('0x120')]==='16'&&this[_0xffbf('0x66')][_0x1f902e[_0xffbf('0x97')]][_0xffbf('0x6a')]){this[_0xffbf('0x8f')](_0x1f902e,_0x1f902e[_0xffbf('0x97')],_0x1f902e[_0xffbf('0x120')]);}else if(this['actions'][_0x1f902e['linkedid']][_0xffbf('0x6a')]){logger[_0xffbf('0x64')](_0xffbf('0x121'),_0x1f902e[_0xffbf('0x97')],_0x1f902e[_0xffbf('0x120')],_0xffbf('0x9d'),_0x589021[_0xffbf('0x23')],'pTalking:\x20',_0x589021[_0xffbf('0x28')]);this['callProgressDetectingCustomer'](_0x1f902e,_0x1f902e[_0xffbf('0x97')],_0x1f902e[_0xffbf('0x120')]);}}else if(_0x1c7695&&_[_0xffbf('0x63')](_0x1c7695[_0xffbf('0x122')])&&_0x589021[_0xffbf('0x123')]&&_0x1f902e[_0xffbf('0x97')]===_0x1f902e[_0xffbf('0x9c')]&&_[_0xffbf('0x63')](_0x1f902e[_0xffbf('0xcf')])&&_0x1f902e[_0xffbf('0x120')]==='16'&&_0x1f902e[_0xffbf('0x124')]==='6'&&_[_0xffbf('0xcd')](_0x1c7695[_0xffbf('0x125')])){if(_0x1c7695[_0xffbf('0xb1')]){rpcDb[_0xffbf('0xc0')](_0x1c7695[_0xffbf('0xc1')]);}if(_0x1c7695[_0xffbf('0xb9')]){rpcDb[_0xffbf('0xc2')](_0x1c7695[_0xffbf('0xc1')]);}_0x1f902e[_0xffbf('0xcf')]='22';this[_0xffbf('0xcc')](_0x1c7695,_0x589021,_0x1f902e);}else if(_0x1c7695&&_0x1c7695[_0xffbf('0x125')]){if(_0x1f902e['cause']==='16'&&this[_0xffbf('0x66')][_0x1f902e['linkedid']]['dialAnswer']){logger[_0xffbf('0x64')]('[syncHangup][talking][transfer]',_0x1f902e[_0xffbf('0x97')],_0x1f902e['cause'],'\x20Queue',_0x589021[_0xffbf('0x23')],_0xffbf('0x69'),_0x589021['pTalking']);this[_0xffbf('0x8f')](_0x1f902e,_0x1f902e[_0xffbf('0x97')],_0x1f902e[_0xffbf('0x120')]);}else if(this[_0xffbf('0x66')][_0x1f902e[_0xffbf('0x97')]][_0xffbf('0x6a')]){logger[_0xffbf('0x64')](_0xffbf('0x121'),_0x1f902e[_0xffbf('0x97')],_0x1f902e['cause'],_0xffbf('0x9d'),_0x589021[_0xffbf('0x23')],'pTalking:\x20',_0x589021['pTalking']);this[_0xffbf('0x8f')](_0x1f902e,_0x1f902e[_0xffbf('0x97')],_0x1f902e['cause']);}}};Preview[_0xffbf('0x5b')][_0xffbf('0x19')]=function(_0x379003){if(this['actions'][_0x379003[_0xffbf('0xcb')]]&&_0x379003[_0xffbf('0xcb')]!==_0x379003[_0xffbf('0x126')]){this['callProgressDetectingCustomer'](_0x379003,_0x379003[_0xffbf('0xcb')],_0x379003[_0xffbf('0xc6')]);}};Preview[_0xffbf('0x5b')][_0xffbf('0x18')]=function(_0x56b320){if(this[_0xffbf('0x66')][_0x56b320[_0xffbf('0x97')]]&&_0x56b320[_0xffbf('0x97')]!==_0x56b320[_0xffbf('0x9c')]&&!this[_0xffbf('0x66')][_0x56b320[_0xffbf('0x97')]][_0xffbf('0x6a')]){if(_0x56b320[_0xffbf('0x120')]==='1'){this[_0xffbf('0x8f')](_0x56b320,_0x56b320[_0xffbf('0x97')],_0x56b320['cause']);}}};Preview[_0xffbf('0x5b')][_0xffbf('0x127')]=function(_0x196caa,_0x4e5b18,_0xc8522d){if(this[_0xffbf('0x66')][_0x196caa]){if(_[_0xffbf('0x63')](this[_0xffbf('0x66')][_0x196caa][_0xffbf('0x128')])){this[_0xffbf('0x66')][_0x196caa][_0xffbf('0x128')]={};}this[_0xffbf('0x66')][_0x196caa][_0xffbf('0x128')][_0x4e5b18]=_0xc8522d;}};Preview[_0xffbf('0x5b')][_0xffbf('0x1c')]=function(_0x419661){try{if(!_[_0xffbf('0x63')](_0x419661)){if(ut['filterKey'](_[_0xffbf('0x129')](_0x419661['variable'])[0x0])){this[_0xffbf('0x127')](_0x419661[_0xffbf('0x9c')],_[_0xffbf('0x129')](_0x419661[_0xffbf('0x12a')])[0x0],_0x419661['value']);}}}catch(_0x4f568e){logger['error']('[syncVarSet][Preview]',util['inspect'](_0x4f568e,{'showHidden':![],'depth':null}));}};Preview[_0xffbf('0x5b')][_0xffbf('0x1e')]=function(_0x3c663d){if(_0x3c663d){if(this[_0xffbf('0x66')][_0x3c663d[_0xffbf('0x12b')]]){this[_0xffbf('0x66')][_0x3c663d[_0xffbf('0x12b')]][_0xffbf('0x125')]=!![];}}};Preview['prototype'][_0xffbf('0x20')]=function(_0x238d21){if(_0x238d21){if(this['actions'][_0x238d21['transfererlinkedid']]){this[_0xffbf('0x66')][_0x238d21[_0xffbf('0x12c')]][_0xffbf('0x125')]=!![];}}};module[_0xffbf('0x12d')]=Preview; \ No newline at end of file +var _0x3e95=['syncHangup','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','channelstate','transfer','destuniqueid','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./action','./util/util','redis','localhost','socket.io-emitter','prototype','tail','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','name','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','message','originated','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','Interval','voice:queue:%s','format','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','booked','type','outbound','clearZombieChannels','hasOwnProperty','preview','setMessage','recallMe','clearZombieChannel','enqueue','isNil','info','Queue','stringify','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','length','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','AGENTS_NOT_LOGGED','isActive','dialActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countglobal','totalGlobal','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','buildObj','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','[syncHangup][talking][decrement]','pTalking:\x20','BUSY','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','rescheduleContact','scheduledAt','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','unlockAgent','activeContact','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestionGlobal]','[callProgressDetectingCustomer][logCongestion]','dialBusyRetryFrequency','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','then','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','disableContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','dialCutDigit','substring','SIP/%s/%s%s','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','callerid','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','[originated][increment]','[originateFailure][logOriginateFailure]','syncNewExten','syncOriginateResponse','actionid','lookAgent','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer'];(function(_0x5167a4,_0x4ac437){var _0xba0081=function(_0xad262a){while(--_0xad262a){_0x5167a4['push'](_0x5167a4['shift']());}};_0xba0081(++_0x4ac437);}(_0x3e95,0x14f));var _0x53e9=function(_0x4f91ec,_0x77123f){_0x4f91ec=_0x4f91ec-0x0;var _0x2cec02=_0x3e95[_0x4f91ec];return _0x2cec02;};'use strict';var util=require(_0x53e9('0x0'));var _=require(_0x53e9('0x1'));var BPromise=require(_0x53e9('0x2'));var uuid=require(_0x53e9('0x3'));var moment=require(_0x53e9('0x4'));var md5=require(_0x53e9('0x5'));var Redis=require(_0x53e9('0x6'));var config=require(_0x53e9('0x7'));var logger=require(_0x53e9('0x8'))('preview');var loggerAction=require('../../../config/logger')('actionPreview');var ami=require('../ami');var rpcDb=require(_0x53e9('0x9'));var Action=require(_0x53e9('0xa'));var ut=require(_0x53e9('0xb'));config[_0x53e9('0xc')]=_['defaults'](config[_0x53e9('0xc')],{'host':_0x53e9('0xd'),'port':0x18eb});var io=require(_0x53e9('0xe'))(new Redis(config[_0x53e9('0xc')]));var Sequence=function(){};Sequence[_0x53e9('0xf')]['enqueue']=function(_0xd7c26e){this[_0x53e9('0x10')]=this[_0x53e9('0x10')]?this[_0x53e9('0x10')]['finally'](_0xd7c26e):_0xd7c26e();};function Preview(_0x32f73b){this[_0x53e9('0x11')]=new Sequence();this[_0x53e9('0x12')]=_0x32f73b['voiceQueues'];this[_0x53e9('0x13')]=_0x32f73b['trunks'];this[_0x53e9('0x14')]={};this[_0x53e9('0x15')]=_0x32f73b[_0x53e9('0x15')];this[_0x53e9('0x16')]=0x0;ami['on'](_0x53e9('0x17'),this['syncOriginateResponse'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x19'),this['syncHangup'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1a'),this[_0x53e9('0x1b')][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1c'),this[_0x53e9('0x1d')][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1e'),this['syncNewExten'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x1f'),this['syncVarSet'][_0x53e9('0x18')](this));ami['on'](_0x53e9('0x20'),this[_0x53e9('0x21')]['bind'](this));ami['on'](_0x53e9('0x22'),this[_0x53e9('0x23')][_0x53e9('0x18')](this));this[_0x53e9('0x24')](this['campaignsPreview']);}function emit(_0x55d4e5,_0x12663e,_0x2e68d0){io['to'](_0x55d4e5)[_0x53e9('0x25')](_0x12663e,_0x2e68d0);}function emitCampaignPreview(_0x5a68ae){if(_0x5a68ae['type']==='outbound'){var _0x420d5b={'id':_0x5a68ae['id'],'name':_0x5a68ae[_0x53e9('0x26')],'strategy':_0x5a68ae[_0x53e9('0x27')],'answered':_0x5a68ae['answered'],'available':_0x5a68ae[_0x53e9('0x28')],'loggedIn':_0x5a68ae[_0x53e9('0x29')],'pTalking':_0x5a68ae['pTalking'],'sumBillable':_0x5a68ae[_0x53e9('0x2a')],'sumDuration':_0x5a68ae[_0x53e9('0x2b')],'sumHoldTime':_0x5a68ae[_0x53e9('0x2c')]||0x0,'talking':_0x5a68ae[_0x53e9('0x2d')],'total':_0x5a68ae[_0x53e9('0x2e')],'type':_0x5a68ae['type'],'unmanaged':_0x5a68ae['unmanaged'],'abandoned':_0x5a68ae[_0x53e9('0x2f')],'waiting':_0x5a68ae['waiting'],'loggedInDb':_0x5a68ae[_0x53e9('0x30')],'dialActive':_0x5a68ae['dialActive'],'dialMethod':_0x5a68ae[_0x53e9('0x31')],'dialOriginateCallerIdName':_0x5a68ae[_0x53e9('0x32')],'dialOriginateCallerIdNumber':_0x5a68ae[_0x53e9('0x33')],'dialOriginateTimeout':_0x5a68ae['dialOriginateTimeout'],'dialPrefix':_0x5a68ae[_0x53e9('0x34')],'outboundAnswerAgiCallsDay':_0x5a68ae[_0x53e9('0x35')],'outboundAnswerCallsDay':_0x5a68ae[_0x53e9('0x36')],'outboundBlacklistCallsDay':_0x5a68ae[_0x53e9('0x37')],'outboundBusyCallsDay':_0x5a68ae[_0x53e9('0x38')],'outboundCongestionCallsDay':_0x5a68ae[_0x53e9('0x39')],'outboundDropCallsDayACS':_0x5a68ae[_0x53e9('0x3a')],'outboundDropCallsDayCallersExit':_0x5a68ae['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5a68ae[_0x53e9('0x3b')],'outboundNoAnswerCallsDay':_0x5a68ae[_0x53e9('0x3c')],'outboundNoSuchCallsDay':_0x5a68ae[_0x53e9('0x3d')],'outboundOriginateFailureCallsDay':_0x5a68ae[_0x53e9('0x3e')],'outboundReCallsDay':_0x5a68ae[_0x53e9('0x3f')],'outboundRejectCallsDay':_0x5a68ae[_0x53e9('0x40')],'outboundUnknownCallsDay':_0x5a68ae['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x5a68ae[_0x53e9('0x41')],'predictiveIntervalAvgHoldtime':_0x5a68ae[_0x53e9('0x42')],'predictiveIntervalAvgTalktime':_0x5a68ae[_0x53e9('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x5a68ae[_0x53e9('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x5a68ae[_0x53e9('0x45')],'predictiveIntervalErlangCalls':_0x5a68ae[_0x53e9('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x5a68ae[_0x53e9('0x47')],'predictiveIntervalHitRate':_0x5a68ae[_0x53e9('0x48')],'predictiveIntervalMultiplicativeFactor':_0x5a68ae[_0x53e9('0x49')],'predictiveIntervalPauses':_0x5a68ae[_0x53e9('0x4a')],'predictiveIntervalAvailable':_0x5a68ae['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x5a68ae['predictiveIntervalTotalCalls'],'message':_0x5a68ae[_0x53e9('0x4b')],'originated':_0x5a68ae[_0x53e9('0x4c')],'erlangCalls':_0x5a68ae['erlangCalls'],'erlangCallToSecond':_0x5a68ae[_0x53e9('0x4d')],'erlangAbandonmentRate':_0x5a68ae[_0x53e9('0x4e')],'erlangBusyFactor':_0x5a68ae['erlangBusyFactor'],'startPredictive':_0x5a68ae['startPredictive'],'startProgressive':_0x5a68ae[_0x53e9('0x4f')]};if(_0x5a68ae['Trunk']){_0x420d5b[_0x53e9('0x50')]={'id':_0x5a68ae[_0x53e9('0x50')]['id'],'name':_0x5a68ae[_0x53e9('0x50')][_0x53e9('0x26')],'active':_0x5a68ae[_0x53e9('0x50')]['active'],'callerid':_0x5a68ae[_0x53e9('0x50')]['callerid']};}if(_0x5a68ae[_0x53e9('0x51')]){_0x420d5b['Interval']={'id':_0x5a68ae[_0x53e9('0x51')]['id'],'name':_0x5a68ae[_0x53e9('0x51')][_0x53e9('0x26')]};}var _0x443aba=md5(JSON['stringify'](_0x420d5b));if(_0x5a68ae[_0x53e9('0x5')]!==_0x443aba){_0x5a68ae[_0x53e9('0x5')]=_0x443aba;emit(util['format'](_0x53e9('0x52'),_0x420d5b[_0x53e9('0x26')]),'voice_queue:save',_0x420d5b);}}}function emitVoiceQueueChannelRemove(_0x59100e){emit(util[_0x53e9('0x53')](_0x53e9('0x52'),_0x59100e[_0x53e9('0x26')]),_0x53e9('0x54'),_0x59100e);}function notSendMessagesQueue(_0x567478){if(_0x567478[_0x53e9('0x55')]){if(_0x567478['originated']===0x0&&_0x567478[_0x53e9('0x56')]===0x0){_0x567478['sendMessageOneNotActive']=![];_0x567478[_0x53e9('0x28')]=0x0;_0x567478['paused']=0x0;_0x567478[_0x53e9('0x4b')]='NOT_ACTIVE';ut[_0x53e9('0x57')](_0x53e9('0x58'),_0x567478['name']+_0x53e9('0x59'));}else{_0x567478[_0x53e9('0x4b')]=_0x53e9('0x5a');ut[_0x53e9('0x57')](_0x53e9('0x58'),_0x567478[_0x53e9('0x26')]+_0x53e9('0x5b'));}emitCampaignPreview(_0x567478);}}Preview[_0x53e9('0xf')][_0x53e9('0x24')]=function(){var _0x35c6d7=this;setInterval(function(){_0x35c6d7[_0x53e9('0x5c')]();},0x7cf);};Preview['prototype'][_0x53e9('0x5c')]=function(){var _0x44d378=this[_0x53e9('0x12')];this[_0x53e9('0x16')]+=0x1;for(var _0x9a9724 in _0x44d378){if(_0x44d378['hasOwnProperty'](_0x9a9724)&&(_0x44d378[_0x9a9724][_0x53e9('0x31')]==='preview'||_0x44d378[_0x9a9724]['dialMethod']===_0x53e9('0x5d'))&&_0x44d378[_0x9a9724][_0x53e9('0x5e')]===_0x53e9('0x5f')){if(this[_0x53e9('0x16')]>0x7){this[_0x53e9('0x16')]=0x0;this[_0x53e9('0x60')]();}}if(_0x44d378[_0x53e9('0x61')](_0x9a9724)&&_0x44d378[_0x9a9724]['dialMethod']===_0x53e9('0x62')&&_0x44d378[_0x9a9724]['type']===_0x53e9('0x5f')){if(_0x44d378[_0x9a9724]['dialActive']){this[_0x53e9('0x63')](_0x44d378[_0x9a9724]);this[_0x53e9('0x64')](_0x44d378[_0x9a9724]);}else{notSendMessagesQueue(_0x44d378[_0x9a9724]);}}}};Preview[_0x53e9('0xf')][_0x53e9('0x65')]=function(_0x2cf907){var _0x1d9906=this;this['sequence'][_0x53e9('0x66')](function(){if(!_[_0x53e9('0x67')](_0x1d9906['actions'][_0x2cf907])){loggerAction[_0x53e9('0x68')]('[clearZombieChannels][talking]',_0x2cf907,_0x53e9('0x69'),_0x1d9906[_0x53e9('0x14')][_0x2cf907]['queue'],'originated:\x20',JSON[_0x53e9('0x6a')](_0x1d9906[_0x53e9('0x12')][_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6b')]]['originated']),'pTalking:\x20',JSON[_0x53e9('0x6a')](_0x1d9906['campaignsPreview'][_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]][_0x53e9('0x56')]),JSON[_0x53e9('0x6a')](_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6c')]),JSON[_0x53e9('0x6a')](_[_0x53e9('0x6d')](_0x1d9906['actions'][_0x2cf907],[_0x53e9('0x6e'),_0x53e9('0x6f'),_0x53e9('0x70'),_0x53e9('0x71')])));return ami[_0x53e9('0x72')]({'action':_0x53e9('0x73'),'channel':_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x74')]})[_0x53e9('0x75')](function(_0x1cadd1){if(_0x1cadd1[_0x53e9('0x4b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1d9906[_0x53e9('0x14')][_0x2cf907]){ut[_0x53e9('0x76')](_0x1d9906[_0x53e9('0x12')][_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]],_0x53e9('0x77'));if(_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6c')]===!![]){ut[_0x53e9('0x78')](_0x1d9906[_0x53e9('0x12')][_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]],_0x53e9('0x77'));ut[_0x53e9('0x79')](_0x53e9('0x7a')+_0x2cf907,_0x1d9906[_0x53e9('0x14')][_0x2cf907][_0x53e9('0x6b')]);}ut[_0x53e9('0x79')](_0x53e9('0x7b')+_0x2cf907,_0x1d9906['actions'][_0x2cf907][_0x53e9('0x6b')]);delete _0x1d9906[_0x53e9('0x14')][_0x2cf907];}},0x2328);}});}});};Preview[_0x53e9('0xf')]['clearZombieChannels']=function(){var _0x44f05c=this;loggerAction[_0x53e9('0x68')](_0x53e9('0x7c'),_[_0x53e9('0x7d')](this[_0x53e9('0x14')]));for(var _0x1465d8 in this['actions']){if(_0x44f05c[_0x53e9('0x14')][_0x53e9('0x61')](_0x1465d8)){_0x44f05c[_0x53e9('0x65')](_0x1465d8);}}};Preview[_0x53e9('0xf')][_0x53e9('0x64')]=function(_0x1e7f19){var _0x1c704c=this;rpcDb[_0x53e9('0x7e')](_0x1e7f19['id'],ut[_0x53e9('0x7f')](this[_0x53e9('0x15')]))['then'](function(_0x46b370){if(!_[_0x53e9('0x67')](_0x46b370)){for(var _0x20f44e=0x0;_0x20f44e<_0x46b370[_0x53e9('0x80')];_0x20f44e+=0x1){if(ut['getDiff'](_0x46b370[_0x20f44e][_0x53e9('0x81')])<_0x1e7f19[_0x53e9('0x82')]*0x3c){_0x1c704c[_0x53e9('0x83')](_0x46b370[_0x20f44e]['id'])['then'](ut[_0x53e9('0x84')](_0x53e9('0x85')))[_0x53e9('0x75')](ut['logger2'](_0x53e9('0x85')));}else{var _0x42fc7e=new Action(_0x46b370[_0x20f44e],_0x1e7f19);_0x42fc7e['starttime']=moment()['format'](_0x53e9('0x86'));_0x1e7f19[_0x53e9('0x3f')]+=0x1;ut['logCustomer'](_0x42fc7e,0x17,_0x53e9('0x87'));if(_0x1e7f19['dialRecallInQueue']){rpcDb[_0x53e9('0x88')](ut[_0x53e9('0x89')](_0x46b370[_0x20f44e]));rpcDb[_0x53e9('0x8a')](_0x42fc7e,_0x53e9('0x8b'));}else{ut[_0x53e9('0x8c')](_0x42fc7e,0x16,_0x53e9('0x8d'));rpcDb[_0x53e9('0x8a')](_0x42fc7e,_0x53e9('0x8e'));rpcDb['createCustomerFinal'](_0x42fc7e,_0x53e9('0x8e'));}}}}})[_0x53e9('0x75')](ut[_0x53e9('0x84')](_0x53e9('0x8f')));};Preview[_0x53e9('0xf')][_0x53e9('0x63')]=function(_0x54cbfd){_0x54cbfd[_0x53e9('0x55')]=!![];if(ut['IsNotLoggedIn'](_0x54cbfd[_0x53e9('0x29')])){_0x54cbfd['message']=_0x53e9('0x90');}else if(!ut[_0x53e9('0x91')](_0x54cbfd[_0x53e9('0x92')])){_0x54cbfd[_0x53e9('0x4b')]=_0x53e9('0x93');}else if(!this[_0x53e9('0x94')](_0x54cbfd[_0x53e9('0x50')])){if(!this[_0x53e9('0x94')](_0x54cbfd[_0x53e9('0x95')])){_0x54cbfd[_0x53e9('0x4b')]=_0x53e9('0x96');}else{_0x54cbfd['message']=_0x53e9('0x97');}}else{_0x54cbfd[_0x53e9('0x4b')]='ACTIVE';}emitCampaignPreview(_0x54cbfd);};Preview[_0x53e9('0xf')]['callProgressDetectingCustomer']=function(_0x541da7,_0x389c9c,_0x3b01bc){var _0x51252e=this;var _0x199b46=this[_0x53e9('0x14')][_0x389c9c];var _0xd28d75=this[_0x53e9('0x12')][_0x199b46[_0x53e9('0x6b')]];var _0x19bdbc;if(_0xd28d75){switch(_0x3b01bc){case'1':_0xd28d75[_0x53e9('0x3d')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x0,'NoSuchNumber');rpcDb[_0x53e9('0x8a')](_0x199b46,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut['cloneAction'](_0x199b46,0xf,'Global');rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0x9c'));}else{rpcDb['createCustomerFinal'](_0x199b46,_0x53e9('0x9c'));}delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0x9d')]];break;case _0x53e9('0x9e'):var _0x5a4346=moment()[_0x53e9('0x53')](_0x53e9('0x86'));_0x199b46[_0x53e9('0x9f')]=_0x5a4346;_0x199b46['answertime']=_0x5a4346;_0x199b46[_0x53e9('0x6c')]=!![];_0xd28d75[_0x53e9('0x56')]+=0x1;logger['info'](_0x53e9('0xa0'),_0x199b46[_0x53e9('0xa1')],_0x53e9('0xa2'),_0xd28d75[_0x53e9('0x26')],'pTalking:\x20',_0xd28d75[_0x53e9('0x56')]);ami[_0x53e9('0x25')](_0x53e9('0xa3'),ut['buildObj'](_0x199b46,'connect'));if(_0xd28d75[_0x53e9('0xa4')]){ami[_0x53e9('0x25')](_0x53e9('0xa5'),ut[_0x53e9('0xa6')](_0x199b46));}break;case'16':ami['emit'](_0x53e9('0xa7'),ut['buildObj'](_0x199b46,_0x53e9('0xa8')));emitVoiceQueueChannelRemove(ut[_0x53e9('0xa9')](_0x199b46,'complete'));_0xd28d75[_0x53e9('0x36')]+=0x1;_0xd28d75[_0x53e9('0x2e')]+=0x1;_0xd28d75[_0x53e9('0xaa')]+=0x1;ut[_0x53e9('0x78')](_0xd28d75,_0x53e9('0xab'));_0x199b46[_0x53e9('0x98')]=ut['totalGlobal'](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x4,'Answer');rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xac'));rpcDb['createCustomerFinal'](_0x199b46,_0x53e9('0xad'));rpcDb['crateCustomerReportQueue'](_0x199b46);_0xd28d75[_0x53e9('0x2b')]+=_0x199b46[_0x53e9('0xae')];_0xd28d75['sumBillable']+=_0x199b46[_0x53e9('0xae')];logger['info'](_0x53e9('0xaf'),_0x199b46[_0x53e9('0xa1')],_0x53e9('0xa2'),_0xd28d75['name'],_0x53e9('0xb0'),_0xd28d75[_0x53e9('0x56')]);delete this['actions'][_0x541da7[_0x53e9('0x9d')]];break;case _0x53e9('0xb1'):_0xd28d75[_0x53e9('0x38')]+=0x1;_0x199b46['countbusyretry']+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut['logCustomer'](_0x199b46,0x5,'Busy');rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xb2'));if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut[_0x53e9('0xb3')](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0xb5'));}else{if(_0x199b46[_0x53e9('0xb6')]>=_0xd28d75['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x199b46,_0x53e9('0xb2'));}else{rpcDb[_0x53e9('0xb7')](ut[_0x53e9('0xb8')](_0x199b46,_0x53e9('0xb6'),_0xd28d75['dialBusyRetryFrequency']),_0x199b46['unlockAgent'],_0x199b46['activeContact']);}}break;case'NOANSWER':_0xd28d75[_0x53e9('0x3c')]+=0x1;_0x199b46[_0x53e9('0xb9')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x3,_0x53e9('0xba'));rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xbb'));if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut[_0x53e9('0xb3')](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0xbc'));}else{if(_0x199b46[_0x53e9('0xb9')]>=_0xd28d75[_0x53e9('0xbd')]){rpcDb[_0x53e9('0x9b')](_0x199b46,_0x53e9('0xbb'));}else{rpcDb['rescheduleContact'](ut[_0x53e9('0xb8')](_0x199b46,'countnoanswerretry',_0xd28d75['dialNoAnswerRetryFrequency']),_0x199b46[_0x53e9('0xbe')],_0x199b46[_0x53e9('0xbf')]);}}break;case _0x53e9('0xc0'):_0xd28d75[_0x53e9('0x39')]+=0x1;_0x199b46[_0x53e9('0xc1')]+=0x1;_0x199b46['countglobal']=ut['totalGlobal'](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x8,'Congestion');rpcDb[_0x53e9('0x8a')](_0x199b46,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75[_0x53e9('0x9a')]){_0x19bdbc=ut['cloneAction'](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb['createCustomerFinal'](_0x19bdbc,_0x53e9('0xc2'));}else{if(_0x199b46[_0x53e9('0xc1')]>=_0xd28d75['dialCongestionMaxRetry']){rpcDb[_0x53e9('0x9b')](_0x199b46,_0x53e9('0xc3'));}else{rpcDb[_0x53e9('0xb7')](ut['scheduledAt'](_0x199b46,_0x53e9('0xc1'),_0xd28d75[_0x53e9('0xc4')]),_0x199b46[_0x53e9('0xbe')],_0x199b46['activeContact']);}}break;case'CANCEL':_0xd28d75[_0x53e9('0x40')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut['totalGlobal'](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0x14,_0x53e9('0xc5'));rpcDb[_0x53e9('0x8a')](_0x199b46,_0x53e9('0xc6'));if(_0x199b46[_0x53e9('0xbe')]){rpcDb[_0x53e9('0xc7')](_0x199b46[_0x53e9('0xc8')]);}if(_0x199b46['activeContact']){rpcDb['disableContact'](_0x199b46[_0x53e9('0xc8')]);}break;default:if(_0x199b46['dialAnswer']){ut[_0x53e9('0x78')](_0xd28d75,_0x53e9('0xc9'));ut[_0x53e9('0x79')](_0x53e9('0xca')+_0xd28d75[_0x53e9('0x26')],_0x541da7);}_0xd28d75[_0x53e9('0xcb')]+=0x1;_0x199b46[_0x53e9('0x98')]=ut[_0x53e9('0x99')](_0x199b46);ut[_0x53e9('0x8c')](_0x199b46,0xc,_0x541da7[_0x53e9('0xcc')]||_0x541da7[_0x53e9('0xcd')]);rpcDb[_0x53e9('0x8a')](_0x199b46,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x53e9('0x99')](_0x199b46)>=_0xd28d75['dialGlobalMaxRetry']){_0x19bdbc=ut[_0x53e9('0xb3')](_0x199b46,0xf,_0x53e9('0xb4'));rpcDb[_0x53e9('0x9b')](_0x19bdbc,_0x53e9('0xce'));}else{rpcDb[_0x53e9('0x9b')](_0x199b46,_0x53e9('0xce'));}delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0x9d')]];}if(!(_0x199b46['dialAnswer']&&_0x3b01bc==='16')){ut[_0x53e9('0x76')](_0xd28d75,'[callProgressDetectingCustomer]');logger[_0x53e9('0x68')]('[originated][decrement][callProgressDetectingCustomer]',_0x199b46['uniqueid'],_0x53e9('0xa2'),_0xd28d75[_0x53e9('0x26')],'originated:\x20',_0xd28d75[_0x53e9('0x4c')]);}if(_0x3b01bc!==_0x53e9('0x9e')){delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0x9d')]];delete this[_0x53e9('0x14')][_0x541da7[_0x53e9('0xcf')]];}}};Preview[_0x53e9('0xf')][_0x53e9('0xd0')]=function(_0x4c3796,_0x1935e7,_0x2c2905){if(_[_0x53e9('0xd1')](_0x1935e7)&&_0x53e9('0xd2')!==typeof _0x1935e7){return;}if(_['isUndefined'](_0x2c2905)&&_0x53e9('0xd2')!==typeof _0x2c2905){return;}switch(_0x2c2905[_0x53e9('0xd3')]){case'0':ut['logAgent'](_0x4c3796,0x0,_0x53e9('0xd4'));rpcDb[_0x53e9('0xd5')](_0x4c3796,_0x53e9('0xd6'));break;case'3':ut[_0x53e9('0xd7')](_0x4c3796,0x3,_0x53e9('0xba'));rpcDb[_0x53e9('0xd5')](_0x4c3796,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x53e9('0xd7')](_0x4c3796,0x5,_0x53e9('0xd8'));rpcDb[_0x53e9('0xd5')](_0x4c3796,_0x53e9('0xd9'));break;case'8':ut[_0x53e9('0xd7')](_0x4c3796,0x8,'Congestion');rpcDb['createAgentHistory'](_0x4c3796,_0x53e9('0xda'));break;case'22':ut[_0x53e9('0xd7')](_0x4c3796,0x16,_0x53e9('0xdb'));rpcDb[_0x53e9('0xd5')](_0x4c3796,_0x53e9('0xdc'));break;default:ut[_0x53e9('0xd7')](_0x4c3796,0xc,_0x2c2905['reason']);rpcDb[_0x53e9('0xd5')](_0x4c3796,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x1935e7,_0x53e9('0xdd'));logger[_0x53e9('0x68')](_0x53e9('0xde'),_0x4c3796['uniqueid'],'\x20Queue',_0x1935e7[_0x53e9('0x26')],_0x53e9('0xdf'),_0x1935e7[_0x53e9('0x4c')]);delete this[_0x53e9('0x14')][_0x4c3796[_0x53e9('0xa1')]];};Preview['prototype'][_0x53e9('0xe0')]=function(_0xa3d92d,_0x4f49e5,_0x1eaf64,_0x41b882,_0x375952){var _0x469383=this;return new BPromise(function(_0x2c49b4,_0x5a6298){if(_[_0x53e9('0x67')](_0x4f49e5)||_[_0x53e9('0x67')](_0x4f49e5[_0x53e9('0xe1')])||_[_0x53e9('0x67')](_0x4f49e5[_0x53e9('0xe1')][_0x53e9('0xe2')])||_[_0x53e9('0x67')](_0x4f49e5['VoiceQueueId'])){_0x5a6298(ut[_0x53e9('0x4b')](_0x53e9('0xe3'),_0x41b882,_0x375952));return;}var _0x1e01ec=uuid['v4']();var _0x575867=_0x469383[_0x53e9('0x12')][_0x4f49e5[_0x53e9('0x69')][_0x53e9('0x26')]];var _0x19fc49=_0x1eaf64?_0x469383[_0x53e9('0x15')][_0x1eaf64]['id']:undefined;_0x469383['actions'][_0x1e01ec]=new Action(_0x4f49e5,_0x575867,_0x1e01ec,_0x1eaf64,_0x19fc49);var _0x526a07=_0x469383['actions'][_0x1e01ec];_0x526a07['unlockAgent']=_0x41b882;_0x526a07['activeContact']=_0x375952;_0x526a07['lookAgent']=_0x1eaf64;if(_[_0x53e9('0xe4')](_0xa3d92d)){_0x469383[_0x53e9('0xe5')](_0x526a07,_0x575867,_0x4f49e5,_0x1eaf64)[_0x53e9('0xe6')](function(_0x5deba4){logger[_0x53e9('0x68')](_0x53e9('0xe7'),_0x53e9('0xe8')+_0x526a07[_0x53e9('0x6b')]+'\x20IdHopper:\x20'+_0x526a07['idContact'],JSON[_0x53e9('0x6a')](_0x5deba4));ami['emit'](_0x53e9('0xe9'),ut['buildObj'](_0x526a07,'called'));_0x2c49b4(ut[_0x53e9('0x4b')](_0x53e9('0xea')));})[_0x53e9('0x75')](function(_0x7d85c5){ut[_0x53e9('0x57')](_0x53e9('0xeb'),_0x7d85c5);_0x5a6298(ut[_0x53e9('0x4b')]('Call\x20failed',_0x41b882,_0x375952));});}else{_0x575867[_0x53e9('0x37')]+=0x1;ut[_0x53e9('0xec')](_0x526a07);rpcDb[_0x53e9('0xed')](_0x526a07,_0x53e9('0xee'));delete _0x469383[_0x53e9('0x14')][_0x1e01ec];_0x5a6298(ut[_0x53e9('0x4b')](_0x53e9('0xef'),_0x41b882,_0x375952));}});};Preview['prototype'][_0x53e9('0x94')]=function(_0x3a61ec){return!_['isNil'](_0x3a61ec)&&!_['isNil'](_0x3a61ec['name'])&&!_[_0x53e9('0x67')](_0x3a61ec[_0x53e9('0xf0')])&&_0x3a61ec[_0x53e9('0xf0')]&&!_[_0x53e9('0x67')](this[_0x53e9('0x13')][util[_0x53e9('0x53')](_0x53e9('0xf1'),_0x3a61ec[_0x53e9('0x26')])])&&!_[_0x53e9('0x67')](this['trunks'][util[_0x53e9('0x53')](_0x53e9('0xf1'),_0x3a61ec[_0x53e9('0x26')])][_0x53e9('0x73')])&&(this[_0x53e9('0x13')][util[_0x53e9('0x53')](_0x53e9('0xf1'),_0x3a61ec[_0x53e9('0x26')])][_0x53e9('0x73')]===_0x53e9('0xf2')||this[_0x53e9('0x13')][util['format']('SIP/%s',_0x3a61ec[_0x53e9('0x26')])][_0x53e9('0x73')]===_0x53e9('0xf3'));};Preview[_0x53e9('0xf')][_0x53e9('0x83')]=function(_0x50c20c,_0x162578){var _0x80678f=this;return new BPromise(function(_0x25c33d,_0x10be0a){_0x80678f[_0x53e9('0xf4')](_0x50c20c,_0x162578)[_0x53e9('0xe6')](function(_0x5ef506){_0x25c33d(_[_0x53e9('0x6d')](_0x5ef506,[_0x53e9('0x4b')]));})[_0x53e9('0x75')](function(_0x3748b8){if(_0x3748b8[_0x53e9('0xf5')]){rpcDb['unlockContact'](_0x50c20c);}if(_0x3748b8['active']){rpcDb[_0x53e9('0xf6')](_0x50c20c);}_0x10be0a(_[_0x53e9('0x6d')](_0x3748b8,[_0x53e9('0x4b')]));});});};Preview[_0x53e9('0xf')][_0x53e9('0xf4')]=function(_0x1d127f,_0x85f774){var _0x178c06=this;return new BPromise(function(_0x4e8ad1,_0x1d9816){var _0x4bc1ab,_0x493588;rpcDb[_0x53e9('0xf7')](_0x1d127f)[_0x53e9('0xe6')](function(_0x31c256){if(!_['isNil'](_0x31c256[0x0])){_0x493588=_0x31c256[0x0][_0x53e9('0xf8')]?![]:!![];_0x4bc1ab=_0x31c256[0x0]['recallme']?!![]:![];_0x4bc1ab=_0x85f774?!![]:_0x4bc1ab;}var _0x55f773=_0x178c06[_0x53e9('0xf9')](_0x31c256);if(_0x55f773[_0x53e9('0xfa')]){rpcDb[_0x53e9('0xfb')](_['pick'](_0x31c256[0x0],[_0x53e9('0x70'),'Contact.phone']))[_0x53e9('0xe6')](function(_0x38f81d){_0x178c06[_0x53e9('0xe0')](_0x38f81d,_0x31c256[0x0],_0x85f774,_0x493588,_0x4bc1ab)[_0x53e9('0xe6')](function(_0x3092db){_0x4e8ad1(_0x3092db);})[_0x53e9('0x75')](function(_0x3f08ab){_0x1d9816(_0x3f08ab);});})[_0x53e9('0x75')](function(_0x3e9107){ut['logger'](_0x53e9('0xfc'),_0x3e9107);_0x1d9816(ut[_0x53e9('0x4b')](_0x53e9('0xfd'),_0x493588,_0x4bc1ab));});}else{_0x1d9816(ut[_0x53e9('0x4b')](_0x55f773[_0x53e9('0x4b')],_0x493588,_0x4bc1ab));}})[_0x53e9('0x75')](function(_0x2ccc20){ut[_0x53e9('0x57')]('[Preview][getContactPreview]',_0x2ccc20);_0x1d9816(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype']['validateContact']=function(_0x4f938a){if(_['isNil'](_0x4f938a)||_['isEmpty'](_0x4f938a)||!_[_0x53e9('0x67')](_0x4f938a[0x0][_0x53e9('0xfe')])&&_[_0x53e9('0x67')](_0x4f938a[0x0]['Agent']['name'])){ut[_0x53e9('0x57')](_0x53e9('0xff'),_0x4f938a);return{'isValid':![],'message':_0x53e9('0x100')};}var _0x25a58b=this[_0x53e9('0x12')][_0x4f938a[0x0][_0x53e9('0x69')][_0x53e9('0x26')]];_0x25a58b[_0x53e9('0x4b')]=_0x53e9('0x97');if(_[_0x53e9('0x67')](_0x25a58b)){ut[_0x53e9('0x57')](_0x53e9('0x101'),_0x25a58b);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x53e9('0x94')](_0x25a58b['Trunk'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20'+_0x25a58b['name']+_0x53e9('0x102'));if(!this[_0x53e9('0x94')](_0x25a58b['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x25a58b[_0x53e9('0x26')]+_0x53e9('0x103'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut['isActive'](_0x25a58b[_0x53e9('0x92')])){ut[_0x53e9('0x57')](_0x53e9('0x104'),_0x25a58b['name']+_0x53e9('0x105'));return{'isValid':![],'message':_0x53e9('0x106')+_0x25a58b[_0x53e9('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x53e9('0x107')};};Preview[_0x53e9('0xf')][_0x53e9('0xe5')]=function(_0x3c7ffb,_0x94c833,_0x3998e5,_0x4cbe4b){var _0x4ff7f2=this;return new BPromise(function(_0x4c8ca4,_0x111bad){var _0x5c98e5=_0x3c7ffb['uniqueid'];var _0x5d6f34=_0x4ff7f2[_0x53e9('0x94')](_0x94c833[_0x53e9('0x50')])?util['format']('SIP/%s/%s%s',_0x94c833[_0x53e9('0x50')][_0x53e9('0x26')],_['isNil'](_0x94c833[_0x53e9('0x34')])?'':_0x94c833['dialPrefix']['trim']()||'',_0x94c833[_0x53e9('0x108')]>0x0?_0x3998e5[_0x53e9('0xe1')][_0x53e9('0xe2')][_0x53e9('0x109')](_0x94c833['dialCutDigit']):_0x3998e5['Contact'][_0x53e9('0xe2')]):util[_0x53e9('0x53')](_0x53e9('0x10a'),_[_0x53e9('0x67')](_0x94c833[_0x53e9('0x95')])?_0x94c833[_0x53e9('0x50')][_0x53e9('0x26')]:_0x94c833[_0x53e9('0x95')]['name'],_[_0x53e9('0x67')](_0x94c833['dialPrefix'])?'':_0x94c833['dialPrefix']['trim']()||'',_0x94c833[_0x53e9('0x108')]>0x0?_0x3998e5[_0x53e9('0xe1')]['phone'][_0x53e9('0x109')](_0x94c833[_0x53e9('0x108')]):_0x3998e5['Contact'][_0x53e9('0xe2')]);var _0xd3bbd3=_0x4ff7f2['isTrunkReachable'](_0x94c833[_0x53e9('0x50')])?ut[_0x53e9('0x10b')](_0x94c833['Trunk']['callerid'],_0x94c833[_0x53e9('0x32')],_0x94c833['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x53e9('0x10c')](_0x94c833[_0x53e9('0x33')],_0x94c833[_0x53e9('0x10d')]):_0x94c833[_0x53e9('0x33')]):ut['getCallerId'](_[_0x53e9('0x67')](_0x94c833[_0x53e9('0x95')])?_0x94c833[_0x53e9('0x50')]['callerid']:_0x94c833[_0x53e9('0x95')][_0x53e9('0x10e')],_0x94c833['dialOriginateCallerIdName'],_0x94c833[_0x53e9('0x10d')]>0x0?ut[_0x53e9('0x10c')](_0x94c833[_0x53e9('0x33')],_0x94c833[_0x53e9('0x10d')]):_0x94c833[_0x53e9('0x33')]);if(_0xd3bbd3){_0x3c7ffb[_0x53e9('0x10f')]=ut[_0x53e9('0x110')](_0xd3bbd3);_0x3c7ffb[_0x53e9('0x111')]=ut[_0x53e9('0x112')](_0xd3bbd3);}var _0x5ca30d=ut[_0x53e9('0x113')](_0x94c833,_0x3998e5,_0x5d6f34,_0xd3bbd3,_0x5c98e5,_0x3c7ffb);_[_0x53e9('0x114')](_0x3c7ffb,ut[_0x53e9('0x115')](_0x5ca30d));_0x3c7ffb[_0x53e9('0x116')]=moment()[_0x53e9('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x53e9('0x72')](ut[_0x53e9('0x117')](_0x3c7ffb,_0x94c833,_0x5ca30d,_0x3c7ffb[_0x53e9('0xbf')],_0x4cbe4b))[_0x53e9('0xe6')](function(_0x468142){_0x94c833[_0x53e9('0x4c')]+=0x1;logger['info'](_0x53e9('0x118'),_0x5c98e5,_0x53e9('0xa2'),_0x94c833[_0x53e9('0x26')],_0x53e9('0xdf'),_0x94c833[_0x53e9('0x4c')]);_0x4c8ca4(_0x468142);})[_0x53e9('0x75')](function(_0x26d2b3){ut[_0x53e9('0xd7')](_0x3c7ffb,0xe,'OriginateError');rpcDb['createAgentHistory'](_0x3c7ffb,_0x53e9('0x119'));_0x111bad(_0x26d2b3);});});};Preview[_0x53e9('0xf')][_0x53e9('0x11a')]=function(_0x5a398d){if(this['actions'][_0x5a398d[_0x53e9('0x9d')]]){this[_0x53e9('0x14')][_0x5a398d[_0x53e9('0x9d')]][_0x53e9('0x74')]=_0x5a398d[_0x53e9('0x74')];}};Preview['prototype'][_0x53e9('0x11b')]=function(_0x5b3766){var _0xcf75ac=this;var _0x2c2f71=this[_0x53e9('0x14')][_0x5b3766[_0x53e9('0x11c')]];if(_0x2c2f71){if(_0x2c2f71[_0x53e9('0x11d')]&&this['agents'][_0x2c2f71[_0x53e9('0x11d')]]){ut[_0x53e9('0x11e')](_0x2c2f71,this[_0x53e9('0x15')][_0x2c2f71['lookAgent']]['name'],this[_0x53e9('0x15')][_0x2c2f71['lookAgent']]['id']);}var _0x22af54=_[_0x53e9('0x11f')](_0x2c2f71);_0x22af54[_0x53e9('0x9f')]=moment()['format'](_0x53e9('0x86'));var _0xb5dcf9=_0xcf75ac['campaignsPreview'][_0x2c2f71['queue']];if(ut[_0x53e9('0x120')](_0x5b3766[_0x53e9('0x121')])){if(_0x2c2f71[_0x53e9('0xbe')]){rpcDb['unlockContact'](_0x2c2f71[_0x53e9('0xc8')]);}if(_0x2c2f71[_0x53e9('0xbf')]){rpcDb[_0x53e9('0xf6')](_0x2c2f71[_0x53e9('0xc8')]);}ami[_0x53e9('0x25')](_0x53e9('0x122'),ut[_0x53e9('0xa9')](_0x2c2f71,_0x53e9('0x123')));this[_0x53e9('0xd0')](_0x22af54,_0xb5dcf9,_0x5b3766);}else{_0x2c2f71[_0x53e9('0x116')]=moment()[_0x53e9('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x53e9('0xd7')](_0x22af54,0x4,_0x53e9('0x124'));rpcDb['createAgentHistory'](_0x22af54,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype'][_0x53e9('0x125')]=function(_0x31b70e){var _0x274a8f=this;var _0xb5346=this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]];var _0x200d8c;if(_0xb5346){_0x200d8c=this['campaignsPreview'][_0xb5346[_0x53e9('0x6b')]];logger['info'](_0x53e9('0x126'),_0x31b70e[_0x53e9('0x9d')],'\x20Queue',_0x200d8c['name'],_0x53e9('0xb0'),_0x200d8c[_0x53e9('0x56')]);}if(this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]]&&_0x31b70e[_0x53e9('0x9d')]!==_0x31b70e['uniqueid']){if(_0x31b70e[_0x53e9('0x127')]==='16'&&this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]][_0x53e9('0x6c')]){this[_0x53e9('0x128')](_0x31b70e,_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')]);}else if(this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]][_0x53e9('0x6c')]){logger[_0x53e9('0x68')](_0x53e9('0x129'),_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')],_0x53e9('0xa2'),_0x200d8c['name'],_0x53e9('0xb0'),_0x200d8c[_0x53e9('0x56')]);this['callProgressDetectingCustomer'](_0x31b70e,_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')]);}}else if(_0xb5346&&_[_0x53e9('0x67')](_0xb5346[_0x53e9('0x12a')])&&_0x200d8c['dialQueueProject']&&_0x31b70e[_0x53e9('0x9d')]===_0x31b70e[_0x53e9('0xa1')]&&_[_0x53e9('0x67')](_0x31b70e[_0x53e9('0xd3')])&&_0x31b70e[_0x53e9('0x127')]==='16'&&_0x31b70e[_0x53e9('0x12b')]==='6'&&_['isUndefined'](_0xb5346[_0x53e9('0x12c')])){if(_0xb5346[_0x53e9('0xbe')]){rpcDb[_0x53e9('0xc7')](_0xb5346[_0x53e9('0xc8')]);}if(_0xb5346[_0x53e9('0xbf')]){rpcDb[_0x53e9('0xf6')](_0xb5346['idContact']);}_0x31b70e['reason']='22';this[_0x53e9('0xd0')](_0xb5346,_0x200d8c,_0x31b70e);}else if(_0xb5346&&_0xb5346[_0x53e9('0x12c')]){if(_0x31b70e['cause']==='16'&&this[_0x53e9('0x14')][_0x31b70e[_0x53e9('0x9d')]][_0x53e9('0x6c')]){logger[_0x53e9('0x68')]('[syncHangup][talking][transfer]',_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')],_0x53e9('0xa2'),_0x200d8c[_0x53e9('0x26')],'pTalking:\x20',_0x200d8c[_0x53e9('0x56')]);this['callProgressDetectingCustomer'](_0x31b70e,_0x31b70e['linkedid'],_0x31b70e[_0x53e9('0x127')]);}else if(this[_0x53e9('0x14')][_0x31b70e['linkedid']][_0x53e9('0x6c')]){logger[_0x53e9('0x68')](_0x53e9('0x129'),_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')],_0x53e9('0xa2'),_0x200d8c[_0x53e9('0x26')],_0x53e9('0xb0'),_0x200d8c['pTalking']);this[_0x53e9('0x128')](_0x31b70e,_0x31b70e[_0x53e9('0x9d')],_0x31b70e[_0x53e9('0x127')]);}}};Preview[_0x53e9('0xf')][_0x53e9('0x1d')]=function(_0x31757a){if(this[_0x53e9('0x14')][_0x31757a['destlinkedid']]&&_0x31757a[_0x53e9('0xcf')]!==_0x31757a[_0x53e9('0x12d')]){this[_0x53e9('0x128')](_0x31757a,_0x31757a[_0x53e9('0xcf')],_0x31757a['dialstatus']);}};Preview[_0x53e9('0xf')][_0x53e9('0x1b')]=function(_0x47406a){if(this['actions'][_0x47406a['linkedid']]&&_0x47406a['linkedid']!==_0x47406a[_0x53e9('0xa1')]&&!this[_0x53e9('0x14')][_0x47406a[_0x53e9('0x9d')]][_0x53e9('0x6c')]){if(_0x47406a['cause']==='1'){this['callProgressDetectingCustomer'](_0x47406a,_0x47406a[_0x53e9('0x9d')],_0x47406a['cause']);}}};Preview['prototype'][_0x53e9('0x12e')]=function(_0x163337,_0x4dc763,_0x232ab0){if(this[_0x53e9('0x14')][_0x163337]){if(_[_0x53e9('0x67')](this[_0x53e9('0x14')][_0x163337][_0x53e9('0x12f')])){this[_0x53e9('0x14')][_0x163337][_0x53e9('0x12f')]={};}this['actions'][_0x163337][_0x53e9('0x12f')][_0x4dc763]=_0x232ab0;}};Preview[_0x53e9('0xf')][_0x53e9('0x130')]=function(_0x33c68c){try{if(!_[_0x53e9('0x67')](_0x33c68c)){if(ut[_0x53e9('0x131')](_[_0x53e9('0x132')](_0x33c68c[_0x53e9('0x133')])[0x0])){this[_0x53e9('0x12e')](_0x33c68c['uniqueid'],_[_0x53e9('0x132')](_0x33c68c[_0x53e9('0x133')])[0x0],_0x33c68c[_0x53e9('0x134')]);}}}catch(_0x1ceca5){logger[_0x53e9('0x135')](_0x53e9('0x136'),util[_0x53e9('0x137')](_0x1ceca5,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x53e9('0x21')]=function(_0x5d50a1){if(_0x5d50a1){if(this[_0x53e9('0x14')][_0x5d50a1[_0x53e9('0x138')]]){this['actions'][_0x5d50a1['transfertargetlinkedid']][_0x53e9('0x12c')]=!![];}}};Preview[_0x53e9('0xf')][_0x53e9('0x23')]=function(_0xa945a5){if(_0xa945a5){if(this[_0x53e9('0x14')][_0xa945a5[_0x53e9('0x139')]]){this[_0x53e9('0x14')][_0xa945a5[_0x53e9('0x139')]][_0x53e9('0x12c')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 9d1a9d8..d7be612 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 _0x36ab=['util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','lastAssignedTo','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x36ab,0x196));var _0xb36a=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x36ab[_0x40bffc];return _0x3007e9;};'use strict';var util=require(_0xb36a('0x0'));var BPromise=require(_0xb36a('0x1'));var logger=require(_0xb36a('0x2'))(_0xb36a('0x3'));var _=require(_0xb36a('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xb36a('0x5'));var cmHopperHistory=require(_0xb36a('0x6'));var cmHopperBlack=require(_0xb36a('0x7'));var voiceQueueRt=require(_0xb36a('0x8'));var agentReportPreview=require(_0xb36a('0x9'));var voiceQueueReport=require(_0xb36a('0xa'));function loggerCatch(_0x506a23){return function(_0x14ad98){logger[_0xb36a('0xb')](_0x506a23,util['inspect'](_0x14ad98,{'showHidden':![],'depth':null}));};}function create(_0xc0202d){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](cmHopperHistory[_0xb36a('0xe')](_0xc0202d))[_0xb36a('0xf')](loggerCatch(_0xb36a('0x10')));}function createAgent(_0x16aec8){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](agentReportPreview[_0xb36a('0xe')](_0x16aec8))['catch'](loggerCatch(_0xb36a('0x10')));}function moveContact(_0x468623){return BPromise[_0xb36a('0xc')]()['then'](cmHopper[_0xb36a('0x11')](_0x468623,!![]))['catch'](loggerCatch(_0xb36a('0x12')));}exports['checkIsBlackList']=function(_0xa2cf4){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](cmHopperBlack[_0xb36a('0x13')](_0xa2cf4))['catch'](loggerCatch(_0xb36a('0x14')));};exports[_0xb36a('0x15')]=function(_0x5ee024){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](cmHopper[_0xb36a('0x15')](_0x5ee024))[_0xb36a('0xf')](loggerCatch(_0xb36a('0x16')));};exports[_0xb36a('0xe')]=function(_0x1f21ac,_0x273bfb){create(_0x1f21ac)[_0xb36a('0xf')](loggerCatch(_0x273bfb));moveContact(_0x1f21ac)[_0xb36a('0xf')](loggerCatch(_0x273bfb));};exports['createAgentHistory']=function(_0x559c8c,_0x17725c){createAgent(_0x559c8c)[_0xb36a('0xf')](loggerCatch(_0x17725c));};exports[_0xb36a('0x17')]=function(_0x1c7356,_0x598ee7){create(_0x1c7356)[_0xb36a('0xf')](loggerCatch(_0x598ee7));};exports[_0xb36a('0x18')]=function(_0x447078,_0x1ecbf2){moveContact(_0x447078)[_0xb36a('0xf')](loggerCatch(_0x1ecbf2));};exports[_0xb36a('0x19')]=function(_0x585946,_0x576af7,_0x27de86){if(_0x576af7){_0x585946[_0xb36a('0x1a')]=null;}if(_0x27de86){_0x585946[_0xb36a('0x1b')]=![];}return BPromise[_0xb36a('0xc')]()['then'](cmHopper[_0xb36a('0x19')](_0x585946))[_0xb36a('0xf')](loggerCatch(_0xb36a('0x1c')));};exports[_0xb36a('0x1d')]=function(_0x2a0195){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](cmHopper['countReScheduled'](_0x2a0195))[_0xb36a('0xf')](loggerCatch(_0xb36a('0x1e')));};exports[_0xb36a('0x1f')]=function(_0x52976d){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](cmHopper[_0xb36a('0x1f')]({'UserId':null},_0x52976d,0x1))['catch'](loggerCatch(_0xb36a('0x20')));};exports[_0xb36a('0x21')]=function(_0x4664af){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](cmHopper[_0xb36a('0x1f')]({'active':![]},_0x4664af,0x1))[_0xb36a('0xf')](loggerCatch(_0xb36a('0x22')));};exports[_0xb36a('0x23')]=function(_0x47e4e9){var _0x42df38={};_0x42df38[_0xb36a('0x24')]=_0x47e4e9[_0xb36a('0x24')];_0x42df38[_0xb36a('0x25')]=_0x47e4e9[_0xb36a('0x25')];_0x42df38[_0xb36a('0x26')]=_0x47e4e9['calleridnum'];_0x42df38[_0xb36a('0x27')]=_0x47e4e9[_0xb36a('0x27')];_0x42df38[_0xb36a('0x28')]=_0x47e4e9[_0xb36a('0x28')];_0x42df38[_0xb36a('0x29')]=_0x47e4e9[_0xb36a('0x2a')];_0x42df38[_0xb36a('0x2b')]=_0x47e4e9['answertime'];_0x42df38['queuecallercomplete']=0x1;_0x42df38[_0xb36a('0x2c')]=_0x47e4e9[_0xb36a('0x2d')];_0x42df38[_0xb36a('0x2e')]=_0x47e4e9[_0xb36a('0x2f')];_0x42df38[_0xb36a('0x30')]=_0xb36a('0x31');_0x42df38[_0xb36a('0x32')]='xcally-motion-preview';_0x42df38[_0xb36a('0x33')]=0x0;_0x42df38['assigned']=0x1;_0x42df38[_0xb36a('0x34')]=_0x47e4e9[_0xb36a('0x2f')];_0x42df38['queuecallerexitreason']='COMPLETED';return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](voiceQueueReport[_0xb36a('0x35')](_0x42df38))[_0xb36a('0xf')](loggerCatch(_0xb36a('0x36')));};exports[_0xb36a('0x37')]=function(_0x343c11,_0xa6267c){return BPromise[_0xb36a('0xc')]()['then'](cmHopper[_0xb36a('0x37')](_0x343c11,_0xa6267c))[_0xb36a('0xf')](loggerCatch(_0xb36a('0x38')));};exports[_0xb36a('0x39')]=function(_0x2af566){return BPromise[_0xb36a('0xc')]()[_0xb36a('0xd')](cmHopper['rescheduleContact'](_0x2af566,!![],!![]))[_0xb36a('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x7fb0=['create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED'];(function(_0x4ed55c,_0x575fcc){var _0x409cfd=function(_0x27ffa3){while(--_0x27ffa3){_0x4ed55c['push'](_0x4ed55c['shift']());}};_0x409cfd(++_0x575fcc);}(_0x7fb0,0x155));var _0x07fb=function(_0x1ecd2d,_0x3e247a){_0x1ecd2d=_0x1ecd2d-0x0;var _0x17aba7=_0x7fb0[_0x1ecd2d];return _0x17aba7;};'use strict';var util=require('util');var BPromise=require(_0x07fb('0x0'));var logger=require(_0x07fb('0x1'))(_0x07fb('0x2'));var _=require('lodash');var cmHopper=require(_0x07fb('0x3'));var cmHopperFinal=require(_0x07fb('0x4'));var cmHopperHistory=require(_0x07fb('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x07fb('0x6'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x07fb('0x7'));function loggerCatch(_0x5862c4){return function(_0x4d8433){logger[_0x07fb('0x8')](_0x5862c4,util[_0x07fb('0x9')](_0x4d8433,{'showHidden':![],'depth':null}));};}function create(_0x4d3e7f){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopperHistory[_0x07fb('0xc')](_0x4d3e7f))[_0x07fb('0xd')](loggerCatch(_0x07fb('0xe')));}function createAgent(_0x3bae46){return BPromise[_0x07fb('0xa')]()['then'](agentReportPreview[_0x07fb('0xc')](_0x3bae46))['catch'](loggerCatch(_0x07fb('0xe')));}function moveContact(_0x27bd5d){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper[_0x07fb('0xf')](_0x27bd5d,!![]))['catch'](loggerCatch(_0x07fb('0x10')));}exports[_0x07fb('0x11')]=function(_0x3368b3){return BPromise['resolve']()['then'](cmHopperBlack[_0x07fb('0x11')](_0x3368b3))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x12')));};exports['getContactPreview']=function(_0x2c4c56){return BPromise[_0x07fb('0xa')]()['then'](cmHopper[_0x07fb('0x13')](_0x2c4c56))[_0x07fb('0xd')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x5bdc3f,_0x42b2ec){create(_0x5bdc3f)[_0x07fb('0xd')](loggerCatch(_0x42b2ec));moveContact(_0x5bdc3f)[_0x07fb('0xd')](loggerCatch(_0x42b2ec));};exports['createAgentHistory']=function(_0x202328,_0xbae940){createAgent(_0x202328)[_0x07fb('0xd')](loggerCatch(_0xbae940));};exports[_0x07fb('0x14')]=function(_0x94565,_0x5195f4){create(_0x94565)['catch'](loggerCatch(_0x5195f4));};exports[_0x07fb('0x15')]=function(_0x1059b8,_0x413298){moveContact(_0x1059b8)[_0x07fb('0xd')](loggerCatch(_0x413298));};exports['rescheduleContact']=function(_0x3b57e3,_0x227c92,_0x4210ab){if(_0x227c92){_0x3b57e3[_0x07fb('0x16')]=null;}if(_0x4210ab){_0x3b57e3['active']=![];}return BPromise[_0x07fb('0xa')]()['then'](cmHopper[_0x07fb('0x17')](_0x3b57e3))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x18')));};exports[_0x07fb('0x19')]=function(_0x54e27){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper[_0x07fb('0x19')](_0x54e27))['catch'](loggerCatch('[countReScheduled]\x20'));};exports[_0x07fb('0x1a')]=function(_0x536fbb){return BPromise['resolve']()['then'](cmHopper[_0x07fb('0x1a')]({'UserId':null},_0x536fbb,0x1))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x1b')));};exports[_0x07fb('0x1c')]=function(_0x17755f){return BPromise['resolve']()[_0x07fb('0xb')](cmHopper[_0x07fb('0x1a')]({'active':![]},_0x17755f,0x1))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x1d')));};exports[_0x07fb('0x1e')]=function(_0xc11070){var _0x5aac44={};_0x5aac44[_0x07fb('0x1f')]=_0xc11070[_0x07fb('0x1f')];_0x5aac44['uniqueid']=_0xc11070[_0x07fb('0x20')];_0x5aac44['calleridnum']=_0xc11070[_0x07fb('0x21')];_0x5aac44[_0x07fb('0x22')]=_0xc11070[_0x07fb('0x22')];_0x5aac44['queue']=_0xc11070[_0x07fb('0x23')];_0x5aac44[_0x07fb('0x24')]=_0xc11070[_0x07fb('0x25')];_0x5aac44[_0x07fb('0x26')]=_0xc11070['answertime'];_0x5aac44[_0x07fb('0x27')]=0x1;_0x5aac44['queuecallercompleteAt']=_0xc11070[_0x07fb('0x28')];_0x5aac44[_0x07fb('0x29')]=_0xc11070[_0x07fb('0x2a')];_0x5aac44[_0x07fb('0x2b')]=_0x07fb('0x2c');_0x5aac44[_0x07fb('0x2d')]='xcally-motion-preview';_0x5aac44[_0x07fb('0x2e')]=0x0;_0x5aac44[_0x07fb('0x2f')]=0x1;_0x5aac44[_0x07fb('0x30')]=_0xc11070[_0x07fb('0x2a')];_0x5aac44[_0x07fb('0x31')]=_0x07fb('0x32');return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](voiceQueueReport[_0x07fb('0x33')](_0x5aac44))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x34')));};exports[_0x07fb('0x35')]=function(_0x43f975,_0x5bd80a){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper[_0x07fb('0x35')](_0x43f975,_0x5bd80a))[_0x07fb('0xd')](loggerCatch(_0x07fb('0x36')));};exports[_0x07fb('0x37')]=function(_0x12da85){return BPromise[_0x07fb('0xa')]()[_0x07fb('0xb')](cmHopper['rescheduleContact'](_0x12da85,!![],!![]))['catch'](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 9e72b3f..0021c05 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 _0xf1e1=['logger','info','inspect','loggerError','logger2','message','getCallerId','string','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','XMD-','toLowerVariables','updateOriginated','originated','logBlacklist','state','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','logLookAgent','membername','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','from-sip','timeout','uniqueid','countbusyretry','countcongestionretry','countnoanswerretry','clone','statedesc','active','scheduledat','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','interface','buildAcw','channelAgent','agentReadyId','reachable','push','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackat','recallme','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','moment','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error'];(function(_0x411bab,_0x4f606b){var _0x4390b7=function(_0x518352){while(--_0x518352){_0x411bab['push'](_0x411bab['shift']());}};_0x4390b7(++_0x4f606b);}(_0xf1e1,0x102));var _0x1f1e=function(_0x289a67,_0x1e5a3c){_0x289a67=_0x289a67-0x0;var _0x572b49=_0xf1e1[_0x289a67];return _0x572b49;};'use strict';var util=require(_0x1f1e('0x0'));var _=require('lodash');var moment=require(_0x1f1e('0x1'));var logger=require('../../../../config/logger')(_0x1f1e('0x2'));var ipAgi=process['env'][_0x1f1e('0x3')]||_0x1f1e('0x4');function getSeconds(_0x2243c6,_0x2ab1f9){var _0x3b301d=moment(_0x2243c6)[_0x1f1e('0x5')](0x0);var _0x1bdcee=moment(_0x2ab1f9)[_0x1f1e('0x5')](0x0);return _0x3b301d[_0x1f1e('0x6')](_0x1bdcee,_0x1f1e('0x7'));}exports[_0x1f1e('0x8')]=function(_0x3699d2){return function(_0x6ab45b){logger[_0x1f1e('0x9')](_0x3699d2,util['inspect'](_0x6ab45b,{'showHidden':![],'depth':null}));};};exports[_0x1f1e('0xa')]=function(_0x20bd13,_0x12c2ca){logger[_0x1f1e('0xb')](_0x20bd13,util[_0x1f1e('0xc')](_0x12c2ca,{'showHidden':![],'depth':null}));};exports[_0x1f1e('0xd')]=function(_0x29aa81,_0x2ad0be){logger[_0x1f1e('0x9')](_0x29aa81,util['inspect'](_0x2ad0be,{'showHidden':![],'depth':null}));};exports[_0x1f1e('0xe')]=function(_0x15dee8){return function(_0x1cfe77){logger[_0x1f1e('0xb')](_0x15dee8,util[_0x1f1e('0xc')](_0x1cfe77,{'showHidden':![],'depth':null}));};};exports[_0x1f1e('0xf')]=function(_0x1f40ef,_0x4f16e0,_0x3ff746){return{'message':_0x1f40ef,'unlock':_0x4f16e0,'active':_0x3ff746};};exports[_0x1f1e('0x10')]=function(_0x53c5e1,_0x28563e,_0x59394b){if(!_['isUndefined'](_0x59394b)&&_0x1f1e('0x11')===typeof _0x59394b&&!_[_0x1f1e('0x12')](_0x59394b)){if(!_[_0x1f1e('0x13')](_0x28563e)&&_0x1f1e('0x11')===typeof _0x28563e&&!_[_0x1f1e('0x12')](_0x28563e)){return util[_0x1f1e('0x14')](_0x1f1e('0x15'),_0x28563e,_0x59394b);}return util[_0x1f1e('0x14')](_0x1f1e('0x15'),_0x59394b,_0x59394b);}if(!_['isUndefined'](_0x53c5e1)&&_0x1f1e('0x11')===typeof _0x53c5e1&&!_[_0x1f1e('0x12')](_0x53c5e1)){return _0x53c5e1;}return'\x22\x22\x20<>';};exports[_0x1f1e('0x16')]=function(_0x219532){if(_[_0x1f1e('0x17')](_0x219532)){return![];}return _0x219532;};exports['addVariables']=function(_0x553367,_0x49c107,_0x1d18d9,_0x226f45,_0xed547a,_0x2642b3){var _0x300f60={'XMD-QUEUE':_0x49c107[_0x1f1e('0x18')]?_0x49c107[_0x1f1e('0x18')][_0x1f1e('0x19')]:'','XMD-CALLERID':_0x226f45,'XMD-CALLERID-PREVIEW':_0x2642b3?util['format']('\x22%s\x22\x20<%s>',_0x2642b3['calleridname'],_0x2642b3[_0x1f1e('0x1a')]):_0x226f45,'XMD-DIALID':_0xed547a,'XMD-CONTACTID':_0x49c107[_0x1f1e('0x1b')],'XMD-CDRTYPE':_0x1f1e('0x1c'),'CALLERID(all)':_0x226f45,'XMD-VOICEQUEUEID':_0x49c107[_0x1f1e('0x1d')],'XMD-DIALCHANNEL':_0x1d18d9,'XMD-DIALTIMEOUT':_0x553367['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x1f1e('0x14')](_0x1f1e('0x1e'),_0x553367[_0x1f1e('0x1f')]?'g':'',_['isEmpty'](_0x553367['monitor_format'])?'':_0x1f1e('0x20')),'XMD-DIALURL':_0x553367[_0x1f1e('0x21')]||'','XMD-AGI':_0x553367[_0x1f1e('0x22')]?util['format'](_0x1f1e('0x23'),ipAgi,_0x553367[_0x1f1e('0x22')]):'NONE','XMD-AGIAFTER':_0x553367[_0x1f1e('0x1f')]?util['format'](_0x1f1e('0x23'),ipAgi,_0x553367[_0x1f1e('0x1f')]):_0x1f1e('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x2642b3?_0x2642b3[_0x1f1e('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x2642b3?_0x2642b3[_0x1f1e('0x26')]:'','XMD-DESTINATION':_0x1f1e('0x27')};if(!_['isEmpty'](_0x553367[_0x1f1e('0x28')])){_0x300f60[util[_0x1f1e('0x14')]('%s',_0x1f1e('0x29'))]=_0x553367[_0x1f1e('0x28')];_0x300f60[util[_0x1f1e('0x14')]('%s',_0x1f1e('0x2a'))]=_0xed547a;}if(_0x49c107&&_0x49c107[_0x1f1e('0x2b')]){for(var _0x5b1610 in _0x49c107[_0x1f1e('0x2b')]){if(_0x49c107[_0x1f1e('0x2b')][_0x1f1e('0x2c')](_0x5b1610)){if(!_[_0x1f1e('0x17')](_0x49c107[_0x1f1e('0x2b')][_0x5b1610])&&_0x5b1610!=='id'&&_0x5b1610!==_0x1f1e('0x2d')&&_0x5b1610!==_0x1f1e('0x2e')&&_0x5b1610!==_0x1f1e('0x2f')){_0x300f60[util['format']('%s%s',_0x1f1e('0x30'),_['toUpper'](_0x5b1610))]=_0x49c107['Contact'][_0x5b1610];}}}}return _0x300f60;};exports[_0x1f1e('0x31')]=function(_0x3806ff){var _0x2551a5={};for(var _0x2decf4 in _0x3806ff){if(_0x3806ff[_0x1f1e('0x2c')](_0x2decf4)){_0x2551a5[util[_0x1f1e('0x14')]('%s',_['toLower'](_0x2decf4))]=_0x3806ff[_0x2decf4];}}return{'variables':_0x2551a5};};exports[_0x1f1e('0x32')]=function(_0x361148,_0x17af5a){if(!_['isNil'](_0x361148)){if(_0x361148[_0x1f1e('0x2c')](_0x1f1e('0x33'))){if(_0x361148['originated']>0x0){_0x361148['originated']-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x17af5a);}}}else{logger[_0x1f1e('0x9')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x17af5a);}};exports[_0x1f1e('0x34')]=function(_0xe5bb64){var _0x51454d=moment()[_0x1f1e('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0xe5bb64[_0x1f1e('0x35')]=0xd;_0xe5bb64['statedesc']=_0x1f1e('0x36');_0xe5bb64[_0x1f1e('0x37')]=_0x51454d;_0xe5bb64[_0x1f1e('0x38')]=_0x51454d;_0xe5bb64[_0x1f1e('0x39')]=_0x51454d;};exports[_0x1f1e('0x3a')]=function(_0x2e36ac,_0x2fee75,_0x588d58){var _0x188d73=moment()['format'](_0x1f1e('0x3b'));_0x2e36ac['state']=_0x2fee75;_0x2e36ac['statedesc']=_0x588d58;_0x2e36ac[_0x1f1e('0x38')]=_0x188d73;_0x2e36ac['ringtime']=getSeconds(_0x2e36ac[_0x1f1e('0x38')],_0x2e36ac[_0x1f1e('0x37')]);};exports[_0x1f1e('0x3c')]=function(_0x437d28,_0x401c79,_0x4c8be8){_0x437d28[_0x1f1e('0x3d')]=_0x401c79;_0x437d28[_0x1f1e('0x3e')]=_0x4c8be8;};exports[_0x1f1e('0x3f')]=function(_0x375a7a,_0x2b2c74,_0x34003f){var _0x57c69d=moment()['format'](_0x1f1e('0x3b'));_0x375a7a[_0x1f1e('0x35')]=_0x2b2c74;_0x375a7a['statedesc']=_0x34003f;_0x375a7a['responsetime']=_0x375a7a[_0x1f1e('0x38')]?_0x375a7a['responsetime']:_0x57c69d;_0x375a7a[_0x1f1e('0x39')]=_0x375a7a[_0x1f1e('0x39')]?_0x375a7a[_0x1f1e('0x39')]:_0x57c69d;_0x375a7a[_0x1f1e('0x40')]=getSeconds(_0x375a7a[_0x1f1e('0x38')]||0x0,_0x375a7a['starttime']||0x0);_0x375a7a[_0x1f1e('0x41')]=_0x375a7a[_0x1f1e('0x42')]?getSeconds(_0x375a7a[_0x1f1e('0x39')],_0x375a7a[_0x1f1e('0x42')]):0x0;};exports[_0x1f1e('0x43')]=function(_0x1410bc){return _0x1410bc===_0x1f1e('0x44');};exports[_0x1f1e('0x45')]=function(_0xcdbb1,_0x330476,_0x13d510,_0x3877b7,_0x20c84e){var _0x465c59=_0x3877b7?_0x1f1e('0x46'):_0xcdbb1[_0x1f1e('0x47')];_0x465c59=_0x20c84e?_0x1f1e('0x48'):_0x465c59;return{'actionid':_0xcdbb1['uniqueid'],'action':'originate','channel':_0xcdbb1['channelAgent'],'callerid':util[_0x1f1e('0x14')]('\x22%s\x22\x20<%s>',_0x465c59,_0xcdbb1[_0x1f1e('0x1a')]),'Exten':_0x1f1e('0x27'),'Context':_0x1f1e('0x49'),'Priority':'1','variable':_0x13d510,'timeout':(_0x330476[_0x1f1e('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0xcdbb1[_0x1f1e('0x4b')]};};exports['totalGlobal']=function(_0x4f91cb){return _0x4f91cb[_0x1f1e('0x4c')]+_0x4f91cb[_0x1f1e('0x4d')]+_0x4f91cb[_0x1f1e('0x4e')];};exports['cloneAction']=function(_0x1a9133){var _0x594b21=_[_0x1f1e('0x4f')](_0x1a9133);_0x594b21[_0x1f1e('0x35')]=0xf;_0x594b21[_0x1f1e('0x50')]='Global';return _0x594b21;};exports['scheduledAt']=function(_0x1d156e,_0x5d38d2,_0x33c145){var _0xc5ca52={};_0xc5ca52[_0x5d38d2]=_0x1d156e[_0x5d38d2];_0xc5ca52[_0x1f1e('0x51')]=![];_0xc5ca52[_0x1f1e('0x52')]=moment()[_0x1f1e('0x53')](_0x33c145,'minutes')[_0x1f1e('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0xc5ca52[_0x1f1e('0x1b')]=_0x1d156e['ContactId'];_0xc5ca52[_0x1f1e('0x54')]=_0x1d156e[_0x1f1e('0x54')];_0xc5ca52['VoiceQueueId']=_0x1d156e[_0x1f1e('0x1d')]||undefined;return _0xc5ca52;};exports['decrementTalkink']=function(_0x3a8b63,_0x423146){if(!_['isNil'](_0x3a8b63)){if(_0x3a8b63[_0x1f1e('0x55')]>0x0){_0x3a8b63['pTalking']-=0x1;}else{logger[_0x1f1e('0x9')](_0x423146,_0x1f1e('0x56'));}}else{logger['error'](_0x423146,_0x1f1e('0x57'));}};exports['IsNotLoggedIn']=function(_0x5ee30e){if(_0x5ee30e<=0x0){return!![];}return![];};exports['buildObj']=function(_0x4e2adb,_0x2453c5){_0x4e2adb[_0x1f1e('0x58')]=_0x2453c5;_0x4e2adb[_0x1f1e('0x19')]=_0x4e2adb[_0x1f1e('0x59')];_0x4e2adb[_0x1f1e('0x5a')]=_0x4e2adb['channelAgent'];return _0x4e2adb;};exports[_0x1f1e('0x5b')]=function(_0xe5a15b){var _0x17eb1c={};_0x17eb1c[_0x1f1e('0x59')]=_0xe5a15b[_0x1f1e('0x59')];_0x17eb1c[_0x1f1e('0x5a')]=_0xe5a15b[_0x1f1e('0x5c')];_0x17eb1c[_0x1f1e('0x4b')]=_0xe5a15b[_0x1f1e('0x4b')];return _0x17eb1c;};exports[_0x1f1e('0x5d')]=function(_0x2fbc82){var _0x3a3c6d=[];for(var _0x46f556 in _0x2fbc82){if(_0x2fbc82[_0x1f1e('0x2c')](_0x46f556)){if(!_['isNil'](_0x2fbc82[_0x46f556])&&_0x2fbc82[_0x46f556][_0x1f1e('0x35')]==='not_inuse'&&_0x2fbc82[_0x46f556]['status']===_0x1f1e('0x5e')){_0x3a3c6d[_0x1f1e('0x5f')](_0x2fbc82[_0x46f556]['id']);}}}return _0x3a3c6d;};exports['getDiff']=function(_0x30b3a7){var _0x41cc11=moment()[_0x1f1e('0x5')](0x0);var _0xa739af=moment(_0x30b3a7)[_0x1f1e('0x5')](0x0);return _0x41cc11[_0x1f1e('0x6')](_0xa739af,_0x1f1e('0x7'));};exports[_0x1f1e('0x60')]=function(_0x389eb3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x389eb3[_0x1f1e('0x1b')],'ListId':_0x389eb3['ListId'],'VoiceQueueId':_0x389eb3[_0x1f1e('0x1d')]||undefined,'CampaignId':_0x389eb3[_0x1f1e('0x61')]||undefined};};exports[_0x1f1e('0x62')]=function(_0x2b35c8){if(_0x2b35c8===_0x1f1e('0x4b')||_0x2b35c8===_0x1f1e('0x63')||_0x2b35c8===_0x1f1e('0x59')||_0x2b35c8===_0x1f1e('0x64')||_0x2b35c8===_0x1f1e('0x65')||_0x2b35c8===_0x1f1e('0x66')||_0x2b35c8===_0x1f1e('0x3d')||_0x2b35c8==='channelAgent'||_0x2b35c8===_0x1f1e('0x47')||_0x2b35c8==='active'||_0x2b35c8==='calleridnum'||_0x2b35c8===_0x1f1e('0x52')||_0x2b35c8===_0x1f1e('0x4c')||_0x2b35c8===_0x1f1e('0x4d')||_0x2b35c8===_0x1f1e('0x4e')||_0x2b35c8==='countglobal'||_0x2b35c8===_0x1f1e('0x67')||_0x2b35c8==='callbackuniqueid'||_0x2b35c8===_0x1f1e('0x68')||_0x2b35c8===_0x1f1e('0x69')||_0x2b35c8===_0x1f1e('0x1b')||_0x2b35c8===_0x1f1e('0x54')||_0x2b35c8===_0x1f1e('0x3e')||_0x2b35c8===_0x1f1e('0x1d')||_0x2b35c8==='sipcallid'||_0x2b35c8==='xmd-voicequeueid'||_0x2b35c8===_0x1f1e('0x6a')||_0x2b35c8===_0x1f1e('0x6b')||_0x2b35c8===_0x1f1e('0x6c')||_0x2b35c8===_0x1f1e('0x6d')||_0x2b35c8===_0x1f1e('0x6e')||_0x2b35c8==='xmd-dialoptions'||_0x2b35c8===_0x1f1e('0x6f')||_0x2b35c8===_0x1f1e('0x70')||_0x2b35c8===_0x1f1e('0x71')||_0x2b35c8===_0x1f1e('0x72')||_0x2b35c8===_0x1f1e('0x73')||_0x2b35c8===_0x1f1e('0x74')||_0x2b35c8===_0x1f1e('0x75')||_0x2b35c8===_0x1f1e('0x76')||_0x2b35c8==='rtpaudioqosbridged'||_0x2b35c8===_0x1f1e('0x77')||_0x2b35c8===_0x1f1e('0x78')||_0x2b35c8===_0x1f1e('0x79')||_0x2b35c8===_0x1f1e('0x7a')||_0x2b35c8===_0x1f1e('0x7b')||_0x2b35c8===_0x1f1e('0x7c')||_0x2b35c8===_0x1f1e('0x76')||_0x2b35c8==='rtpaudioqosbridged'||_0x2b35c8===_0x1f1e('0x77')||_0x2b35c8===_0x1f1e('0x78')||_0x2b35c8===_0x1f1e('0x79')||_0x2b35c8===_0x1f1e('0x7a')||_0x2b35c8===_0x1f1e('0x7b')||_0x2b35c8===_0x1f1e('0x7c')||_0x2b35c8===_0x1f1e('0x7d')||_0x2b35c8==='bridgepvtcallid'||_0x2b35c8==='state'||_0x2b35c8===_0x1f1e('0x50')){return![];}return!![];};exports[_0x1f1e('0x7e')]=function(_0x54354b,_0x4ea5ca){var _0x1afb05,_0x18be70,_0x5bc77f;if(_0x4ea5ca<=0x0){_0x4ea5ca=0x1;}_0x1afb05=new RegExp(_0x1f1e('0x7f')+_0x4ea5ca+'}$');_0x18be70=Math['pow'](0xa,_0x4ea5ca-0x1);_0x5bc77f=Math[_0x1f1e('0x80')](0xa,_0x4ea5ca)-0x1;return util['format']('%s',_[_0x1f1e('0x81')](_0x54354b,_0x1afb05,_[_0x1f1e('0x82')](_0x18be70,_0x5bc77f)));};exports[_0x1f1e('0x83')]=function(_0x394a9d){var _0x334b19=_0x394a9d['match'](/"(.*?)"/);return _0x334b19?_0x334b19[0x1]:_0x394a9d;};exports[_0x1f1e('0x84')]=function(_0x58d0e9){var _0x4db40f=_0x58d0e9[_0x1f1e('0x85')](/<(.*?)>/);return _0x4db40f?_0x4db40f[0x1]:_0x58d0e9;}; \ No newline at end of file +var _0x1330=['uniqueid','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','ContactId','ListId','decrementTalkink','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','match','extractCalleridNumber','lodash','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','name','format','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','Blacklist','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','UserId','logCustomer','state','talktime','answertime','isFailure','variablesAction','RECALL','BOOKED','originate','channelAgent','from-sip','timeout'];(function(_0x4504a7,_0x563a15){var _0x1b3b76=function(_0xb0f30d){while(--_0xb0f30d){_0x4504a7['push'](_0x4504a7['shift']());}};_0x1b3b76(++_0x563a15);}(_0x1330,0x1f4));var _0x0133=function(_0x156b03,_0x238b09){_0x156b03=_0x156b03-0x0;var _0x302cc5=_0x1330[_0x156b03];return _0x302cc5;};'use strict';var util=require('util');var _=require(_0x0133('0x0'));var moment=require(_0x0133('0x1'));var logger=require(_0x0133('0x2'))(_0x0133('0x3'));var ipAgi=process['env'][_0x0133('0x4')]||_0x0133('0x5');function getSeconds(_0x12e24d,_0xf95880){var _0x2ecd9d=moment(_0x12e24d)[_0x0133('0x6')](0x0);var _0x519efa=moment(_0xf95880)[_0x0133('0x6')](0x0);return _0x2ecd9d[_0x0133('0x7')](_0x519efa,_0x0133('0x8'));}exports[_0x0133('0x9')]=function(_0x10d7c8){return function(_0x206cf1){logger[_0x0133('0xa')](_0x10d7c8,util[_0x0133('0xb')](_0x206cf1,{'showHidden':![],'depth':null}));};};exports[_0x0133('0xc')]=function(_0x278b80,_0x57a9dc){logger[_0x0133('0xd')](_0x278b80,util[_0x0133('0xb')](_0x57a9dc,{'showHidden':![],'depth':null}));};exports[_0x0133('0xe')]=function(_0x5d4ac0,_0x21c9f2){logger[_0x0133('0xa')](_0x5d4ac0,util[_0x0133('0xb')](_0x21c9f2,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x52b72b){return function(_0x1742b2){logger[_0x0133('0xd')](_0x52b72b,util[_0x0133('0xb')](_0x1742b2,{'showHidden':![],'depth':null}));};};exports[_0x0133('0xf')]=function(_0xe2f077,_0x19bf18,_0x1e7901){return{'message':_0xe2f077,'unlock':_0x19bf18,'active':_0x1e7901};};exports[_0x0133('0x10')]=function(_0x2a9860,_0xeefcc4,_0x457650){if(!_[_0x0133('0x11')](_0x457650)&&_0x0133('0x12')===typeof _0x457650&&!_[_0x0133('0x13')](_0x457650)){if(!_[_0x0133('0x11')](_0xeefcc4)&&_0x0133('0x12')===typeof _0xeefcc4&&!_[_0x0133('0x13')](_0xeefcc4)){return util['format'](_0x0133('0x14'),_0xeefcc4,_0x457650);}return util['format'](_0x0133('0x14'),_0x457650,_0x457650);}if(!_[_0x0133('0x11')](_0x2a9860)&&_0x0133('0x12')===typeof _0x2a9860&&!_[_0x0133('0x13')](_0x2a9860)){return _0x2a9860;}return _0x0133('0x15');};exports['isActive']=function(_0x2a95e9){if(_[_0x0133('0x16')](_0x2a95e9)){return![];}return _0x2a95e9;};exports[_0x0133('0x17')]=function(_0x12a494,_0x49503a,_0x4ce0c5,_0x2bac3c,_0x52a05f,_0x3b2324){var _0x15e0b4={'XMD-QUEUE':_0x49503a[_0x0133('0x18')]?_0x49503a[_0x0133('0x18')][_0x0133('0x19')]:'','XMD-CALLERID':_0x2bac3c,'XMD-CALLERID-PREVIEW':_0x3b2324?util[_0x0133('0x1a')]('\x22%s\x22\x20<%s>',_0x3b2324[_0x0133('0x1b')],_0x3b2324[_0x0133('0x1c')]):_0x2bac3c,'XMD-DIALID':_0x52a05f,'XMD-CONTACTID':_0x49503a['ContactId'],'XMD-CDRTYPE':_0x0133('0x1d'),'CALLERID(all)':_0x2bac3c,'XMD-VOICEQUEUEID':_0x49503a[_0x0133('0x1e')],'XMD-DIALCHANNEL':_0x4ce0c5,'XMD-DIALTIMEOUT':_0x12a494[_0x0133('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x0133('0x20'),_0x12a494['dialQueueProject2']?'g':'',_[_0x0133('0x13')](_0x12a494['monitor_format'])?'':_0x0133('0x21')),'XMD-DIALURL':_0x12a494[_0x0133('0x22')]||'','XMD-AGI':_0x12a494[_0x0133('0x23')]?util[_0x0133('0x1a')](_0x0133('0x24'),ipAgi,_0x12a494[_0x0133('0x23')]):_0x0133('0x25'),'XMD-AGIAFTER':_0x12a494[_0x0133('0x26')]?util['format'](_0x0133('0x24'),ipAgi,_0x12a494['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3b2324?_0x3b2324[_0x0133('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x3b2324?_0x3b2324[_0x0133('0x28')]:'','XMD-DESTINATION':_0x0133('0x29')};if(!_[_0x0133('0x13')](_0x12a494[_0x0133('0x2a')])){_0x15e0b4[util[_0x0133('0x1a')]('%s',_0x0133('0x2b'))]=_0x12a494[_0x0133('0x2a')];_0x15e0b4[util[_0x0133('0x1a')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x52a05f;}if(_0x49503a&&_0x49503a[_0x0133('0x2c')]){for(var _0x35754f in _0x49503a['Contact']){if(_0x49503a[_0x0133('0x2c')][_0x0133('0x2d')](_0x35754f)){if(!_[_0x0133('0x16')](_0x49503a[_0x0133('0x2c')][_0x35754f])&&_0x35754f!=='id'&&_0x35754f!=='tags'&&_0x35754f!==_0x0133('0x2e')&&_0x35754f!==_0x0133('0x2f')){_0x15e0b4[util['format'](_0x0133('0x30'),_0x0133('0x31'),_[_0x0133('0x32')](_0x35754f))]=_0x49503a[_0x0133('0x2c')][_0x35754f];}}}}return _0x15e0b4;};exports[_0x0133('0x33')]=function(_0x2420de){var _0x4ae110={};for(var _0x351420 in _0x2420de){if(_0x2420de[_0x0133('0x2d')](_0x351420)){_0x4ae110[util['format']('%s',_[_0x0133('0x34')](_0x351420))]=_0x2420de[_0x351420];}}return{'variables':_0x4ae110};};exports[_0x0133('0x35')]=function(_0x1c5f79,_0x296ddb){if(!_[_0x0133('0x16')](_0x1c5f79)){if(_0x1c5f79['hasOwnProperty'](_0x0133('0x36'))){if(_0x1c5f79[_0x0133('0x36')]>0x0){_0x1c5f79[_0x0133('0x36')]-=0x1;}else{logger[_0x0133('0xa')](_0x0133('0x37'),_0x296ddb);}}}else{logger[_0x0133('0xa')](_0x0133('0x38'),_0x296ddb);}};exports['logBlacklist']=function(_0x3514cf){var _0x3d2664=moment()[_0x0133('0x1a')](_0x0133('0x39'));_0x3514cf['state']=0xd;_0x3514cf['statedesc']=_0x0133('0x3a');_0x3514cf[_0x0133('0x3b')]=_0x3d2664;_0x3514cf[_0x0133('0x3c')]=_0x3d2664;_0x3514cf[_0x0133('0x3d')]=_0x3d2664;};exports[_0x0133('0x3e')]=function(_0x5bb0dd,_0x4b3b95,_0xa2513b){var _0x580730=moment()[_0x0133('0x1a')](_0x0133('0x39'));_0x5bb0dd['state']=_0x4b3b95;_0x5bb0dd[_0x0133('0x3f')]=_0xa2513b;_0x5bb0dd[_0x0133('0x3c')]=_0x580730;_0x5bb0dd[_0x0133('0x40')]=getSeconds(_0x5bb0dd['responsetime'],_0x5bb0dd['starttime']);};exports[_0x0133('0x41')]=function(_0x5c2669,_0x481c3c,_0x2e03d5){_0x5c2669[_0x0133('0x42')]=_0x481c3c;_0x5c2669[_0x0133('0x43')]=_0x2e03d5;};exports[_0x0133('0x44')]=function(_0x5ea321,_0x2b7464,_0xeaf6aa){var _0x5027d0=moment()[_0x0133('0x1a')](_0x0133('0x39'));_0x5ea321[_0x0133('0x45')]=_0x2b7464;_0x5ea321[_0x0133('0x3f')]=_0xeaf6aa;_0x5ea321[_0x0133('0x3c')]=_0x5ea321[_0x0133('0x3c')]?_0x5ea321[_0x0133('0x3c')]:_0x5027d0;_0x5ea321[_0x0133('0x3d')]=_0x5ea321[_0x0133('0x3d')]?_0x5ea321[_0x0133('0x3d')]:_0x5027d0;_0x5ea321[_0x0133('0x40')]=getSeconds(_0x5ea321[_0x0133('0x3c')]||0x0,_0x5ea321['starttime']||0x0);_0x5ea321[_0x0133('0x46')]=_0x5ea321[_0x0133('0x47')]?getSeconds(_0x5ea321[_0x0133('0x3d')],_0x5ea321[_0x0133('0x47')]):0x0;};exports[_0x0133('0x48')]=function(_0x25d8cd){return _0x25d8cd==='Failure';};exports[_0x0133('0x49')]=function(_0x503a5e,_0x59f68f,_0x2219f0,_0x303c30,_0x1c756d){var _0x360cca=_0x303c30?_0x0133('0x4a'):_0x503a5e[_0x0133('0x1b')];_0x360cca=_0x1c756d?_0x0133('0x4b'):_0x360cca;return{'actionid':_0x503a5e['uniqueid'],'action':_0x0133('0x4c'),'channel':_0x503a5e[_0x0133('0x4d')],'callerid':util[_0x0133('0x1a')](_0x0133('0x14'),_0x360cca,_0x503a5e[_0x0133('0x1c')]),'Exten':_0x0133('0x29'),'Context':_0x0133('0x4e'),'Priority':'1','variable':_0x2219f0,'timeout':(_0x59f68f[_0x0133('0x4f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x503a5e[_0x0133('0x50')]};};exports[_0x0133('0x51')]=function(_0x1ee014){return _0x1ee014[_0x0133('0x52')]+_0x1ee014['countcongestionretry']+_0x1ee014[_0x0133('0x53')];};exports[_0x0133('0x54')]=function(_0x3b4b12){var _0x533f13=_[_0x0133('0x55')](_0x3b4b12);_0x533f13['state']=0xf;_0x533f13[_0x0133('0x3f')]=_0x0133('0x56');return _0x533f13;};exports[_0x0133('0x57')]=function(_0xbae95,_0x483752,_0x40c198){var _0x4dbe20={};_0x4dbe20[_0x483752]=_0xbae95[_0x483752];_0x4dbe20[_0x0133('0x58')]=![];_0x4dbe20['scheduledat']=moment()['add'](_0x40c198,'minutes')['format'](_0x0133('0x39'));_0x4dbe20[_0x0133('0x59')]=_0xbae95[_0x0133('0x59')];_0x4dbe20[_0x0133('0x5a')]=_0xbae95[_0x0133('0x5a')];_0x4dbe20[_0x0133('0x1e')]=_0xbae95[_0x0133('0x1e')]||undefined;return _0x4dbe20;};exports[_0x0133('0x5b')]=function(_0x2fdef6,_0x2b37c4){if(!_['isNil'](_0x2fdef6)){if(_0x2fdef6['pTalking']>0x0){_0x2fdef6['pTalking']-=0x1;}else{logger['error'](_0x2b37c4,_0x0133('0x5c'));}}else{logger[_0x0133('0xa')](_0x2b37c4,_0x0133('0x5d'));}};exports[_0x0133('0x5e')]=function(_0x20f39e){if(_0x20f39e<=0x0){return!![];}return![];};exports[_0x0133('0x5f')]=function(_0x278734,_0x1d5db4){_0x278734[_0x0133('0x60')]=_0x1d5db4;_0x278734['name']=_0x278734[_0x0133('0x61')];_0x278734[_0x0133('0x62')]=_0x278734['channelAgent'];return _0x278734;};exports[_0x0133('0x63')]=function(_0x54838f){var _0x5d12fc={};_0x5d12fc['queue']=_0x54838f['queue'];_0x5d12fc[_0x0133('0x62')]=_0x54838f['channelAgent'];_0x5d12fc[_0x0133('0x50')]=_0x54838f[_0x0133('0x50')];return _0x5d12fc;};exports[_0x0133('0x64')]=function(_0x6eeab9){var _0x5b3234=[];for(var _0x3d4dc4 in _0x6eeab9){if(_0x6eeab9['hasOwnProperty'](_0x3d4dc4)){if(!_[_0x0133('0x16')](_0x6eeab9[_0x3d4dc4])&&_0x6eeab9[_0x3d4dc4]['state']===_0x0133('0x65')&&_0x6eeab9[_0x3d4dc4]['status']===_0x0133('0x66')){_0x5b3234[_0x0133('0x67')](_0x6eeab9[_0x3d4dc4]['id']);}}}return _0x5b3234;};exports[_0x0133('0x68')]=function(_0x2a69c6){var _0x5d9c33=moment()['milliseconds'](0x0);var _0xfe8728=moment(_0x2a69c6)[_0x0133('0x6')](0x0);return _0x5d9c33[_0x0133('0x7')](_0xfe8728,_0x0133('0x8'));};exports['createBody']=function(_0x5309f8){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5309f8[_0x0133('0x59')],'ListId':_0x5309f8['ListId'],'VoiceQueueId':_0x5309f8[_0x0133('0x1e')]||undefined,'CampaignId':_0x5309f8[_0x0133('0x69')]||undefined};};exports[_0x0133('0x6a')]=function(_0x5a57e8){if(_0x5a57e8===_0x0133('0x50')||_0x5a57e8===_0x0133('0x6b')||_0x5a57e8===_0x0133('0x61')||_0x5a57e8===_0x0133('0x6c')||_0x5a57e8===_0x0133('0x6d')||_0x5a57e8===_0x0133('0x6e')||_0x5a57e8==='membername'||_0x5a57e8==='channelAgent'||_0x5a57e8===_0x0133('0x1b')||_0x5a57e8===_0x0133('0x58')||_0x5a57e8===_0x0133('0x1c')||_0x5a57e8===_0x0133('0x6f')||_0x5a57e8==='countbusyretry'||_0x5a57e8==='countcongestionretry'||_0x5a57e8===_0x0133('0x53')||_0x5a57e8===_0x0133('0x70')||_0x5a57e8==='callback'||_0x5a57e8===_0x0133('0x71')||_0x5a57e8===_0x0133('0x72')||_0x5a57e8===_0x0133('0x73')||_0x5a57e8===_0x0133('0x59')||_0x5a57e8===_0x0133('0x5a')||_0x5a57e8==='UserId'||_0x5a57e8===_0x0133('0x1e')||_0x5a57e8===_0x0133('0x74')||_0x5a57e8===_0x0133('0x75')||_0x5a57e8===_0x0133('0x76')||_0x5a57e8===_0x0133('0x77')||_0x5a57e8===_0x0133('0x78')||_0x5a57e8===_0x0133('0x79')||_0x5a57e8===_0x0133('0x7a')||_0x5a57e8===_0x0133('0x7b')||_0x5a57e8==='xmd-dialid'||_0x5a57e8===_0x0133('0x7c')||_0x5a57e8===_0x0133('0x7d')||_0x5a57e8===_0x0133('0x7e')||_0x5a57e8===_0x0133('0x7f')||_0x5a57e8===_0x0133('0x80')||_0x5a57e8===_0x0133('0x81')||_0x5a57e8===_0x0133('0x82')||_0x5a57e8===_0x0133('0x83')||_0x5a57e8===_0x0133('0x84')||_0x5a57e8===_0x0133('0x85')||_0x5a57e8===_0x0133('0x86')||_0x5a57e8===_0x0133('0x87')||_0x5a57e8===_0x0133('0x88')||_0x5a57e8===_0x0133('0x89')||_0x5a57e8===_0x0133('0x82')||_0x5a57e8===_0x0133('0x83')||_0x5a57e8===_0x0133('0x84')||_0x5a57e8==='rtpaudioqosjitterbridged'||_0x5a57e8===_0x0133('0x86')||_0x5a57e8===_0x0133('0x87')||_0x5a57e8==='rtpaudioqosrtt'||_0x5a57e8===_0x0133('0x89')||_0x5a57e8===_0x0133('0x8a')||_0x5a57e8===_0x0133('0x8b')||_0x5a57e8===_0x0133('0x45')||_0x5a57e8===_0x0133('0x3f')){return![];}return!![];};exports[_0x0133('0x8c')]=function(_0x1a5f70,_0x42f008){var _0x3dbe99,_0x4d454f,_0x3b1c6a;if(_0x42f008<=0x0){_0x42f008=0x1;}_0x3dbe99=new RegExp('\x5cw{0,'+_0x42f008+'}$');_0x4d454f=Math[_0x0133('0x8d')](0xa,_0x42f008-0x1);_0x3b1c6a=Math[_0x0133('0x8d')](0xa,_0x42f008)-0x1;return util[_0x0133('0x1a')]('%s',_[_0x0133('0x8e')](_0x1a5f70,_0x3dbe99,_['random'](_0x4d454f,_0x3b1c6a)));};exports['extractCalleridName']=function(_0x2ef1f9){var _0x46c838=_0x2ef1f9[_0x0133('0x8f')](/"(.*?)"/);return _0x46c838?_0x46c838[0x1]:_0x2ef1f9;};exports[_0x0133('0x90')]=function(_0x50d8be){var _0x576aaa=_0x50d8be['match'](/<(.*?)>/);return _0x576aaa?_0x576aaa[0x1]:_0x50d8be;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 17a39e9..c8667f4 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 _0x6b8f=['reload','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','queueremove','queuepause','boolean'];(function(_0x284807,_0x4be925){var _0x50c774=function(_0xf56cf7){while(--_0xf56cf7){_0x284807['push'](_0x284807['shift']());}};_0x50c774(++_0x4be925);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x3c84eb,_0x2a9054){_0x3c84eb=_0x3c84eb-0x0;var _0x22976b=_0x6b8f[_0x3c84eb];return _0x22976b;};'use strict';exports['queueadd']={'queue':{'type':_0xf6b8('0x0'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0xf6b8('0x0'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xf6b8('0x1')]={'queue':{'type':_0xf6b8('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xf6b8('0x2')]={'interface':{'type':_0xf6b8('0x0'),'required':!![]},'paused':{'type':_0xf6b8('0x3')},'reason':{'type':'string','required':![]}};exports[_0xf6b8('0x4')]={'module':{'type':_0xf6b8('0x0'),'required':![]}};exports[_0xf6b8('0x5')]={'uniqueid':{'type':_0xf6b8('0x0'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xf6b8('0x0')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf6b8('0x0')}};exports[_0xf6b8('0x6')]={'uniqueid':{'type':_0xf6b8('0x0'),'required':!![]}};exports[_0xf6b8('0x7')]={'uniqueid':{'type':_0xf6b8('0x0'),'required':!![]},'exten':{'type':_0xf6b8('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x0c02=['number','boolean','queueremove','queuepause','reload','voicequeuechannelhangup','string'];(function(_0x8c3e66,_0x58f6cf){var _0x7d5abd=function(_0x5546ab){while(--_0x5546ab){_0x8c3e66['push'](_0x8c3e66['shift']());}};_0x7d5abd(++_0x58f6cf);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';exports['queueadd']={'queue':{'type':_0x20c0('0x0'),'required':!![]},'interface':{'type':_0x20c0('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x20c0('0x1'),'required':![]},'paused':{'type':_0x20c0('0x2'),'required':![]}};exports[_0x20c0('0x3')]={'queue':{'type':_0x20c0('0x0'),'required':!![]},'interface':{'type':_0x20c0('0x0'),'required':!![]}};exports[_0x20c0('0x4')]={'interface':{'type':_0x20c0('0x0'),'required':!![]},'paused':{'type':_0x20c0('0x2')},'reason':{'type':_0x20c0('0x0'),'required':![]}};exports[_0x20c0('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x20c0('0x0'),'required':!![]},'filename':{'type':_0x20c0('0x0')},'format':{'type':_0x20c0('0x0')},'mixmonitorid':{'type':_0x20c0('0x0')}};exports[_0x20c0('0x6')]={'uniqueid':{'type':_0x20c0('0x0'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 2c95d6e..b323ae3 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 _0x340b=['outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','format','initTelephones','isUndefined','telephones','initTrunks','trunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','answered','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','exports','bluebird','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/faxAccount','agents','triggers','campaigns','templates','outbound','channels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','faxAccounts','hasOwnProperty','mapKeys','SIP/%s','isNil','interface','name','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay'];(function(_0xf3cb47,_0x12dd4a){var _0x26d091=function(_0x28953a){while(--_0x28953a){_0xf3cb47['push'](_0xf3cb47['shift']());}};_0x26d091(++_0x12dd4a);}(_0x340b,0x16a));var _0xb340=function(_0x12912c,_0x18edeb){_0x12912c=_0x12912c-0x0;var _0x2980da=_0x340b[_0x12912c];return _0x2980da;};'use strict';var BPromise=require(_0xb340('0x0'));var util=require('util');var _=require(_0xb340('0x1'));var moment=require(_0xb340('0x2'));var Agent=require(_0xb340('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0xb340('0x4'));var VoiceQueue=require(_0xb340('0x5'));var Trigger=require(_0xb340('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xb340('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0xb340('0x8'));var FreshdeskAccount=require(_0xb340('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xb340('0xa'));var DeskAccount=require(_0xb340('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xb340('0xc'));var FaxAccount=require(_0xb340('0xd'));var Realtime=function(){this[_0xb340('0xe')]={};this['telephones']={};this['trunks']={};this['voiceQueues']={};this[_0xb340('0xf')]={};this[_0xb340('0x10')]={};this[_0xb340('0x11')]={};this[_0xb340('0x12')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xb340('0x13')]={};this['queueChannels']={};this['outboundChannels']={};this[_0xb340('0x14')]={};this[_0xb340('0x15')]={};this[_0xb340('0x16')]={};this[_0xb340('0x17')]={};this[_0xb340('0x18')]={};this[_0xb340('0x19')]={};this[_0xb340('0x1a')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0xb340('0x1b')]={};this[_0xb340('0x1c')]={};};function freeIsNotKey(_0x29c004,_0x214c28,_0x1ab272){var _0x49548d=_['mapKeys'](_0x29c004,function(_0x4de427,_0x16f4cb){return _0x4de427[_0x1ab272];});for(var _0x56bdd4 in _0x214c28){if(_0x214c28[_0xb340('0x1d')](_0x56bdd4)){if(!_0x49548d[_0x56bdd4]){delete _0x214c28[_0x56bdd4];}}}}function freeIsNotKeySip(_0x3c6fd3,_0x1a8ae9){var _0x40cf56=_[_0xb340('0x1e')](_0x3c6fd3,function(_0x4d2af6,_0x14de51){return util['format'](_0xb340('0x1f'),_0x4d2af6['name']);});for(var _0x239674 in _0x1a8ae9){if(_0x1a8ae9[_0xb340('0x1d')](_0x239674)){if(!_0x40cf56[_0x239674]){delete _0x1a8ae9[_0x239674];}}}}function freeIsNotKeyAgent(_0x3bda2a,_0x1f0b94){var _0x59fd56=_[_0xb340('0x1e')](_0x3bda2a,function(_0x3e4b02,_0x3f8262){var _0xa41c56=_[_0xb340('0x20')](_0x3e4b02[_0xb340('0x21')])?util['format'](_0xb340('0x1f'),_0x3e4b02[_0xb340('0x22')]):_0x3e4b02[_0xb340('0x21')];return _0xa41c56;});for(var _0x20245b in _0x1f0b94){if(_0x1f0b94[_0xb340('0x1d')](_0x20245b)){if(!_0x59fd56[_0x20245b]){delete _0x1f0b94[_0x20245b];}}}}function clearVoiceCallReports(_0x11e175){_0x11e175['total']=0x0;_0x11e175['answered']=0x0;_0x11e175[_0xb340('0x23')]=0x0;_0x11e175[_0xb340('0x24')]=0x0;_0x11e175[_0xb340('0x25')]=0x0;}function clearCampaigns(_0x3c1946){if(!_[_0xb340('0x26')](_0x3c1946)){for(var _0x25a8ec in _0x3c1946){if(_0x3c1946[_0xb340('0x1d')](_0x25a8ec)){_0x3c1946[_0x25a8ec]['ivrTotalCallsDays']=0x0;_0x3c1946[_0x25a8ec][_0xb340('0x27')]=0x0;}}}}function clearVoiceQueues(_0x508d6f){if(!_['isEmpty'](_0x508d6f)){for(var _0x5772eb in _0x508d6f){if(_0x508d6f[_0xb340('0x1d')](_0x5772eb)){_0x508d6f[_0x5772eb][_0xb340('0x28')]=0x0;_0x508d6f[_0x5772eb]['answered']=0x0;_0x508d6f[_0x5772eb]['unmanaged']=0x0;_0x508d6f[_0x5772eb][_0xb340('0x29')]=0x0;_0x508d6f[_0x5772eb]['sumHoldTime']=0x0;_0x508d6f[_0x5772eb][_0xb340('0x24')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x25')]=0x0;_0x508d6f[_0x5772eb]['outboundAnswerAgiCallsDay']=0x0;_0x508d6f[_0x5772eb][_0xb340('0x2a')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x2b')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x2c')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x2d')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x2e')]=0x0;_0x508d6f[_0x5772eb]['outboundDropCallsDayTimeout']=0x0;_0x508d6f[_0x5772eb][_0xb340('0x2f')]=0x0;_0x508d6f[_0x5772eb]['outboundBlacklistCallsDay']=0x0;_0x508d6f[_0x5772eb][_0xb340('0x30')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x31')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x32')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x33')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x34')]=0x0;_0x508d6f[_0x5772eb][_0xb340('0x35')]=!![];}}}}Realtime[_0xb340('0x36')][_0xb340('0x37')]=function(_0x25c164,_0x27e2f7){for(var _0x37f476 in _0x27e2f7){if(_0x25c164[_0xb340('0x1d')](_0x37f476)){_0x25c164[_0x37f476]=_0x27e2f7[_0x37f476];}}};Realtime[_0xb340('0x36')][_0xb340('0x38')]=function(){var _0x507c81=this;return function(_0x3ee0d4){if(_0x3ee0d4){freeIsNotKeyAgent(_0x3ee0d4,_0x507c81[_0xb340('0xe')]);for(var _0x5cf263=0x0,_0x5d9fb8={},_0x117b02={};_0x5cf263<_0x3ee0d4[_0xb340('0x39')];_0x5cf263+=0x1){_0x5d9fb8=_0x3ee0d4[_0x5cf263];var _0x21b730=_[_0xb340('0x20')](_0x5d9fb8['interface'])?util[_0xb340('0x3a')](_0xb340('0x1f'),_0x5d9fb8['name']):_0x5d9fb8[_0xb340('0x21')];if(_['isUndefined'](_0x507c81['agents'][_0x21b730])){_0x507c81['agents'][_0x21b730]=new Agent(_0x5d9fb8);}else{_0x507c81[_0xb340('0x37')](_0x507c81[_0xb340('0xe')][_0x21b730],_0x5d9fb8);}}}return _0x507c81[_0xb340('0xe')];};};Realtime[_0xb340('0x36')][_0xb340('0x3b')]=function(){var _0x536dfc=this;return function(_0x49e6cb){if(_0x49e6cb){freeIsNotKeySip(_0x49e6cb,_0x536dfc['telephones']);for(var _0x1af6e8=0x0,_0x21cddc={},_0x58fb4c={};_0x1af6e8<_0x49e6cb[_0xb340('0x39')];_0x1af6e8+=0x1){_0x21cddc=_0x49e6cb[_0x1af6e8];if(_[_0xb340('0x3c')](_0x536dfc['telephones'][util[_0xb340('0x3a')]('SIP/%s',_0x21cddc['name'])])){_0x536dfc['telephones'][util[_0xb340('0x3a')](_0xb340('0x1f'),_0x21cddc[_0xb340('0x22')])]=new Telephone(_0x21cddc);}else{_0x536dfc[_0xb340('0x37')](_0x536dfc[_0xb340('0x3d')][util[_0xb340('0x3a')]('SIP/%s',_0x21cddc[_0xb340('0x22')])],_0x21cddc);}}}return _0x536dfc[_0xb340('0x3d')];};};Realtime[_0xb340('0x36')][_0xb340('0x3e')]=function(){var _0x35d15a=this;return function(_0x25f454){if(_0x25f454){freeIsNotKeySip(_0x25f454,_0x35d15a[_0xb340('0x3f')]);for(var _0x489c4b=0x0,_0xf2c096={},_0x40f32c={};_0x489c4b<_0x25f454['length'];_0x489c4b+=0x1){_0xf2c096=_0x25f454[_0x489c4b];if(_[_0xb340('0x3c')](_0x35d15a[_0xb340('0x3f')][util[_0xb340('0x3a')](_0xb340('0x1f'),_0xf2c096[_0xb340('0x22')])])){_0x35d15a['trunks'][util[_0xb340('0x3a')](_0xb340('0x1f'),_0xf2c096[_0xb340('0x22')])]=new Trunk(_0xf2c096);}else{_0x35d15a[_0xb340('0x37')](_0x35d15a[_0xb340('0x3f')][util[_0xb340('0x3a')]('SIP/%s',_0xf2c096[_0xb340('0x22')])],_0xf2c096);}}}return _0x35d15a['trunks'];};};Realtime[_0xb340('0x36')][_0xb340('0x40')]=function(){var _0x1d01cd=this;return function(_0x1891dc){if(_0x1891dc){freeIsNotKey(_0x1891dc,_0x1d01cd[_0xb340('0x41')],'name');for(var _0x16be9a=0x0,_0x22053e={},_0x1a732a={};_0x16be9a<_0x1891dc[_0xb340('0x39')];_0x16be9a+=0x1){_0x22053e=_0x1891dc[_0x16be9a];if(_[_0xb340('0x3c')](_0x1d01cd[_0xb340('0x41')][_0x22053e[_0xb340('0x22')]])){_0x1d01cd[_0xb340('0x41')][_0x22053e[_0xb340('0x22')]]=new VoiceQueue(_0x22053e);}else{_0x1d01cd[_0xb340('0x37')](_0x1d01cd['voiceQueues'][_0x22053e[_0xb340('0x22')]],_0x22053e);}}}return _0x1d01cd[_0xb340('0x41')];};};Realtime[_0xb340('0x36')][_0xb340('0x42')]=function(){var _0x2ad38a=this;return function(_0x369cc3){if(_0x369cc3){freeIsNotKey(_0x369cc3,_0x2ad38a[_0xb340('0xf')],'id');for(var _0x2fa111=0x0,_0x495105={},_0x47ff75={};_0x2fa111<_0x369cc3['length'];_0x2fa111+=0x1){_0x495105=_0x369cc3[_0x2fa111];if(_[_0xb340('0x3c')](_0x2ad38a[_0xb340('0xf')][_0x495105['id']])){_0x2ad38a['triggers'][_0x495105['id']]=new Trigger(_0x495105);}else{_0x2ad38a[_0xb340('0x37')](_0x2ad38a['triggers'][_0x495105['id']],_0x495105);}}}return _0x2ad38a['triggers'];};};Realtime['prototype'][_0xb340('0x43')]=function(){var _0x47d42e=this;return function(_0x340a2c){if(_0x340a2c){freeIsNotKey(_0x340a2c,_0x47d42e[_0xb340('0x11')],'id');for(var _0x96d184=0x0,_0x5a499d={},_0xab0de4={};_0x96d184<_0x340a2c['length'];_0x96d184+=0x1){_0x5a499d=_0x340a2c[_0x96d184];if(_[_0xb340('0x3c')](_0x47d42e['templates'][_0x5a499d['id']])){_0x47d42e['templates'][_0x5a499d['id']]=new Template(_0x5a499d);}else{_0x47d42e[_0xb340('0x37')](_0x47d42e['templates'][_0x5a499d['id']],_0x5a499d);}}}return _0x47d42e[_0xb340('0x11')];};};Realtime[_0xb340('0x36')][_0xb340('0x44')]=function(){var _0x5bb1f8=this;return function(_0x1befaa){if(_0x1befaa){freeIsNotKey(_0x1befaa,_0x5bb1f8[_0xb340('0x15')],'id');for(var _0x1ad44e=0x0,_0x6f399e={},_0x1ccced={};_0x1ad44e<_0x1befaa[_0xb340('0x39')];_0x1ad44e+=0x1){_0x6f399e=_0x1befaa[_0x1ad44e];if(_['isUndefined'](_0x5bb1f8['zendeskAccounts'][_0x6f399e['id']])){_0x5bb1f8[_0xb340('0x15')][_0x6f399e['id']]=new ZendeskAccount(_0x6f399e);}else{_0x5bb1f8['mergeFromDatabase'](_0x5bb1f8[_0xb340('0x15')][_0x6f399e['id']],_0x6f399e);}}}return _0x5bb1f8[_0xb340('0x15')];};};Realtime[_0xb340('0x36')]['initSalesforceAccounts']=function(){var _0x17adea=this;return function(_0x4a1a10){if(_0x4a1a10){freeIsNotKey(_0x4a1a10,_0x17adea[_0xb340('0x16')],'id');for(var _0x233bc0=0x0,_0x2ee906={},_0xa3716d={};_0x233bc0<_0x4a1a10['length'];_0x233bc0+=0x1){_0x2ee906=_0x4a1a10[_0x233bc0];if(_[_0xb340('0x3c')](_0x17adea[_0xb340('0x16')][_0x2ee906['id']])){_0x17adea['salesforceAccounts'][_0x2ee906['id']]=new SalesforceAccount(_0x2ee906);}else{_0x17adea[_0xb340('0x37')](_0x17adea[_0xb340('0x16')][_0x2ee906['id']],_0x2ee906);}}}return _0x17adea['salesforceAccounts'];};};Realtime[_0xb340('0x36')][_0xb340('0x45')]=function(){var _0x402372=this;return function(_0x51bf5a){if(_0x51bf5a){freeIsNotKey(_0x51bf5a,_0x402372[_0xb340('0x18')],'id');for(var _0x2e2e23=0x0,_0x5b4e5c={},_0x4df49d={};_0x2e2e23<_0x51bf5a[_0xb340('0x39')];_0x2e2e23+=0x1){_0x5b4e5c=_0x51bf5a[_0x2e2e23];if(_['isUndefined'](_0x402372[_0xb340('0x18')][_0x5b4e5c['id']])){_0x402372['freshdeskAccounts'][_0x5b4e5c['id']]=new FreshdeskAccount(_0x5b4e5c);}else{_0x402372[_0xb340('0x37')](_0x402372[_0xb340('0x18')][_0x5b4e5c['id']],_0x5b4e5c);}}}return _0x402372[_0xb340('0x18')];};};Realtime[_0xb340('0x36')][_0xb340('0x46')]=function(){var _0x39d3be=this;return function(_0x190bc1){if(_0x190bc1){freeIsNotKey(_0x190bc1,_0x39d3be['zohoAccounts'],'id');for(var _0x307c7f=0x0,_0xa5dfb9={},_0x252ff8={};_0x307c7f<_0x190bc1[_0xb340('0x39')];_0x307c7f+=0x1){_0xa5dfb9=_0x190bc1[_0x307c7f];if(_[_0xb340('0x3c')](_0x39d3be['zohoAccounts'][_0xa5dfb9['id']])){_0x39d3be[_0xb340('0x19')][_0xa5dfb9['id']]=new ZohoAccount(_0xa5dfb9);}else{_0x39d3be[_0xb340('0x37')](_0x39d3be[_0xb340('0x19')][_0xa5dfb9['id']],_0xa5dfb9);}}}return _0x39d3be[_0xb340('0x19')];};};Realtime[_0xb340('0x36')][_0xb340('0x47')]=function(){var _0x23858c=this;return function(_0x570801){if(_0x570801){freeIsNotKey(_0x570801,_0x23858c[_0xb340('0x1a')],'id');for(var _0x440735=0x0,_0x4125c8={},_0x1eb6b1={};_0x440735<_0x570801['length'];_0x440735+=0x1){_0x4125c8=_0x570801[_0x440735];if(_[_0xb340('0x3c')](_0x23858c['deskAccounts'][_0x4125c8['id']])){_0x23858c[_0xb340('0x1a')][_0x4125c8['id']]=new DeskAccount(_0x4125c8);}else{_0x23858c['mergeFromDatabase'](_0x23858c['deskAccounts'][_0x4125c8['id']],_0x4125c8);}}}return _0x23858c[_0xb340('0x1a')];};};Realtime[_0xb340('0x36')][_0xb340('0x48')]=function(){var _0x616f1d=this;return function(_0x239b65){if(_0x239b65){freeIsNotKey(_0x239b65,_0x616f1d['sugarcrmAccounts'],'id');for(var _0x2d8546=0x0,_0x46ce39={},_0x4633fd={};_0x2d8546<_0x239b65[_0xb340('0x39')];_0x2d8546+=0x1){_0x46ce39=_0x239b65[_0x2d8546];if(_[_0xb340('0x3c')](_0x616f1d[_0xb340('0x17')][_0x46ce39['id']])){_0x616f1d[_0xb340('0x17')][_0x46ce39['id']]=new SugarcrmAccount(_0x46ce39);}else{_0x616f1d[_0xb340('0x37')](_0x616f1d['sugarcrmAccounts'][_0x46ce39['id']],_0x46ce39);}}}return _0x616f1d[_0xb340('0x17')];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x289a99=this;return function(_0x39106d){if(_0x39106d){freeIsNotKey(_0x39106d,_0x289a99[_0xb340('0x49')],'id');for(var _0x4a169b=0x0,_0x4be858={},_0x29de04={};_0x4a169b<_0x39106d[_0xb340('0x39')];_0x4a169b+=0x1){_0x4be858=_0x39106d[_0x4a169b];if(_[_0xb340('0x3c')](_0x289a99[_0xb340('0x49')][_0x4be858['id']])){_0x289a99[_0xb340('0x49')][_0x4be858['id']]=new VtigerAccount(_0x4be858);}else{_0x289a99[_0xb340('0x37')](_0x289a99[_0xb340('0x49')][_0x4be858['id']],_0x4be858);}}}return _0x289a99[_0xb340('0x49')];};};Realtime[_0xb340('0x36')][_0xb340('0x4a')]=function(){var _0x218939=this;return function(_0x23b661){if(_0x23b661){freeIsNotKey(_0x23b661,_0x218939[_0xb340('0x4b')],'id');for(var _0x51ebc9=0x0,_0x745111={},_0x3a43ae={};_0x51ebc9<_0x23b661[_0xb340('0x39')];_0x51ebc9+=0x1){_0x745111=_0x23b661[_0x51ebc9];if(_['isUndefined'](_0x218939[_0xb340('0x4b')][_0x745111['id']])){_0x218939[_0xb340('0x4b')][_0x745111['id']]=new ServicenowAccount(_0x745111);}else{_0x218939[_0xb340('0x37')](_0x218939[_0xb340('0x4b')][_0x745111['id']],_0x745111);}}}return _0x218939[_0xb340('0x4b')];};};Realtime[_0xb340('0x36')][_0xb340('0x4c')]=function(){var _0x55f7ed=this;return function(_0xe08436){if(_0xe08436){freeIsNotKey(_0xe08436,_0x55f7ed[_0xb340('0x1b')],'id');for(var _0x2b5a38=0x0,_0x3f72d8={},_0x5b5fde={};_0x2b5a38<_0xe08436[_0xb340('0x39')];_0x2b5a38+=0x1){_0x3f72d8=_0xe08436[_0x2b5a38];if(_['isUndefined'](_0x55f7ed[_0xb340('0x1b')][_0x3f72d8['id']])){_0x55f7ed[_0xb340('0x1b')][_0x3f72d8['id']]=new Dynamics365Account(_0x3f72d8);}else{_0x55f7ed[_0xb340('0x37')](_0x55f7ed[_0xb340('0x1b')][_0x3f72d8['id']],_0x3f72d8);}}}return _0x55f7ed[_0xb340('0x1b')];};};Realtime[_0xb340('0x36')][_0xb340('0x4d')]=function(){var _0x51d9f9=this;return function(_0x19be4c){for(var _0x2752ca=0x0;_0x2752ca<_0x19be4c[_0xb340('0x39')];_0x2752ca+=0x1){_[_0xb340('0x4e')](_0x51d9f9[_0xb340('0x41')][_0x19be4c[_0x2752ca][_0xb340('0x22')]],_0x19be4c[_0x2752ca]);}return _0x51d9f9[_0xb340('0x41')];};};Realtime[_0xb340('0x36')][_0xb340('0x4f')]=function(){var _0xc69071=this;return function(_0x4e3b27){clearVoiceQueues(_0xc69071['voiceQueues']);if(_0x4e3b27){_0x4e3b27=_[_0xb340('0x50')](_0x4e3b27,_0xb340('0x51'));for(var _0x5d0805 in _0x4e3b27){if(_0x4e3b27[_0xb340('0x1d')](_0x5d0805)){var _0x4bbac3={};for(var _0x548ab9=0x0;_0x548ab9<_0x4e3b27[_0x5d0805][_0xb340('0x39')];_0x548ab9+=0x1){var _0x19494b=_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x52')];if(_0xc69071[_0xb340('0x41')][_0x19494b]){if(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x53')]){_0xc69071[_0xb340('0x41')][_0x19494b][_0xb340('0x54')]+=0x1;}if(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x55')]){_0xc69071[_0xb340('0x41')][_0x19494b][_0xb340('0x29')]+=0x1;}_0xc69071[_0xb340('0x41')][_0x19494b][_0xb340('0x23')]+=moment(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x56')])[_0xb340('0x57')](moment(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x58')]),_0xb340('0x59'))||0x0;if(_0x548ab9===_0x4e3b27[_0x5d0805][_0xb340('0x39')]-0x1){_0xc69071['voiceQueues'][_0x19494b][_0xb340('0x24')]+=moment(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x5a')]||_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x5b')]||_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x5c')])[_0xb340('0x57')](moment(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x58')]),_0xb340('0x59'))||0x0;_0xc69071[_0xb340('0x41')][_0x19494b][_0xb340('0x28')]+=0x1;if(_0x4e3b27[_0x5d0805][_0x548ab9]['queuecallercomplete']){_0xc69071[_0xb340('0x41')][_0x19494b][_0xb340('0x5d')]+=0x1;_0xc69071[_0xb340('0x41')][_0x19494b]['sumBillable']+=moment(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x5a')])[_0xb340('0x57')](moment(_0x4e3b27[_0x5d0805][_0x548ab9][_0xb340('0x56')]),_0xb340('0x59'))||0x0;}}else{_0xc69071[_0xb340('0x41')][_0x19494b][_0xb340('0x24')]+=_0xc69071[_0xb340('0x41')][_0x19494b][_0xb340('0x23')]||0x0;}}}}}}return _0xc69071['voiceQueues'];};};Realtime[_0xb340('0x36')][_0xb340('0x5e')]=function(){var _0x586563=this;return function(_0xe317a6){clearVoiceCallReports(_0x586563[_0xb340('0x12')]);if(_0xe317a6){for(var _0x47e3c6=0x0;_0x47e3c6<_0xe317a6[_0xb340('0x39')];_0x47e3c6+=0x1){_0x586563['outbound'][_0xb340('0x28')]+=0x1;_0x586563[_0xb340('0x12')][_0xb340('0x24')]+=_0xe317a6[_0x47e3c6][_0xb340('0x5f')];if(_0xe317a6[_0x47e3c6][_0xb340('0x60')]==='ANSWERED'){_0x586563[_0xb340('0x12')][_0xb340('0x5d')]+=0x1;_0x586563['outbound'][_0xb340('0x23')]+=_0xe317a6[_0x47e3c6][_0xb340('0x5f')]-_0xe317a6[_0x47e3c6][_0xb340('0x61')]||0x0;_0x586563['outbound'][_0xb340('0x25')]+=_0xe317a6[_0x47e3c6][_0xb340('0x61')];}}}return _0x586563[_0xb340('0x12')];};};Realtime[_0xb340('0x36')][_0xb340('0x62')]=function(){var _0x532b64=this;return function(_0x2667ba){if(_0x2667ba){freeIsNotKey(_0x2667ba,_0x532b64[_0xb340('0x10')],'name');for(var _0x20ba79=0x0,_0x27bc1c={};_0x20ba79<_0x2667ba['length'];_0x20ba79+=0x1){_0x27bc1c=_0x2667ba[_0x20ba79];if(_[_0xb340('0x3c')](_0x532b64[_0xb340('0x10')][_0x27bc1c['name']])){_0x532b64[_0xb340('0x10')][_0x27bc1c['name']]=new Campaign(_0x27bc1c);}else{_0x532b64[_0xb340('0x37')](_0x532b64[_0xb340('0x10')][_0x27bc1c[_0xb340('0x22')]],_0x27bc1c);}}}return _0x532b64[_0xb340('0x10')];};};Realtime[_0xb340('0x36')][_0xb340('0x63')]=function(){var _0x53d754=this;return function(_0x21bf1f){if(_0x21bf1f){freeIsNotKey(_0x21bf1f,_0x53d754[_0xb340('0x64')],'id');for(var _0x1e0f45=0x0,_0x2981e3={};_0x1e0f45<_0x21bf1f[_0xb340('0x39')];_0x1e0f45+=0x1){_0x2981e3=_0x21bf1f[_0x1e0f45];if(_['isUndefined'](_0x53d754['voiceExtensions'][_0x2981e3['id']])){_0x53d754[_0xb340('0x64')][_0x2981e3['id']]=new VoiceExtension(_0x2981e3);}else{_0x53d754['mergeFromDatabase'](_0x53d754[_0xb340('0x64')][_0x2981e3['id']],_0x2981e3);}}}return _0x53d754[_0xb340('0x64')];};};Realtime['prototype'][_0xb340('0x65')]=function(){var _0x431dd8=this;return function(_0x57c475){clearCampaigns(_0x431dd8[_0xb340('0x10')]);for(var _0xf2d485=0x0;_0xf2d485<_0x57c475[_0xb340('0x39')];_0xf2d485+=0x1){_['merge'](_0x431dd8['campaigns'][_0x57c475[_0xf2d485][_0xb340('0x22')]],_0x57c475[_0xf2d485]);}return _0x431dd8[_0xb340('0x10')];};};Realtime[_0xb340('0x36')]['initFaxAccounts']=function(){var _0x428fb2=this;return function(_0xad7ecd){if(_0xad7ecd){freeIsNotKey(_0xad7ecd,_0x428fb2['faxAccounts'],'id');for(var _0x1b82ad=0x0,_0x209e4b={},_0x1a9789={};_0x1b82ad<_0xad7ecd[_0xb340('0x39')];_0x1b82ad+=0x1){_0x209e4b=_0xad7ecd[_0x1b82ad];if(_['isUndefined'](_0x428fb2[_0xb340('0x1c')][_0x209e4b['id']])){_0x428fb2[_0xb340('0x1c')][_0x209e4b['id']]=new FaxAccount(_0x209e4b);}else{_0x428fb2[_0xb340('0x37')](_0x428fb2['faxAccounts'][_0x209e4b['id']],_0x209e4b);}}}return _0x428fb2['faxAccounts'];};};module[_0xb340('0x66')]=Realtime; \ No newline at end of file +var _0x6c50=['vtigerAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','isNil','interface','format','answered','sumDuration','isEmpty','ivrTotalCallsDays','total','unmanaged','sumHoldTime','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','isUndefined','initTelephones','length','initVoiceQueues','initTriggers','initTemplates','templates','salesforceAccounts','initFreshdeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts'];(function(_0x142d4f,_0x31f574){var _0x240cb3=function(_0x3a926b){while(--_0x3a926b){_0x142d4f['push'](_0x142d4f['shift']());}};_0x240cb3(++_0x31f574);}(_0x6c50,0xe2));var _0x06c5=function(_0x5d7283,_0x17e0ec){_0x5d7283=_0x5d7283-0x0;var _0x34266c=_0x6c50[_0x5d7283];return _0x34266c;};'use strict';var BPromise=require(_0x06c5('0x0'));var util=require('util');var _=require(_0x06c5('0x1'));var moment=require(_0x06c5('0x2'));var Agent=require(_0x06c5('0x3'));var Telephone=require(_0x06c5('0x4'));var Trunk=require(_0x06c5('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x06c5('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0x06c5('0x7'));var ZendeskAccount=require(_0x06c5('0x8'));var SalesforceAccount=require(_0x06c5('0x9'));var FreshdeskAccount=require(_0x06c5('0xa'));var SugarcrmAccount=require(_0x06c5('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x06c5('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FaxAccount=require(_0x06c5('0xd'));var Realtime=function(){this[_0x06c5('0xe')]={};this[_0x06c5('0xf')]={};this[_0x06c5('0x10')]={};this[_0x06c5('0x11')]={};this[_0x06c5('0x12')]={};this[_0x06c5('0x13')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x06c5('0x14')]={};this[_0x06c5('0x15')]={};this[_0x06c5('0x16')]={};this[_0x06c5('0x17')]={};this[_0x06c5('0x18')]={};this[_0x06c5('0x19')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0x06c5('0x1a')]={};this[_0x06c5('0x1b')]={};this[_0x06c5('0x1c')]={};this['vtigerAccounts']={};this['servicenowAccounts']={};this[_0x06c5('0x1d')]={};this[_0x06c5('0x1e')]={};};function freeIsNotKey(_0x5eb3db,_0x3cfc25,_0x2b2f66){var _0x221b7b=_[_0x06c5('0x1f')](_0x5eb3db,function(_0x5754d0,_0xcd7877){return _0x5754d0[_0x2b2f66];});for(var _0x30a83f in _0x3cfc25){if(_0x3cfc25[_0x06c5('0x20')](_0x30a83f)){if(!_0x221b7b[_0x30a83f]){delete _0x3cfc25[_0x30a83f];}}}}function freeIsNotKeySip(_0x4c2a92,_0x3f3306){var _0x24cd51=_[_0x06c5('0x1f')](_0x4c2a92,function(_0x42a29b,_0x216b39){return util['format'](_0x06c5('0x21'),_0x42a29b[_0x06c5('0x22')]);});for(var _0x54ac16 in _0x3f3306){if(_0x3f3306[_0x06c5('0x20')](_0x54ac16)){if(!_0x24cd51[_0x54ac16]){delete _0x3f3306[_0x54ac16];}}}}function freeIsNotKeyAgent(_0x4c3eb8,_0x42c3f7){var _0x569624=_['mapKeys'](_0x4c3eb8,function(_0x573327,_0x446eb5){var _0x42340f=_[_0x06c5('0x23')](_0x573327[_0x06c5('0x24')])?util[_0x06c5('0x25')](_0x06c5('0x21'),_0x573327[_0x06c5('0x22')]):_0x573327[_0x06c5('0x24')];return _0x42340f;});for(var _0x4b7e83 in _0x42c3f7){if(_0x42c3f7[_0x06c5('0x20')](_0x4b7e83)){if(!_0x569624[_0x4b7e83]){delete _0x42c3f7[_0x4b7e83];}}}}function clearVoiceCallReports(_0x3dab1e){_0x3dab1e['total']=0x0;_0x3dab1e[_0x06c5('0x26')]=0x0;_0x3dab1e['sumHoldTime']=0x0;_0x3dab1e[_0x06c5('0x27')]=0x0;_0x3dab1e['sumBillable']=0x0;}function clearCampaigns(_0x4842cf){if(!_[_0x06c5('0x28')](_0x4842cf)){for(var _0x41c486 in _0x4842cf){if(_0x4842cf[_0x06c5('0x20')](_0x41c486)){_0x4842cf[_0x41c486][_0x06c5('0x29')]=0x0;_0x4842cf[_0x41c486]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x33e4a8){if(!_[_0x06c5('0x28')](_0x33e4a8)){for(var _0x4cd165 in _0x33e4a8){if(_0x33e4a8[_0x06c5('0x20')](_0x4cd165)){_0x33e4a8[_0x4cd165][_0x06c5('0x2a')]=0x0;_0x33e4a8[_0x4cd165]['answered']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2b')]=0x0;_0x33e4a8[_0x4cd165]['abandoned']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2c')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x27')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2d')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2e')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2f')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x30')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x31')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x32')]=0x0;_0x33e4a8[_0x4cd165]['outboundUnknownCallsDay']=0x0;_0x33e4a8[_0x4cd165]['outboundDropCallsDayTimeout']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x33')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x34')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x35')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x36')]=0x0;_0x33e4a8[_0x4cd165]['outboundReCallsDay']=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x2e')]=0x0;_0x33e4a8[_0x4cd165][_0x06c5('0x37')]=0x0;_0x33e4a8[_0x4cd165]['queueStatusComplete']=!![];}}}}Realtime[_0x06c5('0x38')][_0x06c5('0x39')]=function(_0x1fbcb3,_0x1d55c6){for(var _0x5970e1 in _0x1d55c6){if(_0x1fbcb3[_0x06c5('0x20')](_0x5970e1)){_0x1fbcb3[_0x5970e1]=_0x1d55c6[_0x5970e1];}}};Realtime[_0x06c5('0x38')][_0x06c5('0x3a')]=function(){var _0x340e65=this;return function(_0x408996){if(_0x408996){freeIsNotKeyAgent(_0x408996,_0x340e65[_0x06c5('0xe')]);for(var _0x4c484c=0x0,_0x483480={},_0x1b4a0c={};_0x4c484c<_0x408996['length'];_0x4c484c+=0x1){_0x483480=_0x408996[_0x4c484c];var _0xcf48b6=_['isNil'](_0x483480[_0x06c5('0x24')])?util[_0x06c5('0x25')](_0x06c5('0x21'),_0x483480[_0x06c5('0x22')]):_0x483480[_0x06c5('0x24')];if(_[_0x06c5('0x3b')](_0x340e65[_0x06c5('0xe')][_0xcf48b6])){_0x340e65[_0x06c5('0xe')][_0xcf48b6]=new Agent(_0x483480);}else{_0x340e65['mergeFromDatabase'](_0x340e65[_0x06c5('0xe')][_0xcf48b6],_0x483480);}}}return _0x340e65['agents'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x3c')]=function(){var _0x5d8d44=this;return function(_0x1e55ed){if(_0x1e55ed){freeIsNotKeySip(_0x1e55ed,_0x5d8d44[_0x06c5('0xf')]);for(var _0x1b96a6=0x0,_0x3d0da4={},_0x399822={};_0x1b96a6<_0x1e55ed['length'];_0x1b96a6+=0x1){_0x3d0da4=_0x1e55ed[_0x1b96a6];if(_['isUndefined'](_0x5d8d44[_0x06c5('0xf')][util[_0x06c5('0x25')](_0x06c5('0x21'),_0x3d0da4[_0x06c5('0x22')])])){_0x5d8d44[_0x06c5('0xf')][util[_0x06c5('0x25')](_0x06c5('0x21'),_0x3d0da4['name'])]=new Telephone(_0x3d0da4);}else{_0x5d8d44['mergeFromDatabase'](_0x5d8d44[_0x06c5('0xf')][util[_0x06c5('0x25')]('SIP/%s',_0x3d0da4['name'])],_0x3d0da4);}}}return _0x5d8d44['telephones'];};};Realtime[_0x06c5('0x38')]['initTrunks']=function(){var _0x2cf0aa=this;return function(_0x24cc7e){if(_0x24cc7e){freeIsNotKeySip(_0x24cc7e,_0x2cf0aa['trunks']);for(var _0x159875=0x0,_0x6f4259={},_0x5c009f={};_0x159875<_0x24cc7e[_0x06c5('0x3d')];_0x159875+=0x1){_0x6f4259=_0x24cc7e[_0x159875];if(_[_0x06c5('0x3b')](_0x2cf0aa[_0x06c5('0x10')][util[_0x06c5('0x25')]('SIP/%s',_0x6f4259[_0x06c5('0x22')])])){_0x2cf0aa[_0x06c5('0x10')][util[_0x06c5('0x25')]('SIP/%s',_0x6f4259['name'])]=new Trunk(_0x6f4259);}else{_0x2cf0aa[_0x06c5('0x39')](_0x2cf0aa['trunks'][util[_0x06c5('0x25')](_0x06c5('0x21'),_0x6f4259[_0x06c5('0x22')])],_0x6f4259);}}}return _0x2cf0aa[_0x06c5('0x10')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x3e')]=function(){var _0x27e4d1=this;return function(_0x5b9492){if(_0x5b9492){freeIsNotKey(_0x5b9492,_0x27e4d1[_0x06c5('0x11')],'name');for(var _0x33a921=0x0,_0xdfa773={},_0x6e7383={};_0x33a921<_0x5b9492[_0x06c5('0x3d')];_0x33a921+=0x1){_0xdfa773=_0x5b9492[_0x33a921];if(_[_0x06c5('0x3b')](_0x27e4d1['voiceQueues'][_0xdfa773[_0x06c5('0x22')]])){_0x27e4d1[_0x06c5('0x11')][_0xdfa773[_0x06c5('0x22')]]=new VoiceQueue(_0xdfa773);}else{_0x27e4d1['mergeFromDatabase'](_0x27e4d1[_0x06c5('0x11')][_0xdfa773[_0x06c5('0x22')]],_0xdfa773);}}}return _0x27e4d1['voiceQueues'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x3f')]=function(){var _0x45d415=this;return function(_0x3cff70){if(_0x3cff70){freeIsNotKey(_0x3cff70,_0x45d415[_0x06c5('0x12')],'id');for(var _0x4c277d=0x0,_0x1c8c2d={},_0x20226d={};_0x4c277d<_0x3cff70['length'];_0x4c277d+=0x1){_0x1c8c2d=_0x3cff70[_0x4c277d];if(_['isUndefined'](_0x45d415['triggers'][_0x1c8c2d['id']])){_0x45d415[_0x06c5('0x12')][_0x1c8c2d['id']]=new Trigger(_0x1c8c2d);}else{_0x45d415[_0x06c5('0x39')](_0x45d415[_0x06c5('0x12')][_0x1c8c2d['id']],_0x1c8c2d);}}}return _0x45d415[_0x06c5('0x12')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x40')]=function(){var _0x3cf136=this;return function(_0x2d41c3){if(_0x2d41c3){freeIsNotKey(_0x2d41c3,_0x3cf136[_0x06c5('0x41')],'id');for(var _0x459769=0x0,_0x21440b={},_0x1d10a4={};_0x459769<_0x2d41c3[_0x06c5('0x3d')];_0x459769+=0x1){_0x21440b=_0x2d41c3[_0x459769];if(_[_0x06c5('0x3b')](_0x3cf136[_0x06c5('0x41')][_0x21440b['id']])){_0x3cf136['templates'][_0x21440b['id']]=new Template(_0x21440b);}else{_0x3cf136[_0x06c5('0x39')](_0x3cf136['templates'][_0x21440b['id']],_0x21440b);}}}return _0x3cf136['templates'];};};Realtime[_0x06c5('0x38')]['initZendeskAccounts']=function(){var _0xc14378=this;return function(_0x60814){if(_0x60814){freeIsNotKey(_0x60814,_0xc14378[_0x06c5('0x19')],'id');for(var _0x21e5f5=0x0,_0x356909={},_0x29cfff={};_0x21e5f5<_0x60814[_0x06c5('0x3d')];_0x21e5f5+=0x1){_0x356909=_0x60814[_0x21e5f5];if(_[_0x06c5('0x3b')](_0xc14378[_0x06c5('0x19')][_0x356909['id']])){_0xc14378[_0x06c5('0x19')][_0x356909['id']]=new ZendeskAccount(_0x356909);}else{_0xc14378[_0x06c5('0x39')](_0xc14378['zendeskAccounts'][_0x356909['id']],_0x356909);}}}return _0xc14378[_0x06c5('0x19')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x50e154=this;return function(_0x53dea7){if(_0x53dea7){freeIsNotKey(_0x53dea7,_0x50e154[_0x06c5('0x42')],'id');for(var _0x5cec64=0x0,_0x3a7c30={},_0x36766c={};_0x5cec64<_0x53dea7[_0x06c5('0x3d')];_0x5cec64+=0x1){_0x3a7c30=_0x53dea7[_0x5cec64];if(_['isUndefined'](_0x50e154['salesforceAccounts'][_0x3a7c30['id']])){_0x50e154['salesforceAccounts'][_0x3a7c30['id']]=new SalesforceAccount(_0x3a7c30);}else{_0x50e154[_0x06c5('0x39')](_0x50e154[_0x06c5('0x42')][_0x3a7c30['id']],_0x3a7c30);}}}return _0x50e154[_0x06c5('0x42')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x43')]=function(){var _0x1e83d0=this;return function(_0x2e1035){if(_0x2e1035){freeIsNotKey(_0x2e1035,_0x1e83d0[_0x06c5('0x1a')],'id');for(var _0x14ecd0=0x0,_0x4e0ff9={},_0x2cb49a={};_0x14ecd0<_0x2e1035[_0x06c5('0x3d')];_0x14ecd0+=0x1){_0x4e0ff9=_0x2e1035[_0x14ecd0];if(_[_0x06c5('0x3b')](_0x1e83d0[_0x06c5('0x1a')][_0x4e0ff9['id']])){_0x1e83d0[_0x06c5('0x1a')][_0x4e0ff9['id']]=new FreshdeskAccount(_0x4e0ff9);}else{_0x1e83d0[_0x06c5('0x39')](_0x1e83d0[_0x06c5('0x1a')][_0x4e0ff9['id']],_0x4e0ff9);}}}return _0x1e83d0['freshdeskAccounts'];};};Realtime[_0x06c5('0x38')]['initZohoAccounts']=function(){var _0x5d8a7d=this;return function(_0xd188fb){if(_0xd188fb){freeIsNotKey(_0xd188fb,_0x5d8a7d[_0x06c5('0x1b')],'id');for(var _0x38c16d=0x0,_0x128faa={},_0x1240e7={};_0x38c16d<_0xd188fb[_0x06c5('0x3d')];_0x38c16d+=0x1){_0x128faa=_0xd188fb[_0x38c16d];if(_[_0x06c5('0x3b')](_0x5d8a7d[_0x06c5('0x1b')][_0x128faa['id']])){_0x5d8a7d['zohoAccounts'][_0x128faa['id']]=new ZohoAccount(_0x128faa);}else{_0x5d8a7d[_0x06c5('0x39')](_0x5d8a7d[_0x06c5('0x1b')][_0x128faa['id']],_0x128faa);}}}return _0x5d8a7d[_0x06c5('0x1b')];};};Realtime[_0x06c5('0x38')]['initDeskAccounts']=function(){var _0x316fa8=this;return function(_0x45961a){if(_0x45961a){freeIsNotKey(_0x45961a,_0x316fa8[_0x06c5('0x1c')],'id');for(var _0x520223=0x0,_0x38205d={},_0x1d8b75={};_0x520223<_0x45961a[_0x06c5('0x3d')];_0x520223+=0x1){_0x38205d=_0x45961a[_0x520223];if(_[_0x06c5('0x3b')](_0x316fa8[_0x06c5('0x1c')][_0x38205d['id']])){_0x316fa8[_0x06c5('0x1c')][_0x38205d['id']]=new DeskAccount(_0x38205d);}else{_0x316fa8[_0x06c5('0x39')](_0x316fa8['deskAccounts'][_0x38205d['id']],_0x38205d);}}}return _0x316fa8[_0x06c5('0x1c')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x44')]=function(){var _0xc2980a=this;return function(_0xae5471){if(_0xae5471){freeIsNotKey(_0xae5471,_0xc2980a[_0x06c5('0x45')],'id');for(var _0x466c4a=0x0,_0x1ba985={},_0x1001a7={};_0x466c4a<_0xae5471[_0x06c5('0x3d')];_0x466c4a+=0x1){_0x1ba985=_0xae5471[_0x466c4a];if(_[_0x06c5('0x3b')](_0xc2980a[_0x06c5('0x45')][_0x1ba985['id']])){_0xc2980a[_0x06c5('0x45')][_0x1ba985['id']]=new SugarcrmAccount(_0x1ba985);}else{_0xc2980a['mergeFromDatabase'](_0xc2980a['sugarcrmAccounts'][_0x1ba985['id']],_0x1ba985);}}}return _0xc2980a[_0x06c5('0x45')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x46')]=function(){var _0x4b76be=this;return function(_0xd5ea32){if(_0xd5ea32){freeIsNotKey(_0xd5ea32,_0x4b76be[_0x06c5('0x47')],'id');for(var _0x8ef938=0x0,_0x4f8b5a={},_0x10a7fb={};_0x8ef938<_0xd5ea32['length'];_0x8ef938+=0x1){_0x4f8b5a=_0xd5ea32[_0x8ef938];if(_[_0x06c5('0x3b')](_0x4b76be[_0x06c5('0x47')][_0x4f8b5a['id']])){_0x4b76be[_0x06c5('0x47')][_0x4f8b5a['id']]=new VtigerAccount(_0x4f8b5a);}else{_0x4b76be[_0x06c5('0x39')](_0x4b76be[_0x06c5('0x47')][_0x4f8b5a['id']],_0x4f8b5a);}}}return _0x4b76be['vtigerAccounts'];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x193b85=this;return function(_0xc11de8){if(_0xc11de8){freeIsNotKey(_0xc11de8,_0x193b85[_0x06c5('0x48')],'id');for(var _0x1ed6fd=0x0,_0x1e692c={},_0x548df9={};_0x1ed6fd<_0xc11de8[_0x06c5('0x3d')];_0x1ed6fd+=0x1){_0x1e692c=_0xc11de8[_0x1ed6fd];if(_[_0x06c5('0x3b')](_0x193b85[_0x06c5('0x48')][_0x1e692c['id']])){_0x193b85[_0x06c5('0x48')][_0x1e692c['id']]=new ServicenowAccount(_0x1e692c);}else{_0x193b85[_0x06c5('0x39')](_0x193b85[_0x06c5('0x48')][_0x1e692c['id']],_0x1e692c);}}}return _0x193b85['servicenowAccounts'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x49')]=function(){var _0x5c79f7=this;return function(_0x5c8ad3){if(_0x5c8ad3){freeIsNotKey(_0x5c8ad3,_0x5c79f7['dynamics365Accounts'],'id');for(var _0x5a054e=0x0,_0x60b631={},_0x53b8d0={};_0x5a054e<_0x5c8ad3[_0x06c5('0x3d')];_0x5a054e+=0x1){_0x60b631=_0x5c8ad3[_0x5a054e];if(_[_0x06c5('0x3b')](_0x5c79f7['dynamics365Accounts'][_0x60b631['id']])){_0x5c79f7[_0x06c5('0x1d')][_0x60b631['id']]=new Dynamics365Account(_0x60b631);}else{_0x5c79f7[_0x06c5('0x39')](_0x5c79f7[_0x06c5('0x1d')][_0x60b631['id']],_0x60b631);}}}return _0x5c79f7[_0x06c5('0x1d')];};};Realtime[_0x06c5('0x38')]['initVoiceQueueHopperHistory']=function(){var _0x3968d4=this;return function(_0x18107e){for(var _0xa1b6b=0x0;_0xa1b6b<_0x18107e[_0x06c5('0x3d')];_0xa1b6b+=0x1){_['merge'](_0x3968d4[_0x06c5('0x11')][_0x18107e[_0xa1b6b]['name']],_0x18107e[_0xa1b6b]);}return _0x3968d4['voiceQueues'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x4a')]=function(){var _0x293e27=this;return function(_0x4557eb){clearVoiceQueues(_0x293e27[_0x06c5('0x11')]);if(_0x4557eb){_0x4557eb=_[_0x06c5('0x4b')](_0x4557eb,_0x06c5('0x4c'));for(var _0x3b5bf8 in _0x4557eb){if(_0x4557eb[_0x06c5('0x20')](_0x3b5bf8)){var _0x301306={};for(var _0x19a463=0x0;_0x19a463<_0x4557eb[_0x3b5bf8][_0x06c5('0x3d')];_0x19a463+=0x1){var _0x752485=_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x4d')];if(_0x293e27['voiceQueues'][_0x752485]){if(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x4e')]){_0x293e27['voiceQueues'][_0x752485]['unmanaged']+=0x1;}if(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x4f')]){_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x50')]+=0x1;}_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2c')]+=moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x51')])[_0x06c5('0x52')](moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x53')]),_0x06c5('0x54'))||0x0;if(_0x19a463===_0x4557eb[_0x3b5bf8][_0x06c5('0x3d')]-0x1){_0x293e27[_0x06c5('0x11')][_0x752485]['sumDuration']+=moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x55')]||_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x56')]||_0x4557eb[_0x3b5bf8][_0x19a463]['queuecallerexitAt'])[_0x06c5('0x52')](moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x53')]),_0x06c5('0x54'))||0x0;_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2a')]+=0x1;if(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x57')]){_0x293e27['voiceQueues'][_0x752485][_0x06c5('0x26')]+=0x1;_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2d')]+=moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x55')])[_0x06c5('0x52')](moment(_0x4557eb[_0x3b5bf8][_0x19a463][_0x06c5('0x51')]),_0x06c5('0x54'))||0x0;}}else{_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x27')]+=_0x293e27[_0x06c5('0x11')][_0x752485][_0x06c5('0x2c')]||0x0;}}}}}}return _0x293e27[_0x06c5('0x11')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x58')]=function(){var _0x1e7e43=this;return function(_0x4b7fe9){clearVoiceCallReports(_0x1e7e43[_0x06c5('0x59')]);if(_0x4b7fe9){for(var _0x29ae2d=0x0;_0x29ae2d<_0x4b7fe9[_0x06c5('0x3d')];_0x29ae2d+=0x1){_0x1e7e43[_0x06c5('0x59')]['total']+=0x1;_0x1e7e43[_0x06c5('0x59')][_0x06c5('0x27')]+=_0x4b7fe9[_0x29ae2d][_0x06c5('0x5a')];if(_0x4b7fe9[_0x29ae2d][_0x06c5('0x5b')]===_0x06c5('0x5c')){_0x1e7e43['outbound'][_0x06c5('0x26')]+=0x1;_0x1e7e43[_0x06c5('0x59')][_0x06c5('0x2c')]+=_0x4b7fe9[_0x29ae2d][_0x06c5('0x5a')]-_0x4b7fe9[_0x29ae2d][_0x06c5('0x5d')]||0x0;_0x1e7e43[_0x06c5('0x59')][_0x06c5('0x2d')]+=_0x4b7fe9[_0x29ae2d]['billableseconds'];}}}return _0x1e7e43[_0x06c5('0x59')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x5e')]=function(){var _0x34d5dc=this;return function(_0xcb5b9f){if(_0xcb5b9f){freeIsNotKey(_0xcb5b9f,_0x34d5dc[_0x06c5('0x13')],_0x06c5('0x22'));for(var _0x37734e=0x0,_0x579940={};_0x37734e<_0xcb5b9f[_0x06c5('0x3d')];_0x37734e+=0x1){_0x579940=_0xcb5b9f[_0x37734e];if(_[_0x06c5('0x3b')](_0x34d5dc[_0x06c5('0x13')][_0x579940[_0x06c5('0x22')]])){_0x34d5dc['campaigns'][_0x579940[_0x06c5('0x22')]]=new Campaign(_0x579940);}else{_0x34d5dc['mergeFromDatabase'](_0x34d5dc['campaigns'][_0x579940[_0x06c5('0x22')]],_0x579940);}}}return _0x34d5dc[_0x06c5('0x13')];};};Realtime[_0x06c5('0x38')][_0x06c5('0x5f')]=function(){var _0x3f87a7=this;return function(_0x23663d){if(_0x23663d){freeIsNotKey(_0x23663d,_0x3f87a7[_0x06c5('0x14')],'id');for(var _0x172335=0x0,_0x41c6de={};_0x172335<_0x23663d[_0x06c5('0x3d')];_0x172335+=0x1){_0x41c6de=_0x23663d[_0x172335];if(_[_0x06c5('0x3b')](_0x3f87a7[_0x06c5('0x14')][_0x41c6de['id']])){_0x3f87a7[_0x06c5('0x14')][_0x41c6de['id']]=new VoiceExtension(_0x41c6de);}else{_0x3f87a7[_0x06c5('0x39')](_0x3f87a7[_0x06c5('0x14')][_0x41c6de['id']],_0x41c6de);}}}return _0x3f87a7['voiceExtensions'];};};Realtime[_0x06c5('0x38')][_0x06c5('0x60')]=function(){var _0x104fb6=this;return function(_0x28b8ae){clearCampaigns(_0x104fb6[_0x06c5('0x13')]);for(var _0x7fa9cf=0x0;_0x7fa9cf<_0x28b8ae[_0x06c5('0x3d')];_0x7fa9cf+=0x1){_['merge'](_0x104fb6[_0x06c5('0x13')][_0x28b8ae[_0x7fa9cf][_0x06c5('0x22')]],_0x28b8ae[_0x7fa9cf]);}return _0x104fb6[_0x06c5('0x13')];};};Realtime['prototype'][_0x06c5('0x61')]=function(){var _0x53caab=this;return function(_0x4f481d){if(_0x4f481d){freeIsNotKey(_0x4f481d,_0x53caab[_0x06c5('0x1e')],'id');for(var _0x36ef79=0x0,_0x3ce1e4={},_0x3f6cbb={};_0x36ef79<_0x4f481d[_0x06c5('0x3d')];_0x36ef79+=0x1){_0x3ce1e4=_0x4f481d[_0x36ef79];if(_['isUndefined'](_0x53caab[_0x06c5('0x1e')][_0x3ce1e4['id']])){_0x53caab[_0x06c5('0x1e')][_0x3ce1e4['id']]=new FaxAccount(_0x3ce1e4);}else{_0x53caab['mergeFromDatabase'](_0x53caab['faxAccounts'][_0x3ce1e4['id']],_0x3ce1e4);}}}return _0x53caab[_0x06c5('0x1e')];};};module[_0x06c5('0x62')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 85c8fb6..18964e4 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 _0x72ef=['match','voiceCallReport','destination','exten','type','dialer','lastapplication','lastdata','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','createdAt','monitors','calleridname','connectedlinename','membername','xcally-motion-dialer','create','isArray','voiceDialReport','startsWith','Local','substring','indexOf','mobile','phone','exports','bluebird','lodash','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','bind','blindTransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','format','SIP/%s','length','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt'];(function(_0xe87e7f,_0x168854){var _0x28065a=function(_0x30dfc4){while(--_0x30dfc4){_0xe87e7f['push'](_0xe87e7f['shift']());}};_0x28065a(++_0x168854);}(_0x72ef,0x183));var _0xf72e=function(_0x57659d,_0x3a210e){_0x57659d=_0x57659d-0x0;var _0x1f0b7f=_0x72ef[_0x57659d];return _0x1f0b7f;};'use strict';var BPromise=require(_0xf72e('0x0'));var _=require(_0xf72e('0x1'));var moment=require('moment');var util=require('util');var config=require(_0xf72e('0x2'));var logger=require(_0xf72e('0x3'))(_0xf72e('0x4'));var ami=require(_0xf72e('0x5'));var RpcVoiceAgentReport=require(_0xf72e('0x6'));var RpcVoiceCallReport=require(_0xf72e('0x7'));var RpcVoiceDialReport=require(_0xf72e('0x8'));var RpcMemberReport=require(_0xf72e('0x9'));var RpcVoiceQueueReport=require(_0xf72e('0xa'));var RpcVoiceRecording=require(_0xf72e('0xb'));var RpcVoiceTransferReport=require(_0xf72e('0xc'));var VoiceQueueReport=require(_0xf72e('0xd'));var VoiceCallReport=require(_0xf72e('0xe'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xf72e('0xf'));var UserReport=require(_0xf72e('0x10'));function Report(_0x41fa51){this[_0xf72e('0x11')]=_0x41fa51;this[_0xf72e('0x12')]=_0x41fa51[_0xf72e('0x12')];this['telephones']=_0x41fa51[_0xf72e('0x13')];}Report[_0xf72e('0x14')][_0xf72e('0x15')]=function(_0x4f132e){var _0x334614=new VoiceQueueReport(this['realtime']);var _0x175c2b=new VoiceAgentReport(this[_0xf72e('0x11')]);var _0x44aed5=new VoiceDialReport(this[_0xf72e('0x11')]);var _0x57a9f6=new VoiceCallReport(this[_0xf72e('0x11')]);var _0x5d8e73=new UserReport(this[_0xf72e('0x11')]);if(config[_0xf72e('0x16')]&&config[_0xf72e('0x16')][_0xf72e('0x17')]){ami['on'](_0xf72e('0x18'),this[_0xf72e('0x19')]['bind'](this));ami['on'](_0xf72e('0x1a'),this['voiceCallReport']['bind'](this));ami['on'](_0xf72e('0x1b'),this[_0xf72e('0x1c')][_0xf72e('0x1d')](this));ami['on']('custom:voiceDialReport',this['voiceDialReport'][_0xf72e('0x1d')](this));ami['on']('blindtransfer',this[_0xf72e('0x1e')][_0xf72e('0x1d')](this));ami['on']('attendedtransfer',this[_0xf72e('0x1f')][_0xf72e('0x1d')](this));}};Report['prototype'][_0xf72e('0x20')]=function(_0x4d5d76){var _0x1a9f47=undefined;_0x1a9f47=_['find'](this[_0xf72e('0x12')],function(_0x37a052){return _0x37a052[_0xf72e('0x21')]==_0x4d5d76||_0x37a052[_0xf72e('0x22')]==_0x4d5d76;});if(_[_0xf72e('0x23')](_0x1a9f47)){var _0x3437df=_[_0xf72e('0x24')](this[_0xf72e('0x13')],function(_0x1fa1d9){return _0x1fa1d9[_0xf72e('0x21')]==_0x4d5d76||_0x1fa1d9['name']==_0x4d5d76;});if(_0x3437df){_0x1a9f47=_[_0xf72e('0x24')](this['agents'],function(_0x45a8e1){return _0x45a8e1[_0xf72e('0x25')]==util[_0xf72e('0x26')](_0xf72e('0x27'),_0x3437df[_0xf72e('0x22')]);});}}return _0x1a9f47;};Report[_0xf72e('0x14')][_0xf72e('0x19')]=function(_0x515e62){for(var _0x3d87b1=0x0;_0x3d87b1<_0x515e62[_0xf72e('0x28')];_0x3d87b1+=0x1){var _0x5ebda0=this[_0xf72e('0x20')](_0x515e62[_0x3d87b1]['connectedlinenum']);if(_0x5ebda0){_0x515e62[_0x3d87b1][_0xf72e('0x21')]=_0x5ebda0[_0xf72e('0x21')];_0x515e62[_0x3d87b1][_0xf72e('0x29')]=!![];_0x515e62[_0x3d87b1][_0xf72e('0x2a')]=_0x5ebda0[_0xf72e('0x22')];_0x515e62[_0x3d87b1][_0xf72e('0x25')]=_['isNil'](_0x5ebda0[_0xf72e('0x25')])?util[_0xf72e('0x26')](_0xf72e('0x27'),_0x5ebda0[_0xf72e('0x22')]):_0x5ebda0[_0xf72e('0x25')];if(_0x515e62[_0x3d87b1][_0xf72e('0x2b')]){_0x515e62[_0x3d87b1][_0xf72e('0x2c')]=moment()[_0xf72e('0x26')](_0xf72e('0x2d'));}if(_0x515e62[_0x3d87b1][_0xf72e('0x2e')]){_0x515e62[_0x3d87b1][_0xf72e('0x2f')]=moment()[_0xf72e('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xf72e('0x19')](_0x515e62[_0x3d87b1]);}RpcVoiceQueueReport['create'](_0x515e62[_0x3d87b1]);}};function extractCalleridNumber(_0x2cf954){var _0x2d3840=_0x2cf954[_0xf72e('0x30')](/<(.*?)>/);return _0x2d3840?_0x2d3840[0x1]:_0x2cf954;}Report[_0xf72e('0x14')][_0xf72e('0x31')]=function(_0xb423d0){_0xb423d0[_0xf72e('0x32')]=_0xb423d0['destination']||_0xb423d0[_0xf72e('0x33')];if(_0xb423d0[_0xf72e('0x34')]==_0xf72e('0x35')){_0xb423d0[_0xf72e('0x36')]='queue';_0xb423d0[_0xf72e('0x37')]=_0xb423d0[_0xf72e('0x38')];if(_0xb423d0[_0xf72e('0x39')]==_0xf72e('0x3a')){_0xb423d0[_0xf72e('0x21')]='';_0xb423d0['destination']=extractCalleridNumber(_0xb423d0['callerid']);}else if(_0xb423d0[_0xf72e('0x39')]==_0xf72e('0x3b')){if(_0xb423d0[_0xf72e('0x32')]==_0xf72e('0x3c')){_0xb423d0[_0xf72e('0x32')]=extractCalleridNumber(_0xb423d0[_0xf72e('0x3d')]);_0xb423d0[_0xf72e('0x3e')]=_0xb423d0[_0xf72e('0x3f')];_0xb423d0[_0xf72e('0x40')]=[_0xb423d0[_0xf72e('0x41')],_0xb423d0[_0xf72e('0x41')]=_0xb423d0[_0xf72e('0x40')]][0x0];_0xb423d0[_0xf72e('0x42')]=_0xb423d0[_0xf72e('0x3d')];}else{_0xb423d0['destination']=_0xb423d0['calleridnum'];_0xb423d0[_0xf72e('0x3e')]=_0xb423d0[_0xf72e('0x3f')];if(_0xb423d0[_0xf72e('0x43')]==_0xf72e('0x44')){_0xb423d0[_0xf72e('0x21')]=_0xb423d0[_0xf72e('0x45')];}else{_0xb423d0[_0xf72e('0x21')]='';}}}}else{_0xb423d0[_0xf72e('0x42')]=util[_0xf72e('0x26')](_0xf72e('0x46'),_0xb423d0['calleridname'],_0xb423d0[_0xf72e('0x3e')]);}RpcVoiceCallReport['create'](_0xb423d0);if(_0xb423d0['monitor']){for(var _0x1443bd=0x0;_0x1443bd<_0xb423d0['monitors']['length'];_0x1443bd+=0x1){_0xb423d0['monitorFilename']=_0xb423d0['monitors'][_0x1443bd]['filename'];_0xb423d0[_0xf72e('0x47')]=_0xb423d0[_0xf72e('0x48')][_0x1443bd][_0xf72e('0x47')];if(_0xb423d0['exten']==_0xf72e('0x3c')){_0xb423d0[_0xf72e('0x3e')]=_0xb423d0[_0xf72e('0x45')];_0xb423d0[_0xf72e('0x49')]=_0xb423d0[_0xf72e('0x4a')];_0xb423d0[_0xf72e('0x45')]=_0xb423d0[_0xf72e('0x21')];_0xb423d0[_0xf72e('0x4a')]=_0xb423d0[_0xf72e('0x4b')];_0xb423d0[_0xf72e('0x33')]=_0xb423d0[_0xf72e('0x3f')];}else if(_0xb423d0[_0xf72e('0x33')]==_0xf72e('0x4c')){_0xb423d0[_0xf72e('0x3e')]=_0xb423d0[_0xf72e('0x32')];_0xb423d0[_0xf72e('0x33')]=_0xb423d0[_0xf72e('0x3f')];}RpcVoiceRecording[_0xf72e('0x4d')](_0xb423d0);}}};Report['prototype']['voiceAgentReport']=function(_0x37cf97){if(_[_0xf72e('0x4e')](_0x37cf97)){_0x37cf97['forEach'](function(_0x9aa0b0){RpcVoiceAgentReport['create'](_0x9aa0b0);});}else{RpcVoiceAgentReport[_0xf72e('0x4d')](_0x37cf97);}};Report[_0xf72e('0x14')][_0xf72e('0x4f')]=function(_0x4b8e9f){RpcVoiceDialReport[_0xf72e('0x4d')](_0x4b8e9f);var _0x2d8a5a=undefined;var _0x59a39b=_0x4b8e9f['channel'];if(_[_0xf72e('0x50')](_0x59a39b,_0xf72e('0x51'))){var _0x455cd7=_0x59a39b[_0xf72e('0x52')](_0x59a39b['indexOf']('/')+0x1,_0x59a39b[_0xf72e('0x53')]('@'));_0x2d8a5a=_['find'](this['agents'],function(_0x1338fc){return _0x1338fc[_0xf72e('0x54')]==_0x455cd7||_0x1338fc[_0xf72e('0x55')]==_0x455cd7||_0x1338fc[_0xf72e('0x21')]==_0x455cd7;});}else{var _0x455cd7=_0x59a39b['substring'](_0x59a39b['indexOf']('/')+0x1,_0x59a39b['lastIndexOf']('-'));_0x2d8a5a=this['findAgent'](_0x455cd7);}if(_0x2d8a5a){_0x4b8e9f['interface']=_[_0xf72e('0x23')](_0x2d8a5a[_0xf72e('0x25')])?util['format']('SIP/%s',_0x2d8a5a[_0xf72e('0x22')]):_0x2d8a5a[_0xf72e('0x25')];_0x4b8e9f[_0xf72e('0x4b')]=_0x2d8a5a[_0xf72e('0x22')];_0x4b8e9f[_0xf72e('0x21')]=_0x2d8a5a[_0xf72e('0x21')];RpcMemberReport[_0xf72e('0x4f')](_0x4b8e9f);}};Report[_0xf72e('0x14')][_0xf72e('0x1e')]=function(_0x4c5b00){RpcVoiceTransferReport[_0xf72e('0x1e')](_0x4c5b00);};Report[_0xf72e('0x14')]['attendedTransfer']=function(_0x1b3ed0){RpcVoiceTransferReport[_0xf72e('0x1f')](_0x1b3ed0);};module[_0xf72e('0x56')]=Report; \ No newline at end of file +var _0xf280=['queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','voiceCallReport','destination','exten','type','lastapplication','queue','lastdata','from-voip-provider','callerid','context','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','disposition','\x22%s\x22\x20<%s>','calleridname','length','monitorFilename','monitors','filename','createdAt','connectedlinename','create','voiceAgentReport','Local','substring','indexOf','mobile','phone','lastIndexOf','membername','voiceDialReport','exports','bluebird','lodash','moment','util','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','name','find','accountcode','format','SIP/%s','connectedlinenum','lastAssignedTo','interface','isNil','queuecallercomplete'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0xf280,0x174));var _0x0f28=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xf280[_0x2fb87c];return _0x43038b;};'use strict';var BPromise=require(_0x0f28('0x0'));var _=require(_0x0f28('0x1'));var moment=require(_0x0f28('0x2'));var util=require(_0x0f28('0x3'));var config=require('../../../config/environment');var logger=require(_0x0f28('0x4'))(_0x0f28('0x5'));var ami=require(_0x0f28('0x6'));var RpcVoiceAgentReport=require(_0x0f28('0x7'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x0f28('0x8'));var RpcMemberReport=require(_0x0f28('0x9'));var RpcVoiceQueueReport=require(_0x0f28('0xa'));var RpcVoiceRecording=require(_0x0f28('0xb'));var RpcVoiceTransferReport=require(_0x0f28('0xc'));var VoiceQueueReport=require(_0x0f28('0xd'));var VoiceCallReport=require(_0x0f28('0xe'));var VoiceAgentReport=require(_0x0f28('0xf'));var VoiceDialReport=require(_0x0f28('0x10'));var UserReport=require('./userReport');function Report(_0x562bc9){this[_0x0f28('0x11')]=_0x562bc9;this[_0x0f28('0x12')]=_0x562bc9[_0x0f28('0x12')];this[_0x0f28('0x13')]=_0x562bc9['telephones'];}Report[_0x0f28('0x14')][_0x0f28('0x15')]=function(_0x5d973b){var _0x296c72=new VoiceQueueReport(this[_0x0f28('0x11')]);var _0x3741d3=new VoiceAgentReport(this[_0x0f28('0x11')]);var _0x4927cf=new VoiceDialReport(this['realtime']);var _0x2ba119=new VoiceCallReport(this[_0x0f28('0x11')]);var _0x14fe46=new UserReport(this[_0x0f28('0x11')]);if(config['xdr']&&config[_0x0f28('0x16')][_0x0f28('0x17')]){ami['on'](_0x0f28('0x18'),this[_0x0f28('0x19')][_0x0f28('0x1a')](this));ami['on'](_0x0f28('0x1b'),this['voiceCallReport'][_0x0f28('0x1a')](this));ami['on'](_0x0f28('0x1c'),this['voiceAgentReport']['bind'](this));ami['on']('custom:voiceDialReport',this['voiceDialReport']['bind'](this));ami['on'](_0x0f28('0x1d'),this[_0x0f28('0x1e')][_0x0f28('0x1a')](this));ami['on']('attendedtransfer',this[_0x0f28('0x1f')][_0x0f28('0x1a')](this));}};Report['prototype'][_0x0f28('0x20')]=function(_0x8b1f97){var _0x5aff8e=undefined;_0x5aff8e=_['find'](this[_0x0f28('0x12')],function(_0x3d69d6){return _0x3d69d6['accountcode']==_0x8b1f97||_0x3d69d6[_0x0f28('0x21')]==_0x8b1f97;});if(_['isNil'](_0x5aff8e)){var _0x141172=_[_0x0f28('0x22')](this[_0x0f28('0x13')],function(_0x411004){return _0x411004[_0x0f28('0x23')]==_0x8b1f97||_0x411004[_0x0f28('0x21')]==_0x8b1f97;});if(_0x141172){_0x5aff8e=_[_0x0f28('0x22')](this[_0x0f28('0x12')],function(_0x5460da){return _0x5460da['interface']==util[_0x0f28('0x24')](_0x0f28('0x25'),_0x141172[_0x0f28('0x21')]);});}}return _0x5aff8e;};Report[_0x0f28('0x14')][_0x0f28('0x19')]=function(_0x32a290){for(var _0x442b92=0x0;_0x442b92<_0x32a290['length'];_0x442b92+=0x1){var _0x225348=this[_0x0f28('0x20')](_0x32a290[_0x442b92][_0x0f28('0x26')]);if(_0x225348){_0x32a290[_0x442b92][_0x0f28('0x23')]=_0x225348[_0x0f28('0x23')];_0x32a290[_0x442b92]['assigned']=!![];_0x32a290[_0x442b92][_0x0f28('0x27')]=_0x225348[_0x0f28('0x21')];_0x32a290[_0x442b92][_0x0f28('0x28')]=_[_0x0f28('0x29')](_0x225348[_0x0f28('0x28')])?util[_0x0f28('0x24')](_0x0f28('0x25'),_0x225348[_0x0f28('0x21')]):_0x225348[_0x0f28('0x28')];if(_0x32a290[_0x442b92][_0x0f28('0x2a')]){_0x32a290[_0x442b92][_0x0f28('0x2b')]=moment()[_0x0f28('0x24')](_0x0f28('0x2c'));}if(_0x32a290[_0x442b92][_0x0f28('0x2d')]){_0x32a290[_0x442b92][_0x0f28('0x2e')]=moment()[_0x0f28('0x24')](_0x0f28('0x2c'));}RpcMemberReport[_0x0f28('0x19')](_0x32a290[_0x442b92]);}RpcVoiceQueueReport['create'](_0x32a290[_0x442b92]);}};function extractCalleridNumber(_0x2f5430){var _0xf50aae=_0x2f5430[_0x0f28('0x2f')](/<(.*?)>/);return _0xf50aae?_0xf50aae[0x1]:_0x2f5430;}Report[_0x0f28('0x14')][_0x0f28('0x30')]=function(_0x161c08){_0x161c08[_0x0f28('0x31')]=_0x161c08[_0x0f28('0x31')]||_0x161c08[_0x0f28('0x32')];if(_0x161c08[_0x0f28('0x33')]=='dialer'){_0x161c08[_0x0f28('0x34')]=_0x0f28('0x35');_0x161c08[_0x0f28('0x36')]=_0x161c08[_0x0f28('0x35')];if(_0x161c08['context']==_0x0f28('0x37')){_0x161c08[_0x0f28('0x23')]='';_0x161c08[_0x0f28('0x31')]=extractCalleridNumber(_0x161c08[_0x0f28('0x38')]);}else if(_0x161c08[_0x0f28('0x39')]=='from-sip'){if(_0x161c08[_0x0f28('0x31')]=='xcally-motion-preview'){_0x161c08[_0x0f28('0x31')]=extractCalleridNumber(_0x161c08[_0x0f28('0x3a')]);_0x161c08[_0x0f28('0x3b')]=_0x161c08['originatecalleridnum'];_0x161c08[_0x0f28('0x3c')]=[_0x161c08[_0x0f28('0x3d')],_0x161c08[_0x0f28('0x3d')]=_0x161c08[_0x0f28('0x3c')]][0x0];_0x161c08[_0x0f28('0x38')]=_0x161c08['calleridpreview'];}else{_0x161c08[_0x0f28('0x31')]=_0x161c08[_0x0f28('0x3b')];_0x161c08[_0x0f28('0x3b')]=_0x161c08[_0x0f28('0x3e')];if(_0x161c08[_0x0f28('0x3f')]=='ANSWERED'){_0x161c08[_0x0f28('0x23')]=_0x161c08[_0x0f28('0x26')];}else{_0x161c08[_0x0f28('0x23')]='';}}}}else{_0x161c08[_0x0f28('0x38')]=util[_0x0f28('0x24')](_0x0f28('0x40'),_0x161c08[_0x0f28('0x41')],_0x161c08['calleridnum']);}RpcVoiceCallReport['create'](_0x161c08);if(_0x161c08['monitor']){for(var _0x5e00bb=0x0;_0x5e00bb<_0x161c08['monitors'][_0x0f28('0x42')];_0x5e00bb+=0x1){_0x161c08[_0x0f28('0x43')]=_0x161c08[_0x0f28('0x44')][_0x5e00bb][_0x0f28('0x45')];_0x161c08['createdAt']=_0x161c08[_0x0f28('0x44')][_0x5e00bb][_0x0f28('0x46')];if(_0x161c08[_0x0f28('0x32')]=='xcally-motion-preview'){_0x161c08['calleridnum']=_0x161c08[_0x0f28('0x26')];_0x161c08[_0x0f28('0x41')]=_0x161c08[_0x0f28('0x47')];_0x161c08['connectedlinenum']=_0x161c08['accountcode'];_0x161c08[_0x0f28('0x47')]=_0x161c08['membername'];_0x161c08['exten']=_0x161c08[_0x0f28('0x3e')];}else if(_0x161c08[_0x0f28('0x32')]=='xcally-motion-dialer'){_0x161c08['calleridnum']=_0x161c08[_0x0f28('0x31')];_0x161c08[_0x0f28('0x32')]=_0x161c08[_0x0f28('0x3e')];}RpcVoiceRecording[_0x0f28('0x48')](_0x161c08);}}};Report['prototype'][_0x0f28('0x49')]=function(_0x286c26){if(_['isArray'](_0x286c26)){_0x286c26['forEach'](function(_0x46d4b2){RpcVoiceAgentReport[_0x0f28('0x48')](_0x46d4b2);});}else{RpcVoiceAgentReport[_0x0f28('0x48')](_0x286c26);}};Report[_0x0f28('0x14')]['voiceDialReport']=function(_0x1a323d){RpcVoiceDialReport[_0x0f28('0x48')](_0x1a323d);var _0x3593d3=undefined;var _0x20a884=_0x1a323d[_0x0f28('0x3d')];if(_['startsWith'](_0x20a884,_0x0f28('0x4a'))){var _0x255447=_0x20a884[_0x0f28('0x4b')](_0x20a884['indexOf']('/')+0x1,_0x20a884[_0x0f28('0x4c')]('@'));_0x3593d3=_[_0x0f28('0x22')](this[_0x0f28('0x12')],function(_0x3a31b8){return _0x3a31b8[_0x0f28('0x4d')]==_0x255447||_0x3a31b8[_0x0f28('0x4e')]==_0x255447||_0x3a31b8[_0x0f28('0x23')]==_0x255447;});}else{var _0x255447=_0x20a884[_0x0f28('0x4b')](_0x20a884[_0x0f28('0x4c')]('/')+0x1,_0x20a884[_0x0f28('0x4f')]('-'));_0x3593d3=this[_0x0f28('0x20')](_0x255447);}if(_0x3593d3){_0x1a323d[_0x0f28('0x28')]=_[_0x0f28('0x29')](_0x3593d3[_0x0f28('0x28')])?util['format'](_0x0f28('0x25'),_0x3593d3[_0x0f28('0x21')]):_0x3593d3[_0x0f28('0x28')];_0x1a323d[_0x0f28('0x50')]=_0x3593d3[_0x0f28('0x21')];_0x1a323d[_0x0f28('0x23')]=_0x3593d3[_0x0f28('0x23')];RpcMemberReport[_0x0f28('0x51')](_0x1a323d);}};Report[_0x0f28('0x14')][_0x0f28('0x1e')]=function(_0x2c2e46){RpcVoiceTransferReport[_0x0f28('0x1e')](_0x2c2e46);};Report[_0x0f28('0x14')][_0x0f28('0x1f')]=function(_0x2f13a4){RpcVoiceTransferReport[_0x0f28('0x1f')](_0x2f13a4);};module[_0x0f28('0x52')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 1c411a4..2bfe349 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 _0x924a=['stateRegistry','state','merge','omit','event','actionid','format','trunk:%s','name','trunk:save','[syncRegistry][UserReport]','device','inuse','local','toNumber','updateStatusRealtime','toLowerCase','stateTime','telephone:save','startsWith','Local','mobile','phone','peer','peerstatus','registered','address','status','telephone:%s','[syncPeerStatus][UserReport]','exports','lodash','moment','ioredis','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','devicestatechange','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','find','username'];(function(_0x3bfd1d,_0x575b15){var _0x341e4f=function(_0x1c7cf0){while(--_0x1c7cf0){_0x3bfd1d['push'](_0x3bfd1d['shift']());}};_0x341e4f(++_0x575b15);}(_0x924a,0x117));var _0xa924=function(_0x3b29cf,_0x171bc9){_0x3b29cf=_0x3b29cf-0x0;var _0x1dc73b=_0x924a[_0x3b29cf];return _0x1dc73b;};'use strict';var _=require(_0xa924('0x0'));var moment=require(_0xa924('0x1'));var BPromise=require('bluebird');var util=require('util');var Redis=require(_0xa924('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require('../ami');config[_0xa924('0x3')]=_[_0xa924('0x4')](config[_0xa924('0x3')],{'host':_0xa924('0x5'),'port':0x18eb});var io=require(_0xa924('0x6'))(new Redis(config['redis']));function UserReport(_0x1ab407){this[_0xa924('0x7')]=_0x1ab407['trunks'];this[_0xa924('0x8')]=_0x1ab407[_0xa924('0x8')];this[_0xa924('0x9')]=_0x1ab407['telephones'];ami['on'](_0xa924('0xa'),this[_0xa924('0xb')][_0xa924('0xc')](this));ami['on']('registry',this[_0xa924('0xb')][_0xa924('0xc')](this));ami['on'](_0xa924('0xd'),this['syncDeviceState'][_0xa924('0xc')](this));ami['on']('peerstatus',this[_0xa924('0xe')][_0xa924('0xc')](this));this[_0xa924('0xf')]();return BPromise[_0xa924('0x10')]()[_0xa924('0x11')](ami[_0xa924('0x12')]())[_0xa924('0x11')](ami[_0xa924('0x13')]())[_0xa924('0x11')](ami[_0xa924('0x14')]())[_0xa924('0x15')](loggerCatch(_0xa924('0x16')));}function loggerCatch(_0x55bd2a){return function(_0x43c360){logger[_0xa924('0x17')](_0x55bd2a,util[_0xa924('0x18')](_0x43c360,{'showHidden':![],'depth':null}));};}UserReport[_0xa924('0x19')][_0xa924('0xf')]=function(){setInterval(function(){BPromise['resolve']()[_0xa924('0x11')](ami[_0xa924('0x12')]())['then'](ami['actionDeviceStateList']())[_0xa924('0x11')](ami[_0xa924('0x14')]())[_0xa924('0x15')](loggerCatch(_0xa924('0x16')));},0x32c8);};UserReport[_0xa924('0x19')][_0xa924('0x1a')]=function(_0xc7f47d){return _0xc7f47d!==null&&!_[_0xa924('0x1b')](_0xc7f47d);};UserReport[_0xa924('0x19')][_0xa924('0x1c')]=function(_0x29bbaa,_0x473b57,_0x4c7681){io['to'](_0x29bbaa)[_0xa924('0x1c')](_0x473b57,_0x4c7681);};UserReport['prototype'][_0xa924('0xb')]=function(_0x13b22a){try{if(this[_0xa924('0x1a')](_0x13b22a)){var _0x87f45c=_[_0xa924('0x1d')](this[_0xa924('0x7')],{'registry':_0x13b22a[_0xa924('0x1e')]});if(_0x87f45c){_0x13b22a[_0xa924('0x1f')]=_0x13b22a[_0xa924('0x20')];_[_0xa924('0x21')](_0x87f45c,_[_0xa924('0x22')](_0x13b22a,[_0xa924('0x23'),_0xa924('0x24'),'username',_0xa924('0x20')]));this[_0xa924('0x1c')](util[_0xa924('0x25')](_0xa924('0x26'),_0x87f45c[_0xa924('0x27')]),_0xa924('0x28'),_0x87f45c);}}}catch(_0x50e1a0){logger[_0xa924('0x17')](_0xa924('0x29'),util['inspect'](_0x50e1a0,{'showHidden':![],'depth':null}));}};UserReport[_0xa924('0x19')]['syncDeviceState']=function(_0x5c0a3a){try{if(this[_0xa924('0x1a')](_0x5c0a3a)){if(this[_0xa924('0x8')][_0x5c0a3a[_0xa924('0x2a')]]){if(!this[_0xa924('0x8')][_0x5c0a3a[_0xa924('0x2a')]]['local']||_0x5c0a3a[_0xa924('0x20')]['toLowerCase']()==_0xa924('0x2b')){this[_0xa924('0x8')][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x2c')]=![];if(this[_0xa924('0x8')][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x20')]!==_0x5c0a3a[_0xa924('0x20')]['toLowerCase']()){this[_0xa924('0x8')][_0x5c0a3a[_0xa924('0x2a')]]['stateTime']=_[_0xa924('0x2d')](moment()[_0xa924('0x25')]('x'));}this[_0xa924('0x8')][_0x5c0a3a[_0xa924('0x2a')]]['state']=_0x5c0a3a[_0xa924('0x20')]['toLowerCase']();this['agents'][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x2e')](_0x5c0a3a);}}else if(this[_0xa924('0x9')][_0x5c0a3a['device']]){if(this[_0xa924('0x9')][_0x5c0a3a['device']][_0xa924('0x20')]!==_0x5c0a3a[_0xa924('0x20')][_0xa924('0x2f')]()){this['telephones'][_0x5c0a3a['device']][_0xa924('0x30')]=_[_0xa924('0x2d')](moment()[_0xa924('0x25')]('x'));}this[_0xa924('0x9')][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x20')]=_0x5c0a3a[_0xa924('0x20')][_0xa924('0x2f')]();this['emit'](util['format']('telephone:%s',this[_0xa924('0x9')][_0x5c0a3a[_0xa924('0x2a')]]['name']),_0xa924('0x31'),this[_0xa924('0x9')][_0x5c0a3a[_0xa924('0x2a')]]);}else if(this[_0xa924('0x7')][_0x5c0a3a[_0xa924('0x2a')]]){if(this['trunks'][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x20')]!==_0x5c0a3a[_0xa924('0x20')][_0xa924('0x2f')]()){this[_0xa924('0x7')][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x30')]=_['toNumber'](moment()[_0xa924('0x25')]('x'));}this['trunks'][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x20')]=_0x5c0a3a[_0xa924('0x20')][_0xa924('0x2f')]();this[_0xa924('0x1c')](util['format']('trunk:%s',this[_0xa924('0x7')][_0x5c0a3a[_0xa924('0x2a')]][_0xa924('0x27')]),_0xa924('0x28'),this[_0xa924('0x7')][_0x5c0a3a[_0xa924('0x2a')]]);}else if(_[_0xa924('0x32')](_0x5c0a3a[_0xa924('0x2a')],'Queue')){}else if(_['startsWith'](_0x5c0a3a[_0xa924('0x2a')],_0xa924('0x33'))){var _0x15f870=_0x5c0a3a[_0xa924('0x2a')];var _0x22922d=_0x15f870['substring'](_0x15f870['indexOf']('/')+0x1,_0x15f870['indexOf']('@'));var _0x3e652f=_[_0xa924('0x1d')](this[_0xa924('0x8')],function(_0x609493){return _0x609493[_0xa924('0x34')]==_0x22922d||_0x609493[_0xa924('0x35')]==_0x22922d||_0x609493['accountcode']==_0x22922d;});if(_0x3e652f){if(_0x3e652f[_0xa924('0x20')]!==_0x5c0a3a[_0xa924('0x20')]['toLowerCase']()){_0x3e652f[_0xa924('0x30')]=_[_0xa924('0x2d')](moment()[_0xa924('0x25')]('x'));}_0x3e652f[_0xa924('0x20')]=_0x5c0a3a[_0xa924('0x20')][_0xa924('0x2f')]();_0x3e652f[_0xa924('0x2c')]=!![];_0x3e652f[_0xa924('0x2e')](_0x5c0a3a);}}else{}}}catch(_0x1c08ef){logger[_0xa924('0x17')]('[syncDeviceState][UserReport]',util['inspect'](_0x1c08ef,{'showHidden':![],'depth':null}));}};UserReport[_0xa924('0x19')]['syncPeerStatus']=function(_0x18cadc){try{if(this[_0xa924('0x1a')](_0x18cadc)&&this[_0xa924('0x1a')](_0x18cadc['peerstatus'])){if(this[_0xa924('0x8')][_0x18cadc[_0xa924('0x36')]]){if(!this[_0xa924('0x8')][_0x18cadc[_0xa924('0x36')]][_0xa924('0x2c')]||_0x18cadc[_0xa924('0x37')][_0xa924('0x2f')]()==_0xa924('0x38')){this[_0xa924('0x8')][_0x18cadc['peer']][_0xa924('0x2c')]=![];this[_0xa924('0x8')][_0x18cadc[_0xa924('0x36')]]['status']=_0x18cadc[_0xa924('0x37')][_0xa924('0x2f')]();this[_0xa924('0x8')][_0x18cadc[_0xa924('0x36')]][_0xa924('0x39')]=_0x18cadc[_0xa924('0x39')];this[_0xa924('0x8')][_0x18cadc['peer']][_0xa924('0x2e')](_0x18cadc);}}else if(this[_0xa924('0x9')][_0x18cadc[_0xa924('0x36')]]){this['telephones'][_0x18cadc[_0xa924('0x36')]][_0xa924('0x3a')]=_0x18cadc['peerstatus'][_0xa924('0x2f')]();this['telephones'][_0x18cadc['peer']][_0xa924('0x39')]=_0x18cadc[_0xa924('0x39')];this[_0xa924('0x1c')](util['format'](_0xa924('0x3b'),this[_0xa924('0x9')][_0x18cadc[_0xa924('0x36')]][_0xa924('0x27')]),'telephone:save',this[_0xa924('0x9')][_0x18cadc[_0xa924('0x36')]]);}else if(this[_0xa924('0x7')][_0x18cadc['peer']]){this[_0xa924('0x7')][_0x18cadc[_0xa924('0x36')]][_0xa924('0x3a')]=_0x18cadc[_0xa924('0x37')][_0xa924('0x2f')]();this[_0xa924('0x7')][_0x18cadc[_0xa924('0x36')]][_0xa924('0x39')]=_0x18cadc[_0xa924('0x39')];this[_0xa924('0x1c')](util[_0xa924('0x25')](_0xa924('0x26'),this[_0xa924('0x7')][_0x18cadc[_0xa924('0x36')]][_0xa924('0x27')]),_0xa924('0x28'),this[_0xa924('0x7')][_0x18cadc['peer']]);}else{}}}catch(_0x3958b6){logger[_0xa924('0x17')](_0xa924('0x3c'),util[_0xa924('0x18')](_0x3958b6,{'showHidden':![],'depth':null}));}};module[_0xa924('0x3d')]=UserReport; \ No newline at end of file +var _0x4761=['syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','find','username','state','merge','event','actionid','format','trunk:%s','name','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','trunks','trunk:save','startsWith','Queue','Local','substring','indexOf','mobile','peer','registered','address','status','util','ioredis','../../../config/logger','ami','../ami','defaults','socket.io-emitter','redis','agents','telephones','registryentry','bind','registry','syncRegistry','devicestatechange'];(function(_0xaa5be9,_0x3e59fb){var _0x30a168=function(_0x1a0796){while(--_0x1a0796){_0xaa5be9['push'](_0xaa5be9['shift']());}};_0x30a168(++_0x3e59fb);}(_0x4761,0x1e9));var _0x1476=function(_0xa2d7cc,_0x25e17e){_0xa2d7cc=_0xa2d7cc-0x0;var _0x3cfb61=_0x4761[_0xa2d7cc];return _0x3cfb61;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x1476('0x0'));var Redis=require(_0x1476('0x1'));var config=require('../../../config/environment');var logger=require(_0x1476('0x2'))(_0x1476('0x3'));var ami=require(_0x1476('0x4'));config['redis']=_[_0x1476('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1476('0x6'))(new Redis(config[_0x1476('0x7')]));function UserReport(_0x17849f){this['trunks']=_0x17849f['trunks'];this[_0x1476('0x8')]=_0x17849f[_0x1476('0x8')];this[_0x1476('0x9')]=_0x17849f['telephones'];ami['on'](_0x1476('0xa'),this['syncRegistry'][_0x1476('0xb')](this));ami['on'](_0x1476('0xc'),this[_0x1476('0xd')][_0x1476('0xb')](this));ami['on'](_0x1476('0xe'),this[_0x1476('0xf')][_0x1476('0xb')](this));ami['on'](_0x1476('0x10'),this[_0x1476('0x11')]['bind'](this));this[_0x1476('0x12')]();return BPromise[_0x1476('0x13')]()[_0x1476('0x14')](ami[_0x1476('0x15')]())[_0x1476('0x14')](ami[_0x1476('0x16')]())['then'](ami[_0x1476('0x17')]())[_0x1476('0x18')](loggerCatch(_0x1476('0x19')));}function loggerCatch(_0x2149f2){return function(_0x2d02dc){logger[_0x1476('0x1a')](_0x2149f2,util[_0x1476('0x1b')](_0x2d02dc,{'showHidden':![],'depth':null}));};}UserReport[_0x1476('0x1c')][_0x1476('0x12')]=function(){setInterval(function(){BPromise[_0x1476('0x13')]()[_0x1476('0x14')](ami[_0x1476('0x15')]())['then'](ami['actionDeviceStateList']())[_0x1476('0x14')](ami[_0x1476('0x17')]())[_0x1476('0x18')](loggerCatch(_0x1476('0x19')));},0x32c8);};UserReport[_0x1476('0x1c')][_0x1476('0x1d')]=function(_0x4bded9){return _0x4bded9!==null&&!_[_0x1476('0x1e')](_0x4bded9);};UserReport[_0x1476('0x1c')][_0x1476('0x1f')]=function(_0x2a1957,_0x186222,_0x449c1b){io['to'](_0x2a1957)[_0x1476('0x1f')](_0x186222,_0x449c1b);};UserReport[_0x1476('0x1c')][_0x1476('0xd')]=function(_0x46633a){try{if(this[_0x1476('0x1d')](_0x46633a)){var _0xec8e2=_[_0x1476('0x20')](this['trunks'],{'registry':_0x46633a[_0x1476('0x21')]});if(_0xec8e2){_0x46633a['stateRegistry']=_0x46633a[_0x1476('0x22')];_[_0x1476('0x23')](_0xec8e2,_['omit'](_0x46633a,[_0x1476('0x24'),_0x1476('0x25'),'username',_0x1476('0x22')]));this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x27'),_0xec8e2[_0x1476('0x28')]),'trunk:save',_0xec8e2);}}}catch(_0x25b8d2){logger[_0x1476('0x1a')](_0x1476('0x29'),util[_0x1476('0x1b')](_0x25b8d2,{'showHidden':![],'depth':null}));}};UserReport[_0x1476('0x1c')][_0x1476('0xf')]=function(_0x58c701){try{if(this[_0x1476('0x1d')](_0x58c701)){if(this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]]){if(!this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2b')]||_0x58c701['state'][_0x1476('0x2c')]()==_0x1476('0x2d')){this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2b')]=![];if(this[_0x1476('0x8')][_0x58c701['device']][_0x1476('0x22')]!==_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]()){this[_0x1476('0x8')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2e')]=_[_0x1476('0x2f')](moment()['format']('x'));}this[_0x1476('0x8')][_0x58c701['device']][_0x1476('0x22')]=_0x58c701['state'][_0x1476('0x2c')]();this['agents'][_0x58c701['device']][_0x1476('0x30')](_0x58c701);}}else if(this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]]){if(this[_0x1476('0x9')][_0x58c701['device']][_0x1476('0x22')]!==_0x58c701[_0x1476('0x22')]['toLowerCase']()){this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2e')]=_[_0x1476('0x2f')](moment()[_0x1476('0x26')]('x'));}this['telephones'][_0x58c701[_0x1476('0x2a')]][_0x1476('0x22')]=_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]();this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x31'),this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x28')]),_0x1476('0x32'),this[_0x1476('0x9')][_0x58c701[_0x1476('0x2a')]]);}else if(this[_0x1476('0x33')][_0x58c701[_0x1476('0x2a')]]){if(this['trunks'][_0x58c701[_0x1476('0x2a')]]['state']!==_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]()){this[_0x1476('0x33')][_0x58c701[_0x1476('0x2a')]][_0x1476('0x2e')]=_[_0x1476('0x2f')](moment()['format']('x'));}this[_0x1476('0x33')][_0x58c701['device']][_0x1476('0x22')]=_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]();this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x27'),this[_0x1476('0x33')][_0x58c701['device']]['name']),_0x1476('0x34'),this[_0x1476('0x33')][_0x58c701[_0x1476('0x2a')]]);}else if(_[_0x1476('0x35')](_0x58c701[_0x1476('0x2a')],_0x1476('0x36'))){}else if(_[_0x1476('0x35')](_0x58c701[_0x1476('0x2a')],_0x1476('0x37'))){var _0x36c805=_0x58c701['device'];var _0x1e0249=_0x36c805[_0x1476('0x38')](_0x36c805[_0x1476('0x39')]('/')+0x1,_0x36c805[_0x1476('0x39')]('@'));var _0x52ffdf=_['find'](this[_0x1476('0x8')],function(_0x2dee69){return _0x2dee69[_0x1476('0x3a')]==_0x1e0249||_0x2dee69['phone']==_0x1e0249||_0x2dee69['accountcode']==_0x1e0249;});if(_0x52ffdf){if(_0x52ffdf[_0x1476('0x22')]!==_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]()){_0x52ffdf['stateTime']=_[_0x1476('0x2f')](moment()['format']('x'));}_0x52ffdf[_0x1476('0x22')]=_0x58c701[_0x1476('0x22')][_0x1476('0x2c')]();_0x52ffdf['local']=!![];_0x52ffdf[_0x1476('0x30')](_0x58c701);}}else{}}}catch(_0x4f4498){logger[_0x1476('0x1a')]('[syncDeviceState][UserReport]',util[_0x1476('0x1b')](_0x4f4498,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x1476('0x11')]=function(_0x5be111){try{if(this[_0x1476('0x1d')](_0x5be111)&&this[_0x1476('0x1d')](_0x5be111[_0x1476('0x10')])){if(this['agents'][_0x5be111[_0x1476('0x3b')]]){if(!this[_0x1476('0x8')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x2b')]||_0x5be111[_0x1476('0x10')][_0x1476('0x2c')]()==_0x1476('0x3c')){this['agents'][_0x5be111[_0x1476('0x3b')]][_0x1476('0x2b')]=![];this[_0x1476('0x8')][_0x5be111[_0x1476('0x3b')]]['status']=_0x5be111[_0x1476('0x10')]['toLowerCase']();this[_0x1476('0x8')][_0x5be111[_0x1476('0x3b')]]['address']=_0x5be111[_0x1476('0x3d')];this['agents'][_0x5be111[_0x1476('0x3b')]][_0x1476('0x30')](_0x5be111);}}else if(this[_0x1476('0x9')][_0x5be111[_0x1476('0x3b')]]){this[_0x1476('0x9')][_0x5be111['peer']]['status']=_0x5be111[_0x1476('0x10')]['toLowerCase']();this['telephones'][_0x5be111['peer']][_0x1476('0x3d')]=_0x5be111[_0x1476('0x3d')];this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x31'),this[_0x1476('0x9')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x28')]),_0x1476('0x32'),this[_0x1476('0x9')][_0x5be111['peer']]);}else if(this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]]){this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x3e')]=_0x5be111['peerstatus'][_0x1476('0x2c')]();this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x3d')]=_0x5be111['address'];this[_0x1476('0x1f')](util[_0x1476('0x26')](_0x1476('0x27'),this[_0x1476('0x33')][_0x5be111[_0x1476('0x3b')]][_0x1476('0x28')]),'trunk:save',this[_0x1476('0x33')][_0x5be111['peer']]);}else{}}}catch(_0x2e724d){logger[_0x1476('0x1a')]('[syncPeerStatus][UserReport]',util[_0x1476('0x1b')](_0x2e724d,{'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 a0787cd..22e634f 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 _0x6b43=['[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','custom:voiceAgentReport','values','transfereeuniqueid','origtransfereruniqueid','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','diff','seconds','[syncBlindTransfer][VoiceAgentReport]','substring','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','channel','lastIndexOf','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','redis','localhost','socket.io-emitter','channels','agents','agentcalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','emit','prototype','isNotNull','isUndefined','syncAgentCalled','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','variables','voiceQueues','queue','inbound','merge','omit','event','privilege','custom:agentcalled','membername','user:called','[syncAgentCalled][VoiceAgentReport]','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','pick','destconnectedlinenum','user:%s','user:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','error','[syncAgentConnect][VoiceAgentReport]','inspect','rejected','lastevent','[syncAgentRingNoAnswer][VoiceAgentReport]','reason','abandoned','custom:agentqueuecallerabandon','agentcompleteAt','complete','talktime','transfer','agent','acw','agentacw','acwTimeout','interface','user:agentcomplete','custom:agentcomplete'];(function(_0x436b7f,_0xe5b65f){var _0x590b79=function(_0x12d633){while(--_0x12d633){_0x436b7f['push'](_0x436b7f['shift']());}};_0x590b79(++_0xe5b65f);}(_0x6b43,0xa2));var _0x36b4=function(_0x25643e,_0x1b0548){_0x25643e=_0x25643e-0x0;var _0xd13e2c=_0x6b43[_0x25643e];return _0xd13e2c;};'use strict';var _=require(_0x36b4('0x0'));var moment=require('moment');var util=require(_0x36b4('0x1'));var Redis=require(_0x36b4('0x2'));var config=require(_0x36b4('0x3'));var logger=require(_0x36b4('0x4'))('ami');var ami=require('../ami');config[_0x36b4('0x5')]=_['defaults'](config['redis'],{'host':_0x36b4('0x6'),'port':0x18eb});var io=require(_0x36b4('0x7'))(new Redis(config[_0x36b4('0x5')]));function VoiceAgentReport(_0x544696){this[_0x36b4('0x8')]={};this['voiceQueues']=_0x544696['voiceQueues'];this[_0x36b4('0x9')]=_0x544696['agents'];this['variables']={};ami['on'](_0x36b4('0xa'),this['syncAgentCalled']['bind'](this));ami['on'](_0x36b4('0xb'),this[_0x36b4('0xc')][_0x36b4('0xd')](this));ami['on'](_0x36b4('0xe'),this[_0x36b4('0xf')]['bind'](this));ami['on'](_0x36b4('0x10'),this[_0x36b4('0x11')][_0x36b4('0xd')](this));ami['on'](_0x36b4('0x12'),this[_0x36b4('0x13')][_0x36b4('0xd')](this));ami['on']('varset',this[_0x36b4('0x14')][_0x36b4('0xd')](this));ami['on'](_0x36b4('0x15'),this[_0x36b4('0x16')][_0x36b4('0xd')](this));ami['on'](_0x36b4('0x17'),this[_0x36b4('0x18')][_0x36b4('0xd')](this));ami['on'](_0x36b4('0x19'),this[_0x36b4('0x1a')][_0x36b4('0xd')](this));ami['on'](_0x36b4('0x1b'),this[_0x36b4('0x1c')][_0x36b4('0xd')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x36b4('0xd')](this));}VoiceAgentReport['prototype']['emit']=function(_0x41d331,_0x373cbb,_0x50c6c1){io['to'](_0x41d331)[_0x36b4('0x1d')](_0x373cbb,_0x50c6c1);};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0x1f')]=function(_0x415c5e){return _0x415c5e!==null&&!_[_0x36b4('0x20')](_0x415c5e);};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0x21')]=function(_0x560313){try{if(this[_0x36b4('0x1f')](_0x560313)){if(_['isUndefined'](this['channels'][_0x560313[_0x36b4('0x22')]])){this[_0x36b4('0x8')][_0x560313[_0x36b4('0x22')]]={};}if(_[_0x36b4('0x20')](this[_0x36b4('0x8')][_0x560313[_0x36b4('0x22')]][_0x560313[_0x36b4('0x23')]])){this[_0x36b4('0x8')][_0x560313[_0x36b4('0x22')]][_0x560313['destuniqueid']]={'agentcalledAt':moment()[_0x36b4('0x24')](_0x36b4('0x25')),'lastevent':'called','variables':this[_0x36b4('0x26')][_0x560313['uniqueid']],'type':this[_0x36b4('0x27')][_0x560313[_0x36b4('0x28')]]?this[_0x36b4('0x27')][_0x560313[_0x36b4('0x28')]]['type']||_0x36b4('0x29'):_0x36b4('0x29')};}_[_0x36b4('0x2a')](this[_0x36b4('0x8')][_0x560313['uniqueid']][_0x560313['destuniqueid']],_[_0x36b4('0x2b')](_0x560313,[_0x36b4('0x2c'),_0x36b4('0x2d')]));ami['emit'](_0x36b4('0x2e'),this['channels'][_0x560313[_0x36b4('0x22')]][_0x560313[_0x36b4('0x23')]]);this[_0x36b4('0x1d')](util[_0x36b4('0x24')]('user:%s',_0x560313[_0x36b4('0x2f')]),_0x36b4('0x30'),this[_0x36b4('0x8')][_0x560313[_0x36b4('0x22')]][_0x560313['destuniqueid']]);}}catch(_0x64a0f){logger['error'](_0x36b4('0x31'),util['inspect'](_0x64a0f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0xc')]=function(_0x1a68dd){try{if(this['isNotNull'](_0x1a68dd)){if(this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]]){for(var _0x5c0223 in this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]]){if(this[_0x36b4('0x8')][_0x1a68dd['uniqueid']][_0x36b4('0x32')](_0x5c0223)){if(_0x1a68dd[_0x36b4('0x23')]===_0x5c0223){this['channels'][_0x1a68dd['uniqueid']][_0x5c0223][_0x36b4('0x33')]=moment()[_0x36b4('0x24')](_0x36b4('0x25'));this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223]['lastevent']=_0x36b4('0x34');this['channels'][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0x35')]=_0x1a68dd[_0x36b4('0x35')];this['channels'][_0x1a68dd['uniqueid']][_0x5c0223][_0x36b4('0x36')]=_0x1a68dd[_0x36b4('0x36')];this['channels'][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0x37')]=_0x1a68dd[_0x36b4('0x37')];this['channels'][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0x38')]=_0x1a68dd[_0x36b4('0x38')];this['channels'][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223]['destchannelstatedesc']=_0x1a68dd[_0x36b4('0x39')];_['merge'](this[_0x36b4('0x9')][_0x1a68dd['interface']],_[_0x36b4('0x3a')](_0x1a68dd,[_0x36b4('0x28'),_0x36b4('0x3b')]));this[_0x36b4('0x1d')](util['format'](_0x36b4('0x3c'),_0x1a68dd[_0x36b4('0x2f')]),_0x36b4('0x3d'),this['channels'][_0x1a68dd['uniqueid']][_0x1a68dd[_0x36b4('0x23')]]);ami[_0x36b4('0x1d')]('custom:agentconnect',this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223]);}else if(!this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0xe')]&&!this['channels'][_0x1a68dd['uniqueid']][_0x5c0223][_0x36b4('0x12')]){this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0xe')]=!![];this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0x3e')]=moment()[_0x36b4('0x24')](_0x36b4('0x25'));this[_0x36b4('0x8')][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223]['reason']=_0x36b4('0x3f');this[_0x36b4('0x8')][_0x1a68dd['uniqueid']][_0x5c0223]['lastevent']=_0x36b4('0x3f');this['channels'][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0x40')]=_0x1a68dd[_0x36b4('0x23')];this['channels'][_0x1a68dd[_0x36b4('0x22')]][_0x5c0223][_0x36b4('0x41')]=_0x1a68dd[_0x36b4('0x2f')];ami[_0x36b4('0x1d')]('custom:agentansweredelsewhere',this[_0x36b4('0x8')][_0x1a68dd['uniqueid']][_0x5c0223]);}}}}}}catch(_0x53431b){logger[_0x36b4('0x42')](_0x36b4('0x43'),util[_0x36b4('0x44')](_0x53431b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0xf')]=function(_0x359933){try{if(this['isNotNull'](_0x359933)){if(this['channels'][_0x359933['uniqueid']]&&this[_0x36b4('0x8')][_0x359933['uniqueid']][_0x359933[_0x36b4('0x23')]]){this[_0x36b4('0x8')][_0x359933['uniqueid']][_0x359933['destuniqueid']][_0x36b4('0xe')]=!![];this[_0x36b4('0x8')][_0x359933['uniqueid']][_0x359933[_0x36b4('0x23')]][_0x36b4('0x3e')]=moment()['format'](_0x36b4('0x25'));this[_0x36b4('0x8')][_0x359933[_0x36b4('0x22')]][_0x359933[_0x36b4('0x23')]]['reason']=_0x36b4('0x45');this[_0x36b4('0x8')][_0x359933[_0x36b4('0x22')]][_0x359933['destuniqueid']][_0x36b4('0x46')]='rejected';ami[_0x36b4('0x1d')]('custom:agentringnoanswer',this[_0x36b4('0x8')][_0x359933[_0x36b4('0x22')]][_0x359933['destuniqueid']]);}}}catch(_0x30180a){logger[_0x36b4('0x42')](_0x36b4('0x47'),util[_0x36b4('0x44')](_0x30180a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')]['syncQueueCallerAbandon']=function(_0x5cfb69){try{if(this[_0x36b4('0x1f')](_0x5cfb69)){if(this[_0x36b4('0x8')][_0x5cfb69[_0x36b4('0x22')]]){for(var _0x218d6a in this[_0x36b4('0x8')][_0x5cfb69['uniqueid']]){if(this[_0x36b4('0x8')][_0x5cfb69[_0x36b4('0x22')]][_0x36b4('0x32')](_0x218d6a)&&!this['channels'][_0x5cfb69[_0x36b4('0x22')]][_0x218d6a][_0x36b4('0xe')]&&!this['channels'][_0x5cfb69[_0x36b4('0x22')]][_0x218d6a][_0x36b4('0x12')]){this['channels'][_0x5cfb69[_0x36b4('0x22')]][_0x218d6a]['agentringnoanswer']=!![];this['channels'][_0x5cfb69[_0x36b4('0x22')]][_0x218d6a][_0x36b4('0x3e')]=moment()[_0x36b4('0x24')](_0x36b4('0x25'));this[_0x36b4('0x8')][_0x5cfb69[_0x36b4('0x22')]][_0x218d6a][_0x36b4('0x48')]=_0x36b4('0x49');this['channels'][_0x5cfb69['uniqueid']][_0x218d6a][_0x36b4('0x46')]=_0x36b4('0x49');ami[_0x36b4('0x1d')](_0x36b4('0x4a'),this['channels'][_0x5cfb69[_0x36b4('0x22')]][_0x218d6a]);}}}}}catch(_0x2da1f0){logger['error']('[syncQueueCallerAbandon][VoiceAgentReport]',util['inspect'](_0x2da1f0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')]['syncAgentComplete']=function(_0x56cbb9){try{if(this[_0x36b4('0x1f')](_0x56cbb9)){if(this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]]){for(var _0x18fa72 in this['channels'][_0x56cbb9[_0x36b4('0x22')]]){if(this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]]['hasOwnProperty'](_0x18fa72)){if(this['channels'][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72][_0x36b4('0x33')]&&!this[_0x36b4('0x8')][_0x56cbb9['uniqueid']][_0x18fa72]['agentcomplete']){this['channels'][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72][_0x36b4('0x12')]=!![];this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72][_0x36b4('0x4b')]=moment()[_0x36b4('0x24')](_0x36b4('0x25'));this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72][_0x36b4('0x46')]=_0x36b4('0x4c');this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72][_0x36b4('0x4d')]=_0x56cbb9['talktime'];this['channels'][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72]['reason']=_0x56cbb9[_0x36b4('0x48')]==_0x36b4('0x4e')?_0x36b4('0x4f'):_0x56cbb9['reason'];if(this[_0x36b4('0x27')][_0x56cbb9[_0x36b4('0x28')]]&&this[_0x36b4('0x27')][_0x56cbb9[_0x36b4('0x28')]][_0x36b4('0x50')]){this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72][_0x36b4('0x51')]=!![];this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72]['acwtime']=this[_0x36b4('0x27')][_0x56cbb9[_0x36b4('0x28')]][_0x36b4('0x52')];}this[_0x36b4('0x9')][_0x56cbb9[_0x36b4('0x53')]]=_[_0x36b4('0x2b')](this['agents'][_0x56cbb9[_0x36b4('0x53')]],[_0x36b4('0x28'),_0x36b4('0x3b')]);this['emit'](util[_0x36b4('0x24')](_0x36b4('0x3c'),_0x56cbb9[_0x36b4('0x2f')]),_0x36b4('0x54'),this[_0x36b4('0x8')][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72]);ami[_0x36b4('0x1d')](_0x36b4('0x55'),this['channels'][_0x56cbb9[_0x36b4('0x22')]][_0x18fa72]);}}}}}}catch(_0x470729){logger[_0x36b4('0x42')](_0x36b4('0x56'),util['inspect'](_0x470729,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x36b4('0x14')]=function(_0x58cd75){try{if(this[_0x36b4('0x1f')](_0x58cd75)){this[_0x36b4('0x57')](_0x58cd75[_0x36b4('0x22')],_[_0x36b4('0x58')](_0x58cd75[_0x36b4('0x59')])[0x0],_0x58cd75[_0x36b4('0x5a')]);if(this[_0x36b4('0x8')][_0x58cd75[_0x36b4('0x22')]]){for(var _0xee7f2b in this[_0x36b4('0x8')][_0x58cd75[_0x36b4('0x22')]]){if(this['channels'][_0x58cd75[_0x36b4('0x22')]][_0x36b4('0x32')](_0xee7f2b)){if(_[_0x36b4('0x20')](this[_0x36b4('0x8')][_0x58cd75[_0x36b4('0x22')]][_0xee7f2b]['variables'])){this[_0x36b4('0x8')][_0x58cd75[_0x36b4('0x22')]][_0xee7f2b][_0x36b4('0x26')]={};}this[_0x36b4('0x8')][_0x58cd75[_0x36b4('0x22')]][_0xee7f2b]['variables']=this[_0x36b4('0x26')][_0x58cd75[_0x36b4('0x22')]];}}}}}catch(_0x33042d){logger['error']('[syncVarSet][VoiceAgentReport]',util['inspect'](_0x33042d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0x57')]=function(_0x46f4b1,_0x456259,_0x40c8b9){var _0x4cc364=[_0x36b4('0x5b'),'rtpaudioqosbridged',_0x36b4('0x5c'),'rtpaudioqosjitterbridged',_0x36b4('0x5d'),'rtpaudioqoslossbridged',_0x36b4('0x5e'),'rtpaudioqosrttbridged',_0x36b4('0x5f'),_0x36b4('0x60'),_0x36b4('0x61'),_0x36b4('0x62'),_0x36b4('0x63'),_0x36b4('0x64'),_0x36b4('0x65'),_0x36b4('0x66'),'membername',_0x36b4('0x67'),_0x36b4('0x68')];if(!_[_0x36b4('0x69')](_0x456259)&&!_[_0x36b4('0x6a')](_0x4cc364,_0x456259)){if(_[_0x36b4('0x20')](this[_0x36b4('0x26')][_0x46f4b1])){this[_0x36b4('0x26')][_0x46f4b1]={};}this['variables'][_0x46f4b1][_0x456259]=_0x40c8b9;}};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0x16')]=function(_0x138ed8){try{if(this[_0x36b4('0x1f')](_0x138ed8)){if(this[_0x36b4('0x8')][_0x138ed8[_0x36b4('0x22')]]){for(var _0x5af958 in this[_0x36b4('0x8')][_0x138ed8[_0x36b4('0x22')]]){if(this['channels'][_0x138ed8[_0x36b4('0x22')]][_0x36b4('0x32')](_0x5af958)){if(this[_0x36b4('0x8')][_0x138ed8[_0x36b4('0x22')]][_0x5af958]['reason']==_0x36b4('0x4e')&&this[_0x36b4('0x8')][_0x138ed8['uniqueid']][_0x5af958][_0x36b4('0x12')]){this[_0x36b4('0x8')][_0x138ed8[_0x36b4('0x22')]][_0x5af958][_0x36b4('0x4b')]=moment()[_0x36b4('0x24')](_0x36b4('0x25'));}}}ami[_0x36b4('0x1d')](_0x36b4('0x6b'),_[_0x36b4('0x6c')](this[_0x36b4('0x8')][_0x138ed8[_0x36b4('0x22')]]));delete this[_0x36b4('0x8')][_0x138ed8[_0x36b4('0x22')]];}if(this[_0x36b4('0x26')][_0x138ed8[_0x36b4('0x22')]]){delete this['variables'][_0x138ed8[_0x36b4('0x22')]];}}}catch(_0x5a2a29){logger[_0x36b4('0x42')]('[syncHangup][VoiceAgentReport]',util['inspect'](_0x5a2a29,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')]['syncAttendedTransfer']=function(_0x149d86){try{if(this[_0x36b4('0x1f')](_0x149d86)){if(this['channels'][_0x149d86[_0x36b4('0x6d')]]){for(var _0x3e8b4f in this[_0x36b4('0x8')][_0x149d86[_0x36b4('0x6d')]]){if(this['channels'][_0x149d86[_0x36b4('0x6d')]][_0x36b4('0x32')](_0x3e8b4f)){if(_0x149d86[_0x36b4('0x6e')]===_0x3e8b4f){var _0x18a93b=moment();this['channels'][_0x149d86[_0x36b4('0x6d')]][_0x3e8b4f][_0x36b4('0x12')]=!![];this[_0x36b4('0x8')][_0x149d86[_0x36b4('0x6d')]][_0x3e8b4f][_0x36b4('0x4b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x149d86[_0x36b4('0x6d')]][_0x3e8b4f][_0x36b4('0x48')]='transfer';this[_0x36b4('0x8')][_0x149d86['transfereeuniqueid']][_0x3e8b4f]['lastevent']=_0x36b4('0x4c');this[_0x36b4('0x8')][_0x149d86['transfereeuniqueid']][_0x3e8b4f][_0x36b4('0x4d')]=_0x18a93b['diff'](this['channels'][_0x149d86[_0x36b4('0x6d')]][_0x3e8b4f][_0x36b4('0x33')],'seconds');}}}}if(this[_0x36b4('0x8')][_0x149d86[_0x36b4('0x6f')]]){var _0x2b616e=this[_0x36b4('0x8')][_0x149d86[_0x36b4('0x6f')]];this[_0x36b4('0x8')][_0x149d86[_0x36b4('0x6f')]]=this[_0x36b4('0x8')][_0x149d86[_0x36b4('0x6d')]];this[_0x36b4('0x8')][_0x149d86[_0x36b4('0x6d')]]=_0x2b616e;}}}catch(_0x4e3ca7){logger[_0x36b4('0x42')](_0x36b4('0x70'),util[_0x36b4('0x44')](_0x4e3ca7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0x71')]=function(_0x401978){try{if(this[_0x36b4('0x1f')](_0x401978)){if(this[_0x36b4('0x8')][_0x401978[_0x36b4('0x6d')]]){for(var _0x3b369e in this[_0x36b4('0x8')][_0x401978[_0x36b4('0x6d')]]){if(this['channels'][_0x401978[_0x36b4('0x6d')]][_0x36b4('0x32')](_0x3b369e)){if(_0x401978['transfereruniqueid']===_0x3b369e){var _0x5bca0c=moment();this[_0x36b4('0x8')][_0x401978[_0x36b4('0x6d')]][_0x3b369e][_0x36b4('0x12')]=!![];this[_0x36b4('0x8')][_0x401978['transfereeuniqueid']][_0x3b369e][_0x36b4('0x4b')]=_0x5bca0c;this[_0x36b4('0x8')][_0x401978[_0x36b4('0x6d')]][_0x3b369e][_0x36b4('0x48')]=_0x36b4('0x4e');this[_0x36b4('0x8')][_0x401978[_0x36b4('0x6d')]][_0x3b369e][_0x36b4('0x46')]=_0x36b4('0x4c');this[_0x36b4('0x8')][_0x401978[_0x36b4('0x6d')]][_0x3b369e][_0x36b4('0x4d')]=_0x5bca0c[_0x36b4('0x72')](this[_0x36b4('0x8')][_0x401978[_0x36b4('0x6d')]][_0x3b369e][_0x36b4('0x33')],_0x36b4('0x73'));}}}}}}catch(_0x2a596e){logger['error'](_0x36b4('0x74'),util[_0x36b4('0x44')](_0x2a596e,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x36b4('0x18')]=function(_0x46f518){var _0x40e7ea='';try{if(this[_0x36b4('0x1f')](_0x46f518)){if(_0x46f518['channel']){_0x40e7ea=_0x46f518['channel'][_0x36b4('0x75')](0x0,_0x46f518['channel']['lastIndexOf']('-'));if(this[_0x36b4('0x9')][_0x40e7ea]){this[_0x36b4('0x9')][_0x40e7ea][_0x36b4('0x76')]=!![];}}}}catch(_0x1b32c8){logger['error'](_0x36b4('0x77'),util[_0x36b4('0x44')](_0x1b32c8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x36b4('0x1e')][_0x36b4('0x1a')]=function(_0x295992){var _0x368c2c='';try{if(this['isNotNull'](_0x295992)){if(_0x295992[_0x36b4('0x78')]){_0x368c2c=_0x295992[_0x36b4('0x78')][_0x36b4('0x75')](0x0,_0x295992[_0x36b4('0x78')][_0x36b4('0x79')]('-'));if(this['agents'][_0x368c2c]){this['agents'][_0x368c2c]['onhold']=![];}}}}catch(_0x32b10e){logger['error'](_0x36b4('0x7a'),util['inspect'](_0x32b10e,{'showHidden':![],'depth':null}));}};module[_0x36b4('0x7b')]=VoiceAgentReport; \ No newline at end of file +var _0x4c24=['destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','merge','omit','event','privilege','custom:agentcalled','user:%s','[syncAgentCalled][VoiceAgentReport]','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','membername','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','error','inspect','rejected','custom:agentringnoanswer','abandoned','custom:agentqueuecallerabandon','agentcompleteAt','complete','talktime','agent','acw','agentacw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','keys','variable','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','custom:voiceAgentReport','transfereeuniqueid','origtransfereruniqueid','transfer','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','substring','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','lodash','moment','../../../config/environment','../ami','redis','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid'];(function(_0x1d91ea,_0xfcb61a){var _0x5a8d06=function(_0x3e69df){while(--_0x3e69df){_0x1d91ea['push'](_0x1d91ea['shift']());}};_0x5a8d06(++_0xfcb61a);}(_0x4c24,0xc4));var _0x44c2=function(_0x5e61aa,_0x500cf0){_0x5e61aa=_0x5e61aa-0x0;var _0x41a3f2=_0x4c24[_0x5e61aa];return _0x41a3f2;};'use strict';var _=require(_0x44c2('0x0'));var moment=require(_0x44c2('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x44c2('0x2'));var logger=require('../../../config/logger')('ami');var ami=require(_0x44c2('0x3'));config[_0x44c2('0x4')]=_['defaults'](config[_0x44c2('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x44c2('0x5'))(new Redis(config[_0x44c2('0x4')]));function VoiceAgentReport(_0x3d8bac){this[_0x44c2('0x6')]={};this[_0x44c2('0x7')]=_0x3d8bac[_0x44c2('0x7')];this[_0x44c2('0x8')]=_0x3d8bac['agents'];this[_0x44c2('0x9')]={};ami['on'](_0x44c2('0xa'),this[_0x44c2('0xb')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0xd'),this[_0x44c2('0xe')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0xf'),this[_0x44c2('0x10')][_0x44c2('0xc')](this));ami['on']('queuecallerabandon',this[_0x44c2('0x11')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x12'),this[_0x44c2('0x13')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x14'),this[_0x44c2('0x15')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x16'),this[_0x44c2('0x17')][_0x44c2('0xc')](this));ami['on']('musiconholdstart',this[_0x44c2('0x18')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x19'),this[_0x44c2('0x1a')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x1b'),this[_0x44c2('0x1c')][_0x44c2('0xc')](this));ami['on'](_0x44c2('0x1d'),this[_0x44c2('0x1e')]['bind'](this));}VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x20')]=function(_0x5ada45,_0x4619e4,_0x472c90){io['to'](_0x5ada45)[_0x44c2('0x20')](_0x4619e4,_0x472c90);};VoiceAgentReport['prototype'][_0x44c2('0x21')]=function(_0x352896){return _0x352896!==null&&!_[_0x44c2('0x22')](_0x352896);};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentCalled']=function(_0x269a79){try{if(this[_0x44c2('0x21')](_0x269a79)){if(_[_0x44c2('0x22')](this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]])){this[_0x44c2('0x6')][_0x269a79['uniqueid']]={};}if(_[_0x44c2('0x22')](this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]])){this['channels'][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]]={'agentcalledAt':moment()[_0x44c2('0x25')](_0x44c2('0x26')),'lastevent':'called','variables':this[_0x44c2('0x9')][_0x269a79['uniqueid']],'type':this[_0x44c2('0x7')][_0x269a79[_0x44c2('0x27')]]?this['voiceQueues'][_0x269a79['queue']][_0x44c2('0x28')]||_0x44c2('0x29'):_0x44c2('0x29')};}_[_0x44c2('0x2a')](this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]],_[_0x44c2('0x2b')](_0x269a79,[_0x44c2('0x2c'),_0x44c2('0x2d')]));ami[_0x44c2('0x20')](_0x44c2('0x2e'),this[_0x44c2('0x6')][_0x269a79[_0x44c2('0x23')]][_0x269a79[_0x44c2('0x24')]]);this['emit'](util[_0x44c2('0x25')](_0x44c2('0x2f'),_0x269a79['membername']),'user:called',this[_0x44c2('0x6')][_0x269a79['uniqueid']][_0x269a79[_0x44c2('0x24')]]);}}catch(_0x2fe5a2){logger['error'](_0x44c2('0x30'),util['inspect'](_0x2fe5a2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentConnect']=function(_0xda1113){try{if(this[_0x44c2('0x21')](_0xda1113)){if(this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]]){for(var _0x4489b6 in this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]]){if(this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x44c2('0x31')](_0x4489b6)){if(_0xda1113[_0x44c2('0x24')]===_0x4489b6){this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x32')]=moment()['format'](_0x44c2('0x26'));this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x33')]=_0x44c2('0x34');this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x35')]=_0xda1113[_0x44c2('0x35')];this[_0x44c2('0x6')][_0xda1113['uniqueid']][_0x4489b6][_0x44c2('0x36')]=_0xda1113[_0x44c2('0x36')];this['channels'][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x37')]=_0xda1113[_0x44c2('0x37')];this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x38')]=_0xda1113[_0x44c2('0x38')];this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x39')]=_0xda1113['destchannelstatedesc'];_['merge'](this[_0x44c2('0x8')][_0xda1113[_0x44c2('0x3a')]],_['pick'](_0xda1113,[_0x44c2('0x27'),'destconnectedlinenum']));this[_0x44c2('0x20')](util[_0x44c2('0x25')](_0x44c2('0x2f'),_0xda1113[_0x44c2('0x3b')]),_0x44c2('0x3c'),this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0xda1113['destuniqueid']]);ami[_0x44c2('0x20')](_0x44c2('0x3d'),this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6]);}else if(!this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6]['agentringnoanswer']&&!this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0xf')]=!![];this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x3e')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x3f')]=_0x44c2('0x40');this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x33')]=_0x44c2('0x40');this[_0x44c2('0x6')][_0xda1113['uniqueid']][_0x4489b6]['answeredelsewheredestinationuniqueid']=_0xda1113[_0x44c2('0x24')];this['channels'][_0xda1113[_0x44c2('0x23')]][_0x4489b6][_0x44c2('0x41')]=_0xda1113['membername'];ami[_0x44c2('0x20')]('custom:agentansweredelsewhere',this[_0x44c2('0x6')][_0xda1113[_0x44c2('0x23')]][_0x4489b6]);}}}}}}catch(_0x4fa415){logger[_0x44c2('0x42')]('[syncAgentConnect][VoiceAgentReport]',util[_0x44c2('0x43')](_0x4fa415,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentRingNoAnswer']=function(_0x2f82c5){try{if(this[_0x44c2('0x21')](_0x2f82c5)){if(this[_0x44c2('0x6')][_0x2f82c5['uniqueid']]&&this[_0x44c2('0x6')][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5['destuniqueid']]){this[_0x44c2('0x6')][_0x2f82c5['uniqueid']][_0x2f82c5['destuniqueid']][_0x44c2('0xf')]=!![];this['channels'][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5['destuniqueid']][_0x44c2('0x3e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x44c2('0x6')][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5[_0x44c2('0x24')]]['reason']=_0x44c2('0x44');this[_0x44c2('0x6')][_0x2f82c5[_0x44c2('0x23')]][_0x2f82c5[_0x44c2('0x24')]]['lastevent']='rejected';ami['emit'](_0x44c2('0x45'),this['channels'][_0x2f82c5['uniqueid']][_0x2f82c5[_0x44c2('0x24')]]);}}}catch(_0x3d11f3){logger['error']('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x44c2('0x43')](_0x3d11f3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x11')]=function(_0x395273){try{if(this['isNotNull'](_0x395273)){if(this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]]){for(var _0x3818d6 in this['channels'][_0x395273[_0x44c2('0x23')]]){if(this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x44c2('0x31')](_0x3818d6)&&!this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6]['agentringnoanswer']&&!this[_0x44c2('0x6')][_0x395273['uniqueid']][_0x3818d6][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6][_0x44c2('0xf')]=!![];this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6][_0x44c2('0x3e')]=moment()['format'](_0x44c2('0x26'));this['channels'][_0x395273['uniqueid']][_0x3818d6][_0x44c2('0x3f')]=_0x44c2('0x46');this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6][_0x44c2('0x33')]=_0x44c2('0x46');ami['emit'](_0x44c2('0x47'),this[_0x44c2('0x6')][_0x395273[_0x44c2('0x23')]][_0x3818d6]);}}}}}catch(_0x53205c){logger['error']('[syncQueueCallerAbandon][VoiceAgentReport]',util['inspect'](_0x53205c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncAgentComplete']=function(_0x2389c4){try{if(this[_0x44c2('0x21')](_0x2389c4)){if(this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]]){for(var _0x945ed6 in this[_0x44c2('0x6')][_0x2389c4['uniqueid']]){if(this[_0x44c2('0x6')][_0x2389c4['uniqueid']][_0x44c2('0x31')](_0x945ed6)){if(this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x32')]&&!this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]['agentcomplete']=!![];this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x48')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]['lastevent']=_0x44c2('0x49');this[_0x44c2('0x6')][_0x2389c4['uniqueid']][_0x945ed6]['talktime']=_0x2389c4[_0x44c2('0x4a')];this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x3f')]=_0x2389c4[_0x44c2('0x3f')]=='transfer'?_0x44c2('0x4b'):_0x2389c4['reason'];if(this[_0x44c2('0x7')][_0x2389c4[_0x44c2('0x27')]]&&this[_0x44c2('0x7')][_0x2389c4[_0x44c2('0x27')]][_0x44c2('0x4c')]){this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x4d')]=!![];this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6][_0x44c2('0x4e')]=this[_0x44c2('0x7')][_0x2389c4[_0x44c2('0x27')]][_0x44c2('0x4f')];}this[_0x44c2('0x8')][_0x2389c4[_0x44c2('0x3a')]]=_['omit'](this[_0x44c2('0x8')][_0x2389c4[_0x44c2('0x3a')]],[_0x44c2('0x27'),'destconnectedlinenum']);this[_0x44c2('0x20')](util['format']('user:%s',_0x2389c4['membername']),_0x44c2('0x50'),this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]);ami[_0x44c2('0x20')](_0x44c2('0x51'),this[_0x44c2('0x6')][_0x2389c4[_0x44c2('0x23')]][_0x945ed6]);}}}}}}catch(_0x2eca1c){logger[_0x44c2('0x42')]('[syncAgentComplete][VoiceAgentReport]',util[_0x44c2('0x43')](_0x2eca1c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x44c2('0x15')]=function(_0x3bc5f9){try{if(this[_0x44c2('0x21')](_0x3bc5f9)){this['addVariable'](_0x3bc5f9[_0x44c2('0x23')],_[_0x44c2('0x52')](_0x3bc5f9[_0x44c2('0x53')])[0x0],_0x3bc5f9[_0x44c2('0x54')]);if(this['channels'][_0x3bc5f9[_0x44c2('0x23')]]){for(var _0x545075 in this[_0x44c2('0x6')][_0x3bc5f9['uniqueid']]){if(this[_0x44c2('0x6')][_0x3bc5f9[_0x44c2('0x23')]][_0x44c2('0x31')](_0x545075)){if(_['isUndefined'](this[_0x44c2('0x6')][_0x3bc5f9['uniqueid']][_0x545075]['variables'])){this[_0x44c2('0x6')][_0x3bc5f9[_0x44c2('0x23')]][_0x545075][_0x44c2('0x9')]={};}this[_0x44c2('0x6')][_0x3bc5f9[_0x44c2('0x23')]][_0x545075]['variables']=this[_0x44c2('0x9')][_0x3bc5f9['uniqueid']];}}}}}catch(_0xe0ab91){logger[_0x44c2('0x42')]('[syncVarSet][VoiceAgentReport]',util[_0x44c2('0x43')](_0xe0ab91,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['addVariable']=function(_0x211ca1,_0x401327,_0x5b8671){var _0x1fe0c3=[_0x44c2('0x55'),_0x44c2('0x56'),_0x44c2('0x57'),_0x44c2('0x58'),_0x44c2('0x59'),_0x44c2('0x5a'),'rtpaudioqosrtt',_0x44c2('0x5b'),_0x44c2('0x5c'),_0x44c2('0x5d'),'bridgepeer',_0x44c2('0x5e'),'membercalls',_0x44c2('0x5f'),_0x44c2('0x60'),_0x44c2('0x61'),_0x44c2('0x3b'),_0x44c2('0x62'),'memberrealtime'];if(!_['isNil'](_0x401327)&&!_[_0x44c2('0x63')](_0x1fe0c3,_0x401327)){if(_[_0x44c2('0x22')](this[_0x44c2('0x9')][_0x211ca1])){this[_0x44c2('0x9')][_0x211ca1]={};}this['variables'][_0x211ca1][_0x401327]=_0x5b8671;}};VoiceAgentReport['prototype'][_0x44c2('0x17')]=function(_0x5e1167){try{if(this['isNotNull'](_0x5e1167)){if(this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]]){for(var _0x32434e in this['channels'][_0x5e1167[_0x44c2('0x23')]]){if(this['channels'][_0x5e1167['uniqueid']]['hasOwnProperty'](_0x32434e)){if(this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]][_0x32434e][_0x44c2('0x3f')]=='transfer'&&this['channels'][_0x5e1167[_0x44c2('0x23')]][_0x32434e][_0x44c2('0x12')]){this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]][_0x32434e][_0x44c2('0x48')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));}}}ami[_0x44c2('0x20')](_0x44c2('0x64'),_['values'](this[_0x44c2('0x6')][_0x5e1167[_0x44c2('0x23')]]));delete this[_0x44c2('0x6')][_0x5e1167['uniqueid']];}if(this['variables'][_0x5e1167[_0x44c2('0x23')]]){delete this['variables'][_0x5e1167[_0x44c2('0x23')]];}}}catch(_0x17751b){logger['error']('[syncHangup][VoiceAgentReport]',util[_0x44c2('0x43')](_0x17751b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x1c')]=function(_0x4feea3){try{if(this[_0x44c2('0x21')](_0x4feea3)){if(this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]]){for(var _0x15352e in this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]]){if(this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]][_0x44c2('0x31')](_0x15352e)){if(_0x4feea3[_0x44c2('0x66')]===_0x15352e){var _0xa06282=moment();this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x12')]=!![];this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x48')]=moment()[_0x44c2('0x25')](_0x44c2('0x26'));this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]][_0x15352e][_0x44c2('0x3f')]=_0x44c2('0x67');this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x33')]=_0x44c2('0x49');this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']][_0x15352e][_0x44c2('0x4a')]=_0xa06282[_0x44c2('0x68')](this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x65')]][_0x15352e][_0x44c2('0x32')],_0x44c2('0x69'));}}}}if(this['channels'][_0x4feea3[_0x44c2('0x6a')]]){var _0x1e8f76=this[_0x44c2('0x6')][_0x4feea3[_0x44c2('0x6a')]];this['channels'][_0x4feea3[_0x44c2('0x6a')]]=this[_0x44c2('0x6')][_0x4feea3['transfereeuniqueid']];this['channels'][_0x4feea3['transfereeuniqueid']]=_0x1e8f76;}}}catch(_0x16257c){logger['error'](_0x44c2('0x6b'),util[_0x44c2('0x43')](_0x16257c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')]['syncBlindTransfer']=function(_0x125891){try{if(this[_0x44c2('0x21')](_0x125891)){if(this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]]){for(var _0x597d76 in this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]]){if(this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]]['hasOwnProperty'](_0x597d76)){if(_0x125891[_0x44c2('0x6c')]===_0x597d76){var _0x50ee89=moment();this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x12')]=!![];this['channels'][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x48')]=_0x50ee89;this['channels'][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x3f')]=_0x44c2('0x67');this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x33')]=_0x44c2('0x49');this[_0x44c2('0x6')][_0x125891['transfereeuniqueid']][_0x597d76][_0x44c2('0x4a')]=_0x50ee89[_0x44c2('0x68')](this[_0x44c2('0x6')][_0x125891[_0x44c2('0x65')]][_0x597d76][_0x44c2('0x32')],_0x44c2('0x69'));}}}}}}catch(_0x200098){logger[_0x44c2('0x42')](_0x44c2('0x6d'),util[_0x44c2('0x43')](_0x200098,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x44c2('0x1f')][_0x44c2('0x18')]=function(_0x1ca898){var _0x1359b9='';try{if(this[_0x44c2('0x21')](_0x1ca898)){if(_0x1ca898['channel']){_0x1359b9=_0x1ca898['channel'][_0x44c2('0x6e')](0x0,_0x1ca898[_0x44c2('0x6f')][_0x44c2('0x70')]('-'));if(this[_0x44c2('0x8')][_0x1359b9]){this[_0x44c2('0x8')][_0x1359b9][_0x44c2('0x71')]=!![];}}}}catch(_0xe122a8){logger[_0x44c2('0x42')](_0x44c2('0x72'),util[_0x44c2('0x43')](_0xe122a8,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x23697b){var _0x4b6ca2='';try{if(this[_0x44c2('0x21')](_0x23697b)){if(_0x23697b[_0x44c2('0x6f')]){_0x4b6ca2=_0x23697b[_0x44c2('0x6f')][_0x44c2('0x6e')](0x0,_0x23697b[_0x44c2('0x6f')][_0x44c2('0x70')]('-'));if(this[_0x44c2('0x8')][_0x4b6ca2]){this[_0x44c2('0x8')][_0x4b6ca2][_0x44c2('0x71')]=![];}}}}catch(_0x5623e1){logger['error'](_0x44c2('0x73'),util['inspect'](_0x5623e1,{'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 b229f63..a96c3c6 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 _0xf67a=['ringinuse','onhold','set','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','pick','error','[syncNewCallerId][VoiceCallReport]','syncNewChannel','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','keys','context','from-sip','split','destconnectedlinenum','exten','user:%s','user:agentconnect','accountcode','inspect','application','toLowerCase','applicationdata','appdata','duration','merge','includes','lastapplication','lastdata','match','[syncNewExten][VoiceCallReport]','channelstate','answered','holdtime','diff','xcally-motion-preview','connectedlinenum','calleridname','UserId','membername','name','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','replace','.wav49','.WAV','monitors','isNil','rec','syncVarSet','variable','mixmonitor_filename','xmd-phone','calleridnum','value','callerid','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','answertime','seconds','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','moment','util','path','ioredis','../../../config/logger','ami','../ami','unknown','not_inuse','inuse','busy','invalid','ringing'];(function(_0x17044c,_0x208790){var _0x5e6db0=function(_0x3f5f50){while(--_0x3f5f50){_0x17044c['push'](_0x17044c['shift']());}};_0x5e6db0(++_0x208790);}(_0xf67a,0x8b));var _0xaf67=function(_0x25c0ee,_0x4286d9){_0x25c0ee=_0x25c0ee-0x0;var _0x274e36=_0xf67a[_0x25c0ee];return _0x274e36;};'use strict';var BPromise=require(_0xaf67('0x0'));var _=require('lodash');var moment=require(_0xaf67('0x1'));var util=require(_0xaf67('0x2'));var path=require(_0xaf67('0x3'));var Redis=require(_0xaf67('0x4'));var config=require('../../../config/environment');var logger=require(_0xaf67('0x5'))(_0xaf67('0x6'));var ami=require(_0xaf67('0x7'));var Channel=require('../model/channel');var statusDesc=[_0xaf67('0x8'),_0xaf67('0x9'),_0xaf67('0xa'),_0xaf67('0xb'),_0xaf67('0xc'),'unavailable',_0xaf67('0xd'),_0xaf67('0xe'),_0xaf67('0xf')];var applications=[_0xaf67('0x10'),_0xaf67('0x11'),_0xaf67('0x12'),'dial',_0xaf67('0x13'),_0xaf67('0x14')];var dispositions=['NO\x20ANSWER',_0xaf67('0x15'),_0xaf67('0x15'),_0xaf67('0x16'),'NO\x20ANSWER','NO\x20ANSWER',_0xaf67('0x17'),_0xaf67('0x18'),_0xaf67('0x15'),_0xaf67('0x15'),_0xaf67('0x15')];var actions={};config[_0xaf67('0x19')]=_['defaults'](config[_0xaf67('0x19')],{'host':_0xaf67('0x1a'),'port':0x18eb});var io=require(_0xaf67('0x1b'))(new Redis(config[_0xaf67('0x19')]));function VoiceCallReport(_0x589a88){this[_0xaf67('0x1c')]=_0x589a88['channels'];this[_0xaf67('0x1d')]=_0x589a88[_0xaf67('0x1d')];ami['on'](_0xaf67('0x1e'),this[_0xaf67('0x1f')][_0xaf67('0x20')](this));ami['on'](_0xaf67('0x21'),this['syncNewExten'][_0xaf67('0x20')](this));ami['on'](_0xaf67('0x22'),this['syncNewChannel'][_0xaf67('0x20')](this));ami['on'](_0xaf67('0x23'),this[_0xaf67('0x24')][_0xaf67('0x20')](this));ami['on'](_0xaf67('0x25'),this['syncVarSet']['bind'](this));ami['on'](_0xaf67('0x26'),this[_0xaf67('0x27')]['bind'](this));ami['on']('newcallerid',this[_0xaf67('0x28')][_0xaf67('0x20')](this));ami['on'](_0xaf67('0x29'),this[_0xaf67('0x2a')][_0xaf67('0x20')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xaf67('0x20')](this));ami['on'](_0xaf67('0x2b'),this[_0xaf67('0x2c')][_0xaf67('0x20')](this));ami['on'](_0xaf67('0x2d'),this[_0xaf67('0x2e')][_0xaf67('0x20')](this));return BPromise[_0xaf67('0x2f')]()[_0xaf67('0x30')](ami[_0xaf67('0x31')]())[_0xaf67('0x32')](function(_0x42a83f){console['log'](_0x42a83f);});}VoiceCallReport[_0xaf67('0x33')][_0xaf67('0x34')]=function(_0x50c1cd){return _0x50c1cd!==null&&!_[_0xaf67('0x35')](_0x50c1cd);};VoiceCallReport[_0xaf67('0x33')][_0xaf67('0x36')]=function(_0x459451,_0x138e1e,_0x22da92){io['to'](_0x459451)[_0xaf67('0x36')](_0x138e1e,_0x22da92);};VoiceCallReport[_0xaf67('0x33')]['syncNewCallerId']=function(_0x5ae6c5){try{if(this[_0xaf67('0x34')](_0x5ae6c5)){if(_0x5ae6c5[_0xaf67('0x37')]===_0x5ae6c5[_0xaf67('0x38')]){if(!_['isUndefined'](this['channels'][_0x5ae6c5[_0xaf67('0x37')]])){_['merge'](this[_0xaf67('0x1c')][_0x5ae6c5['uniqueid']],_[_0xaf67('0x39')](_0x5ae6c5,_['keys'](this['channels'][_0x5ae6c5['uniqueid']])));}}}}catch(_0x53764d){logger[_0xaf67('0x3a')](_0xaf67('0x3b'),util['inspect'](_0x53764d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf67('0x33')][_0xaf67('0x3c')]=function(_0x151dd5){try{if(this[_0xaf67('0x34')](_0x151dd5)){if(_0x151dd5[_0xaf67('0x37')]===_0x151dd5[_0xaf67('0x38')]&&_0x151dd5[_0xaf67('0x3d')]!=_0xaf67('0x3e')){if(_[_0xaf67('0x35')](this[_0xaf67('0x1c')][_0x151dd5['uniqueid']])){this[_0xaf67('0x1c')][_0x151dd5[_0xaf67('0x37')]]=new Channel();this['channels'][_0x151dd5['uniqueid']][_0xaf67('0x3f')]=moment()[_0xaf67('0x40')](_0xaf67('0x41'));this[_0xaf67('0x1c')][_0x151dd5['uniqueid']][_0xaf67('0x42')]=dispositions[_[_0xaf67('0x43')](_0x151dd5['channelstate'])];_['merge'](this[_0xaf67('0x1c')][_0x151dd5[_0xaf67('0x37')]],_[_0xaf67('0x39')](_0x151dd5,_[_0xaf67('0x44')](this[_0xaf67('0x1c')][_0x151dd5[_0xaf67('0x37')]])));if(_0x151dd5[_0xaf67('0x45')]===_0xaf67('0x46')){if(this[_0xaf67('0x1d')][_0x151dd5['channel'][_0xaf67('0x47')]('-')[0x0]]){this[_0xaf67('0x1d')][_0x151dd5[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]][_0xaf67('0x48')]=_0x151dd5[_0xaf67('0x49')];this['emit'](util[_0xaf67('0x40')](_0xaf67('0x4a'),this[_0xaf67('0x1d')][_0x151dd5[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]]['name']),_0xaf67('0x4b'),{'destaccountcode':this['agents'][_0x151dd5[_0xaf67('0x3d')]['split']('-')[0x0]][_0xaf67('0x4c')],'destconnectedlinenum':_0x151dd5['exten']});}}}}}}catch(_0x23e4a5){logger[_0xaf67('0x3a')]('[syncNewChannel][VoiceCallReport]',util[_0xaf67('0x4d')](_0x23e4a5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf67('0x33')]['syncNewExten']=function(_0x2d9408){try{if(this['isNotNull'](_0x2d9408)){if(_0x2d9408['uniqueid']===_0x2d9408[_0xaf67('0x38')]&&_0x2d9408[_0xaf67('0x49')]!='h'&&_0x2d9408[_0xaf67('0x3d')]!=_0xaf67('0x3e')){_0x2d9408[_0xaf67('0x4e')]=_0x2d9408[_0xaf67('0x4e')][_0xaf67('0x4f')]();_0x2d9408[_0xaf67('0x50')]=(_0x2d9408[_0xaf67('0x51')]||_0x2d9408[_0xaf67('0x50')])['toLowerCase']();if(_[_0xaf67('0x35')](this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]])){this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]]=new Channel();this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]][_0xaf67('0x3f')]=_0x2d9408[_0xaf67('0x52')]?moment()['subtract'](moment['duration'](_0x2d9408[_0xaf67('0x52')])['seconds'](),'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xaf67('0x41'));this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]]['disposition']=_0xaf67('0x16');}_[_0xaf67('0x53')](this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]],_[_0xaf67('0x39')](_0x2d9408,_[_0xaf67('0x44')](this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]])));if(_[_0xaf67('0x54')](applications,_0x2d9408[_0xaf67('0x4e')])){this['channels'][_0x2d9408[_0xaf67('0x37')]][_0xaf67('0x55')]=_0x2d9408[_0xaf67('0x4e')];this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]][_0xaf67('0x56')]=_0x2d9408['applicationdata'];if(_0x2d9408[_0xaf67('0x4e')]===_0xaf67('0x10')&&_['startsWith'](_0x2d9408[_0xaf67('0x50')],'cdr(')){var _0x43f2f2=_0x2d9408[_0xaf67('0x50')][_0xaf67('0x47')]('=');var _0x4eaca9=_0x43f2f2[0x0][_0xaf67('0x57')](/cdr\((.*)\)/);if(_0x4eaca9){this[_0xaf67('0x1c')][_0x2d9408[_0xaf67('0x37')]][_0x4eaca9[0x1]]=_0x43f2f2[0x1];}}else if(_0x2d9408[_0xaf67('0x4e')]==='queue'){this[_0xaf67('0x1c')][_0x2d9408['uniqueid']]['queue']=_0x2d9408[_0xaf67('0x50')][_0xaf67('0x47')](',')[0x0];}}}}}catch(_0x45eecf){logger[_0xaf67('0x3a')](_0xaf67('0x58'),util[_0xaf67('0x4d')](_0x45eecf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf67('0x33')]['syncNewState']=function(_0x2cc7ee){try{if(this[_0xaf67('0x34')](_0x2cc7ee)){if(_0x2cc7ee[_0xaf67('0x37')]!==_0x2cc7ee['linkedid']){if(this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]]){if(_0x2cc7ee[_0xaf67('0x59')]==='6'){if(!this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]][_0xaf67('0x5a')]){var _0x33dd5b=moment();this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]][_0xaf67('0x5a')]=!![];this[_0xaf67('0x1c')][_0x2cc7ee['linkedid']]['answertime']=_0x33dd5b[_0xaf67('0x40')](_0xaf67('0x41'));if(this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]][_0xaf67('0x3f')]){this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]][_0xaf67('0x5b')]=_0x33dd5b[_0xaf67('0x5c')](this['channels'][_0x2cc7ee[_0xaf67('0x38')]][_0xaf67('0x3f')],'seconds');}}this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]]['linkedid']=_0x2cc7ee[_0xaf67('0x37')];if(_0x2cc7ee['calleridnum']!==_0xaf67('0x5d')){this[_0xaf67('0x1c')][_0x2cc7ee['linkedid']][_0xaf67('0x5e')]=_0x2cc7ee['calleridnum'];}this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]]['connectedlinename']=_0x2cc7ee[_0xaf67('0x5f')];this[_0xaf67('0x1c')][_0x2cc7ee['linkedid']]['destinationchannel']=_0x2cc7ee[_0xaf67('0x3d')];this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]]['disposition']=dispositions[_[_0xaf67('0x43')](_0x2cc7ee[_0xaf67('0x59')])];if(this[_0xaf67('0x1d')][_0x2cc7ee[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]]){this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]][_0xaf67('0x60')]=this[_0xaf67('0x1d')][_0x2cc7ee[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]]['id'];this[_0xaf67('0x1c')][_0x2cc7ee[_0xaf67('0x38')]][_0xaf67('0x61')]=this[_0xaf67('0x1d')][_0x2cc7ee[_0xaf67('0x3d')]['split']('-')[0x0]][_0xaf67('0x62')];}}}}else{if(this['channels'][_0x2cc7ee[_0xaf67('0x37')]]){if(_0x2cc7ee[_0xaf67('0x59')]==='6'){if(this[_0xaf67('0x1d')][_0x2cc7ee[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]]){this[_0xaf67('0x1c')][_0x2cc7ee['uniqueid']]['UserId']=this[_0xaf67('0x1d')][_0x2cc7ee[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]]['id'];this['channels'][_0x2cc7ee[_0xaf67('0x37')]][_0xaf67('0x61')]=this['agents'][_0x2cc7ee['channel'][_0xaf67('0x47')]('-')[0x0]]['name'];}}}}}}catch(_0xc13fa4){logger[_0xaf67('0x3a')](_0xaf67('0x63'),util[_0xaf67('0x4d')](_0xc13fa4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf67('0x33')][_0xaf67('0x64')]=function(_0x1e1007,_0xc620a1){if(this[_0xaf67('0x1c')][_0x1e1007]){this[_0xaf67('0x1c')][_0x1e1007]['monitor']=!![];if(_[_0xaf67('0x65')](_0xc620a1,'.wav49')){_0xc620a1=_0xc620a1[_0xaf67('0x66')](_0xaf67('0x67'),_0xaf67('0x68'));}this[_0xaf67('0x1c')][_0x1e1007]['monitorFilename']=_0xc620a1;var _0xda7520=_['find'](this['channels'][_0x1e1007][_0xaf67('0x69')],{'filename':_0xc620a1});if(_[_0xaf67('0x6a')](_0xda7520)){this['channels'][_0x1e1007]['monitors']['push']({'filename':_0xc620a1,'createdAt':moment()['format'](_0xaf67('0x41')),'mixmonitorid':'','status':_0xaf67('0x6b')});}}};VoiceCallReport[_0xaf67('0x33')][_0xaf67('0x6c')]=function(_0x3e200e){try{if(this['isNotNull'](_0x3e200e)){if(this[_0xaf67('0x1c')][_0x3e200e[_0xaf67('0x37')]]&&_0x3e200e[_0xaf67('0x3d')]!=_0xaf67('0x3e')){if(this[_0xaf67('0x34')](_0x3e200e[_0xaf67('0x6d')])){if(this[_0xaf67('0x34')](_0x3e200e[_0xaf67('0x6d')][_0xaf67('0x6e')])){this[_0xaf67('0x64')](_0x3e200e[_0xaf67('0x37')],_0x3e200e['value']);}else if(this['isNotNull'](_0x3e200e[_0xaf67('0x6d')][_0xaf67('0x6f')])){this['channels'][_0x3e200e[_0xaf67('0x37')]][_0xaf67('0x70')]=_0x3e200e[_0xaf67('0x71')];}else if(this['isNotNull'](_0x3e200e[_0xaf67('0x6d')]['xmd-callerid'])){this['channels'][_0x3e200e[_0xaf67('0x37')]][_0xaf67('0x72')]=_0x3e200e[_0xaf67('0x71')];}else if(this[_0xaf67('0x34')](_0x3e200e[_0xaf67('0x6d')]['xmd-cdrtype'])){this['channels'][_0x3e200e[_0xaf67('0x37')]][_0xaf67('0x73')]=_0x3e200e[_0xaf67('0x71')];}else if(this[_0xaf67('0x34')](_0x3e200e[_0xaf67('0x6d')][_0xaf67('0x74')])){this['channels'][_0x3e200e['uniqueid']]['queue']=_0x3e200e[_0xaf67('0x71')][_0xaf67('0x47')](',')[0x0];}else if(this[_0xaf67('0x34')](_0x3e200e[_0xaf67('0x6d')][_0xaf67('0x75')])){this[_0xaf67('0x1c')][_0x3e200e[_0xaf67('0x37')]][_0xaf67('0x76')]=_0x3e200e[_0xaf67('0x71')];}else if(this['isNotNull'](_0x3e200e[_0xaf67('0x6d')]['xmd-destination'])){this[_0xaf67('0x1c')][_0x3e200e[_0xaf67('0x37')]][_0xaf67('0x77')]=_0x3e200e[_0xaf67('0x71')];}else if(this['isNotNull'](_0x3e200e[_0xaf67('0x6d')][_0xaf67('0x78')])){this[_0xaf67('0x1c')][_0x3e200e[_0xaf67('0x37')]][_0xaf67('0x79')]=_0x3e200e[_0xaf67('0x71')];}else if(this[_0xaf67('0x34')](_0x3e200e['variable'][_0xaf67('0x7a')])){this[_0xaf67('0x1c')][_0x3e200e[_0xaf67('0x37')]][_0xaf67('0x11')]=_0x3e200e[_0xaf67('0x71')];}else if(this[_0xaf67('0x34')](_0x3e200e[_0xaf67('0x6d')][_0xaf67('0x7b')])){this[_0xaf67('0x1c')][_0x3e200e['uniqueid']]['sipcalluniqueid']=_0x3e200e['value'];}}}else if(this[_0xaf67('0x34')](_0x3e200e['variable'][_0xaf67('0x6e')])){if(_0x3e200e[_0xaf67('0x71')]){var _0x4fdba9=path[_0xaf67('0x7c')](_0x3e200e['value'])[_0xaf67('0x62')];this[_0xaf67('0x64')](_0x4fdba9,_0x3e200e[_0xaf67('0x71')]);}}else if(this[_0xaf67('0x1c')][_0x3e200e['linkedid']]){if(this['isNotNull'](_0x3e200e[_0xaf67('0x6d')])){if(this[_0xaf67('0x34')](_0x3e200e[_0xaf67('0x6d')][_0xaf67('0x7b')])){this[_0xaf67('0x1c')][_0x3e200e[_0xaf67('0x38')]][_0xaf67('0x7d')]=_0x3e200e[_0xaf67('0x71')];}}}}}catch(_0xd8efbd){logger[_0xaf67('0x3a')](_0xaf67('0x7e'),util[_0xaf67('0x4d')](_0xd8efbd,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xaf67('0x27')]=function(_0x474d20){try{if(this[_0xaf67('0x34')](_0x474d20)){if(this[_0xaf67('0x1c')][_0x474d20['uniqueid']]){var _0x2cb153=moment();this[_0xaf67('0x1c')][_0x474d20['uniqueid']][_0xaf67('0x7f')]=_0x2cb153[_0xaf67('0x40')](_0xaf67('0x41'));this['channels'][_0x474d20[_0xaf67('0x37')]]['duration']=_0x2cb153[_0xaf67('0x5c')](this[_0xaf67('0x1c')][_0x474d20[_0xaf67('0x37')]][_0xaf67('0x3f')],'seconds');if(this[_0xaf67('0x1c')][_0x474d20[_0xaf67('0x37')]][_0xaf67('0x5a')]){this[_0xaf67('0x1c')][_0x474d20[_0xaf67('0x37')]][_0xaf67('0x80')]=_0x2cb153[_0xaf67('0x5c')](this[_0xaf67('0x1c')][_0x474d20[_0xaf67('0x37')]][_0xaf67('0x81')],_0xaf67('0x82'));this['channels'][_0x474d20['uniqueid']][_0xaf67('0x5b')]=this[_0xaf67('0x1c')][_0x474d20['uniqueid']]['duration']-this['channels'][_0x474d20['uniqueid']][_0xaf67('0x80')];}if(_0x474d20['context']===_0xaf67('0x46')){if(this[_0xaf67('0x1d')][_0x474d20[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]]){this[_0xaf67('0x1d')][_0x474d20[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]]=_['omit'](this['agents'][_0x474d20[_0xaf67('0x3d')]['split']('-')[0x0]],[_0xaf67('0x48')]);this['emit'](util[_0xaf67('0x40')](_0xaf67('0x4a'),this['agents'][_0x474d20['channel']['split']('-')[0x0]][_0xaf67('0x62')]),_0xaf67('0x83'),{'destaccountcode':this['agents'][_0x474d20[_0xaf67('0x3d')][_0xaf67('0x47')]('-')[0x0]][_0xaf67('0x4c')]});}}ami['emit'](_0xaf67('0x84'),this[_0xaf67('0x1c')][_0x474d20[_0xaf67('0x37')]]);delete this[_0xaf67('0x1c')][_0x474d20[_0xaf67('0x37')]];}}}catch(_0x3f8bc3){logger[_0xaf67('0x3a')](_0xaf67('0x85'),util[_0xaf67('0x4d')](_0x3f8bc3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf67('0x33')]['syncAttendedTransfer']=function(_0xc25c77){try{if(this[_0xaf67('0x34')](_0xc25c77)){if(this[_0xaf67('0x1c')][_0xc25c77['transfereeuniqueid']]){this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x86')]]['transfercalleridnum']=_0xc25c77[_0xaf67('0x87')];this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x86')]][_0xaf67('0x88')]=_0xc25c77[_0xaf67('0x89')];if(this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x8a')]]){var _0x5e276b=this[_0xaf67('0x1c')][_0xc25c77['secondtransfereruniqueid']];this['channels'][_0xc25c77[_0xaf67('0x8a')]]=this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x86')]];this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x86')]]=_0x5e276b;}}else if(this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x8b')]]){this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x8b')]][_0xaf67('0x8c')]=_0xc25c77[_0xaf67('0x87')];this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x8b')]][_0xaf67('0x88')]=_0xc25c77[_0xaf67('0x89')];if(this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x8d')]]){var _0x5e276b=this[_0xaf67('0x1c')][_0xc25c77[_0xaf67('0x8d')]];this['channels'][_0xc25c77[_0xaf67('0x8d')]]=this[_0xaf67('0x1c')][_0xc25c77['transfertargetuniqueid']];this[_0xaf67('0x1c')][_0xc25c77['transfertargetuniqueid']]=_0x5e276b;}}}}catch(_0x44a43d){logger[_0xaf67('0x3a')](_0xaf67('0x8e'),util[_0xaf67('0x4d')](_0x44a43d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf67('0x33')][_0xaf67('0x8f')]=function(_0x944205){try{if(this[_0xaf67('0x34')](_0x944205)){if(this[_0xaf67('0x1c')][_0x944205[_0xaf67('0x86')]]){this['channels'][_0x944205[_0xaf67('0x86')]][_0xaf67('0x8c')]=_0x944205[_0xaf67('0x90')];this['channels'][_0x944205['transfereeuniqueid']][_0xaf67('0x88')]=_0x944205[_0xaf67('0x91')];this[_0xaf67('0x27')]({'event':_0xaf67('0x92'),'uniqueid':_0x944205[_0xaf67('0x86')],'context':_0x944205[_0xaf67('0x45')],'channel':_0x944205[_0xaf67('0x93')]});}}}catch(_0x8df968){logger[_0xaf67('0x3a')](_0xaf67('0x94'),util['inspect'](_0x8df968,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x57d259){try{if(this[_0xaf67('0x34')](_0x57d259)){if(this[_0xaf67('0x1c')][_0x57d259[_0xaf67('0x37')]]){if(!_[_0xaf67('0x6a')](this['channels'][_0x57d259[_0xaf67('0x37')]][_0xaf67('0x81')])){this[_0xaf67('0x1c')][_0x57d259['uniqueid']][_0xaf67('0x95')]=moment()[_0xaf67('0x40')](_0xaf67('0x41'));}}}}catch(_0x19d519){logger[_0xaf67('0x3a')](_0xaf67('0x96'),util[_0xaf67('0x4d')](_0x19d519,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xaf67('0x33')][_0xaf67('0x2e')]=function(_0xe028b7){try{if(this[_0xaf67('0x34')](_0xe028b7)){if(this[_0xaf67('0x1c')][_0xe028b7[_0xaf67('0x37')]]){if(!_['isNil'](this[_0xaf67('0x1c')][_0xe028b7[_0xaf67('0x37')]][_0xaf67('0x95')])){this['channels'][_0xe028b7[_0xaf67('0x37')]]['mohtime']+=moment()[_0xaf67('0x97')](0x0)['diff'](this[_0xaf67('0x1c')][_0xe028b7[_0xaf67('0x37')]]['mohstarttime'],_0xaf67('0x82'));delete this[_0xaf67('0x1c')][_0xe028b7[_0xaf67('0x37')]]['mohstarttime'];}}}}catch(_0x4a185e){logger[_0xaf67('0x3a')](_0xaf67('0x98'),util[_0xaf67('0x4d')](_0x4a185e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xe829=['transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','transfererchannel','mohstarttime','syncMusicOnHoldStop','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','bluebird','lodash','util','ioredis','../../../config/environment','ami','../ami','../model/channel','not_inuse','busy','invalid','unavailable','ringing','onhold','set','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','channels','agents','coreshowchannel','syncNewExten','bind','newexten','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','pick','keys','[syncNewCallerId][VoiceCallReport]','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','merge','context','from-sip','split','destconnectedlinenum','user:%s','name','user:agentconnect','exten','[syncNewChannel][VoiceCallReport]','application','applicationdata','toLowerCase','duration','seconds','includes','lastapplication','lastdata','startsWith','match','error','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','disposition','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','replace','.WAV','monitorFilename','find','isNil','monitors','push','rec','variable','mixmonitor_filename','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','inspect','omit','user:agentcomplete','accountcode','custom:voiceCallReport','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid'];(function(_0x80ab9e,_0x32c636){var _0x7605e6=function(_0x207f0d){while(--_0x207f0d){_0x80ab9e['push'](_0x80ab9e['shift']());}};_0x7605e6(++_0x32c636);}(_0xe829,0x139));var _0x9e82=function(_0x4651ae,_0x3d2bc0){_0x4651ae=_0x4651ae-0x0;var _0x29a97c=_0xe829[_0x4651ae];return _0x29a97c;};'use strict';var BPromise=require(_0x9e82('0x0'));var _=require(_0x9e82('0x1'));var moment=require('moment');var util=require(_0x9e82('0x2'));var path=require('path');var Redis=require(_0x9e82('0x3'));var config=require(_0x9e82('0x4'));var logger=require('../../../config/logger')(_0x9e82('0x5'));var ami=require(_0x9e82('0x6'));var Channel=require(_0x9e82('0x7'));var statusDesc=['unknown',_0x9e82('0x8'),'inuse',_0x9e82('0x9'),_0x9e82('0xa'),_0x9e82('0xb'),_0x9e82('0xc'),'ringinuse',_0x9e82('0xd')];var applications=[_0x9e82('0xe'),_0x9e82('0xf'),_0x9e82('0x10'),'dial',_0x9e82('0x11'),_0x9e82('0x12')];var dispositions=[_0x9e82('0x13'),_0x9e82('0x14'),_0x9e82('0x14'),_0x9e82('0x13'),'NO\x20ANSWER',_0x9e82('0x13'),_0x9e82('0x15'),_0x9e82('0x16'),'FAILED',_0x9e82('0x14'),_0x9e82('0x14')];var actions={};config[_0x9e82('0x17')]=_[_0x9e82('0x18')](config[_0x9e82('0x17')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e82('0x17')]));function VoiceCallReport(_0x3320dd){this[_0x9e82('0x19')]=_0x3320dd['channels'];this[_0x9e82('0x1a')]=_0x3320dd['agents'];ami['on'](_0x9e82('0x1b'),this[_0x9e82('0x1c')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x1e'),this['syncNewExten'][_0x9e82('0x1d')](this));ami['on']('newchannel',this[_0x9e82('0x1f')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x20'),this[_0x9e82('0x21')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x22'),this[_0x9e82('0x23')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x24'),this[_0x9e82('0x25')][_0x9e82('0x1d')](this));ami['on']('newcallerid',this[_0x9e82('0x26')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x27'),this[_0x9e82('0x28')]['bind'](this));ami['on'](_0x9e82('0x29'),this[_0x9e82('0x2a')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x2b'),this[_0x9e82('0x2c')][_0x9e82('0x1d')](this));ami['on'](_0x9e82('0x2d'),this['syncMusicOnHoldStop'][_0x9e82('0x1d')](this));return BPromise[_0x9e82('0x2e')]()[_0x9e82('0x2f')](ami[_0x9e82('0x30')]())[_0x9e82('0x31')](function(_0x2deb86){console[_0x9e82('0x32')](_0x2deb86);});}VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x34')]=function(_0x22b937){return _0x22b937!==null&&!_[_0x9e82('0x35')](_0x22b937);};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x36')]=function(_0x3fa282,_0x7bc1e1,_0x155fb2){io['to'](_0x3fa282)['emit'](_0x7bc1e1,_0x155fb2);};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x26')]=function(_0x243438){try{if(this[_0x9e82('0x34')](_0x243438)){if(_0x243438[_0x9e82('0x37')]===_0x243438[_0x9e82('0x38')]){if(!_[_0x9e82('0x35')](this[_0x9e82('0x19')][_0x243438[_0x9e82('0x37')]])){_['merge'](this[_0x9e82('0x19')][_0x243438['uniqueid']],_[_0x9e82('0x39')](_0x243438,_[_0x9e82('0x3a')](this[_0x9e82('0x19')][_0x243438[_0x9e82('0x37')]])));}}}}catch(_0x5ad3c5){logger['error'](_0x9e82('0x3b'),util['inspect'](_0x5ad3c5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x1f')]=function(_0x1726f3){try{if(this[_0x9e82('0x34')](_0x1726f3)){if(_0x1726f3[_0x9e82('0x37')]===_0x1726f3[_0x9e82('0x38')]&&_0x1726f3[_0x9e82('0x3c')]!=_0x9e82('0x3d')){if(_[_0x9e82('0x35')](this[_0x9e82('0x19')][_0x1726f3['uniqueid']])){this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]]=new Channel();this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]][_0x9e82('0x3e')]=moment()[_0x9e82('0x3f')](_0x9e82('0x40'));this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]]['disposition']=dispositions[_[_0x9e82('0x41')](_0x1726f3[_0x9e82('0x42')])];_[_0x9e82('0x43')](this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]],_['pick'](_0x1726f3,_[_0x9e82('0x3a')](this[_0x9e82('0x19')][_0x1726f3[_0x9e82('0x37')]])));if(_0x1726f3[_0x9e82('0x44')]===_0x9e82('0x45')){if(this[_0x9e82('0x1a')][_0x1726f3[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]){this[_0x9e82('0x1a')][_0x1726f3[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]][_0x9e82('0x47')]=_0x1726f3['exten'];this['emit'](util['format'](_0x9e82('0x48'),this[_0x9e82('0x1a')][_0x1726f3['channel'][_0x9e82('0x46')]('-')[0x0]][_0x9e82('0x49')]),_0x9e82('0x4a'),{'destaccountcode':this[_0x9e82('0x1a')][_0x1726f3[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1726f3[_0x9e82('0x4b')]});}}}}}}catch(_0xbfcdc5){logger['error'](_0x9e82('0x4c'),util['inspect'](_0xbfcdc5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e82('0x1c')]=function(_0x3780b8){try{if(this[_0x9e82('0x34')](_0x3780b8)){if(_0x3780b8[_0x9e82('0x37')]===_0x3780b8[_0x9e82('0x38')]&&_0x3780b8[_0x9e82('0x4b')]!='h'&&_0x3780b8[_0x9e82('0x3c')]!=_0x9e82('0x3d')){_0x3780b8[_0x9e82('0x4d')]=_0x3780b8['application']['toLowerCase']();_0x3780b8[_0x9e82('0x4e')]=(_0x3780b8['appdata']||_0x3780b8[_0x9e82('0x4e')])[_0x9e82('0x4f')]();if(_[_0x9e82('0x35')](this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]])){this['channels'][_0x3780b8[_0x9e82('0x37')]]=new Channel();this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]][_0x9e82('0x3e')]=_0x3780b8[_0x9e82('0x50')]?moment()['subtract'](moment[_0x9e82('0x50')](_0x3780b8['duration'])['seconds'](),_0x9e82('0x51'))['format'](_0x9e82('0x40')):moment()[_0x9e82('0x3f')](_0x9e82('0x40'));this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]]['disposition']=_0x9e82('0x13');}_[_0x9e82('0x43')](this['channels'][_0x3780b8[_0x9e82('0x37')]],_['pick'](_0x3780b8,_['keys'](this['channels'][_0x3780b8['uniqueid']])));if(_[_0x9e82('0x52')](applications,_0x3780b8['application'])){this['channels'][_0x3780b8[_0x9e82('0x37')]][_0x9e82('0x53')]=_0x3780b8[_0x9e82('0x4d')];this[_0x9e82('0x19')][_0x3780b8['uniqueid']][_0x9e82('0x54')]=_0x3780b8[_0x9e82('0x4e')];if(_0x3780b8[_0x9e82('0x4d')]===_0x9e82('0xe')&&_[_0x9e82('0x55')](_0x3780b8[_0x9e82('0x4e')],'cdr(')){var _0x5668d7=_0x3780b8[_0x9e82('0x4e')][_0x9e82('0x46')]('=');var _0x59143b=_0x5668d7[0x0][_0x9e82('0x56')](/cdr\((.*)\)/);if(_0x59143b){this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]][_0x59143b[0x1]]=_0x5668d7[0x1];}}else if(_0x3780b8[_0x9e82('0x4d')]===_0x9e82('0xf')){this[_0x9e82('0x19')][_0x3780b8[_0x9e82('0x37')]][_0x9e82('0xf')]=_0x3780b8[_0x9e82('0x4e')][_0x9e82('0x46')](',')[0x0];}}}}}catch(_0xeaa8cb){logger[_0x9e82('0x57')](_0x9e82('0x58'),util['inspect'](_0xeaa8cb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x21')]=function(_0x11f716){try{if(this[_0x9e82('0x34')](_0x11f716)){if(_0x11f716[_0x9e82('0x37')]!==_0x11f716[_0x9e82('0x38')]){if(this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]]){if(_0x11f716[_0x9e82('0x42')]==='6'){if(!this['channels'][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x59')]){var _0x429e2a=moment();this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x59')]=!![];this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x5a')]=_0x429e2a[_0x9e82('0x3f')](_0x9e82('0x40'));if(this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]]['starttime']){this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x5b')]=_0x429e2a[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x3e')],_0x9e82('0x51'));}}this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x38')]=_0x11f716[_0x9e82('0x37')];if(_0x11f716[_0x9e82('0x5d')]!==_0x9e82('0x5e')){this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x5f')]=_0x11f716['calleridnum'];}this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x60')]=_0x11f716[_0x9e82('0x61')];this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]][_0x9e82('0x62')]=_0x11f716[_0x9e82('0x3c')];this['channels'][_0x11f716['linkedid']][_0x9e82('0x63')]=dispositions[_[_0x9e82('0x41')](_0x11f716[_0x9e82('0x42')])];if(this['agents'][_0x11f716['channel'][_0x9e82('0x46')]('-')[0x0]]){this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x38')]]['UserId']=this['agents'][_0x11f716['channel'][_0x9e82('0x46')]('-')[0x0]]['id'];this['channels'][_0x11f716[_0x9e82('0x38')]]['membername']=this[_0x9e82('0x1a')][_0x11f716[_0x9e82('0x3c')]['split']('-')[0x0]][_0x9e82('0x49')];}}}}else{if(this['channels'][_0x11f716[_0x9e82('0x37')]]){if(_0x11f716['channelstate']==='6'){if(this[_0x9e82('0x1a')][_0x11f716[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]){this[_0x9e82('0x19')][_0x11f716['uniqueid']][_0x9e82('0x64')]=this['agents'][_0x11f716[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]['id'];this[_0x9e82('0x19')][_0x11f716[_0x9e82('0x37')]]['membername']=this[_0x9e82('0x1a')][_0x11f716[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]['name'];}}}}}}catch(_0x571de7){logger[_0x9e82('0x57')](_0x9e82('0x65'),util['inspect'](_0x571de7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x66')]=function(_0x35f4b7,_0x1e1e25){if(this[_0x9e82('0x19')][_0x35f4b7]){this[_0x9e82('0x19')][_0x35f4b7][_0x9e82('0x67')]=!![];if(_['endsWith'](_0x1e1e25,_0x9e82('0x68'))){_0x1e1e25=_0x1e1e25[_0x9e82('0x69')](_0x9e82('0x68'),_0x9e82('0x6a'));}this['channels'][_0x35f4b7][_0x9e82('0x6b')]=_0x1e1e25;var _0x19a3f5=_[_0x9e82('0x6c')](this['channels'][_0x35f4b7]['monitors'],{'filename':_0x1e1e25});if(_[_0x9e82('0x6d')](_0x19a3f5)){this[_0x9e82('0x19')][_0x35f4b7][_0x9e82('0x6e')][_0x9e82('0x6f')]({'filename':_0x1e1e25,'createdAt':moment()['format'](_0x9e82('0x40')),'mixmonitorid':'','status':_0x9e82('0x70')});}}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x23')]=function(_0x40734d){try{if(this[_0x9e82('0x34')](_0x40734d)){if(this[_0x9e82('0x19')][_0x40734d['uniqueid']]&&_0x40734d[_0x9e82('0x3c')]!='OutgoingSpoolFailed'){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')])){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x72')])){this['syncMixMonitorFilename'](_0x40734d['uniqueid'],_0x40734d[_0x9e82('0x73')]);}else if(this['isNotNull'](_0x40734d[_0x9e82('0x71')]['xmd-phone'])){this['channels'][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x5d')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d['variable'][_0x9e82('0x74')])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x75')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x76')])){this['channels'][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x77')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')]['xmd-queue'])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0xf')]=_0x40734d['value']['split'](',')[0x0];}else if(this[_0x9e82('0x34')](_0x40734d['variable']['xmd-originatecalleridnum'])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]]['originatecalleridnum']=_0x40734d[_0x9e82('0x73')];}else if(this['isNotNull'](_0x40734d['variable'][_0x9e82('0x78')])){this[_0x9e82('0x19')][_0x40734d['uniqueid']][_0x9e82('0x79')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x7a')])){this[_0x9e82('0x19')][_0x40734d['uniqueid']][_0x9e82('0x7b')]=_0x40734d['value'];}else if(this['isNotNull'](_0x40734d['variable'][_0x9e82('0x7c')])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0xf')]=_0x40734d[_0x9e82('0x73')];}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x7d')])){this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x37')]][_0x9e82('0x7e')]=_0x40734d[_0x9e82('0x73')];}}}else if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')]['mixmonitor_filename'])){if(_0x40734d[_0x9e82('0x73')]){var _0x3c7235=path[_0x9e82('0x7f')](_0x40734d[_0x9e82('0x73')])[_0x9e82('0x49')];this['syncMixMonitorFilename'](_0x3c7235,_0x40734d['value']);}}else if(this[_0x9e82('0x19')][_0x40734d[_0x9e82('0x38')]]){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')])){if(this[_0x9e82('0x34')](_0x40734d[_0x9e82('0x71')][_0x9e82('0x7d')])){this['channels'][_0x40734d['linkedid']][_0x9e82('0x80')]=_0x40734d['value'];}}}}}catch(_0x3c96b6){logger[_0x9e82('0x57')](_0x9e82('0x81'),util[_0x9e82('0x82')](_0x3c96b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x25')]=function(_0x57d659){try{if(this[_0x9e82('0x34')](_0x57d659)){if(this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]){var _0xc92ceb=moment();this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]['endtime']=_0xc92ceb[_0x9e82('0x3f')](_0x9e82('0x40'));this[_0x9e82('0x19')][_0x57d659['uniqueid']][_0x9e82('0x50')]=_0xc92ceb[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x3e')],'seconds');if(this[_0x9e82('0x19')][_0x57d659['uniqueid']][_0x9e82('0x59')]){this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]['billableseconds']=_0xc92ceb[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x5a')],'seconds');this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x5b')]=this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]][_0x9e82('0x50')]-this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]['billableseconds'];}if(_0x57d659[_0x9e82('0x44')]==='from-sip'){if(this[_0x9e82('0x1a')][_0x57d659[_0x9e82('0x3c')]['split']('-')[0x0]]){this['agents'][_0x57d659[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]]=_[_0x9e82('0x83')](this[_0x9e82('0x1a')][_0x57d659['channel'][_0x9e82('0x46')]('-')[0x0]],[_0x9e82('0x47')]);this[_0x9e82('0x36')](util[_0x9e82('0x3f')](_0x9e82('0x48'),this[_0x9e82('0x1a')][_0x57d659[_0x9e82('0x3c')][_0x9e82('0x46')]('-')[0x0]][_0x9e82('0x49')]),_0x9e82('0x84'),{'destaccountcode':this[_0x9e82('0x1a')][_0x57d659[_0x9e82('0x3c')]['split']('-')[0x0]][_0x9e82('0x85')]});}}ami[_0x9e82('0x36')](_0x9e82('0x86'),this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]]);delete this[_0x9e82('0x19')][_0x57d659[_0x9e82('0x37')]];}}}catch(_0x3ae737){logger[_0x9e82('0x57')]('[syncHangup][VoiceCallReport]',util['inspect'](_0x3ae737,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x37ee99){try{if(this[_0x9e82('0x34')](_0x37ee99)){if(this['channels'][_0x37ee99[_0x9e82('0x87')]]){this[_0x9e82('0x19')][_0x37ee99['transfereeuniqueid']]['transfercalleridnum']=_0x37ee99[_0x9e82('0x88')];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x87')]][_0x9e82('0x89')]=_0x37ee99[_0x9e82('0x8a')];if(this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8b')]]){var _0x56b2f7=this['channels'][_0x37ee99[_0x9e82('0x8b')]];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8b')]]=this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x87')]];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x87')]]=_0x56b2f7;}}else if(this[_0x9e82('0x19')][_0x37ee99['transfertargetuniqueid']]){this[_0x9e82('0x19')][_0x37ee99['transfertargetuniqueid']]['transfercalleridnum']=_0x37ee99['origtransferercalleridnum'];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8c')]][_0x9e82('0x89')]=_0x37ee99[_0x9e82('0x8a')];if(this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8d')]]){var _0x56b2f7=this['channels'][_0x37ee99[_0x9e82('0x8d')]];this['channels'][_0x37ee99[_0x9e82('0x8d')]]=this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8c')]];this[_0x9e82('0x19')][_0x37ee99[_0x9e82('0x8c')]]=_0x56b2f7;}}}}catch(_0x1ffeb2){logger['error'](_0x9e82('0x8e'),util[_0x9e82('0x82')](_0x1ffeb2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x2a')]=function(_0x3590b2){try{if(this['isNotNull'](_0x3590b2)){if(this[_0x9e82('0x19')][_0x3590b2[_0x9e82('0x87')]]){this[_0x9e82('0x19')][_0x3590b2[_0x9e82('0x87')]]['transfercalleridnum']=_0x3590b2[_0x9e82('0x8f')];this[_0x9e82('0x19')][_0x3590b2['transfereeuniqueid']][_0x9e82('0x89')]=_0x3590b2[_0x9e82('0x90')];this[_0x9e82('0x25')]({'event':_0x9e82('0x91'),'uniqueid':_0x3590b2[_0x9e82('0x87')],'context':_0x3590b2[_0x9e82('0x44')],'channel':_0x3590b2[_0x9e82('0x92')]});}}}catch(_0x2406b9){logger[_0x9e82('0x57')]('[syncBlindTransfer][VoiceCallReport]',util[_0x9e82('0x82')](_0x2406b9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9e82('0x33')][_0x9e82('0x2c')]=function(_0x1a3bd3){try{if(this[_0x9e82('0x34')](_0x1a3bd3)){if(this[_0x9e82('0x19')][_0x1a3bd3['uniqueid']]){if(!_[_0x9e82('0x6d')](this[_0x9e82('0x19')][_0x1a3bd3[_0x9e82('0x37')]][_0x9e82('0x5a')])){this[_0x9e82('0x19')][_0x1a3bd3[_0x9e82('0x37')]][_0x9e82('0x93')]=moment()[_0x9e82('0x3f')](_0x9e82('0x40'));}}}}catch(_0x231b4d){logger[_0x9e82('0x57')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x9e82('0x82')](_0x231b4d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9e82('0x94')]=function(_0x1bf823){try{if(this[_0x9e82('0x34')](_0x1bf823)){if(this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]]){if(!_[_0x9e82('0x6d')](this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]][_0x9e82('0x93')])){this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]][_0x9e82('0x95')]+=moment()['milliseconds'](0x0)[_0x9e82('0x5c')](this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]]['mohstarttime'],_0x9e82('0x51'));delete this[_0x9e82('0x19')][_0x1bf823[_0x9e82('0x37')]][_0x9e82('0x93')];}}}}catch(_0x39525b){logger[_0x9e82('0x57')](_0x9e82('0x96'),util[_0x9e82('0x82')](_0x39525b,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 7bf6ccb..1d4613a 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 _0x49ec=['dialstatus','ANSWER','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','connect','custom:dialconnect','voice:outbound','voice_outbound_channel:save','inspect','syncVarSet','keys','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberpenalty','isNil','endtime','duration','seconds','lastevent','total','answered','holdtime','starttime','billableseconds','diff','sumHoldTime','sumBillable','sumDuration','custom:dialend','[syncHangup][VoiceDialReport]','exports','lodash','util','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outbound','variables','dialbegin','syncDialBegin','bind','syncDialEnd','varset','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','uniqueid','merge','format','called','channel','substring','lastIndexOf','omit','event','privilege','error'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x49ec,0x83));var _0xc49e=function(_0xd59547,_0x258684){_0xd59547=_0xd59547-0x0;var _0x1cbdbe=_0x49ec[_0xd59547];return _0x1cbdbe;};'use strict';var _=require(_0xc49e('0x0'));var moment=require('moment');var util=require(_0xc49e('0x1'));var Redis=require(_0xc49e('0x2'));var config=require(_0xc49e('0x3'));var logger=require('../../../config/logger')(_0xc49e('0x4'));var ami=require(_0xc49e('0x5'));config[_0xc49e('0x6')]=_[_0xc49e('0x7')](config[_0xc49e('0x6')],{'host':_0xc49e('0x8'),'port':0x18eb});var io=require(_0xc49e('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x53c937){this[_0xc49e('0xa')]=_0x53c937['outboundChannels'];this[_0xc49e('0xb')]=_0x53c937[_0xc49e('0xb')];this[_0xc49e('0xc')]={};ami['on'](_0xc49e('0xd'),this[_0xc49e('0xe')][_0xc49e('0xf')](this));ami['on']('dialend',this[_0xc49e('0x10')][_0xc49e('0xf')](this));ami['on'](_0xc49e('0x11'),this['syncVarSet'][_0xc49e('0xf')](this));ami['on'](_0xc49e('0x12'),this[_0xc49e('0x13')]['bind'](this));}VoiceDialReport['prototype'][_0xc49e('0x14')]=function(_0x25be76){return _0x25be76!==null&&!_[_0xc49e('0x15')](_0x25be76);};VoiceDialReport[_0xc49e('0x16')][_0xc49e('0x17')]=function(_0x43e23c,_0x40d9f2,_0x5903e7){io['to'](_0x43e23c)[_0xc49e('0x17')](_0x40d9f2,_0x5903e7);};VoiceDialReport[_0xc49e('0x16')][_0xc49e('0xe')]=function(_0x32c585){try{if(this[_0xc49e('0x14')](_0x32c585)){if(this['channels'][_0x32c585[_0xc49e('0x18')]]){_[_0xc49e('0x19')](this[_0xc49e('0xa')][_0x32c585[_0xc49e('0x18')]],{'starttime':moment()[_0xc49e('0x1a')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xc49e('0x1b'),'interface':_0x32c585[_0xc49e('0x1c')][_0xc49e('0x1d')](0x0,_0x32c585[_0xc49e('0x1c')]['lastIndexOf']('-')),'membername':_0x32c585[_0xc49e('0x1c')][_0xc49e('0x1d')](_0x32c585[_0xc49e('0x1c')][_0xc49e('0x1e')]('/')+0x1,_0x32c585[_0xc49e('0x1c')][_0xc49e('0x1e')]('-'))},_[_0xc49e('0x1f')](_0x32c585,[_0xc49e('0x20'),_0xc49e('0x21')]));this[_0xc49e('0x17')]('voice:outbound','voice_outbound_channel:save',this[_0xc49e('0xa')][_0x32c585[_0xc49e('0x18')]]);ami['emit']('custom:dialbegin',this[_0xc49e('0xa')][_0x32c585[_0xc49e('0x18')]]);}}}catch(_0x4d6035){logger[_0xc49e('0x22')]('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x4d6035,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc49e('0x16')][_0xc49e('0x10')]=function(_0xfbf31a){try{if(this['isNotNull'](_0xfbf31a)){if(this[_0xc49e('0xa')][_0xfbf31a[_0xc49e('0x18')]]){this['channels'][_0xfbf31a[_0xc49e('0x18')]][_0xc49e('0x23')]=_0xfbf31a[_0xc49e('0x23')];if(_0xfbf31a[_0xc49e('0x23')]===_0xc49e('0x24')){this[_0xc49e('0xa')][_0xfbf31a[_0xc49e('0x18')]]['connectedlinenum']=_0xfbf31a['connectedlinenum'];this[_0xc49e('0xa')][_0xfbf31a[_0xc49e('0x18')]][_0xc49e('0x25')]=_0xfbf31a[_0xc49e('0x25')];this['channels'][_0xfbf31a[_0xc49e('0x18')]][_0xc49e('0x26')]=moment()['format'](_0xc49e('0x27'));this[_0xc49e('0xa')][_0xfbf31a[_0xc49e('0x18')]]['lastevent']=_0xc49e('0x28');ami[_0xc49e('0x17')](_0xc49e('0x29'),this[_0xc49e('0xa')][_0xfbf31a[_0xc49e('0x18')]]);}this[_0xc49e('0x17')](_0xc49e('0x2a'),_0xc49e('0x2b'),this[_0xc49e('0xa')][_0xfbf31a[_0xc49e('0x18')]]);}}}catch(_0x5deea8){logger['error']('[syncDialEnd][VoiceDialReport]',util[_0xc49e('0x2c')](_0x5deea8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc49e('0x16')][_0xc49e('0x2d')]=function(_0x3d10e0){try{if(this[_0xc49e('0x14')](_0x3d10e0)){this['addVariable'](_0x3d10e0[_0xc49e('0x18')],_[_0xc49e('0x2e')](_0x3d10e0[_0xc49e('0x2f')])[0x0],_0x3d10e0[_0xc49e('0x30')]);if(this['isNotNull'](_0x3d10e0[_0xc49e('0x2f')])&&this['isNotNull'](_0x3d10e0[_0xc49e('0x2f')][_0xc49e('0x31')])){if(_[_0xc49e('0x15')](this[_0xc49e('0xa')][_0x3d10e0[_0xc49e('0x18')]])){this[_0xc49e('0xa')][_0x3d10e0['uniqueid']]={'routeId':_0x3d10e0[_0xc49e('0x30')],'variables':this['variables'][_0x3d10e0[_0xc49e('0x18')]]};this[_0xc49e('0x17')](_0xc49e('0x2a'),'voice_outbound_channel:save',this[_0xc49e('0xa')][_0x3d10e0[_0xc49e('0x18')]]);}}}}catch(_0x2a664d){logger[_0xc49e('0x22')](_0xc49e('0x32'),util[_0xc49e('0x2c')](_0x2a664d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xc49e('0x16')][_0xc49e('0x33')]=function(_0x53c016,_0x2307bb,_0x455983){var _0x280d99=[_0xc49e('0x34'),_0xc49e('0x35'),_0xc49e('0x36'),_0xc49e('0x37'),_0xc49e('0x38'),'rtpaudioqoslossbridged',_0xc49e('0x39'),_0xc49e('0x3a'),_0xc49e('0x3b'),_0xc49e('0x3c'),_0xc49e('0x3d'),'bridgepvtcallid',_0xc49e('0x3e'),'memberdynamic',_0xc49e('0x3f'),_0xc49e('0x40'),'membername',_0xc49e('0x41'),'memberrealtime'];if(!_[_0xc49e('0x42')](_0x2307bb)&&!_['includes'](_0x280d99,_0x2307bb)){if(_['isUndefined'](this[_0xc49e('0xc')][_0x53c016])){this[_0xc49e('0xc')][_0x53c016]={};}this[_0xc49e('0xc')][_0x53c016][_0x2307bb]=_0x455983;}};VoiceDialReport[_0xc49e('0x16')][_0xc49e('0x13')]=function(_0x3ada64){try{if(this[_0xc49e('0x14')](_0x3ada64)){if(this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]]){this['channels'][_0x3ada64['uniqueid']][_0xc49e('0x43')]=moment()[_0xc49e('0x1a')](_0xc49e('0x27'));this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x44')]=moment(this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]]['endtime'])['diff'](this['channels'][_0x3ada64['uniqueid']]['starttime'],_0xc49e('0x45'));this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x46')]='complete';this['outbound'][_0xc49e('0x47')]+=0x1;if(this['channels'][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x26')]){this['outbound'][_0xc49e('0x48')]+=0x1;this[_0xc49e('0xa')][_0x3ada64['uniqueid']][_0xc49e('0x49')]=moment(this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x26')])['diff'](this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x4a')],_0xc49e('0x45'));this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x4b')]=moment(this['channels'][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x43')])[_0xc49e('0x4c')](this[_0xc49e('0xa')][_0x3ada64['uniqueid']][_0xc49e('0x26')],_0xc49e('0x45'));this['outbound'][_0xc49e('0x4d')]+=this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x49')]||0x0;this[_0xc49e('0xb')][_0xc49e('0x4e')]+=this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x4b')];}this['outbound'][_0xc49e('0x4f')]+=this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]][_0xc49e('0x44')];ami[_0xc49e('0x17')]('custom:voiceDialReport',this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]]);ami[_0xc49e('0x17')](_0xc49e('0x50'),this['channels'][_0x3ada64[_0xc49e('0x18')]]);this['emit'](_0xc49e('0x2a'),'voice_outbound:save',this[_0xc49e('0xb')]);this[_0xc49e('0x17')](_0xc49e('0x2a'),'voice_outbound_channel:remove',this[_0xc49e('0xa')][_0x3ada64['uniqueid']]);delete this[_0xc49e('0xa')][_0x3ada64[_0xc49e('0x18')]];}if(this[_0xc49e('0xc')][_0x3ada64['uniqueid']]){delete this[_0xc49e('0xc')][_0x3ada64[_0xc49e('0x18')]];}}}catch(_0x385ca7){logger[_0xc49e('0x22')](_0xc49e('0x51'),util[_0xc49e('0x2c')](_0x385ca7,{'showHidden':![],'depth':null}));}};module[_0xc49e('0x52')]=VoiceDialReport; \ No newline at end of file +var _0x5c1f=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','diff','starttime','complete','total','answered','holdtime','seconds','billableseconds','sumDuration','custom:dialend','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','ioredis','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','syncVarSet','hangup','isNotNull','isUndefined','prototype','uniqueid','format','called','channel','substring','lastIndexOf','omit','event','privilege','emit','voice:outbound','voice_outbound_channel:save','error','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','addVariable','keys','variable','outboundrouteid','value','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged'];(function(_0x57c7a8,_0x497e8c){var _0x70c788=function(_0x4be826){while(--_0x4be826){_0x57c7a8['push'](_0x57c7a8['shift']());}};_0x70c788(++_0x497e8c);}(_0x5c1f,0x1d5));var _0xf5c1=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x5c1f[_0x260f28];return _0x3aefcc;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require(_0xf5c1('0x0'));var config=require(_0xf5c1('0x1'));var logger=require(_0xf5c1('0x2'))('ami');var ami=require(_0xf5c1('0x3'));config[_0xf5c1('0x4')]=_['defaults'](config[_0xf5c1('0x4')],{'host':_0xf5c1('0x5'),'port':0x18eb});var io=require(_0xf5c1('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0x77d808){this[_0xf5c1('0x7')]=_0x77d808[_0xf5c1('0x8')];this[_0xf5c1('0x9')]=_0x77d808[_0xf5c1('0x9')];this[_0xf5c1('0xa')]={};ami['on'](_0xf5c1('0xb'),this[_0xf5c1('0xc')]['bind'](this));ami['on'](_0xf5c1('0xd'),this[_0xf5c1('0xe')][_0xf5c1('0xf')](this));ami['on'](_0xf5c1('0x10'),this[_0xf5c1('0x11')][_0xf5c1('0xf')](this));ami['on'](_0xf5c1('0x12'),this['syncHangup'][_0xf5c1('0xf')](this));}VoiceDialReport['prototype'][_0xf5c1('0x13')]=function(_0x16bb7e){return _0x16bb7e!==null&&!_[_0xf5c1('0x14')](_0x16bb7e);};VoiceDialReport[_0xf5c1('0x15')]['emit']=function(_0x544f46,_0x507a48,_0x26d26c){io['to'](_0x544f46)['emit'](_0x507a48,_0x26d26c);};VoiceDialReport[_0xf5c1('0x15')][_0xf5c1('0xc')]=function(_0xffbaad){try{if(this[_0xf5c1('0x13')](_0xffbaad)){if(this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]]){_['merge'](this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]],{'starttime':moment()[_0xf5c1('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xf5c1('0x18'),'interface':_0xffbaad[_0xf5c1('0x19')][_0xf5c1('0x1a')](0x0,_0xffbaad[_0xf5c1('0x19')][_0xf5c1('0x1b')]('-')),'membername':_0xffbaad['channel']['substring'](_0xffbaad[_0xf5c1('0x19')]['lastIndexOf']('/')+0x1,_0xffbaad[_0xf5c1('0x19')][_0xf5c1('0x1b')]('-'))},_[_0xf5c1('0x1c')](_0xffbaad,[_0xf5c1('0x1d'),_0xf5c1('0x1e')]));this[_0xf5c1('0x1f')](_0xf5c1('0x20'),_0xf5c1('0x21'),this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]]);ami['emit']('custom:dialbegin',this[_0xf5c1('0x7')][_0xffbaad[_0xf5c1('0x16')]]);}}}catch(_0x1d63f5){logger[_0xf5c1('0x22')]('[syncDialBegin][VoiceDialReport]',util[_0xf5c1('0x23')](_0x1d63f5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf5c1('0x15')][_0xf5c1('0xe')]=function(_0x3b80b0){try{if(this[_0xf5c1('0x13')](_0x3b80b0)){if(this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]]){this['channels'][_0x3b80b0['uniqueid']][_0xf5c1('0x24')]=_0x3b80b0[_0xf5c1('0x24')];if(_0x3b80b0[_0xf5c1('0x24')]===_0xf5c1('0x25')){this[_0xf5c1('0x7')][_0x3b80b0['uniqueid']][_0xf5c1('0x26')]=_0x3b80b0[_0xf5c1('0x26')];this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]][_0xf5c1('0x27')]=_0x3b80b0[_0xf5c1('0x27')];this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]][_0xf5c1('0x28')]=moment()[_0xf5c1('0x17')](_0xf5c1('0x29'));this[_0xf5c1('0x7')][_0x3b80b0['uniqueid']]['lastevent']=_0xf5c1('0x2a');ami[_0xf5c1('0x1f')](_0xf5c1('0x2b'),this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]]);}this['emit'](_0xf5c1('0x20'),_0xf5c1('0x21'),this[_0xf5c1('0x7')][_0x3b80b0[_0xf5c1('0x16')]]);}}}catch(_0x319147){logger[_0xf5c1('0x22')](_0xf5c1('0x2c'),util[_0xf5c1('0x23')](_0x319147,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf5c1('0x15')][_0xf5c1('0x11')]=function(_0x30d50d){try{if(this['isNotNull'](_0x30d50d)){this[_0xf5c1('0x2d')](_0x30d50d['uniqueid'],_[_0xf5c1('0x2e')](_0x30d50d[_0xf5c1('0x2f')])[0x0],_0x30d50d['value']);if(this['isNotNull'](_0x30d50d['variable'])&&this['isNotNull'](_0x30d50d[_0xf5c1('0x2f')][_0xf5c1('0x30')])){if(_[_0xf5c1('0x14')](this['channels'][_0x30d50d['uniqueid']])){this[_0xf5c1('0x7')][_0x30d50d['uniqueid']]={'routeId':_0x30d50d[_0xf5c1('0x31')],'variables':this['variables'][_0x30d50d[_0xf5c1('0x16')]]};this[_0xf5c1('0x1f')](_0xf5c1('0x20'),_0xf5c1('0x21'),this[_0xf5c1('0x7')][_0x30d50d[_0xf5c1('0x16')]]);}}}}catch(_0x10023d){logger[_0xf5c1('0x22')](_0xf5c1('0x32'),util['inspect'](_0x10023d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xf5c1('0x15')]['addVariable']=function(_0x462402,_0x1bf736,_0x204d60){var _0x3c71e5=[_0xf5c1('0x33'),_0xf5c1('0x34'),_0xf5c1('0x35'),_0xf5c1('0x36'),_0xf5c1('0x37'),_0xf5c1('0x38'),_0xf5c1('0x39'),_0xf5c1('0x3a'),_0xf5c1('0x3b'),_0xf5c1('0x3c'),_0xf5c1('0x3d'),_0xf5c1('0x3e'),_0xf5c1('0x3f'),_0xf5c1('0x40'),_0xf5c1('0x41'),'memberlastcall',_0xf5c1('0x42'),_0xf5c1('0x43'),_0xf5c1('0x44')];if(!_[_0xf5c1('0x45')](_0x1bf736)&&!_[_0xf5c1('0x46')](_0x3c71e5,_0x1bf736)){if(_[_0xf5c1('0x14')](this[_0xf5c1('0xa')][_0x462402])){this[_0xf5c1('0xa')][_0x462402]={};}this[_0xf5c1('0xa')][_0x462402][_0x1bf736]=_0x204d60;}};VoiceDialReport['prototype']['syncHangup']=function(_0x2f5621){try{if(this[_0xf5c1('0x13')](_0x2f5621)){if(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]){this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x47')]=moment()['format'](_0xf5c1('0x29'));this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x48')]=moment(this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x47')])[_0xf5c1('0x49')](this['channels'][_0x2f5621['uniqueid']][_0xf5c1('0x4a')],'seconds');this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['lastevent']=_0xf5c1('0x4b');this['outbound'][_0xf5c1('0x4c')]+=0x1;if(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x28')]){this['outbound'][_0xf5c1('0x4d')]+=0x1;this[_0xf5c1('0x7')][_0x2f5621['uniqueid']][_0xf5c1('0x4e')]=moment(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['answertime'])[_0xf5c1('0x49')](this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['starttime'],_0xf5c1('0x4f'));this[_0xf5c1('0x7')][_0x2f5621['uniqueid']][_0xf5c1('0x50')]=moment(this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['endtime'])[_0xf5c1('0x49')](this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x28')],_0xf5c1('0x4f'));this[_0xf5c1('0x9')]['sumHoldTime']+=this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x4e')]||0x0;this[_0xf5c1('0x9')]['sumBillable']+=this['channels'][_0x2f5621[_0xf5c1('0x16')]][_0xf5c1('0x50')];}this[_0xf5c1('0x9')][_0xf5c1('0x51')]+=this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]['duration'];ami['emit']('custom:voiceDialReport',this['channels'][_0x2f5621[_0xf5c1('0x16')]]);ami[_0xf5c1('0x1f')](_0xf5c1('0x52'),this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]);this[_0xf5c1('0x1f')]('voice:outbound',_0xf5c1('0x53'),this[_0xf5c1('0x9')]);this['emit'](_0xf5c1('0x20'),_0xf5c1('0x54'),this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]]);delete this[_0xf5c1('0x7')][_0x2f5621[_0xf5c1('0x16')]];}if(this['variables'][_0x2f5621[_0xf5c1('0x16')]]){delete this[_0xf5c1('0xa')][_0x2f5621[_0xf5c1('0x16')]];}}}catch(_0x350fa9){logger['error'](_0xf5c1('0x55'),util[_0xf5c1('0x23')](_0x350fa9,{'showHidden':![],'depth':null}));}};module[_0xf5c1('0x56')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 57f0424..5c129ae 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 _0xb7ae=['custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','BLIND','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','exports','lodash','moment','bluebird','util','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','variables','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','sumDuration','sumHoldTime','type','abandoned','Trunk','active','callerid','Interval','md5','voice_queue:save','isNotNull','loopQueueShow','queues','[queues]','then','[queuesummary]','queue','countBy','callers','waiting','loggedIn','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','syncQueueCallerJoin','uniqueid','position','count','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','syncAgentConnect','COMPLETEDBYAGENT','syncAgentComplete','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','local/','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','queuestatus','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','length','unmanaged','diff','milliseconds','total','sumBillable','lastevent','custom:queuecallerunmanaged'];(function(_0x5c0ff6,_0x22cdd2){var _0x1135cd=function(_0x55d5b0){while(--_0x55d5b0){_0x5c0ff6['push'](_0x5c0ff6['shift']());}};_0x1135cd(++_0x22cdd2);}(_0xb7ae,0xdd));var _0xeb7a=function(_0x217ad6,_0x5bc2d9){_0x217ad6=_0x217ad6-0x0;var _0x1b975d=_0xb7ae[_0x217ad6];return _0x1b975d;};'use strict';var _=require(_0xeb7a('0x0'));var moment=require(_0xeb7a('0x1'));var BPromise=require(_0xeb7a('0x2'));var util=require(_0xeb7a('0x3'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xeb7a('0x4'));var logger=require(_0xeb7a('0x5'))(_0xeb7a('0x6'));var ami=require(_0xeb7a('0x7'));var QueueReport=require(_0xeb7a('0x8'));config[_0xeb7a('0x9')]=_[_0xeb7a('0xa')](config[_0xeb7a('0x9')],{'host':_0xeb7a('0xb'),'port':0x18eb});var io=require(_0xeb7a('0xc'))(new Redis(config[_0xeb7a('0x9')]));var Sequence=function(){};Sequence[_0xeb7a('0xd')][_0xeb7a('0xe')]=function(_0x2f3871){this[_0xeb7a('0xf')]=this[_0xeb7a('0xf')]?this[_0xeb7a('0xf')][_0xeb7a('0x10')](_0x2f3871):_0x2f3871();};function VoiceQueueReport(_0x32d47b){this[_0xeb7a('0x11')]=new Sequence();this[_0xeb7a('0x12')]={};this[_0xeb7a('0x13')]=_0x32d47b['agents'];this[_0xeb7a('0x14')]=_0x32d47b[_0xeb7a('0x15')];this[_0xeb7a('0x16')]=_0x32d47b['voiceQueues'];this[_0xeb7a('0x17')]=!![];this[_0xeb7a('0x18')]=_0x32d47b['campaigns'];this['variables']={};ami['on'](_0xeb7a('0x19'),this[_0xeb7a('0x1a')]['bind'](this));ami['on'](_0xeb7a('0x1b'),this[_0xeb7a('0x1c')]['bind'](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x1e'),this[_0xeb7a('0x1f')][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x20'),this[_0xeb7a('0x21')][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x22'),this['syncAgentComplete'][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x23'),this['syncAgentConnect'][_0xeb7a('0x1d')](this));ami['on']('varset',this[_0xeb7a('0x24')][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x25'),this[_0xeb7a('0x26')][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x27'),this[_0xeb7a('0x28')][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x29'),this[_0xeb7a('0x2a')][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x2b'),this[_0xeb7a('0x2c')]['bind'](this));ami['on'](_0xeb7a('0x2d'),this[_0xeb7a('0x2e')][_0xeb7a('0x1d')](this));ami['on'](_0xeb7a('0x2f'),this['syncBlindTransfer'][_0xeb7a('0x1d')](this));this[_0xeb7a('0x30')]();this['loopQueueShow']();}function isNotNull(_0x22480a){return _0x22480a!==null&&!_[_0xeb7a('0x31')](_0x22480a);}function clearChannels(_0x5a4c4){if(!_[_0xeb7a('0x32')](_0x5a4c4)){for(var _0x268ca8 in _0x5a4c4){if(_0x5a4c4[_0xeb7a('0x33')](_0x268ca8)){delete _0x5a4c4[_0x268ca8];}}}}function clearCampaigns(_0x49ac95){if(!_[_0xeb7a('0x32')](_0x49ac95)){for(var _0x2628c2 in _0x49ac95){if(_0x49ac95[_0xeb7a('0x33')](_0x2628c2)){_0x49ac95[_0x2628c2][_0xeb7a('0x34')]=0x0;}}}}function clearVoiceQueues(_0x2f2824){if(!_[_0xeb7a('0x32')](_0x2f2824)){for(var _0x31f4ad in _0x2f2824){if(_0x2f2824[_0xeb7a('0x33')](_0x31f4ad)){_0x2f2824[_0x31f4ad][_0xeb7a('0x34')]=0x0;_0x2f2824[_0x31f4ad][_0xeb7a('0x35')]=0x0;_0x2f2824[_0x31f4ad][_0xeb7a('0x36')]=0x0;_0x2f2824[_0x31f4ad]['waiting']=0x0;_0x2f2824[_0x31f4ad][_0xeb7a('0x37')]=!![];}}}}function clearAgentBooked(_0x3eb036){if(!_[_0xeb7a('0x32')](_0x3eb036)){for(var _0x3ab9ea in _0x3eb036){if(_0x3eb036[_0xeb7a('0x33')](_0x3ab9ea)){_0x3eb036[_0x3ab9ea][_0xeb7a('0x38')]=!![];}}}}VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x39')]=function(){var _0x11681e=this;for(var _0x122129 in this['channels']){if(this['channels']['hasOwnProperty'](_0x122129)&&!this[_0xeb7a('0x14')][_0x122129][_0xeb7a('0x3a')]){this[_0xeb7a('0x11')][_0xeb7a('0xe')](function(){if(!_[_0xeb7a('0x3b')](_0x11681e[_0xeb7a('0x14')][_0x122129])){return ami[_0xeb7a('0x3c')]({'action':_0xeb7a('0x3d'),'channel':_0x11681e[_0xeb7a('0x14')][_0x122129][_0xeb7a('0x3e')]})[_0xeb7a('0x3f')](function(_0x17534d){if(_0x17534d[_0xeb7a('0x40')]===_0xeb7a('0x41')){setTimeout(function(){if(_0x11681e[_0xeb7a('0x14')][_0x122129]){delete _0x11681e[_0xeb7a('0x14')][_0x122129];logger[_0xeb7a('0x42')](_0xeb7a('0x43'),_0x122129);}if(_0x11681e[_0xeb7a('0x12')][_0x122129]){delete _0x11681e[_0xeb7a('0x12')][_0x122129];logger['error'](_0xeb7a('0x44'),_0x122129);}if(_0x11681e[_0xeb7a('0x45')][_0x122129]){delete _0x11681e['variables'][_0x122129];logger[_0xeb7a('0x42')](_0xeb7a('0x46'),_0x122129);}},0x1f40);}});}});}}};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x28')]=function(){logger['error'](_0xeb7a('0x47'));clearChannels(this[_0xeb7a('0x14')]);this[_0xeb7a('0x48')](this[_0xeb7a('0x12')]);clearAgentBooked(this[_0xeb7a('0x13')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xeb7a('0x18')]);};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x48')]=function(_0x33bca7){var _0x16b438=this;if(!_[_0xeb7a('0x32')](_0x33bca7)){for(var _0x45557d in _0x33bca7){if(_0x33bca7[_0xeb7a('0x33')](_0x45557d)){_0x16b438[_0xeb7a('0x49')](_0x33bca7[_0x45557d]);delete _0x33bca7[_0x45557d];}}}};function loggerCatch(_0x4dd173){return function(_0x43214d){logger[_0xeb7a('0x42')](_0x4dd173,util[_0xeb7a('0x4a')](_0x43214d,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0xeb7a('0x4b')]=function(_0x4b5747,_0x79f3bc,_0x148c60){io['to'](_0x4b5747)['emit'](_0x79f3bc,_0x148c60);};VoiceQueueReport['prototype'][_0xeb7a('0x4c')]=function(_0x4c8ff0){this[_0xeb7a('0x4b')](util[_0xeb7a('0x4d')](_0xeb7a('0x4e'),_0x4c8ff0[_0xeb7a('0x4f')]),_0xeb7a('0x50'),_0x4c8ff0);};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x49')]=function(_0x4716f1){this[_0xeb7a('0x4b')](util[_0xeb7a('0x4d')](_0xeb7a('0x4e'),_0x4716f1[_0xeb7a('0x4f')]),_0xeb7a('0x51'),_0x4716f1);};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x52')]=function(_0x4c458c){if(_0x4c458c['type']===_0xeb7a('0x53')){var _0x265fe7={'id':_0x4c458c['id'],'name':_0x4c458c['name'],'strategy':_0x4c458c[_0xeb7a('0x54')],'answered':_0x4c458c[_0xeb7a('0x55')],'available':_0x4c458c[_0xeb7a('0x56')],'loggedIn':_0x4c458c['loggedIn'],'pTalking':_0x4c458c['pTalking'],'sumBillable':_0x4c458c['sumBillable'],'sumDuration':_0x4c458c[_0xeb7a('0x57')],'sumHoldTime':_0x4c458c[_0xeb7a('0x58')]||0x0,'talking':_0x4c458c[_0xeb7a('0x35')],'total':_0x4c458c['total'],'type':_0x4c458c[_0xeb7a('0x59')],'unmanaged':_0x4c458c['unmanaged'],'abandoned':_0x4c458c[_0xeb7a('0x5a')],'waiting':_0x4c458c['waiting']};if(_0x4c458c['Trunk']){_0x265fe7[_0xeb7a('0x5b')]={'id':_0x4c458c[_0xeb7a('0x5b')]['id'],'name':_0x4c458c[_0xeb7a('0x5b')]['name'],'active':_0x4c458c[_0xeb7a('0x5b')][_0xeb7a('0x5c')],'callerid':_0x4c458c['Trunk'][_0xeb7a('0x5d')]};}if(_0x4c458c[_0xeb7a('0x5e')]){_0x265fe7[_0xeb7a('0x5e')]={'id':_0x4c458c[_0xeb7a('0x5e')]['id'],'name':_0x4c458c[_0xeb7a('0x5e')][_0xeb7a('0x4f')]};}var _0x5b9d5e=md5(JSON['stringify'](_0x265fe7));if(_0x4c458c[_0xeb7a('0x5f')]!==_0x5b9d5e){_0x4c458c['md5']=_0x5b9d5e;this[_0xeb7a('0x4b')](util[_0xeb7a('0x4d')]('voice:queue:%s',_0x265fe7[_0xeb7a('0x4f')]),_0xeb7a('0x60'),_0x265fe7);}}};VoiceQueueReport['prototype'][_0xeb7a('0x61')]=function(_0xcfbb40){return _0xcfbb40!==null&&!_[_0xeb7a('0x31')](_0xcfbb40);};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x62')]=function(){var _0x22ca96=this;setInterval(function(){_0x22ca96[_0xeb7a('0x39')]();ami[_0xeb7a('0x3c')]({'action':_0xeb7a('0x63')})['catch'](loggerCatch(_0xeb7a('0x64')));},0x2710);};VoiceQueueReport[_0xeb7a('0xd')]['loopQueueSummary']=function(){var _0x150f07=this;setInterval(function(){if(_0x150f07['flagQueueSummary']){return ami[_0xeb7a('0x3c')]({'action':_0xeb7a('0x19')})[_0xeb7a('0x65')](function(_0x19bb62){_0x150f07[_0xeb7a('0x17')]=![];})[_0xeb7a('0x3f')](loggerCatch(_0xeb7a('0x66')));}},0x3e8);};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x1a')]=function(_0x3c4e){try{if(this[_0xeb7a('0x61')](_0x3c4e)&&this[_0xeb7a('0x61')](_0x3c4e[_0xeb7a('0x67')])){if(this['voiceQueues'][_0x3c4e[_0xeb7a('0x67')]]){var _0x1bdd77=_[_0xeb7a('0x68')](this[_0xeb7a('0x14')],'queue')[_0x3c4e[_0xeb7a('0x67')]]||0x0;var _0x39d766=_0x1bdd77-_0x3c4e[_0xeb7a('0x69')];if(this['voiceQueues'][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x6a')]!==_['toNumber'](_0x3c4e['callers'])||this['voiceQueues'][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x6b')]!==_[_0xeb7a('0x6c')](_0x3c4e[_0xeb7a('0x6d')])||this[_0xeb7a('0x16')][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x56')]!==_[_0xeb7a('0x6c')](_0x3c4e[_0xeb7a('0x56')])||this[_0xeb7a('0x16')][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x35')]!==_0x39d766){this['voiceQueues'][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x6a')]=_[_0xeb7a('0x6c')](_0x3c4e[_0xeb7a('0x69')]);this[_0xeb7a('0x16')][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x6b')]=_['toNumber'](_0x3c4e[_0xeb7a('0x6d')]);this[_0xeb7a('0x16')][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x56')]=_['toNumber'](_0x3c4e['available']);this[_0xeb7a('0x16')][_0x3c4e[_0xeb7a('0x67')]]['talking']=_0x39d766>0x0?_0x39d766:0x0;this[_0xeb7a('0x16')][_0x3c4e['queue']][_0xeb7a('0x35')]=this['voiceQueues'][_0x3c4e[_0xeb7a('0x67')]][_0xeb7a('0x35')]>_[_0xeb7a('0x6c')](_0x3c4e[_0xeb7a('0x6d')])?_[_0xeb7a('0x6c')](_0x3c4e[_0xeb7a('0x6d')]):this[_0xeb7a('0x16')][_0x3c4e['queue']][_0xeb7a('0x35')];this[_0xeb7a('0x52')](this[_0xeb7a('0x16')][_0x3c4e[_0xeb7a('0x67')]]);}ami[_0xeb7a('0x4b')](_0xeb7a('0x6e'),this[_0xeb7a('0x16')][_0x3c4e['queue']]);}}}catch(_0x5553ce){logger[_0xeb7a('0x42')](_0xeb7a('0x6f'),util['inspect'](_0x5553ce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x1c')]=function(_0x568af9){this[_0xeb7a('0x17')]=!![];};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x70')]=function(_0x4511d5){};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x71')]=function(_0x444829){try{if(this['isNotNull'](_0x444829)){if(_[_0xeb7a('0x31')](this['queueReports'][_0x444829[_0xeb7a('0x72')]])){this[_0xeb7a('0x12')][_0x444829[_0xeb7a('0x72')]]=[];this['channels'][_0x444829['uniqueid']]={};}var _0x5c8bb1=new QueueReport();_0x5c8bb1['name']=_0x444829[_0xeb7a('0x67')];_0x5c8bb1[_0xeb7a('0x59')]=this[_0xeb7a('0x16')][_0x5c8bb1[_0xeb7a('0x4f')]]&&this[_0xeb7a('0x16')][_0x5c8bb1[_0xeb7a('0x4f')]][_0xeb7a('0x59')]?this[_0xeb7a('0x16')][_0x5c8bb1['name']][_0xeb7a('0x59')]||'inbound':_0xeb7a('0x53');_0x5c8bb1['queue']=_0x444829['queue'];_0x5c8bb1['queuecallerjoinAt']=moment()[_0xeb7a('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c8bb1['position']=_0x444829[_0xeb7a('0x73')];_0x5c8bb1['count']=_0x444829[_0xeb7a('0x74')];_['merge'](_0x5c8bb1,_[_0xeb7a('0x75')](_0x444829,_[_0xeb7a('0x76')](_0x5c8bb1)));this[_0xeb7a('0x12')][_0x444829[_0xeb7a('0x72')]][_0xeb7a('0x77')](_0x5c8bb1);this[_0xeb7a('0x14')][_0x444829[_0xeb7a('0x72')]]=_0x5c8bb1;this[_0xeb7a('0x4c')](_0x5c8bb1);}}catch(_0x4157d2){logger[_0xeb7a('0x42')](_0xeb7a('0x78'),util[_0xeb7a('0x4a')](_0x4157d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb7a('0xd')]['syncQueueCallerAbandon']=function(_0x49ca07){try{if(this[_0xeb7a('0x61')](_0x49ca07)){if(this[_0xeb7a('0x12')][_0x49ca07[_0xeb7a('0x72')]]){var _0x4a605d=_[_0xeb7a('0x79')](this[_0xeb7a('0x12')][_0x49ca07[_0xeb7a('0x72')]]);_0x4a605d[_0xeb7a('0x7a')]=![];_0x4a605d[_0xeb7a('0x7b')]=null;_0x4a605d['holdtime']=_0x49ca07[_0xeb7a('0x7c')];_0x4a605d['originalposition']=_0x49ca07[_0xeb7a('0x7d')];_0x4a605d['queuecallerabandon']=!![];_0x4a605d[_0xeb7a('0x7e')]=moment()[_0xeb7a('0x4d')](_0xeb7a('0x7f'));_0x4a605d[_0xeb7a('0x80')]=_0xeb7a('0x81');_0x4a605d[_0xeb7a('0x82')]=null;this[_0xeb7a('0x14')][_0x49ca07[_0xeb7a('0x72')]]=_0x4a605d;this['emitVoiceQueueChannelRemove'](_0x4a605d);}}}catch(_0x2a66b0){logger[_0xeb7a('0x42')](_0xeb7a('0x83'),util[_0xeb7a('0x4a')](_0x2a66b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x21')]=function(_0x527551){try{if(this[_0xeb7a('0x61')](_0x527551)){if(this[_0xeb7a('0x12')][_0x527551['uniqueid']]){var _0xeee64e=_[_0xeb7a('0x79')](this['queueReports'][_0x527551[_0xeb7a('0x72')]]);_0xeee64e[_0xeb7a('0x84')]=moment()['format'](_0xeb7a('0x7f'));_0xeee64e[_0xeb7a('0x85')]=_0x527551[_0xeb7a('0x85')];_0xeee64e[_0xeb7a('0x86')]=_0x527551[_0xeb7a('0x86')];this[_0xeb7a('0x14')][_0x527551[_0xeb7a('0x72')]]=_0xeee64e;this[_0xeb7a('0x4c')](_0xeee64e);}}}catch(_0x1ff4e8){logger[_0xeb7a('0x42')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0xeb7a('0x4a')](_0x1ff4e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x87')]=function(_0x480954){try{if(this['isNotNull'](_0x480954)){if(this[_0xeb7a('0x12')][_0x480954['uniqueid']]){var _0xee24e8=_[_0xeb7a('0x79')](this[_0xeb7a('0x12')][_0x480954[_0xeb7a('0x72')]]);_0xee24e8[_0xeb7a('0x7a')]=!![];_0xee24e8['queuecallerexitreason']=_0xeb7a('0x88');}}}catch(_0x45bed4){logger['error']('[syncAgentConnect][VoiceQueueReport]',util[_0xeb7a('0x4a')](_0x45bed4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x89')]=function(_0x43a455){try{if(this['isNotNull'](_0x43a455)){if(this['queueReports'][_0x43a455['uniqueid']]){var _0x5c7ce6=_['last'](this[_0xeb7a('0x12')][_0x43a455[_0xeb7a('0x72')]]);_0x5c7ce6[_0xeb7a('0x1e')]=![];_0x5c7ce6[_0xeb7a('0x7e')]=null;_0x5c7ce6[_0xeb7a('0x8a')]=!![];_0x5c7ce6[_0xeb7a('0x82')]=_0x43a455[_0xeb7a('0x8b')];_0x5c7ce6[_0xeb7a('0x7c')]=_0x43a455[_0xeb7a('0x7c')];_0x5c7ce6[_0xeb7a('0x7a')]=!![];_0x5c7ce6[_0xeb7a('0x8c')]=![];_0x5c7ce6[_0xeb7a('0x8d')]=null;if(!_0x5c7ce6[_0xeb7a('0x8e')]){if(_0x43a455[_0xeb7a('0x8f')]==_0xeb7a('0x8e')){_0x5c7ce6[_0xeb7a('0x80')]='COMPLETED';}else{if(_['startsWith'](_0x43a455[_0xeb7a('0x3e')]['toLowerCase'](),_0xeb7a('0x90'))){if(this['queueReports'][_0x43a455[_0xeb7a('0x91')]]){var _0x24d533=_['last'](this['queueReports'][_0x43a455[_0xeb7a('0x91')]]);_0x24d533[_0xeb7a('0x7a')]=![];_0x24d533[_0xeb7a('0x8c')]=!![];_0x24d533[_0xeb7a('0x8d')]=moment(_0x5c7ce6[_0xeb7a('0x92')])[_0xeb7a('0x93')](_0x43a455[_0xeb7a('0x7c')],_0xeb7a('0x94'))[_0xeb7a('0x4d')](_0xeb7a('0x7f'));_0x24d533[_0xeb7a('0x80')]=_0xeb7a('0x95');_0x24d533[_0xeb7a('0x8e')]=!![];_0x24d533[_0xeb7a('0x96')]='FORWARD';_0x24d533[_0xeb7a('0x97')]=_0x43a455[_0xeb7a('0x98')];_0x24d533[_0xeb7a('0x99')]=_0x43a455[_0xeb7a('0x72')];var _0x37f524=this['queueReports'][_0x43a455[_0xeb7a('0x91')]];this[_0xeb7a('0x12')][_0x43a455[_0xeb7a('0x91')]]=this[_0xeb7a('0x12')][_0x43a455['uniqueid']];this[_0xeb7a('0x12')][_0x43a455[_0xeb7a('0x72')]]=_0x37f524;}}else{_0x5c7ce6[_0xeb7a('0x80')]=_0xeb7a('0x9a')+_0x43a455[_0xeb7a('0x8f')]['toUpperCase']();}}}this[_0xeb7a('0x14')][_0x43a455[_0xeb7a('0x72')]]=_0x5c7ce6;this['emitVoiceQueueChannelRemove'](_0x5c7ce6);}}}catch(_0x276d90){logger[_0xeb7a('0x42')](_0xeb7a('0x9b'),util['inspect'](_0x276d90,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0xde5231){try{if(this[_0xeb7a('0x61')](_0xde5231)){this[_0xeb7a('0x9c')](_0xde5231[_0xeb7a('0x72')],_[_0xeb7a('0x76')](_0xde5231[_0xeb7a('0x9d')])[0x0],_0xde5231[_0xeb7a('0x9e')]);if(this[_0xeb7a('0x12')][_0xde5231[_0xeb7a('0x72')]]){var _0x8b51bb=_[_0xeb7a('0x79')](this[_0xeb7a('0x12')][_0xde5231['uniqueid']]);if(_0x8b51bb){if(this[_0xeb7a('0x61')](_0xde5231[_0xeb7a('0x9d')])&&this[_0xeb7a('0x61')](_0xde5231[_0xeb7a('0x9d')][_0xeb7a('0x9f')])){switch(_0xde5231[_0xeb7a('0x9e')]){case'CONTINUE':_0x8b51bb[_0xeb7a('0x8c')]=![];_0x8b51bb[_0xeb7a('0x8d')]=null;break;default:_0x8b51bb[_0xeb7a('0x8c')]=!![];_0x8b51bb[_0xeb7a('0x8d')]=moment()[_0xeb7a('0x4d')](_0xeb7a('0x7f'));_0x8b51bb['queuecallerleaveAt']=moment()[_0xeb7a('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');}_0x8b51bb[_0xeb7a('0x1e')]=![];_0x8b51bb[_0xeb7a('0x7e')]=null;_0x8b51bb[_0xeb7a('0x80')]=_0xde5231[_0xeb7a('0x9e')];this[_0xeb7a('0x14')][_0xde5231[_0xeb7a('0x72')]]=_0x8b51bb;this[_0xeb7a('0x49')](_0x8b51bb);}else if(this[_0xeb7a('0x61')](_0xde5231['variable'])&&this['isNotNull'](_0xde5231[_0xeb7a('0x9d')][_0xeb7a('0xa0')])){if(!_0x8b51bb[_0xeb7a('0x1e')]){_0x8b51bb[_0xeb7a('0x8c')]=!![];_0x8b51bb['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x8b51bb[_0xeb7a('0x80')]=_0xeb7a('0xa1');_0x8b51bb[_0xeb7a('0x84')]=moment()['format'](_0xeb7a('0x7f'));this[_0xeb7a('0x14')][_0xde5231[_0xeb7a('0x72')]]=_0x8b51bb;}}_0x8b51bb[_0xeb7a('0x45')]=this[_0xeb7a('0x45')][_0xde5231[_0xeb7a('0x72')]];}}}}catch(_0x3d5780){logger[_0xeb7a('0x42')](_0xeb7a('0xa2'),util[_0xeb7a('0x4a')](_0x3d5780,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x9c')]=function(_0x10ce44,_0x4561b6,_0xd46055){var _0x19f6c0=['rtpaudioqos',_0xeb7a('0xa3'),_0xeb7a('0xa4'),_0xeb7a('0xa5'),'rtpaudioqosloss',_0xeb7a('0xa6'),_0xeb7a('0xa7'),_0xeb7a('0xa8'),'sipcallid',_0xeb7a('0xa9'),_0xeb7a('0xaa'),_0xeb7a('0xab'),'membercalls',_0xeb7a('0xac'),_0xeb7a('0xad'),_0xeb7a('0xae'),_0xeb7a('0x8b'),_0xeb7a('0xaf'),'memberrealtime'];if(!_[_0xeb7a('0x3b')](_0x4561b6)&&!_[_0xeb7a('0xb0')](_0x19f6c0,_0x4561b6)){if(_['isUndefined'](this[_0xeb7a('0x45')][_0x10ce44])){this[_0xeb7a('0x45')][_0x10ce44]={};}this['variables'][_0x10ce44][_0x4561b6]=_0xd46055;}};VoiceQueueReport[_0xeb7a('0xd')][_0xeb7a('0x26')]=function(_0x386ed3){try{if(this[_0xeb7a('0x61')](_0x386ed3)){if(this[_0xeb7a('0x12')][_0x386ed3[_0xeb7a('0x72')]]){for(var _0x1675a5=0x0,_0xa278c4={};_0x1675a50x0?_0x24acac:0x0;this['voiceQueues'][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x2e')]=this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x2e')]>_['toNumber'](_0x24ccda[_0x78d9('0x65')])?_[_0x78d9('0x66')](_0x24ccda[_0x78d9('0x65')]):this['voiceQueues'][_0x24ccda[_0x78d9('0x63')]][_0x78d9('0x2e')];this[_0x78d9('0x4d')](this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]);}ami[_0x78d9('0x4a')](_0x78d9('0x68'),this[_0x78d9('0x12')][_0x24ccda[_0x78d9('0x63')]]);}}}catch(_0x2f13cb){logger[_0x78d9('0x3d')](_0x78d9('0x69'),util[_0x78d9('0x46')](_0x2f13cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x18')]=function(_0x57dc2e){this[_0x78d9('0x13')]=!![];};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x6a')]=function(_0x5edf43){};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1a')]=function(_0x51b785){try{if(this['isNotNull'](_0x51b785)){if(_['isUndefined'](this[_0x78d9('0x3f')][_0x51b785[_0x78d9('0x6b')]])){this[_0x78d9('0x3f')][_0x51b785[_0x78d9('0x6b')]]=[];this[_0x78d9('0x11')][_0x51b785[_0x78d9('0x6b')]]={};}var _0x10623d=new QueueReport();_0x10623d[_0x78d9('0x49')]=_0x51b785[_0x78d9('0x63')];_0x10623d['type']=this[_0x78d9('0x12')][_0x10623d['name']]&&this['voiceQueues'][_0x10623d['name']][_0x78d9('0x4e')]?this[_0x78d9('0x12')][_0x10623d['name']][_0x78d9('0x4e')]||'inbound':'inbound';_0x10623d['queue']=_0x51b785['queue'];_0x10623d[_0x78d9('0x6c')]=moment()[_0x78d9('0x4b')](_0x78d9('0x6d'));_0x10623d[_0x78d9('0x6e')]=_0x51b785[_0x78d9('0x6e')];_0x10623d[_0x78d9('0x6f')]=_0x51b785[_0x78d9('0x6f')];_[_0x78d9('0x70')](_0x10623d,_[_0x78d9('0x71')](_0x51b785,_[_0x78d9('0x72')](_0x10623d)));this[_0x78d9('0x3f')][_0x51b785[_0x78d9('0x6b')]][_0x78d9('0x73')](_0x10623d);this[_0x78d9('0x11')][_0x51b785[_0x78d9('0x6b')]]=_0x10623d;this[_0x78d9('0x47')](_0x10623d);}}catch(_0x3bdc44){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x78d9('0x46')](_0x3bdc44,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1c')]=function(_0x36d3aa){try{if(this[_0x78d9('0x5d')](_0x36d3aa)){if(this[_0x78d9('0x3f')][_0x36d3aa[_0x78d9('0x6b')]]){var _0x334f03=_[_0x78d9('0x74')](this[_0x78d9('0x3f')][_0x36d3aa[_0x78d9('0x6b')]]);_0x334f03[_0x78d9('0x75')]=![];_0x334f03[_0x78d9('0x76')]=null;_0x334f03[_0x78d9('0x77')]=_0x36d3aa[_0x78d9('0x77')];_0x334f03[_0x78d9('0x78')]=_0x36d3aa['originalposition'];_0x334f03[_0x78d9('0x1b')]=!![];_0x334f03[_0x78d9('0x79')]=moment()[_0x78d9('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x334f03[_0x78d9('0x7a')]=_0x78d9('0x7b');_0x334f03['lastAssignedTo']=null;this['channels'][_0x36d3aa['uniqueid']]=_0x334f03;this['emitVoiceQueueChannelRemove'](_0x334f03);}}}catch(_0xa71238){logger[_0x78d9('0x3d')](_0x78d9('0x7c'),util[_0x78d9('0x46')](_0xa71238,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1d')]=function(_0x1dd6ea){try{if(this[_0x78d9('0x5d')](_0x1dd6ea)){if(this[_0x78d9('0x3f')][_0x1dd6ea[_0x78d9('0x6b')]]){var _0x3ee789=_[_0x78d9('0x74')](this['queueReports'][_0x1dd6ea[_0x78d9('0x6b')]]);_0x3ee789[_0x78d9('0x7d')]=moment()[_0x78d9('0x4b')](_0x78d9('0x6d'));_0x3ee789['connectedlinenum']=_0x1dd6ea[_0x78d9('0x7e')];_0x3ee789[_0x78d9('0x7f')]=_0x1dd6ea['connectedlinename'];this[_0x78d9('0x11')][_0x1dd6ea['uniqueid']]=_0x3ee789;this[_0x78d9('0x47')](_0x3ee789);}}}catch(_0x15e649){logger['error']('[syncQueueCallerLeave][VoiceQueueReport]',util[_0x78d9('0x46')](_0x15e649,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x20')]=function(_0x15755e){try{if(this['isNotNull'](_0x15755e)){if(this['queueReports'][_0x15755e[_0x78d9('0x6b')]]){var _0x34a9ce=_[_0x78d9('0x74')](this['queueReports'][_0x15755e['uniqueid']]);_0x34a9ce[_0x78d9('0x75')]=!![];_0x34a9ce['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x2d419a){logger[_0x78d9('0x3d')](_0x78d9('0x80'),util[_0x78d9('0x46')](_0x2d419a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x1e')]=function(_0x3bc592){try{if(this['isNotNull'](_0x3bc592)){if(this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]]){var _0x16b16e=_[_0x78d9('0x74')](this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]]);_0x16b16e[_0x78d9('0x1b')]=![];_0x16b16e[_0x78d9('0x79')]=null;_0x16b16e[_0x78d9('0x81')]=!![];_0x16b16e[_0x78d9('0x82')]=_0x3bc592[_0x78d9('0x83')];_0x16b16e[_0x78d9('0x77')]=_0x3bc592['holdtime'];_0x16b16e[_0x78d9('0x75')]=!![];_0x16b16e[_0x78d9('0x84')]=![];_0x16b16e[_0x78d9('0x85')]=null;if(!_0x16b16e['transfer']){if(_0x3bc592[_0x78d9('0x86')]==_0x78d9('0x87')){_0x16b16e['queuecallerexitreason']='COMPLETED';}else{if(_[_0x78d9('0x88')](_0x3bc592[_0x78d9('0x39')][_0x78d9('0x89')](),_0x78d9('0x8a'))){if(this[_0x78d9('0x3f')][_0x3bc592['linkedid']]){var _0x3e500e=_['last'](this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x8b')]]);_0x3e500e[_0x78d9('0x75')]=![];_0x3e500e[_0x78d9('0x84')]=!![];_0x3e500e[_0x78d9('0x85')]=moment(_0x16b16e['queuecallerjoinAt'])[_0x78d9('0x8c')](_0x3bc592[_0x78d9('0x77')],_0x78d9('0x8d'))['format'](_0x78d9('0x6d'));_0x3e500e[_0x78d9('0x7a')]=_0x78d9('0x8e');_0x3e500e[_0x78d9('0x87')]=!![];_0x3e500e[_0x78d9('0x8f')]=_0x78d9('0x90');_0x3e500e[_0x78d9('0x91')]=_0x3bc592[_0x78d9('0x92')];_0x3e500e['transferuniqueid']=_0x3bc592['uniqueid'];var _0x43c8b3=this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x8b')]];this['queueReports'][_0x3bc592[_0x78d9('0x8b')]]=this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]];this[_0x78d9('0x3f')][_0x3bc592[_0x78d9('0x6b')]]=_0x43c8b3;}}else{_0x16b16e[_0x78d9('0x7a')]=_0x78d9('0x93')+_0x3bc592[_0x78d9('0x86')][_0x78d9('0x94')]();}}}this['channels'][_0x3bc592[_0x78d9('0x6b')]]=_0x16b16e;this[_0x78d9('0x45')](_0x16b16e);}}}catch(_0x4e9922){logger[_0x78d9('0x3d')](_0x78d9('0x95'),util[_0x78d9('0x46')](_0x4e9922,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')]['syncVarSet']=function(_0x508ae3){try{if(this[_0x78d9('0x5d')](_0x508ae3)){this[_0x78d9('0x96')](_0x508ae3[_0x78d9('0x6b')],_[_0x78d9('0x72')](_0x508ae3['variable'])[0x0],_0x508ae3['value']);if(this['queueReports'][_0x508ae3[_0x78d9('0x6b')]]){var _0x428d8f=_[_0x78d9('0x74')](this[_0x78d9('0x3f')][_0x508ae3[_0x78d9('0x6b')]]);if(_0x428d8f){if(this[_0x78d9('0x5d')](_0x508ae3[_0x78d9('0x97')])&&this[_0x78d9('0x5d')](_0x508ae3[_0x78d9('0x97')]['queuestatus'])){switch(_0x508ae3[_0x78d9('0x98')]){case _0x78d9('0x99'):_0x428d8f['queuecallerexit']=![];_0x428d8f[_0x78d9('0x85')]=null;break;default:_0x428d8f[_0x78d9('0x84')]=!![];_0x428d8f[_0x78d9('0x85')]=moment()[_0x78d9('0x4b')](_0x78d9('0x6d'));_0x428d8f[_0x78d9('0x7d')]=moment()['format'](_0x78d9('0x6d'));}_0x428d8f[_0x78d9('0x1b')]=![];_0x428d8f[_0x78d9('0x79')]=null;_0x428d8f['queuecallerexitreason']=_0x508ae3['value'];this['channels'][_0x508ae3[_0x78d9('0x6b')]]=_0x428d8f;this[_0x78d9('0x45')](_0x428d8f);}else if(this[_0x78d9('0x5d')](_0x508ae3[_0x78d9('0x97')])&&this['isNotNull'](_0x508ae3[_0x78d9('0x97')][_0x78d9('0x9a')])){if(!_0x428d8f[_0x78d9('0x1b')]){_0x428d8f[_0x78d9('0x84')]=!![];_0x428d8f[_0x78d9('0x85')]=moment()['format'](_0x78d9('0x6d'));_0x428d8f[_0x78d9('0x7a')]=_0x78d9('0x9b');_0x428d8f['queuecallerleaveAt']=moment()['format'](_0x78d9('0x6d'));this[_0x78d9('0x11')][_0x508ae3[_0x78d9('0x6b')]]=_0x428d8f;}}_0x428d8f[_0x78d9('0x41')]=this['variables'][_0x508ae3['uniqueid']];}}}}catch(_0x1c4b66){logger[_0x78d9('0x3d')](_0x78d9('0x9c'),util[_0x78d9('0x46')](_0x1c4b66,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x32')][_0x78d9('0x96')]=function(_0xa6406d,_0x29b61e,_0x3b158d){var _0x5e15ad=[_0x78d9('0x9d'),_0x78d9('0x9e'),_0x78d9('0x9f'),_0x78d9('0xa0'),_0x78d9('0xa1'),_0x78d9('0xa2'),_0x78d9('0xa3'),_0x78d9('0xa4'),'sipcallid',_0x78d9('0xa5'),_0x78d9('0xa6'),_0x78d9('0xa7'),_0x78d9('0xa8'),_0x78d9('0xa9'),'memberinterface',_0x78d9('0xaa'),_0x78d9('0x83'),'memberpenalty',_0x78d9('0xab')];if(!_[_0x78d9('0x36')](_0x29b61e)&&!_['includes'](_0x5e15ad,_0x29b61e)){if(_[_0x78d9('0x2b')](this['variables'][_0xa6406d])){this[_0x78d9('0x41')][_0xa6406d]={};}this[_0x78d9('0x41')][_0xa6406d][_0x29b61e]=_0x3b158d;}};VoiceQueueReport['prototype'][_0x78d9('0x22')]=function(_0x4a3945){try{if(this[_0x78d9('0x5d')](_0x4a3945)){if(this['queueReports'][_0x4a3945['uniqueid']]){for(var _0xbd0e4c=0x0,_0x60de4f={};_0xbd0e4c=0x0?moment(_0x1a93f9[_0xddb6('0x1c')])[_0xddb6('0xd')](_0x1a93f9[_0xddb6('0x1b')],'seconds'):null,'data1':'outbound','data2':_0x1a93f9[_0xddb6('0x15')],'data3':_0x1a93f9[_0xddb6('0x12')],'data4':_0x1a93f9[_0xddb6('0x1d')]||null,'role':_0xddb6('0x14'),'internal':_0x1a93f9[_0xddb6('0x15')]?_[_0xddb6('0x16')](_0x1a93f9[_0xddb6('0x15')]):undefined,'uniqueid':_0x1a93f9[_0xddb6('0x1e')]},'log':_0xddb6('0x17')});}; \ No newline at end of file +var _0x6d96=['starttime','endtime','diff','seconds','outbound','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','interface','format','SIP/%s','TALKING','queuecallerleaveAt','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername'];(function(_0x3aa460,_0x48053b){var _0x280f8a=function(_0x3d02c8){while(--_0x3d02c8){_0x3aa460['push'](_0x3aa460['shift']());}};_0x280f8a(++_0x48053b);}(_0x6d96,0x18c));var _0x66d9=function(_0x7d8bdc,_0x48cc6c){_0x7d8bdc=_0x7d8bdc-0x0;var _0x3c9c6a=_0x6d96[_0x7d8bdc];return _0x3c9c6a;};'use strict';var moment=require(_0x66d9('0x0'));var _=require(_0x66d9('0x1'));var util=require(_0x66d9('0x2'));var client=require(_0x66d9('0x3'));exports[_0x66d9('0x4')]=function(_0x3ee126){var _0x21f0fb=_0x3ee126[_0x66d9('0x5')]||_0x3ee126['queuecallerexitAt'];return client[_0x66d9('0x6')](_0x66d9('0x7'),{'body':{'channel':_0x66d9('0x8'),'membername':_0x3ee126[_0x66d9('0x9')],'interface':_['isNil'](_0x3ee126[_0x66d9('0xa')])?util[_0x66d9('0xb')](_0x66d9('0xc'),_0x3ee126[_0x66d9('0x9')]):_0x3ee126[_0x66d9('0xa')],'type':_0x66d9('0xd'),'enterAt':_0x3ee126[_0x66d9('0xe')],'exitAt':_0x21f0fb,'duration':moment(_0x21f0fb)['diff'](_0x3ee126[_0x66d9('0xe')],'seconds'),'data1':_0x66d9('0xf'),'data2':_0x3ee126[_0x66d9('0x10')],'data3':_0x3ee126[_0x66d9('0x11')],'data4':null,'data5':_0x3ee126['queue'],'role':_0x66d9('0x12'),'internal':_0x3ee126[_0x66d9('0x13')]?_[_0x66d9('0x14')](_0x3ee126[_0x66d9('0x13')]):undefined,'uniqueid':_0x3ee126[_0x66d9('0x15')]},'log':_0x66d9('0x7')});};exports[_0x66d9('0x16')]=function(_0x3c6e49){return client[_0x66d9('0x6')](_0x66d9('0x7'),{'body':{'channel':_0x66d9('0x8'),'membername':_0x3c6e49[_0x66d9('0x17')],'interface':_0x3c6e49[_0x66d9('0xa')],'type':_0x66d9('0xd'),'enterAt':_0x3c6e49[_0x66d9('0x18')],'exitAt':_0x3c6e49[_0x66d9('0x19')],'duration':moment(_0x3c6e49[_0x66d9('0x19')])[_0x66d9('0x1a')](_0x3c6e49[_0x66d9('0x18')],_0x66d9('0x1b'))>=0x0?moment(_0x3c6e49[_0x66d9('0x19')])[_0x66d9('0x1a')](_0x3c6e49[_0x66d9('0x18')],_0x66d9('0x1b')):null,'data1':_0x66d9('0x1c'),'data2':_0x3c6e49[_0x66d9('0x13')],'data3':_0x3c6e49[_0x66d9('0x11')],'data4':_0x3c6e49[_0x66d9('0x1d')]||null,'role':'agent','internal':_0x3c6e49[_0x66d9('0x13')]?_[_0x66d9('0x14')](_0x3c6e49[_0x66d9('0x13')]):undefined,'uniqueid':_0x3c6e49[_0x66d9('0x15')]},'log':_0x66d9('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index b7b5039..f5fe597 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 _0x9d82=['html','getTemplates','GetTemplate','name'];(function(_0x3a8df3,_0x31806f){var _0x197cf8=function(_0x4db821){while(--_0x4db821){_0x3a8df3['push'](_0x3a8df3['shift']());}};_0x197cf8(++_0x31806f);}(_0x9d82,0xb1));var _0x29d8=function(_0xa6eb95,_0x1f20cf){_0xa6eb95=_0xa6eb95-0x0;var _0x46866c=_0x9d82[_0xa6eb95];return _0x46866c;};'use strict';var client=require('../client');exports[_0x29d8('0x0')]=function(_0x40be93){return function(_0x76d72){return client['Request'](_0x29d8('0x1'),{'options':{'raw':!![],'attributes':['id',_0x29d8('0x2'),_0x29d8('0x3')]},'log':_0x29d8('0x1')});};}; \ No newline at end of file +var _0x3e52=['getTemplates','Request','GetTemplate','../client'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x3e52,0x1af));var _0x23e5=function(_0x55380f,_0x334be7){_0x55380f=_0x55380f-0x0;var _0x52839c=_0x3e52[_0x55380f];return _0x52839c;};'use strict';var client=require(_0x23e5('0x0'));exports[_0x23e5('0x1')]=function(_0x34e3bc){return function(_0x437fcc){return client[_0x23e5('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x23e5('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3118785..5b13958 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 _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x408704,_0x139393){var _0x3dfbc7=function(_0x43a6ff){while(--_0x43a6ff){_0x408704['push'](_0x408704['shift']());}};_0x3dfbc7(++_0x139393);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xa9e0=['data3','data4','data5','../client','getTriggers','GetTrigger','channel','status','Condition','AllConditions','field','value','AnyConditions','action','data1','data2'];(function(_0x247967,_0x583f62){var _0x148861=function(_0x21117d){while(--_0x21117d){_0x247967['push'](_0x247967['shift']());}};_0x148861(++_0x583f62);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(_0x29929c){return function(_0x5dd881){return client['Request'](_0x0a9e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),_0x0a9e('0x4')],'include':[{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x6'),'attributes':['id',_0x0a9e('0x7'),'operator',_0x0a9e('0x8')]},{'model':_0x0a9e('0x5'),'as':_0x0a9e('0x9'),'attributes':['id','field','operator',_0x0a9e('0x8')]},{'model':'Action','as':'Actions','attributes':['id',_0x0a9e('0xa'),_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),'data6','data7']}]},'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 7b33ff1..97feef8 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 _0xe207=['../client','getTrunks','GetTrunk'];(function(_0x482ff3,_0x543408){var _0x393ac3=function(_0x1d6a14){while(--_0x1d6a14){_0x482ff3['push'](_0x482ff3['shift']());}};_0x393ac3(++_0x543408);}(_0xe207,0xd5));var _0x7e20=function(_0x21d9d0,_0x46756f){_0x21d9d0=_0x21d9d0-0x0;var _0x4f80e2=_0xe207[_0x21d9d0];return _0x4f80e2;};'use strict';var client=require(_0x7e20('0x0'));exports[_0x7e20('0x1')]=function(_0x5e84e7){return function(_0xde0ae0){return client['Request'](_0x7e20('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name','registry']},'log':_0x7e20('0x2')});};}; \ No newline at end of file +var _0x87a4=['name','registry','getTrunks','Request','GetTrunk'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x87a4,0xc0));var _0x487a=function(_0x5289c3,_0x56714c){_0x5289c3=_0x5289c3-0x0;var _0x30f1a2=_0x87a4[_0x5289c3];return _0x30f1a2;};'use strict';var client=require('../client');exports[_0x487a('0x0')]=function(_0x40a4ad){return function(_0x11fed0){return client[_0x487a('0x1')](_0x487a('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x487a('0x3'),_0x487a('0x4')]},'log':_0x487a('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 32c8780..78cb039 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 _0xa0de=['getAgent','ShowUser','online','../client','Request','GetUser','agent','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','getAgents','getTelephones','telephone','name','internal','savePause','saveUnpause'];(function(_0x5640b8,_0x89fcb0){var _0x708431=function(_0x46db22){while(--_0x46db22){_0x5640b8['push'](_0x5640b8['shift']());}};_0x708431(++_0x89fcb0);}(_0xa0de,0x76));var _0xea0d=function(_0x1f42c5,_0x26d94f){_0x1f42c5=_0x1f42c5-0x0;var _0x161e3e=_0xa0de[_0x1f42c5];return _0x161e3e;};'use strict';var client=require(_0xea0d('0x0'));exports['getAgents']=function(){return function(){return client[_0xea0d('0x1')](_0xea0d('0x2'),{'options':{'raw':![],'where':{'role':_0xea0d('0x3')},'attributes':['id','name',_0xea0d('0x4'),_0xea0d('0x5'),_0xea0d('0x6'),'online',_0xea0d('0x7'),_0xea0d('0x8'),_0xea0d('0x9'),_0xea0d('0xa'),_0xea0d('0xb'),_0xea0d('0xc'),'interface']},'log':_0xea0d('0xd')});};};exports[_0xea0d('0xe')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0xea0d('0xf')},'attributes':['id',_0xea0d('0x10'),_0xea0d('0x5'),_0xea0d('0x11')]},'log':'getTelephones'});};};exports[_0xea0d('0x12')]=function(_0x49af19,_0x44da44,_0x38315b){return client['Request']('PauseUser',{'body':{'type':_0x44da44,'uniqueid':_0x38315b},'options':{'where':{'id':_0x49af19['id']}},'log':_0xea0d('0x12')});};exports[_0xea0d('0x13')]=function(_0xf1318c){return client[_0xea0d('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0xf1318c['id']}},'log':_0xea0d('0x12')});};exports[_0xea0d('0x14')]=function(_0x286d8c){return client['Request'](_0xea0d('0x15'),{'options':{'raw':![],'where':{'role':_0xea0d('0x3'),'id':_0x286d8c},'attributes':['id',_0xea0d('0x10'),_0xea0d('0x4'),'accountcode',_0xea0d('0x6'),_0xea0d('0x16'),_0xea0d('0x7'),_0xea0d('0x8'),'lastPauseAt',_0xea0d('0xa'),'interface']},'log':_0xea0d('0x14')});}; \ No newline at end of file +var _0xf155=['Request','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','accountcode','interface','../client','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','getAgents','getTelephones'];(function(_0x1e9424,_0x191cba){var _0x1bd96c=function(_0x5e952d){while(--_0x5e952d){_0x1e9424['push'](_0x1e9424['shift']());}};_0x1bd96c(++_0x191cba);}(_0xf155,0x169));var _0x5f15=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xf155[_0x4ff09b];return _0x3f5c2e;};'use strict';var client=require(_0x5f15('0x0'));exports['getAgents']=function(){return function(){return client['Request'](_0x5f15('0x1'),{'options':{'raw':![],'where':{'role':_0x5f15('0x2')},'attributes':['id',_0x5f15('0x3'),_0x5f15('0x4'),'accountcode',_0x5f15('0x5'),_0x5f15('0x6'),_0x5f15('0x7'),_0x5f15('0x8'),_0x5f15('0x9'),_0x5f15('0xa'),'phone','mobile','interface']},'log':_0x5f15('0xb')});};};exports[_0x5f15('0xc')]=function(){return function(){return client[_0x5f15('0xd')](_0x5f15('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name','accountcode',_0x5f15('0xe')]},'log':'getTelephones'});};};exports[_0x5f15('0xf')]=function(_0x38a04b,_0x5bbc64,_0x4a9915){return client['Request'](_0x5f15('0x10'),{'body':{'type':_0x5bbc64,'uniqueid':_0x4a9915},'options':{'where':{'id':_0x38a04b['id']}},'log':_0x5f15('0xf')});};exports[_0x5f15('0x11')]=function(_0x2c69b4){return client['Request'](_0x5f15('0x12'),{'body':{},'options':{'where':{'id':_0x2c69b4['id']}},'log':_0x5f15('0xf')});};exports[_0x5f15('0x13')]=function(_0x48ea96){return client['Request']('ShowUser',{'options':{'raw':![],'where':{'role':_0x5f15('0x2'),'id':_0x48ea96},'attributes':['id','name',_0x5f15('0x4'),_0x5f15('0x14'),_0x5f15('0x5'),_0x5f15('0x6'),_0x5f15('0x7'),'pauseType','lastPauseAt','voicePause',_0x5f15('0x15')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9f43a11..3821554 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 _0xdc6a=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x181792,_0x218dd9){var _0x2a7c08=function(_0x55be3f){while(--_0x55be3f){_0x181792['push'](_0x181792['shift']());}};_0x2a7c08(++_0x218dd9);}(_0xdc6a,0x9f));var _0xadc6=function(_0x3429d0,_0x267e26){_0x3429d0=_0x3429d0-0x0;var _0x3d1059=_0xdc6a[_0x3429d0];return _0x3d1059;};'use strict';var client=require(_0xadc6('0x0'));exports['create']=function(_0x3c7153){return client[_0xadc6('0x1')](_0xadc6('0x2'),{'body':_0x3c7153,'log':_0xadc6('0x2')});};exports['update']=function(_0x3bc0da,_0x3b3261,_0x429741){return client['Request'](_0xadc6('0x3'),{'body':_0x3bc0da,'options':{'where':{'uniqueid':_0x3b3261,'interface':_0x429741}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x7fef=['UpdateVoiceAgentReport','create','CreateVoiceAgentReport','update','Request'];(function(_0x10204c,_0x5da425){var _0x61345d=function(_0x2a8c56){while(--_0x2a8c56){_0x10204c['push'](_0x10204c['shift']());}};_0x61345d(++_0x5da425);}(_0x7fef,0x141));var _0xf7fe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7fef[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xf7fe('0x0')]=function(_0x2244ab){return client['Request'](_0xf7fe('0x1'),{'body':_0x2244ab,'log':'CreateVoiceAgentReport'});};exports[_0xf7fe('0x2')]=function(_0x52eb69,_0x5138db,_0x51d7f9){return client[_0xf7fe('0x3')](_0xf7fe('0x4'),{'body':_0x52eb69,'options':{'where':{'uniqueid':_0x5138db,'interface':_0x51d7f9}},'log':_0xf7fe('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index baf16cd..a0d9128 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 _0x65ec=['lodash','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION','getVoiceCallReports','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','disposition','duration','billableseconds','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x65ec,0x168));var _0xc65e=function(_0x5ed830,_0x1f97d2){_0x5ed830=_0x5ed830-0x0;var _0x128f04=_0x65ec[_0x5ed830];return _0x128f04;};'use strict';var moment=require(_0xc65e('0x0'));var util=require('util');var _=require(_0xc65e('0x1'));var client=require('../client');exports[_0xc65e('0x2')]=function(_0x4ac0e1){return client[_0xc65e('0x3')](_0xc65e('0x4'),{'body':_[_0xc65e('0x5')](_0x4ac0e1,{'source':_0x4ac0e1[_0xc65e('0x6')],'destinationcontext':_0x4ac0e1[_0xc65e('0x7')],'callerid':_0x4ac0e1['callerid'],'amaflags':_0xc65e('0x8')}),'log':_0xc65e('0x4')});};exports[_0xc65e('0x9')]=function(){return function(){return client[_0xc65e('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0xc65e('0xa')],'createdAt':{'$between':[moment()[_0xc65e('0xb')]('day')[_0xc65e('0xc')](_0xc65e('0xd')),moment()[_0xc65e('0xe')](_0xc65e('0xf'))[_0xc65e('0xc')](_0xc65e('0xd'))]}},'attributes':['type',_0xc65e('0x10'),_0xc65e('0x11'),_0xc65e('0x12')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x0823=['duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','day','type'];(function(_0x304aca,_0x4f8e0b){var _0x3b811c=function(_0x3f6c71){while(--_0x3f6c71){_0x304aca['push'](_0x304aca['shift']());}};_0x3b811c(++_0x4f8e0b);}(_0x0823,0x12f));var _0x3082=function(_0x4c4ca2,_0x30d812){_0x4c4ca2=_0x4c4ca2-0x0;var _0x17dac3=_0x0823[_0x4c4ca2];return _0x17dac3;};'use strict';var moment=require('moment');var util=require(_0x3082('0x0'));var _=require(_0x3082('0x1'));var client=require(_0x3082('0x2'));exports[_0x3082('0x3')]=function(_0x2be000){return client[_0x3082('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0x2be000,{'source':_0x2be000[_0x3082('0x5')],'destinationcontext':_0x2be000[_0x3082('0x6')],'callerid':_0x2be000[_0x3082('0x7')],'amaflags':_0x3082('0x8')}),'log':'CreateVoiceCallReport'});};exports[_0x3082('0x9')]=function(){return function(){return client[_0x3082('0x4')](_0x3082('0xa'),{'options':{'where':{'type':[_0x3082('0xb')],'createdAt':{'$between':[moment()[_0x3082('0xc')]('day')[_0x3082('0xd')](_0x3082('0xe')),moment()['endOf'](_0x3082('0xf'))[_0x3082('0xd')](_0x3082('0xe'))]}},'attributes':[_0x3082('0x10'),'disposition',_0x3082('0x11'),_0x3082('0x12')]},'log':_0x3082('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c27fd32..027e629 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 _0x5b16=['Request','CreateVoiceDialReport','create'];(function(_0x407aea,_0x40583a){var _0x13cbf3=function(_0x3b3858){while(--_0x3b3858){_0x407aea['push'](_0x407aea['shift']());}};_0x13cbf3(++_0x40583a);}(_0x5b16,0x1a6));var _0x65b1=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5b16[_0x3d42d8];return _0x27fc41;};'use strict';var client=require('../client');exports[_0x65b1('0x0')]=function(_0x541c9f){return client[_0x65b1('0x1')](_0x65b1('0x2'),{'body':_0x541c9f,'log':_0x65b1('0x2')});}; \ No newline at end of file +var _0x075b=['CreateVoiceDialReport','create','Request'];(function(_0xf8e8f0,_0xad0cd7){var _0x47956a=function(_0x341cfd){while(--_0x341cfd){_0xf8e8f0['push'](_0xf8e8f0['shift']());}};_0x47956a(++_0xad0cd7);}(_0x075b,0x142));var _0xb075=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x075b[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports[_0xb075('0x0')]=function(_0x4d6b53){return client[_0xb075('0x1')](_0xb075('0x2'),{'body':_0x4d6b53,'log':_0xb075('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 30784e4..2e5882d 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 _0xd620=['recordingFormat','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xd620,0x1e7));var _0x0d62=function(_0x274690,_0xa4b268){_0x274690=_0x274690-0x0;var _0x3b1537=_0xd620[_0x274690];return _0x3b1537;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x0d62('0x0')](_0x0d62('0x1'),{'options':{'raw':!![],'attributes':['id',_0x0d62('0x2'),_0x0d62('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x0d62('0x4')});};}; \ No newline at end of file +var _0xac12=['recordingFormat','getVoiceExtensions','../client','GetVoiceExtension','exten'];(function(_0x383ac6,_0x48711c){var _0x3cbabd=function(_0xa328a7){while(--_0xa328a7){_0x383ac6['push'](_0x383ac6['shift']());}};_0x3cbabd(++_0x48711c);}(_0xac12,0xc0));var _0x2ac1=function(_0x2519cb,_0x139ade){_0x2519cb=_0x2519cb-0x0;var _0x28aab8=_0xac12[_0x2519cb];return _0x28aab8;};'use strict';var client=require(_0x2ac1('0x0'));exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x2ac1('0x1'),{'options':{'raw':!![],'attributes':['id',_0x2ac1('0x2'),_0x2ac1('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x2ac1('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 71bda16..5742d7d 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 _0xb531=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence'];(function(_0x3cd574,_0x148bb0){var _0x1286bf=function(_0x27cbb0){while(--_0x27cbb0){_0x3cd574['push'](_0x3cd574['shift']());}};_0x1286bf(++_0x148bb0);}(_0xb531,0x1d3));var _0x1b53=function(_0x363044,_0x5d5c70){_0x363044=_0x363044-0x0;var _0xad109b=_0xb531[_0x363044];return _0xad109b;};'use strict';var client=require(_0x1b53('0x0'));exports[_0x1b53('0x1')]=function(){return function(){return client[_0x1b53('0x2')](_0x1b53('0x3'),{'options':{'raw':![],'attributes':['id',_0x1b53('0x4'),_0x1b53('0x5'),_0x1b53('0x6'),_0x1b53('0x7'),_0x1b53('0x8'),_0x1b53('0x9'),'dialActive',_0x1b53('0xa'),_0x1b53('0xb'),_0x1b53('0xc'),_0x1b53('0xd'),_0x1b53('0xe'),_0x1b53('0xf'),'dialPredictiveInterval',_0x1b53('0x10'),_0x1b53('0x11'),'dialOriginateTimeout',_0x1b53('0x12'),'dialQueueTimeout','dialQueueProject',_0x1b53('0x13'),_0x1b53('0x14'),'dialBusyMaxRetry',_0x1b53('0x15'),_0x1b53('0x16'),'dialNoAnswerRetryFrequency',_0x1b53('0x17'),'dialTimezone',_0x1b53('0x18'),_0x1b53('0x19'),'dialCheckDuplicateType',_0x1b53('0x1a'),_0x1b53('0x1b'),_0x1b53('0x1c'),_0x1b53('0x1d'),_0x1b53('0x1e'),_0x1b53('0x1f'),_0x1b53('0x20'),_0x1b53('0x21'),_0x1b53('0x22'),_0x1b53('0x23'),_0x1b53('0x24'),_0x1b53('0x25'),_0x1b53('0x26'),'dialOrderByScheduledAt',_0x1b53('0x27'),_0x1b53('0x28'),_0x1b53('0x29'),_0x1b53('0x8'),_0x1b53('0x2a'),_0x1b53('0x2b'),'dialCutDigit',_0x1b53('0x2c'),_0x1b53('0x2d'),_0x1b53('0x2e')],'include':[{'model':'Trunk','as':_0x1b53('0x2f'),'attributes':['id','name',_0x1b53('0x30'),_0x1b53('0x31')]},{'model':_0x1b53('0x32'),'as':_0x1b53('0x33'),'attributes':['id',_0x1b53('0x4')]},{'model':_0x1b53('0x2f'),'as':_0x1b53('0x34'),'attributes':['id',_0x1b53('0x4'),_0x1b53('0x30'),'active']},{'model':_0x1b53('0x35'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0x1b53('0x35'),'as':'Intervals','attributes':['id',_0x1b53('0x4'),_0x1b53('0x36')]}]}]},'log':_0x1b53('0x1')});};}; \ No newline at end of file +var _0x1849=['dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x1849,0x19e));var _0x9184=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x1849[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0x9184('0x0'));exports[_0x9184('0x1')]=function(){return function(){return client[_0x9184('0x2')](_0x9184('0x3'),{'options':{'raw':![],'attributes':['id',_0x9184('0x4'),_0x9184('0x5'),_0x9184('0x6'),_0x9184('0x7'),_0x9184('0x8'),_0x9184('0x9'),'dialActive',_0x9184('0xa'),_0x9184('0xb'),_0x9184('0xc'),'dialPowerLevel',_0x9184('0xd'),_0x9184('0xe'),'dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber',_0x9184('0xf'),_0x9184('0x10'),'dialQueueTimeout',_0x9184('0x11'),_0x9184('0x12'),_0x9184('0x13'),'dialBusyMaxRetry',_0x9184('0x14'),_0x9184('0x15'),_0x9184('0x16'),_0x9184('0x17'),_0x9184('0x18'),_0x9184('0x19'),'dialPrefix',_0x9184('0x1a'),_0x9184('0x1b'),'dialAMDInitialSilence',_0x9184('0x1c'),_0x9184('0x1d'),_0x9184('0x1e'),_0x9184('0x1f'),_0x9184('0x20'),'dialAMDMaximumNumberOfWords',_0x9184('0x21'),_0x9184('0x22'),_0x9184('0x23'),_0x9184('0x24'),_0x9184('0x25'),'dialOrderByScheduledAt',_0x9184('0x26'),'dialAgiAfterHangupClient',_0x9184('0x27'),_0x9184('0x8'),_0x9184('0x28'),_0x9184('0x29'),_0x9184('0x2a'),_0x9184('0x2b'),_0x9184('0x2c'),_0x9184('0x2d')],'include':[{'model':_0x9184('0x2e'),'as':_0x9184('0x2e'),'attributes':['id','name',_0x9184('0x2f'),_0x9184('0x30')]},{'model':'Pause','as':_0x9184('0x31'),'attributes':['id',_0x9184('0x4')]},{'model':_0x9184('0x2e'),'as':'TrunkBackup','attributes':['id',_0x9184('0x4'),_0x9184('0x2f'),_0x9184('0x30')]},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':_0x9184('0x32'),'as':_0x9184('0x33'),'attributes':['id',_0x9184('0x4'),_0x9184('0x34')]}]}]},'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 90fecd9..6f77d25 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 _0x3923=['moment','lodash','../client','create','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports'];(function(_0x42f0f6,_0x5eac43){var _0x308e9d=function(_0x767bb2){while(--_0x767bb2){_0x42f0f6['push'](_0x42f0f6['shift']());}};_0x308e9d(++_0x5eac43);}(_0x3923,0x1cc));var _0x3392=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3923[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0x3392('0x0'));var _=require(_0x3392('0x1'));var client=require(_0x3392('0x2'));exports[_0x3392('0x3')]=function(_0x34dfd5){return client['Request']('CreateVoiceQueueReport',{'body':_0x34dfd5,'log':_0x3392('0x4')});};exports[_0x3392('0x5')]=function(){return function(){return client['Request'](_0x3392('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x3392('0x7')](_0x3392('0x8'))[_0x3392('0x9')](_0x3392('0xa')),moment()[_0x3392('0xb')]('day')[_0x3392('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['uniqueid',_0x3392('0xc'),_0x3392('0xd'),_0x3392('0xe'),'queuecallercomplete',_0x3392('0xf'),_0x3392('0x10'),_0x3392('0x11'),_0x3392('0x12'),'queuecallerabandonAt']},'log':_0x3392('0x13')});};}; \ No newline at end of file +var _0x8453=['endOf','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5293c8,_0xab0c3c){var _0x3623fb=function(_0x23ef99){while(--_0x23ef99){_0x5293c8['push'](_0x5293c8['shift']());}};_0x3623fb(++_0xab0c3c);}(_0x8453,0xf2));var _0x3845=function(_0xcabb0a,_0x20707c){_0xcabb0a=_0xcabb0a-0x0;var _0x462917=_0x8453[_0xcabb0a];return _0x462917;};'use strict';var moment=require(_0x3845('0x0'));var _=require(_0x3845('0x1'));var client=require('../client');exports[_0x3845('0x2')]=function(_0x1a8ba3){return client[_0x3845('0x3')](_0x3845('0x4'),{'body':_0x1a8ba3,'log':_0x3845('0x4')});};exports[_0x3845('0x5')]=function(){return function(){return client[_0x3845('0x3')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0x3845('0x6')](_0x3845('0x7'))[_0x3845('0x8')](_0x3845('0x9')),moment()[_0x3845('0xa')](_0x3845('0x7'))['format'](_0x3845('0x9'))]}},'attributes':['uniqueid','queue','queuecallerjoinAt',_0x3845('0xb'),'queuecallercomplete',_0x3845('0xc'),_0x3845('0xd'),_0x3845('0xe'),_0x3845('0xf'),_0x3845('0x10')]},'log':_0x3845('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 756825a..960a12a 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 _0xa18d=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x331f7e,_0xa66d77){var _0x2c82b7=function(_0x5c35b2){while(--_0x5c35b2){_0x331f7e['push'](_0x331f7e['shift']());}};_0x2c82b7(++_0xa66d77);}(_0xa18d,0x94));var _0xda18=function(_0xa8fbb6,_0x850e07){_0xa8fbb6=_0xa8fbb6-0x0;var _0x28a107=_0xa18d[_0xa8fbb6];return _0x28a107;};'use strict';var client=require(_0xda18('0x0'));exports[_0xda18('0x1')]=function(_0x527cf6){return function(){return client[_0xda18('0x2')](_0xda18('0x3'),{'options':{'where':{'VoiceQueueId':_0x527cf6,'paused':!![]},'raw':!![]},'log':_0xda18('0x1')});};}; \ No newline at end of file +var _0x1552=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x3cc170,_0x152e82){var _0x5e1291=function(_0x22edeb){while(--_0x22edeb){_0x3cc170['push'](_0x3cc170['shift']());}};_0x5e1291(++_0x152e82);}(_0x1552,0x19b));var _0x2155=function(_0x3fb743,_0x2b6886){_0x3fb743=_0x3fb743-0x0;var _0x135901=_0x1552[_0x3fb743];return _0x135901;};'use strict';var client=require(_0x2155('0x0'));exports['getVoiceQueueRtPauses']=function(_0x4b8731){return function(){return client[_0x2155('0x1')](_0x2155('0x2'),{'options':{'where':{'VoiceQueueId':_0x4b8731,'paused':!![]},'raw':!![]},'log':_0x2155('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 655a67e..d937607 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 _0x33ba=['lodash','Request','CreateVoiceRecording','merge','monitorFilename'];(function(_0x323c9d,_0x21d520){var _0xddbcf8=function(_0x445dbc){while(--_0x445dbc){_0x323c9d['push'](_0x323c9d['shift']());}};_0xddbcf8(++_0x21d520);}(_0x33ba,0x78));var _0xa33b=function(_0x573829,_0xeb7bac){_0x573829=_0x573829-0x0;var _0x5097b9=_0x33ba[_0x573829];return _0x5097b9;};'use strict';var _=require(_0xa33b('0x0'));var client=require('../client');exports['create']=function(_0x147fa2){return client[_0xa33b('0x1')](_0xa33b('0x2'),{'body':_[_0xa33b('0x3')](_0x147fa2,{'value':_0x147fa2[_0xa33b('0x4')]}),'log':_0xa33b('0x2')});}; \ No newline at end of file +var _0x3c9c=['../client','CreateVoiceRecording','merge','monitorFilename'];(function(_0x4d7379,_0x4b4e63){var _0x46d7cf=function(_0x53f5f0){while(--_0x53f5f0){_0x4d7379['push'](_0x4d7379['shift']());}};_0x46d7cf(++_0x4b4e63);}(_0x3c9c,0x19c));var _0xc3c9=function(_0x465809,_0x599a35){_0x465809=_0x465809-0x0;var _0x1812fd=_0x3c9c[_0x465809];return _0x1812fd;};'use strict';var _=require('lodash');var client=require(_0xc3c9('0x0'));exports['create']=function(_0x32e802){return client['Request'](_0xc3c9('0x1'),{'body':_[_0xc3c9('0x2')](_0x32e802,{'value':_0x32e802[_0xc3c9('0x3')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 83dee2c..de0af33 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 _0x3b67=['transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','context','blind','CreateVoiceTransferReport','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','../client','Request','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereecalleridnum','transfereecalleridname'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x3b67,0x10d));var _0x73b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b67[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x73b6('0x0'));exports['blindTransfer']=function(_0x38af44){return client[_0x73b6('0x1')]('CreateVoiceTransferReport',{'body':{'result':_0x38af44['result'],'transfererchannel':_0x38af44[_0x73b6('0x2')],'transferercalleridnum':_0x38af44['transferercalleridnum'],'transferercalleridname':_0x38af44[_0x73b6('0x3')],'transfererconnectedlinenum':_0x38af44[_0x73b6('0x4')],'transfererconnectedlinename':_0x38af44[_0x73b6('0x5')],'transfereraccountcode':_0x38af44[_0x73b6('0x6')],'transferercontext':_0x38af44[_0x73b6('0x7')],'transfererexten':_0x38af44['transfererexten'],'transfererlinkedid':_0x38af44[_0x73b6('0x8')],'transfereechannel':_0x38af44['transfereechannel'],'transfereecalleridnum':_0x38af44[_0x73b6('0x9')],'transfereecalleridname':_0x38af44[_0x73b6('0xa')],'transfereeconnectedlinenum':_0x38af44[_0x73b6('0xb')],'transfereeconnectedlinename':_0x38af44[_0x73b6('0xc')],'transfereeaccountcode':_0x38af44[_0x73b6('0xd')],'transfereecontext':_0x38af44[_0x73b6('0xe')],'transfereeexten':_0x38af44['transfereeexten'],'transfereelinkedid':_0x38af44[_0x73b6('0xf')],'isexternal':_0x38af44['isexternal'],'context':_0x38af44[_0x73b6('0x10')],'extension':_0x38af44['extension'],'type':_0x73b6('0x11')},'log':_0x73b6('0x12')});};exports['attendedTransfer']=function(_0x36876a){return client[_0x73b6('0x1')](_0x73b6('0x12'),{'body':{'result':_0x36876a['result'],'transfererchannel':_0x36876a[_0x73b6('0x13')],'transferercalleridnum':_0x36876a[_0x73b6('0x14')],'transferercalleridname':_0x36876a['origtransferercalleridname'],'transfererconnectedlinenum':_0x36876a[_0x73b6('0x15')],'transfererconnectedlinename':_0x36876a['secondtransfererconnectedlinename'],'transfereraccountcode':_0x36876a[_0x73b6('0x16')],'transferercontext':_0x36876a[_0x73b6('0x17')],'transfererexten':_0x36876a[_0x73b6('0x18')],'transfererlinkedid':_0x36876a['origtransfererlinkedid'],'transfereechannel':_0x36876a[_0x73b6('0x19')],'transfereecalleridnum':_0x36876a[_0x73b6('0x1a')],'transfereecalleridname':_0x36876a[_0x73b6('0x1b')],'transfereeconnectedlinenum':_0x36876a[_0x73b6('0x1c')],'transfereeconnectedlinename':_0x36876a[_0x73b6('0x1d')],'transfereeaccountcode':_0x36876a['transfertargetaccountcode'],'transfereecontext':_0x36876a[_0x73b6('0x1e')],'transfereeexten':_0x36876a[_0x73b6('0x1f')],'transfereelinkedid':_0x36876a[_0x73b6('0x20')],'isexternal':_0x36876a[_0x73b6('0x21')],'context':_0x36876a[_0x73b6('0x22')],'extension':_0x36876a['origtransfererexten'],'type':'attended'},'log':_0x73b6('0x12')});}; \ No newline at end of file +var _0xbdbd=['origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xbdbd,0x11b));var _0xdbdb=function(_0x507fa0,_0x2c7822){_0x507fa0=_0x507fa0-0x0;var _0x454e3b=_0xbdbd[_0x507fa0];return _0x454e3b;};'use strict';var client=require(_0xdbdb('0x0'));exports[_0xdbdb('0x1')]=function(_0x45694d){return client[_0xdbdb('0x2')](_0xdbdb('0x3'),{'body':{'result':_0x45694d[_0xdbdb('0x4')],'transfererchannel':_0x45694d['transfererchannel'],'transferercalleridnum':_0x45694d['transferercalleridnum'],'transferercalleridname':_0x45694d[_0xdbdb('0x5')],'transfererconnectedlinenum':_0x45694d[_0xdbdb('0x6')],'transfererconnectedlinename':_0x45694d[_0xdbdb('0x7')],'transfereraccountcode':_0x45694d[_0xdbdb('0x8')],'transferercontext':_0x45694d[_0xdbdb('0x9')],'transfererexten':_0x45694d['transfererexten'],'transfererlinkedid':_0x45694d['transfererlinkedid'],'transfereechannel':_0x45694d[_0xdbdb('0xa')],'transfereecalleridnum':_0x45694d['transfereecalleridnum'],'transfereecalleridname':_0x45694d[_0xdbdb('0xb')],'transfereeconnectedlinenum':_0x45694d[_0xdbdb('0xc')],'transfereeconnectedlinename':_0x45694d[_0xdbdb('0xd')],'transfereeaccountcode':_0x45694d[_0xdbdb('0xe')],'transfereecontext':_0x45694d[_0xdbdb('0xf')],'transfereeexten':_0x45694d[_0xdbdb('0x10')],'transfereelinkedid':_0x45694d[_0xdbdb('0x11')],'isexternal':_0x45694d[_0xdbdb('0x12')],'context':_0x45694d['context'],'extension':_0x45694d[_0xdbdb('0x13')],'type':'blind'},'log':_0xdbdb('0x3')});};exports[_0xdbdb('0x14')]=function(_0x44932f){return client['Request'](_0xdbdb('0x3'),{'body':{'result':_0x44932f[_0xdbdb('0x4')],'transfererchannel':_0x44932f[_0xdbdb('0x15')],'transferercalleridnum':_0x44932f['origtransferercalleridnum'],'transferercalleridname':_0x44932f[_0xdbdb('0x16')],'transfererconnectedlinenum':_0x44932f[_0xdbdb('0x17')],'transfererconnectedlinename':_0x44932f[_0xdbdb('0x18')],'transfereraccountcode':_0x44932f[_0xdbdb('0x19')],'transferercontext':_0x44932f[_0xdbdb('0x1a')],'transfererexten':_0x44932f[_0xdbdb('0x1b')],'transfererlinkedid':_0x44932f[_0xdbdb('0x1c')],'transfereechannel':_0x44932f[_0xdbdb('0x1d')],'transfereecalleridnum':_0x44932f['transfertargetcalleridnum'],'transfereecalleridname':_0x44932f[_0xdbdb('0x1e')],'transfereeconnectedlinenum':_0x44932f[_0xdbdb('0x1f')],'transfereeconnectedlinename':_0x44932f[_0xdbdb('0x20')],'transfereeaccountcode':_0x44932f[_0xdbdb('0x21')],'transfereecontext':_0x44932f[_0xdbdb('0x22')],'transfereeexten':_0x44932f[_0xdbdb('0x23')],'transfereelinkedid':_0x44932f[_0xdbdb('0x24')],'isexternal':_0x44932f[_0xdbdb('0x12')],'context':_0x44932f[_0xdbdb('0x25')],'extension':_0x44932f[_0xdbdb('0x26')],'type':_0xdbdb('0x27')},'log':_0xdbdb('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index cd38f8e..8b35a59 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 _0x21dc=['updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','module','Reload','Action','catch','message','join','command','action','Command','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','voicechannel','find','format','filename','uniqueid','wav','channel','ai(mixmonitorid)','then','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','trunks','outboundChannels','campaigns','run','event','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','validate','moment','../properties','SIP','name','timers','timer','updateAcw','agents'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x21dc,0x18b));var _0xc21d=function(_0x26ec68,_0x37f301){_0x26ec68=_0x26ec68-0x0;var _0xbdedff=_0x21dc[_0x26ec68];return _0xbdedff;};'use strict';var _=require(_0xc21d('0x0'));var util=require('util');var jayson=require('jayson/promise');var schema=require(_0xc21d('0x1'));var BPromise=require('bluebird');var moment=require(_0xc21d('0x2'));var config=require('../../../config/environment');var properties=require(_0xc21d('0x3'));var ami=require('../ami');exports['listen']=function(_0x31bdf3,_0x5c7afc,_0x5a2133){return new BPromise(function(_0x5a5715,_0x36e851){var _0x2379d7={'QueuePause':function(_0x174274){return new Promise(function(_0x40b031,_0x2464a9){var _0x47f414=util['format']('%s/%s',_0xc21d('0x4'),_0x174274[_0xc21d('0x5')]);if(_0x31bdf3[_0xc21d('0x6')]&&_0x31bdf3[_0xc21d('0x6')][_0x47f414]&&_0x31bdf3[_0xc21d('0x6')][_0x47f414][_0xc21d('0x7')]){_0x31bdf3[_0xc21d('0x6')][_0x47f414][_0xc21d('0x8')]();}if(_0x31bdf3[_0xc21d('0x9')][_0x47f414]){_0x31bdf3['agents'][_0x47f414][_0xc21d('0xa')]({'statePause':_0x174274['pause']?!![]:![]});}_0x40b031({'code':0xc8,'message':_0xc21d('0xb')});});},'Reload':function(_0xefab3d){var _0x5c51ad=this;return new Promise(function(_0x15151c,_0x2bbf63){if(ami[_0xc21d('0xc')]()==![]){return _0x2bbf63(_0x5c51ad[_0xc21d('0xd')](0x1f4,[config[_0xc21d('0xe')]['ip'],config[_0xc21d('0xe')][_0xc21d('0xf')],_0xc21d('0x10')]['join']('\x20')));}_0xefab3d=_[_0xc21d('0x11')](_0xefab3d,_[_0xc21d('0x12')](properties[_0xc21d('0x13')]));_0xefab3d['action']=_0xc21d('0x14');return ami[_0xc21d('0x15')](_0xefab3d)['then'](function(_0x32a02c){_0x15151c({'code':0xc8,'message':_0x32a02c['message']});})[_0xc21d('0x16')](function(_0x1e007c){_0x2bbf63(_0x5c51ad['error'](0x1f5,_0x1e007c[_0xc21d('0x17')]));});});},'Command':function(_0x241332){var _0x361946=this;return new Promise(function(_0x5039d8,_0x5b1d1a){if(ami[_0xc21d('0xc')]()==![]){return _0x5b1d1a(_0x361946[_0xc21d('0xd')](0x1f4,[config['asterisk']['ip'],config[_0xc21d('0xe')][_0xc21d('0xf')],_0xc21d('0x10')][_0xc21d('0x18')]('\x20')));}_0x241332=_[_0xc21d('0x11')](_0x241332,_0xc21d('0x19'));_0x241332[_0xc21d('0x1a')]=_0xc21d('0x1b');return ami[_0xc21d('0x15')](_0x241332)['then'](function(_0x3fcb9b){_0x5039d8({'code':0xc8,'message':_0x3fcb9b['content']});})[_0xc21d('0x16')](function(_0x38a45a){_0x5b1d1a(_0x361946['error'](0x1f5,_0x38a45a[_0xc21d('0x17')]));});});},'VoiceQueues':function(_0xbdffda){return new Promise(function(_0x55c00b,_0x254c04){var _0x3aee4c=[];for(var _0x22915d in _0x31bdf3['voiceQueues']){if(_0x31bdf3[_0xc21d('0x1c')][_0xc21d('0x1d')](_0x22915d)){var _0x52521a=_0x31bdf3[_0xc21d('0x1c')][_0x22915d];var _0x457892={'id':_0x52521a['id'],'name':_0x52521a[_0xc21d('0x5')],'strategy':_0x52521a[_0xc21d('0x1e')],'answered':_0x52521a['answered'],'available':_0x52521a[_0xc21d('0x1f')],'loggedIn':_0x52521a[_0xc21d('0x20')],'pTalking':_0x52521a[_0xc21d('0x21')],'sumBillable':_0x52521a['sumBillable'],'sumDuration':_0x52521a[_0xc21d('0x22')],'sumHoldTime':_0x52521a[_0xc21d('0x23')]||0x0,'talking':_0x52521a[_0xc21d('0x24')],'total':_0x52521a[_0xc21d('0x25')],'type':_0x52521a[_0xc21d('0x26')],'unmanaged':_0x52521a[_0xc21d('0x27')],'abandoned':_0x52521a['abandoned'],'waiting':_0x52521a[_0xc21d('0x28')],'loggedInDb':_0x52521a[_0xc21d('0x29')]};if(_0x52521a[_0xc21d('0x26')]===_0xc21d('0x2a')){_0x457892[_0xc21d('0x2b')]=_0x52521a[_0xc21d('0x2b')];_0x457892[_0xc21d('0x2c')]=_0x52521a['dialMethod'];_0x457892['dialOriginateCallerIdName']=_0x52521a[_0xc21d('0x2d')];_0x457892[_0xc21d('0x2e')]=_0x52521a[_0xc21d('0x2e')];_0x457892[_0xc21d('0x2f')]=_0x52521a[_0xc21d('0x2f')];_0x457892['dialPrefix']=_0x52521a[_0xc21d('0x30')];_0x457892['outboundAnswerAgiCallsDay']=_0x52521a[_0xc21d('0x31')];_0x457892['outboundAnswerCallsDay']=_0x52521a[_0xc21d('0x32')];_0x457892[_0xc21d('0x33')]=_0x52521a[_0xc21d('0x33')];_0x457892['outboundBusyCallsDay']=_0x52521a[_0xc21d('0x34')];_0x457892['outboundCongestionCallsDay']=_0x52521a[_0xc21d('0x35')];_0x457892['outboundDropCallsDayACS']=_0x52521a['outboundDropCallsDayACS'];_0x457892[_0xc21d('0x36')]=_0x52521a['outboundDropCallsDayCallersExit'];_0x457892[_0xc21d('0x37')]=_0x52521a['outboundDropCallsDayTimeout'];_0x457892[_0xc21d('0x38')]=_0x52521a[_0xc21d('0x38')];_0x457892['outboundNoSuchCallsDay']=_0x52521a[_0xc21d('0x39')];_0x457892[_0xc21d('0x3a')]=_0x52521a[_0xc21d('0x3a')];_0x457892[_0xc21d('0x3b')]=_0x52521a['outboundReCallsDay'];_0x457892['outboundRejectCallsDay']=_0x52521a[_0xc21d('0x3c')];_0x457892['outboundUnknownCallsDay']=_0x52521a[_0xc21d('0x3d')];_0x457892[_0xc21d('0x3e')]=_0x52521a[_0xc21d('0x3e')];_0x457892['predictiveIntervalAvgHoldtime']=_0x52521a[_0xc21d('0x3f')];_0x457892['predictiveIntervalAvgTalktime']=_0x52521a[_0xc21d('0x40')];_0x457892[_0xc21d('0x41')]=_0x52521a['predictiveIntervalDroppedCallsCallersExit'];_0x457892[_0xc21d('0x42')]=_0x52521a[_0xc21d('0x42')];_0x457892[_0xc21d('0x43')]=_0x52521a[_0xc21d('0x43')];_0x457892['predictiveIntervalErlangCallsDroppedCalls']=_0x52521a[_0xc21d('0x44')];_0x457892[_0xc21d('0x45')]=_0x52521a[_0xc21d('0x45')];_0x457892[_0xc21d('0x46')]=_0x52521a['predictiveIntervalMultiplicativeFactor'];_0x457892[_0xc21d('0x47')]=_0x52521a['predictiveIntervalPauses'];_0x457892['predictiveIntervalAvailable']=_0x52521a[_0xc21d('0x48')];_0x457892[_0xc21d('0x49')]=_0x52521a[_0xc21d('0x49')];_0x457892[_0xc21d('0x17')]=_0x52521a[_0xc21d('0x17')];_0x457892[_0xc21d('0x4a')]=_0x52521a[_0xc21d('0x4a')];_0x457892[_0xc21d('0x4b')]=_0x52521a[_0xc21d('0x4b')];_0x457892[_0xc21d('0x4c')]=_0x52521a['erlangCallToSecond'];_0x457892[_0xc21d('0x4d')]=_0x52521a[_0xc21d('0x4d')];_0x457892['erlangBusyFactor']=_0x52521a['erlangBusyFactor'];_0x457892[_0xc21d('0x4e')]=_0x52521a[_0xc21d('0x4e')];_0x457892[_0xc21d('0x4f')]=_0x52521a[_0xc21d('0x4f')];}if(_0x52521a['Trunk']){_0x457892[_0xc21d('0x50')]={'id':_0x52521a[_0xc21d('0x50')]['id'],'name':_0x52521a['Trunk']['name'],'active':_0x52521a['Trunk'][_0xc21d('0x51')],'callerid':_0x52521a[_0xc21d('0x50')][_0xc21d('0x52')]};}if(_0x52521a[_0xc21d('0x53')]){_0x457892[_0xc21d('0x53')]={'id':_0x52521a[_0xc21d('0x53')]['id'],'name':_0x52521a[_0xc21d('0x53')][_0xc21d('0x5')]};}_0x3aee4c[_0xc21d('0x54')](_0x457892);}}_0x55c00b({'count':_0x3aee4c[_0xc21d('0x55')],'rows':_0x3aee4c});});},'VoiceChannels':function(_0x4bcdb4){return new Promise(function(_0x454354,_0x3f08b4){var _0x26b421=_[_0xc21d('0x56')](_0x31bdf3[_0xc21d('0x57')]);_0x454354({'count':_0x26b421[_0xc21d('0x55')],'rows':_0x26b421});});},'VoiceChannelMixMonitor':function(_0x2ac807){var _0x13cc61=this;return new Promise(function(_0x5a3988,_0x50863d){if(ami[_0xc21d('0xc')]()==![]){return _0x50863d(_0x13cc61[_0xc21d('0xd')](0x1f4,[config[_0xc21d('0xe')]['ip'],config[_0xc21d('0xe')]['username'],_0xc21d('0x10')][_0xc21d('0x18')]('\x20')));}var _0x3daab9=schema(properties[_0xc21d('0x58')])[_0xc21d('0x1')](_0x2ac807);if(_0x3daab9[_0xc21d('0x55')]>0x0){return _0x50863d(_0x13cc61[_0xc21d('0xd')](0x1f4,_['map'](_0x3daab9,_0xc21d('0x17'))[_0xc21d('0x18')](',\x20')));}var _0xf43033=_[_0xc21d('0x59')](_0x31bdf3['channels'],{'uniqueid':_0x2ac807['uniqueid']});if(_0xf43033&&_0xf43033['channel']){var _0x356bdd=util[_0xc21d('0x5a')]('%s.%s',_0x2ac807[_0xc21d('0x5b')]||_0x2ac807[_0xc21d('0x5c')],_0x2ac807[_0xc21d('0x5a')]||_0xc21d('0x5d'));return ami['Action']({'action':'MixMonitor','channel':_0xf43033[_0xc21d('0x5e')],'file':_0x356bdd,'options':_0xc21d('0x5f')})[_0xc21d('0x60')](function(_0x513df9){var _0x147d8c=_[_0xc21d('0x59')](_0xf43033[_0xc21d('0x61')],{'filename':_0xc21d('0x62')+_0x356bdd[_0xc21d('0x63')]()});if(_[_0xc21d('0x64')](_0x147d8c)){_0xf43033[_0xc21d('0x61')][_0xc21d('0x54')]({'filename':_0xc21d('0x62')+_0x356bdd[_0xc21d('0x63')](),'createdAt':moment()['format'](_0xc21d('0x65')),'mixmonitorid':_0x513df9[_0xc21d('0x66')],'status':_0xc21d('0x67')});}else{_0x147d8c['mixmonitorid']=_0x513df9[_0xc21d('0x66')];_0x147d8c[_0xc21d('0x68')]=_0xc21d('0x67');}_0x5a3988({'code':0xc8,'message':[_0x2ac807[_0xc21d('0x5c')],_0xc21d('0x69'),_0x513df9[_0xc21d('0x66')]][_0xc21d('0x18')]('\x20'),'mixmonitorid':_0x513df9['mixmonitorid']});})[_0xc21d('0x16')](function(_0x1447e3){_0x50863d(_0x13cc61[_0xc21d('0xd')](0x1f5,[_0x2ac807['uniqueid'],_0x1447e3[_0xc21d('0x17')][_0xc21d('0x63')]()][_0xc21d('0x18')]('\x20')));});}else{return _0x50863d(_0x13cc61[_0xc21d('0xd')](0x1f5,_0xc21d('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x2596ae){var _0x471b4d=this;return new Promise(function(_0x4d5d1e,_0xa3ee2f){if(ami[_0xc21d('0xc')]()==![]){return _0xa3ee2f(_0x471b4d['error'](0x1f4,[config[_0xc21d('0xe')]['ip'],config[_0xc21d('0xe')][_0xc21d('0xf')],_0xc21d('0x10')][_0xc21d('0x18')]('\x20')));}var _0x13db3a=schema(properties['voicechannel'])['validate'](_0x2596ae);if(_0x13db3a[_0xc21d('0x55')]>0x0){return _0xa3ee2f(_0x471b4d[_0xc21d('0xd')](0x1f4,_[_0xc21d('0x6b')](_0x13db3a,_0xc21d('0x17'))[_0xc21d('0x18')](',\x20')));}var _0x399e12=_[_0xc21d('0x59')](_0x31bdf3[_0xc21d('0x57')],{'uniqueid':_0x2596ae['uniqueid']});if(_0x399e12){return BPromise[_0xc21d('0x6c')]()[_0xc21d('0x60')](function(){if(_0x399e12['channel']){return ami['Action']({'action':_0xc21d('0x6d'),'channel':_0x399e12[_0xc21d('0x5e')],'mixmonitorid':_0x2596ae['mixmonitorid']})[_0xc21d('0x16')](function(_0x2dbd6b){});}})[_0xc21d('0x60')](function(){if(_0x399e12[_0xc21d('0x6e')]){return ami[_0xc21d('0x15')]({'action':_0xc21d('0x6d'),'channel':_0x399e12[_0xc21d('0x6e')],'mixmonitorid':_0x2596ae[_0xc21d('0x66')]})[_0xc21d('0x16')](function(_0x16a842){});}})[_0xc21d('0x60')](function(_0x130cd0){var _0x13b427=_[_0xc21d('0x59')](_0x399e12[_0xc21d('0x61')],{'mixmonitorid':_0x2596ae['mixmonitorid']});if(_0x13b427){_0x13b427[_0xc21d('0x68')]=_0xc21d('0x6f');}})[_0xc21d('0x60')](function(){var _0x97d3f2=util[_0xc21d('0x5a')](_0xc21d('0x70'),_0x2596ae[_0xc21d('0x5b')]||_0x2596ae[_0xc21d('0x5c')],_0x2596ae['format']||_0xc21d('0x5d'));var _0x170063=_['find'](_0x399e12[_0xc21d('0x61')],{'filename':'/var/spool/asterisk/monitor/'+_0x97d3f2[_0xc21d('0x63')]()});if(_0x170063){_0x170063[_0xc21d('0x68')]=_0xc21d('0x6f');}})[_0xc21d('0x60')](function(){_0x4d5d1e({'code':0xc8,'message':[_0x2596ae[_0xc21d('0x5c')],'StopMixMonitor\x20Success'][_0xc21d('0x18')]('\x20')});})[_0xc21d('0x16')](function(_0x3623ba){_0xa3ee2f(_0x471b4d[_0xc21d('0xd')](0x1f5,[_0x2596ae[_0xc21d('0x5c')],_0x3623ba['message'][_0xc21d('0x63')]()][_0xc21d('0x18')]('\x20')));});}else{return _0xa3ee2f(_0x471b4d['error'](0x1f5,_0xc21d('0x6a')));}});},'VoiceQueuesChannels':function(_0x9ae4c6){return new Promise(function(_0x35eed2,_0x2088f2){var _0x49e9be=_['values'](_0x31bdf3[_0xc21d('0x71')]);_0x35eed2({'count':_0x49e9be['length'],'rows':_0x49e9be});});},'VoiceQueuesChannel':function(_0x3cf71d){var _0x395209=this;return new Promise(function(_0x3c9137,_0x129f86){var _0x32912b=schema(properties[_0xc21d('0x72')])[_0xc21d('0x1')](_0x3cf71d);if(_0x32912b[_0xc21d('0x55')]>0x0){return _0x129f86(_0x395209[_0xc21d('0xd')](0x1f4,_[_0xc21d('0x6b')](_0x32912b,_0xc21d('0x17'))['join'](',\x20')));}var _0x5d721a=_[_0xc21d('0x59')](_0x31bdf3[_0xc21d('0x71')],{'uniqueid':_0x3cf71d[_0xc21d('0x5c')]});if(_0x5d721a){_0x3c9137(_0x5d721a);}else{return _0x129f86(_0x395209['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x13547d){var _0x4502de=this;return new Promise(function(_0x29e30d,_0x3c064){if(ami['isConnected']()==![]){return _0x3c064(_0x4502de['error'](0x1f4,[config[_0xc21d('0xe')]['ip'],config[_0xc21d('0xe')][_0xc21d('0xf')],_0xc21d('0x10')]['join']('\x20')));}var _0x3821da=schema(properties[_0xc21d('0x73')])[_0xc21d('0x1')](_0x13547d);if(_0x3821da['length']>0x0){return _0x3c064(_0x4502de[_0xc21d('0xd')](0x1f4,_['map'](_0x3821da,'message')[_0xc21d('0x18')](',\x20')));}var _0x115e8b=_[_0xc21d('0x59')](_0x31bdf3[_0xc21d('0x71')],{'uniqueid':_0x13547d[_0xc21d('0x5c')]});if(_0x115e8b&&_0x115e8b[_0xc21d('0x5e')]){return ami[_0xc21d('0x15')]({'action':_0xc21d('0x74'),'channel':_0x115e8b[_0xc21d('0x5e')]})[_0xc21d('0x60')](function(_0x5b4f67){_0x29e30d({'code':0xc8,'message':[_0x13547d[_0xc21d('0x5c')],_0x5b4f67['message'][_0xc21d('0x63')]()][_0xc21d('0x18')]('\x20')});})[_0xc21d('0x16')](function(_0x5062ea){_0x3c064(_0x4502de[_0xc21d('0xd')](0x1f5,[_0x13547d[_0xc21d('0x5c')],_0x5062ea[_0xc21d('0x17')]['toLowerCase']()][_0xc21d('0x18')]('\x20')));});}else{return _0x3c064(_0x4502de[_0xc21d('0xd')](0x1f5,_0xc21d('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x53d8f3){var _0x3cc8db=this;return new Promise(function(_0x2978d7,_0x141fd0){if(ami[_0xc21d('0xc')]()==![]){return _0x141fd0(_0x3cc8db[_0xc21d('0xd')](0x1f4,[config[_0xc21d('0xe')]['ip'],config[_0xc21d('0xe')]['username'],_0xc21d('0x10')][_0xc21d('0x18')]('\x20')));}var _0x262212=schema(properties[_0xc21d('0x75')])[_0xc21d('0x1')](_0x53d8f3);if(_0x262212['length']>0x0){return _0x141fd0(_0x3cc8db[_0xc21d('0xd')](0x1f4,_[_0xc21d('0x6b')](_0x262212,_0xc21d('0x17'))[_0xc21d('0x18')](',\x20')));}var _0x415a52=_[_0xc21d('0x59')](_0x31bdf3[_0xc21d('0x71')],{'uniqueid':_0x53d8f3['uniqueid']});if(_0x415a52&&_0x415a52[_0xc21d('0x5e')]){return ami['Action']({'action':'Redirect','channel':_0x415a52[_0xc21d('0x5e')],'exten':_0x53d8f3[_0xc21d('0x76')],'context':_0x53d8f3['context']||_0x415a52[_0xc21d('0x77')],'priority':0x1})[_0xc21d('0x60')](function(_0x729096){_0x2978d7({'code':0xc8,'message':[_0x53d8f3[_0xc21d('0x5c')],_0x729096[_0xc21d('0x17')]['toLowerCase']()][_0xc21d('0x18')]('\x20')});})['catch'](function(_0x2e822e){_0x141fd0(_0x3cc8db[_0xc21d('0xd')](0x1f5,[_0x53d8f3[_0xc21d('0x5c')],_0x2e822e['message'][_0xc21d('0x63')]()][_0xc21d('0x18')]('\x20')));});}else{return _0x141fd0(_0x3cc8db[_0xc21d('0xd')](0x1f5,_0xc21d('0x6a')));}});},'Agents':function(_0xb626ab){return new Promise(function(_0x491ae8,_0x58f11a){var _0x3e51a2=_['values'](_0x31bdf3[_0xc21d('0x9')]);_0x491ae8({'count':_0x3e51a2[_0xc21d('0x55')],'rows':_0x3e51a2});});},'Telephones':function(_0x3d9a9e){return new Promise(function(_0x40f723,_0x3b8590){var _0x2df2ba=_[_0xc21d('0x56')](_0x31bdf3['telephones']);_0x40f723({'count':_0x2df2ba[_0xc21d('0x55')],'rows':_0x2df2ba});});},'Trunks':function(_0x2e95d0){return new Promise(function(_0x179895,_0x1aca3a){var _0x217783=_[_0xc21d('0x56')](_0x31bdf3[_0xc21d('0x78')]);_0x179895({'count':_0x217783[_0xc21d('0x55')],'rows':_0x217783});});},'OutboundChannels':function(_0x2a433f){return new Promise(function(_0x4569dd,_0x2fe18f){var _0x271fab=_[_0xc21d('0x56')](_0x31bdf3[_0xc21d('0x79')]);_0x4569dd({'count':_0x271fab[_0xc21d('0x55')],'rows':_0x271fab});});},'Outbound':function(_0x28213a){return new Promise(function(_0x4edd4a,_0x2102c3){_0x4edd4a(_0x31bdf3[_0xc21d('0x2a')]);});},'Campaigns':function(_0x12a47f){return new Promise(function(_0x8e6caf,_0x37ed35){var _0x26eac4=_[_0xc21d('0x56')](_0x31bdf3[_0xc21d('0x7a')]);_0x8e6caf({'count':_0x26eac4[_0xc21d('0x55')],'rows':_0x26eac4});});},'VoiceQueuesPreview':function(_0x4ec04a){var _0x2cbabf=this;return new Promise(function(_0x30c42e,_0x46996b){_0x5c7afc[_0xc21d('0x7b')](_0x4ec04a['id'])[_0xc21d('0x60')](function(_0x5e2e5c){_0x30c42e({'code':0xc8,'message':_0x5e2e5c['message']});})[_0xc21d('0x16')](function(_0x160572){_0x46996b(_0x2cbabf[_0xc21d('0xd')](0x1f4,_0x160572['message']));});});},'EventManager':function(_0x5844c0){var _0x1ba982=this;return new Promise(function(_0x125725,_0x4dc2c3){if(!_0x5844c0[_0xc21d('0x7c')]){return _0x4dc2c3(_0x1ba982[_0xc21d('0xd')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0xc21d('0x7d')+_0x5844c0[_0xc21d('0x7c')],_0x5844c0[_0xc21d('0x17')]);_0x125725({'code':0xc8,'message':_0x5844c0});});},'FaxAccounts':function(_0x3059bf){return new Promise(function(_0x48301e,_0x498770){var _0x3e35e4=_['values'](_0x31bdf3[_0xc21d('0x7e')]);_0x48301e({'count':_0x3e35e4[_0xc21d('0x55')],'rows':_0x3e35e4});});},'SendFax':function(_0x28fe8a){var _0x481f3b=this;return new Promise(function(_0x86895c,_0x1513a4){_0x5a2133[_0xc21d('0x7f')](_0x28fe8a)[_0xc21d('0x60')](function(_0xf3bf40){_0x86895c({'code':0xc8,'message':_0xf3bf40[_0xc21d('0x17')]});})[_0xc21d('0x16')](function(_0x2d5316){_0x1513a4(_0x481f3b['error'](0x1f4,_0x2d5316[_0xc21d('0x17')]));});});},'CheckAfterSend':function(_0x594d94){var _0x3d3d4c=this;return new Promise(function(_0x48abcc,_0x98341e){_0x5a2133[_0xc21d('0x80')](_0x594d94)[_0xc21d('0x60')](function(_0x9956c8){_0x48abcc({'code':0xc8,'message':_0x9956c8[_0xc21d('0x17')]});})['catch'](function(_0x2e3e47){_0x98341e(_0x3d3d4c[_0xc21d('0xd')](0x1f4,_0x2e3e47[_0xc21d('0x17')]));});});}};var _0x597892=jayson[_0xc21d('0x81')](_0x2379d7)[_0xc21d('0x82')]();_0x597892['on'](_0xc21d('0xd'),function(_0x39c0f8){return _0x36e851(_0x39c0f8);});_0x597892[_0xc21d('0x83')](0x232a,_0xc21d('0x84'),function(){console[_0xc21d('0x85')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x5a5715(_0xc21d('0x86')+0x232a);});});}; \ No newline at end of file +var _0x4460=['push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','queueChannels','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','validate','bluebird','../properties','listen','format','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','catch','username','content','voiceQueues','hasOwnProperty','strategy','answered','pTalking','sumDuration','type','abandoned','waiting','loggedInDb','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','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','callerid','Interval','length','values','find','channels','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','isNil','monitors'];(function(_0x103f5d,_0xb26b06){var _0x4900eb=function(_0x118376){while(--_0x118376){_0x103f5d['push'](_0x103f5d['shift']());}};_0x4900eb(++_0xb26b06);}(_0x4460,0x123));var _0x0446=function(_0x429b61,_0x4089f9){_0x429b61=_0x429b61-0x0;var _0x3a70c9=_0x4460[_0x429b61];return _0x3a70c9;};'use strict';var _=require(_0x0446('0x0'));var util=require(_0x0446('0x1'));var jayson=require('jayson/promise');var schema=require(_0x0446('0x2'));var BPromise=require(_0x0446('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x0446('0x4'));var ami=require('../ami');exports[_0x0446('0x5')]=function(_0x43990f,_0x457c07,_0x3f6160){return new BPromise(function(_0x12c793,_0x465363){var _0x1e62cb={'QueuePause':function(_0x982169){return new Promise(function(_0x56bada,_0x580e40){var _0x4e066d=util[_0x0446('0x6')](_0x0446('0x7'),_0x0446('0x8'),_0x982169[_0x0446('0x9')]);if(_0x43990f[_0x0446('0xa')]&&_0x43990f[_0x0446('0xa')][_0x4e066d]&&_0x43990f['timers'][_0x4e066d]['timer']){_0x43990f['timers'][_0x4e066d][_0x0446('0xb')]();}if(_0x43990f[_0x0446('0xc')][_0x4e066d]){_0x43990f[_0x0446('0xc')][_0x4e066d][_0x0446('0xd')]({'statePause':_0x982169[_0x0446('0xe')]?!![]:![]});}_0x56bada({'code':0xc8,'message':_0x0446('0xf')});});},'Reload':function(_0x2edc58){var _0x4693ac=this;return new Promise(function(_0x429995,_0x4605a4){if(ami[_0x0446('0x10')]()==![]){return _0x4605a4(_0x4693ac[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk']['username'],_0x0446('0x13')][_0x0446('0x14')]('\x20')));}_0x2edc58=_[_0x0446('0x15')](_0x2edc58,_['keys'](properties[_0x0446('0x16')]));_0x2edc58[_0x0446('0x17')]=_0x0446('0x18');return ami[_0x0446('0x19')](_0x2edc58)[_0x0446('0x1a')](function(_0x2b54fb){_0x429995({'code':0xc8,'message':_0x2b54fb[_0x0446('0x1b')]});})[_0x0446('0x1c')](function(_0x4e341d){_0x4605a4(_0x4693ac[_0x0446('0x11')](0x1f5,_0x4e341d[_0x0446('0x1b')]));});});},'Command':function(_0x43c9ed){var _0x5c1c5d=this;return new Promise(function(_0x373f6b,_0x5aff09){if(ami[_0x0446('0x10')]()==![]){return _0x5aff09(_0x5c1c5d[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk'][_0x0446('0x1d')],_0x0446('0x13')]['join']('\x20')));}_0x43c9ed=_['pick'](_0x43c9ed,'command');_0x43c9ed[_0x0446('0x17')]='Command';return ami[_0x0446('0x19')](_0x43c9ed)[_0x0446('0x1a')](function(_0x5832af){_0x373f6b({'code':0xc8,'message':_0x5832af[_0x0446('0x1e')]});})[_0x0446('0x1c')](function(_0x56dd9c){_0x5aff09(_0x5c1c5d[_0x0446('0x11')](0x1f5,_0x56dd9c[_0x0446('0x1b')]));});});},'VoiceQueues':function(_0x2bad65){return new Promise(function(_0xd7e42a,_0x50ce7f){var _0x2e1772=[];for(var _0x3e7019 in _0x43990f[_0x0446('0x1f')]){if(_0x43990f[_0x0446('0x1f')][_0x0446('0x20')](_0x3e7019)){var _0x2d4f1b=_0x43990f['voiceQueues'][_0x3e7019];var _0x148b32={'id':_0x2d4f1b['id'],'name':_0x2d4f1b[_0x0446('0x9')],'strategy':_0x2d4f1b[_0x0446('0x21')],'answered':_0x2d4f1b[_0x0446('0x22')],'available':_0x2d4f1b['available'],'loggedIn':_0x2d4f1b['loggedIn'],'pTalking':_0x2d4f1b[_0x0446('0x23')],'sumBillable':_0x2d4f1b['sumBillable'],'sumDuration':_0x2d4f1b[_0x0446('0x24')],'sumHoldTime':_0x2d4f1b['sumHoldTime']||0x0,'talking':_0x2d4f1b['talking'],'total':_0x2d4f1b['total'],'type':_0x2d4f1b[_0x0446('0x25')],'unmanaged':_0x2d4f1b['unmanaged'],'abandoned':_0x2d4f1b[_0x0446('0x26')],'waiting':_0x2d4f1b[_0x0446('0x27')],'loggedInDb':_0x2d4f1b[_0x0446('0x28')]};if(_0x2d4f1b[_0x0446('0x25')]==='outbound'){_0x148b32['dialActive']=_0x2d4f1b['dialActive'];_0x148b32[_0x0446('0x29')]=_0x2d4f1b[_0x0446('0x29')];_0x148b32[_0x0446('0x2a')]=_0x2d4f1b[_0x0446('0x2a')];_0x148b32[_0x0446('0x2b')]=_0x2d4f1b[_0x0446('0x2b')];_0x148b32[_0x0446('0x2c')]=_0x2d4f1b[_0x0446('0x2c')];_0x148b32[_0x0446('0x2d')]=_0x2d4f1b[_0x0446('0x2d')];_0x148b32[_0x0446('0x2e')]=_0x2d4f1b[_0x0446('0x2e')];_0x148b32[_0x0446('0x2f')]=_0x2d4f1b[_0x0446('0x2f')];_0x148b32[_0x0446('0x30')]=_0x2d4f1b[_0x0446('0x30')];_0x148b32[_0x0446('0x31')]=_0x2d4f1b[_0x0446('0x31')];_0x148b32[_0x0446('0x32')]=_0x2d4f1b[_0x0446('0x32')];_0x148b32[_0x0446('0x33')]=_0x2d4f1b[_0x0446('0x33')];_0x148b32[_0x0446('0x34')]=_0x2d4f1b['outboundDropCallsDayCallersExit'];_0x148b32['outboundDropCallsDayTimeout']=_0x2d4f1b[_0x0446('0x35')];_0x148b32[_0x0446('0x36')]=_0x2d4f1b[_0x0446('0x36')];_0x148b32[_0x0446('0x37')]=_0x2d4f1b[_0x0446('0x37')];_0x148b32[_0x0446('0x38')]=_0x2d4f1b['outboundOriginateFailureCallsDay'];_0x148b32[_0x0446('0x39')]=_0x2d4f1b['outboundReCallsDay'];_0x148b32[_0x0446('0x3a')]=_0x2d4f1b[_0x0446('0x3a')];_0x148b32[_0x0446('0x3b')]=_0x2d4f1b[_0x0446('0x3b')];_0x148b32['predictiveIntervalAnsweredCalls']=_0x2d4f1b[_0x0446('0x3c')];_0x148b32[_0x0446('0x3d')]=_0x2d4f1b[_0x0446('0x3d')];_0x148b32[_0x0446('0x3e')]=_0x2d4f1b[_0x0446('0x3e')];_0x148b32[_0x0446('0x3f')]=_0x2d4f1b['predictiveIntervalDroppedCallsCallersExit'];_0x148b32[_0x0446('0x40')]=_0x2d4f1b[_0x0446('0x40')];_0x148b32[_0x0446('0x41')]=_0x2d4f1b['predictiveIntervalErlangCalls'];_0x148b32[_0x0446('0x42')]=_0x2d4f1b['predictiveIntervalErlangCallsDroppedCalls'];_0x148b32['predictiveIntervalHitRate']=_0x2d4f1b[_0x0446('0x43')];_0x148b32[_0x0446('0x44')]=_0x2d4f1b[_0x0446('0x44')];_0x148b32['predictiveIntervalPauses']=_0x2d4f1b[_0x0446('0x45')];_0x148b32[_0x0446('0x46')]=_0x2d4f1b[_0x0446('0x46')];_0x148b32[_0x0446('0x47')]=_0x2d4f1b[_0x0446('0x47')];_0x148b32[_0x0446('0x1b')]=_0x2d4f1b[_0x0446('0x1b')];_0x148b32[_0x0446('0x48')]=_0x2d4f1b[_0x0446('0x48')];_0x148b32[_0x0446('0x49')]=_0x2d4f1b[_0x0446('0x49')];_0x148b32[_0x0446('0x4a')]=_0x2d4f1b[_0x0446('0x4a')];_0x148b32[_0x0446('0x4b')]=_0x2d4f1b[_0x0446('0x4b')];_0x148b32[_0x0446('0x4c')]=_0x2d4f1b[_0x0446('0x4c')];_0x148b32[_0x0446('0x4d')]=_0x2d4f1b['startPredictive'];_0x148b32[_0x0446('0x4e')]=_0x2d4f1b['startProgressive'];}if(_0x2d4f1b['Trunk']){_0x148b32['Trunk']={'id':_0x2d4f1b['Trunk']['id'],'name':_0x2d4f1b[_0x0446('0x4f')][_0x0446('0x9')],'active':_0x2d4f1b[_0x0446('0x4f')][_0x0446('0x50')],'callerid':_0x2d4f1b[_0x0446('0x4f')][_0x0446('0x51')]};}if(_0x2d4f1b[_0x0446('0x52')]){_0x148b32['Interval']={'id':_0x2d4f1b[_0x0446('0x52')]['id'],'name':_0x2d4f1b[_0x0446('0x52')][_0x0446('0x9')]};}_0x2e1772['push'](_0x148b32);}}_0xd7e42a({'count':_0x2e1772[_0x0446('0x53')],'rows':_0x2e1772});});},'VoiceChannels':function(_0x963b0e){return new Promise(function(_0x2fbbc5,_0x85bb8e){var _0x518ae5=_[_0x0446('0x54')](_0x43990f['channels']);_0x2fbbc5({'count':_0x518ae5[_0x0446('0x53')],'rows':_0x518ae5});});},'VoiceChannelMixMonitor':function(_0x14f6be){var _0x5cd770=this;return new Promise(function(_0x3558c0,_0x39ee9a){if(ami[_0x0446('0x10')]()==![]){return _0x39ee9a(_0x5cd770[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk'][_0x0446('0x1d')],_0x0446('0x13')][_0x0446('0x14')]('\x20')));}var _0xf746a9=schema(properties['voicechannel'])[_0x0446('0x2')](_0x14f6be);if(_0xf746a9[_0x0446('0x53')]>0x0){return _0x39ee9a(_0x5cd770['error'](0x1f4,_['map'](_0xf746a9,_0x0446('0x1b'))[_0x0446('0x14')](',\x20')));}var _0x9fa0ba=_[_0x0446('0x55')](_0x43990f[_0x0446('0x56')],{'uniqueid':_0x14f6be['uniqueid']});if(_0x9fa0ba&&_0x9fa0ba[_0x0446('0x57')]){var _0x16c63f=util[_0x0446('0x6')](_0x0446('0x58'),_0x14f6be[_0x0446('0x59')]||_0x14f6be[_0x0446('0x5a')],_0x14f6be[_0x0446('0x6')]||_0x0446('0x5b'));return ami[_0x0446('0x19')]({'action':_0x0446('0x5c'),'channel':_0x9fa0ba[_0x0446('0x57')],'file':_0x16c63f,'options':_0x0446('0x5d')})['then'](function(_0x10f106){var _0x5eb93b=_[_0x0446('0x55')](_0x9fa0ba['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x16c63f['toLowerCase']()});if(_[_0x0446('0x5e')](_0x5eb93b)){_0x9fa0ba[_0x0446('0x5f')][_0x0446('0x60')]({'filename':'/var/spool/asterisk/monitor/'+_0x16c63f[_0x0446('0x61')](),'createdAt':moment()['format'](_0x0446('0x62')),'mixmonitorid':_0x10f106['mixmonitorid'],'status':_0x0446('0x63')});}else{_0x5eb93b[_0x0446('0x64')]=_0x10f106[_0x0446('0x64')];_0x5eb93b[_0x0446('0x65')]='rec';}_0x3558c0({'code':0xc8,'message':[_0x14f6be[_0x0446('0x5a')],_0x0446('0x66'),_0x10f106[_0x0446('0x64')]][_0x0446('0x14')]('\x20'),'mixmonitorid':_0x10f106[_0x0446('0x64')]});})['catch'](function(_0x5e6d80){_0x39ee9a(_0x5cd770[_0x0446('0x11')](0x1f5,[_0x14f6be[_0x0446('0x5a')],_0x5e6d80[_0x0446('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x39ee9a(_0x5cd770[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0x36c633){var _0x3fe8dd=this;return new Promise(function(_0x46084d,_0x4bc3b1){if(ami[_0x0446('0x10')]()==![]){return _0x4bc3b1(_0x3fe8dd[_0x0446('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x0446('0x12')][_0x0446('0x1d')],'ami\x20disconnected'][_0x0446('0x14')]('\x20')));}var _0x559e8d=schema(properties['voicechannel'])['validate'](_0x36c633);if(_0x559e8d[_0x0446('0x53')]>0x0){return _0x4bc3b1(_0x3fe8dd['error'](0x1f4,_[_0x0446('0x68')](_0x559e8d,_0x0446('0x1b'))[_0x0446('0x14')](',\x20')));}var _0x5bdf4f=_['find'](_0x43990f[_0x0446('0x56')],{'uniqueid':_0x36c633[_0x0446('0x5a')]});if(_0x5bdf4f){return BPromise[_0x0446('0x69')]()['then'](function(){if(_0x5bdf4f[_0x0446('0x57')]){return ami[_0x0446('0x19')]({'action':'StopMixMonitor','channel':_0x5bdf4f[_0x0446('0x57')],'mixmonitorid':_0x36c633[_0x0446('0x64')]})[_0x0446('0x1c')](function(_0x47a698){});}})[_0x0446('0x1a')](function(){if(_0x5bdf4f['destinationchannel']){return ami[_0x0446('0x19')]({'action':_0x0446('0x6a'),'channel':_0x5bdf4f[_0x0446('0x6b')],'mixmonitorid':_0x36c633[_0x0446('0x64')]})[_0x0446('0x1c')](function(_0x61f011){});}})[_0x0446('0x1a')](function(_0x26b6ba){var _0x2f7d3b=_[_0x0446('0x55')](_0x5bdf4f[_0x0446('0x5f')],{'mixmonitorid':_0x36c633['mixmonitorid']});if(_0x2f7d3b){_0x2f7d3b[_0x0446('0x65')]=_0x0446('0x6c');}})['then'](function(){var _0x185f5d=util['format']('%s.%s',_0x36c633['filename']||_0x36c633[_0x0446('0x5a')],_0x36c633[_0x0446('0x6')]||_0x0446('0x5b'));var _0x210e49=_[_0x0446('0x55')](_0x5bdf4f['monitors'],{'filename':_0x0446('0x6d')+_0x185f5d['toLowerCase']()});if(_0x210e49){_0x210e49[_0x0446('0x65')]=_0x0446('0x6c');}})[_0x0446('0x1a')](function(){_0x46084d({'code':0xc8,'message':[_0x36c633[_0x0446('0x5a')],_0x0446('0x6e')]['join']('\x20')});})[_0x0446('0x1c')](function(_0x5956c0){_0x4bc3b1(_0x3fe8dd[_0x0446('0x11')](0x1f5,[_0x36c633[_0x0446('0x5a')],_0x5956c0['message'][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')));});}else{return _0x4bc3b1(_0x3fe8dd[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceQueuesChannels':function(_0x214b34){return new Promise(function(_0x1bd778,_0x1a7a3e){var _0x39c492=_[_0x0446('0x54')](_0x43990f[_0x0446('0x6f')]);_0x1bd778({'count':_0x39c492[_0x0446('0x53')],'rows':_0x39c492});});},'VoiceQueuesChannel':function(_0x235f2f){var _0x550d4e=this;return new Promise(function(_0x133ebf,_0x55be59){var _0x444106=schema(properties['voicequeuechannel'])['validate'](_0x235f2f);if(_0x444106[_0x0446('0x53')]>0x0){return _0x55be59(_0x550d4e['error'](0x1f4,_[_0x0446('0x68')](_0x444106,'message')[_0x0446('0x14')](',\x20')));}var _0x1e7bed=_[_0x0446('0x55')](_0x43990f['queueChannels'],{'uniqueid':_0x235f2f[_0x0446('0x5a')]});if(_0x1e7bed){_0x133ebf(_0x1e7bed);}else{return _0x55be59(_0x550d4e[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceQueuesChannelHangup':function(_0x3e5c21){var _0x14f5ba=this;return new Promise(function(_0x183dc2,_0x1738e4){if(ami['isConnected']()==![]){return _0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x0446('0x14')]('\x20')));}var _0xf51372=schema(properties['voicequeuechannelhangup'])[_0x0446('0x2')](_0x3e5c21);if(_0xf51372[_0x0446('0x53')]>0x0){return _0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f4,_[_0x0446('0x68')](_0xf51372,_0x0446('0x1b'))[_0x0446('0x14')](',\x20')));}var _0x4f1bd8=_['find'](_0x43990f['queueChannels'],{'uniqueid':_0x3e5c21[_0x0446('0x5a')]});if(_0x4f1bd8&&_0x4f1bd8[_0x0446('0x57')]){return ami[_0x0446('0x19')]({'action':'Hangup','channel':_0x4f1bd8['channel']})[_0x0446('0x1a')](function(_0x5d801b){_0x183dc2({'code':0xc8,'message':[_0x3e5c21[_0x0446('0x5a')],_0x5d801b[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')});})[_0x0446('0x1c')](function(_0x1662a2){_0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f5,[_0x3e5c21[_0x0446('0x5a')],_0x1662a2[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')));});}else{return _0x1738e4(_0x14f5ba[_0x0446('0x11')](0x1f5,_0x0446('0x67')));}});},'VoiceQueuesChannelRedirect':function(_0x526673){var _0x5c1af1=this;return new Promise(function(_0x820a0a,_0x1ae806){if(ami[_0x0446('0x10')]()==![]){return _0x1ae806(_0x5c1af1[_0x0446('0x11')](0x1f4,[config[_0x0446('0x12')]['ip'],config[_0x0446('0x12')][_0x0446('0x1d')],_0x0446('0x13')]['join']('\x20')));}var _0x32c1b3=schema(properties[_0x0446('0x70')])[_0x0446('0x2')](_0x526673);if(_0x32c1b3[_0x0446('0x53')]>0x0){return _0x1ae806(_0x5c1af1[_0x0446('0x11')](0x1f4,_[_0x0446('0x68')](_0x32c1b3,_0x0446('0x1b'))['join'](',\x20')));}var _0x2132e5=_['find'](_0x43990f[_0x0446('0x6f')],{'uniqueid':_0x526673[_0x0446('0x5a')]});if(_0x2132e5&&_0x2132e5[_0x0446('0x57')]){return ami[_0x0446('0x19')]({'action':_0x0446('0x71'),'channel':_0x2132e5[_0x0446('0x57')],'exten':_0x526673[_0x0446('0x72')],'context':_0x526673['context']||_0x2132e5['context'],'priority':0x1})[_0x0446('0x1a')](function(_0x2dad10){_0x820a0a({'code':0xc8,'message':[_0x526673[_0x0446('0x5a')],_0x2dad10[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')});})[_0x0446('0x1c')](function(_0x195175){_0x1ae806(_0x5c1af1[_0x0446('0x11')](0x1f5,[_0x526673[_0x0446('0x5a')],_0x195175[_0x0446('0x1b')][_0x0446('0x61')]()][_0x0446('0x14')]('\x20')));});}else{return _0x1ae806(_0x5c1af1['error'](0x1f5,_0x0446('0x67')));}});},'Agents':function(_0x45f010){return new Promise(function(_0x1e5442,_0xa3503d){var _0x3537c0=_[_0x0446('0x54')](_0x43990f[_0x0446('0xc')]);_0x1e5442({'count':_0x3537c0[_0x0446('0x53')],'rows':_0x3537c0});});},'Telephones':function(_0x12a365){return new Promise(function(_0x527969,_0x3cd410){var _0x39e7b6=_['values'](_0x43990f[_0x0446('0x73')]);_0x527969({'count':_0x39e7b6[_0x0446('0x53')],'rows':_0x39e7b6});});},'Trunks':function(_0x4a5182){return new Promise(function(_0xad076e,_0x1a7bd8){var _0x3b0ad4=_[_0x0446('0x54')](_0x43990f[_0x0446('0x74')]);_0xad076e({'count':_0x3b0ad4['length'],'rows':_0x3b0ad4});});},'OutboundChannels':function(_0x31f715){return new Promise(function(_0x4b0320,_0x17fe3d){var _0x5b5e9d=_[_0x0446('0x54')](_0x43990f[_0x0446('0x75')]);_0x4b0320({'count':_0x5b5e9d[_0x0446('0x53')],'rows':_0x5b5e9d});});},'Outbound':function(_0x4ec51a){return new Promise(function(_0x41adaf,_0x3bd129){_0x41adaf(_0x43990f[_0x0446('0x76')]);});},'Campaigns':function(_0x14b78a){return new Promise(function(_0x4e0584,_0x1083ee){var _0x5e6dba=_[_0x0446('0x54')](_0x43990f['campaigns']);_0x4e0584({'count':_0x5e6dba[_0x0446('0x53')],'rows':_0x5e6dba});});},'VoiceQueuesPreview':function(_0x4f2b9b){var _0x1e409e=this;return new Promise(function(_0x556dbe,_0x3a5558){_0x457c07[_0x0446('0x77')](_0x4f2b9b['id'])[_0x0446('0x1a')](function(_0x2aaedc){_0x556dbe({'code':0xc8,'message':_0x2aaedc[_0x0446('0x1b')]});})[_0x0446('0x1c')](function(_0x57fad4){_0x3a5558(_0x1e409e[_0x0446('0x11')](0x1f4,_0x57fad4[_0x0446('0x1b')]));});});},'EventManager':function(_0x26fe50){var _0x34d371=this;return new Promise(function(_0xa6122f,_0x5795ff){if(!_0x26fe50[_0x0446('0x78')]){return _0x5795ff(_0x34d371[_0x0446('0x11')](0x1f4,_0x0446('0x79')));}ami['emit']('custom:'+_0x26fe50['event'],_0x26fe50['message']);_0xa6122f({'code':0xc8,'message':_0x26fe50});});},'FaxAccounts':function(_0x38fa76){return new Promise(function(_0x1c1d12,_0x132aa0){var _0x9fdcee=_[_0x0446('0x54')](_0x43990f['faxAccounts']);_0x1c1d12({'count':_0x9fdcee[_0x0446('0x53')],'rows':_0x9fdcee});});},'SendFax':function(_0x4dae71){var _0x47d174=this;return new Promise(function(_0x3ad9aa,_0x370a9b){_0x3f6160[_0x0446('0x7a')](_0x4dae71)['then'](function(_0x38d750){_0x3ad9aa({'code':0xc8,'message':_0x38d750['message']});})['catch'](function(_0x238591){_0x370a9b(_0x47d174[_0x0446('0x11')](0x1f4,_0x238591['message']));});});},'CheckAfterSend':function(_0x4a367b){var _0x5ea4ce=this;return new Promise(function(_0x5d21eb,_0x5f2fb8){_0x3f6160[_0x0446('0x7b')](_0x4a367b)[_0x0446('0x1a')](function(_0x3c3c92){_0x5d21eb({'code':0xc8,'message':_0x3c3c92[_0x0446('0x1b')]});})['catch'](function(_0x32d5be){_0x5f2fb8(_0x5ea4ce['error'](0x1f4,_0x32d5be[_0x0446('0x1b')]));});});}};var _0x2d3c17=jayson[_0x0446('0x7c')](_0x1e62cb)[_0x0446('0x7d')]();_0x2d3c17['on']('error',function(_0x10aba9){return _0x465363(_0x10aba9);});_0x2d3c17[_0x0446('0x5')](0x232a,_0x0446('0x7e'),function(){console['log'](_0x0446('0x7f'),0x232a);return _0x12c793(_0x0446('0x80')+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 74871ed..018af77 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 _0x642f=['destcalleridnum','phone','resolve','then','showContact','omit','xmd-contactid2','format','user:%s','trigger:%s','action','toLowerCase','merge','createContact','Error\x20creating\x20contact','stringify','name','bluebird','util','lodash','ioredis','../../../../config/environment','trigger','../../rpc/cmContact','defaults','redis','localhost','info','emit','exec','autoCreate','data2','data1','calleridnum','isNil','firstName','calleridname','','uniqueid','destcalleridname'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x642f,0x151));var _0xf642=function(_0x44ddc4,_0x12c759){_0x44ddc4=_0x44ddc4-0x0;var _0x327637=_0x642f[_0x44ddc4];return _0x327637;};'use strict';var BPromise=require(_0xf642('0x0'));var util=require(_0xf642('0x1'));var _=require(_0xf642('0x2'));var Redis=require(_0xf642('0x3'));var config=require(_0xf642('0x4'));var logger=require('../../../../config/logger')(_0xf642('0x5'));var cmContactRpc=require(_0xf642('0x6'));config['redis']=_[_0xf642('0x7')](config[_0xf642('0x8')],{'host':_0xf642('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf642('0x8')]));function emit(_0x3731aa,_0x26d11b,_0x5d7967){logger[_0xf642('0xa')](_0x3731aa,_0x26d11b,JSON['stringify'](_0x5d7967));io['to'](_0x3731aa)[_0xf642('0xb')](_0x26d11b,_0x5d7967);}exports[_0xf642('0xc')]=function(_0x545ae3,_0x492b75,_0x2b3994){_0x2b3994[_0xf642('0xd')]=0x0;if(_0x492b75[_0xf642('0xe')]&&parseInt(_0x492b75[_0xf642('0xe')],0xa)){var _0x3ec3ca={'ListId':parseInt(_0x492b75[_0xf642('0xf')],0xa),'phone':_0x2b3994[_0xf642('0x10')]};if(_[_0xf642('0x11')](_0x2b3994['routeId'])){_0x3ec3ca[_0xf642('0x12')]=_0x2b3994['calleridname']&&_0x2b3994[_0xf642('0x13')]!==_0xf642('0x14')?_0x2b3994[_0xf642('0x13')]:_0x2b3994[_0xf642('0x10')]||_0x2b3994[_0xf642('0x15')];}else{_0x3ec3ca[_0xf642('0x12')]=_0x2b3994[_0xf642('0x16')]&&_0x2b3994[_0xf642('0x16')]!==''?_0x2b3994[_0xf642('0x16')]:_0x2b3994[_0xf642('0x17')]||_0x2b3994['uniqueid'];_0x3ec3ca[_0xf642('0x18')]=_0x2b3994['destcalleridname']&&_0x2b3994[_0xf642('0x16')]!==_0xf642('0x14')?_0x2b3994['destcalleridname']:_0x2b3994['destcalleridnum']||_0x2b3994['uniqueid'];}BPromise[_0xf642('0x19')]()[_0xf642('0x1a')](cmContactRpc[_0xf642('0x1b')]({'where':_[_0xf642('0x1c')](_0x3ec3ca,[_0xf642('0x12')])}))[_0xf642('0x1a')](function(_0x5b12e5){if(_0x5b12e5){_0x2b3994[_0xf642('0x1d')]=_0x5b12e5['id'];emit(util[_0xf642('0x1e')](_0xf642('0x1f'),_0x545ae3['name']),util[_0xf642('0x1e')](_0xf642('0x20'),_0x492b75[_0xf642('0x21')][_0xf642('0x22')]()),_[_0xf642('0x23')](_0x2b3994,{'ListId':parseInt(_0x492b75['data1'],0xa)}));return;}else{return BPromise['resolve']()[_0xf642('0x1a')](cmContactRpc[_0xf642('0x24')](_0x3ec3ca));}})[_0xf642('0x1a')](function(_0x5bcb95){if(_0x5bcb95){_0x2b3994[_0xf642('0x1d')]=_0x5bcb95['id'];emit(util[_0xf642('0x1e')](_0xf642('0x1f'),_0x545ae3['name']),util[_0xf642('0x1e')](_0xf642('0x20'),_0x492b75[_0xf642('0x21')]['toLowerCase']()),_['merge'](_0x2b3994,{'ListId':parseInt(_0x492b75[_0xf642('0xf')],0xa)}));}})['catch'](function(_0x3489b8){logger['error'](_0xf642('0x25'),JSON[_0xf642('0x26')](_0x3489b8));});}else{if(_0x545ae3){emit(util[_0xf642('0x1e')](_0xf642('0x1f'),_0x545ae3[_0xf642('0x27')]),util['format'](_0xf642('0x20'),_0x492b75[_0xf642('0x21')][_0xf642('0x22')]()),_[_0xf642('0x23')]({'ListId':parseInt(_0x492b75[_0xf642('0xf')],0xa)},_0x2b3994));}}}; \ No newline at end of file +var _0x4303=['socket.io-emitter','emit','exec','autoCreate','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','resolve','then','showContact','omit','user:%s','name','format','action','toLowerCase','merge','xmd-contactid2','trigger:%s','Error\x20creating\x20contact','stringify','bluebird','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost'];(function(_0x3e0b8f,_0x1cddeb){var _0x22f742=function(_0xacb1bc){while(--_0xacb1bc){_0x3e0b8f['push'](_0x3e0b8f['shift']());}};_0x22f742(++_0x1cddeb);}(_0x4303,0xda));var _0x3430=function(_0x3f6439,_0x17de7c){_0x3f6439=_0x3f6439-0x0;var _0x143eb8=_0x4303[_0x3f6439];return _0x143eb8;};'use strict';var BPromise=require(_0x3430('0x0'));var util=require('util');var _=require(_0x3430('0x1'));var Redis=require(_0x3430('0x2'));var config=require(_0x3430('0x3'));var logger=require(_0x3430('0x4'))(_0x3430('0x5'));var cmContactRpc=require(_0x3430('0x6'));config[_0x3430('0x7')]=_[_0x3430('0x8')](config[_0x3430('0x7')],{'host':_0x3430('0x9'),'port':0x18eb});var io=require(_0x3430('0xa'))(new Redis(config[_0x3430('0x7')]));function emit(_0x44ce3f,_0x26ac21,_0x321634){logger['info'](_0x44ce3f,_0x26ac21,JSON['stringify'](_0x321634));io['to'](_0x44ce3f)[_0x3430('0xb')](_0x26ac21,_0x321634);}exports[_0x3430('0xc')]=function(_0x19fe37,_0xdf7a68,_0x9fe9e9){_0x9fe9e9[_0x3430('0xd')]=0x0;if(_0xdf7a68['data2']&&parseInt(_0xdf7a68['data2'],0xa)){var _0xd25f51={'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa),'phone':_0x9fe9e9[_0x3430('0xf')]};if(_[_0x3430('0x10')](_0x9fe9e9[_0x3430('0x11')])){_0xd25f51[_0x3430('0x12')]=_0x9fe9e9[_0x3430('0x13')]&&_0x9fe9e9['calleridname']!==_0x3430('0x14')?_0x9fe9e9[_0x3430('0x13')]:_0x9fe9e9[_0x3430('0xf')]||_0x9fe9e9[_0x3430('0x15')];}else{_0xd25f51['firstName']=_0x9fe9e9[_0x3430('0x16')]&&_0x9fe9e9[_0x3430('0x16')]!==_0x3430('0x14')?_0x9fe9e9[_0x3430('0x16')]:_0x9fe9e9['destcalleridnum']||_0x9fe9e9[_0x3430('0x15')];_0xd25f51['phone']=_0x9fe9e9[_0x3430('0x16')]&&_0x9fe9e9[_0x3430('0x16')]!==_0x3430('0x14')?_0x9fe9e9[_0x3430('0x16')]:_0x9fe9e9[_0x3430('0x17')]||_0x9fe9e9[_0x3430('0x15')];}BPromise[_0x3430('0x18')]()[_0x3430('0x19')](cmContactRpc[_0x3430('0x1a')]({'where':_[_0x3430('0x1b')](_0xd25f51,[_0x3430('0x12')])}))[_0x3430('0x19')](function(_0x2a2267){if(_0x2a2267){_0x9fe9e9['xmd-contactid2']=_0x2a2267['id'];emit(util['format'](_0x3430('0x1c'),_0x19fe37[_0x3430('0x1d')]),util[_0x3430('0x1e')]('trigger:%s',_0xdf7a68[_0x3430('0x1f')][_0x3430('0x20')]()),_[_0x3430('0x21')](_0x9fe9e9,{'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa)}));return;}else{return BPromise[_0x3430('0x18')]()[_0x3430('0x19')](cmContactRpc['createContact'](_0xd25f51));}})[_0x3430('0x19')](function(_0x386f88){if(_0x386f88){_0x9fe9e9[_0x3430('0x22')]=_0x386f88['id'];emit(util[_0x3430('0x1e')](_0x3430('0x1c'),_0x19fe37[_0x3430('0x1d')]),util[_0x3430('0x1e')](_0x3430('0x23'),_0xdf7a68[_0x3430('0x1f')][_0x3430('0x20')]()),_[_0x3430('0x21')](_0x9fe9e9,{'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa)}));}})['catch'](function(_0x4400f9){logger['error'](_0x3430('0x24'),JSON[_0x3430('0x25')](_0x4400f9));});}else{if(_0x19fe37){emit(util['format'](_0x3430('0x1c'),_0x19fe37[_0x3430('0x1d')]),util[_0x3430('0x1e')](_0x3430('0x23'),_0xdf7a68[_0x3430('0x1f')][_0x3430('0x20')]()),_[_0x3430('0x21')]({'ListId':parseInt(_0xdf7a68[_0x3430('0xe')],0xa)},_0x9fe9e9));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index a7a3876..2b9ee1e 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 _0xb887=['custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','stringify','prototype','clone','hasOwnProperty','status','checkTrigger','merge','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','popup','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','data3','data4','windowWidth','isNil','data5','600','data6','winApplication','format','name','jscripty','trigger:%s','user:%s','exec','integration','queue','routeId','urlforward','script','parse','search','AllConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','agent','membername','lastevent','util','mustache','ioredis','./script','../rpc/cmContact','../../../config/environment','trigger','../ami','defaults','localhost','socket.io-emitter','redis','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete'];(function(_0x245c2c,_0x2862bf){var _0x3d3e94=function(_0x30fdcb){while(--_0x30fdcb){_0x245c2c['push'](_0x245c2c['shift']());}};_0x3d3e94(++_0x2862bf);}(_0xb887,0xaf));var _0x7b88=function(_0x1b8961,_0x50a2b6){_0x1b8961=_0x1b8961-0x0;var _0x199856=_0xb887[_0x1b8961];return _0x199856;};'use strict';var util=require(_0x7b88('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0x7b88('0x1'));var Redis=require(_0x7b88('0x2'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x7b88('0x3'));var cmContactRpc=require(_0x7b88('0x4'));var config=require(_0x7b88('0x5'));var logger=require('../../../config/logger')(_0x7b88('0x6'));var ami=require(_0x7b88('0x7'));config['redis']=_[_0x7b88('0x8')](config['redis'],{'host':_0x7b88('0x9'),'port':0x18eb});var io=require(_0x7b88('0xa'))(new Redis(config[_0x7b88('0xb')]));var operators={'equals':function(_0x295f56,_0x3d0452){return _0x295f56==_0x3d0452;},'not_equals':function(_0x16753d,_0x57e863){return _0x16753d!=_0x57e863;}};var barAndWebActions=['popup','url',_0x7b88('0xc')];function Trigger(_0x360dc9){this[_0x7b88('0xd')]=_0x360dc9['triggers'];this['agents']=_0x360dc9[_0x7b88('0xe')];this[_0x7b88('0xf')]=_0x360dc9[_0x7b88('0xf')];this['templates']=_0x360dc9[_0x7b88('0x10')];this[_0x7b88('0x11')]=_0x360dc9[_0x7b88('0x11')];this[_0x7b88('0x12')]=_0x360dc9['zendeskAccounts'];this[_0x7b88('0x13')]=_0x360dc9[_0x7b88('0x13')];this[_0x7b88('0x14')]=_0x360dc9[_0x7b88('0x14')];this[_0x7b88('0x15')]=_0x360dc9[_0x7b88('0x15')];this['zohoAccounts']=_0x360dc9[_0x7b88('0x16')];this[_0x7b88('0x17')]=_0x360dc9[_0x7b88('0x17')];this['vtigerAccounts']=_0x360dc9['vtigerAccounts'];this[_0x7b88('0x18')]=_0x360dc9[_0x7b88('0x18')];this['dynamics365Accounts']=_0x360dc9[_0x7b88('0x19')];this[_0x7b88('0x1a')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x7b88('0x14')],'freshdesk':this[_0x7b88('0x13')],'sugarcrm':this[_0x7b88('0x15')],'zoho':this[_0x7b88('0x16')],'desk':this[_0x7b88('0x17')],'vtiger':this[_0x7b88('0x1b')],'servicenow':this[_0x7b88('0x18')],'dynamics365':this['dynamics365Accounts']};ami['on'](_0x7b88('0x1c'),this[_0x7b88('0x1d')][_0x7b88('0x1e')](this));ami['on'](_0x7b88('0x1f'),this['syncCustomEvent'][_0x7b88('0x1e')](this));ami['on']('custom:agentringnoanswer',this[_0x7b88('0x1d')]['bind'](this));ami['on'](_0x7b88('0x20'),this[_0x7b88('0x1d')]['bind'](this));ami['on'](_0x7b88('0x21'),this[_0x7b88('0x1d')][_0x7b88('0x1e')](this));ami['on'](_0x7b88('0x22'),this['syncAgentDial'][_0x7b88('0x1e')](this));ami['on'](_0x7b88('0x23'),this['syncAgentDial'][_0x7b88('0x1e')](this));ami['on']('custom:dialend',this[_0x7b88('0x24')][_0x7b88('0x1e')](this));ami['on']('custom:newinteraction',this[_0x7b88('0x1d')][_0x7b88('0x1e')](this));ami['on'](_0x7b88('0x25'),this['syncCustomEvent']['bind'](this));ami['on'](_0x7b88('0x26'),this['syncCustomEvent']['bind'](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x7b88('0x1e')](this));ami['on'](_0x7b88('0x27'),this[_0x7b88('0x1d')][_0x7b88('0x1e')](this));ami['on'](_0x7b88('0x28'),this[_0x7b88('0x1d')][_0x7b88('0x1e')](this));}Trigger['prototype'][_0x7b88('0x29')]=function(_0x4c518a,_0x43445f,_0xeba0d4){logger['info'](_0x4c518a,_0x43445f,JSON[_0x7b88('0x2a')](_0xeba0d4));io['to'](_0x4c518a)[_0x7b88('0x29')](_0x43445f,_0xeba0d4);};Trigger[_0x7b88('0x2b')]['syncCustomEvent']=function(_0x25c413){var _0xf5bcab=_[_0x7b88('0x2c')](_0x25c413);this['checkTriggers'](_0xf5bcab);};Trigger[_0x7b88('0x2b')][_0x7b88('0x24')]=function(_0xdee449){if(this[_0x7b88('0xe')][_0xdee449['interface']]){this['syncCustomEvent'](_0xdee449);}};Trigger[_0x7b88('0x2b')]['checkTriggers']=function(_0xe13a7){var _0x4c84f3;for(var _0x3cb5ba in this['triggers']){if(this[_0x7b88('0xd')][_0x7b88('0x2d')](_0x3cb5ba)){if(this[_0x7b88('0xd')][_0x3cb5ba][_0x7b88('0x2e')]){_0x4c84f3=this[_0x7b88('0x2f')](this['triggers'][_0x3cb5ba],_0xe13a7);if(_0x4c84f3){_[_0x7b88('0x30')](_0xe13a7,_0xe13a7['variables']);for(var _0x19712c=0x0,_0x25a5dd,_0x5f11fc,_0x20c46c;_0x19712c0x0){_0x479989=_[_0xcaf3('0x28')](_0x5b8866,_0x3bbe25);}return _0x479989;}function getCustomFields(_0x50b039,_0x2fab40){var _0x2e95c7=[];var _0x29b948={'custom_fields':{}};if(_0x50b039[_0xcaf3('0x27')]>0x0){_[_0xcaf3('0x29')](_0x50b039,function(_0x121fdd){if(_0x121fdd[_0xcaf3('0x2a')]===_0xcaf3('0x2b')&&_0x121fdd['nameField']&&!_0x121fdd['customField']){_0x29b948[_0x121fdd[_0xcaf3('0x2c')][_0xcaf3('0x2d')]()]=_0x121fdd[_0xcaf3('0x2e')][_0xcaf3('0x20')]();}else if(_0x121fdd[_0xcaf3('0x2a')]==='string'&&_0x121fdd[_0xcaf3('0x2f')]&&_0x121fdd[_0xcaf3('0x30')]){_0x29b948[_0xcaf3('0x31')][_0x121fdd[_0xcaf3('0x2f')]]=_0x121fdd[_0xcaf3('0x2e')]['toString']();}else if(_0x121fdd[_0xcaf3('0x2a')]===_0xcaf3('0x32')&&_0x121fdd['variableName']&&_0x121fdd[_0xcaf3('0x2f')]&&_0x121fdd[_0xcaf3('0x30')]){_0x2fab40[_0x121fdd[_0xcaf3('0x33')]]&&(_0x29b948[_0xcaf3('0x31')][_0x121fdd[_0xcaf3('0x2f')]]=_0x2fab40[_0x121fdd[_0xcaf3('0x33')]][_0xcaf3('0x20')]());}else if(_0x121fdd[_0xcaf3('0x2a')]===_0xcaf3('0x34')&&_0x121fdd[_0xcaf3('0x35')]&&_0x121fdd[_0xcaf3('0x35')][_0xcaf3('0x36')]&&_0x121fdd[_0xcaf3('0x2f')]&&_0x121fdd[_0xcaf3('0x30')]){_0x2fab40[_0x121fdd[_0xcaf3('0x35')][_0xcaf3('0x36')]['toLowerCase']()]&&(_0x29b948['custom_fields'][_0x121fdd[_0xcaf3('0x2f')]]=_0x2fab40[_0x121fdd[_0xcaf3('0x35')][_0xcaf3('0x36')][_0xcaf3('0x2d')]()][_0xcaf3('0x20')]());}});}if(_0x29b948[_0xcaf3('0x37')]){_0x29b948['priority']=Number(_0x29b948['priority']);}return _0x29b948;}function getTicket(_0x44cfa,_0x1ef6cb,_0x1e9d52,_0x3b04e8,_0x201633){logger[_0xcaf3('0xa')]('Creating\x20new\x20ticket...');var _0x158f21=_['merge']({'subject':intUtil[_0xcaf3('0x38')](_0x3b04e8[_0xcaf3('0x39')],_0x201633,'\x20'),'type':'phone','status':_0xcaf3('0x3a'),'labels':[_0xcaf3('0x3b'),'Motion',_0xcaf3('0x3c')][_0xcaf3('0x3d')](getTags(_0x3b04e8[_0xcaf3('0x3e')],'name')),'description':intUtil['getString'](_0x3b04e8[_0xcaf3('0x3f')],_0x201633,'\x0a'),'_links':{'assigned_user':{'href':util[_0xcaf3('0xc')]('/api/v2/users/%d',_0x1ef6cb['id']),'class':_0xcaf3('0x40')}},'message':{'direction':'in','body':intUtil[_0xcaf3('0x38')](_0x3b04e8[_0xcaf3('0x3f')],_0x201633,'\x0a')}},getCustomFields(_0x3b04e8[_0xcaf3('0x41')],_0x201633));return request({'uri':util[_0xcaf3('0xc')](_0xcaf3('0x42'),_0x44cfa[_0xcaf3('0xd')],_0x1e9d52['id']),'method':_0xcaf3('0x26'),'body':_0x158f21});}exports[_0xcaf3('0x43')]=function(_0x4e2d68,_0x4dca73,_0x26b004,_0x525ac7,_0x412f5c,_0x43e4bd){var _0xa76dce,_0x11e26d;_0x43e4bd[_0xcaf3('0xd')]=intUtil[_0xcaf3('0x44')](_0x43e4bd[_0xcaf3('0xd')]);_0x43e4bd[_0xcaf3('0x45')]=intUtil[_0xcaf3('0x44')](_0x43e4bd[_0xcaf3('0x45')]);if(_0x412f5c&&_0x412f5c[_0xcaf3('0x46')]){logger[_0xcaf3('0xa')]('[QUEUE]',_0xcaf3('0x47'));_0x4dca73[_0xcaf3('0x48')]=util[_0xcaf3('0xc')](_0xcaf3('0x49'),_0x43e4bd[_0xcaf3('0x45')],_0x4dca73[_0xcaf3('0x4a')],md5(_0x4dca73['uniqueid']));}else{_0x4dca73[_0xcaf3('0x48')]='';}headers[_0xcaf3('0x4b')]=getAuth(_0x43e4bd);return getUser(_0x43e4bd,_0x525ac7[_0xcaf3('0x4c')])[_0xcaf3('0xe')](function(_0x37b709){_0xa76dce=_0x37b709;logger[_0xcaf3('0xa')]('The\x20User\x20ID\x20is:',_0xa76dce['id']);return getEndUser(_0x43e4bd,_0x4dca73['calleridname'],_0x4dca73[_0xcaf3('0x4d')]);})[_0xcaf3('0xe')](function(_0x29b6a6){_0x11e26d=_0x29b6a6;logger[_0xcaf3('0xa')](_0xcaf3('0x4e'),_0x11e26d['id']);return getTicket(_0x43e4bd,_0xa76dce,_0x11e26d,_0x26b004,_0x4dca73);})[_0xcaf3('0xe')](function(_0x3d3df6){if(_0x3d3df6){logger[_0xcaf3('0xa')](_0xcaf3('0x4f'));logger['info'](_0xcaf3('0x50'),_0x3d3df6['id']);switch(_0x43e4bd[_0xcaf3('0x2a')]){case _0xcaf3('0x51'):logger['info']('[QUEUE]',_0xcaf3('0x52'));emit(util['format'](_0xcaf3('0x53'),_0x525ac7[_0xcaf3('0x36')]),'trigger:desk:display',{'recordId':_0x3d3df6['id']});break;case _0xcaf3('0x54'):logger[_0xcaf3('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xcaf3('0xc')](_0xcaf3('0x53'),_0x525ac7[_0xcaf3('0x36')]),_0xcaf3('0x55'),{'uri':util[_0xcaf3('0xc')](_0xcaf3('0x56'),_0x3d3df6['id'])});break;default:logger[_0xcaf3('0x57')]('[QUEUE]',_0xcaf3('0x58'));}}})[_0xcaf3('0x59')](function(_0x113d7d){console['error'](_0x113d7d);logger[_0xcaf3('0x57')](_0xcaf3('0x5a'),JSON[_0xcaf3('0x5b')](_0x113d7d));});};exports[_0xcaf3('0x5c')]=function(_0x34db0e,_0x5f28c1,_0x22088f,_0x80786e,_0x1e2280,_0x1ad584,_0x38d5a0){var _0x26c842,_0x3883f0;_0x1ad584[_0xcaf3('0xd')]=intUtil[_0xcaf3('0x44')](_0x1ad584[_0xcaf3('0xd')]);_0x1ad584[_0xcaf3('0x45')]=intUtil['stripTrailingSlash'](_0x1ad584[_0xcaf3('0x45')]);if(_0x38d5a0&&_0x38d5a0['recordingFormat']&&_0x38d5a0[_0xcaf3('0x5d')]!==_0xcaf3('0x5e')){logger[_0xcaf3('0xa')](_0xcaf3('0x5f'),_0xcaf3('0x47'));_0x5f28c1[_0xcaf3('0x48')]=util['format'](_0xcaf3('0x49'),_0x1ad584[_0xcaf3('0x45')],_0x5f28c1[_0xcaf3('0x4a')],md5(_0x5f28c1[_0xcaf3('0x4a')]));}headers[_0xcaf3('0x4b')]=getAuth(_0x1ad584);return getUser(_0x1ad584,_0x80786e[_0xcaf3('0x4c')])[_0xcaf3('0xe')](function(_0x24ad5d){_0x26c842=_0x24ad5d;logger[_0xcaf3('0xa')](_0xcaf3('0x60'),_0x26c842['id']);return getEndUser(_0x1ad584,_0x5f28c1['destcalleridname'],_0x5f28c1[_0xcaf3('0x61')]);})[_0xcaf3('0xe')](function(_0x107726){_0x3883f0=_0x107726;logger['info'](_0xcaf3('0x4e'),_0x3883f0['id']);return getTicket(_0x1ad584,_0x26c842,_0x3883f0,_0x22088f,_0x5f28c1);})[_0xcaf3('0xe')](function(_0x3ba1ba){if(_0x3ba1ba){logger[_0xcaf3('0xa')]('Ticket\x20created!');logger[_0xcaf3('0xa')]('The\x20Ticket\x20ID\x20is:',_0x3ba1ba['id']);switch(_0x1ad584[_0xcaf3('0x2a')]){case _0xcaf3('0x51'):logger[_0xcaf3('0xa')](_0xcaf3('0x5a'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xcaf3('0xc')](_0xcaf3('0x53'),_0x80786e[_0xcaf3('0x36')]),_0xcaf3('0x62'),{'recordId':_0x3ba1ba['id']});break;case'newTab':logger['info']('[QUEUE]',_0xcaf3('0x63'));emit(util[_0xcaf3('0xc')](_0xcaf3('0x53'),_0x80786e[_0xcaf3('0x36')]),_0xcaf3('0x55'),{'uri':util[_0xcaf3('0xc')]('%s/agent/tickets/%s',_0x1ad584['remoteUri'],_0x3ba1ba['id'])});break;default:logger[_0xcaf3('0x57')](_0xcaf3('0x5f'),_0xcaf3('0x58'));}}})[_0xcaf3('0x59')](function(_0xec453c){logger['error'](_0xcaf3('0x5f'),JSON[_0xcaf3('0x5b')](_0xec453c));});};exports[_0xcaf3('0x64')]=function(_0x3e3145,_0x366b45,_0x5b97cb,_0x51504a,_0x237efe,_0xd4af88){var _0x3aca1c,_0x237f56;_0xd4af88['remoteUri']=intUtil[_0xcaf3('0x44')](_0xd4af88[_0xcaf3('0xd')]);_0xd4af88[_0xcaf3('0x45')]=intUtil['stripTrailingSlash'](_0xd4af88[_0xcaf3('0x45')]);if(_0x237efe&&_0x237efe[_0xcaf3('0x46')]){logger[_0xcaf3('0xa')](_0xcaf3('0x65'),_0xcaf3('0x47'));_0x366b45[_0xcaf3('0x48')]=util[_0xcaf3('0xc')](_0xcaf3('0x49'),_0xd4af88['serverUrl'],_0x366b45[_0xcaf3('0x4a')],md5(_0x366b45[_0xcaf3('0x4a')]));}else{_0x366b45[_0xcaf3('0x48')]='';}headers[_0xcaf3('0x4b')]=getAuth(_0xd4af88);return getUser(_0xd4af88)['then'](function(_0x86a9d5){_0x3aca1c=_0x86a9d5;logger[_0xcaf3('0xa')]('The\x20User\x20ID\x20is:',_0x3aca1c['id']);return getEndUser(_0xd4af88,_0x366b45[_0xcaf3('0x66')],_0x366b45[_0xcaf3('0x4d')]);})['then'](function(_0x1594b9){_0x237f56=_0x1594b9;logger['info'](_0xcaf3('0x4e'),_0x237f56['id']);return getTicket(_0xd4af88,_0x3aca1c,_0x237f56,_0x5b97cb,_0x366b45);})[_0xcaf3('0xe')](function(_0x2ee631){if(_0x2ee631){logger[_0xcaf3('0xa')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x2ee631['id']);}})['catch'](function(_0x309595){logger[_0xcaf3('0x57')](_0xcaf3('0x65'),JSON[_0xcaf3('0x5b')](_0x309595));});}; \ No newline at end of file +var _0x0f00=['calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','[OUTBOUND]','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','socket.io-emitter','redis','emit','application/json','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','debug','[HTTP]','stringify','GET','basic','%s:%s','username','password','token','%s/token:%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','map','forEach','type','string','nameField','toLowerCase','content','idField','toString','variableName','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','CTI','Descriptions','user','Fields','%s/customers/%d/cases','queue','serverUrl','stripTrailingSlash','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:'];(function(_0x4b90f8,_0x3a3331){var _0x3723f3=function(_0x4b6d7f){while(--_0x4b6d7f){_0x4b90f8['push'](_0x4b90f8['shift']());}};_0x3723f3(++_0x3a3331);}(_0x0f00,0xeb));var _0x00f0=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x0f00[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x00f0('0x0'));var rp=require(_0x00f0('0x1'));var md5=require(_0x00f0('0x2'));var util=require(_0x00f0('0x3'));var Redis=require(_0x00f0('0x4'));var intUtil=require(_0x00f0('0x5'));var config=require(_0x00f0('0x6'));var logger=require(_0x00f0('0x7'))('desk');config['redis']=_[_0x00f0('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x00f0('0x9'))(new Redis(config[_0x00f0('0xa')]));function emit(_0x4d676f,_0x3f6450,_0xc73ceb){io['to'](_0x4d676f)[_0x00f0('0xb')](_0x3f6450,_0xc73ceb);}var headers={'Content-Type':_0x00f0('0xc'),'Accept':_0x00f0('0xc')};function getUser(_0x16047d,_0x477c73){if(intUtil['validateEmail'](_0x477c73)===!![]){logger[_0x00f0('0xd')](_0x00f0('0xe'),_0x477c73);return request({'uri':util[_0x00f0('0xf')](_0x00f0('0x10'),_0x16047d['remoteUri'])})[_0x00f0('0x11')](function(_0x4dbf05){if(_0x4dbf05[_0x00f0('0x12')]){return _[_0x00f0('0x13')](_0x4dbf05[_0x00f0('0x14')][_0x00f0('0x15')],{'email':_0x477c73});}})['then'](function(_0x2d9bef){if(_0x2d9bef){logger[_0x00f0('0xd')](_0x00f0('0x16'));return _0x2d9bef;}else{logger[_0x00f0('0xd')](_0x00f0('0x17'));return request({'uri':util['format'](_0x00f0('0x18'),_0x16047d[_0x00f0('0x19')])});}});}else{logger[_0x00f0('0xd')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me',_0x16047d['remoteUri'])});}}function request(_0x6cc8c3){logger[_0x00f0('0x1a')](_0x00f0('0x1b'),JSON[_0x00f0('0x1c')](_0x6cc8c3));return rp(_['defaults'](_0x6cc8c3,{'method':_0x00f0('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x599ee1){var _0x4961ea;if(_0x599ee1['authType']===_0x00f0('0x1e')){_0x4961ea=util[_0x00f0('0xf')](_0x00f0('0x1f'),_0x599ee1[_0x00f0('0x20')],_0x599ee1[_0x00f0('0x21')]);}else if(_0x599ee1['authType']===_0x00f0('0x22')){_0x4961ea=util['format'](_0x00f0('0x23'),_0x599ee1['username'],_0x599ee1[_0x00f0('0x22')]);}return util[_0x00f0('0xf')]('Basic\x20%s',new Buffer(_0x4961ea)['toString'](_0x00f0('0x24')));}function getEndUser(_0x3fe0ac,_0x1e777d,_0x347fd9){logger[_0x00f0('0xd')](_0x00f0('0x25'),_0x347fd9);return request({'uri':util[_0x00f0('0xf')](_0x00f0('0x26'),_0x3fe0ac['remoteUri']),'qs':{'phone':_0x347fd9}})['then'](function(_0xdaee4b){if(_0xdaee4b['total_entries']){logger[_0x00f0('0xd')]('Enduser\x20found!');return _0xdaee4b[_0x00f0('0x14')][_0x00f0('0x15')][0x0];}else{logger[_0x00f0('0xd')](_0x00f0('0x27'));return request({'uri':util[_0x00f0('0xf')](_0x00f0('0x28'),_0x3fe0ac[_0x00f0('0x19')]),'method':_0x00f0('0x29'),'body':{'first_name':_0x1e777d,'title':_0x1e777d,'phone_numbers':[{'type':'work','value':_0x347fd9}]}});}});}function getTags(_0x401e9b,_0x2271ad){var _0x3a929c=[];if(_0x401e9b&&_0x401e9b[_0x00f0('0x2a')]>0x0){_0x3a929c=_[_0x00f0('0x2b')](_0x401e9b,_0x2271ad);}return _0x3a929c;}function getCustomFields(_0x385a7a,_0x16f2dc){var _0x234fab=[];var _0xe82f3={'custom_fields':{}};if(_0x385a7a['length']>0x0){_[_0x00f0('0x2c')](_0x385a7a,function(_0xcbf323){if(_0xcbf323[_0x00f0('0x2d')]===_0x00f0('0x2e')&&_0xcbf323[_0x00f0('0x2f')]&&!_0xcbf323['customField']){_0xe82f3[_0xcbf323[_0x00f0('0x2f')][_0x00f0('0x30')]()]=_0xcbf323[_0x00f0('0x31')]['toString']();}else if(_0xcbf323[_0x00f0('0x2d')]===_0x00f0('0x2e')&&_0xcbf323[_0x00f0('0x32')]&&_0xcbf323['customField']){_0xe82f3['custom_fields'][_0xcbf323[_0x00f0('0x32')]]=_0xcbf323[_0x00f0('0x31')][_0x00f0('0x33')]();}else if(_0xcbf323[_0x00f0('0x2d')]==='variable'&&_0xcbf323[_0x00f0('0x34')]&&_0xcbf323[_0x00f0('0x32')]&&_0xcbf323['customField']){_0x16f2dc[_0xcbf323['variableName']]&&(_0xe82f3['custom_fields'][_0xcbf323[_0x00f0('0x32')]]=_0x16f2dc[_0xcbf323[_0x00f0('0x34')]][_0x00f0('0x33')]());}else if(_0xcbf323['type']==='customVariable'&&_0xcbf323['Variable']&&_0xcbf323[_0x00f0('0x35')][_0x00f0('0x36')]&&_0xcbf323[_0x00f0('0x32')]&&_0xcbf323['customField']){_0x16f2dc[_0xcbf323[_0x00f0('0x35')][_0x00f0('0x36')]['toLowerCase']()]&&(_0xe82f3['custom_fields'][_0xcbf323[_0x00f0('0x32')]]=_0x16f2dc[_0xcbf323['Variable']['name'][_0x00f0('0x30')]()][_0x00f0('0x33')]());}});}if(_0xe82f3[_0x00f0('0x37')]){_0xe82f3[_0x00f0('0x37')]=Number(_0xe82f3[_0x00f0('0x37')]);}return _0xe82f3;}function getTicket(_0x1c12a2,_0x477a0c,_0x1b1235,_0x437aa1,_0x3be760){logger['info'](_0x00f0('0x38'));var _0x4f452=_[_0x00f0('0x39')]({'subject':intUtil[_0x00f0('0x3a')](_0x437aa1[_0x00f0('0x3b')],_0x3be760,'\x20'),'type':_0x00f0('0x3c'),'status':_0x00f0('0x3d'),'labels':[_0x00f0('0x3e'),_0x00f0('0x3f'),_0x00f0('0x40')]['concat'](getTags(_0x437aa1['Tags'],_0x00f0('0x36'))),'description':intUtil[_0x00f0('0x3a')](_0x437aa1[_0x00f0('0x41')],_0x3be760,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x477a0c['id']),'class':_0x00f0('0x42')}},'message':{'direction':'in','body':intUtil[_0x00f0('0x3a')](_0x437aa1[_0x00f0('0x41')],_0x3be760,'\x0a')}},getCustomFields(_0x437aa1[_0x00f0('0x43')],_0x3be760));return request({'uri':util[_0x00f0('0xf')](_0x00f0('0x44'),_0x1c12a2[_0x00f0('0x19')],_0x1b1235['id']),'method':'POST','body':_0x4f452});}exports[_0x00f0('0x45')]=function(_0x49dc5f,_0x3705a2,_0x22a2df,_0x499da3,_0x6cb323,_0x53a79f){var _0x534791,_0x4b6486;_0x53a79f[_0x00f0('0x19')]=intUtil['stripTrailingSlash'](_0x53a79f['remoteUri']);_0x53a79f[_0x00f0('0x46')]=intUtil[_0x00f0('0x47')](_0x53a79f['serverUrl']);if(_0x6cb323&&_0x6cb323['monitor_format']){logger[_0x00f0('0xd')]('[QUEUE]',_0x00f0('0x48'));_0x3705a2[_0x00f0('0x49')]=util[_0x00f0('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x53a79f[_0x00f0('0x46')],_0x3705a2['uniqueid'],md5(_0x3705a2[_0x00f0('0x4a')]));}else{_0x3705a2[_0x00f0('0x49')]='';}headers[_0x00f0('0x4b')]=getAuth(_0x53a79f);return getUser(_0x53a79f,_0x499da3['email'])[_0x00f0('0x11')](function(_0x5df721){_0x534791=_0x5df721;logger[_0x00f0('0xd')](_0x00f0('0x4c'),_0x534791['id']);return getEndUser(_0x53a79f,_0x3705a2[_0x00f0('0x4d')],_0x3705a2[_0x00f0('0x4e')]);})[_0x00f0('0x11')](function(_0x154afe){_0x4b6486=_0x154afe;logger[_0x00f0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4b6486['id']);return getTicket(_0x53a79f,_0x534791,_0x4b6486,_0x22a2df,_0x3705a2);})[_0x00f0('0x11')](function(_0x1baa2b){if(_0x1baa2b){logger[_0x00f0('0xd')](_0x00f0('0x4f'));logger[_0x00f0('0xd')](_0x00f0('0x50'),_0x1baa2b['id']);switch(_0x53a79f['type']){case'integrationTab':logger['info'](_0x00f0('0x51'),_0x00f0('0x52'));emit(util[_0x00f0('0xf')]('user:%s',_0x499da3['name']),'trigger:desk:display',{'recordId':_0x1baa2b['id']});break;case _0x00f0('0x53'):logger['info'](_0x00f0('0x51'),_0x00f0('0x54'));emit(util[_0x00f0('0xf')](_0x00f0('0x55'),_0x499da3[_0x00f0('0x36')]),'trigger:browser:url',{'uri':util[_0x00f0('0xf')](_0x00f0('0x56'),_0x1baa2b['id'])});break;default:logger[_0x00f0('0x57')](_0x00f0('0x51'),_0x00f0('0x58'));}}})[_0x00f0('0x59')](function(_0x122a5b){console[_0x00f0('0x57')](_0x122a5b);logger[_0x00f0('0x57')](_0x00f0('0x51'),JSON[_0x00f0('0x1c')](_0x122a5b));});};exports[_0x00f0('0x5a')]=function(_0x5667a5,_0x1282df,_0x2a0530,_0x27349d,_0x2fea91,_0xc43b05,_0x1f13f7){var _0x5d316a,_0x721bd8;_0xc43b05[_0x00f0('0x19')]=intUtil[_0x00f0('0x47')](_0xc43b05[_0x00f0('0x19')]);_0xc43b05[_0x00f0('0x46')]=intUtil['stripTrailingSlash'](_0xc43b05[_0x00f0('0x46')]);if(_0x1f13f7&&_0x1f13f7[_0x00f0('0x5b')]&&_0x1f13f7[_0x00f0('0x5b')]!==_0x00f0('0x5c')){logger['info']('[OUTBOUND]',_0x00f0('0x48'));_0x1282df['recordingURL']=util['format'](_0x00f0('0x5d'),_0xc43b05[_0x00f0('0x46')],_0x1282df[_0x00f0('0x4a')],md5(_0x1282df['uniqueid']));}headers[_0x00f0('0x4b')]=getAuth(_0xc43b05);return getUser(_0xc43b05,_0x27349d[_0x00f0('0x5e')])[_0x00f0('0x11')](function(_0x443685){_0x5d316a=_0x443685;logger['info'](_0x00f0('0x4c'),_0x5d316a['id']);return getEndUser(_0xc43b05,_0x1282df[_0x00f0('0x5f')],_0x1282df[_0x00f0('0x60')]);})['then'](function(_0x3842bd){_0x721bd8=_0x3842bd;logger[_0x00f0('0xd')](_0x00f0('0x61'),_0x721bd8['id']);return getTicket(_0xc43b05,_0x5d316a,_0x721bd8,_0x2a0530,_0x1282df);})['then'](function(_0x5e4644){if(_0x5e4644){logger[_0x00f0('0xd')](_0x00f0('0x4f'));logger[_0x00f0('0xd')](_0x00f0('0x50'),_0x5e4644['id']);switch(_0xc43b05[_0x00f0('0x2d')]){case _0x00f0('0x62'):logger['info'](_0x00f0('0x51'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x00f0('0xf')]('user:%s',_0x27349d[_0x00f0('0x36')]),_0x00f0('0x63'),{'recordId':_0x5e4644['id']});break;case _0x00f0('0x53'):logger[_0x00f0('0xd')](_0x00f0('0x51'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x00f0('0xf')](_0x00f0('0x55'),_0x27349d[_0x00f0('0x36')]),_0x00f0('0x64'),{'uri':util['format'](_0x00f0('0x65'),_0xc43b05[_0x00f0('0x19')],_0x5e4644['id'])});break;default:logger[_0x00f0('0x57')](_0x00f0('0x66'),_0x00f0('0x58'));}}})[_0x00f0('0x59')](function(_0x2b6551){logger[_0x00f0('0x57')](_0x00f0('0x66'),JSON[_0x00f0('0x1c')](_0x2b6551));});};exports['abandoned']=function(_0x741a90,_0x5a3219,_0x444d63,_0x13e9d4,_0x3dd1d8,_0x2c6bee){var _0x5d7622,_0x25e9ac;_0x2c6bee[_0x00f0('0x19')]=intUtil['stripTrailingSlash'](_0x2c6bee['remoteUri']);_0x2c6bee[_0x00f0('0x46')]=intUtil[_0x00f0('0x47')](_0x2c6bee[_0x00f0('0x46')]);if(_0x3dd1d8&&_0x3dd1d8['monitor_format']){logger[_0x00f0('0xd')](_0x00f0('0x67'),'Recording\x20is\x20enabled!');_0x5a3219[_0x00f0('0x49')]=util[_0x00f0('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2c6bee['serverUrl'],_0x5a3219[_0x00f0('0x4a')],md5(_0x5a3219['uniqueid']));}else{_0x5a3219[_0x00f0('0x49')]='';}headers[_0x00f0('0x4b')]=getAuth(_0x2c6bee);return getUser(_0x2c6bee)[_0x00f0('0x11')](function(_0x286753){_0x5d7622=_0x286753;logger[_0x00f0('0xd')](_0x00f0('0x4c'),_0x5d7622['id']);return getEndUser(_0x2c6bee,_0x5a3219[_0x00f0('0x4d')],_0x5a3219['calleridnum']);})[_0x00f0('0x11')](function(_0xeed15a){_0x25e9ac=_0xeed15a;logger[_0x00f0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x25e9ac['id']);return getTicket(_0x2c6bee,_0x5d7622,_0x25e9ac,_0x444d63,_0x5a3219);})['then'](function(_0x32ec8c){if(_0x32ec8c){logger[_0x00f0('0xd')](_0x00f0('0x4f'));logger[_0x00f0('0xd')](_0x00f0('0x50'),_0x32ec8c['id']);}})[_0x00f0('0x59')](function(_0x71a67b){logger[_0x00f0('0x57')]('[ABANDONED]',JSON['stringify'](_0x71a67b));});}; \ 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 20b4310..25e087c 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 _0xd33b=['Fields','phonecalls','assign','callDirection','queue','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','abandoned','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','recordingURL','recordingFormat',']\x20The\x20User\x20email\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','localhost','socket.io-emitter','redis','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','outbound','calleridnum','contacts','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1','toLowerCase','destcalleridnum','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','string','customField','idField','substring','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','/systemusers('];(function(_0xd46a4e,_0x55ef0c){var _0x114b42=function(_0x2f0040){while(--_0x2f0040){_0xd46a4e['push'](_0xd46a4e['shift']());}};_0x114b42(++_0x55ef0c);}(_0xd33b,0x74));var _0xbd33=function(_0x591bfd,_0x2bd2e4){_0x591bfd=_0x591bfd-0x0;var _0x4f6910=_0xd33b[_0x591bfd];return _0x4f6910;};'use strict';var _=require(_0xbd33('0x0'));var BPromise=require(_0xbd33('0x1'));var rp=require('request-promise');var util=require(_0xbd33('0x2'));var intUtil=require(_0xbd33('0x3'));var md5=require(_0xbd33('0x4'));var Redis=require(_0xbd33('0x5'));var logger=require(_0xbd33('0x6'))(_0xbd33('0x7'));var config=require(_0xbd33('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0xbd33('0x9'),'port':0x18eb});var io=require(_0xbd33('0xa'))(new Redis(config[_0xbd33('0xb')]));function getAuthToken(_0x373731,_0x183ef0,_0x594d5b){var _0x142715={'method':_0xbd33('0xc'),'uri':_0x183ef0,'form':{'client_id':_0x373731[_0xbd33('0xd')],'resource':_0x373731[_0xbd33('0xe')],'username':_0x373731[_0xbd33('0xf')],'password':_0x373731['password'],'grant_type':_0xbd33('0x10'),'client_secret':_0x373731[_0xbd33('0x11')]},'json':!![]};return rp(_0x142715)[_0xbd33('0x12')](function(_0x8c92fc){return _0x8c92fc[_0xbd33('0x13')];})[_0xbd33('0x14')](function(_0x3a49b3){logger[_0xbd33('0x15')]('['+[_0x594d5b[_0xbd33('0x16')]()]+_0xbd33('0x17'));return _0x3a49b3[_0xbd33('0x18')];});}function getUser(_0xa954a0,_0x4387aa,_0xc39806,_0x107349,_0x2f0cf4,_0x4d492a){return new BPromise(function(_0x265473,_0x65bb01){return getAuthToken(_0x4387aa,_0x107349,_0x4d492a)['then'](function(_0x147601){var _0x57e05f={'method':_0xbd33('0x19'),'uri':_0x2f0cf4+_0xbd33('0x1a'),'headers':{'Authorization':_0xbd33('0x1b')+_0x147601,'OData-Version':_0xbd33('0x1c')},'json':!![]};return rp(_0x57e05f);})[_0xbd33('0x12')](function(_0x16e92d){var _0x3f1e35=_0x16e92d[_0xbd33('0x1d')];var _0x1058a7=![];var _0x2d78f0=null;if(!_[_0xbd33('0x1e')](_0xc39806)){if(intUtil['validateEmail'](_0xc39806[_0xbd33('0x1f')])){_0xa954a0[_0xbd33('0x20')]=_0xc39806[_0xbd33('0x1f')];for(_0x2d78f0=0x0;_0x2d78f0<_0x3f1e35[_0xbd33('0x21')];_0x2d78f0++){if(_0x3f1e35[_0x2d78f0][_0xbd33('0x22')]===_0xc39806[_0xbd33('0x1f')]&&!_0x3f1e35[_0x2d78f0]['isdisabled']){_0x1058a7=!![];logger[_0xbd33('0x23')]('['+[_0x4d492a['toUpperCase']()]+_0xbd33('0x24')+_0x3f1e35[_0x2d78f0][_0xbd33('0x25')]+'!');_0xa954a0['userId']=_0x3f1e35[_0x2d78f0][_0xbd33('0x25')];}}}}if(!_0x1058a7){logger[_0xbd33('0x23')]('['+[_0x4d492a[_0xbd33('0x16')]()]+_0xbd33('0x26'));_0xa954a0['userEmail']=_0x4387aa[_0xbd33('0xf')];for(_0x2d78f0=0x0;_0x2d78f0<_0x3f1e35['length'];_0x2d78f0++){if(_0x3f1e35[_0x2d78f0][_0xbd33('0x22')]===_0x4387aa['username']){_0xa954a0[_0xbd33('0x27')]=_0x3f1e35[_0x2d78f0]['systemuserid'];}}}_0x265473(_0xa954a0);})['catch'](function(_0x2b3c9f){_0x65bb01(_0x2b3c9f[_0xbd33('0x18')]);});});}function createEndUser(_0x2b24a8,_0x36d81a,_0x5c2bbc,_0x5716a4,_0xdaa5dc,_0x590f8e){return new BPromise(function(_0x39c78e,_0x1b79f5){return getAuthToken(_0x36d81a,_0x5c2bbc,_0x590f8e)[_0xbd33('0x12')](function(_0x23dd69){var _0xee15e=_0x590f8e['toLowerCase']()===_0xbd33('0x28')?_0xdaa5dc['destcalleridnum']:_0xdaa5dc[_0xbd33('0x29')];var _0x43d1cf={'method':_0xbd33('0xc'),'uri':_0x5716a4+_0xbd33('0x2a'),'body':{'telephone1':_0xee15e,'fullname':_0xee15e,'firstname':_0xee15e,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x2b24a8[_0xbd33('0x27')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x23dd69,'OData-Version':_0xbd33('0x1c')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x43d1cf);})[_0xbd33('0x12')](function(_0x3b82fd){var _0x51c09c=_0x3b82fd['headers'][_0xbd33('0x2b')];var _0xe0e9d0=_0x51c09c['substring'](_0x51c09c[_0xbd33('0x2c')]('(')+0x1,_0x51c09c['lastIndexOf'](')'));_0x2b24a8[_0xbd33('0x2d')]=_0xe0e9d0;_0x39c78e(_0x2b24a8);})[_0xbd33('0x14')](function(_0x3e197f){_0x1b79f5(_0x3e197f[_0xbd33('0x18')]);});});}function getEndUser(_0x414065,_0x4fa236,_0xcb0b1b,_0x2e9a0,_0x14f3af,_0x12f4bb){return new BPromise(function(_0x28a2b6,_0x788055){return getAuthToken(_0x4fa236,_0xcb0b1b,_0x12f4bb)[_0xbd33('0x12')](function(_0x1f34f3){var _0x524b26={'method':_0xbd33('0x19'),'uri':_0x2e9a0+_0xbd33('0x2e'),'headers':{'Authorization':_0xbd33('0x1b')+_0x1f34f3,'If-None-Match':null,'OData-Version':_0xbd33('0x1c')},'json':!![]};return rp(_0x524b26);})[_0xbd33('0x12')](function(_0x3266e7){var _0x361082=null;if(_0x3266e7){var _0x4ed394=_0x3266e7[_0xbd33('0x1d')];var _0x461d3b=![];for(_0x361082=0x0;_0x361082<_0x4ed394[_0xbd33('0x21')];_0x361082++){var _0x3b6ecf=_0x12f4bb[_0xbd33('0x2f')]()===_0xbd33('0x28')?_0x14f3af[_0xbd33('0x30')]:_0x14f3af[_0xbd33('0x29')];if(_0x4ed394[_0x361082][_0xbd33('0x31')]===_0x3b6ecf){_0x461d3b=!![];_0x414065[_0xbd33('0x2d')]=_0x4ed394[_0x361082][_0xbd33('0x32')];}}if(_0x461d3b){_0x28a2b6(_0x414065);}else{return createEndUser(_0x414065,_0x4fa236,_0xcb0b1b,_0x2e9a0,_0x14f3af,_0x12f4bb)[_0xbd33('0x12')](function(_0x58a134){logger[_0xbd33('0x23')]('['+[_0x12f4bb[_0xbd33('0x16')]()]+_0xbd33('0x33'),_0x58a134[_0xbd33('0x2d')]);_0x28a2b6(_0x58a134);});}}else{return createEndUser(_0x414065,_0x4fa236,_0xcb0b1b,_0x2e9a0,_0x14f3af,_0x12f4bb)['then'](function(_0x14d198){logger[_0xbd33('0x23')]('['+[_0x12f4bb[_0xbd33('0x16')]()]+_0xbd33('0x34'),_0x14d198[_0xbd33('0x2d')]);_0x28a2b6(_0x14d198);});}});});}function getCustomFields(_0x346355,_0x42179a,_0xbc47fc){var _0x364224={};if(_0x346355[_0xbd33('0x21')]>0x0){_['forEach'](_0x346355,function(_0x20b018){if(_0x20b018[_0xbd33('0x35')]===_0xbd33('0x36')&&_0x20b018['nameField']&&!_0x20b018[_0xbd33('0x37')]){var _0x5ce896=_0x20b018[_0xbd33('0x38')][_0xbd33('0x2f')]();var _0x15a53d=_0x5ce896[_0xbd33('0x39')](0x0,_0x5ce896['indexOf']('_'));var _0x51c088=_0x5ce896[_0xbd33('0x39')](_0x5ce896[_0xbd33('0x3a')]('_')+0x1);if(_0x15a53d===_0xbc47fc){_0x364224[_0x51c088]=_0x20b018[_0xbd33('0x3b')];}}});}return _0x364224;}function getTicket(_0x4e1f41,_0x3fc32f,_0x515218,_0x30d10b,_0x41dc34,_0x3f4171,_0x4ca757){return new BPromise(function(_0x25c047,_0x26f6be){var _0x3f94ae;return getAuthToken(_0x3fc32f,_0x515218,_0x4ca757)[_0xbd33('0x12')](function(_0x355030){if(_0x3f4171[_0xbd33('0x3c')]===_0xbd33('0x3d')){_0x3f94ae={'method':_0xbd33('0xc'),'uri':_0x30d10b+_0xbd33('0x3e'),'body':Object['assign']({},{'title':intUtil[_0xbd33('0x3f')](_0x3f4171[_0xbd33('0x40')],_0x41dc34,'\x20'),'description':intUtil['getString'](_0x3f4171[_0xbd33('0x41')],_0x41dc34,'\x0a'),'customerid_contact@odata.bind':_0xbd33('0x42')+_0x4e1f41[_0xbd33('0x2d')]+')','ownerid@odata.bind':_0xbd33('0x43')+_0x4e1f41[_0xbd33('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x3f4171[_0xbd33('0x44')],_0x41dc34,_0x3f4171['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x355030,'OData-Version':_0xbd33('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3f4171['ticketType']==='phonecall'){_0x3f94ae={'method':_0xbd33('0xc'),'uri':_0x30d10b+_0xbd33('0x45'),'body':Object[_0xbd33('0x46')]({},{'subject':intUtil[_0xbd33('0x3f')](_0x3f4171[_0xbd33('0x40')],_0x41dc34,'\x20'),'phonenumber':String(_0x41dc34[_0xbd33('0x29')]),'description':intUtil[_0xbd33('0x3f')](_0x3f4171[_0xbd33('0x41')],_0x41dc34,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbd33('0x42')+_0x4e1f41[_0xbd33('0x2d')]+')','ownerid@odata.bind':_0xbd33('0x43')+_0x4e1f41[_0xbd33('0x27')]+')','directioncode':_0x4e1f41[_0xbd33('0x47')]===_0xbd33('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xbd33('0x43')+_0x4e1f41[_0xbd33('0x27')]+')','participationtypemask':_0x4e1f41['callDirection']===_0xbd33('0x48')?0x2:0x1},{'partyid_contact@odata.bind':_0xbd33('0x42')+_0x4e1f41[_0xbd33('0x2d')]+')','participationtypemask':_0x4e1f41[_0xbd33('0x47')]==='queue'?0x1:0x2}]},getCustomFields(_0x3f4171[_0xbd33('0x44')],_0x41dc34,_0x3f4171[_0xbd33('0x3c')])),'headers':{'Authorization':_0xbd33('0x1b')+_0x355030,'OData-Version':_0xbd33('0x1c')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3f94ae);})['then'](function(_0x5fce5a){var _0x28cd80=_0x5fce5a[_0xbd33('0x49')]['odata-entityid'];var _0x27d1f8=_0x28cd80[_0xbd33('0x39')](_0x28cd80['lastIndexOf']('(')+0x1,_0x28cd80[_0xbd33('0x2c')](')'));_0x4e1f41[_0xbd33('0x4a')]=_0x27d1f8;_0x25c047(_0x4e1f41);})[_0xbd33('0x14')](function(_0x132130){_0x26f6be(_0x132130[_0xbd33('0x18')]);});});}function emit(_0x313046,_0x46e697,_0x51697b,_0xbc6c89){var _0xc29774={'uri':util[_0xbd33('0x4b')](_0xbd33('0x4c'),_0x313046,_0x51697b,_0xbc6c89)};io['to'](util[_0xbd33('0x4b')](_0xbd33('0x4d'),_0x46e697))[_0xbd33('0x4e')](_0xbd33('0x4f'),_0xc29774);}exports['cs']=function(_0x5d9774,_0x40733e,_0x49048e,_0x3e5cb2,_0x401ad9,_0x107ced,_0x506e01,_0x29fa47){var _0x350573={};_0x107ced[_0xbd33('0xe')]=intUtil['stripTrailingSlash'](_0x107ced[_0xbd33('0xe')]);_0x107ced[_0xbd33('0x50')]=intUtil[_0xbd33('0x51')](_0x107ced[_0xbd33('0x50')]);_0x350573['callDirection']=_0x29fa47===_0xbd33('0x48')||_0x29fa47===_0xbd33('0x52')?_0xbd33('0x48'):_0xbd33('0x28');var _0x30d79f=util['format']('%s/api/data/v9.0/',_0x107ced[_0xbd33('0xe')]);var _0x34090c=util[_0xbd33('0x4b')](_0xbd33('0x53'),_0x107ced['tenantId']);var _0x8925e9=util[_0xbd33('0x4b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x107ced[_0xbd33('0x50')],_0x40733e[_0xbd33('0x54')],md5(_0x40733e[_0xbd33('0x54')]));if(_0x401ad9&&_0x401ad9[_0xbd33('0x55')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x40733e[_0xbd33('0x56')]=_0x8925e9;}else if(_0x506e01&&_0x506e01[_0xbd33('0x57')]&&_0x506e01[_0xbd33('0x57')]!=='none'){logger[_0xbd33('0x23')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x40733e['recordingURL']=_0x8925e9;}else{_0x40733e[_0xbd33('0x56')]='';}return getUser(_0x350573,_0x107ced,_0x3e5cb2,_0x34090c,_0x30d79f,_0x29fa47)[_0xbd33('0x12')](function(_0x13a1e1){logger[_0xbd33('0x23')]('['+_0x29fa47[_0xbd33('0x16')]()+']\x20The\x20User\x20ID\x20is:',_0x13a1e1[_0xbd33('0x27')]);logger[_0xbd33('0x23')]('['+_0x29fa47[_0xbd33('0x16')]()+_0xbd33('0x58'),_0x13a1e1[_0xbd33('0x20')]);return getEndUser(_0x13a1e1,_0x107ced,_0x34090c,_0x30d79f,_0x40733e,_0x29fa47);})[_0xbd33('0x12')](function(_0xd82cd1){logger['info']('['+_0x29fa47[_0xbd33('0x16')]()+']\x20The\x20Enduser\x20ID\x20is:',_0xd82cd1[_0xbd33('0x2d')]);logger[_0xbd33('0x23')]('['+_0x29fa47['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x40733e[_0xbd33('0x29')]);return getTicket(_0xd82cd1,_0x107ced,_0x34090c,_0x30d79f,_0x40733e,_0x49048e,_0x29fa47);})[_0xbd33('0x12')](function(_0x1f8cf4){logger['info'](util[_0xbd33('0x4b')]('['+_0x29fa47[_0xbd33('0x16')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x49048e[_0xbd33('0x3c')],_0x1f8cf4['ticketId']));logger[_0xbd33('0x23')](util[_0xbd33('0x4b')]('['+_0x29fa47[_0xbd33('0x16')]()+']\x20Call\x20direction:\x20%s',_0x29fa47));if(_0x29fa47!=='abandoned'){logger[_0xbd33('0x23')]('['+_0x29fa47[_0xbd33('0x16')]()+']',_0xbd33('0x59'));emit(_0x107ced[_0xbd33('0xe')],_0x3e5cb2['name'],_0x49048e[_0xbd33('0x3c')],_0x1f8cf4[_0xbd33('0x4a')]);}})['catch'](function(_0xf28e20){logger['error']('['+_0x29fa47['toUpperCase']()+_0xbd33('0x5a'),util[_0xbd33('0x5b')](_0xf28e20,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc9f4=['catch','error','toUpperCase',']\x20Wrong\x20credentials!','GET','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','message','toLowerCase','destcalleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','outbound','calleridnum','telephone1','contactid','type','nameField','indexOf','content','ticketType','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','phonecalls','Subjects','callDirection','queue','ticketId','format','user:%s','emit','trigger:browser:url','serverUrl','abandoned','%s/api/data/v9.0/','tenantId','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','then','access_token'];(function(_0x41a531,_0x563fa6){var _0x164b35=function(_0x5db756){while(--_0x5db756){_0x41a531['push'](_0x41a531['shift']());}};_0x164b35(++_0x563fa6);}(_0xc9f4,0x1cc));var _0x4c9f=function(_0xbbb22,_0x4d6a3c){_0xbbb22=_0xbbb22-0x0;var _0x5c6905=_0xc9f4[_0xbbb22];return _0x5c6905;};'use strict';var _=require(_0x4c9f('0x0'));var BPromise=require('bluebird');var rp=require(_0x4c9f('0x1'));var util=require(_0x4c9f('0x2'));var intUtil=require(_0x4c9f('0x3'));var md5=require(_0x4c9f('0x4'));var Redis=require(_0x4c9f('0x5'));var logger=require(_0x4c9f('0x6'))(_0x4c9f('0x7'));var config=require(_0x4c9f('0x8'));config['redis']=_[_0x4c9f('0x9')](config[_0x4c9f('0xa')],{'host':_0x4c9f('0xb'),'port':0x18eb});var io=require(_0x4c9f('0xc'))(new Redis(config['redis']));function getAuthToken(_0x39a70a,_0x47c142,_0x3c7f92){var _0x55745c={'method':_0x4c9f('0xd'),'uri':_0x47c142,'form':{'client_id':_0x39a70a[_0x4c9f('0xe')],'resource':_0x39a70a[_0x4c9f('0xf')],'username':_0x39a70a['username'],'password':_0x39a70a[_0x4c9f('0x10')],'grant_type':_0x4c9f('0x10'),'client_secret':_0x39a70a[_0x4c9f('0x11')]},'json':!![]};return rp(_0x55745c)[_0x4c9f('0x12')](function(_0x4cbce7){return _0x4cbce7[_0x4c9f('0x13')];})[_0x4c9f('0x14')](function(_0x4bd5ae){logger[_0x4c9f('0x15')]('['+[_0x3c7f92[_0x4c9f('0x16')]()]+_0x4c9f('0x17'));return _0x4bd5ae['message'];});}function getUser(_0x5534ce,_0x2f6499,_0x4e870f,_0x118578,_0x5a23a0,_0x1238cd){return new BPromise(function(_0x4dfd2c,_0x3d5789){return getAuthToken(_0x2f6499,_0x118578,_0x1238cd)[_0x4c9f('0x12')](function(_0x2573ff){var _0x831d02={'method':_0x4c9f('0x18'),'uri':_0x5a23a0+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':'Bearer\x20'+_0x2573ff,'OData-Version':_0x4c9f('0x19')},'json':!![]};return rp(_0x831d02);})[_0x4c9f('0x12')](function(_0x559597){var _0x55a217=_0x559597[_0x4c9f('0x1a')];var _0x1a2f49=![];var _0x2f816f=null;if(!_[_0x4c9f('0x1b')](_0x4e870f)){if(intUtil[_0x4c9f('0x1c')](_0x4e870f[_0x4c9f('0x1d')])){_0x5534ce['userEmail']=_0x4e870f[_0x4c9f('0x1d')];for(_0x2f816f=0x0;_0x2f816f<_0x55a217[_0x4c9f('0x1e')];_0x2f816f++){if(_0x55a217[_0x2f816f][_0x4c9f('0x1f')]===_0x4e870f['email']&&!_0x55a217[_0x2f816f][_0x4c9f('0x20')]){_0x1a2f49=!![];logger['info']('['+[_0x1238cd[_0x4c9f('0x16')]()]+_0x4c9f('0x21')+_0x55a217[_0x2f816f][_0x4c9f('0x22')]+'!');_0x5534ce[_0x4c9f('0x23')]=_0x55a217[_0x2f816f][_0x4c9f('0x22')];}}}}if(!_0x1a2f49){logger[_0x4c9f('0x24')]('['+[_0x1238cd['toUpperCase']()]+_0x4c9f('0x25'));_0x5534ce[_0x4c9f('0x26')]=_0x2f6499[_0x4c9f('0x27')];for(_0x2f816f=0x0;_0x2f816f<_0x55a217['length'];_0x2f816f++){if(_0x55a217[_0x2f816f][_0x4c9f('0x1f')]===_0x2f6499[_0x4c9f('0x27')]){_0x5534ce[_0x4c9f('0x23')]=_0x55a217[_0x2f816f]['systemuserid'];}}}_0x4dfd2c(_0x5534ce);})[_0x4c9f('0x14')](function(_0x1cb1f7){_0x3d5789(_0x1cb1f7[_0x4c9f('0x28')]);});});}function createEndUser(_0x13c13e,_0x3af35d,_0x263459,_0x5a524d,_0x262f5c,_0x27e663){return new BPromise(function(_0x2f81ff,_0x1fcf19){return getAuthToken(_0x3af35d,_0x263459,_0x27e663)[_0x4c9f('0x12')](function(_0x126ccc){var _0x5ebb7b=_0x27e663[_0x4c9f('0x29')]()==='outbound'?_0x262f5c[_0x4c9f('0x2a')]:_0x262f5c['calleridnum'];var _0x5d73ff={'method':'POST','uri':_0x5a524d+'contacts','body':{'telephone1':_0x5ebb7b,'fullname':_0x5ebb7b,'firstname':_0x5ebb7b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4c9f('0x2b')+_0x13c13e['userId']+')'},'headers':{'Authorization':_0x4c9f('0x2c')+_0x126ccc,'OData-Version':_0x4c9f('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5d73ff);})[_0x4c9f('0x12')](function(_0x24f396){var _0x5a4620=_0x24f396[_0x4c9f('0x2d')][_0x4c9f('0x2e')];var _0x84451e=_0x5a4620[_0x4c9f('0x2f')](_0x5a4620[_0x4c9f('0x30')]('(')+0x1,_0x5a4620[_0x4c9f('0x30')](')'));_0x13c13e[_0x4c9f('0x31')]=_0x84451e;_0x2f81ff(_0x13c13e);})[_0x4c9f('0x14')](function(_0x5adf01){_0x1fcf19(_0x5adf01[_0x4c9f('0x28')]);});});}function getEndUser(_0x452f9d,_0x4aaff5,_0x5ce0b3,_0x400ecb,_0x444d4f,_0x54c2a1){return new BPromise(function(_0x9b9a03,_0x251710){return getAuthToken(_0x4aaff5,_0x5ce0b3,_0x54c2a1)[_0x4c9f('0x12')](function(_0x5b1f4f){var _0x3289c1={'method':_0x4c9f('0x18'),'uri':_0x400ecb+_0x4c9f('0x32'),'headers':{'Authorization':_0x4c9f('0x2c')+_0x5b1f4f,'If-None-Match':null,'OData-Version':_0x4c9f('0x19')},'json':!![]};return rp(_0x3289c1);})['then'](function(_0x1fa541){var _0x8f326a=null;if(_0x1fa541){var _0x2919a8=_0x1fa541[_0x4c9f('0x1a')];var _0xde2eb3=![];for(_0x8f326a=0x0;_0x8f326a<_0x2919a8['length'];_0x8f326a++){var _0x2fc58e=_0x54c2a1[_0x4c9f('0x29')]()===_0x4c9f('0x33')?_0x444d4f[_0x4c9f('0x2a')]:_0x444d4f[_0x4c9f('0x34')];if(_0x2919a8[_0x8f326a][_0x4c9f('0x35')]===_0x2fc58e){_0xde2eb3=!![];_0x452f9d[_0x4c9f('0x31')]=_0x2919a8[_0x8f326a][_0x4c9f('0x36')];}}if(_0xde2eb3){_0x9b9a03(_0x452f9d);}else{return createEndUser(_0x452f9d,_0x4aaff5,_0x5ce0b3,_0x400ecb,_0x444d4f,_0x54c2a1)[_0x4c9f('0x12')](function(_0x4db790){logger[_0x4c9f('0x24')]('['+[_0x54c2a1['toUpperCase']()]+']\x20Enduser\x20created!',_0x4db790[_0x4c9f('0x31')]);_0x9b9a03(_0x4db790);});}}else{return createEndUser(_0x452f9d,_0x4aaff5,_0x5ce0b3,_0x400ecb,_0x444d4f,_0x54c2a1)['then'](function(_0x6b1214){logger[_0x4c9f('0x24')]('['+[_0x54c2a1[_0x4c9f('0x16')]()]+']\x20Enduser\x20Created!',_0x6b1214['enduserId']);_0x9b9a03(_0x6b1214);});}});});}function getCustomFields(_0x26ccba,_0x5851d7,_0x572cc1){var _0x478b9f={};if(_0x26ccba[_0x4c9f('0x1e')]>0x0){_['forEach'](_0x26ccba,function(_0x3b6f2d){if(_0x3b6f2d[_0x4c9f('0x37')]==='string'&&_0x3b6f2d[_0x4c9f('0x38')]&&!_0x3b6f2d['customField']){var _0x46946b=_0x3b6f2d['idField'][_0x4c9f('0x29')]();var _0x4d4f2b=_0x46946b[_0x4c9f('0x2f')](0x0,_0x46946b[_0x4c9f('0x39')]('_'));var _0x225af2=_0x46946b[_0x4c9f('0x2f')](_0x46946b[_0x4c9f('0x39')]('_')+0x1);if(_0x4d4f2b===_0x572cc1){_0x478b9f[_0x225af2]=_0x3b6f2d[_0x4c9f('0x3a')];}}});}return _0x478b9f;}function getTicket(_0x151eda,_0x4c5596,_0x40a932,_0x55feef,_0x1eb361,_0x136c97,_0x223b11){return new BPromise(function(_0x31e2c7,_0xe2b9ad){var _0x17cca9;return getAuthToken(_0x4c5596,_0x40a932,_0x223b11)['then'](function(_0x189735){if(_0x136c97[_0x4c9f('0x3b')]===_0x4c9f('0x3c')){_0x17cca9={'method':_0x4c9f('0xd'),'uri':_0x55feef+_0x4c9f('0x3d'),'body':Object[_0x4c9f('0x3e')]({},{'title':intUtil['getString'](_0x136c97['Subjects'],_0x1eb361,'\x20'),'description':intUtil[_0x4c9f('0x3f')](_0x136c97[_0x4c9f('0x40')],_0x1eb361,'\x0a'),'customerid_contact@odata.bind':_0x4c9f('0x41')+_0x151eda[_0x4c9f('0x31')]+')','ownerid@odata.bind':_0x4c9f('0x2b')+_0x151eda['userId']+')','caseorigincode':'1'},getCustomFields(_0x136c97[_0x4c9f('0x42')],_0x1eb361,_0x136c97[_0x4c9f('0x3b')])),'headers':{'Authorization':_0x4c9f('0x2c')+_0x189735,'OData-Version':_0x4c9f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x136c97[_0x4c9f('0x3b')]==='phonecall'){_0x17cca9={'method':'POST','uri':_0x55feef+_0x4c9f('0x43'),'body':Object[_0x4c9f('0x3e')]({},{'subject':intUtil[_0x4c9f('0x3f')](_0x136c97[_0x4c9f('0x44')],_0x1eb361,'\x20'),'phonenumber':String(_0x1eb361[_0x4c9f('0x34')]),'description':intUtil[_0x4c9f('0x3f')](_0x136c97[_0x4c9f('0x40')],_0x1eb361,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4c9f('0x41')+_0x151eda[_0x4c9f('0x31')]+')','ownerid@odata.bind':_0x4c9f('0x2b')+_0x151eda[_0x4c9f('0x23')]+')','directioncode':_0x151eda[_0x4c9f('0x45')]===_0x4c9f('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4c9f('0x2b')+_0x151eda['userId']+')','participationtypemask':_0x151eda[_0x4c9f('0x45')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x151eda[_0x4c9f('0x31')]+')','participationtypemask':_0x151eda[_0x4c9f('0x45')]===_0x4c9f('0x46')?0x1:0x2}]},getCustomFields(_0x136c97['Fields'],_0x1eb361,_0x136c97[_0x4c9f('0x3b')])),'headers':{'Authorization':'Bearer\x20'+_0x189735,'OData-Version':_0x4c9f('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x17cca9);})['then'](function(_0x13cb65){var _0x2ab3a4=_0x13cb65[_0x4c9f('0x2d')]['odata-entityid'];var _0x1eed62=_0x2ab3a4[_0x4c9f('0x2f')](_0x2ab3a4['lastIndexOf']('(')+0x1,_0x2ab3a4['lastIndexOf'](')'));_0x151eda[_0x4c9f('0x47')]=_0x1eed62;_0x31e2c7(_0x151eda);})[_0x4c9f('0x14')](function(_0x14f403){_0xe2b9ad(_0x14f403[_0x4c9f('0x28')]);});});}function emit(_0x5512dc,_0x47c741,_0x213522,_0x1e23ea){var _0x19dc35={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5512dc,_0x213522,_0x1e23ea)};io['to'](util[_0x4c9f('0x48')](_0x4c9f('0x49'),_0x47c741))[_0x4c9f('0x4a')](_0x4c9f('0x4b'),_0x19dc35);}exports['cs']=function(_0x7b8c57,_0x88b9f2,_0x376987,_0x5016fc,_0x50e827,_0x576f7a,_0xe5155e,_0x35e9be){var _0x5b98cd={};_0x576f7a[_0x4c9f('0xf')]=intUtil['stripTrailingSlash'](_0x576f7a['remoteUri']);_0x576f7a[_0x4c9f('0x4c')]=intUtil['stripTrailingSlash'](_0x576f7a[_0x4c9f('0x4c')]);_0x5b98cd['callDirection']=_0x35e9be===_0x4c9f('0x46')||_0x35e9be===_0x4c9f('0x4d')?_0x4c9f('0x46'):_0x4c9f('0x33');var _0x2c92e6=util[_0x4c9f('0x48')](_0x4c9f('0x4e'),_0x576f7a[_0x4c9f('0xf')]);var _0xcd972=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x576f7a[_0x4c9f('0x4f')]);var _0x474066=util[_0x4c9f('0x48')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x576f7a[_0x4c9f('0x4c')],_0x88b9f2['uniqueid'],md5(_0x88b9f2['uniqueid']));if(_0x50e827&&_0x50e827['monitor_format']){logger[_0x4c9f('0x24')](_0x4c9f('0x50'),_0x4c9f('0x51'));_0x88b9f2[_0x4c9f('0x52')]=_0x474066;}else if(_0xe5155e&&_0xe5155e[_0x4c9f('0x53')]&&_0xe5155e[_0x4c9f('0x53')]!==_0x4c9f('0x54')){logger[_0x4c9f('0x24')](_0x4c9f('0x55'),_0x4c9f('0x51'));_0x88b9f2[_0x4c9f('0x52')]=_0x474066;}else{_0x88b9f2[_0x4c9f('0x52')]='';}return getUser(_0x5b98cd,_0x576f7a,_0x5016fc,_0xcd972,_0x2c92e6,_0x35e9be)[_0x4c9f('0x12')](function(_0x26682c){logger[_0x4c9f('0x24')]('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x56'),_0x26682c[_0x4c9f('0x23')]);logger[_0x4c9f('0x24')]('['+_0x35e9be['toUpperCase']()+_0x4c9f('0x57'),_0x26682c['userEmail']);return getEndUser(_0x26682c,_0x576f7a,_0xcd972,_0x2c92e6,_0x88b9f2,_0x35e9be);})[_0x4c9f('0x12')](function(_0x4a4801){logger['info']('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x58'),_0x4a4801[_0x4c9f('0x31')]);logger['info']('['+_0x35e9be['toUpperCase']()+_0x4c9f('0x59'),_0x88b9f2[_0x4c9f('0x34')]);return getTicket(_0x4a4801,_0x576f7a,_0xcd972,_0x2c92e6,_0x88b9f2,_0x376987,_0x35e9be);})[_0x4c9f('0x12')](function(_0x3b06cc){logger['info'](util[_0x4c9f('0x48')]('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x5a'),_0x376987['ticketType'],_0x3b06cc[_0x4c9f('0x47')]));logger[_0x4c9f('0x24')](util[_0x4c9f('0x48')]('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x5b'),_0x35e9be));if(_0x35e9be!==_0x4c9f('0x4d')){logger[_0x4c9f('0x24')]('['+_0x35e9be['toUpperCase']()+']',_0x4c9f('0x5c'));emit(_0x576f7a['remoteUri'],_0x5016fc[_0x4c9f('0x5d')],_0x376987['ticketType'],_0x3b06cc[_0x4c9f('0x47')]);}})[_0x4c9f('0x14')](function(_0x5c4775){logger['error']('['+_0x35e9be[_0x4c9f('0x16')]()+_0x4c9f('0x5e'),util[_0x4c9f('0x5f')](_0x5c4775,{'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 9e617de..104b858 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 _0x167e=['application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','value','%s/api/v2/tickets','remoteUri','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','POST','Enduser\x20created.','Basic\x20%s','toString','base64','stringify','defaults','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','stripTrailingSlash','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/helpdesk/tickets/%d','[OUTBOUND]','calleridname','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','socket.io-emitter'];(function(_0x4f25a6,_0x1369c5){var _0x14232d=function(_0x2a0d85){while(--_0x2a0d85){_0x4f25a6['push'](_0x4f25a6['shift']());}};_0x14232d(++_0x1369c5);}(_0x167e,0x166));var _0xe167=function(_0x17d87c,_0x4564f0){_0x17d87c=_0x17d87c-0x0;var _0x15e661=_0x167e[_0x17d87c];return _0x15e661;};'use strict';var _=require(_0xe167('0x0'));var rp=require(_0xe167('0x1'));var md5=require(_0xe167('0x2'));var util=require(_0xe167('0x3'));var Redis=require(_0xe167('0x4'));var intUtil=require(_0xe167('0x5'));var config=require(_0xe167('0x6'));var logger=require('../../../../config/logger')(_0xe167('0x7'));config[_0xe167('0x8')]=_['defaults'](config[_0xe167('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xe167('0x9'))(new Redis(config[_0xe167('0x8')]));var headers={'Content-Type':_0xe167('0xa'),'Accept':_0xe167('0xa')};function emit(_0x2f1369,_0x2e7fc5,_0x44c74f){io['to'](_0x2f1369)[_0xe167('0xb')](_0x2e7fc5,_0x44c74f);}function getTicket(_0xe5b99e,_0x265c7,_0xf86279,_0xc72b18,_0x228597){logger[_0xe167('0xc')](_0xe167('0xd'));var _0x455969=_[_0xe167('0xe')]({'responder_id':_0x265c7['id'],'requester_id':_0xf86279['id'],'name':util[_0xe167('0xf')](_0xe167('0x10'),_0x228597['calleridname']),'phone':_0x228597[_0xe167('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe167('0x12')](_0xc72b18[_0xe167('0x13')],_0x228597,'\x20'),'description':intUtil[_0xe167('0x12')](_0xc72b18[_0xe167('0x14')],_0x228597,_0xe167('0x15')),'tags':getTags(_0xc72b18[_0xe167('0x16')],_0xe167('0x17'))},getCustomFields(_0xc72b18[_0xe167('0x18')],_0x228597));_0x455969['custom_fields']=_[_0xe167('0x19')](_['keyBy'](_0x455969['custom_fields'],'id'),_0xe167('0x1a'));return request({'uri':util[_0xe167('0xf')](_0xe167('0x1b'),_0xe5b99e[_0xe167('0x1c')]),'method':'POST','body':_0x455969})['then'](function(_0x13aed1){logger[_0xe167('0xc')](_0xe167('0x1d'));return _0x13aed1;});}function getUser(_0x31eacf,_0x4306a2){if(intUtil[_0xe167('0x1e')](_0x4306a2)){return request({'uri':util['format'](_0xe167('0x1f'),_0x31eacf[_0xe167('0x1c')]),'qs':{'email':_0x4306a2}})[_0xe167('0x20')](function(_0x2a472c){if(_0x2a472c['length']){logger[_0xe167('0xc')](_0xe167('0x21'));return _[_0xe167('0x22')](_0x2a472c,function(_0x4f67e2){return _0x4f67e2[_0xe167('0x23')][_0xe167('0x24')]===_0x4306a2;});}else{logger[_0xe167('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xe167('0xf')](_0xe167('0x25'),_0x31eacf[_0xe167('0x1c')])})['then'](function(_0x503191){logger[_0xe167('0xc')](_0xe167('0x26'));return _0x503191;});}});}else{logger[_0xe167('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xe167('0x25'),_0x31eacf[_0xe167('0x1c')])})[_0xe167('0x20')](function(_0x206744){logger[_0xe167('0xc')]('Admin\x20account\x20selected.');return _0x206744;});}}function getEndUser(_0x3d1415,_0x1252bc,_0x432964){logger[_0xe167('0xc')](_0xe167('0x27'),_0x432964);return request({'uri':util[_0xe167('0xf')](_0xe167('0x28'),_0x3d1415['remoteUri']),'qs':{'phone':_0x432964}})[_0xe167('0x20')](function(_0x349075){if(_0x349075[_0xe167('0x29')]){logger[_0xe167('0xc')](_0xe167('0x2a'));return _[_0xe167('0x22')](_0x349075,{'phone':_0x432964});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xe167('0xf')]('%s/api/v2/contacts',_0x3d1415[_0xe167('0x1c')]),'method':_0xe167('0x2b'),'body':{'name':_0x1252bc,'phone':_0x432964}})[_0xe167('0x20')](function(_0x462c18){logger[_0xe167('0xc')](_0xe167('0x2c'));return _0x462c18;});}});}function getAuth(_0x6282c9){return util[_0xe167('0xf')](_0xe167('0x2d'),new Buffer(_0x6282c9['apiKey']+':X')[_0xe167('0x2e')](_0xe167('0x2f')));}function request(_0x5601ba){logger['debug']('[HTTP]',JSON[_0xe167('0x30')](_0x5601ba));return rp(_[_0xe167('0x31')](_0x5601ba,{'method':_0xe167('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x42c2c2,_0x2ff61f){var _0x2d6d4f=[];if(_0x42c2c2&&_0x42c2c2[_0xe167('0x29')]>0x0){_0x2d6d4f=_[_0xe167('0x33')](_0x42c2c2,_0x2ff61f);}return _0x2d6d4f;}function getCustomFields(_0x3d6c3d,_0x5fbd30){var _0x400c07=[];var _0x4cef56={'custom_fields':[]};if(_0x3d6c3d[_0xe167('0x29')]>0x0){_[_0xe167('0x34')](_0x3d6c3d,function(_0x2dd188){if(_0x2dd188[_0xe167('0x35')]===_0xe167('0x36')&&_0x2dd188[_0xe167('0x37')]&&!_0x2dd188[_0xe167('0x38')]){_0x4cef56[_0x2dd188[_0xe167('0x37')][_0xe167('0x39')]()]=_0x2dd188[_0xe167('0x3a')][_0xe167('0x2e')]();}else if(_0x2dd188['type']==='string'&&_0x2dd188[_0xe167('0x3b')]&&_0x2dd188[_0xe167('0x38')]){_0x4cef56[_0xe167('0x3c')][_0xe167('0x3d')]({'id':_0x2dd188[_0xe167('0x3b')],'value':_0x2dd188[_0xe167('0x3a')][_0xe167('0x2e')]()});}else if(_0x2dd188[_0xe167('0x35')]===_0xe167('0x3e')&&_0x2dd188[_0xe167('0x3f')]&&_0x2dd188[_0xe167('0x3b')]&&_0x2dd188[_0xe167('0x38')]){_0x5fbd30[_0x2dd188['variableName']]&&_0x4cef56[_0xe167('0x3c')][_0xe167('0x3d')]({'id':_0x2dd188[_0xe167('0x3b')],'value':_0x5fbd30[_0x2dd188[_0xe167('0x3f')]]['toString']()});}else if(_0x2dd188[_0xe167('0x35')]===_0xe167('0x40')&&_0x2dd188[_0xe167('0x41')]&&_0x2dd188[_0xe167('0x41')][_0xe167('0x17')]&&_0x2dd188[_0xe167('0x3b')]&&_0x2dd188['customField']){_0x5fbd30[_0x2dd188[_0xe167('0x41')][_0xe167('0x17')][_0xe167('0x39')]()]&&_0x4cef56[_0xe167('0x3c')]['push']({'id':_0x2dd188[_0xe167('0x3b')],'value':_0x5fbd30[_0x2dd188[_0xe167('0x41')]['name'][_0xe167('0x39')]()][_0xe167('0x2e')]()});}});}return _0x4cef56;}exports[_0xe167('0x42')]=function(_0x2732c6,_0x948b7a,_0x456c93,_0x4be9c3,_0x31f480,_0x18a69a){var _0x4df830,_0xcaddc4;_0x18a69a[_0xe167('0x1c')]=intUtil['stripTrailingSlash'](_0x18a69a[_0xe167('0x1c')]);_0x18a69a[_0xe167('0x43')]=intUtil['stripTrailingSlash'](_0x18a69a[_0xe167('0x43')]);if(_0x31f480&&_0x31f480[_0xe167('0x44')]){logger[_0xe167('0xc')](_0xe167('0x45'),_0xe167('0x46'));_0x948b7a[_0xe167('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x18a69a[_0xe167('0x43')],_0x948b7a[_0xe167('0x48')],md5(_0x948b7a[_0xe167('0x48')]));}else{_0x948b7a[_0xe167('0x47')]='';}headers[_0xe167('0x49')]=getAuth(_0x18a69a);return getUser(_0x18a69a,_0x4be9c3[_0xe167('0x24')])[_0xe167('0x20')](function(_0x140038){_0x4df830=_0x140038;logger['info']('The\x20User\x20ID\x20is:',_0x4df830['id']);return getEndUser(_0x18a69a,_0x948b7a['calleridname'],_0x948b7a['calleridnum']);})[_0xe167('0x20')](function(_0x3bc6f2){_0xcaddc4=_0x3bc6f2;logger[_0xe167('0xc')](_0xe167('0x4a'),_0xcaddc4['id']);return getTicket(_0x18a69a,_0x4df830,_0xcaddc4,_0x456c93,_0x948b7a);})[_0xe167('0x20')](function(_0x42de48){if(_0x42de48&&_0x42de48['id']){logger[_0xe167('0xc')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x42de48['id']);logger[_0xe167('0xc')](_0xe167('0x45'),_0xe167('0x4b'));emit(util['format'](_0xe167('0x4c'),_0x4be9c3[_0xe167('0x17')]),_0xe167('0x4d'),{'uri':util[_0xe167('0xf')]('%s/helpdesk/tickets/%d',_0x18a69a['remoteUri'],_0x42de48['id'])});}})[_0xe167('0x4e')](function(_0x16e863){logger['error'](_0xe167('0x45'),JSON[_0xe167('0x30')](_0x16e863));});};exports[_0xe167('0x4f')]=function(_0x5a6890,_0xd803d0,_0x398f1d,_0x781e86,_0x3127f4,_0x3da4ec,_0x8e29e0){var _0x55fa35,_0x279e5c;_0x3da4ec[_0xe167('0x1c')]=intUtil[_0xe167('0x50')](_0x3da4ec['remoteUri']);_0x3da4ec[_0xe167('0x43')]=intUtil[_0xe167('0x50')](_0x3da4ec[_0xe167('0x43')]);if(_0x8e29e0&&_0x8e29e0['recordingFormat']&&_0x8e29e0[_0xe167('0x51')]!==_0xe167('0x52')){logger[_0xe167('0xc')]('[OUTBOUND]',_0xe167('0x46'));_0xd803d0[_0xe167('0x47')]=util['format'](_0xe167('0x53'),_0x3da4ec[_0xe167('0x43')],_0xd803d0[_0xe167('0x48')],md5(_0xd803d0[_0xe167('0x48')]));}headers[_0xe167('0x49')]=getAuth(_0x3da4ec);return getUser(_0x3da4ec,_0x781e86[_0xe167('0x24')])[_0xe167('0x20')](function(_0x327fc6){_0x55fa35=_0x327fc6;logger[_0xe167('0xc')](_0xe167('0x54'),_0x55fa35['id']);return getEndUser(_0x3da4ec,_0xd803d0[_0xe167('0x55')],_0xd803d0[_0xe167('0x56')]);})['then'](function(_0x34817e){_0x279e5c=_0x34817e;logger[_0xe167('0xc')]('The\x20Enduser\x20ID\x20is:',_0x279e5c['id']);return getTicket(_0x3da4ec,_0x55fa35,_0x279e5c,_0x398f1d,_0xd803d0);})[_0xe167('0x20')](function(_0x178290){if(_0x178290&&_0x178290['id']){logger[_0xe167('0xc')](_0xe167('0x1d'));logger['info'](_0xe167('0x57'),_0x178290['id']);logger[_0xe167('0xc')]('[OUTBOUND]',_0xe167('0x4b'));emit(util[_0xe167('0xf')](_0xe167('0x4c'),_0x781e86['name']),_0xe167('0x4d'),{'uri':util[_0xe167('0xf')](_0xe167('0x58'),_0x3da4ec[_0xe167('0x1c')],_0x178290['id'])});}})['catch'](function(_0x455d76){logger['error'](_0xe167('0x59'),JSON[_0xe167('0x30')](_0x455d76));});};exports['abandoned']=function(_0x41b3b0,_0x54134c,_0x4b90e3,_0x1b690e,_0x23252d,_0x38aa3f){var _0x3cb88f,_0x316a60;_0x38aa3f[_0xe167('0x1c')]=intUtil['stripTrailingSlash'](_0x38aa3f['remoteUri']);_0x38aa3f[_0xe167('0x43')]=intUtil[_0xe167('0x50')](_0x38aa3f[_0xe167('0x43')]);if(_0x23252d&&_0x23252d['monitor_format']){logger[_0xe167('0xc')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x54134c[_0xe167('0x47')]=util[_0xe167('0xf')](_0xe167('0x53'),_0x38aa3f[_0xe167('0x43')],_0x54134c[_0xe167('0x48')],md5(_0x54134c['uniqueid']));}else{_0x54134c[_0xe167('0x47')]='';}headers[_0xe167('0x49')]=getAuth(_0x38aa3f);return getUser(_0x38aa3f,'')['then'](function(_0x2370c7){_0x3cb88f=_0x2370c7;logger[_0xe167('0xc')](_0xe167('0x54'),_0x3cb88f['id']);return getEndUser(_0x38aa3f,_0x54134c[_0xe167('0x5a')],_0x54134c[_0xe167('0x11')]);})['then'](function(_0x5f07a3){_0x316a60=_0x5f07a3;logger[_0xe167('0xc')](_0xe167('0x4a'),_0x316a60['id']);return getTicket(_0x38aa3f,_0x3cb88f,_0x316a60,_0x4b90e3,_0x54134c);})['then'](function(_0x5486b0){if(_0x5486b0){logger[_0xe167('0xc')](_0xe167('0x1d'));logger[_0xe167('0xc')](_0xe167('0x57'),_0x5486b0['id']);}})[_0xe167('0x4e')](function(_0x1737e1){logger['error'](_0xe167('0x5b'),JSON[_0xe167('0x30')](_0x1737e1));});}; \ No newline at end of file +var _0x9f34=['The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','user:%s','abandoned','Recording\x20is\x20enabled!','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','format','%s/api/v2/agents','length','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','forEach','type','string','nameField','customField','toLowerCase','content','push','idField','variableName','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x47a2cb,_0x170391){var _0x4bddcc=function(_0x33a9d4){while(--_0x33a9d4){_0x47a2cb['push'](_0x47a2cb['shift']());}};_0x4bddcc(++_0x170391);}(_0x9f34,0x162));var _0x49f3=function(_0x5947e2,_0x1abef5){_0x5947e2=_0x5947e2-0x0;var _0x295a86=_0x9f34[_0x5947e2];return _0x295a86;};'use strict';var _=require(_0x49f3('0x0'));var rp=require('request-promise');var md5=require(_0x49f3('0x1'));var util=require(_0x49f3('0x2'));var Redis=require(_0x49f3('0x3'));var intUtil=require(_0x49f3('0x4'));var config=require(_0x49f3('0x5'));var logger=require('../../../../config/logger')('freshdesk');config[_0x49f3('0x6')]=_['defaults'](config[_0x49f3('0x6')],{'host':_0x49f3('0x7'),'port':0x18eb});var io=require(_0x49f3('0x8'))(new Redis(config[_0x49f3('0x6')]));var headers={'Content-Type':_0x49f3('0x9'),'Accept':'application/json'};function emit(_0x3add84,_0x25f040,_0x3416d9){io['to'](_0x3add84)[_0x49f3('0xa')](_0x25f040,_0x3416d9);}function getTicket(_0x57b3fe,_0x324706,_0x502c3f,_0x588cd5,_0x579c4c){logger[_0x49f3('0xb')](_0x49f3('0xc'));var _0xb8e174=_['merge']({'responder_id':_0x324706['id'],'requester_id':_0x502c3f['id'],'name':util['format'](_0x49f3('0xd'),_0x579c4c[_0x49f3('0xe')]),'phone':_0x579c4c[_0x49f3('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x49f3('0x10')](_0x588cd5[_0x49f3('0x11')],_0x579c4c,'\x20'),'description':intUtil[_0x49f3('0x10')](_0x588cd5[_0x49f3('0x12')],_0x579c4c,_0x49f3('0x13')),'tags':getTags(_0x588cd5[_0x49f3('0x14')],_0x49f3('0x15'))},getCustomFields(_0x588cd5[_0x49f3('0x16')],_0x579c4c));_0xb8e174[_0x49f3('0x17')]=_['mapValues'](_[_0x49f3('0x18')](_0xb8e174[_0x49f3('0x17')],'id'),'value');return request({'uri':util['format'](_0x49f3('0x19'),_0x57b3fe[_0x49f3('0x1a')]),'method':_0x49f3('0x1b'),'body':_0xb8e174})[_0x49f3('0x1c')](function(_0x3206ff){logger[_0x49f3('0xb')](_0x49f3('0x1d'));return _0x3206ff;});}function getUser(_0x13af67,_0xcedc9b){if(intUtil['validateEmail'](_0xcedc9b)){return request({'uri':util[_0x49f3('0x1e')](_0x49f3('0x1f'),_0x13af67[_0x49f3('0x1a')]),'qs':{'email':_0xcedc9b}})[_0x49f3('0x1c')](function(_0x575171){if(_0x575171[_0x49f3('0x20')]){logger[_0x49f3('0xb')]('Agent\x20found!');return _[_0x49f3('0x21')](_0x575171,function(_0x3d2e3b){return _0x3d2e3b[_0x49f3('0x22')][_0x49f3('0x23')]===_0xcedc9b;});}else{logger[_0x49f3('0xb')](_0x49f3('0x24'));return request({'uri':util['format'](_0x49f3('0x25'),_0x13af67[_0x49f3('0x1a')])})[_0x49f3('0x1c')](function(_0x359090){logger['info'](_0x49f3('0x26'));return _0x359090;});}});}else{logger[_0x49f3('0xb')](_0x49f3('0x27'));return request({'uri':util['format'](_0x49f3('0x25'),_0x13af67[_0x49f3('0x1a')])})[_0x49f3('0x1c')](function(_0x3b873f){logger['info'](_0x49f3('0x26'));return _0x3b873f;});}}function getEndUser(_0x31f50e,_0x35d441,_0x41a267){logger[_0x49f3('0xb')](_0x49f3('0x28'),_0x41a267);return request({'uri':util[_0x49f3('0x1e')]('%s/api/v2/contacts',_0x31f50e['remoteUri']),'qs':{'phone':_0x41a267}})[_0x49f3('0x1c')](function(_0x26a2f9){if(_0x26a2f9[_0x49f3('0x20')]){logger[_0x49f3('0xb')](_0x49f3('0x29'));return _[_0x49f3('0x21')](_0x26a2f9,{'phone':_0x41a267});}else{logger['info'](_0x49f3('0x2a'));return request({'uri':util[_0x49f3('0x1e')]('%s/api/v2/contacts',_0x31f50e[_0x49f3('0x1a')]),'method':_0x49f3('0x1b'),'body':{'name':_0x35d441,'phone':_0x41a267}})[_0x49f3('0x1c')](function(_0x466dc5){logger[_0x49f3('0xb')]('Enduser\x20created.');return _0x466dc5;});}});}function getAuth(_0x3e80b2){return util[_0x49f3('0x1e')](_0x49f3('0x2b'),new Buffer(_0x3e80b2[_0x49f3('0x2c')]+':X')[_0x49f3('0x2d')](_0x49f3('0x2e')));}function request(_0x5b39f6){logger[_0x49f3('0x2f')](_0x49f3('0x30'),JSON[_0x49f3('0x31')](_0x5b39f6));return rp(_[_0x49f3('0x32')](_0x5b39f6,{'method':_0x49f3('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x50adab,_0x2f223d){var _0x163868=[];if(_0x50adab&&_0x50adab[_0x49f3('0x20')]>0x0){_0x163868=_['map'](_0x50adab,_0x2f223d);}return _0x163868;}function getCustomFields(_0x24983a,_0x30b946){var _0xed920d=[];var _0x1a0b55={'custom_fields':[]};if(_0x24983a[_0x49f3('0x20')]>0x0){_[_0x49f3('0x34')](_0x24983a,function(_0x253f5c){if(_0x253f5c[_0x49f3('0x35')]===_0x49f3('0x36')&&_0x253f5c[_0x49f3('0x37')]&&!_0x253f5c[_0x49f3('0x38')]){_0x1a0b55[_0x253f5c[_0x49f3('0x37')][_0x49f3('0x39')]()]=_0x253f5c[_0x49f3('0x3a')][_0x49f3('0x2d')]();}else if(_0x253f5c[_0x49f3('0x35')]===_0x49f3('0x36')&&_0x253f5c['idField']&&_0x253f5c['customField']){_0x1a0b55['custom_fields'][_0x49f3('0x3b')]({'id':_0x253f5c[_0x49f3('0x3c')],'value':_0x253f5c[_0x49f3('0x3a')][_0x49f3('0x2d')]()});}else if(_0x253f5c[_0x49f3('0x35')]==='variable'&&_0x253f5c['variableName']&&_0x253f5c[_0x49f3('0x3c')]&&_0x253f5c[_0x49f3('0x38')]){_0x30b946[_0x253f5c['variableName']]&&_0x1a0b55[_0x49f3('0x17')][_0x49f3('0x3b')]({'id':_0x253f5c[_0x49f3('0x3c')],'value':_0x30b946[_0x253f5c[_0x49f3('0x3d')]]['toString']()});}else if(_0x253f5c[_0x49f3('0x35')]==='customVariable'&&_0x253f5c[_0x49f3('0x3e')]&&_0x253f5c[_0x49f3('0x3e')][_0x49f3('0x15')]&&_0x253f5c[_0x49f3('0x3c')]&&_0x253f5c['customField']){_0x30b946[_0x253f5c['Variable'][_0x49f3('0x15')][_0x49f3('0x39')]()]&&_0x1a0b55[_0x49f3('0x17')]['push']({'id':_0x253f5c[_0x49f3('0x3c')],'value':_0x30b946[_0x253f5c[_0x49f3('0x3e')]['name']['toLowerCase']()][_0x49f3('0x2d')]()});}});}return _0x1a0b55;}exports[_0x49f3('0x3f')]=function(_0xd3483f,_0x501dba,_0x53a251,_0xed7b61,_0x230e0d,_0x3aa2e8){var _0x18bbee,_0xa0a163;_0x3aa2e8[_0x49f3('0x1a')]=intUtil['stripTrailingSlash'](_0x3aa2e8[_0x49f3('0x1a')]);_0x3aa2e8[_0x49f3('0x40')]=intUtil[_0x49f3('0x41')](_0x3aa2e8[_0x49f3('0x40')]);if(_0x230e0d&&_0x230e0d[_0x49f3('0x42')]){logger[_0x49f3('0xb')](_0x49f3('0x43'),'Recording\x20is\x20enabled!');_0x501dba[_0x49f3('0x44')]=util[_0x49f3('0x1e')](_0x49f3('0x45'),_0x3aa2e8[_0x49f3('0x40')],_0x501dba[_0x49f3('0x46')],md5(_0x501dba[_0x49f3('0x46')]));}else{_0x501dba['recordingURL']='';}headers['Authorization']=getAuth(_0x3aa2e8);return getUser(_0x3aa2e8,_0xed7b61[_0x49f3('0x23')])[_0x49f3('0x1c')](function(_0x56e93b){_0x18bbee=_0x56e93b;logger[_0x49f3('0xb')]('The\x20User\x20ID\x20is:',_0x18bbee['id']);return getEndUser(_0x3aa2e8,_0x501dba[_0x49f3('0xe')],_0x501dba[_0x49f3('0xf')]);})[_0x49f3('0x1c')](function(_0x2a3ffa){_0xa0a163=_0x2a3ffa;logger['info'](_0x49f3('0x47'),_0xa0a163['id']);return getTicket(_0x3aa2e8,_0x18bbee,_0xa0a163,_0x53a251,_0x501dba);})['then'](function(_0x46eed4){if(_0x46eed4&&_0x46eed4['id']){logger[_0x49f3('0xb')](_0x49f3('0x1d'));logger[_0x49f3('0xb')](_0x49f3('0x48'),_0x46eed4['id']);logger[_0x49f3('0xb')](_0x49f3('0x43'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x49f3('0x1e')]('user:%s',_0xed7b61['name']),_0x49f3('0x49'),{'uri':util[_0x49f3('0x1e')](_0x49f3('0x4a'),_0x3aa2e8[_0x49f3('0x1a')],_0x46eed4['id'])});}})[_0x49f3('0x4b')](function(_0x1ee20a){logger[_0x49f3('0x4c')](_0x49f3('0x43'),JSON[_0x49f3('0x31')](_0x1ee20a));});};exports[_0x49f3('0x4d')]=function(_0x41bdf3,_0x4aab8c,_0x27b565,_0x5a7636,_0x1e5312,_0x3300ad,_0x20d70e){var _0x2c3fca,_0x54e1b1;_0x3300ad[_0x49f3('0x1a')]=intUtil[_0x49f3('0x41')](_0x3300ad[_0x49f3('0x1a')]);_0x3300ad[_0x49f3('0x40')]=intUtil[_0x49f3('0x41')](_0x3300ad[_0x49f3('0x40')]);if(_0x20d70e&&_0x20d70e[_0x49f3('0x4e')]&&_0x20d70e[_0x49f3('0x4e')]!=='none'){logger['info'](_0x49f3('0x4f'),'Recording\x20is\x20enabled!');_0x4aab8c[_0x49f3('0x44')]=util['format'](_0x49f3('0x45'),_0x3300ad[_0x49f3('0x40')],_0x4aab8c[_0x49f3('0x46')],md5(_0x4aab8c[_0x49f3('0x46')]));}headers['Authorization']=getAuth(_0x3300ad);return getUser(_0x3300ad,_0x5a7636['email'])[_0x49f3('0x1c')](function(_0x554000){_0x2c3fca=_0x554000;logger[_0x49f3('0xb')](_0x49f3('0x50'),_0x2c3fca['id']);return getEndUser(_0x3300ad,_0x4aab8c['destcalleridname'],_0x4aab8c[_0x49f3('0x51')]);})[_0x49f3('0x1c')](function(_0x3a927a){_0x54e1b1=_0x3a927a;logger[_0x49f3('0xb')](_0x49f3('0x47'),_0x54e1b1['id']);return getTicket(_0x3300ad,_0x2c3fca,_0x54e1b1,_0x27b565,_0x4aab8c);})[_0x49f3('0x1c')](function(_0x2aa65d){if(_0x2aa65d&&_0x2aa65d['id']){logger[_0x49f3('0xb')](_0x49f3('0x1d'));logger[_0x49f3('0xb')](_0x49f3('0x48'),_0x2aa65d['id']);logger[_0x49f3('0xb')](_0x49f3('0x4f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x49f3('0x52'),_0x5a7636[_0x49f3('0x15')]),_0x49f3('0x49'),{'uri':util[_0x49f3('0x1e')]('%s/helpdesk/tickets/%d',_0x3300ad['remoteUri'],_0x2aa65d['id'])});}})[_0x49f3('0x4b')](function(_0x15c5e1){logger[_0x49f3('0x4c')]('[OUTBOUND]',JSON['stringify'](_0x15c5e1));});};exports[_0x49f3('0x53')]=function(_0x3ace22,_0x77d1ee,_0x443af0,_0x4e9d02,_0x48e237,_0x5ee815){var _0x43befb,_0xcaac66;_0x5ee815['remoteUri']=intUtil[_0x49f3('0x41')](_0x5ee815['remoteUri']);_0x5ee815['serverUrl']=intUtil[_0x49f3('0x41')](_0x5ee815['serverUrl']);if(_0x48e237&&_0x48e237[_0x49f3('0x42')]){logger[_0x49f3('0xb')]('[ABANDONED]',_0x49f3('0x54'));_0x77d1ee['recordingURL']=util[_0x49f3('0x1e')](_0x49f3('0x45'),_0x5ee815[_0x49f3('0x40')],_0x77d1ee['uniqueid'],md5(_0x77d1ee[_0x49f3('0x46')]));}else{_0x77d1ee[_0x49f3('0x44')]='';}headers['Authorization']=getAuth(_0x5ee815);return getUser(_0x5ee815,'')[_0x49f3('0x1c')](function(_0x2f0bf1){_0x43befb=_0x2f0bf1;logger[_0x49f3('0xb')](_0x49f3('0x50'),_0x43befb['id']);return getEndUser(_0x5ee815,_0x77d1ee[_0x49f3('0xe')],_0x77d1ee['calleridnum']);})['then'](function(_0x1efe6d){_0xcaac66=_0x1efe6d;logger['info']('The\x20Enduser\x20ID\x20is:',_0xcaac66['id']);return getTicket(_0x5ee815,_0x43befb,_0xcaac66,_0x443af0,_0x77d1ee);})[_0x49f3('0x1c')](function(_0x45c577){if(_0x45c577){logger['info'](_0x49f3('0x1d'));logger[_0x49f3('0xb')](_0x49f3('0x48'),_0x45c577['id']);}})[_0x49f3('0x4b')](function(_0x114dbd){logger[_0x49f3('0x4c')]('[ABANDONED]',JSON[_0x49f3('0x31')](_0x114dbd));});}; \ 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 a06c200..4f1aae1 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 _0x4690=['../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./servicenow','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','data1','toLowerCase','data2','Configurations','data3','routeId','outbound','log','EVENT\x20UNKNOWN','servicenow','unknown\x20integration'];(function(_0x39fe32,_0x14c190){var _0x351145=function(_0x5dd377){while(--_0x5dd377){_0x39fe32['push'](_0x39fe32['shift']());}};_0x351145(++_0x14c190);}(_0x4690,0x150));var _0x0469=function(_0x35d374,_0x31d597){_0x35d374=_0x35d374-0x0;var _0x39ae31=_0x4690[_0x35d374];return _0x39ae31;};'use strict';var _=require(_0x0469('0x0'));var util=require(_0x0469('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x0469('0x2'));var sugarcrm=require(_0x0469('0x3'));var freshdesk=require(_0x0469('0x4'));var zoho=require(_0x0469('0x5'));var desk=require('./desk');var vtiger=require('./vtiger');var servicenow=require(_0x0469('0x6'));var dynamics365=require(_0x0469('0x7'));var integrations=[_0x0469('0x8'),_0x0469('0x9'),_0x0469('0xa'),_0x0469('0xb'),_0x0469('0xc'),_0x0469('0xd'),_0x0469('0xe'),'servicenow',_0x0469('0xf')];exports['exec']=function(_0x23912c,_0x28d4eb,_0x16b24d,_0x44c4f7,_0x59e7b8,_0x1fa0a2){if(_0x16b24d){if(_['includes'](integrations,_0x23912c[_0x0469('0x10')][_0x0469('0x11')]())){try{var _0x3c106c=null;var _0x515a70='';var _0x196e85=_0x16b24d[_0x23912c[_0x0469('0x10')]['toLowerCase']()];if(_0x196e85){var _0x331e23=_0x196e85[_0x23912c[_0x0469('0x12')]];if(_0x331e23){var _0xd89723=_['find'](_0x331e23[_0x0469('0x13')],{'id':parseInt(_0x23912c[_0x0469('0x14')],0xa)});if(_0xd89723){if(_0x44c4f7){if(_0x59e7b8&&_0x28d4eb['queue']){_0x515a70='queue';}else if(_0x28d4eb[_0x0469('0x15')]){_0x515a70=_0x0469('0x16');}else{console[_0x0469('0x17')](_0x0469('0x18'),_0x28d4eb);}}else{_0x515a70='abandoned';}switch(_0x23912c[_0x0469('0x10')]['toLowerCase']()){case _0x0469('0x8'):zendesk[_0x515a70](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2);break;case _0x0469('0x9'):salesforce[_0x515a70](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2);break;case _0x0469('0xa'):sugarcrm[_0x515a70](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2);break;case _0x0469('0xb'):freshdesk[_0x515a70](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2);break;case _0x0469('0xc'):zoho[_0x515a70](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2);break;case _0x0469('0xd'):desk[_0x515a70](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2);break;case _0x0469('0xe'):vtiger[_0x515a70](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2);break;case _0x0469('0x19'):servicenow['cs'](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2,_0x515a70);break;case _0x0469('0xf'):dynamics365['cs'](_0x23912c,_0x28d4eb,_0xd89723,_0x44c4f7,_0x59e7b8,_0x331e23,_0x1fa0a2,_0x515a70);break;default:console['log'](_0x0469('0x1a'));}}else{_0x3c106c=require(_0x0469('0x1b'))(_0x23912c[_0x0469('0x10')]['toLowerCase']());_0x3c106c[_0x0469('0x1c')](_0x0469('0x1d'),util[_0x0469('0x1e')](_0x0469('0x1f'),_0x23912c[_0x0469('0x10')][_0x0469('0x11')](),_0x23912c['data3']));}}else{_0x3c106c=require(_0x0469('0x1b'))(_0x23912c[_0x0469('0x10')][_0x0469('0x11')]());_0x3c106c['error']('[EXEC]',util[_0x0469('0x1e')](_0x0469('0x20'),_0x23912c[_0x0469('0x10')]['toLowerCase'](),_0x23912c[_0x0469('0x12')]));}}else{}}catch(_0x4995ea){console[_0x0469('0x1c')](_0x4995ea);}}}}; \ No newline at end of file +var _0x4dc8=['toLowerCase','data2','find','Configurations','queue','routeId','outbound','log','EVENT\x20UNKNOWN','abandoned','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','servicenow','dynamics365','exec','includes','data1'];(function(_0x46ef9f,_0x49cf7f){var _0x21e1f4=function(_0x38d857){while(--_0x38d857){_0x46ef9f['push'](_0x46ef9f['shift']());}};_0x21e1f4(++_0x49cf7f);}(_0x4dc8,0x1b5));var _0x84dc=function(_0xf5bf7b,_0x55c643){_0xf5bf7b=_0xf5bf7b-0x0;var _0x4a0321=_0x4dc8[_0xf5bf7b];return _0x4a0321;};'use strict';var _=require(_0x84dc('0x0'));var util=require('util');var zendesk=require('./zendesk');var salesforce=require('./salesforce');var sugarcrm=require(_0x84dc('0x1'));var freshdesk=require(_0x84dc('0x2'));var zoho=require(_0x84dc('0x3'));var desk=require(_0x84dc('0x4'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x84dc('0x5'));var integrations=[_0x84dc('0x6'),_0x84dc('0x7'),_0x84dc('0x8'),_0x84dc('0x9'),_0x84dc('0xa'),_0x84dc('0xb'),_0x84dc('0xc'),_0x84dc('0xd'),_0x84dc('0xe')];exports[_0x84dc('0xf')]=function(_0x107bf4,_0x5d1244,_0x4f4682,_0x4051ce,_0xc0bce9,_0x4c9521){if(_0x4f4682){if(_[_0x84dc('0x10')](integrations,_0x107bf4[_0x84dc('0x11')][_0x84dc('0x12')]())){try{var _0x33ed21=null;var _0x5c9e34='';var _0x37af6c=_0x4f4682[_0x107bf4['data1'][_0x84dc('0x12')]()];if(_0x37af6c){var _0x37a84d=_0x37af6c[_0x107bf4[_0x84dc('0x13')]];if(_0x37a84d){var _0x52bd7c=_[_0x84dc('0x14')](_0x37a84d[_0x84dc('0x15')],{'id':parseInt(_0x107bf4['data3'],0xa)});if(_0x52bd7c){if(_0x4051ce){if(_0xc0bce9&&_0x5d1244[_0x84dc('0x16')]){_0x5c9e34=_0x84dc('0x16');}else if(_0x5d1244[_0x84dc('0x17')]){_0x5c9e34=_0x84dc('0x18');}else{console[_0x84dc('0x19')](_0x84dc('0x1a'),_0x5d1244);}}else{_0x5c9e34=_0x84dc('0x1b');}switch(_0x107bf4[_0x84dc('0x11')]['toLowerCase']()){case'zendesk':zendesk[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0x7'):salesforce[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0x8'):sugarcrm[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case'freshdesk':freshdesk[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case'zoho':zoho[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0xb'):desk[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case'vtiger':vtiger[_0x5c9e34](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521);break;case _0x84dc('0xd'):servicenow['cs'](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521,_0x5c9e34);break;case _0x84dc('0xe'):dynamics365['cs'](_0x107bf4,_0x5d1244,_0x52bd7c,_0x4051ce,_0xc0bce9,_0x37a84d,_0x4c9521,_0x5c9e34);break;default:console[_0x84dc('0x19')]('unknown\x20integration');}}else{_0x33ed21=require('../../../../config/logger')(_0x107bf4[_0x84dc('0x11')][_0x84dc('0x12')]());_0x33ed21[_0x84dc('0x1c')](_0x84dc('0x1d'),util[_0x84dc('0x1e')](_0x84dc('0x1f'),_0x107bf4[_0x84dc('0x11')][_0x84dc('0x12')](),_0x107bf4[_0x84dc('0x20')]));}}else{_0x33ed21=require(_0x84dc('0x21'))(_0x107bf4['data1']['toLowerCase']());_0x33ed21[_0x84dc('0x1c')]('[EXEC]',util[_0x84dc('0x1e')](_0x84dc('0x22'),_0x107bf4[_0x84dc('0x11')]['toLowerCase'](),_0x107bf4[_0x84dc('0x13')]));}}else{}}catch(_0x547041){console['error'](_0x547041);}}}}; \ 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 c279b1a..e8d02c4 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 _0x9c44=['username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','isNil','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','moment','bluebird','md5','jsforce','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','utc','getString','Descriptions','WhoId','Case','assign','Subjects','ContactId','sobject','create','find','then','length','Email','info','Agent\x20%s\x20found.','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','resolve','user_id','display_name','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','execute','Lead','contact','lead','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login'];(function(_0x12f89c,_0x47aa19){var _0x977066=function(_0x51ab64){while(--_0x51ab64){_0x12f89c['push'](_0x12f89c['shift']());}};_0x977066(++_0x47aa19);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var md5=require(_0x49c4('0x2'));var jsforce=require(_0x49c4('0x3'));var util=require(_0x49c4('0x4'));var Redis=require(_0x49c4('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x49c4('0x6'))('salesforce');config[_0x49c4('0x7')]=_[_0x49c4('0x8')](config[_0x49c4('0x7')],{'host':_0x49c4('0x9'),'port':0x18eb});var io=require(_0x49c4('0xa'))(new Redis(config['redis']));function emit(_0x11c586,_0x42e4f8,_0x1d13fb){io['to'](_0x11c586)[_0x49c4('0xb')](_0x42e4f8,_0x1d13fb);}function getTicket(_0x4c7d3a,_0x5ab4a3,_0x451ea6,_0x313e73,_0x58cad7,_0xb611a1,_0x459d09,_0x4adb3c){var _0x536d42={};if(_0x313e73[_0x49c4('0xc')]===_0x49c4('0xd')){_0x536d42=Object['assign']({},{'OwnerId':_0x5ab4a3['id'],'ActivityDate':moment[_0x49c4('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x49c4('0xf')](_0x313e73['Subjects'],_0x58cad7,'\x20'),'Description':intUtil[_0x49c4('0xf')](_0x313e73[_0x49c4('0x10')],_0x58cad7,'\x0a')},getCustomFields(_0xb611a1,_0x58cad7));if(_0x451ea6){_0x536d42[_0x49c4('0x11')]=_0x451ea6['id'];}}else if(_0x313e73[_0x49c4('0xc')]===_0x49c4('0x12')){_0x536d42=Object[_0x49c4('0x13')]({},{'OwnerId':_0x5ab4a3['id'],'Subject':intUtil[_0x49c4('0xf')](_0x313e73[_0x49c4('0x14')],_0x58cad7,'\x20'),'Description':intUtil['getString'](_0x313e73[_0x49c4('0x10')],_0x58cad7,'\x0a')},getCustomFields(_0xb611a1,_0x58cad7));if(_0x451ea6){_0x536d42[_0x49c4('0x15')]=_0x451ea6['id'];}}return _0x459d09[_0x49c4('0x16')](_0x313e73[_0x49c4('0xc')])[_0x49c4('0x17')](_0x536d42);}function getUser(_0x53e3a2,_0x44e607,_0x2891f4){if(!_['isNil'](_0x44e607)&&intUtil['validateEmail'](_0x44e607)){var _0x3c782d={'Email':_0x44e607};var _0x2f82d5={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2891f4[_0x49c4('0x16')]('User')[_0x49c4('0x18')](_0x3c782d,_0x2f82d5)['execute']()[_0x49c4('0x19')](function(_0x1806c2){if(_0x1806c2[_0x49c4('0x1a')]){var _0x291526=_[_0x49c4('0x18')](_0x1806c2,function(_0x41078c){return _0x41078c[_0x49c4('0x1b')]===_0x44e607;});if(_0x291526){logger[_0x49c4('0x1c')](_0x49c4('0x1d'),_0x44e607);return BPromise['resolve']({'id':_0x291526['Id'],'name':_0x291526['Name']});}}else{logger['info'](_0x49c4('0x1e'),_0x44e607);return _0x2891f4['identity']()['then'](function(_0x2263ae){return BPromise[_0x49c4('0x1f')]({'id':_0x2263ae[_0x49c4('0x20')],'name':_0x2263ae[_0x49c4('0x21')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x44e607);return _0x2891f4[_0x49c4('0x22')]()[_0x49c4('0x19')](function(_0x565423){return BPromise[_0x49c4('0x1f')]({'id':_0x565423[_0x49c4('0x20')],'name':_0x565423[_0x49c4('0x21')]});});}}function getEndUser(_0xa7a826,_0x531d92,_0x543ea2,_0x449960,_0x53c199){var _0x3800b7={'Phone':_0x449960};var _0x3852b2={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x49c4('0x1f')]()[_0x49c4('0x19')](function(){if(_0x531d92['ticketType']===_0x49c4('0xd')){logger[_0x49c4('0x1c')](_0x49c4('0x23'),_0x449960,_0x531d92[_0x49c4('0x24')]);switch(_0x531d92[_0x49c4('0x24')]){case _0x49c4('0x25'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x26'))[_0x49c4('0x18')](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]()[_0x49c4('0x19')](function(_0x4ea6ea){if(_0x4ea6ea&&_0x4ea6ea['length']){return _0x4ea6ea;}else{return _0x53c199['sobject'](_0x49c4('0x28'))[_0x49c4('0x18')](_0x3800b7,_0x3852b2);}});case _0x49c4('0x29'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x26'))['find'](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]();case _0x49c4('0x2a'):return _0x53c199[_0x49c4('0x16')](_0x49c4('0x28'))['find'](_0x3800b7,_0x3852b2);default:return null;}}else if(_0x531d92['ticketType']===_0x49c4('0x12')){logger[_0x49c4('0x1c')](_0x49c4('0x23'),_0x449960,_0x49c4('0x29'));return _0x53c199[_0x49c4('0x16')]('Contact')[_0x49c4('0x18')](_0x3800b7,_0x3852b2)[_0x49c4('0x27')]();}})[_0x49c4('0x19')](function(_0x512d02){if(_0x512d02&&_0x512d02['length']){var _0x85dce2=_[_0x49c4('0x18')](_0x512d02,function(_0x3bec0a){return _0x3bec0a[_0x49c4('0x2b')]===_0x449960;});if(_0x85dce2){return BPromise[_0x49c4('0x1f')]({'id':_0x85dce2['Id'],'name':_0x85dce2[_0x49c4('0x2c')],'phone':_0x85dce2[_0x49c4('0x2b')]});}}})[_0x49c4('0x19')](function(_0x3209cd){if(_0x3209cd){logger['info'](_0x49c4('0x2d'),_0x449960);return BPromise['resolve'](_0x3209cd);}else{logger[_0x49c4('0x1c')](_0x49c4('0x2e'),_0x449960);var _0x2625a6={'LastName':_0x543ea2!==_0x49c4('0x2f')?_0x543ea2:util['format'](_0x49c4('0x30'),_0x449960),'Phone':_0x449960};if(_0x531d92[_0x49c4('0x31')]){if(_0x531d92[_0x49c4('0x31')]==='contact'){logger[_0x49c4('0x1c')](_0x49c4('0x32'),_0x449960,_0x531d92[_0x49c4('0x31')]);}else if(_0x531d92[_0x49c4('0x31')]===_0x49c4('0x2a')&&_0x531d92[_0x49c4('0xc')]===_0x49c4('0xd')){logger[_0x49c4('0x1c')](_0x49c4('0x32'),_0x449960,_0x531d92[_0x49c4('0x31')]);_0x2625a6[_0x49c4('0x33')]='No\x20Company';}else{return null;}}return _0x53c199[_0x49c4('0x16')](_[_0x49c4('0x34')](_0x531d92[_0x49c4('0x31')]))[_0x49c4('0x17')](_0x2625a6);}});}function getCustomFields(_0x41ad28,_0x29dd5d){var _0x1be62d={};if(_0x41ad28[_0x49c4('0x1a')]>0x0){_[_0x49c4('0x35')](_0x41ad28,function(_0x2668ed){if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x37')&&_0x2668ed[_0x49c4('0x38')]){_0x1be62d[_0x2668ed['idField']]=_0x2668ed[_0x49c4('0x39')]['toString']();}else if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x3a')&&_0x2668ed[_0x49c4('0x3b')]&&_0x2668ed[_0x49c4('0x38')]){_0x29dd5d[_0x2668ed[_0x49c4('0x3b')]]&&(_0x1be62d[_0x2668ed[_0x49c4('0x38')]]=_0x29dd5d[_0x2668ed['variableName']]['toString']());}else if(_0x2668ed[_0x49c4('0x36')]===_0x49c4('0x3c')&&_0x2668ed[_0x49c4('0x3d')]&&_0x2668ed[_0x49c4('0x3d')]['name']&&_0x2668ed[_0x49c4('0x38')]){_0x29dd5d[_0x2668ed[_0x49c4('0x3d')][_0x49c4('0x3e')][_0x49c4('0x3f')]()]&&(_0x1be62d[_0x2668ed[_0x49c4('0x38')]]=_0x29dd5d[_0x2668ed[_0x49c4('0x3d')][_0x49c4('0x3e')][_0x49c4('0x3f')]()][_0x49c4('0x40')]());}});}return _0x1be62d;}function getConnection(_0x5640d3){var _0x2ad771=_0x5640d3['password'][_0x49c4('0x41')](_0x5640d3[_0x49c4('0x42')]);var _0x301def=new jsforce[(_0x49c4('0x43'))]({'oauth2':{'loginUrl':_0x5640d3[_0x49c4('0x44')]||'https://login.salesforce.com','clientId':_0x5640d3[_0x49c4('0x45')],'clientSecret':_0x5640d3[_0x49c4('0x46')]}});return _0x301def[_0x49c4('0x47')](_0x5640d3[_0x49c4('0x48')],_0x2ad771)[_0x49c4('0x19')](function(){logger[_0x49c4('0x1c')](_0x49c4('0x49'));return _0x301def;});}exports['queue']=function(_0x3bac1b,_0x5cfff9,_0x3f7379,_0x906d3,_0x29fe65,_0x27adfe){var _0x2d8087,_0x30bea5,_0x2c6be1,_0x506c71;_0x27adfe[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x27adfe['serverUrl']);_0x27adfe[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x27adfe[_0x49c4('0x44')]);if(_0x29fe65&&_0x29fe65[_0x49c4('0x4c')]){logger['info']('[QUEUE]',_0x49c4('0x4d'));_0x5cfff9['recordingURL']=util[_0x49c4('0x4e')](_0x49c4('0x4f'),_0x27adfe[_0x49c4('0x4a')],_0x5cfff9[_0x49c4('0x50')],md5(_0x5cfff9[_0x49c4('0x50')]));}else{_0x5cfff9[_0x49c4('0x51')]='';}return getConnection(_0x27adfe)[_0x49c4('0x19')](function(_0x563f0b){_0x506c71=_0x563f0b;return getUser(_0x27adfe,_0x906d3[_0x49c4('0x52')],_0x506c71);})[_0x49c4('0x19')](function(_0x3936d3){_0x2d8087=_0x3936d3;return getEndUser(_0x27adfe,_0x3f7379,_0x5cfff9[_0x49c4('0x53')],_0x5cfff9[_0x49c4('0x54')],_0x506c71);})[_0x49c4('0x19')](function(_0x156748){_0x30bea5=_0x156748;return getTicket(_0x27adfe,_0x2d8087,_0x30bea5,_0x3f7379,_0x5cfff9,_0x3f7379[_0x49c4('0x55')],_0x506c71,_0x49c4('0x56'));})[_0x49c4('0x19')](function(_0x5b822f){_0x2c6be1=_0x5b822f;logger['info'](_0x49c4('0x57'),_0x2c6be1['id']);logger[_0x49c4('0x1c')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2c6be1['id'],_0x906d3['name'],_0x27adfe[_0x49c4('0x36')]);switch(_0x27adfe['type']){case'integrationTab':emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x906d3[_0x49c4('0x3e')]),_0x49c4('0x59'),{'recordId':_0x2c6be1['id']});break;case _0x49c4('0x5a'):emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x906d3['name']),_0x49c4('0x5b'),{'uri':util[_0x49c4('0x4e')](_0x49c4('0x5c'),_0x506c71[_0x49c4('0x5d')],_0x2c6be1['id'])});break;default:logger[_0x49c4('0x5e')](_0x49c4('0x5f'));}})['catch'](function(_0x5c7ddd){logger[_0x49c4('0x5e')](_0x49c4('0x60'),JSON[_0x49c4('0x61')](_0x5c7ddd));});};exports[_0x49c4('0x62')]=function(_0x23288e,_0x6b2592,_0xc2033f,_0x58dc5f,_0x45d715,_0x33c9a6,_0x4ba4eb){var _0x42928c,_0x53690f,_0x2f966c,_0x147ebd;_0x33c9a6[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x33c9a6[_0x49c4('0x4a')]);_0x33c9a6[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x33c9a6[_0x49c4('0x44')]);if(_0x4ba4eb&&_0x4ba4eb['recordingFormat']&&_0x4ba4eb[_0x49c4('0x63')]!==_0x49c4('0x64')){logger['info'](_0x49c4('0x65'),_0x49c4('0x4d'));_0x6b2592['recordingURL']=util[_0x49c4('0x4e')](_0x49c4('0x4f'),_0x33c9a6['serverUrl'],_0x6b2592['uniqueid'],md5(_0x6b2592['uniqueid']));}return getConnection(_0x33c9a6)['then'](function(_0xc43386){_0x147ebd=_0xc43386;return getUser(_0x33c9a6,_0x58dc5f['email'],_0x147ebd);})[_0x49c4('0x19')](function(_0x32f344){_0x42928c=_0x32f344;return getEndUser(_0x33c9a6,_0xc2033f,_0x6b2592['destcalleridname'],_0x6b2592[_0x49c4('0x66')],_0x147ebd);})[_0x49c4('0x19')](function(_0x5ac9f0){_0x53690f=_0x5ac9f0;return getTicket(_0x33c9a6,_0x42928c,_0x53690f,_0xc2033f,_0x6b2592,_0xc2033f[_0x49c4('0x55')],_0x147ebd,_0x49c4('0x62'));})[_0x49c4('0x19')](function(_0x35f46f){_0x2f966c=_0x35f46f;logger['info'](_0x49c4('0x67'),_0x2f966c['id']);logger[_0x49c4('0x1c')](_0x49c4('0x68'),_0x2f966c['id'],_0x58dc5f[_0x49c4('0x3e')],_0x33c9a6['type']);switch(_0x33c9a6[_0x49c4('0x36')]){case'integrationTab':emit(util['format']('user:%s',_0x58dc5f['name']),_0x49c4('0x59'),{'recordId':_0x2f966c['id']});break;case _0x49c4('0x5a'):emit(util[_0x49c4('0x4e')](_0x49c4('0x58'),_0x58dc5f['name']),'trigger:browser:url',{'uri':util[_0x49c4('0x4e')](_0x49c4('0x5c'),_0x147ebd[_0x49c4('0x5d')],_0x2f966c['id'])});break;default:logger[_0x49c4('0x5e')](_0x49c4('0x65'),_0x49c4('0x69'));}})[_0x49c4('0x6a')](function(_0x3b949d){logger['error'](_0x49c4('0x65'),JSON['stringify'](_0x3b949d));});};exports[_0x49c4('0x6b')]=function(_0x264902,_0x1a5d4c,_0x1ea1b4,_0x3a1c81,_0x2e062f,_0x13d657){var _0x3feb0b,_0x13d951,_0x1743d0,_0x1e3911;_0x13d657[_0x49c4('0x4a')]=intUtil[_0x49c4('0x4b')](_0x13d657[_0x49c4('0x4a')]);_0x13d657[_0x49c4('0x44')]=intUtil[_0x49c4('0x4b')](_0x13d657[_0x49c4('0x44')]);if(_0x2e062f&&_0x2e062f[_0x49c4('0x4c')]){logger['info']('[ABANDONED]',_0x49c4('0x4d'));_0x1a5d4c[_0x49c4('0x51')]=util['format'](_0x49c4('0x4f'),_0x13d657[_0x49c4('0x4a')],_0x1a5d4c[_0x49c4('0x50')],md5(_0x1a5d4c[_0x49c4('0x50')]));}else{_0x1a5d4c['recordingURL']='';}return getConnection(_0x13d657)['then'](function(_0x4a85d4){_0x1e3911=_0x4a85d4;if(!_[_0x49c4('0x6c')](_0x3a1c81)){return getUser(_0x13d657,_0x3a1c81[_0x49c4('0x3e')],_0x1e3911);}else{return getUser(_0x13d657,null,_0x1e3911);}})[_0x49c4('0x19')](function(_0x2f4289){_0x3feb0b=_0x2f4289;return getEndUser(_0x13d657,_0x1ea1b4,_0x1a5d4c[_0x49c4('0x53')],_0x1a5d4c[_0x49c4('0x54')],_0x1e3911);})[_0x49c4('0x19')](function(_0x3692a4){_0x13d951=_0x3692a4;return getTicket(_0x13d657,_0x3feb0b,_0x13d951,_0x1ea1b4,_0x1a5d4c,_0x1ea1b4[_0x49c4('0x55')],_0x1e3911);})['then'](function(_0x363b2e){_0x1743d0=_0x363b2e;logger[_0x49c4('0x1c')](_0x49c4('0x6d'),_0x1743d0['id']);logger['info'](_0x49c4('0x6e'),_0x13d657[_0x49c4('0x36')]);})[_0x49c4('0x6a')](function(_0xb6031b){logger[_0x49c4('0x5e')](_0x49c4('0x6f'),JSON[_0x49c4('0x61')](_0xb6031b));});}; \ No newline at end of file +var _0x0713=['instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','stringify','abandoned','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','Task','getString','Descriptions','assign','Subjects','ContactId','sobject','create','isNil','validateEmail','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','lead','Lead','Case','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','forEach','type','string','idField','variableName','toString','customVariable','Variable','name','toLowerCase','password','securityToken','remoteUri','clientId','login','username','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var md5=require(_0x3071('0x2'));var jsforce=require(_0x3071('0x3'));var util=require(_0x3071('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var logger=require(_0x3071('0x7'))(_0x3071('0x8'));config[_0x3071('0x9')]=_[_0x3071('0xa')](config[_0x3071('0x9')],{'host':_0x3071('0xb'),'port':0x18eb});var io=require(_0x3071('0xc'))(new Redis(config[_0x3071('0x9')]));function emit(_0x3e9a5e,_0x2fce7a,_0x1a868e){io['to'](_0x3e9a5e)['emit'](_0x2fce7a,_0x1a868e);}function getTicket(_0x3457cd,_0x2610b4,_0x937259,_0xff9a29,_0x1ce844,_0x4a470a,_0x2ace21,_0x11a7ee){var _0x401b4d={};if(_0xff9a29[_0x3071('0xd')]===_0x3071('0xe')){_0x401b4d=Object['assign']({},{'OwnerId':_0x2610b4['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3071('0xf')](_0xff9a29['Subjects'],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d['WhoId']=_0x937259['id'];}}else if(_0xff9a29[_0x3071('0xd')]==='Case'){_0x401b4d=Object[_0x3071('0x11')]({},{'OwnerId':_0x2610b4['id'],'Subject':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x12')],_0x1ce844,'\x20'),'Description':intUtil[_0x3071('0xf')](_0xff9a29[_0x3071('0x10')],_0x1ce844,'\x0a')},getCustomFields(_0x4a470a,_0x1ce844));if(_0x937259){_0x401b4d[_0x3071('0x13')]=_0x937259['id'];}}return _0x2ace21[_0x3071('0x14')](_0xff9a29[_0x3071('0xd')])[_0x3071('0x15')](_0x401b4d);}function getUser(_0x344ea6,_0x5f3c22,_0x224996){if(!_[_0x3071('0x16')](_0x5f3c22)&&intUtil[_0x3071('0x17')](_0x5f3c22)){var _0x108a83={'Email':_0x5f3c22};var _0x3acf0e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x224996[_0x3071('0x14')](_0x3071('0x18'))[_0x3071('0x19')](_0x108a83,_0x3acf0e)['execute']()[_0x3071('0x1a')](function(_0x2bfa33){if(_0x2bfa33[_0x3071('0x1b')]){var _0x56c267=_[_0x3071('0x19')](_0x2bfa33,function(_0x5cd80d){return _0x5cd80d[_0x3071('0x1c')]===_0x5f3c22;});if(_0x56c267){logger[_0x3071('0x1d')](_0x3071('0x1e'),_0x5f3c22);return BPromise[_0x3071('0x1f')]({'id':_0x56c267['Id'],'name':_0x56c267[_0x3071('0x20')]});}}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()['then'](function(_0x481a51){return BPromise[_0x3071('0x1f')]({'id':_0x481a51[_0x3071('0x23')],'name':_0x481a51[_0x3071('0x24')]});});}});}else{logger[_0x3071('0x1d')](_0x3071('0x21'),_0x5f3c22);return _0x224996[_0x3071('0x22')]()[_0x3071('0x1a')](function(_0x1fe727){return BPromise[_0x3071('0x1f')]({'id':_0x1fe727['user_id'],'name':_0x1fe727[_0x3071('0x24')]});});}}function getEndUser(_0x3f1e6e,_0x177138,_0x4d5c4b,_0x4fb1ca,_0x28792d){var _0x163604={'Phone':_0x4fb1ca};var _0x950fde={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3071('0x1f')]()[_0x3071('0x1a')](function(){if(_0x177138[_0x3071('0xd')]===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x177138[_0x3071('0x26')]);switch(_0x177138['moduleSearch']){case'contact_lead':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)[_0x3071('0x28')]()[_0x3071('0x1a')](function(_0x29538c){if(_0x29538c&&_0x29538c[_0x3071('0x1b')]){return _0x29538c;}else{return _0x28792d[_0x3071('0x14')]('Lead')['find'](_0x163604,_0x950fde);}});case'contact':return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))['find'](_0x163604,_0x950fde)[_0x3071('0x28')]();case _0x3071('0x29'):return _0x28792d[_0x3071('0x14')](_0x3071('0x2a'))['find'](_0x163604,_0x950fde);default:return null;}}else if(_0x177138[_0x3071('0xd')]===_0x3071('0x2b')){logger[_0x3071('0x1d')](_0x3071('0x25'),_0x4fb1ca,_0x3071('0x2c'));return _0x28792d[_0x3071('0x14')](_0x3071('0x27'))[_0x3071('0x19')](_0x163604,_0x950fde)['execute']();}})[_0x3071('0x1a')](function(_0x54e52f){if(_0x54e52f&&_0x54e52f['length']){var _0x1a1a64=_[_0x3071('0x19')](_0x54e52f,function(_0x54d9c3){return _0x54d9c3[_0x3071('0x2d')]===_0x4fb1ca;});if(_0x1a1a64){return BPromise[_0x3071('0x1f')]({'id':_0x1a1a64['Id'],'name':_0x1a1a64[_0x3071('0x20')],'phone':_0x1a1a64[_0x3071('0x2d')]});}}})[_0x3071('0x1a')](function(_0x232235){if(_0x232235){logger['info'](_0x3071('0x2e'),_0x4fb1ca);return BPromise[_0x3071('0x1f')](_0x232235);}else{logger['info'](_0x3071('0x2f'),_0x4fb1ca);var _0x5b1392={'LastName':_0x4d5c4b!==_0x3071('0x30')?_0x4d5c4b:util[_0x3071('0x31')]('Caller\x20-\x20%s',_0x4fb1ca),'Phone':_0x4fb1ca};if(_0x177138['moduleCreate']){if(_0x177138[_0x3071('0x32')]===_0x3071('0x2c')){logger[_0x3071('0x1d')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x4fb1ca,_0x177138[_0x3071('0x32')]);}else if(_0x177138['moduleCreate']===_0x3071('0x29')&&_0x177138['ticketType']===_0x3071('0xe')){logger[_0x3071('0x1d')](_0x3071('0x33'),_0x4fb1ca,_0x177138[_0x3071('0x32')]);_0x5b1392[_0x3071('0x34')]='No\x20Company';}else{return null;}}return _0x28792d['sobject'](_[_0x3071('0x35')](_0x177138[_0x3071('0x32')]))[_0x3071('0x15')](_0x5b1392);}});}function getCustomFields(_0x1f69a6,_0x525389){var _0x3cfc05={};if(_0x1f69a6[_0x3071('0x1b')]>0x0){_[_0x3071('0x36')](_0x1f69a6,function(_0x25c29f){if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x38')&&_0x25c29f['idField']){_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x25c29f['content']['toString']();}else if(_0x25c29f['type']==='variable'&&_0x25c29f[_0x3071('0x3a')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3a')]]&&(_0x3cfc05[_0x25c29f[_0x3071('0x39')]]=_0x525389[_0x25c29f[_0x3071('0x3a')]][_0x3071('0x3b')]());}else if(_0x25c29f[_0x3071('0x37')]===_0x3071('0x3c')&&_0x25c29f['Variable']&&_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]&&_0x25c29f[_0x3071('0x39')]){_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')]['toLowerCase']()]&&(_0x3cfc05[_0x25c29f['idField']]=_0x525389[_0x25c29f[_0x3071('0x3d')][_0x3071('0x3e')][_0x3071('0x3f')]()][_0x3071('0x3b')]());}});}return _0x3cfc05;}function getConnection(_0x606ef8){var _0x5db437=_0x606ef8[_0x3071('0x40')]['concat'](_0x606ef8[_0x3071('0x41')]);var _0x509178=new jsforce['Connection']({'oauth2':{'loginUrl':_0x606ef8[_0x3071('0x42')]||'https://login.salesforce.com','clientId':_0x606ef8[_0x3071('0x43')],'clientSecret':_0x606ef8['clientSecret']}});return _0x509178[_0x3071('0x44')](_0x606ef8[_0x3071('0x45')],_0x5db437)[_0x3071('0x1a')](function(){logger[_0x3071('0x1d')]('Connection\x20established.');return _0x509178;});}exports[_0x3071('0x46')]=function(_0x575c12,_0xd273ec,_0x4b6bbb,_0x46924d,_0x2060e9,_0x4d395a){var _0x131ae6,_0x117e73,_0x224a70,_0x38bcc2;_0x4d395a[_0x3071('0x47')]=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x47')]);_0x4d395a['remoteUri']=intUtil[_0x3071('0x48')](_0x4d395a[_0x3071('0x42')]);if(_0x2060e9&&_0x2060e9[_0x3071('0x49')]){logger[_0x3071('0x1d')]('[QUEUE]',_0x3071('0x4a'));_0xd273ec[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x4d395a[_0x3071('0x47')],_0xd273ec[_0x3071('0x4d')],md5(_0xd273ec[_0x3071('0x4d')]));}else{_0xd273ec[_0x3071('0x4b')]='';}return getConnection(_0x4d395a)[_0x3071('0x1a')](function(_0x886f7){_0x38bcc2=_0x886f7;return getUser(_0x4d395a,_0x46924d[_0x3071('0x4e')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x24977b){_0x131ae6=_0x24977b;return getEndUser(_0x4d395a,_0x4b6bbb,_0xd273ec[_0x3071('0x4f')],_0xd273ec[_0x3071('0x50')],_0x38bcc2);})[_0x3071('0x1a')](function(_0x596cdd){_0x117e73=_0x596cdd;return getTicket(_0x4d395a,_0x131ae6,_0x117e73,_0x4b6bbb,_0xd273ec,_0x4b6bbb['Fields'],_0x38bcc2,_0x3071('0x46'));})['then'](function(_0x403761){_0x224a70=_0x403761;logger[_0x3071('0x1d')](_0x3071('0x51'),_0x224a70['id']);logger['info'](_0x3071('0x52'),_0x224a70['id'],_0x46924d[_0x3071('0x3e')],_0x4d395a['type']);switch(_0x4d395a['type']){case _0x3071('0x53'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),'trigger:salesforce:display',{'recordId':_0x224a70['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')](_0x3071('0x54'),_0x46924d[_0x3071('0x3e')]),_0x3071('0x56'),{'uri':util['format'](_0x3071('0x57'),_0x38bcc2[_0x3071('0x58')],_0x224a70['id'])});break;default:logger[_0x3071('0x59')](_0x3071('0x5a'));}})[_0x3071('0x5b')](function(_0x24f429){logger[_0x3071('0x59')]('[QUEUE]',JSON['stringify'](_0x24f429));});};exports[_0x3071('0x5c')]=function(_0x4de4f3,_0xe96994,_0x26ba8a,_0x499b6a,_0x19dc95,_0x1bf911,_0x4d3886){var _0x108b14,_0x1878e2,_0x180344,_0x6e96c7;_0x1bf911[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x1bf911[_0x3071('0x47')]);_0x1bf911[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x1bf911['remoteUri']);if(_0x4d3886&&_0x4d3886[_0x3071('0x5d')]&&_0x4d3886[_0x3071('0x5d')]!==_0x3071('0x5e')){logger[_0x3071('0x1d')](_0x3071('0x5f'),_0x3071('0x4a'));_0xe96994[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x1bf911['serverUrl'],_0xe96994[_0x3071('0x4d')],md5(_0xe96994[_0x3071('0x4d')]));}return getConnection(_0x1bf911)[_0x3071('0x1a')](function(_0x26ecb2){_0x6e96c7=_0x26ecb2;return getUser(_0x1bf911,_0x499b6a[_0x3071('0x4e')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x389dca){_0x108b14=_0x389dca;return getEndUser(_0x1bf911,_0x26ba8a,_0xe96994[_0x3071('0x60')],_0xe96994[_0x3071('0x61')],_0x6e96c7);})[_0x3071('0x1a')](function(_0x195d03){_0x1878e2=_0x195d03;return getTicket(_0x1bf911,_0x108b14,_0x1878e2,_0x26ba8a,_0xe96994,_0x26ba8a['Fields'],_0x6e96c7,_0x3071('0x5c'));})[_0x3071('0x1a')](function(_0x279594){_0x180344=_0x279594;logger[_0x3071('0x1d')](_0x3071('0x62'),_0x180344['id']);logger[_0x3071('0x1d')](_0x3071('0x63'),_0x180344['id'],_0x499b6a[_0x3071('0x3e')],_0x1bf911['type']);switch(_0x1bf911[_0x3071('0x37')]){case _0x3071('0x53'):emit(util['format']('user:%s',_0x499b6a[_0x3071('0x3e')]),_0x3071('0x64'),{'recordId':_0x180344['id']});break;case _0x3071('0x55'):emit(util[_0x3071('0x31')]('user:%s',_0x499b6a['name']),_0x3071('0x56'),{'uri':util['format']('%s/%s/e',_0x6e96c7['instanceUrl'],_0x180344['id'])});break;default:logger['error'](_0x3071('0x5f'),_0x3071('0x65'));}})[_0x3071('0x5b')](function(_0x567d19){logger[_0x3071('0x59')](_0x3071('0x5f'),JSON[_0x3071('0x66')](_0x567d19));});};exports[_0x3071('0x67')]=function(_0x5a0c1b,_0x2103a4,_0x29841a,_0x588406,_0x1b35d3,_0x29ee70){var _0x388cd1,_0x40c258,_0x4edd23,_0x11ffdd;_0x29ee70[_0x3071('0x47')]=intUtil['stripTrailingSlash'](_0x29ee70['serverUrl']);_0x29ee70[_0x3071('0x42')]=intUtil[_0x3071('0x48')](_0x29ee70[_0x3071('0x42')]);if(_0x1b35d3&&_0x1b35d3['monitor_format']){logger['info'](_0x3071('0x68'),_0x3071('0x4a'));_0x2103a4[_0x3071('0x4b')]=util[_0x3071('0x31')](_0x3071('0x4c'),_0x29ee70[_0x3071('0x47')],_0x2103a4[_0x3071('0x4d')],md5(_0x2103a4[_0x3071('0x4d')]));}else{_0x2103a4['recordingURL']='';}return getConnection(_0x29ee70)[_0x3071('0x1a')](function(_0x5ea33f){_0x11ffdd=_0x5ea33f;if(!_[_0x3071('0x16')](_0x588406)){return getUser(_0x29ee70,_0x588406[_0x3071('0x3e')],_0x11ffdd);}else{return getUser(_0x29ee70,null,_0x11ffdd);}})[_0x3071('0x1a')](function(_0x2fbac7){_0x388cd1=_0x2fbac7;return getEndUser(_0x29ee70,_0x29841a,_0x2103a4[_0x3071('0x4f')],_0x2103a4[_0x3071('0x50')],_0x11ffdd);})[_0x3071('0x1a')](function(_0x2ae053){_0x40c258=_0x2ae053;return getTicket(_0x29ee70,_0x388cd1,_0x40c258,_0x29841a,_0x2103a4,_0x29841a['Fields'],_0x11ffdd);})[_0x3071('0x1a')](function(_0x138a94){_0x4edd23=_0x138a94;logger[_0x3071('0x1d')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x4edd23['id']);logger[_0x3071('0x1d')](_0x3071('0x69'),_0x29ee70[_0x3071('0x37')]);})['catch'](function(_0x521ee6){logger[_0x3071('0x59')]('[ABANDONED]',JSON[_0x3071('0x66')](_0x521ee6));});}; \ 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 e5785d5..bdf401e 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 _0x984b=['map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','format','emit','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','util','md5','ioredis','../../../../config/logger','servicenow','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','true','userId','adminEmail','catch','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','endUserId','],\x20createEndUser\x20crm','forEach','type','nameField','customField','idField','toLowerCase','content','toString','string','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all'];(function(_0x2a4eed,_0xf0ed64){var _0x38bc32=function(_0x420c23){while(--_0x420c23){_0x2a4eed['push'](_0x2a4eed['shift']());}};_0x38bc32(++_0xf0ed64);}(_0x984b,0xee));var _0xb984=function(_0x4e4393,_0x189ebb){_0x4e4393=_0x4e4393-0x0;var _0x593f1e=_0x984b[_0x4e4393];return _0x593f1e;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xb984('0x0'));var md5=require(_0xb984('0x1'));var Redis=require(_0xb984('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xb984('0x3'))(_0xb984('0x4'));config['redis']=_['defaults'](config[_0xb984('0x5')],{'host':_0xb984('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb984('0x5')]));function getAdminUser(_0x1a00d6,_0x4d72b7,_0x37fd36,_0x4e6b9a,_0x7624a2,_0x42dfd9){return new Promise(function(_0x124143,_0x2f4e77){var _0xf66bad={'method':_0xb984('0x7'),'uri':_0x4e6b9a+_0xb984('0x8')+'&'+_0x7624a2+'&'+_0x42dfd9,'auth':_0x4d72b7,'json':!![]};return rp(_0xf66bad)[_0xb984('0x9')](function(_0x16d46f){if(_0x16d46f[_0xb984('0xa')][_0xb984('0xb')]>0x0){_0x37fd36[_0xb984('0xc')]=_0x16d46f['result'][0x0][_0xb984('0xd')];}logger['info']('['+[_0x1a00d6[_0xb984('0xe')]()]+_0xb984('0xf'),_0x37fd36);_0x124143(_0x37fd36);})['catch'](function(_0x2caf88){logger[_0xb984('0x10')]('['+[_0x1a00d6['toUpperCase']()]+']',_0x2caf88[_0xb984('0x11')]);_0x2f4e77(_0x2caf88[_0xb984('0x11')]);});});}function getUser(_0x549791,_0xede12d,_0x4073cb,_0x57365c,_0x6fae41){return function(_0x5cd1aa){logger[_0xb984('0x12')]('['+[_0x549791[_0xb984('0xe')]()]+_0xb984('0x13'),_0x5cd1aa);return new Promise(function(_0x3f7cff,_0x59dcb7){if(intUtil[_0xb984('0x14')](_0x5cd1aa[_0xb984('0x15')])){var _0x3a5c96={'method':_0xb984('0x7'),'uri':_0x4073cb+_0xb984('0x16')+_0x5cd1aa[_0xb984('0x15')]+'&'+_0x57365c+'&'+_0x6fae41,'auth':_0xede12d,'json':!![]};logger['info']('['+[_0x549791[_0xb984('0xe')]()]+_0xb984('0x17'),_0x3a5c96);return rp(_0x3a5c96)[_0xb984('0x9')](function(_0x3870ba){logger[_0xb984('0x12')]('['+[_0x549791[_0xb984('0xe')]()]+'],\x20getUser\x20entity',_0x3870ba);if(_0x3870ba[_0xb984('0xa')][_0xb984('0xb')]>0x0&&String(_0x3870ba['result'][0x0][_0xb984('0x18')])===_0xb984('0x19')){_0x5cd1aa[_0xb984('0x1a')]=_0x3870ba[_0xb984('0xa')][0x0][_0xb984('0xd')];}else{_0x5cd1aa[_0xb984('0x1a')]=_0x5cd1aa[_0xb984('0xc')];_0x5cd1aa['userEmail']=_0x5cd1aa[_0xb984('0x1b')];}logger[_0xb984('0x12')]('['+[_0x549791[_0xb984('0xe')]()]+'],\x20getUser\x20crm',_0x5cd1aa);_0x3f7cff(_0x5cd1aa);})[_0xb984('0x1c')](function(_0x2e806e){logger[_0xb984('0x10')]('['+[_0x549791[_0xb984('0xe')]()]+']',_0x2e806e[_0xb984('0x11')]);_0x59dcb7(_0x2e806e[_0xb984('0x11')]);});}else{logger[_0xb984('0x12')]('['+[_0x549791[_0xb984('0xe')]()]+']\x20using\x20admin\x20profile');_0x5cd1aa[_0xb984('0x1a')]=_0x5cd1aa[_0xb984('0xc')];_0x5cd1aa[_0xb984('0x15')]=_0x5cd1aa[_0xb984('0x1b')];_0x3f7cff(_0x5cd1aa);}});};}function createEndUser(_0x4fb896,_0xa44895,_0x67e4d3,_0x476811,_0x482a9f){logger[_0xb984('0x12')]('['+[_0x4fb896[_0xb984('0xe')]()]+_0xb984('0x1d'),_0x67e4d3);return new Promise(function(_0x3d2757,_0x4d00a8){var _0x5b8da1={'method':'POST','uri':_0x476811+_0xb984('0x1e')+_0x482a9f,'body':{'user_name':_0x67e4d3[_0xb984('0x1f')],'roles':'user','first_name':_0x67e4d3[_0xb984('0x1f')],'active':_0xb984('0x19'),'date_format':_0xb984('0x20'),'phone':_0x67e4d3[_0xb984('0x1f')]},'auth':_0xa44895,'json':!![]};return rp(_0x5b8da1)['then'](function(_0x4bb6da){logger[_0xb984('0x12')]('['+[_0x4fb896[_0xb984('0xe')]()]+_0xb984('0x21'),_0x4bb6da[_0xb984('0xa')]);_0x67e4d3['endUserId']=_0x4bb6da[_0xb984('0xa')][_0xb984('0xd')];_0x3d2757(_0x67e4d3);})[_0xb984('0x1c')](function(_0x3c4687){logger[_0xb984('0x10')]('['+[_0x4fb896[_0xb984('0xe')]()]+']',_0x3c4687['message']);_0x4d00a8(_0x3c4687[_0xb984('0x11')]);});});}function getEndUser(_0x2f7eca,_0x523784,_0x2ed13e,_0x371c6a,_0x30891c){return function(_0x55dc81){logger[_0xb984('0x12')]('['+[_0x2f7eca[_0xb984('0xe')]()]+'],\x20getEndUser\x20input\x20crm',_0x55dc81);return new Promise(function(_0x578a80,_0x13a950){var _0x4a440d={'method':_0xb984('0x7'),'uri':_0x2ed13e+_0xb984('0x22')+_0x55dc81['endUserNumber']+'&'+_0x371c6a+'&'+_0x30891c,'auth':_0x523784,'json':!![]};return rp(_0x4a440d)[_0xb984('0x9')](function(_0x4f2f3d){if(_0x4f2f3d[_0xb984('0xa')]['length']>0x0){_0x55dc81[_0xb984('0x23')]=_0x4f2f3d['result'][0x0]['sys_id'];logger[_0xb984('0x12')]('['+[_0x2f7eca[_0xb984('0xe')]()]+'],\x20getEndUser\x20crm',_0x55dc81);_0x578a80(_0x55dc81);}else{return createEndUser(_0x2f7eca,_0x523784,_0x55dc81,_0x2ed13e,_0x371c6a)[_0xb984('0x9')](function(_0x1fd248){logger['info']('['+[_0x2f7eca[_0xb984('0xe')]()]+_0xb984('0x24'),_0x1fd248);_0x578a80(_0x1fd248);});}})[_0xb984('0x1c')](function(_0x35f2c1){logger['error']('['+[_0x2f7eca[_0xb984('0xe')]()]+']',_0x35f2c1[_0xb984('0x11')]);_0x13a950(_0x35f2c1[_0xb984('0x11')]);});});};}function getCustomFields(_0x474fbd,_0x2d93d5){var _0x345a60={};if(_0x474fbd[_0xb984('0xb')]>0x0){_[_0xb984('0x25')](_0x474fbd,function(_0x1df786){if(_0x1df786[_0xb984('0x26')]==='string'&&_0x1df786[_0xb984('0x27')]&&!_0x1df786[_0xb984('0x28')]){_0x345a60[_0x1df786[_0xb984('0x29')][_0xb984('0x2a')]()]=_0x1df786[_0xb984('0x2b')][_0xb984('0x2c')]();}else if(_0x1df786[_0xb984('0x26')]===_0xb984('0x2d')&&_0x1df786['idField']&&_0x1df786['customField']){_0x345a60[_0x1df786[_0xb984('0x29')]['toLowerCase']()]=_0x1df786[_0xb984('0x2b')][_0xb984('0x2c')]();}else if(_0x1df786[_0xb984('0x26')]===_0xb984('0x2e')&&_0x1df786['variableName']&&_0x1df786[_0xb984('0x29')]&&_0x1df786[_0xb984('0x28')]){_0x345a60[_0x1df786['idField'][_0xb984('0x2a')]()]=_0x2d93d5[_0x1df786[_0xb984('0x2f')]][_0xb984('0x2c')]();}else if(_0x1df786[_0xb984('0x26')]===_0xb984('0x30')&&_0x1df786[_0xb984('0x31')]&&_0x1df786[_0xb984('0x31')]['name']&&_0x1df786[_0xb984('0x29')]&&_0x1df786[_0xb984('0x28')]){_0x345a60[_0x1df786['idField']['toLowerCase']()]=_0x2d93d5[_0x1df786[_0xb984('0x31')][_0xb984('0x32')][_0xb984('0x2a')]()][_0xb984('0x2c')]();}});}return _0x345a60;}function getTicket(_0x1acc7a,_0x56a3bf,_0x664cb1,_0x40666f,_0x424f65,_0x25413d){return function(_0x460a7e){logger[_0xb984('0x12')]('['+[_0x1acc7a[_0xb984('0xe')]()]+_0xb984('0x33'),_0x460a7e);return new Promise(function(_0x23b95b,_0x271c48){var _0x5bee67=_0x1acc7a[_0xb984('0x2a')]()===_0xb984('0x34')?_0x460a7e['userId']:_0x460a7e[_0xb984('0x23')];var _0x436597={'method':_0xb984('0x35'),'uri':_0x664cb1+_0xb984('0x36')+'?'+_0x25413d,'body':Object[_0xb984('0x37')]({},{'active':_0xb984('0x19'),'caller_id':_0x5bee67,'assigned_to':_0x460a7e[_0xb984('0x1a')],'short_description':intUtil[_0xb984('0x38')](_0x40666f[_0xb984('0x39')],_0x424f65,'\x20'),'description':intUtil[_0xb984('0x38')](_0x40666f['Descriptions'],_0x424f65,'\x0a')},getCustomFields(_0x40666f[_0xb984('0x3a')],_0x424f65)),'auth':_0x56a3bf,'json':!![]};return rp(_0x436597)[_0xb984('0x9')](function(_0x262898){logger[_0xb984('0x12')]('['+[_0x1acc7a[_0xb984('0xe')]()]+_0xb984('0x3b'),_0x262898[_0xb984('0xa')]);_0x460a7e[_0xb984('0x3c')]=_0x262898[_0xb984('0xa')]['sys_id'];_0x460a7e[_0xb984('0x3d')]=_0x262898[_0xb984('0xa')][_0xb984('0x3e')];logger['info']('['+[_0x1acc7a[_0xb984('0xe')]()]+_0xb984('0x3f'),_0x460a7e);_0x23b95b(_0x460a7e);})['catch'](function(_0xdb477){logger['error']('['+[_0x1acc7a[_0xb984('0xe')]()]+']',_0xdb477[_0xb984('0x11')]);_0x271c48(_0xdb477['message']);});});};}function createRemoteTag(_0xa51a2d,_0x38b1cb,_0x22afea,_0x3ddeb5){return new Promise(function(_0xbf328d,_0x1fb5da){var _0x5e8501={'method':_0xb984('0x35'),'uri':_0x22afea+'label'+'?'+_0x3ddeb5,'body':{'short_description':_0xa51a2d,'global':!![],'active':!![],'name':_0xa51a2d},'auth':_0x38b1cb,'json':!![]};return rp(_0x5e8501)[_0xb984('0x9')](function(_0x40b54d){var _0x260825=_0x40b54d['result']['sys_id'];_0xbf328d(_0x260825);});});}function getRemoteTag(_0xeb208e,_0x2dfaf8,_0x56ad15,_0x493a8b,_0x1e8847){return new Promise(function(_0x30c135,_0x38cca4){var _0x3daaa0={'method':_0xb984('0x7'),'uri':_0x56ad15+_0xb984('0x40')+'?sysparm_query=name%3D'+_0xeb208e+'&'+_0x493a8b,'auth':_0x2dfaf8,'json':!![]};return rp(_0x3daaa0)['then'](function(_0x3dcdf1){if(_0x3dcdf1[_0xb984('0xa')]['length']>0x0){var _0x727af2=_0x3dcdf1[_0xb984('0xa')][0x0][_0xb984('0xd')];_0x30c135(_0x727af2);}else{return createRemoteTag(_0xeb208e,_0x2dfaf8,_0x56ad15,_0x493a8b)[_0xb984('0x9')](function(_0x529f64){_0x30c135(_0x529f64);});}});});}function assignTagToIncident(_0x4d719c,_0x226db2,_0x36a9eb,_0x2fc1f7,_0x29c79d){return new Promise(function(_0x3bdadc,_0x3cc2a0){var _0x49ecfd={'method':_0xb984('0x35'),'uri':_0x36a9eb+_0xb984('0x41')+'?'+_0x29c79d,'body':{'label':_0x4d719c,'table':_0xb984('0x36'),'id_type':_0xb984('0x42'),'table_key':_0x2fc1f7[_0xb984('0x3c')],'title':_0xb984('0x43')+_0x2fc1f7['ticketNumber'],'id_display':_0x2fc1f7['ticketNumber']},'auth':_0x226db2,'json':!![]};return rp(_0x49ecfd)['then'](function(_0x1b596d){_0x3bdadc();})[_0xb984('0x1c')](function(){_0x3bdadc();});});}function manageTags(_0x36ca94,_0x475d49,_0x19c6e7,_0x5040ed,_0x434bca,_0x32aa84,_0x356442){return new Promise(function(_0x5549f3,_0x935abe){var _0x10e37b=[];_0x475d49['forEach'](function(_0x4b52ed){_0x10e37b[_0xb984('0x44')](getRemoteTag(_0x4b52ed,_0x19c6e7,_0x5040ed,_0x32aa84,_0x356442));});return Promise['all'](_0x10e37b)['then'](function(_0x174384){if(_0x174384['length']){logger[_0xb984('0x12')]('['+[_0x36ca94[_0xb984('0xe')]()]+_0xb984('0x45'),_0x174384);var _0x146f71=[];_0x174384[_0xb984('0x25')](function(_0x4378f7){_0x146f71[_0xb984('0x44')](assignTagToIncident(_0x4378f7,_0x19c6e7,_0x5040ed,_0x434bca,_0x32aa84));});return Promise[_0xb984('0x46')](_0x146f71)[_0xb984('0x9')](function(){_0x5549f3();})[_0xb984('0x1c')](function(){_0x5549f3();});}else{_0x5549f3();}});});}function getTags(_0x742a0f,_0x1d9213,_0x479b52,_0x284df9,_0x5f126e,_0x35ca06){return function(_0x511780){return new Promise(function(_0x54abb4,_0x2adf1d){var _0x285e1e=[];var _0x74fc95=_0x284df9['Tags'];if(_0x74fc95&&_0x74fc95[_0xb984('0xb')]>0x0){_0x285e1e=_[_0xb984('0x47')](_0x74fc95,_0xb984('0x32'));}if(_0x285e1e[_0xb984('0xb')]>0x0){return manageTags(_0x742a0f,_0x285e1e,_0x1d9213,_0x479b52,_0x511780,_0x5f126e,_0x35ca06)[_0xb984('0x9')](function(){_0x54abb4(_0x511780);});}else{_0x54abb4(_0x511780);}});};}function emit(_0x1793e2,_0x2e0df9,_0xdf1105){var _0x1d7e1e=_0xb984('0x48')+_0xb984('0x49')+_0xb984('0x4a')+_0xb984('0x4b');var _0x9ea21f={'uri':_0x1793e2+'/nav_to.do?uri=incident.do?sys_id%3D'+_0xdf1105+_0x1d7e1e};io['to'](util[_0xb984('0x4c')]('user:%s',_0x2e0df9))[_0xb984('0x4d')]('trigger:browser:url',_0x9ea21f);}exports['cs']=function(_0x3cfd28,_0x59ce18,_0x278a0d,_0xae996e,_0x33b124,_0x32e1c2,_0x2eb8bf,_0x2319aa){var _0x3bc1d3={};var _0x40a9ac={'user':_0x32e1c2[_0xb984('0x4e')],'pass':_0x32e1c2[_0xb984('0x4f')]};var _0x23c3d5='sysparm_limit=1';var _0x4886bf=_0xb984('0x50');_0x32e1c2[_0xb984('0x51')]=intUtil[_0xb984('0x52')](_0x32e1c2['remoteUri']);_0x32e1c2[_0xb984('0x53')]=intUtil[_0xb984('0x52')](_0x32e1c2['serverUrl']);var _0x4ebe30=util['format'](_0xb984('0x54'),_0x32e1c2['remoteUri']);_0x3bc1d3['userEmail']=!_['isNil'](_0xae996e)?_0xae996e[_0xb984('0x55')]:null;_0x3bc1d3[_0xb984('0x1b')]=_0x32e1c2[_0xb984('0x55')];_0x3bc1d3[_0xb984('0x1f')]=_0x2319aa['toLowerCase']()==='outbound'?_0x59ce18[_0xb984('0x56')]:_0x59ce18[_0xb984('0x57')];_0x3bc1d3[_0xb984('0x58')]=_0x2319aa===_0xb984('0x59')||_0x2319aa===_0xb984('0x5a')?'queue':_0xb984('0x34');var _0x3e7ed1=util[_0xb984('0x4c')](_0xb984('0x5b'),_0x32e1c2[_0xb984('0x53')],_0x59ce18[_0xb984('0x5c')],md5(_0x59ce18['uniqueid']));if(_0x33b124&&_0x33b124[_0xb984('0x5d')]){logger['info'](_0xb984('0x5e'),_0xb984('0x5f'));_0x59ce18[_0xb984('0x60')]=_0x3e7ed1;}else if(_0x2eb8bf&&_0x2eb8bf[_0xb984('0x61')]&&_0x2eb8bf[_0xb984('0x61')]!=='none'){logger[_0xb984('0x12')](_0xb984('0x62'),_0xb984('0x5f'));_0x59ce18['recordingURL']=_0x3e7ed1;}else{_0x59ce18[_0xb984('0x60')]='';}return getAdminUser(_0x2319aa,_0x40a9ac,_0x3bc1d3,_0x4ebe30,_0x4886bf,_0x23c3d5)[_0xb984('0x9')](getUser(_0x2319aa,_0x40a9ac,_0x4ebe30,_0x4886bf,_0x23c3d5))[_0xb984('0x9')](getEndUser(_0x2319aa,_0x40a9ac,_0x4ebe30,_0x4886bf,_0x23c3d5))[_0xb984('0x9')](getTicket(_0x2319aa,_0x40a9ac,_0x4ebe30,_0x278a0d,_0x59ce18,_0x4886bf))[_0xb984('0x9')](function(_0x5e2e0c){logger['info'](util[_0xb984('0x4c')](_0xb984('0x63'),_0x5e2e0c[_0xb984('0x3c')]));logger[_0xb984('0x12')](util['format'](_0xb984('0x64'),_0x2319aa));if(_0x2319aa!==_0xb984('0x5a')){logger[_0xb984('0x12')]('['+[_0x2319aa[_0xb984('0xe')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x32e1c2[_0xb984('0x51')],_0xae996e[_0xb984('0x32')],_0x5e2e0c[_0xb984('0x3c')]);}})[_0xb984('0x1c')](function(_0x484a35){logger[_0xb984('0x10')]('['+[_0x2319aa[_0xb984('0xe')]()]+_0xb984('0x65'),util[_0xb984('0x66')](_0x484a35,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3036=['?sysparm_query=name%3D','Incident\x20-\x20','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','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','password','sysparm_limit=1','stripTrailingSlash','remoteUri','serverUrl','email','calleridnum','callDirection','abandoned','queue','uniqueid','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','ticketId','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','request-promise','util','md5','./util','redis','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','true','userId','adminId','adminEmail','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','endUserId','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','toLowerCase','toString','idField','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber',']\x20getTicket\x20crm','label'];(function(_0x5deea5,_0x230d81){var _0x3d1998=function(_0x39341d){while(--_0x39341d){_0x5deea5['push'](_0x5deea5['shift']());}};_0x3d1998(++_0x230d81);}(_0x3036,0x1a9));var _0x6303=function(_0x5cc228,_0x57c8e3){_0x5cc228=_0x5cc228-0x0;var _0x52bd2f=_0x3036[_0x5cc228];return _0x52bd2f;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require(_0x6303('0x0'));var util=require(_0x6303('0x1'));var md5=require(_0x6303('0x2'));var Redis=require('ioredis');var intUtil=require(_0x6303('0x3'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0x6303('0x4')]=_['defaults'](config[_0x6303('0x4')],{'host':_0x6303('0x5'),'port':0x18eb});var io=require(_0x6303('0x6'))(new Redis(config['redis']));function getAdminUser(_0x8a0038,_0x420da8,_0x2e2be8,_0x469401,_0x7f88f,_0x2684ac){return new Promise(function(_0x23b326,_0x179151){var _0x3eccd5={'method':'GET','uri':_0x469401+_0x6303('0x7')+'&'+_0x7f88f+'&'+_0x2684ac,'auth':_0x420da8,'json':!![]};return rp(_0x3eccd5)[_0x6303('0x8')](function(_0x3ac7ef){if(_0x3ac7ef[_0x6303('0x9')][_0x6303('0xa')]>0x0){_0x2e2be8['adminId']=_0x3ac7ef[_0x6303('0x9')][0x0][_0x6303('0xb')];}logger[_0x6303('0xc')]('['+[_0x8a0038[_0x6303('0xd')]()]+_0x6303('0xe'),_0x2e2be8);_0x23b326(_0x2e2be8);})['catch'](function(_0x5ef678){logger['error']('['+[_0x8a0038[_0x6303('0xd')]()]+']',_0x5ef678[_0x6303('0xf')]);_0x179151(_0x5ef678[_0x6303('0xf')]);});});}function getUser(_0x3e72aa,_0x2bbc57,_0x43526d,_0x3395e0,_0x2c4cbd){return function(_0x13874f){logger['info']('['+[_0x3e72aa['toUpperCase']()]+_0x6303('0x10'),_0x13874f);return new Promise(function(_0xc26f2c,_0x46c724){if(intUtil[_0x6303('0x11')](_0x13874f[_0x6303('0x12')])){var _0x4fe5cf={'method':_0x6303('0x13'),'uri':_0x43526d+_0x6303('0x14')+_0x13874f[_0x6303('0x12')]+'&'+_0x3395e0+'&'+_0x2c4cbd,'auth':_0x2bbc57,'json':!![]};logger[_0x6303('0xc')]('['+[_0x3e72aa[_0x6303('0xd')]()]+_0x6303('0x15'),_0x4fe5cf);return rp(_0x4fe5cf)[_0x6303('0x8')](function(_0x1211b4){logger[_0x6303('0xc')]('['+[_0x3e72aa[_0x6303('0xd')]()]+_0x6303('0x16'),_0x1211b4);if(_0x1211b4['result']['length']>0x0&&String(_0x1211b4[_0x6303('0x9')][0x0][_0x6303('0x17')])===_0x6303('0x18')){_0x13874f[_0x6303('0x19')]=_0x1211b4['result'][0x0][_0x6303('0xb')];}else{_0x13874f[_0x6303('0x19')]=_0x13874f[_0x6303('0x1a')];_0x13874f[_0x6303('0x12')]=_0x13874f[_0x6303('0x1b')];}logger[_0x6303('0xc')]('['+[_0x3e72aa[_0x6303('0xd')]()]+'],\x20getUser\x20crm',_0x13874f);_0xc26f2c(_0x13874f);})['catch'](function(_0x135434){logger[_0x6303('0x1c')]('['+[_0x3e72aa['toUpperCase']()]+']',_0x135434[_0x6303('0xf')]);_0x46c724(_0x135434[_0x6303('0xf')]);});}else{logger[_0x6303('0xc')]('['+[_0x3e72aa['toUpperCase']()]+_0x6303('0x1d'));_0x13874f[_0x6303('0x19')]=_0x13874f[_0x6303('0x1a')];_0x13874f[_0x6303('0x12')]=_0x13874f[_0x6303('0x1b')];_0xc26f2c(_0x13874f);}});};}function createEndUser(_0x24b2fc,_0x411c12,_0x3bcf79,_0x62e4b,_0x29cd61){logger[_0x6303('0xc')]('['+[_0x24b2fc['toUpperCase']()]+_0x6303('0x1e'),_0x3bcf79);return new Promise(function(_0x4d1e98,_0x206878){var _0x544107={'method':'POST','uri':_0x62e4b+_0x6303('0x1f')+_0x29cd61,'body':{'user_name':_0x3bcf79[_0x6303('0x20')],'roles':_0x6303('0x21'),'first_name':_0x3bcf79['endUserNumber'],'active':'true','date_format':_0x6303('0x22'),'phone':_0x3bcf79['endUserNumber']},'auth':_0x411c12,'json':!![]};return rp(_0x544107)['then'](function(_0x57f803){logger[_0x6303('0xc')]('['+[_0x24b2fc[_0x6303('0xd')]()]+_0x6303('0x23'),_0x57f803[_0x6303('0x9')]);_0x3bcf79['endUserId']=_0x57f803[_0x6303('0x9')][_0x6303('0xb')];_0x4d1e98(_0x3bcf79);})[_0x6303('0x24')](function(_0x591fdb){logger['error']('['+[_0x24b2fc[_0x6303('0xd')]()]+']',_0x591fdb['message']);_0x206878(_0x591fdb[_0x6303('0xf')]);});});}function getEndUser(_0x11b368,_0x3e4767,_0x2db401,_0x470f56,_0x57dc5d){return function(_0x12878f){logger[_0x6303('0xc')]('['+[_0x11b368[_0x6303('0xd')]()]+_0x6303('0x25'),_0x12878f);return new Promise(function(_0x2fee5c,_0x50731e){var _0xfeaac9={'method':_0x6303('0x13'),'uri':_0x2db401+_0x6303('0x26')+_0x12878f[_0x6303('0x20')]+'&'+_0x470f56+'&'+_0x57dc5d,'auth':_0x3e4767,'json':!![]};return rp(_0xfeaac9)[_0x6303('0x8')](function(_0x540eb5){if(_0x540eb5[_0x6303('0x9')]['length']>0x0){_0x12878f[_0x6303('0x27')]=_0x540eb5[_0x6303('0x9')][0x0][_0x6303('0xb')];logger['info']('['+[_0x11b368['toUpperCase']()]+_0x6303('0x28'),_0x12878f);_0x2fee5c(_0x12878f);}else{return createEndUser(_0x11b368,_0x3e4767,_0x12878f,_0x2db401,_0x470f56)['then'](function(_0x2e099d){logger[_0x6303('0xc')]('['+[_0x11b368[_0x6303('0xd')]()]+'],\x20createEndUser\x20crm',_0x2e099d);_0x2fee5c(_0x2e099d);});}})['catch'](function(_0x1f0857){logger[_0x6303('0x1c')]('['+[_0x11b368[_0x6303('0xd')]()]+']',_0x1f0857[_0x6303('0xf')]);_0x50731e(_0x1f0857[_0x6303('0xf')]);});});};}function getCustomFields(_0x38f4b6,_0x54861c){var _0x375379={};if(_0x38f4b6['length']>0x0){_[_0x6303('0x29')](_0x38f4b6,function(_0x5c466f){if(_0x5c466f[_0x6303('0x2a')]===_0x6303('0x2b')&&_0x5c466f[_0x6303('0x2c')]&&!_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f['idField'][_0x6303('0x2e')]()]=_0x5c466f['content'][_0x6303('0x2f')]();}else if(_0x5c466f[_0x6303('0x2a')]==='string'&&_0x5c466f[_0x6303('0x30')]&&_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f['idField'][_0x6303('0x2e')]()]=_0x5c466f['content'][_0x6303('0x2f')]();}else if(_0x5c466f['type']==='variable'&&_0x5c466f['variableName']&&_0x5c466f[_0x6303('0x30')]&&_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f['idField']['toLowerCase']()]=_0x54861c[_0x5c466f[_0x6303('0x31')]][_0x6303('0x2f')]();}else if(_0x5c466f['type']===_0x6303('0x32')&&_0x5c466f[_0x6303('0x33')]&&_0x5c466f[_0x6303('0x33')][_0x6303('0x34')]&&_0x5c466f['idField']&&_0x5c466f[_0x6303('0x2d')]){_0x375379[_0x5c466f[_0x6303('0x30')][_0x6303('0x2e')]()]=_0x54861c[_0x5c466f['Variable'][_0x6303('0x34')][_0x6303('0x2e')]()][_0x6303('0x2f')]();}});}return _0x375379;}function getTicket(_0x2c19fd,_0x692daa,_0x26558c,_0x548270,_0x4c78d7,_0x46c1b8){return function(_0x3e8366){logger['info']('['+[_0x2c19fd[_0x6303('0xd')]()]+_0x6303('0x35'),_0x3e8366);return new Promise(function(_0x362fee,_0x3cbf35){var _0x4a5a84=_0x2c19fd[_0x6303('0x2e')]()===_0x6303('0x36')?_0x3e8366[_0x6303('0x19')]:_0x3e8366[_0x6303('0x27')];var _0x4b5e69={'method':_0x6303('0x37'),'uri':_0x26558c+_0x6303('0x38')+'?'+_0x46c1b8,'body':Object['assign']({},{'active':_0x6303('0x18'),'caller_id':_0x4a5a84,'assigned_to':_0x3e8366[_0x6303('0x19')],'short_description':intUtil[_0x6303('0x39')](_0x548270[_0x6303('0x3a')],_0x4c78d7,'\x20'),'description':intUtil[_0x6303('0x39')](_0x548270[_0x6303('0x3b')],_0x4c78d7,'\x0a')},getCustomFields(_0x548270[_0x6303('0x3c')],_0x4c78d7)),'auth':_0x692daa,'json':!![]};return rp(_0x4b5e69)[_0x6303('0x8')](function(_0x36ab4e){logger[_0x6303('0xc')]('['+[_0x2c19fd[_0x6303('0xd')]()]+_0x6303('0x3d'),_0x36ab4e[_0x6303('0x9')]);_0x3e8366['ticketId']=_0x36ab4e[_0x6303('0x9')]['sys_id'];_0x3e8366[_0x6303('0x3e')]=_0x36ab4e[_0x6303('0x9')]['number'];logger['info']('['+[_0x2c19fd[_0x6303('0xd')]()]+_0x6303('0x3f'),_0x3e8366);_0x362fee(_0x3e8366);})[_0x6303('0x24')](function(_0x3707af){logger[_0x6303('0x1c')]('['+[_0x2c19fd[_0x6303('0xd')]()]+']',_0x3707af[_0x6303('0xf')]);_0x3cbf35(_0x3707af[_0x6303('0xf')]);});});};}function createRemoteTag(_0x6a4ef2,_0x47705a,_0x21315d,_0x24d56d){return new Promise(function(_0xcd7bd0,_0x5db7b0){var _0x3370a2={'method':'POST','uri':_0x21315d+'label'+'?'+_0x24d56d,'body':{'short_description':_0x6a4ef2,'global':!![],'active':!![],'name':_0x6a4ef2},'auth':_0x47705a,'json':!![]};return rp(_0x3370a2)['then'](function(_0x4a6bde){var _0x4a01ac=_0x4a6bde['result']['sys_id'];_0xcd7bd0(_0x4a01ac);});});}function getRemoteTag(_0x451289,_0x1c297b,_0x519701,_0x1c0935,_0x5be5f5){return new Promise(function(_0x47cc7e,_0x11414b){var _0x1cd73d={'method':_0x6303('0x13'),'uri':_0x519701+_0x6303('0x40')+_0x6303('0x41')+_0x451289+'&'+_0x1c0935,'auth':_0x1c297b,'json':!![]};return rp(_0x1cd73d)[_0x6303('0x8')](function(_0x36ff1e){if(_0x36ff1e[_0x6303('0x9')][_0x6303('0xa')]>0x0){var _0x1be9bd=_0x36ff1e['result'][0x0][_0x6303('0xb')];_0x47cc7e(_0x1be9bd);}else{return createRemoteTag(_0x451289,_0x1c297b,_0x519701,_0x1c0935)['then'](function(_0x6925dd){_0x47cc7e(_0x6925dd);});}});});}function assignTagToIncident(_0x2aa59c,_0x6c6ebc,_0x22bb6a,_0x370044,_0x4beaad){return new Promise(function(_0x5883bb,_0x3de3a4){var _0x502eb0={'method':_0x6303('0x37'),'uri':_0x22bb6a+'label_entry'+'?'+_0x4beaad,'body':{'label':_0x2aa59c,'table':_0x6303('0x38'),'id_type':'Incident','table_key':_0x370044['ticketId'],'title':_0x6303('0x42')+_0x370044[_0x6303('0x3e')],'id_display':_0x370044['ticketNumber']},'auth':_0x6c6ebc,'json':!![]};return rp(_0x502eb0)[_0x6303('0x8')](function(_0x22132e){_0x5883bb();})[_0x6303('0x24')](function(){_0x5883bb();});});}function manageTags(_0x3f77c7,_0x50879d,_0x1e63c7,_0x19ef9b,_0x2b4469,_0x24e1d3,_0x1bbdf9){return new Promise(function(_0x4d3d24,_0x5d8bea){var _0x3f9fb4=[];_0x50879d[_0x6303('0x29')](function(_0x2f9aec){_0x3f9fb4['push'](getRemoteTag(_0x2f9aec,_0x1e63c7,_0x19ef9b,_0x24e1d3,_0x1bbdf9));});return Promise[_0x6303('0x43')](_0x3f9fb4)[_0x6303('0x8')](function(_0x35c787){if(_0x35c787[_0x6303('0xa')]){logger[_0x6303('0xc')]('['+[_0x3f77c7[_0x6303('0xd')]()]+_0x6303('0x44'),_0x35c787);var _0x4eaa6c=[];_0x35c787[_0x6303('0x29')](function(_0x141367){_0x4eaa6c[_0x6303('0x45')](assignTagToIncident(_0x141367,_0x1e63c7,_0x19ef9b,_0x2b4469,_0x24e1d3));});return Promise['all'](_0x4eaa6c)[_0x6303('0x8')](function(){_0x4d3d24();})[_0x6303('0x24')](function(){_0x4d3d24();});}else{_0x4d3d24();}});});}function getTags(_0x561830,_0xfd4139,_0x2335ef,_0x5c8adf,_0x10c643,_0x41631c){return function(_0x420b4c){return new Promise(function(_0xe30024,_0x24e5fd){var _0x3c7161=[];var _0x452c5d=_0x5c8adf[_0x6303('0x46')];if(_0x452c5d&&_0x452c5d['length']>0x0){_0x3c7161=_[_0x6303('0x47')](_0x452c5d,_0x6303('0x34'));}if(_0x3c7161[_0x6303('0xa')]>0x0){return manageTags(_0x561830,_0x3c7161,_0xfd4139,_0x2335ef,_0x420b4c,_0x10c643,_0x41631c)[_0x6303('0x8')](function(){_0xe30024(_0x420b4c);});}else{_0xe30024(_0x420b4c);}});};}function emit(_0x2f01e5,_0xe708ef,_0x5b99a9){var _0x531f11=_0x6303('0x48')+_0x6303('0x49')+_0x6303('0x4a')+'%255EORDERBYDESCnumber';var _0x571e25={'uri':_0x2f01e5+_0x6303('0x4b')+_0x5b99a9+_0x531f11};io['to'](util[_0x6303('0x4c')](_0x6303('0x4d'),_0xe708ef))['emit']('trigger:browser:url',_0x571e25);}exports['cs']=function(_0x9f2209,_0xce52e,_0x4cc4f2,_0x3095c1,_0x5d43e8,_0x1cbcb1,_0x2641eb,_0x4f0277){var _0x4876a2={};var _0x289885={'user':_0x1cbcb1['username'],'pass':_0x1cbcb1[_0x6303('0x4e')]};var _0x2d66a5=_0x6303('0x4f');var _0x12c84c='sysparm_display_value=true';_0x1cbcb1['remoteUri']=intUtil[_0x6303('0x50')](_0x1cbcb1[_0x6303('0x51')]);_0x1cbcb1[_0x6303('0x52')]=intUtil[_0x6303('0x50')](_0x1cbcb1['serverUrl']);var _0x4f9466=util['format']('%s/api/now/table/',_0x1cbcb1[_0x6303('0x51')]);_0x4876a2[_0x6303('0x12')]=!_['isNil'](_0x3095c1)?_0x3095c1[_0x6303('0x53')]:null;_0x4876a2[_0x6303('0x1b')]=_0x1cbcb1[_0x6303('0x53')];_0x4876a2[_0x6303('0x20')]=_0x4f0277[_0x6303('0x2e')]()==='outbound'?_0xce52e['destcalleridnum']:_0xce52e[_0x6303('0x54')];_0x4876a2[_0x6303('0x55')]=_0x4f0277==='queue'||_0x4f0277===_0x6303('0x56')?_0x6303('0x57'):_0x6303('0x36');var _0x3b4d1c=util[_0x6303('0x4c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1cbcb1['serverUrl'],_0xce52e[_0x6303('0x58')],md5(_0xce52e[_0x6303('0x58')]));if(_0x5d43e8&&_0x5d43e8['monitor_format']){logger['info']('[QUEUE]',_0x6303('0x59'));_0xce52e['recordingURL']=_0x3b4d1c;}else if(_0x2641eb&&_0x2641eb[_0x6303('0x5a')]&&_0x2641eb[_0x6303('0x5a')]!==_0x6303('0x5b')){logger[_0x6303('0xc')](_0x6303('0x5c'),'Recording\x20is\x20enabled!');_0xce52e[_0x6303('0x5d')]=_0x3b4d1c;}else{_0xce52e['recordingURL']='';}return getAdminUser(_0x4f0277,_0x289885,_0x4876a2,_0x4f9466,_0x12c84c,_0x2d66a5)[_0x6303('0x8')](getUser(_0x4f0277,_0x289885,_0x4f9466,_0x12c84c,_0x2d66a5))['then'](getEndUser(_0x4f0277,_0x289885,_0x4f9466,_0x12c84c,_0x2d66a5))[_0x6303('0x8')](getTicket(_0x4f0277,_0x289885,_0x4f9466,_0x4cc4f2,_0xce52e,_0x12c84c))[_0x6303('0x8')](function(_0x3df9d1){logger['info'](util[_0x6303('0x4c')](_0x6303('0x5e'),_0x3df9d1[_0x6303('0x5f')]));logger[_0x6303('0xc')](util[_0x6303('0x4c')](_0x6303('0x60'),_0x4f0277));if(_0x4f0277!==_0x6303('0x56')){logger['info']('['+[_0x4f0277[_0x6303('0xd')]()]+']',_0x6303('0x61'));emit(_0x1cbcb1[_0x6303('0x51')],_0x3095c1[_0x6303('0x34')],_0x3df9d1[_0x6303('0x5f')]);}})[_0x6303('0x24')](function(_0x41bde9){logger['error']('['+[_0x4f0277[_0x6303('0xd')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x41bde9,{'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 e2c6628..fbbadbf 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 _0xb051=['recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','abandoned','[ABANDONED]','isNil','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','push','variableName','JSON','Calls','format','apiKey','base64','get_server_info','stringify','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','first_name','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','map','forEach','type','string','nameField','toLowerCase','content','toString','idField','customField','custom_fields','variable','customVariable','Variable','login','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','then','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','outbound'];(function(_0x17f347,_0x41cf67){var _0xf4ce40=function(_0x34e9f2){while(--_0x34e9f2){_0x17f347['push'](_0x17f347['shift']());}};_0xf4ce40(++_0x41cf67);}(_0xb051,0x7c));var _0x1b05=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb051[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x1b05('0x0'));var rp=require(_0x1b05('0x1'));var BPromise=require(_0x1b05('0x2'));var md5=require(_0x1b05('0x3'));var util=require(_0x1b05('0x4'));var Redis=require(_0x1b05('0x5'));var intUtil=require(_0x1b05('0x6'));var config=require(_0x1b05('0x7'));var logger=require('../../../../config/logger')('sugarcrm');config['redis']=_['defaults'](config[_0x1b05('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x1b05('0x9'))(new Redis(config['redis']));var def={'method':_0x1b05('0xa'),'json':!![]};function emit(_0x184cce,_0x1b6bdf,_0x20c2a0){io['to'](_0x184cce)[_0x1b05('0xb')](_0x1b6bdf,_0x20c2a0);}function getTicket(_0x55f8f0,_0x267584,_0x28decf,_0x35115b,_0x3bed23,_0x56f8e9,_0x4c5546,_0x4d4f4b){logger[_0x1b05('0xc')](_0x1b05('0xd'));var _0x574586=new Date();var _0x3a675a=[{'name':_0x1b05('0xe'),'value':intUtil[_0x1b05('0xf')](_0x35115b[_0x1b05('0x10')],_0x3bed23,'\x20')},{'name':_0x1b05('0x11'),'value':_0x267584['id']},{'name':'created_by','value':_0x267584['id']},{'name':'description','value':intUtil[_0x1b05('0xf')](_0x35115b[_0x1b05('0x12')],_0x3bed23,'\x0a')},{'name':'date_start','value':_0x574586[_0x1b05('0x13')]()['slice'](0x0,0x13)[_0x1b05('0x14')]('T','\x20')},{'name':_0x1b05('0x15'),'value':'0'},{'name':_0x1b05('0x16'),'value':'15'},{'name':_0x1b05('0x17'),'value':_0x28decf['id']},{'name':_0x1b05('0x18'),'value':_0x1b05('0x19')},{'name':_0x1b05('0x1a'),'value':_0x28decf[_0x1b05('0xe')]},{'name':'direction','value':_0x4d4f4b}];if(_0x56f8e9[_0x1b05('0x1b')]){_['forEach'](_0x56f8e9,function(_0x56f1aa){if(_0x3bed23[_0x56f1aa['variableName']]){_0x3a675a[_0x1b05('0x1c')]({'name':_0x56f1aa['idField'],'value':_0x3bed23[_0x56f1aa[_0x1b05('0x1d')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x1b05('0x1e'),'response_type':_0x1b05('0x1e'),'rest_data':JSON['stringify']({'session':_0x4c5546['id'],'module_name':_0x1b05('0x1f'),'name_value_list':_0x3a675a})}});}function getAuth(_0x5f5990){return util[_0x1b05('0x20')]('Basic\x20%s',new Buffer(_0x5f5990[_0x1b05('0x21')]+':X')['toString'](_0x1b05('0x22')));}function getServerInfo(_0x34096a){return request({'form':{'method':_0x1b05('0x23'),'input_type':_0x1b05('0x1e'),'response_type':_0x1b05('0x1e'),'rest_data':JSON[_0x1b05('0x24')]({'session':_0x34096a['id']})}});}function getUser(_0x5b1180,_0x11eed6,_0x2ca544){if(!_['isNil'](_0x11eed6)){logger['info'](_0x1b05('0x25'),_0x11eed6);return request({'form':{'method':_0x1b05('0x26'),'input_type':_0x1b05('0x1e'),'response_type':_0x1b05('0x1e'),'rest_data':JSON[_0x1b05('0x24')]({'session':_0x2ca544['id'],'module_name':'Employees','query':util[_0x1b05('0x20')](_0x1b05('0x27'),_0x11eed6),'order_by':'','offset':'0','select_fields':['id',_0x1b05('0xe'),_0x1b05('0x28')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xbb4bd8){if(_0xbb4bd8[_0x1b05('0x29')][_0x1b05('0x1b')]){var _0x451ff4=_[_0x1b05('0x2a')](_0xbb4bd8['entry_list'],function(_0x2843cb){return _0x2843cb[_0x1b05('0x2b')][_0x1b05('0x28')]['value']===_0x11eed6;});if(_0x451ff4){logger[_0x1b05('0xc')](_0x1b05('0x2c'));return BPromise['resolve']({'id':_0x451ff4[_0x1b05('0x2b')]['id'][_0x1b05('0x2d')],'name':_0x451ff4[_0x1b05('0x2b')][_0x1b05('0xe')][_0x1b05('0x2d')]});}}logger['info'](_0x1b05('0x2e'));return BPromise['resolve']({'id':_0x2ca544[_0x1b05('0x2b')][_0x1b05('0x2f')][_0x1b05('0x2d')],'name':_0x2ca544[_0x1b05('0x2b')]['user_name'][_0x1b05('0x2d')]});});}else{logger[_0x1b05('0xc')](_0x1b05('0x30'));return BPromise[_0x1b05('0x31')]({'id':_0x2ca544[_0x1b05('0x2b')][_0x1b05('0x2f')]['value'],'name':_0x2ca544[_0x1b05('0x2b')][_0x1b05('0x28')][_0x1b05('0x2d')]});}}function getEndUser(_0x5eca4a,_0x25694c,_0x24ae2b,_0x5c7a57){logger[_0x1b05('0xc')](_0x1b05('0x32'),_0x24ae2b);return request({'form':{'method':_0x1b05('0x26'),'input_type':'JSON','response_type':_0x1b05('0x1e'),'rest_data':JSON[_0x1b05('0x24')]({'session':_0x5c7a57['id'],'module_name':_0x1b05('0x19'),'query':util[_0x1b05('0x20')](_0x1b05('0x33'),_0x24ae2b),'order_by':'','offset':'0','select_fields':['id','name',_0x1b05('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0xe0a7a5){if(_0xe0a7a5[_0x1b05('0x29')][_0x1b05('0x1b')]){var _0x4d650d=_[_0x1b05('0x2a')](_0xe0a7a5['entry_list'],function(_0x1a9017){return _0x1a9017[_0x1b05('0x2b')]['phone_home'][_0x1b05('0x2d')]===_0x24ae2b;});if(_0x4d650d){logger[_0x1b05('0xc')]('Enduser\x20found!');return BPromise[_0x1b05('0x31')]({'id':_0x4d650d[_0x1b05('0x2b')]['id']['value'],'name':_0x4d650d[_0x1b05('0x2b')][_0x1b05('0xe')][_0x1b05('0x2d')],'phone':_0x4d650d[_0x1b05('0x2b')][_0x1b05('0x34')][_0x1b05('0x2d')]});}}else{logger[_0x1b05('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x1b05('0x1e'),'rest_data':JSON['stringify']({'session':_0x5c7a57['id'],'module_name':_0x1b05('0x19'),'name_value_list':[{'name':_0x1b05('0x35'),'value':_0x25694c!==''?_0x25694c:util[_0x1b05('0x20')](_0x1b05('0x36'),_0x24ae2b)},{'name':_0x1b05('0x34'),'value':_0x24ae2b}]})}})['then'](function(_0x4fd368){logger[_0x1b05('0xc')](_0x1b05('0x37'));return BPromise[_0x1b05('0x31')]({'id':_0x4fd368['id'],'name':_0x4fd368[_0x1b05('0x29')][_0x1b05('0x35')][_0x1b05('0x2d')],'phone':_0x4fd368[_0x1b05('0x29')]['phone_home'][_0x1b05('0x2d')]});});}});}function request(_0xe76d11){logger['debug'](_0x1b05('0x38'),JSON[_0x1b05('0x24')](_0xe76d11));return rp(_['merge'](def,_0xe76d11));}function getTags(_0x5aaba8,_0x44a3bc){var _0x510582=[];if(_0x5aaba8&&_0x5aaba8[_0x1b05('0x1b')]>0x0){_0x510582=_[_0x1b05('0x39')](_0x5aaba8,_0x44a3bc);}return _0x510582;}function getCustomFields(_0x4dac31,_0x159bd6){var _0x434fea=[];var _0x56dbde={'custom_fields':[]};if(_0x4dac31['length']>0x0){_[_0x1b05('0x3a')](_0x4dac31,function(_0x5612ba){if(_0x5612ba[_0x1b05('0x3b')]===_0x1b05('0x3c')&&_0x5612ba[_0x1b05('0x3d')]&&!_0x5612ba['customField']){_0x56dbde[_0x5612ba[_0x1b05('0x3d')][_0x1b05('0x3e')]()]=_0x5612ba[_0x1b05('0x3f')][_0x1b05('0x40')]();}else if(_0x5612ba[_0x1b05('0x3b')]==='string'&&_0x5612ba[_0x1b05('0x41')]&&_0x5612ba[_0x1b05('0x42')]){_0x56dbde[_0x1b05('0x43')]['push']({'id':_0x5612ba['idField'],'value':_0x5612ba[_0x1b05('0x3f')][_0x1b05('0x40')]()});}else if(_0x5612ba[_0x1b05('0x3b')]===_0x1b05('0x44')&&_0x5612ba[_0x1b05('0x1d')]&&_0x5612ba['idField']&&_0x5612ba[_0x1b05('0x42')]){_0x159bd6[_0x5612ba['variableName']]&&_0x56dbde['custom_fields'][_0x1b05('0x1c')]({'id':_0x5612ba[_0x1b05('0x41')],'value':_0x159bd6[_0x5612ba[_0x1b05('0x1d')]][_0x1b05('0x40')]()});}else if(_0x5612ba[_0x1b05('0x3b')]===_0x1b05('0x45')&&_0x5612ba[_0x1b05('0x46')]&&_0x5612ba[_0x1b05('0x46')]['name']&&_0x5612ba[_0x1b05('0x41')]&&_0x5612ba[_0x1b05('0x42')]){_0x159bd6[_0x5612ba[_0x1b05('0x46')]['name'][_0x1b05('0x3e')]()]&&_0x56dbde['custom_fields'][_0x1b05('0x1c')]({'id':_0x5612ba[_0x1b05('0x41')],'value':_0x159bd6[_0x5612ba['Variable']['name'][_0x1b05('0x3e')]()][_0x1b05('0x40')]()});}});}return _0x56dbde;}function getConnection(_0x5cc35f){return request({'method':_0x1b05('0xa'),'form':{'method':_0x1b05('0x47'),'input_type':'JSON','response_type':_0x1b05('0x1e'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5cc35f['username'],'password':_0x5cc35f[_0x1b05('0x48')],'encryption':'PLAIN'},'application':_0x1b05('0x49')})}})['then'](function(_0xcf0255){var _0xa338c6=_0xcf0255;if(_0xa338c6['id']){def[_0x1b05('0x4a')]=_0xa338c6['id'];return BPromise['resolve'](_0xa338c6);}else{throw new Error(util['format'](_0x1b05('0x4b'),_0x5cc35f['id']));}});}function setRelationship(_0x872c8f,_0x30b6c4,_0x5da612,_0x303e29){return request({'form':{'method':'set_relationship','input_type':_0x1b05('0x1e'),'response_type':_0x1b05('0x1e'),'rest_data':JSON['stringify']({'session':_0x872c8f['id'],'module_name':_0x1b05('0x1f'),'module_id':_0x5da612['id'],'link_field_name':_0x303e29,'related_ids':[_0x30b6c4['id']]})}});}exports['queue']=function(_0x559b29,_0x5a2121,_0x4c9593,_0x78984,_0x49305c,_0x306520){var _0x1e563d,_0x225a84,_0x41c45e,_0xc64187;_0x306520[_0x1b05('0x4c')]=intUtil[_0x1b05('0x4d')](_0x306520[_0x1b05('0x4c')]);_0x306520['serverUrl']=intUtil['stripTrailingSlash'](_0x306520[_0x1b05('0x4e')]);def[_0x1b05('0x4f')]=util[_0x1b05('0x20')](_0x1b05('0x50'),_0x306520[_0x1b05('0x4c')]);if(_0x49305c&&_0x49305c[_0x1b05('0x51')]){logger['info'](_0x1b05('0x52'),'Recording\x20is\x20enabled!');_0x5a2121[_0x1b05('0x53')]=util['format'](_0x1b05('0x54'),_0x306520[_0x1b05('0x4e')],_0x5a2121[_0x1b05('0x55')],md5(_0x5a2121[_0x1b05('0x55')]));}else{_0x5a2121[_0x1b05('0x53')]='';}return getConnection(_0x306520)['then'](function(_0x5135e2){_0xc64187=_0x5135e2;return getUser(_0x306520,_0x78984[_0x1b05('0xe')],_0xc64187);})[_0x1b05('0x56')](function(_0x55df07){_0x1e563d=_0x55df07;logger[_0x1b05('0xc')](_0x1b05('0x57'),_0x1e563d['id']);return getEndUser(_0x306520,_0x5a2121[_0x1b05('0x58')],_0x5a2121[_0x1b05('0x59')],_0xc64187);})[_0x1b05('0x56')](function(_0x5724c6){_0x225a84=_0x5724c6;logger[_0x1b05('0xc')](_0x1b05('0x5a'),_0x225a84['id']);return getTicket(_0x306520,_0x1e563d,_0x225a84,_0x4c9593,_0x5a2121,_0x4c9593['Fields'],_0xc64187,_0x1b05('0x5b'));})[_0x1b05('0x56')](function(_0xd24de){_0x41c45e=_0xd24de;logger[_0x1b05('0xc')](_0x1b05('0x5c'));logger[_0x1b05('0xc')](_0x1b05('0x5d'),_0x41c45e['id']);return setRelationship(_0xc64187,_0x1e563d,_0x41c45e,_0x1b05('0x5e'));})[_0x1b05('0x56')](function(){return setRelationship(_0xc64187,_0x225a84,_0x41c45e,_0x1b05('0x5f'));})[_0x1b05('0x56')](function(){return getServerInfo(_0xc64187);})[_0x1b05('0x56')](function(_0x4445d3){var _0x3471a8=parseInt(_0x4445d3[_0x1b05('0x60')][_0x1b05('0x61')](0x0));var _0x5173dd=util[_0x1b05('0x20')](_0x1b05('0x62'),_0x306520[_0x1b05('0x4c')],_0x41c45e['id']);if(_0x3471a8>0x6){_0x5173dd=util['format'](_0x1b05('0x63'),_0x306520[_0x1b05('0x4c')],_0x41c45e['id']);}logger[_0x1b05('0xc')]('[QUEUE]',_0x1b05('0x64'));emit(util[_0x1b05('0x20')](_0x1b05('0x65'),_0x78984[_0x1b05('0xe')]),_0x1b05('0x66'),{'uri':_0x5173dd});})[_0x1b05('0x67')](function(_0x19da72){logger[_0x1b05('0x68')](_0x1b05('0x52'),JSON[_0x1b05('0x24')](_0x19da72));});};exports[_0x1b05('0x69')]=function(_0x33020c,_0x14c436,_0xe0db07,_0x41819e,_0x5911b9,_0x467349,_0x52f18e){var _0x4beb03,_0x33ad7c,_0x58ad62,_0x5cd1a7;_0x467349['remoteUri']=intUtil[_0x1b05('0x4d')](_0x467349['remoteUri']);_0x467349[_0x1b05('0x4e')]=intUtil[_0x1b05('0x4d')](_0x467349['serverUrl']);def[_0x1b05('0x4f')]=util[_0x1b05('0x20')](_0x1b05('0x50'),_0x467349[_0x1b05('0x4c')]);if(_0x52f18e&&_0x52f18e[_0x1b05('0x6a')]&&_0x52f18e['recordingFormat']!=='none'){logger[_0x1b05('0xc')](_0x1b05('0x6b'),_0x1b05('0x6c'));_0x14c436[_0x1b05('0x53')]=util[_0x1b05('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x467349[_0x1b05('0x4e')],_0x14c436[_0x1b05('0x55')],md5(_0x14c436[_0x1b05('0x55')]));}return getConnection(_0x467349)[_0x1b05('0x56')](function(_0x244291){_0x5cd1a7=_0x244291;return getUser(_0x467349,_0x41819e[_0x1b05('0xe')],_0x5cd1a7);})[_0x1b05('0x56')](function(_0x466a24){_0x4beb03=_0x466a24;logger[_0x1b05('0xc')]('The\x20User\x20ID\x20is:',_0x4beb03['id']);return getEndUser(_0x467349,_0x14c436[_0x1b05('0x6d')],_0x14c436[_0x1b05('0x6e')],_0x5cd1a7);})[_0x1b05('0x56')](function(_0x38f872){_0x33ad7c=_0x38f872;logger['info'](_0x1b05('0x5a'),_0x33ad7c['id']);return getTicket(_0x467349,_0x4beb03,_0x33ad7c,_0xe0db07,_0x14c436,_0xe0db07[_0x1b05('0x6f')],_0x5cd1a7,'Outbound');})['then'](function(_0x48c4aa){_0x58ad62=_0x48c4aa;logger[_0x1b05('0xc')]('Ticket\x20created!');logger['info'](_0x1b05('0x5d'),_0x58ad62['id']);return setRelationship(_0x5cd1a7,_0x4beb03,_0x58ad62,_0x1b05('0x5e'));})[_0x1b05('0x56')](function(){return setRelationship(_0x5cd1a7,_0x33ad7c,_0x58ad62,_0x1b05('0x5f'));})[_0x1b05('0x56')](function(){return getServerInfo(_0x5cd1a7);})['then'](function(_0xfbfd8c){var _0x3ee3d4=parseInt(_0xfbfd8c[_0x1b05('0x60')]['charAt'](0x0));var _0x17b302=util[_0x1b05('0x20')](_0x1b05('0x62'),_0x467349['remoteUri'],_0x58ad62['id']);if(_0x3ee3d4>0x6){_0x17b302=util[_0x1b05('0x20')](_0x1b05('0x63'),_0x467349[_0x1b05('0x4c')],_0x58ad62['id']);}logger[_0x1b05('0xc')]('[OUTBOUND]',_0x1b05('0x64'));emit(util[_0x1b05('0x20')]('user:%s',_0x41819e['name']),_0x1b05('0x66'),{'uri':_0x17b302});})['catch'](function(_0x41d1a2){logger[_0x1b05('0x68')](_0x1b05('0x6b'),JSON[_0x1b05('0x24')](_0x41d1a2));});};exports[_0x1b05('0x70')]=function(_0x200e0f,_0x4e7c61,_0x1178e3,_0x569f31,_0x556056,_0x1905db){var _0x5b148a,_0x2843c4,_0x2d7d2a,_0x6876f7;_0x1905db[_0x1b05('0x4c')]=intUtil[_0x1b05('0x4d')](_0x1905db[_0x1b05('0x4c')]);_0x1905db[_0x1b05('0x4e')]=intUtil[_0x1b05('0x4d')](_0x1905db[_0x1b05('0x4e')]);def[_0x1b05('0x4f')]=util[_0x1b05('0x20')](_0x1b05('0x50'),_0x1905db['remoteUri']);if(_0x556056&&_0x556056['monitor_format']){logger['info'](_0x1b05('0x71'),'Recording\x20is\x20enabled!');_0x4e7c61[_0x1b05('0x53')]=util[_0x1b05('0x20')](_0x1b05('0x54'),_0x1905db['serverUrl'],_0x4e7c61[_0x1b05('0x55')],md5(_0x4e7c61['uniqueid']));}else{_0x4e7c61[_0x1b05('0x53')]='';}return getConnection(_0x1905db)[_0x1b05('0x56')](function(_0x2824cf){_0x6876f7=_0x2824cf;if(!_[_0x1b05('0x72')](_0x569f31)){return getUser(_0x1905db,_0x569f31['name'],_0x6876f7);}else{return getUser(_0x1905db,null,_0x6876f7);}})[_0x1b05('0x56')](function(_0x32fed7){_0x5b148a=_0x32fed7;logger[_0x1b05('0xc')](_0x1b05('0x57'),_0x5b148a['id']);return getEndUser(_0x1905db,_0x4e7c61[_0x1b05('0x58')],_0x4e7c61[_0x1b05('0x59')],_0x6876f7);})[_0x1b05('0x56')](function(_0x3e9162){_0x2843c4=_0x3e9162;logger[_0x1b05('0xc')](_0x1b05('0x5a'),_0x2843c4['id']);return getTicket(_0x1905db,_0x5b148a,_0x2843c4,_0x1178e3,_0x4e7c61,_0x1178e3[_0x1b05('0x6f')],_0x6876f7,'Inbound');})[_0x1b05('0x56')](function(_0x43fe86){_0x2d7d2a=_0x43fe86;logger[_0x1b05('0xc')](_0x1b05('0x5c'));logger[_0x1b05('0xc')](_0x1b05('0x5d'),_0x2d7d2a['id']);return setRelationship(_0x6876f7,_0x5b148a,_0x2d7d2a,_0x1b05('0x5e'));})[_0x1b05('0x56')](function(){return setRelationship(_0x6876f7,_0x2843c4,_0x2d7d2a,'contacts');})[_0x1b05('0x56')](function(){return getServerInfo(_0x6876f7);})['catch'](function(_0x484903){logger['error'](_0x1b05('0x71'),JSON['stringify'](_0x484903));});}; \ No newline at end of file +var _0xf6d6=['%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','stripTrailingSlash','uri','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','Outbound','error','abandoned','[ABANDONED]','calleridnum','Inbound','Ticket\x20created!','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','Descriptions','date_start','toISOString','slice','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','forEach','push','idField','variableName','set_entry','JSON','stringify','Calls','format','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','then','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','customField','nameField','type','string','custom_fields','content','Variable','toLowerCase','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','Fields','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s'];(function(_0x5f4e17,_0x21bebd){var _0x2820af=function(_0x1b8b51){while(--_0x1b8b51){_0x5f4e17['push'](_0x5f4e17['shift']());}};_0x2820af(++_0x21bebd);}(_0xf6d6,0x10b));var _0x6f6d=function(_0x569d04,_0x435ded){_0x569d04=_0x569d04-0x0;var _0x3c4b0f=_0xf6d6[_0x569d04];return _0x3c4b0f;};'use strict';var _=require('lodash');var rp=require(_0x6f6d('0x0'));var BPromise=require(_0x6f6d('0x1'));var md5=require(_0x6f6d('0x2'));var util=require(_0x6f6d('0x3'));var Redis=require(_0x6f6d('0x4'));var intUtil=require(_0x6f6d('0x5'));var config=require('../../../../config/environment');var logger=require(_0x6f6d('0x6'))(_0x6f6d('0x7'));config[_0x6f6d('0x8')]=_[_0x6f6d('0x9')](config[_0x6f6d('0x8')],{'host':_0x6f6d('0xa'),'port':0x18eb});var io=require(_0x6f6d('0xb'))(new Redis(config[_0x6f6d('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x3e9cef,_0x57c947,_0x114f5f){io['to'](_0x3e9cef)[_0x6f6d('0xc')](_0x57c947,_0x114f5f);}function getTicket(_0x174cdd,_0x4c6858,_0x126f4d,_0x49f6ba,_0x2a08fb,_0x2cf9b9,_0x3804de,_0x40aa1e){logger[_0x6f6d('0xd')](_0x6f6d('0xe'));var _0x4431ce=new Date();var _0x3bcc98=[{'name':_0x6f6d('0xf'),'value':intUtil[_0x6f6d('0x10')](_0x49f6ba[_0x6f6d('0x11')],_0x2a08fb,'\x20')},{'name':'assigned_user_id','value':_0x4c6858['id']},{'name':_0x6f6d('0x12'),'value':_0x4c6858['id']},{'name':'description','value':intUtil[_0x6f6d('0x10')](_0x49f6ba[_0x6f6d('0x13')],_0x2a08fb,'\x0a')},{'name':_0x6f6d('0x14'),'value':_0x4431ce[_0x6f6d('0x15')]()[_0x6f6d('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x6f6d('0x17'),'value':'15'},{'name':_0x6f6d('0x18'),'value':_0x126f4d['id']},{'name':_0x6f6d('0x19'),'value':_0x6f6d('0x1a')},{'name':_0x6f6d('0x1b'),'value':_0x126f4d[_0x6f6d('0xf')]},{'name':'direction','value':_0x40aa1e}];if(_0x2cf9b9[_0x6f6d('0x1c')]){_[_0x6f6d('0x1d')](_0x2cf9b9,function(_0x2ac207){if(_0x2a08fb[_0x2ac207['variableName']]){_0x3bcc98[_0x6f6d('0x1e')]({'name':_0x2ac207[_0x6f6d('0x1f')],'value':_0x2a08fb[_0x2ac207[_0x6f6d('0x20')]]});}});}return request({'form':{'method':_0x6f6d('0x21'),'input_type':_0x6f6d('0x22'),'response_type':_0x6f6d('0x22'),'rest_data':JSON[_0x6f6d('0x23')]({'session':_0x3804de['id'],'module_name':_0x6f6d('0x24'),'name_value_list':_0x3bcc98})}});}function getAuth(_0x5cede9){return util[_0x6f6d('0x25')]('Basic\x20%s',new Buffer(_0x5cede9[_0x6f6d('0x26')]+':X')[_0x6f6d('0x27')](_0x6f6d('0x28')));}function getServerInfo(_0x13e5ee){return request({'form':{'method':_0x6f6d('0x29'),'input_type':_0x6f6d('0x22'),'response_type':_0x6f6d('0x22'),'rest_data':JSON[_0x6f6d('0x23')]({'session':_0x13e5ee['id']})}});}function getUser(_0x5dab63,_0x37620b,_0x40d1a4){if(!_[_0x6f6d('0x2a')](_0x37620b)){logger[_0x6f6d('0xd')](_0x6f6d('0x2b'),_0x37620b);return request({'form':{'method':_0x6f6d('0x2c'),'input_type':'JSON','response_type':_0x6f6d('0x22'),'rest_data':JSON[_0x6f6d('0x23')]({'session':_0x40d1a4['id'],'module_name':_0x6f6d('0x2d'),'query':util[_0x6f6d('0x25')](_0x6f6d('0x2e'),_0x37620b),'order_by':'','offset':'0','select_fields':['id',_0x6f6d('0xf'),_0x6f6d('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6f6d('0x30')](function(_0xebd23){if(_0xebd23[_0x6f6d('0x31')][_0x6f6d('0x1c')]){var _0xf963ae=_['find'](_0xebd23[_0x6f6d('0x31')],function(_0x29a85d){return _0x29a85d['name_value_list'][_0x6f6d('0x2f')][_0x6f6d('0x32')]===_0x37620b;});if(_0xf963ae){logger[_0x6f6d('0xd')](_0x6f6d('0x33'));return BPromise[_0x6f6d('0x34')]({'id':_0xf963ae[_0x6f6d('0x35')]['id'][_0x6f6d('0x32')],'name':_0xf963ae[_0x6f6d('0x35')]['name']['value']});}}logger[_0x6f6d('0xd')](_0x6f6d('0x36'));return BPromise[_0x6f6d('0x34')]({'id':_0x40d1a4['name_value_list'][_0x6f6d('0x37')][_0x6f6d('0x32')],'name':_0x40d1a4[_0x6f6d('0x35')][_0x6f6d('0x2f')][_0x6f6d('0x32')]});});}else{logger[_0x6f6d('0xd')](_0x6f6d('0x38'));return BPromise[_0x6f6d('0x34')]({'id':_0x40d1a4[_0x6f6d('0x35')][_0x6f6d('0x37')]['value'],'name':_0x40d1a4[_0x6f6d('0x35')]['user_name'][_0x6f6d('0x32')]});}}function getEndUser(_0x45adff,_0x5330f9,_0x52fb7f,_0x4416ad){logger[_0x6f6d('0xd')](_0x6f6d('0x39'),_0x52fb7f);return request({'form':{'method':'get_entry_list','input_type':_0x6f6d('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x4416ad['id'],'module_name':'Contacts','query':util[_0x6f6d('0x25')](_0x6f6d('0x3a'),_0x52fb7f),'order_by':'','offset':'0','select_fields':['id','name',_0x6f6d('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6f6d('0x30')](function(_0x2e5245){if(_0x2e5245[_0x6f6d('0x31')]['length']){var _0x1abb98=_[_0x6f6d('0x3c')](_0x2e5245[_0x6f6d('0x31')],function(_0x2cda7a){return _0x2cda7a[_0x6f6d('0x35')][_0x6f6d('0x3b')]['value']===_0x52fb7f;});if(_0x1abb98){logger[_0x6f6d('0xd')](_0x6f6d('0x3d'));return BPromise[_0x6f6d('0x34')]({'id':_0x1abb98[_0x6f6d('0x35')]['id'][_0x6f6d('0x32')],'name':_0x1abb98[_0x6f6d('0x35')][_0x6f6d('0xf')][_0x6f6d('0x32')],'phone':_0x1abb98[_0x6f6d('0x35')][_0x6f6d('0x3b')]['value']});}}else{logger['info'](_0x6f6d('0x3e'));return request({'form':{'method':_0x6f6d('0x21'),'input_type':'JSON','response_type':_0x6f6d('0x22'),'rest_data':JSON['stringify']({'session':_0x4416ad['id'],'module_name':'Contacts','name_value_list':[{'name':_0x6f6d('0x3f'),'value':_0x5330f9!==_0x6f6d('0x40')?_0x5330f9:util[_0x6f6d('0x25')](_0x6f6d('0x41'),_0x52fb7f)},{'name':_0x6f6d('0x3b'),'value':_0x52fb7f}]})}})[_0x6f6d('0x30')](function(_0x48e2d5){logger['info'](_0x6f6d('0x42'));return BPromise[_0x6f6d('0x34')]({'id':_0x48e2d5['id'],'name':_0x48e2d5[_0x6f6d('0x31')][_0x6f6d('0x3f')][_0x6f6d('0x32')],'phone':_0x48e2d5[_0x6f6d('0x31')][_0x6f6d('0x3b')][_0x6f6d('0x32')]});});}});}function request(_0x36f24d){logger[_0x6f6d('0x43')](_0x6f6d('0x44'),JSON[_0x6f6d('0x23')](_0x36f24d));return rp(_[_0x6f6d('0x45')](def,_0x36f24d));}function getTags(_0x2322fe,_0x5039bd){var _0x1d15b3=[];if(_0x2322fe&&_0x2322fe[_0x6f6d('0x1c')]>0x0){_0x1d15b3=_[_0x6f6d('0x46')](_0x2322fe,_0x5039bd);}return _0x1d15b3;}function getCustomFields(_0xc92f0f,_0x1d085c){var _0x509536=[];var _0x193179={'custom_fields':[]};if(_0xc92f0f[_0x6f6d('0x1c')]>0x0){_[_0x6f6d('0x1d')](_0xc92f0f,function(_0x3f5982){if(_0x3f5982['type']==='string'&&_0x3f5982['nameField']&&!_0x3f5982[_0x6f6d('0x47')]){_0x193179[_0x3f5982[_0x6f6d('0x48')]['toLowerCase']()]=_0x3f5982['content'][_0x6f6d('0x27')]();}else if(_0x3f5982[_0x6f6d('0x49')]===_0x6f6d('0x4a')&&_0x3f5982['idField']&&_0x3f5982[_0x6f6d('0x47')]){_0x193179[_0x6f6d('0x4b')][_0x6f6d('0x1e')]({'id':_0x3f5982[_0x6f6d('0x1f')],'value':_0x3f5982[_0x6f6d('0x4c')]['toString']()});}else if(_0x3f5982[_0x6f6d('0x49')]==='variable'&&_0x3f5982[_0x6f6d('0x20')]&&_0x3f5982[_0x6f6d('0x1f')]&&_0x3f5982[_0x6f6d('0x47')]){_0x1d085c[_0x3f5982[_0x6f6d('0x20')]]&&_0x193179['custom_fields'][_0x6f6d('0x1e')]({'id':_0x3f5982['idField'],'value':_0x1d085c[_0x3f5982[_0x6f6d('0x20')]]['toString']()});}else if(_0x3f5982[_0x6f6d('0x49')]==='customVariable'&&_0x3f5982[_0x6f6d('0x4d')]&&_0x3f5982[_0x6f6d('0x4d')]['name']&&_0x3f5982[_0x6f6d('0x1f')]&&_0x3f5982[_0x6f6d('0x47')]){_0x1d085c[_0x3f5982['Variable'][_0x6f6d('0xf')][_0x6f6d('0x4e')]()]&&_0x193179[_0x6f6d('0x4b')]['push']({'id':_0x3f5982['idField'],'value':_0x1d085c[_0x3f5982['Variable']['name'][_0x6f6d('0x4e')]()][_0x6f6d('0x27')]()});}});}return _0x193179;}function getConnection(_0x3fa88f){return request({'method':_0x6f6d('0x4f'),'form':{'method':_0x6f6d('0x50'),'input_type':_0x6f6d('0x22'),'response_type':_0x6f6d('0x22'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3fa88f[_0x6f6d('0x51')],'password':_0x3fa88f[_0x6f6d('0x52')],'encryption':_0x6f6d('0x53')},'application':_0x6f6d('0x54')})}})['then'](function(_0x253608){var _0x453781=_0x253608;if(_0x453781['id']){def[_0x6f6d('0x55')]=_0x453781['id'];return BPromise['resolve'](_0x453781);}else{throw new Error(util['format'](_0x6f6d('0x56'),_0x3fa88f['id']));}});}function setRelationship(_0x300449,_0xed0125,_0x4f346e,_0x5bf669){return request({'form':{'method':'set_relationship','input_type':_0x6f6d('0x22'),'response_type':'JSON','rest_data':JSON[_0x6f6d('0x23')]({'session':_0x300449['id'],'module_name':'Calls','module_id':_0x4f346e['id'],'link_field_name':_0x5bf669,'related_ids':[_0xed0125['id']]})}});}exports[_0x6f6d('0x57')]=function(_0x30c18e,_0x506e4d,_0x18d0d0,_0x326c57,_0x59babe,_0xc46e33){var _0x21a50c,_0x4a8b27,_0x3c695d,_0x1513a9;_0xc46e33[_0x6f6d('0x58')]=intUtil['stripTrailingSlash'](_0xc46e33[_0x6f6d('0x58')]);_0xc46e33['serverUrl']=intUtil['stripTrailingSlash'](_0xc46e33[_0x6f6d('0x59')]);def['uri']=util['format'](_0x6f6d('0x5a'),_0xc46e33[_0x6f6d('0x58')]);if(_0x59babe&&_0x59babe[_0x6f6d('0x5b')]){logger[_0x6f6d('0xd')](_0x6f6d('0x5c'),_0x6f6d('0x5d'));_0x506e4d['recordingURL']=util['format'](_0x6f6d('0x5e'),_0xc46e33[_0x6f6d('0x59')],_0x506e4d[_0x6f6d('0x5f')],md5(_0x506e4d[_0x6f6d('0x5f')]));}else{_0x506e4d[_0x6f6d('0x60')]='';}return getConnection(_0xc46e33)[_0x6f6d('0x30')](function(_0x4e6b30){_0x1513a9=_0x4e6b30;return getUser(_0xc46e33,_0x326c57[_0x6f6d('0xf')],_0x1513a9);})[_0x6f6d('0x30')](function(_0x1b1922){_0x21a50c=_0x1b1922;logger[_0x6f6d('0xd')]('The\x20User\x20ID\x20is:',_0x21a50c['id']);return getEndUser(_0xc46e33,_0x506e4d[_0x6f6d('0x61')],_0x506e4d['calleridnum'],_0x1513a9);})['then'](function(_0x39f412){_0x4a8b27=_0x39f412;logger[_0x6f6d('0xd')]('The\x20Enduser\x20ID\x20is:',_0x4a8b27['id']);return getTicket(_0xc46e33,_0x21a50c,_0x4a8b27,_0x18d0d0,_0x506e4d,_0x18d0d0[_0x6f6d('0x62')],_0x1513a9,'Inbound');})['then'](function(_0xce1ad2){_0x3c695d=_0xce1ad2;logger[_0x6f6d('0xd')]('Ticket\x20created!');logger['info'](_0x6f6d('0x63'),_0x3c695d['id']);return setRelationship(_0x1513a9,_0x21a50c,_0x3c695d,_0x6f6d('0x64'));})['then'](function(){return setRelationship(_0x1513a9,_0x4a8b27,_0x3c695d,_0x6f6d('0x65'));})['then'](function(){return getServerInfo(_0x1513a9);})[_0x6f6d('0x30')](function(_0xf71132){var _0x59a4bb=parseInt(_0xf71132[_0x6f6d('0x66')][_0x6f6d('0x67')](0x0));var _0x3bf18b=util[_0x6f6d('0x25')](_0x6f6d('0x68'),_0xc46e33[_0x6f6d('0x58')],_0x3c695d['id']);if(_0x59a4bb>0x6){_0x3bf18b=util[_0x6f6d('0x25')](_0x6f6d('0x69'),_0xc46e33['remoteUri'],_0x3c695d['id']);}logger[_0x6f6d('0xd')](_0x6f6d('0x5c'),_0x6f6d('0x6a'));emit(util[_0x6f6d('0x25')](_0x6f6d('0x6b'),_0x326c57[_0x6f6d('0xf')]),_0x6f6d('0x6c'),{'uri':_0x3bf18b});})[_0x6f6d('0x6d')](function(_0x110067){logger['error'](_0x6f6d('0x5c'),JSON[_0x6f6d('0x23')](_0x110067));});};exports[_0x6f6d('0x6e')]=function(_0x39318d,_0x4125ed,_0xb5ad4c,_0x1e09c2,_0x103eb9,_0x2caa70,_0x169e62){var _0x118787,_0xc25716,_0x1e480a,_0x518c3e;_0x2caa70[_0x6f6d('0x58')]=intUtil[_0x6f6d('0x6f')](_0x2caa70[_0x6f6d('0x58')]);_0x2caa70['serverUrl']=intUtil['stripTrailingSlash'](_0x2caa70['serverUrl']);def[_0x6f6d('0x70')]=util[_0x6f6d('0x25')]('%s/service/v4_1/rest.php',_0x2caa70['remoteUri']);if(_0x169e62&&_0x169e62['recordingFormat']&&_0x169e62[_0x6f6d('0x71')]!==_0x6f6d('0x72')){logger[_0x6f6d('0xd')](_0x6f6d('0x73'),_0x6f6d('0x5d'));_0x4125ed['recordingURL']=util[_0x6f6d('0x25')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2caa70[_0x6f6d('0x59')],_0x4125ed[_0x6f6d('0x5f')],md5(_0x4125ed[_0x6f6d('0x5f')]));}return getConnection(_0x2caa70)[_0x6f6d('0x30')](function(_0x433114){_0x518c3e=_0x433114;return getUser(_0x2caa70,_0x1e09c2[_0x6f6d('0xf')],_0x518c3e);})['then'](function(_0xd0ae92){_0x118787=_0xd0ae92;logger['info']('The\x20User\x20ID\x20is:',_0x118787['id']);return getEndUser(_0x2caa70,_0x4125ed['destcalleridname'],_0x4125ed['destcalleridnum'],_0x518c3e);})[_0x6f6d('0x30')](function(_0xaee0ed){_0xc25716=_0xaee0ed;logger[_0x6f6d('0xd')](_0x6f6d('0x74'),_0xc25716['id']);return getTicket(_0x2caa70,_0x118787,_0xc25716,_0xb5ad4c,_0x4125ed,_0xb5ad4c[_0x6f6d('0x62')],_0x518c3e,_0x6f6d('0x75'));})[_0x6f6d('0x30')](function(_0x3342f1){_0x1e480a=_0x3342f1;logger[_0x6f6d('0xd')]('Ticket\x20created!');logger[_0x6f6d('0xd')](_0x6f6d('0x63'),_0x1e480a['id']);return setRelationship(_0x518c3e,_0x118787,_0x1e480a,_0x6f6d('0x64'));})[_0x6f6d('0x30')](function(){return setRelationship(_0x518c3e,_0xc25716,_0x1e480a,_0x6f6d('0x65'));})[_0x6f6d('0x30')](function(){return getServerInfo(_0x518c3e);})[_0x6f6d('0x30')](function(_0x9d14b5){var _0x833d80=parseInt(_0x9d14b5[_0x6f6d('0x66')][_0x6f6d('0x67')](0x0));var _0x481b8c=util[_0x6f6d('0x25')](_0x6f6d('0x68'),_0x2caa70[_0x6f6d('0x58')],_0x1e480a['id']);if(_0x833d80>0x6){_0x481b8c=util['format'](_0x6f6d('0x69'),_0x2caa70[_0x6f6d('0x58')],_0x1e480a['id']);}logger['info'](_0x6f6d('0x73'),_0x6f6d('0x6a'));emit(util[_0x6f6d('0x25')](_0x6f6d('0x6b'),_0x1e09c2[_0x6f6d('0xf')]),_0x6f6d('0x6c'),{'uri':_0x481b8c});})[_0x6f6d('0x6d')](function(_0x1b48d9){logger[_0x6f6d('0x76')]('[OUTBOUND]',JSON[_0x6f6d('0x23')](_0x1b48d9));});};exports[_0x6f6d('0x77')]=function(_0xdb0cd4,_0x341e7e,_0x1eb1d1,_0x315ec6,_0x36af57,_0x3c6b05){var _0xba119d,_0x53fa6c,_0x458b07,_0x54f0f0;_0x3c6b05[_0x6f6d('0x58')]=intUtil[_0x6f6d('0x6f')](_0x3c6b05[_0x6f6d('0x58')]);_0x3c6b05[_0x6f6d('0x59')]=intUtil[_0x6f6d('0x6f')](_0x3c6b05[_0x6f6d('0x59')]);def[_0x6f6d('0x70')]=util['format'](_0x6f6d('0x5a'),_0x3c6b05['remoteUri']);if(_0x36af57&&_0x36af57[_0x6f6d('0x5b')]){logger['info'](_0x6f6d('0x78'),_0x6f6d('0x5d'));_0x341e7e['recordingURL']=util[_0x6f6d('0x25')](_0x6f6d('0x5e'),_0x3c6b05[_0x6f6d('0x59')],_0x341e7e['uniqueid'],md5(_0x341e7e[_0x6f6d('0x5f')]));}else{_0x341e7e[_0x6f6d('0x60')]='';}return getConnection(_0x3c6b05)['then'](function(_0x5f4658){_0x54f0f0=_0x5f4658;if(!_['isNil'](_0x315ec6)){return getUser(_0x3c6b05,_0x315ec6[_0x6f6d('0xf')],_0x54f0f0);}else{return getUser(_0x3c6b05,null,_0x54f0f0);}})[_0x6f6d('0x30')](function(_0x6d036e){_0xba119d=_0x6d036e;logger['info']('The\x20User\x20ID\x20is:',_0xba119d['id']);return getEndUser(_0x3c6b05,_0x341e7e[_0x6f6d('0x61')],_0x341e7e[_0x6f6d('0x79')],_0x54f0f0);})[_0x6f6d('0x30')](function(_0x4adf4c){_0x53fa6c=_0x4adf4c;logger[_0x6f6d('0xd')](_0x6f6d('0x74'),_0x53fa6c['id']);return getTicket(_0x3c6b05,_0xba119d,_0x53fa6c,_0x1eb1d1,_0x341e7e,_0x1eb1d1[_0x6f6d('0x62')],_0x54f0f0,_0x6f6d('0x7a'));})['then'](function(_0x288b4e){_0x458b07=_0x288b4e;logger[_0x6f6d('0xd')](_0x6f6d('0x7b'));logger[_0x6f6d('0xd')](_0x6f6d('0x63'),_0x458b07['id']);return setRelationship(_0x54f0f0,_0xba119d,_0x458b07,_0x6f6d('0x64'));})[_0x6f6d('0x30')](function(){return setRelationship(_0x54f0f0,_0x53fa6c,_0x458b07,'contacts');})['then'](function(){return getServerInfo(_0x54f0f0);})[_0x6f6d('0x6d')](function(_0x240118){logger[_0x6f6d('0x76')](_0x6f6d('0x78'),JSON[_0x6f6d('0x23')](_0x240118));});}; \ 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 73682b4..abb096f 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 _0x1f9f=['name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','content','variable','variableName','customVariable','Variable'];(function(_0x1f067a,_0x377666){var _0x55fcc3=function(_0x27541b){while(--_0x27541b){_0x1f067a['push'](_0x1f067a['shift']());}};_0x55fcc3(++_0x377666);}(_0x1f9f,0x95));var _0xf1f9=function(_0x239f30,_0x4dbad1){_0x239f30=_0x239f30-0x0;var _0x575926=_0x1f9f[_0x239f30];return _0x575926;};'use strict';var _=require(_0xf1f9('0x0'));var util=require(_0xf1f9('0x1'));exports[_0xf1f9('0x2')]=function(_0x8da0f7,_0x41d83e,_0x3e3a97){var _0xef3c13=[];if(_0x8da0f7[_0xf1f9('0x3')]>0x0){var _0x400b12=_[_0xf1f9('0x4')](_0x8da0f7,['id']);for(var _0xf91769=0x0;_0xf91769<_0x400b12['length'];_0xf91769++){var _0xb0117f=_0x400b12[_0xf91769];if(_0xb0117f[_0xf1f9('0x5')]===_0xf1f9('0x6')){_0xef3c13[_0xf1f9('0x7')](_0xb0117f[_0xf1f9('0x8')]);}else if(_0xb0117f[_0xf1f9('0x5')]===_0xf1f9('0x9')&&_0xb0117f[_0xf1f9('0xa')]){_0x41d83e[_0xb0117f[_0xf1f9('0xa')]]&&_0xef3c13[_0xf1f9('0x7')](_0x41d83e[_0xb0117f[_0xf1f9('0xa')]]['toString']());}else if(_0xb0117f['type']===_0xf1f9('0xb')&&_0xb0117f[_0xf1f9('0xc')]&&_0xb0117f[_0xf1f9('0xc')]['name']){_0x41d83e[_0xb0117f[_0xf1f9('0xc')][_0xf1f9('0xd')][_0xf1f9('0xe')]()]&&_0xef3c13[_0xf1f9('0x7')](_0x41d83e[_0xb0117f[_0xf1f9('0xc')][_0xf1f9('0xd')][_0xf1f9('0xe')]()]['toString']());}else if(_0xb0117f[_0xf1f9('0x5')]===_0xf1f9('0xf')){if(_0xb0117f[_0xf1f9('0x10')]===_0xf1f9('0x6')&&_0xb0117f[_0xf1f9('0x11')]){_0xef3c13[_0xf1f9('0x7')](util[_0xf1f9('0x12')](_0xf1f9('0x13'),_0xb0117f[_0xf1f9('0x11')],_0xb0117f[_0xf1f9('0x14')]));}else if(_0xb0117f[_0xf1f9('0x10')]===_0xf1f9('0x9')&&_0xb0117f['variableName']&&_0xb0117f[_0xf1f9('0x11')]){_0x41d83e[_0xb0117f['variableName']]&&_0xef3c13[_0xf1f9('0x7')](util[_0xf1f9('0x12')]('%s:\x20%s',_0xb0117f[_0xf1f9('0x11')],_0x41d83e[_0xb0117f[_0xf1f9('0xa')]]));}else if(_0xb0117f[_0xf1f9('0x10')]===_0xf1f9('0xb')&&_0xb0117f[_0xf1f9('0xc')]&&_0xb0117f[_0xf1f9('0xc')][_0xf1f9('0xd')]&&_0xb0117f[_0xf1f9('0x11')]){_0x41d83e[_0xb0117f[_0xf1f9('0xc')]['name']['toLowerCase']()]&&_0xef3c13[_0xf1f9('0x7')](util[_0xf1f9('0x12')](_0xf1f9('0x13'),_0xb0117f[_0xf1f9('0x11')],_0x41d83e[_0xb0117f[_0xf1f9('0xc')]['name'][_0xf1f9('0xe')]()]));}}}}return _0xef3c13[_0xf1f9('0x15')](_0x3e3a97);};exports[_0xf1f9('0x16')]=function(_0x1c45fc){var _0x528b7b=_0x1c45fc[_0xf1f9('0x17')](-0x1);if(_0x528b7b==='/'){_0x1c45fc=_0x1c45fc['substring'](0x0,_0x1c45fc[_0xf1f9('0x18')](_0x528b7b));}return _0x1c45fc;};exports[_0xf1f9('0x19')]=function(_0x36d535){if(!_[_0xf1f9('0x1a')](_0x36d535)&&_0x36d535!==''){var _0x2504c7=/^(([^<>()\[\]\\.,;:\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 _0x2504c7['test'](String(_0x36d535)[_0xf1f9('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xa4d5=['keyValue','key','%s:\x20%s','keyType','format','join','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','string','type','variable','variableName','push','customVariable','name','Variable','toLowerCase','toString'];(function(_0x4e1a49,_0x4da738){var _0x136aae=function(_0x3ffd93){while(--_0x3ffd93){_0x4e1a49['push'](_0x4e1a49['shift']());}};_0x136aae(++_0x4da738);}(_0xa4d5,0xc9));var _0x5a4d=function(_0x1ee96e,_0x531a4b){_0x1ee96e=_0x1ee96e-0x0;var _0x3f378a=_0xa4d5[_0x1ee96e];return _0x3f378a;};'use strict';var _=require(_0x5a4d('0x0'));var util=require(_0x5a4d('0x1'));exports[_0x5a4d('0x2')]=function(_0x4b9c33,_0x3d41d8,_0x1d8665){var _0x30239e=[];if(_0x4b9c33[_0x5a4d('0x3')]>0x0){var _0x4db121=_[_0x5a4d('0x4')](_0x4b9c33,['id']);for(var _0xd95bcd=0x0;_0xd95bcd<_0x4db121[_0x5a4d('0x3')];_0xd95bcd++){var _0x26e726=_0x4db121[_0xd95bcd];if(_0x26e726['type']===_0x5a4d('0x5')){_0x30239e['push'](_0x26e726['content']);}else if(_0x26e726[_0x5a4d('0x6')]===_0x5a4d('0x7')&&_0x26e726[_0x5a4d('0x8')]){_0x3d41d8[_0x26e726[_0x5a4d('0x8')]]&&_0x30239e[_0x5a4d('0x9')](_0x3d41d8[_0x26e726[_0x5a4d('0x8')]]['toString']());}else if(_0x26e726[_0x5a4d('0x6')]===_0x5a4d('0xa')&&_0x26e726['Variable']&&_0x26e726['Variable'][_0x5a4d('0xb')]){_0x3d41d8[_0x26e726[_0x5a4d('0xc')]['name'][_0x5a4d('0xd')]()]&&_0x30239e[_0x5a4d('0x9')](_0x3d41d8[_0x26e726['Variable'][_0x5a4d('0xb')][_0x5a4d('0xd')]()][_0x5a4d('0xe')]());}else if(_0x26e726['type']===_0x5a4d('0xf')){if(_0x26e726['keyType']===_0x5a4d('0x5')&&_0x26e726[_0x5a4d('0x10')]){_0x30239e[_0x5a4d('0x9')](util['format'](_0x5a4d('0x11'),_0x26e726[_0x5a4d('0x10')],_0x26e726['keyContent']));}else if(_0x26e726['keyType']===_0x5a4d('0x7')&&_0x26e726['variableName']&&_0x26e726[_0x5a4d('0x10')]){_0x3d41d8[_0x26e726['variableName']]&&_0x30239e[_0x5a4d('0x9')](util['format'](_0x5a4d('0x11'),_0x26e726[_0x5a4d('0x10')],_0x3d41d8[_0x26e726[_0x5a4d('0x8')]]));}else if(_0x26e726[_0x5a4d('0x12')]===_0x5a4d('0xa')&&_0x26e726[_0x5a4d('0xc')]&&_0x26e726[_0x5a4d('0xc')][_0x5a4d('0xb')]&&_0x26e726[_0x5a4d('0x10')]){_0x3d41d8[_0x26e726['Variable'][_0x5a4d('0xb')][_0x5a4d('0xd')]()]&&_0x30239e['push'](util[_0x5a4d('0x13')](_0x5a4d('0x11'),_0x26e726[_0x5a4d('0x10')],_0x3d41d8[_0x26e726[_0x5a4d('0xc')][_0x5a4d('0xb')]['toLowerCase']()]));}}}}return _0x30239e[_0x5a4d('0x14')](_0x1d8665);};exports['stripTrailingSlash']=function(_0x41d964){var _0x58b20c=_0x41d964[_0x5a4d('0x15')](-0x1);if(_0x58b20c==='/'){_0x41d964=_0x41d964[_0x5a4d('0x16')](0x0,_0x41d964[_0x5a4d('0x17')](_0x58b20c));}return _0x41d964;};exports[_0x5a4d('0x18')]=function(_0x4235cb){if(!_[_0x5a4d('0x19')](_0x4235cb)&&_0x4235cb!==''){var _0x4722ee=/^(([^<>()\[\]\\.,;:\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 _0x4722ee[_0x5a4d('0x1a')](String(_0x4235cb)[_0x5a4d('0xd')]());}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 1575e87..82f7f11 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 _0x8aa7=['info','Creating\x20new\x20ticket...','Normal','Open','Subjects','getString','Descriptions','format','%s/webservice.php','create','admin','sessionName','HelpDesk','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','stringify','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','first_name','userId','username','statusCode','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20end\x20user\x20with\x20phone','GET','remoteUri','query','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;','firstname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Contacts','lastname','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','user:%s','outbound','serverUrl','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','Fields','split','abandoned','[ABANDONED]','Recording\x20is\x20enabled!','calleridname','The\x20Enduser\x20ID\x20is:','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','type','string','content','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase'];(function(_0xd10d51,_0x37eb56){var _0x5e7b61=function(_0x296125){while(--_0x296125){_0xd10d51['push'](_0xd10d51['shift']());}};_0x5e7b61(++_0x37eb56);}(_0x8aa7,0xb6));var _0x78aa=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x8aa7[_0x5608a3];return _0x1ed50a;};'use strict';var _=require('lodash');var rp=require(_0x78aa('0x0'));var BPromise=require(_0x78aa('0x1'));var md5=require(_0x78aa('0x2'));var util=require(_0x78aa('0x3'));var Redis=require(_0x78aa('0x4'));var intUtil=require(_0x78aa('0x5'));var config=require(_0x78aa('0x6'));var logger=require('../../../../config/logger')(_0x78aa('0x7'));config[_0x78aa('0x8')]=_[_0x78aa('0x9')](config[_0x78aa('0x8')],{'host':_0x78aa('0xa'),'port':0x18eb});var io=require(_0x78aa('0xb'))(new Redis(config[_0x78aa('0x8')]));function emit(_0xa79008,_0x2368ac,_0x460488){io['to'](_0xa79008)[_0x78aa('0xc')](_0x2368ac,_0x460488);}function getCustomFields(_0x116a77,_0x45d377){var _0x41e196={};if(_0x116a77[_0x78aa('0xd')]>0x0){_[_0x78aa('0xe')](_0x116a77,function(_0x3df85c){if(_0x3df85c[_0x78aa('0xf')]===_0x78aa('0x10')&&_0x3df85c['idField']){_0x41e196[_0x3df85c['idField']]=_0x3df85c[_0x78aa('0x11')][_0x78aa('0x12')]();}else if(_0x3df85c['type']===_0x78aa('0x13')&&_0x3df85c[_0x78aa('0x14')]&&_0x3df85c[_0x78aa('0x15')]&&_0x45d377[_0x3df85c[_0x78aa('0x14')]]){_0x41e196[_0x3df85c[_0x78aa('0x15')]]=_0x45d377[_0x3df85c['variableName']][_0x78aa('0x12')]();}else if(_0x3df85c[_0x78aa('0xf')]===_0x78aa('0x16')&&_0x3df85c[_0x78aa('0x17')]&&_0x3df85c[_0x78aa('0x17')]['name']&&_0x3df85c[_0x78aa('0x15')]&&_0x45d377[_0x3df85c[_0x78aa('0x17')][_0x78aa('0x18')][_0x78aa('0x19')]()]){_0x41e196[_0x3df85c[_0x78aa('0x15')]]=_0x45d377[_0x3df85c[_0x78aa('0x17')]['name']['toLowerCase']()][_0x78aa('0x12')]();}});}return _0x41e196;}function createTicket(_0x345e4d,_0xc316d9,_0x4207b0,_0x9879bf,_0x18513e,_0x23e739,_0x137354){logger[_0x78aa('0x1a')](_0x78aa('0x1b'));var _0x39e41f=_['merge']({'parent_id':'','assigned_user_id':_0xc316d9['id'],'ticketpriorities':_0x78aa('0x1c'),'ticketstatus':_0x78aa('0x1d'),'ticket_title':intUtil['getString'](_0x9879bf[_0x78aa('0x1e')],_0x18513e,'\x20'),'description':intUtil[_0x78aa('0x1f')](_0x9879bf[_0x78aa('0x20')],_0x18513e,'\x0a'),'contact_id':_0x4207b0['id']},getCustomFields(_0x23e739,_0x18513e));var _0x507b19={'method':'POST','uri':util[_0x78aa('0x21')](_0x78aa('0x22'),_0x345e4d['remoteUri']),'form':{'operation':_0x78aa('0x23'),'username':_0x78aa('0x24'),'sessionName':_0x137354[_0x78aa('0x25')],'elementType':_0x78aa('0x26'),'element':JSON['stringify'](_0x39e41f)},'json':!![]};return request(_0x507b19)[_0x78aa('0x27')](function(_0x25463d){if(_0x25463d[_0x78aa('0x28')]){return BPromise[_0x78aa('0x29')]({'id':_0x25463d[_0x78aa('0x2a')]['id']});}else{throw new Error(util[_0x78aa('0x21')](_0x78aa('0x2b'),JSON[_0x78aa('0x2c')](_0x25463d['error'])));}})[_0x78aa('0x2d')](function(_0x55d622){var _0x18f930=_0x55d622['statusCode']||0x1f4;logger[_0x78aa('0x2e')](_0x78aa('0x2f'),_0x78aa('0x30'),_0x18f930,JSON[_0x78aa('0x2c')](_0x55d622));});}function getUser(_0x3047c1,_0x5683c8,_0x2d8b5e){if(intUtil[_0x78aa('0x31')](_0x5683c8)){logger['info'](_0x78aa('0x32'),_0x5683c8);return request({'method':'GET','uri':util['format'](_0x78aa('0x22'),_0x3047c1['remoteUri']),'qs':{'operation':'query','username':_0x78aa('0x24'),'sessionName':_0x2d8b5e[_0x78aa('0x25')],'query':util[_0x78aa('0x21')](_0x78aa('0x33'),_0x5683c8)},'json':!![]})[_0x78aa('0x27')](function(_0x2a9fad){if(_0x2a9fad[_0x78aa('0x28')]&&_0x2a9fad['result']['length']){logger['info'](_0x78aa('0x34'));return BPromise[_0x78aa('0x29')]({'id':_0x2a9fad[_0x78aa('0x2a')][0x0]['id'],'email':_0x2a9fad[_0x78aa('0x2a')][0x0]['email1'],'name':_0x2a9fad[_0x78aa('0x2a')][0x0][_0x78aa('0x35')]+'\x20'+_0x2a9fad[_0x78aa('0x2a')]['last_name']});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x2d8b5e[_0x78aa('0x36')],'email':_0x3047c1[_0x78aa('0x37')],'name':_0x78aa('0x24')});}})[_0x78aa('0x2d')](function(_0xd2b4e0){var _0x11dbe1=_0xd2b4e0[_0x78aa('0x38')]||0x1f4;logger[_0x78aa('0x2e')](_0x78aa('0x2f'),'getUser',_0x11dbe1,JSON[_0x78aa('0x2c')](_0xd2b4e0));});}else{logger['info'](_0x78aa('0x39'));return BPromise[_0x78aa('0x29')]({'id':_0x2d8b5e[_0x78aa('0x36')],'email':_0x3047c1[_0x78aa('0x37')],'name':_0x78aa('0x24')})[_0x78aa('0x2d')](function(_0x255299){var _0x13af04=_0x255299['statusCode']||0x1f4;logger[_0x78aa('0x2e')](_0x78aa('0x2f'),'getUser',_0x13af04,JSON[_0x78aa('0x2c')](_0x255299));});}}function getEndUser(_0x524362,_0x202143,_0x362bfe,_0x3ab402){logger[_0x78aa('0x1a')](_0x78aa('0x3a'),_0x362bfe);return request({'method':_0x78aa('0x3b'),'uri':util[_0x78aa('0x21')](_0x78aa('0x22'),_0x524362[_0x78aa('0x3c')]),'qs':{'operation':_0x78aa('0x3d'),'username':_0x78aa('0x24'),'sessionName':_0x3ab402[_0x78aa('0x25')],'query':util[_0x78aa('0x21')](_0x78aa('0x3e'),_0x362bfe,_0x362bfe,_0x362bfe,_0x362bfe,_0x362bfe)},'json':!![]})['then'](function(_0x4eb60c){if(_0x4eb60c[_0x78aa('0x28')]&&_0x4eb60c['result'][_0x78aa('0xd')]){logger[_0x78aa('0x1a')]('Enduser\x20found!');return BPromise[_0x78aa('0x29')]({'id':_0x4eb60c[_0x78aa('0x2a')][0x0]['id'],'name':_0x4eb60c['result'][0x0][_0x78aa('0x3f')]+'\x20'+_0x4eb60c['result'][0x0]['lastname'],'phone':_0x362bfe});}else{logger[_0x78aa('0x1a')](_0x78aa('0x40'));return request({'method':_0x78aa('0x41'),'uri':util[_0x78aa('0x21')]('%s/webservice.php',_0x524362[_0x78aa('0x3c')]),'form':{'operation':'create','sessionName':_0x3ab402[_0x78aa('0x25')],'elementType':_0x78aa('0x42'),'element':JSON['stringify']({'lastname':_0x202143,'phone':_0x362bfe,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x18c7f4){logger['info']('Enduser\x20created.');return BPromise[_0x78aa('0x29')]({'id':_0x18c7f4[_0x78aa('0x2a')]['id'],'name':_0x18c7f4['result'][_0x78aa('0x43')],'phone':_0x18c7f4[_0x78aa('0x2a')][_0x78aa('0x44')]});})[_0x78aa('0x2d')](function(_0x2fb9c4){var _0x6e6206=_0x2fb9c4[_0x78aa('0x38')]||0x1f4;logger[_0x78aa('0x2e')](_0x78aa('0x2f'),_0x78aa('0x45'),_0x6e6206,JSON[_0x78aa('0x2c')](_0x2fb9c4));});}});}function getConnection(_0xb31491){var _0x3ad762=_0xb31491['username'];var _0x5e8a57=_0xb31491[_0x78aa('0x46')];return request({'method':_0x78aa('0x3b'),'uri':util['format'](_0x78aa('0x22'),_0xb31491['remoteUri']),'qs':{'operation':_0x78aa('0x47'),'username':_0x3ad762},'json':!![]})[_0x78aa('0x27')](function(_0x5dabe6){if(_0x5dabe6['success']){return request({'method':_0x78aa('0x41'),'uri':util[_0x78aa('0x21')]('%s/webservice.php',_0xb31491['remoteUri']),'form':{'operation':_0x78aa('0x48'),'username':_0x78aa('0x24'),'accessKey':md5(_0x5dabe6['result'][_0x78aa('0x49')]+_0x5e8a57)},'json':!![]});}})[_0x78aa('0x27')](function(_0x1e77c4){if(_0x1e77c4[_0x78aa('0x28')]){return BPromise[_0x78aa('0x29')](_0x1e77c4['result']);}else{throw new Error(util[_0x78aa('0x21')](_0x78aa('0x4a'),_0xb31491['id']));}})[_0x78aa('0x2d')](function(_0x2861f3){var _0x2c5a27=_0x2861f3[_0x78aa('0x38')]||0x1f4;logger['error'](_0x78aa('0x2f'),_0x78aa('0x4b'),_0x2c5a27,JSON[_0x78aa('0x2c')](_0x2861f3));});}function request(_0x4e4e53){logger[_0x78aa('0x1a')]('[HTTP]',JSON['stringify'](_0x4e4e53));return rp(_0x4e4e53);}exports[_0x78aa('0x4c')]=function(_0x3489b8,_0x24f647,_0x4e5fd5,_0x3ba940,_0x41442b,_0x2e96f9){var _0x56caf8,_0x383d71,_0xff1634,_0x125698;_0x2e96f9[_0x78aa('0x3c')]=intUtil[_0x78aa('0x4d')](_0x2e96f9['remoteUri']);if(_0x41442b&&_0x41442b[_0x78aa('0x4e')]){logger[_0x78aa('0x1a')](_0x78aa('0x4f'),'Recording\x20is\x20enabled!');_0x24f647[_0x78aa('0x50')]=util[_0x78aa('0x21')](_0x78aa('0x51'),_0x2e96f9['serverUrl'],_0x24f647[_0x78aa('0x52')],md5(_0x24f647['uniqueid']));}else{_0x24f647[_0x78aa('0x50')]='';}return getConnection(_0x2e96f9)[_0x78aa('0x27')](function(_0x42626a){_0x125698=_0x42626a;return getUser(_0x2e96f9,_0x3ba940['email'],_0x125698);})[_0x78aa('0x27')](function(_0x361f02){_0x56caf8=_0x361f02;logger[_0x78aa('0x1a')](_0x78aa('0x53'),_0x56caf8['id']);return getEndUser(_0x2e96f9,_0x24f647['calleridname'],_0x24f647[_0x78aa('0x54')],_0x125698);})['then'](function(_0x5cf84a){_0x383d71=_0x5cf84a;logger['info']('The\x20Enduser\x20ID\x20is:',_0x383d71['id']);return createTicket(_0x2e96f9,_0x56caf8,_0x383d71,_0x4e5fd5,_0x24f647,_0x4e5fd5['Fields'],_0x125698);})[_0x78aa('0x27')](function(_0x3fa4e9){_0xff1634=_0x3fa4e9;logger['info'](_0x78aa('0x55'));logger[_0x78aa('0x1a')](_0x78aa('0x56'),_0xff1634['id']);var _0x167f3d=util['format'](_0x78aa('0x57'),_0x2e96f9[_0x78aa('0x3c')],_['split'](_0xff1634['id'],'x')[0x1]);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x78aa('0x21')](_0x78aa('0x58'),_0x3ba940[_0x78aa('0x18')]),'trigger:browser:url',{'uri':_0x167f3d});})[_0x78aa('0x2d')](function(_0x4f3309){logger[_0x78aa('0x2e')](_0x78aa('0x4f'),JSON[_0x78aa('0x2c')](_0x4f3309));});};exports[_0x78aa('0x59')]=function(_0x352cd6,_0x1c738b,_0x2245b4,_0x192795,_0x5482e1,_0x34a239,_0x5788cb){var _0x416610,_0x152b18,_0x4057aa,_0x1ce565;_0x34a239[_0x78aa('0x3c')]=intUtil['stripTrailingSlash'](_0x34a239[_0x78aa('0x3c')]);_0x34a239[_0x78aa('0x5a')]=intUtil[_0x78aa('0x4d')](_0x34a239[_0x78aa('0x5a')]);if(_0x5788cb&&_0x5788cb[_0x78aa('0x5b')]&&_0x5788cb[_0x78aa('0x5b')]!==_0x78aa('0x5c')){logger['info'](_0x78aa('0x5d'),'Recording\x20is\x20enabled!');_0x1c738b[_0x78aa('0x50')]=util[_0x78aa('0x21')](_0x78aa('0x51'),_0x34a239[_0x78aa('0x5a')],_0x1c738b['uniqueid'],md5(_0x1c738b[_0x78aa('0x52')]));}return getConnection(_0x34a239)[_0x78aa('0x27')](function(_0x5165d0){_0x1ce565=_0x5165d0;return getUser(_0x34a239,_0x192795[_0x78aa('0x5e')],_0x1ce565);})[_0x78aa('0x27')](function(_0x2927be){_0x416610=_0x2927be;logger[_0x78aa('0x1a')]('The\x20User\x20ID\x20is:',_0x416610['id']);return getEndUser(_0x34a239,_0x1c738b[_0x78aa('0x5f')],_0x1c738b[_0x78aa('0x60')],_0x1ce565);})[_0x78aa('0x27')](function(_0x3fd323){_0x152b18=_0x3fd323;logger[_0x78aa('0x1a')]('The\x20Enduser\x20ID\x20is:',_0x152b18['id']);return createTicket(_0x34a239,_0x416610,_0x152b18,_0x2245b4,_0x1c738b,_0x2245b4[_0x78aa('0x61')],_0x1ce565);})['then'](function(_0x585df5){_0x4057aa=_0x585df5;logger[_0x78aa('0x1a')](_0x78aa('0x55'));logger[_0x78aa('0x1a')]('The\x20Ticket\x20ID\x20is:',_0x4057aa['id']);var _0x58ccc7=util[_0x78aa('0x21')](_0x78aa('0x57'),_0x34a239['remoteUri'],_[_0x78aa('0x62')](_0x4057aa['id'],'x')[0x1]);logger[_0x78aa('0x1a')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x78aa('0x21')](_0x78aa('0x58'),_0x192795[_0x78aa('0x18')]),'trigger:browser:url',{'uri':_0x58ccc7});})[_0x78aa('0x2d')](function(_0x4228c8){logger[_0x78aa('0x2e')](_0x78aa('0x5d'),JSON[_0x78aa('0x2c')](_0x4228c8));});};exports[_0x78aa('0x63')]=function(_0x324dc9,_0x12d586,_0x37dbb2,_0x243041,_0x9021c6,_0x1d766b){var _0x3e2412,_0x3741c2,_0xe8b573,_0xa0e2c7;_0x1d766b[_0x78aa('0x3c')]=intUtil['stripTrailingSlash'](_0x1d766b[_0x78aa('0x3c')]);_0x1d766b[_0x78aa('0x5a')]=intUtil[_0x78aa('0x4d')](_0x1d766b[_0x78aa('0x5a')]);if(_0x9021c6&&_0x9021c6[_0x78aa('0x4e')]){logger[_0x78aa('0x1a')](_0x78aa('0x64'),_0x78aa('0x65'));_0x12d586['recordingURL']=util[_0x78aa('0x21')](_0x78aa('0x51'),_0x1d766b['serverUrl'],_0x12d586[_0x78aa('0x52')],md5(_0x12d586['uniqueid']));}else{_0x12d586[_0x78aa('0x50')]='';}return getConnection(_0x1d766b)[_0x78aa('0x27')](function(_0x25d63a){_0xa0e2c7=_0x25d63a;return getUser(_0x1d766b,'',_0xa0e2c7);})['then'](function(_0x47a18b){_0x3e2412=_0x47a18b;logger[_0x78aa('0x1a')]('The\x20User\x20ID\x20is:',_0x3e2412['id']);return getEndUser(_0x1d766b,_0x12d586[_0x78aa('0x66')],_0x12d586[_0x78aa('0x54')],_0xa0e2c7);})['then'](function(_0x5a1727){_0x3741c2=_0x5a1727;logger[_0x78aa('0x1a')](_0x78aa('0x67'),_0x3741c2['id']);return createTicket(_0x1d766b,_0x3e2412,_0x3741c2,_0x37dbb2,_0x12d586,_0x37dbb2[_0x78aa('0x61')],_0xa0e2c7);})['then'](function(_0x50684f){_0xe8b573=_0x50684f;logger[_0x78aa('0x1a')](_0x78aa('0x55'));logger[_0x78aa('0x1a')](_0x78aa('0x56'),_0xe8b573['id']);})[_0x78aa('0x2d')](function(_0x514ab8){logger[_0x78aa('0x2e')]('[ABANDONED]',JSON['stringify'](_0x514ab8));});}; \ No newline at end of file +var _0xe9ad=['queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','trigger:browser:url','[ABANDONED]','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','Open','getString','Descriptions','POST','format','%s/webservice.php','remoteUri','create','admin','sessionName','HelpDesk','stringify','then','success','resolve','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','createTicket','info','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','userId','catch','[vTiger],\x20%s,\x20%s,\x20%s','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','getConnection'];(function(_0x10cb39,_0x4f2f75){var _0x8699a5=function(_0x4f5bb3){while(--_0x4f5bb3){_0x10cb39['push'](_0x10cb39['shift']());}};_0x8699a5(++_0x4f2f75);}(_0xe9ad,0x82));var _0xde9a=function(_0x4b6bee,_0x23f984){_0x4b6bee=_0x4b6bee-0x0;var _0x167259=_0xe9ad[_0x4b6bee];return _0x167259;};'use strict';var _=require(_0xde9a('0x0'));var rp=require(_0xde9a('0x1'));var BPromise=require(_0xde9a('0x2'));var md5=require(_0xde9a('0x3'));var util=require(_0xde9a('0x4'));var Redis=require(_0xde9a('0x5'));var intUtil=require(_0xde9a('0x6'));var config=require('../../../../config/environment');var logger=require(_0xde9a('0x7'))(_0xde9a('0x8'));config[_0xde9a('0x9')]=_[_0xde9a('0xa')](config['redis'],{'host':_0xde9a('0xb'),'port':0x18eb});var io=require(_0xde9a('0xc'))(new Redis(config[_0xde9a('0x9')]));function emit(_0x5d4412,_0x45d4a7,_0x17f89b){io['to'](_0x5d4412)[_0xde9a('0xd')](_0x45d4a7,_0x17f89b);}function getCustomFields(_0x1fac02,_0x297975){var _0x34cd1a={};if(_0x1fac02[_0xde9a('0xe')]>0x0){_[_0xde9a('0xf')](_0x1fac02,function(_0x2fe8b2){if(_0x2fe8b2['type']===_0xde9a('0x10')&&_0x2fe8b2[_0xde9a('0x11')]){_0x34cd1a[_0x2fe8b2[_0xde9a('0x11')]]=_0x2fe8b2[_0xde9a('0x12')][_0xde9a('0x13')]();}else if(_0x2fe8b2[_0xde9a('0x14')]===_0xde9a('0x15')&&_0x2fe8b2[_0xde9a('0x16')]&&_0x2fe8b2[_0xde9a('0x11')]&&_0x297975[_0x2fe8b2['variableName']]){_0x34cd1a[_0x2fe8b2[_0xde9a('0x11')]]=_0x297975[_0x2fe8b2[_0xde9a('0x16')]][_0xde9a('0x13')]();}else if(_0x2fe8b2[_0xde9a('0x14')]===_0xde9a('0x17')&&_0x2fe8b2[_0xde9a('0x18')]&&_0x2fe8b2[_0xde9a('0x18')][_0xde9a('0x19')]&&_0x2fe8b2[_0xde9a('0x11')]&&_0x297975[_0x2fe8b2[_0xde9a('0x18')][_0xde9a('0x19')][_0xde9a('0x1a')]()]){_0x34cd1a[_0x2fe8b2[_0xde9a('0x11')]]=_0x297975[_0x2fe8b2[_0xde9a('0x18')][_0xde9a('0x19')][_0xde9a('0x1a')]()]['toString']();}});}return _0x34cd1a;}function createTicket(_0x12ba7f,_0x2714a9,_0x3b89ef,_0x57613b,_0x2e96ee,_0x52e5ea,_0x8f481a){logger['info'](_0xde9a('0x1b'));var _0x5b2a41=_[_0xde9a('0x1c')]({'parent_id':'','assigned_user_id':_0x2714a9['id'],'ticketpriorities':'Normal','ticketstatus':_0xde9a('0x1d'),'ticket_title':intUtil[_0xde9a('0x1e')](_0x57613b['Subjects'],_0x2e96ee,'\x20'),'description':intUtil['getString'](_0x57613b[_0xde9a('0x1f')],_0x2e96ee,'\x0a'),'contact_id':_0x3b89ef['id']},getCustomFields(_0x52e5ea,_0x2e96ee));var _0x416b36={'method':_0xde9a('0x20'),'uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x12ba7f[_0xde9a('0x23')]),'form':{'operation':_0xde9a('0x24'),'username':_0xde9a('0x25'),'sessionName':_0x8f481a[_0xde9a('0x26')],'elementType':_0xde9a('0x27'),'element':JSON[_0xde9a('0x28')](_0x5b2a41)},'json':!![]};return request(_0x416b36)[_0xde9a('0x29')](function(_0x2fa60c){if(_0x2fa60c[_0xde9a('0x2a')]){return BPromise[_0xde9a('0x2b')]({'id':_0x2fa60c[_0xde9a('0x2c')]['id']});}else{throw new Error(util[_0xde9a('0x21')](_0xde9a('0x2d'),JSON[_0xde9a('0x28')](_0x2fa60c['error'])));}})['catch'](function(_0x1ee39e){var _0x42ba56=_0x1ee39e[_0xde9a('0x2e')]||0x1f4;logger[_0xde9a('0x2f')]('[vTiger],\x20%s,\x20%s,\x20%s',_0xde9a('0x30'),_0x42ba56,JSON[_0xde9a('0x28')](_0x1ee39e));});}function getUser(_0x467ce2,_0x51806d,_0x3bd254){if(intUtil['validateEmail'](_0x51806d)){logger[_0xde9a('0x31')]('Getting\x20agent\x20with\x20email',_0x51806d);return request({'method':_0xde9a('0x32'),'uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x467ce2[_0xde9a('0x23')]),'qs':{'operation':_0xde9a('0x33'),'username':_0xde9a('0x25'),'sessionName':_0x3bd254[_0xde9a('0x26')],'query':util['format'](_0xde9a('0x34'),_0x51806d)},'json':!![]})[_0xde9a('0x29')](function(_0x25d7f1){if(_0x25d7f1[_0xde9a('0x2a')]&&_0x25d7f1[_0xde9a('0x2c')][_0xde9a('0xe')]){logger[_0xde9a('0x31')](_0xde9a('0x35'));return BPromise[_0xde9a('0x2b')]({'id':_0x25d7f1[_0xde9a('0x2c')][0x0]['id'],'email':_0x25d7f1[_0xde9a('0x2c')][0x0][_0xde9a('0x36')],'name':_0x25d7f1[_0xde9a('0x2c')][0x0][_0xde9a('0x37')]+'\x20'+_0x25d7f1['result']['last_name']});}else{logger[_0xde9a('0x31')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0xde9a('0x2b')]({'id':_0x3bd254[_0xde9a('0x38')],'email':_0x467ce2['username'],'name':_0xde9a('0x25')});}})[_0xde9a('0x39')](function(_0x29579e){var _0x4d45a2=_0x29579e['statusCode']||0x1f4;logger[_0xde9a('0x2f')](_0xde9a('0x3a'),'getUser',_0x4d45a2,JSON[_0xde9a('0x28')](_0x29579e));});}else{logger[_0xde9a('0x31')](_0xde9a('0x3b'));return BPromise[_0xde9a('0x2b')]({'id':_0x3bd254[_0xde9a('0x38')],'email':_0x467ce2[_0xde9a('0x3c')],'name':_0xde9a('0x25')})[_0xde9a('0x39')](function(_0x32c6f0){var _0x463dc5=_0x32c6f0['statusCode']||0x1f4;logger[_0xde9a('0x2f')](_0xde9a('0x3a'),_0xde9a('0x3d'),_0x463dc5,JSON[_0xde9a('0x28')](_0x32c6f0));});}}function getEndUser(_0x4e67e7,_0x40a62f,_0xbdfe73,_0x1bc86d){logger[_0xde9a('0x31')](_0xde9a('0x3e'),_0xbdfe73);return request({'method':_0xde9a('0x32'),'uri':util['format'](_0xde9a('0x22'),_0x4e67e7[_0xde9a('0x23')]),'qs':{'operation':'query','username':_0xde9a('0x25'),'sessionName':_0x1bc86d[_0xde9a('0x26')],'query':util[_0xde9a('0x21')](_0xde9a('0x3f'),_0xbdfe73,_0xbdfe73,_0xbdfe73,_0xbdfe73,_0xbdfe73)},'json':!![]})[_0xde9a('0x29')](function(_0x5ccb51){if(_0x5ccb51[_0xde9a('0x2a')]&&_0x5ccb51[_0xde9a('0x2c')][_0xde9a('0xe')]){logger[_0xde9a('0x31')](_0xde9a('0x40'));return BPromise[_0xde9a('0x2b')]({'id':_0x5ccb51[_0xde9a('0x2c')][0x0]['id'],'name':_0x5ccb51[_0xde9a('0x2c')][0x0]['firstname']+'\x20'+_0x5ccb51[_0xde9a('0x2c')][0x0][_0xde9a('0x41')],'phone':_0xbdfe73});}else{logger['info'](_0xde9a('0x42'));return request({'method':'POST','uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x4e67e7[_0xde9a('0x23')]),'form':{'operation':_0xde9a('0x24'),'sessionName':_0x1bc86d[_0xde9a('0x26')],'elementType':_0xde9a('0x43'),'element':JSON[_0xde9a('0x28')]({'lastname':_0x40a62f,'phone':_0xbdfe73,'assigned_user_id':'\x20'})},'json':!![]})[_0xde9a('0x29')](function(_0x57fbf8){logger['info'](_0xde9a('0x44'));return BPromise[_0xde9a('0x2b')]({'id':_0x57fbf8['result']['id'],'name':_0x57fbf8['result'][_0xde9a('0x41')],'phone':_0x57fbf8[_0xde9a('0x2c')][_0xde9a('0x45')]});})[_0xde9a('0x39')](function(_0x10a645){var _0x5b9d60=_0x10a645[_0xde9a('0x2e')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0xde9a('0x46'),_0x5b9d60,JSON[_0xde9a('0x28')](_0x10a645));});}});}function getConnection(_0x5b6d34){var _0x34f550=_0x5b6d34[_0xde9a('0x3c')];var _0x4f1a07=_0x5b6d34[_0xde9a('0x47')];return request({'method':_0xde9a('0x32'),'uri':util[_0xde9a('0x21')](_0xde9a('0x22'),_0x5b6d34[_0xde9a('0x23')]),'qs':{'operation':_0xde9a('0x48'),'username':_0x34f550},'json':!![]})[_0xde9a('0x29')](function(_0x58c343){if(_0x58c343[_0xde9a('0x2a')]){return request({'method':'POST','uri':util['format'](_0xde9a('0x22'),_0x5b6d34[_0xde9a('0x23')]),'form':{'operation':_0xde9a('0x49'),'username':_0xde9a('0x25'),'accessKey':md5(_0x58c343[_0xde9a('0x2c')][_0xde9a('0x4a')]+_0x4f1a07)},'json':!![]});}})[_0xde9a('0x29')](function(_0x95b412){if(_0x95b412[_0xde9a('0x2a')]){return BPromise[_0xde9a('0x2b')](_0x95b412[_0xde9a('0x2c')]);}else{throw new Error(util[_0xde9a('0x21')]('Account\x20%d\x20is\x20not\x20valid',_0x5b6d34['id']));}})[_0xde9a('0x39')](function(_0x21ac07){var _0x3c2cdf=_0x21ac07[_0xde9a('0x2e')]||0x1f4;logger[_0xde9a('0x2f')](_0xde9a('0x3a'),_0xde9a('0x4b'),_0x3c2cdf,JSON[_0xde9a('0x28')](_0x21ac07));});}function request(_0x222044){logger[_0xde9a('0x31')]('[HTTP]',JSON['stringify'](_0x222044));return rp(_0x222044);}exports[_0xde9a('0x4c')]=function(_0x426ea9,_0x397264,_0x210fcd,_0x52c59b,_0x8c11ca,_0x816717){var _0x60e342,_0x4872f6,_0x31dc15,_0x3d5f70;_0x816717['remoteUri']=intUtil[_0xde9a('0x4d')](_0x816717[_0xde9a('0x23')]);if(_0x8c11ca&&_0x8c11ca[_0xde9a('0x4e')]){logger[_0xde9a('0x31')](_0xde9a('0x4f'),_0xde9a('0x50'));_0x397264['recordingURL']=util['format'](_0xde9a('0x51'),_0x816717[_0xde9a('0x52')],_0x397264['uniqueid'],md5(_0x397264[_0xde9a('0x53')]));}else{_0x397264['recordingURL']='';}return getConnection(_0x816717)[_0xde9a('0x29')](function(_0x4be605){_0x3d5f70=_0x4be605;return getUser(_0x816717,_0x52c59b[_0xde9a('0x54')],_0x3d5f70);})[_0xde9a('0x29')](function(_0x5368ca){_0x60e342=_0x5368ca;logger['info'](_0xde9a('0x55'),_0x60e342['id']);return getEndUser(_0x816717,_0x397264[_0xde9a('0x56')],_0x397264[_0xde9a('0x57')],_0x3d5f70);})[_0xde9a('0x29')](function(_0x1a1786){_0x4872f6=_0x1a1786;logger[_0xde9a('0x31')](_0xde9a('0x58'),_0x4872f6['id']);return createTicket(_0x816717,_0x60e342,_0x4872f6,_0x210fcd,_0x397264,_0x210fcd['Fields'],_0x3d5f70);})[_0xde9a('0x29')](function(_0x7481fd){_0x31dc15=_0x7481fd;logger[_0xde9a('0x31')](_0xde9a('0x59'));logger['info'](_0xde9a('0x5a'),_0x31dc15['id']);var _0x472d6e=util[_0xde9a('0x21')](_0xde9a('0x5b'),_0x816717[_0xde9a('0x23')],_[_0xde9a('0x5c')](_0x31dc15['id'],'x')[0x1]);logger[_0xde9a('0x31')]('[QUEUE]',_0xde9a('0x5d'));emit(util[_0xde9a('0x21')](_0xde9a('0x5e'),_0x52c59b['name']),'trigger:browser:url',{'uri':_0x472d6e});})[_0xde9a('0x39')](function(_0x40cf79){logger['error'](_0xde9a('0x4f'),JSON[_0xde9a('0x28')](_0x40cf79));});};exports[_0xde9a('0x5f')]=function(_0x2ef673,_0x53cb96,_0x19b1a2,_0x5e3195,_0x57e8ca,_0x589360,_0x35250c){var _0x2a4ba0,_0x4a1164,_0x509efb,_0x286203;_0x589360[_0xde9a('0x23')]=intUtil[_0xde9a('0x4d')](_0x589360[_0xde9a('0x23')]);_0x589360[_0xde9a('0x52')]=intUtil['stripTrailingSlash'](_0x589360['serverUrl']);if(_0x35250c&&_0x35250c['recordingFormat']&&_0x35250c[_0xde9a('0x60')]!=='none'){logger[_0xde9a('0x31')](_0xde9a('0x61'),_0xde9a('0x50'));_0x53cb96[_0xde9a('0x62')]=util['format'](_0xde9a('0x51'),_0x589360[_0xde9a('0x52')],_0x53cb96['uniqueid'],md5(_0x53cb96['uniqueid']));}return getConnection(_0x589360)[_0xde9a('0x29')](function(_0x23c830){_0x286203=_0x23c830;return getUser(_0x589360,_0x5e3195[_0xde9a('0x54')],_0x286203);})[_0xde9a('0x29')](function(_0x4b4a93){_0x2a4ba0=_0x4b4a93;logger[_0xde9a('0x31')](_0xde9a('0x55'),_0x2a4ba0['id']);return getEndUser(_0x589360,_0x53cb96[_0xde9a('0x63')],_0x53cb96[_0xde9a('0x64')],_0x286203);})[_0xde9a('0x29')](function(_0x5f17ab){_0x4a1164=_0x5f17ab;logger[_0xde9a('0x31')](_0xde9a('0x58'),_0x4a1164['id']);return createTicket(_0x589360,_0x2a4ba0,_0x4a1164,_0x19b1a2,_0x53cb96,_0x19b1a2['Fields'],_0x286203);})[_0xde9a('0x29')](function(_0x1cd288){_0x509efb=_0x1cd288;logger['info'](_0xde9a('0x59'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x509efb['id']);var _0x1dc2ec=util[_0xde9a('0x21')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x589360['remoteUri'],_[_0xde9a('0x5c')](_0x509efb['id'],'x')[0x1]);logger[_0xde9a('0x31')](_0xde9a('0x61'),_0xde9a('0x5d'));emit(util['format']('user:%s',_0x5e3195[_0xde9a('0x19')]),_0xde9a('0x65'),{'uri':_0x1dc2ec});})[_0xde9a('0x39')](function(_0x283451){logger[_0xde9a('0x2f')]('[OUTBOUND]',JSON[_0xde9a('0x28')](_0x283451));});};exports['abandoned']=function(_0x59ccb4,_0x1a082a,_0x3d5386,_0x326f77,_0x49d70a,_0x112af4){var _0x3a5f74,_0x44aeac,_0xe412ed,_0x40161f;_0x112af4[_0xde9a('0x23')]=intUtil[_0xde9a('0x4d')](_0x112af4[_0xde9a('0x23')]);_0x112af4[_0xde9a('0x52')]=intUtil[_0xde9a('0x4d')](_0x112af4['serverUrl']);if(_0x49d70a&&_0x49d70a['monitor_format']){logger[_0xde9a('0x31')](_0xde9a('0x66'),_0xde9a('0x50'));_0x1a082a[_0xde9a('0x62')]=util[_0xde9a('0x21')](_0xde9a('0x51'),_0x112af4[_0xde9a('0x52')],_0x1a082a[_0xde9a('0x53')],md5(_0x1a082a['uniqueid']));}else{_0x1a082a['recordingURL']='';}return getConnection(_0x112af4)[_0xde9a('0x29')](function(_0x200ce6){_0x40161f=_0x200ce6;return getUser(_0x112af4,'',_0x40161f);})[_0xde9a('0x29')](function(_0x451107){_0x3a5f74=_0x451107;logger[_0xde9a('0x31')](_0xde9a('0x55'),_0x3a5f74['id']);return getEndUser(_0x112af4,_0x1a082a[_0xde9a('0x56')],_0x1a082a[_0xde9a('0x57')],_0x40161f);})[_0xde9a('0x29')](function(_0x19f88d){_0x44aeac=_0x19f88d;logger[_0xde9a('0x31')]('The\x20Enduser\x20ID\x20is:',_0x44aeac['id']);return createTicket(_0x112af4,_0x3a5f74,_0x44aeac,_0x3d5386,_0x1a082a,_0x3d5386['Fields'],_0x40161f);})[_0xde9a('0x29')](function(_0x43ae23){_0xe412ed=_0x43ae23;logger['info'](_0xde9a('0x59'));logger[_0xde9a('0x31')](_0xde9a('0x5a'),_0xe412ed['id']);})[_0xde9a('0x39')](function(_0x501876){logger[_0xde9a('0x2f')](_0xde9a('0x66'),JSON[_0xde9a('0x28')](_0x501876));});}; \ 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 418dc70..de93901 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 _0xd494=['Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','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','error','Zendesk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','[ABANDONED]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','find','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','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','Basic\x20%s','toString','stringify','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','variable','variableName','Variable','name','push','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]'];(function(_0x564974,_0x4c4288){var _0x11ad87=function(_0x4df2b7){while(--_0x4df2b7){_0x564974['push'](_0x564974['shift']());}};_0x11ad87(++_0x4c4288);}(_0xd494,0x1c3));var _0x4d49=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd494[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x4d49('0x0'));var rp=require(_0x4d49('0x1'));var md5=require(_0x4d49('0x2'));var util=require(_0x4d49('0x3'));var Redis=require('ioredis');var intUtil=require(_0x4d49('0x4'));var config=require(_0x4d49('0x5'));var logger=require(_0x4d49('0x6'))(_0x4d49('0x7'));config[_0x4d49('0x8')]=_[_0x4d49('0x9')](config['redis'],{'host':_0x4d49('0xa'),'port':0x18eb});var io=require(_0x4d49('0xb'))(new Redis(config[_0x4d49('0x8')]));function emit(_0x5e7500,_0x4c4425,_0x1904e2){io['to'](_0x5e7500)['emit'](_0x4c4425,_0x1904e2);}var headers={'Content-Type':'application/json','Accept':_0x4d49('0xc')};function getTicket(_0x30d47f,_0x160e9d,_0x57c679,_0x2f579f,_0x3de484){logger['info'](_0x4d49('0xd'));return request({'uri':util[_0x4d49('0xe')](_0x4d49('0xf'),_0x30d47f[_0x4d49('0x10')]),'method':_0x4d49('0x11'),'body':{'ticket':_[_0x4d49('0x12')]({'requester_id':_0x57c679['id'],'submitter_id':_0x160e9d?_0x160e9d['id']:undefined,'assignee_id':_0x160e9d?_0x160e9d['id']:undefined,'tags':getTags(_0x2f579f[_0x4d49('0x13')],'name'),'subject':intUtil[_0x4d49('0x14')](_0x2f579f[_0x4d49('0x15')],_0x3de484,'\x20'),'description':intUtil[_0x4d49('0x14')](_0x2f579f[_0x4d49('0x16')],_0x3de484,'\x0a'),'comment':{'public':![],'body':intUtil[_0x4d49('0x14')](_0x2f579f[_0x4d49('0x16')],_0x3de484,'\x0a')}},getCustomFields(_0x2f579f[_0x4d49('0x17')],_0x3de484))}})[_0x4d49('0x18')](function(_0x1b7974){logger[_0x4d49('0x19')](_0x4d49('0x1a'));return _0x1b7974[_0x4d49('0x1b')];});}function getUser(_0x3f2a7b,_0x252486){if(intUtil[_0x4d49('0x1c')](_0x252486)){logger['info'](_0x4d49('0x1d'),_0x252486);return request({'uri':util['format'](_0x4d49('0x1e'),_0x3f2a7b['remoteUri']),'qs':{'query':util[_0x4d49('0xe')]('type:user\x20role:agent\x20email:%s',_0x252486)}})['then'](function(_0x383fa6){if(_0x383fa6['count']){logger[_0x4d49('0x19')]('Agent\x20found!');return _[_0x4d49('0x1f')](_0x383fa6[_0x4d49('0x20')],{'email':_0x252486,'role':'agent'});}else{logger['info'](_0x4d49('0x21'));return request({'uri':util[_0x4d49('0xe')]('%s/users/me.json',_0x3f2a7b[_0x4d49('0x10')])})[_0x4d49('0x18')](function(_0x33239b){logger[_0x4d49('0x19')](_0x4d49('0x22'));return _0x33239b[_0x4d49('0x23')];});}});}else{logger[_0x4d49('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x4d49('0x24'),_0x3f2a7b[_0x4d49('0x10')])})[_0x4d49('0x18')](function(_0x457c05){logger['info']('Admin\x20account\x20selected.');return _0x457c05[_0x4d49('0x23')];});}}function getEndUser(_0x130227,_0x44f80d,_0x547076){logger[_0x4d49('0x19')](_0x4d49('0x25'),_0x547076);return request({'uri':util['format'](_0x4d49('0x1e'),_0x130227[_0x4d49('0x10')]),'qs':{'query':util[_0x4d49('0xe')](_0x4d49('0x26'),_0x547076)}})[_0x4d49('0x18')](function(_0x4bc0f0){var _0x155842;if(_0x4bc0f0[_0x4d49('0x20')][_0x4d49('0x27')]){_0x4bc0f0[_0x4d49('0x20')]=_['filter'](_0x4bc0f0['results'],{'suspended':![],'role':_0x4d49('0x28')});if(_0x4bc0f0['results'][_0x4d49('0x27')]){_0x155842=_[_0x4d49('0x29')](_0x4bc0f0[_0x4d49('0x20')]);}}if(_0x155842){logger['info'](_0x4d49('0x2a'));return _0x155842;}else{logger[_0x4d49('0x19')](_0x4d49('0x2b'));return request({'uri':util['format'](_0x4d49('0x2c'),_0x130227[_0x4d49('0x10')]),'method':_0x4d49('0x11'),'body':{'user':{'role':'end-user','name':util[_0x4d49('0xe')](_0x4d49('0x2d'),_0x44f80d||_0x547076),'phone':_0x547076}}})['then'](function(_0x175163){logger[_0x4d49('0x19')](_0x4d49('0x2e'));return _0x175163[_0x4d49('0x23')];});}});}function getAuth(_0x1e7881){var _0x2ce2c5;if(_0x1e7881[_0x4d49('0x2f')]===_0x4d49('0x30')){_0x2ce2c5=util['format']('%s:%s',_0x1e7881[_0x4d49('0x31')],_0x1e7881[_0x4d49('0x30')]);}else if(_0x1e7881['authType']===_0x4d49('0x32')){_0x2ce2c5=util[_0x4d49('0xe')]('%s/token:%s',_0x1e7881[_0x4d49('0x31')],_0x1e7881['token']);}return util[_0x4d49('0xe')](_0x4d49('0x33'),new Buffer(_0x2ce2c5)[_0x4d49('0x34')]('base64'));}function request(_0x3872c7){logger['debug']('[HTTP]',JSON[_0x4d49('0x35')](_0x3872c7));return rp(_['defaults'](_0x3872c7,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x47e0d2,_0x2ba11b){var _0x4fe198=[];if(_0x47e0d2&&_0x47e0d2[_0x4d49('0x27')]>0x0){_0x4fe198=_[_0x4d49('0x36')](_0x47e0d2,_0x2ba11b);}return _0x4fe198;}function getCustomFields(_0x5828a5,_0x2025d3){var _0x36fd1d=[];var _0x20db41={'custom_fields':[]};if(_0x5828a5[_0x4d49('0x27')]>0x0){_[_0x4d49('0x37')](_0x5828a5,function(_0xd05267){if(_0xd05267[_0x4d49('0x38')]===_0x4d49('0x39')&&_0xd05267[_0x4d49('0x3a')]&&!_0xd05267[_0x4d49('0x3b')]){_0x20db41[_0xd05267[_0x4d49('0x3a')][_0x4d49('0x3c')]()]=_0xd05267[_0x4d49('0x3d')][_0x4d49('0x34')]();}else if(_0xd05267['type']===_0x4d49('0x39')&&_0xd05267[_0x4d49('0x3e')]&&_0xd05267[_0x4d49('0x3b')]){_0x20db41[_0x4d49('0x3f')]['push']({'id':_0xd05267['idField'],'value':_0xd05267['content'][_0x4d49('0x34')]()});}else if(_0xd05267[_0x4d49('0x38')]===_0x4d49('0x40')&&_0xd05267[_0x4d49('0x41')]&&_0xd05267[_0x4d49('0x3e')]&&_0xd05267[_0x4d49('0x3b')]){_0x2025d3[_0xd05267[_0x4d49('0x41')]]&&_0x20db41[_0x4d49('0x3f')]['push']({'id':_0xd05267[_0x4d49('0x3e')],'value':_0x2025d3[_0xd05267[_0x4d49('0x41')]][_0x4d49('0x34')]()});}else if(_0xd05267['type']==='customVariable'&&_0xd05267[_0x4d49('0x42')]&&_0xd05267[_0x4d49('0x42')][_0x4d49('0x43')]&&_0xd05267[_0x4d49('0x3e')]&&_0xd05267[_0x4d49('0x3b')]){_0x2025d3[_0xd05267[_0x4d49('0x42')][_0x4d49('0x43')][_0x4d49('0x3c')]()]&&_0x20db41[_0x4d49('0x3f')][_0x4d49('0x44')]({'id':_0xd05267[_0x4d49('0x3e')],'value':_0x2025d3[_0xd05267[_0x4d49('0x42')][_0x4d49('0x43')]['toLowerCase']()][_0x4d49('0x34')]()});}});}return _0x20db41;}exports[_0x4d49('0x45')]=function(_0x35eb29,_0x3a61ee,_0x8d13cb,_0x2a2fee,_0x189bc2,_0x7e1fdb){var _0xe01962,_0x412c62;_0x7e1fdb['remoteUri']=intUtil[_0x4d49('0x46')](_0x7e1fdb['remoteUri']);_0x7e1fdb[_0x4d49('0x47')]=intUtil['stripTrailingSlash'](_0x7e1fdb[_0x4d49('0x47')]);if(_0x189bc2&&_0x189bc2[_0x4d49('0x48')]){logger['info'](_0x4d49('0x49'),_0x4d49('0x4a'));_0x3a61ee[_0x4d49('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x7e1fdb[_0x4d49('0x47')],_0x3a61ee[_0x4d49('0x4c')],md5(_0x3a61ee[_0x4d49('0x4c')]));}else{_0x3a61ee[_0x4d49('0x4b')]='';}headers[_0x4d49('0x4d')]=getAuth(_0x7e1fdb);return getUser(_0x7e1fdb,_0x2a2fee['email'])[_0x4d49('0x18')](function(_0x134a21){_0xe01962=_0x134a21;logger[_0x4d49('0x19')](_0x4d49('0x4e'),_0xe01962['id']);return getEndUser(_0x7e1fdb,_0x3a61ee[_0x4d49('0x4f')],_0x3a61ee[_0x4d49('0x50')]);})[_0x4d49('0x18')](function(_0x1b038f){_0x412c62=_0x1b038f;logger[_0x4d49('0x19')]('The\x20Enduser\x20ID\x20is:',_0x412c62['id']);return getTicket(_0x7e1fdb,_0xe01962,_0x412c62,_0x8d13cb,_0x3a61ee);})[_0x4d49('0x18')](function(_0x4e610e){if(_0x4e610e){logger['info'](_0x4d49('0x51'),_0x4e610e['id']);switch(_0x7e1fdb[_0x4d49('0x38')]){case'integrationTab':logger[_0x4d49('0x19')](_0x4d49('0x49'),_0x4d49('0x52'));return request({'uri':util[_0x4d49('0xe')](_0x4d49('0x53'),_0x7e1fdb[_0x4d49('0x10')],_0xe01962['id'],_0x4e610e['id']),'method':_0x4d49('0x11')});case'newTab':logger[_0x4d49('0x19')]('[QUEUE]',_0x4d49('0x54'));emit(util['format'](_0x4d49('0x55'),_0x2a2fee[_0x4d49('0x43')]),_0x4d49('0x56'),{'uri':util[_0x4d49('0xe')]('%s/agent/tickets/%s',_0x7e1fdb[_0x4d49('0x10')],_0x4e610e['id'])});break;default:logger[_0x4d49('0x57')](_0x4d49('0x49'),_0x4d49('0x58'));}}})['catch'](function(_0x108563){logger[_0x4d49('0x57')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x108563,{'showHidden':!![],'depth':null}));});};exports[_0x4d49('0x59')]=function(_0x232807,_0x1fc814,_0x51c27b,_0x42a137,_0x3d5c75,_0x4e4fc6,_0x33d020){var _0x390c08,_0x475c2b;_0x4e4fc6[_0x4d49('0x10')]=intUtil[_0x4d49('0x46')](_0x4e4fc6[_0x4d49('0x10')]);_0x4e4fc6[_0x4d49('0x47')]=intUtil[_0x4d49('0x46')](_0x4e4fc6['serverUrl']);if(_0x33d020&&_0x33d020[_0x4d49('0x5a')]&&_0x33d020[_0x4d49('0x5a')]!==_0x4d49('0x5b')){logger['info'](_0x4d49('0x5c'),_0x4d49('0x4a'));_0x1fc814[_0x4d49('0x4b')]=util[_0x4d49('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e4fc6[_0x4d49('0x47')],_0x1fc814[_0x4d49('0x4c')],md5(_0x1fc814[_0x4d49('0x4c')]));}headers[_0x4d49('0x4d')]=getAuth(_0x4e4fc6);return getUser(_0x4e4fc6,_0x42a137[_0x4d49('0x5d')])[_0x4d49('0x18')](function(_0x53a99a){_0x390c08=_0x53a99a;logger[_0x4d49('0x19')](_0x4d49('0x4e'),_0x390c08['id']);return getEndUser(_0x4e4fc6,_0x1fc814[_0x4d49('0x5e')],_0x1fc814[_0x4d49('0x5f')]);})['then'](function(_0x3debb9){_0x475c2b=_0x3debb9;logger[_0x4d49('0x19')](_0x4d49('0x60'),_0x475c2b['id']);return getTicket(_0x4e4fc6,_0x390c08,_0x475c2b,_0x51c27b,_0x1fc814);})[_0x4d49('0x18')](function(_0x5658fc){if(_0x5658fc){logger['info'](_0x4d49('0x51'),_0x5658fc['id']);switch(_0x4e4fc6[_0x4d49('0x38')]){case _0x4d49('0x61'):logger[_0x4d49('0x19')](_0x4d49('0x5c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x4d49('0x53'),_0x4e4fc6['remoteUri'],_0x390c08['id'],_0x5658fc['id']),'method':_0x4d49('0x11')});case'newTab':logger[_0x4d49('0x19')](_0x4d49('0x5c'),_0x4d49('0x54'));emit(util[_0x4d49('0xe')]('user:%s',_0x42a137[_0x4d49('0x43')]),_0x4d49('0x56'),{'uri':util['format'](_0x4d49('0x62'),_0x4e4fc6[_0x4d49('0x10')],_0x5658fc['id'])});break;default:logger[_0x4d49('0x57')]('[OUTBOUND]',_0x4d49('0x58'));}}})[_0x4d49('0x63')](function(_0xa6239d){logger[_0x4d49('0x57')](_0x4d49('0x64'),util[_0x4d49('0x65')](_0xa6239d,{'showHidden':!![],'depth':null}));});};exports[_0x4d49('0x66')]=function(_0x44ac2b,_0x37ee68,_0x2b76c4,_0x3913f4,_0x8edd32,_0x21c9df){var _0x589feb,_0x19fe26;_0x21c9df[_0x4d49('0x10')]=intUtil['stripTrailingSlash'](_0x21c9df['remoteUri']);_0x21c9df[_0x4d49('0x47')]=intUtil['stripTrailingSlash'](_0x21c9df[_0x4d49('0x47')]);if(_0x8edd32&&_0x8edd32[_0x4d49('0x48')]){logger[_0x4d49('0x19')](_0x4d49('0x67'),_0x4d49('0x4a'));_0x37ee68['recordingURL']=util['format'](_0x4d49('0x68'),_0x21c9df['serverUrl'],_0x37ee68[_0x4d49('0x4c')],md5(_0x37ee68['uniqueid']));}else{_0x37ee68[_0x4d49('0x4b')]='';}headers[_0x4d49('0x4d')]=getAuth(_0x21c9df);return getUser(_0x21c9df)['then'](function(_0xf6221a){_0x589feb=_0xf6221a;logger['info'](_0x4d49('0x4e'),_0x589feb['id']);return getEndUser(_0x21c9df,_0x37ee68[_0x4d49('0x4f')],_0x37ee68[_0x4d49('0x50')]);})['then'](function(_0x36782b){_0x19fe26=_0x36782b;logger[_0x4d49('0x19')](_0x4d49('0x60'),_0x19fe26['id']);return getTicket(_0x21c9df,_0x589feb,_0x19fe26,_0x2b76c4,_0x37ee68);})[_0x4d49('0x18')](function(_0x49f30a){if(_0x49f30a){logger[_0x4d49('0x19')](_0x4d49('0x51'),_0x49f30a['id']);}})[_0x4d49('0x63')](function(_0x36a732){logger[_0x4d49('0x57')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x4d49('0x65')](_0x36a732,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x1291=['trigger:browser:url','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','[ABANDONED]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridnum','lodash','md5','ioredis','./util','../../../../config/logger','zendesk','localhost','socket.io-emitter','redis','application/json','info','Creating\x20new\x20ticket...','format','POST','Tags','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','find','results','agent','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','%s/users.json','Caller\x20-\x20%s','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','defaults','GET','forEach','type','string','nameField','content','idField','customField','push','variable','variableName','custom_fields','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','monitor_format','[QUEUE]','serverUrl','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0x1291,0x149));var _0x1129=function(_0xc6c2e1,_0x50010a){_0xc6c2e1=_0xc6c2e1-0x0;var _0x5bb521=_0x1291[_0xc6c2e1];return _0x5bb521;};'use strict';var _=require(_0x1129('0x0'));var rp=require('request-promise');var md5=require(_0x1129('0x1'));var util=require('util');var Redis=require(_0x1129('0x2'));var intUtil=require(_0x1129('0x3'));var config=require('../../../../config/environment');var logger=require(_0x1129('0x4'))(_0x1129('0x5'));config['redis']=_['defaults'](config['redis'],{'host':_0x1129('0x6'),'port':0x18eb});var io=require(_0x1129('0x7'))(new Redis(config[_0x1129('0x8')]));function emit(_0x22a735,_0x2b9ad0,_0x2e5ba1){io['to'](_0x22a735)['emit'](_0x2b9ad0,_0x2e5ba1);}var headers={'Content-Type':_0x1129('0x9'),'Accept':'application/json'};function getTicket(_0x1e537c,_0x1d324e,_0x40b7be,_0x515850,_0xc52e7f){logger[_0x1129('0xa')](_0x1129('0xb'));return request({'uri':util[_0x1129('0xc')]('%s/tickets.json',_0x1e537c['remoteUri']),'method':_0x1129('0xd'),'body':{'ticket':_['merge']({'requester_id':_0x40b7be['id'],'submitter_id':_0x1d324e?_0x1d324e['id']:undefined,'assignee_id':_0x1d324e?_0x1d324e['id']:undefined,'tags':getTags(_0x515850[_0x1129('0xe')],_0x1129('0xf')),'subject':intUtil[_0x1129('0x10')](_0x515850[_0x1129('0x11')],_0xc52e7f,'\x20'),'description':intUtil['getString'](_0x515850[_0x1129('0x12')],_0xc52e7f,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x515850['Descriptions'],_0xc52e7f,'\x0a')}},getCustomFields(_0x515850[_0x1129('0x13')],_0xc52e7f))}})[_0x1129('0x14')](function(_0x147545){logger[_0x1129('0xa')]('Ticket\x20created!');return _0x147545[_0x1129('0x15')];});}function getUser(_0x305e5d,_0x483156){if(intUtil[_0x1129('0x16')](_0x483156)){logger[_0x1129('0xa')](_0x1129('0x17'),_0x483156);return request({'uri':util[_0x1129('0xc')](_0x1129('0x18'),_0x305e5d[_0x1129('0x19')]),'qs':{'query':util[_0x1129('0xc')](_0x1129('0x1a'),_0x483156)}})[_0x1129('0x14')](function(_0x54cac5){if(_0x54cac5['count']){logger[_0x1129('0xa')]('Agent\x20found!');return _[_0x1129('0x1b')](_0x54cac5[_0x1129('0x1c')],{'email':_0x483156,'role':_0x1129('0x1d')});}else{logger[_0x1129('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1129('0xc')]('%s/users/me.json',_0x305e5d[_0x1129('0x19')])})[_0x1129('0x14')](function(_0x311aa6){logger[_0x1129('0xa')](_0x1129('0x1e'));return _0x311aa6[_0x1129('0x1f')];});}});}else{logger['info'](_0x1129('0x20'));return request({'uri':util[_0x1129('0xc')]('%s/users/me.json',_0x305e5d[_0x1129('0x19')])})[_0x1129('0x14')](function(_0xb4310f){logger['info'](_0x1129('0x1e'));return _0xb4310f['user'];});}}function getEndUser(_0xdaeed8,_0x59feb3,_0x24b4a0){logger[_0x1129('0xa')]('Searching\x20enduser\x20with\x20phone',_0x24b4a0);return request({'uri':util[_0x1129('0xc')](_0x1129('0x18'),_0xdaeed8[_0x1129('0x19')]),'qs':{'query':util['format'](_0x1129('0x21'),_0x24b4a0)}})[_0x1129('0x14')](function(_0xed0d87){var _0x2591f7;if(_0xed0d87[_0x1129('0x1c')][_0x1129('0x22')]){_0xed0d87['results']=_[_0x1129('0x23')](_0xed0d87[_0x1129('0x1c')],{'suspended':![],'role':_0x1129('0x24')});if(_0xed0d87[_0x1129('0x1c')][_0x1129('0x22')]){_0x2591f7=_[_0x1129('0x25')](_0xed0d87[_0x1129('0x1c')]);}}if(_0x2591f7){logger[_0x1129('0xa')](_0x1129('0x26'));return _0x2591f7;}else{logger[_0x1129('0xa')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x1129('0x27'),_0xdaeed8['remoteUri']),'method':_0x1129('0xd'),'body':{'user':{'role':_0x1129('0x24'),'name':util[_0x1129('0xc')](_0x1129('0x28'),_0x59feb3||_0x24b4a0),'phone':_0x24b4a0}}})[_0x1129('0x14')](function(_0x41a85e){logger['info']('Enduser\x20created.');return _0x41a85e['user'];});}});}function getAuth(_0x3ced59){var _0x551f7f;if(_0x3ced59['authType']===_0x1129('0x29')){_0x551f7f=util[_0x1129('0xc')](_0x1129('0x2a'),_0x3ced59[_0x1129('0x2b')],_0x3ced59[_0x1129('0x29')]);}else if(_0x3ced59[_0x1129('0x2c')]===_0x1129('0x2d')){_0x551f7f=util[_0x1129('0xc')](_0x1129('0x2e'),_0x3ced59[_0x1129('0x2b')],_0x3ced59['token']);}return util[_0x1129('0xc')](_0x1129('0x2f'),new Buffer(_0x551f7f)[_0x1129('0x30')](_0x1129('0x31')));}function request(_0x4a3823){logger[_0x1129('0x32')](_0x1129('0x33'),JSON['stringify'](_0x4a3823));return rp(_[_0x1129('0x34')](_0x4a3823,{'method':_0x1129('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x149b3d,_0x23b7b6){var _0x14eb07=[];if(_0x149b3d&&_0x149b3d[_0x1129('0x22')]>0x0){_0x14eb07=_['map'](_0x149b3d,_0x23b7b6);}return _0x14eb07;}function getCustomFields(_0x518730,_0x48e68f){var _0xa2b35e=[];var _0x40a1de={'custom_fields':[]};if(_0x518730['length']>0x0){_[_0x1129('0x36')](_0x518730,function(_0x30e005){if(_0x30e005[_0x1129('0x37')]===_0x1129('0x38')&&_0x30e005['nameField']&&!_0x30e005['customField']){_0x40a1de[_0x30e005[_0x1129('0x39')]['toLowerCase']()]=_0x30e005[_0x1129('0x3a')][_0x1129('0x30')]();}else if(_0x30e005[_0x1129('0x37')]===_0x1129('0x38')&&_0x30e005[_0x1129('0x3b')]&&_0x30e005[_0x1129('0x3c')]){_0x40a1de['custom_fields'][_0x1129('0x3d')]({'id':_0x30e005['idField'],'value':_0x30e005['content'][_0x1129('0x30')]()});}else if(_0x30e005[_0x1129('0x37')]===_0x1129('0x3e')&&_0x30e005[_0x1129('0x3f')]&&_0x30e005[_0x1129('0x3b')]&&_0x30e005[_0x1129('0x3c')]){_0x48e68f[_0x30e005[_0x1129('0x3f')]]&&_0x40a1de[_0x1129('0x40')]['push']({'id':_0x30e005['idField'],'value':_0x48e68f[_0x30e005[_0x1129('0x3f')]][_0x1129('0x30')]()});}else if(_0x30e005[_0x1129('0x37')]===_0x1129('0x41')&&_0x30e005[_0x1129('0x42')]&&_0x30e005[_0x1129('0x42')]['name']&&_0x30e005[_0x1129('0x3b')]&&_0x30e005[_0x1129('0x3c')]){_0x48e68f[_0x30e005['Variable']['name'][_0x1129('0x43')]()]&&_0x40a1de[_0x1129('0x40')][_0x1129('0x3d')]({'id':_0x30e005['idField'],'value':_0x48e68f[_0x30e005['Variable'][_0x1129('0xf')][_0x1129('0x43')]()][_0x1129('0x30')]()});}});}return _0x40a1de;}exports[_0x1129('0x44')]=function(_0x34cd83,_0x239fce,_0x87f4f2,_0x36710c,_0x2aa73a,_0x12a604){var _0x39d93a,_0x4dec0f;_0x12a604[_0x1129('0x19')]=intUtil[_0x1129('0x45')](_0x12a604[_0x1129('0x19')]);_0x12a604['serverUrl']=intUtil[_0x1129('0x45')](_0x12a604['serverUrl']);if(_0x2aa73a&&_0x2aa73a[_0x1129('0x46')]){logger[_0x1129('0xa')](_0x1129('0x47'),'Recording\x20is\x20enabled!');_0x239fce['recordingURL']=util[_0x1129('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x12a604[_0x1129('0x48')],_0x239fce['uniqueid'],md5(_0x239fce[_0x1129('0x49')]));}else{_0x239fce[_0x1129('0x4a')]='';}headers[_0x1129('0x4b')]=getAuth(_0x12a604);return getUser(_0x12a604,_0x36710c[_0x1129('0x4c')])[_0x1129('0x14')](function(_0x6d3ac6){_0x39d93a=_0x6d3ac6;logger[_0x1129('0xa')](_0x1129('0x4d'),_0x39d93a['id']);return getEndUser(_0x12a604,_0x239fce[_0x1129('0x4e')],_0x239fce['calleridnum']);})[_0x1129('0x14')](function(_0x5e8236){_0x4dec0f=_0x5e8236;logger['info'](_0x1129('0x4f'),_0x4dec0f['id']);return getTicket(_0x12a604,_0x39d93a,_0x4dec0f,_0x87f4f2,_0x239fce);})[_0x1129('0x14')](function(_0x202480){if(_0x202480){logger[_0x1129('0xa')](_0x1129('0x50'),_0x202480['id']);switch(_0x12a604[_0x1129('0x37')]){case _0x1129('0x51'):logger[_0x1129('0xa')](_0x1129('0x47'),_0x1129('0x52'));return request({'uri':util[_0x1129('0xc')](_0x1129('0x53'),_0x12a604[_0x1129('0x19')],_0x39d93a['id'],_0x202480['id']),'method':'POST'});case _0x1129('0x54'):logger[_0x1129('0xa')](_0x1129('0x47'),_0x1129('0x55'));emit(util['format'](_0x1129('0x56'),_0x36710c[_0x1129('0xf')]),_0x1129('0x57'),{'uri':util['format'](_0x1129('0x58'),_0x12a604[_0x1129('0x19')],_0x202480['id'])});break;default:logger['error']('[QUEUE]',_0x1129('0x59'));}}})[_0x1129('0x5a')](function(_0x2ae69f){logger[_0x1129('0x5b')](_0x1129('0x5c'),util[_0x1129('0x5d')](_0x2ae69f,{'showHidden':!![],'depth':null}));});};exports[_0x1129('0x5e')]=function(_0x913cae,_0x28ee20,_0x32facc,_0x150509,_0x3689a7,_0x1a6bbb,_0x27016a){var _0x21fca4,_0x4097a1;_0x1a6bbb[_0x1129('0x19')]=intUtil['stripTrailingSlash'](_0x1a6bbb['remoteUri']);_0x1a6bbb['serverUrl']=intUtil['stripTrailingSlash'](_0x1a6bbb[_0x1129('0x48')]);if(_0x27016a&&_0x27016a['recordingFormat']&&_0x27016a[_0x1129('0x5f')]!=='none'){logger[_0x1129('0xa')](_0x1129('0x60'),'Recording\x20is\x20enabled!');_0x28ee20['recordingURL']=util[_0x1129('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1a6bbb[_0x1129('0x48')],_0x28ee20['uniqueid'],md5(_0x28ee20[_0x1129('0x49')]));}headers['Authorization']=getAuth(_0x1a6bbb);return getUser(_0x1a6bbb,_0x150509[_0x1129('0x4c')])[_0x1129('0x14')](function(_0x19abce){_0x21fca4=_0x19abce;logger[_0x1129('0xa')](_0x1129('0x4d'),_0x21fca4['id']);return getEndUser(_0x1a6bbb,_0x28ee20['destcalleridname'],_0x28ee20[_0x1129('0x61')]);})[_0x1129('0x14')](function(_0x4c0f50){_0x4097a1=_0x4c0f50;logger['info'](_0x1129('0x4f'),_0x4097a1['id']);return getTicket(_0x1a6bbb,_0x21fca4,_0x4097a1,_0x32facc,_0x28ee20);})['then'](function(_0x5d48ac){if(_0x5d48ac){logger[_0x1129('0xa')](_0x1129('0x50'),_0x5d48ac['id']);switch(_0x1a6bbb[_0x1129('0x37')]){case'integrationTab':logger[_0x1129('0xa')](_0x1129('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x1129('0x53'),_0x1a6bbb[_0x1129('0x19')],_0x21fca4['id'],_0x5d48ac['id']),'method':'POST'});case'newTab':logger[_0x1129('0xa')](_0x1129('0x60'),_0x1129('0x55'));emit(util[_0x1129('0xc')](_0x1129('0x56'),_0x150509['name']),_0x1129('0x57'),{'uri':util[_0x1129('0xc')]('%s/agent/tickets/%s',_0x1a6bbb[_0x1129('0x19')],_0x5d48ac['id'])});break;default:logger[_0x1129('0x5b')](_0x1129('0x60'),_0x1129('0x59'));}}})['catch'](function(_0x315f6d){logger[_0x1129('0x5b')](_0x1129('0x62'),util[_0x1129('0x5d')](_0x315f6d,{'showHidden':!![],'depth':null}));});};exports[_0x1129('0x63')]=function(_0x68e7bc,_0x40f33a,_0x53ce33,_0x894ffb,_0xf900d2,_0x2adbe2){var _0x2c8d19,_0xcff002;_0x2adbe2['remoteUri']=intUtil[_0x1129('0x45')](_0x2adbe2[_0x1129('0x19')]);_0x2adbe2[_0x1129('0x48')]=intUtil[_0x1129('0x45')](_0x2adbe2[_0x1129('0x48')]);if(_0xf900d2&&_0xf900d2[_0x1129('0x46')]){logger[_0x1129('0xa')](_0x1129('0x64'),_0x1129('0x65'));_0x40f33a[_0x1129('0x4a')]=util['format'](_0x1129('0x66'),_0x2adbe2[_0x1129('0x48')],_0x40f33a[_0x1129('0x49')],md5(_0x40f33a[_0x1129('0x49')]));}else{_0x40f33a[_0x1129('0x4a')]='';}headers[_0x1129('0x4b')]=getAuth(_0x2adbe2);return getUser(_0x2adbe2)[_0x1129('0x14')](function(_0x1fcf7d){_0x2c8d19=_0x1fcf7d;logger['info']('The\x20User\x20ID\x20is:',_0x2c8d19['id']);return getEndUser(_0x2adbe2,_0x40f33a['calleridname'],_0x40f33a[_0x1129('0x67')]);})[_0x1129('0x14')](function(_0x40d565){_0xcff002=_0x40d565;logger[_0x1129('0xa')](_0x1129('0x4f'),_0xcff002['id']);return getTicket(_0x2adbe2,_0x2c8d19,_0xcff002,_0x53ce33,_0x40f33a);})[_0x1129('0x14')](function(_0x11875a){if(_0x11875a){logger['info'](_0x1129('0x50'),_0x11875a['id']);}})['catch'](function(_0x256a4b){logger[_0x1129('0x5b')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0x1129('0x5d')](_0x256a4b,{'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 bb0df01..8b8d365 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 _0x237f=['agentcalledAt','format','YYYY-MM-DD\x20HH:mm:ss','getString','Descriptions','lastevent','called','Call\x20Result','complete','Rejected','abandoned','Abandoned','Call\x20Duration','mm:ss','answertime','utc','endtime','diff','CONTACTID','SEMODULE','Leads','SEID','LEADID','hasOwnProperty','%s','encodeXML','https://crm.%s/crm/private/xml/Calls/insertRecords','host','authToken','crmapi','toJson','result','recorddetail','Call\x20created!','stringify','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','users','user','log','zoho\x20data\x20users','isNil','find','Using\x20the\x20admin\x20account!','Administrator','profile','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','https://crm.%s/crm/private/json/Contacts/searchRecords','then','response','row','Contacts','val','content','GET','https://crm.%s/crm/private/json/Leads/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Leads!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','%s%s%s','parse','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20creation:\x20','length','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','catch','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','[ABANDONED]','calleridname','lodash','request-promise','md5','util','./util','xml2json','entities','moment','ioredis','../../../../config/logger','zoho','redis','socket.io-emitter','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','starttime'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0x237f,0x6e));var _0xf237=function(_0x557741,_0x43d009){_0x557741=_0x557741-0x0;var _0x4cd544=_0x237f[_0x557741];return _0x4cd544;};'use strict';var _=require(_0xf237('0x0'));var rp=require(_0xf237('0x1'));var md5=require(_0xf237('0x2'));var util=require(_0xf237('0x3'));var intUtil=require(_0xf237('0x4'));var parser=require(_0xf237('0x5'));var entities=require(_0xf237('0x6'));var moment=require(_0xf237('0x7'));var Redis=require(_0xf237('0x8'));var config=require('../../../../config/environment');var logger=require(_0xf237('0x9'))(_0xf237('0xa'));config[_0xf237('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf237('0xc'))(new Redis(config['redis']));function emit(_0x4bf169,_0x574dd6,_0xc8e167){io['to'](_0x4bf169)[_0xf237('0xd')](_0x574dd6,_0xc8e167);}var headers={'Content-Type':_0xf237('0xe'),'Accept':_0xf237('0xe')};function getCall(_0x3ec050,_0x1ca3d5,_0x258b14,_0x29c517,_0x116be1,_0x426e66){logger[_0xf237('0xf')](_0xf237('0x10'));var _0x1957fe=_[_0xf237('0x11')]({'SMOWNERID':_0x1ca3d5['id'],'Call Type':_0x426e66||_0xf237('0x12'),'Call Start Time':(_0x426e66==='outbound'?_0x116be1[_0xf237('0x13')]:_0x116be1[_0xf237('0x14')])||moment()[_0xf237('0x15')](_0xf237('0x16')),'Subject':intUtil['getString'](_0x29c517['Subjects'],_0x116be1,'\x20'),'Description':intUtil[_0xf237('0x17')](_0x29c517[_0xf237('0x18')],_0x116be1,'\x0a')},getCustomFields(_0x29c517['Fields'],_0x116be1));switch(_0x116be1[_0xf237('0x19')]){case _0xf237('0x1a'):_0x1957fe[_0xf237('0x1b')]='Called';break;case _0xf237('0x1c'):case'connect':_0x1957fe[_0xf237('0x1b')]='Answered';break;case'rejected':_0x1957fe[_0xf237('0x1b')]=_0xf237('0x1d');break;case _0xf237('0x1e'):_0x1957fe[_0xf237('0x1b')]=_0xf237('0x1f');break;default:}if(_0x116be1['talktime']){_0x1957fe[_0xf237('0x20')]=moment['utc'](parseInt(_0x116be1['talktime'])*0x3e8)[_0xf237('0x15')](_0xf237('0x21'));}else if(_0x116be1[_0xf237('0x22')]&&_0x116be1['endtime']){_0x1957fe['Call\x20Duration']=moment[_0xf237('0x23')](moment(_0x116be1[_0xf237('0x24')],_0xf237('0x16'))[_0xf237('0x25')](moment(_0x116be1[_0xf237('0x13')],_0xf237('0x16'))))[_0xf237('0x15')]('mm:ss');}if(_0x258b14[_0xf237('0x26')]){_0x1957fe[_0xf237('0x26')]=_0x258b14[_0xf237('0x26')];}else if(_0x258b14['LEADID']){_0x1957fe[_0xf237('0x27')]=_0xf237('0x28');_0x1957fe[_0xf237('0x29')]=_0x258b14[_0xf237('0x2a')];}var _0x4c0f86='';for(var _0x115afa in _0x1957fe){if(_0x1957fe[_0xf237('0x2b')](_0x115afa)){_0x4c0f86+=util[_0xf237('0x15')](_0xf237('0x2c'),entities[_0xf237('0x2d')](_0x115afa),entities[_0xf237('0x2d')](_0x1957fe[_0x115afa]));}}_0x4c0f86+='';return request({'method':'POST','uri':util['format'](_0xf237('0x2e'),_0x3ec050[_0xf237('0x2f')]),'qs':{'authtoken':_0x3ec050[_0xf237('0x30')],'scope':_0xf237('0x31'),'xmlData':_0x4c0f86},'json':!![]})['then'](function(_0x3b149d){_0x3b149d=JSON['parse'](parser[_0xf237('0x32')](_0x3b149d));if(_0x3b149d['response']){if(_0x3b149d['response'][_0xf237('0x33')]&&_0x3b149d['response'][_0xf237('0x33')][_0xf237('0x34')]){logger[_0xf237('0xf')](_0xf237('0x35'));return{'id':_0x3b149d['response'][_0xf237('0x33')]['recorddetail']['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON[_0xf237('0x36')](_0x3b149d));});}function getUser(_0x2b0c3f,_0x53e7be){return request({'method':'GET','uri':util[_0xf237('0x15')](_0xf237('0x37'),_0x2b0c3f[_0xf237('0x2f')]),'qs':{'type':_0xf237('0x38'),'authtoken':_0x2b0c3f[_0xf237('0x30')],'scope':_0xf237('0x31')},'json':!![]})['then'](function(_0x5243d7){if(_0x5243d7['users']&&_0x5243d7[_0xf237('0x39')][_0xf237('0x3a')]){var _0xe63be8;console[_0xf237('0x3b')](_0xf237('0x3c'),_0x5243d7[_0xf237('0x39')][_0xf237('0x3a')]);if(_['isArrayLikeObject'](_0x5243d7[_0xf237('0x39')][_0xf237('0x3a')])){console[_0xf237('0x3b')](_0xf237('0x3c'),_0x5243d7[_0xf237('0x39')][_0xf237('0x3a')]);if(!_[_0xf237('0x3d')](_0x53e7be)){_0xe63be8=_[_0xf237('0x3e')](_0x5243d7[_0xf237('0x39')][_0xf237('0x3a')],{'email':_0x53e7be,'profile':'Standard','status':'active'});}if(!_['isNil'](_0xe63be8)){logger[_0xf237('0xf')]('Agent\x20found!');}else{logger[_0xf237('0xf')](_0xf237('0x3f'));_0xe63be8=_[_0xf237('0x3e')](_0x5243d7[_0xf237('0x39')]['user'],{'profile':_0xf237('0x40')});}console[_0xf237('0x3b')]('zoho\x20user',_0xe63be8);return _0xe63be8;}else{if(_0x5243d7[_0xf237('0x39')][_0xf237('0x3a')][_0xf237('0x41')]==='Administrator'){logger[_0xf237('0xf')]('Using\x20the\x20admin\x20account!');_0xe63be8=_0x5243d7[_0xf237('0x39')][_0xf237('0x3a')];return _0xe63be8;}else{logger[_0xf237('0x42')]('The\x20failing\x20result\x20is',JSON[_0xf237('0x36')](_0x5243d7));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xf237('0x36')](_0x5243d7));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xf237('0x36')](_0x5243d7));throw new Error(_0xf237('0x43')+JSON[_0xf237('0x36')](_0x5243d7));}});}function getEndUser(_0x4c5558,_0x2b375d,_0x25e3c1){logger[_0xf237('0xf')]('Searching\x20enduser\x20with\x20phone',_0x25e3c1);return request({'method':'GET','uri':util[_0xf237('0x15')](_0xf237('0x44'),_0x4c5558[_0xf237('0x2f')]),'qs':{'authtoken':_0x4c5558[_0xf237('0x30')],'scope':'crmapi','criteria':util[_0xf237('0x15')]('((Phone:%s))',_0x25e3c1)},'json':!![]})[_0xf237('0x45')](function(_0x15976a){if(_0x15976a[_0xf237('0x46')]&&_0x15976a['response']['result']){logger['info']('Enduser\x20found\x20in\x20Contacts!');var _0x51a395={};var _0x5de97c=_0x15976a['response']['result']['Contacts'][_0xf237('0x47')]['no']?_0x15976a[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x48')][_0xf237('0x47')]['FL']:_0x15976a[_0xf237('0x46')]['result'][_0xf237('0x48')][_0xf237('0x47')][0x0]['FL'];for(var _0x33ec4d=0x0,_0x52851b=_0x5de97c['length'];_0x33ec4d<_0x52851b;_0x33ec4d++){_0x51a395[_0x5de97c[_0x33ec4d][_0xf237('0x49')]]=_0x5de97c[_0x33ec4d][_0xf237('0x4a')];}return _0x51a395;}else{return request({'method':_0xf237('0x4b'),'uri':util['format'](_0xf237('0x4c'),_0x4c5558[_0xf237('0x2f')]),'qs':{'authtoken':_0x4c5558['authToken'],'scope':_0xf237('0x31'),'criteria':util['format'](_0xf237('0x4d'),_0x25e3c1)},'json':!![]})[_0xf237('0x45')](function(_0x45ab12){if(_0x45ab12[_0xf237('0x46')]&&_0x45ab12[_0xf237('0x46')][_0xf237('0x33')]){logger['info'](_0xf237('0x4e'));var _0x5e9ea2={};var _0x3019b9=_0x45ab12[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x28')][_0xf237('0x47')]['no']?_0x45ab12[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x28')]['row']['FL']:_0x45ab12[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x28')][_0xf237('0x47')][0x0]['FL'];for(var _0x51729c=0x0,_0x21f0ef=_0x3019b9['length'];_0x51729c<_0x21f0ef;_0x51729c++){_0x5e9ea2[_0x3019b9[_0x51729c][_0xf237('0x49')]]=_0x3019b9[_0x51729c][_0xf237('0x4a')];}return _0x5e9ea2;}else{logger[_0xf237('0xf')](_0xf237('0x4f'));_0x2b375d=getName(_0x2b375d);return request({'method':_0xf237('0x50'),'uri':util[_0xf237('0x15')]('https://crm.%s/crm/private/xml/Leads/insertRecords',_0x4c5558['host']),'qs':{'authtoken':_0x4c5558[_0xf237('0x30')],'scope':_0xf237('0x31'),'xmlData':util['format'](_0xf237('0x51'),entities[_0xf237('0x2d')](_0x2b375d[0x0]),entities[_0xf237('0x2d')](_0x2b375d[0x1]),_0x25e3c1)},'json':!![]})[_0xf237('0x45')](function(_0xa26bf6){_0xa26bf6=JSON[_0xf237('0x52')](parser['toJson'](_0xa26bf6));if(_0xa26bf6['response']){if(_0xa26bf6[_0xf237('0x46')][_0xf237('0x33')]&&_0xa26bf6[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x34')]){logger[_0xf237('0xf')](_0xf237('0x53'));return request({'method':'GET','uri':util[_0xf237('0x15')](_0xf237('0x54'),_0x4c5558['host']),'qs':{'authtoken':_0x4c5558[_0xf237('0x30')],'scope':'crmapi','id':_0xa26bf6[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x34')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error(_0xf237('0x55')+JSON[_0xf237('0x36')](_0xa26bf6));})[_0xf237('0x45')](function(_0x36162b){if(_0x36162b[_0xf237('0x46')]){if(_0x36162b[_0xf237('0x46')][_0xf237('0x33')]){var _0x266e95={};for(var _0x2fe3b3=0x0,_0x1211df=_0x36162b[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x28')]['row']['FL'][_0xf237('0x56')];_0x2fe3b3<_0x1211df;_0x2fe3b3++){_0x266e95[_0x36162b[_0xf237('0x46')][_0xf237('0x33')][_0xf237('0x28')]['row']['FL'][_0x2fe3b3][_0xf237('0x49')]]=_0x36162b[_0xf237('0x46')]['result']['Leads']['row']['FL'][_0x2fe3b3][_0xf237('0x4a')];}return _0x266e95;}}throw new Error(_0xf237('0x57')+JSON[_0xf237('0x36')](_0x36162b));});}});}});}function request(_0x2ca24f){logger[_0xf237('0x58')](_0xf237('0x59'),JSON['stringify'](_0x2ca24f));return rp(_0x2ca24f);}function getCustomFields(_0x38a624,_0x5bb1fa){var _0x3323b9={};if(_0x38a624['length']>0x0){_[_0xf237('0x5a')](_0x38a624,function(_0x227aa4){if(_0x227aa4[_0xf237('0x5b')]===_0xf237('0x5c')&&_0x227aa4[_0xf237('0x5d')]){_0x3323b9[_0x227aa4[_0xf237('0x5d')]]=_0x227aa4['content'][_0xf237('0x5e')]();}else if(_0x227aa4[_0xf237('0x5b')]===_0xf237('0x5f')&&_0x227aa4[_0xf237('0x60')]&&_0x227aa4[_0xf237('0x5d')]&&_0x5bb1fa[_0x227aa4['variableName']]){_0x3323b9[_0x227aa4[_0xf237('0x5d')]]=_0x5bb1fa[_0x227aa4[_0xf237('0x60')]][_0xf237('0x5e')]();}else if(_0x227aa4['type']===_0xf237('0x61')&&_0x227aa4[_0xf237('0x62')]&&_0x227aa4[_0xf237('0x62')][_0xf237('0x63')]&&_0x227aa4['idField']&&_0x5bb1fa[_0x227aa4[_0xf237('0x62')][_0xf237('0x63')][_0xf237('0x64')]()]){_0x3323b9[_0x227aa4[_0xf237('0x5d')]]=_0x5bb1fa[_0x227aa4[_0xf237('0x62')]['name'][_0xf237('0x64')]()][_0xf237('0x5e')]();}});}return _0x3323b9;}function getName(_0x53105d){if(_0x53105d['indexOf']('\x20')>0x0){var _0x30bed5=_0x53105d[_0xf237('0x65')](/ (.+)/);if(_0x30bed5[0x1]){return _0x30bed5;}}return[_0x53105d,_0x53105d];}exports[_0xf237('0x66')]=function(_0x49ea6a,_0x49a9ab,_0x23e16d,_0x129c8e,_0x1c93be,_0x59e074){var _0xc11d2a,_0x221cfe;_0x59e074[_0xf237('0x2f')]=intUtil[_0xf237('0x67')](_0x59e074[_0xf237('0x2f')]);_0x59e074[_0xf237('0x68')]=intUtil[_0xf237('0x67')](_0x59e074[_0xf237('0x68')]);if(_0x1c93be&&_0x1c93be[_0xf237('0x69')]){logger[_0xf237('0xf')]('[QUEUE]',_0xf237('0x6a'));_0x49a9ab[_0xf237('0x6b')]=util['format'](_0xf237('0x6c'),_0x59e074['serverUrl'],_0x49a9ab[_0xf237('0x6d')],md5(_0x49a9ab[_0xf237('0x6d')]));}else{_0x49a9ab[_0xf237('0x6b')]='';}return getUser(_0x59e074,_0x129c8e[_0xf237('0x6e')])['then'](function(_0x1670ad){_0xc11d2a=_0x1670ad;logger[_0xf237('0xf')](_0xf237('0x6f'),_0xc11d2a['id']);return getEndUser(_0x59e074,_0x49a9ab['calleridname'],_0x49a9ab[_0xf237('0x70')]);})[_0xf237('0x45')](function(_0x40745b){_0x221cfe=_0x40745b;logger[_0xf237('0xf')](_0xf237('0x71'),_0x221cfe[_0xf237('0x26')]||_0x221cfe[_0xf237('0x2a')]);return getCall(_0x59e074,_0xc11d2a,_0x221cfe,_0x23e16d,_0x49a9ab,_0xf237('0x72'));})[_0xf237('0x45')](function(_0x2d0e02){if(_0x2d0e02){logger[_0xf237('0xf')]('The\x20Call\x20ID\x20is:',_0x2d0e02['id']);logger['info'](_0xf237('0x73'),_0xf237('0x74'));emit(util[_0xf237('0x15')](_0xf237('0x75'),_0x129c8e['name']),_0xf237('0x76'),{'uri':util[_0xf237('0x15')](_0xf237('0x77'),_0x59e074[_0xf237('0x2f')],_0x2d0e02['id'])});}})[_0xf237('0x78')](function(_0x37a8d9){logger[_0xf237('0x42')](_0xf237('0x73'),JSON[_0xf237('0x36')](_0x37a8d9));});};exports[_0xf237('0x79')]=function(_0x2197ab,_0x3ad673,_0x47222c,_0x5a9a20,_0x10f0c7,_0x3bdc06,_0x5244a5){var _0x119c88,_0x12e164;_0x3bdc06[_0xf237('0x2f')]=intUtil['stripTrailingSlash'](_0x3bdc06[_0xf237('0x2f')]);_0x3bdc06[_0xf237('0x68')]=intUtil['stripTrailingSlash'](_0x3bdc06[_0xf237('0x68')]);if(_0x5244a5&&_0x5244a5[_0xf237('0x7a')]&&_0x5244a5[_0xf237('0x7a')]!=='none'){logger[_0xf237('0xf')](_0xf237('0x7b'),'Recording\x20is\x20enabled!');_0x3ad673[_0xf237('0x6b')]=util[_0xf237('0x15')](_0xf237('0x6c'),_0x3bdc06[_0xf237('0x68')],_0x3ad673[_0xf237('0x6d')],md5(_0x3ad673[_0xf237('0x6d')]));}return getUser(_0x3bdc06,_0x5a9a20[_0xf237('0x6e')])[_0xf237('0x45')](function(_0x3558e8){_0x119c88=_0x3558e8;logger[_0xf237('0xf')](_0xf237('0x6f'),_0x119c88['id']);return getEndUser(_0x3bdc06,_0x3ad673[_0xf237('0x7c')],_0x3ad673[_0xf237('0x7d')]);})[_0xf237('0x45')](function(_0x9557be){_0x12e164=_0x9557be;logger[_0xf237('0xf')](_0xf237('0x71'),_0x12e164[_0xf237('0x26')]||_0x12e164['LEADID']);return getCall(_0x3bdc06,_0x119c88,_0x12e164,_0x47222c,_0x3ad673,_0xf237('0x7e'));})[_0xf237('0x45')](function(_0x17601a){if(_0x17601a){logger['info'](_0xf237('0x7f'),_0x17601a['id']);logger[_0xf237('0xf')](_0xf237('0x7b'),_0xf237('0x74'));emit(util[_0xf237('0x15')](_0xf237('0x75'),_0x5a9a20[_0xf237('0x63')]),'trigger:browser:url',{'uri':util[_0xf237('0x15')](_0xf237('0x77'),_0x3bdc06[_0xf237('0x2f')],_0x17601a['id'])});}})[_0xf237('0x78')](function(_0x4b91ac){logger[_0xf237('0x42')](_0xf237('0x7b'),JSON['stringify'](_0x4b91ac));});};exports['abandoned']=function(_0x22c9d9,_0x29e4c8,_0x418548,_0x1ad2b8,_0x597ffc,_0x25f83f){var _0x4eaa2a,_0x3dbea7;_0x25f83f[_0xf237('0x2f')]=intUtil['stripTrailingSlash'](_0x25f83f[_0xf237('0x2f')]);_0x25f83f[_0xf237('0x68')]=intUtil['stripTrailingSlash'](_0x25f83f[_0xf237('0x68')]);if(_0x597ffc&&_0x597ffc[_0xf237('0x69')]){logger[_0xf237('0xf')](_0xf237('0x80'),_0xf237('0x6a'));_0x29e4c8[_0xf237('0x6b')]=util[_0xf237('0x15')](_0xf237('0x6c'),_0x25f83f[_0xf237('0x68')],_0x29e4c8[_0xf237('0x6d')],md5(_0x29e4c8['uniqueid']));}else{_0x29e4c8['recordingURL']='';}return getUser(_0x25f83f)[_0xf237('0x45')](function(_0x37a6c3){_0x4eaa2a=_0x37a6c3;logger['info'](_0xf237('0x6f'),_0x4eaa2a['id']);return getEndUser(_0x25f83f,_0x29e4c8[_0xf237('0x81')],_0x29e4c8[_0xf237('0x70')]);})[_0xf237('0x45')](function(_0x7b0969){_0x3dbea7=_0x7b0969;logger[_0xf237('0xf')](_0xf237('0x71'),_0x3dbea7[_0xf237('0x26')]||_0x3dbea7[_0xf237('0x2a')]);return getCall(_0x25f83f,_0x4eaa2a,_0x3dbea7,_0x418548,_0x29e4c8,'Inbound');})[_0xf237('0x45')](function(_0x2d5475){if(_0x2d5475){logger[_0xf237('0xf')](_0xf237('0x7f'),_0x2d5475['id']);}})[_0xf237('0x78')](function(_0x1c4993){logger[_0xf237('0x42')](_0xf237('0x80'),JSON[_0xf237('0x36')](_0x1c4993));});}; \ No newline at end of file +var _0xfe6d=['user','isNil','find','Standard','active','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Searching\x20enduser\x20with\x20phone','https://crm.%s/crm/private/json/Contacts/searchRecords','((Phone:%s))','Enduser\x20found\x20in\x20Contacts!','Contacts','row','length','val','content','GET','https://crm.%s/crm/private/json/Leads/searchRecords','Enduser\x20found\x20in\x20Leads!','Leads','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','https://crm.%s/crm/private/xml/Leads/insertRecords','%s%s%s','Enduser\x20created.','https://crm.%s/crm/private/json/Leads/getRecordById','Error\x20on\x20Lead\x20retrieve:\x20','debug','[HTTP]','forEach','type','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','queue','serverUrl','monitor_format','[QUEUE]','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.%s/crm/EntityInfo.do?module=Calls&id=%s','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridnum','Outbound','catch','[ABANDONED]','request-promise','md5','./util','xml2json','entities','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','emit','application/json','info','Creating\x20new\x20call...','merge','inbound','outbound','getString','Subjects','Descriptions','Fields','called','Called','complete','Call\x20Result','Answered','Rejected','abandoned','talktime','Call\x20Duration','utc','format','mm:ss','endtime','YYYY-MM-DD\x20HH:mm:ss','diff','starttime','CONTACTID','SEID','LEADID','','hasOwnProperty','encodeXML','POST','host','authToken','crmapi','then','parse','toJson','response','result','recorddetail','Call\x20created!','https://crm.%s/crm/private/json/Users/getUsers','AllUsers','log','users','isArrayLikeObject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe6d,0x1de));var _0xdfe6=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0xfe6d[_0x166742];return _0xb7814a;};'use strict';var _=require('lodash');var rp=require(_0xdfe6('0x0'));var md5=require(_0xdfe6('0x1'));var util=require('util');var intUtil=require(_0xdfe6('0x2'));var parser=require(_0xdfe6('0x3'));var entities=require(_0xdfe6('0x4'));var moment=require(_0xdfe6('0x5'));var Redis=require(_0xdfe6('0x6'));var config=require(_0xdfe6('0x7'));var logger=require(_0xdfe6('0x8'))(_0xdfe6('0x9'));config['redis']=_[_0xdfe6('0xa')](config[_0xdfe6('0xb')],{'host':_0xdfe6('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4980e5,_0x37dc02,_0x19b334){io['to'](_0x4980e5)[_0xdfe6('0xd')](_0x37dc02,_0x19b334);}var headers={'Content-Type':_0xdfe6('0xe'),'Accept':_0xdfe6('0xe')};function getCall(_0x5b065c,_0x18b4c6,_0x50edb1,_0x3b04b6,_0x3f9b02,_0x62ab50){logger[_0xdfe6('0xf')](_0xdfe6('0x10'));var _0x1777a1=_[_0xdfe6('0x11')]({'SMOWNERID':_0x18b4c6['id'],'Call Type':_0x62ab50||_0xdfe6('0x12'),'Call Start Time':(_0x62ab50===_0xdfe6('0x13')?_0x3f9b02['starttime']:_0x3f9b02['agentcalledAt'])||moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'Subject':intUtil[_0xdfe6('0x14')](_0x3b04b6[_0xdfe6('0x15')],_0x3f9b02,'\x20'),'Description':intUtil[_0xdfe6('0x14')](_0x3b04b6[_0xdfe6('0x16')],_0x3f9b02,'\x0a')},getCustomFields(_0x3b04b6[_0xdfe6('0x17')],_0x3f9b02));switch(_0x3f9b02['lastevent']){case _0xdfe6('0x18'):_0x1777a1['Call\x20Result']=_0xdfe6('0x19');break;case _0xdfe6('0x1a'):case'connect':_0x1777a1[_0xdfe6('0x1b')]=_0xdfe6('0x1c');break;case'rejected':_0x1777a1['Call\x20Result']=_0xdfe6('0x1d');break;case _0xdfe6('0x1e'):_0x1777a1[_0xdfe6('0x1b')]='Abandoned';break;default:}if(_0x3f9b02[_0xdfe6('0x1f')]){_0x1777a1[_0xdfe6('0x20')]=moment[_0xdfe6('0x21')](parseInt(_0x3f9b02[_0xdfe6('0x1f')])*0x3e8)[_0xdfe6('0x22')](_0xdfe6('0x23'));}else if(_0x3f9b02['answertime']&&_0x3f9b02['endtime']){_0x1777a1[_0xdfe6('0x20')]=moment[_0xdfe6('0x21')](moment(_0x3f9b02[_0xdfe6('0x24')],_0xdfe6('0x25'))[_0xdfe6('0x26')](moment(_0x3f9b02[_0xdfe6('0x27')],'YYYY-MM-DD\x20HH:mm:ss')))[_0xdfe6('0x22')](_0xdfe6('0x23'));}if(_0x50edb1[_0xdfe6('0x28')]){_0x1777a1[_0xdfe6('0x28')]=_0x50edb1['CONTACTID'];}else if(_0x50edb1['LEADID']){_0x1777a1['SEMODULE']='Leads';_0x1777a1[_0xdfe6('0x29')]=_0x50edb1[_0xdfe6('0x2a')];}var _0x185341=_0xdfe6('0x2b');for(var _0x3909e2 in _0x1777a1){if(_0x1777a1[_0xdfe6('0x2c')](_0x3909e2)){_0x185341+=util[_0xdfe6('0x22')]('%s',entities[_0xdfe6('0x2d')](_0x3909e2),entities[_0xdfe6('0x2d')](_0x1777a1[_0x3909e2]));}}_0x185341+='';return request({'method':_0xdfe6('0x2e'),'uri':util['format']('https://crm.%s/crm/private/xml/Calls/insertRecords',_0x5b065c[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x5b065c[_0xdfe6('0x30')],'scope':_0xdfe6('0x31'),'xmlData':_0x185341},'json':!![]})[_0xdfe6('0x32')](function(_0x35d939){_0x35d939=JSON[_0xdfe6('0x33')](parser[_0xdfe6('0x34')](_0x35d939));if(_0x35d939[_0xdfe6('0x35')]){if(_0x35d939[_0xdfe6('0x35')][_0xdfe6('0x36')]&&_0x35d939[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x37')]){logger[_0xdfe6('0xf')](_0xdfe6('0x38'));return{'id':_0x35d939[_0xdfe6('0x35')][_0xdfe6('0x36')]['recorddetail']['FL'][0x0]['$t']};}}throw new Error('Error\x20on\x20call\x20creation:\x20'+JSON['stringify'](_0x35d939));});}function getUser(_0x2c8edc,_0x25d672){return request({'method':'GET','uri':util['format'](_0xdfe6('0x39'),_0x2c8edc[_0xdfe6('0x2f')]),'qs':{'type':_0xdfe6('0x3a'),'authtoken':_0x2c8edc['authToken'],'scope':_0xdfe6('0x31')},'json':!![]})[_0xdfe6('0x32')](function(_0x5b9812){if(_0x5b9812['users']&&_0x5b9812['users']['user']){var _0x2a9913;console[_0xdfe6('0x3b')]('zoho\x20data\x20users',_0x5b9812[_0xdfe6('0x3c')]['user']);if(_[_0xdfe6('0x3d')](_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')])){console['log']('zoho\x20data\x20users',_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')]);if(!_[_0xdfe6('0x3f')](_0x25d672)){_0x2a9913=_[_0xdfe6('0x40')](_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')],{'email':_0x25d672,'profile':_0xdfe6('0x41'),'status':_0xdfe6('0x42')});}if(!_[_0xdfe6('0x3f')](_0x2a9913)){logger[_0xdfe6('0xf')](_0xdfe6('0x43'));}else{logger[_0xdfe6('0xf')](_0xdfe6('0x44'));_0x2a9913=_[_0xdfe6('0x40')](_0x5b9812[_0xdfe6('0x3c')]['user'],{'profile':_0xdfe6('0x45')});}console['log']('zoho\x20user',_0x2a9913);return _0x2a9913;}else{if(_0x5b9812['users'][_0xdfe6('0x3e')][_0xdfe6('0x46')]===_0xdfe6('0x45')){logger[_0xdfe6('0xf')](_0xdfe6('0x44'));_0x2a9913=_0x5b9812[_0xdfe6('0x3c')][_0xdfe6('0x3e')];return _0x2a9913;}else{logger[_0xdfe6('0x47')](_0xdfe6('0x48'),JSON[_0xdfe6('0x49')](_0x5b9812));throw new Error(_0xdfe6('0x4a')+JSON[_0xdfe6('0x49')](_0x5b9812));}}}else{logger[_0xdfe6('0x47')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x5b9812));throw new Error(_0xdfe6('0x4a')+JSON[_0xdfe6('0x49')](_0x5b9812));}});}function getEndUser(_0x1ae636,_0x5538b2,_0x7fa05){logger[_0xdfe6('0xf')](_0xdfe6('0x4b'),_0x7fa05);return request({'method':'GET','uri':util[_0xdfe6('0x22')](_0xdfe6('0x4c'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636['authToken'],'scope':_0xdfe6('0x31'),'criteria':util[_0xdfe6('0x22')](_0xdfe6('0x4d'),_0x7fa05)},'json':!![]})[_0xdfe6('0x32')](function(_0x381ede){if(_0x381ede['response']&&_0x381ede[_0xdfe6('0x35')][_0xdfe6('0x36')]){logger['info'](_0xdfe6('0x4e'));var _0x50ae0b={};var _0x4ca9a1=_0x381ede[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x4f')]['row']['no']?_0x381ede[_0xdfe6('0x35')]['result']['Contacts']['row']['FL']:_0x381ede[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x4f')][_0xdfe6('0x50')][0x0]['FL'];for(var _0xe1d34a=0x0,_0x52727c=_0x4ca9a1[_0xdfe6('0x51')];_0xe1d34a<_0x52727c;_0xe1d34a++){_0x50ae0b[_0x4ca9a1[_0xe1d34a][_0xdfe6('0x52')]]=_0x4ca9a1[_0xe1d34a][_0xdfe6('0x53')];}return _0x50ae0b;}else{return request({'method':_0xdfe6('0x54'),'uri':util[_0xdfe6('0x22')](_0xdfe6('0x55'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636[_0xdfe6('0x30')],'scope':_0xdfe6('0x31'),'criteria':util[_0xdfe6('0x22')](_0xdfe6('0x4d'),_0x7fa05)},'json':!![]})['then'](function(_0x56b0ca){if(_0x56b0ca[_0xdfe6('0x35')]&&_0x56b0ca[_0xdfe6('0x35')][_0xdfe6('0x36')]){logger[_0xdfe6('0xf')](_0xdfe6('0x56'));var _0x7ac1f5={};var _0x6ba71c=_0x56b0ca[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x57')][_0xdfe6('0x50')]['no']?_0x56b0ca['response'][_0xdfe6('0x36')][_0xdfe6('0x57')][_0xdfe6('0x50')]['FL']:_0x56b0ca[_0xdfe6('0x35')][_0xdfe6('0x36')]['Leads'][_0xdfe6('0x50')][0x0]['FL'];for(var _0x415632=0x0,_0x141b13=_0x6ba71c[_0xdfe6('0x51')];_0x415632<_0x141b13;_0x415632++){_0x7ac1f5[_0x6ba71c[_0x415632][_0xdfe6('0x52')]]=_0x6ba71c[_0x415632][_0xdfe6('0x53')];}return _0x7ac1f5;}else{logger[_0xdfe6('0xf')](_0xdfe6('0x58'));_0x5538b2=getName(_0x5538b2);return request({'method':_0xdfe6('0x2e'),'uri':util[_0xdfe6('0x22')](_0xdfe6('0x59'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636[_0xdfe6('0x30')],'scope':'crmapi','xmlData':util['format'](_0xdfe6('0x5a'),entities[_0xdfe6('0x2d')](_0x5538b2[0x0]),entities[_0xdfe6('0x2d')](_0x5538b2[0x1]),_0x7fa05)},'json':!![]})[_0xdfe6('0x32')](function(_0x45061){_0x45061=JSON[_0xdfe6('0x33')](parser['toJson'](_0x45061));if(_0x45061['response']){if(_0x45061[_0xdfe6('0x35')][_0xdfe6('0x36')]&&_0x45061['response']['result']['recorddetail']){logger[_0xdfe6('0xf')](_0xdfe6('0x5b'));return request({'method':'GET','uri':util[_0xdfe6('0x22')](_0xdfe6('0x5c'),_0x1ae636[_0xdfe6('0x2f')]),'qs':{'authtoken':_0x1ae636['authToken'],'scope':_0xdfe6('0x31'),'id':_0x45061['response']['result'][_0xdfe6('0x37')]['FL'][0x0]['$t']},'json':!![]});}}throw new Error('Error\x20on\x20Lead\x20creation:\x20'+JSON[_0xdfe6('0x49')](_0x45061));})['then'](function(_0x574788){if(_0x574788['response']){if(_0x574788['response'][_0xdfe6('0x36')]){var _0x5276c3={};for(var _0x2cec2e=0x0,_0x590a7e=_0x574788[_0xdfe6('0x35')][_0xdfe6('0x36')][_0xdfe6('0x57')]['row']['FL'][_0xdfe6('0x51')];_0x2cec2e<_0x590a7e;_0x2cec2e++){_0x5276c3[_0x574788['response'][_0xdfe6('0x36')][_0xdfe6('0x57')][_0xdfe6('0x50')]['FL'][_0x2cec2e][_0xdfe6('0x52')]]=_0x574788[_0xdfe6('0x35')][_0xdfe6('0x36')]['Leads'][_0xdfe6('0x50')]['FL'][_0x2cec2e][_0xdfe6('0x53')];}return _0x5276c3;}}throw new Error(_0xdfe6('0x5d')+JSON[_0xdfe6('0x49')](_0x574788));});}});}});}function request(_0x2f721e){logger[_0xdfe6('0x5e')](_0xdfe6('0x5f'),JSON[_0xdfe6('0x49')](_0x2f721e));return rp(_0x2f721e);}function getCustomFields(_0x48c5ae,_0x964883){var _0x2755e3={};if(_0x48c5ae[_0xdfe6('0x51')]>0x0){_[_0xdfe6('0x60')](_0x48c5ae,function(_0x1aef40){if(_0x1aef40[_0xdfe6('0x61')]==='string'&&_0x1aef40[_0xdfe6('0x62')]){_0x2755e3[_0x1aef40[_0xdfe6('0x62')]]=_0x1aef40[_0xdfe6('0x53')]['toString']();}else if(_0x1aef40[_0xdfe6('0x61')]===_0xdfe6('0x63')&&_0x1aef40[_0xdfe6('0x64')]&&_0x1aef40['idField']&&_0x964883[_0x1aef40[_0xdfe6('0x64')]]){_0x2755e3[_0x1aef40[_0xdfe6('0x62')]]=_0x964883[_0x1aef40[_0xdfe6('0x64')]][_0xdfe6('0x65')]();}else if(_0x1aef40[_0xdfe6('0x61')]===_0xdfe6('0x66')&&_0x1aef40['Variable']&&_0x1aef40[_0xdfe6('0x67')][_0xdfe6('0x68')]&&_0x1aef40[_0xdfe6('0x62')]&&_0x964883[_0x1aef40[_0xdfe6('0x67')]['name'][_0xdfe6('0x69')]()]){_0x2755e3[_0x1aef40[_0xdfe6('0x62')]]=_0x964883[_0x1aef40[_0xdfe6('0x67')][_0xdfe6('0x68')][_0xdfe6('0x69')]()][_0xdfe6('0x65')]();}});}return _0x2755e3;}function getName(_0x3135db){if(_0x3135db[_0xdfe6('0x6a')]('\x20')>0x0){var _0xc4d49f=_0x3135db[_0xdfe6('0x6b')](/ (.+)/);if(_0xc4d49f[0x1]){return _0xc4d49f;}}return[_0x3135db,_0x3135db];}exports[_0xdfe6('0x6c')]=function(_0x2f5293,_0x3f590f,_0x57dc52,_0x3b8712,_0x43eaca,_0xb57bc2){var _0x126823,_0x426b7a;_0xb57bc2[_0xdfe6('0x2f')]=intUtil['stripTrailingSlash'](_0xb57bc2[_0xdfe6('0x2f')]);_0xb57bc2[_0xdfe6('0x6d')]=intUtil['stripTrailingSlash'](_0xb57bc2['serverUrl']);if(_0x43eaca&&_0x43eaca[_0xdfe6('0x6e')]){logger[_0xdfe6('0xf')](_0xdfe6('0x6f'),'Recording\x20is\x20enabled!');_0x3f590f[_0xdfe6('0x70')]=util[_0xdfe6('0x22')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb57bc2[_0xdfe6('0x6d')],_0x3f590f['uniqueid'],md5(_0x3f590f[_0xdfe6('0x71')]));}else{_0x3f590f[_0xdfe6('0x70')]='';}return getUser(_0xb57bc2,_0x3b8712['email'])[_0xdfe6('0x32')](function(_0x4b01d8){_0x126823=_0x4b01d8;logger[_0xdfe6('0xf')](_0xdfe6('0x72'),_0x126823['id']);return getEndUser(_0xb57bc2,_0x3f590f[_0xdfe6('0x73')],_0x3f590f[_0xdfe6('0x74')]);})[_0xdfe6('0x32')](function(_0x28ffad){_0x426b7a=_0x28ffad;logger['info'](_0xdfe6('0x75'),_0x426b7a[_0xdfe6('0x28')]||_0x426b7a[_0xdfe6('0x2a')]);return getCall(_0xb57bc2,_0x126823,_0x426b7a,_0x57dc52,_0x3f590f,_0xdfe6('0x76'));})[_0xdfe6('0x32')](function(_0x4d4b22){if(_0x4d4b22){logger[_0xdfe6('0xf')](_0xdfe6('0x77'),_0x4d4b22['id']);logger[_0xdfe6('0xf')](_0xdfe6('0x6f'),_0xdfe6('0x78'));emit(util[_0xdfe6('0x22')](_0xdfe6('0x79'),_0x3b8712[_0xdfe6('0x68')]),_0xdfe6('0x7a'),{'uri':util[_0xdfe6('0x22')](_0xdfe6('0x7b'),_0xb57bc2[_0xdfe6('0x2f')],_0x4d4b22['id'])});}})['catch'](function(_0x110166){logger[_0xdfe6('0x47')]('[QUEUE]',JSON['stringify'](_0x110166));});};exports[_0xdfe6('0x13')]=function(_0x2c992e,_0x392d8d,_0x9c301c,_0x4780e5,_0x180a5f,_0x469209,_0x4c2d9b){var _0x1bd11b,_0x2f5524;_0x469209[_0xdfe6('0x2f')]=intUtil[_0xdfe6('0x7c')](_0x469209['host']);_0x469209[_0xdfe6('0x6d')]=intUtil[_0xdfe6('0x7c')](_0x469209[_0xdfe6('0x6d')]);if(_0x4c2d9b&&_0x4c2d9b[_0xdfe6('0x7d')]&&_0x4c2d9b[_0xdfe6('0x7d')]!==_0xdfe6('0x7e')){logger[_0xdfe6('0xf')](_0xdfe6('0x7f'),_0xdfe6('0x80'));_0x392d8d[_0xdfe6('0x70')]=util[_0xdfe6('0x22')](_0xdfe6('0x81'),_0x469209['serverUrl'],_0x392d8d['uniqueid'],md5(_0x392d8d[_0xdfe6('0x71')]));}return getUser(_0x469209,_0x4780e5[_0xdfe6('0x82')])[_0xdfe6('0x32')](function(_0x26505e){_0x1bd11b=_0x26505e;logger[_0xdfe6('0xf')](_0xdfe6('0x72'),_0x1bd11b['id']);return getEndUser(_0x469209,_0x392d8d['destcalleridname'],_0x392d8d[_0xdfe6('0x83')]);})[_0xdfe6('0x32')](function(_0xaa88e3){_0x2f5524=_0xaa88e3;logger['info'](_0xdfe6('0x75'),_0x2f5524['CONTACTID']||_0x2f5524[_0xdfe6('0x2a')]);return getCall(_0x469209,_0x1bd11b,_0x2f5524,_0x9c301c,_0x392d8d,_0xdfe6('0x84'));})[_0xdfe6('0x32')](function(_0x266b65){if(_0x266b65){logger['info'](_0xdfe6('0x77'),_0x266b65['id']);logger[_0xdfe6('0xf')](_0xdfe6('0x7f'),_0xdfe6('0x78'));emit(util[_0xdfe6('0x22')]('user:%s',_0x4780e5[_0xdfe6('0x68')]),_0xdfe6('0x7a'),{'uri':util['format'](_0xdfe6('0x7b'),_0x469209[_0xdfe6('0x2f')],_0x266b65['id'])});}})['catch'](function(_0x217ac2){logger['error'](_0xdfe6('0x7f'),JSON[_0xdfe6('0x49')](_0x217ac2));});};exports[_0xdfe6('0x1e')]=function(_0x28aeec,_0x5844c6,_0x16c478,_0x3b26b5,_0x1bcd80,_0xb4fe51){var _0x408012,_0x595ffb;_0xb4fe51[_0xdfe6('0x2f')]=intUtil[_0xdfe6('0x7c')](_0xb4fe51[_0xdfe6('0x2f')]);_0xb4fe51[_0xdfe6('0x6d')]=intUtil[_0xdfe6('0x7c')](_0xb4fe51['serverUrl']);if(_0x1bcd80&&_0x1bcd80['monitor_format']){logger[_0xdfe6('0xf')]('[ABANDONED]',_0xdfe6('0x80'));_0x5844c6[_0xdfe6('0x70')]=util['format'](_0xdfe6('0x81'),_0xb4fe51[_0xdfe6('0x6d')],_0x5844c6[_0xdfe6('0x71')],md5(_0x5844c6[_0xdfe6('0x71')]));}else{_0x5844c6[_0xdfe6('0x70')]='';}return getUser(_0xb4fe51)[_0xdfe6('0x32')](function(_0x11ce4f){_0x408012=_0x11ce4f;logger['info'](_0xdfe6('0x72'),_0x408012['id']);return getEndUser(_0xb4fe51,_0x5844c6[_0xdfe6('0x73')],_0x5844c6['calleridnum']);})[_0xdfe6('0x32')](function(_0x5b0bbf){_0x595ffb=_0x5b0bbf;logger['info'](_0xdfe6('0x75'),_0x595ffb[_0xdfe6('0x28')]||_0x595ffb[_0xdfe6('0x2a')]);return getCall(_0xb4fe51,_0x408012,_0x595ffb,_0x16c478,_0x5844c6,_0xdfe6('0x76'));})['then'](function(_0x1cb71d){if(_0x1cb71d){logger[_0xdfe6('0xf')](_0xdfe6('0x77'),_0x1cb71d['id']);}})[_0xdfe6('0x85')](function(_0x7c9d89){logger[_0xdfe6('0x47')](_0xdfe6('0x86'),JSON[_0xdfe6('0x49')](_0x7c9d89));});}; \ 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 8e0771d..e4ff123 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 _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0xb368d0,_0x3a6025){var _0x532f01=function(_0x4a5de9){while(--_0x4a5de9){_0xb368d0['push'](_0xb368d0['shift']());}};_0x532f01(++_0x3a6025);}(_0x7a54,0x106));var _0x47a5=function(_0x1945c1,_0x20b020){_0x1945c1=_0x1945c1-0x0;var _0x41bb07=_0x7a54[_0x1945c1];return _0x41bb07;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x2cf785,_0x4f3be2){var _0x5e4177=function(_0xb301cd){while(--_0xb301cd){_0x2cf785['push'](_0x2cf785['shift']());}};_0x5e4177(++_0x4f3be2);}(_0x7a54,0x106));var _0x47a5=function(_0x561e3f,_0x36ae34){_0x561e3f=_0x561e3f-0x0;var _0x282282=_0x7a54[_0x561e3f];return _0x282282;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ 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 72ec3b5..20407bb 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 _0x73a1=['info','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','lodash','mustache','trigger','exec','data1','toUpperCase','render','data2','headers','data6','parse','error','GET','POST','PUT','data7','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','body','object'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0x73a1,0x161));var _0x173a=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x73a1[_0x3c4dad];return _0x1a4f49;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x173a('0x0'));var Mustache=require(_0x173a('0x1'));var logger=require('../../../../config/logger')(_0x173a('0x2'));exports[_0x173a('0x3')]=function(_0xeec920,_0xf2a2c8){var _0x4a3f0f,_0x57edf4;var _0x417ec0={'method':_0xeec920[_0x173a('0x4')][_0x173a('0x5')](),'uri':encodeURI(Mustache[_0x173a('0x6')](_0xeec920[_0x173a('0x7')],_0xf2a2c8)),'json':!![],'resolveWithFullResponse':!![]};try{_0x417ec0[_0x173a('0x8')]=_0xeec920[_0x173a('0x9')]?JSON[_0x173a('0xa')](Mustache[_0x173a('0x6')](_0xeec920[_0x173a('0x9')],_0xf2a2c8)):{};}catch(_0x30ffef){logger[_0x173a('0xb')](_0x30ffef['stack']);}switch(_0xeec920[_0x173a('0x4')]['toUpperCase']()){case _0x173a('0xc'):_0x417ec0['qs']=_0xf2a2c8;break;case _0x173a('0xd'):case _0x173a('0xe'):_0x4a3f0f={};if(_0xeec920[_0x173a('0xf')]){_0x4a3f0f=Mustache['render'](_0xeec920[_0x173a('0xf')],_0xf2a2c8);}else{_0x4a3f0f=_0xf2a2c8;}_0x417ec0['body']=JSON[_0x173a('0xa')](_0x4a3f0f);break;}logger['info'](util[_0x173a('0x10')](_0x173a('0x11'),_0xeec920['data1'],_0xeec920[_0x173a('0x7')],JSON[_0x173a('0x12')](_0x417ec0)));rp(_0x417ec0)[_0x173a('0x13')](function(_0x20eb9f){_0x4a3f0f=!_[_0x173a('0x14')](_0x4a3f0f)?_0x173a('0x15')+_0x4a3f0f:'';_0x57edf4=typeof _0x20eb9f[_0x173a('0x16')]===_0x173a('0x17')?JSON['stringify'](_0x20eb9f[_0x173a('0x16')]):_0x20eb9f[_0x173a('0x16')];logger[_0x173a('0x18')](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0xeec920['data1'],_0xeec920[_0x173a('0x7')],_0x20eb9f['statusCode'],_0x57edf4));})['catch'](function(_0xd84224){logger[_0x173a('0xb')](util['format'](_0x173a('0x19'),_0xeec920[_0x173a('0x4')],_0xeec920[_0x173a('0x7')],_0xd84224[_0x173a('0x1a')],_0xd84224[_0x173a('0x1b')],_0xd84224[_0x173a('0x1c')]));});}; \ No newline at end of file +var _0xfe9d=['parse','error','stack','toUpperCase','GET','POST','PUT','data7','render','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','request-promise','util','lodash','mustache','../../../../config/logger','exec','data1','data2','data6'];(function(_0x4f00e9,_0x619dee){var _0x3cfffc=function(_0x3fc689){while(--_0x3fc689){_0x4f00e9['push'](_0x4f00e9['shift']());}};_0x3cfffc(++_0x619dee);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x59d623,_0x554126){_0x59d623=_0x59d623-0x0;var _0x13b87a=_0xfe9d[_0x59d623];return _0x13b87a;};'use strict';var rp=require(_0xdfe9('0x0'));var util=require(_0xdfe9('0x1'));var _=require(_0xdfe9('0x2'));var Mustache=require(_0xdfe9('0x3'));var logger=require(_0xdfe9('0x4'))('trigger');exports[_0xdfe9('0x5')]=function(_0x4c71d5,_0x1144b0){var _0x1256ab,_0x2e5fd8;var _0x6dd8ce={'method':_0x4c71d5[_0xdfe9('0x6')]['toUpperCase'](),'uri':encodeURI(Mustache['render'](_0x4c71d5[_0xdfe9('0x7')],_0x1144b0)),'json':!![],'resolveWithFullResponse':!![]};try{_0x6dd8ce['headers']=_0x4c71d5[_0xdfe9('0x8')]?JSON[_0xdfe9('0x9')](Mustache['render'](_0x4c71d5[_0xdfe9('0x8')],_0x1144b0)):{};}catch(_0x36f0c6){logger[_0xdfe9('0xa')](_0x36f0c6[_0xdfe9('0xb')]);}switch(_0x4c71d5['data1'][_0xdfe9('0xc')]()){case _0xdfe9('0xd'):_0x6dd8ce['qs']=_0x1144b0;break;case _0xdfe9('0xe'):case _0xdfe9('0xf'):_0x1256ab={};if(_0x4c71d5[_0xdfe9('0x10')]){_0x1256ab=Mustache[_0xdfe9('0x11')](_0x4c71d5[_0xdfe9('0x10')],_0x1144b0);}else{_0x1256ab=_0x1144b0;}_0x6dd8ce[_0xdfe9('0x12')]=JSON[_0xdfe9('0x9')](_0x1256ab);break;}logger[_0xdfe9('0x13')](util['format'](_0xdfe9('0x14'),_0x4c71d5['data1'],_0x4c71d5['data2'],JSON[_0xdfe9('0x15')](_0x6dd8ce)));rp(_0x6dd8ce)[_0xdfe9('0x16')](function(_0x531409){_0x1256ab=!_[_0xdfe9('0x17')](_0x1256ab)?_0xdfe9('0x18')+_0x1256ab:'';_0x2e5fd8=typeof _0x531409['body']===_0xdfe9('0x19')?JSON['stringify'](_0x531409[_0xdfe9('0x12')]):_0x531409[_0xdfe9('0x12')];logger[_0xdfe9('0x13')](util[_0xdfe9('0x1a')](_0xdfe9('0x1b'),_0x4c71d5[_0xdfe9('0x6')],_0x4c71d5['data2'],_0x531409['statusCode'],_0x2e5fd8));})[_0xdfe9('0x1c')](function(_0x4fd892){logger[_0xdfe9('0xa')](util[_0xdfe9('0x1a')](_0xdfe9('0x1d'),_0x4c71d5['data1'],_0x4c71d5['data2'],_0x4fd892[_0xdfe9('0x1e')],_0x4fd892['name'],_0x4fd892['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 5b79247..ab09e88 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 _0xf2c7=['debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','http','Request','request','then'];(function(_0x3924a8,_0x242cb6){var _0x37dca9=function(_0x5f12c9){while(--_0x5f12c9){_0x3924a8['push'](_0x3924a8['shift']());}};_0x37dca9(++_0x242cb6);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x2d8f6c,_0x44db4c){_0x2d8f6c=_0x2d8f6c-0x0;var _0x3a00f6=_0xf2c7[_0x2d8f6c];return _0x3a00f6;};'use strict';var jayson=require(_0x7f2c('0x0'));var BPromise=require(_0x7f2c('0x1'));var logger=require(_0x7f2c('0x2'))(_0x7f2c('0x3'));var client=jayson['client'][_0x7f2c('0x4')]({'port':0x2329});client[_0x7f2c('0x5')]=function(_0x4f526a,_0x4f340c){return new BPromise(function(_0xebab07,_0x4cb6ff){return client[_0x7f2c('0x6')](_0x4f526a,_0x4f340c)[_0x7f2c('0x7')](function(_0x4e348c){logger[_0x7f2c('0x8')](_0x7f2c('0x9'),_0x7f2c('0x3'),_0x4f526a,_0x4f340c,_0x4e348c);if(_0x4e348c['error']){logger[_0x7f2c('0xa')](_0x7f2c('0x9'),_0x7f2c('0x3'),_0x4f526a,_0x4e348c[_0x7f2c('0xa')][_0x7f2c('0xb')],_0x4f340c);return _0x4cb6ff(_0x4e348c[_0x7f2c('0xa')]['message']);}else{return _0xebab07(_0x4e348c[_0x7f2c('0xc')]);}})[_0x7f2c('0xd')](function(_0x3edb66){logger[_0x7f2c('0xa')](_0x7f2c('0x9'),_0x7f2c('0x3'),_0x4f526a,_0x3edb66,_0x4f340c);return _0x4cb6ff(_0x3edb66);});});};module[_0x7f2c('0xe')]=client; \ No newline at end of file +var _0xb138=['exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','then','rpc','error','message','result','catch'];(function(_0x8ce474,_0x5929bf){var _0x411432=function(_0x18c146){while(--_0x18c146){_0x8ce474['push'](_0x8ce474['shift']());}};_0x411432(++_0x5929bf);}(_0xb138,0x1dd));var _0x8b13=function(_0x13b2a7,_0x3fc11a){_0x13b2a7=_0x13b2a7-0x0;var _0x282bff=_0xb138[_0x13b2a7];return _0x282bff;};'use strict';var jayson=require(_0x8b13('0x0'));var BPromise=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var client=jayson[_0x8b13('0x4')][_0x8b13('0x5')]({'port':0x2329});client[_0x8b13('0x6')]=function(_0x5369d4,_0x4411a0){return new BPromise(function(_0x241acb,_0x3af81a){return client['request'](_0x5369d4,_0x4411a0)[_0x8b13('0x7')](function(_0x13f7bd){logger['debug'](_0x8b13('0x8'),_0x8b13('0x3'),_0x5369d4,_0x4411a0,_0x13f7bd);if(_0x13f7bd[_0x8b13('0x9')]){logger['error'](_0x8b13('0x8'),_0x8b13('0x3'),_0x5369d4,_0x13f7bd['error']['message'],_0x4411a0);return _0x3af81a(_0x13f7bd[_0x8b13('0x9')][_0x8b13('0xa')]);}else{return _0x241acb(_0x13f7bd[_0x8b13('0xb')]);}})[_0x8b13('0xc')](function(_0x3e8eca){logger['error'](_0x8b13('0x8'),_0x8b13('0x3'),_0x5369d4,_0x3e8eca,_0x4411a0);return _0x3af81a(_0x3e8eca);});});};module[_0x8b13('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 523c36e..fa02168 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 _0xb3ef=['mailAccounts','catch','./server','resolve','then','getMailAccounts','initMailAccounts','refresh'];(function(_0x1cc3b3,_0xf3d9b0){var _0x4b366e=function(_0x41e70f){while(--_0x41e70f){_0x1cc3b3['push'](_0x1cc3b3['shift']());}};_0x4b366e(++_0xf3d9b0);}(_0xb3ef,0xda));var _0xfb3e=function(_0x4f0b8d,_0x388f85){_0x4f0b8d=_0x4f0b8d-0x0;var _0x16a1d2=_0xb3ef[_0x4f0b8d];return _0x16a1d2;};'use strict';var BPromise=require('bluebird');var server=require(_0xfb3e('0x0'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xfb3e('0x1')]()[_0xfb3e('0x2')](mailAccount[_0xfb3e('0x3')]())[_0xfb3e('0x2')](realtime[_0xfb3e('0x4')]())[_0xfb3e('0x2')](function(){email[_0xfb3e('0x5')](realtime[_0xfb3e('0x6')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0xfb3e('0x2')](function(_0x36b8c6){return initRealtime();})[_0xfb3e('0x2')](function(_0x28c5d3){return setInterval(initRealtime,0x2710);})[_0xfb3e('0x7')](function(_0x3aabf8){console['log'](_0x3aabf8);});}main(); \ No newline at end of file +var _0x7e03=['./realtime','./rpc/mailAccount','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','catch','log','bluebird','./server'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x7e03,0x12a));var _0x37e0=function(_0x4e3899,_0x20a9bf){_0x4e3899=_0x4e3899-0x0;var _0x96f85d=_0x7e03[_0x4e3899];return _0x96f85d;};'use strict';var BPromise=require(_0x37e0('0x0'));var server=require(_0x37e0('0x1'));var Realtime=require(_0x37e0('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x37e0('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x37e0('0x4')]()[_0x37e0('0x5')](mailAccount[_0x37e0('0x6')]())[_0x37e0('0x5')](realtime[_0x37e0('0x7')]())[_0x37e0('0x5')](function(){email[_0x37e0('0x8')](realtime[_0x37e0('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(_0x2a8b12){return initRealtime();})[_0x37e0('0x5')](function(_0x427755){return setInterval(initRealtime,0x2710);})[_0x37e0('0xa')](function(_0x4ff5cd){console[_0x37e0('0xb')](_0x4ff5cd);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 768d4f8..55633b9 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 _0xaa56=['md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','total','isNil','mailAccount:update','refresh','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','send','Smtp','verify','moment','bluebird'];(function(_0x310f02,_0x49336d){var _0x25f92f=function(_0x2d27b1){while(--_0x2d27b1){_0x310f02['push'](_0x310f02['shift']());}};_0x25f92f(++_0x49336d);}(_0xaa56,0xc6));var _0x6aa5=function(_0x3672e2,_0x18fa78){_0x3672e2=_0x3672e2-0x0;var _0x1d7a82=_0xaa56[_0x3672e2];return _0x1d7a82;};'use strict';var _=require('lodash');var moment=require(_0x6aa5('0x0'));var BPromise=require(_0x6aa5('0x1'));var md5=require(_0x6aa5('0x2'));var Redis=require('ioredis');var config=require(_0x6aa5('0x3'));var logger=require(_0x6aa5('0x4'))(_0x6aa5('0x5'));config[_0x6aa5('0x6')]=_[_0x6aa5('0x7')](config['redis'],{'host':_0x6aa5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6aa5('0x6')]));var EmailImap=require(_0x6aa5('0x9'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x6aa5('0xa'));var md5Accounts={};function EmailChannel(_0x35dbbc){logger[_0x6aa5('0xb')](_0x6aa5('0xc'));this[_0x6aa5('0xd')]=_0x35dbbc[_0x6aa5('0xd')];this[_0x6aa5('0xe')]={};this[_0x6aa5('0xf')]=new EmailSmtp();}EmailChannel[_0x6aa5('0x10')][_0x6aa5('0x11')]=function(_0x1fd778){var _0x2388e=this[_0x6aa5('0xd')][_0x1fd778];var _0x22280f={'id':_0x2388e['id'],'name':_0x2388e['name'],'key':_0x2388e[_0x6aa5('0x12')],'active':_0x2388e[_0x6aa5('0x13')],'Imap':{'status':_0x2388e[_0x6aa5('0x14')][_0x6aa5('0x15')],'messageStatus':_0x2388e['Imap']['messageStatus'],'total':_0x2388e['Imap'][_0x6aa5('0x16')]}};if(_[_0x6aa5('0x17')](md5Accounts[_0x1fd778])){md5Accounts[_0x1fd778]={};}var _0x1173b1=md5(JSON['stringify'](_0x22280f));if(md5Accounts[_0x1fd778][_0x6aa5('0x2')]!==_0x1173b1){md5Accounts[_0x1fd778][_0x6aa5('0x2')]=_0x1173b1;io['emit'](_0x6aa5('0x18'),_0x22280f);}};EmailChannel[_0x6aa5('0x10')][_0x6aa5('0x19')]=function(_0xff6da7){for(var _0x5ca1f3 in _0xff6da7){if(_0xff6da7['hasOwnProperty'](_0x5ca1f3)){if(_0xff6da7[_0x5ca1f3][_0x6aa5('0x14')]&&_0xff6da7[_0x5ca1f3]['active']){var _0x4393c3=_0xff6da7[_0x5ca1f3][_0x6aa5('0x14')];if(!this['imapAccounts']['hasOwnProperty'](_0x4393c3['id'])){this[_0x6aa5('0xe')][_0x4393c3['id']]=new EmailImap(_0x4393c3,_0xff6da7[_0x5ca1f3][_0x6aa5('0x5')]);this[_0x6aa5('0xe')][_0x4393c3['id']]['on']('box',this[_0x6aa5('0x1a')]['bind'](this,_0x5ca1f3));this[_0x6aa5('0xe')][_0x4393c3['id']]['on'](_0x6aa5('0x5'),this[_0x6aa5('0x1b')][_0x6aa5('0x1c')](this,_0x5ca1f3));this['imapAccounts'][_0x4393c3['id']]['on'](_0x6aa5('0x1d'),this[_0x6aa5('0x1e')][_0x6aa5('0x1c')](this,_0x5ca1f3));this[_0x6aa5('0xe')][_0x4393c3['id']]['on'](_0x6aa5('0x1f'),this['handleImapError'][_0x6aa5('0x1c')](this,_0x5ca1f3));}}else{if(_['isNil'](this[_0x6aa5('0xd')][_0x5ca1f3]['Imap'])){this[_0x6aa5('0xd')][_0x5ca1f3][_0x6aa5('0x14')]={};}this['mailAccounts'][_0x5ca1f3]['Imap'][_0x6aa5('0x15')]=_0x6aa5('0x20');this['mailAccounts'][_0x5ca1f3][_0x6aa5('0x14')][_0x6aa5('0x21')]='';this[_0x6aa5('0x11')](_0x5ca1f3);}}}};EmailChannel['prototype'][_0x6aa5('0x1a')]=function(_0xa55c2f,_0x577946){if(this[_0x6aa5('0xd')][_0xa55c2f]){this['mailAccounts'][_0xa55c2f]['Imap'][_0x6aa5('0x15')]=_0x6aa5('0x22');this[_0x6aa5('0xd')][_0xa55c2f]['Imap'][_0x6aa5('0x21')]=_0x577946['name'];if(_0x577946[_0x6aa5('0x23')]){this['mailAccounts'][_0xa55c2f]['Imap'][_0x6aa5('0x16')]=_0x577946[_0x6aa5('0x23')]['total'];}return this[_0x6aa5('0x11')](_0xa55c2f);}};EmailChannel[_0x6aa5('0x10')][_0x6aa5('0x1b')]=function(_0x1a14f8,_0x35a301){logger[_0x6aa5('0xb')](_0x6aa5('0x24'),_0x35a301['firstName'],_0x35a301[_0x6aa5('0x25')],_0x35a301[_0x6aa5('0x26')],_0x1a14f8);if(this[_0x6aa5('0xd')][_0x1a14f8]){return mailAccount['notify'](_0x1a14f8,_0x35a301)[_0x6aa5('0x27')](function(_0x241de2){if(_0x241de2){logger[_0x6aa5('0xb')](_0x6aa5('0x28'));}})[_0x6aa5('0x29')](function(_0x2ca1bf){logger[_0x6aa5('0x1f')](_0x6aa5('0x2a'),JSON[_0x6aa5('0x2b')](_0x2ca1bf));});}};EmailChannel[_0x6aa5('0x10')][_0x6aa5('0x1e')]=function(_0x58980d){if(this[_0x6aa5('0xd')][_0x58980d]&&this[_0x6aa5('0xd')][_0x58980d]['Imap']){if(this[_0x6aa5('0xe')][this[_0x6aa5('0xd')][_0x58980d][_0x6aa5('0x14')]['id']]){delete this['imapAccounts'][this[_0x6aa5('0xd')][_0x58980d][_0x6aa5('0x14')]['id']];}this[_0x6aa5('0xd')][_0x58980d][_0x6aa5('0x14')][_0x6aa5('0x2c')]=moment();this[_0x6aa5('0x11')](_0x58980d);}};EmailChannel[_0x6aa5('0x10')][_0x6aa5('0x2d')]=function(_0x26a083,_0x1fbd5a){if(this['mailAccounts'][_0x26a083]){this[_0x6aa5('0xd')][_0x26a083][_0x6aa5('0x14')][_0x6aa5('0x15')]=_0x6aa5('0x1f');this[_0x6aa5('0xd')][_0x26a083][_0x6aa5('0x14')][_0x6aa5('0x21')]=_0x1fbd5a;return this[_0x6aa5('0x11')](_0x26a083);}};EmailChannel[_0x6aa5('0x10')][_0x6aa5('0x2e')]=function(_0x4c7a41,_0x4e9e1f){return this[_0x6aa5('0xf')][_0x6aa5('0x2f')](_0x4c7a41,_0x4e9e1f);};EmailChannel['prototype']['verifySmtp']=function(_0x30c078){var _0x60a5d2=this;if(this[_0x6aa5('0xd')][_0x30c078['id']]){if(_[_0x6aa5('0x17')](this['mailAccounts'][_0x30c078['id']]['Smtp'])){this[_0x6aa5('0xd')][_0x30c078['id']][_0x6aa5('0x30')]={};}this[_0x6aa5('0xd')][_0x30c078['id']][_0x6aa5('0x30')][_0x6aa5('0x2c')]=moment();return new BPromise(function(_0xb355b5,_0x1bfc55){return _0x60a5d2[_0x6aa5('0xf')]['verify'](_0x30c078)[_0x6aa5('0x27')](function(_0x25596b){_0x60a5d2['mailAccounts'][_0x30c078['id']][_0x6aa5('0x30')][_0x6aa5('0x15')]='verified';_0x60a5d2[_0x6aa5('0xd')][_0x30c078['id']][_0x6aa5('0x30')][_0x6aa5('0x21')]='';_0x60a5d2[_0x6aa5('0x11')](_0x30c078['id']);_0xb355b5(_0x25596b);})[_0x6aa5('0x29')](function(_0x415260){_0x60a5d2[_0x6aa5('0xd')][_0x30c078['id']][_0x6aa5('0x30')][_0x6aa5('0x15')]='error';_0x60a5d2[_0x6aa5('0xd')][_0x30c078['id']]['Smtp'][_0x6aa5('0x21')]=_0x415260;_0x60a5d2[_0x6aa5('0x11')](_0x30c078['id']);_0x1bfc55(_0x415260);});});}return this['smtp'][_0x6aa5('0x31')](_0x30c078);};module['exports']=EmailChannel; \ No newline at end of file +var _0x6343=['Imap','status','messageStatus','total','isNil','stringify','emit','prototype','refresh','hasOwnProperty','email','handleImapBox','bind','handleImapEnd','handleImapError','disabled','connected','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','sendMail','send','verifySmtp','Smtp','verify','exports','bluebird','md5','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','name','key','active'];(function(_0x33823b,_0x3aedea){var _0x10f7e5=function(_0x5f19a9){while(--_0x5f19a9){_0x33823b['push'](_0x33823b['shift']());}};_0x10f7e5(++_0x3aedea);}(_0x6343,0x168));var _0x3634=function(_0x1c20c8,_0x40832e){_0x1c20c8=_0x1c20c8-0x0;var _0x39c05c=_0x6343[_0x1c20c8];return _0x39c05c;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x3634('0x0'));var md5=require(_0x3634('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')('email');config[_0x3634('0x2')]=_[_0x3634('0x3')](config['redis'],{'host':_0x3634('0x4'),'port':0x18eb});var io=require(_0x3634('0x5'))(new Redis(config['redis']));var EmailImap=require(_0x3634('0x6'));var EmailSmtp=require(_0x3634('0x7'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5affba){logger[_0x3634('0x8')](_0x3634('0x9'));this[_0x3634('0xa')]=_0x5affba[_0x3634('0xa')];this[_0x3634('0xb')]={};this[_0x3634('0xc')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x31bcfc){var _0x364e60=this['mailAccounts'][_0x31bcfc];var _0x2bb4db={'id':_0x364e60['id'],'name':_0x364e60[_0x3634('0xd')],'key':_0x364e60[_0x3634('0xe')],'active':_0x364e60[_0x3634('0xf')],'Imap':{'status':_0x364e60[_0x3634('0x10')][_0x3634('0x11')],'messageStatus':_0x364e60[_0x3634('0x10')][_0x3634('0x12')],'total':_0x364e60[_0x3634('0x10')][_0x3634('0x13')]}};if(_[_0x3634('0x14')](md5Accounts[_0x31bcfc])){md5Accounts[_0x31bcfc]={};}var _0x71d09b=md5(JSON[_0x3634('0x15')](_0x2bb4db));if(md5Accounts[_0x31bcfc][_0x3634('0x1')]!==_0x71d09b){md5Accounts[_0x31bcfc]['md5']=_0x71d09b;io[_0x3634('0x16')]('mailAccount:update',_0x2bb4db);}};EmailChannel[_0x3634('0x17')][_0x3634('0x18')]=function(_0x2fc628){for(var _0x78f93f in _0x2fc628){if(_0x2fc628[_0x3634('0x19')](_0x78f93f)){if(_0x2fc628[_0x78f93f]['Imap']&&_0x2fc628[_0x78f93f][_0x3634('0xf')]){var _0x4b8ec8=_0x2fc628[_0x78f93f]['Imap'];if(!this[_0x3634('0xb')]['hasOwnProperty'](_0x4b8ec8['id'])){this[_0x3634('0xb')][_0x4b8ec8['id']]=new EmailImap(_0x4b8ec8,_0x2fc628[_0x78f93f][_0x3634('0x1a')]);this[_0x3634('0xb')][_0x4b8ec8['id']]['on']('box',this[_0x3634('0x1b')][_0x3634('0x1c')](this,_0x78f93f));this['imapAccounts'][_0x4b8ec8['id']]['on'](_0x3634('0x1a'),this['handleImapEmail'][_0x3634('0x1c')](this,_0x78f93f));this[_0x3634('0xb')][_0x4b8ec8['id']]['on']('end',this[_0x3634('0x1d')][_0x3634('0x1c')](this,_0x78f93f));this[_0x3634('0xb')][_0x4b8ec8['id']]['on']('error',this[_0x3634('0x1e')][_0x3634('0x1c')](this,_0x78f93f));}}else{if(_['isNil'](this[_0x3634('0xa')][_0x78f93f]['Imap'])){this['mailAccounts'][_0x78f93f][_0x3634('0x10')]={};}this[_0x3634('0xa')][_0x78f93f]['Imap'][_0x3634('0x11')]=_0x3634('0x1f');this[_0x3634('0xa')][_0x78f93f][_0x3634('0x10')][_0x3634('0x12')]='';this[_0x3634('0x16')](_0x78f93f);}}}};EmailChannel[_0x3634('0x17')][_0x3634('0x1b')]=function(_0x22f1f1,_0x52e9ae){if(this[_0x3634('0xa')][_0x22f1f1]){this['mailAccounts'][_0x22f1f1]['Imap']['status']=_0x3634('0x20');this['mailAccounts'][_0x22f1f1][_0x3634('0x10')][_0x3634('0x12')]=_0x52e9ae['name'];if(_0x52e9ae['messages']){this[_0x3634('0xa')][_0x22f1f1]['Imap'][_0x3634('0x13')]=_0x52e9ae['messages'][_0x3634('0x13')];}return this[_0x3634('0x16')](_0x22f1f1);}};EmailChannel[_0x3634('0x17')][_0x3634('0x21')]=function(_0x1f46d9,_0x20b062){logger[_0x3634('0x8')](_0x3634('0x22'),_0x20b062['firstName'],_0x20b062['lastName'],_0x20b062['from'],_0x1f46d9);if(this[_0x3634('0xa')][_0x1f46d9]){return mailAccount['notify'](_0x1f46d9,_0x20b062)[_0x3634('0x23')](function(_0x15b0a4){if(_0x15b0a4){logger[_0x3634('0x8')](_0x3634('0x24'));}})[_0x3634('0x25')](function(_0x293e52){logger['error'](_0x3634('0x26'),JSON[_0x3634('0x15')](_0x293e52));});}};EmailChannel[_0x3634('0x17')][_0x3634('0x1d')]=function(_0x424825){if(this[_0x3634('0xa')][_0x424825]&&this[_0x3634('0xa')][_0x424825][_0x3634('0x10')]){if(this[_0x3634('0xb')][this['mailAccounts'][_0x424825][_0x3634('0x10')]['id']]){delete this[_0x3634('0xb')][this[_0x3634('0xa')][_0x424825][_0x3634('0x10')]['id']];}this['mailAccounts'][_0x424825][_0x3634('0x10')][_0x3634('0x27')]=moment();this[_0x3634('0x16')](_0x424825);}};EmailChannel['prototype']['handleImapError']=function(_0x55b8d8,_0x4204fe){if(this[_0x3634('0xa')][_0x55b8d8]){this['mailAccounts'][_0x55b8d8][_0x3634('0x10')][_0x3634('0x11')]=_0x3634('0x28');this[_0x3634('0xa')][_0x55b8d8][_0x3634('0x10')][_0x3634('0x12')]=_0x4204fe;return this[_0x3634('0x16')](_0x55b8d8);}};EmailChannel['prototype'][_0x3634('0x29')]=function(_0x59dbf2,_0x35b71e){return this[_0x3634('0xc')][_0x3634('0x2a')](_0x59dbf2,_0x35b71e);};EmailChannel[_0x3634('0x17')][_0x3634('0x2b')]=function(_0x597511){var _0x10ff70=this;if(this[_0x3634('0xa')][_0x597511['id']]){if(_[_0x3634('0x14')](this[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')])){this[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')]={};}this[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')]['lastSync']=moment();return new BPromise(function(_0x4c1e6a,_0x14586d){return _0x10ff70['smtp']['verify'](_0x597511)['then'](function(_0x80f1a2){_0x10ff70['mailAccounts'][_0x597511['id']][_0x3634('0x2c')][_0x3634('0x11')]='verified';_0x10ff70['mailAccounts'][_0x597511['id']]['Smtp'][_0x3634('0x12')]='';_0x10ff70[_0x3634('0x16')](_0x597511['id']);_0x4c1e6a(_0x80f1a2);})['catch'](function(_0x37144c){_0x10ff70[_0x3634('0xa')][_0x597511['id']][_0x3634('0x2c')][_0x3634('0x11')]=_0x3634('0x28');_0x10ff70['mailAccounts'][_0x597511['id']]['Smtp'][_0x3634('0x12')]=_0x37144c;_0x10ff70[_0x3634('0x16')](_0x597511['id']);_0x14586d(_0x37144c);});});}return this[_0x3634('0xc')][_0x3634('0x2d')](_0x597511);};module[_0x3634('0x2e')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 46f8eed..f1c8f38 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 _0xb575=['anonymous@xcally.com','handleReady','openBox','emit','box','readUnseen','handleCloseBox','end','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','lodash','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','imap','once','ready','bind','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required'];(function(_0x3b02ad,_0x542c05){var _0x460d97=function(_0x166b1b){while(--_0x166b1b){_0x3b02ad['push'](_0x3b02ad['shift']());}};_0x460d97(++_0x542c05);}(_0xb575,0xda));var _0x5b57=function(_0x385fa4,_0xbd3d3f){_0x385fa4=_0x385fa4-0x0;var _0x1992dd=_0xb575[_0x385fa4];return _0x1992dd;};'use strict';var fs=require('fs');var path=require(_0x5b57('0x0'));var util=require(_0x5b57('0x1'));var Imap=require('imap');var _=require(_0x5b57('0x2'));var rs=require('randomstring');var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x5b57('0x3'))[_0x5b57('0x4')];var EventEmitter=require('events')[_0x5b57('0x5')];var utils=require(_0x5b57('0x6'));var logger=require(_0x5b57('0x7'))(_0x5b57('0x8'));function EmailImap(_0x672beb,_0x5d223d){this[_0x5b57('0x9')]='INBOX';this[_0x5b57('0xa')]=this[_0x5b57('0xb')](_0x672beb,_0x5d223d);this[_0x5b57('0xc')]=new Imap(this['account']);this[_0x5b57('0xc')][_0x5b57('0xd')](_0x5b57('0xe'),this['handleReady'][_0x5b57('0xf')](this));this[_0x5b57('0xc')]['once']('end',this[_0x5b57('0x10')][_0x5b57('0xf')](this));this[_0x5b57('0xc')]['on'](_0x5b57('0x11'),this[_0x5b57('0x12')][_0x5b57('0xf')](this));this[_0x5b57('0xc')][_0x5b57('0x13')]();}util[_0x5b57('0x14')](EmailImap,EventEmitter);EmailImap[_0x5b57('0x15')]['getAccount']=function(_0x16ffe0,_0x3182cf){var _0x297c96={'connTimeout':_0x16ffe0['connTimeout']?_0x16ffe0[_0x5b57('0x16')]*0x3e8:0x2710,'authTimeout':_0x16ffe0[_0x5b57('0x17')]?_0x16ffe0[_0x5b57('0x17')]*0x3e8:0x1388};if(_[_0x5b57('0x18')](_0x16ffe0[_0x5b57('0x19')])){if(_0x16ffe0[_0x5b57('0x1a')]){_0x297c96[_0x5b57('0x1b')]=_0x16ffe0[_0x5b57('0x1b')];_0x297c96['password']=_0x16ffe0[_0x5b57('0x1c')];}_0x297c96[_0x5b57('0x1d')]=_0x16ffe0[_0x5b57('0x1d')];_0x297c96[_0x5b57('0x1e')]=_0x16ffe0[_0x5b57('0x1e')]||0x3e1;if(_0x16ffe0[_0x5b57('0x1f')]){_0x297c96['tls']=!![];}else{_0x297c96[_0x5b57('0x1f')]=![];_0x297c96[_0x5b57('0x20')]=_0x5b57('0x21');}}else{_0x297c96[_0x5b57('0x1b')]=_0x16ffe0['user'];_0x297c96[_0x5b57('0x1c')]=_0x16ffe0[_0x5b57('0x1c')];_0x297c96[_0x5b57('0x1d')]=utils['getHost'](_0x16ffe0[_0x5b57('0x19')]);_0x297c96[_0x5b57('0x1e')]=0x3e1;_0x297c96[_0x5b57('0x1f')]=!![];}_0x297c96[_0x5b57('0x8')]=_0x3182cf||_0x16ffe0[_0x5b57('0x1b')]||_0x5b57('0x22');return _0x297c96;};EmailImap['prototype'][_0x5b57('0x23')]=function(){this['imap'][_0x5b57('0x24')](this[_0x5b57('0x9')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x5b57('0x15')]['handleOpenBox']=function(_0x120dc6,_0xc173a4){if(_0x120dc6){this[_0x5b57('0x12')](_0x120dc6,!![]);}else{this[_0x5b57('0x25')](_0x5b57('0x26'),_0xc173a4);this[_0x5b57('0x27')]();}};EmailImap[_0x5b57('0x15')][_0x5b57('0x28')]=function(_0xf0375b){if(_0xf0375b){this[_0x5b57('0x12')](_0xf0375b,!![]);}else{this[_0x5b57('0xc')][_0x5b57('0x29')]();}};EmailImap[_0x5b57('0x15')][_0x5b57('0x27')]=function(){this[_0x5b57('0xc')][_0x5b57('0x2a')]([_0x5b57('0x2b')],this['handleReadUnseen'][_0x5b57('0xf')](this));};EmailImap['prototype'][_0x5b57('0x2c')]=function(_0x2743ce,_0x33b262){if(_0x2743ce){this[_0x5b57('0x12')](_0x2743ce,!![]);}else{if(_0x33b262[_0x5b57('0x2d')]){try{var _0x41434b=this['imap'][_0x5b57('0x2e')](_0x33b262,{'bodies':'','markSeen':!![]});_0x41434b['on'](_0x5b57('0x2f'),this[_0x5b57('0x30')][_0x5b57('0xf')](this));_0x41434b[_0x5b57('0xd')]('error',this[_0x5b57('0x31')]['bind'](this));_0x41434b[_0x5b57('0xd')]('end',this[_0x5b57('0x32')][_0x5b57('0xf')](this));}catch(_0x5a9953){logger[_0x5b57('0x11')](_0x5a9953);}}else{this[_0x5b57('0xc')][_0x5b57('0x33')](!![],this[_0x5b57('0x28')][_0x5b57('0xf')](this));}}};EmailImap[_0x5b57('0x15')][_0x5b57('0x30')]=function(_0x57985c,_0x2277ea){_0x57985c['on'](_0x5b57('0x34'),this[_0x5b57('0x35')][_0x5b57('0xf')](this));_0x57985c[_0x5b57('0xd')](_0x5b57('0x36'),this[_0x5b57('0x37')][_0x5b57('0xf')](this));_0x57985c[_0x5b57('0xd')](_0x5b57('0x29'),this[_0x5b57('0x38')][_0x5b57('0xf')](this));};EmailImap[_0x5b57('0x15')][_0x5b57('0x35')]=function(_0x5b4bd2,_0x4155ac){simpleParser(_0x5b4bd2,{'Iconv':Iconv},this['handleSimpleParser'][_0x5b57('0xf')](this));};EmailImap[_0x5b57('0x15')][_0x5b57('0x37')]=function(_0x20d872){};EmailImap[_0x5b57('0x15')][_0x5b57('0x38')]=function(){};EmailImap[_0x5b57('0x15')]['handleSimpleParser']=function(_0x25a1be,_0x1ec1dc){if(_0x25a1be){logger[_0x5b57('0x11')](_0x25a1be);}else{var _0x569c87=this;utils[_0x5b57('0x39')](this[_0x5b57('0xa')],_0x1ec1dc,function(_0x5eea89){_0x569c87[_0x5b57('0x25')](_0x5b57('0x8'),_0x5eea89);});}};EmailImap[_0x5b57('0x15')]['handleFetchEnd']=function(){this['imap'][_0x5b57('0x33')](!![],this[_0x5b57('0x28')]['bind'](this));};EmailImap[_0x5b57('0x15')]['handleFetchError']=function(_0xd6bda6){this[_0x5b57('0x12')](_0xd6bda6);this['imap'][_0x5b57('0x33')](!![],this[_0x5b57('0x28')][_0x5b57('0xf')](this));};EmailImap[_0x5b57('0x15')][_0x5b57('0x10')]=function(){this[_0x5b57('0x25')](_0x5b57('0x29'));};EmailImap['prototype']['handleError']=function(_0x140d23,_0x48fb91){logger[_0x5b57('0x11')]('handleError',this[_0x5b57('0xa')][_0x5b57('0x8')],JSON[_0x5b57('0x3a')](_0x140d23));var _0x254207='';if(_0x140d23){if(_0x140d23[_0x5b57('0x3b')]){_0x254207=_0x140d23[_0x5b57('0x3b')];}else{for(var _0x12629a in _0x140d23){if(_0x140d23[_0x5b57('0x3c')](_0x12629a)){_0x254207+=_[_0x5b57('0x3d')](_0x12629a)+':\x20'+_0x140d23[_0x12629a]+'\x0a';}}}}if(_0x48fb91){this[_0x5b57('0xc')][_0x5b57('0x29')]();}else{this[_0x5b57('0x25')](_0x5b57('0x11'),_0x254207);this[_0x5b57('0x25')](_0x5b57('0x29'));}};module[_0x5b57('0x3e')]=EmailImap; \ No newline at end of file +var _0xa179=['autotls','required','getHost','email','anonymous@xcally.com','openBox','handleOpenBox','handleError','emit','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','error','handleFetchError','closeBox','handleCloseBox','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','upperFirst','exports','path','util','lodash','randomstring','simpleParser','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','account','getAccount','imap','once','handleReady','bind','end','handleEnd','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','password','host','port','tls'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0xa179,0x1c1));var _0x9a17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa179[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x9a17('0x0'));var util=require(_0x9a17('0x1'));var Imap=require('imap');var _=require(_0x9a17('0x2'));var rs=require(_0x9a17('0x3'));var simpleParser=require('mailparser')[_0x9a17('0x4')];var Iconv=require('iconv')[_0x9a17('0x5')];var EventEmitter=require(_0x9a17('0x6'))[_0x9a17('0x7')];var utils=require(_0x9a17('0x8'));var logger=require(_0x9a17('0x9'))('email');function EmailImap(_0x40206b,_0x3149b7){this[_0x9a17('0xa')]=_0x9a17('0xb');this[_0x9a17('0xc')]=this[_0x9a17('0xd')](_0x40206b,_0x3149b7);this[_0x9a17('0xe')]=new Imap(this[_0x9a17('0xc')]);this[_0x9a17('0xe')][_0x9a17('0xf')]('ready',this[_0x9a17('0x10')][_0x9a17('0x11')](this));this['imap'][_0x9a17('0xf')](_0x9a17('0x12'),this[_0x9a17('0x13')][_0x9a17('0x11')](this));this[_0x9a17('0xe')]['on']('error',this['handleError'][_0x9a17('0x11')](this));this[_0x9a17('0xe')]['connect']();}util[_0x9a17('0x14')](EmailImap,EventEmitter);EmailImap[_0x9a17('0x15')][_0x9a17('0xd')]=function(_0x13c62b,_0x3aa8f8){var _0x15e569={'connTimeout':_0x13c62b[_0x9a17('0x16')]?_0x13c62b[_0x9a17('0x16')]*0x3e8:0x2710,'authTimeout':_0x13c62b[_0x9a17('0x17')]?_0x13c62b[_0x9a17('0x17')]*0x3e8:0x1388};if(_[_0x9a17('0x18')](_0x13c62b['service'])){if(_0x13c62b[_0x9a17('0x19')]){_0x15e569[_0x9a17('0x1a')]=_0x13c62b['user'];_0x15e569['password']=_0x13c62b[_0x9a17('0x1b')];}_0x15e569[_0x9a17('0x1c')]=_0x13c62b[_0x9a17('0x1c')];_0x15e569[_0x9a17('0x1d')]=_0x13c62b[_0x9a17('0x1d')]||0x3e1;if(_0x13c62b[_0x9a17('0x1e')]){_0x15e569[_0x9a17('0x1e')]=!![];}else{_0x15e569[_0x9a17('0x1e')]=![];_0x15e569[_0x9a17('0x1f')]=_0x9a17('0x20');}}else{_0x15e569[_0x9a17('0x1a')]=_0x13c62b[_0x9a17('0x1a')];_0x15e569[_0x9a17('0x1b')]=_0x13c62b['password'];_0x15e569['host']=utils[_0x9a17('0x21')](_0x13c62b['service']);_0x15e569[_0x9a17('0x1d')]=0x3e1;_0x15e569[_0x9a17('0x1e')]=!![];}_0x15e569[_0x9a17('0x22')]=_0x3aa8f8||_0x13c62b[_0x9a17('0x1a')]||_0x9a17('0x23');return _0x15e569;};EmailImap[_0x9a17('0x15')]['handleReady']=function(){this['imap'][_0x9a17('0x24')](this[_0x9a17('0xa')],![],this[_0x9a17('0x25')][_0x9a17('0x11')](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x25')]=function(_0xbef18a,_0x5158f7){if(_0xbef18a){this[_0x9a17('0x26')](_0xbef18a,!![]);}else{this[_0x9a17('0x27')]('box',_0x5158f7);this['readUnseen']();}};EmailImap['prototype']['handleCloseBox']=function(_0x355f5a){if(_0x355f5a){this[_0x9a17('0x26')](_0x355f5a,!![]);}else{this[_0x9a17('0xe')][_0x9a17('0x12')]();}};EmailImap['prototype']['readUnseen']=function(){this[_0x9a17('0xe')][_0x9a17('0x28')]([_0x9a17('0x29')],this[_0x9a17('0x2a')]['bind'](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x2a')]=function(_0x105a79,_0x4d0b6f){if(_0x105a79){this[_0x9a17('0x26')](_0x105a79,!![]);}else{if(_0x4d0b6f['length']){try{var _0x5da93b=this[_0x9a17('0xe')][_0x9a17('0x2b')](_0x4d0b6f,{'bodies':'','markSeen':!![]});_0x5da93b['on'](_0x9a17('0x2c'),this[_0x9a17('0x2d')]['bind'](this));_0x5da93b[_0x9a17('0xf')](_0x9a17('0x2e'),this[_0x9a17('0x2f')][_0x9a17('0x11')](this));_0x5da93b[_0x9a17('0xf')]('end',this['handleFetchEnd'][_0x9a17('0x11')](this));}catch(_0x1fcd0c){logger[_0x9a17('0x2e')](_0x1fcd0c);}}else{this[_0x9a17('0xe')][_0x9a17('0x30')](!![],this[_0x9a17('0x31')][_0x9a17('0x11')](this));}}};EmailImap['prototype'][_0x9a17('0x2d')]=function(_0x4c1ced,_0x23fae8){_0x4c1ced['on']('body',this[_0x9a17('0x32')][_0x9a17('0x11')](this));_0x4c1ced[_0x9a17('0xf')](_0x9a17('0x33'),this[_0x9a17('0x34')]['bind'](this));_0x4c1ced[_0x9a17('0xf')]('end',this['handleMessageEnd']['bind'](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x32')]=function(_0x3bd788,_0x3d1d1e){simpleParser(_0x3bd788,{'Iconv':Iconv},this[_0x9a17('0x35')]['bind'](this));};EmailImap[_0x9a17('0x15')][_0x9a17('0x34')]=function(_0x404590){};EmailImap[_0x9a17('0x15')]['handleMessageEnd']=function(){};EmailImap[_0x9a17('0x15')][_0x9a17('0x35')]=function(_0x2552a9,_0xc83341){if(_0x2552a9){logger['error'](_0x2552a9);}else{var _0x354eb0=this;utils[_0x9a17('0x36')](this['account'],_0xc83341,function(_0x2e8625){_0x354eb0['emit'](_0x9a17('0x22'),_0x2e8625);});}};EmailImap[_0x9a17('0x15')][_0x9a17('0x37')]=function(){this['imap'][_0x9a17('0x30')](!![],this[_0x9a17('0x31')][_0x9a17('0x11')](this));};EmailImap['prototype'][_0x9a17('0x2f')]=function(_0x3623e3){this[_0x9a17('0x26')](_0x3623e3);this[_0x9a17('0xe')][_0x9a17('0x30')](!![],this['handleCloseBox'][_0x9a17('0x11')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x9a17('0x27')](_0x9a17('0x12'));};EmailImap[_0x9a17('0x15')][_0x9a17('0x26')]=function(_0x41ab5a,_0x5260a8){logger['error'](_0x9a17('0x26'),this[_0x9a17('0xc')][_0x9a17('0x22')],JSON[_0x9a17('0x38')](_0x41ab5a));var _0xaa8b0f='';if(_0x41ab5a){if(_0x41ab5a[_0x9a17('0x39')]){_0xaa8b0f=_0x41ab5a['textCode'];}else{for(var _0x24c072 in _0x41ab5a){if(_0x41ab5a['hasOwnProperty'](_0x24c072)){_0xaa8b0f+=_[_0x9a17('0x3a')](_0x24c072)+':\x20'+_0x41ab5a[_0x24c072]+'\x0a';}}}}if(_0x5260a8){this[_0x9a17('0xe')]['end']();}else{this[_0x9a17('0x27')](_0x9a17('0x2e'),_0xaa8b0f);this[_0x9a17('0x27')](_0x9a17('0x12'));}};module[_0x9a17('0x3b')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index cb4fcfb..c554422 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 _0xef75=['createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype'];(function(_0x2faa36,_0x2543e6){var _0x41026d=function(_0x15c6f8){while(--_0x15c6f8){_0x2faa36['push'](_0x2faa36['shift']());}};_0x41026d(++_0x2543e6);}(_0xef75,0x134));var _0x5ef7=function(_0x1dfdb1,_0x39ad43){_0x1dfdb1=_0x1dfdb1-0x0;var _0x72a878=_0xef75[_0x1dfdb1];return _0x72a878;};'use strict';var nodemailer=require(_0x5ef7('0x0'));var BPromise=require(_0x5ef7('0x1'));var inlineBase64=require(_0x5ef7('0x2'));function EmailSmtp(){}EmailSmtp[_0x5ef7('0x3')]['send']=function(_0x2f4e3f,_0x41f687){return new BPromise(function(_0x5d7745,_0x166934){var _0xba652c=nodemailer[_0x5ef7('0x4')](_0x2f4e3f);_0xba652c[_0x5ef7('0x5')](_0x5ef7('0x6'),inlineBase64());_0xba652c[_0x5ef7('0x7')](_0x41f687,function(_0x479a4a,_0x2b94f0){if(_0x479a4a){_0x166934(_0x479a4a[_0x5ef7('0x8')]());}else{_0x5d7745(_0x2b94f0);}});});};EmailSmtp[_0x5ef7('0x3')][_0x5ef7('0x9')]=function(_0xcb9c3a){return new BPromise(function(_0xf36c7e,_0x46760f){var _0x507111=nodemailer[_0x5ef7('0x4')](_0xcb9c3a);_0x507111[_0x5ef7('0x9')](function(_0x5e9ce6,_0x413074){if(_0x5e9ce6){_0x46760f(_0x5e9ce6[_0x5ef7('0x8')]());}else{if(_0x413074){_0xf36c7e(_0x413074);}else{_0x46760f(_0x5ef7('0xa'));}}});});};module[_0x5ef7('0xb')]=EmailSmtp; \ No newline at end of file +var _0x83b7=['use','compile','sendMail','toString','prototype','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport'];(function(_0x549490,_0xea5dd0){var _0x3a8791=function(_0x4930d4){while(--_0x4930d4){_0x549490['push'](_0x549490['shift']());}};_0x3a8791(++_0xea5dd0);}(_0x83b7,0xf8));var _0x783b=function(_0x5f1bb2,_0x3d0ec3){_0x5f1bb2=_0x5f1bb2-0x0;var _0x5b0d1e=_0x83b7[_0x5f1bb2];return _0x5b0d1e;};'use strict';var nodemailer=require(_0x783b('0x0'));var BPromise=require(_0x783b('0x1'));var inlineBase64=require(_0x783b('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x783b('0x3')]=function(_0xd35d42,_0x4945ca){return new BPromise(function(_0x51c72,_0x1fb968){var _0x31d0a3=nodemailer[_0x783b('0x4')](_0xd35d42);_0x31d0a3[_0x783b('0x5')](_0x783b('0x6'),inlineBase64());_0x31d0a3[_0x783b('0x7')](_0x4945ca,function(_0x4cf436,_0x412c64){if(_0x4cf436){_0x1fb968(_0x4cf436[_0x783b('0x8')]());}else{_0x51c72(_0x412c64);}});});};EmailSmtp[_0x783b('0x9')]['verify']=function(_0x51e3a1){return new BPromise(function(_0x366c02,_0x4ca8ea){var _0xd26ade=nodemailer[_0x783b('0x4')](_0x51e3a1);_0xd26ade['verify'](function(_0x125458,_0xb0eafc){if(_0x125458){_0x4ca8ea(_0x125458[_0x783b('0x8')]());}else{if(_0xb0eafc){_0x366c02(_0xb0eafc);}else{_0x4ca8ea('Not\x20verifired');}}});});};module[_0x783b('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c3245ca..76c7ded 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 _0x37de=['root','server/files/attachments/','writeFileSync','push','contentType','parser','from','subject','messageId','inReplyTo','date','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','content','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','lodash','moment','randomstring','path','node-tnef','../../../config/environment','head','address','anonymous','generate','@xcally.com','value','name','slice','join','Anonymous','split','length','pop','test','html','replace','body','textAsHtml','0x1?_0x3731b0[_0xe37d('0x12')]():'';}return'';}function getMails(_0x2c79c0,_0x947767){var _0x5302d0='';for(var _0x428c9a=0x0;_0x428c9a<_0x947767[_0xe37d('0xb')]['length'];_0x428c9a+=0x1){if(_0x947767['value'][_0x428c9a][_0xe37d('0x7')]!==_0x2c79c0){if(!_['isEmpty'](_0x5302d0)){_0x5302d0+=',';}_0x5302d0+=_0x947767[_0xe37d('0xb')][_0x428c9a]['name']||_0x947767['value'][_0x428c9a]['address']||'';_0x5302d0+='\x20<';_0x5302d0+=_0x947767[_0xe37d('0xb')][_0x428c9a][_0xe37d('0x7')]?_0x947767[_0xe37d('0xb')][_0x428c9a][_0xe37d('0x7')]:_0xe37d('0x8')+random[_0xe37d('0x9')](0x6)+_0xe37d('0xa');_0x5302d0+='>';}}return _0x5302d0;}function parseEmail(_0x525a07,_0x246495,_0x39edec){if(_0x246495['html']){var _0x597f92=/)<[^<]*)*<\/script>/gi;while(_0x597f92[_0xe37d('0x13')](_0x246495[_0xe37d('0x14')])){_0x246495[_0xe37d('0x14')]=_0x246495['html'][_0xe37d('0x15')](_0x597f92,'');}_0x39edec[_0xe37d('0x16')]=_0x246495[_0xe37d('0x14')];}else{_0x39edec[_0xe37d('0x16')]=_0x246495[_0xe37d('0x17')];}if(_0x39edec['body']){_0x39edec[_0xe37d('0x16')]=_0x39edec[_0xe37d('0x16')][_0xe37d('0x15')](/0x1?_0x185fe3['pop']():'';}return'';}function getMails(_0x290266,_0x45db46){var _0xef15c8='';for(var _0x3ce4ac=0x0;_0x3ce4ac<_0x45db46[_0xe0e3('0x9')][_0xe0e3('0x10')];_0x3ce4ac+=0x1){if(_0x45db46[_0xe0e3('0x9')][_0x3ce4ac][_0xe0e3('0xa')]!==_0x290266){if(!_['isEmpty'](_0xef15c8)){_0xef15c8+=',';}_0xef15c8+=_0x45db46[_0xe0e3('0x9')][_0x3ce4ac][_0xe0e3('0xe')]||_0x45db46[_0xe0e3('0x9')][_0x3ce4ac][_0xe0e3('0xa')]||'';_0xef15c8+='\x20<';_0xef15c8+=_0x45db46[_0xe0e3('0x9')][_0x3ce4ac]['address']?_0x45db46[_0xe0e3('0x9')][_0x3ce4ac]['address']:_0xe0e3('0xb')+random[_0xe0e3('0xc')](0x6)+'@xcally.com';_0xef15c8+='>';}}return _0xef15c8;}function parseEmail(_0x17cd83,_0x5c3401,_0x42bcd4){if(_0x5c3401[_0xe0e3('0x14')]){var _0x58fc07=/)<[^<]*)*<\/script>/gi;while(_0x58fc07[_0xe0e3('0x15')](_0x5c3401[_0xe0e3('0x14')])){_0x5c3401[_0xe0e3('0x14')]=_0x5c3401[_0xe0e3('0x14')][_0xe0e3('0x16')](_0x58fc07,'');}_0x42bcd4['body']=_0x5c3401[_0xe0e3('0x14')];}else{_0x42bcd4[_0xe0e3('0x17')]=_0x5c3401[_0xe0e3('0x18')];}if(_0x42bcd4[_0xe0e3('0x17')]){_0x42bcd4[_0xe0e3('0x17')]=_0x42bcd4[_0xe0e3('0x17')][_0xe0e3('0x16')](/Empty\x20message

';if(_0x40ed0e['Attachments']){for(var _0x152761=0x0;_0x152761<_0x40ed0e[_0xe0e3('0x34')]['length'];_0x152761++){var _0x2f5f67=_0x40ed0e[_0xe0e3('0x34')][_0x152761];_0xd0778a[_0xe0e3('0x1a')][_0xe0e3('0x20')][_0xe0e3('0x35')]({'filename':_0x2f5f67['Title'],'content':new Buffer(_0x2f5f67[_0xe0e3('0x36')])});}}}_0x1613e3(parseEmail(_0x438261,_0x548d9b,_0xd0778a));});}else{_0x548d9b[_0xe0e3('0x14')]='

Empty\x20message

';_0x1613e3(parseEmail(_0x438261,_0x548d9b,_0xd0778a));}}else{_0x1613e3(parseEmail(_0x438261,_0x548d9b,_0xd0778a));}};exports[_0xe0e3('0x37')]=function(_0x90d7a){switch(_0x90d7a){case _0xe0e3('0x38'):return'imap.gmail.com';case _0xe0e3('0x39'):return'imap.mail.yahoo.com';case _0xe0e3('0x3a'):return'imap-mail.outlook.com';case'outlook365':return _0xe0e3('0x3b');}return _0xe0e3('0x3c');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 0851e59..cd0cfc2 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 _0x1604=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x4e9b9f,_0x2c2234){var _0x40252d=function(_0x3a16d3){while(--_0x3a16d3){_0x4e9b9f['push'](_0x4e9b9f['shift']());}};_0x40252d(++_0x2c2234);}(_0x1604,0x18c));var _0x4160=function(_0x571aed,_0x2156a8){_0x571aed=_0x571aed-0x0;var _0x2728b7=_0x1604[_0x571aed];return _0x2728b7;};'use strict';var _=require(_0x4160('0x0'));function MailAccount(_0x5ef900){this['id']=_0x5ef900['id']||0x0;this[_0x4160('0x1')]=_0x5ef900[_0x4160('0x1')]||_0x4160('0x2');this[_0x4160('0x3')]=_0x5ef900['key']||_0x4160('0x4');this[_0x4160('0x5')]=_0x5ef900[_0x4160('0x5')]||![];this[_0x4160('0x6')]=_0x5ef900['Imap']||[];this[_0x4160('0x7')]=_0x5ef900['Smtp']||[];}module[_0x4160('0x8')]=MailAccount; \ No newline at end of file +var _0x6cc3=['active','Smtp','lodash','name','Service','key','SERV'];(function(_0x4a0e68,_0x45c08c){var _0x4fb274=function(_0x5f36b1){while(--_0x5f36b1){_0x4a0e68['push'](_0x4a0e68['shift']());}};_0x4fb274(++_0x45c08c);}(_0x6cc3,0xdb));var _0x36cc=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0x6cc3[_0x3ebb69];return _0x421e59;};'use strict';var _=require(_0x36cc('0x0'));function MailAccount(_0x45dd36){this['id']=_0x45dd36['id']||0x0;this['name']=_0x45dd36[_0x36cc('0x1')]||_0x36cc('0x2');this[_0x36cc('0x3')]=_0x45dd36[_0x36cc('0x3')]||_0x36cc('0x4');this[_0x36cc('0x5')]=_0x45dd36[_0x36cc('0x5')]||![];this['Imap']=_0x45dd36['Imap']||[];this[_0x36cc('0x6')]=_0x45dd36[_0x36cc('0x6')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 63615c7..3bffbeb 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 _0xc1c6=['mapKeys','hasOwnProperty','mergeFromDatabase','prototype','length','merge','exports','lodash','../model/mailAccount','mailAccounts'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x153f96,_0x388800){_0x153f96=_0x153f96-0x0;var _0x1bd41e=_0xc1c6[_0x153f96];return _0x1bd41e;};'use strict';var _=require(_0x6c1c('0x0'));var MailAccount=require(_0x6c1c('0x1'));var Realtime=function(){this[_0x6c1c('0x2')]={};};function freeIsNotKey(_0x59f49a,_0x114c93,_0x4c33ca){var _0x426398=_[_0x6c1c('0x3')](_0x59f49a,function(_0x265d2c,_0x59f799){return _0x265d2c[_0x4c33ca];});for(var _0x56ed6f in _0x114c93){if(_0x114c93[_0x6c1c('0x4')](_0x56ed6f)){if(!_0x426398[_0x56ed6f]){delete _0x114c93[_0x56ed6f];}}}}Realtime['prototype'][_0x6c1c('0x5')]=function(_0x582bec,_0xe510ca){for(var _0x2eb1ba in _0xe510ca){if(_0x582bec[_0x6c1c('0x4')](_0x2eb1ba)){_0x582bec[_0x2eb1ba]=_0xe510ca[_0x2eb1ba];}}};Realtime[_0x6c1c('0x6')]['initMailAccounts']=function(){var _0x35f9ab=this;return function(_0x3ca985){if(_0x3ca985){freeIsNotKey(_0x3ca985,_0x35f9ab['mailAccounts'],'id');for(var _0x147c7b=0x0,_0x36275f={},_0xb3bd12={};_0x147c7b<_0x3ca985[_0x6c1c('0x7')];_0x147c7b+=0x1){_0x36275f=_0x3ca985[_0x147c7b];if(_['isUndefined'](_0x35f9ab[_0x6c1c('0x2')][_0x36275f['id']])){_0x35f9ab[_0x6c1c('0x2')][_0x36275f['id']]=new MailAccount(_0x36275f);}else{_[_0x6c1c('0x8')](_0x35f9ab['mailAccounts'][_0x36275f['id']],_0x36275f);}}}return _0x35f9ab[_0x6c1c('0x2')];};};module[_0x6c1c('0x9')]=Realtime; \ No newline at end of file +var _0xe5af=['length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','hasOwnProperty','prototype'];(function(_0x29bfe0,_0x43c952){var _0x1fca0a=function(_0x5ebe08){while(--_0x5ebe08){_0x29bfe0['push'](_0x29bfe0['shift']());}};_0x1fca0a(++_0x43c952);}(_0xe5af,0x9c));var _0xfe5a=function(_0xc26ee9,_0x125f39){_0xc26ee9=_0xc26ee9-0x0;var _0x989625=_0xe5af[_0xc26ee9];return _0x989625;};'use strict';var _=require('lodash');var MailAccount=require(_0xfe5a('0x0'));var Realtime=function(){this[_0xfe5a('0x1')]={};};function freeIsNotKey(_0x4b1845,_0x9a3743,_0x1bad12){var _0x23b7f0=_['mapKeys'](_0x4b1845,function(_0x1165e3,_0x48e3a7){return _0x1165e3[_0x1bad12];});for(var _0x526677 in _0x9a3743){if(_0x9a3743[_0xfe5a('0x2')](_0x526677)){if(!_0x23b7f0[_0x526677]){delete _0x9a3743[_0x526677];}}}}Realtime[_0xfe5a('0x3')]['mergeFromDatabase']=function(_0x5eea2e,_0x356c69){for(var _0x106492 in _0x356c69){if(_0x5eea2e[_0xfe5a('0x2')](_0x106492)){_0x5eea2e[_0x106492]=_0x356c69[_0x106492];}}};Realtime[_0xfe5a('0x3')]['initMailAccounts']=function(){var _0x37e2b0=this;return function(_0x5a48ff){if(_0x5a48ff){freeIsNotKey(_0x5a48ff,_0x37e2b0['mailAccounts'],'id');for(var _0x259e8a=0x0,_0x2cb946={},_0x543619={};_0x259e8a<_0x5a48ff[_0xfe5a('0x4')];_0x259e8a+=0x1){_0x2cb946=_0x5a48ff[_0x259e8a];if(_[_0xfe5a('0x5')](_0x37e2b0[_0xfe5a('0x1')][_0x2cb946['id']])){_0x37e2b0[_0xfe5a('0x1')][_0x2cb946['id']]=new MailAccount(_0x2cb946);}else{_[_0xfe5a('0x6')](_0x37e2b0['mailAccounts'][_0x2cb946['id']],_0x2cb946);}}}return _0x37e2b0[_0xfe5a('0x1')];};};module[_0xfe5a('0x7')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 28b63f1..425cff3 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 _0xd846=['Request','service','key','ListId','MailServerIn','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts'];(function(_0x27c159,_0x371301){var _0x33df79=function(_0x2ce655){while(--_0x2ce655){_0x27c159['push'](_0x27c159['shift']());}};_0x33df79(++_0x371301);}(_0xd846,0x195));var _0x6d84=function(_0x2b7012,_0xd5c727){_0x2b7012=_0x2b7012-0x0;var _0x474086=_0xd846[_0x2b7012];return _0x474086;};'use strict';var client=require(_0x6d84('0x0'));exports[_0x6d84('0x1')]=function(){return function(){return client[_0x6d84('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0x6d84('0x3'),'email','active',_0x6d84('0x4'),_0x6d84('0x5'),'TemplateId'],'raw':![],'include':[{'model':_0x6d84('0x6'),'as':'Imap'},{'model':'MailServerOut','as':_0x6d84('0x7')}]},'log':_0x6d84('0x8')});};};exports[_0x6d84('0x9')]=function(_0x3577cf,_0x20f36c){return client[_0x6d84('0x2')](_0x6d84('0xa'),{'account':{'id':_0x3577cf},'body':_0x20f36c,'log':_0x6d84('0xa')});}; \ No newline at end of file +var _0x7ff1=['ListId','Imap','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','service','email','key'];(function(_0x42e61b,_0x32eeb2){var _0x55d71d=function(_0x31c8e7){while(--_0x31c8e7){_0x42e61b['push'](_0x42e61b['shift']());}};_0x55d71d(++_0x32eeb2);}(_0x7ff1,0x93));var _0x17ff=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x7ff1[_0x525c7b];return _0x27b33e;};'use strict';var client=require('../client');exports[_0x17ff('0x0')]=function(){return function(){return client[_0x17ff('0x1')](_0x17ff('0x2'),{'options':{'attributes':['id',_0x17ff('0x3'),_0x17ff('0x4'),_0x17ff('0x5'),'active',_0x17ff('0x6'),_0x17ff('0x7'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0x17ff('0x8')},{'model':_0x17ff('0x9'),'as':_0x17ff('0xa')}]},'log':_0x17ff('0xb')});};};exports[_0x17ff('0xc')]=function(_0x570e2a,_0x423bc6){return client[_0x17ff('0x1')]('NotifyMailAccount',{'account':{'id':_0x570e2a},'body':_0x423bc6,'log':_0x17ff('0xd')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index dc67efa..81c5a14 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 _0x8710=['account','message','catch','error','verifySmtp','then','Verified','length','Imap','password','Smtp','http','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','../../../config/logger','email','listen','sendMail'];(function(_0x855f78,_0x43bbf4){var _0x32d0f0=function(_0x1617d8){while(--_0x1617d8){_0x855f78['push'](_0x855f78['shift']());}};_0x32d0f0(++_0x43bbf4);}(_0x8710,0x68));var _0x0871=function(_0x7c2b29,_0x24dbba){_0x7c2b29=_0x7c2b29-0x0;var _0x2b776d=_0x8710[_0x7c2b29];return _0x2b776d;};'use strict';var jayson=require(_0x0871('0x0'));var BPromise=require(_0x0871('0x1'));var _=require('lodash');var logger=require(_0x0871('0x2'))(_0x0871('0x3'));exports[_0x0871('0x4')]=function(_0x4c43f6,_0x2ac8cf){return new BPromise(function(_0x825b5,_0x48a450){var _0x3bd909={'SendMail':function(_0x4b70ec){var _0x32d76a=this;return new Promise(function(_0x42539c,_0x18b47f){_0x2ac8cf[_0x0871('0x5')](_0x4b70ec[_0x0871('0x6')],_0x4b70ec[_0x0871('0x7')])['then'](function(_0x111b05){_0x42539c({'code':0xc8,'message':_0x111b05});})[_0x0871('0x8')](function(_0x5e9ef){_0x18b47f(_0x32d76a[_0x0871('0x9')](0x1f4,_0x5e9ef));});});},'VerifySmtp':function(_0xd80c43){var _0x4df538=this;return new Promise(function(_0x8488f2,_0x34d018){_0x2ac8cf[_0x0871('0xa')](_0xd80c43[_0x0871('0x6')])[_0x0871('0xb')](function(_0x576a97){_0x8488f2({'code':0xc8,'message':_0x0871('0xc')});})[_0x0871('0x8')](function(_0xc94c7b){_0x34d018(_0x4df538[_0x0871('0x9')](0x1f4,_0xc94c7b));});});},'MailAccounts':function(_0x2b0031){return new Promise(function(_0xa58197,_0xe0925d){var _0x3b111e=_['values'](_0x4c43f6['mailAccounts']);for(var _0x34a51a=0x0;_0x34a51a<_0x3b111e[_0x0871('0xd')];_0x34a51a+=0x1){if(_0x3b111e[_0x34a51a][_0x0871('0xe')]&&_0x3b111e[_0x34a51a][_0x0871('0xe')][_0x0871('0xf')]){delete _0x3b111e[_0x34a51a][_0x0871('0xe')][_0x0871('0xf')];}if(_0x3b111e[_0x34a51a][_0x0871('0x10')]&&_0x3b111e[_0x34a51a][_0x0871('0x10')]['pass']){delete _0x3b111e[_0x34a51a][_0x0871('0x10')]['pass'];}}_0xa58197({'count':_0x3b111e[_0x0871('0xd')],'rows':_0x3b111e});});}};var _0x238d3a=jayson['server'](_0x3bd909)[_0x0871('0x11')]();_0x238d3a['on'](_0x0871('0x9'),function(_0x10ad02){logger[_0x0871('0x9')](JSON['stringify'](_0x10ad02));return _0x48a450(_0x10ad02);});_0x238d3a['listen'](0x232b,_0x0871('0x12'),function(){console[_0x0871('0x13')](_0x0871('0x14'),0x232b);return _0x825b5(_0x0871('0x15')+0x232b);});});}; \ No newline at end of file +var _0x793b=['Smtp','pass','length','server','http','stringify','listen','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','jayson/promise','bluebird','lodash','../../../config/logger','email','sendMail','account','message','then','catch','error','values','mailAccounts','Imap','password'];(function(_0xc52696,_0x3076ac){var _0x84b87a=function(_0x47be00){while(--_0x47be00){_0xc52696['push'](_0xc52696['shift']());}};_0x84b87a(++_0x3076ac);}(_0x793b,0x189));var _0xb793=function(_0x46ec37,_0x11382a){_0x46ec37=_0x46ec37-0x0;var _0x44a8dc=_0x793b[_0x46ec37];return _0x44a8dc;};'use strict';var jayson=require(_0xb793('0x0'));var BPromise=require(_0xb793('0x1'));var _=require(_0xb793('0x2'));var logger=require(_0xb793('0x3'))(_0xb793('0x4'));exports['listen']=function(_0x9a7c87,_0x18aa98){return new BPromise(function(_0x577e1c,_0x56ca69){var _0x28d672={'SendMail':function(_0x3cb1c8){var _0x322b07=this;return new Promise(function(_0x2b1f19,_0x39f110){_0x18aa98[_0xb793('0x5')](_0x3cb1c8[_0xb793('0x6')],_0x3cb1c8[_0xb793('0x7')])[_0xb793('0x8')](function(_0x1795b5){_0x2b1f19({'code':0xc8,'message':_0x1795b5});})[_0xb793('0x9')](function(_0x22c9ea){_0x39f110(_0x322b07[_0xb793('0xa')](0x1f4,_0x22c9ea));});});},'VerifySmtp':function(_0x1a34d0){var _0x4d9270=this;return new Promise(function(_0x259d3f,_0x3f0c30){_0x18aa98['verifySmtp'](_0x1a34d0['account'])[_0xb793('0x8')](function(_0x36d353){_0x259d3f({'code':0xc8,'message':'Verified'});})[_0xb793('0x9')](function(_0x2dd4ce){_0x3f0c30(_0x4d9270['error'](0x1f4,_0x2dd4ce));});});},'MailAccounts':function(_0x13d536){return new Promise(function(_0x164088,_0x100b9b){var _0x1f31ee=_[_0xb793('0xb')](_0x9a7c87[_0xb793('0xc')]);for(var _0x19d2cb=0x0;_0x19d2cb<_0x1f31ee['length'];_0x19d2cb+=0x1){if(_0x1f31ee[_0x19d2cb][_0xb793('0xd')]&&_0x1f31ee[_0x19d2cb]['Imap']['password']){delete _0x1f31ee[_0x19d2cb][_0xb793('0xd')][_0xb793('0xe')];}if(_0x1f31ee[_0x19d2cb][_0xb793('0xf')]&&_0x1f31ee[_0x19d2cb][_0xb793('0xf')][_0xb793('0x10')]){delete _0x1f31ee[_0x19d2cb][_0xb793('0xf')][_0xb793('0x10')];}}_0x164088({'count':_0x1f31ee[_0xb793('0x11')],'rows':_0x1f31ee});});}};var _0x977026=jayson[_0xb793('0x12')](_0x28d672)[_0xb793('0x13')]();_0x977026['on'](_0xb793('0xa'),function(_0xeb9559){logger[_0xb793('0xa')](JSON[_0xb793('0x14')](_0xeb9559));return _0x56ca69(_0xeb9559);});_0x977026[_0xb793('0x15')](0x232b,'127.0.0.1',function(){console[_0xb793('0x16')](_0xb793('0x17'),0x232b);return _0x577e1c('RPC\x20listening\x20on\x20port:'+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 3a7e188..e45f6d8 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 _0xe107=['adapter','../../config/socketio','default','../../config/express','../../routes','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','express','sticky-session','ioredis','createServer','port','socket.io','websocket','defaults','redis','localhost'];(function(_0x1d9895,_0x105948){var _0x3cfa53=function(_0xcf195d){while(--_0xcf195d){_0x1d9895['push'](_0x1d9895['shift']());}};_0x3cfa53(++_0x105948);}(_0xe107,0xb3));var _0x7e10=function(_0x127610,_0x452e73){_0x127610=_0x127610-0x0;var _0x17fd26=_0xe107[_0x127610];return _0x17fd26;};'use strict';var _=require(_0x7e10('0x0'));var http=require('http');var express=require(_0x7e10('0x1'));var sticky=require(_0x7e10('0x2'));var Redis=require(_0x7e10('0x3'));var config=require('../../config/environment');var app=express();var server=http[_0x7e10('0x4')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config[_0x7e10('0x5')])){var socketio=require(_0x7e10('0x6'))(server,{'transports':[_0x7e10('0x7'),'polling']});config['redis']=_[_0x7e10('0x8')](config[_0x7e10('0x9')],{'host':_0x7e10('0xa'),'port':0x18eb});socketio[_0x7e10('0xb')](require('socket.io-redis')({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x7e10('0x9')])}));require('../../config/triggers')['default']();require(_0x7e10('0xc'))[_0x7e10('0xd')](socketio);require(_0x7e10('0xe'))[_0x7e10('0xd')](app);require(_0x7e10('0xf'))['default'](app);}else{server[_0x7e10('0x10')]('listening',function(){console[_0x7e10('0x11')](_0x7e10('0x12'),config[_0x7e10('0x5')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xfe57=['localhost','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','lodash','http','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults'];(function(_0x5a477e,_0xa44c7f){var _0x580cbe=function(_0x10772a){while(--_0x10772a){_0x5a477e['push'](_0x5a477e['shift']());}};_0x580cbe(++_0xa44c7f);}(_0xfe57,0x195));var _0x7fe5=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xfe57[_0x58dc25];return _0x21b0a7;};'use strict';var _=require(_0x7fe5('0x0'));var http=require(_0x7fe5('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x7fe5('0x2'));var config=require(_0x7fe5('0x3'));var app=express();var server=http[_0x7fe5('0x4')](app);server[_0x7fe5('0x5')]=0xdbba0;if(sticky[_0x7fe5('0x6')](server,config[_0x7fe5('0x7')])){var socketio=require(_0x7fe5('0x8'))(server,{'transports':[_0x7fe5('0x9'),_0x7fe5('0xa')]});config[_0x7fe5('0xb')]=_[_0x7fe5('0xc')](config[_0x7fe5('0xb')],{'host':_0x7fe5('0xd'),'port':0x18eb});socketio['adapter'](require(_0x7fe5('0xe'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x7fe5('0xb')])}));require(_0x7fe5('0xf'))['default']();require('../../config/socketio')[_0x7fe5('0x10')](socketio);require(_0x7fe5('0x11'))['default'](app);require(_0x7fe5('0x12'))['default'](app);}else{server['once'](_0x7fe5('0x13'),function(){console[_0x7fe5('0x14')](_0x7fe5('0x15'),config[_0x7fe5('0x7')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 9a73baf..b9f02c7 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 _0x8ccb=['client','http','Request','request','debug','rpc','error','message','result','catch','jayson/promise','bluebird','routing'];(function(_0xe69bf1,_0x487cbc){var _0x1259d1=function(_0x5e610d){while(--_0x5e610d){_0xe69bf1['push'](_0xe69bf1['shift']());}};_0x1259d1(++_0x487cbc);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x47adb8,_0x591ccc){_0x47adb8=_0x47adb8-0x0;var _0x4689a8=_0x8ccb[_0x47adb8];return _0x4689a8;};'use strict';var jayson=require(_0xb8cc('0x0'));var BPromise=require(_0xb8cc('0x1'));var logger=require('../../config/logger')(_0xb8cc('0x2'));var client=jayson[_0xb8cc('0x3')][_0xb8cc('0x4')]({'port':0x2329});client[_0xb8cc('0x5')]=function(_0x5ede44,_0x4e1ed7){return new BPromise(function(_0x115fdc,_0x3672bc){return client[_0xb8cc('0x6')](_0x5ede44,_0x4e1ed7)['then'](function(_0x46ac6e){logger[_0xb8cc('0x7')](_0xb8cc('0x8'),'routing',_0x5ede44,_0x4e1ed7,_0x46ac6e);if(_0x46ac6e[_0xb8cc('0x9')]){logger[_0xb8cc('0x9')](_0xb8cc('0x8'),'routing',_0x5ede44,_0x46ac6e[_0xb8cc('0x9')][_0xb8cc('0xa')],_0x4e1ed7);return _0x3672bc(_0x46ac6e['error']['message']);}else{return _0x115fdc(_0x46ac6e[_0xb8cc('0xb')]);}})[_0xb8cc('0xc')](function(_0x57522f){logger['error'](_0xb8cc('0x8'),_0xb8cc('0x2'),_0x5ede44,_0x57522f,_0x4e1ed7);return _0x3672bc(_0x57522f);});});};module['exports']=client; \ No newline at end of file +var _0x818f=['request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http'];(function(_0x496eac,_0x3150c9){var _0x59fc7d=function(_0x239538){while(--_0x239538){_0x496eac['push'](_0x496eac['shift']());}};_0x59fc7d(++_0x3150c9);}(_0x818f,0x1da));var _0xf818=function(_0x97785c,_0x368eb8){_0x97785c=_0x97785c-0x0;var _0x3de899=_0x818f[_0x97785c];return _0x3de899;};'use strict';var jayson=require(_0xf818('0x0'));var BPromise=require(_0xf818('0x1'));var logger=require(_0xf818('0x2'))(_0xf818('0x3'));var client=jayson[_0xf818('0x4')][_0xf818('0x5')]({'port':0x2329});client['Request']=function(_0x240fdb,_0xd6c86){return new BPromise(function(_0x2c1bb0,_0x2c6dd0){return client[_0xf818('0x6')](_0x240fdb,_0xd6c86)[_0xf818('0x7')](function(_0x27119b){logger[_0xf818('0x8')](_0xf818('0x9'),'routing',_0x240fdb,_0xd6c86,_0x27119b);if(_0x27119b[_0xf818('0xa')]){logger[_0xf818('0xa')](_0xf818('0x9'),'routing',_0x240fdb,_0x27119b['error'][_0xf818('0xb')],_0xd6c86);return _0x2c6dd0(_0x27119b[_0xf818('0xa')][_0xf818('0xb')]);}else{return _0x2c1bb0(_0x27119b[_0xf818('0xc')]);}})[_0xf818('0xd')](function(_0x4accdc){logger[_0xf818('0xa')](_0xf818('0x9'),_0xf818('0x3'),_0x240fdb,_0x4accdc,_0xd6c86);return _0x2c6dd0(_0x4accdc);});});};module[_0xf818('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 96dfaae..516138a 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 _0xc8b7=['then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','listen','bluebird','./server','./realtime','./rpc/user','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','resolve'];(function(_0xcddd43,_0x17c9f0){var _0xdf5a53=function(_0x33ba75){while(--_0x33ba75){_0xcddd43['push'](_0xcddd43['shift']());}};_0xdf5a53(++_0x17c9f0);}(_0xc8b7,0x1bf));var _0x7c8b=function(_0x184918,_0x355722){_0x184918=_0x184918-0x0;var _0x9aacb5=_0xc8b7[_0x184918];return _0x9aacb5;};'use strict';var BPromise=require(_0x7c8b('0x0'));var server=require(_0x7c8b('0x1'));var Realtime=require(_0x7c8b('0x2'));var user=require(_0x7c8b('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x7c8b('0x4'));var smsQueue=require(_0x7c8b('0x5'));var mailQueue=require(_0x7c8b('0x6'));var faxQueue=require(_0x7c8b('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7c8b('0x8')]()[_0x7c8b('0x9')](user[_0x7c8b('0xa')]())['then'](realtime[_0x7c8b('0xb')]())['then'](interval[_0x7c8b('0xc')]())[_0x7c8b('0x9')](realtime[_0x7c8b('0xd')]())[_0x7c8b('0x9')](openchannelQueue[_0x7c8b('0xe')]())['then'](realtime[_0x7c8b('0xf')]())[_0x7c8b('0x9')](chatQueue['getChatQueues']())[_0x7c8b('0x9')](realtime[_0x7c8b('0x10')]())['then'](smsQueue[_0x7c8b('0x11')]())[_0x7c8b('0x9')](realtime[_0x7c8b('0x12')]())[_0x7c8b('0x9')](mailQueue[_0x7c8b('0x13')]())[_0x7c8b('0x9')](realtime[_0x7c8b('0x14')]())[_0x7c8b('0x9')](faxQueue[_0x7c8b('0x15')]())['then'](realtime[_0x7c8b('0x16')]())[_0x7c8b('0x9')](function(){return realtime;});}function main(){return server[_0x7c8b('0x17')](realtime)[_0x7c8b('0x9')](function(_0x375a07){return initRealtime();})[_0x7c8b('0x9')](function(_0x231005){return setInterval(initRealtime,0x1388);})['catch'](function(_0x18aff3){console['log'](_0x18aff3);});}main(); \ No newline at end of file +var _0x1919=['./rpc/faxQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getSmsQueues','getMailQueues','initMailQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1919,0x1b0));var _0x9191=function(_0x555e2c,_0x3bdee1){_0x555e2c=_0x555e2c-0x0;var _0x2fba07=_0x1919[_0x555e2c];return _0x2fba07;};'use strict';var BPromise=require(_0x9191('0x0'));var server=require(_0x9191('0x1'));var Realtime=require(_0x9191('0x2'));var user=require('./rpc/user');var interval=require(_0x9191('0x3'));var openchannelQueue=require(_0x9191('0x4'));var chatQueue=require(_0x9191('0x5'));var smsQueue=require(_0x9191('0x6'));var mailQueue=require(_0x9191('0x7'));var faxQueue=require(_0x9191('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9191('0x9')]()['then'](user[_0x9191('0xa')]())[_0x9191('0xb')](realtime[_0x9191('0xc')]())[_0x9191('0xb')](interval[_0x9191('0xd')]())[_0x9191('0xb')](realtime[_0x9191('0xe')]())[_0x9191('0xb')](openchannelQueue[_0x9191('0xf')]())[_0x9191('0xb')](realtime['initOpenchannelQueues']())[_0x9191('0xb')](chatQueue['getChatQueues']())[_0x9191('0xb')](realtime['initChatQueues']())[_0x9191('0xb')](smsQueue[_0x9191('0x10')]())[_0x9191('0xb')](realtime['initSmsQueues']())[_0x9191('0xb')](mailQueue[_0x9191('0x11')]())['then'](realtime[_0x9191('0x12')]())[_0x9191('0xb')](faxQueue['getFaxQueues']())[_0x9191('0xb')](realtime['initFaxQueues']())[_0x9191('0xb')](function(){return realtime;});}function main(){return server[_0x9191('0x13')](realtime)[_0x9191('0xb')](function(_0x40aec0){return initRealtime();})[_0x9191('0xb')](function(_0x5156c4){return setInterval(initRealtime,0x1388);})[_0x9191('0x14')](function(_0x3a700){console[_0x9191('0x15')](_0x3a700);});}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 a2d570a..9cc2f98 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 _0x8170=['parse','exports','events','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','push','sync','filter','orderBy','asc','execute','result','clone','consequence','index_','nextTick','ruleRef','next','isEqual','restart','length','condition','call','noop','findRules','matches','turn','prioritize','priority','map','toString','fromJSON','isString'];(function(_0x143759,_0x249c49){var _0x4582be=function(_0x5b9462){while(--_0x5b9462){_0x143759['push'](_0x143759['shift']());}};_0x4582be(++_0x249c49);}(_0x8170,0x128));var _0x0817=function(_0x328995,_0x5a01ee){_0x328995=_0x328995-0x0;var _0x4cd86a=_0x8170[_0x328995];return _0x4cd86a;};'use strict';var _=require('lodash');var util=require('util');var EventEmitter=require(_0x0817('0x0'))[_0x0817('0x1')];function RuleEngine(_0x7e4842,_0x5803cf){this[_0x0817('0x2')]();if(!_[_0x0817('0x3')](_0x7e4842)){this[_0x0817('0x4')](_0x7e4842);}if(_0x5803cf){this[_0x0817('0x5')]=_0x5803cf['ignoreFactChanges'];}return this;}util[_0x0817('0x6')](RuleEngine,EventEmitter);RuleEngine[_0x0817('0x7')][_0x0817('0x2')]=function(_0x56f767){this[_0x0817('0x8')]=[];this[_0x0817('0x9')]=[];};RuleEngine[_0x0817('0x7')][_0x0817('0x4')]=function(_0x5cae66){if(Array['isArray'](_0x5cae66)){this[_0x0817('0x8')]=this[_0x0817('0x8')][_0x0817('0xa')](_0x5cae66);}else if(_0x5cae66!==null&&_[_0x0817('0xb')](_0x5cae66)){this['rules'][_0x0817('0xc')](_0x5cae66);}this[_0x0817('0xd')]();};RuleEngine[_0x0817('0x7')]['sync']=function(){this[_0x0817('0x9')]=this[_0x0817('0x8')][_0x0817('0xe')](function(_0x29ace2){if(_[_0x0817('0x3')](_0x29ace2['on'])){_0x29ace2['on']=!![];}if(_0x29ace2['on']===!![]){return _0x29ace2;}});this[_0x0817('0x9')]=_[_0x0817('0xf')](this['activeRules'],['p'],[_0x0817('0x10')]);};RuleEngine['prototype'][_0x0817('0x11')]=function(_0x41c864,_0x3b1e55){var _0x26f650=![];_0x41c864[_0x0817('0x12')]=!![];var _0x51a900=_['clone'](_0x41c864);var _0xde2cc0=_[_0x0817('0x13')](_0x41c864);var _0x4b0f1e=this[_0x0817('0x9')];var _0x5827d7=[];var _0x296a21=this[_0x0817('0x5')];(function FnRuleLoop(_0x54c3ec){var _0x4e3402={'rules':function(){return _0x4b0f1e;},'rule':function(){return _0x4b0f1e[_0x54c3ec];},'when':function(_0x39c701){if(_0x39c701){var _0x63d5ee=_0x4b0f1e[_0x54c3ec][_0x0817('0x14')];_0x63d5ee['ruleRef']=_0x4b0f1e[_0x54c3ec]['id']||_0x4b0f1e[_0x54c3ec]['name']||_0x0817('0x15')+_0x54c3ec;process[_0x0817('0x16')](function(){_0x5827d7[_0x0817('0xc')](_0x63d5ee[_0x0817('0x17')]);_0x63d5ee['call'](_0x51a900,_0x4e3402);});}else{process[_0x0817('0x16')](function(){_0x4e3402[_0x0817('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x26f650=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc5d7){if(!_0x296a21&&!_[_0x0817('0x19')](_0xde2cc0,_0x51a900)){_0xde2cc0=_['clone'](_0x51a900);process[_0x0817('0x16')](function(){_0x4e3402[_0x0817('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x0817('0x3')](_0x5cc5d7)){return FnRuleLoop(_0x54c3ec+0x1);}else{return FnRuleLoop(_0x5cc5d7);}});}}};if(_0x54c3ec<_0x4b0f1e[_0x0817('0x1b')]&&_0x26f650===![]){var _0x4a0533=_0x4b0f1e[_0x54c3ec][_0x0817('0x1c')];_0x4a0533[_0x0817('0x1d')](_0x51a900,_0x4e3402);}else{process[_0x0817('0x16')](function(){_0x51a900['matchPath']=_0x5827d7;return _0x3b1e55?_0x3b1e55(_0x51a900):_[_0x0817('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x0817('0x1f')]=function(_0x3894af){if(_['isNil'](_0x3894af)){return this[_0x0817('0x8')];}else{var _0x3072e4=_[_0x0817('0x20')](_0x3894af);return _['filter'](this[_0x0817('0x8')],_0x3072e4);}};RuleEngine[_0x0817('0x7')][_0x0817('0x21')]=function(_0x562fc1,_0x124ccc){var _0x562fc1=_0x562fc1==='on'||_0x562fc1==='ON'?!![]:![];var _0x47bcdd=this[_0x0817('0x1f')](_0x124ccc);for(var _0x352458=0x0,_0x12ae7d=_0x47bcdd['length'];_0x352458<_0x12ae7d;_0x352458+=0x1){_0x47bcdd[_0x352458]['on']=_0x562fc1;}this[_0x0817('0xd')]();};RuleEngine[_0x0817('0x7')][_0x0817('0x22')]=function(_0x278df1,_0x1d383a){_0x278df1=parseInt(_0x278df1,0xa);var _0x3c9786=this[_0x0817('0x1f')](_0x1d383a);for(var _0x1c12a=0x0,_0x30434f=_0x3c9786[_0x0817('0x1b')];_0x1c12a<_0x30434f;_0x1c12a+=0x1){_0x3c9786[_0x1c12a][_0x0817('0x23')]=_0x278df1;}this[_0x0817('0xd')]();};RuleEngine[_0x0817('0x7')]['toJSON']=function(){var _0x1ba329=this['rules'];if(_0x1ba329 instanceof Array){_0x1ba329=_0x1ba329[_0x0817('0x24')](function(_0x6f9dcf){_0x6f9dcf[_0x0817('0x1c')]=_0x6f9dcf[_0x0817('0x1c')][_0x0817('0x25')]();_0x6f9dcf['consequence']=_0x6f9dcf[_0x0817('0x14')][_0x0817('0x25')]();return _0x6f9dcf;});}else if(!_[_0x0817('0x3')](_0x1ba329)){_0x1ba329['condition']=_0x1ba329[_0x0817('0x1c')][_0x0817('0x25')]();_0x1ba329[_0x0817('0x14')]=_0x1ba329[_0x0817('0x14')]['toString']();}return _0x1ba329;};RuleEngine[_0x0817('0x7')][_0x0817('0x26')]=function(_0x4bfb52){this[_0x0817('0x2')]();if(_[_0x0817('0x27')](_0x4bfb52)){_0x4bfb52=JSON[_0x0817('0x28')](_0x4bfb52);}if(_0x4bfb52 instanceof Array){_0x4bfb52=_0x4bfb52['map'](function(_0x8d63c1){_0x8d63c1['condition']=eval('('+_0x8d63c1[_0x0817('0x1c')]+')');_0x8d63c1[_0x0817('0x14')]=eval('('+_0x8d63c1[_0x0817('0x14')]+')');return _0x8d63c1;});}else if(_0x4bfb52!==null&&typeof _0x4bfb52=='object'){_0x4bfb52[_0x0817('0x1c')]=eval('('+_0x4bfb52[_0x0817('0x1c')]+')');_0x4bfb52[_0x0817('0x14')]=eval('('+_0x4bfb52[_0x0817('0x14')]+')');}this['register'](_0x4bfb52);};module[_0x0817('0x29')]=RuleEngine; \ No newline at end of file +var _0x5bf5=['concat','isObject','push','sync','activeRules','filter','isNil','asc','execute','result','clone','consequence','ruleRef','name','nextTick','call','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','parse','map','object','lodash','init','register','ignoreFactChanges','inherits','prototype','isArray','rules'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x5bf5,0x138));var _0x55bf=function(_0x49b569,_0x1095b6){_0x49b569=_0x49b569-0x0;var _0x3e1741=_0x5bf5[_0x49b569];return _0x3e1741;};'use strict';var _=require(_0x55bf('0x0'));var util=require('util');var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x43b157,_0x204d29){this[_0x55bf('0x1')]();if(!_['isNil'](_0x43b157)){this[_0x55bf('0x2')](_0x43b157);}if(_0x204d29){this[_0x55bf('0x3')]=_0x204d29[_0x55bf('0x3')];}return this;}util[_0x55bf('0x4')](RuleEngine,EventEmitter);RuleEngine[_0x55bf('0x5')][_0x55bf('0x1')]=function(_0x5cc36b){this['rules']=[];this['activeRules']=[];};RuleEngine[_0x55bf('0x5')]['register']=function(_0xccc118){if(Array[_0x55bf('0x6')](_0xccc118)){this['rules']=this[_0x55bf('0x7')][_0x55bf('0x8')](_0xccc118);}else if(_0xccc118!==null&&_[_0x55bf('0x9')](_0xccc118)){this[_0x55bf('0x7')][_0x55bf('0xa')](_0xccc118);}this[_0x55bf('0xb')]();};RuleEngine['prototype'][_0x55bf('0xb')]=function(){this[_0x55bf('0xc')]=this[_0x55bf('0x7')][_0x55bf('0xd')](function(_0x116bd5){if(_[_0x55bf('0xe')](_0x116bd5['on'])){_0x116bd5['on']=!![];}if(_0x116bd5['on']===!![]){return _0x116bd5;}});this['activeRules']=_['orderBy'](this[_0x55bf('0xc')],['p'],[_0x55bf('0xf')]);};RuleEngine['prototype'][_0x55bf('0x10')]=function(_0x4f37a9,_0x1a9fb5){var _0xc33b23=![];_0x4f37a9[_0x55bf('0x11')]=!![];var _0x5287ba=_[_0x55bf('0x12')](_0x4f37a9);var _0x4098ba=_[_0x55bf('0x12')](_0x4f37a9);var _0x25d91c=this[_0x55bf('0xc')];var _0x166864=[];var _0x58357b=this['ignoreFactChanges'];(function FnRuleLoop(_0x1fecb4){var _0x3878cc={'rules':function(){return _0x25d91c;},'rule':function(){return _0x25d91c[_0x1fecb4];},'when':function(_0x23115c){if(_0x23115c){var _0x4527e3=_0x25d91c[_0x1fecb4][_0x55bf('0x13')];_0x4527e3[_0x55bf('0x14')]=_0x25d91c[_0x1fecb4]['id']||_0x25d91c[_0x1fecb4][_0x55bf('0x15')]||'index_'+_0x1fecb4;process[_0x55bf('0x16')](function(){_0x166864[_0x55bf('0xa')](_0x4527e3[_0x55bf('0x14')]);_0x4527e3[_0x55bf('0x17')](_0x5287ba,_0x3878cc);});}else{process[_0x55bf('0x16')](function(){_0x3878cc['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0xc33b23=!![];return FnRuleLoop(0x0);},'next':function(_0x664058){if(!_0x58357b&&!_['isEqual'](_0x4098ba,_0x5287ba)){_0x4098ba=_[_0x55bf('0x12')](_0x5287ba);process[_0x55bf('0x16')](function(){_0x3878cc[_0x55bf('0x18')]();});}else{process[_0x55bf('0x16')](function(){if(_[_0x55bf('0xe')](_0x664058)){return FnRuleLoop(_0x1fecb4+0x1);}else{return FnRuleLoop(_0x664058);}});}}};if(_0x1fecb4<_0x25d91c[_0x55bf('0x19')]&&_0xc33b23===![]){var _0x2e837d=_0x25d91c[_0x1fecb4][_0x55bf('0x1a')];_0x2e837d[_0x55bf('0x17')](_0x5287ba,_0x3878cc);}else{process['nextTick'](function(){_0x5287ba[_0x55bf('0x1b')]=_0x166864;return _0x1a9fb5?_0x1a9fb5(_0x5287ba):_[_0x55bf('0x1c')]();});}}(0x0));};RuleEngine[_0x55bf('0x5')][_0x55bf('0x1d')]=function(_0x1541db){if(_[_0x55bf('0xe')](_0x1541db)){return this[_0x55bf('0x7')];}else{var _0x34a615=_[_0x55bf('0x1e')](_0x1541db);return _[_0x55bf('0xd')](this['rules'],_0x34a615);}};RuleEngine['prototype'][_0x55bf('0x1f')]=function(_0x56234e,_0x1360f7){var _0x56234e=_0x56234e==='on'||_0x56234e==='ON'?!![]:![];var _0x208226=this[_0x55bf('0x1d')](_0x1360f7);for(var _0x36ccbb=0x0,_0x1a3dcd=_0x208226[_0x55bf('0x19')];_0x36ccbb<_0x1a3dcd;_0x36ccbb+=0x1){_0x208226[_0x36ccbb]['on']=_0x56234e;}this[_0x55bf('0xb')]();};RuleEngine['prototype'][_0x55bf('0x20')]=function(_0x11b06f,_0x3a218a){_0x11b06f=parseInt(_0x11b06f,0xa);var _0x54abdd=this[_0x55bf('0x1d')](_0x3a218a);for(var _0x34b051=0x0,_0x136210=_0x54abdd['length'];_0x34b051<_0x136210;_0x34b051+=0x1){_0x54abdd[_0x34b051][_0x55bf('0x21')]=_0x11b06f;}this['sync']();};RuleEngine[_0x55bf('0x5')][_0x55bf('0x22')]=function(){var _0x446e46=this[_0x55bf('0x7')];if(_0x446e46 instanceof Array){_0x446e46=_0x446e46['map'](function(_0x5db6ca){_0x5db6ca['condition']=_0x5db6ca[_0x55bf('0x1a')][_0x55bf('0x23')]();_0x5db6ca[_0x55bf('0x13')]=_0x5db6ca[_0x55bf('0x13')][_0x55bf('0x23')]();return _0x5db6ca;});}else if(!_[_0x55bf('0xe')](_0x446e46)){_0x446e46[_0x55bf('0x1a')]=_0x446e46['condition'][_0x55bf('0x23')]();_0x446e46[_0x55bf('0x13')]=_0x446e46[_0x55bf('0x13')][_0x55bf('0x23')]();}return _0x446e46;};RuleEngine[_0x55bf('0x5')][_0x55bf('0x24')]=function(_0x292f52){this['init']();if(_['isString'](_0x292f52)){_0x292f52=JSON[_0x55bf('0x25')](_0x292f52);}if(_0x292f52 instanceof Array){_0x292f52=_0x292f52[_0x55bf('0x26')](function(_0x39735b){_0x39735b[_0x55bf('0x1a')]=eval('('+_0x39735b['condition']+')');_0x39735b[_0x55bf('0x13')]=eval('('+_0x39735b[_0x55bf('0x13')]+')');return _0x39735b;});}else if(_0x292f52!==null&&typeof _0x292f52==_0x55bf('0x27')){_0x292f52[_0x55bf('0x1a')]=eval('('+_0x292f52[_0x55bf('0x1a')]+')');_0x292f52['consequence']=eval('('+_0x292f52[_0x55bf('0x13')]+')');}this[_0x55bf('0x2')](_0x292f52);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index b377431..4340917 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x41ac5a,_0xd0b667){var _0x5a497a=function(_0x385d8c){while(--_0x385d8c){_0x41ac5a['push'](_0x41ac5a['shift']());}};_0x5a497a(++_0xd0b667);}(_0x814b,0x1a2));var _0xb814=function(_0x2383bc,_0x2d5ec9){_0x2383bc=_0x2383bc-0x0;var _0x283573=_0x814b[_0x2383bc];return _0x283573;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x475d6c,_0x5e8c4b){var _0x12c230=function(_0x255873){while(--_0x255873){_0x475d6c['push'](_0x475d6c['shift']());}};_0x12c230(++_0x5e8c4b);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index ce33b36..6816282 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 _0x9dfc=['StatusTime','toNumber','format','Status','mailStatus','mailCurrentCapacity','exports','lodash','md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','openchannel','fax','sms'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9dfc,0x71));var _0xc9df=function(_0x403f4a,_0xe94209){_0x403f4a=_0x403f4a-0x0;var _0x58537f=_0x9dfc[_0x403f4a];return _0x58537f;};'use strict';var _=require(_0xc9df('0x0'));var moment=require('moment');var md5=require(_0xc9df('0x1'));var Redis=require(_0xc9df('0x2'));var config=require(_0xc9df('0x3'));config['redis']=_[_0xc9df('0x4')](config['redis'],{'host':_0xc9df('0x5'),'port':0x18eb});var io=require(_0xc9df('0x6'))(new Redis(config[_0xc9df('0x7')]));function Agent(_0x164a2f){this['id']=_0x164a2f['id']||0x0;this['name']=_0x164a2f[_0xc9df('0x8')]||'';this[_0xc9df('0x9')]=_0x164a2f[_0xc9df('0x9')]||!![];this[_0xc9df('0xa')]=_0x164a2f['voicePause']||![];this[_0xc9df('0xb')]=_0x164a2f[_0xc9df('0xb')]||![];this[_0xc9df('0xc')]=_0x164a2f[_0xc9df('0xc')]||![];this[_0xc9df('0xd')]=_0x164a2f[_0xc9df('0xd')]||![];this[_0xc9df('0xe')]=_0x164a2f['smsPause']||![];this[_0xc9df('0xf')]=_0x164a2f[_0xc9df('0xf')]||![];this[_0xc9df('0x10')]=_0xc9df('0x11');this[_0xc9df('0x12')]=0x0;this[_0xc9df('0x13')]=_0x164a2f[_0xc9df('0x13')]||0x0;this[_0xc9df('0x14')]=0x0;this['mailStatus']=_0xc9df('0x11');this[_0xc9df('0x15')]=0x0;this[_0xc9df('0x16')]=_0x164a2f[_0xc9df('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xc9df('0x17')]='unknown';this[_0xc9df('0x18')]=0x0;this[_0xc9df('0x19')]=_0x164a2f[_0xc9df('0x19')]||0x0;this[_0xc9df('0x1a')]=0x0;this[_0xc9df('0x1b')]=_0xc9df('0x11');this[_0xc9df('0x1c')]=0x0;this[_0xc9df('0x1d')]=_0x164a2f[_0xc9df('0x1d')]||0x0;this[_0xc9df('0x1e')]=0x0;this[_0xc9df('0x1f')]=_0xc9df('0x11');this[_0xc9df('0x20')]=0x0;this[_0xc9df('0x21')]=_0x164a2f[_0xc9df('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xc9df('0x22')]=![];this['busyQueue']=undefined;this[_0xc9df('0x1')]='';this[_0xc9df('0x23')]();}Agent[_0xc9df('0x24')][_0xc9df('0x25')]=function(_0x177f23){if(this[_0x177f23+_0xc9df('0x26')]>0x0){if(this[_0x177f23+_0xc9df('0x27')]>0x0&&this[_0x177f23+_0xc9df('0x26')]>=this[_0x177f23+_0xc9df('0x27')]){return _0xc9df('0x28');}else{return _0xc9df('0x29');}}else{return _0xc9df('0x2a');}};Agent[_0xc9df('0x24')][_0xc9df('0x23')]=function(){var _0x5e7573=['mail','chat',_0xc9df('0x2b'),_0xc9df('0x2c'),_0xc9df('0x2d')];for(var _0x296d17=0x0;_0x296d17<_0x5e7573['length'];_0x296d17+=0x1){var _0x1f34b5=this[_0xc9df('0x25')](_0x5e7573[_0x296d17]);if(this[_0x5e7573[_0x296d17]+'Status']!==_0x1f34b5){this[_0x5e7573[_0x296d17]+_0xc9df('0x2e')]=_[_0xc9df('0x2f')](moment()[_0xc9df('0x30')]('x'));}this[_0x5e7573[_0x296d17]+_0xc9df('0x31')]=_0x1f34b5;}var _0x266b5c={'id':this['id'],'name':this[_0xc9df('0x8')],'online':this[_0xc9df('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0xc9df('0xb')],'mailPause':this['mailPause'],'smsPause':this[_0xc9df('0xe')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xc9df('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0xc9df('0x14')],'mailStatus':this[_0xc9df('0x32')],'mailStatusTime':this[_0xc9df('0x15')],'mailCapacity':this[_0xc9df('0x16')],'mailCurrentCapacity':this[_0xc9df('0x33')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0xc9df('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0xc9df('0x1b')],'smsStatusTime':this[_0xc9df('0x1c')],'smsCapacity':this[_0xc9df('0x1d')],'smsCurrentCapacity':this[_0xc9df('0x1e')],'openchannelStatus':this[_0xc9df('0x1f')],'openchannelStatusTime':this[_0xc9df('0x20')],'openchannelCapacity':this[_0xc9df('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x102ef7=md5(JSON['stringify'](_0x266b5c));if(this[_0xc9df('0x1')]!==_0x102ef7){this[_0xc9df('0x1')]=_0x102ef7;io['emit']('user:save',_0x266b5c);}};module[_0xc9df('0x34')]=Agent; \ No newline at end of file +var _0x2609=['stringify','user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','faxStatus','faxStatusTime','smsStatus','smsCapacity','openchannelStatus','openchannelCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','idle','mail','chat','fax','length','Status','toNumber','mailStatus','mailCapacity','mailCurrentCapacity','faxCapacity','faxCurrentCapacity','smsStatusTime','openchannelStatusTime','busy'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2609,0xa2));var _0x9260=function(_0x5d592e,_0x1c4721){_0x5d592e=_0x5d592e-0x0;var _0x17da9d=_0x2609[_0x5d592e];return _0x17da9d;};'use strict';var _=require(_0x9260('0x0'));var moment=require(_0x9260('0x1'));var md5=require(_0x9260('0x2'));var Redis=require(_0x9260('0x3'));var config=require(_0x9260('0x4'));config[_0x9260('0x5')]=_[_0x9260('0x6')](config[_0x9260('0x5')],{'host':_0x9260('0x7'),'port':0x18eb});var io=require(_0x9260('0x8'))(new Redis(config[_0x9260('0x5')]));function Agent(_0x35eb75){this['id']=_0x35eb75['id']||0x0;this[_0x9260('0x9')]=_0x35eb75['name']||'';this[_0x9260('0xa')]=_0x35eb75[_0x9260('0xa')]||!![];this['voicePause']=_0x35eb75[_0x9260('0xb')]||![];this['chatPause']=_0x35eb75[_0x9260('0xc')]||![];this[_0x9260('0xd')]=_0x35eb75['mailPause']||![];this['faxPause']=_0x35eb75[_0x9260('0xe')]||![];this[_0x9260('0xf')]=_0x35eb75['smsPause']||![];this[_0x9260('0x10')]=_0x35eb75[_0x9260('0x10')]||![];this[_0x9260('0x11')]=_0x9260('0x12');this[_0x9260('0x13')]=0x0;this['chatCapacity']=_0x35eb75[_0x9260('0x14')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']='unknown';this[_0x9260('0x15')]=0x0;this['mailCapacity']=_0x35eb75['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x9260('0x16')]=_0x9260('0x12');this[_0x9260('0x17')]=0x0;this['faxCapacity']=_0x35eb75['faxCapacity']||0x0;this['faxCurrentCapacity']=0x0;this[_0x9260('0x18')]=_0x9260('0x12');this['smsStatusTime']=0x0;this['smsCapacity']=_0x35eb75[_0x9260('0x19')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x9260('0x1a')]=_0x9260('0x12');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x35eb75[_0x9260('0x1b')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x9260('0x1c')]=undefined;this[_0x9260('0x2')]='';this[_0x9260('0x1d')]();}Agent[_0x9260('0x1e')][_0x9260('0x1f')]=function(_0x441d0a){if(this[_0x441d0a+'CurrentCapacity']>0x0){if(this[_0x441d0a+_0x9260('0x20')]>0x0&&this[_0x441d0a+_0x9260('0x21')]>=this[_0x441d0a+_0x9260('0x20')]){return _0x9260('0x22');}else{return'working';}}else{return _0x9260('0x23');}};Agent[_0x9260('0x1e')][_0x9260('0x1d')]=function(){var _0x65672f=[_0x9260('0x24'),_0x9260('0x25'),'openchannel',_0x9260('0x26'),'sms'];for(var _0x39f9c3=0x0;_0x39f9c3<_0x65672f[_0x9260('0x27')];_0x39f9c3+=0x1){var _0x521d4e=this[_0x9260('0x1f')](_0x65672f[_0x39f9c3]);if(this[_0x65672f[_0x39f9c3]+_0x9260('0x28')]!==_0x521d4e){this[_0x65672f[_0x39f9c3]+'StatusTime']=_[_0x9260('0x29')](moment()['format']('x'));}this[_0x65672f[_0x39f9c3]+_0x9260('0x28')]=_0x521d4e;}var _0x364459={'id':this['id'],'name':this[_0x9260('0x9')],'online':this[_0x9260('0xa')],'voicePause':this['voicePause'],'chatPause':this[_0x9260('0xc')],'mailPause':this[_0x9260('0xd')],'smsPause':this[_0x9260('0xf')],'faxPause':this['faxPause'],'openchannelPause':this[_0x9260('0x10')],'chatStatus':this[_0x9260('0x11')],'chatStatusTime':this[_0x9260('0x13')],'chatCapacity':this[_0x9260('0x14')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x9260('0x2a')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x9260('0x2b')],'mailCurrentCapacity':this[_0x9260('0x2c')],'faxStatus':this[_0x9260('0x16')],'faxStatusTime':this[_0x9260('0x17')],'faxCapacity':this[_0x9260('0x2d')],'faxCurrentCapacity':this[_0x9260('0x2e')],'smsStatus':this[_0x9260('0x18')],'smsStatusTime':this[_0x9260('0x2f')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x9260('0x30')],'openchannelCapacity':this[_0x9260('0x1b')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x9260('0x31')],'busyQueue':this[_0x9260('0x1c')]};var _0x2e694b=md5(JSON[_0x9260('0x32')](_0x364459));if(this[_0x9260('0x2')]!==_0x2e694b){this[_0x9260('0x2')]=_0x2e694b;io['emit'](_0x9260('0x33'),_0x364459);}};module[_0x9260('0x34')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 58724e1..66d7fd9 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 _0x918f=['localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','Agents','loggedIn','length','online','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','redis','defaults'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x918f,0x1ad));var _0xf918=function(_0x529870,_0x975245){_0x529870=_0x529870-0x0;var _0x39435f=_0x918f[_0x529870];return _0x39435f;};'use strict';var _=require(_0xf918('0x0'));var md5=require(_0xf918('0x1'));var util=require(_0xf918('0x2'));var Redis=require(_0xf918('0x3'));var config=require('../../../config/environment');config[_0xf918('0x4')]=_[_0xf918('0x5')](config[_0xf918('0x4')],{'host':_0xf918('0x6'),'port':0x18eb});var io=require(_0xf918('0x7'))(new Redis(config[_0xf918('0x4')]));function ChatQueue(_0x1b4cb5){this['id']=_0x1b4cb5['id']||0x0;this[_0xf918('0x8')]=_0x1b4cb5['name']||'';this['timeout']=_0x1b4cb5[_0xf918('0x9')]||0xa;this[_0xf918('0xa')]=_0x1b4cb5[_0xf918('0xa')]||_0xf918('0xb');this['Agents']=_0x1b4cb5['Agents'];this['mapAgentsId']={};this[_0xf918('0xc')]=0x0;this[_0xf918('0x1')]='';this[_0xf918('0xd')]();this[_0xf918('0xe')]();}ChatQueue['prototype'][_0xf918('0xd')]=function(){var _0x42a1f5=this[_0xf918('0xf')][_0xf918('0x10')];this[_0xf918('0xf')]=_['map'](this[_0xf918('0x11')],'id');this[_0xf918('0xf')][_0xf918('0x10')]=_0x42a1f5;};ChatQueue['prototype'][_0xf918('0xe')]=function(){this[_0xf918('0x12')]=0x0;this['paused']=0x0;for(var _0x4716bc=0x0;_0x4716bc=0x0?this[_0xf918('0x16')]:0x0;var _0x5b4bce={'id':this['id'],'available':this[_0xf918('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xf918('0x8')],'paused':this[_0xf918('0x15')],'waiting':this[_0xf918('0xc')]};var _0x1052c9=md5(JSON[_0xf918('0x17')](_0x5b4bce));if(this[_0xf918('0x1')]!==_0x1052c9){this['md5']=_0x1052c9;io['to'](util[_0xf918('0x18')](_0xf918('0x19'),_0x5b4bce[_0xf918('0x8')]))[_0xf918('0x1a')](_0xf918('0x1b'),_0x5b4bce);}};module[_0xf918('0x1c')]=ChatQueue; \ No newline at end of file +var _0xf2ee=['strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','paused','online','chatPause','available','stringify','chat:queue:%s','emit','exports','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout'];(function(_0x1d432d,_0x401149){var _0x338acb=function(_0x194623){while(--_0x194623){_0x1d432d['push'](_0x1d432d['shift']());}};_0x338acb(++_0x401149);}(_0xf2ee,0x84));var _0xef2e=function(_0x289f62,_0x8a1eec){_0x289f62=_0x289f62-0x0;var _0x2630c5=_0xf2ee[_0x289f62];return _0x2630c5;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xef2e('0x0'));var Redis=require(_0xef2e('0x1'));var config=require(_0xef2e('0x2'));config[_0xef2e('0x3')]=_['defaults'](config[_0xef2e('0x3')],{'host':_0xef2e('0x4'),'port':0x18eb});var io=require(_0xef2e('0x5'))(new Redis(config[_0xef2e('0x3')]));function ChatQueue(_0x189cd9){this['id']=_0x189cd9['id']||0x0;this[_0xef2e('0x6')]=_0x189cd9[_0xef2e('0x6')]||'';this['timeout']=_0x189cd9[_0xef2e('0x7')]||0xa;this[_0xef2e('0x8')]=_0x189cd9[_0xef2e('0x8')]||_0xef2e('0x9');this[_0xef2e('0xa')]=_0x189cd9[_0xef2e('0xa')];this[_0xef2e('0xb')]={};this[_0xef2e('0xc')]=0x0;this[_0xef2e('0xd')]='';this['updateRouting']();this[_0xef2e('0xe')]();}ChatQueue[_0xef2e('0xf')][_0xef2e('0x10')]=function(){var _0x13bd9b=this[_0xef2e('0xb')]['_rr'];this[_0xef2e('0xb')]=_[_0xef2e('0x11')](this[_0xef2e('0xa')],'id');this['mapAgentsId'][_0xef2e('0x12')]=_0x13bd9b;};ChatQueue[_0xef2e('0xf')][_0xef2e('0xe')]=function(){this[_0xef2e('0x13')]=0x0;this[_0xef2e('0x14')]=0x0;for(var _0x2e3c15=0x0;_0x2e3c15=0x0?this['available']:0x0;var _0x143907={'id':this['id'],'available':this[_0xef2e('0x17')],'loggedIn':this[_0xef2e('0x13')],'name':this[_0xef2e('0x6')],'paused':this[_0xef2e('0x14')],'waiting':this[_0xef2e('0xc')]};var _0x492ee7=md5(JSON[_0xef2e('0x18')](_0x143907));if(this[_0xef2e('0xd')]!==_0x492ee7){this[_0xef2e('0xd')]=_0x492ee7;io['to'](util['format'](_0xef2e('0x19'),_0x143907['name']))[_0xef2e('0x1a')]('chat_queue:save',_0x143907);}};module[_0xef2e('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index cff4c77..a54a484 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 _0x406a=['available','waiting','stringify','format','fax:queue:%s','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','updateRouting','updateRealtime','_rr','mapAgentsId','prototype','loggedIn','length','online','faxPause','paused'];(function(_0x1664cf,_0x3f6468){var _0x30a314=function(_0x24cdc1){while(--_0x24cdc1){_0x1664cf['push'](_0x1664cf['shift']());}};_0x30a314(++_0x3f6468);}(_0x406a,0x19c));var _0xa406=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x406a[_0x2261ce];return _0x524640;};'use strict';var _=require(_0xa406('0x0'));var md5=require(_0xa406('0x1'));var util=require(_0xa406('0x2'));var Redis=require(_0xa406('0x3'));var config=require(_0xa406('0x4'));config['redis']=_[_0xa406('0x5')](config[_0xa406('0x6')],{'host':_0xa406('0x7'),'port':0x18eb});var io=require(_0xa406('0x8'))(new Redis(config['redis']));function FaxQueue(_0x53ffde){this['id']=_0x53ffde['id']||0x0;this[_0xa406('0x9')]=_0x53ffde[_0xa406('0x9')]||'';this[_0xa406('0xa')]=_0x53ffde[_0xa406('0xa')]||0xa;this[_0xa406('0xb')]=_0x53ffde['strategy']||'beepall';this[_0xa406('0xc')]=_0x53ffde[_0xa406('0xc')];this['mapAgentsId']={};this['waiting']=0x0;this[_0xa406('0x1')]='';this[_0xa406('0xd')]();this[_0xa406('0xe')]();}FaxQueue['prototype'][_0xa406('0xd')]=function(){var _0x4ff5f3=this['mapAgentsId'][_0xa406('0xf')];this[_0xa406('0x10')]=_['map'](this['Agents'],'id');this[_0xa406('0x10')][_0xa406('0xf')]=_0x4ff5f3;};FaxQueue[_0xa406('0x11')]['updateRealtime']=function(){this[_0xa406('0x12')]=0x0;this['paused']=0x0;for(var _0x1b513d=0x0;_0x1b513d=0x0?this[_0xa406('0x17')]:0x0;var _0x2c0459={'id':this['id'],'available':this[_0xa406('0x17')],'loggedIn':this[_0xa406('0x12')],'name':this[_0xa406('0x9')],'paused':this[_0xa406('0x16')],'waiting':this[_0xa406('0x18')]};var _0x6aa7ed=md5(JSON[_0xa406('0x19')](_0x2c0459));if(this[_0xa406('0x1')]!==_0x6aa7ed){this[_0xa406('0x1')]=_0x6aa7ed;io['to'](util[_0xa406('0x1a')](_0xa406('0x1b'),_0x2c0459['name']))['emit'](_0xa406('0x1c'),_0x2c0459);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x3b25=['paused','waiting','stringify','format','fax:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','online','faxPause','available'];(function(_0x5c7649,_0x5ef05f){var _0x26f229=function(_0x3f0e83){while(--_0x3f0e83){_0x5c7649['push'](_0x5c7649['shift']());}};_0x26f229(++_0x5ef05f);}(_0x3b25,0x13b));var _0x53b2=function(_0x51df41,_0x2d43bd){_0x51df41=_0x51df41-0x0;var _0x29d21a=_0x3b25[_0x51df41];return _0x29d21a;};'use strict';var _=require(_0x53b2('0x0'));var md5=require(_0x53b2('0x1'));var util=require(_0x53b2('0x2'));var Redis=require(_0x53b2('0x3'));var config=require(_0x53b2('0x4'));config['redis']=_[_0x53b2('0x5')](config[_0x53b2('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x53b2('0x6')]));function FaxQueue(_0x34fa19){this['id']=_0x34fa19['id']||0x0;this[_0x53b2('0x7')]=_0x34fa19[_0x53b2('0x7')]||'';this[_0x53b2('0x8')]=_0x34fa19[_0x53b2('0x8')]||0xa;this[_0x53b2('0x9')]=_0x34fa19[_0x53b2('0x9')]||_0x53b2('0xa');this[_0x53b2('0xb')]=_0x34fa19[_0x53b2('0xb')];this[_0x53b2('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x53b2('0xd')]();this[_0x53b2('0xe')]();}FaxQueue[_0x53b2('0xf')][_0x53b2('0xd')]=function(){var _0x55699e=this[_0x53b2('0xc')][_0x53b2('0x10')];this[_0x53b2('0xc')]=_['map'](this['Agents'],'id');this[_0x53b2('0xc')][_0x53b2('0x10')]=_0x55699e;};FaxQueue[_0x53b2('0xf')][_0x53b2('0xe')]=function(){this[_0x53b2('0x11')]=0x0;this['paused']=0x0;for(var _0x41b86d=0x0;_0x41b86d=0x0?this[_0x53b2('0x14')]:0x0;var _0x2b8a6b={'id':this['id'],'available':this[_0x53b2('0x14')],'loggedIn':this[_0x53b2('0x11')],'name':this[_0x53b2('0x7')],'paused':this[_0x53b2('0x15')],'waiting':this[_0x53b2('0x16')]};var _0x249840=md5(JSON[_0x53b2('0x17')](_0x2b8a6b));if(this[_0x53b2('0x1')]!==_0x249840){this[_0x53b2('0x1')]=_0x249840;io['to'](util[_0x53b2('0x18')](_0x53b2('0x19'),_0x2b8a6b[_0x53b2('0x7')]))[_0x53b2('0x1a')]('fax_queue:save',_0x2b8a6b);}};module[_0x53b2('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 4e0d9db..b82c1b6 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 _0x70e9=['exports','name','Intervals'];(function(_0x413f72,_0x12e3c1){var _0x220289=function(_0xad8738){while(--_0xad8738){_0x413f72['push'](_0x413f72['shift']());}};_0x220289(++_0x12e3c1);}(_0x70e9,0x1d2));var _0x970e=function(_0x7a45a3,_0x4e6733){_0x7a45a3=_0x7a45a3-0x0;var _0x42e6cc=_0x70e9[_0x7a45a3];return _0x42e6cc;};'use strict';function Interval(_0x216368){this['id']=_0x216368['id']||0x0;this[_0x970e('0x0')]=_0x216368[_0x970e('0x0')]||'';this[_0x970e('0x1')]=_0x216368[_0x970e('0x1')]||{};}module[_0x970e('0x2')]=Interval; \ No newline at end of file +var _0xbd72=['Intervals','exports'];(function(_0x435cb6,_0x152acc){var _0x1dc78e=function(_0x41768a){while(--_0x41768a){_0x435cb6['push'](_0x435cb6['shift']());}};_0x1dc78e(++_0x152acc);}(_0xbd72,0xc6));var _0x2bd7=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0xbd72[_0x2fd69d];return _0x5d5ef3;};'use strict';function Interval(_0x58dd59){this['id']=_0x58dd59['id']||0x0;this['name']=_0x58dd59['name']||'';this[_0x2bd7('0x0')]=_0x58dd59[_0x2bd7('0x0')]||{};}module[_0x2bd7('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 053725e..c0e5dc4 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 _0xc9ab=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRealtime','prototype','_rr','mapAgentsId','loggedIn','paused','length','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','defaults'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc9ab,0x125));var _0xbc9a=function(_0x4c8159,_0x431f89){_0x4c8159=_0x4c8159-0x0;var _0x2c4a13=_0xc9ab[_0x4c8159];return _0x2c4a13;};'use strict';var _=require(_0xbc9a('0x0'));var md5=require(_0xbc9a('0x1'));var util=require(_0xbc9a('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0xbc9a('0x3')](config[_0xbc9a('0x4')],{'host':_0xbc9a('0x5'),'port':0x18eb});var io=require(_0xbc9a('0x6'))(new Redis(config[_0xbc9a('0x4')]));function MailQueue(_0x3e54f8){this['id']=_0x3e54f8['id']||0x0;this[_0xbc9a('0x7')]=_0x3e54f8[_0xbc9a('0x7')]||'';this[_0xbc9a('0x8')]=_0x3e54f8[_0xbc9a('0x8')]||0xa;this[_0xbc9a('0x9')]=_0x3e54f8[_0xbc9a('0x9')]||_0xbc9a('0xa');this[_0xbc9a('0xb')]=_0x3e54f8['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xbc9a('0x1')]='';this['updateRouting']();this[_0xbc9a('0xc')]();}MailQueue[_0xbc9a('0xd')]['updateRouting']=function(){var _0x5f2b48=this['mapAgentsId'][_0xbc9a('0xe')];this[_0xbc9a('0xf')]=_['map'](this[_0xbc9a('0xb')],'id');this[_0xbc9a('0xf')][_0xbc9a('0xe')]=_0x5f2b48;};MailQueue[_0xbc9a('0xd')][_0xbc9a('0xc')]=function(){this[_0xbc9a('0x10')]=0x0;this[_0xbc9a('0x11')]=0x0;for(var _0x4f6786=0x0;_0x4f6786=0x0?this[_0xbc9a('0x14')]:0x0;var _0x3cc279={'id':this['id'],'available':this['available'],'loggedIn':this[_0xbc9a('0x10')],'name':this[_0xbc9a('0x7')],'paused':this[_0xbc9a('0x11')],'waiting':this['waiting']};var _0x67b853=md5(JSON[_0xbc9a('0x15')](_0x3cc279));if(this[_0xbc9a('0x1')]!==_0x67b853){this[_0xbc9a('0x1')]=_0x67b853;io['to'](util[_0xbc9a('0x16')](_0xbc9a('0x17'),_0x3cc279[_0xbc9a('0x7')]))[_0xbc9a('0x18')](_0xbc9a('0x19'),_0x3cc279);}};module[_0xbc9a('0x1a')]=MailQueue; \ No newline at end of file +var _0x36f3=['available','stringify','format','mail:queue:%s','mail_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','loggedIn','paused','length','online','mailPause'];(function(_0x4c9a82,_0x757638){var _0x1ffeab=function(_0x1f93e8){while(--_0x1f93e8){_0x4c9a82['push'](_0x4c9a82['shift']());}};_0x1ffeab(++_0x757638);}(_0x36f3,0xe6));var _0x336f=function(_0x4dddcc,_0x5dae19){_0x4dddcc=_0x4dddcc-0x0;var _0x2e9da1=_0x36f3[_0x4dddcc];return _0x2e9da1;};'use strict';var _=require('lodash');var md5=require(_0x336f('0x0'));var util=require(_0x336f('0x1'));var Redis=require(_0x336f('0x2'));var config=require(_0x336f('0x3'));config[_0x336f('0x4')]=_[_0x336f('0x5')](config[_0x336f('0x4')],{'host':_0x336f('0x6'),'port':0x18eb});var io=require(_0x336f('0x7'))(new Redis(config['redis']));function MailQueue(_0x40df1c){this['id']=_0x40df1c['id']||0x0;this[_0x336f('0x8')]=_0x40df1c[_0x336f('0x8')]||'';this['timeout']=_0x40df1c['timeout']||0xa;this[_0x336f('0x9')]=_0x40df1c[_0x336f('0x9')]||_0x336f('0xa');this[_0x336f('0xb')]=_0x40df1c[_0x336f('0xb')];this[_0x336f('0xc')]={};this[_0x336f('0xd')]=0x0;this[_0x336f('0x0')]='';this['updateRouting']();this[_0x336f('0xe')]();}MailQueue[_0x336f('0xf')][_0x336f('0x10')]=function(){var _0x15db54=this['mapAgentsId']['_rr'];this[_0x336f('0xc')]=_['map'](this[_0x336f('0xb')],'id');this[_0x336f('0xc')]['_rr']=_0x15db54;};MailQueue[_0x336f('0xf')][_0x336f('0xe')]=function(){this[_0x336f('0x11')]=0x0;this[_0x336f('0x12')]=0x0;for(var _0x12c5e0=0x0;_0x12c5e0=0x0?this[_0x336f('0x16')]:0x0;var _0x2d89d5={'id':this['id'],'available':this['available'],'loggedIn':this[_0x336f('0x11')],'name':this[_0x336f('0x8')],'paused':this[_0x336f('0x12')],'waiting':this['waiting']};var _0x1eb065=md5(JSON[_0x336f('0x17')](_0x2d89d5));if(this['md5']!==_0x1eb065){this[_0x336f('0x0')]=_0x1eb065;io['to'](util[_0x336f('0x18')](_0x336f('0x19'),_0x2d89d5[_0x336f('0x8')]))['emit'](_0x336f('0x1a'),_0x2d89d5);}};module[_0x336f('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 1267021..77b1b79 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 _0x6b72=['redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','updateRouting','_rr','map','prototype','loggedIn','paused','length','openchannelPause','available','stringify','openchannel:queue:%s','lodash','util','ioredis'];(function(_0x33c42e,_0x170930){var _0xfddb2b=function(_0x382a0e){while(--_0x382a0e){_0x33c42e['push'](_0x33c42e['shift']());}};_0xfddb2b(++_0x170930);}(_0x6b72,0x19d));var _0x26b7=function(_0x10b41e,_0x55ddb6){_0x10b41e=_0x10b41e-0x0;var _0x566a2f=_0x6b72[_0x10b41e];return _0x566a2f;};'use strict';var _=require(_0x26b7('0x0'));var md5=require('md5');var util=require(_0x26b7('0x1'));var Redis=require(_0x26b7('0x2'));var config=require('../../../config/environment');config[_0x26b7('0x3')]=_[_0x26b7('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x26b7('0x5'))(new Redis(config[_0x26b7('0x3')]));function OpenchannelQueue(_0x44d910){this['id']=_0x44d910['id']||0x0;this[_0x26b7('0x6')]=_0x44d910[_0x26b7('0x6')]||'';this[_0x26b7('0x7')]=_0x44d910[_0x26b7('0x7')]||0xa;this[_0x26b7('0x8')]=_0x44d910[_0x26b7('0x8')]||_0x26b7('0x9');this[_0x26b7('0xa')]=_0x44d910['Agents'];this[_0x26b7('0xb')]={};this[_0x26b7('0xc')]=0x0;this[_0x26b7('0xd')]='';this['updateRouting']();this[_0x26b7('0xe')]();}OpenchannelQueue['prototype'][_0x26b7('0xf')]=function(){var _0x4d0408=this[_0x26b7('0xb')][_0x26b7('0x10')];this[_0x26b7('0xb')]=_[_0x26b7('0x11')](this['Agents'],'id');this[_0x26b7('0xb')][_0x26b7('0x10')]=_0x4d0408;};OpenchannelQueue[_0x26b7('0x12')][_0x26b7('0xe')]=function(){this[_0x26b7('0x13')]=0x0;this[_0x26b7('0x14')]=0x0;for(var _0x33b34d=0x0;_0x33b34d=0x0?this[_0x26b7('0x17')]:0x0;var _0x5d80bb={'id':this['id'],'available':this[_0x26b7('0x17')],'loggedIn':this[_0x26b7('0x13')],'name':this[_0x26b7('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x373182=md5(JSON[_0x26b7('0x18')](_0x5d80bb));if(this[_0x26b7('0xd')]!==_0x373182){this[_0x26b7('0xd')]=_0x373182;io['to'](util['format'](_0x26b7('0x19'),_0x5d80bb[_0x26b7('0x6')]))['emit']('openchannel_queue:save',_0x5d80bb);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xe3f5=['lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRealtime','_rr','map','loggedIn','paused','length','online','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0xe3f5,0x118));var _0x5e3f=function(_0x562cb9,_0x52752d){_0x562cb9=_0x562cb9-0x0;var _0x4de0e3=_0xe3f5[_0x562cb9];return _0x4de0e3;};'use strict';var _=require(_0x5e3f('0x0'));var md5=require('md5');var util=require(_0x5e3f('0x1'));var Redis=require(_0x5e3f('0x2'));var config=require(_0x5e3f('0x3'));config[_0x5e3f('0x4')]=_[_0x5e3f('0x5')](config['redis'],{'host':_0x5e3f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e3f('0x4')]));function OpenchannelQueue(_0x3ecfee){this['id']=_0x3ecfee['id']||0x0;this['name']=_0x3ecfee[_0x5e3f('0x7')]||'';this['timeout']=_0x3ecfee[_0x5e3f('0x8')]||0xa;this[_0x5e3f('0x9')]=_0x3ecfee[_0x5e3f('0x9')]||_0x5e3f('0xa');this['Agents']=_0x3ecfee[_0x5e3f('0xb')];this[_0x5e3f('0xc')]={};this['waiting']=0x0;this[_0x5e3f('0xd')]='';this['updateRouting']();this[_0x5e3f('0xe')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x2ef445=this[_0x5e3f('0xc')][_0x5e3f('0xf')];this[_0x5e3f('0xc')]=_[_0x5e3f('0x10')](this[_0x5e3f('0xb')],'id');this[_0x5e3f('0xc')][_0x5e3f('0xf')]=_0x2ef445;};OpenchannelQueue['prototype'][_0x5e3f('0xe')]=function(){this[_0x5e3f('0x11')]=0x0;this[_0x5e3f('0x12')]=0x0;for(var _0x3c7427=0x0;_0x3c7427=0x0?this['available']:0x0;var _0x244c5a={'id':this['id'],'available':this[_0x5e3f('0x16')],'loggedIn':this[_0x5e3f('0x11')],'name':this[_0x5e3f('0x7')],'paused':this[_0x5e3f('0x12')],'waiting':this['waiting']};var _0x5b4169=md5(JSON[_0x5e3f('0x17')](_0x244c5a));if(this[_0x5e3f('0xd')]!==_0x5b4169){this[_0x5e3f('0xd')]=_0x5b4169;io['to'](util[_0x5e3f('0x18')](_0x5e3f('0x19'),_0x244c5a[_0x5e3f('0x7')]))[_0x5e3f('0x1a')](_0x5e3f('0x1b'),_0x244c5a);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 720d556..70a9d1a 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 _0xb6e0=['emit','sms_queue:save','lodash','md5','util','../../../config/environment','defaults','redis','localhost','name','strategy','Agents','waiting','updateRouting','mapAgentsId','prototype','updateRealtime','loggedIn','paused','online','smsPause','available','stringify','format','sms:queue:%s'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xb6e0,0x1ab));var _0x0b6e=function(_0x2e2e55,_0x5c4ca9){_0x2e2e55=_0x2e2e55-0x0;var _0x1c7a0b=_0xb6e0[_0x2e2e55];return _0x1c7a0b;};'use strict';var _=require(_0x0b6e('0x0'));var md5=require(_0x0b6e('0x1'));var util=require(_0x0b6e('0x2'));var Redis=require('ioredis');var config=require(_0x0b6e('0x3'));config['redis']=_[_0x0b6e('0x4')](config[_0x0b6e('0x5')],{'host':_0x0b6e('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0b6e('0x5')]));function SmsQueue(_0xa4603c){this['id']=_0xa4603c['id']||0x0;this[_0x0b6e('0x7')]=_0xa4603c[_0x0b6e('0x7')]||'';this['timeout']=_0xa4603c['timeout']||0xa;this[_0x0b6e('0x8')]=_0xa4603c[_0x0b6e('0x8')]||'beepall';this[_0x0b6e('0x9')]=_0xa4603c[_0x0b6e('0x9')];this['mapAgentsId']={};this[_0x0b6e('0xa')]=0x0;this[_0x0b6e('0x1')]='';this[_0x0b6e('0xb')]();this['updateRealtime']();}SmsQueue['prototype'][_0x0b6e('0xb')]=function(){var _0x7d69c5=this[_0x0b6e('0xc')]['_rr'];this[_0x0b6e('0xc')]=_['map'](this[_0x0b6e('0x9')],'id');this[_0x0b6e('0xc')]['_rr']=_0x7d69c5;};SmsQueue[_0x0b6e('0xd')][_0x0b6e('0xe')]=function(){this[_0x0b6e('0xf')]=0x0;this[_0x0b6e('0x10')]=0x0;for(var _0x409432=0x0;_0x409432=0x0?this[_0x0b6e('0x13')]:0x0;var _0xc2b07b={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0b6e('0xf')],'name':this[_0x0b6e('0x7')],'paused':this[_0x0b6e('0x10')],'waiting':this['waiting']};var _0xa0e3b=md5(JSON[_0x0b6e('0x14')](_0xc2b07b));if(this[_0x0b6e('0x1')]!==_0xa0e3b){this['md5']=_0xa0e3b;io['to'](util[_0x0b6e('0x15')](_0x0b6e('0x16'),_0xc2b07b[_0x0b6e('0x7')]))[_0x0b6e('0x17')](_0x0b6e('0x18'),_0xc2b07b);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xbad1=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','format','sms_queue:save','exports','lodash','md5','util','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy'];(function(_0xc383be,_0x194a13){var _0x4fa994=function(_0x4ecb85){while(--_0x4ecb85){_0xc383be['push'](_0xc383be['shift']());}};_0x4fa994(++_0x194a13);}(_0xbad1,0x197));var _0x1bad=function(_0x4e0a01,_0x7d15ff){_0x4e0a01=_0x4e0a01-0x0;var _0x1aa533=_0xbad1[_0x4e0a01];return _0x1aa533;};'use strict';var _=require(_0x1bad('0x0'));var md5=require(_0x1bad('0x1'));var util=require(_0x1bad('0x2'));var Redis=require('ioredis');var config=require(_0x1bad('0x3'));config[_0x1bad('0x4')]=_['defaults'](config[_0x1bad('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x1bad('0x5'))(new Redis(config[_0x1bad('0x4')]));function SmsQueue(_0x868451){this['id']=_0x868451['id']||0x0;this[_0x1bad('0x6')]=_0x868451[_0x1bad('0x6')]||'';this['timeout']=_0x868451[_0x1bad('0x7')]||0xa;this[_0x1bad('0x8')]=_0x868451[_0x1bad('0x8')]||_0x1bad('0x9');this[_0x1bad('0xa')]=_0x868451[_0x1bad('0xa')];this[_0x1bad('0xb')]={};this[_0x1bad('0xc')]=0x0;this[_0x1bad('0x1')]='';this[_0x1bad('0xd')]();this[_0x1bad('0xe')]();}SmsQueue[_0x1bad('0xf')][_0x1bad('0xd')]=function(){var _0x5709bf=this[_0x1bad('0xb')][_0x1bad('0x10')];this['mapAgentsId']=_[_0x1bad('0x11')](this['Agents'],'id');this[_0x1bad('0xb')]['_rr']=_0x5709bf;};SmsQueue['prototype'][_0x1bad('0xe')]=function(){this[_0x1bad('0x12')]=0x0;this[_0x1bad('0x13')]=0x0;for(var _0x33b513=0x0;_0x33b513=0x0?this[_0x1bad('0x16')]:0x0;var _0x4b0c9a={'id':this['id'],'available':this[_0x1bad('0x16')],'loggedIn':this[_0x1bad('0x12')],'name':this[_0x1bad('0x6')],'paused':this[_0x1bad('0x13')],'waiting':this[_0x1bad('0xc')]};var _0x199109=md5(JSON['stringify'](_0x4b0c9a));if(this[_0x1bad('0x1')]!==_0x199109){this[_0x1bad('0x1')]=_0x199109;io['to'](util[_0x1bad('0x17')]('sms:queue:%s',_0x4b0c9a['name']))['emit'](_0x1bad('0x18'),_0x4b0c9a);}};module[_0x1bad('0x19')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 9b0bd1c..6ca77ec 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 _0x51ba=['lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/smsQueue','agents','openchannelQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','isUndefined','initIntervals','intervals','initOpenchannelQueues','updateRouting','updateRealtime','chatQueues','length','initSmsQueues','initMailQueues','initFaxQueues','bluebird','util'];(function(_0x3b6d59,_0x30b8cf){var _0x3db027=function(_0x36157e){while(--_0x36157e){_0x3b6d59['push'](_0x3b6d59['shift']());}};_0x3db027(++_0x30b8cf);}(_0x51ba,0x169));var _0xa51b=function(_0x34771a,_0x262d6d){_0x34771a=_0x34771a-0x0;var _0xdc08ff=_0x51ba[_0x34771a];return _0xdc08ff;};'use strict';var BPromise=require(_0xa51b('0x0'));var util=require(_0xa51b('0x1'));var _=require(_0xa51b('0x2'));var moment=require(_0xa51b('0x3'));var Agent=require(_0xa51b('0x4'));var Interval=require(_0xa51b('0x5'));var OpenchannelQueue=require(_0xa51b('0x6'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0xa51b('0x7'));var MailQueue=require('../model/mailQueue');var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0xa51b('0x8')]={};this['intervals']={};this[_0xa51b('0x9')]={};this['chatQueues']={};this[_0xa51b('0xa')]={};this[_0xa51b('0xb')]={};this[_0xa51b('0xc')]={};this[_0xa51b('0xd')]={};this[_0xa51b('0xe')]={};this[_0xa51b('0xf')]={};this[_0xa51b('0x10')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x384c98,_0x2001b3,_0x3214f7){var _0x27ffc2=_[_0xa51b('0x11')](_0x384c98,function(_0x746803,_0xbd5ece){return _0x746803[_0x3214f7];});for(var _0x55582b in _0x2001b3){if(_0x2001b3[_0xa51b('0x12')](_0x55582b)){if(!_0x27ffc2[_0x55582b]){delete _0x2001b3[_0x55582b];}}}}Realtime[_0xa51b('0x13')][_0xa51b('0x14')]=function(_0x3cefaf,_0x1f446e){for(var _0x5d45c2 in _0x1f446e){if(_0x3cefaf['hasOwnProperty'](_0x5d45c2)){_0x3cefaf[_0x5d45c2]=_0x1f446e[_0x5d45c2];}}};Realtime['prototype'][_0xa51b('0x15')]=function(){var _0x146d49=this;return function(_0x2ca0f3){if(_0x2ca0f3){freeIsNotKey(_0x2ca0f3,_0x146d49['agents'],'id');for(var _0x5b2477=0x0,_0x357ed0={},_0x35f656={};_0x5b2477<_0x2ca0f3['length'];_0x5b2477+=0x1){_0x357ed0=_0x2ca0f3[_0x5b2477];if(_[_0xa51b('0x16')](_0x146d49[_0xa51b('0x8')][_0x357ed0['id']])){_0x146d49[_0xa51b('0x8')][_0x357ed0['id']]=new Agent(_0x357ed0);}else{_0x146d49[_0xa51b('0x14')](_0x146d49[_0xa51b('0x8')][_0x357ed0['id']],_0x357ed0);}}}return _0x146d49[_0xa51b('0x8')];};};Realtime[_0xa51b('0x13')][_0xa51b('0x17')]=function(){var _0x5d403e=this;return function(_0x5b261e){if(_0x5b261e){freeIsNotKey(_0x5b261e,_0x5d403e['intervals'],'id');for(var _0x2a4448=0x0,_0x2d7a69={},_0x78a579={};_0x2a4448<_0x5b261e['length'];_0x2a4448+=0x1){_0x2d7a69=_0x5b261e[_0x2a4448];if(_[_0xa51b('0x16')](_0x5d403e[_0xa51b('0x18')][_0x2d7a69['id']])){_0x5d403e[_0xa51b('0x18')][_0x2d7a69['id']]=new Interval(_0x2d7a69);}else{_0x5d403e[_0xa51b('0x14')](_0x5d403e[_0xa51b('0x18')][_0x2d7a69['id']],_0x2d7a69);}}}return _0x5d403e[_0xa51b('0x18')];};};Realtime[_0xa51b('0x13')][_0xa51b('0x19')]=function(){var _0x165024=this;return function(_0x31eaf8){if(_0x31eaf8){freeIsNotKey(_0x31eaf8,_0x165024[_0xa51b('0x9')],'id');for(var _0x3dd05a=0x0,_0x42834e={},_0x2d8615={};_0x3dd05a<_0x31eaf8['length'];_0x3dd05a+=0x1){_0x42834e=_0x31eaf8[_0x3dd05a];if(_[_0xa51b('0x16')](_0x165024[_0xa51b('0x9')][_0x42834e['id']])){_0x165024[_0xa51b('0x9')][_0x42834e['id']]=new OpenchannelQueue(_0x42834e);}else{_0x165024[_0xa51b('0x14')](_0x165024[_0xa51b('0x9')][_0x42834e['id']],_0x42834e);}_0x165024['openchannelQueues'][_0x42834e['id']][_0xa51b('0x1a')]();_0x165024[_0xa51b('0x9')][_0x42834e['id']][_0xa51b('0x1b')]();}}return _0x165024[_0xa51b('0x9')];};};Realtime[_0xa51b('0x13')]['initChatQueues']=function(){var _0x220d9e=this;return function(_0x417944){if(_0x417944){freeIsNotKey(_0x417944,_0x220d9e[_0xa51b('0x1c')],'id');for(var _0x54eafc=0x0,_0x3ebdbf={},_0x583c21={};_0x54eafc<_0x417944[_0xa51b('0x1d')];_0x54eafc+=0x1){_0x3ebdbf=_0x417944[_0x54eafc];if(_[_0xa51b('0x16')](_0x220d9e['chatQueues'][_0x3ebdbf['id']])){_0x220d9e[_0xa51b('0x1c')][_0x3ebdbf['id']]=new ChatQueue(_0x3ebdbf);}else{_0x220d9e[_0xa51b('0x14')](_0x220d9e[_0xa51b('0x1c')][_0x3ebdbf['id']],_0x3ebdbf);}_0x220d9e[_0xa51b('0x1c')][_0x3ebdbf['id']][_0xa51b('0x1a')]();_0x220d9e[_0xa51b('0x1c')][_0x3ebdbf['id']][_0xa51b('0x1b')]();}}return _0x220d9e[_0xa51b('0x1c')];};};Realtime[_0xa51b('0x13')][_0xa51b('0x1e')]=function(){var _0xe82148=this;return function(_0x43b85b){if(_0x43b85b){freeIsNotKey(_0x43b85b,_0xe82148[_0xa51b('0xa')],'id');for(var _0x1cfbd4=0x0,_0x18f3d9={},_0x5816dd={};_0x1cfbd4<_0x43b85b[_0xa51b('0x1d')];_0x1cfbd4+=0x1){_0x18f3d9=_0x43b85b[_0x1cfbd4];if(_[_0xa51b('0x16')](_0xe82148[_0xa51b('0xa')][_0x18f3d9['id']])){_0xe82148[_0xa51b('0xa')][_0x18f3d9['id']]=new SmsQueue(_0x18f3d9);}else{_0xe82148[_0xa51b('0x14')](_0xe82148[_0xa51b('0xa')][_0x18f3d9['id']],_0x18f3d9);}_0xe82148[_0xa51b('0xa')][_0x18f3d9['id']][_0xa51b('0x1a')]();_0xe82148['smsQueues'][_0x18f3d9['id']][_0xa51b('0x1b')]();}}return _0xe82148[_0xa51b('0xa')];};};Realtime[_0xa51b('0x13')][_0xa51b('0x1f')]=function(){var _0x18025f=this;return function(_0x58a408){if(_0x58a408){freeIsNotKey(_0x58a408,_0x18025f[_0xa51b('0xb')],'id');for(var _0x471bf7=0x0,_0x272d75={},_0xdfb8e0={};_0x471bf7<_0x58a408[_0xa51b('0x1d')];_0x471bf7+=0x1){_0x272d75=_0x58a408[_0x471bf7];if(_['isUndefined'](_0x18025f[_0xa51b('0xb')][_0x272d75['id']])){_0x18025f[_0xa51b('0xb')][_0x272d75['id']]=new MailQueue(_0x272d75);}else{_0x18025f[_0xa51b('0x14')](_0x18025f['mailQueues'][_0x272d75['id']],_0x272d75);}_0x18025f['mailQueues'][_0x272d75['id']][_0xa51b('0x1a')]();_0x18025f[_0xa51b('0xb')][_0x272d75['id']][_0xa51b('0x1b')]();}}return _0x18025f[_0xa51b('0xb')];};};Realtime[_0xa51b('0x13')][_0xa51b('0x20')]=function(){var _0x297894=this;return function(_0x1f95cb){if(_0x1f95cb){freeIsNotKey(_0x1f95cb,_0x297894[_0xa51b('0xc')],'id');for(var _0x92d001=0x0,_0x4f887f={},_0x5ecba5={};_0x92d001<_0x1f95cb[_0xa51b('0x1d')];_0x92d001+=0x1){_0x4f887f=_0x1f95cb[_0x92d001];if(_['isUndefined'](_0x297894[_0xa51b('0xc')][_0x4f887f['id']])){_0x297894['faxQueues'][_0x4f887f['id']]=new FaxQueue(_0x4f887f);}else{_0x297894[_0xa51b('0x14')](_0x297894[_0xa51b('0xc')][_0x4f887f['id']],_0x4f887f);}_0x297894[_0xa51b('0xc')][_0x4f887f['id']]['updateRouting']();_0x297894[_0xa51b('0xc')][_0x4f887f['id']][_0xa51b('0x1b')]();}}return _0x297894[_0xa51b('0xc')];};};module['exports']=Realtime; \ No newline at end of file +var _0xd3c0=['initFaxQueues','exports','util','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','openchannelQueues','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','hasOwnProperty','length','isUndefined','mergeFromDatabase','initIntervals','intervals','initOpenchannelQueues','updateRouting','updateRealtime','chatQueues','initSmsQueues','initMailQueues'];(function(_0x439845,_0x2b5861){var _0x19bf9b=function(_0x3dd6b6){while(--_0x3dd6b6){_0x439845['push'](_0x439845['shift']());}};_0x19bf9b(++_0x2b5861);}(_0xd3c0,0x160));var _0x0d3c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3c0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require(_0x0d3c('0x0'));var _=require(_0x0d3c('0x1'));var moment=require(_0x0d3c('0x2'));var Agent=require(_0x0d3c('0x3'));var Interval=require(_0x0d3c('0x4'));var OpenchannelQueue=require(_0x0d3c('0x5'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require(_0x0d3c('0x6'));var MailQueue=require(_0x0d3c('0x7'));var FaxQueue=require(_0x0d3c('0x8'));var Realtime=function(){this[_0x0d3c('0x9')]={};this['intervals']={};this[_0x0d3c('0xa')]={};this['chatQueues']={};this[_0x0d3c('0xb')]={};this[_0x0d3c('0xc')]={};this[_0x0d3c('0xd')]={};this[_0x0d3c('0xe')]={};this[_0x0d3c('0xf')]={};this[_0x0d3c('0x10')]={};this[_0x0d3c('0x11')]={};this[_0x0d3c('0x12')]={};};function freeIsNotKey(_0x489e63,_0x1b08a9,_0x4e3b51){var _0xaeebae=_[_0x0d3c('0x13')](_0x489e63,function(_0x5db01e,_0x29f977){return _0x5db01e[_0x4e3b51];});for(var _0x95474a in _0x1b08a9){if(_0x1b08a9['hasOwnProperty'](_0x95474a)){if(!_0xaeebae[_0x95474a]){delete _0x1b08a9[_0x95474a];}}}}Realtime[_0x0d3c('0x14')]['mergeFromDatabase']=function(_0x37b0d0,_0x4c9084){for(var _0x2ab9ef in _0x4c9084){if(_0x37b0d0[_0x0d3c('0x15')](_0x2ab9ef)){_0x37b0d0[_0x2ab9ef]=_0x4c9084[_0x2ab9ef];}}};Realtime[_0x0d3c('0x14')]['initAgents']=function(){var _0x4bd59b=this;return function(_0x4a8f99){if(_0x4a8f99){freeIsNotKey(_0x4a8f99,_0x4bd59b[_0x0d3c('0x9')],'id');for(var _0x4c2dea=0x0,_0x44d46f={},_0x4cfce9={};_0x4c2dea<_0x4a8f99[_0x0d3c('0x16')];_0x4c2dea+=0x1){_0x44d46f=_0x4a8f99[_0x4c2dea];if(_[_0x0d3c('0x17')](_0x4bd59b['agents'][_0x44d46f['id']])){_0x4bd59b[_0x0d3c('0x9')][_0x44d46f['id']]=new Agent(_0x44d46f);}else{_0x4bd59b[_0x0d3c('0x18')](_0x4bd59b[_0x0d3c('0x9')][_0x44d46f['id']],_0x44d46f);}}}return _0x4bd59b['agents'];};};Realtime['prototype'][_0x0d3c('0x19')]=function(){var _0xf2bca4=this;return function(_0x295c15){if(_0x295c15){freeIsNotKey(_0x295c15,_0xf2bca4['intervals'],'id');for(var _0x58162e=0x0,_0xce6307={},_0x20ed88={};_0x58162e<_0x295c15[_0x0d3c('0x16')];_0x58162e+=0x1){_0xce6307=_0x295c15[_0x58162e];if(_['isUndefined'](_0xf2bca4[_0x0d3c('0x1a')][_0xce6307['id']])){_0xf2bca4[_0x0d3c('0x1a')][_0xce6307['id']]=new Interval(_0xce6307);}else{_0xf2bca4['mergeFromDatabase'](_0xf2bca4['intervals'][_0xce6307['id']],_0xce6307);}}}return _0xf2bca4[_0x0d3c('0x1a')];};};Realtime['prototype'][_0x0d3c('0x1b')]=function(){var _0x3147fe=this;return function(_0x1283a9){if(_0x1283a9){freeIsNotKey(_0x1283a9,_0x3147fe[_0x0d3c('0xa')],'id');for(var _0x2ed3fb=0x0,_0x26083a={},_0x180286={};_0x2ed3fb<_0x1283a9['length'];_0x2ed3fb+=0x1){_0x26083a=_0x1283a9[_0x2ed3fb];if(_[_0x0d3c('0x17')](_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']])){_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']]=new OpenchannelQueue(_0x26083a);}else{_0x3147fe[_0x0d3c('0x18')](_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']],_0x26083a);}_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']][_0x0d3c('0x1c')]();_0x3147fe[_0x0d3c('0xa')][_0x26083a['id']][_0x0d3c('0x1d')]();}}return _0x3147fe[_0x0d3c('0xa')];};};Realtime['prototype']['initChatQueues']=function(){var _0x39aa32=this;return function(_0x11ebe0){if(_0x11ebe0){freeIsNotKey(_0x11ebe0,_0x39aa32[_0x0d3c('0x1e')],'id');for(var _0x18668e=0x0,_0x3a4dad={},_0x36f11e={};_0x18668e<_0x11ebe0[_0x0d3c('0x16')];_0x18668e+=0x1){_0x3a4dad=_0x11ebe0[_0x18668e];if(_[_0x0d3c('0x17')](_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']])){_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']]=new ChatQueue(_0x3a4dad);}else{_0x39aa32[_0x0d3c('0x18')](_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']],_0x3a4dad);}_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']][_0x0d3c('0x1c')]();_0x39aa32[_0x0d3c('0x1e')][_0x3a4dad['id']]['updateRealtime']();}}return _0x39aa32[_0x0d3c('0x1e')];};};Realtime[_0x0d3c('0x14')][_0x0d3c('0x1f')]=function(){var _0x1ba1ed=this;return function(_0x24f84f){if(_0x24f84f){freeIsNotKey(_0x24f84f,_0x1ba1ed[_0x0d3c('0xb')],'id');for(var _0x1e1e69=0x0,_0x2cce60={},_0x54becd={};_0x1e1e69<_0x24f84f[_0x0d3c('0x16')];_0x1e1e69+=0x1){_0x2cce60=_0x24f84f[_0x1e1e69];if(_[_0x0d3c('0x17')](_0x1ba1ed[_0x0d3c('0xb')][_0x2cce60['id']])){_0x1ba1ed[_0x0d3c('0xb')][_0x2cce60['id']]=new SmsQueue(_0x2cce60);}else{_0x1ba1ed[_0x0d3c('0x18')](_0x1ba1ed['smsQueues'][_0x2cce60['id']],_0x2cce60);}_0x1ba1ed['smsQueues'][_0x2cce60['id']]['updateRouting']();_0x1ba1ed[_0x0d3c('0xb')][_0x2cce60['id']][_0x0d3c('0x1d')]();}}return _0x1ba1ed['smsQueues'];};};Realtime[_0x0d3c('0x14')][_0x0d3c('0x20')]=function(){var _0x432d37=this;return function(_0x422bd1){if(_0x422bd1){freeIsNotKey(_0x422bd1,_0x432d37[_0x0d3c('0xc')],'id');for(var _0x11085d=0x0,_0x30985={},_0x4c9bfd={};_0x11085d<_0x422bd1[_0x0d3c('0x16')];_0x11085d+=0x1){_0x30985=_0x422bd1[_0x11085d];if(_['isUndefined'](_0x432d37['mailQueues'][_0x30985['id']])){_0x432d37[_0x0d3c('0xc')][_0x30985['id']]=new MailQueue(_0x30985);}else{_0x432d37[_0x0d3c('0x18')](_0x432d37[_0x0d3c('0xc')][_0x30985['id']],_0x30985);}_0x432d37[_0x0d3c('0xc')][_0x30985['id']][_0x0d3c('0x1c')]();_0x432d37[_0x0d3c('0xc')][_0x30985['id']][_0x0d3c('0x1d')]();}}return _0x432d37['mailQueues'];};};Realtime[_0x0d3c('0x14')][_0x0d3c('0x21')]=function(){var _0x1cdacf=this;return function(_0x6d66a8){if(_0x6d66a8){freeIsNotKey(_0x6d66a8,_0x1cdacf['faxQueues'],'id');for(var _0x33dbc8=0x0,_0x2c9c9f={},_0x21e9fe={};_0x33dbc8<_0x6d66a8[_0x0d3c('0x16')];_0x33dbc8+=0x1){_0x2c9c9f=_0x6d66a8[_0x33dbc8];if(_[_0x0d3c('0x17')](_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']])){_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']]=new FaxQueue(_0x2c9c9f);}else{_0x1cdacf[_0x0d3c('0x18')](_0x1cdacf['faxQueues'][_0x2c9c9f['id']],_0x2c9c9f);}_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']][_0x0d3c('0x1c')]();_0x1cdacf[_0x0d3c('0xd')][_0x2c9c9f['id']][_0x0d3c('0x1d')]();}}return _0x1cdacf['faxQueues'];};};module[_0x0d3c('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 c01a1e8..12b6595 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 _0x74af=['Request','updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x113876,_0x2d243d){var _0x3da554=function(_0x4df645){while(--_0x4df645){_0x113876['push'](_0x113876['shift']());}};_0x3da554(++_0x2d243d);}(_0x74af,0xfa));var _0xf74a=function(_0x158707,_0x2f2ec9){_0x158707=_0x158707-0x0;var _0x5f34b2=_0x74af[_0x158707];return _0x5f34b2;};'use strict';var client=require(_0xf74a('0x0'));exports[_0xf74a('0x1')]=function(_0x3ffeba,_0x50cbcf){return client[_0xf74a('0x2')]('UpdateChatInteraction',{'body':_0x50cbcf,'options':{'where':{'id':_0x3ffeba}},'log':_0xf74a('0x3')});};exports['addTags']=function(_0x11e3ba,_0x3f4364){return client[_0xf74a('0x2')](_0xf74a('0x4'),{'body':_0x3f4364,'options':{'where':{'id':_0x11e3ba}},'log':_0xf74a('0x5')});}; \ No newline at end of file +var _0x9174=['addTagsToChatInteraction','../client','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x3f5a0a,_0x440d14){var _0x3ba695=function(_0x118125){while(--_0x118125){_0x3f5a0a['push'](_0x3f5a0a['shift']());}};_0x3ba695(++_0x440d14);}(_0x9174,0xcd));var _0x4917=function(_0x3c884b,_0x2984d6){_0x3c884b=_0x3c884b-0x0;var _0x158008=_0x9174[_0x3c884b];return _0x158008;};'use strict';var client=require(_0x4917('0x0'));exports['update']=function(_0x9e5283,_0x291cc0){return client['Request']('UpdateChatInteraction',{'body':_0x291cc0,'options':{'where':{'id':_0x9e5283}},'log':_0x4917('0x1')});};exports[_0x4917('0x2')]=function(_0x5f231c,_0x4920b3){return client[_0x4917('0x3')](_0x4917('0x4'),{'body':_0x4920b3,'options':{'where':{'id':_0x5f231c}},'log':_0x4917('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index ef6dfc3..6a7d4e8 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 _0x8da5=['../client','create','Request','CreateChatMessage'];(function(_0x3139d3,_0xefe99e){var _0x45a313=function(_0x15f0ed){while(--_0x15f0ed){_0x3139d3['push'](_0x3139d3['shift']());}};_0x45a313(++_0xefe99e);}(_0x8da5,0x1f0));var _0x58da=function(_0x12bd9a,_0x4a435a){_0x12bd9a=_0x12bd9a-0x0;var _0x356d89=_0x8da5[_0x12bd9a];return _0x356d89;};'use strict';var client=require(_0x58da('0x0'));exports[_0x58da('0x1')]=function(_0x1fab3b){return client[_0x58da('0x2')](_0x58da('0x3'),{'body':_0x1fab3b,'log':'createChatMessage'});}; \ No newline at end of file +var _0x36e0=['CreateChatMessage','create','Request'];(function(_0x460f79,_0x1af962){var _0x57a93e=function(_0x327ed2){while(--_0x327ed2){_0x460f79['push'](_0x460f79['shift']());}};_0x57a93e(++_0x1af962);}(_0x36e0,0x11b));var _0x036e=function(_0x13d09f,_0x894f95){_0x13d09f=_0x13d09f-0x0;var _0x3d3ab9=_0x36e0[_0x13d09f];return _0x3d3ab9;};'use strict';var client=require('../client');exports[_0x036e('0x0')]=function(_0x30ca45){return client[_0x036e('0x1')](_0x036e('0x2'),{'body':_0x30ca45,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 24e3821..717016e 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 _0x903e=['User','online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout'];(function(_0xb1174e,_0x1e68a7){var _0x285bac=function(_0x32c505){while(--_0x32c505){_0xb1174e['push'](_0xb1174e['shift']());}};_0x285bac(++_0x1e68a7);}(_0x903e,0x66));var _0xe903=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x903e[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0xe903('0x0'));exports[_0xe903('0x1')]=function(){return function(){return client[_0xe903('0x2')](_0xe903('0x3'),{'options':{'raw':![],'attributes':['id',_0xe903('0x4'),_0xe903('0x5'),'strategy'],'include':[{'model':_0xe903('0x6'),'as':'Agents','attributes':['id',_0xe903('0x4'),_0xe903('0x7'),_0xe903('0x8')]}]},'log':_0xe903('0x1')});};}; \ No newline at end of file +var _0xaa28=['User','Agents','online','Request','GetChatQueue','name','timeout','strategy'];(function(_0x1d8f6,_0x2e6807){var _0x36ae00=function(_0xe01cc3){while(--_0xe01cc3){_0x1d8f6['push'](_0x1d8f6['shift']());}};_0x36ae00(++_0x2e6807);}(_0xaa28,0x18b));var _0x8aa2=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0xaa28[_0x547add];return _0x2ed1f3;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client[_0x8aa2('0x0')](_0x8aa2('0x1'),{'options':{'raw':![],'attributes':['id',_0x8aa2('0x2'),_0x8aa2('0x3'),_0x8aa2('0x4')],'include':[{'model':_0x8aa2('0x5'),'as':_0x8aa2('0x6'),'attributes':['id',_0x8aa2('0x2'),_0x8aa2('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 03f33a8..932f2e3 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 _0xfa2f=['UpdateChatQueueReport','DESC','CreateChatQueueReport','update','Request'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xfa2f,0xe8));var _0xffa2=function(_0x3a99a4,_0x3cb3de){_0x3a99a4=_0x3a99a4-0x0;var _0x45291d=_0xfa2f[_0x3a99a4];return _0x45291d;};'use strict';var client=require('../client');exports['create']=function(_0x3a81ad){return client['Request'](_0xffa2('0x0'),{'body':_0x3a81ad,'log':_0xffa2('0x0')});};exports[_0xffa2('0x1')]=function(_0x54d423,_0x3fcced){return client[_0xffa2('0x2')](_0xffa2('0x3'),{'body':_0x3fcced,'options':{'where':{'uniqueid':_0x54d423},'order':[['id',_0xffa2('0x4')]],'limit':0x1},'log':_0xffa2('0x3')});}; \ No newline at end of file +var _0xd73a=['CreateChatQueueReport','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x954b3a,_0x10a7c1){var _0x3a313e=function(_0x1070ad){while(--_0x1070ad){_0x954b3a['push'](_0x954b3a['shift']());}};_0x3a313e(++_0x10a7c1);}(_0xd73a,0x171));var _0xad73=function(_0x2873bd,_0x3a8504){_0x2873bd=_0x2873bd-0x0;var _0x53cded=_0xd73a[_0x2873bd];return _0x53cded;};'use strict';var client=require(_0xad73('0x0'));exports[_0xad73('0x1')]=function(_0x138ac){return client[_0xad73('0x2')](_0xad73('0x3'),{'body':_0x138ac,'log':'CreateChatQueueReport'});};exports['update']=function(_0x1b0cd2,_0x216563){return client[_0xad73('0x2')](_0xad73('0x4'),{'body':_0x216563,'options':{'where':{'uniqueid':_0x1b0cd2},'order':[['id',_0xad73('0x5')]],'limit':0x1},'log':_0xad73('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 66213e0..8685d42 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 _0x7ab5=['addTagsToFaxInteraction','../client','update','Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction'];(function(_0x30ceb2,_0x212574){var _0x5836f9=function(_0x2344d4){while(--_0x2344d4){_0x30ceb2['push'](_0x30ceb2['shift']());}};_0x5836f9(++_0x212574);}(_0x7ab5,0x199));var _0x57ab=function(_0x24e3a2,_0x39128b){_0x24e3a2=_0x24e3a2-0x0;var _0x328657=_0x7ab5[_0x24e3a2];return _0x328657;};'use strict';var client=require(_0x57ab('0x0'));exports[_0x57ab('0x1')]=function(_0x5e5095,_0x5806a0){return client[_0x57ab('0x2')](_0x57ab('0x3'),{'body':_0x5806a0,'options':{'where':{'id':_0x5e5095}},'log':_0x57ab('0x4')});};exports[_0x57ab('0x5')]=function(_0x1c5050,_0x29c52d){return client['Request'](_0x57ab('0x6'),{'body':_0x29c52d,'options':{'where':{'id':_0x1c5050}},'log':_0x57ab('0x7')});}; \ No newline at end of file +var _0x1966=['addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','update','Request','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x5426b8,_0x535f41){var _0x58bf6c=function(_0x3c6b8c){while(--_0x3c6b8c){_0x5426b8['push'](_0x5426b8['shift']());}};_0x58bf6c(++_0x535f41);}(_0x1966,0x15a));var _0x6196=function(_0x58e3cd,_0x3fac55){_0x58e3cd=_0x58e3cd-0x0;var _0x2be4fd=_0x1966[_0x58e3cd];return _0x2be4fd;};'use strict';var client=require('../client');exports[_0x6196('0x0')]=function(_0x1765d0,_0x39318a){return client[_0x6196('0x1')](_0x6196('0x2'),{'body':_0x39318a,'options':{'where':{'id':_0x1765d0}},'log':_0x6196('0x3')});};exports[_0x6196('0x4')]=function(_0x5a2c6a,_0x490b6e){return client[_0x6196('0x1')](_0x6196('0x5'),{'body':_0x490b6e,'options':{'where':{'id':_0x5a2c6a}},'log':_0x6196('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index fc058f3..a410693 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 _0x1fd1=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x59ec7a,_0x1eb345){var _0x8535ed=function(_0x5bca0b){while(--_0x5bca0b){_0x59ec7a['push'](_0x59ec7a['shift']());}};_0x8535ed(++_0x1eb345);}(_0x1fd1,0x1c0));var _0x11fd=function(_0x218f24,_0x20b70f){_0x218f24=_0x218f24-0x0;var _0x50e93d=_0x1fd1[_0x218f24];return _0x50e93d;};'use strict';var client=require(_0x11fd('0x0'));exports[_0x11fd('0x1')]=function(_0x38534d){return client[_0x11fd('0x2')](_0x11fd('0x3'),{'body':_0x38534d,'log':_0x11fd('0x4')});}; \ No newline at end of file +var _0xa353=['../client','create','Request','CreateFaxMessage'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0xa353,0x160));var _0x3a35=function(_0x21c218,_0xe204e){_0x21c218=_0x21c218-0x0;var _0xebff61=_0xa353[_0x21c218];return _0xebff61;};'use strict';var client=require(_0x3a35('0x0'));exports[_0x3a35('0x1')]=function(_0x327b8d){return client[_0x3a35('0x2')](_0x3a35('0x3'),{'body':_0x327b8d,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 317cbd2..36c7260 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 _0x4201=['Agents','name','online','faxPause','../client','getFaxQueues','GetFaxQueue','timeout','strategy'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x4201,0xf7));var _0x1420=function(_0x3357b8,_0xeb406){_0x3357b8=_0x3357b8-0x0;var _0x50737a=_0x4201[_0x3357b8];return _0x50737a;};'use strict';var client=require(_0x1420('0x0'));exports[_0x1420('0x1')]=function(){return function(){return client['Request'](_0x1420('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x1420('0x3'),_0x1420('0x4')],'include':[{'model':'User','as':_0x1420('0x5'),'attributes':['id',_0x1420('0x6'),_0x1420('0x7'),_0x1420('0x8')]}]},'log':_0x1420('0x1')});};}; \ No newline at end of file +var _0x2ee7=['Request','GetFaxQueue','name','timeout','strategy','online','faxPause','getFaxQueues','../client'];(function(_0x1de43c,_0xaa29de){var _0x296d3e=function(_0x50b76f){while(--_0x50b76f){_0x1de43c['push'](_0x1de43c['shift']());}};_0x296d3e(++_0xaa29de);}(_0x2ee7,0x6b));var _0x72ee=function(_0x17bd48,_0x21cff6){_0x17bd48=_0x17bd48-0x0;var _0x114e3b=_0x2ee7[_0x17bd48];return _0x114e3b;};'use strict';var client=require(_0x72ee('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x72ee('0x1')](_0x72ee('0x2'),{'options':{'raw':![],'attributes':['id',_0x72ee('0x3'),_0x72ee('0x4'),_0x72ee('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x72ee('0x3'),_0x72ee('0x6'),_0x72ee('0x7')]}]},'log':_0x72ee('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 5cde1d1..b608905 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 _0xd83b=['CreateFaxQueueReport','update','UpdateFaxQueueReport','../client','Request'];(function(_0x4b9506,_0x3a4178){var _0x536803=function(_0x2ad2f1){while(--_0x2ad2f1){_0x4b9506['push'](_0x4b9506['shift']());}};_0x536803(++_0x3a4178);}(_0xd83b,0x71));var _0xbd83=function(_0x45a036,_0xf26197){_0x45a036=_0x45a036-0x0;var _0x21c73d=_0xd83b[_0x45a036];return _0x21c73d;};'use strict';var client=require(_0xbd83('0x0'));exports['create']=function(_0x1f76c5){return client[_0xbd83('0x1')](_0xbd83('0x2'),{'body':_0x1f76c5,'log':'CreateFaxQueueReport'});};exports[_0xbd83('0x3')]=function(_0x2f0f73,_0x42b2c4){return client[_0xbd83('0x1')](_0xbd83('0x4'),{'body':_0x42b2c4,'options':{'where':{'uniqueid':_0x2f0f73},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0x7f5e=['UpdateFaxQueueReport','CreateFaxQueueReport','Request'];(function(_0x43529b,_0xd0752e){var _0x312adb=function(_0x649fb7){while(--_0x649fb7){_0x43529b['push'](_0x43529b['shift']());}};_0x312adb(++_0xd0752e);}(_0x7f5e,0x18d));var _0xe7f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7f5e[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports['create']=function(_0x53acb3){return client['Request'](_0xe7f5('0x0'),{'body':_0x53acb3,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x1daa29,_0x591852){return client[_0xe7f5('0x1')](_0xe7f5('0x2'),{'body':_0x591852,'options':{'where':{'uniqueid':_0x1daa29},'order':[['id','DESC']],'limit':0x1},'log':_0xe7f5('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 7f548de..e52b4d5 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 _0x4bde=['Intervals','../client','getIntervals','Request','name','Interval'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x1615c1,_0x54756a){_0x1615c1=_0x1615c1-0x0;var _0x2912a0=_0x4bde[_0x1615c1];return _0x2912a0;};'use strict';var client=require(_0xe4bd('0x0'));exports[_0xe4bd('0x1')]=function(){return function(){return client[_0xe4bd('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xe4bd('0x3')],'include':[{'model':_0xe4bd('0x4'),'as':_0xe4bd('0x5'),'attributes':['id',_0xe4bd('0x3'),'interval']}]},'log':_0xe4bd('0x1')});};}; \ No newline at end of file +var _0xe5b5=['Interval','Intervals','interval','../client','getIntervals','Request','GetInterval','name'];(function(_0x423ae4,_0x2d8a48){var _0x15402e=function(_0x2099ea){while(--_0x2099ea){_0x423ae4['push'](_0x423ae4['shift']());}};_0x15402e(++_0x2d8a48);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0xe5b5[_0x4d67b8];return _0x55af3b;};'use strict';var client=require(_0x5e5b('0x0'));exports[_0x5e5b('0x1')]=function(){return function(){return client[_0x5e5b('0x2')](_0x5e5b('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5e5b('0x4')],'include':[{'model':_0x5e5b('0x5'),'as':_0x5e5b('0x6'),'attributes':['id',_0x5e5b('0x4'),_0x5e5b('0x7')]}]},'log':_0x5e5b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 99f811a..5768d26 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 _0xe232=['UpdateMailInteraction','updateMailInteraction','addTags','Request','AddTagsToMailInteraction','update'];(function(_0x3e1744,_0x48b1f2){var _0x19c83b=function(_0x170978){while(--_0x170978){_0x3e1744['push'](_0x3e1744['shift']());}};_0x19c83b(++_0x48b1f2);}(_0xe232,0x9b));var _0x2e23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe232[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x2e23('0x0')]=function(_0x40ee58,_0x597247){return client['Request'](_0x2e23('0x1'),{'body':_0x597247,'options':{'where':{'id':_0x40ee58}},'log':_0x2e23('0x2')});};exports[_0x2e23('0x3')]=function(_0x3d0922,_0x20f6ef){return client[_0x2e23('0x4')](_0x2e23('0x5'),{'body':_0x20f6ef,'options':{'where':{'id':_0x3d0922}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x760b=['AddTagsToMailInteraction','../client','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x559434,_0x2f9870){var _0x252834=function(_0x548490){while(--_0x548490){_0x559434['push'](_0x559434['shift']());}};_0x252834(++_0x2f9870);}(_0x760b,0x19f));var _0xb760=function(_0x58997f,_0x5a9f7c){_0x58997f=_0x58997f-0x0;var _0x248748=_0x760b[_0x58997f];return _0x248748;};'use strict';var client=require(_0xb760('0x0'));exports['update']=function(_0x1d6b09,_0x57e7a7){return client[_0xb760('0x1')](_0xb760('0x2'),{'body':_0x57e7a7,'options':{'where':{'id':_0x1d6b09}},'log':_0xb760('0x3')});};exports[_0xb760('0x4')]=function(_0xba6ae3,_0x57c249){return client[_0xb760('0x1')](_0xb760('0x5'),{'body':_0x57c249,'options':{'where':{'id':_0xba6ae3}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 0705662..cde9344 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 _0xafdf=['../client','create','CreateMailMessage'];(function(_0x23a477,_0x36bd86){var _0x1a6fb2=function(_0x4e9f26){while(--_0x4e9f26){_0x23a477['push'](_0x23a477['shift']());}};_0x1a6fb2(++_0x36bd86);}(_0xafdf,0x75));var _0xfafd=function(_0x1b5db0,_0x410ee8){_0x1b5db0=_0x1b5db0-0x0;var _0x90ea95=_0xafdf[_0x1b5db0];return _0x90ea95;};'use strict';var client=require(_0xfafd('0x0'));exports[_0xfafd('0x1')]=function(_0x5b8da9){return client['Request'](_0xfafd('0x2'),{'body':_0x5b8da9,'log':'createMailMessage'});}; \ No newline at end of file +var _0x1e1d=['create','Request','createMailMessage'];(function(_0x4052b2,_0x32b19c){var _0x10c53c=function(_0x403b62){while(--_0x403b62){_0x4052b2['push'](_0x4052b2['shift']());}};_0x10c53c(++_0x32b19c);}(_0x1e1d,0xa8));var _0xd1e1=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x1e1d[_0x4b2863];return _0x567d67;};'use strict';var client=require('../client');exports[_0xd1e1('0x0')]=function(_0x3fd548){return client[_0xd1e1('0x1')]('CreateMailMessage',{'body':_0x3fd548,'log':_0xd1e1('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 9c95b10..0ff57bc 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 _0x7451=['strategy','User','Agents','online','mailPause','../client','GetMailQueue','name','timeout'];(function(_0x4b5a05,_0x1ce6e7){var _0x55c0ce=function(_0x1168bf){while(--_0x1168bf){_0x4b5a05['push'](_0x4b5a05['shift']());}};_0x55c0ce(++_0x1ce6e7);}(_0x7451,0xb0));var _0x1745=function(_0x24a22e,_0x1ad0ed){_0x24a22e=_0x24a22e-0x0;var _0x507a95=_0x7451[_0x24a22e];return _0x507a95;};'use strict';var client=require(_0x1745('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x1745('0x1'),{'options':{'raw':![],'attributes':['id',_0x1745('0x2'),_0x1745('0x3'),_0x1745('0x4')],'include':[{'model':_0x1745('0x5'),'as':_0x1745('0x6'),'attributes':['id',_0x1745('0x2'),_0x1745('0x7'),_0x1745('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xeb09=['online','mailPause','../client','getMailQueues','name','timeout','User','Agents'];(function(_0x2edd87,_0x4b49e8){var _0x2ad924=function(_0x4e8920){while(--_0x4e8920){_0x2edd87['push'](_0x2edd87['shift']());}};_0x2ad924(++_0x4b49e8);}(_0xeb09,0x7a));var _0x9eb0=function(_0x35662f,_0x1d682d){_0x35662f=_0x35662f-0x0;var _0x10ad70=_0xeb09[_0x35662f];return _0x10ad70;};'use strict';var client=require(_0x9eb0('0x0'));exports[_0x9eb0('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x9eb0('0x2'),_0x9eb0('0x3'),'strategy'],'include':[{'model':_0x9eb0('0x4'),'as':_0x9eb0('0x5'),'attributes':['id',_0x9eb0('0x2'),_0x9eb0('0x6'),_0x9eb0('0x7')]}]},'log':_0x9eb0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index f8c5898..d5d5c1f 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 _0x8977=['../client','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x2d347e,_0x4d139a){var _0x36b409=function(_0x1266ae){while(--_0x1266ae){_0x2d347e['push'](_0x2d347e['shift']());}};_0x36b409(++_0x4d139a);}(_0x8977,0x1b6));var _0x7897=function(_0x45b547,_0x50c48a){_0x45b547=_0x45b547-0x0;var _0x50d435=_0x8977[_0x45b547];return _0x50d435;};'use strict';var client=require(_0x7897('0x0'));exports['create']=function(_0xc327bd){return client[_0x7897('0x1')](_0x7897('0x2'),{'body':_0xc327bd,'log':'CreateMailQueueReport'});};exports[_0x7897('0x3')]=function(_0x3e023a,_0x1544a9){return client[_0x7897('0x1')](_0x7897('0x4'),{'body':_0x1544a9,'options':{'where':{'uniqueid':_0x3e023a},'order':[['id',_0x7897('0x5')]],'limit':0x1},'log':_0x7897('0x4')});}; \ No newline at end of file +var _0xee6b=['update','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xee6b,0x7a));var _0xbee6=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0xee6b[_0x4ec7f2];return _0x118004;};'use strict';var client=require(_0xbee6('0x0'));exports[_0xbee6('0x1')]=function(_0x94f922){return client[_0xbee6('0x2')](_0xbee6('0x3'),{'body':_0x94f922,'log':_0xbee6('0x3')});};exports[_0xbee6('0x4')]=function(_0x14e8ce,_0x1d522a){return client[_0xbee6('0x2')](_0xbee6('0x5'),{'body':_0x1d522a,'options':{'where':{'uniqueid':_0x14e8ce},'order':[['id','DESC']],'limit':0x1},'log':_0xbee6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 61565f1..b9b9bc8 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 _0xadfb=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xadfb,0x13f));var _0xbadf=function(_0x38f937,_0x781984){_0x38f937=_0x38f937-0x0;var _0xfb7fb3=_0xadfb[_0x38f937];return _0xfb7fb3;};'use strict';var client=require(_0xbadf('0x0'));exports[_0xbadf('0x1')]=function(_0x48f5a3,_0x18d071){return client['Request'](_0xbadf('0x2'),{'body':_0x18d071,'options':{'where':{'id':_0x48f5a3}},'log':_0xbadf('0x3')});};exports[_0xbadf('0x4')]=function(_0x4cc913,_0x3b1e47){return client['Request'](_0xbadf('0x5'),{'body':_0x3b1e47,'options':{'where':{'id':_0x4cc913}},'log':_0xbadf('0x6')});}; \ No newline at end of file +var _0xa2a4=['update','Request','UpdateOpenchannelInteraction','addTagsToChatInteraction','../client'];(function(_0x120376,_0x571898){var _0x28c529=function(_0x4f130c){while(--_0x4f130c){_0x120376['push'](_0x120376['shift']());}};_0x28c529(++_0x571898);}(_0xa2a4,0x135));var _0x4a2a=function(_0x5a90b1,_0x5758cf){_0x5a90b1=_0x5a90b1-0x0;var _0x495257=_0xa2a4[_0x5a90b1];return _0x495257;};'use strict';var client=require(_0x4a2a('0x0'));exports[_0x4a2a('0x1')]=function(_0x32a0aa,_0x2ef012){return client[_0x4a2a('0x2')](_0x4a2a('0x3'),{'body':_0x2ef012,'options':{'where':{'id':_0x32a0aa}},'log':'updateOpenchannelInteraction'});};exports['addTags']=function(_0x3abf6f,_0x4d8bac){return client[_0x4a2a('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x4d8bac,'options':{'where':{'id':_0x3abf6f}},'log':_0x4a2a('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index eed832b..d45d0ec 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 _0xe14d=['Request','createOpenchannelMessage','../client','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe14d,0x1ee));var _0xde14=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xe14d[_0x2b10c6];return _0x3789d2;};'use strict';var client=require(_0xde14('0x0'));exports[_0xde14('0x1')]=function(_0x1b5d3b){return client[_0xde14('0x2')]('CreateOpenchannelMessage',{'body':_0x1b5d3b,'log':_0xde14('0x3')});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0xedd9,0xfc));var _0x9edd=function(_0x1fcd40,_0x241fcb){_0x1fcd40=_0x1fcd40-0x0;var _0x56f968=_0xedd9[_0x1fcd40];return _0x56f968;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 31fb424..096871d 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 _0x85a8=['Agents','name','online','getOpenchannelQueues','../client','GetOpenchannelQueue','timeout','strategy','User'];(function(_0x4ddfc1,_0x2f2018){var _0x5144c8=function(_0x31e89b){while(--_0x31e89b){_0x4ddfc1['push'](_0x4ddfc1['shift']());}};_0x5144c8(++_0x2f2018);}(_0x85a8,0xca));var _0x885a=function(_0x441045,_0x2afbb4){_0x441045=_0x441045-0x0;var _0x5de0f4=_0x85a8[_0x441045];return _0x5de0f4;};'use strict';var client=require(_0x885a('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x885a('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x885a('0x2'),_0x885a('0x3')],'include':[{'model':_0x885a('0x4'),'as':_0x885a('0x5'),'attributes':['id',_0x885a('0x6'),_0x885a('0x7'),'openchannelPause']}]},'log':_0x885a('0x8')});};}; \ No newline at end of file +var _0xa23d=['getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','Agents','online','openchannelPause','../client'];(function(_0xf5541e,_0x53a22f){var _0x3aed8e=function(_0x1ee74c){while(--_0x1ee74c){_0xf5541e['push'](_0xf5541e['shift']());}};_0x3aed8e(++_0x53a22f);}(_0xa23d,0xef));var _0xda23=function(_0x422230,_0x1964a8){_0x422230=_0x422230-0x0;var _0x2c8f10=_0xa23d[_0x422230];return _0x2c8f10;};'use strict';var client=require(_0xda23('0x0'));exports[_0xda23('0x1')]=function(){return function(){return client[_0xda23('0x2')](_0xda23('0x3'),{'options':{'raw':![],'attributes':['id',_0xda23('0x4'),_0xda23('0x5'),_0xda23('0x6')],'include':[{'model':'User','as':_0xda23('0x7'),'attributes':['id',_0xda23('0x4'),_0xda23('0x8'),_0xda23('0x9')]}]},'log':_0xda23('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 6e6284e..0b72df2 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 _0xf85c=['update','Request','UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport'];(function(_0xc62995,_0x552578){var _0x238e75=function(_0x3755d2){while(--_0x3755d2){_0xc62995['push'](_0xc62995['shift']());}};_0x238e75(++_0x552578);}(_0xf85c,0x1a7));var _0xcf85=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xf85c[_0xef8146];return _0x5a6cb0;};'use strict';var client=require(_0xcf85('0x0'));exports[_0xcf85('0x1')]=function(_0x5165e0){return client['Request'](_0xcf85('0x2'),{'body':_0x5165e0,'log':'CreateOpenchannelQueueReport'});};exports[_0xcf85('0x3')]=function(_0x480ceb,_0x53af4d){return client[_0xcf85('0x4')](_0xcf85('0x5'),{'body':_0x53af4d,'options':{'where':{'uniqueid':_0x480ceb},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xbfcf=['create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x39ce33,_0x21db1e){var _0x384a32=function(_0x37a728){while(--_0x37a728){_0x39ce33['push'](_0x39ce33['shift']());}};_0x384a32(++_0x21db1e);}(_0xbfcf,0x1e9));var _0xfbfc=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0xbfcf[_0x10791d];return _0x1b4f9c;};'use strict';var client=require(_0xfbfc('0x0'));exports[_0xfbfc('0x1')]=function(_0x2ae493){return client[_0xfbfc('0x2')](_0xfbfc('0x3'),{'body':_0x2ae493,'log':_0xfbfc('0x3')});};exports[_0xfbfc('0x4')]=function(_0x1477e0,_0x29a85d){return client[_0xfbfc('0x2')](_0xfbfc('0x5'),{'body':_0x29a85d,'options':{'where':{'uniqueid':_0x1477e0},'order':[['id',_0xfbfc('0x6')]],'limit':0x1},'log':_0xfbfc('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 2345707..a238ac5 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 _0xf398=['../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x5d4516,_0xd7bf26){var _0x6af37b=function(_0x2f601c){while(--_0x2f601c){_0x5d4516['push'](_0x5d4516['shift']());}};_0x6af37b(++_0xd7bf26);}(_0xf398,0x181));var _0x8f39=function(_0x557db9,_0x52172f){_0x557db9=_0x557db9-0x0;var _0x1fa9be=_0xf398[_0x557db9];return _0x1fa9be;};'use strict';var client=require(_0x8f39('0x0'));exports[_0x8f39('0x1')]=function(_0x4837af,_0x426fb6){return client[_0x8f39('0x2')](_0x8f39('0x3'),{'body':_0x426fb6,'options':{'where':{'id':_0x4837af}},'log':_0x8f39('0x4')});};exports['addTags']=function(_0x2c2360,_0x6337a){return client[_0x8f39('0x2')](_0x8f39('0x5'),{'body':_0x6337a,'options':{'where':{'id':_0x2c2360}},'log':_0x8f39('0x6')});}; \ No newline at end of file +var _0x3f6b=['AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3f6b,0x10b));var _0xb3f6=function(_0x20f092,_0x492711){_0x20f092=_0x20f092-0x0;var _0x47bbec=_0x3f6b[_0x20f092];return _0x47bbec;};'use strict';var client=require(_0xb3f6('0x0'));exports[_0xb3f6('0x1')]=function(_0x2cc152,_0x3be137){return client[_0xb3f6('0x2')](_0xb3f6('0x3'),{'body':_0x3be137,'options':{'where':{'id':_0x2cc152}},'log':_0xb3f6('0x4')});};exports[_0xb3f6('0x5')]=function(_0x1100a8,_0x3a29d0){return client[_0xb3f6('0x2')](_0xb3f6('0x6'),{'body':_0x3a29d0,'options':{'where':{'id':_0x1100a8}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index dc40066..c739adb 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 _0x994b=['Request','CreateSmsMessage'];(function(_0x139f7e,_0x27c002){var _0x31fc43=function(_0xdc0ef3){while(--_0xdc0ef3){_0x139f7e['push'](_0x139f7e['shift']());}};_0x31fc43(++_0x27c002);}(_0x994b,0x198));var _0xb994=function(_0xedf622,_0x5a854d){_0xedf622=_0xedf622-0x0;var _0x245b71=_0x994b[_0xedf622];return _0x245b71;};'use strict';var client=require('../client');exports['create']=function(_0x56811e){return client[_0xb994('0x0')](_0xb994('0x1'),{'body':_0x56811e,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x6e86=['create','../client'];(function(_0x236ee0,_0x460e9f){var _0x5b05ae=function(_0x2238d6){while(--_0x2238d6){_0x236ee0['push'](_0x236ee0['shift']());}};_0x5b05ae(++_0x460e9f);}(_0x6e86,0x1e5));var _0x66e8=function(_0x16bb4b,_0x5fe431){_0x16bb4b=_0x16bb4b-0x0;var _0x8aeb84=_0x6e86[_0x16bb4b];return _0x8aeb84;};'use strict';var client=require(_0x66e8('0x0'));exports[_0x66e8('0x1')]=function(_0x4384e3){return client['Request']('CreateSmsMessage',{'body':_0x4384e3,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 073c688..90a9318 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 _0x0fcf=['strategy','User','Agents','online','smsPause','getSmsQueues','../client','Request','GetSmsQueue','name','timeout'];(function(_0x545448,_0x4bd2d2){var _0x21d1ad=function(_0x16d9d8){while(--_0x16d9d8){_0x545448['push'](_0x545448['shift']());}};_0x21d1ad(++_0x4bd2d2);}(_0x0fcf,0x145));var _0xf0fc=function(_0x20aaa1,_0x5ec354){_0x20aaa1=_0x20aaa1-0x0;var _0x3dc34f=_0x0fcf[_0x20aaa1];return _0x3dc34f;};'use strict';var client=require(_0xf0fc('0x0'));exports['getSmsQueues']=function(){return function(){return client[_0xf0fc('0x1')](_0xf0fc('0x2'),{'options':{'raw':![],'attributes':['id',_0xf0fc('0x3'),_0xf0fc('0x4'),_0xf0fc('0x5')],'include':[{'model':_0xf0fc('0x6'),'as':_0xf0fc('0x7'),'attributes':['id',_0xf0fc('0x3'),_0xf0fc('0x8'),_0xf0fc('0x9')]}]},'log':_0xf0fc('0xa')});};}; \ No newline at end of file +var _0xf34b=['User','Agents','online','../client','getSmsQueues','Request','GetSmsQueue','name','timeout','strategy'];(function(_0x4be58d,_0x36b7bb){var _0x19f0f5=function(_0x1f7473){while(--_0x1f7473){_0x4be58d['push'](_0x4be58d['shift']());}};_0x19f0f5(++_0x36b7bb);}(_0xf34b,0xa3));var _0xbf34=function(_0x1c14a4,_0x48ca5b){_0x1c14a4=_0x1c14a4-0x0;var _0x486007=_0xf34b[_0x1c14a4];return _0x486007;};'use strict';var client=require(_0xbf34('0x0'));exports[_0xbf34('0x1')]=function(){return function(){return client[_0xbf34('0x2')](_0xbf34('0x3'),{'options':{'raw':![],'attributes':['id',_0xbf34('0x4'),_0xbf34('0x5'),_0xbf34('0x6')],'include':[{'model':_0xbf34('0x7'),'as':_0xbf34('0x8'),'attributes':['id',_0xbf34('0x4'),_0xbf34('0x9'),'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 b33e553..b8ce068 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 _0x9b51=['DESC','../client','Request','CreateSmsQueueReport','update'];(function(_0x134058,_0x423995){var _0x14a1a9=function(_0x47a2c9){while(--_0x47a2c9){_0x134058['push'](_0x134058['shift']());}};_0x14a1a9(++_0x423995);}(_0x9b51,0x1d2));var _0x19b5=function(_0xdb017c,_0x5416a2){_0xdb017c=_0xdb017c-0x0;var _0x4778da=_0x9b51[_0xdb017c];return _0x4778da;};'use strict';var client=require(_0x19b5('0x0'));exports['create']=function(_0x5f1b29){return client[_0x19b5('0x1')](_0x19b5('0x2'),{'body':_0x5f1b29,'log':'CreateSmsQueueReport'});};exports[_0x19b5('0x3')]=function(_0x3815f2,_0x273c9a){return client['Request']('UpdateSmsQueueReport',{'body':_0x273c9a,'options':{'where':{'uniqueid':_0x3815f2},'order':[['id',_0x19b5('0x4')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0xb6db=['UpdateSmsQueueReport','DESC','Request','CreateSmsQueueReport','update'];(function(_0x4a4c3d,_0x4581f0){var _0x525a81=function(_0x24060e){while(--_0x24060e){_0x4a4c3d['push'](_0x4a4c3d['shift']());}};_0x525a81(++_0x4581f0);}(_0xb6db,0x16a));var _0xbb6d=function(_0x3cdad3,_0x3bc5b2){_0x3cdad3=_0x3cdad3-0x0;var _0x5486bd=_0xb6db[_0x3cdad3];return _0x5486bd;};'use strict';var client=require('../client');exports['create']=function(_0x33c766){return client[_0xbb6d('0x0')](_0xbb6d('0x1'),{'body':_0x33c766,'log':_0xbb6d('0x1')});};exports[_0xbb6d('0x2')]=function(_0x5a473f,_0xe084d6){return client[_0xbb6d('0x0')](_0xbb6d('0x3'),{'body':_0xe084d6,'options':{'where':{'uniqueid':_0x5a473f},'order':[['id',_0xbb6d('0x4')]],'limit':0x1},'log':_0xbb6d('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index becb1e7..717b019 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 _0xb253=['pauseType','voicePause','mailPause','faxPause','openchannelPause','chatCapacity','mailCapacity','../client','getAgents','GetUser','agent','online'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xb253,0x7f));var _0x3b25=function(_0x4bc5b0,_0x98be22){_0x4bc5b0=_0x4bc5b0-0x0;var _0x51b246=_0xb253[_0x4bc5b0];return _0x51b246;};'use strict';var client=require(_0x3b25('0x0'));exports[_0x3b25('0x1')]=function(){return function(){return client['Request'](_0x3b25('0x2'),{'options':{'raw':!![],'where':{'role':_0x3b25('0x3')},'attributes':['id','name',_0x3b25('0x4'),_0x3b25('0x5'),'lastPauseAt',_0x3b25('0x6'),'chatPause',_0x3b25('0x7'),_0x3b25('0x8'),'smsPause',_0x3b25('0x9'),_0x3b25('0xa'),_0x3b25('0xb'),'faxCapacity','smsCapacity','openchannelCapacity']},'log':_0x3b25('0x1')});};}; \ No newline at end of file +var _0x49ae=['online','pauseType','lastPauseAt','voicePause','faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','GetUser','agent'];(function(_0x536822,_0x8954cd){var _0x4e72d0=function(_0x5a0bae){while(--_0x5a0bae){_0x536822['push'](_0x536822['shift']());}};_0x4e72d0(++_0x8954cd);}(_0x49ae,0x1a0));var _0xe49a=function(_0x508911,_0x26e1d2){_0x508911=_0x508911-0x0;var _0x47ced5=_0x49ae[_0x508911];return _0x47ced5;};'use strict';var client=require('../client');exports[_0xe49a('0x0')]=function(){return function(){return client[_0xe49a('0x1')](_0xe49a('0x2'),{'options':{'raw':!![],'where':{'role':_0xe49a('0x3')},'attributes':['id','name',_0xe49a('0x4'),_0xe49a('0x5'),_0xe49a('0x6'),_0xe49a('0x7'),'chatPause','mailPause',_0xe49a('0x8'),_0xe49a('0x9'),_0xe49a('0xa'),'chatCapacity',_0xe49a('0xb'),_0xe49a('0xc'),_0xe49a('0xd'),_0xe49a('0xe')]},'log':_0xe49a('0x0')});};}; \ 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 972e168..284a607 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 _0x6339=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','atimeout','channel','START:%s','rules','end','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','routing'];(function(_0x7abcb9,_0x43039f){var _0x52648a=function(_0x5f2d05){while(--_0x5f2d05){_0x7abcb9['push'](_0x7abcb9['shift']());}};_0x52648a(++_0x43039f);}(_0x6339,0xe2));var _0x9633=function(_0x4971b5,_0x1c39a4){_0x4971b5=_0x4971b5-0x0;var _0x20f4a0=_0x6339[_0x4971b5];return _0x20f4a0;};'use strict';var schema=require(_0x9633('0x0'));var _=require(_0x9633('0x1'));var util=require(_0x9633('0x2'));var seqqueue=require(_0x9633('0x3'));var logger=require('../../../../config/logger')(_0x9633('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x9633('0x5'),'required':!![],'message':_0x9633('0x6')},'timeout':{'type':'number','message':_0x9633('0x7')}});function writeLog(_0x22aa5d,_0x49ab49,_0x1e6d37){return logger[_0x9633('0x8')](util[_0x9633('0x9')](_0x9633('0xa'),_0x22aa5d,_0x49ab49[_0x9633('0xb')],_0x1e6d37));}function handleFindAgent(_0x575ade){return function(_0x33ab9a){return _0x33ab9a[_0x9633('0xb')][_0x9633('0xc')]()===_0x575ade[_0x9633('0xc')]();};}exports[_0x9633('0xd')]=function(_0x276ac8,_0x3ad6bf,_0x131ccc,_0x5367b0){return function(_0x59e5df){try{var _0x3e282e={'name':_0x3ad6bf[0x0],'timeout':_0x3ad6bf[0x1]};var _0x23f312=queue[_0x9633('0x0')](_0x3e282e,{'typecast':!![]});if(_0x23f312['length']){logger['error'](_0x9633('0xe'),_0x276ac8,_[_0x9633('0xf')](_0x23f312,_0x9633('0x10'))[_0x9633('0x11')](',\x20'));_0x59e5df[_0x9633('0x12')]();}else{var _0x3d841e=_['find'](_0x131ccc[_0x9633('0x13')],handleFindAgent(_0x3e282e[_0x9633('0xb')]));if(_0x3d841e){var _0x98fb39=(_0x3e282e[_0x9633('0x14')]||0xa)*0x3e8;var _0x4aef54,_0x327b8d;var _0x5a5a92=seqqueue['createQueue'](_0x98fb39);_0x5a5a92['id']=_0x276ac8;_0x5a5a92[_0x9633('0x15')]=_0x98fb39;_0x5a5a92[_0x9633('0x16')]=_0x5367b0[_0x9633('0x16')];writeLog(_0x276ac8,_0x3d841e,util[_0x9633('0x9')](_0x9633('0x17'),_0x98fb39));_0x131ccc[_0x9633('0x18')][_0x276ac8]['on'](_0x9633('0x19'),function(){_0x5a5a92[_0x9633('0x1a')]();clearTimeout(_0x327b8d);_0x327b8d=undefined;if(_0x131ccc[_0x9633('0x18')][_0x276ac8]){delete _0x131ccc[_0x9633('0x18')][_0x276ac8];}logger[_0x9633('0x8')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x276ac8);_0x59e5df['stop']();});_0x327b8d=setTimeout(function(){clearTimeout(_0x327b8d);_0x5a5a92[_0x9633('0x1a')]();logger[_0x9633('0x8')]('[%s][AGENT]\x20ROUTING\x20END',_0x276ac8);_0x59e5df[_0x9633('0x1b')]();},_0x98fb39);strategy[_0x9633('0x1c')](_0x5a5a92,_0x3d841e,_0x131ccc,_0x5367b0);}else{logger[_0x9633('0x1d')](_0x9633('0x1e'),_0x276ac8,_0x3e282e[_0x9633('0xb')]);_0x59e5df['stop']();}}}catch(_0x25c7c6){console['log'](_0x25c7c6);logger['error'](_0x9633('0x1f'),_0x276ac8,_0x25c7c6[_0x9633('0x20')]);_0x59e5df['stop']();}};}; \ No newline at end of file +var _0xeab3=['lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','createQueue','atimeout','channel','START:%s','end','close','rules','[%s][AGENT]\x20ROUTING\x20END','agent','log','stack','validate'];(function(_0x30144e,_0x1c9bc3){var _0xe15c6c=function(_0x50dd17){while(--_0x50dd17){_0x30144e['push'](_0x30144e['shift']());}};_0xe15c6c(++_0x1c9bc3);}(_0xeab3,0xdd));var _0x3eab=function(_0x209581,_0x11f596){_0x209581=_0x209581-0x0;var _0x2fed45=_0xeab3[_0x209581];return _0x2fed45;};'use strict';var schema=require(_0x3eab('0x0'));var _=require(_0x3eab('0x1'));var util=require(_0x3eab('0x2'));var seqqueue=require(_0x3eab('0x3'));var logger=require(_0x3eab('0x4'))(_0x3eab('0x5'));var strategy=require(_0x3eab('0x6'));var queue=schema({'name':{'type':_0x3eab('0x7'),'required':!![],'message':_0x3eab('0x8')},'timeout':{'type':_0x3eab('0x9'),'message':_0x3eab('0xa')}});function writeLog(_0x53a083,_0x1e1005,_0x161c3f){return logger[_0x3eab('0xb')](util[_0x3eab('0xc')](_0x3eab('0xd'),_0x53a083,_0x1e1005[_0x3eab('0xe')],_0x161c3f));}function handleFindAgent(_0x3dc0d1){return function(_0xc4a421){return _0xc4a421[_0x3eab('0xe')][_0x3eab('0xf')]()===_0x3dc0d1['toLowerCase']();};}exports[_0x3eab('0x10')]=function(_0x3b43b2,_0x931e80,_0x37085d,_0xc652b8){return function(_0x13626c){try{var _0x11a9b7={'name':_0x931e80[0x0],'timeout':_0x931e80[0x1]};var _0x2b4f34=queue['validate'](_0x11a9b7,{'typecast':!![]});if(_0x2b4f34[_0x3eab('0x11')]){logger[_0x3eab('0x12')](_0x3eab('0x13'),_0x3b43b2,_[_0x3eab('0x14')](_0x2b4f34,_0x3eab('0x15'))[_0x3eab('0x16')](',\x20'));_0x13626c[_0x3eab('0x17')]();}else{var _0x49aa7a=_[_0x3eab('0x18')](_0x37085d[_0x3eab('0x19')],handleFindAgent(_0x11a9b7[_0x3eab('0xe')]));if(_0x49aa7a){var _0x42afa3=(_0x11a9b7['timeout']||0xa)*0x3e8;var _0x19e3f5,_0x3ce95e;var _0x3c8e1c=seqqueue[_0x3eab('0x1a')](_0x42afa3);_0x3c8e1c['id']=_0x3b43b2;_0x3c8e1c[_0x3eab('0x1b')]=_0x42afa3;_0x3c8e1c[_0x3eab('0x1c')]=_0xc652b8[_0x3eab('0x1c')];writeLog(_0x3b43b2,_0x49aa7a,util['format'](_0x3eab('0x1d'),_0x42afa3));_0x37085d['rules'][_0x3b43b2]['on'](_0x3eab('0x1e'),function(){_0x3c8e1c[_0x3eab('0x1f')]();clearTimeout(_0x3ce95e);_0x3ce95e=undefined;if(_0x37085d[_0x3eab('0x20')][_0x3b43b2]){delete _0x37085d['rules'][_0x3b43b2];}logger[_0x3eab('0xb')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3b43b2);_0x13626c['stop']();});_0x3ce95e=setTimeout(function(){clearTimeout(_0x3ce95e);_0x3c8e1c[_0x3eab('0x1f')]();logger[_0x3eab('0xb')](_0x3eab('0x21'),_0x3b43b2);_0x13626c['next']();},_0x42afa3);strategy[_0x3eab('0x22')](_0x3c8e1c,_0x49aa7a,_0x37085d,_0xc652b8);}else{logger[_0x3eab('0x12')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x3b43b2,_0x11a9b7['name']);_0x13626c[_0x3eab('0x17')]();}}}catch(_0x32b7bf){console[_0x3eab('0x23')](_0x32b7bf);logger['error']('[%s][QUEUE]\x20%s',_0x3b43b2,_0x32b7bf[_0x3eab('0x24')]);_0x13626c[_0x3eab('0x17')]();}};}; \ 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 f4438ba..fac1e30 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 _0x0cf8=['InteractionId','created','getMustacheRender','create','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','body','toString','postText','amazonlex','Message','then','dialogState','Failed','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','account','AccountId'];(function(_0x2163fc,_0x58ea83){var _0xd34cbf=function(_0x3b10a6){while(--_0x3b10a6){_0x2163fc['push'](_0x2163fc['shift']());}};_0xd34cbf(++_0x58ea83);}(_0x0cf8,0x1cd));var _0x80cf=function(_0x379b5c,_0x378597){_0x379b5c=_0x379b5c-0x0;var _0x50821d=_0x0cf8[_0x379b5c];return _0x50821d;};'use strict';var _=require(_0x80cf('0x0'));var moment=require('moment');var AWS=require('aws-sdk');var utils=require(_0x80cf('0x1'));var logger=require(_0x80cf('0x2'))(_0x80cf('0x3'));var rpc={'chatMessage':require(_0x80cf('0x4')),'openchannelMessage':require(_0x80cf('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x80cf('0x6')]=function(_0x4e8487,_0x26b152){return function(_0x3374d5){try{if(!_[_0x80cf('0x7')](this[_0x80cf('0x8')]['UserId'])){logger[_0x80cf('0x9')](_0x80cf('0xa'),_0x4e8487,_0x80cf('0xb'));return _0x3374d5[_0x80cf('0xc')]();}var _0x3f27ad={'ContactId':this[_0x80cf('0xd')]['id'],'sentAt':moment()[_0x80cf('0xe')](_0x80cf('0xf')),'direction':_0x80cf('0x10')};var _0x32d8a2=this['channel'];if(_0x32d8a2==='chat'){_0x3f27ad['ChatWebsiteId']=this[_0x80cf('0x11')]['id'];}else{_0x3f27ad[_['upperFirst'](_0x32d8a2)+_0x80cf('0x12')]=this[_0x80cf('0x11')]['id'];}_0x3f27ad[_['upperFirst'](_0x32d8a2)+_0x80cf('0x13')]=this[_0x80cf('0x8')]['id'];if(this['interaction'][_0x80cf('0x14')]){var _0xad9633=_0x26b152[0x4];if(!_['isEmpty'](_0xad9633)){_0x3f27ad['body']=utils[_0x80cf('0x15')](_0xad9633,this);return rpc[_0x32d8a2+'Message'][_0x80cf('0x16')](_0x3f27ad)['then'](function(_0x1906ba){logger[_0x80cf('0x9')]('[%s][AMAZONLEX]\x20%s',_0x4e8487,_0x3f27ad['body']);})[_0x80cf('0x17')](function(_0x60a3fc){logger[_0x80cf('0x18')](_0x80cf('0xa'),_0x4e8487,JSON[_0x80cf('0x19')](_0x60a3fc));})[_0x80cf('0x1a')](function(){logger[_0x80cf('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4e8487);_0x3374d5['stop']();});}else{logger[_0x80cf('0x9')](_0x80cf('0x1b'),_0x4e8487);_0x3374d5[_0x80cf('0x1c')]();}}else{var _0x3c0962=this;var _0x32bc2e=new AWS[(_0x80cf('0x1d'))]({'accessKeyId':_0x26b152[0x0],'secretAccessKey':_0x26b152[0x1],'region':_0x26b152[0x2]});var _0x1daa3b={'botAlias':_0x80cf('0x1e'),'botName':_0x26b152[0x3],'inputText':this[_0x80cf('0x1f')][_0x80cf('0x20')],'userId':this['interaction']['id'][_0x80cf('0x21')]()};_0x32bc2e[_0x80cf('0x22')](_0x1daa3b,function(_0x7b8be,_0x369f2e){if(_0x7b8be){logger[_0x80cf('0x18')]('[%s][AMAZONLEX]\x20%s',_0x4e8487,_0x7b8be[_0x80cf('0x1f')]);_0x3374d5[_0x80cf('0xc')]();}else if(_0x369f2e&&_0x369f2e[_0x80cf('0x1f')]){_0x3c0962[_0x80cf('0x20')][_0x80cf('0x23')]=_0x369f2e;_0x3f27ad[_0x80cf('0x20')]=_0x369f2e[_0x80cf('0x1f')];return rpc[_0x32d8a2+_0x80cf('0x24')][_0x80cf('0x16')](_0x3f27ad)[_0x80cf('0x25')](function(_0x444225){logger[_0x80cf('0x9')](_0x80cf('0xa'),_0x4e8487,_0x3f27ad[_0x80cf('0x20')]);if(_0x369f2e[_0x80cf('0x26')]==_0x80cf('0x27')){_0x3374d5['next']();}else{_0x3374d5[_0x80cf('0x1c')]();}})['catch'](function(_0x843b4c){logger[_0x80cf('0x18')](_0x80cf('0xa'),_0x4e8487,JSON[_0x80cf('0x19')](_0x843b4c));_0x3374d5[_0x80cf('0xc')]();});}else{_0x3374d5['next']();}});}}catch(_0x60974a){logger[_0x80cf('0x18')](_0x80cf('0xa'),_0x4e8487,JSON['stringify'](_0x60974a));_0x3374d5['stop']();}};}; \ No newline at end of file +var _0xe742=['interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','channel','chat','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','finally','stop','$LATEST','message','toString','postText','amazonlex','dialogState','Failed','stringify','moment','aws-sdk','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence'];(function(_0x5a4bfa,_0x87f1fd){var _0x31c1e4=function(_0x41bc8c){while(--_0x41bc8c){_0x5a4bfa['push'](_0x5a4bfa['shift']());}};_0x31c1e4(++_0x87f1fd);}(_0xe742,0xde));var _0x2e74=function(_0x4b5c09,_0x56814b){_0x4b5c09=_0x4b5c09-0x0;var _0x1456d7=_0xe742[_0x4b5c09];return _0x1456d7;};'use strict';var _=require('lodash');var moment=require(_0x2e74('0x0'));var AWS=require(_0x2e74('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x2e74('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2e74('0x3')),'mailMessage':require(_0x2e74('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x2e74('0x5')]=function(_0x23c236,_0x3ce619){return function(_0x38e4e3){try{if(!_['isNil'](this[_0x2e74('0x6')]['UserId'])){logger[_0x2e74('0x7')](_0x2e74('0x8'),_0x23c236,_0x2e74('0x9'));return _0x38e4e3[_0x2e74('0xa')]();}var _0x57b6f7={'ContactId':this[_0x2e74('0xb')]['id'],'sentAt':moment()[_0x2e74('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};var _0x535c8f=this[_0x2e74('0xd')];if(_0x535c8f===_0x2e74('0xe')){_0x57b6f7[_0x2e74('0xf')]=this['account']['id'];}else{_0x57b6f7[_[_0x2e74('0x10')](_0x535c8f)+'AccountId']=this[_0x2e74('0x11')]['id'];}_0x57b6f7[_['upperFirst'](_0x535c8f)+_0x2e74('0x12')]=this[_0x2e74('0x6')]['id'];if(this[_0x2e74('0x6')][_0x2e74('0x13')]){var _0x357bb7=_0x3ce619[0x4];if(!_[_0x2e74('0x14')](_0x357bb7)){_0x57b6f7[_0x2e74('0x15')]=utils[_0x2e74('0x16')](_0x357bb7,this);return rpc[_0x535c8f+_0x2e74('0x17')][_0x2e74('0x18')](_0x57b6f7)[_0x2e74('0x19')](function(_0x31b3f4){logger['info']('[%s][AMAZONLEX]\x20%s',_0x23c236,_0x57b6f7['body']);})[_0x2e74('0x1a')](function(_0x2fb763){logger[_0x2e74('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x23c236,JSON['stringify'](_0x2fb763));})[_0x2e74('0x1c')](function(){logger[_0x2e74('0x7')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x23c236);_0x38e4e3[_0x2e74('0x1d')]();});}else{logger[_0x2e74('0x7')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x23c236);_0x38e4e3['stop']();}}else{var _0x4277d9=this;var _0x468e55=new AWS['LexRuntime']({'accessKeyId':_0x3ce619[0x0],'secretAccessKey':_0x3ce619[0x1],'region':_0x3ce619[0x2]});var _0x1a9813={'botAlias':_0x2e74('0x1e'),'botName':_0x3ce619[0x3],'inputText':this[_0x2e74('0x1f')][_0x2e74('0x15')],'userId':this['interaction']['id'][_0x2e74('0x20')]()};_0x468e55[_0x2e74('0x21')](_0x1a9813,function(_0x4665dd,_0x1ef631){if(_0x4665dd){logger['error'](_0x2e74('0x8'),_0x23c236,_0x4665dd[_0x2e74('0x1f')]);_0x38e4e3['next']();}else if(_0x1ef631&&_0x1ef631[_0x2e74('0x1f')]){_0x4277d9['body'][_0x2e74('0x22')]=_0x1ef631;_0x57b6f7[_0x2e74('0x15')]=_0x1ef631[_0x2e74('0x1f')];return rpc[_0x535c8f+_0x2e74('0x17')][_0x2e74('0x18')](_0x57b6f7)['then'](function(_0x3c5458){logger[_0x2e74('0x7')](_0x2e74('0x8'),_0x23c236,_0x57b6f7[_0x2e74('0x15')]);if(_0x1ef631[_0x2e74('0x23')]==_0x2e74('0x24')){_0x38e4e3['next']();}else{_0x38e4e3[_0x2e74('0x1d')]();}})[_0x2e74('0x1a')](function(_0x4f38f6){logger[_0x2e74('0x1b')](_0x2e74('0x8'),_0x23c236,JSON['stringify'](_0x4f38f6));_0x38e4e3[_0x2e74('0xa')]();});}else{_0x38e4e3[_0x2e74('0xa')]();}});}}catch(_0x21d873){logger[_0x2e74('0x1b')](_0x2e74('0x8'),_0x23c236,JSON[_0x2e74('0x25')](_0x21d873));_0x38e4e3['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index edd01a1..41b328b 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 _0xe706=['next','channel','getMustacheRender','YYYY-MM-DD\x20HH:mm:ss','out','message','from','read','subject','Re:','Re:\x20','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','replace','body','';return mailRpc[_0x6e70('0x33')](_0x228350,_0x37b3e0)['then'](function(_0x259486){logger['info'](_0x6e70('0x34'),_0x1b0389);_0x37b3e0[_0x6e70('0x2c')]=_0x259486[_0x6e70('0x16')]['messageId'];return rpc[_0x743eb5+_0x6e70('0x22')][_0x6e70('0x35')](_0x37b3e0);})['then'](function(_0x13d673){logger[_0x6e70('0xe')]('[%s][AUTOREPLY]\x20%s',_0x1b0389,JSON[_0x6e70('0x36')](_0x13d673));})[_0x6e70('0x37')](function(_0x2d52bd){logger[_0x6e70('0x38')](_0x6e70('0x39'),_0x1b0389,JSON[_0x6e70('0x36')](_0x2d52bd));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}else{return rpc[this[_0x6e70('0x12')]+_0x6e70('0x22')]['create'](_0x37b3e0)[_0x6e70('0x3b')](function(_0x4795a0){logger[_0x6e70('0xe')](_0x6e70('0xf'),_0x1b0389,_0x37b3e0[_0x6e70('0x30')]);})[_0x6e70('0x37')](function(_0x233a83){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON[_0x6e70('0x36')](_0x233a83));})[_0x6e70('0x3a')](function(){_0x36357b[_0x6e70('0x11')]();});}}}catch(_0x2a5444){logger[_0x6e70('0x38')](_0x6e70('0xf'),_0x1b0389,JSON['stringify'](_0x2a5444));_0x36357b['stop']();}};}; \ No newline at end of file +var _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['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 cee1577..fed6a26 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 _0xd027=['update','interaction','catch','error','stringify','stop','[%s][CLOSE]\x20%s','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x1d8b31,_0xef220e){var _0x2548ce=function(_0x2cb76a){while(--_0x2cb76a){_0x1d8b31['push'](_0x1d8b31['shift']());}};_0x2548ce(++_0xef220e);}(_0xd027,0x197));var _0x7d02=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd027[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var logger=require(_0x7d02('0x0'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x7d02('0x1')),'smsInteraction':require(_0x7d02('0x2')),'mailInteraction':require(_0x7d02('0x3')),'faxInteraction':require(_0x7d02('0x4'))};exports[_0x7d02('0x5')]=function(_0x19cf80,_0xfd64c3,_0x2e4687,_0x50824f){return function(_0x1e75e2){try{logger[_0x7d02('0x6')](_0x7d02('0x7'),_0x19cf80,_0xfd64c3[0x0]);var _0x4442c5={'closed':0x1,'closedAt':moment()[_0x7d02('0x8')](_0x7d02('0x9')),'closeReason':_0x7d02('0xa'),'disposition':_0xfd64c3[0x0]};if(rpc[_0x50824f[_0x7d02('0xb')]+_0x7d02('0xc')]){rpc[_0x50824f[_0x7d02('0xb')]+_0x7d02('0xc')][_0x7d02('0xd')](_0x50824f[_0x7d02('0xe')]['id'],_0x4442c5)['then'](function(_0x30e2ec){logger[_0x7d02('0x6')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x19cf80,_0x50824f[_0x7d02('0xe')]['id']);})[_0x7d02('0xf')](function(_0x3fb728){logger[_0x7d02('0x10')]('[%s][CLOSE]\x20%s',_0x19cf80,JSON[_0x7d02('0x11')](_0x3fb728));})['finally'](function(){_0x1e75e2[_0x7d02('0x12')]();});}}catch(_0x1e38b5){logger['error'](_0x7d02('0x13'),_0x19cf80,JSON[_0x7d02('0x11')](_0x1e38b5));_0x1e75e2['stop']();}};}; \ No newline at end of file +var _0xed3c=['finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','format','Interaction','channel','update','interaction','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify'];(function(_0x41b164,_0x48d6f1){var _0x635742=function(_0x182dcc){while(--_0x182dcc){_0x41b164['push'](_0x41b164['shift']());}};_0x635742(++_0x48d6f1);}(_0xed3c,0x1a6));var _0xced3=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0xed3c[_0x65d12e];return _0x4274e0;};'use strict';var moment=require(_0xced3('0x0'));var logger=require(_0xced3('0x1'))(_0xced3('0x2'));var rpc={'chatInteraction':require(_0xced3('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xced3('0x4')),'mailInteraction':require(_0xced3('0x5')),'faxInteraction':require(_0xced3('0x6'))};exports['consequence']=function(_0x51e500,_0x3d3aa0,_0x1ada18,_0x2f92f8){return function(_0x1cd694){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x51e500,_0x3d3aa0[0x0]);var _0x5ca701={'closed':0x1,'closedAt':moment()[_0xced3('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':'system','disposition':_0x3d3aa0[0x0]};if(rpc[_0x2f92f8['channel']+_0xced3('0x8')]){rpc[_0x2f92f8[_0xced3('0x9')]+_0xced3('0x8')][_0xced3('0xa')](_0x2f92f8[_0xced3('0xb')]['id'],_0x5ca701)['then'](function(_0x36ea7f){logger[_0xced3('0xc')](_0xced3('0xd'),_0x51e500,_0x2f92f8['interaction']['id']);})[_0xced3('0xe')](function(_0x19b8c2){logger[_0xced3('0xf')](_0xced3('0x10'),_0x51e500,JSON[_0xced3('0x11')](_0x19b8c2));})[_0xced3('0x12')](function(){_0x1cd694[_0xced3('0x13')]();});}}catch(_0x5aadb6){logger[_0xced3('0xf')]('[%s][CLOSE]\x20%s',_0x51e500,JSON[_0xced3('0x11')](_0x5aadb6));_0x1cd694[_0xced3('0x13')]();}};}; \ 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 e72ca23..6191833 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 _0x7d62=['apiai-promise','md5','./utils','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','account','upperFirst','AccountId','created','isEmpty','Message','create','body','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','then','dialogflow','result','speech','metadata','endConversation','error','message','lodash','moment'];(function(_0x10ab17,_0x24de77){var _0xbbb279=function(_0x47eba2){while(--_0x47eba2){_0x10ab17['push'](_0x10ab17['shift']());}};_0xbbb279(++_0x24de77);}(_0x7d62,0xfa));var _0x27d6=function(_0x29f730,_0x23d7ed){_0x29f730=_0x29f730-0x0;var _0x189806=_0x7d62[_0x29f730];return _0x189806;};'use strict';var _=require(_0x27d6('0x0'));var moment=require(_0x27d6('0x1'));var apiai=require(_0x27d6('0x2'));var md5=require(_0x27d6('0x3'));var utils=require(_0x27d6('0x4'));var logger=require('../../../../config/logger')(_0x27d6('0x5'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x27d6('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x27d6('0x7')),'faxMessage':require(_0x27d6('0x8'))};exports[_0x27d6('0x9')]=function(_0x2a4a9e,_0x53950f){return function(_0x2d103a){try{if(!_['isNil'](this[_0x27d6('0xa')]['UserId'])){logger[_0x27d6('0xb')](_0x27d6('0xc'),_0x2a4a9e,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2d103a[_0x27d6('0xd')]();}var _0x498841={'ContactId':this[_0x27d6('0xe')]['id'],'sentAt':moment()[_0x27d6('0xf')](_0x27d6('0x10')),'direction':_0x27d6('0x11')};var _0x2ddff9=this[_0x27d6('0x12')];if(_0x2ddff9==='chat'){_0x498841['ChatWebsiteId']=this[_0x27d6('0x13')]['id'];}else{_0x498841[_[_0x27d6('0x14')](_0x2ddff9)+_0x27d6('0x15')]=this[_0x27d6('0x13')]['id'];}_0x498841[_['upperFirst'](_0x2ddff9)+'InteractionId']=this['interaction']['id'];if(this[_0x27d6('0xa')][_0x27d6('0x16')]){var _0x3bf6e3=_0x53950f[0x2];if(!_[_0x27d6('0x17')](_0x3bf6e3)){_0x498841['body']=utils['getMustacheRender'](_0x3bf6e3,this);return rpc[_0x2ddff9+_0x27d6('0x18')][_0x27d6('0x19')](_0x498841)['then'](function(_0x1b5c0a){logger[_0x27d6('0xb')](_0x27d6('0xc'),_0x2a4a9e,_0x498841[_0x27d6('0x1a')]);})[_0x27d6('0x1b')](function(_0x49edaa){logger['error'](_0x27d6('0xc'),_0x2a4a9e,JSON[_0x27d6('0x1c')](_0x49edaa));})[_0x27d6('0x1d')](function(){logger[_0x27d6('0xb')](_0x27d6('0x1e'),_0x2a4a9e);_0x2d103a['stop']();});}else{logger[_0x27d6('0xb')](_0x27d6('0x1f'),_0x2a4a9e);_0x2d103a[_0x27d6('0x20')]();}}else{var _0x593426=this;var _0x1a601e=apiai(_0x53950f[0x0],{'language':_0x53950f[0x1]||'en'});return _0x1a601e[_0x27d6('0x21')](this['message'][_0x27d6('0x1a')],{'sessionId':md5(this[_0x27d6('0xa')]['id'])})[_0x27d6('0x22')](function(_0x496717){_0x593426[_0x27d6('0x1a')][_0x27d6('0x23')]=_0x496717;_0x498841[_0x27d6('0x1a')]=_0x496717[_0x27d6('0x24')]['fulfillment'][_0x27d6('0x25')];return rpc[_0x2ddff9+_0x27d6('0x18')][_0x27d6('0x19')](_0x498841)[_0x27d6('0x22')](function(_0x48536c){logger[_0x27d6('0xb')](_0x27d6('0xc'),_0x2a4a9e,_0x498841['body']);if(_0x496717['result'][_0x27d6('0x26')][_0x27d6('0x27')]){_0x2d103a[_0x27d6('0xd')]();}else{_0x2d103a['stop']();}})[_0x27d6('0x1b')](function(_0x22bd14){logger['error'](_0x27d6('0xc'),_0x2a4a9e,JSON['stringify'](_0x22bd14));_0x2d103a[_0x27d6('0xd')]();});})['catch'](function(_0xdb6a86){logger[_0x27d6('0x28')](_0x27d6('0xc'),_0x2a4a9e,_0xdb6a86[_0x27d6('0x29')]);_0x2d103a[_0x27d6('0xd')]();});}}catch(_0x28fbde){logger['error'](_0x27d6('0xc'),_0x2a4a9e,JSON[_0x27d6('0x1c')](_0x28fbde));_0x2d103a[_0x27d6('0x20')]();}};}; \ No newline at end of file +var _0x4745=['../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','isEmpty','body','getMustacheRender','Message','create','catch','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','then','metadata','error','stringify','lodash','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage'];(function(_0x5a6e4e,_0xa59e83){var _0x2f89f=function(_0x17072a){while(--_0x17072a){_0x5a6e4e['push'](_0x5a6e4e['shift']());}};_0x2f89f(++_0xa59e83);}(_0x4745,0x84));var _0x5474=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x4745[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x5474('0x0'));var moment=require('moment');var apiai=require(_0x5474('0x1'));var md5=require(_0x5474('0x2'));var utils=require(_0x5474('0x3'));var logger=require(_0x5474('0x4'))('routing');var rpc={'chatMessage':require(_0x5474('0x5')),'openchannelMessage':require(_0x5474('0x6')),'mailMessage':require(_0x5474('0x7')),'smsMessage':require(_0x5474('0x8')),'faxMessage':require(_0x5474('0x9'))};exports[_0x5474('0xa')]=function(_0x55594b,_0xb3a654){return function(_0x5ec268){try{if(!_[_0x5474('0xb')](this['interaction'][_0x5474('0xc')])){logger[_0x5474('0xd')](_0x5474('0xe'),_0x55594b,_0x5474('0xf'));return _0x5ec268[_0x5474('0x10')]();}var _0x6f6869={'ContactId':this[_0x5474('0x11')]['id'],'sentAt':moment()[_0x5474('0x12')](_0x5474('0x13')),'direction':_0x5474('0x14')};var _0x131a3e=this[_0x5474('0x15')];if(_0x131a3e===_0x5474('0x16')){_0x6f6869[_0x5474('0x17')]=this[_0x5474('0x18')]['id'];}else{_0x6f6869[_[_0x5474('0x19')](_0x131a3e)+_0x5474('0x1a')]=this[_0x5474('0x18')]['id'];}_0x6f6869[_[_0x5474('0x19')](_0x131a3e)+_0x5474('0x1b')]=this[_0x5474('0x1c')]['id'];if(this[_0x5474('0x1c')]['created']){var _0x4ed932=_0xb3a654[0x2];if(!_[_0x5474('0x1d')](_0x4ed932)){_0x6f6869[_0x5474('0x1e')]=utils[_0x5474('0x1f')](_0x4ed932,this);return rpc[_0x131a3e+_0x5474('0x20')][_0x5474('0x21')](_0x6f6869)['then'](function(_0x3ccd3d){logger[_0x5474('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x55594b,_0x6f6869[_0x5474('0x1e')]);})[_0x5474('0x22')](function(_0x98b7de){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x55594b,JSON['stringify'](_0x98b7de));})['finally'](function(){logger[_0x5474('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x55594b);_0x5ec268[_0x5474('0x23')]();});}else{logger[_0x5474('0xd')](_0x5474('0x24'),_0x55594b);_0x5ec268['stop']();}}else{var _0x3e8483=this;var _0x3ab021=apiai(_0xb3a654[0x0],{'language':_0xb3a654[0x1]||'en'});return _0x3ab021[_0x5474('0x25')](this[_0x5474('0x26')][_0x5474('0x1e')],{'sessionId':md5(this[_0x5474('0x1c')]['id'])})['then'](function(_0x57baf6){_0x3e8483['body'][_0x5474('0x27')]=_0x57baf6;_0x6f6869['body']=_0x57baf6[_0x5474('0x28')][_0x5474('0x29')][_0x5474('0x2a')];return rpc[_0x131a3e+'Message'][_0x5474('0x21')](_0x6f6869)[_0x5474('0x2b')](function(_0x2e7120){logger[_0x5474('0xd')](_0x5474('0xe'),_0x55594b,_0x6f6869[_0x5474('0x1e')]);if(_0x57baf6[_0x5474('0x28')][_0x5474('0x2c')]['endConversation']){_0x5ec268[_0x5474('0x10')]();}else{_0x5ec268[_0x5474('0x23')]();}})['catch'](function(_0x1f2206){logger[_0x5474('0x2d')](_0x5474('0xe'),_0x55594b,JSON[_0x5474('0x2e')](_0x1f2206));_0x5ec268[_0x5474('0x10')]();});})[_0x5474('0x22')](function(_0x5cb75a){logger['error'](_0x5474('0xe'),_0x55594b,_0x5cb75a[_0x5474('0x26')]);_0x5ec268[_0x5474('0x10')]();});}}catch(_0x20dc0a){logger[_0x5474('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0x55594b,JSON[_0x5474('0x2e')](_0x20dc0a));_0x5ec268[_0x5474('0x23')]();}};}; \ 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 774f1ed..3372205 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 _0xe772=['priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','string','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','message'];(function(_0x398e68,_0x47d5e4){var _0x2e9720=function(_0x34812d){while(--_0x34812d){_0x398e68['push'](_0x398e68['shift']());}};_0x2e9720(++_0x47d5e4);}(_0xe772,0x1df));var _0x2e77=function(_0x2f3b86,_0x1fffad){_0x2f3b86=_0x2f3b86-0x0;var _0x9741a0=_0xe772[_0x2f3b86];return _0x9741a0;};'use strict';var schema=require(_0x2e77('0x0'));var _=require(_0x2e77('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x2e77('0x2'));var logger=require(_0x2e77('0x3'))('routing');var gotoif=schema({'condition':{'type':_0x2e77('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0x2e77('0x5')},'priorityFalse':{'type':'number','message':_0x2e77('0x6')}});exports[_0x2e77('0x7')]=function(_0x4577a1,_0x4caa49){return function(_0x5acb43){try{var _0x167c87={'condition':htmlToText[_0x2e77('0x8')](utils[_0x2e77('0x9')](_0x4caa49[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4caa49[0x1],'priorityFalse':_0x4caa49[0x2]};var _0x133cb0=gotoif[_0x2e77('0x0')](_0x167c87,{'typecast':!![]});if(_0x133cb0[_0x2e77('0xa')]){logger[_0x2e77('0xb')](_0x2e77('0xc'),_0x4577a1,_[_0x2e77('0xd')](_0x133cb0,_0x2e77('0xe'))['join'](',\x20'));_0x5acb43['stop']();}else{try{var _0x2a7b75=eval('('+_0x167c87['condition']+')');var _0x1282a6=_0x2a7b75?_0x167c87[_0x2e77('0xf')]:_0x167c87[_0x2e77('0x10')];logger['info'](_0x2e77('0x11'),_0x4577a1,_0x167c87[_0x2e77('0x12')],_0x2a7b75,_0x1282a6||_0x2e77('0x13'));if(_0x1282a6){var _0x5716dd=_[_0x2e77('0x14')](_0x5acb43['rules'](),{'p':_0x1282a6});if(_0x5716dd>=0x0){logger[_0x2e77('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x4577a1,_0x1282a6||_0x2e77('0x13'),_0x5716dd);_0x5acb43['next'](_0x5716dd);}else{logger[_0x2e77('0x15')](_0x2e77('0x16'),_0x4577a1,_0x1282a6||_0x2e77('0x13'));_0x5acb43[_0x2e77('0x17')]();}}else{_0x5acb43['next']();}}catch(_0xfa870a){logger[_0x2e77('0xb')](_0x2e77('0x18'),_0x4577a1,_0xfa870a[_0x2e77('0xe')]);_0x5acb43[_0x2e77('0x17')]();}}}catch(_0x3456d2){logger['error'](_0x2e77('0xc'),_0x4577a1,JSON[_0x2e77('0x19')](_0x3456d2));_0x5acb43[_0x2e77('0x17')]();}};}; \ No newline at end of file +var _0xd665=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20%s','stringify','validate','lodash','./utils','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','map','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x30f790,_0x37bb95){var _0x3f4dea=function(_0x19a37d){while(--_0x19a37d){_0x30f790['push'](_0x30f790['shift']());}};_0x3f4dea(++_0x37bb95);}(_0xd665,0xca));var _0x5d66=function(_0x4177e8,_0x5a313b){_0x4177e8=_0x4177e8-0x0;var _0x35ced7=_0xd665[_0x4177e8];return _0x35ced7;};'use strict';var schema=require(_0x5d66('0x0'));var _=require(_0x5d66('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x5d66('0x2'));var logger=require('../../../../config/logger')(_0x5d66('0x3'));var gotoif=schema({'condition':{'type':_0x5d66('0x4'),'required':!![],'message':_0x5d66('0x5')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0x5d66('0x6')}});exports[_0x5d66('0x7')]=function(_0x4b247f,_0x3a25e3){return function(_0x6bcdc2){try{var _0xedf3a2={'condition':htmlToText[_0x5d66('0x8')](utils['getMustacheRender'](_0x3a25e3[0x0],this),{'wordwrap':![]})[_0x5d66('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3a25e3[0x1],'priorityFalse':_0x3a25e3[0x2]};var _0x4ae203=gotoif[_0x5d66('0x0')](_0xedf3a2,{'typecast':!![]});if(_0x4ae203[_0x5d66('0xa')]){logger[_0x5d66('0xb')]('[%s][GOTOIF]\x20%s',_0x4b247f,_[_0x5d66('0xc')](_0x4ae203,_0x5d66('0xd'))[_0x5d66('0xe')](',\x20'));_0x6bcdc2['stop']();}else{try{var _0x40f53d=eval('('+_0xedf3a2[_0x5d66('0xf')]+')');var _0x464b31=_0x40f53d?_0xedf3a2[_0x5d66('0x10')]:_0xedf3a2[_0x5d66('0x11')];logger[_0x5d66('0x12')](_0x5d66('0x13'),_0x4b247f,_0xedf3a2[_0x5d66('0xf')],_0x40f53d,_0x464b31||_0x5d66('0x14'));if(_0x464b31){var _0xa8d4e0=_[_0x5d66('0x15')](_0x6bcdc2[_0x5d66('0x16')](),{'p':_0x464b31});if(_0xa8d4e0>=0x0){logger[_0x5d66('0x12')](_0x5d66('0x17'),_0x4b247f,_0x464b31||_0x5d66('0x14'),_0xa8d4e0);_0x6bcdc2[_0x5d66('0x14')](_0xa8d4e0);}else{logger[_0x5d66('0x12')](_0x5d66('0x18'),_0x4b247f,_0x464b31||_0x5d66('0x14'));_0x6bcdc2[_0x5d66('0x19')]();}}else{_0x6bcdc2[_0x5d66('0x14')]();}}catch(_0x320132){logger[_0x5d66('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x4b247f,_0x320132[_0x5d66('0xd')]);_0x6bcdc2[_0x5d66('0x19')]();}}}catch(_0x10255e){logger[_0x5d66('0xb')](_0x5d66('0x1a'),_0x4b247f,JSON[_0x5d66('0x1b')](_0x10255e));_0x6bcdc2[_0x5d66('0x19')]();}};}; \ 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 baa1727..7a80761 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 _0xdd2d=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','findIndex','rules','priority','next','routing'];(function(_0x1f9a2f,_0x47cada){var _0x4798d7=function(_0x1fc425){while(--_0x1fc425){_0x1f9a2f['push'](_0x1f9a2f['shift']());}};_0x4798d7(++_0x47cada);}(_0xdd2d,0x1ca));var _0xddd2=function(_0x3adb1e,_0x2145b0){_0x3adb1e=_0x3adb1e-0x0;var _0xe5dba9=_0xdd2d[_0x3adb1e];return _0xe5dba9;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require('../../../../config/logger')(_0xddd2('0x0'));var gotop=schema({'priority':{'type':_0xddd2('0x1'),'required':!![],'message':_0xddd2('0x2')}});exports[_0xddd2('0x3')]=function(_0x2028aa,_0x57fc6e){return function(_0x4325ac){try{var _0x4c6cba={'priority':_0x57fc6e[0x0]};var _0xd4b0dd=gotop[_0xddd2('0x4')](_0x4c6cba,{'typecast':!![]});if(_0xd4b0dd[_0xddd2('0x5')]){logger[_0xddd2('0x6')](_0xddd2('0x7'),_0x2028aa,_[_0xddd2('0x8')](_0xd4b0dd,_0xddd2('0x9'))[_0xddd2('0xa')](',\x20'));_0x4325ac[_0xddd2('0xb')]();}else{logger[_0xddd2('0xc')]('[%s][GOTOP]\x20priority\x20%s',_0x2028aa,_0x4c6cba['priority']);if(_0x4c6cba['priority']){var _0x59199b=_[_0xddd2('0xd')](_0x4325ac[_0xddd2('0xe')](),{'p':_0x4c6cba[_0xddd2('0xf')]});if(_0x59199b>=0x0){logger[_0xddd2('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2028aa,_0x4c6cba[_0xddd2('0xf')]||_0xddd2('0x10'),_0x59199b);_0x4325ac[_0xddd2('0x10')](_0x59199b);}else{logger[_0xddd2('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x2028aa,_0x4c6cba[_0xddd2('0xf')]||_0xddd2('0x10'));_0x4325ac[_0xddd2('0xb')]();}}else{_0x4325ac[_0xddd2('0x10')]();}}}catch(_0x23f363){logger[_0xddd2('0x6')](_0xddd2('0x7'),_0x2028aa,JSON['stringify'](_0x23f363));_0x4325ac[_0xddd2('0xb')]();}};}; \ No newline at end of file +var _0x9226=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','error','[%s][GOTOP]\x20%s','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info'];(function(_0x24d4e8,_0x4611f3){var _0x3ff886=function(_0x2d34aa){while(--_0x2d34aa){_0x24d4e8['push'](_0x24d4e8['shift']());}};_0x3ff886(++_0x4611f3);}(_0x9226,0xae));var _0x6922=function(_0x3030a8,_0x2b34fd){_0x3030a8=_0x3030a8-0x0;var _0x22f252=_0x9226[_0x3030a8];return _0x22f252;};'use strict';var schema=require(_0x6922('0x0'));var _=require(_0x6922('0x1'));var logger=require(_0x6922('0x2'))(_0x6922('0x3'));var gotop=schema({'priority':{'type':_0x6922('0x4'),'required':!![],'message':_0x6922('0x5')}});exports[_0x6922('0x6')]=function(_0x418e2d,_0x1f4474){return function(_0x5a95ef){try{var _0x58f48f={'priority':_0x1f4474[0x0]};var _0x1266ad=gotop[_0x6922('0x0')](_0x58f48f,{'typecast':!![]});if(_0x1266ad['length']){logger[_0x6922('0x7')](_0x6922('0x8'),_0x418e2d,_['map'](_0x1266ad,'message')[_0x6922('0x9')](',\x20'));_0x5a95ef[_0x6922('0xa')]();}else{logger['info'](_0x6922('0xb'),_0x418e2d,_0x58f48f[_0x6922('0xc')]);if(_0x58f48f[_0x6922('0xc')]){var _0x5e3d9f=_[_0x6922('0xd')](_0x5a95ef[_0x6922('0xe')](),{'p':_0x58f48f[_0x6922('0xc')]});if(_0x5e3d9f>=0x0){logger[_0x6922('0xf')](_0x6922('0x10'),_0x418e2d,_0x58f48f[_0x6922('0xc')]||_0x6922('0x11'),_0x5e3d9f);_0x5a95ef[_0x6922('0x11')](_0x5e3d9f);}else{logger[_0x6922('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x418e2d,_0x58f48f[_0x6922('0xc')]||'next');_0x5a95ef[_0x6922('0xa')]();}}else{_0x5a95ef['next']();}}}catch(_0x491713){logger[_0x6922('0x7')](_0x6922('0x8'),_0x418e2d,JSON[_0x6922('0x12')](_0x491713));_0x5a95ef[_0x6922('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 68464e8..d76dc39 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 _0x6acf=['../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','upperFirst','account','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x45731b,_0x3c2bdb){var _0x2d0c83=function(_0x479539){while(--_0x479539){_0x45731b['push'](_0x45731b['shift']());}};_0x2d0c83(++_0x3c2bdb);}(_0x6acf,0xf5));var _0xf6ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6acf[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var utils=require(_0xf6ac('0x0'));var logger=require(_0xf6ac('0x1'))(_0xf6ac('0x2'));var rpc={'chatMessage':require(_0xf6ac('0x3')),'openchannelMessage':require(_0xf6ac('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xf6ac('0x5')),'faxMessage':require(_0xf6ac('0x6'))};exports[_0xf6ac('0x7')]=function(_0x1de07f,_0x29d588){return function(_0x48b751){try{var _0x137826={'body':utils[_0xf6ac('0x8')](_0x29d588[0x0],this),'ContactId':this[_0xf6ac('0x9')]['id']};if(this[_0xf6ac('0xa')]===_0xf6ac('0xb')){_0x137826[_0xf6ac('0xc')]=this['account']['id'];}else{_0x137826[_[_0xf6ac('0xd')](this['channel'])+'AccountId']=this[_0xf6ac('0xe')]['id'];}_0x137826[_[_0xf6ac('0xd')](this[_0xf6ac('0xa')])+'InteractionId']=this[_0xf6ac('0xf')]['id'];if(rpc[this[_0xf6ac('0xa')]+_0xf6ac('0x10')]){return rpc[this[_0xf6ac('0xa')]+_0xf6ac('0x10')]['create'](_0x137826)[_0xf6ac('0x11')](function(_0x39a082){logger[_0xf6ac('0x12')](_0xf6ac('0x13'),_0x1de07f,_0x137826[_0xf6ac('0x14')]);_0x48b751[_0xf6ac('0x15')]();})[_0xf6ac('0x16')](function(_0x4698d7){logger['error'](_0xf6ac('0x13'),_0x1de07f,JSON[_0xf6ac('0x17')](_0x4698d7));_0x48b751['stop']();});}}catch(_0x2fbcd1){logger['error']('[%s][MESSAGE]\x20%s',_0x1de07f,JSON[_0xf6ac('0x17')](_0x2fbcd1));_0x48b751[_0xf6ac('0x18')]();}};}; \ No newline at end of file +var _0xbfc3=['[%s][MESSAGE]\x20%s','next','error','stop','stringify','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','create','info'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0xbfc3,0x18c));var _0x3bfc=function(_0x268881,_0x554bed){_0x268881=_0x268881-0x0;var _0x2a1326=_0xbfc3[_0x268881];return _0x2a1326;};'use strict';var _=require(_0x3bfc('0x0'));var utils=require('./utils');var logger=require(_0x3bfc('0x1'))(_0x3bfc('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3bfc('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x3bfc('0x4')),'faxMessage':require(_0x3bfc('0x5'))};exports[_0x3bfc('0x6')]=function(_0x1495f2,_0x5c4df3){return function(_0x2a4b6d){try{var _0x58fb74={'body':utils[_0x3bfc('0x7')](_0x5c4df3[0x0],this),'ContactId':this[_0x3bfc('0x8')]['id']};if(this[_0x3bfc('0x9')]===_0x3bfc('0xa')){_0x58fb74[_0x3bfc('0xb')]=this[_0x3bfc('0xc')]['id'];}else{_0x58fb74[_[_0x3bfc('0xd')](this[_0x3bfc('0x9')])+'AccountId']=this['account']['id'];}_0x58fb74[_[_0x3bfc('0xd')](this[_0x3bfc('0x9')])+_0x3bfc('0xe')]=this[_0x3bfc('0xf')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x3bfc('0x9')]+'Message'][_0x3bfc('0x10')](_0x58fb74)['then'](function(_0x2a8995){logger[_0x3bfc('0x11')](_0x3bfc('0x12'),_0x1495f2,_0x58fb74['body']);_0x2a4b6d[_0x3bfc('0x13')]();})['catch'](function(_0xbe3ea8){logger[_0x3bfc('0x14')](_0x3bfc('0x12'),_0x1495f2,JSON['stringify'](_0xbe3ea8));_0x2a4b6d[_0x3bfc('0x15')]();});}}catch(_0x18d892){logger[_0x3bfc('0x14')]('[%s][MESSAGE]\x20%s',_0x1495f2,JSON[_0x3bfc('0x16')](_0x18d892));_0x2a4b6d[_0x3bfc('0x15')]();}};}; \ 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 1346e89..d3451cd 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 _0x279f=['[%s][NOOP]\x20%s','getMustacheRender','error','stringify','stop','../../../../config/logger','routing','consequence'];(function(_0x365a1c,_0x46d1cf){var _0x145c10=function(_0x52fea3){while(--_0x52fea3){_0x365a1c['push'](_0x365a1c['shift']());}};_0x145c10(++_0x46d1cf);}(_0x279f,0xe5));var _0xf279=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x279f[_0x1203f];return _0x365f0a;};'use strict';var utils=require('./utils');var logger=require(_0xf279('0x0'))(_0xf279('0x1'));exports[_0xf279('0x2')]=function(_0x4acd6e,_0x2b62e0){return function(_0x176583){try{logger['info'](_0xf279('0x3'),_0x4acd6e,utils[_0xf279('0x4')](_0x2b62e0[0x0],this));_0x176583['next']();}catch(_0x5cc9ec){logger[_0xf279('0x5')](_0xf279('0x3'),_0x4acd6e,JSON[_0xf279('0x6')](_0x5cc9ec));_0x176583[_0xf279('0x7')]();}};}; \ No newline at end of file +var _0x5094=['info','getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','./utils','../../../../config/logger','routing','consequence'];(function(_0xe6cbe9,_0xe9c426){var _0x4d6230=function(_0x3976a0){while(--_0x3976a0){_0xe6cbe9['push'](_0xe6cbe9['shift']());}};_0x4d6230(++_0xe9c426);}(_0x5094,0x1b4));var _0x4509=function(_0x3285d4,_0x136036){_0x3285d4=_0x3285d4-0x0;var _0x5408c9=_0x5094[_0x3285d4];return _0x5408c9;};'use strict';var utils=require(_0x4509('0x0'));var logger=require(_0x4509('0x1'))(_0x4509('0x2'));exports[_0x4509('0x3')]=function(_0x191e2d,_0x488536){return function(_0x2a5998){try{logger[_0x4509('0x4')]('[%s][NOOP]\x20%s',_0x191e2d,utils[_0x4509('0x5')](_0x488536[0x0],this));_0x2a5998[_0x4509('0x6')]();}catch(_0x2e64b6){logger[_0x4509('0x7')](_0x4509('0x8'),_0x191e2d,JSON[_0x4509('0x9')](_0x2e64b6));_0x2a5998['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 3fad0a0..10e22d3 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 _0x2771=['createQueue','atimeout','rules','end','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','redis','defaults','socket.io-emitter','account','queue','from','emit','queue_id','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/faxQueueReport','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','waiting','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'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x2771,0x12d));var _0x1277=function(_0x178f3e,_0x567056){_0x178f3e=_0x178f3e-0x0;var _0x2c73ab=_0x2771[_0x178f3e];return _0x2c73ab;};'use strict';var schema=require(_0x1277('0x0'));var _=require(_0x1277('0x1'));var util=require(_0x1277('0x2'));var seqqueue=require(_0x1277('0x3'));var moment=require(_0x1277('0x4'));var Redis=require(_0x1277('0x5'));var config=require(_0x1277('0x6'));var logger=require(_0x1277('0x7'))(_0x1277('0x8'));var strategy=require('./strategy');config[_0x1277('0x9')]=_[_0x1277('0xa')](config[_0x1277('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x1277('0xb'))(new Redis(config['redis']));var attributes=['id','queue_id',_0x1277('0xc'),_0x1277('0xd'),_0x1277('0xe'),'joinAt'];function emit(_0x3f81a2,_0x44601a,_0x3583df){io['to'](_0x3f81a2)[_0x1277('0xf')](_0x44601a,_0x3583df);}function emitChannelQueueInteraction(_0x475eeb,_0x593417,_0x2f1295,_0x5de158,_0x40f400,_0x34b514,_0x2d8c57,_0x5eb569){_0x2f1295[_0x1277('0x10')]=_0x5eb569;_0x2f1295['queue']=_0x593417;_0x2f1295[_0x1277('0xc')]=_0x5de158;_0x2f1295['id']=_0x40f400;if(_0x34b514){_0x2d8c57[util[_0x1277('0x11')](_0x1277('0x12'),_0x475eeb)][_0x40f400]=_[_0x1277('0x13')](_0x2f1295,attributes);}else{delete _0x2d8c57[util['format'](_0x1277('0x12'),_0x475eeb)][_0x40f400];}emit(util[_0x1277('0x11')](_0x1277('0x14'),_0x475eeb,_0x593417),util[_0x1277('0x11')](_0x1277('0x15'),_0x475eeb,_0x34b514?_0x1277('0x16'):_0x1277('0x17')),_[_0x1277('0x13')](_0x2f1295,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x1277('0x18'))};var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x13f629,_0x282174,_0x2ef030,_0xf1c8f0){if(_0x13f629&&_0x282174&&_0x2ef030){_0x282174['waiting']+=0x1;var _0x35a384={'uniqueid':_0x13f629,'from':_0x2ef030[_0x1277('0x19')]?_0x2ef030['body'][_0x1277('0xe')]:'','joinAt':moment()[_0x1277('0x11')](_0x1277('0x1a')),'ContactId':_0x2ef030['contact']?_0x2ef030[_0x1277('0x1b')]['id']:null,'ListId':_0x2ef030[_0x1277('0x1c')]?_0x2ef030[_0x1277('0x1c')]['id']:null};_0x35a384[_[_0x1277('0x1d')](_0x2ef030['channel'])+'QueueId']=_0x282174['id']||null;_0x35a384[_[_0x1277('0x1d')](_0x2ef030[_0x1277('0x1e')])+_0x1277('0x1f')]=_0x2ef030[_0x1277('0x20')]?_0x2ef030[_0x1277('0x20')]['id']:null;_0x35a384[_[_0x1277('0x1d')](_0x2ef030[_0x1277('0x1e')])+_0x1277('0x21')]=_0x2ef030['message']?_0x2ef030[_0x1277('0x22')]['id']:null;_0x35a384[_[_0x1277('0x1d')](_0x2ef030[_0x1277('0x1e')])+(_0x2ef030[_0x1277('0x1e')]!==_0x1277('0x23')?_0x1277('0x24'):_0x1277('0x25'))]=_0x2ef030[_0x1277('0xc')]?_0x2ef030[_0x1277('0xc')]['id']:null;logger[_0x1277('0x26')](util[_0x1277('0x11')](_0x1277('0x27'),_0x13f629,_0x282174[_0x1277('0x28')]));emitChannelQueueInteraction(_0x2ef030[_0x1277('0x1e')],_0x282174[_0x1277('0x28')],_0x35a384,_0x2ef030['account'][_0x1277('0x28')],_0x2ef030[_0x1277('0x22')]['id'],!![],_0xf1c8f0,_0x282174['id']);if(rpc[_0x2ef030['channel']+_0x1277('0x29')]){return rpc[_0x2ef030[_0x1277('0x1e')]+'QueueReport'][_0x1277('0x2a')](_0x35a384)[_0x1277('0x2b')](function(_0x34bb75){logger[_0x1277('0x2c')]('create\x20queue\x20report');});}}}function stopRouting(_0x4af684,_0x371387,_0x229575,_0x1f2e00){if(_0x4af684&&_0x371387){_0x371387[_0x1277('0x2d')]-=0x1;var _0x3d6b1a={'leaveAt':moment()[_0x1277('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x1277('0x11')](_0x1277('0x1a')),'reason':_0x1277('0x2e')};logger[_0x1277('0x26')](util[_0x1277('0x11')](_0x1277('0x2f'),_0x4af684,_0x371387[_0x1277('0x28')]));emitChannelQueueInteraction(_0x229575['channel'],_0x371387[_0x1277('0x28')],_0x229575[_0x1277('0x19')],_0x229575[_0x1277('0xc')][_0x1277('0x28')],_0x229575[_0x1277('0x22')]['id'],![],_0x1f2e00,_0x371387['id']);if(rpc[_0x229575['channel']+_0x1277('0x29')]){return rpc[_0x229575[_0x1277('0x1e')]+_0x1277('0x29')][_0x1277('0x30')](_0x4af684,_0x3d6b1a)[_0x1277('0x2b')](function(_0x8ee259){logger[_0x1277('0x2c')](_0x1277('0x31'));});}}}function endRouting(_0x14bf7d,_0x253dba,_0x343e34,_0x393457){if(_0x14bf7d&&_0x253dba){_0x253dba[_0x1277('0x2d')]-=0x1;var _0x214aa2={'leaveAt':moment()[_0x1277('0x11')](_0x1277('0x1a')),'exitAt':moment()[_0x1277('0x11')](_0x1277('0x1a')),'reason':_0x1277('0x32')};logger[_0x1277('0x26')](util['format'](_0x1277('0x33'),_0x14bf7d,_0x253dba[_0x1277('0x28')]));emitChannelQueueInteraction(_0x343e34['channel'],_0x253dba['name'],_0x343e34[_0x1277('0x19')],_0x343e34[_0x1277('0xc')][_0x1277('0x28')],_0x343e34[_0x1277('0x22')]['id'],![],_0x393457);if(rpc[_0x343e34[_0x1277('0x1e')]+_0x1277('0x29')]){return rpc[_0x343e34['channel']+_0x1277('0x29')]['update'](_0x14bf7d,_0x214aa2)[_0x1277('0x2b')](function(_0x15d04f){logger[_0x1277('0x2c')](_0x1277('0x31'));});}}}function handleFindQueue(_0x3f7f45){return function(_0xe36e06){return _0xe36e06[_0x1277('0x28')][_0x1277('0x34')]()===_0x3f7f45['toLowerCase']();};}exports[_0x1277('0x35')]=function(_0xb05925,_0x1c48f6,_0x4928d6,_0x47a878){return function(_0x4230cc){try{var _0x5c44d3={'name':_0x1c48f6[0x0],'timeout':_0x1c48f6[0x1]};var _0x2ca215=queue['validate'](_0x5c44d3,{'typecast':!![]});if(_0x2ca215[_0x1277('0x36')]){logger[_0x1277('0x2c')](_0x1277('0x37'),_0xb05925,_['map'](_0x2ca215,_0x1277('0x22'))[_0x1277('0x38')](',\x20'));_0x4230cc[_0x1277('0x39')]();}else{var _0x3dada1=_[_0x1277('0x3a')](_0x4928d6[_0x47a878[_0x1277('0x1e')]+'Queues'],handleFindQueue(_0x5c44d3['name']));if(_0x3dada1){startRouting(_0xb05925,_0x3dada1,_0x47a878,_0x4928d6);var _0x5daea5=(_0x3dada1['timeout']||0xa)*0x3e8;var _0x3101de=(_0x5c44d3['timeout']||0x14)*0x3e8;var _0x3a5bda,_0xcd2aa3;if(_0x5daea5>_0x3101de){_0x3101de=_0x5daea5;}var _0x187706=seqqueue[_0x1277('0x3b')](_0x5daea5);_0x187706['id']=_0xb05925;_0x187706[_0x1277('0x3c')]=_0x5daea5;_0x187706['qtimeout']=_0x3101de;_0x187706['channel']=_0x47a878[_0x1277('0x1e')];_0x4928d6[_0x1277('0x3d')][_0xb05925]['on'](_0x1277('0x3e'),function(){stopRouting(_0xb05925,_0x3dada1,_0x47a878,_0x4928d6);_0x187706[_0x1277('0x3f')](!![]);clearTimeout(_0x3a5bda);_0x3a5bda=undefined;if(_0x4928d6[_0x1277('0x3d')][_0xb05925]){delete _0x4928d6[_0x1277('0x3d')][_0xb05925];}logger[_0x1277('0x26')](_0x1277('0x40'),_0xb05925);_0x4230cc[_0x1277('0x39')]();});_0x3a5bda=setTimeout(function(){endRouting(_0xb05925,_0x3dada1,_0x47a878,_0x4928d6);clearTimeout(_0x3a5bda);_0x187706['close'](!![]);logger[_0x1277('0x26')](_0x1277('0x41'),_0xb05925);_0x4230cc[_0x1277('0x42')]();},_0x3101de);switch(_0x3dada1[_0x1277('0x43')]){case _0x1277('0x44'):strategy[_0x1277('0x44')](_0x187706,_0x3dada1,_0x4928d6,_0x47a878);break;default:strategy[_0x1277('0x45')](_0x187706,_0x3dada1,_0x4928d6,_0x47a878);}}else{logger[_0x1277('0x2c')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xb05925,_0x5c44d3['name']);_0x4230cc['stop']();}}}catch(_0x5655aa){console[_0x1277('0x46')](_0x5655aa);logger[_0x1277('0x2c')](_0x1277('0x37'),_0xb05925,_0x5655aa[_0x1277('0x47')]);_0x4230cc[_0x1277('0x39')]();}};}; \ No newline at end of file +var _0x100a=['emit','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','channel','InteractionId','interaction','upperFirst','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','catch','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','qtimeout','close','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x100a,0x128));var _0xa100=function(_0x50a818,_0x39b486){_0x50a818=_0x50a818-0x0;var _0x50859d=_0x100a[_0x50a818];return _0x50859d;};'use strict';var schema=require(_0xa100('0x0'));var _=require('lodash');var util=require(_0xa100('0x1'));var seqqueue=require('seq-queue');var moment=require(_0xa100('0x2'));var Redis=require('ioredis');var config=require(_0xa100('0x3'));var logger=require(_0xa100('0x4'))(_0xa100('0x5'));var strategy=require(_0xa100('0x6'));config[_0xa100('0x7')]=_[_0xa100('0x8')](config['redis'],{'host':_0xa100('0x9'),'port':0x18eb});var io=require(_0xa100('0xa'))(new Redis(config[_0xa100('0x7')]));var attributes=['id',_0xa100('0xb'),_0xa100('0xc'),_0xa100('0xd'),_0xa100('0xe'),_0xa100('0xf')];function emit(_0x4055ae,_0x42ee34,_0x3e5de4){io['to'](_0x4055ae)[_0xa100('0x10')](_0x42ee34,_0x3e5de4);}function emitChannelQueueInteraction(_0x504785,_0x27cc28,_0x2c51c9,_0x55f1ac,_0x42b029,_0x50ec2d,_0x3891dd,_0x19bd7d){_0x2c51c9[_0xa100('0xb')]=_0x19bd7d;_0x2c51c9['queue']=_0x27cc28;_0x2c51c9[_0xa100('0xc')]=_0x55f1ac;_0x2c51c9['id']=_0x42b029;if(_0x50ec2d){_0x3891dd[util['format'](_0xa100('0x11'),_0x504785)][_0x42b029]=_[_0xa100('0x12')](_0x2c51c9,attributes);}else{delete _0x3891dd[util[_0xa100('0x13')](_0xa100('0x11'),_0x504785)][_0x42b029];}emit(util[_0xa100('0x13')]('%s:queue:%s',_0x504785,_0x27cc28),util[_0xa100('0x13')](_0xa100('0x14'),_0x504785,_0x50ec2d?_0xa100('0x15'):_0xa100('0x16')),_[_0xa100('0x12')](_0x2c51c9,attributes));}var rpc={'openchannelQueueReport':require(_0xa100('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xa100('0x18')),'faxQueueReport':require(_0xa100('0x19'))};var queue=schema({'name':{'type':_0xa100('0x1a'),'required':!![],'message':_0xa100('0x1b')},'timeout':{'type':_0xa100('0x1c'),'message':_0xa100('0x1d')}});function startRouting(_0x20c568,_0x29e8d5,_0x28ac3c,_0x3c51d2){if(_0x20c568&&_0x29e8d5&&_0x28ac3c){_0x29e8d5[_0xa100('0x1e')]+=0x1;var _0x2ab49d={'uniqueid':_0x20c568,'from':_0x28ac3c[_0xa100('0x1f')]?_0x28ac3c[_0xa100('0x1f')][_0xa100('0xe')]:'','joinAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'ContactId':_0x28ac3c['contact']?_0x28ac3c[_0xa100('0x21')]['id']:null,'ListId':_0x28ac3c['list']?_0x28ac3c['list']['id']:null};_0x2ab49d[_['upperFirst'](_0x28ac3c[_0xa100('0x22')])+'QueueId']=_0x29e8d5['id']||null;_0x2ab49d[_['upperFirst'](_0x28ac3c[_0xa100('0x22')])+_0xa100('0x23')]=_0x28ac3c['interaction']?_0x28ac3c[_0xa100('0x24')]['id']:null;_0x2ab49d[_[_0xa100('0x25')](_0x28ac3c[_0xa100('0x22')])+_0xa100('0x26')]=_0x28ac3c[_0xa100('0x27')]?_0x28ac3c[_0xa100('0x27')]['id']:null;_0x2ab49d[_['upperFirst'](_0x28ac3c[_0xa100('0x22')])+(_0x28ac3c[_0xa100('0x22')]!==_0xa100('0x28')?_0xa100('0x29'):_0xa100('0x2a'))]=_0x28ac3c[_0xa100('0xc')]?_0x28ac3c[_0xa100('0xc')]['id']:null;logger[_0xa100('0x2b')](util[_0xa100('0x13')](_0xa100('0x2c'),_0x20c568,_0x29e8d5['name']));emitChannelQueueInteraction(_0x28ac3c[_0xa100('0x22')],_0x29e8d5['name'],_0x2ab49d,_0x28ac3c[_0xa100('0xc')][_0xa100('0x2d')],_0x28ac3c[_0xa100('0x27')]['id'],!![],_0x3c51d2,_0x29e8d5['id']);if(rpc[_0x28ac3c[_0xa100('0x22')]+_0xa100('0x2e')]){return rpc[_0x28ac3c[_0xa100('0x22')]+_0xa100('0x2e')][_0xa100('0x2f')](_0x2ab49d)['catch'](function(_0x1d5467){logger[_0xa100('0x30')](_0xa100('0x31'));});}}}function stopRouting(_0x336db9,_0x56828,_0x2e9160,_0xd0ea0c){if(_0x336db9&&_0x56828){_0x56828[_0xa100('0x1e')]-=0x1;var _0x2fa154={'leaveAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'acceptAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'reason':_0xa100('0x32')};logger[_0xa100('0x2b')](util[_0xa100('0x13')](_0xa100('0x33'),_0x336db9,_0x56828[_0xa100('0x2d')]));emitChannelQueueInteraction(_0x2e9160[_0xa100('0x22')],_0x56828['name'],_0x2e9160[_0xa100('0x1f')],_0x2e9160['account'][_0xa100('0x2d')],_0x2e9160[_0xa100('0x27')]['id'],![],_0xd0ea0c,_0x56828['id']);if(rpc[_0x2e9160[_0xa100('0x22')]+_0xa100('0x2e')]){return rpc[_0x2e9160[_0xa100('0x22')]+'QueueReport'][_0xa100('0x34')](_0x336db9,_0x2fa154)[_0xa100('0x35')](function(_0x2f892d){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x3e6852,_0x349069,_0x42e2ae,_0x33731a){if(_0x3e6852&&_0x349069){_0x349069[_0xa100('0x1e')]-=0x1;var _0x48532d={'leaveAt':moment()[_0xa100('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xa100('0x13')](_0xa100('0x20')),'reason':_0xa100('0x36')};logger[_0xa100('0x2b')](util['format'](_0xa100('0x37'),_0x3e6852,_0x349069[_0xa100('0x2d')]));emitChannelQueueInteraction(_0x42e2ae['channel'],_0x349069['name'],_0x42e2ae['body'],_0x42e2ae['account'][_0xa100('0x2d')],_0x42e2ae[_0xa100('0x27')]['id'],![],_0x33731a);if(rpc[_0x42e2ae[_0xa100('0x22')]+_0xa100('0x2e')]){return rpc[_0x42e2ae[_0xa100('0x22')]+_0xa100('0x2e')][_0xa100('0x34')](_0x3e6852,_0x48532d)[_0xa100('0x35')](function(_0x21b7db){logger['error'](_0xa100('0x38'));});}}}function handleFindQueue(_0x1cb738){return function(_0x29a8cf){return _0x29a8cf['name']['toLowerCase']()===_0x1cb738['toLowerCase']();};}exports[_0xa100('0x39')]=function(_0x20d6ce,_0x44f99f,_0x5ae3d7,_0x63ddca){return function(_0x4161a1){try{var _0x2a9c5f={'name':_0x44f99f[0x0],'timeout':_0x44f99f[0x1]};var _0x44f86f=queue['validate'](_0x2a9c5f,{'typecast':!![]});if(_0x44f86f[_0xa100('0x3a')]){logger[_0xa100('0x30')](_0xa100('0x3b'),_0x20d6ce,_[_0xa100('0x3c')](_0x44f86f,_0xa100('0x27'))['join'](',\x20'));_0x4161a1[_0xa100('0x3d')]();}else{var _0x158043=_[_0xa100('0x3e')](_0x5ae3d7[_0x63ddca[_0xa100('0x22')]+_0xa100('0x3f')],handleFindQueue(_0x2a9c5f['name']));if(_0x158043){startRouting(_0x20d6ce,_0x158043,_0x63ddca,_0x5ae3d7);var _0x25d85d=(_0x158043['timeout']||0xa)*0x3e8;var _0x2729ca=(_0x2a9c5f[_0xa100('0x36')]||0x14)*0x3e8;var _0x2a5ff6,_0x26248b;if(_0x25d85d>_0x2729ca){_0x2729ca=_0x25d85d;}var _0x235466=seqqueue[_0xa100('0x40')](_0x25d85d);_0x235466['id']=_0x20d6ce;_0x235466[_0xa100('0x41')]=_0x25d85d;_0x235466[_0xa100('0x42')]=_0x2729ca;_0x235466['channel']=_0x63ddca[_0xa100('0x22')];_0x5ae3d7['rules'][_0x20d6ce]['on']('end',function(){stopRouting(_0x20d6ce,_0x158043,_0x63ddca,_0x5ae3d7);_0x235466[_0xa100('0x43')](!![]);clearTimeout(_0x2a5ff6);_0x2a5ff6=undefined;if(_0x5ae3d7[_0xa100('0x44')][_0x20d6ce]){delete _0x5ae3d7[_0xa100('0x44')][_0x20d6ce];}logger[_0xa100('0x2b')](_0xa100('0x45'),_0x20d6ce);_0x4161a1['stop']();});_0x2a5ff6=setTimeout(function(){endRouting(_0x20d6ce,_0x158043,_0x63ddca,_0x5ae3d7);clearTimeout(_0x2a5ff6);_0x235466['close'](!![]);logger[_0xa100('0x2b')](_0xa100('0x46'),_0x20d6ce);_0x4161a1[_0xa100('0x47')]();},_0x2729ca);switch(_0x158043[_0xa100('0x48')]){case _0xa100('0x49'):strategy['rrmemory'](_0x235466,_0x158043,_0x5ae3d7,_0x63ddca);break;default:strategy[_0xa100('0x4a')](_0x235466,_0x158043,_0x5ae3d7,_0x63ddca);}}else{logger[_0xa100('0x30')](_0xa100('0x4b'),_0x20d6ce,_0x2a9c5f[_0xa100('0x2d')]);_0x4161a1[_0xa100('0x3d')]();}}}catch(_0x1763c7){console[_0xa100('0x4c')](_0x1763c7);logger[_0xa100('0x30')](_0xa100('0x3b'),_0x20d6ce,_0x1763c7[_0xa100('0x4d')]);_0x4161a1[_0xa100('0x3d')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 420a570..ea35aa8 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 _0xa52d=['busyQueue','showNotification','notificationId','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','busy','writeLog','STOP','TIMEOUT','lodash','./util','../../../../../config/logger','routing','agent','realtime','handleRun','bind','handleTimeout','squeue','timeout','drained','handleDrained','push','prototype','info','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0x390f00,_0x242c37){var _0x3aa74d=function(_0x4be754){while(--_0x4be754){_0x390f00['push'](_0x390f00['shift']());}};_0x3aa74d(++_0x242c37);}(_0xa52d,0x18a));var _0xda52=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0xa52d[_0x4a96d2];return _0x38af04;};'use strict';var _=require(_0xda52('0x0'));var uuid=require('uuid');var util=require(_0xda52('0x1'));var logger=require(_0xda52('0x2'))(_0xda52('0x3'));var Agent=function(_0x253aa4,_0x1d88ee,_0xf2e876,_0x5e3619){this['notificationId']=uuid['v4']();this['squeue']=_0x253aa4;this[_0xda52('0x4')]=_0x1d88ee;this[_0xda52('0x5')]=_0xf2e876;this[_0xda52('0x3')]=_0x5e3619;this['squeue']['push'](this[_0xda52('0x6')][_0xda52('0x7')](this),this[_0xda52('0x8')][_0xda52('0x7')](this));this[_0xda52('0x9')]['on'](_0xda52('0xa'),this['handleTimeout'][_0xda52('0x7')](this));this['squeue']['on'](_0xda52('0xb'),this[_0xda52('0xc')][_0xda52('0x7')](this));};Agent['prototype'][_0xda52('0xd')]=function(){this[_0xda52('0x9')][_0xda52('0xd')](this[_0xda52('0x6')][_0xda52('0x7')](this),this['handleTimeout'][_0xda52('0x7')](this));};Agent[_0xda52('0xe')][_0xda52('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0xda52('0x6')]=function(_0x4d2f81){logger[_0xda52('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0xda52('0x4')]['id']);if(_[_0xda52('0x10')](this[_0xda52('0x5')][_0xda52('0x11')][this[_0xda52('0x4')]['id']])){logger[_0xda52('0xf')](_0xda52('0x12'),this[_0xda52('0x9')]['id'],this['agent']['id']);setTimeout(this[_0xda52('0xd')]['bind'](this),0x3e8);}else{if(this['routing'][_0xda52('0x13')]||util[_0xda52('0x14')](this[_0xda52('0x9')]['id'],this[_0xda52('0x5')]['agents'][this['agent']['id']],this[_0xda52('0x9')][_0xda52('0x15')],![])){this[_0xda52('0x5')][_0xda52('0x11')][this['agent']['id']]['busy']=!![];this[_0xda52('0x5')]['agents'][this[_0xda52('0x4')]['id']][_0xda52('0x16')]=undefined;util[_0xda52('0x17')](this[_0xda52('0x18')],this[_0xda52('0x9')]['id'],this[_0xda52('0x5')]['agents'][this[_0xda52('0x4')]['id']],null,this[_0xda52('0x3')]);util['writeLog'](this[_0xda52('0x9')]['id'],this['realtime']['agents'][this[_0xda52('0x4')]['id']],_0xda52('0x19')+(this[_0xda52('0x3')][_0xda52('0x13')]?_0xda52('0x1a'):''));}else{logger[_0xda52('0xf')](_0xda52('0x1b'),this['squeue']['id'],this[_0xda52('0x4')]['id']);setTimeout(this['push'][_0xda52('0x7')](this),0x3e8);}}};Agent[_0xda52('0xe')]['handleTimeout']=function(_0xa418ba){if(_[_0xda52('0x10')](this[_0xda52('0x5')][_0xda52('0x11')][this[_0xda52('0x4')]['id']])){return logger[_0xda52('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xda52('0x9')]['id'],this['agent']['id']);}else{logger[_0xda52('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xda52('0x9')]['id'],this['agent']['id']);util['hideNotification'](this[_0xda52('0x18')],this[_0xda52('0x9')]['id'],this[_0xda52('0x5')][_0xda52('0x11')][this[_0xda52('0x4')]['id']],null,this[_0xda52('0x3')]);this[_0xda52('0x5')][_0xda52('0x11')][this[_0xda52('0x4')]['id']][_0xda52('0x1c')]=![];this[_0xda52('0x5')]['agents'][this['agent']['id']]['busyQueue']=undefined;util[_0xda52('0x1d')](this[_0xda52('0x9')]['id'],this[_0xda52('0x5')][_0xda52('0x11')][this[_0xda52('0x4')]['id']],_0xa418ba?_0xda52('0x1e'):_0xda52('0x1f'));}if(!_0xa418ba){setTimeout(this[_0xda52('0xd')][_0xda52('0x7')](this),0x3e8);}};function agent(_0x13caf7,_0x5f510b,_0x5726ad,_0x205720){return new Agent(_0x13caf7,_0x5f510b,_0x5726ad,_0x205720);}module['exports']=agent; \ No newline at end of file +var _0xbf0b=['agents','channel','busy','busyQueue','showNotification',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','writeLog','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','notificationId','agent','squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','isAgentAvailable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf0b,0x16a));var _0xbbf0=function(_0x55ba56,_0x19a08d){_0x55ba56=_0x55ba56-0x0;var _0x47bd94=_0xbf0b[_0x55ba56];return _0x47bd94;};'use strict';var _=require(_0xbbf0('0x0'));var uuid=require(_0xbbf0('0x1'));var util=require(_0xbbf0('0x2'));var logger=require(_0xbbf0('0x3'))('routing');var Agent=function(_0x3f50b5,_0x161e7c,_0x5ca1bd,_0x234e38){this[_0xbbf0('0x4')]=uuid['v4']();this['squeue']=_0x3f50b5;this[_0xbbf0('0x5')]=_0x161e7c;this['realtime']=_0x5ca1bd;this['routing']=_0x234e38;this[_0xbbf0('0x6')]['push'](this[_0xbbf0('0x7')]['bind'](this),this[_0xbbf0('0x8')][_0xbbf0('0x9')](this));this['squeue']['on'](_0xbbf0('0xa'),this[_0xbbf0('0x8')][_0xbbf0('0x9')](this));this[_0xbbf0('0x6')]['on'](_0xbbf0('0xb'),this[_0xbbf0('0xc')][_0xbbf0('0x9')](this));};Agent[_0xbbf0('0xd')][_0xbbf0('0xe')]=function(){this['squeue'][_0xbbf0('0xe')](this[_0xbbf0('0x7')]['bind'](this),this[_0xbbf0('0x8')][_0xbbf0('0x9')](this));};Agent[_0xbbf0('0xd')][_0xbbf0('0xc')]=function(){this[_0xbbf0('0x8')](!![]);};Agent[_0xbbf0('0xd')][_0xbbf0('0x7')]=function(_0x3b5f7d){logger[_0xbbf0('0xf')](_0xbbf0('0x10'),this['squeue']['id'],this[_0xbbf0('0x5')]['id']);if(_[_0xbbf0('0x11')](this[_0xbbf0('0x12')]['agents'][this[_0xbbf0('0x5')]['id']])){logger[_0xbbf0('0xf')](_0xbbf0('0x13'),this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x5')]['id']);setTimeout(this[_0xbbf0('0xe')]['bind'](this),0x3e8);}else{if(this[_0xbbf0('0x14')]['forcedOwnership']||util[_0xbbf0('0x15')](this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']],this[_0xbbf0('0x6')][_0xbbf0('0x17')],![])){this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']][_0xbbf0('0x18')]=!![];this[_0xbbf0('0x12')][_0xbbf0('0x16')][this['agent']['id']][_0xbbf0('0x19')]=undefined;util[_0xbbf0('0x1a')](this[_0xbbf0('0x4')],this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x12')]['agents'][this[_0xbbf0('0x5')]['id']],null,this[_0xbbf0('0x14')]);util['writeLog'](this[_0xbbf0('0x6')]['id'],this['realtime'][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']],'RINGING'+(this['routing']['forcedOwnership']?_0xbbf0('0x1b'):''));}else{logger['info'](_0xbbf0('0x1c'),this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x5')]['id']);setTimeout(this['push'][_0xbbf0('0x9')](this),0x3e8);}}};Agent[_0xbbf0('0xd')][_0xbbf0('0x8')]=function(_0x199cd2){if(_[_0xbbf0('0x11')](this['realtime'][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']])){return logger[_0xbbf0('0xf')](_0xbbf0('0x13'),this[_0xbbf0('0x6')]['id'],this['agent']['id']);}else{logger[_0xbbf0('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x5')]['id']);util['hideNotification'](this[_0xbbf0('0x4')],this['squeue']['id'],this[_0xbbf0('0x12')]['agents'][this[_0xbbf0('0x5')]['id']],null,this[_0xbbf0('0x14')]);this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']][_0xbbf0('0x18')]=![];this[_0xbbf0('0x12')][_0xbbf0('0x16')][this['agent']['id']][_0xbbf0('0x19')]=undefined;util[_0xbbf0('0x1d')](this[_0xbbf0('0x6')]['id'],this[_0xbbf0('0x12')][_0xbbf0('0x16')][this[_0xbbf0('0x5')]['id']],_0x199cd2?_0xbbf0('0x1e'):_0xbbf0('0x1f'));}if(!_0x199cd2){setTimeout(this[_0xbbf0('0xe')][_0xbbf0('0x9')](this),0x3e8);}};function agent(_0xaca152,_0x6f4162,_0x55a538,_0x559919){return new Agent(_0xaca152,_0x6f4162,_0x55a538,_0x559919);}module['exports']=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 62f2584..2405bfb 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 _0x8268=['bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','squeue','queue','realtime','push','handleRun'];(function(_0x5d671f,_0x30c1cb){var _0x519e88=function(_0x1d8da7){while(--_0x1d8da7){_0x5d671f['push'](_0x5d671f['shift']());}};_0x519e88(++_0x30c1cb);}(_0x8268,0xcf));var _0x8826=function(_0x5bdafa,_0x54dc99){_0x5bdafa=_0x5bdafa-0x0;var _0x13af05=_0x8268[_0x5bdafa];return _0x13af05;};'use strict';var _=require(_0x8826('0x0'));var uuid=require(_0x8826('0x1'));var util=require(_0x8826('0x2'));var logger=require('../../../../../config/logger')(_0x8826('0x3'));var Beepall=function(_0x29d5c3,_0x2577c0,_0x568d0f,_0x206734){this[_0x8826('0x4')]=uuid['v4']();this[_0x8826('0x5')]=_0x29d5c3;this[_0x8826('0x6')]=_0x2577c0;this[_0x8826('0x7')]=_0x568d0f;this['routing']=_0x206734;this[_0x8826('0x5')][_0x8826('0x8')](this[_0x8826('0x9')][_0x8826('0xa')](this),this[_0x8826('0xb')][_0x8826('0xa')](this));this['squeue']['on'](_0x8826('0xc'),this[_0x8826('0xb')][_0x8826('0xa')](this));this[_0x8826('0x5')]['on'](_0x8826('0xd'),this[_0x8826('0xe')][_0x8826('0xa')](this));};Beepall[_0x8826('0xf')][_0x8826('0x8')]=function(){this[_0x8826('0x5')][_0x8826('0x8')](this[_0x8826('0x9')][_0x8826('0xa')](this),this[_0x8826('0xb')][_0x8826('0xa')](this));};Beepall[_0x8826('0xf')][_0x8826('0xe')]=function(_0xd0dbc0){this['handleTimeout'](!![]);};Beepall['prototype'][_0x8826('0x9')]=function(_0x391c65){var _0x15c1b5=!![];if(!_[_0x8826('0x10')](this[_0x8826('0x6')])&&!_['isNil'](this['queue'][_0x8826('0x11')])&&this['queue'][_0x8826('0x11')]['length']>0x0){for(var _0x4a49c7=0x0,_0x430f56;_0x4a49c70x0){for(var _0x18c49c=0x0,_0x1576ed;_0x18c49c0x0&&_0x32acdf[_0xb90233+_0x11b4('0x26')]>=_0x32acdf[_0xb90233+'Capacity']){writeLog(_0xf6eb86,_0x32acdf,_0xb90233[_0x11b4('0x27')]()+_0x11b4('0x28'));return![];}}return!![];};exports[_0x11b4('0x29')]=function(_0xba2a24,_0x49fc6c,_0x243c16,_0x5c7892,_0x4f0fa7){return sendNotification(!![],_0xba2a24,_0x49fc6c,_0x243c16,_0x5c7892,_0x4f0fa7);};exports[_0x11b4('0x2a')]=function(_0x42156d,_0x2a6588,_0x40ca6a,_0x3c617a,_0xef4172){return sendNotification(![],_0x42156d,_0x2a6588,_0x40ca6a,_0x3c617a,_0xef4172);};exports['writeLog']=writeLog; \ No newline at end of file +var _0xf655=['redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','user:save','split','name','notificationSound','account','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]','isAgentAvailable','busy','online','OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing'];(function(_0x9a4a06,_0x41589b){var _0x11bc46=function(_0x39a68b){while(--_0x39a68b){_0x9a4a06['push'](_0x9a4a06['shift']());}};_0x11bc46(++_0x41589b);}(_0xf655,0x1e7));var _0x5f65=function(_0x1f79bf,_0x491f09){_0x1f79bf=_0x1f79bf-0x0;var _0x5eb6e9=_0xf655[_0x1f79bf];return _0x5eb6e9;};'use strict';var _=require(_0x5f65('0x0'));var util=require(_0x5f65('0x1'));var utils=require(_0x5f65('0x2'));var Mustache=require(_0x5f65('0x3'));var Redis=require(_0x5f65('0x4'));var config=require(_0x5f65('0x5'));var logger=require(_0x5f65('0x6'))(_0x5f65('0x7'));config[_0x5f65('0x8')]=_[_0x5f65('0x9')](config[_0x5f65('0x8')],{'host':_0x5f65('0xa'),'port':0x18eb});var io=require(_0x5f65('0xb'))(new Redis(config[_0x5f65('0x8')]));function emit(_0x3258be,_0x4f9153,_0x57cb5b){io['to'](_0x3258be)[_0x5f65('0xc')](_0x4f9153,_0x57cb5b);}function sendNotification(_0x2fbb89,_0x4460c5,_0x4ca053,_0x1d42ab,_0x1a63d0,_0x3320e1){io['to'](util[_0x5f65('0xd')](_0x5f65('0xe'),_0x1d42ab['name']))[_0x5f65('0xc')](_0x5f65('0xf'),_0x1d42ab);var _0x5ce3de=_0x3320e1||{};var _0x531aed=_0x4ca053[_0x5f65('0x10')]('.');var _0x1233d5={'uniqueid':_0x4460c5,'channel':_0x531aed[0x0],'id':_0x531aed[0x1],'title':_0x531aed[0x0]+'\x20interaction','interactionId':_0x531aed[0x2],'queue':_0x1a63d0?_0x1a63d0[_0x5f65('0x11')]:null,'sound':_0x5ce3de['account'][_0x5f65('0x12')],'shake':_0x5ce3de[_0x5f65('0x13')]['notificationShake']};try{if(!_0x5ce3de['body']){_0x5ce3de[_0x5f65('0x14')]={};}if(_0x1a63d0){_0x5ce3de[_0x5f65('0x14')][_0x5f65('0x15')]=_0x1a63d0;}else if(_0x5ce3de['body'][_0x5f65('0x15')]){delete _0x5ce3de[_0x5f65('0x14')]['queue'];}_0x1233d5[_0x5f65('0x16')]=utils[_0x5f65('0x17')](_0x5ce3de['account'][_0x5f65('0x18')],_0x5ce3de);}catch(_0x272d7b){_0x1233d5[_0x5f65('0x16')]=_0x5f65('0x19');logger[_0x5f65('0x1a')](util['format'](_0x5f65('0x1b'),_0x4460c5,_0x272d7b['message']));}io['to'](util[_0x5f65('0xd')](_0x5f65('0xe'),_0x1d42ab[_0x5f65('0x11')]))['emit'](util[_0x5f65('0xd')](_0x5f65('0x1c'),_0x2fbb89?_0x5f65('0x1d'):_0x5f65('0x1e')),_0x1233d5);}function writeLog(_0x344961,_0x54040f,_0x4ecaad){return logger[_0x5f65('0x1f')](util['format'](_0x5f65('0x20'),_0x344961,_0x54040f['name'],_0x4ecaad));}exports[_0x5f65('0x21')]=function(_0x529058,_0x2e0a14,_0x5cac7e,_0x1d47d7){if(_0x2e0a14[_0x5f65('0x22')]){writeLog(_0x529058,_0x2e0a14,'BUSY');return![];}if(!_0x2e0a14[_0x5f65('0x23')]){writeLog(_0x529058,_0x2e0a14,_0x5f65('0x24'));return![];}if(_0x2e0a14[_0x5cac7e+_0x5f65('0x25')]){writeLog(_0x529058,_0x2e0a14,'PAUSE');return![];}if(_0x1d47d7&&_0x2e0a14[_0x5f65('0x26')](_0x5cac7e+_0x5f65('0x27'))&&_0x2e0a14[_0x5f65('0x26')](_0x5cac7e+_0x5f65('0x28'))){if(_0x2e0a14[_0x5cac7e+_0x5f65('0x27')]>0x0&&_0x2e0a14[_0x5cac7e+_0x5f65('0x28')]>=_0x2e0a14[_0x5cac7e+'Capacity']){writeLog(_0x529058,_0x2e0a14,_0x5cac7e[_0x5f65('0x29')]()+_0x5f65('0x2a'));return![];}}return!![];};exports['showNotification']=function(_0x3f6f41,_0x13dacc,_0x79ac47,_0x27767e,_0x54518d){return sendNotification(!![],_0x3f6f41,_0x13dacc,_0x79ac47,_0x27767e,_0x54518d);};exports[_0x5f65('0x2b')]=function(_0x5d776f,_0x4ac086,_0x1484f2,_0x575bbf,_0x333640){return sendNotification(![],_0x5d776f,_0x4ac086,_0x1484f2,_0x575bbf,_0x333640);};exports[_0x5f65('0x2c')]=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 ef698cc..ca8fd92 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 _0xc408=['shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate'];(function(_0x378965,_0x24b336){var _0x264afa=function(_0x3d382c){while(--_0x3d382c){_0x378965['push'](_0x378965['shift']());}};_0x264afa(++_0x24b336);}(_0xc408,0xe7));var _0x8c40=function(_0x5ab14e,_0x315cbd){_0x5ab14e=_0x5ab14e-0x0;var _0x35079a=_0xc408[_0x5ab14e];return _0x35079a;};'use strict';var schema=require(_0x8c40('0x0'));var sh=require(_0x8c40('0x1'));var _=require(_0x8c40('0x2'));var utils=require(_0x8c40('0x3'));var logger=require(_0x8c40('0x4'))(_0x8c40('0x5'));var system=schema({'command':{'type':_0x8c40('0x6'),'required':!![],'message':_0x8c40('0x7')}});exports['consequence']=function(_0x307473,_0x1ed2e2){return function(_0x38b9ce){try{var _0x23fb11={'command':_0x1ed2e2[0x0]};var _0x25eb00=system[_0x8c40('0x0')](_0x23fb11,{'typecast':!![]});if(_0x25eb00[_0x8c40('0x8')]){logger[_0x8c40('0x9')](_0x8c40('0xa'),_0x307473,_[_0x8c40('0xb')](_0x25eb00,_0x8c40('0xc'))['join'](',\x20'));logger[_0x8c40('0xd')](_0x8c40('0xe'),_0x307473);_0x38b9ce[_0x8c40('0xf')]();}else{var _0x37e0ca=this;var _0x846ede=utils[_0x8c40('0x10')](_0x1ed2e2[0x0],this);logger['info'](_0x8c40('0x11'),_0x307473,_0x846ede);sh[_0x8c40('0x12')](_[_0x8c40('0x13')](_0x846ede),function(_0x3bdb77,_0x26f4f3){logger[_0x8c40('0xd')](_0x8c40('0x14'),_0x307473,_0x3bdb77);if(_0x3bdb77==0x0){var _0x3ad02b=_0x26f4f3[_0x8c40('0x15')](/(\r\n|\n|\r)/gm,'');if(_[_0x8c40('0x16')](_0x1ed2e2[0x1])||_[_0x8c40('0x17')](_0x1ed2e2[0x1])){logger[_0x8c40('0xd')](_0x8c40('0x18'),_0x307473);_0x37e0ca[_0x8c40('0x19')][_0x1ed2e2[0x1]]=_0x3ad02b;}else{logger[_0x8c40('0xd')](_0x8c40('0x1a'),_0x307473,_0x1ed2e2[0x1],_0x3ad02b);_0x37e0ca[_0x8c40('0x19')][_0x1ed2e2[0x1]]=_0x3ad02b;}}_0x38b9ce[_0x8c40('0xf')]();});}}catch(_0x910f3a){logger[_0x8c40('0x9')](_0x8c40('0xa'),_0x307473,_[_0x8c40('0x1b')](_0x910f3a)?JSON[_0x8c40('0x1c')](_0x910f3a):_0x910f3a);logger[_0x8c40('0xd')](_0x8c40('0xe'),_0x307473);_0x38b9ce[_0x8c40('0xf')]();}};}; \ No newline at end of file +var _0x3cfa=['getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][SYSTEM]\x20%s','map','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cfa,0xc9));var _0xa3cf=function(_0x264755,_0x44b561){_0x264755=_0x264755-0x0;var _0x38db02=_0x3cfa[_0x264755];return _0x38db02;};'use strict';var schema=require(_0xa3cf('0x0'));var sh=require(_0xa3cf('0x1'));var _=require(_0xa3cf('0x2'));var utils=require(_0xa3cf('0x3'));var logger=require(_0xa3cf('0x4'))(_0xa3cf('0x5'));var system=schema({'command':{'type':_0xa3cf('0x6'),'required':!![],'message':_0xa3cf('0x7')}});exports[_0xa3cf('0x8')]=function(_0x499ee7,_0x27bc5c){return function(_0x389289){try{var _0x3f6f94={'command':_0x27bc5c[0x0]};var _0x5c6d70=system[_0xa3cf('0x0')](_0x3f6f94,{'typecast':!![]});if(_0x5c6d70['length']){logger['error'](_0xa3cf('0x9'),_0x499ee7,_[_0xa3cf('0xa')](_0x5c6d70,_0xa3cf('0xb'))['join'](',\x20'));logger[_0xa3cf('0xc')](_0xa3cf('0xd'),_0x499ee7);_0x389289[_0xa3cf('0xe')]();}else{var _0x5f3ac3=this;var _0x57cd42=utils[_0xa3cf('0xf')](_0x27bc5c[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x499ee7,_0x57cd42);sh[_0xa3cf('0x10')](_[_0xa3cf('0x11')](_0x57cd42),function(_0x54d6fa,_0x43cf6f){logger[_0xa3cf('0xc')](_0xa3cf('0x12'),_0x499ee7,_0x54d6fa);if(_0x54d6fa==0x0){var _0x33d4d7=_0x43cf6f[_0xa3cf('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xa3cf('0x14')](_0x27bc5c[0x1])||_[_0xa3cf('0x15')](_0x27bc5c[0x1])){logger[_0xa3cf('0xc')](_0xa3cf('0x16'),_0x499ee7);_0x5f3ac3['body'][_0x27bc5c[0x1]]=_0x33d4d7;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x499ee7,_0x27bc5c[0x1],_0x33d4d7);_0x5f3ac3[_0xa3cf('0x17')][_0x27bc5c[0x1]]=_0x33d4d7;}}_0x389289[_0xa3cf('0xe')]();});}}catch(_0x1ea9c7){logger[_0xa3cf('0x18')](_0xa3cf('0x9'),_0x499ee7,_[_0xa3cf('0x19')](_0x1ea9c7)?JSON[_0xa3cf('0x1a')](_0x1ea9c7):_0x1ea9c7);logger[_0xa3cf('0xc')](_0xa3cf('0xd'),_0x499ee7);_0x389289[_0xa3cf('0xe')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 496918b..54e5735 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 _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x57ac00,_0x17bf69){var _0x14814a=function(_0x846bf4){while(--_0x846bf4){_0x57ac00['push'](_0x57ac00['shift']());}};_0x14814a(++_0x17bf69);}(_0x7a54,0x106));var _0x47a5=function(_0x5caaf9,_0x1b006e){_0x5caaf9=_0x5caaf9-0x0;var _0x549967=_0x7a54[_0x5caaf9];return _0x549967;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x2c3c23,_0x3609b5){var _0x24e0ee=function(_0x510410){while(--_0x510410){_0x2c3c23['push'](_0x2c3c23['shift']());}};_0x24e0ee(++_0x3609b5);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 0f32dbb..e5cfe4a 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 _0xa73a=['message','account','interaction','list','lodash','exports','render'];(function(_0x44378f,_0x16296f){var _0x5dd8fe=function(_0x8b77c){while(--_0x8b77c){_0x44378f['push'](_0x44378f['shift']());}};_0x5dd8fe(++_0x16296f);}(_0xa73a,0x82));var _0xaa73=function(_0x4bd950,_0x184ed5){_0x4bd950=_0x4bd950-0x0;var _0x5dc59a=_0xa73a[_0x4bd950];return _0x5dc59a;};'use strict';var Mustache=require('mustache');var _=require(_0xaa73('0x0'));module[_0xaa73('0x1')]={'getMustacheRender':function(_0x230542,_0x2cc781){return Mustache[_0xaa73('0x2')](_0x230542,_['merge'](_0x2cc781['body'],{'contact':_0x2cc781['contact'],'message':_0x2cc781[_0xaa73('0x3')],'account':_0x2cc781[_0xaa73('0x4')],'interaction':_0x2cc781[_0xaa73('0x5')],'list':_0x2cc781[_0xaa73('0x6')]}))||'';}}; \ No newline at end of file +var _0x142c=['account','list','mustache','exports','merge','body'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x142c,0x86));var _0xc142=function(_0x8377ed,_0x5d4c1a){_0x8377ed=_0x8377ed-0x0;var _0x1a71ae=_0x142c[_0x8377ed];return _0x1a71ae;};'use strict';var Mustache=require(_0xc142('0x0'));var _=require('lodash');module[_0xc142('0x1')]={'getMustacheRender':function(_0x146a30,_0x10367){return Mustache['render'](_0x146a30,_[_0xc142('0x2')](_0x10367[_0xc142('0x3')],{'contact':_0x10367['contact'],'message':_0x10367['message'],'account':_0x10367[_0xc142('0x4')],'interaction':_0x10367['interaction'],'list':_0x10367[_0xc142('0x5')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index fbde60e..ea7f960 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 _0x39ca=['split','push','slice','dialogflow','tag','%s:%s:%s','./interval','intervals','./applications/','info','Push\x20new\x20rule','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','stringify','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','length','join','app','toLowerCase','autoreply','appdata'];(function(_0x38fe5c,_0x215e7a){var _0x21a5b4=function(_0x1a6339){while(--_0x1a6339){_0x38fe5c['push'](_0x38fe5c['shift']());}};_0x21a5b4(++_0x215e7a);}(_0x39ca,0xe2));var _0xa39c=function(_0x4292cd,_0x327a40){_0x4292cd=_0x4292cd-0x0;var _0x5e4838=_0x39ca[_0x4292cd];return _0x5e4838;};'use strict';var _=require(_0xa39c('0x0'));var util=require(_0xa39c('0x1'));var path=require(_0xa39c('0x2'));var fs=require('fs');var jayson=require(_0xa39c('0x3'));var BPromise=require(_0xa39c('0x4'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa39c('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0xa39c('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xa39c('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xa39c('0x8'))};var RuleEngine=require(_0xa39c('0x9'));function getId(_0x241e6d,_0x4340c0,_0x586ba9){return util[_0xa39c('0xa')](_0xa39c('0xb'),_0x241e6d,_0x4340c0||0x0,_0x586ba9||0x0);}function getIntervals(_0x40941f,_0x3e02da){var _0x637891=[];if(!_[_0xa39c('0xc')](_0x3e02da['IntervalId'])&&!_[_0xa39c('0xc')](_0x40941f[_0x3e02da[_0xa39c('0xd')]])&&!_['isNil'](_0x40941f[_0x3e02da[_0xa39c('0xd')]][_0xa39c('0xe')])){_0x637891=_[_0xa39c('0xf')](_0x40941f[_0x3e02da[_0xa39c('0xd')]]['Intervals'],_0xa39c('0x10'));}else if(!_[_0xa39c('0xc')](_0x3e02da['interval'])){_0x637891=[_0x3e02da['interval']];}return _0x637891;}exports[_0xa39c('0x11')]=function(_0x5f2a3d){_0x5f2a3d[_0xa39c('0x12')]={};return new BPromise(function(_0x3176b5,_0x75009){var _0x55509f={'Start':function(_0x26fefb){var _0x2b50a0=this;return new Promise(function(_0x1b1876,_0x2225eb){if(_0x26fefb){try{var _0x2cfcac=[];var _0x966ada=getId(_0x26fefb[_0xa39c('0x13')],_0x26fefb[_0xa39c('0x14')]?_0x26fefb[_0xa39c('0x14')]['id']:0x0,_0x26fefb[_0xa39c('0x15')]?_0x26fefb[_0xa39c('0x15')]['id']:0x0);if(_0x26fefb['applications']&&_['isArray'](_0x26fefb['applications'])&&_0x26fefb[_0xa39c('0x16')][_0xa39c('0x17')]){for(var _0x29c88d=0x0;_0x29c88d<_0x26fefb['applications'][_0xa39c('0x17')];_0x29c88d+=0x1){var _0x58db25=_0x26fefb[_0xa39c('0x16')][_0x29c88d];if(fs['existsSync'](path[_0xa39c('0x18')](__dirname,_0xa39c('0x16'),_0x58db25[_0xa39c('0x19')]+'.js'))){var _0x2181e8=[];switch(_0x58db25[_0xa39c('0x19')][_0xa39c('0x1a')]()){case _0xa39c('0x1b'):var _0xf37ac9=_0x58db25[_0xa39c('0x1c')][_0xa39c('0x1d')](',');_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[0x0]);_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[_0xa39c('0x1f')](0x1,_0xf37ac9[_0xa39c('0x17')])[_0xa39c('0x18')](','));break;case _0xa39c('0x20'):var _0xf37ac9=_0x58db25[_0xa39c('0x1c')][_0xa39c('0x1d')](',');_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[0x0]);_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[0x1]);_0x2181e8['push'](_0xf37ac9['slice'](0x2,_0xf37ac9[_0xa39c('0x17')])['join'](','));break;case'amazonlex':var _0xf37ac9=_0x58db25[_0xa39c('0x1c')][_0xa39c('0x1d')](',');_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[0x0]);_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[0x1]);_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[0x2]);_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[0x3]);_0x2181e8[_0xa39c('0x1e')](_0xf37ac9[_0xa39c('0x1f')](0x4,_0xf37ac9[_0xa39c('0x17')])[_0xa39c('0x18')](','));break;case _0xa39c('0x14'):_0x2181e8[_0xa39c('0x1e')](_0x58db25[_0xa39c('0x1c')]);break;case _0xa39c('0x21'):_0x2181e8['push'](_0x58db25['TagId']);_0x2181e8[_0xa39c('0x1e')](_0x58db25[_0xa39c('0x1c')]);break;default:_0x2181e8=_[_0xa39c('0xc')](_0x58db25[_0xa39c('0x1c')])?[]:_0x58db25[_0xa39c('0x1c')]['split'](',');}var _0x33e716={'id':util[_0xa39c('0xa')](_0xa39c('0x22'),_0x966ada,_0x58db25['id'],_0x58db25[_0xa39c('0x19')]),'condition':require(_0xa39c('0x23'))['condition'](_0x966ada,getIntervals(_0x5f2a3d[_0xa39c('0x24')],_0x58db25),_0x5f2a3d),'consequence':require(_0xa39c('0x25')+_0x58db25['app'])['consequence'](_0x966ada,_0x2181e8,_0x5f2a3d,_0x26fefb),'p':_0x58db25['priority']||0x0};logger[_0xa39c('0x26')](_0xa39c('0x27'),_0x33e716['id'],'on\x20interval',getIntervals(_0x5f2a3d[_0xa39c('0x24')],_0x58db25)[_0xa39c('0x18')]('\x20|\x20'));_0x2cfcac[_0xa39c('0x1e')](_0x33e716);}else{logger[_0xa39c('0x28')](_0xa39c('0x29'),path[_0xa39c('0x18')](__dirname,_0xa39c('0x16'),_0x58db25['app']+_0xa39c('0x2a')));}}_0x5f2a3d[_0xa39c('0x12')][_0x966ada]=new RuleEngine(_0x2cfcac);_0x5f2a3d['rules'][_0x966ada][_0xa39c('0x2b')](_0x26fefb,function(_0x301ecf){logger[_0xa39c('0x26')]('Applications\x20executed',JSON[_0xa39c('0x2c')](_0x301ecf[_0xa39c('0x2d')]));if(_0x5f2a3d[_0xa39c('0x12')][_0x966ada]){_0x5f2a3d['rules'][_0x966ada][_0xa39c('0x2e')]('end');}});return _0x1b1876({'code':0xc8,'message':_0x26fefb});}else{logger['info'](_0xa39c('0x2f'));return _0x1b1876({'code':0xc8,'message':_0x26fefb});}}catch(_0x239e39){logger['error'](_0x239e39['stack']);return _0x2225eb(_0x2b50a0[_0xa39c('0x28')](0x1f4,_0x239e39));}}return _0x2225eb(_0xa39c('0x30'));});},'AcceptMessage':function(_0x3de025){var _0x104a28=this;return new Promise(function(_0x33f704,_0x3b9b85){if(_0x3de025[_0xa39c('0x14')]&&_0x3de025[_0xa39c('0x14')]['id']){try{var _0x2d36ed=getId(_0x3de025['channel'],_0x3de025[_0xa39c('0x14')]?_0x3de025[_0xa39c('0x14')]['id']:0x0,_0x3de025['interaction']?_0x3de025[_0xa39c('0x15')]['id']:0x0);if(_0x5f2a3d[_0xa39c('0x12')][_0x2d36ed]){_0x5f2a3d[_0xa39c('0x12')][_0x2d36ed]['emit'](_0xa39c('0x31'));if(rpc[_0x3de025[_0xa39c('0x13')]+_0xa39c('0x32')]){rpc[_0x3de025[_0xa39c('0x13')]+'QueueReport'][_0xa39c('0x33')](_0x2d36ed,{'UserId':_0x3de025[_0xa39c('0x14')][_0xa39c('0x34')]})[_0xa39c('0x35')](function(_0x1af96d){logger[_0xa39c('0x28')](_0xa39c('0x36'));});}}return _0x33f704({'code':0xc8,'message':_0x3de025});}catch(_0x51eb7a){logger[_0xa39c('0x28')](_0x51eb7a[_0xa39c('0x37')]);return _0x3b9b85(_0x104a28[_0xa39c('0x28')](0x1f4,_0x51eb7a));}}logger[_0xa39c('0x28')](_0xa39c('0x38'));return _0x3b9b85(_0x104a28[_0xa39c('0x28')](0x1f4,_0xa39c('0x38')));});},'RejectMessage':function(_0x53225a){var _0x2cfe29=this;return new Promise(function(_0x35bea4,_0x1d11dc){if(_0x53225a[_0xa39c('0x39')]&&_0x53225a[_0xa39c('0x39')]['id']){try{if(_0x5f2a3d[_0xa39c('0x3a')][_0x53225a[_0xa39c('0x39')]['id']]){_0x5f2a3d[_0xa39c('0x3a')][_0x53225a['agent']['id']][_0xa39c('0x3b')]=![];_0x5f2a3d[_0xa39c('0x3a')][_0x53225a[_0xa39c('0x39')]['id']][_0xa39c('0x3c')]=undefined;}return _0x35bea4({'code':0xc8,'message':_0x53225a});}catch(_0x4f0ab5){logger[_0xa39c('0x28')](_0x4f0ab5[_0xa39c('0x37')]);return _0x1d11dc(_0x2cfe29['error'](0x1f4,_0x4f0ab5));}}logger[_0xa39c('0x28')](_0xa39c('0x38'));return _0x1d11dc(_0x2cfe29[_0xa39c('0x28')](0x1f4,_0xa39c('0x38')));});},'AbandonInteraction':function(_0x29e8ab){var _0x3b2bd6=this;return new Promise(function(_0x26ae0d,_0x31a680){if(_0x29e8ab[_0xa39c('0x13')]&&_0x29e8ab[_0xa39c('0x15')]&&_0x29e8ab[_0xa39c('0x15')]['id']){try{var _0xdff5a0=getId(_0x29e8ab[_0xa39c('0x13')],_0x29e8ab['message']?_0x29e8ab['message']['id']:0x0,_0x29e8ab[_0xa39c('0x15')]?_0x29e8ab[_0xa39c('0x15')]['id']:0x0);if(_0x5f2a3d[_0xa39c('0x12')][_0xdff5a0]){_0x5f2a3d[_0xa39c('0x12')][_0xdff5a0][_0xa39c('0x2e')](_0xa39c('0x31'));}return _0x26ae0d({'code':0xc8,'message':_0x29e8ab});}catch(_0x5421f3){logger[_0xa39c('0x28')](_0x5421f3['stack']);return _0x31a680(_0x3b2bd6[_0xa39c('0x28')](0x1f4,_0x5421f3));}}logger[_0xa39c('0x28')](_0xa39c('0x38'));return _0x31a680(_0x3b2bd6[_0xa39c('0x28')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x26ced4){var _0x1dcb9b=this;return new Promise(function(_0x3bc357,_0x48fae4){if(_0x5f2a3d[_0xa39c('0x3a')][_0xa39c('0x3d')](_0x26ced4['id'])){for(var _0x3b58db in _0x26ced4[_0xa39c('0x3e')]){if(_0x26ced4[_0xa39c('0x3e')][_0xa39c('0x3d')](_0x3b58db)){if(_0x5f2a3d['agents'][_0x26ced4['id']]['hasOwnProperty'](_0x3b58db+_0xa39c('0x3f'))){_0x5f2a3d['agents'][_0x26ced4['id']][_0x3b58db+_0xa39c('0x3f')]=parseInt(_0x26ced4[_0xa39c('0x3e')][_0x3b58db],0xa);}}}_0x5f2a3d[_0xa39c('0x3a')][_0x26ced4['id']][_0xa39c('0x40')]();return _0x3bc357({'code':0xc8,'message':_0x5f2a3d[_0xa39c('0x3a')][_0x26ced4['id']]});}else{return _0x48fae4(_0x1dcb9b['error'](0x1f4,_0xa39c('0x41')));}});},'Agents':function(_0x13b2cf){return new Promise(function(_0x3c1f0f,_0x4dc396){var _0x47871e=_[_0xa39c('0x42')](_0x5f2a3d[_0xa39c('0x3a')]);_0x3c1f0f({'count':_0x47871e[_0xa39c('0x17')],'rows':_0x47871e});});},'ChatQueues':function(_0x1e00f5){return new Promise(function(_0x5c04f4,_0x55984b){var _0x1486b9=[];for(var _0x4df070 in _0x5f2a3d[_0xa39c('0x43')]){if(_0x5f2a3d[_0xa39c('0x43')][_0xa39c('0x3d')](_0x4df070)){var _0x3d9331=_0x5f2a3d[_0xa39c('0x43')][_0x4df070];var _0x569266={'id':_0x3d9331['id'],'available':_0x3d9331[_0xa39c('0x44')],'loggedIn':_0x3d9331[_0xa39c('0x45')],'name':_0x3d9331[_0xa39c('0x46')],'paused':_0x3d9331['paused'],'waiting':_0x3d9331[_0xa39c('0x47')]};_0x1486b9[_0xa39c('0x1e')](_0x569266);}}_0x5c04f4({'count':_0x1486b9['length'],'rows':_0x1486b9});});},'MailQueues':function(_0x2f6969){return new Promise(function(_0x2dd1b4,_0x3da0d9){var _0x44fe76=[];for(var _0x1088c8 in _0x5f2a3d['mailQueues']){if(_0x5f2a3d[_0xa39c('0x48')][_0xa39c('0x3d')](_0x1088c8)){var _0x1cb801=_0x5f2a3d[_0xa39c('0x48')][_0x1088c8];var _0x5425ea={'id':_0x1cb801['id'],'available':_0x1cb801[_0xa39c('0x44')],'loggedIn':_0x1cb801[_0xa39c('0x45')],'name':_0x1cb801[_0xa39c('0x46')],'paused':_0x1cb801[_0xa39c('0x49')],'waiting':_0x1cb801[_0xa39c('0x47')]};_0x44fe76[_0xa39c('0x1e')](_0x5425ea);}}_0x2dd1b4({'count':_0x44fe76[_0xa39c('0x17')],'rows':_0x44fe76});});},'OpenchannelQueues':function(_0x1652e5){return new Promise(function(_0x148661,_0x18b1ad){var _0x3a1e6e=[];for(var _0x1e16bc in _0x5f2a3d[_0xa39c('0x4a')]){if(_0x5f2a3d[_0xa39c('0x4a')][_0xa39c('0x3d')](_0x1e16bc)){var _0x13d7b0=_0x5f2a3d[_0xa39c('0x4a')][_0x1e16bc];var _0x5efdc0={'id':_0x13d7b0['id'],'available':_0x13d7b0[_0xa39c('0x44')],'loggedIn':_0x13d7b0[_0xa39c('0x45')],'name':_0x13d7b0[_0xa39c('0x46')],'paused':_0x13d7b0[_0xa39c('0x49')],'waiting':_0x13d7b0[_0xa39c('0x47')]};_0x3a1e6e[_0xa39c('0x1e')](_0x5efdc0);}}_0x148661({'count':_0x3a1e6e[_0xa39c('0x17')],'rows':_0x3a1e6e});});},'SmsQueues':function(_0x25afe5){return new Promise(function(_0x3f6569,_0x502b45){var _0x4e291e=[];for(var _0x32a49e in _0x5f2a3d[_0xa39c('0x4b')]){if(_0x5f2a3d[_0xa39c('0x4b')]['hasOwnProperty'](_0x32a49e)){var _0xfcd4e4=_0x5f2a3d[_0xa39c('0x4b')][_0x32a49e];var _0x3ae03b={'id':_0xfcd4e4['id'],'available':_0xfcd4e4[_0xa39c('0x44')],'loggedIn':_0xfcd4e4['loggedIn'],'name':_0xfcd4e4[_0xa39c('0x46')],'paused':_0xfcd4e4[_0xa39c('0x49')],'waiting':_0xfcd4e4[_0xa39c('0x47')]};_0x4e291e[_0xa39c('0x1e')](_0x3ae03b);}}_0x3f6569({'count':_0x4e291e[_0xa39c('0x17')],'rows':_0x4e291e});});},'FaxQueues':function(_0x2319d5){return new Promise(function(_0x4fd64f,_0x509752){var _0x1c6995=[];for(var _0x3f71d6 in _0x5f2a3d[_0xa39c('0x4c')]){if(_0x5f2a3d[_0xa39c('0x4c')][_0xa39c('0x3d')](_0x3f71d6)){var _0x57deb4=_0x5f2a3d['faxQueues'][_0x3f71d6];var _0x1cedbb={'id':_0x57deb4['id'],'available':_0x57deb4[_0xa39c('0x44')],'loggedIn':_0x57deb4[_0xa39c('0x45')],'name':_0x57deb4[_0xa39c('0x46')],'paused':_0x57deb4[_0xa39c('0x49')],'waiting':_0x57deb4[_0xa39c('0x47')]};_0x1c6995[_0xa39c('0x1e')](_0x1cedbb);}}_0x4fd64f({'count':_0x1c6995[_0xa39c('0x17')],'rows':_0x1c6995});});},'ChatQueuesWaitingInteractions':function(_0x51da9a){return new Promise(function(_0x3ec2e0,_0x113355){var _0x3fd52e=_['values'](_0x5f2a3d[_0xa39c('0x4d')]);_0x3ec2e0({'count':_0x3fd52e[_0xa39c('0x17')],'rows':_0x3fd52e});});},'MailQueuesWaitingInteractions':function(_0x3d1fbf){return new Promise(function(_0x192659,_0x2c3d54){var _0x1d874f=_[_0xa39c('0x42')](_0x5f2a3d[_0xa39c('0x4e')]);_0x192659({'count':_0x1d874f[_0xa39c('0x17')],'rows':_0x1d874f});});},'OpenchannelQueuesWaitingInteractions':function(_0x3db65b){return new Promise(function(_0x141410,_0x27c36f){var _0x1d7999=_[_0xa39c('0x42')](_0x5f2a3d[_0xa39c('0x4f')]);_0x141410({'count':_0x1d7999[_0xa39c('0x17')],'rows':_0x1d7999});});},'SmsQueuesWaitingInteractions':function(_0x48f5f4){return new Promise(function(_0x400865,_0x44e84c){var _0x5b8737=_['values'](_0x5f2a3d[_0xa39c('0x50')]);_0x400865({'count':_0x5b8737[_0xa39c('0x17')],'rows':_0x5b8737});});},'FaxQueuesWaitingInteractions':function(_0x27b589){return new Promise(function(_0x25fec6,_0x39440c){var _0x17e218=_[_0xa39c('0x42')](_0x5f2a3d[_0xa39c('0x51')]);_0x25fec6({'count':_0x17e218[_0xa39c('0x17')],'rows':_0x17e218});});}};var _0x46cfc4=jayson['server'](_0x55509f)[_0xa39c('0x52')]();_0x46cfc4['on'](_0xa39c('0x28'),function(_0x57ae21){logger[_0xa39c('0x28')](JSON[_0xa39c('0x2c')](_0x57ae21));return _0x75009(_0x57ae21);});_0x46cfc4['listen'](0x232c,'127.0.0.1',function(){console['log'](_0xa39c('0x53'),0x232c);return _0x3176b5(_0xa39c('0x54')+0x232c);});});}; \ No newline at end of file +var _0xc340=['appdata','condition','intervals','./applications/','consequence','priority','info','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','No\x20applications\x20to\x20execute','stack','emit','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','agent','agents','busy','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','agent\x20not\x20found','chatQueues','loggedIn','name','paused','mailQueues','available','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','push','slice'];(function(_0x301dab,_0x38050a){var _0x2500a2=function(_0x4d3dff){while(--_0x4d3dff){_0x301dab['push'](_0x301dab['shift']());}};_0x2500a2(++_0x38050a);}(_0xc340,0x1d1));var _0x0c34=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc340[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x0c34('0x0'));var util=require(_0x0c34('0x1'));var path=require(_0x0c34('0x2'));var fs=require('fs');var jayson=require(_0x0c34('0x3'));var BPromise=require(_0x0c34('0x4'));var uuid=require(_0x0c34('0x5'));var config=require(_0x0c34('0x6'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x0c34('0x7'))};var rpc={'openchannelQueueReport':require(_0x0c34('0x7')),'mailQueueReport':require(_0x0c34('0x8')),'chatQueueReport':require(_0x0c34('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x3a0449,_0x274666,_0x4c751d){return util[_0x0c34('0xa')](_0x0c34('0xb'),_0x3a0449,_0x274666||0x0,_0x4c751d||0x0);}function getIntervals(_0x2dd18a,_0x11475b){var _0x38682a=[];if(!_[_0x0c34('0xc')](_0x11475b[_0x0c34('0xd')])&&!_[_0x0c34('0xc')](_0x2dd18a[_0x11475b[_0x0c34('0xd')]])&&!_[_0x0c34('0xc')](_0x2dd18a[_0x11475b[_0x0c34('0xd')]][_0x0c34('0xe')])){_0x38682a=_['map'](_0x2dd18a[_0x11475b[_0x0c34('0xd')]][_0x0c34('0xe')],'interval');}else if(!_[_0x0c34('0xc')](_0x11475b[_0x0c34('0xf')])){_0x38682a=[_0x11475b[_0x0c34('0xf')]];}return _0x38682a;}exports[_0x0c34('0x10')]=function(_0x1abe70){_0x1abe70[_0x0c34('0x11')]={};return new BPromise(function(_0x33d66c,_0x54df6f){var _0x2ab1df={'Start':function(_0x4661e1){var _0x1542ce=this;return new Promise(function(_0x5c7299,_0x4dd7f8){if(_0x4661e1){try{var _0x372e34=[];var _0x3d60c3=getId(_0x4661e1[_0x0c34('0x12')],_0x4661e1[_0x0c34('0x13')]?_0x4661e1[_0x0c34('0x13')]['id']:0x0,_0x4661e1['interaction']?_0x4661e1[_0x0c34('0x14')]['id']:0x0);if(_0x4661e1[_0x0c34('0x15')]&&_[_0x0c34('0x16')](_0x4661e1['applications'])&&_0x4661e1['applications']['length']){for(var _0x35c78b=0x0;_0x35c78b<_0x4661e1[_0x0c34('0x15')][_0x0c34('0x17')];_0x35c78b+=0x1){var _0x5423d9=_0x4661e1[_0x0c34('0x15')][_0x35c78b];if(fs[_0x0c34('0x18')](path[_0x0c34('0x19')](__dirname,'applications',_0x5423d9[_0x0c34('0x1a')]+_0x0c34('0x1b')))){var _0x4351e5=[];switch(_0x5423d9['app'][_0x0c34('0x1c')]()){case _0x0c34('0x1d'):var _0x311ff3=_0x5423d9['appdata'][_0x0c34('0x1e')](',');_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x0]);_0x4351e5['push'](_0x311ff3[_0x0c34('0x20')](0x1,_0x311ff3[_0x0c34('0x17')])[_0x0c34('0x19')](','));break;case'dialogflow':var _0x311ff3=_0x5423d9[_0x0c34('0x21')][_0x0c34('0x1e')](',');_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x0]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x1]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[_0x0c34('0x20')](0x2,_0x311ff3['length'])[_0x0c34('0x19')](','));break;case'amazonlex':var _0x311ff3=_0x5423d9[_0x0c34('0x21')][_0x0c34('0x1e')](',');_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x0]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[0x1]);_0x4351e5['push'](_0x311ff3[0x2]);_0x4351e5['push'](_0x311ff3[0x3]);_0x4351e5[_0x0c34('0x1f')](_0x311ff3[_0x0c34('0x20')](0x4,_0x311ff3[_0x0c34('0x17')])['join'](','));break;case'message':_0x4351e5[_0x0c34('0x1f')](_0x5423d9[_0x0c34('0x21')]);break;case'tag':_0x4351e5[_0x0c34('0x1f')](_0x5423d9['TagId']);_0x4351e5[_0x0c34('0x1f')](_0x5423d9[_0x0c34('0x21')]);break;default:_0x4351e5=_[_0x0c34('0xc')](_0x5423d9[_0x0c34('0x21')])?[]:_0x5423d9[_0x0c34('0x21')]['split'](',');}var _0x10a323={'id':util[_0x0c34('0xa')]('%s:%s:%s',_0x3d60c3,_0x5423d9['id'],_0x5423d9[_0x0c34('0x1a')]),'condition':require('./interval')[_0x0c34('0x22')](_0x3d60c3,getIntervals(_0x1abe70[_0x0c34('0x23')],_0x5423d9),_0x1abe70),'consequence':require(_0x0c34('0x24')+_0x5423d9[_0x0c34('0x1a')])[_0x0c34('0x25')](_0x3d60c3,_0x4351e5,_0x1abe70,_0x4661e1),'p':_0x5423d9[_0x0c34('0x26')]||0x0};logger[_0x0c34('0x27')]('Push\x20new\x20rule',_0x10a323['id'],_0x0c34('0x28'),getIntervals(_0x1abe70[_0x0c34('0x23')],_0x5423d9)['join'](_0x0c34('0x29')));_0x372e34['push'](_0x10a323);}else{logger[_0x0c34('0x2a')](_0x0c34('0x2b'),path[_0x0c34('0x19')](__dirname,_0x0c34('0x15'),_0x5423d9[_0x0c34('0x1a')]+_0x0c34('0x1b')));}}_0x1abe70[_0x0c34('0x11')][_0x3d60c3]=new RuleEngine(_0x372e34);_0x1abe70[_0x0c34('0x11')][_0x3d60c3][_0x0c34('0x2c')](_0x4661e1,function(_0x4986ec){logger[_0x0c34('0x27')](_0x0c34('0x2d'),JSON['stringify'](_0x4986ec[_0x0c34('0x2e')]));if(_0x1abe70[_0x0c34('0x11')][_0x3d60c3]){_0x1abe70[_0x0c34('0x11')][_0x3d60c3]['emit']('end');}});return _0x5c7299({'code':0xc8,'message':_0x4661e1});}else{logger[_0x0c34('0x27')](_0x0c34('0x2f'));return _0x5c7299({'code':0xc8,'message':_0x4661e1});}}catch(_0x513001){logger[_0x0c34('0x2a')](_0x513001[_0x0c34('0x30')]);return _0x4dd7f8(_0x1542ce[_0x0c34('0x2a')](0x1f4,_0x513001));}}return _0x4dd7f8('routing\x20is\x20empty');});},'AcceptMessage':function(_0x358a46){var _0x31559e=this;return new Promise(function(_0x2c9441,_0x2a8b35){if(_0x358a46['message']&&_0x358a46[_0x0c34('0x13')]['id']){try{var _0x2a5a46=getId(_0x358a46[_0x0c34('0x12')],_0x358a46[_0x0c34('0x13')]?_0x358a46[_0x0c34('0x13')]['id']:0x0,_0x358a46[_0x0c34('0x14')]?_0x358a46[_0x0c34('0x14')]['id']:0x0);if(_0x1abe70['rules'][_0x2a5a46]){_0x1abe70['rules'][_0x2a5a46][_0x0c34('0x31')](_0x0c34('0x32'));if(rpc[_0x358a46['channel']+_0x0c34('0x33')]){rpc[_0x358a46[_0x0c34('0x12')]+_0x0c34('0x33')][_0x0c34('0x34')](_0x2a5a46,{'UserId':_0x358a46[_0x0c34('0x13')][_0x0c34('0x35')]})['catch'](function(_0x113147){logger[_0x0c34('0x2a')](_0x0c34('0x36'));});}}return _0x2c9441({'code':0xc8,'message':_0x358a46});}catch(_0x36dbc3){logger['error'](_0x36dbc3[_0x0c34('0x30')]);return _0x2a8b35(_0x31559e[_0x0c34('0x2a')](0x1f4,_0x36dbc3));}}logger[_0x0c34('0x2a')]('message\x20is\x20empty');return _0x2a8b35(_0x31559e[_0x0c34('0x2a')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x1192f3){var _0x5b9247=this;return new Promise(function(_0x477727,_0x25e2b1){if(_0x1192f3[_0x0c34('0x37')]&&_0x1192f3[_0x0c34('0x37')]['id']){try{if(_0x1abe70[_0x0c34('0x38')][_0x1192f3[_0x0c34('0x37')]['id']]){_0x1abe70[_0x0c34('0x38')][_0x1192f3[_0x0c34('0x37')]['id']][_0x0c34('0x39')]=![];_0x1abe70['agents'][_0x1192f3[_0x0c34('0x37')]['id']]['busyQueue']=undefined;}return _0x477727({'code':0xc8,'message':_0x1192f3});}catch(_0x1e8c2c){logger[_0x0c34('0x2a')](_0x1e8c2c[_0x0c34('0x30')]);return _0x25e2b1(_0x5b9247[_0x0c34('0x2a')](0x1f4,_0x1e8c2c));}}logger[_0x0c34('0x2a')](_0x0c34('0x3a'));return _0x25e2b1(_0x5b9247[_0x0c34('0x2a')](0x1f4,_0x0c34('0x3a')));});},'AbandonInteraction':function(_0x5bcbd1){var _0x13726f=this;return new Promise(function(_0x1d4f12,_0x4b5ea9){if(_0x5bcbd1[_0x0c34('0x12')]&&_0x5bcbd1[_0x0c34('0x14')]&&_0x5bcbd1['interaction']['id']){try{var _0x362789=getId(_0x5bcbd1[_0x0c34('0x12')],_0x5bcbd1['message']?_0x5bcbd1[_0x0c34('0x13')]['id']:0x0,_0x5bcbd1[_0x0c34('0x14')]?_0x5bcbd1[_0x0c34('0x14')]['id']:0x0);if(_0x1abe70['rules'][_0x362789]){_0x1abe70[_0x0c34('0x11')][_0x362789][_0x0c34('0x31')](_0x0c34('0x32'));}return _0x1d4f12({'code':0xc8,'message':_0x5bcbd1});}catch(_0x468de0){logger[_0x0c34('0x2a')](_0x468de0[_0x0c34('0x30')]);return _0x4b5ea9(_0x13726f[_0x0c34('0x2a')](0x1f4,_0x468de0));}}logger['error'](_0x0c34('0x3a'));return _0x4b5ea9(_0x13726f[_0x0c34('0x2a')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x38fdd1){var _0x3aa7ca=this;return new Promise(function(_0x4aa819,_0x5238ed){if(_0x1abe70['agents']['hasOwnProperty'](_0x38fdd1['id'])){for(var _0x353210 in _0x38fdd1[_0x0c34('0x3b')]){if(_0x38fdd1[_0x0c34('0x3b')][_0x0c34('0x3c')](_0x353210)){if(_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']][_0x0c34('0x3c')](_0x353210+_0x0c34('0x3d'))){_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']][_0x353210+_0x0c34('0x3d')]=parseInt(_0x38fdd1[_0x0c34('0x3b')][_0x353210],0xa);}}}_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']]['updateRealtime']();return _0x4aa819({'code':0xc8,'message':_0x1abe70[_0x0c34('0x38')][_0x38fdd1['id']]});}else{return _0x5238ed(_0x3aa7ca[_0x0c34('0x2a')](0x1f4,_0x0c34('0x3e')));}});},'Agents':function(_0x9c81b4){return new Promise(function(_0x46ddc1,_0x2e3f2a){var _0x681338=_['values'](_0x1abe70[_0x0c34('0x38')]);_0x46ddc1({'count':_0x681338[_0x0c34('0x17')],'rows':_0x681338});});},'ChatQueues':function(_0x2cf5a8){return new Promise(function(_0x12afad,_0x18a0a4){var _0x1c00e5=[];for(var _0x13bd30 in _0x1abe70['chatQueues']){if(_0x1abe70[_0x0c34('0x3f')][_0x0c34('0x3c')](_0x13bd30)){var _0x3ad91e=_0x1abe70[_0x0c34('0x3f')][_0x13bd30];var _0x12c4f5={'id':_0x3ad91e['id'],'available':_0x3ad91e['available'],'loggedIn':_0x3ad91e[_0x0c34('0x40')],'name':_0x3ad91e[_0x0c34('0x41')],'paused':_0x3ad91e[_0x0c34('0x42')],'waiting':_0x3ad91e['waiting']};_0x1c00e5[_0x0c34('0x1f')](_0x12c4f5);}}_0x12afad({'count':_0x1c00e5[_0x0c34('0x17')],'rows':_0x1c00e5});});},'MailQueues':function(_0x20c83b){return new Promise(function(_0x2f2223,_0x580b98){var _0x10d9fd=[];for(var _0x326645 in _0x1abe70[_0x0c34('0x43')]){if(_0x1abe70[_0x0c34('0x43')][_0x0c34('0x3c')](_0x326645)){var _0x15766c=_0x1abe70[_0x0c34('0x43')][_0x326645];var _0x492b55={'id':_0x15766c['id'],'available':_0x15766c[_0x0c34('0x44')],'loggedIn':_0x15766c[_0x0c34('0x40')],'name':_0x15766c[_0x0c34('0x41')],'paused':_0x15766c[_0x0c34('0x42')],'waiting':_0x15766c[_0x0c34('0x45')]};_0x10d9fd['push'](_0x492b55);}}_0x2f2223({'count':_0x10d9fd[_0x0c34('0x17')],'rows':_0x10d9fd});});},'OpenchannelQueues':function(_0x34d47c){return new Promise(function(_0x37ec3b,_0x2c1de0){var _0x3e2202=[];for(var _0x36c053 in _0x1abe70['openchannelQueues']){if(_0x1abe70[_0x0c34('0x46')]['hasOwnProperty'](_0x36c053)){var _0x521513=_0x1abe70[_0x0c34('0x46')][_0x36c053];var _0x420131={'id':_0x521513['id'],'available':_0x521513['available'],'loggedIn':_0x521513[_0x0c34('0x40')],'name':_0x521513[_0x0c34('0x41')],'paused':_0x521513[_0x0c34('0x42')],'waiting':_0x521513[_0x0c34('0x45')]};_0x3e2202[_0x0c34('0x1f')](_0x420131);}}_0x37ec3b({'count':_0x3e2202[_0x0c34('0x17')],'rows':_0x3e2202});});},'SmsQueues':function(_0x5a9a02){return new Promise(function(_0x4bfe6e,_0x3ac7af){var _0x3c3674=[];for(var _0x1f27f7 in _0x1abe70[_0x0c34('0x47')]){if(_0x1abe70[_0x0c34('0x47')]['hasOwnProperty'](_0x1f27f7)){var _0x21fd29=_0x1abe70['smsQueues'][_0x1f27f7];var _0x4c7a89={'id':_0x21fd29['id'],'available':_0x21fd29['available'],'loggedIn':_0x21fd29[_0x0c34('0x40')],'name':_0x21fd29['name'],'paused':_0x21fd29[_0x0c34('0x42')],'waiting':_0x21fd29['waiting']};_0x3c3674[_0x0c34('0x1f')](_0x4c7a89);}}_0x4bfe6e({'count':_0x3c3674[_0x0c34('0x17')],'rows':_0x3c3674});});},'FaxQueues':function(_0x3d20ca){return new Promise(function(_0x188120,_0x277043){var _0x3f38f0=[];for(var _0x3e9bc4 in _0x1abe70[_0x0c34('0x48')]){if(_0x1abe70[_0x0c34('0x48')][_0x0c34('0x3c')](_0x3e9bc4)){var _0x484669=_0x1abe70['faxQueues'][_0x3e9bc4];var _0x2544e9={'id':_0x484669['id'],'available':_0x484669['available'],'loggedIn':_0x484669[_0x0c34('0x40')],'name':_0x484669[_0x0c34('0x41')],'paused':_0x484669[_0x0c34('0x42')],'waiting':_0x484669['waiting']};_0x3f38f0['push'](_0x2544e9);}}_0x188120({'count':_0x3f38f0[_0x0c34('0x17')],'rows':_0x3f38f0});});},'ChatQueuesWaitingInteractions':function(_0x3d049d){return new Promise(function(_0x3797c4,_0x418336){var _0x4774e4=_['values'](_0x1abe70[_0x0c34('0x49')]);_0x3797c4({'count':_0x4774e4[_0x0c34('0x17')],'rows':_0x4774e4});});},'MailQueuesWaitingInteractions':function(_0x19b70e){return new Promise(function(_0x355728,_0x2c2c63){var _0x4b19a2=_[_0x0c34('0x4a')](_0x1abe70[_0x0c34('0x4b')]);_0x355728({'count':_0x4b19a2[_0x0c34('0x17')],'rows':_0x4b19a2});});},'OpenchannelQueuesWaitingInteractions':function(_0xadc3b4){return new Promise(function(_0x51acb6,_0x3ad526){var _0x434312=_['values'](_0x1abe70[_0x0c34('0x4c')]);_0x51acb6({'count':_0x434312[_0x0c34('0x17')],'rows':_0x434312});});},'SmsQueuesWaitingInteractions':function(_0x5103d5){return new Promise(function(_0x3ff722,_0x4e2600){var _0x180951=_['values'](_0x1abe70['smsQueuesWaitingInteractions']);_0x3ff722({'count':_0x180951[_0x0c34('0x17')],'rows':_0x180951});});},'FaxQueuesWaitingInteractions':function(_0x52edb2){return new Promise(function(_0x4fa743,_0xf60311){var _0x249661=_['values'](_0x1abe70[_0x0c34('0x4d')]);_0x4fa743({'count':_0x249661['length'],'rows':_0x249661});});}};var _0x80a2b8=jayson[_0x0c34('0x4e')](_0x2ab1df)[_0x0c34('0x4f')]();_0x80a2b8['on'](_0x0c34('0x2a'),function(_0x118223){logger[_0x0c34('0x2a')](JSON['stringify'](_0x118223));return _0x54df6f(_0x118223);});_0x80a2b8[_0x0c34('0x10')](0x232c,_0x0c34('0x50'),function(){console[_0x0c34('0x51')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x33d66c(_0x0c34('0x52')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index c0c25b8..7cc2d14 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 _0xf53c=['jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','result','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','format','iftime\x20%s','true','catch','[%s][INTERVAL]\x20%s','all','some','info','\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','join','stack','stop','util','bluebird'];(function(_0x175b15,_0x243323){var _0x18ec6b=function(_0x3a3cbd){while(--_0x3a3cbd){_0x175b15['push'](_0x175b15['shift']());}};_0x18ec6b(++_0x243323);}(_0xf53c,0x148));var _0xcf53=function(_0x1d17ff,_0x3cace1){_0x1d17ff=_0x1d17ff-0x0;var _0x44df1e=_0xf53c[_0x1d17ff];return _0x44df1e;};'use strict';var util=require(_0xcf53('0x0'));var BPromise=require(_0xcf53('0x1'));var jayson=require(_0xcf53('0x2'));var _=require(_0xcf53('0x3'));var logger=require(_0xcf53('0x4'))(_0xcf53('0x5'));var client=jayson[_0xcf53('0x6')]['http']({'port':0x232a});function request(_0x4a0d3d,_0x7a91be){return new BPromise(function(_0x499a11,_0x25845e){return client[_0xcf53('0x7')](_0x4a0d3d,_0x7a91be)[_0xcf53('0x8')](function(_0x106960){if(_0x106960[_0xcf53('0x9')]){return _0x25845e(_0x106960['error'][_0xcf53('0xa')]);}else{return _0x499a11(_0x106960[_0xcf53('0xb')]);}})['catch'](function(_0x5bef9b){return _0x25845e(_0x5bef9b);});});}exports[_0xcf53('0xc')]=function(_0x6884bd,_0x36f5f2,_0xe4ab6c){return function(_0x594bb0){if(_0xe4ab6c['rules']&&!_0xe4ab6c[_0xcf53('0xd')][_0x6884bd]){logger['info'](_0xcf53('0xe'),_0x6884bd);return _0x594bb0['stop']();}var _0x60d9fc=[];for(var _0x2b6c4a=0x0;_0x2b6c4a<_0x36f5f2['length'];_0x2b6c4a+=0x1){_0x60d9fc[_0xcf53('0xf')](request('Command',{'command':util[_0xcf53('0x10')](_0xcf53('0x11'),_0x36f5f2[_0x2b6c4a])})[_0xcf53('0x8')](function(_0x449e39){return _0x449e39&&_0x449e39[_0xcf53('0xa')]&&_0x449e39['message']['indexOf'](_0xcf53('0x12'))>=0x0?!![]:![];})[_0xcf53('0x13')](function(_0xc5bdbe){logger['error'](_0xcf53('0x14'),_0x6884bd,_0x36f5f2[_0x2b6c4a]);}));}BPromise[_0xcf53('0x15')](_0x60d9fc)[_0xcf53('0x8')](function(_0x703025){var _0x174587=_[_0xcf53('0x16')](_0x703025);logger[_0xcf53('0x17')]('[%s][INTERVAL]\x20%s\x20%s',_0x6884bd,_0x36f5f2['join'](_0xcf53('0x18')),_0x174587);_0x594bb0[_0xcf53('0x19')](_0x174587);})[_0xcf53('0x13')](function(_0x328fac){console['log'](_0x328fac);logger['error'](_0xcf53('0x1a'),_0x6884bd,_0x36f5f2[_0xcf53('0x1b')](_0xcf53('0x18')),_0x328fac[_0xcf53('0x1c')]);_0x594bb0[_0xcf53('0x1d')]();});};}; \ No newline at end of file +var _0x134d=['push','Command','format','true','[%s][INTERVAL]\x20%s','all','some','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','then','error','message','result','catch','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x134d,0x1c0));var _0xd134=function(_0xa29d3c,_0x23499b){_0xa29d3c=_0xa29d3c-0x0;var _0x310c3f=_0x134d[_0xa29d3c];return _0x310c3f;};'use strict';var util=require('util');var BPromise=require(_0xd134('0x0'));var jayson=require(_0xd134('0x1'));var _=require(_0xd134('0x2'));var logger=require(_0xd134('0x3'))(_0xd134('0x4'));var client=jayson[_0xd134('0x5')][_0xd134('0x6')]({'port':0x232a});function request(_0x1ea92d,_0x2fa9c8){return new BPromise(function(_0x2fc9cc,_0x4f50c9){return client['request'](_0x1ea92d,_0x2fa9c8)[_0xd134('0x7')](function(_0x4364f9){if(_0x4364f9['error']){return _0x4f50c9(_0x4364f9[_0xd134('0x8')][_0xd134('0x9')]);}else{return _0x2fc9cc(_0x4364f9[_0xd134('0xa')]);}})[_0xd134('0xb')](function(_0x409e8b){return _0x4f50c9(_0x409e8b);});});}exports['condition']=function(_0x191bcb,_0x4636b3,_0x19f550){return function(_0x2ec1b6){if(_0x19f550[_0xd134('0xc')]&&!_0x19f550[_0xd134('0xc')][_0x191bcb]){logger['info'](_0xd134('0xd'),_0x191bcb);return _0x2ec1b6[_0xd134('0xe')]();}var _0x970ecf=[];for(var _0x4ea720=0x0;_0x4ea720<_0x4636b3[_0xd134('0xf')];_0x4ea720+=0x1){_0x970ecf[_0xd134('0x10')](request(_0xd134('0x11'),{'command':util[_0xd134('0x12')]('iftime\x20%s',_0x4636b3[_0x4ea720])})['then'](function(_0x4a9334){return _0x4a9334&&_0x4a9334[_0xd134('0x9')]&&_0x4a9334['message']['indexOf'](_0xd134('0x13'))>=0x0?!![]:![];})[_0xd134('0xb')](function(_0x5075f5){logger[_0xd134('0x8')](_0xd134('0x14'),_0x191bcb,_0x4636b3[_0x4ea720]);}));}BPromise[_0xd134('0x15')](_0x970ecf)[_0xd134('0x7')](function(_0x3df249){var _0x3e3e46=_[_0xd134('0x16')](_0x3df249);logger[_0xd134('0x17')](_0xd134('0x18'),_0x191bcb,_0x4636b3[_0xd134('0x19')](_0xd134('0x1a')),_0x3e3e46);_0x2ec1b6[_0xd134('0x1b')](_0x3e3e46);})['catch'](function(_0x1247bd){console['log'](_0x1247bd);logger['error'](_0xd134('0x18'),_0x191bcb,_0x4636b3['join']('\x20|\x20'),_0x1247bd[_0xd134('0x1c')]);_0x2ec1b6[_0xd134('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index fb8f228..997730f 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 _0xa0b8=['rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','abandoned','stack','agentconnect','connectedlinename','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfer','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','isNil','secondtransfereruniqueid','ATTENDED','origtransfererexten','origtransfereruniqueid','agententerreason','transfereeuniqueid','clone','calleridnum','calleridname','secondtransfererexten','transfertargetuniqueid','agent','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','CreateVoiceAgentReport','request','destuniqueid','agentcalled','agentcalledAt','now','called','error','agentringnoanswer','agentringnoanswerAt'];(function(_0x25faea,_0xed3bd8){var _0x20c766=function(_0xd7ac0b){while(--_0xd7ac0b){_0x25faea['push'](_0x25faea['shift']());}};_0x20c766(++_0xed3bd8);}(_0xa0b8,0x139));var _0x8a0b=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xa0b8[_0x5466ab];return _0x40751a;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x8a0b('0x0'));var agents={};var transfers={};function writeDB(_0x3f7598,_0xee160a){utils[_0x8a0b('0x1')](util[_0x8a0b('0x2')](_0x8a0b('0x3'),_0x3f7598[_0x8a0b('0x4')],_0x3f7598[_0x8a0b('0x5')],_0x3f7598[_0x8a0b('0x6')],_0x3f7598[_0x8a0b('0x7')],_0x3f7598[_0x8a0b('0x8')],_0x3f7598['calleridnum'],_0x3f7598[_0x8a0b('0x9')],_0x3f7598[_0x8a0b('0xa')]));if(_0x3f7598[_0x8a0b('0x6')]){utils[_0x8a0b('0xb')](_0x3f7598['queue'])[_0x8a0b('0xc')](function(_0x2f3505){if(_0x2f3505){_0x3f7598[_0x8a0b('0xd')]=_0x2f3505['type'];_0x3f7598[_0x8a0b('0xe')]=_0x3f7598['agentcomplete']?_0x2f3505[_0x8a0b('0xf')]:![];_0x3f7598[_0x8a0b('0x10')]=_0x3f7598[_0x8a0b('0xe')]?_0x2f3505['acwTimeout']:0x0;}utils['request'](_0x8a0b('0x11'),_0x3f7598);});}else{utils[_0x8a0b('0x12')](_0x8a0b('0x11'),_0x3f7598);}if(_0xee160a){delete transfers[_0x3f7598[_0x8a0b('0x4')]];}else{delete agents[_0x3f7598[_0x8a0b('0x13')]];}}exports[_0x8a0b('0x14')]=function(_0x5824a1){try{agents[_0x5824a1[_0x8a0b('0x13')]]=_0x5824a1;agents[_0x5824a1['destuniqueid']][_0x8a0b('0x15')]=utils[_0x8a0b('0x16')]();agents[_0x5824a1['destuniqueid']]['lastevent']=_0x8a0b('0x17');agents[_0x5824a1['destuniqueid']][_0x8a0b('0x9')]=null;agents[_0x5824a1[_0x8a0b('0x13')]]['connectedlinename']=null;}catch(_0x47340d){utils[_0x8a0b('0x18')](_0x47340d['stack']);}};exports['agentringnoanswer']=function(_0x2d0ee5){try{if(!_['isNil'](agents[_0x2d0ee5[_0x8a0b('0x13')]])){agents[_0x2d0ee5[_0x8a0b('0x13')]][_0x8a0b('0x19')]=!![];agents[_0x2d0ee5[_0x8a0b('0x13')]][_0x8a0b('0x1a')]=utils[_0x8a0b('0x16')]();agents[_0x2d0ee5[_0x8a0b('0x13')]][_0x8a0b('0xa')]=_0x8a0b('0x1b');agents[_0x2d0ee5[_0x8a0b('0x13')]][_0x8a0b('0x1c')]='rejected';agents[_0x2d0ee5[_0x8a0b('0x13')]][_0x8a0b('0x1d')]=_0x2d0ee5[_0x8a0b('0x1e')]?parseInt(_0x2d0ee5[_0x8a0b('0x1e')])/0x3e8:0x0;agents[_0x2d0ee5['destuniqueid']][_0x8a0b('0x1f')]=0x0;writeDB(agents[_0x2d0ee5[_0x8a0b('0x13')]]);}}catch(_0x4005bb){utils[_0x8a0b('0x18')](_0x4005bb['stack']);}};exports[_0x8a0b('0x20')]=function(_0x209d7b){try{_[_0x8a0b('0x21')](agents,function(_0x1b0116,_0x536642){if(_0x1b0116[_0x8a0b('0x4')]==_0x209d7b[_0x8a0b('0x4')]){_0x1b0116['agentringnoanswer']=!![];_0x1b0116[_0x8a0b('0x1a')]=utils[_0x8a0b('0x16')]();_0x1b0116[_0x8a0b('0xa')]=_0x8a0b('0x22');_0x1b0116[_0x8a0b('0x1c')]=_0x8a0b('0x22');_0x1b0116[_0x8a0b('0x1d')]=_0x209d7b[_0x8a0b('0x1d')];_0x1b0116['talktime']=0x0;writeDB(_0x1b0116);}});}catch(_0x1264d1){utils[_0x8a0b('0x18')](_0x1264d1[_0x8a0b('0x23')]);}};exports[_0x8a0b('0x24')]=function(_0x2bf95b){try{if(agents[_0x2bf95b[_0x8a0b('0x13')]]){agents[_0x2bf95b[_0x8a0b('0x13')]]['agentconnectAt']=utils[_0x8a0b('0x16')]();agents[_0x2bf95b[_0x8a0b('0x13')]][_0x8a0b('0x9')]=_0x2bf95b[_0x8a0b('0x9')];agents[_0x2bf95b[_0x8a0b('0x13')]][_0x8a0b('0x25')]=_0x2bf95b['connectedlinename'];agents[_0x2bf95b[_0x8a0b('0x13')]][_0x8a0b('0x1d')]=_0x2bf95b['ringtime'];agents[_0x2bf95b[_0x8a0b('0x13')]][_0x8a0b('0xa')]=_0x8a0b('0x26');_[_0x8a0b('0x21')](agents,function(_0x181c25,_0x4bac9e){if(_0x181c25[_0x8a0b('0x13')]!=_0x2bf95b[_0x8a0b('0x13')]&&_0x181c25[_0x8a0b('0x4')]==_0x2bf95b[_0x8a0b('0x4')]){_0x181c25[_0x8a0b('0x1f')]=0x0;_0x181c25[_0x8a0b('0x1d')]=_0x2bf95b[_0x8a0b('0x1e')];_0x181c25['agentringnoanswer']=!![];_0x181c25[_0x8a0b('0x1a')]=utils[_0x8a0b('0x16')]();_0x181c25[_0x8a0b('0xa')]='answered_elsewhere';_0x181c25[_0x8a0b('0x1c')]=_0x8a0b('0x27');_0x181c25[_0x8a0b('0x28')]=_0x2bf95b[_0x8a0b('0x13')];_0x181c25['answeredelsewheremembername']=_0x2bf95b[_0x8a0b('0x7')];writeDB(_0x181c25);}});}}catch(_0x8a151a){utils[_0x8a0b('0x18')](_0x8a151a[_0x8a0b('0x23')]);}};exports[_0x8a0b('0x29')]=function(_0x3199e8){try{if(!_['isNil'](agents[_0x3199e8[_0x8a0b('0x13')]])){agents[_0x3199e8['destuniqueid']]['agentcomplete']=!![];agents[_0x3199e8[_0x8a0b('0x13')]][_0x8a0b('0x2a')]=utils[_0x8a0b('0x16')]();agents[_0x3199e8[_0x8a0b('0x13')]][_0x8a0b('0x1f')]=utils[_0x8a0b('0x2b')](agents[_0x3199e8[_0x8a0b('0x13')]]['agentcompleteAt'],agents[_0x3199e8[_0x8a0b('0x13')]][_0x8a0b('0x2c')]);agents[_0x3199e8[_0x8a0b('0x13')]]['reason']=_0x3199e8[_0x8a0b('0x1c')];agents[_0x3199e8[_0x8a0b('0x13')]]['lastevent']=_0x8a0b('0x2d');writeDB(agents[_0x3199e8['destuniqueid']]);}}catch(_0x4af40f){utils[_0x8a0b('0x18')](_0x4af40f[_0x8a0b('0x23')]);}};exports[_0x8a0b('0x2e')]=function(_0x5b79cf){try{if(!_['isNil'](agents[_0x5b79cf[_0x8a0b('0x2f')]])){agents[_0x5b79cf[_0x8a0b('0x2f')]][_0x8a0b('0x30')]=!![];agents[_0x5b79cf[_0x8a0b('0x2f')]][_0x8a0b('0x31')]='blind';agents[_0x5b79cf['transfereruniqueid']][_0x8a0b('0x32')]=_0x5b79cf[_0x8a0b('0x33')];agents[_0x5b79cf[_0x8a0b('0x2f')]][_0x8a0b('0x34')]=agents[_0x5b79cf[_0x8a0b('0x2f')]][_0x8a0b('0x4')];}}catch(_0x1948e7){utils['error'](_0x1948e7[_0x8a0b('0x23')]);}};exports[_0x8a0b('0x35')]=function(_0x202622){try{if(_0x202622['origtransfereruniqueid']==_0x202622[_0x8a0b('0x36')]){if(!_[_0x8a0b('0x37')](agents[_0x202622[_0x8a0b('0x38')]])){agents[_0x202622[_0x8a0b('0x38')]][_0x8a0b('0x30')]=!![];agents[_0x202622['secondtransfereruniqueid']]['transfertype']=_0x8a0b('0x39');agents[_0x202622[_0x8a0b('0x38')]][_0x8a0b('0x32')]=_0x202622[_0x8a0b('0x3a')];agents[_0x202622[_0x8a0b('0x38')]][_0x8a0b('0x34')]=_0x202622[_0x8a0b('0x3b')];}if(_0x202622['transfereeuniqueid']&&agents[_0x202622['transfereeuniqueid']]){agents[_0x202622['transfereeuniqueid']][_0x8a0b('0x3c')]=0x1;transfers[_0x202622[_0x8a0b('0x3d')]]=_[_0x8a0b('0x3e')](agents[_0x202622[_0x8a0b('0x3d')]]);transfers[_0x202622[_0x8a0b('0x3d')]][_0x8a0b('0x3f')]=agents[_0x202622[_0x8a0b('0x38')]][_0x8a0b('0x3f')];transfers[_0x202622[_0x8a0b('0x3d')]]['calleridname']=agents[_0x202622['secondtransfereruniqueid']][_0x8a0b('0x40')];transfers[_0x202622[_0x8a0b('0x3d')]][_0x8a0b('0x15')]=utils[_0x8a0b('0x16')]();transfers[_0x202622[_0x8a0b('0x3d')]][_0x8a0b('0x2c')]=utils['now']();transfers[_0x202622[_0x8a0b('0x3d')]][_0x8a0b('0x1d')]=0x0;transfers[_0x202622['transfereeuniqueid']][_0x8a0b('0x3c')]=0x2;}}else if(_0x202622[_0x8a0b('0x38')]==_0x202622['secondtransfererlinkedid']){if(!_[_0x8a0b('0x37')](agents[_0x202622['origtransfereruniqueid']])){agents[_0x202622['origtransfereruniqueid']][_0x8a0b('0x30')]=!![];agents[_0x202622[_0x8a0b('0x3b')]]['transfertype']=_0x8a0b('0x39');agents[_0x202622[_0x8a0b('0x3b')]][_0x8a0b('0x32')]=_0x202622[_0x8a0b('0x41')];agents[_0x202622[_0x8a0b('0x3b')]][_0x8a0b('0x34')]=_0x202622[_0x8a0b('0x38')];}if(_0x202622[_0x8a0b('0x42')]&&agents[_0x202622['transfertargetuniqueid']]){agents[_0x202622['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x202622[_0x8a0b('0x42')]]=_[_0x8a0b('0x3e')](agents[_0x202622[_0x8a0b('0x42')]]);transfers[_0x202622['transfertargetuniqueid']][_0x8a0b('0x3f')]=agents[_0x202622['origtransfereruniqueid']][_0x8a0b('0x3f')];transfers[_0x202622[_0x8a0b('0x42')]][_0x8a0b('0x40')]=agents[_0x202622[_0x8a0b('0x3b')]][_0x8a0b('0x40')];transfers[_0x202622['transfertargetuniqueid']][_0x8a0b('0x15')]=utils['now']();transfers[_0x202622[_0x8a0b('0x42')]]['agentconnectAt']=utils['now']();transfers[_0x202622[_0x8a0b('0x42')]][_0x8a0b('0x1d')]=0x0;transfers[_0x202622[_0x8a0b('0x42')]][_0x8a0b('0x3c')]=0x2;}}}catch(_0x1fe5d7){utils[_0x8a0b('0x18')](_0x1fe5d7[_0x8a0b('0x23')]);}};exports['hangup']=function(_0x36bb46){try{if(transfers[_0x36bb46[_0x8a0b('0x4')]]){transfers[_0x36bb46[_0x8a0b('0x4')]]['agentcomplete']=!![];transfers[_0x36bb46['uniqueid']][_0x8a0b('0x2a')]=utils[_0x8a0b('0x16')]();transfers[_0x36bb46[_0x8a0b('0x4')]]['talktime']=utils[_0x8a0b('0x2b')](transfers[_0x36bb46[_0x8a0b('0x4')]]['agentcompleteAt'],transfers[_0x36bb46[_0x8a0b('0x4')]][_0x8a0b('0x2c')]);transfers[_0x36bb46[_0x8a0b('0x4')]]['reason']=_0x8a0b('0x43');transfers[_0x36bb46['uniqueid']][_0x8a0b('0xa')]='complete';writeDB(transfers[_0x36bb46[_0x8a0b('0x4')]],!![]);}if(agents[_0x36bb46[_0x8a0b('0x4')]]&&agents[_0x36bb46[_0x8a0b('0x4')]]['agentconnectAt']){agents[_0x36bb46[_0x8a0b('0x4')]]['agentcomplete']=!![];agents[_0x36bb46['uniqueid']][_0x8a0b('0x2a')]=utils[_0x8a0b('0x16')]();agents[_0x36bb46[_0x8a0b('0x4')]]['talktime']=utils[_0x8a0b('0x2b')](agents[_0x36bb46[_0x8a0b('0x4')]][_0x8a0b('0x2a')],agents[_0x36bb46[_0x8a0b('0x4')]][_0x8a0b('0x2c')]);agents[_0x36bb46['uniqueid']][_0x8a0b('0x1c')]=agents[_0x36bb46['uniqueid']][_0x8a0b('0x30')]?_0x8a0b('0x30'):_0x8a0b('0x43');agents[_0x36bb46['uniqueid']][_0x8a0b('0xa')]=_0x8a0b('0x2d');writeDB(agents[_0x36bb46[_0x8a0b('0x4')]]);}}catch(_0x47f09){utils['error'](_0x47f09[_0x8a0b('0x23')]);}}; \ No newline at end of file +var _0x4cd0=['stack','agentringnoanswer','rejected','reason','holdtime','ringtime','talktime','forIn','agentringnoanswerAt','abandoned','agentconnect','agentconnectAt','connectedlinename','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcompleteAt','complete','isNil','transfereruniqueid','transfer','blind','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfertype','ATTENDED','transferexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','transfertargetuniqueid','calleridname','hangup','agentcomplete','diffTime','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalledAt','now','called','error'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x4cd0,0xf0));var _0x04cd=function(_0x581fd4,_0x4a81ea){_0x581fd4=_0x581fd4-0x0;var _0x43ce49=_0x4cd0[_0x581fd4];return _0x43ce49;};'use strict';var _=require(_0x04cd('0x0'));var util=require(_0x04cd('0x1'));var utils=require(_0x04cd('0x2'));var agents={};var transfers={};function writeDB(_0x1e1f83,_0x44c5ca){utils[_0x04cd('0x3')](util[_0x04cd('0x4')](_0x04cd('0x5'),_0x1e1f83[_0x04cd('0x6')],_0x1e1f83[_0x04cd('0x7')],_0x1e1f83[_0x04cd('0x8')],_0x1e1f83[_0x04cd('0x9')],_0x1e1f83[_0x04cd('0xa')],_0x1e1f83[_0x04cd('0xb')],_0x1e1f83[_0x04cd('0xc')],_0x1e1f83[_0x04cd('0xd')]));if(_0x1e1f83['queue']){utils[_0x04cd('0xe')](_0x1e1f83['queue'])[_0x04cd('0xf')](function(_0x324f2f){if(_0x324f2f){_0x1e1f83['type']=_0x324f2f[_0x04cd('0x10')];_0x1e1f83[_0x04cd('0x11')]=_0x1e1f83['agentcomplete']?_0x324f2f[_0x04cd('0x12')]:![];_0x1e1f83[_0x04cd('0x13')]=_0x1e1f83[_0x04cd('0x11')]?_0x324f2f[_0x04cd('0x14')]:0x0;}utils[_0x04cd('0x15')](_0x04cd('0x16'),_0x1e1f83);});}else{utils['request']('CreateVoiceAgentReport',_0x1e1f83);}if(_0x44c5ca){delete transfers[_0x1e1f83['uniqueid']];}else{delete agents[_0x1e1f83[_0x04cd('0x17')]];}}exports['agentcalled']=function(_0x3ccb2c){try{agents[_0x3ccb2c[_0x04cd('0x17')]]=_0x3ccb2c;agents[_0x3ccb2c['destuniqueid']][_0x04cd('0x18')]=utils[_0x04cd('0x19')]();agents[_0x3ccb2c['destuniqueid']][_0x04cd('0xd')]=_0x04cd('0x1a');agents[_0x3ccb2c['destuniqueid']][_0x04cd('0xc')]=null;agents[_0x3ccb2c[_0x04cd('0x17')]]['connectedlinename']=null;}catch(_0x4f7dc2){utils[_0x04cd('0x1b')](_0x4f7dc2[_0x04cd('0x1c')]);}};exports[_0x04cd('0x1d')]=function(_0x1e55e1){try{if(!_['isNil'](agents[_0x1e55e1[_0x04cd('0x17')]])){agents[_0x1e55e1[_0x04cd('0x17')]]['agentringnoanswer']=!![];agents[_0x1e55e1[_0x04cd('0x17')]]['agentringnoanswerAt']=utils[_0x04cd('0x19')]();agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0xd')]=_0x04cd('0x1e');agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0x1f')]=_0x04cd('0x1e');agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0x20')]=_0x1e55e1['ringtime']?parseInt(_0x1e55e1[_0x04cd('0x21')])/0x3e8:0x0;agents[_0x1e55e1[_0x04cd('0x17')]][_0x04cd('0x22')]=0x0;writeDB(agents[_0x1e55e1[_0x04cd('0x17')]]);}}catch(_0x664414){utils[_0x04cd('0x1b')](_0x664414[_0x04cd('0x1c')]);}};exports['queuecallerabandon']=function(_0xceceff){try{_[_0x04cd('0x23')](agents,function(_0x1049f8,_0x9bbf6a){if(_0x1049f8[_0x04cd('0x6')]==_0xceceff[_0x04cd('0x6')]){_0x1049f8[_0x04cd('0x1d')]=!![];_0x1049f8[_0x04cd('0x24')]=utils[_0x04cd('0x19')]();_0x1049f8['lastevent']='abandoned';_0x1049f8[_0x04cd('0x1f')]=_0x04cd('0x25');_0x1049f8['holdtime']=_0xceceff['holdtime'];_0x1049f8[_0x04cd('0x22')]=0x0;writeDB(_0x1049f8);}});}catch(_0x2c7e83){utils['error'](_0x2c7e83[_0x04cd('0x1c')]);}};exports[_0x04cd('0x26')]=function(_0x5a8b70){try{if(agents[_0x5a8b70['destuniqueid']]){agents[_0x5a8b70[_0x04cd('0x17')]][_0x04cd('0x27')]=utils[_0x04cd('0x19')]();agents[_0x5a8b70[_0x04cd('0x17')]]['connectedlinenum']=_0x5a8b70[_0x04cd('0xc')];agents[_0x5a8b70[_0x04cd('0x17')]][_0x04cd('0x28')]=_0x5a8b70[_0x04cd('0x28')];agents[_0x5a8b70[_0x04cd('0x17')]][_0x04cd('0x20')]=_0x5a8b70['ringtime'];agents[_0x5a8b70[_0x04cd('0x17')]]['lastevent']='connect';_[_0x04cd('0x23')](agents,function(_0x1ea463,_0x5b5c46){if(_0x1ea463[_0x04cd('0x17')]!=_0x5a8b70['destuniqueid']&&_0x1ea463['uniqueid']==_0x5a8b70[_0x04cd('0x6')]){_0x1ea463[_0x04cd('0x22')]=0x0;_0x1ea463[_0x04cd('0x20')]=_0x5a8b70[_0x04cd('0x21')];_0x1ea463['agentringnoanswer']=!![];_0x1ea463[_0x04cd('0x24')]=utils[_0x04cd('0x19')]();_0x1ea463[_0x04cd('0xd')]=_0x04cd('0x29');_0x1ea463[_0x04cd('0x1f')]='answered_elsewhere';_0x1ea463[_0x04cd('0x2a')]=_0x5a8b70[_0x04cd('0x17')];_0x1ea463['answeredelsewheremembername']=_0x5a8b70[_0x04cd('0x9')];writeDB(_0x1ea463);}});}}catch(_0x1088f4){utils[_0x04cd('0x1b')](_0x1088f4[_0x04cd('0x1c')]);}};exports['agentcomplete']=function(_0x494d62){try{if(!_['isNil'](agents[_0x494d62[_0x04cd('0x17')]])){agents[_0x494d62[_0x04cd('0x17')]]['agentcomplete']=!![];agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0x2b')]=utils[_0x04cd('0x19')]();agents[_0x494d62[_0x04cd('0x17')]]['talktime']=utils['diffTime'](agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0x2b')],agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0x27')]);agents[_0x494d62[_0x04cd('0x17')]]['reason']=_0x494d62['reason'];agents[_0x494d62[_0x04cd('0x17')]][_0x04cd('0xd')]=_0x04cd('0x2c');writeDB(agents[_0x494d62[_0x04cd('0x17')]]);}}catch(_0x2b257a){utils['error'](_0x2b257a[_0x04cd('0x1c')]);}};exports['blindtransfer']=function(_0x1e5b60){try{if(!_[_0x04cd('0x2d')](agents[_0x1e5b60[_0x04cd('0x2e')]])){agents[_0x1e5b60[_0x04cd('0x2e')]][_0x04cd('0x2f')]=!![];agents[_0x1e5b60['transfereruniqueid']]['transfertype']=_0x04cd('0x30');agents[_0x1e5b60[_0x04cd('0x2e')]]['transferexten']=_0x1e5b60[_0x04cd('0x31')];agents[_0x1e5b60[_0x04cd('0x2e')]]['transferuniqueid']=agents[_0x1e5b60[_0x04cd('0x2e')]][_0x04cd('0x6')];}}catch(_0x54ea1c){utils[_0x04cd('0x1b')](_0x54ea1c[_0x04cd('0x1c')]);}};exports[_0x04cd('0x32')]=function(_0x5c9262){try{if(_0x5c9262[_0x04cd('0x33')]==_0x5c9262[_0x04cd('0x34')]){if(!_['isNil'](agents[_0x5c9262[_0x04cd('0x35')]])){agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x2f')]=!![];agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x36')]=_0x04cd('0x37');agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x38')]=_0x5c9262['origtransfererexten'];agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0x39')]=_0x5c9262[_0x04cd('0x33')];}if(_0x5c9262[_0x04cd('0x3a')]&&agents[_0x5c9262[_0x04cd('0x3a')]]){agents[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0x3b')]=0x1;transfers[_0x5c9262[_0x04cd('0x3a')]]=_[_0x04cd('0x3c')](agents[_0x5c9262['transfereeuniqueid']]);transfers[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0xb')]=agents[_0x5c9262[_0x04cd('0x35')]][_0x04cd('0xb')];transfers[_0x5c9262[_0x04cd('0x3a')]]['calleridname']=agents[_0x5c9262['secondtransfereruniqueid']]['calleridname'];transfers[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0x18')]=utils['now']();transfers[_0x5c9262[_0x04cd('0x3a')]][_0x04cd('0x27')]=utils[_0x04cd('0x19')]();transfers[_0x5c9262['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x5c9262['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x5c9262['secondtransfereruniqueid']==_0x5c9262['secondtransfererlinkedid']){if(!_['isNil'](agents[_0x5c9262[_0x04cd('0x33')]])){agents[_0x5c9262['origtransfereruniqueid']][_0x04cd('0x2f')]=!![];agents[_0x5c9262[_0x04cd('0x33')]]['transfertype']=_0x04cd('0x37');agents[_0x5c9262[_0x04cd('0x33')]][_0x04cd('0x38')]=_0x5c9262['secondtransfererexten'];agents[_0x5c9262['origtransfereruniqueid']][_0x04cd('0x39')]=_0x5c9262['secondtransfereruniqueid'];}if(_0x5c9262[_0x04cd('0x3d')]&&agents[_0x5c9262[_0x04cd('0x3d')]]){agents[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0x3b')]=0x1;transfers[_0x5c9262['transfertargetuniqueid']]=_[_0x04cd('0x3c')](agents[_0x5c9262['transfertargetuniqueid']]);transfers[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0xb')]=agents[_0x5c9262['origtransfereruniqueid']][_0x04cd('0xb')];transfers[_0x5c9262[_0x04cd('0x3d')]]['calleridname']=agents[_0x5c9262[_0x04cd('0x33')]][_0x04cd('0x3e')];transfers[_0x5c9262[_0x04cd('0x3d')]]['agentcalledAt']=utils[_0x04cd('0x19')]();transfers[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0x27')]=utils['now']();transfers[_0x5c9262[_0x04cd('0x3d')]]['holdtime']=0x0;transfers[_0x5c9262[_0x04cd('0x3d')]][_0x04cd('0x3b')]=0x2;}}}catch(_0x218d40){utils[_0x04cd('0x1b')](_0x218d40[_0x04cd('0x1c')]);}};exports[_0x04cd('0x3f')]=function(_0x2270d9){try{if(transfers[_0x2270d9[_0x04cd('0x6')]]){transfers[_0x2270d9['uniqueid']][_0x04cd('0x40')]=!![];transfers[_0x2270d9['uniqueid']][_0x04cd('0x2b')]=utils['now']();transfers[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x22')]=utils[_0x04cd('0x41')](transfers[_0x2270d9[_0x04cd('0x6')]]['agentcompleteAt'],transfers[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x27')]);transfers[_0x2270d9['uniqueid']][_0x04cd('0x1f')]='agent';transfers[_0x2270d9[_0x04cd('0x6')]]['lastevent']=_0x04cd('0x2c');writeDB(transfers[_0x2270d9[_0x04cd('0x6')]],!![]);}if(agents[_0x2270d9[_0x04cd('0x6')]]&&agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x27')]){agents[_0x2270d9[_0x04cd('0x6')]]['agentcomplete']=!![];agents[_0x2270d9['uniqueid']][_0x04cd('0x2b')]=utils[_0x04cd('0x19')]();agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x22')]=utils[_0x04cd('0x41')](agents[_0x2270d9['uniqueid']]['agentcompleteAt'],agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x27')]);agents[_0x2270d9[_0x04cd('0x6')]]['reason']=agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0x2f')]?_0x04cd('0x2f'):_0x04cd('0x42');agents[_0x2270d9[_0x04cd('0x6')]][_0x04cd('0xd')]=_0x04cd('0x2c');writeDB(agents[_0x2270d9[_0x04cd('0x6')]]);}}catch(_0x468fd0){utils[_0x04cd('0x1b')](_0x468fd0[_0x04cd('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index d61aab4..697d709 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 _0x28f3=['accountcode','source','destination','disposition','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','channel','OutgoingSpoolFailed','exten','context','now','error','newstate','isNil','channelstate','systemanswertime','linkedid','transfer','destinationchannel','answertime','stack','hangup','callerid','calleridnum','endtime','duration','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','userfield','_attended','transfertargetchannel','musiconholdstop','mohtime','musiconholdstartAt','varset','variable','xmd-originatecalleridnum','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','type','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid'];(function(_0x404418,_0x467a48){var _0x5c8612=function(_0x2ab1f5){while(--_0x2ab1f5){_0x404418['push'](_0x404418['shift']());}};_0x5c8612(++_0x467a48);}(_0x28f3,0xec));var _0x328f=function(_0x216826,_0x8f0e7b){_0x216826=_0x216826-0x0;var _0x5c0df0=_0x28f3[_0x216826];return _0x5c0df0;};'use strict';var _=require(_0x328f('0x0'));var util=require(_0x328f('0x1'));var utils=require(_0x328f('0x2'));var dispositions=['NO\x20ANSWER',_0x328f('0x3'),_0x328f('0x3'),_0x328f('0x4'),_0x328f('0x4'),_0x328f('0x4'),_0x328f('0x5'),_0x328f('0x6'),'FAILED','FAILED',_0x328f('0x3')];var channels={};function writeDB(_0x27c893){utils['info'](util[_0x328f('0x7')](_0x328f('0x8'),_0x27c893[_0x328f('0x9')],_0x27c893['channel'],_0x27c893['type'],_0x27c893[_0x328f('0xa')],_0x27c893[_0x328f('0xb')],_0x27c893[_0x328f('0xc')],_0x27c893['callerid'],_0x27c893[_0x328f('0xd')]));if(_0x27c893['accountcode']){utils[_0x328f('0xe')](_0x27c893[_0x328f('0xa')])[_0x328f('0xf')](function(_0x251589){if(_0x251589){_0x27c893['UserId']=_0x251589['id'];}utils[_0x328f('0x10')](_0x328f('0x11'),_0x27c893);});}else{utils['request'](_0x328f('0x11'),_0x27c893);}if(channels[_0x27c893[_0x328f('0x9')]]){delete channels[_0x27c893['uniqueid']];}}exports[_0x328f('0x12')]=function(_0x571ff0){try{if(_0x571ff0[_0x328f('0x9')]==_0x571ff0['linkedid']&&_0x571ff0[_0x328f('0x13')]!=_0x328f('0x14')){channels[_0x571ff0['uniqueid']]={'uniqueid':_0x571ff0['uniqueid'],'accountcode':_0x571ff0[_0x328f('0xa')],'source':_0x571ff0['calleridnum'],'destination':_0x571ff0[_0x328f('0x15')],'destinationcontext':_0x571ff0[_0x328f('0x16')],'channel':_0x571ff0[_0x328f('0x13')],'starttime':utils[_0x328f('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x570324){utils[_0x328f('0x18')](_0x570324['stack']);}};exports[_0x328f('0x19')]=function(_0x7e8393){try{if(!_[_0x328f('0x1a')](channels[_0x7e8393[_0x328f('0x9')]])&&_0x7e8393[_0x328f('0x1b')]==0x6){if(_['isNil'](channels[_0x7e8393['uniqueid']]['systemanswertime'])){channels[_0x7e8393[_0x328f('0x9')]][_0x328f('0x1c')]=utils[_0x328f('0x17')]();}}else if(!_[_0x328f('0x1a')](channels[_0x7e8393[_0x328f('0x1d')]])&&_0x7e8393[_0x328f('0x1b')]==0x6&&_0x7e8393[_0x328f('0x16')]!=_0x328f('0x1e')){channels[_0x7e8393[_0x328f('0x1d')]][_0x328f('0xa')]=_0x7e8393[_0x328f('0xa')];channels[_0x7e8393['linkedid']][_0x328f('0x1f')]=_0x7e8393['channel'];if(_['isNil'](channels[_0x7e8393[_0x328f('0x1d')]]['answertime'])){channels[_0x7e8393[_0x328f('0x1d')]][_0x328f('0x20')]=utils[_0x328f('0x17')]();}channels[_0x7e8393['linkedid']][_0x328f('0xd')]=dispositions[_['toNumber'](_0x7e8393[_0x328f('0x1b')])]||'ANSWERED';}}catch(_0x1be15c){utils['error'](_0x1be15c[_0x328f('0x21')]);}};exports[_0x328f('0x22')]=function(_0x3988a4){try{if(!_['isNil'](channels[_0x3988a4[_0x328f('0x9')]])){if(_[_0x328f('0x1a')](channels[_0x3988a4[_0x328f('0x9')]][_0x328f('0x23')])){channels[_0x3988a4[_0x328f('0x9')]][_0x328f('0x23')]=_0x3988a4['calleridname']+'\x20<'+_0x3988a4[_0x328f('0x24')]+'>';}channels[_0x3988a4['uniqueid']][_0x328f('0x25')]=utils[_0x328f('0x17')]();channels[_0x3988a4[_0x328f('0x9')]][_0x328f('0x26')]=utils['diffTime'](channels[_0x3988a4[_0x328f('0x9')]][_0x328f('0x25')],channels[_0x3988a4[_0x328f('0x9')]]['starttime']);channels[_0x3988a4[_0x328f('0x9')]][_0x328f('0x27')]=channels[_0x3988a4[_0x328f('0x9')]][_0x328f('0x20')]?utils[_0x328f('0x28')](channels[_0x3988a4['uniqueid']][_0x328f('0x25')],channels[_0x3988a4[_0x328f('0x9')]][_0x328f('0x20')]):0x0;writeDB(channels[_0x3988a4[_0x328f('0x9')]]);}}catch(_0x3938c6){utils[_0x328f('0x18')](_0x3938c6[_0x328f('0x21')]);}};exports[_0x328f('0x29')]=function(_0x3bb7bf){try{if(!_[_0x328f('0x1a')](channels[_0x3bb7bf['localtwolinkedid']])){if(channels[_0x3bb7bf[_0x328f('0x2a')]][_0x328f('0x13')]==_0x3bb7bf[_0x328f('0x2b')]){channels[_0x3bb7bf[_0x328f('0x2a')]][_0x328f('0x1f')]=_0x3bb7bf['secondtransfererchannel'];channels[_0x3bb7bf[_0x328f('0x2a')]][_0x328f('0x2c')]=_0x328f('0x2d');}else if(channels[_0x3bb7bf[_0x328f('0x2a')]][_0x328f('0x13')]=_0x3bb7bf[_0x328f('0x2e')]){channels[_0x3bb7bf['localtwolinkedid']][_0x328f('0x1f')]=_0x3bb7bf['origtransfererchannel'];channels[_0x3bb7bf['localtwolinkedid']]['userfield']='_attended';}}}catch(_0x1fd305){utils[_0x328f('0x18')](_0x1fd305[_0x328f('0x21')]);}};exports['musiconholdstart']=function(_0x20d64e){try{if(!_[_0x328f('0x1a')](channels[_0x20d64e['uniqueid']])){channels[_0x20d64e[_0x328f('0x9')]]['musiconholdstartAt']=utils[_0x328f('0x17')]();}}catch(_0x1bff94){utils[_0x328f('0x18')](_0x1bff94[_0x328f('0x21')]);}};exports[_0x328f('0x2f')]=function(_0x575c0b){try{if(!_[_0x328f('0x1a')](channels[_0x575c0b[_0x328f('0x9')]])){if(!_[_0x328f('0x1a')](channels[_0x575c0b[_0x328f('0x9')]]['musiconholdstartAt'])){channels[_0x575c0b[_0x328f('0x9')]][_0x328f('0x30')]+=utils[_0x328f('0x28')](utils['now'](),channels[_0x575c0b[_0x328f('0x9')]]['musiconholdstartAt']);delete channels[_0x575c0b[_0x328f('0x9')]][_0x328f('0x31')];}}}catch(_0x3a8bdc){utils[_0x328f('0x18')](_0x3a8bdc[_0x328f('0x21')]);}};exports[_0x328f('0x32')]=function(_0x2dafac){try{if(!_[_0x328f('0x1a')](channels[_0x2dafac[_0x328f('0x9')]])){if(!_['isNil'](_0x2dafac[_0x328f('0x33')][_0x328f('0x34')])){channels[_0x2dafac[_0x328f('0x9')]][_0x328f('0xb')]=_0x2dafac['value'];}if(!_[_0x328f('0x1a')](_0x2dafac[_0x328f('0x33')]['xmd-phone'])){channels[_0x2dafac[_0x328f('0x9')]][_0x328f('0xc')]=_0x2dafac[_0x328f('0x35')];channels[_0x2dafac[_0x328f('0x9')]][_0x328f('0x23')]='\x22'+_0x2dafac[_0x328f('0x35')]+_0x328f('0x36')+_0x2dafac[_0x328f('0x35')]+'>';}if(!_['isNil'](_0x2dafac['variable'][_0x328f('0x37')])||!_[_0x328f('0x1a')](_0x2dafac['variable'][_0x328f('0x38')])){channels[_0x2dafac['uniqueid']][_0x328f('0x23')]=_0x2dafac[_0x328f('0x35')];}if(!_[_0x328f('0x1a')](_0x2dafac['variable'][_0x328f('0x39')])||!_[_0x328f('0x1a')](_0x2dafac[_0x328f('0x33')][_0x328f('0x3a')])){channels[_0x2dafac['uniqueid']][_0x328f('0x3b')]=_0x328f('0x3c');channels[_0x2dafac['uniqueid']][_0x328f('0x3d')]=_0x2dafac[_0x328f('0x35')];channels[_0x2dafac[_0x328f('0x9')]][_0x328f('0x3e')]=!![];}if(!_[_0x328f('0x1a')](_0x2dafac['variable'][_0x328f('0x3f')])){channels[_0x2dafac[_0x328f('0x9')]][_0x328f('0x40')]=_0x2dafac['value'];}if(!_[_0x328f('0x1a')](_0x2dafac['variable'][_0x328f('0x41')])){channels[_0x2dafac[_0x328f('0x9')]][_0x328f('0x42')]=_0x2dafac['value'];}if(!_['isNil'](_0x2dafac[_0x328f('0x33')]['outboundrouteid'])){channels[_0x2dafac[_0x328f('0x9')]][_0x328f('0x43')]=_0x2dafac[_0x328f('0x35')];}if(!_[_0x328f('0x1a')](_0x2dafac[_0x328f('0x33')][_0x328f('0x44')])){channels[_0x2dafac['uniqueid']][_0x328f('0x44')]=_0x2dafac[_0x328f('0x35')];}}}catch(_0x598c93){utils[_0x328f('0x18')](_0x598c93[_0x328f('0x21')]);}};exports[_0x328f('0x45')]=function(_0x568d95){try{if(!_[_0x328f('0x1a')](channels[_0x568d95[_0x328f('0x9')]])){if(_0x568d95[_0x328f('0x46')][_0x328f('0x47')]()==_0x328f('0x48')&&_[_0x328f('0x49')](_0x568d95[_0x328f('0x4a')][_0x328f('0x47')](),_0x328f('0x4b'))){var _0x350bf8=_0x568d95[_0x328f('0x4a')][_0x328f('0x4c')]('=');var _0x5e302b=_0x350bf8[0x0]['substring'](_0x350bf8[0x0][_0x328f('0x4d')]('(')+0x1,_0x350bf8[0x0][_0x328f('0x4d')](')'));var _0x22e5ec=_0x350bf8[0x1];channels[_0x568d95[_0x328f('0x9')]][_0x5e302b]=_0x22e5ec;}if(!_[_0x328f('0x4e')]([_0x328f('0x22'),_0x328f('0x4f'),_0x328f('0x50'),_0x328f('0x48'),_0x328f('0x51')],_0x568d95[_0x328f('0x46')][_0x328f('0x47')]())){channels[_0x568d95[_0x328f('0x9')]][_0x328f('0x3b')]=_0x568d95[_0x328f('0x46')];channels[_0x568d95[_0x328f('0x9')]][_0x328f('0x3d')]=_0x568d95[_0x328f('0x4a')];}}}catch(_0x56b49b){utils[_0x328f('0x18')](_0x56b49b[_0x328f('0x21')]);}}; \ No newline at end of file +var _0x58d0=['calleridname','calleridnum','endtime','duration','diffTime','billableseconds','error','attendedtransfer','localtwolinkedid','secondtransfererchannel','userfield','_attended','transfertargetchannel','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-phone','value','callerid','\x22\x20<','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','queue','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','sipcallid','newexten','set','startsWith','appdata','cdr','split','substring','lastIndexOf','noop','execif','application','toLowerCase','lastdata','lodash','util','./utils','FAILED','NO\x20ANSWER','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','accountcode','source','destination','disposition','getUserByInternal','then','request','CreateVoiceCallReport','newchannel','linkedid','channel','OutgoingSpoolFailed','exten','context','now','newstate','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','toNumber','ANSWERED','stack','hangup'];(function(_0x459d34,_0x5cc6c9){var _0x1d220f=function(_0x137d1d){while(--_0x137d1d){_0x459d34['push'](_0x459d34['shift']());}};_0x1d220f(++_0x5cc6c9);}(_0x58d0,0x177));var _0x058d=function(_0x234cdb,_0x28750b){_0x234cdb=_0x234cdb-0x0;var _0x1d18bb=_0x58d0[_0x234cdb];return _0x1d18bb;};'use strict';var _=require(_0x058d('0x0'));var util=require(_0x058d('0x1'));var utils=require(_0x058d('0x2'));var dispositions=['NO\x20ANSWER','FAILED',_0x058d('0x3'),_0x058d('0x4'),_0x058d('0x4'),'NO\x20ANSWER','ANSWERED',_0x058d('0x5'),_0x058d('0x3'),_0x058d('0x3'),_0x058d('0x3')];var channels={};function writeDB(_0x45f98d){utils[_0x058d('0x6')](util['format'](_0x058d('0x7'),_0x45f98d[_0x058d('0x8')],_0x45f98d['channel'],_0x45f98d['type'],_0x45f98d[_0x058d('0x9')],_0x45f98d[_0x058d('0xa')],_0x45f98d[_0x058d('0xb')],_0x45f98d['callerid'],_0x45f98d[_0x058d('0xc')]));if(_0x45f98d[_0x058d('0x9')]){utils[_0x058d('0xd')](_0x45f98d[_0x058d('0x9')])[_0x058d('0xe')](function(_0x521606){if(_0x521606){_0x45f98d['UserId']=_0x521606['id'];}utils['request']('CreateVoiceCallReport',_0x45f98d);});}else{utils[_0x058d('0xf')](_0x058d('0x10'),_0x45f98d);}if(channels[_0x45f98d['uniqueid']]){delete channels[_0x45f98d['uniqueid']];}}exports[_0x058d('0x11')]=function(_0x4d4cc1){try{if(_0x4d4cc1[_0x058d('0x8')]==_0x4d4cc1[_0x058d('0x12')]&&_0x4d4cc1[_0x058d('0x13')]!=_0x058d('0x14')){channels[_0x4d4cc1[_0x058d('0x8')]]={'uniqueid':_0x4d4cc1['uniqueid'],'accountcode':_0x4d4cc1[_0x058d('0x9')],'source':_0x4d4cc1['calleridnum'],'destination':_0x4d4cc1[_0x058d('0x15')],'destinationcontext':_0x4d4cc1[_0x058d('0x16')],'channel':_0x4d4cc1[_0x058d('0x13')],'starttime':utils[_0x058d('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x9b5446){utils['error'](_0x9b5446['stack']);}};exports[_0x058d('0x18')]=function(_0xf144d8){try{if(!_[_0x058d('0x19')](channels[_0xf144d8['uniqueid']])&&_0xf144d8[_0x058d('0x1a')]==0x6){if(_[_0x058d('0x19')](channels[_0xf144d8[_0x058d('0x8')]][_0x058d('0x1b')])){channels[_0xf144d8[_0x058d('0x8')]][_0x058d('0x1b')]=utils[_0x058d('0x17')]();}}else if(!_[_0x058d('0x19')](channels[_0xf144d8['linkedid']])&&_0xf144d8[_0x058d('0x1a')]==0x6&&_0xf144d8[_0x058d('0x16')]!=_0x058d('0x1c')){channels[_0xf144d8[_0x058d('0x12')]]['accountcode']=_0xf144d8['accountcode'];channels[_0xf144d8[_0x058d('0x12')]][_0x058d('0x1d')]=_0xf144d8[_0x058d('0x13')];if(_[_0x058d('0x19')](channels[_0xf144d8[_0x058d('0x12')]][_0x058d('0x1e')])){channels[_0xf144d8[_0x058d('0x12')]][_0x058d('0x1e')]=utils['now']();}channels[_0xf144d8['linkedid']][_0x058d('0xc')]=dispositions[_[_0x058d('0x1f')](_0xf144d8[_0x058d('0x1a')])]||_0x058d('0x20');}}catch(_0x2ee776){utils['error'](_0x2ee776[_0x058d('0x21')]);}};exports[_0x058d('0x22')]=function(_0x5a7d86){try{if(!_[_0x058d('0x19')](channels[_0x5a7d86[_0x058d('0x8')]])){if(_['isNil'](channels[_0x5a7d86[_0x058d('0x8')]]['callerid'])){channels[_0x5a7d86[_0x058d('0x8')]]['callerid']=_0x5a7d86[_0x058d('0x23')]+'\x20<'+_0x5a7d86[_0x058d('0x24')]+'>';}channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x25')]=utils['now']();channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x26')]=utils[_0x058d('0x27')](channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x25')],channels[_0x5a7d86['uniqueid']]['starttime']);channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x28')]=channels[_0x5a7d86['uniqueid']]['answertime']?utils['diffTime'](channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x25')],channels[_0x5a7d86[_0x058d('0x8')]][_0x058d('0x1e')]):0x0;writeDB(channels[_0x5a7d86[_0x058d('0x8')]]);}}catch(_0x4070eb){utils[_0x058d('0x29')](_0x4070eb[_0x058d('0x21')]);}};exports[_0x058d('0x2a')]=function(_0x135d09){try{if(!_[_0x058d('0x19')](channels[_0x135d09[_0x058d('0x2b')]])){if(channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x13')]==_0x135d09['transfereechannel']){channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x1d')]=_0x135d09[_0x058d('0x2c')];channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x2d')]=_0x058d('0x2e');}else if(channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x13')]=_0x135d09[_0x058d('0x2f')]){channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x1d')]=_0x135d09['origtransfererchannel'];channels[_0x135d09[_0x058d('0x2b')]][_0x058d('0x2d')]=_0x058d('0x2e');}}}catch(_0x256d7a){utils[_0x058d('0x29')](_0x256d7a[_0x058d('0x21')]);}};exports['musiconholdstart']=function(_0x1dd4d8){try{if(!_[_0x058d('0x19')](channels[_0x1dd4d8[_0x058d('0x8')]])){channels[_0x1dd4d8[_0x058d('0x8')]][_0x058d('0x30')]=utils[_0x058d('0x17')]();}}catch(_0x2aa9d8){utils['error'](_0x2aa9d8[_0x058d('0x21')]);}};exports[_0x058d('0x31')]=function(_0x482a87){try{if(!_[_0x058d('0x19')](channels[_0x482a87[_0x058d('0x8')]])){if(!_[_0x058d('0x19')](channels[_0x482a87['uniqueid']][_0x058d('0x30')])){channels[_0x482a87['uniqueid']][_0x058d('0x32')]+=utils['diffTime'](utils[_0x058d('0x17')](),channels[_0x482a87[_0x058d('0x8')]][_0x058d('0x30')]);delete channels[_0x482a87['uniqueid']][_0x058d('0x30')];}}}catch(_0x4fc23c){utils[_0x058d('0x29')](_0x4fc23c[_0x058d('0x21')]);}};exports[_0x058d('0x33')]=function(_0x1ca3ea){try{if(!_[_0x058d('0x19')](channels[_0x1ca3ea[_0x058d('0x8')]])){if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')]['xmd-originatecalleridnum'])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0xa')]=_0x1ca3ea['value'];}if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x35')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0xb')]=_0x1ca3ea[_0x058d('0x36')];channels[_0x1ca3ea['uniqueid']][_0x058d('0x37')]='\x22'+_0x1ca3ea[_0x058d('0x36')]+_0x058d('0x38')+_0x1ca3ea[_0x058d('0x36')]+'>';}if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x39')])||!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')]['xmd-callerid'])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x37')]=_0x1ca3ea[_0x058d('0x36')];}if(!_['isNil'](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x3a')])||!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')][_0x058d('0x3b')])){channels[_0x1ca3ea['uniqueid']][_0x058d('0x3c')]=_0x058d('0x3d');channels[_0x1ca3ea[_0x058d('0x8')]]['lastdata']=_0x1ca3ea[_0x058d('0x36')];channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x3e')]=!![];}if(!_[_0x058d('0x19')](_0x1ca3ea[_0x058d('0x34')]['xmd-contactid'])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x3f')]=_0x1ca3ea[_0x058d('0x36')];}if(!_[_0x058d('0x19')](_0x1ca3ea['variable'][_0x058d('0x40')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x41')]=_0x1ca3ea[_0x058d('0x36')];}if(!_[_0x058d('0x19')](_0x1ca3ea['variable'][_0x058d('0x42')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x43')]=_0x1ca3ea[_0x058d('0x36')];}if(!_['isNil'](_0x1ca3ea['variable'][_0x058d('0x44')])){channels[_0x1ca3ea[_0x058d('0x8')]][_0x058d('0x44')]=_0x1ca3ea['value'];}}}catch(_0x15b1b9){utils['error'](_0x15b1b9[_0x058d('0x21')]);}};exports[_0x058d('0x45')]=function(_0x336fea){try{if(!_[_0x058d('0x19')](channels[_0x336fea['uniqueid']])){if(_0x336fea['application']['toLowerCase']()==_0x058d('0x46')&&_[_0x058d('0x47')](_0x336fea[_0x058d('0x48')]['toLowerCase'](),_0x058d('0x49'))){var _0x30210d=_0x336fea[_0x058d('0x48')][_0x058d('0x4a')]('=');var _0x55fb3f=_0x30210d[0x0][_0x058d('0x4b')](_0x30210d[0x0][_0x058d('0x4c')]('(')+0x1,_0x30210d[0x0][_0x058d('0x4c')](')'));var _0x4a1082=_0x30210d[0x1];channels[_0x336fea[_0x058d('0x8')]][_0x55fb3f]=_0x4a1082;}if(!_['includes'](['hangup',_0x058d('0x4d'),_0x058d('0x4e'),'set','gotoif'],_0x336fea[_0x058d('0x4f')][_0x058d('0x50')]())){channels[_0x336fea[_0x058d('0x8')]][_0x058d('0x3c')]=_0x336fea['application'];channels[_0x336fea[_0x058d('0x8')]][_0x058d('0x51')]=_0x336fea[_0x058d('0x48')];}}}catch(_0x3b384c){utils['error'](_0x3b384c['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 787ebad..546229b 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 _0xb458=['SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent','./utils','lodash','connect','shutdown','info'];(function(_0x4915c7,_0x21bb57){var _0xdb0896=function(_0x26324e){while(--_0x26324e){_0x4915c7['push'](_0x4915c7['shift']());}};_0xdb0896(++_0x21bb57);}(_0xb458,0x103));var _0x8b45=function(_0x459ecb,_0x531e17){_0x459ecb=_0x459ecb-0x0;var _0x54a6fd=_0xb458[_0x459ecb];return _0x54a6fd;};'use strict';var utils=require(_0x8b45('0x0'));var _=require(_0x8b45('0x1'));exports[_0x8b45('0x2')]=function(){utils['info']('CONNECTED');};exports[_0x8b45('0x3')]=function(){utils[_0x8b45('0x4')](_0x8b45('0x5'));};exports[_0x8b45('0x6')]=function(){utils['info'](_0x8b45('0x7'));};exports['error']=function(_0x5cc2d5){utils[_0x8b45('0x8')](_0x5cc2d5);};exports[_0x8b45('0x9')]=function(){utils[_0x8b45('0x4')](_0x8b45('0xa'));};exports[_0x8b45('0xb')]=function(_0x4d1718){}; \ No newline at end of file +var _0x24ca=['FULLYBOOTED','error','CLOSE','managerevent','./utils','info','shutdown','SHUTDOWN'];(function(_0x3e5b00,_0x11648d){var _0x4c81d3=function(_0x1d0ada){while(--_0x1d0ada){_0x3e5b00['push'](_0x3e5b00['shift']());}};_0x4c81d3(++_0x11648d);}(_0x24ca,0x8c));var _0xa24c=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x24ca[_0x256e32];return _0x464070;};'use strict';var utils=require(_0xa24c('0x0'));var _=require('lodash');exports['connect']=function(){utils[_0xa24c('0x1')]('CONNECTED');};exports[_0xa24c('0x2')]=function(){utils[_0xa24c('0x1')](_0xa24c('0x3'));};exports['fullybooted']=function(){utils[_0xa24c('0x1')](_0xa24c('0x4'));};exports[_0xa24c('0x5')]=function(_0x5a37ae){utils['error'](_0x5a37ae);};exports['close']=function(){utils[_0xa24c('0x1')](_0xa24c('0x6'));};exports[_0xa24c('0x7')]=function(_0x3c3959){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 4c30b76..33d7e97 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 _0xcc90=['varset','isNil','variable','dialbegin','starttime','lastevent','called','dialend','ANSWER','now','connect','hangup','assign','duration','diffTime','holdtime','answertime','endtime','billableseconds','lodash','util','info','format','DIAL|%s|%s|%s|%s|%s|%s','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','newexten','application','toLowerCase','set','startsWith','appdata','cdr(routeid)','split','error','stack'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xcc90,0x65));var _0x0cc9=function(_0x11652a,_0xa8f9d1){_0x11652a=_0x11652a-0x0;var _0x53b6d9=_0xcc90[_0x11652a];return _0x53b6d9;};'use strict';var _=require(_0x0cc9('0x0'));var util=require(_0x0cc9('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x53f471){utils[_0x0cc9('0x2')](util[_0x0cc9('0x3')](_0x0cc9('0x4'),_0x53f471['uniqueid'],_0x53f471[_0x0cc9('0x5')],_0x53f471[_0x0cc9('0x6')],_0x53f471[_0x0cc9('0x7')],_0x53f471[_0x0cc9('0x8')],_0x53f471[_0x0cc9('0x9')]));utils['request'](_0x0cc9('0xa'),_0x53f471);delete dials[_0x53f471[_0x0cc9('0xb')]];}exports[_0x0cc9('0xc')]=function(_0x397402){try{if(_0x397402[_0x0cc9('0xd')][_0x0cc9('0xe')]()==_0x0cc9('0xf')&&_[_0x0cc9('0x10')](_0x397402[_0x0cc9('0x11')][_0x0cc9('0xe')](),_0x0cc9('0x12'))){var _0xb2edad=_0x397402[_0x0cc9('0x11')][_0x0cc9('0x13')]('=');dials[_0x397402[_0x0cc9('0xb')]]={'routeId':_0xb2edad[0x1]};}}catch(_0x23e25c){utils[_0x0cc9('0x14')](_0x23e25c[_0x0cc9('0x15')]);}};exports[_0x0cc9('0x16')]=function(_0x3e1d46){try{if(!_[_0x0cc9('0x17')](_0x3e1d46[_0x0cc9('0x18')]['outboundrouteid'])){dials[_0x3e1d46[_0x0cc9('0xb')]]={'routeId':_0x3e1d46['value']};}}catch(_0x3061c9){utils[_0x0cc9('0x14')](_0x3061c9[_0x0cc9('0x15')]);}};exports[_0x0cc9('0x19')]=function(_0x3a0ab8){try{if(!_['isNil'](dials[_0x3a0ab8['uniqueid']])){dials[_0x3a0ab8[_0x0cc9('0xb')]]=_['assign'](dials[_0x3a0ab8[_0x0cc9('0xb')]],_0x3a0ab8);dials[_0x3a0ab8['uniqueid']][_0x0cc9('0x1a')]=utils['now']();dials[_0x3a0ab8[_0x0cc9('0xb')]][_0x0cc9('0x1b')]=_0x0cc9('0x1c');}}catch(_0x129478){utils[_0x0cc9('0x14')](_0x129478[_0x0cc9('0x15')]);}};exports[_0x0cc9('0x1d')]=function(_0x3e5860){try{if(!_['isNil'](dials[_0x3e5860[_0x0cc9('0xb')]])){dials[_0x3e5860['uniqueid']]['dialstatus']=_0x3e5860[_0x0cc9('0x9')];if(_0x3e5860[_0x0cc9('0x9')]==_0x0cc9('0x1e')){dials[_0x3e5860['uniqueid']]=_['assign'](dials[_0x3e5860[_0x0cc9('0xb')]],_0x3e5860);dials[_0x3e5860[_0x0cc9('0xb')]]['answertime']=utils[_0x0cc9('0x1f')]();dials[_0x3e5860['uniqueid']][_0x0cc9('0x1b')]=_0x0cc9('0x20');}}}catch(_0x43ede1){utils[_0x0cc9('0x14')](_0x43ede1[_0x0cc9('0x15')]);}};exports[_0x0cc9('0x21')]=function(_0x59de4a){try{if(!_[_0x0cc9('0x17')](dials[_0x59de4a[_0x0cc9('0xb')]])){dials[_0x59de4a['uniqueid']]=_[_0x0cc9('0x22')](dials[_0x59de4a['uniqueid']],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x59de4a['uniqueid']][_0x0cc9('0x23')]=utils[_0x0cc9('0x24')](dials[_0x59de4a['uniqueid']]['endtime'],dials[_0x59de4a[_0x0cc9('0xb')]][_0x0cc9('0x1a')]);dials[_0x59de4a[_0x0cc9('0xb')]][_0x0cc9('0x25')]=utils[_0x0cc9('0x24')](dials[_0x59de4a[_0x0cc9('0xb')]][_0x0cc9('0x26')]||dials[_0x59de4a[_0x0cc9('0xb')]][_0x0cc9('0x27')],dials[_0x59de4a['uniqueid']][_0x0cc9('0x1a')]);dials[_0x59de4a['uniqueid']][_0x0cc9('0x28')]=dials[_0x59de4a[_0x0cc9('0xb')]][_0x0cc9('0x26')]?utils[_0x0cc9('0x24')](dials[_0x59de4a[_0x0cc9('0xb')]]['endtime'],dials[_0x59de4a[_0x0cc9('0xb')]]['answertime']):0x0;writeDB(dials[_0x59de4a[_0x0cc9('0xb')]]);}}catch(_0x504f1c){utils[_0x0cc9('0x14')](_0x504f1c['stack']);}}; \ No newline at end of file +var _0xe82b=['dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','appdata','cdr(routeid)','stack','isNil','outboundrouteid','value','error','dialbegin','assign','now','lastevent','dialend','ANSWER','answertime','hangup','complete','duration','diffTime','endtime','starttime','lodash','util','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel'];(function(_0x427fd4,_0x2248d1){var _0x4361ff=function(_0x43969d){while(--_0x43969d){_0x427fd4['push'](_0x427fd4['shift']());}};_0x4361ff(++_0x2248d1);}(_0xe82b,0xfc));var _0xbe82=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe82b[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0xbe82('0x0'));var util=require(_0xbe82('0x1'));var utils=require(_0xbe82('0x2'));var dials={};function writeDB(_0x492ad3){utils[_0xbe82('0x3')](util['format'](_0xbe82('0x4'),_0x492ad3[_0xbe82('0x5')],_0x492ad3[_0xbe82('0x6')],_0x492ad3[_0xbe82('0x7')],_0x492ad3[_0xbe82('0x8')],_0x492ad3[_0xbe82('0x9')],_0x492ad3[_0xbe82('0xa')]));utils[_0xbe82('0xb')](_0xbe82('0xc'),_0x492ad3);delete dials[_0x492ad3['uniqueid']];}exports[_0xbe82('0xd')]=function(_0x139da8){try{if(_0x139da8[_0xbe82('0xe')][_0xbe82('0xf')]()==_0xbe82('0x10')&&_['startsWith'](_0x139da8[_0xbe82('0x11')][_0xbe82('0xf')](),_0xbe82('0x12'))){var _0x3a2635=_0x139da8[_0xbe82('0x11')]['split']('=');dials[_0x139da8['uniqueid']]={'routeId':_0x3a2635[0x1]};}}catch(_0xc62762){utils['error'](_0xc62762[_0xbe82('0x13')]);}};exports['varset']=function(_0x2338c0){try{if(!_[_0xbe82('0x14')](_0x2338c0['variable'][_0xbe82('0x15')])){dials[_0x2338c0[_0xbe82('0x5')]]={'routeId':_0x2338c0[_0xbe82('0x16')]};}}catch(_0x4cc840){utils[_0xbe82('0x17')](_0x4cc840[_0xbe82('0x13')]);}};exports[_0xbe82('0x18')]=function(_0x33ca4a){try{if(!_['isNil'](dials[_0x33ca4a['uniqueid']])){dials[_0x33ca4a[_0xbe82('0x5')]]=_[_0xbe82('0x19')](dials[_0x33ca4a[_0xbe82('0x5')]],_0x33ca4a);dials[_0x33ca4a[_0xbe82('0x5')]]['starttime']=utils[_0xbe82('0x1a')]();dials[_0x33ca4a[_0xbe82('0x5')]][_0xbe82('0x1b')]='called';}}catch(_0x583385){utils[_0xbe82('0x17')](_0x583385[_0xbe82('0x13')]);}};exports[_0xbe82('0x1c')]=function(_0x43491b){try{if(!_[_0xbe82('0x14')](dials[_0x43491b[_0xbe82('0x5')]])){dials[_0x43491b['uniqueid']][_0xbe82('0xa')]=_0x43491b[_0xbe82('0xa')];if(_0x43491b['dialstatus']==_0xbe82('0x1d')){dials[_0x43491b[_0xbe82('0x5')]]=_['assign'](dials[_0x43491b[_0xbe82('0x5')]],_0x43491b);dials[_0x43491b[_0xbe82('0x5')]][_0xbe82('0x1e')]=utils['now']();dials[_0x43491b[_0xbe82('0x5')]][_0xbe82('0x1b')]='connect';}}}catch(_0x94f861){utils[_0xbe82('0x17')](_0x94f861[_0xbe82('0x13')]);}};exports[_0xbe82('0x1f')]=function(_0x2d94f0){try{if(!_['isNil'](dials[_0x2d94f0['uniqueid']])){dials[_0x2d94f0[_0xbe82('0x5')]]=_[_0xbe82('0x19')](dials[_0x2d94f0['uniqueid']],{'endtime':utils['now'](),'lastevent':_0xbe82('0x20')});dials[_0x2d94f0['uniqueid']][_0xbe82('0x21')]=utils[_0xbe82('0x22')](dials[_0x2d94f0['uniqueid']][_0xbe82('0x23')],dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x24')]);dials[_0x2d94f0[_0xbe82('0x5')]]['holdtime']=utils['diffTime'](dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x1e')]||dials[_0x2d94f0[_0xbe82('0x5')]]['endtime'],dials[_0x2d94f0['uniqueid']]['starttime']);dials[_0x2d94f0[_0xbe82('0x5')]]['billableseconds']=dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x1e')]?utils[_0xbe82('0x22')](dials[_0x2d94f0[_0xbe82('0x5')]][_0xbe82('0x23')],dials[_0x2d94f0['uniqueid']][_0xbe82('0x1e')]):0x0;writeDB(dials[_0x2d94f0[_0xbe82('0x5')]]);}}catch(_0x3b7eb6){utils['error'](_0x3b7eb6[_0xbe82('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index c8035e0..4b2afd0 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 _0xa4c7=['queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','asterisk','port','username','password','xdr','disabled','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete'];(function(_0x243918,_0x8dcbc3){var _0x49d6a7=function(_0x59c738){while(--_0x59c738){_0x243918['push'](_0x243918['shift']());}};_0x49d6a7(++_0x8dcbc3);}(_0xa4c7,0xff));var _0x7a4c=function(_0x309493,_0x37e320){_0x309493=_0x309493-0x0;var _0x1b0469=_0xa4c7[_0x309493];return _0x1b0469;};var AsteriskManager=require('asterisk-manager');var config=require(_0x7a4c('0x0'));var utils=require('./utils');var ami=new AsteriskManager(config[_0x7a4c('0x1')][_0x7a4c('0x2')],config[_0x7a4c('0x1')]['ip'],config[_0x7a4c('0x1')][_0x7a4c('0x3')],config['asterisk'][_0x7a4c('0x4')],!![]);ami['keepConnected']();if(config[_0x7a4c('0x5')]&&config[_0x7a4c('0x5')][_0x7a4c('0x6')]){utils['info'](_0x7a4c('0x7'));}else{var agents=require(_0x7a4c('0x8'));var calls=require(_0x7a4c('0x9'));var queues=require(_0x7a4c('0xa'));var recordings=require(_0x7a4c('0xb'));var members=require(_0x7a4c('0xc'));var dials=require(_0x7a4c('0xd'));var transfers=require(_0x7a4c('0xe'));var core=require('./core.controller');ami['on']('connect',core['connect']);ami['on'](_0x7a4c('0xf'),core[_0x7a4c('0xf')]);ami['on'](_0x7a4c('0x10'),core[_0x7a4c('0x10')]);ami['on'](_0x7a4c('0x11'),core['error']);ami['on'](_0x7a4c('0x12'),core[_0x7a4c('0x12')]);ami['on'](_0x7a4c('0x13'),core[_0x7a4c('0x13')]);ami['on'](_0x7a4c('0x14'),function(_0x18c417){try{members['devicestatechange'](_0x18c417);}catch(_0x1c353f){utils['error'](_0x1c353f);}});ami['on'](_0x7a4c('0x15'),function(_0x18efd3){try{agents[_0x7a4c('0x15')](_0x18efd3);}catch(_0x234aff){utils['error'](_0x234aff);}});ami['on'](_0x7a4c('0x16'),function(_0x26ec3b){try{agents[_0x7a4c('0x16')](_0x26ec3b);}catch(_0x5a2f19){utils[_0x7a4c('0x11')](_0x5a2f19);}});ami['on'](_0x7a4c('0x17'),function(_0x58c9b4){try{agents[_0x7a4c('0x17')](_0x58c9b4);queues[_0x7a4c('0x17')](_0x58c9b4);}catch(_0x510708){utils[_0x7a4c('0x11')](_0x510708);}});ami['on'](_0x7a4c('0x18'),function(_0x3aa7d9){try{agents[_0x7a4c('0x18')](_0x3aa7d9);queues[_0x7a4c('0x18')](_0x3aa7d9);members[_0x7a4c('0x18')](_0x3aa7d9);}catch(_0x2cbab3){utils[_0x7a4c('0x11')](_0x2cbab3);}});ami['on'](_0x7a4c('0x19'),function(_0x51216f){try{agents[_0x7a4c('0x19')](_0x51216f);queues['queuecallerabandon'](_0x51216f);}catch(_0x14c1fc){utils[_0x7a4c('0x11')](_0x14c1fc);}});ami['on']('queuecallerjoin',function(_0x533a45){try{queues['queuecallerjoin'](_0x533a45);recordings[_0x7a4c('0x1a')](_0x533a45);}catch(_0x3bab29){utils[_0x7a4c('0x11')](_0x3bab29);}});ami['on'](_0x7a4c('0x1b'),function(_0x169c93){try{queues[_0x7a4c('0x1b')](_0x169c93);}catch(_0x2dc8d8){utils[_0x7a4c('0x11')](_0x2dc8d8);}});ami['on']('musiconholdstart',function(_0x378b1a){try{queues['musiconholdstart'](_0x378b1a);calls[_0x7a4c('0x1c')](_0x378b1a);}catch(_0x46ec6f){utils[_0x7a4c('0x11')](_0x46ec6f);}});ami['on'](_0x7a4c('0x1d'),function(_0xdc332c){try{queues['musiconholdstop'](_0xdc332c);calls['musiconholdstop'](_0xdc332c);}catch(_0x49354f){utils[_0x7a4c('0x11')](_0x49354f);}});ami['on']('newstate',function(_0x4ba007){try{calls[_0x7a4c('0x1e')](_0x4ba007);recordings[_0x7a4c('0x1e')](_0x4ba007);}catch(_0x3e3dba){utils[_0x7a4c('0x11')](_0x3e3dba);}});ami['on'](_0x7a4c('0x1f'),function(_0xf69e89){try{calls[_0x7a4c('0x1f')](_0xf69e89);recordings[_0x7a4c('0x1f')](_0xf69e89);dials[_0x7a4c('0x1f')](_0xf69e89);agents[_0x7a4c('0x1f')](_0xf69e89);queues['hangup'](_0xf69e89);}catch(_0x59a0f7){utils[_0x7a4c('0x11')](_0x59a0f7);}});ami['on'](_0x7a4c('0x20'),function(_0x4fc711){try{members[_0x7a4c('0x20')](_0x4fc711);}catch(_0x2feaf9){utils[_0x7a4c('0x11')](_0x2feaf9);}});ami['on'](_0x7a4c('0x21'),function(_0x2de3bf){try{queues[_0x7a4c('0x21')](_0x2de3bf);agents[_0x7a4c('0x21')](_0x2de3bf);transfers['blindtransfer'](_0x2de3bf);}catch(_0x39215f){utils[_0x7a4c('0x11')](_0x39215f);}});ami['on'](_0x7a4c('0x22'),function(_0x3dd377){try{queues['attendedtransfer'](_0x3dd377);transfers[_0x7a4c('0x22')](_0x3dd377);agents[_0x7a4c('0x22')](_0x3dd377);calls[_0x7a4c('0x22')](_0x3dd377);}catch(_0x54053c){utils[_0x7a4c('0x11')](_0x54053c);}});ami['on'](_0x7a4c('0x23'),function(_0x2ac471){try{queues[_0x7a4c('0x23')](_0x2ac471);recordings[_0x7a4c('0x23')](_0x2ac471);calls[_0x7a4c('0x23')](_0x2ac471);dials['varset'](_0x2ac471);}catch(_0x2790bf){utils[_0x7a4c('0x11')](_0x2790bf);}});ami['on'](_0x7a4c('0x24'),function(_0x8457fe){try{calls[_0x7a4c('0x24')](_0x8457fe);recordings['newexten'](_0x8457fe);dials[_0x7a4c('0x24')](_0x8457fe);}catch(_0x106fca){utils['error'](_0x106fca);}});ami['on'](_0x7a4c('0x25'),function(_0x2d6c6a){try{calls[_0x7a4c('0x25')](_0x2d6c6a);recordings[_0x7a4c('0x25')](_0x2d6c6a);}catch(_0x5222e0){utils[_0x7a4c('0x11')](_0x5222e0);}});ami['on'](_0x7a4c('0x26'),function(_0x53b34d){try{dials['dialbegin'](_0x53b34d);}catch(_0x30c8a1){utils[_0x7a4c('0x11')](_0x30c8a1);}});ami['on'](_0x7a4c('0x27'),function(_0x40020d){try{dials[_0x7a4c('0x27')](_0x40020d);}catch(_0x258d02){utils[_0x7a4c('0x11')](_0x258d02);}});} \ No newline at end of file +var _0x2589=['username','password','xdr','info','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port'];(function(_0x397027,_0x5c02d4){var _0x3d2682=function(_0xa7b034){while(--_0xa7b034){_0x397027['push'](_0x397027['shift']());}};_0x3d2682(++_0x5c02d4);}(_0x2589,0xc3));var _0x9258=function(_0x258c7f,_0x5142ee){_0x258c7f=_0x258c7f-0x0;var _0x441272=_0x2589[_0x258c7f];return _0x441272;};var AsteriskManager=require(_0x9258('0x0'));var config=require(_0x9258('0x1'));var utils=require(_0x9258('0x2'));var ami=new AsteriskManager(config[_0x9258('0x3')][_0x9258('0x4')],config[_0x9258('0x3')]['ip'],config[_0x9258('0x3')][_0x9258('0x5')],config[_0x9258('0x3')][_0x9258('0x6')],!![]);ami['keepConnected']();if(config[_0x9258('0x7')]&&config[_0x9258('0x7')]['disabled']){utils[_0x9258('0x8')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require(_0x9258('0x9'));var queues=require(_0x9258('0xa'));var recordings=require(_0x9258('0xb'));var members=require('./members.controller');var dials=require(_0x9258('0xc'));var transfers=require(_0x9258('0xd'));var core=require(_0x9258('0xe'));ami['on']('connect',core[_0x9258('0xf')]);ami['on'](_0x9258('0x10'),core['shutdown']);ami['on']('fullybooted',core[_0x9258('0x11')]);ami['on']('error',core[_0x9258('0x12')]);ami['on'](_0x9258('0x13'),core[_0x9258('0x13')]);ami['on'](_0x9258('0x14'),core[_0x9258('0x14')]);ami['on'](_0x9258('0x15'),function(_0x49360a){try{members[_0x9258('0x15')](_0x49360a);}catch(_0x4234a4){utils['error'](_0x4234a4);}});ami['on'](_0x9258('0x16'),function(_0x3439ce){try{agents[_0x9258('0x16')](_0x3439ce);}catch(_0x1afa8){utils[_0x9258('0x12')](_0x1afa8);}});ami['on']('agentringnoanswer',function(_0x4ace96){try{agents['agentringnoanswer'](_0x4ace96);}catch(_0xe60aae){utils[_0x9258('0x12')](_0xe60aae);}});ami['on'](_0x9258('0x17'),function(_0x56173e){try{agents[_0x9258('0x17')](_0x56173e);queues[_0x9258('0x17')](_0x56173e);}catch(_0xca4d7d){utils[_0x9258('0x12')](_0xca4d7d);}});ami['on'](_0x9258('0x18'),function(_0x39c9a5){try{agents[_0x9258('0x18')](_0x39c9a5);queues[_0x9258('0x18')](_0x39c9a5);members[_0x9258('0x18')](_0x39c9a5);}catch(_0x1c811e){utils[_0x9258('0x12')](_0x1c811e);}});ami['on'](_0x9258('0x19'),function(_0x45b700){try{agents['queuecallerabandon'](_0x45b700);queues[_0x9258('0x19')](_0x45b700);}catch(_0x207b3e){utils[_0x9258('0x12')](_0x207b3e);}});ami['on']('queuecallerjoin',function(_0x17514e){try{queues[_0x9258('0x1a')](_0x17514e);recordings[_0x9258('0x1a')](_0x17514e);}catch(_0xaeb0c9){utils['error'](_0xaeb0c9);}});ami['on'](_0x9258('0x1b'),function(_0x52f2df){try{queues[_0x9258('0x1b')](_0x52f2df);}catch(_0x56983f){utils[_0x9258('0x12')](_0x56983f);}});ami['on'](_0x9258('0x1c'),function(_0x140b12){try{queues['musiconholdstart'](_0x140b12);calls[_0x9258('0x1c')](_0x140b12);}catch(_0x224222){utils[_0x9258('0x12')](_0x224222);}});ami['on'](_0x9258('0x1d'),function(_0x46891f){try{queues[_0x9258('0x1d')](_0x46891f);calls[_0x9258('0x1d')](_0x46891f);}catch(_0x2d1203){utils[_0x9258('0x12')](_0x2d1203);}});ami['on'](_0x9258('0x1e'),function(_0x3d3422){try{calls[_0x9258('0x1e')](_0x3d3422);recordings[_0x9258('0x1e')](_0x3d3422);}catch(_0x190eee){utils[_0x9258('0x12')](_0x190eee);}});ami['on']('hangup',function(_0x13ad49){try{calls[_0x9258('0x1f')](_0x13ad49);recordings[_0x9258('0x1f')](_0x13ad49);dials[_0x9258('0x1f')](_0x13ad49);agents[_0x9258('0x1f')](_0x13ad49);queues['hangup'](_0x13ad49);}catch(_0x4e1c8e){utils[_0x9258('0x12')](_0x4e1c8e);}});ami['on'](_0x9258('0x20'),function(_0x155662){try{members[_0x9258('0x20')](_0x155662);}catch(_0x59ce9e){utils[_0x9258('0x12')](_0x59ce9e);}});ami['on'](_0x9258('0x21'),function(_0x5cc0dd){try{queues[_0x9258('0x21')](_0x5cc0dd);agents['blindtransfer'](_0x5cc0dd);transfers[_0x9258('0x21')](_0x5cc0dd);}catch(_0x11a0bb){utils[_0x9258('0x12')](_0x11a0bb);}});ami['on']('attendedtransfer',function(_0x7f63b2){try{queues[_0x9258('0x22')](_0x7f63b2);transfers[_0x9258('0x22')](_0x7f63b2);agents[_0x9258('0x22')](_0x7f63b2);calls['attendedtransfer'](_0x7f63b2);}catch(_0xa0f691){utils[_0x9258('0x12')](_0xa0f691);}});ami['on'](_0x9258('0x23'),function(_0x21d04b){try{queues['varset'](_0x21d04b);recordings['varset'](_0x21d04b);calls['varset'](_0x21d04b);dials[_0x9258('0x23')](_0x21d04b);}catch(_0x563d5c){utils[_0x9258('0x12')](_0x563d5c);}});ami['on'](_0x9258('0x24'),function(_0x966859){try{calls[_0x9258('0x24')](_0x966859);recordings[_0x9258('0x24')](_0x966859);dials[_0x9258('0x24')](_0x966859);}catch(_0x4b3f45){utils[_0x9258('0x12')](_0x4b3f45);}});ami['on']('newchannel',function(_0x363e7a){try{calls[_0x9258('0x25')](_0x363e7a);recordings[_0x9258('0x25')](_0x363e7a);}catch(_0x3c6962){utils[_0x9258('0x12')](_0x3c6962);}});ami['on'](_0x9258('0x26'),function(_0x11b0d7){try{dials[_0x9258('0x26')](_0x11b0d7);}catch(_0x437af6){utils[_0x9258('0x12')](_0x437af6);}});ami['on'](_0x9258('0x27'),function(_0x424509){try{dials['dialend'](_0x424509);}catch(_0x584dfe){utils[_0x9258('0x12')](_0x584dfe);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index e3ee8c4..b258ce3 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 _0x5e40=['isNil','duration','diffTime','enterAt','uniqueid','agentcomplete','queue','cdr','data1','data3','destination','destinationchannel','source','exitAt','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','channel','data2','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','catch','interface','some','startsWith','devicestatechange','state','INUSE','BUSY','device','voice','now','agent','NOT_INUSE'];(function(_0x1b90e0,_0x128583){var _0x2a26c4=function(_0x2a6e35){while(--_0x2a6e35){_0x1b90e0['push'](_0x1b90e0['shift']());}};_0x2a26c4(++_0x128583);}(_0x5e40,0x1da));var _0x05e4=function(_0x545240,_0x5daa34){_0x545240=_0x545240-0x0;var _0x4cf537=_0x5e40[_0x545240];return _0x4cf537;};'use strict';var _=require(_0x05e4('0x0'));var util=require(_0x05e4('0x1'));var utils=require(_0x05e4('0x2'));var members={};var exclude=[_0x05e4('0x3'),_0x05e4('0x4')];function writeDB(_0x4e1797){utils[_0x05e4('0x5')](util['format'](_0x05e4('0x6'),_0x4e1797['uniqueid'],_0x4e1797['interface'],_0x4e1797[_0x05e4('0x7')],_0x4e1797[_0x05e4('0x8')],_0x4e1797[_0x05e4('0x9')],_0x4e1797[_0x05e4('0xa')]));if(_0x4e1797['interface']){utils[_0x05e4('0xb')](_0x4e1797['interface'])[_0x05e4('0xc')](function(_0x3c9a31){if(_0x3c9a31){_0x4e1797[_0x05e4('0x9')]=_0x3c9a31[_0x05e4('0xd')];_0x4e1797[_0x05e4('0xe')]=_0x3c9a31[_0x05e4('0xe')];utils[_0x05e4('0xf')](_0x05e4('0x10'),_0x4e1797);}else{utils[_0x05e4('0x11')](_0x4e1797['interface'][_0x05e4('0x12')]('/')[0x1])[_0x05e4('0xc')](function(_0x184dbb){if(_0x184dbb){_0x4e1797[_0x05e4('0x9')]=_0x184dbb[_0x05e4('0xd')];_0x4e1797[_0x05e4('0xe')]=_0x184dbb[_0x05e4('0xe')];utils[_0x05e4('0xf')](_0x05e4('0x10'),_0x4e1797);}});}})[_0x05e4('0x13')](function(_0x4b0a79){utils['error'](_0x4b0a79);});}delete members[_0x4e1797[_0x05e4('0x14')]];}function startsWith(_0x3d34a2,_0x492112){return _[_0x05e4('0x15')](_0x3d34a2,function(_0x2794e4){return _[_0x05e4('0x16')](_0x492112,_0x2794e4);});}exports[_0x05e4('0x17')]=function(_0x34f886){switch(_0x34f886[_0x05e4('0x18')]){case _0x05e4('0x19'):case _0x05e4('0x1a'):if(!startsWith(exclude,_0x34f886[_0x05e4('0x1b')])){members[_0x34f886['device']]={'channel':_0x05e4('0x1c'),'interface':_0x34f886[_0x05e4('0x1b')],'type':'TALKING','enterAt':utils[_0x05e4('0x1d')](),'role':_0x05e4('0x1e')};}break;case _0x05e4('0x1f'):if(!_[_0x05e4('0x20')](members[_0x34f886[_0x05e4('0x1b')]])){members[_0x34f886[_0x05e4('0x1b')]]['exitAt']=utils['now']();members[_0x34f886[_0x05e4('0x1b')]][_0x05e4('0x21')]=utils[_0x05e4('0x22')](members[_0x34f886[_0x05e4('0x1b')]]['exitAt'],members[_0x34f886[_0x05e4('0x1b')]][_0x05e4('0x23')]);if(members[_0x34f886[_0x05e4('0x1b')]][_0x05e4('0x24')]){writeDB(members[_0x34f886[_0x05e4('0x1b')]]);}}default:break;}};exports[_0x05e4('0x25')]=function(_0x49945e){if(!_[_0x05e4('0x20')](members[_0x49945e['interface']])){members[_0x49945e[_0x05e4('0x14')]]=_['assign'](members[_0x49945e[_0x05e4('0x14')]],{'data4':_0x49945e[_0x05e4('0x26')],'uniqueid':_0x49945e['uniqueid']});}};exports[_0x05e4('0x27')]=function(_0x1c777c){if(_0x1c777c[_0x05e4('0x7')]){var _0x55cc52=_0x1c777c[_0x05e4('0x7')][_0x05e4('0x12')]('-')[0x0];if(!_[_0x05e4('0x20')](members[_0x55cc52])){members[_0x55cc52]=_['assign'](members[_0x55cc52],{'data1':members[_0x55cc52][_0x05e4('0x28')]||_0x1c777c[_0x05e4('0xa')],'data2':members[_0x55cc52][_0x05e4('0x8')]||_0x1c777c['source'],'data3':members[_0x55cc52][_0x05e4('0x29')]||_0x1c777c[_0x05e4('0x2a')],'uniqueid':members[_0x55cc52][_0x05e4('0x24')]||_0x1c777c[_0x05e4('0x24')]});if(members[_0x55cc52]['exitAt']){writeDB(members[_0x55cc52]);}}}if(_0x1c777c['destinationchannel']){var _0x574486=_0x1c777c[_0x05e4('0x2b')][_0x05e4('0x12')]('-')[0x0];if(!_['isNil'](members[_0x574486])){members[_0x574486]=_['assign'](members[_0x574486],{'data1':members[_0x574486]['data1']||_0x1c777c['type'],'data2':members[_0x574486][_0x05e4('0x8')]||_0x1c777c[_0x05e4('0x2c')],'data3':members[_0x574486][_0x05e4('0x29')]||_0x1c777c[_0x05e4('0x2a')],'uniqueid':members[_0x574486]['uniqueid']||_0x1c777c[_0x05e4('0x24')]});if(members[_0x574486][_0x05e4('0x2d')]){writeDB(members[_0x574486]);}}}}; \ No newline at end of file +var _0xfe7c=['diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','source','data3','destination','destinationchannel','lodash','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','channel','data2','type','interface','membername','name','request','CreateMemberReport','getUserByName','split','then','internal','catch','error','startsWith','devicestatechange','state','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0xfe7c,0x1cd));var _0xcfe7=function(_0x36e8d6,_0x142639){_0x36e8d6=_0x36e8d6-0x0;var _0x347069=_0xfe7c[_0x36e8d6];return _0x347069;};'use strict';var _=require(_0xcfe7('0x0'));var util=require('util');var utils=require('./utils');var members={};var exclude=[_0xcfe7('0x1'),_0xcfe7('0x2')];function writeDB(_0x410fcc){utils[_0xcfe7('0x3')](util[_0xcfe7('0x4')](_0xcfe7('0x5'),_0x410fcc[_0xcfe7('0x6')],_0x410fcc['interface'],_0x410fcc[_0xcfe7('0x7')],_0x410fcc[_0xcfe7('0x8')],_0x410fcc['membername'],_0x410fcc[_0xcfe7('0x9')]));if(_0x410fcc[_0xcfe7('0xa')]){utils['getUserByInterface'](_0x410fcc[_0xcfe7('0xa')])['then'](function(_0x4e61fd){if(_0x4e61fd){_0x410fcc[_0xcfe7('0xb')]=_0x4e61fd[_0xcfe7('0xc')];_0x410fcc['internal']=_0x4e61fd['internal'];utils[_0xcfe7('0xd')](_0xcfe7('0xe'),_0x410fcc);}else{utils[_0xcfe7('0xf')](_0x410fcc[_0xcfe7('0xa')][_0xcfe7('0x10')]('/')[0x1])[_0xcfe7('0x11')](function(_0x43c9c1){if(_0x43c9c1){_0x410fcc[_0xcfe7('0xb')]=_0x43c9c1[_0xcfe7('0xc')];_0x410fcc[_0xcfe7('0x12')]=_0x43c9c1[_0xcfe7('0x12')];utils[_0xcfe7('0xd')](_0xcfe7('0xe'),_0x410fcc);}});}})[_0xcfe7('0x13')](function(_0x14beb3){utils[_0xcfe7('0x14')](_0x14beb3);});}delete members[_0x410fcc['interface']];}function startsWith(_0x4e7c08,_0x42f6b8){return _['some'](_0x4e7c08,function(_0x15e217){return _[_0xcfe7('0x15')](_0x42f6b8,_0x15e217);});}exports[_0xcfe7('0x16')]=function(_0xcc760){switch(_0xcc760[_0xcfe7('0x17')]){case'INUSE':case _0xcfe7('0x18'):if(!startsWith(exclude,_0xcc760[_0xcfe7('0x19')])){members[_0xcc760[_0xcfe7('0x19')]]={'channel':_0xcfe7('0x1a'),'interface':_0xcc760[_0xcfe7('0x19')],'type':_0xcfe7('0x1b'),'enterAt':utils[_0xcfe7('0x1c')](),'role':_0xcfe7('0x1d')};}break;case _0xcfe7('0x1e'):if(!_[_0xcfe7('0x1f')](members[_0xcc760[_0xcfe7('0x19')]])){members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x20')]=utils['now']();members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x21')]=utils[_0xcfe7('0x22')](members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x20')],members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x23')]);if(members[_0xcc760[_0xcfe7('0x19')]][_0xcfe7('0x6')]){writeDB(members[_0xcc760['device']]);}}default:break;}};exports[_0xcfe7('0x24')]=function(_0x402c51){if(!_['isNil'](members[_0x402c51['interface']])){members[_0x402c51['interface']]=_[_0xcfe7('0x25')](members[_0x402c51[_0xcfe7('0xa')]],{'data4':_0x402c51[_0xcfe7('0x26')],'uniqueid':_0x402c51[_0xcfe7('0x6')]});}};exports[_0xcfe7('0x27')]=function(_0x3c739d){if(_0x3c739d[_0xcfe7('0x7')]){var _0x541fed=_0x3c739d[_0xcfe7('0x7')][_0xcfe7('0x10')]('-')[0x0];if(!_['isNil'](members[_0x541fed])){members[_0x541fed]=_[_0xcfe7('0x25')](members[_0x541fed],{'data1':members[_0x541fed][_0xcfe7('0x28')]||_0x3c739d[_0xcfe7('0x9')],'data2':members[_0x541fed][_0xcfe7('0x8')]||_0x3c739d[_0xcfe7('0x29')],'data3':members[_0x541fed][_0xcfe7('0x2a')]||_0x3c739d[_0xcfe7('0x2b')],'uniqueid':members[_0x541fed][_0xcfe7('0x6')]||_0x3c739d['uniqueid']});if(members[_0x541fed]['exitAt']){writeDB(members[_0x541fed]);}}}if(_0x3c739d[_0xcfe7('0x2c')]){var _0x10cef0=_0x3c739d[_0xcfe7('0x2c')][_0xcfe7('0x10')]('-')[0x0];if(!_[_0xcfe7('0x1f')](members[_0x10cef0])){members[_0x10cef0]=_[_0xcfe7('0x25')](members[_0x10cef0],{'data1':members[_0x10cef0][_0xcfe7('0x28')]||_0x3c739d[_0xcfe7('0x9')],'data2':members[_0x10cef0][_0xcfe7('0x8')]||_0x3c739d['source'],'data3':members[_0x10cef0][_0xcfe7('0x2a')]||_0x3c739d['destination'],'uniqueid':members[_0x10cef0]['uniqueid']||_0x3c739d['uniqueid']});if(members[_0x10cef0]['exitAt']){writeDB(members[_0x10cef0]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 89cf178..962338a 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 _0xe3af=['origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','secondtransfereruniqueid','secondtransfererexten','transferuniqueid','transfertargetlinkedid','transfertargetuniqueid','error','stack','musiconholdstart','musiconholdstartAt','lodash','./utils','info','format','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','transfereduniqueid','uniqueid','queuecallerjoin','assign','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallerenterreason','varset','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','variable','queueposition','EXITWITHKEY','queuecallerleave','holdtime','queuecallerjoinAt','position','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','agentcomplete','queuecallercompleteAt','transfer','TRANSFER','reason','toUpperCase','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED'];(function(_0x346235,_0x554727){var _0x4a0d35=function(_0x562621){while(--_0x562621){_0x346235['push'](_0x346235['shift']());}};_0x4a0d35(++_0x554727);}(_0xe3af,0x1de));var _0xfe3a=function(_0x299027,_0x5d2e4f){_0x299027=_0x299027-0x0;var _0x1bc622=_0xe3af[_0x299027];return _0x1bc622;};'use strict';var _=require(_0xfe3a('0x0'));var util=require('util');var utils=require(_0xfe3a('0x1'));var queues={};function writeDB(_0xf36fa5){utils[_0xfe3a('0x2')](util[_0xfe3a('0x3')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0xf36fa5['uniqueid'],_0xf36fa5[_0xfe3a('0x4')],_0xf36fa5['queue'],_0xf36fa5[_0xfe3a('0x5')],_0xf36fa5[_0xfe3a('0x6')],_0xf36fa5[_0xfe3a('0x7')],_0xf36fa5[_0xfe3a('0x8')]));if(_0xf36fa5[_0xfe3a('0x9')]){utils[_0xfe3a('0xa')](_0xf36fa5[_0xfe3a('0x9')])[_0xfe3a('0xb')](function(_0x40bf92){if(_0x40bf92){_0xf36fa5[_0xfe3a('0xc')]=_0x40bf92[_0xfe3a('0xc')];}utils[_0xfe3a('0xd')]('CreateVoiceQueueReport',_0xf36fa5);});}else{utils[_0xfe3a('0xd')]('CreateVoiceQueueReport',_0xf36fa5);}if(_0xf36fa5['transfereduniqueid']){delete queues[_0xf36fa5[_0xfe3a('0xe')]];}else{delete queues[_0xf36fa5[_0xfe3a('0xf')]];}}exports[_0xfe3a('0x10')]=function(_0x5b9f4f){queues[_0x5b9f4f['uniqueid']]=_[_0xfe3a('0x11')](_0x5b9f4f,{'originalposition':_0x5b9f4f['position'],'queuecallerjoinAt':utils[_0xfe3a('0x12')](),'mohtime':0x0});};exports[_0xfe3a('0x13')]=function(_0x49ca37){if(!_[_0xfe3a('0x14')](queues[_0x49ca37[_0xfe3a('0xf')]])){if(queues[_0x49ca37[_0xfe3a('0xf')]][_0xfe3a('0x15')]){if(!queues[_0x49ca37['uniqueid']][_0xfe3a('0x16')]&&!queues[_0x49ca37[_0xfe3a('0xf')]][_0xfe3a('0x17')]){queues[_0x49ca37[_0xfe3a('0xf')]][_0xfe3a('0x18')]=!![];queues[_0x49ca37[_0xfe3a('0xf')]]['queuecallercompleteAt']=utils[_0xfe3a('0x12')]();queues[_0x49ca37['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}writeDB(queues[_0x49ca37[_0xfe3a('0xf')]]);}else{if(queues[_0x49ca37['uniqueid']]['transfereduniqueid']){queues[queues[_0x49ca37['uniqueid']][_0xfe3a('0xe')]]=queues[_0x49ca37[_0xfe3a('0xf')]];queues[queues[_0x49ca37[_0xfe3a('0xf')]]['transfereduniqueid']][_0xfe3a('0x19')]=0x2;delete queues[_0x49ca37[_0xfe3a('0xf')]];}}}};exports[_0xfe3a('0x1a')]=function(_0x9f146d){if(!_[_0xfe3a('0x14')](_0x9f146d['variable'][_0xfe3a('0x1b')])){if(!_[_0xfe3a('0x14')](queues[_0x9f146d[_0xfe3a('0xf')]])){queues[_0x9f146d[_0xfe3a('0xf')]][_0xfe3a('0x16')]=![];queues[_0x9f146d[_0xfe3a('0xf')]][_0xfe3a('0x1c')]=null;queues[_0x9f146d[_0xfe3a('0xf')]][_0xfe3a('0x17')]=!![];queues[_0x9f146d['uniqueid']][_0xfe3a('0x1d')]=utils['now']();queues[_0x9f146d[_0xfe3a('0xf')]][_0xfe3a('0x8')]=_0x9f146d[_0xfe3a('0x1e')]['toUpperCase']();writeDB(queues[_0x9f146d[_0xfe3a('0xf')]]);}}else if(!_['isNil'](_0x9f146d[_0xfe3a('0x1f')][_0xfe3a('0x20')])){if(!_['isNil'](queues[_0x9f146d['uniqueid']])&&!queues[_0x9f146d[_0xfe3a('0xf')]]['queuecallerabandon']){queues[_0x9f146d[_0xfe3a('0xf')]]['queuecallerabandon']=![];queues[_0x9f146d[_0xfe3a('0xf')]][_0xfe3a('0x1c')]=null;queues[_0x9f146d[_0xfe3a('0xf')]][_0xfe3a('0x17')]=!![];queues[_0x9f146d[_0xfe3a('0xf')]][_0xfe3a('0x1d')]=utils[_0xfe3a('0x12')]();queues[_0x9f146d[_0xfe3a('0xf')]]['queuecallerexitreason']=_0xfe3a('0x21');}}};exports[_0xfe3a('0x16')]=function(_0x5a515c){if(!_[_0xfe3a('0x14')](queues[_0x5a515c['uniqueid']])){queues[_0x5a515c[_0xfe3a('0xf')]]['queuecallerexit']=![];queues[_0x5a515c[_0xfe3a('0xf')]][_0xfe3a('0x1d')]=null;queues[_0x5a515c[_0xfe3a('0xf')]][_0xfe3a('0x16')]=!![];queues[_0x5a515c[_0xfe3a('0xf')]]['queuecallerabandonAt']=utils[_0xfe3a('0x12')]();queues[_0x5a515c['uniqueid']]['queuecallerexitreason']='ABANDONED';}};exports['queuecallerleave']=function(_0x4a9de5){if(!_[_0xfe3a('0x14')](queues[_0x4a9de5['uniqueid']])){queues[_0x4a9de5[_0xfe3a('0xf')]][_0xfe3a('0x22')]=!![];queues[_0x4a9de5[_0xfe3a('0xf')]]['queuecallerleaveAt']=utils[_0xfe3a('0x12')]();queues[_0x4a9de5[_0xfe3a('0xf')]][_0xfe3a('0x23')]=utils['diffTime'](queues[_0x4a9de5[_0xfe3a('0xf')]][_0xfe3a('0x15')],queues[_0x4a9de5[_0xfe3a('0xf')]][_0xfe3a('0x24')]);queues[_0x4a9de5[_0xfe3a('0xf')]][_0xfe3a('0x25')]=_0x4a9de5[_0xfe3a('0x25')];queues[_0x4a9de5['uniqueid']]['count']=_0x4a9de5[_0xfe3a('0x26')];queues[_0x4a9de5['uniqueid']][_0xfe3a('0x27')]=_0x4a9de5[_0xfe3a('0x27')];queues[_0x4a9de5[_0xfe3a('0xf')]]['connectedlinename']=_0x4a9de5[_0xfe3a('0x28')];}};exports[_0xfe3a('0x29')]=function(_0xf98e78){if(!_[_0xfe3a('0x14')](queues[_0xf98e78[_0xfe3a('0xf')]])){queues[_0xf98e78[_0xfe3a('0xf')]][_0xfe3a('0x16')]=![];queues[_0xf98e78['uniqueid']]['queuecallerabandon']=![];queues[_0xf98e78[_0xfe3a('0xf')]][_0xfe3a('0x1c')]=null;queues[_0xf98e78[_0xfe3a('0xf')]][_0xfe3a('0x17')]=![];queues[_0xf98e78[_0xfe3a('0xf')]]['queuecallerexitAt']=null;queues[_0xf98e78[_0xfe3a('0xf')]][_0xfe3a('0x2a')]=!![];queues[_0xf98e78[_0xfe3a('0xf')]][_0xfe3a('0x7')]=_0xf98e78[_0xfe3a('0x2b')];queues[_0xf98e78['uniqueid']]['lastAssignedTo']=_0xf98e78[_0xfe3a('0x2c')];}};exports[_0xfe3a('0x2d')]=function(_0x362c12){if(!_[_0xfe3a('0x14')](queues[_0x362c12[_0xfe3a('0xf')]])){if(queues[_0x362c12['uniqueid']][_0xfe3a('0x15')]){queues[_0x362c12[_0xfe3a('0xf')]][_0xfe3a('0x16')]=![];queues[_0x362c12[_0xfe3a('0xf')]]['queuecallerabandon']=![];queues[_0x362c12['uniqueid']][_0xfe3a('0x1c')]=null;queues[_0x362c12[_0xfe3a('0xf')]][_0xfe3a('0x17')]=![];queues[_0x362c12[_0xfe3a('0xf')]][_0xfe3a('0x1d')]=null;queues[_0x362c12[_0xfe3a('0xf')]]['assigned']=!![];queues[_0x362c12[_0xfe3a('0xf')]][_0xfe3a('0x5')]=_0x362c12[_0xfe3a('0x2c')];queues[_0x362c12[_0xfe3a('0xf')]]['queuecallercomplete']=!![];queues[_0x362c12[_0xfe3a('0xf')]][_0xfe3a('0x2e')]=utils[_0xfe3a('0x12')]();if(_0x362c12['reason']=='transfer'){if(!queues[_0x362c12['uniqueid']][_0xfe3a('0x2f')]){queues[_0x362c12[_0xfe3a('0xf')]][_0xfe3a('0x8')]=_0xfe3a('0x30');}}else{queues[_0x362c12[_0xfe3a('0xf')]][_0xfe3a('0x8')]='COMPLETEDBY'+_0x362c12[_0xfe3a('0x31')][_0xfe3a('0x32')]();}writeDB(queues[_0x362c12[_0xfe3a('0xf')]]);}}};exports[_0xfe3a('0x33')]=function(_0x563d77){if(!_[_0xfe3a('0x14')](queues[_0x563d77[_0xfe3a('0x34')]])){queues[_0x563d77[_0xfe3a('0x34')]][_0xfe3a('0x2f')]=!![];queues[_0x563d77[_0xfe3a('0x34')]][_0xfe3a('0x35')]='BLIND';queues[_0x563d77[_0xfe3a('0x34')]][_0xfe3a('0x36')]=_0x563d77[_0xfe3a('0x37')];queues[_0x563d77[_0xfe3a('0x34')]]['transferuniqueid']=_0x563d77['transfereeuniqueid'];queues[_0x563d77[_0xfe3a('0x34')]]['queuecallerexitreason']=_0xfe3a('0x38');}};exports[_0xfe3a('0x39')]=function(_0xc1b357){try{if(_0xc1b357['origtransfereruniqueid']==_0xc1b357[_0xfe3a('0x3a')]){if(!_[_0xfe3a('0x14')](queues[_0xc1b357[_0xfe3a('0x3b')]])){queues[_0xc1b357[_0xfe3a('0x3b')]][_0xfe3a('0x2f')]=!![];queues[_0xc1b357['secondtransfererlinkedid']]['transfertype']=_0xfe3a('0x3c');queues[_0xc1b357[_0xfe3a('0x3b')]]['transferexten']=_0xc1b357[_0xfe3a('0x3d')];queues[_0xc1b357[_0xfe3a('0x3b')]]['transferuniqueid']=_0xc1b357[_0xfe3a('0x3e')];queues[_0xc1b357[_0xfe3a('0x3b')]][_0xfe3a('0x8')]=_0xfe3a('0x3f');}if(!_[_0xfe3a('0x14')](queues[_0xc1b357[_0xfe3a('0x3a')]])){if(_0xc1b357[_0xfe3a('0x40')]&&queues[_0xc1b357[_0xfe3a('0x40')]]){queues[_0xc1b357[_0xfe3a('0x40')]][_0xfe3a('0x19')]=0x1;queues[_0xc1b357['transfereeuniqueid']]=_[_0xfe3a('0x41')](queues[_0xc1b357[_0xfe3a('0x40')]]);queues[_0xc1b357[_0xfe3a('0x34')]][_0xfe3a('0xe')]=_0xc1b357['transfertargetuniqueid'];queues[_0xc1b357['transfereeuniqueid']][_0xfe3a('0x19')]=0x2;queues[_0xc1b357[_0xfe3a('0x34')]][_0xfe3a('0x6')]=queues[_0xc1b357['secondtransfererlinkedid']][_0xfe3a('0x6')];queues[_0xc1b357[_0xfe3a('0x34')]][_0xfe3a('0x42')]=queues[_0xc1b357[_0xfe3a('0x3b')]]['calleridname'];queues[_0xc1b357[_0xfe3a('0x34')]][_0xfe3a('0x24')]=utils[_0xfe3a('0x12')]();queues[_0xc1b357[_0xfe3a('0x34')]][_0xfe3a('0x15')]=utils[_0xfe3a('0x12')]();queues[_0xc1b357[_0xfe3a('0x34')]]['holdtime']=0x0;queues[_0xc1b357[_0xfe3a('0x34')]][_0xfe3a('0x43')]=0x0;}else{queues[_0xc1b357['origtransfererlinkedid']]['transfereduniqueid']=_0xc1b357[_0xfe3a('0x3b')];}}}else if(_0xc1b357[_0xfe3a('0x44')]==_0xc1b357[_0xfe3a('0x3b')]){if(!_['isNil'](queues[_0xc1b357[_0xfe3a('0x3a')]])){queues[_0xc1b357[_0xfe3a('0x3a')]]['transfer']=!![];queues[_0xc1b357[_0xfe3a('0x3a')]]['transfertype']=_0xfe3a('0x3c');queues[_0xc1b357[_0xfe3a('0x3a')]][_0xfe3a('0x36')]=_0xc1b357[_0xfe3a('0x45')];queues[_0xc1b357[_0xfe3a('0x3a')]][_0xfe3a('0x46')]=_0xc1b357['secondtransfereruniqueid'];queues[_0xc1b357[_0xfe3a('0x3a')]][_0xfe3a('0x8')]=_0xfe3a('0x3f');}if(!_[_0xfe3a('0x14')](queues[_0xc1b357[_0xfe3a('0x3b')]])){if(_0xc1b357['transfertargetlinkedid']&&queues[_0xc1b357[_0xfe3a('0x47')]]){queues[_0xc1b357[_0xfe3a('0x47')]][_0xfe3a('0x19')]=0x1;queues[_0xc1b357['transfertargetuniqueid']]=_[_0xfe3a('0x41')](queues[_0xc1b357[_0xfe3a('0x47')]]);queues[_0xc1b357[_0xfe3a('0x48')]][_0xfe3a('0xe')]=_0xc1b357[_0xfe3a('0x48')];queues[_0xc1b357['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0xc1b357[_0xfe3a('0x48')]][_0xfe3a('0x6')]=queues[_0xc1b357[_0xfe3a('0x3a')]]['calleridnum'];queues[_0xc1b357[_0xfe3a('0x48')]][_0xfe3a('0x42')]=queues[_0xc1b357[_0xfe3a('0x3a')]][_0xfe3a('0x42')];queues[_0xc1b357[_0xfe3a('0x48')]]['queuecallerjoinAt']=utils[_0xfe3a('0x12')]();queues[_0xc1b357[_0xfe3a('0x48')]][_0xfe3a('0x15')]=utils['now']();queues[_0xc1b357[_0xfe3a('0x48')]]['holdtime']=0x0;queues[_0xc1b357['transfertargetuniqueid']][_0xfe3a('0x43')]=0x0;}else{queues[_0xc1b357[_0xfe3a('0x3b')]]['transfereduniqueid']=_0xc1b357[_0xfe3a('0x3a')];}}}}catch(_0x3b6aad){utils[_0xfe3a('0x49')](_0x3b6aad[_0xfe3a('0x4a')]);}};exports[_0xfe3a('0x4b')]=function(_0x43a751){if(!_[_0xfe3a('0x14')](queues[_0x43a751[_0xfe3a('0xf')]])){queues[_0x43a751[_0xfe3a('0xf')]][_0xfe3a('0x4c')]=utils[_0xfe3a('0x12')]();}};exports['musiconholdstop']=function(_0x5c33e3){if(!_[_0xfe3a('0x14')](queues[_0x5c33e3[_0xfe3a('0xf')]])){if(!_[_0xfe3a('0x14')](queues[_0x5c33e3['uniqueid']][_0xfe3a('0x4c')])){queues[_0x5c33e3[_0xfe3a('0xf')]][_0xfe3a('0x43')]+=utils['diffTime'](utils[_0xfe3a('0x12')](),queues[_0x5c33e3[_0xfe3a('0xf')]][_0xfe3a('0x4c')]);delete queues[_0x5c33e3['uniqueid']][_0xfe3a('0x4c')];}}}; \ No newline at end of file +var _0xe04a=['accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','queuestatus','queuecallerexitAt','value','variable','queueposition','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','agentcomplete','membername','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfertype','BLIND','transfereeuniqueid','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','lodash','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','lastAssignedTo','calleridnum'];(function(_0x103d83,_0x31d755){var _0x2a0ecd=function(_0xf30445){while(--_0xf30445){_0x103d83['push'](_0x103d83['shift']());}};_0x2a0ecd(++_0x31d755);}(_0xe04a,0xef));var _0xae04=function(_0x1b17e4,_0x3493e4){_0x1b17e4=_0x1b17e4-0x0;var _0x4e26b8=_0xe04a[_0x1b17e4];return _0x4e26b8;};'use strict';var _=require(_0xae04('0x0'));var util=require(_0xae04('0x1'));var utils=require(_0xae04('0x2'));var queues={};function writeDB(_0x37a138){utils[_0xae04('0x3')](util[_0xae04('0x4')](_0xae04('0x5'),_0x37a138[_0xae04('0x6')],_0x37a138['channel'],_0x37a138[_0xae04('0x7')],_0x37a138[_0xae04('0x8')],_0x37a138[_0xae04('0x9')],_0x37a138[_0xae04('0xa')],_0x37a138[_0xae04('0xb')]));if(_0x37a138['queue']){utils[_0xae04('0xc')](_0x37a138[_0xae04('0x7')])[_0xae04('0xd')](function(_0x1849f3){if(_0x1849f3){_0x37a138['type']=_0x1849f3[_0xae04('0xe')];}utils[_0xae04('0xf')](_0xae04('0x10'),_0x37a138);});}else{utils[_0xae04('0xf')](_0xae04('0x10'),_0x37a138);}if(_0x37a138[_0xae04('0x11')]){delete queues[_0x37a138[_0xae04('0x11')]];}else{delete queues[_0x37a138['uniqueid']];}}exports[_0xae04('0x12')]=function(_0x330fcb){queues[_0x330fcb[_0xae04('0x6')]]=_['assign'](_0x330fcb,{'originalposition':_0x330fcb[_0xae04('0x13')],'queuecallerjoinAt':utils[_0xae04('0x14')](),'mohtime':0x0});};exports[_0xae04('0x15')]=function(_0x7f46fc){if(!_[_0xae04('0x16')](queues[_0x7f46fc[_0xae04('0x6')]])){if(queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x17')]){if(!queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x18')]&&!queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x19')]){queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x1a')]=!![];queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x1b')]=utils['now']();queues[_0x7f46fc['uniqueid']]['queuecallerexitreason']=_0xae04('0x1c');}writeDB(queues[_0x7f46fc[_0xae04('0x6')]]);}else{if(queues[_0x7f46fc['uniqueid']][_0xae04('0x11')]){queues[queues[_0x7f46fc[_0xae04('0x6')]][_0xae04('0x11')]]=queues[_0x7f46fc['uniqueid']];queues[queues[_0x7f46fc['uniqueid']]['transfereduniqueid']][_0xae04('0x1d')]=0x2;delete queues[_0x7f46fc['uniqueid']];}}}};exports[_0xae04('0x1e')]=function(_0x51aded){if(!_['isNil'](_0x51aded['variable'][_0xae04('0x1f')])){if(!_['isNil'](queues[_0x51aded[_0xae04('0x6')]])){queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x51aded[_0xae04('0x6')]]['queuecallerabandonAt']=null;queues[_0x51aded[_0xae04('0x6')]]['queuecallerexit']=!![];queues[_0x51aded['uniqueid']][_0xae04('0x20')]=utils[_0xae04('0x14')]();queues[_0x51aded['uniqueid']]['queuecallerexitreason']=_0x51aded[_0xae04('0x21')]['toUpperCase']();writeDB(queues[_0x51aded['uniqueid']]);}}else if(!_['isNil'](_0x51aded[_0xae04('0x22')][_0xae04('0x23')])){if(!_[_0xae04('0x16')](queues[_0x51aded[_0xae04('0x6')]])&&!queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x18')]){queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x51aded['uniqueid']][_0xae04('0x24')]=null;queues[_0x51aded['uniqueid']][_0xae04('0x19')]=!![];queues[_0x51aded[_0xae04('0x6')]][_0xae04('0x20')]=utils[_0xae04('0x14')]();queues[_0x51aded[_0xae04('0x6')]]['queuecallerexitreason']=_0xae04('0x25');}}};exports[_0xae04('0x18')]=function(_0xe4011a){if(!_[_0xae04('0x16')](queues[_0xe4011a[_0xae04('0x6')]])){queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x19')]=![];queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x20')]=null;queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x18')]=!![];queues[_0xe4011a[_0xae04('0x6')]][_0xae04('0x24')]=utils[_0xae04('0x14')]();queues[_0xe4011a['uniqueid']][_0xae04('0xb')]=_0xae04('0x26');}};exports[_0xae04('0x27')]=function(_0x5cebf1){if(!_['isNil'](queues[_0x5cebf1['uniqueid']])){queues[_0x5cebf1[_0xae04('0x6')]]['queuecallerleave']=!![];queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x17')]=utils[_0xae04('0x14')]();queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x28')]=utils[_0xae04('0x29')](queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x17')],queues[_0x5cebf1['uniqueid']]['queuecallerjoinAt']);queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x13')]=_0x5cebf1[_0xae04('0x13')];queues[_0x5cebf1[_0xae04('0x6')]]['count']=_0x5cebf1[_0xae04('0x2a')];queues[_0x5cebf1[_0xae04('0x6')]][_0xae04('0x2b')]=_0x5cebf1['connectedlinenum'];queues[_0x5cebf1['uniqueid']][_0xae04('0x2c')]=_0x5cebf1[_0xae04('0x2c')];}};exports[_0xae04('0x2d')]=function(_0x27e3b9){if(!_[_0xae04('0x16')](queues[_0x27e3b9[_0xae04('0x6')]])){queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x24')]=null;queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x19')]=![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x20')]=null;queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x2e')]=!![];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0xa')]=_0x27e3b9[_0xae04('0x2f')];queues[_0x27e3b9[_0xae04('0x6')]][_0xae04('0x8')]=_0x27e3b9['membername'];}};exports[_0xae04('0x30')]=function(_0x545659){if(!_[_0xae04('0x16')](queues[_0x545659[_0xae04('0x6')]])){if(queues[_0x545659['uniqueid']][_0xae04('0x17')]){queues[_0x545659[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x18')]=![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x24')]=null;queues[_0x545659[_0xae04('0x6')]][_0xae04('0x19')]=![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x20')]=null;queues[_0x545659[_0xae04('0x6')]][_0xae04('0x2e')]=!![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x8')]=_0x545659[_0xae04('0x31')];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x1a')]=!![];queues[_0x545659[_0xae04('0x6')]][_0xae04('0x1b')]=utils['now']();if(_0x545659[_0xae04('0x32')]==_0xae04('0x33')){if(!queues[_0x545659[_0xae04('0x6')]][_0xae04('0x33')]){queues[_0x545659[_0xae04('0x6')]][_0xae04('0xb')]=_0xae04('0x34');}}else{queues[_0x545659['uniqueid']][_0xae04('0xb')]=_0xae04('0x35')+_0x545659[_0xae04('0x32')]['toUpperCase']();}writeDB(queues[_0x545659[_0xae04('0x6')]]);}}};exports[_0xae04('0x36')]=function(_0xa332c4){if(!_[_0xae04('0x16')](queues[_0xa332c4['transfereeuniqueid']])){queues[_0xa332c4['transfereeuniqueid']][_0xae04('0x33')]=!![];queues[_0xa332c4['transfereeuniqueid']][_0xae04('0x37')]=_0xae04('0x38');queues[_0xa332c4[_0xae04('0x39')]][_0xae04('0x3a')]=_0xa332c4[_0xae04('0x3b')];queues[_0xa332c4['transfereeuniqueid']][_0xae04('0x3c')]=_0xa332c4[_0xae04('0x39')];queues[_0xa332c4[_0xae04('0x39')]]['queuecallerexitreason']=_0xae04('0x3d');}};exports[_0xae04('0x3e')]=function(_0x1dc48c){try{if(_0x1dc48c[_0xae04('0x3f')]==_0x1dc48c[_0xae04('0x40')]){if(!_[_0xae04('0x16')](queues[_0x1dc48c['secondtransfererlinkedid']])){queues[_0x1dc48c[_0xae04('0x41')]][_0xae04('0x33')]=!![];queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x37')]=_0xae04('0x42');queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x3a')]=_0x1dc48c[_0xae04('0x43')];queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x3c')]=_0x1dc48c[_0xae04('0x3f')];queues[_0x1dc48c[_0xae04('0x41')]][_0xae04('0xb')]=_0xae04('0x44');}if(!_[_0xae04('0x16')](queues[_0x1dc48c[_0xae04('0x40')]])){if(_0x1dc48c[_0xae04('0x45')]&&queues[_0x1dc48c[_0xae04('0x45')]]){queues[_0x1dc48c[_0xae04('0x45')]][_0xae04('0x1d')]=0x1;queues[_0x1dc48c[_0xae04('0x39')]]=_[_0xae04('0x46')](queues[_0x1dc48c[_0xae04('0x45')]]);queues[_0x1dc48c[_0xae04('0x39')]]['transfereduniqueid']=_0x1dc48c[_0xae04('0x47')];queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x1d')]=0x2;queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x9')]=queues[_0x1dc48c[_0xae04('0x41')]][_0xae04('0x9')];queues[_0x1dc48c['transfereeuniqueid']][_0xae04('0x48')]=queues[_0x1dc48c['secondtransfererlinkedid']]['calleridname'];queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x49')]=utils[_0xae04('0x14')]();queues[_0x1dc48c[_0xae04('0x39')]][_0xae04('0x17')]=utils[_0xae04('0x14')]();queues[_0x1dc48c['transfereeuniqueid']][_0xae04('0x28')]=0x0;queues[_0x1dc48c['transfereeuniqueid']]['mohtime']=0x0;}else{queues[_0x1dc48c[_0xae04('0x40')]]['transfereduniqueid']=_0x1dc48c['secondtransfererlinkedid'];}}}else if(_0x1dc48c[_0xae04('0x4a')]==_0x1dc48c['secondtransfererlinkedid']){if(!_[_0xae04('0x16')](queues[_0x1dc48c[_0xae04('0x40')]])){queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x33')]=!![];queues[_0x1dc48c[_0xae04('0x40')]]['transfertype']=_0xae04('0x42');queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x3a')]=_0x1dc48c[_0xae04('0x4b')];queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x3c')]=_0x1dc48c[_0xae04('0x4a')];queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xae04('0x16')](queues[_0x1dc48c['secondtransfererlinkedid']])){if(_0x1dc48c[_0xae04('0x4c')]&&queues[_0x1dc48c[_0xae04('0x4c')]]){queues[_0x1dc48c['transfertargetlinkedid']][_0xae04('0x1d')]=0x1;queues[_0x1dc48c['transfertargetuniqueid']]=_[_0xae04('0x46')](queues[_0x1dc48c['transfertargetlinkedid']]);queues[_0x1dc48c['transfertargetuniqueid']]['transfereduniqueid']=_0x1dc48c['transfertargetuniqueid'];queues[_0x1dc48c[_0xae04('0x47')]]['queuecallerenterreason']=0x2;queues[_0x1dc48c['transfertargetuniqueid']][_0xae04('0x9')]=queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x9')];queues[_0x1dc48c['transfertargetuniqueid']][_0xae04('0x48')]=queues[_0x1dc48c[_0xae04('0x40')]][_0xae04('0x48')];queues[_0x1dc48c[_0xae04('0x47')]][_0xae04('0x49')]=utils['now']();queues[_0x1dc48c['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0xae04('0x14')]();queues[_0x1dc48c[_0xae04('0x47')]][_0xae04('0x28')]=0x0;queues[_0x1dc48c[_0xae04('0x47')]]['mohtime']=0x0;}else{queues[_0x1dc48c['secondtransfererlinkedid']][_0xae04('0x11')]=_0x1dc48c['origtransfererlinkedid'];}}}}catch(_0x2252a3){utils[_0xae04('0x4d')](_0x2252a3[_0xae04('0x4e')]);}};exports[_0xae04('0x4f')]=function(_0x1c4993){if(!_['isNil'](queues[_0x1c4993[_0xae04('0x6')]])){queues[_0x1c4993[_0xae04('0x6')]][_0xae04('0x50')]=utils[_0xae04('0x14')]();}};exports[_0xae04('0x51')]=function(_0x441bbe){if(!_[_0xae04('0x16')](queues[_0x441bbe[_0xae04('0x6')]])){if(!_[_0xae04('0x16')](queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x50')])){queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x52')]+=utils['diffTime'](utils[_0xae04('0x14')](),queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x50')]);delete queues[_0x441bbe[_0xae04('0x6')]][_0xae04('0x50')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 1cc91dc..d60a12f 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 _0x34e8=['membername','name','UserId','CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','stack','newstate','isNil','channelstate','transfer','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','getUserByInternal','accountcode','then'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x34e8,0x12c));var _0x834e=function(_0x1497f0,_0x1364a2){_0x1497f0=_0x1497f0-0x0;var _0x1b79f7=_0x34e8[_0x1497f0];return _0x1b79f7;};'use strict';var _=require(_0x834e('0x0'));var utils=require(_0x834e('0x1'));var recordings={};function writeDB(_0x8b339){utils[_0x834e('0x2')](_0x8b339);if(_0x8b339['accountcode']){utils[_0x834e('0x3')](_0x8b339[_0x834e('0x4')])[_0x834e('0x5')](function(_0x31bf20){if(_0x31bf20){_0x8b339[_0x834e('0x6')]=_0x31bf20[_0x834e('0x7')];_0x8b339[_0x834e('0x8')]=_0x31bf20['id'];}utils['request'](_0x834e('0x9'),_0x8b339);});}else{utils['request'](_0x834e('0x9'),_0x8b339);}}exports[_0x834e('0xa')]=function(_0x3a3ef6){try{if(_0x3a3ef6[_0x834e('0xb')]==_0x3a3ef6[_0x834e('0xc')]){recordings[_0x3a3ef6[_0x834e('0xb')]]={'uniqueid':_0x3a3ef6[_0x834e('0xb')],'accountcode':_0x3a3ef6[_0x834e('0x4')],'exten':_0x3a3ef6[_0x834e('0xd')],'context':_0x3a3ef6[_0x834e('0xe')],'channel':_0x3a3ef6[_0x834e('0xf')],'monitors':[]};}}catch(_0x36e124){utils[_0x834e('0x10')](_0x36e124[_0x834e('0x11')]);}};exports[_0x834e('0x12')]=function(_0x1e00de){try{if(!_[_0x834e('0x13')](recordings[_0x1e00de['uniqueid']])&&_0x1e00de[_0x834e('0x14')]==0x6){}else if(!_[_0x834e('0x13')](recordings[_0x1e00de['linkedid']])&&_0x1e00de[_0x834e('0x14')]==0x6&&_0x1e00de[_0x834e('0xe')]!=_0x834e('0x15')){recordings[_0x1e00de[_0x834e('0xc')]]['accountcode']=_0x1e00de[_0x834e('0x4')];}}catch(_0x302cbd){utils['error'](_0x302cbd[_0x834e('0x11')]);}};exports['varset']=function(_0x38a8cd){try{if(!_[_0x834e('0x13')](_0x38a8cd['variable'])&&!_[_0x834e('0x13')](_0x38a8cd[_0x834e('0x16')][_0x834e('0x17')])){if(_['endsWith'](_0x38a8cd[_0x834e('0x18')],_0x834e('0x19'))){_0x38a8cd[_0x834e('0x18')]=_0x38a8cd[_0x834e('0x18')][_0x834e('0x1a')](_0x834e('0x19'),_0x834e('0x1b'));}if(recordings[_0x38a8cd['linkedid']]){var _0x2545b4=_[_0x834e('0x1c')](recordings[_0x38a8cd[_0x834e('0xc')]][_0x834e('0x1d')],{'value':_0x38a8cd['value']});if(_[_0x834e('0x13')](_0x2545b4)){recordings[_0x38a8cd[_0x834e('0xc')]]['monitors'][_0x834e('0x1e')]({'value':_0x38a8cd[_0x834e('0x18')]});}}}}catch(_0x8d406e){utils['error'](_0x8d406e['stack']);}};exports[_0x834e('0x1f')]=function(_0x34563b){try{if(!_['isNil'](recordings[_0x34563b[_0x834e('0xb')]])){recordings[_0x34563b[_0x834e('0xb')]]['calleridnum']=_0x34563b[_0x834e('0x20')];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x21')]=_0x34563b['calleridname'];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x22')]=_0x34563b['connectedlinenum'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]=_0x34563b['connectedlinename'];if(recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x24')]==_0x834e('0x25')&&recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x4')]){recordings[_0x34563b[_0x834e('0xb')]]['connectedlinenum']=recordings[_0x34563b['uniqueid']]['accountcode'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]='';}recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x1d')]['forEach'](_0xb5bc06=>{var _0x11f1ce=_[_0x834e('0x26')](recordings[_0x34563b[_0x834e('0xb')]]);_0x11f1ce[_0x834e('0x18')]=_0xb5bc06[_0x834e('0x18')];writeDB(_0x11f1ce);});delete recordings[_0x34563b[_0x834e('0xb')]];}}catch(_0xfaf716){utils[_0x834e('0x10')](_0xfaf716['stack']);}};exports[_0x834e('0x27')]=function(_0x5cad11){try{if(!_[_0x834e('0x13')](recordings[_0x5cad11[_0x834e('0xb')]])){if(_0x5cad11[_0x834e('0x28')][_0x834e('0x29')]()==_0x834e('0x2a')&&_[_0x834e('0x2b')](_0x5cad11[_0x834e('0x2c')][_0x834e('0x29')](),_0x834e('0x2d'))){var _0x12b2bc=_0x5cad11['appdata'][_0x834e('0x2e')]('=');var _0x2f408a=_0x12b2bc[0x0][_0x834e('0x2f')](_0x12b2bc[0x0][_0x834e('0x30')]('(')+0x1,_0x12b2bc[0x0]['lastIndexOf'](')'));var _0x3f88ad=_0x12b2bc[0x1];recordings[_0x5cad11[_0x834e('0xb')]][_0x2f408a]=_0x3f88ad;}}}catch(_0x4b12f5){utils['error'](_0x4b12f5['stack']);}};exports[_0x834e('0x31')]=function(_0x41bf4d){try{if(!_[_0x834e('0x13')](recordings[_0x41bf4d[_0x834e('0xb')]])){recordings[_0x41bf4d[_0x834e('0xb')]][_0x834e('0x32')]=_0x41bf4d['queue'];}}catch(_0x2c2d94){utils['error'](_0x2c2d94[_0x834e('0x11')]);}}; \ No newline at end of file +var _0x70e0=['.WAV','find','monitors','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','forEach','newexten','set','appdata','toLowerCase','split','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','accountcode','then','name','request','newchannel','uniqueid','linkedid','channel','error','stack','newstate','isNil','channelstate','transfer','variable','endsWith','value','.wav49'];(function(_0x4066f0,_0x5a9af0){var _0x35e6bb=function(_0x3f5c6c){while(--_0x3f5c6c){_0x4066f0['push'](_0x4066f0['shift']());}};_0x35e6bb(++_0x5a9af0);}(_0x70e0,0x17b));var _0x070e=function(_0x22f603,_0x15cae6){_0x22f603=_0x22f603-0x0;var _0x242d22=_0x70e0[_0x22f603];return _0x242d22;};'use strict';var _=require(_0x070e('0x0'));var utils=require(_0x070e('0x1'));var recordings={};function writeDB(_0x198c2e){utils['debug'](_0x198c2e);if(_0x198c2e['accountcode']){utils[_0x070e('0x2')](_0x198c2e[_0x070e('0x3')])[_0x070e('0x4')](function(_0x2593e5){if(_0x2593e5){_0x198c2e['membername']=_0x2593e5[_0x070e('0x5')];_0x198c2e['UserId']=_0x2593e5['id'];}utils[_0x070e('0x6')]('CreateVoiceRecording',_0x198c2e);});}else{utils['request']('CreateVoiceRecording',_0x198c2e);}}exports[_0x070e('0x7')]=function(_0x1e11f0){try{if(_0x1e11f0[_0x070e('0x8')]==_0x1e11f0[_0x070e('0x9')]){recordings[_0x1e11f0[_0x070e('0x8')]]={'uniqueid':_0x1e11f0[_0x070e('0x8')],'accountcode':_0x1e11f0[_0x070e('0x3')],'exten':_0x1e11f0['exten'],'context':_0x1e11f0['context'],'channel':_0x1e11f0[_0x070e('0xa')],'monitors':[]};}}catch(_0x2e3e5e){utils[_0x070e('0xb')](_0x2e3e5e[_0x070e('0xc')]);}};exports[_0x070e('0xd')]=function(_0xffcdd6){try{if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x8')]])&&_0xffcdd6[_0x070e('0xf')]==0x6){}else if(!_[_0x070e('0xe')](recordings[_0xffcdd6[_0x070e('0x9')]])&&_0xffcdd6['channelstate']==0x6&&_0xffcdd6['context']!=_0x070e('0x10')){recordings[_0xffcdd6['linkedid']]['accountcode']=_0xffcdd6['accountcode'];}}catch(_0x11d2ce){utils[_0x070e('0xb')](_0x11d2ce['stack']);}};exports['varset']=function(_0x373d86){try{if(!_[_0x070e('0xe')](_0x373d86[_0x070e('0x11')])&&!_[_0x070e('0xe')](_0x373d86['variable']['mixmonitor_filename'])){if(_[_0x070e('0x12')](_0x373d86[_0x070e('0x13')],_0x070e('0x14'))){_0x373d86[_0x070e('0x13')]=_0x373d86[_0x070e('0x13')]['replace'](_0x070e('0x14'),_0x070e('0x15'));}if(recordings[_0x373d86[_0x070e('0x9')]]){var _0x3ea105=_[_0x070e('0x16')](recordings[_0x373d86['linkedid']]['monitors'],{'value':_0x373d86['value']});if(_[_0x070e('0xe')](_0x3ea105)){recordings[_0x373d86[_0x070e('0x9')]][_0x070e('0x17')]['push']({'value':_0x373d86[_0x070e('0x13')]});}}}}catch(_0x5dc5d2){utils[_0x070e('0xb')](_0x5dc5d2[_0x070e('0xc')]);}};exports[_0x070e('0x18')]=function(_0x33e8c6){try{if(!_[_0x070e('0xe')](recordings[_0x33e8c6[_0x070e('0x8')]])){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x19')]=_0x33e8c6['calleridnum'];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1a')]=_0x33e8c6[_0x070e('0x1a')];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1b')]=_0x33e8c6['connectedlinenum'];recordings[_0x33e8c6['uniqueid']][_0x070e('0x1c')]=_0x33e8c6[_0x070e('0x1c')];if(recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1d')]==_0x070e('0x1e')&&recordings[_0x33e8c6['uniqueid']][_0x070e('0x3')]){recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1b')]=recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x3')];recordings[_0x33e8c6[_0x070e('0x8')]][_0x070e('0x1c')]='';}recordings[_0x33e8c6[_0x070e('0x8')]]['monitors'][_0x070e('0x1f')](_0x351641=>{var _0x3a16d0=_['clone'](recordings[_0x33e8c6['uniqueid']]);_0x3a16d0[_0x070e('0x13')]=_0x351641[_0x070e('0x13')];writeDB(_0x3a16d0);});delete recordings[_0x33e8c6[_0x070e('0x8')]];}}catch(_0x51402c){utils[_0x070e('0xb')](_0x51402c[_0x070e('0xc')]);}};exports[_0x070e('0x20')]=function(_0x5f2bee){try{if(!_['isNil'](recordings[_0x5f2bee['uniqueid']])){if(_0x5f2bee['application']['toLowerCase']()==_0x070e('0x21')&&_['startsWith'](_0x5f2bee[_0x070e('0x22')][_0x070e('0x23')](),'cdr')){var _0x47a739=_0x5f2bee[_0x070e('0x22')][_0x070e('0x24')]('=');var _0x55288a=_0x47a739[0x0]['substring'](_0x47a739[0x0][_0x070e('0x25')]('(')+0x1,_0x47a739[0x0][_0x070e('0x25')](')'));var _0x444d02=_0x47a739[0x1];recordings[_0x5f2bee[_0x070e('0x8')]][_0x55288a]=_0x444d02;}}}catch(_0x18f0ad){utils['error'](_0x18f0ad['stack']);}};exports[_0x070e('0x26')]=function(_0x3011c4){try{if(!_[_0x070e('0xe')](recordings[_0x3011c4[_0x070e('0x8')]])){recordings[_0x3011c4[_0x070e('0x8')]]['queue']=_0x3011c4[_0x070e('0x27')];}}catch(_0x1927f4){utils['error'](_0x1927f4[_0x070e('0xc')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 42009ca..477906a 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 _0x0fa8=['error','stack','attendedtransfer','assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','info','format','type','request','CreateVoiceTransferReport','blind'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x0fa8,0x1f1));var _0x80fa=function(_0x50972d,_0x1376a9){_0x50972d=_0x50972d-0x0;var _0x334bb8=_0x0fa8[_0x50972d];return _0x334bb8;};'use strict';var _=require(_0x80fa('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x43d0e9){utils[_0x80fa('0x1')](util[_0x80fa('0x2')]('TRANSFER|%s',_0x43d0e9[_0x80fa('0x3')]));utils[_0x80fa('0x4')](_0x80fa('0x5'),_0x43d0e9);}exports['blindtransfer']=function(_0x1ebcf6){try{_0x1ebcf6[_0x80fa('0x3')]=_0x80fa('0x6');writeDB(_0x1ebcf6);}catch(_0x297666){utils[_0x80fa('0x7')](_0x297666[_0x80fa('0x8')]);}};exports[_0x80fa('0x9')]=function(_0x2eef5f){try{_0x2eef5f=_[_0x80fa('0xa')](_0x2eef5f,{'transfererchannel':_0x2eef5f[_0x80fa('0xb')],'transferercalleridnum':_0x2eef5f['origtransferercalleridnum'],'transferercalleridname':_0x2eef5f[_0x80fa('0xc')],'transfererconnectedlinenum':_0x2eef5f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2eef5f[_0x80fa('0xd')],'transfereraccountcode':_0x2eef5f['origtransfereraccountcode'],'transferercontext':_0x2eef5f[_0x80fa('0xe')],'transfererexten':_0x2eef5f['secondtransfererexten'],'transfererlinkedid':_0x2eef5f[_0x80fa('0xf')],'context':_0x2eef5f[_0x80fa('0x10')],'extension':_0x2eef5f[_0x80fa('0x11')],'type':_0x80fa('0x12')});if(_[_0x80fa('0x13')](_0x2eef5f[_0x80fa('0x14')])){_0x2eef5f=_['assign'](_0x2eef5f,{'transfereechannel':_0x2eef5f[_0x80fa('0x15')],'transfereecalleridnum':_0x2eef5f[_0x80fa('0x16')],'transfereecalleridname':_0x2eef5f[_0x80fa('0x17')],'transfereeconnectedlinenum':_0x2eef5f['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2eef5f[_0x80fa('0x18')],'transfereeaccountcode':_0x2eef5f['transfertargetaccountcode'],'transfereecontext':_0x2eef5f[_0x80fa('0x19')],'transfereeexten':_0x2eef5f[_0x80fa('0x1a')],'transfereelinkedid':_0x2eef5f[_0x80fa('0x1b')]});}writeDB(_0x2eef5f);}catch(_0x29a572){utils[_0x80fa('0x7')](_0x29a572['stack']);}}; \ No newline at end of file +var _0xddf7=['transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','error','attendedtransfer','assign','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename'];(function(_0x549610,_0x2a23a7){var _0x44d899=function(_0x4c2272){while(--_0x4c2272){_0x549610['push'](_0x549610['shift']());}};_0x44d899(++_0x2a23a7);}(_0xddf7,0x184));var _0x7ddf=function(_0x2f52ad,_0x1778f5){_0x2f52ad=_0x2f52ad-0x0;var _0x10ea07=_0xddf7[_0x2f52ad];return _0x10ea07;};'use strict';var _=require(_0x7ddf('0x0'));var util=require(_0x7ddf('0x1'));var utils=require(_0x7ddf('0x2'));function writeDB(_0x4b25c3){utils[_0x7ddf('0x3')](util[_0x7ddf('0x4')](_0x7ddf('0x5'),_0x4b25c3[_0x7ddf('0x6')]));utils[_0x7ddf('0x7')](_0x7ddf('0x8'),_0x4b25c3);}exports[_0x7ddf('0x9')]=function(_0xc3d96e){try{_0xc3d96e['type']='blind';writeDB(_0xc3d96e);}catch(_0x22075e){utils[_0x7ddf('0xa')](_0x22075e['stack']);}};exports[_0x7ddf('0xb')]=function(_0x207224){try{_0x207224=_[_0x7ddf('0xc')](_0x207224,{'transfererchannel':_0x207224[_0x7ddf('0xd')],'transferercalleridnum':_0x207224[_0x7ddf('0xe')],'transferercalleridname':_0x207224['origtransferercalleridname'],'transfererconnectedlinenum':_0x207224[_0x7ddf('0xf')],'transfererconnectedlinename':_0x207224[_0x7ddf('0x10')],'transfereraccountcode':_0x207224[_0x7ddf('0x11')],'transferercontext':_0x207224['secondtransferercontext'],'transfererexten':_0x207224[_0x7ddf('0x12')],'transfererlinkedid':_0x207224[_0x7ddf('0x13')],'context':_0x207224[_0x7ddf('0x14')],'extension':_0x207224['origtransfererexten'],'type':'attended'});if(_[_0x7ddf('0x15')](_0x207224[_0x7ddf('0x16')])){_0x207224=_[_0x7ddf('0xc')](_0x207224,{'transfereechannel':_0x207224[_0x7ddf('0x17')],'transfereecalleridnum':_0x207224[_0x7ddf('0x18')],'transfereecalleridname':_0x207224[_0x7ddf('0x19')],'transfereeconnectedlinenum':_0x207224[_0x7ddf('0x1a')],'transfereeconnectedlinename':_0x207224[_0x7ddf('0x1b')],'transfereeaccountcode':_0x207224[_0x7ddf('0x1c')],'transfereecontext':_0x207224[_0x7ddf('0x1d')],'transfereeexten':_0x207224[_0x7ddf('0x1e')],'transfereelinkedid':_0x207224[_0x7ddf('0x1f')]});}writeDB(_0x207224);}catch(_0x34ae4a){utils[_0x7ddf('0xa')](_0x34ae4a['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index fd098c9..76a5074 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 _0x42e3=['getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','now','isBefore','moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','GetUser','name','interface','GETUSER|','result','length','FOUND','NOTFOUND','catch'];(function(_0x2dd46e,_0x1314c0){var _0x4ec8e3=function(_0x4a2259){while(--_0x4a2259){_0x2dd46e['push'](_0x2dd46e['shift']());}};_0x4ec8e3(++_0x1314c0);}(_0x42e3,0xed));var _0x342e=function(_0x30dac6,_0x33e7ba){_0x30dac6=_0x30dac6-0x0;var _0xc526de=_0x42e3[_0x30dac6];return _0xc526de;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x342e('0x0'));var BPromise=require(_0x342e('0x1'));var client=jayson[_0x342e('0x2')][_0x342e('0x3')]({'port':0x2329});var logger=require(_0x342e('0x4'))(_0x342e('0x5'));exports['info']=function(_0x1bebb4){logger[_0x342e('0x6')](_0x1bebb4);};exports[_0x342e('0x7')]=function(_0x5bdca0){logger['debug'](JSON[_0x342e('0x8')](_0x5bdca0));};exports[_0x342e('0x9')]=function(_0x135844){logger[_0x342e('0x9')](_0x135844[_0x342e('0xa')]);};exports[_0x342e('0xb')]=function(_0x1f123c,_0x4e137b){return client[_0x342e('0xb')](_0x1f123c,{'body':_0x4e137b})[_0x342e('0xc')](function(_0x3c595e){logger[_0x342e('0x7')](JSON[_0x342e('0x8')](_0x3c595e));})['catch'](function(_0x16ddc9){logger['error'](_0x16ddc9[_0x342e('0xa')]);});};function getUser(_0x1ad361){return client[_0x342e('0xb')](_0x342e('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0x342e('0xe'),_0x342e('0xf')],'where':_0x1ad361,'limit':0x1}})[_0x342e('0xc')](function(_0xda4316){logger[_0x342e('0x6')](_0x342e('0x10')+JSON[_0x342e('0x8')](_0x1ad361)+'|'+(_0xda4316[_0x342e('0x11')][_0x342e('0x12')]?_0x342e('0x13'):_0x342e('0x14')));return _0xda4316['result'][_0x342e('0x12')]?_0xda4316[_0x342e('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x1b5fff){return new BPromise(function(_0x117d55,_0x5959a1){if(_0x1b5fff){return getUser({'internal':_0x1b5fff})[_0x342e('0xc')](function(_0x3f23b2){return _0x117d55(_0x3f23b2);})[_0x342e('0x15')](function(_0xcf42cc){logger[_0x342e('0x9')](_0xcf42cc['stack']);return _0x117d55(null);});}else{return _0x117d55(null);}});};exports['getUserByInterface']=function(_0x5db356){return new BPromise(function(_0xe63655,_0x388d05){if(_0x5db356){return getUser({'interface':_0x5db356})[_0x342e('0xc')](function(_0x4b59d1){return _0xe63655(_0x4b59d1);})[_0x342e('0x15')](function(_0x34e66c){logger[_0x342e('0x9')](_0x34e66c[_0x342e('0xa')]);return _0xe63655(null);});}else{return _0xe63655(null);}});};exports[_0x342e('0x16')]=function(_0x573ddb){return new BPromise(function(_0x2270dc,_0x7bb877){if(_0x573ddb){return getUser({'name':_0x573ddb})['then'](function(_0x4fbf17){return _0x2270dc(_0x4fbf17);})[_0x342e('0x15')](function(_0x364bfb){logger['error'](_0x364bfb[_0x342e('0xa')]);return _0x2270dc(null);});}else{return _0x2270dc(null);}});};exports[_0x342e('0x17')]=function(_0x4dc274){return new BPromise(function(_0x10e265,_0x2e79c2){if(_0x4dc274){return client[_0x342e('0xb')](_0x342e('0x18'),{'options':{'raw':!![],'attributes':['id','name',_0x342e('0x19'),_0x342e('0x1a'),_0x342e('0x1b')],'where':{'name':_0x4dc274},'limit':0x1}})[_0x342e('0xc')](function(_0x397d90){logger[_0x342e('0x6')](_0x342e('0x1c')+_0x4dc274+'|'+(_0x397d90[_0x342e('0x11')][_0x342e('0x12')]?_0x342e('0x13'):'NOTFOUND'));return _0x10e265(_0x397d90[_0x342e('0x11')][_0x342e('0x12')]?_0x397d90[_0x342e('0x11')][0x0]:null);})[_0x342e('0x15')](function(_0x2ce91a){logger[_0x342e('0x9')](_0x2ce91a[_0x342e('0xa')]);return _0x10e265(null);});}else{return _0x10e265(null);}});};exports[_0x342e('0x1d')]=function(_0x280dcf,_0x3b1831){return moment(_0x280dcf)[_0x342e('0x1e')](_0x3b1831,_0x342e('0x1f'))[_0x342e('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x342e('0x21')]=function(_0x850f4d,_0x2ebace){return moment(_0x850f4d)['subtract'](_0x2ebace,_0x342e('0x1f'))['format'](_0x342e('0x22'));};exports['diffTime']=function(_0x179a5c,_0x2a8b6d){return moment(_0x179a5c)['diff'](moment(_0x2a8b6d),'seconds');};exports['sumTime']=function(_0x3fbc19,_0x2ef39d){return parseInt(_0x3fbc19,0xa)+parseInt(_0x2ef39d,0xa);};exports[_0x342e('0x23')]=function(){return moment()[_0x342e('0x20')](_0x342e('0x22'));};exports['isAfter']=function(_0x28b66d,_0x438a77){if(_0x438a77){return moment(_0x28b66d)['isAfter'](_0x438a77);}else{return!![];}};exports[_0x342e('0x24')]=function(_0x43eda8,_0x203974){if(_0x203974){return moment(_0x43eda8)[_0x342e('0x24')](_0x203974);}else if(_0x43eda8){return!![];}else{return![];}}; \ No newline at end of file +var _0x5a0e=['moment','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','error','stack','request','then','catch','GetUser','name','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore'];(function(_0xe99866,_0x2713a8){var _0xc8c671=function(_0x1a511e){while(--_0x1a511e){_0xe99866['push'](_0xe99866['shift']());}};_0xc8c671(++_0x2713a8);}(_0x5a0e,0x102));var _0xe5a0=function(_0x9105f4,_0x3bf6f7){_0x9105f4=_0x9105f4-0x0;var _0x57a818=_0x5a0e[_0x9105f4];return _0x57a818;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xe5a0('0x0'));var BPromise=require(_0xe5a0('0x1'));var client=jayson[_0xe5a0('0x2')][_0xe5a0('0x3')]({'port':0x2329});var logger=require(_0xe5a0('0x4'))(_0xe5a0('0x5'));exports[_0xe5a0('0x6')]=function(_0x49073e){logger[_0xe5a0('0x6')](_0x49073e);};exports[_0xe5a0('0x7')]=function(_0x2aa71b){logger['debug'](JSON[_0xe5a0('0x8')](_0x2aa71b));};exports['error']=function(_0x40bcff){logger[_0xe5a0('0x9')](_0x40bcff[_0xe5a0('0xa')]);};exports['request']=function(_0x36b592,_0x2c0e3d){return client[_0xe5a0('0xb')](_0x36b592,{'body':_0x2c0e3d})[_0xe5a0('0xc')](function(_0x4516b3){logger[_0xe5a0('0x7')](JSON['stringify'](_0x4516b3));})[_0xe5a0('0xd')](function(_0x312213){logger[_0xe5a0('0x9')](_0x312213[_0xe5a0('0xa')]);});};function getUser(_0x24e0a0){return client[_0xe5a0('0xb')](_0xe5a0('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0xe5a0('0xf'),_0xe5a0('0x10')],'where':_0x24e0a0,'limit':0x1}})['then'](function(_0x43e44b){logger[_0xe5a0('0x6')](_0xe5a0('0x11')+JSON[_0xe5a0('0x8')](_0x24e0a0)+'|'+(_0x43e44b[_0xe5a0('0x12')][_0xe5a0('0x13')]?_0xe5a0('0x14'):_0xe5a0('0x15')));return _0x43e44b['result']['length']?_0x43e44b[_0xe5a0('0x12')][0x0]:null;});}exports[_0xe5a0('0x16')]=function(_0x4b0414){return new BPromise(function(_0x3beadf,_0x226217){if(_0x4b0414){return getUser({'internal':_0x4b0414})['then'](function(_0x1e6f55){return _0x3beadf(_0x1e6f55);})[_0xe5a0('0xd')](function(_0x5c0786){logger[_0xe5a0('0x9')](_0x5c0786[_0xe5a0('0xa')]);return _0x3beadf(null);});}else{return _0x3beadf(null);}});};exports[_0xe5a0('0x17')]=function(_0x2f8a1a){return new BPromise(function(_0x340393,_0x4f1c5a){if(_0x2f8a1a){return getUser({'interface':_0x2f8a1a})[_0xe5a0('0xc')](function(_0xee7da2){return _0x340393(_0xee7da2);})['catch'](function(_0x5d8b66){logger[_0xe5a0('0x9')](_0x5d8b66[_0xe5a0('0xa')]);return _0x340393(null);});}else{return _0x340393(null);}});};exports[_0xe5a0('0x18')]=function(_0x324161){return new BPromise(function(_0x19bcc3,_0x3c0a84){if(_0x324161){return getUser({'name':_0x324161})[_0xe5a0('0xc')](function(_0x7ead4d){return _0x19bcc3(_0x7ead4d);})[_0xe5a0('0xd')](function(_0x5268db){logger['error'](_0x5268db[_0xe5a0('0xa')]);return _0x19bcc3(null);});}else{return _0x19bcc3(null);}});};exports[_0xe5a0('0x19')]=function(_0x5566e0){return new BPromise(function(_0x132959,_0x2db9a8){if(_0x5566e0){return client[_0xe5a0('0xb')](_0xe5a0('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xe5a0('0xf'),'type',_0xe5a0('0x1b'),_0xe5a0('0x1c')],'where':{'name':_0x5566e0},'limit':0x1}})[_0xe5a0('0xc')](function(_0x10c5d0){logger['info'](_0xe5a0('0x1d')+_0x5566e0+'|'+(_0x10c5d0[_0xe5a0('0x12')][_0xe5a0('0x13')]?'FOUND':_0xe5a0('0x15')));return _0x132959(_0x10c5d0['result']['length']?_0x10c5d0[_0xe5a0('0x12')][0x0]:null);})[_0xe5a0('0xd')](function(_0x5d33d3){logger[_0xe5a0('0x9')](_0x5d33d3['stack']);return _0x132959(null);});}else{return _0x132959(null);}});};exports[_0xe5a0('0x1e')]=function(_0x3683b6,_0x5e3627){return moment(_0x3683b6)[_0xe5a0('0x1f')](_0x5e3627,_0xe5a0('0x20'))[_0xe5a0('0x21')](_0xe5a0('0x22'));};exports[_0xe5a0('0x23')]=function(_0x3a5487,_0x1af866){return moment(_0x3a5487)[_0xe5a0('0x24')](_0x1af866,_0xe5a0('0x20'))[_0xe5a0('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xe5a0('0x25')]=function(_0x528732,_0x22d68f){return moment(_0x528732)[_0xe5a0('0x26')](moment(_0x22d68f),_0xe5a0('0x20'));};exports[_0xe5a0('0x27')]=function(_0x403436,_0x35587d){return parseInt(_0x403436,0xa)+parseInt(_0x35587d,0xa);};exports[_0xe5a0('0x28')]=function(){return moment()[_0xe5a0('0x21')](_0xe5a0('0x22'));};exports[_0xe5a0('0x29')]=function(_0x1de507,_0x4267f8){if(_0x4267f8){return moment(_0x1de507)['isAfter'](_0x4267f8);}else{return!![];}};exports[_0xe5a0('0x2a')]=function(_0xdcb38a,_0x3ebd3d){if(_0x3ebd3d){return moment(_0xdcb38a)[_0xe5a0('0x2a')](_0x3ebd3d);}else if(_0xdcb38a){return!![];}else{return![];}}; \ No newline at end of file diff --git a/snippet/1.0.14/styles/custom.css b/snippet/1.0.14/styles/custom.css new file mode 100644 index 0000000..d4d71eb --- /dev/null +++ b/snippet/1.0.14/styles/custom.css @@ -0,0 +1,396 @@ +.emojionearea { + + width: 100%; +} + +#chat-app { + height: auto; + width: 295px; + background-color: transparent +} + +#chat-app .header-button { + padding: 0; + margin: 0; + font-size: 18px; + cursor: pointer +} + +#chat-app .chat-toolbar { + top: 0; + min-height: 50px; + width: 275px; + position: fixed; + cursor: pointer; + outline: 0 +} + +#chat-app .chat-content { + top: 56px; + bottom: 0; + height: auto; + background: #fff; + border: 1px solid #d3d3d3; + -ms-overflow-style: none; + overflow: auto +} + +#chat-app .chat-content .chat-messages { + height: 342px; + overflow: auto; + border-bottom: 1px solid #d3d3d3 +} + +#chat-app .chat-content .chat-online { + height: 392px; + padding: 20px +} + +#chat-app .chat-content .chat-unmanaged { + height: 392px; + padding: 20px +} + +#chat-app .avatar-wrapper { + position: relative; + bottom: -3px; + right: 5px +} + +#chat-app .chat-content .message-row .bubble { + word-wrap: break-word; + position: relative; + max-width: 268px; + padding: 6px 7px 8px 9px; + background-color: #fff; + /* box-shadow: 0 1px .5px rgba(0, 0, 0, .13); */ + border-radius: 6px +} + +#chat-app .chat-content .message-row .bubble .message { + white-space: pre-wrap +} + +#chat-app .chat-content .message-row .bubble .message-done { + color: #dcdcdc +} + +#chat-app .chat-content .message-row .bubble .message-done-all { + color: #00bfff +} + +#chat-app .chat-content .message-row .bubble:before { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAADGUExURQAAAP////b29vn5+f///wAAAP///wAAAAAAAP///9ra2v////j4+PHx8fv7++Hh4fHx8f////////////////39/QAAAP////////z8/P////39/f39/fz8/P////////////z8/P////////////z8/P////////////v7+/Hx8f///9bW1vz8/K2trf////39/f39/WJiYgAAAExMTFtbWwAAAN3d3cjIyPr6+vX19QAAAO7u7vz8/NTU1Ofn5zMzM////zGPlXsAAABBdFJOUwAcm/kREh4CCDWL1SneR6TfAQffhMYK/A5nRrLWfRc5DW2ih5f+19Kn+9v4g/1LCJuXHwQUKgahcXS6DNnlDMMKKzPoTgAAAKBJREFUKM+V08USwmAQA+C/0NIWd3d3d8/7vxTMcIPkQK7f7CG7s8bQAOY/SCuwFYQU1P+eiCqIK2gpWCmoCrAgoKQgJ8CHgIqAMjg0MxxSQ3DogEMWFBZtUPAHYGB1CyDQWE6AH7BrfXzlAxGAQhECTGAmwN1Okz0Gb/LW4fEItIfrOfNELMh3tck7u+PhcT2zQ7l77/K8iY8yJwV3BeYFqpc/uSyPGdAAAAAASUVORK5CYII=); + content: ''; + position: absolute; + left: -11px; + bottom: 3px; + width: 12px; + height: 19px; + background-position: 50% 50%; + background-repeat: no-repeat; + background-size: contain +} + +#chat-app .chat-content .message-row .bubble .time { + font-size: 10px; + text-align: right; + margin-bottom: 5px +} + +#chat-app .chat-content .message-row.out .avatar { + margin: 0 16px 0 0; + width: 40px; + min-width: 40px; + height: 40px; + line-height: 40px; + border-radius: 50%; + font-weight: 500; + text-align: center; + color: #fff +} + +#chat-app .chat-content .message-row.auto { + align-items: flex-end; + font-style: italic +} + +#chat-app .chat-content .message-row.auto .avatar { + margin: 0 16px 0 0; + width: 40px; + min-width: 40px; + height: 40px; + line-height: 40px; + border-radius: 50%; + font-size: 17px; + font-style: italic; + font-weight: 500; + text-align: center; + color: #fff +} + +#chat-app .chat-content .message-row.in { + align-items: flex-end +} + +#chat-app .chat-content .message-row.in2 { + align-items: flex-end +} + +#chat-app .chat-content .message-row.out { + align-items: flex-end +} + +#chat-app .chat-content .message-row.in2 .avatar { + margin: 0 16px 0 0; + width: 40px; + min-width: 40px; + height: 40px; + line-height: 40px; + border-radius: 50%; + font-weight: 500; + text-align: center; + color: #fff +} + +#chat-app .chat-content .message-row.in2 .bubble { + margin-right: auto; + background-color: #e8f5e9; + border: 1px solid #dfebe0; + order: 1 +} + +#chat-app .chat-content .message-row.in2 .bubble:before { + left: -11px; + right: auto; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=); + -webkit-transform: rotate(180deg); + transform: rotate(180deg) +} + +#chat-app .chat-content .message-row.in .avatar { + order: 2; + margin: 0 0 0 16px; + width: 40px; + min-width: 40px; + height: 40px; + line-height: 40px; + border-radius: 50%; + font-weight: 500; + text-align: center; + color: #fff +} + +#chat-app .chat-content .message-row.in .bubble { + margin-left: auto; + background-color: #e8f5e9; + border: 1px solid #dfebe0; + order: 1 +} + +#chat-app .chat-content .message-row.in .bubble:before { + right: -11px; + left: auto; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAmCAMAAADp2asXAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAD2UExURQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRsXAAAANzwzNPmxNrtyau5oIWRedDkwNntyczgwdfpyJ+/n97wzsLWtNjsytvwzczfvtPmxau6nNjqxtrtyio1KtzwzNjryAAAANzwzgAAANzwzK7Aor/Us9Lnw8vevAAAAMzevtbpxrvMrX+IdwAAAEROOi45Lr3MrZGjf9LoxX+MctnqydLkwhgYGMzfv9vuyQAAANzwzNvuy9zxy7vMu7XGqNvtzKKykwAAANruzKq6nLnMriQkGMXXuL3PsNjsySgzKAAAANLkw83fvd3vy9z4xtzwzRpFmIEAAABQdFJOUwAXChEGBAMBAgwhDvJ7k0YqMc0Zmwj6apf2kjU0+dkw/swh/CP9j2Wr2gndvaYeBRoxQg6gUPt/FaHJGdTj9A9k7XQLeE6iFcN12xkSt9r4NKizowAAAMFJREFUKM+V0sdywlAMBVDbMX7PQCihQ+iQ0HsJvfem/P/PwBIzugu0PXNnNNJVyPmhsIPhhoB2COwIGuLdhAcl3AhCBoBoHUC6BCBbA0C/EkBFB5D/FjxQwQYg1RI8UKINgDoSAPUlAPqUAMgfAEBfXsEDBV0+Hogi4Zhg4THj9YwHoqEBYOrgYTI3GVgMNn8r+Qq94k9yZNosW/3Hy9VuTjWfHkOX6367bGZUU7de66ieHZrO1OGg8Z1WTgYAFLgD5S1PCkzo1B0AAAAASUVORK5CYII=) +} + +#chat-app .chat-footer { + width: 100%; + top: -100px !important; +} + +#waiting { + overflow: visible; + height: 392px; + background: #fff; + text-align: center; + flex: 1 0 auto; + padding: 32px +} + +#waiting .subtitle { + margin: 16px 0; + max-width: 300px; + color: rgba(0, 0, 0, .54) +} + +.sk-fading-circle { + width: 40px; + height: 40px; + position: relative +} + +.sk-fading-circle .sk-circle { + width: 100%; + height: 100%; + position: absolute; + left: 0; + top: 0 +} + +.sk-fading-circle .sk-circle:before { + content: ''; + display: block; + margin: 0 auto; + width: 15%; + height: 15%; + background-color: #333; + border-radius: 100%; + -webkit-animation: sk-circleFadeDelay 1.2s infinite ease-in-out both; + animation: sk-circleFadeDelay 1.2s infinite ease-in-out both +} + +.sk-fading-circle .sk-circle2 { + -webkit-transform: rotate(30deg); + -ms-transform: rotate(30deg); + transform: rotate(30deg) +} + +.sk-fading-circle .sk-circle3 { + -webkit-transform: rotate(60deg); + -ms-transform: rotate(60deg); + transform: rotate(60deg) +} + +.sk-fading-circle .sk-circle4 { + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg) +} + +.sk-fading-circle .sk-circle5 { + -webkit-transform: rotate(120deg); + -ms-transform: rotate(120deg); + transform: rotate(120deg) +} + +.sk-fading-circle .sk-circle6 { + -webkit-transform: rotate(150deg); + -ms-transform: rotate(150deg); + transform: rotate(150deg) +} + +.sk-fading-circle .sk-circle7 { + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg) +} + +.sk-fading-circle .sk-circle8 { + -webkit-transform: rotate(210deg); + -ms-transform: rotate(210deg); + transform: rotate(210deg) +} + +.sk-fading-circle .sk-circle9 { + -webkit-transform: rotate(240deg); + -ms-transform: rotate(240deg); + transform: rotate(240deg) +} + +.sk-fading-circle .sk-circle10 { + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg) +} + +.sk-fading-circle .sk-circle11 { + -webkit-transform: rotate(300deg); + -ms-transform: rotate(300deg); + transform: rotate(300deg) +} + +.sk-fading-circle .sk-circle12 { + -webkit-transform: rotate(330deg); + -ms-transform: rotate(330deg); + transform: rotate(330deg) +} + +.sk-fading-circle .sk-circle2:before { + -webkit-animation-delay: -1.1s; + animation-delay: -1.1s +} + +.sk-fading-circle .sk-circle3:before { + -webkit-animation-delay: -1s; + animation-delay: -1s +} + +.sk-fading-circle .sk-circle4:before { + -webkit-animation-delay: -.9s; + animation-delay: -.9s +} + +.sk-fading-circle .sk-circle5:before { + -webkit-animation-delay: -.8s; + animation-delay: -.8s +} + +.sk-fading-circle .sk-circle6:before { + -webkit-animation-delay: -.7s; + animation-delay: -.7s +} + +.sk-fading-circle .sk-circle7:before { + -webkit-animation-delay: -.6s; + animation-delay: -.6s +} + +.sk-fading-circle .sk-circle8:before { + -webkit-animation-delay: -.5s; + animation-delay: -.5s +} + +.sk-fading-circle .sk-circle9:before { + -webkit-animation-delay: -.4s; + animation-delay: -.4s +} + +.sk-fading-circle .sk-circle10:before { + -webkit-animation-delay: -.3s; + animation-delay: -.3s +} + +.sk-fading-circle .sk-circle11:before { + -webkit-animation-delay: -.2s; + animation-delay: -.2s +} + +.sk-fading-circle .sk-circle12:before { + -webkit-animation-delay: -.1s; + animation-delay: -.1s +} + +@-webkit-keyframes sk-circleFadeDelay { + + 0%, + 100%, + 39% { + opacity: 0 + } + + 40% { + opacity: 1 + } +} + +@keyframes sk-circleFadeDelay { + + 0%, + 100%, + 39% { + opacity: 0 + } + + 40% { + opacity: 1 + } +} + +md-toast.md-success-toast .md-toast-content { + background-color: green +} + +md-toast.md-failure-toast .md-toast-content { + background-color: red +} \ No newline at end of file diff --git a/snippet/1.0.14/styles/mobile.css b/snippet/1.0.14/styles/mobile.css new file mode 100644 index 0000000..ce8f1ec --- /dev/null +++ b/snippet/1.0.14/styles/mobile.css @@ -0,0 +1,140 @@ +/* IFRAME GENERALE*/ +iframe[id='motion-chat-iframe'] { + /* Style attributes*/ + + position: fixed; + height: 450px; + border: 0; + /* box-shadow: 0px 0px 10px 2px #333333; */ + -webkit-transition: all 0.7s ease-out; + -moz-transition: all 0.7s ease-out; + -ms-transition: all 0.7s ease-out; + -o-transition: all 0.7s ease-out; + transition: all 0.7s ease-out; + z-index: 9999; + /* overflow: hidden; */ + +} + +/* IFRAME BASSO-DESTRA*/ +.motion-chat-iframe-bottom_right { + /* Style attributes*/ + + width: 295px; + bottom: -400px; + right: 0; + +} + +/* IFRAME DESTRA*/ +.motion-chat-iframe-right { + /* Style attributes*/ + + width: 295px; + right: -312px; + +} + +/* LINGUETTA DESTRA*/ +.motion-chat-div-right { + /* Style attributes*/ + + display: none; + right: 0px; + position: fixed; + cursor: pointer; + height: 100px; + width: 25px; + -webkit-transition: all 0.7s ease-out; + -moz-transition: all 0.7s ease-out; + -ms-transition: all 0.7s ease-out; + -o-transition: all 0.7s ease-out; + transition: all 0.7s ease-out; + z-index: 9999; + +} + +/* IFRAME SINISTRA*/ +.motion-chat-iframe-left { + /* Style attributes*/ + + width: 295px; + left: -297px; + +} + +/* LINGUETTA SINISTRA*/ +.motion-chat-div-left { + /* Style attributes*/ + + left: 0px; + display: none; + position: fixed; + cursor: pointer; + height: 100px; + width: 25px; + -webkit-transition: all 0.7s ease-out; + -moz-transition: all 0.7s ease-out; + -ms-transition: all 0.7s ease-out; + -o-transition: all 0.7s ease-out; + transition: all 0.7s ease-out; + z-index: 9999; + +} + +@media only screen and (max-width: 320px) { + + /* IFRAME BASSO-DESTRA*/ + .motion-chat-iframe-right { + /* Style attributes*/ + + width: 295px; + bottom: 0px; + right: 0; + + } + + /* IFRAME BASSO-DESTRA*/ + .motion-chat-iframe-left { + /* Style attributes*/ + + width: 295px; + bottom: 0px; + right: 0; + + } + +} + +@media only screen and (max-height: 450px) { + + /* IFRAME BASSO-DESTRA*/ + iframe[id='motion-chat-iframe'] { + /* Style attributes*/ + height: 100% !important; + + } + + .motion-chat-iframe-right { + /* Style attributes*/ + + top: 0px !important; + + } + + /* IFRAME BASSO-DESTRA*/ + .motion-chat-iframe-left { + /* Style attributes*/ + + top: 0px !important; + + } + + div[id='motion-chat-iframe-tab'] { + /* Style attributes*/ + + top: auto !important; + bottom: 0px !important; + + } +} \ No newline at end of file -- 1.7.1